Отображение суммарных статов уехало из DressedItems в UserStats. #18

This commit is contained in:
lopar
2021-03-11 21:20:36 +02:00
parent c54b97681b
commit 4164046edb
3 changed files with 11 additions and 67 deletions
+6 -17
View File
@@ -177,22 +177,6 @@ class UserStats extends User
return $this->maxMana;
}
/**
* @return int
*/
public function getMinDamage(): int
{
return $this->minDamage;
}
/**
* @return int
*/
public function getMaxDamage(): int
{
return $this->maxDamage;
}
/**
* @return int
*/
@@ -226,7 +210,12 @@ class UserStats extends User
sum(greatest(intuition + (ifnull((select sum(add_intuition) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as intuition,
sum(greatest(endurance + (ifnull((select sum(add_endurance) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as endurance,
sum(greatest(intelligence + (ifnull((select sum(add_intelligence) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as intelligence,
sum(greatest(wisdom + (ifnull((select sum(add_wisdom) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as wisdom
sum(greatest(wisdom + (ifnull((select sum(add_wisdom) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as wisdom,
ifnull((select sum(add_accuracy) from inventory where dressed_slot != 0 and owner_id = $this->id), 0) as accuracy,
ifnull((select sum(add_evasion) from inventory where dressed_slot != 0 and owner_id = $this->id), 0) as evasion,
ifnull((select sum(add_criticals) from inventory where dressed_slot != 0 and owner_id = $this->id), 0) as criticals,
sum(greatest($this->minDamage + (ifnull((select sum(add_min_physical_damage) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as min_physical_damage,
sum(greatest($this->maxDamage + (ifnull((select sum(add_max_physical_damage) from inventory where dressed_slot != 0 and owner_id = $this->id), 0)), 0)) as max_physical_damage
from users where id = $this->id";
return self::$db->ofetch($query);
}