Skip to content

Commit

Permalink
[Port] Small Energy Crossbow / Маленький Энергетический Арбалет (#60)
Browse files Browse the repository at this point in the history
* add: ebow

* RU Loc

* Update BlurOnCollideComponent.cs

* test
  • Loading branch information
Spatison authored Sep 26, 2024
1 parent 55c0d4b commit a7990bc
Show file tree
Hide file tree
Showing 20 changed files with 232 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ public sealed partial class BlurryVisionComponent : Component
/// Amount of "blurring". Also modifies examine ranges.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("magnitude"), AutoNetworkedField]
public float Magnitude;
public float Magnitude = 4f; // WD EDIT

/// <summary>
/// Exponent that controls the magnitude of the effect.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("correctionPower"), AutoNetworkedField]
public float CorrectionPower;
public float CorrectionPower = 2f; // WD EDIT

public const float MaxMagnitude = 6;
public const float DefaultCorrectionPower = 2f;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Content.Shared._White.Collision.Blur;

[RegisterComponent]
public sealed partial class BlurOnCollideComponent : Component
{
[DataField]
public float BlurTime = 10f;
}
37 changes: 37 additions & 0 deletions Content.Shared/_White/Collision/Blur/BlurOnCollideSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using Content.Shared.Eye.Blinding.Components;
using Content.Shared.Projectiles;
using Content.Shared.StatusEffect;
using Content.Shared.Throwing;

namespace Content.Shared._White.Collision.Blur;

public sealed class BlurOnCollideSystem : EntitySystem
{
[Dependency] private readonly StatusEffectsSystem _statusEffects = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<BlurOnCollideComponent, ProjectileHitEvent>(OnProjectileHit);
SubscribeLocalEvent<BlurOnCollideComponent, ThrowDoHitEvent>(OnEntityHit);
}

private void OnEntityHit(Entity<BlurOnCollideComponent> ent, ref ThrowDoHitEvent args)
{
ApplyEffects(args.Target, ent.Comp);
}

private void OnProjectileHit(Entity<BlurOnCollideComponent> ent, ref ProjectileHitEvent args)
{
ApplyEffects(args.Target, ent.Comp);
}

private void ApplyEffects(EntityUid target, BlurOnCollideComponent component)
{
_statusEffects.TryAddStatusEffect<BlurryVisionComponent>(target,
"BlurryVision",
TimeSpan.FromSeconds(component.BlurTime),
true);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Content.Shared._White.Standing;

namespace Content.Shared._White.Collision.Knockdown;

[RegisterComponent]
public sealed partial class KnockdownOnCollideComponent : Component
{
[DataField]
public DropHeldItemsBehavior Behavior = DropHeldItemsBehavior.NoDrop;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using Content.Shared._White.Standing;
using Content.Shared.Projectiles;
using Content.Shared.Throwing;

namespace Content.Shared._White.Collision.Knockdown;

public sealed class KnockdownOnCollideSystem : EntitySystem
{
[Dependency] private readonly SharedLayingDownSystem _layingDown = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<KnockdownOnCollideComponent, ProjectileHitEvent>(OnProjectileHit);
SubscribeLocalEvent<KnockdownOnCollideComponent, ThrowDoHitEvent>(OnEntityHit);
}

private void OnEntityHit(Entity<KnockdownOnCollideComponent> ent, ref ThrowDoHitEvent args)
{
ApplyEffects(args.Target, ent.Comp);
}

private void OnProjectileHit(Entity<KnockdownOnCollideComponent> ent, ref ProjectileHitEvent args)
{
ApplyEffects(args.Target, ent.Comp);
}

private void ApplyEffects(EntityUid target, KnockdownOnCollideComponent component)
{
_layingDown.TryLieDown(target, null, null, component.Behavior);
}
}
5 changes: 4 additions & 1 deletion Resources/Locale/en-US/_white/store/uplink-catalog.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
uplink-emp-flashlight-desc = A rechargeable device disguised as a flashlight designed to disrupt electronic systems. Useful for disrupting communications, security's energy weapons, and APCs when you're in a tight spot.
uplink-betrayal-knife-name = Betrayal dagger
uplink-betrayal-knife-desc = The betrayal dagger allows the user to teleport a short distance, and also causes significant damage when stabbed in the back.
uplink-betrayal-knife-desc = The betrayal dagger allows the user to teleport a short distance, and also causes significant damage when stabbed in the back.
uplink-ebow-name = Small energy crossbow
uplink-ebow-desc = A fairly quiet weapon that automatically reloads and stuns. It goes well with other types of weapons.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ent-EnergyCrossbowMini = Mаленький энергетический арбалет
.desc = Стреляет энергетическими болтами, которые отравляют и оглушают цель.
5 changes: 4 additions & 1 deletion Resources/Locale/ru-RU/_white/store/uplink-catalog.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
uplink-emp-flashlight-desc = Замаскированное под фонарик устройство. При ударе выпускает ЭМИ, поражающий электрические устройства.
uplink-betrayal-knife-name = Предательский кинжал
uplink-betrayal-knife-desc = Предательский кинжал позволяет пользователю телепортироваться на короткое расстояние, а также наносит значительные повреждения при ударе в спину.
uplink-betrayal-knife-desc = Предательский кинжал позволяет пользователю телепортироваться на короткое расстояние, а также наносит значительные повреждения при ударе в спину.
uplink-ebow-name = Маленький энергетический арбалет
uplink-ebow-desc = Довольно тихое оружие, которое автоматически перезаряжается и оглушает. Хорошо сочетается с другими видами оружия.
17 changes: 17 additions & 0 deletions Resources/Prototypes/_White/Catalog/uplink_catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,20 @@
tags:
- NukeOpsUplink
saleLimit: 1

- type: listing
id: UplinkMiniEbow
name: uplink-ebow-name
description: uplink-ebow-desc
icon: { sprite: /Textures/_White/Objects/Weapons/Guns/Battery/mini-ebow.rsi, state: icon }
productEntity: EnergyCrossbowMini
cost:
Telecrystal: 10
categories:
- UplinkWeapons
conditions:
- !type:StoreWhitelistCondition
blacklist:
tags:
- NukeOpsUplink
saleLimit: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
- type: entity
name: small energy crossbow
description: Shoots energy bolts that poison and stun the target.
parent: BaseItem
id: EnergyCrossbowMini
components:
- type: Sprite
sprite: _White/Objects/Weapons/Guns/Battery/mini-ebow.rsi
state: icon
- type: Item
size: Small
sprite: _White/Objects/Weapons/Guns/Battery/mini-ebow.rsi
- type: Clothing
slots:
- Belt
- type: Gun
resetOnHandSelected: false
fireRate: 0.4
soundGunshot:
path: /Audio/Weapons/click.ogg
- type: RechargeBasicEntityAmmo
rechargeCooldown: 1.5
rechargeSound:
path: /Audio/Weapons/Guns/MagIn/revolver_magin.ogg
- type: BasicEntityAmmoProvider
proto: BoltEnergyCrossbow
capacity: 1
count: 1
- type: AmmoCounter
- type: GenericVisualizer
visuals:
enum.AmmoVisuals.HasAmmo:
base:
True: { state: icon }
False: { state: empty }
- type: Appearance
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
- type: entity
name: energy crossbow bolt
parent: BaseBullet
id: BoltEnergyCrossbow
noSpawn: true
components:
- type: Sprite
sprite: _White/Objects/Weapons/Guns/Projectiles/ebolt.rsi
state: bullet
- type: Ammo
muzzleFlash: null
- type: Projectile
impactEffect: null
damage:
types:
Poison: 15
- type: Reflective
reflective:
- Energy
- type: Fixtures
fixtures:
projectile:
shape:
!type:PhysShapeAabb
bounds: "-0.1,-0.2,0.1,0.2"
hard: false
mask:
- Opaque
- type: KnockdownOnCollide
behavior: AlwaysDrop
- type: BlurOnCollide
7 changes: 6 additions & 1 deletion Resources/Prototypes/status_effects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,13 @@
- type: statusEffect
id: StaminaModifier

# WD EDIT
# WD EDIT START
- type: statusEffect
id: RecentlyBlocked
alwaysAllowed: true
alert: RecentlyBlocked

- type: statusEffect
id: BlurryVision
alwaysAllowed: true
# WD EDIT END
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from tgstation at https://github.com/tgstation/tgstation/commit/40d89d11ea4a5cb81d61dc1018b46f4e7d32c62a",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "icon"
},
{
"name": "empty"
},
{
"name": "bolt"
},
{
"name": "inhand-left",
"directions": 4
},
{
"name": "inhand-right",
"directions": 4
}
]
}
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,14 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "See copyright for above folder (Weapons/Guns/Projectiles)",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "bullet"
}
]
}

0 comments on commit a7990bc

Please sign in to comment.