diff --git a/lib/NetPacksLib.cpp b/lib/NetPacksLib.cpp index 6c6aab125..62be0802e 100644 --- a/lib/NetPacksLib.cpp +++ b/lib/NetPacksLib.cpp @@ -927,6 +927,9 @@ static std::vector stackEffectToFeature(const CStack::StackEffect case 28: //air shield sf.push_back(featureGenerator(StackFeature::GENERAL_DAMAGE_REDUCTION, 1, VLC->spellh->spells[sse.id].powers[sse.level], sse.turnsRemain)); break; + case 29: //fire shield + sf.push_back(featureGenerator(StackFeature::FIRE_SHIELD, 0, VLC->spellh->spells[sse.id].powers[sse.level], sse.turnsRemain)); + break; case 30: //protection from air sf.push_back(featureGenerator(StackFeature::SPELL_DAMAGE_REDUCTION, 0, VLC->spellh->spells[sse.id].powers[sse.level], sse.turnsRemain)); break; diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index fe26223a6..d04f511c3 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -599,7 +599,22 @@ void CGameHandler::prepareAttack(BattleAttack &bat, const CStack *att, const CSt bsa->damageAmount *= 2; bat.flags |= 4; } + int dmg = bsa->damageAmount; prepareAttacked(*bsa, def); + + //fire shield handling + if ( !bat.shot() && def->hasFeatureOfType(StackFeature::FIRE_SHIELD) && !bsa->killed() ) + { + bat.bsa.push_back(BattleStackAttacked()); + BattleStackAttacked *bsa = &bat.bsa.back(); + bsa->stackAttacked = att->ID; + bsa->attackerID = def->ID; + bsa->flags |= 2; + bsa->effect = 11; + + bsa->damageAmount = (dmg * def->valOfFeatures(StackFeature::FIRE_SHIELD)) / 100; + prepareAttacked(*bsa, att); + } } void CGameHandler::handleConnection(std::set players, CConnection &c) { @@ -3403,6 +3418,7 @@ void CGameHandler::handleSpellCasting( int spellID, int spellLvl, int destinatio } case 27: //shield case 28: //air shield + case 29: //fire shield case 30: //protection from air case 31: //protection from fire case 32: //protection from water