From f1d1e6f5e957c7e11c455d7f317e2213b4269d32 Mon Sep 17 00:00:00 2001 From: coiax Date: Mon, 13 Mar 2017 08:59:48 +0000 Subject: [PATCH] Demotes HANDSLOW to secondary flag (#24878) It's used in literally four places, it doesn't need a high speed bitflag slot. --- code/__DEFINES/flags.dm | 2 +- .../objects/items/weapons/holy_weapons.dm | 29 ++++++++++--------- code/modules/awaymissions/capture_the_flag.dm | 2 +- .../mob/living/carbon/human/species.dm | 2 +- .../computers/item/laptop.dm | 8 +++-- .../modules/projectiles/guns/ballistic/bow.dm | 5 +++- .../guns/ballistic/laser_gatling.dm | 21 ++++++++------ 7 files changed, 40 insertions(+), 29 deletions(-) diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index bcdef181b1e..c88f8d14324 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -12,7 +12,6 @@ #define NOBLUDGEON 4 // when an item has this it produces no "X has been hit by Y with Z" message in the default attackby() #define MASKINTERNALS 8 // mask allows internals #define HEAR 16 // This flag is what recursive_hear_check() uses to determine wether to add an item to the hearer list or not. -#define HANDSLOW 32 // If an item has this flag, it will slow you to carry it #define CONDUCT 64 // conducts electricity (metal etc.) #define ABSTRACT 128 // for all things that are technically items but used for various different stuff, made it 128 because it could conflict with other flags other way #define NODECONSTRUCT 128 // For machines and structures that should not break into parts, eg, holodeck stuff @@ -32,6 +31,7 @@ /* Secondary atom flags, access using the SECONDARY_FLAG macros */ +#define SLOWS_WHILE_IN_HAND "slows_while_in_hand" #define NO_EMP_WIRES "no_emp_wires" #define HOLOGRAM "hologram" #define FROZEN "frozen" diff --git a/code/game/objects/items/weapons/holy_weapons.dm b/code/game/objects/items/weapons/holy_weapons.dm index 424e14596e8..868ec8e059e 100644 --- a/code/game/objects/items/weapons/holy_weapons.dm +++ b/code/game/objects/items/weapons/holy_weapons.dm @@ -348,10 +348,25 @@ desc = "They say fear is the true mind killer, but stabbing them in the head works too. Honour compels you to not sheathe it once drawn." sharpness = IS_SHARP slot_flags = null - flags = HANDSLOW hitsound = 'sound/weapons/bladeslice.ogg' attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") +/obj/item/weapon/nullrod/tribal_knife/Initialize(mapload) + ..() + SET_SECONDARY_FLAG(src, SLOWS_WHILE_IN_HAND) + +/obj/item/weapon/nullrod/tribal_knife/New() + ..() + START_PROCESSING(SSobj, src) + +/obj/item/weapon/nullrod/tribal_knife/Destroy() + STOP_PROCESSING(SSobj, src) + . = ..() + +/obj/item/weapon/nullrod/tribal_knife/process() + slowdown = rand(-2, 2) + + /obj/item/weapon/nullrod/pitchfork icon_state = "pitchfork0" name = "unholy pitchfork" @@ -360,15 +375,3 @@ attack_verb = list("poked", "impaled", "pierced", "jabbed") hitsound = 'sound/weapons/bladeslice.ogg' sharpness = IS_SHARP - -/obj/item/weapon/nullrod/tribal_knife/New() - ..() - START_PROCESSING(SSobj, src) - -/obj/item/weapon/nullrod/tribal_knife/Destroy() - STOP_PROCESSING(SSobj, src) - return ..() - -/obj/item/weapon/nullrod/tribal_knife/process() - slowdown = rand(-2, 2) - diff --git a/code/modules/awaymissions/capture_the_flag.dm b/code/modules/awaymissions/capture_the_flag.dm index b3513cddb80..1758388ed65 100644 --- a/code/modules/awaymissions/capture_the_flag.dm +++ b/code/modules/awaymissions/capture_the_flag.dm @@ -21,7 +21,6 @@ armour_penetration = 1000 resistance_flags = INDESTRUCTIBLE anchored = TRUE - flags = HANDSLOW var/team = WHITE_TEAM var/reset_cooldown = 0 var/obj/effect/ctf/flag_reset/reset @@ -35,6 +34,7 @@ /obj/item/weapon/twohanded/ctf/Initialize() ..() + SET_SECONDARY_FLAG(src, SLOWS_WHILE_IN_HAND) if(!reset) reset = new reset_path(get_turf(src)) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index f63a72bb37f..c06a9cd6b30 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -887,7 +887,7 @@ if(H.back) . += H.back.slowdown for(var/obj/item/I in H.held_items) - if(I.flags & HANDSLOW) + if(HAS_SECONDARY_FLAG(I, SLOWS_WHILE_IN_HAND)) . += I.slowdown var/health_deficiency = (100 - H.health + H.staminaloss) var/hungry = (500 - H.nutrition) / 5 // So overeat would be 100 and default level would be 80 diff --git a/code/modules/modular_computers/computers/item/laptop.dm b/code/modules/modular_computers/computers/item/laptop.dm index f87eb0e6daf..6a14d3a43fe 100644 --- a/code/modules/modular_computers/computers/item/laptop.dm +++ b/code/modules/modular_computers/computers/item/laptop.dm @@ -12,16 +12,18 @@ max_hardware_size = 2 w_class = WEIGHT_CLASS_NORMAL - flags = HANDSLOW // No running around with open laptops in hands. - screen_on = 0 // Starts closed var/start_open = 1 // unless this var is set to 1 var/icon_state_closed = "laptop-closed" var/w_class_open = WEIGHT_CLASS_BULKY var/slowdown_open = 1 -/obj/item/device/modular_computer/laptop/New() +/obj/item/device/modular_computer/laptop/Initialize() ..() + + // No running around with open laptops in hands. + SET_SECONDARY_FLAG(src, SLOWS_WHILE_IN_HAND) + if(start_open && !screen_on) toggle_open() diff --git a/code/modules/projectiles/guns/ballistic/bow.dm b/code/modules/projectiles/guns/ballistic/bow.dm index 42eca2b053d..bd00fdd7d92 100644 --- a/code/modules/projectiles/guns/ballistic/bow.dm +++ b/code/modules/projectiles/guns/ballistic/bow.dm @@ -9,12 +9,15 @@ var/item_state_firing = "bow" fire_sound = 'sound/weapons/grenadelaunch.ogg' mag_type = /obj/item/ammo_box/magazine/internal/bow - flags = HANDSLOW weapon_weight = WEAPON_HEAVY var/draw_sound = 'sound/weapons/draw_bow.ogg' var/ready_to_fire = 0 var/slowdown_when_ready = 2 +/obj/item/weapon/gun/ballistic/bow/Initialize(mapload) + ..() + SET_SECONDARY_FLAG(src, SLOWS_WHILE_IN_HAND) + /obj/item/weapon/gun/ballistic/bow/update_icon() if(ready_to_fire) icon_state = icon_state_firing diff --git a/code/modules/projectiles/guns/ballistic/laser_gatling.dm b/code/modules/projectiles/guns/ballistic/laser_gatling.dm index 38cc6a344d7..2049273da22 100644 --- a/code/modules/projectiles/guns/ballistic/laser_gatling.dm +++ b/code/modules/projectiles/guns/ballistic/laser_gatling.dm @@ -96,7 +96,7 @@ icon_state = "minigun_spin" item_state = "minigun" origin_tech = "combat=6;powerstorage=5;magnets=4" - flags = CONDUCT | HANDSLOW + flags = CONDUCT slowdown = 1 slot_flags = null w_class = WEIGHT_CLASS_HUGE @@ -110,6 +110,17 @@ casing_ejector = 0 var/obj/item/weapon/minigunpack/ammo_pack +/obj/item/weapon/gun/ballistic/minigun/Initialize(mapload) + ..() + SET_SECONDARY_FLAG(src, SLOWS_WHILE_IN_HAND) + + if(!ammo_pack) + if(istype(loc,/obj/item/weapon/minigunpack)) //We should spawn inside a ammo pack so let's use that one. + ammo_pack = loc + ..() + else + qdel(src)//No pack, no gun + /obj/item/weapon/gun/ballistic/minigun/attack_self(mob/living/user) return @@ -132,14 +143,6 @@ to_chat(user, "You need the backpack power source to fire the gun!") ..() -/obj/item/weapon/gun/ballistic/minigun/New() - if(!ammo_pack) - if(istype(loc,/obj/item/weapon/minigunpack)) //We should spawn inside a ammo pack so let's use that one. - ammo_pack = loc - ..() - else - qdel(src)//No pack, no gun - /obj/item/weapon/gun/ballistic/minigun/dropped(mob/living/user) ammo_pack.attach_gun(user)