Skip to content

Instantly share code, notes, and snippets.

@TomiToivio
Created June 16, 2014 02:05
Show Gist options
  • Save TomiToivio/fefb80bb0f35e2a58d53 to your computer and use it in GitHub Desktop.
Save TomiToivio/fefb80bb0f35e2a58d53 to your computer and use it in GitHub Desktop.
local P = {}
AI_SOV = P
function P.ProposeDeclareWar( minister )
local ai = minister:GetOwnerAI()
local ministerCountry = minister:GetCountry()
local strategy = ministerCountry:GetStrategy()
local year = ai:GetCurrentDate():GetYear()
local month = ai:GetCurrentDate():GetMonthOfYear()
local perTag = CCountryDataBase.GetTag('PER')
if not ministerCountry:GetRelation(perTag):HasWar()
and not perTag:GetCountry():IsSubject()
and CCurrentGameState.GetProvince( 9158 ):GetController() == perTag
then
strategy:PrepareWar( perTag, 100 )
end
end
function P.ManageSpyMissionAtHome(newMission, ai, minister, ministerCountry)
if not ministerCountry:IsAtWar() then
newMission = SpyMission.SPYMISSION_LOWER_NEUTRALITY
end
return newMission
end
function P.PickBestMission(ai, minister, countryTag, bestMission, bestScore )
if tostring(countryTag) == 'GER' then
bestMission = SpyMission.SPYMISSION_INCREASE_THREAT
else
bestMission = SpyMission.SPYMISSION_BOOST_OUR_PARTY
end
return bestMission
end
return AI_SOV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment