Commit 9521f927 authored by mercury233's avatar mercury233

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

parents d5ee2352 36018614
...@@ -89,6 +89,11 @@ Name=奇異果 Deck=LightswornShaddoldinosour Dialog=kiwi.zh-TW ...@@ -89,6 +89,11 @@ Name=奇異果 Deck=LightswornShaddoldinosour Dialog=kiwi.zh-TW
光道影依恐龙卡组。 光道影依恐龙卡组。
SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
!奇魔果
Name=奇魔果 Deck=DarkMagician Dialog=kiwi.zh-TW
黑魔术师卡组。
SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
!燃血鬥士 !燃血鬥士
Name=燃血鬥士 Deck=ChainBurn Dialog=kiwi.zh-TW Name=燃血鬥士 Deck=ChainBurn Dialog=kiwi.zh-TW
连锁烧卡组。 连锁烧卡组。
......
#created by ... #created by ...
#main #main
33015627
33015627
33015627
7733560
7733560
7733560
41386308 41386308
3549275 3549275
45812361 45812361
...@@ -50,19 +56,16 @@ ...@@ -50,19 +56,16 @@
75249652 75249652
75249652 75249652
83555666 83555666
98444741
#extra #extra
41999284 41999284
41999284 41999284
41999284 41999284
!side !side
33508719 33508719
36468556
67095270 67095270
67095270 67095270
67095270 67095270
98444741 98444741
100227025 98444741
100227025 98444741
100227025
36468556
98444741
\ No newline at end of file
...@@ -11,8 +11,8 @@ namespace WindBot.Game.AI.Decks ...@@ -11,8 +11,8 @@ namespace WindBot.Game.AI.Decks
{ {
public class CardId public class CardId
{ {
public const int SandaionTheTimelord = 100227025; public const int SandaionTheTimelord = 33015627;
public const int MichionTimelord = 100227021; public const int MichionTimelord = 7733560;
public const int Mathematician = 41386308; public const int Mathematician = 41386308;
public const int DiceJar = 3549275; public const int DiceJar = 3549275;
public const int CardcarD = 45812361; public const int CardcarD = 45812361;
......
...@@ -90,6 +90,7 @@ namespace WindBot.Game ...@@ -90,6 +90,7 @@ namespace WindBot.Game
_messages.Add(GameMessage.ShuffleDeck, OnShuffleDeck); _messages.Add(GameMessage.ShuffleDeck, OnShuffleDeck);
_messages.Add(GameMessage.ShuffleHand, OnShuffleHand); _messages.Add(GameMessage.ShuffleHand, OnShuffleHand);
_messages.Add(GameMessage.ShuffleExtra, OnShuffleExtra); _messages.Add(GameMessage.ShuffleExtra, OnShuffleExtra);
_messages.Add(GameMessage.ShuffleSetCard, OnShuffleSetCard);
_messages.Add(GameMessage.TagSwap, OnTagSwap); _messages.Add(GameMessage.TagSwap, OnTagSwap);
_messages.Add(GameMessage.NewTurn, OnNewTurn); _messages.Add(GameMessage.NewTurn, OnNewTurn);
_messages.Add(GameMessage.NewPhase, OnNewPhase); _messages.Add(GameMessage.NewPhase, OnNewPhase);
...@@ -109,7 +110,7 @@ namespace WindBot.Game ...@@ -109,7 +110,7 @@ namespace WindBot.Game
_messages.Add(GameMessage.BecomeTarget, OnBecomeTarget); _messages.Add(GameMessage.BecomeTarget, OnBecomeTarget);
_messages.Add(GameMessage.SelectBattleCmd, OnSelectBattleCmd); _messages.Add(GameMessage.SelectBattleCmd, OnSelectBattleCmd);
_messages.Add(GameMessage.SelectCard, OnSelectCard); _messages.Add(GameMessage.SelectCard, OnSelectCard);
_messages.Add(GameMessage.SelectUnselectCard, OnSelectUnselectCard); _messages.Add(GameMessage.SelectUnselect, OnSelectUnselectCard);
_messages.Add(GameMessage.SelectChain, OnSelectChain); _messages.Add(GameMessage.SelectChain, OnSelectChain);
_messages.Add(GameMessage.SelectCounter, OnSelectCounter); _messages.Add(GameMessage.SelectCounter, OnSelectCounter);
_messages.Add(GameMessage.SelectDisfield, OnSelectDisfield); _messages.Add(GameMessage.SelectDisfield, OnSelectDisfield);
...@@ -389,6 +390,35 @@ namespace WindBot.Game ...@@ -389,6 +390,35 @@ namespace WindBot.Game
} }
} }
private void OnShuffleSetCard(BinaryReader packet)
{
int location = packet.ReadByte();
int count = packet.ReadByte();
ClientCard[] list = new ClientCard[5];
for (int i = 0; i < count; ++i)
{
int player = GetLocalPlayer(packet.ReadByte());
int loc = packet.ReadByte();
int seq = packet.ReadByte();
/*int sseq = */packet.ReadByte();
ClientCard card = _duel.GetCard(player, (CardLocation)loc, seq);
if (card == null) continue;
list[i] = card;
card.SetId(0);
}
for (int i = 0; i < count; ++i)
{
int player = GetLocalPlayer(packet.ReadByte());
int loc = packet.ReadByte();
int seq = packet.ReadByte();
/*int sseq = */packet.ReadByte();
ClientCard card = _duel.GetCard(player, (CardLocation)loc, seq);
if (card == null) continue;
ClientCard[] zone = (loc == (int)CardLocation.MonsterZone) ? _duel.Fields[player].MonsterZone : _duel.Fields[player].SpellZone;
zone[seq] = list[i];
}
}
private void OnTagSwap(BinaryReader packet) private void OnTagSwap(BinaryReader packet)
{ {
int player = GetLocalPlayer(packet.ReadByte()); int player = GetLocalPlayer(packet.ReadByte());
...@@ -433,8 +463,18 @@ namespace WindBot.Game ...@@ -433,8 +463,18 @@ namespace WindBot.Game
{ {
Logger.WriteLine(card.Name); Logger.WriteLine(card.Name);
} }
Logger.WriteLine("*********Bot Hand*********"); Logger.WriteLine("*********Bot Spell*********");
} foreach (ClientCard card in _duel.Fields[0].SpellZone)
{
Logger.WriteLine(card?.Name);
}
Logger.WriteLine("*********Bot Monster*********");
foreach (ClientCard card in _duel.Fields[0].MonsterZone)
{
Logger.WriteLine(card?.Name);
}
Logger.WriteLine("*********Finish*********");
}
if (_debug) if (_debug)
Logger.WriteLine("(Go to " + (_duel.Phase.ToString()) + ")"); Logger.WriteLine("(Go to " + (_duel.Phase.ToString()) + ")");
_duel.LastSummonPlayer = -1; _duel.LastSummonPlayer = -1;
......
...@@ -38,6 +38,12 @@ The version of YGOPro. ...@@ -38,6 +38,12 @@ The version of YGOPro.
`Hand` `Hand`
If you are testing deck, you may want to make sure the bot go first or second. `Hand=1` will make the bot always show Scissors, 2 for Rock, 3 for Paper. If you are testing deck, you may want to make sure the bot go first or second. `Hand=1` will make the bot always show Scissors, 2 for Rock, 3 for Paper.
`Chat`
False to turn the chat of bot off.
`Debug`
Print verbose log of card movement info. False at default. (May be updated in future)
`ServerMode` and `ServerPort` `ServerMode` and `ServerPort`
WindBot can run as a "server", provide a http interface to create bot. WindBot can run as a "server", provide a http interface to create bot.
...@@ -61,6 +67,10 @@ WindBot can run as a "server", provide a http interface to create bot. ...@@ -61,6 +67,10 @@ WindBot can run as a "server", provide a http interface to create bot.
* Blue-Eyes * Blue-Eyes
* ChainBurn
* DarkMagician
* Dragunity * Dragunity
* Qliphort * Qliphort
...@@ -69,6 +79,8 @@ WindBot can run as a "server", provide a http interface to create bot. ...@@ -69,6 +79,8 @@ WindBot can run as a "server", provide a http interface to create bot.
* Rank V * Rank V
* SkyStriker
* ST1732 * ST1732
* Toadally Awesome (old lflist, master rule 3 only) * Toadally Awesome (old lflist, master rule 3 only)
...@@ -85,8 +97,6 @@ WindBot can run as a "server", provide a http interface to create bot. ...@@ -85,8 +97,6 @@ WindBot can run as a "server", provide a http interface to create bot.
* Blackwing * Blackwing
* ChainBurn
* CyberDragon * CyberDragon
* Evilswarm * Evilswarm
...@@ -117,6 +127,23 @@ The parameters are same as commandlines, but low cased. ...@@ -117,6 +127,23 @@ The parameters are same as commandlines, but low cased.
### Changelog ### Changelog
#### v0x1344 (2018-06-05)
- Update YGOPro protrol to 0x1344
- New decks: DarkMagician, SkyStriker
- Add param to turn chat off
- Add param to print verbose log
- Add part of `Zones` enum and `AI.SelectPlace`
- Add `ClientCard.IsTuner`, `ClientCard.LinkMarker`, `ClientCard.HasLinkMarker`
- Add `ShouldNotBeTarget` and `ShouldBeDisabledBeforeItUseEffectMonster` enum
- Add `AI.Utils.GetBestBotMonster`, `AI.Utils.GetWorstBotMonster` and `AI.Utils.ChainContainPlayer`
- Add `Executor.OnCardSorting` and `Executor.OnDraw`
- Add `ClientField.GetColumnCount` and `ClientField.HasInHandOrInSpellZone` etc.
- Misc updates to LightswornShaddoldinosour and ChainBurn deck
- Misc updates to default executors
- Fix OnSelectUnselectCard
- Fix OnMove to keep card data when moving
#### v0x1343 (2018-04-11) #### v0x1343 (2018-04-11)
- Update YGOPro protrol to 0x1343 - Update YGOPro protrol to 0x1343
...@@ -185,7 +212,7 @@ The parameters are same as commandlines, but low cased. ...@@ -185,7 +212,7 @@ The parameters are same as commandlines, but low cased.
* Documents for creating AI * Documents for creating AI
* `AI.SelectZone` * `AI.SelectPlace` for linked zones or not linked zones
* `AI.SelectTribute` * `AI.SelectTribute`
......
...@@ -22,7 +22,7 @@ namespace WindBot ...@@ -22,7 +22,7 @@ namespace WindBot
Host = "127.0.0.1"; Host = "127.0.0.1";
Port = 7911; Port = 7911;
HostInfo = ""; HostInfo = "";
Version = 0x1343; Version = 0x1344;
Hand = 0; Hand = 0;
Debug = false; Debug = false;
Chat = true; Chat = true;
......
No preview for this file type
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