* EI NATH

* fix gibs

* figs
This commit is contained in:
Kara
2022-06-23 05:19:32 -07:00
committed by GitHub
parent d684c67ee3
commit a63f698544
9 changed files with 84 additions and 3 deletions

View File

@@ -0,0 +1,12 @@
using Content.Shared.Actions;
namespace Content.Server.Magic.Events;
public sealed class SmiteSpellEvent : EntityTargetActionEvent
{
/// <summary>
/// Should this smite delete all parts/mechanisms gibbed except for the brain?
/// </summary>
[DataField("deleteNonBrainParts")]
public bool DeleteNonBrainParts = true;
}

View File

@@ -1,4 +1,5 @@
using System.Threading;
using Content.Server.Body.Components;
using Content.Server.Coordinates.Helpers;
using Content.Server.Decals;
using Content.Server.DoAfter;
@@ -9,6 +10,7 @@ using Content.Server.Spawners.Components;
using Content.Server.Weapon.Ranged.Systems;
using Content.Shared.Actions;
using Content.Shared.Actions.ActionTypes;
using Content.Shared.Body.Components;
using Content.Shared.Doors.Components;
using Content.Shared.Doors.Systems;
using Content.Shared.Interaction.Events;
@@ -49,6 +51,7 @@ public sealed class MagicSystem : EntitySystem
SubscribeLocalEvent<InstantSpawnSpellEvent>(OnInstantSpawn);
SubscribeLocalEvent<TeleportSpellEvent>(OnTeleportSpell);
SubscribeLocalEvent<KnockSpellEvent>(OnKnockSpell);
SubscribeLocalEvent<SmiteSpellEvent>(OnSmiteSpell);
SubscribeLocalEvent<WorldSpawnSpellEvent>(OnWorldSpawn);
SubscribeLocalEvent<ProjectileSpellEvent>(OnProjectileSpell);
}
@@ -264,6 +267,30 @@ public sealed class MagicSystem : EntitySystem
args.Handled = true;
}
private void OnSmiteSpell(SmiteSpellEvent ev)
{
if (ev.Handled)
return;
if (!TryComp<BodyComponent>(ev.Target, out var body))
return;
var ents = body.Gib(true);
if (!ev.DeleteNonBrainParts)
return;
foreach (var part in ents)
{
// just leaves a brain and clothes
if ((HasComp<BodyPartComponent>(part) || HasComp<MechanismComponent>(part))
&& !HasComp<BrainComponent>(part))
{
QueueDel(part);
}
}
}
/// <summary>
/// Spawns entity prototypes from a list within range of click.
/// </summary>

View File

@@ -397,7 +397,7 @@ namespace Content.Shared.Body.Components
RemovePart(part);
if (gibParts)
part.Gib();
gibs.UnionWith(part.Gib());
}
return gibs;

View File

@@ -287,12 +287,17 @@ namespace Content.Shared.Body.Components
/// <summary>
/// Gibs the body part.
/// </summary>
public virtual void Gib()
public virtual HashSet<EntityUid> Gib()
{
var gibs = new HashSet<EntityUid>();
foreach (var mechanism in _mechanisms)
{
gibs.Add(mechanism.Owner);
RemoveMechanism(mechanism);
}
return gibs;
}
}

Binary file not shown.

View File

@@ -3,5 +3,6 @@ https://github.com/Citadel-Station-13/Citadel-Station-13/blob/master/sound/magic
https://github.com/Citadel-Station-13/Citadel-Station-13/blob/master/sound/magic/Knock.ogg
fireball.ogg taken from /tg/station at https://github.com/tgstation/tgstation/commit/906fb0682bab6a0975b45036001c54f021f58ae7
disintegrate.ogg from /tg/station at https://github.com/tgstation/tgstation/commit/6fde7a49fcd56d6edb844cd31a04ce026065de8b
copyright: CC BY-SA 3.0
copyright: CC BY-SA 3.0

View File

@@ -9,6 +9,10 @@ action-name-spell-knock = Knock
action-description-spell-knock = This spell opens nearby doors.
action-speech-spell-knock = AULIE OXIN FIERA
action-name-spell-smite = Smite
action-description-spell-smite = Instantly gibs a target.
action-speech-spell-smite = EI NATH!
action-name-spell-blink = Blink
action-description-spell-blink = Teleport to the clicked location.

View File

@@ -50,6 +50,20 @@
worldSpells:
Blink: -1
- type: entity
id: SmiteBook
name: smite spellbook
parent: BaseSpellbook
components:
- type: Sprite
netsync: false
sprite: Objects/Magic/spellbooks.rsi
layers:
- state: spellbook
- type: Spellbook
entitySpells:
Smite: -1
- type: entity
id: KnockSpellbook
name: knock spellbook

View File

@@ -0,0 +1,18 @@
- type: entityTargetAction
id: Smite
name: action-name-spell-smite
description: action-description-spell-smite
useDelay: 60
speech: action-speech-spell-smite
itemIconStyle: BigAction
whitelist:
components:
- Body
canTargetSelf: false
interactOnMiss: false
sound: !type:SoundPathSpecifier
path: /Audio/Magic/disintegrate.ogg
icon:
sprite: Objects/Magic/magicactions.rsi
state: gib
serverEvent: !type:SmiteSpellEvent