Skip to content

Commit

Permalink
uuhhh fix it NOW
Browse files Browse the repository at this point in the history
  • Loading branch information
Roudenn committed Dec 3, 2024
1 parent 0c01f84 commit 66022d0
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 0 deletions.
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");
}
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 Content.Server/Backmen/Abilities/Xeno/XenoAbilitiesSystem.cs
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);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using Content.Shared.Actions;
using Content.Shared.Ghost;
using Content.Shared.Magic;
using Robust.Shared.Audio;


namespace Content.Server.Backmen.Species.Shadowkin.Events;

/// <summary>
Expand Down
33 changes: 33 additions & 0 deletions Resources/Prototypes/_Backmen/Actions/xeno.yml
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
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
- id: XenoRCD
- id: WeaponXenoHealingSpit
- id: PinpointerXeno
- type: XenoAcidSpiller
- type: Destructible
thresholds:
- trigger:
Expand Down

0 comments on commit 66022d0

Please sign in to comment.