Bloodgrass gatherable entity + gatherable system cleanup + bugfix (#154)

* added 4 basic reagent effects

* entrance bugfixes

* add bloodgrass world sprites

* preuso cherry pick

* add planet bloodgrass and sickle gathering

* +1 gather sound
This commit is contained in:
Ed
2024-05-18 15:16:20 +03:00
committed by GitHub
parent a29034a133
commit 9690077532
26 changed files with 285 additions and 60 deletions

View File

@@ -1,7 +1,5 @@
using Content.Server.Gatherable.Components;
using Content.Server.Projectiles;
using Content.Shared.Projectiles;
using Content.Shared.Weapons.Ranged.Systems;
using Robust.Shared.Physics.Events;
namespace Content.Server.Gatherable;
@@ -13,20 +11,20 @@ public sealed partial class GatherableSystem
SubscribeLocalEvent<GatheringProjectileComponent, StartCollideEvent>(OnProjectileCollide);
}
private void OnProjectileCollide(EntityUid uid, GatheringProjectileComponent component, ref StartCollideEvent args)
private void OnProjectileCollide(Entity<GatheringProjectileComponent> gathering, ref StartCollideEvent args)
{
if (!args.OtherFixture.Hard ||
args.OurFixtureId != SharedProjectileSystem.ProjectileFixture ||
component.Amount <= 0 ||
gathering.Comp.Amount <= 0 ||
!TryComp<GatherableComponent>(args.OtherEntity, out var gatherable))
{
return;
}
Gather(args.OtherEntity, uid, gatherable);
component.Amount--;
Gather(args.OtherEntity, gathering, gatherable);
gathering.Comp.Amount--;
if (component.Amount <= 0)
QueueDel(uid);
if (gathering.Comp.Amount <= 0)
QueueDel(gathering);
}
}