From 6b56a54a84d7fe7afeca5658485f898f72af78c4 Mon Sep 17 00:00:00 2001 From: ketmar Date: Mon, 27 Sep 2010 14:15:21 +0300 Subject: [PATCH] player now can liberate citizens of New Attnam (with no visible effects for now) --- src/game/Jamfile | 2 ++ src/game/game.cpp | 22 +++++++++++++++------- src/game/game.h | 3 +++ src/game/human.cpp | 9 +++++++++ src/game/human.h | 2 ++ 5 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/game/Jamfile b/src/game/Jamfile index 66cc778..2826313 100644 --- a/src/game/Jamfile +++ b/src/game/Jamfile @@ -35,3 +35,5 @@ LinkLibraries ivan : libfelib.a libregex.a ; SubIncludeOnce JAM_IVAN_INC_SRC_FELIB : TOP src felib ; +SubIncludeOnce JAM_IVAN_INC_SRC_REGEX : TOP src regex ; +SubIncludeOnce JAM_IVAN_INC_SRC_VASYA : TOP src vasya ; diff --git a/src/game/game.cpp b/src/game/game.cpp index 35b4b1a..fb528f5 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -53,7 +53,7 @@ #define SAVE_FILE_VERSION 119 // Increment this if changes make savefiles incompatible #define BONE_FILE_VERSION 106 // Increment this if changes make bonefiles incompatible */ -#define SAVE_FILE_VERSION 120 // Increment this if changes make savefiles incompatible +#define SAVE_FILE_VERSION 121 // Increment this if changes make savefiles incompatible #define BONE_FILE_VERSION 106 // Increment this if changes make bonefiles incompatible #define LOADED 0 @@ -95,6 +95,7 @@ int game::RingOfThieves; int game::Masamune; int game::Muramasa; int game::LoricatusHammer; +int game::Liberator; /* */ massacremap game::PlayerMassacreMap; massacremap game::PetMassacreMap; @@ -365,7 +366,6 @@ truth game::Init (cfestring &Name) { Player->EditExperience(c, 500, 1<<11); } Player->SetMoney(Player->GetMoney()+RAND()%11); - //if (PlayerName == "_k8_") Player->SetMoney(666666); //k8 GetTeam(0)->SetLeader(Player); InitDangerMap(); Petrus = 0; @@ -385,6 +385,7 @@ truth game::Init (cfestring &Name) { Masamune = 0; Muramasa = 0; LoricatusHammer = 0; + Liberator = 0; /* */ PlayerMassacreMap.clear(); PetMassacreMap.clear(); @@ -763,7 +764,7 @@ truth game::Save (cfestring &SaveName) { SaveFile << AveragePlayerDexterityExperience; SaveFile << AveragePlayerAgilityExperience; SaveFile << Teams << Dungeons << StoryState << PlayerRunning; - SaveFile << MondedrPass << RingOfThieves << Masamune << Muramasa << LoricatusHammer; + SaveFile << MondedrPass << RingOfThieves << Masamune << Muramasa << LoricatusHammer << Liberator; SaveFile << PlayerMassacreMap << PetMassacreMap << MiscMassacreMap; SaveFile << PlayerMassacreAmount << PetMassacreAmount << MiscMassacreAmount; SaveArray(SaveFile, EquipmentMemory, MAX_EQUIPMENT_SLOTS); @@ -793,10 +794,12 @@ int game::Load (cfestring &SaveName) { int Version; SaveFile >> Version; if (Version != SAVE_FILE_VERSION) { - if(!iosystem::Menu(0, v2(RES.X >> 1, RES.Y >> 1), CONST_S("Sorry, this save is incompatible with the new version.\rStart new game?\r"), CONST_S("Yes\rNo\r"), LIGHT_GRAY)) - return NEW_GAME; - else - return BACK; + if (Version != 120) { + if (!iosystem::Menu(0, v2(RES.X >> 1, RES.Y >> 1), CONST_S("Sorry, this save is incompatible with the new version.\rStart new game?\r"), CONST_S("Yes\rNo\r"), LIGHT_GRAY)) + return NEW_GAME; + else + return BACK; + } } SaveFile >> GameScript >> CurrentDungeonIndex >> CurrentLevelIndex >> Camera; SaveFile >> WizardMode >> SeeWholeMapCheatMode >> GoThroughWallsCheat; @@ -809,6 +812,11 @@ int game::Load (cfestring &SaveName) { SaveFile >> AveragePlayerAgilityExperience; SaveFile >> Teams >> Dungeons >> StoryState >> PlayerRunning; SaveFile >> MondedrPass >> RingOfThieves >> Masamune >> Muramasa >> LoricatusHammer; + if (Version == SAVE_FILE_VERSION) { + SaveFile >> Liberator; + } else { + Liberator = 0; + } SaveFile >> PlayerMassacreMap >> PetMassacreMap >> MiscMassacreMap; SaveFile >> PlayerMassacreAmount >> PetMassacreAmount >> MiscMassacreAmount; LoadArray(SaveFile, EquipmentMemory, MAX_EQUIPMENT_SLOTS); diff --git a/src/game/game.h b/src/game/game.h index 6f5def6..d5f5003 100644 --- a/src/game/game.h +++ b/src/game/game.h @@ -341,6 +341,8 @@ public: static void SetMuramasa (int What) { Muramasa = What; } static int GetLoricatusHammer () { return LoricatusHammer; } static void SetLoricatusHammer (int What) { LoricatusHammer = What; } + static int GetLiberator () { return Liberator; } + static void SetLiberator (int What) { Liberator = What; } static void SetIsInGetCommand(truth What) { InGetCommand = What; } static truth IsInGetCommand() { return InGetCommand; } static festring GetHomeDir(); @@ -530,6 +532,7 @@ private: static int Masamune; static int Muramasa; static int LoricatusHammer; + static int Liberator; static truth InGetCommand; static truth PlayerHurtByExplosion; static area* CurrentArea; diff --git a/src/game/human.cpp b/src/game/human.cpp index 2c81b60..cf2fd58 100644 --- a/src/game/human.cpp +++ b/src/game/human.cpp @@ -5342,3 +5342,12 @@ void imperialist::BeTalkedTo () { void imperialist::DisplayStethoscopeInfo (character *) const { ADD_MESSAGE("You hear coins clinking inside."); } + + +void imperialist::CreateCorpse (lsquare *Square) { + if (!game::GetLiberator()) { + game::SetLiberator(1); + ADD_MESSAGE("You liberate citizens of New Attnam!"); + } + imperialistsysbase::CreateCorpse(Square); +} diff --git a/src/game/human.h b/src/game/human.h index 9e68017..5426152 100644 --- a/src/game/human.h +++ b/src/game/human.h @@ -546,6 +546,8 @@ public: virtual void GetAICommand () { StandIdleAI(); } virtual void BeTalkedTo (); virtual void DisplayStethoscopeInfo (character *) const; +protected: + virtual void CreateCorpse (lsquare *); }; CHARACTER(smith, humanoid) -- 2.11.4.GIT