private static void godmodeisreal(string[] args)
 {
     if (Raft_Network.InMenuScene)
     {
         Debug.Log(Error + "Is In Lobby");
         return;
     }
     godmode = !godmode;
     if (godmode)
     {
         while (RAPI.GetLocalPlayer().Stats.stat_hunger.Normal.Value < 100 || RAPI.GetLocalPlayer().Stats.stat_thirst.Normal.Value < 100 || RAPI.GetLocalPlayer().Stats.stat_health.Value < 100 || RAPI.GetLocalPlayer().Stats.stat_oxygen.GetOxygenLostPerSecond() > 0f)
         {
             RAPI.GetLocalPlayer().Stats.stat_hunger.Normal.Value = 100;
             RAPI.GetLocalPlayer().Stats.stat_health.Value = 100;
             RAPI.GetLocalPlayer().Stats.stat_thirst.Normal.Value = 100;
             RAPI.GetLocalPlayer().Stats.stat_oxygen.Value = 100;
             GameModeValueManager.GetCurrentGameModeValue().nourishmentVariables.foodDecrementRateMultiplier = 0f;
             GameModeValueManager.GetCurrentGameModeValue().nourishmentVariables.thirstDecrementRateMultiplier = 0f;
             RAPI.GetLocalPlayer().Stats.stat_oxygen.SetOxygenLostPerSecond(0f);
             GameModeValueManager.GetCurrentGameModeValue().playerSpecificVariables.damageTakenMultiplier = 0f;
         }
         GameModeValueManager.GetCurrentGameModeValue().nourishmentVariables.foodDecrementRateMultiplier = 0f;
         GameModeValueManager.GetCurrentGameModeValue().nourishmentVariables.thirstDecrementRateMultiplier = 0f;
         RAPI.GetLocalPlayer().Stats.stat_oxygen.SetOxygenLostPerSecond(0f);
         GameModeValueManager.GetCurrentGameModeValue().playerSpecificVariables.damageTakenMultiplier = 0f;
     }
     else
     {
         GameModeValueManager.GetCurrentGameModeValue().nourishmentVariables.foodDecrementRateMultiplier = 1f;
         GameModeValueManager.GetCurrentGameModeValue().nourishmentVariables.thirstDecrementRateMultiplier = 1f;
         RAPI.GetLocalPlayer().Stats.stat_oxygen.SetOxygenLostPerSecond(1f);
         GameModeValueManager.GetCurrentGameModeValue().playerSpecificVariables.damageTakenMultiplier = 1f;
     }
 }
Beispiel #2
0
 public void OnModUnload()
 {
     if (GameModeValueManager.GetCurrentGameModeValue().gameMode != GameMode.Easy)
     {
         GameModeValueManager.GetCurrentGameModeValue().playerSpecificVariables.clearInventoryOnSurrender = true;
     }
     RConsole.Log("InvPersist has been unloaded!");
     Destroy(gameObject); // Please do not remove that line!
 }
