Add slow motion to killstreak

This commit is contained in:
Sofia 2019-08-23 00:12:49 +03:00
parent 7c49762506
commit a06b0ee648
3 changed files with 71 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@ -525,7 +525,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c0a7560055c54ab479467ce5b1c7cfcd, type: 3} m_Script: {fileID: 11500000, guid: c0a7560055c54ab479467ce5b1c7cfcd, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
Player: {fileID: 8489029732530782806}
MaxFun: 100 MaxFun: 100
FunDegradeSpeed: 4 FunDegradeSpeed: 4
StandingStillMultiplier: 1.5 StandingStillMultiplier: 1.5
@ -536,6 +535,8 @@ MonoBehaviour:
DebugAdd10Fun: 0 DebugAdd10Fun: 0
DebugSubtract10Fun: 0 DebugSubtract10Fun: 0
GodMode: 0 GodMode: 0
DebugAddKill: 0
KillStreakTimer: 5
--- !u!114 &7263640616704110489 --- !u!114 &7263640616704110489
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -553,6 +554,8 @@ MonoBehaviour:
MaxSpeed: 7 MaxSpeed: 7
AccelerationSpeed: 70 AccelerationSpeed: 70
DecelerationSpeed: 70 DecelerationSpeed: 70
AnimationSpeedModifier: 0
AnimationSpeed: 0
--- !u!114 &5620918083888341557 --- !u!114 &5620918083888341557
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -2,11 +2,14 @@
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.SceneManagement; using UnityEngine.SceneManagement;
using Saltosion.OneWeapon.Effects;
namespace Saltosion.OneWeapon.Player { namespace Saltosion.OneWeapon.Player {
[RequireComponent(typeof(PlayerController))]
public class PlayerFun : MonoBehaviour { public class PlayerFun : MonoBehaviour {
public PlayerController Player; private PlayerController Player;
private CameraFX CameraFX;
public float MaxFun = 100; public float MaxFun = 100;
public float FunDegradeSpeed = 5; public float FunDegradeSpeed = 5;
@ -26,11 +29,13 @@ namespace Saltosion.OneWeapon.Player {
public float CurrentDamageBoost { private set; get; } public float CurrentDamageBoost { private set; get; }
public float KillStreakTimer = 1; public float KillStreakTimer = 2;
public int KillStreak { private set; get; } public int KillStreak { private set; get; }
public float CurrentKillStreakTime { private set; get; } public float CurrentKillStreakTime { private set; get; }
void Start() { void Start() {
Player = GetComponent<PlayerController>();
CameraFX = Camera.main.GetComponent<CameraFX>();
CurrentFun = MaxFun * 0.75f; CurrentFun = MaxFun * 0.75f;
} }
@ -117,6 +122,9 @@ namespace Saltosion.OneWeapon.Player {
public void GainKill() { public void GainKill() {
KillStreak += 1; KillStreak += 1;
CurrentKillStreakTime = KillStreakTimer; CurrentKillStreakTime = KillStreakTimer;
if (KillStreak > 3) {
CameraFX.SlowMotion(0.4f, Mathf.Min(KillStreak * 0.05f, 0.5f));
}
} }
} }
} }