Erwan
-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:
@@ -36,6 +36,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
|
||||||
ascendant_evincar.txt
|
ascendant_evincar.txt
|
||||||
ascendant_evincar2.txt
|
ascendant_evincar2.txt
|
||||||
ascendant_evincar3.txt
|
ascendant_evincar3.txt
|
||||||
|
|||||||
@@ -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]
|
||||||
+24
-19
@@ -28,23 +28,6 @@ void Damage::init(MTGCardInstance * _source, Damageable * _target, int _damage){
|
|||||||
int Damage::resolve(){
|
int Damage::resolve(){
|
||||||
if (damage <0) damage = 0; //Negative damages cannot happen
|
if (damage <0) damage = 0; //Negative damages cannot happen
|
||||||
state = RESOLVED_OK;
|
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();
|
GameObserver * g = GameObserver::GetInstance();
|
||||||
WEvent * e = NEW WEventDamage(this);
|
WEvent * e = NEW WEventDamage(this);
|
||||||
@@ -60,8 +43,30 @@ int Damage::resolve(){
|
|||||||
damage = ev->damage->damage;
|
damage = ev->damage->damage;
|
||||||
target = ev->damage->target;
|
target = ev->damage->target;
|
||||||
|
|
||||||
int a = 0;
|
if (!damage) return 0;
|
||||||
if (damage) a = target->dealDamage(damage);
|
|
||||||
|
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
|
//Send (Damage/Replaced effect) event to listeners
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user