From 21e1993fbb3fd83206acab00ce776a30b25968d3 Mon Sep 17 00:00:00 2001 From: Hirmuolio Date: Tue, 20 Apr 2021 16:44:14 +0300 Subject: [PATCH 1/4] add missing no_reload flags --- data/json/items/battery.json | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/data/json/items/battery.json b/data/json/items/battery.json index 3d510fff74bea..bae1ef4a5f256 100644 --- a/data/json/items/battery.json +++ b/data/json/items/battery.json @@ -14,7 +14,7 @@ "color": "yellow", "max_capacity": "30 kJ", "looks_like": "battery", - "flags": [ "NO_SALVAGE", "NO_UNLOAD", "RECHARGE" ] + "flags": [ "NO_SALVAGE", "NO_UNLOAD", "NO_RELOAD", "RECHARGE" ] }, { "id": "light_minus_battery_cell", @@ -33,7 +33,7 @@ "ammo_type": [ "battery" ], "capacity": 50, "looks_like": "battery", - "flags": [ "NO_SALVAGE", "NO_UNLOAD", "RECHARGE" ], + "flags": [ "NO_SALVAGE", "NO_UNLOAD", "NO_RELOAD", "RECHARGE" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 50 } } ] }, { @@ -54,7 +54,7 @@ "count": 500, "capacity": 500, "looks_like": "battery", - "flags": [ "NO_SALVAGE", "NO_UNLOAD", "LEAK_DAM", "RADIOACTIVE" ], + "flags": [ "NO_SALVAGE", "NO_UNLOAD", "NO_RELOAD", "LEAK_DAM", "RADIOACTIVE" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 500 } } ] }, { @@ -74,7 +74,7 @@ "count": 100, "capacity": 100, "looks_like": "battery", - "flags": [ "NO_SALVAGE", "NO_UNLOAD" ], + "flags": [ "NO_SALVAGE", "NO_UNLOAD", "NO_RELOAD" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 100 } } ] }, { @@ -94,7 +94,7 @@ "ammo_type": [ "battery" ], "capacity": 100, "looks_like": "battery", - "flags": [ "NO_SALVAGE", "NO_UNLOAD", "RECHARGE" ], + "flags": [ "NO_SALVAGE", "NO_UNLOAD", "NO_RELOAD", "RECHARGE" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 100 } } ] }, { @@ -113,7 +113,7 @@ "ammo_type": [ "battery" ], "capacity": 150, "looks_like": "battery", - "flags": [ "NO_SALVAGE", "NO_UNLOAD", "RECHARGE" ], + "flags": [ "NO_SALVAGE", "NO_UNLOAD", "NO_RELOAD", "RECHARGE" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 150 } } ] }, { @@ -134,7 +134,7 @@ "count": 1000, "capacity": 1000, "looks_like": "battery", - "flags": [ "NO_SALVAGE", "NO_UNLOAD", "LEAK_DAM", "RADIOACTIVE" ], + "flags": [ "NO_SALVAGE", "NO_UNLOAD", "NO_RELOAD", "LEAK_DAM", "RADIOACTIVE" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 1000 } } ] }, { @@ -154,7 +154,7 @@ "count": 300, "capacity": 300, "looks_like": "battery", - "flags": [ "NO_SALVAGE", "NO_UNLOAD" ], + "flags": [ "NO_SALVAGE", "NO_UNLOAD", "NO_RELOAD" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 300 } } ] }, { @@ -174,7 +174,7 @@ "ammo_type": [ "battery" ], "capacity": 500, "looks_like": "battery", - "flags": [ "NO_SALVAGE", "NO_UNLOAD", "RECHARGE" ], + "flags": [ "NO_SALVAGE", "NO_UNLOAD", "NO_RELOAD", "RECHARGE" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 500 } } ] }, { @@ -193,7 +193,7 @@ "ammo_type": [ "battery" ], "capacity": 600, "looks_like": "battery", - "flags": [ "NO_SALVAGE", "NO_UNLOAD", "RECHARGE" ], + "flags": [ "NO_SALVAGE", "NO_UNLOAD", "NO_RELOAD", "RECHARGE" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 600 } } ] }, { @@ -214,7 +214,7 @@ "count": 5000, "capacity": 5000, "looks_like": "battery", - "flags": [ "NO_SALVAGE", "NO_UNLOAD", "LEAK_DAM", "RADIOACTIVE" ], + "flags": [ "NO_SALVAGE", "NO_UNLOAD", "NO_RELOAD", "LEAK_DAM", "RADIOACTIVE" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 5000 } } ] }, { @@ -234,7 +234,7 @@ "count": 1200, "capacity": 1200, "looks_like": "battery", - "flags": [ "NO_SALVAGE", "NO_UNLOAD" ], + "flags": [ "NO_SALVAGE", "NO_UNLOAD", "NO_RELOAD" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 1200 } } ] }, { @@ -254,7 +254,7 @@ "ammo_type": [ "battery" ], "capacity": 1000, "looks_like": "battery", - "flags": [ "NO_SALVAGE", "NO_UNLOAD", "RECHARGE" ], + "flags": [ "NO_SALVAGE", "NO_UNLOAD", "NO_RELOAD", "RECHARGE" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 1000 } } ] }, { @@ -273,7 +273,7 @@ "ammo_type": [ "battery" ], "capacity": 1250, "looks_like": "battery", - "flags": [ "NO_SALVAGE", "NO_UNLOAD", "RECHARGE" ], + "flags": [ "NO_SALVAGE", "NO_UNLOAD", "NO_RELOAD", "RECHARGE" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 1250 } } ] }, { @@ -294,7 +294,7 @@ "count": 10000, "capacity": 10000, "looks_like": "battery", - "flags": [ "NO_SALVAGE", "NO_UNLOAD", "LEAK_DAM", "RADIOACTIVE" ], + "flags": [ "NO_SALVAGE", "NO_UNLOAD", "NO_RELOAD", "LEAK_DAM", "RADIOACTIVE" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 10000 } } ] }, { @@ -314,7 +314,7 @@ "count": 100000, "capacity": 100000, "looks_like": "battery", - "flags": [ "NO_SALVAGE", "NO_UNLOAD", "MECH_BAT", "LEAK_DAM", "RADIOACTIVE" ], + "flags": [ "NO_SALVAGE", "NO_UNLOAD", "NO_RELOAD", "MECH_BAT", "LEAK_DAM", "RADIOACTIVE" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 100000 } } ] }, { @@ -334,7 +334,7 @@ "count": 2500, "capacity": 2500, "looks_like": "battery", - "flags": [ "NO_SALVAGE", "NO_UNLOAD" ], + "flags": [ "NO_SALVAGE", "NO_UNLOAD", "NO_RELOAD" ], "pocket_data": [ { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 2500 } } ] } ] From d54577ff79cb5429ac1f54402c701ee86eb3f1d8 Mon Sep 17 00:00:00 2001 From: Hirmuolio Date: Tue, 20 Apr 2021 16:52:30 +0300 Subject: [PATCH 2/4] add missing no_reload flags --- data/json/items/tool/lighting.json | 8 ++++---- data/json/items/tool_armor.json | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/data/json/items/tool/lighting.json b/data/json/items/tool/lighting.json index c45ccadc7d8b9..2f719c29b58d2 100644 --- a/data/json/items/tool/lighting.json +++ b/data/json/items/tool/lighting.json @@ -298,7 +298,7 @@ "menu_text": "Activate", "type": "transform" }, - "flags": [ "NO_UNLOAD" ] + "flags": [ "NO_UNLOAD", "NO_RELOAD" ] }, { "id": "glowstick_dead", @@ -332,7 +332,7 @@ "turns_per_charge": 30, "revert_to": "glowstick_dead", "revert_msg": "The glowstick fades out.", - "flags": [ "LIGHT_8", "TRADER_AVOID", "SLEEP_IGNORE", "NO_UNLOAD" ] + "flags": [ "LIGHT_8", "TRADER_AVOID", "SLEEP_IGNORE", "NO_UNLOAD", "NO_RELOAD" ] }, { "id": "handflare", @@ -355,7 +355,7 @@ "active": true, "msg": "You strike your flare and light it." }, - "flags": [ "NO_UNLOAD" ] + "flags": [ "NO_UNLOAD", "NO_RELOAD" ] }, { "id": "handflare_lit", @@ -368,7 +368,7 @@ "revert_to": "handflare_dead", "revert_msg": "The flare sputters out", "use_action": { "type": "firestarter", "moves": 50 }, - "flags": [ "FIRE", "LIGHT_240", "CHARGEDIM", "FLAMING", "TRADER_AVOID", "FIRESTARTER", "NO_UNLOAD" ] + "flags": [ "FIRE", "LIGHT_240", "CHARGEDIM", "FLAMING", "TRADER_AVOID", "FIRESTARTER", "NO_UNLOAD", "NO_RELOAD" ] }, { "id": "heavy_flashlight", diff --git a/data/json/items/tool_armor.json b/data/json/items/tool_armor.json index 5187b13499c55..7e1260ebc6548 100644 --- a/data/json/items/tool_armor.json +++ b/data/json/items/tool_armor.json @@ -2915,7 +2915,7 @@ { "pocket_type": "MAGAZINE", "airtight": true, "rigid": true, "watertight": true, "ammo_restriction": { "nitrox": 60 } } ], "covers": [ "torso" ], - "flags": [ "WATER_FRIENDLY", "BELTED", "ONLY_ONE", "STURDY", "NO_UNLOAD" ], + "flags": [ "WATER_FRIENDLY", "BELTED", "ONLY_ONE", "STURDY", "NO_UNLOAD", "NO_RELOAD" ], "environmental_protection": 1, "environmental_protection_with_filter": 16, "encumbrance": 30, @@ -2947,7 +2947,7 @@ "charges_per_use": 1, "turns_per_charge": 60, "covers": [ "torso", "mouth" ], - "flags": [ "WATER_FRIENDLY", "BELTED", "ONLY_ONE", "STURDY", "NO_UNLOAD" ], + "flags": [ "WATER_FRIENDLY", "BELTED", "ONLY_ONE", "STURDY", "NO_UNLOAD", "NO_RELOAD" ], "environmental_protection": 1, "environmental_protection_with_filter": 16, "encumbrance": 30, @@ -2976,7 +2976,7 @@ { "pocket_type": "MAGAZINE", "airtight": true, "rigid": true, "watertight": true, "ammo_restriction": { "nitrox": 20 } } ], "covers": [ "torso" ], - "flags": [ "WATER_FRIENDLY", "BELTED", "ONLY_ONE", "STURDY", "NO_UNLOAD" ], + "flags": [ "WATER_FRIENDLY", "BELTED", "ONLY_ONE", "STURDY", "NO_UNLOAD", "NO_RELOAD" ], "environmental_protection": 1, "environmental_protection_with_filter": 16, "encumbrance": 30, @@ -3008,7 +3008,7 @@ "charges_per_use": 1, "turns_per_charge": 60, "covers": [ "torso", "mouth" ], - "flags": [ "WATER_FRIENDLY", "BELTED", "ONLY_ONE", "STURDY", "NO_UNLOAD" ], + "flags": [ "WATER_FRIENDLY", "BELTED", "ONLY_ONE", "STURDY", "NO_UNLOAD", "NO_RELOAD" ], "environmental_protection": 1, "environmental_protection_with_filter": 16, "encumbrance": 30, From a2e45c573ba1f2c74be210cc9cb5478f879631b9 Mon Sep 17 00:00:00 2001 From: Hirmuolio Date: Tue, 20 Apr 2021 17:24:50 +0300 Subject: [PATCH 3/4] remove test case that wanted to reload batteries --- tests/battery_mod_test.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/battery_mod_test.cpp b/tests/battery_mod_test.cpp index c83f42d3b60b4..6c66f7b65eaf6 100644 --- a/tests/battery_mod_test.cpp +++ b/tests/battery_mod_test.cpp @@ -228,11 +228,6 @@ TEST_CASE( "battery and tool properties", "[battery][tool][properties]" ) CHECK( bat_cell.ammo_default() == bat_ammo ); } - SECTION( "is reloadable with battery ammo" ) { - CHECK( bat_cell.is_reloadable() ); - CHECK( bat_cell.is_reloadable_with( bat_ammo ) ); - } - SECTION( "is not counted by charges" ) { CHECK_FALSE( bat_cell.count_by_charges() ); } From 6c0c4246c0d69ec540ba1237761b479375609287 Mon Sep 17 00:00:00 2001 From: Hirmuolio Date: Tue, 20 Apr 2021 17:25:54 +0300 Subject: [PATCH 4/4] outdated comment --- tests/battery_mod_test.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/battery_mod_test.cpp b/tests/battery_mod_test.cpp index 6c66f7b65eaf6..19c6f0d93eef6 100644 --- a/tests/battery_mod_test.cpp +++ b/tests/battery_mod_test.cpp @@ -183,7 +183,6 @@ TEST_CASE( "battery tool mod test", "[battery][mod]" ) // // - Batteries are "magazines" // - Have "ammo types" compatible with them -// - Can be reloaded with "ammo" (battery charges) // - Charge left in the battery is "ammo remaining" // // - Tools have a "magazine well" (battery compartment)