add: Прототип гранатомета СБ (#479)
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
namespace Content.Server._White.Explosion;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed partial class TriggerOnLandComponent : Component
|
||||
{
|
||||
[DataField]
|
||||
public float Delay = 0.3f;
|
||||
}
|
||||
19
Content.Server/_White/Explosion/TriggerOnLandSystem.cs
Normal file
19
Content.Server/_White/Explosion/TriggerOnLandSystem.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Content.Server.Explosion.EntitySystems;
|
||||
using Content.Shared.Throwing;
|
||||
|
||||
namespace Content.Server._White.Explosion;
|
||||
|
||||
public sealed class TriggerOnLandSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly TriggerSystem _timer = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<TriggerOnLandComponent, LandEvent>(OnLand);
|
||||
}
|
||||
|
||||
private void OnLand(EntityUid uid, TriggerOnLandComponent component, ref LandEvent args)
|
||||
{
|
||||
_timer.HandleTimerTrigger(uid, null, component.Delay, 1, null, null);
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ using Content.Shared.Damage.Events;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.Effects;
|
||||
using Content.Shared.IdentityManagement;
|
||||
using Content.Shared.Item.ItemToggle.Components;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Projectiles;
|
||||
using Content.Shared.Rejuvenate;
|
||||
@@ -258,11 +259,19 @@ public sealed partial class StaminaSystem : EntitySystem
|
||||
return;
|
||||
|
||||
// Have we already reached the point of max stamina damage?
|
||||
if (component.Critical)
|
||||
if (component.Critical) // WD EDIT
|
||||
{
|
||||
if (TryComp<StunLockComponent>(with, out _)) // WD EDIT
|
||||
if (TryComp<StunLockComponent>(with, out _))
|
||||
{
|
||||
if (TryComp<ItemToggleComponent>(with, out var toggle) && !toggle.Activated)
|
||||
return;
|
||||
_stunSystem.TryParalyze(uid, component.StunTime, true);
|
||||
return;
|
||||
if (visual)
|
||||
_color.RaiseEffect(Color.Aqua, new List<EntityUid>() { uid }, Filter.Pvs(uid, entityManager: EntityManager));
|
||||
if (_net.IsServer)
|
||||
_audio.PlayPvs(sound, uid);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var oldDamage = component.StaminaDamage;
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
- type: entity
|
||||
name: BaseWeaponLauncher
|
||||
parent: BaseItem
|
||||
id: BaseWeaponLauncher
|
||||
description: A rooty tooty point and shooty.
|
||||
@@ -0,0 +1,147 @@
|
||||
- type: entity
|
||||
name: Riot Launcher
|
||||
parent: BaseItem
|
||||
id: RiotWeaponLauncher
|
||||
description: ShitSec Launcher
|
||||
components:
|
||||
- type: Sprite
|
||||
sprite: White/Objects/Weapons/Guns/Launchers/china_lake-icons.rsi
|
||||
layers:
|
||||
- state: icon
|
||||
map: ["enum.GunVisualLayers.Base"]
|
||||
- type: Item
|
||||
sprite: White/Objects/Weapons/Guns/Launchers/china_lake-inhands.rsi
|
||||
- type: Clothing
|
||||
sprite: White/Objects/Weapons/Guns/Launchers/china_lake-inhands.rsi
|
||||
slots:
|
||||
- Back
|
||||
- suitStorage
|
||||
- type: AmmoCounter
|
||||
- type: Gun
|
||||
fireRate: 1
|
||||
selectedMode: SemiAuto
|
||||
projectileSpeed: 10
|
||||
projectileSpeedModified: 10
|
||||
availableModes:
|
||||
- SemiAuto
|
||||
soundGunshot:
|
||||
path: /Audio/Weapons/Guns/Gunshots/grenade_launcher.ogg
|
||||
- type: BallisticAmmoProvider
|
||||
whitelist:
|
||||
tags:
|
||||
- RiotGrenade
|
||||
capacity: 1
|
||||
proto: RiotGrenadeFlash
|
||||
soundInsert:
|
||||
path: /Audio/Weapons/Guns/MagIn/batrifle_magin.ogg
|
||||
autoCycle: false
|
||||
|
||||
- type: entity
|
||||
id: BaseRiotGrenade
|
||||
name: base riot grenade
|
||||
parent: BaseItem
|
||||
abstract: true
|
||||
components:
|
||||
- type: Tag
|
||||
tags:
|
||||
- RiotGrenade
|
||||
- type: Item
|
||||
size: Small
|
||||
- type: Sprite
|
||||
|
||||
- type: entity
|
||||
id: RiotGrenadeFlash
|
||||
name: riot flash grenade
|
||||
parent: BaseRiotGrenade
|
||||
components:
|
||||
- type: CartridgeAmmo
|
||||
proto: RiotBulletGrenadeFlash
|
||||
- type: Sprite
|
||||
sprite: Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi
|
||||
layers:
|
||||
- state: blast
|
||||
map: ["enum.AmmoVisualLayers.Base"]
|
||||
- type: Appearance
|
||||
- type: SpentAmmoVisuals
|
||||
state: flash
|
||||
suffix: false
|
||||
|
||||
- type: entity
|
||||
id: RiotGrenadeSmoke
|
||||
name: riot smoke grenade
|
||||
parent: BaseRiotGrenade
|
||||
components:
|
||||
- type: CartridgeAmmo
|
||||
proto: RiotBulletGrenadeSmoke
|
||||
- type: Sprite
|
||||
sprite: Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi
|
||||
layers:
|
||||
- state: blast
|
||||
map: ["enum.AmmoVisualLayers.Base"]
|
||||
- type: Appearance
|
||||
- type: SpentAmmoVisuals
|
||||
state: smoke
|
||||
suffix: false
|
||||
|
||||
- type: entity
|
||||
id: BaseBulletRiotGranade
|
||||
name: base roit granade
|
||||
abstract: true
|
||||
components:
|
||||
- type: MovedByPressure
|
||||
- type: FlyBySound
|
||||
- type: Clickable
|
||||
- type: Sprite
|
||||
noRot: false
|
||||
sprite: Objects/Weapons/Guns/Projectiles/projectiles2.rsi
|
||||
layers:
|
||||
- state: grenade
|
||||
- type: Fixtures
|
||||
fixtures:
|
||||
fix1:
|
||||
shape:
|
||||
!type:PhysShapeAabb
|
||||
bounds: "-0.25,-0.25,0.25,0.25"
|
||||
density: 20
|
||||
mask:
|
||||
- ItemMask
|
||||
restitution: 0.3 # fite me
|
||||
friction: 0.2
|
||||
- type: DeleteOnTrigger
|
||||
- type: Physics
|
||||
bodyType: Dynamic
|
||||
- type: TimedDespawn
|
||||
lifetime: 10
|
||||
- type: TriggerOnLand
|
||||
|
||||
- type: entity
|
||||
id: RiotBulletGrenadeFlash
|
||||
name: flash riot grenade
|
||||
parent: BaseBulletRiotGranade
|
||||
noSpawn: true
|
||||
components:
|
||||
- type: Sprite
|
||||
sprite: Objects/Weapons/Guns/Projectiles/projectiles2.rsi
|
||||
layers:
|
||||
- state: grenade
|
||||
- type: FlashOnTrigger
|
||||
range: 7
|
||||
forceStun: true
|
||||
- type: SpawnOnTrigger
|
||||
proto: GrenadeFlashEffect
|
||||
|
||||
- type: entity
|
||||
id: RiotBulletGrenadeSmoke
|
||||
name: smoke riot grenade
|
||||
parent: BaseBulletRiotGranade
|
||||
noSpawn: true
|
||||
components:
|
||||
- type: Sprite
|
||||
sprite: Objects/Weapons/Guns/Projectiles/projectiles2.rsi
|
||||
layers:
|
||||
- state: grenade
|
||||
- type: SmokeOnTrigger
|
||||
duration: 30
|
||||
spreadAmount: 50
|
||||
- type: SoundOnTrigger
|
||||
sound: /Audio/Items/smoke_grenade_smoke.ogg
|
||||
Reference in New Issue
Block a user