forked from terraforming-mars/terraforming-mars
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request terraforming-mars#2360 from kberg/moon7
Moon 7: Fix Board.getAdjacentSpaces to work properly with the Moon.
- Loading branch information
Showing
22 changed files
with
383 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import {CardName} from '../../CardName'; | ||
import {Player} from '../../Player'; | ||
import {CardType} from '../CardType'; | ||
import {IProjectCard} from '../IProjectCard'; | ||
import {Tags} from '../Tags'; | ||
import {CardRenderer} from '../render/CardRenderer'; | ||
import {Resources} from '../../Resources'; | ||
import {MoonSpaces} from '../../moon/MoonSpaces'; | ||
import {MoonExpansion} from '../../moon/MoonExpansion'; | ||
import {Card} from '../Card'; | ||
import {Units} from '../../Units'; | ||
|
||
export class MareImbriumMine extends Card implements IProjectCard { | ||
constructor() { | ||
super({ | ||
name: CardName.MARE_IMBRIUM_MINE, | ||
cardType: CardType.AUTOMATED, | ||
tags: [Tags.MOON, Tags.BUILDING], | ||
cost: 19, | ||
|
||
metadata: { | ||
description: 'Spend 1 titanium. Increase your steel production 1 step and your titanium production 1 step. Place a mine ON THE RESERVED AREA and raise Mining Rate 1 step.', | ||
cardNumber: 'M03', | ||
renderData: CardRenderer.builder((b) => { | ||
b.minus().titanium(1); | ||
b.production((pb) => pb.steel(1).titanium(1)).br; | ||
b.moonMine().asterix(); | ||
}), | ||
}, | ||
}); | ||
} | ||
|
||
public reserveUnits = Units.of({titanium: 1}); | ||
|
||
public play(player: Player) { | ||
Units.deductUnits(this.reserveUnits, player); | ||
player.addProduction(Resources.STEEL, 1); | ||
player.addProduction(Resources.TITANIUM, 1); | ||
MoonExpansion.addMineTile(player, MoonSpaces.MARE_IMBRIUM, this.name); | ||
MoonExpansion.raiseMiningRate(player); | ||
return undefined; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import {CardName} from '../../CardName'; | ||
import {Player} from '../../Player'; | ||
import {CardType} from '../CardType'; | ||
import {IProjectCard} from '../IProjectCard'; | ||
import {Tags} from '../Tags'; | ||
import {CardRenderer} from '../render/CardRenderer'; | ||
import {Resources} from '../../Resources'; | ||
import {MoonSpaces} from '../../moon/MoonSpaces'; | ||
import {MoonExpansion} from '../../moon/MoonExpansion'; | ||
import {Card} from '../Card'; | ||
import {Units} from '../../Units'; | ||
|
||
export class MareNubiumMine extends Card implements IProjectCard { | ||
constructor() { | ||
super({ | ||
name: CardName.MARE_NUBIUM_MINE, | ||
cardType: CardType.AUTOMATED, | ||
tags: [Tags.MOON, Tags.BUILDING], | ||
cost: 17, | ||
|
||
metadata: { | ||
description: 'Spend 1 titanium. Increase your titanium production 1 step. Place a mine ON THE RESERVED AREA and raise Mining Rate 1 step.', | ||
cardNumber: 'M02', | ||
renderData: CardRenderer.builder((b) => { | ||
b.minus().titanium(1); | ||
b.production((pb) => pb.titanium(1)).moonMine().asterix(); | ||
}), | ||
}, | ||
}); | ||
} | ||
|
||
public reserveUnits = Units.of({titanium: 1}); | ||
|
||
public play(player: Player) { | ||
Units.deductUnits(this.reserveUnits, player); | ||
player.addProduction(Resources.TITANIUM, 1); | ||
MoonExpansion.addMineTile(player, MoonSpaces.MARE_NUBIUM, this.name); | ||
MoonExpansion.raiseMiningRate(player); | ||
return undefined; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import {DeferredAction} from '../deferredActions/DeferredAction'; | ||
import {SelectSpace} from '../inputs/SelectSpace'; | ||
import {Player} from '../Player'; | ||
import {Resources} from '../Resources'; | ||
import {MoonExpansion} from './MoonExpansion'; | ||
|
||
export class PlaceMoonRoadTile implements DeferredAction { | ||
constructor( | ||
public player: Player, | ||
public title: string = 'Select a space on the Moon for a road tile.', | ||
) {} | ||
|
||
public execute() { | ||
const moonData = MoonExpansion.moonData(this.player.game); | ||
const spaces = moonData.moon.getAvailableSpacesOnLand(this.player); | ||
|
||
if (spaces.length === 0) { | ||
return undefined; | ||
} | ||
return new SelectSpace( | ||
this.title, | ||
spaces, | ||
(space) => { | ||
MoonExpansion.addRoadTile(this.player, space.id); | ||
MoonExpansion.raiseLogisticRate(this.player); | ||
this.player.addProduction(Resources.MEGACREDITS, 1, this.player.game); | ||
return undefined; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.