Beispiel #3
0
    public void Update()
    {
        if (Semih_Network.InLobbyScene)
        {
            return;
        }
        if (MyInput.GetButtonDown("Sprint"))
        {
            sprinted = !sprinted;
            if (sprinted)
            {
                if (RAPI.GetLocalPlayer().PersonController.controllerType != ControllerType.Water)
                {
                    return;
                }

                float sS = 1f;
                sS *= (RAPI.GetLocalPlayer().PlayerEquipment.GetEquipedIndexes().Contains(63) ? 1.4f : 1f);
                if (sS == 1f)
                {
                    sS = 0f;
                }
                theSpeed = RAPI.GetLocalPlayer().PersonController.swimSpeed;
                if (RAPI.GetLocalPlayer().PersonController.swimSpeed > 10)
                {
                    FindObjectOfType <HNotify>().AddNotification(HNotify.NotificationType.normal, "Swim Sprint : You can't actually Sprint when your swimming speed is more than the sprint itself ;-;", 2, HNotify.ErrorSprite).SetCloseDelay(2).SetTextColor(Color.red);
                    return;
                }
                else if (RAPI.GetLocalPlayer().PersonController.swimSpeed > 2 && RAPI.GetLocalPlayer().PersonController.swimSpeed < 10)
                {
                    RAPI.GetLocalPlayer().PersonController.swimSpeed = 10 + sS;
                    RAPI.GetLocalPlayer().PersonController.swimSpeed = (2 * 5) + sS;
                    GameModeValueManager.GetCurrentGameModeValue().nourishmentVariables.foodDecrementRateMultiplier = 1.2f;
                    GameModeValueManager.GetCurrentGameModeValue().nourishmentVariables.thirstDecrementRateMultiplier = 1.2f;
                    RAPI.GetLocalPlayer().Stats.stat_oxygen.SetOxygenLostPerSecond(1.25f);
                    return;
                }
                RAPI.GetLocalPlayer().PersonController.swimSpeed = 10 + sS;
                GameModeValueManager.GetCurrentGameModeValue().nourishmentVariables.foodDecrementRateMultiplier = 1.3f;
                GameModeValueManager.GetCurrentGameModeValue().nourishmentVariables.thirstDecrementRateMultiplier = 1.3f;
                RAPI.GetLocalPlayer().Stats.stat_oxygen.SetOxygenLostPerSecond(1.5f);
            }
        }
        else if (MyInput.GetButtonUp("Sprint"))
        {
            sprinted = !sprinted;
            if (theSpeed < 2)
            {
                theSpeed = 2;
            }
            RAPI.GetLocalPlayer().PersonController.swimSpeed = theSpeed;
            GameModeValueManager.GetCurrentGameModeValue().nourishmentVariables.foodDecrementRateMultiplier = 1f;
            GameModeValueManager.GetCurrentGameModeValue().nourishmentVariables.thirstDecrementRateMultiplier = 1f;
            RAPI.GetLocalPlayer().Stats.stat_oxygen.SetOxygenLostPerSecond(1f);
        }
    }
Beispiel #4
0
    public void SetGameMode(int value)
    {
        string newGM = "";

        switch (value)
        {
        case 0:
        {
            newGM = "Creative";
            break;
        }

        case 1:
        {
            newGM = "Peaceful";
            break;
        }

        case 2:
        {
            newGM = "Easy";
            break;
        }

        case 3:
        {
            newGM = "Normal";
            break;
        }

        case 4:
        {
            newGM = "Hardcore";
            break;
        }

        default: break;
        }
        GameMode mode;

        if (newGM != "" && !GameModeValueManager.GetCurrentGameModeValue().name.Contains(newGM) && GameMode.TryParse(newGM, out mode))
        {
            GameModeValueManager.SelectCurrentGameMode(mode);
            FindObjectOfType <RNotify>().AddNotification(RNotify.NotificationType.normal, string.Format("Gamemode changed to {0}", newGM), 3, RNotify.CheckSprite);
        }
    }
 public void Update()
 {
     if (godmode)
     {
         if (RAPI.GetLocalPlayer().Stats.stat_hunger.Normal.Value < 100 || RAPI.GetLocalPlayer().Stats.stat_thirst.Normal.Value < 100 || RAPI.GetLocalPlayer().Stats.stat_health.Value < 100 || RAPI.GetLocalPlayer().Stats.stat_oxygen.GetOxygenLostPerSecond() > 0f)
         {
             RAPI.GetLocalPlayer().Stats.stat_hunger.Normal.Value = 100;
             RAPI.GetLocalPlayer().Stats.stat_health.Value = 100;
             RAPI.GetLocalPlayer().Stats.stat_thirst.Normal.Value = 100;
             RAPI.GetLocalPlayer().Stats.stat_oxygen.Value = 100;
             GameModeValueManager.GetCurrentGameModeValue().nourishmentVariables.foodDecrementRateMultiplier = 0f;
             GameModeValueManager.GetCurrentGameModeValue().nourishmentVariables.thirstDecrementRateMultiplier = 0f;
             RAPI.GetLocalPlayer().Stats.stat_oxygen.SetOxygenLostPerSecond(0f);
             GameModeValueManager.GetCurrentGameModeValue().playerSpecificVariables.damageTakenMultiplier = 0f;
         }
     }
 }
