Commit 0e228ca1 authored by mercury233's avatar mercury233

update card.attacked

parent 2e7936cf
using YGOSharp.OCGWrapper.Enums; using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic; using System.Collections.Generic;
using WindBot;
using WindBot.Game; using WindBot.Game;
using WindBot.Game.AI; using WindBot.Game.AI;
...@@ -58,7 +59,7 @@ namespace DevBot.Game.AI.Decks ...@@ -58,7 +59,7 @@ namespace DevBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, (int)CardId.CrystalWingSynchroDragon, CrystalWingSynchroDragonEffect); AddExecutor(ExecutorType.Activate, (int)CardId.CrystalWingSynchroDragon, CrystalWingSynchroDragonEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.DragunityPhalanx); AddExecutor(ExecutorType.Activate, (int)CardId.DragunityPhalanx);
AddExecutor(ExecutorType.Activate, (int)CardId.DragunityKnightVajrayana); AddExecutor(ExecutorType.Activate, (int)CardId.DragunityKnightVajrayana);
AddExecutor(ExecutorType.Activate, (int)CardId.DragunityArmaMysletainn); AddExecutor(ExecutorType.Activate, (int)CardId.DragunityArmaMysletainn, DragunityArmaMysletainnEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.DragunityDux); AddExecutor(ExecutorType.Activate, (int)CardId.DragunityDux);
// Summon // Summon
...@@ -98,7 +99,7 @@ namespace DevBot.Game.AI.Decks ...@@ -98,7 +99,7 @@ namespace DevBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, (int)CardId.StarlightRoad, DefaultTrap); AddExecutor(ExecutorType.Activate, (int)CardId.StarlightRoad, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.MirrorForce, DefaultTrap); AddExecutor(ExecutorType.Activate, (int)CardId.MirrorForce, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.DimensionalPrison, DefaultTrap); AddExecutor(ExecutorType.Activate, (int)CardId.DimensionalPrison, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.AssaultModeActivate); AddExecutor(ExecutorType.Activate, (int)CardId.AssaultModeActivate, AssaultModeActivate);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos); AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
} }
...@@ -432,6 +433,12 @@ namespace DevBot.Game.AI.Decks ...@@ -432,6 +433,12 @@ namespace DevBot.Game.AI.Decks
return false; return false;
} }
private bool DragunityArmaMysletainnEffect()
{
AI.SelectCard((int)CardId.DragunityPhalanx);
return true;
}
private bool DragunityArmaMysletainnTribute() private bool DragunityArmaMysletainnTribute()
{ {
if ((Duel.Fields[0].HasInMonstersZone((int)CardId.AssaultBeast) if ((Duel.Fields[0].HasInMonstersZone((int)CardId.AssaultBeast)
...@@ -468,6 +475,23 @@ namespace DevBot.Game.AI.Decks ...@@ -468,6 +475,23 @@ namespace DevBot.Game.AI.Decks
return LastChainPlayer == 1; return LastChainPlayer == 1;
} }
private bool AssaultModeActivate()
{
if (Duel.Player == 0 && Duel.Phase == DuelPhase.BattleStart)
{
List<ClientCard> monsters = Duel.Fields[0].GetMonsters();
foreach (ClientCard monster in monsters)
{
if (monster.Id == (int)CardId.StardustDragon && monster.Attacked)
{
AI.SelectCard(monster);
return true;
}
}
}
return Duel.Player == 1;
}
private ClientCard GetProblematicCard() private ClientCard GetProblematicCard()
{ {
ClientCard card = Duel.Fields[1].MonsterZone.GetInvincibleMonster(); ClientCard card = Duel.Fields[1].MonsterZone.GetInvincibleMonster();
......
...@@ -32,6 +32,7 @@ namespace WindBot.Game ...@@ -32,6 +32,7 @@ namespace WindBot.Game
public int SelectSeq { get; set; } public int SelectSeq { get; set; }
public bool CanDirectAttack { get; set; } public bool CanDirectAttack { get; set; }
public bool ShouldDirectAttack { get; set; } public bool ShouldDirectAttack { get; set; }
public bool Attacked { 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; }
......
...@@ -542,8 +542,15 @@ namespace WindBot.Game ...@@ -542,8 +542,15 @@ namespace WindBot.Game
else else
card.CanDirectAttack = false; card.CanDirectAttack = false;
battle.AttackableCards.Add(card); battle.AttackableCards.Add(card);
card.Attacked = false;
} }
} }
List<ClientCard> monsters = _duel.Fields[0].GetMonsters();
foreach (ClientCard monster in monsters)
{
if (!battle.AttackableCards.Contains(monster))
monster.Attacked = true;
}
battle.CanMainPhaseTwo = packet.ReadByte() != 0; battle.CanMainPhaseTwo = packet.ReadByte() != 0;
battle.CanEndPhase = packet.ReadByte() != 0; battle.CanEndPhase = packet.ReadByte() != 0;
......
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