Commit 79206c87 authored by mercury233's avatar mercury233

add recognize Floodgates

parent 78be7e2f
......@@ -120,7 +120,10 @@ namespace WindBot.Game.AI
ClientCard card = Duel.Fields[1].MonsterZone.GetInvincibleMonster();
if (card != null)
return card;
card = Duel.Fields[1].SpellZone.GetNegateAttackSpell();
card = Duel.Fields[1].MonsterZone.GetFloodgate();
if (card != null)
return card;
card = Duel.Fields[1].SpellZone.GetFloodgate();
if (card != null)
return card;
if (attack == 0)
......
......@@ -164,5 +164,15 @@ namespace WindBot.Game.AI
}
return null;
}
public static ClientCard GetFloodgate(this IEnumerable<ClientCard> cards)
{
foreach (ClientCard card in cards)
{
if (card != null && card.IsFloodgate())
return card;
}
return null;
}
}
}
\ No newline at end of file
......@@ -19,5 +19,10 @@ namespace WindBot.Game.AI
{
return Enum.IsDefined(typeof(NegateAttackSpell), card.Id);
}
public static bool IsFloodgate(this ClientCard card)
{
return Enum.IsDefined(typeof(Floodgate), card.Id);
}
}
}
\ No newline at end of file
......@@ -51,7 +51,7 @@ namespace MycardBot.Game.AI.Decks
: base(ai, duel)
{
// 有坑先清
AddExecutor(ExecutorType.Activate, (int)CardId.银河旋风, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, (int)CardId.银河旋风, 银河旋风效果);
AddExecutor(ExecutorType.Activate, (int)CardId.鹰身女妖的羽毛扫);
// 灵庙
......@@ -253,6 +253,47 @@ namespace MycardBot.Game.AI.Decks
return attacker.Attack > 0;
}
private bool 银河旋风效果()
{
List<ClientCard> spells = Duel.Fields[1].GetSpells();
if (spells.Count == 0)
return false;
ClientCard selected = null;
if (Card.Location == CardLocation.Grave)
{
selected = Duel.Fields[1].SpellZone.GetFloodgate();
if (selected == null)
{
foreach (ClientCard card in spells)
{
if (!card.IsFacedown())
{
selected = card;
break;
}
}
}
}
else
{
foreach (ClientCard card in spells)
{
if (card.IsFacedown())
{
selected = card;
break;
}
}
}
if (selected == null)
return false;
AI.SelectCard(selected);
return true;
}
private bool 龙之灵庙效果()
{
Logger.DebugWriteLine("龙之灵庙.");
......@@ -413,17 +454,8 @@ namespace MycardBot.Game.AI.Decks
{
return false;
}
List<ClientCard> spells = Duel.Fields[1].GetSpells();
ClientCard selected = null;
foreach (ClientCard card in spells)
{
if (card.IsSpellNegateAttack())
{
selected = card;
break;
}
}
if (selected != null && Duel.Fields[0].HasInGraveyard((int)CardId.白色灵龙))
ClientCard floodgate = Duel.Fields[1].SpellZone.GetFloodgate();
if (floodgate != null && Duel.Fields[0].HasInGraveyard((int)CardId.白色灵龙))
{
AI.SelectCard((int)CardId.白色灵龙);
}
......@@ -475,6 +507,8 @@ namespace MycardBot.Game.AI.Decks
if (ActivateDescription == -1) // AI.Utils.GetStringId((int)CardId.白色灵龙, 0))
{
Logger.DebugWriteLine("白色灵龙拆后场.");
ClientCard target = Duel.Fields[1].SpellZone.GetFloodgate();
AI.SelectCard(target);
return true;
}
/*else if(Duel.Phase==DuelPhase.BattleStart)
......@@ -740,7 +774,7 @@ namespace MycardBot.Game.AI.Decks
List<ClientCard> spells = Duel.Fields[1].GetSpells();
foreach (ClientCard spell in spells)
{
if (spell.IsSpellNegateAttack())
if (spell.IsFloodgate())
{
AI.SelectCard(spell);
return true;
......
......@@ -469,7 +469,7 @@ namespace DevBot.Game.AI.Decks
private ClientCard GetProblematicCard()
{
ClientCard card = Duel.Fields[1].MonsterZone.GetInvincibleMonster();
return card ?? Duel.Fields[1].SpellZone.GetNegateAttackSpell();
return card ?? Duel.Fields[1].SpellZone.GetFloodgate();
}
}
}
\ No newline at end of file
......@@ -33,15 +33,7 @@ namespace WindBot.Game.AI
if (spells.Count == 0)
return false;
ClientCard selected = null;
foreach (ClientCard card in spells)
{
if (card.IsSpellNegateAttack())
{
selected = card;
break;
}
}
ClientCard selected = Duel.Fields[1].SpellZone.GetFloodgate();
if (selected == null)
{
......
namespace WindBot.Game.AI.Enums
{
public enum Floodgate
{
BarrierStatueoftheTorrent = 10963799,
BarrierStatueoftheDrought = 19740112,
BarrierStatueoftheHeavens = 46145256,
BarrierStatueoftheInferno = 47961808,
BarrierStatueoftheStormwinds = 73356503,
BarrierStatueoftheAbyss = 84478195,
ThunderKingRaiOh = 71564252,
FossilDynaPachycephalo = 42009836,
VanitysFiend = 47084486,
MajestysFiend = 33746252,
VanitysRuler = 72634965,
KycootheGhostDestroyer = 88240808,
ConsecratedLight = 2980764,
ArchlordKristya = 59509952,
KoakiMeiruDrago = 12435193,
DenkoSekka = 13974207,
ZapMustung = 29951323,
Jinzo = 77585513,
SpellCanceller = 84636823,
LevelLimitAreaB = 3136426,
DimensionalFissure = 81674782,
Necrovalley = 47355498,
SecretVillageoftheSpellcasters = 68462976,
SwordsofRevealingLight = 72302403,
MessengerofPeace = 44656491,
KaiserColosseum = 35059553,
DomainoftheTrueMonarchs = 84171830,
ImperialOrder = 61740673,
MacroCosmos = 30241314,
MindDrain = 68937720,
SoulDrain = 73599290,
SkillDrain = 82732705,
Eisbahn = 54059040,
GozenMatch = 53334471,
RivalryofWarlords = 90846359,
AntiSpellFragrance = 58921041,
LightImprisoningMirror = 53341729,
ShadowImprisoningMirror = 99735427,
WallofRevealingLight = 17078030,
VanitysEmptiness = 5851097,
Lose1Turn = 24348804,
Reqliate = 20426907,
SummonLimit = 23516703,
AndtheBandPlayedOn = 47594939,
StygianDirge = 81489939,
RoyalDecree = 51452091,
ImperialIronWall = 30459350,
DNASurgery = 74701381,
NaturiaExterio = 99916754,
TheLastWarriorfromAnotherPlanet = 86099788,
ThousandEyesRestrict = 63519819,
ElShaddollWinda = 94977269,
MaskedHERODarkLaw = 58481572,
NaturiaBeast = 33198837,
NaturiaBarkion = 2956282,
EvilswarmOphion = 91279700,
MermailAbyssgaios = 74371660,
AbyssDweller = 21044178
}
}
......@@ -76,6 +76,7 @@
<Compile Include="Game\AI\Dialogs.cs" />
<Compile Include="Game\AI\Enums\DangerousMonster.cs" />
<Compile Include="Game\AI\Enums\InvincibleMonster.cs" />
<Compile Include="Game\AI\Enums\Floodgate.cs" />
<Compile Include="Game\AI\Enums\NegateAttackSpell.cs" />
<Compile Include="Game\AI\Enums\NegatesEffects.cs" />
<Compile Include="Game\AI\Enums\NegatesSpells.cs" />
......
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