clibuddy 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +60 -0
  3. package/dist/adventure/adventureUI.d.ts +24 -0
  4. package/dist/adventure/adventureUI.js +290 -0
  5. package/dist/adventure/adventures.d.ts +4 -0
  6. package/dist/adventure/adventures.js +206 -0
  7. package/dist/adventure/biomes.d.ts +30 -0
  8. package/dist/adventure/biomes.js +80 -0
  9. package/dist/adventure/combat/combat.d.ts +14 -0
  10. package/dist/adventure/combat/combat.js +638 -0
  11. package/dist/adventure/combat/combatUI.d.ts +5 -0
  12. package/dist/adventure/combat/combatUI.js +116 -0
  13. package/dist/adventure/combat/conditions.d.ts +20 -0
  14. package/dist/adventure/combat/conditions.js +111 -0
  15. package/dist/adventure/combat/enemies.d.ts +4 -0
  16. package/dist/adventure/combat/enemies.js +430 -0
  17. package/dist/adventure/combat/gear.d.ts +3 -0
  18. package/dist/adventure/combat/gear.js +199 -0
  19. package/dist/adventure/combat/skills.d.ts +6 -0
  20. package/dist/adventure/combat/skills.js +197 -0
  21. package/dist/adventure/combat.d.ts +31 -0
  22. package/dist/adventure/combat.js +732 -0
  23. package/dist/adventure/combatUI.d.ts +5 -0
  24. package/dist/adventure/combatUI.js +116 -0
  25. package/dist/adventure/endless.d.ts +18 -0
  26. package/dist/adventure/endless.js +154 -0
  27. package/dist/adventure/enemies.d.ts +4 -0
  28. package/dist/adventure/enemies.js +320 -0
  29. package/dist/adventure/engine.d.ts +20 -0
  30. package/dist/adventure/engine.js +137 -0
  31. package/dist/adventure/gear.d.ts +3 -0
  32. package/dist/adventure/gear.js +149 -0
  33. package/dist/adventure/generation/biomes.d.ts +30 -0
  34. package/dist/adventure/generation/biomes.js +102 -0
  35. package/dist/adventure/generation/endless.d.ts +18 -0
  36. package/dist/adventure/generation/endless.js +154 -0
  37. package/dist/adventure/generation/generator.d.ts +9 -0
  38. package/dist/adventure/generation/generator.js +245 -0
  39. package/dist/adventure/generation/templates.d.ts +25 -0
  40. package/dist/adventure/generation/templates.js +228 -0
  41. package/dist/adventure/generator.d.ts +9 -0
  42. package/dist/adventure/generator.js +245 -0
  43. package/dist/adventure/skills.d.ts +6 -0
  44. package/dist/adventure/skills.js +197 -0
  45. package/dist/adventure/templates.d.ts +25 -0
  46. package/dist/adventure/templates.js +228 -0
  47. package/dist/adventure/types.d.ts +236 -0
  48. package/dist/adventure/types.js +97 -0
  49. package/dist/app/state.d.ts +49 -0
  50. package/dist/app/state.js +51 -0
  51. package/dist/buddy/activities.d.ts +16 -0
  52. package/dist/buddy/activities.js +90 -0
  53. package/dist/buddy/decay.d.ts +3 -0
  54. package/dist/buddy/decay.js +45 -0
  55. package/dist/buddy/leveling.d.ts +11 -0
  56. package/dist/buddy/leveling.js +25 -0
  57. package/dist/buddy/roll.d.ts +4 -0
  58. package/dist/buddy/roll.js +61 -0
  59. package/dist/buddy/species.d.ts +4 -0
  60. package/dist/buddy/species.js +592 -0
  61. package/dist/buddy/titles.d.ts +17 -0
  62. package/dist/buddy/titles.js +89 -0
  63. package/dist/buddy/types.d.ts +92 -0
  64. package/dist/buddy/types.js +21 -0
  65. package/dist/commands/actions.d.ts +2 -0
  66. package/dist/commands/actions.js +141 -0
  67. package/dist/commands/admin.d.ts +2 -0
  68. package/dist/commands/admin.js +202 -0
  69. package/dist/commands/registry.d.ts +25 -0
  70. package/dist/commands/registry.js +31 -0
  71. package/dist/commands/social.d.ts +2 -0
  72. package/dist/commands/social.js +92 -0
  73. package/dist/dialogue/engine.d.ts +7 -0
  74. package/dist/dialogue/engine.js +68 -0
  75. package/dist/dialogue/lines.d.ts +26 -0
  76. package/dist/dialogue/lines.js +294 -0
  77. package/dist/events/engine.d.ts +20 -0
  78. package/dist/events/engine.js +51 -0
  79. package/dist/events/events.d.ts +13 -0
  80. package/dist/events/events.js +149 -0
  81. package/dist/index.d.ts +10 -0
  82. package/dist/index.js +1665 -0
  83. package/dist/inventory/finding.d.ts +11 -0
  84. package/dist/inventory/finding.js +99 -0
  85. package/dist/inventory/items.d.ts +31 -0
  86. package/dist/inventory/items.js +63 -0
  87. package/dist/minigames/copycat.d.ts +2 -0
  88. package/dist/minigames/copycat.js +153 -0
  89. package/dist/minigames/fetch.d.ts +2 -0
  90. package/dist/minigames/fetch.js +179 -0
  91. package/dist/minigames/moodmatch.d.ts +2 -0
  92. package/dist/minigames/moodmatch.js +144 -0
  93. package/dist/minigames/quickpaws.d.ts +2 -0
  94. package/dist/minigames/quickpaws.js +142 -0
  95. package/dist/minigames/registry.d.ts +5 -0
  96. package/dist/minigames/registry.js +16 -0
  97. package/dist/minigames/rpsplus.d.ts +2 -0
  98. package/dist/minigames/rpsplus.js +168 -0
  99. package/dist/minigames/treasurehunt.d.ts +2 -0
  100. package/dist/minigames/treasurehunt.js +146 -0
  101. package/dist/minigames/types.d.ts +30 -0
  102. package/dist/minigames/types.js +69 -0
  103. package/dist/rendering/commandPalette.d.ts +16 -0
  104. package/dist/rendering/commandPalette.js +77 -0
  105. package/dist/rendering/display.d.ts +9 -0
  106. package/dist/rendering/display.js +231 -0
  107. package/dist/rendering/inventoryUI.d.ts +14 -0
  108. package/dist/rendering/inventoryUI.js +99 -0
  109. package/dist/rendering/items.d.ts +7 -0
  110. package/dist/rendering/items.js +34 -0
  111. package/dist/rendering/listUtils.d.ts +3 -0
  112. package/dist/rendering/listUtils.js +24 -0
  113. package/dist/rendering/minigameUI.d.ts +11 -0
  114. package/dist/rendering/minigameUI.js +37 -0
  115. package/dist/rendering/overlayUI.d.ts +24 -0
  116. package/dist/rendering/overlayUI.js +184 -0
  117. package/dist/rendering/scene.d.ts +8 -0
  118. package/dist/rendering/scene.js +87 -0
  119. package/dist/rendering/screen.d.ts +43 -0
  120. package/dist/rendering/screen.js +97 -0
  121. package/dist/sound/sound.d.ts +11 -0
  122. package/dist/sound/sound.js +55 -0
  123. package/dist/state/save.d.ts +5 -0
  124. package/dist/state/save.js +100 -0
  125. package/dist/state/settings.d.ts +7 -0
  126. package/dist/state/settings.js +81 -0
  127. package/dist/story/mainStory.d.ts +4 -0
  128. package/dist/story/mainStory.js +3111 -0
  129. package/dist/story/npcs.d.ts +17 -0
  130. package/dist/story/npcs.js +137 -0
  131. package/dist/story/progress.d.ts +26 -0
  132. package/dist/story/progress.js +168 -0
  133. package/dist/story/seasonal.d.ts +6 -0
  134. package/dist/story/seasonal.js +96 -0
  135. package/dist/story/shop.d.ts +7 -0
  136. package/dist/story/shop.js +26 -0
  137. package/dist/story/sideQuests.d.ts +4 -0
  138. package/dist/story/sideQuests.js +151 -0
  139. package/dist/story/types.d.ts +61 -0
  140. package/dist/story/types.js +36 -0
  141. package/dist/updates.d.ts +23 -0
  142. package/dist/updates.js +142 -0
  143. package/package.json +53 -0
