- Since the marloss stuff did a lot of stuff i had to add a few new affects to not change the old logic
- These include: u_add_addiction, u_lose_addiction, u_vomit (that one is evil :o ), u_fall_asleep, u_heal_all, u_hurt_all, u_set_hunger, u_mod_healthy, u_fil_stomach, u_marlossify (i went of the name already existing for that) and u_add_memorial
- I also added what they do to the documentation EFFECT_ON_CONDITION.md
- The reason for that is that the callback functions that triggered the effect on eating a seed or beery were not called anymore aka dead code
- I also saw that the EOC's for the addictions already existed and used those.
- This allowed me to remove the old / dead code from the iuse.h and iuse.cpp. Same thing in the item_factory.cpp
- The f_map_is_passible function in condition.cpp is supposed to make the spores skip walls like the old code does
- Ah yes and a few tests so i dont go insane testing it manually
- I am also very thankful (!) to the Magiclism and Mind over Matter people since i was able to use that as a reference
- Also whoever made the Docs is amazing too!
This took in fact 9 hours of my life... just for anyone wondering
Changes after feedback:
Fixed the janky broken map logic i created to keep the iuse rng logic
Removed the boolean parameter for vomit and marlossify since it did nothing
Moved the daily_health and hunger assertions to math like suggested
Fixed the eating order issue and now it uses a MARLOSS guard in the can_eat function like suggested
Renamed the NPC_AUTOCONSUME flag to MARLOSS to better reflect the actual usage
Adjustd my existing tests and also added for the order of eating and blacking out. This now uses the time_in_future to keep it in a safe order
Also added a test for the marloss refusal
Added tests in for the new hunger and daily heath math parsers
* get rid of npctalk_var_ prefix for eoc variables
* cleanup after #77055
* deprecate more of type and context
* migrate item vars, make migration happen only once
* doc updates
* migrate u/npc/monster variables
* fix context var migration
* remove `substr( 12 )` in math parser
* move migration to a single function where possible
* no auto
* please clang
* Please clang more
* fix submap load test
* clean up after #77656
* cleanups after #77520
* Add `calories()` math function
* add assigning function
* remove u_val version of the kcal checks
* replaces all instances of u_val('kcal') with new function
* document change
* fix clang tidy error
* Update src/math_parser_diag.cpp
Co-authored-by: mqrause <38702195+mqrause@users.noreply.github.com>
* Update src/math_parser_diag.cpp
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* resolve the rest of shiv, fix (potentially) few tests
* missed the zero
* remove percent calories assigning since you can't assign calories as percent anymore
* remove math kcal test because it's not a shim
* the way this test is made drive me insane
* i was told this can fix the test
* spare me
* now this one is my fault
* fix MoM using old syntax
* Do floating point math
Co-authored-by: anothersimulacrum <anothersimulacrum@gmail.com>
* get rid of magic number
* revert `Do floating point math` because i don't want static cast all the returns in the function.
better approach would be divide this function in two, one for raw value that return int, one for percent value that return double
or function that return healthy kcal directly
* add `-> double`
* Update src/math_parser_diag.cpp
Co-authored-by: anothersimulacrum <anothersimulacrum@gmail.com>
---------
Co-authored-by: mqrause <38702195+mqrause@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: anothersimulacrum <anothersimulacrum@gmail.com>
* math_parser: implement real kwargs
* options/eoc: fix segfault in game_option()
* math_parser: hold diag functions in a map
map::find is more efficient for a container of this size
also reduces churn when adding functions
* eoc: obsolete mission_goal_condition_context
* eoc: untemplate all EOC code
* condition: post-untemplating cleanup
fix some errors that clang-tidy can catch now that the code isn't templated