WIP: removing User::class public array $items for Stat()::class.
This commit is contained in:
@@ -2,20 +2,98 @@
|
||||
|
||||
namespace Battle;
|
||||
|
||||
use Helper\Math;
|
||||
use User;
|
||||
|
||||
class Fighter
|
||||
{
|
||||
private int $id;
|
||||
private string $obraz;
|
||||
private string $login;
|
||||
private string $login2;
|
||||
private int $online;
|
||||
private int $admin;
|
||||
private string $align;
|
||||
private int $clan;
|
||||
private int $level;
|
||||
private int $life;
|
||||
private int $mana;
|
||||
private int $maxlife;
|
||||
private int $maxmana;
|
||||
|
||||
public function __construct() {}
|
||||
private int $damage;
|
||||
private int $damageMultiplier;
|
||||
private int $critChance;
|
||||
private int $critMultiplier;
|
||||
private int $evadeChance;
|
||||
private int $counterstrikeChance;
|
||||
private int $parryChance;
|
||||
private int $shieldblockChance;
|
||||
private int $ignoreArmorChance;
|
||||
private int $anticritChance;
|
||||
private int $antievadeChance;
|
||||
private int $defence;
|
||||
private int $airdefence;
|
||||
private int $waterdefence;
|
||||
private int $firedefence;
|
||||
private int $earthdefence;
|
||||
private int $armor;
|
||||
public function __construct(private readonly int $id, private readonly int $team) {
|
||||
$u = User::start($id);
|
||||
$this->obraz = $u->info['sex'] . DIRECTORY_SEPARATOR . $u->info['obraz'];
|
||||
$this->login = $u->info['login'];
|
||||
$this->level = $u->info['level'];
|
||||
$this->life = $u->stats['hpNow'];
|
||||
$this->mana = $u->stats['mpNow'];
|
||||
$this->maxlife = $u->stats['hpAll'];
|
||||
$this->maxmana = $u->stats['mpAll'];
|
||||
$this->damage = 100500;
|
||||
$this->armor = 35;
|
||||
$this->damageMultiplier = $u->stats['m10'];
|
||||
$this->critChance = $u->stats['m1'];
|
||||
$this->critMultiplier = $u->stats['m3'];
|
||||
$this->evadeChance = $u->stats['m4'];
|
||||
$this->counterstrikeChance = $u->stats['m6'];
|
||||
$this->parryChance = $u->stats['m7'];
|
||||
$this->shieldblockChance = $u->stats['m8'];
|
||||
$this->ignoreArmorChance = $u->stats['m9'];
|
||||
$this->anticritChance = $u->stats['m2'];
|
||||
$this->antievadeChance = $u->stats['m5'];
|
||||
$this->defence = $u->stats['za']; // ой не та это защита, ой не та. ещё ж броня должна быть.
|
||||
$this->airdefence = $u->stats['zm2'];
|
||||
$this->waterdefence = $u->stats['zm3'];
|
||||
$this->firedefence = $u->stats['zm1'];
|
||||
$this->earthdefence = $u->stats['zm4'];
|
||||
unset($u);
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
|
||||
$dmg = Math::addPercent($this->damage, $this->damageMultiplier);
|
||||
return <<<RETURN
|
||||
$this->login [$this->level] id:$this->id <br>
|
||||
Здоровье: $this->life / $this->maxlife <br>
|
||||
Мана: $this->mana / $this->maxmana <br>
|
||||
<img src="https://img.new-combats.tech/i/obraz/$this->obraz" alt=""><br>
|
||||
Урон: $this->damage + $this->damageMultiplier% = $dmg <br>
|
||||
Броня: $this->armor <br>
|
||||
Крит: $this->critChance% <br>
|
||||
Антикрит $this->anticritChance% <br>
|
||||
Мощность крита $this->critMultiplier% <br>
|
||||
Уровот $this->evadeChance% <br>
|
||||
Антиуворот $this->antievadeChance% <br>
|
||||
Контрудар $this->counterstrikeChance% <br>
|
||||
Парирование $this->parryChance% <br>
|
||||
Блок щитом $this->shieldblockChance% <br>
|
||||
Игнор брони $this->ignoreArmorChance% <br>
|
||||
Защита от урона $this->defence <br>
|
||||
Зашита от огня $this->firedefence <br>
|
||||
Защита от воды $this->waterdefence <br>
|
||||
Защита от воздуха $this->airdefence <br>
|
||||
Защита от земли $this->earthdefence <br><br>
|
||||
Сражается за команду: $this->team
|
||||
RETURN;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
/app/_incl_data/class/Battle.php:471:
|
||||
@@ -58,21 +136,6 @@ array (size=126)
|
||||
'stopexp' => int 0
|
||||
'real' => int 1
|
||||
'stats' => string 's1=3|s2=3|s3=3|s4=250|rinv=40|m9=5|m6=10|s7="0"|a1=0|a2=0|a3=0|a4=0|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0' (length=175)
|
||||
's1' => int 0
|
||||
's2' => int 0
|
||||
's3' => int 0
|
||||
's4' => int 0
|
||||
's5' => int 0
|
||||
's6' => int 0
|
||||
's7' => int 0
|
||||
'a1' => int 0
|
||||
'a2' => int 0
|
||||
'a3' => int 0
|
||||
'a4' => int 0
|
||||
'mg1' => int 0
|
||||
'mg2' => int 0
|
||||
'mg3' => int 0
|
||||
'mg4' => int 0
|
||||
'hpNow' => int 1132
|
||||
'mpNow' => int 0
|
||||
'enNow' => int 0
|
||||
|
||||
Reference in New Issue
Block a user