diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 0266a1ef8..7213a693d 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -4708,7 +4708,8 @@ DYNAMIC_ABILITY_WHO_TARGETOPPONENT = 4, DYNAMIC_ABILITY_WHO_TOSOURCE = 5, DYNAMIC_ABILITY_WHO_SOURCECONTROLLER = 6, DYNAMIC_ABILITY_WHO_SOURCEOPPONENT = 7, -DYNAMIC_ABILITY_WHO_NB = 8, +DYNAMIC_ABILITY_WHO_ABILITYCONTROLLER = 8, +DYNAMIC_ABILITY_WHO_NB = 9, }; int type; @@ -6277,6 +6278,14 @@ public: who = source->owner; } + if (after == "postbattle") + { + if(game->getCurrentGamePhase() < MTG_PHASE_COMBATEND) + after = "secondmain"; + else + after = "this"; + } + if (after == "this")//apply it right now. { if(!applied) diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 816d7a1d7..eab654818 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -3464,10 +3464,17 @@ int AADynamic::resolve() tosrc = true; break; case DYNAMIC_ABILITY_WHO_SOURCECONTROLLER: - secondaryTarget = ((MTGCardInstance *) OriginalSrc)->controller(); + secondaryTarget = OriginalSrc->controller(); break; case DYNAMIC_ABILITY_WHO_SOURCEOPPONENT: secondaryTarget = OriginalSrc->controller()->opponent(); + case DYNAMIC_ABILITY_WHO_ABILITYCONTROLLER: + { + if(OriginalSrc->storedSourceCard) + secondaryTarget = OriginalSrc->storedSourceCard->controller(); + else + secondaryTarget = OriginalSrc->controller(); + } break; default: break; diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 3f5368917..ab90b0ac5 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -77,10 +77,10 @@ const int kDynamicEffectIds[] = { }; -const string kDynamicWhoKeywords[] = {"eachother", "itself", "targetcontroller", "targetopponent", "tosrc", "srccontroller", "srcopponent" }; +const string kDynamicWhoKeywords[] = {"eachother", "itself", "targetcontroller", "targetopponent", "tosrc", "srccontroller", "srcopponent" , "abilitycontroller" }; const int kDynamicWhoIds[] = { AADynamic::DYNAMIC_ABILITY_WHO_EACHOTHER, AADynamic::DYNAMIC_ABILITY_WHO_ITSELF, AADynamic::DYNAMIC_ABILITY_WHO_TARGETCONTROLLER, AADynamic::DYNAMIC_ABILITY_WHO_TARGETOPPONENT, - AADynamic::DYNAMIC_ABILITY_WHO_TOSOURCE, AADynamic::DYNAMIC_ABILITY_WHO_SOURCECONTROLLER, AADynamic::DYNAMIC_ABILITY_WHO_SOURCEOPPONENT + AADynamic::DYNAMIC_ABILITY_WHO_TOSOURCE, AADynamic::DYNAMIC_ABILITY_WHO_SOURCECONTROLLER, AADynamic::DYNAMIC_ABILITY_WHO_SOURCEOPPONENT, AADynamic::DYNAMIC_ABILITY_WHO_ABILITYCONTROLLER }; int MTGAbility::allowedToCast(MTGCardInstance * card,Player * player)