feat(game): PUA激励台增加HC消耗机制,费用=当前HC×15%,余额不足时禁用,防止无限激励破坏平衡
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user