Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for one-sided alliances #1680

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions data/RTTR/campaigns/roman/MISS200.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@


-------------------------------- TODO -----------------------------------------
-- EnableNextMissions()
-- Set Portraits
-- Set AI Agression Level
-------------------------------------------------------------------------------


Expand Down Expand Up @@ -196,6 +194,7 @@ function onSettingsReady()
checkVersion()
rttr:Log("-----------------------\n MISS200.lua loaded... \n-----------------------\n")
rttr:ResetAddons()
rttr:SetAddon(ADDON_CATAPULTS_ATTACK_ALLIES, true)
rttr:SetAddon(ADDON_FRONTIER_DISTANCE_REACHABLE, true)
rttr:SetGameSettings({
["fow"] = EXP_CLASSIC,
Expand Down
9 changes: 6 additions & 3 deletions data/RTTR/campaigns/roman/MISS201.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
------------------------------------------------------------------------------
-- LUA-Script for MISS201.WLD (mission 2 of the original "Roman Campaign" --
-- --
-- Authors: CrazyL, Spikeone, ArthurMurray47 --
-- Authors: CrazyL, Spikeone, ArthurMurray47, kubaau --
------------------------------------------------------------------------------


-------------------------------- TODO -----------------------------------------
-- EnableNextMissions()
-- Set Portraits
-- Set AI Agression Level
-- RttR: AI doesn't go south
-------------------------------------------------------------------------------

Expand Down Expand Up @@ -154,6 +153,7 @@ function onSettingsReady()
checkVersion()
rttr:Log("-----------------------\n MISS201.lua loaded... \n-----------------------\n")
rttr:ResetAddons()
rttr:SetAddon(ADDON_CATAPULTS_ATTACK_ALLIES, true)
rttr:SetAddon(ADDON_FRONTIER_DISTANCE_REACHABLE, true)
rttr:SetGameSettings({
["fow"] = EXP_CLASSIC,
Expand All @@ -168,7 +168,6 @@ function onSettingsReady()
rttr:GetPlayer(1):SetNation(NAT_AFRICANS) -- nation
rttr:GetPlayer(1):SetColor(1) -- yellow
rttr:GetPlayer(1):SetName('Shaka') -- Enemy Name
rttr:GetPlayer(1):SetTeam(TM_TEAM1)
end

function getAllowedChanges()
Expand All @@ -185,6 +184,10 @@ end

-- start callback
function onStart(isFirstStart)
if isFirstStart then
rttr:GetPlayer(1):MakeOneSidedAllianceTo(0) -- !GLOBAL_SET_COMPUTER_ALLIANCE 1 0
end

for i = 0, 1 do -- set resources
addPlayerRes(i, not isFirstStart)
addPlayerBld(i, not isFirstStart)
Expand Down
13 changes: 9 additions & 4 deletions data/RTTR/campaigns/roman/MISS202.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
------------------------------------------------------------------------------
-- LUA-Script for MISS202.WLD (mission 3 of the original "Roman Campaign" --
-- --
-- Authors: CrazyL, Spikeone, ArthurMurray47 --
-- Authors: CrazyL, Spikeone, ArthurMurray47, kubaau --
------------------------------------------------------------------------------


-------------------------------- TODO -----------------------------------------
-- EnableNextMissions()
-- Set Portraits
-- Set AI Agression Level
-------------------------------------------------------------------------------


Expand Down Expand Up @@ -106,6 +105,7 @@ function onSettingsReady()
checkVersion()
rttr:Log("-----------------------\n MISS202.lua loaded... \n-----------------------\n")
rttr:ResetAddons()
rttr:SetAddon(ADDON_CATAPULTS_ATTACK_ALLIES, true)
rttr:SetAddon(ADDON_FRONTIER_DISTANCE_REACHABLE, true)
rttr:SetGameSettings({
["fow"] = EXP_CLASSIC,
Expand All @@ -120,13 +120,11 @@ function onSettingsReady()
rttr:GetPlayer(1):SetNation(NAT_AFRICANS) -- nation
rttr:GetPlayer(1):SetColor(1) -- yellow
rttr:GetPlayer(1):SetName('Mnga Tscha') -- Enemy Name
rttr:GetPlayer(1):SetTeam(TM_TEAM1)

rttr:GetPlayer(2):SetAI(3) -- hard AI
rttr:GetPlayer(2):SetNation(NAT_AFRICANS) -- nation
rttr:GetPlayer(2):SetColor(2) -- red
rttr:GetPlayer(2):SetName('Todo') -- Enemy Name
rttr:GetPlayer(2):SetTeam(TM_TEAM1)
end

function getAllowedChanges()
Expand All @@ -143,6 +141,13 @@ end

-- start callback
function onStart(isFirstStart)
if isFirstStart then
rttr:GetPlayer(2):MakeOneSidedAllianceTo(1) -- !GLOBAL_SET_COMPUTER_ALLIANCE 2 1
rttr:GetPlayer(1):MakeOneSidedAllianceTo(2) -- !GLOBAL_SET_COMPUTER_ALLIANCE 1 2
rttr:GetPlayer(1):MakeOneSidedAllianceTo(0) -- !GLOBAL_SET_COMPUTER_ALLIANCE 1 0
rttr:GetPlayer(2):MakeOneSidedAllianceTo(0) -- !GLOBAL_SET_COMPUTER_ALLIANCE 2 0
end

for i = 0, 2 do -- set resources
addPlayerRes(i, not isFirstStart)
addPlayerBld(i, not isFirstStart)
Expand Down
13 changes: 9 additions & 4 deletions data/RTTR/campaigns/roman/MISS203.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
------------------------------------------------------------------------------
-- LUA-Script for MISS203.WLD (mission 4 of the original "Roman Campaign") --
-- --
-- Authors: CrazyL, Spikeone, ArthurMurray47 --
-- Authors: CrazyL, Spikeone, ArthurMurray47, kubaau --
------------------------------------------------------------------------------


-------------------------------- TODO -----------------------------------------
-- EnableNextMissions()
-- Set Portraits
-- Set AI Agression Level
-------------------------------------------------------------------------------


Expand Down Expand Up @@ -105,6 +104,7 @@ function onSettingsReady()
checkVersion()
rttr:Log("-----------------------\n MISS203.lua loaded... \n-----------------------\n")
rttr:ResetAddons()
rttr:SetAddon(ADDON_CATAPULTS_ATTACK_ALLIES, true)
rttr:SetAddon(ADDON_FRONTIER_DISTANCE_REACHABLE, true)
rttr:SetGameSettings({
["fow"] = EXP_CLASSIC,
Expand All @@ -119,13 +119,11 @@ function onSettingsReady()
rttr:GetPlayer(1):SetNation(NAT_VIKINGS) -- nation
rttr:GetPlayer(1):SetColor(1) -- yellow
rttr:GetPlayer(1):SetName('Erik') -- Enemy Name
rttr:GetPlayer(1):SetTeam(TM_TEAM1)

rttr:GetPlayer(2):SetAI(3) -- hard AI
rttr:GetPlayer(2):SetNation(NAT_VIKINGS) -- nation
rttr:GetPlayer(2):SetColor(2) -- red
rttr:GetPlayer(2):SetName('Knut') -- Enemy Name
rttr:GetPlayer(2):SetTeam(TM_TEAM1)
end

function getAllowedChanges()
Expand All @@ -142,6 +140,13 @@ end

-- start callback
function onStart(isFirstStart)
if isFirstStart then
rttr:GetPlayer(2):MakeOneSidedAllianceTo(1) -- !GLOBAL_SET_COMPUTER_ALLIANCE 2 1
rttr:GetPlayer(1):MakeOneSidedAllianceTo(2) -- !GLOBAL_SET_COMPUTER_ALLIANCE 1 2
rttr:GetPlayer(1):MakeOneSidedAllianceTo(0) -- !GLOBAL_SET_COMPUTER_ALLIANCE 1 0
rttr:GetPlayer(2):MakeOneSidedAllianceTo(0) -- !GLOBAL_SET_COMPUTER_ALLIANCE 2 0
end

for i = 0, 2 do -- set resources and buildings
addPlayerRes(i, not isFirstStart)
addPlayerBld(i, not isFirstStart)
Expand Down
13 changes: 9 additions & 4 deletions data/RTTR/campaigns/roman/MISS204.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
------------------------------------------------------------------------------
-- LUA-Script for MISS204.WLD (mission 5 of the original "Roman Campaign") --
-- --
-- Authors: CrazyL, Spikeone, ArthurMurray47 --
-- Authors: CrazyL, Spikeone, ArthurMurray47, kubaau --
------------------------------------------------------------------------------


-------------------------------- TODO -----------------------------------------
-- EnableNextMissions()
-- Set Portraits
-- Set AI Agression Level
-------------------------------------------------------------------------------


Expand Down Expand Up @@ -99,6 +98,7 @@ function onSettingsReady()
checkVersion()
rttr:Log("-----------------------\n MISS204.lua loaded... \n-----------------------\n")
rttr:ResetAddons()
rttr:SetAddon(ADDON_CATAPULTS_ATTACK_ALLIES, true)
rttr:SetAddon(ADDON_FRONTIER_DISTANCE_REACHABLE, true)
rttr:SetGameSettings({
["fow"] = EXP_CLASSIC,
Expand All @@ -113,13 +113,11 @@ function onSettingsReady()
rttr:GetPlayer(1):SetNation(NAT_JAPANESE) -- nation
rttr:GetPlayer(1):SetColor(1) -- yellow
rttr:GetPlayer(1):SetName('Hakirawashi') -- Enemy Name
rttr:GetPlayer(1):SetTeam(TM_TEAM1)

rttr:GetPlayer(2):SetAI(3) -- hard AI
rttr:GetPlayer(2):SetNation(NAT_JAPANESE) -- nation
rttr:GetPlayer(2):SetColor(2) -- red
rttr:GetPlayer(2):SetName('Tsunami') -- Enemy Name
rttr:GetPlayer(2):SetTeam(TM_TEAM1)
end

function getAllowedChanges()
Expand All @@ -136,6 +134,13 @@ end

-- start callback
function onStart(isFirstStart)
if isFirstStart then
rttr:GetPlayer(2):MakeOneSidedAllianceTo(1) -- !GLOBAL_SET_COMPUTER_ALLIANCE 2 1
rttr:GetPlayer(1):MakeOneSidedAllianceTo(2) -- !GLOBAL_SET_COMPUTER_ALLIANCE 1 2
rttr:GetPlayer(1):MakeOneSidedAllianceTo(0) -- !GLOBAL_SET_COMPUTER_ALLIANCE 1 0
rttr:GetPlayer(2):MakeOneSidedAllianceTo(0) -- !GLOBAL_SET_COMPUTER_ALLIANCE 2 0
end

for i = 0, 2 do -- set resources
addPlayerRes(i, not isFirstStart)
addPlayerBld(i, not isFirstStart)
Expand Down
8 changes: 4 additions & 4 deletions data/RTTR/campaigns/roman/MISS205.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
------------------------------------------------------------------------------
-- LUA-Script for MISS205.WLD (mission 6 of the original "Roman Campaign" --
-- --
-- Authors: CrazyL, Spikeone, ArthurMurray47 --
-- Authors: CrazyL, Spikeone, ArthurMurray47, kubaau --
------------------------------------------------------------------------------


-------------------------------- TODO -----------------------------------------
-- EnableNextMissions()
-- Set Portraits
-- Set AI Agression Level
-------------------------------------------------------------------------------


Expand Down Expand Up @@ -99,6 +98,7 @@ function onSettingsReady()
checkVersion()
rttr:Log("-----------------------\n MISS205.lua loaded... \n-----------------------\n")
rttr:ResetAddons()
rttr:SetAddon(ADDON_CATAPULTS_ATTACK_ALLIES, true)
rttr:SetAddon(ADDON_FRONTIER_DISTANCE_REACHABLE, true)
rttr:SetGameSettings({
["fow"] = EXP_CLASSIC,
Expand All @@ -113,13 +113,11 @@ function onSettingsReady()
rttr:GetPlayer(1):SetNation(NAT_VIKINGS) -- nation
rttr:GetPlayer(1):SetColor(1) -- yellow
rttr:GetPlayer(1):SetName('Erik') -- Enemy Name
rttr:GetPlayer(1):SetTeam(TM_TEAM1)

rttr:GetPlayer(2):SetAI(3) -- hard AI
rttr:GetPlayer(2):SetNation(NAT_VIKINGS) -- nation
rttr:GetPlayer(2):SetColor(2) -- red
rttr:GetPlayer(2):SetName('Olof') -- Enemy Name
rttr:GetPlayer(2):SetTeam(TM_TEAM1)
end

function getAllowedChanges()
Expand All @@ -136,6 +134,8 @@ end

-- start callback
function onStart(isFirstStart)
-- no alliances in this mission

for i = 0, 2 do -- set resources
addPlayerRes(i, not isFirstStart)
addPlayerBld(i, not isFirstStart)
Expand Down
13 changes: 9 additions & 4 deletions data/RTTR/campaigns/roman/MISS206.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
------------------------------------------------------------------------------
-- LUA-Script for MISS206.WLD (mission 7 of the original "Roman Campaign" --
-- --
-- Authors: CrazyL, Spikeone, ArthurMurray47 --
-- Authors: CrazyL, Spikeone, ArthurMurray47, kubaau --
------------------------------------------------------------------------------


-------------------------------- TODO -----------------------------------------
-- EnableNextMissions()
-- Set Portraits
-- Set AI Agression Level
-------------------------------------------------------------------------------


Expand Down Expand Up @@ -99,6 +98,7 @@ function onSettingsReady()
checkVersion()
rttr:Log("-----------------------\n MISS206.lua loaded... \n-----------------------\n")
rttr:ResetAddons() -- S2-settings
rttr:SetAddon(ADDON_CATAPULTS_ATTACK_ALLIES, true)
rttr:SetAddon(ADDON_FRONTIER_DISTANCE_REACHABLE, true)
rttr:SetGameSettings({
["fow"] = EXP_CLASSIC,
Expand All @@ -113,13 +113,11 @@ function onSettingsReady()
rttr:GetPlayer(1):SetNation(NAT_VIKINGS) -- nation
rttr:GetPlayer(1):SetColor(1) -- yellow
rttr:GetPlayer(1):SetName('Erik') -- Enemy Name
rttr:GetPlayer(1):SetTeam(TM_TEAM1)

rttr:GetPlayer(2):SetAI(3) -- hard AI
rttr:GetPlayer(2):SetNation(NAT_VIKINGS) -- nation
rttr:GetPlayer(2):SetColor(2) -- red
rttr:GetPlayer(2):SetName('Olof') -- Enemy Name
rttr:GetPlayer(2):SetTeam(TM_TEAM1)
end

function getAllowedChanges()
Expand All @@ -136,6 +134,13 @@ end

-- start callback
function onStart(isFirstStart)
if isFirstStart then
rttr:GetPlayer(2):MakeOneSidedAllianceTo(1) -- !GLOBAL_SET_COMPUTER_ALLIANCE 2 1
rttr:GetPlayer(1):MakeOneSidedAllianceTo(2) -- !GLOBAL_SET_COMPUTER_ALLIANCE 1 2
rttr:GetPlayer(1):MakeOneSidedAllianceTo(0) -- !GLOBAL_SET_COMPUTER_ALLIANCE 1 0
rttr:GetPlayer(2):MakeOneSidedAllianceTo(0) -- !GLOBAL_SET_COMPUTER_ALLIANCE 2 0
end

for i = 0, (rttr:GetPlayerCount() - 1) do -- set resources
addPlayerRes(i, not isFirstStart)
addPlayerBld(i, not isFirstStart)
Expand Down
12 changes: 8 additions & 4 deletions data/RTTR/campaigns/roman/MISS207.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
------------------------------------------------------------------------------
-- LUA-Script for MISS207.WLD (mission 8 of the original "Roman Campaign") --
-- --
-- Authors: CrazyL, Spikeone, ArthurMurray47 --
-- Authors: CrazyL, Spikeone, ArthurMurray47, kubaau --
------------------------------------------------------------------------------


-------------------------------- TODO -----------------------------------------
-- EnableNextMissions()
-- Set Portraits
-- Set AI Agression Level
-------------------------------------------------------------------------------


Expand Down Expand Up @@ -87,6 +86,7 @@ function onSettingsReady()
checkVersion()
rttr:Log("-----------------------\n MISS207.lua loaded... \n-----------------------\n")
rttr:ResetAddons()
rttr:SetAddon(ADDON_CATAPULTS_ATTACK_ALLIES, true)
rttr:SetAddon(ADDON_FRONTIER_DISTANCE_REACHABLE, true)
rttr:SetGameSettings({
["fow"] = EXP_CLASSIC,
Expand All @@ -101,17 +101,21 @@ function onSettingsReady()
rttr:GetPlayer(1):SetNation(NAT_AFRICANS) -- nation
rttr:GetPlayer(1):SetColor(1) -- yellow
rttr:GetPlayer(1):SetName('Mnga Tscha') -- Enemy Name
rttr:GetPlayer(1):SetTeam(TM_TEAM1)

rttr:GetPlayer(2):SetAI(3) -- hard AI
rttr:GetPlayer(2):SetNation(NAT_AFRICANS) -- nation
rttr:GetPlayer(2):SetColor(2) -- red
rttr:GetPlayer(2):SetName('Todo') -- Enemy Name
rttr:GetPlayer(2):SetTeam(TM_TEAM1)
end

-- start callback
function onStart(isFirstStart)
if isFirstStart then
rttr:GetPlayer(1):MakeOneSidedAllianceTo(2) -- !GLOBAL_SET_COMPUTER_ALLIANCE 1 2
rttr:GetPlayer(2):MakeOneSidedAllianceTo(1) -- !GLOBAL_SET_COMPUTER_ALLIANCE 2 1
rttr:GetPlayer(2):MakeOneSidedAllianceTo(0) -- !GLOBAL_SET_COMPUTER_ALLIANCE 2 0
end

for i = 0, (rttr:GetPlayerCount() - 1) do -- set resources
addPlayerRes(i, not isFirstStart)
addPlayerBld(i, not isFirstStart)
Expand Down
Loading