* Fix usages of TryIndex()
Most usages of TryIndex() were using it incorrectly. Checking whether prototype IDs specified in prototypes actually existed before using them. This is not appropriate as it's just hiding bugs that should be getting caught by the YAML linter and other tools. (#39115)
This then resulted in TryIndex() getting modified to log errors (94f98073b0), which is incorrect as it causes false-positive errors in proper uses of the API: external data validation. (#39098)
This commit goes through and checks every call site of TryIndex() to see whether they were correct. Most call sites were replaced with the new Resolve(), which is suitable for these "defensive programming" use cases.
Fixes#39115
Breaking change: while doing this I noticed IdCardComponent and related systems were erroneously using ProtoId<AccessLevelPrototype> for job prototypes. This has been corrected.
* fix tests
---------
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
* Title
* Tired
* That shit did nothing goddamn
* Fix for real
* Use og code
* Hmmm borgaer
---------
Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
* Delete original entity when polymorph is deleted
* Switch to EntityTerminatingEvent
* Add RevertOnDelete option to PolymorphPrototype
* Fix error on server shutdown while polymorphed
* Set RevertOnDelete to false by default
* AsNullable
* Revert "Set RevertOnDelete to false by default"
This reverts commit 087c43fbb923c9369c61c9d001e18814b3de3aca.
* Use pattern matching instead of .Value
* Shelve
* 22 file diff
* What if it was just better
* Hold that thought
* Near final Commit, then YAML hell
* 95% done with cs
* Working Commit
* Final Commit (Before reviews tear it apart and kill me)
* Add a really stupid comment.
* KILL
* EXPLODE TEST FAILS WITH MY MIND
* I hate it here
* TACTICAL NUCLEAR STRIKE
* Wait what the fuck was I doing?
* Comments
* Me when I'm stupid
* Food doesn't need solutions
* API improvements with some API weirdness
* Move non-API out of API
* Better comment
* Fixes and spelling mistakes
* Final fixes
* Final fixes for real...
* Kill food and drink localization files because I hate them.
* Water droplet fix
* Utensil fixes
* Fix verb priority (It should've been 2)
* A few minor localization fixes
* merge conflict and stuff
* MERGE CONFLICT NUCLEAR WAR!!!
* Cleanup
---------
Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
* Add an event for polymorph actions
* Subscribe FollowerSystem to the event
* Add check that unfollow target is actually current target.
* Make followers try to follow on state update; Dirty follower on follow.
* Changed comments to be more clear and uniform.
EggLayer uses NextGrowth instead of frame accumulation.
Egglayer uses much less energy to make eggs, and lay time is randomized for player and AI chicken.
* UdderComponent ReagentId can be changed now
UdderSystem and WoolySystem use SharedSolutionContainerSystem now
* Entities with udders can be examined to see a rough hunger level
udders and wooly stop reagent generation/extra nutrient usage once the solution container is full
* Moved stuff to Shared
AutoPausedField now
* Cleanup moving stuff to Shared
* Oops. Make UdderSystem sealed instead of abstract.
* Switch PopupEntity for PopupClient
* Didn't mean to delete Access
* new() instead of default! prototype
revert egglayer balance change
NextGrowth += timespan in egglayer
* forgot [Datafield] for NextGrowth
* forgot NetworkedComponent again...
* Renaming Shared Animal to Shared Animals to match Server
Hopefully also resolve merge conflicts.
* Fix incorrect filename
* Update with requested changes
Put UdderSystem dependencies in alphabetical order.
Initialise NextGrowth for Udder and Wooly components on MapInitEvent.
Clean-up EggLayerSystem a little.
Re-write OnExamine function for UdderSystem, improving clarity.
Add full stops to end of udder examine locales.
And more :)
* Add some additional descriptions for cow hunger levels.
* Add Udder and Wooly quantity to AutoNetworkedField
* Account for less than starving threshold.
---------
Co-authored-by: sirionaut <sirionaut@gmail.com>
Co-authored-by: Sirionaut <148076704+Sirionaut@users.noreply.github.com>
Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
* Act
* Adds Jaunt ECS and related prototypes
* Adds jaunt sounds
* Adds enter and exit sound support to polymorphs
* Updates jaunt description
* Adds jaunt action sprite and changes jaunt polymorph to use it
* Adds Jaunt and upgrade to the wizard grimoire
* Makes base mob jaunt parent off of incorporeal and basemob, adds blue ghost sprite for ethereal jaunt
* Update Resources/Locale/en-US/store/spellbook-catalog.ftl
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
* Update Resources/Prototypes/Entities/Mobs/Player/jaunt_mobs.yml
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
* Update Resources/Prototypes/Entities/Mobs/Player/jaunt_mobs.yml
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
* Update Resources/Prototypes/Entities/Mobs/Player/jaunt_mobs.yml
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
* Update Content.Shared/Polymorph/PolymorphPrototype.cs
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
* Update Content.Shared/Polymorph/PolymorphPrototype.cs
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
* removes meta changes
* removes other meta changes
* adds context menu and a description to basemobjaunt
* comments for jaunt component and adds on component shutdown method
* Update Content.Shared/Jaunt/JauntComponent.cs
* Update Content.Shared/Jaunt/JauntComponent.cs
* Update Content.Shared/Jaunt/JauntComponent.cs
* Update Resources/Prototypes/Catalog/spellbook_catalog.yml
---------
Co-authored-by: lzk <124214523+lzk228@users.noreply.github.com>
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
* polymorph changes
Adds poly proto ids to polymorph action event and checks for proto id when performing
* nullable proto id
* Replaces instances of Polymorph prototype with a proto id and tryindex
* birdup
---------
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
* remove deprecated entity coordinate extension functions. Reduces warning count by approximately 50
* final toCoords Removed
* Remove all unused variables and dead code paths
* remove always true variable, should be a cvar or something instead
* remove superfluous variables from tests
* Fix robusted dionas not being recoverable
* Implement a polymorph cooldown field, used for TreeMorph
Allows the polymorphed Diona some time to work off robust harvest
without immediately polymorphing again.
* Minor adjustment to polymorph cooldown timing
* Apply suggestions from code review
Co-authored-by: Kara <lunarautomaton6@gmail.com>
* fix: trigger polymorph revert on destruction
As suggested by mirrorcult, DamageThresholdReached is not the ideal
candidate for reverting a polymorph on destruction, as there exists a
DestructionEventArgs to listen for instead.
---------
Co-authored-by: Kara <lunarautomaton6@gmail.com>