Commit 4a0dc098 authored by mercury233's avatar mercury233

update SuperheavySamuraiExecutor

merge #197
parent eb5d8f48
...@@ -80,7 +80,8 @@ namespace WindBot.Game.AI.Decks ...@@ -80,7 +80,8 @@ namespace WindBot.Game.AI.Decks
public SuperheavySamuraiExecutor(GameAI ai, Duel duel) public SuperheavySamuraiExecutor(GameAI ai, Duel duel)
: base(ai, duel) : base(ai, duel)
{ {
AddExecutor(ExecutorType.Activate, CardId.PSYFramelordOmega); AddExecutor(ExecutorType.Repos, MonsterRepos);
AddExecutor(ExecutorType.Activate, CardId.PSYFramelordOmega,PSYFunction);
AddExecutor(ExecutorType.Activate, CardId.IP,IPFunction); AddExecutor(ExecutorType.Activate, CardId.IP,IPFunction);
AddExecutor(ExecutorType.Activate, CardId.Sarutobi,SarutobiFunction); AddExecutor(ExecutorType.Activate, CardId.Sarutobi,SarutobiFunction);
AddExecutor(ExecutorType.Activate, CardId.Unicorn,UnicornFunction); AddExecutor(ExecutorType.Activate, CardId.Unicorn,UnicornFunction);
...@@ -102,8 +103,7 @@ namespace WindBot.Game.AI.Decks ...@@ -102,8 +103,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, CardId.Scales,ScalesFunction); AddExecutor(ExecutorType.Activate, CardId.Scales,ScalesFunction);
//Synchron //Synchron
AddExecutor(ExecutorType.SpSummon, CardId.ASStardustDragon,ASStardustDragonSynchronFunction2); AddExecutor(ExecutorType.SpSummon, CardId.PSYFramelordOmega,PSYFramelordOmegaSynchronFunction);
AddExecutor(ExecutorType.SpSummon, CardId.Fleur,FleurSynchronFunction2);
//Pendulum //Pendulum
AddExecutor(ExecutorType.Activate, CardId.Wakaushi,WakaushiFunction); AddExecutor(ExecutorType.Activate, CardId.Wakaushi,WakaushiFunction);
...@@ -183,7 +183,6 @@ namespace WindBot.Game.AI.Decks ...@@ -183,7 +183,6 @@ namespace WindBot.Game.AI.Decks
//Synchron //Synchron
AddExecutor(ExecutorType.SpSummon, CardId.Masurawo,MasurawoSynchronFunction); AddExecutor(ExecutorType.SpSummon, CardId.Masurawo,MasurawoSynchronFunction);
AddExecutor(ExecutorType.SpSummon, CardId.Sarutobi,DeSynchronFunction); AddExecutor(ExecutorType.SpSummon, CardId.Sarutobi,DeSynchronFunction);
AddExecutor(ExecutorType.SpSummon, CardId.PSYFramelordOmega);
//equip Soulhorns //equip Soulhorns
AddExecutor(ExecutorType.Activate, CardId.Soulhorns,SoulhornsEquipFunction); AddExecutor(ExecutorType.Activate, CardId.Soulhorns,SoulhornsEquipFunction);
...@@ -213,12 +212,29 @@ namespace WindBot.Game.AI.Decks ...@@ -213,12 +212,29 @@ namespace WindBot.Game.AI.Decks
activate_Genius = false; activate_Genius = false;
activate_Sarutobi = false; activate_Sarutobi = false;
to_deck = false; to_deck = false;
base.OnNewTurn();
} }
public override bool OnSelectHand() public override bool OnSelectHand()
{ {
return true; return true;
} }
private bool MonsterRepos()
{
if (Card.IsFacedown())
return true;
if (Card.IsFaceup() && Card.IsAttack() && (Card.Id == CardId.Masurawo || Card.Id == CardId.Sarutobi))
return true;
return false;
}
public override CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions)
{
YGOSharp.OCGWrapper.NamedCard cardData = YGOSharp.OCGWrapper.NamedCard.Get(cardId);
if (cardData != null)
{
if (cardId == CardId.Masurawo || cardId == CardId.Sarutobi)
return CardPosition.FaceUpDefence;
}
return 0;
}
public override int OnSelectPlace(int cardId, int player, CardLocation location, int available) public override int OnSelectPlace(int cardId, int player, CardLocation location, int available)
{ {
if (player == 0 && location == CardLocation.MonsterZone) if (player == 0 && location == CardLocation.MonsterZone)
...@@ -597,14 +613,6 @@ namespace WindBot.Game.AI.Decks ...@@ -597,14 +613,6 @@ namespace WindBot.Game.AI.Decks
AI.SelectMaterials(materials_lists[0]); AI.SelectMaterials(materials_lists[0]);
return true; return true;
} }
private bool FleurSynchronFunction2()
{
var materials_lists = Util.GetSynchroMaterials(Bot.MonsterZone,10,1,1,false,false,null,
card => { return !FinalCards(card.Id); });
if (materials_lists.Count <= 0) return false;
AI.SelectMaterials(materials_lists[0]);
return true;
}
private bool DeSynchronFunction() private bool DeSynchronFunction()
{ {
AI.SelectPosition(CardPosition.FaceUpDefence); AI.SelectPosition(CardPosition.FaceUpDefence);
...@@ -630,17 +638,26 @@ namespace WindBot.Game.AI.Decks ...@@ -630,17 +638,26 @@ namespace WindBot.Game.AI.Decks
{ {
return (Bot.HasInExtra(CardId.Fleur) || Bot.HasInExtra(CardId.Masurawo)); return (Bot.HasInExtra(CardId.Fleur) || Bot.HasInExtra(CardId.Masurawo));
} }
return false; else if (Bot.HasInMonstersZone(CardId.Motorbike))
}
private bool ASStardustDragonSynchronFunction2()
{ {
if (!activate_Scales || !activate_PSY) return false; AI.SelectMaterials(CardId.Motorbike);
if (Bot.HasInGraveyard(CardId.Motorbike) || Bot.HasInGraveyard(CardId.PsyFramegearGamma)) return true;
}
else if (Bot.HasInMonstersZone(CardId.PsyFramegearGamma))
{ {
return (Bot.HasInExtra(CardId.Fleur) || Bot.HasInExtra(CardId.Masurawo)); AI.SelectMaterials(CardId.PsyFramegearGamma);
return true;
} }
return false; return false;
} }
private bool PSYFramelordOmegaSynchronFunction()
{
if (Bot.HasInMonstersZone(CardId.Motorbike))
AI.SelectMaterials(CardId.Motorbike);
else if (Bot.HasInMonstersZone(CardId.PsyFramegearGamma))
AI.SelectMaterials(CardId.PsyFramegearGamma);
return activate_PSY || activate_Scales;
}
private bool SavageDragonFunction() private bool SavageDragonFunction()
{ {
if (Duel.LastChainPlayer == 1) if (Duel.LastChainPlayer == 1)
...@@ -1156,6 +1173,11 @@ namespace WindBot.Game.AI.Decks ...@@ -1156,6 +1173,11 @@ namespace WindBot.Game.AI.Decks
AI.SelectMaterials(materials); AI.SelectMaterials(materials);
return true; return true;
} }
private bool PSYFunction()
{
activate_PSY = true;
return true;
}
private bool IPFunction() private bool IPFunction()
{ {
if (Duel.LastChainPlayer == 0) return false; if (Duel.LastChainPlayer == 0) return false;
......
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