From b46eef7154d87dd17792a273a9c55a8007675755 Mon Sep 17 00:00:00 2001 From: jc_gargma Date: Thu, 9 Nov 2023 02:06:37 -0800 Subject: Porting to 0.4, part 2. --- revert-18-Simplify-broken-limb-mending-3054.patch | 24 ++++++++--------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'revert-18-Simplify-broken-limb-mending-3054.patch') diff --git a/revert-18-Simplify-broken-limb-mending-3054.patch b/revert-18-Simplify-broken-limb-mending-3054.patch index dd3aa52..12fba7b 100644 --- a/revert-18-Simplify-broken-limb-mending-3054.patch +++ b/revert-18-Simplify-broken-limb-mending-3054.patch @@ -188,14 +188,14 @@ index 78827e780d7..bb2b2bd73e7 100644 static const efftype_id effect_meth( "meth" ); static const efftype_id effect_narcosis( "narcosis" ); static const efftype_id effect_operating( "operating" ); -@@ -190,7 +189,6 @@ static const trait_id trait_MASOCHIST_MED( "MASOCHIST_MED" ); - static const trait_id trait_NOPAIN( "NOPAIN" ); +@@ -190,7 +189,6 @@ static const trait_id trait_PROF_AUTODOC( "PROF_AUTODOC" ); static const trait_id trait_PROF_MED( "PROF_MED" ); + static const trait_id trait_PYROMANIA( "PYROMANIA" ); -static const trait_id trait_REGEN_LIZ( "REGEN_LIZ" ); static const trait_id trait_THRESH_MEDICAL( "THRESH_MEDICAL" ); - static const std::string flag_ALLOWS_NATURAL_ATTACKS( "ALLOWS_NATURAL_ATTACKS" ); + static const flag_id flag_BIONIC_GUN( "BIONIC_GUN" ); @@ -1675,18 +1673,6 @@ void Character::process_bionic( bionic &bio ) } if( calendar::once_every( 2_minutes ) ) { @@ -550,12 +550,13 @@ index 36b63dd2bb4..9c31869540d 100644 static const efftype_id effect_npc_flee_player( "npc_flee_player" ); static const efftype_id effect_npc_suspend( "npc_suspend" ); static const efftype_id effect_pkill_l( "pkill_l" ); -@@ -1073,7 +1072,7 @@ bool npc::wear_if_wanted( const item &it, std::string &reason ) +@@ -1073,7 +1072,8 @@ bool npc::wear_if_wanted( const item &it, std::string &reason ) for( int i = 0; i < num_hp_parts; i++ ) { hp_part hpp = static_cast( i ); body_part bp = player::hp_to_bp( hpp ); - if( is_limb_broken( convert_bp( bp ) ) && !has_effect( effect_mending, bp ) && -+ if( is_limb_broken( convert_bp( bp ) ) && !worn_with_flag( flag_SPLINT, convert_bp( bp ).id() ) && ++ if( is_limb_broken( convert_bp( bp ).id() ) && ++ !worn_with_flag( flag_SPLINT, convert_bp( bp ).id() ) && it.covers( convert_bp( bp ).id() ) ) { reason = _( "Thanks, I'll wear that now." ); return !!wear_item( it, false ); @@ -571,15 +572,6 @@ index 41983b82ae5..9c8ae1701bc 100644 static const trait_id trait_SELFAWARE( "SELFAWARE" ); static const trait_id trait_THRESH_FELINE( "THRESH_FELINE" ); static const trait_id trait_THRESH_BIRD( "THRESH_BIRD" ); -@@ -69,7 +68,7 @@ static const trait_id trait_THRESH_URSINE( "THRESH_URSINE" ); - - static const efftype_id effect_got_checked( "got_checked" ); - --static const std::string flag_SPLINT( "SPLINT" ); -+static const flag_str_id flag_SPLINT( "SPLINT" ); - - // constructor - window_panel::window_panel( std::function @@ -771,36 +770,36 @@ static void draw_limb_health( avatar &u, const catacurses::window &w, int limb_i wprintz( w, color, sym ); } @@ -597,12 +589,12 @@ index 41983b82ae5..9c8ae1701bc 100644 - std::string limb = "~~%~~"; - nc_color color = c_light_red; - -- if( u.worn_with_flag( flag_SPLINT, bp ) || u.has_trait( trait_REGEN_LIZ ) ) { +- if( u.worn_with_flag( json_flag_SPLINT, bp ) || u.has_trait( trait_REGEN_LIZ ) ) { - static const efftype_id effect_mending( "mending" ); - const auto &eff = u.get_effect( effect_mending, bp->token ); - const int mend_perc = eff.is_null() ? 0.0 : 100 * eff.get_duration() / eff.get_max_duration(); + const int mend_perc = 100 * hp_cur / hp_max; -+ bool splinted = u.worn_with_flag( flag_SPLINT.str(), bp ) || ++ bool splinted = u.worn_with_flag( json_flag_SPLINT, bp ) || + ( u.mutation_value( "mending_modifier" ) >= 1.0f ); + nc_color color = splinted ? c_blue : c_dark_gray; -- cgit v1.2.1