Erwan
- Added the possibility to narrow a spell/ability target according to color,tapped status, attacker/blocker, abilities... - Changed the games phase system to become a phaseRing. This allows to add cards that have an impact on the phases, such as stasis - Added a few cards - Fixed a (windows) bug in gatherer tool - Adding stdint.h for VC++ (see wikipedia->stdint.h) - deleting the compiled PSP lib to avoid confusion. People who work from the sourcehave to compile the lib by themselves.
This commit is contained in:
@@ -36,7 +36,7 @@ public:
|
||||
virtual ~AIPlayer();
|
||||
virtual MTGCardInstance * chooseCard(TargetChooser * tc, MTGCardInstance * source, int random = 0);
|
||||
virtual int chooseTarget(TargetChooser * tc = NULL);
|
||||
virtual int Act();
|
||||
virtual int Act(float dt);
|
||||
int isAI(){return 1;};
|
||||
|
||||
};
|
||||
@@ -49,7 +49,7 @@ protected:
|
||||
MTGCardInstance * FindCardToPlay(ManaCost * potentialMana, const char * type);
|
||||
public:
|
||||
AIPlayerBaka(MTGPlayerCards * _deck, char * deckFile);
|
||||
virtual int Act();
|
||||
virtual int Act(float dt);
|
||||
void initTimer();
|
||||
};
|
||||
|
||||
|
||||
@@ -449,6 +449,13 @@ public:
|
||||
//That means the player has to choose one. although that is perfect for cards such as birds of paradise or badlands,
|
||||
other solutions need to be provided for abilities that add mana (ex: mana flare)
|
||||
*/
|
||||
/*
|
||||
Currently the mana is added to the pool AFTER the animation
|
||||
This is VERY BAD, since we don't have any control on the duration of the animation. This can lead to bugs with
|
||||
the AI, who is expecting to have the mana in its manapool right after clicking the land card !!!
|
||||
The sum of "dt" has to be 0.25 for the mana to be in the manapool currently
|
||||
*/
|
||||
|
||||
class AManaProducer: public MTGAbility{
|
||||
protected:
|
||||
ManaCost * cost;
|
||||
@@ -2643,6 +2650,54 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//Stasis
|
||||
class AStasis:public ActivatedAbility{
|
||||
public:
|
||||
int paidThisTurn;
|
||||
AStasis(int _id, MTGCardInstance * card):ActivatedAbility(_id,card, NEW ManaCost(),1,0){
|
||||
paidThisTurn = 1;
|
||||
cost->add(MTG_COLOR_BLUE,1);
|
||||
}
|
||||
|
||||
void Update(float dt){
|
||||
//Upkeep Cost
|
||||
if (newPhase !=currentPhase){
|
||||
if (newPhase == MTG_PHASE_UPKEEP){
|
||||
paidThisTurn = 0;
|
||||
}else if (!paidThisTurn && newPhase > MTG_PHASE_UPKEEP && game->currentPlayer==source->controller() ){
|
||||
game->currentPlayer->game->putInGraveyard(source);
|
||||
paidThisTurn = 1;
|
||||
}
|
||||
}
|
||||
//Stasis Effect
|
||||
for (int i = 0; i < 2; i++){
|
||||
game->phaseRing->removePhase(MTG_PHASE_UNTAP,game->players[i]);
|
||||
}
|
||||
|
||||
//Parent Class Method Call
|
||||
ActivatedAbility::Update(dt);
|
||||
}
|
||||
|
||||
int isReactingToClick(MTGCardInstance * card){
|
||||
return (!paidThisTurn && currentPhase == MTG_PHASE_UPKEEP && ActivatedAbility::isReactingToClick(card));
|
||||
}
|
||||
|
||||
int resolve(){
|
||||
paidThisTurn = 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int destroy(){
|
||||
for (int i = 0; i < 2; i++){
|
||||
game->phaseRing->addPhaseBefore(MTG_PHASE_UNTAP,game->players[i],MTG_PHASE_UPKEEP,game->players[i]);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
//--------------Addon Abra------------------
|
||||
//ShieldOfTheAge
|
||||
class AShieldOfTheAge: public TargetAbility{
|
||||
|
||||
@@ -8,10 +8,15 @@ A Filter/Mask system for Card Instances to find cards matching specific settings
|
||||
#include "MTGCardInstance.h"
|
||||
#include "MTGGameZones.h"
|
||||
|
||||
#define CD_OR 1
|
||||
#define CD_AND 2
|
||||
|
||||
class CardDescriptor: public MTGCardInstance{
|
||||
protected:
|
||||
|
||||
MTGCardInstance * match_or(MTGCardInstance * card);
|
||||
MTGCardInstance * match_and(MTGCardInstance * card);
|
||||
public:
|
||||
int mode;
|
||||
int init();
|
||||
CardDescriptor();
|
||||
MTGCardInstance * match(MTGCardInstance * card);
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "PlayGuiObject.h"
|
||||
#include "DuelLayers.h"
|
||||
#include "TargetChooser.h"
|
||||
#include "PhaseRing.h"
|
||||
|
||||
#define MAX_GAME_OBSERVERS 500
|
||||
|
||||
@@ -33,6 +34,7 @@ class GameObserver{
|
||||
|
||||
int targetListIsSet(MTGCardInstance * card);
|
||||
public:
|
||||
PhaseRing * phaseRing;
|
||||
int cancelCurrentAction();
|
||||
int currentGamePhase;
|
||||
int oldGamePhase;
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
|
||||
static char MTGColorChars[] = {'x','g','u','r','b','w','l'};
|
||||
static const char * MTGColorStrings[] = {"artifact", "green", "blue", "red", "black", "white", "land"};
|
||||
|
||||
static int _r[7] = {75, 20, 20, 200,50,255,128};
|
||||
static int _g[7] = {30, 140, 30, 15, 50,255,128};
|
||||
static int _b[7] = {20, 0, 140,15, 50,255,128};
|
||||
@@ -37,20 +39,22 @@ static int _b[7] = {20, 0, 140,15, 50,255,128};
|
||||
|
||||
|
||||
|
||||
#define MTG_PHASE_UNTAP 0
|
||||
#define MTG_PHASE_UPKEEP 1
|
||||
#define MTG_PHASE_DRAW 2
|
||||
#define MTG_PHASE_FIRSTMAIN 3
|
||||
#define MTG_PHASE_COMBATBEGIN 4
|
||||
#define MTG_PHASE_COMBATATTACKERS 5
|
||||
#define MTG_PHASE_COMBATBLOCKERS 6
|
||||
#define MTG_PHASE_COMBATDAMAGE 7
|
||||
#define MTG_PHASE_COMBATEND 8
|
||||
#define MTG_PHASE_SECONDMAIN 9
|
||||
#define MTG_PHASE_ENDOFTURN 10
|
||||
#define MTG_PHASE_EOT 10
|
||||
#define MTG_PHASE_CLEANUP 11
|
||||
|
||||
#define MTG_PHASE_BEFORE_BEGIN 0
|
||||
#define MTG_PHASE_UNTAP 1
|
||||
#define MTG_PHASE_UPKEEP 2
|
||||
#define MTG_PHASE_DRAW 3
|
||||
#define MTG_PHASE_FIRSTMAIN 4
|
||||
#define MTG_PHASE_COMBATBEGIN 5
|
||||
#define MTG_PHASE_COMBATATTACKERS 6
|
||||
#define MTG_PHASE_COMBATBLOCKERS 7
|
||||
#define MTG_PHASE_COMBATDAMAGE 8
|
||||
#define MTG_PHASE_COMBATEND 9
|
||||
#define MTG_PHASE_SECONDMAIN 10
|
||||
#define MTG_PHASE_ENDOFTURN 11
|
||||
#define MTG_PHASE_EOT 11
|
||||
#define MTG_PHASE_CLEANUP 12
|
||||
#define MTG_PHASE_AFTER_EOT 13
|
||||
#define NB_MTG_PHASES 14
|
||||
|
||||
#define TRAMPLE 0
|
||||
#define FORESTWALK 1
|
||||
@@ -145,6 +149,7 @@ static const char * MTGBasicAbilities[] = {
|
||||
|
||||
static const char *MTGPhaseNames[] =
|
||||
{
|
||||
"---",
|
||||
"Untap",
|
||||
"Upkeep",
|
||||
"Draw",
|
||||
@@ -156,7 +161,8 @@ static const char *MTGPhaseNames[] =
|
||||
"Combat ends",
|
||||
"Main phase 2",
|
||||
"End of turn",
|
||||
"cleanup"
|
||||
"cleanup",
|
||||
"---"
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class Player: public Damageable, public Targetable{
|
||||
ManaCost * getManaPool();
|
||||
int manaBurn();
|
||||
void cleanupPhase();
|
||||
virtual int Act(){return 0;};
|
||||
virtual int Act(float dt){return 0;};
|
||||
virtual int isAI(){return 0;};
|
||||
Player * opponent();
|
||||
int getId();
|
||||
|
||||
@@ -18,6 +18,7 @@ class MTGGameZone;
|
||||
class Player;
|
||||
class Damageable;
|
||||
class Targetable;
|
||||
class CardDescriptor;
|
||||
|
||||
|
||||
|
||||
@@ -96,6 +97,14 @@ public:
|
||||
virtual int canTarget(Targetable * targe);
|
||||
};
|
||||
|
||||
class DescriptorTargetChooser:public TargetZoneChooser{
|
||||
public:
|
||||
CardDescriptor * cd;
|
||||
DescriptorTargetChooser(CardDescriptor * _cd, MTGCardInstance * card = NULL, int _maxtargets = 1);
|
||||
DescriptorTargetChooser(CardDescriptor * _cd, MTGGameZone ** _zones, int nbzones, MTGCardInstance * card = NULL, int _maxtargets = 1);
|
||||
virtual int canTarget(Targetable * target);
|
||||
};
|
||||
|
||||
|
||||
class SpellTargetChooser:public TargetChooser{
|
||||
public:
|
||||
|
||||
@@ -47,6 +47,7 @@ public:
|
||||
};
|
||||
class TestSuite{
|
||||
public:
|
||||
float timerLimit;
|
||||
int currentAction;
|
||||
TestSuiteState initState;
|
||||
TestSuiteState endState;
|
||||
@@ -72,9 +73,9 @@ public:
|
||||
class TestSuiteAI:public AIPlayer{
|
||||
public:
|
||||
TestSuite * suite;
|
||||
int timer;
|
||||
float timer;
|
||||
TestSuiteAI(MTGAllCards * collection,TestSuite * suite, int playerId);
|
||||
virtual int Act();
|
||||
virtual int Act(float dt);
|
||||
virtual int displayStack(){return 1;}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user