Skip to content
Draft
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
4 changes: 1 addition & 3 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 @@ -508,9 +506,9 @@ function MissionEvent(e, onLoad)
rttr:GetPlayer(0):EnableBuilding(BLD_BAKERY, not onLoad)

elseif(e == 99) then
-- TODO: EnableNextMissions()
-- Show opened arc
rttr:GetWorld():AddStaticObject(14, 8, 561, 0xFFFF, 2)
rttr:SetCampaignChapterCompleted("roman", 0)
end

-- update event state
Expand Down
4 changes: 2 additions & 2 deletions data/RTTR/campaigns/roman/MISS201.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


-------------------------------- TODO -----------------------------------------
-- EnableNextMissions()
-- Set Portraits
-- Set AI Agression Level
-- RttR: AI doesn't go south
Expand Down Expand Up @@ -514,9 +513,10 @@ function MissionEvent(e, onLoad)
rttr:GetPlayer(1):DisableBuilding(BLD_CATAPULT, false)

elseif(e == 99) then
-- TODO: EnableNextMissions()
-- Show opened arc
rttr:GetWorld():AddStaticObject(48, 9, 561, 0xFFFF, 2)
rttr:SetCampaignChapterCompleted("roman", 1)
rttr:EnableCampaignChapter("roman", 2)
end

-- update event state
Expand Down
4 changes: 2 additions & 2 deletions data/RTTR/campaigns/roman/MISS202.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


-------------------------------- TODO -----------------------------------------
-- EnableNextMissions()
-- Set Portraits
-- Set AI Agression Level
-------------------------------------------------------------------------------
Expand Down Expand Up @@ -496,9 +495,10 @@ function MissionEvent(e, onLoad)
rttr:GetPlayer(0):EnableBuilding(BLD_LOOKOUTTOWER, not onLoad)

elseif(e == 99) then
-- TODO: EnableNextMissions()
-- Show opened arc
rttr:GetWorld():AddStaticObject(89, 20, 561, 0xFFFF, 2)
rttr:SetCampaignChapterCompleted("roman", 2)
rttr:EnableCampaignChapter("roman", 3)
end

-- update event state
Expand Down
4 changes: 2 additions & 2 deletions data/RTTR/campaigns/roman/MISS203.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


-------------------------------- TODO -----------------------------------------
-- EnableNextMissions()
-- Set Portraits
-- Set AI Agression Level
-------------------------------------------------------------------------------
Expand Down Expand Up @@ -477,9 +476,10 @@ function MissionEvent(e, onLoad)
rttr:GetPlayer(0):EnableBuilding(BLD_SHIPYARD, not onLoad)

elseif(e == 99) then
-- TODO: EnableNextMissions()
-- Show opened arc
rttr:GetWorld():AddStaticObject(97, 68, 561, 0xFFFF, 2)
rttr:SetCampaignChapterCompleted("roman", 3)
rttr:EnableCampaignChapter("roman", 4)
end

-- update event state
Expand Down
4 changes: 2 additions & 2 deletions data/RTTR/campaigns/roman/MISS204.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


-------------------------------- TODO -----------------------------------------
-- EnableNextMissions()
-- Set Portraits
-- Set AI Agression Level
-------------------------------------------------------------------------------
Expand Down Expand Up @@ -433,9 +432,10 @@ function MissionEvent(e, onLoad)

-- call side effects for active events, check "eState[e] == 1" for multiple call events!
if(e == 99) then
-- TODO: EnableNextMissions()
-- Show opened arc
rttr:GetWorld():AddStaticObject(19, 37, 561, 0xFFFF, 2)
rttr:SetCampaignChapterCompleted("roman", 4)
rttr:EnableCampaignChapter("roman", 5)
end

-- update event state
Expand Down
5 changes: 3 additions & 2 deletions data/RTTR/campaigns/roman/MISS205.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


-------------------------------- TODO -----------------------------------------
-- EnableNextMissions()
-- Set Portraits
-- Set AI Agression Level
-------------------------------------------------------------------------------
Expand Down Expand Up @@ -491,9 +490,11 @@ function MissionEvent(e, onLoad)

