Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly move pulping to activity actor, tweak it #79483

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GuardianDll
Copy link
Member

@GuardianDll GuardianDll commented Feb 1, 2025

Summary

Features "You no longer need to dismember corpses separately"

Purpose of change

Fix #79400
Fix #79461
Supersedes #79479 (tho can be merged in parallel)
Tried to fix what i did in #78948, found that pulping, while was ported to activity actors, did not actually used any of it's features

Describe the solution

all the logic in pulp_activity_actor::do_turn was split in pulp_activity_actor::start, pulp_activity_actor::do_turn and pulp_activity_actor::finish where reasonable
Remove all the manual move tweaks, instead speed is handled by "based_on": "speed", activity actor functionality
Revamped the formula for pulping speed, now your best bash tool, survival skill, having a knife, and your knowledge of this specific monster weakpoints; in return, you can learn a little bit of weakpoint proficiency while smashing the monster
Pulping acid corpses now do not trigger any messages, but you spend 2.5 times more time on pulping acid corpse, and all the acid spill only where the corpse is - do not pulp corpse that is lay down right under your character, but smashing it one tile nearby is totally safe, albeit long
pulp effort seemed to be too low, pulping with your bare arms cost only 8 stamina (character regen 20 stamina per second); stamina consumption is increased by 20 todo: need to think for a better way to calculate stamina consumption

Testing

You still can pulp monsters
Npcs still can pulp monsters
You can pulp acid monsters without killing yourself
The game properly save and load you pulping if you autosaved in the meantime

@github-actions github-actions bot added <Bugfix> This is a fix for a bug (or closes open issue) <Enhancement / Feature> New features, or enhancements on existing [JSON] Changes (can be) made in JSON [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Feb 1, 2025
Copy link
Contributor

@moxian moxian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the code, left some comments.

Also please address clang-tidy complaints.

src/activity_actor.cpp Show resolved Hide resolved
src/activity_actor.cpp Show resolved Hide resolved
data/json/player_activities.json Show resolved Hide resolved
src/activity_actor_definitions.h Outdated Show resolved Hide resolved
src/activity_actor.cpp Outdated Show resolved Hide resolved
src/activity_actor.cpp Outdated Show resolved Hide resolved
src/activity_actor.cpp Outdated Show resolved Hide resolved
src/activity_actor.cpp Outdated Show resolved Hide resolved
src/activity_actor.cpp Outdated Show resolved Hide resolved
src/activity_actor.cpp Show resolved Hide resolved
@PatrikLundell
Copy link
Contributor

Suggested additional test: Debug spawn monster a bit away, start pulping, and ensure you're warned when the monster gets dangerously close and that you are actually able to stop pulping at that time. Could also disable warnings and check that you're interrupted by the monster attacking. I'd use a large corpse to ensure pulping takes a lot of time to ensure there's a fair bit of pulping left to do by the time you're interrupted. Could do the same with companion.

@GuardianDll
Copy link
Member Author

Do we even have a way to test popups?

@PatrikLundell
Copy link
Contributor

I don't think there's any automated support, so it would have to be done manually.

@GuardianDll GuardianDll marked this pull request as draft February 2, 2025 21:56
@mqrause
Copy link
Contributor

mqrause commented Feb 3, 2025

There's a test activity_interruption_by_distractions that you probably can just add the activity to, if it isn't part of it already.

But speaking of testing, please test if player speed actually has an influence on pulping speed. Because I think with the current setup there's no difference between speed and time, just one step of pulping per turn.

@github-actions github-actions bot added the NPC / Factions NPCs, AI, Speech, Factions, Ownership label Feb 6, 2025
Copy link
Contributor

github-actions bot commented Feb 6, 2025

Spell checker encountered unrecognized words in the in-game text added in this pull request. See below for details.

Click to expand
  • left one corpse unpulped, for %1$s has no tool heavy enough to deal with it.
  • left some corpses unpulped, for %1$s has no tool heavy enough to deal with it.
  • You left one corpse unpulped, for you have no tool heavy enough to deal with it.
  • You left some corpses unpulped, for you have no tool heavy enough to deal with it.

This alert is automatically generated. You can simply disregard if this is inaccurate, or (optionally) you can also add the new words to tools/spell_checker/dictionary.txt so they will not trigger an alert next time.

Hints for adding a new word to the dictionary
  • If the word is normally in all lowercase, such as the noun word or the verb does, add it in its lower-case form; if the word is a proper noun, such as the surname George, add it in its initial-caps form; if the word is an acronym or has special letter case, such as the acronym CDDA or the unit mW, add it by preserving the case of all the letters. A word in the dictionary will also match its initial-caps form (if the word is in all lowercase) and all-uppercase form, so a word should be added to the dictionary in its normal letter case even if used in a different letter case in a sentence.
  • For a word to be added to the dictionary, it should either be a real, properly-spelled modern American English word, a foreign loan word (including romanized foreign names), or a foreign or made-up word that is used consistently and commonly enough in the game. Intentional misspelling (including eye dialect) of a word should not be added unless it has become a common terminology in the game, because while someone may have a legitimate use for it, another person may spell it that way accidentally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Monsters Monsters both friendly and unfriendly. NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
4 participants