瀏覽代碼

Creatures now use SHOTS Bonus to express their total ammo count. Support for "additional shots" exp premy.

DjWarmonger 14 年之前
父節點
當前提交
3c5a0fd4ce
共有 5 個文件被更改,包括 14 次插入6 次删除
  1. 4 2
      client/CCreatureWindow.cpp
  2. 4 2
      client/GUIClasses.cpp
  3. 1 1
      lib/BattleState.cpp
  4. 3 0
      lib/CCreatureHandler.cpp
  5. 2 1
      lib/HeroBonus.h

+ 4 - 2
client/CCreatureWindow.cpp

@@ -315,8 +315,10 @@ void CCreatureWindow::showAll(SDL_Surface * to)
 
 	printLine(0, CGI->generaltexth->primarySkillNames[0], c->valOfBonuses(Bonus::PRIMARY_SKILL, PrimarySkill::ATTACK), stackNode->valOfBonuses(Bonus::PRIMARY_SKILL, PrimarySkill::ATTACK));
 	printLine(1, CGI->generaltexth->primarySkillNames[1], c->valOfBonuses(Bonus::PRIMARY_SKILL, PrimarySkill::DEFENSE), stackNode->valOfBonuses(Bonus::PRIMARY_SKILL, PrimarySkill::DEFENSE));
-	if(c->shots)
-		printLine(2, CGI->generaltexth->allTexts[198], c->shots);
+	//if(c->shots)
+	//	printLine(2, CGI->generaltexth->allTexts[198], c->shots);
+	if(stackNode->valOfBonuses(Bonus::SHOTS))
+		printLine(2, CGI->generaltexth->allTexts[198], stackNode->valOfBonuses(Bonus::SHOTS));
 
 	//TODO
 	int dmgMultiply = 1;

+ 4 - 2
client/GUIClasses.cpp

@@ -2167,8 +2167,10 @@ void CCreInfoWindow::init(const CCreature *cre, const CBonusSystemNode *stackNod
 	
 	printLine(0, CGI->generaltexth->primarySkillNames[0], cre->valOfBonuses(Bonus::PRIMARY_SKILL, PrimarySkill::ATTACK), stackNode->valOfBonuses(Bonus::PRIMARY_SKILL, PrimarySkill::ATTACK));
 	printLine(1, CGI->generaltexth->primarySkillNames[1], cre->valOfBonuses(Bonus::PRIMARY_SKILL, PrimarySkill::DEFENSE), stackNode->valOfBonuses(Bonus::PRIMARY_SKILL, PrimarySkill::DEFENSE));
-	if(c->shots)
-		printLine(2, CGI->generaltexth->allTexts[198], c->shots);
+	//if(c->shots)
+	//	printLine(2, CGI->generaltexth->allTexts[198], c->shots);
+	if(stackNode->valOfBonuses(Bonus::SHOTS))
+		printLine(2, CGI->generaltexth->allTexts[198], stackNode->valOfBonuses(Bonus::SHOTS));
 
 	//TODO
 	int dmgMultiply = 1;

+ 1 - 1
lib/BattleState.cpp

@@ -1962,7 +1962,7 @@ void CStack::postInit()
 	assert(parents.size());
 
 	firstHPleft = valOfBonuses(Bonus::STACK_HEALTH);
-	shots = getCreature()->shots;
+	shots = getCreature()->valOfBonuses(Bonus::SHOTS);
 	counterAttacks = 1 + valOfBonuses(Bonus::ADDITIONAL_RETALIATION);
 	state.insert(ALIVE);  //alive state indication
 

+ 3 - 0
lib/CCreatureHandler.cpp

@@ -285,6 +285,7 @@ void CCreatureHandler::loadCreatures()
 		ncre.addBonus(ncre.damageMax, Bonus::CREATURE_DAMAGE, 2);
 
 		ncre.shots = readNumber(befi, i, andame, buf);
+		ncre.addBonus(ncre.shots, Bonus::SHOTS);
 		ncre.spells = readNumber(befi, i, andame, buf);
 		ncre.ammMin = readNumber(befi, i, andame, buf);
 		ncre.ammMax = readNumber(befi, i, andame, buf);
@@ -831,6 +832,8 @@ void CCreatureHandler::loadStackExp(Bonus & b, BonusList & bl, std::string & src
 		break;
 	case 'S':
 		b.type = Bonus::STACKS_SPEED; break;
+	case 'O':
+		b.type = Bonus::SHOTS; break;
 
 	case 'b':
 		b.type = Bonus::ENEMY_DEFENCE_REDUCTION; break;

+ 2 - 1
lib/HeroBonus.h

@@ -155,7 +155,8 @@ namespace PrimarySkill
 	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(EXP_MULTIPLIER)/* val - percent of additional exp gained by stack/commander (base value 100)*/
+	BONUS_NAME(EXP_MULTIPLIER)/* val - percent of additional exp gained by stack/commander (base value 100)*/\
+	BONUS_NAME(SHOTS)
 
 /// Struct for handling bonuses of several types. Can be transfered to any hero
 struct DLL_EXPORT Bonus