mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
Water breathing potion
This commit is contained in:
parent
6735234bf4
commit
275a1e3f60
@ -40,7 +40,7 @@ class Effect{
|
||||
const REGENERATION = 10;
|
||||
//TODO: const DAMAGE_RESISTANCE = 11;
|
||||
const FIRE_RESISTANCE = 12;
|
||||
//TODO: const WATER_BREATHING = 13;
|
||||
const WATER_BREATHING = 13;
|
||||
const INVISIBILITY = 14;
|
||||
//const BLINDNESS = 15;
|
||||
//const NIGHT_VISION = 16;
|
||||
@ -69,7 +69,7 @@ class Effect{
|
||||
self::$effects[Effect::REGENERATION] = new Effect(Effect::REGENERATION, "Regeneration");
|
||||
//self::$effects[Effect::DAMAGE_RESISTANCE] = new Effect(Effect::DAMAGE_RESISTANCE, "Damage Resistance");
|
||||
self::$effects[Effect::FIRE_RESISTANCE] = new Effect(Effect::FIRE_RESISTANCE, "Fire Resistance");
|
||||
//self::$effects[Effect::WATER_BREATHING] = new Effect(Effect::WATER_BREATHING, "Water Breathing");
|
||||
self::$effects[Effect::WATER_BREATHING] = new Effect(Effect::WATER_BREATHING, "Water Breathing");
|
||||
self::$effects[Effect::INVISIBILITY] = new Effect(Effect::INVISIBILITY, "Invisibility");
|
||||
//self::$effects[Effect::WEAKNESS] = new Effect(Effect::WEAKNESS, "Weakness", true);
|
||||
self::$effects[Effect::POISON] = new Effect(Effect::POISON, "Poison", true);
|
||||
|
@ -180,7 +180,7 @@ abstract class Living extends Entity implements Damageable{
|
||||
$this->attack($ev->getFinalDamage(), $ev);
|
||||
}
|
||||
|
||||
if($this->dead !== true and $this->isInsideOfWater()){
|
||||
if($this->dead !== true and !$this->hasEffect(Effect::WATER_BREATHING) and $this->isInsideOfWater()){
|
||||
$hasUpdate = true;
|
||||
$airTicks = $this->getDataProperty(self::DATA_AIR) - $tickDiff;
|
||||
if($airTicks <= -20){
|
||||
|
Loading…
x
Reference in New Issue
Block a user