Add GodMode and bind F10 to it

This commit is contained in:
Sofia 2019-08-07 22:31:43 +03:00
parent 086a47af72
commit a1950a7b7a
2 changed files with 18 additions and 4 deletions

View File

@ -20,6 +20,8 @@ namespace Saltosion.OneWeapon {
public float CurrentFun { private set; get; }
public bool DebugAdd10Fun = false;
public bool DebugSubtract10Fun = false;
public bool GodMode = false;
public float CurrentDamageBoost { private set; get; }
@ -28,16 +30,28 @@ namespace Saltosion.OneWeapon {
}
void Update() {
// God mode hotkey
if (Input.GetButtonUp("GodModeToggle")) {
GodMode = !GodMode;
}
float Delta = FunDegradeSpeed * Time.deltaTime;
if (!Player.IsMoving) {
Delta *= StandingStillMultiplier;
}
float NewFun = CurrentFun - Delta;
float NewFun = CurrentFun;
if (!GodMode) {
NewFun -= Delta;
}
if (DebugAdd10Fun) {
NewFun += 10;
DebugAdd10Fun = false;
}
if (DebugSubtract10Fun) {
NewFun -= 10;
DebugSubtract10Fun = false;
}
CurrentFun = Mathf.Clamp(NewFun, 0, MaxFun);

View File

@ -70,13 +70,13 @@ InputManager:
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire3
m_Name: GodModeToggle
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: left shift
positiveButton: f10
altNegativeButton:
altPositiveButton: mouse 2
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000