Fixed some missing costs

This commit is contained in:
marcin.sciesinski
2019-09-10 10:57:34 -07:00
parent 899afb42d1
commit c5721fe4b2
4 changed files with 13 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
"19_1": {
"title": "*The One Ring",
"subtitle": "The Great Ring",
"cost": 0,
"type": "the one ring",
"effects": [
{

View File

@@ -206,6 +206,7 @@
"40_39": {
"title": "Coordinated Strike",
"culture": "elven",
"cost": 3,
"type": "condition",
"keyword": "support area",
"effects": [

View File

@@ -2,6 +2,7 @@
"40_1": {
"title": "*The One Ring",
"subtitle": "Doom of Free Peoples",
"cost": 0,
"type": "the one ring",
"strength": 1,
"vitality": 1,
@@ -63,6 +64,7 @@
"40_2": {
"title": "*The One Ring",
"subtitle": "The Ruling Ring",
"cost": 0,
"type": "the one ring",
"strength": 1,
"effects": [

View File

@@ -27,7 +27,7 @@ public class BuiltLotroCardBlueprint implements LotroCardBlueprint {
private Race race;
private Signet signet;
private Map<Keyword, Integer> keywords;
private int cost;
private int cost = -1;
private int strength;
private int vitality;
private int resistance;
@@ -807,5 +807,13 @@ public class BuiltLotroCardBlueprint implements LotroCardBlueprint {
}
if (cardType != CardType.EVENT && playEventAction != null)
throw new InvalidCardDefinitionException("Only events should have an event type effect");
if (cost == -1)
throw new InvalidCardDefinitionException("Cost was not assigned to card");
if (Arrays.asList(CardType.MINION, CardType.COMPANION, CardType.ALLY).contains(cardType)) {
if (vitality == 0)
throw new InvalidCardDefinitionException("Character has 0 vitality");
if (strength == 0)
throw new InvalidCardDefinitionException("Character has 0 strength");
}
}
}