Skip to content

Commit

Permalink
Allow the player to become one of the factions in the big map
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrettin committed Aug 21, 2016
1 parent bd7b686 commit 60f11a7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ GameResults GameResult; /// Outcome of the game

std::string GameName;
std::string FullGameName;
//Wyrmgus start
std::string PlayerFaction;
//Wyrmgus end

unsigned long GameCycle; /// Game simulation cycle counter
unsigned long FastForwardCycle; /// Cycle to fastforward to in a replay
Expand Down
3 changes: 3 additions & 0 deletions src/include/stratagus.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ extern const char NameLine[];

extern std::string StratagusLibPath; /// Location of stratagus data
extern std::string MenuRace;
//Wyrmgus start
extern std::string PlayerFaction;
//Wyrmgus end

extern unsigned long GameCycle; /// Game simulation cycle counter
extern unsigned long FastForwardCycle; /// Game Replay Fast Forward Counter
Expand Down
9 changes: 9 additions & 0 deletions src/map/script_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,15 @@ void ApplyMapTemplate(std::string map_template_ident, int template_start_x, int
}
}

if (!PlayerFaction.empty()) {
CFaction *player_faction = PlayerRaces.GetFaction(-1, PlayerFaction);

if (player_faction) {
ThisPlayer->SetCivilization(player_faction->Civilization);
ThisPlayer->SetFaction(player_faction->Name);
}
}

for (size_t i = 0; i < map_template->Subtemplates.size(); ++i) {
Vec2i random_pos(0, 0);
Vec2i min_pos(0, 0);
Expand Down
4 changes: 4 additions & 0 deletions src/tolua/game.pkg
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ extern tolua_property__s int GameSpeed;
extern bool GameObserve;
extern bool GameEstablishing;

//Wyrmgus start
extern std::string PlayerFaction;
//Wyrmgus end

extern unsigned long GameCycle;
extern unsigned long FastForwardCycle;
//Wyrmgus start
Expand Down

0 comments on commit 60f11a7

Please sign in to comment.