52 Commits

Author SHA1 Message Date
Ciarán Walsh
c2f4b5145d Defibs will now also shock anyone still interacting with the target. (#35998)
* Defibs will now also shock anyone still interacting with the target.

* Improvements to test readability

* Apply fixes to other tests

* Refactor the interacting entities query to use an event.

* Include pullers as interacting with the entity they are pulling

* Broadcast event

* Use a constant

* Convert new test to InteractionTest

* Convert existing test

* Add behaviour note

* Revert "Convert existing test"

This reverts commit b8a8f2f68e3733bdb6ec254faf955a42096d47d7.

* Move new test into separate (InteractionTest) test file

* Use ToServer

* Use a constant for prototype id

* Use ToServer

* Add EntProtoId constructor

* Add assertion failure messages

* Manual cleanup of test entities

* Remove obsolete flag

* Add test summaries

* Remove tuple constructor

* Wrap entity deletion in WaitPost

* Extend DoAfter interacting test with an extra mob
2025-11-22 23:44:26 +00:00
Hannah Giovanna Dawson
cdbe92d37d Update DamageableSystem to modern standards (#39417)
* Update DamageableSystem to modern standards

* DamageContainerId -> DamageContainerID with lint flag

* Replace strings with protoids

* Make CVar subscription declarations all consistently whitespaced

* ChangeDamage -> TryChangeDamage, cope with C# jank

* Revert event signature changes

* Restore a comment

* Re-add two queries

* Init the queries

* Use appearanceQuery in DamageChanged

* Use damageableQuery in TryChangeDamage

* Use damageableQuery in SetDamageModifierSetId

* Final cleanup, fix sandboxing

* Rectify ExplosionSystem:::ProcessEntity's call to TryChangeDamage

* Re-organize DamageableSystem

* first big fuck you breaking change.

* THATS A LOT OF DAMAGE!!!

* Fix test fails

* test fixes 2

* push it

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
2025-10-27 19:53:04 +00:00
InsoPL
327f217e18 Do after checks for being inside container (#39880)
fix
2025-09-10 12:22:24 -07:00
keronshb
f885075d2e DoAfter support for Actions (#38253)
* Adds Action DoAfter Events

* Adds DoAfterArgs fields to DoAfterComp

* Adds a base doafter action

* Adds Attempt action doafter logic

* Adds doafter logic to actions

* Changes Action Attempt Doafter and action doafter to take in Performer and the original use delay. Use delay now triggers when a repeated action  is cancelled.

* Readds the TryPerformAction method and readds request perform action into the action doafter events

* Adds a force skip to DoAfter Cancel so we can skip the complete check

* Adds a Delay Reduction field to the comp and to the comp state

* Fixes doafter mispredict, changes doafter comp check to a guard clause, sets delay reduction if it exists.

* Cancels ActionDoAfter if charges is 0

* Serializes Attempt Frequency

* Comment for rework

* Changes todo into a comment

* Moves doafterargs to doafterargscomp

* Adds DoAfterArgs comp to BaseDoAfterAction

* Removes unused trycomp with actionDoAfter

* Replaces DoAfterRepateUseDelay const with timespan.zero

* Removes unused usings

* Makes SharedActionsSystem partial, adds DoAfter partial class to ActionSystem, moves ActionDoAfter logic to the SharedActionsSystem.DoAfter class

* Cleanup and prediction

* Renames OnActionDoAfterAttempt to OnActionDoAfter, moves both to Shared Action DoAfter

* Removes ActionAttemptDoAfterEvent and moves its summaries to ActionDoAfterEvent. Converts OnActionDoAfterAttempt into TryStartActionDoAfter

* Removes Extra check for charges and actiondoafters

* Sloptimization

* Cleanup

* Cleanup

* Adds param descs

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
2025-09-08 12:55:13 +03:00
Princess Cheeseballs
9de76e70c7 EVENT BASED WEIGHTLESSNESS (#37971)
* Init Commit

* Typos

* Commit 2

* Save Interaction Test Mob from failing

* ssss

* Confident I've gotten all the correct prototypes

* Whoops forgot to edit those

* aaaaa

* Better solution

* Test fail fixes

* Yaml fix

* THE FINAL TEST FIX

* Final fix(?)

* whoops

* Added a WeightlessnessChangedEvent

* Check out this diff

* Wait I'm dumb

* Final optimization and don't duplicate code

* Death to IsWeightless

* File scoped namespaces

* REVIEW

* Fix test fails

* FIX TEST FAILS REAL

* A

* Commit of doom

* borgar

* We don't need to specify on map init apparently

* Fuck it

* LOAD BEARING COMMENT

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
2025-08-19 14:35:09 -04:00
Myra
0a991593f5 Revert "Fix: Break do_after if target/tool becomes inaccessible" (#39617) 2025-08-13 22:07:46 +02:00
Winkarst-cpu
cea8dea005 Fix: Break do_after if target/tool becomes inaccessible (#35079) 2025-08-13 09:35:35 +03:00
slarticodefast
c4016b97c5 fix DoAfter DistanceThreshold (#39276) 2025-08-06 16:35:31 +02:00
Nemanja
524725d378 HandsSystem Refactor (#38438)
* checkpoint

* pt 2

* pt... i forgot

* pt 4

* patch

* More test fixes

* optimization!!!

* the REAL hand system

* fix RetractableItemActionSystem.cs oversight

* the review

* test

* remove test usage of body prototype

* Update Content.IntegrationTests/Tests/Interaction/InteractionTest.cs

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>

* hellcode

* hellcode 2

* Minor cleanup

* test

* Chasing the last of the bugs

* changes

---------

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
2025-06-25 15:13:03 +02:00
J
af9526197a Extracts magic strings from Tag calls (#36305)
* Extracts magic strings from Tag calls

When #36281 gets merged, the `TagSystem` methods will all give warnings. Let's fix those warnings before they even happen!

* Adds missing libraries

* Remove not yet implemented TagSystem changes

* Fix tag spelling error

Genuinely surprised there was only 1!

* Styling and proper type changes

* Styling

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>

---------

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
2025-04-04 20:20:19 -04:00
Winkarst
6b265b400a Remove inaccessible code from SharedDoAfterSystem (#35089) 2025-02-19 00:02:25 +11:00
Plykiya
9f8ff021ea Fix for stripping doafters (#30821)
Apparently I need to check if they're holding an item

Co-authored-by: plykiya <plykiya@protonmail.com>
2024-08-09 22:02:06 +10:00
Plykiya
190ceda02e Add BreakOnDropItem, update do afters, remove unnecessary declarations (#30361)
* Add BreakOnDropItem, update do afters, remove unnecessary declarations

* bola

* Changed my mind about the nuke

* gennies too

* Make the comments more clear.

* Sorry for the trailing commas

* Revert "Sorry for the trailing commas"

This reverts commit e60fd9a30977393df3344948e6d5c0ce035723cd.

---------

Co-authored-by: plykiya <plykiya@protonmail.com>
2024-08-08 13:39:46 +02:00
Brandon Hu
5bc9c04a02 add(SharedDoAfterSystem): Add a IsRunning "Utility" function (#30512) 2024-07-31 21:32:19 +10:00
Plykiya
b7aa97e203 Replace obsolete EntityCoordiates.InRange() with TransformSystem.InRange() (#29993)
* Replace EntityCoordiates.InRange() with TransformSystem.InRange()

* nullspace

* I figured it out

* man I have no clue how client side sutff works

* please have mercy

* remove RadiationPulseOverlay changes

* nullspace

---------

Co-authored-by: plykiya <plykiya@protonmail.com>
2024-07-13 23:25:51 +02:00
Pieter-Jan Briers
cf374ac905 You can now pry multiple tiles at once (#29231)
* You can now pry multiple tiles at once

* More advanced do after duplicate checking.

Instead of just saying "lol tile prying can raise duplicates", we now have a system so tile prying can properly distinguish events on 2 different tiles. This is achieved with a virtual function on DoAfterEvent.
2024-06-21 00:05:40 +10:00
Leon Friedrich
6d16d6b1c9 Fix DoAfter attempt event null error (#27280)
* Fix DoAfter attempt event null error

* A
2024-04-25 11:54:25 +10:00
nikthechampiongr
362d56981f Simplify DoAfterArgs behavior for movement and distance checks (#25226)
* Merge BreakOnWeightlessMove and BreakOnMove. Provide different theshold for weightless movement.

* Adjust WeightlessMovementThresholds. Put a thing I forgot to put in the doafterargs.

* Make DoAfterArgs only use OnMove to determine whether to check for
movement and MoveThreshold to determine the threshold regardless of
weightlessness. Gave DistanceThreshold a default value which will always
be checked now.

* Fix issue introduced by merge.

* Use interaction system for determining whether a distance is within range

* Fix incorrect doafter args introduced by previous merge.
Forgor to commit these.

* Exorcise ghost.

The execution system should have been deleted when I merged previously.
For a reason I cannot comprehend it came back, but only the execution
system.

* Exorcise ghost Pt. 2

* Allow for movement check to be overriden in zero g and adjust doafter args where needed.

You can now override checking for movement in zero g with the BreakOnWeightlessMove bool. By default it will check.
The following doafters were made to ignore the movement check in zero g:
- Healing yourself with healing items,
- Removing embedded projectiles,
- Using tools like welders and crowbars

* Adjust distance for cuffing/uncuffing to work. Make injections not break on weightless movement.

* Fix evil incorrect and uneeded comments
2024-03-19 21:09:00 +11:00
LordCarve
aafe815122 Obsolete Logger cleanup for EntitySystems (#25941)
* Small obsolete Logger cleanup

* Fixed three EntitySystem logs that weren't doing it right.
2024-03-10 01:15:13 +01:00
DrSmugleaf
9ad1ae5d96 Fix error when starting a DoAfter while handling one on the same entity (#24218)
* Fix error when starting a DoAfter while handling one on the same entity

* Reuse array
2024-01-18 00:01:58 -08:00
TemporalOroboros
19614453d9 Makes thieving gloves sneakier (#21398)
* Hidden DoAfters

* Fix formatting warnings

* Hide progress bar and pickup animation

* Copy Hidden field in copy constructor
2023-11-02 22:10:58 -04:00
metalgearsloth
edbfef22d6 Climbing refactor (#20516) 2023-10-10 16:41:11 -07:00
metalgearsloth
bbbc1174e6 Fix do_after net initial item (#20363) 2023-09-20 22:01:54 +10:00
DrSmugleaf
89337f33bc Fix doafters always being red for the client (#20187) 2023-09-15 10:21:59 +10:00
metalgearsloth
5a0fc68be2 Content update for NetEntities (#18935) 2023-09-11 09:42:41 +10:00
metalgearsloth
789c5e0a2b Add fultons (#18958) 2023-08-29 16:34:05 +10:00
DrSmugleaf
a88e747a0b Refactor serialization copying to use source generators (#19412) 2023-08-22 18:14:33 -07:00
Topy
b85c902189 Added sink (#14348) 2023-06-30 18:10:47 -04:00
metalgearsloth
90110183be Fix a bunch of logger warnings (#17691) 2023-06-27 23:56:52 +10:00
Vordenburg
f8888b0960 Allow specific entities to bypass DoAfter delays (#17349)
* Allow specific entities to bypass DoAfter delays

This adds the InstantDoAfters tag to the admin ghost for mappers.

* Add specific player prototype for InteractionTest
2023-06-15 13:18:38 -06:00
deltanedas
10932cc384 space doafters, like doafters but in space (#16670)
Co-authored-by: deltanedas <@deltanedas:kde.org>
2023-06-03 12:33:41 -07:00
metalgearsloth
e780c6a98a Fix NPC door prying (#15605) 2023-04-21 15:05:29 +10:00
keronshb
c6aae19a16 Adds repeating DoAfters to Food and Drink (#15233) 2023-04-16 08:14:26 +10:00
Leon Friedrich
489660a6bb Add interaction tests (#15251) 2023-04-14 12:41:25 -07:00
Leon Friedrich
61b19b3164 Remove unnecessary dependency injection from DoAfters (#15170) 2023-04-12 03:23:04 +10:00
DrSmugleaf
b947856431 Remove hands component reference (#15197) 2023-04-07 11:21:12 -07:00
Leon Friedrich
6e1fa57155 Fix instant awaited DoAfters (#15088) 2023-04-03 14:53:24 +10:00
Leon Friedrich
19277a2276 More DoAfter Changes (#14609)
* DoAfters

* Compact Clone()

* Fix mice and cuffables

* Try generalize attempt events

* moves climbabledoafter event to shared, fixes issue with climbable target

* Fix merge (cuffing)

* Make all events netserializable

* handful of doafter events moved

* moves the rest of the events to their respective shared folders

* Changes all mentions of server doafter to shared

* stop stripping cancellation

* fix merge errors

* draw paused doafters

* handle unpausing

* missing netserializable ref

* removes break on stun reference

* removes cuffing state reference

* Fix tools

* Fix door prying.

* Fix construction

* Fix dumping

* Fix wielding assert

* fix rev

* Fix test

* more test fixes

---------

Co-authored-by: keronshb <keronshb@live.com>
2023-04-02 21:13:48 -04:00
Leon Friedrich
b148bebd60 Equipment verbs & admin inventory access. (#14315) 2023-03-06 04:12:08 +11:00
keronshb
eff088189d Another batch of DoAfter fixes (#14351) 2023-03-04 21:26:03 -08:00
keronshb
e9dbcc4278 Another round of DoAfter fixes (#14295) 2023-03-01 11:51:42 +11:00
keronshb
9ebb452a3c DoAfter Refactor (#13225)
Co-authored-by: DrSmugleaf <drsmugleaf@gmail.com>
2023-02-25 01:01:25 +01:00
metalgearsloth
71ffca2257 Move do_afters to an overlay (#10463) 2022-08-13 14:32:23 +10:00
keronshb
7896620224 Adds a damage threshold property for DoAfters (#7712) 2022-04-23 17:41:48 -07:00
metalgearsloth
0f1aac396a Fix do_after cancellations 2022-02-28 00:12:47 +11:00
metalgearsloth
6bd0de6299 "ECS" do_after (#6531) 2022-02-19 12:15:57 -07:00
wrexbe
17db0775c8 Auto comp (#6416) 2022-02-02 14:35:40 +11:00
Leon Friedrich
afc3ae6335 Make more uids nullable (#5794) 2021-12-26 13:32:45 +11:00
Visne
c67160ae19 Disable warnings that would be refactored anyway (#5047) 2021-10-27 18:10:40 +02:00
Visne
b7dc3c81ae Remove redundant #nullable enable (#4275) 2021-07-16 17:37:09 -07:00