-- call side effects for active events, check "eState[e] == 1" for multiple call events!
if(e == 99) then
-- TODO: EnableNextMissions()
-- Show opened arc
rttr:GetWorld():AddStaticObject(148, 50, 561, 0xFFFF, 2)
rttr:SetCampaignChapterCompleted("roman", 5)
rttr:EnableCampaignChapter("roman", 6)
rttr:EnableCampaignChapter("roman", 7) -- TODO: remove this when chapter 7 is playable
end

-- update event state
Expand Down
4 changes: 2 additions & 2 deletions data/RTTR/campaigns/roman/MISS206.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


-------------------------------- TODO -----------------------------------------
-- EnableNextMissions()
-- Set Portraits
-- Set AI Agression Level
-------------------------------------------------------------------------------
Expand Down Expand Up @@ -451,9 +450,10 @@ function MissionEvent(e, onLoad)

-- call side effects for active events, check "eState[e] == 1" for multiple call events!
if(e == 99) then
-- TODO: EnableNextMissions()
-- Show opened arc
rttr:GetWorld():AddStaticObject(13, 66, 561, 0xFFFF, 2)
rttr:SetCampaignChapterCompleted("roman", 6)
rttr:EnableCampaignChapter("roman", 7)
end

-- update event state
Expand Down
4 changes: 2 additions & 2 deletions data/RTTR/campaigns/roman/MISS207.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


-------------------------------- TODO -----------------------------------------
-- EnableNextMissions()
-- Set Portraits
-- Set AI Agression Level
-------------------------------------------------------------------------------
Expand Down Expand Up @@ -422,9 +421,10 @@ function MissionEvent(e, onLoad)

-- call side effects for active events, check "eState[e] == 1" for multiple call events!
if(e == 99) then
-- TODO: EnableNextMissions()
-- Show opened arc
rttr:GetWorld():AddStaticObject(11, 125, 561, 0xFFFF, 2)
rttr:SetCampaignChapterCompleted("roman", 7)
rttr:EnableCampaignChapter("roman", 8)
end

-- update event state
Expand Down
4 changes: 2 additions & 2 deletions data/RTTR/campaigns/roman/MISS208.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


-------------------------------- TODO -----------------------------------------
-- EnableNextMissions()
-- Set Portraits
-- Set AI Agression Level
-------------------------------------------------------------------------------
Expand Down Expand Up @@ -419,9 +418,10 @@ function MissionEvent(e, onLoad)

-- call side effects for active events, check "eState[e] == 1" for multiple call events!
if(e == 99) then
-- TODO: EnableNextMissions()
-- Show opened arc - Done
rttr:GetWorld():AddStaticObject(127, 48, 561, 0xFFFF, 2)
rttr:SetCampaignChapterCompleted("roman", 8)
rttr:EnableCampaignChapter("roman", 9)
end

-- update event state
Expand Down
4 changes: 2 additions & 2 deletions data/RTTR/campaigns/roman/MISS209.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


-------------------------------- TODO -----------------------------------------
-- EnableNextMissions()
-- Set Portraits
-- Set AI Agression Level
-------------------------------------------------------------------------------
Expand Down Expand Up @@ -440,9 +439,10 @@ function MissionEvent(e, onLoad)

-- call side effects for active events, check "eState[e] == 1" for multiple call events!
if(e == 99) then
-- TODO: EnableNextMissions()
-- Show opened arc
rttr:GetWorld():AddStaticObject(75, 40, 561, 0xFFFF, 2)
rttr:SetCampaignChapterCompleted("roman", 9)
rttr:SetCampaignCompleted("roman")
end

-- update event state
Expand Down
1 change: 1 addition & 0 deletions data/RTTR/campaigns/roman/campaign.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ rttr:RegisterTranslations(

campaign = {
version = 1,
uid = "roman",
author = "Bluebyte",
name = _"name",
shortDescription = _"shortDescription",
Expand Down
6 changes: 6 additions & 0 deletions data/RTTR/campaigns/world/AFRICA.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,9 @@ function getAllowedChanges()
["aiTeam"] = false
}
end

-------------------------------- mission events -------------------------------
function onHumanWinner()
rttr:SetCampaignChapterCompleted("world", 2)
rttr:EnableCampaignChapter("world", 8) -- sasia
end
7 changes: 7 additions & 0 deletions data/RTTR/campaigns/world/AUSTRA.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,10 @@ function getAllowedChanges()
["aiTeam"] = false
}
end

-------------------------------- mission events -------------------------------
function onHumanWinner()
rttr:SetCampaignChapterCompleted("world", 6)
rttr:EnableCampaignChapter("world", 8) -- sasia
rttr:EnableCampaignChapter("world", 9) -- japan
end
8 changes: 8 additions & 0 deletions data/RTTR/campaigns/world/EUROPE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,11 @@ function getAllowedChanges()
["aiTeam"] = false
}
end

-------------------------------- mission events -------------------------------
function onHumanWinner()
rttr:SetCampaignChapterCompleted("world", 1)
rttr:EnableCampaignChapter("world", 2) -- africa
rttr:EnableCampaignChapter("world", 5) -- green
rttr:EnableCampaignChapter("world", 7) -- nasia
end
6 changes: 6 additions & 0 deletions data/RTTR/campaigns/world/GREEN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@ function getAllowedChanges()
["aiTeam"] = false
}
end

-------------------------------- mission events -------------------------------
function onHumanWinner()
rttr:SetCampaignChapterCompleted("world", 5)
rttr:EnableCampaignChapter("world", 3) -- namerica
end
7 changes: 7 additions & 0 deletions data/RTTR/campaigns/world/JAPAN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,10 @@ function getAllowedChanges()
["aiTeam"] = false
}
end

-------------------------------- mission events -------------------------------
function onHumanWinner()
rttr:SetCampaignChapterCompleted("world", 9)
rttr:EnableCampaignChapter("world", 6) -- austra
rttr:EnableCampaignChapter("world", 7) -- nasia
end
7 changes: 7 additions & 0 deletions data/RTTR/campaigns/world/NAMERICA.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,10 @@ function getAllowedChanges()
["aiTeam"] = false
}
end

-------------------------------- mission events -------------------------------
function onHumanWinner()
rttr:SetCampaignChapterCompleted("world", 3)
rttr:EnableCampaignChapter("world", 4) -- samerica
rttr:EnableCampaignChapter("world", 5) -- green
end
7 changes: 7 additions & 0 deletions data/RTTR/campaigns/world/NASIA.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,10 @@ function getAllowedChanges()
["aiTeam"] = false
}
end

-------------------------------- mission events -------------------------------
function onHumanWinner()
rttr:SetCampaignChapterCompleted("world", 7)
rttr:EnableCampaignChapter("world", 8) -- sasia
rttr:EnableCampaignChapter("world", 9) -- japan
end
6 changes: 6 additions & 0 deletions data/RTTR/campaigns/world/SAMERICA.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,9 @@ function getAllowedChanges()
["aiTeam"] = false
}
end

-------------------------------- mission events -------------------------------
function onHumanWinner()
rttr:SetCampaignChapterCompleted("world", 4)
rttr:EnableCampaignChapter("world", 3) -- namerica
end
8 changes: 8 additions & 0 deletions data/RTTR/campaigns/world/SASIA.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,11 @@ function getAllowedChanges()
["aiTeam"] = false
}
end

