Browse Source

update ids/keys of cards and all references.

main
Stephanie Gredell 4 months ago
parent
commit
d1c9957eab
  1. 64
      src/data/cards.js
  2. 27
      src/main.js
  3. 24
      src/ui/render.js

64
src/data/cards.js

@ -49,57 +49,57 @@ export const CARDS = {
} }
}, },
refactor: { segfault: {
id: "refactor", name: "Segfault", cost: 2, type: "attack", text: "Deal 7. Draw 1.", id: "segfault", name: "Segfault", cost: 2, type: "attack", text: "Deal 7. Draw 1.",
effect: (ctx) => { ctx.deal(ctx.enemy, ctx.scalarFromWeak(7)); ctx.draw(1); } effect: (ctx) => { ctx.deal(ctx.enemy, ctx.scalarFromWeak(7)); ctx.draw(1); }
}, },
type_safety: { skill_issue: {
id: "type_safety", name: "Skill Issue", cost: 1, type: "skill", text: "Gain 6 Block. If enemy intends attack → apply Weak(1).", id: "skill_issue", name: "Skill Issue", cost: 1, type: "skill", text: "Gain 6 Block. If enemy intends attack → apply Weak(1).",
effect: (ctx) => { ctx.player.block += 6; if (ctx.intentIsAttack()) ctx.applyWeak(ctx.enemy, 1); } effect: (ctx) => { ctx.player.block += 6; if (ctx.intentIsAttack()) ctx.applyWeak(ctx.enemy, 1); }
}, },
chat_ban: { "404": {
id: "chat_ban", name: "404", cost: 1, type: "skill", text: "Apply Weak(2).", id: "404", name: "404", cost: 1, type: "skill", text: "Apply Weak(2).",
effect: (ctx) => ctx.applyWeak(ctx.enemy, 2) effect: (ctx) => ctx.applyWeak(ctx.enemy, 2)
}, },
segfault: { dark_mode: {
id: "segfault", name: "Dark Mode", cost: 2, type: "attack", text: "Deal 20. End your turn.", id: "dark_mode", name: "Dark Mode", cost: 2, type: "attack", text: "Deal 20. End your turn.",
effect: (ctx) => { ctx.deal(ctx.enemy, ctx.scalarFromWeak(20)); ctx.forceEndTurn() } effect: (ctx) => { ctx.deal(ctx.enemy, ctx.scalarFromWeak(20)); ctx.forceEndTurn() }
}, },
gc: { object_object: {
id: "gc", name: "[object Object]", cost: 1, type: "skill", text: "Exhaust 1 card, draw 2.", id: "object_object", name: "[object Object]", cost: 1, type: "skill", text: "Exhaust 1 card, draw 2.",
effect: (ctx) => { effect: (ctx) => {
ctx.promptExhaust(1); ctx.promptExhaust(1);
ctx.draw(2); ctx.draw(2);
} }
}, },
async_await: { just_one_game: {
id: "async_await", name: "Just One Game", cost: 1, type: "power", text: "Skip this turn. Next turn +2 Energy.", id: "just_one_game", name: "Just One Game", cost: 1, type: "power", text: "Skip this turn. Next turn +2 Energy.",
effect: (ctx) => { ctx.flags.skipThisTurn = true; ctx.flags.nextTurnEnergyBonus = (ctx.flags.nextTurnEnergyBonus || 0) + 2; } effect: (ctx) => { ctx.flags.skipThisTurn = true; ctx.flags.nextTurnEnergyBonus = (ctx.flags.nextTurnEnergyBonus || 0) + 2; }
}, },
stack_overflow: { colon_q: {
id: "stack_overflow", name: "Colon Q", cost: 2, type: "attack", text: "Deal 1 per card in discard.", id: "colon_q", name: "Colon Q", cost: 2, type: "attack", text: "Deal 1 per card in discard.",
effect: (ctx) => ctx.deal(ctx.enemy, ctx.scalarFromWeak(Math.max(0, ctx.discard.length))) effect: (ctx) => ctx.deal(ctx.enemy, ctx.scalarFromWeak(Math.max(0, ctx.discard.length)))
}, },
infinite_vim: { vibe_code: {
id: "infinite_vim", name: "Vibe Code", cost: 1, type: "skill", text: "Next card costs 0.", id: "vibe_code", name: "Vibe Code", cost: 1, type: "skill", text: "Next card costs 0.",
effect: (ctx) => ctx.flags.nextCardFree = true effect: (ctx) => ctx.flags.nextCardFree = true
}, },
debug_print: { raw_dog: {
id: "debug_print", name: "Raw Dog", cost: 0, type: "skill", text: "Draw 2. Exhaust.", id: "raw_dog", name: "Raw Dog", cost: 0, type: "skill", text: "Draw 2. Exhaust.",
exhaust: true, exhaust: true,
effect: (ctx) => ctx.draw(2) effect: (ctx) => ctx.draw(2)
}, },
null_pointer: { task_failed_successfully: {
id: "null_pointer", name: "Task failed successfully", cost: 2, type: "attack", text: "Deal 8. If enemy has no Block, deal 4 more.", id: "task_failed_successfully", name: "Task failed successfully", cost: 2, type: "attack", text: "Deal 8. If enemy has no Block, deal 4 more.",
effect: (ctx) => { effect: (ctx) => {
let dmg = ctx.scalarFromWeak(8); let dmg = ctx.scalarFromWeak(8);
if (ctx.enemy.block === 0) dmg += ctx.scalarFromWeak(4); if (ctx.enemy.block === 0) dmg += ctx.scalarFromWeak(4);
@ -159,8 +159,8 @@ export const CARDS = {
} }
}, },
rubber_duck: { ligma: {
id: "rubber_duck", name: "Ligma", cost: 0, type: "skill", text: "Unalive yourself with -69 hit points. Courtesy of Defysall.", id: "ligma", name: "Ligma", cost: 0, type: "skill", text: "Unalive yourself with -69 hit points. Courtesy of Defysall.",
effect: (ctx) => { effect: (ctx) => {
ctx.player.hp = Math.max(0, ctx.player.hp - 69); ctx.player.hp = Math.max(0, ctx.player.hp - 69);
ctx.draw(1); ctx.draw(1);
@ -176,8 +176,8 @@ export const CARDS = {
} }
}, },
unit_test: { virgin: {
id: "unit_test", name: "Virgin", cost: 1, type: "skill", text: "If enemy intends to attack, gain 8 Block.", id: "virgin", name: "Virgin", cost: 1, type: "skill", text: "If enemy intends to attack, gain 8 Block.",
effect: (ctx) => { effect: (ctx) => {
if (ctx.intentIsAttack()) { if (ctx.intentIsAttack()) {
ctx.player.block += 8; ctx.player.block += 8;
@ -207,15 +207,15 @@ export const CARDS = {
export const STARTER_DECK = [ export const STARTER_DECK = [
"refactor", "debug_print", "coffee_rush", "segfault", "raw_dog", "coffee_rush",
"type_safety", "infinite_vim", "chat_ban", "skill_issue", "vibe_code", "404",
"git_commit", "rubber_duck", "null_pointer", "unit_test" "git_commit", "ligma", "task_failed_successfully", "virgin"
]; ];
export const CARD_POOL = [ export const CARD_POOL = [
"coffee_rush", "macro", "refactor", "type_safety", "chat_ban", "coffee_rush", "macro", "segfault", "skill_issue", "404",
"segfault", "gc", "async_await", "stack_overflow", "infinite_vim", "dark_mode", "object_object", "just_one_game", "colon_q", "vibe_code",
"debug_print", "null_pointer", "recursion", "git_commit", "memory_leak", "raw_dog", "task_failed_successfully", "recursion", "git_commit", "memory_leak",
"code_review", "pair_programming", "hotfix", "rubber_duck", "merge_conflict", "code_review", "pair_programming", "hotfix", "ligma", "merge_conflict",
"unit_test", "production_deploy" "virgin", "production_deploy"
]; ];

27
src/main.js

@ -131,7 +131,6 @@ const root = {
}, },
save() { save() {
if (this._battleInProgress) { if (this._battleInProgress) {
return; return;
} }
@ -190,21 +189,6 @@ const root = {
if (this.player.hand) { if (this.player.hand) {
this.player.hand.forEach(restoreCard); this.player.hand.forEach(restoreCard);
} }
if (this.player.deck) {
this.player.deck.forEach(id => {
});
}
if (this.player.draw) {
this.player.draw.forEach(id => {
});
}
if (this.player.discard) {
this.player.discard.forEach(id => {
});
}
}, },
clearSave() { clearSave() {
@ -251,8 +235,7 @@ function initializeGame() {
case 'victory': case 'victory':
case 'win': case 'win':
renderWin(root); renderWin(root);
return; // Exit early to prevent any other code from running return;
break;
case 'defeat': case 'defeat':
case 'lose': case 'lose':
renderLose(root); renderLose(root);
@ -298,10 +281,10 @@ function setupMockData() {
root.player.maxHp = 50; root.player.maxHp = 50;
root.player.gold = 150; root.player.gold = 150;
root.player.energy = 3; root.player.energy = 3;
root.player.deck = ['strike', 'defend', 'coffee_rush', 'debug_print', 'refactor', 'unit_test']; root.player.deck = ['strike', 'defend', 'coffee_rush', 'raw_dog', 'segfault', 'virgin'];
root.player.hand = ['strike', 'coffee_rush', 'debug_print']; root.player.hand = ['strike', 'coffee_rush', 'raw_dog'];
root.player.draw = ['defend', 'refactor']; root.player.draw = ['defend', 'segfault'];
root.player.discard = ['unit_test']; root.player.discard = ['virgin'];
attachRelics(root, ['coffee_thermos', 'cpp_compiler']); attachRelics(root, ['coffee_thermos', 'cpp_compiler']);

24
src/ui/render.js

@ -1154,12 +1154,12 @@ function getCardArt(cardId) {
coffee_rush: 'Monk_5.png', // Energy boost coffee_rush: 'Monk_5.png', // Energy boost
'coffee_rush+': 'Monk_6.png', // Upgraded energy 'coffee_rush+': 'Monk_6.png', // Upgraded energy
macro: 'Monk_7.png', // Replay magic macro: 'Monk_7.png', // Replay magic
refactor: 'Monk_8.png', // Refactoring tool segfault: 'Monk_8.png', // Refactoring tool
type_safety: 'Monk_9.png', // Protection skill_issue: 'Monk_9.png', // Protection
chat_ban: 'Monk_10.png', // Ban/restriction "404": 'Monk_10.png', // Ban/restriction
segfault: 'Monk_11.png', // Powerful attack segfault: 'Monk_11.png', // Powerful attack
null_pointer: 'Monk_12.png', // Precise strike task_failed_successfully: 'Monk_12.png', // Precise strike
recursion: 'Monk_13.png', // Repetition recursion: 'Monk_13.png', // Repetition
merge_conflict: 'Monk_14.png', // Dual attack merge_conflict: 'Monk_14.png', // Dual attack
hotfix: 'Monk_15.png', // Emergency fix hotfix: 'Monk_15.png', // Emergency fix
@ -1168,14 +1168,14 @@ function getCardArt(cardId) {
gc: 'Monk_17.png', // Cleanup gc: 'Monk_17.png', // Cleanup
async_await: 'Monk_18.png', // Time manipulation async_await: 'Monk_18.png', // Time manipulation
stack_overflow: 'Monk_19.png', // Knowledge overflow stack_overflow: 'Monk_19.png', // Knowledge overflow
infinite_vim: 'Monk_20.png', // Infinite power vibe_code: 'Monk_20.png', // Infinite power
debug_print: 'Monk_21.png', // Information raw_dog: 'Monk_21.png', // Information
git_commit: 'Monk_22.png', // Recording git_commit: 'Monk_22.png', // Recording
memory_leak: 'Monk_23.png', // Draining effect memory_leak: 'Monk_23.png', // Draining effect
code_review: 'Monk_24.png', // Investigation code_review: 'Monk_24.png', // Investigation
pair_programming: 'Monk_25.png', // Cooperation pair_programming: 'Monk_25.png', // Cooperation
rubber_duck: 'Monk_26.png', // Helpful companion ligma: 'Monk_26.png', // Helpful companion
unit_test: 'Monk_27.png', // Testing/verification virgin: 'Monk_27.png', // Testing/verification
sugar_crash: 'Monk_28.png' // Negative effect sugar_crash: 'Monk_28.png' // Negative effect
}; };
@ -1192,11 +1192,11 @@ function getCardArt(cardId) {
function getCardArtFallback(cardId) { function getCardArtFallback(cardId) {
const fallbacks = { const fallbacks = {
strike: '👊', defend: '🛡', coffee_rush: '☕', macro: '🔄', strike: '👊', defend: '🛡', coffee_rush: '☕', macro: '🔄',
refactor: '⚡', type_safety: '🔒', chat_ban: '🚫', segfault: '💥', segfault: '⚡', skill_issue: '🔒', "404": '🚫', dark_mode: '💥',
gc: '🗑', async_await: '⏳', stack_overflow: '📚', infinite_vim: '♾', object_object: '🗑', just_one_game: '⏳', colon_q: '📚', vibe_code: '♾',
debug_print: '🐛', null_pointer: '❌', recursion: '🔁', git_commit: '📝', raw_dog: '🐛', task_failed_successfully: '❌', recursion: '🔁', git_commit: '📝',
memory_leak: '🕳', code_review: '👀', pair_programming: '👥', hotfix: '🚨', memory_leak: '🕳', code_review: '👀', pair_programming: '👥', hotfix: '🚨',
rubber_duck: '🦆', merge_conflict: '⚔', unit_test: '✅', production_deploy: '🚀', ligma: '🦆', merge_conflict: '⚔', virgin: '✅', production_deploy: '🚀',
sugar_crash: '🍰' sugar_crash: '🍰'
}; };
return fallbacks[cardId] || '🃏'; return fallbacks[cardId] || '🃏';

Loading…
Cancel
Save