which tells the ai not to use the targetible cards as attackers, this can be card names, and CD modes.
modified the way ai handles multikicker. it will not be casting 1/1 joragas anymore :D
made WParsedInt ignore "+" signs....
added a new affinity ability...autohand=affinity(creature[vampire]|mygraveyard) ....
this is essentially affinity for creatures in your grave.
added supkeyword to clone clone addtype(zombie)....it adds the type listed to the cards types on clone...
reparse PT bonus on resolve.
reworked bushido, it should now work correctly...aside from that it now excepts word variables...fumiko is now bushido(type:creature[attacking]:battlefield/type:creature[attacking]:battlefield)
added a keyword to access acontrolsteal..the keyword is "steal"
auto=ueot steal target(creature)
reworked persist to handle undying..added the new counter handling rules intruduced by wotc in ISD
added a vector cardsAbilities to mtgcardinstance...this keeps the abilities added to the game for a card to use stored where we can easly alter or remove them.
added an automatic increase to geteff return if the ability is a putinplay ability.
finished coding support for flip and double sided cards, though viewing the "other side" is still not possible yet.
the ability follows the mtg rules.
the ability syntax is flip(card name)...a card can flip into any other card by name...even flip into itself.
added a "canPay() call for Ninja cost...to prevent it from coming up in a menu unless you're in blockers....
added 3 new restriction types that work very similar to type(
thisturn(tc)~morethan~2
lastturn(tc)~lessthan~thisturn(tc)
compare(wordvarible)~equalto~compare(wordvarible)
these are pretty self explanitory.
moved "&&" ability parsing below "this(" allowing "this(" to grant abilities now which contain &&...enclave egologist bug is fixed by this.
fixed an issue with combatspirit link for some reason the way i was doing the bool was not always working.
took care of the todo for AProtectionFrom...you can now give a protection from(blah) in a instant or ueot ability.
added altho very limited right now a "targetedplayer" tc word. i hope to increase this with time.
as always my sidekick doc already has some cards coded for this and test will follow the addition of the cards.
221 lines
4.3 KiB
C++
221 lines
4.3 KiB
C++
#ifndef _EXTRACOST_H_
|
|
#define _EXTRACOST_H_
|
|
|
|
#include <vector>
|
|
#include "Counters.h"
|
|
#include "ObjectAnalytics.h"
|
|
|
|
using std::vector;
|
|
|
|
class TargetChooser;
|
|
class MTGCardInstance;
|
|
class MTGAbility;
|
|
|
|
class ExtraCost
|
|
#ifdef TRACK_OBJECT_USAGE
|
|
: public InstanceCounter<ExtraCost>
|
|
#endif
|
|
{
|
|
public:
|
|
TargetChooser * tc;
|
|
MTGCardInstance * source;
|
|
MTGCardInstance * target;
|
|
std::string mCostRenderString;
|
|
|
|
ExtraCost(const std::string& inCostRenderString, TargetChooser *_tc = NULL);
|
|
virtual ~ExtraCost();
|
|
|
|
virtual int setPayment(MTGCardInstance * card);
|
|
virtual int isPaymentSet()
|
|
{
|
|
return (target != NULL);
|
|
}
|
|
|
|
virtual int canPay() { return 1; }
|
|
virtual int doPay() = 0;
|
|
virtual void Render();
|
|
virtual int setSource(MTGCardInstance * _source);
|
|
virtual ExtraCost* clone() const = 0;
|
|
};
|
|
|
|
class ExtraCosts
|
|
{
|
|
public:
|
|
vector<ExtraCost *>costs;
|
|
MTGCardInstance * source;
|
|
MTGAbility * action;
|
|
|
|
ExtraCosts();
|
|
~ExtraCosts();
|
|
void Render();
|
|
int tryToSetPayment(MTGCardInstance * card);
|
|
int isPaymentSet();
|
|
int canPay();
|
|
int doPay();
|
|
int reset();
|
|
int setAction(MTGAbility * _action, MTGCardInstance * _source);
|
|
void Dump();
|
|
ExtraCosts * clone() const;
|
|
};
|
|
|
|
class SacrificeCost : public ExtraCost
|
|
{
|
|
public:
|
|
SacrificeCost(TargetChooser *_tc = NULL);
|
|
virtual int doPay();
|
|
virtual SacrificeCost * clone() const;
|
|
};
|
|
|
|
//life cost
|
|
class LifeCost : public ExtraCost
|
|
{
|
|
public:
|
|
LifeCost(TargetChooser *_tc = NULL);
|
|
virtual int canPay();
|
|
virtual int doPay();
|
|
virtual LifeCost * clone() const;
|
|
};
|
|
|
|
//pyrhaixa mana
|
|
class LifeorManaCost : public ExtraCost
|
|
{
|
|
public:
|
|
LifeorManaCost(TargetChooser *_tc = NULL,string manaType = "");
|
|
string manaType;
|
|
virtual int canPay();
|
|
virtual int doPay();
|
|
virtual LifeorManaCost * clone() const;
|
|
};
|
|
|
|
//Discard a random card cost
|
|
class DiscardRandomCost : public ExtraCost
|
|
{
|
|
public:
|
|
DiscardRandomCost(TargetChooser *_tc = NULL);
|
|
virtual int canPay();
|
|
virtual int doPay();
|
|
virtual DiscardRandomCost * clone() const;
|
|
};
|
|
|
|
//a choosen discard
|
|
class DiscardCost : public ExtraCost
|
|
{
|
|
public:
|
|
DiscardCost(TargetChooser *_tc = NULL);
|
|
virtual int doPay();
|
|
virtual DiscardCost * clone() const;
|
|
};
|
|
|
|
//cycle
|
|
class CycleCost : public ExtraCost
|
|
{
|
|
public:
|
|
CycleCost(TargetChooser *_tc = NULL);
|
|
virtual int doPay();
|
|
virtual CycleCost * clone() const;
|
|
};
|
|
|
|
//tolibrary cost
|
|
class ToLibraryCost : public ExtraCost
|
|
{
|
|
public:
|
|
ToLibraryCost(TargetChooser *_tc = NULL);
|
|
virtual int doPay();
|
|
virtual ToLibraryCost * clone() const;
|
|
};
|
|
|
|
//Millyourself cost
|
|
class MillCost : public ExtraCost
|
|
{
|
|
public:
|
|
MillCost(TargetChooser *_tc = NULL);
|
|
virtual int canPay();
|
|
virtual int doPay();
|
|
virtual MillCost * clone() const;
|
|
};
|
|
|
|
//Mill to exile yourself cost
|
|
class MillExileCost : public MillCost
|
|
{
|
|
public:
|
|
MillExileCost(TargetChooser *_tc = NULL);
|
|
virtual int doPay();
|
|
};
|
|
|
|
//tap cost
|
|
class TapCost : public ExtraCost
|
|
{
|
|
public:
|
|
TapCost();
|
|
virtual int isPaymentSet();
|
|
virtual int canPay();
|
|
virtual int doPay();
|
|
virtual TapCost * clone() const;
|
|
};
|
|
|
|
//untap cost
|
|
class UnTapCost : public ExtraCost
|
|
{
|
|
public:
|
|
UnTapCost();
|
|
virtual int isPaymentSet();
|
|
virtual int canPay();
|
|
virtual int doPay();
|
|
virtual UnTapCost * clone() const;
|
|
};
|
|
|
|
//tap other cost
|
|
class TapTargetCost : public ExtraCost
|
|
{
|
|
public:
|
|
TapTargetCost(TargetChooser *_tc = NULL);
|
|
virtual int isPaymentSet();
|
|
virtual int doPay();
|
|
virtual TapTargetCost * clone() const;
|
|
};
|
|
|
|
//exile as cost
|
|
class ExileTargetCost : public ExtraCost
|
|
{
|
|
public:
|
|
ExileTargetCost(TargetChooser *_tc = NULL);
|
|
virtual int doPay();
|
|
virtual ExileTargetCost * clone() const;
|
|
};
|
|
|
|
//bounce cost
|
|
class BounceTargetCost : public ExtraCost
|
|
{
|
|
public:
|
|
BounceTargetCost(TargetChooser *_tc = NULL);
|
|
virtual int doPay();
|
|
virtual BounceTargetCost * clone() const;
|
|
};
|
|
|
|
//bounce cost
|
|
class Ninja : public ExtraCost
|
|
{
|
|
public:
|
|
Ninja(TargetChooser *_tc = NULL);
|
|
virtual int canPay();
|
|
virtual int isPaymentSet();
|
|
virtual int doPay();
|
|
virtual Ninja * clone() const;
|
|
};
|
|
|
|
class CounterCost : public ExtraCost
|
|
{
|
|
public:
|
|
Counter * counter;
|
|
int hasCounters;
|
|
CounterCost(Counter * _counter,TargetChooser *_tc = NULL);
|
|
~CounterCost();
|
|
virtual int setPayment(MTGCardInstance * card);
|
|
virtual int isPaymentSet();
|
|
virtual int canPay();
|
|
virtual int doPay();
|
|
virtual CounterCost * clone() const;
|
|
};
|
|
|
|
#endif
|