@@ -0,0 +1,197 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SKILLS = void 0;
4
+ exports.getAvailableSkills = getAvailableSkills;
5
+ exports.getSkill = getSkill;
6
+ exports.SKILLS = [
7
+ // ─── Universal ─────────────────────────────────────────────
8
+ {
9
+ id: "focus", name: "Focus", description: "+50% ATK next turn",
10
+ speciesId: "all", levelRequired: 1, energyCost: 1,
11
+ effect: { type: "buff", stat: "atk", amount: 0.5, turns: 1 },
12
+ useLine: "concentrates deeply...",
13
+ },
14
+ // ─── Rabbit ────────────────────────────────────────────────
15
+ {
16
+ id: "quick_hop", name: "Quick Hop", description: "+30% dodge for 2 turns",
17
+ speciesId: "rabbit", levelRequired: 3, energyCost: 1,
18
+ effect: { type: "buff", stat: "dodge", amount: 0.3, turns: 2 },
19
+ useLine: "hops around frantically!",
20
+ },
21
+ {
22
+ id: "burrow", name: "Burrow", description: "Enemy skips next turn",
23
+ speciesId: "rabbit", levelRequired: 6, energyCost: 2,
24
+ effect: { type: "skip_enemy_turn" },
25
+ useLine: "digs underground and vanishes!",
26
+ },
27
+ {
28
+ id: "natures_blessing", name: "Nature's Blessing", description: "Regen 5 HP/turn for 3 turns",
29
+ speciesId: "rabbit", levelRequired: 10, energyCost: 2, element: "nature",
30
+ effect: { type: "buff", stat: "def", amount: 0, turns: 3 }, // handled specially by ID in combat.ts
31
+ useLine: "channels the power of nature!",
32
+ },
33
+ {
34
+ id: "earthquake", name: "Earthquake", description: "1.5x Nature dmg + stun",
35
+ speciesId: "rabbit", levelRequired: 15, energyCost: 3, element: "nature",
36
+ effect: { type: "damage", multiplier: 1.5 },
37
+ useLine: "stomps the ground with tremendous force!",
38
+ },
39
+ // ─── Cat ───────────────────────────────────────────────────
40
+ {
41
+ id: "pounce", name: "Pounce", description: "1.5x damage",
42
+ speciesId: "cat", levelRequired: 3, energyCost: 1,
43
+ effect: { type: "damage", multiplier: 1.5 },
44
+ useLine: "leaps through the air!",
45
+ },
46
+ {
47
+ id: "shadow_step", name: "Shadow Step", description: "+40% dodge 3 turns + next crit",
48
+ speciesId: "cat", levelRequired: 6, energyCost: 2, element: "shadow",
49
+ effect: { type: "buff", stat: "dodge", amount: 0.4, turns: 3 },
50
+ useLine: "melts into the shadows!",
51
+ },
52
+ {
53
+ id: "nine_lives", name: "Nine Lives", description: "Survive one KO with 1 HP",
54
+ speciesId: "cat", levelRequired: 10, energyCost: 3,
55
+ effect: { type: "revive", hpPercent: 0.01 },
56
+ useLine: "'s eyes flash — not done yet!",
57
+ },
58
+ {
59
+ id: "shadow_strike", name: "Shadow Strike", description: "2x Shadow dmg + charm 1t",
60
+ speciesId: "cat", levelRequired: 15, energyCost: 3, element: "shadow",
61
+ effect: { type: "damage", multiplier: 2.0 },
62
+ useLine: "strikes from the darkness!",
63
+ },
64
+ // ─── Frog ──────────────────────────────────────────────────
65
+ {
66
+ id: "tongue_lash", name: "Tongue Lash", description: "1.3x, ignores DEF",
67
+ speciesId: "frog", levelRequired: 3, energyCost: 1,
68
+ effect: { type: "damage", multiplier: 1.3, ignoreDefense: true },
69
+ useLine: "'s tongue snaps out!",
70
+ },
71
+ {
72
+ id: "toxic_splash", name: "Toxic Splash", description: "Poison: 4 dmg/turn for 3 turns",
73
+ speciesId: "frog", levelRequired: 6, energyCost: 2, element: "nature",
74
+ effect: { type: "poison", damagePerTurn: 4, turns: 3 },
75
+ useLine: "sprays a toxic mist!",
76
+ },
77
+ {
78
+ id: "aqua_shield", name: "Aqua Shield", description: "Shield absorbs 20 damage",
79
+ speciesId: "frog", levelRequired: 10, energyCost: 2, element: "water",
80
+ effect: { type: "buff", stat: "def", amount: 0, turns: 1 }, // handled specially
81
+ useLine: "conjures a water barrier!",
82
+ },
83
+ {
84
+ id: "tidal_wave", name: "Tidal Wave", description: "2x Water dmg + freeze 1t",
85
+ speciesId: "frog", levelRequired: 15, energyCost: 3, element: "water",
86
+ effect: { type: "damage", multiplier: 2.0 },
87
+ useLine: "summons a massive wave!",
88
+ },
89
+ // ─── Owl ───────────────────────────────────────────────────
90
+ {
91
+ id: "keen_eye", name: "Keen Eye", description: "+25% crit for 3 turns",
92
+ speciesId: "owl", levelRequired: 3, energyCost: 1,
93
+ effect: { type: "buff", stat: "crit", amount: 0.25, turns: 3 },
94
+ useLine: "'s eyes narrow with focus...",
95
+ },
96
+ {
97
+ id: "screech", name: "Screech", description: "-30% enemy ATK for 3 turns",
98
+ speciesId: "owl", levelRequired: 6, energyCost: 2,
99
+ effect: { type: "debuff", stat: "atk", amount: 0.3, turns: 3 },
100
+ useLine: "lets out a piercing screech!",
101
+ },
102
+ {
103
+ id: "illuminate", name: "Illuminate", description: "Blind enemy for 2 turns",
104
+ speciesId: "owl", levelRequired: 10, energyCost: 2, element: "light",
105
+ effect: { type: "stun", turns: 0 }, // handled specially — applies blind condition
106
+ useLine: "emits a blinding flash!",
107
+ },
108
+ {
109
+ id: "piercing_gaze", name: "Piercing Gaze", description: "2.5x Light dmg + -50% DEF 2t",
110
+ speciesId: "owl", levelRequired: 15, energyCost: 4, element: "light",
111
+ effect: { type: "damage", multiplier: 2.5 },
112
+ useLine: "focuses an intense beam of light!",
113
+ },
114
+ // ─── Fox ───────────────────────────────────────────────────
115
+ {
116
+ id: "trick", name: "Trick", description: "Stun enemy 1 turn",
117
+ speciesId: "fox", levelRequired: 3, energyCost: 1,
118
+ effect: { type: "stun", turns: 1 },
119
+ useLine: "pulls a clever feint!",
120
+ },
121
+ {
122
+ id: "cunning_strike", name: "Cunning Strike", description: "2x dmg if HP > 50%",
123
+ speciesId: "fox", levelRequired: 6, energyCost: 2,
124
+ effect: { type: "damage", multiplier: 2.0 },
125
+ useLine: "strikes with cunning precision!",
126
+ },
127
+ {
128
+ id: "shadow_cloak", name: "Shadow Cloak", description: "+50% dodge 2t, stealth",
129
+ speciesId: "fox", levelRequired: 10, energyCost: 2, element: "shadow",
130
+ effect: { type: "buff", stat: "dodge", amount: 0.5, turns: 2 },
131
+ useLine: "vanishes into thin air!",
132
+ },
133
+ {
134
+ id: "outfox", name: "Outfox", description: "2x Nature dmg + charm 1t",
135
+ speciesId: "fox", levelRequired: 15, energyCost: 3, element: "nature",
136
+ effect: { type: "damage", multiplier: 2.0 },
137
+ useLine: "outwits the enemy completely!",
138
+ },
139
+ // ─── Phoenix ───────────────────────────────────────────────
140
+ {
141
+ id: "flame_burst", name: "Flame Burst", description: "1.6x Fire damage",
142
+ speciesId: "phoenix", levelRequired: 3, energyCost: 1, element: "fire",
143
+ effect: { type: "damage", multiplier: 1.6 },
144
+ useLine: "erupts in flames!",
145
+ },
146
+ {
147
+ id: "inferno", name: "Inferno", description: "1.4x Fire + burn 5/t 3t",
148
+ speciesId: "phoenix", levelRequired: 6, energyCost: 2, element: "fire",
149
+ effect: { type: "damage", multiplier: 1.4 },
150
+ useLine: "unleashes a raging inferno!",
151
+ },
152
+ {
153
+ id: "rebirth", name: "Rebirth", description: "Revive with 30% HP once",
154
+ speciesId: "phoenix", levelRequired: 10, energyCost: 3,
155
+ effect: { type: "revive", hpPercent: 0.3 },
156
+ useLine: "bursts into ashes... and rises reborn!",
157
+ },
158
+ {
159
+ id: "supernova", name: "Supernova", description: "2.5x Fire + burn all",
160
+ speciesId: "phoenix", levelRequired: 15, energyCost: 4, element: "fire",
161
+ effect: { type: "damage", multiplier: 2.5 },
162
+ useLine: "explodes in a blinding supernova!",
163
+ },
164
+ // ─── Dragon ────────────────────────────────────────────────
165
+ {
166
+ id: "fire_breath", name: "Fire Breath", description: "1.8x Fire damage",
167
+ speciesId: "dragon", levelRequired: 3, energyCost: 1, element: "fire",
168
+ effect: { type: "damage", multiplier: 1.8 },
169
+ useLine: "unleashes a stream of fire!",
170
+ },
171
+ {
172
+ id: "scale_shield", name: "Scale Shield", description: "+50% DEF for 3 turns",
173
+ speciesId: "dragon", levelRequired: 6, energyCost: 2,
174
+ effect: { type: "buff", stat: "def", amount: 0.5, turns: 3 },
175
+ useLine: "'s scales harden and gleam!",
176
+ },
177
+ {
178
+ id: "dragons_roar", name: "Dragon's Roar", description: "-40% enemy ATK 2 turns",
179
+ speciesId: "dragon", levelRequired: 10, energyCost: 2,
180
+ effect: { type: "debuff", stat: "atk", amount: 0.4, turns: 2 },
181
+ useLine: "lets out an earth-shaking roar!",
182
+ },
183
+ {
184
+ id: "apocalypse", name: "Apocalypse", description: "3x Fire dmg (devastating)",
185
+ speciesId: "dragon", levelRequired: 15, energyCost: 4, element: "fire",
186
+ effect: { type: "damage", multiplier: 3.0 },
187
+ useLine: "rains fire from above!",
188
+ },
189
+ ];
190
+ /** Get skills available to a species at a given level */
191
+ function getAvailableSkills(speciesId, level) {
192
+ return exports.SKILLS.filter((s) => (s.speciesId === speciesId || s.speciesId === "all") && level >= s.levelRequired);
193
+ }
194
+ function getSkill(id) {
195
+ return exports.SKILLS.find((s) => s.id === id);
196
+ }
197
+ //# sourceMappingURL=skills.js.map
@@ -0,0 +1,31 @@
1
+ import { BuddyState } from "../buddy/types";
2
+ import { CombatStats, CombatState, EnemyDef, StatusCondition, StatType, SkillDef, Element } from "./types";
3
+ export declare function deriveCombatStats(state: BuddyState): CombatStats;
4
+ export declare function deriveEnemyStats(enemy: EnemyDef): CombatStats;
5
+ export declare function startCombat(state: BuddyState, enemy: EnemyDef, morale?: number): CombatState;
6
+ export declare function playerAttack(combat: CombatState): CombatState;
7
+ export declare function playerDefend(combat: CombatState): CombatState;
8
+ export declare function playerFlee(combat: CombatState): CombatState;
9
+ export declare function playerUseSkill(combat: CombatState, skill: SkillDef): CombatState;
10
+ export declare function enemyTurn(combat: CombatState): CombatState;
11
+ /** Apply start-of-turn conditions to a combatant. Returns updated HP, conditions, and log messages. */
12
+ export declare function processConditions(hp: number, maxHp: number, conditions: StatusCondition[], log: string[], targetName: string): {
13
+ hp: number;
14
+ conditions: StatusCondition[];
15
+ log: string[];
16
+ skipTurn: boolean;
17
+ };
18
+ /** Apply shield absorption — returns remaining damage and updated conditions */
19
+ export declare function applyShield(damage: number, conditions: StatusCondition[]): {
20
+ damage: number;
21
+ conditions: StatusCondition[];
22
+ };
23
+ /** Check if target has a specific condition */
24
+ export declare function hasCondition(conditions: StatusCondition[], type: string): boolean;
25
+ /** Add a condition, respecting immunities */
26
+ export declare function addCondition(conditions: StatusCondition[], cond: StatusCondition, targetElement: Element): StatusCondition[];
27
+ /** Get effective stat modifier from conditions (buff/debuff) */
28
+ export declare function getConditionStatMod(conditions: StatusCondition[], stat: StatType): number;
29
+ /** Called each tick to advance animation phases */
30
+ export declare function tickCombat(combat: CombatState): CombatState;
31
+ //# sourceMappingURL=combat.d.ts.map