- Added "PreventAllCombatDamage" [from(...)] [to(...)] keyword. Please test it on a few cards before we "mass" use it. As a side effect, fixed issue 155 (ebony horse target).
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-11-14 11:35:29 +00:00
parent 5781060d83
commit 9ca552093e
15 changed files with 2695 additions and 2577 deletions

View File

@@ -2,10 +2,10 @@
#include "../include/ReplacementEffects.h"
#include "../include/MTGCardInstance.h"
#include "../include/TargetChooser.h"
#include "../include/Damage.h"
REDamagePrevention::REDamagePrevention(MTGAbility * source, TargetChooser *tcSource, TargetChooser *tcTarget, int damage, bool oneShot):source(source), tcSource(tcSource), tcTarget(tcTarget), damage(damage), oneShot(oneShot){
REDamagePrevention::REDamagePrevention(MTGAbility * source, TargetChooser *tcSource, TargetChooser *tcTarget, int damage, bool oneShot, int typeOfDamage):source(source), tcSource(tcSource), tcTarget(tcTarget), damage(damage), oneShot(oneShot), typeOfDamage(typeOfDamage){
}
WEvent * REDamagePrevention::replace (WEvent *event){
@@ -14,6 +14,7 @@ WEvent * REDamagePrevention::replace (WEvent *event){
WEventDamage * e = dynamic_cast<WEventDamage*>(event);
if (!e) return event;
Damage *d = e->damage;
if (d->typeOfDamage != typeOfDamage && typeOfDamage != DAMAGE_ALL_TYPES) return event;
if ((!tcSource || tcSource->canTarget(d->source)) &&
(!tcTarget || tcTarget->canTarget(d->target))
){