Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
difficulty={[0] = 1, 2, 3, 5, 7, 9, 10}
fearCards={[0] = {0,0,0}, {0,0,0}, {0,1,0}, {0,1,1}, {1,1,1}, {1,2,1}, {1,2,2}}
broadcast={
[0] = nil,
nil,
nil,
nil,
"Remember Portugal can only build Cities in inland lands at Level 6",
"Remember Portugal can only build Cities in inland lands at Level 6",
"Remember Portugal can only build Cities in inland lands at Level 6",
}
reminderSetup = true
mapSetup = true
-- Add reminder tokens for Build (1) Ravage (3) Explore (5)
function GetReminderSetup(params)
local reminderTiles = {}
if params.level >= 1 then
reminderTiles.build = true
end
if params.level >= 3 then
reminderTiles.ravage = true
end
if params.level >= 5 then
reminderTiles.explore = true
end
return reminderTiles
end
-- Does it need some coordinate to put the reminder tokens? I'll use existing ones and call it a day
function ReminderSetup(params)
local aidBoard = Global.getVar("aidBoard")
if params.level >= 1 then
if not params.other.build then
getObjectFromGUID("be2c91").setPositionSmooth(aidBoard.positionToWorld({-0.72,0.1,2.26}))
end
end
if params.level >= 3 then
if not params.other.ravage then
getObjectFromGUID("16ab25").setPositionSmooth(aidBoard.positionToWorld({-0.2,0.1,2.26}))
end
end
if params.level >= 5 then
if not params.other.explore then
getObjectFromGUID("f4a568").setPositionSmooth(aidBoard.positionToWorld({-1.24,0.1,2.26}))
end
end
end
function MapSetup(params)
if params.level >= 2 then
-- add 1 Explorer and Blight to land #1
table.insert(params.pieces[1],"Explorer")
table.insert(params.pieces[1],"BlightInfinite")
end
if params.level >= 4 then
-- add a town to the a lowest numbered inland lands (4+) without invaders or blight
local lowestNumberedInlandLandWithoutInvaderBlight = 4
-- first town look between 4 and the last(#) params.pieces
for i=lowestNumberedInlandLandWithoutInvaderBlight, #params.pieces, 1 do
--for each land check
local landLackExplorer = true
local landLackTown = true
local landLackCity = true
local landLackBlight = true
for _,v in pairs (params.pieces) do
if v == "Explorer" then
landLackExplorer = false
break
end
end
for _,v in pairs (params.pieces) do
if v == "Town" then
landLackTown = false
break
end
end
for _,v in pairs (params.pieces) do
if v == "City" then
landLackCity = false
break
end
end
for _,v in pairs (params.pieces) do
if v == "BlightInfinite" then
landLackBlight = false
break
end
end
evaluate_condition = (landLackExplorer and landLackTown and landLackCity and landLackBlight)
if evaluate_condition then
--if it lacks invaders and blight add town
lowestNumberedInlandLandWithoutInvaderBlight = i
table.insert(params.pieces[lowestNumberedInlandLandWithoutInvaderBlight],"Town")
break
end
end
--Add the second_town
lowestNumberedInlandLandWithoutInvaderBlight = lowestNumberedInlandLandWithoutInvaderBlight + 1;
for i=lowestNumberedInlandLandWithoutInvaderBlight, #params.pieces, 1 do
--for each land check
local landLackExplorer = true
local landLackTown = true
local landLackCity = true
local landLackBlight = true
for _,v in pairs (params.pieces) do
if v == "Explorer" then
landLackExplorer = false
break
end
end
for _,v in pairs (params.pieces) do
if v == "Town" then
landLackTown = false
break
end
end
for _,v in pairs (params.pieces) do
if v == "City" then
landLackCity = false
break
end
end
for _,v in pairs (params.pieces) do
if v == "BlightInfinite" then
landLackBlight = false
break
end
end
evaluate_condition = (landLackExplorer and landLackTown and landLackCity and landLackBlight)
if evaluate_condition then
--if it lacks invaders and blight add town
lowestNumberedInlandLandWithoutInvaderBlight = i
table.insert(params.pieces[lowestNumberedInlandLandWithoutInvaderBlight],"Town")
break
end
end
--end of second town ]]
end
return params.pieces
end
difficulty={[0] = 0, 3, 4, 6, 7, 8, 10}
fearCards={[0] = {0,0,0}, {0,0,0}, {0,1,0}, {1,0,0}, {1,0,1}, {1,1,1}, {1,2,1}}
reminderSetup = true
mapSetup = true
-- Add reminder tokens for Build (1) Ravage (3) Explore (5)
function GetReminderSetup(params)
local reminderTiles = {}
if params.level >= 1 then
reminderTiles.build = true
end
if params.level >= 5 then
reminderTiles.ravage = true
end
return reminderTiles
end
-- Does it need some coordinate to put the reminder tokens? I'll use existing ones and call it a day
function ReminderSetup(params)
local aidBoard = Global.getVar("aidBoard")
if params.level >= 1 then
if not params.other.build then
getObjectFromGUID("be2c91").setPositionSmooth(aidBoard.positionToWorld({-0.72,0.1,2.26}))
end
end
if params.level >= 5 then
if not params.other.ravage then
getObjectFromGUID("16ab25").setPositionSmooth(aidBoard.positionToWorld({-0.2,0.1,2.26}))
end
end
end
--]]
function MapSetup(params)
if params.level >= 2 then
-- replace highest town with city
local highestNumberedLandWithTown = 0
for i=#params.pieces,1,-1 do
local landHasTown = false
for _,v in pairs (params.pieces) do
if v == "Town" then
landHasTown = true
break
end
end
if landHasTown then
highestNumberedLandWithTown = i
--replace the town with a city oddly works like this, without removing the town
table.insert(params.pieces[highestNumberedLandWithTown],"City")
-- then stop looping if it finds highest town index
break
end
end
end
if params.level >= 4 then
-- add city to land #2
table.insert(params.pieces[2],"City")
end
return params.pieces
end
For spain all you really need to do is change the value in the table so something like this should do:
function MapSetup(params)
if params.level >= 2 then
-- replace highest town with city
for i=#params.pieces,1,-1 do
local landHasTown = false
for j,v in pairs (params.pieces) do
if v == "Town" then
params.pieces[j] = "City"
landHasTown = true
break
end
end
if landHasTown then
break
end
end
end
if params.level >= 4 then
-- add city to land #2
table.insert(params.pieces[2],"City")
end
return params.pieces
end
As for Portugal looking at your broadcast definition it appears to only be relevant for level 6, so you can make level 4 and 5 nil. The feature was primarily intended for non scripted setup like Sweden's Royal Backing, but you're free to use it whatever way you want. Portugal's Map setup could be done like this
function MapSetup(params)
if params.level >= 2 then
-- add 1 Explorer and Blight to land #1
table.insert(params.pieces[1],"Explorer")
table.insert(params.pieces[1],"BlightInfinite")
end
if params.level >= 4 then
-- add a town to the a lowest numbered inland lands (4+) without invaders or blight
local lowestInland = 4
local count = 0
for i=lowestInland, #params.pieces, 1 do
local noInvadersOrBlight = true
for _,v in pairs (params.pieces) do
if v == "Explorer" or v == "Town" or v == "City" or v == "BlightInfinite" then
noInvadersOrBlight = false
break
end
end
if noInvadersOrBlight then
--if it lacks invaders and blight add town
table.insert(params.pieces,"Town")
count = count + 1
end
if count == 2 then
break
end
end
end
return params.pieces
end
One thing I noticed about your code samples above is that when you were trying to iterate through all the pieces for each land, you were missing the
As for NE thematic having a 4th coastal land thanks for bringing this to my attention, I'll update the API to start adding the map guid into the params object, I think that would be the most straight forward fix for this
I used the existing reminder just to signal my abilities, regardless of nationality on it.
So the broadcast is different per level - that's good to know.
Spain is currently working. Oddly enough.
Both the code snippets I posted above were working for me (besides the Portugal Thematic issue), are you having issues besides that for Portugal?
So double adversaries can break the reminder pieces. I guess I'll remove it then.
Busy day - i'll try soon enough.
EDIT This week has been a bit full. I'll give a heads up later.
--spain script
difficulty={[0] = 1, 3, 4, 6, 7, 8, 10}
fearCards={[0] = {0,0,0}, {0,0,0}, {0,1,0}, {1,0,0}, {1,0,1}, {1,1,1}, {1,2,1}}
reminderSetup = true
mapSetup = true
hasUI = true
function ReminderSetup(params)
local reminderTiles = {}
if params.level >= 1 then
reminderTiles.build = "a178fa"
end
if params.level >= 5 then
reminderTiles.ravage = "135124"
end
return reminderTiles
end
function AdversaryUI(params)
local ui = {}
ui.escalation = {}
ui.escalation.tooltip = "Add 1 Explorer to each land of the shown terrain."
if params.level >= 1 then
ui.one = {}
ui.one.name = "Quicksilver Mining"
ui.one.tooltip = "When Building in lands without Dahan or\nBlight, add a Blight instead of a Town/City."
end
if params.level >= 3 then
ui.three = {}
ui.three.name = "Retreat and Rebuild"
ui.three.tooltip = "Whenever a City is destroyed,\nadd a Town to an adjacent land."
end
if params.level >= 5 then
ui.five = {}
ui.five.name = "Disciplined Warfare"
ui.five.tooltip = "Each turn, Dahan do not fight back\nafter a Ravage unless a Fear card\nhas been resolved that turn."
end
if params.level >= 6 then
ui.six = {}
ui.six.name = "Encomienda System"
ui.six.tooltip = "When Ravaging, Invaders deal +1 damage.\n(Total, if thare are any Invaders.)"
end
return ui
end
function MapSetup(params)
if params.level >= 2 then
-- replace highest town with city
for i=#params.pieces,1,-1 do
local landHasTown = false
for j,v in pairs (params.pieces) do
if v == "Town" then
params.pieces[j] = "City"
landHasTown = true
break
end
end
if landHasTown then
break
end
end
end
if params.level >= 4 then
-- add city to land #2
table.insert(params.pieces[2],"City")
end
return params.pieces
end
--Portugal script
difficulty={[0] = 1, 2, 3, 5, 7, 9, 10}
fearCards={[0] = {0,0,0}, {0,0,0}, {0,1,0}, {0,1,1}, {1,1,1}, {1,2,1}, {1,2,2}}
reminderSetup = true
mapSetup = true
hasUI = true
function ReminderSetup(params)
local reminderTiles = {}
if params.level >= 1 then
reminderTiles.build = "a178fa"
end
if params.level >= 3 then
reminderTiles.ravage = "135124"
end
if params.level >= 5 then
reminderTiles.ravage = "a5b6b3"
end
return reminderTiles
end
function AdversaryUI(params)
local ui = {}
ui.escalation = {}
ui.escalation.tooltip = "On each board, pick a land of the\nshown terrain without Blight. Add\n1 Blight there if there are Invaders."
if params.level >= 1 then
ui.one = {}
ui.one.name = "Great Naval Empire"
ui.one.tooltip = "When Invaders would Build a City in an Inland\nland, add a Town instead. When Invaders Build\nin a Coastal land, add both a Town and a City."
end
if params.level >= 3 then
ui.three = {}
ui.three.name = "Concentrated Population"
ui.three.tooltip = "If Blight is added to a Coastal land\nduring Ravage, add an extra Blight.\nThe additional Blight does not destory\nPresence or cause cascades."
end
if params.level >= 5 then
ui.five = {}
ui.five.name = "Massive Slave Trade"
ui.five.tooltip = "After Setup, when Exploring,\nplace 1 Town instead of 1 Explorer\non each of the lowest numbered\nterrain type matching the card.\n(This has no effect for the \"Coastal\nLands\" card during Stage II.)"
end
if params.level >= 6 then
ui.six = {}
ui.six.name = "A Kingdom United"
ui.six.tooltip = "Invaders build Cities normally in Inland lands."
end
return ui
end
function MapSetup(params)
if params.level >= 2 then
-- add 1 Explorer and Blight to land #1
table.insert(params.pieces[1],"Explorer")
table.insert(params.pieces[1],"BlightInfinite")
end
if params.level >= 4 then
-- add a town to the a lowest numbered inland lands (4+) without invaders or blight
local lowestInland = 4
if params.guid == "f4fc81" or params.guid == "14a35f" then
lowestInland = 5
end
local count = 0
for i=lowestInland, #params.pieces, 1 do
local noInvadersOrBlight = true
for _,v in pairs (params.pieces) do
if v == "Explorer" or v == "Town" or v == "City" or v == "BlightInfinite" then
noInvadersOrBlight = false
break
end
end
if noInvadersOrBlight then
--if it lacks invaders and blight add town
table.insert(params.pieces,"Town")
count = count + 1
end
if count == 2 then
break
end
end
end
return params.pieces
end
My Spain Adversary had a revision in 2 abilities and difficultity, so I had to implement these changes as well.
* The new UI features are pretty cool. Themouse hover text is a nice touch.
* Both Spain and Portugal took some additional tweaking to work.
* I'm not sure why the portugal script for adding 2 towns didn't work for me. It is working like this.
* On the upperside the identification of the board seemed to work like a charm.
* Spain probably needed an additional index to substitute the right town in the right land, so i end up using table.remove and table.insert functions.
* These are Cool generic reminders. There was a mix up of them, but I sorted it out.
--spain script
difficulty={[0] = 0, 2, 3, 4, 6, 7, 9}
fearCards={[0] = {0,0,0}, {0,0,0}, {0,1,0}, {1,0,0}, {1,0,1}, {1,1,1}, {1,2,1}}
reminderSetup = true
mapSetup = true
hasUI = true
function ReminderSetup(params)
local reminderTiles = {}
if params.level >= 1 then
reminderTiles.build = "a178fa"
end
if params.level >= 6 then
reminderTiles.ravage = "135124"
end
return reminderTiles
end
function AdversaryUI(params)
local ui = {}
ui.escalation = {}
ui.escalation.tooltip = "Add 1 Explorer to each land of the shown terrain."
if (params.level>=1 and params.level<4 ) then
ui.one = {}
ui.one.name = "Quicksilver Mining (I)"
ui.one.tooltip = "When Building in lands without Dahan or\nBlight, add a Blight instead of a Town/City."
end
if params.level >= 3 then
ui.three = {}
ui.three.name = "Retreat and Rebuild"
ui.three.tooltip = "Whenever a City is destroyed, add a Town\n to an adjacent land without a Town."
end
if params.level >= 4 then
ui.five = {}
ui.five.name = "Quicksilver Mining (II)"
ui.five.tooltip = "When Building in lands without Dahan or\nBlight, add a Blight in addition to a Town/City."
end
if params.level >= 6 then
ui.six = {}
ui.six.name = "Encomienda System"
ui.six.tooltip = "When Ravaging, Invaders deal +1 damage.\n(Total, if thare are any Invaders.)"
end
return ui
end
function MapSetup(params)
if params.level >= 2 then
for i=#params.pieces,1,-1 do
local landHasTown = false
for index, v in pairs (params.pieces) do
if v == "Town" then
landHasTown = true
table.remove(params.pieces,index)
table.insert(params.pieces,"City")
break
end
end
if landHasTown then
break
end
end
end
if params.level >= 5 then
-- add city to land #2
table.insert(params.pieces[2],"City")
end
return params.pieces
end
--Portugal script
difficulty={[0] = 1, 2, 3, 5, 7, 9, 10}
fearCards={[0] = {0,0,0}, {0,0,0}, {0,1,0}, {0,1,1}, {1,1,1}, {1,2,1}, {1,2,2}}
broadcast={
[0] = nil,
"Due Great Naval Empire, building only places Towns in inland lands.",
"Due Great Naval Empire, building only places Towns in inland lands.",
"Due Great Naval Empire, building only places Towns in inland lands.",
"Due Great Naval Empire, building only places Towns in inland lands.",
"Due Great Naval Empire, building only places Towns in inland lands.",
"You are facing Portugal level 6. Good Luck.",
}
reminderSetup = true
mapSetup = true
hasUI = true
function ReminderSetup(params)
local reminderTiles = {}
if params.level >= 1 then
reminderTiles.build = "a5b6b3"
end
if params.level >= 3 then
reminderTiles.ravage = "135124"
end
if params.level >= 5 then
reminderTiles.explore = "a178fa"
end
return reminderTiles
end
function AdversaryUI(params)
local ui = {}
ui.escalation = {}
ui.escalation.tooltip = "On each board, pick a land of the\nshown terrain without Blight. Add\n1 Blight there if there are Invaders."
if params.level >= 1 then
ui.one = {}
ui.one.name = "Great Naval Empire"
ui.one.tooltip = "When Invaders would Build a City in an Inland\nland, add a Town instead. When Invaders Build\nin a Coastal land, add both a Town and a City."
end
if params.level >= 3 then
ui.three = {}
ui.three.name = "Concentrated Population"
ui.three.tooltip = "If Blight is added to a Coastal land\nduring Ravage, add an extra Blight.\nThe additional Blight does not destory\nPresence or cause cascades."
end
if params.level >= 5 then
ui.five = {}
ui.five.name = "Massive Slave Trade"
ui.five.tooltip = "After Setup, when Exploring,\nplace 1 Town instead of 1 Explorer\non each of the lowest numbered\nterrain type matching the card.\n(This has no effect for the \"Coastal\nLands\" card during Stage II.)"
end
if params.level >= 6 then
ui.six = {}
ui.six.name = "A Kingdom United"
ui.six.tooltip = "Invaders build Cities normally in Inland lands."
end
return ui
end
function MapSetup(params)
if params.level >= 2 then
-- add 1 Explorer and Blight to land #1
table.insert(params.pieces[1],"Explorer")
table.insert(params.pieces[1],"BlightInfinite")
end
if params.level >= 4 then
-- add a town to the a lowest numbered inland lands (4+) without invaders or blight
local lowestInland = 4
if params.guid == "f4fc81" or params.guid == "14a35f" then
lowestInland = 5
end
local count = 0
for i=lowestInland, #params.pieces, 1 do
--for each land check start at true
local noInvadersOrBlight = true
--Then for each piece on that land, check if there is a forbidden piece
for _,v in pairs (params.pieces) do
if v == "Explorer" then
noInvadersOrBlight = false
break
end
if v == "Town" then
noInvadersOrBlight = false
break
end
if v == "City" then
noInvadersOrBlight = false
break
end
if v == "BlightInfinite" then
noInvadersOrBlight = false
break
end
end
--If there isn't a forbidden piece - add town and increase count
if noInvadersOrBlight then
--if it lacks invaders and blight add town
table.insert(params.pieces,"Town")
count = count + 1
end
if count == 2 then
break
end
end
end
return params.pieces
end
I even got the multistep evaluation for portugal inland towns working, it was probably due the mistake in the reminder piece that it bugged previously.
If you run into any issues getting that hooked up, please let me know
It'll probably take a a couple of weeks to go back to double adversaries, since we want to defeat each of them at level 6.
I did manage to add some blight cards. I didn't get the consequences of that "immediate" switch they have.