refactor + lessen stamina usage
This commit is contained in:
parent
a8063216cc
commit
2f483ca113
@ -16,6 +16,17 @@ public class DisableStaminaRegenEffect : CustomPlayerEffect, IStaminaModifier
|
|||||||
public override EffectClassification Classification => EffectClassification.Negative;
|
public override EffectClassification Classification => EffectClassification.Negative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class BloodFueledStaminaEffect : CustomPlayerEffect, IStaminaModifier
|
||||||
|
{
|
||||||
|
public bool StaminaModifierActive => IsEnabled;
|
||||||
|
public float StaminaUsageMultiplier => 0.1f;
|
||||||
|
|
||||||
|
public float StaminaRegenMultiplier => 1;
|
||||||
|
public bool SprintingDisabled => false;
|
||||||
|
|
||||||
|
public override EffectClassification Classification => EffectClassification.Negative;
|
||||||
|
}
|
||||||
|
|
||||||
public class BloodFueledManager
|
public class BloodFueledManager
|
||||||
{
|
{
|
||||||
private readonly CustomClasses _plugin;
|
private readonly CustomClasses _plugin;
|
||||||
|
@ -30,16 +30,24 @@ public abstract class CustomPlayerEffect : StatusEffectBase
|
|||||||
|
|
||||||
_isLoaded = true;
|
_isLoaded = true;
|
||||||
|
|
||||||
var playerEffects = NetworkManager.singleton.playerPrefab.GetComponent<ReferenceHub>().playerEffectsController.effectsGameObject.transform;
|
Type[] toLoad =
|
||||||
var type = typeof(DisableStaminaRegenEffect);
|
[
|
||||||
if (!typeof(StatusEffectBase).IsAssignableFrom(type))
|
typeof(DisableStaminaRegenEffect),
|
||||||
{
|
typeof(BloodFueledStaminaEffect)
|
||||||
Logger.Error($"[CustomPlayerEffect.Initialize] {type.FullName} is not a valid StatusEffectBase and thus could not be registered!");
|
];
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// register effect into prefab
|
var playerEffects = NetworkManager.singleton.playerPrefab.GetComponent<ReferenceHub>().playerEffectsController.effectsGameObject.transform;
|
||||||
new GameObject(type.Name, type).transform.parent = playerEffects;
|
foreach (var type in toLoad)
|
||||||
|
{
|
||||||
|
if (!typeof(StatusEffectBase).IsAssignableFrom(type))
|
||||||
|
{
|
||||||
|
Logger.Error($"[CustomPlayerEffect.Initialize] {type.FullName} is not a valid StatusEffectBase and thus could not be registered!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// register effect into prefab
|
||||||
|
new GameObject(type.Name, type).transform.parent = playerEffects;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user