diff --git a/Content.Server/Stunnable/Systems/StunbatonSystem.cs b/Content.Server/Stunnable/Systems/StunbatonSystem.cs index 97dd2c7e7359bb..47386c4b48aa0a 100644 --- a/Content.Server/Stunnable/Systems/StunbatonSystem.cs +++ b/Content.Server/Stunnable/Systems/StunbatonSystem.cs @@ -35,6 +35,14 @@ public override void Initialize() private void OnStaminaHitAttempt(Entity 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(entity.Owner, out var battery) || !_battery.TryUseCharge(entity.Owner, entity.Comp.EnergyPerUse, battery)) { diff --git a/Content.Shared/Stunnable/StunbatonComponent.cs b/Content.Shared/Stunnable/StunbatonComponent.cs index 1df009f780b45f..0192bdccb23eb6 100644 --- a/Content.Shared/Stunnable/StunbatonComponent.cs +++ b/Content.Shared/Stunnable/StunbatonComponent.cs @@ -15,4 +15,11 @@ public sealed partial class StunbatonComponent : Component [DataField("sparksSound")] public SoundSpecifier SparksSound = new SoundCollectionSpecifier("sparks"); + + // Impstation + /// + /// Should this stun when turned off, instead of when on? + /// + [DataField] + public bool Inverted = false; } diff --git a/Resources/Prototypes/Roles/Antags/ninja.yml b/Resources/Prototypes/Roles/Antags/ninja.yml index 6a9a65bb13ec87..b4a9d64c08d2bb 100644 --- a/Resources/Prototypes/Roles/Antags/ninja.yml +++ b/Resources/Prototypes/Roles/Antags/ninja.yml @@ -22,7 +22,7 @@ ears: ClothingHeadsetGrey pocket1: SpiderCharge pocket2: PinpointerStation - belt: EnergyKatana + belt: EnergyKatanaStun # imp inhand: - JetpackBlackFilled storage: diff --git a/Resources/Prototypes/_Impstation/Entities/Objects/Weapons/Melee/sword.yml b/Resources/Prototypes/_Impstation/Entities/Objects/Weapons/Melee/sword.yml new file mode 100644 index 00000000000000..4564da1eac9d04 --- /dev/null +++ b/Resources/Prototypes/_Impstation/Entities/Objects/Weapons/Melee/sword.yml @@ -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} diff --git a/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/equipped-BACKPACK.png b/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/equipped-BACKPACK.png new file mode 100644 index 00000000000000..ba554a95b5a9ca Binary files /dev/null and b/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/equipped-BACKPACK.png differ diff --git a/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/equipped-BELT.png b/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/equipped-BELT.png new file mode 100644 index 00000000000000..abdef910aa9691 Binary files /dev/null and b/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/equipped-BELT.png differ diff --git a/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/meta.json b/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/meta.json new file mode 100644 index 00000000000000..ebe2f0bbbd70c5 --- /dev/null +++ b/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/meta.json @@ -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 + } + ] +} diff --git a/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/off-icon.png b/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/off-icon.png new file mode 100644 index 00000000000000..dd15a421db3150 Binary files /dev/null and b/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/off-icon.png differ diff --git a/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/off-inhand-left.png b/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/off-inhand-left.png new file mode 100644 index 00000000000000..35cb582c16ec90 Binary files /dev/null and b/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/off-inhand-left.png differ diff --git a/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/off-inhand-right.png b/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/off-inhand-right.png new file mode 100644 index 00000000000000..9338415aca0b24 Binary files /dev/null and b/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/off-inhand-right.png differ diff --git a/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/on-icon.png b/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/on-icon.png new file mode 100644 index 00000000000000..665c53dd152031 Binary files /dev/null and b/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/on-icon.png differ diff --git a/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/on-inhand-left.png b/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/on-inhand-left.png new file mode 100644 index 00000000000000..a3286c07bbacd9 Binary files /dev/null and b/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/on-inhand-left.png differ diff --git a/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/on-inhand-right.png b/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/on-inhand-right.png new file mode 100644 index 00000000000000..05e721d1796592 Binary files /dev/null and b/Resources/Textures/_Impstation/Objects/Weapons/Melee/energykatana.rsi/on-inhand-right.png differ