Wizard: Repulse Spell (#35377)

This commit is contained in:
keronshb
2025-02-22 10:56:54 -05:00
committed by GitHub
parent f32ca4efef
commit ee31a1f293
7 changed files with 65 additions and 3 deletions

View File

@@ -0,0 +1,8 @@
using Content.Shared.Actions;
namespace Content.Shared.RepulseAttract.Events;
// Action event to repulse/attract
// TODO: Give speech support later for wizard
// TODO: When actions are refactored, give action targeting data (to change between single target, all around, etc)
public sealed partial class RepulseAttractActionEvent : InstantActionEvent;

View File

@@ -7,6 +7,7 @@ using Content.Shared.Wieldable;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Components;
using System.Numerics; using System.Numerics;
using Content.Shared.RepulseAttract.Events;
using Content.Shared.Weapons.Melee; using Content.Shared.Weapons.Melee;
namespace Content.Shared.RepulseAttract; namespace Content.Shared.RepulseAttract;
@@ -28,7 +29,9 @@ public sealed class RepulseAttractSystem : EntitySystem
_physicsQuery = GetEntityQuery<PhysicsComponent>(); _physicsQuery = GetEntityQuery<PhysicsComponent>();
SubscribeLocalEvent<RepulseAttractComponent, MeleeHitEvent>(OnMeleeAttempt, before: [typeof(UseDelayOnMeleeHitSystem)], after: [typeof(SharedWieldableSystem)]); SubscribeLocalEvent<RepulseAttractComponent, MeleeHitEvent>(OnMeleeAttempt, before: [typeof(UseDelayOnMeleeHitSystem)], after: [typeof(SharedWieldableSystem)]);
SubscribeLocalEvent<RepulseAttractComponent, RepulseAttractActionEvent>(OnRepulseAttractAction);
} }
private void OnMeleeAttempt(Entity<RepulseAttractComponent> ent, ref MeleeHitEvent args) private void OnMeleeAttempt(Entity<RepulseAttractComponent> ent, ref MeleeHitEvent args)
{ {
if (_delay.IsDelayed(ent.Owner)) if (_delay.IsDelayed(ent.Owner))
@@ -37,6 +40,15 @@ public sealed class RepulseAttractSystem : EntitySystem
TryRepulseAttract(ent, args.User); TryRepulseAttract(ent, args.User);
} }
private void OnRepulseAttractAction(Entity<RepulseAttractComponent> ent, ref RepulseAttractActionEvent args)
{
if (args.Handled)
return;
var position = _xForm.GetMapCoordinates(args.Performer);
args.Handled = TryRepulseAttract(position, args.Performer, ent.Comp.Speed, ent.Comp.Range, ent.Comp.Whitelist, ent.Comp.CollisionMask);
}
public bool TryRepulseAttract(Entity<RepulseAttractComponent> ent, EntityUid user) public bool TryRepulseAttract(Entity<RepulseAttractComponent> ent, EntityUid user)
{ {
var position = _xForm.GetMapCoordinates(ent.Owner); var position = _xForm.GetMapCoordinates(ent.Owner);

View File

@@ -9,9 +9,12 @@ spellbook-voidapplause-name = Void Applause
spellbook-voidapplause-desc = Swap places with the target, doesn't it make you want to do the boogie? spellbook-voidapplause-desc = Swap places with the target, doesn't it make you want to do the boogie?
spellbook-force-wall-name = Force Wall spellbook-force-wall-name = Force Wall
spellbook-force-wall-desc = Make three walls of pure force that you can pass through, but other's can't. spellbook-force-wall-desc = Make three walls of pure force that you can pass through, but others can't.
spellbook-polymoprh-spider-name = Spider Polymoprh spellbook-repulse-name = Repulse
spellbook-repulse-desc = Tell people to GITTAH`WEIGH and push 'em away from you.
spellbook-polymorph-spider-name = Spider Polymorph
spellbook-polymorph-spider-desc = Transforms you into a spider, man! spellbook-polymorph-spider-desc = Transforms you into a spider, man!
spellbook-polymorph-rod-name = Rod Polymorph spellbook-polymorph-rod-name = Rod Polymorph

View File

@@ -75,11 +75,27 @@
WizCoin: 3 WizCoin: 3
categories: categories:
- SpellbookDefensive - SpellbookDefensive
conditions:
- !type:ListingLimitedStockCondition
stock: 1
- type: listing
id: SpellbookRepulse
name: spellbook-repulse-name
description: spellbook-repulse-desc
productAction: ActionRepulse
cost:
WizCoin: 2
categories:
- SpellbookDefensive
conditions:
- !type:ListingLimitedStockCondition
stock: 1
# Utility # Utility
- type: listing - type: listing
id: SpellbookPolymorphSpider id: SpellbookPolymorphSpider
name: spellbook-polymoprh-spider-name name: spellbook-polymorph-spider-name
description: spellbook-polymorph-spider-desc description: spellbook-polymorph-spider-desc
productAction: ActionPolymorphWizardSpider productAction: ActionPolymorphWizardSpider
cost: cost:

View File

@@ -0,0 +1,20 @@
- type: entity
id: ActionRepulse
name: Repulse
description: Pushes entities away from the user.
components:
- type: RepulseAttract
speed: 10
range: 5
whitelist:
components:
- MobMover
- Item
- type: InstantAction
useDelay: 40
raiseOnAction: true
itemIconStyle: BigAction
icon:
sprite: Objects/Magic/magicactions.rsi
state: repulse
event: !type:RepulseAttractActionEvent

View File

@@ -33,6 +33,9 @@
}, },
{ {
"name": "item_recall" "name": "item_recall"
},
{
"name": "repulse"
} }
] ]
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B