From 50d6f7f4f3e6715099bfebbebe16d5e611799b6d Mon Sep 17 00:00:00 2001 From: Stephanie Gredell Date: Mon, 1 Sep 2025 15:42:06 -0700 Subject: [PATCH] Ligma balls --- src/data/cards.js | 3 ++- src/engine/battle.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/data/cards.js b/src/data/cards.js index 8f4edba..6b11667 100644 --- a/src/data/cards.js +++ b/src/data/cards.js @@ -162,8 +162,9 @@ export const CARDS = { rubber_duck: { id: "rubber_duck", name: "Ligma", cost: 0, type: "skill", text: "Unalive yourself with -69 hit points. Courtesy of Defysall.", effect: (ctx) => { - ctx.player.hp = Math.min(ctx.player.maxHp, ctx.player.hp - 69); + ctx.player.hp = Math.max(0, ctx.player.hp - 69); ctx.draw(1); + ctx.log("Ligma balls! You take 69 damage!"); } }, diff --git a/src/engine/battle.js b/src/engine/battle.js index 9f37eef..b3f02fb 100644 --- a/src/engine/battle.js +++ b/src/engine/battle.js @@ -87,6 +87,7 @@ export function playCard(ctx, handIndex) { } if (ctx.enemy.hp <= 0) { ctx.enemy.hp = 0; ctx.onWin(); return; } + if (ctx.player.hp <= 0) { ctx.onLose(); return; } ctx.render(); }