Quellcode durchsuchen

Merge pull request #1577 from sollybr/bugfix/Retaliation_Tie

Update Retaliation.cs
x89rt2 vor 1 Monat
Ursprung
Commit
56024128f5

+ 7 - 22
Assets/Scripts/Script/CardEffectCommons/KeyWordEffects/Retaliation.cs

@@ -21,7 +21,8 @@ public partial class CardEffectCommons
 
                     if (TopCard != null)
                     {
-                        if (IsTopCardStillInTrash(cardEffect))
+                        bool sourceIsToken = cardEffect.EffectSourceCard?.IsToken ?? false;
+                        if (IsTopCardStillInTrash(cardEffect) || sourceIsToken)
                         {
                             IBattle battle = GetBattleFromHashtable(hashtable);
 
@@ -31,30 +32,14 @@ public partial class CardEffectCommons
 
                                 if (battleHashtable != null)
                                 {
-                                    List<Permanent> LoserPermanents = GetLoserPermanentsFromHashtable(battleHashtable);
 
-                                    if (LoserPermanents != null)
+                                    List<Permanent> WinnerPermanents = GetWinnerPermanentsRealFromHashtable(battleHashtable);
+
+                                    if (WinnerPermanents != null)
                                     {
-                                        if (LoserPermanents.Some((permanent) => permanent.cardSources.Contains(TopCard)))
+                                        if (WinnerPermanents.Some(permanent => IsOpponentPermanent(permanent, TopCard)))
                                         {
-                                            #region Work out if opponent is still in play
-                                            if (LoserPermanents.Some(permanent => IsOpponentPermanent(permanent, TopCard)))// In case of tie, any other permanent is the opponent's digimon
-                                            {
-                                                return true;
-                                            } 
-                                            else
-                                            {
-                                                List<Permanent> WinnerPermanents = GetWinnerPermanentsRealFromHashtable(battleHashtable);
-
-                                                if (WinnerPermanents != null)
-                                                {
-                                                    if (WinnerPermanents.Some(permanent => IsOpponentPermanent(permanent, TopCard)))
-                                                    {
-                                                        return true;
-                                                    }
-                                                }
-                                            }
-                                            #endregion
+                                            return true;
                                         }
                                     }
                                 }