From 7d585884f62caa54a28f8a25af4f86efbcada36b Mon Sep 17 00:00:00 2001 From: Robob27 Date: Mon, 5 Dec 2022 00:46:53 -0500 Subject: [PATCH 1/4] Remove UNARMED_WEAPON flag checks --- data/json/items/melee/unarmed_weapons.json | 1 - src/character.h | 2 +- src/item.cpp | 10 ---------- src/item.h | 2 -- src/martialarts.cpp | 9 +-------- src/melee.cpp | 8 ++++---- src/npc_attack.cpp | 3 +-- 7 files changed, 7 insertions(+), 28 deletions(-) diff --git a/data/json/items/melee/unarmed_weapons.json b/data/json/items/melee/unarmed_weapons.json index 1e6f90d77371c..66032d80de9c9 100644 --- a/data/json/items/melee/unarmed_weapons.json +++ b/data/json/items/melee/unarmed_weapons.json @@ -151,7 +151,6 @@ "bashing": 4, "price_postapoc": 50, "qualities": [ [ "HAMMER", 1 ] ], - "flags": [ "UNARMED_WEAPON" ], "material_thickness": 1, "armor": [ { diff --git a/src/character.h b/src/character.h index 39d8e6782198f..ab415775bef11 100644 --- a/src/character.h +++ b/src/character.h @@ -1946,7 +1946,7 @@ class Character : public Creature, public visitable /** How much dispersion does one point of target's dodge add when throwing at said target? */ int throw_dispersion_per_dodge( bool add_encumbrance = true ) const; - /** True if unarmed or wielding a weapon with the UNARMED_WEAPON flag */ + /** True if unarmed */ bool unarmed_attack() const; /// Checks for items, tools, and vehicles with the Lifting quality near the character diff --git a/src/item.cpp b/src/item.cpp index 966851c935810..11964199ddfde 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -193,7 +193,6 @@ static const quality_id qual_LIFT( "LIFT" ); static const skill_id skill_cooking( "cooking" ); static const skill_id skill_melee( "melee" ); static const skill_id skill_survival( "survival" ); -static const skill_id skill_unarmed( "unarmed" ); static const skill_id skill_weapon( "weapon" ); static const species_id species_ROBOT( "ROBOT" ); @@ -851,11 +850,6 @@ bool item::is_null() const return ( type == nullptr || type == nullitem() || typeId().is_null() ); } -bool item::is_unarmed_weapon() const -{ - return is_null() || has_flag( flag_UNARMED_WEAPON ); -} - bool item::is_frozen_liquid() const { return made_of( phase_id::SOLID ) && made_of_from_type( phase_id::LIQUID ); @@ -10596,10 +10590,6 @@ gun_type_type item::gun_type() const skill_id item::melee_skill() const { - if( is_unarmed_weapon() ) { - return skill_unarmed; - } - if( !is_melee() ) { return skill_id::NULL_ID(); } diff --git a/src/item.h b/src/item.h index ffd1dab3735a7..2b5bdb8584624 100644 --- a/src/item.h +++ b/src/item.h @@ -1511,8 +1511,6 @@ class item : public visitable /** Returns true if the item is broken or will be broken on activation */ bool is_broken_on_active() const; - bool is_unarmed_weapon() const; //Returns true if the item should be considered unarmed - bool has_temperature() const; /** Returns true if the item is A: is SOLID and if it B: is of type LIQUID */ diff --git a/src/martialarts.cpp b/src/martialarts.cpp index 33da5786a5320..645077f6395fe 100644 --- a/src/martialarts.cpp +++ b/src/martialarts.cpp @@ -40,7 +40,6 @@ static const bionic_id bio_armor_arms( "bio_armor_arms" ); static const bionic_id bio_armor_legs( "bio_armor_legs" ); static const bionic_id bio_cqb( "bio_cqb" ); -static const flag_id json_flag_UNARMED_WEAPON( "UNARMED_WEAPON" ); static const json_character_flag json_flag_ALWAYS_BLOCK( "ALWAYS_BLOCK" ); static const json_character_flag json_flag_NONSTANDARD_BLOCK( "NONSTANDARD_BLOCK" ); @@ -620,15 +619,13 @@ bool ma_requirements::is_valid_character( const Character &u ) const bool melee_style = u.martial_arts_data->selected_strictly_melee(); bool is_armed = u.is_armed(); bool forced_unarmed = u.martial_arts_data->selected_force_unarmed(); - bool unarmed_weapon = is_armed && !forced_unarmed && weapon->has_flag( json_flag_UNARMED_WEAPON ); bool weapon_ok = melee_allowed && weapon && is_valid_weapon( *weapon ); bool style_weapon = weapon && u.martial_arts_data->selected_has_weapon( weapon->typeId() ); bool all_weapons = u.martial_arts_data->selected_allow_all_weapons(); - bool unarmed_ok = !is_armed || ( unarmed_weapon && unarmed_weapons_allowed ); bool melee_ok = weapon_ok && ( style_weapon || all_weapons ); - bool valid_unarmed = !melee_style && unarmed_allowed && unarmed_ok; + bool valid_unarmed = !melee_style && unarmed_allowed && !is_armed; bool valid_melee = !strictly_unarmed && ( forced_unarmed || melee_ok ); if( !valid_unarmed && !valid_melee ) { @@ -1282,10 +1279,6 @@ bool martialart::weapon_valid( const item_location &it ) const return true; } - if( !strictly_unarmed && !strictly_melee && it && it->has_flag( json_flag_UNARMED_WEAPON ) ) { - return true; - } - return false; } diff --git a/src/melee.cpp b/src/melee.cpp index a10450e898263..55ca290df99f9 100644 --- a/src/melee.cpp +++ b/src/melee.cpp @@ -193,7 +193,7 @@ bool Character::is_armed() const bool Character::unarmed_attack() const { const item_location weap = used_weapon(); - return !weap || weap->has_flag( flag_UNARMED_WEAPON ); + return !weap; } bool Character::handle_melee_wear( item_location shield, float wear_multiplier ) @@ -451,7 +451,7 @@ static void melee_train( Character &you, int lo, int hi, const item &weap ) float total = std::max( cut + stab + bash, 1 ); // Unarmed may deal cut, stab, and bash damage depending on the weapon - if( weap.is_unarmed_weapon() ) { + if( weap.is_null() ) { you.practice( skill_unarmed, std::ceil( 1 * rng( lo, hi ) ), hi ); } else { you.practice( skill_cutting, std::ceil( cut / total * rng( lo, hi ) ), hi ); @@ -1049,7 +1049,7 @@ double Character::crit_chance( float roll_hit, float target_dodge, const item &w // Weapon to-hit roll double weapon_crit_chance = 0.5; - if( weap.is_unarmed_weapon() ) { + if( weap.is_null() ) { // Unarmed attack: 1/2 of unarmed skill is to-hit /** @EFFECT_UNARMED increases critical chance with UNARMED_WEAPON */ weapon_crit_chance = 0.5 + 0.05 * get_skill_level( skill_unarmed ); @@ -2185,7 +2185,7 @@ bool Character::block_hit( Creature *source, bodypart_id &bp_hit, damage_instanc bool worn_shield = has_shield && shield->has_flag( flag_BLOCK_WHILE_WORN ); bool conductive_shield = false; - bool unarmed = !is_armed() || weapon.has_flag( flag_UNARMED_WEAPON ); + bool unarmed = !is_armed(); bool force_unarmed = martial_arts_data->is_force_unarmed(); bool allow_weapon_blocking = martial_arts_data->can_weapon_block(); diff --git a/src/npc_attack.cpp b/src/npc_attack.cpp index 18e4b766f7cb1..d2d2da499ef76 100644 --- a/src/npc_attack.cpp +++ b/src/npc_attack.cpp @@ -657,8 +657,7 @@ bool npc_attack_throw::can_use( const npc &source ) const bool throwable = source.throw_range( single_item ) > 0 && !source.is_worn( thrown_item ) && !thrown_item.has_flag( flag_NPC_ACTIVATE ); throwable = throwable && !thrown_item.is_gun() && !thrown_item.is_armor() && - !thrown_item.is_comestible() && !thrown_item.is_magazine() && !thrown_item.is_tool() && - !thrown_item.is_unarmed_weapon(); + !thrown_item.is_comestible() && !thrown_item.is_magazine() && !thrown_item.is_tool(); // TODO: Better choose what should be thrown return throwable; } From b744d37d05a1f60b0738e7824b68cc5c5c354f29 Mon Sep 17 00:00:00 2001 From: Fris0uman Date: Sat, 14 Jan 2023 15:55:34 +0100 Subject: [PATCH 2/4] Convert remaining unarmed weapons to armor --- data/json/items/armor/integrated.json | 2 +- data/json/items/generic.json | 2 +- data/json/items/tool/electronics.json | 2 +- data/mods/Aftershock/items/weapons.json | 11 ++--- data/mods/CRT_EXPANSION/items/crt_gun.json | 5 ++- data/mods/CRT_EXPANSION/items/crt_tools.json | 16 +++++-- .../Magiclysm/items/enchanted_unarmed.json | 18 ++++---- data/mods/Magiclysm/items/ethereal_items.json | 42 +++++++------------ 8 files changed, 50 insertions(+), 48 deletions(-) diff --git a/data/json/items/armor/integrated.json b/data/json/items/armor/integrated.json index 0a4a64230ab63..23769afd0413e 100644 --- a/data/json/items/armor/integrated.json +++ b/data/json/items/armor/integrated.json @@ -679,7 +679,7 @@ "qualities": [ [ "CUT", 2 ], [ "BUTCHER", 4 ], [ "PRY", 1 ] ], "environmental_protection": 1, "techniques": [ "RAPID" ], - "flags": [ "INTEGRATED", "ALLOWS_NATURAL_ATTACKS", "UNARMED_WEAPON", "UNBREAKABLE", "OUTER", "PADDED" ], + "flags": [ "INTEGRATED", "ALLOWS_NATURAL_ATTACKS", "UNBREAKABLE", "OUTER", "PADDED" ], "armor": [ { "material": [ { "type": "sclerotin", "covered_by_mat": 100, "thickness": 3.2 } ], diff --git a/data/json/items/generic.json b/data/json/items/generic.json index 0b67cba00fa5f..ae3173e809353 100644 --- a/data/json/items/generic.json +++ b/data/json/items/generic.json @@ -116,7 +116,7 @@ "description": "seeing this is a bug", "price": 0, "volume": "0 ml", - "flags": [ "PSEUDO", "UNARMED_WEAPON" ], + "flags": [ "PSEUDO" ], "//": "Fist is internally represented as 'wielding a none as a weapon'" }, { diff --git a/data/json/items/tool/electronics.json b/data/json/items/tool/electronics.json index be6bab207eb05..1364c21f90a02 100644 --- a/data/json/items/tool/electronics.json +++ b/data/json/items/tool/electronics.json @@ -133,7 +133,7 @@ "turns_per_charge": 1, "use_action": [ "EHANDCUFFS" ], "//": "Don't add ELECTRONIC flag here, since these handcuffs have their own behavior when affected by EMP blast", - "flags": [ "ALWAYS_TWOHAND", "UNARMED_WEAPON", "TRADER_AVOID", "WATER_BREAK" ] + "flags": [ "ALWAYS_TWOHAND", "TRADER_AVOID", "WATER_BREAK" ] }, { "id": "eink_tablet_pc", diff --git a/data/mods/Aftershock/items/weapons.json b/data/mods/Aftershock/items/weapons.json index e198ffa8ac7cd..a4f6313e1e1cf 100644 --- a/data/mods/Aftershock/items/weapons.json +++ b/data/mods/Aftershock/items/weapons.json @@ -120,7 +120,7 @@ }, { "id": "afs_hydraulic_gauntlet", - "type": "GENERIC", + "type": "ARMOR", "name": { "str": "hydraulic gauntlet" }, "description": "A huge, heavy metal gauntlet lined with tubing and gauges. Slow and unwieldy, it uses internal pressure to deliver devastating blows, but takes tremendous strength to use effectively. Thanks to an internal microreactor, it doesn't require power of its own.", "weight": "3778 g", @@ -133,8 +133,9 @@ "color": "light_gray", "bashing": 50, "to_hit": -2, - "flags": [ "NO_REPAIR", "NONCONDUCTIVE", "SLOW_WIELD", "DURABLE_MELEE", "LEAK_DAM", "UNARMED_WEAPON" ], - "techniques": [ "BRUTAL", "AFS_PRESSURE_CRUNCH" ] + "flags": [ "NO_REPAIR", "NONCONDUCTIVE", "SLOW_WIELD", "DURABLE_MELEE", "LEAK_DAM" ], + "techniques": [ "BRUTAL", "AFS_PRESSURE_CRUNCH" ], + "armor": [ { "encumbrance": 5, "coverage": 100, "covers": [ "hand_r" ] } ] }, { "id": "afs_freeze_gauntlet", @@ -151,10 +152,10 @@ "color": "light_cyan", "bashing": 3, "relic_data": { - "passive_effects": [ { "has": "WIELD", "condition": "ALWAYS", "values": [ { "value": "ITEM_DAMAGE_COLD", "add": 17 } ] } ] + "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "values": [ { "value": "ITEM_DAMAGE_COLD", "add": 17 } ] } ] }, "to_hit": 0, - "flags": [ "NO_REPAIR", "NONCONDUCTIVE", "SLOW_WIELD", "DURABLE_MELEE", "UNARMED_WEAPON" ], + "flags": [ "NO_REPAIR", "NONCONDUCTIVE", "SLOW_WIELD", "DURABLE_MELEE" ], "techniques": [ "WBLOCK_1" ], "material_thickness": 1, "armor": [ { "encumbrance": 5, "coverage": 100, "covers": [ "hand_l", "hand_r" ] } ] diff --git a/data/mods/CRT_EXPANSION/items/crt_gun.json b/data/mods/CRT_EXPANSION/items/crt_gun.json index 7577160ae599e..2c54217621315 100644 --- a/data/mods/CRT_EXPANSION/items/crt_gun.json +++ b/data/mods/CRT_EXPANSION/items/crt_gun.json @@ -159,7 +159,7 @@ }, { "id": "crt_fire_glove", - "type": "GUN", + "type": "ARMOR", "name": "C.R.I.T Fire Glove", "description": "Experimental CQB weapon system under development in C.R.I.T R&D.", "weight": "650 g", @@ -189,7 +189,8 @@ [ "underbarrel", 1 ] ], "ammo_effects": [ "STREAM", "INCENDIARY" ], - "flags": [ "NEVER_JAMS", "NO_UNLOAD", "UNARMED_WEAPON", "DURABLE_MELEE", "NON_FOULING" ] + "flags": [ "NEVER_JAMS", "NO_UNLOAD", "DURABLE_MELEE", "NON_FOULING" ], + "armor": [ { "encumbrance": 5, "coverage": 100, "covers": [ "hand_r" ] } ] }, { "id": "pelletgun", diff --git a/data/mods/CRT_EXPANSION/items/crt_tools.json b/data/mods/CRT_EXPANSION/items/crt_tools.json index 168912c22e45f..b9cb63b8c9492 100644 --- a/data/mods/CRT_EXPANSION/items/crt_tools.json +++ b/data/mods/CRT_EXPANSION/items/crt_tools.json @@ -44,12 +44,12 @@ "symbol": ";", "qualities": [ [ "PRY", 1 ], [ "CUT", 2 ], [ "CUT_FINE", 1 ] ], "use_action": [ "CROWBAR" ], - "flags": [ "SHEATH_KNIFE", "UNARMED_WEAPON", "STAB", "UNBREAKABLE_MELEE" ], + "flags": [ "SHEATH_KNIFE", "STAB", "UNBREAKABLE_MELEE" ], "techniques": [ "WBLOCK_2", "UHAND", "PROD" ] }, { "id": "crt_knuckledusters", - "type": "TOOL", + "type": "ARMOR", "category": "weapons", "name": { "str": "pair of C.R.I.T Knuckledusters", "str_pl": "pairs of C.R.I.T Knuckledusters" }, "description": "C.R.I.T CQB knuckledusters. Not too different from any normal pair other than weight.", @@ -61,8 +61,16 @@ "bashing": 10, "to_hit": 1, "symbol": "8", - "flags": [ "UNARMED_WEAPON", "UNBREAKABLE_MELEE" ], - "techniques": [ "WBLOCK_2", "HOOK" ] + "flags": [ "UNBREAKABLE_MELEE" ], + "techniques": [ "WBLOCK_2", "HOOK" ], + "armor": [ + { + "encumbrance": 5, + "coverage": 20, + "covers": [ "hand_l", "hand_r" ], + "specifically_covers": [ "hand_fingers_l", "hand_fingers_r" ] + } + ] }, { "id": "sword_crt", diff --git a/data/mods/Magiclysm/items/enchanted_unarmed.json b/data/mods/Magiclysm/items/enchanted_unarmed.json index c1ca982ff9d93..8453b48493e0b 100644 --- a/data/mods/Magiclysm/items/enchanted_unarmed.json +++ b/data/mods/Magiclysm/items/enchanted_unarmed.json @@ -18,7 +18,7 @@ "relative": { "to_hit": 2 } }, { - "type": "GENERIC", + "type": "ARMOR", "id": "flaming_fist", "symbol": "3", "color": "red", @@ -31,7 +31,8 @@ "to_hit": 2, "bashing": 12, "qualities": [ [ "HAMMER", 1 ] ], - "flags": [ "UNARMED_WEAPON", "DURABLE_MELEE", "NONCONDUCTIVE", "FLAMING" ] + "flags": [ "DURABLE_MELEE", "NONCONDUCTIVE", "FLAMING" ], + "armor": [ { "encumbrance": 5, "coverage": 20, "covers": [ "hand_r" ] } ] }, { "type": "GENERIC", @@ -65,12 +66,13 @@ "to_hit": 3, "qualities": [ [ "HAMMER", 2 ] ], "techniques": [ "WBLOCK_1", "BRUTAL" ], - "flags": [ "UNARMED_WEAPON", "DURABLE_MELEE", "NONCONDUCTIVE", "OVERSIZE", "MESSY" ] + "flags": [ "DURABLE_MELEE", "NONCONDUCTIVE", "OVERSIZE", "MESSY" ], + "armor": [ { "encumbrance": 5, "coverage": 20, "covers": [ "hand_r" ] } ] }, { "id": "shotcestus", "copy-from": "shotgun_base", - "type": "GUN", + "type": "ARMOR", "name": { "str": "shotcestus", "str_pl": "shotcestuses" }, "description": "A sawn-off double-barrel shotgun mounted on a metal cestus. The lack of a stock to absorb recoil means some strength is required to fire.", "weight": "1566 g", @@ -90,9 +92,10 @@ "reload": 200, "barrel_volume": "500 ml", "valid_mod_locations": [ [ "mechanism", 1 ] ], - "flags": [ "UNARMED_WEAPON", "DURABLE_MELEE", "NEVER_JAMS", "RELOAD_EJECT", "RELOAD_ONE" ], + "flags": [ "DURABLE_MELEE", "NEVER_JAMS", "RELOAD_EJECT", "RELOAD_ONE" ], "faults": [ "fault_gun_blackpowder", "fault_gun_dirt" ], - "pocket_data": [ { "pocket_type": "MAGAZINE", "ammo_restriction": { "shot": 2 } } ] + "pocket_data": [ { "pocket_type": "MAGAZINE", "ammo_restriction": { "shot": 2 } } ], + "armor": [ { "encumbrance": 5, "coverage": 20, "covers": [ "hand_r" ] } ] }, { "type": "GENERIC", @@ -108,6 +111,7 @@ "to_hit": 1, "qualities": [ [ "HAMMER", 1 ] ], "techniques": [ "WBLOCK_1", "BRUTAL" ], - "flags": [ "UNARMED_WEAPON", "DURABLE_MELEE", "TRADER_AVOID", "MAGIC_FOCUS" ] + "flags": [ "DURABLE_MELEE", "TRADER_AVOID", "MAGIC_FOCUS" ], + "armor": [ { "encumbrance": 5, "coverage": 20, "covers": [ "hand_r" ] } ] } ] diff --git a/data/mods/Magiclysm/items/ethereal_items.json b/data/mods/Magiclysm/items/ethereal_items.json index 2320ce96e4f19..019819b20c170 100644 --- a/data/mods/Magiclysm/items/ethereal_items.json +++ b/data/mods/Magiclysm/items/ethereal_items.json @@ -1,7 +1,7 @@ [ { "id": "stonefist", - "type": "GENERIC", + "type": "ARMOR", "name": { "str": "pair of magical armored stone gauntlets", "str_pl": "pairs of magical armored stone gauntlets" }, "description": "A magical flexible stonelike substance for protection and attack.", "weight": "1 g", @@ -26,7 +26,7 @@ ] }, "qualities": [ [ "HAMMER", 1 ] ], - "flags": [ "STURDY", "UNARMED_WEAPON", "DURABLE_MELEE", "NONCONDUCTIVE", "MAGIC_FOCUS" ], + "flags": [ "STURDY", "DURABLE_MELEE", "NONCONDUCTIVE", "MAGIC_FOCUS" ], "techniques": [ "WBLOCK_3" ] }, { @@ -194,16 +194,7 @@ "volume": "155 ml", "weight": "300 g", "bashing": 6, - "flags": [ - "UNARMED_WEAPON", - "UNBREAKABLE_MELEE", - "NONCONDUCTIVE", - "LIGHT_5", - "TRADER_AVOID", - "NO_REPAIR", - "NO_SALVAGE", - "MAGIC_FOCUS" - ], + "flags": [ "UNBREAKABLE_MELEE", "NONCONDUCTIVE", "LIGHT_5", "TRADER_AVOID", "NO_REPAIR", "NO_SALVAGE", "MAGIC_FOCUS" ], "relic_data": { "passive_effects": [ { "has": "WORN", "values": [ { "value": "ITEM_DAMAGE_ELEC", "add": 20 } ] } ] }, "material_thickness": 1, "armor": [ @@ -247,7 +238,6 @@ "WHIP", "STURDY", "TRADER_AVOID", - "UNARMED_WEAPON", "UNBREAKABLE_MELEE", "NO_REPAIR", "NO_SALVAGE", @@ -273,7 +263,6 @@ "WHIP", "STURDY", "TRADER_AVOID", - "UNARMED_WEAPON", "UNBREAKABLE_MELEE", "NO_REPAIR", "NO_SALVAGE", @@ -840,7 +829,7 @@ }, { "id": "subzero_talons", - "type": "GENERIC", + "type": "ARMOR", "name": { "str_sp": "subzero talons" }, "description": "Claws made from ice, able to freeze on contact while mauling foes. You, however, feel only a slight chill on your hands.", "weight": "100 g", @@ -853,20 +842,19 @@ "color": "light_gray", "qualities": [ [ "CUT", 2 ], [ "CUT_FINE", 1 ], [ "BUTCHER", 12 ] ], "weapon_category": [ "CLAWS" ], - "flags": [ - "UNARMED_WEAPON", - "UNBREAKABLE_MELEE", - "NONCONDUCTIVE", - "NO_UNWIELD", - "MAGIC_FOCUS", - "TRADER_AVOID", - "NO_REPAIR", - "NO_SALVAGE" - ], + "flags": [ "UNBREAKABLE_MELEE", "NONCONDUCTIVE", "NO_UNWIELD", "MAGIC_FOCUS", "TRADER_AVOID", "NO_REPAIR", "NO_SALVAGE" ], "techniques": [ "WBLOCK_2", "RAPID" ], "relic_data": { - "passive_effects": [ { "has": "WIELD", "condition": "ALWAYS", "values": [ { "value": "ITEM_DAMAGE_COLD", "add": 6 } ] } ] - } + "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "values": [ { "value": "ITEM_DAMAGE_COLD", "add": 6 } ] } ] + }, + "armor": [ + { + "encumbrance": 5, + "coverage": 20, + "covers": [ "hand_l", "hand_r" ], + "specifically_covers": [ "hand_back_l", "hand_back_r" ] + } + ] }, { "id": "armor_spirit", From de41f54a0d79d400277a34eb0089a37f6b120265 Mon Sep 17 00:00:00 2001 From: Robob27 Date: Mon, 5 Dec 2022 03:36:40 -0500 Subject: [PATCH 3/4] Remove UNARMED_WEAPON flag entirely --- data/json/flags.json | 6 ------ src/flag.cpp | 1 - src/flag.h | 1 - src/melee.cpp | 2 +- 4 files changed, 1 insertion(+), 9 deletions(-) diff --git a/data/json/flags.json b/data/json/flags.json index b46ef2bc3f69c..2397f99341903 100644 --- a/data/json/flags.json +++ b/data/json/flags.json @@ -935,12 +935,6 @@ "type": "json_flag", "//": "This gun wont train marksmanship when fired. Used in Aftershock smart guns." }, - { - "id": "UNARMED_WEAPON", - "type": "json_flag", - "//": "Allows wielding with unarmed fighting styles and trains unarmed when used.", - "info": "This weapon can be used with unarmed fighting styles." - }, { "id": "NANOFAB_REPAIR", "type": "json_flag", diff --git a/src/flag.cpp b/src/flag.cpp index 508d824f33cbf..c362e5006bb0d 100644 --- a/src/flag.cpp +++ b/src/flag.cpp @@ -327,7 +327,6 @@ const flag_id flag_TRADER_AVOID( "TRADER_AVOID" ); const flag_id flag_TRADER_KEEP( "TRADER_KEEP" ); const flag_id flag_TRADER_KEEP_EQUIPPED( "TRADER_KEEP_EQUIPPED" ); const flag_id flag_TWO_WAY_RADIO( "TWO_WAY_RADIO" ); -const flag_id flag_UNARMED_WEAPON( "UNARMED_WEAPON" ); const flag_id flag_UNBREAKABLE( "UNBREAKABLE" ); const flag_id flag_UNBREAKABLE_MELEE( "UNBREAKABLE_MELEE" ); const flag_id flag_UNDERSIZE( "UNDERSIZE" ); diff --git a/src/flag.h b/src/flag.h index 5df0694fcedd8..ee85cf50bc518 100644 --- a/src/flag.h +++ b/src/flag.h @@ -332,7 +332,6 @@ extern const flag_id flag_TRADER_AVOID; extern const flag_id flag_TRADER_KEEP; extern const flag_id flag_TRADER_KEEP_EQUIPPED; extern const flag_id flag_TWO_WAY_RADIO; -extern const flag_id flag_UNARMED_WEAPON; extern const flag_id flag_UNBREAKABLE; extern const flag_id flag_UNBREAKABLE_MELEE; extern const flag_id flag_UNDERSIZE; diff --git a/src/melee.cpp b/src/melee.cpp index 55ca290df99f9..97fe4624c326e 100644 --- a/src/melee.cpp +++ b/src/melee.cpp @@ -1051,7 +1051,7 @@ double Character::crit_chance( float roll_hit, float target_dodge, const item &w double weapon_crit_chance = 0.5; if( weap.is_null() ) { // Unarmed attack: 1/2 of unarmed skill is to-hit - /** @EFFECT_UNARMED increases critical chance with UNARMED_WEAPON */ + /** @EFFECT_UNARMED increases critical chance */ weapon_crit_chance = 0.5 + 0.05 * get_skill_level( skill_unarmed ); } From b9ff31751df26f4396ff7d546974e8f1e79138b8 Mon Sep 17 00:00:00 2001 From: Fris0uman Date: Sun, 15 Jan 2023 16:47:18 +0100 Subject: [PATCH 4/4] Put flag in obsolete.json to keep 3rd party mod from erroring --- data/json/obsolete.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/data/json/obsolete.json b/data/json/obsolete.json index 0ba94011a0946..7ae6f94f6e0fc 100644 --- a/data/json/obsolete.json +++ b/data/json/obsolete.json @@ -1069,5 +1069,11 @@ "copy-from": "AID_abstract", "name": { "str_sp": "Railgun CBM installation data" }, "description": "Precise step-by-step instructions and other required data for installation of Railgun CBM, stored on a data card of proprietary form-factor, designed to be used extensively by an Autodoc, and allowing bionic installation with minimal failure chance. Integrated security subroutine renders it unusable after installation." + }, + { + "id": "UNARMED_WEAPON", + "type": "json_flag", + "//": "REMOVE After 0.G.", + "info": "This weapon can be used with unarmed fighting styles." } ]