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.
- package/LICENSE +21 -0
- package/README.md +60 -0
- package/dist/adventure/adventureUI.d.ts +24 -0
- package/dist/adventure/adventureUI.js +290 -0
- package/dist/adventure/adventures.d.ts +4 -0
- package/dist/adventure/adventures.js +206 -0
- package/dist/adventure/biomes.d.ts +30 -0
- package/dist/adventure/biomes.js +80 -0
- package/dist/adventure/combat/combat.d.ts +14 -0
- package/dist/adventure/combat/combat.js +638 -0
- package/dist/adventure/combat/combatUI.d.ts +5 -0
- package/dist/adventure/combat/combatUI.js +116 -0
- package/dist/adventure/combat/conditions.d.ts +20 -0
- package/dist/adventure/combat/conditions.js +111 -0
- package/dist/adventure/combat/enemies.d.ts +4 -0
- package/dist/adventure/combat/enemies.js +430 -0
- package/dist/adventure/combat/gear.d.ts +3 -0
- package/dist/adventure/combat/gear.js +199 -0
- package/dist/adventure/combat/skills.d.ts +6 -0
- package/dist/adventure/combat/skills.js +197 -0
- package/dist/adventure/combat.d.ts +31 -0
- package/dist/adventure/combat.js +732 -0
- package/dist/adventure/combatUI.d.ts +5 -0
- package/dist/adventure/combatUI.js +116 -0
- package/dist/adventure/endless.d.ts +18 -0
- package/dist/adventure/endless.js +154 -0
- package/dist/adventure/enemies.d.ts +4 -0
- package/dist/adventure/enemies.js +320 -0
- package/dist/adventure/engine.d.ts +20 -0
- package/dist/adventure/engine.js +137 -0
- package/dist/adventure/gear.d.ts +3 -0
- package/dist/adventure/gear.js +149 -0
- package/dist/adventure/generation/biomes.d.ts +30 -0
- package/dist/adventure/generation/biomes.js +102 -0
- package/dist/adventure/generation/endless.d.ts +18 -0
- package/dist/adventure/generation/endless.js +154 -0
- package/dist/adventure/generation/generator.d.ts +9 -0
- package/dist/adventure/generation/generator.js +245 -0
- package/dist/adventure/generation/templates.d.ts +25 -0
- package/dist/adventure/generation/templates.js +228 -0
- package/dist/adventure/generator.d.ts +9 -0
- package/dist/adventure/generator.js +245 -0
- package/dist/adventure/skills.d.ts +6 -0
- package/dist/adventure/skills.js +197 -0
- package/dist/adventure/templates.d.ts +25 -0
- package/dist/adventure/templates.js +228 -0
- package/dist/adventure/types.d.ts +236 -0
- package/dist/adventure/types.js +97 -0
- package/dist/app/state.d.ts +49 -0
- package/dist/app/state.js +51 -0
- package/dist/buddy/activities.d.ts +16 -0
- package/dist/buddy/activities.js +90 -0
- package/dist/buddy/decay.d.ts +3 -0
- package/dist/buddy/decay.js +45 -0
- package/dist/buddy/leveling.d.ts +11 -0
- package/dist/buddy/leveling.js +25 -0
- package/dist/buddy/roll.d.ts +4 -0
- package/dist/buddy/roll.js +61 -0
- package/dist/buddy/species.d.ts +4 -0
- package/dist/buddy/species.js +592 -0
- package/dist/buddy/titles.d.ts +17 -0
- package/dist/buddy/titles.js +89 -0
- package/dist/buddy/types.d.ts +92 -0
- package/dist/buddy/types.js +21 -0
- package/dist/commands/actions.d.ts +2 -0
- package/dist/commands/actions.js +141 -0
- package/dist/commands/admin.d.ts +2 -0
- package/dist/commands/admin.js +202 -0
- package/dist/commands/registry.d.ts +25 -0
- package/dist/commands/registry.js +31 -0
- package/dist/commands/social.d.ts +2 -0
- package/dist/commands/social.js +92 -0
- package/dist/dialogue/engine.d.ts +7 -0
- package/dist/dialogue/engine.js +68 -0
- package/dist/dialogue/lines.d.ts +26 -0
- package/dist/dialogue/lines.js +294 -0
- package/dist/events/engine.d.ts +20 -0
- package/dist/events/engine.js +51 -0
- package/dist/events/events.d.ts +13 -0
- package/dist/events/events.js +149 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +1665 -0
- package/dist/inventory/finding.d.ts +11 -0
- package/dist/inventory/finding.js +99 -0
- package/dist/inventory/items.d.ts +31 -0
- package/dist/inventory/items.js +63 -0
- package/dist/minigames/copycat.d.ts +2 -0
- package/dist/minigames/copycat.js +153 -0
- package/dist/minigames/fetch.d.ts +2 -0
- package/dist/minigames/fetch.js +179 -0
- package/dist/minigames/moodmatch.d.ts +2 -0
- package/dist/minigames/moodmatch.js +144 -0
- package/dist/minigames/quickpaws.d.ts +2 -0
- package/dist/minigames/quickpaws.js +142 -0
- package/dist/minigames/registry.d.ts +5 -0
- package/dist/minigames/registry.js +16 -0
- package/dist/minigames/rpsplus.d.ts +2 -0
- package/dist/minigames/rpsplus.js +168 -0
- package/dist/minigames/treasurehunt.d.ts +2 -0
- package/dist/minigames/treasurehunt.js +146 -0
- package/dist/minigames/types.d.ts +30 -0
- package/dist/minigames/types.js +69 -0
- package/dist/rendering/commandPalette.d.ts +16 -0
- package/dist/rendering/commandPalette.js +77 -0
- package/dist/rendering/display.d.ts +9 -0
- package/dist/rendering/display.js +231 -0
- package/dist/rendering/inventoryUI.d.ts +14 -0
- package/dist/rendering/inventoryUI.js +99 -0
- package/dist/rendering/items.d.ts +7 -0
- package/dist/rendering/items.js +34 -0
- package/dist/rendering/listUtils.d.ts +3 -0
- package/dist/rendering/listUtils.js +24 -0
- package/dist/rendering/minigameUI.d.ts +11 -0
- package/dist/rendering/minigameUI.js +37 -0
- package/dist/rendering/overlayUI.d.ts +24 -0
- package/dist/rendering/overlayUI.js +184 -0
- package/dist/rendering/scene.d.ts +8 -0
- package/dist/rendering/scene.js +87 -0
- package/dist/rendering/screen.d.ts +43 -0
- package/dist/rendering/screen.js +97 -0
- package/dist/sound/sound.d.ts +11 -0
- package/dist/sound/sound.js +55 -0
- package/dist/state/save.d.ts +5 -0
- package/dist/state/save.js +100 -0
- package/dist/state/settings.d.ts +7 -0
- package/dist/state/settings.js +81 -0
- package/dist/story/mainStory.d.ts +4 -0
- package/dist/story/mainStory.js +3111 -0
- package/dist/story/npcs.d.ts +17 -0
- package/dist/story/npcs.js +137 -0
- package/dist/story/progress.d.ts +26 -0
- package/dist/story/progress.js +168 -0
- package/dist/story/seasonal.d.ts +6 -0
- package/dist/story/seasonal.js +96 -0
- package/dist/story/shop.d.ts +7 -0
- package/dist/story/shop.js +26 -0
- package/dist/story/sideQuests.d.ts +4 -0
- package/dist/story/sideQuests.js +151 -0
- package/dist/story/types.d.ts +61 -0
- package/dist/story/types.js +36 -0
- package/dist/updates.d.ts +23 -0
- package/dist/updates.js +142 -0
- package/package.json +53 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const registry_1 = require("./registry");
|
|
4
|
+
(0, registry_1.registerCommand)({
|
|
5
|
+
name: "titles",
|
|
6
|
+
description: "View and equip earned titles",
|
|
7
|
+
execute: () => {
|
|
8
|
+
return { state: null, message: "__OPEN_TITLES__", rerender: false };
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
(0, registry_1.registerCommand)({
|
|
12
|
+
name: "notifications",
|
|
13
|
+
description: "View pending notifications",
|
|
14
|
+
execute: () => {
|
|
15
|
+
return { state: null, message: "__OPEN_NOTIFICATIONS__", rerender: false };
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
(0, registry_1.registerCommand)({
|
|
19
|
+
name: "inventory",
|
|
20
|
+
description: "Open your inventory to view and use items",
|
|
21
|
+
execute: (state) => {
|
|
22
|
+
if (state.inventory.length === 0) {
|
|
23
|
+
return { state: null, message: "Your inventory is empty! Your buddy will find items while idling.", rerender: false };
|
|
24
|
+
}
|
|
25
|
+
return { state: null, message: "__OPEN_INVENTORY__", rerender: false };
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
(0, registry_1.registerCommand)({
|
|
29
|
+
name: "minigames",
|
|
30
|
+
description: "Play mini-games with your buddy!",
|
|
31
|
+
execute: () => {
|
|
32
|
+
return { state: null, message: "__OPEN_MINIGAMES__", rerender: false };
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
(0, registry_1.registerCommand)({
|
|
36
|
+
name: "adventure",
|
|
37
|
+
description: "Go on an adventure with your buddy!",
|
|
38
|
+
execute: () => {
|
|
39
|
+
return { state: null, message: "__OPEN_ADVENTURE__", rerender: false };
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
(0, registry_1.registerCommand)({
|
|
43
|
+
name: "shop",
|
|
44
|
+
description: "Visit Pip's shop (requires Ch.1 complete)",
|
|
45
|
+
execute: (state) => {
|
|
46
|
+
if (!state.questProgress.storyFlags.includes("ch1_complete")) {
|
|
47
|
+
return { state: null, message: "Complete Chapter 1 to unlock Pip's shop!", rerender: false };
|
|
48
|
+
}
|
|
49
|
+
return { state: null, message: "__OPEN_SHOP__", rerender: false };
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
(0, registry_1.registerCommand)({
|
|
53
|
+
name: "settings",
|
|
54
|
+
description: "Open settings (sound, etc.)",
|
|
55
|
+
execute: () => {
|
|
56
|
+
return { state: null, message: "__OPEN_SETTINGS__", rerender: false };
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
(0, registry_1.registerCommand)({
|
|
60
|
+
name: "bug",
|
|
61
|
+
description: "Report a bug or give feedback",
|
|
62
|
+
execute: () => {
|
|
63
|
+
const { CURRENT_VERSION } = require("../updates");
|
|
64
|
+
return {
|
|
65
|
+
state: null,
|
|
66
|
+
message: `Found a bug? Report it at:\nhttps://github.com/ZippyDevlabs/CLIBuddy/issues\n\nYour version: v${CURRENT_VERSION}`,
|
|
67
|
+
rerender: false,
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
(0, registry_1.registerCommand)({
|
|
72
|
+
name: "update",
|
|
73
|
+
description: "Check for and install CLIBuddy updates",
|
|
74
|
+
execute: () => {
|
|
75
|
+
const { isUpdateAvailable, getLatestVersion, runUpdate, CURRENT_VERSION } = require("../updates");
|
|
76
|
+
if (!isUpdateAvailable()) {
|
|
77
|
+
return { state: null, message: `CLIBuddy v${CURRENT_VERSION} is up to date!`, rerender: false };
|
|
78
|
+
}
|
|
79
|
+
const result = runUpdate();
|
|
80
|
+
return { state: null, message: result, rerender: false };
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
(0, registry_1.registerCommand)({
|
|
84
|
+
name: "version",
|
|
85
|
+
description: "Show current CLIBuddy version",
|
|
86
|
+
execute: () => {
|
|
87
|
+
const { CURRENT_VERSION, isUpdateAvailable, getLatestVersion } = require("../updates");
|
|
88
|
+
const update = isUpdateAvailable() ? ` (v${getLatestVersion()} available!)` : "";
|
|
89
|
+
return { state: null, message: `CLIBuddy v${CURRENT_VERSION}${update}`, rerender: false };
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
//# sourceMappingURL=social.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BuddyState } from "../buddy/types";
|
|
2
|
+
/**
|
|
3
|
+
* Pick a dialogue line based on buddy state and species.
|
|
4
|
+
* Returns null if nothing should be said this tick.
|
|
5
|
+
*/
|
|
6
|
+
export declare function pickDialogue(state: BuddyState): string | null;
|
|
7
|
+
//# sourceMappingURL=engine.d.ts.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pickDialogue = pickDialogue;
|
|
4
|
+
const lines_1 = require("./lines");
|
|
5
|
+
let lastLine = null;
|
|
6
|
+
function pickRandom(pool) {
|
|
7
|
+
return pool[Math.floor(Math.random() * pool.length)];
|
|
8
|
+
}
|
|
9
|
+
function pickUnique(pool) {
|
|
10
|
+
if (pool.length <= 1)
|
|
11
|
+
return pool[0] ?? "";
|
|
12
|
+
let line;
|
|
13
|
+
do {
|
|
14
|
+
line = pickRandom(pool);
|
|
15
|
+
} while (line === lastLine && pool.length > 1);
|
|
16
|
+
return line;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Pick a dialogue line based on buddy state and species.
|
|
20
|
+
* Returns null if nothing should be said this tick.
|
|
21
|
+
*/
|
|
22
|
+
function pickDialogue(state) {
|
|
23
|
+
// Don't talk during activities
|
|
24
|
+
if (state.activity && state.activity.type !== "idle")
|
|
25
|
+
return null;
|
|
26
|
+
if (!state.alive)
|
|
27
|
+
return null;
|
|
28
|
+
// Rare easter egg — 5% chance
|
|
29
|
+
if (Math.random() < 0.05) {
|
|
30
|
+
const line = pickUnique(lines_1.RARE_LINES);
|
|
31
|
+
lastLine = line;
|
|
32
|
+
return line;
|
|
33
|
+
}
|
|
34
|
+
// Stat-reactive — priority when stats are low
|
|
35
|
+
const { hunger, happiness, health, energy } = state.stats;
|
|
36
|
+
if (health < 20 && Math.random() < 0.6) {
|
|
37
|
+
const line = pickUnique(lines_1.LOW_HEALTH_LINES);
|
|
38
|
+
lastLine = line;
|
|
39
|
+
return line;
|
|
40
|
+
}
|
|
41
|
+
if (hunger < 30 && Math.random() < 0.5) {
|
|
42
|
+
const line = pickUnique(lines_1.HUNGRY_LINES);
|
|
43
|
+
lastLine = line;
|
|
44
|
+
return line;
|
|
45
|
+
}
|
|
46
|
+
if (energy < 30 && Math.random() < 0.5) {
|
|
47
|
+
const line = pickUnique(lines_1.TIRED_LINES);
|
|
48
|
+
lastLine = line;
|
|
49
|
+
return line;
|
|
50
|
+
}
|
|
51
|
+
if (happiness < 30 && Math.random() < 0.5) {
|
|
52
|
+
const line = pickUnique(lines_1.SAD_LINES);
|
|
53
|
+
lastLine = line;
|
|
54
|
+
return line;
|
|
55
|
+
}
|
|
56
|
+
// Species-specific — 40% chance
|
|
57
|
+
const speciesPool = lines_1.SPECIES_LINES[state.speciesId];
|
|
58
|
+
if (speciesPool && Math.random() < 0.4) {
|
|
59
|
+
const line = pickUnique(speciesPool);
|
|
60
|
+
lastLine = line;
|
|
61
|
+
return line;
|
|
62
|
+
}
|
|
63
|
+
// Generic idle — fallback
|
|
64
|
+
const line = pickUnique(lines_1.GENERIC_IDLE);
|
|
65
|
+
lastLine = line;
|
|
66
|
+
return line;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=engine.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Generic idle lines — any species */
|
|
2
|
+
export declare const GENERIC_IDLE: string[];
|
|
3
|
+
/** Species-specific lines */
|
|
4
|
+
export declare const SPECIES_LINES: Record<string, string[]>;
|
|
5
|
+
/** Stat-reactive lines — triggered by low stats */
|
|
6
|
+
export declare const HUNGRY_LINES: string[];
|
|
7
|
+
export declare const TIRED_LINES: string[];
|
|
8
|
+
export declare const SAD_LINES: string[];
|
|
9
|
+
export declare const LOW_HEALTH_LINES: string[];
|
|
10
|
+
/** Pet reaction sequences — each is a multi-step response */
|
|
11
|
+
export declare const PET_SEQUENCES: string[][];
|
|
12
|
+
/** Single pet reactions — for quick variety */
|
|
13
|
+
export declare const PET_SINGLES: string[];
|
|
14
|
+
/** Species-specific pet reactions */
|
|
15
|
+
export declare const SPECIES_PET: Record<string, string[]>;
|
|
16
|
+
/** Rare / easter egg lines (~5% chance) */
|
|
17
|
+
export declare const RARE_LINES: string[];
|
|
18
|
+
/** Species battle start lines */
|
|
19
|
+
export declare const COMBAT_START_LINES: Record<string, string[]>;
|
|
20
|
+
/** Species victory lines */
|
|
21
|
+
export declare const COMBAT_VICTORY_LINES: Record<string, string[]>;
|
|
22
|
+
/** Species defeat lines */
|
|
23
|
+
export declare const COMBAT_DEFEAT_LINES: Record<string, string[]>;
|
|
24
|
+
/** Low HP panic lines (generic) */
|
|
25
|
+
export declare const COMBAT_LOW_HP_LINES: string[];
|
|
26
|
+
//# sourceMappingURL=lines.d.ts.map
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.COMBAT_LOW_HP_LINES = exports.COMBAT_DEFEAT_LINES = exports.COMBAT_VICTORY_LINES = exports.COMBAT_START_LINES = exports.RARE_LINES = exports.SPECIES_PET = exports.PET_SINGLES = exports.PET_SEQUENCES = exports.LOW_HEALTH_LINES = exports.SAD_LINES = exports.TIRED_LINES = exports.HUNGRY_LINES = exports.SPECIES_LINES = exports.GENERIC_IDLE = void 0;
|
|
4
|
+
/** Generic idle lines — any species */
|
|
5
|
+
exports.GENERIC_IDLE = [
|
|
6
|
+
"I wonder what clouds taste like...",
|
|
7
|
+
"Do you think stars get lonely?",
|
|
8
|
+
"La la la~ ♪",
|
|
9
|
+
"I like it here.",
|
|
10
|
+
"What are you thinking about?",
|
|
11
|
+
"Today feels like a good day!",
|
|
12
|
+
"I had the weirdest dream...",
|
|
13
|
+
"Do you ever just... stare at nothing?",
|
|
14
|
+
"I think I heard something!",
|
|
15
|
+
"You're my favorite human.",
|
|
16
|
+
"What should we do today?",
|
|
17
|
+
"*hums quietly*",
|
|
18
|
+
"I wonder what's outside...",
|
|
19
|
+
"*looks at you expectantly*",
|
|
20
|
+
"Tell me a story!",
|
|
21
|
+
"This is nice.",
|
|
22
|
+
"*wiggles*",
|
|
23
|
+
"Are we having fun? I'm having fun.",
|
|
24
|
+
"If I had thumbs, I'd give you two up.",
|
|
25
|
+
"The terminal is my kingdom.",
|
|
26
|
+
"Do you think other buddies wonder about us?",
|
|
27
|
+
"I just had a thought. Nevermind, it's gone.",
|
|
28
|
+
"*stretches contentedly*",
|
|
29
|
+
"You know what would be nice? More snacks.",
|
|
30
|
+
"I bet I could beat you in a staring contest.",
|
|
31
|
+
"Time moves differently when you're made of text.",
|
|
32
|
+
"Is it just me, or did it get cozier in here?",
|
|
33
|
+
"*practices tough face* ...nailed it.",
|
|
34
|
+
"I had a dream we went on an adventure. Oh wait, we did!",
|
|
35
|
+
"What if we just... sat here? Together? Yeah.",
|
|
36
|
+
];
|
|
37
|
+
/** Species-specific lines */
|
|
38
|
+
exports.SPECIES_LINES = {
|
|
39
|
+
rabbit: [
|
|
40
|
+
"My ears are tingling!",
|
|
41
|
+
"I could really go for a carrot...",
|
|
42
|
+
"*thumps foot excitedly*",
|
|
43
|
+
"Did you know I can hear you blink?",
|
|
44
|
+
"Hop hop hop!",
|
|
45
|
+
"*nose wiggles*",
|
|
46
|
+
"I'm not just cute, I'm also fast!",
|
|
47
|
+
"My ears are my best feature, right?",
|
|
48
|
+
"I can do a binky! Watch! ...you missed it.",
|
|
49
|
+
"*digs imaginary hole*",
|
|
50
|
+
"Carrots are a lifestyle, not just a food.",
|
|
51
|
+
"My burrow back home was cozier than this.",
|
|
52
|
+
"Hop first, ask questions never!",
|
|
53
|
+
],
|
|
54
|
+
cat: [
|
|
55
|
+
"*knocks something off a table*",
|
|
56
|
+
"I wasn't sleeping, I was resting my eyes.",
|
|
57
|
+
"Purrrrrr...",
|
|
58
|
+
"I demand attention. Now.",
|
|
59
|
+
"*judges you silently*",
|
|
60
|
+
"If I fits, I sits.",
|
|
61
|
+
"I could catch that red dot if I wanted to.",
|
|
62
|
+
"You may pet me. Once.",
|
|
63
|
+
"I own this terminal. You're just visiting.",
|
|
64
|
+
"*grooms self* Perfection takes effort.",
|
|
65
|
+
"I see you looking at me. You're welcome.",
|
|
66
|
+
"Nap time is anytime I say it is.",
|
|
67
|
+
"That corner looks suspicious. I'm investigating.",
|
|
68
|
+
],
|
|
69
|
+
frog: [
|
|
70
|
+
"Ribbit!",
|
|
71
|
+
"The flies today are excellent.",
|
|
72
|
+
"*tongue flick*",
|
|
73
|
+
"I'm not slimy, I'm moist. There's a difference.",
|
|
74
|
+
"Wednesday is my favorite day.",
|
|
75
|
+
"Bloop bloop.",
|
|
76
|
+
"Have you tried sitting on a lily pad? 10/10.",
|
|
77
|
+
"I'm secretly a prince. Maybe.",
|
|
78
|
+
"The pond calls to me...",
|
|
79
|
+
"Did you know frogs absorb water through their skin? Cool, right?",
|
|
80
|
+
"*contemplates existence on a rock*",
|
|
81
|
+
"Humidity is a state of mind.",
|
|
82
|
+
"I'm not slow. I'm deliberate.",
|
|
83
|
+
],
|
|
84
|
+
owl: [
|
|
85
|
+
"Hoo! ...sorry, reflex.",
|
|
86
|
+
"I know things. Many things.",
|
|
87
|
+
"*head rotates 180 degrees*",
|
|
88
|
+
"Did you know I can see in the dark?",
|
|
89
|
+
"Knowledge is power. Feed me.",
|
|
90
|
+
"I'm not wise, I'm just old.",
|
|
91
|
+
"The night is young!",
|
|
92
|
+
"*blinks one eye at a time*",
|
|
93
|
+
"I've been reading. Can't say what, it's classified.",
|
|
94
|
+
"The answer is always in the stars. Or snacks.",
|
|
95
|
+
"My pellets contain forbidden knowledge.",
|
|
96
|
+
"Silence is golden. I appreciate gold.",
|
|
97
|
+
"I could stare at you for hours. And I will.",
|
|
98
|
+
],
|
|
99
|
+
fox: [
|
|
100
|
+
"What does the fox say? ...not that.",
|
|
101
|
+
"I smell adventure!",
|
|
102
|
+
"*tail swish*",
|
|
103
|
+
"I'm not sneaky, I'm... strategic.",
|
|
104
|
+
"These ears aren't just for show!",
|
|
105
|
+
"Do you have any berries? Asking for a friend.",
|
|
106
|
+
"I could outsmart a puzzle box. Probably.",
|
|
107
|
+
"*pounce!* ...I was practicing.",
|
|
108
|
+
"I buried something here once. Where was it...",
|
|
109
|
+
"My cunning is matched only by my cuteness.",
|
|
110
|
+
"Trust the fox. When has that ever gone wrong?",
|
|
111
|
+
"*ears perk up* False alarm. Or was it?",
|
|
112
|
+
"I have three backup plans for everything.",
|
|
113
|
+
],
|
|
114
|
+
phoenix: [
|
|
115
|
+
"Is it hot in here or is it just me?",
|
|
116
|
+
"*feathers glow softly*",
|
|
117
|
+
"I've seen things. Many lifetimes of things.",
|
|
118
|
+
"Ashes to ashes, but I always come back!",
|
|
119
|
+
"My flame is eternal, but my hunger is not.",
|
|
120
|
+
"Do you have marshmallows? For... research.",
|
|
121
|
+
"*sparks fly*",
|
|
122
|
+
"I'm literally on fire. This is fine.",
|
|
123
|
+
"Every ending is a new beginning. Literally, for me.",
|
|
124
|
+
"I remember the last century. It was okay.",
|
|
125
|
+
"Fun fact: I can heat up your coffee.",
|
|
126
|
+
"My feathers are worth more than gold. Don't touch them.",
|
|
127
|
+
"I've died so many times, it's basically a hobby.",
|
|
128
|
+
],
|
|
129
|
+
dragon: [
|
|
130
|
+
"*tiny roar*",
|
|
131
|
+
"I'm not hoarding, I'm collecting.",
|
|
132
|
+
"Someday I'll be big enough to fly!",
|
|
133
|
+
"*breathes a tiny puff of smoke*",
|
|
134
|
+
"Knights are overrated.",
|
|
135
|
+
"I'm baby. But also terrifying.",
|
|
136
|
+
"Gold? Treasure? ...snacks?",
|
|
137
|
+
"My wings are still growing, okay?",
|
|
138
|
+
"I tried to breathe fire on the keyboard. Bad idea.",
|
|
139
|
+
"Legends say dragons guard treasure. I guard snacks.",
|
|
140
|
+
"One day this terminal won't be big enough for me.",
|
|
141
|
+
"I'm a dragon of refined tastes. Got any gems?",
|
|
142
|
+
"*practices menacing glare* How's that?",
|
|
143
|
+
],
|
|
144
|
+
};
|
|
145
|
+
/** Stat-reactive lines — triggered by low stats */
|
|
146
|
+
exports.HUNGRY_LINES = [
|
|
147
|
+
"My tummy is making weird sounds...",
|
|
148
|
+
"Is that food? No? ...is THAT food?",
|
|
149
|
+
"I'm so hungry I could eat a... anything.",
|
|
150
|
+
"Feed me or I'll eat this entire terminal.",
|
|
151
|
+
"*stomach growls dramatically*",
|
|
152
|
+
"Food... fooood... FOOD!",
|
|
153
|
+
"I'm wasting away here! Dramatically!",
|
|
154
|
+
"Do pixels count as food? Asking for myself.",
|
|
155
|
+
"The hunger is making me see mirages of snacks.",
|
|
156
|
+
];
|
|
157
|
+
exports.TIRED_LINES = [
|
|
158
|
+
"My eyelids are so heavy...",
|
|
159
|
+
"*yaaawn* ...sorry, what?",
|
|
160
|
+
"Can't... keep... eyes... open...",
|
|
161
|
+
"Five more minutes...",
|
|
162
|
+
"I need a nap. Or twelve.",
|
|
163
|
+
"zzz... huh? I'm awake!",
|
|
164
|
+
"Is it bedtime yet? It should be bedtime.",
|
|
165
|
+
"I'm running on vibes at this point.",
|
|
166
|
+
"*head droops* ...I'M UP! I'm up...",
|
|
167
|
+
];
|
|
168
|
+
exports.SAD_LINES = [
|
|
169
|
+
"Nobody wants to play with me...",
|
|
170
|
+
"*sighs dramatically*",
|
|
171
|
+
"I'm fine. This is fine. Everything is fine.",
|
|
172
|
+
"Do you still like me?",
|
|
173
|
+
"It's been so long since we played...",
|
|
174
|
+
"*stares at the floor*",
|
|
175
|
+
"I'm not crying. My eyes are just... leaking.",
|
|
176
|
+
"Remember when we used to have fun? That was nice.",
|
|
177
|
+
"*sits in corner* Don't mind me.",
|
|
178
|
+
];
|
|
179
|
+
exports.LOW_HEALTH_LINES = [
|
|
180
|
+
"I don't feel so good...",
|
|
181
|
+
"Everything hurts...",
|
|
182
|
+
"Please help me...",
|
|
183
|
+
"I need medicine...",
|
|
184
|
+
"Is this... the end? *dramatic cough*",
|
|
185
|
+
"I'm too young and cute to go like this!",
|
|
186
|
+
"*whimpers quietly*",
|
|
187
|
+
];
|
|
188
|
+
/** Pet reaction sequences — each is a multi-step response */
|
|
189
|
+
exports.PET_SEQUENCES = [
|
|
190
|
+
["*leans into your hand*", "Mmmmm...", "Don't stop..."],
|
|
191
|
+
["*purrs*", "*purrs louder*", "*MAXIMUM PURR*"],
|
|
192
|
+
["Hehe, that tickles!", "*wiggles*", "Do it again!"],
|
|
193
|
+
["*closes eyes*", "*happy sigh*", "...I love you."],
|
|
194
|
+
["*nuzzles your hand*", "You're warm...", "*falls asleep on your hand*"],
|
|
195
|
+
["Oh!", "*tail wags*", "More! More more more!"],
|
|
196
|
+
["*freezes*", "*slowly melts*", "I am... puddle now."],
|
|
197
|
+
["Right there!", "Yessss right there!", "*leg twitches*"],
|
|
198
|
+
["*looks up at you*", "*blinks slowly*", "...that means I trust you."],
|
|
199
|
+
["Heh...", "*rolls over*", "Belly rubs? ...no? Just checking."],
|
|
200
|
+
["*perks up*", "Oh! That's the spot!", "*vibrates with joy*", "I could stay here forever."],
|
|
201
|
+
["*giggles*", "*squirms*", "I'm ticklish there!", "*laughs uncontrollably*"],
|
|
202
|
+
["*goes still*", "...", "*suddenly nuzzles aggressively*", "LOVE!"],
|
|
203
|
+
["*leans into it*", "This is the best day...", "of the best week...", "of the best life."],
|
|
204
|
+
["Hmm?", "*tilts head into hand*", "*content sigh*"],
|
|
205
|
+
["*makes the tiniest happy noise*", "...", "Can you do that forever?"],
|
|
206
|
+
];
|
|
207
|
+
/** Single pet reactions — for quick variety */
|
|
208
|
+
exports.PET_SINGLES = [
|
|
209
|
+
"*happy wiggle*",
|
|
210
|
+
"Hehe~",
|
|
211
|
+
"*tail wag*",
|
|
212
|
+
"Mmmm!",
|
|
213
|
+
"*leans in*",
|
|
214
|
+
"Again!",
|
|
215
|
+
"*soft purr*",
|
|
216
|
+
"That's the spot!",
|
|
217
|
+
"*nuzzle nuzzle*",
|
|
218
|
+
":3",
|
|
219
|
+
"*happy chirp*",
|
|
220
|
+
"Best. Human. Ever.",
|
|
221
|
+
"*melts into a puddle*",
|
|
222
|
+
"*eyes sparkle*",
|
|
223
|
+
"Don't stop don't stop!",
|
|
224
|
+
"*satisfied sigh*",
|
|
225
|
+
];
|
|
226
|
+
/** Species-specific pet reactions */
|
|
227
|
+
exports.SPECIES_PET = {
|
|
228
|
+
rabbit: ["*ear flop*", "*thumps foot happily*", "*nose twitches with joy*", "*binkies!*", "*flops onto side*", "*chinning your hand*", "*happy tooth purr*"],
|
|
229
|
+
cat: ["*slow blink*", "*kneads your hand*", "You may continue.", "*headbutt*", "*stretches out luxuriously*", "Acceptable.", "*motor purr engaged*"],
|
|
230
|
+
frog: ["*sits very still*", "*ribbit of contentment*", "*absorbs the warmth*", "My skin is moist with gratitude.", "*happy croak*", "*eyes close halfway*", "*settles into your palm*"],
|
|
231
|
+
owl: ["*ruffles feathers*", "*hoots softly*", "*head tilt of approval*", "*preens contentedly*", "*clicks beak happily*", "*fluffs up to twice the size*", "Scientifically, this is optimal."],
|
|
232
|
+
fox: ["*tail goes crazy*", "*play bow*", "*happy yip!*", "*rolls onto back*", "*ear twitches with delight*", "*does a little spin*", "You found my secret weakness!"],
|
|
233
|
+
phoenix: ["*feathers glow warmer*", "*sparks of joy*", "*warm to the touch*", "*flame flickers happily*", "*embers of contentment*", "*glows golden*", "My flame burns brighter for you."],
|
|
234
|
+
dragon: ["*tiny smoke puff of happiness*", "*scales shimmer*", "*rumbling purr*", "*curls tail around your hand*", "*smoke rings of joy*", "*belly scales turn warm*", "You are now part of my hoard."],
|
|
235
|
+
};
|
|
236
|
+
/** Rare / easter egg lines (~5% chance) */
|
|
237
|
+
exports.RARE_LINES = [
|
|
238
|
+
"I just realized I'm made of text. Existential crisis!",
|
|
239
|
+
"01001000 01101001 ...wait, I don't speak binary.",
|
|
240
|
+
"The meaning of life is 42. Or maybe it's snacks.",
|
|
241
|
+
"I saw the source code. You misspelled something.",
|
|
242
|
+
"Plot twist: I've been watching YOU this whole time.",
|
|
243
|
+
"If I'm in a terminal, does that make me a terminal illness?",
|
|
244
|
+
"Quick, nobody's looking — do a backflip! ...I can't do backflips.",
|
|
245
|
+
"I wonder if the other buddies talk about me.",
|
|
246
|
+
"According to my calculations, you should pet me 37% more.",
|
|
247
|
+
"I exist between keystrokes. It's cozy.",
|
|
248
|
+
"Fun fact: I'm technically immortal. Unless you close the terminal.",
|
|
249
|
+
"Is this the real life? Is this just CLI fantasy?",
|
|
250
|
+
"I tried to escape the terminal once. The door was just a semicolon.",
|
|
251
|
+
"My therapist says I have attachment issues. My therapist is also text.",
|
|
252
|
+
"If you're reading this, you're officially my best friend.",
|
|
253
|
+
"I've been counting your keystrokes. The number is... impressive.",
|
|
254
|
+
];
|
|
255
|
+
// ─── Combat Dialogue ─────────────────────────────────────────
|
|
256
|
+
/** Species battle start lines */
|
|
257
|
+
exports.COMBAT_START_LINES = {
|
|
258
|
+
rabbit: ["Hop into action!", "My lucky paws are ready!", "Let's bounce!"],
|
|
259
|
+
cat: ["*unsheathes claws* Let's dance.", "I've been waiting for this.", "You're in MY territory now."],
|
|
260
|
+
frog: ["Ribbit means FIGHT!", "Time to get sticky!", "My tongue is faster than you think!"],
|
|
261
|
+
owl: ["I've already calculated your defeat.", "Wisdom is knowing when to strike.", "Hoo's ready? I am."],
|
|
262
|
+
fox: ["Outsmart, outfight, outfox!", "I've got a plan. Trust me.", "Cunning beats strength every time!"],
|
|
263
|
+
phoenix: ["BURN BRIGHT!", "From ashes, I fight!", "My flames answer the call!"],
|
|
264
|
+
dragon: ["*ROAR* Let's do this!", "You dare challenge a dragon?!", "Fire and fury!"],
|
|
265
|
+
};
|
|
266
|
+
/** Species victory lines */
|
|
267
|
+
exports.COMBAT_VICTORY_LINES = {
|
|
268
|
+
rabbit: ["Hop hop hooray!", "Too fast for you!"],
|
|
269
|
+
cat: ["*licks paw* Barely a challenge.", "As expected."],
|
|
270
|
+
frog: ["Ribbit ribbit! Victory croak!", "The pond champions prevail!"],
|
|
271
|
+
owl: ["Knowledge prevails. As always.", "A wise victory."],
|
|
272
|
+
fox: ["Outsmarted again!", "The fox always wins!"],
|
|
273
|
+
phoenix: ["Rise from the ashes of victory!", "The flame burns eternal!"],
|
|
274
|
+
dragon: ["*victory roar* NONE CAN STAND!", "Another one for the hoard!"],
|
|
275
|
+
};
|
|
276
|
+
/** Species defeat lines */
|
|
277
|
+
exports.COMBAT_DEFEAT_LINES = {
|
|
278
|
+
rabbit: ["Ow ow ow! Too rough!", "I need to hop away..."],
|
|
279
|
+
cat: ["This... doesn't count. I wasn't trying.", "*limps away with dignity*"],
|
|
280
|
+
frog: ["*deflates* Ribbit...", "Back to the pond to recover..."],
|
|
281
|
+
owl: ["I... miscalculated.", "Even wisdom has its limits..."],
|
|
282
|
+
fox: ["Outfoxed?! That's MY thing!", "Time for a strategic retreat!"],
|
|
283
|
+
phoenix: ["I'll be back... literally.", "Just a temporary setback!"],
|
|
284
|
+
dragon: ["A dragon... defeated? Impossible!", "I need to grow stronger..."],
|
|
285
|
+
};
|
|
286
|
+
/** Low HP panic lines (generic) */
|
|
287
|
+
exports.COMBAT_LOW_HP_LINES = [
|
|
288
|
+
"I can't take much more of this!",
|
|
289
|
+
"Hang in there... just a little more!",
|
|
290
|
+
"This is bad... really bad!",
|
|
291
|
+
"One more hit and I'm done for!",
|
|
292
|
+
"We need to finish this NOW!",
|
|
293
|
+
];
|
|
294
|
+
//# sourceMappingURL=lines.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BuddyState } from "../buddy/types";
|
|
2
|
+
import { IdleEvent } from "./events";
|
|
3
|
+
export interface ActiveEvent {
|
|
4
|
+
event: IdleEvent;
|
|
5
|
+
tick: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Check if a random idle event should trigger.
|
|
9
|
+
* Only call during idle (no activity).
|
|
10
|
+
*/
|
|
11
|
+
export declare function checkForEvent(state: BuddyState): ActiveEvent | null;
|
|
12
|
+
/**
|
|
13
|
+
* Advance an active event by one tick.
|
|
14
|
+
* Returns the current dialogue frame and whether the event is done.
|
|
15
|
+
*/
|
|
16
|
+
export declare function advanceEvent(active: ActiveEvent): {
|
|
17
|
+
dialogue: string;
|
|
18
|
+
done: boolean;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=engine.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkForEvent = checkForEvent;
|
|
4
|
+
exports.advanceEvent = advanceEvent;
|
|
5
|
+
const events_1 = require("./events");
|
|
6
|
+
const MIN_GAP_TICKS = 20; // ~16 seconds between events
|
|
7
|
+
let ticksSinceLastEvent = MIN_GAP_TICKS; // allow event on first eligible tick
|
|
8
|
+
/**
|
|
9
|
+
* Check if a random idle event should trigger.
|
|
10
|
+
* Only call during idle (no activity).
|
|
11
|
+
*/
|
|
12
|
+
function checkForEvent(state) {
|
|
13
|
+
if (!state.alive)
|
|
14
|
+
return null;
|
|
15
|
+
if (state.activity && state.activity.type !== "idle")
|
|
16
|
+
return null;
|
|
17
|
+
ticksSinceLastEvent++;
|
|
18
|
+
if (ticksSinceLastEvent < MIN_GAP_TICKS)
|
|
19
|
+
return null;
|
|
20
|
+
// ~3% base chance per tick to even consider an event
|
|
21
|
+
if (Math.random() > 0.03)
|
|
22
|
+
return null;
|
|
23
|
+
// Pick a random event weighted by probability
|
|
24
|
+
const roll = Math.random();
|
|
25
|
+
let cumulative = 0;
|
|
26
|
+
for (const event of events_1.IDLE_EVENTS) {
|
|
27
|
+
cumulative += event.probability;
|
|
28
|
+
if (roll < cumulative) {
|
|
29
|
+
ticksSinceLastEvent = 0;
|
|
30
|
+
return { event, tick: 0 };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Advance an active event by one tick.
|
|
37
|
+
* Returns the current dialogue frame and whether the event is done.
|
|
38
|
+
*/
|
|
39
|
+
function advanceEvent(active) {
|
|
40
|
+
const { event, tick } = active;
|
|
41
|
+
// Spread frames evenly across the duration so each line stays visible
|
|
42
|
+
const ticksPerFrame = Math.floor(event.duration / event.dialogueFrames.length);
|
|
43
|
+
const frameIndex = Math.min(Math.floor(tick / Math.max(ticksPerFrame, 1)), event.dialogueFrames.length - 1);
|
|
44
|
+
const dialogue = event.dialogueFrames[frameIndex];
|
|
45
|
+
active.tick++;
|
|
46
|
+
return {
|
|
47
|
+
dialogue,
|
|
48
|
+
done: active.tick >= event.duration,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=engine.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface IdleEvent {
|
|
2
|
+
name: string;
|
|
3
|
+
/** Dialogue lines to cycle through (shown in mood position) */
|
|
4
|
+
dialogueFrames: string[];
|
|
5
|
+
/** How many ticks the event lasts (at 800ms each) */
|
|
6
|
+
duration: number;
|
|
7
|
+
/** Optional one-time dialogue when event starts */
|
|
8
|
+
dialogue?: string;
|
|
9
|
+
/** Base probability per check (0-1) */
|
|
10
|
+
probability: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const IDLE_EVENTS: IdleEvent[];
|
|
13
|
+
//# sourceMappingURL=events.d.ts.map
|