removed the variable doTap in Tap from all classes, all test pass but there could be an edge case where i missed removing one...if so just let me know, tweaked some ai eff returns, trying to teach it to use counters more effectively, i noticed it was not using -1/-1 counters on the players creature and was using off counters +1/-1 on its own creatures to the point where they died.
doTap now only serves a single purpose, to pass Tap variable to amanaproducer class so that "tappedformana" will trigger is a manaproducer was tapped for mana.
This commit is contained in:
@@ -894,7 +894,7 @@ public:
|
|||||||
string menu;
|
string menu;
|
||||||
|
|
||||||
AACounter(int id, MTGCardInstance * source, MTGCardInstance * target,string counterstring, const char * _name, int power, int toughness, int nb,int maxNb = 0,
|
AACounter(int id, MTGCardInstance * source, MTGCardInstance * target,string counterstring, const char * _name, int power, int toughness, int nb,int maxNb = 0,
|
||||||
ManaCost * cost = NULL, int doTap = 0);
|
ManaCost * cost = NULL);
|
||||||
|
|
||||||
int resolve();
|
int resolve();
|
||||||
const char* getMenuText();
|
const char* getMenuText();
|
||||||
@@ -913,7 +913,7 @@ public:
|
|||||||
bool all;
|
bool all;
|
||||||
|
|
||||||
AARemoveAllCounter(int id, MTGCardInstance * source, MTGCardInstance * target, const char * _name, int power, int toughness, int nb,
|
AARemoveAllCounter(int id, MTGCardInstance * source, MTGCardInstance * target, const char * _name, int power, int toughness, int nb,
|
||||||
bool all,ManaCost * cost = NULL, int doTap = 0);
|
bool all,ManaCost * cost = NULL);
|
||||||
|
|
||||||
int resolve();
|
int resolve();
|
||||||
const char* getMenuText();
|
const char* getMenuText();
|
||||||
@@ -925,7 +925,7 @@ class AAFizzler: public ActivatedAbility
|
|||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AAFizzler(int _id, MTGCardInstance * card, Spell * _target, ManaCost * _cost = NULL, int _tap = 0);
|
AAFizzler(int _id, MTGCardInstance * card, Spell * _target, ManaCost * _cost = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
AAFizzler* clone() const;
|
AAFizzler* clone() const;
|
||||||
@@ -965,7 +965,7 @@ class MultiAbility: public ActivatedAbility
|
|||||||
public:
|
public:
|
||||||
vector<MTGAbility *> abilities;
|
vector<MTGAbility *> abilities;
|
||||||
|
|
||||||
MultiAbility(int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost, int _tap);
|
MultiAbility(int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost);
|
||||||
int Add(MTGAbility * ability);
|
int Add(MTGAbility * ability);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
@@ -981,7 +981,7 @@ public:
|
|||||||
MTGGameZone * activeZone;
|
MTGGameZone * activeZone;
|
||||||
string newName;
|
string newName;
|
||||||
|
|
||||||
GenericActivatedAbility(string newName,int _id, MTGCardInstance * card, MTGAbility * a, ManaCost * _cost, int _tap = 0, string limit = "",MTGAbility * sideEffects = NULL,string usesBeforeSideEffects = "",
|
GenericActivatedAbility(string newName,int _id, MTGCardInstance * card, MTGAbility * a, ManaCost * _cost, string limit = "",MTGAbility * sideEffects = NULL,string usesBeforeSideEffects = "",
|
||||||
int restrictions = 0, MTGGameZone * dest = NULL);
|
int restrictions = 0, MTGGameZone * dest = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
@@ -1035,7 +1035,7 @@ class AAMover: public ActivatedAbility
|
|||||||
public:
|
public:
|
||||||
string destination;
|
string destination;
|
||||||
|
|
||||||
AAMover(int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest, ManaCost * _cost = NULL, int doTap = 0);
|
AAMover(int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest, ManaCost * _cost = NULL);
|
||||||
MTGGameZone * destinationZone();
|
MTGGameZone * destinationZone();
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
@@ -1109,8 +1109,7 @@ public:
|
|||||||
MTGGameZone * activeZone;
|
MTGGameZone * activeZone;
|
||||||
string newName;
|
string newName;
|
||||||
|
|
||||||
GenericTargetAbility(string newName,int _id, MTGCardInstance * _source, TargetChooser * _tc, MTGAbility * a, ManaCost * _cost = NULL,
|
GenericTargetAbility(string newName,int _id, MTGCardInstance * _source, TargetChooser * _tc, MTGAbility * a, ManaCost * _cost = NULL, string limit = "",MTGAbility * sideEffects = NULL,string usesBeforeSideEffects = "", int restrictions = 0, MTGGameZone * dest = NULL);
|
||||||
int _tap = 0, string limit = "",MTGAbility * sideEffects = NULL,string usesBeforeSideEffects = "", int restrictions = 0, MTGGameZone * dest = NULL);
|
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
~GenericTargetAbility();
|
~GenericTargetAbility();
|
||||||
GenericTargetAbility * clone() const;
|
GenericTargetAbility * clone() const;
|
||||||
@@ -1239,7 +1238,7 @@ public:
|
|||||||
|
|
||||||
string nbcardsStr;
|
string nbcardsStr;
|
||||||
|
|
||||||
AADrawer(int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost,string nbcardsStr, int _tap = 0, int who =
|
AADrawer(int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost,string nbcardsStr, int who =
|
||||||
TargetChooser::UNSET);
|
TargetChooser::UNSET);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
@@ -1287,7 +1286,7 @@ class AALifer: public ActivatedAbilityTP
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
string life_s;
|
string life_s;
|
||||||
AALifer(int _id, MTGCardInstance * card, Targetable * _target,string life_s, ManaCost * _cost = NULL, int _tap = 0,
|
AALifer(int _id, MTGCardInstance * card, Targetable * _target,string life_s, ManaCost * _cost = NULL,
|
||||||
int who = TargetChooser::UNSET);
|
int who = TargetChooser::UNSET);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
@@ -1300,7 +1299,7 @@ public:
|
|||||||
class AAWinGame: public ActivatedAbilityTP
|
class AAWinGame: public ActivatedAbilityTP
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AAWinGame(int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost = NULL, int _tap = 0, int who =
|
AAWinGame(int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost = NULL, int who =
|
||||||
TargetChooser::UNSET);
|
TargetChooser::UNSET);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
@@ -1390,8 +1389,8 @@ public:
|
|||||||
int stateBeforeActivation[50];
|
int stateBeforeActivation[50];
|
||||||
int ability;
|
int ability;
|
||||||
ABasicAbilityModifierUntilEOT(int _id, MTGCardInstance * _source, int _ability, ManaCost * _cost, TargetChooser * _tc = NULL,
|
ABasicAbilityModifierUntilEOT(int _id, MTGCardInstance * _source, int _ability, ManaCost * _cost, TargetChooser * _tc = NULL,
|
||||||
int _modifier = 1, int _tap = 1) :
|
int _modifier = 1) :
|
||||||
TargetAbility(_id, _source, _cost, 0, _tap), modifier(_modifier), ability(_ability)
|
TargetAbility(_id, _source, _cost, 0), modifier(_modifier), ability(_ability)
|
||||||
{
|
{
|
||||||
aType = MTGAbility::STANDARDABILITYGRANT;
|
aType = MTGAbility::STANDARDABILITYGRANT;
|
||||||
abilitygranted = ability;
|
abilitygranted = ability;
|
||||||
@@ -1520,7 +1519,7 @@ public:
|
|||||||
AInstantBasicAbilityModifierUntilEOT * ability;
|
AInstantBasicAbilityModifierUntilEOT * ability;
|
||||||
ABasicAbilityAuraModifierUntilEOT(int _id, MTGCardInstance * _source, MTGCardInstance * _target, ManaCost * _cost,
|
ABasicAbilityAuraModifierUntilEOT(int _id, MTGCardInstance * _source, MTGCardInstance * _target, ManaCost * _cost,
|
||||||
int _ability, int _value = 1) :
|
int _ability, int _value = 1) :
|
||||||
ActivatedAbility(_id, _source, _cost, 0, 0)
|
ActivatedAbility(_id, _source, _cost, 0)
|
||||||
{
|
{
|
||||||
target = _target;
|
target = _target;
|
||||||
ability = NEW AInstantBasicAbilityModifierUntilEOT(_id, _source, _target, _ability, _value);
|
ability = NEW AInstantBasicAbilityModifierUntilEOT(_id, _source, _target, _ability, _value);
|
||||||
@@ -1916,7 +1915,7 @@ protected:
|
|||||||
map<ReplacementEffect*, int> current;
|
map<ReplacementEffect*, int> current;
|
||||||
public:
|
public:
|
||||||
ACircleOfProtection(int _id, MTGCardInstance * source, int _color) :
|
ACircleOfProtection(int _id, MTGCardInstance * source, int _color) :
|
||||||
TargetAbility(_id, source, NEW SpellOrPermanentTargetChooser(source, _color), NEW ManaCost(), 0, 0)
|
TargetAbility(_id, source, NEW SpellOrPermanentTargetChooser(source, _color), NEW ManaCost(), 0)
|
||||||
{
|
{
|
||||||
cost->add(Constants::MTG_COLOR_ARTIFACT, 1);
|
cost->add(Constants::MTG_COLOR_ARTIFACT, 1);
|
||||||
tc->targetter = NULL; //Circle of Protection doesn't use the word "source"
|
tc->targetter = NULL; //Circle of Protection doesn't use the word "source"
|
||||||
@@ -1978,7 +1977,7 @@ class AStandardRegenerate: public ActivatedAbility
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AStandardRegenerate(int _id, MTGCardInstance * _source, MTGCardInstance * _target, ManaCost * _cost = NULL) :
|
AStandardRegenerate(int _id, MTGCardInstance * _source, MTGCardInstance * _target, ManaCost * _cost = NULL) :
|
||||||
ActivatedAbility(_id, _source, _cost, 0, 0)
|
ActivatedAbility(_id, _source, _cost, 0)
|
||||||
{
|
{
|
||||||
target = _target;
|
target = _target;
|
||||||
aType = MTGAbility::STANDARD_REGENERATE;
|
aType = MTGAbility::STANDARD_REGENERATE;
|
||||||
@@ -2628,9 +2627,9 @@ class AEquip: public TargetAbility
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
vector<MTGAbility *> currentAbilities;
|
vector<MTGAbility *> currentAbilities;
|
||||||
AEquip(int _id, MTGCardInstance * _source, ManaCost * _cost = NULL, int doTap = 0, int restrictions =
|
AEquip(int _id, MTGCardInstance * _source, ManaCost * _cost = NULL, int restrictions =
|
||||||
ActivatedAbility::AS_SORCERY) :
|
ActivatedAbility::AS_SORCERY) :
|
||||||
TargetAbility(_id, _source, NULL, _cost, restrictions, doTap)
|
TargetAbility(_id, _source, NULL, _cost, restrictions)
|
||||||
{
|
{
|
||||||
aType = MTGAbility::STANDARD_EQUIP;
|
aType = MTGAbility::STANDARD_EQUIP;
|
||||||
}
|
}
|
||||||
@@ -2744,9 +2743,9 @@ ATOKEN_WHO_TARGETCONTROLLER = 2
|
|||||||
MTGCardInstance * myToken;
|
MTGCardInstance * myToken;
|
||||||
vector<MTGAbility *> currentAbilities;
|
vector<MTGAbility *> currentAbilities;
|
||||||
Player * tokenReciever;
|
Player * tokenReciever;
|
||||||
ATokenCreator(int _id, MTGCardInstance * _source, Targetable * _target, ManaCost * _cost, int tokenId, int _doTap,string starfound, WParsedInt * multiplier = NULL,
|
ATokenCreator(int _id, MTGCardInstance * _source, Targetable * _target, ManaCost * _cost, int tokenId,string starfound, WParsedInt * multiplier = NULL,
|
||||||
int who = 0,bool aLivingWeapon = false) :
|
int who = 0,bool aLivingWeapon = false) :
|
||||||
ActivatedAbility(_id, _source, _cost, 0, _doTap), tokenId(tokenId), starfound(starfound),multiplier(multiplier), who(who),aLivingWeapon(aLivingWeapon)
|
ActivatedAbility(_id, _source, _cost, 0), tokenId(tokenId), starfound(starfound),multiplier(multiplier), who(who),aLivingWeapon(aLivingWeapon)
|
||||||
{
|
{
|
||||||
if (!multiplier) this->multiplier = NEW WParsedInt(1);
|
if (!multiplier) this->multiplier = NEW WParsedInt(1);
|
||||||
MTGCard * card = MTGCollection()->getCardById(tokenId);
|
MTGCard * card = MTGCollection()->getCardById(tokenId);
|
||||||
@@ -2755,8 +2754,8 @@ ATOKEN_WHO_TARGETCONTROLLER = 2
|
|||||||
}
|
}
|
||||||
|
|
||||||
ATokenCreator(int _id, MTGCardInstance * _source, Targetable * _target, ManaCost * _cost, string sname, string stypes, int _power, int _toughness,
|
ATokenCreator(int _id, MTGCardInstance * _source, Targetable * _target, ManaCost * _cost, string sname, string stypes, int _power, int _toughness,
|
||||||
string sabilities, int _doTap, string starfound,WParsedInt * multiplier = NULL, int who = 0,bool aLivingWeapon = false,string spt = "") :
|
string sabilities, string starfound,WParsedInt * multiplier = NULL, int who = 0,bool aLivingWeapon = false,string spt = "") :
|
||||||
ActivatedAbility(_id, _source, _cost, 0, _doTap),sabilities(sabilities),starfound(starfound), multiplier(multiplier), who(who),aLivingWeapon(aLivingWeapon),spt(spt)
|
ActivatedAbility(_id, _source, _cost, 0),sabilities(sabilities),starfound(starfound), multiplier(multiplier), who(who),aLivingWeapon(aLivingWeapon),spt(spt)
|
||||||
{
|
{
|
||||||
power = _power;
|
power = _power;
|
||||||
toughness = _toughness;
|
toughness = _toughness;
|
||||||
@@ -3243,7 +3242,7 @@ class AALifeSet: public ActivatedAbilityTP
|
|||||||
public:
|
public:
|
||||||
WParsedInt * life;
|
WParsedInt * life;
|
||||||
|
|
||||||
AALifeSet(int _id, MTGCardInstance * _source, Targetable * _target, WParsedInt * life, ManaCost * _cost = NULL, int doTap = 0,
|
AALifeSet(int _id, MTGCardInstance * _source, Targetable * _target, WParsedInt * life, ManaCost * _cost = NULL,
|
||||||
int who = TargetChooser::UNSET);
|
int who = TargetChooser::UNSET);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
@@ -3260,7 +3259,7 @@ public:
|
|||||||
string d;
|
string d;
|
||||||
|
|
||||||
AADamager(int _id, MTGCardInstance * _source, Targetable * _target, string d, ManaCost * _cost = NULL,
|
AADamager(int _id, MTGCardInstance * _source, Targetable * _target, string d, ManaCost * _cost = NULL,
|
||||||
int doTap = 0, int who = TargetChooser::UNSET);
|
int who = TargetChooser::UNSET);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
int getDamage();
|
int getDamage();
|
||||||
@@ -3274,8 +3273,7 @@ class AADamagePrevent: public ActivatedAbilityTP
|
|||||||
public:
|
public:
|
||||||
int preventing;
|
int preventing;
|
||||||
|
|
||||||
AADamagePrevent(int _id, MTGCardInstance * _source, Targetable * _target, int preventing, ManaCost * _cost = NULL, int doTap =
|
AADamagePrevent(int _id, MTGCardInstance * _source, Targetable * _target, int preventing, ManaCost * _cost = NULL, int who = TargetChooser::UNSET);
|
||||||
0, int who = TargetChooser::UNSET);
|
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
AADamagePrevent * clone() const;
|
AADamagePrevent * clone() const;
|
||||||
@@ -3288,7 +3286,7 @@ class AAAlterPoison: public ActivatedAbilityTP
|
|||||||
public:
|
public:
|
||||||
int poison;
|
int poison;
|
||||||
|
|
||||||
AAAlterPoison(int _id, MTGCardInstance * _source, Targetable * _target, int poison, ManaCost * _cost = NULL, int doTap = 0,
|
AAAlterPoison(int _id, MTGCardInstance * _source, Targetable * _target, int poison, ManaCost * _cost = NULL,
|
||||||
int who = TargetChooser::UNSET);
|
int who = TargetChooser::UNSET);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
@@ -3300,8 +3298,8 @@ class TADamager: public TargetAbility
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TADamager(int id, MTGCardInstance * card, ManaCost * _cost, string d, TargetChooser * _tc = NULL, int _tap = 0) :
|
TADamager(int id, MTGCardInstance * card, ManaCost * _cost, string d, TargetChooser * _tc = NULL) :
|
||||||
TargetAbility(id, card, _tc, _cost, 0, _tap)
|
TargetAbility(id, card, _tc, _cost, 0)
|
||||||
{
|
{
|
||||||
if (!tc) tc = NEW DamageableTargetChooser(card);
|
if (!tc) tc = NEW DamageableTargetChooser(card);
|
||||||
ability = NEW AADamager(id, card, NULL, d);
|
ability = NEW AADamager(id, card, NULL, d);
|
||||||
@@ -3319,7 +3317,7 @@ public:
|
|||||||
class AATapper: public ActivatedAbility
|
class AATapper: public ActivatedAbility
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AATapper(int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL, int doTap = 0);
|
AATapper(int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
AATapper * clone() const;
|
AATapper * clone() const;
|
||||||
@@ -3329,7 +3327,7 @@ public:
|
|||||||
class AAUntapper: public ActivatedAbility
|
class AAUntapper: public ActivatedAbility
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AAUntapper(int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL, int doTap = 0);
|
AAUntapper(int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
AAUntapper * clone() const;
|
AAUntapper * clone() const;
|
||||||
@@ -3341,7 +3339,7 @@ class AAWhatsMax: public ActivatedAbility
|
|||||||
public:
|
public:
|
||||||
int value;
|
int value;
|
||||||
|
|
||||||
AAWhatsMax(int id, MTGCardInstance * card, MTGCardInstance * source, ManaCost * _cost = NULL, int doTap = 0, int value = 0);
|
AAWhatsMax(int id, MTGCardInstance * card, MTGCardInstance * source, ManaCost * _cost = NULL, int value = 0);
|
||||||
int resolve();
|
int resolve();
|
||||||
AAWhatsMax * clone() const;
|
AAWhatsMax * clone() const;
|
||||||
};
|
};
|
||||||
@@ -3350,7 +3348,7 @@ public:
|
|||||||
class AAFrozen: public ActivatedAbility
|
class AAFrozen: public ActivatedAbility
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AAFrozen(int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL, int doTap = 0);
|
AAFrozen(int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
AAFrozen * clone() const;
|
AAFrozen * clone() const;
|
||||||
@@ -3360,7 +3358,7 @@ class AANewTarget: public ActivatedAbility
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool retarget;
|
bool retarget;
|
||||||
AANewTarget(int id, MTGCardInstance * card, MTGCardInstance * _target,bool retarget = false, ManaCost * _cost = NULL, int doTap = 0);
|
AANewTarget(int id, MTGCardInstance * card, MTGCardInstance * _target,bool retarget = false, ManaCost * _cost = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
AANewTarget * clone() const;
|
AANewTarget * clone() const;
|
||||||
@@ -3370,7 +3368,7 @@ class AAMorph: public ActivatedAbility
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
vector<MTGAbility *> currentAbilities;
|
vector<MTGAbility *> currentAbilities;
|
||||||
AAMorph(int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL, int doTap = 0);
|
AAMorph(int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
int testDestroy();
|
int testDestroy();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
@@ -3433,7 +3431,7 @@ MTGAbility * storedAbility;
|
|||||||
MTGAbility * clonedStored;
|
MTGAbility * clonedStored;
|
||||||
string menu;
|
string menu;
|
||||||
|
|
||||||
AADynamic(int id, MTGCardInstance * card, Damageable * _target,int type = 0,int effect = 0,int who = 0,int amountsource = 1,MTGAbility * storedAbility = NULL, ManaCost * _cost = NULL, int doTap = 0);
|
AADynamic(int id, MTGCardInstance * card, Damageable * _target,int type = 0,int effect = 0,int who = 0,int amountsource = 1,MTGAbility * storedAbility = NULL, ManaCost * _cost = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
int activateStored();
|
int activateStored();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
@@ -3890,7 +3888,7 @@ public:
|
|||||||
string counterName;
|
string counterName;
|
||||||
int next;
|
int next;
|
||||||
|
|
||||||
AVanishing(int _id, MTGCardInstance * card, ManaCost * _cost, int _tap = 0, int restrictions = 0,int amount = 0,string counterName = "");
|
AVanishing(int _id, MTGCardInstance * card, ManaCost * _cost, int restrictions = 0,int amount = 0,string counterName = "");
|
||||||
void Update(float dt);
|
void Update(float dt);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
@@ -3908,7 +3906,7 @@ public:
|
|||||||
bool Cumulative;
|
bool Cumulative;
|
||||||
int currentage;
|
int currentage;
|
||||||
|
|
||||||
AUpkeep(int _id, MTGCardInstance * card, MTGAbility * a, ManaCost * _cost, int _tap = 0, int restrictions = 0, int _phase =
|
AUpkeep(int _id, MTGCardInstance * card, MTGAbility * a, ManaCost * _cost, int restrictions = 0, int _phase =
|
||||||
Constants::MTG_PHASE_UPKEEP, int _once = 0,bool Cumulative = false);
|
Constants::MTG_PHASE_UPKEEP, int _once = 0,bool Cumulative = false);
|
||||||
int receiveEvent(WEvent * event);
|
int receiveEvent(WEvent * event);
|
||||||
void Update(float dt);
|
void Update(float dt);
|
||||||
@@ -3935,7 +3933,7 @@ public:
|
|||||||
bool opponentturn;
|
bool opponentturn;
|
||||||
Player * abilityOwner;
|
Player * abilityOwner;
|
||||||
|
|
||||||
APhaseAction(int _id, MTGCardInstance * card, MTGCardInstance * target, string sAbility, int _tap = 0, int restrictions = 0, int _phase =
|
APhaseAction(int _id, MTGCardInstance * card, MTGCardInstance * target, string sAbility, int restrictions = 0, int _phase =
|
||||||
Constants::MTG_PHASE_UPKEEP,bool forcedestroy = false,bool next = true,bool myturn = true,bool opponentturn = true);
|
Constants::MTG_PHASE_UPKEEP,bool forcedestroy = false,bool next = true,bool myturn = true,bool opponentturn = true);
|
||||||
void Update(float dt);
|
void Update(float dt);
|
||||||
int resolve();
|
int resolve();
|
||||||
@@ -3950,7 +3948,7 @@ class APhaseActionGeneric: public InstantAbility
|
|||||||
public:
|
public:
|
||||||
string sAbility;
|
string sAbility;
|
||||||
APhaseAction * ability;
|
APhaseAction * ability;
|
||||||
APhaseActionGeneric(int _id, MTGCardInstance * card, MTGCardInstance * target, string sAbility, int _tap = 0, int restrictions = 0, int _phase =
|
APhaseActionGeneric(int _id, MTGCardInstance * card, MTGCardInstance * target, string sAbility, int restrictions = 0, int _phase =
|
||||||
Constants::MTG_PHASE_UPKEEP,bool forcedestroy = false,bool next = true,bool myturn = false,bool opponentturn = false);
|
Constants::MTG_PHASE_UPKEEP,bool forcedestroy = false,bool next = true,bool myturn = false,bool opponentturn = false);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
@@ -4251,7 +4249,7 @@ class AFarmstead: public ActivatedAbility
|
|||||||
public:
|
public:
|
||||||
int usedThisTurn;
|
int usedThisTurn;
|
||||||
AFarmstead(int _id, MTGCardInstance * source, MTGCardInstance * _target) :
|
AFarmstead(int _id, MTGCardInstance * source, MTGCardInstance * _target) :
|
||||||
ActivatedAbility(_id, source, 0, 1, 0)
|
ActivatedAbility(_id, source, 0, 1)
|
||||||
{
|
{
|
||||||
int _cost[] = { Constants::MTG_COLOR_WHITE, 2 };
|
int _cost[] = { Constants::MTG_COLOR_WHITE, 2 };
|
||||||
cost = NEW ManaCost(_cost, 1);
|
cost = NEW ManaCost(_cost, 1);
|
||||||
@@ -4880,7 +4878,7 @@ class AStasis: public ActivatedAbility
|
|||||||
public:
|
public:
|
||||||
int paidThisTurn;
|
int paidThisTurn;
|
||||||
AStasis(int _id, MTGCardInstance * card) :
|
AStasis(int _id, MTGCardInstance * card) :
|
||||||
ActivatedAbility(_id, card, NEW ManaCost(), 1, 0)
|
ActivatedAbility(_id, card, NEW ManaCost(), 0)
|
||||||
{
|
{
|
||||||
paidThisTurn = 1;
|
paidThisTurn = 1;
|
||||||
cost->add(Constants::MTG_COLOR_BLUE, 1);
|
cost->add(Constants::MTG_COLOR_BLUE, 1);
|
||||||
@@ -5003,7 +5001,7 @@ class AADepleter: public ActivatedAbilityTP
|
|||||||
public:
|
public:
|
||||||
string nbcardsStr;
|
string nbcardsStr;
|
||||||
|
|
||||||
AADepleter(int _id, MTGCardInstance * card, Targetable * _target,string nbcardsStr, ManaCost * _cost = NULL, int _tap = 0,
|
AADepleter(int _id, MTGCardInstance * card, Targetable * _target,string nbcardsStr, ManaCost * _cost = NULL,
|
||||||
int who = TargetChooser::UNSET);
|
int who = TargetChooser::UNSET);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
@@ -5014,7 +5012,7 @@ public:
|
|||||||
class AAShuffle: public ActivatedAbilityTP
|
class AAShuffle: public ActivatedAbilityTP
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AAShuffle(int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost = NULL, int _tap = 0, int who =
|
AAShuffle(int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost = NULL, int who =
|
||||||
TargetChooser::UNSET);
|
TargetChooser::UNSET);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
@@ -5029,7 +5027,7 @@ public:
|
|||||||
string nbcardsStr;
|
string nbcardsStr;
|
||||||
|
|
||||||
AARandomDiscarder(int _id, MTGCardInstance * card, Targetable * _target,string nbcardsStr, ManaCost * _cost = NULL,
|
AARandomDiscarder(int _id, MTGCardInstance * card, Targetable * _target,string nbcardsStr, ManaCost * _cost = NULL,
|
||||||
int _tap = 0, int who = TargetChooser::UNSET);
|
int who = TargetChooser::UNSET);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
AARandomDiscarder * clone() const;
|
AARandomDiscarder * clone() const;
|
||||||
@@ -5041,7 +5039,7 @@ class AMinionofLeshrac: public TargetAbility
|
|||||||
public:
|
public:
|
||||||
int paidThisTurn;
|
int paidThisTurn;
|
||||||
AMinionofLeshrac(int _id, MTGCardInstance * source) :
|
AMinionofLeshrac(int _id, MTGCardInstance * source) :
|
||||||
TargetAbility(_id, source, NEW TypeTargetChooser("creature"), 0, 1, 0)
|
TargetAbility(_id, source, NEW TypeTargetChooser("creature"), 0, 1)
|
||||||
{
|
{
|
||||||
paidThisTurn = 1;
|
paidThisTurn = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ class MTGAbility: public ActionElement{
|
|||||||
STANDARD_TOKENCREATOR = 27,
|
STANDARD_TOKENCREATOR = 27,
|
||||||
MORPH_COST = 28,
|
MORPH_COST = 28,
|
||||||
SUSPEND_COST = 29,
|
SUSPEND_COST = 29,
|
||||||
|
COUNTERS = 30,
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -261,7 +262,7 @@ class ActivatedAbility:public MTGAbility{
|
|||||||
MTGAbility * sa;
|
MTGAbility * sa;
|
||||||
string usesBeforeSideEffects;
|
string usesBeforeSideEffects;
|
||||||
int uses;
|
int uses;
|
||||||
ActivatedAbility(int id, MTGCardInstance * card,ManaCost * _cost = NULL, int _restrictions = NO_RESTRICTION,int tap = 1,string limit = "",MTGAbility * sideEffect = NULL,string usesBeforeSideEffects = "");
|
ActivatedAbility(int id, MTGCardInstance * card,ManaCost * _cost = NULL, int _restrictions = NO_RESTRICTION,string limit = "",MTGAbility * sideEffect = NULL,string usesBeforeSideEffects = "");
|
||||||
virtual ~ActivatedAbility();
|
virtual ~ActivatedAbility();
|
||||||
virtual void Update(float dt)
|
virtual void Update(float dt)
|
||||||
{
|
{
|
||||||
@@ -283,8 +284,8 @@ class ActivatedAbility:public MTGAbility{
|
|||||||
|
|
||||||
class TargetAbility:public ActivatedAbility, public NestedAbility{
|
class TargetAbility:public ActivatedAbility, public NestedAbility{
|
||||||
public:
|
public:
|
||||||
TargetAbility(int id, MTGCardInstance * card, TargetChooser * _tc,ManaCost * _cost = NULL, int _playerturnonly = 0,int tap = 1);
|
TargetAbility(int id, MTGCardInstance * card, TargetChooser * _tc,ManaCost * _cost = NULL, int _playerturnonly = 0);
|
||||||
TargetAbility(int id, MTGCardInstance * card,ManaCost * _cost = NULL, int _playerturnonly = 0,int tap = 1);
|
TargetAbility(int id, MTGCardInstance * card,ManaCost * _cost = NULL, int _playerturnonly = 0);
|
||||||
virtual int reactToClick(MTGCardInstance * card);
|
virtual int reactToClick(MTGCardInstance * card);
|
||||||
virtual int reactToTargetClick(Targetable * object);
|
virtual int reactToTargetClick(Targetable * object);
|
||||||
virtual TargetAbility* clone() const = 0;
|
virtual TargetAbility* clone() const = 0;
|
||||||
@@ -408,7 +409,7 @@ public:
|
|||||||
class ActivatedAbilityTP:public ActivatedAbility{
|
class ActivatedAbilityTP:public ActivatedAbility{
|
||||||
public:
|
public:
|
||||||
int who;
|
int who;
|
||||||
ActivatedAbilityTP(int id, MTGCardInstance * card, Targetable * _target = NULL, ManaCost * cost=NULL, int doTap = 0, int who = TargetChooser::UNSET);
|
ActivatedAbilityTP(int id, MTGCardInstance * card, Targetable * _target = NULL, ManaCost * cost=NULL, int who = TargetChooser::UNSET);
|
||||||
Targetable * getTarget();
|
Targetable * getTarget();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -437,7 +438,7 @@ class AManaProducer: public ActivatedAbilityTP{
|
|||||||
string menutext;
|
string menutext;
|
||||||
ManaCost * output;
|
ManaCost * output;
|
||||||
int tap;
|
int tap;
|
||||||
AManaProducer(int id, MTGCardInstance * card, Targetable * t, ManaCost * _output, ManaCost * _cost = NULL, int doTap = 0, int who = TargetChooser::UNSET );
|
AManaProducer(int id, MTGCardInstance * card, Targetable * t, ManaCost * _output, ManaCost * _cost = NULL, int who = TargetChooser::UNSET );
|
||||||
int isReactingToClick(MTGCardInstance * _card, ManaCost * mana = NULL);
|
int isReactingToClick(MTGCardInstance * _card, ManaCost * mana = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
int reactToClick(MTGCardInstance * _card);
|
int reactToClick(MTGCardInstance * _card);
|
||||||
|
|||||||
+119
-92
@@ -216,8 +216,7 @@ int AIPlayer::canHandleCost(MTGAbility * ability)
|
|||||||
// I can't remember as I type this in which condition we use one or the other for this function, if you find out please replace this comment
|
// I can't remember as I type this in which condition we use one or the other for this function, if you find out please replace this comment
|
||||||
int AIAction::getEfficiency()
|
int AIAction::getEfficiency()
|
||||||
{
|
{
|
||||||
//TODO add multiplier according to what the player wants
|
if (efficiency > -1)
|
||||||
if (efficiency != -1)
|
|
||||||
return efficiency;
|
return efficiency;
|
||||||
if (!ability)
|
if (!ability)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -282,91 +281,90 @@ int AIAction::getEfficiency()
|
|||||||
{
|
{
|
||||||
efficiency = 95;
|
efficiency = 95;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO If the card is the target of a damage spell
|
//TODO If the card is the target of a damage spell
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MTGAbility::STANDARD_PREVENT:
|
case MTGAbility::STANDARD_PREVENT:
|
||||||
{
|
|
||||||
efficiency = 0;//starts out low to avoid spamming it when its not needed.
|
|
||||||
if (!target && !dynamic_cast<ALord*> (a))
|
|
||||||
break;
|
|
||||||
if(dynamic_cast<ALord*> (a) && !target)
|
|
||||||
{
|
{
|
||||||
//this is a special case for all(this) targetting workaround.
|
efficiency = 0;//starts out low to avoid spamming it when its not needed.
|
||||||
//adding a direct method for targetting the source is planned for
|
if (!target && !dynamic_cast<ALord*> (a))
|
||||||
//the coming releases, all(this) workaround prevents eff from being returned
|
break;
|
||||||
//as its not targetted the same as abilities
|
if(dynamic_cast<ALord*> (a) && !target)
|
||||||
//for now this dirty hack will calculate eff on lords as tho the source is
|
|
||||||
//the target...otherwise these abilities will never be used.
|
|
||||||
target = a->source;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool NeedPreventing;
|
|
||||||
NeedPreventing = false;
|
|
||||||
if (g->getCurrentGamePhase() == Constants::MTG_PHASE_COMBATBLOCKERS)
|
|
||||||
{
|
|
||||||
if ((target->defenser || target->blockers.size()) && target->preventable < target->getNextOpponent()->power)
|
|
||||||
NeedPreventing = true;
|
|
||||||
if (p == target->controller() && target->controller()->isAI() && NeedPreventing && !(target->getNextOpponent()->has(Constants::DEATHTOUCH)
|
|
||||||
|| target->getNextOpponent()->has(Constants::WITHER)))
|
|
||||||
{
|
{
|
||||||
efficiency = 20 * (target->DangerRanking());//increase this chance to be used in combat if the creature blocking/blocked could kill the creature this chance is taking into consideration how good the creature is, best creature will always be the first "saved"..
|
//this is a special case for all(this) targetting workaround.
|
||||||
if (target->toughness == 1 && target->getNextOpponent()->power == 1)
|
//adding a direct method for targetting the source is planned for
|
||||||
efficiency += 15;
|
//the coming releases, all(this) workaround prevents eff from being returned
|
||||||
//small bonus added for the poor 1/1s, if we can save them, we will unless something else took precidence.
|
//as its not targetted the same as abilities
|
||||||
//note is the target is being blocked or blocking a creature with wither or deathtouch, it is not even considered for preventing as it is a waste.
|
//for now this dirty hack will calculate eff on lords as tho the source is
|
||||||
//if its combat blockers, it is being blocked or blocking, and has less prevents the the amount of damage it will be taking, the effeincy is increased slightly and totalled by the danger rank multiplier for final result.
|
//the target...otherwise these abilities will never be used.
|
||||||
int calculateAfterDamage = 0;
|
target = a->source;
|
||||||
int damages = 0;
|
}
|
||||||
if((target->defenser || target->blockers.size()) && target->controller()->isAI())
|
|
||||||
|
bool NeedPreventing;
|
||||||
|
NeedPreventing = false;
|
||||||
|
if (g->getCurrentGamePhase() == Constants::MTG_PHASE_COMBATBLOCKERS)
|
||||||
|
{
|
||||||
|
if ((target->defenser || target->blockers.size()) && target->preventable < target->getNextOpponent()->power)
|
||||||
|
NeedPreventing = true;
|
||||||
|
if (p == target->controller() && target->controller()->isAI() && NeedPreventing && !(target->getNextOpponent()->has(Constants::DEATHTOUCH)
|
||||||
|
|| target->getNextOpponent()->has(Constants::WITHER)))
|
||||||
{
|
{
|
||||||
damages = target->getNextOpponent()->power;
|
efficiency = 20 * (target->DangerRanking());//increase this chance to be used in combat if the creature blocking/blocked could kill the creature this chance is taking into consideration how good the creature is, best creature will always be the first "saved"..
|
||||||
calculateAfterDamage = int(target->toughness - damages);
|
if (target->toughness == 1 && target->getNextOpponent()->power == 1)
|
||||||
if((calculateAfterDamage + target->preventable) > 0)
|
efficiency += 15;
|
||||||
|
//small bonus added for the poor 1/1s, if we can save them, we will unless something else took precidence.
|
||||||
|
//note is the target is being blocked or blocking a creature with wither or deathtouch, it is not even considered for preventing as it is a waste.
|
||||||
|
//if its combat blockers, it is being blocked or blocking, and has less prevents the the amount of damage it will be taking, the effeincy is increased slightly and totalled by the danger rank multiplier for final result.
|
||||||
|
int calculateAfterDamage = 0;
|
||||||
|
int damages = 0;
|
||||||
|
if((target->defenser || target->blockers.size()) && target->controller()->isAI())
|
||||||
{
|
{
|
||||||
efficiency = 0;
|
damages = target->getNextOpponent()->power;
|
||||||
//this is to avoid wasting prevents on creatures that will already survive.
|
calculateAfterDamage = int(target->toughness - damages);
|
||||||
//this should take into account bushido and flanking as this check is run after every trigger.
|
if((calculateAfterDamage + target->preventable) > 0)
|
||||||
|
{
|
||||||
|
efficiency = 0;
|
||||||
|
//this is to avoid wasting prevents on creatures that will already survive.
|
||||||
|
//this should take into account bushido and flanking as this check is run after every trigger.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
//TODO If the card is the target of a damage spell
|
||||||
//TODO If the card is the target of a damage spell
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case MTGAbility::STANDARD_EQUIP:
|
|
||||||
{
|
|
||||||
|
|
||||||
efficiency = 0;
|
|
||||||
if (!target)
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
int equips = p->game->battlefield->countByType("Equipment");
|
|
||||||
int myArmy = p->game->battlefield->countByType("Creature");
|
|
||||||
// when can this ever be negative?
|
|
||||||
int equilized = myArmy ? abs(equips / myArmy) : 0;
|
|
||||||
|
|
||||||
if (p == target->controller() && target->equipment <= 1 && !a->source->target)
|
|
||||||
{
|
|
||||||
efficiency = 20 * (target->DangerRanking());
|
|
||||||
if (target->hasColor(Constants::MTG_COLOR_WHITE))
|
|
||||||
efficiency += 20;//this is to encourage Ai to equip white creatures in a weenie deck. ultimately it will depend on what had the higher dangerranking.
|
|
||||||
if (target->power == 1 && target->toughness == 1 && target->isToken == 0)
|
|
||||||
efficiency += 10; //small bonus to encourage equipping nontoken 1/1 creatures.
|
|
||||||
}
|
}
|
||||||
|
case MTGAbility::STANDARD_EQUIP:
|
||||||
if (p == target->controller() && !a->source->target && target->equipment < equilized)
|
|
||||||
{
|
{
|
||||||
efficiency = 15 * (target->DangerRanking());
|
|
||||||
efficiency -= 5 * (target->equipment);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
efficiency = 0;
|
||||||
|
if (!target)
|
||||||
|
break;
|
||||||
|
|
||||||
|
int equips = p->game->battlefield->countByType("Equipment");
|
||||||
|
int myArmy = p->game->battlefield->countByType("Creature");
|
||||||
|
// when can this ever be negative?
|
||||||
|
int equilized = myArmy ? abs(equips / myArmy) : 0;
|
||||||
|
|
||||||
|
if (p == target->controller() && target->equipment <= 1 && !a->source->target)
|
||||||
|
{
|
||||||
|
efficiency = 20 * (target->DangerRanking());
|
||||||
|
if (target->hasColor(Constants::MTG_COLOR_WHITE))
|
||||||
|
efficiency += 20;//this is to encourage Ai to equip white creatures in a weenie deck. ultimately it will depend on what had the higher dangerranking.
|
||||||
|
if (target->power == 1 && target->toughness == 1 && target->isToken == 0)
|
||||||
|
efficiency += 10; //small bonus to encourage equipping nontoken 1/1 creatures.
|
||||||
|
}
|
||||||
|
|
||||||
|
if (p == target->controller() && !a->source->target && target->equipment < equilized)
|
||||||
|
{
|
||||||
|
efficiency = 15 * (target->DangerRanking());
|
||||||
|
efficiency -= 5 * (target->equipment);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case MTGAbility::STANDARD_LEVELUP:
|
case MTGAbility::STANDARD_LEVELUP:
|
||||||
|
case MTGAbility::COUNTERS:
|
||||||
{
|
{
|
||||||
MTGCardInstance * _target = (MTGCardInstance *) (a->target);
|
MTGCardInstance * _target = (MTGCardInstance *) target;
|
||||||
efficiency = 0;
|
efficiency = 0;
|
||||||
Counter * targetCounter = NULL;
|
Counter * targetCounter = NULL;
|
||||||
int currentlevel = 0;
|
int currentlevel = 0;
|
||||||
@@ -379,27 +377,47 @@ int AIAction::getEfficiency()
|
|||||||
currentlevel = targetCounter->nb;
|
currentlevel = targetCounter->nb;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(AACounter * cc = dynamic_cast<AACounter*> (a))
|
||||||
|
{
|
||||||
|
if(cc && !targetCounter)
|
||||||
|
{
|
||||||
|
if(_target && _target->controller()->isAI() && cc->toughness>=0)
|
||||||
|
{
|
||||||
|
efficiency = 90;
|
||||||
|
|
||||||
if (currentlevel < _target->MaxLevelUp)
|
}
|
||||||
{
|
if(_target && !_target->controller()->isAI() && ((_target->toughness + cc->toughness <= 0 && _target->toughness) || (cc->toughness < 0 && cc->power < 0)))
|
||||||
efficiency = 85;
|
{
|
||||||
//increase the efficeincy of leveling up by a small amount equal to current level.
|
efficiency = 90;
|
||||||
efficiency += currentlevel;
|
|
||||||
|
|
||||||
if (p->game->hand->nb_cards > 0 && p->isAI())
|
}
|
||||||
{
|
if(_target && _target->counters && _target->counters->counters && _target->counters->hasCounter(cc->power,cc->toughness) && _target->counters->hasCounter(cc->power,cc->toughness)->nb > 15)
|
||||||
efficiency -= (10 * p->game->hand->nb_cards);//reduce the eff if by 10 times the amount of cards in Ais hand.
|
{
|
||||||
//it should always try playing more cards before deciding
|
efficiency = _target->counters->hasCounter(cc->power,cc->toughness)->nb;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (currentlevel < _target->MaxLevelUp)
|
||||||
|
{
|
||||||
|
efficiency = 85;
|
||||||
|
//increase the efficeincy of leveling up by a small amount equal to current level.
|
||||||
|
efficiency += currentlevel;
|
||||||
|
|
||||||
if (g->getCurrentGamePhase() == Constants::MTG_PHASE_SECONDMAIN)
|
if (p->game->hand->nb_cards > 0 && p->isAI())
|
||||||
{
|
{
|
||||||
efficiency = 100;
|
efficiency -= (10 * p->game->hand->nb_cards);//reduce the eff if by 10 times the amount of cards in Ais hand.
|
||||||
//in 2nd main, go all out and try to max stuff.
|
//it should always try playing more cards before deciding
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
if (g->getCurrentGamePhase() == Constants::MTG_PHASE_SECONDMAIN)
|
||||||
}
|
{
|
||||||
|
efficiency = 100;
|
||||||
|
//in 2nd main, go all out and try to max stuff.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case MTGAbility::STANDARD_PUMP:
|
case MTGAbility::STANDARD_PUMP:
|
||||||
{
|
{
|
||||||
MTGCardInstance * _target = (MTGCardInstance *) (a->target);
|
MTGCardInstance * _target = (MTGCardInstance *) (a->target);
|
||||||
@@ -416,7 +434,6 @@ int AIAction::getEfficiency()
|
|||||||
{
|
{
|
||||||
target = a->source;
|
target = a->source;
|
||||||
}
|
}
|
||||||
|
|
||||||
AbilityFactory af;
|
AbilityFactory af;
|
||||||
int suggestion = af.abilityEfficiency(a, p, MODE_ABILITY);
|
int suggestion = af.abilityEfficiency(a, p, MODE_ABILITY);
|
||||||
//i do not set a starting eff. on this ability, this allows Ai to sometimes randomly do it as it normally does.
|
//i do not set a starting eff. on this ability, this allows Ai to sometimes randomly do it as it normally does.
|
||||||
@@ -440,7 +457,7 @@ int AIAction::getEfficiency()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (suggestion == BAKA_EFFECT_BAD && !target->controller()->isAI())
|
if (suggestion == BAKA_EFFECT_BAD && !target->controller()->isAI() && target->toughness > 0)
|
||||||
{
|
{
|
||||||
efficiency = 100;
|
efficiency = 100;
|
||||||
}
|
}
|
||||||
@@ -532,7 +549,7 @@ int AIAction::getEfficiency()
|
|||||||
int efficiencyModifier = (25 * target->DangerRanking());
|
int efficiencyModifier = (25 * target->DangerRanking());
|
||||||
if (p->game->hand->nb_cards > 1)
|
if (p->game->hand->nb_cards > 1)
|
||||||
{
|
{
|
||||||
efficiencyModifier /= p->game->hand->nb_cards;
|
efficiencyModifier -= p->game->hand->nb_cards*3;
|
||||||
}
|
}
|
||||||
if (suggestion == BAKA_EFFECT_BAD && p != target->controller() && target->has(a->abilitygranted) && p->isAI())
|
if (suggestion == BAKA_EFFECT_BAD && p != target->controller() && target->has(a->abilitygranted) && p->isAI())
|
||||||
{
|
{
|
||||||
@@ -677,7 +694,17 @@ int AIAction::getEfficiency()
|
|||||||
{
|
{
|
||||||
ExtraCosts * ec = ability->cost->extraCosts;
|
ExtraCosts * ec = ability->cost->extraCosts;
|
||||||
if (ec)
|
if (ec)
|
||||||
efficiency = efficiency / 3; //Decrease chance of using ability if there is an extra cost to use the ability
|
{
|
||||||
|
for(unsigned int i = 0; i < ec->costs.size();i++)
|
||||||
|
{
|
||||||
|
ExtraCost * tapper = dynamic_cast<TapCost*>(ec->costs[i]);
|
||||||
|
if(tapper)
|
||||||
|
continue;
|
||||||
|
else
|
||||||
|
efficiency = efficiency / 2;
|
||||||
|
}
|
||||||
|
//Decrease chance of using ability if there is an extra cost to use the ability, ignore tap
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return efficiency;
|
return efficiency;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
//Activated Abilities
|
//Activated Abilities
|
||||||
|
|
||||||
//Generic Activated Abilities
|
//Generic Activated Abilities
|
||||||
GenericActivatedAbility::GenericActivatedAbility(string newName,int _id, MTGCardInstance * card, MTGAbility * a, ManaCost * _cost, int _tap,
|
GenericActivatedAbility::GenericActivatedAbility(string newName,int _id, MTGCardInstance * card, MTGAbility * a, ManaCost * _cost,
|
||||||
string limit,MTGAbility * sideEffects,string usesBeforeSideEffects, int restrictions, MTGGameZone * dest) :
|
string limit,MTGAbility * sideEffects,string usesBeforeSideEffects, int restrictions, MTGGameZone * dest) :
|
||||||
ActivatedAbility(_id, card, _cost, restrictions, _tap,limit,sideEffects,usesBeforeSideEffects), NestedAbility(a), activeZone(dest),newName(newName)
|
ActivatedAbility(_id, card, _cost, restrictions,limit,sideEffects,usesBeforeSideEffects), NestedAbility(a), activeZone(dest),newName(newName)
|
||||||
{
|
{
|
||||||
counters = 0;
|
counters = 0;
|
||||||
target = ability->target;
|
target = ability->target;
|
||||||
@@ -71,9 +71,9 @@ GenericActivatedAbility::~GenericActivatedAbility()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//AA Alter Poison
|
//AA Alter Poison
|
||||||
AAAlterPoison::AAAlterPoison(int _id, MTGCardInstance * _source, Targetable * _target, int poison, ManaCost * _cost, int doTap,
|
AAAlterPoison::AAAlterPoison(int _id, MTGCardInstance * _source, Targetable * _target, int poison, ManaCost * _cost,
|
||||||
int who) :
|
int who) :
|
||||||
ActivatedAbilityTP(_id, _source, _target, _cost, doTap, who), poison(poison)
|
ActivatedAbilityTP(_id, _source, _target, _cost, who), poison(poison)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,8 +105,8 @@ AAAlterPoison::~AAAlterPoison()
|
|||||||
|
|
||||||
//Damage Prevent
|
//Damage Prevent
|
||||||
AADamagePrevent::AADamagePrevent(int _id, MTGCardInstance * _source, Targetable * _target, int preventing, ManaCost * _cost,
|
AADamagePrevent::AADamagePrevent(int _id, MTGCardInstance * _source, Targetable * _target, int preventing, ManaCost * _cost,
|
||||||
int doTap, int who) :
|
int who) :
|
||||||
ActivatedAbilityTP(_id, _source, _target, _cost, doTap, who), preventing(preventing)
|
ActivatedAbilityTP(_id, _source, _target, _cost, who), preventing(preventing)
|
||||||
{
|
{
|
||||||
aType = MTGAbility::STANDARD_PREVENT;
|
aType = MTGAbility::STANDARD_PREVENT;
|
||||||
}
|
}
|
||||||
@@ -138,9 +138,9 @@ AADamagePrevent::~AADamagePrevent()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//AADamager
|
//AADamager
|
||||||
AADamager::AADamager(int _id, MTGCardInstance * _source, Targetable * _target, string d, ManaCost * _cost, int doTap,
|
AADamager::AADamager(int _id, MTGCardInstance * _source, Targetable * _target, string d, ManaCost * _cost,
|
||||||
int who) :
|
int who) :
|
||||||
ActivatedAbilityTP(_id, _source, _target, _cost, doTap, who), d(d)
|
ActivatedAbilityTP(_id, _source, _target, _cost, who), d(d)
|
||||||
{
|
{
|
||||||
aType = MTGAbility::DAMAGER;
|
aType = MTGAbility::DAMAGER;
|
||||||
}
|
}
|
||||||
@@ -178,8 +178,8 @@ AADamager * AADamager::clone() const
|
|||||||
|
|
||||||
|
|
||||||
//AADepleter
|
//AADepleter
|
||||||
AADepleter::AADepleter(int _id, MTGCardInstance * card, Targetable * _target,string nbcardsStr, ManaCost * _cost, int _tap, int who) :
|
AADepleter::AADepleter(int _id, MTGCardInstance * card, Targetable * _target,string nbcardsStr, ManaCost * _cost, int who) :
|
||||||
ActivatedAbilityTP(_id, card, _target, _cost, _tap, who),nbcardsStr(nbcardsStr)
|
ActivatedAbilityTP(_id, card, _target, _cost, who),nbcardsStr(nbcardsStr)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -223,7 +223,7 @@ AADepleter * AADepleter::clone() const
|
|||||||
|
|
||||||
//AACopier
|
//AACopier
|
||||||
AACopier::AACopier(int _id, MTGCardInstance * _source, MTGCardInstance * _target, ManaCost * _cost) :
|
AACopier::AACopier(int _id, MTGCardInstance * _source, MTGCardInstance * _target, ManaCost * _cost) :
|
||||||
ActivatedAbility(_id, _source, _cost, 0, 0)
|
ActivatedAbility(_id, _source, _cost, 0)
|
||||||
{
|
{
|
||||||
target = _target;
|
target = _target;
|
||||||
}
|
}
|
||||||
@@ -253,7 +253,7 @@ AACopier * AACopier::clone() const
|
|||||||
|
|
||||||
//phaser
|
//phaser
|
||||||
AAPhaseOut::AAPhaseOut(int _id, MTGCardInstance * _source, MTGCardInstance * _target, ManaCost * _cost) :
|
AAPhaseOut::AAPhaseOut(int _id, MTGCardInstance * _source, MTGCardInstance * _target, ManaCost * _cost) :
|
||||||
ActivatedAbility(_id, _source, _cost, 0, 0)
|
ActivatedAbility(_id, _source, _cost, 0)
|
||||||
{
|
{
|
||||||
target = _target;
|
target = _target;
|
||||||
}
|
}
|
||||||
@@ -288,12 +288,15 @@ AAPhaseOut * AAPhaseOut::clone() const
|
|||||||
|
|
||||||
//Counters
|
//Counters
|
||||||
AACounter::AACounter(int id, MTGCardInstance * source, MTGCardInstance * target,string counterstring, const char * _name, int power, int toughness,
|
AACounter::AACounter(int id, MTGCardInstance * source, MTGCardInstance * target,string counterstring, const char * _name, int power, int toughness,
|
||||||
int nb,int maxNb, ManaCost * cost, int doTap) :
|
int nb,int maxNb, ManaCost * cost) :
|
||||||
ActivatedAbility(id, source, cost, 0, doTap),counterstring(counterstring), nb(nb),maxNb(maxNb), power(power), toughness(toughness), name(_name)
|
ActivatedAbility(id, source, cost, 0),counterstring(counterstring), nb(nb),maxNb(maxNb), power(power), toughness(toughness), name(_name)
|
||||||
{
|
{
|
||||||
this->target = target;
|
this->target = target;
|
||||||
if (name.find("Level"))
|
if (name.find("Level"))
|
||||||
aType = MTGAbility::STANDARD_LEVELUP;
|
aType = MTGAbility::STANDARD_LEVELUP;
|
||||||
|
else
|
||||||
|
aType = MTGAbility::COUNTERS;
|
||||||
|
|
||||||
menu = "";
|
menu = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -381,8 +384,8 @@ AACounter * AACounter::clone() const
|
|||||||
|
|
||||||
//Counters
|
//Counters
|
||||||
AARemoveAllCounter::AARemoveAllCounter(int id, MTGCardInstance * source, MTGCardInstance * target, const char * _name, int power, int toughness,
|
AARemoveAllCounter::AARemoveAllCounter(int id, MTGCardInstance * source, MTGCardInstance * target, const char * _name, int power, int toughness,
|
||||||
int nb,bool all, ManaCost * cost, int doTap) :
|
int nb,bool all, ManaCost * cost) :
|
||||||
ActivatedAbility(id, source, cost, 0, doTap), nb(nb), power(power), toughness(toughness), name(_name),all(all)
|
ActivatedAbility(id, source, cost, 0), nb(nb), power(power), toughness(toughness), name(_name),all(all)
|
||||||
{
|
{
|
||||||
this->target = target;
|
this->target = target;
|
||||||
menu = "";
|
menu = "";
|
||||||
@@ -462,8 +465,8 @@ AARemoveAllCounter * AARemoveAllCounter::clone() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fizzler
|
// Fizzler
|
||||||
AAFizzler::AAFizzler(int _id, MTGCardInstance * card, Spell * _target, ManaCost * _cost, int _tap) :
|
AAFizzler::AAFizzler(int _id, MTGCardInstance * card, Spell * _target, ManaCost * _cost) :
|
||||||
ActivatedAbility(_id, card, _cost, 0, _tap)
|
ActivatedAbility(_id, card, _cost, 0)
|
||||||
{
|
{
|
||||||
target = _target;
|
target = _target;
|
||||||
}
|
}
|
||||||
@@ -650,9 +653,9 @@ AADiscardCard * AADiscardCard::clone() const
|
|||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
AADrawer::AADrawer(int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost, string nbcardsStr, int _tap,
|
AADrawer::AADrawer(int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost, string nbcardsStr,
|
||||||
int who) :
|
int who) :
|
||||||
ActivatedAbilityTP(_id, card, _target, _cost, _tap, who), nbcardsStr(nbcardsStr)
|
ActivatedAbilityTP(_id, card, _target, _cost, who), nbcardsStr(nbcardsStr)
|
||||||
{
|
{
|
||||||
aType = MTGAbility::STANDARD_DRAW;
|
aType = MTGAbility::STANDARD_DRAW;
|
||||||
}
|
}
|
||||||
@@ -697,8 +700,8 @@ AADrawer * AADrawer::clone() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// AAFrozen: Prevent a card from untapping during next untap phase
|
// AAFrozen: Prevent a card from untapping during next untap phase
|
||||||
AAFrozen::AAFrozen(int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost, int doTap) :
|
AAFrozen::AAFrozen(int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost) :
|
||||||
ActivatedAbility(id, card, _cost, 0, doTap)
|
ActivatedAbility(id, card, _cost, 0)
|
||||||
{
|
{
|
||||||
target = _target;
|
target = _target;
|
||||||
}
|
}
|
||||||
@@ -728,8 +731,8 @@ AAFrozen * AAFrozen::clone() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// chose a new target for an aura or enchantment and equip it note: VERY basic right now.
|
// chose a new target for an aura or enchantment and equip it note: VERY basic right now.
|
||||||
AANewTarget::AANewTarget(int id, MTGCardInstance * card, MTGCardInstance * _target,bool retarget, ManaCost * _cost, int doTap) :
|
AANewTarget::AANewTarget(int id, MTGCardInstance * card, MTGCardInstance * _target,bool retarget, ManaCost * _cost) :
|
||||||
ActivatedAbility(id, card, _cost, 0, doTap),retarget(retarget)
|
ActivatedAbility(id, card, _cost, 0),retarget(retarget)
|
||||||
{
|
{
|
||||||
target = _target;
|
target = _target;
|
||||||
}
|
}
|
||||||
@@ -796,8 +799,8 @@ AANewTarget * AANewTarget::clone() const
|
|||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
// morph a card
|
// morph a card
|
||||||
AAMorph::AAMorph(int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost, int doTap) :
|
AAMorph::AAMorph(int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost) :
|
||||||
ActivatedAbility(id, card, _cost, restrictions, doTap)
|
ActivatedAbility(id, card, _cost, restrictions)
|
||||||
{
|
{
|
||||||
target = _target;
|
target = _target;
|
||||||
}
|
}
|
||||||
@@ -875,8 +878,8 @@ AAMorph * AAMorph::clone() const
|
|||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
// AADYNAMIC: dynamic ability builder
|
// AADYNAMIC: dynamic ability builder
|
||||||
AADynamic::AADynamic(int id, MTGCardInstance * card, Damageable * _target,int type,int effect,int who,int amountsource,MTGAbility * storedAbility, ManaCost * _cost, int doTap) :
|
AADynamic::AADynamic(int id, MTGCardInstance * card, Damageable * _target,int type,int effect,int who,int amountsource,MTGAbility * storedAbility, ManaCost * _cost) :
|
||||||
ActivatedAbility(id, card, _cost, 0, doTap),type(type),effect(effect),who(who),amountsource(amountsource),eachother(eachother),storedAbility(storedAbility)
|
ActivatedAbility(id, card, _cost, 0),type(type),effect(effect),who(who),amountsource(amountsource),eachother(eachother),storedAbility(storedAbility)
|
||||||
{
|
{
|
||||||
target = _target;
|
target = _target;
|
||||||
sourceamount = 0;
|
sourceamount = 0;
|
||||||
@@ -1293,8 +1296,8 @@ AADynamic::~AADynamic()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//AALifer
|
//AALifer
|
||||||
AALifer::AALifer(int _id, MTGCardInstance * card, Targetable * _target, string life_s, ManaCost * _cost, int _tap, int who) :
|
AALifer::AALifer(int _id, MTGCardInstance * card, Targetable * _target, string life_s, ManaCost * _cost, int who) :
|
||||||
ActivatedAbilityTP(_id, card, _target, _cost, _tap, who),life_s(life_s)
|
ActivatedAbilityTP(_id, card, _target, _cost, who),life_s(life_s)
|
||||||
{
|
{
|
||||||
aType = MTGAbility::LIFER;
|
aType = MTGAbility::LIFER;
|
||||||
}
|
}
|
||||||
@@ -1339,9 +1342,9 @@ AALifer * AALifer::clone() const
|
|||||||
|
|
||||||
|
|
||||||
//Lifeset
|
//Lifeset
|
||||||
AALifeSet::AALifeSet(int _id, MTGCardInstance * _source, Targetable * _target, WParsedInt * life, ManaCost * _cost, int doTap,
|
AALifeSet::AALifeSet(int _id, MTGCardInstance * _source, Targetable * _target, WParsedInt * life, ManaCost * _cost,
|
||||||
int who) :
|
int who) :
|
||||||
ActivatedAbilityTP(_id, _source, _target, _cost, doTap, who), life(life)
|
ActivatedAbilityTP(_id, _source, _target, _cost, who), life(life)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1389,7 +1392,7 @@ AALifeSet::~AALifeSet()
|
|||||||
//cloning...this makes a token thats a copy of the target.
|
//cloning...this makes a token thats a copy of the target.
|
||||||
AACloner::AACloner(int _id, MTGCardInstance * _source, MTGCardInstance * _target, ManaCost * _cost, int who,
|
AACloner::AACloner(int _id, MTGCardInstance * _source, MTGCardInstance * _target, ManaCost * _cost, int who,
|
||||||
string abilitiesStringList) :
|
string abilitiesStringList) :
|
||||||
ActivatedAbility(_id, _source, _cost, 0, 0), who(who)
|
ActivatedAbility(_id, _source, _cost, 0), who(who)
|
||||||
{
|
{
|
||||||
aType = MTGAbility::CLONING;
|
aType = MTGAbility::CLONING;
|
||||||
target = _target;
|
target = _target;
|
||||||
@@ -1587,8 +1590,8 @@ AInstantCastRestrictionUEOT::~AInstantCastRestrictionUEOT()
|
|||||||
|
|
||||||
|
|
||||||
//AAMover
|
//AAMover
|
||||||
AAMover::AAMover(int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest, ManaCost * _cost, int doTap) :
|
AAMover::AAMover(int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest, ManaCost * _cost) :
|
||||||
ActivatedAbility(_id, _source, _cost, 0, doTap), destination(dest)
|
ActivatedAbility(_id, _source, _cost, 0), destination(dest)
|
||||||
{
|
{
|
||||||
if (_target)
|
if (_target)
|
||||||
target = _target;
|
target = _target;
|
||||||
@@ -1646,8 +1649,8 @@ AAMover * AAMover::clone() const
|
|||||||
|
|
||||||
//Random Discard
|
//Random Discard
|
||||||
AARandomDiscarder::AARandomDiscarder(int _id, MTGCardInstance * card, Targetable * _target,string nbcardsStr, ManaCost * _cost,
|
AARandomDiscarder::AARandomDiscarder(int _id, MTGCardInstance * card, Targetable * _target,string nbcardsStr, ManaCost * _cost,
|
||||||
int _tap, int who) :
|
int who) :
|
||||||
ActivatedAbilityTP(_id, card, _target, _cost, _tap, who), nbcardsStr(nbcardsStr)
|
ActivatedAbilityTP(_id, card, _target, _cost, who), nbcardsStr(nbcardsStr)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1690,8 +1693,8 @@ AARandomDiscarder * AARandomDiscarder::clone() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Shuffle
|
// Shuffle
|
||||||
AAShuffle::AAShuffle(int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost, int _tap, int who) :
|
AAShuffle::AAShuffle(int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost, int who) :
|
||||||
ActivatedAbilityTP(_id, card, _target, _cost, _tap, who)
|
ActivatedAbilityTP(_id, card, _target, _cost, who)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1728,8 +1731,8 @@ AAShuffle * AAShuffle::clone() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Tapper
|
//Tapper
|
||||||
AATapper::AATapper(int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost, int doTap) :
|
AATapper::AATapper(int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost) :
|
||||||
ActivatedAbility(id, card, _cost, 0, doTap)
|
ActivatedAbility(id, card, _cost, 0)
|
||||||
{
|
{
|
||||||
target = _target;
|
target = _target;
|
||||||
aType = MTGAbility::TAPPER;
|
aType = MTGAbility::TAPPER;
|
||||||
@@ -1760,8 +1763,8 @@ AATapper * AATapper::clone() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
//AA Untapper
|
//AA Untapper
|
||||||
AAUntapper::AAUntapper(int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost, int doTap) :
|
AAUntapper::AAUntapper(int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost) :
|
||||||
ActivatedAbility(id, card, _cost, 0, doTap)
|
ActivatedAbility(id, card, _cost, 0)
|
||||||
{
|
{
|
||||||
target = _target;
|
target = _target;
|
||||||
aType = MTGAbility::UNTAPPER;
|
aType = MTGAbility::UNTAPPER;
|
||||||
@@ -1791,8 +1794,8 @@ AAUntapper * AAUntapper::clone() const
|
|||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
AAWhatsMax::AAWhatsMax(int id, MTGCardInstance * card, MTGCardInstance * source, ManaCost * _cost, int doTap, int value) :
|
AAWhatsMax::AAWhatsMax(int id, MTGCardInstance * card, MTGCardInstance * source, ManaCost * _cost, int value) :
|
||||||
ActivatedAbility(id, card, _cost, 0, doTap), value(value)
|
ActivatedAbility(id, card, _cost, 0), value(value)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1815,8 +1818,8 @@ AAWhatsMax * AAWhatsMax::clone() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Win Game
|
// Win Game
|
||||||
AAWinGame::AAWinGame(int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost, int _tap, int who) :
|
AAWinGame::AAWinGame(int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost, int who) :
|
||||||
ActivatedAbilityTP(_id, card, _target, _cost, _tap, who)
|
ActivatedAbilityTP(_id, card, _target, _cost, who)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1942,8 +1945,8 @@ MayAbility::~MayAbility()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//MultiAbility : triggers several actions for a cost
|
//MultiAbility : triggers several actions for a cost
|
||||||
MultiAbility::MultiAbility(int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost, int _tap) :
|
MultiAbility::MultiAbility(int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost) :
|
||||||
ActivatedAbility(_id, card, _cost, 0, _tap)
|
ActivatedAbility(_id, card, _cost, 0)
|
||||||
{
|
{
|
||||||
if (_target)
|
if (_target)
|
||||||
target = _target;
|
target = _target;
|
||||||
@@ -2012,8 +2015,8 @@ MultiAbility::~MultiAbility()
|
|||||||
|
|
||||||
//Generic Target Ability
|
//Generic Target Ability
|
||||||
GenericTargetAbility::GenericTargetAbility(string newName,int _id, MTGCardInstance * _source, TargetChooser * _tc, MTGAbility * a,
|
GenericTargetAbility::GenericTargetAbility(string newName,int _id, MTGCardInstance * _source, TargetChooser * _tc, MTGAbility * a,
|
||||||
ManaCost * _cost, int _tap, string limit,MTGAbility * sideEffects,string usesBeforeSideEffects, int restrictions, MTGGameZone * dest) :
|
ManaCost * _cost, string limit,MTGAbility * sideEffects,string usesBeforeSideEffects, int restrictions, MTGGameZone * dest) :
|
||||||
TargetAbility(_id, _source, _tc, _cost, restrictions, _tap), limit(limit), activeZone(dest),newName(newName)
|
TargetAbility(_id, _source, _tc, _cost, restrictions), limit(limit), activeZone(dest),newName(newName)
|
||||||
{
|
{
|
||||||
ability = a;
|
ability = a;
|
||||||
MTGAbility * core = AbilityFactory::getCoreAbility(a);
|
MTGAbility * core = AbilityFactory::getCoreAbility(a);
|
||||||
@@ -2749,7 +2752,7 @@ APreventDamageTypesUEOT::~APreventDamageTypesUEOT()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//AVanishing creature also fading
|
//AVanishing creature also fading
|
||||||
AVanishing::AVanishing(int _id, MTGCardInstance * card, ManaCost * _cost, int _tap, int restrictions, int amount, string counterName) :
|
AVanishing::AVanishing(int _id, MTGCardInstance * card, ManaCost * _cost, int restrictions, int amount, string counterName) :
|
||||||
MTGAbility(_id, source, target),amount(amount),counterName(counterName)
|
MTGAbility(_id, source, target),amount(amount),counterName(counterName)
|
||||||
{
|
{
|
||||||
target = card;
|
target = card;
|
||||||
@@ -2823,9 +2826,9 @@ AVanishing::~AVanishing()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//AUpkeep
|
//AUpkeep
|
||||||
AUpkeep::AUpkeep(int _id, MTGCardInstance * card, MTGAbility * a, ManaCost * _cost, int _tap, int restrictions, int _phase,
|
AUpkeep::AUpkeep(int _id, MTGCardInstance * card, MTGAbility * a, ManaCost * _cost, int restrictions, int _phase,
|
||||||
int _once,bool Cumulative) :
|
int _once,bool Cumulative) :
|
||||||
ActivatedAbility(_id, card, _cost, restrictions, _tap), NestedAbility(a), phase(_phase), once(_once),Cumulative(Cumulative)
|
ActivatedAbility(_id, card, _cost, restrictions), NestedAbility(a), phase(_phase), once(_once),Cumulative(Cumulative)
|
||||||
{
|
{
|
||||||
paidThisTurn = 0;
|
paidThisTurn = 0;
|
||||||
aType = MTGAbility::UPCOST;
|
aType = MTGAbility::UPCOST;
|
||||||
@@ -2913,7 +2916,7 @@ AUpkeep::~AUpkeep()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//A Phase based Action
|
//A Phase based Action
|
||||||
APhaseAction::APhaseAction(int _id, MTGCardInstance * card, MTGCardInstance * target, string sAbility, int _tap, int restrictions, int _phase,bool forcedestroy,bool next,bool myturn,bool opponentturn) :
|
APhaseAction::APhaseAction(int _id, MTGCardInstance * card, MTGCardInstance * target, string sAbility, int restrictions, int _phase,bool forcedestroy,bool next,bool myturn,bool opponentturn) :
|
||||||
MTGAbility(_id, card),sAbility(sAbility), phase(_phase),forcedestroy(forcedestroy),next(next),myturn(myturn),opponentturn(opponentturn)
|
MTGAbility(_id, card),sAbility(sAbility), phase(_phase),forcedestroy(forcedestroy),next(next),myturn(myturn),opponentturn(opponentturn)
|
||||||
{
|
{
|
||||||
abilityId = _id;
|
abilityId = _id;
|
||||||
@@ -3005,11 +3008,11 @@ APhaseAction::~APhaseAction()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// the main ability
|
// the main ability
|
||||||
APhaseActionGeneric::APhaseActionGeneric(int _id, MTGCardInstance * card, MTGCardInstance * target, string sAbility, int _tap, int restrictions, int _phase,bool forcedestroy,bool next,bool myturn,bool opponentturn) :
|
APhaseActionGeneric::APhaseActionGeneric(int _id, MTGCardInstance * card, MTGCardInstance * target, string sAbility, int restrictions, int _phase,bool forcedestroy,bool next,bool myturn,bool opponentturn) :
|
||||||
InstantAbility(_id, source, target)
|
InstantAbility(_id, source, target)
|
||||||
{
|
{
|
||||||
MTGCardInstance * _target = target;
|
MTGCardInstance * _target = target;
|
||||||
ability = NEW APhaseAction(_id, card,_target, sAbility,_tap, restrictions, _phase,forcedestroy,next,myturn,opponentturn);
|
ability = NEW APhaseAction(_id, card,_target, sAbility, restrictions, _phase,forcedestroy,next,myturn,opponentturn);
|
||||||
}
|
}
|
||||||
|
|
||||||
int APhaseActionGeneric::resolve()
|
int APhaseActionGeneric::resolve()
|
||||||
|
|||||||
@@ -897,9 +897,6 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int doTap = 0; //Tap in the cost ?
|
|
||||||
if (s.find("{t}") != string::npos)
|
|
||||||
doTap = 1;
|
|
||||||
|
|
||||||
int restrictions = parseRestriction(s);
|
int restrictions = parseRestriction(s);
|
||||||
|
|
||||||
@@ -938,6 +935,17 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
if (delimiter != string::npos && firstNonSpace != string::npos && sWithoutTc[firstNonSpace] == '{')
|
if (delimiter != string::npos && firstNonSpace != string::npos && sWithoutTc[firstNonSpace] == '{')
|
||||||
{
|
{
|
||||||
ManaCost * cost = ManaCost::parseManaCost(sWithoutTc.substr(0, delimiter + 1), NULL, card);
|
ManaCost * cost = ManaCost::parseManaCost(sWithoutTc.substr(0, delimiter + 1), NULL, card);
|
||||||
|
int doTap = 0; //Tap in the cost ?
|
||||||
|
if(cost && cost->extraCosts)
|
||||||
|
{
|
||||||
|
for(unsigned int i = 0; i < cost->extraCosts->costs.size();i++)
|
||||||
|
{
|
||||||
|
ExtraCost * tapper = dynamic_cast<TapCost*>(cost->extraCosts->costs[i]);
|
||||||
|
if(tapper)
|
||||||
|
doTap = 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
if (doTap || cost)
|
if (doTap || cost)
|
||||||
{
|
{
|
||||||
string s1 = sWithoutTc.substr(delimiter + 2);
|
string s1 = sWithoutTc.substr(delimiter + 2);
|
||||||
@@ -997,8 +1005,8 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
return ae;
|
return ae;
|
||||||
}
|
}
|
||||||
if (tc)
|
if (tc)
|
||||||
return NEW GenericTargetAbility(newName,id, card, tc, a, cost, doTap, limit,sideEffect,usesBeforeSideEffect, restrictions, dest);
|
return NEW GenericTargetAbility(newName,id, card, tc, a, cost, limit,sideEffect,usesBeforeSideEffect, restrictions, dest);
|
||||||
return NEW GenericActivatedAbility(newName,id, card, a, cost, doTap, limit,sideEffect,usesBeforeSideEffect,restrictions, dest);
|
return NEW GenericActivatedAbility(newName,id, card, a, cost, limit,sideEffect,usesBeforeSideEffect,restrictions, dest);
|
||||||
}
|
}
|
||||||
SAFE_DELETE(cost);
|
SAFE_DELETE(cost);
|
||||||
}
|
}
|
||||||
@@ -1127,7 +1135,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NEW AUpkeep(id, card, a, cost, doTap, restrictions, phase, once,Cumulative);
|
return NEW AUpkeep(id, card, a, cost, restrictions, phase, once,Cumulative);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Phase based actions
|
//Phase based actions
|
||||||
@@ -1171,7 +1179,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
_target = spell->getNextCardTarget();
|
_target = spell->getNextCardTarget();
|
||||||
if(!_target)
|
if(!_target)
|
||||||
_target = target;
|
_target = target;
|
||||||
return NEW APhaseActionGeneric(id, card,_target,sAbility, doTap, restrictions, phase,sourceinPlay,next);
|
return NEW APhaseActionGeneric(id, card,_target,sAbility, restrictions, phase,sourceinPlay,next);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Multiple abilities for ONE cost
|
//Multiple abilities for ONE cost
|
||||||
@@ -1180,7 +1188,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
{
|
{
|
||||||
SAFE_DELETE(tc);
|
SAFE_DELETE(tc);
|
||||||
vector<string> multiEffects = split(s,'&');
|
vector<string> multiEffects = split(s,'&');
|
||||||
MultiAbility * multi = NEW MultiAbility(id, card, target, NULL, 0);
|
MultiAbility * multi = NEW MultiAbility(id, card, target, NULL);
|
||||||
for(unsigned int i = 0;i < multiEffects.size();i++)
|
for(unsigned int i = 0;i < multiEffects.size();i++)
|
||||||
{
|
{
|
||||||
if(!multiEffects[i].empty())
|
if(!multiEffects[i].empty())
|
||||||
@@ -1658,7 +1666,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
_target = spell->getNextCardTarget();
|
_target = spell->getNextCardTarget();
|
||||||
if(!_target)
|
if(!_target)
|
||||||
_target = target;
|
_target = target;
|
||||||
return NEW APhaseActionGeneric(id, card,_target, sAbility, doTap, restrictions, phase,sourceinPlay,next,myturn,opponentturn);
|
return NEW APhaseActionGeneric(id, card,_target, sAbility, restrictions, phase,sourceinPlay,next,myturn,opponentturn);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Upkeep Cost
|
//Upkeep Cost
|
||||||
@@ -1706,7 +1714,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NEW AUpkeep(id, card, a, cost, doTap, restrictions, phase, once,Cumulative);
|
return NEW AUpkeep(id, card, a, cost, restrictions, phase, once,Cumulative);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Cycling
|
//Cycling
|
||||||
@@ -1820,14 +1828,14 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
MTGCard * safetycard = MTGCollection()->getCardById(tokenId);
|
MTGCard * safetycard = MTGCollection()->getCardById(tokenId);
|
||||||
if (safetycard)
|
if (safetycard)
|
||||||
{//contenue
|
{//contenue
|
||||||
ATokenCreator * tok = NEW ATokenCreator(id, card,target, NULL, tokenId, 0, starfound, multiplier, who);
|
ATokenCreator * tok = NEW ATokenCreator(id, card,target, NULL, tokenId, starfound, multiplier, who);
|
||||||
tok->oneShot = 1;
|
tok->oneShot = 1;
|
||||||
return tok;
|
return tok;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tokenId = 0;
|
tokenId = 0;
|
||||||
ATokenCreator * tok = NEW ATokenCreator(id, card, target, NULL, "ID NOT FOUND", "ERROR ID", 0, 0, "", 0, NULL);
|
ATokenCreator * tok = NEW ATokenCreator(id, card, target, NULL, "ID NOT FOUND", "ERROR ID",0, 0, "",0, NULL,0);
|
||||||
return tok;
|
return tok;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1854,7 +1862,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
}
|
}
|
||||||
parsePowerToughness(spt, &power, &toughness);
|
parsePowerToughness(spt, &power, &toughness);
|
||||||
string sabilities = s.substr(end + 1);
|
string sabilities = s.substr(end + 1);
|
||||||
ATokenCreator * tok = NEW ATokenCreator(id, card,target, NULL, sname, stypes, power + value, toughness + value, sabilities, 0,starfound,
|
ATokenCreator * tok = NEW ATokenCreator(id, card,target, NULL, sname, stypes, power + value, toughness + value, sabilities,starfound,
|
||||||
multiplier, who,aLivingWeapon,spt);
|
multiplier, who,aLivingWeapon,spt);
|
||||||
tok->oneShot = 1;
|
tok->oneShot = 1;
|
||||||
if(aLivingWeapon)
|
if(aLivingWeapon)
|
||||||
@@ -1874,7 +1882,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
found = s.find("attach");
|
found = s.find("attach");
|
||||||
if (found != string::npos)
|
if (found != string::npos)
|
||||||
{
|
{
|
||||||
MTGAbility * a = NEW AEquip(id, card, 0, 0, ActivatedAbility::NO_RESTRICTION);
|
MTGAbility * a = NEW AEquip(id, card, 0, ActivatedAbility::NO_RESTRICTION);
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2117,7 +2125,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
Targetable * t = NULL;
|
Targetable * t = NULL;
|
||||||
if (spell)
|
if (spell)
|
||||||
t = spell->getNextTarget();
|
t = spell->getNextTarget();
|
||||||
MTGAbility * a = NEW AADamager(id, card, t, d, NULL, 0, who);
|
MTGAbility * a = NEW AADamager(id, card, t, d, NULL, who);
|
||||||
a->oneShot = 1;
|
a->oneShot = 1;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
@@ -2141,7 +2149,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
Targetable * t = NULL;
|
Targetable * t = NULL;
|
||||||
if (spell)
|
if (spell)
|
||||||
t = spell->getNextPlayerTarget();
|
t = spell->getNextPlayerTarget();
|
||||||
MTGAbility * a = NEW AAAlterPoison(id, card, t, poison, NULL, 0, who);
|
MTGAbility * a = NEW AAAlterPoison(id, card, t, poison, NULL, who);
|
||||||
a->oneShot = 1;
|
a->oneShot = 1;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
@@ -2164,7 +2172,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
Targetable * t = NULL;
|
Targetable * t = NULL;
|
||||||
if (spell)
|
if (spell)
|
||||||
t = spell->getNextDamageableTarget();
|
t = spell->getNextDamageableTarget();
|
||||||
MTGAbility * a = NEW AADamagePrevent(id, card, t, preventing, NULL, 0, who);
|
MTGAbility * a = NEW AADamagePrevent(id, card, t, preventing, NULL, who);
|
||||||
a->oneShot = 1;
|
a->oneShot = 1;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
@@ -2189,7 +2197,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
Damageable * t = NULL;
|
Damageable * t = NULL;
|
||||||
if (spell)
|
if (spell)
|
||||||
t = spell->getNextDamageableTarget();
|
t = spell->getNextDamageableTarget();
|
||||||
MTGAbility * a = NEW AALifeSet(id, card, t, life, NULL, 0, who);
|
MTGAbility * a = NEW AALifeSet(id, card, t, life, NULL, who);
|
||||||
a->oneShot = 1;
|
a->oneShot = 1;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
@@ -2212,7 +2220,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
Targetable * t = NULL;
|
Targetable * t = NULL;
|
||||||
if (spell)
|
if (spell)
|
||||||
t = spell->getNextTarget();
|
t = spell->getNextTarget();
|
||||||
MTGAbility * a = NEW AALifer(id, card, t, life_s, NULL, 0, who);
|
MTGAbility * a = NEW AALifer(id, card, t, life_s, NULL, who);
|
||||||
a->oneShot = 1;
|
a->oneShot = 1;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
@@ -2224,7 +2232,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
Damageable * d = NULL;
|
Damageable * d = NULL;
|
||||||
if (spell)
|
if (spell)
|
||||||
d = spell->getNextDamageableTarget();
|
d = spell->getNextDamageableTarget();
|
||||||
MTGAbility * a = NEW AAWinGame(id, card, d, NULL, 0, who);
|
MTGAbility * a = NEW AAWinGame(id, card, d, NULL, who);
|
||||||
a->oneShot = 1;
|
a->oneShot = 1;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
@@ -2247,7 +2255,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
Targetable * t = NULL;
|
Targetable * t = NULL;
|
||||||
if (spell)
|
if (spell)
|
||||||
t = spell->getNextTarget();
|
t = spell->getNextTarget();
|
||||||
MTGAbility * a = NEW AADrawer(id, card, t, NULL,nbcardsStr, 0, who);
|
MTGAbility * a = NEW AADrawer(id, card, t, NULL,nbcardsStr, who);
|
||||||
a->oneShot = 1;
|
a->oneShot = 1;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
@@ -2271,7 +2279,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
Targetable * t = NULL;
|
Targetable * t = NULL;
|
||||||
if (spell)
|
if (spell)
|
||||||
t = spell->getNextTarget();
|
t = spell->getNextTarget();
|
||||||
MTGAbility * a = NEW AADepleter(id, card, t ,nbcardsStr, NULL, 0, who);
|
MTGAbility * a = NEW AADepleter(id, card, t ,nbcardsStr, NULL, who);
|
||||||
a->oneShot = 1;
|
a->oneShot = 1;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
@@ -2283,7 +2291,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
Targetable * t = NULL;
|
Targetable * t = NULL;
|
||||||
if (spell)
|
if (spell)
|
||||||
t = spell->getNextTarget();
|
t = spell->getNextTarget();
|
||||||
MTGAbility * a = NEW AAShuffle(id, card, t, NULL, 0, who);
|
MTGAbility * a = NEW AAShuffle(id, card, t, NULL, who);
|
||||||
a->oneShot = 1;
|
a->oneShot = 1;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
@@ -2344,7 +2352,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
Targetable * t = NULL;
|
Targetable * t = NULL;
|
||||||
if (spell)
|
if (spell)
|
||||||
t = spell->getNextPlayerTarget();
|
t = spell->getNextPlayerTarget();
|
||||||
MTGAbility * a = NEW AARandomDiscarder(id, card, t, nbcardsStr, NULL, 0, who);
|
MTGAbility * a = NEW AARandomDiscarder(id, card, t, nbcardsStr, NULL, who);
|
||||||
a->oneShot = 1;
|
a->oneShot = 1;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
@@ -2532,7 +2540,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
{
|
{
|
||||||
amount = atoi(s.substr(start + 1).c_str());
|
amount = atoi(s.substr(start + 1).c_str());
|
||||||
}
|
}
|
||||||
MTGAbility * a = NEW AVanishing(id, card, NULL, doTap, restrictions,amount,"time");
|
MTGAbility * a = NEW AVanishing(id, card, NULL, restrictions,amount,"time");
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
//Fading
|
//Fading
|
||||||
@@ -2550,7 +2558,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
{
|
{
|
||||||
amount = atoi(s.substr(start + 1).c_str());
|
amount = atoi(s.substr(start + 1).c_str());
|
||||||
}
|
}
|
||||||
MTGAbility * a = NEW AVanishing(id, card, NULL, doTap, restrictions,amount,"fade");
|
MTGAbility * a = NEW AVanishing(id, card, NULL, restrictions,amount,"fade");
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
if (s.find("altercost(") != string::npos)
|
if (s.find("altercost(") != string::npos)
|
||||||
@@ -2669,7 +2677,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
Targetable * t = NULL;
|
Targetable * t = NULL;
|
||||||
if (spell)
|
if (spell)
|
||||||
t = spell->getNextTarget();
|
t = spell->getNextTarget();
|
||||||
MTGAbility * a = NEW AManaProducer(id, card, t, output, NULL, doTap, who);
|
MTGAbility * a = NEW AManaProducer(id, card, t, output, NULL, who);
|
||||||
a->oneShot = 1;
|
a->oneShot = 1;
|
||||||
if(newName.size())
|
if(newName.size())
|
||||||
((AManaProducer*)a)->menutext = newName;
|
((AManaProducer*)a)->menutext = newName;
|
||||||
@@ -2791,7 +2799,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
{
|
{
|
||||||
value = atoi(s.substr(start + 1).c_str());
|
value = atoi(s.substr(start + 1).c_str());
|
||||||
}
|
}
|
||||||
MTGAbility * a = NEW AAWhatsMax(id, card, card, NULL, 0, value);
|
MTGAbility * a = NEW AAWhatsMax(id, card, card, NULL, value);
|
||||||
a->oneShot = 1;
|
a->oneShot = 1;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
@@ -3977,8 +3985,8 @@ NestedAbility::NestedAbility(MTGAbility * _ability)
|
|||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
ActivatedAbility::ActivatedAbility(int id, MTGCardInstance * card, ManaCost * _cost, int restrictions, int tap,string limit,MTGAbility * sideEffect,string usesBeforeSideEffects) :
|
ActivatedAbility::ActivatedAbility(int id, MTGCardInstance * card, ManaCost * _cost, int restrictions,string limit,MTGAbility * sideEffect,string usesBeforeSideEffects) :
|
||||||
MTGAbility(id, card), restrictions(restrictions), needsTapping(tap),limit(limit),sideEffect(sideEffect),usesBeforeSideEffects(usesBeforeSideEffects)
|
MTGAbility(id, card), restrictions(restrictions), needsTapping(0),limit(limit),sideEffect(sideEffect),usesBeforeSideEffects(usesBeforeSideEffects)
|
||||||
{
|
{
|
||||||
counters = 0;
|
counters = 0;
|
||||||
cost = _cost;
|
cost = _cost;
|
||||||
@@ -4203,14 +4211,14 @@ ostream& ActivatedAbility::toString(ostream& out) const
|
|||||||
return MTGAbility::toString(out) << ")";
|
return MTGAbility::toString(out) << ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
TargetAbility::TargetAbility(int id, MTGCardInstance * card, TargetChooser * _tc, ManaCost * _cost, int _playerturnonly, int tap) :
|
TargetAbility::TargetAbility(int id, MTGCardInstance * card, TargetChooser * _tc, ManaCost * _cost, int _playerturnonly) :
|
||||||
ActivatedAbility(id, card, _cost, _playerturnonly, tap), NestedAbility(NULL)
|
ActivatedAbility(id, card, _cost, _playerturnonly), NestedAbility(NULL)
|
||||||
{
|
{
|
||||||
tc = _tc;
|
tc = _tc;
|
||||||
}
|
}
|
||||||
|
|
||||||
TargetAbility::TargetAbility(int id, MTGCardInstance * card, ManaCost * _cost, int _playerturnonly, int tap) :
|
TargetAbility::TargetAbility(int id, MTGCardInstance * card, ManaCost * _cost, int _playerturnonly) :
|
||||||
ActivatedAbility(id, card, _cost, _playerturnonly, tap), NestedAbility(NULL)
|
ActivatedAbility(id, card, _cost, _playerturnonly), NestedAbility(NULL)
|
||||||
{
|
{
|
||||||
tc = NULL;
|
tc = NULL;
|
||||||
}
|
}
|
||||||
@@ -4758,9 +4766,9 @@ GenericTriggeredAbility* GenericTriggeredAbility::clone() const
|
|||||||
other solutions need to be provided for abilities that add mana (ex: mana flare)
|
other solutions need to be provided for abilities that add mana (ex: mana flare)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
AManaProducer::AManaProducer(int id, MTGCardInstance * card, Targetable * t, ManaCost * _output, ManaCost * _cost, int doTap,
|
AManaProducer::AManaProducer(int id, MTGCardInstance * card, Targetable * t, ManaCost * _output, ManaCost * _cost,
|
||||||
int who) :
|
int who) :
|
||||||
ActivatedAbilityTP(id, card, t, _cost, doTap, who)
|
ActivatedAbilityTP(id, card, t, _cost, who)
|
||||||
{
|
{
|
||||||
|
|
||||||
aType = MTGAbility::MANA_PRODUCER;
|
aType = MTGAbility::MANA_PRODUCER;
|
||||||
@@ -4830,7 +4838,6 @@ int AManaProducer::reactToClick(MTGCardInstance * _card)
|
|||||||
GameObserver *g = GameObserver::GetInstance();
|
GameObserver *g = GameObserver::GetInstance();
|
||||||
WEvent * e = NEW WEventCardTappedForMana(source, 0, 1);
|
WEvent * e = NEW WEventCardTappedForMana(source, 0, 1);
|
||||||
g->receiveEvent(e);
|
g->receiveEvent(e);
|
||||||
source->tap();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options[Options::SFXVOLUME].number > 0)
|
if (options[Options::SFXVOLUME].number > 0)
|
||||||
@@ -4940,8 +4947,8 @@ Targetable * AbilityTP::getTarget()
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ActivatedAbilityTP::ActivatedAbilityTP(int id, MTGCardInstance * card, Targetable * _target, ManaCost * cost, int doTap, int who) :
|
ActivatedAbilityTP::ActivatedAbilityTP(int id, MTGCardInstance * card, Targetable * _target, ManaCost * cost, int who) :
|
||||||
ActivatedAbility(id, card, cost, 0, doTap), who(who)
|
ActivatedAbility(id, card, cost, 0), who(who)
|
||||||
{
|
{
|
||||||
if (_target)
|
if (_target)
|
||||||
target = _target;
|
target = _target;
|
||||||
|
|||||||
Reference in New Issue
Block a user