Skip to content

Commit

Permalink
England will now move the cards from ontop of high immigration onto d…
Browse files Browse the repository at this point in the history
…iscard as well
  • Loading branch information
iakona committed Mar 4, 2021
1 parent d77d853 commit 0f57ae3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion objects/a62bd7/contained/e5d18b/object.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"MeasureMovement": false,
"DragSelectable": true,
"Autoraise": true,
"Sticky": true,
"Sticky": false,
"Tooltip": true,
"GridProjection": false,
"HideWhenFaceDown": false,
Expand Down
24 changes: 22 additions & 2 deletions objects/b765cf/script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ function onObjectPickUp(player_color, picked_up_object)
UI.setAttribute("panelBuild2","active",false)
UI.setAttribute("panelInvader","width","380")
local aidBoard = Global.getVar("aidBoard")
moveDiscard(aidBoard)
moveDiscard(aidBoard, picked_up_object)
removeEnglandSnap(aidBoard)
end
end
function moveDiscard(aidBoard)
function moveDiscard(aidBoard, immigrationTile)
local currentDiscard = aidBoard.getTable("discard")
local hits = Physics.cast({
origin = currentDiscard,
Expand All @@ -57,6 +57,26 @@ function moveDiscard(aidBoard)
end
end
end

hits = Physics.cast({
origin = immigrationTile.getPosition(),
direction = Vector(0,1,0),
type = 3,
size = Vector(1,0.9,1.5),
orientation = Vector(0,90,0),
max_distance = 0,
--debug = true,
})
for _,hit in pairs(hits) do
if hit.hit_object ~= immigrationTile then
if hit.hit_object.type == "Card" or hit.hit_object.type == "Deck" then
Wait.frames(function()
hit.hit_object.setPosition(originalDiscardPosition + Vector(0,0.5,0))
hit.hit_object.setRotation(Vector(0,90,0))
end, 1)
end
end
end
end
function removeEnglandSnap(aidBoard)
local snapPoints = Global.getSnapPoints()
Expand Down

0 comments on commit 0f57ae3

Please sign in to comment.