Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhbvkleef committed Apr 23, 2018
2 parents 925e47d + 485fb6f commit 66638de
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 21 deletions.
2 changes: 1 addition & 1 deletion main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ STATE = {
},
hand = {},
discardPile = { "small_office", "small_generator", "small_residential"},
drawPile = {"blackout"},
drawPile = {},
currentTurnEffects = {},
cars = {},
}
Expand Down
69 changes: 49 additions & 20 deletions scripts/gameobjects/cards.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ cards.medium_generator = {
effects = {
{
type = "add_card",
card = "medium_generator",
card = "industrial_1",
},
{
type = "place_building",
building = "industrial_1",
building = "medium_generator",
},
},
requirements = {},
costs = { type = "money", value = 8 },
costs = { type = "money", value = 10 },
}

cards.wind_generator = {
Expand All @@ -46,7 +46,7 @@ cards.wind_generator = {
},
},
requirements = {},
costs = { type = "money", value = 10 },
costs = { type = "money", value = 8 },
is_creeper = false,
}

Expand All @@ -63,7 +63,7 @@ cards.small_office = {
}
},
requirements = {},
costs = {},
costs = { type = "money", value = 6},
is_creeper = false,
}

Expand All @@ -81,7 +81,7 @@ cards.large_office = {

},
requirements = {},
costs = {},
costs = { type = "money", value = 12},
is_creeper = false,
}

Expand All @@ -94,7 +94,7 @@ cards.tech_office = {
}
},
requirements = {},
costs = {},
costs = { type = "money", value = 25},
is_creeper = false,
}

Expand All @@ -116,7 +116,7 @@ cards.small_residential = {

},
requirements = {},
costs = {},
costs = { type = "money", value = 5},
is_creeper = false,
}

Expand All @@ -133,7 +133,7 @@ cards.medium_residential = {
},
},
requirements = {},
costs = {},
costs = { type = "money", value = 10},
is_creeper = false,
}

Expand All @@ -150,7 +150,7 @@ cards.small_park = {
},
},
requirements = {},
costs = { type = "money", value = 3 },
costs = { type = "money", value = 8 },
is_creeper = false,
}

Expand All @@ -163,7 +163,7 @@ cards.stadium = {
}
},
requirements = {},
costs = {},
costs = { type = "money", value = 25},
is_creeper = false,
}

Expand All @@ -174,17 +174,13 @@ cards.university = {
type = "add_card",
card = "tech_office", -- Autoloads from `cards`
},
{
type = "add_card",
card = "industrial_2", -- Autoloads from `cards`
},
{
type = "place_building",
building = "university",
},
},
requirements = {},
costs = {},
costs = { type = "money", value = 35},
is_creeper = false,
}

Expand All @@ -197,7 +193,7 @@ cards.casino = {
}
},
requirements = {},
costs = {},
costs = { type = "money", value = 25},
is_creeper = false,
}

Expand All @@ -214,7 +210,7 @@ cards.industrial_1 = {
},
},
requirements = {},
costs = {},
costs = { type = "money", value = 12},
is_creeper = false,
}

Expand All @@ -227,7 +223,7 @@ cards.industrial_2 = {
}
},
requirements = {},
costs = {},
costs = { type = "money", value = 24},
is_creeper = false,
}

Expand All @@ -246,7 +242,40 @@ cards.blackout = {
value = -10,
},
},
requirements = {{type="resource", property="power", relation="lt", value=30}},
requirements = {{type="resource", property="power", relation="lt", value=0}},
costs = {},
autoadd=true,
is_creeper = true,
}

cards.payback = {
name = "Payback",
effects = {
{
type = "resource",
resource="money",
value = -130,
},
},
requirements = {},
costs = {},
is_creeper = true,
}

cards.loan = {
name = "Loan",
effects = {
{
type = "resource",
resource="money",
value = 100,
},
{
type = "add_card",
card="payback",
},
},
requirements = {{type="resource", property="money", relation="lt", value=-10}},
costs = {},
autoadd=true,
is_creeper = true,
Expand Down
1 change: 1 addition & 0 deletions scripts/helpers/gamerules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ gamerules.resources.happiness = gamerules.getHappiness
gamerules.resources.relaxation = gamerules.getRelaxation
gamerules.resources.nuisance = gamerules.getNuisance

gamerules.resources.money = function(state) return state.properties.money end


return gamerules

0 comments on commit 66638de

Please sign in to comment.