diff --git a/classes/Magic.php b/classes/Magic.php new file mode 100644 index 0000000..3feaeda --- /dev/null +++ b/classes/Magic.php @@ -0,0 +1,47 @@ +battle != $target->battle || $caster->room != $target->room) { + $this->status = 'Вы не видите цель!'; + return false; + } else { + return true; + } + } + + protected function isNotDead($caster) + { + if ($caster->health < 1) { + $this->status = 'Вы мертвы!'; + return false; + } else { + return true; + } + } + + protected function enoughMana($caster) + { + if ($caster->mana < 1) { + $this->status = 'Недостаточно пыли!'; + return false; + } else { + return true; + } + } + + protected function isNotInBattle($caster) + { + if ($caster->battle) { + $this->status = 'Невозможно применить в поединке!'; + return false; + } else { + return true; + } + } +} \ No newline at end of file diff --git a/magic/Healing.php b/magic/Healing.php index 8da87c9..fc662d8 100644 --- a/magic/Healing.php +++ b/magic/Healing.php @@ -3,6 +3,7 @@ class Healing extends Magic { + private $target; private $magicPower; /**