diff --git a/Content.Server/Explosion/Components/StartTimerOnShootComponent.cs b/Content.Server/Explosion/Components/StartTimerOnShootComponent.cs new file mode 100644 index 0000000000..87096c6402 --- /dev/null +++ b/Content.Server/Explosion/Components/StartTimerOnShootComponent.cs @@ -0,0 +1,6 @@ +namespace Content.Server.Explosion.Components; + +[RegisterComponent] +public sealed partial class StartTimerOnShootComponent : Component +{ +} diff --git a/Content.Server/Explosion/EntitySystems/TriggerSystem.cs b/Content.Server/Explosion/EntitySystems/TriggerSystem.cs index 57847551aa..c7067cecb6 100644 --- a/Content.Server/Explosion/EntitySystems/TriggerSystem.cs +++ b/Content.Server/Explosion/EntitySystems/TriggerSystem.cs @@ -33,6 +33,7 @@ using Robust.Shared.Prototypes; using Robust.Shared.Random; using Robust.Shared.Player; using Content.Shared.Coordinates; +using Content.Shared.Projectiles; using Robust.Shared.Utility; using Robust.Shared.Timing; @@ -91,6 +92,7 @@ namespace Content.Server.Explosion.EntitySystems InitializeMobstate(); SubscribeLocalEvent(OnSpawnTriggered); + SubscribeLocalEvent(StartTimerOnShoot); // Sunrise-Edit SubscribeLocalEvent(OnTriggerCollide); SubscribeLocalEvent(OnActivate); SubscribeLocalEvent(OnImplantTrigger); @@ -239,6 +241,14 @@ namespace Content.Server.Explosion.EntitySystems Trigger(uid); } + // Sunrise-Start + private void StartTimerOnShoot(EntityUid uid, StartTimerOnShootComponent component, ProjectileShotEvent args) + { + if (TryComp(uid, out var projectile)) + StartTimer(uid, projectile.Shooter); + } + // Sunrise-End + private void OnActivate(EntityUid uid, TriggerOnActivateComponent component, ActivateInWorldEvent args) { if (args.Handled || !args.Complex) diff --git a/Content.Shared/Weapons/Ranged/Events/ProjectileShotEvent.cs b/Content.Shared/Weapons/Ranged/Events/ProjectileShotEvent.cs new file mode 100644 index 0000000000..5204161eb2 --- /dev/null +++ b/Content.Shared/Weapons/Ranged/Events/ProjectileShotEvent.cs @@ -0,0 +1,4 @@ +namespace Content.Shared.Weapons.Ranged.Events; + +[ByRefEvent] +public record struct ProjectileShotEvent; diff --git a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs index 4268a5c70d..9f761e179f 100644 --- a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs +++ b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs @@ -460,6 +460,11 @@ public abstract partial class SharedGunSystem : EntitySystem Projectiles.SetShooter(uid, projectile, user ?? gunUid); projectile.Weapon = gunUid; + // Sunrise-Start + var ev = new ProjectileShotEvent(); + RaiseLocalEvent(uid, ref ev); + // Sunrise-End + TransformSystem.SetWorldRotation(uid, direction.ToWorldAngle()); } diff --git a/Resources/Changelog/ChangelogSunrise.yml b/Resources/Changelog/ChangelogSunrise.yml index bb6b5f762c..907ae22488 100644 --- a/Resources/Changelog/ChangelogSunrise.yml +++ b/Resources/Changelog/ChangelogSunrise.yml @@ -5423,11 +5423,34 @@ - author: SplikZerys changes: - message: "\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u044B \u043D\u043E\u0432\ - \u044B\u0435 \u0422\u0422\u0421-\u0433\u043E\u043B\u043E\u0441\u0430 \u0438\ - \u0437 Crysis 2: \u041E\u043F\u0435\u0440\u0430\u0442\u0438\u0432\u043D\ - \u0438\u043A 1 \u0438 Hearthstone: \u041F\u0440\u0438\u043D\u0446 \u0410\u0440\ - \u0442\u0430\u0441 \u0438 \u0422\u0430\u0440\u043A\u0443\u0441." + \u044B\u0435 \u0422\u0422\u0421-\u0433\u043E\u043B\u043E\u0441\u0430 \u0438\u0437\ + \ Crysis 2: \u041E\u043F\u0435\u0440\u0430\u0442\u0438\u0432\u043D\u0438\u043A\ + \ 1 \u0438 Hearthstone: \u041F\u0440\u0438\u043D\u0446 \u0410\u0440\u0442\u0430\ + \u0441 \u0438 \u0422\u0430\u0440\u043A\u0443\u0441." type: Add id: 375 time: '2024-10-30T09:45:39.0000000+00:00' url: https://github.com/space-sunrise/space-station-14/pull/570 +- author: VigersRay + changes: + - message: "\u0420\u0435\u0432\u043E\u0440\u043A China Lake - \u0433\u0440\u0430\ + \u043D\u0430\u0442\u044B \u0442\u0435\u043F\u0435\u0440\u044C \u0432\u0437\u0440\ + \u044B\u0432\u0430\u044E\u0442\u0441\u044F \u043D\u0435 \u043F\u0440\u0438 \u043F\ + \u043E\u043F\u0430\u0434\u0430\u043D\u0438\u0438, \u0430 \u043A\u0430\u043A\ + \ \u043E\u0431\u044B\u0447\u043D\u044B\u0435 \u0433\u0440\u0430\u043D\u0430\u0442\ + \u044B." + type: Tweak + - message: "\u0423\u043C\u0435\u043D\u044C\u0448\u0435\u043D\u0430 \u0446\u0435\u043D\ + \u0430 \u043D\u0430 \u043D\u0430\u0431\u043E\u0440 China Lake. \u0412 \u043D\ + \u0435\u0433\u043E \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u043E 4\ + \ \u042D\u041C\u0418 \u0433\u0440\u0430\u043D\u0430\u0442\u044B." + type: Tweak + - message: "\u0412 \u0430\u043F\u043B\u0438\u043D\u043A \u0434\u043E\u0431\u0430\ + \u0432\u043B\u0435\u043D\u0430 \u044D\u043C\u0438 \u0433\u0440\u0430\u043D\u0430\ + \u0442\u0430 \u0434\u043B\u044F China Lake. \u0426\u0435\u043D\u0430 \u043D\u0430\ + \ \u0432\u0441\u0435 \u0433\u0440\u0430\u043D\u0430\u0442\u044B \u0434\u043B\ + \u044F China Lake \u043F\u043E\u043D\u0438\u0436\u0435\u043D\u0430 \u0434\u043E\ + \ 2-\u0445 \u0442\u043A." + type: Tweak + id: 376 + time: '2024-10-30T17:10:01.155021+00:00' diff --git a/Resources/Prototypes/Catalog/Fills/Backpacks/duffelbag.yml b/Resources/Prototypes/Catalog/Fills/Backpacks/duffelbag.yml index e6b205eff4..95218b3483 100644 --- a/Resources/Prototypes/Catalog/Fills/Backpacks/duffelbag.yml +++ b/Resources/Prototypes/Catalog/Fills/Backpacks/duffelbag.yml @@ -93,6 +93,8 @@ amount: 4 - id: GrenadeFrag amount: 4 + - id: BulletGrenadeEMP + amount: 4 - type: entity parent: ClothingBackpackDuffelSyndicateBundle diff --git a/Resources/Prototypes/Catalog/uplink_catalog.yml b/Resources/Prototypes/Catalog/uplink_catalog.yml index 37b410ac93..7f63e03be6 100644 --- a/Resources/Prototypes/Catalog/uplink_catalog.yml +++ b/Resources/Prototypes/Catalog/uplink_catalog.yml @@ -244,9 +244,9 @@ productEntity: ClothingBackpackDuffelSyndicateFilledGrenadeLauncher discountCategory: veryRareDiscounts discountDownTo: - Telecrystal: 20 + Telecrystal: 15 cost: - Telecrystal: 25 + Telecrystal: 20 categories: - UplinkWeaponry #Sunrise-start diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Launchers/launchers.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Launchers/launchers.yml index 4c48ec1f20..3ebefb82c5 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Launchers/launchers.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Launchers/launchers.yml @@ -44,6 +44,7 @@ - SemiAuto soundGunshot: path: /Audio/Weapons/Guns/Gunshots/grenade_launcher.ogg + projectileSpeed: 15 # Sunrise-Edit - type: BallisticAmmoProvider whitelist: tags: diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml index 828f126608..bb3d32aff9 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml @@ -700,10 +700,37 @@ - type: StaminaDamageOnCollide damage: 80 +# Sunrise-Start +- type: entity + id: BaseBulletGrenade + parent: BaseItem + categories: [ HideSpawnMenu ] + components: + - type: Projectile + damage: + types: + Blunt: 5 + deleteOnCollide: false + - type: StartTimerOnShoot + - type: OnUseTimerTrigger + delay: 2 + - type: Fixtures + fixtures: + fix1: + shape: + !type:PhysShapeAabb + bounds: "-0.25,-0.25,0.25,0.25" + density: 50 + mask: + - ItemMask + restitution: 0.05 + friction: 0.5 + # Sunrise-End + - type: entity id: BulletGrenadeBlast name: blast grenade - parent: BaseBulletTrigger + parent: BaseBulletGrenade # Sunrise-Edit categories: [ HideSpawnMenu ] components: - type: Sprite @@ -720,7 +747,7 @@ - type: entity id: BulletGrenadeFlash name: flash grenade - parent: BaseBulletTrigger + parent: BaseBulletGrenade # Sunrise-Edit categories: [ HideSpawnMenu ] components: - type: Sprite @@ -739,7 +766,7 @@ - type: entity id: BulletGrenadeFrag name: frag grenade - parent: BaseBulletTrigger + parent: BaseBulletGrenade # Sunrise-Edit categories: [ HideSpawnMenu ] components: - type: Sprite @@ -756,7 +783,7 @@ - type: entity id: BulletGrenadeEMP name: EMP rocket - parent: BaseBulletTrigger + parent: BaseBulletGrenade # Sunrise-Edit categories: [ HideSpawnMenu ] components: - type: Sprite diff --git a/Resources/Prototypes/_Sunrise/Catalog/uplink_catalog.yml b/Resources/Prototypes/_Sunrise/Catalog/uplink_catalog.yml index ae93a8fdba..6dfc6f1152 100644 --- a/Resources/Prototypes/_Sunrise/Catalog/uplink_catalog.yml +++ b/Resources/Prototypes/_Sunrise/Catalog/uplink_catalog.yml @@ -80,7 +80,7 @@ icon: { sprite: /Textures/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi, state: frag } productEntity: GrenadeFrag cost: - Telecrystal: 3 + Telecrystal: 2 categories: - UplinkAmmo conditions: @@ -96,7 +96,23 @@ icon: { sprite: /Textures/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi, state: blast } productEntity: GrenadeBlast cost: - Telecrystal: 3 + Telecrystal: 2 + categories: + - UplinkAmmo + conditions: + - !type:BuyerWhitelistCondition + blacklist: + components: + - SurplusBundle + +- type: listing + id: UplinkGrenadeEMP + name: uplink-grenade-emp-name + description: uplink-grenade-emp-desc + icon: { sprite: /Textures/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi, state: emp } + productEntity: GrenadeEMP + cost: + Telecrystal: 2 categories: - UplinkAmmo conditions: