-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-feast-mode.js
More file actions
227 lines (189 loc) Β· 9.81 KB
/
test-feast-mode.js
File metadata and controls
227 lines (189 loc) Β· 9.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
const chalk = require('chalk');
console.log('π½οΈ KOII FEAST MODE - MAXIMUM FOOD! π½οΈ\n');
function testFeastMode() {
const koiiStages = [
'KOII', // Stage 0: Initial form
'KO', // Stage 1: Basic form after waking
'KO°°)', // Stage 2: Gains eyes and tail
'K(°°)', // Stage 3: First body segment
'K((°°)', // Stage 4: Second body segment
'K(((°°)', // Stage 5: Third body segment
'K((((°°)', // Stage 6: Fourth body segment
'K(((((°°)', // Stage 7: Fifth body segment
'K((((((°°)', // Stage 8: Sixth body segment
'K(((((((°°)' // Stage 9: Ultimate form
];
// Evolution requirements - food needed for each stage (1.5x scaling)
// Index 0: KOII (0 food), Index 1: KO (2 food), Index 2: KO°°) (3 food), etc.
const evolutionRequirements = [0, 2, 3, 5, 8, 12, 18, 27, 41];
// Crypto token tickers
const cryptoTickers = [
'BTC', 'ETH', 'BNB', 'XRP', 'ADA', 'DOGE', 'SOL', 'TRX', 'DOT', 'MATIC',
'LTC', 'SHIB', 'AVAX', 'UNI', 'ATOM', 'LINK', 'XMR', 'ETC', 'BCH', 'NEAR',
'KOII', 'PEPE', 'FLOKI', 'BONK', 'WIF', 'BOME', 'POPCAT', 'MEW', 'NEIRO', 'GOAT'
];
let currentStage = 1; // Start as KO
let animationPhase = 'eating';
let cycles = 0;
let swimPosition = 20;
let seaweedOffset = 0;
let foodEaten = 0;
let lastEatenToken = '';
// OPTIMIZED FOOD BUFFET! Well-spaced for performance
const foodPositions = [];
for (let i = 30; i <= 450; i += 20) {
foodPositions.push(i);
}
console.log(chalk.green.bold(`π½οΈ FEAST PREPARED! ${foodPositions.length} pieces of food available!`));
const generateOceanFloor = (offset) => {
const floorLength = 80;
const seaweedPositions = [15, 25, 35, 45];
let floor = '_'.repeat(floorLength);
seaweedPositions.forEach(pos => {
const adjustedPos = (pos - offset + floorLength) % floorLength;
if (adjustedPos >= 0 && adjustedPos < floor.length) {
floor = floor.substring(0, adjustedPos) + '}' + floor.substring(adjustedPos + 1);
}
});
return floor;
};
const generateFoodLine = () => {
const lineLength = 80;
const windowStart = Math.max(0, Math.floor(swimPosition) - 40);
let foodLine = ' '.repeat(lineLength);
foodPositions.forEach(pos => {
const relativePos = pos - windowStart;
if (relativePos >= 0 && relativePos < lineLength - 1) {
foodLine = foodLine.substring(0, relativePos) + '::' + foodLine.substring(relativePos + 2);
}
});
return foodLine;
};
const checkFoodCollision = () => {
const koiiEnd = swimPosition + koiiStages[currentStage].length;
for (let i = foodPositions.length - 1; i >= 0; i--) {
const foodPos = foodPositions[i];
if (swimPosition <= foodPos && koiiEnd >= foodPos) {
foodPositions.splice(i, 1);
foodEaten++;
lastEatenToken = cryptoTickers[Math.floor(Math.random() * cryptoTickers.length)];
return true;
}
}
return false;
};
const redrawScene = (message, creature, justAte = false) => {
console.clear();
console.log(chalk.cyan.bold('\nββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ'));
console.log(chalk.cyan.bold('β KOII FEAST MODE - MAXIMUM FOOD! β'));
console.log(chalk.cyan.bold('ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n'));
const foodCounter = ` (Food eaten: ${foodEaten}/${foodPositions.length + foodEaten})`;
const tokenInfo = lastEatenToken ? ` | Last ate: ${lastEatenToken}` : '';
const nextEvolution = currentStage < koiiStages.length - 1 ?
` | Next evolution: ${evolutionRequirements[currentStage + 1] - foodEaten} more` : ' | MAX LEVEL!';
console.log(chalk.magenta.bold(message + foodCounter + tokenInfo + nextEvolution));
// Water line above food
const waterLine = '~'.repeat(80);
console.log(chalk.blue.bold(waterLine));
// Food line
const foodLine = generateFoodLine();
console.log(chalk.red.bold(foodLine));
// Fish line (right below food)
const windowStart = Math.max(0, Math.floor(swimPosition) - 40);
const relativePosition = Math.max(0, swimPosition - windowStart);
const spaces = ' '.repeat(Math.min(79, relativePosition));
// Add eating effect (*) at the front of the fish's mouth when it just ate
const eatingEffect = justAte ? chalk.red.bold('*') : '';
console.log(chalk.yellow.bold(`${spaces}${creature}${eatingEffect}`));
console.log('');
// Ocean floor
const oceanFloor = generateOceanFloor(seaweedOffset);
console.log(chalk.green.bold(oceanFloor));
console.log(chalk.gray(`\nCycle: ${cycles} | Position: ${Math.floor(swimPosition)} | Stage: ${currentStage} (${creature}) | Food remaining: ${foodPositions.length}`));
};
// Initial display
redrawScene('π½οΈ FEAST MODE ACTIVATED! The Koii approaches the buffet!', koiiStages[currentStage]);
const animationInterval = setInterval(() => {
cycles++;
seaweedOffset += 1;
switch (animationPhase) {
case 'eating': {
// Move Koii forward faster to eat more
swimPosition += 1.0; // Faster movement
// Check for food collision
const ateFood = checkFoodCollision();
// Check if ready to evolve (only when exact requirement is met)
if (ateFood && currentStage < koiiStages.length - 1) {
const requiredFood = evolutionRequirements[currentStage + 1];
if (foodEaten === requiredFood) {
// Start evolution animation - only when exact requirement is met
animationPhase = 'evolving';
cycles = 0;
} else {
const needed = requiredFood - foodEaten;
redrawScene(`π½οΈ CHOMP! The Koii ate ${lastEatenToken}! Needs ${needed} more to evolve!`, koiiStages[currentStage], true);
}
} else if (ateFood) {
// At max evolution, just show eating message
redrawScene(`π½οΈ MAXIMUM POWER! The Koii ate ${lastEatenToken}!`, koiiStages[currentStage], true);
} else {
redrawScene('π½οΈ The Koii devours the ocean buffet!', koiiStages[currentStage], false);
}
// Reset position when reaching edge - improved performance
if (swimPosition > 470) {
swimPosition = 20;
}
break;
}
case 'evolving': {
if (cycles < 8) { // Faster evolution
const bubbleFrames = ['oOOo*', 'OoOO*', '*oOO*', 'O*oO*', '*OoO*', 'oO*O*', '*o*O*', 'O*o**'];
const bubbleFrame = bubbleFrames[cycles % bubbleFrames.length];
let evolutionMessage = '';
if (currentStage === 1) {
evolutionMessage = `β¨ EVOLUTION! The Koii ate ${lastEatenToken} and gained eyes and tail! β¨`;
} else if (currentStage === 2) {
evolutionMessage = `β¨ EVOLUTION! The Koii ate ${lastEatenToken} and grew first body segment! β¨`;
} else {
evolutionMessage = `β¨ EVOLUTION! The Koii ate ${lastEatenToken} and grew bigger! β¨`;
}
redrawScene(evolutionMessage, bubbleFrame, false);
} else {
// Evolution complete
currentStage++;
let newFormMessage = '';
if (currentStage === 2) {
newFormMessage = `π EYES AND TAIL GAINED! ${koiiStages[currentStage]} is ready to feast more! π`;
} else if (currentStage === 3) {
newFormMessage = `π FIRST BODY SEGMENT! ${koiiStages[currentStage]} continues the feast! π`;
} else {
newFormMessage = `π BIGGER FISH! ${koiiStages[currentStage]} continues the feast! π`;
}
redrawScene(newFormMessage, koiiStages[currentStage], false);
// Return to eating immediately
setTimeout(() => {
animationPhase = 'eating';
cycles = 0;
}, 500);
}
break;
}
}
// Stop when all food is eaten or max evolution reached
if (foodPositions.length === 0 || (currentStage === koiiStages.length - 1 && foodEaten >= evolutionRequirements[evolutionRequirements.length - 1])) {
clearInterval(animationInterval);
console.clear();
console.log(chalk.cyan.bold('\nββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ'));
console.log(chalk.cyan.bold('β FEAST COMPLETE! β'));
console.log(chalk.cyan.bold('ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n'));
console.log(chalk.green.bold('π THE KOII HAS CONSUMED THE ENTIRE OCEAN! π'));
console.log(chalk.cyan.bold(`π Final form: ${koiiStages[currentStage]}`));
console.log(chalk.yellow.bold(`π½οΈ Total food consumed: ${foodEaten}`));
if (lastEatenToken) {
console.log(chalk.magenta.bold(`πͺ Last crypto devoured: ${lastEatenToken}`));
}
console.log(chalk.red.bold('\nπ THE OCEAN TREMBLES BEFORE THIS MIGHTY KOII! π'));
}
}, 150); // Faster animation
}
testFeastMode();