Commit 0e228ca1 authored by mercury233's avatar mercury233

update card.attacked

parent 2e7936cf
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
......@@ -58,7 +59,7 @@ namespace DevBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, (int)CardId.CrystalWingSynchroDragon, CrystalWingSynchroDragonEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.DragunityPhalanx);
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);
// Summon
......@@ -98,7 +99,7 @@ namespace DevBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, (int)CardId.StarlightRoad, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.MirrorForce, 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);
}
......@@ -432,6 +433,12 @@ namespace DevBot.Game.AI.Decks
return false;
}
private bool DragunityArmaMysletainnEffect()
{
AI.SelectCard((int)CardId.DragunityPhalanx);
return true;
}
private bool DragunityArmaMysletainnTribute()
{
if ((Duel.Fields[0].HasInMonstersZone((int)CardId.AssaultBeast)
......@@ -468,6 +475,23 @@ namespace DevBot.Game.AI.Decks
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()
{
ClientCard card = Duel.Fields[1].MonsterZone.GetInvincibleMonster();
......
......@@ -32,6 +32,7 @@ namespace WindBot.Game
public int SelectSeq { get; set; }
public bool CanDirectAttack { get; set; }
public bool ShouldDirectAttack { get; set; }
public bool Attacked { get; set; }
public int[] ActionIndex { get; set; }
public IDictionary<int, int> ActionActivateIndex { get; private set; }
......
......@@ -542,8 +542,15 @@ namespace WindBot.Game
else
card.CanDirectAttack = false;
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.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