Commit f79e942c authored by mercury233's avatar mercury233

update SummonOrSet and DefaultMonsterSummon

LuckyExecutor no longer summon monster with higher attack tributes
parent 4e483428
......@@ -20,7 +20,7 @@ namespace WindBot.Game.AI.Decks
{
AddExecutor(ExecutorType.SpSummon);
AddExecutor(ExecutorType.Activate, DefaultDontChainMyself);
AddExecutor(ExecutorType.SummonOrSet);
AddExecutor(ExecutorType.SummonOrSet, DefaultMonsterSummon);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
AddExecutor(ExecutorType.SpellSet);
}
......
......@@ -56,7 +56,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, CardId.MonsterReborn, MonsterReborn);
AddExecutor(ExecutorType.Summon, CardId.WhiteNightDragon, WhiteNightDragon);
AddExecutor(ExecutorType.Summon, CardId.HorusTheBlackFlameDragonLv6, DefaultTributeSummon);
AddExecutor(ExecutorType.Summon, CardId.HorusTheBlackFlameDragonLv6, DefaultMonsterSummon);
AddExecutor(ExecutorType.Summon, CardId.AlexandriteDragon);
AddExecutor(ExecutorType.SummonOrSet, CardId.AxeDragonute);
AddExecutor(ExecutorType.SummonOrSet, CardId.DodgerDragon);
......@@ -157,7 +157,7 @@ namespace WindBot.Game.AI.Decks
if (card.IsCode(11224103))
return false;
return DefaultTributeSummon();
return DefaultMonsterSummon();
}
private bool HorusTheBlackFlameDragonLv8()
......
......@@ -14,12 +14,11 @@ namespace WindBot.Game.AI.Decks
{
AddExecutor(ExecutorType.Activate, ImFeelingLucky);
AddExecutor(ExecutorType.SpSummon, ImFeelingLucky);
AddExecutor(ExecutorType.SummonOrSet, ImFeelingLucky);
AddExecutor(ExecutorType.SpSummon, ImFeelingUnlucky);
AddExecutor(ExecutorType.SummonOrSet, ImFeelingUnlucky);
AddExecutor(ExecutorType.Activate, ImFeelingUnlucky);
AddExecutor(ExecutorType.SummonOrSet, DefaultMonsterSummon);
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
......
......@@ -46,8 +46,8 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, CardId.SwordsOfRevealingLight, SwordsOfRevealingLight);
AddExecutor(ExecutorType.Activate, CardId.DoubleSummon, DoubleSummon);
AddExecutor(ExecutorType.Summon, CardId.AncientGearGolem, DefaultTributeSummon);
AddExecutor(ExecutorType.Summon, CardId.Frostosaurus, DefaultTributeSummon);
AddExecutor(ExecutorType.Summon, CardId.AncientGearGolem, DefaultMonsterSummon);
AddExecutor(ExecutorType.Summon, CardId.Frostosaurus, DefaultMonsterSummon);
AddExecutor(ExecutorType.SummonOrSet, CardId.AlexandriteDragon);
AddExecutor(ExecutorType.SummonOrSet, CardId.GeneWarpedWarwolf);
AddExecutor(ExecutorType.MonsterSet, CardId.GearGolemTheMovingFortress);
......
......@@ -259,9 +259,12 @@ namespace WindBot.Game.AI
return false;
}
public override void OnNewTurn()
/// <summary>
/// Set when this card can't beat the enemies
/// </summary>
public override bool OnSelectMonsterSummonOrSet(ClientCard card)
{
return card.Level <= 4 && Util.IsAllEnemyBetter(true) && Util.IsAllEnemyBetterThanValue(card.Attack + 300, false);
}
/// <summary>
......@@ -643,10 +646,13 @@ namespace WindBot.Game.AI
}
/// <summary>
/// Summon with tributes ATK lower.
/// Summon with no tribute, or with tributes ATK lower.
/// </summary>
protected bool DefaultTributeSummon()
protected bool DefaultMonsterSummon()
{
if (Card.Level <= 4)
return true;
if (!UniqueFaceupMonster())
return false;
int tributecount = (int)Math.Ceiling((Card.Level - 4.0d) / 2.0d);
......
......@@ -188,6 +188,16 @@ namespace WindBot.Game.AI
return false;
}
/// <summary>
/// Called when the executor type is SummonOrSet
/// </summary>
/// <returns>True if select to set the monster.</returns>
public virtual bool OnSelectMonsterSummonOrSet(ClientCard card)
{
// Overrided in DefalultExecutor
return false;
}
/// <summary>
/// Called when bot is going to annouce a card
/// </summary>
......
......@@ -444,8 +444,7 @@ namespace WindBot.Game
}
if (ShouldExecute(exec, card, ExecutorType.SummonOrSet))
{
if (Executor.Util.IsAllEnemyBetter(true) && Executor.Util.IsAllEnemyBetterThanValue(card.Attack + 300, false) &&
main.MonsterSetableCards.Contains(card))
if (main.MonsterSetableCards.Contains(card) && Executor.OnSelectMonsterSummonOrSet(card))
{
_dialogs.SendSetMonster();
return new MainPhaseAction(MainPhaseAction.MainAction.SetMonster, card.ActionIndex);
......@@ -453,7 +452,7 @@ namespace WindBot.Game
_dialogs.SendSummon(card.Name);
return new MainPhaseAction(MainPhaseAction.MainAction.Summon, card.ActionIndex);
}
}
}
foreach (ClientCard card in main.SpellSetableCards)
{
if (ShouldExecute(exec, card, ExecutorType.SpellSet))
......
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