Commit 605c2839 authored by mercury233's avatar mercury233

update OnPreBattleBetween

parent 8dfcd0d5
......@@ -10,7 +10,7 @@ namespace WindBot.Game.AI
/// </summary>
public static bool IsMonsterInvincible(this ClientCard card)
{
return Enum.IsDefined(typeof(InvincibleMonster), card.Id);
return !card.IsDisabled() && Enum.IsDefined(typeof(InvincibleMonster), card.Id);
}
/// <summary>
......
......@@ -82,13 +82,6 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
}
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{
if (defender.IsMonsterInvincible() && !defender.IsMonsterDangerous() && attacker.Id == 83104731)
return true;
return base.OnPreBattleBetween(attacker, defender);
}
private bool ShuraTheBlueFlameSummon()
{
if (Bot.HasInMonstersZone(CardId.SiroccoTheDawn) && Bot.GetMonsters().GetHighestAttackMonster().Attack < 3800)
......
......@@ -84,15 +84,6 @@ namespace WindBot.Game.AI.Decks
private int m_swapFrogSummoned;
private int m_flipFlopFrogSummoned;
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{
if (attacker.Id == CardId.Unifrog || attacker.Id == CardId.DewdarkOfTheIceBarrier)
return true;
if (defender.IsMonsterInvincible() && !defender.IsMonsterDangerous() && attacker.Id == CardId.SubmarineFrog)
return true;
return base.OnPreBattleBetween(attacker, defender);
}
private bool SwapFrogSummon()
{
int atk = Card.Attack + GetSpellBonus();
......
......@@ -64,13 +64,6 @@ namespace WindBot.Game.AI.Decks
private int _lastDoubleSummon;
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{
if (defender.IsMonsterInvincible() && !defender.IsMonsterDangerous() && attacker.Id == CardId.AncientGearGolem)
return true;
return base.OnPreBattleBetween(attacker, defender);
}
private bool DoubleSummon()
{
if (_lastDoubleSummon == Duel.Turn)
......
......@@ -28,6 +28,7 @@ namespace WindBot.Game.AI
public static int ChickenGame = 67616300;
public static int CastelTheSkyblasterMusketeer = 82633039;
public static int CrystalWingSynchroDragon = 50954680;
public static int NumberS39UtopiaTheLightning = 56832966;
public static int Number39Utopia = 84013237;
public static int UltimayaTzolkin = 1686814;
......@@ -49,23 +50,29 @@ namespace WindBot.Game.AI
/// <returns>true if the attack can be done.</returns>
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{
if (defender.IsMonsterInvincible())
if (!attacker.IsMonsterHasPreventActivationEffectInBattle())
{
if (defender.IsMonsterDangerous() || (defender.IsMonsterInvincible() && defender.IsDefense()))
{
if (!attacker.IsMonsterHasPreventActivationEffectInBattle() && (defender.IsMonsterDangerous() || defender.IsDefense()))
return false;
}
if (!defender.IsMonsterHasPreventActivationEffectInBattle())
if (defender.Id == _CardId.CrystalWingSynchroDragon && !defender.IsDisabled() && attacker.Level >= 5)
{
if (attacker.Id == _CardId.NumberS39UtopiaTheLightning && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, _CardId.Number39Utopia))
attacker.RealPower = 5000;
return false;
}
if (!attacker.IsMonsterHasPreventActivationEffectInBattle())
{
if (defender.Id == _CardId.NumberS39UtopiaTheLightning && !defender.IsDisabled() && defender.HasXyzMaterial(2, _CardId.Number39Utopia))
defender.RealPower = 5000;
}
if (!defender.IsMonsterHasPreventActivationEffectInBattle())
{
if (attacker.Id == _CardId.NumberS39UtopiaTheLightning && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, _CardId.Number39Utopia))
attacker.RealPower = 5000;
}
if (Enemy.HasInMonstersZone(_CardId.DupeFrog, true) && defender.Id != _CardId.DupeFrog)
return false;
......
......@@ -9,6 +9,11 @@
Yubel = 78371393,
YubelIncarnate = 4779091,
YubelNightmare = 31764700,
MetaionTheTimelord = 74530899
ZaphionTheTimelord = 28929131,
SadionTheTimelord = 65314286,
MetaionTheTimelord = 74530899,
KamionTheTimelord = 91712985,
LazionTheTimelord = 92435533,
EaterOfMillions = 63845230
}
}
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