-fix issue 297
- also removed the "untapBlockers" system. The idea was nice but incorrectly implemented, and only 2 cards were using it so far.
This commit is contained in:
wagic.the.homebrew@gmail.com
2010-01-17 12:05:40 +00:00
parent 6830d850f2
commit ffbcd3f2d0
16 changed files with 74 additions and 306 deletions

View File

@@ -1405,27 +1405,6 @@ class GenericInstantAbility: public InstantAbility{
};
//Untap Blockers with simple Mana Mechanism
class AUntapManaBlocker: public UntapBlocker{
public:
AUntapManaBlocker(int id, MTGCardInstance * card, ManaCost * _cost):UntapBlocker(id, card, _cost){
}
AUntapManaBlocker(int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost):UntapBlocker(id, card,_target, _cost){
}
virtual ostream& toString(ostream& out) const
{
out << "AUntapManaBlocker ::: (";
return UntapBlocker::toString(out) << ")";
}
AUntapManaBlocker * clone() const{
AUntapManaBlocker * a = NEW AUntapManaBlocker(*this);
a->isClone = 1;
return a;
}
};
//Circle of Protections
class ACircleOfProtection: public TargetAbility{
protected:

View File

@@ -1,55 +0,0 @@
#ifndef _BLOCKER_H_
#define _BLOCKER_H_
#define MAX_BLOCKERS 64 // Currently needs to be equal to MAX_GUI_OBJECTS in JGE/JGui.h.
#include "MTGAbility.h"
class ManaCost;
class GameObserver;
class MTGAbility;
class UntapBlocker : public MTGAbility {
protected:
ManaCost * manaCost;
int currentPhase;
void init(ManaCost * _cost);
public:
virtual ManaCost * untapManaCost(){return manaCost;};
virtual int unblock(){return 1;};
UntapBlocker(int id, MTGCardInstance * card, ManaCost * _cost);
UntapBlocker(int id, MTGCardInstance * card);
UntapBlocker(int id, MTGCardInstance * card, MTGCardInstance *_target);
UntapBlocker(int id, MTGCardInstance * card, MTGCardInstance *_target, ManaCost * _cost);
~UntapBlocker();
virtual void Update(float dt);
virtual int destroy();
virtual UntapBlocker * clone() const;
};
class UntapBlockers {
protected:
int cursor;
int blockers[MAX_BLOCKERS];
GameObserver * game;
public:
UntapBlockers();
~UntapBlockers();
int Add (UntapBlocker * ability);
int Remove (UntapBlocker * ability);
int init();
UntapBlocker * next();
int rewind();
int isEmpty();
};
#include "ManaCost.h"
#include "GameObserver.h"
#endif

View File

@@ -1,14 +0,0 @@
#ifndef _CONSTRAINTRESOLVER_H_
#define _CONSTRAINTRESOLVER_H_
#include "GameObserver.h"
#include "MTGCardInstance.h"
class ConstraintResolver {
protected:
public:
static int untap(GameObserver * game, MTGCardInstance * card);
};
#endif

View File

@@ -31,6 +31,7 @@ class GameObserver{
int nbPlayers;
int currentPlayerId;
int untap(MTGCardInstance * card);
public:
CombatStep combatStep;

View File

@@ -119,6 +119,38 @@ class ActivatedAbility:public MTGAbility{
MY_EOT = 15,
MY_CLEANUP = 16,
MY_AFTER_EOT = 17,
OPPONENT_BEFORE_BEGIN = 23,
OPPONENT_UNTAP = 24,
OPPONENT_UPKEEP = 25,
OPPONENT_DRAW = 26,
OPPONENT_FIRSTMAIN = 27,
OPPONENT_COMBATBEGIN = 28,
OPPONENT_COMBATATTACKERS = 29,
OPPONENT_COMBATBLOCKERS = 30,
OPPONENT_COMBATDAMAGE = 31,
OPPONENT_COMBATEND = 32,
OPPONENT_SECONDMAIN = 33,
OPPONENT_ENDOFTURN = 34,
OPPONENT_EOT = 35,
OPPONENT_CLEANUP = 36,
OPPONENT_AFTER_EOT = 37,
BEFORE_BEGIN = 43,
UNTAP = 44,
UPKEEP = 45,
DRAW = 46,
FIRSTMAIN = 47,
COMBATBEGIN = 48,
COMBATATTACKERS = 49,
COMBATBLOCKERS = 50,
COMBATDAMAGE = 51,
COMBATEND = 52,
SECONDMAIN = 53,
ENDOFTURN = 54,
EOT = 55,
CLEANUP = 56,
AFTER_EOT = 57,
};
int restrictions;
int needsTapping;

View File

@@ -33,7 +33,6 @@ class MTGCardInstance: public CardPrimitive, public MTGCard, public Damageable {
int tapped;
int lifeOrig;
UntapBlockers * untapBlockers;
MTGPlayerCards * belongs_to;
MTGAbility * untapBlockerAbilities[10];
MTGCardInstance * getNextPartner();
@@ -105,7 +104,6 @@ class MTGCardInstance: public CardPrimitive, public MTGCard, public Damageable {
MTGCard * model;
MTGCardInstance();
MTGCardInstance(MTGCard * card, MTGPlayerCards * _belongs_to);
UntapBlockers * getUntapBlockers();
int regenerate();
int triggerRegenerate();
Player * controller();