Commit 13c8f9ce authored by mercury233's avatar mercury233

update Yosenju deck

parent 96bc0f0c
......@@ -42,33 +42,18 @@
84749824
#extra
44508094
56832966
86532744
16195942
84013237
94380860
96381979
63746411
82633039
95169481
22653490
46772449
21044178
12014404
12014404
16195942
82633039
56832966
86532744
84013237
!side
5133471
5133471
5133471
3493058
3493058
3493058
5318639
5318639
5318639
30459350
30459350
30459350
83266092
83266092
83266092
......@@ -52,7 +52,7 @@
],
"chaining": [
"我挥动了神奇的魔法棒,并发动了{0}的效果~",
"啊!这下死定了!...嘿嘿你上当了,打开盖卡!{0}!",
"啊!这下死定了!...嘿嘿你上当了,我发动{0}!",
"你这太贸然了,难道你没想到我会发动{0}吗?"
]
}
using System.Collections.Generic;
using YGOSharp.OCGWrapper.Enums;
namespace WindBot.Game.AI
{
......@@ -37,6 +38,21 @@ namespace WindBot.Game.AI
return 1;
}
public int GetBestAttack(ClientField field, bool onlyatk)
{
int bestAtk = -1;
for (int i = 0; i < 5; ++i)
{
ClientCard card = field.MonsterZone[i];
if (card == null) continue;
if (onlyatk && card.IsDefense()) continue;
int ennemyValue = card.GetDefensePower();
if (ennemyValue > bestAtk)
bestAtk = ennemyValue;
}
return bestAtk;
}
public bool IsEnnemyBetter(bool onlyatk, bool all)
{
if (Duel.Fields[1].GetMonsterCount() == 0)
......@@ -103,5 +119,10 @@ namespace WindBot.Game.AI
{
return id * 16 + option;
}
public bool IsTurn1OrMain2()
{
return Duel.Turn == 1 || Duel.Phase == DuelPhase.Main2;
}
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -33,7 +33,7 @@ namespace WindBot.Game.AI
public virtual bool OnSelectHand()
{
return true; // I want to begin !
return Program.Rand.Next(2) > 0;
}
public virtual BattlePhaseAction OnBattle(IList<ClientCard> attackers, IList<ClientCard> defenders)
......@@ -59,6 +59,13 @@ namespace WindBot.Game.AI
}
}
for (int i = attackers.Count - 1; i >= 0; --i)
{
ClientCard attacker = attackers[i];
if (attacker.CanDirectAttack)
return AI.Attack(attacker, null);
}
if (!Battle.CanMainPhaseTwo)
return AI.Attack(attackers[attackers.Count - 1], defenders[0]);
......
......@@ -30,6 +30,8 @@ namespace WindBot.Game
public int Controller { get; private set; }
public int Disabled { get; private set; }
public int SelectSeq { get; set; }
public bool CanDirectAttack { get; set; }
public bool ShouldDirectAttack { get; set; }
public int[] ActionIndex { get; set; }
public IDictionary<int, int> ActionActivateIndex { get; private set; }
......
......@@ -42,6 +42,11 @@ namespace WindBot.Game
return GetCount(SpellZone);
}
public int GetHandCount()
{
return GetCount(Hand);
}
public int GetSpellCountWithoutField()
{
int count = 0;
......
......@@ -632,14 +632,19 @@ namespace WindBot.Game
public BattlePhaseAction Attack(ClientCard attacker, ClientCard defender)
{
Executor.SetCard(0, attacker, -1);
if (defender != null)
{
string cardName = defender.Name ?? "monster";
attacker.ShouldDirectAttack = false;
_dialogs.SendAttack(attacker.Name, cardName);
SelectCard(defender);
}
else
{
attacker.ShouldDirectAttack = true;
_dialogs.SendDirectAttack(attacker.Name);
}
return new BattlePhaseAction(BattlePhaseAction.BattleAction.Attack, attacker.ActionIndex);
}
......
......@@ -529,13 +529,15 @@ namespace WindBot.Game
int con = GetLocalPlayer(packet.ReadByte());
CardLocation loc = (CardLocation)packet.ReadByte();
int seq = packet.ReadByte();
packet.ReadByte(); // diratt
int diratt = packet.ReadByte();
ClientCard card = _duel.GetCard(con, loc, seq);
if (card != null)
{
card.ActionIndex[1] = i;
battle.AttackableCards.Add(_duel.GetCard(con, loc, seq));
if (diratt > 0)
card.CanDirectAttack = true;
battle.AttackableCards.Add(card);
}
}
......@@ -625,7 +627,7 @@ namespace WindBot.Game
int con = GetLocalPlayer(packet.ReadByte());
int loc = packet.ReadByte();
int seq = packet.ReadByte();
int sseq = 0; //packet.ReadByte();
int sseq = packet.ReadByte();
int desc = packet.ReadInt32();
cards.Add(_duel.GetCard(con, loc, seq, sseq));
......
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