X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcommon%2FCapsule.cpp;h=de2ea56583fd7ff77a0d5375782d0f1f93f907e1;hb=3d69f521b593457304b282e5f23e36ab165288b6;hp=083931c5c0a6a2835e933b4134aa0a5c1149879d;hpb=8f4cb4e8ad954ba73fb78a030c969c933a7ed60c;p=l2e.git diff --git a/src/common/Capsule.cpp b/src/common/Capsule.cpp index 083931c..de2ea56 100644 --- a/src/common/Capsule.cpp +++ b/src/common/Capsule.cpp @@ -1,8 +1,9 @@ #include "Capsule.h" -#include "../common/Item.h" -#include "../common/Spell.h" -#include "../common/Stats.h" +#include "Item.h" +#include "Spell.h" +#include "Stats.h" +#include "Upgrade.h" #include "../graphics/Animation.h" #include "../graphics/Sprite.h" #include "../loader/Interpreter.h" @@ -82,9 +83,11 @@ int Capsule::NextLevel() const { } } -void Capsule::AddExperience(int exp, vector &info) { +void Capsule::AddExperience(int exp, vector &info) { if (level > numLevels) { // don't award any experience if at highest level + info.push_back(Upgrade( + name, Upgrade::LEVEL_NEXT, NextLevel())); return; } int remain = exp; @@ -94,15 +97,19 @@ void Capsule::AddExperience(int exp, vector &info) { remain -= added; ++level; - info.push_back(Hero::UpgradeInfo(Hero::UPGRADE_LVL, level)); + info.push_back(Upgrade(name, Upgrade::LEVEL_UP, level)); // TODO: upgrade attributes and push info if (level > numLevels) { + info.push_back(Upgrade( + name, Upgrade::LEVEL_NEXT, NextLevel())); return; } } experience += remain; + info.push_back(Upgrade( + name, Upgrade::LEVEL_NEXT, NextLevel())); }