Commit 60252a31 authored by mercury233's avatar mercury233

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

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