Beispiel #6
0
    public void RefreshUI()
    {
        UI_sliders[0].value = settings.durabilityMultiplier;
        UI_sliders[1].value = settings.stackSizeMultiplier;
        UI_sliders[2].value = settings.foodDecrementRateMultiplier;
        UI_sliders[3].value = settings.thirstDecrementRateMultiplier;
        UI_sliders[4].value = settings.sharkDamageMultiplier;
        UI_sliders[5].value = settings.biteRaftIntervalMultiplier;

        UI_checkboxes[0].isOn = settings.sharkDisabled;
        UI_checkboxes[1].isOn = settings.disableSharkBitingRaft;
        UI_checkboxes[2].isOn = settings.disableFastSharkSpawn;
        UI_checkboxes[3].isOn = settings.enableDolphinJumping;
        UI_checkboxes[4].isOn = settings.fallDmgDisabled;
        UI_checkboxes[5].isOn = settings.cheatsEnabled;

        string CurrentGM   = GameModeValueManager.GetCurrentGameModeValue().name;
        int    CurrentGM_N = -1;

        if (CurrentGM.Contains("Creative"))
        {
            CurrentGM_N = 0;
        }
        if (CurrentGM.Contains("Peaceful"))
        {
            CurrentGM_N = 1;
        }
        if (CurrentGM.Contains("Easy"))
        {
            CurrentGM_N = 2;
        }
        if (CurrentGM.Contains("Normal"))
        {
            CurrentGM_N = 3;
        }
        if (CurrentGM.Contains("Hardcore"))
        {
            CurrentGM_N = 4;
        }
        if (CurrentGM_N != -1)
        {
            UI_dropdown.value = CurrentGM_N;
        }
    }
 public void OnModUnload()
 {
     Debug.Log(UnLoaded);
     if (!Raft_Network.InMenuScene)
     {
         Raft raft = ComponentManager <Raft> .Value;
         if (raft != null)
         {
             var defaultRaftSpeed = defaultSpeed * defaultRaft;
             raft.maxSpeed        = defaultRaftSpeed;
             raft.maxVelocity     = defaultRaftSpeed;
             raft.waterDriftSpeed = defaultRaftSpeed;
             changedRaft          = defaultRaftSpeed;
             if (anchored)
             {
             }
             else
             {
                 ComponentManager <Raft> .Value.RemoveAnchor(10);
             }
         }
         if (godmode)
         {
             GameModeValueManager.GetCurrentGameModeValue().nourishmentVariables.foodDecrementRateMultiplier = 1f;
             GameModeValueManager.GetCurrentGameModeValue().nourishmentVariables.thirstDecrementRateMultiplier = 1f;
             RAPI.GetLocalPlayer().Stats.stat_oxygen.SetOxygenLostPerSecond(1f);
             GameModeValueManager.GetCurrentGameModeValue().playerSpecificVariables.damageTakenMultiplier = 1f;
         }
         else
         {
         }
         RAPI.GetLocalPlayer().PersonController.normalSpeed = 3;
         RAPI.GetLocalPlayer().PersonController.sprintSpeed = 6;
         RAPI.GetLocalPlayer().PersonController.swimSpeed = 2;
     }
 }
