megapatch contents

added
"whenever a creature enters the battlefield you may pay {1}, if you do gain one life"
conditional may pay({cost}) effect 
this version is a super type ability, and can only be used in certain combos.

to nest you will need to use it in its subtype pay[[{cost}]] effect
pay keyword can have sideeffects coded as follows
pay[[{1}]] life:1?life:-1
pay one mana and gain 1 life, if you dont then you lose one life. notice no space between the abilities and the question mark.

added castcard()
a method to cast a targeted card, this contains the following subkeywords which can be used in combinations
(normal)
(restricted)
(copied)
(noevent)
castcard(restricted copied noevent) for example will cast a card that is a copy or the spell without sending a cast event only when the spell is castable.
"normal" subkeyword cast the actual spell, not a copy.

extended the use of exiledeath to everyzone, any card going from any zone to graveyard is placed in exile if it has exiledeath.

limited swipe left to open hand only when hand is closed view.

"moveto(" can now be named.
This commit is contained in:
omegablast2002@yahoo.com
2013-06-18 01:41:34 +00:00
parent ece78395f4
commit b61cd2f69a
22 changed files with 937 additions and 101 deletions

View File

@@ -19,6 +19,7 @@
#include <JGui.h>
#include <hge/hgeparticle.h>
#include "IconButton.h"
#include "ExtraCost.h"
#include <map>
using std::map;
@@ -1102,7 +1103,8 @@ public:
class AAFakeAbility: public ActivatedAbility
{
public:
AAFakeAbility(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, ManaCost * cost = NULL);
string named;
AAFakeAbility(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target,string _newName, ManaCost * cost = NULL);
int resolve();
const char* getMenuText();
AAFakeAbility * clone() const;
@@ -1157,7 +1159,6 @@ public:
string Cond;
Player * previousInterrupter;
MTGAbility * mClone;
ManaCost * optionalCost;
MayAbility(GameObserver* observer, int _id, MTGAbility * _ability, MTGCardInstance * _source, bool must = false, string restriction = "");
@@ -1182,11 +1183,15 @@ public:
int triggered;
bool removeMenu;
bool must;
bool processed;
MTGAbility * mClone;
ManaCost * toPay;
vector<MTGAbility*>abilities;
vector<ManaCost*>optionalCosts;
Player * who;
string newNameString;
MenuAbility(GameObserver* observer, int _id, Targetable * target, MTGCardInstance * _source, bool must = false, vector<MTGAbility*>abilities = vector<MTGAbility*>(),Player * who = NULL,string _newName = "");
bool CheckUserInput(JButton key);
void Update(float dt);
int resolve();
const char * getMenuText();
@@ -1194,6 +1199,7 @@ public:
int isReactingToTargetClick(Targetable * card);
int reactToTargetClick(Targetable * object);
int reactToChoiceClick(Targetable * object,int choice,int control);
int processAbility();
MenuAbility * clone() const;
~MenuAbility();
@@ -1301,7 +1307,8 @@ class AAMover: public ActivatedAbility
public:
string destination;
MTGAbility * andAbility;
AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest, ManaCost * _cost = NULL);
string named;
AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string _name, ManaCost * _cost = NULL);
MTGGameZone * destinationZone(Targetable * target = NULL);
int resolve();
const char * getMenuText();
@@ -1331,6 +1338,7 @@ class AABuryCard: public ActivatedAbility
{
public:
MTGAbility * andAbility;
string menu;
AABuryCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target);
int resolve();
const char * getMenuText();
@@ -5569,6 +5577,32 @@ public:
}
};
class AACastCard: public MTGAbility
{
public:
MTGAbility * andAbility;
bool processed;
bool restricted;
bool asCopy;
bool normal;
string cardNamed;
string nameThis;
MTGCardInstance * theNamedCard;
bool noEvent;
AACastCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target,bool restricted,bool copied,bool _asNormal,string nameCard,string abilityName,bool _noEvent);
int testDestroy(){return 0;};
void Update(float dt);
const char * getMenuText();
int isReactingToTargetClick(Targetable * card);
int reactToTargetClick(Targetable * object);
MTGCardInstance * makeCard();
int resolveSpell();
AACastCard * clone() const;
~AACastCard();
};
//A Spirit Link Ability
class ASpiritLinkAbility: public MTGAbility
{
@@ -5736,6 +5770,25 @@ public:
GenericFlipACoin * clone() const;
~GenericFlipACoin();
};
//------------
class GenericPaidAbility: public ActivatedAbility
{
public:
MTGAbility * baseAbility;
ManaCost * optionalCost;
string newName;
string restrictions;
string baseCost;
string baseAbilityStr;
GenericPaidAbility(GameObserver* observer, int id, MTGCardInstance * source, Targetable * target,string _newName,string _castRestriction,string _mayCost, string toAdd, ManaCost * cost = NULL);
int resolve();
const char* getMenuText();
GenericPaidAbility * clone() const;
~GenericPaidAbility();
};
// utility functions

