This commit is contained in:
2023-11-02 15:57:39 +02:00
parent a14232a899
commit def933dca4
51 changed files with 8866 additions and 12429 deletions
+14 -3
View File
@@ -7,7 +7,7 @@ use Model\Effect;
class Effects
{
public static function addCustom(array $values)
public static function addCustom(array $values): void
{
$sql = '
insert into eff_users
@@ -92,6 +92,7 @@ insert into eff_users
/** Дать игроку эффект.
* @param int $uid id игрока
* @param int $id id эффекта
* @param bool $ignoreLimits
* @return bool
*/
public static function addById(int $uid, int $id, bool $ignoreLimits = false): bool
@@ -129,7 +130,7 @@ insert into eff_users
public static function hasInjury(int $uid): bool
{
return Db::getValue('select count(*) from eff_users where id_eff in (4,5) and `delete` = 0 and uid = ?', [$uid]) > 0;
return Db::getValue('select count(*) from eff_users where id_eff in (4,5,6) and `delete` = 0 and uid = ?', [$uid]) > 0;
}
public static function hasAddiction(int $addictionId, int $uid): bool // пристрастие
@@ -157,7 +158,7 @@ insert into eff_users
return Db::getValue('select count(*) from eff_users where id_eff in (479, 480, 481) and `delete` = 0 and uid = ?', [$targetId]) > 0;
}
public static function giveAttackImmunity(int $userId)
public static function giveAttackImmunity(int $userId): void
{
Db::sql("insert into eff_users (no_Ace, id_eff, overType, uid, name, data, timeUse) values (1,479,112,?,'Защита от нападения','zashitatk=1',unix_timestamp())", [$userId]);
}
@@ -175,4 +176,14 @@ insert into eff_users
values (22,?,'Спасение','add_spasenie=1',101,77,?,'priem',324,'preservation.gif','спасение',1)", [$id, $id]);
}
public static function getActive(int $userId): array
{
return Db::getRows('select * from eff_users where uid = ?', [$userId]);
}
public static function getAllInjuries(int $uid): array
{
return Db::getRows('select * from eff_users where uid = ? and id_eff in (4,5,6) order by id_eff', [$uid]);
}
}