[DataField("plantIconState")] public string PlantIconState { get; set; } = "produce";
+ /// <summary>
+ /// Screams random sound, could be strict sound SoundPathSpecifier or collection SoundCollectionSpecifier
+ /// base class is SoundSpecifier
+ /// </summary>
[DataField("screamSound")]
- public SoundSpecifier ScreamSound = new SoundPathSpecifier("/Audio/Voice/Human/malescream_1.ogg");
-
+ public SoundSpecifier ScreamSound = new SoundCollectionSpecifier("PlantScreams", AudioParams.Default.WithVolume(-10));
[DataField("screaming")] public bool CanScream;
var displayName = Loc.GetString(component.Seed.DisplayName);
_popup.PopupCursor(Loc.GetString("plant-holder-component-take-sample-message",
("seedName", displayName)), args.User);
-
- if (component.Seed != null && component.Seed.CanScream)
- {
- _audio.PlayPvs(component.Seed.ScreamSound, uid, AudioParams.Default.WithVolume(-2));
- }
+
+ DoScream(entity.Owner, component.Seed);
if (_random.Prob(0.3f))
component.Sampled = true;
return true;
}
+ /// <summary>
+ /// Force do scream on PlantHolder (like plant is screaming) using seed's ScreamSound specifier (collection or soundPath)
+ /// </summary>
+ /// <returns></returns>
+ public bool DoScream(EntityUid plantholder, SeedData? seed = null)
+ {
+ if (seed == null || seed.CanScream == false)
+ return false;
+
+ _audio.PlayPvs(seed.ScreamSound, plantholder);
+ return true;
+ }
+
public void AutoHarvest(EntityUid uid, PlantHolderComponent? component = null)
{
if (!Resolve(uid, ref component))
component.Harvest = false;
component.LastProduce = component.Age;
- if (component.Seed != null && component.Seed.CanScream)
- _audio.PlayPvs(component.Seed.ScreamSound, uid, AudioParams.Default.WithVolume(-2));
+ DoScream(uid, component.Seed);
if (component.Seed?.HarvestRepeat == HarvestType.NoRepeat)
RemovePlant(uid, component);
- /Audio/Voice/Cluwne/cluwnelaugh1.ogg
- /Audio/Voice/Cluwne/cluwnelaugh2.ogg
- /Audio/Voice/Cluwne/cluwnelaugh3.ogg
+
+- type: soundCollection
+ id: PlantScreams
+ files:
+ # Male.
+ - /Audio/Voice/Human/malescream_1.ogg
+ - /Audio/Voice/Human/malescream_2.ogg
+ - /Audio/Voice/Human/malescream_3.ogg
+ - /Audio/Voice/Human/malescream_4.ogg
+ - /Audio/Voice/Human/malescream_5.ogg
+ - /Audio/Voice/Human/malescream_6.ogg
+
+ # Female.
+ - /Audio/Voice/Human/femalescream_1.ogg
+ - /Audio/Voice/Human/femalescream_2.ogg
+ - /Audio/Voice/Human/femalescream_3.ogg
+ - /Audio/Voice/Human/femalescream_4.ogg
+ - /Audio/Voice/Human/femalescream_5.ogg
\ No newline at end of file