瀏覽代碼

Properly calculate experience on altar

Piotr Wójcik 8 年之前
父節點
當前提交
f9ed952869
共有 2 個文件被更改,包括 4 次插入2 次删除
  1. 3 1
      client/windows/CTradeWindow.cpp
  2. 1 1
      server/CGameHandler.cpp

+ 3 - 1
client/windows/CTradeWindow.cpp

@@ -1450,7 +1450,7 @@ void CAltarWindow::updateRight(CTradeableItem *toUpdate)
 {
 	int val = sacrificedUnits[toUpdate->serial];
 	toUpdate->setType(val ? CREATURE : CREATURE_PLACEHOLDER);
-	toUpdate->subtitle = val ? boost::str(boost::format(CGI->generaltexth->allTexts[122]) % boost::lexical_cast<std::string>(val * expPerUnit[toUpdate->serial])) : ""; //%s exp
+	toUpdate->subtitle = val ? boost::str(boost::format(CGI->generaltexth->allTexts[122]) % boost::lexical_cast<std::string>(hero->calculateXp(val * expPerUnit[toUpdate->serial]))) : ""; //%s exp
 }
 
 int CAltarWindow::firstFreeSlot()
@@ -1495,6 +1495,7 @@ void CAltarWindow::showAll(SDL_Surface * to)
 
 		int dmp, val;
 		market->getOffer(arts->commonInfo->src.art->artType->id, 0, dmp, val, EMarketMode::ARTIFACT_EXP);
+		val = hero->calculateXp(val);
 		printAtMiddleLoc(boost::lexical_cast<std::string>(val), 304, 498, FONT_SMALL, Colors::WHITE, to);
 	}
 }
@@ -1520,6 +1521,7 @@ bool CAltarWindow::putOnAltar(CTradeableItem* altarSlot, const CArtifactInstance
 
 	int dmp, val;
 	market->getOffer(art->artType->id, 0, dmp, val, EMarketMode::ARTIFACT_EXP);
+	val = hero->calculateXp(val);
 
 	arts->artifactsOnAltar.insert(art);
 	altarSlot->setArtInstance(art);

+ 1 - 1
server/CGameHandler.cpp

@@ -5467,7 +5467,7 @@ bool CGameHandler::sacrificeArtifact(const IMarket * m, const CGHeroInstance * h
 	int expSum = 0;
 	auto finish = [this, &hero, &expSum]()
 	{
-		changePrimSkill(hero, PrimarySkill::EXPERIENCE, expSum);
+		changePrimSkill(hero, PrimarySkill::EXPERIENCE, hero->calculateXp(expSum));
 	};
 
 	for (int i = 0; i < slot.size(); ++i)