Updates Tools

Adds toolspeed var, which is a multiplier on how 'fast' the tool works.  0.5 means it goes twice as fast.
Adds usesound var, which determines what sound is used when a tool is being used.
Changes a lot of code to use those two vars instead.
Adds 'ayyy' tools, which are ported from /tg/'s abductor gamemode.  They're currently admin only but I might make them obtainable by xenoarch later.
Adds powertools, also from /tg/.  CE starts with them in a new toolbelt that spawns in their locker, ported from (you guessed it) /tg/.
Changes welder sprites to look nicer, ported yet again from /tg/.  Modified the blue welder slightly so it can be the electric welder sprite.
Adds various sounds from /tg/, for tools and welders.
This commit is contained in:
Neerti
2017-08-03 04:49:23 -04:00
parent aa4729478b
commit 99eb6f9404
169 changed files with 901 additions and 511 deletions

View File

@@ -23,10 +23,10 @@
hack_state = null
return ..()
/obj/item/device/multitool/hacktool/attackby(var/obj/W, var/mob/user)
/obj/item/device/multitool/hacktool/attackby(var/obj/item/W, var/mob/user)
if(isscrewdriver(W))
in_hack_mode = !in_hack_mode
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
playsound(src.loc, W.usesound, 50, 1)
else
..()

View File

@@ -14,7 +14,7 @@
/obj/item/clothing/suit/space/void
)
/obj/item/device/modkit/afterattack(obj/O, mob/user as mob, proximity)
/obj/item/device/modkit/afterattack(obj/item/O, mob/user as mob, proximity)
if(!proximity)
return
@@ -47,7 +47,7 @@
user << "<span class='warning'>[O] must be safely placed on the ground for modification.</span>"
return
playsound(user.loc, 'sound/items/Screwdriver.ogg', 100, 1)
playsound(src.loc, O.usesound, 100, 1)
user.visible_message("<span class='notice'>\The [user] opens \the [src] and modifies \the [O].</span>","<span class='notice'>You open \the [src] and modify \the [O].</span>")

View File

@@ -22,6 +22,7 @@
var/obj/machinery/telecomms/buffer // simple machine buffer for device linkage
var/obj/machinery/clonepod/connecting //same for cryopod linkage
var/obj/machinery/connectable //Used to connect machinery.
toolspeed = 1
/obj/item/device/multitool/attack_self(mob/user)
var/clear = alert("Do you want to clear the buffers on the [src]?",, "Yes", "No",)
@@ -30,4 +31,17 @@
connecting = null
connectable = null
else
..()
..()
/obj/item/device/multitool/cyborg
name = "multitool"
desc = "Optimised and stripped-down version of a regular multitool."
toolspeed = 0.5
/obj/item/device/multitool/ayyy
name = "alien multitool"
desc = "An omni-technological interface."
icon = 'icons/obj/abductor.dmi'
icon_state = "multitool"
toolspeed = 0.1
origin_tech = list(TECH_MAGNETS = 5, TECH_ENGINEERING = 5)

View File

@@ -42,6 +42,7 @@
anchored = 1
mode = 1
src.visible_message("<span class='notice'>[user] attaches [src] to the cable!</span>")
playsound(src, I.usesound, 50, 1)
return
else
user << "Device must be placed over an exposed cable to attach to it."
@@ -54,6 +55,7 @@
mode = 0
src.visible_message("<span class='notice'>[user] detaches [src] from the cable!</span>")
set_light(0)
playsound(src, I.usesound, 50, 1)
icon_state = "powersink0"
return

View File

@@ -348,6 +348,7 @@
recalculateChannels()
user << "You pop out the encryption keys in the headset!"
playsound(src, W.usesound, 50, 1)
else
user << "This headset doesn't have any encryption keys! How useless..."

View File

@@ -113,6 +113,7 @@
if(istype(W, /obj/item/weapon/screwdriver)) // Opening the intercom up.
wiresexposed = !wiresexposed
user << "The wires have been [wiresexposed ? "exposed" : "unexposed"]"
playsound(src, W.usesound, 50, 1)
if(wiresexposed)
if(!on)
icon_state = "intercom-p_open"
@@ -123,7 +124,7 @@
return
if(wiresexposed && istype(W, /obj/item/weapon/wirecutters))
user.visible_message("<span class='warning'>[user] has cut the wires inside \the [src]!</span>", "You have cut the wires inside \the [src].")
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
playsound(src, W.usesound, 50, 1)
new/obj/item/stack/cable_coil(get_turf(src), 5)
var/obj/structure/frame/A = new /obj/structure/frame(src.loc)
var/obj/item/weapon/circuitboard/M = circuit

