Commit f4966efc authored by mercury233's avatar mercury233

Merge branch 'master' of https://github.com/IceYGO/windbot

parents 60252a31 61d40754
...@@ -64,6 +64,9 @@ namespace WindBot.Game.AI.Decks ...@@ -64,6 +64,9 @@ namespace WindBot.Game.AI.Decks
public OrcustExecutor(GameAI ai, Duel duel) public OrcustExecutor(GameAI ai, Duel duel)
: base(ai, duel) : base(ai, duel)
{ {
AddExecutor(ExecutorType.Activate, CardId.SkyStrikerMechaEagleBooster, EagleBoosterEffect);
AddExecutor(ExecutorType.Activate, CardId.OrcustratedClimax, ClimaxEffect);
AddExecutor(ExecutorType.Activate, CardId.MaxxC, DefaultMaxxC); AddExecutor(ExecutorType.Activate, CardId.MaxxC, DefaultMaxxC);
AddExecutor(ExecutorType.Activate, CardId.AshBlossomJoyousSpring, DefaultAshBlossomAndJoyousSpring); AddExecutor(ExecutorType.Activate, CardId.AshBlossomJoyousSpring, DefaultAshBlossomAndJoyousSpring);
AddExecutor(ExecutorType.Activate, CardId.GhostBelleHauntedMansion, DefaultGhostBelleAndHauntedMansion); AddExecutor(ExecutorType.Activate, CardId.GhostBelleHauntedMansion, DefaultGhostBelleAndHauntedMansion);
...@@ -80,6 +83,9 @@ namespace WindBot.Game.AI.Decks ...@@ -80,6 +83,9 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.SpSummon, CardId.SkyStrikerAceKagari); AddExecutor(ExecutorType.SpSummon, CardId.SkyStrikerAceKagari);
AddExecutor(ExecutorType.Activate, CardId.SkyStrikerAceKagari); AddExecutor(ExecutorType.Activate, CardId.SkyStrikerAceKagari);
AddExecutor(ExecutorType.SpSummon, CardId.KnightmareMermaid, KnightmareMermaidSummon);
AddExecutor(ExecutorType.Activate, CardId.KnightmareMermaid, KnightmareMermaidEffect);
AddExecutor(ExecutorType.SpSummon, CardId.TrickstarCarobein, CarobeinSummon); AddExecutor(ExecutorType.SpSummon, CardId.TrickstarCarobein, CarobeinSummon);
AddExecutor(ExecutorType.Activate, CardId.TrickstarCarobein); AddExecutor(ExecutorType.Activate, CardId.TrickstarCarobein);
...@@ -100,6 +106,8 @@ namespace WindBot.Game.AI.Decks ...@@ -100,6 +106,8 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.SpSummon, CardId.CrystronNeedlefiber, NeedlefiberSummonFirst); AddExecutor(ExecutorType.SpSummon, CardId.CrystronNeedlefiber, NeedlefiberSummonFirst);
AddExecutor(ExecutorType.Activate, CardId.CrystronNeedlefiber, NeedlefiberEffect); AddExecutor(ExecutorType.Activate, CardId.CrystronNeedlefiber, NeedlefiberEffect);
AddExecutor(ExecutorType.Activate, CardId.ShootingRiserDragon, ShootingRiserDragonEffect);
AddExecutor(ExecutorType.Summon, CardId.TrickstarCandina, CandinaSummon); AddExecutor(ExecutorType.Summon, CardId.TrickstarCandina, CandinaSummon);
AddExecutor(ExecutorType.Activate, CardId.TrickstarCandina, CandinaEffect); AddExecutor(ExecutorType.Activate, CardId.TrickstarCandina, CandinaEffect);
...@@ -112,8 +120,6 @@ namespace WindBot.Game.AI.Decks ...@@ -112,8 +120,6 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.SpSummon, CardId.KnightmarePhoenix, KnightmarePhoenixSummon); AddExecutor(ExecutorType.SpSummon, CardId.KnightmarePhoenix, KnightmarePhoenixSummon);
AddExecutor(ExecutorType.Activate, CardId.KnightmarePhoenix, KnightmarePhoenixEffect); AddExecutor(ExecutorType.Activate, CardId.KnightmarePhoenix, KnightmarePhoenixEffect);
AddExecutor(ExecutorType.SpSummon, CardId.KnightmareMermaid, KnightmareMermaidSummon);
AddExecutor(ExecutorType.Activate, CardId.KnightmareMermaid, KnightmareMermaidEffect);
AddExecutor(ExecutorType.SpSummon, CardId.GalateaTheOrcustAutomaton, GalateaSummonFirst); AddExecutor(ExecutorType.SpSummon, CardId.GalateaTheOrcustAutomaton, GalateaSummonFirst);
...@@ -155,15 +161,17 @@ namespace WindBot.Game.AI.Decks ...@@ -155,15 +161,17 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Summon, CardId.MaxxC, LinkMaterialSummon); AddExecutor(ExecutorType.Summon, CardId.MaxxC, LinkMaterialSummon);
AddExecutor(ExecutorType.Summon, CardId.ThePhantomKnightsofSilentBoots, LinkMaterialSummon); AddExecutor(ExecutorType.Summon, CardId.ThePhantomKnightsofSilentBoots, LinkMaterialSummon);
AddExecutor(ExecutorType.SpSummon, CardId.CrystronNeedlefiber, NeedlefiberSummonSecond);
AddExecutor(ExecutorType.SpSummon, CardId.BorrelswordDragon, BorrelswordDragonSummon);
AddExecutor(ExecutorType.Activate, CardId.BorrelswordDragon, BorrelswordDragonEffect);
AddExecutor(ExecutorType.SpellSet, CardId.PhantomKnightsFogBlade); AddExecutor(ExecutorType.SpellSet, CardId.PhantomKnightsFogBlade);
AddExecutor(ExecutorType.Activate, CardId.PhantomKnightsFogBlade, FogBladeEffect); AddExecutor(ExecutorType.Activate, CardId.PhantomKnightsFogBlade, FogBladeEffect);
AddExecutor(ExecutorType.SpellSet, CardId.OrcustratedClimax); AddExecutor(ExecutorType.SpellSet, CardId.OrcustratedClimax);
AddExecutor(ExecutorType.Activate, CardId.OrcustratedClimax, ClimaxEffect);
AddExecutor(ExecutorType.Activate, CardId.OrcustratedBabel, BabelEffect); AddExecutor(ExecutorType.Activate, CardId.OrcustratedBabel, BabelEffect);
AddExecutor(ExecutorType.Activate, CardId.SkyStrikerMechaEagleBooster, EagleBoosterEffect);
AddExecutor(ExecutorType.Repos, MonsterRepos); AddExecutor(ExecutorType.Repos, MonsterRepos);
} }
...@@ -171,8 +179,8 @@ namespace WindBot.Game.AI.Decks ...@@ -171,8 +179,8 @@ namespace WindBot.Game.AI.Decks
private bool SheorcustDingirsuSummoned = false; private bool SheorcustDingirsuSummoned = false;
private bool HarpHorrorUsed = false; private bool HarpHorrorUsed = false;
private bool CymbalSkeletonUsed = false; private bool CymbalSkeletonUsed = false;
private bool BorrelswordDragonUsed = false;
private ClientCard RustyBardicheTarget = null; private ClientCard RustyBardicheTarget = null;
private ClientCard LightStageTarget = null;
private int[] HandCosts = new[] private int[] HandCosts = new[]
{ {
...@@ -204,8 +212,8 @@ namespace WindBot.Game.AI.Decks ...@@ -204,8 +212,8 @@ namespace WindBot.Game.AI.Decks
SheorcustDingirsuSummoned = false; SheorcustDingirsuSummoned = false;
HarpHorrorUsed = false; HarpHorrorUsed = false;
CymbalSkeletonUsed = false; CymbalSkeletonUsed = false;
BorrelswordDragonUsed = false;
RustyBardicheTarget = null; RustyBardicheTarget = null;
LightStageTarget = null;
} }
public override void OnChainEnd() public override void OnChainEnd()
...@@ -228,7 +236,7 @@ namespace WindBot.Game.AI.Decks ...@@ -228,7 +236,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (location == CardLocation.SpellZone) if (location == CardLocation.SpellZone)
{ {
if(cardId==CardId.KnightmarePhoenix || cardId == CardId.CrystronNeedlefiber) if (cardId == CardId.KnightmarePhoenix || cardId == CardId.CrystronNeedlefiber)
{ {
ClientCard b = Bot.MonsterZone.GetFirstMatchingCard(card => card.Id == CardId.BorreloadSavageDragon); ClientCard b = Bot.MonsterZone.GetFirstMatchingCard(card => card.Id == CardId.BorreloadSavageDragon);
int zone = (1 << (b?.Sequence ?? 0)) & available; int zone = (1 << (b?.Sequence ?? 0)) & available;
...@@ -263,7 +271,7 @@ namespace WindBot.Game.AI.Decks ...@@ -263,7 +271,7 @@ namespace WindBot.Game.AI.Decks
if ((zones & Zones.z0) > 0) if ((zones & Zones.z0) > 0)
return Zones.z0; return Zones.z0;
} }
if(cardId == CardId.GalateaTheOrcustAutomaton) if (cardId == CardId.GalateaTheOrcustAutomaton)
{ {
int zones = Bot.GetLinkedZones() & available; int zones = Bot.GetLinkedZones() & available;
if ((zones & Zones.z0) > 0) if ((zones & Zones.z0) > 0)
...@@ -277,7 +285,18 @@ namespace WindBot.Game.AI.Decks ...@@ -277,7 +285,18 @@ namespace WindBot.Game.AI.Decks
if ((zones & Zones.z4) > 0) if ((zones & Zones.z4) > 0)
return Zones.z4; return Zones.z4;
} }
if (cardId == CardId.KnightmarePhoenix)
{
if ((Enemy.MonsterZone[5]?.HasLinkMarker(CardLinkMarker.Top) ?? false) && (available & Zones.z3) > 0)
return Zones.z3;
if ((Enemy.MonsterZone[6]?.HasLinkMarker(CardLinkMarker.Top) ?? false) && (available & Zones.z1) > 0)
return Zones.z1;
}
if ((available & Zones.z6) > 0)
return Zones.z6;
if ((available & Zones.z5) > 0)
return Zones.z5;
if ((available & Zones.z1) > 0) if ((available & Zones.z1) > 0)
return Zones.z1; return Zones.z1;
if ((available & Zones.z3) > 0) if ((available & Zones.z3) > 0)
...@@ -292,6 +311,22 @@ namespace WindBot.Game.AI.Decks ...@@ -292,6 +311,22 @@ namespace WindBot.Game.AI.Decks
return 0; return 0;
} }
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{
if (!defender.IsMonsterHasPreventActivationEffectInBattle())
{
if (attacker.IsCode(CardId.TrickstarCandina) && Bot.HasInHand(CardId.TrickstarCarobein))
attacker.RealPower = attacker.RealPower + 1800;
if (attacker.IsCode(CardId.BorrelswordDragon) && !attacker.IsDisabled() && !BorrelswordDragonUsed)
{
attacker.RealPower = attacker.RealPower + defender.GetDefensePower() / 2;
defender.RealPower = defender.RealPower - defender.GetDefensePower() / 2;
}
}
return base.OnPreBattleBetween(attacker, defender);
}
private bool TerraformingEffect() private bool TerraformingEffect()
{ {
AI.SelectCard(CardId.TrickstarLightStage); AI.SelectCard(CardId.TrickstarLightStage);
...@@ -332,7 +367,6 @@ namespace WindBot.Game.AI.Decks ...@@ -332,7 +367,6 @@ namespace WindBot.Game.AI.Decks
return true; return true;
} }
ClientCard target = Enemy.SpellZone.GetFirstMatchingCard(card => card.IsFacedown()); ClientCard target = Enemy.SpellZone.GetFirstMatchingCard(card => card.IsFacedown());
LightStageTarget = target;
AI.SelectCard(target); AI.SelectCard(target);
return true; return true;
} }
...@@ -440,7 +474,7 @@ namespace WindBot.Game.AI.Decks ...@@ -440,7 +474,7 @@ namespace WindBot.Game.AI.Decks
if (Bot.GetMonsterCount() > 1) if (Bot.GetMonsterCount() > 1)
return false; return false;
ClientCard mat = Bot.GetMonsters().First(); ClientCard mat = Bot.GetMonsters().First();
if(mat.IsCode(new[] { if (mat.IsCode(new[] {
CardId.JetSynchron, CardId.JetSynchron,
CardId.ThePhantomKnightsofAncientCloak, CardId.ThePhantomKnightsofAncientCloak,
CardId.ThePhantomKnightsofSilentBoots CardId.ThePhantomKnightsofSilentBoots
...@@ -464,24 +498,71 @@ namespace WindBot.Game.AI.Decks ...@@ -464,24 +498,71 @@ namespace WindBot.Game.AI.Decks
if (!Bot.HasInHand(CardId.JetSynchron) && Bot.GetRemainingCount(CardId.JetSynchron, 1) == 0) if (!Bot.HasInHand(CardId.JetSynchron) && Bot.GetRemainingCount(CardId.JetSynchron, 1) == 0)
return false; return false;
int[] firstMats = new[] { int[] matids = new[] {
CardId.DestrudoTheLostDragonsFrisson, CardId.DestrudoTheLostDragonsFrisson,
CardId.AshBlossomJoyousSpring, CardId.AshBlossomJoyousSpring,
CardId.GhostBelleHauntedMansion, CardId.GhostBelleHauntedMansion,
CardId.ArmageddonKnight,
CardId.ScrapRecycler,
CardId.SkyStrikerMechaHornetDronesToken, CardId.SkyStrikerMechaHornetDronesToken,
CardId.TrickstarCarobein,
CardId.SkyStrikerAceKagari, CardId.SkyStrikerAceKagari,
CardId.ScrapRecycler,
CardId.ArmageddonKnight,
CardId.TrickstarCandina, CardId.TrickstarCandina,
CardId.TrickstarCarobein,
CardId.OrcustHarpHorror, CardId.OrcustHarpHorror,
CardId.OrcustCymbalSkeleton, CardId.OrcustCymbalSkeleton,
CardId.ThePhantomKnightsofAncientCloak, CardId.ThePhantomKnightsofAncientCloak,
CardId.ThePhantomKnightsofSilentBoots CardId.ThePhantomKnightsofSilentBoots
}; };
if (Bot.MonsterZone.GetMatchingCardsCount(card => card.IsCode(firstMats)) >= 2) if (Bot.MonsterZone.GetMatchingCardsCount(card => card.IsCode(matids)) >= 2)
{ {
AI.SelectMaterials(firstMats); AI.SelectMaterials(matids);
return true;
}
return false;
}
private bool NeedlefiberSummonSecond()
{
IList<ClientCard> selected = new List<ClientCard>();
ClientCard tuner = Bot.MonsterZone.GetFirstMatchingFaceupCard(card => card.IsCode(new[]
{
CardId.DestrudoTheLostDragonsFrisson,
CardId.AshBlossomJoyousSpring,
CardId.GhostBelleHauntedMansion,
CardId.JetSynchron
}));
if (tuner != null)
selected.Add(tuner);
int[] matids = new[] {
CardId.SkyStrikerMechaHornetDronesToken,
CardId.ThePhantomKnightsofShadeBrigandine,
CardId.SkyStrikerAceKagari,
CardId.ScrapRecycler,
CardId.ArmageddonKnight,
CardId.OrcustHarpHorror,
CardId.OrcustCymbalSkeleton,
CardId.ThePhantomKnightsofAncientCloak,
CardId.ThePhantomKnightsofSilentBoots
};
IList<ClientCard> mats = Bot.MonsterZone.GetMatchingCards(card => card.Attack <= 1700);
for (int i = 0; i < matids.Length && selected.Count < 2; i++)
{
ClientCard c = mats.GetFirstMatchingFaceupCard(card => card.IsCode(matids[i]));
if (c != null)
{
selected.Add(c);
if (selected.Count == 2 && Util.GetBotAvailZonesFromExtraDeck(selected) == 0)
selected.Remove(c);
}
}
if (selected.Count == 2)
{
AI.SelectMaterials(selected);
return true; return true;
} }
return false; return false;
...@@ -493,6 +574,45 @@ namespace WindBot.Game.AI.Decks ...@@ -493,6 +574,45 @@ namespace WindBot.Game.AI.Decks
return true; return true;
} }
private bool ShootingRiserDragonEffect()
{
if (ActivateDescription == -1 || (ActivateDescription == Util.GetStringId(CardId.ShootingRiserDragon, 0)))
{
if (Bot.MonsterZone.IsExistingMatchingCard(card => card.Level == 3 && card.IsFaceup() && !card.IsTuner()) && Bot.GetRemainingCount(CardId.MaxxC, 3) > 0)
{
AI.SelectCard(CardId.MaxxC);
}
else if (Bot.MonsterZone.IsExistingMatchingCard(card => card.Level == 4 && card.IsFaceup() && !card.IsTuner()))
{
AI.SelectCard(new[] {
CardId.ThePhantomKnightsofAncientCloak,
CardId.ThePhantomKnightsofSilentBoots,
CardId.ScrapRecycler,
CardId.OrcustCymbalSkeleton,
CardId.AshBlossomJoyousSpring,
CardId.GhostBelleHauntedMansion
});
}
else if (Bot.MonsterZone.IsExistingMatchingCard(card => card.Level == 5 && card.IsFaceup() && !card.IsTuner()))
{
AI.SelectCard(new[] {
CardId.OrcustHarpHorror,
CardId.ArmageddonKnight,
CardId.TrickstarCandina
});
}
else
{
FoolishBurialEffect();
}
return true;
}
else
{
return Duel.LastChainPlayer != 0;
}
}
private bool KnightmarePhoenixSummon() private bool KnightmarePhoenixSummon()
{ {
if (!KnightmareMermaidSummon()) if (!KnightmareMermaidSummon())
...@@ -511,10 +631,9 @@ namespace WindBot.Game.AI.Decks ...@@ -511,10 +631,9 @@ namespace WindBot.Game.AI.Decks
CardId.TrickstarCandina, CardId.TrickstarCandina,
CardId.TrickstarCarobein CardId.TrickstarCarobein
}; };
if(Bot.MonsterZone.GetMatchingCardsCount(card => card.IsCode(firstMats)) >= 2) if (Bot.MonsterZone.GetMatchingCardsCount(card => card.IsCode(firstMats)) >= 2)
{ {
AI.SelectMaterials(firstMats); AI.SelectMaterials(firstMats);
PhoenixSelectPlace();
return true; return true;
} }
int[] secondMats = new[] { int[] secondMats = new[] {
...@@ -533,29 +652,21 @@ namespace WindBot.Game.AI.Decks ...@@ -533,29 +652,21 @@ namespace WindBot.Game.AI.Decks
if (Bot.MonsterZone.GetMatchingCardsCount(card => card.IsCode(mats)) >= 2) if (Bot.MonsterZone.GetMatchingCardsCount(card => card.IsCode(mats)) >= 2)
{ {
AI.SelectMaterials(mats); AI.SelectMaterials(mats);
PhoenixSelectPlace();
return true; return true;
} }
return false; return false;
} }
private void PhoenixSelectPlace()
{
if (Enemy.MonsterZone[5]?.HasLinkMarker(CardLinkMarker.Top) ?? false)
AI.SelectPlace(Zones.z3);
if (Enemy.MonsterZone[6]?.HasLinkMarker(CardLinkMarker.Top) ?? false)
AI.SelectPlace(Zones.z1);
}
private bool KnightmarePhoenixEffect() private bool KnightmarePhoenixEffect()
{ {
IList<ClientCard> costCards = Bot.Hand.GetMatchingCards(card => card.IsCode(HandCosts)); int costcount = Bot.Hand.GetMatchingCardsCount(card => card.IsCode(HandCosts));
ClientCard target = Enemy.SpellZone.GetFloodgate(); ClientCard target = Enemy.SpellZone.GetFloodgate();
if (costCards.Count > 1 || (Bot.GetHandCount() > 1 && target != null)) ClientCard anytarget = Enemy.SpellZone.GetFirstMatchingCard(card => !card.OwnTargets.Any(cont => cont.IsCode(CardId.TrickstarLightStage)));
if ((costcount > 1 && anytarget != null) || (Bot.GetHandCount() > 1 && target != null))
{ {
AI.SelectCard(HandCosts); AI.SelectCard(HandCosts);
if (target == null) if (target == null)
target = Enemy.SpellZone.GetFirstMatchingCard(card => card != LightStageTarget); target = anytarget;
AI.SelectNextCard(target); AI.SelectNextCard(target);
return true; return true;
} }
...@@ -604,7 +715,7 @@ namespace WindBot.Game.AI.Decks ...@@ -604,7 +715,7 @@ namespace WindBot.Game.AI.Decks
AI.SelectNextCard(CardId.WorldLegacyWorldWand); AI.SelectNextCard(CardId.WorldLegacyWorldWand);
return true; return true;
} }
else if(!Bot.HasInGraveyard(CardId.OrcustCymbalSkeleton) && Bot.GetRemainingCount(CardId.OrcustCymbalSkeleton, 1) > 0 && Bot.HasInGraveyard(CardId.SheorcustDingirsu) && !SheorcustDingirsuSummoned) else if (!Bot.HasInGraveyard(CardId.OrcustCymbalSkeleton) && Bot.GetRemainingCount(CardId.OrcustCymbalSkeleton, 1) > 0 && Bot.HasInGraveyard(CardId.SheorcustDingirsu) && !SheorcustDingirsuSummoned)
{ {
AI.SelectCard(CardId.GalateaTheOrcustAutomaton); AI.SelectCard(CardId.GalateaTheOrcustAutomaton);
AI.SelectNextCard(CardId.OrcustCymbalSkeleton); AI.SelectNextCard(CardId.OrcustCymbalSkeleton);
...@@ -682,7 +793,7 @@ namespace WindBot.Game.AI.Decks ...@@ -682,7 +793,7 @@ namespace WindBot.Game.AI.Decks
} }
else if (Duel.Player == 0 && Bot.HasInGraveyard(CardId.SheorcustDingirsu) && !SheorcustDingirsuSummoned) else if (Duel.Player == 0 && Bot.HasInGraveyard(CardId.SheorcustDingirsu) && !SheorcustDingirsuSummoned)
{ {
AI.SelectCard(botTurnTargets); AI.SelectCard(emenyTurnTargets);
SheorcustDingirsuSummoned = true; SheorcustDingirsuSummoned = true;
CymbalSkeletonUsed = true; CymbalSkeletonUsed = true;
return true; return true;
...@@ -709,6 +820,7 @@ namespace WindBot.Game.AI.Decks ...@@ -709,6 +820,7 @@ namespace WindBot.Game.AI.Decks
if (ActivateDescription == 96) if (ActivateDescription == 96)
{ {
// TODO: FogBlade lost target // TODO: FogBlade lost target
AI.SelectCard(CardId.OrcustCymbalSkeleton);
return true; return true;
} }
ClientCard target; ClientCard target;
...@@ -790,21 +902,46 @@ namespace WindBot.Game.AI.Decks ...@@ -790,21 +902,46 @@ namespace WindBot.Game.AI.Decks
if (Bot.HasInMonstersZone(CardId.GalateaTheOrcustAutomaton)) if (Bot.HasInMonstersZone(CardId.GalateaTheOrcustAutomaton))
return false; return false;
IList<ClientCard> mats = Bot.MonsterZone.GetMatchingCards(card => card.IsCode(CardId.SheorcustDingirsu) || (card.Level > 0 && card.Level <= 7)); IList<ClientCard> selected = new List<ClientCard>();
if (mats.Count >= 2)
if (!Bot.HasInGraveyard(CardId.SheorcustDingirsu))
{ {
AI.SelectMaterials(new[] { ClientCard sheorcustDingirsu = Bot.MonsterZone.GetFirstMatchingFaceupCard(card => card.IsCode(CardId.SheorcustDingirsu));
if (sheorcustDingirsu != null)
selected.Add(sheorcustDingirsu);
}
int[] matids = new[] {
CardId.SkyStrikerMechaHornetDronesToken, CardId.SkyStrikerMechaHornetDronesToken,
CardId.OrcustKnightmare,
CardId.ThePhantomKnightsofShadeBrigandine, CardId.ThePhantomKnightsofShadeBrigandine,
CardId.ThePhantomKnightsofSilentBoots, CardId.ThePhantomKnightsofSilentBoots,
CardId.ThePhantomKnightsofAncientCloak, CardId.ThePhantomKnightsofAncientCloak,
CardId.OrcustCymbalSkeleton, CardId.OrcustCymbalSkeleton,
CardId.OrcustHarpHorror, CardId.OrcustHarpHorror,
CardId.ScrapRecycler,
CardId.CrystronNeedlefiber, CardId.CrystronNeedlefiber,
CardId.SkyStrikerAceKagari, CardId.SkyStrikerAceKagari,
CardId.KnightmareMermaid, CardId.KnightmareMermaid,
CardId.ArmageddonKnight CardId.ArmageddonKnight
}); };
IList<ClientCard> mats = Bot.MonsterZone.GetMatchingCards(card => card.Level > 0 && card.Level <= 7);
for (int i = 0; i < matids.Length && selected.Count < 2; i++)
{
ClientCard c = mats.GetFirstMatchingFaceupCard(card => card.IsCode(matids[i]));
if (c != null)
{
selected.Add(c);
if (selected.Count == 2 && Util.GetBotAvailZonesFromExtraDeck(selected) == 0)
selected.Remove(c);
}
}
if (selected.Count == 2)
{
AI.SelectMaterials(selected);
return true; return true;
} }
...@@ -826,6 +963,72 @@ namespace WindBot.Game.AI.Decks ...@@ -826,6 +963,72 @@ namespace WindBot.Game.AI.Decks
return true; return true;
} }
private bool BorrelswordDragonSummon()
{
if (Util.IsTurn1OrMain2())
return false;
List<ClientCard> mats = Bot.MonsterZone.GetMatchingCards(card => card.IsFaceup() && card.HasType(CardType.Effect) && card.Attack <= 2000).ToList();
mats.Sort(CardContainer.CompareCardAttack);
mats.Reverse();
int link = 0;
bool doubleused = false;
IList<ClientCard> selected = new List<ClientCard>();
foreach (ClientCard card in mats)
{
selected.Add(card);
if (!doubleused && card.LinkCount == 2)
{
doubleused = true;
link += 2;
}
else
link++;
if (link >= 4)
break;
}
if (link >= 4 && Util.GetBotAvailZonesFromExtraDeck(selected) > 0)
{
AI.SelectMaterials(selected);
return true;
}
return false;
}
private bool BorrelswordDragonEffect()
{
if (ActivateDescription == -1 || ActivateDescription == Util.GetStringId(CardId.BorrelswordDragon, 1))
{
BorrelswordDragonUsed = true;
return true;
}
else
{
if (Duel.Player == 0 && (Duel.Turn == 1 || Duel.Phase >= DuelPhase.Main2))
{
return false;
}
ClientCard target = Bot.MonsterZone.GetFirstMatchingCard(card => card.IsAttack() && !card.HasType(CardType.Link) && card.Attacked && !card.IsShouldNotBeTarget());
if (target != null)
{
AI.SelectCard(target);
return true;
}
if (!Bot.MonsterZone.IsExistingMatchingCard(card => card.IsAttack() && !card.HasType(CardType.Link)))
{
target = Enemy.MonsterZone.GetFirstMatchingCard(card => card.IsAttack() && !card.HasType(CardType.Link) && !card.IsShouldNotBeTarget());
if (target != null)
{
AI.SelectCard(target);
return true;
}
}
return false;
}
}
private bool BabelEffect() private bool BabelEffect()
{ {
if (Card.Location == CardLocation.Grave) if (Card.Location == CardLocation.Grave)
...@@ -855,7 +1058,7 @@ namespace WindBot.Game.AI.Decks ...@@ -855,7 +1058,7 @@ namespace WindBot.Game.AI.Decks
private bool OneCardComboSummon() private bool OneCardComboSummon()
{ {
if (Bot.HasInExtra(CardId.SalamangreatAlmiraj) && Bot.HasInExtra(new[] { CardId.CrystronNeedlefiber, CardId.KnightmarePhoenix })) if (Bot.HasInExtra(CardId.SalamangreatAlmiraj) && Bot.HasInExtra(new[] { CardId.CrystronNeedlefiber, CardId.KnightmarePhoenix }) && Bot.GetMonsterCount() < 3)
{ {
NormalSummoned = true; NormalSummoned = true;
return true; return true;
...@@ -865,7 +1068,7 @@ namespace WindBot.Game.AI.Decks ...@@ -865,7 +1068,7 @@ namespace WindBot.Game.AI.Decks
private bool LinkMaterialSummon() private bool LinkMaterialSummon()
{ {
if (Bot.HasInExtra(CardId.KnightmarePhoenix) && Bot.GetMonsterCount() > 0) if (Bot.HasInExtra(CardId.KnightmarePhoenix) && Bot.GetMonsterCount() > 0 && Bot.GetMonsterCount() < 3)
{ {
NormalSummoned = true; NormalSummoned = true;
return true; return true;
...@@ -875,7 +1078,7 @@ namespace WindBot.Game.AI.Decks ...@@ -875,7 +1078,7 @@ namespace WindBot.Game.AI.Decks
private bool TunerSummon() private bool TunerSummon()
{ {
if (Bot.HasInExtra(new[] { CardId.CrystronNeedlefiber, CardId.KnightmarePhoenix }) && Bot.GetMonsterCount() > 0) if (Bot.HasInExtra(new[] { CardId.CrystronNeedlefiber, CardId.KnightmarePhoenix }) && Bot.GetMonsterCount() > 0 && Bot.GetMonsterCount() < 3)
{ {
NormalSummoned = true; NormalSummoned = true;
return true; return true;
......
...@@ -220,8 +220,9 @@ namespace WindBot.Game.AI.Decks ...@@ -220,8 +220,9 @@ namespace WindBot.Game.AI.Decks
{ {
CardId.WindUpSoldier, CardId.WindUpSoldier,
CardId.StarDrawing, CardId.StarDrawing,
CardId.ChronomalyGoldenJet CardId.ChronomalyGoldenJet,
}) || (Bot.HasInHand(CardId.MistArchfiend) && NeedLV5())) CardId.MistArchfiend
}))
{ {
NormalSummoned = false; NormalSummoned = false;
DoubleSummonUsed = true; DoubleSummonUsed = true;
......
...@@ -79,9 +79,9 @@ namespace WindBot.Game.AI.Decks ...@@ -79,9 +79,9 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, CardId.Number61Volcasaurus); AddExecutor(ExecutorType.Activate, CardId.Number61Volcasaurus);
// Weapons // Weapons
AddExecutor(ExecutorType.Activate, CardId.ZwTornadoBringer); AddExecutor(ExecutorType.Activate, CardId.ZwTornadoBringer, ZwWeapon);
AddExecutor(ExecutorType.Activate, CardId.ZwLightningBlade); AddExecutor(ExecutorType.Activate, CardId.ZwLightningBlade, ZwWeapon);
AddExecutor(ExecutorType.Activate, CardId.ZwAsuraStrike); AddExecutor(ExecutorType.Activate, CardId.ZwAsuraStrike, ZwWeapon);
// Special summons // Special summons
...@@ -122,6 +122,13 @@ namespace WindBot.Game.AI.Decks ...@@ -122,6 +122,13 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, CardId.SolemnStrike, DefaultSolemnStrike); AddExecutor(ExecutorType.Activate, CardId.SolemnStrike, DefaultSolemnStrike);
} }
private int ZwCount = 0;
public override void OnNewTurn()
{
ZwCount = 0;
}
public override bool OnSelectHand() public override bool OnSelectHand()
{ {
return false; return false;
...@@ -164,10 +171,16 @@ namespace WindBot.Game.AI.Decks ...@@ -164,10 +171,16 @@ namespace WindBot.Game.AI.Decks
if (ActivateDescription == Util.GetStringId(CardId.ZwLionArms, 0)) if (ActivateDescription == Util.GetStringId(CardId.ZwLionArms, 0))
return true; return true;
if (ActivateDescription == Util.GetStringId(CardId.ZwLionArms, 1)) if (ActivateDescription == Util.GetStringId(CardId.ZwLionArms, 1))
return !Card.IsDisabled(); return !Card.IsDisabled() && ZwWeapon();
return false; return false;
} }
private bool ZwWeapon()
{
ZwCount++;
return ZwCount < 10;
}
private bool ReinforcementOfTheArmy() private bool ReinforcementOfTheArmy()
{ {
AI.SelectCard( AI.SelectCard(
......
...@@ -506,6 +506,11 @@ namespace WindBot.Game ...@@ -506,6 +506,11 @@ namespace WindBot.Game
_duel.Fields[1].BattlingMonster = null; _duel.Fields[1].BattlingMonster = null;
_duel.Fields[0].UnderAttack = false; _duel.Fields[0].UnderAttack = false;
_duel.Fields[1].UnderAttack = false; _duel.Fields[1].UnderAttack = false;
List<ClientCard> monsters = _duel.Fields[0].GetMonsters();
foreach (ClientCard monster in monsters)
{
monster.Attacked = false;
}
_select_hint = 0; _select_hint = 0;
_ai.OnNewPhase(); _ai.OnNewPhase();
} }
......
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