public static Vector2f GetPositionOfTheBestDamagingSpellDeploy() { // Prio1: Hit Enemy King Tower if health is low // Prio2: Every damaging spell if there is a big group of enemies if (EnemyCharacterHandling.EnemyKingTower.HealthComponent.CurrentHealth < GameHandling.Settings.KingTowerSpellDamagingHealth) { return(EnemyCharacterHandling.EnemyKingTower.StartPosition); } else { int count; Character enemy = EnemyCharacterHandling.EnemyCharacterWithTheMostEnemiesAround(out count); if (enemy != null) { if (PlayerCharacterHandling.HowManyCharactersAroundCharacter(enemy) >= GameHandling.Settings.SpellCorrectionConditionCharCount) { return(enemy.StartPosition); } else { // Position Correction return(PositionHelper.AddYInDirection(enemy.StartPosition, PlayerProperties.PlayerPosition, 4000)); } } } return(Vector2f.Zero); }
private static Vector2f PrincessTowerCharacterDeploymentCorrection(Vector2f position) { Logger.Debug("PT Characer Position Correction: Name und Typ {0} " + cardToDeploy.Name, (cardToDeploy as CardCharacter).Type); Vector2f result = Vector2f.Zero; if (cardToDeploy is CardCharacter) { switch ((cardToDeploy as CardCharacter).Type) { case TroopType.GroundAttack: case TroopType.Flying: case TroopType.Tank: return(PositionHelper.SubtractYInDirection(position, PlayerProperties.PlayerPosition)); case TroopType.Ranger: case TroopType.AirAttack: case TroopType.AOEAttackGround: case TroopType.AOEAttackFlying: case TroopType.Damager: return(PositionHelper.AddYInDirection(position, PlayerProperties.PlayerPosition)); default: break; } } else { Logger.Debug("Tower Correction: No Correction!!!"); } return(position); }
private static Vector2f DKT() { if (cardToDeploy is CardCharacter) { switch ((cardToDeploy as CardCharacter).Type) { case TroopType.GroundAttack: case TroopType.Flying: case TroopType.Tank: Logger.Debug("DKT Troop-Name {0} ; CartType GroundAttack, Flying or Tank", cardToDeploy.Name); if (PlaygroundPositionHandling.IsPositionOnTheRightSide(EnemyCharacterHandling.NearestEnemy.StartPosition)) { return(PlayerCharacterHandling.KingTower.StartPosition + new Vector2f(1000, 0)); } else { return(PlayerCharacterHandling.KingTower.StartPosition - new Vector2f(1000, 0)); } case TroopType.Ranger: case TroopType.AirAttack: case TroopType.AOEAttackGround: case TroopType.AOEAttackFlying: case TroopType.Damager: Vector2f position = PositionHelper.AddYInDirection(PlayerCharacterHandling.KingTower.StartPosition, PlayerProperties.PlayerPosition); if (PlaygroundPositionHandling.IsPositionOnTheRightSide(EnemyCharacterHandling.NearestEnemy.StartPosition)) { return(position + new Vector2f(300, 0)); } else { return(position - new Vector2f(300, 0)); } default: break; } } if (PlaygroundPositionHandling.IsPositionOnTheRightSide(EnemyCharacterHandling.NearestEnemy.StartPosition)) { return(PlayerCharacterHandling.KingTower.StartPosition + new Vector2f(1000, 0)); } else { return(PlayerCharacterHandling.KingTower.StartPosition - new Vector2f(1000, 0)); } }