Implement Channel Points Twungeon MVP
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import type { GameSnapshot } from '../../domain/src/index.js'
|
||||
|
||||
export function controlDisabledReason(snapshot:GameSnapshot,twitchUserId:string|null):string|null{
|
||||
if(!twitchUserId)return 'Sign in to the Extension.'
|
||||
const p=snapshot.players.find(x=>x.twitchUserId===twitchUserId)
|
||||
if(!p)return 'Type !spawn in chat first.'
|
||||
if(!p.extensionBound)return 'Extension identity is not bound.'
|
||||
if(p.lifeState==='dead')return 'Your character is dead.'
|
||||
if(snapshot.phase.kind!=='player')return 'Wait for Player Phase.'
|
||||
if(p.ap===0)return 'No AP remains this phase.'
|
||||
return null
|
||||
}
|
||||
Reference in New Issue
Block a user