View File

@@ -629,6 +629,7 @@ var/global/list/default_medbay_channels = list(
recalculateChannels()
user << "You pop out the encryption key in the radio!"
playsound(src, W.usesound, 50, 1)
else
user << "This radio doesn't have any encryption keys!"

View File

@@ -138,6 +138,7 @@
else
cover_open = 1
user << "You unscrew the panel."
playsound(src, W.usesound, 50, 1)
updateicon()
return

View File

@@ -416,7 +416,8 @@
/obj/item/device/tape/attackby(obj/item/I, mob/user, params)
if(ruined && istype(I, /obj/item/weapon/screwdriver))
to_chat(user, "<span class='notice'>You start winding the tape back in...</span>")
if(do_after(user, 120, target = src))
playsound(src, I.usesound, 50, 1)
if(do_after(user, 120 * I.toolspeed, target = src))
to_chat(user, "<span class='notice'>You wound the tape back in.</span>")
fix()
return

View File

@@ -8,6 +8,7 @@
/obj/item/weapon/circuitboard/rdconsole/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I,/obj/item/weapon/screwdriver))
playsound(src, I.usesound, 50, 1)
user.visible_message("<span class='notice'>\The [user] adjusts the jumper on \the [src]'s access protocol pins.</span>", "<span class='notice'>You adjust the jumper on the access protocol pins.</span>")
if(build_path == /obj/machinery/computer/rdconsole/core)
name = T_BOARD("RD Console - Robotics")

View File

@@ -13,6 +13,7 @@ obj/item/weapon/circuitboard/rdserver
obj/item/weapon/circuitboard/rdserver/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I,/obj/item/weapon/screwdriver))
playsound(src, I.usesound, 50, 1)
user.visible_message("<span class='notice'>\The [user] adjusts the jumper on \the [src]'s access protocol pins.</span>", "<span class='notice'>You adjust the jumper on the access protocol pins.</span>")
if(build_path == /obj/machinery/r_n_d/server/core)
name = T_BOARD("RD Console - Robotics")

View File

@@ -28,6 +28,7 @@
if(istype(I, /obj/item/weapon/screwdriver))
open_panel = !open_panel
user << "<span class='notice'>You [open_panel ? "open" : "close"] the wire panel.</span>"
playsound(src, I.usesound, 50, 1)
else if(istype(I, /obj/item/weapon/wirecutters) || istype(I, /obj/item/device/multitool) || istype(I, /obj/item/device/assembly/signaler ))
wires.Interact(user)
else

View File

@@ -86,7 +86,7 @@
// user << "<span class='warning'>You need to add at least one beaker before locking the assembly.</span>"
user << "<span class='notice'>You lock the empty assembly.</span>"
name = "fake grenade"
playsound(src.loc, 'sound/items/Screwdriver.ogg', 25, -3)
playsound(src, W.usesound, 50, 1)
icon_state = initial(icon_state) +"_locked"
stage = 2
else if(stage == 2)
@@ -96,7 +96,7 @@
return
else
user << "<span class='notice'>You unlock the assembly.</span>"
playsound(src.loc, 'sound/items/Screwdriver.ogg', 25, -3)
playsound(src.loc, W.usesound, 50, -3)
name = "unsecured grenade with [beakers.len] containers[detonator?" and detonator":""]"
icon_state = initial(icon_state) + (detonator?"_ass":"")
stage = 1

View File

@@ -9,6 +9,7 @@
/obj/item/weapon/material/butterflyconstruction/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/screwdriver))
user << "You finish the concealed blade weapon."
playsound(src, W.usesound, 50, 1)
new /obj/item/weapon/material/butterfly(user.loc, material.name)
qdel(src)
return

View File

@@ -77,6 +77,22 @@
new /obj/item/weapon/wirecutters(src)
new /obj/item/device/t_scanner(src)
/obj/item/weapon/storage/belt/utility/chief
name = "chief engineer's toolbelt"
desc = "Holds tools, looks snazzy."
icon_state = "utilitybelt_ce"
item_state = "utility_ce"
/obj/item/weapon/storage/belt/utility/chief/full/New()
..()
new /obj/item/weapon/screwdriver/power(src)
new /obj/item/weapon/crowbar/power(src)
new /obj/item/weapon/weldingtool/experimental(src)
new /obj/item/device/multitool(src)
new /obj/item/stack/cable_coil(src,30,pick("red","yellow","orange"))
new /obj/item/weapon/extinguisher/mini(src)
new /obj/item/device/analyzer(src)
/obj/item/weapon/storage/belt/medical
name = "medical belt"
desc = "Can hold various medical equipment."
@@ -208,6 +224,22 @@
new /obj/item/device/soulstone(src)
new /obj/item/device/soulstone(src)
/obj/item/weapon/storage/belt/utility/ayyy
name = "alien belt"
desc = "A belt(?) that can hold things."
icon = 'icons/obj/abductor.dmi'
icon_state = "belt"
item_state = "security"
/obj/item/weapon/storage/belt/utility/ayyy/full/New()
..()
new /obj/item/weapon/screwdriver/ayyy(src)
new /obj/item/weapon/wrench/ayyy(src)
new /obj/item/weapon/weldingtool/ayyy(src)
new /obj/item/weapon/crowbar/ayyy(src)
new /obj/item/weapon/wirecutters/ayyy(src)
new /obj/item/device/multitool/ayyy(src)
new /obj/item/stack/cable_coil(src,30,"white")
/obj/item/weapon/storage/belt/champion
name = "championship belt"

View File

@@ -42,8 +42,9 @@
return
if (istype(W, /obj/item/weapon/screwdriver))
if (do_after(user, 20))
if (do_after(user, 20 * W.toolspeed))
src.open =! src.open
playsound(src, W.usesound, 50, 1)
user.show_message(text("<span class='notice'>You [] the service panel.</span>", (src.open ? "open" : "close")))
return
if ((istype(W, /obj/item/device/multitool)) && (src.open == 1)&& (!src.l_hacking))

View File

@@ -61,7 +61,7 @@
/obj/item/weapon/surgical/surgicaldrill
name = "surgical drill"
desc = "You can drill using this item. You dig?"
icon_state = "drill"
icon_state = "surgery_drill"
hitsound = 'sound/weapons/circsawhit.ogg'
matter = list(DEFAULT_WALL_MATERIAL = 15000, "glass" = 10000)
force = 15.0

View File

@@ -93,4 +93,5 @@
/obj/item/weapon/flame/lighter/zippo/c4detonator/attackby(obj/item/weapon/W, mob/user as mob)
if(istype(W, /obj/item/weapon/screwdriver))
detonator_mode = !detonator_mode
playsound(src, W.usesound, 50, 1)
user << "<span class='notice'>You unscrew the top panel of \the [src] revealing a button.</span>"

View File

