- new features by Zethfox:
-- "oneshot" optional parameters for lords (helps fixing issues with bouncelands)
-- Life as a cost (avoids using a dirty trick of paying life as an effect)
-- set life total abilitiy (lifeset
-- new auto lines: autostack, autoexile

The test suite passes with these changes, also no test using these abilities has been added yet
This commit is contained in:
wagic.the.homebrew@gmail.com
2010-08-08 14:04:37 +00:00
parent 3d3b4112cb
commit 47c9ad1b65
5 changed files with 174 additions and 2 deletions

View File

@@ -51,6 +51,10 @@ public:
intValue = computeX(spell,card);
}else if (s == "manacost"){
intValue = target->getManaCost()->getConvertedCost();
}else if (s == "lifetotal"){
intValue = target->controller()->life;
}else if (s == "opponentlifetotal"){
intValue = target->controller()->opponent()->life;
}else if (s == "p"){
intValue = target->power;
}else if (s == "t"){
@@ -699,7 +703,7 @@ class AALifer:public ActivatedAbilityTP{
if (_target->type_as_damageable == DAMAGEABLE_MTGCARDINSTANCE){
_target = ((MTGCardInstance *)_target)->controller();
}
_target->life+=life->getValue();
_target->life +=life->getValue();
}
return 1;
}
@@ -1166,7 +1170,6 @@ public:
};
/*Gives life each time a spell matching CardDescriptor's criteria are match . Optionnal manacost*/
class ASpellCastLife:public MTGAbility{
public:
@@ -2087,7 +2090,43 @@ class AThisForEach:public MTGAbility, public NestedAbility{
return a;
}
};
//lifeset
class AALifeSet:public ActivatedAbilityTP{
public:
WParsedInt * life;
AALifeSet(int _id, MTGCardInstance * _source, Targetable * _target, WParsedInt * life, ManaCost * _cost=NULL, int doTap = 0, int who = TargetChooser::UNSET):ActivatedAbilityTP(_id,_source,_target,_cost,doTap,who),life(life){
}
int resolve(){
Damageable * _target = (Damageable *) getTarget();
if(_target){
if (_target->type_as_damageable == DAMAGEABLE_MTGCARDINSTANCE){
_target = ((MTGCardInstance *)_target)->controller();
}
_target->life =life->getValue();
}
return 0;
}
const char * getMenuText(){
return "Set Life";
}
AALifeSet * clone() const{
AALifeSet * a = NEW AALifeSet(*this);
a->life = NEW WParsedInt(*(a->life));
a->isClone = 1;
return a;
}
~AALifeSet(){
SAFE_DELETE(life);
}
};
//lifesetend
class AADamager:public ActivatedAbilityTP{
public:
WParsedInt * damage;

View File

@@ -55,6 +55,20 @@ public:
virtual SacrificeCost * clone() const;
};
//life cost
class LifeCost: public ExtraCost{
public:
MTGCardInstance * target;
LifeCost(TargetChooser *_tc = NULL);
virtual int setPayment(MTGCardInstance * card);
virtual int isPaymentSet();
virtual int canPay();
virtual int doPay();
virtual void Render();
virtual int setSource(MTGCardInstance * _source);
virtual LifeCost * clone() const;
};
//tap other cost
class TapTargetCost: public ExtraCost{
public: