fix Stuffy Doll not dealing damage to opponent when it receives damage from blocking a creature.

This commit is contained in:
jendave
2011-08-06 12:28:17 +00:00
parent 913eaaa56a
commit 710c86e705
2 changed files with 27 additions and 4 deletions

View File

@@ -2841,6 +2841,22 @@ public class Card extends MyObservable {
damage += damageToAdd;
}
if(this.getName().equals("Stuffy Doll")) {
final Player opponent = this.getOwner().getOpponent();
final int stuffyDamage = damageToAdd;
SpellAbility ability = new Ability(this, "0") {
@Override
public void resolve() {
opponent.addDamage(stuffyDamage, Card.this);
}
};
StringBuilder sb = new StringBuilder();
sb.append("Stuffy Doll - causes ").append(stuffyDamage).append(" damage to ").append(opponent);
ability.setStackDescription(sb.toString());
AllZone.Stack.add(ability);
}
if(source.getKeyword().contains("Lifelink") && CardFactoryUtil.canDamage(source, this)) GameActionUtil.executeLifeLinkEffects(source, damageToAdd);
if(isEnchantedBy("Mortal Wound")) {

View File

@@ -324,9 +324,10 @@ public class CardFactory_Creatures {
return newCard;
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Stuffy Doll")) {
/*
final Card newCard = new Card() {
Card c = this;
@@ -364,30 +365,36 @@ public class CardFactory_Creatures {
newCard.setBaseDefense(1);
newCard.addIntrinsicKeyword("Indestructible");
*/
Ability_Cost abilCost = new Ability_Cost("T", cardName, true);
final Ability_Activated ability = new Ability_Activated(newCard, abilCost, null){
final Ability_Activated ability = new Ability_Activated(card, abilCost, null){
private static final long serialVersionUID = 577739727089395613L;
@Override
public void resolve() {
newCard.addDamage(1, newCard);
card.addDamage(1, card);
}
};//SpellAbility
StringBuilder sb = new StringBuilder();
sb.append(abilCost.toString()).append("Stuffy Doll deals 1 damage to itself.");
ability.setDescription(sb.toString());
ability.setStackDescription("Stuffy Doll - deals 1 damage to itself.");
card.addSpellAbility(ability);
/*
ability.setStackDescription("Stuffy Doll - deals 1 damage to itself.");
newCard.addSpellAbility(new Spell_Permanent(newCard));
newCard.addSpellAbility(ability);
newCard.addSpellAbility(ability);
newCard.setSVars(card.getSVars());
return newCard;
return newCard;*/
}//*************** END ************ END **************************