private Rectangle GetNewBounds() { float newXGridLocation = LoZGame.Instance.Random.Next(0, 11); float newYGridLocation = LoZGame.Instance.Random.Next(0, 6); Vector2 newScreenLocation = LoZGame.Instance.Dungeon.CurrentRoom.GridToScreenVector(newXGridLocation, newYGridLocation); return(new Rectangle((int)newScreenLocation.X, (int)newScreenLocation.Y, EnemySpriteFactory.GetEnemyWidth(Enemy), EnemySpriteFactory.GetEnemyHeight(Enemy))); }
private void CheckEnemies(ReadOnlyCollection <IEnemy> enemies, ReadOnlyCollection <IProjectile> playerProjectiles) { foreach (IEnemy enemy in enemies) { // Do not check borders for the Old Man/Merchant since they are static NPCs. if (!(enemy is OldMan || enemy is Merchant)) { CheckBorders(enemy, EnemySpriteFactory.GetEnemyWidth(enemy), EnemySpriteFactory.GetEnemyHeight(enemy)); } CheckCollisions <IProjectile>(enemy, playerProjectiles); } }
public Ganon(Vector2 location) { RandomStateGenerator = new RandomStateGenerator(this); States = new Dictionary <RandomStateGenerator.StateType, int>(GameData.Instance.EnemyStateWeights.GanonTeleportingStateList); Health = new HealthManager(GameData.Instance.EnemyHealthConstants.GanonHealth); Physics = new Physics(location); Physics.Mass = GameData.Instance.EnemyMassConstants.GanonMass; CurrentState = new IdleEnemyState(this); Physics.Bounds = new Rectangle((int)Physics.Location.X, (int)Physics.Location.Y, EnemySpriteFactory.GetEnemyWidth(this), EnemySpriteFactory.GetEnemyHeight(this)); EnemyCollisionHandler = new EnemyCollisionHandler(this); Expired = false; Physics.IsMovable = false; visibilityTimer = LoZGame.Instance.UpdateSpeed; Damage = GameData.Instance.EnemyDamageConstants.GanonDamage; DamageTimer = 0; MoveSpeed = GameData.Instance.EnemySpeedConstants.GanonSpeed; CurrentTint = LoZGame.Instance.DefaultTint; DropTable = GameData.Instance.EnemyDropTables.EmptyDropTable; ApplyDamageMod(); ApplySmallSpeedMod(); ApplyLargeWeightModPos(); ApplyLargeHealthMod(); }
public Patra(Vector2 location) { RandomStateGenerator = new RandomStateGenerator(this); States = new Dictionary <RandomStateGenerator.StateType, int>(GameData.Instance.EnemyStateWeights.PatraStateList); Health = new HealthManager(GameData.Instance.EnemyHealthConstants.PatraHealth); Physics = new Physics(location); Physics.Mass = GameData.Instance.EnemyMassConstants.PatraMass; Physics.IsMovable = false; CurrentState = new IdleEnemyState(this); Physics.Bounds = new Rectangle((int)Physics.Location.X, (int)Physics.Location.Y, EnemySpriteFactory.GetEnemyWidth(this), EnemySpriteFactory.GetEnemyHeight(this)); EnemyCollisionHandler = new EnemyCollisionHandler(this); Expired = false; IsTransparent = false; Damage = GameData.Instance.EnemyDamageConstants.PatraDamage; DamageTimer = 0; MoveSpeed = GameData.Instance.EnemySpeedConstants.PatraSpeed; CurrentTint = LoZGame.Instance.DefaultTint; spawnedChildren = false; AI = EnemyAI.Patra; DropTable = GameData.Instance.EnemyDropTables.PatraDropTable; IsSpawning = false; children = new Dictionary <int, IEnemy>(); deadChildren = new List <int>(); addedChildren = 0; rotationCheck = 0; childID = 0; }
public DigDogger(Vector2 location, IEnemy parent) { protectedSelf = parent; Physics = new Physics(location); CurrentState = new SpawnEnemyState(this); States = new Dictionary <RandomStateGenerator.StateType, int>(GameData.Instance.EnemyStateWeights.DigDoggerStateList); RandomStateGenerator = new RandomStateGenerator(this); Health = new HealthManager(GameData.Instance.EnemyHealthConstants.DigDoggerHealth); Physics.Mass = GameData.Instance.EnemyMassConstants.DigDoggerSmallMass; Physics.Bounds = new Rectangle((int)Physics.Location.X, (int)Physics.Location.Y, EnemySpriteFactory.GetEnemyWidth(this), EnemySpriteFactory.GetEnemyHeight(this)); EnemyCollisionHandler = new EnemyCollisionHandler(this); Expired = false; Damage = GameData.Instance.EnemyDamageConstants.DigDoggerDamage; DamageTimer = 0; MoveSpeed = GameData.Instance.EnemySpeedConstants.DigDoggerFleeSpeed; CurrentTint = LoZGame.Instance.DefaultTint; AI = EnemyAI.SmallDigDogger; DropTable = GameData.Instance.EnemyDropTables.DigDoggerDropTable; MinMaxWander = new Point(GameData.Instance.EnemyMiscConstants.MinDirectionChange, GameData.Instance.EnemyMiscConstants.MaxDirectionChange); Physics.IsMovable = false; ApplyDamageMod(); ApplyLargeSpeedMod(); ApplyLargeWeightModPos(); ApplyLargeHealthMod(); }
public GleeokHead(IEnemy body) { neckBase = new Point(body.Physics.Bounds.Center.X, body.Physics.Bounds.Bottom); parent = body; RandomStateGenerator = new RandomStateGenerator(this); States = new Dictionary <RandomStateGenerator.StateType, int>(GameData.Instance.EnemyStateWeights.GleeokHeadStateList); Health = new HealthManager(GameData.Instance.EnemyHealthConstants.GleeokHeadHealth); Physics = new Physics(neckBase.ToVector2()); Physics.Mass = GameData.Instance.EnemyMassConstants.DragonMass; Physics.IsMovable = false; CurrentState = new IdleEnemyState(this); Physics.Bounds = new Rectangle((int)Physics.Location.X, (int)Physics.Location.Y, EnemySpriteFactory.GetEnemyWidth(this), EnemySpriteFactory.GetEnemyHeight(this)); EnemyCollisionHandler = new EnemyCollisionHandler(this); Expired = false; Damage = GameData.Instance.EnemyDamageConstants.FullHeart + GameData.Instance.EnemyDamageConstants.HalfHeart; MoveSpeed = GameData.Instance.EnemySpeedConstants.GleeokHeadSpeed; DamageTimer = 0; MinMaxWander = new Point(LoZGame.Instance.UpdateSpeed / 4, LoZGame.Instance.UpdateSpeed); CurrentTint = LoZGame.Instance.DefaultTint; IsBossPart = true; HasChild = false; AI = EnemyAI.GleeokHead; IsSpawning = false; DropTable = GameData.Instance.EnemyDropTables.EmptyDropTable; ApplyDamageMod(); ApplyLargeWeightModPos(); ApplySmallHealthMod(); }
public RedMoldormHead(Vector2 location) { RandomStateGenerator = new RandomStateGenerator(this); States = new Dictionary <RandomStateGenerator.StateType, int>(GameData.Instance.EnemyStateWeights.FireSnakeStateList); Health = new HealthManager(GameData.Instance.EnemyHealthConstants.FireSnakeHealth); Physics = new Physics(location); Physics.Mass = GameData.Instance.EnemyMassConstants.FireSnakeMass; Physics.IsMovable = false; CurrentState = new IdleEnemyState(this); Physics.Bounds = new Rectangle((int)Physics.Location.X, (int)Physics.Location.Y, EnemySpriteFactory.GetEnemyWidth(this), EnemySpriteFactory.GetEnemyHeight(this)); EnemyCollisionHandler = new EnemyCollisionHandler(this); Expired = false; Damage = GameData.Instance.EnemyDamageConstants.FireSnakeDamage; DamageTimer = 0; MoveSpeed = GameData.Instance.EnemySpeedConstants.RedFireSnakeSpeed; CurrentTint = LoZGame.Instance.DefaultTint; HasChild = true; children = new List <IEnemy>(); spawnedChildren = false; AI = EnemyAI.MoldormHead; IsSpawning = false; DropTable = GameData.Instance.EnemyDropTables.RedMoldormDropTable; ApplyDamageMod(); ApplySmallSpeedMod(); ApplySmallWeightModPos(); ApplyLargeHealthMod(); MinMaxWander = new Point(LoZGame.Instance.UpdateSpeed); }
public Likelike(Vector2 location) { Timer = 0; RandomStateGenerator = new RandomStateGenerator(this); States = new Dictionary <RandomStateGenerator.StateType, int>(GameData.Instance.EnemyStateWeights.LikelikeStateList); Health = new HealthManager(GameData.Instance.EnemyHealthConstants.LikelikeHealth); Physics = new Physics(location); Physics.Mass = GameData.Instance.EnemyMassConstants.LikelikeMass; CurrentState = new SpawnEnemyState(this); EntityManager = LoZGame.Instance.GameObjects.Entities; Cooldown = 0; Physics.Bounds = new Rectangle((int)Physics.Location.X, (int)Physics.Location.Y, EnemySpriteFactory.GetEnemyWidth(this), EnemySpriteFactory.GetEnemyHeight(this)); EnemyCollisionHandler = new EnemyCollisionHandler(this); Expired = false; IsDead = false; Damage = GameData.Instance.EnemyDamageConstants.LikelikeDamage; DamageTimer = 0; MoveSpeed = GameData.Instance.EnemySpeedConstants.LikelikeSpeed; CurrentTint = LoZGame.Instance.DefaultTint; DropTable = GameData.Instance.EnemyDropTables.LikelikeDropTable; }
public OldMan(Vector2 location) { Physics = new Physics(location); flameOffset = new Point(130, 0); RandomStateGenerator = new RandomStateGenerator(this); States = new Dictionary <RandomStateGenerator.StateType, int>(GameData.Instance.EnemyStateWeights.OldManStateList); CurrentState = new IdleEnemyState(this); EnemyCollisionHandler = new EnemyCollisionHandler(this); Physics.Bounds = new Rectangle((int)Physics.Location.X, (int)Physics.Location.Y, EnemySpriteFactory.GetEnemyWidth(this), EnemySpriteFactory.GetEnemyHeight(this)); Health = new HealthManager(GameData.Instance.EnemyHealthConstants.OldManHealth); Expired = false; Damage = GameData.Instance.EnemyDamageConstants.OldManDamage; DamageTimer = 0; MoveSpeed = GameData.Instance.EnemySpeedConstants.OldManSpeed; CurrentTint = Color.White; timesShot = 0; DropTable = GameData.Instance.EnemyDropTables.EmptyDropTable; IsKillable = false; }
public VireKeese(Vector2 location) { RandomStateGenerator = new RandomStateGenerator(this); States = new Dictionary <RandomStateGenerator.StateType, int>(GameData.Instance.EnemyStateWeights.KeeseStateList); Health = new HealthManager(GameData.Instance.EnemyHealthConstants.KeeseHealth); Physics = new Physics(location); Physics.Mass = GameData.Instance.EnemyMassConstants.KeeseMass; CurrentState = new SpawnEnemyState(this); EntityManager = LoZGame.Instance.GameObjects.Entities; Cooldown = 0; Physics.Bounds = new Rectangle((int)Physics.Location.X, (int)Physics.Location.Y, EnemySpriteFactory.GetEnemyWidth(this), EnemySpriteFactory.GetEnemyHeight(this)); EnemyCollisionHandler = new EnemyCollisionHandler(this); Expired = false; Damage = GameData.Instance.EnemyDamageConstants.KeeseDamage; DamageTimer = 0; MoveSpeed = GameData.Instance.EnemySpeedConstants.MinKeeseSpeed; CurrentTint = LoZGame.Instance.DefaultTint; AI = EnemyAI.Keese; DropTable = GameData.Instance.EnemyDropTables.EmptyDropTable; MinMaxWander = new Point(GameData.Instance.EnemyMiscConstants.MinDirectionChange, GameData.Instance.EnemyMiscConstants.MaxDirectionChange); }
public GleeokNeck(IEnemy body) { parent = body; RandomStateGenerator = new RandomStateGenerator(this); States = new Dictionary <RandomStateGenerator.StateType, int>(GameData.Instance.EnemyStateWeights.ManhandlaHeadStateList); Health = new HealthManager(GameData.Instance.EnemyHealthConstants.GleeokNeckHealth); Physics = new Physics(body.Physics.Bounds.Center.ToVector2()); Physics.Mass = GameData.Instance.EnemyMassConstants.DragonMass; Physics.IsMovable = false; CurrentState = new IdleEnemyState(this); Physics.Bounds = new Rectangle((int)Physics.Location.X, (int)Physics.Location.Y, EnemySpriteFactory.GetEnemyWidth(this), EnemySpriteFactory.GetEnemyHeight(this)); EnemyCollisionHandler = new EnemyCollisionHandler(this); Expired = false; Damage = 0; DamageTimer = 0; MoveSpeed = 0; CurrentTint = LoZGame.Instance.DefaultTint; IsBossPart = true; HasChild = true; AI = EnemyAI.NoAI; DropTable = GameData.Instance.EnemyDropTables.EmptyDropTable; IsTransparent = true; ApplyDamageMod(); ApplyLargeWeightModPos(); ApplyLargeHealthMod(); }
public ManhandlaHead(IEnemy body, Physics.Direction side) { parent = body; RandomStateGenerator = new RandomStateGenerator(this); States = new Dictionary <RandomStateGenerator.StateType, int>(GameData.Instance.EnemyStateWeights.ManhandlaHeadStateList); Health = new HealthManager(GameData.Instance.EnemyHealthConstants.ManhandlaHeadHealth); Physics = new Physics(body.Physics.Bounds.Center.ToVector2()); Physics.Mass = GameData.Instance.EnemyMassConstants.DragonMass; Physics.IsMovable = false; Physics.CurrentDirection = side; Physics.Bounds = new Rectangle((int)Physics.Location.X, (int)Physics.Location.Y, EnemySpriteFactory.GetEnemyWidth(this), EnemySpriteFactory.GetEnemyHeight(this)); Setup(); CurrentState = new IdleEnemyState(this); EnemyCollisionHandler = new EnemyCollisionHandler(this); Expired = false; Damage = GameData.Instance.EnemyDamageConstants.DragonDamage; MoveSpeed = 0; CurrentTint = LoZGame.Instance.DefaultTint; IsBossPart = true; AI = EnemyAI.ManHandlaHead; IsSpawning = false; buffedParent = false; DropTable = GameData.Instance.EnemyDropTables.EmptyDropTable; ApplyDamageMod(); ApplyLargeWeightModPos(); ApplyLargeHealthMod(); }
public MiniPatra(IEnemy body) { parent = body; Physics = new Physics(Vector2.Zero); rotation = -MathHelper.PiOver2; SetLocation(); RandomStateGenerator = new RandomStateGenerator(this); States = new Dictionary <RandomStateGenerator.StateType, int>() { { RandomStateGenerator.StateType.Idle, 1 }, }; Health = new HealthManager(1); Physics.Mass = GameData.Instance.EnemyMassConstants.PatraMass; Physics.IsMovable = false; CurrentState = new IdleEnemyState(this); Physics.Bounds = new Rectangle((int)Physics.Location.X, (int)Physics.Location.Y, EnemySpriteFactory.GetEnemyWidth(this), EnemySpriteFactory.GetEnemyHeight(this)); EnemyCollisionHandler = new EnemyCollisionHandler(this); Expired = false; Damage = GameData.Instance.EnemyDamageConstants.MiniPatraDamage; MoveSpeed = GameData.Instance.EnemySpeedConstants.PatraSpeed; DamageTimer = 0; MinMaxWander = new Point(LoZGame.Instance.UpdateSpeed / 4, LoZGame.Instance.UpdateSpeed); CurrentTint = LoZGame.Instance.DefaultTint; HasChild = false; AI = EnemyAI.MiniPatra; IsSpawning = false; DropTable = GameData.Instance.EnemyDropTables.EmptyDropTable; ApplyDamageMod(); ApplySmallWeightModPos(); }
public override void UpdateChild() { IEnemy exposedSelf = new DigDogger(this.Physics.Location, this); Point offset = new Point(this.Physics.Bounds.Width / 2) - new Point(EnemySpriteFactory.GetEnemyHeight(exposedSelf) / 2); exposedSelf.Physics.Bounds = new Rectangle(exposedSelf.Physics.Bounds.Location + offset, exposedSelf.Physics.Bounds.Size); exposedSelf.Physics.SetLocation(); LoZGame.Instance.GameObjects.Enemies.Add(exposedSelf); this.Expired = true; }
public RedMoldormSegment(IEnemy parent) { RandomStateGenerator = new RandomStateGenerator(this); States = GameData.Instance.EnemyStateWeights.FireSnakeStateList; this.parent = parent; Physics = new Physics(parent.Physics.Location); Physics.Mass = GameData.Instance.EnemyMassConstants.FireSnakeMass; Physics.IsMovable = false; Physics.Bounds = new Rectangle((int)Physics.Location.X, (int)Physics.Location.Y, EnemySpriteFactory.GetEnemyWidth(this), EnemySpriteFactory.GetEnemyHeight(this)); EnemyCollisionHandler = new EnemyCollisionHandler(this); CurrentState = new FollowFireSnakeState(this); HasChild = false; Expired = false; Damage = GameData.Instance.EnemyDamageConstants.FireSnakeDamage; DamageTimer = 0; MoveSpeed = GameData.Instance.EnemySpeedConstants.RedFireSnakeSpeed; CurrentTint = LoZGame.Instance.DefaultTint; AI = EnemyAI.Segment; DropTable = GameData.Instance.EnemyDropTables.EmptyDropTable; }
public SpikeCross(Vector2 location) { Health = new HealthManager(GameData.Instance.EnemyHealthConstants.SpikeCrossHealth); Physics = new Physics(new Vector2(location.X, location.Y)); Physics.Mass = GameData.Instance.EnemyMassConstants.SpikeCrossMass; Physics.Bounds = new Rectangle((int)Physics.Location.X, (int)Physics.Location.Y, EnemySpriteFactory.GetEnemyWidth(this), EnemySpriteFactory.GetEnemyHeight(this)); CurrentState = new SpawnEnemyState(this); EnemyCollisionHandler = new EnemyCollisionHandler(this); InitialPos = Physics.Bounds.Location; Expired = false; IsKillable = false; Damage = GameData.Instance.EnemyDamageConstants.SpikeCrossDamage; DamageTimer = 0; CurrentTint = LoZGame.Instance.DefaultTint; //CurrentTint = Color.White; AI = EnemyAI.SpikeCross; DropTable = GameData.Instance.EnemyDropTables.EmptyDropTable; IsTransparent = true; ApplyDamageMod(); ApplySmallSpeedMod(); ApplyLargeWeightModPos(); }
public GleeokBody(Vector2 location) { RandomStateGenerator = new RandomStateGenerator(this); States = new Dictionary <RandomStateGenerator.StateType, int>() { { RandomStateGenerator.StateType.Idle, 1 } }; Health = new HealthManager(GameData.Instance.EnemyHealthConstants.ManhandlaBodyHealth); Physics = new Physics(location); Physics.Mass = GameData.Instance.EnemyMassConstants.DragonMass; Physics.IsMovable = false; CurrentState = new IdleEnemyState(this); Physics.Bounds = new Rectangle((int)Physics.Location.X, (int)Physics.Location.Y, EnemySpriteFactory.GetEnemyWidth(this), EnemySpriteFactory.GetEnemyHeight(this)); EnemyCollisionHandler = new EnemyCollisionHandler(this); Expired = false; IsTransparent = true; Damage = GameData.Instance.EnemyDamageConstants.DragonDamage; DamageTimer = 0; MoveSpeed = GameData.Instance.EnemySpeedConstants.ManhandlaMinSpeed; CurrentTint = LoZGame.Instance.DefaultTint; spawnedChildren = false; AI = EnemyAI.NoSpawn; DropTable = GameData.Instance.EnemyDropTables.GleeokDropTable; IsSpawning = false; }
public Gel(Vector2 location) { RandomStateGenerator = new RandomStateGenerator(this); States = new Dictionary <RandomStateGenerator.StateType, int>(GameData.Instance.EnemyStateWeights.GelStateList); Health = new HealthManager(GameData.Instance.EnemyHealthConstants.GelHealth); Physics = new Physics(location); Physics.Mass = GameData.Instance.EnemyMassConstants.GelMass; Physics.Bounds = new Rectangle((int)Physics.Location.X, (int)Physics.Location.Y, EnemySpriteFactory.GetEnemyWidth(this), EnemySpriteFactory.GetEnemyHeight(this)); EnemyCollisionHandler = new EnemyCollisionHandler(this); Expired = false; Damage = GameData.Instance.EnemyDamageConstants.GelDamage; DamageTimer = 0; MoveSpeed = GameData.Instance.EnemySpeedConstants.GelSpeed; CurrentTint = LoZGame.Instance.DefaultTint; CurrentState = new SpawnEnemyState(this); AI = EnemyAI.Gel; DropTable = GameData.Instance.EnemyDropTables.EmptyDropTable; ApplyDamageMod(); ApplySmallSpeedMod(); ApplySmallWeightModPos(); ApplySmallHealthMod(); }
public GleeokHeadOff(IEnemy body, Point spawnPoint) { parent = body; RandomStateGenerator = new RandomStateGenerator(this); States = new Dictionary <RandomStateGenerator.StateType, int>(GameData.Instance.EnemyStateWeights.GleeokHeadOffStateList); Health = new HealthManager(1); Physics = new Physics(spawnPoint.ToVector2()); Physics.Mass = 1; Physics.IsMovable = false; CurrentState = new IdleEnemyState(this); Physics.Bounds = new Rectangle((int)Physics.Location.X, (int)Physics.Location.Y, EnemySpriteFactory.GetEnemyWidth(this), EnemySpriteFactory.GetEnemyHeight(this)); EnemyCollisionHandler = new EnemyCollisionHandler(this); IsTransparent = true; IsKillable = false; Expired = false; Damage = GameData.Instance.EnemyDamageConstants.FullHeart; MoveSpeed = GameData.Instance.EnemySpeedConstants.GleeokHeadOffSpeed; DamageTimer = 0; MinMaxWander = new Point(LoZGame.Instance.UpdateSpeed); CurrentTint = LoZGame.Instance.DefaultTint; IsBossPart = true; HasChild = false; AI = EnemyAI.GleeokHeadOff; DropTable = GameData.Instance.EnemyDropTables.EmptyDropTable; IsSpawning = false; ApplyDamageMod(); ApplyLargeSpeedMod(); }