-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Limited amount of splints in autodoc #47379
Limited amount of splints in autodoc #47379
Conversation
Also print an error if there's not enough splints. Also fixed a bug where autodoc couldn't splint two broken arms or two broken legs simultaneously.
if( supplies.typeId() == itype_arm_splint ) { | ||
arm_splints.push_back( supplies ); | ||
} | ||
if( supplies.typeId() == itype_leg_splint ) { | ||
leg_splints.push_back( supplies ); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could I suggest a flag instead of a hardcoded id check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it, but as you stated below, it made using use_amount
impossible, so I decided that hardcoded ids would be tolerable for now.
int quantity = 1; | ||
if( part == bodypart_id( "arm_l" ) || part == bodypart_id( "arm_r" ) ) { | ||
if( arm_splints.size() > 0 ) { | ||
for( const item &it : get_map().use_amount( examp, 1, itype_arm_splint, quantity ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though using flags could make this tricky, so it's only a suggestion.
Would it be possible to reload them with splints? |
Yes. Autodoc now functions as container which allows it to hold items inside. |
Summary
Features "Limited amount of splints in autodoc."
Purpose of change
Unlimited splints in autodoc was neither realistic nor fun.
Describe the solution
Describe alternatives you've considered
None.
Testing
Debug-broken both of my character's arms and one leg. Put one arm splint and two leg splints in autodoc. Selected bonesetting in autodoc's menu. One broken arm and broken leg were splinted. Second attempt of bonesetting showed me an error.
Additional context
New list in autodoc's menu depicting available supplies
Two out of three broken limbs were splinted
Second attempt of bonesetting, when there's no available arm splints in autodoc, popped up an error
In order to fix the aforementioned bug, I had to slightly change the logic. Now autodoc forcefully splints the broken limb even if there's another splint set up already. But it's still a good thing as autodoc applies very good level of bonesetting, and your character level of recover for that limb will instantly be bumped to "Mostly recovered".