]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Adds Hellspawn (Nar'Sie demon mob) (#20291)
authorbrainfood1183 <113240905+brainfood1183@users.noreply.github.com>
Thu, 4 Jan 2024 12:53:15 +0000 (12:53 +0000)
committerGitHub <noreply@github.com>
Thu, 4 Jan 2024 12:53:15 +0000 (05:53 -0700)
* HellSpawn Mob

* added spawner

* summary for the namespace

* larger collider, cannot enter single tile corridors.

* fix

* remove duplicate from yml, fix attributions.

* moved action to shared, moved comp to shared, networked comp, separated heal, fixed attributions

* removed flammable from hellspawn
removed the healing effect from firestarter ability (healing can be separate ability).

* Update attributions.yml

fix attributions

* fix

* fix

21 files changed:
Content.Server/Abilities/Firestarter/FirestarterSystem.cs [new file with mode: 0644]
Content.Shared/Abilities/Firestarter/FirestarterComponent.cs [new file with mode: 0644]
Content.Shared/Abilities/Firestarter/SharedFirestarterSystem.cs [new file with mode: 0644]
Content.Shared/Actions/Events/FireStarterActionEvent.cs [new file with mode: 0644]
Resources/Audio/Effects/Footsteps/attributions.yml
Resources/Audio/Effects/Footsteps/largethud.ogg [new file with mode: 0644]
Resources/Audio/Magic/attributions.yml
Resources/Audio/Magic/rumble.ogg [new file with mode: 0644]
Resources/Locale/en-US/ghost/roles/ghost-role-component.ftl
Resources/Prototypes/Actions/types.yml
Resources/Prototypes/Damage/modifier_sets.yml
Resources/Prototypes/Entities/Markers/Spawners/mobs.yml
Resources/Prototypes/Entities/Mobs/NPCs/hellspawn.yml [new file with mode: 0644]
Resources/Prototypes/SoundCollections/footsteps.yml
Resources/Textures/Interface/Actions/firestarter.png [new file with mode: 0644]
Resources/Textures/Interface/Actions/meta.json
Resources/Textures/Markers/mobs.rsi/hellspawn.png [new file with mode: 0644]
Resources/Textures/Markers/mobs.rsi/meta.json [new file with mode: 0644]
Resources/Textures/Mobs/Demons/hellspawn.rsi/alive.png [new file with mode: 0644]
Resources/Textures/Mobs/Demons/hellspawn.rsi/dead.png [new file with mode: 0644]
Resources/Textures/Mobs/Demons/hellspawn.rsi/meta.json [new file with mode: 0644]

diff --git a/Content.Server/Abilities/Firestarter/FirestarterSystem.cs b/Content.Server/Abilities/Firestarter/FirestarterSystem.cs
new file mode 100644 (file)
index 0000000..9ad8bda
--- /dev/null
@@ -0,0 +1,61 @@
+using Content.Shared.Actions.Events;
+using Robust.Shared.Containers;
+using Robust.Shared.Map;
+using Content.Server.Atmos.Components;
+using Content.Server.Atmos.EntitySystems;
+using Robust.Shared.Audio.Systems;
+using Content.Shared.Abilities.Firestarter;
+
+/// <summary>
+/// Adds an action ability that will cause all flammable targets in a radius to ignite, also heals the owner
+/// of the component when used.
+/// </summary>
+namespace Content.Server.Abilities.Firestarter;
+
+public sealed class FirestarterSystem : EntitySystem
+{
+    [Dependency] private readonly EntityLookupSystem _lookup = default!;
+    [Dependency] private readonly FlammableSystem _flammable = default!;
+    [Dependency] private readonly SharedAudioSystem _audio = default!;
+    [Dependency] private readonly SharedContainerSystem _container = default!;
+
+    public override void Initialize()
+    {
+        base.Initialize();
+        SubscribeLocalEvent<FirestarterComponent, FireStarterActionEvent>(OnStartFire);
+    }
+
+    /// <summary>
+    /// Checks Radius for igniting nearby flammable objects .
+    /// </summary>
+    private void OnStartFire(EntityUid uid, FirestarterComponent component, FireStarterActionEvent args)
+    {
+
+        if (_container.IsEntityOrParentInContainer(uid))
+            return;
+
+        var xform = Transform(uid);
+        var ignitionRadius = component.IgnitionRadius;
+        IgniteNearby(uid, xform.Coordinates, args.Severity, ignitionRadius);
+        _audio.PlayPvs(component.IgniteSound, uid);
+
+        args.Handled = true;
+    }
+
+    /// <summary>
+    /// Ignites flammable objects within range.
+    /// </summary>
+    public void IgniteNearby(EntityUid uid, EntityCoordinates coordinates, float severity, float radius)
+    {
+        var flammables = new HashSet<Entity<FlammableComponent>>();
+        _lookup.GetEntitiesInRange(coordinates, radius, flammables);
+
+        foreach (var flammable in flammables)
+        {
+            var ent = flammable.Owner;
+            var stackAmount = 2 + (int) (severity / 0.15f);
+            _flammable.AdjustFireStacks(ent, stackAmount, flammable);
+            _flammable.Ignite(ent, uid, flammable);
+        }
+    }
+}
diff --git a/Content.Shared/Abilities/Firestarter/FirestarterComponent.cs b/Content.Shared/Abilities/Firestarter/FirestarterComponent.cs
new file mode 100644 (file)
index 0000000..d236b5c
--- /dev/null
@@ -0,0 +1,34 @@
+using Robust.Shared.Prototypes;
+using Robust.Shared.Audio;
+using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
+using Robust.Shared.GameStates;
+
+namespace Content.Shared.Abilities.Firestarter;
+
+/// <summary>
+/// Lets its owner entity ignite flammables around it and also heal some damage.
+/// </summary>
+[RegisterComponent, NetworkedComponent, Access(typeof(SharedFirestarterSystem))]
+public sealed partial class FirestarterComponent : Component
+{
+    /// <summary>
+    /// Radius of objects that will be ignited if flammable.
+    /// </summary>
+    [DataField("ignitionRadius")]
+    public float IgnitionRadius = 4f;
+
+    /// <summary>
+    /// The action entity.
+    /// </summary>
+    [DataField("fireStarterAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
+    public string? FireStarterAction = "ActionFireStarter";
+
+    [DataField("fireStarterActionEntity")] public EntityUid? FireStarterActionEntity;
+
+
+    /// <summary>
+    /// Radius of objects that will be ignited if flammable.
+    /// </summary>
+    [DataField("igniteSound")]
+    public SoundSpecifier IgniteSound = new SoundPathSpecifier("/Audio/Magic/rumble.ogg");
+}
diff --git a/Content.Shared/Abilities/Firestarter/SharedFirestarterSystem.cs b/Content.Shared/Abilities/Firestarter/SharedFirestarterSystem.cs
new file mode 100644 (file)
index 0000000..5e4d434
--- /dev/null
@@ -0,0 +1,22 @@
+using Content.Shared.Actions;
+
+namespace Content.Shared.Abilities.Firestarter;
+
+public sealed class SharedFirestarterSystem : EntitySystem
+{
+    [Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
+
+    public override void Initialize()
+    {
+        base.Initialize();
+        SubscribeLocalEvent<FirestarterComponent, ComponentInit>(OnComponentInit);
+    }
+
+    /// <summary>
+    /// Adds the firestarter action.
+    /// </summary>
+    private void OnComponentInit(EntityUid uid, FirestarterComponent component, ComponentInit args)
+    {
+        _actionsSystem.AddAction(uid, ref component.FireStarterActionEntity, component.FireStarterAction, uid);
+    }
+}
diff --git a/Content.Shared/Actions/Events/FireStarterActionEvent.cs b/Content.Shared/Actions/Events/FireStarterActionEvent.cs
new file mode 100644 (file)
index 0000000..21a2acb
--- /dev/null
@@ -0,0 +1,10 @@
+namespace Content.Shared.Actions.Events;
+
+public sealed partial class FireStarterActionEvent : InstantActionEvent
+{
+    /// <summary>
+    /// Increases the number of fire stacks when a flammable object is ignited.
+    /// </summary>
+    [ViewVariables(VVAccess.ReadWrite)]
+    public float Severity = 0.3f;
+}
index ef91a34d365f825544a30e02b5437b7ae54a0743..756f8c84084d391af6a844ac6d988cf5548f1c93 100644 (file)
   copyright: "Taken and modified from tgstation (clownstep 1 and 2) by brainfood1183 (github)"
   source: "https://github.com/tgstation/tgstation/tree/f8ee37afc00bce1ad421615eaa0e4cbddd5eea90/sound/effects"
 
+- files:
+  - largethud.ogg
+  license: "CC0-1.0"
+  copyright: "Made by philRacoIndie freesound.org, modified by brainfood1183 (github)"
+  source: "https://freesound.org/people/philRacoIndie/sounds/512483/"
+
 - files:
   - snake1.ogg
   - snake2.ogg
diff --git a/Resources/Audio/Effects/Footsteps/largethud.ogg b/Resources/Audio/Effects/Footsteps/largethud.ogg
new file mode 100644 (file)
index 0000000..b9983d6
Binary files /dev/null and b/Resources/Audio/Effects/Footsteps/largethud.ogg differ
index 9efaf8ff91d1cf1e1f380313faab2b43eeb0c9a8..cedda322862f0828e325b4289fe19fc725a343d2 100644 (file)
@@ -1,3 +1,8 @@
+- files: [rumble.ogg]
+  copyright: "Made by Uzbazur freesound.org, modified by brainfood1183 (github)"
+  license: "CC-BY-4.0"
+  source: "https://freesound.org/people/Uzbazur/sounds/221872/"
+
 - files: [fireball.ogg]
   copyright: '"fireball.ogg" by /tg/station'
   license: CC-BY-SA-3.0
@@ -15,4 +20,3 @@
   copyright: '"ForceWall.ogg", "Knock.ogg", and "blink.ogg" by Citadel Station 13'
   license: CC-BY-SA-3.0
   source: https://github.com/Citadel-Station-13/Citadel-Station-13/commit/35a1723e98a60f375df590ca572cc90f1bb80bd5
-
diff --git a/Resources/Audio/Magic/rumble.ogg b/Resources/Audio/Magic/rumble.ogg
new file mode 100644 (file)
index 0000000..3271e9d
Binary files /dev/null and b/Resources/Audio/Magic/rumble.ogg differ
index 37e7d2e2ea04414e3c80ec73b3f304d902e3a280..a42ce6df561bc4c1ea7f22a20c6314f8ea6d9362 100644 (file)
@@ -188,6 +188,10 @@ ghost-role-information-loneop-rules = You are a syndicate operative tasked with
 ghost-role-information-behonker-name = Behonker
 ghost-role-information-behonker-description = You are an antagonist, bring death and honks to those who do not follow the honkmother.
 
+
+ghost-role-information-hellspawn-name = Hellspawn
+ghost-role-information-hellspawn-description = You are an antagonist, bring death to those who do not follow the great god Nar'Sie.
+
 ghost-role-information-Death-Squad-name = Death Squad Operative
 ghost-role-information-Death-Squad-description = One of Nanotrasen's top internal affairs agents. Await orders from CentComm or an official.
 
index 8151cf422e8bb36f50ed889a8151ba984dbb8c15..f301589879c32bcc9ad4c29c934c08cd8ffb97e0 100644 (file)
     event: !type:ActivateImplantEvent
     useDelay: 1
 
+- type: entity
+  id: ActionFireStarter
+  name: Ignite
+  description: Ignites enemies in a radius around you.
+  noSpawn: true
+  components:
+  - type: InstantAction
+    priority: -1
+    useDelay: 30
+    icon: Interface/Actions/firestarter.png
+    event: !type:FireStarterActionEvent
+
 - type: entity
   id: ActionToggleEyes
   name: Open/Close eyes
     iconOn: Interface/Actions/eyeclose.png
     event: !type:ToggleEyesActionEvent
     useDelay: 1 # so u cant give yourself and observers eyestrain by rapidly spamming the action
+
index 71871405c3943787e37883f04c7494b64cef5685..92ba63d4eb022ffc8e36a689703fd9be8a422e9b 100644 (file)
     Radiation: 0.2
     Caustic: 0.0
 
+- type: damageModifierSet
+  id: HellSpawn
+  coefficients:
+    Heat: 0.0
+    Radiation: 0.0
+    Shock: 0.8
+    Bloodloss: 0.4
+
 - type: damageModifierSet
   id: Cockroach
   coefficients:
index 12f735e14d3e6f137bdcf02257f525925d288033..b794d5a4f91f3168c3a20baa9707785ff4dd3d99 100644 (file)
   - type: ConditionalSpawner
     prototypes:
     - MobPenguin
-
+    
+    
+- type: entity
+  name: Hellspawn Spawner
+  id: SpawnMobHellspawn
+  parent: MarkerBase
+  components:
+  - type: Sprite
+    layers:
+    - state: green
+    - state: hellspawn
+      sprite: Markers/mobs.rsi
+  - type: ConditionalSpawner
+    prototypes:
+      - MobHellspawn
+      
 - type: entity
   name: ore crab spawner
   id: SpawnMobOreCrab
diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/hellspawn.yml b/Resources/Prototypes/Entities/Mobs/NPCs/hellspawn.yml
new file mode 100644 (file)
index 0000000..5511c40
--- /dev/null
@@ -0,0 +1,99 @@
+- type: entity
+  name: hellspawn
+  parent:
+  - BaseSimpleMob
+  - MobCombat
+  - MobBloodstream
+  id: MobHellspawn
+  description: An unstoppable force of carnage.
+  components:
+  - type: GhostRole
+    allowMovement: true
+    makeSentient: true
+    name: ghost-role-information-hellspawn-name
+    description: ghost-role-information-hellspawn-description
+  - type: RotationVisuals
+    defaultRotation: 90
+    horizontalRotation: 90
+  - type: GhostTakeoverAvailable
+  - type: HTN
+    rootTask:
+      task: SimpleHostileCompound
+  - type: NpcFactionMember
+    factions:
+      - SimpleHostile
+  - type: Body
+    prototype: Animal
+  - type: Damageable
+    damageContainer: Biological
+    damageModifierSet: HellSpawn
+  - type: MovementSpeedModifier
+    baseWalkSpeed: 2
+    baseSprintSpeed: 3
+  - type: Sprite
+    sprite: Mobs/Demons/hellspawn.rsi
+    layers:
+      - map: [ "enum.DamageStateVisualLayers.Base" ]
+        state: alive
+  - type: DamageStateVisuals
+    states:
+      Alive:
+        Base: alive
+      Dead:
+        Base: dead
+  - type: Firestarter
+  - type: NameIdentifier
+    group: GenericNumber
+  - type: SlowOnDamage
+    speedModifierThresholds:
+      60: 0.7
+      80: 0.5
+  - type: MobPrice
+    price: 1000 # Living critters are valuable in space.
+  - type: Perishable
+  - type: Reflect
+    reflectProb: 0.7
+    reflects:
+      - Energy
+  - type: Fixtures
+    fixtures:
+      fix1:
+        shape:
+          !type:PhysShapeCircle
+          radius: 0.9
+        density: 300
+        mask:
+        - MobMask
+        layer:
+        - MobLayer
+  - type: MobState
+  - type: Tag
+    tags:
+      - CannotSuicide
+      - DoorBumpOpener
+      - FootstepSound
+  - type: MobThresholds
+    thresholds:
+      0: Alive
+      450: Dead
+  - type: Butcherable
+    spawned:
+      - id: ArtifactFragment
+        amount: 4
+  - type: MeleeWeapon
+    attackRate: 0.6
+    hidden: true
+    soundHit:
+      path: /Audio/Weapons/Xeno/alien_claw_flesh3.ogg
+    damage:
+      types:
+        Blunt: 150
+        Structural: 70
+  - type: FootstepModifier
+    footstepSoundCollection:
+      collection: FootstepThud
+  - type: PointLight
+    radius: 2
+    energy: 4.5
+    color: "#ff4242"
+    castShadows: false
index e5b721026201372e0352fc1a240fe8d528c71ee3..296e6386500263949656fef8ab928efe2ea31557 100644 (file)
   - /Audio/Effects/Footsteps/clownspiderstep1.ogg
   - /Audio/Effects/Footsteps/clownspiderstep2.ogg
 
+- type: soundCollection
+  id: FootstepThud
+  files:
+  - /Audio/Effects/Footsteps/largethud.ogg
+
 - type: soundCollection
   id: FootstepSnake
   files:
diff --git a/Resources/Textures/Interface/Actions/firestarter.png b/Resources/Textures/Interface/Actions/firestarter.png
new file mode 100644 (file)
index 0000000..8371191
Binary files /dev/null and b/Resources/Textures/Interface/Actions/firestarter.png differ
index 1779d2e9cac1bc7f8a204b852ae6df3c5100e4f4..886484c333b95743c8cdf6191ad3de4fccfa26c4 100644 (file)
@@ -19,6 +19,9 @@
         {
             "name": "disarm"
         },
+        {
+            "name": "firestarter"
+        },
         {
             "name": "harm"
         },
diff --git a/Resources/Textures/Markers/mobs.rsi/hellspawn.png b/Resources/Textures/Markers/mobs.rsi/hellspawn.png
new file mode 100644 (file)
index 0000000..0dc7788
Binary files /dev/null and b/Resources/Textures/Markers/mobs.rsi/hellspawn.png differ
diff --git a/Resources/Textures/Markers/mobs.rsi/meta.json b/Resources/Textures/Markers/mobs.rsi/meta.json
new file mode 100644 (file)
index 0000000..611deb0
--- /dev/null
@@ -0,0 +1,14 @@
+{
+  "version": 1,
+  "license": "CC-BY-SA-3.0",
+  "copyright": "hellspawn made by rainfood1183 (github)",
+  "size": {
+    "x": 32,
+    "y": 32
+  },
+  "states": [
+    {
+      "name": "hellspawn"
+    }
+  ]
+}
diff --git a/Resources/Textures/Mobs/Demons/hellspawn.rsi/alive.png b/Resources/Textures/Mobs/Demons/hellspawn.rsi/alive.png
new file mode 100644 (file)
index 0000000..9f954e8
Binary files /dev/null and b/Resources/Textures/Mobs/Demons/hellspawn.rsi/alive.png differ
diff --git a/Resources/Textures/Mobs/Demons/hellspawn.rsi/dead.png b/Resources/Textures/Mobs/Demons/hellspawn.rsi/dead.png
new file mode 100644 (file)
index 0000000..75e952c
Binary files /dev/null and b/Resources/Textures/Mobs/Demons/hellspawn.rsi/dead.png differ
diff --git a/Resources/Textures/Mobs/Demons/hellspawn.rsi/meta.json b/Resources/Textures/Mobs/Demons/hellspawn.rsi/meta.json
new file mode 100644 (file)
index 0000000..060526e
--- /dev/null
@@ -0,0 +1,18 @@
+{
+  "version": 1,
+  "size": {
+    "x": 64,
+    "y": 64
+  },
+  "license": "CC-BY-SA-3.0",
+  "copyright": "Made by brainfood1183 (github) for ss14",
+  "states": [
+    {
+      "name": "dead"
+    },
+    {
+      "name": "alive",
+      "directions": 4
+    }
+  ]
+}
\ No newline at end of file