code folder. 221 files changed wew
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
|
||||
flags_1 = CONDUCT_1 | NOBLUDGEON_1
|
||||
slot_flags = SLOT_BELT
|
||||
usesound = 'sound/effects/spray2.ogg'
|
||||
|
||||
var/obj/item/device/toner/ink = null
|
||||
|
||||
@@ -20,7 +21,7 @@
|
||||
|
||||
//This proc doesn't just check if the painter can be used, but also uses it.
|
||||
//Only call this if you are certain that the painter will be used right after this check!
|
||||
/obj/item/airlock_painter/proc/use(mob/user)
|
||||
/obj/item/airlock_painter/proc/use_paint(mob/user)
|
||||
if(can_use(user))
|
||||
ink.charges--
|
||||
playsound(src.loc, 'sound/effects/spray2.ogg', 50, 1)
|
||||
|
||||
@@ -78,9 +78,17 @@
|
||||
return
|
||||
A.emag_act(user)
|
||||
|
||||
/obj/item/card/emag/fake/afterattack()
|
||||
playsound(src.loc, 'sound/items/bikehorn.ogg', 50, 1)
|
||||
return
|
||||
/obj/item/card/emagfake
|
||||
desc = "It's a card with a magnetic strip attached to some circuitry."
|
||||
name = "cryptographic sequencer"
|
||||
icon_state = "emag"
|
||||
item_state = "card-id"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/idcards_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi'
|
||||
|
||||
/obj/item/card/emagfake/afterattack()
|
||||
. = ..()
|
||||
playsound(src, 'sound/items/bikehorn.ogg', 50, 1)
|
||||
|
||||
/obj/item/card/id
|
||||
name = "identification card"
|
||||
|
||||
@@ -807,4 +807,4 @@ CIGARETTE PACKETS ARE IN FANCY.DM
|
||||
return
|
||||
|
||||
if(reagents && reagents.total_volume)
|
||||
hand_reagents()
|
||||
hand_reagents()
|
||||
|
||||
@@ -292,7 +292,7 @@
|
||||
new_setting = "Freezer"
|
||||
name = initial(new_type.name)
|
||||
build_path = initial(new_type.build_path)
|
||||
playsound(user, I.usesound, 50, 1)
|
||||
I.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You change the circuitboard setting to \"[new_setting]\".</span>")
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -170,11 +170,9 @@
|
||||
to_chat(user, "<span class='warning'>Turn off [src] before you perform this action!</span>")
|
||||
return 0
|
||||
user.visible_message("<span class='notice'>[user] unscrews [src]'s maintenance panel and begins fiddling with its innards...</span>", "<span class='notice'>You begin resetting [src]...</span>")
|
||||
playsound(user, I.usesound, 50, 1)
|
||||
if(!do_after(user, 40*I.toolspeed, target = user))
|
||||
if(!I.use_tool(src, user, 40, volume=50))
|
||||
return 0
|
||||
user.visible_message("<span class='notice'>[user] refastens [src]'s maintenance panel!</span>", "<span class='notice'>You reset [src] to its factory settings!</span>")
|
||||
playsound(user, 'sound/items/screwdriver2.ogg', 50, 1)
|
||||
obj_flags &= ~EMAGGED
|
||||
radiation_count = 0
|
||||
update_icon()
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
hitsound = 'sound/weapons/tap.ogg'
|
||||
toolspeed = 1
|
||||
tool_behaviour = TOOL_MULTITOOL
|
||||
usesound = 'sound/weapons/empty.ogg'
|
||||
var/datum/integrated_io/selected_io = null //functional for integrated circuits.
|
||||
var/mode = 0
|
||||
|
||||
|
||||
@@ -57,37 +57,28 @@
|
||||
|
||||
/obj/item/device/radio/intercom/attackby(obj/item/I, mob/living/user, params)
|
||||
if(istype(I, /obj/item/screwdriver))
|
||||
var/obj/item/screwdriver/S = I
|
||||
if(unfastened)
|
||||
user.visible_message("<span class='notice'>[user] starts tightening [src]'s screws...</span>", "<span class='notice'>You start screwing in [src]...</span>")
|
||||
playsound(src, S.usesound, 50, 1)
|
||||
if(!do_after(user, 30 * S.toolspeed, target = src))
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] tightens [src]'s screws!</span>", "<span class='notice'>You tighten [src]'s screws.</span>")
|
||||
playsound(src, 'sound/items/screwdriver2.ogg', 50, 1)
|
||||
unfastened = FALSE
|
||||
if(I.use_tool(src, user, 30, volume=50))
|
||||
user.visible_message("<span class='notice'>[user] tightens [src]'s screws!</span>", "<span class='notice'>You tighten [src]'s screws.</span>")
|
||||
unfastened = FALSE
|
||||
else
|
||||
user.visible_message("<span class='notice'>[user] starts loosening [src]'s screws...</span>", "<span class='notice'>You start unscrewing [src]...</span>")
|
||||
playsound(src, S.usesound, 50, 1)
|
||||
if(!do_after(user, 60 * S.toolspeed, target = src))
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] loosens [src]'s screws!</span>", "<span class='notice'>You unscrew [src], loosening it from the wall.</span>")
|
||||
playsound(src, 'sound/items/screwdriver2.ogg', 50, 1)
|
||||
unfastened = TRUE
|
||||
if(I.use_tool(src, user, 40, volume=50))
|
||||
user.visible_message("<span class='notice'>[user] loosens [src]'s screws!</span>", "<span class='notice'>You unscrew [src], loosening it from the wall.</span>")
|
||||
unfastened = TRUE
|
||||
return
|
||||
else if(istype(I, /obj/item/wrench))
|
||||
if(!unfastened)
|
||||
to_chat(user, "<span class='warning'>You need to unscrew [src] from the wall first!</span>")
|
||||
return
|
||||
var/obj/item/wrench/W = I
|
||||
user.visible_message("<span class='notice'>[user] starts unsecuring [src]...</span>", "<span class='notice'>You start unsecuring [src]...</span>")
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
if(!do_after(user, 80 * W.toolspeed, target = src))
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] unsecures [src]!</span>", "<span class='notice'>You detach [src] from the wall.</span>")
|
||||
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
new/obj/item/wallframe/intercom(get_turf(src))
|
||||
qdel(src)
|
||||
I.play_tool_sound(src)
|
||||
if(I.use_tool(src, user, 80))
|
||||
user.visible_message("<span class='notice'>[user] unsecures [src]!</span>", "<span class='notice'>You detach [src] from the wall.</span>")
|
||||
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
new/obj/item/wallframe/intercom(get_turf(src))
|
||||
qdel(src)
|
||||
return
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -276,17 +276,11 @@
|
||||
|
||||
|
||||
/obj/item/device/tape/attackby(obj/item/I, mob/user, params)
|
||||
if(ruined)
|
||||
var/delay = -1
|
||||
if (istype(I, /obj/item/screwdriver))
|
||||
delay = 120*I.toolspeed
|
||||
else if(istype(I, /obj/item/pen))
|
||||
delay = 120*1.5
|
||||
if (delay != -1)
|
||||
to_chat(user, "<span class='notice'>You start winding the tape back in...</span>")
|
||||
if(do_after(user, delay, target = src))
|
||||
to_chat(user, "<span class='notice'>You wound the tape back in.</span>")
|
||||
fix()
|
||||
if(ruined && istype(I, /obj/item/screwdriver) || istype(I, /obj/item/pen))
|
||||
to_chat(user, "<span class='notice'>You start winding the tape back in...</span>")
|
||||
if(I.use_tool(src, user, 120))
|
||||
to_chat(user, "<span class='notice'>You wound the tape back in.</span>")
|
||||
fix()
|
||||
|
||||
//Random colour tapes
|
||||
/obj/item/device/tape/random
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
if(beakers.len)
|
||||
stage_change(READY)
|
||||
to_chat(user, "<span class='notice'>You lock the [initial(name)] assembly.</span>")
|
||||
playsound(loc, I.usesound, 25, -3)
|
||||
I.play_tool_sound(src, 25)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need to add at least one beaker before locking the [initial(name)] assembly!</span>")
|
||||
else if(stage == READY && !nadeassembly)
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
update_icon()
|
||||
return
|
||||
if(nadeassembly && istype(I, /obj/item/wirecutters))
|
||||
playsound(src, I.usesound, 20, 1)
|
||||
I.play_tool_sound(src, 20)
|
||||
nadeassembly.forceMove(get_turf(src))
|
||||
nadeassembly.master = null
|
||||
nadeassembly = null
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
//CREATOR'S NOTE: DO NOT FUCKING GIVE THIS TO BOTANY!
|
||||
/obj/item/hot_potato
|
||||
name = "hot potato"
|
||||
desc = "A label on the side of this potato reads \"Product of DonkCo Service Wing. Activate far away from populated areas. Device will only attach to sapient creatures.\" <span class='boldnotice'>You can attack anyone with it to force it on them instead of yourself!</span>"
|
||||
icon = 'icons/obj/hydroponics/harvest.dmi'
|
||||
icon_state = "potato"
|
||||
flags_1 = NOBLUDGEON_1
|
||||
force = 0
|
||||
var/icon_off = "potato"
|
||||
var/icon_on = "potato_active"
|
||||
var/detonation_timerid
|
||||
var/activation_time = 0
|
||||
var/timer = 600 //deciseconds
|
||||
var/show_timer = FALSE
|
||||
var/reusable = FALSE //absolute madman
|
||||
var/sticky = TRUE
|
||||
var/forceful_attachment = TRUE
|
||||
var/stimulant = TRUE
|
||||
var/detonate_explosion = TRUE
|
||||
var/detonate_dev_range = 0
|
||||
var/detonate_heavy_range = 0
|
||||
var/detonate_light_range = 2
|
||||
var/detonate_flash_range = 5
|
||||
var/detonate_fire_range = 5
|
||||
|
||||
var/color_val = FALSE
|
||||
|
||||
/obj/item/hot_potato/proc/detonate()
|
||||
var/atom/location = loc
|
||||
location.visible_message("<span class='userdanger'>[src] [detonate_explosion? "explodes" : "activates"]!</span>", "<span class='userdanger'>[src] activates! You've ran out of time!</span>")
|
||||
if(detonate_explosion)
|
||||
explosion(src, detonate_dev_range, detonate_heavy_range, detonate_light_range, detonate_flash_range, flame_range = detonate_fire_range)
|
||||
deactivate()
|
||||
if(!reusable)
|
||||
var/mob/M = loc
|
||||
if(istype(M))
|
||||
M.dropItemToGround(src, TRUE)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/hot_potato/proc/is_active()
|
||||
return isnull(detonation_timerid)? FALSE : TRUE
|
||||
|
||||
/obj/item/hot_potato/attack_self(mob/user)
|
||||
if(activate(timer, user))
|
||||
user.visible_message("<span class='boldwarning'>[user] squeezes [src], which promptly starts to flash red-hot colors!</span>", "<span class='boldwarning'>You squeeze [src], activating its countdown and attachment mechanism!</span>",
|
||||
"<span class='boldwarning'>You hear a mechanical click and a loud beeping!</span>")
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/item/hot_potato/process()
|
||||
if(stimulant)
|
||||
if(isliving(loc))
|
||||
var/mob/living/L = loc
|
||||
L.SetStun(0)
|
||||
L.SetKnockdown(0)
|
||||
L.SetSleeping(0)
|
||||
L.SetUnconscious(0)
|
||||
L.reagents.add_reagent("muscle_stimulant", CLAMP(5 - L.reagents.get_reagent_amount("muscle_stimulant"), 0, 5)) //If you don't have legs or get bola'd, tough luck!
|
||||
color_val = !color_val
|
||||
L.add_atom_colour(color_val? "#ffff00" : "#00ffff", FIXED_COLOUR_PRIORITY)
|
||||
|
||||
/obj/item/hot_potato/examine(mob/user)
|
||||
. = ..()
|
||||
if(is_active())
|
||||
to_chat(user, "<span class='warning'>[src] is flashing red-hot! You should probably get rid of it!</span>")
|
||||
if(show_timer)
|
||||
to_chat(user, "<span class='warning'>[src]'s timer looks to be at [(activation_time - world.time) / 10] seconds!</span>")
|
||||
|
||||
/obj/item/hot_potato/equipped(mob/user)
|
||||
. = ..()
|
||||
if(is_active())
|
||||
to_chat(user, "<span class='userdanger'>You have a really bad feeling about [src]!</span>")
|
||||
|
||||
/obj/item/hot_potato/afterattack(atom/target, mob/user, adjacent, params)
|
||||
if(!adjacent || !ismob(target))
|
||||
return ..()
|
||||
force_onto(target, user)
|
||||
|
||||
/obj/item/hot_potato/proc/force_onto(mob/living/victim, mob/user)
|
||||
if(!istype(victim) || user != loc || victim == user)
|
||||
return FALSE
|
||||
if(!victim.client)
|
||||
to_chat(user, "<span class='boldwarning'>[src] refuses to attach to a non-sapient creature!</span>")
|
||||
if(victim.stat != CONSCIOUS || !victim.get_num_legs())
|
||||
to_chat(user, "<span class='boldwarning'>[src] refuses to attach to someone incapable of using it!</span>")
|
||||
user.temporarilyRemoveItemFromInventory(src, TRUE)
|
||||
. = FALSE
|
||||
if(!victim.put_in_hands(src))
|
||||
if(forceful_attachment)
|
||||
victim.dropItemToGround(victim.get_inactive_held_item())
|
||||
if(!victim.put_in_hands(src))
|
||||
victim.dropItemToGround(victim.get_active_held_item())
|
||||
if(victim.put_in_hands(src))
|
||||
. = TRUE
|
||||
else
|
||||
. = TRUE
|
||||
else
|
||||
. = TRUE
|
||||
if(.)
|
||||
add_logs(user, victim, "forced a hot potato with explosive variables ([detonate_explosion]-[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_flash_range]/[detonate_fire_range]) onto")
|
||||
user.visible_message("<span class='userdanger'>[user] forces [src] onto [victim]!</span>", "<span class='userdanger'>You force [src] onto [victim]!</span>", "<span class='boldwarning'>You hear a mechanical click and a beep.</span>")
|
||||
user.remove_atom_colour(TEMPORARY_COLOUR_PRIORITY)
|
||||
else
|
||||
add_logs(user, victim, "tried to force a hot potato with explosive variables ([detonate_explosion]-[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_flash_range]/[detonate_fire_range]) onto")
|
||||
user.visible_message("<span class='boldwarning'>[user] tried to force [src] onto [victim], but it could not attach!</span>", "<span class='boldwarning'>You try to force [src] onto [victim], but it is unable to attach!</span>", "<span class='boldwarning'>You hear a mechanical click and two buzzes.</span>")
|
||||
user.put_in_hands(src)
|
||||
|
||||
/obj/item/hot_potato/dropped(mob/user)
|
||||
. = ..()
|
||||
user.remove_atom_colour(TEMPORARY_COLOUR_PRIORITY)
|
||||
|
||||
/obj/item/hot_potato/proc/activate(delay, mob/user)
|
||||
if(is_active())
|
||||
return
|
||||
update_icon()
|
||||
if(sticky)
|
||||
flags_1 |= NODROP_1
|
||||
name = "primed [name]"
|
||||
activation_time = timer + world.time
|
||||
detonation_timerid = addtimer(CALLBACK(src, .proc/detonate), delay, TIMER_STOPPABLE)
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
var/turf/T = get_turf(src)
|
||||
message_admins("[user? "[ADMIN_LOOKUPFLW(user)] has primed [src]" : "A [src] has been primed"] (Timer:[delay],Explosive:[detonate_explosion],Range:[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_fire_range]) for detonation at [COORD(T)]([T.loc])")
|
||||
log_game("[user? "[user] has primed [src]" : "A [src] has been primed"] ([detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_fire_range]) for detonation at [COORD(T)]([T.loc])")
|
||||
|
||||
/obj/item/hot_potato/proc/deactivate()
|
||||
update_icon()
|
||||
name = initial(name)
|
||||
flags_1 &= ~NODROP_1
|
||||
deltimer(detonation_timerid)
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
detonation_timerid = null
|
||||
if(ismob(loc))
|
||||
var/mob/user = loc
|
||||
user.remove_atom_colour(TEMPORARY_COLOUR_PRIORITY)
|
||||
|
||||
/obj/item/hot_potato/update_icon()
|
||||
icon_state = is_active()? icon_on : icon_off
|
||||
|
||||
/obj/item/hot_potato/syndicate
|
||||
detonate_light_range = 4
|
||||
detonate_fire_range = 5
|
||||
|
||||
/obj/item/hot_potato/harmless
|
||||
detonate_explosion = FALSE
|
||||
|
||||
/obj/item/hot_potato/harmless/toy
|
||||
desc = "A label on the side of this potato reads \"Product of DonkCo Toys and Recreation department.\" <span class='boldnotice'>You can attack anyone with it to put it on them instead, if they have a free hand to take it!</span>"
|
||||
sticky = FALSE
|
||||
reusable = TRUE
|
||||
forceful_attachment = FALSE
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
/obj/item/inducer/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/screwdriver))
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
W.play_tool_sound(src)
|
||||
if(!opened)
|
||||
to_chat(user, "<span class='notice'>You unscrew the battery compartment.</span>")
|
||||
opened = TRUE
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
to_chat(user, "<span class='warning'>You already murdered it!</span>")
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] tears out the stuffing from [src]!</span>", "<span class='notice'>You rip a bunch of the stuffing from [src]. Murderer.</span>")
|
||||
playsound(I, I.usesound, 50, TRUE)
|
||||
I.play_tool_sound(src)
|
||||
stuffed = FALSE
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You remove the grenade from [src].</span>")
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
fisto_setting = 3
|
||||
if(3)
|
||||
fisto_setting = 1
|
||||
playsound(loc, W.usesound, 50, 1)
|
||||
W.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You tweak \the [src]'s piston valve to [fisto_setting].</span>")
|
||||
else if(istype(W, /obj/item/screwdriver))
|
||||
if(tank)
|
||||
|
||||
@@ -25,14 +25,11 @@
|
||||
if(pinnedLoc)
|
||||
pinnedLoc.forceMove(loc)
|
||||
|
||||
/obj/item/target/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/weldingtool))
|
||||
var/obj/item/weldingtool/WT = W
|
||||
if(WT.remove_fuel(0, user))
|
||||
removeOverlays()
|
||||
to_chat(user, "<span class='notice'>You slice off [src]'s uneven chunks of aluminium and scorch marks.</span>")
|
||||
else
|
||||
return ..()
|
||||
/obj/item/target/welder_act(mob/living/user, obj/item/I)
|
||||
if(I.use_tool(src, user, 0, volume=40))
|
||||
removeOverlays()
|
||||
to_chat(user, "<span class='notice'>You slice off [src]'s uneven chunks of aluminium and scorch marks.</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/item/target/attack_hand(mob/user)
|
||||
if(pinnedLoc)
|
||||
|
||||
@@ -40,17 +40,15 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
|
||||
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(istype(W, /obj/item/weldingtool))
|
||||
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))
|
||||
if(W.use_tool(src, user, 0, volume=40))
|
||||
var/obj/item/stack/sheet/metal/new_item = new(usr.loc)
|
||||
user.visible_message("[user.name] shaped [src] into metal with the welding tool.", \
|
||||
"<span class='notice'>You shape [src] into metal with the welding tool.</span>", \
|
||||
user.visible_message("[user.name] shaped [src] into metal with [W].", \
|
||||
"<span class='notice'>You shape [src] into metal with [W].</span>", \
|
||||
"<span class='italics'>You hear welding.</span>")
|
||||
var/obj/item/stack/rods/R = src
|
||||
src = null
|
||||
|
||||
@@ -279,21 +279,22 @@ GLOBAL_LIST_INIT(plastitaniumglass_recipes, list(
|
||||
/obj/item/shard/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/device/lightreplacer))
|
||||
I.attackby(src, user)
|
||||
else if(istype(I, /obj/item/weldingtool))
|
||||
var/obj/item/weldingtool/WT = I
|
||||
if(WT.remove_fuel(0, user))
|
||||
var/obj/item/stack/sheet/glass/NG = new (user.loc)
|
||||
for(var/obj/item/stack/sheet/glass/G in user.loc)
|
||||
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)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/shard/welder_act(mob/living/user, obj/item/I)
|
||||
if(I.use_tool(src, user, 0, volume=50))
|
||||
var/obj/item/stack/sheet/glass/NG = new (user.loc)
|
||||
for(var/obj/item/stack/sheet/glass/G in user.loc)
|
||||
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 TRUE
|
||||
|
||||
/obj/item/shard/Crossed(mob/living/L)
|
||||
if(istype(L) && has_gravity(loc))
|
||||
playsound(loc, 'sound/effects/glass_step.ogg', 50, 1)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
/obj/item/stack/on_grind()
|
||||
for(var/i in 1 to grind_results.len) //This should only call if it's ground, so no need to check if grind_results exists
|
||||
grind_results[grind_results[i]] *= amount //Gets the key at position i, then the reagent amount of that key, then multiplies it by stack size
|
||||
grind_results[grind_results[i]] *= get_amount() //Gets the key at position i, then the reagent amount of that key, then multiplies it by stack size
|
||||
|
||||
/obj/item/stack/grind_requirements()
|
||||
if(is_cyborg)
|
||||
@@ -247,7 +247,7 @@
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/item/stack/proc/use(used, transfer = FALSE) // return 0 = borked; return 1 = had enough
|
||||
/obj/item/stack/use(used, transfer = FALSE) // return 0 = borked; return 1 = had enough
|
||||
if(zero_amount())
|
||||
return 0
|
||||
if (is_cyborg)
|
||||
@@ -260,6 +260,20 @@
|
||||
update_weight()
|
||||
return 1
|
||||
|
||||
/obj/item/stack/tool_use_check(mob/living/user, amount)
|
||||
if(get_amount() < amount)
|
||||
if(singular_name)
|
||||
if(amount > 1)
|
||||
to_chat(user, "<span class='warning'>You need at least [amount] [singular_name]\s to do this!</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need at least [amount] [singular_name] to do this!</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need at least [amount] to do this!</span>")
|
||||
|
||||
return FALSE
|
||||
|
||||
return TRUE
|
||||
|
||||
/obj/item/stack/proc/zero_amount()
|
||||
if(is_cyborg)
|
||||
return source.energy < cost
|
||||
|
||||
@@ -21,18 +21,15 @@
|
||||
/obj/item/stack/tile/attackby(obj/item/W, mob/user, params)
|
||||
|
||||
if (istype(W, /obj/item/weldingtool))
|
||||
var/obj/item/weldingtool/WT = W
|
||||
|
||||
if(get_amount() < 4)
|
||||
to_chat(user, "<span class='warning'>You need at least four tiles to do this!</span>")
|
||||
return
|
||||
|
||||
if(WT.is_hot() && !mineralType)
|
||||
if(!mineralType)
|
||||
to_chat(user, "<span class='warning'>You can not reform this!</span>")
|
||||
return
|
||||
|
||||
if(WT.remove_fuel(0,user))
|
||||
|
||||
if(W.use_tool(src, user, 0, volume=40))
|
||||
if(mineralType == "plasma")
|
||||
atmos_spawn_air("plasma=5;TEMP=1000")
|
||||
user.visible_message("<span class='warning'>[user.name] sets the plasma tiles on fire!</span>", \
|
||||
|
||||
@@ -34,17 +34,17 @@
|
||||
/obj/item/storage/secure/attackby(obj/item/W, mob/user, params)
|
||||
if(locked)
|
||||
if (istype(W, /obj/item/screwdriver))
|
||||
if (do_after(user, 20*W.toolspeed, target = user))
|
||||
if (W.use_tool(src, user, 20))
|
||||
open =! open
|
||||
to_chat(user, "<span class='notice'>You [open ? "open" : "close"] the service panel.</span>")
|
||||
return
|
||||
if (istype(W, /obj/item/wirecutters) || istype(W, /obj/item/card/emag))
|
||||
if (istype(W, /obj/item/wirecutters))
|
||||
to_chat(user, "<span class='danger'>[src] is protected from this sort of tampering, yet it appears the internal memory wires can still be <b>pulsed</b>.</span>")
|
||||
if ((istype(W, /obj/item/device/multitool)) && (!l_hacking))
|
||||
if(src.open == 1)
|
||||
to_chat(user, "<span class='danger'>Now attempting to reset internal memory, please hold.</span>")
|
||||
src.l_hacking = 1
|
||||
if (do_after(usr, 400*W.toolspeed, target = user))
|
||||
if (W.use_tool(src, user, 400))
|
||||
to_chat(user, "<span class='danger'>Internal memory reset - lock has been disengaged.</span>")
|
||||
src.l_set = 0
|
||||
src.l_hacking = 0
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
materials = list(MAT_METAL=75)
|
||||
attack_verb = list("stabbed")
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
usesound = 'sound/items/screwdriver.ogg'
|
||||
usesound = list('sound/items/screwdriver.ogg', 'sound/items/screwdriver2.ogg')
|
||||
tool_behaviour = TOOL_SCREWDRIVER
|
||||
toolspeed = 1
|
||||
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 30)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
force = 3
|
||||
throwforce = 5
|
||||
hitsound = "swing_hit"
|
||||
usesound = 'sound/items/welder.ogg'
|
||||
usesound = list('sound/items/welder.ogg', 'sound/items/welder2.ogg')
|
||||
var/acti_sound = 'sound/items/welderactivate.ogg'
|
||||
var/deac_sound = 'sound/items/welderdeactivate.ogg'
|
||||
throw_speed = 3
|
||||
@@ -73,7 +73,7 @@
|
||||
damtype = "fire"
|
||||
++burned_fuel_for
|
||||
if(burned_fuel_for >= WELDER_FUEL_BURN_INTERVAL)
|
||||
remove_fuel(1)
|
||||
use(1)
|
||||
update_icon()
|
||||
|
||||
//This is to start fires. process() is only called if the welder is on.
|
||||
@@ -107,10 +107,10 @@
|
||||
var/obj/item/bodypart/affecting = H.get_bodypart(check_zone(user.zone_selected))
|
||||
|
||||
if(affecting && affecting.status == BODYPART_ROBOTIC && user.a_intent != INTENT_HARM)
|
||||
if(src.remove_fuel(1))
|
||||
playsound(loc, usesound, 50, 1)
|
||||
if(src.use_tool(H, user, 0, volume=50, amount=1))
|
||||
if(user == H)
|
||||
user.visible_message("<span class='notice'>[user] starts to fix some of the dents on [H]'s [affecting.name].</span>", "<span class='notice'>You start fixing some of the dents on [H]'s [affecting.name].</span>")
|
||||
user.visible_message("<span class='notice'>[user] starts to fix some of the dents on [H]'s [affecting.name].</span>",
|
||||
"<span class='notice'>You start fixing some of the dents on [H]'s [affecting.name].</span>")
|
||||
if(!do_mob(user, H, 50))
|
||||
return
|
||||
item_heal_robotic(H, user, 15, 0)
|
||||
@@ -125,8 +125,8 @@
|
||||
reagents.trans_to(O, reagents.total_volume)
|
||||
to_chat(user, "<span class='notice'>You empty [src]'s fuel tank into [O].</span>")
|
||||
update_icon()
|
||||
if(welding)
|
||||
remove_fuel(1)
|
||||
if(isOn())
|
||||
use(1)
|
||||
var/turf/location = get_turf(user)
|
||||
location.hotspot_expose(700, 50, 1)
|
||||
if(get_fuel() <= 0)
|
||||
@@ -150,26 +150,23 @@
|
||||
update_icon()
|
||||
|
||||
|
||||
//Returns the amount of fuel in the welder
|
||||
// Returns the amount of fuel in the welder
|
||||
/obj/item/weldingtool/proc/get_fuel()
|
||||
return reagents.get_reagent_amount("welding_fuel")
|
||||
|
||||
|
||||
//Removes fuel from the welding tool. If a mob is passed, it will try to flash the mob's eyes. This should probably be renamed to use()
|
||||
/obj/item/weldingtool/proc/remove_fuel(amount = 1, mob/living/M = null)
|
||||
if(!welding || !check_fuel())
|
||||
return 0
|
||||
if(amount)
|
||||
// Uses fuel from the welding tool.
|
||||
/obj/item/weldingtool/use(used = 0)
|
||||
if(!isOn() || !check_fuel())
|
||||
return FALSE
|
||||
|
||||
if(used)
|
||||
burned_fuel_for = 0
|
||||
if(get_fuel() >= amount)
|
||||
reagents.remove_reagent("welding_fuel", amount)
|
||||
if(get_fuel() >= used)
|
||||
reagents.remove_reagent("welding_fuel", used)
|
||||
check_fuel()
|
||||
if(M)
|
||||
M.flash_act(light_intensity)
|
||||
return TRUE
|
||||
else
|
||||
if(M)
|
||||
to_chat(M, "<span class='warning'>You need more welding fuel to complete this task!</span>")
|
||||
return FALSE
|
||||
|
||||
|
||||
@@ -231,6 +228,24 @@
|
||||
/obj/item/weldingtool/proc/isOn()
|
||||
return welding
|
||||
|
||||
// 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_act(light_intensity)
|
||||
|
||||
// If welding tool ran out of fuel during a construction task, construction fails.
|
||||
/obj/item/weldingtool/tool_use_check(mob/living/user, amount)
|
||||
if(!isOn() || !check_fuel())
|
||||
to_chat(user, "<span class='warning'>[src] has to be on to complete this task!</span>")
|
||||
return FALSE
|
||||
|
||||
if(get_fuel() >= amount)
|
||||
return TRUE
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need more welding fuel to complete this task!</span>")
|
||||
return FALSE
|
||||
|
||||
|
||||
/obj/item/weldingtool/proc/flamethrower_screwdriver(obj/item/I, mob/user)
|
||||
if(welding)
|
||||
@@ -260,10 +275,10 @@
|
||||
to_chat(user, "<span class='warning'>You need one rod to start building a flamethrower!</span>")
|
||||
|
||||
/obj/item/weldingtool/ignition_effect(atom/A, mob/user)
|
||||
if(welding && remove_fuel(1, user))
|
||||
. = "<span class='notice'>[user] casually lights [A] with [src], what a badass.</span>"
|
||||
if(use_tool(A, user, 0, amount=1))
|
||||
return "<span class='notice'>[user] casually lights [A] with [src], what a badass.</span>"
|
||||
else
|
||||
. = ""
|
||||
return ""
|
||||
|
||||
/obj/item/weldingtool/largetank
|
||||
name = "industrial welding tool"
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
name = "crushed can"
|
||||
icon_state = "cola"
|
||||
resistance_flags = NONE
|
||||
grind_results = list("aluminum" = 10)
|
||||
grind_results = list("aluminium" = 10)
|
||||
|
||||
/obj/item/trash/attack(mob/M, mob/living/user)
|
||||
return
|
||||
@@ -81,4 +81,4 @@
|
||||
/obj/item/trash/coal/burn()
|
||||
visible_message("[src] fuses into a diamond! Someone wasn't so naughty after all...")
|
||||
new /obj/item/stack/ore/diamond(loc)
|
||||
qdel(src)
|
||||
qdel(src)
|
||||
|
||||
Reference in New Issue
Block a user