Migrated hitscan protos to new entity. Fixed vox emotes.

This commit is contained in:
Vanessa
2025-12-29 11:39:27 -06:00
parent 760f44386e
commit f440bc0ebd
7 changed files with 139 additions and 112 deletions
@@ -14,6 +14,7 @@ using Content.Shared.Mobs.Systems;
using Content.Shared.Popups;
using Content.Shared.Projectiles;
using Content.Shared.Verbs;
using Content.Shared.Weapons.Hitscan.Components;
using Content.Shared.Weapons.Ranged;
using Content.Shared.Weapons.Ranged.Components;
using Content.Shared.Weapons.Ranged.Events;
@@ -235,9 +236,7 @@ public sealed class ExecutionSystem : EntitySystem
var prototype = _prototypeManager.Index<EntityPrototype>(cartridge.Prototype);
prototype.TryGetComponent<ProjectileComponent>(out var projectileA, _componentFactory); // sloth forgive me
if (projectileA != null)
{
damage = projectileA.Damage;
}
// Expend the cartridge
cartridge.Spent = true;
@@ -248,14 +247,16 @@ public sealed class ExecutionSystem : EntitySystem
case AmmoComponent newAmmo:
if (TryComp<ProjectileComponent>(ammoUid, out var projectileB))
{
damage = projectileB.Damage;
}
Del(ammoUid);
break;
case HitscanPrototype hitscan:
damage = hitscan.Damage!;
case HitscanAmmoComponent hitscan:
if (TryComp<HitscanBasicDamageComponent>(ammoUid, out var hitscanDamage))
damage = hitscanDamage.Damage;
Del(ammoUid); // Im guessing we delete this too?
break;
default:
@@ -264,8 +265,7 @@ public sealed class ExecutionSystem : EntitySystem
// Clumsy people have a chance to shoot themselves (not in the head)
if (!component.ClumsyProof &&
TryComp<ClumsyComponent>(attacker, out var clumsy) &&
_random.Prob(1f/3f))
TryComp<ClumsyComponent>(attacker, out var clumsy) && _random.Prob(1f / 3f))
{
ShowExecutionPopup("execution-popup-gun-clumsy-internal", Filter.Entities(attacker), PopupType.Medium, attacker, victim, weapon);
ShowExecutionPopup("execution-popup-gun-clumsy-external", Filter.PvsExcept(attacker), PopupType.MediumCaution, attacker, victim, weapon);