Browse Source

Ligma balls

main
Stephanie Gredell 4 months ago
parent
commit
50d6f7f4f3
  1. 3
      src/data/cards.js
  2. 1
      src/engine/battle.js

3
src/data/cards.js

@ -162,8 +162,9 @@ export const CARDS = {
rubber_duck: { rubber_duck: {
id: "rubber_duck", name: "Ligma", cost: 0, type: "skill", text: "Unalive yourself with -69 hit points. Courtesy of Defysall.", id: "rubber_duck", name: "Ligma", cost: 0, type: "skill", text: "Unalive yourself with -69 hit points. Courtesy of Defysall.",
effect: (ctx) => { 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.draw(1);
ctx.log("Ligma balls! You take 69 damage!");
} }
}, },

1
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.enemy.hp <= 0) { ctx.enemy.hp = 0; ctx.onWin(); return; }
if (ctx.player.hp <= 0) { ctx.onLose(); return; }
ctx.render(); ctx.render();
} }

Loading…
Cancel
Save