-------------------------------- mission events -------------------------------
function onHumanWinner()
rttr:SetCampaignChapterCompleted("world", 8)
rttr:EnableCampaignChapter("world", 2) -- africa
rttr:EnableCampaignChapter("world", 6) -- austra
rttr:EnableCampaignChapter("world", 7) -- nasia
end
22 changes: 12 additions & 10 deletions data/RTTR/campaigns/world/campaign.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ rttr:RegisterTranslations(

campaign = {
version = 1,
uid = "world",
author = "Bluebyte",
name = _"name",
shortDescription = _"shortDescription",
Expand All @@ -30,7 +31,8 @@ campaign = {
difficulty = "easy",
mapFolder = "<RTTR_GAME>/DATA/MAPS2",
luaFolder = "<RTTR_RTTR>/CAMPAIGNS/WORLD",
maps = { "EUROPE.WLD","NAMERICA.WLD","SAMERICA.WLD","GREEN.WLD","AFRICA.WLD","NASIA.WLD","SASIA.WLD","JAPAN.WLD","AUSTRA.WLD"},
maps = {"EUROPE.WLD", "AFRICA.WLD", "NAMERICA.WLD", "SAMERICA.WLD", "GREEN.WLD", "AUSTRA.WLD", "NASIA.WLD", "SASIA.WLD", "JAPAN.WLD"},
chaptersEnabled = {1},
selectionMap = {
background = {"<RTTR_GAME>/GFX/PICS/SETUP990.LBM", 0},
map = {"<RTTR_GAME>/GFX/PICS/WORLD.LBM", 0},
Expand All @@ -40,15 +42,15 @@ campaign = {
backgroundOffset = {64, 70},
disabledColor = 0x70000000,
missionSelectionInfos = {
{0xffffff00, 243, 97},
{0xffaf73cb, 55,78},
{0xff008fc3, 122, 193},
{0xff43c373, 166, 36},
{0xff27871b, 241,176},
{0xffc32323, 366,87},
{0xff573327, 375,145},
{0xffcfaf4b, 486, 136},
{0xffbb6313, 441, 264}
{0xffffff00, 243, 97}, -- europe
{0xff27871b, 241,176}, -- africa
{0xffaf73cb, 55,78}, -- namerica
{0xff008fc3, 122, 193}, -- samerica
{0xff43c373, 166, 36}, -- green
{0xffbb6313, 441, 264}, -- austra
{0xffc32323, 366,87}, -- nasia
{0xff573327, 375,145}, -- sasia
{0xffcfaf4b, 486, 136} -- japan
}
}
}
3 changes: 3 additions & 0 deletions doc/lua/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,6 @@ Called when a pact has been canceled.

**onPactCreated(PactType, suggestedByPlayerIdx, targetPlayerIdx, duration)**
Called when a pact has been confirmed.

**onHumanWinner()**
Called when the game is won by a human.
3 changes: 3 additions & 0 deletions libs/libGamedata/gameData/CampaignDescription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
CampaignDescription::CampaignDescription(const boost::filesystem::path& campaignPath, const kaguya::LuaRef& table)
{
CheckedLuaTable luaData(table);
uid = luaData.getOrDefault("uid", decltype(uid){""});
luaData.getOrThrow(version, "version");
luaData.getOrThrow(author, "author");
luaData.getOrThrow(name, "name");
Expand Down Expand Up @@ -45,6 +46,8 @@ CampaignDescription::CampaignDescription(const boost::filesystem::path& campaign
// Default lua folder to map folder, i.e. LUA files are side by side with the maps
luaFolder_ = resolveFolder(luaData.getOrDefault("luaFolder", mapFolder));
mapNames_ = luaData.getOrDefault("maps", std::vector<std::string>());
// enable chapters 1 and 2 (like in the Roman campaign and the FANpaign) unless specified otherwise
chaptersEnabled = luaData.getOrDefault<decltype(chaptersEnabled)>("chaptersEnabled", {0, 1});
selectionMapData = luaData.getOptional<SelectionMapInputData>("selectionMap");
luaData.checkUnused();
}
Expand Down
3 changes: 3 additions & 0 deletions libs/libGamedata/gameData/CampaignDescription.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once
#include "CampaignTypes.h"
#include "SelectionMapInputData.h"
#include <boost/filesystem/path.hpp>
#include <optional>
Expand All @@ -15,6 +16,7 @@ class LuaRef;

struct CampaignDescription
{
std::string uid;
std::string version;
std::string author;
std::string name;
Expand All @@ -23,6 +25,7 @@ struct CampaignDescription
std::optional<std::string> image;
unsigned maxHumanPlayers = 1;
std::string difficulty;
std::vector<ChapterID> chaptersEnabled;
std::optional<SelectionMapInputData> selectionMapData;

CampaignDescription() = default;
Expand Down
Loading
Loading