Water breathing potion

This commit is contained in:
Shoghi Cervantes 2015-03-19 10:14:35 +01:00
parent 6735234bf4
commit 275a1e3f60
2 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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){