@@ -1,5 +1,7 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
#define WELDER_FUEL_BURN_INTERVAL 13
/* Tools!
* Note: Multitools are /obj/item/device
*
@@ -17,7 +19,7 @@
/obj/item/weapon/wrench
name = "wrench"
desc = "A wrench with many common uses. Can be usually found in your hand."
icon = 'icons/obj/items.dmi'
icon = 'icons/obj/tools.dmi'
icon_state = "wrench"
flags = CONDUCT
slot_flags = SLOT_BELT
@@ -27,7 +29,44 @@
origin_tech = list(TECH_MATERIAL = 1, TECH_ENGINEERING = 1)
matter = list(DEFAULT_WALL_MATERIAL = 150)
attack_verb = list("bashed", "battered", "bludgeoned", "whacked")
usesound = 'sound/items/ratchet.ogg'
toolspeed = 1
/obj/item/weapon/wrench/cyborg
name = "automatic wrench"
desc = "An advanced robotic wrench. Can be found in industrial synthetic shells."
usesound = 'sound/items/drill_use.ogg'
toolspeed = 0.5
/obj/item/weapon/wrench/ayyy
name = "alien wrench"
desc = "A polarized wrench. It causes anything placed between the jaws to turn."
icon = 'icons/obj/abductor.dmi'
icon_state = "wrench"
usesound = 'sound/effects/empulse.ogg'
toolspeed = 0.1
origin_tech = list(TECH_MATERIAL = 5, TECH_ENGINEER = 5)
/obj/item/weapon/wrench/power
name = "hand drill"
desc = "A simple powered hand drill. It's fitted with a bolt bit."
icon_state = "drill_bolt"
item_state = "drill"
usesound = 'sound/items/drill_use.ogg'
matter = list(DEFAULT_WALL_MATERIAL = 150, MAT_SILVER = 50, MAT_TITANIUM = 25)
origin_tech = list(TECH_MATERIAL = 2, TECH_ENGINEERING = 2)
force = 8
w_class = ITEMSIZE_SMALL
throwforce = 8
attack_verb = list("drilled", "screwed", "jabbed")
toolspeed = 0.25
/obj/item/weapon/wrench/power/attack_self(mob/user)
playsound(get_turf(user),'sound/items/change_drill.ogg',50,1)
var/obj/item/weapon/screwdriver/power/s_drill = new /obj/item/weapon/screwdriver/power
to_chat(user, "<span class='notice'>You attach the screw driver bit to [src].</span>")
qdel(src)
user.put_in_active_hand(s_drill)
/*
* Screwdriver
@@ -35,7 +74,7 @@
/obj/item/weapon/screwdriver
name = "screwdriver"
desc = "You can be totally screwwy with this."
icon = 'icons/obj/items.dmi'
icon = 'icons/obj/tools.dmi'
icon_state = "screwdriver"
flags = CONDUCT
slot_flags = SLOT_BELT | SLOT_EARS
@@ -44,9 +83,13 @@
throwforce = 5
throw_speed = 3
throw_range = 5
hitsound = 'sound/weapons/bladeslice.ogg'
usesound = 'sound/items/screwdriver.ogg'
matter = list(DEFAULT_WALL_MATERIAL = 75)
attack_verb = list("stabbed")
sharp = 1
toolspeed = 1
var/random_color = TRUE
suicide_act(mob/user)
viewers(user) << pick("<span class='danger'>\The [user] is stabbing the [src.name] into \his temple! It looks like \he's trying to commit suicide.</span>", \
@@ -54,28 +97,29 @@
return(BRUTELOSS)
/obj/item/weapon/screwdriver/New()
switch(pick("red","blue","purple","brown","green","cyan","yellow"))
if ("red")
icon_state = "screwdriver2"
item_state = "screwdriver"
if ("blue")
icon_state = "screwdriver"
item_state = "screwdriver_blue"
if ("purple")
icon_state = "screwdriver3"
item_state = "screwdriver_purple"
if ("brown")
icon_state = "screwdriver4"
item_state = "screwdriver_brown"
if ("green")
icon_state = "screwdriver5"
item_state = "screwdriver_green"
if ("cyan")
icon_state = "screwdriver6"
item_state = "screwdriver_cyan"
if ("yellow")
icon_state = "screwdriver7"
item_state = "screwdriver_yellow"
if(random_color)
switch(pick("red","blue","purple","brown","green","cyan","yellow"))
if ("red")
icon_state = "screwdriver2"
item_state = "screwdriver"
if ("blue")
icon_state = "screwdriver"
item_state = "screwdriver_blue"
if ("purple")
icon_state = "screwdriver3"
item_state = "screwdriver_purple"
if ("brown")
icon_state = "screwdriver4"
item_state = "screwdriver_brown"
if ("green")
icon_state = "screwdriver5"
item_state = "screwdriver_green"
if ("cyan")
icon_state = "screwdriver6"
item_state = "screwdriver_cyan"
if ("yellow")
icon_state = "screwdriver7"
item_state = "screwdriver_yellow"
if (prob(75))
src.pixel_y = rand(0, 16)
@@ -90,13 +134,55 @@
M = user
return eyestab(M,user)
/obj/item/weapon/screwdriver/ayyy
name = "alien screwdriver"
desc = "An ultrasonic screwdriver."
icon = 'icons/obj/abductor.dmi'
icon_state = "screwdriver_a"
item_state = "screwdriver_black"
usesound = 'sound/items/pshoom.ogg'
toolspeed = 0.1
random_color = FALSE
/obj/item/weapon/screwdriver/cyborg
name = "powered screwdriver"
desc = "An electrical screwdriver, designed to be both precise and quick."
usesound = 'sound/items/drill_use.ogg'
toolspeed = 0.5
/obj/item/weapon/screwdriver/power
name = "hand drill"
desc = "A simple powered hand drill. It's fitted with a screw bit."
icon_state = "drill_screw"
item_state = "drill"
matter = list(DEFAULT_WALL_MATERIAL = 150, MAT_SILVER = 50, MAT_TITANIUM = 25)
origin_tech = list(TECH_MATERIAL = 2, TECH_ENGINEERING = 2)
force = 8
w_class = ITEMSIZE_SMALL
throwforce = 8
throw_speed = 2
throw_range = 3//it's heavier than a screw driver/wrench, so it does more damage, but can't be thrown as far
attack_verb = list("drilled", "screwed", "jabbed", "whacked")
hitsound = 'sound/items/drill_hit.ogg'
usesound = 'sound/items/drill_use.ogg'
toolspeed = 0.25
random_color = FALSE
/obj/item/weapon/screwdriver/power/attack_self(mob/user)
playsound(get_turf(user),'sound/items/change_drill.ogg',50,1)
var/obj/item/weapon/wrench/power/w_drill = new /obj/item/weapon/wrench/power
to_chat(user, "<span class='notice'>You attach the bolt driver bit to [src].</span>")
qdel(src)
user.put_in_active_hand(w_drill)
/*
* Wirecutters
*/
/obj/item/weapon/wirecutters
name = "wirecutters"
desc = "This cuts wires."
icon = 'icons/obj/items.dmi'
icon = 'icons/obj/tools.dmi'
icon_state = "cutters"
flags = CONDUCT
slot_flags = SLOT_BELT
@@ -107,11 +193,15 @@
origin_tech = list(TECH_MATERIAL = 1, TECH_ENGINEERING = 1)
matter = list(DEFAULT_WALL_MATERIAL = 80)
attack_verb = list("pinched", "nipped")
hitsound = 'sound/items/wirecutter.ogg'
usesound = 'sound/items/wirecutter.ogg'
sharp = 1
edge = 1
toolspeed = 1
var/random_color = TRUE
/obj/item/weapon/wirecutters/New()
if(prob(50))
if(random_color && prob(50))
icon_state = "cutters-y"
item_state = "cutters_yellow"
..()
@@ -129,13 +219,48 @@
else
..()
/obj/item/weapon/wirecutters/ayyy
name = "alien wirecutters"
desc = "Extremely sharp wirecutters, made out of a silvery-green metal."
icon = 'icons/obj/abductor.dmi'
icon_state = "cutters"
toolspeed = 0.1
origin_tech = list(TECH_MATERIAL = 5, TECH_ENGINEERING = 4)
random_color = FALSE
/obj/item/weapon/wirecutters/cyborg
name = "wirecutters"
desc = "This cuts wires. With science."
usesound = 'sound/items/jaws_cut.ogg'
toolspeed = 0.5
/obj/item/weapon/wirecutters/power
name = "jaws of life"
desc = "A set of jaws of life, compressed through the magic of science. It's fitted with a cutting head."
icon_state = "jaws_cutter"
item_state = "jawsoflife"
origin_tech = list(TECH_MATERIAL = 2, TECH_ENGINEERING = 2)
matter = list(MAT_METAL=150, MAT_SILVER=50, MAT_TITANIUM=25)
usesound = 'sound/items/jaws_cut.ogg'
force = 15
toolspeed = 0.25
random_color = FALSE
/obj/item/weapon/wirecutters/power/attack_self(mob/user)
playsound(get_turf(user), 'sound/items/change_jaws.ogg', 50, 1)
var/obj/item/weapon/crowbar/power/pryjaws = new /obj/item/weapon/crowbar/power
to_chat(user, "<span class='notice'>You attach the pry jaws to [src].</span>")
qdel(src)
user.put_in_active_hand(pryjaws)
/*
* Welding Tool
*/
/obj/item/weapon/weldingtool
name = "welding tool"
icon = 'icons/obj/items.dmi'
icon = 'icons/obj/tools.dmi'
icon_state = "welder"
item_state = "welder"
flags = CONDUCT
slot_flags = SLOT_BELT
@@ -157,16 +282,30 @@
var/status = 1 //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/acti_sound = 'sound/items/welderactivate.ogg'
var/deac_sound = 'sound/items/welderdeactivate.ogg'
usesound = 'sound/items/Welder2.ogg'
var/change_icons = TRUE
var/flame_intensity = 2 //how powerful the emitted light is when used.
var/flame_color = "#FF9933" // What color the welder light emits when its on. Default is an orange-ish color.
var/eye_safety_modifier = 0 // Increasing this will make less eye protection needed to stop eye damage. IE at 1, sunglasses will fully protect.
var/burned_fuel_for = 0 // Keeps track of how long the welder's been on, used to gradually empty the welder if left one, without RNG.
var/always_process = FALSE // If true, keeps the welder on the process list even if it's off. Used for when it needs to regenerate fuel.
toolspeed = 1
/obj/item/weapon/weldingtool/New()
// var/random_fuel = min(rand(10,20),max_fuel)
var/datum/reagents/R = new/datum/reagents(max_fuel)
reagents = R
R.my_atom = src
R.add_reagent("fuel", max_fuel)
update_icon()
if(always_process)
processing_objects |= src
..()
/obj/item/weapon/weldingtool/Destroy()
if(welding)
if(welding || always_process)
processing_objects -= src
return ..()
@@ -216,9 +355,12 @@
/obj/item/weapon/weldingtool/process()
if(welding)
if(prob(5))
++burned_fuel_for
if(burned_fuel_for >= WELDER_FUEL_BURN_INTERVAL)
remove_fuel(1)
if(get_fuel() < 1)
setWelding(0)
@@ -270,19 +412,25 @@
/obj/item/weapon/weldingtool/proc/get_fuel()
return reagents.get_reagent_amount("fuel")
/obj/item/weapon/weldingtool/proc/get_max_fuel()
return max_fuel
//Removes fuel from the welding tool. If a mob is passed, it will perform an eyecheck on the mob. This should probably be renamed to use()
/obj/item/weapon/weldingtool/proc/remove_fuel(var/amount = 1, var/mob/M = null)
if(!welding)
return 0
if(amount)
burned_fuel_for = 0 // Reset the counter since we're removing fuel.
if(get_fuel() >= amount)
reagents.remove_reagent("fuel", amount)
if(M)
eyecheck(M)
update_icon()
return 1
else
if(M)
M << "<span class='notice'>You need more welding fuel to complete this task.</span>"
update_icon()
return 0
//Returns whether or not the welding tool is currently on.
@@ -291,7 +439,29 @@
/obj/item/weapon/weldingtool/update_icon()
..()
icon_state = welding ? "[icon_state]1" : "[initial(icon_state)]"
overlays.Cut()
// Welding overlay.
if(welding)
var/image/I = image(icon, src, "[icon_state]-on")
overlays.Add(I)
item_state = "[initial(item_state)]1"
else
item_state = initial(item_state)
// Fuel counter overlay.
if(change_icons && get_max_fuel())
var/ratio = get_fuel() / get_max_fuel()
ratio = Ceiling(ratio*4) * 25
var/image/I = image(icon, src, "[icon_state][ratio]")
overlays.Add(I)
// Lights
if(welding && flame_intensity)
set_light(flame_intensity, flame_intensity, flame_color)
else
set_light(0)
// icon_state = welding ? "[icon_state]1" : "[initial(icon_state)]"
var/mob/M = loc
if(istype(M))
M.update_inv_l_hand()
@@ -342,12 +512,15 @@
M << "<span class='notice'>You switch the [src] on.</span>"
else if(T)
T.visible_message("<span class='danger'>\The [src] turns on.</span>")
playsound(loc, acti_sound, 50, 1)
src.force = 15
src.damtype = "fire"
src.w_class = ITEMSIZE_LARGE
src.hitsound = 'sound/items/welder.ogg'
welding = 1
update_icon()
processing_objects |= src
if(!always_process)
processing_objects |= src
else
if(M)
var/msg = max_fuel ? "welding fuel" : "charge"
@@ -355,22 +528,27 @@
return
//Otherwise
else if(!set_welding && welding)
processing_objects -= src
if(!always_process)
processing_objects -= src
if(M)
M << "<span class='notice'>You switch \the [src] off.</span>"
else if(T)
T.visible_message("<span class='warning'>\The [src] turns off.</span>")
playsound(loc, deac_sound, 50, 1)
src.force = 3
src.damtype = "brute"
src.w_class = initial(src.w_class)
src.welding = 0
src.hitsound = initial(src.hitsound)
update_icon()
//Decides whether or not to damage a player's eyes based on what they're wearing as protection
//Note: This should probably be moved to mob
/obj/item/weapon/weldingtool/proc/eyecheck(mob/user as mob)
if(!iscarbon(user)) return 1
var/safety = user:eyecheck()
/obj/item/weapon/weldingtool/proc/eyecheck(mob/living/carbon/user)
if(!istype(user))
return 1
var/safety = user.eyecheck()
safety = between(-1, safety + eye_safety_modifier, 2)
if(istype(user, /mob/living/carbon/human))
var/mob/living/carbon/human/H = user
var/obj/item/organ/internal/eyes/E = H.internal_organs_by_name[O_EYES]
@@ -410,36 +588,71 @@
/obj/item/weapon/weldingtool/largetank
name = "industrial welding tool"
desc = "A slightly larger welder with a larger tank."
icon_state = "indwelder"
max_fuel = 40
origin_tech = list(TECH_ENGINEERING = 2)
origin_tech = list(TECH_ENGINEERING = 2, TECH_PHORON = 2)
matter = list(DEFAULT_WALL_MATERIAL = 70, "glass" = 60)
/obj/item/weapon/weldingtool/largetank/cyborg
name = "integrated welding tool"
desc = "An advanced welder designed to be used in robotic systems."
toolspeed = 0.5
/obj/item/weapon/weldingtool/hugetank
name = "upgraded welding tool"
desc = "A much larger welder with a huge tank."
icon_state = "indwelder"
max_fuel = 80
w_class = ITEMSIZE_NORMAL
origin_tech = list(TECH_ENGINEERING = 3)
matter = list(DEFAULT_WALL_MATERIAL = 70, "glass" = 120)
/obj/item/weapon/weldingtool/mini
name = "emergency welding tool"
desc = "A miniature welder used during emergencies."
icon_state = "miniwelder"
max_fuel = 10
w_class = ITEMSIZE_SMALL
matter = list(MAT_METAL = 30, MAT_GLASS = 10)
change_icons = 0
toolspeed = 2
eye_safety_modifier = 1 // Safer on eyes.
/obj/item/weapon/weldingtool/ayyy
name = "alien welding tool"
desc = "An alien welding tool. Whatever fuel it uses, it never runs out."
icon = 'icons/obj/abductor.dmi'
icon_state = "welder"
toolspeed = 0.1
flame_color = "#6699FF" // Light bluish.
eye_safety_modifier = 2
change_icons = 0
origin_tech = list(TECH_PHORON = 5 ,TECH_ENGINEERING = 5)
always_process = TRUE
/obj/item/weapon/weldingtool/ayyy/process()
if(get_fuel() <= get_max_fuel())
reagents.add_reagent("fuel", 1)
..()
/obj/item/weapon/weldingtool/experimental
name = "experimental welding tool"
desc = "An experimental welder capable of self-fuel generation. It can output a flame hotter than regular welders."
icon_state = "exwelder"
max_fuel = 40
w_class = ITEMSIZE_NORMAL
origin_tech = list(TECH_ENGINEERING = 4, TECH_PHORON = 3)
matter = list(DEFAULT_WALL_MATERIAL = 70, "glass" = 120)
toolspeed = 0.5
change_icons = 0
flame_intensity = 3
always_process = TRUE
var/nextrefueltick = 0
/obj/item/weapon/weldingtool/experimental/New()
processing_objects |= src
..()
/obj/item/weapon/weldingtool/experimental/Destroy()
processing_objects -= src
return ..()
/obj/item/weapon/weldingtool/experimental/process()
..()
if(get_fuel() < max_fuel && nextrefueltick < world.time)
if(get_fuel() < get_max_fuel() && nextrefueltick < world.time)
nextrefueltick = world.time + 10
reagents.add_reagent("fuel", 1)
@@ -449,12 +662,17 @@
/obj/item/weapon/weldingtool/electric //AND HIS WELDING WAS ELECTRIC
name = "electric welding tool"
desc = "A welder which runs off of electricity."
icon_state = "arcwelder"
max_fuel = 0 //We'll handle the consumption later.
item_state = "ewelder"
var/obj/item/weapon/cell/power_supply //What type of power cell this uses
var/charge_cost = 24 //The rough equivalent of 1 unit of fuel, based on us wanting 10 welds per battery
var/cell_type = /obj/item/weapon/cell/device
var/use_external_power = 0 //If in a borg or hardsuit, this needs to = 1
flame_color = "#00CCFF" // Blue-ish, to set it apart from the gas flames.
acti_sound = 'sound/effects/sparks4.ogg'
deac_sound = 'sound/effects/sparks4.ogg'
/obj/item/weapon/weldingtool/electric/New()
..()
@@ -485,6 +703,15 @@
else
return 0
/obj/item/weapon/weldingtool/electric/get_max_fuel()
if(use_external_power)
var/obj/item/weapon/cell/external = get_external_power_supply()
return external.maxcharge
else if(power_supply)
return power_supply.maxcharge
else
return 0
/obj/item/weapon/weldingtool/electric/remove_fuel(var/amount = 1, var/mob/M = null)
if(!welding)
return 0
@@ -496,10 +723,12 @@
power_supply.give(charge_cost) //Give it back to the cell.
if(M)
eyecheck(M)
update_icon()
return 1
else
if(M)
M << "<span class='notice'>You need more energy to complete this task.</span>"
update_icon()
return 0
/obj/item/weapon/weldingtool/electric/attack_hand(mob/user as mob)
@@ -556,7 +785,7 @@
/obj/item/weapon/crowbar
name = "crowbar"
desc = "Used to remove floors and to pry open doors."
icon = 'icons/obj/items.dmi'
icon = 'icons/obj/tools.dmi'
icon_state = "crowbar"
flags = CONDUCT
slot_flags = SLOT_BELT
@@ -568,6 +797,8 @@
origin_tech = list(TECH_ENGINEERING = 1)
matter = list(DEFAULT_WALL_MATERIAL = 50)
attack_verb = list("attacked", "bashed", "battered", "bludgeoned", "whacked")
usesound = 'sound/items/crowbar.ogg'
toolspeed = 1
/obj/item/weapon/crowbar/red
icon = 'icons/obj/items.dmi'
@@ -592,6 +823,40 @@
else
return ..()
/obj/item/weapon/crowbar/ayyy
name = "alien crowbar"
desc = "A hard-light crowbar. It appears to pry by itself, without any effort required."
icon = 'icons/obj/abductor.dmi'
usesound = 'sound/weapons/sonic_jackhammer.ogg'
icon_state = "crowbar"
toolspeed = 0.1
origin_tech = list(TECH_COMBAT = 4, TECH_ENGINEERING = 4)
/obj/item/weapon/crowbar/cyborg
name = "hydraulic crowbar"
desc = "A hydraulic prying tool, compact but powerful. Designed to replace crowbars in industrial synthetics."
usesound = 'sound/items/jaws_pry.ogg'
force = 10
toolspeed = 0.5
/obj/item/weapon/crowbar/power
name = "jaws of life"
desc = "A set of jaws of life, compressed through the magic of science. It's fitted with a prying head."
icon_state = "jaws_pry"
item_state = "jawsoflife"
matter = list(MAT_METAL=150, MAT_SILVER=50, MAT_TITANIUM=25)
origin_tech = list(TECH_MATERIALS = 2, TECH_ENGINEERING = 2)
usesound = 'sound/items/jaws_pry.ogg'
force = 15
toolspeed = 0.25
/obj/item/weapon/crowbar/power/attack_self(mob/user)
playsound(get_turf(user), 'sound/items/change_jaws.ogg', 50, 1)
var/obj/item/weapon/wirecutters/power/cutjaws = new /obj/item/weapon/wirecutters/power
to_chat(user, "<span class='notice'>You attach the cutting jaws to [src].</span>")
qdel(src)
user.put_in_active_hand(cutjaws)
/*/obj/item/weapon/combitool
name = "combi-tool"
desc = "It even has one of those nubbins for doing the thingy."
@@ -649,3 +914,5 @@
tool.afterattack(target,user,1)
if(tool)
tool.loc = src*/
#undef WELDER_FUEL_BURN_INTERVAL