Skip to content

Commit

Permalink
Merge pull request #1225 from iaada/imp/stun-katana
Browse files Browse the repository at this point in the history
ninja stun katana
  • Loading branch information
hivehum authored Jan 4, 2025
2 parents 8ac0241 + 335e52d commit ac87029
Show file tree
Hide file tree
Showing 13 changed files with 135 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Content.Server/Stunnable/Systems/StunbatonSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ public override void Initialize()

private void OnStaminaHitAttempt(Entity<StunbatonComponent> entity, ref StaminaDamageOnHitAttemptEvent args)
{
// Impstation
if (entity.Comp.Inverted && _itemToggle.IsActivated(entity.Owner))
{
args.Cancelled = true;
}
else if (entity.Comp.Inverted) // Uses else so that the next if statement can call battery drain when stun gets canceled (e.g. baton is on)
return;

if (!_itemToggle.IsActivated(entity.Owner) ||
!TryComp<BatteryComponent>(entity.Owner, out var battery) || !_battery.TryUseCharge(entity.Owner, entity.Comp.EnergyPerUse, battery))
{
Expand Down
7 changes: 7 additions & 0 deletions Content.Shared/Stunnable/StunbatonComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,11 @@ public sealed partial class StunbatonComponent : Component

[DataField("sparksSound")]
public SoundSpecifier SparksSound = new SoundCollectionSpecifier("sparks");

// Impstation
/// <summary>
/// Should this stun when turned off, instead of when on?
/// </summary>
[DataField]
public bool Inverted = false;
}
2 changes: 1 addition & 1 deletion Resources/Prototypes/Roles/Antags/ninja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
ears: ClothingHeadsetGrey
pocket1: SpiderCharge
pocket2: PinpointerStation
belt: EnergyKatana
belt: EnergyKatanaStun # imp
inhand:
- JetpackBlackFilled
storage:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
- type: entity
name: energy katana
suffix: stun
parent: Katana
id: EnergyKatanaStun
description: A katana infused with strong energy. Few possess the strength to contain it.
components:
- type: StaminaDamageOnHit
damage: 30
sound: /Audio/Weapons/egloves.ogg
- type: MeleeWeapon
wideAnimationRotation: -60
damage:
types:
Slash: 5
- type: ItemToggleMeleeWeapon
activatedDamage:
types:
Slash: 30
activatedSoundOnHit:
path: /Audio/Weapons/bladeslice.ogg
deactivatedSoundOnHit:
path: /Audio/Weapons/bladeslice.ogg
- type: Stunbaton
energyPerUse: 100
inverted: true
- type: Battery
maxCharge: 1000
startingCharge: 1000
- type: Sprite
sprite: _Impstation/Objects/Weapons/Melee/energykatana.rsi
layers:
- state: off-icon
map: [ "enum.ToggleVisuals.Layer" ]
angle: 60
animation: WeaponArcSlash
- type: Item
heldPrefix: off
sprite: _Impstation/Objects/Weapons/Melee/energykatana.rsi
- type: Clothing
sprite: _Impstation/Objects/Weapons/Melee/energykatana.rsi
quickEquip: false
slots:
- Back
- Belt
- type: EnergyKatana
- type: DashAbility
- type: LimitedCharges
maxCharges: 3
charges: 3
- type: AutoRecharge
rechargeDuration: 20
- type: Reflect
- type: ThrowingAngle
angle: 300
- type: ItemToggleDamageOtherOnHit
- type: ItemToggle
predictable: false
soundActivate:
collection: sparks
params:
variation: 0.250
soundDeactivate:
collection: sparks
params:
variation: 0.250
soundFailToActivate:
path: /Audio/Machines/button.ogg
params:
variation: 0.250
- type: UseDelay
- type: Appearance
- type: GenericVisualizer
visuals:
enum.ToggleVisuals.Toggled:
enum.ToggleVisuals.Layer:
True: {state: on-icon}
False: {state: off-icon}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from tgstation at https://github.com/tgstation/tgstation/commit/a9451f4d22f233d328b63490c2bcf64a640e42ff and modified by Jackal298, recolor by iaada (github).",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "off-icon"
},
{
"name": "on-icon"
},
{
"name": "equipped-BELT",
"directions": 4
},
{
"name": "off-inhand-left",
"directions": 4
},
{
"name": "on-inhand-left",
"directions": 4
},
{
"name": "off-inhand-right",
"directions": 4
},
{
"name": "on-inhand-right",
"directions": 4
},
{
"name": "equipped-BACKPACK",
"directions": 4
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ac87029

Please sign in to comment.