feat(gameplay): add crazy dave casino and bank, and zombie mutation lab

This commit is contained in:
Antigravity committed 2026-09-22 09:25:08 +00:00
1 parent d8be8f4366
commit b8db5a123d
16 files changed
+2365 -135

No files matched your search

+78 -1
View File
@@ -49,7 +49,17 @@ window.WaveSystem = class WaveSystem {
if (campLvl.isBoss) {
this.mode = 'boss';
}
this.customWavesConfig = campLvl.wavesConfig || campLvl.waves || null;
this.modifiers = campLvl.modifiers || {};
this.speedMultiplier = this.modifiers.speedMultiplier || campLvl.speedMultiplier || 1.0;
this.hpMultiplier = this.modifiers.hpMultiplier || campLvl.hpMultiplier || 1.0;
this.startingSun = this.modifiers.startingSun !== undefined ? this.modifiers.startingSun : (campLvl.startingSun !== undefined ? campLvl.startingSun : null);
} else {
this.customWavesConfig = null;
this.modifiers = {};
this.speedMultiplier = 1.0;
this.hpMultiplier = 1.0;
this.startingSun = null;
if (level <= 5) {
this.biome = 'day';
this.totalWaves = (level === 1) ? 3 : 4;
@@ -209,7 +219,74 @@ window.WaveSystem = class WaveSystem {
return;
}
// Adventure Campaign Waves
// Adventure Campaign Waves (Custom Server Waves or Standard Biome Progression)
if (this.customWavesConfig) {
let customWave = null;
if (Array.isArray(this.customWavesConfig)) {
customWave = this.customWavesConfig.find(w => w && w.wave === this.currentWave) || this.customWavesConfig[this.currentWave - 1];
} else if (typeof this.customWavesConfig === 'object') {
if (Array.isArray(this.customWavesConfig.list)) {
customWave = this.customWavesConfig.list.find(w => w && w.wave === this.currentWave) || this.customWavesConfig.list[this.currentWave - 1];
} else {
customWave = this.customWavesConfig[String(this.currentWave)] || this.customWavesConfig[this.currentWave - 1];
}
}
if (customWave && (customWave.squad || customWave.zombies)) {
const isLastWave = this.currentWave >= this.totalWaves;
const defaultBanner = isLastWave ? '☠️ ПОСЛЕДНЯЯ ВОЛНА!' : `ВОЛНА ${this.currentWave} / ${this.totalWaves}`;
this.bannerText = customWave.banner || customWave.bannerText || defaultBanner;
this.bannerTimer = customWave.bannerTimer || (isLastWave ? 4.0 : 3.0);
if (customWave.isHuge || customWave.is_huge || isLastWave || this.bannerText.includes('БОЛЬШАЯ') || this.bannerText.includes('ПОСЛЕДНЯЯ')) {
if (window.PvZAudio) window.PvZAudio.playHugeWave();
}
this.spawnQueue = [];
const rawSquad = customWave.squad || customWave.zombies || [];
if (Array.isArray(rawSquad)) {
for (let i = 0; i < rawSquad.length; i++) {
const item = rawSquad[i];
const zType = typeof item === 'string' ? item : (item.type || 'normal');
const delay = (typeof item === 'object' && item.delay !== undefined) ? item.delay : (2.0 + i * 2.2);
let row = (typeof item === 'object' && item.row !== undefined && item.row >= 0) ? item.row : null;
if (row === null) {
row = (zType === 'duckytube' && (this.biome === 'pool' || this.biome === 'fog'))
? (Math.random() > 0.5 ? 2 : 3)
: this.randomRow(gameState);
}
this.spawnQueue.push({ delay, type: zType, row });
}
}
// Night mode gravestones rise on final or huge wave
if (this.biome === 'night' && (isLastWave || customWave.isHuge)) {
for (const grave of gameState.grid.graves) {
setTimeout(() => {
if (gameState.isRunning) {
const bounds = gameState.grid.getCellBounds(grave.col, grave.row);
const z = new window.Zombie(grave.row, 'normal', bounds.centerX);
z.y = bounds.centerY - 5;
if (this.hpMultiplier && this.hpMultiplier !== 1.0) {
z.maxHp *= this.hpMultiplier;
z.hp *= this.hpMultiplier;
}
if (this.speedMultiplier && this.speedMultiplier !== 1.0) {
z.speed *= this.speedMultiplier;
}
gameState.zombies.push(z);
gameState.combat.createExplosionParticles(bounds.centerX, bounds.centerY);
}
}, 2500);
}
}
this.initialWaveZombies = Math.max(1, this.spawnQueue.length);
return;
}
}
// Default Biome Standard Campaign Wave Progression
if (this.currentWave === 1) {
this.bannerText = 'ПЕРВЫЕ ЗОМБИ...';
this.bannerTimer = 3.0;