- added "targetplayer" functionality to ManaProducer objects. As a collateral benefit, this fixes issue 191 (seismic spike)
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-11-14 07:07:58 +00:00
parent 8390a94440
commit 7b2ac9e610
6 changed files with 47 additions and 37 deletions
-21
View File
@@ -454,28 +454,7 @@ public:
};
class ActivatedAbilityTP:public ActivatedAbility{
public:
int who;
ActivatedAbilityTP(int id, MTGCardInstance * card, Targetable * _target = NULL, ManaCost * cost=NULL, int doTap = 0, int who = TargetChooser::UNSET):ActivatedAbility(id,card,cost,0,doTap),who(who){
if (_target) target = _target;
}
Targetable * getTarget(){
switch(who){
case TargetChooser::TARGET_CONTROLLER:
if (target) return ((MTGCardInstance *)target)->controller();
return NULL;
case TargetChooser::CONTROLLER:
return source->controller();
case TargetChooser::OPPONENT:
return source->controller()->opponent();
default:
return target;
}
return NULL;
}
};
//Drawer, allows to draw a card for a cost:
+10 -3
View File
@@ -8,7 +8,6 @@ class GameObserver;
class Spell;
class Damageable;
class PlayGuiObject;
class TargetChooser;
class ManaCost;
class MTGGameZone;
class Player;
@@ -20,6 +19,7 @@ class WEvent;
#include <map>
#include <hge/hgeparticle.h>
#include "../include/Damage.h"
#include "../include/TargetChooser.h"
using std::string;
using std::map;
@@ -217,7 +217,14 @@ class AbilityFactory{
};
class AManaProducer: public MTGAbility{
class ActivatedAbilityTP:public ActivatedAbility{
public:
int who;
ActivatedAbilityTP(int id, MTGCardInstance * card, Targetable * _target = NULL, ManaCost * cost=NULL, int doTap = 0, int who = TargetChooser::UNSET);
Targetable * getTarget();
};
class AManaProducer: public ActivatedAbilityTP{
protected:
@@ -227,7 +234,7 @@ class AManaProducer: public MTGAbility{
public:
ManaCost * output;
int tap;
AManaProducer(int id, MTGCardInstance * card, ManaCost * _output, ManaCost * _cost = NULL, int doTap = 1 );
AManaProducer(int id, MTGCardInstance * card, Targetable * t, ManaCost * _output, ManaCost * _cost = NULL, int doTap = 1, int who = TargetChooser::UNSET );
int isReactingToClick(MTGCardInstance * _card, ManaCost * mana = NULL);
int resolve();
int reactToClick(MTGCardInstance * _card);
-1
View File
@@ -2,7 +2,6 @@
#define _MTGCARD_H_
#define MTGCARD_NAME_SIZE 30
#define MTGCARD_TEXT_SIZE 300
#define MTG_IMAGE_WIDTH 200
#define MTG_IMAGE_HEIGHT 285