- Fixed Shadow Ability now works properly
- Added Generic KirdApe give P/W modifier when cards inplay - Added Rampage (WIP) does not work at the moment - Added Cards from diverse Sets
This commit is contained in:
+147
-147
@@ -2,150 +2,150 @@
|
|||||||
* Wagic, The Homebrew ?! is licensed under the BSD license
|
* Wagic, The Homebrew ?! is licensed under the BSD license
|
||||||
* See LICENSE in the Folder's root
|
* See LICENSE in the Folder's root
|
||||||
* http://wololo.net/wagic/
|
* http://wololo.net/wagic/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SPELLSTACK_H_
|
#ifndef _SPELLSTACK_H_
|
||||||
#define _SPELLSTACK_H_
|
#define _SPELLSTACK_H_
|
||||||
|
|
||||||
#define MAX_SPELL_TARGETS 10
|
#define MAX_SPELL_TARGETS 10
|
||||||
|
|
||||||
|
|
||||||
#define ACTION_SPELL 10
|
#define ACTION_SPELL 10
|
||||||
#define ACTION_DAMAGE 11
|
#define ACTION_DAMAGE 11
|
||||||
#define ACTION_DAMAGES 12
|
#define ACTION_DAMAGES 12
|
||||||
#define ACTION_NEXTGAMEPHASE 13
|
#define ACTION_NEXTGAMEPHASE 13
|
||||||
#define ACTION_DRAW 14
|
#define ACTION_DRAW 14
|
||||||
#define ACTION_PUTINGRAVEYARD 15
|
#define ACTION_PUTINGRAVEYARD 15
|
||||||
#define ACTION_ABILITY 16
|
#define ACTION_ABILITY 16
|
||||||
|
|
||||||
#define NOT_RESOLVED -2
|
#define NOT_RESOLVED -2
|
||||||
#define RESOLVED_OK 1
|
#define RESOLVED_OK 1
|
||||||
#define RESOLVED_NOK -1
|
#define RESOLVED_NOK -1
|
||||||
|
|
||||||
#include "../include/PlayGuiObject.h"
|
#include "../include/PlayGuiObject.h"
|
||||||
#include "GuiLayers.h"
|
#include "GuiLayers.h"
|
||||||
#include "../include/TargetsList.h"
|
#include "../include/TargetsList.h"
|
||||||
#include "../include/Targetable.h"
|
#include "../include/Targetable.h"
|
||||||
|
|
||||||
class GuiLayer;
|
class GuiLayer;
|
||||||
class PlayGuiObject;
|
class PlayGuiObject;
|
||||||
class MTGCardInstance;
|
class MTGCardInstance;
|
||||||
class GameObserver;
|
class GameObserver;
|
||||||
class Player;
|
class Player;
|
||||||
class Damageable;
|
class Damageable;
|
||||||
class MTGAbility;
|
class MTGAbility;
|
||||||
class Targetable;
|
class Targetable;
|
||||||
class DamageStack;
|
class DamageStack;
|
||||||
class ManaCost;
|
class ManaCost;
|
||||||
|
|
||||||
|
|
||||||
#define ACTIONSTACK_STANDARD 0
|
#define ACTIONSTACK_STANDARD 0
|
||||||
#define ACTIONSTACK_TARGET 1
|
#define ACTIONSTACK_TARGET 1
|
||||||
|
|
||||||
class Interruptible: public PlayGuiObject, public Targetable{
|
class Interruptible: public PlayGuiObject, public Targetable{
|
||||||
public:
|
public:
|
||||||
int state, display;
|
int state, display;
|
||||||
MTGCardInstance * source;
|
MTGCardInstance * source;
|
||||||
virtual void Entering(){mHasFocus = true;};
|
virtual void Entering(){mHasFocus = true;};
|
||||||
virtual bool Leaving(u32 key){mHasFocus = false;return true;};
|
virtual bool Leaving(u32 key){mHasFocus = false;return true;};
|
||||||
virtual bool ButtonPressed(){return true;};
|
virtual bool ButtonPressed(){return true;};
|
||||||
virtual int resolve(){return 0;};
|
virtual int resolve(){return 0;};
|
||||||
virtual void Render(){};
|
virtual void Render(){};
|
||||||
int typeAsTarget(){return TARGET_STACKACTION;};
|
int typeAsTarget(){return TARGET_STACKACTION;};
|
||||||
Interruptible(int id,bool hasFocus = false):PlayGuiObject(id,40,x,y,hasFocus){state=NOT_RESOLVED;display=0;source=NULL;};
|
Interruptible(int id,bool hasFocus = false):PlayGuiObject(id,40,x,y,hasFocus){state=NOT_RESOLVED;display=0;source=NULL;};
|
||||||
};
|
};
|
||||||
|
|
||||||
class NextGamePhase: public Interruptible {
|
class NextGamePhase: public Interruptible {
|
||||||
public:
|
public:
|
||||||
int resolve();
|
int resolve();
|
||||||
void Render();
|
void Render();
|
||||||
NextGamePhase(int id);
|
NextGamePhase(int id);
|
||||||
};
|
};
|
||||||
|
|
||||||
class Spell: public Interruptible, public TargetsList {
|
class Spell: public Interruptible, public TargetsList {
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ManaCost * cost;
|
ManaCost * cost;
|
||||||
Spell(MTGCardInstance* _source);
|
Spell(MTGCardInstance* _source);
|
||||||
Spell(int id, MTGCardInstance* _source, Targetable * _targets[], int _nbtargets, ManaCost * _cost);
|
Spell(int id, MTGCardInstance* _source, Targetable * _targets[], int _nbtargets, ManaCost * _cost);
|
||||||
~Spell();
|
~Spell();
|
||||||
int resolve();
|
int resolve();
|
||||||
void Render();
|
void Render();
|
||||||
};
|
};
|
||||||
|
|
||||||
class StackAbility: public Interruptible {
|
class StackAbility: public Interruptible {
|
||||||
public:
|
public:
|
||||||
MTGAbility * ability;
|
MTGAbility * ability;
|
||||||
int resolve();
|
int resolve();
|
||||||
void Render();
|
void Render();
|
||||||
StackAbility(int id, MTGAbility * _ability);
|
StackAbility(int id, MTGAbility * _ability);
|
||||||
};
|
};
|
||||||
|
|
||||||
class PutInGraveyard: public Interruptible {
|
class PutInGraveyard: public Interruptible {
|
||||||
public:
|
public:
|
||||||
MTGCardInstance * card;
|
MTGCardInstance * card;
|
||||||
int removeFromGame;
|
int removeFromGame;
|
||||||
int resolve();
|
int resolve();
|
||||||
void Render();
|
void Render();
|
||||||
PutInGraveyard(int id, MTGCardInstance * _card);
|
PutInGraveyard(int id, MTGCardInstance * _card);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class DrawAction: public Interruptible {
|
class DrawAction: public Interruptible {
|
||||||
public:
|
public:
|
||||||
int nbcards;
|
int nbcards;
|
||||||
Player * player;
|
Player * player;
|
||||||
int resolve();
|
int resolve();
|
||||||
void Render();
|
void Render();
|
||||||
DrawAction(int id, Player * _player, int _nbcards);
|
DrawAction(int id, Player * _player, int _nbcards);
|
||||||
};
|
};
|
||||||
|
|
||||||
class ActionStack :public GuiLayer{
|
class ActionStack :public GuiLayer{
|
||||||
protected:
|
protected:
|
||||||
int interruptDecision[2];
|
int interruptDecision[2];
|
||||||
int timer;
|
int timer;
|
||||||
int currentState;
|
int currentState;
|
||||||
int mode;
|
int mode;
|
||||||
int checked;
|
int checked;
|
||||||
|
|
||||||
|
|
||||||
void unpackDamageStacks();
|
void unpackDamageStacks();
|
||||||
void unpackDamageStack(DamageStack * ds);
|
void unpackDamageStack(DamageStack * ds);
|
||||||
void repackDamageStacks();
|
void repackDamageStacks();
|
||||||
public:
|
public:
|
||||||
int setIsInterrupting(Player * player);
|
int setIsInterrupting(Player * player);
|
||||||
int count( int type = 0 , int state = 0 , int display = -1);
|
int count( int type = 0 , int state = 0 , int display = -1);
|
||||||
Interruptible * getPrevious(Interruptible * next, int type = 0, int state = 0 , int display = -1);
|
Interruptible * getPrevious(Interruptible * next, int type = 0, int state = 0 , int display = -1);
|
||||||
int getPreviousIndex(Interruptible * next, int type = 0, int state = 0 , int display = -1);
|
int getPreviousIndex(Interruptible * next, int type = 0, int state = 0 , int display = -1);
|
||||||
Interruptible * getNext(Interruptible * previous, int type = 0, int state = 0 , int display = -1);
|
Interruptible * getNext(Interruptible * previous, int type = 0, int state = 0 , int display = -1);
|
||||||
int getNextIndex(Interruptible * previous, int type = 0, int state = 0 , int display = -1);
|
int getNextIndex(Interruptible * previous, int type = 0, int state = 0 , int display = -1);
|
||||||
void Fizzle(Interruptible * action);
|
void Fizzle(Interruptible * action);
|
||||||
Interruptible * _(int id);
|
Interruptible * _(int id);
|
||||||
void cancelInterruptOffer(int cancelMode = 1);
|
void cancelInterruptOffer(int cancelMode = 1);
|
||||||
void endOfInterruption();
|
void endOfInterruption();
|
||||||
Interruptible * getLatest(int state);
|
Interruptible * getLatest(int state);
|
||||||
Player * askIfWishesToInterrupt;
|
Player * askIfWishesToInterrupt;
|
||||||
int garbageCollect();
|
int garbageCollect();
|
||||||
int addAction(Interruptible * interruptible);
|
int addAction(Interruptible * interruptible);
|
||||||
int addSpell(MTGCardInstance* card, Targetable * targets[], int nbtargets, ManaCost * mana);
|
int addSpell(MTGCardInstance* card, Targetable * targets[], int nbtargets, ManaCost * mana);
|
||||||
int AddNextGamePhase();
|
int AddNextGamePhase();
|
||||||
int addPutInGraveyard(MTGCardInstance * card);
|
int addPutInGraveyard(MTGCardInstance * card);
|
||||||
int addDraw(Player * player, int nbcards = 1);
|
int addDraw(Player * player, int nbcards = 1);
|
||||||
int addDamage(MTGCardInstance * _source, Damageable * target, int _damage);
|
int addDamage(MTGCardInstance * _source, Damageable * target, int _damage);
|
||||||
int addAbility(MTGAbility * ability);
|
int addAbility(MTGAbility * ability);
|
||||||
void Update(float dt);
|
void Update(float dt);
|
||||||
void CheckUserInput(float dt);
|
void CheckUserInput(float dt);
|
||||||
virtual void Render();
|
virtual void Render();
|
||||||
ActionStack(int id, GameObserver* _game);
|
ActionStack(int id, GameObserver* _game);
|
||||||
int resolve();
|
int resolve();
|
||||||
int CombatDamages();
|
int CombatDamages();
|
||||||
int CombatDamages(int firststrike);
|
int CombatDamages(int firststrike);
|
||||||
int has(Interruptible * action);
|
int has(Interruptible * action);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -2715,7 +2715,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// GiveLifeForTappedType
|
// GiveLifeForTappedType
|
||||||
|
|
||||||
class AGiveLifeForTappedType:public MTGAbility{
|
class AGiveLifeForTappedType:public MTGAbility{
|
||||||
public:
|
public:
|
||||||
char type[20];
|
char type[20];
|
||||||
@@ -2746,6 +2745,67 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// People of the Woods
|
||||||
|
class APeopleOfTheWoods:public ListMaintainerAbility{
|
||||||
|
public:
|
||||||
|
APeopleOfTheWoods(int _id, MTGCardInstance * _source):ListMaintainerAbility(_id, _source){
|
||||||
|
}
|
||||||
|
|
||||||
|
int canBeInList(MTGCardInstance * card){
|
||||||
|
if (source->controller()->game->inPlay->hasCard(card) && card->hasType("forest") ) return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int added(MTGCardInstance * card){
|
||||||
|
source->addToToughness(1);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int removed(MTGCardInstance * card){
|
||||||
|
source->addToToughness(-1);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
//Abomination Kill blocking creature if white or green
|
||||||
|
class AAbomination :public MTGAbility{
|
||||||
|
public:
|
||||||
|
MTGCardInstance * opponents[20];
|
||||||
|
int nbOpponents;
|
||||||
|
AAbomination (int _id, MTGCardInstance * _source):MTGAbility(_id, _source){
|
||||||
|
nbOpponents = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Update(float dt){
|
||||||
|
if (newPhase != currentPhase){
|
||||||
|
if( newPhase == MTG_PHASE_COMBATDAMAGE){
|
||||||
|
nbOpponents = 0;
|
||||||
|
MTGCardInstance * opponent = source->getNextOpponent();
|
||||||
|
while (opponent && opponent->hasColor(MTG_COLOR_GREEN) || opponent->hasColor(MTG_COLOR_WHITE)){
|
||||||
|
opponents[nbOpponents] = opponent;
|
||||||
|
nbOpponents ++;
|
||||||
|
opponent = source->getNextOpponent(opponent);
|
||||||
|
}
|
||||||
|
}else if (newPhase == MTG_PHASE_COMBATEND){
|
||||||
|
for (int i = 0; i < nbOpponents ; i++){
|
||||||
|
game->mLayers->stackLayer()->addPutInGraveyard(opponents[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int testDestroy(){
|
||||||
|
if(!game->isInPlay(source) && currentPhase != MTG_PHASE_UNTAP){
|
||||||
|
return 0;
|
||||||
|
}else{
|
||||||
|
return MTGAbility::testDestroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Minion of Leshrac
|
//Minion of Leshrac
|
||||||
class AMinionofLeshrac: public TargetAbility{
|
class AMinionofLeshrac: public TargetAbility{
|
||||||
public:
|
public:
|
||||||
@@ -2808,5 +2868,114 @@ public:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//CreaturePowerToughnessModifierForAllTypeControlled
|
||||||
|
class ACreaturePowerToughnessModifierForAllTypeControlled:public ListMaintainerAbility{
|
||||||
|
public:
|
||||||
|
char type[20];
|
||||||
|
ACreaturePowerToughnessModifierForAllTypeControlled(int _id, MTGCardInstance * _source, const char * _type):ListMaintainerAbility(_id, _source){
|
||||||
|
}
|
||||||
|
|
||||||
|
int canBeInList(MTGCardInstance * card){
|
||||||
|
if (source->controller()->game->inPlay->hasCard(card) && card->hasType(type) ) return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int added(MTGCardInstance * card){
|
||||||
|
source->power += 1;
|
||||||
|
source->addToToughness(1);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int removed(MTGCardInstance * card){
|
||||||
|
source->power -= 1;
|
||||||
|
source->addToToughness(-1);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
//GenericKirdApe
|
||||||
|
class AGenericKirdApe:public MTGAbility{
|
||||||
|
public:
|
||||||
|
int init;
|
||||||
|
char type [20];
|
||||||
|
int power;
|
||||||
|
int toughness;
|
||||||
|
AGenericKirdApe(int _id, MTGCardInstance * _source, const char * _type, int _power, int _toughness):MTGAbility(_id, _source){
|
||||||
|
init = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Update(float dt){
|
||||||
|
if (source->controller()->game->inPlay->hasType(type)){
|
||||||
|
if(!init){
|
||||||
|
init = 1;
|
||||||
|
source->power+=power;
|
||||||
|
source->addToToughness(toughness);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if (init){
|
||||||
|
init = 0;
|
||||||
|
source->power-=power;
|
||||||
|
source->addToToughness(-toughness);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//Rampage ability Tentative 2
|
||||||
|
class ARampageAbility:public MTGAbility{
|
||||||
|
public:
|
||||||
|
int nbOpponents;
|
||||||
|
int PowerModifier;
|
||||||
|
int ToughnessModifier;
|
||||||
|
int modifier;
|
||||||
|
ARampageAbility(int _id, MTGCardInstance * _source,int _PowerModifier, int _ToughnessModifier):MTGAbility(_id, _source){
|
||||||
|
modifier=0;
|
||||||
|
}
|
||||||
|
void Update(float dt){
|
||||||
|
if (source->isAttacker()){
|
||||||
|
MTGInPlay * inPlay = game->opponent()->game->inPlay;
|
||||||
|
for (int i = 0; i < inPlay->nb_cards; i ++){
|
||||||
|
MTGCardInstance * current = inPlay->cards[i];
|
||||||
|
if (current->isDefenser()){
|
||||||
|
modifier++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
source->power+= (PowerModifier * modifier);
|
||||||
|
source->addToToughness(ToughnessModifier * modifier);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//Rampage ability Tentative 1 - Did not work as expected
|
||||||
|
class A1RampageAbility:public MTGAbility{
|
||||||
|
public:
|
||||||
|
MTGCardInstance * opponents[20];
|
||||||
|
int nbOpponents;
|
||||||
|
int PowerModifier;
|
||||||
|
int ToughnessModifier;
|
||||||
|
A1RampageAbility(int _id, MTGCardInstance * _source,int _PowerModifier, int _ToughnessModifier):MTGAbility(_id, _source){
|
||||||
|
nbOpponents = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Update(float dt){
|
||||||
|
if (source->isAttacker()){
|
||||||
|
if (newPhase != currentPhase){
|
||||||
|
if( newPhase == MTG_PHASE_COMBATDAMAGE){
|
||||||
|
nbOpponents = 0;
|
||||||
|
MTGCardInstance * opponent = source->getNextOpponent();
|
||||||
|
while (opponent){
|
||||||
|
opponents[nbOpponents] = opponent;
|
||||||
|
nbOpponents ++;
|
||||||
|
source->power+= PowerModifier;
|
||||||
|
source->addToToughness(ToughnessModifier);
|
||||||
|
opponent = source->getNextOpponent(opponent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -93,8 +93,10 @@ static int _b[7] = {20, 0, 140,15, 50,255,128};
|
|||||||
#define MOUNTAINHOME 33
|
#define MOUNTAINHOME 33
|
||||||
#define SWAMPHOME 34
|
#define SWAMPHOME 34
|
||||||
#define PLAINSHOME 35
|
#define PLAINSHOME 35
|
||||||
|
#define FLANKING 36
|
||||||
|
#define RAMPAGE1 37
|
||||||
|
|
||||||
#define NB_BASIC_ABILITIES 36
|
#define NB_BASIC_ABILITIES 38
|
||||||
|
|
||||||
static const char * MTGBasicAbilities[] = {
|
static const char * MTGBasicAbilities[] = {
|
||||||
"trample",
|
"trample",
|
||||||
@@ -132,7 +134,9 @@ static const char * MTGBasicAbilities[] = {
|
|||||||
"islandhome",
|
"islandhome",
|
||||||
"moutainhome",
|
"moutainhome",
|
||||||
"swamphome",
|
"swamphome",
|
||||||
"plainshome"
|
"plainshome",
|
||||||
|
"flanking",
|
||||||
|
"rampage",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -154,6 +154,17 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
|
|||||||
result++;
|
result++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
//Tentative Destroyall not working char is not compatible with string variable
|
||||||
|
//found = s.find("destroyall(");
|
||||||
|
//if (found != string::npos){
|
||||||
|
// if (dryMode) return BAKA_EFFECT_GOOD;
|
||||||
|
// unsigned int end = s.find(")", found+11);
|
||||||
|
// if (end != string::npos){
|
||||||
|
// string type = s.substr(found+11,end-found-11).c_str();
|
||||||
|
// destroyAllFromTypeInPlay(type.c_str(), card);
|
||||||
|
// result++;
|
||||||
|
// continue;
|
||||||
|
//}
|
||||||
|
|
||||||
//Regeneration
|
//Regeneration
|
||||||
found = s.find("}:regenerate");
|
found = s.find("}:regenerate");
|
||||||
@@ -200,6 +211,10 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Summon
|
||||||
|
|
||||||
|
//Reveal Take Target and put in in hand (should be also able to target hand since some card needs you to reveal a card in your hand
|
||||||
|
|
||||||
//Damage
|
//Damage
|
||||||
found = s.find("damage");
|
found = s.find("damage");
|
||||||
if (found != string::npos){
|
if (found != string::npos){
|
||||||
@@ -959,8 +974,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
{
|
{
|
||||||
MTGPlayerCards * zones = card->target->controller()->game;
|
MTGPlayerCards * zones = card->target->controller()->game;
|
||||||
zones->putInZone(card->target,zones->inPlay,zones->hand);
|
zones->putInZone(card->target,zones->inPlay,zones->hand);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
case 1235: //Aspect of Wolf
|
case 1235: //Aspect of Wolf
|
||||||
{
|
{
|
||||||
@@ -1256,6 +1270,77 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Addons ALA
|
||||||
|
|
||||||
|
case 175114: // Master of Etherium
|
||||||
|
{
|
||||||
|
game->addObserver(NEW ACreaturePowerToughnessModifierForAllTypeControlled(_id,card,"artifact"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 174989: // Wild Nacatl
|
||||||
|
{
|
||||||
|
game->addObserver(NEW AGenericKirdApe(_id,card,"plains",1,1));
|
||||||
|
game->addObserver(NEW AGenericKirdApe(_id,card,"moutain",1,1));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Addons The Dark
|
||||||
|
|
||||||
|
case 1797: //Inferno does 6 damage to all players and all creatures.
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 2 ; i++){
|
||||||
|
game->mLayers->stackLayer()->addDamage(card, game->players[i], 6);
|
||||||
|
for (int j = 0; j < game->players[i]->game->inPlay->nb_cards; j++){
|
||||||
|
MTGCardInstance * current = game->players[i]->game->inPlay->cards[j];
|
||||||
|
if (current->isACreature()){
|
||||||
|
game->mLayers->stackLayer()->addDamage(card, current, 6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 1773 : //People of the Woods
|
||||||
|
{
|
||||||
|
game->addObserver(NEW APeopleOfTheWoods(_id, card));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 1818: //Tivadar's Crusade
|
||||||
|
{
|
||||||
|
destroyAllFromTypeInPlay("goblin", card);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Addons Legends
|
||||||
|
case 1470: //Acid Rain
|
||||||
|
{
|
||||||
|
destroyAllFromTypeInPlay("forest", card);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1427: //Abomination
|
||||||
|
{
|
||||||
|
game->addObserver(NEW AAbomination(_id,card));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1533: //Livingplane
|
||||||
|
{
|
||||||
|
game->addObserver(NEW AConvertLandToCreatures(id, card, "land"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1607: //Divine Offering
|
||||||
|
{
|
||||||
|
card->target->controller()->game->putInGraveyard(card->target);
|
||||||
|
game->currentlyActing()->life+= card->target->getManaCost()->getConvertedCost();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1625: //Lifeblood
|
||||||
|
{
|
||||||
|
game->addObserver(NEW AGiveLifeForTappedType (_id, card, "island"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
//Addons ICE-AGE Cards
|
//Addons ICE-AGE Cards
|
||||||
case 2631: //Jokulhaups
|
case 2631: //Jokulhaups
|
||||||
{
|
{
|
||||||
@@ -1385,6 +1470,12 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
if (card->basicAbilities[PLAINSHOME]){
|
if (card->basicAbilities[PLAINSHOME]){
|
||||||
game->addObserver(NEW AStrongLandLinkCreature(_id, card,"plains"));
|
game->addObserver(NEW AStrongLandLinkCreature(_id, card,"plains"));
|
||||||
}
|
}
|
||||||
|
// New Abilities Flanking and Rampage
|
||||||
|
|
||||||
|
if (card->basicAbilities [RAMPAGE1]){
|
||||||
|
game->addObserver (NEW ARampageAbility(_id, card, 1, 1));
|
||||||
|
}
|
||||||
|
|
||||||
//Instants are put in the graveyard automatically if that's not already done
|
//Instants are put in the graveyard automatically if that's not already done
|
||||||
if (!putSourceInGraveyard){
|
if (!putSourceInGraveyard){
|
||||||
if (card->hasType("instant") || card->hasType("sorcery")){
|
if (card->hasType("instant") || card->hasType("sorcery")){
|
||||||
|
|||||||
@@ -233,23 +233,22 @@ int MTGCardInstance::setToughness(int value){
|
|||||||
|
|
||||||
int MTGCardInstance::canBlock(){
|
int MTGCardInstance::canBlock(){
|
||||||
if (!tapped && isACreature())return 1;
|
if (!tapped && isACreature())return 1;
|
||||||
if (!basicAbilities[SHADOW]&& isACreature()) return 1; // Try to add shadow
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int MTGCardInstance::canBlock(MTGCardInstance * opponent){
|
int MTGCardInstance::canBlock(MTGCardInstance * opponent){
|
||||||
if (!canBlock()) return 0;
|
if (!canBlock()) return 0;
|
||||||
if (!opponent) return 1;
|
if (!opponent) return 1;
|
||||||
if (!opponent->isAttacker()) return 0;
|
if (!opponent->isAttacker()) return 0;
|
||||||
|
|
||||||
// Comprehensive rule 502.7f : If a creature with protection attacks, it can't be blocked by creatures that have the stated quality.
|
// Comprehensive rule 502.7f : If a creature with protection attacks, it can't be blocked by creatures that have the stated quality.
|
||||||
if (opponent->protectedAgainst(this)) return 0;
|
if (opponent->protectedAgainst(this)) return 0;
|
||||||
|
|
||||||
if (opponent->basicAbilities[UNBLOCKABLE]) return 0;
|
if (opponent->basicAbilities[UNBLOCKABLE]) return 0;
|
||||||
if (opponent->basicAbilities[FEAR] && !(hasColor(MTG_COLOR_ARTIFACT) || hasColor(MTG_COLOR_BLACK))) return 0;
|
if (opponent->basicAbilities[FEAR] && !(hasColor(MTG_COLOR_ARTIFACT) || hasColor(MTG_COLOR_BLACK))) return 0;
|
||||||
if (opponent->basicAbilities[FLYING] && !( basicAbilities[FLYING] || basicAbilities[REACH])) return 0;
|
if (opponent->basicAbilities[FLYING] && !( basicAbilities[FLYING] || basicAbilities[REACH])) return 0;
|
||||||
|
// If opponent has shadow and a creature does not have either shadow or reachshadow it cannot be blocked
|
||||||
if (opponent->basicAbilities[SHADOW] && !( basicAbilities[SHADOW] || basicAbilities[REACHSHADOW])) return 0;
|
if (opponent->basicAbilities[SHADOW] && !( basicAbilities[SHADOW] || basicAbilities[REACHSHADOW])) return 0;
|
||||||
|
// If opponent does not have shadow and a creature has shadow it cannot be blocked
|
||||||
|
if (!opponent->basicAbilities[SHADOW] && basicAbilities[SHADOW]) return 0;
|
||||||
if (opponent->basicAbilities[SWAMPWALK] && controller()->game->inPlay->hasType("swamp")) return 0;
|
if (opponent->basicAbilities[SWAMPWALK] && controller()->game->inPlay->hasType("swamp")) return 0;
|
||||||
if (opponent->basicAbilities[FORESTWALK] && controller()->game->inPlay->hasType("forest")) return 0;
|
if (opponent->basicAbilities[FORESTWALK] && controller()->game->inPlay->hasType("forest")) return 0;
|
||||||
if (opponent->basicAbilities[ISLANDWALK] && controller()->game->inPlay->hasType("island")) return 0;
|
if (opponent->basicAbilities[ISLANDWALK] && controller()->game->inPlay->hasType("island")) return 0;
|
||||||
@@ -258,7 +257,6 @@ int MTGCardInstance::canBlock(MTGCardInstance * opponent){
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MTGCardInstance * MTGCardInstance::getNextPartner(){
|
MTGCardInstance * MTGCardInstance::getNextPartner(){
|
||||||
MTGInPlay * inplay = controller()->game->inPlay;
|
MTGInPlay * inplay = controller()->game->inPlay;
|
||||||
MTGCardInstance * bandingPartner = inplay->getNextAttacker(banding);
|
MTGCardInstance * bandingPartner = inplay->getNextAttacker(banding);
|
||||||
|
|||||||
Reference in New Issue
Block a user