Fixed some primitives from issue #1085 and from Discord channel, fixed all curses primitives and targets, added new keywords "oppotgt" and "ctrltgt" to check wich player has been targeted from a card, fixed an issue on "chooseaname" ability.

This commit is contained in:
Vittorio Alfieri
2023-07-13 17:24:11 +02:00
parent c170733af6
commit fbfcb7d3ac
9 changed files with 298 additions and 174 deletions

View File

@@ -3817,7 +3817,7 @@ GenericRollDie::~GenericRollDie()
//set die result
AASetDie::AASetDie(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * _target, int _side, int _diefaces, string toAlter):
InstantAbility(observer, id, source),side(_side), diefaces(_diefaces), abilityToAlter(toAlter)
InstantAbility(observer, id, source), side(_side), diefaces(_diefaces), abilityToAlter(toAlter)
{
this->target = _target;
abilityAltered = NULL;
@@ -3833,12 +3833,12 @@ int AASetDie::resolve()
_target->dieNumFaces = diefaces;
WEvent * e = NEW WEventCardRollDie(_target, source->controller()->getDisplayName());
game->receiveEvent(e);
vector<string>Win = parseBetween(abilityToAlter,"winability "," winabilityend");
vector<string>Win = parseBetween(abilityToAlter, "winability ", " winabilityend");
if(Win.size())
{
abilityWin = Win[1];
}
vector<string>Lose = parseBetween(abilityToAlter,"loseability "," loseabilityend");
vector<string>Lose = parseBetween(abilityToAlter, "loseability ", " loseabilityend");
if(Lose.size())
{
abilityLose = Lose[1];
@@ -3860,14 +3860,14 @@ int AASetDie::resolve()
abilityAltered->addToGame();
}
msg << "Result is: " << roll << ". You Won The Die Roll";
MTGAbility * message = NEW MTGEventText(game,this->GetId(), source, msg.str());
MTGAbility * message = NEW MTGEventText(game, this->GetId(), source, msg.str());
message->oneShot = true;
message->addToGame();
}
else if(abilityWin.size() && !abilityLose.size())
{
msg << "Result is: " << roll << ". You Lost The Die Roll";
MTGAbility * message = NEW MTGEventText(game,this->GetId(), source, msg.str());
MTGAbility * message = NEW MTGEventText(game, this->GetId(), source, msg.str());
message->oneShot = true;
message->addToGame();
}
@@ -3886,14 +3886,14 @@ int AASetDie::resolve()
abilityAltered->addToGame();
}
msg << "Result is: " << roll << ". You Lost The Die Roll";
MTGAbility * message = NEW MTGEventText(game,this->GetId(), source, msg.str());
MTGAbility * message = NEW MTGEventText(game, this->GetId(), source, msg.str());
message->oneShot = true;
message->addToGame();
}
else if(abilityLose.size())
{
msg << "Result is: " << roll << ". You Won The Die Roll";
MTGAbility * message = NEW MTGEventText(game,this->GetId(), source, msg.str());
MTGAbility * message = NEW MTGEventText(game, this->GetId(), source, msg.str());
message->oneShot = true;
message->addToGame();
}