-fixed problem with lifelink+wither, although combat damages are not entirely correct. Once combat damages actually deal the correct amount of damage, let's put test "armadillo_cloak" back in the suite
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-09-12 11:40:48 +00:00
parent 5bbf9137ad
commit baf49c9ebf
3 changed files with 58 additions and 19 deletions

View File

@@ -36,6 +36,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
ascendant_evincar.txt
ascendant_evincar2.txt
ascendant_evincar3.txt

View File

@@ -0,0 +1,33 @@
#Bug:lifelink and wither
[INIT]
FIRSTMAIN
[PLAYER1]
inplay:Wildslayer Elves
hand:Armadillo Cloak
manapool:{1}{G}{W}
[PLAYER2]
inplay:grizzly bears
[DO]
armadillo cloak
Wildslayer Elves
next
#begin
next
#attackers
Wildslayer elves
next
#blockers
grizzly bears
next
#combat damage
next
combat end
[ASSERT]
COMBATEND
[PLAYER1]
inplay:Wildslayer Elves,Armadillo Cloak
life:25
[PLAYER2]
graveyard:grizzly bears
life:20
[END]

View File

@@ -28,23 +28,6 @@ void Damage::init(MTGCardInstance * _source, Damageable * _target, int _damage){
int Damage::resolve(){
if (damage <0) damage = 0; //Negative damages cannot happen
state = RESOLVED_OK;
if (target->type_as_damageable == DAMAGEABLE_MTGCARDINSTANCE){
MTGCardInstance * _target = (MTGCardInstance *)target;
if ((_target)->protectedAgainst(source)) damage = 0;
// Damage for WITHER on creatures
if (!damage){
state = RESOLVED_NOK;
return 0;
}
if (source->has(Constants::WITHER)){
for (int i = 0; i < damage; i++){
_target->counters->addCounter(-1, -1);
}
return 1;
}
_target->doDamageTest = 1;
}
GameObserver * g = GameObserver::GetInstance();
WEvent * e = NEW WEventDamage(this);
@@ -60,8 +43,30 @@ int Damage::resolve(){
damage = ev->damage->damage;
target = ev->damage->target;
int a = 0;
if (damage) a = target->dealDamage(damage);
if (!damage) return 0;
if (target->type_as_damageable == DAMAGEABLE_MTGCARDINSTANCE){
MTGCardInstance * _target = (MTGCardInstance *)target;
if ((_target)->protectedAgainst(source)) damage = 0;
if (!damage){
state = RESOLVED_NOK;
delete (e);
return 0;
}
_target->doDamageTest = 1;
}
int a = damage;
// Damage for WITHER on creatures. This should probably go in replacement effects
if (target->type_as_damageable == DAMAGEABLE_MTGCARDINSTANCE && source->has(Constants::WITHER)){
MTGCardInstance * _target = (MTGCardInstance *)target;
for (int i = 0; i < damage; i++){
_target->counters->addCounter(-1, -1);
}
}else{ //Normal case
a = target->dealDamage(damage);
}
//Send (Damage/Replaced effect) event to listeners