Commit 40bbe8bf authored by mercury233's avatar mercury233

add deck level to make random deck works better

parent b9dac6e5
......@@ -7,14 +7,16 @@ namespace WindBot.Game.AI
{
public string Name { get; private set; }
public string File { get; private set; }
public string Level { get; private set; }
public DeckAttribute(string name, string file = null)
public DeckAttribute(string name, string file = null, string level = "Normal")
{
if (String.IsNullOrEmpty(file))
file = name;
Name = name;
File = file;
Level = level;
}
}
}
......@@ -7,7 +7,7 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
// NOT FINISHED YET
[Deck("Blackwing", "AI_Blackwing")]
[Deck("Blackwing", "AI_Blackwing", "NotFinished")]
public class BlackwingExecutor : DefaultExecutor
{
public enum CardId
......
......@@ -6,7 +6,7 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("Burn", "AI_Burn")]
[Deck("Burn", "AI_Burn", "Easy")]
public class BurnExecutor : DefaultExecutor
{
public enum CardId
......
......@@ -7,7 +7,7 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
// NOT FINISHED YET
[Deck("CyberDragon", "AI_CyberDragon")]
[Deck("CyberDragon", "AI_CyberDragon", "NotFinished")]
public class CyberDragonExecutor : DefaultExecutor
{
bool PowerBondUsed = false;
......
......@@ -6,7 +6,7 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("Test", "AI_Test")]
[Deck("Test", "AI_Test", "Test")]
public class DoEverythingExecutor : DefaultExecutor
{
public enum CardId
......
......@@ -7,7 +7,7 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
// NOT FINISHED YET
[Deck("Evilswarm", "AI_Evilswarm")]
[Deck("Evilswarm", "AI_Evilswarm", "NotFinished")]
public class EvilswarmExecutor : DefaultExecutor
{
public enum CardId
......
......@@ -6,7 +6,7 @@ using YGOSharp.OCGWrapper.Enums;
namespace WindBot.Game.AI.Decks
{
[Deck("Frog", "AI_Frog")]
[Deck("Frog", "AI_Frog", "Easy")]
public class FrogExecutor : DefaultExecutor
{
public enum CardId
......
......@@ -7,7 +7,7 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
// NOT FINISHED YET
[Deck("Gravekeeper", "AI_Gravekeeper")]
[Deck("Gravekeeper", "AI_Gravekeeper", "NotFinished")]
public class GravekeeperExecutor : DefaultExecutor
{
public enum CardId
......
......@@ -7,7 +7,7 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
// NOT FINISHED YET
[Deck("Graydle", "AI_Graydle")]
[Deck("Graydle", "AI_Graydle", "NotFinished")]
public class GraydleExecutor : DefaultExecutor
{
public enum CardId
......
......@@ -6,7 +6,7 @@ using YGOSharp.OCGWrapper.Enums;
namespace WindBot.Game.AI.Decks
{
[Deck("Horus", "AI_Horus")]
[Deck("Horus", "AI_Horus", "Easy")]
public class HorusExecutor : DefaultExecutor
{
public enum CardId
......
......@@ -7,7 +7,7 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
// NOT FINISHED YET
[Deck("Lightsworn", "AI_Lightsworn")]
[Deck("Lightsworn", "AI_Lightsworn", "NotFinished")]
public class LightswornExecutor : DefaultExecutor
{
public enum CardId
......
......@@ -6,7 +6,7 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("MokeyMokey", "AI_MokeyMokey")]
[Deck("MokeyMokey", "AI_MokeyMokey", "Easy")]
public class MokeyMokeyExecutor : DefaultExecutor
{
public enum CardId
......
......@@ -6,7 +6,7 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("MokeyMokeyKing", "AI_MokeyMokeyKing")]
[Deck("MokeyMokeyKing", "AI_MokeyMokeyKing", "Easy")]
public class MokeyMokeyKingExecutor : DefaultExecutor
{
public enum CardId
......
......@@ -7,7 +7,7 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
// NOT FINISHED YET
[Deck("Nekroz", "AI_Nekroz")]
[Deck("Nekroz", "AI_Nekroz", "NotFinished")]
public class NekrozExecutor : DefaultExecutor
{
public enum CardId
......
......@@ -6,7 +6,7 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("OldSchool", "AI_OldSchool")]
[Deck("OldSchool", "AI_OldSchool", "Easy")]
public class OldSchoolExecutor : DefaultExecutor
{
public enum CardId
......
......@@ -6,7 +6,7 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("ST1732", "AI_ST1732")]
[Deck("ST1732", "AI_ST1732", "Easy")]
public class ST1732Executor : DefaultExecutor
{
public enum CardId
......
......@@ -6,7 +6,7 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("Toadally Awesome", "AI_ToadallyAwesome")]
[Deck("Toadally Awesome", "AI_ToadallyAwesome", "OutDated")]
public class ToadallyAwesomeExecutor : DefaultExecutor
{
public enum CardId
......
......@@ -6,7 +6,7 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("Zoodiac", "AI_Zoodiac")]
[Deck("Zoodiac", "AI_Zoodiac", "OutDated")]
class ZoodiacExecutor : DefaultExecutor
{
public enum CardId
......
......@@ -10,11 +10,13 @@ namespace WindBot.Game.AI
{
public string Deck { get; private set; }
public Type Type { get; private set; }
public string Level { get; private set; }
public DeckInstance(string deck, Type type)
public DeckInstance(string deck, Type type, string level)
{
Deck = deck;
Type = type;
Level = level;
}
}
......@@ -39,7 +41,7 @@ namespace WindBot.Game.AI
if (attribute is DeckAttribute)
{
DeckAttribute deck = (DeckAttribute)attribute;
_decks.Add(deck.Name, new DeckInstance(deck.File, type));
_decks.Add(deck.Name, new DeckInstance(deck.File, type, deck.Level));
}
}
}
......@@ -59,7 +61,13 @@ namespace WindBot.Game.AI
if (deck != null && _decks.ContainsKey(deck))
infos = _decks[deck];
else
{
do
{
infos = _list[_rand.Next(_list.Count)];
}
while (infos.Level != "Normal");
}
Executor executor = (Executor)Activator.CreateInstance(infos.Type, ai, duel);
executor.Deck = infos.Deck;
......
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