Castcard, Rebound and other fixes
This commit is contained in:
@@ -5244,12 +5244,15 @@ void ABlink::Update(float dt)
|
||||
resolveBlink();
|
||||
}
|
||||
|
||||
if ((blinkueot && currentPhase == MTG_PHASE_ENDOFTURN) || (blinkForSource && !source->isInPlay(game)) && (Blinked->blinked))
|
||||
if ((blinkueot && currentPhase == MTG_PHASE_ENDOFTURN) || (blinkForSource && !source->isInPlay(game)))
|
||||
{
|
||||
if (Blinked == NULL)
|
||||
MTGAbility::Update(dt);
|
||||
MTGCardInstance * _target = Blinked;
|
||||
returnCardIntoPlay(_target);
|
||||
if(Blinked->blinked)
|
||||
{
|
||||
if (Blinked == NULL)
|
||||
MTGAbility::Update(dt);
|
||||
MTGCardInstance * _target = Blinked;
|
||||
returnCardIntoPlay(_target);
|
||||
}
|
||||
}
|
||||
MTGAbility::Update(dt);
|
||||
}
|
||||
@@ -5724,16 +5727,28 @@ void AACastCard::Update(float dt)
|
||||
this->forceDestroy = 1;
|
||||
return;
|
||||
}
|
||||
if(!toCheck->hasType(Subtypes::TYPE_INSTANT) && !(game->getCurrentGamePhase() == MTG_PHASE_FIRSTMAIN || game->getCurrentGamePhase() == MTG_PHASE_SECONDMAIN))
|
||||
/*if(!toCheck->hasType(Subtypes::TYPE_INSTANT) && !(game->getCurrentGamePhase() == MTG_PHASE_FIRSTMAIN || game->getCurrentGamePhase() == MTG_PHASE_SECONDMAIN))
|
||||
{
|
||||
processed = true;
|
||||
this->forceDestroy = 1;
|
||||
return;
|
||||
}*/
|
||||
}
|
||||
MTGCardInstance * toCheck = (MTGCardInstance*)target;
|
||||
if(theNamedCard)
|
||||
toCheck = theNamedCard;
|
||||
if(toCheck && toCheck->spellTargetType.size())
|
||||
{
|
||||
TargetChooserFactory tcf(game);
|
||||
TargetChooser * stc = tcf.createTargetChooser(toCheck->spellTargetType,toCheck);
|
||||
if (!stc->validTargetsExist()||toCheck->isToken)
|
||||
{
|
||||
processed = true;
|
||||
this->forceDestroy = 1;
|
||||
return;
|
||||
}
|
||||
SAFE_DELETE(stc);
|
||||
}
|
||||
MTGCardInstance * toCheck = (MTGCardInstance*)target;
|
||||
if(theNamedCard)
|
||||
toCheck = theNamedCard;
|
||||
if (Spell * checkSpell = dynamic_cast<Spell*>(target))
|
||||
{
|
||||
toCheck = checkSpell->source;
|
||||
|
||||
@@ -310,6 +310,21 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
check = restriction[i].find("rebound");
|
||||
if(check != string::npos)
|
||||
{
|
||||
int count = 0;
|
||||
for(unsigned int k = 0; k < player->game->stack->cardsSeenThisTurn.size(); k++)
|
||||
{
|
||||
MTGCardInstance * stackCard = player->game->stack->cardsSeenThisTurn[k];
|
||||
if(stackCard->next && stackCard->next == card && card->previousZone == card->controller()->game->hand)
|
||||
count++;
|
||||
if(stackCard == card && card->previousZone == card->controller()->game->hand)
|
||||
count++;
|
||||
}
|
||||
if(!count)
|
||||
return 0;
|
||||
}
|
||||
check = restriction[i].find("morbid");
|
||||
if(check != string::npos)
|
||||
{
|
||||
|
||||
@@ -739,6 +739,10 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
|
||||
{
|
||||
return NEW CardTargetChooser(observer, card->storedSourceCard, card, zones, nbzones);
|
||||
}
|
||||
else if (typeName.compare("abilitycontroller") == 0)
|
||||
{
|
||||
return NEW PlayerTargetChooser(observer, card, 1, card->storedSourceCard->controller());
|
||||
}
|
||||
else
|
||||
{
|
||||
tc = NEW TypeTargetChooser(observer, typeName.c_str(), zones, nbzones, card, maxtargets, other, targetMin);
|
||||
|
||||
Reference in New Issue
Block a user