Adds ClumsyComponent.TryRollClumsy helper method.

This commit is contained in:
Pieter-Jan Briers
2021-01-23 17:54:58 +01:00
parent 6635054cac
commit 1eb5af6449
2 changed files with 28 additions and 3 deletions

View File

@@ -161,9 +161,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged
_lastFireTime = curTime;
if (ClumsyCheck &&
user.HasComponent<ClumsyComponent>() &&
_random.Prob(ClumsyExplodeChance))
if (ClumsyCheck && ClumsyComponent.TryRollClumsy(user, ClumsyExplodeChance))
{
var soundSystem = EntitySystem.Get<AudioSystem>();
soundSystem.PlayAtCoords("/Audio/Items/bikehorn.ogg",