Beispiel #8
0
 public override void WorldEvent_WorldLoaded()
 {
     GameModeValueManager.GetCurrentGameModeValue().playerSpecificVariables.clearInventoryOnSurrender = false;
 }
    private static bool Prefix
    (
        Raft __instance,
        ref Rigidbody ___body,
        ref float ___currentMovementSpeed,
        ref float ___speed,
        ref float ___maxDistanceFromAnchorPoint,
        ref StudioEventEmitter ___eventEmitter_idle,
        ref Vector3 ___previousPosition,
        ref Vector3 ___moveDirection,
        ref Vector3 ___anchorPosition
    )
    {
        if (!Semih_Network.IsHost)
        {
            return(false);
        }
        if (GameModeValueManager.GetCurrentGameModeValue().raftSpecificVariables.isRaftAlwaysAnchored)
        {
            return(false);
        }
        if (!__instance.IsAnchored)
        {
            if (___speed != 0f)
            {
                float openedSails = 0f;
                ___moveDirection = Vector3.forward;
                if (RaftVelocityManager.MotorDirection == Vector3.zero)
                {
                    List <Sail> allSails = Sail.AllSails;

                    Vector3 vector = Vector3.zero;

                    for (int i = 0; i < allSails.Count; i++)
                    {
                        Sail sail = allSails[i];
                        if (sail.open)
                        {
                            openedSails++;
                            vector += sail.GetNormalizedDirection();
                        }
                    }
                    if (vector.z < 0f)
                    {
                        if ((double)Mathf.Abs(vector.x) > 0.7)
                        {
                            vector.z = (___moveDirection.z = 0f);
                        }
                        else
                        {
                            vector.z = -0.8f;
                        }
                    }
                    ___moveDirection += vector;
                }
                else
                {
                    ___moveDirection = RaftVelocityManager.MotorDirection;
                }
                ___currentMovementSpeed = ___speed;
                if (RaftVelocityManager.MotorDirection != Vector3.zero)
                {
                    ___currentMovementSpeed = RaftVelocityManager.motorSpeed;
                    if (RaftVelocityManager.MotorWheelWeightStrength == MotorWheel.WeightStrength.Weak)
                    {
                        ___currentMovementSpeed *= 0.5f;
                    }
                    if (___currentMovementSpeed < ___speed)
                    {
                        ___currentMovementSpeed = ___speed;
                    }
                }
                else
                {
                    for (float i = 1; i < (openedSails + 1); i++)
                    {
                        ___currentMovementSpeed += (1.5f * (float)(i / Math.Pow(i, MoreSailsMoreSpeed.RaftFixedUpdatePatchRate)));
                    }
                }
                if (___speed != 0f)
                {
                    if (___currentMovementSpeed > __instance.maxSpeed)
                    {
                        ___currentMovementSpeed = __instance.maxSpeed;
                    }
                    ___moveDirection = Vector3.ClampMagnitude(___moveDirection, 1f);
                    ___body.AddForce(___moveDirection * ___currentMovementSpeed);
                }
            }
            List <SteeringWheel> steeringWheels = RaftVelocityManager.steeringWheels;
            float num = 0f;
            foreach (SteeringWheel steeringWheel in steeringWheels)
            {
                num += steeringWheel.SteeringRotation;
            }
            num = Mathf.Clamp(num, -1f, 1f);
            if (num != 0f)
            {
                Vector3 torque = new Vector3(0f, Mathf.Tan(0.0174532924f * num), 0f) * __instance.maxSteeringTorque;
                ___body.AddTorque(torque, ForceMode.Acceleration);
            }
        }
        else if (__instance.transform.position.DistanceXZ(___anchorPosition) > ___maxDistanceFromAnchorPoint)
        {
            Vector3 vector2 = ___anchorPosition - __instance.transform.position;
            vector2.y = 0f;
            ___body.AddForce(vector2.normalized * 2f);
        }
        if (___body.velocity.sqrMagnitude > __instance.maxVelocity)
        {
            ___body.velocity = Vector3.ClampMagnitude(___body.velocity, __instance.maxVelocity);
        }
        ___eventEmitter_idle.SetParameter("velocity", ___body.velocity.sqrMagnitude / __instance.maxVelocity);
        ___previousPosition = ___body.transform.position;
        return(false);
    }
Beispiel #10
0
 static public bool isUnlimitedResources()
 {
     return(GameModeValueManager.GetCurrentGameModeValue().playerSpecificVariables.unlimitedResources);
 }