- 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...
This commit is contained in:
wagic.the.homebrew
2009-01-25 09:20:01 +00:00
parent f593d1289c
commit b6a17098a4
26 changed files with 2095 additions and 321 deletions
+1
View File
@@ -145,6 +145,7 @@ class ActionStack :public GuiLayer{
int CombatDamages();
int CombatDamages(int firststrike);
int has(Interruptible * action);
int has(MTGAbility * ability);
#if defined (WIN32) || defined (LINUX)
void Dump();
#endif
+16
View File
@@ -81,10 +81,15 @@ class ADrawer:public ActivatedAbility{
return 1;
}
const char * getMenuText(){
return "Draw";
}
~ADrawer(){
OutputDebugString("Deleting ADrawer\n");
}
};
@@ -170,6 +175,17 @@ public:
if (p){
MTGGameZone * fromZone = _target->getCurrentZone();
MTGGameZone * destZone = MTGGameZone::stringToZone(destinationZone, source);
//inplay is a special zone !
for (int i=0; i < 2; i++){
if (destZone == game->players[i]->game->inPlay){
Spell * spell = NEW Spell(_target);
game->players[i]->game->putInZone(_target, fromZone, game->players[i]->game->stack);
spell->resolve();
delete spell;
return 1;
}
}
p->game->putInZone(_target,fromZone,destZone);
}
return 1;
+49
View File
@@ -0,0 +1,49 @@
#ifndef _EXTRACOST_H_
#define _EXTRACOST_H_
#include <vector>
using std::vector;
class TargetChooser;
class MTGCardInstance;
class MTGAbility;
class ExtraCost{
public:
TargetChooser * tc;
MTGCardInstance * source;
ExtraCost(TargetChooser *_tc = NULL);
virtual int setPayment(MTGCardInstance * card) = 0;
virtual int isPaymentSet() = 0;
virtual int doPay() = 0;
virtual void Render(){};
virtual int setSource(MTGCardInstance * _source);
};
class ExtraCosts{
public:
vector<ExtraCost *>costs;
MTGCardInstance * source;
MTGAbility * action;
ExtraCosts();
void Render();
int tryToSetPayment(MTGCardInstance * card);
int isPaymentSet();
int doPay();
int reset();
int setAction(MTGAbility * _action, MTGCardInstance * _source);
void Dump();
};
class SacrificeCost: public ExtraCost{
public:
MTGCardInstance * target;
SacrificeCost(TargetChooser *_tc = NULL);
virtual int setPayment(MTGCardInstance * card);
virtual int isPaymentSet();
virtual int doPay();
virtual void Render();
virtual int setSource(MTGCardInstance * _source);
};
#endif
+1
View File
@@ -38,6 +38,7 @@ class GameObserver{
PhaseRing * phaseRing;
int cancelCurrentAction();
int currentGamePhase;
ExtraCosts * waitForExtraPayment;
int oldGamePhase;
TargetChooser * targetChooser;
DuelLayers * mLayers;
+17
View File
@@ -6,13 +6,19 @@
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();
@@ -21,6 +27,7 @@ class ManaCost{
~ManaCost();
ManaCost(ManaCost * _manaCost);
void copy (ManaCost * _manaCost);
int isNull();
int getConvertedCost();
string toString();
int getCost(int color);
@@ -30,6 +37,16 @@ class ManaCost{
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[]);