Skip to content

Commit

Permalink
Disabled creeper card display timer
Browse files Browse the repository at this point in the history
  • Loading branch information
rhbvkleef committed Apr 23, 2018
1 parent 0a187d0 commit 234fb55
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 17 deletions.
3 changes: 2 additions & 1 deletion main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ function love.load()
require "lib.lovebird".monfn = function()
return "<b>Draw: </b>" .. inspect(STATE.drawPile) ..
"<br/><b>Discard: </b>" .. inspect(STATE.discardPile) ..
"<br/><b>Hand: </b>" .. inspect(STATE.hand)
"<br/><b>Hand: </b>" .. inspect(STATE.hand) ..
"<br/><b>Gamestate: </b>" .. Gamestate.current().name
end
end
end
Expand Down
1 change: 0 additions & 1 deletion scripts/helpers/gamerules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ function gamerules.startTurn(state)
end
end
state.currentTurnEffects = newEffects
print(state.population)
state.properties.money = state.properties.money + gamerules.getMoneyPerTurn(state) + math.min ( -gamerules.getTotalResource(state, "work"), state.properties.population)

beforeTurn.housing = gamerules.getTotalHousing(state)
Expand Down
2 changes: 2 additions & 0 deletions scripts/states/addBuilding.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
-- To change this template use File | Settings | File Templates.
--
local addBuilding = {} -- previously: Gamestate.new()
addBuilding.name = "addBuilding"

function addBuilding:enter(prev, state, building, card)
addBuilding.prev = prev
addBuilding.building = building
Expand Down
1 change: 1 addition & 0 deletions scripts/states/creeperNothingHappened.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
--

local menu = {} -- previously: Gamestate.new()
menu.name = "creeperNothingHappened"

function menu:enter(prev, state, cardIndex, card)
menu.prev = prev
Expand Down
1 change: 1 addition & 0 deletions scripts/states/dealHand.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
--
HAND = 5
local menu = {} -- previously: Gamestate.new()
menu.name = "dealHand"
function menu:enter(prev)
menu.prev = prev
menu.counter = 0
Expand Down
15 changes: 2 additions & 13 deletions scripts/states/drawCard.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,21 @@
-- To change this template use File | Settings | File Templates.
--
local menu = {} -- previously: Gamestate.new()
menu.name = "drawCard"
function menu:enter(prev)
menu.prev = prev
-- setup entities here
-- TODO: Make this take time.
menu.hasShuffled = false
menu.showCardDrawAnim = false
end

function menu:draw()
menu.prev:draw(true)

if menu.showCardDrawAnim then
end
end

function menu:update(dt, bo)
scripts.rendering.renderUI.updateMove(dt)
if not bo then
if menu.showCardDrawAnim then
menu.showCardDrawAnim = menu.showCardDrawAnim - dt
if menu.showCardDrawAnim < 0 then
Gamestate.pop()
end
return
end
local c = STATE.drawPile[1]
if c then
local card = scripts.gameobjects.cards[c]
Expand All @@ -45,7 +35,6 @@ function menu:update(dt, bo)
else
STATE.hand[#STATE.hand + 1] = c
table.remove(STATE.drawPile, 1)
menu.showCardDrawAnim = 0.5
end

else
Expand All @@ -63,7 +52,7 @@ function menu:update(dt, bo)
end

function menu:mousepressed(x, y, click)
scripts.rendering.renderUI.mousePressed(x, y, click)
Gamestate.pop()
end

function menu:mousereleased(x, y, mouse_btn)
Expand Down
1 change: 1 addition & 0 deletions scripts/states/endOfTurn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
-- To change this template use File | Settings | File Templates.
--
local menu = {} -- previously: Gamestate.new()
menu.name = "endOfTurn"
function menu:enter(prev)
menu.prev = prev
menu.changes, menu.creepers = scripts.helpers.gamerules.endTurn(STATE)
Expand Down
1 change: 1 addition & 0 deletions scripts/states/playCards.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
LOWEST = 0

local menu = {} -- previously: Gamestate.new()
menu.name = "playCards"
function menu:enter(prev)
menu.prev = prev
end
Expand Down
11 changes: 9 additions & 2 deletions scripts/states/runCard.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
--

local menu = {} -- previously: Gamestate.new()
menu.name = "runCard"

function menu:enter(prev, state, cardIndex, card)
menu.prev = prev
Expand Down Expand Up @@ -127,7 +128,9 @@ function menu:update(dt, wait)
table.remove(STATE.hand, menu.card)
end
end
Gamestate.pop()
if not scripts.gameobjects.cards[menu.cardData].is_creeper then
Gamestate.pop()
end
end
end
end
Expand All @@ -148,7 +151,11 @@ function menu:draw()
end

function menu:mousepressed(x, y, click)
scripts.rendering.renderUI.mousePressed(x, y, click)
if scripts.gameobjects.cards[menu.cardData].is_creeper then
Gamestate.pop()
else
scripts.rendering.renderUI.mousePressed(x, y, click)
end
end

function menu:mousereleased(x, y, mouse_btn)
Expand Down
1 change: 1 addition & 0 deletions scripts/states/showCard.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
--

local menu = {} -- previously: Gamestate.new()
menu.name = "showCard"
function menu:enter(prev, state, card)
menu.state = state
menu.card = card
Expand Down
1 change: 1 addition & 0 deletions scripts/states/showCreepers.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local menu = {} -- previously: Gamestate.new()
menu.name = "showCreepers"
function menu:enter(prev, cards)
menu.prev = prev
menu.cards = cards
Expand Down
1 change: 1 addition & 0 deletions scripts/states/shuffleDiscardPile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
-- To change this template use File | Settings | File Templates.
--
local menu = {} -- previously: Gamestate.new()
menu.name = "shuffleDiscardPile"
function menu:enter(prev)
menu.prev = prev
-- setup entities here
Expand Down

0 comments on commit 234fb55

Please sign in to comment.