import { IProjectCard } from '../IProjectCard' ; import { Card } from '../Card' ; import { CardType } from '../CardType' ; import { Player } from '../../Player' ; import { Resources } from '../../Resources' ; import { CardName } from '../../CardName' ; import { DecreaseAnyProduction } from '../../deferredActions/DecreaseAnyProduction' ; import { CardRequirements } from '../CardRequirements' ; import { CardRenderer } from '../render/CardRenderer' ; import { all } from '../Options' ; export class CloudSeeding extends Card implements IProjectCard { constructor ( ) { super ( { cardType : CardType . AUTOMATED , name : CardName . CLOUD_SEEDING , cost : 11 , requirements : CardRequirements . builder ( ( b ) => b . oceans ( 3 ) ) , metadata : { cardNumber : '004' , description : 'Requires 3 ocean tiles. Decrease your M€ production 1 step and any heat production 1 step. Increase your Plant production 2 steps.' , renderData : CardRenderer . builder ( ( b ) => b . production ( ( pb ) => { pb . minus ( ) . megacredits ( 1 ) . heat ( 1 , { all } ) . br ; pb . plus ( ) . plants ( 2 ) ; } ) ) , } , } ) ; } public canPlay ( player ) { return player . getProduction ( Resources . MEGACREDITS ) > - 5 && player . game . someoneHasResourceProduction ( Resources . HEAT , 1 ) ; } public play ( player ) { player . game . defer ( new DecreaseAnyProduction ( player , Resources . HEAT , { count : 1 } ) ) ; player . addProduction ( Resources . MEGACREDITS , - 1 ) ; player . addProduction ( Resources . PLANTS , 2 ) ; return undefined ; } }