From fe10959af0a367fd0c7d0ffb2c71dc17690ac77e Mon Sep 17 00:00:00 2001 From: ShizCalev Date: Fri, 26 Oct 2018 20:10:37 -0400 Subject: [PATCH] Adds examine messages for helmets & guns with flashlights (and bayonets) (#40998) cl ShizCalev tweak: Added examine messages for helmets & guns with flashlights (and bayonets.) fix: Fixed an issue where you were able to remove flashlights/bayonets that were supposed to be permanently attached to a gun. fix: Fixed an issue where you were unable to remove flashlights & bayonets from certain weapons. fix: Fixed a potential issue where adding a flashlight to your helmet would've caused you to lose other action buttons. fix: Fixed a issue where guns with multiple action buttons would break all but one of those action buttons. tweak: If you have both a bayonet and a flashlight attached to your gun, you'll now be given a prompt on which you'd like to remove when using a screwdriver on it. /cl Shouldn't need to have "pro-gamer tips" in adminpm's just to inform folks that you can remove a flashlight from a helmet with a screwdriver. Also added some missing handle_atom_del / Destroy logic, as well as moving the clothing can_flashlight & flashlight vars down to helmet level (since they were the only things that utilize them anyway.) also why the fuck was the helmet flashlight var just called F. hnnnngg --- code/modules/clothing/clothing.dm | 2 - code/modules/clothing/head/helmet.dm | 122 ++++++++----- code/modules/clothing/under/_under.dm | 2 +- code/modules/projectiles/gun.dm | 165 ++++++++++++------ .../projectiles/guns/ballistic/automatic.dm | 12 +- code/modules/projectiles/guns/energy.dm | 3 - .../projectiles/guns/energy/energy_gun.dm | 8 +- .../guns/energy/kinetic_accelerator.dm | 4 +- .../projectiles/guns/energy/mounted.dm | 2 +- code/modules/projectiles/guns/energy/pulse.dm | 2 +- .../projectiles/guns/energy/special.dm | 4 +- code/modules/projectiles/guns/energy/stun.dm | 4 +- .../projectiles/guns/misc/beam_rifle.dm | 26 +-- 13 files changed, 222 insertions(+), 134 deletions(-) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 2c88fa34cb0..c513b313ec6 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -20,8 +20,6 @@ var/active_sound = null var/toggle_cooldown = null var/cooldown = 0 - var/obj/item/flashlight/F = null - var/can_flashlight = 0 var/scan_reagents = 0 //Can the wearer see reagents while it's equipped? var/clothing_flags = NONE diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index bce67e92a2f..82ce7c098fe 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -16,17 +16,47 @@ dog_fashion = /datum/dog_fashion/head/helmet + var/can_flashlight = FALSE //if a flashlight can be mounted. if it has a flashlight and this is false, it is permanently attached. + var/obj/item/flashlight/seclite/attached_light + var/datum/action/item_action/toggle_helmet_flashlight/alight + +/obj/item/clothing/head/helmet/Initialize() + . = ..() + if(attached_light) + alight = new(src) + /obj/item/clothing/head/helmet/ComponentInitialize() . = ..() AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_HEAD)) +/obj/item/clothing/head/helmet/examine(mob/user) + ..() + if(attached_light) + to_chat(user, "It has \a [attached_light] [can_flashlight ? "" : "permanently "]mounted on it.") + if(can_flashlight) + to_chat(user, "[attached_light] looks like it can be unscrewed from [src].") + else if(can_flashlight) + to_chat(user, "It has a mounting point for a seclite.") + +/obj/item/clothing/head/helmet/Destroy() + QDEL_NULL(attached_light) + return ..() + +/obj/item/clothing/head/helmet/handle_atom_del(atom/A) + if(A == attached_light) + attached_light = null + update_helmlight() + update_icon() + QDEL_NULL(alight) + return ..() + /obj/item/clothing/head/helmet/sec - can_flashlight = 1 + can_flashlight = TRUE /obj/item/clothing/head/helmet/sec/attackby(obj/item/I, mob/user, params) if(issignaler(I)) var/obj/item/assembly/signaler/S = I - if(F) //Has a flashlight. Player must remove it, else it will be lost forever. + if(attached_light) //Has a flashlight. Player must remove it, else it will be lost forever. to_chat(user, "The mounted flashlight is in the way, remove it first!") return @@ -45,7 +75,7 @@ icon_state = "helmetalt" item_state = "helmetalt" armor = list("melee" = 15, "bullet" = 60, "laser" = 10, "energy" = 10, "bomb" = 40, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50) - can_flashlight = 1 + can_flashlight = TRUE dog_fashion = null /obj/item/clothing/head/helmet/old @@ -93,7 +123,7 @@ if(active_sound) while(up) - playsound(src.loc, "[active_sound]", 100, 0, 4) + playsound(src, "[active_sound]", 100, FALSE, 4) sleep(15) /obj/item/clothing/head/helmet/justice @@ -255,8 +285,8 @@ /obj/item/clothing/head/helmet/update_icon() var/state = "[initial(icon_state)]" - if(F) - if(F.on) + if(attached_light) + if(attached_light.on) state += "-flight-on" //"helmet-flight-on" // "helmet-cam-flight-on" else state += "-flight" //etc. @@ -268,7 +298,7 @@ H.update_inv_head() /obj/item/clothing/head/helmet/ui_action_click(mob/user, action) - if(istype(action, /datum/action/item_action/toggle_helmet_flashlight)) + if(istype(action, alight)) toggle_helmlight() else ..() @@ -276,60 +306,60 @@ /obj/item/clothing/head/helmet/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/flashlight/seclite)) var/obj/item/flashlight/seclite/S = I - if(can_flashlight) - if(!F) - if(!user.transferItemToLoc(S, src)) - return - to_chat(user, "You click [S] into place on [src].") - if(S.on) - set_light(0) - F = S - update_icon() - update_helmlight(user) - verbs += /obj/item/clothing/head/helmet/proc/toggle_helmlight - var/datum/action/A = new /datum/action/item_action/toggle_helmet_flashlight(src) - if(loc == user) - A.Grant(user) + if(can_flashlight && !attached_light) + if(!user.transferItemToLoc(S, src)) + return + to_chat(user, "You click [S] into place on [src].") + if(S.on) + set_light(0) + attached_light = S + update_icon() + update_helmlight() + alight = new(src) + if(loc == user) + alight.Grant(user) return - - if(I.tool_behaviour == TOOL_SCREWDRIVER) - if(F) - for(var/obj/item/flashlight/seclite/S in src) - to_chat(user, "You unscrew the seclite from [src].") - F = null - S.forceMove(user.drop_location()) - update_helmlight(user) - S.update_brightness(user) - update_icon() - usr.update_inv_head() - verbs -= /obj/item/clothing/head/helmet/proc/toggle_helmlight - for(var/datum/action/item_action/toggle_helmet_flashlight/THL in actions) - qdel(THL) - return - return ..() +/obj/item/clothing/head/helmet/screwdriver_act(mob/living/user, obj/item/I) + ..() + if(can_flashlight && attached_light) //if it has a light but can_flashlight is false, the light is permanently attached. + I.play_tool_sound(src) + to_chat(user, "You unscrew [attached_light] from [src].") + attached_light.forceMove(drop_location()) + if(Adjacent(user) && !issilicon(user)) + user.put_in_hands(attached_light) + + var/obj/item/flashlight/removed_light = attached_light + attached_light = null + update_helmlight() + removed_light.update_brightness(user) + update_icon() + user.update_inv_head() + QDEL_NULL(alight) + return TRUE + /obj/item/clothing/head/helmet/proc/toggle_helmlight() set name = "Toggle Helmetlight" set category = "Object" set desc = "Click to toggle your helmet's attached flashlight." - if(!F) + if(!attached_light) return var/mob/user = usr if(user.incapacitated()) return - F.on = !F.on - to_chat(user, "You toggle the helmetlight [F.on ? "on":"off"].") + attached_light.on = !attached_light.on + to_chat(user, "You toggle the helmet-light [attached_light.on ? "on":"off"].") - playsound(user, 'sound/weapons/empty.ogg', 100, 1) - update_helmlight(user) + playsound(user, 'sound/weapons/empty.ogg', 100, TRUE) + update_helmlight() -/obj/item/clothing/head/helmet/proc/update_helmlight(mob/user = null) - if(F) - if(F.on) - set_light(F.brightness_on) +/obj/item/clothing/head/helmet/proc/update_helmlight() + if(attached_light) + if(attached_light.on) + set_light(attached_light.brightness_on) else set_light(0) update_icon() diff --git a/code/modules/clothing/under/_under.dm b/code/modules/clothing/under/_under.dm index 5aa37b742d6..272afe646ab 100644 --- a/code/modules/clothing/under/_under.dm +++ b/code/modules/clothing/under/_under.dm @@ -155,4 +155,4 @@ if(SENSOR_COORDS) to_chat(user, "Its vital tracker and tracking beacon appear to be enabled.") if(attached_accessory) - to_chat(user, "\A [attached_accessory] is attached to it.") \ No newline at end of file + to_chat(user, "\A [attached_accessory] is attached to it.") diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index d59b7b5c4e5..1ce73b9d4e5 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -41,20 +41,21 @@ var/obj/item/firing_pin/pin = /obj/item/firing_pin //standard firing pin for most guns - var/obj/item/flashlight/gun_light - var/can_flashlight = 0 + var/can_flashlight = FALSE //if a flashlight can be added or removed if it already has one. + var/obj/item/flashlight/seclite/gun_light + var/mutable_appearance/flashlight_overlay + var/datum/action/item_action/toggle_gunlight/alight + + var/can_bayonet = FALSE //if a bayonet can be added or removed if it already has one. var/obj/item/kitchen/knife/bayonet var/mutable_appearance/knife_overlay - var/can_bayonet = FALSE - var/datum/action/item_action/toggle_gunlight/alight - var/mutable_appearance/flashlight_overlay + var/knife_x_offset = 0 + var/knife_y_offset = 0 var/ammo_x_offset = 0 //used for positioning ammo count overlay on sprite var/ammo_y_offset = 0 var/flight_x_offset = 0 var/flight_y_offset = 0 - var/knife_x_offset = 0 - var/knife_y_offset = 0 //Zooming var/zoomable = FALSE //whether the gun generates a Zoom action on creation @@ -68,9 +69,28 @@ if(pin) pin = new pin(src) if(gun_light) - alight = new /datum/action/item_action/toggle_gunlight(src) + alight = new(src) build_zooming() +/obj/item/gun/Destroy() + QDEL_NULL(pin) + QDEL_NULL(gun_light) + QDEL_NULL(bayonet) + QDEL_NULL(chambered) + QDEL_NULL(azoom) + return ..() + +/obj/item/gun/handle_atom_del(atom/A) + if(A == pin) + pin = null + if(A == chambered) + chambered = null + update_icon() + if(A == bayonet) + clear_bayonet() + if(A == gun_light) + clear_gunlight() + return ..() /obj/item/gun/CheckParts(list/parts_list) ..() @@ -86,7 +106,21 @@ if(pin) to_chat(user, "It has \a [pin] installed.") else - to_chat(user, "It doesn't have a firing pin installed, and won't fire.") + to_chat(user, "It doesn't have a firing pin installed, and won't fire.") + + if(gun_light) + to_chat(user, "It has \a [gun_light] [can_flashlight ? "" : "permanently "]mounted on it.") + if(can_flashlight) //if it has a light and this is false, the light is permanent. + to_chat(user, "[gun_light] looks like it can be unscrewed from [src].") + else if(can_flashlight) + to_chat(user, "It has a mounting point for a seclite.") + + if(bayonet) + to_chat(user, "It has \a [bayonet] [can_bayonet ? "" : "permanently "]affixed to it.") + if(can_bayonet) //if it has a bayonet and this is false, the bayonet is permanent. + to_chat(user, "[bayonet] looks like it can be unscrewed from [src].") + else if(can_bayonet) + to_chat(user, "It has a bayonet lug on it.") /obj/item/gun/equipped(mob/living/user, slot) . = ..() @@ -104,7 +138,7 @@ /obj/item/gun/proc/shoot_with_empty_chamber(mob/living/user as mob|obj) to_chat(user, "*click*") - playsound(src, "gun_dry_fire", 30, 1) + playsound(src, "gun_dry_fire", 30, TRUE) /obj/item/gun/proc/shoot_live_shot(mob/living/user as mob|obj, pointblank = 0, mob/pbtarget = null, message = 1) @@ -112,9 +146,9 @@ shake_camera(user, recoil + 1, recoil) if(suppressed) - playsound(user, fire_sound, 10, 1) + playsound(user, fire_sound, 10, TRUE) else - playsound(user, fire_sound, 50, 1) + playsound(user, fire_sound, 50, TRUE) if(message) if(pointblank) user.visible_message("[user] fires [src] point blank at [pbtarget]!", null, null, COMBAT_MESSAGE_RANGE) @@ -323,12 +357,12 @@ if(!gun_light) if(!user.transferItemToLoc(I, src)) return - to_chat(user, "You click \the [S] into place on \the [src].") + to_chat(user, "You click [S] into place on [src].") if(S.on) set_light(0) gun_light = S - update_gunlight(user) - alight = new /datum/action/item_action/toggle_gunlight(src) + update_gunlight() + alight = new(src) if(loc == user) alight.Grant(user) else if(istype(I, /obj/item/kitchen/knife)) @@ -337,7 +371,7 @@ return ..() if(!user.transferItemToLoc(I, src)) return - to_chat(user, "You attach \the [K] to the front of \the [src].") + to_chat(user, "You attach [K] to [src]'s bayonet lug.") bayonet = K var/state = "bayonet" //Generic state. if(bayonet.icon_state in icon_states('icons/obj/guns/bayonets.dmi')) //Snowflake state? @@ -347,25 +381,67 @@ knife_overlay.pixel_x = knife_x_offset knife_overlay.pixel_y = knife_y_offset add_overlay(knife_overlay, TRUE) - else if(I.tool_behaviour == TOOL_SCREWDRIVER) - if(gun_light) - var/obj/item/flashlight/seclite/S = gun_light - to_chat(user, "You unscrew the seclite from \the [src].") - gun_light = null - S.forceMove(get_turf(user)) - update_gunlight(user) - S.update_brightness(user) - QDEL_NULL(alight) - if(bayonet) - to_chat(user, "You unscrew the bayonet from \the [src].") - var/obj/item/kitchen/knife/K = bayonet - K.forceMove(get_turf(user)) - bayonet = null - cut_overlay(knife_overlay, TRUE) - knife_overlay = null else return ..() +/obj/item/gun/screwdriver_act(mob/living/user, obj/item/I) + . = ..() + if(.) + return + if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) + return + if((can_flashlight && gun_light) && (can_bayonet && bayonet)) //give them a choice instead of removing both + var/list/possible_items = list(gun_light, bayonet) + var/obj/item/item_to_remove = input(user, "Select an attachment to remove", "Attachment Removal") as null|obj in possible_items + if(!item_to_remove || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) + return + return remove_gun_attachment(user, I, item_to_remove) + + else if(gun_light && can_flashlight) //if it has a gun_light and can_flashlight is false, the flashlight is permanently attached. + return remove_gun_attachment(user, I, gun_light, "unscrewed") + + else if(bayonet && can_bayonet) //if it has a bayonet, and the bayonet can be removed + return remove_gun_attachment(user, I, bayonet, "unfix") + +/obj/item/gun/proc/remove_gun_attachment(mob/living/user, obj/item/tool_item, obj/item/item_to_remove, removal_verb) + if(tool_item) + tool_item.play_tool_sound(src) + to_chat(user, "You [removal_verb ? removal_verb : "remove"] [item_to_remove] from [src].") + item_to_remove.forceMove(drop_location()) + + if(Adjacent(user) && !issilicon(user)) + user.put_in_hands(item_to_remove) + + if(item_to_remove == bayonet) + return clear_bayonet() + else if(item_to_remove == gun_light) + return clear_gunlight() + +/obj/item/gun/proc/clear_bayonet() + if(!bayonet) + return + bayonet = null + if(knife_overlay) + cut_overlay(knife_overlay, TRUE) + knife_overlay = null + return TRUE + +/obj/item/gun/proc/clear_gunlight() + if(!gun_light) + return + var/obj/item/flashlight/seclite/removed_light = gun_light + gun_light = null + update_gunlight() + removed_light.update_brightness() + QDEL_NULL(alight) + return TRUE + +/obj/item/gun/ui_action_click(mob/user, actiontype) + if(istype(actiontype, alight)) + toggle_gunlight() + else + ..() + /obj/item/gun/proc/toggle_gunlight() if(!gun_light) return @@ -374,11 +450,10 @@ gun_light.on = !gun_light.on to_chat(user, "You toggle the gunlight [gun_light.on ? "on":"off"].") - playsound(user, 'sound/weapons/empty.ogg', 100, 1) - update_gunlight(user) - return + playsound(user, 'sound/weapons/empty.ogg', 100, TRUE) + update_gunlight() -/obj/item/gun/proc/update_gunlight(mob/user = null) +/obj/item/gun/proc/update_gunlight() if(gun_light) if(gun_light.on) set_light(gun_light.brightness_on) @@ -401,21 +476,10 @@ var/datum/action/A = X A.UpdateButtonIcon() -/obj/item/gun/pickup(mob/user) - ..() - if(azoom) - azoom.Grant(user) - if(alight) - alight.Grant(user) - /obj/item/gun/dropped(mob/user) - ..() + . = ..() if(zoomed) zoom(user,FALSE) - if(azoom) - azoom.Remove(user) - if(alight) - alight.Remove(user) /obj/item/gun/proc/handle_suicide(mob/living/carbon/human/user, mob/living/carbon/human/target, params) if(!ishuman(user) || !ishuman(target)) @@ -522,8 +586,3 @@ if(zoomable) azoom = new() azoom.gun = src - -/obj/item/gun/handle_atom_del(atom/A) - if(A == chambered) - chambered = null - update_icon() diff --git a/code/modules/projectiles/guns/ballistic/automatic.dm b/code/modules/projectiles/guns/ballistic/automatic.dm index 356e93b3f83..4f0ca6e4060 100644 --- a/code/modules/projectiles/guns/ballistic/automatic.dm +++ b/code/modules/projectiles/guns/ballistic/automatic.dm @@ -51,8 +51,11 @@ else to_chat(user, "You cannot seem to get \the [src] out of your hands!") -/obj/item/gun/ballistic/automatic/ui_action_click() - burst_select() +/obj/item/gun/ballistic/automatic/ui_action_click(mob/user, actiontype) + if(istype(actiontype, /datum/action/item_action/toggle_firemode)) + burst_select() + else + ..() /obj/item/gun/ballistic/automatic/proc/burst_select() var/mob/living/carbon/human/user = usr @@ -106,7 +109,6 @@ /obj/item/gun/ballistic/automatic/c20r/afterattack() . = ..() empty_alarm() - return /obj/item/gun/ballistic/automatic/c20r/update_icon() ..() @@ -167,8 +169,8 @@ if(select == 2) underbarrel.afterattack(target, user, flag, params) else - . = ..() - return + return ..() + /obj/item/gun/ballistic/automatic/m90/attackby(obj/item/A, mob/user, params) if(istype(A, /obj/item/ammo_casing)) if(istype(A, underbarrel.magazine.ammo_type)) diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm index dd2baa7db88..3ac52bd979d 100644 --- a/code/modules/projectiles/guns/energy.dm +++ b/code/modules/projectiles/guns/energy.dm @@ -165,9 +165,6 @@ itemState += "[ratio]" item_state = itemState -/obj/item/gun/energy/ui_action_click() - toggle_gunlight() - /obj/item/gun/energy/suicide_act(mob/living/user) if (istype(user) && can_shoot() && can_trigger_gun(user) && user.get_bodypart(BODY_ZONE_HEAD)) user.visible_message("[user] is putting the barrel of [src] in [user.p_their()] mouth. It looks like [user.p_theyre()] trying to commit suicide!") diff --git a/code/modules/projectiles/guns/energy/energy_gun.dm b/code/modules/projectiles/guns/energy/energy_gun.dm index 99f8166297d..976733246c4 100644 --- a/code/modules/projectiles/guns/energy/energy_gun.dm +++ b/code/modules/projectiles/guns/energy/energy_gun.dm @@ -5,7 +5,7 @@ item_state = null //so the human update icon uses the icon_state instead. ammo_type = list(/obj/item/ammo_casing/energy/disabler, /obj/item/ammo_casing/energy/laser) modifystate = 1 - can_flashlight = 1 + can_flashlight = TRUE ammo_x_offset = 3 flight_x_offset = 15 flight_y_offset = 10 @@ -19,7 +19,7 @@ cell_type = /obj/item/stock_parts/cell{charge = 600; maxcharge = 600} ammo_x_offset = 2 charge_sections = 3 - can_flashlight = 0 // Can't attach or detach the flashlight, and override it's icon update + can_flashlight = FALSE // Can't attach or detach the flashlight, and override it's icon update /obj/item/gun/energy/e_gun/mini/Initialize() gun_light = new /obj/item/flashlight/seclite(src) @@ -67,7 +67,7 @@ lefthand_file = 'icons/mob/inhands/weapons/guns_lefthand.dmi' righthand_file = 'icons/mob/inhands/weapons/guns_righthand.dmi' ammo_type = list(/obj/item/ammo_casing/energy/net, /obj/item/ammo_casing/energy/trap) - can_flashlight = 0 + can_flashlight = FALSE ammo_x_offset = 1 /obj/item/gun/energy/e_gun/dragnet/snare @@ -84,7 +84,7 @@ w_class = WEIGHT_CLASS_HUGE ammo_type = list(/obj/item/ammo_casing/energy/electrode, /obj/item/ammo_casing/energy/laser) weapon_weight = WEAPON_HEAVY - can_flashlight = 0 + can_flashlight = FALSE trigger_guard = TRIGGER_GUARD_NONE ammo_x_offset = 2 diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm index 2639c138d8f..09c55c12d87 100644 --- a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm +++ b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm @@ -8,7 +8,7 @@ item_flags = NONE obj_flags = UNIQUE_RENAME weapon_weight = WEAPON_LIGHT - can_flashlight = 1 + can_flashlight = TRUE flight_x_offset = 15 flight_y_offset = 9 automatic_charge_overlays = FALSE @@ -22,7 +22,7 @@ var/max_mod_capacity = 100 var/list/modkits = list() - + var/recharge_timerid /obj/item/gun/energy/kinetic_accelerator/examine(mob/user) diff --git a/code/modules/projectiles/guns/energy/mounted.dm b/code/modules/projectiles/guns/energy/mounted.dm index 79226689de0..869b4887449 100644 --- a/code/modules/projectiles/guns/energy/mounted.dm +++ b/code/modules/projectiles/guns/energy/mounted.dm @@ -6,7 +6,7 @@ item_state = "armcannonstun4" force = 5 selfcharge = 1 - can_flashlight = 0 + can_flashlight = FALSE trigger_guard = TRIGGER_GUARD_ALLOW_ALL // Has no trigger at all, uses neural signals instead /obj/item/gun/energy/e_gun/advtaser/mounted/dropped()//if somebody manages to drop this somehow... diff --git a/code/modules/projectiles/guns/energy/pulse.dm b/code/modules/projectiles/guns/energy/pulse.dm index cf9b697d000..e39c171ab2f 100644 --- a/code/modules/projectiles/guns/energy/pulse.dm +++ b/code/modules/projectiles/guns/energy/pulse.dm @@ -43,7 +43,7 @@ icon_state = "pulse_carbine" item_state = null cell_type = "/obj/item/stock_parts/cell/pulse/carbine" - can_flashlight = 1 + can_flashlight = TRUE flight_x_offset = 18 flight_y_offset = 12 diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm index b2c558ab58a..b771dea581a 100644 --- a/code/modules/projectiles/guns/energy/special.dm +++ b/code/modules/projectiles/guns/energy/special.dm @@ -3,7 +3,7 @@ desc = "A man-portable anti-armor weapon designed to disable mechanical threats at range." icon_state = "ionrifle" item_state = null //so the human update icon uses the icon_state instead. - can_flashlight = 1 + can_flashlight = TRUE w_class = WEIGHT_CLASS_HUGE flags_1 = CONDUCT_1 slot_flags = ITEM_SLOT_BACK @@ -93,7 +93,7 @@ overheat_time = 20 holds_charge = TRUE unique_frequency = TRUE - can_flashlight = 0 + can_flashlight = FALSE max_mod_capacity = 0 /obj/item/gun/energy/kinetic_accelerator/crossbow/halloween diff --git a/code/modules/projectiles/guns/energy/stun.dm b/code/modules/projectiles/guns/energy/stun.dm index 77281497ba6..96d263c6c58 100644 --- a/code/modules/projectiles/guns/energy/stun.dm +++ b/code/modules/projectiles/guns/energy/stun.dm @@ -12,7 +12,7 @@ icon_state = "tesla" item_state = "tesla" ammo_type = list(/obj/item/ammo_casing/energy/tesla_revolver) - can_flashlight = 0 + can_flashlight = FALSE pin = null shaded_charge = 1 @@ -26,7 +26,7 @@ /obj/item/gun/energy/e_gun/advtaser/cyborg name = "cyborg taser" desc = "An integrated hybrid taser that draws directly from a cyborg's power cell. The weapon contains a limiter to prevent the cyborg's power cell from overheating." - can_flashlight = 0 + can_flashlight = FALSE can_charge = 0 use_cyborg_cell = 1 diff --git a/code/modules/projectiles/guns/misc/beam_rifle.dm b/code/modules/projectiles/guns/misc/beam_rifle.dm index 27d87342d4c..98f37609ec5 100644 --- a/code/modules/projectiles/guns/misc/beam_rifle.dm +++ b/code/modules/projectiles/guns/misc/beam_rifle.dm @@ -85,31 +85,33 @@ /obj/item/gun/energy/beam_rifle/equipped(mob/user) set_user(user) - . = ..() + return ..() /obj/item/gun/energy/beam_rifle/pickup(mob/user) set_user(user) - . = ..() + return ..() /obj/item/gun/energy/beam_rifle/dropped(mob/user) set_user() - . = ..() + return ..() -/obj/item/gun/energy/beam_rifle/ui_action_click(owner, action) - if(istype(action, /datum/action/item_action/zoom_lock_action)) +/obj/item/gun/energy/beam_rifle/ui_action_click(mob/user, actiontype) + if(istype(actiontype, zoom_lock_action)) zoom_lock++ if(zoom_lock > 3) zoom_lock = 0 switch(zoom_lock) if(ZOOM_LOCK_AUTOZOOM_FREEMOVE) - to_chat(owner, "You switch [src]'s zooming processor to free directional.") + to_chat(user, "You switch [src]'s zooming processor to free directional.") if(ZOOM_LOCK_AUTOZOOM_ANGLELOCK) - to_chat(owner, "You switch [src]'s zooming processor to locked directional.") + to_chat(user, "You switch [src]'s zooming processor to locked directional.") if(ZOOM_LOCK_CENTER_VIEW) - to_chat(owner, "You switch [src]'s zooming processor to center mode.") + to_chat(user, "You switch [src]'s zooming processor to center mode.") if(ZOOM_LOCK_OFF) - to_chat(owner, "You disable [src]'s zooming system.") - reset_zooming() + to_chat(user, "You disable [src]'s zooming system.") + reset_zooming() + else + ..() /obj/item/gun/energy/beam_rifle/proc/set_autozoom_pixel_offsets_immediate(current_angle) if(zoom_lock == ZOOM_LOCK_CENTER_VIEW || zoom_lock == ZOOM_LOCK_OFF) @@ -518,13 +520,13 @@ return FALSE if(!QDELETED(target)) cached = get_turf(target) - . = ..() + return ..() /obj/item/projectile/beam/beam_rifle/on_hit(atom/target, blocked = FALSE) if(!QDELETED(target)) cached = get_turf(target) handle_hit(target) - . = ..() + return ..() /obj/item/projectile/beam/beam_rifle/hitscan icon_state = ""