public ManhandlaHead(IEnemy body, Physics.Direction side) { parent = body; RandomStateGenerator = new RandomStateGenerator(this); States = new Dictionary <RandomStateGenerator.StateType, int>(GameData.Instance.EnemyStateWeights.ManhandlaHeadStateList); Health = new HealthManager(GameData.Instance.EnemyHealthConstants.ManhandlaHeadHealth); Physics = new Physics(body.Physics.Bounds.Center.ToVector2()); Physics.Mass = GameData.Instance.EnemyMassConstants.DragonMass; Physics.IsMovable = false; Physics.CurrentDirection = side; Physics.Bounds = new Rectangle((int)Physics.Location.X, (int)Physics.Location.Y, EnemySpriteFactory.GetEnemyWidth(this), EnemySpriteFactory.GetEnemyHeight(this)); Setup(); CurrentState = new IdleEnemyState(this); EnemyCollisionHandler = new EnemyCollisionHandler(this); Expired = false; Damage = GameData.Instance.EnemyDamageConstants.DragonDamage; MoveSpeed = 0; CurrentTint = LoZGame.Instance.DefaultTint; IsBossPart = true; AI = EnemyAI.ManHandlaHead; IsSpawning = false; buffedParent = false; DropTable = GameData.Instance.EnemyDropTables.EmptyDropTable; ApplyDamageMod(); ApplyLargeWeightModPos(); ApplyLargeHealthMod(); }
/// <inheritdoc></inheritdoc> public override void TransitionRoom(Physics.Direction direction) { if (!(LoZGame.Instance.Players[0].State is SwallowedState)) { LoZGame.Instance.GameState = new TransitionRoomState(direction); } }
// Wizzrobe Sprites public ISprite CreateRedWizzrobeSprite(Physics.Direction direction) { switch (direction) { case Physics.Direction.North: return new ObjectSprite(redWizzrobeUpTexture, wizzrobeData); case Physics.Direction.East: return new ObjectSprite(redWizzrobeRightTexture, wizzrobeData); default: return new ObjectSprite(redWizzrobeLeftTexture, wizzrobeData); } }
public void UpdateRedWizzrobe() { Physics.Direction oldDirection = Enemy.Physics.CurrentDirection; FacePlayer(); Physics.Direction newDirection = Enemy.Physics.CurrentDirection; if (oldDirection != newDirection) { Enemy.CreateCorrectSprite(); } DefaultUpdate(); }
public ISprite CreateRedDarknutSprite(Physics.Direction direction) { switch (direction) { case Physics.Direction.North: return new ObjectSprite(upRedDarknut, upDarknutData); case Physics.Direction.South: return new ObjectSprite(downRedDarknut, downDarknutData); case Physics.Direction.East: return new ObjectSprite(rightRedDarknut, rightDarknutData); default: return new ObjectSprite(leftRedDarknut, leftDarknutData); } }
public ISprite CreateManhandlaHeadSprite(Physics.Direction direction) { switch (direction) { case Physics.Direction.North: return new ObjectSprite(manhandlaHeadUpTexture, manhandlaHeadData); case Physics.Direction.South: return new ObjectSprite(manhandlaHeadDownTexture, manhandlaHeadData); case Physics.Direction.East: return new ObjectSprite(manhandlaHeadRightTexture, manhandlaHeadData); default: return new ObjectSprite(manhandlaHeadLeftTexture, manhandlaHeadData); } }
// Goriya Sprites public ISprite CreateGoriyaSprite(Physics.Direction direction) { switch (direction) { case Physics.Direction.North: return new ObjectSprite(upGoriya, upGoriyaData); case Physics.Direction.South: return new ObjectSprite(downGoriya, downGoriyaData); case Physics.Direction.East: return new ObjectSprite(rightGoriya, rightGoriyaData); default: return new ObjectSprite(leftGoriya, leftGoriyaData); } }
// DigDogger Sprites public ISprite CreateLargeDigDogger(Physics.Direction direction) { switch (direction) { case Physics.Direction.West: case Physics.Direction.NorthWest: case Physics.Direction.SouthWest: case Physics.Direction.North: return new ObjectSprite(digDoggerLeft, movingDigDoggerData); case Physics.Direction.East: case Physics.Direction.NorthEast: case Physics.Direction.SouthEast: case Physics.Direction.South: return new ObjectSprite(digDoggerRight, movingDigDoggerData); default: return new ObjectSprite(digDoggerIdle, idleDigDoggerData); } }
public ISprite CreateSmallDigDogger(Physics.Direction direction) { return new ObjectSprite(smallDigDogger, smallDigDoggerData); }
public TransitionRoomState(Physics.Direction direction) { // initialize the variables and directions we need to check for a transition oldObjects = LoZGame.Instance.GameObjects; newObjects = new GameObjectManager(); done = false; transitionDistance = 0; dungeon = LoZGame.Instance.Dungeon; currentRoomLocation = new Point(dungeon.CurrentRoomX, dungeon.CurrentRoomY); currentRoomBorderOffset = Vector2.Zero; puzzleDoors = new List <IDoor>(); specialDoors = new List <IDoor>(); foreach (IPlayer player in LoZGame.Instance.Players) { player.Physics.KnockbackVelocity = Vector2.Zero; } // finds the room we are transitioning to, and sets the variables needed to transition to it switch (direction) { case Physics.Direction.North: transitionDistance = YTransition; nextRoomLocation = new Point(currentRoomLocation.X, currentRoomLocation.Y - 1); nextRoomOffset = new Point(0, -YTransition); break; case Physics.Direction.South: transitionDistance = YTransition; nextRoomLocation = new Point(currentRoomLocation.X, currentRoomLocation.Y + 1); nextRoomOffset = new Point(0, YTransition); break; case Physics.Direction.East: transitionDistance = XTransition; nextRoomLocation = new Point(currentRoomLocation.X + 1, currentRoomLocation.Y); nextRoomOffset = new Point(XTransition, 0); break; case Physics.Direction.West: transitionDistance = XTransition; nextRoomLocation = new Point(currentRoomLocation.X - 1, currentRoomLocation.Y); nextRoomOffset = new Point(-XTransition, 0); break; } // loads the nextroom NextRoom = dungeon.GetRoom(nextRoomLocation.Y, nextRoomLocation.X); nextRoomBorderOffset = nextRoomOffset.ToVector2(); // checks that the next room actually exists before transitioning if (NextRoom.Exists) { MasterMovement = new Vector2((float)(-1 * nextRoomOffset.X) / transitionSpeed, (float)(-1 * nextRoomOffset.Y) / transitionSpeed); oldObjects.Entities.Clear(); dungeon.LoadNewRoom(newObjects, nextRoomLocation, nextRoomOffset); // assigns players movement velocity based on transition direction foreach (IPlayer player in LoZGame.Instance.Players) { switch (direction) { case Physics.Direction.North: player.MoveUp(); player.Physics.MovementVelocity = new Vector2(0, -(float)maxPlayerMovement / transitionSpeed); break; case Physics.Direction.South: player.MoveDown(); player.Physics.MovementVelocity = new Vector2(0, (float)maxPlayerMovement / transitionSpeed); break; case Physics.Direction.East: player.MoveRight(); player.Physics.MovementVelocity = new Vector2((float)maxPlayerMovement / transitionSpeed, 0); break; case Physics.Direction.West: player.MoveLeft(); player.Physics.MovementVelocity = new Vector2(-(float)maxPlayerMovement / transitionSpeed, 0); break; } player.Physics.MovementVelocity += MasterMovement; } // sets moveement velocity for all other objects apart from player; oldObjects.SetObjectMovement(MasterMovement); newObjects.SetObjectMovement(MasterMovement); // sets doors to draw on the top level foreach (IDoor door in oldObjects.Doors.DoorList) { door.Physics.Depth = 1; } foreach (IDoor door in newObjects.Doors.DoorList) { door.Physics.Depth = 1; } // opens all special and puzzle doors in the room we are entering foreach (IDoor door in newObjects.Doors.DoorList) { if (door.DoorType == Door.DoorTypes.Special) { specialDoors.Add(door); door.Open(); } } foreach (IDoor door in newObjects.Doors.DoorList) { if (door.DoorType == Door.DoorTypes.Puzzle) { puzzleDoors.Add(door); door.Open(); } } } // plays game if the room does not exist else { PlayGame(); } }
/// <inheritdoc></inheritdoc> public virtual void TransitionRoom(Physics.Direction direction) { }
/** * \brief Simulates bouncing off walls. * * \param Physics.Direction wallPlacement : Where the wall it, * relative to the object that holds this velocity * * \return void */ public void Reflect(Physics.Direction wallPlacement) { vel = Physics.CircleBounce(vel, wallPlacement); }