Cherrypicks 5 (#399)
* Give moldy food the "Trash" tag (#29380) Make moldy food items have the "Trash" tag, so they can be collected. * Add "Structure" tag to switches, buttons, and levers (#29378) shit Co-authored-by: Eoin Mcloughlin <helloworld@eoinrul.es> * Revamped Meteor Swarm (#28974) * meteor code and balanced values * Meteor Swarms * Update meteors.yml * Update meteors.yml * HOO! (fix overkill bug and buff space dust) * undo BloodstreamComponent.cs changes * DamageDistribution -> DamageTypes * part 2. * meteor fixes * improve meteor spawning (#29057) * Decrease meteor frequency (#29194) * Make Projectiles Only Hit a Variety of Station Objects Unless Clicked on (#28571) * Revert "Make Projectiles Only Hit a Variety of Station Objects Unless Clicked on (#28571)" This reverts commit 4f934f02f17ce55cabc03b965eb1df7738d63148. * Makes machine parts stackable, removes unused field in stack prototypes (#28434) * Makes machine parts stacks, removes unused field in stack prototypes * forgor * Fix tests * Fixes lathe construction. Yes. This sucks but there's no better way that doesnt involve refactoring machine parts completely * detail * a * Add pressure and temperature warning text to firelocks (#28341) * fix firelocks * missing nukies can be filled in by ghost roles (#28316) * Revert "missing nukies can be filled in by ghost roles (#28316)" This reverts commit 99f13e1e45bc778a4941316fde5d89d7b91337ce. * welding gas mask (#27108) * welding gas mask * eek * Canes + Cane Blade for Syndicate Librarians (#25873) * Cane + Cane Blade * Add - type: ContainerContainer * Add another - type: ContainerContainer * Fix and add proper ContainerContainer component * Add UserInterface component * Remove Space * Stat Changes * review --------- Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com> * Fix stupid NPC. (#26868) * init commit * Review --------- Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com> * fixes --------- Co-authored-by: VeritableCalamity <34698192+Veritable-Calamity@users.noreply.github.com> Co-authored-by: eoineoineoin <github@eoinrul.es> Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Co-authored-by: Cojoke <83733158+Cojoke-dot@users.noreply.github.com> Co-authored-by: AJCM-git <60196617+AJCM-git@users.noreply.github.com> Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com> Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com> Co-authored-by: Ps3Moira <113228053+ps3moira@users.noreply.github.com> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com> Co-authored-by: Vigers Ray <60344369+VigersRay@users.noreply.github.com>
This commit is contained in:
@@ -1,84 +0,0 @@
|
||||
using System.Numerics;
|
||||
using Content.Server.GameTicking.Rules.Components;
|
||||
using Content.Server.StationEvents.Components;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
using Robust.Shared.Spawners;
|
||||
|
||||
namespace Content.Server.StationEvents.Events
|
||||
{
|
||||
public sealed class MeteorSwarmRule : StationEventSystem<MeteorSwarmRuleComponent>
|
||||
{
|
||||
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
||||
|
||||
protected override void Started(EntityUid uid, MeteorSwarmRuleComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args)
|
||||
{
|
||||
base.Started(uid, component, gameRule, args);
|
||||
|
||||
component.WaveCounter = RobustRandom.Next(component.MinimumWaves, component.MaximumWaves);
|
||||
}
|
||||
|
||||
protected override void ActiveTick(EntityUid uid, MeteorSwarmRuleComponent component, GameRuleComponent gameRule, float frameTime)
|
||||
{
|
||||
if (component.WaveCounter <= 0)
|
||||
{
|
||||
ForceEndSelf(uid, gameRule);
|
||||
return;
|
||||
}
|
||||
|
||||
component.Cooldown -= frameTime;
|
||||
|
||||
if (component.Cooldown > 0f)
|
||||
return;
|
||||
|
||||
component.WaveCounter--;
|
||||
|
||||
component.Cooldown += (component.MaximumCooldown - component.MinimumCooldown) * RobustRandom.NextFloat() + component.MinimumCooldown;
|
||||
|
||||
Box2? playableArea = null;
|
||||
var mapId = GameTicker.DefaultMap;
|
||||
|
||||
var query = AllEntityQuery<MapGridComponent, TransformComponent>();
|
||||
while (query.MoveNext(out var gridId, out _, out var xform))
|
||||
{
|
||||
if (xform.MapID != mapId)
|
||||
continue;
|
||||
|
||||
var aabb = _physics.GetWorldAABB(gridId);
|
||||
playableArea = playableArea?.Union(aabb) ?? aabb;
|
||||
}
|
||||
|
||||
if (playableArea == null)
|
||||
{
|
||||
ForceEndSelf(uid, gameRule);
|
||||
return;
|
||||
}
|
||||
|
||||
var minimumDistance = (playableArea.Value.TopRight - playableArea.Value.Center).Length() + 50f;
|
||||
var maximumDistance = minimumDistance + 100f;
|
||||
|
||||
var center = playableArea.Value.Center;
|
||||
|
||||
for (var i = 0; i < component.MeteorsPerWave; i++)
|
||||
{
|
||||
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("MeteorLarge", spawnPosition);
|
||||
var physics = EntityManager.GetComponent<PhysicsComponent>(meteor);
|
||||
_physics.SetBodyStatus(meteor, physics, BodyStatus.InAir);
|
||||
_physics.SetLinearDamping(meteor, physics, 0f);
|
||||
_physics.SetAngularDamping(meteor, physics, 0f);
|
||||
_physics.ApplyLinearImpulse(meteor, -offset.Normalized() * component.MeteorVelocity * physics.Mass, body: physics);
|
||||
_physics.ApplyAngularImpulse(
|
||||
meteor,
|
||||
physics.Mass * ((component.MaxAngularVelocity - component.MinAngularVelocity) * RobustRandom.NextFloat() + component.MinAngularVelocity),
|
||||
body: physics);
|
||||
|
||||
EnsureComp<TimedDespawnComponent>(meteor).Lifetime = 120f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user