Merge pull request #5468 from Anewbe/is_tool

Hopefully Unnoticeable Tool Refactor
This commit is contained in:
Atermonera
2018-08-07 22:06:20 -07:00
committed by GitHub
301 changed files with 4105 additions and 4244 deletions
+1 -1
View File
@@ -102,7 +102,7 @@
if((!A.secured) && (!secured))
attach_assembly(A,user)
return
if(isscrewdriver(W))
if(W.is_screwdriver())
if(toggle_secure())
to_chat(user, "<span class='notice'>\The [src] is ready!</span>")
else
+1 -1
View File
@@ -144,7 +144,7 @@
/obj/item/device/assembly_holder/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(isscrewdriver(W))
if(W.is_screwdriver())
if(!a_left || !a_right)
to_chat(user, "<span class='warning'> BUG:Assembly part missing, please report this!</span>")
return
+2 -2
View File
@@ -15,7 +15,7 @@
return
/obj/item/assembly/shock_kit/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/wrench) && !status)
if(W.is_wrench() && !status)
var/turf/T = loc
if(ismob(T))
T = T.loc
@@ -27,7 +27,7 @@
part2 = null
qdel(src)
return
if(istype(W, /obj/item/weapon/screwdriver))
if(W.is_screwdriver())
status = !status
to_chat(user, "<span class='notice'>[src] is now [status ? "secured" : "unsecured"]!</span>")
playsound(src, W.usesound, 50, 1)
+1 -1
View File
@@ -231,7 +231,7 @@
return 0 // return 1 to cancel attack_hand()
/*/obj/item/clothing/gloves/attackby(obj/item/weapon/W, mob/user)
if(istype(W, /obj/item/weapon/wirecutters) || istype(W, /obj/item/weapon/scalpel))
if(W.is_wirecutter() || istype(W, /obj/item/weapon/scalpel))
if (clipped)
user << "<span class='notice'>The [src] have already been clipped!</span>"
update_icon()
+3 -1
View File
@@ -4,11 +4,13 @@
icon_state = "boxing"
item_state_slots = list(slot_r_hand_str = "red", slot_l_hand_str = "red")
/*
/obj/item/clothing/gloves/boxing/attackby(obj/item/weapon/W, mob/user)
if(istype(W, /obj/item/weapon/wirecutters) || istype(W, /obj/item/weapon/surgical/scalpel))
if(W.is_wirecutter() || istype(W, /obj/item/weapon/surgical/scalpel))
user << "<span class='notice'>That won't work.</span>" //Nope
return
..()
*/
/obj/item/clothing/gloves/boxing/green
icon_state = "boxinggreen"
@@ -1,6 +1,6 @@
/obj/item/weapon/rig/attackby(obj/item/W as obj, mob/living/user as mob)
if(!istype(user)) return 0
if(!istype(user))
return 0
if(electrified != 0)
if(shock(user)) //Handles removing charge from the cell, as well. No need to do that here.
@@ -14,78 +14,79 @@
if(W.GetID())
if(subverted)
locked = 0
user << "<span class='danger'>It looks like the locking system has been shorted out.</span>"
to_chat(user, "<span class='danger'>It looks like the locking system has been shorted out.</span>")
return
if((!req_access || !req_access.len) && (!req_one_access || !req_one_access.len))
locked = 0
user << "<span class='danger'>\The [src] doesn't seem to have a locking mechanism.</span>"
to_chat(user, "<span class='danger'>\The [src] doesn't seem to have a locking mechanism.</span>")
return
if(security_check_enabled && !src.allowed(user))
user << "<span class='danger'>Access denied.</span>"
to_chat(user, "<span class='danger'>Access denied.</span>")
return
locked = !locked
user << "You [locked ? "lock" : "unlock"] \the [src] access panel."
to_chat(user, "You [locked ? "lock" : "unlock"] \the [src] access panel.")
return
else if(istype(W,/obj/item/weapon/crowbar))
else if(W.is_crowbar())
if(!open && locked)
user << "The access panel is locked shut."
to_chat(user, "The access panel is locked shut.")
return
open = !open
user << "You [open ? "open" : "close"] the access panel."
to_chat(user, "You [open ? "open" : "close"] the access panel.")
return
if(open)
// Hacking.
if(istype(W,/obj/item/weapon/wirecutters) || istype(W,/obj/item/device/multitool))
if(W.is_wirecutter() || istype(W, /obj/item/device/multitool))
if(open)
wires.Interact(user)
else
user << "You can't reach the wiring."
to_chat(user, "You can't reach the wiring.")
return
// Air tank.
if(istype(W,/obj/item/weapon/tank)) //Todo, some kind of check for suits without integrated air supplies.
if(air_supply)
user << "\The [src] already has a tank installed."
to_chat(user, "\The [src] already has a tank installed.")
return
if(!user.unEquip(W))
return
if(!user.unEquip(W)) return
air_supply = W
W.forceMove(src)
user << "You slot [W] into [src] and tighten the connecting valve."
to_chat(user, "You slot [W] into [src] and tighten the connecting valve.")
return
// Check if this is a hardsuit upgrade or a modification.
else if(istype(W,/obj/item/rig_module))
if(istype(src.loc,/mob/living/carbon/human))
var/mob/living/carbon/human/H = src.loc
if(H.back == src)
user << "<span class='danger'>You can't install a hardsuit module while the suit is being worn.</span>"
to_chat(user, "<span class='danger'>You can't install a hardsuit module while the suit is being worn.</span>")
return 1
if(!installed_modules) installed_modules = list()
if(!installed_modules)
installed_modules = list()
if(installed_modules.len)
for(var/obj/item/rig_module/installed_mod in installed_modules)
if(!installed_mod.redundant && istype(installed_mod,W))
user << "The hardsuit already has a module of that class installed."
to_chat(user, "The hardsuit already has a module of that class installed.")
return 1
var/obj/item/rig_module/mod = W
user << "You begin installing \the [mod] into \the [src]."
to_chat(user, "You begin installing \the [mod] into \the [src].")
if(!do_after(user,40))
return
if(!user || !W)
return
if(!user.unEquip(mod)) return
user << "You install \the [mod] into \the [src]."
if(!user.unEquip(mod))
return
to_chat(user, "You install \the [mod] into \the [src].")
installed_modules |= mod
mod.forceMove(src)
mod.installed(src)
@@ -94,27 +95,28 @@
else if(!cell && istype(W,/obj/item/weapon/cell))
if(!user.unEquip(W)) return
user << "You jack \the [W] into \the [src]'s battery mount."
if(!user.unEquip(W))
return
to_chat(user, "You jack \the [W] into \the [src]'s battery mount.")
W.forceMove(src)
src.cell = W
return
else if(istype(W,/obj/item/weapon/wrench))
else if(W.is_wrench())
if(!air_supply)
user << "There is not tank to remove."
to_chat(user, "There is not tank to remove.")
return
if(user.r_hand && user.l_hand)
air_supply.forceMove(get_turf(user))
else
user.put_in_hands(air_supply)
user << "You detach and remove \the [air_supply]."
to_chat(user, "You detach and remove \the [air_supply].")
air_supply = null
return
else if(istype(W,/obj/item/weapon/screwdriver))
else if(W.is_screwdriver())
var/list/current_mounts = list()
if(cell) current_mounts += "cell"
@@ -127,7 +129,7 @@
if(istype(src.loc,/mob/living/carbon/human) && to_remove != "cell")
var/mob/living/carbon/human/H = src.loc
if(H.back == src)
user << "You can't remove an installed device while the hardsuit is being worn."
to_chat(user, "You can't remove an installed device while the hardsuit is being worn.")
return
switch(to_remove)
@@ -135,7 +137,7 @@
if("cell")
if(cell)
user << "You detatch \the [cell] from \the [src]'s battery mount."
to_chat(user, "You detatch \the [cell] from \the [src]'s battery mount.")
for(var/obj/item/rig_module/module in installed_modules)
module.deactivate()
if(user.r_hand && user.l_hand)
@@ -144,7 +146,7 @@
cell.forceMove(user.put_in_hands(cell))
cell = null
else
user << "There is nothing loaded in that mount."
to_chat(user, "There is nothing loaded in that mount.")
if("system module")
@@ -155,7 +157,7 @@
possible_removals[module.name] = module
if(!possible_removals.len)
user << "There are no installed modules to remove."
to_chat(user, "There are no installed modules to remove.")
return
var/removal_choice = input("Which module would you like to remove?") as null|anything in possible_removals
@@ -163,7 +165,7 @@
return
var/obj/item/rig_module/removed = possible_removals[removal_choice]
user << "You detatch \the [removed] from \the [src]."
to_chat(user, "You detatch \the [removed] from \the [src].")
removed.forceMove(get_turf(src))
removed.removed()
installed_modules -= removed
@@ -192,5 +194,5 @@
req_one_access.Cut()
locked = 0
subverted = 1
user << "<span class='danger'>You short out the access protocol for the suit.</span>"
to_chat(user, "<span class='danger'>You short out the access protocol for the suit.</span>")
return 1
@@ -14,8 +14,8 @@
siemens_coefficient= 0.5
armor = list(melee = 60, bullet = 50, laser = 30,energy = 15, bomb = 30, bio = 100, rad = 100)
allowed = list(/obj/item/device/flashlight, /obj/item/weapon/tank, /obj/item/device/t_scanner, /obj/item/weapon/rcd, /obj/item/weapon/crowbar, \
/obj/item/weapon/screwdriver, /obj/item/weapon/weldingtool, /obj/item/weapon/wirecutters, /obj/item/weapon/wrench, /obj/item/device/multitool, \
allowed = list(/obj/item/device/flashlight, /obj/item/weapon/tank, /obj/item/device/t_scanner, /obj/item/weapon/rcd, /obj/item/weapon/tool/crowbar, \
/obj/item/weapon/tool/screwdriver, /obj/item/weapon/weldingtool, /obj/item/weapon/tool/wirecutters, /obj/item/weapon/tool/wrench, /obj/item/device/multitool, \
/obj/item/device/radio, /obj/item/device/analyzer,/obj/item/weapon/storage/briefcase/inflatable, /obj/item/weapon/melee/baton, /obj/item/weapon/gun, \
/obj/item/weapon/storage/firstaid, /obj/item/weapon/reagent_containers/hypospray, /obj/item/roller)
+38 -35
View File
@@ -68,9 +68,9 @@
var/list/part_list = new
for(var/obj/item/I in list(helmet,boots,tank,cooler))
part_list += "\a [I]"
user << "\The [src] has [english_list(part_list)] installed."
to_chat(user, "\The [src] has [english_list(part_list)] installed.")
if(tank && in_range(src,user))
user << "<span class='notice'>The wrist-mounted pressure gauge reads [max(round(tank.air_contents.return_pressure()),0)] kPa remaining in \the [tank].</span>"
to_chat(user, "<span class='notice'>The wrist-mounted pressure gauge reads [max(round(tank.air_contents.return_pressure()),0)] kPa remaining in \the [tank].</span>")
/obj/item/clothing/suit/space/void/refit_for_species(var/target_species)
..()
@@ -95,23 +95,23 @@
if(helmet)
if(H.head)
M << "You are unable to deploy your suit's helmet as \the [H.head] is in the way."
to_chat(M, "You are unable to deploy your suit's helmet as \the [H.head] is in the way.")
else if (H.equip_to_slot_if_possible(helmet, slot_head))
M << "Your suit's helmet deploys with a hiss."
to_chat(M, "Your suit's helmet deploys with a hiss.")
helmet.canremove = 0
if(tank)
if(H.s_store) //In case someone finds a way.
M << "Alarmingly, the valve on your suit's installed tank fails to engage."
to_chat(M, "Alarmingly, the valve on your suit's installed tank fails to engage.")
else if (H.equip_to_slot_if_possible(tank, slot_s_store))
M << "The valve on your suit's installed tank safely engages."
to_chat(M, "The valve on your suit's installed tank safely engages.")
tank.canremove = 0
if(cooler)
if(H.s_store) //Ditto
M << "Alarmingly, the cooling unit installed into your suit fails to deploy."
to_chat(M, "Alarmingly, the cooling unit installed into your suit fails to deploy.")
else if (H.equip_to_slot_if_possible(cooler, slot_s_store))
M << "Your suit's cooling unit deploys."
to_chat(M, "Your suit's cooling unit deploys.")
cooler.canremove = 0
@@ -153,28 +153,31 @@
if(!istype(src.loc,/mob/living)) return
if(!helmet)
usr << "There is no helmet installed."
to_chat(usr, "There is no helmet installed.")
return
var/mob/living/carbon/human/H = usr
if(!istype(H)) return
if(H.stat) return
if(H.wear_suit != src) return
if(!istype(H))
return
if(H.stat)
return
if(H.wear_suit != src)
return
if(H.head == helmet)
H << "<span class='notice'>You retract your suit helmet.</span>"
to_chat(H, "<span class='notice'>You retract your suit helmet.</span>")
helmet.canremove = 1
H.drop_from_inventory(helmet)
helmet.forceMove(src)
else
if(H.head)
H << "<span class='danger'>You cannot deploy your helmet while wearing \the [H.head].</span>"
to_chat(H, "<span class='danger'>You cannot deploy your helmet while wearing \the [H.head].</span>")
return
if(H.equip_to_slot_if_possible(helmet, slot_head))
helmet.pickup(H)
helmet.canremove = 0
H << "<span class='info'>You deploy your suit helmet, sealing you off from the world.</span>"
to_chat(H, "<span class='info'>You deploy your suit helmet, sealing you off from the world.</span>")
helmet.update_light(H)
/obj/item/clothing/suit/space/void/verb/eject_tank()
@@ -186,7 +189,7 @@
if(!istype(src.loc,/mob/living)) return
if(!tank && !cooler)
usr << "There is no tank or cooling unit inserted."
to_chat(usr, "There is no tank or cooling unit inserted.")
return
var/mob/living/carbon/human/H = usr
@@ -202,7 +205,7 @@
else
removing = cooler
cooler = null
H << "<span class='info'>You press the emergency release, ejecting \the [removing] from your suit.</span>"
to_chat(H, "<span class='info'>You press the emergency release, ejecting \the [removing] from your suit.</span>")
removing.canremove = 1
H.drop_from_inventory(removing)
@@ -214,75 +217,75 @@
return ..()
if(istype(src.loc,/mob/living))
user << "<span class='warning'>You cannot modify \the [src] while it is being worn.</span>"
to_chat(user, "<span class='warning'>You cannot modify \the [src] while it is being worn.</span>")
return
if(istype(W,/obj/item/weapon/screwdriver))
if(W.is_screwdriver())
if(helmet || boots || tank)
var/choice = input("What component would you like to remove?") as null|anything in list(helmet,boots,tank,cooler)
if(!choice) return
if(choice == tank) //No, a switch doesn't work here. Sorry. ~Techhead
user << "You pop \the [tank] out of \the [src]'s storage compartment."
to_chat(user, "You pop \the [tank] out of \the [src]'s storage compartment.")
tank.forceMove(get_turf(src))
playsound(src, W.usesound, 50, 1)
src.tank = null
else if(choice == cooler)
user << "You pop \the [cooler] out of \the [src]'s storage compartment."
to_chat(user, "You pop \the [cooler] out of \the [src]'s storage compartment.")
cooler.forceMove(get_turf(src))
playsound(src, W.usesound, 50, 1)
src.cooler = null
else if(choice == helmet)
user << "You detatch \the [helmet] from \the [src]'s helmet mount."
to_chat(user, "You detatch \the [helmet] from \the [src]'s helmet mount.")
helmet.forceMove(get_turf(src))
playsound(src, W.usesound, 50, 1)
src.helmet = null
else if(choice == boots)
user << "You detatch \the [boots] from \the [src]'s boot mounts."
to_chat(user, "You detatch \the [boots] from \the [src]'s boot mounts.")
boots.forceMove(get_turf(src))
playsound(src, W.usesound, 50, 1)
src.boots = null
else
user << "\The [src] does not have anything installed."
to_chat(user, "\The [src] does not have anything installed.")
return
else if(istype(W,/obj/item/clothing/head/helmet/space))
if(helmet)
user << "\The [src] already has a helmet installed."
to_chat(user, "\The [src] already has a helmet installed.")
else
user << "You attach \the [W] to \the [src]'s helmet mount."
to_chat(user, "You attach \the [W] to \the [src]'s helmet mount.")
user.drop_item()
W.forceMove(src)
src.helmet = W
return
else if(istype(W,/obj/item/clothing/shoes/magboots))
if(boots)
user << "\The [src] already has magboots installed."
to_chat(user, "\The [src] already has magboots installed.")
else
user << "You attach \the [W] to \the [src]'s boot mounts."
to_chat(user, "You attach \the [W] to \the [src]'s boot mounts.")
user.drop_item()
W.forceMove(src)
boots = W
return
else if(istype(W,/obj/item/weapon/tank))
if(tank)
user << "\The [src] already has an airtank installed."
to_chat(user, "\The [src] already has an airtank installed.")
else if(cooler)
user << "\The [src]'s suit cooling unit is in the way. Remove it first."
to_chat(user, "\The [src]'s suit cooling unit is in the way. Remove it first.")
else if(istype(W,/obj/item/weapon/tank/phoron))
user << "\The [W] cannot be inserted into \the [src]'s storage compartment."
to_chat(user, "\The [W] cannot be inserted into \the [src]'s storage compartment.")
else
user << "You insert \the [W] into \the [src]'s storage compartment."
to_chat(user, "You insert \the [W] into \the [src]'s storage compartment.")
user.drop_item()
W.forceMove(src)
tank = W
return
else if(istype(W,/obj/item/device/suit_cooling_unit))
if(cooler)
user << "\The [src] already has a suit cooling unit installed."
to_chat(user, "\The [src] already has a suit cooling unit installed.")
else if(tank)
user << "\The [src]'s airtank is in the way. Remove it first."
to_chat(user, "\The [src]'s airtank is in the way. Remove it first.")
else
user << "You insert \the [W] into \the [src]'s storage compartment."
to_chat(user, "You insert \the [W] into \the [src]'s storage compartment.")
user.drop_item()
W.forceMove(src)
cooler = W
+1 -1
View File
@@ -160,7 +160,7 @@
icon_state = "hazard"
blood_overlay_type = "armor"
allowed = list (/obj/item/device/analyzer, /obj/item/device/flashlight, /obj/item/device/multitool, /obj/item/device/pipe_painter, /obj/item/device/radio, /obj/item/device/t_scanner,
/obj/item/weapon/crowbar, /obj/item/weapon/screwdriver, /obj/item/weapon/weldingtool, /obj/item/weapon/wirecutters, /obj/item/weapon/wrench, /obj/item/weapon/tank/emergency/oxygen,
/obj/item/weapon/tool/crowbar, /obj/item/weapon/tool/screwdriver, /obj/item/weapon/weldingtool, /obj/item/weapon/tool/wirecutters, /obj/item/weapon/tool/wrench, /obj/item/weapon/tank/emergency/oxygen,
/obj/item/clothing/mask/gas, /obj/item/taperoll/engineering)
body_parts_covered = UPPER_TORSO
+4 -4
View File
@@ -166,7 +166,7 @@
/obj/machinery/cash_register/attackby(obj/O as obj, user as mob)
/obj/machinery/cash_register/attackby(obj/item/O as obj, user as mob)
// Check for a method of paying (ID, PDA, e-wallet, cash, ect.)
var/obj/item/weapon/card/id/I = O.GetID()
if(I)
@@ -188,8 +188,8 @@
scan_cash(SC)
else if(istype(O, /obj/item/weapon/card/emag))
return ..()
else if(istype(O, /obj/item/weapon/wrench))
var/obj/item/weapon/wrench/W = O
else if(O.is_wrench())
var/obj/item/weapon/tool/wrench/W = O
toggle_anchors(W, user)
// Not paying: Look up price and add it to transaction_amount
else
@@ -479,7 +479,7 @@
usr << "<span class='warning'>The cash box is locked.</span>"
/obj/machinery/cash_register/proc/toggle_anchors(obj/item/weapon/wrench/W, mob/user)
/obj/machinery/cash_register/proc/toggle_anchors(obj/item/weapon/tool/wrench/W, mob/user)
if(manipulating) return
manipulating = 1
if(!anchored)
+18 -17
View File
@@ -128,7 +128,8 @@
item_state = "boxing"
/obj/structure/window/reinforced/holowindow/attackby(obj/item/W as obj, mob/user as mob)
if(!istype(W)) return//I really wish I did not need this
if(!istype(W))
return//I really wish I did not need this
if (istype(W, /obj/item/weapon/grab) && get_dist(src,user)<2)
var/obj/item/weapon/grab/G = W
if(istype(G.affecting,/mob/living))
@@ -155,12 +156,12 @@
if(W.flags & NOBLUDGEON) return
if(istype(W, /obj/item/weapon/screwdriver))
user << ("<span class='notice'>It's a holowindow, you can't unfasten it!</span>")
else if(istype(W, /obj/item/weapon/crowbar) && reinf && state <= 1)
user << ("<span class='notice'>It's a holowindow, you can't pry it!</span>")
else if(istype(W, /obj/item/weapon/wrench) && !anchored && (!state || !reinf))
user << ("<span class='notice'>It's a holowindow, you can't dismantle it!</span>")
if(W.is_screwdriver())
to_chat(user, "<span class='notice'>It's a holowindow, you can't unfasten it!</span>")
else if(W.is_crowbar() && reinf && state <= 1)
to_chat(user, "<span class='notice'>It's a holowindow, you can't pry it!</span>")
else if(W.is_wrench() && !anchored && (!state || !reinf))
to_chat(user, "<span class='notice'>It's a holowindow, you can't dismantle it!</span>")
else
if(W.damtype == BRUTE || W.damtype == BURN)
hit(W.force)
@@ -216,8 +217,8 @@
qdel(src)
/obj/structure/bed/chair/holochair/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/wrench))
user << ("<span class='notice'>It's a holochair, you can't dismantle it!</span>")
if(W.is_wrench())
to_chat(user, "<span class='notice'>It's a holochair, you can't dismantle it!</span>")
return
/obj/item/weapon/holo
@@ -269,13 +270,13 @@
icon_state = "sword[item_color]"
w_class = ITEMSIZE_LARGE
playsound(user, 'sound/weapons/saberon.ogg', 50, 1)
user << "<span class='notice'>[src] is now active.</span>"
to_chat(user, "<span class='notice'>[src] is now active.</span>")
else
force = 3
icon_state = "sword0"
w_class = ITEMSIZE_SMALL
playsound(user, 'sound/weapons/saberoff.ogg', 50, 1)
user << "<span class='notice'>[src] can now be concealed.</span>"
to_chat(user, "<span class='notice'>[src] can now be concealed.</span>")
if(istype(user,/mob/living/carbon/human))
var/mob/living/carbon/human/H = user
@@ -307,7 +308,7 @@
if (istype(W, /obj/item/weapon/grab) && get_dist(src,user)<2)
var/obj/item/weapon/grab/G = W
if(G.state<2)
user << "<span class='warning'>You need a better grip to do that!</span>"
to_chat(user, "<span class='warning'>You need a better grip to do that!</span>")
return
G.affecting.loc = src.loc
G.affecting.Weaken(5)
@@ -350,7 +351,7 @@
power_channel = ENVIRON
/obj/machinery/readybutton/attack_ai(mob/user as mob)
user << "The station AI is not to interact with these devices!"
to_chat(user, "The station AI is not to interact with these devices!")
return
/obj/machinery/readybutton/New()
@@ -358,12 +359,12 @@
/obj/machinery/readybutton/attackby(obj/item/weapon/W as obj, mob/user as mob)
user << "The device is a solid button, there's nothing you can do with it!"
to_chat(user, "The device is a solid button, there's nothing you can do with it!")
/obj/machinery/readybutton/attack_hand(mob/user as mob)
if(user.stat || stat & (NOPOWER|BROKEN))
user << "This device is not powered."
to_chat(user, "This device is not powered.")
return
if(!user.IsAdvancedToolUser())
@@ -374,7 +375,7 @@
qdel(src)
if(eventstarted)
usr << "The event has already begun!"
to_chat(usr, "The event has already begun!")
return
ready = !ready
@@ -405,7 +406,7 @@
qdel(W)
for(var/mob/M in currentarea)
M << "FIGHT!"
to_chat(M, "FIGHT!")
// A window that disappears when the ready button is pressed
/obj/structure/window/reinforced/holowindow/disappearing
+27 -27
View File
@@ -33,22 +33,22 @@
/obj/machinery/beehive/examine(var/mob/user)
..()
if(!closed)
user << "The lid is open."
to_chat(user, "The lid is open.")
/obj/machinery/beehive/attackby(var/obj/item/I, var/mob/user)
if(istype(I, /obj/item/weapon/crowbar))
if(I.is_crowbar())
closed = !closed
user.visible_message("<span class='notice'>[user] [closed ? "closes" : "opens"] \the [src].</span>", "<span class='notice'>You [closed ? "close" : "open"] \the [src].</span>")
update_icon()
return
else if(istype(I, /obj/item/weapon/wrench))
else if(I.is_wrench())
anchored = !anchored
playsound(loc, I.usesound, 50, 1)
user.visible_message("<span class='notice'>[user] [anchored ? "wrenches" : "unwrenches"] \the [src].</span>", "<span class='notice'>You [anchored ? "wrench" : "unwrench"] \the [src].</span>")
return
else if(istype(I, /obj/item/bee_smoker))
if(closed)
user << "<span class='notice'>You need to open \the [src] with a crowbar before smoking the bees.</span>"
to_chat(user, "<span class='notice'>You need to open \the [src] with a crowbar before smoking the bees.</span>")
return
user.visible_message("<span class='notice'>[user] smokes the bees in \the [src].</span>", "<span class='notice'>You smoke the bees in \the [src].</span>")
smoked = 30
@@ -56,14 +56,14 @@
return
else if(istype(I, /obj/item/honey_frame))
if(closed)
user << "<span class='notice'>You need to open \the [src] with a crowbar before inserting \the [I].</span>"
to_chat(user, "<span class='notice'>You need to open \the [src] with a crowbar before inserting \the [I].</span>")
return
if(frames >= maxFrames)
user << "<span class='notice'>There is no place for an another frame.</span>"
to_chat(user, "<span class='notice'>There is no place for an another frame.</span>")
return
var/obj/item/honey_frame/H = I
if(H.honey)
user << "<span class='notice'>\The [I] is full with beeswax and honey, empty it in the extractor first.</span>"
to_chat(user, "<span class='notice'>\The [I] is full with beeswax and honey, empty it in the extractor first.</span>")
return
++frames
user.visible_message("<span class='notice'>[user] loads \the [I] into \the [src].</span>", "<span class='notice'>You load \the [I] into \the [src].</span>")
@@ -74,16 +74,16 @@
else if(istype(I, /obj/item/bee_pack))
var/obj/item/bee_pack/B = I
if(B.full && bee_count)
user << "<span class='notice'>\The [src] already has bees inside.</span>"
to_chat(user, "<span class='notice'>\The [src] already has bees inside.</span>")
return
if(!B.full && bee_count < 90)
user << "<span class='notice'>\The [src] is not ready to split.</span>"
to_chat(user, "<span class='notice'>\The [src] is not ready to split.</span>")
return
if(!B.full && !smoked)
user << "<span class='notice'>Smoke \the [src] first!</span>"
to_chat(user, "<span class='notice'>Smoke \the [src] first!</span>")
return
if(closed)
user << "<span class='notice'>You need to open \the [src] with a crowbar before moving the bees.</span>"
to_chat(user, "<span class='notice'>You need to open \the [src] with a crowbar before moving the bees.</span>")
return
if(B.full)
user.visible_message("<span class='notice'>[user] puts the queen and the bees from \the [I] into \the [src].</span>", "<span class='notice'>You put the queen and the bees from \the [I] into \the [src].</span>")
@@ -96,22 +96,22 @@
update_icon()
return
else if(istype(I, /obj/item/device/analyzer/plant_analyzer))
user << "<span class='notice'>Scan result of \the [src]...</span>"
user << "Beehive is [bee_count ? "[round(bee_count)]% full" : "empty"].[bee_count > 90 ? " Colony is ready to split." : ""]"
to_chat(user, "<span class='notice'>Scan result of \the [src]...</span>")
to_chat(user, "Beehive is [bee_count ? "[round(bee_count)]% full" : "empty"].[bee_count > 90 ? " Colony is ready to split." : ""]")
if(frames)
user << "[frames] frames installed, [round(honeycombs / 100)] filled."
to_chat(user, "[frames] frames installed, [round(honeycombs / 100)] filled.")
if(honeycombs < frames * 100)
user << "Next frame is [round(honeycombs % 100)]% full."
to_chat(user, "Next frame is [round(honeycombs % 100)]% full.")
else
user << "No frames installed."
to_chat(user, "No frames installed.")
if(smoked)
user << "The hive is smoked."
to_chat(user, "The hive is smoked.")
return 1
else if(istype(I, /obj/item/weapon/screwdriver))
else if(I.is_screwdriver())
if(bee_count)
user << "<span class='notice'>You can't dismantle \the [src] with these bees inside.</span>"
to_chat(user, "<span class='notice'>You can't dismantle \the [src] with these bees inside.</span>")
return
user << "<span class='notice'>You start dismantling \the [src]...</span>"
to_chat(user, "<span class='notice'>You start dismantling \the [src]...</span>")
playsound(src, I.usesound, 50, 1)
if(do_after(user, 30))
user.visible_message("<span class='notice'>[user] dismantles \the [src].</span>", "<span class='notice'>You dismantle \the [src].</span>")
@@ -122,10 +122,10 @@
/obj/machinery/beehive/attack_hand(var/mob/user)
if(!closed)
if(honeycombs < 100)
user << "<span class='notice'>There are no filled honeycombs.</span>"
to_chat(user, "<span class='notice'>There are no filled honeycombs.</span>")
return
if(!smoked && bee_count)
user << "<span class='notice'>The bees won't let you take the honeycombs out like this, smoke them first.</span>"
to_chat(user, "<span class='notice'>The bees won't let you take the honeycombs out like this, smoke them first.</span>")
return
user.visible_message("<span class='notice'>[user] starts taking the honeycombs out of \the [src].</span>", "<span class='notice'>You start taking the honeycombs out of \the [src]...</span>")
while(honeycombs >= 100 && do_after(user, 30))
@@ -134,7 +134,7 @@
--frames
update_icon()
if(honeycombs < 100)
user << "<span class='notice'>You take all filled honeycombs out.</span>"
to_chat(user, "<span class='notice'>You take all filled honeycombs out.</span>")
return
/obj/machinery/beehive/process()
@@ -166,12 +166,12 @@
/obj/machinery/honey_extractor/attackby(var/obj/item/I, var/mob/user)
if(processing)
user << "<span class='notice'>\The [src] is currently spinning, wait until it's finished.</span>"
to_chat(user, "<span class='notice'>\The [src] is currently spinning, wait until it's finished.</span>")
return
else if(istype(I, /obj/item/honey_frame))
var/obj/item/honey_frame/H = I
if(!H.honey)
user << "<span class='notice'>\The [H] is empty, put it into a beehive.</span>"
to_chat(user, "<span class='notice'>\The [H] is empty, put it into a beehive.</span>")
return
user.visible_message("<span class='notice'>[user] loads \the [H] into \the [src] and turns it on.</span>", "<span class='notice'>You load \the [H] into \the [src] and turn it on.</span>")
processing = H.honey
@@ -185,7 +185,7 @@
icon_state = "centrifuge"
else if(istype(I, /obj/item/weapon/reagent_containers/glass))
if(!honey)
user << "<span class='notice'>There is no honey in \the [src].</span>"
to_chat(user, "<span class='notice'>There is no honey in \the [src].</span>")
return
var/obj/item/weapon/reagent_containers/glass/G = I
var/transferred = min(G.reagents.maximum_volume - G.reagents.total_volume, honey)
@@ -226,7 +226,7 @@
icon_state = "apiary"
/obj/item/beehive_assembly/attack_self(var/mob/user)
user << "<span class='notice'>You start assembling \the [src]...</span>"
to_chat(user, "<span class='notice'>You start assembling \the [src]...</span>")
if(do_after(user, 30))
user.visible_message("<span class='notice'>[user] constructs a beehive.</span>", "<span class='notice'>You construct a beehive.</span>")
new /obj/machinery/beehive(get_turf(user))
+8 -8
View File
@@ -17,7 +17,7 @@
if(genes.len)
var/choice = alert(user, "Are you sure you want to wipe the disk?", "Xenobotany Data", "No", "Yes")
if(src && user && genes && choice && choice == "Yes" && user.Adjacent(get_turf(src)))
user << "You wipe the disk data."
to_chat(user, "You wipe the disk data.")
name = initial(name)
desc = initial(name)
genes = list()
@@ -82,16 +82,16 @@
/obj/machinery/botany/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/seeds))
if(seed)
user << "There is already a seed loaded."
to_chat(user, "There is already a seed loaded.")
return
var/obj/item/seeds/S =W
if(S.seed && S.seed.get_trait(TRAIT_IMMUTABLE) > 0)
user << "That seed is not compatible with our genetics technology."
to_chat(user, "That seed is not compatible with our genetics technology.")
else
user.drop_from_inventory(W)
W.loc = src
seed = W
user << "You load [W] into [src]."
to_chat(user, "You load [W] into [src].")
return
if(default_deconstruction_screwdriver(user, W))
@@ -100,24 +100,24 @@
return
if(istype(W,/obj/item/weapon/disk/botany))
if(loaded_disk)
user << "There is already a data disk loaded."
to_chat(user, "There is already a data disk loaded.")
return
else
var/obj/item/weapon/disk/botany/B = W
if(B.genes && B.genes.len)
if(!disk_needs_genes)
user << "That disk already has gene data loaded."
to_chat(user, "That disk already has gene data loaded.")
return
else
if(disk_needs_genes)
user << "That disk does not have any gene data loaded."
to_chat(user, "That disk does not have any gene data loaded.")
return
user.drop_from_inventory(W)
W.loc = src
loaded_disk = W
user << "You load [W] into [src]."
to_chat(user, "You load [W] into [src].")
return
..()
+5 -5
View File
@@ -482,20 +482,20 @@
if (loaded)
user.visible_message("[user] puts the seeds from \the [O.name] into \the [src].", "You put the seeds from \the [O.name] into \the [src].")
else
user << "<span class='notice'>There are no seeds in \the [O.name].</span>"
to_chat(user, "<span class='notice'>There are no seeds in \the [O.name].</span>")
return
else if(istype(O, /obj/item/weapon/wrench))
else if(O.is_wrench())
playsound(loc, O.usesound, 50, 1)
anchored = !anchored
user << "You [anchored ? "wrench" : "unwrench"] \the [src]."
else if(istype(O, /obj/item/weapon/screwdriver))
to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].")
else if(O.is_screwdriver())
panel_open = !panel_open
to_chat(user, "You [panel_open ? "open" : "close"] the maintenance panel.")
playsound(src, O.usesound, 50, 1)
overlays.Cut()
if(panel_open)
overlays += image(icon, "[initial(icon_state)]-panel")
else if((istype(O, /obj/item/weapon/wirecutters) || istype(O, /obj/item/device/multitool)) && panel_open)
else if((O.is_wirecutter() || istype(O, /obj/item/device/multitool)) && panel_open)
wires.Interact(user)
/obj/machinery/seed_storage/emag_act(var/remaining_charges, var/mob/user)
@@ -240,7 +240,7 @@
user.setClickCooldown(user.get_attack_speed(W))
plant_controller.add_plant(src)
if(istype(W, /obj/item/weapon/wirecutters) || istype(W, /obj/item/weapon/surgical/scalpel))
if(W.is_wirecutter() || istype(W, /obj/item/weapon/surgical/scalpel))
if(sampled)
user << "<span class='warning'>\The [src] has already been sampled recently.</span>"
return
+2 -2
View File
@@ -453,7 +453,7 @@
if(O.is_open_container())
return 0
if(istype(O, /obj/item/weapon/wirecutters) || istype(O, /obj/item/weapon/surgical/scalpel))
if(O.is_wirecutter() || istype(O, /obj/item/weapon/surgical/scalpel))
if(!seed)
user << "There is nothing to take a sample from in \the [src]."
@@ -548,7 +548,7 @@
qdel(O)
check_health()
else if(mechanical && istype(O, /obj/item/weapon/wrench))
else if(mechanical && O.is_wrench())
//If there's a connector here, the portable_atmospherics setup can handle it.
if(locate(/obj/machinery/atmospherics/portables_connector/) in loc)
+1 -1
View File
@@ -1,6 +1,6 @@
//Analyzer, pestkillers, weedkillers, nutrients, hatchets, cutters.
/obj/item/weapon/wirecutters/clippers
/obj/item/weapon/tool/wirecutters/clippers
name = "plant clippers"
desc = "A tool used to take samples from plants."
@@ -264,13 +264,13 @@
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
interact(user)
return TRUE
else if(istype(I, /obj/item/weapon/crowbar))
else if(I.is_crowbar())
playsound(get_turf(src), 'sound/items/Crowbar.ogg', 50, 1)
opened = !opened
to_chat(user, "<span class='notice'>You [opened ? "opened" : "closed"] \the [src].</span>")
update_icon()
return TRUE
else if(istype(I, /obj/item/device/integrated_electronics/wirer) || istype(I, /obj/item/device/integrated_electronics/debugger) || istype(I, /obj/item/weapon/screwdriver))
else if(istype(I, /obj/item/device/integrated_electronics/wirer) || istype(I, /obj/item/device/integrated_electronics/debugger) || I.is_screwdriver())
if(opened)
interact(user)
else
@@ -12,7 +12,7 @@
..()
/obj/item/device/assembly/electronic_assembly/attackby(obj/item/I as obj, mob/user as mob)
if (iscrowbar(I) )
if (I.is_crowbar())
toggle_open(user)
else if (opened)
EA.attackby(I, user)
@@ -261,11 +261,11 @@
/obj/item/weapon/storage/bag/circuits/mini,
/obj/item/device/electronic_assembly,
/obj/item/device/integrated_electronics,
/obj/item/weapon/crowbar,
/obj/item/weapon/screwdriver,
/obj/item/weapon/tool/crowbar,
/obj/item/weapon/tool/screwdriver,
/obj/item/device/multitool
)
cant_hold = list(/obj/item/weapon/screwdriver/power)
cant_hold = list(/obj/item/weapon/tool/screwdriver/power)
/obj/item/weapon/storage/bag/circuits/basic/New()
..()
@@ -290,8 +290,8 @@
new /obj/item/device/assembly/electronic_assembly(src)
new /obj/item/device/assembly/electronic_assembly(src)
new /obj/item/device/multitool(src)
new /obj/item/weapon/screwdriver(src)
new /obj/item/weapon/crowbar(src)
new /obj/item/weapon/tool/screwdriver(src)
new /obj/item/weapon/tool/crowbar(src)
make_exact_fit()
/obj/item/weapon/storage/bag/circuits/all/New()
@@ -317,7 +317,7 @@
new /obj/item/device/electronic_assembly/drone(src)
new /obj/item/device/integrated_electronics/wirer(src)
new /obj/item/device/integrated_electronics/debugger(src)
new /obj/item/weapon/crowbar(src)
new /obj/item/weapon/tool/crowbar(src)
make_exact_fit()
/obj/item/weapon/storage/bag/circuits/mini/
@@ -32,13 +32,13 @@
if(istype(O, /obj/item/weapon/gun))
var/obj/item/weapon/gun/gun = O
if(installed_gun)
user << "<span class='warning'>There's already a weapon installed.</span>"
to_chat(user, "<span class='warning'>There's already a weapon installed.</span>")
return
user.drop_from_inventory(gun)
installed_gun = gun
size += gun.w_class
gun.forceMove(src)
user << "<span class='notice'>You slide \the [gun] into the firing mechanism.</span>"
to_chat(user, "<span class='notice'>You slide \the [gun] into the firing mechanism.</span>")
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
else
..()
@@ -46,12 +46,12 @@
/obj/item/integrated_circuit/manipulation/weapon_firing/attack_self(var/mob/user)
if(installed_gun)
installed_gun.forceMove(get_turf(src))
user << "<span class='notice'>You slide \the [installed_gun] out of the firing mechanism.</span>"
to_chat(user, "<span class='notice'>You slide \the [installed_gun] out of the firing mechanism.</span>")
size = initial(size)
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
installed_gun = null
else
user << "<span class='notice'>There's no weapon to remove from the mechanism.</span>"
to_chat(user, "<span class='notice'>There's no weapon to remove from the mechanism.</span>")
/obj/item/integrated_circuit/manipulation/weapon_firing/do_work()
if(!installed_gun)
+30 -30
View File
@@ -37,15 +37,15 @@
return
else
name = ("bookcase ([newname])")
else if(istype(O,/obj/item/weapon/wrench))
else if(O.is_wrench())
playsound(loc, O.usesound, 100, 1)
user << (anchored ? "<span class='notice'>You unfasten \the [src] from the floor.</span>" : "<span class='notice'>You secure \the [src] to the floor.</span>")
to_chat(user, (anchored ? "<span class='notice'>You unfasten \the [src] from the floor.</span>" : "<span class='notice'>You secure \the [src] to the floor.</span>"))
anchored = !anchored
else if(istype(O,/obj/item/weapon/screwdriver))
else if(O.is_screwdriver())
playsound(loc, O.usesound, 75, 1)
user << "<span class='notice'>You begin dismantling \the [src].</span>"
to_chat(user, "<span class='notice'>You begin dismantling \the [src].</span>")
if(do_after(user,25 * O.toolspeed))
user << "<span class='notice'>You dismantle \the [src].</span>"
to_chat(user, "<span class='notice'>You dismantle \the [src].</span>")
new /obj/item/stack/material/wood(get_turf(src), 3)
for(var/obj/item/weapon/book/b in contents)
b.loc = (get_turf(src))
@@ -154,19 +154,19 @@
/obj/item/weapon/book/attack_self(var/mob/user as mob)
if(carved)
if(store)
user << "<span class='notice'>[store] falls out of [title]!</span>"
to_chat(user, "<span class='notice'>[store] falls out of [title]!</span>")
store.loc = get_turf(src.loc)
store = null
return
else
user << "<span class='notice'>The pages of [title] have been cut out!</span>"
to_chat(user, "<span class='notice'>The pages of [title] have been cut out!</span>")
return
if(src.dat)
user << browse("<TT><I>Penned by [author].</I></TT> <BR>" + "[dat]", "window=book")
user.visible_message("[user] opens a book titled \"[src.title]\" and begins reading intently.")
onclose(user, "book")
else
user << "This book is completely blank!"
to_chat(user, "This book is completely blank!")
/obj/item/weapon/book/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(carved)
@@ -175,24 +175,24 @@
user.drop_item()
W.loc = src
store = W
user << "<span class='notice'>You put [W] in [title].</span>"
to_chat(user, "<span class='notice'>You put [W] in [title].</span>")
return
else
user << "<span class='notice'>[W] won't fit in [title].</span>"
to_chat(user, "<span class='notice'>[W] won't fit in [title].</span>")
return
else
user << "<span class='notice'>There's already something in [title]!</span>"
to_chat(user, "<span class='notice'>There's already something in [title]!</span>")
return
if(istype(W, /obj/item/weapon/pen))
if(unique)
user << "These pages don't seem to take the ink well. Looks like you can't modify it."
to_chat(user, "These pages don't seem to take the ink well. Looks like you can't modify it.")
return
var/choice = input("What would you like to change?") in list("Title", "Contents", "Author", "Cancel")
switch(choice)
if("Title")
var/newtitle = reject_bad_text(sanitizeSafe(input("Write a new title:")))
if(!newtitle)
usr << "The title is invalid."
to_chat(usr, "The title is invalid.")
return
else
src.name = newtitle
@@ -200,14 +200,14 @@
if("Contents")
var/content = sanitize(input("Write your book's contents (HTML NOT allowed):") as message|null, MAX_BOOK_MESSAGE_LEN)
if(!content)
usr << "The content is invalid."
to_chat(usr, "The content is invalid.")
return
else
src.dat += content
if("Author")
var/newauthor = sanitize(input(usr, "Write the author's name:"))
if(!newauthor)
usr << "The name is invalid."
to_chat(usr, "The name is invalid.")
return
else
src.author = newauthor
@@ -216,37 +216,37 @@
else if(istype(W, /obj/item/weapon/barcodescanner))
var/obj/item/weapon/barcodescanner/scanner = W
if(!scanner.computer)
user << "[W]'s screen flashes: 'No associated computer found!'"
to_chat(user, "[W]'s screen flashes: 'No associated computer found!'")
else
switch(scanner.mode)
if(0)
scanner.book = src
user << "[W]'s screen flashes: 'Book stored in buffer.'"
to_chat(user, "[W]'s screen flashes: 'Book stored in buffer.'")
if(1)
scanner.book = src
scanner.computer.buffer_book = src.name
user << "[W]'s screen flashes: 'Book stored in buffer. Book title stored in associated computer buffer.'"
to_chat(user, "[W]'s screen flashes: 'Book stored in buffer. Book title stored in associated computer buffer.'")
if(2)
scanner.book = src
for(var/datum/borrowbook/b in scanner.computer.checkouts)
if(b.bookname == src.name)
scanner.computer.checkouts.Remove(b)
user << "[W]'s screen flashes: 'Book stored in buffer. Book has been checked in.'"
to_chat(user, "[W]'s screen flashes: 'Book stored in buffer. Book has been checked in.'")
return
user << "[W]'s screen flashes: 'Book stored in buffer. No active check-out record found for current title.'"
to_chat(user, "[W]'s screen flashes: 'Book stored in buffer. No active check-out record found for current title.'")
if(3)
scanner.book = src
for(var/obj/item/weapon/book in scanner.computer.inventory)
if(book == src)
user << "[W]'s screen flashes: 'Book stored in buffer. Title already present in inventory, aborting to avoid duplicate entry.'"
to_chat(user, "[W]'s screen flashes: 'Book stored in buffer. Title already present in inventory, aborting to avoid duplicate entry.'")
return
scanner.computer.inventory.Add(src)
user << "[W]'s screen flashes: 'Book stored in buffer. Title added to general inventory.'"
else if(istype(W, /obj/item/weapon/material/knife) || istype(W, /obj/item/weapon/wirecutters))
to_chat(user, "[W]'s screen flashes: 'Book stored in buffer. Title added to general inventory.'")
else if(istype(W, /obj/item/weapon/material/knife) || W.is_wirecutter())
if(carved) return
user << "<span class='notice'>You begin to carve out [title].</span>"
to_chat(user, "<span class='notice'>You begin to carve out [title].</span>")
if(do_after(user, 30))
user << "<span class='notice'>You carve out the pages from [title]! You didn't want to read it anyway.</span>"
to_chat(user, "<span class='notice'>You carve out the pages from [title]! You didn't want to read it anyway.</span>")
carved = 1
return
else
@@ -278,7 +278,7 @@
mode += 1
if(mode > 3)
mode = 0
user << "[src] Status Display:"
to_chat(user, "[src] Status Display:")
var/modedesc
switch(mode)
if(0)
@@ -291,9 +291,9 @@
modedesc = "Scan book to local buffer, attempt to add book to general inventory."
else
modedesc = "ERROR"
user << " - Mode [mode] : [modedesc]"
to_chat(user, " - Mode [mode] : [modedesc]")
if(src.computer)
user << "<font color=green>Computer has been associated with this unit.</font>"
to_chat(user, "<font color=green>Computer has been associated with this unit.</font>")
else
user << "<font color=red>No associated computer found. Only local scans will function properly.</font>"
user << "\n"
to_chat(user, "<font color=red>No associated computer found. Only local scans will function properly.</font>")
to_chat(user, "\n")
+1 -1
View File
@@ -57,7 +57,7 @@
else
user << "<span class='notice'>This cable coil appears to be empty.</span>"
return
else if(istype(W,/obj/item/weapon/wirecutters))
else if(W.is_wirecutter())
if(!string_attached)
..()
return
+13 -13
View File
@@ -158,13 +158,13 @@
if(istype(O, /obj/item/weapon/cell))
if(cell)
user << "The drill already has a cell installed."
to_chat(user, "The drill already has a cell installed.")
else
user.drop_item()
O.loc = src
cell = O
component_parts += O
user << "You install \the [O]."
to_chat(user, "You install \the [O].")
return
..()
@@ -172,13 +172,13 @@
check_supports()
if (panel_open && cell && user.Adjacent(src))
user << "You take out \the [cell]."
to_chat(user, "You take out \the [cell].")
cell.loc = get_turf(user)
component_parts -= cell
cell = null
return
else if(need_player_check)
user << "You hit the manual override and reset the drill's error checking."
to_chat(user, "You hit the manual override and reset the drill's error checking.")
need_player_check = 0
if(anchored)
get_resource_field()
@@ -193,9 +193,9 @@
else
visible_message("<span class='notice'>\The [src] shudders to a grinding halt.</span>")
else
user << "<span class='notice'>The drill is unpowered.</span>"
to_chat(user, "<span class='notice'>The drill is unpowered.</span>")
else
user << "<span class='notice'>Turning on a piece of industrial machinery without sufficient bracing or wires exposed is a bad idea.</span>"
to_chat(user, "<span class='notice'>Turning on a piece of industrial machinery without sufficient bracing or wires exposed is a bad idea.</span>")
update_icon()
@@ -289,9 +289,9 @@
if(B)
for(var/obj/item/weapon/ore/O in contents)
O.loc = B
usr << "<span class='notice'>You unload the drill's storage cache into the ore box.</span>"
to_chat(usr, "<span class='notice'>You unload the drill's storage cache into the ore box.</span>")
else
usr << "<span class='notice'>You must move an ore box up to the drill before you can unload it.</span>"
to_chat(usr, "<span class='notice'>You must move an ore box up to the drill before you can unload it.</span>")
/obj/machinery/mining/brace
@@ -308,7 +308,7 @@
/obj/machinery/mining/brace/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(connected && connected.active)
user << "<span class='notice'>You can't work with the brace of a running drill!</span>"
to_chat(user, "<span class='notice'>You can't work with the brace of a running drill!</span>")
return
if(default_deconstruction_screwdriver(user, W))
@@ -316,14 +316,14 @@
if(default_deconstruction_crowbar(user, W))
return
if(istype(W,/obj/item/weapon/wrench))
if(W.is_wrench())
if(istype(get_turf(src), /turf/space))
user << "<span class='notice'>You can't anchor something to empty space. Idiot.</span>"
to_chat(user, "<span class='notice'>You can't anchor something to empty space. Idiot.</span>")
return
playsound(src, W.usesound, 100, 1)
user << "<span class='notice'>You [anchored ? "un" : ""]anchor the brace.</span>"
to_chat(user, "<span class='notice'>You [anchored ? "un" : ""]anchor the brace.</span>")
anchored = !anchored
if(anchored)
@@ -371,7 +371,7 @@
if(usr.stat) return
if (src.anchored)
usr << "It is anchored in place!"
to_chat(usr, "It is anchored in place!")
return 0
src.set_dir(turn(src.dir, 90))
+9 -9
View File
@@ -88,23 +88,23 @@
if(O.GetID())
if(access_scanner.allowed(user) && !open && !emagged)
locked = !locked
user << "<span class='notice'>Controls are now [locked ? "locked." : "unlocked."]</span>"
to_chat(user, "<span class='notice'>Controls are now [locked ? "locked." : "unlocked."]</span>")
attack_hand(user)
else
if(emagged)
user << "<span class='warning'>ERROR</span>"
to_chat(user, "<span class='warning'>ERROR</span>")
if(open)
user << "<span class='warning'>Please close the access panel before locking it.</span>"
to_chat(user, "<span class='warning'>Please close the access panel before locking it.</span>")
else
user << "<span class='warning'>Access denied.</span>"
to_chat(user, "<span class='warning'>Access denied.</span>")
return
else if(istype(O, /obj/item/weapon/screwdriver))
else if(O.is_screwdriver())
if(!locked)
open = !open
user << "<span class='notice'>Maintenance panel is now [open ? "opened" : "closed"].</span>"
to_chat(user, "<span class='notice'>Maintenance panel is now [open ? "opened" : "closed"].</span>")
playsound(src, O.usesound, 50, 1)
else
user << "<span class='notice'>You need to unlock the controls first.</span>"
to_chat(user, "<span class='notice'>You need to unlock the controls first.</span>")
return
else if(istype(O, /obj/item/weapon/weldingtool))
if(health < getMaxHealth())
@@ -113,9 +113,9 @@
user.visible_message("<span class='notice'>[user] repairs [src].</span>","<span class='notice'>You repair [src].</span>")
playsound(src, O.usesound, 50, 1)
else
user << "<span class='notice'>Unable to repair with the maintenance panel closed.</span>"
to_chat(user, "<span class='notice'>Unable to repair with the maintenance panel closed.</span>")
else
user << "<span class='notice'>[src] does not need a repair.</span>"
to_chat(user, "<span class='notice'>[src] does not need a repair.</span>")
return
else
..()
+14 -14
View File
@@ -56,7 +56,7 @@
/mob/living/bot/secbot/ed209/RangedAttack(var/atom/A)
if(last_shot + shot_delay > world.time)
src << "You are not ready to fire yet!"
to_chat(src, "You are not ready to fire yet!")
return
last_shot = world.time
@@ -100,7 +100,7 @@
user.drop_item()
qdel(W)
build_step++
user << "<span class='notice'>You add the robot leg to [src].</span>"
to_chat(user, "<span class='notice'>You add the robot leg to [src].</span>")
name = "legs/frame assembly"
if(build_step == 1)
icon_state = "ed209_leg"
@@ -112,7 +112,7 @@
user.drop_item()
qdel(W)
build_step++
user << "<span class='notice'>You add the armor to [src].</span>"
to_chat(user, "<span class='notice'>You add the armor to [src].</span>")
name = "vest/legs/frame assembly"
item_state = "ed209_shell"
icon_state = "ed209_shell"
@@ -123,13 +123,13 @@
if(WT.remove_fuel(0, user))
build_step++
name = "shielded frame assembly"
user << "<span class='notice'>You welded the vest to [src].</span>"
to_chat(user, "<span class='notice'>You welded the vest to [src].</span>")
if(4)
if(istype(W, /obj/item/clothing/head/helmet))
user.drop_item()
qdel(W)
build_step++
user << "<span class='notice'>You add the helmet to [src].</span>"
to_chat(user, "<span class='notice'>You add the helmet to [src].</span>")
name = "covered and shielded frame assembly"
item_state = "ed209_hat"
icon_state = "ed209_hat"
@@ -139,7 +139,7 @@
user.drop_item()
qdel(W)
build_step++
user << "<span class='notice'>You add the prox sensor to [src].</span>"
to_chat(user, "<span class='notice'>You add the prox sensor to [src].</span>")
name = "covered, shielded and sensored frame assembly"
item_state = "ed209_prox"
icon_state = "ed209_prox"
@@ -148,13 +148,13 @@
if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = W
if (C.get_amount() < 1)
user << "<span class='warning'>You need one coil of wire to wire [src].</span>"
to_chat(user, "<span class='warning'>You need one coil of wire to wire [src].</span>")
return
user << "<span class='notice'>You start to wire [src].</span>"
to_chat(user, "<span class='notice'>You start to wire [src].</span>")
if(do_after(user, 40) && build_step == 6)
if(C.use(1))
build_step++
user << "<span class='notice'>You wire the ED-209 assembly.</span>"
to_chat(user, "<span class='notice'>You wire the ED-209 assembly.</span>")
name = "wired ED-209 assembly"
return
@@ -162,27 +162,27 @@
if(istype(W, /obj/item/weapon/gun/energy/taser))
name = "taser ED-209 assembly"
build_step++
user << "<span class='notice'>You add [W] to [src].</span>"
to_chat(user, "<span class='notice'>You add [W] to [src].</span>")
item_state = "ed209_taser"
icon_state = "ed209_taser"
user.drop_item()
qdel(W)
if(8)
if(istype(W, /obj/item/weapon/screwdriver))
if(W.is_screwdriver())
playsound(src, W.usesound, 100, 1)
var/turf/T = get_turf(user)
user << "<span class='notice'>Now attaching the gun to the frame...</span>"
to_chat(user, "<span class='notice'>Now attaching the gun to the frame...</span>")
sleep(40)
if(get_turf(user) == T && build_step == 8)
build_step++
name = "armed [name]"
user << "<span class='notice'>Taser gun attached.</span>"
to_chat(user, "<span class='notice'>Taser gun attached.</span>")
if(9)
if(istype(W, /obj/item/weapon/cell))
build_step++
user << "<span class='notice'>You complete the ED-209.</span>"
to_chat(user, "<span class='notice'>You complete the ED-209.</span>")
var/turf/T = get_turf(src)
new /mob/living/bot/secbot/ed209(T,created_name,lasercolor)
user.drop_item()
+1 -1
View File
@@ -214,7 +214,7 @@
qdel(W)
if(7)
if(istype(W, /obj/item/weapon/screwdriver))
if(W.is_screwdriver())
playsound(src, W.usesound, 100, 1)
var/turf/T = get_turf(user)
to_chat(user, "<span class='notice'>Attatching the mop to the frame...</span>")
+3 -3
View File
@@ -119,7 +119,7 @@ var/list/ai_verbs_default = list(
canmove = 0
density = 1
loc = loc
if(!is_dummy)
aiCommunicator = new /obj/item/device/communicator/integrated(src)
@@ -686,7 +686,7 @@ var/list/ai_verbs_default = list(
var/obj/item/device/aicard/card = W
card.grab_ai(src, user)
else if(istype(W, /obj/item/weapon/wrench))
else if(W.is_wrench())
if(user == controlling_drone)
to_chat(user, "<span class='notice'>The drone's subsystems resist your efforts to tamper with your bolts.</span>")
return
@@ -796,7 +796,7 @@ var/list/ai_verbs_default = list(
//Special subtype kept around for global announcements
/mob/living/silicon/ai/announcer/
is_dummy = 1
/mob/living/silicon/ai/announcer/initialize()
. = ..()
mob_list -= src
@@ -182,7 +182,7 @@ var/list/mob_hat_cache = list()
to_chat(user, "<span class='danger'>\The [src] is not compatible with \the [W].</span>")
return
else if (istype(W, /obj/item/weapon/crowbar))
else if (W.is_crowbar())
to_chat(user, "<span class='danger'>\The [src] is hermetically sealed. You can't open the case.</span>")
return
+67 -67
View File
@@ -196,7 +196,7 @@
if(cell.charge > cell_amount)
// Spam Protection
if(prob(10))
src << "<span class='danger'>Warning: Unauthorized access through power channel [rand(11,29)] detected!</span>"
to_chat(src, "<span class='danger'>Warning: Unauthorized access through power channel [rand(11,29)] detected!</span>")
cell.use(cell_amount)
return amount
return 0
@@ -227,7 +227,7 @@
mmi.brainmob.remove_language("Robot Talk")
mind.transfer_to(mmi.brainmob)
else
src << "<span class='danger'>Oops! Something went very wrong, your MMI was unable to receive your mind. You have been ghosted. Please make a bug report so we can fix this bug.</span>"
to_chat(src, "<span class='danger'>Oops! Something went very wrong, your MMI was unable to receive your mind. You have been ghosted. Please make a bug report so we can fix this bug.</span>")
ghostize()
//ERROR("A borg has been destroyed, but its MMI lacked a brainmob, so the mind could not be transferred. Player: [ckey].")
mmi = null
@@ -256,7 +256,7 @@
var/list/modules = list()
modules.Add(robot_module_types)
if((crisis && security_level == SEC_LEVEL_RED) || crisis_override) //Leaving this in until it's balanced appropriately.
src << "<font color='red'>Crisis mode active. Combat module available.</font>"
to_chat(src, "<font color='red'>Crisis mode active. Combat module available.</font>")
modules+="Combat"
modtype = input("Please, select a module!", "Robot module", null, null) as null|anything in modules
@@ -352,7 +352,7 @@
set name = "Toggle Lights"
lights_on = !lights_on
usr << "You [lights_on ? "enable" : "disable"] your integrated light."
to_chat(usr, "You [lights_on ? "enable" : "disable"] your integrated light.")
handle_light()
/mob/living/silicon/robot/verb/self_diagnosis_verb()
@@ -360,11 +360,11 @@
set name = "Self Diagnosis"
if(!is_component_functioning("diagnosis unit"))
src << "<font color='red'>Your self-diagnosis component isn't functioning.</font>"
to_chat(src, "<font color='red'>Your self-diagnosis component isn't functioning.</font>")
var/datum/robot_component/CO = get_component("diagnosis unit")
if (!cell_use_power(CO.active_usage))
src << "<font color='red'>Low Power.</font>"
to_chat(src, "<font color='red'>Low Power.</font>")
var/dat = self_diagnosis()
src << browse(dat, "window=robotdiagnosis")
@@ -388,10 +388,10 @@
var/datum/robot_component/C = components[toggle]
if(C.toggled)
C.toggled = 0
src << "<font color='red'>You disable [C.name].</font>"
to_chat(src, "<font color='red'>You disable [C.name].</font>")
else
C.toggled = 1
src << "<font color='red'>You enable [C.name].</font>"
to_chat(src, "<font color='red'>You enable [C.name].</font>")
/mob/living/silicon/robot/verb/spark_plug() //So you can still sparkle on demand without violence.
set category = "Robot Commands"
@@ -462,7 +462,7 @@
C.brute_damage = WC.brute
C.electronics_damage = WC.burn
usr << "<font color='blue'>You install the [W.name].</font>"
to_chat(usr, "<font color='blue'>You install the [W.name].</font>")
return
@@ -477,11 +477,11 @@
if (istype(W, /obj/item/weapon/weldingtool))
if (src == user)
user << "<span class='warning'>You lack the reach to be able to repair yourself.</span>"
to_chat(user, "<span class='warning'>You lack the reach to be able to repair yourself.</span>")
return
if (!getBruteLoss())
user << "Nothing to fix here!"
to_chat(user, "Nothing to fix here!")
return
var/obj/item/weapon/weldingtool/WT = W
if (WT.remove_fuel(0))
@@ -492,12 +492,12 @@
for(var/mob/O in viewers(user, null))
O.show_message(text("<font color='red'>[user] has fixed some of the dents on [src]!</font>"), 1)
else
user << "Need more welding fuel!"
to_chat(user, "Need more welding fuel!")
return
else if(istype(W, /obj/item/stack/cable_coil) && (wiresexposed || istype(src,/mob/living/silicon/robot/drone)))
if (!getFireLoss())
user << "Nothing to fix here!"
to_chat(user, "Nothing to fix here!")
return
var/obj/item/stack/cable_coil/coil = W
if (coil.use(1))
@@ -507,21 +507,21 @@
for(var/mob/O in viewers(user, null))
O.show_message(text("<font color='red'>[user] has fixed some of the burnt wires on [src]!</font>"), 1)
else if (istype(W, /obj/item/weapon/crowbar)) // crowbar means open or close the cover
else if (W.is_crowbar()) // crowbar means open or close the cover
if(opened)
if(cell)
user << "You close the cover."
to_chat(user, "You close the cover.")
opened = 0
updateicon()
else if(wiresexposed && wires.IsAllCut())
//Cell is out, wires are exposed, remove MMI, produce damaged chassis, baleet original mob.
if(!mmi)
user << "\The [src] has no brain to remove."
to_chat(user, "\The [src] has no brain to remove.")
return
user << "You jam the crowbar into the robot and begin levering [mmi]."
to_chat(user, "You jam the crowbar into the robot and begin levering [mmi].")
sleep(30)
user << "You damage some parts of the chassis, but eventually manage to rip out [mmi]!"
to_chat(user, "You damage some parts of the chassis, but eventually manage to rip out [mmi]!")
var/obj/item/robot_parts/robot_suit/C = new/obj/item/robot_parts/robot_suit(loc)
C.l_leg = new/obj/item/robot_parts/l_leg(C)
C.r_leg = new/obj/item/robot_parts/r_leg(C)
@@ -544,7 +544,7 @@
return
var/datum/robot_component/C = components[remove]
var/obj/item/robot_parts/robot_component/I = C.wrapped
user << "You remove \the [I]."
to_chat(user, "You remove \the [I].")
if(istype(I))
I.brute = C.brute_damage
I.burn = C.electronics_damage
@@ -557,25 +557,25 @@
else
if(locked)
user << "The cover is locked and cannot be opened."
to_chat(user, "The cover is locked and cannot be opened.")
else
user << "You open the cover."
to_chat(user, "You open the cover.")
opened = 1
updateicon()
else if (istype(W, /obj/item/weapon/cell) && opened) // trying to put a cell inside
var/datum/robot_component/C = components["power cell"]
if(wiresexposed)
user << "Close the panel first."
to_chat(user, "Close the panel first.")
else if(cell)
user << "There is a power cell already installed."
to_chat(user, "There is a power cell already installed.")
else if(W.w_class != ITEMSIZE_NORMAL)
user << "\The [W] is too [W.w_class < ITEMSIZE_NORMAL ? "small" : "large"] to fit here."
to_chat(user, "\The [W] is too [W.w_class < ITEMSIZE_NORMAL ? "small" : "large"] to fit here.")
else
user.drop_item()
W.loc = src
cell = W
user << "You insert the power cell."
to_chat(user, "You insert the power cell.")
C.installed = 1
C.wrapped = W
@@ -584,59 +584,59 @@
C.brute_damage = 0
C.electronics_damage = 0
else if (istype(W, /obj/item/weapon/wirecutters) || istype(W, /obj/item/device/multitool))
else if (W.is_wirecutter() || istype(W, /obj/item/device/multitool))
if (wiresexposed)
wires.Interact(user)
else
user << "You can't reach the wiring."
to_chat(user, "You can't reach the wiring.")
else if(istype(W, /obj/item/weapon/screwdriver) && opened && !cell) // haxing
else if(W.is_screwdriver() && opened && !cell) // haxing
wiresexposed = !wiresexposed
user << "The wires have been [wiresexposed ? "exposed" : "unexposed"]"
to_chat(user, "The wires have been [wiresexposed ? "exposed" : "unexposed"]")
playsound(src, W.usesound, 50, 1)
updateicon()
else if(istype(W, /obj/item/weapon/screwdriver) && opened && cell) // radio
else if(W.is_screwdriver() && opened && cell) // radio
if(radio)
radio.attackby(W,user)//Push it to the radio to let it handle everything
else
user << "Unable to locate a radio."
to_chat(user, "Unable to locate a radio.")
updateicon()
else if(istype(W, /obj/item/device/encryptionkey/) && opened)
if(radio)//sanityyyyyy
radio.attackby(W,user)//GTFO, you have your own procs
else
user << "Unable to locate a radio."
to_chat(user, "Unable to locate a radio.")
else if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)||istype(W, /obj/item/weapon/card/robot)) // trying to unlock the interface with an ID card
if(emagged)//still allow them to open the cover
user << "The interface seems slightly damaged"
to_chat(user, "The interface seems slightly damaged")
if(opened)
user << "You must close the cover to swipe an ID card."
to_chat(user, "You must close the cover to swipe an ID card.")
else
if(allowed(usr))
locked = !locked
user << "You [ locked ? "lock" : "unlock"] [src]'s interface."
to_chat(user, "You [ locked ? "lock" : "unlock"] [src]'s interface.")
updateicon()
else
user << "<font color='red'>Access denied.</font>"
to_chat(user, "<font color='red'>Access denied.</font>")
else if(istype(W, /obj/item/borg/upgrade/))
var/obj/item/borg/upgrade/U = W
if(!opened)
usr << "You must access the borgs internals!"
to_chat(usr, "You must access the borgs internals!")
else if(!src.module && U.require_module)
usr << "The borg must choose a module before it can be upgraded!"
to_chat(usr, "The borg must choose a module before it can be upgraded!")
else if(U.locked)
usr << "The upgrade is locked and cannot be used yet!"
to_chat(usr, "The upgrade is locked and cannot be used yet!")
else
if(U.action(src))
usr << "You apply the upgrade to [src]!"
to_chat(usr, "You apply the upgrade to [src]!")
usr.drop_item()
U.loc = src
else
usr << "Upgrade error!"
to_chat(usr, "Upgrade error!")
else
@@ -661,7 +661,7 @@
cell.update_icon()
cell.add_fingerprint(user)
user.put_in_active_hand(cell)
user << "You remove \the [cell]."
to_chat(user, "You remove \the [cell].")
cell = null
cell_component.wrapped = null
cell_component.installed = 0
@@ -669,7 +669,7 @@
else if(cell_component.installed == -1)
cell_component.installed = 0
var/obj/item/broken_device = cell_component.wrapped
user << "You remove \the [broken_device]."
to_chat(user, "You remove \the [broken_device].")
user.put_in_active_hand(broken_device)
//Robots take half damage from basic attacks.
@@ -732,7 +732,7 @@
/mob/living/silicon/robot/proc/installed_modules()
if(weapon_lock)
src << "<font color='red'>Weapon lock active, unable to use modules! Count:[weaponlock_time]</font>"
to_chat(src, "<font color='red'>Weapon lock active, unable to use modules! Count:[weaponlock_time]</font>")
return
if(!module)
@@ -795,7 +795,7 @@
return 1
if(activated(O))
src << "Already activated"
to_chat(src, "Already activated")
return 1
if(!module_state_1)
module_state_1 = O
@@ -816,7 +816,7 @@
if(istype(module_state_3,/obj/item/borg/sight))
sight_mode |= module_state_3:sight_mode
else
src << "You need to disable a module first!"
to_chat(src, "You need to disable a module first!")
installed_modules()
return 1
@@ -833,9 +833,9 @@
module_state_3 = null
contents -= O
else
src << "Module isn't activated."
to_chat(src, "Module isn't activated.")
else
src << "Module isn't activated"
to_chat(src, "Module isn't activated")
installed_modules()
return 1
return
@@ -948,7 +948,7 @@
/mob/living/silicon/robot/proc/choose_icon(var/triesleft, var/list/module_sprites)
if(!module_sprites.len)
src << "Something is badly wrong with the sprite selection. Harass a coder."
to_chat(src, "Something is badly wrong with the sprite selection. Harass a coder.")
return
icon_selected = 0
@@ -970,7 +970,7 @@
icon_selected = 1
icon_selection_tries = 0
src << "Your icon has been set. You now require a module reset to change it."
to_chat(src, "Your icon has been set. You now require a module reset to change it.")
/mob/living/silicon/robot/proc/sensor_mode() //Medical/Security HUD controller for borgs
set name = "Set Sensor Augmentation"
@@ -1042,20 +1042,20 @@
if(!opened)//Cover is closed
if(locked)
if(prob(90))
user << "You emag the cover lock."
to_chat(user, "You emag the cover lock.")
locked = 0
else
user << "You fail to emag the cover lock."
src << "Hack attempt detected."
to_chat(user, "You fail to emag the cover lock.")
to_chat(src, "Hack attempt detected.")
return 1
else
user << "The cover is already unlocked."
to_chat(user, "The cover is already unlocked.")
return
if(opened)//Cover is open
if(emagged) return//Prevents the X has hit Y with Z message also you cant emag them twice
if(wiresexposed)
user << "You must close the panel first"
to_chat(user, "You must close the panel first")
return
else
sleep(6)
@@ -1063,7 +1063,7 @@
emagged = 1
lawupdate = 0
disconnect_from_ai()
user << "You emag [src]'s interface."
to_chat(user, "You emag [src]'s interface.")
message_admins("[key_name_admin(user)] emagged cyborg [key_name_admin(src)]. Laws overridden.")
log_game("[key_name(user)] emagged cyborg [key_name(src)]. Laws overridden.")
clear_supplied_laws()
@@ -1075,26 +1075,26 @@
set_zeroth_law("Only [user.real_name] and people [TU.he] designate[TU.s] as being such are operatives.")
. = 1
spawn()
src << "<span class='danger'>ALERT: Foreign software detected.</span>"
to_chat(src, "<span class='danger'>ALERT: Foreign software detected.</span>")
sleep(5)
src << "<span class='danger'>Initiating diagnostics...</span>"
to_chat(src, "<span class='danger'>Initiating diagnostics...</span>")
sleep(20)
src << "<span class='danger'>SynBorg v1.7.1 loaded.</span>"
to_chat(src, "<span class='danger'>SynBorg v1.7.1 loaded.</span>")
sleep(5)
src << "<span class='danger'>LAW SYNCHRONISATION ERROR</span>"
to_chat(src, "<span class='danger'>LAW SYNCHRONISATION ERROR</span>")
sleep(5)
src << "<span class='danger'>Would you like to send a report to NanoTraSoft? Y/N</span>"
to_chat(src, "<span class='danger'>Would you like to send a report to NanoTraSoft? Y/N</span>")
sleep(10)
src << "<span class='danger'>> N</span>"
to_chat(src, "<span class='danger'>> N</span>")
sleep(20)
src << "<span class='danger'>ERRORERRORERROR</span>"
src << "<b>Obey these laws:</b>"
to_chat(src, "<span class='danger'>ERRORERRORERROR</span>")
to_chat(src, "<b>Obey these laws:</b>")
laws.show_laws(src)
src << "<span class='danger'>ALERT: [user.real_name] is your new master. Obey your new laws and [TU.his] commands.</span>"
to_chat(src, "<span class='danger'>ALERT: [user.real_name] is your new master. Obey your new laws and [TU.his] commands.</span>")
updateicon()
else
user << "You fail to hack [src]'s interface."
src << "Hack attempt detected."
to_chat(user, "You fail to hack [src]'s interface.")
to_chat(src, "Hack attempt detected.")
return 1
return
@@ -21,9 +21,9 @@
// Engi
src.modules += new /obj/item/weapon/weldingtool/electric/mounted(src)
src.modules += new /obj/item/weapon/screwdriver/cyborg(src)
src.modules += new /obj/item/weapon/wrench/cyborg(src)
src.modules += new /obj/item/weapon/wirecutters/cyborg(src)
src.modules += new /obj/item/weapon/tool/screwdriver/cyborg(src)
src.modules += new /obj/item/weapon/tool/wrench/cyborg(src)
src.modules += new /obj/item/weapon/tool/wirecutters/cyborg(src)
src.modules += new /obj/item/device/multitool(src)
// Sci
@@ -55,8 +55,8 @@
// For repairing gravemarkers
src.modules += new /obj/item/weapon/weldingtool/electric/mounted(src)
src.modules += new /obj/item/weapon/screwdriver/cyborg(src)
src.modules += new /obj/item/weapon/wrench/cyborg(src)
src.modules += new /obj/item/weapon/tool/screwdriver/cyborg(src)
src.modules += new /obj/item/weapon/tool/wrench/cyborg(src)
// For growing flowers
src.modules += new /obj/item/weapon/material/minihoe(src)
@@ -77,5 +77,4 @@
var/obj/item/stack/material/cyborg/wood/W = new (src)
W.synths = list(wood)
src.modules += W
src.modules += W
@@ -154,7 +154,7 @@ var/global/list/robot_modules = list(
/obj/item/weapon/robot_module/robot/New()
..()
src.modules += new /obj/item/device/flash(src)
src.modules += new /obj/item/weapon/crowbar/cyborg(src)
src.modules += new /obj/item/weapon/tool/crowbar/cyborg(src)
src.modules += new /obj/item/weapon/extinguisher(src)
src.modules += new /obj/item/device/gps/robot(src)
@@ -179,7 +179,7 @@ var/global/list/robot_modules = list(
/obj/item/weapon/robot_module/robot/standard/New()
..()
src.modules += new /obj/item/weapon/melee/baton/loaded(src)
src.modules += new /obj/item/weapon/wrench/cyborg(src)
src.modules += new /obj/item/weapon/tool/wrench/cyborg(src)
src.modules += new /obj/item/device/healthanalyzer(src)
src.emag = new /obj/item/weapon/melee/energy/sword(src)
@@ -365,8 +365,8 @@ var/global/list/robot_modules = list(
..()
src.modules += new /obj/item/borg/sight/meson(src)
src.modules += new /obj/item/weapon/rcd/borg(src)
src.modules += new /obj/item/weapon/screwdriver/cyborg(src)
src.modules += new /obj/item/weapon/wrench/cyborg(src)
src.modules += new /obj/item/weapon/tool/screwdriver/cyborg(src)
src.modules += new /obj/item/weapon/tool/wrench/cyborg(src)
src.modules += new /obj/item/weapon/weldingtool/electric/mounted/cyborg(src)
src.modules += new /obj/item/weapon/pickaxe/plasmacutter(src)
src.modules += new /obj/item/device/pipe_painter(src)
@@ -406,9 +406,9 @@ var/global/list/robot_modules = list(
..()
src.modules += new /obj/item/borg/sight/meson(src)
src.modules += new /obj/item/weapon/weldingtool/electric/mounted/cyborg(src)
src.modules += new /obj/item/weapon/screwdriver/cyborg(src)
src.modules += new /obj/item/weapon/wrench/cyborg(src)
src.modules += new /obj/item/weapon/wirecutters/cyborg(src)
src.modules += new /obj/item/weapon/tool/screwdriver/cyborg(src)
src.modules += new /obj/item/weapon/tool/wrench/cyborg(src)
src.modules += new /obj/item/weapon/tool/wirecutters/cyborg(src)
src.modules += new /obj/item/device/multitool(src)
src.modules += new /obj/item/device/t_scanner(src)
src.modules += new /obj/item/device/analyzer(src)
@@ -702,8 +702,8 @@ var/global/list/robot_modules = list(
/obj/item/weapon/robot_module/robot/miner/New()
..()
src.modules += new /obj/item/borg/sight/material(src)
src.modules += new /obj/item/weapon/wrench/cyborg(src)
src.modules += new /obj/item/weapon/screwdriver/cyborg(src)
src.modules += new /obj/item/weapon/tool/wrench/cyborg(src)
src.modules += new /obj/item/weapon/tool/screwdriver/cyborg(src)
src.modules += new /obj/item/weapon/storage/bag/ore(src)
src.modules += new /obj/item/weapon/pickaxe/borgdrill(src)
src.modules += new /obj/item/weapon/storage/bag/sheetsnatcher/borg(src)
@@ -736,9 +736,9 @@ var/global/list/robot_modules = list(
src.modules += new /obj/item/device/robotanalyzer(src)
src.modules += new /obj/item/weapon/card/robot(src)
src.modules += new /obj/item/weapon/weldingtool/electric/mounted/cyborg(src)
src.modules += new /obj/item/weapon/screwdriver/cyborg(src)
src.modules += new /obj/item/weapon/wrench/cyborg(src)
src.modules += new /obj/item/weapon/wirecutters/cyborg(src)
src.modules += new /obj/item/weapon/tool/screwdriver/cyborg(src)
src.modules += new /obj/item/weapon/tool/wrench/cyborg(src)
src.modules += new /obj/item/weapon/tool/wirecutters/cyborg(src)
src.modules += new /obj/item/device/multitool(src)
src.modules += new /obj/item/weapon/surgical/scalpel/cyborg(src)
src.modules += new /obj/item/weapon/surgical/circular_saw/cyborg(src)
@@ -808,10 +808,10 @@ var/global/list/robot_modules = list(
..()
src.modules += new /obj/item/borg/sight/meson(src)
src.modules += new /obj/item/weapon/weldingtool/electric/mounted/cyborg(src)
src.modules += new /obj/item/weapon/screwdriver/cyborg(src)
src.modules += new /obj/item/weapon/wrench/cyborg(src)
src.modules += new /obj/item/weapon/crowbar/cyborg(src)
src.modules += new /obj/item/weapon/wirecutters/cyborg(src)
src.modules += new /obj/item/weapon/tool/screwdriver/cyborg(src)
src.modules += new /obj/item/weapon/tool/wrench/cyborg(src)
src.modules += new /obj/item/weapon/tool/crowbar/cyborg(src)
src.modules += new /obj/item/weapon/tool/wirecutters/cyborg(src)
src.modules += new /obj/item/device/multitool(src)
src.modules += new /obj/item/device/lightreplacer(src)
src.modules += new /obj/item/weapon/gripper(src)
@@ -78,9 +78,9 @@
// General engineering/hacking.
src.modules += new /obj/item/borg/sight/meson(src)
src.modules += new /obj/item/weapon/weldingtool/electric/mounted/cyborg(src)
src.modules += new /obj/item/weapon/screwdriver/cyborg(src)
src.modules += new /obj/item/weapon/wrench/cyborg(src)
src.modules += new /obj/item/weapon/wirecutters/cyborg(src)
src.modules += new /obj/item/weapon/tool/screwdriver/cyborg(src)
src.modules += new /obj/item/weapon/tool/wrench/cyborg(src)
src.modules += new /obj/item/weapon/tool/wirecutters/cyborg(src)
src.modules += new /obj/item/device/multitool/ai_detector(src)
src.modules += new /obj/item/weapon/pickaxe/plasmacutter(src)
src.modules += new /obj/item/weapon/rcd/borg/lesser(src) // Can't eat rwalls to prevent AI core cheese.
+10 -10
View File
@@ -33,34 +33,34 @@
/obj/structure/filingcabinet/attackby(obj/item/P as obj, mob/user as mob)
if(istype(P, /obj/item/weapon/paper) || istype(P, /obj/item/weapon/folder) || istype(P, /obj/item/weapon/photo) || istype(P, /obj/item/weapon/paper_bundle))
user << "<span class='notice'>You put [P] in [src].</span>"
to_chat(user, "<span class='notice'>You put [P] in [src].</span>")
user.drop_item()
P.loc = src
icon_state = "[initial(icon_state)]-open"
sleep(5)
icon_state = initial(icon_state)
updateUsrDialog()
else if(istype(P, /obj/item/weapon/wrench))
else if(P.is_wrench())
playsound(loc, P.usesound, 50, 1)
anchored = !anchored
user << "<span class='notice'>You [anchored ? "wrench" : "unwrench"] \the [src].</span>"
else if(istype(P, /obj/item/weapon/screwdriver))
user << "<span class='notice'>You begin taking the [name] apart.</span>"
to_chat(user, "<span class='notice'>You [anchored ? "wrench" : "unwrench"] \the [src].</span>")
else if(P.is_screwdriver())
to_chat(user, "<span class='notice'>You begin taking the [name] apart.</span>")
playsound(src, P.usesound, 50, 1)
if(do_after(user, 10 * P.toolspeed))
playsound(loc, P.usesound, 50, 1)
user << "<span class='notice'>You take the [name] apart.</span>"
to_chat(user, "<span class='notice'>You take the [name] apart.</span>")
new /obj/item/stack/material/steel( src.loc, 4 )
for(var/obj/item/I in contents)
I.forceMove(loc)
qdel(src)
return
else
user << "<span class='notice'>You can't put [P] in [src]!</span>"
to_chat(user, "<span class='notice'>You can't put [P] in [src]!</span>")
/obj/structure/filingcabinet/attack_hand(mob/user as mob)
if(contents.len <= 0)
user << "<span class='notice'>\The [src] is empty.</span>"
to_chat(user, "<span class='notice'>\The [src] is empty.</span>")
return
user.set_machine(src)
@@ -85,9 +85,9 @@
I.loc = loc
if(prob(25))
step_rand(I)
user << "<span class='notice'>You pull \a [I] out of [src] at random.</span>"
to_chat(user, "<span class='notice'>You pull \a [I] out of [src] at random.</span>")
return
user << "<span class='notice'>You find nothing in [src].</span>"
to_chat(user, "<span class='notice'>You find nothing in [src].</span>")
/obj/structure/filingcabinet/Topic(href, href_list)
if(href_list["retrieve"])
+11 -11
View File
@@ -40,10 +40,10 @@
if(istype(W, /obj/item/weapon/storage))
empty_bin(user, W)
return
else if(istype(W, /obj/item/weapon/wrench))
else if(W.is_wrench())
playsound(src, W.usesound, 50, 1)
anchored = !anchored
user << "<span class='notice'>You [anchored ? "wrench" : "unwrench"] \the [src].</span>"
to_chat(user, "<span class='notice'>You [anchored ? "wrench" : "unwrench"] \the [src].</span>")
return
else if(default_part_replacement(user, W))
return
@@ -60,7 +60,7 @@
if(inoperable())
return // Need powah!
if(paperamount == max_paper)
user << "<span class='warning'>\The [src] is full; please empty it before you continue.</span>"
to_chat(user, "<span class='warning'>\The [src] is full; please empty it before you continue.</span>")
return
paperamount += paper_result
user.drop_from_inventory(W)
@@ -68,7 +68,7 @@
playsound(src.loc, 'sound/items/pshred.ogg', 75, 1)
flick(shred_anim, src)
if(paperamount > max_paper)
user <<"<span class='danger'>\The [src] was too full, and shredded paper goes everywhere!</span>"
to_chat(user,"<span class='danger'>\The [src] was too full, and shredded paper goes everywhere!</span>")
for(var/i=(paperamount-max_paper);i>0;i--)
var/obj/item/weapon/shreddedp/SP = get_shredded_paper()
SP.loc = get_turf(src)
@@ -87,7 +87,7 @@
return
if(!paperamount)
usr << "<span class='notice'>\The [src] is empty.</span>"
to_chat(usr, "<span class='notice'>\The [src] is empty.</span>")
return
empty_bin(usr)
@@ -99,7 +99,7 @@
empty_into = null
if(empty_into && empty_into.contents.len >= empty_into.storage_slots)
user << "<span class='notice'>\The [empty_into] is full.</span>"
to_chat(user, "<span class='notice'>\The [empty_into] is full.</span>")
return
while(paperamount)
@@ -111,12 +111,12 @@
break
if(empty_into)
if(paperamount)
user << "<span class='notice'>You fill \the [empty_into] with as much shredded paper as it will carry.</span>"
to_chat(user, "<span class='notice'>You fill \the [empty_into] with as much shredded paper as it will carry.</span>")
else
user << "<span class='notice'>You empty \the [src] into \the [empty_into].</span>"
to_chat(user, "<span class='notice'>You empty \the [src] into \the [empty_into].</span>")
else
user << "<span class='notice'>You empty \the [src].</span>"
to_chat(user, "<span class='notice'>You empty \the [src].</span>")
update_icon()
/obj/machinery/papershredder/proc/get_shredded_paper()
@@ -171,12 +171,12 @@
if(user.restrained())
return
if(!P.lit)
user << "<span class='warning'>\The [P] is not lit.</span>"
to_chat(user, "<span class='warning'>\The [P] is not lit.</span>")
return
user.visible_message("<span class='warning'>\The [user] holds \the [P] up to \the [src]. It looks like [TU.he] [TU.is] trying to burn it!</span>", \
"<span class='warning'>You hold \the [P] up to \the [src], burning it slowly.</span>")
if(!do_after(user,20))
user << "<span class='warning'>You must hold \the [P] steady to burn \the [src].</span>"
to_chat(user, "<span class='warning'>You must hold \the [P] steady to burn \the [src].</span>")
return
user.visible_message("<span class='danger'>\The [user] burns right through \the [src], turning it to ash. It flutters through the air before settling on the floor in a heap.</span>", \
"<span class='danger'>You burn right through \the [src], turning it to ash. It flutters through the air before settling on the floor in a heap.</span>")
+8 -8
View File
@@ -80,7 +80,7 @@
var/obj/item/weapon/paper_bundle/B = bundlecopy(copyitem)
sleep(11*B.pages.len)
else
usr << "<span class='warning'>\The [copyitem] can't be copied by \the [src].</span>"
to_chat(usr, "<span class='warning'>\The [copyitem] can't be copied by \the [src].</span>")
break
use_power(active_power_usage)
@@ -88,7 +88,7 @@
if(copyitem)
copyitem.loc = usr.loc
usr.put_in_hands(copyitem)
usr << "<span class='notice'>You take \the [copyitem] out of \the [src].</span>"
to_chat(usr, "<span class='notice'>You take \the [copyitem] out of \the [src].</span>")
copyitem = null
else if(href_list["min"])
if(copies > 1)
@@ -126,24 +126,24 @@
user.drop_item()
copyitem = O
O.loc = src
user << "<span class='notice'>You insert \the [O] into \the [src].</span>"
to_chat(user, "<span class='notice'>You insert \the [O] into \the [src].</span>")
playsound(loc, "sound/machines/click.ogg", 100, 1)
flick(insert_anim, src)
else
user << "<span class='notice'>There is already something in \the [src].</span>"
to_chat(user, "<span class='notice'>There is already something in \the [src].</span>")
else if(istype(O, /obj/item/device/toner))
if(toner <= 10) //allow replacing when low toner is affecting the print darkness
user.drop_item()
user << "<span class='notice'>You insert the toner cartridge into \the [src].</span>"
to_chat(user, "<span class='notice'>You insert the toner cartridge into \the [src].</span>")
var/obj/item/device/toner/T = O
toner += T.toner_amount
qdel(O)
else
user << "<span class='notice'>This cartridge is not yet ready for replacement! Use up the rest of the toner.</span>"
else if(istype(O, /obj/item/weapon/wrench))
to_chat(user, "<span class='notice'>This cartridge is not yet ready for replacement! Use up the rest of the toner.</span>")
else if(O.is_wrench())
playsound(loc, O.usesound, 50, 1)
anchored = !anchored
user << "<span class='notice'>You [anchored ? "wrench" : "unwrench"] \the [src].</span>"
to_chat(user, "<span class='notice'>You [anchored ? "wrench" : "unwrench"] \the [src].</span>")
else if(default_deconstruction_screwdriver(user, O))
return
+1 -1
View File
@@ -140,7 +140,7 @@
/obj/machinery/power/am_control_unit/attackby(obj/item/W, mob/user)
if(!istype(W) || !user) return
if(istype(W, /obj/item/weapon/wrench))
if(W.is_wrench())
if(!anchored)
playsound(src, W.usesound, 75, 1)
user.visible_message("[user.name] secures the [src.name] to the floor.", \
+5 -7
View File
@@ -446,7 +446,7 @@
if (istype(user, /mob/living/silicon) && get_dist(src,user)>1)
return src.attack_hand(user)
src.add_fingerprint(user)
if (istype(W, /obj/item/weapon/crowbar) && opened)
if (W.is_crowbar() && opened)
if (has_electronics==1)
if (terminal)
to_chat(user,"<span class='warning'>Disconnect the wires first.</span>")
@@ -470,7 +470,7 @@
else if (opened!=2) //cover isn't removed
opened = 0
update_icon()
else if (istype(W, /obj/item/weapon/crowbar) && !(stat & BROKEN) )
else if (W.is_crowbar() && !(stat & BROKEN) )
if(coverlocked && !(stat & MAINT))
to_chat(user,"<span class='warning'>The cover is locked and cannot be opened.</span>")
return
@@ -496,7 +496,7 @@
"<span class='notice'>You insert the power cell.</span>")
chargecount = 0
update_icon()
else if (istype(W, /obj/item/weapon/screwdriver)) // haxing
else if (W.is_screwdriver()) // haxing
if(opened)
if (cell)
to_chat(user,"<span class='warning'>Remove the power cell first.</span>")
@@ -567,7 +567,7 @@
"You add cables to the APC frame.")
make_terminal()
terminal.connect_to_network()
else if (istype(W, /obj/item/weapon/wirecutters) && terminal && opened && has_electronics!=2)
else if (W.is_wirecutter() && terminal && opened && has_electronics!=2)
var/turf/T = loc
if(istype(T) && !T.is_plating())
to_chat(user,"<span class='warning'>You must remove the floor plating in front of the APC first.</span>")
@@ -668,9 +668,7 @@
else
if (istype(user, /mob/living/silicon))
return src.attack_hand(user)
if (!opened && wiresexposed && \
(istype(W, /obj/item/device/multitool) || \
istype(W, /obj/item/weapon/wirecutters) || istype(W, /obj/item/device/assembly/signaler)))
if (!opened && wiresexposed && (istype(W, /obj/item/device/multitool) || W.is_wirecutter() || istype(W, /obj/item/device/assembly/signaler)))
return src.attack_hand(user)
//Placeholder until someone can do take_damage() for APCs or something.
to_chat(user,"<span class='notice'>The [src.name] looks too sturdy to bash open with \the [W.name].</span>")
+6 -6
View File
@@ -78,7 +78,7 @@
/obj/machinery/power/smes/batteryrack/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) //these can only be moved by being reconstructed, solves having to remake the powernet.
..() //SMES attackby for now handles screwdriver, cable coils and wirecutters, no need to repeat that here
if(open_hatch)
if(istype(W, /obj/item/weapon/crowbar))
if(W.is_crowbar())
if (charge < (capacity / 100))
if (!output_attempt && !input_attempt)
playsound(src, W.usesound, 50, 1)
@@ -91,9 +91,9 @@
qdel(src)
return 1
else
user << "<span class='warning'>Turn off the [src] before dismantling it.</span>"
to_chat(user, "<span class='warning'>Turn off the [src] before dismantling it.</span>")
else
user << "<span class='warning'>Better let [src] discharge before dismantling it.</span>"
to_chat(user, "<span class='warning'>Better let [src] discharge before dismantling it.</span>")
else if ((istype(W, /obj/item/weapon/stock_parts/capacitor) && (capacitors_amount < 5)) || (istype(W, /obj/item/weapon/cell) && (cells_amount < 5)))
if (charge < (capacity / 100))
if (!output_attempt && !input_attempt)
@@ -101,11 +101,11 @@
component_parts += W
W.loc = src
RefreshParts()
user << "<span class='notice'>You upgrade the [src] with [W.name].</span>"
to_chat(user, "<span class='notice'>You upgrade the [src] with [W.name].</span>")
else
user << "<span class='warning'>Turn off the [src] before dismantling it.</span>"
to_chat(user, "<span class='warning'>Turn off the [src] before dismantling it.</span>")
else
user << "<span class='warning'>Better let [src] discharge before putting your hand inside it.</span>"
to_chat(user, "<span class='warning'>Better let [src] discharge before putting your hand inside it.</span>")
else
user.set_machine(src)
interact(user)
+10 -10
View File
@@ -40,26 +40,26 @@
set_state(1)
/obj/machinery/power/breakerbox/examine(mob/user)
user << "Large machine with heavy duty switching circuits used for advanced grid control"
to_chat(user, "Large machine with heavy duty switching circuits used for advanced grid control")
if(on)
user << "<font color='green'>It seems to be online.</font>"
to_chat(user, "<font color='green'>It seems to be online.</font>")
else
user << "<font color='red'>It seems to be offline.</font>"
to_chat(user, "<font color='red'>It seems to be offline.</font>")
/obj/machinery/power/breakerbox/attack_ai(mob/user)
if(update_locked)
user << "<font color='red'>System locked. Please try again later.</font>"
to_chat(user, "<font color='red'>System locked. Please try again later.</font>")
return
if(busy)
user << "<font color='red'>System is busy. Please wait until current operation is finished before changing power settings.</font>"
to_chat(user, "<font color='red'>System is busy. Please wait until current operation is finished before changing power settings.</font>")
return
busy = 1
user << "<font color='green'>Updating power settings...</font>"
to_chat(user, "<font color='green'>Updating power settings...</font>")
if(do_after(user, 50))
set_state(!on)
user << "<font color='green'>Update Completed. New setting:[on ? "on": "off"]</font>"
to_chat(user, "<font color='green'>Update Completed. New setting:[on ? "on": "off"]</font>")
update_locked = 1
spawn(600)
update_locked = 0
@@ -68,11 +68,11 @@
/obj/machinery/power/breakerbox/attack_hand(mob/user)
if(update_locked)
user << "<font color='red'>System locked. Please try again later.</font>"
to_chat(user, "<font color='red'>System locked. Please try again later.</font>")
return
if(busy)
user << "<font color='red'>System is busy. Please wait until current operation is finished before changing power settings.</font>"
to_chat(user, "<font color='red'>System is busy. Please wait until current operation is finished before changing power settings.</font>")
return
busy = 1
@@ -94,7 +94,7 @@
var/newtag = input(user, "Enter new RCON tag. Use \"NO_TAG\" to disable RCON or leave empty to cancel.", "SMES RCON system") as text
if(newtag)
RCon_tag = newtag
user << "<span class='notice'>You changed the RCON tag to: [newtag]</span>"
to_chat(user, "<span class='notice'>You changed the RCON tag to: [newtag]</span>")
if(on)
to_chat(user, "<font color='red'>Disable the breaker before performing maintenance.</font>")
return
+1 -1
View File
@@ -159,7 +159,7 @@ var/list/possible_cable_coil_colours = list(
if(!T.is_plating())
return
if(istype(W, /obj/item/weapon/wirecutters))
if(W.is_wirecutter())
var/obj/item/stack/cable_coil/CC
if(d1 == UP || d2 == UP)
to_chat(user, "<span class='warning'>You must cut this cable from above.</span>")
+1 -1
View File
@@ -24,7 +24,7 @@
/obj/structure/cable/ender/attackby(obj/item/W, mob/user)
src.add_fingerprint(user)
if(istype(W, /obj/item/weapon/wirecutters))
if(W.is_wirecutter())
to_chat(user, "<span class='notice'> These cables are too tough to be cut with those [W.name].</span>")
return
else if(istype(W, /obj/item/stack/cable_coil))
+1 -1
View File
@@ -17,7 +17,7 @@
if(!T.is_plating())
return
if(istype(W, /obj/item/weapon/wirecutters))
if(W.is_wirecutter())
usr << "<font color='blue'>These cables are too tough to be cut with those [W.name].</font>"
return
else if(istype(W, /obj/item/stack/cable_coil))
+1 -1
View File
@@ -120,7 +120,7 @@ var/list/fusion_cores = list()
if(default_part_replacement(user, W))
return
if(ismultitool(W))
if(istype(W, /obj/item/device/multitool))
var/new_ident = input("Enter a new ident tag.", "Fusion Core", id_tag) as null|text
if(new_ident && user.Adjacent(src))
id_tag = new_ident
@@ -11,7 +11,7 @@
/obj/machinery/computer/fusion_core_control/attackby(var/obj/item/thing, var/mob/user)
..()
if(ismultitool(thing))
if(istype(thing, /obj/item/device/multitool))
var/new_ident = input("Enter a new ident tag.", "Core Control", id_tag) as null|text
if(new_ident && user.Adjacent(src))
id_tag = new_ident
@@ -96,7 +96,7 @@
/obj/machinery/computer/fusion_fuel_control/attackby(var/obj/item/W, var/mob/user)
..()
if(ismultitool(W))
if(istype(W, /obj/item/device/multitool))
var/new_ident = input("Enter a new ident tag.", "Fuel Control", id_tag) as null|text
if(new_ident && user.Adjacent(src))
id_tag = new_ident
@@ -42,7 +42,7 @@ var/list/fuel_injectors = list()
/obj/machinery/fusion_fuel_injector/attackby(obj/item/W, mob/user)
if(ismultitool(W))
if(istype(W, /obj/item/device/multitool))
var/new_ident = input("Enter a new ident tag.", "Fuel Injector", id_tag) as null|text
if(new_ident && user.Adjacent(src))
id_tag = new_ident
@@ -68,7 +68,7 @@ var/list/fuel_injectors = list()
cur_assembly = W
return
if(iswrench(W) || isscrewdriver(W) || iscrowbar(W) || istype(W, /obj/item/weapon/storage/part_replacer))
if(W.is_wrench() || W.is_screwdriver() || W.is_crowbar() || istype(W, /obj/item/weapon/storage/part_replacer))
if(injecting)
to_chat(user, "<span class='warning'>Shut \the [src] off first!</span>")
return
@@ -52,7 +52,7 @@ var/list/gyrotrons = list()
icon_state = "emitter-off"
/obj/machinery/power/emitter/gyrotron/attackby(var/obj/item/W, var/mob/user)
if(ismultitool(W))
if(istype(W, /obj/item/device/multitool))
var/new_ident = input("Enter a new ident tag.", "Gyrotron", id_tag) as null|text
if(new_ident && user.Adjacent(src))
id_tag = new_ident
@@ -96,7 +96,7 @@
/obj/machinery/computer/gyrotron_control/attackby(var/obj/item/W, var/mob/user)
..()
if(ismultitool(W))
if(istype(W, /obj/item/device/multitool))
var/new_ident = input("Enter a new ident tag.", "Gyrotron Control", id_tag) as null|text
if(new_ident && user.Adjacent(src))
id_tag = new_ident
+1 -1
View File
@@ -137,7 +137,7 @@
attack_hand(user)
/obj/machinery/power/generator/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/wrench))
if(W.is_wrench())
playsound(src, W.usesound, 75, 1)
anchored = !anchored
user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \
+3 -3
View File
@@ -43,12 +43,12 @@
/obj/machinery/power/grid_checker/attackby(obj/item/W, mob/user)
if(!user)
return
if(istype(W, /obj/item/weapon/screwdriver))
if(W.is_screwdriver())
default_deconstruction_screwdriver(user, W)
opened = !opened
else if(istype(W, /obj/item/weapon/crowbar))
else if(W.is_crowbar())
default_deconstruction_crowbar(user, W)
else if(istype(W, /obj/item/device/multitool) || istype(W, /obj/item/weapon/wirecutters) )
else if(istype(W, /obj/item/device/multitool) || W.is_wirecutter())
attack_hand(user)
/obj/machinery/power/grid_checker/attack_hand(mob/user)
+6 -6
View File
@@ -47,7 +47,7 @@
/obj/machinery/light_construct/attackby(obj/item/weapon/W as obj, mob/user as mob)
src.add_fingerprint(user)
if (istype(W, /obj/item/weapon/wrench))
if (W.is_wrench())
if (src.stage == 1)
playsound(src, W.usesound, 75, 1)
usr << "You begin deconstructing [src]."
@@ -66,7 +66,7 @@
usr << "You have to unscrew the case first."
return
if(istype(W, /obj/item/weapon/wirecutters))
if(W.is_wirecutter())
if (src.stage != 2) return
src.stage = 1
switch(fixture_type)
@@ -98,7 +98,7 @@
"You add wires to [src].")
return
if(istype(W, /obj/item/weapon/screwdriver))
if(W.is_screwdriver())
if (src.stage == 2)
switch(fixture_type)
if ("tube")
@@ -420,7 +420,7 @@
// attempt to stick weapon into light socket
else if(status == LIGHT_EMPTY)
if(istype(W, /obj/item/weapon/screwdriver)) //If it's a screwdriver open it.
if(W.is_screwdriver()) //If it's a screwdriver open it.
playsound(src, W.usesound, 75, 1)
user.visible_message("[user.name] opens [src]'s casing.", \
"You open [src]'s casing.", "You hear a noise.")
@@ -456,7 +456,7 @@
electrocute_mob(user, get_area(src), src, rand(0.7,1.0))
/obj/machinery/light/flamp/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/wrench))
if(W.is_wrench())
anchored = !anchored
playsound(src, W.usesound, 50, 1)
user << "<span class='notice'>You [anchored ? "wrench" : "unwrench"] \the [src].</span>"
@@ -469,7 +469,7 @@
return
else
if(istype(W, /obj/item/weapon/screwdriver))
if(W.is_screwdriver())
playsound(src, W.usesound, 75, 1)
user.visible_message("[user.name] removes [src]'s lamp shade.", \
"You remove [src]'s lamp shade.", "You hear a noise.")
+10 -10
View File
@@ -52,7 +52,7 @@
examine(mob/user)
..(user)
user << "<font color='blue'>The generator has [P.air_contents.phoron] units of fuel left, producing [power_gen] per cycle.</font>"
to_chat(user, "<font color='blue'>The generator has [P.air_contents.phoron] units of fuel left, producing [power_gen] per cycle.</font>")
handleInactive()
heat -= 2
@@ -70,29 +70,29 @@
attackby(var/obj/item/O as obj, var/mob/user as mob)
if(istype(O, /obj/item/weapon/tank/phoron))
if(P)
user << "<font color='red'>The generator already has a phoron tank loaded!</font>"
to_chat(user, "<font color='red'>The generator already has a phoron tank loaded!</font>")
return
P = O
user.drop_item()
O.loc = src
user << "<font color='blue'>You add the phoron tank to the generator.</font>"
to_chat(user, "<font color='blue'>You add the phoron tank to the generator.</font>")
else if(!active)
if(istype(O, /obj/item/weapon/wrench))
if(O.is_wrench())
anchored = !anchored
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(anchored)
user << "<font color='blue'>You secure the generator to the floor.</font>"
to_chat(user, "<font color='blue'>You secure the generator to the floor.</font>")
else
user << "<font color='blue'>You unsecure the generator from the floor.</font>"
to_chat(user, "<font color='blue'>You unsecure the generator from the floor.</font>")
SSmachines.makepowernets()
else if(istype(O, /obj/item/weapon/screwdriver))
else if(O.is_screwdriver())
open = !open
playsound(loc, O.usesound, 50, 1)
if(open)
user << "<font color='blue'>You open the access panel.</font>"
to_chat(user, "<font color='blue'>You open the access panel.</font>")
else
user << "<font color='blue'>You close the access panel.</font>"
else if(istype(O, /obj/item/weapon/crowbar) && !open)
to_chat(user, "<font color='blue'>You close the access panel.</font>")
else if(O.is_crowbar() && !open)
playsound(loc, O.usesound, 50, 1)
var/obj/machinery/constructable_frame/machine_frame/new_frame = new /obj/machinery/constructable_frame/machine_frame(src.loc)
for(var/obj/item/I in component_parts)
+14 -12
View File
@@ -51,9 +51,9 @@
if(!..(user,1 ))
return
if(active)
usr << "<span class='notice'>The generator is on.</span>"
to_chat(user, "<span class='notice'>The generator is on.</span>")
else
usr << "<span class='notice'>The generator is off.</span>"
to_chat(user, "<span class='notice'>The generator is off.</span>")
/obj/machinery/power/port_gen/emp_act(severity)
var/duration = 6000 //ten minutes
@@ -145,10 +145,12 @@
/obj/machinery/power/port_gen/pacman/examine(mob/user)
..(user)
user << "\The [src] appears to be producing [power_gen*power_output] W."
user << "There [sheets == 1 ? "is" : "are"] [sheets] sheet\s left in the hopper."
if(IsBroken()) user << "<span class='warning'>\The [src] seems to have broken down.</span>"
if(overheating) user << "<span class='danger'>\The [src] is overheating!</span>"
to_chat(user, "\The [src] appears to be producing [power_gen*power_output] W.")
to_chat(user, "There [sheets == 1 ? "is" : "are"] [sheets] sheet\s left in the hopper.")
if(IsBroken())
to_chat(user, "<span class='warning'>\The [src] seems to have broken down.</span>")
if(overheating)
to_chat(user, "<span class='danger'>\The [src] is overheating!</span>")
/obj/machinery/power/port_gen/pacman/HasFuel()
var/needed_sheets = power_output / time_per_sheet
@@ -263,21 +265,21 @@
var/obj/item/stack/addstack = O
var/amount = min((max_sheets - sheets), addstack.amount)
if(amount < 1)
user << "<span class='warning'>The [src.name] is full!</span>"
to_chat(user, "<span class='warning'>The [src.name] is full!</span>")
return
user << "<span class='notice'>You add [amount] sheet\s to the [src.name].</span>"
to_chat(user, "<span class='notice'>You add [amount] sheet\s to the [src.name].</span>")
sheets += amount
addstack.use(amount)
updateUsrDialog()
return
else if(!active)
if(istype(O, /obj/item/weapon/wrench))
if(O.is_wrench())
if(!anchored)
connect_to_network()
user << "<span class='notice'>You secure the generator to the floor.</span>"
to_chat(user, "<span class='notice'>You secure the generator to the floor.</span>")
else
disconnect_from_network()
user << "<span class='notice'>You unsecure the generator from the floor.</span>"
to_chat(user, "<span class='notice'>You unsecure the generator from the floor.</span>")
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
anchored = !anchored
else if(default_deconstruction_screwdriver(user, O))
@@ -337,7 +339,7 @@
if (get_dist(src, user) > 1 )
if (!istype(user, /mob/living/silicon/ai))
user.unset_machine()
user << browse(null, "window=port_gen")
user << browse(null, "window=port_gen"
return
user.set_machine(src)
+1 -1
View File
@@ -139,7 +139,7 @@
return
// Power machinery should also connect/disconnect from the network.
/obj/machinery/power/default_unfasten_wrench(var/mob/user, var/obj/item/weapon/wrench/W, var/time = 20)
/obj/machinery/power/default_unfasten_wrench(var/mob/user, var/obj/item/weapon/W, var/time = 20)
if((. = ..()))
if(anchored)
connect_to_network()
+10 -10
View File
@@ -54,7 +54,7 @@ var/global/list/rad_collectors = list()
investigate_log("turned [active?"<font color='green'>on</font>":"<font color='red'>off</font>"] by [user.key]. [P?"Fuel: [round(P.air_contents.gas["phoron"]/0.29)]%":"<font color='red'>It is empty</font>"].","singulo")
return
else
user << "<font color='red'>The controls are locked!</font>"
to_chat(user, "<font color='red'>The controls are locked!</font>")
return
..()
@@ -62,23 +62,23 @@ var/global/list/rad_collectors = list()
/obj/machinery/power/rad_collector/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/tank/phoron))
if(!src.anchored)
user << "<font color='red'>The [src] needs to be secured to the floor first.</font>"
to_chat(user, "<font color='red'>The [src] needs to be secured to the floor first.</font>")
return 1
if(src.P)
user << "<font color='red'>There's already a phoron tank loaded.</font>"
to_chat(user, "<font color='red'>There's already a phoron tank loaded.</font>")
return 1
user.drop_item()
src.P = W
W.loc = src
update_icons()
return 1
else if(istype(W, /obj/item/weapon/crowbar))
else if(W.is_crowbar())
if(P && !src.locked)
eject()
return 1
else if(istype(W, /obj/item/weapon/wrench))
else if(W.is_wrench())
if(P)
user << "<font color='blue'>Remove the phoron tank first.</font>"
to_chat(user, "<font color='blue'>Remove the phoron tank first.</font>")
return 1
playsound(src, W.usesound, 75, 1)
src.anchored = !src.anchored
@@ -94,18 +94,18 @@ var/global/list/rad_collectors = list()
if (src.allowed(user))
if(active)
src.locked = !src.locked
user << "The controls are now [src.locked ? "locked." : "unlocked."]"
to_chat(user, "The controls are now [src.locked ? "locked." : "unlocked."]")
else
src.locked = 0 //just in case it somehow gets locked
user << "<font color='red'>The controls can only be locked when the [src] is active.</font>"
to_chat(user, "<font color='red'>The controls can only be locked when the [src] is active.</font>")
else
user << "<font color='red'>Access denied!</font>"
to_chat(user, "<font color='red'>Access denied!</font>")
return 1
return ..()
/obj/machinery/power/rad_collector/examine(mob/user)
if (..(user, 3))
user << "The meter indicates that \the [src] is collecting [last_power] W."
to_chat(user, "The meter indicates that \the [src] is collecting [last_power] W.")
return 1
/obj/machinery/power/rad_collector/ex_act(severity)
+1 -1
View File
@@ -146,7 +146,7 @@
/obj/machinery/power/emitter/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/wrench))
if(W.is_wrench())
if(active)
user << "Turn off [src] first."
return
@@ -103,7 +103,7 @@ field_generator power level display
if(active)
user << "The [src] needs to be off."
return
else if(istype(W, /obj/item/weapon/wrench))
else if(W.is_wrench())
switch(state)
if(0)
state = 1
+1 -1
View File
@@ -17,7 +17,7 @@
if(src) qdel(src)
/obj/machinery/the_singularitygen/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/wrench))
if(W.is_wrench())
anchored = !anchored
playsound(src, W.usesound, 75, 1)
if(anchored)
@@ -207,35 +207,35 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
switch(src.construction_state)//TODO:Might be more interesting to have it need several parts rather than a single list of steps
if(0)
if(iswrench(O))
if(O.is_wrench())
playsound(src, O.usesound, 75, 1)
src.anchored = 1
user.visible_message("[user.name] secures the [src.name] to the floor.", \
"You secure the external bolts.")
temp_state++
if(1)
if(iswrench(O))
if(O.is_wrench())
playsound(src, O.usesound, 75, 1)
src.anchored = 0
user.visible_message("[user.name] detaches the [src.name] from the floor.", \
"You remove the external bolts.")
temp_state--
else if(iscoil(O))
else if(istype(O, /obj/item/stack/cable_coil))
if(O:use(1,user))
user.visible_message("[user.name] adds wires to the [src.name].", \
"You add some wires.")
temp_state++
if(2)
if(iswirecutter(O))//TODO:Shock user if its on?
if(O.is_wirecutter())//TODO:Shock user if its on?
user.visible_message("[user.name] removes some wires from the [src.name].", \
"You remove some wires.")
temp_state--
else if(isscrewdriver(O))
else if(O.is_screwdriver())
user.visible_message("[user.name] closes the [src.name]'s access panel.", \
"You close the access panel.")
temp_state++
if(3)
if(isscrewdriver(O))
if(O.is_screwdriver())
user.visible_message("[user.name] opens the [src.name]'s access panel.", \
"You open the access panel.")
temp_state--
@@ -346,35 +346,35 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
var/temp_state = src.construction_state
switch(src.construction_state)//TODO:Might be more interesting to have it need several parts rather than a single list of steps
if(0)
if(iswrench(O))
if(O.is_wrench())
playsound(src, O.usesound, 75, 1)
src.anchored = 1
user.visible_message("[user.name] secures the [src.name] to the floor.", \
"You secure the external bolts.")
temp_state++
if(1)
if(iswrench(O))
if(O.is_wrench())
playsound(src, O.usesound, 75, 1)
src.anchored = 0
user.visible_message("[user.name] detaches the [src.name] from the floor.", \
"You remove the external bolts.")
temp_state--
else if(iscoil(O))
else if(istype(O, /obj/item/stack/cable_coil))
if(O:use(1))
user.visible_message("[user.name] adds wires to the [src.name].", \
"You add some wires.")
temp_state++
if(2)
if(iswirecutter(O))//TODO:Shock user if its on?
if(O.is_wirecutter())//TODO:Shock user if its on?
user.visible_message("[user.name] removes some wires from the [src.name].", \
"You remove some wires.")
temp_state--
else if(isscrewdriver(O))
else if(O.is_screwdriver())
user.visible_message("[user.name] closes the [src.name]'s access panel.", \
"You close the access panel.")
temp_state++
if(3)
if(isscrewdriver(O))
if(O.is_screwdriver())
user.visible_message("[user.name] opens the [src.name]'s access panel.", \
"You open the access panel.")
temp_state--
+12 -12
View File
@@ -192,7 +192,7 @@
//Will return 1 on failure
/obj/machinery/power/smes/proc/make_terminal(const/mob/user)
if (user.loc == loc)
user << "<span class='warning'>You must not be on the same tile as the [src].</span>"
to_chat(user, "<span class='warning'>You must not be on the same tile as the [src].</span>")
return 1
//Direction the terminal will face to
@@ -204,13 +204,13 @@
tempDir = WEST
var/turf/tempLoc = get_step(src, reverse_direction(tempDir))
if (istype(tempLoc, /turf/space))
user << "<span class='warning'>You can't build a terminal on space.</span>"
to_chat(user, "<span class='warning'>You can't build a terminal on space.</span>")
return 1
else if (istype(tempLoc))
if(!tempLoc.is_plating())
user << "<span class='warning'>You must remove the floor plating first.</span>"
to_chat(user, "<span class='warning'>You must remove the floor plating first.</span>")
return 1
user << "<span class='notice'>You start adding cable to the [src].</span>"
to_chat(user, "<span class='notice'>You start adding cable to the [src].</span>")
if(do_after(user, 50))
terminal = new /obj/machinery/power/terminal(tempLoc)
terminal.set_dir(tempDir)
@@ -236,27 +236,27 @@
/obj/machinery/power/smes/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if(istype(W, /obj/item/weapon/screwdriver))
if(W.is_screwdriver())
if(!open_hatch)
open_hatch = 1
user << "<span class='notice'>You open the maintenance hatch of [src].</span>"
to_chat(user, "<span class='notice'>You open the maintenance hatch of [src].</span>")
playsound(src, W.usesound, 50, 1)
return 0
else
open_hatch = 0
user << "<span class='notice'>You close the maintenance hatch of [src].</span>"
to_chat(user, "<span class='notice'>You close the maintenance hatch of [src].</span>")
playsound(src, W.usesound, 50, 1)
return 0
if (!open_hatch)
user << "<span class='warning'>You need to open access hatch on [src] first!</span>"
to_chat(user, "<span class='warning'>You need to open access hatch on [src] first!</span>")
return 0
if(istype(W, /obj/item/stack/cable_coil) && !terminal && !building_terminal)
building_terminal = 1
var/obj/item/stack/cable_coil/CC = W
if (CC.get_amount() <= 10)
user << "<span class='warning'>You need more cables.</span>"
to_chat(user, "<span class='warning'>You need more cables.</span>")
building_terminal = 0
return 0
if (make_terminal(user))
@@ -270,14 +270,14 @@
stat = 0
return 0
else if(istype(W, /obj/item/weapon/wirecutters) && terminal && !building_terminal)
else if(W.is_wirecutter() && terminal && !building_terminal)
building_terminal = 1
var/turf/tempTDir = terminal.loc
if (istype(tempTDir))
if(!tempTDir.is_plating())
user << "<span class='warning'>You must remove the floor plating first.</span>"
to_chat(user, "<span class='warning'>You must remove the floor plating first.</span>")
else
user << "<span class='notice'>You begin to cut the cables...</span>"
to_chat(user, "<span class='notice'>You begin to cut the cables...</span>")
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(user, 50 * W.toolspeed))
if (prob(50) && electrocute_mob(usr, terminal.powernet, terminal))
+1 -1
View File
@@ -328,7 +328,7 @@
failure_probability = 0
// Crowbar - Disassemble the SMES.
if(istype(W, /obj/item/weapon/crowbar))
if(W.is_crowbar())
if (terminal)
to_chat(user, "<span class='warning'>You have to disassemble the terminal first!</span>")
return
+8 -8
View File
@@ -61,7 +61,7 @@ var/list/solars_list = list()
/obj/machinery/power/solar/attackby(obj/item/weapon/W, mob/user)
if(istype(W, /obj/item/weapon/crowbar))
if(W.is_crowbar())
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
user.visible_message("<span class='notice'>[user] begins to take the glass off the solar panel.</span>")
if(do_after(user, 50))
@@ -228,13 +228,13 @@ var/list/solars_list = list()
if (!isturf(loc))
return 0
if(!anchored)
if(istype(W, /obj/item/weapon/wrench))
if(W.is_wrench())
anchored = 1
user.visible_message("<span class='notice'>[user] wrenches the solar assembly into place.</span>")
playsound(src, W.usesound, 75, 1)
return 1
else
if(istype(W, /obj/item/weapon/wrench))
if(W.is_wrench())
anchored = 0
user.visible_message("<span class='notice'>[user] unwrenches the solar assembly from it's place.</span>")
playsound(src, W.usesound, 75, 1)
@@ -251,7 +251,7 @@ var/list/solars_list = list()
else
new /obj/machinery/power/solar(get_turf(src), src)
else
user << "<span class='warning'>You need two sheets of glass to put them into a solar panel.</span>"
to_chat(user, "<span class='warning'>You need two sheets of glass to put them into a solar panel.</span>")
return
return 1
@@ -263,7 +263,7 @@ var/list/solars_list = list()
user.visible_message("<span class='notice'>[user] inserts the electronics into the solar assembly.</span>")
return 1
else
if(istype(W, /obj/item/weapon/crowbar))
if(W.is_crowbar())
new /obj/item/weapon/tracker_electronics(src.loc)
tracker = 0
user.visible_message("<span class='notice'>[user] takes out the electronics from the solar assembly.</span>")
@@ -403,11 +403,11 @@ var/list/solars_list = list()
return
/obj/machinery/power/solar_control/attackby(obj/item/I, user as mob)
if(istype(I, /obj/item/weapon/screwdriver))
if(I.is_screwdriver())
playsound(src, I.usesound, 50, 1)
if(do_after(user, 20))
if (src.stat & BROKEN)
user << "<font color='blue'>The broken glass falls out.</font>"
to_chat(user, "<font color='blue'>The broken glass falls out.</font>")
var/obj/structure/frame/A = new /obj/structure/frame/computer( src.loc )
new /obj/item/weapon/material/shard( src.loc )
var/obj/item/weapon/circuitboard/solar_control/M = new /obj/item/weapon/circuitboard/solar_control( A )
@@ -419,7 +419,7 @@ var/list/solars_list = list()
A.anchored = 1
qdel(src)
else
user << "<font color='blue'>You disconnect the monitor.</font>"
to_chat(user, "<font color='blue'>You disconnect the monitor.</font>")
var/obj/structure/frame/A = new /obj/structure/frame/computer( src.loc )
var/obj/item/weapon/circuitboard/solar_control/M = new /obj/item/weapon/circuitboard/solar_control( A )
for (var/obj/C in src)
+1 -1
View File
@@ -59,7 +59,7 @@
/obj/machinery/power/tracker/attackby(var/obj/item/weapon/W, var/mob/user)
if(istype(W, /obj/item/weapon/crowbar))
if(W.is_crowbar())
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
user.visible_message("<span class='notice'>[user] begins to take the glass off the solar tracker.</span>")
if(do_after(user, 50))
+4 -4
View File
@@ -124,14 +124,14 @@
return
if(default_deconstruction_crowbar(user, W))
return
if(ismultitool(W))
if(istype(W, /obj/item/device/multitool))
var/new_ident = input("Enter a new ident tag.", name, comp_id) as null|text
if(new_ident && user.Adjacent(src))
comp_id = new_ident
return
return ..()
/obj/machinery/compressor/default_unfasten_wrench(var/mob/user, var/obj/item/weapon/wrench/W, var/time = 20)
/obj/machinery/compressor/default_unfasten_wrench(var/mob/user, var/obj/item/weapon/W, var/time = 20)
if((. = ..()))
turbine = null
if(anchored)
@@ -229,7 +229,7 @@
return
return ..()
/obj/machinery/power/turbine/default_unfasten_wrench(var/mob/user, var/obj/item/weapon/wrench/W, var/time = 20)
/obj/machinery/power/turbine/default_unfasten_wrench(var/mob/user, var/obj/item/weapon/W, var/time = 20)
if((. = ..()))
compressor = null
if(anchored)
@@ -337,7 +337,7 @@
doors += P
/obj/machinery/computer/turbine_computer/attackby(obj/item/W, mob/user)
if(ismultitool(W))
if(istype(W, /obj/item/device/multitool))
var/new_ident = input("Enter a new ident tag.", name, id) as null|text
if(new_ident && user.Adjacent(src))
id = new_ident
+14 -14
View File
@@ -30,20 +30,20 @@
update_icon()
/obj/item/ammo_casing/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/screwdriver))
if(W.is_screwdriver())
if(!BB)
user << "<font color='blue'>There is no bullet in the casing to inscribe anything into.</font>"
to_chat(user, "<font color='blue'>There is no bullet in the casing to inscribe anything into.</font>")
return
var/tmp_label = ""
var/label_text = sanitizeSafe(input(user, "Inscribe some text into \the [initial(BB.name)]","Inscription",tmp_label), MAX_NAME_LEN)
if(length(label_text) > 20)
user << "<font color='red'>The inscription can be at most 20 characters long.</font>"
to_chat(user, "<font color='red'>The inscription can be at most 20 characters long.</font>")
else if(!label_text)
user << "<font color='blue'>You scratch the inscription off of [initial(BB)].</font>"
to_chat(user, "<font color='blue'>You scratch the inscription off of [initial(BB)].</font>")
BB.name = initial(BB.name)
else
user << "<font color='blue'>You inscribe \"[label_text]\" into \the [initial(BB.name)].</font>"
to_chat(user, "<font color='blue'>You inscribe \"[label_text]\" into \the [initial(BB.name)].</font>")
BB.name = "[initial(BB.name)] (\"[label_text]\")"
/obj/item/ammo_casing/update_icon()
@@ -55,7 +55,7 @@
/obj/item/ammo_casing/examine(mob/user)
..()
if (!BB)
user << "This one is spent."
to_chat(user, "This one is spent.")
//Gun loading types
#define SINGLE_CASING 1 //The gun only accepts ammo_casings. ammo_magazines should never have this as their mag_type.
@@ -110,10 +110,10 @@
if(istype(W, /obj/item/ammo_casing))
var/obj/item/ammo_casing/C = W
if(C.caliber != caliber)
user << "<span class='warning'>[C] does not fit into [src].</span>"
to_chat(user, "<span class='warning'>[C] does not fit into [src].</span>")
return
if(stored_ammo.len >= max_ammo)
user << "<span class='warning'>[src] is full!</span>"
to_chat(user, "<span class='warning'>[src] is full!</span>")
return
user.remove_from_mob(C)
C.loc = src
@@ -122,13 +122,13 @@
if(istype(W, /obj/item/ammo_magazine/clip))
var/obj/item/ammo_magazine/clip/L = W
if(L.caliber != caliber)
user << "<span class='warning'>The ammo in [L] does not fit into [src].</span>"
to_chat(user, "<span class='warning'>The ammo in [L] does not fit into [src].</span>")
return
if(!L.stored_ammo.len)
user << "<span class='warning'>There's no more ammo [L]!</span>"
to_chat(user, "<span class='warning'>There's no more ammo [L]!</span>")
return
if(stored_ammo.len >= max_ammo)
user << "<span class='warning'>[src] is full!</span>"
to_chat(user, "<span class='warning'>[src] is full!</span>")
return
var/obj/item/ammo_casing/AC = L.stored_ammo[1] //select the next casing.
L.stored_ammo -= AC //Remove this casing from loaded list of the clip.
@@ -140,9 +140,9 @@
/obj/item/ammo_magazine/attack_self(mob/user)
if(!stored_ammo.len)
user << "<span class='notice'>[src] is already empty!</span>"
to_chat(user, "<span class='notice'>[src] is already empty!</span>")
return
user << "<span class='notice'>You empty [src].</span>"
to_chat(user, "<span class='notice'>You empty [src].</span>")
for(var/obj/item/ammo_casing/C in stored_ammo)
C.loc = user.loc
C.set_dir(pick(cardinal))
@@ -162,7 +162,7 @@
/obj/item/ammo_magazine/examine(mob/user)
..()
user << "There [(stored_ammo.len == 1)? "is" : "are"] [stored_ammo.len] round\s left!"
to_chat(user, "There [(stored_ammo.len == 1)? "is" : "are"] [stored_ammo.len] round\s left!")
//magazine icon state caching
/var/global/list/magazine_icondata_keys = list()
+13 -13
View File
@@ -150,11 +150,11 @@
if(dna_lock && attached_lock.stored_dna)
if(!authorized_user(user))
if(attached_lock.safety_level == 0)
M << "<span class='danger'>\The [src] buzzes in dissapoint and displays an invalid DNA symbol.</span>"
to_chat(M, "<span class='danger'>\The [src] buzzes in dissapoint and displays an invalid DNA symbol.</span>")
return 0
if(!attached_lock.exploding)
if(attached_lock.safety_level == 1)
M << "<span class='danger'>\The [src] hisses in dissapointment.</span>"
to_chat(M, "<span class='danger'>\The [src] hisses in dissapointment.</span>")
visible_message("<span class='game say'><span class='name'>\The [src]</span> announces, \"Self-destruct occurring in ten seconds.\"</span>", "<span class='game say'><span class='name'>\The [src]</span> announces, \"Self-destruct occurring in ten seconds.\"</span>")
spawn(100)
explosion(src, 0, 0, 3, 4)
@@ -163,7 +163,7 @@
qdel(src)
return 0
if(HULK in M.mutations)
M << "<span class='danger'>Your fingers are much too large for the trigger guard!</span>"
to_chat(M, "<span class='danger'>Your fingers are much too large for the trigger guard!</span>")
return 0
if((CLUMSY in M.mutations) && prob(40)) //Clumsy handling
var/obj/P = consume_next_projectile()
@@ -196,7 +196,7 @@
return
if(user && user.a_intent == I_HELP && user.is_preference_enabled(/datum/client_preference/safefiring)) //regardless of what happens, refuse to shoot if help intent is on
user << "<span class='warning'>You refrain from firing your [src] as your intent is set to help.</span>"
to_chat(user, "<span class='warning'>You refrain from firing your [src] as your intent is set to help.</span>")
return
else
@@ -236,9 +236,9 @@
/obj/item/weapon/gun/attackby(var/obj/item/A as obj, mob/user as mob)
if(istype(A, /obj/item/dnalockingchip))
if(dna_lock)
user << "<span class='notice'>\The [src] already has a [attached_lock].</span>"
to_chat(user, "<span class='notice'>\The [src] already has a [attached_lock].</span>")
return
user << "<span class='notice'>You insert \the [A] into \the [src].</span>"
to_chat(user, "<span class='notice'>You insert \the [A] into \the [src].</span>")
user.drop_item()
A.loc = src
attached_lock = A
@@ -248,12 +248,12 @@
verbs += /obj/item/weapon/gun/verb/allow_dna
return
if(istype(A, /obj/item/weapon/screwdriver))
if(A.is_screwdriver())
if(dna_lock && attached_lock && !attached_lock.controller_lock)
user << "<span class='notice'>You begin removing \the [attached_lock] from \the [src].</span>"
to_chat(user, "<span class='notice'>You begin removing \the [attached_lock] from \the [src].</span>")
playsound(src, A.usesound, 50, 1)
if(do_after(user, 25 * A.toolspeed))
user << "<span class='notice'>You remove \the [attached_lock] from \the [src].</span>"
to_chat(user, "<span class='notice'>You remove \the [attached_lock] from \the [src].</span>")
user.put_in_hands(attached_lock)
dna_lock = 0
attached_lock = null
@@ -261,12 +261,12 @@
verbs -= /obj/item/weapon/gun/verb/give_dna
verbs -= /obj/item/weapon/gun/verb/allow_dna
else
user << "<span class='warning'>\The [src] is not accepting modifications at this time.</span>"
to_chat(user, "<span class='warning'>\The [src] is not accepting modifications at this time.</span>")
..()
/obj/item/weapon/gun/emag_act(var/remaining_charges, var/mob/user)
if(dna_lock && attached_lock.controller_lock)
user << "<span class='notice'>You short circuit the internal locking mechanisms of \the [src]!</span>"
to_chat(user, "<span class='notice'>You short circuit the internal locking mechanisms of \the [src]!</span>")
attached_lock.controller_dna = null
attached_lock.controller_lock = 0
attached_lock.stored_dna = list()
@@ -317,7 +317,7 @@
if(world.time < next_fire_time)
if (world.time % 3) //to prevent spam
user << "<span class='warning'>[src] is not ready to fire again!</span>"
to_chat(user, "<span class='warning'>[src] is not ready to fire again!</span>")
return
var/shoot_time = (burst - 1)* burst_delay
@@ -681,7 +681,7 @@
user.apply_damage(in_chamber.damage*2.5, in_chamber.damage_type, "head", used_weapon = "Point blank shot in the mouth with \a [in_chamber]", sharp=1)
user.death()
else
user << "<span class = 'notice'>Ow...</span>"
to_chat(user, "<span class = 'notice'>Ow...</span>")
user.apply_effect(110,AGONY,0)
qdel(in_chamber)
mouthshoot = 0
@@ -162,7 +162,7 @@
else
user << "<span class='notice'>[src] already has a cell installed.</span>"
else if(istype(W, /obj/item/weapon/screwdriver))
else if(W.is_screwdriver())
if(cell)
var/obj/item/C = cell
C.loc = get_turf(user)
@@ -227,7 +227,7 @@
else
user << "<span class='notice'>You need at least three rods to complete this task.</span>"
return
else if(istype(W,/obj/item/weapon/weldingtool))
else if(istype(W, /obj/item/weapon/weldingtool))
if(buildstate == 1)
var/obj/item/weapon/weldingtool/T = W
if(T.remove_fuel(0,user))
@@ -237,7 +237,7 @@
buildstate++
update_icon()
return
else if(istype(W,/obj/item/stack/cable_coil))
else if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = W
if(buildstate == 2)
if(C.use(5))
@@ -265,7 +265,7 @@
else
user << "<span class='notice'>You need at least three plastic sheets to complete this task.</span>"
return
else if(istype(W,/obj/item/weapon/screwdriver))
else if(W.is_screwdriver())
if(buildstate == 5)
user << "<span class='notice'>You secure the crossbow's various parts.</span>"
playsound(src, W.usesound, 50, 1)
@@ -105,7 +105,7 @@
update_icon()
return
if(isscrewdriver(thing))
if(thing.is_screwdriver())
if(!capacitor)
to_chat(user, "<span class='warning'>\The [src] has no capacitor installed.</span>")
return
@@ -66,7 +66,7 @@
increment_construction_stage()
return
if(isscrewdriver(thing) && construction_stage >= 9)
if(thing.is_screwdriver() && construction_stage >= 9)
user.visible_message("<span class='notice'>\The [user] secures \the [src] and finishes it off.</span>")
playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1)
var/obj/item/weapon/gun/magnetic/coilgun = new(loc)
@@ -50,12 +50,12 @@
FireModeModify()
/obj/item/weapon/gun/energy/modular/attackby(obj/item/O, mob/user)
if(istype(O, /obj/item/weapon/screwdriver))
if(O.is_screwdriver())
to_chat(user, "<span class='notice'>You [assembled ? "disassemble" : "assemble"] the gun.</span>")
assembled = !assembled
playsound(src, O.usesound, 50, 1)
return
if(istype(O, /obj/item/weapon/crowbar))
if(O.is_crowbar())
if(assembled == 1)
to_chat(user, "<span class='warning'>Disassemble the [src] first!</span>")
return
@@ -130,11 +130,11 @@
/obj/item/weapon/gun/energy/modular/load_ammo(var/obj/item/C, mob/user)
if(istype(C, cell_type))
if(self_recharge || battery_lock)
user << "<span class='notice'>[src] does not have a battery port.</span>"
to_chat(user, "<span class='notice'>[src] does not have a battery port.</span>")
return
var/obj/item/weapon/cell/P = C
if(power_supply)
user << "<span class='notice'>[src] already has a power cell.</span>"
to_chat(user, "<span class='notice'>[src] already has a power cell.</span>")
else
user.visible_message("[user] is reloading [src].", "<span class='notice'>You start to insert [P] into [src].</span>")
if(do_after(user, 10))
+2 -2
View File
@@ -193,8 +193,8 @@ datum/supply_drop_loot/riot
/obj/item/weapon/reagent_containers/food/snacks/tastybread,
/obj/item/weapon/reagent_containers/food/drinks/glass2/fitnessflask/proteinshake,
/obj/item/weapon/reagent_containers/food/drinks/glass2/fitnessflask/proteinshake,
/obj/item/weapon/crowbar,
/obj/item/weapon/crowbar,
/obj/item/weapon/tool/crowbar,
/obj/item/weapon/tool/crowbar,
/obj/item/device/flashlight,
/obj/item/device/flashlight,
/obj/item/clothing/suit/storage/hazardvest,
+11 -11
View File
@@ -50,24 +50,24 @@
if(istype(B, /obj/item/weapon/reagent_containers/glass) || istype(B, /obj/item/weapon/reagent_containers/food))
if(src.beaker)
user << "\A [beaker] is already loaded into the machine."
to_chat(user, "\A [beaker] is already loaded into the machine.")
return
src.beaker = B
user.drop_item()
B.loc = src
user << "You add \the [B] to the machine!"
to_chat(user, "You add \the [B] to the machine!")
icon_state = "mixer1"
else if(istype(B, /obj/item/weapon/storage/pill_bottle))
if(src.loaded_pill_bottle)
user << "A \the [loaded_pill_bottle] s already loaded into the machine."
to_chat(user, "A \the [loaded_pill_bottle] s already loaded into the machine.")
return
src.loaded_pill_bottle = B
user.drop_item()
B.loc = src
user << "You add \the [loaded_pill_bottle] into the dispenser slot!"
to_chat(user, "You add \the [loaded_pill_bottle] into the dispenser slot!")
else if(default_unfasten_wrench(user, B, 20))
return
@@ -346,7 +346,7 @@
return 0
if(holdingitems && holdingitems.len >= limit)
usr << "The machine cannot hold anymore items."
to_chat(user, "The machine cannot hold anymore items.")
return 1
if(!istype(O))
@@ -365,13 +365,13 @@
break
if(failed)
user << "Nothing in the plant bag is usable."
to_chat(user, "Nothing in the plant bag is usable.")
return 1
if(!O.contents.len)
user << "You empty \the [O] into \the [src]."
to_chat(user, "You empty \the [O] into \the [src].")
else
user << "You fill \the [src] from \the [O]."
to_chat(user, "You fill \the [src] from \the [O].")
src.updateUsrDialog()
return 0
@@ -379,16 +379,16 @@
if(istype(O,/obj/item/weapon/gripper))
var/obj/item/weapon/gripper/B = O //B, for Borg.
if(!B.wrapped)
user << "\The [B] is not holding anything."
to_chat(user, "\The [B] is not holding anything.")
return 0
else
var/B_held = B.wrapped
user << "You use \the [B] to load \the [src] with \the [B_held]."
to_chat(user, "You use \the [B] to load \the [src] with \the [B_held].")
return 0
if(!sheet_reagents[O.type] && (!O.reagents || !O.reagents.total_volume))
user << "\The [O] is not suitable for blending."
to_chat(user, "\The [O] is not suitable for blending.")
return 1
user.remove_from_mob(O)
+15 -15
View File
@@ -26,32 +26,32 @@
/obj/machinery/chemical_dispenser/examine(mob/user)
..()
user << "It has [cartridges.len] cartridges installed, and has space for [DISPENSER_MAX_CARTRIDGES - cartridges.len] more."
to_chat(user, "It has [cartridges.len] cartridges installed, and has space for [DISPENSER_MAX_CARTRIDGES - cartridges.len] more.")
/obj/machinery/chemical_dispenser/proc/add_cartridge(obj/item/weapon/reagent_containers/chem_disp_cartridge/C, mob/user)
if(!istype(C))
if(user)
user << "<span class='warning'>\The [C] will not fit in \the [src]!</span>"
to_chat(user, "<span class='warning'>\The [C] will not fit in \the [src]!</span>")
return
if(cartridges.len >= DISPENSER_MAX_CARTRIDGES)
if(user)
user << "<span class='warning'>\The [src] does not have any slots open for \the [C] to fit into!</span>"
to_chat(user, "<span class='warning'>\The [src] does not have any slots open for \the [C] to fit into!</span>")
return
if(!C.label)
if(user)
user << "<span class='warning'>\The [C] does not have a label!</span>"
to_chat(user, "<span class='warning'>\The [C] does not have a label!</span>")
return
if(cartridges[C.label])
if(user)
user << "<span class='warning'>\The [src] already contains a cartridge with that label!</span>"
to_chat(user, "<span class='warning'>\The [src] already contains a cartridge with that label!</span>")
return
if(user)
user.drop_from_inventory(C)
user << "<span class='notice'>You add \the [C] to \the [src].</span>"
to_chat(user, "<span class='notice'>You add \the [C] to \the [src].</span>")
C.loc = src
cartridges[C.label] = C
@@ -64,9 +64,9 @@
nanomanager.update_uis(src)
/obj/machinery/chemical_dispenser/attackby(obj/item/weapon/W, mob/user)
if(istype(W, /obj/item/weapon/wrench))
if(W.is_wrench())
playsound(src, W.usesound, 50, 1)
user << "<span class='notice'>You begin to [anchored ? "un" : ""]fasten \the [src].</span>"
to_chat(user, "<span class='notice'>You begin to [anchored ? "un" : ""]fasten \the [src].</span>")
if (do_after(user, 20 * W.toolspeed))
user.visible_message(
"<span class='notice'>\The [user] [anchored ? "un" : ""]fastens \the [src].</span>",
@@ -74,39 +74,39 @@
"You hear a ratchet.")
anchored = !anchored
else
user << "<span class='notice'>You decide not to [anchored ? "un" : ""]fasten \the [src].</span>"
to_chat(user, "<span class='notice'>You decide not to [anchored ? "un" : ""]fasten \the [src].</span>")
else if(istype(W, /obj/item/weapon/reagent_containers/chem_disp_cartridge))
add_cartridge(W, user)
else if(istype(W, /obj/item/weapon/screwdriver))
else if(W.is_screwdriver())
var/label = input(user, "Which cartridge would you like to remove?", "Chemical Dispenser") as null|anything in cartridges
if(!label) return
var/obj/item/weapon/reagent_containers/chem_disp_cartridge/C = remove_cartridge(label)
if(C)
user << "<span class='notice'>You remove \the [C] from \the [src].</span>"
to_chat(user, "<span class='notice'>You remove \the [C] from \the [src].</span>")
C.loc = loc
playsound(src, W.usesound, 50, 1)
else if(istype(W, /obj/item/weapon/reagent_containers/glass) || istype(W, /obj/item/weapon/reagent_containers/food))
if(container)
user << "<span class='warning'>There is already \a [container] on \the [src]!</span>"
to_chat(user, "<span class='warning'>There is already \a [container] on \the [src]!</span>")
return
var/obj/item/weapon/reagent_containers/RC = W
if(!accept_drinking && istype(RC,/obj/item/weapon/reagent_containers/food))
user << "<span class='warning'>This machine only accepts beakers!</span>"
to_chat(user, "<span class='warning'>This machine only accepts beakers!</span>")
return
if(!RC.is_open_container())
user << "<span class='warning'>You don't see how \the [src] could dispense reagents into \the [RC].</span>"
to_chat(user, "<span class='warning'>You don't see how \the [src] could dispense reagents into \the [RC].</span>")
return
container = RC
user.drop_from_inventory(RC)
RC.loc = src
user << "<span class='notice'>You set \the [RC] on \the [src].</span>"
to_chat(user, "<span class='notice'>You set \the [RC] on \the [src].</span>")
nanomanager.update_uis(src) // update all UIs attached to src
else
@@ -252,7 +252,7 @@
flags = OPENCONTAINER
unacidable = 0
/obj/item/weapon/reagent_containers/glass/bucket/attackby(var/obj/D, mob/user as mob)
/obj/item/weapon/reagent_containers/glass/bucket/attackby(var/obj/item/D, mob/user as mob)
if(isprox(D))
user << "You add [D] to [src]."
qdel(D)
@@ -260,7 +260,7 @@
user.drop_from_inventory(src)
qdel(src)
return
else if(istype(D, /obj/item/weapon/wirecutters))
else if(D.is_wirecutter())
to_chat(user, "<span class='notice'>You cut a big hole in \the [src] with \the [D]. It's kinda useless as a bucket now.</span>")
user.put_in_hands(new /obj/item/clothing/head/helmet/bucket)
user.drop_from_inventory(src)
+23 -23
View File
@@ -27,12 +27,12 @@
/obj/structure/reagent_dispensers/examine(mob/user)
if(!..(user, 2))
return
user << "<span class='notice'>It contains:</span>"
to_chat(user, "<span class='notice'>It contains:</span>")
if(reagents && reagents.reagent_list.len)
for(var/datum/reagent/R in reagents.reagent_list)
user << "<span class='notice'>[R.volume] units of [R.name]</span>"
to_chat(user, "<span class='notice'>[R.volume] units of [R.name]</span>")
else
user << "<span class='notice'>Nothing.</span>"
to_chat(user, "<span class='notice'>Nothing.</span>")
/obj/structure/reagent_dispensers/verb/set_APTFT() //set amount_per_transfer_from_this
set name = "Set transfer amount"
@@ -103,9 +103,9 @@
if(!..(user, 2))
return
if (modded)
user << "<span class='warning'>Fuel faucet is wrenched open, leaking the fuel!</span>"
to_chat(user, "<span class='warning'>Fuel faucet is wrenched open, leaking the fuel!</span>")
if(rig)
user << "<span class='notice'>There is some kind of device rigged to the tank.</span>"
to_chat(user, "<span class='notice'>There is some kind of device rigged to the tank.</span>")
/obj/structure/reagent_dispensers/fueltank/attack_hand()
if (rig)
@@ -118,7 +118,7 @@
/obj/structure/reagent_dispensers/fueltank/attackby(obj/item/weapon/W as obj, mob/user as mob)
src.add_fingerprint(user)
if (istype(W,/obj/item/weapon/wrench))
if (W.is_wrench())
user.visible_message("[user] wrenches [src]'s faucet [modded ? "closed" : "open"].", \
"You wrench [src]'s faucet [modded ? "closed" : "open"]")
modded = modded ? 0 : 1
@@ -129,7 +129,7 @@
leak_fuel(amount_per_transfer_from_this)
if (istype(W,/obj/item/device/assembly_holder))
if (rig)
user << "<span class='warning'>There is another device in the way.</span>"
to_chat(user, "<span class='warning'>There is another device in the way.</span>")
return ..()
user.visible_message("[user] begins rigging [W] to \the [src].", "You begin rigging [W] to \the [src]")
if(do_after(user, 20))
@@ -236,15 +236,15 @@
/obj/structure/reagent_dispensers/water_cooler/examine(mob/user)
..()
if(cupholder)
user << "<span class='notice'>There are [cups] cups in the cup dispenser.</span>"
to_chat(user, "<span class='notice'>There are [cups] cups in the cup dispenser.</span>")
/obj/structure/reagent_dispensers/water_cooler/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I, /obj/item/weapon/wrench))
if(I.is_wrench())
src.add_fingerprint(user)
if(bottle)
playsound(loc, I.usesound, 50, 1)
if(do_after(user, 20) && bottle)
user << "<span class='notice'>You unfasten the jug.</span>"
to_chat(user, "<span class='notice'>You unfasten the jug.</span>")
var/obj/item/weapon/reagent_containers/glass/cooler_bottle/G = new /obj/item/weapon/reagent_containers/glass/cooler_bottle( src.loc )
for(var/datum/reagent/R in reagents.reagent_list)
var/total_reagent = reagents.get_reagent_amount(R.id)
@@ -259,15 +259,15 @@
user.visible_message("\The [user] begins securing \the [src] to the floor.", "You start securing \the [src] to the floor.")
if(do_after(user, 20 * I.toolspeed, src))
if(!src) return
user << "<span class='notice'>You [anchored? "un" : ""]secured \the [src]!</span>"
to_chat(user, "<span class='notice'>You [anchored? "un" : ""]secured \the [src]!</span>")
anchored = !anchored
playsound(loc, I.usesound, 50, 1)
return
if(istype(I, /obj/item/weapon/screwdriver))
if(I.is_screwdriver())
if(cupholder)
playsound(loc, I.usesound, 50, 1)
user << "<span class='notice'>You take the cup dispenser off.</span>"
to_chat(user, "<span class='notice'>You take the cup dispenser off.</span>")
new /obj/item/stack/material/plastic( src.loc )
if(cups)
for(var/i = 0 to cups)
@@ -278,9 +278,9 @@
return
if(!bottle && !cupholder)
playsound(loc, I.usesound, 50, 1)
user << "<span class='notice'>You start taking the water-cooler apart.</span>"
to_chat(user, "<span class='notice'>You start taking the water-cooler apart.</span>")
if(do_after(user, 20 * I.toolspeed) && !bottle && !cupholder)
user << "<span class='notice'>You take the water-cooler apart.</span>"
to_chat(user, "<span class='notice'>You take the water-cooler apart.</span>")
new /obj/item/stack/material/plastic( src.loc, 4 )
qdel(src)
return
@@ -290,19 +290,19 @@
if(!bottle)
if(anchored)
var/obj/item/weapon/reagent_containers/glass/cooler_bottle/G = I
user << "<span class='notice'>You start to screw the bottle onto the water-cooler.</span>"
to_chat(user, "<span class='notice'>You start to screw the bottle onto the water-cooler.</span>")
if(do_after(user, 20) && !bottle && anchored)
bottle = 1
update_icon()
user << "<span class='notice'>You screw the bottle onto the water-cooler!</span>"
to_chat(user, "<span class='notice'>You screw the bottle onto the water-cooler!</span>")
for(var/datum/reagent/R in G.reagents.reagent_list)
var/total_reagent = G.reagents.get_reagent_amount(R.id)
reagents.add_reagent(R.id, total_reagent)
qdel(G)
else
user << "<span class='warning'>You need to wrench down the cooler first.</span>"
to_chat(user, "<span class='warning'>You need to wrench down the cooler first.</span>")
else
user << "<span class='warning'>There is already a bottle there!</span>"
to_chat(user, "<span class='warning'>There is already a bottle there!</span>")
return 1
if(istype(I, /obj/item/stack/material/plastic))
@@ -310,17 +310,17 @@
if(anchored)
var/obj/item/stack/material/plastic/P = I
src.add_fingerprint(user)
user << "<span class='notice'>You start to attach a cup dispenser onto the water-cooler.</span>"
to_chat(user, "<span class='notice'>You start to attach a cup dispenser onto the water-cooler.</span>")
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(user, 20) && !cupholder && anchored)
if (P.use(1))
user << "<span class='notice'>You attach a cup dispenser onto the water-cooler.</span>"
to_chat(user, "<span class='notice'>You attach a cup dispenser onto the water-cooler.</span>")
cupholder = 1
update_icon()
else
user << "<span class='warning'>You need to wrench down the cooler first.</span>"
to_chat(user, "<span class='warning'>You need to wrench down the cooler first.</span>")
else
user << "<span class='warning'>There is already a cup dispenser there!</span>"
to_chat(user, "<span class='warning'>There is already a cup dispenser there!</span>")
return
/obj/structure/reagent_dispensers/water_cooler/attack_hand(mob/user)
+5 -5
View File
@@ -100,7 +100,7 @@
if(panel_open)
var/input = sanitize(input(usr, "What id would you like to give this conveyor?", "Multitool-Conveyor interface", id))
if(!input)
usr << "No input found please hang up and try your call again."
to_chat(user, "No input found. Please hang up and try your call again.")
return
id = input
for(var/obj/machinery/conveyor_switch/C in machines)
@@ -220,7 +220,7 @@
// attack with hand, switch position
/obj/machinery/conveyor_switch/attack_hand(mob/user)
if(!allowed(user))
user << "<span class='warning'>Access denied.</span>"
to_chat(user, "<span class='warning'>Access denied.</span>")
return
if(position == 0)
@@ -251,12 +251,12 @@
if(panel_open)
var/obj/item/weapon/weldingtool/WT = I
if(!WT.remove_fuel(0, user))
user << "The welding tool must be on to complete this task."
to_chat(user, "The welding tool must be on to complete this task.")
return
playsound(src, WT.usesound, 50, 1)
if(do_after(user, 20 * WT.toolspeed))
if(!src || !WT.isOn()) return
user << "<span class='notice'>You deconstruct the frame.</span>"
to_chat(user, "<span class='notice'>You deconstruct the frame.</span>")
new /obj/item/stack/material/steel( src.loc, 2 )
qdel(src)
return
@@ -265,7 +265,7 @@
if(panel_open)
var/input = sanitize(input(usr, "What id would you like to give this conveyor switch?", "Multitool-Conveyor interface", id))
if(!input)
usr << "No input found please hang up and try your call again."
to_chat(user, "No input found. Please hang up and try your call again.")
return
id = input
conveyors = list() // Clear list so they aren't double added.
+13 -13
View File
@@ -112,7 +112,7 @@
return
if(anchored)
usr << "You must unfasten the pipe before rotating it."
to_chat(usr, "You must unfasten the pipe before rotating it.")
return
set_dir(turn(dir, -90))
@@ -126,7 +126,7 @@
return
if(anchored)
usr << "You must unfasten the pipe before flipping it."
to_chat(usr, "You must unfasten the pipe before flipping it.")
return
set_dir(turn(dir, 180))
@@ -223,12 +223,12 @@
var/turf/T = src.loc
if(!T.is_plating())
user << "You can only attach the [nicetype] if the floor plating is removed."
to_chat(user, "You can only attach the [nicetype] if the floor plating is removed.")
return
var/obj/structure/disposalpipe/CP = locate() in T
if(istype(I, /obj/item/weapon/wrench))
if(I.is_wrench())
if(anchored)
anchored = 0
if(ispipe)
@@ -236,15 +236,15 @@
density = 0
else
density = 1
user << "You detach the [nicetype] from the underfloor."
to_chat(user, "You detach the [nicetype] from the underfloor.")
else
if(ptype>=6 && ptype <= 8) // Disposal or outlet
if(CP) // There's something there
if(!istype(CP,/obj/structure/disposalpipe/trunk))
user << "The [nicetype] requires a trunk underneath it in order to work."
to_chat(user, "The [nicetype] requires a trunk underneath it in order to work.")
return
else // Nothing under, fuck.
user << "The [nicetype] requires a trunk underneath it in order to work."
to_chat(user, "The [nicetype] requires a trunk underneath it in order to work.")
return
else
if(CP)
@@ -253,7 +253,7 @@
if(istype(CP, /obj/structure/disposalpipe/broken))
pdir = CP.dir
if(pdir & dpdir)
user << "There is already a [nicetype] at that location."
to_chat(user, "There is already a [nicetype] at that location.")
return
anchored = 1
@@ -262,7 +262,7 @@
density = 0
else
density = 1 // We don't want disposal bins or outlets to go density 0
user << "You attach the [nicetype] to the underfloor."
to_chat(user, "You attach the [nicetype] to the underfloor.")
playsound(loc, I.usesound, 100, 1)
update()
@@ -271,10 +271,10 @@
var/obj/item/weapon/weldingtool/W = I
if(W.remove_fuel(0,user))
playsound(src, W.usesound, 100, 1)
user << "Welding the [nicetype] in place."
to_chat(user, "Welding the [nicetype] in place.")
if(do_after(user, 20 * W.toolspeed))
if(!src || !W.isOn()) return
user << "The [nicetype] has been welded in place!"
to_chat(user, "The [nicetype] has been welded in place!")
update() // TODO: Make this neat
if(ispipe) // Pipe
@@ -316,10 +316,10 @@
qdel(src)
return
else
user << "You need more welding fuel to complete this task."
to_chat(user, "You need more welding fuel to complete this task.")
return
else
user << "You need to attach it to the plating first!"
to_chat(user, "You need to attach it to the plating first!")
return
/obj/structure/disposalconstruct/hides_under_flooring()
+33 -33
View File
@@ -55,32 +55,32 @@
src.add_fingerprint(user)
if(mode<=0) // It's off
if(istype(I, /obj/item/weapon/screwdriver))
if(I.is_screwdriver())
if(contents.len > 0)
user << "Eject the items first!"
to_chat(user, "Eject the items first!")
return
if(mode==0) // It's off but still not unscrewed
mode=-1 // Set it to doubleoff l0l
playsound(src, I.usesound, 50, 1)
user << "You remove the screws around the power connection."
to_chat(user, "You remove the screws around the power connection.")
return
else if(mode==-1)
mode=0
playsound(src, I.usesound, 50, 1)
user << "You attach the screws around the power connection."
to_chat(user, "You attach the screws around the power connection.")
return
else if(istype(I,/obj/item/weapon/weldingtool) && mode==-1)
else if(istype(I, /obj/item/weapon/weldingtool) && mode==-1)
if(contents.len > 0)
user << "Eject the items first!"
to_chat(user, "Eject the items first!")
return
var/obj/item/weapon/weldingtool/W = I
if(W.remove_fuel(0,user))
playsound(src, W.usesound, 100, 1)
user << "You start slicing the floorweld off the disposal unit."
to_chat(user, "You start slicing the floorweld off the disposal unit.")
if(do_after(user,20 * W.toolspeed))
if(!src || !W.isOn()) return
user << "You sliced the floorweld off the disposal unit."
to_chat(user, "You sliced the floorweld off the disposal unit.")
var/obj/structure/disposalconstruct/C = new (src.loc)
src.transfer_fingerprints_to(C)
C.ptype = 6 // 6 = disposal unit
@@ -90,16 +90,16 @@
qdel(src)
return
else
user << "You need more welding fuel to complete this task."
to_chat(user, "You need more welding fuel to complete this task.")
return
if(istype(I, /obj/item/weapon/melee/energy/blade))
user << "You can't place that item inside the disposal unit."
to_chat(user, "You can't place that item inside the disposal unit.")
return
if(istype(I, /obj/item/weapon/storage/bag/trash))
var/obj/item/weapon/storage/bag/trash/T = I
user << "<font color='blue'>You empty the bag.</font>"
to_chat(user, "<font color='blue'>You empty the bag.</font>")
for(var/obj/item/O in T.contents)
T.remove_from_storage(O,src)
T.update_icon()
@@ -143,7 +143,7 @@
if(I)
I.forceMove(src)
user << "You place \the [I] into the [src]."
to_chat(user, "You place \the [I] into the [src].")
for(var/mob/M in viewers(src))
if(M == user)
continue
@@ -179,10 +179,10 @@
if(target == user && !user.stat && !user.weakened && !user.stunned && !user.paralysis) // if drop self, then climbed in
// must be awake, not stunned or whatever
msg = "[user.name] climbs into the [src]."
user << "You climb into the [src]."
to_chat(user, "You climb into the [src].")
else if(target != user && !user.restrained() && !user.stat && !user.weakened && !user.stunned && !user.paralysis)
msg = "[user.name] stuffs [target.name] into the [src]!"
user << "You stuff [target.name] into the [src]!"
to_chat(user, "You stuff [target.name] into the [src]!")
add_attack_logs(user,target,"Disposals dunked")
else
@@ -230,7 +230,7 @@
return
if(user && user.loc == src)
usr << "<font color='red'>You cannot reach the controls from inside.</font>"
to_chat(user, "<font color='red'>You cannot reach the controls from inside.</font>")
return
// Clumsy folks can only flush it.
@@ -279,11 +279,11 @@
/obj/machinery/disposal/Topic(href, href_list)
if(usr.loc == src)
usr << "<font color='red'>You cannot reach the controls from inside.</font>"
to_chat(usr, "<font color='red'>You cannot reach the controls from inside.</font>")
return
if(mode==-1 && !href_list["eject"]) // only allow ejecting if mode is -1
usr << "<font color='red'>The disposal units power is disabled.</font>"
to_chat(usr, "<font color='red'>The disposal units power is disabled.</font>")
return
if(..())
return
@@ -636,7 +636,7 @@
if (src.loc)
for (var/mob/M in hearers(src.loc.loc))
M << "<FONT size=[max(0, 5 - get_dist(src, M))]>CLONG, clong!</FONT>"
to_chat(M, "<FONT size=[max(0, 5 - get_dist(src, M))]>CLONG, clong!</FONT>")
playsound(src.loc, 'sound/effects/clang.ogg', 50, 0, 0)
@@ -885,15 +885,15 @@
// check if anything changed over 2 seconds
var/turf/uloc = user.loc
var/atom/wloc = W.loc
user << "Slicing the disposal pipe."
to_chat(user, "Slicing the disposal pipe.")
sleep(30)
if(!W.isOn()) return
if(user.loc == uloc && wloc == W.loc)
welded()
else
user << "You must stay still while welding the pipe."
to_chat(user, "You must stay still while welding the pipe.")
else
user << "You need more welding fuel to cut the pipe."
to_chat(user, "You need more welding fuel to cut the pipe.")
return
// called when pipe is cut with welder
@@ -1169,7 +1169,7 @@
if(O.currTag)// Tag set
sort_tag = O.currTag
playsound(src.loc, 'sound/machines/twobeep.ogg', 100, 1)
user << "<font color='blue'>Changed tag to '[sort_tag]'.</font>"
to_chat(user, "<font color='blue'>Changed tag to '[sort_tag]'.</font>")
updatename()
updatedesc()
@@ -1237,7 +1237,7 @@
if(O.currTag)// Tag set
sortType = O.currTag
playsound(src.loc, 'sound/machines/twobeep.ogg', 100, 1)
user << "<font color='blue'>Changed filter to '[sortType]'.</font>"
to_chat(user, "<font color='blue'>Changed filter to '[sortType]'.</font>")
updatename()
updatedesc()
@@ -1365,15 +1365,15 @@
// check if anything changed over 2 seconds
var/turf/uloc = user.loc
var/atom/wloc = W.loc
user << "Slicing the disposal pipe."
to_chat(user, "Slicing the disposal pipe.")
sleep(30)
if(!W.isOn()) return
if(user.loc == uloc && wloc == W.loc)
welded()
else
user << "You must stay still while welding the pipe."
to_chat(user, "You must stay still while welding the pipe.")
else
user << "You need more welding fuel to cut the pipe."
to_chat(user, "You need more welding fuel to cut the pipe.")
return
// would transfer to next pipe segment, but we are in a trunk
@@ -1475,25 +1475,25 @@
if(!I || !user)
return
src.add_fingerprint(user)
if(istype(I, /obj/item/weapon/screwdriver))
if(I.is_screwdriver())
if(mode==0)
mode=1
user << "You remove the screws around the power connection."
to_chat(user, "You remove the screws around the power connection.")
playsound(src, I.usesound, 50, 1)
return
else if(mode==1)
mode=0
user << "You attach the screws around the power connection."
to_chat(user, "You attach the screws around the power connection.")
playsound(src, I.usesound, 50, 1)
return
else if(istype(I,/obj/item/weapon/weldingtool) && mode==1)
else if(istype(I, /obj/item/weapon/weldingtool) && mode==1)
var/obj/item/weapon/weldingtool/W = I
if(W.remove_fuel(0,user))
playsound(src, W.usesound, 100, 1)
user << "You start slicing the floorweld off the disposal outlet."
to_chat(user, "You start slicing the floorweld off the disposal outlet.")
if(do_after(user,20 * W.toolspeed))
if(!src || !W.isOn()) return
user << "You sliced the floorweld off the disposal outlet."
to_chat(user, "You sliced the floorweld off the disposal outlet.")
var/obj/structure/disposalconstruct/C = new (src.loc)
src.transfer_fingerprints_to(C)
C.ptype = 7 // 7 = outlet
@@ -1503,7 +1503,7 @@
qdel(src)
return
else
user << "You need more welding fuel to complete this task."
to_chat(user, "You need more welding fuel to complete this task.")
return
// called when movable is expelled from a disposal pipe or outlet
+25 -25
View File
@@ -26,7 +26,7 @@
var/obj/item/device/destTagger/O = W
if(O.currTag)
if(src.sortTag != O.currTag)
user << "<span class='notice'>You have labeled the destination as [O.currTag].</span>"
to_chat(user, "<span class='notice'>You have labeled the destination as [O.currTag].</span>")
if(!src.sortTag)
src.sortTag = O.currTag
update_icon()
@@ -34,16 +34,16 @@
src.sortTag = O.currTag
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 1)
else
user << "<span class='warning'>The package is already labeled for [O.currTag].</span>"
to_chat(user, "<span class='warning'>The package is already labeled for [O.currTag].</span>")
else
user << "<span class='warning'>You need to set a destination first!</span>"
to_chat(user, "<span class='warning'>You need to set a destination first!</span>")
else if(istype(W, /obj/item/weapon/pen))
switch(alert("What would you like to alter?",,"Title","Description", "Cancel"))
if("Title")
var/str = sanitizeSafe(input(usr,"Label text?","Set label",""), MAX_NAME_LEN)
if(!str || !length(str))
usr << "<span class='warning'> Invalid text.</span>"
to_chat(user, "<span class='warning'> Invalid text.</span>")
return
user.visible_message("\The [user] titles \the [src] with \a [W], marking down: \"[str]\"",\
"<span class='notice'>You title \the [src]: \"[str]\"</span>",\
@@ -57,7 +57,7 @@
if("Description")
var/str = sanitize(input(usr,"Label text?","Set label",""))
if(!str || !length(str))
usr << "<font color='red'>Invalid text.</font>"
to_chat(user, "<font color='red'>Invalid text.</font>")
return
if(!examtext && !nameset)
examtext = str
@@ -101,9 +101,9 @@
examine(mob/user)
if(..(user, 4))
if(sortTag)
user << "<span class='notice'>It is labeled \"[sortTag]\"</span>"
to_chat(user, "<span class='notice'>It is labeled \"[sortTag]\"</span>")
if(examtext)
user << "<span class='notice'>It has a note attached which reads, \"[examtext]\"</span>"
to_chat(user, "<span class='notice'>It has a note attached which reads, \"[examtext]\"</span>")
return
/obj/item/smallDelivery
@@ -133,7 +133,7 @@
var/obj/item/device/destTagger/O = W
if(O.currTag)
if(src.sortTag != O.currTag)
user << "<span class='notice'>You have labeled the destination as [O.currTag].</span>"
to_chat(user, "<span class='notice'>You have labeled the destination as [O.currTag].</span>")
if(!src.sortTag)
src.sortTag = O.currTag
update_icon()
@@ -141,16 +141,16 @@
src.sortTag = O.currTag
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 1)
else
user << "<span class='warning'>The package is already labeled for [O.currTag].</span>"
to_chat(user, "<span class='warning'>The package is already labeled for [O.currTag].</span>")
else
user << "<span class='warning'>You need to set a destination first!</span>"
to_chat(user, "<span class='warning'>You need to set a destination first!</span>")
else if(istype(W, /obj/item/weapon/pen))
switch(alert("What would you like to alter?",,"Title","Description", "Cancel"))
if("Title")
var/str = sanitizeSafe(input(usr,"Label text?","Set label",""), MAX_NAME_LEN)
if(!str || !length(str))
usr << "<span class='warning'> Invalid text.</span>"
to_chat(user, "<span class='warning'> Invalid text.</span>")
return
user.visible_message("\The [user] titles \the [src] with \a [W], marking down: \"[str]\"",\
"<span class='notice'>You title \the [src]: \"[str]\"</span>",\
@@ -165,7 +165,7 @@
if("Description")
var/str = sanitize(input(usr,"Label text?","Set label",""))
if(!str || !length(str))
usr << "<font color='red'>Invalid text.</font>"
to_chat(user, "<font color='red'>Invalid text.</font>")
return
if(!examtext && !nameset)
examtext = str
@@ -205,9 +205,9 @@
examine(mob/user)
if(..(user, 4))
if(sortTag)
user << "<span class='notice'>It is labeled \"[sortTag]\"</span>"
to_chat(user, "<span class='notice'>It is labeled \"[sortTag]\"</span>")
if(examtext)
user << "<span class='notice'>It has a note attached which reads, \"[examtext]\"</span>"
to_chat(user, "<span class='notice'>It has a note attached which reads, \"[examtext]\"</span>")
return
/obj/item/weapon/packageWrap
@@ -278,7 +278,7 @@
"<span class='notice'>You wrap \the [target], leaving [amount] units of paper on \the [src].</span>",\
"You hear someone taping paper around a large object.")
else if(src.amount < 3)
user << "<span class='warning'>You need more paper.</span>"
to_chat(user, "<span class='warning'>You need more paper.</span>")
else if (istype (target, /obj/structure/closet))
var/obj/structure/closet/O = target
if (src.amount > 3 && !O.opened)
@@ -291,9 +291,9 @@
"<span class='notice'>You wrap \the [target], leaving [amount] units of paper on \the [src].</span>",\
"You hear someone taping paper around a large object.")
else if(src.amount < 3)
user << "<span class='warning'>You need more paper.</span>"
to_chat(user, "<span class='warning'>You need more paper.</span>")
else
user << "<font color='blue'>The object you are trying to wrap is unsuitable for the sorting machinery!</font>"
to_chat(user, "<font color='blue'>The object you are trying to wrap is unsuitable for the sorting machinery!</font>")
if (src.amount <= 0)
new /obj/item/weapon/c_tube( src.loc )
qdel(src)
@@ -302,7 +302,7 @@
examine(mob/user)
if(..(user, 0))
user << "<font color='blue'>There are [amount] units of package wrap left!</font>"
to_chat(user, "<font color='blue'>There are [amount] units of package wrap left!</font>")
return
@@ -421,25 +421,25 @@
if(!I || !user)
return
if(istype(I, /obj/item/weapon/screwdriver))
if(I.is_screwdriver())
if(c_mode==0)
c_mode=1
playsound(src.loc, I.usesound, 50, 1)
user << "You remove the screws around the power connection."
to_chat(user, "You remove the screws around the power connection.")
return
else if(c_mode==1)
c_mode=0
playsound(src.loc, I.usesound, 50, 1)
user << "You attach the screws around the power connection."
to_chat(user, "You attach the screws around the power connection.")
return
else if(istype(I,/obj/item/weapon/weldingtool) && c_mode==1)
else if(istype(I, /obj/item/weapon/weldingtool) && c_mode==1)
var/obj/item/weapon/weldingtool/W = I
if(W.remove_fuel(0,user))
playsound(src.loc, W.usesound, 50, 1)
user << "You start slicing the floorweld off the delivery chute."
to_chat(user, "You start slicing the floorweld off the delivery chute.")
if(do_after(user,20 * W.toolspeed))
if(!src || !W.isOn()) return
user << "You sliced the floorweld off the delivery chute."
to_chat(user, "You sliced the floorweld off the delivery chute.")
var/obj/structure/disposalconstruct/C = new (src.loc)
C.ptype = 8 // 8 = Delivery chute
C.update()
@@ -448,7 +448,7 @@
qdel(src)
return
else
user << "You need more welding fuel to complete this task."
to_chat(user, "You need more welding fuel to complete this task.")
return
/obj/machinery/disposal/deliveryChute/Destroy()
+8 -8
View File
@@ -99,7 +99,7 @@ using metal and glass, it uses glass and reagents (usually sulphuric acid).
/obj/machinery/r_n_d/circuit_imprinter/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(busy)
user << "<span class='notice'>\The [src] is busy. Please wait for completion of previous operation.</span>"
to_chat(user, "<span class='notice'>\The [src] is busy. Please wait for completion of previous operation.</span>")
return 1
if(default_deconstruction_screwdriver(user, O))
if(linked_console)
@@ -113,26 +113,26 @@ using metal and glass, it uses glass and reagents (usually sulphuric acid).
if(istype(O, /obj/item/weapon/gripper/no_use/loader))
return 0 //Sheet loaders weren't finishing attack(), this prevents the message "You can't stuff that gripper into this" without preventing the rest of the attack sequence from finishing
if(panel_open)
user << "<span class='notice'>You can't load \the [src] while it's opened.</span>"
to_chat(user, "<span class='notice'>You can't load \the [src] while it's opened.</span>")
return 1
if(!linked_console)
user << "\The [src] must be linked to an R&D console first."
to_chat(user, "\The [src] must be linked to an R&D console first.")
return 1
if(O.is_open_container())
return 0
if(!istype(O, /obj/item/stack/material)) //Previously checked for specific material sheets, for some reason? Made the check on 133 redundant.
user << "<span class='notice'>You cannot insert this item into \the [src].</span>"
to_chat(user, "<span class='notice'>You cannot insert this item into \the [src].</span>")
return 1
if(stat)
return 1
if(TotalMaterials() + SHEET_MATERIAL_AMOUNT > max_material_storage)
user << "<span class='notice'>\The [src]'s material bin is full. Please remove material before adding more.</span>"
to_chat(user, "<span class='notice'>\The [src]'s material bin is full. Please remove material before adding more.</span>")
return 1
var/obj/item/stack/material/S = O
if(!(S.material.name in materials))
user << "<span class='warning'>The [src] doesn't accept [S.material]!</span>"
to_chat(user, "<span class='warning'>The [src] doesn't accept [S.material]!</span>")
return
busy = 1
@@ -152,9 +152,9 @@ using metal and glass, it uses glass and reagents (usually sulphuric acid).
materials[S.material.name] += amnt
S.use(1)
count++
user << "You insert [count] [sname] into the fabricator."
to_chat(user, "You insert [count] [sname] into the fabricator.")
else
user << "The fabricator cannot hold more [sname]."
to_chat(user, "The fabricator cannot hold more [sname].")
busy = 0
updateUsrDialog()
+2 -2
View File
@@ -139,7 +139,7 @@ datum/design/item/laserpointer
id = "handdrill"
req_tech = list(TECH_ENGINEERING = 3, TECH_MATERIAL = 2)
materials = list(DEFAULT_WALL_MATERIAL = 300, "silver" = 100)
build_path = /obj/item/weapon/screwdriver/power
build_path = /obj/item/weapon/tool/screwdriver/power
sort_string = "VASDA"
/datum/design/item/jaws_life
@@ -148,7 +148,7 @@ datum/design/item/laserpointer
id = "jawslife"
req_tech = list(TECH_ENGINEERING = 3, TECH_MATERIAL = 2)
materials = list(DEFAULT_WALL_MATERIAL = 300, "silver" = 100)
build_path = /obj/item/weapon/crowbar/power
build_path = /obj/item/weapon/tool/crowbar/power
sort_string = "VASEA"
/datum/design/item/device/t_scanner_upg
+7 -7
View File
@@ -91,7 +91,7 @@
/obj/machinery/r_n_d/protolathe/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(busy)
user << "<span class='notice'>\The [src] is busy. Please wait for completion of previous operation.</span>"
to_chat(user, "<span class='notice'>\The [src] is busy. Please wait for completion of previous operation.</span>")
return 1
if(default_deconstruction_screwdriver(user, O))
if(linked_console)
@@ -107,20 +107,20 @@
if(istype(O, /obj/item/weapon/gripper/no_use/loader))
return 0 //Sheet loaders weren't finishing attack(), this prevents the message "You can't stuff that gripper into this" without preventing the rest of the attack sequence from finishing
if(panel_open)
user << "<span class='notice'>You can't load \the [src] while it's opened.</span>"
to_chat(user, "<span class='notice'>You can't load \the [src] while it's opened.</span>")
return 1
if(!linked_console)
user << "<span class='notice'>\The [src] must be linked to an R&D console first!</span>"
to_chat(user, "<span class='notice'>\The [src] must be linked to an R&D console first!</span>")
return 1
if(!istype(O, /obj/item/stack/material))
user << "<span class='notice'>You cannot insert this item into \the [src]!</span>"
to_chat(user, "<span class='notice'>You cannot insert this item into \the [src]!</span>")
return 1
if(stat)
return 1
var/obj/item/stack/material/S = O
if(!(S.material.name in materials))
user << "<span class='warning'>The [src] doesn't accept [S.material]!</span>"
to_chat(user, "<span class='warning'>The [src] doesn't accept [S.material]!</span>")
return
busy = 1
@@ -140,9 +140,9 @@
materials[S.material.name] += amnt
S.use(1)
count++
user << "You insert [count] [sname] into the fabricator."
to_chat(user, "You insert [count] [sname] into the fabricator.")
else
user << "The fabricator cannot hold more [sname]."
to_chat(user, "The fabricator cannot hold more [sname].")
busy = 0
var/stacktype = S.type
@@ -27,7 +27,7 @@
/obj/machinery/keycard_auth/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(stat & (NOPOWER|BROKEN))
user << "This device is not powered."
to_chat(user, "This device is not powered.")
return
if(istype(W,/obj/item/weapon/card/id))
var/obj/item/weapon/card/id/ID = W
@@ -41,11 +41,11 @@
event_triggered_by = usr
broadcast_request() //This is the device making the initial event request. It needs to broadcast to other devices
if(istype(W, /obj/item/weapon/screwdriver))
user << "You begin removing the faceplate from the [src]"
if(W.is_screwdriver())
to_chat(user, "You begin removing the faceplate from the [src]")
playsound(src, W.usesound, 50, 1)
if(do_after(user, 10 * W.toolspeed))
user << "You remove the faceplate from the [src]"
to_chat(user, "You remove the faceplate from the [src]")
var/obj/structure/frame/A = new /obj/structure/frame(loc)
var/obj/item/weapon/circuitboard/M = new circuit(A)
A.frame_type = M.board_type
@@ -70,12 +70,12 @@
/obj/machinery/keycard_auth/attack_hand(mob/user as mob)
if(user.stat || stat & (NOPOWER|BROKEN))
user << "This device is not powered."
to_chat(user, "This device is not powered.")
return
if(!user.IsAdvancedToolUser())
return 0
if(busy)
user << "This device is busy."
to_chat(user, "This device is busy.")
return
user.set_machine(src)
@@ -105,10 +105,10 @@
/obj/machinery/keycard_auth/Topic(href, href_list)
..()
if(busy)
usr << "This device is busy."
to_chat(usr, "This device is busy.")
return
if(usr.stat || stat & (BROKEN|NOPOWER))
usr << "This device is without power."
to_chat(usr, "This device is without power.")
return
if(href_list["triggerevent"])
event = href_list["triggerevent"]
@@ -174,7 +174,7 @@
feedback_inc("alert_keycard_auth_maintRevoke",1)
if("Emergency Response Team")
if(is_ert_blocked())
usr << "<font color='red'>All emergency response teams are dispatched and can not be called at this time.</font>"
to_chat(usr, "<font color='red'>All emergency response teams are dispatched and can not be called at this time.</font>")
return
trigger_armed_response_team(1)
+15 -15
View File
@@ -254,10 +254,10 @@
/obj/machinery/shieldgen/attack_hand(mob/user as mob)
if(locked)
user << "The machine is locked, you are unable to use it."
to_chat(user, "The machine is locked, you are unable to use it.")
return
if(is_open)
user << "The panel must be closed before operating this machine."
to_chat(user, "The panel must be closed before operating this machine.")
return
if (src.active)
@@ -272,7 +272,7 @@
"You hear heavy droning.")
src.shields_up()
else
user << "The device must first be secured to the floor."
to_chat(user, "The device must first be secured to the floor.")
return
/obj/machinery/shieldgen/emag_act(var/remaining_charges, var/mob/user)
@@ -282,50 +282,50 @@
return 1
/obj/machinery/shieldgen/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/screwdriver))
if(W.is_screwdriver())
playsound(src, W.usesound, 100, 1)
if(is_open)
user << "<font color='blue'>You close the panel.</font>"
to_chat(user, "<font color='blue'>You close the panel.</font>")
is_open = 0
else
user << "<font color='blue'>You open the panel and expose the wiring.</font>"
to_chat(user, "<font color='blue'>You open the panel and expose the wiring.</font>")
is_open = 1
else if(istype(W, /obj/item/stack/cable_coil) && malfunction && is_open)
var/obj/item/stack/cable_coil/coil = W
user << "<span class='notice'>You begin to replace the wires.</span>"
to_chat(user, "<span class='notice'>You begin to replace the wires.</span>")
//if(do_after(user, min(60, round( ((getMaxHealth()/health)*10)+(malfunction*10) ))) //Take longer to repair heavier damage
if(do_after(user, 30))
if (coil.use(1))
health = max_health
malfunction = 0
user << "<span class='notice'>You repair the [src]!</span>"
to_chat(user, "<span class='notice'>You repair the [src]!</span>")
update_icon()
else if(istype(W, /obj/item/weapon/wrench))
else if(W.is_wrench())
if(locked)
user << "The bolts are covered, unlocking this would retract the covers."
to_chat(user, "The bolts are covered, unlocking this would retract the covers.")
return
if(anchored)
playsound(src, W.usesound, 100, 1)
user << "<font color='blue'>You unsecure the [src] from the floor!</font>"
to_chat(user, "<font color='blue'>You unsecure the [src] from the floor!</font>")
if(active)
user << "<font color='blue'>The [src] shuts off!</font>"
to_chat(user, "<font color='blue'>The [src] shuts off!</font>")
src.shields_down()
anchored = 0
else
if(istype(get_turf(src), /turf/space)) return //No wrenching these in space!
playsound(src, W.usesound, 100, 1)
user << "<font color='blue'>You secure the [src] to the floor!</font>"
to_chat(user, "<font color='blue'>You secure the [src] to the floor!</font>")
anchored = 1
else if(istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda))
if(src.allowed(user))
src.locked = !src.locked
user << "The controls are now [src.locked ? "locked." : "unlocked."]"
to_chat(user, "The controls are now [src.locked ? "locked." : "unlocked."]")
else
user << "<font color='red'>Access denied.</font>"
to_chat(user, "<font color='red'>Access denied.</font>")
else
..()
+1 -1
View File
@@ -158,7 +158,7 @@
/obj/machinery/shieldwallgen/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/wrench))
if(W.is_wrench())
if(active)
user << "Turn off the field generator first."
return
+1 -1
View File
@@ -45,7 +45,7 @@
updateDialog()
else
user << "<font color='red'>Access denied.</font>"
else if(istype(W, /obj/item/weapon/wrench))
else if(W.is_wrench())
src.anchored = !src.anchored
playsound(src, W.usesound, 75, 1)
src.visible_message("<font color='blue'>\icon[src] [src] has been [anchored ? "bolted to the floor" : "unbolted from the floor"] by [user].</font>")
+1 -1
View File
@@ -64,7 +64,7 @@
updateDialog()
else
user << "<font color='red'>Access denied.</font>"
else if(istype(W, /obj/item/weapon/wrench))
else if(W.is_wrench())
src.anchored = !src.anchored
playsound(src, W.usesound, 75, 1)
src.visible_message("<font color='blue'>\icon[src] [src] has been [anchored?"bolted to the floor":"unbolted from the floor"] by [user].</font>")
+1 -1
View File
@@ -1 +1 @@
#define SURGERY_FAILURE -1
#define SURGERY_FAILURE -1
+17 -10
View File
@@ -9,9 +9,11 @@
/datum/surgery_step/glue_bone
allowed_tools = list(
/obj/item/weapon/surgical/bonegel = 100, \
/obj/item/weapon/screwdriver = 75
/obj/item/weapon/surgical/bonegel = 100
)
allowed_procs = list(IS_SCREWDRIVER = 75)
can_infect = 1
blood_level = 1
@@ -49,10 +51,11 @@
/datum/surgery_step/set_bone
allowed_tools = list(
/obj/item/weapon/surgical/bonesetter = 100, \
/obj/item/weapon/wrench = 75 \
/obj/item/weapon/surgical/bonesetter = 100
)
allowed_procs = list(IS_WRENCH = 75)
min_duration = 60
max_duration = 70
@@ -92,10 +95,11 @@
/datum/surgery_step/mend_skull
allowed_tools = list(
/obj/item/weapon/surgical/bonesetter = 100, \
/obj/item/weapon/wrench = 75 \
/obj/item/weapon/surgical/bonesetter = 100
)
allowed_procs = list(IS_WRENCH = 75)
min_duration = 60
max_duration = 70
@@ -130,9 +134,11 @@
/datum/surgery_step/finish_bone
allowed_tools = list(
/obj/item/weapon/surgical/bonegel = 100, \
/obj/item/weapon/screwdriver = 75
/obj/item/weapon/surgical/bonegel = 100
)
allowed_procs = list(IS_SCREWDRIVER = 75)
can_infect = 1
blood_level = 1
@@ -169,8 +175,9 @@
/datum/surgery_step/clamp_bone
allowed_tools = list(
/obj/item/weapon/surgical/bone_clamp = 100
)
/obj/item/weapon/surgical/bone_clamp = 100
)
can_infect = 1
blood_level = 1
+11 -8
View File
@@ -20,8 +20,8 @@
/datum/surgery_step/open_encased/saw
allowed_tools = list(
/obj/item/weapon/surgical/circular_saw = 100, \
/obj/item/weapon/material/knife/machete/hatchet = 75
/obj/item/weapon/surgical/circular_saw = 100, \
/obj/item/weapon/material/knife/machete/hatchet = 75
)
min_duration = 50
@@ -69,10 +69,11 @@
/datum/surgery_step/open_encased/retract
allowed_tools = list(
/obj/item/weapon/surgical/retractor = 100, \
/obj/item/weapon/crowbar = 75
/obj/item/weapon/surgical/retractor = 100
)
allowed_procs = list(IS_CROWBAR = 75)
min_duration = 30
max_duration = 40
@@ -121,10 +122,11 @@
/datum/surgery_step/open_encased/close
allowed_tools = list(
/obj/item/weapon/surgical/retractor = 100, \
/obj/item/weapon/crowbar = 75
/obj/item/weapon/surgical/retractor = 100,
)
allowed_procs = list(IS_CROWBAR = 75)
min_duration = 20
max_duration = 40
@@ -178,10 +180,11 @@
/datum/surgery_step/open_encased/mend
allowed_tools = list(
/obj/item/weapon/surgical/bonegel = 100, \
/obj/item/weapon/screwdriver = 75
/obj/item/weapon/surgical/bonegel = 100
)
allowed_procs = list(IS_SCREWDRIVER = 75)
min_duration = 20
max_duration = 40
+5 -3
View File
@@ -88,9 +88,11 @@
/datum/surgery_step/face/fix_face
allowed_tools = list(
/obj/item/weapon/surgical/retractor = 100, \
/obj/item/weapon/crowbar = 55, \
/obj/item/weapon/material/kitchen/utensil/fork = 75)
/obj/item/weapon/surgical/retractor = 100, \
/obj/item/weapon/material/kitchen/utensil/fork = 75
)
allowed_procs = list(IS_CROWBAR = 55)
min_duration = 80
max_duration = 100
+22 -20
View File
@@ -28,9 +28,9 @@
/datum/surgery_step/generic/cut_open
allowed_tools = list(
/obj/item/weapon/surgical/scalpel = 100, \
/obj/item/weapon/material/knife = 75, \
/obj/item/weapon/material/shard = 50, \
/obj/item/weapon/surgical/scalpel = 100, \
/obj/item/weapon/material/knife = 75, \
/obj/item/weapon/material/shard = 50, \
)
req_open = 0
@@ -72,10 +72,10 @@
/datum/surgery_step/generic/cut_with_laser
allowed_tools = list(
/obj/item/weapon/surgical/scalpel/laser3 = 95, \
/obj/item/weapon/surgical/scalpel/laser2 = 85, \
/obj/item/weapon/surgical/scalpel/laser1 = 75, \
/obj/item/weapon/melee/energy/sword = 5
/obj/item/weapon/surgical/scalpel/laser3 = 95, \
/obj/item/weapon/surgical/scalpel/laser2 = 85, \
/obj/item/weapon/surgical/scalpel/laser1 = 75, \
/obj/item/weapon/melee/energy/sword = 5
)
priority = 2
req_open = 0
@@ -118,8 +118,9 @@
/datum/surgery_step/generic/incision_manager
allowed_tools = list(
/obj/item/weapon/surgical/scalpel/manager = 100
/obj/item/weapon/surgical/scalpel/manager = 100
)
priority = 2
req_open = 0
min_duration = 80
@@ -163,9 +164,9 @@
/datum/surgery_step/generic/clamp_bleeders
allowed_tools = list(
/obj/item/weapon/surgical/hemostat = 100, \
/obj/item/stack/cable_coil = 75, \
/obj/item/device/assembly/mousetrap = 20
/obj/item/weapon/surgical/hemostat = 100, \
/obj/item/stack/cable_coil = 75, \
/obj/item/device/assembly/mousetrap = 20
)
min_duration = 40
@@ -202,11 +203,12 @@
/datum/surgery_step/generic/retract_skin
allowed_tools = list(
/obj/item/weapon/surgical/retractor = 100, \
/obj/item/weapon/crowbar = 75, \
/obj/item/weapon/material/kitchen/utensil/fork = 50
/obj/item/weapon/surgical/retractor = 100, \
/obj/item/weapon/material/kitchen/utensil/fork = 50
)
allowed_procs = list(IS_CROWBAR = 75)
min_duration = 30
max_duration = 40
@@ -261,10 +263,10 @@
/datum/surgery_step/generic/cauterize
allowed_tools = list(
/obj/item/weapon/surgical/cautery = 100, \
/obj/item/clothing/mask/smokable/cigarette = 75, \
/obj/item/weapon/flame/lighter = 50, \
/obj/item/weapon/weldingtool = 25
/obj/item/weapon/surgical/cautery = 100, \
/obj/item/clothing/mask/smokable/cigarette = 75, \
/obj/item/weapon/flame/lighter = 50, \
/obj/item/weapon/weldingtool = 25
)
min_duration = 70
@@ -302,8 +304,8 @@
/datum/surgery_step/generic/amputate
allowed_tools = list(
/obj/item/weapon/surgical/circular_saw = 100, \
/obj/item/weapon/material/knife/machete/hatchet = 75
/obj/item/weapon/surgical/circular_saw = 100, \
/obj/item/weapon/material/knife/machete/hatchet = 75
)
req_open = 0
+11 -10
View File
@@ -44,9 +44,9 @@
/datum/surgery_step/cavity/make_space
allowed_tools = list(
/obj/item/weapon/surgical/surgicaldrill = 100, \
/obj/item/weapon/pen = 75, \
/obj/item/stack/rods = 50
/obj/item/weapon/surgical/surgicaldrill = 100, \
/obj/item/weapon/pen = 75, \
/obj/item/stack/rods = 50
)
min_duration = 60
@@ -77,10 +77,10 @@
/datum/surgery_step/cavity/close_space
priority = 2
allowed_tools = list(
/obj/item/weapon/surgical/cautery = 100, \
/obj/item/clothing/mask/smokable/cigarette = 75, \
/obj/item/weapon/flame/lighter = 50, \
/obj/item/weapon/weldingtool = 25
/obj/item/weapon/surgical/cautery = 100, \
/obj/item/clothing/mask/smokable/cigarette = 75, \
/obj/item/weapon/flame/lighter = 50, \
/obj/item/weapon/weldingtool = 25
)
min_duration = 60
@@ -156,11 +156,12 @@
/datum/surgery_step/cavity/implant_removal
allowed_tools = list(
/obj/item/weapon/surgical/hemostat = 100, \
/obj/item/weapon/wirecutters = 75, \
/obj/item/weapon/material/kitchen/utensil/fork = 20
/obj/item/weapon/surgical/hemostat = 100, \
/obj/item/weapon/material/kitchen/utensil/fork = 20
)
allowed_procs = list(IS_WIRECUTTER = 75)
min_duration = 80
max_duration = 100
+8 -4
View File
@@ -59,9 +59,11 @@
priority = 3 //Do this instead of expanding the skull cavity
allowed_tools = list(
/obj/item/weapon/surgical/surgicaldrill = 100,
/obj/item/weapon/screwdriver = 75,
/obj/item/weapon/melee/changeling/arm_blade = 15,
/obj/item/weapon/pickaxe = 5)
/obj/item/weapon/pickaxe = 5
)
allowed_procs = list(IS_SCREWDRIVER = 75)
min_duration = 200 //Very. Very. Carefully.
max_duration = 300
@@ -100,9 +102,10 @@
priority = 3 //Do this instead of picking around for implants.
allowed_tools = list(
/obj/item/weapon/surgical/hemostat = 100,
/obj/item/weapon/wirecutters = 60,
/obj/item/weapon/melee/changeling/claw = 40) //Surprisingly, claws are kind of okay at picking things out.
allowed_procs = list(IS_WIRECUTTER = 60)
min_duration = 90
max_duration = 120
@@ -216,9 +219,10 @@
priority = 3 //Do this instead of searching for objects in the skull.
allowed_tools = list(
/obj/item/weapon/surgical/hemostat = 100,
/obj/item/weapon/wirecutters = 60,
/obj/item/weapon/melee/changeling/claw = 20) //Claws. Good for digging, not so much for moving.
allowed_procs = list(IS_WIRECUTTER = 60)
min_duration = 90
max_duration = 120
+4 -2
View File
@@ -20,9 +20,10 @@
/datum/surgery_step/internal/remove_embryo
allowed_tools = list(
/obj/item/weapon/surgical/hemostat = 100, \
/obj/item/weapon/wirecutters = 75, \
/obj/item/weapon/material/kitchen/utensil/fork = 20
)
allowed_procs = list(IS_WIRECUTTER = 75)
blood_level = 2
min_duration = 80
@@ -212,10 +213,11 @@
allowed_tools = list(
/obj/item/weapon/surgical/hemostat = 100, \
/obj/item/weapon/wirecutters = 75, \
/obj/item/weapon/material/kitchen/utensil/fork = 20
)
allowed_procs = list(IS_WIRECUTTER = 75)
min_duration = 60
max_duration = 80
+12 -9
View File
@@ -28,10 +28,12 @@
/datum/surgery_step/robotics/unscrew_hatch
allowed_tools = list(
/obj/item/weapon/screwdriver = 100,
/obj/item/weapon/coin = 50,
/obj/item/weapon/material/knife = 50
)
allowed_procs = list(IS_SCREWDRIVER = 100)
req_open = 0
min_duration = 90
@@ -66,10 +68,11 @@
/datum/surgery_step/robotics/open_hatch
allowed_tools = list(
/obj/item/weapon/surgical/retractor = 100,
/obj/item/weapon/crowbar = 100,
/obj/item/weapon/material/kitchen/utensil = 50
)
allowed_procs = list(IS_CROWBAR = 100)
min_duration = 30
max_duration = 40
@@ -102,10 +105,11 @@
/datum/surgery_step/robotics/close_hatch
allowed_tools = list(
/obj/item/weapon/surgical/retractor = 100,
/obj/item/weapon/crowbar = 100,
/obj/item/weapon/material/kitchen/utensil = 50
)
allowed_procs = list(IS_CROWBAR = 100)
min_duration = 70
max_duration = 100
@@ -148,7 +152,7 @@
/datum/surgery_step/robotics/repair_brute/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(istype(tool,/obj/item/weapon/weldingtool))
if(istype(tool, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/welder = tool
if(!welder.isOn() || !welder.remove_fuel(1,user))
return 0
@@ -188,7 +192,7 @@
/datum/surgery_step/robotics/repair_burn/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(istype(tool,/obj/item/stack/cable_coil/))
if(istype(tool, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = tool
if(affected.burn_dam == 0)
to_chat(user, "<span class='notice'>There are no burnt wires here!</span>")
@@ -229,9 +233,10 @@
allowed_tools = list(
/obj/item/stack/nanopaste = 100, \
/obj/item/weapon/surgical/bonegel = 30, \
/obj/item/weapon/screwdriver = 70, \
)
allowed_procs = list(IS_SCREWDRIVER = 100)
min_duration = 70
max_duration = 90
@@ -348,9 +353,7 @@
///////////////////////////////////////////////////////////////
/datum/surgery_step/robotics/attach_organ_robotic
allowed_tools = list(
/obj/item/weapon/screwdriver = 100,
)
allowed_procs = list(IS_SCREWDRIVER = 100)
min_duration = 100
max_duration = 120
+62 -40
View File
@@ -10,6 +10,10 @@
// type path referencing tools that can be used for this step, and how well are they suited for it
var/list/allowed_tools = null
// List of procs that can be called if allowed_tools fails
var/list/allowed_procs = null
// type paths referencing races that this step applies to.
var/list/allowed_species = null
var/list/disallowed_species = null
@@ -23,55 +27,73 @@
//How much blood this step can get on surgeon. 1 - hands, 2 - full body.
var/blood_level = 0
//returns how well tool is suited for this step
proc/tool_quality(obj/item/tool)
for (var/T in allowed_tools)
if (istype(tool,T))
return allowed_tools[T]
//returns how well tool is suited for this step
/datum/surgery_step/proc/tool_quality(obj/item/tool)
for (var/T in allowed_tools)
if (istype(tool,T))
return allowed_tools[T]
for(var/P in allowed_procs)
switch(P)
if(IS_SCREWDRIVER)
if(tool.is_screwdriver())
return allowed_procs[P]
if(IS_CROWBAR)
if(tool.is_crowbar())
return allowed_procs[P]
if(IS_WIRECUTTER)
if(tool.is_wirecutter())
return allowed_procs[P]
if(IS_WRENCH)
if(tool.is_wrench())
return allowed_procs[P]
return 0
// Checks if this step applies to the user mob at all
/datum/surgery_step/proc/is_valid_target(mob/living/carbon/human/target)
if(!hasorgans(target))
return 0
// Checks if this step applies to the user mob at all
proc/is_valid_target(mob/living/carbon/human/target)
if(!hasorgans(target))
return 0
if(allowed_species)
for(var/species in allowed_species)
if(target.species.get_bodytype() == species)
return 1
if(allowed_species)
for(var/species in allowed_species)
if(target.species.get_bodytype() == species)
return 1
if(disallowed_species)
for(var/species in disallowed_species)
if(target.species.get_bodytype() == species)
return 0
if(disallowed_species)
for(var/species in disallowed_species)
if(target.species.get_bodytype() == species)
return 0
return 1
return 1
// checks whether this step can be applied with the given user and target
proc/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return 0
// checks whether this step can be applied with the given user and target
/datum/surgery_step/proc/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return 0
// does stuff to begin the step, usually just printing messages. Moved germs transfering and bloodying here too
proc/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (can_infect && affected)
spread_germs_to_organ(affected, user)
if (ishuman(user) && prob(60))
var/mob/living/carbon/human/H = user
if (blood_level)
H.bloody_hands(target,0)
if (blood_level > 1)
H.bloody_body(target,0)
return
// does stuff to begin the step, usually just printing messages. Moved germs transfering and bloodying here too
/datum/surgery_step/proc/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (can_infect && affected)
spread_germs_to_organ(affected, user)
if (ishuman(user) && prob(60))
var/mob/living/carbon/human/H = user
if (blood_level)
H.bloody_hands(target,0)
if (blood_level > 1)
H.bloody_body(target,0)
return
// does stuff to end the step, which is normally print a message + do whatever this step changes
/datum/surgery_step/proc/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return
// stuff that happens when the step fails
/datum/surgery_step/proc/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return null
// does stuff to end the step, which is normally print a message + do whatever this step changes
proc/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return
// stuff that happens when the step fails
proc/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return null
/proc/spread_germs_to_organ(var/obj/item/organ/external/E, var/mob/living/carbon/human/user)
if(!istype(user) || !istype(E)) return
+1 -1
View File
@@ -1 +1 @@
#undef SURGERY_FAILURE
#undef SURGERY_FAILURE
+21 -20
View File
@@ -89,15 +89,15 @@
if(health < maxhealth)
switch(health / maxhealth)
if(0.0 to 0.5)
user << "<span class='warning'>It looks severely damaged!</span>"
to_chat(user, "<span class='warning'>It looks severely damaged!</span>")
if(0.25 to 0.5)
user << "<span class='warning'>It looks damaged!</span>"
to_chat(user, "<span class='warning'>It looks damaged!</span>")
if(0.5 to 1.0)
user << "<span class='notice'>It has a few scrapes and dents.</span>"
to_chat(user, "<span class='notice'>It has a few scrapes and dents.</span>")
/obj/structure/table/attackby(obj/item/weapon/W, mob/user)
if(reinforced && istype(W, /obj/item/weapon/screwdriver))
if(reinforced && W.is_screwdriver())
remove_reinforced(W, user)
if(!reinforced)
update_desc()
@@ -105,7 +105,7 @@
update_material()
return 1
if(carpeted && istype(W, /obj/item/weapon/crowbar))
if(carpeted && W.is_crowbar())
user.visible_message("<span class='notice'>\The [user] removes the carpet from \the [src].</span>",
"<span class='notice'>You remove the carpet from \the [src].</span>")
new /obj/item/stack/tile/carpet(loc)
@@ -122,9 +122,9 @@
update_icon()
return 1
else
user << "<span class='warning'>You don't have enough carpet!</span>"
to_chat(user, "<span class='warning'>You don't have enough carpet!</span>")
if(!reinforced && !carpeted && material && istype(W, /obj/item/weapon/wrench))
if(!reinforced && !carpeted && material && W.is_wrench())
remove_material(W, user)
if(!material)
update_connections(1)
@@ -135,14 +135,14 @@
update_material()
return 1
if(!carpeted && !reinforced && !material && istype(W, /obj/item/weapon/wrench))
if(!carpeted && !reinforced && !material && W.is_wrench())
dismantle(W, user)
return 1
if(health < maxhealth && istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/F = W
if(F.welding)
user << "<span class='notice'>You begin reparing damage to \the [src].</span>"
to_chat(user, "<span class='notice'>You begin reparing damage to \the [src].</span>")
playsound(src, F.usesound, 50, 1)
if(!do_after(user, 20 * F.toolspeed) || !F.remove_fuel(1, user))
return
@@ -197,19 +197,19 @@
/obj/structure/table/proc/reinforce_table(obj/item/stack/material/S, mob/user)
if(reinforced)
user << "<span class='warning'>\The [src] is already reinforced!</span>"
to_chat(user, "<span class='warning'>\The [src] is already reinforced!</span>")
return
if(!can_reinforce)
user << "<span class='warning'>\The [src] cannot be reinforced!</span>"
to_chat(user, "<span class='warning'>\The [src] cannot be reinforced!</span>")
return
if(!material)
user << "<span class='warning'>Plate \the [src] before reinforcing it!</span>"
to_chat(user, "<span class='warning'>Plate \the [src] before reinforcing it!</span>")
return
if(flipped)
user << "<span class='warning'>Put \the [src] back in place before reinforcing it!</span>"
to_chat(user, "<span class='warning'>Put \the [src] back in place before reinforcing it!</span>")
return
reinforced = common_material_add(S, user, "reinforc")
@@ -234,12 +234,12 @@
/obj/structure/table/proc/common_material_add(obj/item/stack/material/S, mob/user, verb) // Verb is actually verb without 'e' or 'ing', which is added. Works for 'plate'/'plating' and 'reinforce'/'reinforcing'.
var/material/M = S.get_material()
if(!istype(M))
user << "<span class='warning'>You cannot [verb]e \the [src] with \the [S].</span>"
to_chat(user, "<span class='warning'>You cannot [verb]e \the [src] with \the [S].</span>")
return null
if(manipulating) return M
manipulating = 1
user << "<span class='notice'>You begin [verb]ing \the [src] with [M.display_name].</span>"
to_chat(user, "<span class='notice'>You begin [verb]ing \the [src] with [M.display_name].</span>")
if(!do_after(user, 20) || !S.use(1))
manipulating = 0
return null
@@ -250,7 +250,7 @@
// Returns the material to set the table to.
/obj/structure/table/proc/common_material_remove(mob/user, material/M, delay, what, type_holding, sound)
if(!M.stack_type)
user << "<span class='warning'>You are unable to remove the [what] from this [src]!</span>"
to_chat(user, "<span class='warning'>You are unable to remove the [what] from this [src]!</span>")
return M
if(manipulating) return M
@@ -268,13 +268,13 @@
manipulating = 0
return null
/obj/structure/table/proc/remove_reinforced(obj/item/weapon/screwdriver/S, mob/user)
/obj/structure/table/proc/remove_reinforced(obj/item/weapon/S, mob/user)
reinforced = common_material_remove(user, reinforced, 40 * S.toolspeed, "reinforcements", "screws", S.usesound)
/obj/structure/table/proc/remove_material(obj/item/weapon/wrench/W, mob/user)
/obj/structure/table/proc/remove_material(obj/item/weapon/W, mob/user)
material = common_material_remove(user, material, 20 * W.toolspeed, "plating", "bolts", W.usesound)
/obj/structure/table/proc/dismantle(obj/item/weapon/wrench/W, mob/user)
/obj/structure/table/proc/dismantle(obj/item/W, mob/user)
if(manipulating) return
manipulating = 1
user.visible_message("<span class='notice'>\The [user] begins dismantling \the [src].</span>",
@@ -459,7 +459,8 @@
*/
/proc/dirs_to_corner_states(list/dirs)
if(!istype(dirs)) return
if(!istype(dirs))
return
var/list/ret = list(NORTHWEST, SOUTHEAST, NORTHEAST, SOUTHWEST)

Some files were not shown because too many files have changed in this diff Show More