[Testmerge ready] Ports tool behaviours; refactors all tools; adds functionality for self-filling reagent containers (#11700)

* Adds support for self-filling reagent containers

* Sets tool_behaviour on the default set of tools

* Fixing merge conflicts

* Refactors welder to use tool behaviour

* The refactor: part I

* The refactor: part II

* Tool Refactor Part III: Revenge of the Maint

* Tool Refactor Part IV: A New Hope

* Tool Refactor Part V: The Oldcoder Strikes Back

* Tool Refactor Part VI: Return of the Coder

* VII

* Holy shit, it compiles?!

* Nannek I completed your TODO, you owe me ice cream

* Tool helpers; telepad is compliant

* Bugtest, Round 1: Fight

Fuck refactoring disposals

* Buggfixing, Round 2: Electric Boogaloo

* Personal crafting uses tool behaviours now

* Construction datums use new tool behaviours; better way of handling fueltank refuelling; more bugfixing

* multitool_check_buffer change; removes some useless things in tool_helpers

* proc name change

* TRUE/FALSE changes

* Bugfixing, Round 3: A Good Day To Bugfix Hard

Fixes multiple issues raised by the testmerge

* Minor style changes
This commit is contained in:
Citinited
2020-02-15 13:31:08 -07:00
committed by GitHub
parent 5b1941e784
commit fddff1049b
238 changed files with 6681 additions and 5544 deletions
+6 -19
View File
@@ -32,28 +32,15 @@
/obj/item/candle/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = W
if(WT.isOn()) //Badasses dont get blinded by lighting their candle with a welding tool
light("<span class='notice'>[user] casually lights [src] with [WT], what a badass.")
return
if(istype(W, /obj/item/lighter))
var/obj/item/lighter/L = W
if(L.lit)
light("<span class='notice'>After some fiddling, [user] manages to light [src] with [L].</span>")
return
if(istype(W, /obj/item/match))
var/obj/item/match/M = W
if(M.lit)
light("<span class='notice'>[user] lights [src] with [M]</span>")
return
if(istype(W, /obj/item/candle))
var/obj/item/candle/C = W
if(C.lit)
light("<span class='notice'>[user] tilts [C] and lights [src] with it.</span>")
if(is_hot(W))
light("<span class='notice'>[user] lights [src] with [W].</span>")
return
return ..()
/obj/item/candle/welder_act(mob/user, obj/item/I)
. = TRUE
if(I.tool_use_check(user, 0)) //Don't need to flash eyes because you are a badass
light("<span class='notice'>[user] casually lights the [name] with [I], what a badass.</span>")
/obj/item/candle/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
if(!lit)
@@ -167,7 +167,7 @@
reqs = list(/obj/item/stack/sheet/wood = 5,
/obj/item/stack/cable_coil = 6,
/obj/item/stack/tape_roll = 5)
tools = list(/obj/item/screwdriver, /obj/item/wirecutters)
tools = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
time = 80
category = CAT_MISC
@@ -177,7 +177,7 @@
reqs = list(/obj/item/stack/sheet/wood = 5,
/obj/item/stack/cable_coil = 6,
/obj/item/stack/tape_roll = 5)
tools = list(/obj/item/screwdriver, /obj/item/wirecutters)
tools = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
time = 80
category = CAT_MISC
@@ -187,6 +187,6 @@
reqs = list(/obj/item/stack/sheet/metal = 5,
/obj/item/stack/cable_coil = 6,
/obj/item/stack/tape_roll = 5)
tools = list(/obj/item/screwdriver, /obj/item/wirecutters)
tools = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
time = 80
category = CAT_MISC
+18 -18
View File
@@ -63,27 +63,27 @@
update_icon()
set_light(0)
/obj/item/powersink/attackby(obj/item/I, mob/user)
if(isscrewdriver(I))
if(mode == DISCONNECTED)
var/turf/T = loc
if(isturf(T) && !T.intact)
attached = locate() in T
if(!attached)
to_chat(user, "No exposed cable here to attach to.")
return
else
set_mode(CLAMPED_OFF)
visible_message("<span class='notice'>[user] attaches [src] to the cable!</span>")
message_admins("Power sink activated by [key_name_admin(user)] at ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)")
log_game("Power sink activated by [key_name(user)] at ([x],[y],[z])")
/obj/item/powersink/screwdriver_act(mob/user, obj/item/I)
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
if(mode == DISCONNECTED)
var/turf/T = loc
if(isturf(T) && !T.intact)
attached = locate() in T
if(!attached)
to_chat(user, "No exposed cable here to attach to.")
return
else
to_chat(user, "Device must be placed over an exposed cable to attach to it.")
set_mode(CLAMPED_OFF)
visible_message("<span class='notice'>[user] attaches [src] to the cable!</span>")
message_admins("Power sink activated by [key_name_admin(user)] at ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)")
log_game("Power sink activated by [key_name(user)] at ([x],[y],[z])")
else
set_mode(DISCONNECTED)
src.visible_message("<span class='notice'>[user] detaches [src] from the cable!</span>")
to_chat(user, "Device must be placed over an exposed cable to attach to it.")
else
return ..()
set_mode(DISCONNECTED)
src.visible_message("<span class='notice'>[user] detaches [src] from the cable!</span>")
/obj/item/powersink/attack_ai()
return
@@ -311,34 +311,8 @@
return ..()
/obj/item/radio/headset/attackby(obj/item/W as obj, mob/user as mob)
user.set_machine(src)
if(!( istype(W, /obj/item/screwdriver) || (istype(W, /obj/item/encryptionkey/ ))))
return ..()
if(istype(W, /obj/item/screwdriver))
if(keyslot1 || keyslot2)
for(var/ch_name in channels)
SSradio.remove_object(src, SSradio.radiochannels[ch_name])
secure_radio_connections[ch_name] = null
if(keyslot1)
var/turf/T = get_turf(user)
if(T)
keyslot1.loc = T
keyslot1 = null
if(keyslot2)
var/turf/T = get_turf(user)
if(T)
keyslot2.loc = T
keyslot2 = null
recalculateChannels()
to_chat(user, "You pop out the encryption keys in the headset!")
else
to_chat(user, "This headset doesn't have any encryption keys! How useless...")
if(istype(W, /obj/item/encryptionkey/))
user.set_machine(src)
if(keyslot1 && keyslot2)
to_chat(user, "The headset can't hold another key!")
return
@@ -351,10 +325,37 @@
user.drop_item()
W.loc = src
keyslot2 = W
recalculateChannels()
else
return ..()
/obj/item/radio/headset/screwdriver_act(mob/user, obj/item/I)
. = TRUE
if(!I.use_tool(src, user, 0, volume = 0))
return
user.set_machine(src)
if(keyslot1 || keyslot2)
for(var/ch_name in channels)
SSradio.remove_object(src, SSradio.radiochannels[ch_name])
secure_radio_connections[ch_name] = null
if(keyslot1)
var/turf/T = get_turf(user)
if(T)
keyslot1.loc = T
keyslot1 = null
if(keyslot2)
var/turf/T = get_turf(user)
if(T)
keyslot2.loc = T
keyslot2 = null
recalculateChannels()
return
to_chat(user, "You pop out the encryption keys in the headset!")
I.play_tool_sound(user, I.tool_volume)
else
to_chat(user, "This headset doesn't have any encryption keys! How useless...")
/obj/item/radio/headset/proc/recalculateChannels(var/setDescription = FALSE)
channels = list()
@@ -138,76 +138,82 @@
/obj/item/radio/intercom/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/stack/tape_roll)) //eww
return
switch(buildstage)
if(3)
if(iswirecutter(W) && b_stat && wires.IsAllCut())
to_chat(user, "<span class='notice'>You cut out the intercoms wiring and disconnect its electronics.</span>")
playsound(get_turf(src), W.usesound, 50, 1)
if(do_after(user, 10 * W.toolspeed, target = src))
if(buildstage != 3)
return
new /obj/item/stack/cable_coil(get_turf(src),5)
on = 0
b_stat = 1
buildstage = 1
update_icon()
STOP_PROCESSING(SSobj, src)
return 1
else return ..()
if(2)
if(isscrewdriver(W))
playsound(get_turf(src), W.usesound, 50, 1)
if(do_after(user, 10 * W.toolspeed, target = src))
update_icon()
on = 1
b_stat = 0
buildstage = 3
to_chat(user, "<span class='notice'>You secure the electronics!</span>")
update_icon()
START_PROCESSING(SSobj, src)
for(var/i, i<= 5, i++)
wires.UpdateCut(i,1)
return 1
if(1)
if(iscoil(W))
var/obj/item/stack/cable_coil/coil = W
if(coil.amount < 5)
to_chat(user, "<span class='warning'>You need more cable for this!</span>")
return
if(do_after(user, 10 * coil.toolspeed, target = src))
coil.use(5)
to_chat(user, "<span class='notice'>You wire \the [src]!</span>")
buildstage = 2
return 1
if(iscrowbar(W))
to_chat(user, "<span class='notice'>You begin removing the electronics...</span>")
playsound(get_turf(src), W.usesound, 50, 1)
if(do_after(user, 10 * W.toolspeed, target = src))
if(buildstage != 1)
return
new /obj/item/intercom_electronics(get_turf(src))
to_chat(user, "<span class='notice'>The circuitboard pops out!</span>")
buildstage = 0
return 1
if(0)
if(istype(W,/obj/item/intercom_electronics))
playsound(get_turf(src), W.usesound, 50, 1)
if(do_after(user, 10 * W.toolspeed, target = src))
qdel(W)
to_chat(user, "<span class='notice'>You insert \the [W] into \the [src]!</span>")
buildstage = 1
return 1
if(iswelder(W))
var/obj/item/weldingtool/WT=W
playsound(get_turf(src), WT.usesound, 50, 1)
if(!WT.remove_fuel(3, user))
to_chat(user, "<span class='warning'>You're out of welding fuel.</span>")
return 1
if(do_after(user, 10 * WT.toolspeed, target = src))
to_chat(user, "<span class='notice'>You cut the intercom frame from the wall!</span>")
new /obj/item/mounted/frame/intercom(get_turf(src))
qdel(src)
return 1
else if(iscoil(W) && buildstage == 1)
var/obj/item/stack/cable_coil/coil = W
if(coil.amount < 5)
to_chat(user, "<span class='warning'>You need more cable for this!</span>")
return
if(do_after(user, 10 * coil.toolspeed, target = src) && buildstage == 1)
coil.use(5)
to_chat(user, "<span class='notice'>You wire \the [src]!</span>")
buildstage = 2
return 1
else if(istype(W,/obj/item/intercom_electronics) && buildstage == 0)
playsound(get_turf(src), W.usesound, 50, 1)
if(do_after(user, 10 * W.toolspeed, target = src) && buildstage == 0)
qdel(W)
to_chat(user, "<span class='notice'>You insert \the [W] into \the [src]!</span>")
buildstage = 1
return 1
else
return ..()
/obj/item/radio/intercom/crowbar_act(mob/user, obj/item/I)
if(buildstage != 1)
return
. = TRUE
if(!I.tool_use_check(user, 0))
return
to_chat(user, "<span class='notice'>You begin removing the electronics...</span>")
if(!I.use_tool(src, user, 10, volume = I.tool_volume) || buildstage != 1)
return
new /obj/item/intercom_electronics(get_turf(src))
to_chat(user, "<span class='notice'>The circuit board pops out!</span>")
buildstage = 0
/obj/item/radio/intercom/screwdriver_act(mob/user, obj/item/I)
if(buildstage != 2)
return ..()
. = TRUE
if(!I.tool_use_check(user, 0))
return
if(!I.use_tool(src, user, 10, volume = I.tool_volume) || buildstage != 2)
return
update_icon()
on = 1
b_stat = 0
buildstage = 3
to_chat(user, "<span class='notice'>You secure the electronics!</span>")
update_icon()
START_PROCESSING(SSobj, src)
for(var/i, i<= 5, i++)
wires.UpdateCut(i,1)
/obj/item/radio/intercom/wirecutter_act(mob/user, obj/item/I)
if(!(buildstage == 3 && b_stat && wires.IsAllCut()))
return
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
WIRECUTTER_SNIP_MESSAGE
new /obj/item/stack/cable_coil(get_turf(src),5)
on = 0
b_stat = 1
buildstage = 1
update_icon()
STOP_PROCESSING(SSobj, src)
/obj/item/radio/intercom/welder_act(mob/user, obj/item/I)
if(!buildstage)
return
. = TRUE
if(!I.tool_use_check(user, 3))
return
to_chat(user, "<span class='notice'>You start slicing [src] from the wall...</span>")
if(I.use_tool(src, user, 10, amount = 3, volume = I.tool_volume))
to_chat(user, "<span class='notice'>You cut [src] free from the wall!</span>")
new /obj/item/mounted/frame/intercom(get_turf(src))
qdel(src)
/obj/item/radio/intercom/update_icon()
if(!circuitry_installed)
+42 -35
View File
@@ -603,22 +603,30 @@ var/global/list/default_medbay_channels = list(
else
. += "<span class='notice'>\the [src] can not be modified or attached!</span>"
/obj/item/radio/attackby(obj/item/W as obj, mob/user as mob, params)
..()
user.set_machine(src)
if(!( istype(W, /obj/item/screwdriver) ))
/obj/item/radio/screwdriver_act(mob/user, obj/item/I)
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
b_stat = !( b_stat )
user.set_machine(src)
b_stat = !b_stat
if(!istype(src, /obj/item/radio/beacon))
if(b_stat)
user.show_message("<span class='notice'>The radio can now be attached and modified!</span>")
else
user.show_message("<span class='notice'>The radio can no longer be modified or attached!</span>")
updateDialog()
//Foreach goto(83)
add_fingerprint(user)
/obj/item/radio/wirecutter_act(mob/user, obj/item/I)
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
else return
interact(user)
/obj/item/radio/multitool_act(mob/user, obj/item/I)
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
interact(user)
/obj/item/radio/emp_act(severity)
on = 0
@@ -689,33 +697,8 @@ var/global/list/default_medbay_channels = list(
set_frequency(ERT_FREQ)
/obj/item/radio/borg/attackby(obj/item/W as obj, mob/user as mob, params)
// ..()
user.set_machine(src)
if(!( istype(W, /obj/item/screwdriver) || (istype(W, /obj/item/encryptionkey/ ))))
return
if(istype(W, /obj/item/screwdriver))
if(keyslot)
for(var/ch_name in channels)
SSradio.remove_object(src, SSradio.radiochannels[ch_name])
secure_radio_connections[ch_name] = null
if(keyslot)
var/turf/T = get_turf(user)
if(T)
keyslot.loc = T
keyslot = null
recalculateChannels()
to_chat(user, "You pop out the encryption key in the radio!")
else
to_chat(user, "This radio doesn't have any encryption keys!")
if(istype(W, /obj/item/encryptionkey/))
user.set_machine(src)
if(keyslot)
to_chat(user, "The radio can't hold another key!")
return
@@ -726,8 +709,32 @@ var/global/list/default_medbay_channels = list(
keyslot = W
recalculateChannels()
else
return ..()
return
/obj/item/radio/borg/screwdriver_act(mob/user, obj/item/I)
. = TRUE
if(!I.use_tool(src, user, 0, volume = 0))
return
user.set_machine(src)
if(keyslot)
for(var/ch_name in channels)
SSradio.remove_object(src, SSradio.radiochannels[ch_name])
secure_radio_connections[ch_name] = null
if(keyslot)
var/turf/T = get_turf(user)
if(T)
keyslot.loc = T
keyslot = null
recalculateChannels()
to_chat(user, "You pop out the encryption key in the radio!")
I.play_tool_sound(user, I.tool_volume)
else
to_chat(user, "This radio doesn't have any encryption keys!")
/obj/item/radio/borg/proc/recalculateChannels()
channels = list()
+14 -11
View File
@@ -245,22 +245,25 @@
message_admins("[key_name_admin(user)] has hidden [I] in the [src] ready for detonation at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[bombturf.x];Y=[bombturf.y];Z=[bombturf.z]'>[A.name] (JMP)</a>.")
log_game("[key_name(user)] has hidden [I] in the [src] ready for detonation at [A.name] ([bombturf.x],[bombturf.y],[bombturf.z]).")
investigate_log("[key_name(user)] has hidden [I] in the [src] ready for detonation at [A.name] ([bombturf.x],[bombturf.y],[bombturf.z]).", INVESTIGATE_BOMB)
else if(isscrewdriver(I) && boobytrap && user == trapper)
to_chat(user, "<span class='notice'>You remove [boobytrap] from the [src].</span>")
boobytrap.forceMove(get_turf(src))
boobytrap = null
trapper = null
else
return ..()
/obj/item/flag/chameleon/attackby(obj/item/W, mob/user, params)
if(is_hot(W) && !(resistance_flags & ON_FIRE) && boobytrap && trapper)
else if(is_hot(I) && !(resistance_flags & ON_FIRE) && boobytrap && trapper)
var/turf/bombturf = get_turf(src)
var/area/A = get_area(bombturf)
message_admins("[key_name_admin(user)] has lit the [src] trapped with [boobytrap] by [key_name_admin(trapper)] at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[bombturf.x];Y=[bombturf.y];Z=[bombturf.z]'>[A.name] (JMP)</a>.")
log_game("[key_name_admin(user)] has lit the [src] trapped with [boobytrap] by [key_name_admin(trapper)] at [A.name] ([bombturf.x],[bombturf.y],[bombturf.z]).")
investigate_log("[key_name_admin(user)] has lit the [src] trapped with [boobytrap] by [key_name_admin(trapper)] at [A.name] ([bombturf.x],[bombturf.y],[bombturf.z]).", INVESTIGATE_BOMB)
return ..()
else
return ..()
/obj/item/flag/chameleon/screwdriver_act(mob/user, obj/item/I)
if(!boobytrap || user != trapper)
return
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
to_chat(user, "<span class='notice'>You remove [boobytrap] from [src].</span>")
boobytrap.forceMove(get_turf(src))
boobytrap = null
trapper = null
/obj/item/flag/chameleon/burn()
if(boobytrap)
+6 -9
View File
@@ -31,15 +31,12 @@
// the stake now, we have to push the target.
/obj/item/target/attackby(obj/item/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = W
if(WT.remove_fuel(0, user))
overlays.Cut()
to_chat(usr, "You slice off [src]'s uneven chunks of aluminum and scorch marks.")
return
/obj/item/target/welder_act(mob/user, obj/item/I)
. = TRUE
if(!use_tool(src, user, 0,, volume = I.tool_volume))
return
overlays.Cut()
to_chat(usr, "You slice off [src]'s uneven chunks of aluminum and scorch marks.")
/obj/item/target/attack_hand(mob/user as mob)
// taking pinned targets off!
+19 -25
View File
@@ -46,29 +46,23 @@ var/global/list/datum/stack_recipe/rod_recipes = list ( \
else
icon_state = "rods"
/obj/item/stack/rods/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = W
if(get_amount() < 2)
to_chat(user, "<span class='warning'>You need at least two rods to do this!</span>")
return
if(WT.remove_fuel(0,user))
var/obj/item/stack/sheet/metal/new_item = new(user.loc)
if(new_item.get_amount() <= 0)
// stack was moved into another one on the pile
new_item = locate() in user.loc
user.visible_message("[user.name] shape [src] into metal with the welding tool.", \
"<span class='notice'>You shape [src] into metal with the welding tool.</span>", \
"<span class='italics'>You hear welding.</span>")
var/replace = user.is_in_inactive_hand(src)
use(2)
if(get_amount() <= 0 && replace)
user.unEquip(src, 1)
if(new_item)
user.put_in_hands(new_item)
/obj/item/stack/rods/welder_act(mob/user, obj/item/I)
if(get_amount() < 2)
to_chat(user, "<span class='warning'>You need at least two rods to do this!</span>")
return
..()
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
var/obj/item/stack/sheet/metal/new_item = new(drop_location())
if(new_item.get_amount() <= 0)
// stack was moved into another one on the pile
new_item = locate() in user.loc
visible_message("<span class='notice'>[user.name] shapes [src] into metal with [I]!</span>", \
"<span class='notice'>You shape [src] into metal with [I]!</span>", \
"<span class='warning'>You hear welding.</span>")
var/replace = user.is_in_inactive_hand(src)
use(2)
if(get_amount() <= 0 && replace)
user.unEquip(src, 1)
if(new_item)
user.put_in_hands(new_item)
@@ -216,14 +216,12 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \
..()
recipes = plasma_recipes
/obj/item/stack/sheet/mineral/plasma/attackby(obj/item/W, mob/user, params)
if(is_hot(W) > 300)//If the temperature of the object is over 300, then ignite
/obj/item/stack/sheet/mineral/plasma/welder_act(mob/user, obj/item/I)
if(I.use_tool(src, user, volume = I.tool_volume))
message_admins("Plasma sheets ignited by [key_name_admin(user)]([ADMIN_QUE(user,"?")]) ([ADMIN_FLW(user,"FLW")]) in ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
log_game("Plasma sheets ignited by [key_name(user)] in ([x],[y],[z])")
investigate_log("was <font color='red'><b>ignited</b></font> by [key_name(user)]","atmos")
fire_act()
else
return ..()
/obj/item/stack/sheet/mineral/plasma/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()
+1 -1
View File
@@ -222,7 +222,7 @@
interact(usr)
return
/obj/item/stack/proc/use(used, check = TRUE)
/obj/item/stack/use(used, check = TRUE)
if(check && zero_amount())
return FALSE
if(amount < used)
@@ -8,6 +8,16 @@
mineralType = "plasma"
materials = list(MAT_PLASMA=500)
/obj/item/stack/tile/mineral/plasma/welder_act(mob/user, obj/item/I)
if(I.use_tool(src, user, volume = I.tool_volume))
atmos_spawn_air(SPAWN_HEAT | SPAWN_TOXINS, 5)
user.visible_message("<span class='warning'>[user.name] sets the plasma tiles on fire!</span>", \
"<span class='warning'>You set the plasma tiles on fire!</span>")
message_admins("Plasma tiles ignited by [key_name_admin(user)](<A HREF='?_src_=holder;adminmoreinfo=\ref[user]'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[user]'>FLW</A>) in ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
log_game("Plasma tiles ignited by [key_name(user)] in ([x],[y],[z])")
investigate_log("was <font color='red'><b>ignited</b></font> by [key_name(user)]","atmos")
qdel(src)
/obj/item/stack/tile/mineral/uranium
name = "uranium tile"
singular_name = "uranium floor tile"
@@ -21,56 +21,38 @@
pixel_x = rand(-3, 3)
pixel_y = rand(-3, 3) //randomize a little
/obj/item/stack/tile/attackby(obj/item/W, mob/user, params)
if(iswelder(W))
var/obj/item/weldingtool/WT = W
/obj/item/stack/tile/welder_act(mob/user, obj/item/I)
if(get_amount() < 4)
to_chat(user, "<span class='warning'>You need at least four tiles to do this!</span>")
return
. = TRUE
if(!I.use_tool(src, user, volume = I.tool_volume))
to_chat(user, "<span class='warning'>You can not reform this!</span>")
return
if (mineralType == "metal")
var/obj/item/stack/sheet/metal/new_item = new(user.loc)
user.visible_message("[user.name] shaped [src] into metal with the welding tool.", \
"<span class='notice'>You shaped [src] into metal with the welding tool.</span>", \
"<span class='italics'>You hear welding.</span>")
var/obj/item/stack/rods/R = src
src = null
var/replace = (user.get_inactive_hand()==R)
R.use(4)
if(!R && replace)
user.put_in_hands(new_item)
if(is_hot(W) && !mineralType)
to_chat(user, "<span class='warning'>You can not reform this!</span>")
return
if(get_amount() < 4)
to_chat(user, "<span class='warning'>You need at least four tiles to do this!</span>")
return
if(WT.remove_fuel(0,user))
if(mineralType == "plasma")
atmos_spawn_air(SPAWN_HEAT | SPAWN_TOXINS, 5)
user.visible_message("<span class='warning'>[user.name] sets the plasma tiles on fire!</span>", \
"<span class='warning'>You set the plasma tiles on fire!</span>")
message_admins("Plasma tiles ignited by [key_name_admin(user)](<A HREF='?_src_=holder;adminmoreinfo=\ref[user]'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[user]'>FLW</A>) in ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
log_game("Plasma tiles ignited by [key_name(user)] in ([x],[y],[z])")
investigate_log("was <font color='red'><b>ignited</b></font> by [key_name(user)]","atmos")
qdel(src)
return
if (mineralType == "metal")
var/obj/item/stack/sheet/metal/new_item = new(user.loc)
user.visible_message("[user.name] shaped [src] into metal with the welding tool.", \
"<span class='notice'>You shaped [src] into metal with the welding tool.</span>", \
"<span class='italics'>You hear welding.</span>")
var/obj/item/stack/rods/R = src
src = null
var/replace = (user.get_inactive_hand()==R)
R.use(4)
if(!R && replace)
user.put_in_hands(new_item)
else
var/sheet_type = text2path("/obj/item/stack/sheet/mineral/[mineralType]")
var/obj/item/stack/sheet/mineral/new_item = new sheet_type(user.loc)
user.visible_message("[user.name] shaped [src] into a sheet with the welding tool.", \
"<span class='notice'>You shaped [src] into a sheet with the welding tool.</span>", \
"<span class='italics'>You hear welding.</span>")
var/obj/item/stack/rods/R = src
src = null
var/replace = (user.get_inactive_hand()==R)
R.use(4)
if (!R && replace)
user.put_in_hands(new_item)
else
return ..()
var/sheet_type = text2path("/obj/item/stack/sheet/mineral/[mineralType]")
var/obj/item/stack/sheet/mineral/new_item = new sheet_type(user.loc)
user.visible_message("[user.name] shaped [src] into a sheet with the welding tool.", \
"<span class='notice'>You shaped [src] into a sheet with the welding tool.</span>", \
"<span class='italics'>You hear welding.</span>")
var/obj/item/stack/rods/R = src
src = null
var/replace = (user.get_inactive_hand()==R)
R.use(4)
if (!R && replace)
user.put_in_hands(new_item)
//Grass
/obj/item/stack/tile/grass
+85
View File
@@ -0,0 +1,85 @@
/obj/item/crowbar
name = "pocket crowbar"
desc = "A small crowbar. This handy tool is useful for lots of things, such as prying floor tiles or opening unpowered doors."
icon = 'icons/obj/tools.dmi'
icon_state = "crowbar"
item_state = "crowbar"
usesound = 'sound/items/crowbar.ogg'
flags = CONDUCT
slot_flags = SLOT_BELT
force = 5
throwforce = 7
item_state = "crowbar"
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=50)
origin_tech = "engineering=1;combat=1"
attack_verb = list("attacked", "bashed", "battered", "bludgeoned", "whacked")
toolspeed = 1
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 30)
tool_behaviour = TOOL_CROWBAR
/obj/item/crowbar/red
icon_state = "crowbar_red"
item_state = "crowbar_red"
force = 8
/obj/item/crowbar/brass
name = "brass crowbar"
desc = "A brass crowbar. It feels faintly warm to the touch."
icon_state = "crowbar_brass"
item_state = "crowbar_brass"
toolspeed = 0.5
resistance_flags = FIRE_PROOF | ACID_PROOF
/obj/item/crowbar/abductor
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 = "combat=4;engineering=4;abductor=3"
/obj/item/crowbar/large
name = "crowbar"
desc = "It's a big crowbar. It doesn't fit in your pockets, because its too big."
force = 12
w_class = WEIGHT_CLASS_NORMAL
throw_speed = 3
throw_range = 3
materials = list(MAT_METAL=70)
icon_state = "crowbar_large"
item_state = "crowbar_large"
toolspeed = 0.5
/obj/item/crowbar/cyborg
name = "hydraulic crowbar"
desc = "A hydraulic prying tool, compact but powerful. Designed to replace crowbar in construction cyborgs."
usesound = 'sound/items/jaws_pry.ogg'
force = 10
toolspeed = 0.5
/obj/item/crowbar/power
name = "jaws of life"
desc = "A set of jaws of life, the magic of science has managed to fit it down into a device small enough to fit in a tool belt. It's fitted with a prying head."
icon_state = "jaws_pry"
item_state = "jawsoflife"
materials = list(MAT_METAL=150,MAT_SILVER=50,MAT_TITANIUM=25)
origin_tech = "materials=2;engineering=2"
usesound = 'sound/items/jaws_pry.ogg'
force = 15
toolspeed = 0.25
var/airlock_open_time = 100 // Time required to open powered airlocks
/obj/item/crowbar/power/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is putting [user.p_their()] head in [src]. It looks like [user.p_theyre()] trying to commit suicide!</span>")
playsound(loc, 'sound/items/jaws_pry.ogg', 50, 1, -1)
return BRUTELOSS
/obj/item/crowbar/power/attack_self(mob/user)
playsound(get_turf(user), 'sound/items/change_jaws.ogg', 50, 1)
var/obj/item/wirecutters/power/cutjaws = new /obj/item/wirecutters/power
to_chat(user, "<span class='notice'>You attach the cutting jaws to [src].</span>")
qdel(src)
user.put_in_active_hand(cutjaws)
@@ -1,111 +1,121 @@
#define PROXIMITY_NONE ""
#define PROXIMITY_ON_SCREEN "_red"
#define PROXIMITY_NEAR "_yellow"
/**
* Multitool -- A multitool is used for hacking electronic devices.
* TO-DO -- Using it as a power measurement tool for cables etc. Nannek.
*
*/
/obj/item/multitool
name = "multitool"
desc = "Used for pulsing wires to test which to cut. Not recommended by doctors."
icon = 'icons/obj/device.dmi'
icon_state = "multitool"
flags = CONDUCT
force = 5.0
w_class = WEIGHT_CLASS_SMALL
throwforce = 0
throw_range = 7
throw_speed = 3
materials = list(MAT_METAL=50, MAT_GLASS=20)
origin_tech = "magnets=1;engineering=2"
toolspeed = 1
hitsound = 'sound/weapons/tap.ogg'
var/shows_wire_information = FALSE // shows what a wire does if set to TRUE
var/obj/machinery/buffer // simple machine buffer for device linkage
/obj/item/multitool/proc/IsBufferA(var/typepath)
if(!buffer)
return 0
return istype(buffer,typepath)
// Syndicate device disguised as a multitool; it will turn red when an AI camera is nearby.
/obj/item/multitool/Destroy()
buffer = null
return ..()
/obj/item/multitool/ai_detect
var/track_cooldown = 0
var/track_delay = 10 //How often it checks for proximity
var/detect_state = PROXIMITY_NONE
var/rangealert = 8 //Glows red when inside
var/rangewarning = 20 //Glows yellow when inside
origin_tech = "magnets=1;engineering=2;syndicate=1"
/obj/item/multitool/ai_detect/New()
..()
START_PROCESSING(SSobj, src)
/obj/item/multitool/ai_detect/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/multitool/ai_detect/process()
if(track_cooldown > world.time)
return
detect_state = PROXIMITY_NONE
multitool_detect()
icon_state = "[initial(icon_state)][detect_state]"
track_cooldown = world.time + track_delay
/obj/item/multitool/ai_detect/proc/multitool_detect()
var/turf/our_turf = get_turf(src)
for(var/mob/living/silicon/ai/AI in ai_list)
if(AI.cameraFollow == src)
detect_state = PROXIMITY_ON_SCREEN
break
if(!detect_state && cameranet.chunkGenerated(our_turf.x, our_turf.y, our_turf.z))
var/datum/camerachunk/chunk = cameranet.getCameraChunk(our_turf.x, our_turf.y, our_turf.z)
if(chunk)
if(chunk.seenby.len)
for(var/mob/camera/aiEye/A in chunk.seenby)
var/turf/detect_turf = get_turf(A)
if(get_dist(our_turf, detect_turf) < rangealert)
detect_state = PROXIMITY_ON_SCREEN
break
if(get_dist(our_turf, detect_turf) < rangewarning)
detect_state = PROXIMITY_NEAR
break
/obj/item/multitool/ai_detect/admin
desc = "Used for pulsing wires to test which to cut. Not recommended by doctors. Has a strange tag that says 'Grief in Safety'" //What else should I say for a meme item?
track_delay = 5
shows_wire_information = TRUE
/obj/item/multitool/ai_detect/admin/multitool_detect()
var/turf/our_turf = get_turf(src)
for(var/mob/J in urange(rangewarning,our_turf))
if(check_rights(R_ADMIN, 0, J))
detect_state = PROXIMITY_NEAR
var/turf/detect_turf = get_turf(J)
if(get_dist(our_turf, detect_turf) < rangealert)
detect_state = PROXIMITY_ON_SCREEN
break
/obj/item/multitool/cyborg
name = "multitool"
desc = "Optimised and stripped-down version of a regular multitool."
toolspeed = 0.5
/obj/item/multitool/abductor
name = "alien multitool"
desc = "An omni-technological interface."
icon = 'icons/obj/abductor.dmi'
icon_state = "multitool"
toolspeed = 0.1
origin_tech = "magnets=5;engineering=5;abductor=3"
shows_wire_information = TRUE
#define PROXIMITY_NONE ""
#define PROXIMITY_ON_SCREEN "_red"
#define PROXIMITY_NEAR "_yellow"
/**
* Multitool -- A multitool is used for hacking electronic devices.
*/
/obj/item/multitool
name = "multitool"
desc = "Used for pulsing wires to test which to cut. Not recommended by doctors."
icon = 'icons/obj/device.dmi'
icon_state = "multitool"
flags = CONDUCT
force = 5.0
w_class = WEIGHT_CLASS_SMALL
throwforce = 0
throw_range = 7
throw_speed = 3
materials = list(MAT_METAL=50, MAT_GLASS=20)
origin_tech = "magnets=1;engineering=2"
toolspeed = 1
tool_behaviour = TOOL_MULTITOOL
hitsound = 'sound/weapons/tap.ogg'
var/shows_wire_information = FALSE // shows what a wire does if set to TRUE
var/obj/machinery/buffer // simple machine buffer for device linkage
/obj/item/multitool/proc/IsBufferA(var/typepath)
if(!buffer)
return 0
return istype(buffer,typepath)
/obj/item/multitool/multitool_check_buffer(user, silent = FALSE)
return TRUE
/obj/item/multitool/proc/set_multitool_buffer(mob/user, obj/machinery/M) //Loads a machine into memory, returns TRUE if it does
if(!ismachinery(M))
to_chat(user, "<span class='warning'>That's not a machine!</span>")
return
buffer = M
to_chat(user, "<span class='notice'>You load [M] into [src]'s internal buffer.</span>")
return TRUE
// Syndicate device disguised as a multitool; it will turn red when an AI camera is nearby.
/obj/item/multitool/Destroy()
buffer = null
return ..()
/obj/item/multitool/ai_detect
var/track_cooldown = 0
var/track_delay = 10 //How often it checks for proximity
var/detect_state = PROXIMITY_NONE
var/rangealert = 8 //Glows red when inside
var/rangewarning = 20 //Glows yellow when inside
origin_tech = "magnets=1;engineering=2;syndicate=1"
/obj/item/multitool/ai_detect/New()
..()
START_PROCESSING(SSobj, src)
/obj/item/multitool/ai_detect/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/multitool/ai_detect/process()
if(track_cooldown > world.time)
return
detect_state = PROXIMITY_NONE
multitool_detect()
icon_state = "[initial(icon_state)][detect_state]"
track_cooldown = world.time + track_delay
/obj/item/multitool/ai_detect/proc/multitool_detect()
var/turf/our_turf = get_turf(src)
for(var/mob/living/silicon/ai/AI in ai_list)
if(AI.cameraFollow == src)
detect_state = PROXIMITY_ON_SCREEN
break
if(!detect_state && cameranet.chunkGenerated(our_turf.x, our_turf.y, our_turf.z))
var/datum/camerachunk/chunk = cameranet.getCameraChunk(our_turf.x, our_turf.y, our_turf.z)
if(chunk)
if(chunk.seenby.len)
for(var/mob/camera/aiEye/A in chunk.seenby)
var/turf/detect_turf = get_turf(A)
if(get_dist(our_turf, detect_turf) < rangealert)
detect_state = PROXIMITY_ON_SCREEN
break
if(get_dist(our_turf, detect_turf) < rangewarning)
detect_state = PROXIMITY_NEAR
break
/obj/item/multitool/ai_detect/admin
desc = "Used for pulsing wires to test which to cut. Not recommended by doctors. Has a strange tag that says 'Grief in Safety'" //What else should I say for a meme item?
track_delay = 5
shows_wire_information = TRUE
/obj/item/multitool/ai_detect/admin/multitool_detect()
var/turf/our_turf = get_turf(src)
for(var/mob/J in urange(rangewarning,our_turf))
if(check_rights(R_ADMIN, 0, J))
detect_state = PROXIMITY_NEAR
var/turf/detect_turf = get_turf(J)
if(get_dist(our_turf, detect_turf) < rangealert)
detect_state = PROXIMITY_ON_SCREEN
break
/obj/item/multitool/cyborg
name = "multitool"
desc = "Optimised and stripped-down version of a regular multitool."
toolspeed = 0.5
/obj/item/multitool/abductor
name = "alien multitool"
desc = "An omni-technological interface."
icon = 'icons/obj/abductor.dmi'
icon_state = "multitool"
toolspeed = 0.1
origin_tech = "magnets=5;engineering=5;abductor=3"
shows_wire_information = TRUE
@@ -0,0 +1,101 @@
//Screwdriver
/obj/item/screwdriver
name = "screwdriver"
desc = "You can be totally screwy with this."
icon = 'icons/obj/tools.dmi'
icon_state = "screwdriver_map"
flags = CONDUCT
slot_flags = SLOT_BELT
force = 5
w_class = WEIGHT_CLASS_TINY
throwforce = 5
throw_speed = 3
throw_range = 5
materials = list(MAT_METAL=75)
attack_verb = list("stabbed")
hitsound = 'sound/weapons/bladeslice.ogg'
usesound = 'sound/items/screwdriver.ogg'
toolspeed = 1
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 30)
tool_behaviour = TOOL_SCREWDRIVER
var/random_color = TRUE //if the screwdriver uses random coloring
/obj/item/screwdriver/nuke
name = "screwdriver"
desc = "A screwdriver with an ultra thin tip."
icon_state = "screwdriver_nuke"
toolspeed = 0.5
/obj/item/screwdriver/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is stabbing [src] into [user.p_their()] [pick("temple", "heart")]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return BRUTELOSS
/obj/item/screwdriver/New(loc, var/param_color = null)
..()
if(random_color)
if(!param_color)
param_color = pick("red","blue","pink","brown","green","cyan","yellow")
icon_state = "screwdriver_[param_color]"
if (prob(75))
src.pixel_y = rand(0, 16)
/obj/item/screwdriver/attack(mob/living/carbon/M, mob/living/carbon/user)
if(!istype(M) || user.a_intent == INTENT_HELP)
return ..()
if(user.zone_selected != "eyes" && user.zone_selected != "head")
return ..()
if((CLUMSY in user.mutations) && prob(50))
M = user
return eyestab(M,user)
/obj/item/screwdriver/brass
name = "brass screwdriver"
desc = "A screwdriver made of brass. The handle feels freezing cold."
icon_state = "screwdriver_brass"
toolspeed = 0.5
random_color = FALSE
resistance_flags = FIRE_PROOF | ACID_PROOF
/obj/item/screwdriver/abductor
name = "alien screwdriver"
desc = "An ultrasonic screwdriver."
icon = 'icons/obj/abductor.dmi'
icon_state = "screwdriver"
usesound = 'sound/items/pshoom.ogg'
toolspeed = 0.1
random_color = FALSE
/obj/item/screwdriver/power
name = "hand drill"
desc = "A simple hand drill with a screwdriver bit attached."
icon_state = "drill_screw"
item_state = "drill"
materials = list(MAT_METAL=150,MAT_SILVER=50,MAT_TITANIUM=25)
origin_tech = "materials=2;engineering=2" //done for balance reasons, making them high value for research, but harder to get
force = 8 //might or might not be too high, subject to change
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/screwdriver/power/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is putting [src] to [user.p_their()] temple. It looks like [user.p_theyre()] trying to commit suicide!</span>")
return BRUTELOSS
/obj/item/screwdriver/power/attack_self(mob/user)
playsound(get_turf(user), 'sound/items/change_drill.ogg', 50, 1)
var/obj/item/wrench/power/b_drill = new /obj/item/wrench/power
to_chat(user, "<span class='notice'>You attach the bolt driver bit to [src].</span>")
qdel(src)
user.put_in_active_hand(b_drill)
/obj/item/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
@@ -0,0 +1,60 @@
// Called when a mob tries to use the item as a tool.
// Handles most checks.
/obj/item/proc/use_tool(atom/target, mob/living/user, delay, amount=0, volume=0, datum/callback/extra_checks)
// No delay means there is no start message, and no reason to call tool_start_check before use_tool.
// Run the start check here so we wouldn't have to call it manually.
target.add_fingerprint(user)
if(!tool_start_check(user, amount) && !delay)
return
delay *= toolspeed
// Play tool sound at the beginning of tool usage.
play_tool_sound(target, volume)
if(delay)
// Create a callback with checks that would be called every tick by do_after.
var/datum/callback/tool_check = CALLBACK(src, .proc/tool_check_callback, user, target, amount, extra_checks)
if(ismob(target))
if(!do_mob(user, target, delay, extra_checks=tool_check))
return
else
if(!do_after(user, delay, target=target, extra_checks=tool_check))
return
else
// Invoke the extra checks once, just in case.
if(extra_checks && !extra_checks.Invoke())
return
// Use tool's fuel, stack sheets or charges if amount is set.
if(amount && !use(amount))
return
// Play tool sound at the end of tool usage,
// but only if the delay between the beginning and the end is not too small
if(delay >= MIN_TOOL_SOUND_DELAY)
play_tool_sound(target, volume)
return TRUE
// Called before use_tool if there is a delay, or by use_tool if there isn't.
// Only ever used by welding tools and stacks, so it's not added on any other use_tool checks.
/obj/item/proc/tool_start_check(mob/living/user, amount=0)
return tool_use_check(user, amount)
// A check called by tool_start_check once, and by use_tool on every tick of delay.
/obj/item/proc/tool_use_check(mob/living/user, amount)
return !amount
/obj/item/proc/play_tool_sound(atom/target, volume = tool_volume)
if(target && usesound && volume)
var/played_sound = usesound
if(islist(usesound))
played_sound = pick(usesound)
playsound(target, played_sound, volume, 1)
// Used in a callback that is passed by use_tool into do_after call. Do not override, do not call manually.
/obj/item/proc/tool_check_callback(mob/living/user, atom/target, amount, datum/callback/extra_checks)
return tool_use_check(user, amount) && (!extra_checks || extra_checks.Invoke())
+232
View File
@@ -0,0 +1,232 @@
#define GET_FUEL reagents.get_reagent_amount("fuel")
/obj/item/weldingtool
name = "welding tool"
desc = "A standard edition welder provided by Nanotrasen."
icon = 'icons/obj/tools.dmi'
icon_state = "welder"
item_state = "welder"
flags = CONDUCT
slot_flags = SLOT_BELT
force = 3
throwforce = 5
throw_speed = 3
throw_range = 5
hitsound = "swing_hit"
w_class = WEIGHT_CLASS_SMALL
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 30)
resistance_flags = FIRE_PROOF
materials = list(MAT_METAL=70, MAT_GLASS=30)
origin_tech = "engineering=1;plasmatech=1"
tool_behaviour = TOOL_WELDER
toolspeed = 1
tool_enabled = FALSE
usesound = 'sound/items/welder.ogg'
var/maximum_fuel = 20
var/requires_fuel = TRUE //Set to FALSE if it doesn't need fuel, but serves equally well as a cost modifier
var/refills_over_time = FALSE //Do we regenerate fuel?
var/activation_sound = 'sound/items/welderactivate.ogg'
var/deactivation_sound = 'sound/items/welderdeactivate.ogg'
var/light_intensity = 2
var/low_fuel_changes_icon = TRUE//More than one icon_state due to low fuel?
var/progress_flash_divisor = 10 //Length of time between each "eye flash"
/obj/item/weldingtool/Initialize(mapload)
..()
create_reagents(maximum_fuel)
reagents.add_reagent("fuel", maximum_fuel)
if(refills_over_time)
reagents.reagents_generated_per_cycle += list("fuel" = 1)
update_icon()
/obj/item/weldingtool/examine(mob/user)
. = ..()
if(get_dist(user, src) <= 0)
. += "It contains [GET_FUEL] unit\s of fuel out of [maximum_fuel]."
/obj/item/weldingtool/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] welds [user.p_their()] every orifice closed! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return FIRELOSS
/obj/item/weldingtool/process()
var/turf/T = get_turf(src)
T.hotspot_expose(2500, 5)
if(prob(5))
remove_fuel(1)
..()
/obj/item/weldingtool/attack_self(mob/user)
if(tool_enabled) //Turn off the welder if it's on
to_chat(user, "<span class='notice'>You switch off [src].</span>")
toggle_welder()
return
else if(GET_FUEL) //The welder is off, but we need to check if there is fuel in the tank
to_chat(user, "<span class='notice'>You switch on [src].</span>")
toggle_welder()
else //The welder is off and unfuelled
to_chat(user, "<span class='notice'>[src] is out of fuel!</span>")
/obj/item/weldingtool/proc/toggle_welder(turn_off = FALSE) //Turn it on or off, forces it to deactivate
tool_enabled = turn_off ? FALSE : !tool_enabled
if(tool_enabled)
START_PROCESSING(SSobj, src)
damtype = BURN
force = 15
hitsound = 'sound/items/welder.ogg'
playsound(loc, activation_sound, 50, 1)
set_light(light_intensity)
else
STOP_PROCESSING(SSobj, src)
damtype = BRUTE
force = 3
hitsound = "swing_hit"
playsound(loc, deactivation_sound, 50, 1)
set_light(0)
update_icon()
if(ismob(loc))
var/mob/M = loc
M.update_inv_r_hand()
M.update_inv_l_hand()
// If welding tool ran out of fuel during a construction task, construction fails.
/obj/item/weldingtool/tool_use_check(mob/living/user, amount)
if(!tool_enabled)
to_chat(user, "<span class='notice'>[src] has to be on to complete this task!</span>")
return FALSE
if(GET_FUEL >= amount * requires_fuel)
return TRUE
else
to_chat(user, "<span class='warning'>You need more welding fuel to complete this task!</span>")
return FALSE
// When welding is about to start, run a normal tool_use_check, then flash a mob if it succeeds.
/obj/item/weldingtool/tool_start_check(mob/living/user, amount=0)
. = tool_use_check(user, amount)
if(. && user)
user.flash_eyes(light_intensity)
/obj/item/weldingtool/use(amount)
if(GET_FUEL < amount * requires_fuel)
return
remove_fuel(amount)
return TRUE
/obj/item/weldingtool/use_tool(target, user, delay, amount, volume, datum/callback/extra_checks)
var/did_thing = ..()
if(did_thing)
remove_fuel(1) //Consume some fuel after we do a welding action
if(delay)
progress_flash_divisor = initial(progress_flash_divisor)
return did_thing
/obj/item/weldingtool/tool_check_callback(mob/living/user, amount, datum/callback/extra_checks)
. = ..()
if(. && user)
if(progress_flash_divisor == 0)
user.flash_eyes(min(light_intensity, 1))
progress_flash_divisor = initial(progress_flash_divisor)
else
progress_flash_divisor--
/obj/item/weldingtool/proc/remove_fuel(amount) //NB: doesn't check if we have enough fuel, it just removes however much is left if there's not enough
reagents.remove_reagent("fuel", amount * requires_fuel)
if(!GET_FUEL)
toggle_welder(TRUE)
/obj/item/weldingtool/refill(mob/user, atom/A, amount)
if(!A.reagents)
return
if(GET_FUEL >= maximum_fuel)
to_chat(user, "<span class='notice'>[src] is already full!</span>")
return
var/amount_transferred = A.reagents.trans_id_to(src, "fuel", amount)
if(amount_transferred)
to_chat(user, "<span class='notice'>You refuel [src] by [amount_transferred] unit\s.</span>")
playsound(src, 'sound/effects/refill.ogg', 50, 1)
update_icon()
return amount_transferred
else
to_chat(user, "<span class='warning'>There's not enough fuel in [A] to refuel [src]!</span>")
/obj/item/weldingtool/proc/update_torch()
overlays.Cut()
if(tool_enabled)
overlays += "[initial(icon_state)]-on"
item_state = "[initial(item_state)]1"
else
item_state = "[initial(item_state)]"
/obj/item/weldingtool/update_icon()
if(low_fuel_changes_icon)
var/ratio = GET_FUEL / maximum_fuel
ratio = Ceiling(ratio*4) * 25
if(ratio == 100)
icon_state = initial(icon_state)
else
icon_state = "[initial(icon_state)][ratio]"
update_torch()
..()
/obj/item/weldingtool/largetank
name = "industrial welding tool"
desc = "A slightly larger welder with a larger tank."
icon_state = "indwelder"
maximum_fuel = 40
materials = list(MAT_METAL=70, MAT_GLASS=60)
origin_tech = "engineering=2;plasmatech=2"
/obj/item/weldingtool/largetank/cyborg
name = "integrated welding tool"
desc = "An advanced welder designed to be used in robotic systems."
toolspeed = 0.5
/obj/item/weldingtool/mini
name = "emergency welding tool"
desc = "A miniature welder used during emergencies."
icon_state = "miniwelder"
maximum_fuel = 10
w_class = WEIGHT_CLASS_TINY
materials = list(MAT_METAL=30, MAT_GLASS=10)
low_fuel_changes_icon = FALSE
/obj/item/weldingtool/abductor
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
light_intensity = 0
origin_tech = "plasmatech=5;engineering=5;abductor=3"
requires_fuel = FALSE
refills_over_time = TRUE
low_fuel_changes_icon = FALSE
/obj/item/weldingtool/hugetank
name = "upgraded welding tool"
desc = "An upgraded welder based off the industrial welder."
icon_state = "upindwelder"
item_state = "upindwelder"
maximum_fuel = 80
materials = list(MAT_METAL=70, MAT_GLASS=120)
origin_tech = "engineering=3;plasmatech=2"
/obj/item/weldingtool/experimental
name = "experimental welding tool"
desc = "An experimental welder capable of self-fuel generation and less harmful to the eyes."
icon_state = "exwelder"
item_state = "exwelder"
maximum_fuel = 40
materials = list(MAT_METAL=70, MAT_GLASS=120)
origin_tech = "materials=4;engineering=4;bluespace=3;plasmatech=4"
light_intensity = 1
toolspeed = 0.5
refills_over_time = TRUE
low_fuel_changes_icon = FALSE
/obj/item/weldingtool/experimental/brass
name = "brass welding tool"
desc = "A brass welder that seems to constantly refuel itself. It is faintly warm to the touch."
icon_state = "brasswelder"
item_state = "brasswelder"
resistance_flags = FIRE_PROOF | ACID_PROOF
@@ -0,0 +1,95 @@
/obj/item/wirecutters
name = "wirecutters"
desc = "This cuts wires."
icon = 'icons/obj/tools.dmi'
icon_state = "cutters"
flags = CONDUCT
slot_flags = SLOT_BELT
force = 6
throw_speed = 3
throw_range = 7
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=80)
origin_tech = "materials=1;engineering=1"
attack_verb = list("pinched", "nipped")
hitsound = 'sound/items/wirecutter.ogg'
usesound = 'sound/items/wirecutter.ogg'
sharp = 1
toolspeed = 1
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 30)
tool_behaviour = TOOL_WIRECUTTER
var/random_color = TRUE
/obj/item/wirecutters/New(loc, param_color = null)
..()
if(random_color)
if(!param_color)
param_color = pick("yellow", "red")
icon_state = "cutters_[param_color]"
/obj/item/wirecutters/attack(mob/living/carbon/C, mob/user)
if(istype(C) && C.handcuffed && istype(C.handcuffed, /obj/item/restraints/handcuffs/cable))
user.visible_message("<span class='notice'>[user] cuts [C]'s restraints with [src]!</span>")
QDEL_NULL(C.handcuffed)
if(C.buckled && C.buckled.buckle_requires_restraints)
C.buckled.unbuckle_mob(C)
C.update_handcuffed()
return
else
..()
/obj/item/wirecutters/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is cutting at [user.p_their()] arteries with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
playsound(loc, usesound, 50, 1, -1)
return BRUTELOSS
/obj/item/wirecutters/brass
name = "brass wirecutters"
desc = "A pair of wirecutters made of brass. The handle feels freezing cold to the touch."
icon_state = "cutters_brass"
toolspeed = 0.5
random_color = FALSE
resistance_flags = FIRE_PROOF | ACID_PROOF
/obj/item/wirecutters/abductor
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 = "materials=5;engineering=4;abductor=3"
random_color = FALSE
/obj/item/wirecutters/cyborg
name = "wirecutters"
desc = "This cuts wires."
toolspeed = 0.5
/obj/item/wirecutters/power
name = "jaws of life"
desc = "A set of jaws of life, the magic of science has managed to fit it down into a device small enough to fit in a tool belt. It's fitted with a cutting head."
icon_state = "jaws_cutter"
item_state = "jawsoflife"
origin_tech = "materials=2;engineering=2"
materials = list(MAT_METAL=150,MAT_SILVER=50,MAT_TITANIUM=25)
usesound = 'sound/items/jaws_cut.ogg'
toolspeed = 0.25
random_color = FALSE
/obj/item/wirecutters/power/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is wrapping \the [src] around [user.p_their()] neck. It looks like [user.p_theyre()] trying to rip [user.p_their()] head off!</span>")
playsound(loc, 'sound/items/jaws_cut.ogg', 50, 1, -1)
if(ishuman(user))
var/mob/living/carbon/human/H = user
var/obj/item/organ/external/head/head = H.bodyparts_by_name["head"]
if(head)
head.droplimb(0, DROPLIMB_BLUNT, FALSE, TRUE)
playsound(loc,pick('sound/misc/desceration-01.ogg','sound/misc/desceration-02.ogg','sound/misc/desceration-01.ogg') ,50, 1, -1)
return BRUTELOSS
/obj/item/wirecutters/power/attack_self(mob/user)
playsound(get_turf(user), 'sound/items/change_jaws.ogg', 50, 1)
var/obj/item/crowbar/power/pryjaws = new /obj/item/crowbar/power
to_chat(user, "<span class='notice'>You attach the pry jaws to [src].</span>")
qdel(src)
user.put_in_active_hand(pryjaws)
+105
View File
@@ -0,0 +1,105 @@
//Wrench
/obj/item/wrench
name = "wrench"
desc = "A wrench with common uses. Can be found in your hand."
icon = 'icons/obj/tools.dmi'
icon_state = "wrench"
flags = CONDUCT
slot_flags = SLOT_BELT
force = 5
throwforce = 7
usesound = 'sound/items/ratchet.ogg'
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=150)
origin_tech = "materials=1;engineering=1"
attack_verb = list("bashed", "battered", "bludgeoned", "whacked")
toolspeed = 1
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 30)
tool_behaviour = TOOL_WRENCH
/obj/item/wrench/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is beating [user.p_them()]self to death with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
playsound(loc, 'sound/weapons/genhit.ogg', 50, 1, -1)
return BRUTELOSS
/obj/item/wrench/cyborg
name = "automatic wrench"
desc = "An advanced robotic wrench. Can be found in construction cyborgs."
toolspeed = 0.5
/obj/item/wrench/brass
name = "brass wrench"
desc = "A brass wrench. It's faintly warm to the touch."
icon_state = "wrench_brass"
toolspeed = 0.5
resistance_flags = FIRE_PROOF | ACID_PROOF
/obj/item/wrench/abductor
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 = "materials=5;engineering=5;abductor=3"
/obj/item/wrench/power
name = "hand drill"
desc = "A simple powered drill with a bolt bit."
icon_state = "drill_bolt"
item_state = "drill"
usesound = 'sound/items/drill_use.ogg'
materials = list(MAT_METAL=150,MAT_SILVER=50,MAT_TITANIUM=25)
origin_tech = "materials=2;engineering=2" //done for balance reasons, making them high value for research, but harder to get
force = 8 //might or might not be too high, subject to change
throwforce = 8
attack_verb = list("drilled", "screwed", "jabbed")
toolspeed = 0.25
/obj/item/wrench/power/attack_self(mob/user)
playsound(get_turf(user),'sound/items/change_drill.ogg', 50, 1)
var/obj/item/wirecutters/power/s_drill = new /obj/item/screwdriver/power
to_chat(user, "<span class='notice'>You attach the screwdriver bit to [src].</span>")
qdel(src)
user.put_in_active_hand(s_drill)
/obj/item/wrench/power/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is pressing [src] against [user.p_their()] head! It looks like [user.p_theyre()] trying to commit suicide!")
return BRUTELOSS
/obj/item/wrench/medical
name = "medical wrench"
desc = "A medical wrench with common (medical?) uses. Can be found in your hand."
icon_state = "wrench_medical"
force = 2 //MEDICAL
throwforce = 4
origin_tech = "materials=1;engineering=1;biotech=3"
attack_verb = list("wrenched", "medicaled", "tapped", "jabbed", "whacked")
/obj/item/wrench/medical/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is praying to the medical wrench to take [user.p_their()] soul. It looks like [user.p_theyre()] trying to commit suicide!</span>")
// TODO Make them glow with the power of the M E D I C A L W R E N C H
// during their ascension
// Stun stops them from wandering off
user.Stun(5)
playsound(loc, 'sound/effects/pray.ogg', 50, 1, -1)
// Let the sound effect finish playing
sleep(20)
if(!user)
return
for(var/obj/item/W in user)
user.unEquip(W)
var/obj/item/wrench/medical/W = new /obj/item/wrench/medical(loc)
W.add_fingerprint(user)
W.desc += " For some reason, it reminds you of [user.name]."
if(!user)
return
user.dust()
return OBLITERATION
+21 -17
View File
@@ -36,26 +36,30 @@
return
update_icon()
to_chat(user, "<span class='notice'>You add the cables to the [src]. It now contains [loaded.amount].</span>")
else if(isscrewdriver(W))
if(!loaded)
return
to_chat(user, "<span class='notice'>You loosen the securing screws on the side, allowing you to lower the guiding edge and retrieve the wires.</span>")
while(loaded.amount > 30) //There are only two kinds of situations: "nodiff" (60,90), or "diff" (31-59, 61-89)
var/diff = loaded.amount % 30
if(diff)
loaded.use(diff)
new /obj/item/stack/cable_coil(user.loc, diff)
else
loaded.use(30)
new /obj/item/stack/cable_coil(user.loc, 30)
loaded.max_amount = initial(loaded.max_amount)
loaded.forceMove(user.loc)
user.put_in_hands(loaded)
loaded = null
update_icon()
else
..()
/obj/item/twohanded/rcl/screwdriver_act(mob/user, obj/item/I)
if(!loaded)
return
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
to_chat(user, "<span class='notice'>You loosen the securing screws on the side, allowing you to lower the guiding edge and retrieve the wires.</span>")
while(loaded.amount > 30) //There are only two kinds of situations: "nodiff" (60,90), or "diff" (31-59, 61-89)
var/diff = loaded.amount % 30
if(diff)
loaded.use(diff)
new /obj/item/stack/cable_coil(user.loc, diff)
else
loaded.use(30)
new /obj/item/stack/cable_coil(user.loc, 30)
loaded.max_amount = initial(loaded.max_amount)
loaded.forceMove(user.loc)
user.put_in_hands(loaded)
loaded = null
update_icon()
/obj/item/twohanded/rcl/examine(mob/user)
. = ..()
if(loaded)
+6 -6
View File
@@ -64,14 +64,14 @@ LIGHTERS ARE IN LIGHTERS.DM
..()
light()
/obj/item/clothing/mask/cigarette/welder_act(mob/user, obj/item/I)
. = TRUE
if(I.tool_use_check(user, 0)) //Don't need to flash eyes because you are a badass
light("<span class='notice'>[user] casually lights the [name] with [I], what a badass.</span>")
/obj/item/clothing/mask/cigarette/attackby(obj/item/W as obj, mob/user as mob, params)
..()
if(istype(W, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = W
if(WT.isOn())//Badasses dont get blinded while lighting their cig with a welding tool
light("<span class='notice'>[user] casually lights the [name] with [W], what a badass.</span>")
else if(istype(W, /obj/item/lighter/zippo))
if(istype(W, /obj/item/lighter/zippo))
var/obj/item/lighter/zippo/Z = W
if(Z.lit)
light("<span class='rose'>With a single flick of [user.p_their()] wrist, [user] smoothly lights [user.p_their()] [name] with [user.p_their()] [W]. Damn [user.p_theyre()] cool.</span>")
@@ -0,0 +1,21 @@
// Conversion kit
/obj/item/conversion_kit
name = "\improper Revolver Conversion Kit"
desc = "A professional conversion kit used to convert any knock off revolver into the real deal capable of shooting lethal .357 rounds without the possibility of catastrophic failure."
icon_state = "kit"
flags = CONDUCT
w_class = WEIGHT_CLASS_SMALL
origin_tech = "combat=2"
var/open = 0
/obj/item/conversion_kit/New()
..()
update_icon()
/obj/item/conversion_kit/update_icon()
icon_state = "[initial(icon_state)]_[open]"
/obj/item/conversion_kit/attack_self(mob/user)
open = !open
to_chat(user, "<span class='notice'>You [open ? "open" : "close"] the conversion kit.</span>")
update_icon()
+2 -2
View File
@@ -7,7 +7,7 @@ obj/item/firework
obj/item/firework/attackby(obj/item/W,mob/user, params)
if(litzor)
return
if(istype(W, /obj/item/weldingtool) && W:welding || istype(W,/obj/item/lighter) && W:lit)
if(is_hot(W))
for(var/mob/M in viewers(user))
to_chat(M, "[user] lits \the [src]")
litzor = 1
@@ -29,7 +29,7 @@ obj/item/sparkler
obj/item/sparkler/attackby(obj/item/W,mob/user, params)
if(litzor)
return
if(istype(W, /obj/item/weldingtool) && W:welding || istype(W,/obj/item/lighter) && W:lit)
if(is_hot(W))
for(var/mob/M in viewers(user))
to_chat(M, "[user] lits \the [src]")
litzor = 1
+29 -24
View File
@@ -76,28 +76,7 @@
flame_turf(turflist)
/obj/item/flamethrower/attackby(obj/item/I, mob/user, params)
if(iswrench(I) && !status)//Taking this apart
var/turf/T = get_turf(src)
if(weldtool)
weldtool.forceMove(T)
weldtool = null
if(igniter)
igniter.forceMove(T)
igniter = null
if(ptank)
ptank.forceMove(T)
ptank = null
new /obj/item/stack/rods(T)
qdel(src)
return
else if(isscrewdriver(I) && igniter && !lit)
status = !status
to_chat(user, "<span class='notice'>[igniter] is now [status ? "secured" : "unsecured"]!</span>")
update_icon()
return
else if(isigniter(I))
if(isigniter(I))
var/obj/item/assembly/igniter/IG = I
if(IG.secured)
return
@@ -130,6 +109,34 @@
else
return ..()
/obj/item/flamethrower/wrench_act(mob/user, obj/item/I)
if(status)
return
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
var/turf/T = get_turf(src)
if(weldtool)
weldtool.forceMove(T)
weldtool = null
if(igniter)
igniter.forceMove(T)
igniter = null
if(ptank)
ptank.forceMove(T)
ptank = null
new /obj/item/stack/rods(T)
qdel(src)
/obj/item/flamethrower/screwdriver_act(mob/user, obj/item/I)
if(!igniter || lit)
return
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
status = !status
to_chat(user, "<span class='notice'>[igniter] is now [status ? "secured" : "unsecured"]!</span>")
update_icon()
/obj/item/flamethrower/attack_self(mob/user)
toggle_igniter(user)
@@ -168,7 +175,6 @@
..()
weldtool = locate(/obj/item/weldingtool) in contents
igniter = locate(/obj/item/assembly/igniter) in contents
weldtool.status = FALSE
igniter.secured = FALSE
status = TRUE
update_icon()
@@ -216,7 +222,6 @@
if(create_full)
if(!weldtool)
weldtool = new /obj/item/weldingtool(src)
weldtool.status = FALSE
if(!igniter)
igniter = new igniter_type(src)
igniter.secured = FALSE
@@ -387,18 +387,18 @@
origin_tech = "combat=3;engineering=4"
var/unit_spread = 10 // Amount of units per repeat. Can be altered with a multitool.
/obj/item/grenade/chem_grenade/adv_release/attackby(obj/item/I, mob/user, params)
if(ismultitool(I))
switch(unit_spread)
if(0 to 24)
unit_spread += 5
if(25 to 99)
unit_spread += 25
else
unit_spread = 5
to_chat(user, "<span class='notice'> You set the time release to [unit_spread] units per detonation.</span>")
/obj/item/grenade/chem_grenade/adv_release/multitool_act(mob/user, obj/item/I)
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
..()
switch(unit_spread)
if(0 to 24)
unit_spread += 5
if(25 to 99)
unit_spread += 25
else
unit_spread = 5
to_chat(user, "<span class='notice'> You set the time release to [unit_spread] units per detonation.</span>")
/obj/item/grenade/chem_grenade/adv_release/prime()
if(stage != READY)
@@ -138,8 +138,7 @@
/datum/crafting_recipe/improvised_pneumatic_cannon //Pretty easy to obtain but
name = "Pneumatic Cannon"
result = /obj/item/pneumatic_cannon/ghetto
tools = list(/obj/item/weldingtool,
/obj/item/wrench)
tools = list(TOOL_WELDER, TOOL_WRENCH)
reqs = list(/obj/item/stack/sheet/metal = 4,
/obj/item/stack/packageWrap = 8,
/obj/item/pipe = 2)
+22 -13
View File
@@ -37,20 +37,29 @@
to_chat(user, "<span class='warning'>[IT] is too small for [src].</span>")
return
updateTank(W, 0, user)
else if(iswrench(W))
switch(fisto_setting)
if(1)
fisto_setting = 2
if(2)
fisto_setting = 3
if(3)
fisto_setting = 1
playsound(loc, W.usesound, 50, 1)
to_chat(user, "<span class='notice'>You tweak [src]'s piston valve to [fisto_setting].</span>")
else if(isscrewdriver(W))
if(tank)
updateTank(tank, 1, user)
return
return ..()
/obj/item/melee/powerfist/wrench_act(mob/user, obj/item/I)
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
switch(fisto_setting)
if(1)
fisto_setting = 2
if(2)
fisto_setting = 3
if(3)
fisto_setting = 1
to_chat(user, "<span class='notice'>You tweak [src]'s piston valve to [fisto_setting].</span>")
/obj/item/melee/powerfist/screwdriver_act(mob/user, obj/item/I)
if(!tank)
return
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
updateTank(tank, 1, user)
/obj/item/melee/powerfist/proc/updateTank(obj/item/tank/thetank, removing = 0, mob/living/carbon/human/user)
if(removing)
+17 -16
View File
@@ -60,26 +60,27 @@
H.UpdateDamageIcon()
/obj/item/shard/attackby(obj/item/I, mob/user, params)
if(iswelder(I))
var/obj/item/weldingtool/WT = I
if(WT.remove_fuel(0, user))
var/obj/item/stack/sheet/NG = new welded_type(user.loc)
for(var/obj/item/stack/sheet/G in user.loc)
if(!istype(G, welded_type))
continue
if(G == NG)
continue
if(G.amount >= G.max_amount)
continue
G.attackby(NG, user)
to_chat(user, "<span class='notice'>You add the newly-formed glass to the stack. It now contains [NG.amount] sheet\s.</span>")
qdel(src)
return
if(istype(I, /obj/item/lightreplacer))
I.attackby(src, user)
return
return ..()
/obj/item/shard/welder_act(mob/user, obj/item/I)
. = TRUE
if(!I.use_tool(src, user, volume = I.tool_volume))
return
var/obj/item/stack/sheet/NG = new welded_type(user.loc)
for(var/obj/item/stack/sheet/G in user.loc)
if(!istype(G, welded_type))
continue
if(G == NG)
continue
if(G.amount >= G.max_amount)
continue
G.attackby(NG, user)
to_chat(user, "<span class='notice'>You add the newly-formed glass to the stack. It now contains [NG.amount] sheet\s.</span>")
qdel(src)
/obj/item/shard/Crossed(mob/living/L, oldloc)
if(istype(L) && has_gravity(loc))
if(L.incorporeal_move || L.flying)
@@ -95,4 +96,4 @@
icon_state = "plasmalarge"
materials = list(MAT_PLASMA = MINERAL_MATERIAL_AMOUNT * 0.5, MAT_GLASS = MINERAL_MATERIAL_AMOUNT)
icon_prefix = "plasma"
welded_type = /obj/item/stack/sheet/plasmaglass
welded_type = /obj/item/stack/sheet/plasmaglass
@@ -48,19 +48,7 @@
stored_gun.afterattack(A, user, flag, params)
/obj/item/storage/briefcase/false_bottomed/attackby(var/obj/item/I, mob/user)
if(isscrewdriver(I))
if(!bottom_open && !busy_hunting)
to_chat(user, "You begin to hunt around the rim of the [src]...")
busy_hunting = TRUE
if(do_after(user, 20, target = src))
if(user)
to_chat(user, "You pry open the false bottom!")
bottom_open = TRUE
busy_hunting = FALSE
else if(bottom_open)
to_chat(user, "You push the false bottom down and close it with a click[stored_item ? ", with the [stored_item] snugly inside." : "."]")
bottom_open = FALSE
else if(bottom_open)
if(bottom_open)
if(stored_item)
to_chat(user, "<span class='warning'>There's already something in the false bottom!</span>")
return
@@ -78,6 +66,24 @@
else
return ..()
/obj/item/storage/briefcase/false_bottomed/screwdriver_act(mob/user, obj/item/I)
if(!bottom_open && busy_hunting)
return
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
if(!bottom_open)
to_chat(user, "You begin to hunt around the rim of the [src]...")
busy_hunting = TRUE
if(do_after(user, 20, target = src))
if(user)
to_chat(user, "You pry open the false bottom!")
bottom_open = TRUE
busy_hunting = FALSE
else
to_chat(user, "You push the false bottom down and close it with a click[stored_item ? ", with the [stored_item] snugly inside." : "."]")
bottom_open = FALSE
/obj/item/storage/briefcase/false_bottomed/attack_hand(mob/user)
if(bottom_open && stored_item)
user.put_in_hands(stored_item)
+10 -10
View File
@@ -311,17 +311,17 @@
hitsound = 'sound/weapons/blade1.ogg'
w_class = w_class_on
/obj/item/twohanded/dualsaber/attackby(obj/item/W, mob/user, params)
if(ismultitool(W))
if(!hacked)
hacked = TRUE
to_chat(user, "<span class='warning'>2XRNBW_ENGAGE</span>")
blade_color = "rainbow"
update_icon()
else
to_chat(user, "<span class='warning'>It's starting to look like a triple rainbow - no, nevermind.</span>")
/obj/item/twohanded/dualsaber/multitool_act(mob/user, obj/item/I)
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
if(!hacked)
hacked = TRUE
to_chat(user, "<span class='warning'>2XRNBW_ENGAGE</span>")
blade_color = "rainbow"
update_icon()
else
return ..()
to_chat(user, "<span class='warning'>It's starting to look like a triple rainbow - no, nevermind.</span>")
//spears
/obj/item/twohanded/spear