Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upReplace instant healing with slow healing effects. #23757
Conversation
This comment has been minimized.
This comment has been minimized.
|
Will there be some refactoring for broken limb healing? |
This comment has been minimized.
This comment has been minimized.
|
Broken limb recovery was not changed so it will be the same as before. |
This comment has been minimized.
This comment has been minimized.
|
What about skill gain for self-learners? |
Night-Pryanik
reviewed
May 18, 2018
| "torso_power" : 18, | ||
| "limb_power" : 0, | ||
| "head_power" : 0, | ||
| "torso_power" : 0, |
This comment has been minimized.
This comment has been minimized.
Night-Pryanik
May 18, 2018
Member
Both head_power and torso_power equals to zero by default and can be completely removed.
| "limb_power" : 8, | ||
| "limb_scaling" : 1, | ||
| "limb_power" : 0, | ||
| "limb_scaling" : 0, |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| @@ -2909,6 +2911,27 @@ long heal_actor::finish_using( player &healer, player &patient, item &it, hp_par | |||
| } | |||
| } | |||
|
|
|||
| // apply healing over time effects | |||
| float heal_stack = 4 + 2 * healer.get_skill_level( skill_firstaid ); | |||
| if( it.has_flag( "BANDAGES" ) && it.has_flag( "DISINFECTANT" ) ) { | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Vasyan2006
May 18, 2018
Author
Contributor
Only first aid kits have both flags and they apply both effects with higher intensity to compensate hight ammount of materials.
| if( remove_med >= bandaged_intensity ) { | ||
| remove_effect( effect_bandaged, hurt ); | ||
| remove_med -= bandaged_intensity; | ||
| add_msg_if_player( m_bad, ( "Bandages on your %s was destroyed!" ), body_part_name( hurt ) ); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@pisskop Edit skill gain, so it should be on the same level as before. |
This comment has been minimized.
This comment has been minimized.
|
See #7029 and #16017 (comment) Tl;dr, I love this change. |
This comment has been minimized.
This comment has been minimized.
|
It would be great if healing rate is jsoned and easily modify by mod. |
This comment has been minimized.
This comment has been minimized.
|
I will move all coefficients to jsons and try to implement other mentioned features, so new version will be "soon"(r)(tm). |
BevapDin
reviewed
May 19, 2018
| @@ -4319,6 +4360,57 @@ void player::regen( int rate_multiplier ) | |||
| } | |||
| } | |||
|
|
|||
| // include healing effects | |||
| for( int i = 0; i < num_hp_parts; i++ ) { | |||
This comment has been minimized.
This comment has been minimized.
BevapDin
May 19, 2018
Contributor
Consider iterating over all body parts via something like for( const body_part bp : all_body_parts ) { ...
Note that body_part is implicitly convertible to an integer, so you can use it directly as index into an array (e.g. no separate int variable needed).
This comment has been minimized.
This comment has been minimized.
Vasyan2006
Jun 3, 2018
Author
Contributor
But all_body_parts includes feets and hands, so it can not be used here directly.
BevapDin
reviewed
May 19, 2018
| int disinfected_intensity = 0; | ||
|
|
||
| if( remove_med > 0 && has_effect( effect_bandaged, hurt ) ) { | ||
| auto matching_map_bandaged = effects->find( effect_bandaged ); |
This comment has been minimized.
This comment has been minimized.
BevapDin
May 19, 2018
Contributor
Why are you accessing the effects map directly instead of using the function in Creature, like get_effect?
This comment has been minimized.
This comment has been minimized.
BevapDin
reviewed
May 19, 2018
| auto &bodyparts = matching_map_bandaged->second; | ||
| auto found_effect = bodyparts.find( bp ); | ||
| if( found_effect != bodyparts.end() ) { | ||
| effect &e = found_effect->second; |
This comment has been minimized.
This comment has been minimized.
BevapDin
May 19, 2018
Contributor
Several lines above can be replaced with
effect &e = get_effect( effect_bandaged, bp );
if( !e.is_null() ) {
BevapDin
reviewed
May 19, 2018
| } | ||
| bandaged_intensity = std::min( bandaged_intensity, 8 ); | ||
| disinfected_intensity = std::min( disinfected_intensity, 8 ); | ||
| rate_medicine += 0.0002f * bandaged_intensity + 0.0002f * disinfected_intensity ; |
This comment has been minimized.
This comment has been minimized.
BevapDin
reviewed
May 19, 2018
| @@ -644,7 +648,7 @@ class Character : public Creature, public visitable<Character> | |||
| bool male; | |||
|
|
|||
| std::list<item> worn; | |||
| std::array<int, num_hp_parts> hp_cur, hp_max; | |||
| std::array<int, num_hp_parts> hp_cur, hp_max, damage_bandaged, damage_disinfected; | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
New version:
|
Night-Pryanik
reviewed
Jun 3, 2018
| extract_effect( j, mod_data, "healing_rate", member, "HEAL_MED_RATE", "amount" ); | ||
| extract_effect( j, mod_data, "healing_rate_w_other_effects", member, "HEAL_MED_RATE_W_OTHER", "amount" ); | ||
| extract_effect( j, mod_data, "healing_mult_regen", member, "HEAL_MED_REGEN", "amount" ); | ||
| extract_effect( j, mod_data, "healing_head_mult", member, "HEAL_HEAD_MULT", "amount" ); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Vasyan2006
Jun 4, 2018
Author
Contributor
It does not look much better after Astyle with --style=1tbs --attach-inlines --indent=spaces=4 --align-pointer=name --max-code-length=100 --break-after-logical --indent-classes --indent-preprocessor --indent-switches --indent-col1-comments --min-conditional-indent=0 --pad-oper --unpad-paren --pad-paren-in --add-brackets --convert-tabs.
This comment has been minimized.
This comment has been minimized.
Night-Pryanik
Jun 4, 2018
Member
effect.cpp is in astyle_blacklist. It can violate astyle if needed.
This comment has been minimized.
This comment has been minimized.
|
Must rebuilt this PR on new version, overwise it creates too much conflicts. |
Night-Pryanik
reviewed
Jun 4, 2018
| "bleed" : 0.9, | ||
| "move_cost" : 300 | ||
| } | ||
| }, | ||
| { | ||
| "id": "bandages_makeshift", |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
You are constantly working on your PR. Consider adding [WIP] prefix to its name until you think it is finished. |
Vasyan2006
changed the title
Replace instant healing with slow healing effects.
[WIP] Replace instant healing with slow healing effects.
Jun 4, 2018
Vasyan2006
force-pushed the
Vasyan2006:bandages-disinfectant-and-similar-medicine
branch
Jun 8, 2018
This comment has been minimized.
This comment has been minimized.
|
It was rebase, looks like nothing was broken. |
This comment has been minimized.
This comment has been minimized.
|
New healing properties will be displayed in item description. |
This comment has been minimized.
This comment has been minimized.
|
Add makeshift bandages crafted from rags only without any skill. Advanced version requires cooking skill. So almost every character will be able to craft most simple remedy. |
Night-Pryanik
reviewed
Jun 8, 2018
| "use_action": { "type": "heal", "limb_power": 0, "bandages_power": 2, "bleed": 0.9, "move_cost": 300 } | ||
| }, | ||
| { | ||
| "id": "bandages_makeshift_bleached", |
This comment has been minimized.
This comment has been minimized.
Night-Pryanik
Jun 8, 2018
Member
You can use copy-from from bandages_makeshift for this and for boiled variants.
This comment has been minimized.
This comment has been minimized.
| @@ -2716,6 +2719,11 @@ void heal_actor::load( JsonObject &obj ) | |||
| limb_power = obj.get_float( "limb_power" ); | |||
This comment has been minimized.
This comment has been minimized.
Night-Pryanik
Jun 8, 2018
Member
As direct healing is no longer the case, you could remove limb_power, head_power and torso_power from here and from the jsons.
This comment has been minimized.
This comment has been minimized.
Vasyan2006
Jun 9, 2018
Author
Contributor
I think it is a bad idea to remove working game mechanic from a sandbox game. limb_power is now an optional parameter and removed from jsons (but can be restored).
| long heal_actor::finish_using( player &healer, player &patient, item &it, hp_part healed ) const | ||
| { | ||
| float practice_amount = std::max( 9.0f, limb_power * 3.0f ); | ||
| float practice_amount = limb_power * 3.0f; |
This comment has been minimized.
This comment has been minimized.
Night-Pryanik
Jun 8, 2018
Member
limb_power now equals to zero in case of all healing meds. Should be removed?
| int bandages_intensity = get_bandaged_level( healer ); | ||
| patient.add_effect( effect_bandaged, 1_turns, bp_healed ); | ||
| effect &e = patient.get_effect( effect_bandaged, bp_healed ); | ||
| e.set_duration( e.get_int_dur_factor() * bandages_intensity ); |
This comment has been minimized.
This comment has been minimized.
Night-Pryanik
Jun 8, 2018
Member
Excessive space before the closing bracket here and in the similar block below.
| } | ||
|
|
||
| // remove effects if the limb was healed by other way | ||
| if( has_effect( effect_disinfected, bp ) && ( hp_cur[i] == hp_max[i] ) ) { |
This comment has been minimized.
This comment has been minimized.
Night-Pryanik
Jun 8, 2018
Member
Could this be moved up to the if( damage_bandaged[i] <= 0 ) { as another (||) option?
This comment has been minimized.
This comment has been minimized.
Vasyan2006
Jun 9, 2018
Author
Contributor
This check is separated for the case if the limb is at full HP but still have damage_bandaged and bandaged effect (it was healed by nanobots, for example).
This comment has been minimized.
This comment has been minimized.
|
Add "used_up_item" for drugs, so chloroform rag will not be applied to a body part but can be used in the correct way. |
Coolthulhu
reviewed
Jul 1, 2018
| float disinfected_rate = 0.0f; | ||
|
|
||
| if( has_effect( effect_bandaged, bp ) ) { | ||
| const effect &e_bandaged = get_effect( effect_bandaged, bp ); |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jul 1, 2018
Contributor
has_effect gets effect on the inside, so you're getting the effect twice.
Instead you could call get_effect and then check if it was null by calling e_bandaged.is_null().
This comment has been minimized.
This comment has been minimized.
|
Why do you need those "hp disinfected", "hp bandaged" variables? They make the whole thing pretty ugly and hard to maintain. |
Coolthulhu
reviewed
Jul 1, 2018
| /** How many intensity levels will be applied when healing limbs? */ | ||
| float disinfectant_power = 0; | ||
| /** Extra intensity levels gained per skill level when healing limbs. */ | ||
| float disinfectant_scaling = 0; |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jul 1, 2018
Contributor
You could merge those into something like this:
struct scaled_effect_data {
efftype_id effect;
float base;
float scaling;
};
std::vector<scaled_effect_data> scaled_effects;
Then, instead of checking if( bandages_power > 0), you'd iterate over scaled_effects and apply all of those, without checks (checks could be done at load time).
This would be more generic, so if later someone wanted to add a new effect, say "immobilized", "moistened", "wound sewn" and so on, it wouldn't need any extra work to work.
This comment has been minimized.
This comment has been minimized.
Vasyan2006
Jul 1, 2018
Author
Contributor
"disinfectant_power " and "disinfectant_scaling" use the same mechanic as "limb_power" and "limb_scaling", so I used the same code.
Creating new structures sounds good, but is too complicated for me right now.
Coolthulhu
reviewed
Jul 1, 2018
| remove_effect( effect_disinfected, bp ); | ||
| add_msg_if_player( _( "Disinfected wounds on your %s was healed." ), body_part_name( bp ) ); | ||
| } | ||
| } |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jul 1, 2018
Contributor
Why do you have those checks?
Couldn't it all just rely on effects?
This comment has been minimized.
This comment has been minimized.
Vasyan2006
Jul 1, 2018
Author
Contributor
There are nonstandart reasons of removing these effects:
- taking damage,
- medicated wounds was healed, but character has another wounds on the same limb,
- it was healed by sleeping or nanobots.
Different reasons require different messages.
This comment has been minimized.
This comment has been minimized.
|
"hp disinfected" and "hp bandaged" are required to separate medicated damage and damage taken after using healing items, so new damage will not be healed. And player must apply new healing item after evey combat. |
This comment has been minimized.
This comment has been minimized.
You could control it by decreasing existing effect power on new damage instead. |
This comment has been minimized.
This comment has been minimized.
|
Taking damage can reduce intensity of healing effects (i.e. healing rate), but it is calculated separately. IRL taking new damage may not destroy bandages on another part of the limb, so I prefer to have both mechanics. |
ZhilkinSerg
removed their assignment
Jul 8, 2018
kevingranade
merged commit b622362
into
CleverRaven:master
Jul 16, 2018
BrettDong
referenced this pull request
Jul 16, 2018
Closed
First aid kits can't heal infected body parts #24323
Vasyan2006
deleted the
Vasyan2006:bandages-disinfectant-and-similar-medicine
branch
Jul 16, 2018
This comment has been minimized.
This comment has been minimized.
|
Pretty late to the party, but could I ask your reasoning on removing the ability to cure infections with first aid kits? That's a large change that didn't received very little attention and probably flew under the radar for a lot of people because it was mentioned in one line of a PR that doesn't even mention the change except in the comments. |
This comment has been minimized.
This comment has been minimized.
The reason is first-aid kits do not contain antibiotics which can kill infection settled all over the body. |
This comment has been minimized.
This comment has been minimized.
|
I'll post this from a discussion I had on the subject elsewhere:
Correct me if I'm wrong, but infected wounds are on certain body parts in-game. Having a bite turn bad on your right arm doesn't mean it's all over your body, just that the bite is infected; I always viewed the death-point, where you "succumb" to the infection, as the point of no return where it surpasses the immune system. The Red Cross recommends packing a family first aid kit with antibiotic ointment for treating localized infections, and some Amazon searching tells me that the majority of first aid kits that aren't slim and compact come with it. I'm not a medical expert, but I think it's still plausible that the majority of first aid kits you find out in the world should come with antibiotics handy. This was even clearly a consideration, since improv. first aid kits don't have the infection healing and normal ones do. If need be, maybe the current first aid kit can be made into a "compact" or "travel-sized" first aid kit, and a larger, bulkier version with maybe 0.5 L of volume per kit could have the disinfecting properties? The thought that every single FAK in New England lacks any kind of treatment for infections is baffling to me. |
This comment has been minimized.
This comment has been minimized.
This is the main difference. Common family first aid kit is a drawer full of different medical items. Some first aid cupboards located in large organisations may even contain defibrillators and other complex equipment. They are represented by all medical supplies you can find in houses. |
This comment has been minimized.
This comment has been minimized.
|
Neither the description nor the crafting recipe contain antibiotics and adding them to the recipe would make crafting them significantly harder. /edit: Maybe it should apply the painkiller effect considering it requires aspirin or codeine to craft. |
This comment has been minimized.
This comment has been minimized.
|
Actually I'm all-in for changing how infection cure is working, but it is not about adding infection cure to back to medkit. We should instead change how antibiotics are working - no immediate cure after a single dose (unless dose is really high which only works for certain infections in real life), but regular intake for a certain amount of time. Anyway the thing is medkits should not be some miracle "healing potions" - they are just a bundle of disinfectant, bandage and anesthetic/painkiller. |
This comment has been minimized.
This comment has been minimized.
I made such changes, just need to polish them before releasing. |
Xhuis
referenced this pull request
Jul 19, 2018
Merged
Antibiotic overhaul - slow-acting antibiotics, and adds Atreyupan, a weak antibiotic #24379
This comment has been minimized.
This comment has been minimized.
Amariithynar
commented
Jul 20, 2018
|
@Vasyan2006 @Mecares @ZhilkinSerg You're flatly wrong on first aid kits. Just one look at the description and required materials to craft them would have shown you that, as well as simply looking at first aid kits in reality. These aren't dollar store "first aid kits" that are little more than some bandages, maybe some gauze, and some half-assed medical tape. http://cdda-trunk.chezzo.com/1st_aid/craft straight from the code itself. Description: A full medical kit, with bandages, local anesthetics, and rapid healing agents. Used for healing large amounts of damage. Components required: Third and fourth line right there are antiseptics. Saline solution is a sterile salt water solution where the salt level is isotonic to body salt levels (which is why it's used as an IV-borne hydrating agent as well as a means to carry intravenous drugs into someone's system). Saltwater is inimical to almost all forms of microbial life by virtue of the effect salt has on cells; it draws water out from them, which destroys microbes, and in the case of inflamed tissues, helps reduce inflammation by drawing off excess fluid in the damaged cells, as well. You do not need an oral antibiotic to fight off an infection unless it's a deep, suppurating wound that has been left uncleaned and infected for so long it's actually oozing pus naturally, or an internal infection that cannot be cleaned, as what occurs with food poisoning. As all infections we're dealing with are surface wounds, basic antiseptic treatment is more than sufficient for dealing with them unless left for days without even being cleaned properly. Even cheap compact kits come with disinfectant wipes like https://www.toolstation.com/shop/Workwear+%26+Safety/d70/Fire+%26+First+Aid/sd530/HSE+Travel+First+Aid+Kit/p62708 or http://www.gapyeartravelstore.com/solotrekk-pocket-travel-first-aid-kit.html and proper car-sized travel kits come with much more: http://www.firstaid.co.uk/Foreign-Travel-First-Aid-Kits-PK360/ or https://www.bunnings.com.au/protector-75-piece-home-and-travel-c-compliant-first-aid-kit_p6100257 or https://survivalworldhq.com/products/safe-wilderness-survival-car-travel-first-aid-kit-medical-bag-outdoors-camping-hiking-emergency-kit-treatment-4-sections-pack whilst ambulance kits are like this: http://www.stjohnsupplies.co.uk/products/First-aid-kits/Workplace-kits/Travel-BSI-compliant-kits/Travel-standard-workplace-first-aid-kit-St-John-Ambulance or https://shopsafetyproducts.ca/description.php?sid=2&cid=4&id=47 and even Red Cross notes what a first aid kit should contain: http://www.redcross.ca/training-and-certification/first-aid-tips-and-resources/first-aid-tips/kit-contents Medkits are by no means something that heals wounds immediately, like they were before this was initially implemented, don't get me wrong on appreciating that aspect, but first aid kits SHOULD, by any standard, be able to treat infections. Even the Improvised First Aid Kits mandate the use of either honey (which is antiseptic by virtue of its extremely high sugar concentration) or hard alcohol (which is, again, antiseptic). Change it to not be a binary healing function, like you've done with the wound damage healing, sure, but don't break common sense and actual realism in a bid for increased "realism". |
This comment has been minimized.
This comment has been minimized.
|
It is sad how Amariithynar is not able or is unwilling to understand the difference between cleaning a wound with disinfectant and treating an infection that has spread through the body, especially considering his condescending tone. |
This comment has been minimized.
This comment has been minimized.
|
Weeks, certainly, but as far as I'm aware the game is set merely a day or two after the world ended. It's why fast-spoiling food like milk is still fresh for a while even without power. The end came too savagely and quickly for people to prepare much. There was a wave of panic, and once that was over, everyone was dead except for a tiny few survivors. Antibiotics are far too rare in the current version of the game, but this fact can be addressed by making infections less threatening as well. I'm trying to address both in the PR I linked earlier by adding a method to stave off the infection until you're able to find proper treatment to remove it. |
This comment has been minimized.
This comment has been minimized.
|
Anyone is free to contribute. Overhaul of wound and disease treatment systems to be more realistic is what we are interested in and current PR is a step in right direction. Leave instant healing potions to another games, but some updates to FAK or drugs would still be welcome. |
This comment has been minimized.
This comment has been minimized.
Amariithynar
commented
Jul 20, 2018
|
Agreed, @ZhilkinSerg. As I said, I'm all for removing the instant healing potion aspect of first aid (I actually refused to use them as much as possible because of how 'cheaty' it felt, keeping it to disinfectant-soaked items and bandages to clean and bandage wounds, since they healed minimal amounts). @Mecares I know quite well the difference between just cleaning a wound with disinfectant to prevent an infection from setting in in the first place, and treating a surface infection. There isn't much of one. Infection doesn't just immediately spread throughout your body, delving deep into your tissues and getting into your bones; not without some massive, serious damage, and absolutely no treatment done. Lancing inflamed, infected tissues to open abscesses, cleaning the wound with sterile water (simple boiled water suffices, but a saline solution is better, as I've already noted) and/or a disinfectant and/or applying topical antibiotics/antiseptics can halt the spread and start regression of a surface infection. This is common practice, in fact, for wound-based infections. Oral antibiotics are overprescribed and not needed for every single infection. Deep tissue infection is an entirely other matter, but you don't get deep tissue infection from surface wounds; not without letting a wound fester for days before even attempting initial treatment, anyways, at which point you're basically delirious and soon to die (just as what happens with an infection left to spread and a low health value that allows it to run roughshod over your body right now anyways). Infections are just a critical mass of bacteria or viruses that are causing a negative reaction in your body. Disinfectants work by damaging the proteins that those bacteria and viruses need to "live" and/or replicate. They don't suddenly become useless because there's more of them. @Xhuis I disagree, here, actually. Infections shouldn't be made less threatening to your healt; without antibiotics/antiseptics/antibacterials/antimicrobials etc, they're actually a pretty serious danger to daily life, especially in a world where humanity is no longer the apex predator species. However, it's also not as hard as they're trying to make it to cleanse a wound or take care of an infection, either, which is where the problem lies. |
Vasyan2006 commentedMay 18, 2018
Medical items will not heal immediately, but apply healing over time effects.