Action charges refactor (#33993)

* Action charges refactor

- Fixes the slight godmoding of baseactioncomponent.
- Gets back 1ms of server time.

* chorg

* Remove FrameUpdate

* Fixes

* More fixes

* Combine

* Fixes

* Updates

* weh

* Last fixes

* weh

* Fix naughty

* YAML fixes

* This one too

* Merge conflicts

* This thing

* Review

* Fix this as well

* Icon fix

* weh

* Review

* Review

* seamless

* Review
This commit is contained in:
metalgearsloth
2025-04-18 13:45:48 +10:00
committed by GitHub
parent 424f153142
commit 7d2ef2bd47
30 changed files with 366 additions and 399 deletions

View File

@@ -29,7 +29,7 @@ namespace Content.Server.Flash
{
[Dependency] private readonly AppearanceSystem _appearance = default!;
[Dependency] private readonly AudioSystem _audio = default!;
[Dependency] private readonly SharedChargesSystem _charges = default!;
[Dependency] private readonly SharedChargesSystem _sharedCharges = default!;
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly ExamineSystemShared _examine = default!;
@@ -86,15 +86,15 @@ namespace Content.Server.Flash
return false;
TryComp<LimitedChargesComponent>(uid, out var charges);
if (_charges.IsEmpty(uid, charges))
if (_sharedCharges.IsEmpty((uid, charges)))
return false;
_charges.UseCharge(uid, charges);
_sharedCharges.TryUseCharge((uid, charges));
_audio.PlayPvs(comp.Sound, uid);
comp.Flashing = true;
_appearance.SetData(uid, FlashVisuals.Flashing, true);
if (_charges.IsEmpty(uid, charges))
if (_sharedCharges.IsEmpty((uid, charges)))
{
_appearance.SetData(uid, FlashVisuals.Burnt, true);
_tag.AddTag(uid, TrashTag);