mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Added events
This commit is contained in:
@ -23,6 +23,7 @@ namespace pocketmine\entity;
|
||||
|
||||
use pocketmine\event\entity\EntityDamageEvent;
|
||||
use pocketmine\event\entity\EntityRegainHealthEvent;
|
||||
use pocketmine\event\player\PlayerExhaustEvent;
|
||||
use pocketmine\network\protocol\MobEffectPacket;
|
||||
use pocketmine\Player;
|
||||
|
||||
@ -34,8 +35,8 @@ class Effect{
|
||||
const FATIGUE = 4;
|
||||
const MINING_FATIGUE = 4;
|
||||
const STRENGTH = 5;
|
||||
//TODO: const HEALING = 6;
|
||||
//TODO: const HARMING = 7;
|
||||
// TODO: const HEALING = 6;
|
||||
// TODO: const HARMING = 7;
|
||||
const JUMP = 8;
|
||||
const NAUSEA = 9;
|
||||
const CONFUSION = 9;
|
||||
@ -46,7 +47,7 @@ class Effect{
|
||||
const INVISIBILITY = 14;
|
||||
const BLINDNESS = 15;
|
||||
const NIGHT_VISION = 16;
|
||||
const HUNGER = 17; // TODO implement
|
||||
const HUNGER = 17;
|
||||
const WEAKNESS = 18;
|
||||
const POISON = 19;
|
||||
const WITHER = 20;
|
||||
@ -74,15 +75,15 @@ class Effect{
|
||||
self::$effects[Effect::FIRE_RESISTANCE] = new Effect(Effect::FIRE_RESISTANCE, "%potion.fireResistance", 228, 154, 58);
|
||||
self::$effects[Effect::WATER_BREATHING] = new Effect(Effect::WATER_BREATHING, "%potion.waterBreathing", 46, 82, 153);
|
||||
self::$effects[Effect::INVISIBILITY] = new Effect(Effect::INVISIBILITY, "%potion.invisibility", 127, 131, 146);
|
||||
// TODO Blindness %potion.blindness
|
||||
// TODO Night Vision %potion.nightVision
|
||||
// TODO Hunger %potion.hunger
|
||||
self::$effects[Effect::BLINDNESS] = new Effect(Effect::BLINDNESS, "%potion.blindness", 191, 192, 192);
|
||||
self::$effects[Effect::NIGHT_VISION] = new Effect(Effect::NIGHT_VISION, "%potion.nightVision", 0, 0, 139);
|
||||
self::$effects[Effect::HUNGER] = new Effect(Effect::HUNGER, "%potion.hunger", 46, 139, 87);
|
||||
self::$effects[Effect::WEAKNESS] = new Effect(Effect::WEAKNESS, "%potion.weakness", 72, 77, 72, true);
|
||||
self::$effects[Effect::POISON] = new Effect(Effect::POISON, "%potion.poison", 78, 147, 49, true);
|
||||
self::$effects[Effect::WITHER] = new Effect(Effect::WITHER, "%potion.wither", 53, 42, 39, true);
|
||||
self::$effects[Effect::HEALTH_BOOST] = new Effect(Effect::HEALTH_BOOST, "%potion.healthBoost", 248, 125, 35);
|
||||
// TODO Absorption %potion.absorption
|
||||
// TODO Saturation %potion.saturation
|
||||
self::$effects[Effect::ABSORPTION] = new Effect(Effect::ABSORPTION, "%potion.absorption", 36, 107, 251);
|
||||
self::$effects[Effect::SATURATION] = new Effect(Effect::SATURATION, "%potion.saturation", 255, 0, 255);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -236,7 +237,7 @@ class Effect{
|
||||
|
||||
case Effect::HUNGER:
|
||||
if($entity instanceof Human){
|
||||
$entity->exhaust(0.5 * $this->amplifier);
|
||||
$entity->exhaust(0.5 * $this->amplifier, PlayerExhaustEvent::CAUSE_POTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user