dev #41

Merged
lopar merged 29 commits from dev into master 2021-05-25 15:28:14 +00:00
Showing only changes of commit 73b1f134b2 - Show all commits

View File

@ -91,9 +91,18 @@ class User
} }
public static function setUserEffect(int $userId, int $type, string $name, int $time): bool /**
* @param int $userId
* @param int $type
* @param string $name
* @param int $time
* @param string|null $json_modifiers_list (str, dex, int, end, intel, wis).
* @return bool
*/
public static function setUserEffect(int $userId, int $type, string $name, int $time, string $json_modifiers_list = null): bool
{ {
return self::$db->execute('INSERT INTO users_effects (owner_id, type, name, remaining_time) VALUES (?,?,?,?)', [$userId, $type, $name, $time]); $mods = json_decode($json_modifiers_list);
return self::$db->execute('INSERT INTO users_effects (owner_id, type, name, remaining_time, mod_strength, mod_dexterity, mod_intuition, mod_endurance, mod_intellect, mod_wisdom) VALUES (?,?,?,?,?,?,?,?,?,?)', [$userId, $type, $name, $time, $mods->str ?? null, $mods->dex ?? null, $mods->int ?? null, $mods->end ?? null, $mods->intel ?? null, $mods->wis ?? null]);
} }
public static function removeUserEffect(int $userId, int $type): bool public static function removeUserEffect(int $userId, int $type): bool