Commit 66f2396a authored by nanahira's avatar nanahira

Merge branch 'master' of git.mycard.moe:mycard/windbot

parents ba9636b8 ff957ee2
......@@ -26,7 +26,7 @@ SUPPORT_MASTER_RULE_2020
!P2-自选卡组
Name=P2 Deck=Lucky Dialog=gugugu.zh-CN
人机卡组由你选择。随缘出牌。可将你的卡组文件(.ydk)复制到WindBot的对应文件夹。
人机卡组由你选择。随缘出牌。
SELECT_DECKFILE SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!谜之剑士LV4-龙骑星爆
......@@ -209,7 +209,7 @@ Name=朱露咲浅羽 Deck=Salamangreat Dialog=nlch.zh-CN
浅羽的香喷喷曲奇。
AI_LV3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!朱露咲浅羽-真红眼
!朱露咲浅羽-真红眼龙骑士
Name=朱露咲浅羽 Deck=Dragun Dialog=nlch.zh-CN
超魔导真红眼龙骑士卡组。
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
......@@ -232,4 +232,4 @@ AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!濑名歌铃
Name=濑名歌铃 Deck=Brave Dialog=wof-Sena-Karin
????? 卡组。
AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
AI_LV3 SUPPORT_MASTER_RULE_2020
......@@ -12,7 +12,7 @@
"接下来就是我的舞台"
],
"endturn": [
"我的回合结束,试试来击溃我吧"
"每个人的目的不同,我更注重强度,我只想赢。"
],
"directattack": [
"老子上了,要你的命"
......
......@@ -22,7 +22,7 @@
"directattack": [
"{0},直接攻击!",
"不过如此嘛,直接攻击!",
"快走开,我要回去睡觉了。",
"快走开,我要回去睡觉了。"
],
"attack": [
"{0},攻击{1}!",
......
......@@ -53,6 +53,7 @@ namespace WindBot.Game.AI.Decks
public const int BraveToken = 3285552;
public const int MechaPhantomBeastToken = 31533705;
public const int PrimalBeingToken = 27204312;
}
public BraveExecutor(GameAI ai, Duel duel)
......@@ -146,7 +147,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Summon, CardId.NemesesCorridor, SummonForMaterial);
AddExecutor(ExecutorType.Summon, CardId.DestinyHeroCelestial, SummonForMaterial);
AddExecutor(ExecutorType.Activate, CardId.DestinyHeroDasher);
AddExecutor(ExecutorType.Activate, CardId.DestinyHeroDasher, DestinyHeroDasherEffect);
AddExecutor(ExecutorType.Activate, CardId.DestinyHeroCelestial, DestinyHeroCelestialEffect);
AddExecutor(ExecutorType.Repos, MonsterRepos);
......@@ -163,6 +164,8 @@ namespace WindBot.Game.AI.Decks
private bool JetSynchronUsed = false;
private bool FusionDestinyUsed = false;
private bool BaronessDeFleurUsed = false;
private ClientCard PhoenixTarget = null;
private int PhoenixSelectingTarget = 0;
public override bool OnSelectHand()
{
......@@ -175,6 +178,8 @@ namespace WindBot.Game.AI.Decks
BeastOLionUsed = false;
JetSynchronUsed = false;
FusionDestinyUsed = false;
PhoenixTarget = null;
PhoenixSelectingTarget = 0;
}
public override CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions)
......@@ -184,6 +189,8 @@ namespace WindBot.Game.AI.Decks
{
if (cardData.Attack <= 1000)
return CardPosition.FaceUpDefence;
if (Util.IsTurn1OrMain2() && cardData.Attack <= 2500)
return CardPosition.FaceUpDefence;
}
return 0;
}
......@@ -207,6 +214,9 @@ namespace WindBot.Game.AI.Decks
public override IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, int hint, bool cancelable)
{
if (hint != HintMsg.Destroy)
PhoenixSelectingTarget = 0;
if (hint == HintMsg.AddToHand && max == 1)
{
foreach (ClientCard card in cards)
......@@ -234,6 +244,23 @@ namespace WindBot.Game.AI.Decks
return new List<ClientCard>(new[] { card });
}
}
if (hint == HintMsg.Destroy && max == 1)
{
PhoenixSelectingTarget++;
if (PhoenixSelectingTarget >= 2 && !cards.Contains(PhoenixTarget))
{
ClientCard target = Util.GetProblematicEnemyCard();
if (target == null || !cards.Contains(target))
target = Util.GetBestEnemyCard();
if (target != null && cards.Contains(target))
return new List<ClientCard>(new[] { target });
}
}
if (hint == HintMsg.LinkMaterial && cancelable && min == 0)
{
// TODO: not working
return new List<ClientCard>();
}
return base.OnSelectCard(cards, min, max, hint, cancelable);
}
......@@ -341,6 +368,7 @@ namespace WindBot.Game.AI.Decks
|| (Duel.Player == 0 && Util.IsTurn1OrMain2())
|| (Duel.Player == 1 && Enemy.GetMonsterCount() >= 2))
{
PhoenixTarget = target;
AI.SelectCard(CardId.DestinyHeroDestroyPhoenixEnforcer);
AI.SelectNextCard(target);
return true;
......@@ -432,10 +460,19 @@ namespace WindBot.Game.AI.Decks
else
{
// search rider or aquamancer
if (Bot.GetRemainingCount(CardId.WanderingGryphonRider, 1) == 0 && Bot.HasInHandOrInMonstersZoneOrInGraveyard(CardId.AquamancerOfTheSanctuary))
return false;
AI.SelectCard(CardId.WanderingGryphonRider);
AI.SelectNextCard(GetHandCost());
if (Bot.GetRemainingCount(CardId.WanderingGryphonRider, 1) == 0 || Bot.GetHandCount() == 0 || !Bot.HasInMonstersZone(CardId.BraveToken))
{
AI.SelectCard(CardId.AquamancerOfTheSanctuary);
if (Bot.HasInHandOrInMonstersZoneOrInGraveyard(CardId.AquamancerOfTheSanctuary))
AI.SelectNextCard(CardId.AquamancerOfTheSanctuary);
else
AI.SelectNextCard(GetHandCost());
}
else
{
AI.SelectCard(CardId.WanderingGryphonRider);
AI.SelectNextCard(GetHandCost());
}
return true;
}
}
......@@ -494,6 +531,7 @@ namespace WindBot.Game.AI.Decks
return false;
List<int> materials = new List<int>{
CardId.Sangan,
_CardId.GamecieltheSeaTurtleKaiju,
CardId.PredaplantVerteAnaconda,
CardId.SalamangreatAlmiraj,
CardId.LinkSpider,
......@@ -647,8 +685,9 @@ namespace WindBot.Game.AI.Decks
private bool SalamangreatAlmirajSummon()
{
if (PhoenixNotAvail())
return false;
int[] materials = new[] {
CardId.Sangan,
CardId.MechaPhantomBeastOLion,
CardId.JetSynchron
};
......@@ -669,6 +708,10 @@ namespace WindBot.Game.AI.Decks
{
materials.Add(CardId.BraveToken);
}
if (Bot.GetMonsters().Any(card => card.IsCode(CardId.PrimalBeingToken) && card.Attack <= 4000))
{
materials.Add(CardId.PrimalBeingToken);
}
if (Bot.MonsterZone.GetMatchingCardsCount(card => card.IsCode(materials)) == 0)
return false;
AI.SelectMaterials(materials);
......@@ -700,7 +743,7 @@ namespace WindBot.Game.AI.Decks
private bool PhoenixNotAvail()
{
return Bot.GetRemainingCount(CardId.FusionDestiny, 3) == 0 || Bot.HasInHand(CardId.FusionDestiny)
return Bot.LifePoints <= 2000 || Bot.GetRemainingCount(CardId.FusionDestiny, 3) == 0 || Bot.HasInHand(CardId.FusionDestiny)
|| !Bot.HasInExtra(CardId.PredaplantVerteAnaconda) || !Bot.HasInExtra(CardId.DestinyHeroDestroyPhoenixEnforcer)
|| (Bot.GetRemainingCount(CardId.DestinyHeroCelestial, 1) == 0 && !Bot.HasInHand(CardId.DestinyHeroCelestial))
|| (Bot.GetRemainingCount(CardId.DestinyHeroDasher, 1) == 0 && !Bot.HasInHand(CardId.DestinyHeroDasher));
......@@ -712,6 +755,7 @@ namespace WindBot.Game.AI.Decks
return false;
List<int> materials = new List<int>{
_CardId.GamecieltheSeaTurtleKaiju,
CardId.AquamancerOfTheSanctuary,
CardId.Sangan,
CardId.SalamangreatAlmiraj,
......@@ -807,6 +851,11 @@ namespace WindBot.Game.AI.Decks
}
}
private bool DestinyHeroDasherEffect()
{
return Bot.Hand.Count(card => card.IsMonster()) > 1;
}
private bool DestinyHeroCelestialEffect()
{
if (!Bot.HasInGraveyard(CardId.DestinyHeroDasher))
......@@ -860,6 +909,10 @@ namespace WindBot.Game.AI.Decks
private bool BaronessDeFleurEffect()
{
if (Duel.LastChainPlayer == 0)
{
return false;
}
if (Duel.LastChainPlayer == 1)
{
BaronessDeFleurUsed = true;
......@@ -886,6 +939,9 @@ namespace WindBot.Game.AI.Decks
private bool VirtualWorldKyubiShenshenSummon()
{
if (Bot.HasInMonstersZone(CardId.DestinyHeroDestroyPhoenixEnforcer))
return false;
int[] materials = new[] {
CardId.CoralDragon,
......
......@@ -106,6 +106,7 @@ namespace WindBot.Game.AI
public const int MacroCosmos = 30241314;
public const int UpstartGoblin = 70368879;
public const int CyberEmergency = 60600126;
public const int TheAgentOfCreationVenus = 64734921;
public const int EaterOfMillions = 63845230;
......@@ -471,7 +472,8 @@ namespace WindBot.Game.AI
int[] ignoreList = {
_CardId.MacroCosmos,
_CardId.UpstartGoblin,
_CardId.CyberEmergency
_CardId.CyberEmergency,
_CardId.TheAgentOfCreationVenus
};
if (Util.GetLastChainCard().IsCode(ignoreList))
return false;
......@@ -793,14 +795,14 @@ namespace WindBot.Game.AI
_CardId.JudgmentDragon,
_CardId.TopologicTrisbaena
};
int[] destroyAllOpponentList =
int[] destroyAllOpponentSpellList =
{
_CardId.HarpiesFeatherDuster,
_CardId.DarkMagicAttack
};
if (Util.ChainContainsCard(destroyAllList)) return true;
if (Enemy.HasInSpellZone(destroyAllOpponentList, true)) return true;
if (Enemy.HasInSpellZone(destroyAllOpponentSpellList, true) && Card.Location == CardLocation.SpellZone) return true;
// TODO: ChainContainsCard(id, player)
return false;
}
......
......@@ -1041,6 +1041,7 @@ namespace WindBot.Game
int seq = packet.ReadByte();
packet.ReadByte(); // pos
}
if (count2 == 0) cancelable = false;
IList<ClientCard> selected = func(cards, (finishable ? 0 : 1), 1, _select_hint, cancelable);
......
......@@ -79,6 +79,8 @@ WindBot can run as a "server", provide a http interface to create bot.
* BlueEyesMaxDragon
* Brave
* ChainBurn
* DarkMagician
......
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