some changes

change keyword "makecardt" alternative token creator to "create" keyword
add lifeleech - gain life lost with target
This commit is contained in:
Anthony Calosa
2017-02-07 21:22:49 +08:00
parent 75e372ac9b
commit bac69f95d8
6 changed files with 103 additions and 98 deletions
+5 -3
View File
@@ -3936,8 +3936,8 @@ AADynamic::~AADynamic()
}
//AALifer
AALifer::AALifer(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, string life_s, ManaCost * _cost, int who) :
ActivatedAbilityTP(observer, _id, card, _target, _cost, who),life_s(life_s)
AALifer::AALifer(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, string life_s, bool siphon, ManaCost * _cost, int who) :
ActivatedAbilityTP(observer, _id, card, _target, _cost, who),life_s(life_s),siphon(siphon)
{
aType = MTGAbility::LIFER;
}
@@ -3954,7 +3954,9 @@ int AALifer::resolve()
_target = ((MTGCardInstance *) _target)->controller();
}
Player *player = (Player*)_target;
player->gainOrLoseLife(life.getValue());
int slife = abs(player->gainOrLoseLife(life.getValue()));
if(siphon && (slife > 0) && (life.getValue() < 0))
source->controller()->gainOrLoseLife(slife);
return 1;
}
+2 -2
View File
@@ -1729,8 +1729,8 @@ void GameStateDuel::OnScroll(int inXVelocity, int inYVelocity)
else if(flickLeft && OptionClosedHand::VISIBLE == options[Options::CLOSEDHAND].number)
{
#if defined (ANDROID)
JButton trigger = (options[Options::REVERSETRIGGERS].number ? JGE_BTN_UP : JGE_BTN_DOWN);
mEngine->HoldKey_NoRepeat(trigger);
//JButton trigger = (options[Options::REVERSETRIGGERS].number ? JGE_BTN_UP : JGE_BTN_DOWN);
mEngine->HoldKey_NoRepeat(JGE_BTN_DOWN);
#endif
}
}
+12 -2
View File
@@ -2653,7 +2653,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
}
//Alternative Token creator. Name, type, p/t, abilities - uses ":" as delimeter
vector<string> makeToken = parseBetween(s, "makecardt(", ")");
vector<string> makeToken = parseBetween(s, "create(", ")");
if (makeToken.size())
{
WParsedInt * multiplier = NULL;
@@ -3147,7 +3147,17 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
if (splitLife.size())
{
Targetable * t = spell ? spell->getNextTarget() : NULL;
MTGAbility * a = NEW AALifer(observer, id, card, t, splitLife[1], NULL, who);
MTGAbility * a = NEW AALifer(observer, id, card, t, splitLife[1], false, NULL, who);
a->oneShot = 1;
return a;
}
//siphon life - gain life lost this way
vector<string> splitSiphonLife = parseBetween(s, "lifeleech:", " ", false);
if (splitSiphonLife.size())
{
Targetable * t = spell ? spell->getNextTarget() : NULL;
MTGAbility * a = NEW AALifer(observer, id, card, t, splitSiphonLife[1], true, NULL, who);
a->oneShot = 1;
return a;
}