feat(game): PUA激励台增加HC消耗机制,费用=当前HC×15%,余额不足时禁用,防止无限激励破坏平衡

This commit is contained in:
Cloud Bot
2026-03-24 08:22:21 +00:00
parent adda7ae57c
commit d7253c45be
2 changed files with 137 additions and 28 deletions

View File

@@ -124,13 +124,19 @@ export function createGameScene(PhaserLib: typeof Phaser): typeof Phaser.Scene {
audio.startBGM()
})
// 注册 PUA buff 接口供 React 层调用
// 注册 PUA buff 接口 + HC 查询/扣除接口供 React 层调用
if (typeof window !== 'undefined') {
;(window as any).__gamePuaBuff = (
effect: string, score: number, title: string
) => {
this.applyPuaBuff(effect, score, title)
}
// 查询当前 HC
;(window as any).__gameGetHC = () => this.manager.hc
// 尝试扣除 HC成功返回 true不足返回 false
;(window as any).__gameSpendHC = (amount: number): boolean => {
return this.manager.spendHC(amount)
}
}
this.setupInteraction()