import { Entity } from "./entity" ; import { GAME } from "./GAME" ; import { GameState , SetGameState } from "./gamestate" ; import { Gui } from "./gui" ; import { Party } from "./party" ; import { IParse , Text } from "./text" ; export class PrisonMinigame { public party : Entity [ ] ; public enemy : Party ; constructor ( opts ? ) { opts = opts || { } ; this . party = opts . party || [ ] ; this . enemy = opts . enemy || new Party ( ) ; } public Prep ( ) { const party = GAME ( ) . party ; party . SaveActiveParty ( ) ; party . ClearActiveParty ( ) ; for ( const p of this . party ) { party . SwitchIn ( p ) ; } SetGameState ( GameState . Combat , Gui ) ; } public Cleanup ( ) { const party = GAME ( ) . party ; for ( const e of this . enemy . members ) { e . ClearCombatBonuses ( ) ; e . combatStatus . EndOfCombat ( ) ; } for ( const e of party . members ) { e . ClearCombatBonuses ( ) ; e . combatStatus . EndOfCombat ( ) ; } party . LoadActiveParty ( ) ; SetGameState ( GameState . Event , Gui ) ; } public Tick ( ) { const parse = { } ; Text . Clear ( ) ; Text . Add ( "" , parse ) ; Text . NL ( ) ; Text . Flush ( ) ; Gui . ClearButtons ( ) ; } }