Merge pull request #911 from Zumorica/2020-05-13-stuns

Adds StunnableComponent, Stunbaton...
This commit is contained in:
Víctor Aguilera Puerto
2020-05-21 19:48:19 +02:00
committed by GitHub
41 changed files with 919 additions and 22 deletions

View File

@@ -2,9 +2,12 @@ using System;
using Content.Shared.GameObjects.Components.Sound;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Random;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
namespace Content.Shared.Audio
@@ -18,5 +21,11 @@ namespace Content.Shared.Audio
var scale = (float)(IoCManager.Resolve<IRobustRandom>().NextGaussian(1, amplitude));
return AudioParams.Default.WithPitchScale(scale);
}
public static string GetRandomFileFromSoundCollection(string name)
{
var soundCollection = IoCManager.Resolve<IPrototypeManager>().Index<SoundCollectionPrototype>(name);
return IoCManager.Resolve<IRobustRandom>().Pick(soundCollection.PickFiles);
}
}
}

View File

@@ -20,7 +20,7 @@ namespace Content.Shared.GameObjects.Components.Mobs
/// <summary>
/// Mob is standing up
/// </summary>
Stand,
Standing,
/// <summary>
/// Mob is laying down

View File

@@ -32,5 +32,6 @@ namespace Content.Shared.GameObjects.Components.Mobs
Health,
Hunger,
Thirst,
Stun,
}
}