J :
* 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:
@@ -39,7 +39,7 @@ arcanis_the_omnipotent.txt
|
|||||||
arcanis_the_omnipotent2.txt
|
arcanis_the_omnipotent2.txt
|
||||||
ardakar_wastes.txt
|
ardakar_wastes.txt
|
||||||
argothian_enchantress.txt
|
argothian_enchantress.txt
|
||||||
#armadillo_cloak.txt #TODO restore when damages are completely assigned
|
armadillo_cloak.txt
|
||||||
ascendant_evincar.txt
|
ascendant_evincar.txt
|
||||||
ascendant_evincar2.txt
|
ascendant_evincar2.txt
|
||||||
ascendant_evincar3.txt
|
ascendant_evincar3.txt
|
||||||
@@ -99,7 +99,7 @@ fastbond2.txt
|
|||||||
fault_line.txt
|
fault_line.txt
|
||||||
fists_of_ironwood.txt
|
fists_of_ironwood.txt
|
||||||
flare.txt
|
flare.txt
|
||||||
fledgling_imp.txt
|
fledgling_imp.txt
|
||||||
fledgling_imp2.txt
|
fledgling_imp2.txt
|
||||||
foratog.txt
|
foratog.txt
|
||||||
force_of_nature.txt
|
force_of_nature.txt
|
||||||
@@ -117,7 +117,7 @@ goblin_king.txt
|
|||||||
gravedigger.txt
|
gravedigger.txt
|
||||||
#hammerfist_giant.txt
|
#hammerfist_giant.txt
|
||||||
hannas_custody.txt
|
hannas_custody.txt
|
||||||
harpoon_sniper.txt
|
harpoon_sniper.txt
|
||||||
hellfire.txt
|
hellfire.txt
|
||||||
howl_of_the_night_pack.txt
|
howl_of_the_night_pack.txt
|
||||||
hymn_of_rebirth.txt
|
hymn_of_rebirth.txt
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ void GuiCombat::autoaffectDamage(AttackerDamaged* attacker, CombatStep step)
|
|||||||
attacker->addDamage((*it)->card->stepPower(step), *it);
|
attacker->addDamage((*it)->card->stepPower(step), *it);
|
||||||
damage -= actual_damage;
|
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)
|
void GuiCombat::addOne(DefenserDamaged* blocker, CombatStep step)
|
||||||
@@ -115,7 +116,8 @@ void GuiCombat::removeOne(DefenserDamaged* blocker, CombatStep step)
|
|||||||
{
|
{
|
||||||
blocker->addDamage(-1, activeAtk);
|
blocker->addDamage(-1, activeAtk);
|
||||||
for (vector<DamagerDamaged*>::iterator it = activeAtk->blockers.begin(); it != activeAtk->blockers.end(); ++it)
|
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(){
|
bool GuiCombat::clickOK(){
|
||||||
@@ -301,16 +303,14 @@ int GuiCombat::resolve() // Returns the number of damage objects dealt this turn
|
|||||||
DamageStack* stack = NEW DamageStack();
|
DamageStack* stack = NEW DamageStack();
|
||||||
for (inner_iterator it = attackers.begin(); it != attackers.end(); ++it)
|
for (inner_iterator it = attackers.begin(); it != attackers.end(); ++it)
|
||||||
{
|
{
|
||||||
if ((*it)->blockers.empty())
|
signed dmg = (*it)->card->stepPower(step);
|
||||||
{
|
|
||||||
int dmg = (*it)->card->stepPower(step);
|
|
||||||
if (dmg > 0)
|
|
||||||
stack->Add(NEW Damage((*it)->card, go->opponent(), dmg));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
for (vector<DefenserDamaged*>::iterator q = (*it)->blockers.begin(); q != (*it)->blockers.end(); ++q)
|
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)
|
for (vector<Damage>::iterator d = (*it)->damages.begin(); d != (*it)->damages.end(); ++d)
|
||||||
stack->Add(NEW Damage(*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){
|
if (v > 0){
|
||||||
go->mLayers->stackLayer()->Add(stack);
|
go->mLayers->stackLayer()->Add(stack);
|
||||||
go->mLayers->stackLayer()->resolve(); // This will delete the damage stack which will in turn delete the Damage it contains
|
go->mLayers->stackLayer()->resolve(); // This will delete the damage stack which will in turn delete the Damage it contains
|
||||||
}else{
|
}else
|
||||||
SAFE_DELETE(stack);
|
SAFE_DELETE(stack);
|
||||||
}
|
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user