Browse Source

cleaning up excessive objects, adding more enemies, cleaning up enemies

main
Stephanie Gredell 4 months ago
parent
commit
6e13dd36c2
  1. 0
      assets/avatars/codegirl.png
  2. 61
      src/data/enemies.js
  3. 24
      src/data/maps.js
  4. 7
      src/engine/battle.js
  5. 1098
      src/ui/render.js

0
assets/avatars/merge_conflict_enemy.png → assets/avatars/codegirl.png

Before

Width:  |  Height:  |  Size: 400 KiB

After

Width:  |  Height:  |  Size: 400 KiB

61
src/data/enemies.js

@ -1,64 +1,49 @@ @@ -1,64 +1,49 @@
export const ENEMIES = {
chat_gremlin: {
id: "chat_gremlin", name: "Old Man Judo", maxHp: 40,
old_man_judo: {
id: "old_man_judo", name: "Old Man Judo", maxHp: 40,
avatar: "assets/avatars/13.png", // Young person with cap
background: "assets/backgrounds/terrace.png",
ai: (turn) => turn % 3 === 0 ? { type: "block", value: 6 } : { type: "attack", value: turn % 2 === 0 ? 7 : 8 }
},
type_checker: {
id: "type_checker", name: "Type Checker", maxHp: 45,
avatar: "assets/avatars/type_checker.png", // Scholar/mage with glasses
background: "assets/backgrounds/castle.png",
ai: (turn) => (turn % 3 === 0) ? { type: "debuff", value: 1 } : { type: "attack", value: 8 },
onDebuff: (ctx) => ctx.applyWeak(ctx.player, 1)
},
js_blob: {
id: "js_blob", name: "JS Blob", maxHp: 60,
avatar: "assets/avatars/js_blob.png", // Mysterious hooded figure
background: "assets/backgrounds/dead forest.png",
ai: (turn) => (turn % 2 === 0) ? { type: "attack", value: 12 } : { type: "block", value: 6 },
onBlock: (ctx, val) => ctx.enemy.block += val
},
infinite_loop: {
id: "infinite_loop", name: "Beastco", maxHp: 35,
beastco: {
id: "beastco", name: "Beastco", maxHp: 35,
avatar: "assets/avatars/2.png", // Dizzy/confused character
background: "assets/backgrounds/throne room.png",
ai: (turn) => ({ type: "attack", value: 4 }),
},
merge_conflict_enemy: {
id: "merge_conflict_enemy", name: "Codegirl", maxHp: 50,
avatar: "assets/avatars/merge_conflict_enemy.png", // Warrior with conflicted expression
codegirl: {
id: "codegirl", name: "Codegirl", maxHp: 50,
avatar: "assets/avatars/codegirl.png", // Warrior with conflicted expression
background: "assets/backgrounds/terrace.png", // Repeat background
ai: (turn) => turn <= 4 ? { type: "attack", value: 8 } : { type: "debuff", value: 1 },
onDebuff: (ctx) => {
ctx.enemy.hp = Math.min(ctx.enemy.maxHp, ctx.enemy.hp + 8);
ctx.log("Codegirl resolves the merge conflict and heals 8 HP!");
}
},
bug_404: {
id: "bug_404", name: "404 Bug", maxHp: 45,
avatar: "assets/avatars/bug_404.png", // Elusive character
background: "assets/backgrounds/castle.png", // Repeat background
ai: (turn) => ({ type: "attack", value: 10 }),
},
elite_ts_demon: {
id: "elite_ts_demon", name: "Nightshadedude", maxHp: 85,
nightshadedude: {
id: "nightshadedude", name: "Nightshadedude", maxHp: 85,
avatar: "assets/avatars/11.png", // Powerful demon/witch
background: "assets/backgrounds/dead forest.png", // Repeat background
ai: (turn) => turn % 3 === 1 ? { type: "debuff", value: 1 } : { type: "attack", value: 14 },
onDebuff: (ctx) => ctx.applyVulnerable(ctx.player, 1)
},
elite_refactor: {
id: "elite_refactor", name: "Refactor Dragon (Elite)", maxHp: 90,
avatar: "assets/avatars/elite_refactor.png", // Regal/noble character
background: "assets/backgrounds/throne room.png", // Repeat background
ai: (turn) => ({ type: "attack", value: 10 + Math.floor(turn * 1.5) })
defyusall: {
id: "defyusall", name: "Defyusall", maxHp: 65,
avatar: "assets/avatars/bug_404.png", // Elusive character
background: "assets/backgrounds/castle.png",
ai: (turn) => turn % 3 === 0 ? { type: "block", value: 8 } : { type: "attack", value: 10 },
},
lithium: {
id: "lithium", name: "Lithium", maxHp: 55,
avatar: "assets/avatars/type_checker.png", // Scholar/mage with glasses
background: "assets/backgrounds/dead forest.png",
ai: (turn) => (turn % 2 === 0) ? { type: "debuff", value: 1 } : { type: "attack", value: 12 },
onDebuff: (ctx) => ctx.applyWeak(ctx.player, 1)
},
boss_birthday_bug: {
id: "boss_birthday_bug", name: "Teej", maxHp: 120,
teej: {
id: "teej", name: "Teej", maxHp: 120,
avatar: "assets/avatars/boss_birthday_bug.png", // Demanding/angry character
background: "assets/backgrounds/throne room.png", // Repeat background - fitting for boss
ai: (turn) => {

24
src/data/maps.js

@ -3,16 +3,20 @@ export const MAPS = { @@ -3,16 +3,20 @@ export const MAPS = {
act1: {
id: "act1", name: "Birthday Spire — Act I",
nodes: [
{ id: "n1", kind: "start", next: ["n2", "n3"] },
{ id: "n2", kind: "battle", enemy: "chat_gremlin", next: ["n4"] },
{ id: "n3", kind: "event", next: ["n4"] },
{ id: "n4", kind: "battle", enemy: "infinite_loop", next: ["n5", "n6"] },
{ id: "n5", kind: "rest", next: ["n7"] },
{ id: "n6", kind: "shop", next: ["n7"] },
{ id: "n7", kind: "battle", enemy: "merge_conflict_enemy", next: ["n8"] },
{ id: "n8", kind: "elite", enemy: "elite_ts_demon", next: ["n9"] },
{ id: "n9", kind: "rest", next: ["n10"] },
{ id: "n10", kind: "boss", enemy: "boss_birthday_bug", next: [] },
{ id: "n1", kind: "start", next: ["n2", "n3"], x: 500, y: 760 },
{ id: "n2", kind: "battle", enemy: "old_man_judo", next: ["n4"], x: 350, y: 695 },
{ id: "n3", kind: "event", next: ["n4"], x: 650, y: 695 },
{ id: "n4", kind: "battle", enemy: "beastco", next: ["n5", "n6"], x: 500, y: 600 },
{ id: "n5", kind: "rest", next: ["n7"], x: 350, y: 525 },
{ id: "n6", kind: "shop", next: ["n7"], x: 650, y: 525 },
{ id: "n7", kind: "battle", enemy: "codegirl", next: ["n8"], x: 500, y: 460 },
{ id: "n8", kind: "battle", enemy: "defyusall", next: ["n9", "n10"], x: 500, y: 395 },
{ id: "n9", kind: "rest", next: ["n11"], x: 350, y: 330 },
{ id: "n10", kind: "shop", next: ["n11"], x: 650, y: 330 },
{ id: "n11", kind: "battle", enemy: "lithium", next: ["n12"], x: 500, y: 280 },
{ id: "n12", kind: "elite", enemy: "nightshadedude", next: ["n13"], x: 500, y: 205 },
{ id: "n13", kind: "rest", next: ["n14"], x: 500, y: 125 },
{ id: "n14", kind: "boss", enemy: "teej", next: [], x: 500, y: 40 },
]
}
};

7
src/engine/battle.js

@ -125,13 +125,6 @@ export function enemyTurn(ctx) { @@ -125,13 +125,6 @@ export function enemyTurn(ctx) {
}
function applyDamage(ctx, target, raw, label) {
if (target === ctx.enemy && ctx.enemy.id === "bug_404" && ctx.enemy.turn % 3 === 0) {
ctx.log(`${ctx.enemy.name} phases out and dodges your attack completely!`);
return;
}
let dmg = raw;
for (const r of ctx.relicStates) {
if (r.hooks?.onDamageTaken && target === ctx.player) dmg = r.hooks.onDamageTaken(ctx, dmg);

1098
src/ui/render.js

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save