Merge pull request #671 from kevlahnota/master

Cant life change
This commit is contained in:
Anthony Calosa
2016-06-02 12:51:29 +08:00
11 changed files with 38 additions and 25 deletions
@@ -73994,6 +73994,16 @@ power=4
toughness=4 toughness=4
[/card] [/card]
[card] [card]
name=Platinum Emperion
abilities=cantchangelife
mana={8}
type=Artifact Creature
subtype=Golem
power=8
toughness=8
text=Your life total can't change. (You can't gain or lose life. You can't pay any amount of life except 0.)
[/card]
[card]
name=Plaxcaster Frogling name=Plaxcaster Frogling
auto=counter(1/1,3) auto=counter(1/1,3)
auto={2}:shroud target(creature[counter{1/1.1}]) auto={2}:shroud target(creature[counter{1/1.1}])
@@ -11748,15 +11748,6 @@ power=1
toughness=2 toughness=2
[/card] [/card]
[card] [card]
name=Platinum Emperion
mana={8}
type=Artifact Creature
subtype=Golem
power=8
toughness=8
text=Your life total can't change. (You can't gain or lose life. You can't pay any amount of life except 0.)
[/card]
[card]
name=Plow Through Reito name=Plow Through Reito
text=Sweep - Return any number of Plains you control to their owner's hand. Target creature gets +1/+1 until end of turn for each Plains returned this way. text=Sweep - Return any number of Plains you control to their owner's hand. Target creature gets +1/+1 until end of turn for each Plains returned this way.
mana={1}{W} mana={1}{W}
+4 -3
View File
@@ -2401,6 +2401,7 @@ public:
{ {
if (!isReactingToClick(_card)) return 0; if (!isReactingToClick(_card)) return 0;
game->currentlyActing()->getManaPool()->pay(cost); game->currentlyActing()->getManaPool()->pay(cost);
if(!game->currentlyActing()->inPlay()->hasAbility(Constants::CANTCHANGELIFE))
game->currentlyActing()->life += life; game->currentlyActing()->life += life;
lastUsedOn = lastChecked; lastUsedOn = lastChecked;
return 1; return 1;
@@ -3009,7 +3010,7 @@ public:
{ {
if (newPhase != currentPhase && newPhase == phase && game->currentPlayer == ((MTGCardInstance *) target)->controller()) if (newPhase != currentPhase && newPhase == phase && game->currentPlayer == ((MTGCardInstance *) target)->controller())
{ {
if (!onlyIfTargetTapped || ((MTGCardInstance *) target)->isTapped()) if ((!onlyIfTargetTapped || ((MTGCardInstance *) target)->isTapped()) && (!game->currentPlayer->inPlay()->hasAbility(Constants::CANTCHANGELIFE)))
{ {
if (life > 0) if (life > 0)
{ {
@@ -4592,7 +4593,7 @@ public:
void Update(float) void Update(float)
{ {
if (newPhase != currentPhase && newPhase == phase) if (newPhase != currentPhase && newPhase == phase && !game->currentPlayer->inPlay()->hasAbility(Constants::CANTCHANGELIFE))
{ {
if ((controller && game->currentPlayer == source->controller()) || (!controller && game->currentPlayer if ((controller && game->currentPlayer == source->controller()) || (!controller && game->currentPlayer
!= source->controller())) != source->controller()))
@@ -6238,7 +6239,7 @@ public:
{ {
Player * p = (Player *) isDamaged->damage->target; Player * p = (Player *) isDamaged->damage->target;
WParsedInt lifetoset(life_s, NULL, source); WParsedInt lifetoset(life_s, NULL, source);
if(p && p == source->controller() && p->life <= lifetoset.getValue()) if(p && p == source->controller() && p->life <= lifetoset.getValue() && !p->inPlay()->hasAbility(Constants::CANTCHANGELIFE))
p->life = lifetoset.getValue(); p->life = lifetoset.getValue();
} }
} }
+2 -1
View File
@@ -242,7 +242,8 @@ class Constants
CANPLAYFROMEXILE = 121, CANPLAYFROMEXILE = 121,
LIBRARYEATER = 122, LIBRARYEATER = 122,
DEVOID = 123, DEVOID = 123,
NB_BASIC_ABILITIES = 124, CANTCHANGELIFE = 124,
NB_BASIC_ABILITIES = 125,
RARITY_S = 'S', //Special Rarity RARITY_S = 'S', //Special Rarity
+2
View File
@@ -4623,6 +4623,8 @@ int AAExchangeLife::resolve()
Damageable * _target = (Damageable *) getTarget(); Damageable * _target = (Damageable *) getTarget();
if (_target) if (_target)
{ {
if(_target->type_as_damageable == Damageable::DAMAGEABLE_PLAYER && ((Player*)_target)->inPlay()->hasAbility(Constants::CANTCHANGELIFE))
return 0;
Player *player = source->controller(); Player *player = source->controller();
int oldlife = player->getLife(); int oldlife = player->getLife();
int targetOldLife = _target->getLife(); int targetOldLife = _target->getLife();
+4
View File
@@ -196,6 +196,7 @@ int Damage::resolve()
{ {
//Damage + 1, 2, or 3 poison counters on player //Damage + 1, 2, or 3 poison counters on player
Player * _target = (Player *) target; Player * _target = (Player *) target;
if(!_target->inPlay()->hasAbility(Constants::CANTCHANGELIFE))
a = target->dealDamage(damage); a = target->dealDamage(damage);
target->damageCount += damage; target->damageCount += damage;
if ( typeOfDamage == 1 && target == source->controller()->opponent() )//add vector prowledtypes. if ( typeOfDamage == 1 && target == source->controller()->opponent() )//add vector prowledtypes.
@@ -228,6 +229,9 @@ int Damage::resolve()
{ {
// "Normal" case, // "Normal" case,
//return the left over amount after effects have been applied to them. //return the left over amount after effects have been applied to them.
if (target->type_as_damageable == Damageable::DAMAGEABLE_PLAYER && !((Player *)target)->inPlay()->hasAbility(Constants::CANTCHANGELIFE))
a = target->dealDamage(damage);
else
a = target->dealDamage(damage); a = target->dealDamage(damage);
target->damageCount += damage;//the amount must be the actual damage so i changed this from 1 to damage, this fixes pdcount and odcount target->damageCount += damage;//the amount must be the actual damage so i changed this from 1 to damage, this fixes pdcount and odcount
if (target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE){ if (target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE){
+2 -2
View File
@@ -245,7 +245,7 @@ LifeCost::LifeCost(TargetChooser *_tc)
int LifeCost::canPay() int LifeCost::canPay()
{ {
MTGCardInstance * _target = (MTGCardInstance *) target; MTGCardInstance * _target = (MTGCardInstance *) target;
if(_target->controller()->life <= 0) if(_target->controller()->life <= 0 || _target->controller()->inPlay()->hasAbility(Constants::CANTCHANGELIFE))
{ {
return 0; return 0;
} }
@@ -283,7 +283,7 @@ 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) if(_target->controller()->life >= slc && !_target->controller()->inPlay()->hasAbility(Constants::CANTCHANGELIFE))
{ {
return 1; return 1;
} }
+3
View File
@@ -4389,8 +4389,11 @@ void AbilityFactory::addAbilities(int _id, Spell * spell)
case 130553:// Beacon of Immortality case 130553:// Beacon of Immortality
{ {
Player * player = spell->getNextPlayerTarget(); Player * player = spell->getNextPlayerTarget();
if (!player->inPlay()->hasAbility(Constants::CANTCHANGELIFE))
{
if (player->life < (INT_MAX / 4)) if (player->life < (INT_MAX / 4))
player->life += player->life; player->life += player->life;
}
zones->putInZone(card, spell->from, zones->library); zones->putInZone(card, spell->from, zones->library);
zones->library->shuffle(); zones->library->shuffle();
break; break;
+2 -1
View File
@@ -153,7 +153,8 @@ const char* Constants::MTGBasicAbilities[] = {
"trinisphere", "trinisphere",
"canplayfromexile", "canplayfromexile",
"libraryeater", "libraryeater",
"devoid" "devoid",
"cantchangelife"
}; };
map<string,int> Constants::MTGBasicAbilitiesMap; map<string,int> Constants::MTGBasicAbilitiesMap;
-1
View File
@@ -882,7 +882,6 @@ int ManaCost::pay(ManaCost * _cost)
ManaCost * diff = Diff(toPay); ManaCost * diff = Diff(toPay);
for (int i = 0; i < Constants::NB_Colors; i++) for (int i = 0; i < Constants::NB_Colors; i++)
{ {
cost[i] = diff->getCost(i); cost[i] = diff->getCost(i);
} }
delete diff; delete diff;
+1
View File
@@ -162,6 +162,7 @@ int Player::gainOrLoseLife(int value)
thatmuch = abs(value); //the value that much is a variable to be used with triggered abilities. thatmuch = abs(value); //the value that much is a variable to be used with triggered abilities.
//ie:when ever you gain life, draw that many cards. when used in a trigger draw:thatmuch, will return the value //ie:when ever you gain life, draw that many cards. when used in a trigger draw:thatmuch, will return the value
//that the triggered event stored in the card for "that much". //that the triggered event stored in the card for "that much".
if (!inPlay()->hasAbility(Constants::CANTCHANGELIFE))
life+=value; life+=value;
if (value<0) if (value<0)
lifeLostThisTurn += abs(value); lifeLostThisTurn += abs(value);