From 42e8bb06cbc165bef1097c3d666a0ed6d14c9c17 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 27 Apr 2022 09:06:07 +0200 Subject: [PATCH] [MIRROR] adds (and improves existing) documentation for weldingtool.dm [MDB IGNORE] (#13160) * adds (and improves existing) documentation for weldingtool.dm (#66500) * add welding tool docs * fuck * SHIT * kylerace is making me do work for my gbp * fuck * adds (and improves existing) documentation for weldingtool.dm Co-authored-by: magatsuchi <88991542+magatsuchi@users.noreply.github.com> --- code/game/objects/items/tools/weldingtool.dm | 53 +++++++++++--------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/code/game/objects/items/tools/weldingtool.dm b/code/game/objects/items/tools/weldingtool.dm index 606fd65e158..8f2582acf9f 100644 --- a/code/game/objects/items/tools/weldingtool.dm +++ b/code/game/objects/items/tools/weldingtool.dm @@ -33,15 +33,21 @@ //wound_bonus = 10 //SKYRAT EDIT REMOVAL //bare_wound_bonus = 15 //SKYRAT EDIT REMOVAL custom_materials = list(/datum/material/iron=70, /datum/material/glass=30) - ///Whether the welding tool is on or off. + /// Whether the welding tool is on or off. var/welding = FALSE - var/status = TRUE //Whether the welder is secured or unsecured (able to attach rods to it to make a flamethrower) - var/max_fuel = 20 //The max amount of fuel the welder can hold - var/change_icons = 1 - var/can_off_process = 0 - var/burned_fuel_for = 0 //when fuel was last removed - var/acti_sound = 'sound/items/welderactivate.ogg' - var/deac_sound = 'sound/items/welderdeactivate.ogg' + /// Whether the welder is secured or unsecured (able to attach rods to it to make a flamethrower) + var/status = TRUE + /// The max amount of fuel the welder can hold + var/max_fuel = 20 + /// Whether or not we're changing the icon based on fuel left. + var/change_icons = TRUE + /// Used in process(), dictates whether or not we're calling STOP_PROCESSING whilst we're not welding. + var/can_off_process = FALSE + /// When fuel was last removed. + var/burned_fuel_for = 0 + + var/activation_sound = 'sound/items/welderactivate.ogg' + var/deactivation_sound = 'sound/items/welderdeactivate.ogg' /obj/item/weldingtool/Initialize(mapload) . = ..() @@ -113,7 +119,7 @@ /obj/item/weldingtool/proc/explode() var/plasmaAmount = reagents.get_reagent_amount(/datum/reagent/toxin/plasma) - dyn_explosion(src, plasmaAmount/5, explosion_cause = src)//20 plasma in a standard welder has a 4 power explosion. no breaches, but enough to kill/dismember holder + dyn_explosion(src, plasmaAmount/5, explosion_cause = src) // 20 plasma in a standard welder has a 4 power explosion. no breaches, but enough to kill/dismember holder qdel(src) /obj/item/weldingtool/attack(mob/living/carbon/human/attacked_humanoid, mob/living/user) @@ -179,19 +185,17 @@ update_appearance() - -// Ah fuck, I can't believe you've done this /obj/item/weldingtool/proc/handle_fuel_and_temps(used = 0, mob/living/user) use(used) var/turf/location = get_turf(user) location.hotspot_expose(700, 50, 1) -// Returns the amount of fuel in the welder +/// Returns the amount of fuel in the welder /obj/item/weldingtool/proc/get_fuel() return reagents.get_reagent_amount(/datum/reagent/fuel) -// Uses fuel from the welding tool. +/// Uses fuel from the welding tool. /obj/item/weldingtool/use(used = 0) if(!isOn() || !check_fuel()) return FALSE @@ -207,7 +211,7 @@ return FALSE -//Toggles the welding value. +/// Toggles the welding value. /obj/item/weldingtool/proc/set_welding(new_value) if(welding == new_value) return @@ -217,7 +221,7 @@ SEND_SIGNAL(src, COMSIG_UPDATE_AMMO_HUD) //SKYRAT EDIT ADDITION -//Turns off the welder if there is no more fuel (does this really need to be its own proc?) +/// Turns off the welder if there is no more fuel (does this really need to be its own proc?) /obj/item/weldingtool/proc/check_fuel(mob/user) if(get_fuel() <= 0 && welding) set_light_on(FALSE) @@ -226,7 +230,7 @@ return FALSE return TRUE -//Switches the welder on +// /Switches the welder on /obj/item/weldingtool/proc/switched_on(mob/user) if(!status) to_chat(user, span_warning("[src] can't be turned on while unsecured!")) @@ -235,7 +239,7 @@ if(welding) if(get_fuel() >= 1) to_chat(user, span_notice("You switch [src] on.")) - playsound(loc, acti_sound, 50, TRUE) + playsound(loc, activation_sound, 50, TRUE) force = 15 damtype = BURN hitsound = 'sound/items/welder.ogg' @@ -246,10 +250,10 @@ switched_off(user) else to_chat(user, span_notice("You switch [src] off.")) - playsound(loc, deac_sound, 50, TRUE) + playsound(loc, deactivation_sound, 50, TRUE) switched_off(user) -//Switches the welder off +/// Switches the welder off /obj/item/weldingtool/proc/switched_off(mob/user) set_welding(FALSE) @@ -266,11 +270,11 @@ /obj/item/weldingtool/get_temperature() return welding * heat -//Returns whether or not the welding tool is currently on. +/// Returns whether or not the welding tool is currently on. /obj/item/weldingtool/proc/isOn() return welding -// If welding tool ran out of fuel during a construction task, construction fails. +/// If welding tool ran out of fuel during a construction task, construction fails. /obj/item/weldingtool/tool_use_check(mob/living/user, amount) if(!isOn() || !check_fuel()) to_chat(user, span_warning("[src] has to be on to complete this task!")) @@ -282,7 +286,7 @@ to_chat(user, span_warning("You need more welding fuel to complete this task!")) return FALSE - +/// Ran when the welder is attacked by a screwdriver. /obj/item/weldingtool/proc/flamethrower_screwdriver(obj/item/tool, mob/user) if(welding) to_chat(user, span_warning("Turn it off first!")) @@ -296,6 +300,7 @@ reagents.flags |= OPENCONTAINER add_fingerprint(user) +/// First step of building a flamethrower (when a welder is attacked by rods) /obj/item/weldingtool/proc/flamethrower_rods(obj/item/tool, mob/user) if(!status) var/obj/item/stack/rods/used_rods = tool @@ -382,8 +387,8 @@ inhand_icon_state = "exwelder" max_fuel = 40 custom_materials = list(/datum/material/iron = 1000, /datum/material/glass = 500, /datum/material/plasma = 1500, /datum/material/uranium = 200) - change_icons = 0 - can_off_process = 1 + change_icons = FALSE + can_off_process = TRUE light_range = 1 toolspeed = 0.5 var/last_gen = 0