Commit d0cdd683 authored by wind2009's avatar wind2009

Merge branch 'master' into dealer-season2

parents 55b26c72 f7366b40
...@@ -15,12 +15,12 @@ jobs: ...@@ -15,12 +15,12 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Setup MSBuild.exe - name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1 uses: microsoft/setup-msbuild@v2
- name: Build! - name: Build!
run: msbuild $env:Solution_Name /t:Build /p:Configuration=Release run: msbuild $env:Solution_Name /t:Build /p:Configuration=Release
...@@ -36,7 +36,7 @@ jobs: ...@@ -36,7 +36,7 @@ jobs:
cd .. cd ..
- name: Upload build artifacts - name: Upload build artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
path: dist\WindBot.7z path: dist\WindBot.7z
...@@ -46,7 +46,7 @@ jobs: ...@@ -46,7 +46,7 @@ jobs:
with: with:
repo_token: "${{ secrets.GITHUB_TOKEN }}" repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest" automatic_release_tag: "latest"
prerelease: true prerelease: false
title: "Development Build" title: "Development Build"
files: | files: |
dist/WindBot.7z dist/WindBot.7z
...@@ -42,4 +42,4 @@ AI_LV3 SUPPORT_MASTER_RULE_2020 ...@@ -42,4 +42,4 @@ AI_LV3 SUPPORT_MASTER_RULE_2020
!复制梁龙-闪刀姬 !复制梁龙-闪刀姬
Name=复制梁龙 Deck=SkyStriker Dialog=anothercopy.zh-CN Name=复制梁龙 Deck=SkyStriker Dialog=anothercopy.zh-CN
旧式闪刀姬卡组。 旧式闪刀姬卡组。
AI_LV3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020 AI_LV3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
\ No newline at end of file
#created by ...
#main
32731036
25451383
60242223
62962630
62962630
62962630
68468459
68468459
45484331
45883110
95515789
19096726
14558127
14558127
14558127
23434538
23434538
23434538
36577931
1984618
1984618
6498706
6498706
34995106
44362883
75500286
81439173
24224830
24224830
29948294
36637374
65681983
82738008
18973184
10045474
10045474
10045474
19271881
32756828
17751597
#extra
11321089
38811586
44146295
44146295
92892239
70534340
3410461
24915933
72272462
1906812
41373230
51409648
87746184
87746184
53971455
!side
56787189
55273561
68468460
72554664
95515790
\ No newline at end of file
#created by ...
#main
81497285
81497285
2347656
41165831
73602965
73602965
75730490
1225009
1225009
1225009
37629703
37629703
37629703
14558127
14558127
14558127
23434538
23434538
23434538
74018812
74018812
74018812
2511
2511
2511
49238328
49238328
5380979
5380979
6351147
6351147
10045474
10045474
10045474
30748475
53417695
83326048
92714517
92714517
92714517
#extra
22850702
22850702
93039339
93039339
29479265
93084621
93084621
24269961
24269961
24269961
67680512
67680512
29301450
71607202
94259633
!side
#created by ...
#main
83334932
83334932
83334932
82112494
82112494
82112494
19510093
19510093
34496660
34496660
34496660
90361010
90361010
90361010
78391364
78391364
56727340
56727340
14624296
95500396
10604644
23434538
23434538
23434538
14558127
14558127
14558127
49036338
38814750
38814750
97268402
97268402
73642296
73642296
59438930
59438930
59438930
94145021
94145021
94145021
#extra
64193046
84815190
30983281
44508094
27548199
76471944
74586817
28912357
38342335
27381364
22423493
65741786
33918636
33918636
33918636
!side
...@@ -64,5 +64,11 @@ ...@@ -64,5 +64,11 @@
"Before you do that, I'll chain {0}!", "Before you do that, I'll chain {0}!",
"Nice try, but I have {0}!", "Nice try, but I have {0}!",
"Didn't expect {0}, did you?" "Didn't expect {0}, did you?"
],
"surrender": [
"I surrender.",
"You win this time.",
"I can't win this duel.",
"Good game."
] ]
} }
\ No newline at end of file
{ {
"welcome": [ "welcome": [
"这里就是大灵峰吗?", "这里就是大灵峰吗?",
"这里是教导龙国。" "这里是教导龙国。",
"这里是开放的大地。"
], ],
"deckerror": [ "deckerror": [
"{0}被冰水咒缚了!" "{0}被冰水咒缚了!"
......
...@@ -55,5 +55,10 @@ ...@@ -55,5 +55,10 @@
"但我鸽了", "但我鸽了",
"无此服务", "无此服务",
"可怕" "可怕"
],
"surrender": [
"太可怕了(跑路",
"这游戏好难玩(跑路",
"还好我不玩游戏王(跑路"
] ]
} }
{
"welcome": [
"是宵夜哒哟!",
"什么灵摆卡组都会玩的哟!",
"什么?你说超重不是灵摆卡组?"
],
"deckerror": [
"{0}的数量不对!快去改成无禁限模式!。"
],
"duelstart": [
"给你展现一下超重的魅力!"
],
"newturn": [
"抽卡!弁庆你别上手救我了!",
"抽卡!P身子你别上手救我了!"
],
"endturn": [
"哼哼,到你的回合了!",
"喜不喜欢我的展开呢?"
],
"directattack": [
"我用{0}直接攻击!"
],
"attack": [
"我用{0}攻击{1}!"
],
"ondirectattack": [
"不许打!不许打呀!",
"呜哇!要被打倒惹~"
],
"facedownmonstername": "怪兽",
"activate": [
"呼呼呼,{0}的效果太厉害了!",
"呼呼呼,我使用{0}的效果。"
],
"summon": [
"呼呼呼,我召唤{0}!"
],
"setmonster": [
"呼呼呼,我盖放了一只怪兽。"
],
"chaining": [
"此刻!{0}的效果发动!"
]
}
...@@ -71,5 +71,9 @@ ...@@ -71,5 +71,9 @@
"我不认同。{0},发动!", "我不认同。{0},发动!",
"看样子你忘了我的{0}!", "看样子你忘了我的{0}!",
"你考虑过我有{0}吗?" "你考虑过我有{0}吗?"
],
"surrender": [
"我认输。",
"我承认你的胜利。"
] ]
} }
...@@ -434,6 +434,15 @@ namespace WindBot.Game.AI ...@@ -434,6 +434,15 @@ namespace WindBot.Game.AI
if (selected.Count >= max) if (selected.Count >= max)
break; break;
} }
if (selected.Count < min)
{
#if DEBUG
throw new Exception("Not enough cards to CheckSelectCount");
#else
Logger.WriteErrorLine("Not enough cards to CheckSelectCount, using default");
return null;
#endif
}
} }
while (selected.Count > max) while (selected.Count > max)
{ {
......
...@@ -55,28 +55,32 @@ namespace WindBot.Game.AI ...@@ -55,28 +55,32 @@ namespace WindBot.Game.AI
{ {
return cards return cards
.Where(card => card?.Data != null && card.HasType(CardType.Monster) && card.IsFaceup() && !(canBeTarget && card.IsShouldNotBeTarget())) .Where(card => card?.Data != null && card.HasType(CardType.Monster) && card.IsFaceup() && !(canBeTarget && card.IsShouldNotBeTarget()))
.OrderBy(card => card.Attack).FirstOrDefault(); .OrderByDescending(card => card.Attack)
.FirstOrDefault();
} }
public static ClientCard GetHighestDefenseMonster(this IEnumerable<ClientCard> cards, bool canBeTarget = false) public static ClientCard GetHighestDefenseMonster(this IEnumerable<ClientCard> cards, bool canBeTarget = false)
{ {
return cards return cards
.Where(card => card?.Data != null && card.HasType(CardType.Monster) && card.IsFaceup() && !(canBeTarget && card.IsShouldNotBeTarget())) .Where(card => card?.Data != null && card.HasType(CardType.Monster) && card.IsFaceup() && !(canBeTarget && card.IsShouldNotBeTarget()))
.OrderBy(card => card.Defense).FirstOrDefault(); .OrderByDescending(card => card.Defense)
.FirstOrDefault();
} }
public static ClientCard GetLowestAttackMonster(this IEnumerable<ClientCard> cards, bool canBeTarget = false) public static ClientCard GetLowestAttackMonster(this IEnumerable<ClientCard> cards, bool canBeTarget = false)
{ {
return cards return cards
.Where(card => card?.Data != null && card.HasType(CardType.Monster) && card.IsFaceup() && !(canBeTarget && card.IsShouldNotBeTarget())) .Where(card => card?.Data != null && card.HasType(CardType.Monster) && card.IsFaceup() && !(canBeTarget && card.IsShouldNotBeTarget()))
.OrderByDescending(card => card.Attack).FirstOrDefault(); .OrderBy(card => card.Attack)
.FirstOrDefault();
} }
public static ClientCard GetLowestDefenseMonster(this IEnumerable<ClientCard> cards, bool canBeTarget = false) public static ClientCard GetLowestDefenseMonster(this IEnumerable<ClientCard> cards, bool canBeTarget = false)
{ {
return cards return cards
.Where(card => card?.Data != null && card.HasType(CardType.Monster) && card.IsFaceup() && !(canBeTarget && card.IsShouldNotBeTarget())) .Where(card => card?.Data != null && card.HasType(CardType.Monster) && card.IsFaceup() && !(canBeTarget && card.IsShouldNotBeTarget()))
.OrderByDescending(card => card.Defense).FirstOrDefault(); .OrderBy(card => card.Defense)
.FirstOrDefault();
} }
public static bool ContainsMonsterWithLevel(this IEnumerable<ClientCard> cards, int level) public static bool ContainsMonsterWithLevel(this IEnumerable<ClientCard> cards, int level)
......
...@@ -21,7 +21,8 @@ namespace WindBot.Game.AI ...@@ -21,7 +21,8 @@ namespace WindBot.Game.AI
/// </summary> /// </summary>
public static bool IsMonsterDangerous(this ClientCard card) public static bool IsMonsterDangerous(this ClientCard card)
{ {
return !card.IsDisabled() && Enum.IsDefined(typeof(DangerousMonster), card.Id); return !card.IsDisabled() &&
(Enum.IsDefined(typeof(DangerousMonster), card.Id) || (card.HasSetcode(0x18d) && (card.HasType(CardType.Ritual) || card.EquipCards.Count > 0)));
} }
/// <summary> /// <summary>
......
This diff is collapsed.
...@@ -3,6 +3,7 @@ using System.Collections.Generic; ...@@ -3,6 +3,7 @@ using System.Collections.Generic;
using WindBot; using WindBot;
using WindBot.Game; using WindBot.Game;
using WindBot.Game.AI; using WindBot.Game.AI;
using System.Linq;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
...@@ -220,8 +221,7 @@ namespace WindBot.Game.AI.Decks ...@@ -220,8 +221,7 @@ namespace WindBot.Game.AI.Decks
public bool isAltergeist(ClientCard card) public bool isAltergeist(ClientCard card)
{ {
return card.IsCode(CardId.Marionetter, CardId.Hexstia, CardId.Protocol, CardId.Multifaker, CardId.Meluseek, return card != null && card.HasSetcode(0x103);
CardId.Kunquery, CardId.Manifestation, CardId.Silquitous);
} }
public int GetSequence(ClientCard card) public int GetSequence(ClientCard card)
...@@ -324,23 +324,37 @@ namespace WindBot.Game.AI.Decks ...@@ -324,23 +324,37 @@ namespace WindBot.Game.AI.Decks
public int SelectSTPlace(ClientCard card=null, bool avoid_Impermanence = false) public int SelectSTPlace(ClientCard card=null, bool avoid_Impermanence = false)
{ {
List<int> list = new List<int> { 0, 1, 2, 3, 4 }; if (card == null) card = Card;
List<int> list = new List<int>();
for (int seq = 0; seq < 5; ++seq)
{
if (Bot.SpellZone[seq] == null)
{
if (card != null && card.Location == CardLocation.Hand && avoid_Impermanence && Impermanence_list.Contains(seq)) continue;
list.Add(seq);
}
}
int n = list.Count; int n = list.Count;
while (n-- > 1) while (n-- > 1)
{ {
int index = Program.Rand.Next(n + 1); int index = Program.Rand.Next(list.Count);
int temp = list[index]; int nextIndex = (index + Program.Rand.Next(list.Count - 1)) % list.Count;
list[index] = list[n]; int tempInt = list[index];
list[n] = temp; list[index] = list[nextIndex];
list[nextIndex] = tempInt;
} }
foreach (int seq in list) if (avoid_Impermanence && Bot.GetMonsters().Any(c => c.IsFaceup() && !c.IsDisabled()))
{ {
int zone = (int)System.Math.Pow(2, seq); foreach (int seq in list)
if (Bot.SpellZone[seq] == null)
{ {
if (card != null && card.Location == CardLocation.Hand && avoid_Impermanence && Impermanence_list.Contains(seq)) continue; ClientCard enemySpell = Enemy.SpellZone[4 - seq];
return zone; if (enemySpell != null && enemySpell.IsFacedown()) continue;
}; return (int)System.Math.Pow(2, seq);
}
}
foreach (int seq in list)
{
return (int)System.Math.Pow(2, seq);
} }
return 0; return 0;
} }
...@@ -376,6 +390,7 @@ namespace WindBot.Game.AI.Decks ...@@ -376,6 +390,7 @@ namespace WindBot.Game.AI.Decks
public bool spell_trap_activate(bool isCounter = false, ClientCard target = null) public bool spell_trap_activate(bool isCounter = false, ClientCard target = null)
{ {
if (target == null) target = Card; if (target == null) target = Card;
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (target.Location != CardLocation.SpellZone && target.Location != CardLocation.Hand) return true; if (target.Location != CardLocation.SpellZone && target.Location != CardLocation.Hand) return true;
if (Enemy.HasInMonstersZone(CardId.NaturalExterio, true) && !Bot.HasInHandOrHasInMonstersZone(CardId.GO_SR) && !isCounter && !Bot.HasInSpellZone(CardId.SolemnStrike)) return false; if (Enemy.HasInMonstersZone(CardId.NaturalExterio, true) && !Bot.HasInHandOrHasInMonstersZone(CardId.GO_SR) && !isCounter && !Bot.HasInSpellZone(CardId.SolemnStrike)) return false;
if (target.IsSpell()) if (target.IsSpell())
...@@ -649,7 +664,7 @@ namespace WindBot.Game.AI.Decks ...@@ -649,7 +664,7 @@ namespace WindBot.Game.AI.Decks
public bool G_activate() public bool G_activate()
{ {
return (Duel.Player == 1); return (Duel.Player == 1) && !DefaultCheckWhetherCardIsNegated(Card);
} }
public bool NaturalExterio_eff() public bool NaturalExterio_eff()
...@@ -806,6 +821,7 @@ namespace WindBot.Game.AI.Decks ...@@ -806,6 +821,7 @@ namespace WindBot.Game.AI.Decks
public bool Hand_act_eff() public bool Hand_act_eff()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Card.IsCode(CardId.AB_JS) && Util.GetLastChainCard().HasSetcode(0x11e) && Util.GetLastChainCard().Location == CardLocation.Hand) // Danger! archtype hand effect if (Card.IsCode(CardId.AB_JS) && Util.GetLastChainCard().HasSetcode(0x11e) && Util.GetLastChainCard().Location == CardLocation.Hand) // Danger! archtype hand effect
return false; return false;
if (Card.IsCode(CardId.GO_SR) && Card.Location == CardLocation.Hand && Bot.HasInMonstersZone(CardId.GO_SR)) return false; if (Card.IsCode(CardId.GO_SR) && Card.Location == CardLocation.Hand && Bot.HasInMonstersZone(CardId.GO_SR)) return false;
...@@ -886,6 +902,7 @@ namespace WindBot.Game.AI.Decks ...@@ -886,6 +902,7 @@ namespace WindBot.Game.AI.Decks
public bool GR_WC_activate() public bool GR_WC_activate()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
int warrior_count = 0; int warrior_count = 0;
int pendulum_count = 0; int pendulum_count = 0;
int link_count = 0; int link_count = 0;
...@@ -1248,7 +1265,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1248,7 +1265,7 @@ namespace WindBot.Game.AI.Decks
if (linked_card != null && linked_card.IsCode(CardId.Hexstia)) if (linked_card != null && linked_card.IsCode(CardId.Hexstia))
{ {
int next_seq = get_Hexstia_linkzone(this_seq); int next_seq = get_Hexstia_linkzone(this_seq);
if (next_seq != -1 && Bot.MonsterZone[next_seq] != null && isAltergeist(Bot.MonsterZone[next_seq].Id)) return false; if (next_seq != -1 && Bot.MonsterZone[next_seq] != null && isAltergeist(Bot.MonsterZone[next_seq])) return false;
} }
} }
return true; return true;
...@@ -1675,7 +1692,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1675,7 +1692,7 @@ namespace WindBot.Game.AI.Decks
if (target.IsCode(CardId.Hexstia)) if (target.IsCode(CardId.Hexstia))
{ {
int next_index = get_Hexstia_linkzone(i); int next_index = get_Hexstia_linkzone(i);
if (next_index != -1 && Bot.MonsterZone[next_index] != null && Bot.MonsterZone[next_index].IsFaceup() && isAltergeist(Bot.MonsterZone[next_index].Id)) continue; if (next_index != -1 && Bot.MonsterZone[next_index] != null && Bot.MonsterZone[next_index].IsFaceup() && isAltergeist(Bot.MonsterZone[next_index])) continue;
} }
if (!get_linked_by_Hexstia(i)) if (!get_linked_by_Hexstia(i))
{ {
...@@ -2654,6 +2671,28 @@ namespace WindBot.Game.AI.Decks ...@@ -2654,6 +2671,28 @@ namespace WindBot.Game.AI.Decks
ss_other_monster = false; ss_other_monster = false;
Impermanence_list.Clear(); Impermanence_list.Clear();
attacked_Meluseek.Clear(); attacked_Meluseek.Clear();
base.OnNewTurn();
}
public override void OnChaining(int player, ClientCard card)
{
if (card == null) return;
if (player == 1)
{
if (card.IsCode(_CardId.InfiniteImpermanence))
{
for (int i = 0; i < 5; ++i)
{
if (Enemy.SpellZone[i] == card)
{
Impermanence_list.Add(4-i);
break;
}
}
}
}
base.OnChaining(player, card);
} }
public bool MonsterRepos() public bool MonsterRepos()
...@@ -2797,7 +2836,8 @@ namespace WindBot.Game.AI.Decks ...@@ -2797,7 +2836,8 @@ namespace WindBot.Game.AI.Decks
// throw all?? // throw all??
return null; return null;
} }
return null;
return base.OnSelectCard(cards, min, max, hint, cancelable);
} }
public override CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions) public override CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions)
...@@ -2853,16 +2893,16 @@ namespace WindBot.Game.AI.Decks ...@@ -2853,16 +2893,16 @@ namespace WindBot.Game.AI.Decks
if (cardId == CardId.Hexstia) if (cardId == CardId.Hexstia)
{ {
// ex zone // ex zone
if ((Zones.z5 & available) > 0 && Bot.MonsterZone[1] != null && isAltergeist(Bot.MonsterZone[1].Id)) return Zones.z5; if ((Zones.z5 & available) > 0 && Bot.MonsterZone[1] != null && isAltergeist(Bot.MonsterZone[1])) return Zones.z5;
if ((Zones.z6 & available) > 0 && Bot.MonsterZone[3] != null && isAltergeist(Bot.MonsterZone[3].Id)) return Zones.z6; if ((Zones.z6 & available) > 0 && Bot.MonsterZone[3] != null && isAltergeist(Bot.MonsterZone[3])) return Zones.z6;
if ( ((Zones.z6 & available) > 0 && Bot.MonsterZone[3] != null && !isAltergeist(Bot.MonsterZone[3].Id)) if ( ((Zones.z6 & available) > 0 && Bot.MonsterZone[3] != null && !isAltergeist(Bot.MonsterZone[3]))
|| ((Zones.z5 & available) > 0 && Bot.MonsterZone[1] == null) ) return Zones.z5; || ((Zones.z5 & available) > 0 && Bot.MonsterZone[1] == null) ) return Zones.z5;
if (((Zones.z5 & available) > 0 && Bot.MonsterZone[1] != null && !isAltergeist(Bot.MonsterZone[1].Id)) if (((Zones.z5 & available) > 0 && Bot.MonsterZone[1] != null && !isAltergeist(Bot.MonsterZone[1]))
|| ((Zones.z6 & available) > 0 && Bot.MonsterZone[3] == null)) return Zones.z6; || ((Zones.z6 & available) > 0 && Bot.MonsterZone[3] == null)) return Zones.z6;
// main zone // main zone
for (int i = 1; i < 5; ++i) for (int i = 1; i < 5; ++i)
{ {
if (Bot.MonsterZone[i] != null && isAltergeist(Bot.MonsterZone[i].Id)) if (Bot.MonsterZone[i] != null && isAltergeist(Bot.MonsterZone[i]))
{ {
if ((available & (int)System.Math.Pow(2, i - 1)) > 0) return (int)System.Math.Pow(2, i - 1); if ((available & (int)System.Math.Pow(2, i - 1)) > 0) return (int)System.Math.Pow(2, i - 1);
} }
...@@ -2876,5 +2916,15 @@ namespace WindBot.Game.AI.Decks ...@@ -2876,5 +2916,15 @@ namespace WindBot.Game.AI.Decks
} }
return base.OnSelectPlace(cardId, player, location, available); return base.OnSelectPlace(cardId, player, location, available);
} }
protected override bool DefaultSetForDiabellze()
{
if (base.DefaultSetForDiabellze())
{
AI.SelectPlace(SelectSTPlace(Card, true));
return true;
}
return false;
}
} }
} }
\ No newline at end of file
...@@ -131,6 +131,7 @@ namespace WindBot.Game.AI.Decks ...@@ -131,6 +131,7 @@ namespace WindBot.Game.AI.Decks
UsedGalaxyEyesCipherDragon = null; UsedGalaxyEyesCipherDragon = null;
AlternativeWhiteDragonSummoned = false; AlternativeWhiteDragonSummoned = false;
SoulChargeUsed = false; SoulChargeUsed = false;
base.OnNewTurn();
} }
public override IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, int hint, bool cancelable) public override IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, int hint, bool cancelable)
...@@ -146,7 +147,8 @@ namespace WindBot.Game.AI.Decks ...@@ -146,7 +147,8 @@ namespace WindBot.Game.AI.Decks
return Util.CheckSelectCount(result, cards, min, max); return Util.CheckSelectCount(result, cards, min, max);
} }
Logger.DebugWriteLine("Use default."); Logger.DebugWriteLine("Use default.");
return null;
return base.OnSelectCard(cards, min, max, hint, cancelable);
} }
public override IList<ClientCard> OnSelectXyzMaterial(IList<ClientCard> cards, int min, int max) public override IList<ClientCard> OnSelectXyzMaterial(IList<ClientCard> cards, int min, int max)
......
...@@ -121,6 +121,7 @@ namespace WindBot.Game.AI.Decks ...@@ -121,6 +121,7 @@ namespace WindBot.Game.AI.Decks
private bool MaxxCeff() private bool MaxxCeff()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
return Duel.Player == 1; return Duel.Player == 1;
} }
...@@ -464,6 +465,7 @@ namespace WindBot.Game.AI.Decks ...@@ -464,6 +465,7 @@ namespace WindBot.Game.AI.Decks
private bool Linkuriboheff() private bool Linkuriboheff()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Duel.LastChainPlayer == 0 && Util.GetLastChainCard().IsCode(CardId.Linkuriboh)) return false; if (Duel.LastChainPlayer == 0 && Util.GetLastChainCard().IsCode(CardId.Linkuriboh)) return false;
return true; return true;
} }
......
...@@ -180,6 +180,7 @@ namespace WindBot.Game.AI.Decks ...@@ -180,6 +180,7 @@ namespace WindBot.Game.AI.Decks
FusionDestinyUsed = false; FusionDestinyUsed = false;
PhoenixTarget = null; PhoenixTarget = null;
PhoenixSelectingTarget = 0; PhoenixSelectingTarget = 0;
base.OnNewTurn();
} }
public override CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions) public override CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions)
...@@ -479,6 +480,7 @@ namespace WindBot.Game.AI.Decks ...@@ -479,6 +480,7 @@ namespace WindBot.Game.AI.Decks
private bool AquamancerOfTheSanctuarySearchEffect() private bool AquamancerOfTheSanctuarySearchEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Card.Location == CardLocation.Grave) if (Card.Location == CardLocation.Grave)
{ {
AI.SelectCard(CardLocation.Deck); AI.SelectCard(CardLocation.Deck);
...@@ -626,6 +628,7 @@ namespace WindBot.Game.AI.Decks ...@@ -626,6 +628,7 @@ namespace WindBot.Game.AI.Decks
private bool JetSynchronEffect() private bool JetSynchronEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
int[] materials = new[] { int[] materials = new[] {
CardId.MechaPhantomBeastToken CardId.MechaPhantomBeastToken
}; };
...@@ -786,6 +789,7 @@ namespace WindBot.Game.AI.Decks ...@@ -786,6 +789,7 @@ namespace WindBot.Game.AI.Decks
private bool PredaplantVerteAnacondaEffect() private bool PredaplantVerteAnacondaEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (ActivateDescription == Util.GetStringId(CardId.PredaplantVerteAnaconda, 0)) if (ActivateDescription == Util.GetStringId(CardId.PredaplantVerteAnaconda, 0))
return false; return false;
FusionDestinyUsed = true; FusionDestinyUsed = true;
...@@ -858,6 +862,7 @@ namespace WindBot.Game.AI.Decks ...@@ -858,6 +862,7 @@ namespace WindBot.Game.AI.Decks
private bool DestinyHeroCelestialEffect() private bool DestinyHeroCelestialEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (!Bot.HasInGraveyard(CardId.DestinyHeroDasher)) if (!Bot.HasInGraveyard(CardId.DestinyHeroDasher))
return false; return false;
AI.SelectCard(CardId.DestinyHeroDasher); AI.SelectCard(CardId.DestinyHeroDasher);
...@@ -971,6 +976,7 @@ namespace WindBot.Game.AI.Decks ...@@ -971,6 +976,7 @@ namespace WindBot.Game.AI.Decks
private bool VirtualWorldKyubiShenshenEffect() private bool VirtualWorldKyubiShenshenEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Card.Location == CardLocation.MonsterZone && Bot.HasInBanished(CardId.AquamancerOfTheSanctuary)) if (Card.Location == CardLocation.MonsterZone && Bot.HasInBanished(CardId.AquamancerOfTheSanctuary))
{ {
AI.SelectCard(CardId.AquamancerOfTheSanctuary); AI.SelectCard(CardId.AquamancerOfTheSanctuary);
......
...@@ -265,6 +265,7 @@ namespace WindBot.Game.AI.Decks ...@@ -265,6 +265,7 @@ namespace WindBot.Game.AI.Decks
prevent_used = false; prevent_used = false;
Linkuribohused = true; Linkuribohused = true;
Timelord_check = false; Timelord_check = false;
base.OnNewTurn();
} }
public override void OnNewPhase() public override void OnNewPhase()
{ {
......
...@@ -316,6 +316,7 @@ namespace WindBot.Game.AI.Decks ...@@ -316,6 +316,7 @@ namespace WindBot.Game.AI.Decks
big_attack = false; big_attack = false;
big_attack_used = false; big_attack_used = false;
soul_used = false; soul_used = false;
base.OnNewTurn();
} }
public int GetTotalATK(IList<ClientCard> list) public int GetTotalATK(IList<ClientCard> list)
{ {
...@@ -496,11 +497,13 @@ namespace WindBot.Game.AI.Decks ...@@ -496,11 +497,13 @@ namespace WindBot.Game.AI.Decks
{ {
if (Bot.LifePoints > 1500 && Duel.LastChainPlayer == 1) if (Bot.LifePoints > 1500 && Duel.LastChainPlayer == 1)
return true; return true;
if (DefaultOnlyHorusSpSummoning()) return false;
return false; return false;
} }
private bool ChainEnemy() private bool ChainEnemy()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Util.GetLastChainCard() != null && if (Util.GetLastChainCard() != null &&
Util.GetLastChainCard().IsCode(CardId.UpstartGoblin)) Util.GetLastChainCard().IsCode(CardId.UpstartGoblin))
return false; return false;
...@@ -519,6 +522,7 @@ namespace WindBot.Game.AI.Decks ...@@ -519,6 +522,7 @@ namespace WindBot.Game.AI.Decks
private bool MaxxCeff() private bool MaxxCeff()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
return Duel.Player == 1; return Duel.Player == 1;
} }
/* /*
...@@ -1417,6 +1421,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1417,6 +1421,7 @@ namespace WindBot.Game.AI.Decks
} }
else else
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Bot.HasInMonstersZone(CardId.VentriloauistsClaraAndLucika)) if (Bot.HasInMonstersZone(CardId.VentriloauistsClaraAndLucika))
{ {
AI.SelectCard(CardId.VentriloauistsClaraAndLucika); AI.SelectCard(CardId.VentriloauistsClaraAndLucika);
......
This diff is collapsed.
...@@ -123,6 +123,7 @@ namespace WindBot.Game.AI.Decks ...@@ -123,6 +123,7 @@ namespace WindBot.Game.AI.Decks
{ {
BeastOLionUsed = false; BeastOLionUsed = false;
RedEyesFusionUsed = false; RedEyesFusionUsed = false;
base.OnNewTurn();
} }
public override CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions) public override CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions)
...@@ -198,6 +199,7 @@ namespace WindBot.Game.AI.Decks ...@@ -198,6 +199,7 @@ namespace WindBot.Game.AI.Decks
private bool TourGuideFromTheUnderworldSummon() private bool TourGuideFromTheUnderworldSummon()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Bot.GetRemainingCount(CardId.TourGuideFromTheUnderworld, 2) == 0 && Bot.GetRemainingCount(CardId.Sangan, 2) == 0) if (Bot.GetRemainingCount(CardId.TourGuideFromTheUnderworld, 2) == 0 && Bot.GetRemainingCount(CardId.Sangan, 2) == 0)
return false; return false;
return true; return true;
...@@ -307,6 +309,7 @@ namespace WindBot.Game.AI.Decks ...@@ -307,6 +309,7 @@ namespace WindBot.Game.AI.Decks
private bool MagiciansSoulsEffect() private bool MagiciansSoulsEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Card.Location == CardLocation.Hand) if (Card.Location == CardLocation.Hand)
{ {
if (RedEyesFusionUsed) if (RedEyesFusionUsed)
...@@ -375,6 +378,7 @@ namespace WindBot.Game.AI.Decks ...@@ -375,6 +378,7 @@ namespace WindBot.Game.AI.Decks
private bool PredaplantVerteAnacondaEffect() private bool PredaplantVerteAnacondaEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (ActivateDescription == Util.GetStringId(CardId.PredaplantVerteAnaconda, 0)) if (ActivateDescription == Util.GetStringId(CardId.PredaplantVerteAnaconda, 0))
return false; return false;
AI.SelectCard(CardId.RedEyesFusion); AI.SelectCard(CardId.RedEyesFusion);
......
...@@ -456,6 +456,7 @@ namespace WindBot.Game.AI.Decks ...@@ -456,6 +456,7 @@ namespace WindBot.Game.AI.Decks
private bool AssaultBeast() private bool AssaultBeast()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (!Bot.HasInSpellZone(CardId.AssaultModeActivate)) if (!Bot.HasInSpellZone(CardId.AssaultModeActivate))
return true; return true;
return false; return false;
......
This diff is collapsed.
...@@ -135,6 +135,7 @@ namespace WindBot.Game.AI.Decks ...@@ -135,6 +135,7 @@ namespace WindBot.Game.AI.Decks
private bool Ronintoadin() private bool Ronintoadin()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
List<ClientCard> monsters = Bot.GetGraveyardMonsters(); List<ClientCard> monsters = Bot.GetGraveyardMonsters();
if (monsters.Count > 2) if (monsters.Count > 2)
{ {
......
...@@ -128,6 +128,7 @@ namespace WindBot.Game.AI.Decks ...@@ -128,6 +128,7 @@ namespace WindBot.Game.AI.Decks
{ {
eater_eff = false; eater_eff = false;
CardOfDemiseeff_used = false; CardOfDemiseeff_used = false;
base.OnNewTurn();
} }
public override void OnNewPhase() public override void OnNewPhase()
...@@ -437,6 +438,7 @@ namespace WindBot.Game.AI.Decks ...@@ -437,6 +438,7 @@ namespace WindBot.Game.AI.Decks
private bool ThunderKingRaiOheff() private bool ThunderKingRaiOheff()
{ {
if (DefaultOnlyHorusSpSummoning()) return false;
if(Duel.SummoningCards.Count > 0) if(Duel.SummoningCards.Count > 0)
{ {
foreach(ClientCard m in Duel.SummoningCards) foreach(ClientCard m in Duel.SummoningCards)
...@@ -547,7 +549,7 @@ namespace WindBot.Game.AI.Decks ...@@ -547,7 +549,7 @@ namespace WindBot.Game.AI.Decks
{ {
targets.Add(s_c); targets.Add(s_c);
if (targets.Count >= 5) if (targets.Count >= 5)
{ {
AI.SelectMaterials(targets, HintMsg.Remove); AI.SelectMaterials(targets, HintMsg.Remove);
return true; return true;
} }
...@@ -570,6 +572,7 @@ namespace WindBot.Game.AI.Decks ...@@ -570,6 +572,7 @@ namespace WindBot.Game.AI.Decks
private bool MetalSnakesp() private bool MetalSnakesp()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (ActivateDescription == Util.GetStringId(CardId.MetalSnake, 0) && !Bot.HasInMonstersZone(CardId.MetalSnake)) if (ActivateDescription == Util.GetStringId(CardId.MetalSnake, 0) && !Bot.HasInMonstersZone(CardId.MetalSnake))
{ {
if(Duel.Player == 1 && Duel.Phase >= DuelPhase.BattleStart ) if(Duel.Player == 1 && Duel.Phase >= DuelPhase.BattleStart )
......
...@@ -175,6 +175,7 @@ namespace WindBot.Game.AI.Decks ...@@ -175,6 +175,7 @@ namespace WindBot.Game.AI.Decks
opt_2 = false; opt_2 = false;
if (flag >= 0) ++flag; if (flag >= 0) ++flag;
if (flag >= 2) { flag = -1; activate_DimensionShifter = false; } if (flag >= 2) { flag = -1; activate_DimensionShifter = false; }
base.OnNewTurn();
} }
public override bool OnSelectYesNo(int desc) public override bool OnSelectYesNo(int desc)
{ {
......
This diff is collapsed.
...@@ -217,11 +217,12 @@ namespace WindBot.Game.AI.Decks ...@@ -217,11 +217,12 @@ namespace WindBot.Game.AI.Decks
JetSynchronUsed = false; JetSynchronUsed = false;
ScrapWyvernUsed = false; ScrapWyvernUsed = false;
MaskedChameleonUsed = false; MaskedChameleonUsed = false;
base.OnNewTurn();
} }
public override void OnChainEnd() public override void OnChainEnd()
{ {
base.OnChainEnd();
} }
public override CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions) public override CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions)
......
...@@ -274,6 +274,7 @@ namespace WindBot.Game.AI.Decks ...@@ -274,6 +274,7 @@ namespace WindBot.Game.AI.Decks
ShaddollSquamata_used = false; ShaddollSquamata_used = false;
ShaddollDragon_used = false; ShaddollDragon_used = false;
ShaddollHedgehog_used = false; ShaddollHedgehog_used = false;
base.OnNewTurn();
} }
private bool Luminasummon() private bool Luminasummon()
...@@ -290,6 +291,7 @@ namespace WindBot.Game.AI.Decks ...@@ -290,6 +291,7 @@ namespace WindBot.Game.AI.Decks
} }
private bool Luminaeff() private bool Luminaeff()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Bot.HasInGraveyard(CardId.Raiden)) if (Bot.HasInGraveyard(CardId.Raiden))
{ {
AI.SelectCard(Useless_List()); AI.SelectCard(Useless_List());
...@@ -555,6 +557,7 @@ namespace WindBot.Game.AI.Decks ...@@ -555,6 +557,7 @@ namespace WindBot.Game.AI.Decks
private bool GlowUpBulbeff() private bool GlowUpBulbeff()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
IList<ClientCard> check = Bot.GetMonstersInExtraZone(); IList<ClientCard> check = Bot.GetMonstersInExtraZone();
foreach (ClientCard monster in check) foreach (ClientCard monster in check)
if (monster.HasType(CardType.Fusion)) return false; if (monster.HasType(CardType.Fusion)) return false;
...@@ -627,6 +630,7 @@ namespace WindBot.Game.AI.Decks ...@@ -627,6 +630,7 @@ namespace WindBot.Game.AI.Decks
private bool MaxxC() private bool MaxxC()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
return Duel.Player == 1; return Duel.Player == 1;
} }
...@@ -977,6 +981,7 @@ namespace WindBot.Game.AI.Decks ...@@ -977,6 +981,7 @@ namespace WindBot.Game.AI.Decks
public bool Hand_act_eff() public bool Hand_act_eff()
{ {
//if (Card.IsCode(CardId.Urara) && Bot.HasInHand(CardId.LockBird) && Bot.HasInSpellZone(CardId.Re)) return false; //if (Card.IsCode(CardId.Urara) && Bot.HasInHand(CardId.LockBird) && Bot.HasInSpellZone(CardId.Re)) return false;
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Card.IsCode(CardId.GhostOgre) && Card.Location == CardLocation.Hand && Bot.HasInMonstersZone(CardId.GhostOgre)) return false; if (Card.IsCode(CardId.GhostOgre) && Card.Location == CardLocation.Hand && Bot.HasInMonstersZone(CardId.GhostOgre)) return false;
return (Duel.LastChainPlayer == 1); return (Duel.LastChainPlayer == 1);
} }
...@@ -998,6 +1003,7 @@ namespace WindBot.Game.AI.Decks ...@@ -998,6 +1003,7 @@ namespace WindBot.Game.AI.Decks
if (Card.Location == CardLocation.Grave) if (Card.Location == CardLocation.Grave)
return true; return true;
if (Bot.LifePoints <= 1000) return false; if (Bot.LifePoints <= 1000) return false;
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
ClientCard select = Util.GetBestEnemyCard(); ClientCard select = Util.GetBestEnemyCard();
if (select == null) return false; if (select == null) return false;
if(select!=null) if(select!=null)
......
...@@ -219,11 +219,13 @@ namespace WindBot.Game.AI.Decks ...@@ -219,11 +219,13 @@ namespace WindBot.Game.AI.Decks
private bool ImFeelingLucky() private bool ImFeelingLucky()
{ {
if (Type == ExecutorType.Activate && DefaultCheckWhetherCardIsNegated(Card)) return false;
return Program.Rand.Next(10) >= 5 && DefaultDontChainMyself(); return Program.Rand.Next(10) >= 5 && DefaultDontChainMyself();
} }
private bool ImFeelingUnlucky() private bool ImFeelingUnlucky()
{ {
if (Type == ExecutorType.Activate && DefaultCheckWhetherCardIsNegated(Card)) return false;
return DefaultDontChainMyself(); return DefaultDontChainMyself();
} }
......
...@@ -214,11 +214,13 @@ namespace WindBot.Game.AI.Decks ...@@ -214,11 +214,13 @@ namespace WindBot.Game.AI.Decks
CymbalSkeletonUsed = false; CymbalSkeletonUsed = false;
BorrelswordDragonUsed = false; BorrelswordDragonUsed = false;
RustyBardicheTarget = null; RustyBardicheTarget = null;
base.OnNewTurn();
} }
public override void OnChainEnd() public override void OnChainEnd()
{ {
RustyBardicheTarget = null; RustyBardicheTarget = null;
base.OnChainEnd();
} }
public override CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions) public override CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions)
...@@ -465,6 +467,7 @@ namespace WindBot.Game.AI.Decks ...@@ -465,6 +467,7 @@ namespace WindBot.Game.AI.Decks
private bool JetSynchronEffect() private bool JetSynchronEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
AI.SelectCard(HandCosts); AI.SelectCard(HandCosts);
return true; return true;
} }
...@@ -488,6 +491,7 @@ namespace WindBot.Game.AI.Decks ...@@ -488,6 +491,7 @@ namespace WindBot.Game.AI.Decks
private bool DestrudoSummon() private bool DestrudoSummon()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
return Bot.GetMonsterCount() < 3 && Bot.HasInExtra(new[] { CardId.CrystronNeedlefiber, CardId.KnightmarePhoenix }); return Bot.GetMonsterCount() < 3 && Bot.HasInExtra(new[] { CardId.CrystronNeedlefiber, CardId.KnightmarePhoenix });
} }
...@@ -659,6 +663,7 @@ namespace WindBot.Game.AI.Decks ...@@ -659,6 +663,7 @@ namespace WindBot.Game.AI.Decks
private bool KnightmarePhoenixEffect() private bool KnightmarePhoenixEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
int costcount = Bot.Hand.GetMatchingCardsCount(card => card.IsCode(HandCosts)); int costcount = Bot.Hand.GetMatchingCardsCount(card => card.IsCode(HandCosts));
ClientCard target = Enemy.SpellZone.GetFloodgate(); ClientCard target = Enemy.SpellZone.GetFloodgate();
ClientCard anytarget = Enemy.SpellZone.GetFirstMatchingCard(card => !card.OwnTargets.Any(cont => cont.IsCode(CardId.TrickstarLightStage))); ClientCard anytarget = Enemy.SpellZone.GetFirstMatchingCard(card => !card.OwnTargets.Any(cont => cont.IsCode(CardId.TrickstarLightStage)));
...@@ -685,6 +690,7 @@ namespace WindBot.Game.AI.Decks ...@@ -685,6 +690,7 @@ namespace WindBot.Game.AI.Decks
private bool KnightmareMermaidEffect() private bool KnightmareMermaidEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
AI.SelectCard(HandCosts); AI.SelectCard(HandCosts);
return true; return true;
} }
...@@ -703,6 +709,7 @@ namespace WindBot.Game.AI.Decks ...@@ -703,6 +709,7 @@ namespace WindBot.Game.AI.Decks
private bool OrcustKnightmareEffect() private bool OrcustKnightmareEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (!Bot.HasInGraveyard(CardId.OrcustHarpHorror)) if (!Bot.HasInGraveyard(CardId.OrcustHarpHorror))
{ {
AI.SelectCard(Util.GetBestBotMonster()); AI.SelectCard(Util.GetBestBotMonster());
...@@ -726,6 +733,7 @@ namespace WindBot.Game.AI.Decks ...@@ -726,6 +733,7 @@ namespace WindBot.Game.AI.Decks
private bool HarpHorrorEffect() private bool HarpHorrorEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
HarpHorrorUsed = true; HarpHorrorUsed = true;
AI.SelectCard(CardId.OrcustCymbalSkeleton); AI.SelectCard(CardId.OrcustCymbalSkeleton);
return true; return true;
...@@ -733,6 +741,7 @@ namespace WindBot.Game.AI.Decks ...@@ -733,6 +741,7 @@ namespace WindBot.Game.AI.Decks
private bool WorldWandEffect() private bool WorldWandEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
AI.SelectCard(CardId.OrcustCymbalSkeleton); AI.SelectCard(CardId.OrcustCymbalSkeleton);
return true; return true;
} }
...@@ -783,6 +792,7 @@ namespace WindBot.Game.AI.Decks ...@@ -783,6 +792,7 @@ namespace WindBot.Game.AI.Decks
private bool CymbalSkeletonEffect() private bool CymbalSkeletonEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
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) && Bot.HasInExtra(CardId.SheorcustDingirsu) && !SheorcustDingirsuSummoned) if (Duel.Player == 0 && Bot.HasInGraveyard(CardId.GalateaTheOrcustAutomaton) && !Bot.HasInMonstersZone(CardId.GalateaTheOrcustAutomaton) && Bot.HasInExtra(CardId.SheorcustDingirsu) && !SheorcustDingirsuSummoned)
...@@ -867,6 +877,7 @@ namespace WindBot.Game.AI.Decks ...@@ -867,6 +877,7 @@ namespace WindBot.Game.AI.Decks
private bool AncientCloakEffect() private bool AncientCloakEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Bot.HasInMonstersZone(CardId.SalamangreatAlmiraj) && Bot.HasInExtra(CardId.KnightmarePhoenix)) if (Bot.HasInMonstersZone(CardId.SalamangreatAlmiraj) && Bot.HasInExtra(CardId.KnightmarePhoenix))
AI.SelectCard(CardId.ThePhantomKnightsofShadeBrigandine); AI.SelectCard(CardId.ThePhantomKnightsofShadeBrigandine);
else else
...@@ -881,6 +892,7 @@ namespace WindBot.Game.AI.Decks ...@@ -881,6 +892,7 @@ namespace WindBot.Game.AI.Decks
private bool SilentBootsEffect() private bool SilentBootsEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Bot.HasInMonstersZone(CardId.SalamangreatAlmiraj) && Bot.HasInExtra(CardId.KnightmarePhoenix)) if (Bot.HasInMonstersZone(CardId.SalamangreatAlmiraj) && Bot.HasInExtra(CardId.KnightmarePhoenix))
AI.SelectCard(CardId.ThePhantomKnightsofShadeBrigandine); AI.SelectCard(CardId.ThePhantomKnightsofShadeBrigandine);
else else
...@@ -1033,6 +1045,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1033,6 +1045,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (Card.Location == CardLocation.Grave) if (Card.Location == CardLocation.Grave)
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
IList<ClientCard> costCards = Bot.Hand.GetMatchingCards(card => card.IsCode(HandCosts)); IList<ClientCard> costCards = Bot.Hand.GetMatchingCards(card => card.IsCode(HandCosts));
if (costCards.Count > 0) if (costCards.Count > 0)
{ {
...@@ -1113,6 +1126,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1113,6 +1126,7 @@ namespace WindBot.Game.AI.Decks
} }
else if (Bot.HasInGraveyard(CardId.ThePhantomKnightsofRustyBardiche) || Bot.GetMonsterCount() < 2) else if (Bot.HasInGraveyard(CardId.ThePhantomKnightsofRustyBardiche) || Bot.GetMonsterCount() < 2)
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
AI.SelectCard(CardId.ThePhantomKnightsofRustyBardiche); AI.SelectCard(CardId.ThePhantomKnightsofRustyBardiche);
return true; return true;
} }
......
...@@ -555,6 +555,7 @@ namespace WindBot.Game.AI.Decks ...@@ -555,6 +555,7 @@ namespace WindBot.Game.AI.Decks
} }
private bool SpeedroidTaketomborgeff() private bool SpeedroidTaketomborgeff()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if ((Bot.GetRemainingCount(CardId.SpeedroidRedEyedDice, 1) >= 1) && if ((Bot.GetRemainingCount(CardId.SpeedroidRedEyedDice, 1) >= 1) &&
Bot.HasInMonstersZone(CardId.SpeedroidTerrortop)) Bot.HasInMonstersZone(CardId.SpeedroidTerrortop))
{ {
......
...@@ -130,6 +130,7 @@ namespace WindBot.Game.AI.Decks ...@@ -130,6 +130,7 @@ namespace WindBot.Game.AI.Decks
public override void OnNewTurn() public override void OnNewTurn()
{ {
CardOfDemiseUsed = false; CardOfDemiseUsed = false;
base.OnNewTurn();
} }
public override IList<ClientCard> OnSelectPendulumSummon(IList<ClientCard> cards, int max) public override IList<ClientCard> OnSelectPendulumSummon(IList<ClientCard> cards, int max)
...@@ -281,6 +282,7 @@ namespace WindBot.Game.AI.Decks ...@@ -281,6 +282,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (Card.Location == CardLocation.Hand) if (Card.Location == CardLocation.Hand)
return false; return false;
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
int count = 0; int count = 0;
int handcount = 0; int handcount = 0;
int fieldcount = 0; int fieldcount = 0;
......
...@@ -142,6 +142,7 @@ namespace WindBot.Game.AI.Decks ...@@ -142,6 +142,7 @@ namespace WindBot.Game.AI.Decks
public override void OnNewTurn() public override void OnNewTurn()
{ {
NormalSummoned = false; NormalSummoned = false;
base.OnNewTurn();
} }
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender) public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
...@@ -210,6 +211,7 @@ namespace WindBot.Game.AI.Decks ...@@ -210,6 +211,7 @@ namespace WindBot.Game.AI.Decks
private bool RescueRabbitSummon() private bool RescueRabbitSummon()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
return Util.GetBotAvailZonesFromExtraDeck() > 0 return Util.GetBotAvailZonesFromExtraDeck() > 0
|| !Enemy.MonsterZone.IsExistingMatchingCard(card => card.GetDefensePower() >= 1900) || !Enemy.MonsterZone.IsExistingMatchingCard(card => card.GetDefensePower() >= 1900)
|| Enemy.MonsterZone.GetMatchingCardsCount(card => card.GetDefensePower() < 1900) > Bot.MonsterZone.GetMatchingCardsCount(card => card.Attack >= 1900); || Enemy.MonsterZone.GetMatchingCardsCount(card => card.GetDefensePower() < 1900) > Bot.MonsterZone.GetMatchingCardsCount(card => card.Attack >= 1900);
......
...@@ -116,6 +116,7 @@ namespace WindBot.Game.AI.Decks ...@@ -116,6 +116,7 @@ namespace WindBot.Game.AI.Decks
DoubleSummonUsed = false; DoubleSummonUsed = false;
CyberDragonInfinitySummoned = false; CyberDragonInfinitySummoned = false;
Number61VolcasaurusUsed = false; Number61VolcasaurusUsed = false;
base.OnNewTurn();
} }
public override IList<ClientCard> OnSelectXyzMaterial(IList<ClientCard> cards, int min, int max) public override IList<ClientCard> OnSelectXyzMaterial(IList<ClientCard> cards, int min, int max)
......
...@@ -153,6 +153,7 @@ namespace WindBot.Game.AI.Decks ...@@ -153,6 +153,7 @@ namespace WindBot.Game.AI.Decks
{ {
// reset // reset
BalancerLordUsed = false; BalancerLordUsed = false;
base.OnNewTurn();
} }
public override int OnSelectOption(IList<int> options) public override int OnSelectOption(IList<int> options)
......
...@@ -594,6 +594,7 @@ namespace WindBot.Game.AI.Decks ...@@ -594,6 +594,7 @@ namespace WindBot.Game.AI.Decks
} }
else else
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Bot.HasInHand(CardId.Spinny) || FalcoToGY(false)) if (Bot.HasInHand(CardId.Spinny) || FalcoToGY(false))
{ {
if (Bot.HasInHand(CardId.Spinny) && !Bot.HasInGraveyard(CardId.Spinny)) if (Bot.HasInHand(CardId.Spinny) && !Bot.HasInGraveyard(CardId.Spinny))
...@@ -779,10 +780,12 @@ namespace WindBot.Game.AI.Decks ...@@ -779,10 +780,12 @@ namespace WindBot.Game.AI.Decks
public bool G_activate() public bool G_activate()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
return (Duel.Player == 1); return (Duel.Player == 1);
} }
public bool Hand_act_eff() public bool Hand_act_eff()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
return (Duel.LastChainPlayer == 1); return (Duel.LastChainPlayer == 1);
} }
......
...@@ -146,6 +146,7 @@ namespace WindBot.Game.AI.Decks ...@@ -146,6 +146,7 @@ namespace WindBot.Game.AI.Decks
ShizukuSummoned = false; ShizukuSummoned = false;
HayateSummoned = false; HayateSummoned = false;
WidowAnchorTarget = null; WidowAnchorTarget = null;
base.OnNewTurn();
} }
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender) public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
...@@ -194,6 +195,7 @@ namespace WindBot.Game.AI.Decks ...@@ -194,6 +195,7 @@ namespace WindBot.Game.AI.Decks
private bool MaxxCEffect() private bool MaxxCEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
return Duel.Player == 1; return Duel.Player == 1;
} }
...@@ -667,6 +669,7 @@ namespace WindBot.Game.AI.Decks ...@@ -667,6 +669,7 @@ namespace WindBot.Game.AI.Decks
private bool JetSynchronEffect() private bool JetSynchronEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Bot.HasInMonstersZone(CardId.Raye) || Bot.HasInMonstersZone(CardId.CrystronNeedlefiber)) if (Bot.HasInMonstersZone(CardId.Raye) || Bot.HasInMonstersZone(CardId.CrystronNeedlefiber))
{ {
AI.SelectCard(GetDiscardHand()); AI.SelectCard(GetDiscardHand());
......
This diff is collapsed.
This diff is collapsed.
...@@ -182,8 +182,8 @@ namespace WindBot.Game.AI.Decks ...@@ -182,8 +182,8 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, CardId.BaronnedeFleur, BaronnedeFleurEffect); AddExecutor(ExecutorType.Activate, CardId.BaronnedeFleur, BaronnedeFleurEffect);
AddExecutor(ExecutorType.Activate, CardId.ElderEntityNtss, ElderEntityNtssEffect); AddExecutor(ExecutorType.Activate, CardId.ElderEntityNtss, ElderEntityNtssEffect);
AddExecutor(ExecutorType.Activate, CardId.PredaplantDragostapelia, PredaplantDragostapeliaEffect); AddExecutor(ExecutorType.Activate, CardId.PredaplantDragostapelia, PredaplantDragostapeliaEffect);
AddExecutor(ExecutorType.Activate, CardId.HeraldofOrangeLight); AddExecutor(ExecutorType.Activate, CardId.HeraldofOrangeLight, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.HeraldofGreenLight); AddExecutor(ExecutorType.Activate, CardId.HeraldofGreenLight, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.TearlamentsRulkallos, TearlamentsRulkallosEffect); AddExecutor(ExecutorType.Activate, CardId.TearlamentsRulkallos, TearlamentsRulkallosEffect);
AddExecutor(ExecutorType.Activate, CardId.FADawnDragster); AddExecutor(ExecutorType.Activate, CardId.FADawnDragster);
AddExecutor(ExecutorType.Activate, CardId.PrimevalPlanetPerlereino, PrimevalPlanetPerlereinoEffect); AddExecutor(ExecutorType.Activate, CardId.PrimevalPlanetPerlereino, PrimevalPlanetPerlereinoEffect);
...@@ -275,6 +275,7 @@ namespace WindBot.Game.AI.Decks ...@@ -275,6 +275,7 @@ namespace WindBot.Game.AI.Decks
spsummoned = false; spsummoned = false;
summon_SprightElf = false; summon_SprightElf = false;
TearlamentsKitkallos_summoned = false; TearlamentsKitkallos_summoned = false;
base.OnNewTurn();
} }
private List<ClientCard> GetZoneCards(CardLocation loc, ClientField player) private List<ClientCard> GetZoneCards(CardLocation loc, ClientField player)
{ {
...@@ -1704,7 +1705,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1704,7 +1705,7 @@ namespace WindBot.Game.AI.Decks
if (Duel.Turn == 1 || Enemy.GetMonsterCount() <= 0) return false; if (Duel.Turn == 1 || Enemy.GetMonsterCount() <= 0) return false;
List<ClientCard> e_cards = Enemy.GetMonsters().Where(card => card != null && card.IsFaceup() && card.IsAttack()).ToList(); List<ClientCard> e_cards = Enemy.GetMonsters().Where(card => card != null && card.IsFaceup() && card.IsAttack()).ToList();
List<ClientCard> b_cards = Bot.GetMonsters().Where(card => card != null && card.IsFaceup() && card.IsAttack()).ToList(); List<ClientCard> b_cards = Bot.GetMonsters().Where(card => card != null && card.IsFaceup() && card.IsAttack()).ToList();
if ((e_cards.Count <= 0 || b_cards.Count <= 0) && Enemy.MonsterZone.GetDangerousMonster() == null) return false; if (e_cards.Count <= 0 || b_cards.Count <= 0 || Enemy.MonsterZone.GetDangerousMonster() == null) return false;
e_cards.Sort(CardContainer.CompareCardAttack); e_cards.Sort(CardContainer.CompareCardAttack);
e_cards.Reverse(); e_cards.Reverse();
b_cards.Sort(CardContainer.CompareCardAttack); b_cards.Sort(CardContainer.CompareCardAttack);
...@@ -2172,6 +2173,7 @@ namespace WindBot.Game.AI.Decks ...@@ -2172,6 +2173,7 @@ namespace WindBot.Game.AI.Decks
} }
private bool EvaEffect() private bool EvaEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
List<ClientCard> cards = Bot.GetGraveyardMonsters().Where(card => card != null && card.HasAttribute(CardAttribute.Light) && card.HasRace(CardRace.Fairy) && card != Card).ToList(); List<ClientCard> cards = Bot.GetGraveyardMonsters().Where(card => card != null && card.HasAttribute(CardAttribute.Light) && card.HasRace(CardRace.Fairy) && card != Card).ToList();
if (cards.Count <= 0) return false; if (cards.Count <= 0) return false;
activate_Eva = true; activate_Eva = true;
...@@ -2207,6 +2209,7 @@ namespace WindBot.Game.AI.Decks ...@@ -2207,6 +2209,7 @@ namespace WindBot.Game.AI.Decks
} }
private bool MudoratheSwordOracleEffect() private bool MudoratheSwordOracleEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Card.Location == CardLocation.Hand) if (Card.Location == CardLocation.Hand)
{ {
if ((Bot.Hand.Count(card => card != null && card.Id == CardId.AgidotheAncientSentinel) <= 0 || activate_AgidotheAncientSentinel_2) if ((Bot.Hand.Count(card => card != null && card.Id == CardId.AgidotheAncientSentinel) <= 0 || activate_AgidotheAncientSentinel_2)
......
...@@ -278,6 +278,8 @@ namespace WindBot.Game.AI.Decks ...@@ -278,6 +278,8 @@ namespace WindBot.Game.AI.Decks
for (int i = 0; i < selectAtt.Count; i++) for (int i = 0; i < selectAtt.Count; i++)
selectAtt[i] = false; selectAtt[i] = false;
base.OnNewTurn();
} }
private bool IsAvailableZone(int seq) private bool IsAvailableZone(int seq)
{ {
...@@ -889,6 +891,7 @@ namespace WindBot.Game.AI.Decks ...@@ -889,6 +891,7 @@ namespace WindBot.Game.AI.Decks
} }
private bool AshBlossomEffect() private bool AshBlossomEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
return Duel.CurrentChain.Count > 0 && Duel.LastChainPlayer != 0; return Duel.CurrentChain.Count > 0 && Duel.LastChainPlayer != 0;
} }
public int CompareCardLink(ClientCard cardA, ClientCard cardB) public int CompareCardLink(ClientCard cardA, ClientCard cardB)
...@@ -1053,6 +1056,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1053,6 +1056,7 @@ namespace WindBot.Game.AI.Decks
} }
private bool GEffect() private bool GEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
return Duel.Player != 0; return Duel.Player != 0;
} }
private bool ThunderDragonColossusSummon_2() private bool ThunderDragonColossusSummon_2()
...@@ -1101,6 +1105,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1101,6 +1105,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (ActivateDescription == Util.GetStringId(CardId.PredaplantVerteAnaconda, 1)) if (ActivateDescription == Util.GetStringId(CardId.PredaplantVerteAnaconda, 1))
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (CheckRemainInDeck(CardId.ThunderDragonFusion) <= 0) return false; if (CheckRemainInDeck(CardId.ThunderDragonFusion) <= 0) return false;
if (Bot.GetMonstersInMainZone().Count > 4 && Bot.GetMonstersInMainZone().Count(card => card != null && !card.IsExtraCard() && card.HasSetcode(0x11c) && card.HasType(CardType.Monster) && card.IsFaceup()) <= 0) return false; if (Bot.GetMonstersInMainZone().Count > 4 && Bot.GetMonstersInMainZone().Count(card => card != null && !card.IsExtraCard() && card.HasSetcode(0x11c) && card.HasType(CardType.Monster) && card.IsFaceup()) <= 0) return false;
List<ClientCard> g_card = Bot.Graveyard.ToList(); List<ClientCard> g_card = Bot.Graveyard.ToList();
...@@ -1148,6 +1153,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1148,6 +1153,7 @@ namespace WindBot.Game.AI.Decks
} }
private bool KnightmareUnicornEffect() private bool KnightmareUnicornEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
List<ClientCard> cards = new List<ClientCard>(); List<ClientCard> cards = new List<ClientCard>();
cards.AddRange(Enemy.SpellZone); cards.AddRange(Enemy.SpellZone);
cards.AddRange(Enemy.MonsterZone); cards.AddRange(Enemy.MonsterZone);
...@@ -1598,6 +1604,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1598,6 +1604,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (Card.Location == CardLocation.Hand) if (Card.Location == CardLocation.Hand)
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
List<ClientCard> banish_cards = new List<ClientCard>(); List<ClientCard> banish_cards = new List<ClientCard>();
List<ClientCard> grave_cards = new List<ClientCard>(); List<ClientCard> grave_cards = new List<ClientCard>();
foreach (var card in Bot.Banished) foreach (var card in Bot.Banished)
...@@ -1792,6 +1799,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1792,6 +1799,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (Card.Location == CardLocation.Hand) if (Card.Location == CardLocation.Hand)
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (handActivated) return false; if (handActivated) return false;
handActivated = true; handActivated = true;
activate_ThunderDragonroar = true; activate_ThunderDragonroar = true;
...@@ -2035,6 +2043,7 @@ namespace WindBot.Game.AI.Decks ...@@ -2035,6 +2043,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (Card.Location == CardLocation.Hand) if (Card.Location == CardLocation.Hand)
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Duel.Player == 0) if (Duel.Player == 0)
{ {
if (IsShouldChainTunder()) if (IsShouldChainTunder())
...@@ -2243,6 +2252,7 @@ namespace WindBot.Game.AI.Decks ...@@ -2243,6 +2252,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (Card.Location == CardLocation.Hand) if (Card.Location == CardLocation.Hand)
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (HasInZoneNoActivate(CardId.BystialMagnamhut,CardLocation.Deck) && !Bot.HasInHand(CardId.BystialMagnamhut)) if (HasInZoneNoActivate(CardId.BystialMagnamhut,CardLocation.Deck) && !Bot.HasInHand(CardId.BystialMagnamhut))
AI.SelectCard(CardId.BystialMagnamhut); AI.SelectCard(CardId.BystialMagnamhut);
else if(HasInZoneNoActivate(CardId.BystialDruiswurm, CardLocation.Deck) && !Bot.HasInHand(CardId.BystialDruiswurm)) else if(HasInZoneNoActivate(CardId.BystialDruiswurm, CardLocation.Deck) && !Bot.HasInHand(CardId.BystialDruiswurm))
...@@ -2420,6 +2430,7 @@ namespace WindBot.Game.AI.Decks ...@@ -2420,6 +2430,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (Card.Location == CardLocation.Hand) if (Card.Location == CardLocation.Hand)
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Duel.Player == 0) if (Duel.Player == 0)
{ {
if (IsShouldChainTunder()) if (IsShouldChainTunder())
...@@ -2498,6 +2509,7 @@ namespace WindBot.Game.AI.Decks ...@@ -2498,6 +2509,7 @@ namespace WindBot.Game.AI.Decks
} }
private bool NormalThunderDragonEffect() private bool NormalThunderDragonEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
handActivated = true; handActivated = true;
ResetFlag(); ResetFlag();
selectFlag[(int)Select.NormalThunderDragon] = true; selectFlag[(int)Select.NormalThunderDragon] = true;
......
...@@ -192,6 +192,7 @@ namespace WindBot.Game.AI.Decks ...@@ -192,6 +192,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (Card.Location == CardLocation.MonsterZone) if (Card.Location == CardLocation.MonsterZone)
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
AI.SelectCard(Monsters.TimeThiefCronocorder); AI.SelectCard(Monsters.TimeThiefCronocorder);
AI.SelectCard(Monsters.TimeThiefWinder); AI.SelectCard(Monsters.TimeThiefWinder);
return true; return true;
...@@ -370,6 +371,7 @@ namespace WindBot.Game.AI.Decks ...@@ -370,6 +371,7 @@ namespace WindBot.Game.AI.Decks
} }
private bool ThunderKingRaiOheff() private bool ThunderKingRaiOheff()
{ {
if (DefaultOnlyHorusSpSummoning()) return false;
if (Duel.SummoningCards.Count > 0) if (Duel.SummoningCards.Count > 0)
{ {
foreach (ClientCard m in Duel.SummoningCards) foreach (ClientCard m in Duel.SummoningCards)
......
...@@ -231,6 +231,7 @@ namespace WindBot.Game.AI.Decks ...@@ -231,6 +231,7 @@ namespace WindBot.Game.AI.Decks
} }
else else
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Bot.HasInHand(CardId.DupeFrog)) if (Bot.HasInHand(CardId.DupeFrog))
{ {
AI.SelectCard( AI.SelectCard(
...@@ -267,6 +268,7 @@ namespace WindBot.Game.AI.Decks ...@@ -267,6 +268,7 @@ namespace WindBot.Game.AI.Decks
private bool RonintoadinEffect() private bool RonintoadinEffect()
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
AI.SelectPosition(CardPosition.FaceUpDefence); AI.SelectPosition(CardPosition.FaceUpDefence);
return true; return true;
} }
...@@ -297,6 +299,7 @@ namespace WindBot.Game.AI.Decks ...@@ -297,6 +299,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (Duel.CurrentChain.Count > 0) if (Duel.CurrentChain.Count > 0)
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
// negate effect, select a cost for it // negate effect, select a cost for it
List<ClientCard> monsters = Bot.GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
IList<int> suitableCost = new[] { IList<int> suitableCost = new[] {
...@@ -381,6 +384,7 @@ namespace WindBot.Game.AI.Decks ...@@ -381,6 +384,7 @@ namespace WindBot.Game.AI.Decks
} }
else if (Duel.Phase == DuelPhase.Standby) else if (Duel.Phase == DuelPhase.Standby)
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
SelectXYZDetach(Card.Overlays); SelectXYZDetach(Card.Overlays);
if (Duel.Player == 0) if (Duel.Player == 0)
{ {
......
This diff is collapsed.
This diff is collapsed.
...@@ -155,6 +155,7 @@ namespace WindBot.Game.AI.Decks ...@@ -155,6 +155,7 @@ namespace WindBot.Game.AI.Decks
public override void OnNewTurn() public override void OnNewTurn()
{ {
CardOfDemiseUsed = false; CardOfDemiseUsed = false;
base.OnNewTurn();
} }
public override bool OnSelectYesNo(int desc) public override bool OnSelectYesNo(int desc)
......
...@@ -573,6 +573,7 @@ namespace WindBot.Game.AI.Decks ...@@ -573,6 +573,7 @@ namespace WindBot.Game.AI.Decks
activate_count = 0; activate_count = 0;
summon_count = 0; summon_count = 0;
enemy_activate = false; enemy_activate = false;
base.OnNewTurn();
} }
private bool ZefraProvidenceEffect() private bool ZefraProvidenceEffect()
{ {
...@@ -2115,7 +2116,9 @@ namespace WindBot.Game.AI.Decks ...@@ -2115,7 +2116,9 @@ namespace WindBot.Game.AI.Decks
result.AddRange(tRelease); result.AddRange(tRelease);
result.AddRange(nRelease); result.AddRange(nRelease);
} }
return Func.CheckSelectCount(Util, result, cards, min, max); IList<ClientCard> selectResult = Func.CheckSelectCount(Util, result, cards, min, max);
if (selectResult == null) return base.OnSelectCard(cards, min, max, hint, cancelable);
return selectResult;
} }
private bool HasInDeck(int id) private bool HasInDeck(int id)
{ {
......
...@@ -127,6 +127,7 @@ namespace WindBot.Game.AI.Decks ...@@ -127,6 +127,7 @@ namespace WindBot.Game.AI.Decks
TigermortarSpsummoned = false; TigermortarSpsummoned = false;
ChakanineSpsummoned = false; ChakanineSpsummoned = false;
BroadbullSpsummoned = false; BroadbullSpsummoned = false;
base.OnNewTurn();
} }
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender) public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
...@@ -150,6 +151,7 @@ namespace WindBot.Game.AI.Decks ...@@ -150,6 +151,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (Card.Location == CardLocation.Hand) if (Card.Location == CardLocation.Hand)
{ {
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (!(Duel.Phase == DuelPhase.BattleStep if (!(Duel.Phase == DuelPhase.BattleStep
|| Duel.Phase == DuelPhase.BattleStart || Duel.Phase == DuelPhase.BattleStart
|| Duel.Phase == DuelPhase.Damage)) || Duel.Phase == DuelPhase.Damage))
...@@ -429,8 +431,7 @@ namespace WindBot.Game.AI.Decks ...@@ -429,8 +431,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (Duel.Phase == DuelPhase.Main1 || Duel.Phase == DuelPhase.Main2) if (Duel.Phase == DuelPhase.Main1 || Duel.Phase == DuelPhase.Main2)
return false; return false;
if (Card.IsDisabled()) if (DefaultCheckWhetherCardIsNegated(Card)) return false;
return false;
ClientCard target = null; ClientCard target = null;
List<ClientCard> monsters = Bot.GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
......
This diff is collapsed.
...@@ -36,6 +36,8 @@ namespace WindBot.Game.AI ...@@ -36,6 +36,8 @@ namespace WindBot.Game.AI
[DataMember] [DataMember]
public string[] chaining { get; set; } public string[] chaining { get; set; }
[DataMember] [DataMember]
public string[] surrender { get; set; }
[DataMember]
public string[] custom { get; set; } public string[] custom { get; set; }
} }
public class Dialogs public class Dialogs
...@@ -55,6 +57,7 @@ namespace WindBot.Game.AI ...@@ -55,6 +57,7 @@ namespace WindBot.Game.AI
private string[] _summon; private string[] _summon;
private string[] _setmonster; private string[] _setmonster;
private string[] _chaining; private string[] _chaining;
private string[] _surrender;
private string[] _custom; private string[] _custom;
public Dialogs(GameClient game) public Dialogs(GameClient game)
...@@ -78,6 +81,7 @@ namespace WindBot.Game.AI ...@@ -78,6 +81,7 @@ namespace WindBot.Game.AI
_summon = data.summon; _summon = data.summon;
_setmonster = data.setmonster; _setmonster = data.setmonster;
_chaining = data.chaining; _chaining = data.chaining;
_surrender = data.surrender;
_custom = data.custom; _custom = data.custom;
} }
} }
...@@ -162,10 +166,17 @@ namespace WindBot.Game.AI ...@@ -162,10 +166,17 @@ namespace WindBot.Game.AI
InternalSendMessage(_chaining, card); InternalSendMessage(_chaining, card);
} }
public void SendSurrender()
{
InternalSendMessage(_surrender);
}
private void InternalSendMessage(IList<string> array, params object[] opts) private void InternalSendMessage(IList<string> array, params object[] opts)
{ {
if (!_game._chat) if (!_game._chat)
return; return;
if (array == null || array.Count == 0)
return;
string message = string.Format(array[Program.Rand.Next(array.Count)], opts); string message = string.Format(array[Program.Rand.Next(array.Count)], opts);
if (message != "") if (message != "")
_game.Chat(message); _game.Chat(message);
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
Heart_eartHDragon = 97403510, Heart_eartHDragon = 97403510,
DaigustoSphreeze = 29552709, DaigustoSphreeze = 29552709,
OhimetheManifestedMikanko = 81260679, OhimetheManifestedMikanko = 81260679,
ArahimetheManifestedMikanko = 75771170 ArahimetheManifestedMikanko = 75771170,
YubelDasEwigLiebeWachter = 47172959
} }
} }
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
ElShaddollConstruct = 20366274, ElShaddollConstruct = 20366274,
ElShaddollGrysra = 48424886, ElShaddollGrysra = 48424886,
ElShaddollWinda = 94977269, ElShaddollWinda = 94977269,
HotRedDragonArchfiendAbyss = 9753964,
UltimateConductorTytanno = 18940556, UltimateConductorTytanno = 18940556,
OvertexCoatls = 41782653, OvertexCoatls = 41782653,
FirePrison = 269510, FirePrison = 269510,
...@@ -210,6 +211,18 @@ ...@@ -210,6 +211,18 @@
TGGlaiveBlaster = 95973569, TGGlaiveBlaster = 95973569,
StellarNemesisTPHON_DoomsdayStar = 93039339, StellarNemesisTPHON_DoomsdayStar = 93039339,
SPLittleKnight = 29301450, SPLittleKnight = 29301450,
AngelRing = 40678060 AngelRing = 40678060,
SkullGuardianProtectorOfTheVoicelessVoice = 10774240,
FloweringEtoileTheMelodiousMagnificat = 83793721,
EnlightenmentDragon = 46186135,
GoldPrideEradicator = 45464587,
VarudrasTheFinalBringerOfTheEndTimes = 70636044,
RagnaraikaStagSovereign = 42307760,
DrytronMeteonisAlphaDraconids = 56863746,
TheUnstoppableExodiaIncarnate = 83257450,
LightAndDarknessDragonLord = 19652159,
FiendsmithDiesIrae = 82135803,
MementomictlanTecuhtlicaCombinedConqueror = 14529511,
MadolcheQueenTiaraalaFraise = 49689480
} }
} }
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
FaceCardFusion = 29062925, FaceCardFusion = 29062925,
MyutantFusion = 42577802, MyutantFusion = 42577802,
MyutantCry = 31855260, MyutantCry = 31855260,
FallenOfAlbaz = 68468459,
GreaterPolymerization = 7614732, GreaterPolymerization = 7614732,
UltimateFusion = 71143015, UltimateFusion = 71143015,
BrandedFusion = 44362883, BrandedFusion = 44362883,
...@@ -85,6 +86,8 @@ ...@@ -85,6 +86,8 @@
FusionReproduction = 43331750, FusionReproduction = 43331750,
ChimeraFusion = 63136489, ChimeraFusion = 63136489,
HarmonicSynchroFusion = 7473735, HarmonicSynchroFusion = 7473735,
SouloftheSupremeCelestialKing = 76840111 SouloftheSupremeCelestialKing = 76840111,
MelodiousConcerto = 31458630,
MementotlanFusion = 66518509
} }
} }
...@@ -109,6 +109,20 @@ ...@@ -109,6 +109,20 @@
NightmareMagician = 40221691, NightmareMagician = 40221691,
ArahimetheManifestedMikanko = 75771170, ArahimetheManifestedMikanko = 75771170,
UFOLight = 9275482, UFOLight = 9275482,
TaotheGreatChanter = 34541543 TaotheGreatChanter = 34541543,
SpiritOfYubel = 90829280,
DarkGuardian = 26746975,
EnvoyOfTheWaxState = 87462901,
Fluffyfluff = 85401123,
YubelDasEwigLiebeWachter = 47172959,
TenpaiDragonFadra = 65326118,
GolgoilTheSteelSeismicSmasher = 59369430,
TalonsOfShurilane = 74150658,
NightmareApprentice = 58143852,
MillenniumoonMaiden = 37552929,
MillenniumFiendReflection = 63947968,
HereticalPhoboscobos = 76078185,
TopHatHareTheSilhouetteMagician = 1528054,
Silhouhatte = 24440742
} }
} }
...@@ -11,10 +11,6 @@ ...@@ -11,10 +11,6 @@
SamuraiDestroyer = 40509732, SamuraiDestroyer = 40509732,
ArmadesKeeperOfBoundaries = 88033975, ArmadesKeeperOfBoundaries = 88033975,
NumberS39UtopiaTheLightning = 56832966, NumberS39UtopiaTheLightning = 56832966,
DualAvatarEmpoweredKonGyo = 33026283, DualAvatarEmpoweredKonGyo = 33026283
GGolemRockHammer = 98875863,
WishDragon = 64583600,
ChaosWitch = 30327674,
FissioningMotherSpider = 34034150
} }
} }
...@@ -63,6 +63,10 @@ ...@@ -63,6 +63,10 @@
ThreeEyedGhost = 31464658, ThreeEyedGhost = 31464658,
UrsarcticPolarStar = 62714453, UrsarcticPolarStar = 62714453,
BattlinBoxerPromoter = 83315222, BattlinBoxerPromoter = 83315222,
TGRocketSalamander = 77392987 TGRocketSalamander = 77392987,
GGolemRockHammer = 98875863,
WishDragon = 64583600,
ChaosWitch = 30327674,
FissioningMotherSpider = 34034150
} }
} }
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
BorreloadDragon = 31833038, BorreloadDragon = 31833038,
BorrelendDragon = 98630720, BorrelendDragon = 98630720,
DrytronMeteonisDraconids = 69815951, DrytronMeteonisDraconids = 69815951,
MyutantBeast = 34695290 MyutantBeast = 34695290,
VeidosTheDragonOfEndlessDarkness = 8540986
} }
} }
...@@ -49,6 +49,8 @@ ...@@ -49,6 +49,8 @@
Blackwing_FullArmoredWing = 54082269, Blackwing_FullArmoredWing = 54082269,
DragunofRedEyes = 37818794, DragunofRedEyes = 37818794,
RedEyesBDragon = 74677422, // sometimes the name of DragunofRedEyes will be changed to RedEyesBDragon RedEyesBDragon = 74677422, // sometimes the name of DragunofRedEyes will be changed to RedEyesBDragon
TheArrivalCyberseIgnister = 11738489 TheArrivalCyberseIgnister = 11738489,
MajespecterPorcupineYamaarashi = 51073802,
RaidraptorRisingRebellionFalcon = 71222868
} }
} }
...@@ -103,10 +103,21 @@ namespace WindBot.Game.AI ...@@ -103,10 +103,21 @@ namespace WindBot.Game.AI
// For overriding // For overriding
} }
public virtual void OnChainSolved(int chainIndex)
{
// For overriding
}
public virtual void OnChainEnd() public virtual void OnChainEnd()
{ {
// For overriding // For overriding
} }
public virtual void OnReceivingAnnouce(int player, int data)
{
// For overriding
}
public virtual void OnNewPhase() public virtual void OnNewPhase()
{ {
// Some AI need do something on new phase // Some AI need do something on new phase
...@@ -121,7 +132,7 @@ namespace WindBot.Game.AI ...@@ -121,7 +132,7 @@ namespace WindBot.Game.AI
// Some AI need do something on draw // Some AI need do something on draw
} }
public virtual void OnMove(int cardId, int previousControler, int previousLocation, int currentControler, int currentLocation) public virtual void OnMove(ClientCard card, int previousControler, int previousLocation, int currentControler, int currentLocation)
{ {
// Some AI need do something on card's moving // Some AI need do something on card's moving
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
SummonOrSet, SummonOrSet,
GoToBattlePhase, GoToBattlePhase,
GoToMainPhase2, GoToMainPhase2,
GoToEndPhase GoToEndPhase,
Surrender
} }
} }
\ No newline at end of file
...@@ -57,6 +57,11 @@ ...@@ -57,6 +57,11 @@
ToZone = 571, ToZone = 571,
Counter = 572, Counter = 572,
Disable = 573, Disable = 573,
OperateCard = 574; OperateCard = 574,
RITUAL = 1057,
FUSION = 1056,
SYNCHRO = 1063,
XYZ = 1073,
PENDULUM = 1074;
} }
} }
\ No newline at end of file
...@@ -15,6 +15,7 @@ namespace WindBot.Game ...@@ -15,6 +15,7 @@ namespace WindBot.Game
public int Position { get; set; } public int Position { get; set; }
public int Sequence { get; set; } public int Sequence { get; set; }
public CardLocation Location { get; set; } public CardLocation Location { get; set; }
public CardLocation LastLocation { get; set; }
public int Alias { get; private set; } public int Alias { get; private set; }
public int Level { get; private set; } public int Level { get; private set; }
public int Rank { get; private set; } public int Rank { get; private set; }
...@@ -70,6 +71,7 @@ namespace WindBot.Game ...@@ -70,6 +71,7 @@ namespace WindBot.Game
ActionIndex = new int[16]; ActionIndex = new int[16];
ActionActivateIndex = new Dictionary<int, int>(); ActionActivateIndex = new Dictionary<int, int>();
Location = loc; Location = loc;
LastLocation = 0;
} }
public void SetId(int id) public void SetId(int id)
...@@ -80,8 +82,7 @@ namespace WindBot.Game ...@@ -80,8 +82,7 @@ namespace WindBot.Game
if (Data != null) if (Data != null)
{ {
Name = Data.Name; Name = Data.Name;
if (Data.Alias != 0) Alias = Data.Alias;
Alias = Data.Alias;
} else { } else {
Name = null; Name = null;
Alias = 0; Alias = 0;
...@@ -346,7 +347,7 @@ namespace WindBot.Game ...@@ -346,7 +347,7 @@ namespace WindBot.Game
public bool IsOriginalCode(int id) public bool IsOriginalCode(int id)
{ {
return Id == id || Alias - Id < 10 && Alias == id; return Id == id || Alias - Id < 20 && Alias == id;
} }
public bool HasXyzMaterial() public bool HasXyzMaterial()
...@@ -369,9 +370,20 @@ namespace WindBot.Game ...@@ -369,9 +370,20 @@ namespace WindBot.Game
return IsAttack() ? Attack : Defense; return IsAttack() ? Attack : Defense;
} }
public int GetOriginCode()
{
int code = Id;
if (Data != null)
{
if (Data.Alias > 0) code = Data.Alias;
else code = Data.Id;
}
return code;
}
public bool Equals(ClientCard card) public bool Equals(ClientCard card)
{ {
return ReferenceEquals(this, card); return ReferenceEquals(this, card);
} }
} }
} }
\ No newline at end of file
using System.Collections.Generic; using System.Collections.Generic;
using YGOSharp.OCGWrapper.Enums; using YGOSharp.OCGWrapper.Enums;
namespace WindBot.Game namespace WindBot.Game
...@@ -26,6 +26,8 @@ namespace WindBot.Game ...@@ -26,6 +26,8 @@ namespace WindBot.Game
public int LastSummonPlayer { get; set; } public int LastSummonPlayer { get; set; }
public IList<ClientCard> SummoningCards { get; set; } public IList<ClientCard> SummoningCards { get; set; }
public IList<ClientCard> LastSummonedCards { get; set; } public IList<ClientCard> LastSummonedCards { get; set; }
public int SolvingChainIndex { get; set; }
public IList<int> NegatedChainIndexList { get; set; }
public Duel() public Duel()
{ {
...@@ -41,6 +43,8 @@ namespace WindBot.Game ...@@ -41,6 +43,8 @@ namespace WindBot.Game
LastSummonPlayer = -1; LastSummonPlayer = -1;
SummoningCards = new List<ClientCard>(); SummoningCards = new List<ClientCard>();
LastSummonedCards = new List<ClientCard>(); LastSummonedCards = new List<ClientCard>();
SolvingChainIndex = 0;
NegatedChainIndexList = new List<int>();
} }
public ClientCard GetCard(int player, CardLocation loc, int seq) public ClientCard GetCard(int player, CardLocation loc, int seq)
...@@ -169,5 +173,16 @@ namespace WindBot.Game ...@@ -169,5 +173,16 @@ namespace WindBot.Game
{ {
return IsFirst ? player : 1 - player; return IsFirst ? player : 1 - player;
} }
public ClientCard GetCurrentSolvingChainCard()
{
if (SolvingChainIndex == 0 || SolvingChainIndex > CurrentChain.Count) return null;
return CurrentChain[SolvingChainIndex - 1];
}
public bool IsCurrentSolvingChainNegated()
{
return SolvingChainIndex > 0 && NegatedChainIndexList.Contains(SolvingChainIndex);
}
} }
} }
\ No newline at end of file
...@@ -27,6 +27,18 @@ namespace WindBot.Game ...@@ -27,6 +27,18 @@ namespace WindBot.Game
_activatedCards = new Dictionary<int, int>(); _activatedCards = new Dictionary<int, int>();
} }
private void CheckSurrender()
{
foreach (CardExecutor exec in Executor.Executors)
{
if (exec.Type == ExecutorType.Surrender && exec.Func())
{
_dialogs.SendSurrender();
Game.Surrender();
}
}
}
/// <summary> /// <summary>
/// Called when the AI got the error message. /// Called when the AI got the error message.
/// </summary> /// </summary>
...@@ -119,11 +131,12 @@ namespace WindBot.Game ...@@ -119,11 +131,12 @@ namespace WindBot.Game
_dialogs.SendNewTurn(); _dialogs.SendNewTurn();
} }
Executor.OnNewPhase(); Executor.OnNewPhase();
CheckSurrender();
} }
public void OnMove(int cardId, int previousControler, int previousLocation, int currentControler, int currentLocation) public void OnMove(ClientCard card, int previousControler, int previousLocation, int currentControler, int currentLocation)
{ {
Executor.OnMove(cardId, previousControler, previousLocation, currentControler, currentLocation); Executor.OnMove(card, previousControler, previousLocation, currentControler, currentLocation);
} }
/// <summary> /// <summary>
...@@ -132,6 +145,7 @@ namespace WindBot.Game ...@@ -132,6 +145,7 @@ namespace WindBot.Game
public void OnDirectAttack(ClientCard card) public void OnDirectAttack(ClientCard card)
{ {
_dialogs.SendOnDirectAttack(card.Name); _dialogs.SendOnDirectAttack(card.Name);
CheckSurrender();
} }
/// <summary> /// <summary>
...@@ -143,6 +157,11 @@ namespace WindBot.Game ...@@ -143,6 +157,11 @@ namespace WindBot.Game
{ {
Executor.OnChaining(player,card); Executor.OnChaining(player,card);
} }
public void OnChainSolved(int chainIndex)
{
Executor.OnChainSolved(chainIndex);
}
/// <summary> /// <summary>
/// Called when a chain has been solved. /// Called when a chain has been solved.
...@@ -152,6 +171,17 @@ namespace WindBot.Game ...@@ -152,6 +171,17 @@ namespace WindBot.Game
m_selector.Clear(); m_selector.Clear();
m_selector_pointer = -1; m_selector_pointer = -1;
Executor.OnChainEnd(); Executor.OnChainEnd();
CheckSurrender();
}
/// <summary>
/// Called when receiving annouce
/// </summary>
/// <param name="player">Player who announce.</param>
/// <param name="data">Annouced info.</param>
public void OnReceivingAnnouce(int player, int data)
{
Executor.OnReceivingAnnouce(player, data);
} }
/// <summary> /// <summary>
...@@ -302,6 +332,8 @@ namespace WindBot.Game ...@@ -302,6 +332,8 @@ namespace WindBot.Game
// Always select the first available cards and choose the minimum. // Always select the first available cards and choose the minimum.
IList<ClientCard> selected = new List<ClientCard>(); IList<ClientCard> selected = new List<ClientCard>();
if (hint == HintMsg.AttackTarget && cancelable) return selected;
if (cards.Count >= min) if (cards.Count >= min)
{ {
for (int i = 0; i < min; ++i) for (int i = 0; i < min; ++i)
...@@ -407,6 +439,7 @@ namespace WindBot.Game ...@@ -407,6 +439,7 @@ namespace WindBot.Game
public MainPhaseAction OnSelectIdleCmd(MainPhase main) public MainPhaseAction OnSelectIdleCmd(MainPhase main)
{ {
Executor.SetMain(main); Executor.SetMain(main);
CheckSurrender();
foreach (CardExecutor exec in Executor.Executors) foreach (CardExecutor exec in Executor.Executors)
{ {
if (exec.Type == ExecutorType.GoToEndPhase && main.CanEndPhase && exec.Func()) // check if should enter end phase directly if (exec.Type == ExecutorType.GoToEndPhase && main.CanEndPhase && exec.Func()) // check if should enter end phase directly
...@@ -1131,6 +1164,7 @@ namespace WindBot.Game ...@@ -1131,6 +1164,7 @@ namespace WindBot.Game
private bool ShouldExecute(CardExecutor exec, ClientCard card, ExecutorType type, int desc = -1, int timing = -1) private bool ShouldExecute(CardExecutor exec, ClientCard card, ExecutorType type, int desc = -1, int timing = -1)
{ {
Executor.SetCard(type, card, desc, timing);
if (card.Id != 0 && type == ExecutorType.Activate) if (card.Id != 0 && type == ExecutorType.Activate)
{ {
if (_activatedCards.ContainsKey(card.Id) && _activatedCards[card.Id] >= 9) if (_activatedCards.ContainsKey(card.Id) && _activatedCards[card.Id] >= 9)
...@@ -1138,18 +1172,9 @@ namespace WindBot.Game ...@@ -1138,18 +1172,9 @@ namespace WindBot.Game
if (!Executor.OnPreActivate(card)) if (!Executor.OnPreActivate(card))
return false; return false;
} }
Executor.SetCard(type, card, desc, timing); bool result = card != null && exec.Type == type &&
Func<bool> Func = () =>
{
bool res = Executor.FuncFilters.ContainsKey(exec.Type) && Executor.FuncFilters[exec.Type] != null;
if (Executor.FuncFilters.ContainsKey(exec.Type) && Executor.FuncFilters[exec.Type] != null
&& !Executor.FuncFilters[exec.Type]()) return false;
return exec.Func == null || exec.Func();
};
bool result = card != null && exec.Type == type &&
(exec.CardId == -1 || exec.CardId == card.Id) && (exec.CardId == -1 || exec.CardId == card.Id) &&
Func(); (exec.Func == null || exec.Func());
if (card.Id != 0 && type == ExecutorType.Activate && result) if (card.Id != 0 && type == ExecutorType.Activate && result)
{ {
int count = card.IsDisabled() ? 3 : 1; int count = card.IsDisabled() ? 3 : 1;
......
This diff is collapsed.
...@@ -90,6 +90,11 @@ namespace WindBot.Game ...@@ -90,6 +90,11 @@ namespace WindBot.Game
Connection.Send(chat); Connection.Send(chat);
} }
public void Surrender()
{
Connection.Send(CtosMessage.Surrender);
}
private void OnPacketReceived(BinaryReader reader) private void OnPacketReceived(BinaryReader reader)
{ {
_behavior.OnPacket(reader); _behavior.OnPacket(reader);
......
...@@ -50,15 +50,6 @@ ...@@ -50,15 +50,6 @@
<Reference Include="System.Runtime.Serialization" /> <Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Web" /> <Reference Include="System.Web" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="YGOSharp.Network">
<HintPath>.\YGOSharp.Network.dll</HintPath>
</Reference>
<Reference Include="YGOSharp.OCGWrapper">
<HintPath>.\YGOSharp.OCGWrapper.dll</HintPath>
</Reference>
<Reference Include="YGOSharp.OCGWrapper.Enums">
<HintPath>.\YGOSharp.OCGWrapper.Enums.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Config.cs" /> <Compile Include="Config.cs" />
...@@ -69,6 +60,7 @@ ...@@ -69,6 +60,7 @@
<Compile Include="Game\AI\CardSelector.cs" /> <Compile Include="Game\AI\CardSelector.cs" />
<Compile Include="Game\AI\DeckAttribute.cs" /> <Compile Include="Game\AI\DeckAttribute.cs" />
<Compile Include="Game\AI\DecksManager.cs" /> <Compile Include="Game\AI\DecksManager.cs" />
<Compile Include="Game\AI\Decks\AlbazExecutor.cs" />
<Compile Include="Game\AI\Decks\AltergeistExecutor.cs" /> <Compile Include="Game\AI\Decks\AltergeistExecutor.cs" />
<Compile Include="Game\AI\Decks\BraveExecutor.cs" /> <Compile Include="Game\AI\Decks\BraveExecutor.cs" />
<Compile Include="Game\AI\Decks\FamiliarPossessedExecutor.cs" /> <Compile Include="Game\AI\Decks\FamiliarPossessedExecutor.cs" />
...@@ -103,10 +95,12 @@ ...@@ -103,10 +95,12 @@
<Compile Include="Game\AI\Decks\GraydleExecutor.cs" /> <Compile Include="Game\AI\Decks\GraydleExecutor.cs" />
<Compile Include="Game\AI\Decks\GrenMajuThunderBoarderExecutor.cs" /> <Compile Include="Game\AI\Decks\GrenMajuThunderBoarderExecutor.cs" />
<Compile Include="Game\AI\Decks\LightswornExecutor.cs" /> <Compile Include="Game\AI\Decks\LightswornExecutor.cs" />
<Compile Include="Game\AI\Decks\LabrynthExecutor.cs" />
<Compile Include="Game\AI\Decks\LightswornShaddoldinosourExecutor.cs" /> <Compile Include="Game\AI\Decks\LightswornShaddoldinosourExecutor.cs" />
<Compile Include="Game\AI\Decks\PhantasmExecutor.cs" /> <Compile Include="Game\AI\Decks\PhantasmExecutor.cs" />
<Compile Include="Game\AI\Decks\QliphortExecutor.cs" /> <Compile Include="Game\AI\Decks\QliphortExecutor.cs" />
<Compile Include="Game\AI\Decks\ST1732Executor.cs" /> <Compile Include="Game\AI\Decks\ST1732Executor.cs" />
<Compile Include="Game\AI\Decks\SuperheavySamuraiExecutor.cs" />
<Compile Include="Game\AI\Decks\SwordsoulExecutor.cs" /> <Compile Include="Game\AI\Decks\SwordsoulExecutor.cs" />
<Compile Include="Game\AI\Decks\TrickstarExecutor.cs" /> <Compile Include="Game\AI\Decks\TrickstarExecutor.cs" />
<Compile Include="Game\AI\Decks\WitchcraftExecutor.cs" /> <Compile Include="Game\AI\Decks\WitchcraftExecutor.cs" />
...@@ -156,6 +150,29 @@ ...@@ -156,6 +150,29 @@
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="WindBotInfo.cs" /> <Compile Include="WindBotInfo.cs" />
<Compile Include="YGOSharp.Network\BinaryClient.cs" />
<Compile Include="YGOSharp.Network\Enums\CtosMessage.cs" />
<Compile Include="YGOSharp.Network\Enums\GameState.cs" />
<Compile Include="YGOSharp.Network\Enums\PlayerChange.cs" />
<Compile Include="YGOSharp.Network\Enums\PlayerState.cs" />
<Compile Include="YGOSharp.Network\Enums\PlayerType.cs" />
<Compile Include="YGOSharp.Network\Enums\StocMessage.cs" />
<Compile Include="YGOSharp.Network\NetworkClient.cs" />
<Compile Include="YGOSharp.Network\Utils\BinaryExtensions.cs" />
<Compile Include="YGOSharp.Network\YGOClient.cs" />
<Compile Include="YGOSharp.OCGWrapper.Enums\CardAttribute.cs" />
<Compile Include="YGOSharp.OCGWrapper.Enums\CardLinkMarker.cs" />
<Compile Include="YGOSharp.OCGWrapper.Enums\CardLocation.cs" />
<Compile Include="YGOSharp.OCGWrapper.Enums\CardPosition.cs" />
<Compile Include="YGOSharp.OCGWrapper.Enums\CardRace.cs" />
<Compile Include="YGOSharp.OCGWrapper.Enums\CardType.cs" />
<Compile Include="YGOSharp.OCGWrapper.Enums\DuelPhase.cs" />
<Compile Include="YGOSharp.OCGWrapper.Enums\GameMessage.cs" />
<Compile Include="YGOSharp.OCGWrapper.Enums\Query.cs" />
<Compile Include="YGOSharp.OCGWrapper\Card.cs" />
<Compile Include="YGOSharp.OCGWrapper\CardsManager.cs" />
<Compile Include="YGOSharp.OCGWrapper\NamedCard.cs" />
<Compile Include="YGOSharp.OCGWrapper\NamedCardsManager.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config" />
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
No preview for this file type
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