From 3da7fa61442364be6713359690a35f89aa8e613a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 24 Feb 2013 01:30:46 +0300 Subject: Add support for show quest variables in skills window (evol only) This allow use pseudo skills controlled by quest variables. --- src/gui/statuswindow.cpp | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) (limited to 'src/gui/statuswindow.cpp') diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp index 019d136d4..3e34b088d 100644 --- a/src/gui/statuswindow.cpp +++ b/src/gui/statuswindow.cpp @@ -373,12 +373,10 @@ void StatusWindow::processEvent(Channels channel A_UNUSED, { if (mJobLvlLabel) { - int lvl = PlayerInfo::getStatBase( - static_cast(id)); - + int lvl = PlayerInfo::getStatBase(id); const int oldExp = event.getInt("oldValue1"); - const std::pair exp = PlayerInfo::getStatExperience( - static_cast(id)); + const std::pair exp + = PlayerInfo::getStatExperience(id); if (!lvl) { @@ -392,8 +390,7 @@ void StatusWindow::processEvent(Channels channel A_UNUSED, { lvl = (exp.second - 20000) / 150; blocked = true; - PlayerInfo::setStatBase( - static_cast(id), lvl); + PlayerInfo::setStatBase(id, lvl); blocked = false; } } @@ -404,10 +401,8 @@ void StatusWindow::processEvent(Channels channel A_UNUSED, lvl ++; blocked = true; PlayerInfo::setStatExperience( - static_cast(id), - exp.first, 20000 + lvl * 150); - PlayerInfo::setStatBase( - static_cast(id), lvl); + id, exp.first, 20000 + lvl * 150); + PlayerInfo::setStatBase(id, lvl); blocked = false; } @@ -589,8 +584,7 @@ void StatusWindow::updateJobBar(ProgressBar *const bar, const bool percent) void StatusWindow::updateProgressBar(ProgressBar *const bar, const int id, const bool percent) const { - const std::pair exp = PlayerInfo::getStatExperience( - static_cast(id)); + const std::pair exp = PlayerInfo::getStatExperience(id); updateProgressBar(bar, exp.first, exp.second, percent); } @@ -783,10 +777,8 @@ AttrDisplay::~AttrDisplay() std::string AttrDisplay::update() { - const int base = PlayerInfo::getStatBase( - static_cast(mId)); - const int bonus = PlayerInfo::getStatMod( - static_cast(mId)); + const int base = PlayerInfo::getStatBase(mId); + const int bonus = PlayerInfo::getStatMod(mId); std::string value = toString(base + bonus); if (bonus) value += strprintf("=%d%+d", base, bonus); @@ -872,10 +864,8 @@ void ChangeDisplay::action(const gcn::ActionEvent &event) PlayerInfo::CHAR_POINTS) + 1; PlayerInfo::setAttribute(PlayerInfo::CHAR_POINTS, newpoints); - const int newbase = PlayerInfo::getStatBase( - static_cast(mId)) - 1; - PlayerInfo::setStatBase(static_cast( - mId), newbase); + const int newbase = PlayerInfo::getStatBase(mId) - 1; + PlayerInfo::setStatBase(mId, newbase); Net::getPlayerHandler()->decreaseAttribute(mId); } @@ -893,10 +883,8 @@ void ChangeDisplay::action(const gcn::ActionEvent &event) PlayerInfo::CHAR_POINTS) - cnt; PlayerInfo::setAttribute(PlayerInfo::CHAR_POINTS, newpoints); - const int newbase = PlayerInfo::getStatBase( - static_cast(mId)) + cnt; - PlayerInfo::setStatBase(static_cast( - mId), newbase); + const int newbase = PlayerInfo::getStatBase(mId) + cnt; + PlayerInfo::setStatBase(mId, newbase); for (unsigned f = 0; f < mInc->getClickCount(); f ++) { -- cgit v1.2.3-70-g09d2