Erwan
- fix issue 143 (exalted should be a triggered ability)
This commit is contained in:
@@ -14,6 +14,8 @@ generic/equip_shroud.txt
|
|||||||
generic/equip_shroud2.txt
|
generic/equip_shroud2.txt
|
||||||
generic/equip_wither.txt
|
generic/equip_wither.txt
|
||||||
generic/equipment_i252.txt
|
generic/equipment_i252.txt
|
||||||
|
generic/exalted.txt
|
||||||
|
generic/exalted_i143.txt
|
||||||
generic/fear.txt
|
generic/fear.txt
|
||||||
generic/fear_i147.txt
|
generic/fear_i147.txt
|
||||||
generic/first_and_double_strike1_i187.txt
|
generic/first_and_double_strike1_i187.txt
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
#Testing exalted
|
||||||
|
[INIT]
|
||||||
|
COMBATATTACKERS
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:sigiled paladin,grizzly bears
|
||||||
|
[PLAYER2]
|
||||||
|
[DO]
|
||||||
|
grizzly bears
|
||||||
|
eot
|
||||||
|
eot
|
||||||
|
next
|
||||||
|
#upkeep
|
||||||
|
next
|
||||||
|
#draw
|
||||||
|
next
|
||||||
|
#main
|
||||||
|
next
|
||||||
|
#cb begins
|
||||||
|
next
|
||||||
|
#attackers
|
||||||
|
grizzly bears
|
||||||
|
sigiled paladin
|
||||||
|
next
|
||||||
|
#blockers
|
||||||
|
next
|
||||||
|
#damage 1st strike
|
||||||
|
next
|
||||||
|
#damage 2
|
||||||
|
next
|
||||||
|
#combat end
|
||||||
|
[ASSERT]
|
||||||
|
COMBATEND
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:sigiled paladin,grizzly bears
|
||||||
|
[PLAYER2]
|
||||||
|
life:13
|
||||||
|
[END]
|
||||||
-2
@@ -10,10 +10,8 @@
|
|||||||
combatattackers
|
combatattackers
|
||||||
[PLAYER1]
|
[PLAYER1]
|
||||||
inplay:qasali pridemage,outrider of jhess
|
inplay:qasali pridemage,outrider of jhess
|
||||||
graveyard:
|
|
||||||
[PLAYER2]
|
[PLAYER2]
|
||||||
inplay:white knight
|
inplay:white knight
|
||||||
graveyard:
|
|
||||||
life:7
|
life:7
|
||||||
[DO]
|
[DO]
|
||||||
qasali pridemage
|
qasali pridemage
|
||||||
@@ -1554,51 +1554,47 @@ class ARegularLifeModifierAura:public MTGAbility{
|
|||||||
|
|
||||||
|
|
||||||
//ExaltedAbility (Shards of Alara)
|
//ExaltedAbility (Shards of Alara)
|
||||||
class AExalted:public ListMaintainerAbility{
|
class AExalted:public TriggeredAbility{
|
||||||
public:
|
public:
|
||||||
int power, toughness;
|
int power, toughness;
|
||||||
MTGCardInstance * luckyWinner;
|
MTGCardInstance * luckyWinner;
|
||||||
AExalted(int _id, MTGCardInstance * _source, int _power = 1, int _toughness = 1):ListMaintainerAbility(_id, _source),power(_power),toughness(_toughness){
|
AExalted(int _id, MTGCardInstance * _source, int _power = 1, int _toughness = 1):TriggeredAbility(_id, _source),power(_power),toughness(_toughness){
|
||||||
luckyWinner = NULL;
|
luckyWinner = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int triggerOnEvent(WEvent * event) {
|
||||||
|
if (WEventPhaseChange* pe = dynamic_cast<WEventPhaseChange*>(event)) {
|
||||||
|
if (luckyWinner && Constants::MTG_PHASE_AFTER_EOT == pe->from->id){
|
||||||
|
luckyWinner->addToToughness(-toughness);
|
||||||
|
luckyWinner->power-=power;
|
||||||
|
luckyWinner = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
int canBeInList(MTGCardInstance * card){
|
if (Constants::MTG_PHASE_COMBATATTACKERS == pe->from->id) {
|
||||||
if (card->isAttacker() && game->currentPlayer == source->controller() && game->isInPlay(card)) return 1;
|
int nbattackers = 0;
|
||||||
|
MTGGameZone * z = source->controller()->game->inPlay;
|
||||||
|
int nbcards = z->nb_cards;
|
||||||
|
for (int i = 0; i < nbcards; ++i){
|
||||||
|
MTGCardInstance * c = z->cards[i];
|
||||||
|
if (c->attacker){
|
||||||
|
nbattackers++;
|
||||||
|
luckyWinner = c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (nbattackers == 1) return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int added(MTGCardInstance * card){
|
int resolve(){
|
||||||
if(cards.size() == 1){
|
if (!luckyWinner) return 0;
|
||||||
luckyWinner = cards.begin()->first;
|
luckyWinner->addToToughness(toughness);
|
||||||
luckyWinner->addToToughness(toughness);
|
luckyWinner->power+=power;
|
||||||
luckyWinner->power+=power;
|
|
||||||
}else if (cards.size() == 2){
|
|
||||||
luckyWinner->addToToughness(-toughness);
|
|
||||||
luckyWinner->power-=power;
|
|
||||||
}
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int removed(MTGCardInstance * card){
|
|
||||||
if(cards.size() == 1){
|
|
||||||
luckyWinner = cards.begin()->first;
|
|
||||||
luckyWinner->addToToughness(toughness);
|
|
||||||
luckyWinner->power+=power;
|
|
||||||
}else if (cards.size() == 0){
|
|
||||||
luckyWinner->addToToughness(-toughness);
|
|
||||||
luckyWinner->power-=power;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual ostream& toString(ostream& out) const
|
|
||||||
{
|
|
||||||
out << "AExalted ::: power : " << power
|
|
||||||
<< " ; toughness : " << toughness
|
|
||||||
<< " (";
|
|
||||||
return ListMaintainerAbility::toString(out) << ")";
|
|
||||||
}
|
|
||||||
AExalted * clone() const{
|
AExalted * clone() const{
|
||||||
AExalted * a = NEW AExalted(*this);
|
AExalted * a = NEW AExalted(*this);
|
||||||
a->isClone = 1;
|
a->isClone = 1;
|
||||||
@@ -1606,56 +1602,6 @@ class AExalted:public ListMaintainerAbility{
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//ExaltedAbility for basic abilities (Shards of Alara)
|
|
||||||
class AExaltedAbility:public ListMaintainerAbility{
|
|
||||||
public:
|
|
||||||
int ability;
|
|
||||||
MTGCardInstance * luckyWinner;
|
|
||||||
AExaltedAbility(int _id, MTGCardInstance * _source, int _ability):ListMaintainerAbility(_id, _source),ability(_ability){
|
|
||||||
luckyWinner = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int canBeInList(MTGCardInstance * card){
|
|
||||||
if (card->isAttacker() && game->currentPlayer == source->controller() && game->isInPlay(card)) return 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int added(MTGCardInstance * card){
|
|
||||||
luckyWinner = cards.begin()->first;
|
|
||||||
if(cards.size() == 1){
|
|
||||||
luckyWinner->basicAbilities[ability]+=1;
|
|
||||||
}else if (cards.size() == 2){
|
|
||||||
luckyWinner->basicAbilities[ability]-=1;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int removed(MTGCardInstance * card){
|
|
||||||
if(cards.size() == 1){
|
|
||||||
luckyWinner->basicAbilities[ability]+=1;
|
|
||||||
}else if (cards.size() == 0){
|
|
||||||
luckyWinner->basicAbilities[ability]-=1;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual ostream& toString(ostream& out) const
|
|
||||||
{
|
|
||||||
out << "AExaltedAbility ::: ability : " << ability
|
|
||||||
<< " ; luckyWinner : " << luckyWinner
|
|
||||||
<< " (";
|
|
||||||
return ListMaintainerAbility::toString(out) << ")";
|
|
||||||
}
|
|
||||||
AExaltedAbility * clone() const{
|
|
||||||
AExaltedAbility * a = NEW AExaltedAbility(*this);
|
|
||||||
a->isClone = 1;
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//Converts lands to creatures (Kormus bell, Living lands)
|
//Converts lands to creatures (Kormus bell, Living lands)
|
||||||
class AConvertLandToCreatures:public ListMaintainerAbility{
|
class AConvertLandToCreatures:public ListMaintainerAbility{
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user