import { Event } from './Event' ; import { Player } from '../../../../shared/models/entity' ; import { Choice } from '../../../../shared/models' ; export class PartyLeave extends Event { public static readonly WEIGHT = 0 ; public doChoice ( eventManager , player , choice , valueChosen ) { if ( valueChosen === 'No' ) return true ; player . $$game . partyHelper . playerLeave ( player ) ; return true ; } public operateOn ( player ) { const existingChoice = player . $choices . getChoice ( 'PartyLeave' ) ; if ( existingChoice ) return ; const choice = this . getChoice ( { id : 'PartyLeave' , desc : `
        Would you like to leave your party?
      ` , choices : [ 'Yes' , 'No' ] , defaultChoice : player . getDefaultChoice ( [ 'Yes' , 'No' ] ) } ) ; player . $choices . addChoice ( player , choice ) ; } }