Commit 23ca5d1b authored by wind2009's avatar wind2009 Committed by mercury233

Update Trickstar deck

parent f0c9682e
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
63845230 63845230
63845230 63845230
63845230 63845230
5133471
5133471
18144506 18144506
35261759 35261759
35261759 35261759
...@@ -34,6 +32,8 @@ ...@@ -34,6 +32,8 @@
35371948 35371948
35371948 35371948
35371948 35371948
10813327
10813327
21076084 21076084
83555666 83555666
40605147 40605147
...@@ -42,18 +42,18 @@ ...@@ -42,18 +42,18 @@
84749824 84749824
#extra #extra
41999284 41999284
99111753 3987233
98558751
50588353
2857636
38342335
41999284
74997493
41999284 41999284
74997493
50588353 50588353
98558751
74997493
2857636 2857636
99111753
38342335 38342335
98978921 99111753
31833038
3987233
50588353
41999284
9753964
34408491
!side !side
...@@ -21,6 +21,7 @@ namespace WindBot.Game.AI.Decks ...@@ -21,6 +21,7 @@ namespace WindBot.Game.AI.Decks
public const int MG = 23434538; public const int MG = 23434538;
public const int Tuner = 67441435; public const int Tuner = 67441435;
public const int Eater = 63845230; public const int Eater = 63845230;
public const int LockBird = 94145021;
public const int Feather = 18144506; public const int Feather = 18144506;
public const int Galaxy = 5133471; public const int Galaxy = 5133471;
...@@ -34,27 +35,30 @@ namespace WindBot.Game.AI.Decks ...@@ -34,27 +35,30 @@ namespace WindBot.Game.AI.Decks
public const int Ring = 83555666; public const int Ring = 83555666;
public const int Strike = 40605147; public const int Strike = 40605147;
public const int Warn = 84749824; public const int Warn = 84749824;
public const int Grass = 10813327;
public const int Linkuri = 41999284; public const int Linkuri = 41999284;
public const int Linkspi = 98978921; public const int Linkspi = 98978921;
public const int SafeDra = 99111753; public const int SafeDra = 99111753;
public const int Crystal = 50588353; public const int Crystal = 50588353;
public const int downer = 77058170;
public const int phoneix = 2857636; public const int phoneix = 2857636;
public const int unicorn = 38342335; public const int unicorn = 38342335;
public const int firewall = 5043010;
public const int snake = 74997493; public const int snake = 74997493;
public const int borrel = 31833038; public const int borrel = 31833038;
public const int boomer = 5821478;
public const int TG = 98558751; public const int TG = 98558751;
public const int Beelze = 34408491;
public const int Abyss = 9753964;
public const int Exterio = 99916754;
public const int Missus = 3987233;
} }
public int getLinkMarker(int id) public int getLinkMarker(int id)
{ {
if (id == CardId.borrel || id == CardId.snake) return 4; if (id == CardId.borrel || id == CardId.snake) return 4;
else if (id == CardId.unicorn) return 3; else if (id == CardId.unicorn) return 3;
else if (id == CardId.Crystal || id == CardId.phoneix || id == CardId.SafeDra) return 2; else if (id == CardId.Crystal || id == CardId.phoneix || id == CardId.SafeDra || id == CardId.Missus) return 2;
return 1; return 1;
} }
...@@ -65,6 +69,8 @@ namespace WindBot.Game.AI.Decks ...@@ -65,6 +69,8 @@ namespace WindBot.Game.AI.Decks
bool tuner_eff_used = false; bool tuner_eff_used = false;
bool crystal_eff_used = false; bool crystal_eff_used = false;
int red_ss_count = 0; int red_ss_count = 0;
bool white_eff_used = false;
bool lockbird_useful = false;
public TrickstarExecutor(GameAI ai, Duel duel) public TrickstarExecutor(GameAI ai, Duel duel)
: base(ai, duel) : base(ai, duel)
...@@ -73,9 +79,12 @@ namespace WindBot.Game.AI.Decks ...@@ -73,9 +79,12 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, CardId.MG, G_act); AddExecutor(ExecutorType.Activate, CardId.MG, G_act);
AddExecutor(ExecutorType.Activate, CardId.Strike, DefaultSolemnStrike); AddExecutor(ExecutorType.Activate, CardId.Strike, DefaultSolemnStrike);
AddExecutor(ExecutorType.Activate, CardId.Warn, DefaultSolemnWarning); AddExecutor(ExecutorType.Activate, CardId.Warn, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, CardId.Grass, Grass_ss);
AddExecutor(ExecutorType.Activate, CardId.Urara, Hand_act_eff); AddExecutor(ExecutorType.Activate, CardId.Urara, Hand_act_eff);
AddExecutor(ExecutorType.Activate, CardId.Ghost, Hand_act_eff); AddExecutor(ExecutorType.Activate, CardId.Ghost, Hand_act_eff);
AddExecutor(ExecutorType.Activate, CardId.Ring, DefaultCompulsoryEvacuationDevice); AddExecutor(ExecutorType.Activate, CardId.Ring, DefaultCompulsoryEvacuationDevice);
AddExecutor(ExecutorType.Activate, CardId.Abyss, Abyss_eff);
AddExecutor(ExecutorType.Activate, CardId.Exterio, Exterio_counter);
// spell clean // spell clean
AddExecutor(ExecutorType.Activate, CardId.Stage, Stage_Lock); AddExecutor(ExecutorType.Activate, CardId.Stage, Stage_Lock);
...@@ -84,17 +93,22 @@ namespace WindBot.Game.AI.Decks ...@@ -84,17 +93,22 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, CardId.TG, TG_eff); AddExecutor(ExecutorType.Activate, CardId.TG, TG_eff);
// ex_monster act // ex_monster act
AddExecutor(ExecutorType.Activate, CardId.Beelze);
AddExecutor(ExecutorType.Activate, CardId.Missus, Missus_eff);
AddExecutor(ExecutorType.Activate, CardId.Crystal, Crystal_eff); AddExecutor(ExecutorType.Activate, CardId.Crystal, Crystal_eff);
AddExecutor(ExecutorType.Activate, CardId.SafeDra, DefaultCompulsoryEvacuationDevice); AddExecutor(ExecutorType.Activate, CardId.SafeDra, DefaultCompulsoryEvacuationDevice);
AddExecutor(ExecutorType.Activate, CardId.Linkuri, Linkuri_eff); AddExecutor(ExecutorType.Activate, CardId.Linkuri, Linkuri_eff);
AddExecutor(ExecutorType.Activate, CardId.phoneix, Phoneix_eff); AddExecutor(ExecutorType.Activate, CardId.phoneix, Phoneix_eff);
AddExecutor(ExecutorType.Activate, CardId.unicorn, Unicorn_eff); AddExecutor(ExecutorType.Activate, CardId.unicorn, Unicorn_eff);
AddExecutor(ExecutorType.Activate, CardId.snake, Snake_eff); AddExecutor(ExecutorType.Activate, CardId.snake, Snake_eff);
AddExecutor(ExecutorType.Activate, CardId.borrel, Borrel_eff);
AddExecutor(ExecutorType.Activate, CardId.Tuner,Tuner_eff); AddExecutor(ExecutorType.Activate, CardId.Tuner,Tuner_eff);
// ex ss // ex ss
AddExecutor(ExecutorType.SpSummon, CardId.snake, Snake_ss); AddExecutor(ExecutorType.SpSummon, CardId.snake, Snake_ss);
AddExecutor(ExecutorType.SpSummon, CardId.Missus, Missus_ss);
AddExecutor(ExecutorType.SpSummon, CardId.borrel, Borrel_ss);
AddExecutor(ExecutorType.SpSummon, CardId.phoneix, Phoneix_ss); AddExecutor(ExecutorType.SpSummon, CardId.phoneix, Phoneix_ss);
AddExecutor(ExecutorType.SpSummon, CardId.unicorn, Unicorn_ss); AddExecutor(ExecutorType.SpSummon, CardId.unicorn, Unicorn_ss);
AddExecutor(ExecutorType.SpSummon, CardId.Crystal, Crystal_ss); AddExecutor(ExecutorType.SpSummon, CardId.Crystal, Crystal_ss);
...@@ -108,29 +122,30 @@ namespace WindBot.Game.AI.Decks ...@@ -108,29 +122,30 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, CardId.BF, BF_pos); AddExecutor(ExecutorType.Activate, CardId.BF, BF_pos);
AddExecutor(ExecutorType.Activate, CardId.Sheep, Sheep_Act); AddExecutor(ExecutorType.Activate, CardId.Sheep, Sheep_Act);
AddExecutor(ExecutorType.Activate, CardId.Eater); AddExecutor(ExecutorType.Activate, CardId.Eater);
AddExecutor(ExecutorType.Activate, CardId.LockBird, LockBird_act);
// ts // ts
AddExecutor(ExecutorType.Activate, CardId.Stage, Stage_act); AddExecutor(ExecutorType.Activate, CardId.Stage, Stage_act);
AddExecutor(ExecutorType.Activate, CardId.Pink, Pink_eff); AddExecutor(ExecutorType.Activate, CardId.Pink, Pink_eff);
AddExecutor(ExecutorType.Activate, CardId.Re, Reincarnation);
AddExecutor(ExecutorType.Activate, CardId.Red, Red_ss); AddExecutor(ExecutorType.Activate, CardId.Red, Red_ss);
AddExecutor(ExecutorType.Activate, CardId.Yellow, Yellow_eff); AddExecutor(ExecutorType.Activate, CardId.Yellow, Yellow_eff);
AddExecutor(ExecutorType.Activate, CardId.White, White_eff); AddExecutor(ExecutorType.Activate, CardId.White, White_eff);
AddExecutor(ExecutorType.Activate, CardId.Re, Reincarnation); AddExecutor(ExecutorType.Activate, CardId.Crown, Crown_eff);
AddExecutor(ExecutorType.Summon, CardId.Yellow, Yellow_sum); AddExecutor(ExecutorType.Summon, CardId.Yellow, Yellow_sum);
AddExecutor(ExecutorType.Summon, CardId.Red, Red_sum); AddExecutor(ExecutorType.Summon, CardId.Red, Red_sum);
AddExecutor(ExecutorType.Summon, CardId.Pink, Pink_sum); AddExecutor(ExecutorType.Summon, CardId.Pink, Pink_sum);
// normal // normal
AddExecutor(ExecutorType.SpSummon, CardId.Eater, Eater_ss); AddExecutor(ExecutorType.SpSummon, CardId.Eater, Eater_ss);
AddExecutor(ExecutorType.Summon, CardId.Tuner, Tuner_ns);
AddExecutor(ExecutorType.Summon, CardId.Urara,Tuner_ns); AddExecutor(ExecutorType.Summon, CardId.Urara,Tuner_ns);
AddExecutor(ExecutorType.Summon, CardId.Ghost, Tuner_ns); AddExecutor(ExecutorType.Summon, CardId.Ghost, Tuner_ns);
AddExecutor(ExecutorType.Summon, CardId.Tuner, Tuner_ns);
AddExecutor(ExecutorType.Activate, CardId.Pot, Pot_Act); AddExecutor(ExecutorType.Activate, CardId.Pot, Pot_Act);
AddExecutor(ExecutorType.Repos, MonsterRepos); AddExecutor(ExecutorType.Repos, MonsterRepos);
AddExecutor(ExecutorType.SummonOrSet, CardId.Red); AddExecutor(ExecutorType.SummonOrSet, CardId.Red);
AddExecutor(ExecutorType.SummonOrSet, CardId.Pink); AddExecutor(ExecutorType.SummonOrSet, CardId.Pink);
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet); AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
} }
public bool Has_down_arrow(int id) public bool Has_down_arrow(int id)
...@@ -147,8 +162,9 @@ namespace WindBot.Game.AI.Decks ...@@ -147,8 +162,9 @@ namespace WindBot.Game.AI.Decks
{ {
return new[] return new[]
{ {
CardId.Crown,
CardId.Tuner, CardId.Tuner,
CardId.Grass,
CardId.Crown,
CardId.Pink, CardId.Pink,
CardId.Pot, CardId.Pot,
CardId.BF, CardId.BF,
...@@ -171,6 +187,63 @@ namespace WindBot.Game.AI.Decks ...@@ -171,6 +187,63 @@ namespace WindBot.Game.AI.Decks
}; };
} }
public int GetTotalATK(IList<ClientCard> list)
{
int atk = 0;
foreach(ClientCard c in list)
{
if (c == null) continue;
atk += c.Attack;
}
return atk;
}
public bool Grass_ss()
{
if (Bot.ExtraDeck.Count > 0)
{
IList<ClientCard> ex = Bot.ExtraDeck;
ClientCard ex_best = null;
foreach (ClientCard ex_card in ex)
{
if (ex_best == null || ex_card.Attack > ex_best.Attack) ex_best = ex_card;
}
if (ex_best != null) {
AI.SelectCard(ex_best);
}
return true;
}
return true;
}
public bool Abyss_eff()
{
// tuner ss
if (ActivateDescription == -1)
{
AI.SelectCard(new[]
{
CardId.Ghost,
CardId.TG,
CardId.Tuner,
CardId.Urara,
CardId.BF
});
return true;
};
// counter
if (!Enemy.HasInMonstersZone(CardId.Ghost) || Enemy.GetHandCount() <= 1)
{
ClientCard tosolve = AI.Utils.GetProblematicEnemyCard();
if (tosolve != null)
{
AI.SelectCard(tosolve);
return true;
}
}
return false;
}
public bool Stage_Lock() public bool Stage_Lock()
{ {
if (Card.Location != CardLocation.SpellZone) return false; if (Card.Location != CardLocation.SpellZone) return false;
...@@ -224,24 +297,18 @@ namespace WindBot.Game.AI.Decks ...@@ -224,24 +297,18 @@ namespace WindBot.Game.AI.Decks
public bool Feather_Act() public bool Feather_Act()
{ {
List<ClientCard> spells = Enemy.GetSpells(); if (AI.Utils.GetProblematicEnemySpell() != null)
foreach (ClientCard card in spells)
{ {
// 有常用贴纸 List<ClientCard> grave = Bot.GetGraveyardSpells();
if (card.Id == 5851097 || card.Id == 30241314 || card.Id == 81674782 || card.Id == 58921041 || card.Id == 59305593) foreach (ClientCard self_card in grave)
{ {
List<ClientCard> grave = Bot.GetGraveyardSpells(); if (self_card.Id == CardId.Galaxy)
// 墓地有银河旋风则不发动 return false;
foreach (ClientCard self_card in grave)
{
if (self_card.Id == CardId.Galaxy)
return false;
}
return true;
} }
return true;
} }
// 2张以上才发动 // activate when more than 2 cards
if (spells.Count <= 1) if (Enemy.GetSpellCount() <= 1)
return false; return false;
return true; return true;
} }
...@@ -250,8 +317,8 @@ namespace WindBot.Game.AI.Decks ...@@ -250,8 +317,8 @@ namespace WindBot.Game.AI.Decks
{ {
if (Duel.Player == 0) return false; if (Duel.Player == 0) return false;
if (Duel.Phase == DuelPhase.End) return true; if (Duel.Phase == DuelPhase.End) return true;
if (LastChainPlayer == 1 && (AI.Utils.IsChainTarget(Card) || GetLastChainCard().Id == CardId.Feather)) return true; if (LastChainPlayer == 1 && (AI.Utils.IsChainTarget(Card) || (GetLastChainCard().Id == CardId.Feather && !Bot.HasInSpellZone(CardId.Grass)))) return true;
if (Duel.Phase > DuelPhase.Main1 && Duel.Phase < DuelPhase.Main2) if (Duel.Phase == DuelPhase.BattleStart)
{ {
int total_atk = 0; int total_atk = 0;
List<ClientCard> enemy_monster = Enemy.GetMonsters(); List<ClientCard> enemy_monster = Enemy.GetMonsters();
...@@ -396,10 +463,21 @@ namespace WindBot.Game.AI.Decks ...@@ -396,10 +463,21 @@ namespace WindBot.Game.AI.Decks
public bool Hand_act_eff() public bool Hand_act_eff()
{ {
if (Card.Id == CardId.Urara && Bot.HasInHand(CardId.LockBird) && Bot.HasInSpellZone(CardId.Re)) return false;
if (Card.Id == CardId.Ghost && Card.Location == CardLocation.Hand && Bot.HasInMonstersZone(CardId.Ghost)) return false; if (Card.Id == CardId.Ghost && Card.Location == CardLocation.Hand && Bot.HasInMonstersZone(CardId.Ghost)) return false;
return (LastChainPlayer == 1); return (LastChainPlayer == 1);
} }
public bool Exterio_counter()
{
if (LastChainPlayer == 1)
{
AI.SelectCard(Useless_List());
return true;
}
return false;
}
public bool G_act() public bool G_act()
{ {
return (Duel.Player == 1); return (Duel.Player == 1);
...@@ -481,7 +559,7 @@ namespace WindBot.Game.AI.Decks ...@@ -481,7 +559,7 @@ namespace WindBot.Game.AI.Decks
public bool Red_ss() public bool Red_ss()
{ {
if (red_ss_count >= 9) return false; if (red_ss_count >= 6) return false;
if (LastChainPlayer == 0 && GetLastChainCard().Id == CardId.Red) if (LastChainPlayer == 0 && GetLastChainCard().Id == CardId.Red)
{ {
foreach (ClientCard m in Bot.GetMonsters()) foreach (ClientCard m in Bot.GetMonsters())
...@@ -506,7 +584,7 @@ namespace WindBot.Game.AI.Decks ...@@ -506,7 +584,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (IsTrickstar(c.Id)) if (IsTrickstar(c.Id))
{ {
if (c.Attacked) if (c.Attacked && c.Id != CardId.Red)
{ {
AI.SelectCard(c); AI.SelectCard(c);
red_ss_count += 1; red_ss_count += 1;
...@@ -516,6 +594,7 @@ namespace WindBot.Game.AI.Decks ...@@ -516,6 +594,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (Bot.HasInHand(CardId.White) && c.Attack * 2 < tosolve_enemy.Attack) if (Bot.HasInHand(CardId.White) && c.Attack * 2 < tosolve_enemy.Attack)
{ {
if (tosolve_enemy.Attack > 3200) AI.SelectPosition(CardPosition.FaceUpDefence);
AI.SelectCard(c); AI.SelectCard(c);
red_ss_count += 1; red_ss_count += 1;
return true; return true;
...@@ -528,6 +607,16 @@ namespace WindBot.Game.AI.Decks ...@@ -528,6 +607,16 @@ namespace WindBot.Game.AI.Decks
} }
if (!Bot.HasInHand(CardId.White) && c.Attack < tosolve_enemy.Attack) if (!Bot.HasInHand(CardId.White) && c.Attack < tosolve_enemy.Attack)
{ {
if (!c.Attacked)
{
ClientCard badatk = Enemy.GetMonsters().GetLowestAttackMonster();
ClientCard baddef = Enemy.GetMonsters().GetLowestDefenseMonster();
int enemy_power = 99999;
if (badatk != null && badatk.Attack <= enemy_power) enemy_power = badatk.Attack;
if (baddef != null && baddef.Defense <= enemy_power) enemy_power = baddef.Defense;
if (c.Attack > enemy_power) return false;
}
if (tosolve_enemy.Attack > 1600) AI.SelectPosition(CardPosition.FaceUpDefence);
AI.SelectCard(c); AI.SelectCard(c);
red_ss_count += 1; red_ss_count += 1;
return true; return true;
...@@ -538,6 +627,7 @@ namespace WindBot.Game.AI.Decks ...@@ -538,6 +627,7 @@ namespace WindBot.Game.AI.Decks
} }
} else } else
{ {
if ((ChainContainsCard(53129443) || ChainContainsCard(99330325)) && ChainContainsCard(CardId.Red)) return false;
if (Duel.Phase > DuelPhase.Main1 && Duel.Phase < DuelPhase.Main2) if (Duel.Phase > DuelPhase.Main1 && Duel.Phase < DuelPhase.Main2)
{ {
if (!Bot.HasInHand(CardId.White) && AI.Utils.IsOneEnemyBetterThanValue(1600, true)) if (!Bot.HasInHand(CardId.White) && AI.Utils.IsOneEnemyBetterThanValue(1600, true))
...@@ -560,7 +650,7 @@ namespace WindBot.Game.AI.Decks ...@@ -560,7 +650,7 @@ namespace WindBot.Game.AI.Decks
public bool Yellow_eff() public bool Yellow_eff()
{ {
if (!Bot.HasInHand(CardId.Stage) && !Bot.HasInSpellZone(CardId.Stage) && Bot.GetRemainingCount(CardId.Stage,3) > 0) if (!Bot.HasInHand(CardId.Stage) && !Bot.HasInSpellZone(CardId.Stage) && Bot.GetRemainingCount(CardId.Stage, 3) > 0)
{ {
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
...@@ -576,7 +666,7 @@ namespace WindBot.Game.AI.Decks ...@@ -576,7 +666,7 @@ namespace WindBot.Game.AI.Decks
} }
else if (Enemy.GetMonsterCount() == 0 && !AI.Utils.IsTurn1OrMain2()) else if (Enemy.GetMonsterCount() == 0 && !AI.Utils.IsTurn1OrMain2())
{ {
if (Bot.HasInGraveyard(CardId.Red) && Bot.GetRemainingCount(CardId.Pink,1)>0 && !pink_ss) if (Bot.HasInGraveyard(CardId.Red) && Bot.GetRemainingCount(CardId.Pink, 1) > 0 && !pink_ss)
{ {
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
...@@ -589,7 +679,7 @@ namespace WindBot.Game.AI.Decks ...@@ -589,7 +679,7 @@ namespace WindBot.Game.AI.Decks
CardId.Yellow CardId.Yellow
}); });
} }
else if (Bot.HasInGraveyard(CardId.Pink) && Bot.HasInGraveyard(CardId.Red) && Bot.GetRemainingCount(CardId.Ring,1) > 0) else if (Bot.HasInGraveyard(CardId.Pink) && Bot.HasInGraveyard(CardId.Red) && Bot.GetRemainingCount(CardId.Ring, 1) > 0)
{ {
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
...@@ -602,7 +692,7 @@ namespace WindBot.Game.AI.Decks ...@@ -602,7 +692,7 @@ namespace WindBot.Game.AI.Decks
CardId.Yellow CardId.Yellow
}); });
} }
else if (Bot.GetRemainingCount(CardId.White,2) > 0 && Duel.LifePoints[1] <= 4000) else if (Bot.GetRemainingCount(CardId.White, 2) > 0 && Duel.LifePoints[1] <= 4000)
{ {
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
...@@ -673,6 +763,18 @@ namespace WindBot.Game.AI.Decks ...@@ -673,6 +763,18 @@ namespace WindBot.Game.AI.Decks
}); });
} }
return true; return true;
} else if ((Bot.HasInHand(CardId.Red) || Bot.HasInHand(CardId.Stage)) && Bot.GetRemainingCount(CardId.Re,1) > 0 && Bot.HasInHand(CardId.LockBird)) {
AI.SelectCard(new[]
{
CardId.Re,
CardId.Red,
CardId.White,
CardId.Ring,
CardId.Pink,
CardId.Stage,
CardId.Yellow
});
return true;
} else } else
{ {
AI.SelectCard(new[] AI.SelectCard(new[]
...@@ -700,23 +802,37 @@ namespace WindBot.Game.AI.Decks ...@@ -700,23 +802,37 @@ namespace WindBot.Game.AI.Decks
if (bestMy == null || (bestEnemyATK == null && bestEnemyDEF == null)) if (bestMy == null || (bestEnemyATK == null && bestEnemyDEF == null))
return false; return false;
if (bestEnemyATK != null && bestMy.Attack <= bestEnemyATK.Attack && bestMy.Attack * 2 >= bestEnemyATK.Attack) if (bestEnemyATK != null && bestMy.Attack <= bestEnemyATK.Attack && bestMy.Attack * 2 >= bestEnemyATK.Attack)
{
white_eff_used = true;
return true; return true;
}
if (bestEnemyDEF != null && bestMy.Attack <= bestEnemyDEF.Defense && bestMy.Attack * 2 >= bestEnemyDEF.Defense) if (bestEnemyDEF != null && bestMy.Attack <= bestEnemyDEF.Defense && bestMy.Attack * 2 >= bestEnemyDEF.Defense)
{
white_eff_used = true;
return true; return true;
}
return false; return false;
} else } else
{ {
if (Enemy.GetMonsterCount() == 0 && !AI.Utils.IsTurn1OrMain2()) return true; if (Enemy.GetMonsterCount() == 0 && !AI.Utils.IsTurn1OrMain2()) {
white_eff_used = true;
return true;
}
else if (Enemy.GetMonsterCount() != 0) else if (Enemy.GetMonsterCount() != 0)
{ {
ClientCard tosolve = AI.Utils.GetBestEnemyMonster(true); ClientCard tosolve = AI.Utils.GetBestEnemyMonster(true);
ClientCard self_card = Bot.GetMonsters().GetHighestAttackMonster(); ClientCard self_card = Bot.GetMonsters().GetHighestAttackMonster();
if (tosolve == null || self_card == null || (tosolve != null && self_card != null && !IsTrickstar(self_card.Id))) if (tosolve == null || self_card == null || (tosolve != null && self_card != null && !IsTrickstar(self_card.Id)))
{ {
return (Enemy.GetMonsters().GetLowestAttackMonster() == null || if (Enemy.GetMonsters().GetLowestAttackMonster() == null ||
Enemy.GetMonsters().GetLowestDefenseMonster() == null || Enemy.GetMonsters().GetLowestDefenseMonster() == null ||
Enemy.GetMonsters().GetLowestAttackMonster().Attack < 2000 || Enemy.GetMonsters().GetLowestAttackMonster().Attack < 2000 ||
Enemy.GetMonsters().GetLowestDefenseMonster().Defense < 2000); Enemy.GetMonsters().GetLowestDefenseMonster().Defense < 2000)
{
white_eff_used = true;
return true;
}
else return false;
} }
if (tosolve != null && self_card != null && IsTrickstar(self_card.Id)) if (tosolve != null && self_card != null && IsTrickstar(self_card.Id))
{ {
...@@ -732,12 +848,53 @@ namespace WindBot.Game.AI.Decks ...@@ -732,12 +848,53 @@ namespace WindBot.Game.AI.Decks
} }
} }
public bool LockBird_act()
{
if (Duel.Player == 0) return false;
lockbird_useful = true;
if (Bot.HasInSpellZone(CardId.Re)) return ChainContainsCard(CardId.Re);
return true;
}
public bool Reincarnation() public bool Reincarnation()
{ {
if (Card.Location == CardLocation.Grave) return Ts_reborn(); if (Card.Location == CardLocation.Grave) return Ts_reborn();
if (Bot.HasInHand(CardId.LockBird))
{
if (lockbird_useful || AI.Utils.IsChainTarget(Card) || (Duel.Player == 1 && ChainContainsCard(CardId.Feather))) {
lockbird_useful = false;
return true;
}
return false;
}
return true; return true;
} }
public bool Crown_eff()
{
if (Card.Location == CardLocation.Hand) return Ts_reborn();
if (Bot.HasInHand(CardId.Pink))
{
AI.SelectCard(CardId.Pink);
return true;
}
if (Enemy.GetMonsterCount() == 0)
{
foreach(ClientCard hand in Bot.Hand)
{
if (hand.IsMonster() && IsTrickstar(hand.Id))
{
if (hand.Attack >= Duel.LifePoints[1]) return true;
if (hand.Id != CardId.Yellow)
{
if (AI.Utils.GetOneEnemyBetterThanValue(hand.Attack, false) == null) return true;
}
}
}
}
return false;
}
public bool Ts_reborn() public bool Ts_reborn()
{ {
bool can_summon = (Duel.Player == 0 && NormalSummoned); bool can_summon = (Duel.Player == 0 && NormalSummoned);
...@@ -824,7 +981,11 @@ namespace WindBot.Game.AI.Decks ...@@ -824,7 +981,11 @@ namespace WindBot.Game.AI.Decks
{ {
if (hand.Id == Card.Id) count += 1; if (hand.Id == Card.Id) count += 1;
} }
if (count >= 2) return true; if (count < 2) return false;
foreach(ClientCard m in Bot.GetMonsters())
{
if (m.Id != CardId.Eater && getLinkMarker(m.Id) <= 2) return true;
}
return false; return false;
} }
...@@ -925,7 +1086,16 @@ namespace WindBot.Game.AI.Decks ...@@ -925,7 +1086,16 @@ namespace WindBot.Game.AI.Decks
ClientCard m = AI.Utils.GetProblematicEnemyMonster(); ClientCard m = AI.Utils.GetProblematicEnemyMonster();
if (m == null) if (m == null)
{ {
return (Enemy.GetMonsterCount() == 0 && Duel.LifePoints[1] <= 1100 && Duel.Phase < DuelPhase.Battle); if (Enemy.GetMonsterCount() == 0 && Duel.LifePoints[1] <= 1100 && Duel.Phase < DuelPhase.Battle)
{
IList<ClientCard> list = new List<ClientCard>();
foreach(ClientCard monster in Bot.GetMonsters())
{
if (getLinkMarker(monster.Id) <= 2) list.Add(monster);
if (list.Count >= 2) break;
}
return (list.Count >= 2 && GetTotalATK(list) <= 1100);
}
} }
ClientCard ex_1 = Bot.MonsterZone[5]; ClientCard ex_1 = Bot.MonsterZone[5];
ClientCard ex_2 = Bot.MonsterZone[6]; ClientCard ex_2 = Bot.MonsterZone[6];
...@@ -953,7 +1123,17 @@ namespace WindBot.Game.AI.Decks ...@@ -953,7 +1123,17 @@ namespace WindBot.Game.AI.Decks
ClientCard m = AI.Utils.GetProblematicEnemySpell(); ClientCard m = AI.Utils.GetProblematicEnemySpell();
if (m == null) if (m == null)
{ {
return (Enemy.GetMonsterCount() == 0 && Duel.LifePoints[1] <= 1900 && Duel.Phase == DuelPhase.Main1); if (Enemy.GetMonsterCount() == 0 && Duel.LifePoints[1] <= 1900 && Duel.Phase == DuelPhase.Main1)
{
IList<ClientCard> m_list = new List<ClientCard>();
foreach(ClientCard monster in Bot.GetMonsters())
{
if (getLinkMarker(monster.Id) == 1) m_list.Add(monster);
if (m_list.Count == 2) break;
}
return (m_list.Count == 2 && GetTotalATK(m_list) <= 1900);
}
return false;
} }
if (Bot.Hand.Count == 0) return false; if (Bot.Hand.Count == 0) return false;
IList<ClientCard> targets = new List<ClientCard>(); IList<ClientCard> targets = new List<ClientCard>();
...@@ -977,7 +1157,7 @@ namespace WindBot.Game.AI.Decks ...@@ -977,7 +1157,7 @@ namespace WindBot.Game.AI.Decks
{ {
targets.Add(ex_zone); targets.Add(ex_zone);
} }
AI.SelectCard(targets); AI.SelectMaterials(targets);
return true; return true;
} }
...@@ -989,13 +1169,31 @@ namespace WindBot.Game.AI.Decks ...@@ -989,13 +1169,31 @@ namespace WindBot.Game.AI.Decks
public bool Unicorn_ss() { public bool Unicorn_ss() {
ClientCard m = AI.Utils.GetProblematicEnemyCard(); ClientCard m = AI.Utils.GetProblematicEnemyCard();
int link_count = 0;
if (m == null) if (m == null)
{ {
return (Enemy.GetMonsterCount() == 0 && Duel.LifePoints[1] <= 2200 && Duel.Phase == DuelPhase.Main1); if (Enemy.GetMonsterCount() == 0 && Duel.LifePoints[1] <= 2200 && Duel.Phase == DuelPhase.Main1)
{
IList<ClientCard> m_list = new List<ClientCard>();
foreach(ClientCard monster in Bot.GetMonsters())
{
if (getLinkMarker(monster.Id) == 2)
{
link_count += 2;
m_list.Add(monster);
} else if (getLinkMarker(monster.Id) == 1)
{
link_count += 1;
m_list.Add(monster);
}
if (link_count >= 3) break;
}
return (link_count >= 3 && GetTotalATK(m_list) <= 2200);
}
return false;
} }
if (Bot.Hand.Count == 0) return false; if (Bot.Hand.Count == 0) return false;
IList<ClientCard> targets = new List<ClientCard>(); IList<ClientCard> targets = new List<ClientCard>();
int link_count = 0;
foreach (ClientCard s_m in Bot.GetMonsters()) foreach (ClientCard s_m in Bot.GetMonsters())
{ {
if (s_m.Id != CardId.Eater && getLinkMarker(s_m.Id) <= 2) if (s_m.Id != CardId.Eater && getLinkMarker(s_m.Id) <= 2)
...@@ -1009,7 +1207,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1009,7 +1207,7 @@ namespace WindBot.Game.AI.Decks
} }
} }
if (link_count < 3) return false; if (link_count < 3) return false;
AI.SelectCard(targets); AI.SelectMaterials(targets);
return true; return true;
} }
...@@ -1025,19 +1223,28 @@ namespace WindBot.Game.AI.Decks ...@@ -1025,19 +1223,28 @@ namespace WindBot.Game.AI.Decks
public bool Snake_ss() public bool Snake_ss()
{ {
IList<ClientCard> targets = new List<ClientCard>(); IList<ClientCard> targets = new List<ClientCard>();
foreach (ClientCard m in Bot.GetMonsters()) // exzone fo first
foreach (ClientCard e_m in Bot.GetMonstersInExtraZone())
{ {
if (m.Attack < 1900 && !targets.ContainsCardWithId(m.Id)) if (e_m.Attack < 1900 && !targets.ContainsCardWithId(e_m.Id))
{ {
targets.Add(m); targets.Add(e_m);
} }
} }
if (targets.Count >= 4) foreach (ClientCard m in Bot.GetMonstersInMainZone())
{ {
if (m.Attack < 1900 && !targets.ContainsCardWithId(m.Id))
AI.SelectCard(targets); {
snake_four_s = true; targets.Add(m);
return true; }
if (targets.Count >= 4)
{
if (Duel.LifePoints[1] <= GetTotalATK(targets) && Enemy.GetMonsterCount() == 0) return false;
AI.SelectMaterials(targets);
AI.SelectYesNo(true);
snake_four_s = true;
return true;
}
} }
return false; return false;
} }
...@@ -1073,10 +1280,100 @@ namespace WindBot.Game.AI.Decks ...@@ -1073,10 +1280,100 @@ namespace WindBot.Game.AI.Decks
return false; return false;
} }
public bool Missus_ss()
{
IList<ClientCard> material_list = new List<ClientCard>();
foreach(ClientCard monster in Bot.GetMonsters())
{
if (monster.HasAttribute(CardAttribute.Earth) && getLinkMarker(monster.Id) == 1) material_list.Add(monster);
}
if (material_list.Count < 2) return false;
if (Enemy.GetMonsterCount() == 0)
{
AI.SelectMaterials(material_list);
return true;
} else if (AI.Utils.GetProblematicEnemyMonster(2000) != null && Bot.HasInExtra(CardId.borrel) && !Bot.HasInMonstersZone(CardId.Missus))
{
AI.SelectMaterials(material_list);
return true;
}
return false;
}
public bool Missus_eff()
{
AI.SelectCard(new[]
{
CardId.MG,
CardId.Missus,
CardId.snake
});
return true;
}
public bool Borrel_ss()
{
bool already_link2 = false;
IList<ClientCard> material_list = new List<ClientCard>();
if (AI.Utils.GetProblematicEnemyMonster(2000) != null || (Enemy.GetMonsterCount() == 0 && Duel.Phase == DuelPhase.Main1 && Duel.LifePoints[1] <= 3000))
{
foreach(ClientCard e_m in Bot.GetMonstersInExtraZone())
{
if (getLinkMarker(e_m.Id) < 3)
{
if (getLinkMarker(e_m.Id) == 2) already_link2 = true;
material_list.Add(e_m);
}
}
foreach(ClientCard m in Bot.GetMonstersInMainZone())
{
if (getLinkMarker(m.Id) < 3)
{
if (getLinkMarker(m.Id) == 2 && !already_link2)
{
already_link2 = true;
material_list.Add(m);
} else if (m.Id != CardId.Sheep + 1 && (m.Id != CardId.Eater))
{
material_list.Add(m);
}
if ((already_link2 && material_list.Count == 3) || (!already_link2 && material_list.Count == 4)) break;
}
}
if ((already_link2 && material_list.Count == 3) || (!already_link2 && material_list.Count == 4))
{
if (Enemy.GetMonsterCount() == 0 && Duel.Phase == DuelPhase.Main1 && Duel.LifePoints[1] <= 3000)
{
if (GetTotalATK(material_list) >= 3000) return false;
}
AI.SelectMaterials(material_list);
return true;
}
}
return false;
}
public bool Borrel_eff()
{
if (ActivateDescription == -1) return true;
ClientCard BestEnemy = AI.Utils.GetBestEnemyMonster(true);
ClientCard WorstBot = Bot.GetMonsters().GetLowestAttackMonster();
if (BestEnemy == null || BestEnemy.HasPosition(CardPosition.FaceDown)) return false;
if (WorstBot == null || WorstBot.HasPosition(CardPosition.FaceDown)) return false;
if (BestEnemy.Attack >= WorstBot.RealPower)
{
AI.SelectCard(BestEnemy);
return true;
}
return false;
}
public bool MonsterRepos() public bool MonsterRepos()
{ {
if (Card.Id == CardId.Eater) return false; if (Card.Id == CardId.Eater && Card.IsAttack()) return false;
if (Card.Id == CardId.Sheep + 1) return false;
if (Card.IsFaceup() && Card.IsDefense() && Card.Attack == 0)
return false;
bool enemyBetter = AI.Utils.IsAllEnemyBetter(true); bool enemyBetter = AI.Utils.IsAllEnemyBetter(true);
if (Card.IsAttack() && enemyBetter) if (Card.IsAttack() && enemyBetter)
...@@ -1100,13 +1397,15 @@ namespace WindBot.Game.AI.Decks ...@@ -1100,13 +1397,15 @@ namespace WindBot.Game.AI.Decks
snake_four_s = false; snake_four_s = false;
crystal_eff_used = false; crystal_eff_used = false;
red_ss_count = 0; red_ss_count = 0;
white_eff_used = false;
lockbird_useful = false;
} }
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender) public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{ {
if (!defender.IsMonsterHasPreventActivationEffectInBattle()) if (!defender.IsMonsterHasPreventActivationEffectInBattle())
{ {
if (attacker.Attribute == (int)CardAttribute.Light && Bot.HasInHand(CardId.White)) if (IsTrickstar(attacker.Id) && Bot.HasInHand(CardId.White) && !white_eff_used)
attacker.RealPower = attacker.RealPower * 2; attacker.RealPower = attacker.RealPower * 2;
else if (attacker.Id == CardId.Eater) else if (attacker.Id == CardId.Eater)
attacker.RealPower = 99999; attacker.RealPower = 99999;
......
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