protected override bool ValidateState(Contexts contexts, PlayerEntity player) { player.gamePlay.GameState = player.playerSkyMove.GameState; if (!player.playerSkyMove.IsParachuteAttached) { _logger.Warn("Sky Parachuting State is not valid."); PlayerSkyMoveUtility.AttachParachute(contexts, player, true); if (!player.playerSkyMove.IsParachuteAttached) { if (CheckLandCondition(player)) { _logger.InfoFormat("SKyDive Rollback: Parachuting To Landing State"); player.playerSkyMove.MoveStage = (int)SkyMoveStage.Landing; } else { _logger.InfoFormat("SKyDive Rollback: Parachuting To Gliding State"); player.playerSkyMove.MoveStage = (int)SkyMoveStage.Gliding; } return(false); } } return(true); }
public static void ValidateStateAfterUpdate(Contexts contexts, PlayerEntity player) { if (!player.playerSkyMove.IsMoveEnabled && player.playerSkyMove.IsParachuteAttached) { PlayerSkyMoveUtility.DetachParachute(contexts, player); } }
private void CommonSkyMoveLand(Contexts contexts, PlayerEntity player) { _logger.DebugFormat("SKyDive: Detach Parachute To Landing State"); player.stateInterface.State.ParachutingEnd(); PlayerSkyMoveUtility.DetachParachute(contexts, player); }
protected override bool ValidateState(Contexts contexts, PlayerEntity player) { player.gamePlay.GameState = player.playerSkyMove.GameState; if (player.playerSkyMove.IsParachuteAttached) { _logger.Warn("Sky Gliding State is not valid."); PlayerSkyMoveUtility.DetachParachute(contexts, player); } return(true); }
protected override bool ValidateState(Contexts contexts, PlayerEntity player) { if (player.playerSkyMove.GameState != -1) { player.gamePlay.GameState = player.playerSkyMove.GameState; } if (player.playerSkyMove.IsParachuteAttached) { _logger.Warn("Sky Start State is not valid."); PlayerSkyMoveUtility.DetachParachute(contexts, player); // player.playerSkyMove.MoveStage = (int) SkyMoveStage.Parachuting; // return false; } return(true); }
private void ServerOpenParachute(Contexts contexts, PlayerEntity player) { var playerSkyMove = player.playerSkyMove; _logger.DebugFormat("server " + "OpenParachute-----------------------------------------------------------------,{0}," + " IsWaitForAttach:{1},IsParachuteAttached:{2} ", playerSkyMove.IsReadyForAttachParachute(), playerSkyMove.IsWaitForAttach, playerSkyMove.IsParachuteAttached); if (playerSkyMove.IsReadyForAttachParachute()) { player.stateInterface.State.Parachuting(() => { _logger.DebugFormat("server Parachuting call " + "back-----------------------------------------------------------------"); PlayerSkyMoveUtility.AttachParachute(contexts, player, false); }); } else if (!playerSkyMove.IsParachuteLoading && playerSkyMove.Parachute == null) { PlayerSkyMoveUtility.DelayLoadParachute(player, contexts); } }
protected void OpenParachute(Contexts contexts, PlayerEntity player) { var playerSkyMove = player.playerSkyMove; _logger.DebugFormat("OpenParachute-----------------------------------------------------------------,{0}," + " IsWaitForAttach:{1},IsParachuteAttached:{2} ", playerSkyMove.IsReadyForAttachParachute(), playerSkyMove.IsWaitForAttach, playerSkyMove.IsParachuteAttached); if (playerSkyMove.IsReadyForAttachParachute()) { player.stateInterface.State.Parachuting(() => { _logger.DebugFormat("Parachuting call " + "back-----------------------------------------------------------------"); PlayerSkyMoveUtility.AttachParachute(contexts, player, false); }); player.soundManager.Value.PlayOnce(EPlayerSoundType.OpenParachute); playerSkyMove.IsWaitForAttach = true; } else if (!playerSkyMove.IsParachuteLoading && playerSkyMove.Parachute == null) { PlayerSkyMoveUtility.DelayLoadParachute(player, contexts); playerSkyMove.IsParachuteLoading = true; } }
protected void OpenParachute(Contexts contexts, PlayerEntity player) { var playerSkyMove = player.playerSkyMove; _logger.DebugFormat("OpenParachute-----------------------------------------------------------------,{0}," + " IsWaitForAttach:{1},IsParachuteAttached:{2} ", playerSkyMove.IsReadyForAttachParachute(), playerSkyMove.IsWaitForAttach, playerSkyMove.IsParachuteAttached); if (playerSkyMove.IsReadyForAttachParachute()) { player.stateInterface.State.Parachuting(() => { _logger.DebugFormat("Parachuting call " + "back-----------------------------------------------------------------"); PlayerSkyMoveUtility.AttachParachute(contexts, player, false); }); player.AudioController().PlaySimpleAudio((EAudioUniqueId)5029, true); playerSkyMove.IsWaitForAttach = true; } else if (!playerSkyMove.IsParachuteLoading && playerSkyMove.Parachute == null) { PlayerSkyMoveUtility.DelayLoadParachute(player, contexts); playerSkyMove.IsParachuteLoading = true; } }