/// <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); }