Browse Source

add Fire Shield damage to the battle log

Andrey Filipenkov 3 years ago
parent
commit
87a88da3a9
1 changed files with 12 additions and 3 deletions
  1. 12 3
      server/CGameHandler.cpp

+ 12 - 3
server/CGameHandler.cpp

@@ -1159,8 +1159,6 @@ void CGameHandler::makeAttack(const CStack * attacker, const CStack * defender,
 		blm.lines.push_back(std::move(text));
 	}
 
-	sendAndApply(&blm);
-
 	if(!fireShield.empty())
 	{
 		//todo: this should be "virtual" spell instead, we only need fire spell school bonus here
@@ -1199,9 +1197,20 @@ void CGameHandler::makeAttack(const CStack * attacker, const CStack * defender,
 		StacksInjured pack;
 		pack.stacks.push_back(bsa);
 		sendAndApply(&pack);
-		sendGenericKilledLog(attacker, bsa.killedAmount, false);
+
+		// TODO: this is already implemented in Damage::describeEffect()
+		{
+			MetaString text;
+			text.addTxt(MetaString::GENERAL_TXT, 376);
+			text.addReplacement(MetaString::SPELL_NAME, SpellID::FIRE_SHIELD);
+			text.addReplacement(totalDamage);
+			blm.lines.push_back(std::move(text));
+		}
+		addGenericKilledLog(blm, attacker, bsa.killedAmount, false);
 	}
 
+	sendAndApply(&blm);
+
 	handleAfterAttackCasting(ranged, attacker, defender);
 }