From 8f395c92550fff77df06e7d2361310edca8230e9 Mon Sep 17 00:00:00 2001 From: jc_gargma Date: Sun, 18 Jul 2021 21:08:21 -0700 Subject: Updated to 2021-07-18-1757 Fix NATO M80 tracer naming Add backport to fix radios with UPS Add patch to mark foldable/metal bottles as containers --- 0.F_backport-radio-can-use-ups.patch | 55 +++++++++++++++++++++++++++++++++ 0003-inconsistent-ammo-names.patch | 2 +- 0021-foldable-bottle-is-container.patch | 20 ++++++++++++ 3 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 0.F_backport-radio-can-use-ups.patch create mode 100644 0021-foldable-bottle-is-container.patch diff --git a/0.F_backport-radio-can-use-ups.patch b/0.F_backport-radio-can-use-ups.patch new file mode 100644 index 0000000..ee146e5 --- /dev/null +++ b/0.F_backport-radio-can-use-ups.patch @@ -0,0 +1,55 @@ +--- a/src/iuse.cpp ++++ b/src/iuse.cpp +@@ -289,6 +289,7 @@ + static const std::string flag_HEATS_FOOD( "HEATS_FOOD" ); + static const std::string flag_PLANT( "PLANT" ); + static const std::string flag_PLOWABLE( "PLOWABLE" ); ++static const std::string flag_USE_UPS( "USE_UPS" ); + + // how many characters per turn of radio + static constexpr int RADIO_PER_TURN = 25; +@@ -2162,7 +2163,8 @@ + } + } else { // Activated + int ch = 1; +- if( it->ammo_remaining() > 0 ) { ++ if( it->ammo_remaining() > 0 || ( it->has_flag( flag_USE_UPS ) && ++ p->has_enough_charges( *it, false ) ) ) { + ch = uilist( _( "Radio:" ), { + _( "Scan" ), _( "Turn off" ) + } ); +@@ -4082,7 +4084,8 @@ + if( t ) { // Effects while simply on + + } else { +- if( !it->units_sufficient( *p ) ) { ++ if( !it->units_sufficient( *p ) || !( it->has_flag( flag_USE_UPS ) && ++ p->has_enough_charges( *it, false ) ) ) { + p->add_msg_if_player( m_info, _( "Your tactical tonfa is out of power." ) ); + it->convert( "shocktonfa_off" ).active = false; + } else { +@@ -4107,7 +4110,8 @@ + int iuse::mp3( player *p, item *it, bool, const tripoint & ) + { + // TODO: avoid item id hardcoding to make this function usable for pure json-defined devices. +- if( !it->units_sufficient( *p ) ) { ++ if( !it->units_sufficient( *p ) || !( it->has_flag( flag_USE_UPS ) && ++ p->has_enough_charges( *it, false ) ) ) { + p->add_msg_if_player( m_info, _( "The device's batteries are dead." ) ); + } else if( p->has_active_item( "mp3_on" ) || p->has_active_item( "smartphone_music" ) || + p->has_active_item( "afs_atomic_smartphone_music" ) || +@@ -6367,9 +6371,12 @@ + int iuse::einktabletpc( player *p, item *it, bool t, const tripoint &pos ) + { + if( t ) { +- if( !it->get_var( "EIPC_MUSIC_ON" ).empty() && ( it->ammo_remaining() > 0 ) ) { ++ if( !it->get_var( "EIPC_MUSIC_ON" ).empty() && ++ ( it->ammo_remaining() > 0 || ( it->has_flag( flag_USE_UPS ) && ++ p->has_enough_charges( *it, false ) ) ) ) { + if( calendar::once_every( 5_minutes ) ) { +- it->ammo_consume( 1, p->pos() ); ++ //it->ammo_consume( 1, p->pos() ); ++ p->consume_charges( *it, 1 ); + } + + //the more varied music, the better max mood. diff --git a/0003-inconsistent-ammo-names.patch b/0003-inconsistent-ammo-names.patch index a73c092..61d17ac 100644 --- a/0003-inconsistent-ammo-names.patch +++ b/0003-inconsistent-ammo-names.patch @@ -108,7 +108,7 @@ "copy-from": "762_51_incendiary", "type": "AMMO", - "name": { "str": "7.62x51mm incendiary, reloaded" }, -+ "name": { "str": "7.62x51mm NATO M62 incendiary, reloaded" }, ++ "name": { "str": "7.62x51mm NATO M62 tracer, reloaded" }, "proportional": { "price": 0.7, "damage": { "damage_type": "stab", "amount": 0.9 }, "dispersion": 1.1 }, "extend": { "effects": [ "RECYCLED" ] }, "delete": { "effects": [ "NEVER_MISFIRES" ], "flags": [ "IRREPLACEABLE_CONSUMABLE" ] } diff --git a/0021-foldable-bottle-is-container.patch b/0021-foldable-bottle-is-container.patch new file mode 100644 index 0000000..95b3d0f --- /dev/null +++ b/0021-foldable-bottle-is-container.patch @@ -0,0 +1,20 @@ +--- a/data/json/items/tool/container.json ++++ b/data/json/items/tool/container.json +@@ -2,7 +2,7 @@ + { + "id": "bottle_metal", + "type": "CONTAINER", +- "category": "other", ++ "category": "container", + "name": { "str": "steel bottle" }, + "description": "A stainless steel water bottle, holds 750ml of liquid.", + "weight": "200 g", +@@ -22,7 +22,7 @@ + { + "id": "bottle_folding", + "type": "CONTAINER", +- "category": "other", ++ "category": "container", + "name": { "str": "foldable plastic bottle" }, + "description": "A non-rigid plastic bottle for easy storage, holds 500 ml of liquid.", + "weight": "13 g", -- cgit v1.2.1