Skip to content

Commit

Permalink
update SuperheavySamuraiExecutor
Browse files Browse the repository at this point in the history
merge #197
  • Loading branch information
mercury233 committed Jul 9, 2024
1 parent eb5d8f4 commit 4a0dc09
Showing 1 changed file with 44 additions and 22 deletions.
66 changes: 44 additions & 22 deletions Game/AI/Decks/SuperheavySamuraiExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ public class CardId
public SuperheavySamuraiExecutor(GameAI ai, Duel 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.Sarutobi,SarutobiFunction);
AddExecutor(ExecutorType.Activate, CardId.Unicorn,UnicornFunction);
Expand All @@ -101,9 +102,8 @@ public SuperheavySamuraiExecutor(GameAI ai, Duel duel)
AddExecutor(ExecutorType.SpSummon, CardId.Scales);
AddExecutor(ExecutorType.Activate, CardId.Scales,ScalesFunction);

//Synchron
AddExecutor(ExecutorType.SpSummon, CardId.ASStardustDragon,ASStardustDragonSynchronFunction2);
AddExecutor(ExecutorType.SpSummon, CardId.Fleur,FleurSynchronFunction2);
//Synchron
AddExecutor(ExecutorType.SpSummon, CardId.PSYFramelordOmega,PSYFramelordOmegaSynchronFunction);

//Pendulum
AddExecutor(ExecutorType.Activate, CardId.Wakaushi,WakaushiFunction);
Expand Down Expand Up @@ -183,7 +183,6 @@ public SuperheavySamuraiExecutor(GameAI ai, Duel duel)
//Synchron
AddExecutor(ExecutorType.SpSummon, CardId.Masurawo,MasurawoSynchronFunction);
AddExecutor(ExecutorType.SpSummon, CardId.Sarutobi,DeSynchronFunction);
AddExecutor(ExecutorType.SpSummon, CardId.PSYFramelordOmega);

//equip Soulhorns
AddExecutor(ExecutorType.Activate, CardId.Soulhorns,SoulhornsEquipFunction);
Expand Down Expand Up @@ -213,12 +212,29 @@ public override void OnNewTurn()
activate_Genius = false;
activate_Sarutobi = false;
to_deck = false;
base.OnNewTurn();
}
public override bool OnSelectHand()
{
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)
{
if (player == 0 && location == CardLocation.MonsterZone)
Expand Down Expand Up @@ -597,14 +613,6 @@ private bool FleurSynchronFunction()
AI.SelectMaterials(materials_lists[0]);
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()
{
AI.SelectPosition(CardPosition.FaceUpDefence);
Expand All @@ -630,17 +638,26 @@ private bool ASStardustDragonSynchronFunction()
{
return (Bot.HasInExtra(CardId.Fleur) || Bot.HasInExtra(CardId.Masurawo));
}
return false;
}
private bool ASStardustDragonSynchronFunction2()
{
if (!activate_Scales || !activate_PSY) return false;
if (Bot.HasInGraveyard(CardId.Motorbike) || Bot.HasInGraveyard(CardId.PsyFramegearGamma))
else if (Bot.HasInMonstersZone(CardId.Motorbike))
{
return (Bot.HasInExtra(CardId.Fleur) || Bot.HasInExtra(CardId.Masurawo));
AI.SelectMaterials(CardId.Motorbike);
return true;
}
else if (Bot.HasInMonstersZone(CardId.PsyFramegearGamma))
{
AI.SelectMaterials(CardId.PsyFramegearGamma);
return true;
}
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()
{
if (Duel.LastChainPlayer == 1)
Expand Down Expand Up @@ -1156,6 +1173,11 @@ private bool IPLinkFunction()
AI.SelectMaterials(materials);
return true;
}
private bool PSYFunction()
{
activate_PSY = true;
return true;
}
private bool IPFunction()
{
if (Duel.LastChainPlayer == 0) return false;
Expand Down Expand Up @@ -1193,4 +1215,4 @@ private bool SarutobiFunction()
return true;
}
}
}
}

0 comments on commit 4a0dc09

Please sign in to comment.