Commit 1d36fa32 authored by nanahira's avatar nanahira

Merge branch 'master' of https://code.mycard.moe/nanahira/windbot

parents 1ca75fb7 af9cea2c
......@@ -62,7 +62,7 @@ AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_MASTER_RULE_2020
!复制植物-青眼
Name=复制植物 Deck=Blue-Eyes Dialog=copy.zh-CN
青眼卡组。
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_MASTER_RULE_2020
AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_MASTER_RULE_2020
!复制植物-十二兽
Name=复制植物 Deck=Zoodiac Dialog=copy.zh-CN
......@@ -214,7 +214,12 @@ Name=朱露咲浅羽 Deck=Dragun Dialog=nlch.zh-CN
超魔导真红眼龙骑士卡组。
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!玻璃女巫
!我太帅了-水百凤凰勇者
Name=我太帅了 Deck=Brave Dialog=smart.zh-CN
水机百头龙凤凰人勇者卡组。
AI_LV3 SUPPORT_MASTER_RULE_2020
!玻璃女巫-魔女术
Name=玻璃女巫 Deck=Witchcraft Dialog=verre.zh-CN
魔女术卡组。
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
......@@ -234,6 +239,16 @@ Name=濑名歌铃 Deck=Brave Dialog=wof-Sena-Karin
????? 卡组。
AI_LV3 SUPPORT_MASTER_RULE_2020
!玻璃女巫-救祓少女
Name=玻璃女巫 Deck=Exosister Dialog=verre.zh-CN
救祓少女卡组。
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_MASTER_RULE_2020
!艾克莉西娅-相剑
Name=艾克莉西娅 Deck=Swordsoul Dialog=ecclesia.zh-CN
相剑卡组。
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_MASTER_RULE_2020
!神数不神-刹帝利
Name=神数不神 Deck=Kashtira Dialog=Zefra.zh-CN
俱舍怒威族卡组。
......@@ -243,3 +258,13 @@ AI_LV3 SUPPORT_MASTER_RULE_2020
Name=神数不神 Deck=ThunderDragon Dialog=Zefra.zh-CN
深渊混沌雷龙卡组。(普通模式的人机的卡组会符合其使用的卡池对应的环境的禁限卡表,但在狂野模式中,人机的卡组不符合任何禁限卡表。)
SUPPORT_MASTER_RULE_2020
!神数不神-珠泪哀歌
Name=神数不神 Deck=Tearlaments Dialog=Zefra.zh-CN
旧式地天使珠泪哀歌族卡组。
AI_LV3 SUPPORT_MASTER_RULE_2020
!神数不神-神数
Name=神数不神 Deck=Zefra Dialog=Zefra.zh-CN
神数卡组。
AI_LV3 SUPPORT_MASTER_RULE_2020
#created by ...
#main
37343995
37343995
37343995
16889337
16889337
16889337
16474916
16474916
16474916
67972302
67972302
67972302
79858629
79858629
43863925
43863925
43863925
5352328
5352328
14558127
14558127
14558127
23434538
23434538
23434538
84211599
84211599
4408198
24224830
24224830
77913594
77913594
77913594
197042
197042
10045474
10045474
77891946
77891946
77891946
#extra
90448279
59242457
59242457
9272381
42741437
42741437
42741437
78135071
78135071
41524885
41524885
46772449
5530780
58858807
8728498
!side
74689476
#created by ...
#main
27204311
87052196
87052196
23431858
93490856
93490856
93490856
56495147
56495147
56495147
20001443
20001443
20001443
55273560
55273560
55273560
14558127
14558127
14558127
23434538
23434538
23434538
97268402
97268402
97268402
98159737
35261759
35261759
56465981
56465981
56465981
93850690
24224830
24224830
65681983
10045474
10045474
10045474
14821890
14821890
#extra
42632209
60465049
96633955
84815190
47710198
9464441
5041348
69248256
69248256
83755611
43202238
78917791
32519092
32519092
32519092
!side
#created by ...
#main
49036338
29432356
29432356
29432356
3611830
76794549
5560911
96227613
96227613
27354732
58990362
58990362
58990362
20773176
22617205
69610326
14785765
95401059
31314549
96223501
52159691
21495657
21495657
57777714
92559258
92559258
92559258
38814750
38814750
38814750
72291078
23434538
23434538
23434538
94693857
9742784
19580308
11609969
61488417
2295440
23581825
38943357
38943357
38943357
41620959
41620959
41620959
73628505
74580251
74580251
74580251
81439173
24224830
24224830
46372010
32354768
32354768
32354768
35561352
57831349
#extra
27548199
74586817
80696379
33158448
65536818
79606837
88581108
96157835
73347079
74997493
44097050
24094258
50588353
36429703
41999284
!side
......@@ -50,5 +50,10 @@
"乎,我发动{0}!",
"不好意思拉,我有{0}",
"哈哈,发动{0}的效果!"
],
"custom": [
"呱!本体出征!",
"凸(艹皿艹 )卡手不玩拉!!!",
"嘿不慌,还有摆子场( ̄y▽ ̄)╭"
]
}
{
"welcome": [
"这里就是大灵峰吗?"
],
"deckerror": [
"{0}被冰水咒缚了!"
],
"duelstart": [
"走了好久,肚子饿了……",
"前方会遇到怎样的同伴呢?",
"有阿不思在一起的话……"
],
"newturn": [
"我的回合!"
],
"endturn": [
"姐姐到底在哪里……",
"阿不思的干粮也吃完了啊。",
"什么时候开饭呢?"
],
"directattack": [
"{0},直接攻击!",
"开饭!"
],
"attack": [
"用{0}攻击{1}!"
],
"ondirectattack": [
"好饿……",
"呜呜……",
"姐姐……"
],
"facedownmonstername": "怪兽",
"activate": [
"发动{0}的效果!"
],
"summon": [
"{0}召唤!",
"出来吧,{0}!"
],
"setmonster": [
"……"
],
"chaining": [
"发动{0}的效果!",
"{0}!"
]
}
......@@ -442,5 +442,115 @@ namespace WindBot.Game.AI
return selected;
}
/// <summary>
/// Get all xyz materials lists that xyz monster required level in the 'pre_materials' list
/// </summary>
/// <param name="param_pre_materials">Original materials</param>
/// <param name="level">Xyz monster required level</param>
/// <param name="material_count">SpSummon rule:number of xyz materials</param>
/// <param name="material_count_above">More xyz materials</param>
/// <param name="material_func">Filter xyz materials func</param>
/// <returns></returns>
public List<List<ClientCard>> GetXyzMaterials(IList<ClientCard> param_pre_materials, int level, int material_count, bool material_count_above = false, Func<ClientCard, bool> material_func = null)
{
List<List<ClientCard>> result = new List<List<ClientCard>>();
List<ClientCard> pre_materials = param_pre_materials?.Where(card => card != null && !(card.IsFacedown() & card.Location == CardLocation.MonsterZone) && card.Level == level && !card.IsMonsterNotBeXyzMaterial()).ToList();
if (pre_materials?.Count() < material_count) return result;
Func<ClientCard, bool> default_func = card => true;
material_func = material_func ?? default_func;
for (int i = 1; i < Math.Pow(2, pre_materials.Count); i++)
{
List<ClientCard> temp_materials = new List<ClientCard>();
string binaryString = Convert.ToString(i, 2).PadLeft(pre_materials.Count, '0');
char[] reversedBinaryChars = binaryString.Reverse().ToArray();
for (int j = 0; j < pre_materials.Count; j++)
{
if (reversedBinaryChars[j] == '1' && material_func(pre_materials[j]))
{
temp_materials.Add(pre_materials[j]);
}
}
if (material_count_above ? temp_materials.Count >= material_count : temp_materials.Count == material_count)
{
result.Add(temp_materials);
}
}
return result;
}
/// <summary>
/// Get all synchro materials lists that synchro monster level == param 'level' in the 'pre_materials' list
/// </summary>
/// <param name="pre_materials">Original materials</param>
/// <param name="level">Synchro monster level</param>
/// <param name="tuner_count">SpSummon rule:number of tuner monsters </param>
/// <param name="n_tuner_count">SpSummon rule:number of non-tuner monsters count</param>
/// <param name="tuner_count_above">More tuner monsters</param>
/// <param name="n_tuner_count_above">More non-tuner monsters</param>
/// <param name="tuner_func">Filter tuner monsters func</param>
/// <param name="n_tuner_func">Filter non-tuner monsters func</param>
/// <returns></returns>
public List<List<ClientCard>> GetSynchroMaterials(IList<ClientCard> param_pre_materials, int level, int tuner_count, int n_tuner_count, bool tuner_count_above = false, bool n_tuner_count_above = true, Func<ClientCard, bool> tuner_func = null, Func<ClientCard, bool> n_tuner_func = null)
{
List<List<ClientCard>> t_result = new List<List<ClientCard>>();
List<ClientCard> pre_materials = param_pre_materials?.Where(card => card != null && !(card.IsFacedown() & card.Location == CardLocation.MonsterZone) && card.Level > 0 && !card.IsMonsterNotBeSynchroMaterial()).ToList();
if (pre_materials?.Count() < tuner_count + n_tuner_count) return t_result;
Func<ClientCard, bool> default_func = card => true;
tuner_func = tuner_func ?? default_func;
n_tuner_func = n_tuner_func ?? default_func;
pre_materials.Sort(CardContainer.CompareCardLevel);
Stack<object[]> materials_stack = new Stack<object[]>();
for (var i = 0; i < pre_materials.Count; i++)
{
if (pre_materials[i].Level > level) break;
materials_stack.Push(new object[] { pre_materials[i].Level, i, pre_materials[i].Level, new List<ClientCard> { pre_materials[i] } });
}
while (materials_stack.Count > 0)
{
object[] data = materials_stack.Pop();
int num = (int)data[0];
int index = (int)data[1];
int sum = (int)data[2];
List<ClientCard> temp_materials = (List<ClientCard>)data[3];
if (sum == level)
{
t_result.Add(temp_materials);
}
else if (sum < level)
{
for (var i = index + 1; i < pre_materials.Count; i++)
{
if (pre_materials[i].Level > level - sum) break;
if (i > index + 1 && pre_materials[i].Level == pre_materials[i - 1].Level) continue;
var new_temp_materials = new List<ClientCard>(temp_materials);
new_temp_materials.Add(pre_materials[i]);
materials_stack.Push(new object[] { pre_materials[i].Level, i, sum + pre_materials[i].Level, new_temp_materials });
}
}
}
List<List<ClientCard>> result = new List<List<ClientCard>>();
for (int i = 0; i < t_result.Count; i++)
{
List<ClientCard> materials = t_result[i];
List<ClientCard> tuner_materials = new List<ClientCard>();
List<ClientCard> n_tuner_materials = new List<ClientCard>();
foreach (ClientCard material in materials)
{
if (material.HasType(CardType.Tuner) && tuner_func(material))
{
tuner_materials.Add(material);
}
else if (material.Level > 0 && n_tuner_func(material))
{
n_tuner_materials.Add(material);
}
}
if ((tuner_count_above ? tuner_materials.Count >= tuner_count : tuner_materials.Count == tuner_count)
&& (n_tuner_count_above ? n_tuner_materials.Count >= n_tuner_count : n_tuner_materials.Count == n_tuner_count))
result.Add(materials);
}
return result;
}
}
}
\ No newline at end of file
......@@ -25,6 +25,15 @@ namespace WindBot.Game.AI
return 1;
}
public static int CompareCardLink(ClientCard cardA, ClientCard cardB)
{
if (cardA.LinkCount < cardB.LinkCount)
return -1;
if (cardA.LinkCount == cardB.LinkCount)
return 0;
return 1;
}
public static int CompareDefensePower(ClientCard cardA, ClientCard cardB)
{
if (cardA == null && cardB == null)
......
......@@ -78,5 +78,21 @@ namespace WindBot.Game.AI
{
return Enum.IsDefined(typeof(FusionSpell), card.Id);
}
/// <summary>
/// Is this monster not be synchro material?
/// </summary>
public static bool IsMonsterNotBeSynchroMaterial(this ClientCard card)
{
return Enum.IsDefined(typeof(NotBeSynchroMaterialMonster), card.Id);
}
/// <summary>
/// Is this monster not be xyz material?
/// </summary>
public static bool IsMonsterNotBeXyzMaterial(this ClientCard card)
{
return Enum.IsDefined(typeof(NotBeXyzMaterialMonster), card.Id);
}
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -123,12 +123,18 @@ namespace WindBot.Game.AI
public const int AntiSpellFragrance = 58921041;
public const int lightningStorm = 14532163;
public const int VaylantzWorld_ShinraBansho = 49568943;
public const int VaylantzWorld_KonigWissen = 75952542;
public const int DivineArsenalAAZEUS_SkyThunder = 90448279;
}
protected DefaultExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.Activate, _CardId.ChickenGame, DefaultChickenGame);
AddExecutor(ExecutorType.Activate, _CardId.VaylantzWorld_ShinraBansho, DefaultVaylantzWorld_ShinraBansho);
AddExecutor(ExecutorType.Activate, _CardId.VaylantzWorld_KonigWissen, DefaultVaylantzWorld_KonigWissen);
AddExecutor(ExecutorType.Activate, _CardId.SantaClaws);
}
......@@ -315,6 +321,40 @@ namespace WindBot.Game.AI
return card.Level <= 4 && Bot.GetMonsters().Count(m => m.IsFaceup()) == 0 && Util.IsAllEnemyBetterThanValue(card.Attack, true);
}
/// <summary>
/// Called when the AI has to select one or more cards.
/// </summary>
/// <param name="cards">List of available cards.</param>
/// <param name="min">Minimal quantity.</param>
/// <param name="max">Maximal quantity.</param>
/// <param name="hint">The hint message of the select.</param>
/// <param name="cancelable">True if you can return an empty list.</param>
/// <returns>A new list containing the selected cards.</returns>
public override IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, int hint, bool cancelable)
{
// wordaround for Dogmatika Alba Zoa
int albaZoaCount = Bot.ExtraDeck.Count / 2;
if (!cancelable && min == albaZoaCount && max == albaZoaCount
&& Duel.Player == 1 && (Duel.Phase == DuelPhase.Main1 || Duel.Phase == DuelPhase.Main2) && cards.All(card =>
card.Controller == 0 && (card.Location == CardLocation.Hand || card.Location == CardLocation.Extra)))
{
Logger.DebugWriteLine("Dogmatika Alba Zoa solved");
List<ClientCard> extraDeck = new List<ClientCard>(Bot.ExtraDeck);
int shuffleCount = extraDeck.Count;
while (shuffleCount-- > 1)
{
int index = Program.Rand.Next(extraDeck.Count);
ClientCard tempCard = extraDeck[shuffleCount];
extraDeck[shuffleCount] = extraDeck[index];
extraDeck[index] = tempCard;
}
return Util.CheckSelectCount(extraDeck, cards, min, max);
}
return null;
}
/// <summary>
/// Destroy face-down cards first, in our turn.
/// </summary>
......@@ -795,7 +835,8 @@ namespace WindBot.Game.AI
_CardId.BlackRoseDragon,
_CardId.JudgmentDragon,
_CardId.TopologicTrisbaena,
_CardId.EvenlyMatched
_CardId.EvenlyMatched,
_CardId.DivineArsenalAAZEUS_SkyThunder
};
int[] destroyAllOpponentSpellList =
{
......@@ -1197,7 +1238,56 @@ namespace WindBot.Game.AI
AI.SelectPlace(Zones.SpellZones);
return true;
}
}
/// <summary>
/// Always activate
/// </summary>
protected bool DefaultVaylantzWorld_ShinraBansho()
{
if (DefaultSpellWillBeNegated()) {
return false;
}
return true;
}
/// <summary>
/// Select enemy's best monster
/// </summary>
protected bool DefaultVaylantzWorld_KonigWissen()
{
if (DefaultSpellWillBeNegated()) {
return false;
}
List<ClientCard> monsters = Enemy.GetMonsters();
if (monsters.Count == 0) {
return false;
}
List<ClientCard> targetList = new List<ClientCard>();
List<ClientCard> floodgateCards = monsters
.Where(card => card?.Data != null && card.IsFloodgate() && card.IsFaceup() && !card.IsShouldNotBeTarget())
.OrderBy(card => card.Attack).ToList();
List<ClientCard> dangerousCards = monsters
.Where(card => card?.Data != null && card.IsMonsterDangerous() && card.IsFaceup() && !card.IsShouldNotBeTarget())
.OrderBy(card => card.Attack).ToList();
List<ClientCard> attackOrderedCards = monsters
.Where(card => card?.Data != null && card.HasType(CardType.Monster) && card.IsFaceup() && card.IsShouldNotBeTarget())
.OrderBy(card => card.Attack).ToList();
targetList.AddRange(floodgateCards);
targetList.AddRange(dangerousCards);
targetList.AddRange(attackOrderedCards);
if (targetList?.Count > 0)
{
AI.SelectCard(targetList);
return true;
}
return false;
}
}
}
......@@ -34,7 +34,9 @@ namespace WindBot.Game.AI
[DataMember]
public string[] setmonster { get; set; }
[DataMember]
public string[] chaining { get; set; }
public string[] chaining { get; set; }
[DataMember]
public string[] custom { get; set; }
}
public class Dialogs
{
......@@ -53,7 +55,8 @@ namespace WindBot.Game.AI
private string[] _summon;
private string[] _setmonster;
private string[] _chaining;
private string[] _custom;
public Dialogs(GameClient game)
{
_game = game;
......@@ -75,6 +78,7 @@ namespace WindBot.Game.AI
_summon = data.summon;
_setmonster = data.setmonster;
_chaining = data.chaining;
_custom = data.custom;
}
}
......@@ -176,5 +180,14 @@ namespace WindBot.Game.AI
Logger.WriteLine("Error: " + message);
}
}
public void SendCustomChat(int index, params object[] opts)
{
if (!_game._chat || _custom == null)
return;
string message = string.Format(_custom[index], opts);
if (message != "")
_game.Chat(message);
}
}
}
......@@ -24,5 +24,7 @@
ZushintheSleepingGiant = 67547370,
Heart_eartHDragon = 97403510,
DaigustoSphreeze = 29552709,
OhimetheManifestedMikanko = 81260679,
ArahimetheManifestedMikanko = 75771170
}
}
......@@ -106,6 +106,110 @@
AdamancipatorRisenDragite = 9464441,
TeardroptheRikkaQueen = 33779875,
CeruleanSkyFire = 54828837,
SacredBeastAwakening = 53701259
SacredBeastAwakening = 53701259,
GrandSpiritualArtIchirin = 38057522,
DualAvatarFeetArmoredUnGyo = 7631534,
VirtualWorldKyubiShenshen = 92519087,
VirtualWorldGateChuche = 13364097,
DragunityKnightAreadbhair = 88234821,
AiwasstheMagistusSpellSpirit = 35877582,
OneirostheDreamMirrorErlking = 35187185,
PlunderPatrollshipBrann = 94253655,
PlunderPatrollshipMoerk = 20248754,
PlunderPatrollshipLys = 18832779,
HollowGiants = 15462014,
GrozaTyrantofThunder = 45420955,
SpringansCaptainSargas = 29601381,
S_ForceOrrafist = 95974848,
AncientWarriors_RebelliousLuFeng = 82791472,
OneirostheDreamMirrorTormentor = 37678339,
SacredTreeBeastHyperyton = 9349094,
S_ForceJustify = 35334193,
UnderworldGoddessoftheClosedWorld = 98127546,
VampireVoivode = 4918855,
NekrozofAreadbhair = 39468724,
NekrozofUnicore = 89463537,
BenghalancertheResurgent = 73345237,
UrsarcticSeptentrion = 53087962,
TheIrisSwordsoul = 62849088,
AntihumanIntelligenceME_PSY_YA = 58844135,
MagikeyMechmortar_Garesglasser = 45877457,
ShootingMajesticStarDragon = 40939228,
StellarWindWolfrayet = 3322931,
ChronomalyVimana = 2609443,
CyberdarknessDragon = 18967507,
ClearWingSynchroDragon = 82044279,
CrystalClearWingSynchroDragon = 59765225,
BaronnedeFleur = 84815190,
Lyrilusc_EnsemblueRobin = 72971064,
Number4StealthKragen = 67557908,
Floowandereeze_Snowl = 53212882,
Floowandereeze_Empen = 80611581,
MasqueradetheBlazingDragon = 6855503,
DestinyHERO_DestroyerPhoenixEnforcer = 60461804,
SwordsoulGrandmaster_Chixiao = 69248256,
ZoroatheMagistusConflagrantCalamity = 95911373,
MasterflareHyperion = 63101468,
FallenSanctuary = 90312154,
MyutantBeast = 34695290,
MyutantArsenal = 7574904,
MyutantUltimus = 6182103,
Underdog = 5779502,
IcejadeKosmochlor = 3355732,
IllusionofChaos = 12266229,
SwordsoulSinisterSovereign_QixingLongyuan = 47710198,
DDDDeviserKingDeusMachinex = 46593546,
IcejadeErosion = 46593546,
NordicRelicSvalinn = 64797746,
OceanDragonLord_Kairyu_Shin = 23931679,
MarincessAquaArgonaut = 20934852,
MirrorjadetheIcebladeDragon = 44146295,
WitchcrafterVice_Madame = 9603252,
Therion_King_Regulus = 10604644,
StarvingVenomPredapowerFusionDragon = 39915560,
DinomorphiaRexterm = 92798873,
ExosistersMagnifica = 59242457,
IcejadeCurse = 83670388,
MamonakatheVaylantzUnited = 40680521,
LabrynthLabyrinth = 33407125,
RunickFountain = 92107604,
SprightRed = 75922381,
SprightCarrot = 2311090,
RikkaKonkon = 76869711,
PowerToolBraverDragon = 63265554,
MagikeyDeity_Ashtartu = 26988374,
RainbowOverdragon = 37440988,
TheBystialAlbaLos = 69120785,
KashtiraFenrir = 32909498,
MitsutheInsectNinja = 67282505,
VeratheVernusylphGoddess = 55125728,
TearlamentsRulkallos = 84330567,
Black_WingedAssaultDragon = 73218989,
BrandedBeast = 32756828,
GraphaDragonOverlordofDarkWorld = 39552584,
EpurrelyBeauty = 98049934,
ExpurrelyNoir = 83827392,
BeetrooperScaleBomber = 39041550,
EvigishkiNeremanas = 88926295,
ArktosXII_ChronochasmVaylantz = 50687050,
IcejadeGymirAegirine = 86682165,
KashtiraArise_Heart = 48626373,
LaevateinGeneraiderBossofShadows = 74615388,
SynchroZone = 60306277,
BystialDisPater = 27572350,
DespianLuluwalilith = 53971455,
FirewallDragonSingularity = 21637210,
BrandedEtude = 45675980,
EvolzarLars = 35103106,
AltergeistAdminia = 61470213,
EmperorCharlesTheGreat = 97864322,
YouReFinished = 88346805,
VolcanicEmperor = 46412900,
VolcanicInferno = 84138874,
RedZone = 50056656,
TGGlaiveBlaster = 95973569,
StellarNemesisTPHON_DoomsdayStar = 93039339,
SPLittleKnight = 29301450,
AngelRing = 40678060
}
}
......@@ -51,9 +51,40 @@
FusionGate = 33550694,
DFusion = 26841274,
FusionDestiny = 52947044,
PyroxeneFusion = 55824220,
FragmentFusion = 72029628,
NecroFusion = 81223446,
PredaplantVerteAnaconda = 70369116,
DreamMirrorofChaos = 98570539,
PlunderPatrollShipshapeShipsShipping = 44227727,
FireFormationIngen = 29143457,
ParametalfoesFusion = 58549532,
ReadyFusion = 63854005,
BrandedinWhite = 34995106,
BrandedinRed = 82738008,
FaceCardFusion = 29062925,
MyutantFusion = 42577802,
MyutantCry = 31855260,
GreaterPolymerization = 7614732,
UltimateFusion = 71143015,
BrandedFusion = 44362883,
GhostFusion = 35705817,
WitchcrafterConfusionConfession = 35098357,
BrandedBanishment = 6763530,
DinomorphiaDomain = 26631975,
DinomorphiaFrenzy = 78420796,
SouloftheSupremeKing = 92428405,
InstantContact = 16169772,
ScatterFusion = 40597694,
FavoriteContact = 75047173,
AmazonessSecretArts = 86758746,
DarkWorldAccession = 65956182,
BeetrooperLanding = 13234975,
FusionReproduction = 43331750,
ChimeraFusion = 63136489,
HarmonicSynchroFusion = 7473735,
SouloftheSupremeCelestialKing = 76840111
}
}
......@@ -25,7 +25,11 @@
DaigustoSphreez = 29552709,
Number92HearteartHDragon = 97403510,
NumberC96DarkStorm = 77205367,
Number54LionHeart = 54366836
Number54LionHeart = 54366836,
Number2NinjaShadowMosquito = 32453837,
OhimetheManifestedMikanko = 81260679,
NightmareMagician = 40221691,
ArahimetheManifestedMikanko = 75771170
}
/// <summary>
/// Cards that are invincible to battle.
......@@ -93,6 +97,18 @@
GoukiTheGiantOgre = 47946130,
BorrelswordDragon = 85289965,
NumberF0UtopicFutureDragon = 26973555,
BorrelendDragon = 98630720
BorrelendDragon = 98630720,
MimickingMan_EaterBug = 72427512,
ShiningPiecephilia = 49776811,
BrigrandtheGloryDragon = 34848821,
AmazonessQueen = 15951532,
Number2NinjaShadowMosquito = 32453837,
OhimetheManifestedMikanko = 81260679,
CornfieldCoatl = 92565383,
MirrorSwordknight = 28954097,
NightmareMagician = 40221691,
ArahimetheManifestedMikanko = 75771170,
UFOLight = 9275482,
TaotheGreatChanter = 34541543
}
}
namespace WindBot.Game.AI.Enums
{
public enum NotBeSynchroMaterialMonster
{
Ronintoadin = 1357146,
GagagaCaesar = 9583383,
VagueShadowToken = 9929399,
TourGuideFromtheUnderworld = 10802915,
PhotonToken = 17418745,
KagemuchaKnight = 19353570,
SharkStickers = 20838380,
GagagaMagician = 26082117,
RadianToken = 28674153,
Kurivolt = 40817915,
BlueMountainButterspy = 54582424,
Lightserpent = 55501446,
SaberShark = 63193879,
ConstellarKaus = 70908596,
CeremonialToken = 82340057,
HeroicChallenger_DoubleLance = 89774530,
SteelswarmScout = 90727556,
Kagetokage = 94656263,
YellowDuston = 16366810,
BlueDuston = 40217358,
Centerfrog = 47346782,
GreenDuston = 52182715,
RedDuston = 61019812,
EaterofMillions = 63845230,
PutridPuddingBodyBuddies = 85101097,
Click_Echo = 2992467
}
}
\ No newline at end of file
namespace WindBot.Game.AI.Enums
{
public enum NotBeXyzMaterialMonster
{
YellowDuston = 16366810,
BlueDuston = 40217358,
Centerfrog = 47346782,
GreenDuston = 52182715,
RedDuston = 61019812,
EaterofMillions = 63845230,
PutridPuddingBodyBuddies = 85101097,
Click_Echo = 2992467
}
}
\ No newline at end of file
......@@ -11,5 +11,10 @@
SamuraiDestroyer = 40509732,
ArmadesKeeperOfBoundaries = 88033975,
NumberS39UtopiaTheLightning = 56832966,
DualAvatarEmpoweredKonGyo = 33026283,
GGolemRockHammer = 98875863,
WishDragon = 64583600,
ChaosWitch = 30327674,
FissioningMotherSpider = 34034150
}
}
......@@ -56,6 +56,13 @@
ShiranuiSolitaire = 94801854,
Mixeroid = 71340250,
LonefireBlossom = 48686504,
BrotherhoodoftheFireFist_Leopard = 39699564
BrotherhoodoftheFireFist_Leopard = 39699564,
SpringansPedor = 56818977,
GizmekNaganakitheSunriseSignaler = 96399967,
MyutantMutant = 26561172,
ThreeEyedGhost = 31464658,
UrsarcticPolarStar = 62714453,
BattlinBoxerPromoter = 83315222,
TGRocketSalamander = 77392987
}
}
......@@ -14,6 +14,8 @@
PaleozoicAnomalocaris = 61307542,
PaleozoicOpabinia = 37649320,
BorreloadDragon = 31833038,
BorrelendDragon = 98630720
BorrelendDragon = 98630720,
DrytronMeteonisDraconids = 69815951,
MyutantBeast = 34695290
}
}
......@@ -9,6 +9,7 @@
ApoqliphortTowers = 27279764,
ApoqliphortSkybase = 40061558,
TheLegendaryFishermanIII = 44968687,
ChaosAncientGearGiant = 51788412
ChaosAncientGearGiant = 51788412,
DrytronMeteonisQuadrantids = 95209656
}
}
......@@ -22,6 +22,7 @@ namespace WindBot.Game.AI
protected ExecutorType Type { get; private set; }
protected ClientCard Card { get; private set; }
protected int ActivateDescription { get; private set; }
protected int CurrentTiming { get; private set; }
protected ClientField Bot { get; private set; }
protected ClientField Enemy { get; private set; }
......@@ -165,6 +166,7 @@ namespace WindBot.Game.AI
// For overriding
return null;
}
public virtual void OnSelectChain(IList<ClientCard> cards)
{
return;
......@@ -232,11 +234,12 @@ namespace WindBot.Game.AI
/// <summary>
/// Set global variables Type, Card, ActivateDescription for Executor
/// </summary>
public void SetCard(ExecutorType type, ClientCard card, int description)
public void SetCard(ExecutorType type, ClientCard card, int description, int timing = -1)
{
Type = type;
Card = card;
ActivateDescription = description;
CurrentTiming = timing;
}
/// <summary>
......
......@@ -18,8 +18,10 @@ namespace WindBot.Game
public BattlePhase BattlePhase { get; set; }
public int LastChainPlayer { get; set; }
public CardLocation LastChainLocation { get; set; }
public IList<ClientCard> CurrentChain { get; set; }
public IList<ClientCard> ChainTargets { get; set; }
public IList<ClientCard> LastChainTargets { get; set; }
public IList<ClientCard> ChainTargetOnly { get; set; }
public int LastSummonPlayer { get; set; }
public IList<ClientCard> SummoningCards { get; set; }
......@@ -31,8 +33,10 @@ namespace WindBot.Game
Fields[0] = new ClientField();
Fields[1] = new ClientField();
LastChainPlayer = -1;
LastChainLocation = 0;
CurrentChain = new List<ClientCard>();
ChainTargets = new List<ClientCard>();
LastChainTargets = new List<ClientCard>();
ChainTargetOnly = new List<ClientCard>();
LastSummonPlayer = -1;
SummoningCards = new List<ClientCard>();
......
......@@ -54,6 +54,14 @@ namespace WindBot.Game
_dialogs.SendDuelStart();
}
/// <summary>
/// Customized called when the AI do something in a duel.
/// </summary>
public void SendCustomChat(int index, params object[] opts)
{
_dialogs.SendCustomChat(index, opts);
}
/// <summary>
/// Called when the AI do the rock-paper-scissors.
/// </summary>
......@@ -301,8 +309,9 @@ namespace WindBot.Game
/// <param name="cards">List of activable cards.</param>
/// <param name="descs">List of effect descriptions.</param>
/// <param name="forced">You can't return -1 if this param is true.</param>
/// <param name="timing">Current hint timing</param>
/// <returns>Index of the activated card or -1.</returns>
public int OnSelectChain(IList<ClientCard> cards, IList<int> descs, bool forced)
public int OnSelectChain(IList<ClientCard> cards, IList<int> descs, bool forced, int timing = -1)
{
Executor.OnSelectChain(cards);
foreach (CardExecutor exec in Executor.Executors)
......@@ -310,7 +319,7 @@ namespace WindBot.Game
for (int i = 0; i < cards.Count; ++i)
{
ClientCard card = cards[i];
if (ShouldExecute(exec, card, ExecutorType.Activate, descs[i]))
if (ShouldExecute(exec, card, ExecutorType.Activate, descs[i], timing))
{
_dialogs.SendChaining(card.Name);
return i;
......@@ -1113,7 +1122,7 @@ namespace WindBot.Game
return new BattlePhaseAction(BattlePhaseAction.BattleAction.ToMainPhaseTwo);
}
private bool ShouldExecute(CardExecutor exec, ClientCard card, ExecutorType type, int desc = -1)
private bool ShouldExecute(CardExecutor exec, ClientCard card, ExecutorType type, int desc = -1, int timing = -1)
{
if (card.Id != 0 && type == ExecutorType.Activate)
{
......@@ -1122,7 +1131,7 @@ namespace WindBot.Game
if (!Executor.OnPreActivate(card))
return false;
}
Executor.SetCard(type, card, desc);
Executor.SetCard(type, card, desc, timing);
bool result = card != null && exec.Type == type &&
(exec.CardId == -1 || exec.CardId == card.Id) &&
(exec.Func == null || exec.Func());
......
......@@ -777,7 +777,8 @@ namespace WindBot.Game
card.SetId(cardId);
int cc = GetLocalPlayer(packet.ReadByte());
if (_debug)
if (card != null) Logger.WriteLine("(" + cc.ToString() + " 's " + (card.Name ?? "UnKnowCard") + " activate effect)");
if (card != null) Logger.WriteLine("(" + cc.ToString() + " 's " + (card.Name ?? "UnKnowCard") + " activate effect from " + (CardLocation)pcl + ")");
_duel.LastChainLocation = (CardLocation)pcl;
_ai.OnChaining(card, cc);
//_duel.ChainTargets.Clear();
_duel.ChainTargetOnly.Clear();
......@@ -791,8 +792,10 @@ namespace WindBot.Game
{
_ai.OnChainEnd();
_duel.LastChainPlayer = -1;
_duel.LastChainLocation = 0;
_duel.CurrentChain.Clear();
_duel.ChainTargets.Clear();
_duel.LastChainTargets.Clear();
_duel.ChainTargetOnly.Clear();
}
......@@ -905,6 +908,7 @@ namespace WindBot.Game
private void OnBecomeTarget(BinaryReader packet)
{
_duel.LastChainTargets.Clear();
int count = packet.ReadByte();
for (int i = 0; i < count; ++i)
{
......@@ -917,6 +921,7 @@ namespace WindBot.Game
if (_debug)
Logger.WriteLine("(" + (CardLocation)loc + " 's " + (card.Name ?? "UnKnowCard") + " become target)");
_duel.ChainTargets.Add(card);
_duel.LastChainTargets.Add(card);
_duel.ChainTargetOnly.Add(card);
}
}
......@@ -1122,7 +1127,7 @@ namespace WindBot.Game
packet.ReadByte(); // specount
bool forced = packet.ReadByte() != 0;
packet.ReadInt32(); // hint1
packet.ReadInt32(); // hint2
int hint2 = packet.ReadInt32(); // hint2
IList<ClientCard> cards = new List<ClientCard>();
IList<int> descs = new List<int>();
......@@ -1162,7 +1167,7 @@ namespace WindBot.Game
return;
}
Connection.Send(CtosMessage.Response, _ai.OnSelectChain(cards, descs, forced));
Connection.Send(CtosMessage.Response, _ai.OnSelectChain(cards, descs, forced, hint2));
}
private void OnSelectCounter(BinaryReader packet)
......@@ -1803,7 +1808,7 @@ namespace WindBot.Game
int count = packet.ReadByte();
int available = packet.ReadInt32();
int filter = 0x1;
for (int i = 0; i < 23; ++i)
for (int i = 0; i < 26; ++i)
{
if ((available & filter) != 0)
races.Add((CardRace)filter);
......
......@@ -75,6 +75,7 @@
<Compile Include="Game\AI\Decks\BraveExecutor.cs" />
<Compile Include="Game\AI\Decks\FamiliarPossessedExecutor.cs" />
<Compile Include="Game\AI\Decks\BlackwingExecutor.cs" />
<Compile Include="Game\AI\Decks\ExosisterExecutor.cs" />
<Compile Include="Game\AI\Decks\KashtiraExecutor.cs" />
<Compile Include="Game\AI\Decks\LuckyExecutor.cs" />
<Compile Include="Game\AI\Decks\MathMechExecutor.cs" />
......@@ -108,6 +109,7 @@
<Compile Include="Game\AI\Decks\PhantasmExecutor.cs" />
<Compile Include="Game\AI\Decks\QliphortExecutor.cs" />
<Compile Include="Game\AI\Decks\ST1732Executor.cs" />
<Compile Include="Game\AI\Decks\SwordsoulExecutor.cs" />
<Compile Include="Game\AI\Decks\TrickstarExecutor.cs" />
<Compile Include="Game\AI\Decks\WitchcraftExecutor.cs" />
<Compile Include="Game\AI\Decks\YosenjuExecutor.cs" />
......@@ -117,12 +119,15 @@
<Compile Include="Game\AI\Decks\DoEveryThingExecutor.cs" />
<Compile Include="Game\AI\Decks\OldSchoolExecutor.cs" />
<Compile Include="Game\AI\Decks\Rank5Executor.cs" />
<Compile Include="Game\AI\Decks\ZefraExecutor.cs" />
<Compile Include="Game\AI\Decks\ZoodiacExecutor.cs" />
<Compile Include="Game\AI\Decks\ZexalWeaponsExecutor.cs" />
<Compile Include="Game\AI\DefaultExecutor.cs" />
<Compile Include="Game\AI\Dialogs.cs" />
<Compile Include="Game\AI\Enums\DangerousMonster.cs" />
<Compile Include="Game\AI\Enums\FusionSpell.cs" />
<Compile Include="Game\AI\Enums\NotBeSynchroMaterialMonster.cs" />
<Compile Include="Game\AI\Enums\NotBeXyzMaterialMonster.cs" />
<Compile Include="Game\AI\Enums\ShouldBeDisabledBeforeItUseEffectMonster.cs" />
<Compile Include="Game\AI\Enums\ShouldNotBeSpellTarget.cs" />
<Compile Include="Game\AI\Enums\ShouldNotBeMonsterTarget.cs" />
......
......@@ -26,7 +26,7 @@ namespace WindBot
Host = "127.0.0.1";
Port = 7911;
HostInfo = "";
Version = 0x1354;
Version = 0x1360;
Hand = 0;
Debug = false;
Chat = true;
......
......@@ -35,6 +35,56 @@
"deck": "Level VIII",
"dialog": "swordsman.zh-CN"
},
{
"name": "谜之剑士LV4",
"deck": "Level VIII",
"dialog": "swordsman.zh-CN"
},
{
"name": "我太帅了",
"deck": "Dragun",
"dialog": "smart.zh-CN"
},
{
"name": "我太帅了",
"deck": "Brave",
"dialog": "smart.zh-CN"
},
{
"name": "我太帅了",
"deck": "Brave",
"dialog": "smart.zh-CN"
},
{
"name": "玻璃女巫",
"deck": "Witchcraft",
"dialog": "verre.zh-CN"
},
{
"name": "玻璃女巫",
"deck": "Exosister",
"dialog": "verre.zh-CN"
},
{
"name": "玻璃女巫",
"deck": "Exosister",
"dialog": "verre.zh-CN"
},
{
"name": "玻璃女巫",
"deck": "Exosister",
"dialog": "verre.zh-CN"
},
{
"name": "复制植物",
"deck": "Blue-Eyes",
"dialog": "copy.zh-CN"
},
{
"name": "复制植物",
"deck": "Blue-Eyes",
"dialog": "copy.zh-CN"
},
{
"name": "复制植物",
"deck": "Zoodiac",
......@@ -235,6 +285,26 @@
"name": "神数不神",
"deck": "Tearlaments",
"dialog": "Zefra.zh-CN"
},
{
"name": "神数不神",
"deck": "Zefra",
"dialog": "Zefra.zh-CN"
},
{
"name": "艾克莉西娅",
"deck": "Swordsoul",
"dialog": "ecclesia.zh-CN"
},
{
"name": "艾克莉西娅",
"deck": "Swordsoul",
"dialog": "ecclesia.zh-CN"
},
{
"name": "艾克莉西娅",
"deck": "Swordsoul",
"dialog": "ecclesia.zh-CN"
}
]
}
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