diff --git a/Content.Server/SimpleStation14/Traits/SightFear/SightFearTraitComponent.cs b/Content.Server/SimpleStation14/Traits/SightFear/SightFearTraitComponent.cs new file mode 100644 index 0000000000..255461e40a --- /dev/null +++ b/Content.Server/SimpleStation14/Traits/SightFear/SightFearTraitComponent.cs @@ -0,0 +1,48 @@ +using Robust.Shared.Audio; + +namespace Content.Server.SimpleStation14.Traits.SightFear +{ + [RegisterComponent] + public sealed class SightFearTraitComponent : Component + { + /// + /// The ID of the fear this entity has + /// Matches this to fearable entities with the same ID and adds to + /// If empty, a random fear will be picked from the weighted random prototype "RandomFears" + /// + [DataField("afraidOf")] + [ViewVariables(VVAccess.ReadWrite)] + public string AfraidOf = string.Empty; + + /// + /// How much fear this entity has. + /// Goes up to before the effects of fear start to kick in + /// + [ViewVariables(VVAccess.ReadWrite)] + public double Fear = 0; + + /// + /// How much fear this entity can have before the effects of fear start to kick in + /// + [DataField("maxFear")] + [ViewVariables(VVAccess.ReadWrite)] + public double MaxFear = 20; + + /// + /// If this entity is currently afraid + /// + [ViewVariables(VVAccess.ReadWrite)] + public bool Afraid = false; + + /// + /// How fast the entity's fear goes down + /// + [DataField("calmRate")] + [ViewVariables(VVAccess.ReadWrite)] + public float CalmRate = 2.25f; + + public IPlayingAudioStream? Stream; + + public float Accumulator = 0.084f; + } +} diff --git a/Content.Server/SimpleStation14/Traits/SightFear/SightFearTraitSystem.cs b/Content.Server/SimpleStation14/Traits/SightFear/SightFearTraitSystem.cs new file mode 100644 index 0000000000..b6f901dadd --- /dev/null +++ b/Content.Server/SimpleStation14/Traits/SightFear/SightFearTraitSystem.cs @@ -0,0 +1,158 @@ +using System.Linq; +using Content.Server.Power.EntitySystems; +using Content.Shared.Audio; +using Content.Shared.Chemistry.Reagent; +using Content.Shared.Examine; +using Content.Shared.Interaction.Helpers; +using Content.Shared.Random; +using Content.Shared.Random.Helpers; +using Robust.Server.GameObjects; +using Robust.Shared.Audio; +using Robust.Shared.Player; +using Robust.Shared.Prototypes; +using Robust.Shared.Random; + +namespace Content.Server.SimpleStation14.Traits.SightFear; + +public sealed class SightFearTraitSystem : EntitySystem +{ + [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private readonly EntityLookupSystem _lookup = default!; + [Dependency] private readonly IEntityManager _entity = default!; + [Dependency] private readonly IPrototypeManager _prototype = default!; + [Dependency] private readonly AudioSystem _audio = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnComponentInit); + SubscribeLocalEvent(CheckFeared); + } + + + private void OnComponentInit(EntityUid uid, SightFearTraitComponent component, ComponentInit args) + { + // If the entity already has a fear, don't overwrite it + // Check for RandomFears prototype + if (!string.IsNullOrEmpty(component.AfraidOf) || + !_prototype.TryIndex("RandomFears", out var randomFears)) + return; + + // Pick a random fear and use it + component.AfraidOf = randomFears.Pick(_random); + + // Mark the component as dirty so it gets synced to the client + Dirty(component); + } + + private void CheckFeared(EntityUid uid, SightFearedComponent component, ComponentInit args) + { + // Check if the entity has any fears defined + if (component.Fears.Count == 0) + { + Logger.WarningS("SightFearTraitSystem", $"Entity {uid} has SightFearedComponent without any defined fears."); + return; + } + + // Check if the RandomFears prototype exists + if (!_prototype.TryIndex("RandomFears", out var randomFears)) + { + Logger.ErrorS("SightFearTraitSystem", $"Prototype RandomFears could not be found."); + return; + } + + // Check if the fears defined on the entity are in the RandomFears prototype + foreach (var fear in component.Fears.Keys.Where(fear => !randomFears.Weights.ContainsKey(fear))) + { + Logger.ErrorS("SightFearTraitSystem", $"Prototype RandomFears does not contain fear {fear} from SightFearedComponent on entity {uid}."); + } + } + + public override void Update(float frameTime) + { + base.Update(frameTime); + + // Loop through all entities with SightFearTraitComponent + var query = EntityQueryEnumerator(); + while(query.MoveNext(out var uid, out var component)) + { + // Await the accumulator + if (component.Accumulator > 0f) + { + component.Accumulator -= frameTime; + continue; + } + + // Reset the accumulator + component.Accumulator = 0.084f; + + // Get the range the entity can see based on their eye component + var range = 10f; + if (_entity.TryGetComponent(uid, out var eye)) + range *= (eye.Zoom.X + eye.Zoom.Y) / 2; + + // Get all entities in range that have a SightFearedComponent + var entities = _lookup.GetEntitiesInRange(Transform(uid).Coordinates, range) + .Where(e => _entity.HasComponent(e)); + + var afraid = false; + + // Loop through all fear inflicters + foreach (var entity in entities) + { + // Check if the fear inflicter is in range and unoccluded (visible) + if (!_entity.TryGetComponent(uid, out var examiner) || + !examiner.InRangeUnOccluded(Transform(entity).Coordinates, range)) + continue; + + // Check if the afraid should be afraid of the fear inflicter + var feared = _entity.GetComponent(entity); + if (!feared.Fears.TryGetValue(component.AfraidOf, out var value)) + continue; + + // Calculate the strength of the fear + var distance = (Transform(uid).Coordinates.Position - Transform(entity).Coordinates.Position).Length; + var strength = MathHelper.Lerp(0f, value, 1f - distance / range); + + if (strength <= 0f) + continue; + + // Increase the level of fear + afraid = true; + component.Fear += strength; + + // TODO: Do something when afraid + Logger.ErrorS("SightFearTraitSystem", $"Entity {uid} is afraid of {entity} ({component.AfraidOf}) at strength {strength}, now at a fear level of {component.Fear}/{component.MaxFear}."); + } + + // Set the afraid state for other systems to use + component.Afraid = afraid; + + // Spook + if (component.Fear >= component.MaxFear * 2 && component.Stream == null) + { + component.Stream = _audio.PlayGlobal(new SoundPathSpecifier("/Audio/SimpleStation14/Effects/fastbeat.ogg"), uid, AudioParams.Default.WithLoop(true).WithVariation(0.125f)); + } + else if (component.Fear >= component.MaxFear && component.Stream == null) + { + component.Stream = _audio.PlayGlobal(new SoundPathSpecifier("/Audio/SimpleStation14/Effects/slowbeat.ogg"), uid, AudioParams.Default.WithLoop(true).WithVariation(0.125f)); + } + else if (component.Fear < component.MaxFear && component.Stream != null) + { + component.Stream?.Stop(); + component.Stream = null; + } + + // Decrease the fear level if not afraid this frame + if (!afraid && component.Fear > 0f) + { + component.Fear -= frameTime * 1.19047619 * component.CalmRate; // Don't ask about the number. + Logger.ErrorS("SightFearTraitSystem", $"Entity {uid} is not afraid, decreasing fear level to {component.Fear}/{component.MaxFear}."); + } + + // Clamp the fear level + component.Fear = Math.Clamp(component.Fear, 0, component.MaxFear * 2); + } + } +} diff --git a/Content.Server/SimpleStation14/Traits/SightFear/SightFearedComponent.cs b/Content.Server/SimpleStation14/Traits/SightFear/SightFearedComponent.cs new file mode 100644 index 0000000000..7ba4ae5f29 --- /dev/null +++ b/Content.Server/SimpleStation14/Traits/SightFear/SightFearedComponent.cs @@ -0,0 +1,13 @@ +namespace Content.Server.SimpleStation14.Traits.SightFear +{ + [RegisterComponent] + public sealed class SightFearedComponent : Component + { + /// + /// The fears this entity inflicts, and their power + /// + [DataField("fears")] + [ViewVariables(VVAccess.ReadWrite)] + public Dictionary Fears = new(); + } +} diff --git a/Resources/Audio/SimpleStation14/Effects/fastbeat.ogg b/Resources/Audio/SimpleStation14/Effects/fastbeat.ogg new file mode 100644 index 0000000000..5b3d4a92ab Binary files /dev/null and b/Resources/Audio/SimpleStation14/Effects/fastbeat.ogg differ diff --git a/Resources/Audio/SimpleStation14/Effects/slowbeat.ogg b/Resources/Audio/SimpleStation14/Effects/slowbeat.ogg new file mode 100644 index 0000000000..8989fb04f4 Binary files /dev/null and b/Resources/Audio/SimpleStation14/Effects/slowbeat.ogg differ diff --git a/Resources/Prototypes/Catalog/Fills/Boxes/medical.yml b/Resources/Prototypes/Catalog/Fills/Boxes/medical.yml index 4a352b4990..6f71553293 100644 --- a/Resources/Prototypes/Catalog/Fills/Boxes/medical.yml +++ b/Resources/Prototypes/Catalog/Fills/Boxes/medical.yml @@ -12,6 +12,9 @@ layers: - state: box - state: syringe + - type: SightFeared + fears: + Trypanophobia: 2 - type: entity name: pill canister box @@ -72,7 +75,7 @@ layers: - state: box - state: latex - + - type: entity name: nitrile gloves box parent: BoxCardboard diff --git a/Resources/Prototypes/Entities/Effects/lightning.yml b/Resources/Prototypes/Entities/Effects/lightning.yml index 0f5ee91264..bd0d78bb7e 100644 --- a/Resources/Prototypes/Entities/Effects/lightning.yml +++ b/Resources/Prototypes/Entities/Effects/lightning.yml @@ -29,6 +29,9 @@ - type: Tag tags: - HideContextMenu + - type: SightFeared + fears: + Astraphobia: 2.5 # Doesn't show very long, make it spooky - type: entity name: lightning @@ -60,6 +63,9 @@ - type: Lightning canArc: false shockDamage: 30 + - type: SightFeared + fears: + Astraphobia: 3.25 # Spookier - type: entity name: charged lightning @@ -78,6 +84,9 @@ - type: Lightning canArc: true lightningPrototype: ChargedLightning + - type: SightFeared + fears: + Astraphobia: 2.75 - type: entity name: supercharged lightning @@ -103,6 +112,9 @@ softness: 1 autoRot: true castShadows: false + - type: SightFeared + fears: + Astraphobia: 3 - type: entity name: hypercharged lightning @@ -128,3 +140,6 @@ softness: 1 autoRot: true castShadows: false + - type: SightFeared + fears: + Astraphobia: 3.25 diff --git a/Resources/Prototypes/Entities/Effects/puddle.yml b/Resources/Prototypes/Entities/Effects/puddle.yml index 7cf62880c4..3aa594ccbe 100644 --- a/Resources/Prototypes/Entities/Effects/puddle.yml +++ b/Resources/Prototypes/Entities/Effects/puddle.yml @@ -110,6 +110,9 @@ - type: Puddle overflowVolume: 50 opacityModifier: 8 + - type: SightFeared + fears: + Hemophobia: 0.5 - type: entity name: vomit diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml index feca8517a2..b68e3e221e 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml @@ -212,6 +212,9 @@ - type: SentienceTarget flavorKind: station-event-random-sentience-flavor-organic - type: RandomBark + - type: SightFeared + fears: + Ornithophobia: 0.5 - type: entity name: mallard duck #Quack @@ -1111,6 +1114,9 @@ - type: NoSlip - type: HTN rootTask: IdleEvadeCompound + - type: SightFeared + fears: + Ornithophobia: 0.75 # A bit spookier than the other birds - type: entity name: penguin @@ -1174,6 +1180,9 @@ barks: - Wank barkMultiplier: 0.6 + - type: SightFeared + fears: + Ornithophobia: 0.5 - type: entity name: grenade penguin @@ -1298,6 +1307,9 @@ - Hsssssss - Hss - Hsssss + - type: SightFeared + fears: + Ophidiophobia: 1.5 # Code unique spider prototypes or combine them all into one spider and get a # random sprite state when you spawn it. @@ -1362,6 +1374,9 @@ types: Piercing: 10 - type: RandomBark + - type: SightFeared + fears: + Arachnophobia: 1 - type: entity name: tarantula diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml b/Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml index 4e102dc57c..78b88f4160 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml @@ -125,6 +125,9 @@ - type: ActiveRadio channels: - XenoHive + - type: SightFeared + fears: + Xenophobia: 5 # Fucking SPOOKY # NPC versions diff --git a/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml b/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml index 994f876adb..c027a7c871 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml @@ -127,3 +127,6 @@ - type: SpellbookUser2 - type: Inventory templateId: aghost + - type: SightFeared + fears: + Phasmophobia: 2 # Spooky ghosts are spooky diff --git a/Resources/Prototypes/Entities/Mobs/Player/diona.yml b/Resources/Prototypes/Entities/Mobs/Player/diona.yml index b5b230fc6a..adffe1736e 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/diona.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/diona.yml @@ -35,3 +35,7 @@ - type: Faction factions: - NanoTrasen + - type: SightFeared + fears: + Anthropophobia: 0.75 + Xenophobia: 0.75 diff --git a/Resources/Prototypes/Entities/Mobs/Player/dwarf.yml b/Resources/Prototypes/Entities/Mobs/Player/dwarf.yml index d0042cff02..515300f65a 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/dwarf.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/dwarf.yml @@ -28,3 +28,6 @@ - NanoTrasen - type: MailReceiver - type: PotentialPsionic + - type: SightFeared + fears: + Anthropophobia: 0.8 # A bit shorter, so less scary diff --git a/Resources/Prototypes/Entities/Mobs/Player/human.yml b/Resources/Prototypes/Entities/Mobs/Player/human.yml index 4cfd0a90f7..d616dcb993 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/human.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/human.yml @@ -35,6 +35,9 @@ - NanoTrasen - type: MailReceiver - type: PotentialPsionic + - type: SightFeared + fears: + Anthropophobia: 1 #Syndie - type: entity diff --git a/Resources/Prototypes/Entities/Mobs/Player/observer.yml b/Resources/Prototypes/Entities/Mobs/Player/observer.yml index 0a81c33761..d9e71fce60 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/observer.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/observer.yml @@ -61,3 +61,6 @@ - type: MovementIgnoreGravity - type: Pullable - type: Speech + - type: SightFeared + fears: + Phasmophobia: 1 diff --git a/Resources/Prototypes/Entities/Mobs/Player/reptilian.yml b/Resources/Prototypes/Entities/Mobs/Player/reptilian.yml index 2ea1c9ad1a..542251dc5f 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/reptilian.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/reptilian.yml @@ -34,3 +34,7 @@ damageRecovery: types: Asphyxiation: -1.0 + - type: SightFeared + fears: + Anthropophobia: 0.75 + Xenophobia: 0.7 diff --git a/Resources/Prototypes/Entities/Mobs/Player/skeleton.yml b/Resources/Prototypes/Entities/Mobs/Player/skeleton.yml index b2b1d9bc3a..dc3b9a79eb 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/skeleton.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/skeleton.yml @@ -25,6 +25,10 @@ - type: Faction factions: - NanoTrasen + - type: SightFeared + fears: + Anthropophobia: 0.25 + Xenophobia: 0.8 - type: entity name: Skeleton Pirate diff --git a/Resources/Prototypes/Entities/Mobs/Player/slime.yml b/Resources/Prototypes/Entities/Mobs/Player/slime.yml index d82a53f1be..ced0712af5 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/slime.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/slime.yml @@ -27,3 +27,8 @@ - NanoTrasen - type: MailReceiver - type: PotentialPsionic + - type: SightFeared + fears: + Anthropophobia: 0.75 + Xenophobia: 0.9 + Blennophobia: 1.25 diff --git a/Resources/Prototypes/Entities/Objects/Decoration/flora.yml b/Resources/Prototypes/Entities/Objects/Decoration/flora.yml index 21f2255146..bf2863b7bb 100644 --- a/Resources/Prototypes/Entities/Objects/Decoration/flora.yml +++ b/Resources/Prototypes/Entities/Objects/Decoration/flora.yml @@ -89,6 +89,9 @@ Log: min: 2 max: 8 + - type: SightFeared + fears: + Dendrophobia: 0.75 - type: entity parent: BaseTree @@ -106,6 +109,9 @@ density: 4000 layer: - WallLayer + - type: SightFeared + fears: + Dendrophobia: 0.7 - type: entity parent: BaseTree @@ -123,6 +129,9 @@ density: 2000 layer: - WallLayer + - type: SightFeared + fears: + Dendrophobia: 1 - type: entity parent: BaseTree diff --git a/Resources/Prototypes/Entities/Objects/Fun/toys.yml b/Resources/Prototypes/Entities/Objects/Fun/toys.yml index 3ba5a0addd..eb5897311e 100644 --- a/Resources/Prototypes/Entities/Objects/Fun/toys.yml +++ b/Resources/Prototypes/Entities/Objects/Fun/toys.yml @@ -32,6 +32,9 @@ damage: types: Blunt: 0 + - type: SightFeared + fears: + Pediophobia: 0.75 - type: entity parent: BasePlushie @@ -61,6 +64,9 @@ energy: 2 - type: RgbLightController layers: [ 0 ] + - type: SightFeared + fears: + Pediophobia: 1 - type: entity parent: BasePlushie @@ -70,6 +76,9 @@ components: - type: Sprite state: plushie_nuke + - type: SightFeared + fears: + Pediophobia: 1.5 - type: entity parent: BasePlushie @@ -79,6 +88,9 @@ components: - type: Sprite state: plushie_rouny + - type: SightFeared + fears: + Pediophobia: 1 - type: entity parent: BasePlushie @@ -92,6 +104,9 @@ netsync: false radius: 1.5 energy: 2 + - type: SightFeared + fears: + Pediophobia: 0.25 - type: entity parent: BasePlushie @@ -140,6 +155,9 @@ - type: MeleeWeapon soundHit: path: /Audio/Items/Toys/muffled_weh.ogg + - type: SightFeared + fears: + Pediophobia: 0.5 - type: entity parent: BasePlushie @@ -152,6 +170,9 @@ state: blue - type: Item heldPrefix: blue + - type: SightFeared + fears: + Pediophobia: 1 - type: entity parent: PlushieSharkBlue @@ -185,6 +206,9 @@ components: - type: Sprite state: plushie_ratvar + - type: SightFeared + fears: + Pediophobia: 1.5 - type: entity parent: BasePlushie @@ -194,6 +218,9 @@ components: - type: Sprite state: narplush + - type: SightFeared + fears: + Pediophobia: 1.5 - type: entity @@ -225,6 +252,9 @@ - type: Tag tags: - PlushieCarp + - type: SightFeared + fears: + Pediophobia: 1 - type: entity parent: BasePlushie @@ -234,6 +264,9 @@ components: - type: Sprite state: plushie_slime + - type: SightFeared + fears: + Pediophobia: 0.5 - type: entity parent: BasePlushie @@ -252,6 +285,10 @@ - type: MeleeWeapon soundHit: path: /Audio/Items/Toys/rattle.ogg + - type: SightFeared + fears: + Pediophobia: 1 + Ophidiophobia: 0.75 - type: entity parent: BasePlushie @@ -323,6 +360,10 @@ - type: EmitSoundOnTrigger sound: path: /Audio/Items/Toys/quack.ogg + - type: SightFeared + fears: + Pediophobia: 0.75 + Ornithophobia: 0.5 - type: entity parent: BasePlushie @@ -400,6 +441,9 @@ - type: ItemCooldown - type: UseDelay delay: 15 + - type: SightFeared + fears: + Pediophobia: 1.5 - type: entity parent: BaseItem @@ -875,6 +919,9 @@ base: Sixteen - type: DynamicPrice price: 3 + - type: SightFeared + fears: + Pediophobia: 1 - type: entity parent: BaseItem diff --git a/Resources/Prototypes/Entities/Objects/Misc/books.yml b/Resources/Prototypes/Entities/Objects/Misc/books.yml index d34024d7bb..1a334ef945 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/books.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/books.yml @@ -32,6 +32,9 @@ sound: /Audio/SimpleStation14/Items/Handling/book_drop.ogg - type: EmitSoundOnLand sound: /Audio/SimpleStation14/Items/Handling/book_drop.ogg + - type: SightFeared + fears: + Bibliophobia: 0.75 - type: entity parent: BookBase diff --git a/Resources/Prototypes/Entities/Objects/Misc/implanters.yml b/Resources/Prototypes/Entities/Objects/Misc/implanters.yml index c240be2b51..77f905345d 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/implanters.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/implanters.yml @@ -44,6 +44,9 @@ implantOnly: True: {state: broken} False: {state: syringe_base0} + - type: SightFeared + fears: + Trypanophobia: 1 - type: entity id: Implanter diff --git a/Resources/Prototypes/Entities/Objects/Shields/shields.yml b/Resources/Prototypes/Entities/Objects/Shields/shields.yml index eccc1c5c90..c417c45f89 100644 --- a/Resources/Prototypes/Entities/Objects/Shields/shields.yml +++ b/Resources/Prototypes/Entities/Objects/Shields/shields.yml @@ -217,3 +217,6 @@ SheetGlass: min: 5 max: 5 + - type: SightFeared + fears: + Bibliophobia: 1.5 diff --git a/Resources/Prototypes/Entities/Structures/Furniture/beds.yml b/Resources/Prototypes/Entities/Structures/Furniture/beds.yml index 707ce31db9..0e1813af51 100644 --- a/Resources/Prototypes/Entities/Structures/Furniture/beds.yml +++ b/Resources/Prototypes/Entities/Structures/Furniture/beds.yml @@ -58,6 +58,9 @@ noRot: true - type: Anchorable - type: Pullable + - type: SightFeared + fears: + Somniphobia: 1 - type: entity @@ -78,6 +81,9 @@ - type: Construction graph: bed node: medicalbed + - type: SightFeared + fears: + Somniphobia: 0.7 - type: entity parent: Bed @@ -111,3 +117,6 @@ MaterialWoodPlank: min: 1 max: 5 + - type: SightFeared + fears: + Somniphobia: 0.5 diff --git a/Resources/Prototypes/Entities/Structures/Machines/gravity_generator.yml b/Resources/Prototypes/Entities/Structures/Machines/gravity_generator.yml index 673afa6601..847864c52a 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/gravity_generator.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/gravity_generator.yml @@ -12,7 +12,6 @@ range: 7 sound: path: /Audio/Ambience/Objects/gravity_gen_hum.ogg - - type: Sprite netsync: false sprite: Structures/Machines/gravity_generator.rsi @@ -74,6 +73,9 @@ color: "#a8ffd9" - type: DynamicPrice price: 5000 + - type: SightFeared + fears: + Barophobia: 2.5 # Big scary machine - type: entity id: GravityGeneratorMini @@ -113,3 +115,6 @@ lightRadiusMax: 2.5 - type: DynamicPrice price: 2000 + - type: SightFeared + fears: + Barophobia: 1.75 # Smaller, less scary diff --git a/Resources/Prototypes/Entities/Structures/Wallmounts/mirror.yml b/Resources/Prototypes/Entities/Structures/Wallmounts/mirror.yml index b524f099bf..6e0c58e5e4 100644 --- a/Resources/Prototypes/Entities/Structures/Wallmounts/mirror.yml +++ b/Resources/Prototypes/Entities/Structures/Wallmounts/mirror.yml @@ -18,3 +18,6 @@ interfaces: - key: enum.MagicMirrorUiKey.Key type: MagicMirrorBoundUserInterface + - type: SightFeared + fears: + Catoptrophobia: 1.25 diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Mobs/Player/arachne.yml b/Resources/Prototypes/Nyanotrasen/Entities/Mobs/Player/arachne.yml index 4a2490f438..662e6eb40b 100644 --- a/Resources/Prototypes/Nyanotrasen/Entities/Mobs/Player/arachne.yml +++ b/Resources/Prototypes/Nyanotrasen/Entities/Mobs/Player/arachne.yml @@ -35,3 +35,8 @@ - NanoTrasen - type: MailReceiver - type: PotentialPsionic + - type: SightFeared + fears: + Anthropophobia: 0.9 + Xenophobia: 0.8 + Arachnophobia: 0.9 diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Mobs/Player/felinid.yml b/Resources/Prototypes/Nyanotrasen/Entities/Mobs/Player/felinid.yml index ce1a761047..af9b0a6cfe 100644 --- a/Resources/Prototypes/Nyanotrasen/Entities/Mobs/Player/felinid.yml +++ b/Resources/Prototypes/Nyanotrasen/Entities/Mobs/Player/felinid.yml @@ -42,3 +42,7 @@ interactSuccessSound: /Audio/Effects/thudswoosh.ogg messagePerceivedByOthers: hugging-success-generic-others - type: PotentialPsionic + - type: SightFeared + fears: + Anthropophobia: 0.9 + Xenophobia: 0.25 diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Mobs/Player/moth.yml b/Resources/Prototypes/Nyanotrasen/Entities/Mobs/Player/moth.yml index ab0b552a16..b34618165e 100644 --- a/Resources/Prototypes/Nyanotrasen/Entities/Mobs/Player/moth.yml +++ b/Resources/Prototypes/Nyanotrasen/Entities/Mobs/Player/moth.yml @@ -41,3 +41,8 @@ - NanoTrasen - type: MailReceiver - type: PotentialPsionic + - type: SightFeared + fears: + Anthropophobia: 0.5 + Xenophobia: 0.7 + Arachnophobia: 0.2 diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Mobs/Player/oni.yml b/Resources/Prototypes/Nyanotrasen/Entities/Mobs/Player/oni.yml index d86fcaf1c4..b7da98757e 100644 --- a/Resources/Prototypes/Nyanotrasen/Entities/Mobs/Player/oni.yml +++ b/Resources/Prototypes/Nyanotrasen/Entities/Mobs/Player/oni.yml @@ -36,3 +36,7 @@ interactSuccessSound: /Audio/Effects/thudswoosh.ogg messagePerceivedByOthers: hugging-success-generic-others - type: PotentialPsionic + - type: SightFeared + fears: + Anthropophobia: 0.9 + Xenophobia: 0.75 diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Books/hyperlinks.yml b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Books/hyperlinks.yml index 62d22c9e9a..e1ccf614cd 100644 --- a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Books/hyperlinks.yml +++ b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Books/hyperlinks.yml @@ -14,6 +14,9 @@ sound: /Audio/SimpleStation14/Items/Handling/book_drop.ogg - type: EmitSoundOnLand sound: /Audio/SimpleStation14/Items/Handling/book_drop.ogg + - type: SightFeared + fears: + Bibliophobia: 1 # Spooky book that teaches you - type: entity parent: BaseHyperlinkBook diff --git a/Resources/Prototypes/SimpleStation14/Entities/Objects/Books/guidebooks.yml b/Resources/Prototypes/SimpleStation14/Entities/Objects/Books/guidebooks.yml index 099773d5a1..0c3e8215d4 100644 --- a/Resources/Prototypes/SimpleStation14/Entities/Objects/Books/guidebooks.yml +++ b/Resources/Prototypes/SimpleStation14/Entities/Objects/Books/guidebooks.yml @@ -14,4 +14,3 @@ guides: - AnomalousResearch - Xenoarchaeology - diff --git a/Resources/Prototypes/SimpleStation14/Traits/disabilities.yml b/Resources/Prototypes/SimpleStation14/Traits/disabilities.yml index 2e7e7c81f8..76217d4785 100644 --- a/Resources/Prototypes/SimpleStation14/Traits/disabilities.yml +++ b/Resources/Prototypes/SimpleStation14/Traits/disabilities.yml @@ -60,3 +60,12 @@ messagePerceivedByOthers: hugging-success-generic-others soundPerceivedByOthers: false - type: StutteringAccent + +- type: trait + id: SightFear + name: Fear of Sight # placeholder name + description: You are afraid of seeing things, and will run away from them. # + cost: 2 # + category: Negative + components: + - type: SightFearTrait diff --git a/Resources/Prototypes/SimpleStation14/random.yml b/Resources/Prototypes/SimpleStation14/random.yml new file mode 100644 index 0000000000..daddddad03 --- /dev/null +++ b/Resources/Prototypes/SimpleStation14/random.yml @@ -0,0 +1,33 @@ +- type: weightedRandom + id: RandomFears + weights: + # TODO: Real weight values + # TODO: Every comment with an ! needs to be implemented somehow or removed + #! Alphabetical Order + Anthropophobia: 1 # People + ## Algophobia: 1 #! Pain + Arachnophobia: 1 # Spiders + Astraphobia: 1 # Thunder and lightning + Barophobia: 1 # Gravity + # Batrachophobia: 1 # Amphibians + Bibliophobia: 1 # Books + Blennophobia: 1 # Slime + Catoptrophobia: 1 # Mirrors + ## Chronophobia: 1 #! Time + Coulrophobia: 1 # Clowns + Dendrophobia: 1 # Trees + Hemophobia: 1 # Blood + # Monophobia: 1 # Being alone + ## Necrophobia: 1 #! Corpses + # Nyctophobia: 1 # Darkness + Ophidiophobia: 1 # Snakes + Ornithophobia: 1 # Birds + Pediophobia: 1 # Plushies + Phasmophobia: 1 # Ghosts + # Pyrophobia: 1 # Fire + Somniphobia: 1 # Sleep + ## Technophobia: 1 #! Technology + ## Thanatophobia: 1 #! Death + Trypanophobia: 1 # Needles + Xenophobia: 1 # Aliens + # Zoophobia: 1 # Animals