/// <summary> /// Decide whether to declare attack between attacker and defender. /// Can be overrided to update the RealPower of attacker for cards like Honest. /// </summary> /// <param name="attacker">Card that attack.</param> /// <param name="defender">Card that defend.</param> /// <returns>false if the attack can't be done.</returns> public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender) { if (attacker.RealPower <= 0) { return(false); } if (!attacker.IsMonsterHasPreventActivationEffectInBattle()) { if (defender.IsMonsterDangerous() || (defender.IsMonsterInvincible() && defender.IsDefense())) { return(false); } if (defender.Id == _CardId.CrystalWingSynchroDragon && defender.IsAttack() && !defender.IsDisabled() && attacker.Level >= 5) { return(false); } if (defender.Id == _CardId.NumberS39UtopiaTheLightning && defender.IsAttack() && !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); } if (Enemy.HasInMonstersZone(_CardId.MaraudingCaptain, true) && defender.Id != _CardId.MaraudingCaptain && defender.Race == (int)CardRace.Warrior) { return(false); } if (defender.Id == _CardId.UltimayaTzolkin && !defender.IsDisabled()) { List <ClientCard> monsters = Enemy.GetMonsters(); foreach (ClientCard monster in monsters) { if (monster.HasType(CardType.Synchro)) { return(false); } } } return(true); }
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender) { if (!defender.IsMonsterHasPreventActivationEffectInBattle()) { if (attacker.IsCode(CardId.SkyCavalryCentaurea) && !attacker.IsDisabled() && attacker.HasXyzMaterial()) { attacker.RealPower = Bot.LifePoints + attacker.Attack; } } return(base.OnPreBattleBetween(attacker, defender)); }
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender) { if (!defender.IsMonsterHasPreventActivationEffectInBattle()) { if (attacker.Attribute == (int)CardAttribute.Light && Bot.HasInHand(CardId.Honest)) { attacker.RealPower = attacker.RealPower + defender.Attack; } } return(base.OnPreBattleBetween(attacker, defender)); }
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender) { if (!defender.IsMonsterHasPreventActivationEffectInBattle()) { if (attacker.Id == CardId.UltimateConductorTytanno && !attacker.IsDisabled() && defender.IsDefense()) { attacker.RealPower = 9999; } } return(base.OnPreBattleBetween(attacker, defender)); }
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender) { if (!defender.IsMonsterHasPreventActivationEffectInBattle()) { if (attacker.HasType(CardType.Fusion) && Bot.HasInHand(CardId.AleisterTheInvoker)) { attacker.RealPower = attacker.RealPower + 1000; } } return(base.OnPreBattleBetween(attacker, defender)); }
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender) { if (!defender.IsMonsterHasPreventActivationEffectInBattle()) { if (attacker.IsCode(CardId.HiSpeedroidChanbara) && !attacker.IsDisabled()) { attacker.RealPower = attacker.RealPower + 200; } } return(base.OnPreBattleBetween(attacker, defender)); }
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender) { if (!defender.IsMonsterHasPreventActivationEffectInBattle()) { if (Bot.HasInMonstersZone(CardId.Number37HopeWovenDragonSpiderShark, true, true)) { attacker.RealPower = attacker.RealPower + 1000; } } return(base.OnPreBattleBetween(attacker, defender)); }
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender) { if (!defender.IsMonsterHasPreventActivationEffectInBattle()) { if (attacker.Attribute == (int)CardAttribute.Wind && this.Bot.HasInHand(CardId.YosenjuTsujik)) { attacker.RealPower = attacker.RealPower + 1000; } } return(base.OnPreBattleBetween(attacker, defender)); }
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender) { if (!defender.IsMonsterHasPreventActivationEffectInBattle()) { if (!attacker.IsDisabled() && (attacker.IsCode(CardId.MekkKnightCrusadiaAstram) && defender.IsSpecialSummoned || attacker.IsCode(CardId.CrystalWingSynchroDragon) && defender.Level >= 5)) { attacker.RealPower = attacker.RealPower + defender.Attack; } } return(base.OnPreBattleBetween(attacker, defender)); }
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender) { if (!defender.IsMonsterHasPreventActivationEffectInBattle()) { if (attacker.IsCode(CardId.TrickstarCandina) && Bot.HasInHand(CardId.TrickstarCarobein)) { attacker.RealPower = attacker.RealPower + 1800; } if (attacker.IsCode(CardId.BorrelswordDragon) && !attacker.IsDisabled() && !BorrelswordDragonUsed) { attacker.RealPower = attacker.RealPower + defender.GetDefensePower() / 2; defender.RealPower = defender.RealPower - defender.GetDefensePower() / 2; } } return(base.OnPreBattleBetween(attacker, defender)); }
// update stats for battle prediction based on effects public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender) { if (!defender.IsMonsterHasPreventActivationEffectInBattle()) { if (attacker.IsCode(CardId.ShaddollConstruct) && !attacker.IsDisabled() && defender.IsSpecialSummoned) // NOTE: Possible to check destruction immunity? { attacker.RealPower = 9999; } if (attacker.IsCode(CardId.DragmaFleur) && !attacker.IsDisabled() && !FleurAttackUsed) { attacker.RealPower += 500; } if (attacker.HasType(CardType.Fusion) && Bot.HasInHand(CardId.InvokedAleister)) { attacker.RealPower += 1000; } } return(base.OnPreBattleBetween(attacker, defender)); }
/// <summary> /// Decide whether to declare attack between attacker and defender. /// Can be overrided to update the RealPower of attacker for cards like Honest. /// </summary> /// <param name="attacker">Card that attack.</param> /// <param name="defender">Card that defend.</param> /// <returns>false if the attack shouldn't be done.</returns> public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender) { if (attacker.RealPower <= 0) { return(false); } if (!attacker.IsMonsterHasPreventActivationEffectInBattle()) { if (defender.IsMonsterInvincible() && defender.IsDefense()) { return(false); } if (defender.IsMonsterDangerous()) { bool canIgnoreIt = !attacker.IsDisabled() && ( attacker.IsCode(_CardId.UltimateConductorTytanno) && defender.IsDefense() || attacker.IsCode(_CardId.ElShaddollConstruct) && defender.IsSpecialSummoned || attacker.IsCode(_CardId.AllyOfJusticeCatastor) && !defender.HasAttribute(CardAttribute.Dark)); if (!canIgnoreIt) { return(false); } } foreach (ClientCard equip in defender.EquipCards) { if (equip.IsCode(_CardId.MoonMirrorShield) && !equip.IsDisabled()) { return(false); } } if (!defender.IsDisabled()) { if (defender.IsCode(_CardId.MekkKnightCrusadiaAstram) && defender.IsAttack() && attacker.IsSpecialSummoned) { return(false); } if (defender.IsCode(_CardId.CrystalWingSynchroDragon) && defender.IsAttack() && attacker.Level >= 5) { return(false); } if (defender.IsCode(_CardId.AllyOfJusticeCatastor) && !attacker.HasAttribute(CardAttribute.Dark)) { return(false); } if (defender.IsCode(_CardId.NumberS39UtopiaTheLightning) && defender.IsAttack() && defender.HasXyzMaterial(2, _CardId.Number39Utopia)) { defender.RealPower = 5000; } if (defender.IsCode(_CardId.VampireFraeulein)) { defender.RealPower += (Enemy.LifePoints > 3000) ? 3000 : (Enemy.LifePoints - 100); } if (defender.IsCode(_CardId.InjectionFairyLily) && Enemy.LifePoints > 2000) { defender.RealPower += 3000; } } } if (!defender.IsMonsterHasPreventActivationEffectInBattle()) { if (attacker.IsCode(_CardId.NumberS39UtopiaTheLightning) && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, _CardId.Number39Utopia)) { attacker.RealPower = 5000; } foreach (ClientCard equip in attacker.EquipCards) { if (equip.IsCode(_CardId.MoonMirrorShield) && !equip.IsDisabled()) { attacker.RealPower = defender.RealPower + 100; } } } if (Enemy.HasInMonstersZone(_CardId.MekkKnightCrusadiaAstram, true) && !(defender).IsCode(_CardId.MekkKnightCrusadiaAstram)) { return(false); } if (Enemy.HasInMonstersZone(_CardId.DupeFrog, true) && !(defender).IsCode(_CardId.DupeFrog)) { return(false); } if (Enemy.HasInMonstersZone(_CardId.MaraudingCaptain, true) && !defender.IsCode(_CardId.MaraudingCaptain) && defender.Race == (int)CardRace.Warrior) { return(false); } if (defender.IsCode(_CardId.UltimayaTzolkin) && !defender.IsDisabled() && Enemy.GetMonsters().Any(monster => !monster.Equals(defender) && monster.HasType(CardType.Synchro))) { return(false); } if (defender.OwnTargets.Any(card => card.IsCode(_CardId.PhantomKnightsFogBlade) && !card.IsDisabled())) { return(false); } return(true); }
/// <summary> /// Decide whether to declare attack between attacker and defender. /// Can be overrided to update the RealPower of attacker for cards like Honest. /// </summary> /// <param name="attacker">Card that attack.</param> /// <param name="defender">Card that defend.</param> /// <returns>false if the attack shouldn't be done.</returns> public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender) { if (attacker.RealPower <= 0) { return(false); } if (!attacker.IsMonsterHasPreventActivationEffectInBattle()) { if (defender.IsMonsterInvincible() && defender.IsDefense()) { return(false); } if (defender.IsMonsterDangerous()) { bool canignoreit = false; if (attacker.Id == _CardId.UltimateConductorTytanno && !attacker.IsDisabled() && defender.IsDefense()) { canignoreit = true; } if (!canignoreit) { return(false); } } if (defender.Id == _CardId.CrystalWingSynchroDragon && defender.IsAttack() && !defender.IsDisabled() && attacker.Level >= 5) { return(false); } if (defender.Id == _CardId.NumberS39UtopiaTheLightning && defender.IsAttack() && !defender.IsDisabled() && defender.HasXyzMaterial(2, _CardId.Number39Utopia)) { defender.RealPower = 5000; } if (defender.Id == _CardId.VampireFräulein && !defender.IsDisabled()) { defender.RealPower += (Enemy.LifePoints > 3000) ? 3000 : (Enemy.LifePoints - 100); } if (defender.Id == _CardId.InjectionFairyLily && !defender.IsDisabled() && Enemy.LifePoints > 2000) { defender.RealPower += 3000; } } 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); } if (Enemy.HasInMonstersZone(_CardId.MaraudingCaptain, true) && defender.Id != _CardId.MaraudingCaptain && defender.Race == (int)CardRace.Warrior) { return(false); } if (defender.Id == _CardId.UltimayaTzolkin && !defender.IsDisabled()) { List <ClientCard> monsters = Enemy.GetMonsters(); foreach (ClientCard monster in monsters) { if (monster.HasType(CardType.Synchro)) { return(false); } } } return(true); }