-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
Content.Server/Backmen/Abilities/Xeno/Abilities/XenoAcidSpillerComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Robust.Shared.Audio; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Server.Backmen.Abilities.Xeno.Abilities; | ||
|
||
[RegisterComponent] | ||
public sealed partial class XenoAcidSpillerComponent : Component | ||
{ | ||
[DataField] | ||
public string AcidSpitActionId = "ActionXenoSpitMaidAcid"; | ||
|
||
[DataField] | ||
public EntityUid? AcidSpitAction; | ||
|
||
[DataField] | ||
public EntProtoId BulletSpawnId = "BulletSplashMaidAcid"; | ||
|
||
[DataField] | ||
public SoundSpecifier BulletSound = new SoundPathSpecifier("/Audio/Effects/Fluids/splat.ogg"); | ||
} |
5 changes: 5 additions & 0 deletions
5
Content.Server/Backmen/Abilities/Xeno/Abilities/XenoAcidSpitActionEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
using Content.Shared.Actions; | ||
|
||
namespace Content.Server.Backmen.Abilities.Xeno.Abilities; | ||
|
||
public sealed partial class XenoAcidSpitActionEvent : WorldTargetActionEvent {} |
52 changes: 52 additions & 0 deletions
52
Content.Server/Backmen/Abilities/Xeno/XenoAbilitiesSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using Content.Server.Backmen.Abilities.Xeno.Abilities; | ||
using Content.Server.Weapons.Ranged.Systems; | ||
using Content.Shared.Actions; | ||
using Robust.Server.GameObjects; | ||
using Robust.Shared.Audio.Systems; | ||
|
||
namespace Content.Server.Backmen.Abilities.Xeno; | ||
|
||
public sealed class XenoAbilitiesSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly SharedAudioSystem _audioSystem = default!; | ||
[Dependency] private readonly GunSystem _gunSystem = default!; | ||
[Dependency] private readonly PhysicsSystem _physics = default!; | ||
[Dependency] private readonly SharedTransformSystem _transform = default!; | ||
[Dependency] private readonly SharedActionsSystem _actions = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<XenoAcidSpillerComponent, XenoAcidSpitActionEvent>(OnAcidSpit); | ||
SubscribeLocalEvent<XenoAcidSpillerComponent, ComponentStartup>(OnStartup); | ||
SubscribeLocalEvent<XenoAcidSpillerComponent, ComponentShutdown>(OnShutdown); | ||
} | ||
|
||
private void OnAcidSpit(EntityUid uid, XenoAcidSpillerComponent component, XenoAcidSpitActionEvent args) | ||
{ | ||
if (args.Handled) | ||
return; | ||
|
||
var xform = Transform(uid); | ||
var acidBullet = Spawn(component.BulletSpawnId, xform.Coordinates); | ||
var mapCoords = _transform.ToMapCoordinates(args.Target); | ||
var direction = mapCoords.Position - _transform.GetMapCoordinates(xform).Position; | ||
var userVelocity = _physics.GetMapLinearVelocity(uid); | ||
|
||
_gunSystem.ShootProjectile(acidBullet, direction, userVelocity, uid, uid); | ||
_audioSystem.PlayPvs(component.BulletSound, uid, component.BulletSound.Params); | ||
|
||
args.Handled = true; | ||
} | ||
|
||
private void OnStartup(EntityUid uid, XenoAcidSpillerComponent component, ComponentStartup args) | ||
{ | ||
_actions.AddAction(uid, ref component.AcidSpitAction, component.AcidSpitActionId); | ||
} | ||
|
||
private void OnShutdown(EntityUid uid, XenoAcidSpillerComponent component, ComponentShutdown args) | ||
{ | ||
_actions.RemoveAction(uid, component.AcidSpitAction); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
Content.Shared/Backmen/Shadowkin/Events/ShadowkinEvents.Powers.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
- type: entity | ||
id: ActionXenoSpitMaidAcid | ||
name: Spit slerm | ||
description: Spit the violet acid on your enemies. | ||
components: | ||
- type: WorldTargetAction | ||
icon: Interface/Actions/fleshAcidSpit.png | ||
#itemIconStyle: NoItem | ||
event: !type:XenoAcidSpitActionEvent | ||
checkCanAccess: true | ||
useDelay: 60 | ||
range: 32 | ||
repeat: true | ||
priority: -20 | ||
|
||
- type: entity | ||
id: BulletSplashMaidAcid | ||
name: maid acid spit | ||
parent: BaseBulletTrigger | ||
categories: [ HideSpawnMenu ] | ||
components: | ||
- type: Sprite | ||
sprite: Objects/Weapons/Guns/Projectiles/flesh_toxic.rsi | ||
layers: | ||
- state: flesh_toxic | ||
- type: Projectile | ||
damage: | ||
types: | ||
Caustic: 5 | ||
- type: SplashOnTrigger | ||
splashReagents: | ||
- ReagentId: SlermQueenPlus | ||
Quantity: 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters