private void UpdateFireStrategy(float playerTime) { if (FireStrategies.Index != FireStrategyIndexBasic) { if (WeaponResetTimer.UpdateActivates(playerTime)) { SetFireType(FireStrategyIndexBasic, skipMessage: true); } } }
public void SetFireType(int index, bool skipDropDown = false, bool skipMessage = false, bool endlessTime = false) { // Immediately fire BFG if it's charging if (BfgBulletSpawner.Instance.isActiveAndEnabled) { FireCurrentStrategy(0f); } FireStrategies.Index = index; CurrentFireStrategy.Reset(); CurrentFireStrategy.OnActivate(); if (!skipDropDown) { DebugUi.SetDropdownFiretype(FireStrategies.Index, true, endlessTime); } WeaponResetTimer.Reset(); if (index != DefaultFireTypeIndex) { if (endlessTime) { WeaponResetTimer.ActivationInterval = float.MaxValue; } else { WeaponResetTimer.ActivationInterval = InitialWeaponTime; } } else { WeaponResetTimer.ActivationInterval = InitialWeaponTime; } if (!skipMessage) { NotificationManager.AddNotification(CurrentFireStrategy.NotificationName(WeaponLevel)); } if (endlessTime) { SaveUtil.LastWeapon = index; } }