import { IGlobalEvent , GlobalEvent } from './IGlobalEvent' ; import { GlobalEventName } from './GlobalEventName' ; import { PartyName } from '../parties/PartyName' ; import { Game } from '../../Game' ; import { Turmoil } from '../Turmoil' ; import { CardRenderer } from '../../cards/render/CardRenderer' ; import { Size } from '../../cards/render/Size' ; const RENDER_DATA = CardRenderer . builder ( ( b ) => { b . minus ( ) . text ( '4' ) . tr ( 1 ) . influence ( { size : Size . SMALL } ) ; } ) ; export class WarOnEarth extends GlobalEvent implements IGlobalEvent { constructor ( ) { super ( { name : GlobalEventName . WAR_ON_EARTH , description : 'Reduce TR 4 steps. Each influence prevents 1 step.' , revealedDelegate : PartyName . MARS , currentDelegate : PartyName . KELVINISTS , renderData : RENDER_DATA , } ) ; } public resolve ( game , turmoil ) { game . getPlayers ( ) . forEach ( ( player ) => { player . decreaseTerraformRatingSteps ( 4 - turmoil . getPlayerInfluence ( player ) , { log : true } ) ; } ) ; } }