Commit 1348ee44 authored by mercury233's avatar mercury233

add DeckFile param

parent 972f4135
...@@ -44,7 +44,7 @@ namespace WindBot.Game ...@@ -44,7 +44,7 @@ namespace WindBot.Game
_ai = new GameAI(Game, _duel); _ai = new GameAI(Game, _duel);
_ai.Executor = DecksManager.Instantiate(_ai, _duel); _ai.Executor = DecksManager.Instantiate(_ai, _duel);
Deck = Deck.Load(_ai.Executor.Deck); Deck = Deck.Load(Game.DeckFile ?? _ai.Executor.Deck);
_select_hint = 0; _select_hint = 0;
} }
......
...@@ -13,6 +13,7 @@ namespace WindBot.Game ...@@ -13,6 +13,7 @@ namespace WindBot.Game
public YGOClient Connection { get; private set; } public YGOClient Connection { get; private set; }
public string Username; public string Username;
public string Deck; public string Deck;
public string DeckFile;
public string Dialog; public string Dialog;
public int Hand; public int Hand;
public bool Debug; public bool Debug;
...@@ -29,6 +30,7 @@ namespace WindBot.Game ...@@ -29,6 +30,7 @@ namespace WindBot.Game
{ {
Username = Info.Name; Username = Info.Name;
Deck = Info.Deck; Deck = Info.Deck;
DeckFile = Info.DeckFile;
Dialog = Info.Dialog; Dialog = Info.Dialog;
Hand = Info.Hand; Hand = Info.Hand;
Debug = Info.Debug; Debug = Info.Debug;
......
...@@ -68,6 +68,7 @@ namespace WindBot ...@@ -68,6 +68,7 @@ namespace WindBot
WindBotInfo Info = new WindBotInfo(); WindBotInfo Info = new WindBotInfo();
Info.Name = Config.GetString("Name", Info.Name); Info.Name = Config.GetString("Name", Info.Name);
Info.Deck = Config.GetString("Deck", Info.Deck); Info.Deck = Config.GetString("Deck", Info.Deck);
Info.DeckFile = Config.GetString("DeckFile", Info.DeckFile);
Info.Dialog = Config.GetString("Dialog", Info.Dialog); Info.Dialog = Config.GetString("Dialog", Info.Dialog);
Info.Host = Config.GetString("Host", Info.Host); Info.Host = Config.GetString("Host", Info.Host);
Info.Port = Config.GetInt("Port", Info.Port); Info.Port = Config.GetInt("Port", Info.Port);
...@@ -104,6 +105,9 @@ namespace WindBot ...@@ -104,6 +105,9 @@ namespace WindBot
string port = HttpUtility.ParseQueryString(RawUrl).Get("port"); string port = HttpUtility.ParseQueryString(RawUrl).Get("port");
if (port != null) if (port != null)
Info.Port = Int32.Parse(port); Info.Port = Int32.Parse(port);
string deckfile = HttpUtility.ParseQueryString(RawUrl).Get("deckfile");
if (deckfile != null)
Info.DeckFile = deckfile;
string dialog = HttpUtility.ParseQueryString(RawUrl).Get("dialog"); string dialog = HttpUtility.ParseQueryString(RawUrl).Get("dialog");
if (dialog != null) if (dialog != null)
Info.Dialog = dialog; Info.Dialog = dialog;
......
...@@ -20,6 +20,11 @@ The nickname for the bot. ...@@ -20,6 +20,11 @@ The nickname for the bot.
`Deck` `Deck`
The deck to be used by the bot. Available decks are listed below. Keep empty to use random deck. The deck to be used by the bot. Available decks are listed below. Keep empty to use random deck.
`DeckFile`
The deck file (.ydk) to be used by the bot. Will be set by `Deck` automatically, but you can override it.
Note: Most cards not in the original deck are unknown to the bot, and won't be summoned or activated in the duel.
`Dialog` `Dialog`
The dialog texts to be used by the bot. See Dialogs folder for list. The dialog texts to be used by the bot. See Dialogs folder for list.
......
...@@ -6,6 +6,7 @@ namespace WindBot ...@@ -6,6 +6,7 @@ namespace WindBot
{ {
public string Name { get; set; } public string Name { get; set; }
public string Deck { get; set; } public string Deck { get; set; }
public string DeckFile { get; set; }
public string Dialog { get; set; } public string Dialog { get; set; }
public string Host { get; set; } public string Host { get; set; }
public int Port { get; set; } public int Port { get; set; }
...@@ -18,6 +19,7 @@ namespace WindBot ...@@ -18,6 +19,7 @@ namespace WindBot
{ {
Name = "WindBot"; Name = "WindBot";
Deck = null; Deck = null;
DeckFile = null;
Dialog = "default"; Dialog = "default";
Host = "127.0.0.1"; Host = "127.0.0.1";
Port = 7911; Port = 7911;
......
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