diff --git a/client/CBattleInterface.cpp b/client/CBattleInterface.cpp index 063479add..e3f8b44d2 100644 --- a/client/CBattleInterface.cpp +++ b/client/CBattleInterface.cpp @@ -2535,8 +2535,15 @@ void CBattleInterface::stacksAreAttacked(std::vector attacke for(int h = 0; h < attackedInfos.size(); ++h) { addNewAnim(new CDefenceAnim(attackedInfos[h], this)); + if (attackedInfos[h].rebirth) + displayEffect(50, attackedInfos[h].defender->position); //TODO: play reverse death animation } waitForAnims(); + for(int h = 0; h < attackedInfos.size(); ++h) + { + if (attackedInfos[h].rebirth) + creAnims[attackedInfos[h].defender->ID]->setType(CCreatureAnim::HOLDING); + } } void CBattleInterface::stackAttacking( const CStack * attacker, THex dest, const CStack * attacked, bool shooting ) diff --git a/lib/BattleState.cpp b/lib/BattleState.cpp index cc9d6f7be..f9f7821c4 100644 --- a/lib/BattleState.cpp +++ b/lib/BattleState.cpp @@ -2501,15 +2501,16 @@ void CStack::prepareAttacked(BattleStackAttacked &bsa) const { int resurrectedCount = base->count * resurrectFactor / 100; if (resurrectedCount) - resurrectedCount += ((base->count % resurrectedCount) * resurrectFactor / 100.0f) > ran()%100 ? 1 : 0; //last stack has proportional chance to rebirth + resurrectedCount += ((base->count * resurrectFactor / 100.0f - resurrectedCount) > ran()%100 / 100.0f) ? 1 : 0; //last stack has proportional chance to rebirth else //only one unit - resurrectedCount += (base->count * resurrectFactor / 100.0f) > ran()%100 ? 1 : 0; + resurrectedCount += ((base->count * resurrectFactor / 100.0f) > ran()%100 / 100.0f) ? 1 : 0; if (hasBonusOfType(Bonus::REBIRTH, 1)) amax (resurrectedCount, 1); //resurrect at least one Sacred Phoenix if (resurrectedCount) { bsa.flags |= BattleStackAttacked::REBIRTH; bsa.newAmount = resurrectedCount; //risky? + bsa.newHP = MaxHealth(); //resore full health } } }