From: Daniel Karbach Date: Thu, 7 Feb 2013 06:54:31 +0000 (+0100) Subject: include capsule in victory messages X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=c97ea32c4101fcdadedbfa5eabf8098210306b4b;p=l2e.git include capsule in victory messages --- diff --git a/src/battle/Capsule.h b/src/battle/Capsule.h index ef4e46d..48abe15 100644 --- a/src/battle/Capsule.h +++ b/src/battle/Capsule.h @@ -25,6 +25,9 @@ public: public: bool Active() const { return master; } + common::Capsule &Master() { return *master; } + const common::Capsule &Master() const { return *master; } + const char *Name() const; Uint8 Level() const; diff --git a/src/battle/states/VictoryState.cpp b/src/battle/states/VictoryState.cpp index dca0bf2..c1e5ea4 100644 --- a/src/battle/states/VictoryState.cpp +++ b/src/battle/states/VictoryState.cpp @@ -5,6 +5,7 @@ #include "../Hero.h" #include "../../app/Application.h" #include "../../app/Input.h" +#include "../../common/Capsule.h" #include "../../common/GameConfig.h" #include "../../common/GameState.h" #include "../../common/Hero.h" @@ -40,6 +41,8 @@ void VictoryState::LoadResults() { s << "Gets " << battle->GoldReward() << " gold"; lines.push_back(s.str()); + lines.push_back(""); + for (std::vector::const_iterator i(battle->HeroesBegin()), end(battle->HeroesEnd()); i != end; ++i) { @@ -50,6 +53,15 @@ void VictoryState::LoadResults() { lines.push_back(s.str()); } + if (battle->HasCapsule()) { + const Capsule &capsule = battle->GetCapsule(); + if (capsule.Health() > 0) { + s.str(""); + s << capsule.Name() << " next level " << capsule.Master().NextLevel(); + lines.push_back(s.str()); + } + } + lines.push_back(""); s.str(""); s << parent->Game().state->money << " gold";