Commit d5d933e3 authored by mercury233's avatar mercury233

fix atk 0 monster attack

parent 605c2839
...@@ -231,11 +231,6 @@ namespace WindBot.Game.AI.Decks ...@@ -231,11 +231,6 @@ namespace WindBot.Game.AI.Decks
return null; return null;
} }
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{
return attacker.Attack > 0 && base.OnPreBattleBetween(attacker, defender);
}
private bool DragonShrineEffect() private bool DragonShrineEffect()
{ {
AI.SelectCard(new[] AI.SelectCard(new[]
......
...@@ -33,10 +33,5 @@ namespace WindBot.Game.AI.Decks ...@@ -33,10 +33,5 @@ namespace WindBot.Game.AI.Decks
else else
return base.OnRockPaperScissors(); return base.OnRockPaperScissors();
} }
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{
return attacker.Attack > 0 && base.OnPreBattleBetween(attacker, defender);
}
} }
} }
\ No newline at end of file
...@@ -50,6 +50,8 @@ namespace WindBot.Game.AI ...@@ -50,6 +50,8 @@ namespace WindBot.Game.AI
/// <returns>true if the attack can be done.</returns> /// <returns>true if the attack can be done.</returns>
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender) public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{ {
if (attacker.RealPower <= 0)
return false;
if (!attacker.IsMonsterHasPreventActivationEffectInBattle()) if (!attacker.IsMonsterHasPreventActivationEffectInBattle())
{ {
......
...@@ -62,8 +62,16 @@ namespace WindBot.Game.AI ...@@ -62,8 +62,16 @@ namespace WindBot.Game.AI
return AI.ToMainPhase2(); return AI.ToMainPhase2();
if (defenders.Count == 0) if (defenders.Count == 0)
return AI.Attack(attackers[0], null); {
for (int i = attackers.Count - 1; i >= 0; --i)
{
ClientCard attacker = attackers[i];
if (attacker.Attack > 0)
return AI.Attack(attacker, null);
}
}
else
{
for (int i = defenders.Count - 1; i >= 0; --i) for (int i = defenders.Count - 1; i >= 0; --i)
{ {
ClientCard defender = defenders[i]; ClientCard defender = defenders[i];
...@@ -85,9 +93,10 @@ namespace WindBot.Game.AI ...@@ -85,9 +93,10 @@ namespace WindBot.Game.AI
if (attacker.CanDirectAttack) if (attacker.CanDirectAttack)
return AI.Attack(attacker, null); return AI.Attack(attacker, null);
} }
}
if (!Battle.CanMainPhaseTwo) if (!Battle.CanMainPhaseTwo)
return AI.Attack(attackers[attackers.Count - 1], defenders[0]); return AI.Attack(attackers[0], (defenders.Count == 0) ? null : defenders[0]);
return AI.ToMainPhase2(); return AI.ToMainPhase2();
} }
......
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