- 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:
laurent.rabouin
2008-11-12 08:23:39 +00:00
parent 90238d8269
commit 6ad6f9b668
5 changed files with 419 additions and 157 deletions
+170 -1
View File
@@ -2715,7 +2715,6 @@ public:
};
// GiveLifeForTappedType
class AGiveLifeForTappedType:public MTGAbility{
public:
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
class AMinionofLeshrac: public TargetAbility{
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