Commit 60252a31 authored by mercury233's avatar mercury233

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

parents b60ace1a 6e96e522
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"我的超主流卡组需要{0}才能玩。" "我的超主流卡组需要{0}才能玩。"
], ],
"duelstart": [ "duelstart": [
"闪刀姬卡组测试中,渣操是正常情况,请多指教。", "自奏圣乐卡组测试中,渣操是正常情况,请多指教。",
"超主流是游戏王的一环,不爽不要玩。", "超主流是游戏王的一环,不爽不要玩。",
"抄主流是游戏王的一环,不爽不要玩。", "抄主流是游戏王的一环,不爽不要玩。",
"抄来的卡组不会用,怎么办?" "抄来的卡组不会用,怎么办?"
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
"出来吧,{0}!", "出来吧,{0}!",
"出现吧,{0}!", "出现吧,{0}!",
"我召唤了美丽的{0}!", "我召唤了美丽的{0}!",
"我召唤了强大的{0}!",
"我呼唤{0}参加战斗!", "我呼唤{0}参加战斗!",
"我呼唤出{0}。", "我呼唤出{0}。",
"让我召唤{0}。" "让我召唤{0}。"
......
...@@ -103,9 +103,9 @@ namespace WindBot.Game.AI.Decks ...@@ -103,9 +103,9 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Summon, CardId.TrickstarCandina, CandinaSummon); AddExecutor(ExecutorType.Summon, CardId.TrickstarCandina, CandinaSummon);
AddExecutor(ExecutorType.Activate, CardId.TrickstarCandina, CandinaEffect); AddExecutor(ExecutorType.Activate, CardId.TrickstarCandina, CandinaEffect);
AddExecutor(ExecutorType.Summon, CardId.JetSynchron, OtherSummon); AddExecutor(ExecutorType.Summon, CardId.JetSynchron, OneCardComboSummon);
AddExecutor(ExecutorType.Summon, CardId.ThePhantomKnightsofAncientCloak, OtherSummon); AddExecutor(ExecutorType.Summon, CardId.ThePhantomKnightsofAncientCloak, OneCardComboSummon);
AddExecutor(ExecutorType.Summon, CardId.ThePhantomKnightsofSilentBoots, OtherSummon); AddExecutor(ExecutorType.Summon, CardId.ThePhantomKnightsofSilentBoots, OneCardComboSummon);
AddExecutor(ExecutorType.SpSummon, CardId.SalamangreatAlmiraj, AlmirajSummon); AddExecutor(ExecutorType.SpSummon, CardId.SalamangreatAlmiraj, AlmirajSummon);
AddExecutor(ExecutorType.Activate, CardId.ThePhantomKnightsofShadeBrigandine, ShadeBrigandineSummonFirst); AddExecutor(ExecutorType.Activate, CardId.ThePhantomKnightsofShadeBrigandine, ShadeBrigandineSummonFirst);
...@@ -147,11 +147,13 @@ namespace WindBot.Game.AI.Decks ...@@ -147,11 +147,13 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, CardId.ThePhantomKnightsofSilentBoots, SilentBootsEffect); AddExecutor(ExecutorType.Activate, CardId.ThePhantomKnightsofSilentBoots, SilentBootsEffect);
AddExecutor(ExecutorType.Summon, CardId.OrcustHarpHorror, OtherSummon); AddExecutor(ExecutorType.Summon, CardId.GhostBelleHauntedMansion, TunerSummon);
AddExecutor(ExecutorType.Summon, CardId.AshBlossomJoyousSpring, TunerSummon);
AddExecutor(ExecutorType.Summon, CardId.OrcustCymbalSkeleton, OtherSummon); AddExecutor(ExecutorType.Summon, CardId.OrcustCymbalSkeleton, OtherSummon);
AddExecutor(ExecutorType.Summon, CardId.GhostBelleHauntedMansion, OtherSummon); AddExecutor(ExecutorType.Summon, CardId.OrcustHarpHorror, OtherSummon);
AddExecutor(ExecutorType.Summon, CardId.AshBlossomJoyousSpring, OtherSummon); AddExecutor(ExecutorType.Summon, CardId.ThePhantomKnightsofAncientCloak, LinkMaterialSummon);
AddExecutor(ExecutorType.Summon, CardId.MaxxC, OtherSummon); AddExecutor(ExecutorType.Summon, CardId.MaxxC, LinkMaterialSummon);
AddExecutor(ExecutorType.Summon, CardId.ThePhantomKnightsofSilentBoots, LinkMaterialSummon);
AddExecutor(ExecutorType.SpellSet, CardId.PhantomKnightsFogBlade); AddExecutor(ExecutorType.SpellSet, CardId.PhantomKnightsFogBlade);
AddExecutor(ExecutorType.Activate, CardId.PhantomKnightsFogBlade, FogBladeEffect); AddExecutor(ExecutorType.Activate, CardId.PhantomKnightsFogBlade, FogBladeEffect);
...@@ -162,7 +164,7 @@ namespace WindBot.Game.AI.Decks ...@@ -162,7 +164,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, CardId.SkyStrikerMechaEagleBooster, EagleBoosterEffect); AddExecutor(ExecutorType.Activate, CardId.SkyStrikerMechaEagleBooster, EagleBoosterEffect);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos); AddExecutor(ExecutorType.Repos, MonsterRepos);
} }
private bool NormalSummoned = false; private bool NormalSummoned = false;
...@@ -190,6 +192,12 @@ namespace WindBot.Game.AI.Decks ...@@ -190,6 +192,12 @@ namespace WindBot.Game.AI.Decks
CardId.GhostBelleHauntedMansion CardId.GhostBelleHauntedMansion
}; };
public override bool OnSelectHand()
{
// go first
return true;
}
public override void OnNewTurn() public override void OnNewTurn()
{ {
NormalSummoned = false; NormalSummoned = false;
...@@ -200,6 +208,11 @@ namespace WindBot.Game.AI.Decks ...@@ -200,6 +208,11 @@ namespace WindBot.Game.AI.Decks
LightStageTarget = null; LightStageTarget = null;
} }
public override void OnChainEnd()
{
RustyBardicheTarget = null;
}
public override CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions) public override CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions)
{ {
YGOSharp.OCGWrapper.NamedCard cardData = YGOSharp.OCGWrapper.NamedCard.Get(cardId); YGOSharp.OCGWrapper.NamedCard cardData = YGOSharp.OCGWrapper.NamedCard.Get(cardId);
...@@ -361,7 +374,7 @@ namespace WindBot.Game.AI.Decks ...@@ -361,7 +374,7 @@ namespace WindBot.Game.AI.Decks
private bool DronesEffect() private bool DronesEffect()
{ {
return !Bot.HasInHand(CardId.ArmageddonKnight); return !Bot.HasInHand(CardId.ArmageddonKnight) && !Bot.HasInHand(CardId.TrickstarCandina);
} }
private bool CandinaSummon() private bool CandinaSummon()
...@@ -441,7 +454,7 @@ namespace WindBot.Game.AI.Decks ...@@ -441,7 +454,7 @@ namespace WindBot.Game.AI.Decks
private bool DestrudoSummon() private bool DestrudoSummon()
{ {
return Bot.GetMonsterCount() > 0 && Bot.HasInExtra(new[] { CardId.CrystronNeedlefiber, CardId.KnightmarePhoenix }); return Bot.GetMonsterCount() < 3 && Bot.HasInExtra(new[] { CardId.CrystronNeedlefiber, CardId.KnightmarePhoenix });
} }
private bool NeedlefiberSummonFirst() private bool NeedlefiberSummonFirst()
...@@ -581,7 +594,7 @@ namespace WindBot.Game.AI.Decks ...@@ -581,7 +594,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (!Bot.HasInGraveyard(CardId.OrcustHarpHorror)) if (!Bot.HasInGraveyard(CardId.OrcustHarpHorror))
{ {
AI.SelectCard(CardId.GalateaTheOrcustAutomaton); AI.SelectCard(Util.GetBestBotMonster());
AI.SelectNextCard(CardId.OrcustHarpHorror); AI.SelectNextCard(CardId.OrcustHarpHorror);
return true; return true;
} }
...@@ -632,7 +645,9 @@ namespace WindBot.Game.AI.Decks ...@@ -632,7 +645,9 @@ namespace WindBot.Game.AI.Decks
{ {
if (ActivateDescription == -1 || ActivateDescription == Util.GetStringId(CardId.ThePhantomKnightsofRustyBardiche, 0)) if (ActivateDescription == -1 || ActivateDescription == Util.GetStringId(CardId.ThePhantomKnightsofRustyBardiche, 0))
{ {
ClientCard target = Util.GetBestEnemyCard(false, true); ClientCard target = GetFogBladeTarget();
if (target == null)
target = Util.GetBestEnemyCard(false, true);
if (target == null) if (target == null)
return false; return false;
RustyBardicheTarget = target; RustyBardicheTarget = target;
...@@ -650,11 +665,16 @@ namespace WindBot.Game.AI.Decks ...@@ -650,11 +665,16 @@ namespace WindBot.Game.AI.Decks
} }
} }
private ClientCard GetFogBladeTarget()
{
return Enemy.MonsterZone.GetFirstMatchingCard(card => card.OwnTargets.Any(cont => cont.IsCode(CardId.PhantomKnightsFogBlade)));
}
private bool CymbalSkeletonEffect() private bool CymbalSkeletonEffect()
{ {
int[] botTurnTargets = new[] { CardId.GalateaTheOrcustAutomaton, CardId.SheorcustDingirsu }; int[] botTurnTargets = new[] { CardId.GalateaTheOrcustAutomaton, CardId.SheorcustDingirsu };
int[] emenyTurnTargets = new[] { CardId.SheorcustDingirsu, CardId.GalateaTheOrcustAutomaton }; int[] emenyTurnTargets = new[] { CardId.SheorcustDingirsu, CardId.GalateaTheOrcustAutomaton };
if (Duel.Player == 0 && Bot.HasInGraveyard(CardId.GalateaTheOrcustAutomaton) && !Bot.HasInMonstersZone(CardId.GalateaTheOrcustAutomaton)) if (Duel.Player == 0 && Bot.HasInGraveyard(CardId.GalateaTheOrcustAutomaton) && !Bot.HasInMonstersZone(CardId.GalateaTheOrcustAutomaton) && Bot.HasInExtra(CardId.SheorcustDingirsu) && !SheorcustDingirsuSummoned)
{ {
AI.SelectCard(botTurnTargets); AI.SelectCard(botTurnTargets);
CymbalSkeletonUsed = true; CymbalSkeletonUsed = true;
...@@ -686,7 +706,19 @@ namespace WindBot.Game.AI.Decks ...@@ -686,7 +706,19 @@ namespace WindBot.Game.AI.Decks
private bool SheorcustDingirsuEffect() private bool SheorcustDingirsuEffect()
{ {
if (ActivateDescription == 96)
{
// TODO: FogBlade lost target
return true;
}
ClientCard target; ClientCard target;
target = GetFogBladeTarget();
if (target != null && target != RustyBardicheTarget)
{
AI.SelectOption(0);
AI.SelectCard(target);
return true;
}
target = Util.GetProblematicEnemyMonster(); target = Util.GetProblematicEnemyMonster();
if (target != null && target != RustyBardicheTarget) if (target != null && target != RustyBardicheTarget)
{ {
...@@ -701,8 +733,21 @@ namespace WindBot.Game.AI.Decks ...@@ -701,8 +733,21 @@ namespace WindBot.Game.AI.Decks
AI.SelectCard(target); AI.SelectCard(target);
return true; return true;
} }
if (Bot.HasInBanished(CardId.OrcustCymbalSkeleton))
{
AI.SelectOption(1);
AI.SelectCard(CardId.OrcustCymbalSkeleton);
return true;
}
target = Enemy.MonsterZone.GetFirstMatchingCard(card => card != RustyBardicheTarget) ?? Enemy.SpellZone.GetFirstMatchingCard(card => card != RustyBardicheTarget);
if (target != null)
{
AI.SelectOption(0);
AI.SelectCard(target);
return true;
}
AI.SelectOption(1); AI.SelectOption(1);
AI.SelectCard(CardId.OrcustCymbalSkeleton); //AI.SelectCard(); any card
return true; return true;
} }
...@@ -731,6 +776,8 @@ namespace WindBot.Game.AI.Decks ...@@ -731,6 +776,8 @@ namespace WindBot.Game.AI.Decks
private bool ShadeBrigandineSummonSecond() private bool ShadeBrigandineSummonSecond()
{ {
if (DefaultOnBecomeTarget())
return true;
return (Bot.HasInMonstersZone(CardId.SalamangreatAlmiraj) && Bot.HasInExtra(CardId.KnightmarePhoenix)) || return (Bot.HasInMonstersZone(CardId.SalamangreatAlmiraj) && Bot.HasInExtra(CardId.KnightmarePhoenix)) ||
(Bot.HasInMonstersZone(CardId.JetSynchron) && Bot.HasInMonstersZone(CardId.ThePhantomKnightsofSilentBoots)); (Bot.HasInMonstersZone(CardId.JetSynchron) && Bot.HasInMonstersZone(CardId.ThePhantomKnightsofSilentBoots));
} }
...@@ -755,6 +802,7 @@ namespace WindBot.Game.AI.Decks ...@@ -755,6 +802,7 @@ namespace WindBot.Game.AI.Decks
CardId.OrcustHarpHorror, CardId.OrcustHarpHorror,
CardId.CrystronNeedlefiber, CardId.CrystronNeedlefiber,
CardId.SkyStrikerAceKagari, CardId.SkyStrikerAceKagari,
CardId.KnightmareMermaid,
CardId.ArmageddonKnight CardId.ArmageddonKnight
}); });
return true; return true;
...@@ -805,6 +853,36 @@ namespace WindBot.Game.AI.Decks ...@@ -805,6 +853,36 @@ namespace WindBot.Game.AI.Decks
return Bot.GetMonsterCount() < 2; return Bot.GetMonsterCount() < 2;
} }
private bool OneCardComboSummon()
{
if (Bot.HasInExtra(CardId.SalamangreatAlmiraj) && Bot.HasInExtra(new[] { CardId.CrystronNeedlefiber, CardId.KnightmarePhoenix }))
{
NormalSummoned = true;
return true;
}
return false;
}
private bool LinkMaterialSummon()
{
if (Bot.HasInExtra(CardId.KnightmarePhoenix) && Bot.GetMonsterCount() > 0)
{
NormalSummoned = true;
return true;
}
return false;
}
private bool TunerSummon()
{
if (Bot.HasInExtra(new[] { CardId.CrystronNeedlefiber, CardId.KnightmarePhoenix }) && Bot.GetMonsterCount() > 0)
{
NormalSummoned = true;
return true;
}
return false;
}
private bool OtherSummon() private bool OtherSummon()
{ {
NormalSummoned = true; NormalSummoned = true;
...@@ -861,5 +939,12 @@ namespace WindBot.Game.AI.Decks ...@@ -861,5 +939,12 @@ namespace WindBot.Game.AI.Decks
} }
return false; return false;
} }
private bool MonsterRepos()
{
if (Card.IsFacedown())
return true;
return DefaultMonsterRepos();
}
} }
} }
...@@ -59,6 +59,8 @@ namespace WindBot.Game.AI ...@@ -59,6 +59,8 @@ namespace WindBot.Game.AI
public const int GhostOgreAndSnowRabbit = 59438930; public const int GhostOgreAndSnowRabbit = 59438930;
public const int GhostBelle = 73642296; public const int GhostBelle = 73642296;
public const int EffectVeiler = 63845230; public const int EffectVeiler = 63845230;
public const int ArtifactLancea = 34267821;
public const int CalledByTheGrave = 24224830; public const int CalledByTheGrave = 24224830;
public const int InfiniteImpermanence = 10045474; public const int InfiniteImpermanence = 10045474;
public const int GalaxySoldier = 46659709; public const int GalaxySoldier = 46659709;
...@@ -439,7 +441,9 @@ namespace WindBot.Game.AI ...@@ -439,7 +441,9 @@ namespace WindBot.Game.AI
_CardId.LockBird, _CardId.LockBird,
_CardId.GhostOgreAndSnowRabbit, _CardId.GhostOgreAndSnowRabbit,
_CardId.AshBlossom, _CardId.AshBlossom,
_CardId.GhostBelle _CardId.GhostBelle,
_CardId.EffectVeiler,
_CardId.ArtifactLancea
}; };
if (Duel.LastChainPlayer == 1) if (Duel.LastChainPlayer == 1)
{ {
......
...@@ -371,7 +371,7 @@ namespace WindBot.Game ...@@ -371,7 +371,7 @@ namespace WindBot.Game
{ {
foreach (CardExecutor exec in Executor.Executors) foreach (CardExecutor exec in Executor.Executors)
{ {
if (ShouldExecute(exec, card, ExecutorType.Activate)) if (ShouldExecute(exec, card, ExecutorType.Activate, desc))
return true; return true;
} }
return false; return false;
......
...@@ -1115,6 +1115,14 @@ namespace WindBot.Game ...@@ -1115,6 +1115,14 @@ namespace WindBot.Game
packet.ReadByte(); packet.ReadByte();
int desc = packet.ReadInt32(); int desc = packet.ReadInt32();
if (desc == 0 || desc == 221)
{
// 0: phase trigger effect
// 221: trigger effect
// for compatibility
desc = -1;
}
ClientCard card = _duel.GetCard(player, loc, seq); ClientCard card = _duel.GetCard(player, loc, seq);
if (card == null) if (card == null)
{ {
......
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