Corrections

This commit is contained in:
Anthony Calosa
2016-06-13 15:27:33 +08:00
parent 70c0957248
commit 9ac1540cdc
7 changed files with 71 additions and 37 deletions
@@ -3075,6 +3075,17 @@ power=4
toughness=6 toughness=6
[/card] [/card]
[card] [card]
name=Angel of Jubilation
abilities=flying,cantpaylifeorsaccreatures
auto=lord(other creature[-black]|mybattlefield) 1/1
text=Flying -- Other nonblack creatures you control get +1/+1. -- Players can't pay life or sacrifice creatures to cast spells or activate abilities.
mana={1}{W}{W}{W}
type=Creature
subtype=Angel
power=3
toughness=3
[/card]
[card]
name=Angel of Light name=Angel of Light
abilities=flying,vigilance abilities=flying,vigilance
text=Flying, vigilance text=Flying, vigilance
@@ -527,15 +527,6 @@ power=6
toughness=6 toughness=6
[/card] [/card]
[card] [card]
name=Angel of Jubilation
text=Flying -- Other nonblack creatures you control get +1/+1. -- Players can't pay life or sacrifice creatures to cast spells or activate abilities.
mana={1}{W}{W}{W}
type=Creature
subtype=Angel
power=3
toughness=3
[/card]
[card]
name=Angel of Renewal name=Angel of Renewal
text=Flying -- When Angel of Renewal enters the battlefield, you gain 1 life for each creature you control. text=Flying -- When Angel of Renewal enters the battlefield, you gain 1 life for each creature you control.
mana={5}{W} mana={5}{W}
+21 -23
View File
@@ -634,25 +634,25 @@ private:
{ {
intValue = 0; intValue = 0;
for (int j = card->controller()->game->inPlay->nb_cards - 1; j >= 0; --j) for (int j = card->controller()->game->inPlay->nb_cards - 1; j >= 0; --j)
{
if (card->controller()->game->inPlay->cards[j]->hasType(Subtypes::TYPE_CREATURE) && card->controller()->game->inPlay->cards[j] != card) if (card->controller()->game->inPlay->cards[j]->hasType(Subtypes::TYPE_CREATURE) && card->controller()->game->inPlay->cards[j] != card)
intValue += card->controller()->game->inPlay->cards[j]->getManaCost()->getConvertedCost(); intValue += card->controller()->game->inPlay->cards[j]->getManaCost()->getConvertedCost();
} }
}
else if (s == "pdauntless")//Dauntless Dourbark else if (s == "pdauntless")//Dauntless Dourbark
{ {
MTGGameZone * checkZone = card->controller()->inPlay();
intValue = intValue =
countCardTypeinZone("forest",card->controller()->inPlay()) + countCardTypeinZone("forest",checkZone) +
countCardTypeinZone("treefolk",card->controller()->inPlay()); countCardTypeinZone("treefolk",checkZone);
} }
else if (s == "pbasiclandtypes")//Basic Land types else if (s == "pbasiclandtypes")//Basic Land types
{ {
MTGGameZone * checkZone = card->controller()->inPlay();
intValue = intValue =
cardHasTypeinZone("forest",card->controller()->inPlay()) + cardHasTypeinZone("forest",checkZone) +
cardHasTypeinZone("plains",card->controller()->inPlay()) + cardHasTypeinZone("plains",checkZone) +
cardHasTypeinZone("swamp",card->controller()->inPlay()) + cardHasTypeinZone("swamp",checkZone) +
cardHasTypeinZone("island",card->controller()->inPlay()) + cardHasTypeinZone("island",checkZone) +
cardHasTypeinZone("mountain",card->controller()->inPlay()); cardHasTypeinZone("mountain",checkZone);
} }
else if (s == "myname")//Name of the card you control else if (s == "myname")//Name of the card you control
{ {
@@ -662,10 +662,8 @@ private:
{ {
intValue = 0; intValue = 0;
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)
{
intValue += countCardNameinZone(card->name,card->getObserver()->players[i]->game->battlefield); intValue += countCardNameinZone(card->name,card->getObserver()->players[i]->game->battlefield);
} }
}
else if (s == "pgbzombie")//Soulless One else if (s == "pgbzombie")//Soulless One
{ {
intValue = 0; intValue = 0;
@@ -689,24 +687,24 @@ private:
{ {
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)
{ {
MTGGameZone * checkZone = card->getObserver()->players[i]->game->graveyard;
intValue = intValue =
cardHasTypeinZone("planeswalker",card->getObserver()->players[i]->game->graveyard) + cardHasTypeinZone("planeswalker",checkZone) +
cardHasTypeinZone("tribal",card->getObserver()->players[i]->game->graveyard) + cardHasTypeinZone("tribal",checkZone) +
cardHasTypeinZone("sorcery",card->getObserver()->players[i]->game->graveyard) + cardHasTypeinZone("sorcery",checkZone) +
cardHasTypeinZone("land",card->getObserver()->players[i]->game->graveyard) + cardHasTypeinZone("land",checkZone) +
cardHasTypeinZone("instant",card->getObserver()->players[i]->game->graveyard) + cardHasTypeinZone("instant",checkZone) +
cardHasTypeinZone("enchantment",card->getObserver()->players[i]->game->graveyard) + cardHasTypeinZone("enchantment",checkZone) +
cardHasTypeinZone("creature",card->getObserver()->players[i]->game->graveyard) + cardHasTypeinZone("creature",checkZone) +
cardHasTypeinZone("artifact",card->getObserver()->players[i]->game->graveyard); cardHasTypeinZone("artifact",checkZone);
} }
} }
else if (s == "morethanfourcards") else if (s == "morethanfourcards")
{ {
intValue = 0; intValue = 0;
if ((card->playerTarget) && (card->playerTarget->game->hand->nb_cards - 4)>0) int damage = card->playerTarget ? card->playerTarget->game->hand->nb_cards - 4 : card->controller()->opponent()->game->hand->nb_cards - 4;
intValue = (card->playerTarget->game->hand->nb_cards - 4); if ( damage > 0 )
else if ((card->controller()->opponent()->game->hand->nb_cards - 4)>0) intValue = damage;
intValue = (card->controller()->opponent()->game->hand->nb_cards - 4);
} }
else if (s == "powertotalinplay")//Count Total Power of Creatures you control... Formidable else if (s == "powertotalinplay")//Count Total Power of Creatures you control... Formidable
{ {
+1
View File
@@ -76,6 +76,7 @@ class SacrificeCost : public ExtraCost
{ {
public: public:
SacrificeCost(TargetChooser *_tc = NULL); SacrificeCost(TargetChooser *_tc = NULL);
virtual int canPay();
virtual int doPay(); virtual int doPay();
virtual SacrificeCost * clone() const; virtual SacrificeCost * clone() const;
}; };
+2 -1
View File
@@ -244,7 +244,8 @@ class Constants
DEVOID = 123, DEVOID = 123,
CANTCHANGELIFE = 124, CANTCHANGELIFE = 124,
COMBATTOUGHNESS = 125, COMBATTOUGHNESS = 125,
NB_BASIC_ABILITIES = 126, CANTPAYLIFEORSACCREATURES = 126,
NB_BASIC_ABILITIES = 127,
RARITY_S = 'S', //Special Rarity RARITY_S = 'S', //Special Rarity
+34 -3
View File
@@ -245,7 +245,9 @@ LifeCost::LifeCost(TargetChooser *_tc)
int LifeCost::canPay() int LifeCost::canPay()
{ {
MTGCardInstance * _target = (MTGCardInstance *) target; MTGCardInstance * _target = (MTGCardInstance *) target;
if(_target->controller()->life <= 0 || _target->controller()->inPlay()->hasAbility(Constants::CANTCHANGELIFE)) if (_target->controller()->life <= 0 || _target->controller()->inPlay()->hasAbility(Constants::CANTCHANGELIFE) ||
_target->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES) ||
_target->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES))
{ {
return 0; return 0;
} }
@@ -283,7 +285,9 @@ SpecificLifeCost::SpecificLifeCost(TargetChooser *_tc, int slc)
int SpecificLifeCost::canPay() int SpecificLifeCost::canPay()
{ {
MTGCardInstance * _target = (MTGCardInstance *) target; MTGCardInstance * _target = (MTGCardInstance *) target;
if(_target->controller()->life >= slc && !_target->controller()->inPlay()->hasAbility(Constants::CANTCHANGELIFE)) if(_target->controller()->life >= slc && !_target->controller()->inPlay()->hasAbility(Constants::CANTCHANGELIFE) &&
!_target->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES) &&
!_target->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES))
{ {
return 1; return 1;
} }
@@ -331,7 +335,16 @@ LifeorManaCost::LifeorManaCost(TargetChooser *_tc, string manaType)
int LifeorManaCost::canPay() int LifeorManaCost::canPay()
{ {
MTGCardInstance * _target = (MTGCardInstance *) target; MTGCardInstance * _target = (MTGCardInstance *) target;
if (_target->controller()->getManaPool()->canAfford(getManaCost()) || _target->controller()->life > 1) if ( _target->controller()->life <= 1 || _target->controller()->inPlay()->hasAbility(Constants::CANTCHANGELIFE) ||
_target->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES) ||
_target->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES))
{
return _target->controller()->getManaPool()->canAfford(getManaCost());
}
else if((_target->controller()->life > 1 || _target->controller()->getManaPool()->canAfford(getManaCost())) &&
(!_target->controller()->inPlay()->hasAbility(Constants::CANTCHANGELIFE) &&
!_target->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES) &&
!_target->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES)))
{ {
return 1; return 1;
} }
@@ -923,6 +936,12 @@ ExtraCost("Select creature to offer", _tc)
int Offering::canPay() int Offering::canPay()
{ {
if(source->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES) ||
source->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES))
{
return 0;
}
if (target && (!source->controller()->getManaPool()->canAfford(source->getManaCost()->Diff(target->getManaCost())))) if (target && (!source->controller()->getManaPool()->canAfford(source->getManaCost()->Diff(target->getManaCost()))))
{ {
tc->removeTarget(target); tc->removeTarget(target);
@@ -980,6 +999,18 @@ SacrificeCost::SacrificeCost(TargetChooser *_tc)
{ {
} }
int SacrificeCost::canPay()
{
if(source->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES) ||
source->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES))
{
if (target && target->isCreature())
return 0;
}
return 1;
}
int SacrificeCost::doPay() int SacrificeCost::doPay()
{ {
if (target) if (target)
+2 -1
View File
@@ -155,7 +155,8 @@ const char* Constants::MTGBasicAbilities[] = {
"libraryeater", "libraryeater",
"devoid", "devoid",
"cantchangelife", "cantchangelife",
"combattoughness" "combattoughness",
"cantpaylifeorsaccreatures"
}; };
map<string,int> Constants::MTGBasicAbilitiesMap; map<string,int> Constants::MTGBasicAbilitiesMap;