/// <summary> /// Changes from one room to the room specified /// </summary> /// <param name="destinationRoom">Room to change to</param> public void ChangeRoom(Door door) { loadingTime = 0; game.GameState = GameState.RoomChange; ThreadStart threadStarter = delegate { // Delete all current doors in the game //foreach (Door door in game.DoorComponent.All) //{ // game.GarbagemanSystem.ScheduleVisit(door.EntityID); //} // Delete all the current rooms in the game //foreach (Room room in game.RoomComponent.All) //{ // game.GarbagemanSystem.ScheduleVisit(room.EntityID); //} // Load the destination room uint lastRoomEid = game.CurrentRoomEid; if (door.DestinationRoom == "TestDungeon1" && game.RoomComponent[lastRoomEid].roomName == "TestDungeon3" && game.QuestLogSystem.currentQuest.questName == QuestName.ReachNextRoom && game.QuestLogSystem.currentQuest.questStatus == QuestStatus.InProgress) { game.QuestLogSystem.currentQuest.questStatus = QuestStatus.Finished; game.QuestComponent[game.QuestLogSystem.currentQuest.EntityID] = game.QuestLogSystem.currentQuest; } DungeonCrawlerGame.LevelManager.LoadLevel(door.DestinationRoom); CleanupLastRoom(lastRoomEid); // Don't proceed until the room has finished loading // We wait for a certain time so that the screen doesn't flash black very quickly and then to the new room. while (loadingTime < 0.25f || DungeonCrawlerGame.LevelManager.Loading) { } // Move the player to a new position // TODO: Get this position from the spawn positions in the room foreach (Player player in game.PlayerComponent.All) { Position position = game.PositionComponent[player.EntityID]; position.Center = DungeonCrawlerGame.LevelManager.getCurrentRoom().playerSpawns[door.DestinationSpawnName]; position.RoomID = DungeonCrawlerGame.LevelManager.getCurrentRoom().EntityID; game.PositionComponent[player.EntityID] = position; Collideable collision = game.CollisionComponent[player.EntityID]; collision.RoomID = DungeonCrawlerGame.LevelManager.getCurrentRoom().EntityID; game.CollisionComponent[player.EntityID] = collision; } game.GameState = GameState.Gameplay; }; Thread loadingThread = new Thread(threadStarter); loadingThread.Start(); }
// Use this for initialization protected virtual void Start() { m_BoxCollider = GetComponent <BoxCollider2D>(); m_BasicMovement = this.GetComponent <BasicMovement>(); m_Flash = GetComponent <Flash>(); if (m_Flash == null) { m_Flash = GetComponentInChildren <Flash>(); if (m_Flash == null) { m_Flash = gameObject.AddComponent <Flash>(); } } m_Collideable = GetComponent <Collideable>(); if (m_Collideable == null) { m_Collideable = gameObject.AddComponent <Collideable>(); } m_DetectMovingPlat = GetComponent <DetectMovingPlat>(); if (m_DetectMovingPlat == null) { m_DetectMovingPlat = gameObject.AddComponent <DetectMovingPlat>(); } }
public void Kill(Collideable killer) { PrepareGameOver(); info.killer = killer.name; UnityEngine.SceneManagement.SceneManager.LoadScene("gameOver"); }
public uint CreateSkillAoE(Skills skill, Vector2 direction, Position position) { SkillAoE skillAoE; Movement movement; Sprite sprite; Collideable collideable; uint eid = Entity.NextEntity(); position.EntityID = eid; position.Center += direction * 70; switch (skill) { default: throw new Exception("Not a AoE skill"); } collideable = new Collideable() { EntityID = eid, Bounds = new CircleBounds(position.Center, position.Radius), }; game.SkillAoEComponent.Add(eid, skillAoE); game.MovementComponent.Add(eid, movement); game.PositionComponent.Add(eid, position); game.SpriteComponent.Add(eid, sprite); game.CollisionComponent.Add(eid, collideable); return eid; }
public uint CreateDoor(uint roomId, string destinationRoom, string destinationSpawn, Rectangle rectangle) { uint entityID = Entity.NextEntity(); /*Texture2D spriteSheet = game.Content.Load<Texture2D>(""); * spriteSheet.Name = "";*/ Position position = new Position() { EntityID = entityID, // Center and Radius TBD Later Center = new Vector2(rectangle.Left, rectangle.Top), Radius = 32f, RoomID = roomId }; game.PositionComponent[entityID] = position; Collideable collideable = new Collideable() { EntityID = entityID, RoomID = position.RoomID, Bounds = new RectangleBounds(rectangle.Left, rectangle.Top, rectangle.Width, rectangle.Height), // Center and Radius TBD Later }; game.CollisionComponent[entityID] = collideable; Local local = new Local() { EntityID = entityID, }; game.LocalComponent[entityID] = local; Door door = new Door() { EntityID = entityID, DestinationRoom = destinationRoom, DestinationSpawnName = destinationSpawn, Locked = false, Closed = false, }; game.DoorComponent[entityID] = door; /*Sprite sprite = new Sprite() * { * EntityID = entityID, * // TODO: SpriteSheet and SpriteBounds need a sprite and its bounds. I'm * // waiting to see what the dungeons look like before choosing a sprite * // so that the door sprite matches the dungeon theme. * SpriteSheet = null, * SpriteBounds = new Rectangle(0, 0, 0, 0), * }; * game.SpriteComponent[entityID] = sprite;*/ return(entityID); }
/// <summary> /// Check for collision with rects in all direction of character rect /// </summary> /// <param name="otherObj">Collideable rects</param> public void Collision(Collideable otherObj) { CollisionLeft(otherObj); CollisionRight(otherObj); CollisionTop(otherObj); CollisionBottom(otherObj); NewDestinatinBoxPos(); }
public virtual void Collision(Collideable otherObj) { if (otherObj is Character) { Character character = (Character)otherObj; character.inventory.AddItem(this); } }
private void tellCollision(GameObject A, GameObject B) { Collideable objI = A.gameObject.GetComponent <Collideable>(); if (objI) { objI.InformCollision(B); } }
/// <summary> /// Check for collision with rects in all direction of character rect /// </summary> /// <param name="otherObj">Collideable rects</param> public void Collision(Collideable otherObj) { //Rectangle collisionRect = Rectangle.Intersect(CollisionBox(), otherObj.CollisionBox()); CollisionLeft(otherObj); CollisionRight(otherObj); CollisionTop(otherObj); CollisionBottom(otherObj); NewDestinatinBoxPos(); }
public uint CreateSkillProjectile(SkillType skillP, Facing facing, Position position, int rankP, int speed) { SkillProjectile skillProjectile; Movement movement; Sprite sprite; Collideable collideable; uint eid = Entity.NextEntity(); Vector2 direction = getDirectionFromFacing(facing); position.EntityID = eid; position.Center += direction * 70; switch (skillP) { case SkillType.BenignParasite: skillProjectile = new SkillProjectile() { EntityID = eid, skill = skillP, maxRange = 1, rank = rankP, }; movement = new Movement() { EntityID = eid, Direction = direction, Speed = speed, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load <Texture2D>("Spritesheets/BlueBullet"), SpriteBounds = new Rectangle(0, 0, 10, 10), }; position.Radius = 5; break; default: throw new Exception("Not a projectile skill"); } collideable = new Collideable() { EntityID = eid, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius), }; game.SkillProjectileComponent.Add(eid, skillProjectile); game.MovementComponent.Add(eid, movement); game.PositionComponent.Add(eid, position); game.SpriteComponent.Add(eid, sprite); game.CollisionComponent.Add(eid, collideable); return(eid); }
public uint CreateDoor(uint roomId, string destinationRoom, string destinationSpawn, Rectangle rectangle) { uint entityID = Entity.NextEntity(); /*Texture2D spriteSheet = game.Content.Load<Texture2D>(""); spriteSheet.Name = "";*/ Position position = new Position() { EntityID = entityID, // Center and Radius TBD Later Center = new Vector2(rectangle.Left, rectangle.Top), Radius = 32f, RoomID = roomId }; game.PositionComponent[entityID] = position; Collideable collideable = new Collideable() { EntityID = entityID, RoomID = position.RoomID, Bounds = new RectangleBounds(rectangle.Left,rectangle.Top,rectangle.Width,rectangle.Height), // Center and Radius TBD Later }; game.CollisionComponent[entityID] = collideable; Local local = new Local() { EntityID = entityID, }; game.LocalComponent[entityID] = local; Door door = new Door() { EntityID = entityID, DestinationRoom = destinationRoom, DestinationSpawnName = destinationSpawn, Locked = false, Closed = false, }; game.DoorComponent[entityID] = door; /*Sprite sprite = new Sprite() { EntityID = entityID, // TODO: SpriteSheet and SpriteBounds need a sprite and its bounds. I'm // waiting to see what the dungeons look like before choosing a sprite // so that the door sprite matches the dungeon theme. SpriteSheet = null, SpriteBounds = new Rectangle(0, 0, 0, 0), }; game.SpriteComponent[entityID] = sprite;*/ return entityID; }
public override void Collision(Collideable otherObj) { if (otherObj is Character) { Character character = (Character)otherObj; if (playerType == character.playerType) { character.inventory.AddItem(this); } } }
/// <summary> /// Creates a new bullet and adds it to the game. (Will also create the position, movement, and sprite components) /// </summary> /// <param name="type"></param> /// <param name="position"></param> /// <param name="direction"></param> public uint CreateBullet(BulletType type, Vector2 direction, Position position) { Bullet bullet; Movement movement; Sprite sprite; Collideable collideable; uint eid = Entity.NextEntity(); position.EntityID = eid; position.Center += direction * 70; switch (type) { case BulletType.StandardBullet: bullet = _standardBullet; bullet.EntityID = eid; movement = new Movement() { EntityID = eid, Direction = direction, Speed = 300, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load <Texture2D>("Spritesheets/BlueBullet"), SpriteBounds = new Rectangle(0, 0, 10, 10), }; position.Radius = 5; break; default: throw new Exception("Unknown BulletType"); } collideable = new Collideable() { EntityID = eid, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius), }; _game.BulletComponent.Add(eid, bullet); _game.MovementComponent.Add(eid, movement); _game.PositionComponent.Add(eid, position); _game.SpriteComponent.Add(eid, sprite); _game.CollisionComponent.Add(eid, collideable); return(eid); }
public bool CollisionBottom(Collideable otherObj) { Rectangle collisionRect = Rectangle.Intersect(CollisionBox(), otherObj.CollisionBox()); //Top collision if (otherObj.CollisionBox().Top < CollisionBox().Bottom && otherObj.CollisionBox().Top >= prevDestinationBox.Bottom) { position = new Vector2(position.X, (float)collisionRect.Top - destinationBox.Height); velocity = new Vector2(velocity.X, 0); return true; } return false; }
/// <summary> /// Handles creating the collision box for the weapon. /// </summary> /// <param name="playerID">Player's EntityID</param> /// <param name="weaponID">Weapon's EntityID</param> private void CreateWeaponCollision(uint playerID, uint weaponID) { uint roomID = _positionComponent[playerID].RoomID; Collideable weaponCollision = new Collideable { EntityID = weaponID, RoomID = roomID }; Facing facing = (Facing)_game.SpriteAnimationComponent[playerID].CurrentAnimationRow; Vector2 position = updatePositionByFacing(_positionComponent[playerID], facing, 32); RectangleBounds rb = new RectangleBounds((int)position.X, (int)position.Y, 64, 64); weaponCollision.Bounds = rb; _collisionComponent.Add(weaponCollision.EntityID, weaponCollision); }
public void Collision(Collideable otherObj) { if (otherObj is Character) { Character character = (Character)otherObj; Key key = (Key) character.inventory.HasItemOfType(typeof(Key)); if(key != null) { if (key.playerType == playerType) { character.inventory.RemoveItem(key); Open(); } } } }
/// <summary> /// Changes from one room to the room specified /// </summary> /// <param name="destinationRoom">Room to change to</param> public void ChangeRoom(Door door) { loadingTime = 0; game.GameState = GameState.RoomChange; ThreadStart threadStarter = delegate { // Load the destination room uint lastRoomEid = game.CurrentRoomEid; if (door.DestinationRoom == "D01F01R07" && game.RoomComponent[lastRoomEid].roomName == "D01F01R06" && game.QuestLogSystem.ActiveQuests.Contains(0)) { game.QuestLogSystem.IncremementObjective(0); } DungeonCrawlerGame.LevelManager.LoadLevel(door.DestinationRoom); CleanupLastRoom(lastRoomEid); // Don't proceed until the room has finished loading // We wait for a certain time so that the screen doesn't flash black very quickly and then to the new room. while (loadingTime < 0.25f || DungeonCrawlerGame.LevelManager.Loading) { } // Move the player to a new position // TODO: Get this position from the spawn positions in the room foreach (Player player in game.PlayerComponent.All) { Position position = game.PositionComponent[player.EntityID]; position.Center = DungeonCrawlerGame.LevelManager.getCurrentRoom().playerSpawns[door.DestinationSpawnName]; position.RoomID = DungeonCrawlerGame.LevelManager.getCurrentRoom().EntityID; game.PositionComponent[player.EntityID] = position; Collideable collision = game.CollisionComponent[player.EntityID]; collision.RoomID = DungeonCrawlerGame.LevelManager.getCurrentRoom().EntityID; game.CollisionComponent[player.EntityID] = collision; } game.GameState = GameState.Gameplay; }; Thread loadingThread = new Thread(threadStarter); loadingThread.Start(); }
// Start is called before the first frame update void Start() { Collideable c = GetComponent <Collideable>(); c.onCollideDeleage += onCheckPointTouch; if (debugStartPos) { GameObject player = MyGlobal.GetPlayerObject(); player.transform.position = transform.position; player.transform.position = transform.position; GameObject cam = GameObject.Find("MainCamera"); if (cam != null) { cam.transform.position = transform.position; } } }
public uint CreateSkillDeployable(SkillType skill, Position position, int rankP) { SkillDeployable skillDeployable; Sprite sprite; Collideable collideable; uint eid = Entity.NextEntity(); position.EntityID = eid; switch (skill) { case SkillType.PortableShop: skillDeployable = new SkillDeployable() { EntityID = eid, duration = 1, rank = rankP, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load <Texture2D>("Spritesheets/shop"), SpriteBounds = new Rectangle(343, 50, 24, 25), }; position.Radius = 5; break; default: throw new Exception("Not a Deployable skill"); } collideable = new Collideable() { EntityID = eid, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius), }; game.SkillDeployableComponent.Add(eid, skillDeployable); game.PositionComponent.Add(eid, position); game.SpriteComponent.Add(eid, sprite); game.CollisionComponent.Add(eid, collideable); return(eid); }
public uint CreateSkillAoE(SkillType skill, Position position, int rankP) { SkillAoE skillAoE; Sprite sprite; Collideable collideable; uint eid = Entity.NextEntity(); position.EntityID = eid; switch (skill) { case SkillType.Detnate: skillAoE = new SkillAoE() { EntityID = eid, radius = 1, rank = rankP, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load <Texture2D>("Spritesheets/BlueBullet"), SpriteBounds = new Rectangle(0, 0, 10, 10), }; position.Radius = 5; break; default: throw new Exception("Not a AoE skill"); } collideable = new Collideable() { EntityID = eid, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius), }; game.SkillAoEComponent.Add(eid, skillAoE); game.PositionComponent.Add(eid, position); game.SpriteComponent.Add(eid, sprite); game.CollisionComponent.Add(eid, collideable); return(eid); }
/// <summary> /// Updates weapon's collision box to the players position. /// </summary> /// <param name="playerID">Player's EntityID</param> /// <param name="weaponID">Weapons's EntityID</param> private void UpdateWeaponCollision(uint playerID, uint weaponID) { Collideable collision = _collisionComponent[weaponID]; Position playerPosition = _positionComponent[playerID]; Facing facing = (Facing)_game.SpriteAnimationComponent[playerID].CurrentAnimationRow; if (collision.Bounds is CircleBounds) { ((CircleBounds)collision.Bounds).Center = playerPosition.Center; } else { Vector2 newPos = updatePositionByFacing(playerPosition, facing, 32); ((RectangleBounds)collision.Bounds).Rectangle.X = (int)newPos.X; ((RectangleBounds)collision.Bounds).Rectangle.Y = (int)newPos.Y; } _collisionComponent[weaponID] = collision; }
public uint CreateSkillDeployable(Skills skill, Position position) { SkillDeployable skillDeployable; Sprite sprite; Collideable collideable; uint eid = Entity.NextEntity(); position.EntityID = eid; switch (skill) { case Skills.healingStation: skillDeployable = new SkillDeployable() { EntityID = eid, duration = 1, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load <Texture2D>("Spritesheets/BlueBullet"), SpriteBounds = new Rectangle(0, 0, 10, 10), }; position.Radius = 5; break; default: throw new Exception("Not a Deployable skill"); } collideable = new Collideable() { EntityID = eid, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius), }; game.SkillDeployableComponent.Add(eid, skillDeployable); game.PositionComponent.Add(eid, position); game.SpriteComponent.Add(eid, sprite); game.CollisionComponent.Add(eid, collideable); return(eid); }
public uint CreateWall(uint roomId, Rectangle bounds) { uint entityID = Entity.NextEntity(); /*Texture2D spriteSheet = game.Content.Load<Texture2D>(""); * spriteSheet.Name = "";*/ //It's assumed in collisions that anything in position/collideable but not in other // components is a static object (like a wall) Position position = new Position() { EntityID = entityID, // Center and Radius TBD Later Center = new Vector2(bounds.Left, bounds.Top), Radius = 1, RoomID = roomId, }; game.PositionComponent[entityID] = position; Collideable collideable = new Collideable() { EntityID = entityID, RoomID = position.RoomID, Bounds = new RectangleBounds(bounds.Left, bounds.Top, bounds.Width, bounds.Height), // Center and Radius TBD Later }; game.CollisionComponent[entityID] = collideable; Local local = new Local() { EntityID = entityID, }; game.LocalComponent[entityID] = local; return(entityID); }
public uint CreateWall(uint roomId, Rectangle bounds) { uint entityID = Entity.NextEntity(); /*Texture2D spriteSheet = game.Content.Load<Texture2D>(""); spriteSheet.Name = "";*/ //It's assumed in collisions that anything in position/collideable but not in other // components is a static object (like a wall) Position position = new Position() { EntityID = entityID, // Center and Radius TBD Later Center = new Vector2(bounds.Left, bounds.Top), Radius = 1, RoomID = roomId, }; game.PositionComponent[entityID] = position; Collideable collideable = new Collideable() { EntityID = entityID, RoomID = position.RoomID, Bounds = new RectangleBounds(bounds.Left,bounds.Top, bounds.Width, bounds.Height), // Center and Radius TBD Later }; game.CollisionComponent[entityID] = collideable; Local local = new Local() { EntityID = entityID, }; game.LocalComponent[entityID] = local; return entityID; }
// Use this for initialization void Start() { Collideable c = GetComponent <Collideable>(); if (tryDamageOther) { c.onCollideDeleage += TryDamageOther; } if (tryHealOther) { c.onCollideDeleage += TryHealOther; } if (audioClip != null) { c.onCollideDeleage += PlaySound; } if (myEvent != null) { c.onCollideDeleage += CallEvent; } if (destroySelf) { c.onCollideDeleage += DestroySelf; } if (addBingo) { c.onCollideDeleage += AddBingo; } if (giveEnergy) { c.onCollideDeleage += GiveOtherEnergy; } if (eventToRaise != null) { c.onCollideDeleage += raiseEvent; } }
/// <summary> /// Creates a new bullet and adds it to the game. (Will also create the position, movement, and sprite components) /// </summary> /// <param name="type"></param> /// <param name="position"></param> /// <param name="direction"></param> public uint CreateBullet(BulletType type, Vector2 direction, Position position) { Bullet bullet; Movement movement; Sprite sprite; Collideable collideable; uint eid = Entity.NextEntity(); position.EntityID = eid; position.Center += direction * 70; switch (type) { case BulletType.StandardBullet: bullet = _standardBullet; bullet.EntityID = eid; movement = new Movement() { EntityID = eid, Direction = direction, Speed = 300, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/BlueBullet"), SpriteBounds = new Rectangle(0, 0, 10, 10), }; position.Radius = 5; break; default: throw new Exception("Unknown BulletType"); } collideable = new Collideable() { EntityID = eid, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius), }; _game.BulletComponent.Add(eid, bullet); _game.MovementComponent.Add(eid, movement); _game.PositionComponent.Add(eid, position); _game.SpriteComponent.Add(eid, sprite); _game.CollisionComponent.Add(eid, collideable); return eid; }
/// <summary> /// Creates a new npc and adds it to the game. (No other components created) /// </summary> /// <param name="name">The type of npc to create.</param> public uint CreateNPC(NPCName name, Position position) { uint eid = Entity.NextEntity(); NPC npc; Sprite sprite; Collideable collideable; Texture2D spriteSheet; Movement movement; SpriteAnimation spriteAnimation; NpcAI ai; switch (name) { case NPCName.Trollph: sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/NPC/trollph"), SpriteBounds = new Rectangle(0, 0, 64, 64), }; ai = new NpcAI() { EntityID = eid, Type = NPCType.Background, }; _game.NpcAIComponent.Add(eid, ai); break; case NPCName.DarkRalph: sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/NPC/darkralph"), SpriteBounds = new Rectangle(0, 0, 64, 64), }; ai = new NpcAI() { EntityID = eid, Type = NPCType.Background, }; _game.NpcAIComponent.Add(eid, ai); break; default: throw new Exception("Unknown NPC"); } npc.EntityID = eid; npc.Type = name; position.EntityID = eid; spriteAnimation = new SpriteAnimation() { EntityID = eid, FramesPerSecond = 10, IsLooping = true, IsPlaying = false, TimePassed = 0f, CurrentFrame = 0, CurrentAnimationRow = 0 }; _game.SpriteAnimationComponent[eid] = spriteAnimation; movement = new Movement() { EntityID = eid, }; _game.MovementComponent[eid] = movement; collideable = new Collideable() { EntityID = eid, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius) }; _game.CollisionComponent[eid] = collideable; _game.NPCComponent.Add(eid, npc); _game.PositionComponent.Add(eid, position); _game.SpriteComponent.Add(eid, sprite); return eid; }
/// <summary> /// For using basic projectile: rank is damage, use last parameter for spritesheet /// </summary> /// <param name="skillP"></param> /// <param name="direction"></param> /// <param name="position"></param> /// <param name="rankP"></param> /// <param name="speed"></param> /// <param name="owner"></param> /// <param name="canHitPlayers"></param> /// <param name="canHitEnemies"></param> /// <param name="spriteSheet"></param> /// <returns></returns> public uint CreateSkillProjectile(SkillType skillP, Vector2 direction, Position position, int rankP, int speed, uint owner, bool canHitPlayers = false, bool canHitEnemies = true, string spriteSheet = null, Rectangle spriteBounds = new Rectangle()) { SkillProjectile skillProjectile; Movement movement; Sprite sprite; Collideable collideable; uint eid = Entity.NextEntity(); direction = Vector2.Normalize(direction); position.EntityID = eid; position.Center += direction * 40; switch (skillP) { #region Vermis Projectiles case SkillType.ThrownBlades: skillProjectile = new SkillProjectile() { EntityID = eid, skill = skillP, maxRange = 1, rank = rankP, CanHitEnemies = canHitEnemies, CanHitPlayers = canHitPlayers, }; movement = new Movement() { EntityID = eid, Direction = direction, Speed = speed, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load<Texture2D>("Spritesheets/Skills/skillPlaceHolder2"), SpriteBounds = new Rectangle(0, 250, 50, 50), }; position.Radius = 10; break; case SkillType.MaliciousParasite: skillProjectile = new SkillProjectile() { EntityID = eid, skill = skillP, maxRange = 1, rank = rankP, CanHitEnemies = canHitEnemies, CanHitPlayers = canHitPlayers, }; movement = new Movement() { EntityID = eid, Direction = direction, Speed = speed, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load<Texture2D>("Spritesheets/Skills/skillPlaceHolder2"), SpriteBounds = new Rectangle(300, 150, 50, 50), }; position.Radius = 10; break; case SkillType.MindlessParasites: skillProjectile = new SkillProjectile() { EntityID = eid, skill = skillP, maxRange = 1, rank = rankP, CanHitEnemies = canHitEnemies, CanHitPlayers = canHitPlayers, }; movement = new Movement() { EntityID = eid, Direction = direction, Speed = speed, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load<Texture2D>("Spritesheets/Skills/skillPlaceHolder2"), SpriteBounds = new Rectangle(250, 50, 50, 50), }; position.Radius = 10; break; case SkillType.BenignParasite: skillProjectile = new SkillProjectile() { EntityID = eid, skill = skillP, maxRange = 1, rank = rankP, CanHitEnemies = canHitEnemies, CanHitPlayers = canHitPlayers, }; movement = new Movement() { EntityID = eid, Direction = direction, Speed = speed, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load<Texture2D>("Spritesheets/Skills/skillPlaceHolder2"), SpriteBounds = new Rectangle(100, 0, 50, 50), }; position.Radius = 10; break; #endregion #region Cultist Projectiles #region Psionic Spear case SkillType.PsionicSpear: { skillProjectile = new SkillProjectile() { EntityID = eid, skill = skillP, maxRange = 1, rank = rankP, OwnerID = owner, }; movement = new Movement() { EntityID = eid, Direction = direction, Speed = speed, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load<Texture2D>("Spritesheets/Skills/skillPlaceHolder2"), SpriteBounds = new Rectangle(100, 0, 50, 50), }; position.Radius = 10; break; } #endregion #region Enslave case SkillType.Enslave: { skillProjectile = new SkillProjectile() { EntityID = eid, skill = skillP, maxRange = 1, rank = rankP, OwnerID = owner, }; movement = new Movement() { EntityID = eid, Direction = direction, Speed = speed, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load<Texture2D>("Spritesheets/Skills/skillPlaceHolder2"), SpriteBounds = new Rectangle(100, 0, 50, 50), }; position.Radius = 10; break; } #endregion #region Taint case SkillType.Taint: { skillProjectile = new SkillProjectile() { EntityID = eid, skill = skillP, maxRange = 1, rank = rankP, OwnerID = owner, }; movement = new Movement() { EntityID = eid, Direction = direction, Speed = speed, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load<Texture2D>("Spritesheets/Skills/skillPlaceHolder2"), SpriteBounds = new Rectangle(100, 0, 50, 50), }; position.Radius = 10; break; } #endregion #region Rot case SkillType.Rot: { skillProjectile = new SkillProjectile() { EntityID = eid, skill = skillP, maxRange = 1, rank = rankP, OwnerID = owner, }; movement = new Movement() { EntityID = eid, Direction = direction, Speed = speed, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load<Texture2D>("Spritesheets/Skills/skillPlaceHolder2"), SpriteBounds = new Rectangle(100, 0, 50, 50), }; position.Radius = 10; break; } #endregion #endregion case SkillType.SniperShot: skillProjectile = new SkillProjectile() { EntityID = eid, skill = skillP, maxRange = 800, rank = rankP, CanHitEnemies = canHitEnemies, CanHitPlayers = canHitPlayers, }; movement = new Movement() { EntityID = eid, Direction = direction, Speed = speed, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/AlienOrb"), SpriteBounds = new Rectangle(0, 0, 20, 20), }; position.Radius = 10; break; case SkillType.BasicRangedAttack: skillProjectile = new SkillProjectile() { EntityID = eid, skill = skillP, maxRange = 800, rank = rankP, CanHitEnemies = canHitEnemies, CanHitPlayers = canHitPlayers, }; movement = new Movement() { EntityID = eid, Direction = direction, Speed = speed, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load<Texture2D>(spriteSheet), SpriteBounds = spriteBounds, }; position.Radius = 10; break; default: throw new Exception("Not a projectile skill"); } collideable = new Collideable() { EntityID = eid, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius), }; game.SkillProjectileComponent.Add(eid, skillProjectile); game.MovementComponent.Add(eid, movement); game.PositionComponent.Add(eid, position); game.SpriteComponent.Add(eid, sprite); game.CollisionComponent.Add(eid, collideable); return eid; }
/// <summary> /// Creates a new enemy and adds it to the game. (No other components created) /// </summary> /// <param name="type">The type of enemy to create.</param> public uint CreateEnemy(EnemyFactoryType type, Position position) { uint eid = Entity.NextEntity(); Enemy enemy = new Enemy(); Sprite sprite; Collideable collideable; switch (type) { case EnemyFactoryType.StationaryTarget: enemy.HurtOnTouch = false; enemy.Health = 1; sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/target2"), SpriteBounds = new Rectangle(0, 0, 64, 64), }; break; case EnemyFactoryType.MovingTarget: enemy.HurtOnTouch = false; enemy.Health = 1; sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/target2"), SpriteBounds = new Rectangle(0, 0, 64, 64), }; Movement move = new Movement() { EntityID = eid, }; _game.MovementComponent.Add(eid, move); EnemyAI ai = new EnemyAI() { EntityID = eid, }; _game.EnemyAIComponent.Add(eid, ai); break; default: throw new Exception("Unknown EnemyType"); } EnemyType enemyType; switch (type) { case EnemyFactoryType.MovingTarget: case EnemyFactoryType.StationaryTarget: enemyType = EnemyType.Target; break; default: throw new NotImplementedException(); } enemy.Type = enemyType; enemy.EntityID = eid; position.EntityID = eid; collideable = new Collideable() { EntityID = eid, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius) }; _game.CollisionComponent[eid] = collideable; _game.EnemyComponent.Add(eid, enemy); //_game.MovementComponent.Add(eid, movement); _game.PositionComponent.Add(eid, position); _game.SpriteComponent.Add(eid, sprite); return eid; }
/// <summary> /// Add a collideable to the collideable list. /// </summary> /// <param name="collideable">The collideable that shuld be added.</param> public void RegisterObject(Collideable collideable) { this.collideable.Add(collideable); }
public uint CreateSkillAoE(SkillType skill, Position position, int rankP, int radius) { SkillAoE skillAoE; Sprite sprite; Collideable collideable; uint eid = Entity.NextEntity(); position.EntityID = eid; switch (skill) { #region Gargranian AOE Skills #region Detonate case SkillType.ImprovedPsionicSpear: { skillAoE = new SkillAoE() { EntityID = eid, radius = 1, rank = rankP, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load <Texture2D>("Spritesheets/Weapons/Bullets/BlueBullet"), SpriteBounds = new Rectangle(0, 0, 10, 10), }; position.Radius = radius; break; } #endregion #endregion #region Cultist AOE Skills #region Fear case SkillType.Fear: { skillAoE = new SkillAoE() { EntityID = eid, radius = 1, rank = rankP, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load <Texture2D>("Spritesheets/Weapons/Bullets/BlueBullet"), SpriteBounds = new Rectangle(0, 0, 10, 10), }; position.Radius = radius; break; } #endregion #region Push case SkillType.Push: { skillAoE = new SkillAoE() { EntityID = eid, radius = 1, rank = rankP, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load <Texture2D>("Spritesheets/Weapons/Bullets/BlueBullet"), SpriteBounds = new Rectangle(0, 0, 10, 10), }; position.Radius = radius; break; } #endregion #region Malice case SkillType.Malice: { skillAoE = new SkillAoE() { EntityID = eid, radius = 1, rank = rankP, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load <Texture2D>("Spritesheets/Weapons/Bullets/BlueBullet"), SpriteBounds = new Rectangle(0, 0, 10, 10), }; position.Radius = radius; break; } #endregion #endregion default: throw new Exception("Not a AoE skill"); } collideable = new Collideable() { EntityID = eid, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius), }; game.SkillAoEComponent.Add(eid, skillAoE); game.PositionComponent.Add(eid, position); game.SpriteComponent.Add(eid, sprite); game.CollisionComponent.Add(eid, collideable); return(eid); }
/// <summary> /// Creates a new npc and adds it to the game. (No other components created) /// </summary> /// <param name="name">The type of npc to create.</param> public uint CreateNPC(NPCName name, Position position) { uint eid = Entity.NextEntity(); NPC npc; Sprite sprite; Collideable collideable; Texture2D spriteSheet; Movement movement; SpriteAnimation spriteAnimation; NpcAI ai; switch (name) { case NPCName.Trollph: sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load <Texture2D>("Spritesheets/trollph"), SpriteBounds = new Rectangle(0, 0, 64, 64), }; ai = new NpcAI() { EntityID = eid, Type = NPCType.Background, }; _game.NpcAIComponent.Add(eid, ai); break; case NPCName.DarkRalph: sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load <Texture2D>("Spritesheets/darkralph"), SpriteBounds = new Rectangle(0, 0, 64, 64), }; ai = new NpcAI() { EntityID = eid, Type = NPCType.Background, }; _game.NpcAIComponent.Add(eid, ai); break; default: throw new Exception("Unknown NPC"); } npc.EntityID = eid; npc.Type = name; position.EntityID = eid; spriteAnimation = new SpriteAnimation() { EntityID = eid, FramesPerSecond = 10, IsLooping = true, IsPlaying = false, TimePassed = 0f, CurrentFrame = 0, CurrentAnimationRow = 0 }; _game.SpriteAnimationComponent[eid] = spriteAnimation; movement = new Movement() { EntityID = eid, }; _game.MovementComponent[eid] = movement; collideable = new Collideable() { EntityID = eid, Bounds = new CircleBounds(position.Center, position.Radius) }; _game.CollisionComponent[eid] = collideable; _game.NPCComponent.Add(eid, npc); _game.PositionComponent.Add(eid, position); _game.SpriteComponent.Add(eid, sprite); return(eid); }
/// <summary> /// Creates a new enemy and adds it to the game. (No other components created) /// </summary> /// <param name="type">The type of enemy to create.</param> public uint CreateEnemy(EnemyType type, Position position) { uint eid = Entity.NextEntity(); Enemy enemy = new Enemy(); Sprite sprite; SpriteAnimation spriteAnimation = new SpriteAnimation(eid); Collideable collideable; EnemyAI ai; AIBehaviorType aiBehaviorType = AIBehaviorType.None; float moveSpeed = 100; String spritesheet; Rectangle spriteBounds = new Rectangle(0, 0, 64, 64); Color spriteColor = Color.White; switch (type) { case EnemyType.StationaryTarget: enemy.HurtOnTouch = false; enemy.Health = 1; spritesheet = "Spritesheets/Enemies/target2"; break; case EnemyType.MovingTarget: enemy.HurtOnTouch = false; enemy.Health = 1; spritesheet = "Spritesheets/Enemies/target2"; break; case EnemyType.Spider: enemy.HurtOnTouch = false; enemy.Health = 20; spritesheet = "Spritesheets/Enemies/spider"; spriteBounds = new Rectangle(0, 0, 120 / 3, 141 / 4); aiBehaviorType = AIBehaviorType.Spider; moveSpeed = 115; spriteAnimation.FramesPerSecond = 14; break; case EnemyType.CloakingRobot: enemy.HurtOnTouch = false; enemy.Health = 50; spritesheet = "Spritesheets/Enemies/CloakingRobot"; spriteColor = Color.LightCyan; spriteBounds = new Rectangle(0, 0, 65, 75); spriteAnimation.FramesPerSecond = 5; aiBehaviorType = AIBehaviorType.CloakingRanged; position.Radius = 37; break; case EnemyType.BasicShootingRobot: enemy.HurtOnTouch = false; enemy.Health = 50; spritesheet = "Spritesheets/Enemies/BasicShootingRobot"; spriteBounds = new Rectangle(0, 0, 65, 75); spriteAnimation.FramesPerSecond = 5; aiBehaviorType = AIBehaviorType.DefaultRanged; position.Radius = 32; break; case EnemyType.Sludge1: enemy.HurtOnTouch = false; enemy.Health = 20; spritesheet = "Spritesheets/Enemies/Sludge1"; spriteBounds = new Rectangle(0, 0, 16, 16); spriteAnimation.FramesPerSecond = 10; aiBehaviorType = AIBehaviorType.DefaultMelee; position.Radius = 8; break; case EnemyType.Sludge2: enemy.HurtOnTouch = false; enemy.Health = 30; spritesheet = "Spritesheets/Enemies/Sludge2"; spriteBounds = new Rectangle(0, 0, 32, 32); spriteAnimation.FramesPerSecond = 10; aiBehaviorType = AIBehaviorType.DefaultRanged; position.Radius = 16; break; case EnemyType.Sludge3: enemy.HurtOnTouch = false; enemy.Health = 40; spritesheet = "Spritesheets/Enemies/Sludge3"; spriteBounds = new Rectangle(0, 0, 64, 64); spriteAnimation.FramesPerSecond = 10; aiBehaviorType = AIBehaviorType.DefaultRanged; position.Radius = 32; break; case EnemyType.Sludge4: enemy.HurtOnTouch = false; enemy.Health = 50; spritesheet = "Spritesheets/Enemies/Sludge4"; spriteBounds = new Rectangle(0, 0, 128, 128); spriteAnimation.FramesPerSecond = 10; aiBehaviorType = AIBehaviorType.DefaultRanged; position.Radius = 64; break; case EnemyType.Sludge5: enemy.HurtOnTouch = false; enemy.Health = 60; spritesheet = "Spritesheets/Enemies/Sludge5"; spriteBounds = new Rectangle(0, 0, 256, 256); spriteAnimation.FramesPerSecond = 10; aiBehaviorType = AIBehaviorType.DefaultRanged; position.Radius = 128; break; default: throw new Exception("Unknown EnemyType"); } ai = new EnemyAI() { EntityID = eid, AIBehaviorType = aiBehaviorType, }; _game.EnemyAIComponent.Add(eid, ai); enemy.Type = type; enemy.EntityID = eid; position.EntityID = eid; sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load <Texture2D>(spritesheet), SpriteColor = spriteColor, SpriteBounds = spriteBounds }; collideable = new Collideable() { EntityID = eid, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius) }; Movement move = new Movement() { EntityID = eid, Speed = moveSpeed, }; _game.SpriteAnimationComponent[eid] = spriteAnimation; _game.CollisionComponent[eid] = collideable; _game.MovementComponent.Add(eid, move); _game.EnemyComponent.Add(eid, enemy); _game.PositionComponent.Add(eid, position); _game.SpriteComponent.Add(eid, sprite); return(eid); }
public uint CreateSkillDeployable(Skills skill, Position position) { SkillDeployable skillDeployable; Sprite sprite; Collideable collideable; uint eid = Entity.NextEntity(); position.EntityID = eid; switch (skill) { case Skills.healingStation: skillDeployable = new SkillDeployable() { EntityID = eid, duration = 1, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load<Texture2D>("Spritesheets/BlueBullet"), SpriteBounds = new Rectangle(0, 0, 10, 10), }; position.Radius = 5; break; default: throw new Exception("Not a Deployable skill"); } collideable = new Collideable() { EntityID = eid, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius), }; game.SkillDeployableComponent.Add(eid, skillDeployable); game.PositionComponent.Add(eid, position); game.SpriteComponent.Add(eid, sprite); game.CollisionComponent.Add(eid, collideable); return eid; }
public uint CreateSkillProjectile(Skills skillP, Facing facing, Position position) { SkillProjectile skillProjectile; Movement movement; Sprite sprite; Collideable collideable; uint eid = Entity.NextEntity(); Vector2 direction = getDirectionFromFacing(facing); position.EntityID = eid; position.Center += direction * 70; switch (skillP) { case Skills.benignParasite: skillProjectile = new SkillProjectile() { EntityID = eid, skill = skillP, maxRange = 1, }; movement = new Movement() { EntityID = eid, Direction = direction, Speed = 300, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load<Texture2D>("Spritesheets/BlueBullet"), SpriteBounds = new Rectangle(0, 0, 10, 10), }; position.Radius = 5; break; default: throw new Exception("Not a projectile skill"); } collideable = new Collideable() { EntityID = eid, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius), }; game.SkillProjectileComponent.Add(eid, skillProjectile); game.MovementComponent.Add(eid, movement); game.PositionComponent.Add(eid, position); game.SpriteComponent.Add(eid, sprite); game.CollisionComponent.Add(eid, collideable); return eid; }
public void Collision(Collideable otherObj) { }
private void HandleDynamicDynamic(uint dID1, uint dID2) { //Need the position for position, the collideable for the bounds type, // and the movement to analyze the amount of pushing that should be done Position pos1 = _game.PositionComponent[dID1]; Position pos2 = _game.PositionComponent[dID2]; Collideable col1 = _game.CollisionComponent[dID1]; Collideable col2 = _game.CollisionComponent[dID2]; Movement mov1 = _game.MovementComponent[dID1]; Movement mov2 = _game.MovementComponent[dID2]; //We'll need different equations for different types of bounds. if (col1.Bounds.GetType() == typeof(CircleBounds) && col2.Bounds.GetType() == typeof(CircleBounds)) { CircleBounds c1 = (CircleBounds)col1.Bounds; CircleBounds c2 = (CircleBounds)col2.Bounds; //Angle from c1 to c2 double angle = Math.Atan2(c2.Center.Y - c1.Center.Y, c2.Center.X - c1.Center.X); double distance = Math.Abs((c2.Center.Y - c1.Center.Y) / Math.Sin(angle)); double ddistance = c1.Radius + c2.Radius - distance; double x = pos1.Center.X - (Math.Cos(angle) * ddistance); double y = pos1.Center.Y - (Math.Sin(angle) * ddistance); pos1.Center = new Vector2((float)x, (float)y); x = pos2.Center.X + (Math.Cos(angle) * ddistance); y = pos2.Center.Y + (Math.Sin(angle) * ddistance); pos2.Center = new Vector2((float)x, (float)y); //Now determine the pushback from the movement /*Vector2 dMove = (mov1.Direction * mov1.Speed + mov2.Direction * mov2.Speed) / 2; * double moveAngle = Math.Atan2(dMove.Y, dMove.X); * * double dAngle = moveAngle - angle; * * double moveDistance = Math.Cos(dAngle) * dMove.Length(); * * dMove.Normalize(); * * pos1.Center += dMove * (float)moveDistance; * pos2.Center += dMove * (float)moveDistance; */ _game.PositionComponent[dID1] = pos1; _game.PositionComponent[dID2] = pos2; c1.Center = pos1.Center; c2.Center = pos2.Center; col1.Bounds = c1; col2.Bounds = c2; _game.CollisionComponent[dID1] = col1; _game.CollisionComponent[dID2] = col2; } if (col1.Bounds.GetType() != col2.Bounds.GetType()) { bool col1IsRect = (col1.Bounds.GetType() == typeof(CircleBounds)); Position rectPos = (col1IsRect ? pos1 : pos2); Collideable rectCol = (col1IsRect ? col1 : col2); Movement rectMov = (col1IsRect ? mov1 : mov2); RectangleBounds rect = (RectangleBounds)rectCol.Bounds; Position circPos = (col1IsRect ? pos2 : pos1); Collideable circCol = (col1IsRect ? col2 : col1); Movement circMov = (col1IsRect ? mov2 : mov1); CircleBounds circ = (CircleBounds)rectCol.Bounds; //Do your thing here throw new NotImplementedException(); } if (col1.Bounds.GetType() == typeof(RectangleBounds) && col2.Bounds.GetType() == typeof(RectangleBounds)) { //Can this happen? throw new NotImplementedException(); } }
/// <summary> /// Creates Entities from aggregates (collections of components) /// </summary> /// <param name="aggregate">The specific aggreage to create</param> public uint CreateFromGameSave(DungeonCrawlerGame.CharacterSaveFile gameSave, PlayerIndex playerIndex) { uint entityID = 0xFFFFFF; Texture2D spriteSheet; Position position; Movement movement; Sprite sprite; SpriteAnimation spriteAnimation; //MovementSprite movementSprite; Collideable collideable; Local local; Player player; PlayerInfo info; Stats stats = new Stats(); HUDAggregateFactory hudagg = new HUDAggregateFactory(game); InvAggregateFactory invagg = new InvAggregateFactory(game); //Miscelaneous modifyers for the potential ability modifiers //Placeholders for racial/class bonuses and item bonuses. int miscMeleeAttack = 0; int miscRangedAttack = 0; int miscMeleeSpeed = 0; int miscAccuracy = 0; int miscMeleeDef = 0; int miscRangedDef = 0; int miscSpell = 0; int miscHealth = 0; // Create the player { entityID = Entity.NextEntity(); spriteSheet = game.Content.Load <Texture2D>(gameSave.charAnimation); spriteSheet.Name = gameSave.charAnimation; position = new Position() { EntityID = entityID, Center = new Vector2(400, 150), Radius = 32f, }; game.PositionComponent[entityID] = position; collideable = new Collideable() { EntityID = entityID, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius) }; game.CollisionComponent[entityID] = collideable; movement = new Movement() { EntityID = entityID, Direction = new Vector2(0, 1), Speed = 200f, }; game.MovementComponent[entityID] = movement; spriteAnimation = new SpriteAnimation() { EntityID = entityID, FramesPerSecond = 10, IsLooping = true, IsPlaying = true, TimePassed = 0f, CurrentFrame = 0, CurrentAnimationRow = 0 }; game.SpriteAnimationComponent[entityID] = spriteAnimation; sprite = new Sprite() { EntityID = entityID, SpriteBounds = new Rectangle(0, 0, 64, 64), SpriteSheet = spriteSheet }; game.SpriteComponent[entityID] = sprite; local = new Local() { EntityID = entityID, }; game.LocalComponent[entityID] = local; //This will add a stats section for the player in the stats component stats = new Stats() { EntityID = entityID, // Load from game save Strength = gameSave.stats.Strength, Stamina = gameSave.stats.Stamina, Agility = gameSave.stats.Agility, Intelligence = gameSave.stats.Intelligence, Defense = gameSave.stats.Defense }; game.StatsComponent[entityID] = stats; player = new Player() { EntityID = entityID, PlayerIndex = playerIndex, PlayerRace = (Aggregate)gameSave.aggregate, abilityModifiers = new AbilityModifiers() { meleeDamageReduction = miscMeleeDef + (int)((stats.Defense - 10) / 2), rangedDamageReduction = miscRangedDef + (int)((stats.Defense - 10) / 2), meleeAttackBonus = miscMeleeAttack + (int)((stats.Strength - 10) / 2), RangedAttackBonus = miscRangedAttack + (int)((stats.Agility - 10) / 2), MeleeAttackSpeed = miscMeleeSpeed + (int)((stats.Strength - 10) / 2), Accuracy = miscAccuracy + (int)((stats.Agility - 10) / 2), SpellBonus = miscSpell + (int)((stats.Intelligence - 10) / 2), HealthBonus = miscHealth + (int)((stats.Stamina - 10) / 2), } }; game.PlayerComponent[entityID] = player; info = new PlayerInfo() { Health = 100, Psi = 100, State = PlayerState.Default, }; game.PlayerInfoComponent[entityID] = info; game.PlayerComponent[entityID] = player; //Create HUD hudagg.CreateHUD(player); //create Inv invagg.CreateInv(player); } game.QuestLogSystem.ActivateQuest(entityID, 0); return(entityID); }
/// <summary> /// Handles collision logic for left collision. /// </summary> /// <param name="otherObj">the other object</param> /// <returns>true if it was a collision, false otherwise</returns> public override bool CollisionLeft(Collideable otherObj) { if (base.CollisionLeft(otherObj)) { Debug.WriteLine("Player PosX: " + position.X); // if (otherObj is MoveableBox && pushing) { ((MoveableBox)otherObj).Move(-100); } return true; } return false; }
public uint CreateSkillDeployable(SkillType skill, Position position, int rankP) { SkillDeployable skillDeployable; Sprite sprite; Collideable collideable; uint eid = Entity.NextEntity(); position.EntityID = eid; switch (skill) { case SkillType.PortableShop: skillDeployable = new SkillDeployable() { EntityID = eid, duration = 1, rank = rankP, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load<Texture2D>("Spritesheets/shop"), SpriteBounds = new Rectangle(343, 50, 24, 25), }; position.Radius = 5; break; default: throw new Exception("Not a Deployable skill"); } collideable = new Collideable() { EntityID = eid, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius), }; game.SkillDeployableComponent.Add(eid, skillDeployable); game.PositionComponent.Add(eid, position); game.SpriteComponent.Add(eid, sprite); game.CollisionComponent.Add(eid, collideable); return eid; }
/// <summary> /// Creates a new weapon and adds it to the game. (No other components created) /// </summary> /// <param name="type">The type of weapon to create.</param> public uint CreateCollectible(CollectibleType type, Position position) { uint eid = Entity.NextEntity(); Collectible collectible; Sprite sprite; Collideable collideable; /* Locations for the sprites: gold = 136,46,32,32 silver = 170, 46, 32, 32 bronze = 204, 46, 32, 32 heart = 156, 360, 24, 24 */ switch (type) { case CollectibleType.health1: collectible.CollectibleType = Components.CollectibleType.health; collectible.CollectibleValue = 1; sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/TestMiscIcons1"), SpriteBounds = new Rectangle(156, 360, 24, 24), }; break; case CollectibleType.money1: collectible.CollectibleType = Components.CollectibleType.money; collectible.CollectibleValue = 1; sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/MiscIcons1"), SpriteBounds = new Rectangle(204, 46, 32, 32), }; break; case CollectibleType.money5: collectible.CollectibleType = Components.CollectibleType.money; collectible.CollectibleValue = 5; sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/TestMiscIcons1"), SpriteBounds = new Rectangle(170, 46, 32, 32), }; break; case CollectibleType.money10: collectible.CollectibleType = Components.CollectibleType.money; collectible.CollectibleValue = 10; sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/TestMiscIcons1"), SpriteBounds = new Rectangle(136, 46, 32, 32), }; break; case CollectibleType.pog: collectible.CollectibleType = Components.CollectibleType.pog; collectible.CollectibleValue = 0; //use random generator here, or more complex if you want sprite = new Sprite(); /*sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/TestMiscIcons1"), SpriteBounds = new Rectangle(136, 46, 32, 32), };*/ break; default: throw new Exception("Unknown CollectibleType"); } collectible.EntityID = eid; position.EntityID = eid; collideable = new Collideable() { EntityID = eid, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius) }; _game.CollisionComponent[eid] = collideable; _game.CollectibleComponent.Add(eid, collectible); //_game.MovementComponent.Add(eid, movement); //Eventually do a sin wave y emulation to do the wave effect _game.PositionComponent.Add(eid, position); _game.SpriteComponent.Add(eid, sprite); return eid; }
public uint CreateSkillAoE(SkillType skill, Position position, int rankP, int radius) { SkillAoE skillAoE; Sprite sprite; Collideable collideable; uint eid = Entity.NextEntity(); position.EntityID = eid; switch (skill) { #region Gargranian AOE Skills #region Detonate case SkillType.ImprovedPsionicSpear: { skillAoE = new SkillAoE() { EntityID = eid, radius = 1, rank = rankP, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load<Texture2D>("Spritesheets/Weapons/Bullets/BlueBullet"), SpriteBounds = new Rectangle(0, 0, 10, 10), }; position.Radius = radius; break; } #endregion #endregion #region Cultist AOE Skills #region Fear case SkillType.Fear: { skillAoE = new SkillAoE() { EntityID = eid, radius = 1, rank = rankP, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load<Texture2D>("Spritesheets/Weapons/Bullets/BlueBullet"), SpriteBounds = new Rectangle(0, 0, 10, 10), }; position.Radius = radius; break; } #endregion #region Push case SkillType.Push: { skillAoE = new SkillAoE() { EntityID = eid, radius = 1, rank = rankP, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load<Texture2D>("Spritesheets/Weapons/Bullets/BlueBullet"), SpriteBounds = new Rectangle(0, 0, 10, 10), }; position.Radius = radius; break; } #endregion #region Malice case SkillType.Malice: { skillAoE = new SkillAoE() { EntityID = eid, radius = 1, rank = rankP, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load<Texture2D>("Spritesheets/Weapons/Bullets/BlueBullet"), SpriteBounds = new Rectangle(0, 0, 10, 10), }; position.Radius = radius; break; } #endregion #endregion default: throw new Exception("Not a AoE skill"); } collideable = new Collideable() { EntityID = eid, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius), }; game.SkillAoEComponent.Add(eid, skillAoE); game.PositionComponent.Add(eid, position); game.SpriteComponent.Add(eid, sprite); game.CollisionComponent.Add(eid, collideable); return eid; }
/// <summary> /// Creates a new weapon and adds it to the game. (No other components created) /// </summary> /// <param name="type">The type of weapon to create.</param> public uint CreateCollectible(CollectibleType type, Position position) { uint eid = Entity.NextEntity(); Collectible collectible; Sprite sprite; Collideable collideable; /* * Locations for the sprites: * gold = 136,46,32,32 * silver = 170, 46, 32, 32 * bronze = 204, 46, 32, 32 * heart = 156, 360, 24, 24 */ switch (type) { case CollectibleType.health1: collectible.CollectibleType = Components.CollectibleType.health; collectible.CollectibleValue = 1; sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load <Texture2D>("Spritesheets/TestMiscIcons1"), SpriteBounds = new Rectangle(156, 360, 24, 24), }; break; case CollectibleType.money1: collectible.CollectibleType = Components.CollectibleType.money; collectible.CollectibleValue = 1; sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load <Texture2D>("Spritesheets/MiscIcons1"), SpriteBounds = new Rectangle(204, 46, 32, 32), }; break; case CollectibleType.money5: collectible.CollectibleType = Components.CollectibleType.money; collectible.CollectibleValue = 5; sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load <Texture2D>("Spritesheets/TestMiscIcons1"), SpriteBounds = new Rectangle(170, 46, 32, 32), }; break; case CollectibleType.money10: collectible.CollectibleType = Components.CollectibleType.money; collectible.CollectibleValue = 10; sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load <Texture2D>("Spritesheets/TestMiscIcons1"), SpriteBounds = new Rectangle(136, 46, 32, 32), }; break; case CollectibleType.pog: collectible.CollectibleType = Components.CollectibleType.pog; collectible.CollectibleValue = 0; //use random generator here, or more complex if you want sprite = new Sprite(); /*sprite = new Sprite() * { * EntityID = eid, * SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/TestMiscIcons1"), * SpriteBounds = new Rectangle(136, 46, 32, 32), * };*/ break; default: throw new Exception("Unknown CollectibleType"); } collectible.EntityID = eid; position.EntityID = eid; collideable = new Collideable() { EntityID = eid, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius) }; _game.CollisionComponent[eid] = collideable; _game.CollectibleComponent.Add(eid, collectible); //_game.MovementComponent.Add(eid, movement); //Eventually do a sin wave y emulation to do the wave effect _game.PositionComponent.Add(eid, position); _game.SpriteComponent.Add(eid, sprite); return(eid); }
/// <summary> /// Creates a new enemy and adds it to the game. (No other components created) /// </summary> /// <param name="type">The type of enemy to create.</param> public uint CreateEnemy(EnemyFactoryType type, Position position) { uint eid = Entity.NextEntity(); Enemy enemy = new Enemy(); Sprite sprite; Collideable collideable; switch (type) { case EnemyFactoryType.StationaryTarget: enemy.HurtOnTouch = false; enemy.Health = 1; sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load <Texture2D>("Spritesheets/target2"), SpriteBounds = new Rectangle(0, 0, 64, 64), }; break; case EnemyFactoryType.MovingTarget: enemy.HurtOnTouch = false; enemy.Health = 1; sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load <Texture2D>("Spritesheets/target2"), SpriteBounds = new Rectangle(0, 0, 64, 64), }; Movement move = new Movement() { EntityID = eid, }; _game.MovementComponent.Add(eid, move); EnemyAI ai = new EnemyAI() { EntityID = eid, }; _game.EnemyAIComponent.Add(eid, ai); break; default: throw new Exception("Unknown EnemyType"); } EnemyType enemyType; switch (type) { case EnemyFactoryType.MovingTarget: case EnemyFactoryType.StationaryTarget: enemyType = EnemyType.Target; break; default: throw new NotImplementedException(); } enemy.Type = enemyType; enemy.EntityID = eid; position.EntityID = eid; collideable = new Collideable() { EntityID = eid, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius) }; _game.CollisionComponent[eid] = collideable; _game.EnemyComponent.Add(eid, enemy); //_game.MovementComponent.Add(eid, movement); _game.PositionComponent.Add(eid, position); _game.SpriteComponent.Add(eid, sprite); return(eid); }
/// <summary> /// Handles collision logic for top collision. /// </summary> /// <param name="otherObj">the other object</param> /// <returns>true if it was a collision, false otherwise</returns> public override bool CollisionTop(Collideable otherObj) { Rectangle collisionRect = Rectangle.Intersect(CollisionBox(), otherObj.CollisionBox()); //check otherObj's Bottom side if (otherObj.CollisionBox().Bottom > CollisionBox().Top && otherObj.CollisionBox().Bottom <= prevDestinationBox.Top) { position = new Vector2(position.X, position.Y + (float)collisionRect.Height); velocity = new Vector2(velocity.X, 0); } return false; }
public void UseSkill(Aggregate playerType, SkillType skillType, int rank, uint userID) { #region Global Variables uint eid; Random random = new Random(); #endregion #region Check Cool Down //make sure the user isn't cooling down from a previous use foreach (CoolDown cd in _game.CoolDownComponent.All) { if (cd.Type == skillType && cd.UserID == userID) return; } #endregion switch (playerType) { #region Checking Player Type #region Cyborg case Aggregate.CyborgPlayer: #region Race Variables #endregion switch (skillType) { #region Checking Skill Type case SkillType.EnergyShield: #region Skill Variables TimedEffect timedEffectShield; Buff buffEffectShield; float effectDurationShield; uint targetIDShield; int damageDecreaseShield; int healShield; HealOverTime hotShield; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); targetIDShield = GetPlayerID(); healShield = 1; effectDurationShield = 5; damageDecreaseShield = 10; foreach (Player player in _game.PlayerComponent.All) { targetIDShield = player.EntityID; timedEffectShield = new TimedEffect() { EntityID = eid, TotalDuration = effectDurationShield, TimeLeft = effectDurationShield, }; _game.TimedEffectComponent.Add(eid, timedEffectShield); hotShield = new HealOverTime() { EntityID = eid, AmountPerTick = healShield, TickTime = 1 }; _game.HealOverTimeComponent.Add(eid, hotShield); buffEffectShield = new Buff() { EntityID = eid, TargetID = targetIDShield, DefenseMelee = damageDecreaseShield, DefenseRanged = damageDecreaseShield }; _game.BuffComponent.Add(eid, buffEffectShield); } break; case 2: eid = Entity.NextEntity(); targetIDShield = GetPlayerID(); healShield = 1; effectDurationShield = 5; damageDecreaseShield = 12; foreach (Player player in _game.PlayerComponent.All) { targetIDShield = player.EntityID; timedEffectShield = new TimedEffect() { EntityID = eid, TotalDuration = effectDurationShield, TimeLeft = effectDurationShield, }; _game.TimedEffectComponent.Add(eid, timedEffectShield); hotShield = new HealOverTime() { EntityID = eid, AmountPerTick = healShield, TickTime = 1 }; _game.HealOverTimeComponent.Add(eid, hotShield); buffEffectShield = new Buff() { EntityID = eid, TargetID = targetIDShield, DefenseMelee = damageDecreaseShield, DefenseRanged = damageDecreaseShield }; _game.BuffComponent.Add(eid, buffEffectShield); } break; case 3: eid = Entity.NextEntity(); targetIDShield = GetPlayerID(); healShield = 2; effectDurationShield = 6; damageDecreaseShield = 12; foreach (Player player in _game.PlayerComponent.All) { targetIDShield = player.EntityID; timedEffectShield = new TimedEffect() { EntityID = eid, TotalDuration = effectDurationShield, TimeLeft = effectDurationShield, }; _game.TimedEffectComponent.Add(eid, timedEffectShield); hotShield = new HealOverTime() { EntityID = eid, AmountPerTick = healShield, TickTime = 1 }; _game.HealOverTimeComponent.Add(eid, hotShield); buffEffectShield = new Buff() { EntityID = eid, TargetID = targetIDShield, DefenseMelee = damageDecreaseShield, DefenseRanged = damageDecreaseShield }; _game.BuffComponent.Add(eid, buffEffectShield); } break; case 4: eid = Entity.NextEntity(); targetIDShield = GetPlayerID(); healShield = 2; effectDurationShield = 6; damageDecreaseShield = 14; foreach (Player player in _game.PlayerComponent.All) { targetIDShield = player.EntityID; timedEffectShield = new TimedEffect() { EntityID = eid, TotalDuration = effectDurationShield, TimeLeft = effectDurationShield, }; _game.TimedEffectComponent.Add(eid, timedEffectShield); hotShield = new HealOverTime() { EntityID = eid, AmountPerTick = healShield, TickTime = 1 }; _game.HealOverTimeComponent.Add(eid, hotShield); buffEffectShield = new Buff() { EntityID = eid, TargetID = targetIDShield, DefenseMelee = damageDecreaseShield, DefenseRanged = damageDecreaseShield }; _game.BuffComponent.Add(eid, buffEffectShield); } break; case 5: eid = Entity.NextEntity(); targetIDShield = GetPlayerID(); healShield = 3; effectDurationShield = 7; damageDecreaseShield = 15; foreach (Player player in _game.PlayerComponent.All) { targetIDShield = player.EntityID; timedEffectShield = new TimedEffect() { EntityID = eid, TotalDuration = effectDurationShield, TimeLeft = effectDurationShield, }; _game.TimedEffectComponent.Add(eid, timedEffectShield); hotShield = new HealOverTime() { EntityID = eid, AmountPerTick = healShield, TickTime = 1 }; _game.HealOverTimeComponent.Add(eid, hotShield); buffEffectShield = new Buff() { EntityID = eid, TargetID = targetIDShield, DefenseMelee = damageDecreaseShield, DefenseRanged = damageDecreaseShield }; _game.BuffComponent.Add(eid, buffEffectShield); } break; case 6: eid = Entity.NextEntity(); targetIDShield = GetPlayerID(); healShield = 3; effectDurationShield = 8; damageDecreaseShield = 16; foreach (Player player in _game.PlayerComponent.All) { targetIDShield = player.EntityID; timedEffectShield = new TimedEffect() { EntityID = eid, TotalDuration = effectDurationShield, TimeLeft = effectDurationShield, }; _game.TimedEffectComponent.Add(eid, timedEffectShield); hotShield = new HealOverTime() { EntityID = eid, AmountPerTick = healShield, TickTime = 1 }; _game.HealOverTimeComponent.Add(eid, hotShield); buffEffectShield = new Buff() { EntityID = eid, TargetID = targetIDShield, DefenseMelee = damageDecreaseShield, DefenseRanged = damageDecreaseShield }; _game.BuffComponent.Add(eid, buffEffectShield); } break; case 7: eid = Entity.NextEntity(); targetIDShield = GetPlayerID(); healShield = 4; effectDurationShield = 17; damageDecreaseShield = 9; foreach (Player player in _game.PlayerComponent.All) { targetIDShield = player.EntityID; timedEffectShield = new TimedEffect() { EntityID = eid, TotalDuration = effectDurationShield, TimeLeft = effectDurationShield, }; _game.TimedEffectComponent.Add(eid, timedEffectShield); hotShield = new HealOverTime() { EntityID = eid, AmountPerTick = healShield, TickTime = 1 }; _game.HealOverTimeComponent.Add(eid, hotShield); buffEffectShield = new Buff() { EntityID = eid, TargetID = targetIDShield, DefenseMelee = damageDecreaseShield, DefenseRanged = damageDecreaseShield }; _game.BuffComponent.Add(eid, buffEffectShield); } break; case 8: eid = Entity.NextEntity(); targetIDShield = GetPlayerID(); healShield = 4; effectDurationShield = 10; damageDecreaseShield = 18; foreach (Player player in _game.PlayerComponent.All) { targetIDShield = player.EntityID; timedEffectShield = new TimedEffect() { EntityID = eid, TotalDuration = effectDurationShield, TimeLeft = effectDurationShield, }; _game.TimedEffectComponent.Add(eid, timedEffectShield); hotShield = new HealOverTime() { EntityID = eid, AmountPerTick = healShield, TickTime = 1 }; _game.HealOverTimeComponent.Add(eid, hotShield); buffEffectShield = new Buff() { EntityID = eid, TargetID = targetIDShield, DefenseMelee = damageDecreaseShield, DefenseRanged = damageDecreaseShield }; _game.BuffComponent.Add(eid, buffEffectShield); } break; case 9: eid = Entity.NextEntity(); targetIDShield = GetPlayerID(); healShield = 5; effectDurationShield = 10; damageDecreaseShield = 20; foreach (Player player in _game.PlayerComponent.All) { targetIDShield = player.EntityID; timedEffectShield = new TimedEffect() { EntityID = eid, TotalDuration = effectDurationShield, TimeLeft = effectDurationShield, }; _game.TimedEffectComponent.Add(eid, timedEffectShield); hotShield = new HealOverTime() { EntityID = eid, AmountPerTick = healShield, TickTime = 1 }; _game.HealOverTimeComponent.Add(eid, hotShield); buffEffectShield = new Buff() { EntityID = eid, TargetID = targetIDShield, DefenseMelee = damageDecreaseShield, DefenseRanged = damageDecreaseShield }; _game.BuffComponent.Add(eid, buffEffectShield); } break; case 10: eid = Entity.NextEntity(); targetIDShield = GetPlayerID(); healShield = 5; effectDurationShield = 10; damageDecreaseShield = 25; foreach (Player player in _game.PlayerComponent.All) { targetIDShield = player.EntityID; timedEffectShield = new TimedEffect() { EntityID = eid, TotalDuration = effectDurationShield, TimeLeft = effectDurationShield, }; _game.TimedEffectComponent.Add(eid, timedEffectShield); hotShield = new HealOverTime() { EntityID = eid, AmountPerTick = healShield, TickTime = 1 }; _game.HealOverTimeComponent.Add(eid, hotShield); buffEffectShield = new Buff() { EntityID = eid, TargetID = targetIDShield, DefenseMelee = damageDecreaseShield, DefenseRanged = damageDecreaseShield }; _game.BuffComponent.Add(eid, buffEffectShield); } break; default: break; #endregion } break; case SkillType.Defibrillate: #region Skill Variables TimedEffect timedEffect; float effectDuration; Buff buffEffect; uint targetID; int speedIncrease; int AttackSpeedIncrease; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); effectDuration = 3; targetID = GetPlayerID(); speedIncrease = 200; AttackSpeedIncrease = 150; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration, }; _game.TimedEffectComponent.Add(eid, timedEffect); buffEffect = new Buff() { EntityID = eid, TargetID = targetID, MovementSpeed = speedIncrease, AttackSpeed = AttackSpeedIncrease }; _game.BuffComponent.Add(eid, buffEffect); break; case 2: eid = Entity.NextEntity(); effectDuration = 3; targetID = GetPlayerID(); speedIncrease = 200; AttackSpeedIncrease = 200; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration, }; _game.TimedEffectComponent.Add(eid, timedEffect); buffEffect = new Buff() { EntityID = eid, TargetID = targetID, MovementSpeed = speedIncrease, AttackSpeed = AttackSpeedIncrease }; _game.BuffComponent.Add(eid, buffEffect); break; case 3: eid = Entity.NextEntity(); effectDuration = 4; targetID = GetPlayerID(); speedIncrease = 200; AttackSpeedIncrease = 200; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration, }; _game.TimedEffectComponent.Add(eid, timedEffect); buffEffect = new Buff() { EntityID = eid, TargetID = targetID, MovementSpeed = speedIncrease, AttackSpeed = AttackSpeedIncrease }; _game.BuffComponent.Add(eid, buffEffect); break; case 4: eid = Entity.NextEntity(); effectDuration = 4; targetID = GetPlayerID(); speedIncrease = 200; AttackSpeedIncrease = 250; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration, }; _game.TimedEffectComponent.Add(eid, timedEffect); buffEffect = new Buff() { EntityID = eid, TargetID = targetID, MovementSpeed = speedIncrease, AttackSpeed = AttackSpeedIncrease }; _game.BuffComponent.Add(eid, buffEffect); break; case 5: eid = Entity.NextEntity(); effectDuration = 5; targetID = GetPlayerID(); speedIncrease = 200; AttackSpeedIncrease = 250; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration, }; _game.TimedEffectComponent.Add(eid, timedEffect); buffEffect = new Buff() { EntityID = eid, TargetID = targetID, MovementSpeed = speedIncrease, AttackSpeed = AttackSpeedIncrease }; _game.BuffComponent.Add(eid, buffEffect); break; case 6: eid = Entity.NextEntity(); effectDuration = 5; targetID = GetPlayerID(); speedIncrease = 200; AttackSpeedIncrease = 300; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration, }; _game.TimedEffectComponent.Add(eid, timedEffect); buffEffect = new Buff() { EntityID = eid, TargetID = targetID, MovementSpeed = speedIncrease, AttackSpeed = AttackSpeedIncrease }; _game.BuffComponent.Add(eid, buffEffect); break; case 7: eid = Entity.NextEntity(); effectDuration = 5; targetID = GetPlayerID(); speedIncrease = 200; AttackSpeedIncrease = 300; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration, }; _game.TimedEffectComponent.Add(eid, timedEffect); buffEffect = new Buff() { EntityID = eid, TargetID = targetID, MovementSpeed = speedIncrease, AttackSpeed = AttackSpeedIncrease }; _game.BuffComponent.Add(eid, buffEffect); break; case 8: eid = Entity.NextEntity(); effectDuration = 6; targetID = GetPlayerID(); speedIncrease = 200; AttackSpeedIncrease = 300; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration, }; _game.TimedEffectComponent.Add(eid, timedEffect); buffEffect = new Buff() { EntityID = eid, TargetID = targetID, MovementSpeed = speedIncrease, AttackSpeed = AttackSpeedIncrease }; _game.BuffComponent.Add(eid, buffEffect); break; case 9: eid = Entity.NextEntity(); effectDuration = 6; targetID = GetPlayerID(); speedIncrease = 200; AttackSpeedIncrease = 350; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration, }; _game.TimedEffectComponent.Add(eid, timedEffect); buffEffect = new Buff() { EntityID = eid, TargetID = targetID, MovementSpeed = speedIncrease, AttackSpeed = AttackSpeedIncrease }; _game.BuffComponent.Add(eid, buffEffect); break; case 10: eid = Entity.NextEntity(); effectDuration = 8; targetID = GetPlayerID(); speedIncrease = 200; AttackSpeedIncrease = 400; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration, }; _game.TimedEffectComponent.Add(eid, timedEffect); buffEffect = new Buff() { EntityID = eid, TargetID = targetID, MovementSpeed = speedIncrease, AttackSpeed = AttackSpeedIncrease }; _game.BuffComponent.Add(eid, buffEffect); break; default: break; #endregion } break; case SkillType.Nanobots: #region Skill Variables TimedEffect timedEffectNano; float effectDurationNano; DirectHeal directheal; uint targetIDNano; int heal; HealOverTime hot; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); targetIDNano = GetPlayerID(); heal = 5; directheal = new DirectHeal() { EntityID = eid, Amount = heal }; _game.DirectHealComponent.Add(eid, directheal); break; case 2: eid = Entity.NextEntity(); targetIDNano = GetPlayerID(); heal = 8; directheal = new DirectHeal() { EntityID = eid, Amount = heal }; _game.DirectHealComponent.Add(eid, directheal); break; case 3: eid = Entity.NextEntity(); targetIDNano = GetPlayerID(); heal = 10; directheal = new DirectHeal() { EntityID = eid, Amount = heal }; _game.DirectHealComponent.Add(eid, directheal); break; case 4: eid = Entity.NextEntity(); targetIDNano = GetPlayerID(); heal = 12; directheal = new DirectHeal() { EntityID = eid, Amount = heal }; _game.DirectHealComponent.Add(eid, directheal); break; case 5: eid = Entity.NextEntity(); targetIDNano = GetPlayerID(); heal = 14; directheal = new DirectHeal() { EntityID = eid, Amount = heal }; _game.DirectHealComponent.Add(eid, directheal); eid = Entity.NextEntity(); break; case 6: eid = Entity.NextEntity(); targetIDNano = GetPlayerID(); heal = 16; directheal = new DirectHeal() { EntityID = eid, Amount = heal }; _game.DirectHealComponent.Add(eid, directheal); break; case 7: eid = Entity.NextEntity(); targetIDNano = GetPlayerID(); heal = 18; directheal = new DirectHeal() { EntityID = eid, Amount = heal }; _game.DirectHealComponent.Add(eid, directheal); break; case 8: eid = Entity.NextEntity(); targetIDNano = GetPlayerID(); heal = 20; directheal = new DirectHeal() { EntityID = eid, Amount = heal }; _game.DirectHealComponent.Add(eid, directheal); break; case 9: eid = Entity.NextEntity(); targetIDNano = GetPlayerID(); heal = 25; directheal = new DirectHeal() { EntityID = eid, Amount = heal }; _game.DirectHealComponent.Add(eid, directheal); break; case 10: eid = Entity.NextEntity(); targetIDNano = GetPlayerID(); heal = 25; effectDurationNano = 10; directheal = new DirectHeal() { EntityID = eid, Amount = heal }; _game.DirectHealComponent.Add(eid, directheal); timedEffectNano = new TimedEffect() { EntityID = eid, TotalDuration = effectDurationNano, TimeLeft = effectDurationNano, }; _game.TimedEffectComponent.Add(eid, timedEffectNano); hot = new HealOverTime() { EntityID = eid, AmountPerTick = 1, TickTime = 2 }; _game.HealOverTimeComponent.Add(eid, hot); break; default: break; #endregion } break; case SkillType.TargettingUpgrade: #region Skill Variables Buff buffEffectTarget; int WeaponIncrease; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); targetID = GetPlayerID(); WeaponIncrease = 120; buffEffectTarget = new Buff() { EntityID = eid, TargetID = targetID, WeaponStrength = WeaponIncrease }; _game.BuffComponent.Add(eid, buffEffectTarget); break; case 2: eid = Entity.NextEntity(); targetID = GetPlayerID(); WeaponIncrease = 145; buffEffectTarget = new Buff() { EntityID = eid, TargetID = targetID, WeaponStrength = WeaponIncrease }; _game.BuffComponent.Add(eid, buffEffectTarget); break; case 3: eid = Entity.NextEntity(); targetID = GetPlayerID(); WeaponIncrease = 130; buffEffectTarget = new Buff() { EntityID = eid, TargetID = targetID, WeaponStrength = WeaponIncrease }; _game.BuffComponent.Add(eid, buffEffectTarget); break; case 4: eid = Entity.NextEntity(); targetID = GetPlayerID(); WeaponIncrease = 135; buffEffectTarget = new Buff() { EntityID = eid, TargetID = targetID, WeaponStrength = WeaponIncrease }; _game.BuffComponent.Add(eid, buffEffectTarget); break; case 5: eid = Entity.NextEntity(); targetID = GetPlayerID(); WeaponIncrease = 145; buffEffectTarget = new Buff() { EntityID = eid, TargetID = targetID, WeaponStrength = WeaponIncrease }; _game.BuffComponent.Add(eid, buffEffectTarget); break; case 6: eid = Entity.NextEntity(); targetID = GetPlayerID(); WeaponIncrease = 160; buffEffectTarget = new Buff() { EntityID = eid, TargetID = targetID, WeaponStrength = WeaponIncrease }; _game.BuffComponent.Add(eid, buffEffectTarget); break; case 7: eid = Entity.NextEntity(); targetID = GetPlayerID(); WeaponIncrease = 175; buffEffectTarget = new Buff() { EntityID = eid, TargetID = targetID, WeaponStrength = WeaponIncrease }; _game.BuffComponent.Add(eid, buffEffectTarget); break; case 8: eid = Entity.NextEntity(); targetID = GetPlayerID(); WeaponIncrease = 200; buffEffectTarget = new Buff() { EntityID = eid, TargetID = targetID, WeaponStrength = WeaponIncrease }; _game.BuffComponent.Add(eid, buffEffectTarget); break; case 9: eid = Entity.NextEntity(); targetID = GetPlayerID(); WeaponIncrease = 225; buffEffectTarget = new Buff() { EntityID = eid, TargetID = targetID, WeaponStrength = WeaponIncrease }; _game.BuffComponent.Add(eid, buffEffectTarget); break; case 10: eid = Entity.NextEntity(); targetID = GetPlayerID(); WeaponIncrease = 250; buffEffectTarget = new Buff() { EntityID = eid, TargetID = targetID, WeaponStrength = WeaponIncrease }; _game.BuffComponent.Add(eid, buffEffectTarget); break; default: break; #endregion } break; case SkillType.RepulsorArm: #region Skill Variables InstantEffect instantEffectRepulse; uint eid_2Repulse; uint targetIDRepulse; KnockBack knockBackEffectRepulse; Vector2 originRepulse; float distanceRepulse; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); targetIDRepulse = GetPlayerID(); eid_2Repulse = Entity.NextEntity(); originRepulse = _game.PositionComponent[targetIDRepulse].Center; distanceRepulse = 100; instantEffectRepulse = new InstantEffect() { EntityID = eid_2Repulse, }; _game.InstantEffectComponent.Add(eid_2Repulse, instantEffectRepulse); knockBackEffectRepulse = new KnockBack() { EntityID = eid_2Repulse, Origin = originRepulse, Distance = distanceRepulse, }; _game.KnockBackComponent.Add(eid_2Repulse, knockBackEffectRepulse); break; case 2: eid = Entity.NextEntity(); targetIDRepulse = GetPlayerID(); eid_2Repulse = Entity.NextEntity(); originRepulse = _game.PositionComponent[targetIDRepulse].Center; distanceRepulse = 100; instantEffectRepulse = new InstantEffect() { EntityID = eid_2Repulse, }; _game.InstantEffectComponent.Add(eid_2Repulse, instantEffectRepulse); knockBackEffectRepulse = new KnockBack() { EntityID = eid_2Repulse, Origin = originRepulse, Distance = distanceRepulse, }; _game.KnockBackComponent.Add(eid_2Repulse, knockBackEffectRepulse); break; case 3: eid = Entity.NextEntity(); targetIDRepulse = GetPlayerID(); eid_2Repulse = Entity.NextEntity(); originRepulse = _game.PositionComponent[targetIDRepulse].Center; distanceRepulse = 100; instantEffectRepulse = new InstantEffect() { EntityID = eid_2Repulse, }; _game.InstantEffectComponent.Add(eid_2Repulse, instantEffectRepulse); knockBackEffectRepulse = new KnockBack() { EntityID = eid_2Repulse, Origin = originRepulse, Distance = distanceRepulse, }; _game.KnockBackComponent.Add(eid_2Repulse, knockBackEffectRepulse); break; case 4: eid = Entity.NextEntity(); targetIDRepulse = GetPlayerID(); eid_2Repulse = Entity.NextEntity(); originRepulse = _game.PositionComponent[targetIDRepulse].Center; distanceRepulse = 100; instantEffectRepulse = new InstantEffect() { EntityID = eid_2Repulse, }; _game.InstantEffectComponent.Add(eid_2Repulse, instantEffectRepulse); knockBackEffectRepulse = new KnockBack() { EntityID = eid_2Repulse, Origin = originRepulse, Distance = distanceRepulse, }; _game.KnockBackComponent.Add(eid_2Repulse, knockBackEffectRepulse); break; case 5: eid = Entity.NextEntity(); targetIDRepulse = GetPlayerID(); eid_2Repulse = Entity.NextEntity(); originRepulse = _game.PositionComponent[targetIDRepulse].Center; distanceRepulse = 100; instantEffectRepulse = new InstantEffect() { EntityID = eid_2Repulse, }; _game.InstantEffectComponent.Add(eid_2Repulse, instantEffectRepulse); knockBackEffectRepulse = new KnockBack() { EntityID = eid_2Repulse, Origin = originRepulse, Distance = distanceRepulse, }; _game.KnockBackComponent.Add(eid_2Repulse, knockBackEffectRepulse); break; case 6: eid = Entity.NextEntity(); targetIDRepulse = GetPlayerID(); eid_2Repulse = Entity.NextEntity(); originRepulse = _game.PositionComponent[targetIDRepulse].Center; distanceRepulse = 100; instantEffectRepulse = new InstantEffect() { EntityID = eid_2Repulse, }; _game.InstantEffectComponent.Add(eid_2Repulse, instantEffectRepulse); knockBackEffectRepulse = new KnockBack() { EntityID = eid_2Repulse, Origin = originRepulse, Distance = distanceRepulse, }; _game.KnockBackComponent.Add(eid_2Repulse, knockBackEffectRepulse); break; case 7: eid = Entity.NextEntity(); targetIDRepulse = GetPlayerID(); eid_2Repulse = Entity.NextEntity(); originRepulse = _game.PositionComponent[targetIDRepulse].Center; distanceRepulse = 100; instantEffectRepulse = new InstantEffect() { EntityID = eid_2Repulse, }; _game.InstantEffectComponent.Add(eid_2Repulse, instantEffectRepulse); knockBackEffectRepulse = new KnockBack() { EntityID = eid_2Repulse, Origin = originRepulse, Distance = distanceRepulse, }; _game.KnockBackComponent.Add(eid_2Repulse, knockBackEffectRepulse); break; case 8: eid = Entity.NextEntity(); targetIDRepulse = GetPlayerID(); eid_2Repulse = Entity.NextEntity(); originRepulse = _game.PositionComponent[targetIDRepulse].Center; distanceRepulse = 100; instantEffectRepulse = new InstantEffect() { EntityID = eid_2Repulse, }; _game.InstantEffectComponent.Add(eid_2Repulse, instantEffectRepulse); knockBackEffectRepulse = new KnockBack() { EntityID = eid_2Repulse, Origin = originRepulse, Distance = distanceRepulse, }; _game.KnockBackComponent.Add(eid_2Repulse, knockBackEffectRepulse); break; case 9: eid = Entity.NextEntity(); targetIDRepulse = GetPlayerID(); eid_2Repulse = Entity.NextEntity(); originRepulse = _game.PositionComponent[targetIDRepulse].Center; distanceRepulse = 100; instantEffectRepulse = new InstantEffect() { EntityID = eid_2Repulse, }; _game.InstantEffectComponent.Add(eid_2Repulse, instantEffectRepulse); knockBackEffectRepulse = new KnockBack() { EntityID = eid_2Repulse, Origin = originRepulse, Distance = distanceRepulse, }; _game.KnockBackComponent.Add(eid_2Repulse, knockBackEffectRepulse); break; case 10: eid = Entity.NextEntity(); targetIDRepulse = GetPlayerID(); eid_2Repulse = Entity.NextEntity(); originRepulse = _game.PositionComponent[targetIDRepulse].Center; distanceRepulse = 100; instantEffectRepulse = new InstantEffect() { EntityID = eid_2Repulse, }; _game.InstantEffectComponent.Add(eid_2Repulse, instantEffectRepulse); knockBackEffectRepulse = new KnockBack() { EntityID = eid_2Repulse, Origin = originRepulse, Distance = distanceRepulse, }; _game.KnockBackComponent.Add(eid_2Repulse, knockBackEffectRepulse); break; default: break; #endregion } break; case SkillType.EnergyShot: #region Skill Variables DirectDamage DirectDamageShot; InstantEffect instantEffectShot; int shotDamage; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); shotDamage = 5; instantEffectShot = new InstantEffect() { EntityID = eid, }; _game.InstantEffectComponent.Add(eid, instantEffectShot); DirectDamageShot = new DirectDamage() { EntityID = eid, Damage = shotDamage }; _game.DirectDamageComponent.Add(eid, DirectDamageShot); break; case 2: eid = Entity.NextEntity(); shotDamage = 10; instantEffectShot = new InstantEffect() { EntityID = eid, }; _game.InstantEffectComponent.Add(eid, instantEffectShot); DirectDamageShot = new DirectDamage() { EntityID = eid, Damage = shotDamage }; _game.DirectDamageComponent.Add(eid, DirectDamageShot); break; case 3: eid = Entity.NextEntity(); shotDamage = 15; instantEffectShot = new InstantEffect() { EntityID = eid, }; _game.InstantEffectComponent.Add(eid, instantEffectShot); DirectDamageShot = new DirectDamage() { EntityID = eid, Damage = shotDamage }; _game.DirectDamageComponent.Add(eid, DirectDamageShot); break; case 4: eid = Entity.NextEntity(); shotDamage = 20; instantEffectShot = new InstantEffect() { EntityID = eid, }; _game.InstantEffectComponent.Add(eid, instantEffectShot); DirectDamageShot = new DirectDamage() { EntityID = eid, Damage = shotDamage }; _game.DirectDamageComponent.Add(eid, DirectDamageShot); break; case 5: eid = Entity.NextEntity(); shotDamage = 25; instantEffectShot = new InstantEffect() { EntityID = eid, }; _game.InstantEffectComponent.Add(eid, instantEffectShot); DirectDamageShot = new DirectDamage() { EntityID = eid, Damage = shotDamage }; _game.DirectDamageComponent.Add(eid, DirectDamageShot); break; case 6: eid = Entity.NextEntity(); shotDamage = 30; instantEffectShot = new InstantEffect() { EntityID = eid, }; _game.InstantEffectComponent.Add(eid, instantEffectShot); DirectDamageShot = new DirectDamage() { EntityID = eid, Damage = shotDamage }; _game.DirectDamageComponent.Add(eid, DirectDamageShot); break; case 7: eid = Entity.NextEntity(); shotDamage = 35; instantEffectShot = new InstantEffect() { EntityID = eid, }; _game.InstantEffectComponent.Add(eid, instantEffectShot); DirectDamageShot = new DirectDamage() { EntityID = eid, Damage = shotDamage }; _game.DirectDamageComponent.Add(eid, DirectDamageShot); break; case 8: eid = Entity.NextEntity(); shotDamage = 38; instantEffectShot = new InstantEffect() { EntityID = eid, }; _game.InstantEffectComponent.Add(eid, instantEffectShot); DirectDamageShot = new DirectDamage() { EntityID = eid, Damage = shotDamage }; _game.DirectDamageComponent.Add(eid, DirectDamageShot); break; case 9: eid = Entity.NextEntity(); shotDamage = 40; instantEffectShot = new InstantEffect() { EntityID = eid, }; _game.InstantEffectComponent.Add(eid, instantEffectShot); DirectDamageShot = new DirectDamage() { EntityID = eid, Damage = shotDamage }; _game.DirectDamageComponent.Add(eid, DirectDamageShot); break; case 10: eid = Entity.NextEntity(); shotDamage = 45; instantEffectShot = new InstantEffect() { EntityID = eid, }; _game.InstantEffectComponent.Add(eid, instantEffectShot); DirectDamageShot = new DirectDamage() { EntityID = eid, Damage = shotDamage }; _game.DirectDamageComponent.Add(eid, DirectDamageShot); break; default: break; #endregion } break; case SkillType.AlloyBody: #region Skill Variables Buff buffEffectAlloy; int damageDecrease; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); targetID = GetPlayerID(); damageDecrease = 5; buffEffectAlloy = new Buff() { EntityID = eid, TargetID = targetID, DefenseMelee = damageDecrease, DefenseRanged = damageDecrease }; _game.BuffComponent.Add(eid, buffEffectAlloy); break; case 2: eid = Entity.NextEntity(); targetID = GetPlayerID(); damageDecrease = 10; buffEffectAlloy = new Buff() { EntityID = eid, TargetID = targetID, DefenseMelee = damageDecrease, DefenseRanged = damageDecrease }; _game.BuffComponent.Add(eid, buffEffectAlloy); break; case 3: eid = Entity.NextEntity(); targetID = GetPlayerID(); damageDecrease = 12; buffEffectAlloy = new Buff() { EntityID = eid, TargetID = targetID, DefenseMelee = damageDecrease, DefenseRanged = damageDecrease }; _game.BuffComponent.Add(eid, buffEffectAlloy); break; case 4: eid = Entity.NextEntity(); targetID = GetPlayerID(); damageDecrease = 14; buffEffectAlloy = new Buff() { EntityID = eid, TargetID = targetID, DefenseMelee = damageDecrease, DefenseRanged = damageDecrease }; _game.BuffComponent.Add(eid, buffEffectAlloy); break; case 5: eid = Entity.NextEntity(); targetID = GetPlayerID(); damageDecrease = 16; buffEffectAlloy = new Buff() { EntityID = eid, TargetID = targetID, DefenseMelee = damageDecrease, DefenseRanged = damageDecrease }; _game.BuffComponent.Add(eid, buffEffectAlloy); break; case 6: eid = Entity.NextEntity(); targetID = GetPlayerID(); damageDecrease = 18; buffEffectAlloy = new Buff() { EntityID = eid, TargetID = targetID, DefenseMelee = damageDecrease, DefenseRanged = damageDecrease }; _game.BuffComponent.Add(eid, buffEffectAlloy); break; case 7: eid = Entity.NextEntity(); targetID = GetPlayerID(); damageDecrease = 20; buffEffectAlloy = new Buff() { EntityID = eid, TargetID = targetID, DefenseMelee = damageDecrease, DefenseRanged = damageDecrease }; _game.BuffComponent.Add(eid, buffEffectAlloy); break; case 8: eid = Entity.NextEntity(); targetID = GetPlayerID(); damageDecrease = 26; buffEffectAlloy = new Buff() { EntityID = eid, TargetID = targetID, DefenseMelee = damageDecrease, DefenseRanged = damageDecrease }; _game.BuffComponent.Add(eid, buffEffectAlloy); break; case 9: eid = Entity.NextEntity(); targetID = GetPlayerID(); damageDecrease = 32; buffEffectAlloy = new Buff() { EntityID = eid, TargetID = targetID, DefenseMelee = damageDecrease, DefenseRanged = damageDecrease }; _game.BuffComponent.Add(eid, buffEffectAlloy); break; case 10: eid = Entity.NextEntity(); targetID = GetPlayerID(); damageDecrease = 40; buffEffectAlloy = new Buff() { EntityID = eid, TargetID = targetID, DefenseMelee = damageDecrease, DefenseRanged = damageDecrease }; _game.BuffComponent.Add(eid, buffEffectAlloy); break; default: break; #endregion } break; case SkillType.CyberneticSlam: #region Skill Variables InstantEffect instantEffectSlam; uint eid_2Slam; uint targetIDSlam; DirectDamage DirectDamageSlam; int slamDamage; KnockBack knockBackEffectSlam; Vector2 originSlam; float distanceSlam; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); targetIDSlam = GetPlayerID(); eid_2Slam = Entity.NextEntity(); originSlam = _game.PositionComponent[targetIDSlam].Center; distanceSlam = 40; slamDamage = 5; instantEffectSlam = new InstantEffect() { EntityID = eid_2Slam, }; _game.InstantEffectComponent.Add(eid_2Slam, instantEffectSlam); DirectDamageSlam = new DirectDamage() { EntityID = eid_2Slam, Damage = slamDamage }; _game.DirectDamageComponent.Add(eid_2Slam, DirectDamageSlam); knockBackEffectSlam = new KnockBack() { EntityID = eid_2Slam, Origin = originSlam, Distance = distanceSlam, }; _game.KnockBackComponent.Add(eid_2Slam, knockBackEffectSlam); break; case 2: eid = Entity.NextEntity(); targetIDSlam = GetPlayerID(); eid_2Slam = Entity.NextEntity(); originSlam = _game.PositionComponent[targetIDSlam].Center; distanceSlam = 60; slamDamage = 10; instantEffectSlam = new InstantEffect() { EntityID = eid_2Slam, }; _game.InstantEffectComponent.Add(eid_2Slam, instantEffectSlam); DirectDamageSlam = new DirectDamage() { EntityID = eid_2Slam, Damage = slamDamage }; _game.DirectDamageComponent.Add(eid_2Slam, DirectDamageSlam); knockBackEffectSlam = new KnockBack() { EntityID = eid_2Slam, Origin = originSlam, Distance = distanceSlam, }; _game.KnockBackComponent.Add(eid_2Slam, knockBackEffectSlam); break; case 3: eid = Entity.NextEntity(); targetIDSlam = GetPlayerID(); eid_2Slam = Entity.NextEntity(); originSlam = _game.PositionComponent[targetIDSlam].Center; distanceSlam = 80; slamDamage = 15; instantEffectSlam = new InstantEffect() { EntityID = eid_2Slam, }; _game.InstantEffectComponent.Add(eid_2Slam, instantEffectSlam); DirectDamageSlam = new DirectDamage() { EntityID = eid_2Slam, Damage = slamDamage }; _game.DirectDamageComponent.Add(eid_2Slam, DirectDamageSlam); knockBackEffectSlam = new KnockBack() { EntityID = eid_2Slam, Origin = originSlam, Distance = distanceSlam, }; _game.KnockBackComponent.Add(eid_2Slam, knockBackEffectSlam); break; case 4: eid = Entity.NextEntity(); targetIDSlam = GetPlayerID(); eid_2Slam = Entity.NextEntity(); originSlam = _game.PositionComponent[targetIDSlam].Center; distanceSlam = 100; slamDamage = 20; instantEffectSlam = new InstantEffect() { EntityID = eid_2Slam, }; _game.InstantEffectComponent.Add(eid_2Slam, instantEffectSlam); DirectDamageSlam = new DirectDamage() { EntityID = eid_2Slam, Damage = slamDamage }; _game.DirectDamageComponent.Add(eid_2Slam, DirectDamageSlam); knockBackEffectSlam = new KnockBack() { EntityID = eid_2Slam, Origin = originSlam, Distance = distanceSlam, }; _game.KnockBackComponent.Add(eid_2Slam, knockBackEffectSlam); break; case 5: eid = Entity.NextEntity(); targetIDSlam = GetPlayerID(); eid_2Slam = Entity.NextEntity(); originSlam = _game.PositionComponent[targetIDSlam].Center; distanceSlam = 120; slamDamage = 25; instantEffectSlam = new InstantEffect() { EntityID = eid_2Slam, }; _game.InstantEffectComponent.Add(eid_2Slam, instantEffectSlam); DirectDamageSlam = new DirectDamage() { EntityID = eid_2Slam, Damage = slamDamage }; _game.DirectDamageComponent.Add(eid_2Slam, DirectDamageSlam); knockBackEffectSlam = new KnockBack() { EntityID = eid_2Slam, Origin = originSlam, Distance = distanceSlam, }; _game.KnockBackComponent.Add(eid_2Slam, knockBackEffectSlam); break; case 6: eid = Entity.NextEntity(); targetIDSlam = GetPlayerID(); eid_2Slam = Entity.NextEntity(); originSlam = _game.PositionComponent[targetIDSlam].Center; distanceSlam = 140; slamDamage = 30; instantEffectSlam = new InstantEffect() { EntityID = eid_2Slam, }; _game.InstantEffectComponent.Add(eid_2Slam, instantEffectSlam); DirectDamageSlam = new DirectDamage() { EntityID = eid_2Slam, Damage = slamDamage }; _game.DirectDamageComponent.Add(eid_2Slam, DirectDamageSlam); knockBackEffectSlam = new KnockBack() { EntityID = eid_2Slam, Origin = originSlam, Distance = distanceSlam, }; _game.KnockBackComponent.Add(eid_2Slam, knockBackEffectSlam); break; case 7: eid = Entity.NextEntity(); targetIDSlam = GetPlayerID(); eid_2Slam = Entity.NextEntity(); originSlam = _game.PositionComponent[targetIDSlam].Center; distanceSlam = 160; slamDamage = 35; instantEffectSlam = new InstantEffect() { EntityID = eid_2Slam, }; _game.InstantEffectComponent.Add(eid_2Slam, instantEffectSlam); DirectDamageSlam = new DirectDamage() { EntityID = eid_2Slam, Damage = slamDamage }; _game.DirectDamageComponent.Add(eid_2Slam, DirectDamageSlam); knockBackEffectSlam = new KnockBack() { EntityID = eid_2Slam, Origin = originSlam, Distance = distanceSlam, }; _game.KnockBackComponent.Add(eid_2Slam, knockBackEffectSlam); break; case 8: eid = Entity.NextEntity(); targetIDSlam = GetPlayerID(); eid_2Slam = Entity.NextEntity(); originSlam = _game.PositionComponent[targetIDSlam].Center; distanceSlam = 180; slamDamage = 40; instantEffectSlam = new InstantEffect() { EntityID = eid_2Slam, }; _game.InstantEffectComponent.Add(eid_2Slam, instantEffectSlam); DirectDamageSlam = new DirectDamage() { EntityID = eid_2Slam, Damage = slamDamage }; _game.DirectDamageComponent.Add(eid_2Slam, DirectDamageSlam); knockBackEffectSlam = new KnockBack() { EntityID = eid_2Slam, Origin = originSlam, Distance = distanceSlam, }; _game.KnockBackComponent.Add(eid_2Slam, knockBackEffectSlam); break; case 9: eid = Entity.NextEntity(); targetIDSlam = GetPlayerID(); eid_2Slam = Entity.NextEntity(); originSlam = _game.PositionComponent[targetIDSlam].Center; distanceSlam = 200; slamDamage = 45; instantEffectSlam = new InstantEffect() { EntityID = eid_2Slam, }; _game.InstantEffectComponent.Add(eid_2Slam, instantEffectSlam); DirectDamageSlam = new DirectDamage() { EntityID = eid_2Slam, Damage = slamDamage }; _game.DirectDamageComponent.Add(eid_2Slam, DirectDamageSlam); knockBackEffectSlam = new KnockBack() { EntityID = eid_2Slam, Origin = originSlam, Distance = distanceSlam, }; _game.KnockBackComponent.Add(eid_2Slam, knockBackEffectSlam); break; case 10: eid = Entity.NextEntity(); targetIDSlam = GetPlayerID(); eid_2Slam = Entity.NextEntity(); originSlam = _game.PositionComponent[targetIDSlam].Center; distanceSlam = 220; slamDamage = 50; instantEffectSlam = new InstantEffect() { EntityID = eid_2Slam, }; _game.InstantEffectComponent.Add(eid_2Slam, instantEffectSlam); DirectDamageSlam = new DirectDamage() { EntityID = eid_2Slam, Damage = slamDamage }; _game.DirectDamageComponent.Add(eid_2Slam, DirectDamageSlam); knockBackEffectSlam = new KnockBack() { EntityID = eid_2Slam, Origin = originSlam, Distance = distanceSlam, }; _game.KnockBackComponent.Add(eid_2Slam, knockBackEffectSlam); break; default: break; #endregion } break; case SkillType.ThrusterRush: #region Skill Variables TimedEffect timedEffectRush; float effectDurationRush; Buff buffEffectRush; uint targetIDRush; int speedIncreaseRush; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); effectDurationRush = 1; targetIDRush = GetPlayerID(); speedIncreaseRush = 600; timedEffectRush = new TimedEffect() { EntityID = eid, TotalDuration = effectDurationRush, TimeLeft = effectDurationRush, }; _game.TimedEffectComponent.Add(eid, timedEffectRush); buffEffectRush = new Buff() { EntityID = eid, TargetID = targetIDRush, MovementSpeed = speedIncreaseRush, }; _game.BuffComponent.Add(eid, buffEffectRush); break; case 2: eid = Entity.NextEntity(); effectDurationRush = 1; targetIDRush = GetPlayerID(); speedIncreaseRush = 600; timedEffectRush = new TimedEffect() { EntityID = eid, TotalDuration = effectDurationRush, TimeLeft = effectDurationRush, }; _game.TimedEffectComponent.Add(eid, timedEffectRush); buffEffectRush = new Buff() { EntityID = eid, TargetID = targetIDRush, MovementSpeed = speedIncreaseRush, }; _game.BuffComponent.Add(eid, buffEffectRush); break; case 3: eid = Entity.NextEntity(); effectDurationRush = 1; targetIDRush = GetPlayerID(); speedIncreaseRush = 600; timedEffectRush = new TimedEffect() { EntityID = eid, TotalDuration = effectDurationRush, TimeLeft = effectDurationRush, }; _game.TimedEffectComponent.Add(eid, timedEffectRush); buffEffectRush = new Buff() { EntityID = eid, TargetID = targetIDRush, MovementSpeed = speedIncreaseRush, }; _game.BuffComponent.Add(eid, buffEffectRush); break; case 4: eid = Entity.NextEntity(); effectDurationRush = 1; targetIDRush = GetPlayerID(); speedIncreaseRush = 600; timedEffectRush = new TimedEffect() { EntityID = eid, TotalDuration = effectDurationRush, TimeLeft = effectDurationRush, }; _game.TimedEffectComponent.Add(eid, timedEffectRush); buffEffectRush = new Buff() { EntityID = eid, TargetID = targetIDRush, MovementSpeed = speedIncreaseRush, }; _game.BuffComponent.Add(eid, buffEffectRush); break; case 5: eid = Entity.NextEntity(); effectDurationRush = 1; targetIDRush = GetPlayerID(); speedIncreaseRush = 600; timedEffectRush = new TimedEffect() { EntityID = eid, TotalDuration = effectDurationRush, TimeLeft = effectDurationRush, }; _game.TimedEffectComponent.Add(eid, timedEffectRush); buffEffectRush = new Buff() { EntityID = eid, TargetID = targetIDRush, MovementSpeed = speedIncreaseRush, }; _game.BuffComponent.Add(eid, buffEffectRush); break; case 6: eid = Entity.NextEntity(); effectDurationRush = 1; targetIDRush = GetPlayerID(); speedIncreaseRush = 600; timedEffectRush = new TimedEffect() { EntityID = eid, TotalDuration = effectDurationRush, TimeLeft = effectDurationRush, }; _game.TimedEffectComponent.Add(eid, timedEffectRush); buffEffectRush = new Buff() { EntityID = eid, TargetID = targetIDRush, MovementSpeed = speedIncreaseRush, }; _game.BuffComponent.Add(eid, buffEffectRush); break; case 7: eid = Entity.NextEntity(); effectDurationRush = 1; targetIDRush = GetPlayerID(); speedIncreaseRush = 600; timedEffectRush = new TimedEffect() { EntityID = eid, TotalDuration = effectDurationRush, TimeLeft = effectDurationRush, }; _game.TimedEffectComponent.Add(eid, timedEffectRush); buffEffectRush = new Buff() { EntityID = eid, TargetID = targetIDRush, MovementSpeed = speedIncreaseRush, }; _game.BuffComponent.Add(eid, buffEffectRush); break; case 8: eid = Entity.NextEntity(); effectDurationRush = 1; targetIDRush = GetPlayerID(); speedIncreaseRush = 600; timedEffectRush = new TimedEffect() { EntityID = eid, TotalDuration = effectDurationRush, TimeLeft = effectDurationRush, }; _game.TimedEffectComponent.Add(eid, timedEffectRush); buffEffectRush = new Buff() { EntityID = eid, TargetID = targetIDRush, MovementSpeed = speedIncreaseRush, }; _game.BuffComponent.Add(eid, buffEffectRush); break; case 9: eid = Entity.NextEntity(); effectDurationRush = 1; targetIDRush = GetPlayerID(); speedIncreaseRush = 600; timedEffectRush = new TimedEffect() { EntityID = eid, TotalDuration = effectDurationRush, TimeLeft = effectDurationRush, }; _game.TimedEffectComponent.Add(eid, timedEffectRush); buffEffectRush = new Buff() { EntityID = eid, TargetID = targetIDRush, MovementSpeed = speedIncreaseRush, }; _game.BuffComponent.Add(eid, buffEffectRush); break; case 10: eid = Entity.NextEntity(); effectDurationRush = 1; targetIDRush = GetPlayerID(); speedIncreaseRush = 600; timedEffectRush = new TimedEffect() { EntityID = eid, TotalDuration = effectDurationRush, TimeLeft = effectDurationRush, }; _game.TimedEffectComponent.Add(eid, timedEffectRush); buffEffectRush = new Buff() { EntityID = eid, TargetID = targetIDRush, MovementSpeed = speedIncreaseRush, }; _game.BuffComponent.Add(eid, buffEffectRush); break; default: break; #endregion } break; default: break; #endregion } break; #endregion #region Gargranian case Aggregate.GargranianPlayer: #region Race Variables #endregion switch (skillType) { #region Checking Skill Type case SkillType.Teleport: { #region Skill Variables int psiCost = (int)(_game.StatsComponent[userID].PsiBase * .05); int distance = 300; #endregion switch (rank) { #region Checking Rank case 1: psiCost += (int)(_game.StatsComponent[userID].PsiBase * .5); break; case 2: psiCost += (int)(_game.StatsComponent[userID].PsiBase * .45); break; case 3: psiCost += (int)(_game.StatsComponent[userID].PsiBase * .40); break; case 4: psiCost += (int)(_game.StatsComponent[userID].PsiBase * .35); break; case 5: psiCost += (int)(_game.StatsComponent[userID].PsiBase * .30); break; case 6: psiCost += (int)(_game.StatsComponent[userID].PsiBase * .25); break; case 7: psiCost += (int)(_game.StatsComponent[userID].PsiBase * .20); break; case 8: psiCost += (int)(_game.StatsComponent[userID].PsiBase * .15); break; case 9: psiCost += (int)(_game.StatsComponent[userID].PsiBase * .10); break; case 10: psiCost += (int)(_game.StatsComponent[userID].PsiBase * .05); break; default: break; #endregion } #region Logic if(DrainPsiOrFatigue(userID, psiCost)) { //a new eid for the animation uint entityId = Entity.NextEntity(); //need to get your old position and which direction you were facing Position pos = _game.PositionComponent[userID]; Facing facing = (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow; //create the animation for the after effect SpriteAnimation animation = new SpriteAnimation() { EntityID = entityId, IsLooping = false, CurrentFrame = 0, CurrentAnimationRow = (int)facing, FramesPerSecond = 15, IsPlaying = true, TimePassed = 0 }; _game.SpriteAnimationComponent[entityId] = animation; //give the after effect a position Position animationPos = new Position() { EntityID = entityId, Center = new Vector2(pos.Center.X - 32, pos.Center.Y - 32), Radius = 0, RoomID = _game.PositionComponent[userID].RoomID }; _game.PositionComponent[entityId] = animationPos; //set the spritesheet for the after effect Texture2D spriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/Invis"); spriteSheet.Name = "Spritesheets/Skills/Effects/Invis"; //set up the sprite for the after effect Sprite sprite = new Sprite() { EntityID = entityId, SpriteBounds = new Rectangle(0, 0, 64, 64), SpriteColor = new Color(255, 255, 255, 255), SpriteSheet = spriteSheet, UseDifferentColor = false, }; _game.SpriteComponent[entityId] = sprite; //allow the after effect to expire TimedEffect timedEffect = new TimedEffect() { EntityID = entityId, TotalDuration = 1, TimeLeft = 1 }; _game.TimedEffectComponent.Add(entityId, timedEffect); //depending at which direction the character is facing, move them in that direction switch (facing) { case Facing.North: pos.Center.Y -= distance; if (pos.Center.Y <= 0) pos.Center.Y = 5; break; case Facing.East: pos.Center.X += distance; if (pos.Center.X >= _game.GraphicsDevice.Viewport.Width) pos.Center.X = _game.GraphicsDevice.Viewport.Width - 5; break; case Facing.South: pos.Center.Y += distance; if (pos.Center.Y >= _game.GraphicsDevice.Viewport.Height) pos.Center.Y = _game.GraphicsDevice.Viewport.Height - 5; break; case Facing.West: pos.Center.X -= distance; if (pos.Center.X <= 0) pos.Center.X = 5; break; } //update their position _game.PositionComponent[userID] = pos; //check for collision with static objects _game.CollisionSystem.CheckTeleportCollision(userID, facing); } #endregion break; } case SkillType.Invisibility: { #region Skill Variables int duration = 0; int psiCost = (int)(_game.StatsComponent[userID].PsiBase * .05); #endregion switch (rank) { #region Checking Rank case 1: duration = 2; break; case 2: duration = 4; break; case 3: duration = 6; break; case 4: duration = 8; break; case 5: duration = 10; break; case 6: duration = 12; break; case 7: duration = 14; break; case 8: duration = 16; break; case 9: duration = 18; break; case 10: duration = 20; break; default: break; #endregion } #region Logic if (DrainPsiOrFatigue(userID, psiCost)) { eid = Entity.NextEntity(); TimedEffect timedEffect; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = duration, TimeLeft = duration }; _game.TimedEffectComponent.Add(eid, timedEffect); AgroDrop agroDrop = new AgroDrop() { EntityID = eid, PlayerID = userID }; _game.AgroDropComponent.Add(eid, agroDrop); ChangeVisibility changeVisibility; changeVisibility = new ChangeVisibility() { EntityID = eid, TargetID = userID, newColor = new Color(45, 45, 45, 0) }; _game.ChangeVisibilityComponent.Add(eid, changeVisibility); } #endregion break; } case SkillType.Meditate: { #region Skill Variables float psiAmount = (float)(_game.StatsComponent[userID].PsiBase * .01); int duration = 5; #endregion switch (rank) { #region Checking Rank case 1: psiAmount += (float)(_game.StatsComponent[userID].PsiBase * .02); break; case 2: psiAmount += (float)(_game.StatsComponent[userID].PsiBase * .04); break; case 3: psiAmount += (float)(_game.StatsComponent[userID].PsiBase * .06); break; case 4: psiAmount += (float)(_game.StatsComponent[userID].PsiBase * .08); break; case 5: psiAmount += (float)(_game.StatsComponent[userID].PsiBase * .10); break; case 6: psiAmount += (float)(_game.StatsComponent[userID].PsiBase * .12); break; case 7: psiAmount += (float)(_game.StatsComponent[userID].PsiBase * .14); break; case 8: psiAmount += (float)(_game.StatsComponent[userID].PsiBase * .16); break; case 9: psiAmount += (float)(_game.StatsComponent[userID].PsiBase * .18); break; case 10: psiAmount += (float)(_game.StatsComponent[userID].PsiBase * .2); break; default: break; } #endregion #region logic uint entityId = Entity.NextEntity(); TimedEffect timed = new TimedEffect() { EntityID = entityId, TimeLeft = duration, TotalDuration = duration }; _game.TimedEffectComponent[entityId] = timed; PsiOrFatigueRegen regen = new PsiOrFatigueRegen() { EntityID = entityId, TargetID = userID, AmountPerTick = psiAmount, CurrentTime = 1, TickTime = 1 }; _game.PsiOrFatigueRegenComponent[entityId] = regen; #endregion break; } case SkillType.PsionicSpear: #region Skill Variables #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); break; case 2: eid = Entity.NextEntity(); break; case 3: eid = Entity.NextEntity(); break; case 4: eid = Entity.NextEntity(); break; case 5: eid = Entity.NextEntity(); break; case 6: eid = Entity.NextEntity(); break; case 7: eid = Entity.NextEntity(); break; case 8: eid = Entity.NextEntity(); break; case 9: eid = Entity.NextEntity(); break; case 10: eid = Entity.NextEntity(); break; default: break; #endregion } break; case SkillType.Push: #region Skill Variables #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); break; case 2: eid = Entity.NextEntity(); break; case 3: eid = Entity.NextEntity(); break; case 4: eid = Entity.NextEntity(); break; case 5: eid = Entity.NextEntity(); break; case 6: eid = Entity.NextEntity(); break; case 7: eid = Entity.NextEntity(); break; case 8: eid = Entity.NextEntity(); break; case 9: eid = Entity.NextEntity(); break; case 10: eid = Entity.NextEntity(); break; default: break; #endregion } break; case SkillType.ImprovedPsionicSpear: #region Skill Variables #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); break; case 2: eid = Entity.NextEntity(); break; case 3: eid = Entity.NextEntity(); break; case 4: eid = Entity.NextEntity(); break; case 5: eid = Entity.NextEntity(); break; case 6: eid = Entity.NextEntity(); break; case 7: eid = Entity.NextEntity(); break; case 8: eid = Entity.NextEntity(); break; case 9: eid = Entity.NextEntity(); break; case 10: eid = Entity.NextEntity(); break; default: break; #endregion } break; case SkillType.MentalBarrier: #region Skill Variables #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); break; case 2: eid = Entity.NextEntity(); break; case 3: eid = Entity.NextEntity(); break; case 4: eid = Entity.NextEntity(); break; case 5: eid = Entity.NextEntity(); break; case 6: eid = Entity.NextEntity(); break; case 7: eid = Entity.NextEntity(); break; case 8: eid = Entity.NextEntity(); break; case 9: eid = Entity.NextEntity(); break; case 10: eid = Entity.NextEntity(); break; default: break; #endregion } break; case SkillType.WormOfGargran: #region Skill Variables #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); break; case 2: eid = Entity.NextEntity(); break; case 3: eid = Entity.NextEntity(); break; case 4: eid = Entity.NextEntity(); break; case 5: eid = Entity.NextEntity(); break; case 6: eid = Entity.NextEntity(); break; case 7: eid = Entity.NextEntity(); break; case 8: eid = Entity.NextEntity(); break; case 9: eid = Entity.NextEntity(); break; case 10: eid = Entity.NextEntity(); break; default: break; #endregion } break; case SkillType.Soothe: #region Skill Variables #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); break; case 2: eid = Entity.NextEntity(); break; case 3: eid = Entity.NextEntity(); break; case 4: eid = Entity.NextEntity(); break; case 5: eid = Entity.NextEntity(); break; case 6: eid = Entity.NextEntity(); break; case 7: eid = Entity.NextEntity(); break; case 8: eid = Entity.NextEntity(); break; case 9: eid = Entity.NextEntity(); break; case 10: eid = Entity.NextEntity(); break; default: break; #endregion } break; default: break; #endregion } break; #endregion #region Cultist //Implementation for the Cultist Player ~Nick B. //Useful - Regex for separating rank cases into regions //Replace: break;.*:Cc:Cc //With: break;\n#endregion\n\n#region Rank \n //Turns // break; // // case 2: //Into // break; // #endregion // // #region Rank // case 2: // // All thats needed is to add #region Rank 1 // and an #endregion after case 10 // and put in the rank numbers // ~Nick B. case Aggregate.CultistPlayer: { #region Race Variables int test; #endregion switch (skillType) { #region Checking Skill Type case SkillType.Enslave: //Projectile { #region Skill Logic _game.SkillEntityFactory.CreateSkillProjectile(SkillType.Enslave, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], rank, 300, userID); #endregion break; } case SkillType.Fear: //AOE { #region Skill Variables int fearRange = 0; #endregion #region Skill Logic switch (rank) { #region Checking Rank #region Rank 1 case 1: fearRange = 10; break; #endregion #region Rank 2 case 2: fearRange = 13; break; #endregion #region Rank 3 case 3: fearRange = 17; break; #endregion #region Rank 4 case 4: fearRange = 25; break; #endregion #region Rank 5 case 5: fearRange = 30; break; #endregion #region Rank 6 case 6: fearRange = 37; break; #endregion #region Rank 7 case 7: fearRange = 48; break; #endregion #region Rank 8 case 8: fearRange = 55; break; #endregion #region Rank 9 case 9: fearRange = 67; break; #endregion #region Rank 10 case 10: fearRange = 90; break; #endregion default: break; #endregion } _game.SkillEntityFactory.CreateSkillAoE(SkillType.Fear, _game.PositionComponent[userID], rank, fearRange); #endregion break; } case SkillType.Sacrifice: //Instant { #region Skill Variables InstantEffect instantEffect; DirectHeal directHeal; DirectDamage directDamage; uint enslavedEnemyID = int.MaxValue; float damageValue = 0, healValue = 0; #endregion #region Skill Logic //Getting whatever is the first monster enslaved by this player //Alternatively, could sacrifice all enslaved monsters foreach (Enslave effect in _game.EnslaveComponent.All) { if (effect.OwnerID == userID && _game.EnemyComponent.Contains(effect.TargetID)) { enslavedEnemyID = effect.TargetID; break; } } if (!_game.EnemyComponent.Contains(enslavedEnemyID)) return; damageValue = _game.EnemyComponent[enslavedEnemyID].Health; switch (rank) { #region Checking Rank #region Rank 1 case 1: healValue = damageValue * 0.10f; //10% of remaining life break; #endregion #region Rank 2 case 2: healValue = damageValue * 0.15f; //15% of remaining life break; #endregion #region Rank 3 case 3: healValue = damageValue * 0.20f; //20% of remaining life break; #endregion #region Rank 4 case 4: healValue = damageValue * 0.25f; //25% of remaining life break; #endregion #region Rank 5 case 5: healValue = damageValue * 0.35f; //35% of remaining life break; #endregion #region Rank 6 case 6: healValue = damageValue * 0.50f; //50% of remaining life break; #endregion #region Rank 7 case 7: healValue = damageValue * 0.80f; //80% of remaining life break; #endregion #region Rank 8 case 8: healValue = damageValue * 1.00f; //100% of remaining life break; #endregion #region Rank 9 case 9: healValue = damageValue * 1.10f; //110% of remaining life break; #endregion #region Rank 10 case 10: healValue = damageValue * 0.1f; //10% of remaining life break; #endregion default: return; #endregion } //Since the only variance between ranks is the healValue variable, we can //keep it simple by just adding all the effects down here, after we've //got the variables initialized // ~Nick B. eid = Entity.NextEntity(); instantEffect = new InstantEffect() { EntityID = eid, isTriggered = false, }; _game.InstantEffectComponent.Add(eid, instantEffect); directDamage = new DirectDamage() { EntityID = eid, TargetID = enslavedEnemyID, Damage = damageValue, }; _game.DirectDamageComponent.Add(eid, directDamage); directHeal = new DirectHeal() { EntityID = eid, TargetID = userID, Amount = healValue, }; _game.DirectHealComponent.Add(eid, directHeal); #endregion break; } case SkillType.PsionicSpear: //Projectile { #region Skill Logic _game.SkillEntityFactory.CreateSkillProjectile(SkillType.PsionicSpear, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], rank, 300, userID); #endregion break; } case SkillType.Taint: //Projectile { #region Skill Logic _game.SkillEntityFactory.CreateSkillProjectile(SkillType.Taint, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], rank, 300, userID); #endregion break; } case SkillType.Rot: //Projectile { #region Skill Logic _game.SkillEntityFactory.CreateSkillProjectile(SkillType.Rot, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], rank, 300, userID); #endregion break; } case SkillType.Push: //AOE { #region Skill Variables int pushRange = 0; #endregion #region Skill Logic switch (rank) { #region Checking Rank #region Rank 1 case 1: pushRange = 15; break; #endregion #region Rank 2 case 2: pushRange = 20; break; #endregion #region Rank 3 case 3: pushRange = 24; break; #endregion #region Rank 4 case 4: pushRange = 30; break; #endregion #region Rank 5 case 5: pushRange = 45; break; #endregion #region Rank 6 case 6: pushRange = 60; break; #endregion #region Rank 7 case 7: pushRange = 85; break; #endregion #region Rank 8 case 8: pushRange = 100; break; #endregion #region Rank 9 case 9: pushRange = 125; break; #endregion #region Rank 10 case 10: pushRange = 150; break; #endregion default: break; #endregion } _game.SkillEntityFactory.CreateSkillAoE(SkillType.Push, _game.PositionComponent[userID], rank, pushRange); #endregion break; } case SkillType.Lightning: //Instant { #region Skill Variables InstantEffect instantEffect; DirectDamage directDamage; uint eid_2; TimedEffect timedEffect; Stun stun; Random damageMod = new Random(); Position evalPosition; uint tempEnemyID; List<uint> ignoreList = new List<uint>(); int chainNumber = 0; float duration = 0; int damageValue = 0; float maxChainDistance = 0; #endregion #region Skill Logic //No need to continue if we can't even get the position of the player //which means there will need to be some bugs to iron out if (!_game.PositionComponent.Contains(userID)) return; evalPosition = _game.PositionComponent[userID]; switch (rank) { #region Checking Rank #region Rank 1 case 1: chainNumber = 1; //Chains through 1 enemy duration = 2; //Duration of 2 seconds damageValue = 2 + damageMod.Next(4); //Damage between 2 and 5 maxChainDistance = 10; //Biggest gap an arc will span break; #endregion #region Rank 2 case 2: chainNumber = 1; //Chains through 1 enemy duration = 3; //Duration of 3 seconds damageValue = 4 + damageMod.Next(5); //Damage between 4 and 8 maxChainDistance = 15; //Biggest gap an arc will span break; #endregion #region Rank 3 case 3: chainNumber = 2; //Chains through 2 enemies duration = 3; //Duration of 3 seconds damageValue = 6 + damageMod.Next(5); //Damage between 6 and 10 maxChainDistance = 15; //Biggest gap an arc will span break; #endregion #region Rank 4 case 4: chainNumber = 2; //Chains through 2 enemies duration = 4; //Duration of 4 seconds damageValue = 10 + damageMod.Next(3); //Damage between 10 and 12 maxChainDistance = 18; //Biggest gap an arc with span break; #endregion #region Rank 5 case 5: chainNumber = 3; //Chains through 3 enemies duration = 5; //Duration of 5 seconds damageValue = 13 + damageMod.Next(3); //Damage between 13 and 15 maxChainDistance = 21; //Biggest gap an arc will span break; #endregion #region Rank 6 case 6: chainNumber = 3; //Chains through 3 enemies duration = 5; //Duration of 5 seconds damageValue = 17 + damageMod.Next(4); //Damage between 17 and 20 maxChainDistance = 26; //Biggest gap an arc will span break; #endregion #region Rank 7 case 7: chainNumber = 4; //Chains through 4 enemies duration = 7; //Duration of 7 seconds damageValue = 22 + damageMod.Next(6); //Damage between 22 and 27 maxChainDistance = 30; //Biggest gap an arc will span break; #endregion #region Rank 8 case 8: chainNumber = 4; //Chains through 4 enemies duration = 7; //Duration of 7 seconds damageValue = 30 + damageMod.Next(11); //Damage between 30 and 40 maxChainDistance = 38; //Biggest gap an arc will span break; #endregion #region Rank 9 case 9: chainNumber = 5; //Chains through 5 enemies duration = 7; //Duration of 7 seconds damageValue = 35 + damageMod.Next(13); //Damage between 35 and 47 maxChainDistance = 45; //Biggest gap an arc will span break; #endregion #region Rank 10 case 10: chainNumber = 6; //Chains through 6 enemies duration = 10; //Duration of 10 seconds damageValue = 50 + damageMod.Next(16); //Damage between 50 and 65 maxChainDistance = 50; //Biggest gap an arc will span break; #endregion default: return; #endregion } eid = Entity.NextEntity(); instantEffect = new InstantEffect() { EntityID = eid, isTriggered = false, }; _game.InstantEffectComponent.Add(eid, instantEffect); eid_2 = Entity.NextEntity(); timedEffect = new TimedEffect() { EntityID = eid_2, TotalDuration = duration, TimeLeft = duration, }; for (int x = 0; x < chainNumber; x++) { tempEnemyID = _game.CollisionSystem.GetClosestEnemy(evalPosition, ignoreList, maxChainDistance); //No need to continue, no enemy is close enough or no other enemies exist if (!_game.EnemyComponent.Contains(tempEnemyID)) break; //Add the enemy we just chained to to the ignore list, we don't want //to chain to them again ignoreList.Add(tempEnemyID); //This will be an instant effect, so we'll use eid here directDamage = new DirectDamage() { EntityID = eid, TargetID = tempEnemyID, Damage = damageValue, }; _game.DirectDamageComponent.Add(eid, directDamage); //This will be a timed effect, so we'll need eid_2 here stun = new Stun() { EntityID = eid_2, TargetID = tempEnemyID, Type = StunType.CantBreak, }; _game.StunComponent.Add(eid_2, stun); } #endregion break; } case SkillType.Malice: //AOE { #region Skill Variables int meterConversion = 75; int maliceRange = 0; #endregion #region Skill Logic switch (rank) { #region Checking Rank #region Rank 1 case 1: maliceRange = 2; break; #endregion #region Rank 2 case 2: maliceRange = 2; break; #endregion #region Rank 3 case 3: maliceRange = 3; break; #endregion #region Rank 4 case 4: maliceRange = 3; break; #endregion #region Rank 5 case 5: maliceRange = 4; break; #endregion #region Rank 6 case 6: maliceRange = 5; break; #endregion #region Rank 7 case 7: maliceRange = 5; break; #endregion #region Rank 8 case 8: maliceRange = 6; break; #endregion #region Rank 9 case 9: maliceRange = 6; break; #endregion #region Rank 10 case 10: maliceRange = 6; break; #endregion default: break; #endregion } _game.SkillEntityFactory.CreateSkillAoE(SkillType.Malice, _game.PositionComponent[userID], rank, maliceRange * meterConversion); #endregion break; } default: { break; } #endregion } break; } #endregion #region Vermis case Aggregate.ZombiePlayer: CoolDown coolDown; TimedEffect timeEffect; Buff buff; #region Race Variables #endregion switch (skillType) { #region Checking Skill Type case SkillType.ThrownBlades: #region Skill Variables #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.ThrownBlades, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.ThrownBlades, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 1, 300, userID); break; case 2: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.ThrownBlades, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.ThrownBlades, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 2, 300, userID); break; case 3: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.ThrownBlades, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.ThrownBlades, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 3, 300, userID); break; case 4: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.ThrownBlades, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.ThrownBlades, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 4, 300, userID); break; case 5: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.ThrownBlades, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.ThrownBlades, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 5, 300, userID); break; case 6: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.ThrownBlades, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.ThrownBlades, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 6, 300, userID); break; case 7: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.ThrownBlades, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.ThrownBlades, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 7, 300, userID); break; case 8: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.ThrownBlades, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.ThrownBlades, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 8, 300, userID); break; case 9: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.ThrownBlades, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.ThrownBlades, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 9, 300, userID); break; case 10: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.ThrownBlades, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.ThrownBlades, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 10, 300, userID); break; default: break; #endregion } break; case SkillType.FrenziedAttack: #region Skill Variables #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.FrenziedAttack, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID =eid, TimeLeft = 10, TotalDuration=10, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = 100, DefenseMelee = 0, DefenseRanged = 0, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 10, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = true, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 10, }; _game.BuffComponent.Add(eid, buff); break; case 2: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.FrenziedAttack, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID =eid, TimeLeft = 10, TotalDuration=10, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = 120, DefenseMelee = 0, DefenseRanged = 0, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 15, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = true, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 15, }; _game.BuffComponent.Add(eid, buff); break; case 3: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 12, TimeLeft = 12, Type = SkillType.FrenziedAttack, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 12, TotalDuration = 12, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = 120, DefenseMelee = 0, DefenseRanged = 0, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 15, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = true, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 15, }; _game.BuffComponent.Add(eid, buff); break; case 4: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 14, TimeLeft = 14, Type = SkillType.FrenziedAttack, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 14, TotalDuration = 14, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = 140, DefenseMelee = 0, DefenseRanged = 0, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 20, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = true, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 20, }; _game.BuffComponent.Add(eid, buff); break; case 5: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 14, TimeLeft = 14, Type = SkillType.FrenziedAttack, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 14, TotalDuration = 14, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = 140, DefenseMelee = 0, DefenseRanged = 0, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 20, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = true, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 20, }; _game.BuffComponent.Add(eid, buff); break; case 6: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 16, TimeLeft = 16, Type = SkillType.FrenziedAttack, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 16, TotalDuration = 16, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = 140, DefenseMelee = 0, DefenseRanged = 0, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 20, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = true, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 20, }; _game.BuffComponent.Add(eid, buff); break; case 7: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 16, TimeLeft = 16, Type = SkillType.FrenziedAttack, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 16, TotalDuration = 16, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = 160, DefenseMelee = 0, DefenseRanged = 0, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 25, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = true, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 25, }; _game.BuffComponent.Add(eid, buff); break; case 8: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 18, TimeLeft = 18, Type = SkillType.FrenziedAttack, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 18, TotalDuration = 18, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = 160, DefenseMelee = 0, DefenseRanged = 0, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 25, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = true, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 25, }; _game.BuffComponent.Add(eid, buff); break; case 9: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 18, TimeLeft = 18, Type = SkillType.FrenziedAttack, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 18, TotalDuration = 18, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = 180, DefenseMelee = 0, DefenseRanged = 0, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 30, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = true, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 30, }; _game.BuffComponent.Add(eid, buff); break; case 10: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 20, TimeLeft = 20, Type = SkillType.FrenziedAttack, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 20, TotalDuration = 20, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = 200, DefenseMelee = 0, DefenseRanged = 0, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 35, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = true, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 35, }; _game.BuffComponent.Add(eid, buff); break; default: break; #endregion } break; case SkillType.CausticWeapons: #region Skill Variables #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.CausticWeapons, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); break; case 2: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.CausticWeapons, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); break; case 3: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.CausticWeapons, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); break; case 4: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.CausticWeapons, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); break; case 5: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.CausticWeapons, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); break; case 6: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.CausticWeapons, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); break; case 7: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.CausticWeapons, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); break; case 8: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.CausticWeapons, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); break; case 9: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.CausticWeapons, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); break; case 10: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.CausticWeapons, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); break; default: break; #endregion } break; case SkillType.MeatShield: #region Skill Variables #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.MeatShield, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 10, TotalDuration = 10, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = 0, DefenseMelee = 0, DefenseRanged = 1, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 00, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = true, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = false, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = true, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = -6, }; _game.BuffComponent.Add(eid, buff); break; case 2: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.MeatShield, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 10, TotalDuration = 10, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = 0, DefenseMelee = 0, DefenseRanged = 1, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 00, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = true, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = false, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = true, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = -5, }; _game.BuffComponent.Add(eid, buff); break; case 3: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 12, TimeLeft = 12, Type = SkillType.MeatShield, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 12, TotalDuration = 12, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = 0, DefenseMelee = 0, DefenseRanged = 2, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 00, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = true, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = false, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = true, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = -5, }; _game.BuffComponent.Add(eid, buff); break; case 4: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 14, TimeLeft = 14, Type = SkillType.MeatShield, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 14, TotalDuration = 14, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = 0, DefenseMelee = 0, DefenseRanged = 2, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 00, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = true, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = false, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = true, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = -4, }; _game.BuffComponent.Add(eid, buff); break; case 5: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 14, TimeLeft = 14, Type = SkillType.MeatShield, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 14, TotalDuration = 14, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = 0, DefenseMelee = 0, DefenseRanged = 3, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 00, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = true, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = false, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = true, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = -4, }; _game.BuffComponent.Add(eid, buff); break; case 6: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 16, TimeLeft = 16, Type = SkillType.MeatShield, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 16, TotalDuration = 16, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = 0, DefenseMelee = 0, DefenseRanged = 3, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 00, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = true, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = false, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = true, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = -3, }; _game.BuffComponent.Add(eid, buff); break; case 7: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 16, TimeLeft = 16, Type = SkillType.MeatShield, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 16, TotalDuration = 16, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = 0, DefenseMelee = 0, DefenseRanged = 4, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 00, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = true, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = false, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = true, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = -3, }; _game.BuffComponent.Add(eid, buff); break; case 8: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 18, TimeLeft = 18, Type = SkillType.MeatShield, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 18, TotalDuration = 18, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = 0, DefenseMelee = 0, DefenseRanged = 4, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 00, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = true, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = false, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = true, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = -2, }; _game.BuffComponent.Add(eid, buff); break; case 9: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 18, TimeLeft = 18, Type = SkillType.MeatShield, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 18, TotalDuration = 18, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = 0, DefenseMelee = 0, DefenseRanged = 5, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 00, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = true, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = false, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = true, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = -2, }; _game.BuffComponent.Add(eid, buff); break; case 10: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 20, TimeLeft = 20, Type = SkillType.MeatShield, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 20, TotalDuration = 20, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = 0, DefenseMelee = 0, DefenseRanged = 7, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 00, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = true, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength =- 1, }; _game.BuffComponent.Add(eid, buff); break; default: break; #endregion } break; case SkillType.HardenedBody: #region Skill Variables #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.HardenedBody, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 10, TotalDuration = 10, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = -100, DefenseMelee = 1, DefenseRanged = 0, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 00, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = true, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength =0, }; _game.BuffComponent.Add(eid, buff); break; case 2: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.HardenedBody, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 10, TotalDuration = 10, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = -90, DefenseMelee = 1, DefenseRanged = 0, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 00, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = true, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength =0, }; _game.BuffComponent.Add(eid, buff); break; case 3: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 12, TimeLeft = 12, Type = SkillType.HardenedBody, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 12, TotalDuration = 12, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = -90, DefenseMelee = 2, DefenseRanged =0, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 00, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = true, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 0, }; _game.BuffComponent.Add(eid, buff); break; case 4: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 14, TimeLeft = 14, Type = SkillType.HardenedBody, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 14, TotalDuration = 14, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = -80, DefenseMelee = 2, DefenseRanged = 2, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 00, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = true, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 0, }; _game.BuffComponent.Add(eid, buff); break; case 5: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 14, TimeLeft = 14, Type = SkillType.HardenedBody, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 14, TotalDuration = 14, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = -80, DefenseMelee = 3, DefenseRanged = 2, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 00, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = true, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 0, }; _game.BuffComponent.Add(eid, buff); break; case 6: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 16, TimeLeft = 16, Type = SkillType.HardenedBody, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 16, TotalDuration = 16, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = -70, DefenseMelee = 3, DefenseRanged = 3, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 00, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = true, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 0, }; _game.BuffComponent.Add(eid, buff); break; case 7: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 16, TimeLeft = 16, Type = SkillType.HardenedBody, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 16, TotalDuration = 16, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = -70, DefenseMelee = 4, DefenseRanged = 4, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 00, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = true, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = false, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 0, }; _game.BuffComponent.Add(eid, buff); break; case 8: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 18, TimeLeft = 18, Type = SkillType.HardenedBody, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 18, TotalDuration = 18, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = -60, DefenseMelee = 4, DefenseRanged = 4, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 00, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = true, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = false, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 0, }; _game.BuffComponent.Add(eid, buff); break; case 9: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 18, TimeLeft = 18, Type = SkillType.HardenedBody, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 18, TotalDuration = 18, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = -60, DefenseMelee = 5, DefenseRanged = 0, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 00, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = true, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed =true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 0, }; _game.BuffComponent.Add(eid, buff); break; case 10: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 20, TimeLeft = 20, Type = SkillType.HardenedBody, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); timeEffect = new TimedEffect() { EntityID = eid, TimeLeft = 20, TotalDuration = 20, }; _game.TimedEffectComponent.Add(eid, timeEffect); buff = new Buff() { EntityID = eid, MovementSpeed = -50, DefenseMelee = 7, DefenseRanged = 0, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 00, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = true, isPercentDefenseMelee = true, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = false, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = userID, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 0, }; _game.BuffComponent.Add(eid, buff); break; default: break; #endregion } break; case SkillType.Regeneration: #region Skill Variables HealOverTime HoT; TimedEffect time; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.Regeneration, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); HoT = new HealOverTime() { AmountPerTick = 1, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = userID, TickTime = 1, }; _game.HealOverTimeComponent.Add(eid, HoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 10, TotalDuration = 10, }; _game.TimedEffectComponent.Add(eid, time); break; case 2: eid = Entity.NextEntity(); HoT = new HealOverTime() { AmountPerTick = 1, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = userID, TickTime = 1, }; _game.HealOverTimeComponent.Add(eid, HoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 12, TotalDuration = 12, }; _game.TimedEffectComponent.Add(eid, time); coolDown = new CoolDown() { EntityID = eid, MaxTime = 12, TimeLeft = 12, Type = SkillType.Regeneration, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); break; case 3: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 12, TimeLeft = 12, Type = SkillType.Regeneration, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); HoT = new HealOverTime() { AmountPerTick = 1, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = userID, TickTime = 1, }; _game.HealOverTimeComponent.Add(eid, HoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 12, TotalDuration = 12, }; _game.TimedEffectComponent.Add(eid, time); break; case 4: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.Regeneration, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); HoT = new HealOverTime() { AmountPerTick = 2, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = userID, TickTime = 1, }; _game.HealOverTimeComponent.Add(eid, HoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 14, TotalDuration = 14, }; _game.TimedEffectComponent.Add(eid, time); break; case 5: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.Regeneration, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); HoT = new HealOverTime() { AmountPerTick = 3, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = userID, TickTime = 1, }; _game.HealOverTimeComponent.Add(eid, HoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 14, TotalDuration = 14, }; _game.TimedEffectComponent.Add(eid, time); break; case 6: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.Regeneration, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); HoT = new HealOverTime() { AmountPerTick = 3, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = userID, TickTime = 1, }; _game.HealOverTimeComponent.Add(eid, HoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 16, TotalDuration = 16, }; _game.TimedEffectComponent.Add(eid, time); break; case 7: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.Regeneration, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); HoT = new HealOverTime() { AmountPerTick = 4, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = userID, TickTime = 1, }; _game.HealOverTimeComponent.Add(eid, HoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 16, TotalDuration = 16, }; _game.TimedEffectComponent.Add(eid, time); break; case 8: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.Regeneration, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); break; case 9: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.Regeneration, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); HoT = new HealOverTime() { AmountPerTick = 4, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = userID, TickTime = 1, }; _game.HealOverTimeComponent.Add(eid, HoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 18, TotalDuration = 18, }; _game.TimedEffectComponent.Add(eid, time); break; case 10: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 10, TimeLeft = 10, Type = SkillType.Regeneration, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); HoT = new HealOverTime() { AmountPerTick = 5, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = userID, TickTime = 1, }; _game.HealOverTimeComponent.Add(eid, HoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 20, TotalDuration = 20, }; _game.TimedEffectComponent.Add(eid, time); break; default: break; #endregion } break; case SkillType.BenignParasite: #region Skill Variables #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.BenignParasite, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.BenignParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 1, 300, userID); break; case 2: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.BenignParasite, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.BenignParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 2, 300, userID); break; case 3: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.BenignParasite, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.BenignParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 3, 300, userID); break; case 4: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.BenignParasite, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.BenignParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 4, 300, userID); break; case 5: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.BenignParasite, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.BenignParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 5, 300, userID); break; case 6: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.BenignParasite, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.BenignParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 6, 300, userID); break; case 7: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.BenignParasite, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.BenignParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 7, 300, userID); break; case 8: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.BenignParasite, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.BenignParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 8, 300, userID); break; case 9: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.BenignParasite, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.BenignParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 9, 300, userID); break; case 10: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.BenignParasite, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.BenignParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 10, 300, userID); break; default: break; #endregion } break; case SkillType.MaliciousParasite: #region Skill Variables #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.MaliciousParasite, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MaliciousParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 1, 300, userID); break; case 2: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.MaliciousParasite, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MaliciousParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 2, 300, userID); break; case 3: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.MaliciousParasite, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MaliciousParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 3, 300, userID); break; case 4: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.MaliciousParasite, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MaliciousParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 4, 300, userID); break; case 5: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.MaliciousParasite, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MaliciousParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 5, 300, userID); break; case 6: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.MaliciousParasite, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MaliciousParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 6, 300, userID); break; case 7: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.MaliciousParasite, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MaliciousParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 7, 300, userID); break; case 8: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.MaliciousParasite, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MaliciousParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 8, 300, userID); break; case 9: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.MaliciousParasite, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MaliciousParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 9, 300, userID); break; case 10: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.MaliciousParasite, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MaliciousParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 10, 300, userID); break; default: break; #endregion } break; case SkillType.MindlessParasites: #region Skill Variables #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.MindlessParasites, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MindlessParasites, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 1, 300, userID); break; case 2: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.MindlessParasites, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MindlessParasites, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 2, 300, userID); break; case 3: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.MindlessParasites, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MindlessParasites, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 3, 300, userID); break; case 4: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.MindlessParasites, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MindlessParasites, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 4, 300, userID); break; case 5: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.MindlessParasites, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MindlessParasites, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 5, 300, userID); break; case 6: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.MindlessParasites, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MindlessParasites, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 6, 300, userID); break; case 7: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.MindlessParasites, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MindlessParasites, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 7, 300, userID); break; case 8: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.MindlessParasites, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MindlessParasites, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 8, 300, userID); break; case 9: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.MindlessParasites, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MindlessParasites, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 9, 300, userID); break; case 10: eid = Entity.NextEntity(); coolDown = new CoolDown() { EntityID = eid, MaxTime = 1, TimeLeft = 1, Type = SkillType.MindlessParasites, UserID = userID, }; _game.CoolDownComponent.Add(eid, coolDown); _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MindlessParasites, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow, _game.PositionComponent[userID], 10, 300, userID); break; default: break; #endregion } break; default: break; #endregion } break; #endregion #region Earthian //Earthian Skills done by Andrew Bellinder case Aggregate.EarthianPlayer: #region Race Variables #endregion switch (skillType) { #region Checking Skill Type #region Turret case SkillType.Turret: { #region Skill Variables Turret turret; TimedEffect timedEffect; float effectDuration; Sprite sprite; Position turretPosition; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); effectDuration = 3; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); turretPosition = _game.PositionComponent[GetPlayerID()]; turret = new Turret() { EntityID = eid, position = turretPosition, range = 100, }; _game.TurretComponent.Add(eid, turret); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(11, 49, 37, 63), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, turret.position); break; case 2: eid = Entity.NextEntity(); effectDuration = 4; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); turretPosition = _game.PositionComponent[GetPlayerID()]; turret = new Turret() { EntityID = eid, position = turretPosition, range = 100, }; _game.TurretComponent.Add(eid, turret); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(11, 49, 37, 63), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, turret.position); break; case 3: eid = Entity.NextEntity(); effectDuration = 5; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); turretPosition = _game.PositionComponent[GetPlayerID()]; turret = new Turret() { EntityID = eid, position = turretPosition, range = 150, }; _game.TurretComponent.Add(eid, turret); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(11, 49, 37, 63), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, turret.position); break; case 4: eid = Entity.NextEntity(); effectDuration = 6; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); turretPosition = _game.PositionComponent[GetPlayerID()]; turret = new Turret() { EntityID = eid, position = turretPosition, range = 200, }; _game.TurretComponent.Add(eid, turret); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(11, 49, 37, 63), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, turret.position); break; case 5: eid = Entity.NextEntity(); effectDuration = 7; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); turretPosition = _game.PositionComponent[GetPlayerID()]; turret = new Turret() { EntityID = eid, position = turretPosition, range = 250, }; _game.TurretComponent.Add(eid, turret); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(11, 49, 37, 63), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, turret.position); break; case 6: eid = Entity.NextEntity(); effectDuration = 8; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); turretPosition = _game.PositionComponent[GetPlayerID()]; turret = new Turret() { EntityID = eid, position = turretPosition, range = 300, }; _game.TurretComponent.Add(eid, turret); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(11, 49, 37, 63), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, turret.position); break; case 7: eid = Entity.NextEntity(); effectDuration = 9; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); turretPosition = _game.PositionComponent[GetPlayerID()]; turret = new Turret() { EntityID = eid, position = turretPosition, range = 350, }; _game.TurretComponent.Add(eid, turret); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(11, 49, 37, 63), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, turret.position); break; case 8: eid = Entity.NextEntity(); effectDuration = 10; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); turretPosition = _game.PositionComponent[GetPlayerID()]; turret = new Turret() { EntityID = eid, position = turretPosition, range = 400, }; _game.TurretComponent.Add(eid, turret); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(11, 49, 37, 63), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, turret.position); break; case 9: eid = Entity.NextEntity(); effectDuration = 11; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); turretPosition = _game.PositionComponent[GetPlayerID()]; turret = new Turret() { EntityID = eid, position = turretPosition, range = 450, }; _game.TurretComponent.Add(eid, turret); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(11, 49, 37, 63), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, turret.position); break; case 10: eid = Entity.NextEntity(); effectDuration = 12; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); turretPosition = _game.PositionComponent[GetPlayerID()]; turret = new Turret() { EntityID = eid, position = turretPosition, range = 500, }; _game.TurretComponent.Add(eid, turret); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(11, 49, 37, 63), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, turret.position); break; default: break; #endregion } } break; #endregion #region Trap case SkillType.Trap: { #region Skill Variables TimedEffect timedEffect; float effectDuration; Trap trap; Sprite sprite; Position trapPosition; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); effectDuration = 3; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); trapPosition = _game.PositionComponent[GetPlayerID()]; trap = new Trap() { EntityID = eid, position = trapPosition, isSet = false, range = 20, duration = effectDuration, }; _game.TrapComponent.Add(eid, trap); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(0, 10, 69, 42), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, trap.position); break; case 2: eid = Entity.NextEntity(); effectDuration = 4; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); trapPosition = _game.PositionComponent[GetPlayerID()]; trap = new Trap() { EntityID = eid, position = trapPosition, isSet = false, range = 20, duration = effectDuration, }; _game.TrapComponent.Add(eid, trap); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(0, 10, 69, 42), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, trap.position); break; case 3: eid = Entity.NextEntity(); effectDuration = 4; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); trapPosition = _game.PositionComponent[GetPlayerID()]; trap = new Trap() { EntityID = eid, position = trapPosition, isSet = false, range = 30, duration = effectDuration, }; _game.TrapComponent.Add(eid, trap); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(0, 10, 69, 42), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, trap.position); break; case 4: eid = Entity.NextEntity(); effectDuration = 4; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); trapPosition = _game.PositionComponent[GetPlayerID()]; trap = new Trap() { EntityID = eid, position = trapPosition, isSet = false, range = 30, duration = effectDuration, }; _game.TrapComponent.Add(eid, trap); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(0, 10, 69, 42), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, trap.position); break; case 5: eid = Entity.NextEntity(); effectDuration = 5; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); trapPosition = _game.PositionComponent[GetPlayerID()]; trap = new Trap() { EntityID = eid, position = trapPosition, isSet = false, range = 40, duration = effectDuration, }; _game.TrapComponent.Add(eid, trap); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(0, 10, 69, 42), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, trap.position); break; case 6: eid = Entity.NextEntity(); effectDuration = 5; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); trapPosition = _game.PositionComponent[GetPlayerID()]; trap = new Trap() { EntityID = eid, position = trapPosition, isSet = false, range = 40, duration = effectDuration, }; _game.TrapComponent.Add(eid, trap); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(0, 10, 69, 42), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, trap.position); break; case 7: eid = Entity.NextEntity(); effectDuration = 6; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); trapPosition = _game.PositionComponent[GetPlayerID()]; trap = new Trap() { EntityID = eid, position = trapPosition, isSet = false, range = 50, duration = effectDuration, }; _game.TrapComponent.Add(eid, trap); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(0, 10, 69, 42), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, trap.position); break; case 8: eid = Entity.NextEntity(); effectDuration = 6; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); trapPosition = _game.PositionComponent[GetPlayerID()]; trap = new Trap() { EntityID = eid, position = trapPosition, isSet = false, range = 50, duration = effectDuration, }; _game.TrapComponent.Add(eid, trap); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(0, 10, 69, 42), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, trap.position); break; case 9: eid = Entity.NextEntity(); effectDuration = 6; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); trapPosition = _game.PositionComponent[GetPlayerID()]; trap = new Trap() { EntityID = eid, position = trapPosition, isSet = false, range = 60, duration = effectDuration, }; _game.TrapComponent.Add(eid, trap); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(0, 10, 69, 42), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, trap.position); break; case 10: eid = Entity.NextEntity(); effectDuration = 7; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); trapPosition = _game.PositionComponent[GetPlayerID()]; trap = new Trap() { EntityID = eid, position = trapPosition, isSet = false, range = 60, duration = effectDuration, }; _game.TrapComponent.Add(eid, trap); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(0, 10, 69, 42), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, trap.position); break; default: break; #endregion } } break; #endregion #region Exploding Droids case SkillType.ExplodingDroids: { if (_game.EnemyComponent.All.Count() > 0) { #region Skill Variables TimedEffect timedEffect; float effectDuration; Movement movement; float droidSpeed; ExplodingDroid explodingDroid; Sprite sprite; Position droidPosition; Collideable collideable; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); effectDuration = 6; droidSpeed = 110; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); movement = new Movement() { EntityID = eid, Speed = droidSpeed, }; _game.MovementComponent.Add(eid, movement); droidPosition = _game.PositionComponent[GetPlayerID()]; droidPosition.Radius = 32; explodingDroid = new ExplodingDroid() { EntityID = eid, position = droidPosition, hasEnemy = false, }; _game.ExplodingDroidComponent.Add(eid, explodingDroid); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(51, 45, 71, 82), }; _game.SpriteComponent.Add(eid, sprite); collideable = new Collideable() { EntityID = eid, RoomID = droidPosition.RoomID, Bounds = new CircleBounds(droidPosition.Center, droidPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); _game.PositionComponent.Add(eid, explodingDroid.position); break; case 2: eid = Entity.NextEntity(); effectDuration = 6; droidSpeed = 115; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); movement = new Movement() { EntityID = eid, Speed = droidSpeed, }; _game.MovementComponent.Add(eid, movement); droidPosition = _game.PositionComponent[GetPlayerID()]; droidPosition.Radius = 35; explodingDroid = new ExplodingDroid() { EntityID = eid, position = droidPosition, hasEnemy = false, }; _game.ExplodingDroidComponent.Add(eid, explodingDroid); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(51, 45, 71, 82), }; _game.SpriteComponent.Add(eid, sprite); collideable = new Collideable() { EntityID = eid, RoomID = droidPosition.RoomID, Bounds = new CircleBounds(droidPosition.Center, droidPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); _game.PositionComponent.Add(eid, explodingDroid.position); break; case 3: eid = Entity.NextEntity(); effectDuration = 6; droidSpeed = 120; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); movement = new Movement() { EntityID = eid, Speed = droidSpeed, }; _game.MovementComponent.Add(eid, movement); droidPosition = _game.PositionComponent[GetPlayerID()]; droidPosition.Radius = 40; explodingDroid = new ExplodingDroid() { EntityID = eid, position = droidPosition, hasEnemy = false, }; _game.ExplodingDroidComponent.Add(eid, explodingDroid); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(51, 45, 71, 82), }; _game.SpriteComponent.Add(eid, sprite); collideable = new Collideable() { EntityID = eid, RoomID = droidPosition.RoomID, Bounds = new CircleBounds(droidPosition.Center, droidPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); _game.PositionComponent.Add(eid, explodingDroid.position); break; case 4: eid = Entity.NextEntity(); effectDuration = 6; droidSpeed = 125; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); movement = new Movement() { EntityID = eid, Speed = droidSpeed, }; _game.MovementComponent.Add(eid, movement); droidPosition = _game.PositionComponent[GetPlayerID()]; droidPosition.Radius = 45; explodingDroid = new ExplodingDroid() { EntityID = eid, position = droidPosition, hasEnemy = false, }; _game.ExplodingDroidComponent.Add(eid, explodingDroid); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(51, 45, 71, 82), }; _game.SpriteComponent.Add(eid, sprite); collideable = new Collideable() { EntityID = eid, RoomID = droidPosition.RoomID, Bounds = new CircleBounds(droidPosition.Center, droidPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); _game.PositionComponent.Add(eid, explodingDroid.position); break; case 5: eid = Entity.NextEntity(); effectDuration = 6; droidSpeed = 130; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); movement = new Movement() { EntityID = eid, Speed = droidSpeed, }; _game.MovementComponent.Add(eid, movement); droidPosition = _game.PositionComponent[GetPlayerID()]; droidPosition.Radius = 50; explodingDroid = new ExplodingDroid() { EntityID = eid, position = droidPosition, hasEnemy = false, }; _game.ExplodingDroidComponent.Add(eid, explodingDroid); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(51, 45, 71, 82), }; _game.SpriteComponent.Add(eid, sprite); collideable = new Collideable() { EntityID = eid, RoomID = droidPosition.RoomID, Bounds = new CircleBounds(droidPosition.Center, droidPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); _game.PositionComponent.Add(eid, explodingDroid.position); break; case 6: eid = Entity.NextEntity(); effectDuration = 6; droidSpeed = 135; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); movement = new Movement() { EntityID = eid, Speed = droidSpeed, }; _game.MovementComponent.Add(eid, movement); droidPosition = _game.PositionComponent[GetPlayerID()]; droidPosition.Radius = 55; explodingDroid = new ExplodingDroid() { EntityID = eid, position = droidPosition, hasEnemy = false, }; _game.ExplodingDroidComponent.Add(eid, explodingDroid); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(51, 45, 71, 82), }; _game.SpriteComponent.Add(eid, sprite); collideable = new Collideable() { EntityID = eid, RoomID = droidPosition.RoomID, Bounds = new CircleBounds(droidPosition.Center, droidPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); _game.PositionComponent.Add(eid, explodingDroid.position); break; case 7: eid = Entity.NextEntity(); effectDuration = 6; droidSpeed = 140; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); movement = new Movement() { EntityID = eid, Speed = droidSpeed, }; _game.MovementComponent.Add(eid, movement); droidPosition = _game.PositionComponent[GetPlayerID()]; droidPosition.Radius = 60; explodingDroid = new ExplodingDroid() { EntityID = eid, position = droidPosition, hasEnemy = false, }; _game.ExplodingDroidComponent.Add(eid, explodingDroid); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(51, 45, 71, 82), }; _game.SpriteComponent.Add(eid, sprite); collideable = new Collideable() { EntityID = eid, RoomID = droidPosition.RoomID, Bounds = new CircleBounds(droidPosition.Center, droidPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); _game.PositionComponent.Add(eid, explodingDroid.position); break; case 8: eid = Entity.NextEntity(); effectDuration = 6; droidSpeed = 145; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); movement = new Movement() { EntityID = eid, Speed = droidSpeed, }; _game.MovementComponent.Add(eid, movement); droidPosition = _game.PositionComponent[GetPlayerID()]; droidPosition.Radius = 65; explodingDroid = new ExplodingDroid() { EntityID = eid, position = droidPosition, hasEnemy = false, }; _game.ExplodingDroidComponent.Add(eid, explodingDroid); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(51, 45, 71, 82), }; _game.SpriteComponent.Add(eid, sprite); collideable = new Collideable() { EntityID = eid, RoomID = droidPosition.RoomID, Bounds = new CircleBounds(droidPosition.Center, droidPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); _game.PositionComponent.Add(eid, explodingDroid.position); break; case 9: eid = Entity.NextEntity(); effectDuration = 6; droidSpeed = 150; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); movement = new Movement() { EntityID = eid, Speed = droidSpeed, }; _game.MovementComponent.Add(eid, movement); droidPosition = _game.PositionComponent[GetPlayerID()]; droidPosition.Radius = 70; explodingDroid = new ExplodingDroid() { EntityID = eid, position = droidPosition, hasEnemy = false, }; _game.ExplodingDroidComponent.Add(eid, explodingDroid); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(51, 45, 71, 82), }; _game.SpriteComponent.Add(eid, sprite); collideable = new Collideable() { EntityID = eid, RoomID = droidPosition.RoomID, Bounds = new CircleBounds(droidPosition.Center, droidPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); _game.PositionComponent.Add(eid, explodingDroid.position); break; case 10: eid = Entity.NextEntity(); effectDuration = 6; droidSpeed = 155; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); movement = new Movement() { EntityID = eid, Speed = droidSpeed, }; _game.MovementComponent.Add(eid, movement); droidPosition = _game.PositionComponent[GetPlayerID()]; droidPosition.Radius = 75; explodingDroid = new ExplodingDroid() { EntityID = eid, position = droidPosition, hasEnemy = false, }; _game.ExplodingDroidComponent.Add(eid, explodingDroid); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"), SpriteBounds = new Rectangle(51, 45, 71, 82), }; _game.SpriteComponent.Add(eid, sprite); collideable = new Collideable() { EntityID = eid, RoomID = droidPosition.RoomID, Bounds = new CircleBounds(droidPosition.Center, droidPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); _game.PositionComponent.Add(eid, explodingDroid.position); break; default: break; #endregion } } } break; #endregion #region Healing Station case SkillType.HealingStation: { #region Skill Variables HealingStation healingStation; Sprite sprite; Position stationPosition; Collideable collideable; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); stationPosition = _game.PositionComponent[GetPlayerID()]; healingStation = new HealingStation() { EntityID = eid, position = stationPosition, healthAvailable = 10, }; _game.HealingStationComponent.Add(eid, healingStation); collideable = new Collideable() { EntityID = eid, RoomID = stationPosition.RoomID, Bounds = new CircleBounds(stationPosition.Center, stationPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Turret"), SpriteBounds = new Rectangle(0, 0, 37, 28), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, stationPosition); break; case 2: eid = Entity.NextEntity(); stationPosition = _game.PositionComponent[GetPlayerID()]; healingStation = new HealingStation() { EntityID = eid, position = stationPosition, healthAvailable = 15, }; _game.HealingStationComponent.Add(eid, healingStation); collideable = new Collideable() { EntityID = eid, RoomID = stationPosition.RoomID, Bounds = new CircleBounds(stationPosition.Center, stationPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Turret"), SpriteBounds = new Rectangle(0, 0, 37, 28), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, stationPosition); break; case 3: eid = Entity.NextEntity(); stationPosition = _game.PositionComponent[GetPlayerID()]; healingStation = new HealingStation() { EntityID = eid, position = stationPosition, healthAvailable = 20, }; _game.HealingStationComponent.Add(eid, healingStation); collideable = new Collideable() { EntityID = eid, RoomID = stationPosition.RoomID, Bounds = new CircleBounds(stationPosition.Center, stationPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Turret"), SpriteBounds = new Rectangle(0, 0, 37, 28), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, stationPosition); break; case 4: eid = Entity.NextEntity(); stationPosition = _game.PositionComponent[GetPlayerID()]; healingStation = new HealingStation() { EntityID = eid, position = stationPosition, healthAvailable = 25, }; _game.HealingStationComponent.Add(eid, healingStation); collideable = new Collideable() { EntityID = eid, RoomID = stationPosition.RoomID, Bounds = new CircleBounds(stationPosition.Center, stationPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Turret"), SpriteBounds = new Rectangle(0, 0, 37, 28), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, stationPosition); break; case 5: eid = Entity.NextEntity(); stationPosition = _game.PositionComponent[GetPlayerID()]; healingStation = new HealingStation() { EntityID = eid, position = stationPosition, healthAvailable = 30, }; _game.HealingStationComponent.Add(eid, healingStation); collideable = new Collideable() { EntityID = eid, RoomID = stationPosition.RoomID, Bounds = new CircleBounds(stationPosition.Center, stationPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Turret"), SpriteBounds = new Rectangle(0, 0, 37, 28), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, stationPosition); break; case 6: eid = Entity.NextEntity(); stationPosition = _game.PositionComponent[GetPlayerID()]; healingStation = new HealingStation() { EntityID = eid, position = stationPosition, healthAvailable = 35, }; _game.HealingStationComponent.Add(eid, healingStation); collideable = new Collideable() { EntityID = eid, RoomID = stationPosition.RoomID, Bounds = new CircleBounds(stationPosition.Center, stationPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Turret"), SpriteBounds = new Rectangle(0, 0, 37, 28), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, stationPosition); break; case 7: eid = Entity.NextEntity(); stationPosition = _game.PositionComponent[GetPlayerID()]; healingStation = new HealingStation() { EntityID = eid, position = stationPosition, healthAvailable = 40, }; _game.HealingStationComponent.Add(eid, healingStation); collideable = new Collideable() { EntityID = eid, RoomID = stationPosition.RoomID, Bounds = new CircleBounds(stationPosition.Center, stationPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Turret"), SpriteBounds = new Rectangle(0, 0, 37, 28), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, stationPosition); break; case 8: eid = Entity.NextEntity(); stationPosition = _game.PositionComponent[GetPlayerID()]; healingStation = new HealingStation() { EntityID = eid, position = stationPosition, healthAvailable = 45, }; _game.HealingStationComponent.Add(eid, healingStation); collideable = new Collideable() { EntityID = eid, RoomID = stationPosition.RoomID, Bounds = new CircleBounds(stationPosition.Center, stationPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Turret"), SpriteBounds = new Rectangle(0, 0, 37, 28), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, stationPosition); break; case 9: eid = Entity.NextEntity(); stationPosition = _game.PositionComponent[GetPlayerID()]; healingStation = new HealingStation() { EntityID = eid, position = stationPosition, healthAvailable = 50, }; _game.HealingStationComponent.Add(eid, healingStation); collideable = new Collideable() { EntityID = eid, RoomID = stationPosition.RoomID, Bounds = new CircleBounds(stationPosition.Center, stationPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Turret"), SpriteBounds = new Rectangle(0, 0, 37, 28), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, stationPosition); break; case 10: eid = Entity.NextEntity(); stationPosition = _game.PositionComponent[GetPlayerID()]; healingStation = new HealingStation() { EntityID = eid, position = stationPosition, healthAvailable = 60, }; _game.HealingStationComponent.Add(eid, healingStation); collideable = new Collideable() { EntityID = eid, RoomID = stationPosition.RoomID, Bounds = new CircleBounds(stationPosition.Center, stationPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Turret"), SpriteBounds = new Rectangle(0, 0, 37, 28), }; _game.SpriteComponent.Add(eid, sprite); _game.PositionComponent.Add(eid, stationPosition); break; default: break; #endregion } } break; #endregion #region Portable Shop case SkillType.PortableShop: { #region Skill Variables TimedEffect timedEffect; float effectDuration; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); effectDuration = 5; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); _game.SkillEntityFactory.CreateSkillDeployable(SkillType.PortableShop, _game.PositionComponent[GetPlayerID()], 1); break; case 2: eid = Entity.NextEntity(); effectDuration = 5; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); _game.SkillEntityFactory.CreateSkillDeployable(SkillType.PortableShop, _game.PositionComponent[GetPlayerID()], 2); break; case 3: eid = Entity.NextEntity(); effectDuration = 7; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); _game.SkillEntityFactory.CreateSkillDeployable(SkillType.PortableShop, _game.PositionComponent[GetPlayerID()], 2); break; case 4: eid = Entity.NextEntity(); effectDuration = 9; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); _game.SkillEntityFactory.CreateSkillDeployable(SkillType.PortableShop, _game.PositionComponent[GetPlayerID()], 2); break; case 5: eid = Entity.NextEntity(); effectDuration = 9; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); _game.SkillEntityFactory.CreateSkillDeployable(SkillType.PortableShop, _game.PositionComponent[GetPlayerID()], 2); break; case 6: eid = Entity.NextEntity(); effectDuration = 11; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); _game.SkillEntityFactory.CreateSkillDeployable(SkillType.PortableShop, _game.PositionComponent[GetPlayerID()], 2); break; case 7: eid = Entity.NextEntity(); effectDuration = 13; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); _game.SkillEntityFactory.CreateSkillDeployable(SkillType.PortableShop, _game.PositionComponent[GetPlayerID()], 2); break; case 8: eid = Entity.NextEntity(); effectDuration = 15; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); _game.SkillEntityFactory.CreateSkillDeployable(SkillType.PortableShop, _game.PositionComponent[GetPlayerID()], 2); break; case 9: eid = Entity.NextEntity(); effectDuration = 17; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); _game.SkillEntityFactory.CreateSkillDeployable(SkillType.PortableShop, _game.PositionComponent[GetPlayerID()], 2); break; case 10: eid = Entity.NextEntity(); effectDuration = 20; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); _game.SkillEntityFactory.CreateSkillDeployable(SkillType.PortableShop, _game.PositionComponent[GetPlayerID()], 2); break; default: break; #endregion } } break; #endregion #region Portable Shield case SkillType.PortableShield: { #region Skill Variables TimedEffect timedEffect; float effectDuration; PortableShield portableShield; Position shieldPosition; Sprite sprite; Collideable collideable; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); effectDuration = 5; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); shieldPosition = _game.PositionComponent[GetPlayerID()]; shieldPosition.Radius = 100; portableShield = new PortableShield() { EntityID = eid, position = shieldPosition, }; _game.PortableShieldComponent.Add(eid, portableShield); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/BubbleShield"), SpriteBounds = new Rectangle(18, 34, 229, 136), }; _game.SpriteComponent.Add(eid, sprite); collideable = new Collideable() { EntityID = eid, RoomID = shieldPosition.RoomID, Bounds = new CircleBounds(shieldPosition.Center, shieldPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); _game.PositionComponent.Add(eid, shieldPosition); break; case 2: eid = Entity.NextEntity(); effectDuration = 6; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); shieldPosition = _game.PositionComponent[GetPlayerID()]; shieldPosition.Radius = 100; portableShield = new PortableShield() { EntityID = eid, position = shieldPosition, }; _game.PortableShieldComponent.Add(eid, portableShield); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/BubbleShield"), SpriteBounds = new Rectangle(18, 34, 229, 136), }; _game.SpriteComponent.Add(eid, sprite); collideable = new Collideable() { EntityID = eid, RoomID = shieldPosition.RoomID, Bounds = new CircleBounds(shieldPosition.Center, shieldPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); _game.PositionComponent.Add(eid, shieldPosition); break; case 3: eid = Entity.NextEntity(); effectDuration = 7; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); shieldPosition = _game.PositionComponent[GetPlayerID()]; shieldPosition.Radius = 100; portableShield = new PortableShield() { EntityID = eid, position = shieldPosition, }; _game.PortableShieldComponent.Add(eid, portableShield); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/BubbleShield"), SpriteBounds = new Rectangle(18, 34, 229, 136), }; _game.SpriteComponent.Add(eid, sprite); collideable = new Collideable() { EntityID = eid, RoomID = shieldPosition.RoomID, Bounds = new CircleBounds(shieldPosition.Center, shieldPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); _game.PositionComponent.Add(eid, shieldPosition); break; case 4: eid = Entity.NextEntity(); effectDuration = 8; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); shieldPosition = _game.PositionComponent[GetPlayerID()]; shieldPosition.Radius = 100; portableShield = new PortableShield() { EntityID = eid, position = shieldPosition, }; _game.PortableShieldComponent.Add(eid, portableShield); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/BubbleShield"), SpriteBounds = new Rectangle(18, 34, 229, 136), }; _game.SpriteComponent.Add(eid, sprite); collideable = new Collideable() { EntityID = eid, RoomID = shieldPosition.RoomID, Bounds = new CircleBounds(shieldPosition.Center, shieldPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); _game.PositionComponent.Add(eid, shieldPosition); break; case 5: eid = Entity.NextEntity(); effectDuration = 9; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); shieldPosition = _game.PositionComponent[GetPlayerID()]; shieldPosition.Radius = 100; portableShield = new PortableShield() { EntityID = eid, position = shieldPosition, }; _game.PortableShieldComponent.Add(eid, portableShield); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/BubbleShield"), SpriteBounds = new Rectangle(18, 34, 229, 136), }; _game.SpriteComponent.Add(eid, sprite); collideable = new Collideable() { EntityID = eid, RoomID = shieldPosition.RoomID, Bounds = new CircleBounds(shieldPosition.Center, shieldPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); _game.PositionComponent.Add(eid, shieldPosition); break; case 6: eid = Entity.NextEntity(); effectDuration = 10; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); shieldPosition = _game.PositionComponent[GetPlayerID()]; shieldPosition.Radius = 100; portableShield = new PortableShield() { EntityID = eid, position = shieldPosition, }; _game.PortableShieldComponent.Add(eid, portableShield); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/BubbleShield"), SpriteBounds = new Rectangle(18, 34, 229, 136), }; _game.SpriteComponent.Add(eid, sprite); collideable = new Collideable() { EntityID = eid, RoomID = shieldPosition.RoomID, Bounds = new CircleBounds(shieldPosition.Center, shieldPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); _game.PositionComponent.Add(eid, shieldPosition); break; case 7: eid = Entity.NextEntity(); effectDuration = 11; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); shieldPosition = _game.PositionComponent[GetPlayerID()]; shieldPosition.Radius = 100; portableShield = new PortableShield() { EntityID = eid, position = shieldPosition, }; _game.PortableShieldComponent.Add(eid, portableShield); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/BubbleShield"), SpriteBounds = new Rectangle(18, 34, 229, 136), }; _game.SpriteComponent.Add(eid, sprite); collideable = new Collideable() { EntityID = eid, RoomID = shieldPosition.RoomID, Bounds = new CircleBounds(shieldPosition.Center, shieldPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); _game.PositionComponent.Add(eid, shieldPosition); break; case 8: eid = Entity.NextEntity(); effectDuration = 12; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); shieldPosition = _game.PositionComponent[GetPlayerID()]; shieldPosition.Radius = 100; portableShield = new PortableShield() { EntityID = eid, position = shieldPosition, }; _game.PortableShieldComponent.Add(eid, portableShield); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/BubbleShield"), SpriteBounds = new Rectangle(18, 34, 229, 136), }; _game.SpriteComponent.Add(eid, sprite); collideable = new Collideable() { EntityID = eid, RoomID = shieldPosition.RoomID, Bounds = new CircleBounds(shieldPosition.Center, shieldPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); _game.PositionComponent.Add(eid, shieldPosition); break; case 9: eid = Entity.NextEntity(); effectDuration = 13; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); shieldPosition = _game.PositionComponent[GetPlayerID()]; shieldPosition.Radius = 100; portableShield = new PortableShield() { EntityID = eid, position = shieldPosition, }; _game.PortableShieldComponent.Add(eid, portableShield); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/BubbleShield"), SpriteBounds = new Rectangle(18, 34, 229, 136), }; _game.SpriteComponent.Add(eid, sprite); collideable = new Collideable() { EntityID = eid, RoomID = shieldPosition.RoomID, Bounds = new CircleBounds(shieldPosition.Center, shieldPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); _game.PositionComponent.Add(eid, shieldPosition); break; case 10: eid = Entity.NextEntity(); effectDuration = 14; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); shieldPosition = _game.PositionComponent[GetPlayerID()]; shieldPosition.Radius = 100; portableShield = new PortableShield() { EntityID = eid, position = shieldPosition, }; _game.PortableShieldComponent.Add(eid, portableShield); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/BubbleShield"), SpriteBounds = new Rectangle(18, 34, 229, 136), }; _game.SpriteComponent.Add(eid, sprite); collideable = new Collideable() { EntityID = eid, RoomID = shieldPosition.RoomID, Bounds = new CircleBounds(shieldPosition.Center, shieldPosition.Radius), }; _game.CollisionComponent.Add(eid, collideable); _game.PositionComponent.Add(eid, shieldPosition); break; default: break; #endregion } } break; #endregion #region Motivate case SkillType.Motivate: { #region Skill Variables TimedEffect timedEffect; float effectDuration; Buff buffEffect; Sprite sprite; Position motivatePosition; #endregion switch (rank) { #region Checking Rank #region Rank 1 case 1: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/bubble"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); motivatePosition = _game.PositionComponent[GetPlayerID()]; motivatePosition.Center.X += 40; motivatePosition.Center.Y -= 30; _game.PositionComponent.Add(eid, motivatePosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, Health = 5, }; _game.BuffComponent.Add(eid, buffEffect); } break; #endregion #region Rank 2 case 2: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/bubble"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); motivatePosition = _game.PositionComponent[GetPlayerID()]; motivatePosition.Center.X += 40; motivatePosition.Center.Y -= 30; _game.PositionComponent.Add(eid, motivatePosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, Health = 10, }; _game.BuffComponent.Add(eid, buffEffect); } break; #endregion #region Rank 3 case 3: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/bubble"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); motivatePosition = _game.PositionComponent[GetPlayerID()]; motivatePosition.Center.X += 40; motivatePosition.Center.Y -= 30; _game.PositionComponent.Add(eid, motivatePosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, Health = 15, }; _game.BuffComponent.Add(eid, buffEffect); } break; #endregion #region Rank 4 case 4: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/bubble"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); motivatePosition = _game.PositionComponent[GetPlayerID()]; motivatePosition.Center.X += 40; motivatePosition.Center.Y -= 30; _game.PositionComponent.Add(eid, motivatePosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, Health = 20, }; _game.BuffComponent.Add(eid, buffEffect); } break; #endregion #region Rank 5 case 5: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/bubble"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); motivatePosition = _game.PositionComponent[GetPlayerID()]; motivatePosition.Center.X += 40; motivatePosition.Center.Y -= 30; _game.PositionComponent.Add(eid, motivatePosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, Health = 25, }; _game.BuffComponent.Add(eid, buffEffect); } break; #endregion #region Rank 6 case 6: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/bubble"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); motivatePosition = _game.PositionComponent[GetPlayerID()]; motivatePosition.Center.X += 40; motivatePosition.Center.Y -= 30; _game.PositionComponent.Add(eid, motivatePosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, Health = 30, }; _game.BuffComponent.Add(eid, buffEffect); } break; #endregion #region Rank 7 case 7: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/bubble"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); motivatePosition = _game.PositionComponent[GetPlayerID()]; motivatePosition.Center.X += 40; motivatePosition.Center.Y -= 30; _game.PositionComponent.Add(eid, motivatePosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, Health = 35, }; _game.BuffComponent.Add(eid, buffEffect); } break; #endregion #region Rank 8 case 8: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/bubble"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); motivatePosition = _game.PositionComponent[GetPlayerID()]; motivatePosition.Center.X += 40; motivatePosition.Center.Y -= 30; _game.PositionComponent.Add(eid, motivatePosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, Health = 40, }; _game.BuffComponent.Add(eid, buffEffect); } break; #endregion #region Rank 9 case 9: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/bubble"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); motivatePosition = _game.PositionComponent[GetPlayerID()]; motivatePosition.Center.X += 40; motivatePosition.Center.Y -= 30; _game.PositionComponent.Add(eid, motivatePosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, Health = 45, }; _game.BuffComponent.Add(eid, buffEffect); } break; #endregion #region Rank 10 case 10: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/bubble"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); motivatePosition = _game.PositionComponent[GetPlayerID()]; motivatePosition.Center.X += 40; motivatePosition.Center.Y -= 30; _game.PositionComponent.Add(eid, motivatePosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, Health = 50, }; _game.BuffComponent.Add(eid, buffEffect); } break; #endregion default: break; #endregion } } break; #endregion #region Fall Back case SkillType.FallBack: { #region Skill Variables TimedEffect timedEffect; float effectDuration; Buff buffEffect; Sprite sprite; Position fallBackPosition; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/fallback"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); fallBackPosition = _game.PositionComponent[GetPlayerID()]; fallBackPosition.Center.X += 40; fallBackPosition.Center.Y -= 30; _game.PositionComponent.Add(eid, fallBackPosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, DefenseMelee = 1, AttackMelee = -1, }; _game.BuffComponent.Add(eid, buffEffect); } break; case 2: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/fallback"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); fallBackPosition = _game.PositionComponent[GetPlayerID()]; fallBackPosition.Center.X += 40; fallBackPosition.Center.Y -= 30; _game.PositionComponent.Add(eid, fallBackPosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, DefenseMelee = 2, AttackMelee = -1, }; _game.BuffComponent.Add(eid, buffEffect); } break; case 3: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/fallback"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); fallBackPosition = _game.PositionComponent[GetPlayerID()]; fallBackPosition.Center.X += 40; fallBackPosition.Center.Y -= 30; _game.PositionComponent.Add(eid, fallBackPosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, DefenseMelee = 3, AttackMelee = -2, }; _game.BuffComponent.Add(eid, buffEffect); } break; case 4: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/fallback"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); fallBackPosition = _game.PositionComponent[GetPlayerID()]; fallBackPosition.Center.X += 40; fallBackPosition.Center.Y -= 30; _game.PositionComponent.Add(eid, fallBackPosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, DefenseMelee = 4, AttackMelee = -2, }; _game.BuffComponent.Add(eid, buffEffect); } break; case 5: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/fallback"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); fallBackPosition = _game.PositionComponent[GetPlayerID()]; fallBackPosition.Center.X += 40; fallBackPosition.Center.Y -= 30; _game.PositionComponent.Add(eid, fallBackPosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, DefenseMelee = 5, AttackMelee = -3, }; _game.BuffComponent.Add(eid, buffEffect); } break; case 6: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/fallback"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); fallBackPosition = _game.PositionComponent[GetPlayerID()]; fallBackPosition.Center.X += 40; fallBackPosition.Center.Y -= 30; _game.PositionComponent.Add(eid, fallBackPosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, DefenseMelee = 6, AttackMelee = -3, }; _game.BuffComponent.Add(eid, buffEffect); } break; case 7: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/fallback"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); fallBackPosition = _game.PositionComponent[GetPlayerID()]; fallBackPosition.Center.X += 40; fallBackPosition.Center.Y -= 30; _game.PositionComponent.Add(eid, fallBackPosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, DefenseMelee = 7, AttackMelee = -4, }; _game.BuffComponent.Add(eid, buffEffect); } break; case 8: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/fallback"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); fallBackPosition = _game.PositionComponent[GetPlayerID()]; fallBackPosition.Center.X += 40; fallBackPosition.Center.Y -= 30; _game.PositionComponent.Add(eid, fallBackPosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, DefenseMelee = 8, AttackMelee = -4, }; _game.BuffComponent.Add(eid, buffEffect); } break; case 9: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/fallback"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); fallBackPosition = _game.PositionComponent[GetPlayerID()]; fallBackPosition.Center.X += 40; fallBackPosition.Center.Y -= 30; _game.PositionComponent.Add(eid, fallBackPosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, DefenseMelee = 9, AttackMelee = -5, }; _game.BuffComponent.Add(eid, buffEffect); } break; case 10: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/fallback"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); fallBackPosition = _game.PositionComponent[GetPlayerID()]; fallBackPosition.Center.X += 40; fallBackPosition.Center.Y -= 30; _game.PositionComponent.Add(eid, fallBackPosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, DefenseMelee = 10, AttackMelee = -5, }; _game.BuffComponent.Add(eid, buffEffect); } break; default: break; #endregion } } break; #endregion #region Charge case SkillType.Charge: { #region Skill Variables TimedEffect timedEffect; float effectDuration; Buff buffEffect; Sprite sprite; Position chargePosition; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/charge"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); chargePosition = _game.PositionComponent[GetPlayerID()]; chargePosition.Center.X += 40; chargePosition.Center.Y -= 30; _game.PositionComponent.Add(eid, chargePosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, DefenseMelee = -1, AttackMelee = 1, }; _game.BuffComponent.Add(eid, buffEffect); } break; case 2: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/charge"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); chargePosition = _game.PositionComponent[GetPlayerID()]; chargePosition.Center.X += 40; chargePosition.Center.Y -= 30; _game.PositionComponent.Add(eid, chargePosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, DefenseMelee = -1, AttackMelee = 2, }; _game.BuffComponent.Add(eid, buffEffect); } break; case 3: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/charge"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); chargePosition = _game.PositionComponent[GetPlayerID()]; chargePosition.Center.X += 40; chargePosition.Center.Y -= 30; _game.PositionComponent.Add(eid, chargePosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, DefenseMelee = -2, AttackMelee = 3, }; _game.BuffComponent.Add(eid, buffEffect); } break; case 4: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/charge"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); chargePosition = _game.PositionComponent[GetPlayerID()]; chargePosition.Center.X += 40; chargePosition.Center.Y -= 30; _game.PositionComponent.Add(eid, chargePosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, DefenseMelee = -2, AttackMelee = 4, }; _game.BuffComponent.Add(eid, buffEffect); } break; case 5: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/charge"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); chargePosition = _game.PositionComponent[GetPlayerID()]; chargePosition.Center.X += 40; chargePosition.Center.Y -= 30; _game.PositionComponent.Add(eid, chargePosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, DefenseMelee = -3, AttackMelee = 5, }; _game.BuffComponent.Add(eid, buffEffect); } break; case 6: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/charge"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); chargePosition = _game.PositionComponent[GetPlayerID()]; chargePosition.Center.X += 40; chargePosition.Center.Y -= 30; _game.PositionComponent.Add(eid, chargePosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, DefenseMelee = -3, AttackMelee = 6, }; _game.BuffComponent.Add(eid, buffEffect); } break; case 7: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/charge"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); chargePosition = _game.PositionComponent[GetPlayerID()]; chargePosition.Center.X += 40; chargePosition.Center.Y -= 30; _game.PositionComponent.Add(eid, chargePosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, DefenseMelee = -4, AttackMelee = 7, }; _game.BuffComponent.Add(eid, buffEffect); } break; case 8: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/charge"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); chargePosition = _game.PositionComponent[GetPlayerID()]; chargePosition.Center.X += 40; chargePosition.Center.Y -= 30; _game.PositionComponent.Add(eid, chargePosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, DefenseMelee = -4, AttackMelee = 8, }; _game.BuffComponent.Add(eid, buffEffect); } break; case 9: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/charge"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); chargePosition = _game.PositionComponent[GetPlayerID()]; chargePosition.Center.X += 40; chargePosition.Center.Y -= 30; _game.PositionComponent.Add(eid, chargePosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, DefenseMelee = -5, AttackMelee = 9, }; _game.BuffComponent.Add(eid, buffEffect); } break; case 10: eid = Entity.NextEntity(); effectDuration = 0.5f; timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = effectDuration, TimeLeft = effectDuration }; _game.TimedEffectComponent.Add(eid, timedEffect); sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/charge"), SpriteBounds = new Rectangle(0, 0, 76, 48), }; _game.SpriteComponent.Add(eid, sprite); chargePosition = _game.PositionComponent[GetPlayerID()]; chargePosition.Center.X += 40; chargePosition.Center.Y -= 30; _game.PositionComponent.Add(eid, chargePosition); foreach (Player player in _game.PlayerComponent.All) { eid = Entity.NextEntity(); buffEffect = new Buff() { EntityID = eid, TargetID = player.EntityID, DefenseMelee = -5, AttackMelee = 10, }; _game.BuffComponent.Add(eid, buffEffect); } break; default: break; #endregion } } break; #endregion default: break; #endregion } break; #endregion #region Space Pirate //This was the part contributed by Austin Murphy case Aggregate.SpacePiratePlayer: #region Race Variables #endregion switch (skillType) { #region Checking Skill Type #region AgilityBerserker case SkillType.AgilityBerserker: #region Skill Variables TimedEffect te1, te2; int speedIncrease = 1000; int attackDecrease = -50; float duration, cd; uint targetID; Buff buffeffect; int afterS = -500; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); duration = 10; cd = 55; targetID = GetPlayerID(); te1 = new TimedEffect() { EntityID = eid, TotalDuration = duration, TimeLeft = duration }; _game.TimedEffectComponent.Add(eid, te1); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, MovementSpeed = speedIncrease, AttackMelee = attackDecrease }; _game.BuffComponent.Add(eid, buffeffect); break; case 2: eid = Entity.NextEntity(); duration = 15; cd = 50; targetID = GetPlayerID(); te1 = new TimedEffect() { EntityID = eid, TotalDuration = duration, TimeLeft = duration }; _game.TimedEffectComponent.Add(eid, te1); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, MovementSpeed = speedIncrease }; _game.BuffComponent.Add(eid, buffeffect); break; case 3: eid = Entity.NextEntity(); duration = 20; cd = 45; targetID = GetPlayerID(); te1 = new TimedEffect() { EntityID = eid, TotalDuration = duration, TimeLeft = duration }; _game.TimedEffectComponent.Add(eid, te1); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, MovementSpeed = speedIncrease }; _game.BuffComponent.Add(eid, buffeffect); break; case 4: eid = Entity.NextEntity(); duration = 25; cd = 40; targetID = GetPlayerID(); te1 = new TimedEffect() { EntityID = eid, TotalDuration = duration, TimeLeft = duration }; _game.TimedEffectComponent.Add(eid, te1); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, MovementSpeed = speedIncrease }; _game.BuffComponent.Add(eid, buffeffect); break; case 5: eid = Entity.NextEntity(); duration = 30; cd = 35; targetID = GetPlayerID(); te1 = new TimedEffect() { EntityID = eid, TotalDuration = duration, TimeLeft = duration }; _game.TimedEffectComponent.Add(eid, te1); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, MovementSpeed = speedIncrease }; _game.BuffComponent.Add(eid, buffeffect); break; case 6: eid = Entity.NextEntity(); duration = 35; cd = 30; targetID = GetPlayerID(); te1 = new TimedEffect() { EntityID = eid, TotalDuration = duration, TimeLeft = duration }; _game.TimedEffectComponent.Add(eid, te1); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, MovementSpeed = speedIncrease }; _game.BuffComponent.Add(eid, buffeffect); break; case 7: eid = Entity.NextEntity(); duration = 40; cd = 25; targetID = GetPlayerID(); te1 = new TimedEffect() { EntityID = eid, TotalDuration = duration, TimeLeft = duration }; _game.TimedEffectComponent.Add(eid, te1); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, MovementSpeed = speedIncrease }; _game.BuffComponent.Add(eid, buffeffect); break; case 8: eid = Entity.NextEntity(); duration = 45; cd = 20; targetID = GetPlayerID(); te1 = new TimedEffect() { EntityID = eid, TotalDuration = duration, TimeLeft = duration }; _game.TimedEffectComponent.Add(eid, te1); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, MovementSpeed = speedIncrease }; _game.BuffComponent.Add(eid, buffeffect); break; case 9: eid = Entity.NextEntity(); duration = 50; cd = 15; targetID = GetPlayerID(); te1 = new TimedEffect() { EntityID = eid, TotalDuration = duration, TimeLeft = duration }; _game.TimedEffectComponent.Add(eid, te1); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, MovementSpeed = speedIncrease }; _game.BuffComponent.Add(eid, buffeffect); break; case 10: eid = Entity.NextEntity(); duration = 55; cd = 5; targetID = GetPlayerID(); te1 = new TimedEffect() { EntityID = eid, TotalDuration = duration, TimeLeft = duration }; _game.TimedEffectComponent.Add(eid, te1); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, MovementSpeed = speedIncrease }; _game.BuffComponent.Add(eid, buffeffect); break; default: break; #endregion } break; #endregion #region DualWielding case SkillType.DualWielding: #region Skill Variables int offhand; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); offhand = -80; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackRanged = offhand, AttackMelee = offhand }; _game.BuffComponent.Add(eid, buffeffect); break; case 2: eid = Entity.NextEntity(); offhand = -74; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackRanged = offhand, AttackMelee = offhand }; _game.BuffComponent.Add(eid, buffeffect); break; case 3: eid = Entity.NextEntity(); offhand = -68; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackRanged = offhand, AttackMelee = offhand }; _game.BuffComponent.Add(eid, buffeffect); break; case 4: eid = Entity.NextEntity(); offhand = -62; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackRanged = offhand, AttackMelee = offhand }; _game.BuffComponent.Add(eid, buffeffect); break; case 5: eid = Entity.NextEntity(); offhand = -56; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackRanged = offhand, AttackMelee = offhand }; _game.BuffComponent.Add(eid, buffeffect); break; case 6: eid = Entity.NextEntity(); offhand = -50; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackRanged = offhand, AttackMelee = offhand }; _game.BuffComponent.Add(eid, buffeffect); break; case 7: eid = Entity.NextEntity(); offhand = -44; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackRanged = offhand, AttackMelee = offhand }; _game.BuffComponent.Add(eid, buffeffect); break; case 8: eid = Entity.NextEntity(); offhand = -38; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackRanged = offhand, AttackMelee = offhand }; _game.BuffComponent.Add(eid, buffeffect); break; case 9: eid = Entity.NextEntity(); offhand = -32; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackRanged = offhand, AttackMelee = offhand }; _game.BuffComponent.Add(eid, buffeffect); break; case 10: eid = Entity.NextEntity(); offhand = -20; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackRanged = offhand, AttackMelee = offhand }; _game.BuffComponent.Add(eid, buffeffect); break; default: break; #endregion } break; #endregion #region HeavyDrinker case SkillType.HeavyDrinker: #region Skill Variables int resistance; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); resistance = 5; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, ResistPoison = resistance }; break; case 2: eid = Entity.NextEntity(); resistance = 10; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, ResistPoison = resistance }; break; case 3: eid = Entity.NextEntity(); resistance = 20; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, ResistPoison = resistance }; break; case 4: eid = Entity.NextEntity(); resistance = 30; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, ResistPoison = resistance }; break; case 5: eid = Entity.NextEntity(); resistance = 40; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, ResistPoison = resistance }; break; case 6: eid = Entity.NextEntity(); resistance = 50; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, ResistPoison = resistance }; break; case 7: eid = Entity.NextEntity(); resistance = 60; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, ResistPoison = resistance }; break; case 8: eid = Entity.NextEntity(); resistance = 70; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, ResistPoison = resistance }; break; case 9: eid = Entity.NextEntity(); resistance = 80; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, ResistPoison = resistance }; break; case 10: eid = Entity.NextEntity(); resistance = 90; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, ResistPoison = resistance }; break; default: break; #endregion } break; #endregion #region TrickShot //Trick shot has been modified greatly to fit into our prototype game. case SkillType.TrickShot: #region Skill Variables int TSDamage; DirectDamage dd; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); TSDamage = 20; dd = new DirectDamage() { EntityID = eid, Damage = TSDamage }; _game.DirectDamageComponent.Add(eid, dd); break; case 2: eid = Entity.NextEntity(); TSDamage = 40; dd = new DirectDamage() { EntityID = eid, Damage = TSDamage }; _game.DirectDamageComponent.Add(eid, dd); break; case 3: eid = Entity.NextEntity(); TSDamage = 60; dd = new DirectDamage() { EntityID = eid, Damage = TSDamage }; _game.DirectDamageComponent.Add(eid, dd); break; case 4: eid = Entity.NextEntity(); TSDamage = 80; dd = new DirectDamage() { EntityID = eid, Damage = TSDamage }; _game.DirectDamageComponent.Add(eid, dd); break; case 5: eid = Entity.NextEntity(); TSDamage = 100; dd = new DirectDamage() { EntityID = eid, Damage = TSDamage }; _game.DirectDamageComponent.Add(eid, dd); break; case 6: eid = Entity.NextEntity(); TSDamage = 120; dd = new DirectDamage() { EntityID = eid, Damage = TSDamage }; _game.DirectDamageComponent.Add(eid, dd); break; case 7: eid = Entity.NextEntity(); TSDamage = 140; dd = new DirectDamage() { EntityID = eid, Damage = TSDamage }; _game.DirectDamageComponent.Add(eid, dd); break; case 8: eid = Entity.NextEntity(); TSDamage = 160; dd = new DirectDamage() { EntityID = eid, Damage = TSDamage }; _game.DirectDamageComponent.Add(eid, dd); break; case 9: eid = Entity.NextEntity(); TSDamage = 180; dd = new DirectDamage() { EntityID = eid, Damage = TSDamage }; _game.DirectDamageComponent.Add(eid, dd); break; case 10: eid = Entity.NextEntity(); TSDamage = 200; dd = new DirectDamage() { EntityID = eid, Damage = TSDamage }; _game.DirectDamageComponent.Add(eid, dd); break; default: break; #endregion } break; #endregion #region PowerShot case SkillType.PowerShot: #region Skill Variables int PSDamageIncrease; InstantEffect ie; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); PSDamageIncrease = 10; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackRanged = PSDamageIncrease }; _game.BuffComponent.Add(eid, buffeffect); ie = new InstantEffect() { EntityID = eid }; _game.InstantEffectComponent.Add(eid, ie); break; case 2: eid = Entity.NextEntity(); PSDamageIncrease = 20; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackRanged = PSDamageIncrease }; _game.BuffComponent.Add(eid, buffeffect); ie = new InstantEffect() { EntityID = eid }; _game.InstantEffectComponent.Add(eid, ie); break; case 3: eid = Entity.NextEntity(); PSDamageIncrease = 30; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackRanged = PSDamageIncrease }; _game.BuffComponent.Add(eid, buffeffect); ie = new InstantEffect() { EntityID = eid }; _game.InstantEffectComponent.Add(eid, ie); break; case 4: eid = Entity.NextEntity(); PSDamageIncrease = 40; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackRanged = PSDamageIncrease }; _game.BuffComponent.Add(eid, buffeffect); ie = new InstantEffect() { EntityID = eid }; _game.InstantEffectComponent.Add(eid, ie); break; case 5: eid = Entity.NextEntity(); PSDamageIncrease = 50; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackRanged = PSDamageIncrease }; _game.BuffComponent.Add(eid, buffeffect); ie = new InstantEffect() { EntityID = eid }; _game.InstantEffectComponent.Add(eid, ie); break; case 6: eid = Entity.NextEntity(); PSDamageIncrease = 60; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackRanged = PSDamageIncrease }; _game.BuffComponent.Add(eid, buffeffect); ie = new InstantEffect() { EntityID = eid }; _game.InstantEffectComponent.Add(eid, ie); break; case 7: eid = Entity.NextEntity(); PSDamageIncrease = 70; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackRanged = PSDamageIncrease }; _game.BuffComponent.Add(eid, buffeffect); ie = new InstantEffect() { EntityID = eid }; _game.InstantEffectComponent.Add(eid, ie); break; case 8: eid = Entity.NextEntity(); PSDamageIncrease = 80; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackRanged = PSDamageIncrease }; _game.BuffComponent.Add(eid, buffeffect); ie = new InstantEffect() { EntityID = eid }; _game.InstantEffectComponent.Add(eid, ie); break; case 9: eid = Entity.NextEntity(); PSDamageIncrease = 90; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackRanged = PSDamageIncrease }; _game.BuffComponent.Add(eid, buffeffect); ie = new InstantEffect() { EntityID = eid }; _game.InstantEffectComponent.Add(eid, ie); break; case 10: eid = Entity.NextEntity(); PSDamageIncrease = 100; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackRanged = PSDamageIncrease }; _game.BuffComponent.Add(eid, buffeffect); ie = new InstantEffect() { EntityID = eid }; _game.InstantEffectComponent.Add(eid, ie); break; default: break; #endregion } break; #endregion #region EagleShot //EagleShot has been heavly modified to fit within our game prototype. case SkillType.EagleShot: #region Skill Variables int ESA; InstantEffect eie; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); targetID = GetPlayerID(); ESA = 10; eie = new InstantEffect() { EntityID = eid, }; _game.InstantEffectComponent.Add(eid, eie); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, WeaponAccuracy = ESA }; _game.BuffComponent.Add(eid, buffeffect); break; case 2: eid = Entity.NextEntity(); targetID = GetPlayerID(); ESA = 20; eie = new InstantEffect() { EntityID = eid, }; _game.InstantEffectComponent.Add(eid, eie); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, WeaponAccuracy = ESA }; _game.BuffComponent.Add(eid, buffeffect); break; case 3: eid = Entity.NextEntity(); targetID = GetPlayerID(); ESA = 30; eie = new InstantEffect() { EntityID = eid, }; _game.InstantEffectComponent.Add(eid, eie); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, WeaponAccuracy = ESA }; _game.BuffComponent.Add(eid, buffeffect); break; case 4: eid = Entity.NextEntity(); targetID = GetPlayerID(); ESA = 40; eie = new InstantEffect() { EntityID = eid, }; _game.InstantEffectComponent.Add(eid, eie); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, WeaponAccuracy = ESA }; _game.BuffComponent.Add(eid, buffeffect); break; case 5: eid = Entity.NextEntity(); targetID = GetPlayerID(); ESA = 50; eie = new InstantEffect() { EntityID = eid, }; _game.InstantEffectComponent.Add(eid, eie); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, WeaponAccuracy = ESA }; _game.BuffComponent.Add(eid, buffeffect); break; case 6: eid = Entity.NextEntity(); targetID = GetPlayerID(); ESA = 60; eie = new InstantEffect() { EntityID = eid, }; _game.InstantEffectComponent.Add(eid, eie); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, WeaponAccuracy = ESA }; _game.BuffComponent.Add(eid, buffeffect); break; case 7: eid = Entity.NextEntity(); targetID = GetPlayerID(); ESA = 70; eie = new InstantEffect() { EntityID = eid, }; _game.InstantEffectComponent.Add(eid, eie); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, WeaponAccuracy = ESA }; _game.BuffComponent.Add(eid, buffeffect); break; case 8: eid = Entity.NextEntity(); targetID = GetPlayerID(); ESA = 80; eie = new InstantEffect() { EntityID = eid, }; _game.InstantEffectComponent.Add(eid, eie); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, WeaponAccuracy = ESA }; _game.BuffComponent.Add(eid, buffeffect); break; case 9: eid = Entity.NextEntity(); targetID = GetPlayerID(); ESA = 90; eie = new InstantEffect() { EntityID = eid, }; _game.InstantEffectComponent.Add(eid, eie); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, WeaponAccuracy = ESA }; _game.BuffComponent.Add(eid, buffeffect); break; case 10: eid = Entity.NextEntity(); targetID = GetPlayerID(); ESA = 100; eie = new InstantEffect() { EntityID = eid, }; _game.InstantEffectComponent.Add(eid, eie); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, WeaponAccuracy = ESA }; _game.BuffComponent.Add(eid, buffeffect); break; default: break; #endregion } break; #endregion #region Theft case SkillType.Theft: #region Skill Variables ChanceToSucceed cts; int prob; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); prob = 5; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); break; case 2: eid = Entity.NextEntity(); prob = 10; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); break; case 3: eid = Entity.NextEntity(); prob = 20; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); break; case 4: eid = Entity.NextEntity(); prob = 30; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); break; case 5: eid = Entity.NextEntity(); prob = 40; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); break; case 6: eid = Entity.NextEntity(); prob = 50; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); break; case 7: eid = Entity.NextEntity(); prob = 60; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); break; case 8: eid = Entity.NextEntity(); prob = 70; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); break; case 9: eid = Entity.NextEntity(); prob = 80; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); break; case 10: eid = Entity.NextEntity(); prob = 90; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); break; default: break; #endregion } break; #endregion #region Mug case SkillType.Mug: #region Skill Variables int mugA; #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); prob = 5; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); mugA = -75; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackMelee = mugA }; _game.BuffComponent.Add(eid, buffeffect); break; case 2: eid = Entity.NextEntity(); prob = 10; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); mugA = -75; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackMelee = mugA }; _game.BuffComponent.Add(eid, buffeffect); break; case 3: eid = Entity.NextEntity(); prob = 20; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); mugA = -75; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackMelee = mugA }; _game.BuffComponent.Add(eid, buffeffect); break; case 4: eid = Entity.NextEntity(); prob = 30; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); mugA = -75; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackMelee = mugA }; _game.BuffComponent.Add(eid, buffeffect); break; case 5: eid = Entity.NextEntity(); prob = 40; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); mugA = -75; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackMelee = mugA }; _game.BuffComponent.Add(eid, buffeffect); break; case 6: eid = Entity.NextEntity(); prob = 50; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); mugA = -75; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackMelee = mugA }; _game.BuffComponent.Add(eid, buffeffect); break; case 7: eid = Entity.NextEntity(); prob = 60; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); mugA = -75; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackMelee = mugA }; _game.BuffComponent.Add(eid, buffeffect); break; case 8: eid = Entity.NextEntity(); prob = 70; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); mugA = -75; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackMelee = mugA }; _game.BuffComponent.Add(eid, buffeffect); break; case 9: eid = Entity.NextEntity(); prob = 80; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); mugA = -75; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackMelee = mugA }; _game.BuffComponent.Add(eid, buffeffect); break; case 10: eid = Entity.NextEntity(); prob = 90; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); mugA = -75; targetID = GetPlayerID(); buffeffect = new Buff() { EntityID = eid, TargetID = targetID, AttackMelee = mugA }; _game.BuffComponent.Add(eid, buffeffect); break; default: break; #endregion } break; #endregion #region LockPick case SkillType.LockPicking: #region Skill Variables #endregion switch (rank) { #region Checking Rank case 1: eid = Entity.NextEntity(); prob = 5; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); break; case 2: eid = Entity.NextEntity(); prob = 10; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); break; case 3: eid = Entity.NextEntity(); prob = 20; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); break; case 4: eid = Entity.NextEntity(); prob = 30; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); break; case 5: eid = Entity.NextEntity(); prob = 40; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); break; case 6: eid = Entity.NextEntity(); prob = 50; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); break; case 7: eid = Entity.NextEntity(); prob = 60; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); break; case 8: eid = Entity.NextEntity(); prob = 70; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); break; case 9: eid = Entity.NextEntity(); prob = 80; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); break; case 10: eid = Entity.NextEntity(); prob = 90; cts = new ChanceToSucceed() { EntityID = eid, SuccessRateAsPercentage = prob }; _game.ChanceToSucceedComponent.Add(eid, cts); break; default: break; #endregion } break; #endregion default: break; #endregion } break; #endregion default: break; #endregion } }
/// <summary> /// Creates Entities from aggregates (collections of components) /// </summary> /// <param name="aggregate">The specific aggreage to create</param> /// <param name="playerIndex">The player index for this player</param> /// <param name="aggregate">The game save that we are creating</param> public uint CreateFromAggregate(Aggregate aggregate, PlayerIndex playerIndex, string fileName, out DungeonCrawlerGame.CharacterSaveFile gameSave) { gameSave = new DungeonCrawlerGame.CharacterSaveFile(); uint entityID = 0xFFFFFF; Texture2D spriteSheet; Position position; Movement movement; Sprite sprite; SpriteAnimation spriteAnimation; //MovementSprite movementSprite; Collideable collideable; Local local; Player player; PlayerInfo info; Stats stats = new Stats(); HUDAggregateFactory hudagg = new HUDAggregateFactory(game); InvAggregateFactory invagg = new InvAggregateFactory(game); //Miscelaneous modifyers for the potential ability modifiers //Placeholders for racial/class bonuses and item bonuses. int miscMeleeAttack = 0; int miscRangedAttack = 0; int miscMeleeSpeed = 0; int miscAccuracy = 0; int miscMeleeDef = 0; int miscRangedDef = 0; int miscSpell = 0; int miscHealth = 0; switch (aggregate) { /**************************************** * Fairy * *************************************/ case Aggregate.FairyPlayer: entityID = Entity.NextEntity(); spriteSheet = game.Content.Load<Texture2D>("Spritesheets/wind_fae"); spriteSheet.Name = "Spritesheets/wind_fae"; position = new Position() { EntityID = entityID, Center = new Vector2(400, 150), Radius = 32f, }; game.PositionComponent[entityID] = position; collideable = new Collideable() { EntityID = entityID, Bounds = new CircleBounds(position.Center, position.Radius) }; game.CollisionComponent[entityID] = collideable; movement = new Movement() { EntityID = entityID, Direction = new Vector2(0, 1), Speed = 200f, }; game.MovementComponent[entityID] = movement; /* movementSprite = new MovementSprite() { EntityID = entityID, Facing = Facing.South, SpriteSheet = spriteSheet, SpriteBounds = new Rectangle(0, 0, 64, 64), Timer = 0f, }; game.MovementSpriteComponent[entityID] = movementSprite; */ spriteAnimation = new SpriteAnimation() { EntityID = entityID, FramesPerSecond = 10, IsLooping = true, IsPlaying = true, TimePassed = 0f, CurrentFrame = 0, CurrentAnimationRow = 0 }; game.SpriteAnimationComponent[entityID] = spriteAnimation; sprite = new Sprite() { EntityID = entityID, SpriteBounds = new Rectangle(0, 0, 64, 64), SpriteSheet = spriteSheet }; game.SpriteComponent[entityID] = sprite; local = new Local() { EntityID = entityID, }; game.LocalComponent[entityID] = local; //This will add a stats section for the player in the stats component stats = new Stats() { EntityID = entityID, //So here we just define our base values. Total sum is 50 //The base stats are 10 across the board Strength = 4, Stamina = 10, Agility = 10, Intelligence = 16, Defense = 10 }; game.StatsComponent[entityID] = stats; player = new Player() { EntityID = entityID, PlayerIndex = playerIndex, PlayerRace = aggregate, abilityModifiers = new AbilityModifiers() { meleeDamageReduction = miscMeleeDef + (int)((stats.Defense - 10) / 2), rangedDamageReduction = miscRangedDef + (int)((stats.Defense - 10) / 2), meleeAttackBonus = miscMeleeAttack + (int)((stats.Strength - 10) / 2), RangedAttackBonus = miscRangedAttack + (int)((stats.Agility - 10) / 2), MeleeAttackSpeed = miscMeleeSpeed + (int)((stats.Strength - 10) / 2), Accuracy = miscAccuracy + (int)((stats.Agility - 10) / 2), SpellBonus = miscSpell + (int)((stats.Intelligence - 10) / 2), HealthBonus = miscHealth + (int)((stats.Stamina - 10) / 2), } }; game.PlayerComponent[entityID] = player; info = new PlayerInfo() { Health = 100, Psi = 100, State = PlayerState.Default, }; game.PlayerInfoComponent[entityID] = info; break; /**************************************** * Cultist * *************************************/ case Aggregate.CultistPlayer: entityID = Entity.NextEntity(); spriteSheet = game.Content.Load<Texture2D>("Spritesheets/Cultist"); spriteSheet.Name = "Spritesheets/Cultist"; position = new Position() { EntityID = entityID, Center = new Vector2(400, 150), Radius = 32f, }; game.PositionComponent[entityID] = position; collideable = new Collideable() { EntityID = entityID, Bounds = new CircleBounds(position.Center, position.Radius) }; game.CollisionComponent[entityID] = collideable; movement = new Movement() { EntityID = entityID, Direction = new Vector2(0, 1), Speed = 200f, }; game.MovementComponent[entityID] = movement; //movementSprite = new MovementSprite() { // EntityID = entityID, // Facing = Facing.South, // SpriteSheet = spriteSheet, // SpriteBounds = new Rectangle(0, 0, 64, 64), // Timer = 0f, //}; //game.MovementSpriteComponent[entityID] = movementSprite; spriteAnimation = new SpriteAnimation() { EntityID = entityID, FramesPerSecond = 10, IsLooping = true, IsPlaying = true, TimePassed = 0f, CurrentFrame = 0, CurrentAnimationRow = 0 }; game.SpriteAnimationComponent[entityID] = spriteAnimation; sprite = new Sprite() { EntityID = entityID, SpriteBounds = new Rectangle(0, 0, 64, 64), SpriteSheet = spriteSheet }; game.SpriteComponent[entityID] = sprite; local = new Local() { EntityID = entityID, }; game.LocalComponent[entityID] = local; //This will add a stats section for the player in the stats component stats = new Stats() { EntityID = entityID, //So here we just define our base values. Total sum is 50 //The base stats are 10 across the board Strength = 4, Stamina = 10, Agility = 10, Intelligence = 16, Defense = 10 }; player = new Player() { EntityID = entityID, PlayerIndex = playerIndex, PlayerRace = aggregate, abilityModifiers = new AbilityModifiers() { meleeDamageReduction = miscMeleeDef + (int)((stats.Defense - 10) / 2), rangedDamageReduction = miscRangedDef + (int)((stats.Defense - 10) / 2), meleeAttackBonus = miscMeleeAttack + (int)((stats.Strength - 10) / 2), RangedAttackBonus = miscRangedAttack + (int)((stats.Agility - 10) / 2), MeleeAttackSpeed = miscMeleeSpeed + (int)((stats.Strength - 10) / 2), Accuracy = miscAccuracy + (int)((stats.Agility - 10) / 2), SpellBonus = miscSpell + (int)((stats.Intelligence - 10) / 2), HealthBonus = miscHealth + (int)((stats.Stamina - 10) / 2), } }; info = new PlayerInfo() { Health = 100, Psi = 100, State = PlayerState.Default, }; game.PlayerInfoComponent[entityID] = info; game.PlayerComponent[entityID] = player; //Create HUD hudagg.CreateHUD(player); //create Inv invagg.CreateInv(player); break; /**************************************** * Cyborg - Added by adam Clark * *************************************/ case Aggregate.CyborgPlayer: entityID = Entity.NextEntity(); spriteSheet = game.Content.Load<Texture2D>("Spritesheets/cyborg"); spriteSheet.Name = "Spritesheets/cyborg"; position = new Position() { EntityID = entityID, Center = new Vector2(400, 150), Radius = 32f, }; game.PositionComponent[entityID] = position; collideable = new Collideable() { EntityID = entityID, Bounds = new CircleBounds(position.Center, position.Radius) }; game.CollisionComponent[entityID] = collideable; movement = new Movement() { EntityID = entityID, Direction = new Vector2(0, 1), Speed = 200f, }; game.MovementComponent[entityID] = movement; /*movementSprite = new MovementSprite() { EntityID = entityID, Facing = Facing.South, SpriteSheet = spriteSheet, SpriteBounds = new Rectangle(0, 0, 64, 64), Timer = 0f, }; game.MovementSpriteComponent[entityID] = movementSprite;*/ spriteAnimation = new SpriteAnimation() { EntityID = entityID, FramesPerSecond = 10, IsLooping = true, IsPlaying = true, TimePassed = 0f, CurrentFrame = 0, CurrentAnimationRow = 0 }; game.SpriteAnimationComponent[entityID] = spriteAnimation; sprite = new Sprite() { EntityID = entityID, SpriteBounds = new Rectangle(0, 0, 64, 64), SpriteSheet = spriteSheet }; game.SpriteComponent[entityID] = sprite; local = new Local() { EntityID = entityID, }; game.LocalComponent[entityID] = local; //This will add a stats section for the player in the stats component stats = new Stats() { EntityID = entityID, //So here we just define our base values. Total sum is 50 //The base stats are 10 across the board Strength = 13, Stamina = 12, Agility = 13, Intelligence = 0, Defense = 12 }; game.StatsComponent[entityID] = stats; player = new Player() { EntityID = entityID, PlayerIndex = playerIndex, PlayerRace = aggregate, }; info = new PlayerInfo() { Health = 100, Psi = 100, State = PlayerState.Default, }; game.PlayerInfoComponent[entityID] = info; game.PlayerComponent[entityID] = player; //create HUD hudagg.CreateHUD(player); //create Inv invagg.CreateInv(player); break; /******************************************************************************* * Earthian * Done by Andrew Bellinder. I added the character's sprite and his skill sprites * ******************************************************************************/ case Aggregate.EarthianPlayer: entityID = Entity.NextEntity(); spriteSheet = game.Content.Load<Texture2D>("Spritesheets/Earthian2x"); spriteSheet.Name = "Spritesheets/Earthian2x"; position = new Position() { EntityID = entityID, Center = new Vector2(400, 150), Radius = 32f, }; game.PositionComponent[entityID] = position; collideable = new Collideable() { EntityID = entityID, Bounds = new CircleBounds(position.Center, position.Radius) }; game.CollisionComponent[entityID] = collideable; movement = new Movement() { EntityID = entityID, Direction = new Vector2(0, 1), Speed = 200f, }; game.MovementComponent[entityID] = movement; /* movementSprite = new MovementSprite() { EntityID = entityID, Facing = Facing.South, SpriteSheet = spriteSheet, SpriteBounds = new Rectangle(0, 0, 64, 64), Timer = 0f, }; game.MovementSpriteComponent[entityID] = movementSprite; */ spriteAnimation = new SpriteAnimation() { EntityID = entityID, FramesPerSecond = 10, IsLooping = true, IsPlaying = true, TimePassed = 0f, CurrentFrame = 0, CurrentAnimationRow = 0 }; game.SpriteAnimationComponent[entityID] = spriteAnimation; sprite = new Sprite() { EntityID = entityID, SpriteBounds = new Rectangle(0, 0, 64, 64), SpriteSheet = spriteSheet }; game.SpriteComponent[entityID] = sprite; local = new Local() { EntityID = entityID, }; game.LocalComponent[entityID] = local; //This will add a stats section for the player in the stats component stats = new Stats() { EntityID = entityID, //So here we just define our base values. Total sum is 50 //The base stats are 10 across the board Strength = 10, Stamina = 10, Agility = 10, Intelligence = 10, Defense = 10 }; game.StatsComponent[entityID] = stats; player = new Player() { EntityID = entityID, PlayerIndex = playerIndex, PlayerRace = aggregate, abilityModifiers = new AbilityModifiers() { meleeDamageReduction = miscMeleeDef + (int)((stats.Defense - 10) / 2), rangedDamageReduction = miscRangedDef + (int)((stats.Defense - 10) / 2), meleeAttackBonus = miscMeleeAttack + (int)((stats.Strength - 10) / 2), RangedAttackBonus = miscRangedAttack + (int)((stats.Agility - 10) / 2), MeleeAttackSpeed = miscMeleeSpeed + (int)((stats.Strength - 10) / 2), Accuracy = miscAccuracy + (int)((stats.Agility - 10) / 2), SpellBonus = miscSpell + (int)((stats.Intelligence - 10) / 2), HealthBonus = miscHealth + (int)((stats.Stamina - 10) / 2), } }; game.PlayerComponent[entityID] = player; info = new PlayerInfo() { Health = 100, Psi = 100, State = PlayerState.Default, }; game.PlayerInfoComponent[entityID] = info; //Create HUD hudagg.CreateHUD(player); //create Inv invagg.CreateInv(player); break; /**************************************** * Gargranian by Michael Fountain * *************************************/ case Aggregate.GargranianPlayer: entityID = Entity.NextEntity(); spriteSheet = game.Content.Load<Texture2D>("Spritesheets/gargranian"); spriteSheet.Name = "Spritesheets/gargranian"; position = new Position() { EntityID = entityID, Center = new Vector2(400, 150), Radius = 32f, }; game.PositionComponent[entityID] = position; collideable = new Collideable() { EntityID = entityID, Bounds = new CircleBounds(position.Center, position.Radius) }; game.CollisionComponent[entityID] = collideable; movement = new Movement() { EntityID = entityID, Direction = new Vector2(0, 1), Speed = 200f, }; game.MovementComponent[entityID] = movement; /* movementSprite = new MovementSprite() { EntityID = entityID, Facing = Facing.South, SpriteSheet = spriteSheet, SpriteBounds = new Rectangle(0, 0, 64, 64), Timer = 0f, }; game.MovementSpriteComponent[entityID] = movementSprite; */ spriteAnimation = new SpriteAnimation() { EntityID = entityID, FramesPerSecond = 10, IsLooping = true, IsPlaying = true, TimePassed = 0f, CurrentFrame = 0, CurrentAnimationRow = 0 }; game.SpriteAnimationComponent[entityID] = spriteAnimation; sprite = new Sprite() { EntityID = entityID, SpriteBounds = new Rectangle(0, 0, 64, 64), SpriteSheet = spriteSheet }; game.SpriteComponent[entityID] = sprite; local = new Local() { EntityID = entityID, }; game.LocalComponent[entityID] = local; //This will add a stats section for the player in the stats component stats = new Stats() { EntityID = entityID, //So here we just define our base values. Total sum is 50 //The base stats are 10 across the board Strength = 4, Stamina = 10, Agility = 10, Intelligence = 14, Defense = 12 }; game.StatsComponent[entityID] = stats; player = new Player() { EntityID = entityID, PlayerIndex = playerIndex, PlayerRace = aggregate, }; game.PlayerComponent[entityID] = player; info = new PlayerInfo() { Health = 100, Psi = 100, State = PlayerState.Default, }; game.PlayerInfoComponent[entityID] = info; //Create HUD hudagg.CreateHUD(player); //create Inv invagg.CreateInv(player); break; /**************************************** * Space Pirate * Done by Austin Murphy and I also have posted the 9 sprites for my skills that are listed in the design document. * *************************************/ case Aggregate.SpacePiratePlayer: entityID = Entity.NextEntity(); spriteSheet = game.Content.Load<Texture2D>("Spritesheets/SpacePBig"); spriteSheet.Name = "Spritesheets/SpacePBig"; position = new Position() { EntityID = entityID, Center = new Vector2(400, 150), Radius = 32f, }; game.PositionComponent[entityID] = position; collideable = new Collideable() { EntityID = entityID, Bounds = new CircleBounds(position.Center, position.Radius) }; game.CollisionComponent[entityID] = collideable; movement = new Movement() { EntityID = entityID, Direction = new Vector2(0, 1), Speed = 200f, }; game.MovementComponent[entityID] = movement; /* movementSprite = new MovementSprite() { EntityID = entityID, Facing = Facing.South, SpriteSheet = spriteSheet, SpriteBounds = new Rectangle(0, 0, 64, 64), Timer = 0f, }; game.MovementSpriteComponent[entityID] = movementSprite; */ spriteAnimation = new SpriteAnimation() { EntityID = entityID, FramesPerSecond = 10, IsLooping = true, IsPlaying = true, TimePassed = 0f, CurrentFrame = 0, CurrentAnimationRow = 0 }; game.SpriteAnimationComponent[entityID] = spriteAnimation; sprite = new Sprite() { EntityID = entityID, SpriteBounds = new Rectangle(0, 0, 64, 64), SpriteSheet = spriteSheet }; game.SpriteComponent[entityID] = sprite; local = new Local() { EntityID = entityID, }; game.LocalComponent[entityID] = local; //This will add a stats section for the player in the stats component stats = new Stats() { EntityID = entityID, //So here we just define our base values. Total sum is 50 //The base stats are 10 across the board Strength = 5, Stamina = 5, Agility = 25, Intelligence = 5, Defense = 5 }; game.StatsComponent[entityID] = stats; player = new Player() { EntityID = entityID, PlayerIndex = playerIndex, PlayerRace = aggregate, }; game.PlayerComponent[entityID] = player; info = new PlayerInfo() { Health = 100, Psi = 100, State = PlayerState.Default, }; game.PlayerInfoComponent[entityID] = info; //Create HUD hudagg.CreateHUD(player); //create Inv invagg.CreateInv(player); break; /**************************************** * Zombie * written by Matthew Hart * *************************************/ case Aggregate.ZombiePlayer: entityID = Entity.NextEntity(); spriteSheet = game.Content.Load<Texture2D>("Spritesheets/MzombieBx2"); spriteSheet.Name = "Spritesheets/MzombieBx2"; //Placeholder values miscMeleeAttack = 5; miscMeleeDef = 5; miscRangedDef = -5; position = new Position() { EntityID = entityID, Center = new Vector2(400, 150), Radius = 32f, }; game.PositionComponent[entityID] = position; collideable = new Collideable() { EntityID = entityID, Bounds = new CircleBounds(position.Center, position.Radius) }; game.CollisionComponent[entityID] = collideable; movement = new Movement() { EntityID = entityID, Direction = new Vector2(0, 1), Speed = 200f, }; game.MovementComponent[entityID] = movement; /* movementSprite = new MovementSprite() { EntityID = entityID, Facing = Facing.South, SpriteSheet = spriteSheet, SpriteBounds = new Rectangle(0, 0, 64, 64), Timer = 0f, }; game.MovementSpriteComponent[entityID] = movementSprite; */ spriteAnimation = new SpriteAnimation() { EntityID = entityID, FramesPerSecond = 10, IsLooping = true, IsPlaying = true, TimePassed = 0f, CurrentFrame = 0, CurrentAnimationRow = 0 }; game.SpriteAnimationComponent[entityID] = spriteAnimation; sprite = new Sprite() { EntityID = entityID, SpriteBounds = new Rectangle(0, 0, 64, 64), SpriteSheet = spriteSheet }; game.SpriteComponent[entityID] = sprite; local = new Local() { EntityID = entityID, }; game.LocalComponent[entityID] = local; //This will add a stats section for the player in the stats component stats = new Stats() { EntityID = entityID, //So here we just define our base values. Total sum is 50 //The base stats are 10 across the board Strength = 16, Stamina = 5, Agility = 5, Intelligence = 10, Defense = 14 }; game.StatsComponent[entityID] = stats; player = new Player() { EntityID = entityID, PlayerIndex = playerIndex, PlayerRace = aggregate, abilityModifiers = new AbilityModifiers() { meleeDamageReduction = miscMeleeDef + (int)((stats.Defense - 10) / 2), rangedDamageReduction = miscRangedDef + (int)((stats.Defense - 10) / 2), meleeAttackBonus = miscMeleeAttack + (int)((stats.Strength - 10) / 2), RangedAttackBonus = miscRangedAttack + (int)((stats.Agility - 10) / 2), MeleeAttackSpeed = miscMeleeSpeed + (int)((stats.Strength - 10) / 2), Accuracy = miscAccuracy + (int)((stats.Agility - 10) / 2), SpellBonus = miscSpell + (int)((stats.Intelligence - 10) / 2), HealthBonus = miscHealth + (int)((stats.Stamina - 10) / 2), } }; game.PlayerComponent[entityID] = player; info = new PlayerInfo() { Health = 100, Psi = 100, State = PlayerState.Default, }; game.PlayerInfoComponent[entityID] = info; //Create HUD hudagg.CreateHUD(player); //create Inv invagg.CreateInv(player); break; default: throw new Exception("Unknown type."); } // Store all of the data into the game save gameSave.aggregate = (int)aggregate; gameSave.health = 100; gameSave.psi = 100; gameSave.stats = stats; gameSave.Level = 1; gameSave.charAnimation = spriteSheet.Name; gameSave.fileName = fileName; info.FileName = fileName; string questString = "Proceed to the next room. This can be accomplished by walking through the doorway to your left."; Quest newQuest = new Quest() { EntityID = entityID, questName = QuestName.ReachNextRoom, questStatus = QuestStatus.InProgress, questGoals = new String[(int)Math.Ceiling(questString.Length / 33.0)], }; string[] strings = questString.Split(' '); string newstring = ""; int i = 0; int j = 0; while (j < newQuest.questGoals.Length) { if (i < strings.Length) { newstring += strings[i] + " "; i++; } if (i >= strings.Length) { newQuest.questGoals[j] = newstring; break; } if (newstring.Length + strings[i].Length >= 33 ) { newQuest.questGoals[j] = newstring; newstring = ""; j++; } } game.QuestComponent[entityID] = newQuest; return entityID; }
/// <summary> /// Creates Entities from aggregates (collections of components) /// </summary> /// <param name="aggregate">The specific aggreage to create</param> public uint CreateFromGameSave(DungeonCrawlerGame.CharacterSaveFile gameSave, PlayerIndex playerIndex) { uint entityID = 0xFFFFFF; Texture2D spriteSheet; Position position; Movement movement; Sprite sprite; SpriteAnimation spriteAnimation; //MovementSprite movementSprite; Collideable collideable; Local local; Player player; PlayerInfo info; Stats stats = new Stats(); HUDAggregateFactory hudagg = new HUDAggregateFactory(game); InvAggregateFactory invagg = new InvAggregateFactory(game); //Miscelaneous modifyers for the potential ability modifiers //Placeholders for racial/class bonuses and item bonuses. int miscMeleeAttack = 0; int miscRangedAttack = 0; int miscMeleeSpeed = 0; int miscAccuracy = 0; int miscMeleeDef = 0; int miscRangedDef = 0; int miscSpell = 0; int miscHealth = 0; // Create the player { entityID = Entity.NextEntity(); spriteSheet = game.Content.Load<Texture2D>(gameSave.charAnimation); spriteSheet.Name = gameSave.charAnimation; position = new Position() { EntityID = entityID, Center = new Vector2(400, 150), Radius = 32f, }; game.PositionComponent[entityID] = position; collideable = new Collideable() { EntityID = entityID, Bounds = new CircleBounds(position.Center, position.Radius) }; game.CollisionComponent[entityID] = collideable; movement = new Movement() { EntityID = entityID, Direction = new Vector2(0, 1), Speed = 200f, }; game.MovementComponent[entityID] = movement; spriteAnimation = new SpriteAnimation() { EntityID = entityID, FramesPerSecond = 10, IsLooping = true, IsPlaying = true, TimePassed = 0f, CurrentFrame = 0, CurrentAnimationRow = 0 }; game.SpriteAnimationComponent[entityID] = spriteAnimation; sprite = new Sprite() { EntityID = entityID, SpriteBounds = new Rectangle(0, 0, 64, 64), SpriteSheet = spriteSheet }; game.SpriteComponent[entityID] = sprite; local = new Local() { EntityID = entityID, }; game.LocalComponent[entityID] = local; //This will add a stats section for the player in the stats component stats = new Stats() { EntityID = entityID, // Load from game save Strength = gameSave.stats.Strength, Stamina = gameSave.stats.Stamina, Agility = gameSave.stats.Agility, Intelligence = gameSave.stats.Intelligence, Defense = gameSave.stats.Defense }; game.StatsComponent[entityID] = stats; player = new Player() { EntityID = entityID, PlayerIndex = playerIndex, PlayerRace = (Aggregate)gameSave.aggregate, abilityModifiers = new AbilityModifiers() { meleeDamageReduction = miscMeleeDef + (int)((stats.Defense - 10) / 2), rangedDamageReduction = miscRangedDef + (int)((stats.Defense - 10) / 2), meleeAttackBonus = miscMeleeAttack + (int)((stats.Strength - 10) / 2), RangedAttackBonus = miscRangedAttack + (int)((stats.Agility - 10) / 2), MeleeAttackSpeed = miscMeleeSpeed + (int)((stats.Strength - 10) / 2), Accuracy = miscAccuracy + (int)((stats.Agility - 10) / 2), SpellBonus = miscSpell + (int)((stats.Intelligence - 10) / 2), HealthBonus = miscHealth + (int)((stats.Stamina - 10) / 2), } }; game.PlayerComponent[entityID] = player; info = new PlayerInfo() { Health = 100, Psi = 100, State = PlayerState.Default, }; game.PlayerInfoComponent[entityID] = info; game.PlayerComponent[entityID] = player; //Create HUD hudagg.CreateHUD(player); //create Inv invagg.CreateInv(player); } string questString = "Proceed to the next room. This can be accomplished by walking through the doorway to your left."; Quest newQuest = new Quest() { EntityID = entityID, questName = QuestName.ReachNextRoom, questStatus = QuestStatus.InProgress, questGoals = new String[(int)Math.Ceiling(questString.Length / 33.0)], }; string[] strings = questString.Split(' '); string newstring = ""; int i = 0; int j = 0; while (j < newQuest.questGoals.Length) { if (i < strings.Length) { newstring += strings[i] + " "; i++; } if (i >= strings.Length) { newQuest.questGoals[j] = newstring; break; } if (newstring.Length + strings[i].Length >= 33) { newQuest.questGoals[j] = newstring; newstring = ""; j++; } } game.QuestComponent[entityID] = newQuest; return entityID; }
/// <summary> /// Creates a new enemy and adds it to the game. (No other components created) /// </summary> /// <param name="type">The type of enemy to create.</param> public uint CreateEnemy(EnemyType type, Position position) { uint eid = Entity.NextEntity(); Enemy enemy = new Enemy(); Sprite sprite; SpriteAnimation spriteAnimation = new SpriteAnimation(eid); Collideable collideable; EnemyAI ai; AIBehaviorType aiBehaviorType = AIBehaviorType.None; float moveSpeed = 100; String spritesheet; Rectangle spriteBounds = new Rectangle(0, 0, 64, 64); Color spriteColor = Color.White; switch (type) { case EnemyType.StationaryTarget: enemy.HurtOnTouch = false; enemy.Health = 1; spritesheet = "Spritesheets/Enemies/target2"; break; case EnemyType.MovingTarget: enemy.HurtOnTouch = false; enemy.Health = 1; spritesheet = "Spritesheets/Enemies/target2"; break; case EnemyType.Spider: enemy.HurtOnTouch = false; enemy.Health = 20; spritesheet = "Spritesheets/Enemies/spider"; spriteBounds = new Rectangle(0, 0, 120/3, 141/4); aiBehaviorType = AIBehaviorType.Spider; moveSpeed = 115; spriteAnimation.FramesPerSecond = 14; break; case EnemyType.CloakingRobot: enemy.HurtOnTouch = false; enemy.Health = 150; spritesheet = "Spritesheets/Enemies/CloakingRobot"; spriteColor = Color.LightCyan; spriteBounds = new Rectangle(0, 0, 65, 75); spriteAnimation.FramesPerSecond = 5; aiBehaviorType = AIBehaviorType.CloakingRanged; position.Radius = 37; break; case EnemyType.BasicShootingRobot: enemy.HurtOnTouch = false; enemy.Health = 150; spritesheet = "Spritesheets/Enemies/BasicShootingRobot"; spriteBounds = new Rectangle(0, 0, 65, 75); spriteAnimation.FramesPerSecond = 5; aiBehaviorType = AIBehaviorType.DefaultRanged; position.Radius = 32; break; case EnemyType.Sludge1: enemy.HurtOnTouch = false; enemy.Health = 50; spritesheet = "Spritesheets/Enemies/Sludge1"; spriteBounds = new Rectangle(0, 0, 16, 16); spriteAnimation.FramesPerSecond = 10; aiBehaviorType = AIBehaviorType.DefaultMelee; position.Radius = 8; break; case EnemyType.Sludge2: enemy.HurtOnTouch = false; enemy.Health = 75; spritesheet = "Spritesheets/Enemies/Sludge2"; spriteBounds = new Rectangle(0, 0, 32, 32); spriteAnimation.FramesPerSecond = 10; aiBehaviorType = AIBehaviorType.DefaultRanged; position.Radius = 16; break; case EnemyType.Sludge3: enemy.HurtOnTouch = false; enemy.Health = 100; spritesheet = "Spritesheets/Enemies/Sludge3"; spriteBounds = new Rectangle(0, 0, 64, 64); spriteAnimation.FramesPerSecond = 10; aiBehaviorType = AIBehaviorType.DefaultRanged; position.Radius = 32; break; case EnemyType.Sludge4: enemy.HurtOnTouch = false; enemy.Health = 125; spritesheet = "Spritesheets/Enemies/Sludge4"; spriteBounds = new Rectangle(0, 0, 128, 128); spriteAnimation.FramesPerSecond = 10; aiBehaviorType = AIBehaviorType.DefaultRanged; position.Radius = 64; break; case EnemyType.Sludge5: enemy.HurtOnTouch = false; enemy.Health = 150; spritesheet = "Spritesheets/Enemies/Sludge5"; spriteBounds = new Rectangle(0, 0, 256, 256); spriteAnimation.FramesPerSecond = 10; aiBehaviorType = AIBehaviorType.DefaultRanged; position.Radius = 128; break; default: throw new Exception("Unknown EnemyType"); } ai = new EnemyAI() { EntityID = eid, AIBehaviorType = aiBehaviorType, }; _game.EnemyAIComponent.Add(eid, ai); enemy.Type = type; enemy.EntityID = eid; position.EntityID = eid; sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load<Texture2D>(spritesheet), SpriteColor = spriteColor, SpriteBounds = spriteBounds }; collideable = new Collideable() { EntityID = eid, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius) }; Movement move = new Movement() { EntityID = eid, Speed = moveSpeed, }; _game.SpriteAnimationComponent[eid] = spriteAnimation; _game.CollisionComponent[eid] = collideable; _game.MovementComponent.Add(eid, move); _game.EnemyComponent.Add(eid, enemy); _game.PositionComponent.Add(eid, position); _game.SpriteComponent.Add(eid, sprite); return eid; }
/// <summary> /// Creates a new enemy and adds it to the game. (No other components created) /// </summary> /// <param name="type">The type of enemy to create.</param> public uint CreateEnemy(EnemyType type, Position position) { uint eid = Entity.NextEntity(); Enemy enemy = new Enemy(); Sprite sprite; SpriteAnimation spriteAnimation = new SpriteAnimation(eid); Collideable collideable; EnemyAI ai; AIBehaviorType aiBehaviorType = AIBehaviorType.None; float moveSpeed = 100; String spritesheet; Rectangle spriteBounds = new Rectangle(0, 0, 64, 64);; switch (type) { case EnemyType.StationaryTarget: enemy.HurtOnTouch = false; enemy.Health = 1; spritesheet = "Spritesheets/target2"; break; case EnemyType.MovingTarget: enemy.HurtOnTouch = false; enemy.Health = 1; spritesheet = "Spritesheets/target2"; break; case EnemyType.Alien: enemy.HurtOnTouch = false; enemy.Health = 1; spritesheet = "Spritesheets/alien"; spriteBounds = new Rectangle(0, 0, 32, 32); aiBehaviorType = AIBehaviorType.Alien; break; default: throw new Exception("Unknown EnemyType"); } ai = new EnemyAI() { EntityID = eid, AIBehaviorType = aiBehaviorType, }; _game.EnemyAIComponent.Add(eid, ai); enemy.Type = type; enemy.EntityID = eid; position.EntityID = eid; sprite = new Sprite() { EntityID = eid, SpriteSheet = _game.Content.Load <Texture2D>(spritesheet), SpriteBounds = spriteBounds }; collideable = new Collideable() { EntityID = eid, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius) }; Movement move = new Movement() { EntityID = eid, Speed = moveSpeed, }; _game.SpriteAnimationComponent[eid] = spriteAnimation; _game.CollisionComponent[eid] = collideable; _game.MovementComponent.Add(eid, move); _game.EnemyComponent.Add(eid, enemy); _game.PositionComponent.Add(eid, position); _game.SpriteComponent.Add(eid, sprite); return(eid); }
/// <summary> /// Creates Entities from aggregates (collections of components) /// </summary> /// <param name="aggregate">The specific aggreage to create</param> public uint CreateFromGameSave(DungeonCrawlerGame.CharacterSaveFile gameSave, PlayerIndex playerIndex) { uint entityID = 0xFFFFFF; Texture2D spriteSheet; Position position; Movement movement; Sprite sprite; SpriteAnimation spriteAnimation; //MovementSprite movementSprite; Collideable collideable; Local local; Player player; PlayerInfo info; Stats stats = new Stats(); HUDAggregateFactory hudagg = new HUDAggregateFactory(game); InvAggregateFactory invagg = new InvAggregateFactory(game); //Miscelaneous modifyers for the potential ability modifiers //Placeholders for racial/class bonuses and item bonuses. int miscMeleeAttack = 0; int miscRangedAttack = 0; int miscMeleeSpeed = 0; int miscAccuracy = 0; int miscMeleeDef = 0; int miscRangedDef = 0; int miscSpell = 0; int miscHealth = 0; // Create the player { entityID = Entity.NextEntity(); spriteSheet = game.Content.Load <Texture2D>(gameSave.charAnimation); spriteSheet.Name = gameSave.charAnimation; position = new Position() { EntityID = entityID, Center = new Vector2(400, 150), Radius = 32f, }; game.PositionComponent[entityID] = position; collideable = new Collideable() { EntityID = entityID, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius) }; game.CollisionComponent[entityID] = collideable; movement = new Movement() { EntityID = entityID, Direction = new Vector2(0, 1), Speed = 200f, }; game.MovementComponent[entityID] = movement; spriteAnimation = new SpriteAnimation() { EntityID = entityID, FramesPerSecond = 10, IsLooping = true, IsPlaying = true, TimePassed = 0f, CurrentFrame = 0, CurrentAnimationRow = 0 }; game.SpriteAnimationComponent[entityID] = spriteAnimation; sprite = new Sprite() { EntityID = entityID, SpriteBounds = new Rectangle(0, 0, 64, 64), SpriteSheet = spriteSheet }; game.SpriteComponent[entityID] = sprite; local = new Local() { EntityID = entityID, }; game.LocalComponent[entityID] = local; //This will add a stats section for the player in the stats component stats = new Stats() { EntityID = entityID, // Load from game save Strength = gameSave.stats.Strength, Stamina = gameSave.stats.Stamina, Agility = gameSave.stats.Agility, Intelligence = gameSave.stats.Intelligence, Defense = gameSave.stats.Defense }; game.StatsComponent[entityID] = stats; player = new Player() { EntityID = entityID, PlayerIndex = playerIndex, PlayerRace = (Aggregate)gameSave.aggregate, abilityModifiers = new AbilityModifiers() { meleeDamageReduction = miscMeleeDef + (int)((stats.Defense - 10) / 2), rangedDamageReduction = miscRangedDef + (int)((stats.Defense - 10) / 2), meleeAttackBonus = miscMeleeAttack + (int)((stats.Strength - 10) / 2), RangedAttackBonus = miscRangedAttack + (int)((stats.Agility - 10) / 2), MeleeAttackSpeed = miscMeleeSpeed + (int)((stats.Strength - 10) / 2), Accuracy = miscAccuracy + (int)((stats.Agility - 10) / 2), SpellBonus = miscSpell + (int)((stats.Intelligence - 10) / 2), HealthBonus = miscHealth + (int)((stats.Stamina - 10) / 2), } }; game.PlayerComponent[entityID] = player; info = new PlayerInfo() { Health = 100, Psi = 100, State = PlayerState.Default, }; game.PlayerInfoComponent[entityID] = info; game.PlayerComponent[entityID] = player; //Create HUD hudagg.CreateHUD(player); //create Inv invagg.CreateInv(player); } string questString = "Proceed to the next room. This can be accomplished by walking through the doorway to your left."; Quest newQuest = new Quest() { EntityID = entityID, questName = QuestName.ReachNextRoom, questStatus = QuestStatus.InProgress, questGoals = new String[(int)Math.Ceiling(questString.Length / 33.0)], }; string[] strings = questString.Split(' '); string newstring = ""; int i = 0; int j = 0; while (j < newQuest.questGoals.Length) { if (i < strings.Length) { newstring += strings[i] + " "; i++; } if (i >= strings.Length) { newQuest.questGoals[j] = newstring; break; } if (newstring.Length + strings[i].Length >= 33) { newQuest.questGoals[j] = newstring; newstring = ""; j++; } } game.QuestComponent[entityID] = newQuest; return(entityID); }
void Start() { m_BoxCollider = GetComponent <BoxCollider2D>(); Collideable c = GetComponent <Collideable>(); }
/// <summary> /// Creates Entities from aggregates (collections of components) /// </summary> /// <param name="aggregate">The specific aggreage to create</param> /// <param name="playerIndex">The player index for this player</param> /// <param name="aggregate">The game save that we are creating</param> public uint CreateFromAggregate(Aggregate aggregate, PlayerIndex playerIndex, string fileName, out DungeonCrawlerGame.CharacterSaveFile gameSave) { gameSave = new DungeonCrawlerGame.CharacterSaveFile(); uint entityID = 0xFFFFFF; Texture2D spriteSheet; Position position; Movement movement; Sprite sprite; SpriteAnimation spriteAnimation; //MovementSprite movementSprite; Collideable collideable; Local local; Player player; PlayerInfo info; Stats stats = new Stats(); HUDAggregateFactory hudagg = new HUDAggregateFactory(game); InvAggregateFactory invagg = new InvAggregateFactory(game); //Miscelaneous modifyers for the potential ability modifiers //Placeholders for racial/class bonuses and item bonuses. int miscMeleeAttack = 0; int miscRangedAttack = 0; int miscMeleeSpeed = 0; int miscAccuracy = 0; int miscMeleeDef = 0; int miscRangedDef = 0; int miscSpell = 0; int miscHealth = 0; switch (aggregate) { /**************************************** * Fairy * *************************************/ case Aggregate.FairyPlayer: entityID = Entity.NextEntity(); spriteSheet = game.Content.Load <Texture2D>("Spritesheets/wind_fae"); spriteSheet.Name = "Spritesheets/wind_fae"; position = new Position() { EntityID = entityID, Center = new Vector2(400, 150), Radius = 32f, }; game.PositionComponent[entityID] = position; collideable = new Collideable() { EntityID = entityID, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius) }; game.CollisionComponent[entityID] = collideable; movement = new Movement() { EntityID = entityID, Direction = new Vector2(0, 1), Speed = 200f, }; game.MovementComponent[entityID] = movement; /* * movementSprite = new MovementSprite() * { * EntityID = entityID, * Facing = Facing.South, * SpriteSheet = spriteSheet, * SpriteBounds = new Rectangle(0, 0, 64, 64), * Timer = 0f, * }; * game.MovementSpriteComponent[entityID] = movementSprite; */ spriteAnimation = new SpriteAnimation() { EntityID = entityID, FramesPerSecond = 10, IsLooping = true, IsPlaying = true, TimePassed = 0f, CurrentFrame = 0, CurrentAnimationRow = 0 }; game.SpriteAnimationComponent[entityID] = spriteAnimation; sprite = new Sprite() { EntityID = entityID, SpriteBounds = new Rectangle(0, 0, 64, 64), SpriteSheet = spriteSheet }; game.SpriteComponent[entityID] = sprite; local = new Local() { EntityID = entityID, }; game.LocalComponent[entityID] = local; //This will add a stats section for the player in the stats component stats = new Stats() { EntityID = entityID, //So here we just define our base values. Total sum is 50 //The base stats are 10 across the board Strength = 4, Stamina = 10, Agility = 10, Intelligence = 16, Defense = 10 }; game.StatsComponent[entityID] = stats; player = new Player() { EntityID = entityID, PlayerIndex = playerIndex, PlayerRace = aggregate, abilityModifiers = new AbilityModifiers() { meleeDamageReduction = miscMeleeDef + (int)((stats.Defense - 10) / 2), rangedDamageReduction = miscRangedDef + (int)((stats.Defense - 10) / 2), meleeAttackBonus = miscMeleeAttack + (int)((stats.Strength - 10) / 2), RangedAttackBonus = miscRangedAttack + (int)((stats.Agility - 10) / 2), MeleeAttackSpeed = miscMeleeSpeed + (int)((stats.Strength - 10) / 2), Accuracy = miscAccuracy + (int)((stats.Agility - 10) / 2), SpellBonus = miscSpell + (int)((stats.Intelligence - 10) / 2), HealthBonus = miscHealth + (int)((stats.Stamina - 10) / 2), } }; game.PlayerComponent[entityID] = player; info = new PlayerInfo() { Health = 100, Psi = 100, State = PlayerState.Default, }; game.PlayerInfoComponent[entityID] = info; break; /**************************************** * Cultist * *************************************/ case Aggregate.CultistPlayer: entityID = Entity.NextEntity(); spriteSheet = game.Content.Load <Texture2D>("Spritesheets/Cultist"); spriteSheet.Name = "Spritesheets/Cultist"; position = new Position() { EntityID = entityID, Center = new Vector2(400, 150), Radius = 32f, }; game.PositionComponent[entityID] = position; collideable = new Collideable() { EntityID = entityID, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius) }; game.CollisionComponent[entityID] = collideable; movement = new Movement() { EntityID = entityID, Direction = new Vector2(0, 1), Speed = 200f, }; game.MovementComponent[entityID] = movement; //movementSprite = new MovementSprite() { // EntityID = entityID, // Facing = Facing.South, // SpriteSheet = spriteSheet, // SpriteBounds = new Rectangle(0, 0, 64, 64), // Timer = 0f, //}; //game.MovementSpriteComponent[entityID] = movementSprite; spriteAnimation = new SpriteAnimation() { EntityID = entityID, FramesPerSecond = 10, IsLooping = true, IsPlaying = true, TimePassed = 0f, CurrentFrame = 0, CurrentAnimationRow = 0 }; game.SpriteAnimationComponent[entityID] = spriteAnimation; sprite = new Sprite() { EntityID = entityID, SpriteBounds = new Rectangle(0, 0, 64, 64), SpriteSheet = spriteSheet }; game.SpriteComponent[entityID] = sprite; local = new Local() { EntityID = entityID, }; game.LocalComponent[entityID] = local; //This will add a stats section for the player in the stats component stats = new Stats() { EntityID = entityID, //So here we just define our base values. Total sum is 50 //The base stats are 10 across the board Strength = 4, Stamina = 10, Agility = 10, Intelligence = 16, Defense = 10 }; player = new Player() { EntityID = entityID, PlayerIndex = playerIndex, PlayerRace = aggregate, abilityModifiers = new AbilityModifiers() { meleeDamageReduction = miscMeleeDef + (int)((stats.Defense - 10) / 2), rangedDamageReduction = miscRangedDef + (int)((stats.Defense - 10) / 2), meleeAttackBonus = miscMeleeAttack + (int)((stats.Strength - 10) / 2), RangedAttackBonus = miscRangedAttack + (int)((stats.Agility - 10) / 2), MeleeAttackSpeed = miscMeleeSpeed + (int)((stats.Strength - 10) / 2), Accuracy = miscAccuracy + (int)((stats.Agility - 10) / 2), SpellBonus = miscSpell + (int)((stats.Intelligence - 10) / 2), HealthBonus = miscHealth + (int)((stats.Stamina - 10) / 2), } }; info = new PlayerInfo() { Health = 100, Psi = 100, State = PlayerState.Default, }; game.PlayerInfoComponent[entityID] = info; game.PlayerComponent[entityID] = player; //Create HUD hudagg.CreateHUD(player); //create Inv invagg.CreateInv(player); break; /**************************************** * Cyborg - Added by adam Clark * *************************************/ case Aggregate.CyborgPlayer: entityID = Entity.NextEntity(); spriteSheet = game.Content.Load <Texture2D>("Spritesheets/cyborg"); spriteSheet.Name = "Spritesheets/cyborg"; position = new Position() { EntityID = entityID, Center = new Vector2(400, 150), Radius = 32f, }; game.PositionComponent[entityID] = position; collideable = new Collideable() { EntityID = entityID, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius) }; game.CollisionComponent[entityID] = collideable; movement = new Movement() { EntityID = entityID, Direction = new Vector2(0, 1), Speed = 200f, }; game.MovementComponent[entityID] = movement; /*movementSprite = new MovementSprite() * { * EntityID = entityID, * Facing = Facing.South, * SpriteSheet = spriteSheet, * SpriteBounds = new Rectangle(0, 0, 64, 64), * Timer = 0f, * }; * game.MovementSpriteComponent[entityID] = movementSprite;*/ spriteAnimation = new SpriteAnimation() { EntityID = entityID, FramesPerSecond = 10, IsLooping = true, IsPlaying = true, TimePassed = 0f, CurrentFrame = 0, CurrentAnimationRow = 0 }; game.SpriteAnimationComponent[entityID] = spriteAnimation; sprite = new Sprite() { EntityID = entityID, SpriteBounds = new Rectangle(0, 0, 64, 64), SpriteSheet = spriteSheet }; game.SpriteComponent[entityID] = sprite; local = new Local() { EntityID = entityID, }; game.LocalComponent[entityID] = local; //This will add a stats section for the player in the stats component stats = new Stats() { EntityID = entityID, //So here we just define our base values. Total sum is 50 //The base stats are 10 across the board Strength = 13, Stamina = 12, Agility = 13, Intelligence = 0, Defense = 12 }; game.StatsComponent[entityID] = stats; player = new Player() { EntityID = entityID, PlayerIndex = playerIndex, PlayerRace = aggregate, }; info = new PlayerInfo() { Health = 100, Psi = 100, State = PlayerState.Default, }; game.PlayerInfoComponent[entityID] = info; game.PlayerComponent[entityID] = player; //create HUD hudagg.CreateHUD(player); //create Inv invagg.CreateInv(player); break; /******************************************************************************* * Earthian * Done by Andrew Bellinder. I added the character's sprite and his skill sprites * ******************************************************************************/ case Aggregate.EarthianPlayer: entityID = Entity.NextEntity(); spriteSheet = game.Content.Load <Texture2D>("Spritesheets/Earthian2x"); spriteSheet.Name = "Spritesheets/Earthian2x"; position = new Position() { EntityID = entityID, Center = new Vector2(400, 150), Radius = 32f, }; game.PositionComponent[entityID] = position; collideable = new Collideable() { EntityID = entityID, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius) }; game.CollisionComponent[entityID] = collideable; movement = new Movement() { EntityID = entityID, Direction = new Vector2(0, 1), Speed = 200f, }; game.MovementComponent[entityID] = movement; /* * movementSprite = new MovementSprite() { * EntityID = entityID, * Facing = Facing.South, * SpriteSheet = spriteSheet, * SpriteBounds = new Rectangle(0, 0, 64, 64), * Timer = 0f, * }; * game.MovementSpriteComponent[entityID] = movementSprite; */ spriteAnimation = new SpriteAnimation() { EntityID = entityID, FramesPerSecond = 10, IsLooping = true, IsPlaying = true, TimePassed = 0f, CurrentFrame = 0, CurrentAnimationRow = 0 }; game.SpriteAnimationComponent[entityID] = spriteAnimation; sprite = new Sprite() { EntityID = entityID, SpriteBounds = new Rectangle(0, 0, 64, 64), SpriteSheet = spriteSheet }; game.SpriteComponent[entityID] = sprite; local = new Local() { EntityID = entityID, }; game.LocalComponent[entityID] = local; //This will add a stats section for the player in the stats component stats = new Stats() { EntityID = entityID, //So here we just define our base values. Total sum is 50 //The base stats are 10 across the board Strength = 10, Stamina = 10, Agility = 10, Intelligence = 10, Defense = 10 }; game.StatsComponent[entityID] = stats; player = new Player() { EntityID = entityID, PlayerIndex = playerIndex, PlayerRace = aggregate, abilityModifiers = new AbilityModifiers() { meleeDamageReduction = miscMeleeDef + (int)((stats.Defense - 10) / 2), rangedDamageReduction = miscRangedDef + (int)((stats.Defense - 10) / 2), meleeAttackBonus = miscMeleeAttack + (int)((stats.Strength - 10) / 2), RangedAttackBonus = miscRangedAttack + (int)((stats.Agility - 10) / 2), MeleeAttackSpeed = miscMeleeSpeed + (int)((stats.Strength - 10) / 2), Accuracy = miscAccuracy + (int)((stats.Agility - 10) / 2), SpellBonus = miscSpell + (int)((stats.Intelligence - 10) / 2), HealthBonus = miscHealth + (int)((stats.Stamina - 10) / 2), } }; game.PlayerComponent[entityID] = player; info = new PlayerInfo() { Health = 100, Psi = 100, State = PlayerState.Default, }; game.PlayerInfoComponent[entityID] = info; //Create HUD hudagg.CreateHUD(player); //create Inv invagg.CreateInv(player); break; /**************************************** * Gargranian by Michael Fountain * *************************************/ case Aggregate.GargranianPlayer: entityID = Entity.NextEntity(); spriteSheet = game.Content.Load <Texture2D>("Spritesheets/gargranian"); spriteSheet.Name = "Spritesheets/gargranian"; position = new Position() { EntityID = entityID, Center = new Vector2(400, 150), Radius = 32f, }; game.PositionComponent[entityID] = position; collideable = new Collideable() { EntityID = entityID, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius) }; game.CollisionComponent[entityID] = collideable; movement = new Movement() { EntityID = entityID, Direction = new Vector2(0, 1), Speed = 200f, }; game.MovementComponent[entityID] = movement; /* * movementSprite = new MovementSprite() * { * EntityID = entityID, * Facing = Facing.South, * SpriteSheet = spriteSheet, * SpriteBounds = new Rectangle(0, 0, 64, 64), * Timer = 0f, * }; * game.MovementSpriteComponent[entityID] = movementSprite; */ spriteAnimation = new SpriteAnimation() { EntityID = entityID, FramesPerSecond = 10, IsLooping = true, IsPlaying = true, TimePassed = 0f, CurrentFrame = 0, CurrentAnimationRow = 0 }; game.SpriteAnimationComponent[entityID] = spriteAnimation; sprite = new Sprite() { EntityID = entityID, SpriteBounds = new Rectangle(0, 0, 64, 64), SpriteSheet = spriteSheet }; game.SpriteComponent[entityID] = sprite; local = new Local() { EntityID = entityID, }; game.LocalComponent[entityID] = local; //This will add a stats section for the player in the stats component stats = new Stats() { EntityID = entityID, //So here we just define our base values. Total sum is 50 //The base stats are 10 across the board Strength = 4, Stamina = 10, Agility = 10, Intelligence = 14, Defense = 12 }; game.StatsComponent[entityID] = stats; player = new Player() { EntityID = entityID, PlayerIndex = playerIndex, PlayerRace = aggregate, }; game.PlayerComponent[entityID] = player; info = new PlayerInfo() { Health = 100, Psi = 100, State = PlayerState.Default, }; game.PlayerInfoComponent[entityID] = info; //Create HUD hudagg.CreateHUD(player); //create Inv invagg.CreateInv(player); break; /**************************************** * Space Pirate * Done by Austin Murphy and I also have posted the 9 sprites for my skills that are listed in the design document. * *************************************/ case Aggregate.SpacePiratePlayer: entityID = Entity.NextEntity(); spriteSheet = game.Content.Load <Texture2D>("Spritesheets/SpacePBig"); spriteSheet.Name = "Spritesheets/SpacePBig"; position = new Position() { EntityID = entityID, Center = new Vector2(400, 150), Radius = 32f, }; game.PositionComponent[entityID] = position; collideable = new Collideable() { EntityID = entityID, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius) }; game.CollisionComponent[entityID] = collideable; movement = new Movement() { EntityID = entityID, Direction = new Vector2(0, 1), Speed = 200f, }; game.MovementComponent[entityID] = movement; /* * movementSprite = new MovementSprite() * { * EntityID = entityID, * Facing = Facing.South, * SpriteSheet = spriteSheet, * SpriteBounds = new Rectangle(0, 0, 64, 64), * Timer = 0f, * }; * game.MovementSpriteComponent[entityID] = movementSprite; */ spriteAnimation = new SpriteAnimation() { EntityID = entityID, FramesPerSecond = 10, IsLooping = true, IsPlaying = true, TimePassed = 0f, CurrentFrame = 0, CurrentAnimationRow = 0 }; game.SpriteAnimationComponent[entityID] = spriteAnimation; sprite = new Sprite() { EntityID = entityID, SpriteBounds = new Rectangle(0, 0, 64, 64), SpriteSheet = spriteSheet }; game.SpriteComponent[entityID] = sprite; local = new Local() { EntityID = entityID, }; game.LocalComponent[entityID] = local; //This will add a stats section for the player in the stats component stats = new Stats() { EntityID = entityID, //So here we just define our base values. Total sum is 50 //The base stats are 10 across the board Strength = 5, Stamina = 5, Agility = 25, Intelligence = 5, Defense = 5 }; game.StatsComponent[entityID] = stats; player = new Player() { EntityID = entityID, PlayerIndex = playerIndex, PlayerRace = aggregate, }; game.PlayerComponent[entityID] = player; info = new PlayerInfo() { Health = 100, Psi = 100, State = PlayerState.Default, }; game.PlayerInfoComponent[entityID] = info; //Create HUD hudagg.CreateHUD(player); //create Inv invagg.CreateInv(player); break; /**************************************** * Zombie * written by Matthew Hart * *************************************/ case Aggregate.ZombiePlayer: entityID = Entity.NextEntity(); spriteSheet = game.Content.Load <Texture2D>("Spritesheets/MzombieBx2"); spriteSheet.Name = "Spritesheets/MzombieBx2"; //Placeholder values miscMeleeAttack = 5; miscMeleeDef = 5; miscRangedDef = -5; position = new Position() { EntityID = entityID, Center = new Vector2(400, 150), Radius = 32f, }; game.PositionComponent[entityID] = position; collideable = new Collideable() { EntityID = entityID, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius) }; game.CollisionComponent[entityID] = collideable; movement = new Movement() { EntityID = entityID, Direction = new Vector2(0, 1), Speed = 200f, }; game.MovementComponent[entityID] = movement; /* * movementSprite = new MovementSprite() * { * EntityID = entityID, * Facing = Facing.South, * SpriteSheet = spriteSheet, * SpriteBounds = new Rectangle(0, 0, 64, 64), * Timer = 0f, * }; * game.MovementSpriteComponent[entityID] = movementSprite; */ spriteAnimation = new SpriteAnimation() { EntityID = entityID, FramesPerSecond = 10, IsLooping = true, IsPlaying = true, TimePassed = 0f, CurrentFrame = 0, CurrentAnimationRow = 0 }; game.SpriteAnimationComponent[entityID] = spriteAnimation; sprite = new Sprite() { EntityID = entityID, SpriteBounds = new Rectangle(0, 0, 64, 64), SpriteSheet = spriteSheet }; game.SpriteComponent[entityID] = sprite; local = new Local() { EntityID = entityID, }; game.LocalComponent[entityID] = local; //This will add a stats section for the player in the stats component stats = new Stats() { EntityID = entityID, //So here we just define our base values. Total sum is 50 //The base stats are 10 across the board Strength = 16, Stamina = 5, Agility = 5, Intelligence = 10, Defense = 14 }; game.StatsComponent[entityID] = stats; player = new Player() { EntityID = entityID, PlayerIndex = playerIndex, PlayerRace = aggregate, abilityModifiers = new AbilityModifiers() { meleeDamageReduction = miscMeleeDef + (int)((stats.Defense - 10) / 2), rangedDamageReduction = miscRangedDef + (int)((stats.Defense - 10) / 2), meleeAttackBonus = miscMeleeAttack + (int)((stats.Strength - 10) / 2), RangedAttackBonus = miscRangedAttack + (int)((stats.Agility - 10) / 2), MeleeAttackSpeed = miscMeleeSpeed + (int)((stats.Strength - 10) / 2), Accuracy = miscAccuracy + (int)((stats.Agility - 10) / 2), SpellBonus = miscSpell + (int)((stats.Intelligence - 10) / 2), HealthBonus = miscHealth + (int)((stats.Stamina - 10) / 2), } }; game.PlayerComponent[entityID] = player; info = new PlayerInfo() { Health = 100, Psi = 100, State = PlayerState.Default, }; game.PlayerInfoComponent[entityID] = info; //Create HUD hudagg.CreateHUD(player); //create Inv invagg.CreateInv(player); break; default: throw new Exception("Unknown type."); } // Store all of the data into the game save gameSave.aggregate = (int)aggregate; gameSave.health = 100; gameSave.psi = 100; gameSave.stats = stats; gameSave.Level = 1; gameSave.charAnimation = spriteSheet.Name; gameSave.fileName = fileName; info.FileName = fileName; game.QuestLogSystem.ActivateQuest(entityID, 0); return(entityID); }
/// <summary> /// Handles collision logic for right collision. /// </summary> /// <param name="otherObj">the other object</param> /// <returns>true if it was a collision, false otherwise</returns> public override bool CollisionRight(Collideable otherObj) { if (base.CollisionRight(otherObj)) { if (otherObj is MoveableBox && pushing) { ((MoveableBox)otherObj).Move(100); } return true; } return false; }
/// <summary> /// For using basic projectile: rank is damage, use last parameter for spritesheet /// </summary> /// <param name="skillP"></param> /// <param name="direction"></param> /// <param name="position"></param> /// <param name="rankP"></param> /// <param name="speed"></param> /// <param name="owner"></param> /// <param name="canHitPlayers"></param> /// <param name="canHitEnemies"></param> /// <param name="spriteSheet"></param> /// <returns></returns> public uint CreateSkillProjectile(SkillType skillP, Vector2 direction, Position position, int rankP, int speed, uint owner, bool canHitPlayers = false, bool canHitEnemies = true, string spriteSheet = null, Rectangle spriteBounds = new Rectangle()) { SkillProjectile skillProjectile; Movement movement; Sprite sprite; Collideable collideable; uint eid = Entity.NextEntity(); direction = Vector2.Normalize(direction); position.EntityID = eid; position.Center += direction * 40; switch (skillP) { #region Vermis Projectiles case SkillType.ThrownBlades: skillProjectile = new SkillProjectile() { EntityID = eid, skill = skillP, maxRange = 1, rank = rankP, CanHitEnemies = canHitEnemies, CanHitPlayers = canHitPlayers, }; movement = new Movement() { EntityID = eid, Direction = direction, Speed = speed, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load <Texture2D>("Spritesheets/Skills/skillPlaceHolder2"), SpriteBounds = new Rectangle(0, 250, 50, 50), }; position.Radius = 10; break; case SkillType.MaliciousParasite: skillProjectile = new SkillProjectile() { EntityID = eid, skill = skillP, maxRange = 1, rank = rankP, CanHitEnemies = canHitEnemies, CanHitPlayers = canHitPlayers, }; movement = new Movement() { EntityID = eid, Direction = direction, Speed = speed, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load <Texture2D>("Spritesheets/Skills/skillPlaceHolder2"), SpriteBounds = new Rectangle(300, 150, 50, 50), }; position.Radius = 10; break; case SkillType.MindlessParasites: skillProjectile = new SkillProjectile() { EntityID = eid, skill = skillP, maxRange = 1, rank = rankP, CanHitEnemies = canHitEnemies, CanHitPlayers = canHitPlayers, }; movement = new Movement() { EntityID = eid, Direction = direction, Speed = speed, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load <Texture2D>("Spritesheets/Skills/skillPlaceHolder2"), SpriteBounds = new Rectangle(250, 50, 50, 50), }; position.Radius = 10; break; case SkillType.BenignParasite: skillProjectile = new SkillProjectile() { EntityID = eid, skill = skillP, maxRange = 1, rank = rankP, CanHitEnemies = canHitEnemies, CanHitPlayers = canHitPlayers, }; movement = new Movement() { EntityID = eid, Direction = direction, Speed = speed, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load <Texture2D>("Spritesheets/Skills/skillPlaceHolder2"), SpriteBounds = new Rectangle(100, 0, 50, 50), }; position.Radius = 10; break; #endregion #region Cultist Projectiles #region Psionic Spear case SkillType.PsionicSpear: { skillProjectile = new SkillProjectile() { EntityID = eid, skill = skillP, maxRange = 1, rank = rankP, OwnerID = owner, }; movement = new Movement() { EntityID = eid, Direction = direction, Speed = speed, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load <Texture2D>("Spritesheets/Skills/skillPlaceHolder2"), SpriteBounds = new Rectangle(100, 0, 50, 50), }; position.Radius = 10; break; } #endregion #region Enslave case SkillType.Enslave: { skillProjectile = new SkillProjectile() { EntityID = eid, skill = skillP, maxRange = 1, rank = rankP, OwnerID = owner, }; movement = new Movement() { EntityID = eid, Direction = direction, Speed = speed, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load <Texture2D>("Spritesheets/Skills/skillPlaceHolder2"), SpriteBounds = new Rectangle(100, 0, 50, 50), }; position.Radius = 10; break; } #endregion #region Taint case SkillType.Taint: { skillProjectile = new SkillProjectile() { EntityID = eid, skill = skillP, maxRange = 1, rank = rankP, OwnerID = owner, }; movement = new Movement() { EntityID = eid, Direction = direction, Speed = speed, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load <Texture2D>("Spritesheets/Skills/skillPlaceHolder2"), SpriteBounds = new Rectangle(100, 0, 50, 50), }; position.Radius = 10; break; } #endregion #region Rot case SkillType.Rot: { skillProjectile = new SkillProjectile() { EntityID = eid, skill = skillP, maxRange = 1, rank = rankP, OwnerID = owner, }; movement = new Movement() { EntityID = eid, Direction = direction, Speed = speed, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load <Texture2D>("Spritesheets/Skills/skillPlaceHolder2"), SpriteBounds = new Rectangle(100, 0, 50, 50), }; position.Radius = 10; break; } #endregion #endregion case SkillType.SniperShot: skillProjectile = new SkillProjectile() { EntityID = eid, skill = skillP, maxRange = 800, rank = rankP, CanHitEnemies = canHitEnemies, CanHitPlayers = canHitPlayers, }; movement = new Movement() { EntityID = eid, Direction = direction, Speed = speed, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load <Texture2D>("Spritesheets/Skills/Effects/AlienOrb"), SpriteBounds = new Rectangle(0, 0, 20, 20), }; position.Radius = 10; break; case SkillType.BasicRangedAttack: skillProjectile = new SkillProjectile() { EntityID = eid, skill = skillP, maxRange = 800, rank = rankP, CanHitEnemies = canHitEnemies, CanHitPlayers = canHitPlayers, }; movement = new Movement() { EntityID = eid, Direction = direction, Speed = speed, }; sprite = new Sprite() { EntityID = eid, SpriteSheet = game.Content.Load <Texture2D>(spriteSheet), SpriteBounds = spriteBounds, }; position.Radius = 10; break; default: throw new Exception("Not a projectile skill"); } collideable = new Collideable() { EntityID = eid, RoomID = position.RoomID, Bounds = new CircleBounds(position.Center, position.Radius), }; game.SkillProjectileComponent.Add(eid, skillProjectile); game.MovementComponent.Add(eid, movement); game.PositionComponent.Add(eid, position); game.SpriteComponent.Add(eid, sprite); game.CollisionComponent.Add(eid, collideable); return(eid); }
/// <summary> /// Check for collision with rects in all direction of character rect /// </summary> /// <param name="otherObj">Collideable rects</param> public override void Collision(Collideable otherObj) { base.Collision(otherObj); pushing = false; }
/// <summary> /// Check for collision with rects in all direction of character rect /// </summary> /// <param name="otherObj">Collideable rects</param> public override void Collision(Collideable otherObj) { base.Collision(otherObj); }