feat(game/enemies): 所有怪物子类支持 speedMultiplier/hpMultiplier 参数

This commit is contained in:
Cloud Bot
2026-03-21 09:45:17 +00:00
parent bcfd001c11
commit 185fa39b4e
5 changed files with 45 additions and 28 deletions

View File

@@ -10,18 +10,17 @@ export class BossVP extends EnemyBase {
constructor(
scene: Phaser.Scene,
pathPoints: PathPoint[],
onDestroyTower?: () => void
onDestroyTower?: () => void,
speedMultiplier: number = 1.0,
hpMultiplier: number = 1.0
) {
super(scene, pathPoints, 800, 40, 30, 150, 'enemy-boss')
super(scene, pathPoints, 800, 40, 30, 150, 'enemy-boss', speedMultiplier, hpMultiplier)
this.onDestroyTower = onDestroyTower
// BOSS 放大到 1.3 个格子(跨格的威压感)
const bossSize = this.cellW * 1.3
this.imageSprite.setDisplaySize(bossSize, bossSize)
this.imageSprite.setDepth(12)
// BOSS 出现特效
scene.cameras.main.flash(800, 255, 0, 0, false)
this.showBossAlert()
// BOSS 名字标签
this.bossLabel = scene.add.text(this.x, this.y + this.cellH * 0.5, '空降VP', {
fontFamily: 'VT323, monospace', fontSize: '14px',
color: '#FBBF24', backgroundColor: '#7c2d12', padding: { x: 4, y: 1 },
@@ -30,7 +29,7 @@ export class BossVP extends EnemyBase {
private showBossAlert(): void {
const alert = this.scene.add
.text(this.scene.scale.width / 2, this.scene.scale.height / 2, '空降VP来袭', {
.text(this.scene.scale.width / 2, this.scene.scale.height / 2, '空降VP来袭', {
fontFamily: 'VT323, monospace', fontSize: '36px',
color: '#FBBF24', backgroundColor: '#7F1D1D', padding: { x: 16, y: 8 },
}).setOrigin(0.5, 0.5).setDepth(50)
@@ -48,11 +47,9 @@ export class BossVP extends EnemyBase {
this.skillTimer = 20000
this.triggerOrgRestructure()
}
// 更新名字标签位置
if (this.bossLabel) {
this.bossLabel.setPosition(this.x, this.y + this.cellH * 0.5)
}
// BOSS 金色发光边框
this.imageSprite.setTint(this.skillTimer < 3000 ? 0xff6600 : 0xfbbf24)
}