diff --git a/Game/AI/DefaultExecutor.cs b/Game/AI/DefaultExecutor.cs index 318bb10a..d4d72ff3 100644 --- a/Game/AI/DefaultExecutor.cs +++ b/Game/AI/DefaultExecutor.cs @@ -56,6 +56,14 @@ protected class _CardId public const int MacroCosmos = 30241314; public const int UpstartGoblin = 70368879; public const int EaterOfMillions = 63845230; + + public const int InvokedPurgatrio = 12307878; + public const int ChaosAncientGearGiant = 51788412; + public const int UltimateAncientGearGolem = 12652643; + + public const int ImperialOrder = 61740673; + public const int NaturiaBeast = 33198837; + public const int AntiSpellFragrance = 58921041; } protected DefaultExecutor(GameAI ai, Duel duel) @@ -342,6 +350,31 @@ protected bool DefaultCallOfTheHaunted() return true; } + /// + /// Default Scapegoat effect + /// + protected bool DefaultScapegoat() + { + if (DefaultSpellWillBeNegated()) return false; + if (Duel.Player == 0) return false; + if (Duel.Phase == DuelPhase.End) return true; + if (DefaultOnBecomeTarget()) return true; + if (Duel.Phase > DuelPhase.Main1 && Duel.Phase < DuelPhase.Main2) + { + if (Enemy.HasInMonstersZone(_CardId.UltimateConductorTytanno, true)) return false; + if (Enemy.HasInMonstersZone(_CardId.InvokedPurgatrio, true)) return false; + if (Enemy.HasInMonstersZone(_CardId.ChaosAncientGearGiant, true)) return false; + if (Enemy.HasInMonstersZone(_CardId.UltimateAncientGearGolem, true)) return false; + int total_atk = 0; + List enemy_monster = Enemy.GetMonsters(); + foreach (ClientCard m in enemy_monster) + { + if (m.IsAttack()) total_atk += m.Attack; + } + if (total_atk >= Bot.LifePoints) return true; + } + return false; + } /// /// Always active in opponent's turn. /// @@ -641,6 +674,42 @@ protected bool DefaultMonsterRepos() return false; } + /// + /// If spell will be negated + /// + protected bool DefaultSpellWillBeNegated() + { + ClientCard card = null; + foreach (ClientCard check in Bot.GetSpells()) + { + if (check.Id == _CardId.ImperialOrder && !check.IsDisabled()) + card = check; + } + if (card != null && card.IsFaceup()) + return true; + if (Enemy.HasInSpellZone(_CardId.ImperialOrder, true) || Enemy.HasInMonstersZone(_CardId.NaturiaBeast, true)) + return true; + return false; + } + + /// + /// If spell must set first to activate + /// + protected bool DefaultSpellMustSetFirst() + { + ClientCard card = null; + foreach (ClientCard check in Bot.GetSpells()) + { + if (check.Id == _CardId.AntiSpellFragrance && !check.IsDisabled()) + card = check; + } + if (card != null && card.IsFaceup()) + return true; + if (Enemy.HasInSpellZone(_CardId.AntiSpellFragrance, true)) + return true; + return false; + } + /// /// if spell/trap is the target or enermy activate HarpiesFeatherDuster ///