CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
9.92k stars 4.08k forks source link

[MoM] Write single variable-based EoC for power contemplation, make it more like other meditation activities #74647

Closed Standing-Storm closed 1 week ago

Standing-Storm commented 1 week ago

Summary

Mods "[MoM] Write single variable-based EoC for power contemplation, make it more like other meditation activities"

Purpose of change

Crafting as a way to contemplate powers is currently necessary but it's a little weird. Though batch-crafting works now, it's back-loaded--you spend ten hours studying and then get a giant whack of Nether Attunement and calorie drain at the end, as well as all your XP, and if you're interrupted you get nothing. This was the problem with some of the powers like Wakeful Rest and I fixed them, and it's time to fix this too.

Describe the solution

The contemplation recipe now takes 30 seconds and then starts an activity with a do_turn_eoc. The activity EoC takes the power name and difficulty as variables and checks your focus, and then increments a hidden variable every second. This extra variable is necessary because power experience is an integer, but once the hidden variable hits 1, the power xp goes up by 1 and the variable is reset. Every minute you contemplate, you have a chance of losing 1 focus. Every three minutes you lose some calories (variable based on power difficulty) and have a chance of gaining Nether Attunement. And since you're no longer actually making the recipe most of the time, a separate EoC handles gaining the appropriate contemplation proficiency for whatever path you're contemplating.

You can meditate as long as you want and cancel the activity at any time.

Describe alternatives you've considered

Testing

Generic EoCs work for both powers (appropriate power is passed through) and contemplation proficiency (appropriate path is leveled). It currently throws the "tried to learn negative without direct" error but #74641 should fix that.

Activity begins as appropriate and may be cancelled at any time. Contemplation gradually builds up Nether Attunement.

Additional context

Going to have to switch the Aftershock Esper over to this too.