]> git.localhorst.tv Git - l2e.git/commitdiff
include capsule in victory messages
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 7 Feb 2013 06:54:31 +0000 (07:54 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 7 Feb 2013 06:54:31 +0000 (07:54 +0100)
src/battle/Capsule.h
src/battle/states/VictoryState.cpp

index ef4e46da07f2e342d223852087684ca8b2e1d3c7..48abe15defc6d7ea174cc6dd385e4aeb14e95b29 100644 (file)
@@ -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;
index dca0bf2ee3da96bc727be6ee793c8fd58246007b..c1e5ea422c646826c12ca0aa34b46540230dc115 100644 (file)
@@ -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<Hero>::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";