added support for no max hand size, added nonstatic lifetotal checks, added a check for how many equips a card has, added a fix for a typo in affinityswamp.
This commit is contained in:
@@ -55,6 +55,8 @@ public:
|
||||
intValue = computeX(spell,card);
|
||||
}else if (s == "xx" || s == "XX"){
|
||||
intValue = computeXX(spell,card);
|
||||
}else if (s == "equips"){
|
||||
intValue = target->equipment;
|
||||
}else if (s == "manacost"){
|
||||
intValue = target->getManaCost()->getConvertedCost();
|
||||
}else if (s == "lifetotal"){
|
||||
@@ -792,10 +794,19 @@ class AAWinGame:public ActivatedAbilityTP{
|
||||
int cantlosers = 0;
|
||||
MTGGameZone * z = ((Player *)_target)->opponent()->game->inPlay;
|
||||
int nbcards = z->nb_cards;
|
||||
for (int i = 0; i < nbcards; ++i){
|
||||
|
||||
for (int i = 0; i < nbcards; i++){
|
||||
MTGCardInstance * c = z->cards[i];
|
||||
if (c->has(Constants::CANTLOSE)){
|
||||
cantlosers++;
|
||||
}
|
||||
}
|
||||
MTGGameZone * k = ((Player *)_target)->game->inPlay;
|
||||
int onbcards = k->nb_cards;
|
||||
for (int m = 0; m < onbcards; ++m){
|
||||
MTGCardInstance * e = k->cards[m];
|
||||
if (e->has(Constants::CANTWIN)){
|
||||
cantlosers++;
|
||||
}
|
||||
}
|
||||
if(cantlosers < 1){
|
||||
@@ -1190,7 +1201,7 @@ class ABasicAbilityAuraModifierUntilEOT: public ActivatedAbility{
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//equipment
|
||||
class AEquip:public TargetAbility{
|
||||
public:
|
||||
vector<MTGAbility *> currentAbilities;
|
||||
@@ -1199,6 +1210,7 @@ public:
|
||||
}
|
||||
|
||||
int unequip(){
|
||||
if(source->target){source->target->equipment -= 1;}
|
||||
source->target = NULL;
|
||||
for (size_t i = 0; i < currentAbilities.size(); ++i){
|
||||
MTGAbility * a = currentAbilities[i];
|
||||
@@ -1215,6 +1227,7 @@ public:
|
||||
|
||||
int equip(MTGCardInstance * equipped){
|
||||
source->target = equipped;
|
||||
source->target->equipment += 1;
|
||||
AbilityFactory af;
|
||||
af.getAbilities(¤tAbilities,NULL,source);
|
||||
for (size_t i = 0; i < currentAbilities.size(); ++i){
|
||||
@@ -1233,7 +1246,6 @@ public:
|
||||
if (mTarget == source) return 0;
|
||||
unequip();
|
||||
equip(mTarget);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ class MTGCardInstance: public CardPrimitive, public MTGCard, public Damageable {
|
||||
int flashedback;
|
||||
int paymenttype;
|
||||
int frozen;
|
||||
int equipment;
|
||||
int reduxamount;
|
||||
int regenerateTokens;
|
||||
int isToken;
|
||||
|
||||
@@ -131,9 +131,10 @@ class Constants
|
||||
AFFINITYMOUNTAIN = 73,
|
||||
AFFINITYSWAMP = 74,
|
||||
AFFINITYGREENCREATURES = 75,
|
||||
CANTWIN = 76,
|
||||
NOMAXHAND = 77,
|
||||
|
||||
|
||||
NB_BASIC_ABILITIES = 76,
|
||||
NB_BASIC_ABILITIES = 78,
|
||||
|
||||
|
||||
RARITY_S = 'S', //Special Rarity
|
||||
|
||||
@@ -22,6 +22,7 @@ class Player: public Damageable{
|
||||
JTexture * mAvatarTex;
|
||||
JQuad * mAvatar;
|
||||
int canPutLandsIntoPlay;
|
||||
int nomaxhandsize;
|
||||
int castedspellsthisturn;
|
||||
int onlyonecast;
|
||||
int castcount;
|
||||
|
||||
@@ -41,6 +41,27 @@ class ThisCounterAny:public ThisDescriptor{
|
||||
ThisCounterAny(int nb);
|
||||
};
|
||||
|
||||
class ThisControllerlife:public ThisDescriptor{
|
||||
public:
|
||||
virtual int match(MTGCardInstance * card);
|
||||
|
||||
ThisControllerlife(int life);
|
||||
};
|
||||
|
||||
class ThisOpponentlife:public ThisDescriptor{
|
||||
public:
|
||||
virtual int match(MTGCardInstance * card);
|
||||
|
||||
ThisOpponentlife(int olife);
|
||||
};
|
||||
|
||||
class ThisEquip:public ThisDescriptor{
|
||||
public:
|
||||
virtual int match(MTGCardInstance * card);
|
||||
|
||||
ThisEquip(int equipment);
|
||||
};
|
||||
|
||||
class ThisPower:public ThisDescriptor{
|
||||
public:
|
||||
virtual int match(MTGCardInstance * card);
|
||||
|
||||
Reference in New Issue
Block a user