Commit 13c8f9ce authored by mercury233's avatar mercury233

update Yosenju deck

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