Commit 34dd165e authored by wind2009's avatar wind2009 Committed by GitHub

AI_Dogmatika (#173)

parent 4c5989bc
#created by ...
#main
51522296
51522296
62849088
69680031
69680031
95679145
72270339
60303688
60303688
60303688
14558127
14558127
14558127
23434538
23434538
23434538
10158145
10158145
10158145
1984618
1984618
1984618
31002402
60921537
16240772
24224830
24224830
65681983
80845034
80845034
80845034
35569555
35569555
35569555
10045474
10045474
10045474
82956214
82956214
82956214
#extra
24915933
41373230
11765832
11765832
80532587
80532587
80532587
53971455
53971455
74586817
79606837
93039339
2220237
24842059
60303245
!side
\ No newline at end of file
{ {
"welcome": [ "welcome": [
"这里就是大灵峰吗?" "这里就是大灵峰吗?",
"这里是教导龙国。"
], ],
"deckerror": [ "deckerror": [
"{0}被冰水咒缚了!" "{0}被冰水咒缚了!"
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -113,6 +113,11 @@ namespace WindBot.Game.AI ...@@ -113,6 +113,11 @@ 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)
{
// Some AI need do something on card's moving
}
public virtual IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, int hint, bool cancelable) public virtual IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, int hint, bool cancelable)
{ {
// For overriding // For overriding
......
...@@ -119,6 +119,11 @@ namespace WindBot.Game ...@@ -119,6 +119,11 @@ namespace WindBot.Game
Executor.OnNewPhase(); Executor.OnNewPhase();
} }
public void OnMove(int cardId, int previousControler, int previousLocation, int currentControler, int currentLocation)
{
Executor.OnMove(cardId, previousControler, previousLocation, currentControler, currentLocation);
}
/// <summary> /// <summary>
/// Called when the AI got attack directly. /// Called when the AI got attack directly.
/// </summary> /// </summary>
......
...@@ -144,6 +144,7 @@ namespace WindBot.Game ...@@ -144,6 +144,7 @@ namespace WindBot.Game
_messages.Add(GameMessage.SpSummoned, OnSpSummoned); _messages.Add(GameMessage.SpSummoned, OnSpSummoned);
_messages.Add(GameMessage.FlipSummoning, OnSummoning); _messages.Add(GameMessage.FlipSummoning, OnSummoning);
_messages.Add(GameMessage.FlipSummoned, OnSummoned); _messages.Add(GameMessage.FlipSummoned, OnSummoned);
_messages.Add(GameMessage.ConfirmCards, OnConfirmCards);
} }
private void OnJoinGame(BinaryReader packet) private void OnJoinGame(BinaryReader packet)
...@@ -634,6 +635,8 @@ namespace WindBot.Game ...@@ -634,6 +635,8 @@ namespace WindBot.Game
(CardLocation)previousLocation + " move to " + (CardLocation)currentLocation + ")"); (CardLocation)previousLocation + " move to " + (CardLocation)currentLocation + ")");
} }
} }
_ai.OnMove(cardId, previousControler, previousLocation, currentControler, currentLocation);
} }
private void OnSwap(BinaryReader packet) private void OnSwap(BinaryReader packet)
...@@ -955,7 +958,10 @@ namespace WindBot.Game ...@@ -955,7 +958,10 @@ namespace WindBot.Game
if (((int)loc & (int)CardLocation.Overlay) != 0) if (((int)loc & (int)CardLocation.Overlay) != 0)
card = new ClientCard(id, CardLocation.Overlay, -1); card = new ClientCard(id, CardLocation.Overlay, -1);
else else
{
card = _duel.GetCard(player, loc, seq); card = _duel.GetCard(player, loc, seq);
card.Controller = player;
}
if (card == null) continue; if (card == null) continue;
if (card.Id == 0) if (card.Id == 0)
card.SetId(id); card.SetId(id);
...@@ -1891,5 +1897,22 @@ namespace WindBot.Game ...@@ -1891,5 +1897,22 @@ namespace WindBot.Game
} }
_duel.SummoningCards.Clear(); _duel.SummoningCards.Clear();
} }
private void OnConfirmCards(BinaryReader packet)
{
/*int playerid = */packet.ReadByte();
int count = packet.ReadByte();
for (int i = 0; i < count; ++ i)
{
int cardId = packet.ReadInt32();
int player = GetLocalPlayer(packet.ReadByte());
int loc = packet.ReadByte();
int seq = packet.ReadByte();
ClientCard card = _duel.GetCard(player, (CardLocation)loc, seq);
if (cardId > 0) card.SetId(cardId);
if (_debug)
Logger.WriteLine("(Confirm " + player.ToString() + "'s " + (CardLocation)loc + " card: " + (card.Name ?? "UnKnowCard") + ")");
}
}
} }
} }
...@@ -83,6 +83,7 @@ ...@@ -83,6 +83,7 @@
<Compile Include="Game\AI\Decks\SalamangreatExecutor.cs" /> <Compile Include="Game\AI\Decks\SalamangreatExecutor.cs" />
<Compile Include="Game\AI\Decks\CyberDragonExecutor.cs" /> <Compile Include="Game\AI\Decks\CyberDragonExecutor.cs" />
<Compile Include="Game\AI\Decks\DarkMagicianExecutor.cs" /> <Compile Include="Game\AI\Decks\DarkMagicianExecutor.cs" />
<Compile Include="Game\AI\Decks\DogmatikaExecutor.cs" />
<Compile Include="Game\AI\Decks\OrcustExecutor.cs" /> <Compile Include="Game\AI\Decks\OrcustExecutor.cs" />
<Compile Include="Game\AI\Decks\SkyStrikerExecutor.cs" /> <Compile Include="Game\AI\Decks\SkyStrikerExecutor.cs" />
<Compile Include="Game\AI\Decks\MokeyMokeyKingExecutor.cs" /> <Compile Include="Game\AI\Decks\MokeyMokeyKingExecutor.cs" />
......
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