View File

@@ -4,6 +4,7 @@
#include <vector>
#include "Counters.h"
#include "ObjectAnalytics.h"
#include "ManaCost.h"
using std::vector;
@@ -18,11 +19,12 @@ class ExtraCost
{
public:
TargetChooser * tc;
ManaCost * costToPay;
MTGCardInstance * source;
MTGCardInstance * target;
std::string mCostRenderString;
ExtraCost(const std::string& inCostRenderString, TargetChooser *_tc = NULL);
ExtraCost(const std::string& inCostRenderString, TargetChooser *_tc = NULL,ManaCost * _costToPay = NULL);
virtual ~ExtraCost();
virtual int setPayment(MTGCardInstance * card);
@@ -58,6 +60,18 @@ public:
ExtraCosts * clone() const;
};
//extraextra
class extraManaCost : public ExtraCost
{
public:
extraManaCost(ManaCost * cost = NULL);
virtual int tryToSetPayment(MTGCardInstance * card);
virtual int isPaymentSet();
virtual int canPay();
virtual int doPay();
virtual extraManaCost * clone() const;
};
class SacrificeCost : public ExtraCost
{
public:

View File

@@ -444,6 +444,7 @@ public:
class AbilityFactory
{
private:
string storedPayString;
string storedString;
string storedAbilityString;
string storedAndAbility;

View File

@@ -115,12 +115,11 @@ public:
ManaCost increasedCost;
ManaCost * getReducedManaCost();
ManaCost * getIncreasedManaCost();
bool matchesCastFilter(int castMethod);
// The recommended method to test for summoning Sickness !
int hasSummoningSickness();
MTGCardInstance * changeController(Player * newcontroller);
MTGCardInstance * changeController(Player * newcontroller,bool notZone = false);
Player * owner;
Counters * counters;
const string getDisplayName() const;

View File

@@ -209,7 +209,7 @@ public:
MTGCardInstance * putInExile(MTGCardInstance * card);
MTGCardInstance * putInLibrary(MTGCardInstance * card);
MTGCardInstance * putInHand(MTGCardInstance * card);
MTGCardInstance * putInZone(MTGCardInstance * card, MTGGameZone * from, MTGGameZone * to);
MTGCardInstance * putInZone(MTGCardInstance * card, MTGGameZone * from, MTGGameZone * to, bool asCopy = false);
int isInPlay(MTGCardInstance * card);
int isInGrave(MTGCardInstance * card);
int isInZone(MTGCardInstance * card,MTGGameZone * zone);

View File

@@ -50,6 +50,9 @@ public:
ManaCost * Retrace;
ManaCost * morph;
ManaCost * suspend;
ManaCost * manaUsedToCast;
string alternativeName;
bool isMulti;
static ManaCost * parseManaCost(string value, ManaCost * _manacost = NULL, MTGCardInstance * c = NULL);