feat(game): 新增3个角色、修复实习生攻击特效、加速开发子弹、每波结束自动进入下一波

This commit is contained in:
Cloud Bot
2026-03-24 07:47:41 +00:00
parent 300f4c432f
commit c8b8c7109f
9 changed files with 392 additions and 66 deletions

View File

@@ -32,7 +32,8 @@ export class InternTower extends TowerBase {
}
attack(target: EnemyBase): void {
if (Math.random() < 0.05 && target.hp < 500) {
const isInstakill = Math.random() < 0.05 && target.hp < 500
if (isInstakill) {
target.takeDamage(9999)
this.showMessage('整顿职场!秒杀!', '#A3E635')
} else {
@@ -42,11 +43,34 @@ export class InternTower extends TowerBase {
}
private showMeleeEffect(target: EnemyBase): void {
const g = this.scene.add.graphics()
g.fillStyle(0x22c55e, 0.6)
g.fillCircle(target.x, target.y, 12)
g.setDepth(15)
this.scene.time.delayedCall(150, () => g.destroy())
// 从塔飞向目标的拳头轨迹
const fist = this.scene.add.text(this.px, this.py, '👊', {
fontSize: '18px',
}).setOrigin(0.5, 0.5).setDepth(16)
this.scene.tweens.add({
targets: fist,
x: target.x,
y: target.y,
duration: 120,
ease: 'Power2',
onComplete: () => {
fist.destroy()
// 命中爆炸圆圈
const g = this.scene.add.graphics()
g.lineStyle(3, 0xa3e635, 1)
g.strokeCircle(target.x, target.y, 16)
g.fillStyle(0xa3e635, 0.25)
g.fillCircle(target.x, target.y, 16)
g.setDepth(15)
this.scene.tweens.add({
targets: g,
scaleX: 1.6, scaleY: 1.6, alpha: 0,
duration: 250,
onComplete: () => g.destroy(),
})
},
})
}
private showMessage(msg: string, color: string): void {