Ver código fonte

Some additional info for Stack Experience, fixes.

DjWarmonger 15 anos atrás
pai
commit
7a49240520
3 arquivos alterados com 32 adições e 4 exclusões
  1. 28 3
      lib/CCreatureHandler.cpp
  2. 2 0
      lib/CCreatureHandler.h
  3. 2 1
      lib/HeroBonus.h

+ 28 - 3
lib/CCreatureHandler.cpp

@@ -670,21 +670,46 @@ void CCreatureHandler::loadCreatures()
 		expRanks[0].push_back(it);
 		for (int j = 1; j < 10; ++j) //used for tiers 8-10, and all other probably
 		{
-			expRanks[0].push_back(expRanks[0][j-1] + dif);
+			expRanks[0].push_back(expRanks[0][j-1] + it + dif);
 			dif += it/5;
 		}
-		for (int i = 1; i < 8; ++i)
+		for (i = 1; i < 8; ++i)
 		{
 			dif = 0;
 			it = 1000 * i;
 			expRanks[i].push_back(it);
 			for (int j = 1; j < 10; ++j)
 			{
-				expRanks[i].push_back(expRanks[i][j-1] + dif);
+				expRanks[i].push_back(expRanks[i][j-1] + it + dif);
 				dif += it/5;
 			}
 		}
 
+		buf = bitmaph->getTextFile("CREXPMOD.TXT"); //could be hardcoded though, lots of useless info
+		it = 0;
+		loadToIt (dump2, buf, it, 3); //ignore first line
+
+		maxExpPerBattle.resize(8);
+		si32 val;
+		for (i = 1; i < 8; ++i)
+		{
+			loadToIt (dump2, buf, it, 4); //float multiplier -> hardcoded
+			loadToIt (dump2, buf, it, 4); //ignore upgrade mod? ->hardcoded
+			loadToIt (dump2, buf, it, 4); //already calculated
+			loadToIt (val, buf, it, 4);
+			maxExpPerBattle[i] = (ui32)val;
+			loadToIt (val, buf, it, 4); //11th level
+			val += (si32)expRanks[i].back();
+			expRanks[i].push_back((ui32)val);
+			loadToIt (dump2, buf, it, 3); //crop comment
+		}
+		//skeleton gets exp penalty
+			creatures[56].get()->addBonus(-50, Bonus::EXP_MULTIPLIER, -1);
+			creatures[57].get()->addBonus(-50, Bonus::EXP_MULTIPLIER, -1);
+		//exp for tier >7, rank 11
+			expRanks[0].push_back(14700);
+			expAfterUpgrade = 75; //percent
+
 	}//end of Stack Experience
 	//experiment - add 100 to attack for creatures of tier 1
 // 	Bonus *b = new Bonus(Bonus::PERMANENT, Bonus::PRIMARY_SKILL, Bonus::OTHER, +100, 0, 0);

+ 2 - 0
lib/CCreatureHandler.h

@@ -114,6 +114,8 @@ public:
 
 	std::map<TBonusType, std::pair<std::string, std::string> > stackBonuses; // bonus => name, description
 	std::vector<std::vector<ui32>> expRanks; // stack experience needed for certain rank, index 0 for other tiers (?)
+	std::vector<ui32> maxExpPerBattle; //tiers same as above
+	si8 expAfterUpgrade;//multiplier in %
 
 	void loadCreatures();
 	void loadAnimationInfo();

+ 2 - 1
lib/HeroBonus.h

@@ -156,7 +156,8 @@ namespace PrimarySkill
 	BONUS_NAME(SPECIAL_PECULIAR_ENCHANT) /*blesses and curses with id = val dependent on unit's level, subtype = 0 or 1 for Coronius*/\
 	BONUS_NAME(SPECIAL_UPGRADE) /*val = base, additionalInfo = target */\
 	BONUS_NAME(DRAGON_NATURE) \
-	BONUS_NAME(CREATURE_DAMAGE)/*subtype 0 = both, 1 = min, 2 = max*/
+	BONUS_NAME(CREATURE_DAMAGE)/*subtype 0 = both, 1 = min, 2 = max*/\
+	BONUS_NAME(EXP_MULTIPLIER)/* val - percent of additional exp gained by stack/commander (base value 100)*/
 
 struct DLL_EXPORT Bonus
 {