Skip to content

Commit c465624

Browse files
thaglerclaude
andcommitted
Double Pulse tower costs and fix enemy count for swarm splits
Pulse Cannon was too strong for its price -- doubled baseCost (85->170) and upgradeCosts ([127,170]->[254,340]). Swarm Cluster splitting into mini_drones now increases totalEnemies so the HUD counter stays accurate instead of hitting 0 prematurely. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 12e02c0 commit c465624

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/config/towers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ export const TOWERS: Record<string, TowerConfig> = {
8484
key: 'pulse',
8585
name: 'Pulse Cannon',
8686
description: 'Shockwave emitter. Hits all enemies in radius.',
87-
baseCost: 85,
88-
upgradeCosts: [127, 170],
87+
baseCost: 170,
88+
upgradeCosts: [254, 340],
8989
sellRefundRate: 0.5,
9090
projectileSpeed: 0, // area effect
9191
color: '#cc44ff',

src/scenes/GameScene.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,11 @@ export class GameScene extends Phaser.Scene {
229229
}
230230
});
231231

232+
// ---- Swarm split: adjust total enemy count for spawned children ----
233+
this.enemySpawner.on('enemies-spawned-from-split', (data: { count: number }) => {
234+
this.totalEnemies += data.count;
235+
});
236+
232237
// ---- Enemy reached base: lose a life + visual effects ----
233238
this.enemySpawner.on('enemy-reached-base', (data: { enemy: Enemy }) => {
234239
this.lives--;

src/systems/EnemySpawner.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ export class EnemySpawner extends Phaser.Events.EventEmitter {
228228
waypointIndex: number;
229229
}) => {
230230
this.handleSplit(data);
231+
this.emit('enemies-spawned-from-split', { count: data.splitCount });
231232
});
232233

233234
this.enemyGroup.add(enemy);

0 commit comments

Comments
 (0)