From 95673bfc0c5fa07378808bd88ed89d798d177fc6 Mon Sep 17 00:00:00 2001 From: lopar Date: Wed, 16 Sep 2020 18:13:25 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=BD=D0=B0=20=D1=83=D1=81=D0=BF=D0=B5=D1=85=20=D0=B2?= =?UTF-8?q?=D1=8B=D0=BD=D0=B5=D1=81=D0=B5=D0=BD=D1=8B=20=D0=B2=20=D0=BE?= =?UTF-8?q?=D1=82=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9=20=D1=80=D0=BE?= =?UTF-8?q?=D0=B4=D0=B8=D1=82=D0=B5=D0=BB=D1=8C=D1=81=D0=BA=D0=B8=D0=B9=20?= =?UTF-8?q?=D0=BA=D0=BB=D0=B0=D1=81=D1=81.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/Magic.php | 47 +++++++++++++++++++++++++++++++++++++++++++++++ magic/Healing.php | 1 + 2 files changed, 48 insertions(+) create mode 100644 classes/Magic.php 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; /**