2020-09-16 15:13:25 +00:00
|
|
|
<?php
|
|
|
|
# Date: 16.09.2020 (08:45)
|
2020-10-28 20:21:08 +00:00
|
|
|
namespace Battles\Magic;
|
2020-09-16 15:13:25 +00:00
|
|
|
class Magic
|
|
|
|
{
|
|
|
|
protected $status;
|
|
|
|
|
|
|
|
protected function isVisible($caster, $target)
|
|
|
|
{
|
|
|
|
if ($caster->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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|