Commit f84924f5 authored by handsomekiwi's avatar handsomekiwi Committed by mercury233

add some default executor (#87)

parent ac4b43fa
...@@ -56,6 +56,14 @@ namespace WindBot.Game.AI ...@@ -56,6 +56,14 @@ namespace WindBot.Game.AI
public const int MacroCosmos = 30241314; public const int MacroCosmos = 30241314;
public const int UpstartGoblin = 70368879; public const int UpstartGoblin = 70368879;
public const int EaterOfMillions = 63845230; 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) protected DefaultExecutor(GameAI ai, Duel duel)
...@@ -342,6 +350,31 @@ namespace WindBot.Game.AI ...@@ -342,6 +350,31 @@ namespace WindBot.Game.AI
return true; return true;
} }
/// <summary>
/// Default Scapegoat effect
/// </summary>
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<ClientCard> 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;
}
/// <summary> /// <summary>
/// Always active in opponent's turn. /// Always active in opponent's turn.
/// </summary> /// </summary>
...@@ -641,6 +674,42 @@ namespace WindBot.Game.AI ...@@ -641,6 +674,42 @@ namespace WindBot.Game.AI
return false; return false;
} }
/// <summary>
/// If spell will be negated
/// </summary>
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;
}
/// <summary>
/// If spell must set first to activate
/// </summary>
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;
}
/// <summary> /// <summary>
/// if spell/trap is the target or enermy activate HarpiesFeatherDuster /// if spell/trap is the target or enermy activate HarpiesFeatherDuster
/// </summary> /// </summary>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment