b6a17098a4
- Added Dr Solomat's TEMPEST expansion - Added Sacrifice as part of the cost of activated abilities. Making it work as an extra cost for "put in play" still requires some work though. "Render" methods need to be written correctly - Added cards with sacrifice in the existing sets. Most of them need testing...
64 lines
1.5 KiB
C++
64 lines
1.5 KiB
C++
#ifndef _MANACOST_H_
|
|
#define _MANACOST_H_
|
|
|
|
#include "../include/utils.h"
|
|
#include "../include/MTGDefinitions.h"
|
|
|
|
|
|
class ManaCostHybrid;
|
|
class ExtraCosts;
|
|
class ExtraCost;
|
|
class MTGAbility;
|
|
class MTGCardInstance;
|
|
|
|
class ManaCost{
|
|
protected:
|
|
int cost[Constants::MTG_NB_COLORS+1];
|
|
ManaCostHybrid * hybrids[10];
|
|
int nbhybrids;
|
|
|
|
public:
|
|
ExtraCosts * extraCosts;
|
|
static ManaCost * parseManaCost(string value, ManaCost * _manacost = NULL);
|
|
void init();
|
|
void x();
|
|
ManaCost(int _cost[], int nb_elems);
|
|
ManaCost();
|
|
~ManaCost();
|
|
ManaCost(ManaCost * _manaCost);
|
|
void copy (ManaCost * _manaCost);
|
|
int isNull();
|
|
int getConvertedCost();
|
|
string toString();
|
|
int getCost(int color);
|
|
//Returns NULL if i is greater than nbhybrids
|
|
ManaCostHybrid * getHybridCost(unsigned int i);
|
|
int getMainColor();
|
|
int hasColor(int color);
|
|
int remove (int color, int value);
|
|
int add(int color, int value);
|
|
|
|
//
|
|
// Extra Costs (sacrifice...)
|
|
//
|
|
int addExtraCost(ExtraCost * _cost);
|
|
int setExtraCostsAction(MTGAbility * action, MTGCardInstance * card);
|
|
int isExtraPaymentSet();
|
|
int resetExtraPayment();
|
|
int doPayExtra();
|
|
|
|
int addHybrid(int c1, int v1, int c2, int v2);
|
|
int tryToPayHybrids(ManaCostHybrid * _hybrids[], int _nbhybrids, int diff[]);
|
|
void randomDiffHybrids(ManaCost * _cost, int diff[]);
|
|
int add(ManaCost * _cost);
|
|
int pay (ManaCost * _cost);
|
|
|
|
//return 1 if _cost can be paid with current data, 0 otherwise
|
|
int canAfford(ManaCost * _cost);
|
|
|
|
int isPositive();
|
|
ManaCost * Diff(ManaCost * _cost);
|
|
};
|
|
|
|
#endif
|