Merge pull request #154 from earthiverse/potion-cooldown

add cooldown time when failing to equip (use) potion
This commit is contained in:
Kaan Soral
2025-03-02 02:30:21 +03:00
committed by GitHub
+5 -2
View File
@@ -6636,8 +6636,11 @@ function init_io() {
new_monster(player.in, { type: def.spawn, stype: "trap", x: player.x, y: player.y, owner: player.name });
consume_one(player, data.num);
} else if (def.gives) {
if (player.last.potion && mssince(player.last.potion) < 0) {
return fail_response("not_ready");
if (player.last.potion) {
const ms = -mssince(player.last.potion);
if (ms > 0) {
return fail_response("not_ready", { ms: ms });
}
}
if (item.l) {
return fail_response("item_locked");