- removed some unused code. Please review!
- Added protection from() auto keyword. It is still possible to use protection from [color] in abilities, but when it is not possible, please use protection from([target]) in auto=
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-11-21 07:26:26 +00:00
parent a7a3ecb596
commit da9a82cff4
33 changed files with 178 additions and 436 deletions
+32
View File
@@ -1034,6 +1034,38 @@ class AUnBlocker:public MTGAbility{
};
//Protection From (creature/aura)
class AProtectionFrom: public MTGAbility{
public:
TargetChooser * fromTc;
AProtectionFrom(int id, MTGCardInstance * _source, MTGCardInstance * _target, TargetChooser *fromTc):MTGAbility(id,_source,_target),fromTc(fromTc){
}
int addToGame(){
MTGCardInstance * _target = (MTGCardInstance *)target;
_target->addProtection(fromTc);
return MTGAbility::addToGame();
}
int destroy(){
((MTGCardInstance *)target)->removeProtection(fromTc);
return 1;
}
AProtectionFrom * clone() const{
AProtectionFrom * a = NEW AProtectionFrom(*this);
a->isClone = 1;
return a;
}
~AProtectionFrom(){
SAFE_DELETE(fromTc);
}
};
//Alteration of Power and Toughness (enchantments)
class APowerToughnessModifier: public MTGAbility{
public: