-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Port] Small Energy Crossbow / Маленький Энергетический Арбалет (#60)
* add: ebow * RU Loc * Update BlurOnCollideComponent.cs * test
- Loading branch information
Showing
20 changed files
with
232 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
Content.Shared/_White/Collision/Blur/BlurOnCollideComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
37
Content.Shared/_White/Collision/Blur/BlurOnCollideSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
Content.Shared/_White/Collision/Knockdown/KnockdownOnCollideComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
33 changes: 33 additions & 0 deletions
33
Content.Shared/_White/Collision/Knockdown/KnockdownOnCollideSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
Resources/Locale/ru-RU/_white/prototypes/entities/objects/weapons/guns/battery/ebow.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ent-EnergyCrossbowMini = Mаленький энергетический арбалет | ||
.desc = Стреляет энергетическими болтами, которые отравляют и оглушают цель. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
Resources/Prototypes/_White/Entities/Objects/Weapons/Guns/Battery/mini_ebow.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
31 changes: 31 additions & 0 deletions
31
Resources/Prototypes/_White/Entities/Objects/Weapons/Guns/Projectiles/bolts..yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+4.71 KB
Resources/Textures/_White/Objects/Weapons/Guns/Battery/mini-ebow.rsi/bolt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+548 Bytes
Resources/Textures/_White/Objects/Weapons/Guns/Battery/mini-ebow.rsi/empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+616 Bytes
Resources/Textures/_White/Objects/Weapons/Guns/Battery/mini-ebow.rsi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+352 Bytes
...rces/Textures/_White/Objects/Weapons/Guns/Battery/mini-ebow.rsi/inhand-left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+356 Bytes
...ces/Textures/_White/Objects/Weapons/Guns/Battery/mini-ebow.rsi/inhand-right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions
28
Resources/Textures/_White/Objects/Weapons/Guns/Battery/mini-ebow.rsi/meta.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
] | ||
} |
Binary file added
BIN
+182 Bytes
Resources/Textures/_White/Objects/Weapons/Guns/Projectiles/ebolt.rsi/bullet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions
14
Resources/Textures/_White/Objects/Weapons/Guns/Projectiles/ebolt.rsi/meta.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
] | ||
} |