import { IProjectCard } from '../IProjectCard' ; import { Tags } from '../Tags' ; import { Card } from '../Card' ; import { CardType } from '../CardType' ; import { Player } from '../../Player' ; import { LavaFlows } from '../base/LavaFlows' ; import { Resources } from '../../Resources' ; import { CardName } from '../../CardName' ; import { BoardName } from '../../boards/BoardName' ; import { PlaceCityTile } from '../../deferredActions/PlaceCityTile' ; import { CardRenderer } from '../render/CardRenderer' ; import { Units } from '../../Units' ; export class LavaTubeSettlement extends Card implements IProjectCard { constructor ( ) { super ( { cardType : CardType . AUTOMATED , name : CardName . LAVA_TUBE_SETTLEMENT , tags : [ Tags . BUILDING , Tags . CITY ] , cost : 15 , productionBox : Units . of ( { energy : - 1 , megacredits : 2 } ) , metadata : { cardNumber : 'P37' , renderData : CardRenderer . builder ( ( b ) => { b . production ( ( pb ) => { pb . minus ( ) . energy ( 1 ) . br ; pb . plus ( ) . megacredits ( 2 ) ; } ) . br ; b . city ( ) . asterix ( ) ; } ) , description : 'Decrease your Energy production 1 step and increase your M€ production 2 steps. Place a City Tile on a VOLCANIC AREA regardless of adjacent cities.' , } , } ) ; } private getSpacesForCity ( player ) { if ( player . game . gameOptions . boardName === BoardName . HELLAS ) { return player . game . board . getAvailableSpacesForCity ( player ) ; } return LavaFlows . getVolcanicSpaces ( player ) ; } public canPlay ( player ) { return this . getSpacesForCity ( player ) . length > 0 && player . getProduction ( Resources . ENERGY ) >= 1 ; } public play ( player ) { player . addProduction ( Resources . MEGACREDITS , 2 ) ; player . addProduction ( Resources . ENERGY , - 1 ) ; player . game . defer ( new PlaceCityTile ( player , 'Select either Tharsis Tholus, Ascraeus Mons, Pavonis Mons or Arsia Mons' , this . getSpacesForCity ( player ) ) ) ; return undefined ; } }