Skip to content

Commit

Permalink
Implement shoot over segment
Browse files Browse the repository at this point in the history
  • Loading branch information
VMSolidus committed Jun 24, 2024
1 parent de23fec commit 84edee0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
11 changes: 0 additions & 11 deletions Content.Shared/SegmentedEntity/SegmentedEntitySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public override void Initialize()
SubscribeLocalEvent<SegmentedEntityComponent, DidEquipEvent>(OnDidEquipEvent);
SubscribeLocalEvent<SegmentedEntityComponent, DidUnequipEvent>(OnDidUnequipEvent);
SubscribeLocalEvent<SegmentedEntitySegmentComponent, GetExplosionResistanceEvent>(OnSnekBoom);
SubscribeLocalEvent<SegmentedEntitySegmentComponent, PreventCollideEvent>(PreventShootSelf);
SubscribeLocalEvent<SegmentedEntitySegmentComponent, DamageChangedEvent>(HandleDamageTransfer);
SubscribeLocalEvent<SegmentedEntitySegmentComponent, DamageModifyEvent>(HandleSegmentDamage);
SubscribeLocalEvent<SegmentedEntitySegmentComponent, SegmentSpawnedEvent>(OnSegmentSpawned);
Expand Down Expand Up @@ -265,16 +264,6 @@ private void OnDidUnequipEvent(EntityUid equipee, SegmentedEntityComponent compo
}
}

private void PreventShootSelf(EntityUid uid, SegmentedEntitySegmentComponent component, ref PreventCollideEvent args)
{
if (!TryComp<ProjectileComponent>(args.OtherEntity, out var projectileComponent)) return;

if (projectileComponent.Shooter == component.Lamia)
{
args.Cancelled = true;
}
}

private void OnShootHitscan(EntityUid uid, SegmentedEntityComponent component, ref HitScanAfterRayCastEvent args)
{
if (args.RayCastResults == null) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
- type: Tag
tags:
- HideContextMenu
- type: RequireProjectileTarget
active: True

- type: entity
id: LamiaSegment
Expand Down

0 comments on commit 84edee0

Please sign in to comment.