From b1f6b220955b77cffac1771e9491d670daecbb71 Mon Sep 17 00:00:00 2001 From: deltanedas <@deltanedas:kde.org> Date: Fri, 20 Sep 2024 13:01:44 +0100 Subject: [PATCH 1/2] make meteors duds on glacier --- .../StationEvents/Events/MeteorSwarmRule.cs | 8 ++- .../Weapons/Guns/Projectiles/meteors.yml | 58 +++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/Content.Server/DeltaV/StationEvents/Events/MeteorSwarmRule.cs b/Content.Server/DeltaV/StationEvents/Events/MeteorSwarmRule.cs index da1575c7c09..52c4e0aade1 100644 --- a/Content.Server/DeltaV/StationEvents/Events/MeteorSwarmRule.cs +++ b/Content.Server/DeltaV/StationEvents/Events/MeteorSwarmRule.cs @@ -1,4 +1,5 @@ using System.Numerics; +using Content.Server.Atmos.Components; using Content.Server.GameTicking.Rules.Components; using Content.Server.StationEvents.Components; using Content.Shared.GameTicking.Components; @@ -12,6 +13,7 @@ namespace Content.Server.StationEvents.Events { public sealed class MeteorSwarmRule : StationEventSystem { + [Dependency] private readonly SharedMapSystem _map = default!; [Dependency] private readonly SharedPhysicsSystem _physics = default!; protected override void Started(EntityUid uid, MeteorSwarmRuleComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args) @@ -40,6 +42,10 @@ protected override void ActiveTick(EntityUid uid, MeteorSwarmRuleComponent compo Box2? playableArea = null; var mapId = GameTicker.DefaultMap; + // use a dud meteor if there's an atmosphere to "simulate" burning up + var proto = "MeteorLargeDeltaV"; + if (_map.TryGetMap(mapId, out var mapUid) && TryComp(mapUid, out var atmos) && !atmos.Space) + proto = "MeteorGlacierDeltaV"; var query = AllEntityQuery(); while (query.MoveNext(out var gridId, out _, out var xform)) @@ -67,7 +73,7 @@ protected override void ActiveTick(EntityUid uid, MeteorSwarmRuleComponent compo var angle = new Angle(RobustRandom.NextFloat() * MathF.Tau); var offset = angle.RotateVec(new Vector2((maximumDistance - minimumDistance) * RobustRandom.NextFloat() + minimumDistance, 0)); var spawnPosition = new MapCoordinates(center + offset, mapId); - var meteor = Spawn("MeteorLargeDeltaV", spawnPosition); + var meteor = Spawn(proto, spawnPosition); var physics = EntityManager.GetComponent(meteor); _physics.SetBodyStatus(meteor, physics, BodyStatus.InAir); _physics.SetLinearDamping(meteor, physics, 0f); diff --git a/Resources/Prototypes/DeltaV/Entities/Objects/Weapons/Guns/Projectiles/meteors.yml b/Resources/Prototypes/DeltaV/Entities/Objects/Weapons/Guns/Projectiles/meteors.yml index 240de32b178..ae6bdc63bde 100644 --- a/Resources/Prototypes/DeltaV/Entities/Objects/Weapons/Guns/Projectiles/meteors.yml +++ b/Resources/Prototypes/DeltaV/Entities/Objects/Weapons/Guns/Projectiles/meteors.yml @@ -38,3 +38,61 @@ mask: - Impassable - BulletImpassable + +# this gets spawned by the meteor swarm rule if the target map has an atmosphere +# since meteors dont make much sense +- type: entity + categories: [ HideSpawnMenu ] + id: MeteorGlacierDeltaV + name: meteor + description: This meteor is burning up like a in the atmosphere, like a... meteor. + components: + - type: Sprite + noRot: false + sprite: Objects/Weapons/Guns/Projectiles/meteor.rsi + scale: 0.5,0.5 + layers: + - state: large + shader: unshaded + - type: PointLight + radius: 3 + energy: 5 + color: "#ff6622" + - type: AmbientSound + enabled: true + volume: 2 + range: 14 + sound: + path: /Audio/Items/Flare/flare_burn.ogg + params: + loop: true + - type: IgnitionSource + ignited: true + temperature: 500 + - type: DeleteOnTrigger + - type: TriggerOnCollide + fixtureID: projectile + - type: Projectile + damage: {} + deleteOnCollide: false + - type: Explosive + explosionType: Default + totalIntensity: 600.0 + intensitySlope: 30 + maxIntensity: 45 + - type: Physics + bodyType: Dynamic + - type: Fixtures + fixtures: + projectile: + shape: + !type:PhysShapeCircle + radius: 0.8 + density: 100 + hard: true + # Didn't use MapGridComponent for now as the bounds are stuffed. + layer: + - LargeMobLayer + mask: + - Impassable + - BulletImpassable From 1f4004c116b8b6561c9779a0ad2d0e9d1590fbb9 Mon Sep 17 00:00:00 2001 From: deltanedas <@deltanedas:kde.org> Date: Fri, 20 Sep 2024 14:02:21 +0100 Subject: [PATCH 2/2] remove unused explosive from copy paste --- .../Entities/Objects/Weapons/Guns/Projectiles/meteors.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Resources/Prototypes/DeltaV/Entities/Objects/Weapons/Guns/Projectiles/meteors.yml b/Resources/Prototypes/DeltaV/Entities/Objects/Weapons/Guns/Projectiles/meteors.yml index ae6bdc63bde..5a95f1ed7d9 100644 --- a/Resources/Prototypes/DeltaV/Entities/Objects/Weapons/Guns/Projectiles/meteors.yml +++ b/Resources/Prototypes/DeltaV/Entities/Objects/Weapons/Guns/Projectiles/meteors.yml @@ -75,11 +75,6 @@ - type: Projectile damage: {} deleteOnCollide: false - - type: Explosive - explosionType: Default - totalIntensity: 600.0 - intensitySlope: 30 - maxIntensity: 45 - type: Physics bodyType: Dynamic - type: Fixtures