diff --git a/scripts/gameobjects/cards.lua b/scripts/gameobjects/cards.lua index 7b5ecd5..9838b4a 100644 --- a/scripts/gameobjects/cards.lua +++ b/scripts/gameobjects/cards.lua @@ -248,20 +248,6 @@ cards.blackout = { is_creeper = true, } -cards.payback = { - name = "Payback", - effects = { - { - type = "resource", - resource="money", - value = -130, - }, - }, - requirements = {}, - costs = {}, - is_creeper = true, -} - cards.loan = { name = "Loan", effects = { diff --git a/scripts/helpers/calculations.lua b/scripts/helpers/calculations.lua index b0f3b1c..9d28e53 100644 --- a/scripts/helpers/calculations.lua +++ b/scripts/helpers/calculations.lua @@ -71,18 +71,28 @@ function z.neighbouring(state, x, y) end return false end - +local nameChanger = { + money = {"Money", 1}, + work = {"Work", -1}, + nuisance = {"Nuisance", 1}, + relaxation = {"Relaxation", 1}, + housing = {"Housing", 1}, + power = {"Nuisance", 1}, + money_per_turn = {"Money per turn", 1}, + draw = {"Hand limit: ", 1}, +} local opTable = { gt = "greater than", gte = "greater than or equal", - lt = "loewr than", + lt = "lower than", lte = "lower than or equal", eq = "equal to", } function z.requirementToString(requirement) if requirement.type == "resource" then --{ type = "resource", property = "power", relation = "gt", value = 5 } - return requirement.property .. " " .. opTable[requirement.relation] .. " " .. requirement.value + local row = (nameChanger[requirement.property]) + return row[1] .. " " .. opTable[requirement.relation] .. " " .. row[2]*requirement.value end end @@ -129,7 +139,9 @@ function z.effectToString(effect) return "Adds card " .. scripts.gameobjects.cards[effect.card].name end if effect.type == "resource" then - return effect.resource .. ": " .. effect.value + local row = (nameChanger[effect.resource]) + + return row[1] .. ": " .. row[2]*effect.value end if effect.type == "adjacent" then local acount = 2 diff --git a/scripts/helpers/gamerules.lua b/scripts/helpers/gamerules.lua index b36212c..dbbc3e6 100644 --- a/scripts/helpers/gamerules.lua +++ b/scripts/helpers/gamerules.lua @@ -111,7 +111,7 @@ function gamerules.getNextPopulation(state) population = population + math.min(gamerules.getHappiness(state), - gamerules.getAvailableWork(state)) * 0.25 - return math.floor(math.min(population, gamerules.getTotalHousing(state))) + return math.max(0,math.floor(math.min(population, gamerules.getTotalHousing(state)))) end function gamerules.shuffleDiscards(state) diff --git a/scripts/rendering/renderCard.lua b/scripts/rendering/renderCard.lua index 462308f..e61e65e 100644 --- a/scripts/rendering/renderCard.lua +++ b/scripts/rendering/renderCard.lua @@ -99,11 +99,11 @@ R.renderBuilding = function(card, x, y, scale, building) --named card for copy-p love.graphics.setFont(font) if card.effects then love.graphics.setFont(fonts["cardSectionTitle"]) - love.graphics.print("Effects", (x) / scale + 15, (y) / scale + 190) + love.graphics.print("Effects", (x) / scale + 200, (y) / scale + 190) love.graphics.setFont(fonts["cardText"]) for i, effect in ipairs(card.effects) do - love.graphics.print(scripts.helpers.calculations.effectToString(effect), (x) / scale + 15, (y) / scale + 190 + 20 * i) + love.graphics.print(scripts.helpers.calculations.effectToString(effect), (x) / scale + 10, (y) / scale + 170 + 20 * i) end end if building then diff --git a/scripts/rendering/renderUI.lua b/scripts/rendering/renderUI.lua index ce97bfb..c53b312 100644 --- a/scripts/rendering/renderUI.lua +++ b/scripts/rendering/renderUI.lua @@ -116,17 +116,16 @@ R.drawStats = function(state) love.graphics.draw(icon.image, offsetX, offsetY, angle, 0.15) end local x, y = love.mouse.getPosition() - local xg, yg = x/GLOBSCALE(), y / GLOBSCALE() + local xg, yg = x / GLOBSCALE(), y / GLOBSCALE() if yg < 30 then - love.graphics.draw(ICONS.backdrop_top.image, 0, 30, 0, 1, 2) local str = "" - if xg >200 and xg < 300 then + if xg > 200 and xg < 300 then str = "Population increases if there's enough happiness and enough work" end - if xg >300 and xg < 400 then + if xg > 300 and xg < 400 then str = "Power is produced by power-generators and consumed by other buildings." end - if xg >400 and xg < 500 then + if xg > 400 and xg < 500 then str = "Housing is created by residential buildings and apartments." end if xg > 500 and xg < 600 then @@ -136,11 +135,14 @@ R.drawStats = function(state) str = "Happiness is relaxation minus nuisance minus population." end if xg > 700 and xg < 800 then - str = "Money is created by population with work, and is used by buildings (money_per_turn)." + str = "Money is created by the employed population, and is used by buildings (Money per turn)." end - love.graphics.setColor(0,0,0) + if str ~= "" then + love.graphics.draw(ICONS.backdrop_top.image, 0, 30, 0, 1, 2) + end + love.graphics.setColor(0, 0, 0) love.graphics.print(str, 40, 45) - love.graphics.setColor(1,1,1) + love.graphics.setColor(1, 1, 1) end R.updates = {} end