浏览代码

hero specialty fixes continuation: changes requested during code review

MikeLodz 4 年之前
父节点
当前提交
fe9412f845
共有 2 个文件被更改,包括 6 次插入5 次删除
  1. 2 2
      lib/HeroBonus.h
  2. 4 3
      lib/spells/effects/Timed.cpp

+ 2 - 2
lib/HeroBonus.h

@@ -281,8 +281,6 @@ public:
 	BONUS_NAME(SPECIAL_BLESS_DAMAGE) /*val = spell (bless), additionalInfo = value per level in percent*/\
 	BONUS_NAME(MAXED_SPELL) /*val = id*/\
 	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_ADD_VALUE_ENCHANT) /*specialty like Aenin, additionalInfo = value to add*/\
-	BONUS_NAME(SPECIAL_FIXED_VALUE_ENCHANT) /*specialty like Melody constant 3 luck, additionalInfo = value to fix.*/\
 	BONUS_NAME(SPECIAL_UPGRADE) /*subtype = base, additionalInfo = target */\
 	BONUS_NAME(DRAGON_NATURE) \
 	BONUS_NAME(CREATURE_DAMAGE)/*subtype 0 = both, 1 = min, 2 = max*/\
@@ -323,6 +321,8 @@ public:
 	BONUS_NAME(SPECIAL_CRYSTAL_GENERATION) /*crystal dragon crystal generation*/ \
 	BONUS_NAME(NO_SPELLCAST_BY_DEFAULT) /*spellcast will not be default attack option for this creature*/ \
 	BONUS_NAME(GARGOYLE) /* gargoyle is special than NON_LIVING, cannot be rised or healed */ \
+	BONUS_NAME(SPECIAL_ADD_VALUE_ENCHANT) /*specialty spell like Aenin has, increased effect of spell, additionalInfo = value to add*/\
+	BONUS_NAME(SPECIAL_FIXED_VALUE_ENCHANT) /*specialty spell like Melody has, constant spell effect (i.e. 3 luck), additionalInfo = value to fix.*/\
 
 	/* end of list */
 

+ 4 - 3
lib/spells/effects/Timed.cpp

@@ -213,7 +213,8 @@ void Timed::prepareEffects(SetStackEffect & sse, const Mechanics * m, const Effe
 				power = std::max(5 - tier, 0);
 				break;
 			}
-			if(m->isNegativeSpell()) {
+			if(m->isNegativeSpell())
+			{
 				//negative spells like weakness are defined in json with negative numbers, so we need do same here
 				power = -1 * power;
 			}
@@ -222,14 +223,14 @@ void Timed::prepareEffects(SetStackEffect & sse, const Mechanics * m, const Effe
 				b.val += power;
 			}
 		}
-		else if(addedValueBonus)
+		if(addedValueBonus)
 		{
 			for(Bonus& b : buffer)
 			{
 				b.val += addedValueBonus->additionalInfo[0];
 			}
 		}
-		else if(fixedValueBonus)
+		if(fixedValueBonus)
 		{
 			for(Bonus& b : buffer)
 			{