moving
This commit is contained in:
31
classes/magic/attack.php
Normal file
31
classes/magic/attack.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace magic\attack;
|
||||
|
||||
class attack
|
||||
{
|
||||
private $target_user;
|
||||
private $caster;
|
||||
|
||||
private function __construct($target_user_id)
|
||||
{
|
||||
if (!$this->caster)
|
||||
$this->caster = \db::c()->query('SELECT * FROM `users` WHERE `id` = ?i', $_SESSION['uid']);
|
||||
if (!$this->target_user)
|
||||
$this->target_user = \db::c()->query('SELECT * FROM `users` WHERE `id` = ?i', $target_user_id);
|
||||
if ($this->checks() == 1) return 'Done!';
|
||||
}
|
||||
|
||||
private function checks()
|
||||
{
|
||||
if ($this->caster['battle']) return 'Не в бою...';
|
||||
else return 1;
|
||||
}
|
||||
|
||||
public static function id($playerId)
|
||||
{
|
||||
return new self($playerId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user