* Affect overflowing damage.
* Reinstate Armadillo cloak test.
  . Note that this test does not work at the moment : my understanding
    is the TEST is wrong and not the implementation, but I'd like a
    double check before changing the test.
This commit is contained in:
jean.chalard
2009-09-23 16:22:56 +00:00
parent 02c41695a3
commit f907f39334
2 changed files with 14 additions and 15 deletions
+3 -3
View File
@@ -39,7 +39,7 @@ arcanis_the_omnipotent.txt
arcanis_the_omnipotent2.txt
ardakar_wastes.txt
argothian_enchantress.txt
#armadillo_cloak.txt #TODO restore when damages are completely assigned
armadillo_cloak.txt
ascendant_evincar.txt
ascendant_evincar2.txt
ascendant_evincar3.txt
@@ -99,7 +99,7 @@ fastbond2.txt
fault_line.txt
fists_of_ironwood.txt
flare.txt
fledgling_imp.txt
fledgling_imp.txt
fledgling_imp2.txt
foratog.txt
force_of_nature.txt
@@ -117,7 +117,7 @@ goblin_king.txt
gravedigger.txt
#hammerfist_giant.txt
hannas_custody.txt
harpoon_sniper.txt
harpoon_sniper.txt
hellfire.txt
howl_of_the_night_pack.txt
hymn_of_rebirth.txt
+11 -12
View File
@@ -99,6 +99,7 @@ void GuiCombat::autoaffectDamage(AttackerDamaged* attacker, CombatStep step)
attacker->addDamage((*it)->card->stepPower(step), *it);
damage -= actual_damage;
}
if (damage > 0 && attacker->blockers.size() > 0 && !attacker->card->has(Constants::TRAMPLE)) attacker->blockers[0]->addDamage(damage, attacker);
}
void GuiCombat::addOne(DefenserDamaged* blocker, CombatStep step)
@@ -115,7 +116,8 @@ void GuiCombat::removeOne(DefenserDamaged* blocker, CombatStep step)
{
blocker->addDamage(-1, activeAtk);
for (vector<DamagerDamaged*>::iterator it = activeAtk->blockers.begin(); it != activeAtk->blockers.end(); ++it)
if (!(*it)->hasLethalDamage()) { (*it)->addDamage(1, activeAtk); break; }
if (!(*it)->hasLethalDamage()) { (*it)->addDamage(1, activeAtk); return; }
if (!activeAtk->card->has(Constants::TRAMPLE) && activeAtk->blockers.size() > 0) activeAtk->blockers.back()->addDamage(1, activeAtk);
}
bool GuiCombat::clickOK(){
@@ -301,16 +303,14 @@ int GuiCombat::resolve() // Returns the number of damage objects dealt this turn
DamageStack* stack = NEW DamageStack();
for (inner_iterator it = attackers.begin(); it != attackers.end(); ++it)
{
if ((*it)->blockers.empty())
{
int dmg = (*it)->card->stepPower(step);
if (dmg > 0)
stack->Add(NEW Damage((*it)->card, go->opponent(), dmg));
}
else
signed dmg = (*it)->card->stepPower(step);
for (vector<DefenserDamaged*>::iterator q = (*it)->blockers.begin(); q != (*it)->blockers.end(); ++q)
for (vector<Damage>::iterator d = (*q)->damages.begin(); d != (*q)->damages.end(); ++d)
stack->Add(NEW Damage(*d));
{
for (vector<Damage>::iterator d = (*q)->damages.begin(); d != (*q)->damages.end(); ++d)
stack->Add(NEW Damage(*d));
dmg -= (*q)->sumDamages();
}
if (dmg > 0) stack->Add(NEW Damage((*it)->card, go->opponent(), dmg));
for (vector<Damage>::iterator d = (*it)->damages.begin(); d != (*it)->damages.end(); ++d)
stack->Add(NEW Damage(*d));
}
@@ -318,9 +318,8 @@ int GuiCombat::resolve() // Returns the number of damage objects dealt this turn
if (v > 0){
go->mLayers->stackLayer()->Add(stack);
go->mLayers->stackLayer()->resolve(); // This will delete the damage stack which will in turn delete the Damage it contains
}else{
}else
SAFE_DELETE(stack);
}
return v;
}