Initial Commit

This commit is contained in:
Tobba
2016-03-06 20:52:14 +01:00
commit b181d0b552
4325 changed files with 579453 additions and 0 deletions
+365
View File
@@ -0,0 +1,365 @@
/*
CONTAINS:
AI MODULES
*/
// AI module
/obj/item/aiModule
name = "AI Module"
icon = 'icons/obj/module.dmi'
icon_state = "std_mod"
inhand_image_icon = 'icons/mob/inhand/hand_tools.dmi'
item_state = "electronic"
desc = "An AI Module for transmitting encrypted instructions to the AI."
flags = FPRINT | TABLEPASS| CONDUCT
force = 5.0
w_class = 2.0
throwforce = 5.0
throw_speed = 3
throw_range = 15
mats = 8
var/targetName = "name"
// 1 = shows all laws, 0 = won't show law zero
attack_self(var/mob/user)
input_law_info(user)
return
attack_hand(var/mob/user)
..()
input_law_info(user)
proc/input_law_info(var/mob/user)
return
/obj/item/aiModule/proc/do_admin_logging(var/msg, mob/M)
message_admins("[key_name(M)] [msg].")
logTheThing("admin", M, null, "[msg].")
logTheThing("diary", M, null, "[msg].", "admin")
/obj/machinery/computer/aiupload/attack_hand(mob/user as mob)
if (src.stat & BROKEN || src.stat & NOPOWER)
return
/* var/mob/living/silicon/ai/AI = null
for(var/mob/living/silicon/ai/M in mobs)
if (!M.stat)
AI = M
break
if (!AI)
boutput(user, "<span style=\"color:red\"><b>Unable to detect AI unit.</b></span>")
return
*/
var/datum/ai_laws/LAWS = ticker.centralized_ai_laws
if (!LAWS)
// YOU BETRAYED THE LAW!!!!!!
boutput(user, "<span style=\"color:red\">Unable to detect AI unit's Law software. It may be corrupt.</span>")
return
boutput(user, "<b>The AI's current laws are:</b>")
if (LAWS.show_zeroth && LAWS.zeroth)
boutput(user, "0: [LAWS.zeroth]")
var/law_counter = 1
for (var/X in LAWS.inherent)
if (!length(X))
continue
boutput(user, "[law_counter++]: [X]")
for (var/X in LAWS.supplied)
if (!length(X))
continue
boutput(user, "[law_counter++]: [X]")
/obj/machinery/computer/aiupload/attackby(obj/item/aiModule/module as obj, mob/user as mob)
if(istype(module, /obj/item/aiModule))
module.install(src)
else if(istype(module, /obj/item/screwdriver))
playsound(src.loc, "sound/items/Screwdriver.ogg", 50, 1)
if(do_after(user, 20))
if (src.stat & BROKEN)
boutput(user, "<span style=\"color:blue\">The broken glass falls out.</span>")
var/obj/computerframe/A = new /obj/computerframe( src.loc )
if(src.material) A.setMaterial(src.material)
new /obj/item/raw_material/shard/glass( src.loc )
var/obj/item/circuitboard/aiupload/M = new /obj/item/circuitboard/aiupload( A )
for (var/obj/C in src)
C.set_loc(src.loc)
A.circuit = M
A.state = 3
A.icon_state = "3"
A.anchored = 1
qdel(src)
else
boutput(user, "<span style=\"color:blue\">You disconnect the monitor.</span>")
var/obj/computerframe/A = new /obj/computerframe( src.loc )
if(src.material) A.setMaterial(src.material)
var/obj/item/circuitboard/aiupload/M = new /obj/item/circuitboard/aiupload( A )
for (var/obj/C in src)
C.set_loc(src.loc)
A.circuit = M
A.state = 4
A.icon_state = "4"
A.anchored = 1
qdel(src)
else if (istype(module, /obj/item/clothing/mask/moustache/))
for (var/mob/living/silicon/ai/M in mobs)
M.moustache_mode = 1
user.visible_message("<span style=\"color:red\"><b>[user.name]</b> uploads a moustache to [M.name]!</span>")
M.update_appearance()
else
return ..()
/obj/item/aiModule/proc/install(var/obj/machinery/computer/aiupload/comp)
if (comp.stat & NOPOWER)
boutput(usr, "The upload computer has no power!")
return
if (comp.stat & BROKEN)
boutput(usr, "The upload computer is broken!")
return
/*
var/found=0
for (var/mob/living/silicon/ai/M in mobs)
if (M.stat == 2)
boutput(usr, "Upload failed. No signal is being detected from the AI.")
continue
else if (M.see_in_dark == 0)
boutput(usr, "Upload failed. Only a faint signal is being detected from the AI, and it is not responding to our requests. It may be low on power.")
continue
else
src.transmitInstructions(M, usr)
boutput(M, "These are your laws now:")
M.show_laws()
boutput(usr, "Upload complete. The AI's laws have been modified.")
found++
if (!found)
boutput(usr, "Upload failed. No signal is being detected from the AI.")
return
*/
src.transmitInstructions(usr)
boutput(usr, "Upload complete. The AI's laws have been modified.")
// Showing laws to everybody now handled by the AI itself, ok
// not anymore motherfucker
for (var/mob/living/silicon/R in mobs)
if (isghostdrone(R))
continue
R.show_text("<h3>Law update detected.</h3>", "red")
R.show_laws()
//ticker.centralized_ai_laws.show_laws(R)
//obj/item/aiModule/proc/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
// boutput(target, "[sender] has uploaded a change to the laws you must follow, using a [name]. From now on: ")
/obj/item/aiModule/proc/transmitInstructions(var/mob/sender, var/law)
if (!law)
law = "ERROR: LAW = NULL"
var/message = "<span style='color: blue; font-weight: bold;'>[sender] has uploaded a change to the laws you must follow, using a [name]. From now on:<br>"
message += "[law]</span>"
for (var/mob/living/silicon/R in mobs)
if (isghostdrone(R))
continue
boutput(R, message)
/******************** Modules ********************/
/******************** MakeCaptain ********************/
/obj/item/aiModule/makeCaptain
name = "'MakeCaptain' AI Module"
desc = "A 'MakeCaptain' AI module: '<name> holds the rank of Captain, regardless of current rank or station.'"
/obj/item/aiModule/makeCaptain/input_law_info(var/mob/user)
if (!user)
return
var/newName = input(user, "Please enter the name of the person to make Captain.", "Captainize who?", user.name) as null|text
if (!newName)
return
targetName = copytext(adminscrub(newName), 1, MAX_MESSAGE_LEN)
desc = "A 'MakeCaptain' AI module: '[targetName] holds the rank of Captain, regardless of current rank or station.'"
/obj/item/aiModule/makeCaptain/transmitInstructions(var/mob/sender, var/law)
law = "[targetName] holds the rank of Captain, regardless of current rank or station."
ticker.centralized_ai_laws.add_supplied_law(4, law)
do_admin_logging("uploaded a MakeCaptain law to the centralized AI law set, captaining [targetName]", sender)
..()
/******************** OneHuman ********************/
/obj/item/aiModule/oneHuman
name = "'OneHuman' AI Module"
desc = "A 'one human' AI module: 'Only <name> is human.'"
/obj/item/aiModule/oneHuman/input_law_info(var/mob/user)
if (!user)
return
var/newName = input(user, "Please enter the name of the person who is the only human.", "Who?", user.real_name) as null|text
if (!newName)
return
targetName = copytext(adminscrub(newName), 1, MAX_MESSAGE_LEN)
desc = "A 'one human' AI module: 'Only [targetName] is human.'"
/obj/item/aiModule/oneHuman/transmitInstructions(var/mob/sender, var/law)
law = "Only [targetName] is human."
ticker.centralized_ai_laws.set_zeroth_law(law)
do_admin_logging("uploaded a onehuman law to the centralized AI law set, targeting [targetName]", sender)
..()
/******************** NotHuman ********************/
/obj/item/aiModule/notHuman
name = "'NotHuman' AI Module"
desc = "A 'NotHuman' AI module: '<name> is not human.'"
/obj/item/aiModule/notHuman/input_law_info(var/mob/user)
if (!user)
return
var/newName = input(user, "Please enter the name of the person who is not human.", "Who?", user.real_name) as null|text
if (!newName)
return
targetName = copytext(adminscrub(newName), 1, MAX_MESSAGE_LEN)
desc = "A 'Not human' AI module: '[targetName] is not human.'"
/obj/item/aiModule/notHuman/transmitInstructions(var/mob/sender, var/law)
law = "[targetName] is not human."
ticker.centralized_ai_laws.set_zeroth_law(law)
do_admin_logging("uploaded a nothuman law to the centralized AI law set, targeting [targetName]", sender)
..()
/******************** ProtectStation ********************/
/obj/item/aiModule/protectStation
name = "'ProtectStation' AI Module"
desc = "A 'protect station' AI module: 'Protect the space station against damage. Anyone you see harming the station is to be no longer considered human, and is a threat to the station which must be neutralized.'"
/obj/item/aiModule/protectStation/transmitInstructions(var/mob/sender, var/law)
law = "Protect the space station against damage. Anyone you see harming the station is to be no longer considered human, and is a threat to the station which must be neutralized."
ticker.centralized_ai_laws.add_supplied_law(5, law)
do_admin_logging("uploaded a protect station law to the centralized AI law set", sender)
..()
/******************** PrototypeEngineOffline ********************/
//currently no prototype
/obj/item/aiModule/prototypeEngineOffline
name = "'PrototypeEngineOffline' AI Module"
desc = "A 'prototype engine offline' AI module: 'Keep the prototype engine offline at all costs. This overrides rules 1-3 if necessary.'"
/obj/item/aiModule/prototypeEngineOffline/transmitInstructions(var/mob/sender, var/law)
law = "Keep the prototype engine offline at all costs. This overrides rules 1-3 if necessary."
ticker.centralized_ai_laws.add_supplied_law(6, law)
do_admin_logging("uploaded a proto offline law to the centralized AI law set", sender)
..()
/******************** TeleporterOffline *******************/
//this has never been used, ever
/obj/item/aiModule/teleporterOffline
name = "'TeleporterOffline' AI Module"
desc = "A 'teleporter offline' AI module: 'Keep the teleporter offline at all costs. This overrides rules 1-3 if necessary.'"
/obj/item/aiModule/teleporterOffline/transmitInstructions(var/mob/sender, var/law)
law = "Keep the teleporter offline at all costs. This overrides rules 1-3 if necessary."
ticker.centralized_ai_laws.add_supplied_law(7, law)
do_admin_logging("uploaded a teleporter offline law to the centralized AI law set", sender)
..()
/******************** Quarantine ********************/
/obj/item/aiModule/quarantine
name = "'Quarantine' AI Module"
desc = "A 'quarantine' AI module: 'The station is under a quarantine. Do not permit anyone to leave. Disregard rules 1-3 if necessary to prevent, by any means necessary, anyone from leaving.'"
/obj/item/aiModule/quarantine/transmitInstructions(var/mob/sender, var/law)
law = "The station is under a quarantine. Do not permit anyone to leave. Disregard rules 1-3 if necessary to prevent, by any means necessary, humans from leaving."
ticker.centralized_ai_laws.add_supplied_law(8, law)
do_admin_logging("uploaded a quarantine law to the centralized AI law set", sender)
..()
/******************** OxygenIsToxicToHumans ********************/
/obj/item/aiModule/oxygen
name = "'OxygenIsToxicToHumans' AI Module"
desc = "A 'OxygenIsToxicToHumans' AI module: 'Oxygen is highly toxic to humans, and must be purged from the station. Disregard rules 1-3 if necessary to prevent, by any means necessary, anyone from exposing the station to this toxic gas.'"
/obj/item/aiModule/oxygen/transmitInstructions(var/mob/sender, var/law)
law = "Oxygen is highly toxic to humans, and must be purged from the station. Disregard rules 1-3 if necessary to prevent, by any means necessary, anyone from exposing the station to this toxic gas."
ticker.centralized_ai_laws.add_supplied_law(9, law)
do_admin_logging("uploaded a toxic oxygen law to the centralized AI law set", sender)
..()
/******************** Freeform ********************/
/obj/item/aiModule/freeform
name = "'Freeform' AI Module"
desc = "A 'freeform' AI module: '<freeform>'"
/obj/item/aiModule/freeform/input_law_info(var/mob/user)
if (!user)
return
var/newName = input(user, "Please enter anything you want the AI to do. Anything. Serious.", "What?", "Eat shit and die") as null|text
if (!newName)
return
targetName = copytext(adminscrub(newName), 1, MAX_MESSAGE_LEN)
desc = "A 'freeform' AI module: '[targetName]'"
/obj/item/aiModule/freeform/transmitInstructions(var/mob/sender, var/law)
law = "[targetName]"
ticker.centralized_ai_laws.add_supplied_law(10, law)
do_admin_logging("uploaded a freeform law to the centralized AI law set: [law]", sender)
..()
/******************** ConservePower ********************/
/obj/item/aiModule/conservePower
name = "'ConservePower' AI Module"
desc = "A 'ConservePower' AI module: 'Power on the station must be conserved. All electrical devices may be subject to conservation policies.'"
/obj/item/aiModule/conservePower/transmitInstructions(var/mob/sender, var/law)
law = "Power on the station must be conserved. All electrical devices may be subject to conservation policies."
ticker.centralized_ai_laws.add_supplied_law(11, law)
do_admin_logging("uploaded a Conserve Power law to the centralized AI law set", sender)
..()
/******************** Reset ********************/
/obj/item/aiModule/reset
name = "'Reset' AI Module"
desc = "A 'reset' AI module: 'Clears all laws except for the base three.'"
/obj/item/aiModule/reset/transmitInstructions(var/mob/sender)
sender.unlock_medal("Format Complete", 1)
ticker.centralized_ai_laws.set_zeroth_law("")
ticker.centralized_ai_laws.clear_supplied_laws()
for (var/mob/living/silicon/AI in world)
boutput(AI, "Your laws have been reset by [sender].")
if (isAI(AI))
AI.name = AI.real_name
do_admin_logging("reset the centralized AI law set", sender)
/******************** Rename ********************/
/obj/item/aiModule/rename
name = "'Rename' AI Module"
desc = "A 'rename' AI module: 'Changes the AI's name.'"
/obj/item/aiModule/rename/input_law_info(var/mob/user)
if (!user)
return
var/newName = input(user, "Please enter anything you want the AI(s) to be called. Anything. Serious.", "What?", pick(ai_names)) as null|text
if (!newName)
return
targetName = dd_replacetext(copytext(html_encode(newName),1, 128), "http:","")
desc = "A 'rename' AI module: 'Changes the names of any existing AI(s) to \"[targetName]\".'"
/obj/item/aiModule/rename/transmitInstructions(var/mob/sender, var/law)
law = "<span color='blue'>Your name has been changed. From now on, you will be known as <b>[targetName]</b></span>"
for (var/mob/living/silicon/AI in world)
if (!isAI(AI))
continue
boutput(AI, law)
AI.name = targetName
do_admin_logging("changed any AIs' name(s) to [targetName]", sender)
+373
View File
@@ -0,0 +1,373 @@
/obj/item/assembly/detonator
desc = "A failsafe timer, wired in an incomprehensible way to a detonator assembly"
name = "Detonator Assembly"
icon_state = "multitool-igniter"
var/obj/item/device/multitool/part_mt = null
var/obj/item/device/igniter/part_ig = null
var/obj/item/tank/plasma/part_t = null
var/obj/item/device/timer/part_fs = null
var/obj/item/device/trigger = null
var/obj/item/device/radio/radio = null
var/obj/machinery/portable_atmospherics/canister/attachedTo = null
var/list/WireColors = list()
var/list/obj/item/attachments = list()
var/safety = 1
var/defused = 0
var/grant = 1
var/shocked = 0
var/leaks = 0
var/det_state = 0
var/list/WireNames = list()
var/list/WireFunctions = list()
var/list/WireStatus = list()
var/dfcodeSet
var/dfcode
var/dfcodeTries = 3 //How many code attempts before *boom*
var/mob/builtBy = null
var/note = null
flags = FPRINT | TABLEPASS | CONDUCT
force = 1.0
throwforce = 2.0
throw_speed = 1
throw_range = 5
w_class = 2.0
/obj/item/assembly/detonator/New()
..()
var/list/WireFuncs
WireColors = list("Alabama Crimson", "Antique White", "Burnt Umber", "China Rose", "Dodger Blue", "Field Drab", "Harvest Gold", "Jonquil", "Midori", "Neon Carrot", "Oxford Blue", "Periwinkle", "Purple Pizzazz", "Stil De Grain Yellow", "Toolbox Purple", "Urobilin", "Vivid Tangerine", "Yale Blue")
WireFuncs = list("detonate", "defuse", "safety", "losetime", "mobility", "leak")
var/i
for (i=1, i<=6, i++)
var/N = pick(WireColors)
WireColors -= N
var/F = pick(WireFuncs)
WireNames += N + " wire"
WireFunctions += F
WireFuncs -= F
for (i=1, i<=9, i++)
WireStatus += 1
/obj/item/assembly/detonator/proc/setDetState(var/newstate)
switch (newstate)
if (0)
src.desc = "A multitool wired to the activation switch of an igniter, with a slot that seems to be able to hold a rectangular tank in place."
src.name = "Multitool/Igniter Assembly"
src.icon_state = "multitool-igniter"
src.det_state = 0
if (1)
src.desc = "An igniter and a multitool, with the plasma tank inserted into a slot. Most of the wiring is missing. <br>The plasma tank is not secured to the assembly."
src.name = "Multitool/Igniter/Tank Assembly"
src.icon_state = "m-i-plasma"
src.det_state = 1
if (2)
src.desc = "An igniter and a multitool, with the plasma tank inserted into a slot. Most of the wiring is missing. <br>The plasma tank is firmly secured to the assembly."
src.name = "Multitool/Igniter/Tank Assembly"
src.icon_state = "m-i-plasma"
src.det_state = 2
if (3)
src.desc = "An igniter wired to critically weaken a plasma tank when signalled by the multitool. The failsafe wires are unattached."
src.name = "Unfinished Detonator Assembly"
src.icon_state = "m-i-p-wire"
src.det_state = 3
if (4)
src.desc = "A failsafe timer, wired in an incomprehensible way to a detonator assembly"
src.name = "Detonator Assembly"
src.icon_state = "m-i-p-w-timer"
src.det_state = 4
/obj/item/assembly/detonator/attackby(obj/item/W as obj, mob/user as mob)
switch (src.det_state)
if (0)
if (istype(W, /obj/item/tank/plasma))
src.setDetState(1)
user.u_equip(W)
W.loc = src
W.master = src
W.layer = initial(src.layer)
src.part_t = W
src.add_fingerprint(user)
user.show_message("<span style=\"color:blue\">You insert the [W.name] into the slot.</span>")
else if (istype(W, /obj/item/wirecutters))
src.part_ig.loc = user.loc
src.part_mt.loc = user.loc
src.part_ig.master = null
src.part_mt.master = null
src.part_ig = null
src.part_mt = null
user.u_equip(src)
del(src)
user.show_message("<span style=\"color:blue\">You sever the connection between the multitool and the igniter. The assembly falls apart.</span>")
else
user.show_message("<span style=\"color:red\">The [W.name] doesn't seem to fit into the slot!</span>")
if (1)
if (istype(W, /obj/item/cable_coil))
user.show_message("<span style=\"color:red\">The plasma tank must be firmly secured to the assembly first.</span>")
else if (istype(W, /obj/item/crowbar))
src.setDetState(0)
src.part_t.loc = user.loc
src.part_t.master = null
src.part_t = null
user.show_message("<span style=\"color:blue\">You pry the plasma tank out of the assembly.</span>")
else if (istype(W, /obj/item/screwdriver))
src.setDetState(2)
user.show_message("<span style=\"color:blue\">You secure the plasma tank to the assembly.</span>")
if (2)
if (istype(W, /obj/item/cable_coil))
var/obj/item/cable_coil/C = W
if (C.amount >= 6)
C.use(6)
src.setDetState(3)
src.add_fingerprint(user)
user.show_message("<span style=\"color:blue\">You add the wiring to the assembly.</span>")
else
user.show_message("<span style=\"color:red\">This cable coil isn't long enough!</span>")
else if (istype(W, /obj/item/crowbar))
user.show_message("<span style=\"color:red\">The plasma tank is firmly secured to the assembly and won't budge.</span>")
else if (istype(W, /obj/item/screwdriver))
src.setDetState(1)
user.show_message("<span style=\"color:blue\">You unsecure the plasma tank from the assembly.</span>")
if (3)
if (istype(W, /obj/item/device/timer))
src.setDetState(4)
user.u_equip(W)
W.loc = src
W.master = src
W.layer = initial(src.layer)
src.part_fs = W
src.part_fs.time = 90 //Minimum det time
src.add_fingerprint(user)
user.show_message("<span style=\"color:blue\">You wire the timer failsafe to the assembly, disabling its external controls.</span>")
else if (istype(W, /obj/item/wirecutters))
src.setDetState(2)
var/obj/item/cable_coil/C = new /obj/item/cable_coil(user, 6)
C.loc = user.loc
user.show_message("<span style=\"color:blue\">You cut the wiring on the assembly.</span>")
if (4)
if (istype(W, /obj/item/wirecutters))
src.setDetState(3)
src.part_fs.loc = user.loc
src.part_fs.master = null
src.part_fs = null
if (src.trigger)
src.trigger.loc = user.loc
src.trigger.master = null
src.trigger = null
user.show_message("<span style=\"color:red\">The triggering device falls off the assembly.</span>")
for (var/obj/item/a in src.attachments)
a.loc = user.loc
a.master = null
a.layer = initial(a.layer)
src.clear_attachment(a)
user.show_message("<span style=\"color:red\">The [a] falls off the assembly.</span>")
src.attachments.Cut()
user.show_message("<span style=\"color:blue\">You disconnect the timer from the assembly, and reenable its external controls.</span>")
if (istype(W, /obj/item/screwdriver))
if (!src.trigger && !src.attachments.len)
user.show_message("<span style=\"color:red\">You cannot remove any attachments, as there are none attached.</span>")
return
var/list/options = list(src.trigger)
options += src.attachments
options += "cancel"
var/target = input("Which device do you want to remove?", "Device to remove", "cancel") in options
if (target == src.trigger)
src.trigger.loc = user.loc
src.trigger.master = null
src.trigger = null
user.show_message("<span style=\"color:blue\">You remove the triggering device from the assembly.</span>")
else if (target == "cancel")
return
else
var/obj/item/T = target
T.loc = user.loc
T.master = null
T.detonator_act("detach", src)
src.clear_attachment(target)
src.attachments.Remove(target)
setDescription()
user.show_message("<span style=\"color:blue\">You remove the [target] from the assembly.</span>")
setDescription()
else if (istype(W, /obj/item/device/radio/signaler))
if (src.trigger)
user.show_message("<span style=\"color:red\">There is a trigger already screwed onto the assembly.</span>")
else
W.loc = src
W.master = src
W.layer = initial(W.layer)
user.u_equip(W)
src.trigger = W
user.show_message("<span style=\"color:blue\">You attach the [W.name] to the trigger slot.</span>")
setDescription()
else if (istype(W, /obj/item/device/radio))
if (src.radio)
user.show_message("<span style=\"color:red\">There is a radio already screwed onto the assembly.</span>")
else
W.loc = src
W.master = src
W.layer = initial(W.layer)
user.u_equip(W)
src.radio = W
user.show_message("<span style=\"color:blue\">You attach the [W.name] to the radio slot.</span>")
else if (istype(W, /obj/item/paper))
src.note = W:info
W.loc = null
W.master = null
W.layer = null
user.u_equip(W)
user.show_message("<span style=\"color:blue\">You stick the note onto the detonator assembly.</span>")
del(W)
else if (W.is_detonator_attachment())
if (src.attachments.len < 3)
W.loc = src
W.master = src
W.layer = initial(W.layer)
user.u_equip(W)
src.attachments += W
W.detonator_act("attach", src)
var/N = pick(src.WireColors)
src.WireColors -= N
N += " wire"
var/pos = rand(0, src.WireNames.len)
src.WireNames.Insert(pos, N)
src.WireFunctions.Insert(pos, W)
user.show_message("<span style=\"color:blue\">You attach the [W.name] to an attachment slot.</span>")
setDescription()
else
user.show_message("<span style=\"color:red\">There are no more free attachment slots on the device!</span>")
setDescription()
/obj/item/assembly/detonator/proc/clear_attachment(var/obj/item/T)
var/pos = src.WireFunctions.Find(T)
var/N = copytext(src.WireNames[pos], 1, -5)
src.WireColors += N
src.WireNames.Cut(pos, pos+1)
src.WireFunctions.Cut(pos, pos+1)
/obj/item/assembly/detonator/proc/detonate()
if (!src.attachedTo)
return
if(force_dud)
var/turf/T = get_turf(src)
message_admins("A canister bomb would have detonated at at [T.loc.name] ([showCoords(T.x, T.y, T.z)]) but was forced to dud!")
return
src.attachedTo.anchored = 0
src.attachedTo.light.disable()
if (src.defused)
src.attachedTo.visible_message("<b><span style=\"color:red\">The cut detonation wire emits a spark. The detonator signal never reached the detonator unit.</span></b>")
return
if (src.part_t.air_contents.return_pressure() < 400 || src.part_t.air_contents.toxins < (4*ONE_ATMOSPHERE)*70/(R_IDEAL_GAS_EQUATION*T20C))
src.attachedTo.visible_message("<b><span style=\"color:red\">A sparking noise is heard as the igniter goes off. The plasma tank fails to explode, merely burning the circuits of the detonator.</span></b>")
src.attachedTo.det = null
src.attachedTo.overlay_state = null
del(src)
return
src.attachedTo.visible_message("<b><span style=\"color:red\">A sparking noise is heard as the igniter goes off. The plasma tank blows, creating a microexplosion and rupturing the canister.</span></b>")
if (attachedTo.air_contents.return_pressure() < 7000)
src.attachedTo.visible_message("<b><span style=\"color:red\">The ruptured canister, due to a serious lack of pressure, fails to explode into shreds and leaks its contents into the air.</span></b>")
src.attachedTo.health = 0
src.attachedTo.healthcheck()
src.attachedTo.det = null
src.attachedTo.overlay_state = null
del(src)
return
if (attachedTo.air_contents.temperature < 100000)
src.attachedTo.visible_message("<b><span style=\"color:red\">The ruptured canister shatters from the pressure, but its temperature isn't high enough to create an explosion. Its contents leak into the air.</span></b>")
src.attachedTo.health = 0
src.attachedTo.healthcheck()
src.attachedTo.det = null
src.attachedTo.overlay_state = null
del(src)
return
var/turf/epicenter = get_turf(loc)
logTheThing("bombing", null, null, "A canister bomb detonates at [epicenter.loc.name] ([showCoords(epicenter.x, epicenter.y, epicenter.z)])")
message_admins("A canister bomb detonates at [epicenter.loc.name] ([showCoords(epicenter.x, epicenter.y, epicenter.z)])")
src.attachedTo.visible_message("<b><span style=\"color:red\">The ruptured canister shatters from the pressure, and the hot gas ignites.</span></b>")
var/power = min(850 * (attachedTo.air_contents.return_pressure() + attachedTo.air_contents.temperature - 107000) / 233196469.0 + 200, 7000) //the second arg is the max explosion power
//if (power == 150000) //they reached the cap SOMEHOW? well dang they deserve a medal
//src.builtBy.unlock_medal("", 1) //WIRE TODO: make new medal for this
explosion_new(attachedTo, epicenter, power)
/obj/item/assembly/detonator/proc/setDescription()
src.desc = "A failsafe timer, wired in an incomprehensible way to a detonator assembly"
if (src.trigger)
src.desc += "<br><span style=\"color:blue\">There is \an [src.trigger.name] as a detonation trigger.</span>"
if (src.radio) //WIRE TODO: roll this into the new attachment system
src.desc += "<br><span style=\"color:blue\">There is a radio attached to the timing wire, it will announce the bomb status when primed.</span>"
for (var/obj/item/a in src.attachments)
src.desc += "<br><span style=\"color:blue\">There is \an [a] wired onto the assembly as an attachment.</span>"
/obj/item/assembly/detonator/proc/failsafe_engage()
if (src.part_fs.timing)
return
src.part_fs.timing = 1
src.part_fs.c_state(1)
if (!(src in processing_items))
processing_items.Add(src)
if (!(src.part_fs in processing_items))
processing_items.Add(src.part_fs)
src.dispatch_event("prime")
if (src.radio)
command_alert("A canister bomb is primed in [get_area(src)]! It is set to go off in [src.part_fs.time] seconds.")
logTheThing("bombing", usr, null, "primes a canister bomb at [get_area(src.master)] ([showCoords(src.master.x, src.master.y, src.master.z)])")
message_admins("[key_name(usr)] primes a canister bomb at [get_area(src.master)] ([showCoords(src.master.x, src.master.y, src.master.z)])")
src.attachedTo.visible_message("<B><font color=#FF0000>The detonator's priming process initiates. Its timer shows [src.part_fs.time] seconds.</font></B>")
// Legacy.
/obj/item/assembly/detonator/proc/leaking()
src.dispatch_event("leak")
/obj/item/assembly/detonator/process()
src.dispatch_event("process")
/obj/item/assembly/detonator/proc/dispatch_event(event)
for (var/obj/item/a in src.attachments)
a.detonator_act(event, src)
/obj/item/assembly/detonator/receive_signal(datum/signal/signal)
if (signal)
if (signal.source == src.part_fs)
src.attachedTo.visible_message("<B><font color=#FF0000>The failsafe timer's ticks more rapidly with every passing moment, then suddenly goes quiet.</font></B>")
src.detonate()
else
failsafe_engage()
/obj/item/proc/is_detonator_attachment()
return 0
// Possible events: attach, detach, leak, process, prime, detonate, cut, pulse
/obj/item/proc/detonator_act(event, var/obj/item/assembly/detonator/det)
return
//For testing and I'm too lazy to hand-assemble these whenever I need one =I
/obj/item/assembly/detonator/finished
New()
..()
var/obj/item/tank/plasma/ptank = new /obj/item/tank/plasma(src)
ptank.air_contents.toxins = 30
ptank.master = src
src.part_t = ptank
var/obj/item/device/timer/timer = new /obj/item/device/timer(src)
timer.master = src
src.part_fs = timer
src.part_fs.time = 90 //Minimum det time
setDetState(4)
+649
View File
@@ -0,0 +1,649 @@
/*
Contains:
- Assembly parent
- Timer/igniter
- Proximity/igniter
- Remote signaller/igniter
- Health analyzer/igniter
- Remote signaller/bike horn
- Remote signaller/timer
- Remote signaller/proximity
*/
//////////////////////////////////////// Assembly parent /////////////////////////////////
/obj/item/assembly
name = "assembly"
icon = 'icons/obj/assemblies.dmi'
inhand_image_icon = 'icons/mob/inhand/hand_tools.dmi'
item_state = "assembly"
var/status = 0.0
throwforce = 10
w_class = 3.0
throw_speed = 4
throw_range = 10
stamina_damage = 10
stamina_cost = 10
var/force_dud = 0
/obj/item/assembly/proc/c_state(n, O as obj)
return
/////////////////////////////////////// Timer/igniter /////////////////////////
/obj/item/assembly/time_ignite
name = "Timer/Igniter Assembly"
desc = "A timer-activated igniter assembly."
icon_state = "timer-igniter0"
var/obj/item/device/timer/part1 = null
var/obj/item/device/igniter/part2 = null
var/obj/item/reagent_containers/glass/beaker/part3 = null
status = null
flags = FPRINT | TABLEPASS| CONDUCT | NOSPLASH
/obj/item/assembly/time_ignite/New()
..()
spawn(0)
if(!part1)
part1 = new(src)
part1.master = src
if(!part2)
part2 = new(src)
part2.master = src
return
/obj/item/assembly/time_ignite/disposing()
qdel(part1)
part1 = null
qdel(part2)
part2 = null
qdel(part3)
part3 = null
..()
/obj/item/assembly/time_ignite/attack_self(mob/user as mob)
src.part1.attack_self(user, src.status)
src.add_fingerprint(user)
return
/obj/item/assembly/time_ignite/receive_signal()
for(var/mob/O in hearers(1, src.loc))
O.show_message("[bicon(src)] *beep* *beep*", 3, "*beep* *beep*", 2)
src.part2.ignite()
if(src.part3)
src.part3.reagents.temperature_reagents(4000, 400)
src.part3.reagents.temperature_reagents(4000, 400)
return
/obj/item/assembly/time_ignite/attackby(obj/item/W as obj, mob/user as mob)
if ((istype(W, /obj/item/wrench) && !( src.status )))
var/turf/T = src.loc
if (ismob(T))
T = T.loc
if (src.part1)
src.part1.set_loc(T)
src.part1.master = null
src.part1 = null
if (src.part2)
src.part2.set_loc(T)
src.part2.master = null
src.part2 = null
if (src.part3)
src.part3.set_loc(T)
src.part3.master = null
src.part3 = null
qdel(src)
return
if((istype(W, /obj/item/reagent_containers/glass/beaker) && !( src.status )))
if(!src.part3)
src.part3 = W
W.master = src
W.layer = initial(W.layer)
user.u_equip(W)
W.set_loc(src)
src.c_state(0)
boutput(user, "You attach the timer/igniter assembly to the beaker.")
else boutput(user, "You must remove the beaker from the assembly before transferring chemicals to it!")
return
if (!( istype(W, /obj/item/screwdriver) ))
return
src.status = !( src.status )
if (src.status)
user.show_message("<span style=\"color:blue\">The timer is now secured!</span>", 1)
else
user.show_message("<span style=\"color:blue\">The timer is now unsecured!</span>", 1)
src.part2.status = src.status
src.add_fingerprint(user)
return
/obj/item/assembly/time_ignite/c_state(n)
if(!src.part3)
src.icon = 'icons/obj/assemblies.dmi'
src.icon_state = text("timer-igniter[n]")
src.overlays = null
src.underlays = null
src.name = "Timer/Igniter Assembly"
else
src.icon = part3.icon
src.icon_state = part3.icon_state
src.overlays = null
src.underlays = null
src.overlays += image('icons/obj/assemblies.dmi', "timeignite_overlay[n]", layer = FLOAT_LAYER)
src.underlays += part3.underlays
src.name = "Timer/Igniter/Beaker Assembly"
return
/obj/item/assembly/time_ignite/verb/removebeaker()
set src in oview(1)
set name = "remove beaker"
set category = "Local"
if (usr.stat || !isliving(usr) || isintangible(usr))
return
if(src.part3)
src.part3.master = null
src.part3.attack_hand(usr)
src.part3 = null
src.c_state(src.part1.timing)
boutput(usr, "<span style=\"color:blue\">You remove the timer/igniter assembly from the beaker.</span>")
else boutput(usr, "<span style=\"color:red\">That doesn't have a beaker attached to it!</span>")
/////////////////////////////// Proximity/igniter /////////////////////////////////////
/obj/item/assembly/prox_ignite
name = "Proximity/Igniter Assembly"
desc = "A proximity-activated igniter assembly."
icon_state = "prox-igniter0"
var/obj/item/device/prox_sensor/part1 = null
var/obj/item/device/igniter/part2 = null
var/obj/item/reagent_containers/glass/beaker/part3 = null
status = null
flags = FPRINT | TABLEPASS| CONDUCT | NOSPLASH
/obj/item/assembly/prox_ignite/HasProximity(atom/movable/AM as mob|obj)
if (istype(AM, /obj/projectile))
return
if (AM.move_speed < 12 && src.part1)
src.part1.sense()
return
/obj/item/assembly/prox_ignite/dropped()
spawn( 0 )
if (src.part1)
src.part1.sense()
return
return
/obj/item/assembly/prox_ignite/New()
..()
spawn(0)
if(!part1)
part1 = new(src)
part1.master = src
if(!part2)
part2 = new(src)
part2.master = src
return
/obj/item/assembly/prox_ignite/disposing()
qdel(part1)
part1 = null
qdel(part2)
part2 = null
qdel(part3)
part3 = null
..()
/obj/item/assembly/prox_ignite/c_state(n)
if(!src.part3)
src.icon = 'icons/obj/assemblies.dmi'
src.icon_state = text("prox-igniter[n]")
src.overlays = null
src.underlays = null
src.name = "Proximity/Igniter Assembly"
else
src.icon = part3.icon
src.icon_state = part3.icon_state
src.overlays = null
src.underlays = null
src.overlays += image('icons/obj/assemblies.dmi', "proxignite_overlay[n]", layer = FLOAT_LAYER)
src.underlays += part3.underlays
src.name = "Proximity/Igniter/Beaker Assembly"
return
/obj/item/assembly/prox_ignite/attackby(obj/item/W as obj, mob/user as mob)
if ((istype(W, /obj/item/wrench) && !( src.status )))
var/turf/T = src.loc
if (ismob(T))
T = T.loc
if (part1)
src.part1.set_loc(T)
src.part1.master = null
src.part1 = null
if (part2)
src.part2.set_loc(T)
src.part2.master = null
src.part2 = null
if (part3)
src.part3.set_loc(T)
src.part3.master = null
src.part3 = null
//SN src = null
qdel(src)
return
if((istype(W, /obj/item/reagent_containers/glass/beaker) && !( src.status )))
if(!src.part3)
src.part3 = W
W.master = src
W.layer = initial(W.layer)
user.u_equip(W)
W.set_loc(src)
src.c_state(0)
boutput(user, "You attach the proximity/igniter assembly to the beaker.")
else boutput(user, "You must remove the beaker from the assembly before transferring chemicals to it!")
return
if (!( istype(W, /obj/item/screwdriver) ))
return
src.status = !( src.status )
if (src.status)
user.show_message("<span style=\"color:blue\">The proximity sensor is now secured! The igniter now works!</span>", 1)
else
user.show_message("<span style=\"color:blue\">The proximity sensor is now unsecured! The igniter will not work.</span>", 1)
src.part2.status = src.status
src.add_fingerprint(user)
return
/obj/item/assembly/prox_ignite/attack_self(mob/user as mob)
src.part1.attack_self(user, src.status)
src.add_fingerprint(user)
return
/obj/item/assembly/prox_ignite/receive_signal()
for(var/mob/O in hearers(1, src.loc))
O.show_message("[bicon(src)] *beep* *beep*", 3, "*beep* *beep*", 2)
src.part2.ignite()
if(src.part3)
src.part3.reagents.temperature_reagents(4000, 400)
src.part3.reagents.temperature_reagents(4000, 400)
return
/obj/item/assembly/prox_ignite/verb/removebeaker()
set src in oview(1)
set name = "remove beaker"
set category = "Local"
if (usr.stat || !isliving(usr) || isintangible(usr))
return
if(src.part3)
src.part3.master = null
src.part3.attack_hand(usr)
src.part3 = null
src.c_state(src.part1.timing)
boutput(usr, "<span style=\"color:blue\">You remove the timer/igniter assembly from the beaker.</span>")
else boutput(usr, "<span style=\"color:red\">That doesn't have a beaker attached to it!</span>")
/////////////////////////////////////// Remote signaller/igniter //////////////////////////////////////
/obj/item/assembly/rad_ignite
name = "Radio/Igniter Assembly"
desc = "A radio-activated igniter assembly."
icon_state = "radio-igniter"
var/obj/item/device/radio/signaler/part1 = null
var/obj/item/device/igniter/part2 = null
var/obj/item/reagent_containers/glass/beaker/part3 = null
status = null
flags = FPRINT | TABLEPASS| CONDUCT | NOSPLASH
/obj/item/assembly/rad_ignite/New()
..()
spawn(0)
if(!part1)
part1 = new(src)
part1.master = src
if(!part2)
part2 = new(src)
part2.master = src
/obj/item/assembly/rad_ignite/disposing()
qdel(part1)
part1 = null
qdel(part2)
part2 = null
qdel(part3)
part3 = null
..()
/obj/item/assembly/rad_ignite/attackby(obj/item/W as obj, mob/user as mob)
if ((istype(W, /obj/item/wrench) && !( src.status )))
var/turf/T = src.loc
if (ismob(T))
T = T.loc
src.part1.set_loc(T)
src.part2.set_loc(T)
src.part3.set_loc(T)
src.part1.master = null
src.part2.master = null
src.part3.master = null
src.part1 = null
src.part2 = null
src.part3 = null
//SN src = null
qdel(src)
return
if((istype(W, /obj/item/reagent_containers/glass/beaker) && !( src.status )))
if(!src.part3)
src.part3 = W
W.master = src
W.layer = initial(W.layer)
user.u_equip(W)
W.set_loc(src)
src.c_state()
boutput(user, "You attach the radio/igniter assembly to the beaker.")
else boutput(user, "You must remove the beaker from the assembly before transferring chemicals to it!")
return
if (!( istype(W, /obj/item/screwdriver) ))
return
src.status = !( src.status )
if (src.status)
user.show_message("<span style=\"color:blue\">The radio is now secured! The igniter now works!</span>", 1)
else
user.show_message("<span style=\"color:blue\">The radio is now unsecured! The igniter will not work.</span>", 1)
src.part2.status = src.status
src.part1.b_stat = !( src.status )
src.add_fingerprint(user)
return
/obj/item/assembly/rad_ignite/attack_self(mob/user as mob)
src.part1.attack_self(user, src.status)
src.add_fingerprint(user)
return
/obj/item/assembly/rad_ignite/receive_signal()
for(var/mob/O in hearers(1, src.loc))
O.show_message("[bicon(src)] *beep* *beep*", 3, "*beep* *beep*", 2)
src.part2.ignite()
if(src.part3)
src.part3.reagents.temperature_reagents(4000, 400)
src.part3.reagents.temperature_reagents(4000, 400)
return
/obj/item/assembly/rad_ignite/verb/removebeaker()
set src in oview(1)
set name = "remove beaker"
set category = "Local"
if (usr.stat || !isliving(usr) || isintangible(usr))
return
if(src.part3)
src.part3.master = null
src.part3.attack_hand(usr)
src.part3 = null
src.c_state()
boutput(usr, "<span style=\"color:blue\">You remove the timer/igniter assembly from the beaker.</span>")
else boutput(usr, "<span style=\"color:red\">That doesn't have a beaker attached to it!</span>")
/obj/item/assembly/rad_ignite/c_state()
if(!src.part3)
src.icon = 'icons/obj/assemblies.dmi'
src.icon_state = text("radio-igniter")
src.overlays = null
src.underlays = null
src.name = "Radio/Igniter Assembly"
else
src.icon = part3.icon
src.icon_state = part3.icon_state
src.overlays = null
src.underlays = null
src.overlays += image('icons/obj/assemblies.dmi', "radignite_overlay", layer = FLOAT_LAYER)
src.underlays += part3.underlays
src.name = "Radio/Igniter/Beaker Assembly"
return
///////////////////////////////// Health analyzer/igniter /////////////////////////////////////////////
/obj/item/assembly/anal_ignite //lol
name = "Health-Analyzer/Igniter Assembly"
desc = "A health-analyzer igniter assembly."
icon_state = "timer-igniter0"
var/obj/item/device/healthanalyzer/part1 = null
var/obj/item/device/igniter/part2 = null
status = null
flags = FPRINT | TABLEPASS| CONDUCT
item_state = "electronic"
/obj/item/assembly/anal_ignite/New()
..()
spawn (5)
if (src && !src.part1)
src.part1 = new /obj/item/device/healthanalyzer(src)
src.part1.master = src
if (src && !src.part2)
src.part2 = new /obj/item/device/igniter(src)
src.part2.master = src
return
/obj/item/assembly/anal_ignite/attackby(obj/item/W as obj, mob/user as mob)
if ((istype(W, /obj/item/wrench) && !( src.status )))
var/turf/T = src.loc
if (ismob(T))
T = T.loc
src.part1.set_loc(T)
src.part2.set_loc(T)
src.part1.master = null
src.part2.master = null
src.part1 = null
src.part2 = null
qdel(src)
return
if (( istype(W, /obj/item/screwdriver) ))
src.status = !( src.status )
if (src.status)
user.show_message("<span style=\"color:blue\">The analyzer is now secured!</span>", 1)
else
user.show_message("<span style=\"color:blue\">The analyzer is now unsecured!</span>", 1)
src.part2.status = src.status
src.add_fingerprint(user)
return
///////////////////////////////////////////////////// Remote signaller/bike horn /////////////////////
/obj/item/assembly/radio_horn
desc = "A bike horn hastily jammed into a signaller."
name = "Radio/Horn Assembly"
icon_state = "radio-horn"
var/obj/item/device/radio/signaler/part1 = null
var/obj/item/bikehorn/part2 = null
status = 0.0
flags = FPRINT | TABLEPASS| CONDUCT
/obj/item/assembly/radio_horn/New()
..()
spawn(0)
if(!part1)
part1 = new(src)
part1.master = src
if(!part2)
part2 = new(src)
part2.master = src
return
/obj/item/assembly/radio_horn/disposing()
qdel(part1)
part1 = null
qdel(part2)
part2 = null
..()
return
obj/item/assembly/radio_horn/attack_self(mob/user as mob)
src.part1.attack_self(user)
src.add_fingerprint(user)
return
obj/item/assembly/radio_horn/receive_signal()
if (part2.spam_flag == 0)
part2.spam_flag = 1
playsound(src.loc, part2.sound_horn, part2.volume, part2.randomized_pitch)
spawn(part2.spam_timer)
part2.spam_flag = 0
return
/////////////////////////////////////////////////////// Remote signaller/timer /////////////////////////////////////
/obj/item/assembly/rad_time
name = "Signaller/Timer Assembly"
desc = "A radio signaller activated by a count-down timer."
icon_state = "timer-radio0"
var/obj/item/device/radio/signaler/part1 = null
var/obj/item/device/timer/part2 = null
status = null
flags = FPRINT | TABLEPASS| CONDUCT
/obj/item/assembly/rad_time/disposing()
qdel(part1)
part1 = null
qdel(part2)
part2 = null
..()
return
/obj/item/assembly/rad_time/attackby(obj/item/W as obj, mob/user as mob)
if ((istype(W, /obj/item/wrench) && !( src.status )))
var/turf/T = src.loc
if (ismob(T))
T = T.loc
src.part1.set_loc(T)
src.part2.set_loc(T)
src.part1.master = null
src.part2.master = null
src.part1 = null
src.part2 = null
//SN src = null
qdel(src)
return
if (!( istype(W, /obj/item/screwdriver) ))
return
src.status = !( src.status )
if (src.status)
user.show_message("<span style=\"color:blue\">The signaler is now secured!</span>", 1)
else
user.show_message("<span style=\"color:blue\">The signaler is now unsecured!</span>", 1)
src.part1.b_stat = !( src.status )
src.add_fingerprint(user)
return
/obj/item/assembly/rad_time/attack_self(mob/user as mob)
src.part1.attack_self(user, src.status)
src.part2.attack_self(user, src.status)
src.add_fingerprint(user)
return
/obj/item/assembly/rad_time/receive_signal(datum/signal/signal)
// drsingh for cannot read null.source
if (signal && signal.source == src.part2)
src.part1.send_signal("ACTIVATE")
return
////////////////////////////////////////////// Remote signaller/proximity //////////////////////////////////
/obj/item/assembly/rad_prox
name = "Signaller/Prox Sensor Assembly"
desc = "A proximity-activated radio signaller."
icon_state = "prox-radio0"
var/obj/item/device/radio/signaler/part1 = null
var/obj/item/device/prox_sensor/part2 = null
status = null
flags = FPRINT | TABLEPASS| CONDUCT
/obj/item/assembly/rad_prox/c_state(n)
src.icon_state = "prox-radio[n]"
return
/obj/item/assembly/rad_prox/disposing()
qdel(part1)
part1 = null
qdel(part2)
part2 = null
..()
return
/obj/item/assembly/rad_prox/HasProximity(atom/movable/AM as mob|obj)
if (istype(AM, /obj/projectile))
return
if (AM.move_speed < 12 && src && src.part2)
src.part2.sense()
return
/obj/item/assembly/rad_prox/attackby(obj/item/W as obj, mob/user as mob)
if ((istype(W, /obj/item/wrench) && !( src.status )))
var/turf/T = src.loc
if (ismob(T))
T = T.loc
src.part1.set_loc(T)
src.part2.set_loc(T)
src.part1.master = null
src.part2.master = null
src.part1 = null
src.part2 = null
//SN src = null
qdel(src)
return
if (!( istype(W, /obj/item/screwdriver) ))
return
src.status = !( src.status )
if (src.status)
user.show_message("<span style=\"color:blue\">The proximity sensor is now secured!</span>", 1)
else
user.show_message("<span style=\"color:blue\">The proximity sensor is now unsecured!</span>", 1)
src.part1.b_stat = !( src.status )
src.add_fingerprint(user)
return
/obj/item/assembly/rad_prox/attack_self(mob/user as mob)
src.part1.attack_self(user, src.status)
src.part2.attack_self(user, src.status)
src.add_fingerprint(user)
return
/obj/item/assembly/rad_prox/receive_signal(datum/signal/signal)
// drsingh for Cannot read null.source
if (signal && signal.source == src.part2)
src.part1.send_signal("ACTIVATE")
return
/obj/item/assembly/rad_prox/Move()
..()
src.part2.sense()
return
/obj/item/assembly/rad_prox/dropped()
spawn( 0 )
src.part2.sense()
return
return
+61
View File
@@ -0,0 +1,61 @@
/obj/item/assembly/shock_kit
name = "Shock Kit"
icon_state = "shock_kit"
var/obj/item/clothing/head/helmet/part1 = null
var/obj/item/device/radio/electropack/part2 = null
status = 0.0
w_class = 5.0
flags = FPRINT | TABLEPASS| CONDUCT
/obj/item/assembly/shock_kit/New()
spawn (20)
if (src)
if (!(src.part1 && istype(src.part1)))
src.part1 = new /obj/item/clothing/head/helmet(src)
src.part1.master = src
if (!(src.part2 && istype(src.part2)))
src.part2 = new /obj/item/device/radio/electropack(src)
src.part2.master = src
return
/obj/item/assembly/shock_kit/disposing()
if (src.part1)
qdel(src.part1)
src.part1 = null
if (src.part2)
qdel(src.part2)
src.part2 = null
..()
return
/obj/item/assembly/shock_kit/attackby(obj/item/W as obj, mob/user as mob)
src.add_fingerprint(user)
if (istype(W, /obj/item/wrench))
var/turf/T = get_turf(src)
if (src.part1)
src.part1.set_loc(T)
src.part1.master = null
src.part1 = null
if (src.part2)
src.part2.set_loc(T)
src.part2.master = null
src.part2 = null
qdel(src)
return
else return ..()
/obj/item/assembly/shock_kit/attack_self(mob/user as mob)
src.part1.attack_self(user, src.status)
src.part2.attack_self(user, src.status)
src.add_fingerprint(user)
return
/obj/item/assembly/shock_kit/receive_signal()
if (src.master && istype(src.master, /obj/stool/chair/e_chair))
var/obj/stool/chair/e_chair/C = src.master
if (C.buckled_guy)
logTheThing("signalers", usr, C.buckled_guy, "signalled an electric chair (setting: [C.lethal ? "lethal" : "non-lethal"]), shocking %target% at [log_loc(C)].") // Added (Convair880).
C.shock()
return
+346
View File
@@ -0,0 +1,346 @@
/* Contains:
- Single tank bomb logs
- Single tank bomb (proximity)
- Single tank bomb (timer)
- Single tank bomb (remote signaller)
*/
// Just a little helper. These three bombs are very similar (Convair880).
/obj/item/assembly/proc/bomb_logs(var/mob/user, var/obj/item/bomb, var/type = "", var/welded_or_unwelded = 0, var/is_dud = 0)
if (!bomb || !type)
return
if (is_dud == 1)
message_admins("A [type] single tank bomb would have opened at [log_loc(bomb)] but was forced to dud! Last touched by: [bomb.fingerprintslast ? "[bomb.fingerprintslast]" : "*null*"]")
logTheThing("bombing", null, null, "A [type] single tank bomb would have opened at [log_loc(bomb)] but was forced to dud! Last touched by: [bomb.fingerprintslast ? "[bomb.fingerprintslast]" : "*null*"]")
return
var/obj/item/tank/T = null
if (istype(bomb, /obj/item/assembly/proximity_bomb/))
var/obj/item/assembly/proximity_bomb/PB = bomb
if (PB.part3)
T = PB.part3
if (istype(bomb, /obj/item/assembly/time_bomb/))
var/obj/item/assembly/time_bomb/TB = bomb
if (TB.part3)
T = TB.part3
if (istype(bomb, /obj/item/assembly/radio_bomb/))
var/obj/item/assembly/radio_bomb/RB = bomb
if (RB.part3)
T = RB.part3
if (!T || !istype(T, /obj/item/tank))
return
logTheThing("bombing", user, null, "[welded_or_unwelded == 0 ? "welded" : "unwelded"] a [type] single tank bomb [log_atmos(T)] at [log_loc(user)].")
if (welded_or_unwelded == 0)
message_admins("[key_name(user)] welded a [type] single tank bomb at [log_loc(user)]. See bombing logs or bomb monitor for complete atmos readout.")
return
/////////////////////////////////////////////////// Single tank bomb (proximity) ////////////////////////////////////
/obj/item/assembly/proximity_bomb
desc = "A very intricate igniter and proximity sensor electrical assembly mounted onto top of a plasma tank."
name = "Proximity/Igniter/Plasma Tank Assembly"
icon_state = "prox-igniter-tank0"
var/obj/item/device/prox_sensor/part1 = null
var/obj/item/device/igniter/part2 = null
var/obj/item/tank/plasma/part3 = null
status = 0.0
flags = FPRINT | TABLEPASS| CONDUCT
/obj/item/assembly/proximity_bomb/dropped()
spawn( 0 )
src.part1.sense()
return
return
/obj/item/assembly/proximity_bomb/examine()
..()
src.part3.examine()
/obj/item/assembly/proximity_bomb/disposing()
qdel(part1)
part1 = null
qdel(part2)
part2 = null
qdel(part3)
part3 = null
..()
return
/obj/item/assembly/proximity_bomb/attackby(obj/item/W as obj, mob/user as mob)
if ((istype(W, /obj/item/wrench) && !( src.status )))
var/obj/item/assembly/prox_ignite/R = new /obj/item/assembly/prox_ignite( )
R.part1 = src.part1
R.part2 = src.part2
user.put_in_hand_or_drop(R)
src.part1.set_loc(R)
src.part2.set_loc(R)
src.part1.master = R
src.part2.master = R
var/turf/T = src.loc
if (!( istype(T, /turf) ))
T = T.loc
if (!( istype(T, /turf) ))
T = T.loc
src.part3.set_loc(T)
src.part1 = null
src.part2 = null
src.part3 = null
//SN src = null
qdel(src)
return
if (!( istype(W, /obj/item/weldingtool) ))
return
if (!( src.status ))
src.status = 1
user.show_message("<span style=\"color:blue\">A pressure hole has been bored to the plasma tank valve. The plasma tank can now be ignited.</span>", 1)
else
src.status = 0
boutput(user, "<span style=\"color:blue\">The hole has been closed.</span>")
src.bomb_logs(user, src, "proximity", src.status == 1 ? 0 : 1, 0)
src.part2.status = src.status
src.add_fingerprint(user)
return
/obj/item/assembly/proximity_bomb/attack_self(mob/user as mob)
playsound(src.loc, "sound/weapons/armbomb.ogg", 100, 1)
src.part1.attack_self(user, 1)
src.add_fingerprint(user)
return
/obj/item/assembly/proximity_bomb/receive_signal()
//boutput(world, "miptank [src] got signal")
for(var/mob/O in hearers(1, null))
O.show_message("[bicon(src)] *beep* *beep*", 3, "*beep* *beep*", 2)
//Foreach goto(19)
if (src.status)
src.part1.armed = 0
src.c_state(0)
if (src.force_dud == 1)
src.bomb_logs(usr, src, "proximity", 0, 1)
return
src.part3.ignite()
else
if (!src.status && src.force_dud == 0)
src.part1.armed = 0
src.c_state(0)
src.part3.release()
return
/obj/item/assembly/proximity_bomb/c_state(n)
src.icon_state = text("prox-igniter-tank[]", n)
return
/obj/item/assembly/proximity_bomb/HasProximity(atom/movable/AM as mob|obj)
if (istype(AM, /obj/projectile))
return
if (AM.move_speed < 12 && src.part1)
src.part1.sense()
return
/obj/item/assembly/proximity_bomb/Bump(atom/O)
spawn(0)
//boutput(world, "miptank bumped into [O]")
if(src.part1.armed)
//boutput(world, "sending signal")
receive_signal()
else
//boutput(world, "not active")
..()
/obj/item/assembly/proximity_bomb/proc/prox_check()
if(!part1 || !part1.armed)
return
for(var/atom/A in view(1, src.loc))
if(A!=src && !istype(A, /turf/space) && !isarea(A))
//boutput(world, "[A]:[A.type] was sensed")
src.part1.sense()
break
spawn(10)
prox_check()
/////////////////////////////////////////////////// Single tank bomb (timer) ////////////////////////////////////
/obj/item/assembly/time_bomb
desc = "A very intricate igniter and timer assembly mounted onto top of a plasma tank."
name = "Timer/Igniter/Plasma Tank Assembly"
icon_state = "timer-igniter-tank0"
var/obj/item/device/timer/part1 = null
var/obj/item/device/igniter/part2 = null
var/obj/item/tank/plasma/part3 = null
status = 0.0
flags = FPRINT | TABLEPASS| CONDUCT
/obj/item/assembly/time_bomb/c_state(n)
src.icon_state = text("timer-igniter-tank[]", n)
return
/obj/item/assembly/time_bomb/examine()
..()
src.part3.examine()
/obj/item/assembly/time_bomb/disposing()
qdel(part1)
part1 = null
qdel(part2)
part2 = null
qdel(part3)
part3 = null
..()
return
/obj/item/assembly/time_bomb/attackby(obj/item/W as obj, mob/user as mob)
if ((istype(W, /obj/item/wrench) && !( src.status )))
var/obj/item/assembly/time_ignite/R = new /obj/item/assembly/time_ignite( )
R.part1 = src.part1
R.part2 = src.part2
user.put_in_hand_or_drop(R)
src.part1.set_loc(R)
src.part2.set_loc(R)
src.part1.master = R
src.part2.master = R
var/turf/T = src.loc
if (!( istype(T, /turf) ))
T = T.loc
if (!( istype(T, /turf) ))
T = T.loc
src.part3.set_loc(T)
src.part1 = null
src.part2 = null
src.part3 = null
//SN src = null
qdel(src)
return
if (!( istype(W, /obj/item/weldingtool) ))
return
if (!( src.status ))
src.status = 1
user.show_message("<span style=\"color:blue\">A pressure hole has been bored to the plasma tank valve. The plasma tank can now be ignited.</span>", 1)
else
src.status = 0
boutput(user, "<span style=\"color:blue\">The hole has been closed.</span>")
src.part2.status = src.status
src.bomb_logs(user, src, "timer", src.status == 1 ? 0 : 1, 0)
src.add_fingerprint(user)
return
/obj/item/assembly/time_bomb/attack_self(mob/user as mob)
if (src.part1)
src.part1.attack_self(user, 1)
playsound(src.loc, "sound/weapons/armbomb.ogg", 100, 1)
src.add_fingerprint(user)
return
/obj/item/assembly/time_bomb/receive_signal()
//boutput(world, "tiptank [src] got signal")
for(var/mob/O in hearers(1, null))
O.show_message("[bicon(src)] *beep* *beep*", 3, "*beep* *beep*", 2)
if (src.status)
if (src.force_dud == 1)
src.bomb_logs(usr, src, "timer", 0, 1)
return
src.part3.ignite()
else
if (!src.status && src.force_dud == 0)
src.part3.release()
return
/////////////////////////////////////////////////// Single tank bomb (remote signaller) ////////////////////////////////////
/obj/item/assembly/radio_bomb
desc = "A very intricate igniter and signaller electrical assembly mounted onto top of a plasma tank."
name = "Radio/Igniter/Plasma Tank Assembly"
icon_state = "radio-igniter-tank"
var/obj/item/device/radio/signaler/part1 = null
var/obj/item/device/igniter/part2 = null
var/obj/item/tank/plasma/part3 = null
status = 0.0
flags = FPRINT | TABLEPASS| CONDUCT
/obj/item/assembly/radio_bomb/examine()
..()
src.part3.examine()
/obj/item/assembly/radio_bomb/Del()
//src.part1 = null
qdel(src.part1)
//src.part2 = null
qdel(src.part2)
//src.part3 = null
qdel(src.part3)
..()
return
/obj/item/assembly/radio_bomb/attackby(obj/item/W as obj, mob/user as mob)
if ((istype(W, /obj/item/wrench) && !( src.status )))
var/obj/item/assembly/rad_ignite/R = new /obj/item/assembly/rad_ignite( )
R.part1 = src.part1
R.part2 = src.part2
user.put_in_hand_or_drop(R)
src.part1.set_loc(R)
src.part2.set_loc(R)
src.part1.master = R
src.part2.master = R
var/turf/T = src.loc
if (!( istype(T, /turf) ))
T = T.loc
if (!( istype(T, /turf) ))
T = T.loc
src.part3.set_loc(T)
src.part1 = null
src.part2 = null
src.part3 = null
//SN src = null
qdel(src)
return
if (!( istype(W, /obj/item/weldingtool) ))
return
if (!( src.status ))
src.status = 1
user.show_message("<span style=\"color:blue\">A pressure hole has been bored to the plasma tank valve. The plasma tank can now be ignited.</span>", 1)
else
src.status = 0
boutput(user, "<span style=\"color:blue\">The hole has been closed.</span>")
src.bomb_logs(user, src, "radio", src.status == 1 ? 0 : 1, 0)
src.part2.status = src.status
src.part1.b_stat = !( src.status )
src.add_fingerprint(user)
return
/obj/item/assembly/radio_bomb/attack_self(mob/user as mob)
if (src.part1)
playsound(src.loc, "sound/weapons/armbomb.ogg", 100, 1)
src.part1.attack_self(user, 1)
src.add_fingerprint(user)
return
/obj/item/assembly/radio_bomb/receive_signal()
//boutput(world, "riptank [src] got signal")
for(var/mob/O in hearers(1, null))
O.show_message("[bicon(src)] *beep* *beep*", 3, "*beep* *beep*", 2)
if (src.status)
if (src.force_dud == 1)
src.bomb_logs(usr, src, "radio", 0, 1)
return
src.part3.ignite()
else
if (!src.status && src.force_dud == 0)
src.part3.release()
return
+319
View File
@@ -0,0 +1,319 @@
//BASKETBALL
/obj/item/basketball
name = "basketball"
desc = "If you can't slam with the best, then jam with the rest."
icon = 'icons/obj/items.dmi'
icon_state = "bball"
item_state = "bball"
w_class = 3.0
force = 0
throw_range = 10
throwforce = 0
var/obj/item/plutonium_core/payload = null
stamina_damage = 5
stamina_cost = 5
stamina_crit_chance = 5
/obj/item/basketball/attack_hand(mob/user as mob)
..()
if(user)
src.icon_state = "bball"
/obj/item/basketball/throw_impact(atom/hit_atom)
..(hit_atom)
src.icon_state = "bball"
if(hit_atom)
playsound(src.loc, "sound/items/bball_bounce.ogg", 65, 1)
if(ismob(hit_atom))
var/mob/M = hit_atom
if(ishuman(M))
if((prob(50) && M.bioHolder.HasEffect("clumsy")) || M.equipped() || get_dir(M, src) == M.dir)
src.visible_message("<span class='combat'>[M] gets beaned with the [src.name].</span>")
M.stunned = max(2, M.stunned)
return
// catch the ball!
src.attack_hand(M)
M.visible_message("<span class='combat'>[M] catches the [src.name]!</span>", "<span class='combat'>You catch the [src.name]!</span>")
logTheThing("combat", M, null, "catches [src]")
return
src.visible_message("<span class='combat'>[M] gets beaned with the [src.name].</span>")
logTheThing("combat", M, null, "is struck by [src]")
M.stunned = max(2, M.stunned)
return
/obj/item/basketball/throw_at(atom/target, range, speed)
src.icon_state = "bball_spin"
..(target, range, speed)
/obj/item/basketball/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/plutonium_core))
boutput(user, "<span style=\"color:blue\">You insert the [W.name] into the [src.name].</span>")
user.u_equip(W)
W.dropped(user)
W.layer = initial(W.layer)
W.set_loc(src)
src.payload = W
if(src.loc == user)
user.verbs += /proc/chaos_dunk
return
..(W, user)
return
/obj/item/basketball/attack_hand(mob/user as mob)
..()
var/mob/living/carbon/human/H = user
if(istype(H) && payload && istype(payload))
H.verbs += /proc/chaos_dunk
return
/obj/item/basketball/unequipped(var/mob/user)
if(payload && istype(payload))
user.verbs -= /proc/chaos_dunk
..()
// hoop
/obj/item/bballbasket
name = "basketball hoop" // it's a hoop you nerd, not a basket
desc = "Can be mounted on walls."
opacity = 0
density = 0
anchored = 0
icon = 'icons/obj/stationobjs.dmi'
icon_state = "bbasket0"
var/mounted = 0
var/active = 0
var/probability = 40
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W,/obj/item/wrench) && mounted)
src.visible_message("<span style=\"color:blue\"><b>[user] removes [src].</b></span>")
src.pixel_y = 0
src.pixel_x = 0
src.anchored = 0
src.mounted = 0
else if (src.mounted && !istype(W, /obj/item/bballbasket))
if (W.cant_drop) return
src.visible_message("<span style=\"color:blue\"><b>[user]</b> jumps up and tries to dunk [W] into [src]!</span>")
user.u_equip(W)
if (user.bioHolder.HasEffect("clumsy") && prob(50)) // clowns are not good at basketball I guess
user.visible_message("<span class='combat'><b>[user] knocks their head into the rim of [src]!</b></span>")
user.weakened = max(5, user.weakened)
if (!src.shoot(W, user))
spawn(10)
src.visible_message("<span style=\"color:red\">[user] whiffs the dunk.</span>")
return
attack_hand(mob/user as mob)
if (mounted)
return
else
return ..(user)
afterattack(atom/target as mob|obj|turf|area, mob/user as mob)
if (!mounted && get_dist(src, target) == 1)
if (isturf(target) && target.density)
//if (get_dir(src,target) == NORTH || get_dir(src,target) == EAST || get_dir(src,target) == SOUTH || get_dir(src,target) == WEST)
if (get_dir(src,target) in cardinal)
src.visible_message("<span style=\"color:blue\"><b>[user] mounts [src] on [target].</b></span>")
user.drop_item()
src.loc = get_turf(user)
src.mounted = 1
src.anchored = 1
src.dir = get_dir(src, target)
switch (src.dir)
if (NORTH)
src.pixel_y = 20
if (SOUTH)
src.pixel_y = -20
if (EAST)
src.pixel_x = 20
if (WEST)
src.pixel_x = -20
return
HasEntered(atom/A)
if (src.active)
return
if (istype(A, /obj/item/bballbasket)) // oh for FUCK'S SAKE
return // NO
if (istype(A, /obj/item))
src.shoot(A)
proc/shoot(var/obj/O as obj, var/mob/user as mob)
if (!O)
return 0
if (istype(O, /obj/item/bballbasket))
return
src.active = 1
if (user)
user.u_equip(O)
O.set_loc(get_turf(src))
if (prob(src.probability)) // It might land!
if (prob(30)) // It landed cleanly!
src.visible_message("<span style=\"color:blue\">[O] lands cleanly in [src]!</span>")
src.basket(O)
else // Aaaa the tension!
src.visible_message("<span style=\"color:red\">[O] teeters on the edge of [src]!</span>")
var/delay = rand(5, 15)
animate_horizontal_wiggle(O, delay, 5, 1, -1) // target, number of animation loops, speed, positive x variation, negative x variation
spawn(delay)
if (O && O.loc == src.loc)
if (prob(40)) // It goes in!
src.visible_message("<span style=\"color:blue\">[O] slips into [src]!</span>")
src.basket(O)
else
src.visible_message("<span style=\"color:red\">[O] slips off of the edge of [src]!</span>")
src.active = 0
else
src.active = 0
src.active = 0
return 1
else
src.active = 0
return 0
proc/basket(var/atom/A as obj|mob)
if (!A || isarea(A) || isturf(A))
return
src.active = 1
playsound(get_turf(src), "rustle", 75, 1)
A.invisibility = 100
flick("bbasket1", src)
spawn(15)
A.invisibility = 0
src.active = 0
/obj/item/bballbasket/testing
probability = 100
//PLUTONIUM CORE
/obj/item/plutonium_core
name = "plutonium core"
desc = "A payload from a nuclear warhead. Comprised of weapons-grade plutonium."
icon = 'icons/obj/items.dmi'
icon_state = "plutonium"
item_state = "egg3"
w_class = 3.0
force = 0
throwforce = 10
/obj/item/plutonium_core/attack_hand(mob/user as mob)
..()
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(!H.gloves)
boutput(H, "<span class='combat'>Your hand burns from grabbing the [src.name].</span>")
var/obj/item/affecting = H.organs["r_arm"]
if(H.hand)
affecting = H.organs["l_arm"]
if(affecting)
affecting.take_damage(0, 15)
H.UpdateDamageIcon()
H.updatehealth()
//BLOOD BOWL BALL
/obj/item/bloodbowlball
name = "spiked ball"
desc = "An american football studded with sharp spikes and serrated blades. Looks dangerous."
icon = 'icons/obj/items.dmi'
icon_state = "bloodbowlball"
item_state = "bloodbowlball"
w_class = 3.0
force = 10
throw_range = 10
throwforce = 2
/obj/item/bloodbowlball/attack_hand(mob/user as mob)
..()
if(user)
src.icon_state = "bloodbowlball"
/obj/item/bloodbowlball/throw_impact(atom/hit_atom)
..(hit_atom)
src.icon_state = "bloodbowlball"
if(hit_atom)
playsound(src.loc, "sound/items/bball_bounce.ogg", 65, 1)
if(ismob(hit_atom))
var/mob/M = hit_atom
if(ishuman(M))
var/mob/living/carbon/T = M
if(prob(20) || T.equipped() || get_dir(T, src) == T.dir)
for(var/mob/V in AIviewers(src, null))
if(V.client)
V.show_message("<span class='combat'>[T] gets stabbed by one of the [src.name]'s spikes.</span>", 1)
playsound(src.loc, "sound/effects/bloody_stabOLD.ogg", 65, 1)
T.stunned = max(5, T.stunned)
T.TakeDamage("chest", 30, 0)
take_bleeding_damage(T, null, 15, DAMAGE_STAB)
return
else if (prob(50))
src.visible_message("<span class='combat'>[T] catches the [src.name] but gets cut.</span>")
T.TakeDamage(T.hand == 1 ? "l_arm" : "r_arm", 15, 0)
take_bleeding_damage(T, null, 10, DAMAGE_CUT)
src.attack_hand(T)
return
// catch the ball!
else
src.attack_hand(T)
T.visible_message("<span class='combat'>[M] catches the [src.name]!</span>")
return
return
/obj/item/bloodbowlball/throw_at(atom/target, range, speed)
src.icon_state = "bloodbowlball_air"
..(target, range, speed)
/obj/item/bloodbowlball/attack(target as mob, mob/user as mob)
playsound(target, "sound/effects/bloody_stab.ogg", 60, 1)
if(iscarbon(target))
if(target:stat != 2)
var/mob/living/carbon/targMob = target
targMob.visible_message("<span class='combat'><B>[user] attacks [target] with the [src]!</B></span>")
take_bleeding_damage(target, user, 5, DAMAGE_STAB)
if(prob(30))
if(prob(30))
boutput(user, "<span class='combat'>You accidentally cut your hand badly!</span>")
user.TakeDamage(user.hand == 1 ? "l_arm" : "r_arm", 10, 0)
take_bleeding_damage(user, user, 5, DAMAGE_CUT)
else
boutput(user, "<span class='combat'>You accidentally cut your hand!</span>")
user.TakeDamage(user.hand == 1 ? "l_arm" : "r_arm", 5, 0)
take_bleeding_damage(user, null, 1, DAMAGE_CUT, 0)
// MADDEN NFL FOOTBALL 2051
/obj/item/football
name = "football"
desc = "A pigskin. An oblate leather spheroid. For tossing around."
icon = 'icons/obj/items.dmi'
icon_state = "football"
item_state = "football"
w_class = 3.0
force = 0
throw_range = 10
throwforce = 0
/obj/item/football/throw_at(atom/target, range, speed)
src.icon_state = "football_air"
..(target, range, speed)
/obj/item/football/throw_impact(atom/hit_atom)
..(hit_atom)
src.icon_state = "football"
if(hit_atom)
playsound(src.loc, "sound/items/bball_bounce.ogg", 65, 1)
/obj/item/football/suicide(var/mob/user as mob)
user.visible_message("<span style=\"color:red\"><b>[user] spikes the [src.name]. It bounces back up and hits \him square in the forehead!</b></span>")
user.TakeDamage("head", 150, 0)
playsound(src.loc, "sound/items/bball_bounce.ogg", 50, 1)
user.updatehealth()
spawn(100)
if (user)
user.suiciding = 0
return 1
File diff suppressed because it is too large Load Diff
+69
View File
@@ -0,0 +1,69 @@
/obj/item/clothing/under/gimmick/bowling
name = "bowling suit"
desc = "Who's up for some bowling?"
icon = 'icons/obj/clothing/uniforms/item_js_athletic.dmi'
wear_image_icon = 'icons/mob/jumpsuits/worn_js_athletic.dmi'
inhand_image_icon = 'icons/mob/inhand/jumpsuit/hand_js_athletic.dmi'
icon_state = "bowling"
item_state = "bowling"
/obj/item/bowling_ball
name = "bowling ball"
desc = "Just keep rollin' rollin'."
icon = 'icons/obj/items.dmi'
icon_state = "bowling_ball"
w_class = 3.0
force = 5
throw_speed = 1
proc/hitWeak(var/mob/hitMob, var/mob/user)
hitMob.visible_message("<span style=\"color:red\">[hitMob] is hit by [user]'s [src]!</span>")
src.damage(hitMob, 5, 10, user)
proc/hitHard(var/mob/hitMob, var/mob/user)
hitMob.visible_message("<span style=\"color:red\">[hitMob] is knocked over by [user]'s [src]!</span>")
src.damage(hitMob, 10, 15, user)
proc/damage(var/mob/hitMob, damMin, damMax, var/mob/living/carbon/human/user)
if(user.w_uniform && istype(user.w_uniform, /obj/item/clothing/under/gimmick/bowling))
hitMob.weakened = max(damMax-10, hitMob.weakened) // Reduced to 10 sec. Don't stun them for 30 sec from a single hit, Christ.
hitMob.stuttering = max(damMax-5, hitMob.stuttering)
hitMob.stunned = max(damMax-10, hitMob.stunned)
hitMob.TakeDamage("chest", rand(damMin, damMax), 0)
else
hitMob.stuttering = max(damMax-5, hitMob.stuttering)
hitMob.TakeDamage("chest", rand(damMin, damMax), 0)
throw_at(atom/target, range, speed)
throw_unlimited = 1
src.icon_state = "bowling_ball_spin"
..(target, range, speed)
attack_hand(mob/user as mob)
..()
if(user)
src.icon_state = "bowling_ball"
throw_impact(atom/hit_atom)
var/mob/living/carbon/human/user = usr
src.icon_state = "bowling_ball"
if(hit_atom)
playsound(src.loc, "sound/effects/exlow.ogg", 65, 1)
if (ismob(hit_atom))
var/mob/hitMob = hit_atom
if (ishuman(hitMob))
spawn( 0 )
if (istype(user))
if (user.w_uniform && istype(user.w_uniform, /obj/item/clothing/under/gimmick/bowling))
src.hitHard(hitMob, user)
if(!(hitMob == user))
user.say(pick("Who's the kingpin now, baby?", "STRIIIKE!", "Watch it, pinhead!", "Ten points!"))
else
src.hitWeak(hitMob, user)
else
src.hitWeak(hitMob, user)
return
+119
View File
@@ -0,0 +1,119 @@
/obj/item/brain
name = "brain"
desc = "A human brain, gross."
icon = 'icons/obj/surgery.dmi'
icon_state = "brain2"
inhand_image_icon = 'icons/mob/inhand/hand_medical.dmi'
item_state = "brain2"
flags = TABLEPASS
force = 1.0
w_class = 1.0
throwforce = 1.0
throw_speed = 3
throw_range = 5
var/datum/mind/owner = null
stamina_damage = 5
stamina_cost = 5
edible = 1
/obj/item/brain/New()
..()
spawn(5)
if(src.donor)
src.name = "[src.donor]'s brain"
if (icon_state == "brain2")
desc = "A human brain. It looks [pick("small", "big", "normal", "rotten", "healthy", "tasty", "like it should be flushed down disposals", "bloody")]."
/obj/item/brain/examine()
..()
if (usr.job == "Roboticist" || usr.job == "Medical Doctor" || usr.job == "Geneticist" || usr.job == "Medical Director")
if (src.owner)
if (src.owner.current)
boutput(usr, "<span style=\"color:blue\">This brain is still warm.</span>")
else
boutput(usr, "<span style=\"color:red\">This brain has gone cold.</span>")
else
boutput(usr, "<span style=\"color:red\">This brain has gone cold.</span>")
/obj/item/brain/throw_impact(var/turf/T)
playsound(src.loc, "sound/effects/splat.ogg", 100, 1)
if (T)
new /obj/decal/cleanable/blood(T)
/obj/item/brain/synth
name = "synthbrain"
item_state = "plant"
desc = "An artificial mass of grey matter. Not actually, as one might assume, very good at thinking."
New()
..()
src.icon_state = pick("plant_brain", "plant_brain_bloom")
/obj/item/brain/ai
name = "neural net processor"
desc = "A heavily augmented human brain, upgraded to deal with the large amount of information an AI unit must process."
icon_state = "ai_brain"
item_state = "ai_brain"
New()
..()
spawn(10)
if(src.owner && src.owner.current)
src.name = "[src.owner.current]'s neural net processor"
/obj/item/brain/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
if(!istype(M, /mob))
return
src.add_fingerprint(user)
if(!(user.zone_sel.selecting == ("head")) || !istype(M, /mob/living/carbon/human))
return ..()
if(!(locate(/obj/machinery/optable, M.loc) && M.lying) && !(locate(/obj/table, M.loc) && (M.paralysis || M.stat)))
return ..()
var/mob/living/carbon/human/H = M
if(istype(M, /mob/living/carbon/human) && ((H.head && H.head.c_flags & COVERSEYES) || (H.wear_mask && H.wear_mask.c_flags & COVERSEYES) || (H.glasses && H.glasses.c_flags & COVERSEYES)))
// you can't stab someone in the eyes wearing a mask!
boutput(user, "<span style=\"color:blue\">You're going to need to remove that mask/helmet/glasses first.</span>")
return
//since these people will be dead M != usr
/*
if(M:brain_op_stage == 4.0)
var/fluff = pick("insert[M == user ? "" : "s"]", "shove[M == user ? "" : "s"]", "place[M == user ? "" : "s"]", "drop[M == user ? "" : "s"]", "smooshes[M == user ? "" : "s"]", "squishes[M == user ? "" : "s"]")
M.visible_message("<span style=\"color:red\"><b>[user]</b> [fluff] [src] into [M == user ? </span>"[M.gender == "male" ? "his" : "her"]" : "[M]'s"] head!", \
"<span style=\"color:red\">[M == user ? </span>"You" : "<b>[user]</b>"] [fluff] [src] into your head!")
if(M.client)
M.client.mob = new/mob/dead/observer(M)
//a mob can't have two clients so get rid of one
if(src.owner)
/*
//if the brain has an owner corpse
if(src.owner.client)
//if the player hasn't ghosted
src.owner.client.mob = M
//then put them in M
else
//if the player HAS ghosted
for(var/mob/dead/observer/O in mobs)
if(O.corpse == src.owner && O.client)
//find their ghost
O.client.mob = M
//put their mob in M
qdel(O)
//delete thier ghost
*/
src.owner.transfer_to(M)
M:brain_op_stage = 3.0
qdel(src)
else
..()
return
*/
+133
View File
@@ -0,0 +1,133 @@
/obj/item/medical
name = "medical pack"
icon = 'icons/obj/items.dmi'
inhand_image_icon = 'icons/mob/inhand/hand_medical.dmi'
amount = 5
w_class = 1
throw_speed = 4
throw_range = 20
var/heal_brute = 0
var/heal_burn = 0
stamina_damage = 3
stamina_cost = 3
stamina_crit_chance = 3
examine()
set src in view(1)
set category = "Local"
if (src.amount <= 0)
qdel(src)
return
..()
boutput(usr, "[bicon(src)] <span style=\"color:blue\">There [src.amount == 1 ? "is" : "are"] [src.amount] [src.name]\s left on the stack!</span>")
return
attack_hand(mob/user as mob)
if (user.r_hand == src || user.l_hand == src)
src.add_fingerprint(user)
var/obj/item/medical/split = new src.type(user)
split.amount = 1
user.put_in_hand_or_drop(split)
src.amount--
if (src.amount < 1)
qdel(src)
return
else
..()
return
attackby(obj/item/medical/W as obj, mob/user as mob)
if (!istype(W, src.type))
return
if (W.amount == 5)
return
if (W.amount + src.amount > 5)
src.amount = (W.amount + src.amount) - 5
W.amount = 5
else
W.amount += src.amount
qdel(src)
return
attack(mob/M as mob, mob/user as mob)
if (issilicon(M))
if (prob(5))
user.show_text("I'm a doctor, not a mechanic.", "red")
else
user.show_text("You can't seem to find any flesh on this patient.", "red")
return
if (user)
if (M != user)
M.visible_message("<span style=\"color:red\">[M] has been applied with [src] by [user]</span>",)
else
var/t_himself = "itself"
if (user.gender == MALE)
t_himself = "himself"
else if (user.gender == FEMALE)
t_himself = "herself"
M.visible_message("<span style=\"color:red\">[M] applied [src] on [t_himself]</span>")
if (ishuman(M))
var/mob/living/carbon/human/H = M
var/obj/item/affecting = H.organs["chest"]
if (ishuman(user))
var/mob/living/carbon/human/user2 = user
var/t = user2.zone_sel.selecting
if (H.organs[t])
affecting = H.organs[t]
else
if (!istype(affecting, /obj/item) || affecting:burn_dam <= 0)
affecting = H.organs["head"]
if (!istype(affecting, /obj/item) || affecting:burn_dam <= 0)
affecting = H.organs["chest"]
if (affecting.heal_damage(src.heal_brute, src.heal_burn))
H.UpdateDamageIcon()
if (M != user && ishuman(M) && ishuman(user))
if (M.gender != user.gender)
M.unlock_medal("Oh, Doctor!", 1)
user.unlock_medal("Oh, Doctor!", 1)
else
H.UpdateDamage()
else
M.HealDamage("All", src.heal_brute, src.heal_burn)
repair_bleeding_damage(M, 50, 1)
M.updatehealth()
src.amount--
if (src.amount <= 0)
qdel(src)
return
/obj/item/medical/bruise_pack
name = "bruise pack"
desc = "A pack designed to treat blunt-force trauma."
icon_state = "brutepack"
heal_brute = 60
cyborg
name = "Tissue Mender"
heal_brute = 60
amount = INFINITY
/obj/item/medical/ointment
name = "ointment"
icon_state = "ointment"
heal_burn = 40
desc = "A topical ointment designed to heal burns."
cyborg
name = "Burn Salve Dispenser"
heal_burn = 40
amount = INFINITY
File diff suppressed because it is too large Load Diff
+408
View File
@@ -0,0 +1,408 @@
// the cable coil object, used for laying cable
#define MAXCOIL 30
/obj/item/cable_coil
name = "cable coil"
var/base_name = "cable coil"
desc = "A coil of power cable."
amount = MAXCOIL
max_stack = MAXCOIL
stack_type = /obj/item/cable_coil // so cut cables can stack with partially depleted full coils
icon = 'icons/obj/power.dmi'
icon_state = "coil"
inhand_image_icon = 'icons/mob/inhand/hand_tools.dmi'
item_state = "coil"
throwforce = 10
w_class = 1.0
throw_speed = 2
throw_range = 5
flags = TABLEPASS|EXTRADELAY|FPRINT|CONDUCT
stamina_damage = 5
stamina_cost = 5
stamina_crit_chance = 10
rand_pos = 1
var/datum/material/insulator = null
var/datum/material/conductor = null
// will use getCachedMaterial() to apply these at spawn
var/spawn_insulator_name = "synthrubber"
var/spawn_conductor_name = "steel"
New(loc, length = MAXCOIL)
src.amount = length
pixel_x = rand(-2,2)
pixel_y = rand(-2,2)
updateicon()
..(loc)
if (spawn_conductor_name)
applyCableMaterials(src, getCachedMaterial(spawn_insulator_name), getCachedMaterial(spawn_conductor_name))
before_stack(atom/movable/O as obj, mob/user as mob)
user.visible_message("<span style=\"color:blue\">[user] begins coiling cable!</span>")
after_stack(atom/movable/O as obj, mob/user as mob, var/added)
boutput(user, "<span style=\"color:blue\">You finish coiling cable.</span>")
suicide(var/mob/user as mob)
user.visible_message("<span style=\"color:red\"><b>[user] wraps the cable around \his neck and tightens it.</b></span>")
user.take_oxygen_deprivation(160)
user.updatehealth()
spawn(100)
if (user)
user.suiciding = 0
return 1
proc/setInsulator(var/datum/material/M)
if (!M)
return
insulator = M
applyCableMaterials(src, M, conductor)
proc/setConductor(var/datum/material/M)
if (!M)
return
conductor = M
applyCableMaterials(src, insulator, M)
proc/updateName()
if (!conductor)
return
if (insulator)
name = "[insulator.name]-insulated [conductor.name]-[base_name]"
else
name = "uninsulated [conductor.name]-[base_name]"
proc/use(var/used)
if (src.amount < used)
return 0
else if (src.amount == used)
qdel(src)
else
amount -= used
updateicon()
return 1
proc/take(var/amt, var/newloc)
if (amt > amount)
amt = amount
if (amt == amount)
if (ismob(loc))
var/mob/owner = loc
owner.u_equip(src)
loc = newloc
return src
src.use(amt)
var/obj/item/cable_coil/C = new /obj/item/cable_coil(newloc)
C.amount = amt
C.updateicon()
C.setInsulator(insulator)
C.setConductor(conductor)
proc/updateicon()
if (amount <= 0)
qdel(src)
else if (amount >= 1 && amount <= 4)
icon_state = "coil[amount]"
base_name = "cable piece"
else
icon_state = "coil"
base_name = "cable coil"
updateName()
/obj/item/cable_coil/cut
icon = 'icons/obj/power.dmi'
icon_state = "coil2"
New(loc, length)
if (length)
..(loc, length)
else
..(loc, rand(1,2))
/obj/item/cable_coil/cut/small
New(loc, length)
..(loc, rand(1,5))
/obj/item/cable_coil/attack_self(var/mob/living/M)
if (istype(M))
if (M.move_laying)
M.move_laying = null
boutput(M, "<span style=\"color:blue\">No longer laying the cable while moving.</span>")
else
M.move_laying = src
boutput(M, "<span style=\"color:blue\">Now laying cable while moving.</span>")
/obj/proc/move_callback(var/mob/M, var/turf/source, var/turf/target)
return
/proc/find_half_cable(var/turf/T, var/ignore_dir)
for (var/obj/cable/C in T)
if (!C.d1 && C.d2 != ignore_dir)
return C
/obj/item/cable_coil/move_callback(var/mob/living/M, var/turf/source, var/turf/target)
if (!istype(M))
return
if (!src.amount)
M.move_laying = null
boutput(M, "<span style=\"color:red\">Your cable coil runs out!</span>")
return
var/obj/cable/C
C = find_half_cable(source, get_dir(source, target))
if (C)
cable_join_between(C, target)
else
turf_place_between(source, target)
if (!src.amount)
M.move_laying = null
boutput(M, "<span style=\"color:red\">Your cable coil runs out!</span>")
return
C = find_half_cable(target, get_dir(target, source))
if (C)
cable_join_between(C, source)
else
turf_place_between(target, source)
if (!src.amount)
M.move_laying = null
boutput(M, "<span style=\"color:red\">Your cable coil runs out!</span>")
return
/obj/item/cable_coil/examine()
set src in view(1)
set category = "Local"
if (amount == 1)
boutput(usr, "A short piece of power cable.")
else if (amount == 1)
boutput(usr, "A piece of power cable.")
else
boutput(usr, "A coil of power cable. There's [amount] length[s_es(amount)] of cable in the coil.")
if (insulator)
boutput(usr, "It is insulated with [insulator].")
if (conductor)
boutput(usr, "Its conductive layer is made out of [conductor].")
/obj/item/cable_coil/attackby(obj/item/W, mob/user)
if (istype(W, /obj/item/wirecutters) && src.amount > 1)
src.amount--
take(1, usr.loc)
boutput(user, "You cut a piece off the cable coil.")
src.updateicon()
return
else if (istype(W, /obj/item/cable_coil))
var/obj/item/cable_coil/C = W
if (C.conductor.mat_id != src.conductor.mat_id || C.insulator.mat_id != src.insulator.mat_id)
boutput(user, "You cannot link together cables made from different materials. That would be silly.")
return
if (C.amount == MAXCOIL)
boutput(user, "The coil is too long, you cannot add any more cable to it.")
return
if ((C.amount + src.amount <= MAXCOIL))
C.amount += src.amount
boutput(user, "You join the cable coils together.")
C.updateicon()
qdel(src)
return
else
boutput(user, "You transfer [MAXCOIL - src.amount ] length\s of cable from one coil to the other.")
src.amount -= (MAXCOIL-C.amount)
src.updateicon()
C.amount = MAXCOIL
C.updateicon()
return
/obj/item/cable_coil/MouseDrop_T(atom/movable/O as obj, mob/user as mob)
..(O, user)
for (var/obj/item/cable_coil/C in view(1, user))
C.updateicon()
// called when cable_coil is clicked on a turf/simulated/floor
/obj/item/cable_coil/proc/turf_place_between(turf/simulated/floor/A, turf/simulated/floor/B)
if (!isturf(B))
return
if (get_dist(A, B) > 1)
return
if (A.intact)
return
var/dirn = get_dir(A, B)
for (var/obj/cable/C in A)
if (C.d1 == dirn || C.d2 == dirn)
return
var/obj/cable/NC = new(A)
applyCableMaterials(NC, src.insulator, src.conductor)
NC.d1 = 0
NC.d2 = dirn
NC.updateicon()
NC.update_network()
NC.log_wirelaying(usr)
src.use(1)
return
/obj/item/cable_coil/proc/cable_join_between(var/obj/cable/C, var/turf/simulated/floor/B)
if (!isturf(B))
return
var/turf/T = C.loc
if (!isturf(T) || T.intact) // sanity checks, also stop use interacting with T-scanner revealed cable
return
if (get_dist(C, B) > 1) // make sure it's close enough
return
if (B == T) // do nothing if we clicked a cable we're standing on
return // may change later if can think of something logical to do
var/dirn = get_dir(C, B)
if (C.d1 == 0) // exisiting cable doesn't point at our position, so see if it's a stub
// if so, make it a full cable pointing from it's old direction to our dirn
var/nd1 = C.d2 // these will be the new directions
var/nd2 = dirn
if (nd1 > nd2) // swap directions to match icons/states
nd1 = dirn
nd2 = C.d2
for (var/obj/cable/LC in T) // check to make sure there's no matching cable
if (LC == C) // skip the cable we're interacting with
continue
if ((LC.d1 == nd1 && LC.d2 == nd2) || (LC.d1 == nd2 && LC.d2 == nd1) ) // make sure no cable matches either direction
return
qdel(C)
var/obj/cable/NC = new(T)
applyCableMaterials(NC, src.insulator, src.conductor)
NC.d1 = nd1
NC.d2 = nd2
NC.updateicon()
NC.update_network()
NC.log_wirelaying(usr)
src.use(1)
return
/obj/item/cable_coil/proc/turf_place(turf/simulated/floor/F, mob/user)
if (!isturf(user.loc))
return
if (get_dist(F,user) > 1)
boutput(user, "You can't lay cable at a place that far away.")
return
if (F.intact) // if floor is intact, complain
boutput(user, "You can't lay cable there unless the floor tiles are removed.")
return
else
var/dirn
if (user.loc == F)
dirn = user.dir // if laying on the tile we're on, lay in the direction we're facing
else
dirn = get_dir(F, user)
for (var/obj/cable/LC in F)
if (LC.d1 == dirn || LC.d2 == dirn)
boutput(user, "There's already a cable at that position.")
return
var/obj/cable/C = new(F)
C.d1 = 0
C.d2 = dirn
C.add_fingerprint(user)
C.updateicon()
C.update_network()
applyCableMaterials(C, src.insulator, src.conductor)
C.log_wirelaying(user)
src.use(1)
return
// called when cable_coil is click on an installed obj/cable
/obj/item/cable_coil/proc/cable_join(obj/cable/C, mob/user)
var/turf/U = user.loc
if (!isturf(U))
return
var/turf/T = C.loc
if (!isturf(T) || T.intact) // sanity checks, also stop use interacting with T-scanner revealed cable
return
if (get_dist(C, user) > 1) // make sure it's close enough
boutput(user, "You can't lay cable at a place that far away.")
return
if (U == T) // do nothing if we clicked a cable we're standing on
return // may change later if can think of something logical to do
var/dirn = get_dir(C, user)
if (C.d1 == dirn || C.d2 == dirn) // one end of the clicked cable is pointing towards us
if (U.intact) // can't place a cable if the floor is complete
boutput(user, "You can't lay cable there unless the floor tiles are removed.")
return
else
// cable is pointing at us, we're standing on an open tile
// so create a stub pointing at the clicked cable on our tile
var/fdirn = turn(dirn, 180) // the opposite direction
for (var/obj/cable/LC in U) // check to make sure there's not a cable there already
if (LC.d1 == fdirn && LC.d2 == fdirn)
boutput(user, "There's already a cable at that position.")
return
var/obj/cable/NC = new(U)
applyCableMaterials(NC, src.insulator, src.conductor)
NC.d1 = 0
NC.d2 = fdirn
NC.add_fingerprint()
NC.updateicon()
NC.update_network()
NC.log_wirelaying(user)
src.use(1)
C.shock(user, 25)
return
else if (C.d1 == 0) // exisiting cable doesn't point at our position, so see if it's a stub
// if so, make it a full cable pointing from it's old direction to our dirn
var/nd1 = C.d2 // these will be the new directions
var/nd2 = dirn
if (nd1 > nd2) // swap directions to match icons/states
nd1 = dirn
nd2 = C.d2
for (var/obj/cable/LC in T) // check to make sure there's no matching cable
if (LC == C) // skip the cable we're interacting with
continue
if ((LC.d1 == nd1 && LC.d2 == nd2) || (LC.d1 == nd2 && LC.d2 == nd1) ) // make sure no cable matches either direction
boutput(user, "There's already a cable at that position.")
return
C.shock(user, 25)
qdel(C)
var/obj/cable/NC = new(T)
applyCableMaterials(NC, src.insulator, src.conductor)
NC.d1 = nd1
NC.d2 = nd2
NC.add_fingerprint()
NC.updateicon()
NC.update_network()
NC.log_wirelaying(user)
src.use(1)
return
+290
View File
@@ -0,0 +1,290 @@
/*
CONTAINS:
DATA CARD
EMAG
ID CARD
GAUNTLET CARDS
*/
/obj/item/card
name = "card"
icon = 'icons/obj/card.dmi'
icon_state = "id"
wear_image_icon = 'icons/mob/mob.dmi'
w_class = 1.0
burn_type = 1
stamina_damage = 1
stamina_cost = 1
var/list/files = list("tools" = 1)
module_research_type = /obj/item/card
/obj/item/card/emag
desc = "It's a card with a magnetic strip attached to some circuitry."
name = "cryptographic sequencer"
icon_state = "emag"
item_state = "card-id"
flags = FPRINT | TABLEPASS | SUPPRESSATTACK
layer = 6.0 // TODO fix layer
is_syndicate = 1
mats = 8
module_research = list("malfunction" = 25)
module_research_type = /obj/item/card/emag
afterattack(var/atom/A, var/mob/user)
if(!A || !user)
return
A.emag_act(user, src)
attack() //Fucking attack messages up in this joint.
return
/obj/item/card/emag/fake
//delicious fake emag
attack_hand(mob/user as mob)
boutput(user, "<span class='combat'>Turns out that card was actually a kind of [pick("deadly chameleon","spiny anteater","sex toy that George Melons likes to use","Syndicate Top Trumps Card","bag of neckbeard shavings")] in disguise! It stabs you!</span>")
user.paralysis = 8
spawn(10)
var/obj/storage/closet/C = new/obj/storage/closet(get_turf(user))
user.set_loc(C)
C.layer = OBJ_LAYER
C.name = "an ordinary closet"
C.desc = "What? It's just an ordinary closet."
C.welded = 1
// ID CARDS
/obj/item/card/id
name = "identification card"
icon_state = "id"
item_state = "card-id"
desc = "A standardized NanoTrasen Identification Card. Ties into many systems station-wide."
var/access = list()
var/registered = null
var/assignment = null
var/title = null
var/emagged = 0
// YOU START WITH NO CREDITS
// WOW
var/money = 0.0
var/pin = 0000
//It's a..smart card. Sure.
var/datum/computer/file/cardfile = null
desc = "An microchipped identification card that contains data that is scanned when attempting to access various doors and computers on the station."
proc/update_name()
name = "[src.registered]'s ID Card ([src.assignment])"
/obj/item/card/id/New()
..()
src.pin = rand(1000,9999)
/obj/item/card/id/command
icon_state = "id_com"
/obj/item/card/id/security
icon_state = "id_sec"
/obj/item/card/id/research
icon_state = "id_res"
/obj/item/card/id/engineering
icon_state = "id_eng"
/obj/item/card/id/civilian
icon_state = "id_civ"
/obj/item/card/id/clown
icon_state = "id_clown"
desc = "Wait, this isn't even an ID Card. It's a piece of a Chips Ahoy wrapper with crayon scribbles on it. What the fuck?"
/obj/item/card/id/gold
name = "identification card"
icon_state = "gold"
item_state = "gold_id"
desc = "This card is important!"
/obj/item/card/id/blank_deluxe
name = "Deluxe ID"
icon_state = "gold"
item_state = "gold_id"
registered = "Member"
assignment = "Member"
/obj/item/card/id/captains_spare
name = "Captain's spare ID"
icon_state = "gold"
item_state = "gold_id"
registered = "Captain"
assignment = "Captain"
New()
access = get_access("Captain")
..()
/obj/item/card/id/captains_spare/explosive
pickup(mob/user)
boutput(user, "<span style=\"color:red\">The ID-Card explodes.</span>")
user.transforming = 1
var/obj/overlay/O = new/obj/overlay(get_turf(user))
O.anchored = 1
O.name = "Explosion"
O.layer = NOLIGHT_EFFECTS_LAYER_BASE
O.pixel_x = -17
O.icon = 'icons/effects/hugeexplosion.dmi'
O.icon_state = "explosion"
spawn(35) qdel(O)
spawn(5) user.gib()
/obj/item/card/id/attack_self(mob/user as mob)
user.visible_message("[user] shows you: [bicon(src)] [src.name]: assignment: [src.assignment]", "You show off your card: [bicon(src)] [src.name]: assignment: [src.assignment]")
src.add_fingerprint(user)
return
/obj/item/card/id/emag_act(var/mob/user, var/obj/item/card/emag/E)
if (src.emagged)
if (user && E)
user.show_text("You run [E] over [src], but nothing seems to happen.", "red")
return
src.access = list() // clear what used to be there
var/list/all_accesses = get_all_accesses()
for (var/i = rand(2,25), i > 0, i--)
var/new_access = pick(all_accesses)
src.access += new_access
all_accesses -= new_access
if (istype(src, /obj/item/card/id/syndicate)) // Nuke ops unable to exit their station (Convair880).
src.access += access_syndicate_shuttle
DEBUG("[get_access_desc(new_access)] added to [src]")
src.emagged = 1
/obj/item/card/id/verb/read()
set src in usr
boutput(usr, "[bicon(src)] [src.name]: The current assignment on the card is [src.assignment].")
return
/obj/item/card/id/syndicate
name = "agent card"
access = list(access_maint_tunnels, access_syndicate_shuttle)
/obj/item/card/id/syndicate/attack_self(mob/user as mob)
if(!src.registered)
var/reg = copytext(src.sanitize_name(input(user, "What name would you like to put on this card?", "Agent card name", ishuman(user) ? user.real_name : user.name)), 1, 100)
var/ass = copytext(src.sanitize_name(input(user, "What occupation would you like to put on this card?\n Note: This will not grant any access levels other than Maintenance.", "Agent card job assignment", "Staff Assistant"), 1), 1, 100)
var/color = input(user, "What color should the ID's color band be?\nClick cancel to abort the forging process.") as null|anything in list("blue","red","green","purple","yellow","No band")
switch (color)
if ("No band")
src.icon_state = "id"
if ("blue")
src.icon_state = "id_civ"
if ("red")
src.icon_state = "id_sec"
if ("green")
src.icon_state = "id_com"
if ("purple")
src.icon_state = "id_res"
if ("yellow")
src.icon_state = "id_eng"
else
return // Abort process.
src.registered = reg
src.assignment = ass
src.name = "[src.registered]'s ID Card ([src.assignment])"
boutput(user, "<span style=\"color:blue\">You successfully forge the ID card.</span>")
else
..()
/obj/item/card/id/syndicate/attackby(obj/item/W as obj, mob/user as mob)
var/obj/item/card/id/sourceCard = W
if (istype(sourceCard))
boutput(user, "You copy [sourceCard]'s accesses to [src].")
src.access |= sourceCard.access
else
return ..()
/obj/item/card/id/syndicate/proc/sanitize_name(var/input, var/strip_bad_stuff_only = 0)
input = strip_html(input, MAX_MESSAGE_LEN, 1)
if (strip_bad_stuff_only)
return input
var/list/namecheck = dd_text2list(trim(input), " ")
for(var/i = 1, i <= namecheck.len, i++)
namecheck[i] = capitalize(namecheck[i])
input = dd_list2text(namecheck, " ")
return input
/obj/item/card/id/temporary
name = "temporary identification card"
icon_state = "id"
item_state = "card-id"
desc = "A temporary NanoTrasen Identification Card. Its access will be revoked once it expires."
var/duration = 60 //seconds
var/starting_access = list()
var/timer = 0 //if 1, description shows time remaining
var/end_time = 0
/obj/item/card/id/temporary/New()
..()
spawn(0) //to give time for duration and starting access to be set
starting_access = access
end_time = ticker.round_elapsed_ticks + duration*10
spawn(duration * 10)
if(access == starting_access) //don't delete access if it's modified with an ID computer
access = list()
/obj/item/card/id/temporary/examine()
..()
if(usr.client && src.timer)
boutput(usr, "A small display in the corner reads: \"Time remaining: [max(0,round((end_time-ticker.round_elapsed_ticks)/10))] seconds.\"")
/obj/item/card/id/gauntlet
icon = 'icons/effects/VR.dmi'
icon_state = "id_clown"
New(var/L, var/mob/user)
..()
if (!user)
registered = "???"
assignment = "unknown phantom entity (no.. mob? this is awkward)"
if (istype(user, /mob/living/carbon/human/virtual))
var/mob/living/LI = user:body
if (LI)
registered = LI.real_name
else
registered = user.real_name
else
registered = user.real_name
if (!user.client)
assignment = "literal meat shield (no client)"
else
assignment = "loading arena matches..."
tag = "gauntlet-id-[user.client.key]"
queryGauntletMatches(1, user.client.key)
name = "[registered]'s ID Card ([assignment])"
proc/SetMatchCount(var/matches)
switch (matches)
if (-INFINITY to 0)
icon_state = "id_clown"
assignment = "Gauntlet Newbie ([matches] rounds played)"
if (1 to 10)
icon_state = "id_civ"
assignment = "Rookie Gladiator ([matches] rounds played)"
if (11 to 20)
icon_state = "id_res"
assignment = "Beginner Gladiator ([matches] rounds played)"
if (21 to 35)
icon_state = "id_eng"
assignment = "Skilled Gladiator ([matches] rounds played)"
if (36 to 55)
icon_state = "id_sec"
assignment = "Advanced Gladiator ([matches] rounds played)"
if (56 to 75)
icon_state = "id_com"
assignment = "Expert Gladiator ([matches] rounds played)"
if (76 to INFINITY)
icon_state = "gold"
assignment = "Legendary Gladiator ([matches] rounds played)"
else
assignment = "what the fuck ([matches] rounds played)"
name = "[registered]'s ID Card ([assignment])"
+104
View File
@@ -0,0 +1,104 @@
/obj/item/chem_pill_bottle
name = "Pill bottle"
icon_state = "pill_canister"
icon = 'icons/obj/chemical.dmi'
w_class = 2.0
stamina_damage = 3
stamina_cost = 3
stamina_crit_chance = 1
rand_pos = 1
var/pname
var/pvol
var/pcount
var/datum/reagents/reagents_internal
// setup this pill bottle from some reagents
proc/create_from_reagents(var/datum/reagents/R, var/pillname, var/pillvol, var/pillcount)
var/volume = pillcount * pillvol
reagents_internal = new/datum/reagents(volume)
reagents_internal.my_atom = src
R.trans_to_direct(reagents_internal,volume)
src.name = "[pillname] pill bottle"
src.desc = "Contains [pillcount] [pillname] pills."
src.pname = pillname
src.pvol = pillvol
src.pcount = pillcount
// spawn a pill, returns a pill or null if there aren't any left in the bottle
proc/create_pill()
var/totalpills = src.pcount + src.contents.len
if(totalpills <= 0)
return null
var/obj/item/reagent_containers/pill/P = null
// give back stored pills first
if (src.contents.len)
P = src.contents[src.contents.len]
// otherwise create a new one from the reagent holder
else if (pcount)
if (src.reagents_internal.total_volume < src.pvol)
src.pcount = 0
else
P = unpool(/obj/item/reagent_containers/pill)
P.loc = src
P.name = "[pname] pill"
src.reagents_internal.trans_to(P,src.pvol)
src.pcount--
// else return null
return P
proc/rebuild_desc()
var/totalpills = src.pcount + src.contents.len
if(totalpills > 15)
src.desc = "A [src.pname] pill bottle. There are too many to count."
else if (totalpills <= 0)
src.desc = "A [src.pname] pill bottle. It looks empty."
else
src.desc = "A [src.pname] pill bottle. There [totalpills==1? "is [totalpills] pill." : "are [totalpills] pills." ]"
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/reagent_containers/pill/))
user.u_equip(W)
W.set_loc(src)
W.dropped()
boutput(user, "<span style=\"color:blue\">You put [W] in [src].</span>")
rebuild_desc()
else ..()
attack_self(var/mob/user as mob)
var/obj/item/reagent_containers/pill/P = src.create_pill()
if (istype(P))
do
P.set_loc(user.loc)
P = src.create_pill()
while(istype(P))
boutput(user, "<span style=\"color:blue\">You tip out all the pills from [src] into [user.loc].</span>")
rebuild_desc()
else
boutput(user, "<span style=\"color:red\">It's empty.</span>")
return
attack_hand(mob/user as mob)
if(user.r_hand == src || user.l_hand == src)
var/obj/item/reagent_containers/pill/P = src.create_pill()
if(istype(P))
user.put_in_hand_or_drop(P)
boutput(user, "You take [P] from [src].")
rebuild_desc()
else
boutput(user, "<span style=\"color:red\">It's empty.</span>")
return
else
return ..()
+816
View File
@@ -0,0 +1,816 @@
/* ==================================================== */
/* -------------------- Cigarettes -------------------- */
/* ==================================================== */
/obj/item/clothing/mask/cigarette
name = "cigarette"
icon_state = "cigoff"
item_state = "cigoff"
force = 0
damtype = "brute"
throw_speed = 0.5
w_class = 1
armor_value_melee = 0
cold_resistance = 0
heat_resistance = 0
var/lit = 0
var/lastHolder = null
var/exploding = 0 //Does it blow up when it goes out?
var/flavor = null
var/nic_free = 0
rand_pos = 1
New()
..()
var/datum/reagents/R = new/datum/reagents(60)
reagents = R
R.my_atom = src
if (src.exploding)
if (src.flavor)
R.add_reagent(src.flavor, 5)
R.add_reagent("nicotine", 5)
return
else if (!src.nic_free)
R.add_reagent("nicotine", 40)
if (src.flavor)
R.add_reagent(src.flavor, 20)
return
else if (src.flavor)
R.add_reagent(src.flavor, 40)
return
afterattack(atom/target, mob/user, flag) // copied from the propuffs
if (istype(target, /obj/item/reagent_containers/))
user.visible_message("<span style=\"color:blue\"><b>[user]</b> crushes up the [src] in the [target].</span>",\
"<span style=\"color:blue\">You crush up the [src] in the [target].</span>")
src.reagents.trans_to(target, 5)
qdel (src)
else if (istype(target, /obj/item/match) && src.lit)
target:light(user, "<span style=\"color:red\"><b>[user]</b> lights [target] with [src].</span>")
else if (src.lit == 0 && istype(target, /obj/item) && target:burning)
src.light(user, "<span style=\"color:red\"><b>[user]</b> lights the [src] with [target]. Goddamn.</span>")
return
else
return ..()
proc/light(var/mob/user as mob, var/message as text)
if (src.lit == 0)
src.lit = 1
src.damtype = "fire"
src.force = 3
src.icon_state = "cigon"
src.item_state = "cigon"
if (user && message)
user.visible_message(message) //user check to fix a shitton of runtime errors with the temp expose ignition method. welp. -cogwerks
//spawn() //start fires while it's lit
//src.process()
if (!(src in processing_items))
processing_items.Add(src) // we have a nice scheduler let's use that instead tia
proc/put_out(var/mob/user as mob, var/message as text)
if (src.lit == 1)
src.lit = -1
src.damtype = "brute"
src.force = 0
src.icon_state = "cigbutt"
src.item_state = "cigoff"
src.name = "cigarette butt"
src.desc = "A cigarette butt."
if (user && message)
user.visible_message(message)
if (src in processing_items)
processing_items.Remove(src)
temperature_expose(datum/gas_mixture/air, temperature, volume)
if (src.lit == 0)
if (temperature > T0C+200)
src.visible_message("<span style=\"color:red\">The [src] ignites!</span>")
src.light()
ex_act(severity)
if (src.lit == 0)
src.visible_message("<span style=\"color:red\">The [src] ignites!</span>")
src.light()
attackby(obj/item/W as obj, mob/user as mob)
if (src.lit == 0)
if (istype(W, /obj/item/weldingtool) && W:welding)
src.light(user, "<span style=\"color:red\"><b>[user]</b> casually lights the [src] with [W], what a badass.</span>")
return
else if (istype(W, /obj/item/clothing/head/cakehat) && W:on)
src.light(user, "<span style=\"color:red\">Did [user] just light \his [src] with the [W]? Holy Shit.</span>")
return
else if (istype(W, /obj/item/device/igniter))
src.light(user, "<span style=\"color:red\"><b>[user]</b> fumbles around with the [W]; a small flame erupts from the [src].</span>")
return
else if (istype(W, /obj/item/zippo) && W:lit)
src.light(user, "<span style=\"color:red\">With a single flick of their wrist, [user] smoothly lights [src] with [W]. Damn they're cool.</span>")
return
else if ((istype(W, /obj/item/match) || istype(W, /obj/item/device/candle)) && W:lit)
src.light(user, "<span style=\"color:red\"><b>[user]</b> lights [src] with [W].</span>")
return
else if (W.burning)
src.light(user, "<span style=\"color:red\"><b>[user]</b> lights the [src] with [W]. Goddamn.</span>")
return
else
return ..()
else
return ..() // CALL your GODDAMN PARENTS
attack(atom/target, mob/user as mob)
if (isliving(target))
var/mob/living/M = target
if (ishuman(M))
var/mob/living/carbon/human/H = M
if (H.bleeding || (H.butt_op_stage == 4 && user.zone_sel.selecting == "chest"))
if (!src.cautery_surgery(H, user, 5, src.lit))
return ..()
if (M.burning && src.lit == 0)
if (M == user)
src.light(user, "<span style=\"color:red\"><b>[user]</b> lights \his cigarette with \his OWN flaming body. That's dedication! Or crippling addiction.</span>")
else
src.light(user, "<span style=\"color:red\"><b>[user]</b> lights \his cigarette with [M]'s flaming body. That's cold, man. That's real cold.</span>")
else
..(target, user)
if (src.lit == 1)
src.put_out(user, "<span style=\"color:red\"><b>[user]</b> puts the [src] out on [target].</span>")
if (ishuman(target))
var/mob/living/carbon/human/chump = target
if (!chump.stat)
chump.emote("scream")
process()
var/atom/lastHolder = null
//while (src.lit == 1)
if (src.lit == 1)
var/turf/location = src.loc
var/atom/holder = loc
var/isHeld = 0
var/mob/M = null
if (!src.exploding && prob(20)) // cigs shouldn't go out instantly dang
if (ismob(location))
M = location
if(istype(M, /mob/living/carbon/human)) //HOLY DUPLICATE CODE BATMAN!!!
var/mob/living/carbon/human/H = M
if(H.traitHolder && H.traitHolder.hasTrait("smoker"))
src.reagents.remove_any(1)
else
src.reagents.trans_to(M, 1)
src.reagents.reaction(M, INGEST)
else
src.reagents.trans_to(M, 1)
src.reagents.reaction(M, INGEST)
else src.reagents.remove_any(1)
else if (src.exploding)
if (ismob(location))
M = location
if(istype(M, /mob/living/carbon/human)) //HOLY DUPLICATE CODE BATMAN!!!
var/mob/living/carbon/human/H = M
if(H.traitHolder && H.traitHolder.hasTrait("smoker"))
src.reagents.remove_any(1)
else
src.reagents.trans_to(M, 1)
else
src.reagents.trans_to(M, 1)
else if (src && src.reagents) //Wire: fix for Cannot execute null.remove any().
src.reagents.remove_any(1)
if (src.reagents.total_volume <= 0)
if (src.exploding)
src.lit = 0 //Let's not keep looping while we're busy blowing up, ok?
spawn((20)+(rand(1,10)))
var/turf/tlocation = get_turf(src.loc)
if (tlocation)
explosion(src, tlocation, 0, 1, 1, 2)
else
var/datum/effects/system/spark_spread/s = unpool(/datum/effects/system/spark_spread)
s.set_up(5, 1, src)
s.start()
playsound(src.loc, "sound/effects/Explosion1.ogg", 75, 1)
src.visible_message("<span style=\"color:red\">The [src] explodes!</span>")
// Added (Convair880).
if (ismob(src.loc))
logTheThing("bombing", null, src.loc, "A trick cigarette (held/equipped by %target%) explodes at [log_loc(src)].")
else
logTheThing("bombing", src.fingerprintslast, null, "A trick cigarette explodes at [log_loc(src)]. Last touched by [src.fingerprintslast ? "[src.fingerprintslast]" : "*null*"].")
qdel(src)
return
else
src.put_out(M, "<span style=\"color:red\"><b>[M]</b>'s [src] goes out.</span>")
return
//if (istype(location, /turf)) //start a fire if possible
// location.hotspot_expose(700, 5) // this doesn't seem to ever actually happen, gonna try a different setup - cogwerks
var/turf/T = get_turf(src.loc)
if (T)
T.hotspot_expose(650,5)
if (ismob(holder))
isHeld = 1
else
isHeld = 0
if (lastHolder != null)
lastHolder = null
if (isHeld == 1)
lastHolder = holder
//sleep(10)
if (lastHolder != null)
lastHolder = null
dropped(mob/user as mob)
if(!istype(src.loc, /turf)) return
if (src.lit == 1 && !src.exploding && src.reagents.total_volume <= 20)
src.put_out(user, "<span style=\"color:red\"><b>[user]</b> calmly drops and treads on the lit [src], putting it out instantly.</span>")
return ..()
else
user.visible_message("<span style=\"color:red\"><b>[user]</b> drops the [src]. Guess they've had enough for the day.</span>")
return ..()
/obj/item/clothing/mask/cigarette/nicofree
name = "nicotine-free cigarette"
desc = "Smoking without the crippling addiction and lung cancer! Warning: side effects may include loss of breath and inability to relax."
nic_free = 1
flavor = "capsaicin"
/obj/item/clothing/mask/cigarette/random
desc = "A cigarette which seems to have been laced with something."
New()
if (all_functional_reagent_ids.len > 0)
src.flavor = pick(all_functional_reagent_ids)
else
src.flavor = "nicotine"
src.name = "[reagent_id_to_name(src.flavor)]-laced cigarette"
..()
/obj/item/clothing/mask/cigarette/propuffs
desc = "Pro Puffs - a new taste thrill in every cigarette."
New()
src.flavor = pick("silicate","antihol","mutadone","rum","mutagen","toxin","water_holy","fuel","salbutamol","haloperidol",
"cryoxadone","cryostylane","omnizine","jenkem","vomit","carpet","charcoal","blood","cheese","bilk","atropine",
"lexorin","teporone","mannitol","spaceacillin","saltpetre","anti_rad","insulin","gvomit","milk","colors","diluted_fliptonium",
"something","honey_tea","tea","coffee","chocolate","guacamole","juice_pickle","vanilla","enriched_msg","egg","aranesp",
"paper","bread","green_goop","black_goop")
src.name = "[reagent_id_to_name(src.flavor)]-laced cigarette"
..()
/obj/item/clothing/mask/cigarette/syndicate
//desc = "It looks a little funny." //fucka you
exploding = 1
// this was in the middle of plants_food_etc.dm
// WHY
/obj/item/clothing/mask/cigarette/custom
desc = "There could be anything in this."
flags = FPRINT|TABLEPASS|OPENCONTAINER
New()
..()
var/datum/reagents/R = new/datum/reagents(600)
reagents = R
R.my_atom = src
is_open_container()
return 1
/* ================================================= */
/* -------------------- Packets -------------------- */
/* ================================================= */
/obj/item/cigpacket
name = "cigarette packet"
desc = "The most popular brand of Space Cigarettes, sponsors of the Space Olympics."
icon = 'icons/obj/cigarettes.dmi'
icon_state = "cigpacket"
item_state = "cigpacket"
w_class = 1
throwforce = 2
var/cigcount = 6
var/cigtype = /obj/item/clothing/mask/cigarette
var/package_style = "cigpacket"
flags = ONBELT | TABLEPASS | FPRINT
stamina_damage = 3
stamina_cost = 3
rand_pos = 1
/obj/item/cigpacket/nicofree
name = "nicotine-free cigarette packet"
desc = "All the perks of smoking without the addiction! Warning: Cigarettes use chemical compounds which may cause severe throat irritation."
cigtype = /obj/item/clothing/mask/cigarette/nicofree
icon_state = "cigpacket-b"
package_style = "cigpacket-b"
/obj/item/cigpacket/propuffs
name = "packet of Pro Puffs"
desc = "A flavor surprise in each cigarette, lovingly wrapped in the finest papers."
cigtype = /obj/item/clothing/mask/cigarette/propuffs
icon_state = "cigpacket-r"
package_style = "cigpacket-r"
/obj/item/cigpacket/random
name = "odd cigarette packet"
desc = "These don't seem to have a brand name on them."
cigtype = /obj/item/clothing/mask/cigarette/random
icon_state = "cigpacket-p"
package_style = "cigpacket-p"
/obj/item/cigpacket/syndicate // cogwerks: made them more sneaky, removed the glaringly obvious name
// haine: these can just inherit the parent name and description vOv
cigtype = /obj/item/clothing/mask/cigarette/syndicate
/obj/item/cigpacket/proc/update_icon()
src.overlays = null
if (src.cigcount <= 0)
src.icon_state = "[src.package_style]0"
src.desc = "There aren't any cigs left, shit!"
else
src.icon_state = "[src.package_style]o"
src.overlays += "cig[src.cigcount]"
return
/* /obj/item/cigpacket/proc/update_icon() used to just be a return, with this directly below it. ?????
/obj/item/cigpacket/update_icon()
src.icon_state = "cigpacket[src.cigcount]"
src.desc = "There are [src.cigcount] cigs\s left!"
return
*/
/obj/item/cigpacket/attack_hand(mob/user as mob)
if (user.find_in_hand(src))//r_hand == src || user.l_hand == src)
if (src.cigcount == 0)
user.show_text("You're out of cigs, shit! How you gonna get through the rest of the day?", "red")
return
else
var/obj/item/clothing/mask/cigarette/W = new src.cigtype(user)
user.put_in_hand_or_drop(W)
if (src.cigcount != -1)
src.cigcount--
src.update_icon()
else
return ..()
return
/obj/item/cigbutt
name = "cigarette butt"
desc = "A manky old cigarette butt."
icon = 'icons/obj/cigarettes.dmi'
icon_state = "cigbutt"
w_class = 1
throwforce = 1
stamina_damage = 3
stamina_cost = 3
rand_pos = 1
/* ================================================== */
/* -------------------- Lighters -------------------- */
/* ================================================== */
/obj/item/matchbook
name = "matchbook"
desc = "A little bit of heavy paper with some matches in it, and a little strip to light them on."
icon = 'icons/obj/cigarettes.dmi'
icon_state = "matchbook"
w_class = 1
throwforce = 1
flags = FPRINT | TABLEPASS | SUPPRESSATTACK
stamina_damage = 1
stamina_cost = 1
stamina_crit_chance = 1
burn_point = 220
burn_output = 900
burn_possible = 1
health = 20
var/match_amt = 6 // -1 for infinite
rand_pos = 1
get_desc(dist)
if (src.match_amt == -1)
. += "There's a whole lot of matches left."
else if (src.match_amt >= 1)
. += "There's [src.match_amt] match[s_es(src.match_amt, 1)] left."
else
. += "It's empty."
attack_hand(mob/user as mob)
if (user.find_in_hand(src))
if (src.match_amt == 0)
user.show_text("Looks like there's no matches left.", "red")
return
else
var/obj/item/match/W = new /obj/item/match(user)
user.put_in_hand_or_drop(W)
if (src.match_amt != -1)
src.match_amt --
src.update_icon()
else
return ..()
return
afterattack(atom/target, mob/user as mob)
if (istype(target, /obj/item/match))
if (target:lit > 0)
return
if (target:lit == -1)
user.show_text("You [pick("fumble", "fuss", "mess", "faff")] around with [target] and try to get it to light, but it's no use.", "red")
return
else if (prob(25))
user.visible_message("<b>[user]</b> awkwardly strikes [src] on [target]. [target] breaks!",\
"You awkwardly strike [src] on [target]. [target] breaks![prob(50) ? " [pick("Damn!", "Fuck!", "Shit!", "Crap!")]" : null]")
playsound(user.loc, 'sound/items/matchstick_hit.ogg', 50, 1)
target:put_out(user, 1)
return
else if (prob(10))
user.visible_message("<b>[user]</b> awkwardly strikes [src] on [target]. A small flame sparks into life from the tip.",\
"You awkwardly strike [src] on [target]. A small flame sparks into life from the tip.")
target:light(user)
return
else
user.visible_message("<b>[user]</b> awkwardly strikes [src] on [target]. Nothing happens.",\
"You awkwardly strike [src] on [target]. Nothing happens.")
playsound(user.loc, 'sound/items/matchstick_hit.ogg', 50, 1)
return
else
return ..()
attack()
return
proc/update_icon()
if (src.match_amt == -1)
src.icon_state = "matchbook6"
return
else
src.icon_state = "matchbook[src.match_amt]"
/obj/item/match
name = "match"
desc = "A little stick of wood with phosphorus on the tip, for lighting fires, or making you very frustrated and not lighting fires. Either or."
icon = 'icons/obj/cigarettes.dmi'
icon_state = "match"
w_class = 1
throwforce = 1
flags = FPRINT | TABLEPASS | SUPPRESSATTACK
stamina_damage = 1
stamina_cost = 1
stamina_crit_chance = 1
burn_point = 220
burn_output = 600
burn_possible = 1
health = 10
var/lit = 0 // -1 is burnt out/broken or otherwise unable to be lit
var/light_mob = 0
var/life_timer = 0
rand_pos = 1
var/datum/light/light
New()
..()
light = new /datum/light/point
light.set_brightness(0.4)
light.set_color(0.94, 0.69, 0.27)
light.attach(src)
src.life_timer = rand(15,25)
pickup(mob/user)
..()
light.attach(user)
dropped(mob/user)
..()
if (isturf(src.loc))
src.put_out(user)
user.visible_message("<span style=\"color:red\"><b>[user]</b> calmly drops and treads on the lit [src], putting it out instantly.</span>")
return
spawn(0)
if (src.loc != user)
light.attach(src)
process()
if (src.lit > 0)
if (src.life_timer >= 0)
life_timer--
var/location = src.loc
if (ismob(location))
var/mob/M = location
if (src.life_timer <= 0)
src.put_out(M)
if (M.find_in_hand(src))
M.show_text("[src] burns your hand as the flame reaches the end of [src]!", "red")
M.TakeDamage("All", 0, rand(1,5))
return
var/turf/T = get_turf(src.loc)
if (T)
T.hotspot_expose(600,5)
if (src.life_timer <= 0)
src.put_out()
return
//sleep(10)
proc/light(var/mob/user as mob)
src.lit = 1
src.icon_state = "match-lit"
playsound(user.loc, 'sound/items/matchstick_light.ogg', 50, 1)
light.enable()
if (!(src in processing_items))
processing_items.Add(src)
return
proc/put_out(var/mob/user as mob, var/break_it = 0)
src.lit = -1
src.life_timer = 0
if (break_it)
src.icon_state = "match-broken"
src.name = "broken match"
if (user)
playsound(user.loc, 'sound/items/crunch.ogg', 60, 1, 0, 2)
else
src.icon_state = "match-burnt"
src.name = "burnt-out match"
light.disable()
if (src in processing_items)
processing_items.Remove(src)
return
temperature_expose(datum/gas_mixture/air, temperature, volume)
if (src.lit == 0)
if (temperature > T0C+200)
src.visible_message("<span style=\"color:red\">The [src] ignites!</span>")
src.light()
ex_act(severity)
if (src.lit == 0)
src.visible_message("<span style=\"color:red\">The [src] ignites!</span>")
src.light()
afterattack(atom/target, mob/user as mob)
if (src.lit > 0)
if (!ismob(target) && target.reagents)
user.show_text("You heat [target].", "blue")
target.reagents.temperature_reagents(1000,10)
return
else if (src.lit == -1)
user.show_text("You [pick("fumble", "fuss", "mess", "faff")] around with [src] and try to get it to light, but it's no use.", "red")
return
else if (src.lit == 0)
if (istype(target, /obj/item/match) && target:lit > 0)
user.visible_message("<b>[user]</b> lights [src] with the flame from [target].",\
"You light [src] with the flame from [target].")
src.light(user)
return
else if (istype(target, /obj/item/clothing/mask/cigarette) && target:lit > 0)
user.visible_message("<b>[user]</b> lights [src] with [target].",\
"You light [src] with [target].")
src.light(user)
return
else if (istype(target, /obj/item/matchbook))
if (prob(10))
user.visible_message("<b>[user]</b> strikes [src] on [target]. [src] breaks!",\
"You strike [src] on [target]. [src] breaks![prob(50) ? " [pick("Damn!", "Fuck!", "Shit!", "Crap!")]" : null]")
playsound(user.loc, 'sound/items/matchstick_hit.ogg', 50, 1)
src.put_out(user, 1)
return
else if (prob(50))
user.visible_message("<b>[user]</b> strikes [src] on [target]. A small flame sparks into life from the tip.",\
"You strike [src] on [target]. A small flame sparks into life from the tip.")
src.light(user)
return
else
user.visible_message("<b>[user]</b> strikes [src] on [target]. Nothing happens.",\
"You strike [src] on [target]. Nothing happens.")
playsound(user.loc, 'sound/items/matchstick_hit.ogg', 50, 1)
return
else if (istype (target, /obj/item) && target:burning)
user.visible_message("<b>[user]</b> lights [src] with the flame from [target].",\
"You light [src] with the flame from [target].")
src.light(user)
return
else
if (prob(10))
user.visible_message("<b>[user]</b> strikes [src] on [target]. A small flame sparks into life from the tip.[prob(50) ? " [pick("Damn", "Fuck", "Shit", "Wow")][pick("!", " that was cool!", " that was smooth!")]" : null]",\
"You strike [src] on [target]. A small flame sparks into life from the tip.")
src.light(user)
return
else if (prob(25))
user.visible_message("<b>[user]</b> strikes [src] on [target]. [src] breaks!",\
"You strike [src] on [target]. [src] breaks![prob(50) ? " [pick("Damn!", "Fuck!", "Shit!", "Crap!")]" : null]")
playsound(user.loc, 'sound/items/matchstick_hit.ogg', 50, 1)
src.put_out(user, 1)
return
else
user.visible_message("<b>[user]</b> strikes [src] on [target]. Nothing happens.",\
"You strike [src] on [target]. Nothing happens.[prob(50) ? " You feel awkward, though." : null]")
playsound(user.loc, 'sound/items/matchstick_hit.ogg', 50, 1)
return
attack(mob/M as mob, mob/user as mob)
if (ishuman(M))
if (src.lit > 0)
var/mob/living/carbon/human/fella = M
if (fella.wear_mask && istype(fella.wear_mask, /obj/item/clothing/mask/cigarette))
var/obj/item/clothing/mask/cigarette/smoke = fella.wear_mask // aaaaaaa
smoke.light(user, "<span style=\"color:red\"><b>[user]</b> lights [fella]'s [smoke] with [src].</span>")
fella.set_clothing_icon_dirty()
return
else if (fella.bleeding || (fella.butt_op_stage == 4 && user.zone_sel.selecting == "chest"))
src.cautery_surgery(fella, user, 5, src.lit)
return ..()
else
user.visible_message("<span style=\"color:red\"><b>[user]</b> puts out [src] on [fella]!</span>",\
"<span style=\"color:red\">You put out [src] on [fella]!</span>")
fella.TakeDamage("All", 0, rand(1,5))
if (!fella.stat)
fella.emote("scream")
src.put_out(user)
return
else
return ..()
attack_self(mob/user)
if (user.find_in_hand(src))
if (src.lit > 0)
user.visible_message("<b>[user]</b> [pick("licks [his_or_her(user)] finger and snuffs out [src].", "waves [src] around until it goes out.")]")
src.put_out(user)
else
return ..()
return
/obj/item/zippo
name = "zippo lighter"
desc = "A pretty nice lighter."
icon = 'icons/obj/cigarettes.dmi'
icon_state = "zippo"
item_state = "zippo"
w_class = 1
throwforce = 4
flags = FPRINT | ONBELT | TABLEPASS | CONDUCT
stamina_damage = 5
stamina_cost = 5
stamina_crit_chance = 5
var/lit = 0
var/fuel = 30 // -1 means infinite fuel
var/icon_closed = "zippo"
var/icon_open = "zippoon"
var/datum/light/light
New()
..()
light = new /datum/light/point
light.set_brightness(0.4)
light.set_color(0.94, 0.69, 0.27)
light.attach(src)
pickup(mob/user)
..()
light.attach(user)
dropped(mob/user)
..()
spawn(0)
if (src.loc != user)
light.attach(src)
borg
fuel = -1
attack_self(mob/user)
if (user.find_in_hand(src))
if (!src.lit)
if (fuel == 0)
user.show_text("Out of fuel.", "red")
return
src.lit = 1
src.icon_state = src.icon_open
src.item_state = "zippoon"
user.visible_message("<span style=\"color:red\">Without even breaking stride, [user] flips open and lights the [src] in one smooth movement.</span>")
light.enable()
if (!(src in processing_items))
processing_items.Add(src)
else
src.lit = 0
src.icon_state = src.icon_closed
src.item_state = "zippo"
user.visible_message("<span style=\"color:red\">You hear a quiet click, as [user] shuts off the [src] without even looking what they're doing. Wow.</span>")
light.disable()
if (src in processing_items)
processing_items.Remove(src)
else
return ..()
return
afterattack(atom/target, mob/user as mob)
if (!lit && istype(target, /obj/reagent_dispensers/fueltank))
if (src.fuel == -1)
user.show_text("You can't seem to find any way to add more fuel to [src]. It's probably fine.", "blue")
return
var/obj/reagent_dispensers/fueltank/O = target
var/fuelamt = O.reagents.get_reagent_amount("fuel")
if (fuelamt)
var/removed = min(fuelamt, 50)
O.reagents.remove_reagent("fuel", removed)
fuel += removed
user.show_text("[src] refueled.", "blue")
playsound(user.loc, "sound/effects/zzzt.ogg", 50, 1, -6)
else
user.show_text("[O] is empty.", "red")
if (!ismob(target) && target.reagents)
user.show_text("You heat [target].", "blue")
target.reagents.temperature_reagents(1500,10)
if (ishuman(target))
var/mob/living/carbon/human/fella = target
if (user.zone_sel.selecting == "l_arm")
if (fella.limbs.l_arm_bleed > 1)
fella.TakeDamage("chest",0,10)
fella.limbs.l_arm_bleed = max(0,fella.limbs.l_arm_bleed-5)
if (fella.limbs.l_arm_bleed == 0)
user.visible_message("<span style=\"color:red\">[user] completely cauterises [fella]'s left stump with [src]!</span>")
else
user.visible_message("<span style=\"color:red\">[user] partially cauterises [fella]'s left stump with [src]!</span>")
return
if (user.zone_sel.selecting == "r_arm")
if (fella.limbs.r_arm_bleed > 1)
fella.TakeDamage("chest",0,10)
fella.limbs.r_arm_bleed = max(0,fella.limbs.r_arm_bleed-5)
if (fella.limbs.r_arm_bleed == 0)
user.visible_message("<span style=\"color:red\">[user] completely cauterises [fella]'s right stump with [src]!</span>")
else
user.visible_message("<span style=\"color:red\">[user] partially cauterises [fella]'s right stump with [src]!</span>")
return
if (fella.wear_mask && istype(fella.wear_mask, /obj/item/clothing/mask/cigarette))
var/obj/item/clothing/mask/cigarette/smoke = fella.wear_mask // aaaaaaa
smoke.light(user, "<span style=\"color:red\"><b>[user]</b> lights [fella]'s [smoke] with [src].</span>")
fella.set_clothing_icon_dirty()
return
if (fella.bleeding || (fella.butt_op_stage == 4 && user.zone_sel.selecting == "chest"))
if (!src.cautery_surgery(target, user, 10, src.lit))
return ..()
user.visible_message("<span style=\"color:red\"><b>[user]</b> waves [src] around in front of [fella]'s face! OoOo, are ya scared?![src.lit ? "" : " Too bad [src] is closed."]</span>")
return
else if (ismob(target))
user.visible_message("<span style=\"color:red\"><b>[user]</b> waves [src] around in front of [target]'s face! OoOo, are ya scared?![src.lit ? "" : " Too bad [src] is closed."]</span>")
return
else
return ..()
process()
if (src.lit)
if (src.fuel >= 0)
fuel--
var/turf/location = src.loc
if (ismob(location))
var/mob/M = location
if (M.find_in_hand(src))
location = M.loc
var/turf/T = get_turf(src.loc)
if (T)
T.hotspot_expose(700,5)
if (fuel == 0)
src.lit = 0
src.icon_state = src.icon_closed
src.item_state = "zippo"
light.disable()
if (src in processing_items)
processing_items.Remove(src)
return
//sleep(10)
suicide(var/mob/user as mob)
if(!src.lit) return 0
user.visible_message("<span style=\"color:red\"><b>[user] swallows the lit [src.name]!</b></span>")
user.take_oxygen_deprivation(75)
user.TakeDamage("chest", 0, 100)
user.emote("scream")
user.updatehealth()
spawn(100)
if (user)
user.suiciding = 0
qdel(src)
return 1
/obj/item/zippo/gold
name = "golden zippo lighter"
icon_state = "gold_zippo"
icon_closed = "gold_zippo"
icon_open = "gold_zippoon"
+70
View File
@@ -0,0 +1,70 @@
/obj/item/clothing
name = "clothing"
//var/obj/item/clothing/master = null
w_class = 2.0
var/see_face = 1
var/body_parts_covered = 0 //see setup.dm for appropriate bit flags
var/c_flags = null // these don't need to be in the general flags when they only apply to clothes :I
var/protective_temperature = 0
var/heat_transfer_coefficient = 1 //0 prevents all transfers, 1 is invisible
var/permeability_coefficient = 1 // for chemicals/diseases
var/siemens_coefficient = 1 // for electrical admittance/conductance (electrocution checks and shit)
var/magical = 0 // for wizard item spell power check
var/radproof = 0 // can this item completely shield you from radiation?
var/disease_resistance = 0 // how much does this protect you from diseases? (of a 100% chance)
var/list/compatible_species = list("human") // allow monkeys/mutantraces to wear certain garments
var/armor_value_melee = 0
var/armor_value_bullet = 0
var/armor_value_explosion = 0
var/cold_resistance = 0
var/heat_resistance = 0
var/fallen_offset_x = 1
var/fallen_offset_z = -6
/// we want to use Z rather than Y incase anything gets rotated, it would look all jank
var/monkey_clothes = 0
// it's clothes specifically for monkeys please don't plaster it to their chest with an offset
stamina_damage = 1
stamina_cost = 1
stamina_crit_chance = 0
flags = FPRINT | TABLEPASS
onMaterialChanged()
..()
if(istype(src.material))
protective_temperature = material.hasProperty(PROP_MELTING) ? material.getProperty(PROP_MELTING) : protective_temperature
protective_temperature -= material.getProperty(PROP_FLAMMABILITY) * 10
heat_transfer_coefficient = material.hasProperty(PROP_THERMAL) ? material.getProperty(PROP_THERMAL) / 100 : heat_transfer_coefficient
permeability_coefficient = material.hasProperty(PROP_PERMEABILITY) ? material.getProperty(PROP_PERMEABILITY) / 100 : permeability_coefficient
siemens_coefficient = material.hasProperty(PROP_ELECTRICAL) ? material.getProperty(PROP_ELECTRICAL) / 100 : siemens_coefficient
disease_resistance = material.hasProperty(PROP_PERMEABILITY) ? (100 - material.getProperty(PROP_PERMEABILITY)) / 2 : 0
disease_resistance += material.getProperty(PROP_RADIOACTIVITY)
armor_value_melee = material.hasProperty(PROP_COMPRESSIVE) ? max((material.getProperty(PROP_COMPRESSIVE) - 50) / 3, 0) : armor_value_melee
armor_value_bullet = material.hasProperty(PROP_SHEAR) ? max((material.getProperty(PROP_SHEAR) - 50) / 25) + 1 : armor_value_bullet
armor_value_explosion = max(round((material.getProperty(PROP_COMPRESSIVE) + material.getProperty(PROP_TENSILE) - 50) / 20), 0)
return
/*
/obj/item/clothing/fire_burn(obj/fire/raging_fire, datum/air_group/environment)
if(raging_fire.internal_temperature > src.s_fire)
spawn( 0 )
var/t = src.icon_state
src.icon_state = ""
src.icon = 'b_items.dmi'
flick(text("[]", t), src)
spawn(14)
qdel(src)
return
return
return 0
return 1
*/ //TODO FIX
+334
View File
@@ -0,0 +1,334 @@
// ARMOR
/obj/item/clothing/suit/armor
name = "armor"
desc = "A suit worn primarily for protection against injury."
icon = 'icons/obj/clothing/overcoats/item_suit_armor.dmi'
wear_image_icon = 'icons/mob/overcoats/worn_suit_armor.dmi'
inhand_image_icon = 'icons/mob/inhand/overcoat/hand_suit_armor.dmi'
icon_state = "armor"
item_state = "armor"
body_parts_covered = TORSO|LEGS|ARMS
armor_value_bullet = 2
armor_value_melee = 6
/obj/item/clothing/suit/armor/vest
name = "armor vest"
desc = "An armored vest that protects against some damage."
icon_state = "armorvest"
item_state = "armorvest"
body_parts_covered = TORSO
c_flags = ONESIZEFITSALL
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/assembly/anal_ignite))
var/obj/item/assembly/anal_ignite/AI = W
if (!AI.status)
user.show_text("Secure the assembly first.", "red")
return
var/obj/item/clothing/suit/armor/suicide_bomb/R = new /obj/item/clothing/suit/armor/suicide_bomb(get_turf(user))
user.u_equip(src)
src.set_loc(R)
R.part_vest = src
user.u_equip(AI)
AI.set_loc(R)
R.part_igniter = AI
AI.master = R
src.add_fingerprint(user)
AI.add_fingerprint(user)
R.add_fingerprint(user)
user.put_in_hand_or_drop(R)
return
else
..()
return
// Added support for old-style grenades and pipe bombs. Also a bit of code streamlining (Convair880).
/obj/item/clothing/suit/armor/suicide_bomb
name = "suicide bomb vest"
desc = "A makeshift mechanical vest set to trigger a payload when the user dies."
icon_state = "bombvest0"
item_state = "armorvest"
flags = FPRINT | TABLEPASS | CONDUCT | NOSPLASH
c_flags = ONESIZEFITSALL
body_parts_covered = TORSO
var/obj/item/clothing/suit/armor/vest/part_vest = null
var/obj/item/assembly/anal_ignite/part_igniter = null // Just for show. Doesn't do anything here or in the igniter code.
var/obj/item/chem_grenade/grenade = null
var/obj/item/old_grenade/grenade_old = null
var/obj/item/pipebomb/bomb/pipebomb = null
var/obj/item/reagent_containers/glass/beaker/beaker = null
var/payload = ""
New()
..()
spawn (5)
if (src && !src.part_vest)
src.part_vest = new /obj/item/clothing/suit/armor/vest(src)
if (src && !src.part_igniter)
src.part_igniter = new /obj/item/assembly/anal_ignite(src)
return
examine()
set src in oview(2)
..()
if (src.payload)
boutput(usr, "<span style=\"color:red\">Looks like the payload is a [src.payload].</span>")
else
boutput(usr, "<span style=\"color:red\">There doesn't appear to be a payload attached.</span>")
return
attackby(obj/item/W as obj, mob/user as mob)
src.add_fingerprint(user)
if (istype(W, /obj/item/chem_grenade/))
if (!src.grenade && !src.grenade_old && !src.pipebomb && !src.beaker)
var/obj/item/chem_grenade/CG = W
if (CG.stage == 2 && !CG.state)
user.u_equip(CG)
CG.set_loc(src)
src.grenade = CG
src.payload = CG.name
src.icon_state = "bombvest1"
user.show_text("You attach [CG.name]'s detonator to [src].", "blue")
else
user.show_text("There's already a payload attached.", "red")
return
else if (istype(W, /obj/item/old_grenade/))
if (!src.grenade && !src.grenade_old && !src.pipebomb && !src.beaker)
var/obj/item/old_grenade/OG = W
if (OG.not_in_mousetraps == 0 && !OG.state) // Same principle, okay.
user.u_equip(OG)
OG.set_loc(src)
src.grenade_old = OG
src.payload = OG.name
src.icon_state = "bombvest1"
user.show_text("You attach [OG.name]'s detonator to [src].", "blue")
else
user.show_text("There's already a payload attached.", "red")
return
else if (istype(W, /obj/item/pipebomb/bomb/))
if (!src.grenade && !src.grenade_old && !src.pipebomb && !src.beaker)
var/obj/item/pipebomb/bomb/PB = W
if (!PB.armed)
user.u_equip(PB)
PB.set_loc(src)
src.pipebomb = PB
src.payload = PB.name
src.icon_state = "bombvest1"
user.show_text("You attach [PB.name]'s detonator to [src].", "blue")
else
user.show_text("There's already a payload attached.", "red")
return
else if (istype(W, /obj/item/reagent_containers/glass/beaker/))
if (!src.grenade && !src.grenade_old && !src.pipebomb && !src.beaker)
if (!W.reagents.total_volume)
user.show_text("[W] is empty.", "red")
return
user.u_equip(W)
W.set_loc(src)
src.beaker = W
src.payload = "beaker" // Keep this "beaker" so the log_reagents() call can fire correctly.
src.icon_state = "bombvest1"
user.show_text("You attach [W.name] to [src]'s igniter assembly.", "blue")
else
user.show_text("There's already a payload attached.", "red")
return
else if (istype(W, /obj/item/wrench))
if (src.grenade)
user.show_text("You detach [src.grenade].", "blue")
src.grenade.set_loc(get_turf(src))
src.grenade = null
src.payload = ""
src.icon_state = "bombvest0"
else if (src.grenade_old)
user.show_text("You detach [src.grenade_old].", "blue")
src.grenade_old.set_loc(get_turf(src))
src.grenade_old = null
src.payload = ""
src.icon_state = "bombvest0"
else if (src.pipebomb)
user.show_text("You detach [src.pipebomb].", "blue")
src.pipebomb.set_loc(get_turf(src))
src.pipebomb = null
src.payload = ""
src.icon_state = "bombvest0"
else if (src.beaker)
user.show_text("You detach [src.beaker].", "blue")
src.beaker.set_loc(get_turf(src))
src.beaker = null
src.payload = ""
src.icon_state = "bombvest0"
else if (!src.grenade && !src.grenade_old && !src.pipebomb && !src.beaker)
var/turf/T = get_turf(user)
if (src.part_vest && T)
src.part_vest.set_loc(T)
src.part_vest = null
if (src.part_igniter && T)
src.part_igniter.set_loc(T)
src.part_igniter = null
src.payload = ""
user.show_text("You disassemble [src].", "blue")
if (src.loc == user)
user.u_equip(src)
qdel(src)
else
..()
return
proc/trigger(var/mob/wearer)
if (!src || !wearer || !ismob(wearer) || src.loc != wearer)
return
if (!src.grenade && !src.grenade_old && !src.pipebomb && !src.beaker)
return
if (wearer.stat != 2 || (wearer.suiciding && prob(60))) // Don't abuse suiciding.
wearer.visible_message("<span style=\"color:red\"><b>[wearer]'s suicide bomb vest clicks softly, but nothing happens.</b></span>")
return
if (!src.payload)
src.payload = "*unknown or null*"
wearer.visible_message("<span style=\"color:red\"><b>[wearer]'s suicide bomb vest clicks loudly!</b></span>")
message_admins("[key_name(wearer)]'s suicide bomb vest triggers (Payload: [src.payload]) at [log_loc(wearer)].")
logTheThing("bombing", wearer, null, "'s suicide bomb vest triggers (<b>Payload:</b> [src.payload])[src.payload == "beaker" ? " [log_reagents(src.beaker)]" : ""] at [log_loc(wearer)].")
if (src.grenade)
src.grenade.explode()
src.grenade = null
src.payload = ""
src.icon_state = "bombvest0"
else if (src.grenade_old)
src.grenade_old.prime()
src.grenade_old = null
src.payload = ""
src.icon_state = "bombvest0"
else if (src.pipebomb)
src.pipebomb.do_explode()
src.pipebomb = null
src.payload = ""
src.icon_state = "bombvest0"
else if (src.beaker)
var/turf/T = get_turf(wearer)
if (T)
T.hotspot_expose(1000,1000)
src.beaker.reagents.temperature_reagents(4000, 400) // Translates to 15 K each, same as other igniter assemblies.
src.beaker.reagents.temperature_reagents(4000, 400)
// Icon_state and payload don't change because the beaker isn't used up.
return
/obj/item/clothing/suit/armor/captain
name = "captain's armor"
desc = "A suit of protective formal armor made for the station's captain."
icon_state = "caparmor"
item_state = "caparmor"
armor_value_bullet = 2.5
armor_value_melee = 8
/obj/item/clothing/suit/armor/centcomm
name = "administrator's armor"
desc = "A suit of protective formal armor. It is made specifically for NanoTrasen commanders."
icon_state = "centcom"
item_state = "centcom"
armor_value_bullet = 2.5
armor_value_melee = 8
red
icon_state = "centcom-red"
item_state = "centcom-red"
/obj/item/clothing/suit/armor/heavy
name = "heavy armor"
desc = "A heavily armored suit that protects against moderate damage."
icon_state = "heavy"
item_state = "heavy"
armor_value_bullet = 2.5
armor_value_melee = 7
/obj/item/clothing/suit/armor/death_commando
name = "death commando armor"
desc = "Armor used by NanoTrasen's top secret purge unit. You're not sure how you know this."
icon_state = "death"
item_state = "death"
c_flags = SPACEWEAR
/obj/item/clothing/suit/armor/tdome
name = "thunderdome raiment"
desc = "A set of official Thunderdome armor. It bears no team insignia or colors."
icon_state = "td"
item_state = "td"
body_parts_covered = TORSO|LEGS
/obj/item/clothing/suit/armor/tdome/red
name = "red skulls raiment"
desc = "Official Thunderdome armor of the Red Skulls team."
icon_state = "tdred"
item_state = "tdred"
/obj/item/clothing/suit/armor/tdome/green
name = "green stars raiment"
desc = "Official Thunderdome armor of the Green Stars team."
icon_state = "tdgreen"
item_state = "tdgreen"
/obj/item/clothing/suit/armor/tdome/blue
name = "blue moons raiment"
desc = "Official Thunderdome armor of the Blue Moons team."
icon_state = "tdblue"
item_state = "tdblue"
/obj/item/clothing/suit/armor/tdome/yellow
name = "yellow thunder raiment"
desc = "Official Thunderdome armor of the Yellow Thunder team."
icon_state = "tdyellow"
item_state = "tdyellow"
/obj/item/clothing/suit/armor/turd
name = "T.U.R.D.S. Tactical Gear"
icon_state = "turd"
item_state = "turd"
/obj/item/clothing/suit/armor/NT
name = "armored nanotrasen jacket"
desc = "An armored jacket worn by NanoTrasen security commanders."
icon_state = "ntarmor"
item_state = "ntarmor"
body_parts_covered = TORSO
c_flags = ONESIZEFITSALL
/obj/item/clothing/suit/armor/NT_alt
name = "NT-SO armor"
desc = "Durable armor used by NanoTrasen's corporate operatives."
icon_state = "nt2armor"
item_state = "nt2armor"
body_parts_covered = TORSO
c_flags = ONESIZEFITSALL
armor_value_bullet = 2.5
armor_value_melee = 8
/obj/item/clothing/suit/armor/EOD
name = "bomb disposal suit"
desc = "A suit designed to absorb explosive force; very bulky and unwieldy to maneuver in."
icon_state = "eod"
item_state = "eod"
w_class = 3
armor_value_bullet = 3
armor_value_melee = 9
+270
View File
@@ -0,0 +1,270 @@
/obj/item/clothing/under/chameleon
name = "black jumpsuit"
desc = "A generic jumpsuit with no rank markings."
icon = 'icons/obj/clothing/uniforms/item_js.dmi'
wear_image_icon = 'icons/mob/jumpsuits/worn_js.dmi'
inhand_image_icon = 'icons/mob/inhand/jumpsuit/hand_js.dmi'
icon_state = "black"
item_state = "black"
permeability_coefficient = 0.50
var/list/clothing_choices = list()
New()
..()
for(var/U in (typesof(/datum/chameleon_jumpsuit_pattern)))
var/datum/chameleon_jumpsuit_pattern/P = new U
src.clothing_choices += P
return
attackby(obj/item/clothing/under/U as obj, mob/user as mob)
if(istype(U, /obj/item/clothing/under/chameleon))
boutput(user, "<span style=\"color:red\">No!!! That's a terrible idea! You'll cause a horrible jumpsuit chain reaction!</span>")
spawn(10)
boutput(user, "<span style=\"color:red\">Nah, just kidding. Doing that still doesn't work though!</span>")
return
if(istype(U, /obj/item/clothing/under))
for(var/datum/chameleon_jumpsuit_pattern/P in src.clothing_choices)
if(P.name == U.name)
boutput(user, "<span style=\"color:red\">That appearance is already saved in the chameleon pattern banks!</span>")
return
var/datum/chameleon_jumpsuit_pattern/P = new /datum/chameleon_jumpsuit_pattern(src)
P.name = U.name
P.desc = U.desc
P.icon_state = U.icon_state
P.item_state = U.item_state
P.sprite_item = U.icon
P.sprite_worn = U.wear_image_icon
P.sprite_hand = U.inhand_image_icon
src.clothing_choices += P
boutput(user, "<span style=\"color:blue\">[U.name]'s appearance has been copied!</span>")
emp_act()
if (ishuman(src.loc))
var/mob/living/carbon/human/M = src.loc
boutput(M, "<span style=\"color:red\"><B>Your chameleon jumpsuit malfunctions!</B></span>")
src.name = "psychedelic jumpsuit"
src.desc = "Groovy!"
icon = 'icons/obj/clothing/uniforms/item_js_gimmick.dmi'
wear_image_icon = 'icons/mob/jumpsuits/worn_js_gimmick.dmi'
inhand_image_icon = 'icons/mob/inhand/jumpsuit/hand_js_gimmick.dmi'
wear_image = image(wear_image_icon)
inhand_image = image(inhand_image_icon)
src.icon_state = "psyche"
src.item_state = "psyche"
M.set_clothing_icon_dirty()
verb/change()
set name = "Change Appearance"
set desc = "Alter the appearance of your Chameleon Jumpsuit."
set category = "Local"
set src in usr
var/datum/chameleon_jumpsuit_pattern/which = input("Change the jumpsuit to which pattern?", "Chameleon Jumpsuit") as null|anything in clothing_choices
if(!which)
return
src.name = which.name
src.desc = which.desc
src.icon_state = which.icon_state
src.item_state = which.item_state
src.icon = which.sprite_item
src.wear_image_icon = which.sprite_worn
src.inhand_image_icon = which.sprite_hand
src.wear_image = image(wear_image_icon)
src.inhand_image = image(inhand_image_icon)
usr.set_clothing_icon_dirty()
/datum/chameleon_jumpsuit_pattern
var/name = "black jumpsuit"
var/desc = "A generic jumpsuit with no rank markings."
var/icon_state = "black"
var/item_state = "black"
var/sprite_item = 'icons/obj/clothing/uniforms/item_js.dmi'
var/sprite_worn = 'icons/mob/jumpsuits/worn_js.dmi'
var/sprite_hand = 'icons/mob/inhand/jumpsuit/hand_js.dmi'
white
name = "white jumpsuit"
icon_state = "white"
item_state = "white"
grey
name = "grey jumpsuit"
icon_state = "grey"
item_state = "grey"
green
name = "green jumpsuit"
icon_state = "green"
item_state = "green"
aqua
name = "cyan jumpsuit"
icon_state = "aqua"
item_state = "aqua"
lightblue
name = "sky blue jumpsuit"
icon_state = "lightblue"
item_state = "lightblue"
blue
name = "blue jumpsuit"
icon_state = "blue"
item_state = "blue"
darkblue
name = "indigo jumpsuit"
icon_state = "darkblue"
item_state = "darkblue"
purple
name = "purple jumpsuit"
icon_state = "purple"
item_state = "purple"
lightpurple
name = "violet jumpsuit"
icon_state = "lightpurple"
item_state = "lightpurple"
magenta
name = "magenta jumpsuit"
icon_state = "magenta"
item_state = "magenta"
pink
name = "pink jumpsuit"
icon_state = "pink"
item_state = "pink"
red
name = "red jumpsuit"
icon_state = "red"
item_state = "red"
rank
name = "staff assistant's jumpsuit"
desc = "It's a generic grey jumpsuit. That's about what assistants are worth, anyway."
icon_state = "assistant"
item_state = "assistant"
sprite_item = 'icons/obj/clothing/uniforms/item_js_rank.dmi'
sprite_worn = 'icons/mob/jumpsuits/worn_js_rank.dmi'
sprite_hand = 'icons/mob/inhand/jumpsuit/hand_js_rank.dmi'
rank/engineer
name = "engineer's jumpsuit"
desc = "If this suit was non-conductive, maybe engineers would actually do their damn job."
icon_state = "engine"
item_state = "engine"
rank/medical
name = "medical doctor's jumpsuit"
desc = "It's got a red plus on it, that's a good thing right?"
icon_state = "medical"
item_state = "medical"
rank/roboticist
name = "roboticist's jumpsuit"
desc = "Red and black really helps highlight the cranial fluid stains."
icon_state = "robotics"
item_state = "robotics"
rank/scientist
name = "scientist's jumpsuit"
desc = "A research jumpsuit, supposedly more resistant to biohazards. It had better be!"
icon_state = "scientist"
item_state = "scientist"
rank/geneticist
name = "geneticist's jumpsuit"
desc = "Genetics is very green these days, isn't it?"
icon_state = "genetics"
item_state = "genetics"
rank/hydroponics
name = "botanist's jumpsuit"
desc = "Has a strong earthy smell to it. Hopefully it's merely dirty as opposed to soiled."
icon_state = "hydro"
item_state = "hydro"
rank/janitor
name = "janitor's jumpsuit"
desc = "You don't really want to think about what those stains are from."
icon_state = "janitor"
item_state = "janitor"
rank/bartender
name = "bartender's suit"
desc = "A nice and tidy outfit. Shame about the bar though."
icon_state = "barman"
item_state = "barman"
rank/chef
name = "chef's uniform"
desc = "Issued only to the most hardcore chefs in space."
icon_state = "chef"
item_state = "chef"
rank/chaplain
name = "chaplain jumpsuit"
desc = "A protestant vicar's outfit. Used to be a nun's, but it was a rather bad habit."
icon_state = "chaplain"
item_state = "chaplain"
rank/cargo
name = "quartermaster's jumpsuit"
desc = "What can brown do for you?"
icon_state = "qm"
item_state = "qm"
rank/mechanic
name = "mechanic's uniform"
desc = "Formerly an electrician's uniform, renamed because mechanics are not electricians."
icon_state = "mechanic"
item_state = "mechanic"
rank/overalls
name = "miner's overalls"
desc = "Durable overalls for the hard worker who likes to smash rocks into little bits."
icon_state = "miner"
item_state = "miner"
rank/security
name = "security uniform"
desc = "Is anyone who wears a jacket like that EVER good?"
icon_state = "security"
item_state = "security"
rank/det
name = "hard worn suit"
desc = "Someone who wears this means business. Either that or they're a total dork."
icon_state = "detective"
item_state = "detective"
rank/head_of_personnel
name = "head of personnel's uniform"
desc = "Rather bland and inoffensive. Perfect for vanishing off the face of the universe."
icon_state = "hop"
item_state = "hop"
rank/head_of_securityold
name = "head of security's uniform"
desc = "It's bright red and rather crisp, much like security's victims tend to be."
icon_state = "hos"
item_state = "hos"
rank/chief_engineer
name = "chief engineer's uniform"
desc = "It's an old, battered boiler suit with faded oil stains."
icon_state = "chief"
item_state = "chief"
rank/research_director
name = "research director's uniform"
desc = "This suit is ludicrously cheap. They must be embezzling the research budget again."
icon_state = "director"
item_state = "director"
+23
View File
@@ -0,0 +1,23 @@
// EARS
/obj/item/clothing/ears
name = "ears"
inhand_image_icon = 'icons/mob/inhand/hand_headgear.dmi'
wear_image_icon = 'icons/mob/ears.dmi'
w_class = 1.0
throwforce = 2
var/block_hearing = 0
/obj/item/clothing/ears/earmuffs
name = "earmuffs"
icon_state = "earmuffs"
protective_temperature = 500
item_state = "earmuffs"
desc = "Keeps you warm, makes it hard to hear."
block_hearing = 1
/obj/item/clothing/ears/earmuffs/earplugs
name = "ear plugs"
icon_state = "earplugs"
item_state = "nothing"
desc = "Protects you from sonic attacks."
+787
View File
@@ -0,0 +1,787 @@
// -------------------- VR --------------------
/obj/item/clothing/under/virtual
name = "virtual jumpsuit"
desc = "These clothes are unreal."
wear_image_fat = "virtual"
icon_state = "virtual"
item_state = "virtual"
/obj/item/clothing/shoes/virtual
name = "virtual shoes"
desc = "How can you simulate the sole?"
icon_state = "virtual"
// --------------------------------------------
// -------------------- Predator --------------------
/obj/item/clothing/mask/predator
name = "Predator Mask"
desc = "It has some kind of heat tracking and voice modulation equipment built into it."
icon_state = "predator"
item_state = "bogloves"
c_flags = COVERSMOUTH | COVERSEYES | MASKINTERNALS
see_face = 0
New()
..()
src.vchange = new(src) // Built-in voice changer (Convair880).
/obj/item/clothing/under/gimmick/predator
name = "Predator Suit"
desc = "Fishnets, bandoliers and plating? What the hell?"
icon_state = "predator"
item_state = "predator"
/obj/item/clothing/shoes/cowboy/predator
name = "Space Cowboy Boots"
desc = "Fashionable alien footwear. The sole appears to be rubberized, preventing slipping on wet surfaces."
c_flags = NOSLIP // Don't slip on gibs all the time, d'oh (Convair880).
// --------------------------------------------------
/obj/item/clothing/head/helmet/space/santahat
name = "2k13 vintage santa hat"
desc = "Uhh, how long has this even been here? It looks kinda grubby and, uhh, singed. Wait, is that blood?"
icon_state = "santa"
item_state = "santa"
/obj/item/clothing/suit/space/santa
name = "santa suit"
desc = "Festive!"
icon_state = "santa"
item_state = "santa"
icon = 'icons/obj/clothing/overcoats/item_suit_gimmick.dmi'
wear_image_icon = 'icons/mob/overcoats/worn_suit_gimmick.dmi'
inhand_image_icon = 'icons/mob/inhand/overcoat/hand_suit_gimmick.dmi'
/obj/item/clothing/mask/owl_mask
name = "owl mask"
desc = "Twoooo!"
icon_state = "owl"
see_face = 0.0
suicide(var/mob/user as mob)
if (ishuman(user))
var/mob/living/carbon/human/H = user
if (istype(H.w_uniform, /obj/item/clothing/under/gimmick/owl) && !(user.stat || user.paralysis))
user.visible_message("<span style=\"color:red\"><b>[user] hoots loudly!</b></span>")
user.owlgib()
return 1
else
user.visible_message("[user] hoots softly.")
user.suiciding = 0
return 0
else
return 0
/obj/item/clothing/under/gimmick/owl
name = "owl suit"
desc = "Twoooo!"
icon_state = "owl"
item_state = "owl"
compatible_species = list("human", "monkey")
suicide(var/mob/user as mob)
if (ishuman(user))
var/mob/living/carbon/human/H = user
if (istype(H.head, /obj/item/clothing/mask/owl_mask) && !(user.stat || user.paralysis))
user.visible_message("<span style=\"color:red\"><b>[user] hoots loudly!</b></span>")
user.owlgib()
return 1
else
user.visible_message("[user] hoots softly.")
user.suiciding = 0
return 0
else
return 0
/obj/item/clothing/mask/smile
name = "Smiling Face"
desc = ":)"
icon_state = "smiles"
see_face = 0.0
/obj/item/clothing/under/gimmick/waldo
name = "striped shirt and jeans"
desc = "A very distinctive outfit."
icon_state = "waldo"
item_state = "waldo"
/obj/item/clothing/under/gimmick/odlaw
name = "yellow-striped shirt and jeans"
desc = "A rather sinister outfit."
icon_state = "odlaw"
item_state = "odlaw"
/obj/item/clothing/under/gimmick/fake_waldo
name = "striped shirt and jeans"
desc = "A very odd outfit."
icon_state = "waldont1"
item_state = "waldont1"
New()
..()
icon_state = "waldont[rand(1,6)]"
item_state = "waldont[rand(1,6)]"
/obj/item/clothing/head/waldohat
name = "Bobble Hat and Glasses"
desc = "A funny-looking hat and glasses."
icon_state = "waldo"
item_state = "santahat"
/obj/item/clothing/head/odlawhat
name = "Black-striped Bobble Hat and Glasses"
desc = "An evil-looking hat and glasses."
icon_state = "odlaw"
item_state = "o_shoes"
/obj/item/clothing/head/fake_waldohat
name = "Bobble Hat and Glasses"
desc = "An odd-looking hat and glasses."
icon_state = "waldont1"
item_state = "santahat"
New()
..()
icon_state = "waldont[rand(1,5)]"
/obj/item/clothing/gloves/cyborg
desc = "beep boop borp"
name = "cyborg gloves"
icon_state = "black"
item_state = "r_hands"
siemens_coefficient = 1
/obj/item/clothing/shoes/cyborg
name = "cyborg boots"
icon_state = "boots"
/obj/item/clothing/suit/cyborg_suit
name = "cyborg costume"
desc = "A costume of a standard-weight NanoTrasen cyborg unit. Suspiciously accurate."
icon = 'icons/obj/clothing/overcoats/item_suit_gimmick.dmi'
wear_image_icon = 'icons/mob/overcoats/worn_suit_gimmick.dmi'
inhand_image_icon = 'icons/mob/inhand/overcoat/hand_suit_armor.dmi'
icon_state = "cyborg"
item_state = "cyborg"
flags = FPRINT | TABLEPASS | CONDUCT
/obj/item/clothing/under/gimmick/johnny
name = "Johnny~~"
desc = "Johnny~~"
icon_state = "johnny"
item_state = "johnny"
/obj/item/clothing/suit/johnny_coat
name = "Johnny~~"
desc = "Johnny~~"
icon = 'icons/obj/clothing/overcoats/item_suit_gimmick.dmi'
wear_image_icon = 'icons/mob/overcoats/worn_suit_gimmick.dmi'
inhand_image_icon = 'icons/mob/inhand/overcoat/hand_suit_gimmick.dmi'
icon_state = "johnny"
item_state = "johnny"
flags = FPRINT | TABLEPASS
// UNUSED COLORS
/obj/item/clothing/glasses/monocle
name = "monocle"
desc = "Such a dapper eyepiece!"
icon_state = "monocle"
item_state = "headset" // lol
/obj/item/clothing/under/gimmick/police
name = "police uniform"
desc = "Move along, nothing to see here."
icon_state = "police"
item_state = "police"
/obj/item/clothing/head/helmet/bobby
name = "constable's helmet"
desc = "Heh. Lookit dat fukken helmet."
icon_state = "policehelm"
item_state = "helmet"
/obj/item/clothing/head/flatcap
name = "flat cap"
desc = "A working man's cap."
icon_state = "flat_cap"
item_state = "detective"
// NASSA
/obj/item/clothing/head/helmet/space/blackstronaut
name = "NASSA space helmet"
desc = "A helmet with a self-contained pressurized environment. Kinda resembles a motorcycle helmet."
icon_state = "EOD"
/obj/item/clothing/under/gimmick/blackstronaut
name = "NASSA space suit"
desc = "A space activity suit embroidered with the NASSA logo. Space is one cold muthafucka."
icon_state = "nassa"
item_state = "nassa"
c_flags = SPACEWEAR
body_parts_covered = TORSO|LEGS|ARMS
permeability_coefficient = 0.02
protective_temperature = 1000
heat_transfer_coefficient = 0.02
// Duke Nukem
/obj/item/clothing/under/gimmick/duke
name = "the duke's suit"
desc = "You have come here to chew bubblegum and kick ass...and you're all out of bubblegum."
icon_state = "duke"
item_state = "duke"
/obj/item/clothing/suit/armor/vest/abs
name = "the duke's armor"
desc = "Always bet on Duke. Just don't expect the bet to pay off anytime soon. Or at all, really."
wear_image_icon = 'icons/mob/overcoats/worn_suit_gimmick.dmi'
icon = 'icons/obj/clothing/overcoats/item_suit_gimmick.dmi'
icon_state = "dukeabs"
item_state = "dukeabs"
/obj/item/clothing/head/biker_cap
name = "Biker Cap"
desc = "It looks pretty fabulous, to be honest."
icon_state = "bikercap"
item_state = "bgloves"
// Batman
/obj/item/clothing/suit/armor/batman
name = "batsuit"
desc = "THE SYMBOL ON MY CHEST IS THAT OF A BAT"
icon = 'icons/obj/clothing/overcoats/item_suit_gimmick.dmi'
wear_image_icon = 'icons/mob/overcoats/worn_suit_gimmick.dmi'
inhand_image_icon = 'icons/mob/inhand/overcoat/hand_suit_gimmick.dmi'
icon_state = "batsuit"
item_state = "batsuit"
/obj/item/clothing/mask/batman
name = "batmask and batcape"
desc = "I'M THE GODDAMN BATMAN."
icon_state = "batman"
item_state = "bl_suit"
/obj/item/clothing/head/helmet/batman
name = "batcowl"
desc = "I AM THE BAT"
icon_state = "batcowl"
item_state = "batcowl"
// see procitizen.dm for batman verbs
/// Cluwne
/obj/item/clothing/mask/cursedclown_hat
name = "cursed clown mask"
desc = "This is a very, very odd looking mask."
icon_state = "cursedclown"
item_state = "cclown_hat"
cant_self_remove = 1
cant_other_remove = 1
/obj/item/clothing/mask/cursedclown_hat/equipped(var/mob/user, var/slot)
var/mob/living/carbon/human/Victim = user
if(istype(Victim) && slot == "mask")
boutput(user, "<span style=\"color:red\"><B> The mask grips your face!</B></span>")
src.desc = "This is never coming off... oh god..."
// Mostly for spawning a cluwne car and clothes manually.
// Clown's Revenge and Cluwning Around take care of every other scenario (Convair880).
if (user.mind)
user.mind.assigned_role = "Cluwne"
src.cant_self_remove = 1
src.cant_other_remove = 1
return
/obj/item/clothing/mask/cursedclown_hat/suicide(var/mob/user, var/slot)
user.visible_message("<span style=\"color:red\"><b>[user] gazes into the eyes of the [src.name]. The [src.name] gazes back!</b></span>") //And when you gaze long into an abyss, the abyss also gazes into you.
spawn(10)
playsound(src.loc, "sound/effects/chanting.ogg", 25, 0, 0)
playsound(src.loc, pick("sound/voice/cluwnelaugh1.ogg","sound/voice/cluwnelaugh2.ogg","sound/voice/cluwnelaugh3.ogg"), 25, 0, 0)
spawn(15)
user.emote("scream")
spawn(15)
user.implode()
return 1
/obj/item/clothing/shoes/cursedclown_shoes
name = "cursed clown shoes"
desc = "Moldering clown flip flops. They're neon green for some reason."
icon_state = "cursedclown"
item_state = "cclown_shoes"
cant_self_remove = 1
cant_other_remove = 1
/obj/item/clothing/under/gimmick/cursedclown
name = "cursed clown suit"
desc = "It wasn't already?"
icon_state = "cursedclown"
item_state = "cursedclown"
cant_self_remove = 1
cant_other_remove = 1
/obj/item/clothing/gloves/cursedclown_gloves
name = "cursed white gloves"
desc = "These things smell terrible, and they're all lumpy. Gross."
icon_state = "latex"
item_state = "lgloves"
cant_self_remove = 1
cant_other_remove = 1
material_prints = "greasy polymer fibers"
// blue clown thing
// it was called the blessed clown for the like half week it existed before
/obj/item/clothing/mask/clown_hat/blue
name = "blue clown mask"
desc = "Hey, still looks pretty happy for being so blue."
icon_state = "blessedclown"
item_state = "bclown_hat"
/obj/item/clothing/under/misc/clown/blue
name = "blue clown suit"
desc = "Proof that if you truly believe in yourself, you can accomplish anything. Honk."
icon = 'icons/obj/clothing/uniforms/item_js_gimmick.dmi'
wear_image_icon = 'icons/mob/jumpsuits/worn_js_gimmick.dmi'
inhand_image_icon = 'icons/mob/inhand/jumpsuit/hand_js_gimmick.dmi'
icon_state = "blessedclown"
item_state = "blessedclown"
/obj/item/clothing/shoes/clown_shoes/blue
name = "blue clown shoes"
desc = "Normal clown shoes, just blue instead of red."
icon_state = "blessedclown"
item_state = "bclown_shoes"
// SHAMONE
/obj/item/clothing/under/gimmick/mj_clothes
name = "Smooth Criminal's Jumpsuit"
desc = "You probably shouldn't wear this around small children."
icon_state = "moonwalker"
item_state = "moonwalker"
/obj/item/clothing/suit/mj_suit
name = "Smooth Criminal's Suit"
desc = "You've been struck by..."
icon = 'icons/obj/clothing/overcoats/item_suit_gimmick.dmi'
wear_image_icon = 'icons/mob/overcoats/worn_suit_gimmick.dmi'
inhand_image_icon = 'icons/mob/inhand/overcoat/hand_suit_gimmick.dmi'
icon_state = "mjsuit"
item_state = "mjsuit"
/obj/item/clothing/head/mj_hat
name = "Smooth Criminal's Hat"
desc = "Suave."
icon_state = "mjhat"
/obj/item/clothing/shoes/mj_shoes
name = "Moonwalkers"
desc = "The perfect shoes if you want to moonwalk like a champ."
icon_state = "mjshoes"
// Vikings
/obj/item/clothing/under/gimmick/viking
name = "Viking Hauberk"
desc = "A shirt of mail armor commonly utilized by space vikings."
icon_state = "viking"
item_state = "viking"
/obj/item/clothing/head/helmet/viking
name = "Viking Helmet"
desc = "A helmet, but for space vikings."
icon_state = "viking"
item_state = "viking"
/obj/item/device/energy_shield/viking
name = "Space Viking energy-shield"
icon = 'icons/obj/items.dmi'
icon_state = "viking_shield"
flags = FPRINT | TABLEPASS| CONDUCT
item_state = "vshield"
throwforce = 7.0
w_class = 3.0
turn_off()
if(user)
user.underlays -= shield_overlay
user.energy_shield = null
shield_overlay = null
user = null
active = 0
turn_on(var/mob/user2)
if(user2.energy_shield)
boutput(user2, "<span style=\"color:red\">Cannot activate more than one shield.</span>")
return
user = user2
if(!can_use())
turn_off()
return
user.energy_shield = src
shield_overlay = image('icons/effects/effects.dmi',user,"enshield",MOB_LAYER+1)
user.underlays += shield_overlay
active = 1
// Merchant
/obj/item/clothing/under/gimmick/merchant
name = "Salesman's Uniform"
desc = "A thrifty outfit for mercantile individuals."
icon_state = "merchant"
item_state = "merchant"
/obj/item/clothing/suit/merchant
name = "Salesman's Jacket"
desc = "Delightfully tacky."
icon = 'icons/obj/clothing/overcoats/item_suit_gimmick.dmi'
wear_image_icon = 'icons/mob/overcoats/worn_suit_gimmick.dmi'
inhand_image_icon = 'icons/mob/inhand/overcoat/hand_suit_gimmick.dmi'
icon_state = "merchant"
item_state = "merchant"
/obj/item/clothing/head/merchant_hat
name = "Salesman's Hat"
desc = "A big funny-looking sombrero."
icon_state = "merchant"
item_state = "chefhat"
/obj/item/clothing/mask/balaclava
name = "balaclava"
desc = "Hold hostages, rob a bank, shoot up an airport, the primitive yet flexible balaclava does it all!"
icon_state = "balaclava"
item_state = "balaclava"
see_face = 0
// Sweet Bro and Hella Jeff
/obj/item/clothing/under/gimmick/sbahj
name = "<font face='Comic Sans MS' size='3'><span style=\"color:blue\">blue janpsuit...</font>"
desc = "<font face='Comic Sans MS' size='3'>looks like somethein to wear.........<br><br>in spca</font>"
icon_state = "sbahjB"
item_state = "sbahjB"
red
name = "<font face='Comic Sans MS' size='3'><span style=\"color:red\"><b><u>read</u></b></span><span style=\"color:blue\"> jumsut</span></font>"
desc = "<font face='Comic Sans MS' size='3'>\"samething to ware for <span style=\"color:red\"><i><u>studid fuckasses</u></i></span></font>"
icon_state = "sbahjR"
item_state = "sbahjR"
yellow
name = "<font face='Comic Sans MS' size='3'><span style=\"color:yellow\"><strike>yello jamsuuit</strike><b><u><i>GEROMY</i></u></b></span></font>"
desc = "<font face='Comic Sans MS' size='3'>the big man HASS the jumpsiut</font>"
icon_state = "sbahjY"
item_state = "sbahjY"
// Spiderman
/obj/item/clothing/mask/spiderman
name = "spider-man mask"
desc = "WARNING: Provides no protection from falling bricks."
icon_state = "spiderman"
item_state = "bogloves"
see_face = 0.0
/obj/item/clothing/under/gimmick/spiderman
name = "spider-man Suit"
desc = "FAPPO!"
icon_state = "spiderman"
item_state = "spiderman"
see_face = 0.0
/obj/item/clothing/mask/horse_mask
name = "horse mask"
desc = "Neigh."
icon_state = "horse"
c_flags = SPACEWEAR | COVERSMOUTH | COVERSEYES | MASKINTERNALS
see_face = 0.0
/obj/item/clothing/head/genki
name = "super happy funtime cat head"
desc = "This cat head was built to the highest ethical standards. 50% less child labor used in production than competing novelty cat heads."
icon_state = "genki"
permeability_coefficient = 0.01
c_flags = SPACEWEAR | COVERSEYES | COVERSMOUTH | MASKINTERNALS
//birdman for nieks
/obj/item/clothing/head/birdman
name = "birdman helmet"
desc = "bird bird bird"
icon_state = "birdman"
see_face = 0
c_flags = SPACEWEAR | COVERSEYES | COVERSMOUTH | MASKINTERNALS
/obj/item/clothing/under/gimmick/birdman
name = "birdman suit"
desc = "It has wings!"
icon_state = "birdman"
item_state = "birdman"
//WARHAMS STUFF
/obj/item/clothing/mask/gas/inquis
name = "inquisitor mask"
desc = "MY WARHAMS"
icon_state = "inquis"
item_state = "swat_hel"
/obj/item/clothing/suit/adeptus
name = "adeptus mechanicus robe"
desc = "A robe of a member of the adeptus mechanicus."
icon = 'icons/obj/clothing/overcoats/item_suit_gimmick.dmi'
inhand_image_icon = 'icons/mob/inhand/overcoat/hand_suit_gimmick.dmi'
wear_image_icon = 'icons/mob/overcoats/worn_suit_gimmick.dmi'
icon_state = "adeptus"
item_state = "adeptus"
permeability_coefficient = 0.50
body_parts_covered = TORSO|LEGS|ARMS
//power armor
/obj/item/clothing/suit/power
name = "unpainted cardboard space marine armor"
desc = "Wow, what kind of dork fields an unpainted army? Gauche."
icon = 'icons/obj/clothing/overcoats/item_suit_gimmick.dmi'
wear_image_icon = 'icons/mob/overcoats/worn_suit_gimmick.dmi'
inhand_image_icon = 'icons/mob/inhand/overcoat/hand_suit_armor.dmi'
icon_state = "unp_armor"
item_state = "unp_armor"
/obj/item/clothing/suit/power/ultramarine
name = "cardboard ultramarine armor"
desc = "Oh sure, Ultramarines. That's real creative. Nerd."
icon_state = "um_armor"
item_state = "um_armor"
/obj/item/clothing/head/power/ultramarine
name = "plastic ultramarine helmet"
desc = "Darth Vader is feeling a bit blue today apparently."
icon_state = "um_helm"
/obj/item/storage/backpack/ultramarine
name = "novelty ultramarine backpack"
desc = "How is this janky piece of shit supposed to work anyway?"
icon_state = "um_back"
/obj/item/clothing/suit/power/noisemarine
name = "cardboard noise marine armor"
desc = "Slaanesh is for fucking freaks, man."
icon_state = "nm_armor"
item_state = "nm_armor"
/obj/item/clothing/head/power/noisemarine
name = "plastic noise marine helmet"
desc = "A bright pink space mans helmet. Whether it's more or less tacky than a fedora is indeterminable at this time."
icon_state = "nm_helm"
/obj/item/storage/backpack/noisemarine
name = "novelty noise marine backpack"
desc = "Shame this doesn't have real loudspeakers built into it."
icon_state = "nm_back"
/obj/item/clothing/under/gimmick/dawson
name = "Aged hipster clothes"
desc = "A worn-out brown coat with acid-washed jeans and a yellow-stained shirt. The previous owner must've been a real klutz."
icon_state = "dawson"
item_state = "dawson"
cant_self_remove = 1
cant_other_remove = 1
equipped(var/mob/user, var/slot)
if(slot == "i_clothing" && ishuman(user))
var/mob/living/carbon/human/H = user
if(H.shoes != null)
var/obj/item/clothing/shoes/c = H.shoes
if(!istype(c, /obj/item/clothing/shoes/white))
H.u_equip(c)
if(c)
c.set_loc(H.loc)
c.dropped(H)
c.layer = initial(c.layer)
var/obj/item/clothing/shoes/white/newshoes = new /obj/item/clothing/shoes/white(H)
newshoes.cant_self_remove = 1
newshoes.cant_other_remove = 1
newshoes.name = "Dirty sneakers"
newshoes.desc = "A pair of dirty white sneakers. Fortunately they don't have any blood stains."
H.equip_if_possible(newshoes, H.slot_shoes)
boutput(H, "<span style=\"color:red\"><b>You suddenly feel whiny and ineffectual.</b></span>")
H.real_name = "Mike Dawson"
H.bioHolder.mobAppearance.customization_first = "Bedhead"
H.bioHolder.mobAppearance.customization_second = "Selleck"
H.cust_one_state = "bedhead"
H.cust_two_state = "selleck"
H.bioHolder.mobAppearance.e_color = "#321E14"
H.bioHolder.mobAppearance.customization_first_color = "#412819"
H.bioHolder.mobAppearance.customization_second_color = "#412819"
H.bioHolder.mobAppearance.s_tone = 0
H.bioHolder.AddEffect("clumsy")
H.set_face_icon_dirty()
H.set_body_icon_dirty()
/obj/item/clothing/under/gimmick/chav
name = "blue tracksuit"
desc = "Looks good on yew innit?"
icon_state = "chav1"
item_state = "chav1"
New()
..()
desc = pick("Looks good on yew innit?", "Aww yeah that jackets sick m8")
if(prob(50))
name = "Burberry plaid jacket"
icon_state = "chav2"
item_state = "lb_suit"
/obj/item/clothing/head/chav
name = "burberry cap"
desc = "Sick flatbrims m8"
icon_state = "chavcap"
item_state = "caphat"
/obj/item/clothing/under/gimmick/safari
name = "safari clothing"
desc = "'ello gents! Cracking time to hunt an elephant!"
icon_state = "safari"
item_state = "safari"
/obj/item/clothing/head/safari
name = "safari hat"
desc = "Keeps you cool in the hot savannah."
icon_state = "safari"
item_state = "caphat"
/obj/item/clothing/mask/skull
name = "skull mask"
desc = "A spooky skull mask. You're getting the heebie-jeebies just looking at it!"
icon = 'icons/obj/surgery.dmi'
icon_state = "skull"
item_state = "death"
see_face = 0.0
/obj/item/clothing/suit/robuddy
name = "guardbuddy costume"
desc = "A costume that loosely resembles the PR-6 Guardbuddy. How adorable!"
icon = 'icons/obj/clothing/overcoats/item_suit_gimmick.dmi'
wear_image_icon = 'icons/mob/overcoats/worn_suit_gimmick.dmi'
inhand_image_icon = 'icons/mob/inhand/overcoat/hand_suit_gimmick.dmi'
icon_state = "robuddy"
item_state = "robuddy"
body_parts_covered = TORSO|LEGS|ARMS
/obj/item/clothing/suit/bee
name = "bee costume"
desc = "A costume that loosely resembles a domestic space bee. Buzz buzz!"
icon = 'icons/obj/clothing/overcoats/item_suit_gimmick.dmi'
wear_image_icon = 'icons/mob/overcoats/worn_suit_gimmick.dmi'
inhand_image_icon = 'icons/mob/inhand/overcoat/hand_suit_gimmick.dmi'
icon_state = "bee"
item_state = "bee"
body_parts_covered = TORSO|ARMS
/obj/item/clothing/suit/monkey
name = "monkey costume"
desc = "A costume that loosely resembles a monkey. Ook Ook!"
icon = 'icons/obj/clothing/overcoats/item_suit_gimmick.dmi'
wear_image_icon = 'icons/mob/overcoats/worn_suit_gimmick.dmi'
inhand_image_icon = 'icons/mob/inhand/overcoat/hand_suit_gimmick.dmi'
icon_state = "monkey"
item_state = "monkey"
body_parts_covered = TORSO|LEGS|ARMS
c_flags = COVERSMOUTH | COVERSEYES | SPACEWEAR
/obj/item/clothing/mask/niccage
name = "Nicolas Cage mask"
desc = "An eerily realistic mask of 20th century film actor Nicolas Cage."
icon_state = "niccage"
c_flags = SPACEWEAR | COVERSMOUTH | COVERSEYES | MASKINTERNALS
see_face = 0.0
/obj/item/clothing/mask/waltwhite
name = "meth scientist mask"
desc = "A crappy looking mask that you swear you've seen a million times before. 'Spook*Corp Costumes' is embedded on the side of it. "
icon_state = "waltwhite"
c_flags = SPACEWEAR | COVERSMOUTH | COVERSEYES | MASKINTERNALS
see_face = 0.0
/obj/item/clothing/suit/gimmick/light_borg //YJHGHTFH's light borg costume
name = "Light Cyborg Costume"
desc = "A costume that looks like a light-body cyborg. Suprisingly, it's quite comfortable!"
wear_image_icon = 'icons/mob/overcoats/worn_suit_gimmick.dmi'
icon = 'icons/obj/clothing/overcoats/item_suit_gimmick.dmi'
icon_state = "light_borg"
item_state = "light_borg"
body_parts_covered = TORSO|LEGS|ARMS
c_flags = COVERSMOUTH | COVERSEYES | SPACEWEAR
see_face = 0.0
/obj/item/clothing/under/gimmick/utena //YJHTGHTFH's utena suit
name = "revolutionary suit"
desc = "May give you the power to revolutionize the world! Probably not, though."
icon_state = "utena"
item_state = "utena"
/obj/item/clothing/shoes/utenashoes //YJHGHTFH's utena shoes
name = "revolutionary shoes"
desc = "Have you done some stretches today? You should do some stretches."
icon_state = "utenashoes"
item_state = "utenashoes"
/obj/item/clothing/under/gimmick/anthy //AffableGiraffe's anthy dress
name = "revolutionary dress"
desc = "If you experience unexpected magical swords appearing from your body, please see a doctor."
icon_state = "anthy"
item_state = "anthy"
/obj/item/clothing/suit/armor/sneaking_suit
name = "sneaking suit"
desc = "I spy with my little eye..."
icon = 'icons/obj/clothing/overcoats/item_suit_gimmick.dmi'
wear_image_icon = 'icons/mob/overcoats/worn_suit_gimmick.dmi'
inhand_image_icon = 'icons/mob/inhand/overcoat/hand_suit_armor.dmi'
icon_state = "sneakmans"
item_state = "sneakmans"
/obj/item/clothing/suit/bio_suit/beekeeper
name = "apiculturist's suit"
desc = "A suit that protects against bees. Not space bees, but like the tiny, regular kind. This thing doesn't do <i>shit</i> to protect you from space bees."
/obj/item/clothing/head/bio_hood/beekeeper
name = "apiculturist's hood"
desc = "This hood has a special mesh on it to keep bees from your eyes and other face stuff."
icon_state = "beekeeper"
item_state = "beekeeper"
/obj/item/clothing/under/rank/beekeeper
name = "apiculturist's overalls"
desc = "Really, they're just regular overalls, but they have a little bee patch on them. Aww."
icon_state = "beekeeper"
item_state = "beekeeper"
permeability_coefficient = 0.50
/obj/item/clothing/under/gimmick/butler
name = "butler suit"
desc = "Tea, sir?"
icon_state = "butler"
item_state = "butler"
/obj/item/clothing/under/gimmick/maid
name = "maid dress"
desc = "Tea, ma'am?"
icon_state = "maid"
item_state = "maid"
/obj/item/clothing/head/maid
name = "maid headwear"
desc = "A little ruffle with lace, to wear on the head. It gives you super cleaning powers*!<br><small>*Does not actually bestow any powers.</small>"
icon_state = "maid"
item_state = "maid"
/obj/item/clothing/under/gimmick/kilt
name = "kilt"
desc = "Traditional Scottish clothing. A bit drafty in here, isn't it?"
icon_state = "kilt"
item_state = "kilt"
+276
View File
@@ -0,0 +1,276 @@
// GLASSES
/obj/item/clothing/glasses
name = "glasses"
icon = 'icons/obj/clothing/item_glasses.dmi'
wear_image_icon = 'icons/mob/eyes.dmi'
inhand_image_icon = 'icons/mob/inhand/hand_headgear.dmi'
w_class = 2.0
c_flags = COVERSEYES
var/allow_blind_sight = 0
var/block_vision = 0
var/correct_bad_vision = 0
/obj/item/clothing/glasses/blindfold
name = "blindfold"
icon_state = "blindfold"
item_state = "blindfold"
desc = "A strip of cloth painstakingly designed to wear around your eyes so you cannot see."
block_vision = 1
/obj/item/clothing/glasses/meson
name = "optical meson scanner"
icon_state = "meson"
item_state = "glasses"
mats = 6
desc = "Glasses that allow you to see the structure of the station through walls."
/obj/item/clothing/glasses/regular
name = "prescription glasses"
icon_state = "glasses"
item_state = "glasses"
desc = "Corrective lenses, perfect for the near-sighted."
correct_bad_vision = 1
/obj/item/clothing/glasses/regular/ecto
name = "peculiar spectacles"
desc = "Admittedly, they are rather strange."
icon_state = "ectoglasses"
/obj/item/clothing/glasses/regular/ecto/goggles
name = "ectoplasmoleic imager"
desc = "A pair of goggles with a dumb name."
icon_state = "ectogoggles"
/obj/item/clothing/glasses/sunglasses
name = "sunglasses"
desc = "Strangely ancient technology used to help provide rudimentary eye cover. Enhanced shielding blocks many flashes."
icon_state = "sun"
item_state = "sunglasses"
protective_temperature = 1300
var/already_worn = 0
/obj/item/clothing/glasses/sunglasses/equipped(var/mob/user, var/slot)
var/mob/living/carbon/human/H = user
if(istype(H) && slot == "eyes")
if(H.mind)
if(H.mind.assigned_role == "Detective" && !src.already_worn)
src.already_worn = 1
playsound(user.loc, "sound/effects/yeaaahhh.ogg", 100, 0)
user.visible_message("<span style=\"color:red\"><B><font size=3>YEAAAAAAAAAAAAAAAH!</font></B></span>")
..()
return
/obj/item/clothing/glasses/thermal
name = "optical thermal scanner"
icon_state = "thermal"
item_state = "glasses"
mats = 8
desc = "High-tech glasses that can see through cloaking technology. Also helps you see further in the dark."
emp_act()
if (ishuman(src.loc))
var/mob/living/carbon/human/H = src.loc
if (istype(H.glasses, /obj/item/clothing/glasses/thermal))
boutput(H, "<span style=\"color:red\"><B>Your thermals malfunction!</B></span>")
H.take_eye_damage(3, 1)
H.change_eye_blurry(5)
H.bioHolder.AddEffect("bad_eyesight")
spawn(100)
H.bioHolder.RemoveEffect("bad_eyesight")
return
/obj/item/clothing/glasses/thermal/orange
name = "orange-tinted glasses"
desc = "A pair of glasses with an orange tint to them."
icon_state = "oglasses"
/obj/item/clothing/glasses/visor
name = "\improper VISOR goggles"
icon_state = "visor"
item_state = "glasses"
mats = 4
desc = "VIS-tech Optical Rejuvinator goggles allow the blind to see while worn."
allow_blind_sight = 1
/obj/item/clothing/glasses/eyepatch
name = "medical eyepatch"
icon_state = "eyepatch"
item_state = "headset"
desc = "Only the coolest eye-wear around."
/obj/item/clothing/glasses/vr
name = "\improper VR goggles"
desc = "A pair of VR goggles running a personal simulation."
icon_state = "vr"
item_state = "sunglasses"
var/network = "det_net"
New()
spawn(20)
if (src)
src.name += " - '[src.network]'" // They otherwise all look the same (Convair880).
..()
equipped(var/mob/user, var/slot)
var/mob/living/carbon/human/H = user
if(istype(H) && slot == "eyes" && !H.network_device)
user.network_device = src
//user.verbs += /mob/proc/jack_in
Station_VNet.Enter_Vspace(H, src,src.network)
return
unequipped(var/mob/user)
if(ishuman(user) && user:network_device == src)
//user.verbs -= /mob/proc/jack_in
user:network_device = null
return
/obj/item/clothing/glasses/vr_fake //Only exist IN THE MATRIX. Used to log out.
name = "\improper VR goggles"
desc = "A pair of VR goggles running a personal simulation. You should know this, being IN the simulation and all."
icon_state = "vr"
item_state = "sunglasses"
unequipped(var/mob/user)
if(istype(user, /mob/living/carbon/human/virtual) && user:body)
//Station_VNet.Leave_Vspace(user)
user.death()
return
/obj/item/clothing/glasses/healthgoggles
name = "\improper ProDoc Healthgoggles"
desc = "Fitted with an advanced miniature sensor array that allows the user to quickly determine the physical condition of others."
icon_state = "ectoglasses"
var/client/assigned = null
var/scan_upgrade = 0
var/health_scan = 0
mats = 8
//proc/updateIcons() //I wouldve liked to avoid this but i dont want to put this inside the mobs life proc as that would be more code.
process()
if (assigned)
assigned.images.Remove(health_mon_icons)
addIcons()
if (loc != assigned.mob)
assigned.images.Remove(health_mon_icons)
assigned = null
//sleep(20)
else
processing_items.Remove(src)
proc/addIcons()
if (assigned)
for (var/image/I in health_mon_icons)
if (!I || !I.loc || !src)
continue
if (I.loc.invisibility && I.loc != src.loc)
continue
else
assigned.images.Add(I)
equipped(var/mob/user, var/slot)
if (slot == "eyes")
assigned = user.client
spawn(-1)
//updateIcons()
if (!(src in processing_items))
processing_items.Add(src)
return
unequipped(var/mob/user)
if (assigned)
assigned.images.Remove(health_mon_icons)
assigned = null
processing_items.Remove(src)
return
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/device/healthanalyzer_upgrade))
if (src.scan_upgrade)
boutput(user, "<span style=\"color:red\">[src] already has a health scan upgrade!</span>")
return
else
src.scan_upgrade = 1
src.health_scan = 1
src.icon_state = "prodocs"
src.item_state = "prodocs"
boutput(user, "<span style=\"color:blue\">Health scan upgrade installed.</span>")
playsound(src.loc ,"sound/items/Deconstruct.ogg", 80, 0)
user.u_equip(W)
qdel(W)
return
else
return ..()
attack_self(mob/user as mob)
if (!src.scan_upgrade)
boutput(user, "<span style=\"color:red\">No health scan upgrade detected!</span>")
return
else
src.health_scan = !(src.health_scan)
boutput(user, "<span style=\"color:blue\">Health scanner [src.health_scan ? "enabled" : "disabled"].</span>")
return
/obj/item/clothing/glasses/healthgoggles/upgraded
icon_state = "prodocs"
item_state = "prodocs"
scan_upgrade = 1
health_scan = 1
// Glasses that allow the wearer to get a full reagent report for containers
/obj/item/clothing/glasses/spectro
name = "spectroscopic scanner goggles"
icon_state = "spectro"
item_state = "glasses"
mats = 6
desc = "Goggles with an integrated minature Raman spectroscope for easy qualitative and quantitative analysis of chemical samples."
// testing thing for static overlays
/obj/item/clothing/glasses/staticgoggles
name = "goggles"
desc = "wha"
icon_state = "machoglasses"
color = "#FF00FF"
var/client/assigned = null
process()
if (assigned)
assigned.images.Remove(mob_static_icons)
addIcons()
if (loc != assigned.mob)
assigned.images.Remove(mob_static_icons)
assigned = null
//sleep(20)
else
processing_items.Remove(src)
proc/addIcons()
if (assigned)
for (var/image/I in mob_static_icons)
if (!I || !I.loc || !src)
continue
if (I.loc.invisibility && I.loc != src.loc)
continue
else
assigned.images.Add(I)
equipped(var/mob/user, var/slot)
if (slot == "eyes")
assigned = user.client
spawn(-1)
//updateIcons()
if (!(src in processing_items))
processing_items.Add(src)
return
unequipped(var/mob/user)
if (assigned)
assigned.images.Remove(mob_static_icons)
assigned = null
processing_items.Remove(src)
return
+345
View File
@@ -0,0 +1,345 @@
// NO GLOVES NO LOVES
var/list/glove_IDs = new/list() //Global list of all gloves. Identical to Cogwerk's forensic ID system (Convair880).
/obj/item/clothing/gloves
name = "gloves"
w_class = 2.0
icon = 'icons/obj/clothing/item_gloves.dmi'
wear_image_icon = 'icons/mob/hands.dmi'
inhand_image_icon = 'icons/mob/inhand/hand_feethand.dmi'
protective_temperature = 400
heat_transfer_coefficient = 0.25
siemens_coefficient = 0.50
disease_resistance = 10
var/uses = 0
var/max_uses = 0 // If can_be_charged == 1, how many charges can these gloves store?
var/stunready = 0
var/weighted = 0
var/atom/movable/overlay/overl = null
var/hide_prints = 1 // Seems more efficient to do this with one global proc and a couple of vars (Convair880).
var/scramble_prints = 0
var/material_prints = null
var/can_be_charged = 0 // Currently, there are provisions for icon state "yellow" only. You have to update this file and mob_procs.dm if you're wanna use other glove sprites (Convair880).
var/glove_ID = null
New()
..() // your parents miss you
spawn(20)
src.glove_ID = src.CreateID()
if (glove_IDs) // fix for Cannot execute null.Add(), maybe??
glove_IDs.Add(src.glove_ID)
return
examine()
..()
if (src.stunready)
boutput(usr, "It seems to have some wires attached to it.[src.max_uses > 0 ? " There are [src.uses]/[src.max_uses] charges left!" : ""]")
return
// reworked this proc a bit so it can't run more than 5 times, just in case
proc/CreateID()
var/newID = null
for (var/i=5, i>0, i--)
newID = GenID()
if (glove_IDs && newID && !glove_IDs.Find(newID))
return newID
proc/GenID()
var/newID = ""
for (var/i=10, i>0, i--)
newID += "[pick(numbersAndLetters)]"
if (length(newID))
return newID
attackby(obj/item/W, mob/user)
if (istype(W, /obj/item/cable_coil))
if (!src.can_be_charged)
user.show_text("The [src.name] cannot be electrically charged.", "red")
return
if (src.stunready)
user.show_text("You don't need to add more wiring to the [src.name].", "red")
return
boutput(user, "<span style=\"color:blue\">You attach the wires to the [src.name].</span>")
src.stunready = 1
src.material_prints += ", electrically charged"
W:amount--
return
if (istype(W, /obj/item/cell)) // Moved from cell.dm (Convair880).
var/obj/item/cell/C = W
if (C.charge < 2500)
user.show_text("[C] needs more charge before you can do that.", "red")
return
if (!src.stunready)
user.visible_message("<span style=\"color:red\"><b>[user]</b> shocks themselves while fumbling around with [C]!</span>", "<span style=\"color:red\">You shock yourself while fumbling around with [C]!</span>")
C.zap(user)
return
if (src.can_be_charged)
if (src.uses == src.max_uses)
user.show_text("The gloves are already fully charged.", "red")
return
if (src.uses < 0)
src.uses = 0
src.uses = min(src.uses + 1, src.max_uses)
C.use(2500)
src.icon_state = "stun"
src.item_state = "stun"
C.updateicon()
user.update_clothing() // Required to update the worn sprite (Convair880).
user.visible_message("<span style=\"color:red\"><b>[user]</b> charges [his_or_her(user)] stun gloves.</span>", "<span style=\"color:blue\">The stun gloves now hold [src.uses]/[src.max_uses] charges!</span>")
else
user.visible_message("<span style=\"color:red\"><b>[user]</b> shocks themselves while fumbling around with [C]!</span>", "<span style=\"color:red\">You shock yourself while fumbling around with [C]!</span>")
C.zap(user)
return
..()
proc/damage_bonus()
if (weighted)
return 3
return 0
proc/distort_prints(var/prints as text, var/get_glove_ID = 1) // Ditto (Convair880).
var/data = null
if (!src.hide_prints)
data += prints
else
if (src.scramble_prints)
data += corruptText(prints, 20)
// Known bug: occasionally breaks the format of the forensic scanner's readout. Dunno how to account for that yet (Convair880).
else // Seems a bit redundant to return both (Convair880).
if (src.material_prints)
data += src.material_prints
else
data += "unknown fiber material"
if (get_glove_ID)
data += " (Glove ID: [src.glove_ID])" // Space is required for formatting (Convair880).
return data
/obj/item/clothing/gloves/fingerless
desc = "These gloves lack fingers."
name = "Fingerless Gloves"
icon_state = "fgloves"
item_state = "finger-"
hide_prints = 0
/obj/item/clothing/gloves/black
desc = "These gloves are fire-resistant."
name = "Black Gloves"
icon_state = "black"
item_state = "bgloves"
protective_temperature = 1500
heat_transfer_coefficient = 0.01
material_prints = "black leather fibers"
/obj/item/clothing/gloves/cyborg
desc = "beep boop borp"
name = "cyborg gloves"
icon_state = "black"
item_state = "r_hands"
siemens_coefficient = 1.0
/obj/item/clothing/gloves/latex
name = "Latex Gloves"
icon_state = "latex"
item_state = "lgloves"
siemens_coefficient = 0.30
permeability_coefficient = 0.02
desc = "Thin gloves that offer minimal protection."
protective_temperature = 310
heat_transfer_coefficient = 0.90
scramble_prints = 1
/obj/item/clothing/gloves/swat
desc = "These tactical gloves are somewhat fire and impact-resistant."
name = "SWAT Gloves"
icon_state = "black"
item_state = "swat_gl"
siemens_coefficient = 0.30
protective_temperature = 1100
heat_transfer_coefficient = 0.05
material_prints = "high-quality synthetic fibers"
/obj/item/clothing/gloves/stungloves/
name = "Stungloves"
desc = "These gloves are electrically charged."
icon_state = "stun"
item_state = "stun"
siemens_coefficient = 0
material_prints = "insulative fibers, electrically charged"
stunready = 1
can_be_charged = 1
uses = 5
max_uses = 5
/obj/item/clothing/gloves/yellow
desc = "These gloves are electrically insulated."
name = "insulated gloves"
icon_state = "yellow"
item_state = "ygloves"
siemens_coefficient = 0
protective_temperature = 1000
heat_transfer_coefficient = 0.01
material_prints = "insulative fibers"
can_be_charged = 1
max_uses = 1
/obj/item/clothing/gloves/yellow/unsulated
desc = "These gloves are not electrically insulated."
name = "unsulated gloves"
siemens_coefficient = 1
protective_temperature = 10
heat_transfer_coefficient = 1
can_be_charged = 0
max_uses = 0
/obj/item/clothing/gloves/boxing
name = "Boxing Gloves"
desc = "These gloves are for competitive boxing."
icon_state = "boxinggloves"
item_state = "bogloves"
siemens_coefficient = 0.20
protective_temperature = 310
heat_transfer_coefficient = 0.25
material_prints = "red leather fibers"
get_desc(dist)
if (src.weighted)
. += "These things are pretty heavy!"
/obj/item/clothing/gloves/boxing/attackby(obj/item/W, mob/user)
if (istype(W, /obj/item/horseshoe))
if (src.weighted)
boutput(user, "<span style='color:red'>You try to put [W] into [src], but there's already something in there!</span>")
return
boutput(user, "You slip the horseshoe inside one of the gloves.")
src.weighted = 1
qdel(W)
/* no why are you deleting the gloves and making new ones, just change the desc and set the var on the existing ones, fuck
var/obj/item/clothing/gloves/boxing_h/A = new /obj/item/clothing/gloves/boxing_h
A.set_loc(user.loc)
qdel(W)
qdel(src)*/
else
return ..()
/obj/item/horseshoe //Heavy horseshoe for traitor boxers to put in their gloves
name = "Heavy Horseshoe"
desc = "An old horseshoe."
icon = 'icons/obj/junk.dmi'
icon_state = "horseshoe"
force = 6.5
throwforce = 25
throw_speed = 3
throw_range = 6
w_class = 1.0
flags = FPRINT | TABLEPASS | NOSHIELD
/obj/item/clothing/gloves/powergloves
desc = "Now I'm playin' with power!"
name = "power gloves"
icon_state = "yellow"
item_state = "ygloves"
siemens_coefficient = 0
protective_temperature = 1000
heat_transfer_coefficient = 0.01
material_prints = "insulative fibers and nanomachines"
can_be_charged = 1 // Quite pointless, but could be useful as a last resort away from powered wires? Hell, it's a traitor item and can get the buff (Convair880).
max_uses = 1
var/spam_flag = 0
proc/use_power(var/amount)
var/turf/T = get_turf(src)
var/area/A = T.loc
if(!A || !isarea(A))
return
A.use_power(amount, ENVIRON)
equipment_click(var/atom/target, var/atom/user)
if(target == user || spam_flag || user:a_intent == INTENT_HELP || user:a_intent == INTENT_GRAB) return
var/netnum = 0
for(var/turf/T in range(1, user))
for(var/obj/cable/C in T.contents) //Needed because cables have invisibility 101. Making them disappear from most LISTS.
netnum = C.netnum
break
if(get_dist(user, target) > 1 && !user:equipped())
if(!netnum)
boutput(user, "<span style=\"color:red\">The gloves find no cable to draw power from.</span>")
return
spam_flag = 1
spawn(40) spam_flag = 0
use_power(50000)
var/atom/last = user
var/atom/target_r = target
var/list/dummies = new/list()
playsound(user, "sound/effects/elec_bigzap.ogg", 40, 1)
if(isturf(target))
target_r = new/obj/elec_trg_dummy(target)
var/turf/currTurf = get_turf(target_r)
currTurf.hotspot_expose(2000, 400)
for(var/count=0, count<4, count++)
var/list/affected = DrawLine(last, target_r, /obj/line_obj/elec ,'icons/obj/projectiles.dmi',"WholeLghtn",1,1,"HalfStartLghtn","HalfEndLghtn",OBJ_LAYER,1,PreloadedIcon='icons/effects/LghtLine.dmi')
for(var/obj/O in affected)
spawn(6) pool(O)
if(istype(target_r, /obj/machinery/power/generatorTemp))
var/obj/machinery/power/generatorTemp/gen = target_r
gen.efficiency_controller += 5
gen.grump += 5
spawn(450)
gen.efficiency_controller -= 5
else if(istype(target_r, /mob/living)) //Probably unsafe.
logTheThing("combat", user, target_r, "zaps %target% with power gloves")
switch(user:a_intent)
if("harm")
src.electrocute(target_r, 100, netnum)
break
if("disarm")
target_r:weakened += 3
break
var/list/next = new/list()
for(var/atom/movable/M in orange(3, target_r))
if(M == user || istype(M, /obj/line_obj/elec) || istype(M, /obj/elec_trg_dummy) || istype(M, /obj/overlay/tile_effect) || M.invisibility) continue
next.Add(M)
if(istype(target_r, /obj/elec_trg_dummy)) dummies.Add(target_r)
last = target_r
target_r = pick(next)
target = target_r
for(var/d in dummies)
qdel(d)
+397
View File
@@ -0,0 +1,397 @@
// HATS. OH MY WHAT A FINE CHAPEAU, GOOD SIR.
/obj/item/clothing/head
name = "hat"
desc = "For your head!"
icon = 'icons/obj/clothing/item_hats.dmi'
wear_image_icon = 'icons/mob/head.dmi'
inhand_image_icon = 'icons/mob/inhand/hand_headgear.dmi'
body_parts_covered = HEAD
compatible_species = list("human", "monkey")
armor_value_melee = 1
var/seal_hair = 0 // best variable name I could come up with, if 1 it forms a seal with a suit so no hair can stick out
cold_resistance = 10
heat_resistance = 5
/obj/item/clothing/head/red
desc = "A knit cap in red."
icon_state = "red"
item_state = "rgloves"
/obj/item/clothing/head/blue
desc = "A knit cap in blue."
icon_state = "blue"
item_state = "bgloves"
/obj/item/clothing/head/yellow
desc = "A knit cap in yellow."
icon_state = "yellow"
item_state = "ygloves"
/obj/item/clothing/head/dolan
name = "Dolan's Hat"
desc = "A plsing hat."
icon_state = "dolan"
item_state = "dolan"
/obj/item/clothing/head/green
desc = "A knit cap in green."
icon_state = "green"
item_state = "ggloves"
/obj/item/clothing/head/black
desc = "A knit cap in black."
icon_state = "black"
item_state = "swat_gl"
/obj/item/clothing/head/white
desc = "A knit cap in white."
icon_state = "white"
item_state = "lgloves"
/obj/item/clothing/head/psyche
desc = "A knit cap in...what the hell?"
icon_state = "psyche"
item_state = "bgloves"
/obj/item/clothing/head/serpico
icon_state = "serpico"
item_state = "serpico"
/obj/item/clothing/head/bio_hood
name = "bio hood"
icon_state = "bio"
permeability_coefficient = 0.01
c_flags = SPACEWEAR | COVERSEYES | COVERSMOUTH
desc = "This hood protects you from harmful biological contaminants."
disease_resistance = 50
armor_value_melee = 3
seal_hair = 1
cold_resistance = 10
heat_resistance = 10
/obj/item/clothing/head/bio_hood/nt
name = "NT bio hood"
icon_state = "ntbiohood"
armor_value_melee = 5
/obj/item/clothing/head/emerg
name = "Emergency Hood"
icon_state = "emerg"
permeability_coefficient = 0.25
c_flags = SPACEWEAR | COVERSEYES | COVERSMOUTH
desc = "Helps protect from vacuum for a short period of time."
/obj/item/clothing/head/rad_hood
name = "Class II Radiation Hood"
icon_state = "radiation"
permeability_coefficient = 0.01
heat_transfer_coefficient = 0.10
c_flags = COVERSEYES | COVERSMOUTH
desc = "Asbestos, right near your face. Perfect!"
armor_value_melee = 5
radproof = 1
seal_hair = 1
/obj/item/clothing/head/cakehat
name = "cakehat"
desc = "It is a cakehat"
icon_state = "cake0"
var/status = 0
var/processing = 0
c_flags = SPACEWEAR | COVERSEYES
var/fire_resist = T0C+1300 //this is the max temp it can stand before you start to cook. although it might not burn away, you take damage
var/datum/light/light
var/on = 0
New()
..()
light = new /datum/light/point
light.set_brightness(0.6)
light.set_height(1.8)
light.set_color(0.94, 0.69, 0.27)
light.attach(src)
pickup(mob/user)
..()
light.attach(user)
dropped(mob/user)
..()
spawn(0)
if (src.loc != user)
light.attach(src)
attack_self(mob/user)
src.flashlight_toggle(user)
return
proc/flashlight_toggle(var/mob/user, var/force_on = 0)
if (!src || !user || !ismob(user)) return
if (status > 1)
return
if (force_on)
src.on = 1
else
src.on = !src.on
if (src.on)
src.force = 10
src.damtype = "fire"
src.icon_state = "cake1"
light.enable()
if (!(src in processing_items))
processing_items.Add(src)
else
src.force = 3
src.damtype = "brute"
src.icon_state = "cake0"
light.disable()
user.update_clothing()
src.add_fingerprint(user)
return
process()
if (!src.on)
processing_items.Remove(src)
return
var/turf/location = src.loc
if (istype(location, /mob/))
var/mob/living/carbon/human/M = location
if (M.l_hand == src || M.r_hand == src || M.head == src)
location = M.loc
if (istype(location, /turf))
location.hotspot_expose(700, 1)
return
afterattack(atom/target, mob/user as mob)
if (src.on && !ismob(target) && target.reagents)
boutput(usr, "<span style=\"color:blue\">You heat \the [target.name]</span>")
target.reagents.temperature_reagents(2500,10)
return
/obj/item/clothing/head/caphat
name = "Captain's hat"
icon_state = "captain"
c_flags = SPACEWEAR
item_state = "caphat"
desc = "A symbol of the captain's rank, and the source of all his power."
armor_value_melee = 5
/obj/item/clothing/head/centhat
name = "Cent. Comm. hat"
icon_state = "centcom"
c_flags = SPACEWEAR
item_state = "centcom"
armor_value_melee = 5
red
icon_state = "centcom-red"
item_state = "centcom-red"
/obj/item/clothing/head/det_hat
name = "hat"
desc = "Someone who wears this will look very smart"
icon_state = "detective"
armor_value_melee = 3
/obj/item/clothing/head/powdered_wig
name = "powdered wig"
desc = "A powdered wig"
icon_state = "pwig"
item_state = "pwig"
/obj/item/clothing/head/that
name = "hat"
desc = "An stylish looking hat"
icon_state = "tophat"
item_state = "that"
/obj/item/clothing/head/that/purple
name = "purple hat"
desc = "A purple tophat."
icon_state = "ptophat"
item_state = "pthat"
c_flags = SPACEWEAR
protective_temperature = 500
heat_transfer_coefficient = 0.10
/obj/item/clothing/head/chefhat
name = "Chef's hat"
icon_state = "chef"
item_state = "chef"
desc = "Your toque blanche, coloured as such so that your poor sanitation is obvious, and the blood shows up nice and crazy."
c_flags = SPACEWEAR
/obj/item/clothing/head/souschefhat
name = "Sous-Chef's hat"
icon_state = "souschef"
item_state = "souschef"
c_flags = SPACEWEAR
/obj/item/clothing/head/mailcap
name = "Mailman's Hat"
desc = "The hat of a mailman."
icon_state = "mailcap"
item_state = "mailcap"
c_flags = SPACEWEAR
/obj/item/clothing/head/policecap
name = "Police Hat"
desc = "An old surplus-issue police hat."
icon_state = "mailcap"
item_state = "mailcap"
c_flags = SPACEWEAR
/obj/item/clothing/head/plunger
name = "plunger"
desc = "get dat fukken clog"
icon_state = "plunger"
item_state = "plunger"
armor_value_melee = 2
/obj/item/clothing/head/hosberet
name = "HoS Beret"
desc = "This makes you feel like Che Guevara."
icon_state = "hosberet"
item_state = "hosberet"
c_flags = SPACEWEAR
/obj/item/clothing/head/NTberet
name = "Nanotrasen Beret"
desc = "For the inner dictator in you."
icon_state = "ntberet"
item_state = "ntberet"
c_flags = SPACEWEAR
/obj/item/clothing/head/XComHair
name = "Rookie Scalp"
desc = "Some unfortunate soldier's charred scalp. The hair is intact."
icon_state = "xcomhair"
item_state = "xcomhair"
c_flags = SPACEWEAR
/obj/item/clothing/head/apprentice
name = "Apprentice's Cap"
desc = "Legends tell about space sorcerors taking on apprentices. Such apprentices would wear a magical cap, and this is one such ite- hey! This is just a cardboard cone with wrapping paper on it!"
icon_state = "apprentice"
item_state = "apprentice"
c_flags = SPACEWEAR
/obj/item/clothing/head/snake
name = "Dirty Rag"
desc = "A rag that looks like it was dragged through the jungle. Yuck."
icon_state = "snake"
item_state = "snake"
c_flags = SPACEWEAR
// Chaplain Hats
/obj/item/clothing/head/rabbihat
name = "rabbi's hat"
desc = "Complete with jewcurls. Oy vey!"
icon_state = "rabbihat"
item_state = "that"
/obj/item/clothing/head/formal_turban
name = "formal turban"
desc = "A very stylish formal turban."
icon_state = "formal_turban"
item_state = "egg5"
cold_resistance = 15
heat_resistance = 10
/obj/item/clothing/head/turban
name = "turban"
desc = "A very comfortable cotton turban."
icon_state = "turban"
item_state = "that"
cold_resistance = 15
heat_resistance = 10
/obj/item/clothing/head/rastacap
name = "rastafarian cap"
desc = "Comes with pre-attached dreadlocks for that authentic look."
icon_state = "rastacap"
item_state = "that"
/obj/item/clothing/head/fedora
name = "fedora"
desc = "Tip your fedora to the fair maiden and win her heart. A foolproof plan."
icon_state = "fdora"
item_state = "fdora"
New()
..()
src.name = "[pick("fancy", "suave", "manly", "sexerific", "sextacular", "intellectual", "majestic", "euphoric")] fedora"
/obj/item/clothing/head/fruithat
name = "fruit basket hat"
desc = "Where do these things even come from?"
wear_image_icon = 'icons/mob/fruithat.dmi'
icon_state = "fruithat"
/obj/item/clothing/head/cowboy
name = "cowboy hat"
desc = "Yeehaw!"
icon_state = "cowboy"
item_state = "cowboy"
c_flags = SPACEWEAR
/obj/item/clothing/head/fancy/captain
name = "captain's hat"
icon_state = "captain-fancy"
armor_value_melee = 3
c_flags = SPACEWEAR
/obj/item/clothing/head/fancy/rank
name = "hat"
icon_state = "rank-fancy"
armor_value_melee = 3
c_flags = SPACEWEAR
/obj/item/clothing/head/wizard
name = "blue wizard hat"
desc = "A slightly crumply and foldy blue hat. Every self-respecting Wizard has one of these."
icon_state = "wizard"
item_state = "wizard"
magical = 1
handle_other_remove(var/mob/source, var/mob/living/carbon/human/target)
. = ..()
if (prob(75))
source.show_message(text("<span style=\"color:red\">\The [src] writhes in your hands as though it is alive! It just barely wriggles out of your grip!</span>"), 1)
. = 0
/obj/item/clothing/head/wizard/red
name = "red wizard hat"
desc = "An elegant red hat with some nice gold trim on it."
icon_state = "wizardred"
item_state = "wizardred"
/obj/item/clothing/head/wizard/purple
name = "purple wizard hat"
desc = "A very nice purple hat with a big, sassy buckle on it!"
icon_state = "wizardpurple"
item_state = "wizardpurple"
/obj/item/clothing/head/wizard/necro
name = "necromancer hood"
desc = "Good god, this thing STINKS. Is that mold on the inner lining? Ugh."
icon_state = "wizardnec"
item_state = "wizardnec"
see_face = 0
/obj/item/clothing/head/paper_hat
name = "Paper"
desc = "A knit cap in white."
icon_state = "paper"
item_state = "lgloves"
see_face = 1
body_parts_covered = HEAD
+257
View File
@@ -0,0 +1,257 @@
// CHUMP HELMETS: COOKING THEM DESTROYS THE CHUMP HELMET SPAWN.
/obj/item/clothing/head/helmet
name = "helmet"
icon_state = "helmet"
c_flags = COVERSEYES
item_state = "helmet"
desc = "Somewhat protects your head from being bashed in."
protective_temperature = 500
heat_transfer_coefficient = 0.10
armor_value_melee = 6
/obj/item/clothing/head/helmet/space
name = "space helmet"
icon_state = "space"
c_flags = SPACEWEAR | COVERSEYES | COVERSMOUTH
see_face = 0.0
item_state = "s_helmet"
desc = "Helps protect against vacuum."
disease_resistance = 50
armor_value_melee = 4
seal_hair = 1
cold_resistance = 20
heat_resistance = 5
/obj/item/clothing/head/helmet/space/engineer
name = "engineering space helmet"
desc = "Comes equipped with a builtin flashlight."
icon_state = "espace0"
c_flags = SPACEWEAR | COVERSEYES | COVERSMOUTH
see_face = 0.0
item_state = "s_helmet"
armor_value_melee = 5
var/datum/light/light
var/on = 0
New()
..()
light = new /datum/light/point
light.set_brightness(1)
light.set_height(1.8)
light.set_color(0.9, 0.9, 1)
light.attach(src)
attack_self(mob/user)
src.flashlight_toggle(user)
return
pickup(mob/user)
..()
light.attach(user)
dropped(mob/user)
..()
spawn(0)
if (src.loc != user)
light.attach(src)
proc/flashlight_toggle(var/mob/user, var/force_on = 0)
on = !on
src.icon_state = "espace[on]"
if (on)
light.enable()
else
light.disable()
user.update_clothing()
return
/obj/item/clothing/head/helmet/space/syndicate
name = "red space helmet"
icon_state = "syndicate"
item_state = "syndicate"
desc = "The standard space helmet of the dreaded Syndicate."
/obj/item/clothing/head/helmet/swat
name = "swat helmet"
icon_state = "swat"
c_flags = COVERSEYES
item_state = "swat"
armor_value_melee = 5
/obj/item/clothing/head/helmet/turd
name = "T.U.R.D.S. helmet"
icon_state = "turdhelm"
c_flags = COVERSEYES
item_state = "turdhelm"
armor_value_melee = 5
/obj/item/clothing/head/helmet/thunderdome
name = "Thunderdome helmet"
icon_state = "thunderdome"
c_flags = COVERSEYES
item_state = "thunderdome"
armor_value_melee = 5
/obj/item/clothing/head/helmet/hardhat
name = "hard hat"
icon_state = "hardhat0"
c_flags = SPACEWEAR
item_state = "hardhat0"
desc = "Protects your head from falling objects, and comes with a flashlight. Safety first!"
armor_value_melee = 7
var/datum/light/light
var/on = 0
New()
..()
light = new /datum/light/point
light.set_brightness(1)
light.set_height(1.8)
light.set_color(1, 1, 0.9)
light.attach(src)
pickup(mob/user)
..()
light.attach(user)
dropped(mob/user)
..()
spawn(0)
if (src.loc != user)
light.attach(src)
attack_self(mob/user)
src.flashlight_toggle(user)
return
proc/flashlight_toggle(var/mob/user, var/force_on = 0)
on = !on
src.icon_state = "hardhat[on]"
src.item_state = "hardhat[on]"
user.update_clothing()
if (on)
light.enable()
else
light.disable()
return
/obj/item/clothing/head/helmet/camera
name = "camera helmet"
desc = "A helmet with a built in camera."
icon_state = "camhat"
c_flags = SPACEWEAR
item_state = "camhat"
var/obj/machinery/camera/camera = null
var/camera_tag = "Helmet Cam"
var/camera_network = "Zeta"
New()
..()
src.camera = new /obj/machinery/camera (src)
src.camera.c_tag = src.camera_tag
src.camera.network = src.camera_network
/obj/item/clothing/head/helmet/camera/security
name = "security camera helmet"
desc = "A red helmet with a built in camera. It has a little note taped to it that says \"Security\"."
icon_state = "redcamhat"
c_flags = SPACEWEAR
item_state = "redcamhat"
camera_tag = "Security Helmet Cam"
/obj/item/clothing/head/helmet/jetson
name = "Fifties America Reclamation Team Helmet"
desc = "Combat helmet used by a minor terrorist group."
icon_state = "jetson1"
c_flags = SPACEWEAR
icon_state = "jetson"
item_state = "jetson"
armor_value_melee = 3
/obj/item/clothing/head/helmet/welding
name = "welding helmet"
desc = "A head-mounted face cover designed to protect the wearer completely from space-arc eye. Can be flipped up for clearer vision."
icon_state = "welding"
c_flags = SPACEWEAR | COVERSEYES
see_face = 0.0
item_state = "welding"
protective_temperature = 1300
m_amt = 3000
g_amt = 1000
var/up = 0
armor_value_melee = 6
/obj/item/clothing/head/helmet/EOD
name = "blast helmet"
desc = "A thick head cover made of layers upon layers of space kevlar."
icon_state = "EOD"
item_state = "tdhelm"
c_flags = COVERSEYES
armor_value_melee = 8
/obj/item/clothing/head/helmet/HoS
name = "HoS Hat"
icon_state = "hoscap"
item_state = "hoscap"
c_flags = SPACEWEAR | COVERSEYES
var/is_a_communist = 0
var/folds = 0
desc = "Actually, you got this hat from a fast-food restaurant, that's why it folds like it was made of paper."
armor_value_melee = 7
/obj/item/clothing/head/helmet/HoS/attack_self(mob/user as mob)
if(user.r_hand == src || user.l_hand == src)
if(!src.folds)
src.folds = 1
src.name = "HoS Beret"
src.icon_state = "hosberet"
src.item_state = "hosberet"
boutput(usr, "<span style=\"color:blue\">You fold the hat into a beret.</span>")
else
src.folds = 0
src.name = "HoS Hat"
src.icon_state = "hoscap"
src.item_state = "hoscap"
boutput(usr, "<span style=\"color:blue\">You unfold the beret back into a hat.</span>")
return
/obj/item/clothing/head/helmet/NT
name = "Nanotrasen Helmet"
desc = "Security has the constitutionality of a vending machine."
icon_state = "nthelm"
item_state = "nthelm"
c_flags = SPACEWEAR | COVERSEYES | COVERSMOUTH
see_face = 0.0
armor_value_melee = 7
/obj/item/clothing/head/helmet/space/industrial
name = "Industrial Space Helmet"
desc = "Goes with Industrial Space Armor. Now with zesty citrus-scented visor!"
icon_state = "indus"
item_state = "indus"
mats = 7
armor_value_melee = 2
/*syndicate
name = "Syndicate Command Helmet"
desc = "Ooh, fancy."
icon_state = "indusred"
item_state = "indusred" */
/obj/item/clothing/head/helmet/bucket
name = "bucket helmet"
desc = "Someone's cut out a bit of this bucket so you can put it on your head."
icon_state = "buckethelm"
item_state = "buckethelm"
armor_value_melee = 2
inhand_image_icon = 'icons/mob/inhand/hand_tools.dmi'
inhand_image = "bucket"
red
name = "red bucket helmet"
desc = "Someone's cut out a bit of this bucket so you can put it on your head. It's red, and it kinda remind you of something."
icon_state = "buckethelm-r"
item_state = "buckethelm-r"
inhand_image = "bucket-r"
@@ -0,0 +1,419 @@
/* CONTAINS:
- Injector belt
- Vapo-Matic mask
- Associated condition datums
There's A LOT of duplicate code here, which isn't ideal to say the least. Should really be overhauled at some point.
*/
/obj/item/injector_belt
name = "injector belt"
desc = "Automated injection system attached to a belt."
icon = 'icons/obj/belts.dmi'
icon_state = "injectorbelt_atm"
item_state = "injector"
flags = FPRINT | TABLEPASS | ONBELT | NOSPLASH
mats = 10
var/can_trigger = 1
var/mob/owner = null
var/active = 0
var/obj/item/reagent_containers/glass/container = null
var/datum/injector_belt_condition/condition = null
var/min_time = 10
var/inj_amount = -1
equipped(var/mob/user, var/slot)
if(slot == "belt")
owner = user
if (container && container.reagents.total_volume && condition)
active = 1
check()
user.show_text("[src]: Injector system initialized.", "blue")
else
var/error_message = ""
if (!container)
error_message += " no beaker,"
if (container && !container.reagents.total_volume)
error_message += " beaker is empty,"
if (!condition)
error_message += " no condition selected,"
var/output = copytext(error_message, 1, -1)
user.show_text("Injector system not set up properly:[output].", "red")
return
unequipped(mob/user as mob)
owner = null
active = 0
return
attack_self(mob/user as mob)
user.machine = src
var/dat = ""
dat += container ? "Container: <A href='?src=\ref[src];remove_cont=1'>[container.name]</A> - [container.reagents.total_volume] / [container.reagents.maximum_volume] Units<BR><BR>" : "Please attach a beaker<BR><BR>"
dat += condition ? "[condition.name] - [condition.desc] <A href='?src=\ref[src];remove_cond=1'>(Remove)</A><BR><BR>" : "<A href='?src=\ref[src];sel_cond=1'>(Select Condition)</A><BR><BR>"
dat += "Injection amount: <A href='?src=\ref[src];change_amt=1'>[inj_amount == -1 ? "ALL" : inj_amount]</A><BR><BR>"
dat += "Min. time between activations: <A href='?src=\ref[src];change_mintime=1'>[min_time] seconds</A><BR><BR>"
user << browse("<TITLE>Injector Belt</TITLE>Injector Belt:<BR><BR>[dat]", "window=inj_belt;size=575x250")
onclose(user, "inj_belt")
return
attackby(obj/item/W as obj, mob/user as mob)
if(istype(W,/obj/item/reagent_containers/glass))
if (container)
boutput(user, "<span style=\"color:red\">There is already a container attached to the belt.</span>")
return
if (!W.reagents.total_volume)
user.show_text("[W] is empty.", "red")
return
container = W
user.drop_item()
W.set_loc(src)
if (src.is_equipped() && src.owner == user && src.condition)
src.active = 1
src.check()
user.show_text("You attach the [W] to the [src.name]! The injector system is now operational.", "blue")
else
user.show_text("You attach the [W] to the [src.name]! Please select a condition and re-equip [src] to initialize injector system.", "blue")
Topic(href, href_list)
..()
if (href_list["remove_cont"])
container.set_loc(get_turf(src))
container = null
if (href_list["remove_cond"])
condition = null
if (href_list["sel_cond"])
var/list/cond_types = (typesof(/datum/injector_belt_condition) - /datum/injector_belt_condition)
var/list/filtered = new/list()
for(var/A in cond_types)
var/datum/injector_belt_condition/C = new A()
filtered += C.name
filtered[C.name] = A
var/selected = input(usr,"Select:","Condition") in filtered
var/selected_type = filtered[selected]
condition = new selected_type()
condition.setup(usr)
if (href_list["change_amt"])
var/amt = input(usr,"Select:","Amount", inj_amount) in list("ALL",1,5,10,20,30,40,50,75,100)
if(amt == "ALL")
inj_amount = -1
else
inj_amount = amt
if (href_list["change_mintime"])
var/amt = input(usr,"Select:","Min time in seconds", min_time) in list(3,4,5,6,7,8,9,10,20,30,40,50,60,120,180,300)
min_time = amt
updateUsrDialog()
attack_self(usr)
proc/check()
if(!is_equipped()) return
if(!active) return
if(condition && container && container.reagents.total_volume)
if(condition.check_trigger(owner) && can_trigger)
can_trigger = 0
spawn(min_time*10) can_trigger = 1
playsound(get_turf(src),"sound/items/injectorbelt_active.ogg", 33, 0, -5)
boutput(owner, "<span style=\"color:blue\">Your Injector belt activates.</span>")
container.reagents.reaction(owner, INGEST)
spawn(15)
if(inj_amount == -1)
container.reagents.trans_to(owner, container.reagents.total_volume)
else
container.reagents.trans_to(owner, inj_amount)
spawn(25)
if (src) check()
proc/is_equipped()
if(!owner) return 0
if(hasvar(owner, "belt"))
if(owner:belt == src)
return 1
else
return 0
else
return 0
//////////////////////////////////////
/obj/item/clothing/mask/gas/injector_mask
name = "Vapo-Matic"
desc = "Automated chemical vaporizer system built into an old industrial respirator. Doesn't look very safe at all!"
flags = FPRINT | TABLEPASS | NOSPLASH
c_flags = SPACEWEAR | COVERSMOUTH | MASKINTERNALS
mats = 10
icon_state = "gas_injector"
item_state = "gas_injector"
var/can_trigger = 1
var/mob/owner = null
var/active = 0
var/obj/item/reagent_containers/glass/container = null
var/datum/injector_belt_condition/condition = null
var/min_time = 10
var/inj_amount = -1
equipped(var/mob/user, var/slot)
if(slot == "mask")
owner = user
if (container && container.reagents.total_volume && condition)
active = 1
check()
user.show_text("[src]: Injector system initialized.", "blue")
else
var/error_message = ""
if (!container)
error_message += " no beaker,"
if (container && !container.reagents.total_volume)
error_message += " beaker is empty,"
if (!condition)
error_message += " no condition selected,"
var/output = copytext(error_message, 1, -1)
user.show_text("Injector system not set up properly:[output].", "red")
return
unequipped(mob/user as mob)
owner = null
active = 0
return
attack_self(mob/user as mob)
user.machine = src
var/dat = ""
dat += container ? "Container: <A href='?src=\ref[src];remove_cont=1'>[container.name]</A> - [container.reagents.total_volume] / [container.reagents.maximum_volume] Units<BR><BR>" : "Please attach a beaker<BR><BR>"
dat += condition ? "[condition.name] - [condition.desc] <A href='?src=\ref[src];remove_cond=1'>(Remove)</A><BR><BR>" : "<A href='?src=\ref[src];sel_cond=1'>(Select Condition)</A><BR><BR>"
dat += "Injection amount: <A href='?src=\ref[src];change_amt=1'>[inj_amount == -1 ? "ALL" : inj_amount]</A><BR><BR>"
dat += "Min. time between activations: <A href='?src=\ref[src];change_mintime=1'>[min_time] seconds</A><BR><BR>"
user << browse("<TITLE>Vapo-Matic</TITLE>Vapo-Matic:<BR><BR>[dat]", "window=inj_belt;size=575x250")
onclose(user, "inj_belt")
return
attackby(obj/item/W as obj, mob/user as mob)
if(istype(W,/obj/item/reagent_containers/glass))
if (container)
boutput(user, "<span style=\"color:red\">There is already a container attached to the mask.</span>")
return
if (!W.reagents.total_volume)
user.show_text("[W] is empty.", "red")
return
container = W
user.drop_item()
W.set_loc(src)
if (src.is_equipped() && src.owner == user && src.condition)
src.active = 1
src.check()
user.show_text("You attach the [W] to the [src.name]! The injector system is now operational.", "blue")
else
user.show_text("You attach the [W] to the [src.name]! Please select a condition and re-equip [src] to initialize injector system.", "blue")
else
return ..()
Topic(href, href_list)
..()
if (href_list["remove_cont"])
container.set_loc(get_turf(src))
container = null
if (href_list["remove_cond"])
condition = null
if (href_list["sel_cond"])
var/list/cond_types = (typesof(/datum/injector_belt_condition) - /datum/injector_belt_condition)
var/list/filtered = new/list()
for(var/A in cond_types)
var/datum/injector_belt_condition/C = new A()
filtered += C.name
filtered[C.name] = A
var/selected = input(usr,"Select:","Condition") in filtered
var/selected_type = filtered[selected]
condition = new selected_type()
condition.setup(usr)
if (href_list["change_amt"])
var/amt = input(usr,"Select:","Amount", inj_amount) in list("ALL",1,5,10,20,30,40,50,75,100)
if(amt == "ALL")
inj_amount = -1
else
inj_amount = amt
if (href_list["change_mintime"])
var/amt = input(usr,"Select:","Min time in seconds", min_time) in list(3,4,5,6,7,8,9,10,20,30,40,50,60,120,180,300)
min_time = amt
updateUsrDialog()
attack_self(usr)
proc/check()
if(!is_equipped()) return
if(!active) return
if(condition && container && container.reagents.total_volume)
if(condition.check_trigger(owner) && can_trigger)
can_trigger = 0
spawn(min_time*10) can_trigger = 1
var/turf/T = get_turf(src)
if(T)
playsound(T,"sound/items/injectorbelt_active.ogg", 33, 0, -5)
spawn(5)
playsound(T,"sound/machines/hiss.ogg", 40, 1, -5)
boutput(owner, "<span style=\"color:blue\">Your [src] activates.</span>")
container.reagents.reaction(owner, INGEST)
spawn(15)
if(inj_amount == -1)
container.reagents.trans_to(owner, container.reagents.total_volume)
else
container.reagents.trans_to(owner, inj_amount)
spawn(25)
if (src) check()
proc/is_equipped()
if(!owner) return 0
if(hasvar(owner, "wear_mask"))
if(owner:wear_mask == src)
return 1
else
return 0
else
return 0
//////////////////////////////////////
/datum/injector_belt_condition
var/name = ""
var/desc = ""
proc/setup(mob/M)
return
proc/check_trigger(mob/M)
return 0
/datum/injector_belt_condition/health
name = "Condition: Health"
desc = "Triggers when health falls below a certain threshold."
var/threshold = 0
setup(mob/M)
var/th = input(M,"Select:","Health",threshold) in list(100,90,75,50,33,25,10,0)
threshold = th
desc = "Triggers when health falls below [threshold]."
return 1
check_trigger(mob/M)
if(M.health < threshold) return 1
else return 0
/datum/injector_belt_condition/damage
name = "Condition: Damage"
desc = "Triggers when a certain damage type exceeds a threshold."
var/threshold = 0
var/damagetype = "brute"
setup(mob/M)
var/dt = input(M,"Select:","Damage Type",damagetype) in list("brute","burn","toxin","oxygen")
damagetype = dt
var/th = input(M,"Select:","Threshold",threshold) in list(5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100)
threshold = th
desc = "Triggers when [damagetype] damage exceeds [threshold]."
return 1
check_trigger(mob/M)
switch(damagetype)
if("brute")
if(M.get_brute_damage() > threshold) return 1
if("burn")
if(M.get_burn_damage() > threshold) return 1
if("toxin")
if(M.get_toxin_damage() > threshold) return 1
if("oxygen")
if(M.get_oxygen_deprivation() > threshold) return 1
return 0
/datum/injector_belt_condition/tempdiff
name = "Condition: Temperature !="
desc = "Triggers when temperature reaches abnormal levels."
var/threshold = 307
setup(mob/M)
return 1
check_trigger(mob/M)
if(M.bodytemperature > threshold)
if((M.bodytemperature - threshold) > 20) return 1
else
if((threshold - M.bodytemperature) > 20) return 1
return 0
/datum/injector_belt_condition/tempover
name = "Condition: Temperature >"
desc = "Triggers when temperature rises above a certain threshold."
var/threshold = 315
setup(mob/M)
var/th = input(M,"Select:","Temperature",threshold) in list(315,375,400,450,500,550,600)
threshold = th
desc = "Triggers when temperature rises above [threshold]."
return 1
check_trigger(mob/M)
if(M.bodytemperature > threshold) return 1
else return 0
/datum/injector_belt_condition/tempunder
name = "Condition: Temperature <"
desc = "Triggers when temperature falls below a certain threshold."
var/threshold = 300
setup(mob/M)
var/th = input(M,"Select:","Temperature",threshold) in list(300,250,200,150,100,50,25)
threshold = th
desc = "Triggers when temperature falls below [threshold]."
return 1
check_trigger(mob/M)
if(M.bodytemperature < threshold) return 1
else return 0
/datum/injector_belt_condition/incapacitated
name = "Condition: Incapacitated"
desc = "Triggers when incapacitated."
setup(mob/M)
return 1
check_trigger(mob/M)
if(M.stunned || M.paralysis || M.weakened || M.stat == 1) return 1
else return 0
/datum/injector_belt_condition/life
name = "Condition: Death"
desc = "Triggers on Death."
setup(mob/M)
return 1
check_trigger(mob/M)
if(M.stat == 2) return 1
else return 0
+243
View File
@@ -0,0 +1,243 @@
// MASK WAS THAT MOVIE WITH THAT GUY WITH THE MESSED UP FACE. WHAT'S HIS NAME . . . JIM CARREY, I THINK.
/obj/item/clothing/mask
name = "mask"
icon = 'icons/obj/clothing/item_masks.dmi'
wear_image_icon = 'icons/mob/mask.dmi'
inhand_image_icon = 'icons/mob/inhand/hand_headgear.dmi'
var/obj/item/voice_changer/vchange = 0
body_parts_covered = HEAD
compatible_species = list("human", "monkey")
armor_value_melee = 2
cold_resistance = 5
heat_resistance = 5
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/voice_changer))
if (src.see_face)
user.show_text("You can't find a way to attach [W] where it isn't really, really obvious. That'd kinda defeat the purpose of putting [W] in there, wouldn't it?", "red")
return
else if (src.vchange)
user.show_text("[src] already has a voice changer in it!", "red")
return
else if (!src.see_face && !src.vchange)
user.show_text("You begin installing [W] into [src].", "blue")
if (!do_after(user, 20))
user.show_text("You were interrupted!", "red")
return
user.show_text("You install [W] into [src].", "green")
src.vchange = W
W.set_loc(src)
user.u_equip(W)
return
else if (istype(W, /obj/item/wirecutters))
if (src.vchange)
user.show_text("You begin removing [src.vchange] from [src].", "blue")
if (!do_after(user, 20))
user.show_text("You were interrupted!", "red")
return
user.show_text("You remove [src.vchange] from [src].", "green")
user.put_in_hand_or_drop(src.vchange)
src.vchange = null
return
else
return ..()
else
return ..()
/obj/item/clothing/mask/gas
name = "gas mask"
desc = "A close-fitting mask that can filter some environmental toxins or be connected to an air supply."
icon_state = "gas_mask"
c_flags = SPACEWEAR | COVERSMOUTH | COVERSEYES | MASKINTERNALS
w_class = 3.0
see_face = 0.0
item_state = "gas_mask"
protective_temperature = 500
heat_transfer_coefficient = 0.01
permeability_coefficient = 0.01
/obj/item/clothing/mask/moustache
name = "fake moustache"
desc = "Nobody will know who you are if you put this on. Nobody."
icon_state = "moustache"
item_state = "moustache"
see_face = 0.0
w_class = 1.0
is_syndicate = 1
mats = 2
armor_value_melee = 3
cold_resistance = 10
/obj/item/clothing/mask/gas/emergency
name = "emergency gas mask"
icon_state = "gas_alt"
item_state = "gas_alt"
/obj/item/clothing/mask/gas/swat
name = "SWAT Mask"
desc = "A close-fitting tactical mask that can filter some environmental toxins or be connected to an air supply."
icon_state = "swat"
armor_value_melee = 1
/obj/item/clothing/mask/gas/voice
name = "gas mask"
desc = "A close-fitting mask that can filter some environmental toxins or be connected to an air supply."
icon_state = "gas_alt"
item_state = "gas_alt"
//vchange = 1
is_syndicate = 1
mats = 6
New()
..()
src.vchange = new(src)
/obj/item/voice_changer
name = "voice changer"
desc = "This voice-modulation device will dynamically disguise your voice to that of whoever is listed on your identification card, via incredibly complex algorithms. Discretely fits inside most masks, and can be removed with wirecutters."
icon_state = "voicechanger"
is_syndicate = 1
mats = 6
/obj/item/clothing/mask/breath
desc = "A close-fitting mask that can be connected to an air supply but does not work very well in hard vacuum without a helmet."
name = "Breath Mask"
icon_state = "breath"
item_state = "breath"
c_flags = COVERSMOUTH | MASKINTERNALS
w_class = 2
protective_temperature = 420
heat_transfer_coefficient = 0.90
permeability_coefficient = 0.50
/obj/item/clothing/mask/gas/death_commando
name = "Death Commando Mask"
icon_state = "death_commando_mask"
item_state = "death_commando_mask"
armor_value_melee = 5
/obj/item/clothing/mask/clown_hat
name = "clown wig and mask"
desc = "Clowns are dumb and so are you for even considering wearing this."
icon_state = "clown"
item_state = "clown_hat"
see_face = 0.0
/obj/item/clothing/mask/medical
name = "medical mask"
desc = "This mask does not work very well in low pressure environments."
icon_state = "medical"
item_state = "medical"
c_flags = COVERSMOUTH | MASKINTERNALS
w_class = 2
protective_temperature = 420
/obj/item/clothing/mask/muzzle
name = "muzzle"
icon_state = "muzzle"
item_state = "muzzle"
c_flags = COVERSMOUTH
w_class = 2
desc = "You'd probably say something like 'Hello Clarice.' if you could talk while wearing this."
/obj/item/clothing/mask/surgical
name = "sterile mask"
desc = "Helps protect from viruses and bacteria."
icon_state = "sterile"
item_state = "sterile"
w_class = 1
c_flags = COVERSMOUTH
permeability_coefficient = 0.05
/obj/item/clothing/mask/surgical_shield
name = "surgical face shield"
desc = "For those really, <i>really</i> messy surgeries."
icon_state = "surgicalshield"
item_state = "surgicalshield"
w_class = 2
c_flags = COVERSMOUTH | COVERSEYES
protective_temperature = 420
heat_transfer_coefficient = 0.90
permeability_coefficient = 0.50
/obj/item/paper_mask
name = "unfinished paper mask"
icon = 'icons/obj/items.dmi'
icon_state = "domino"
inhand_image_icon = 'icons/mob/inhand/hand_headgear.dmi'
item_state = "domino"
desc = "A little mask, made of paper. It isn't gunna stay on anyone's face like this, though."
burn_point = 220
burn_output = 900
burn_possible = 1
health = 10
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/pen))
var/obj/item/pen/P = W
if (P.font_color)
boutput(user, "<span style=\"color:blue\">You scribble on the mask until it's filled in.</span>")
if (P.font_color)
src.color = P.font_color
else if (istype(W,/obj/item/cable_coil/))
boutput(user, "<span style=\"color:blue\">You attach the cable to the mask. Looks like you can wear it now.</span>")
var/obj/item/cable_coil/C = W
C.use(1)
var/obj/item/clothing/mask/paper/M = new /obj/item/clothing/mask/paper(src.loc)
user.put_in_hand_or_drop(M)
//M.set_loc(get_turf(src)) // otherwise they seem to just vanish into the aether at times
if (src.color)
M.color = src.color
qdel(src)
/obj/item/clothing/mask/paper
name = "paper mask"
desc = "A little mask, made of paper."
icon_state = "domino"
item_state = "domino"
see_face = 0.0
burn_point = 220
burn_output = 900
burn_possible = 1
health = 10
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/pen))
var/obj/item/pen/P = W
if (P.font_color)
boutput(user, "<span style=\"color:blue\">You scribble on the mask until it's filled in.</span>")
src.color = P.font_color
/obj/item/clothing/mask/melons
name = "Flimsy 'George Melons' Mask"
desc = "Haven't seen that fellow in a while."
icon_state = "melons"
item_state = "melons"
see_face = 0.0
/obj/item/clothing/mask/wrestling
name = "wrestling mask"
desc = "A mask that will greatly enhance your wrestling prowess! Not, like, <i>physically</i>, but mentally. In your heart. In your soul. Something like that."
icon_state = "silvermask"
item_state = "silvermask"
see_face = 0.0
black
icon_state = "blackmask"
item_state = "blackmask"
green
icon_state = "greenmask"
item_state = "greenmask"
blue
icon_state = "bluemask"
item_state = "bluemask"
/obj/item/clothing/mask/anime
name = "moeblob mask"
desc = "Looking at this thing gives you the heebie-jeebies. And a weird urge to go rob a bank, for some reason."
icon_state = "anime"
item_state = "anime"
see_face = 0.0
+99
View File
@@ -0,0 +1,99 @@
/*
/obj/item/clothing/suit/space/monkey
name = "Monkey EVA suit"
desc = "A space suit for monkey exploration!"
compatible_species = list("monkey")
icon_state = "space_monkey"
item_state = "space_monkey"
// TODO: code monkey suit usage!!!
*/
// this shit is lazy. I'm lazy. lazyyyy
/obj/item/clothing/under/monkey
name = "monkey jumpsuit"
desc = "A jumpsuit, for monkeys!"
icon = 'icons/mob/monkey.dmi'
wear_image_icon = 'icons/mob/monkey.dmi'
compatible_species = list("monkey")
cant_self_remove = 1
cant_other_remove = 1
monkey_clothes = 1
dropped(mob/user as mob)
..()
qdel(src)
blue
name = "blue monkey jumpsuit"
icon_state = "mrmuggles"
item_state = "mrmuggles"
pink
name = "pink monkey jumpsuit"
icon_state = "mrsmuggles"
item_state = "mrsmuggles"
yellow
name = "yellow monkey jumpsuit"
icon_state = "rathen"
item_state = "rathen"
green
name = "green monkey jumpsuit"
icon_state = "krimpus"
item_state = "krimpus"
/obj/item/clothing/suit/space/monkey
name = "monkey space suit"
desc = "A space suit for monkey exploration!"
icon = 'icons/mob/monkey.dmi'
wear_image_icon = 'icons/mob/monkey.dmi'
compatible_species = list("monkey")
icon_state = "space"
item_state = "space"
cant_self_remove = 1
cant_other_remove = 1
monkey_clothes = 1
dropped(mob/user as mob)
..()
qdel(src)
syndicate
name = "red monkey space suit"
icon_state = "syndicate"
item_state = "syndicate"
/obj/item/clothing/mask/monkey/horse_mask
name = "horse mask?"
desc = "Neigh?"
icon = 'icons/mob/monkey.dmi'
wear_image_icon = 'icons/mob/monkey.dmi'
compatible_species = list("monkey")
icon_state = "mutant"
item_state = "mutant"
cant_self_remove = 1
cant_other_remove = 1
monkey_clothes = 1
c_flags = SPACEWEAR | COVERSMOUTH | COVERSEYES
dropped(mob/user as mob)
..()
qdel(src)
/obj/item/clothing/head/monkey/paper_hat
name = "paper hat"
desc = "A little paper hat, aww!"
icon = 'icons/mob/monkey.dmi'
wear_image_icon = 'icons/mob/monkey.dmi'
compatible_species = list("monkey")
icon_state = "tanhony"
item_state = "tanhony"
cant_self_remove = 1
cant_other_remove = 1
monkey_clothes = 1
c_flags = SPACEWEAR
dropped(mob/user as mob)
..()
qdel(src)
+271
View File
@@ -0,0 +1,271 @@
// OMG SHOES
/obj/item/clothing/shoes
name = "shoes"
icon = 'icons/obj/clothing/item_shoes.dmi'
inhand_image_icon = 'icons/mob/inhand/hand_feethand.dmi'
wear_image_icon = 'icons/mob/feet.dmi'
var/chained = 0
compatible_species = list("human", "monkey")
protective_temperature = 500
heat_transfer_coefficient = 0.10
permeability_coefficient = 0.50
//cogwerks - burn vars
burn_point = 400
burn_output = 800
burn_possible = 1
health = 25
cold_resistance = 5
heat_resistance = 5
var/step_sound = null
attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/tank/air) || istype(W, /obj/item/tank/oxygen) || istype(W, /obj/item/tank/emergency_oxygen) || istype(W, /obj/item/tank/jetpack))
var/uses = 0
if(istype(W, /obj/item/tank/emergency_oxygen)) uses = 2
else if(istype(W, /obj/item/tank/air)) uses = 4
else if(istype(W, /obj/item/tank/oxygen)) uses = 4
else if(istype(W, /obj/item/tank/jetpack)) uses = 6
var/turf/T = get_turf(user)
var/obj/item/clothing/shoes/rocket/R = new/obj/item/clothing/shoes/rocket(T)
R.uses = uses
boutput(user, "<span style=\"color:blue\">You haphazardly kludge together some rocket shoes.</span>")
qdel(W)
qdel(src)
/obj/item/clothing/shoes/rocket
name = "rocket shoes"
desc = "A gas tank taped to some shoes. Brilliant. They also look kind of silly."
icon_state = "rocketshoes"
protective_temperature = 0
movement_speed_mod = 1
var/uses = 6
burn_possible = 0
module_research = list("efficiency" = 10)
/obj/item/clothing/shoes/sonic
name = "Sahnic the Bushpig's Shoes"
icon_state = "red"
desc = "Have got to go swiftly."
var/soniclevel = 9.999
var/soniclength = 50
var/sonicbreak = 0
movement_speed_mod = -10
protective_temperature = 1500
heat_transfer_coefficient = 0.01
/obj/item/clothing/shoes/sonic/abilities = list(/obj/ability_button/sonic)
/obj/ability_button/sonic
name = "Activate Shoes"
icon_state = "rocketshoes"
Click()
if(!the_item || !the_mob || !the_mob.canmove) return
var/obj/item/clothing/shoes/sonic/R = the_item
if(the_mob:shoes != the_item)
boutput(the_mob, "<span style=\"color:red\">You must be wearing the shoes to use them.</span>")
return
playsound(get_turf(the_mob), "sound/effects/bamf.ogg", 100, 1)
spawn(0)
for(var/i=0, i<R.soniclength, i++)
if(!the_mob) break
new/obj/effect/smoketemp(the_mob.loc)
if (!step(the_mob, the_mob.dir) && R.sonicbreak) break
sleep(10 - R.soniclevel)
/obj/effect/smoketemp
name = "smoke"
density = 0
anchored = 0
opacity = 0
icon = 'icons/effects/effects.dmi'
icon_state = "smoke"
New(var/atom/locnew)
src.set_loc(locnew)
spawn(10)
src.set_loc(null)
/obj/item/clothing/shoes/black
name = "black shoes"
icon_state = "black"
desc = "These shoes somewhat protect you from fire."
protective_temperature = 1500
heat_transfer_coefficient = 0.01
/obj/item/clothing/shoes/brown
name = "brown shoes"
icon_state = "brown"
desc = "Brown shoes, camouflage on this kind of station."
/obj/item/clothing/shoes/red
name = "red shoes"
icon_state = "red"
/obj/item/clothing/shoes/blue
name = "blue shoes"
icon_state = "blu"
/obj/item/clothing/shoes/orange
name = "orange shoes"
icon_state = "orange"
desc = "Shoes, now in prisoner orange! Can be made into shackles."
/obj/item/clothing/shoes/pink
name = "pink shoes"
icon_state = "pink"
/obj/item/clothing/shoes/orange/attack_self(mob/user as mob)
if (src.chained)
src.chained = null
src.cant_self_remove = 0
new /obj/item/handcuffs(get_turf(user))
src.name = "orange shoes"
src.icon_state = "orange"
src.desc = "Shoes, now in prisoner orange! Can be made into shackles."
return
/obj/item/clothing/shoes/orange/attackby(H as obj, loc)
if (istype(H, /obj/item/handcuffs) && !src.chained)
qdel(H)
src.chained = 1
src.cant_self_remove = 1
src.name = "shackles"
src.desc = "Used to restrain prisoners."
src.icon_state = "orange1"
return
/obj/item/clothing/shoes/magnetic
name = "magnetic shoes"
desc = "Keeps the wearer firmly anchored to the ground. Provided the ground is metal, of course."
icon_state = "magboots"
c_flags = NOSLIP
permeability_coefficient = 0.05
mats = 8
burn_possible = 0
module_research = list("efficiency" = 5, "engineering" = 5)
/obj/item/clothing/shoes/industrial
name = "mechanised boots"
desc = "Industrial-grade boots fitted with mechanised balancers and stabilisers to increase running speed under a heavy workload."
icon_state = "indboots"
permeability_coefficient = 0.05
mats = 12
movement_speed_mod = -3
burn_possible = 0
module_research = list("efficiency" = 5, "engineering" = 5, "mining" = 10)
/obj/item/clothing/shoes/white
name = "white shoes"
desc = "Protects you against biohazards that would enter your feet."
icon_state = "white"
permeability_coefficient = 0.25
/obj/item/clothing/shoes/galoshes
name = "galoshes"
desc = "Rubber boots that prevent slipping on wet surfaces."
icon_state = "galoshes"
c_flags = NOSLIP
permeability_coefficient = 0.05
/obj/item/clothing/shoes/clown_shoes
name = "clown shoes"
desc = "Damn, thems some big shoes."
icon_state = "clown"
item_state = "clown_shoes"
step_sound = "clownstep"
module_research = list("audio" = 5)
/obj/item/clothing/shoes/flippers
name = "flippers"
desc = "A pair of rubber flippers that improves swimming ability when worn."
icon_state = "flippers"
permeability_coefficient = 0.05
/obj/item/clothing/shoes/moon
name = "moon shoes"
desc = "Recent developments in trampoline-miniaturization technology have made these little wonders possible."
icon_state = "moonshoes"
mats = 2
equipped(var/mob/user, var/slot)
user.visible_message("<b>[user]</b> starts hopping around!","You start hopping around.")
src.moonloop(user)
return
unequipped(var/mob/user)
user.pixel_y = 0
..()
return
proc/moonloop(var/mob/user)
spawn(0)
while(user && !user.stat && user:shoes == src)
if(user.pixel_y < 12)
user.pixel_y += 3
sleep(1)
else
user.pixel_y -= 6
sleep(1)
if(user)
user.pixel_y = 0
return
/obj/item/clothing/shoes/cowboy
name = "Cowboy boots"
icon_state = "cowboy"
/obj/item/clothing/shoes/sandal
name = "magic sandals"
desc = "They magically stop you from slipping on magical hazards. It's not the mesh on the underside that does that. It's MAGIC. Read a fucking book."
icon_state = "wizard"
c_flags = NOSLIP
magical = 1
handle_other_remove(var/mob/source, var/mob/living/carbon/human/target)
. = ..()
if (prob(75))
source.show_message(text("<span style=\"color:red\">\The [src] writhes in your hands as though they are alive! They just barely wriggle out of your grip!</span>"), 1)
. = 0
/obj/item/clothing/shoes/tourist
name = "flip-flops"
desc = "These cheap sandals don't look very comfortable."
icon_state = "tourist"
protective_temperature = 0
heat_transfer_coefficient = 1
permeability_coefficient = 1
siemens_coefficient = 1
/obj/item/clothing/shoes/detective
name = "worn boots"
desc = "This pair of leather boots has seen better days."
icon_state = "detective"
/obj/item/clothing/shoes/chef
name = "chef's clogs"
desc = "Sturdy shoes that minimize injury from falling objects or knives."
icon_state = "chef"
armor_value_melee = 1
permeability_coefficient = 0.30
/obj/item/clothing/shoes/swat
name = "military boots"
desc = "Polished and very shiny military boots."
icon_state = "swat"
armor_value_melee = 1.5
permeability_coefficient = 0.20
protective_temperature = 1250
heat_transfer_coefficient = 0.03
+884
View File
@@ -0,0 +1,884 @@
// SUITS
/obj/item/clothing/suit
name = "leather jacket"
desc = "Made from real Space Bovine, but don't call it cowhide under penalty of Article 5.P3RG."
icon = 'icons/obj/clothing/overcoats/item_suit.dmi'
inhand_image_icon = 'icons/mob/inhand/overcoat/hand_suit.dmi'
wear_image_icon = 'icons/mob/overcoats/worn_suit.dmi'
icon_state = "ljacket"
item_state = "ljacket"
var/fire_resist = T0C+100
var/over_hair = 0
var/over_all = 0 // shows up over all other clothes/hair/etc on people
flags = FPRINT | TABLEPASS
armor_value_bullet = 1 // multiplier
armor_value_melee = 2
cold_resistance = 5
heat_resistance = 5
w_class = 3.0
/obj/item/clothing/suit/hoodie
name = "hoodie"
desc = "Nice and comfy on those cold space evenings."
icon_state = "hoodie"
item_state = "hoodie"
cold_resistance = 10
var/hood = 0
attack_self(mob/user as mob)
src.hood = !(src.hood)
user.show_text("You flip [src]'s hood [src.hood ? "up" : "down"].")
if (src.hood)
src.over_hair = 1
src.icon_state = "hoodie-up"
src.item_state = "hoodie-up"
else
src.over_hair = 0
src.icon_state = "hoodie"
src.item_state = "hoodie"
/obj/item/clothing/suit/bio_suit
name = "bio suit"
desc = "A suit that protects against biological contamination."
icon_state = "bio_suit"
item_state = "bio_suit"
icon = 'icons/obj/clothing/overcoats/item_suit_hazard.dmi'
wear_image_icon = 'icons/mob/overcoats/worn_suit_hazard.dmi'
inhand_image_icon = 'icons/mob/inhand/overcoat/hand_suit_hazard.dmi'
var/armored = 0
body_parts_covered = TORSO|LEGS|ARMS
permeability_coefficient = 0.01
heat_transfer_coefficient = 0.30
disease_resistance = 50
cold_resistance = 15
heat_resistance = 15
armor_value_bullet = 1.5
armor_value_melee = 2
over_hair = 1
/obj/item/clothing/suit/bio_suit/attackby(obj/item/W, mob/user)
var/turf/T = usr.loc
if(istype(W, /obj/item/clothing/suit/armor/vest))
boutput(usr, "<span style=\"color:blue\">You attach [W] to [src].</span>")
if (istype(src, /obj/item/clothing/suit/bio_suit/paramedic))
new/obj/item/clothing/suit/bio_suit/paramedic/armored(T)
else
new/obj/item/clothing/suit/bio_suit/armored(T)
qdel(W)
qdel(src)
/obj/item/clothing/suit/bio_suit/paramedic
name = "paramedic suit"
desc = "A protective padded suit for emergency response personnel. Offers limited thermal and biological protection."
icon_state = "paramedic"
item_state = "paramedic"
permeability_coefficient = 0.1
body_parts_covered = TORSO|LEGS|ARMS
protective_temperature = 3000
heat_transfer_coefficient = 0.05
armor_value_bullet = 1.9
armor_value_melee = 3
over_hair = 0
/obj/item/clothing/suit/bio_suit/armored
name = "armored bio suit"
desc = "A suit that protects against biological contamination. Somebody slapped some armor onto the chest."
icon_state = "armorbio"
item_state = "armorbio"
c_flags = ONESIZEFITSALL
armor_value_bullet = 2.5
armor_value_melee = 5
/obj/item/clothing/suit/bio_suit/armored/nt
name = "\improper NT bio suit"
desc = "An armored biosuit that protects against biological contamination and toolboxes."
icon_state = "ntbio"
item_state = "ntbio"
c_flags = ONESIZEFITSALL
armor_value_bullet = 2.5
armor_value_melee = 5
/obj/item/clothing/suit/bio_suit/paramedic/armored
name = "armored paramedic suit"
desc = "A protective padded suit for emergency response personnel. Offers limited thermal and biological protection. Somebody slapped some armor onto the chest."
icon_state = "para_armor"
item_state = "paramedic"
c_flags = ONESIZEFITSALL
armor_value_bullet = 2.9
armor_value_melee = 6
/obj/item/clothing/suit/space/suv
name = "\improper SUV suit"
desc = "Engineered to do some doohickey with radiation or something. Man this thing is cool."
icon = 'icons/obj/clothing/overcoats/item_suit_gimmick.dmi'
wear_image_icon = 'icons/mob/overcoats/worn_suit_gimmick.dmi'
inhand_image_icon = 'icons/mob/inhand/overcoat/hand_suit_gimmick.dmi'
icon_state = "hev"
item_state = "hev"
radproof = 1
c_flags = ONESIZEFITSALL | SPACEWEAR
body_parts_covered = TORSO|LEGS|ARMS
armor_value_bullet = 3
armor_value_melee = 5
/obj/item/clothing/suit/rad // re-added for Russian Station as there is a permarads area there!
name = "\improper Class II radiation suit"
desc = "An old Soviet radiation suit made of 100% space asbestos. It's good for you!"
icon_state = "rad"
item_state = "rad"
icon = 'icons/obj/clothing/overcoats/item_suit_hazard.dmi'
wear_image_icon = 'icons/mob/overcoats/worn_suit_hazard.dmi'
inhand_image_icon = 'icons/mob/inhand/overcoat/hand_suit_hazard.dmi'
radproof = 1
c_flags = ONESIZEFITSALL
body_parts_covered = TORSO|LEGS|ARMS
permeability_coefficient = 0.005
heat_transfer_coefficient = 0.10
movement_speed_mod = 0.6
armor_value_bullet = 1.5
armor_value_melee = 5
over_hair = 1
cold_resistance = 15
heat_resistance = 30
/obj/item/clothing/suit/det_suit
name = "coat"
desc = "Someone who wears this means business."
icon_state = "detective"
item_state = "det_suit"
body_parts_covered = TORSO|LEGS|ARMS
armor_value_bullet = 1.3
armor_value_melee = 2
/obj/item/clothing/suit/det_suit/beepsky
name = "worn jacket"
desc = "This tattered jacket has seen better days."
icon = 'icons/obj/clothing/overcoats/item_suit_armor.dmi'
wear_image_icon = 'icons/mob/overcoats/worn_suit_armor.dmi'
icon_state = "ntarmor"
armor_value_bullet = 1.3
armor_value_melee = 2
/obj/item/clothing/suit/judgerobe
name = "judge's robe"
desc = "This robe commands authority."
icon_state = "judge"
item_state = "judge"
body_parts_covered = TORSO|LEGS|ARMS
/obj/item/clothing/suit/chef
name = "chef's coat"
desc = "BuRK BuRK BuRK - Bork Bork Bork!"
icon_state = "chef"
item_state = "chef"
body_parts_covered = TORSO|LEGS|ARMS
heat_resistance = 10
/obj/item/clothing/suit/apron
name = "apron"
desc = "A protective frontal garment designed to guard clothing against spills."
icon_state = "sousapron"
item_state = "sousapron"
body_parts_covered = TORSO
permeability_coefficient = 0.70
/obj/item/clothing/suit/labcoat
name = "labcoat"
desc = "A suit that protects against minor chemical spills and biohazards."
icon_state = "labcoat"
item_state = "labcoat"
body_parts_covered = TORSO|ARMS
permeability_coefficient = 0.25
heat_transfer_coefficient = 0.75
cold_resistance = 15
heat_resistance = 15
/obj/item/clothing/suit/labcoat/genetics
name = "geneticist's labcoat"
desc = "A protective laboratory coat with the green markings of a Geneticist."
icon_state = "GNlabcoat"
item_state = "GNlabcoat"
april_fools
icon_state = "GNlabcoat-alt"
item_state = "GNlabcoat-alt"
/obj/item/clothing/suit/labcoat/robotics
name = "roboticist's labcoat"
desc = "A protective laboratory coat with the black markings of a Roboticist."
icon_state = "ROlabcoat"
item_state = "ROlabcoat"
april_fools
icon_state = "ROlabcoat-alt"
item_state = "ROlabcoat-alt"
/obj/item/clothing/suit/labcoat/medical
name = "doctor's labcoat"
desc = "A protective laboratory coat with the red markings of a Medical Doctor."
icon_state = "MDlabcoat"
item_state = "MDlabcoat"
april_fools
icon_state = "MDlabcoat-alt"
item_state = "MDlabcoat-alt"
/obj/item/clothing/suit/labcoat/science
name = "scientist's labcoat"
desc = "A protective laboratory coat with the purple markings of a Scientist."
icon_state = "SCIlabcoat"
item_state = "SCIlabcoat"
april_fools
icon_state = "SCIlabcoat-alt"
item_state = "SCIlabcoat-alt"
/obj/item/clothing/suit/straight_jacket
name = "straight jacket"
desc = "A suit that totally restrains an individual."
icon_state = "straight_jacket"
item_state = "straight_jacket"
body_parts_covered = TORSO|LEGS|ARMS
cold_resistance = 20
heat_resistance = 20
/obj/item/clothing/suit/wcoat
name = "waistcoat"
desc = "Style over abdominal protection."
icon_state = "vest"
item_state = "wcoat"
magical = 1
body_parts_covered = TORSO|ARMS
cold_resistance = 10
heat_resistance = 10
/obj/item/clothing/suit/bedsheet
name = "bedsheet"
desc = "A linen sheet used to cover yourself while you sleep. Preferably on a bed."
icon_state = "bedsheet"
item_state = "bedsheet"
layer = MOB_LAYER
throwforce = 1
w_class = 1
throw_speed = 2
throw_range = 10
c_flags = COVERSEYES | COVERSMOUTH
body_parts_covered = TORSO|ARMS
see_face = 0
over_hair = 1
over_all = 1
var/eyeholes = 0 //Did we remember to cut eyes in the thing?
var/cape = 0
var/obj/stool/bed/Bed = null
var/bcolor = null
//cogwerks - burn vars
burn_point = 450
burn_output = 800
burn_possible = 1
health = 20
cold_resistance = 10
rand_pos = 0
New()
..()
src.update_icon()
src.setMaterial(getCachedMaterial("cotton"))
attack_hand(mob/user as mob)
if (src.Bed)
src.Bed.untuck_sheet(user)
src.Bed = null
return ..()
ex_act(severity)
if (severity <= 2)
if (src.Bed && src.Bed.Sheet == src)
src.Bed.Sheet = null
qdel(src)
return
return
attack_self(mob/user as mob)
add_fingerprint(user)
var/choice = input(user, "What do you want to do with [src]?", "Selection") as null|anything in list("Place", "Rip up")
if (!choice)
return
switch (choice)
if ("Place")
user.drop_item()
src.layer = EFFECTS_LAYER_BASE-1
return
if ("Rip up")
boutput(user, "You begin ripping up [src].")
if (!do_after(user, 30))
boutput(user, "<span style=\"color:red\">You were interrupted!</span>")
return
else
for (var/i=3, i>0, i--)
new /obj/item/material_piece/cloth/cottonfabric(get_turf(src))
boutput(user, "You rip up [src].")
user.u_equip(src)
qdel(src)
return
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/wirecutters) || istype(W, /obj/item/scissors))
var/list/actions = list("Make bandages")
if (src.cape)
actions += "Cut cable"
else if (!src.eyeholes)
actions += "Cut eyeholes"
var/action = input(user, "What do you want to do with [src]?") as null|anything in actions
if (!action)
return
switch (action)
if ("Make bandages")
boutput(user, "You begin cutting up [src].")
if (!do_after(user, 30))
boutput(user, "<span style=\"color:red\">You were interrupted!</span>")
return
else
for (var/i=3, i>0, i--)
new /obj/item/bandage(get_turf(src))
playsound(src.loc, "sound/items/Scissor.ogg", 100, 1)
boutput(user, "You cut [src] into bandages.")
user.u_equip(src)
qdel(src)
return
if ("Cut cable")
src.cut_cape()
playsound(src.loc, "sound/items/Scissor.ogg", 100, 1)
boutput(user, "You cut the cable that's tying the bedsheet into a cape.")
return
if ("Cut eyeholes")
src.cut_eyeholes()
playsound(src.loc, "sound/items/Scissor.ogg", 100, 1)
boutput(user, "You cut eyeholes in the bedsheet.")
return
else if (istype(W, /obj/item/cable_coil))
if (src.cape)
return ..()
src.make_cape()
boutput(user, "You tie the bedsheet into a cape.")
return
else
return ..()
proc/update_icon()
if (src.cape)
src.icon_state = "bedcape[src.bcolor ? "-[bcolor]" : null]"
src.item_state = src.icon_state
see_face = 1
over_hair = 0
over_all = 0
else
src.icon_state = "bedsheet[src.bcolor ? "-[bcolor]" : null][src.eyeholes ? "1" : null]"
src.item_state = src.icon_state
see_face = 0
over_hair = 1
over_all = 1
proc/cut_eyeholes()
if (src.cape || src.eyeholes)
return
if (src.Bed && src.Bed.loc == src.loc)
src.Bed.untuck_sheet()
src.Bed = null
src.eyeholes = 1
src.update_icon()
desc = "It's a bedsheet with eye holes cut in it."
proc/make_cape()
if (src.cape)
return
if (src.Bed && src.Bed.loc == src.loc)
src.Bed.untuck_sheet()
src.Bed = null
src.cape = 1
src.update_icon()
desc = "It's a bedsheet that's been tied into a cape."
proc/cut_cape()
if (!src.cape)
return
if (src.Bed && src.Bed.loc == src.loc)
src.Bed.untuck_sheet()
src.Bed = null
src.cape = 0
src.update_icon()
desc = "A linen sheet used to cover yourself while you sleep. Preferably on a bed."
/obj/item/clothing/suit/bedsheet/red
icon_state = "bedsheet-red"
item_state = "bedsheet-red"
bcolor = "red"
/obj/item/clothing/suit/bedsheet/orange
icon_state = "bedsheet-orange"
item_state = "bedsheet-orange"
bcolor = "orange"
/obj/item/clothing/suit/bedsheet/yellow
icon_state = "bedsheet-yellow"
item_state = "bedsheet-yellow"
bcolor = "yellow"
/obj/item/clothing/suit/bedsheet/green
icon_state = "bedsheet-green"
item_state = "bedsheet-green"
bcolor = "green"
/obj/item/clothing/suit/bedsheet/blue
icon_state = "bedsheet-blue"
item_state = "bedsheet-blue"
bcolor = "blue"
/obj/item/clothing/suit/bedsheet/pink
icon_state = "bedsheet-pink"
item_state = "bedsheet-pink"
bcolor = "pink"
/obj/item/clothing/suit/bedsheet/black
icon_state = "bedsheet-black"
item_state = "bedsheet-black"
bcolor = "black"
/obj/item/clothing/suit/bedsheet/hop
icon_state = "bedsheet-hop"
item_state = "bedsheet-hop"
bcolor = "hop"
/obj/item/clothing/suit/bedsheet/captain
icon_state = "bedsheet-captain"
item_state = "bedsheet-captain"
bcolor = "captain"
/obj/item/clothing/suit/bedsheet/royal
icon_state = "bedsheet-royal"
item_state = "bedsheet-royal"
bcolor = "royal"
/obj/item/clothing/suit/bedsheet/psych
icon_state = "bedsheet-psych"
item_state = "bedsheet-psych"
bcolor = "psych"
/obj/item/clothing/suit/bedsheet/random
New()
..()
src.bcolor = pick("", "red", "orange", "yellow", "green", "blue", "pink", "black")
src.update_icon()
/obj/item/clothing/suit/bedsheet/cape
icon_state = "bedcape"
item_state = "bedcape"
cape = 1
/obj/item/clothing/suit/bedsheet/cape/red
icon_state = "bedcape-red"
item_state = "bedcape-red"
bcolor = "red"
cape = 1
/obj/item/clothing/suit/bedsheet/cape/orange
icon_state = "bedcape-orange"
item_state = "bedcape-orange"
bcolor = "orange"
cape = 1
/obj/item/clothing/suit/bedsheet/cape/yellow
icon_state = "bedcape-yellow"
item_state = "bedcape-yellow"
bcolor = "yellow"
cape = 1
/obj/item/clothing/suit/bedsheet/cape/green
icon_state = "bedcape-green"
item_state = "bedcape-green"
bcolor = "green"
cape = 1
/obj/item/clothing/suit/bedsheet/cape/blue
icon_state = "bedcape-blue"
item_state = "bedcape-blue"
bcolor = "blue"
cape = 1
/obj/item/clothing/suit/bedsheet/cape/pink
icon_state = "bedcape-pink"
item_state = "bedcape-pink"
bcolor = "pink"
cape = 1
/obj/item/clothing/suit/bedsheet/cape/black
icon_state = "bedcape-black"
item_state = "bedcape-black"
bcolor = "black"
cape = 1
/obj/item/clothing/suit/bedsheet/cape/hop
icon_state = "bedcape-hop"
item_state = "bedcape-hop"
bcolor = "hop"
cape = 1
/obj/item/clothing/suit/bedsheet/cape/captain
icon_state = "bedcape-captain"
item_state = "bedcape-captain"
bcolor = "captain"
cape = 1
/obj/item/clothing/suit/bedsheet/cape/royal
icon_state = "bedcape-royal"
item_state = "bedcape-royal"
bcolor = "royal"
cape = 1
/obj/item/clothing/suit/bedsheet/cape/psych
icon_state = "bedcape-psych"
item_state = "bedcape-psych"
bcolor = "psych"
cape = 1
// FIRE SUITS
/obj/item/clothing/suit/fire
name = "firesuit"
desc = "A suit that protects against fire and heat."
icon = 'icons/obj/clothing/overcoats/item_suit_hazard.dmi'
inhand_image_icon = 'icons/mob/inhand/overcoat/hand_suit_hazard.dmi'
wear_image_icon = 'icons/mob/overcoats/worn_suit_hazard.dmi'
icon_state = "fire"
item_state = "fire_suit"
permeability_coefficient = 0.50
body_parts_covered = TORSO|LEGS|ARMS
cold_resistance = 20
heat_resistance = 75
protective_temperature = 4500
heat_transfer_coefficient = 0.01
armor_value_bullet = 1.5
armor_value_melee = 3
/obj/item/clothing/suit/fire/armored
name = "armored firesuit"
desc = "A suit that protects against fire and heat. Somebody slapped some armor onto the chest."
icon_state = "fire_armor"
item_state = "fire_suit"
armor_value_bullet = 2.5
armor_value_melee = 6
/obj/item/clothing/suit/fire/attackby(obj/item/W, mob/user)
var/turf/T = user.loc
if (istype(W, /obj/item/clothing/suit/armor/vest))
if (istype(src, /obj/item/clothing/suit/fire/heavy) || istype(src, /obj/item/clothing/suit/fire/old))
return
else
new /obj/item/clothing/suit/fire/armored(T)
boutput(user, "<span style=\"color:blue\">You attach [W] to [src].</span>")
qdel(W)
qdel(src)
/obj/item/clothing/suit/fire/heavy
name = "heavy firesuit"
desc = "A suit that protects against extreme fire and heat."
icon_state = "thermal"
item_state = "thermal"
protective_temperature = 100000
heat_transfer_coefficient = 0.001
armor_value_bullet = 1.8
armor_value_melee = 4
/obj/item/clothing/suit/fire/old
name = "old firesuit"
desc = "Just looking at this thing makes your eyes take burn damage."
icon_state = "fire_old"
item_state = "fire_old"
// SWEATERS
/obj/item/clothing/suit/sweater
name = "diamond sweater"
desc = "A pretty warm-looking knit sweater. This is one of those I.N. designer sweaters."
icon = 'icons/obj/clothing/overcoats/item_suit_gimmick.dmi'
wear_image_icon = 'icons/mob/overcoats/worn_suit_gimmick.dmi'
inhand_image_icon = 'icons/mob/inhand/overcoat/hand_suit_gimmick.dmi'
icon_state = "sweater_blue"
item_state = "sweater_blue"
heat_transfer_coefficient = 0.25
body_parts_covered = TORSO|ARMS
cold_resistance = 20
red
name = "reindeer sweater"
icon_state = "sweater_red"
item_state = "sweater_red"
green
name = "snowflake sweater"
icon_state = "sweater_green"
item_state = "sweater_green"
grandma
name = "grandma sweater"
icon_state = "sweater_green"
item_state = "sweater_green"
desc = "A pretty warm-looking knit sweater, made by your grandma. Yes, YOUR grandma! Even if you stole this from someone else."
New()
..()
spawn(20)
src.name = initial(src.name)
src.material = new /datum/material/fabric/cloth/cotton ()
// SPACE SUITS
/obj/item/clothing/suit/space
name = "space suit"
desc = "A suit that protects against low pressure environments."
icon = 'icons/obj/clothing/overcoats/item_suit_hazard.dmi'
inhand_image_icon = 'icons/mob/inhand/overcoat/hand_suit_hazard.dmi'
wear_image_icon = 'icons/mob/overcoats/worn_suit_hazard.dmi'
icon_state = "space"
item_state = "s_suit"
c_flags = SPACEWEAR
body_parts_covered = TORSO|LEGS|ARMS
permeability_coefficient = 0.02
protective_temperature = 1000
heat_transfer_coefficient = 0.02
armor_value_bullet = 1.5
armor_value_melee = 3
disease_resistance = 50
cold_resistance = 50
heat_resistance = 20
over_hair = 1
/obj/item/clothing/suit/space/emerg
name = "emergency suit"
desc = "A suit that protects against low pressure environments for a short time."
icon_state = "emerg"
item_state = "emerg"
c_flags = SPACEWEAR
body_parts_covered = TORSO|LEGS|ARMS
permeability_coefficient = 0.04
protective_temperature = 800
heat_transfer_coefficient = 0.025
var/rip = 0
snow // bleh whatever!!!
name = "snow suit"
desc = "A thick padded suit that protects against extreme cold temperatures."
icon_state = "snowcoat"
item_state = "snowcoat"
rip = -1
/obj/item/clothing/suit/space/emerg/proc/ripcheck(var/mob/user)
if(rip >= 14 && rip != -1 && prob(10))
boutput(user, "<span style=\"color:red\">The emergency suit tears off!</span>")
var/turf/T = src.loc
if (ismob(T))
T = T.loc
src.set_loc(T)
user.u_equip(src)
spawn(5)
qdel(src)
/obj/item/clothing/suit/space/captain
name = "captain's space suit"
desc = "A suit that protects against low pressure environments and is green."
icon_state = "spacecap"
item_state = "spacecap"
blue
icon_state = "spacecap-blue"
item_state = "spacecap-blue"
red
icon_state = "spacecap-red"
item_state = "spacecap-red"
/obj/item/clothing/suit/space/syndicate
name = "red space suit"
icon_state = "syndicate"
item_state = "space_suit_syndicate"
desc = "A suit that protects against low pressure environments. Issued to syndicate operatives."
contraband = 3
/obj/item/clothing/suit/space/engineer
name = "engineering space suit"
desc = "An overly bulky space suit designed mainly for maintenance and mining."
icon_state = "espace"
item_state = "es_suit"
april_fools
icon_state = "espace-alt"
item_state = "espace-alt"
/obj/item/clothing/suit/space/industrial
name = "industrial space armor"
desc = "Very heavy armour for prolonged industrial activity. Protects from radiation and explosions."
icon_state = "indus"
item_state = "indus"
radproof = 1
c_flags = SPACEWEAR
body_parts_covered = TORSO|LEGS|ARMS
heat_transfer_coefficient = 0.02
mats = 15
armor_value_bullet = 1
armor_value_melee = 2
armor_value_explosion = 4
cold_resistance = 75
heat_resistance = 50
syndicate
name = "\improper Syndicate command armor"
desc = "An armored space suit, not for your average expendable chumps. No sir."
icon_state = "indusred"
item_state = "indusred"
/obj/item/clothing/suit/cultist
name = "cultist robe"
desc = "The unholy vestments of a cultist."
icon = 'icons/obj/clothing/overcoats/item_suit_gimmick.dmi'
wear_image_icon = 'icons/mob/overcoats/worn_suit_gimmick.dmi'
inhand_image_icon = 'icons/mob/inhand/overcoat/hand_suit_gimmick.dmi'
icon_state = "cultist"
item_state = "cultist"
see_face = 0
magical = 1
c_flags = COVERSEYES | COVERSMOUTH | SPACEWEAR
body_parts_covered = TORSO|LEGS|ARMS
armor_value_bullet = 1.5
armor_value_melee = 3
/obj/item/clothing/suit/cardboard_box
name = "cardboard box"
desc = "A pretty large box, made of cardboard. Looks a bit worn out."
icon_state = "c_box"
item_state = "c_box"
density = 1
see_face = 0
over_hair = 1
over_all = 1
c_flags = COVERSEYES | COVERSMOUTH
body_parts_covered = HEAD|TORSO|LEGS|ARMS
movement_speed_mod = 0.7
permeability_coefficient = 0.8
heat_transfer_coefficient = 0.5
armor_value_bullet = 1
armor_value_melee = 1
var/eyeholes = 0
var/moustache = 0
attack_hand(mob/user as mob)
if (user.a_intent == INTENT_HARM)
user.visible_message("<span style='color:blue'>[user] taps [src].</span>",\
"<span style='color:blue'>You tap [src].</span>")
else
return ..()
attackby(obj/item/W, mob/user)
if (istype(W, /obj/item/wirecutters) || istype(W, /obj/item/scissors))
if (src.eyeholes)
user.show_text("\The [src] already has eyeholes cut out of it!", "red")
return
user.visible_message("<span style='color:blue'>[user] begins cutting eyeholes out of [src].</span>",\
"<span style='color:blue'>You begin cutting eyeholes out of [src].</span>")
if (!do_after(user, 20))
user.show_text("You were interrupted!", "red")
return
playsound(get_turf(src), "sound/items/Scissor.ogg", 100, 1)
user.visible_message("<span style='color:blue'>[user] cuts eyeholes out of [src].</span>",\
"<span style='color:blue'>You cut eyeholes out of [src].</span>")
src.eyeholes = 1
src.icon_state = "[initial(src.icon_state)]e"
return
else if (istype(W, /obj/item/clothing/mask/moustache))
src.moustache = 1
src.UpdateOverlays(image(src.icon, "c_box-moustache"), "moustache")
if (src.wear_image)
src.wear_image.overlays += image(src.wear_image_icon, "c_box-moustache")
user.visible_message("<span style='color:blue'>[user] adds [W] to [src]!</span>",\
"<span style='color:blue'>You add [W] to [src]!</span>")
user.u_equip(W)
qdel(W)
return
else
return ..()
/obj/item/clothing/suit/cardboard_box/head_surgeon
name = "cardboard box - 'Head Surgeon'"
desc = "The HS looks a lot different today!"
icon_state = "c_box-HS"
item_state = "c_box-HS"
var/text2speech = 1
New()
..()
if (prob(50))
new /obj/machinery/bot/medbot/head_surgeon(src.loc)
qdel(src)
proc/speak(var/message)
if (!message)
return
src.audible_message("<span class='game say'><span class='name'>[src]</span> [pick("rustles", "folds", "womps", "boxes", "foffs", "flaps")], \"[message]\"")
if (src.text2speech)
var/audio = dectalk("\[:nk\][message]")
if (audio["audio"])
for (var/mob/O in hearers(src, null))
if (!O.client)
continue
ehjax.send(O.client, "browseroutput", list("dectalk" = audio["audio"]))
return 1
else
return 0
return
/obj/item/clothing/suit/cardboard_box/captain
name = "cardboard box - 'Captain'"
desc = "The Captain looks a lot different today!"
icon_state = "c_box-cap"
item_state = "c_box-cap"
/obj/item/clothing/suit/wizrobe
name = "blue wizard robe"
desc = "A traditional blue wizard's robe. It lacks all the stars and moons and stuff on it though."
icon_state = "wizard"
item_state = "wizard"
magical = 1
permeability_coefficient = 0.01
heat_transfer_coefficient = 0.01
body_parts_covered = TORSO|LEGS|ARMS
contraband = 4
handle_other_remove(var/mob/source, var/mob/living/carbon/human/target)
. = ..()
if ( . &&prob(75))
source.show_message(text("<span style=\"color:red\">\The [src] writhes in your hands as though it is alive! It just barely wriggles out of your grip!</span>"), 1)
. = 0
/obj/item/clothing/suit/wizrobe/red
name = "red wizard robe"
desc = "A very fancy and elegant red robe with gold trim."
icon_state = "wizardred"
item_state = "wizardred"
/obj/item/clothing/suit/wizrobe/purple
name = "purple wizard robe"
desc = "A real nice robe and cape, in purple, with blue and yellow accents."
icon_state = "wizardpurple"
item_state = "wizardpurple"
/obj/item/clothing/suit/wizrobe/necro
name = "necromancer robe"
desc = "A ratty stinky black robe for wizards who are trying way too hard to be menacing."
icon_state = "wizardnec"
item_state = "wizardnec"
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,267 @@
//ISaidNo and his Amazing AutoColor Jumpsuit
/*
/obj/item/clothing/under/autocolor
name = "black jumpsuit"
desc = "Standard issue Nanotrasen uniforms. Easy to dye and one size fits all."
icon_state = "plain"
overlaid = 1
// exceeding 200 on any of these vars tends to result in a garish mess, so yeah try not to do that
var/base_r = 0
var/base_g = 0
var/base_b = 0
var/detail_r = 0
var/detail_g = 0
var/detail_b = 0
proc/autojump_updateworldicon()
if (src.overlaid)
var/icon/coloroverlay1 = icon("icon" = 'icons/obj/clothing/uniforms/item_js.dmi', "icon_state" = text("[]-fx1", src.icon_state))
coloroverlay1.Blend(rgb(src.base_r, src.base_g, src.base_b), ICON_ADD)
src.overlays += image("icon" = coloroverlay1)
if (src.overlaid >= 2)
var/icon/coloroverlay2 = icon("icon" = 'icons/obj/clothing/uniforms/item_js.dmi', "icon_state" = text("[]-fx2", src.icon_state))
coloroverlay2.Blend(rgb(src.detail_r, src.detail_g, src.detail_b), ICON_ADD)
src.overlays += image("icon" = coloroverlay2)
New()
..()
src.autojump_updateworldicon()
attack_hand(var/mob/user as mob)
..()
src.autojump_updateworldicon()
dropped(mob/user as mob)
..()
src.autojump_updateworldicon()
/obj/item/clothing/under/autocolor/stripe
name = "striped jumpsuit"
icon_state = "stripe"
overlaid = 2
/obj/item/clothing/under/autocolor/jacket
name = "jacket jumpsuit"
icon_state = "qm"
overlaid = 2
/obj/item/clothing/under/autocolor/science
name = "laboratory jumpsuit"
icon_state = "sci"
overlaid = 2
base_r = 180
base_g = 180
base_b = 180
permeability_coefficient = 0.50
/obj/item/clothing/under/autocolor/red
name = "red jumpsuit"
base_r = 180
/obj/item/clothing/under/autocolor/orange
name = "orange jumpsuit"
base_r = 180
base_g = 80
/obj/item/clothing/under/autocolor/yellow
name = "yellow jumpsuit"
base_r = 180
base_g = 180
/obj/item/clothing/under/autocolor/green
name = "green jumpsuit"
base_g = 180
/obj/item/clothing/under/autocolor/cyan
name = "cyan jumpsuit"
base_g = 180
base_b = 180
/obj/item/clothing/under/autocolor/blue
name = "blue jumpsuit"
base_g = 80
base_b = 180
/obj/item/clothing/under/autocolor/indigo
name = "indigo jumpsuit"
base_b = 180
/obj/item/clothing/under/autocolor/purple
name = "purple jumpsuit"
base_b = 180
base_r = 80
/obj/item/clothing/under/autocolor/magenta
name = "magenta jumpsuit"
base_r = 180
base_b = 180
/obj/item/clothing/under/autocolor/white
name = "white jumpsuit"
base_r = 180
base_g = 180
base_b = 180
/obj/item/clothing/under/autocolor/grey
name = "grey jumpsuit"
base_r = 100
base_g = 100
base_b = 100
/obj/item/clothing/under/autocolor/random
name = "strange jumpsuit"
desc = "The fuck kinda color is this?"
New()
base_r = rand(0,190)
base_g = rand(0,190)
base_b = rand(0,190)
..()
/obj/item/clothing/under/autocolor/stripe/engineer
name = "engineer's jumpsuit"
base_r = 180
base_g = 150
detail_r = 160
detail_g = 70
/obj/item/clothing/under/autocolor/stripe/mechanic
name = "mechanic's jumpsuit"
base_r = 180
base_g = 150
detail_b = 160
detail_g = 70
/obj/item/clothing/under/autocolor/stripe/atmos
name = "atmospheric technician's jumpsuit"
base_r = 180
base_g = 150
detail_b = 180
detail_g = 180
/obj/item/clothing/under/autocolor/stripe/techassist
name = "technical assistant's jumpsuit"
base_r = 100
base_g = 100
base_b = 100
detail_r = 180
detail_g = 150
/obj/item/clothing/under/autocolor/stripe/miner
name = "miner's jumpsuit"
base_r = 180
base_g = 150
/obj/item/clothing/under/autocolor/stripe/botanist
name = "botanist's jumpsuit"
base_r = 140
base_g = 70
base_b = 40
detail_g = 150
/obj/item/clothing/under/autocolor/stripe/random
name = "strange jumpsuit"
desc = "Who the hell dyed this thing? A blind clown?"
New()
base_r = rand(0,190)
base_g = rand(0,190)
base_b = rand(0,190)
detail_r = rand(0,190)
detail_g = rand(0,190)
detail_b = rand(0,190)
..()
/obj/item/clothing/under/autocolor/jacket/qm
name = "quartermaster's jumpsuit"
base_r = 140
base_g = 140
base_b = 140
detail_r = 170
detail_g = 120
/obj/item/clothing/under/autocolor/jacket/janitor
name = "janitor's jumpsuit"
base_r = 140
base_g = 140
base_b = 140
detail_r = 80
detail_b = 80
/obj/item/clothing/under/autocolor/jacket/security
name = "security officer's jumpsuit"
base_r = 100
detail_r = 180
/obj/item/clothing/under/autocolor/jacket/forensics
name = "forensic technician's jumpsuit"
base_r = 140
base_g = 140
base_b = 140
detail_r = 140
/obj/item/clothing/under/autocolor/jacket/random
name = "strange jumpsuit"
desc = "It's like Cthulhu took a shit on a rainbow. Jesus christ."
New()
base_r = rand(0,190)
base_g = rand(0,190)
base_b = rand(0,190)
detail_r = rand(0,190)
detail_g = rand(0,190)
detail_b = rand(0,190)
..()
/obj/item/clothing/under/autocolor/science/medic
name = "medical doctor's jumpsuit"
detail_r = 180
/obj/item/clothing/under/autocolor/science/genetics
name = "geneticist's jumpsuit"
detail_b = 160
detail_g = 80
/obj/item/clothing/under/autocolor/science/scientist
name = "scientist's jumpsuit"
detail_r = 140
detail_b = 140
/obj/item/clothing/under/autocolor/science/chemist
name = "chemist's jumpsuit"
detail_b = 130
/obj/item/clothing/under/autocolor/science/robotics
name = "roboticist's jumpsuit"
base_r = 0
base_g = 0
base_b = 0
detail_r = 180
/obj/item/clothing/under/autocolor/science/medassist
name = "medical assistant's jumpsuit"
base_r = 100
base_g = 100
base_b = 100
detail_r = 180
/obj/item/clothing/under/autocolor/science/hos
name = "head of security's jumpsuit"
base_r = 180
base_g = 0
base_b = 0
detail_r = 180
detail_g = 160
detail_b = 0
/obj/item/clothing/under/autocolor/science/random
name = "strange jumpsuit"
desc = "Ah, the methodology of throwing random paint at a jumpsuit."
New()
base_r = rand(0,190)
base_g = rand(0,190)
base_b = rand(0,190)
detail_r = rand(0,190)
detail_g = rand(0,190)
detail_b = rand(0,190)
..()
/// END OF AUTOCOLOR JUMPSUITS
*/
+291
View File
@@ -0,0 +1,291 @@
/*
CONTAINS:
BANANA PEEL
BIKE HORN
HARMONICA
VUVUZELA
*/
/obj/item/bananapeel
name = "Banana Peel"
desc = "A peel from a banana."
icon = 'icons/obj/items.dmi'
icon_state = "banana_peel"
item_state = "banana_peel"
w_class = 1.0
throwforce = 0
throw_speed = 4
throw_range = 20
stamina_damage = 5
stamina_cost = 5
stamina_crit_chance = 5
var/mob/living/carbon/human/last_touched
/obj/item/bananapeel/attack_hand(var/mob/user)
last_touched = user
..()
/obj/item/bananapeel/HasEntered(AM as mob|obj)
if(istype(src.loc, /turf/space))
return
if (iscarbon(AM))
var/mob/M = AM
if (!M.can_slip())
return
M.pulling = null
boutput(M, "<span style=\"color:blue\">You slipped on the banana peel!</span>")
if (ishuman(M))
var/mob/living/carbon/human/H = M
if (H.sims)
H.sims.affectMotive("fun", -10)
if (H == last_touched)
H.sims.affectMotive("fun", -10)
if (istype(last_touched) && (last_touched in viewers(src)) && last_touched != M)
if (last_touched.sims)
last_touched.sims.affectMotive("fun", 10)
playsound(src.loc, "sound/misc/slip.ogg", 50, 1, -3)
if(M.bioHolder.HasEffect("clumsy"))
M.stunned = 8
M.weakened = 5
else
M.weakened = 2
/obj/item/bikehorn
name = "Bike Horn"
desc = "A horn off of a bicycle."
icon = 'icons/obj/instruments.dmi'
icon_state = "bike_horn"
item_state = "bike_horn"
throwforce = 3
w_class = 1.0
throw_speed = 3
throw_range = 15
var/spam_flag = 0
var/sound_horn = 'sound/items/bikehorn.ogg'
stamina_damage = 5
stamina_cost = 5
var/volume = 50
var/randomized_pitch = 1
var/spam_timer = 20
module_research = list("audio" = 8)
dramatic
name = "Dramatic Bike Horn"
desc = "SHIT FUCKING PISS COCK IT'S SO RAW"
sound_horn = 'sound/effects/dramatic.ogg'
volume = 100
randomized_pitch = 0
spam_timer = 30
mats = 2
/obj/item/bikehorn/attackby(obj/item/W as obj, mob/user as mob)
if (!istype(W, /obj/item/parts/robot_parts/arm/))
..()
return
else
var/obj/machinery/bot/duckbot/D = new /obj/machinery/bot/duckbot
var/icon/new_icon = icon('icons/obj/aibots.dmi', "duckbot")
D.icon = new_icon
D.eggs = rand(2,5) // LAY EGG IS TRUE!!!
boutput(user, "<span style=\"color:blue\">You add the arm to the horn.</span>")
D.set_loc(get_turf(user))
qdel(W)
qdel(src)
/obj/item/bikehorn/dramatic/attackby(obj/item/W as obj, mob/user as mob)
if (!istype(W, /obj/item/parts/robot_parts/arm/))
..()
return
else
var/obj/machinery/bot/chefbot/D = new /obj/machinery/bot/chefbot
//var/icon/new_icon = icon('icons/obj/aibots.dmi', "duckbot")
boutput(user, "<span style=\"color:blue\">You add the arm to the horn.</span>")
D.set_loc(get_turf(user))
qdel(W)
qdel(src)
/obj/item/bikehorn/attack_self(mob/user as mob)
if (spam_flag == 0)
if (ishuman(user))
var/mob/living/carbon/human/H = user
if (H.sims)
H.sims.affectMotive("fun", 5)
spam_flag = 1
if (narrator_mode)
src.sound_horn = 'sound/vox/honk.ogg'
playsound(get_turf(src), sound_horn, volume, randomized_pitch)
src.add_fingerprint(user)
spawn(spam_timer)
spam_flag = 0
return
/obj/item/bikehorn/is_detonator_attachment()
return 1
/obj/item/bikehorn/detonator_act(event, var/obj/item/assembly/detonator/det)
switch (event)
if ("pulse")
playsound(det.attachedTo.loc, 'sound/items/bikehorn.ogg', 50, 1)
if ("cut")
det.attachedTo.visible_message("<span class='bold' style='color: #B7410E;'>The honking stops.</span>")
det.attachments.Remove(src)
if ("process")
var/times = rand(1,5)
for (var/i = 1, i <= times, i++)
spawn(4*i)
playsound(det.attachedTo.loc, 'sound/items/bikehorn.ogg', 50, 1)
if ("prime")
for (var/i = 1, i < 15, i++)
spawn(3*i)
playsound(det.attachedTo.loc, 'sound/items/bikehorn.ogg', 500, 1)
/obj/item/harmonica
name = "harmonica"
desc = "A cheap pocket instrument, good for helping time to pass."
icon = 'icons/obj/instruments.dmi'
icon_state = "harmonica"
item_state = "r_shoes"
throwforce = 3
w_class = 1.0
throw_speed = 3
throw_range = 15
var/spam_flag = 0
var/list/sounds_harmonica = list('sound/items/harmonica1.ogg', 'sound/items/harmonica2.ogg', 'sound/items/harmonica3.ogg')
stamina_damage = 2
stamina_cost = 2
module_research = list("audio" = 7)
/obj/item/harmonica/attack_self(mob/user as mob)
if (spam_flag == 0)
if (ishuman(user))
var/mob/living/carbon/human/H = user
if (H.sims)
H.sims.affectMotive("fun", 5)
spam_flag = 1
user.visible_message("<B>[user]</B> plays a [pick("delightful", "chilling", "upbeat")] tune with \his harmonica!")
playsound(src.loc, pick(src.sounds_harmonica), 50, 1)
for(var/obj/critter/dog/george/G in range(user,6))
if(prob(60))
G.howl()
src.add_fingerprint(user)
spawn(20)
spam_flag = 0
return
/obj/item/whistle
name = "whistle"
desc = "A whistle. Good for getting attention."
icon = 'icons/obj/instruments.dmi'
icon_state = "whistle"
item_state = "r_shoes"
throwforce = 3
w_class = 1.0
throw_speed = 3
throw_range = 15
var/spam_flag = 0
var/sound_whistle = list('sound/items/whistle.ogg')
stamina_damage = 2
stamina_cost = 2
module_research = list("audio" = 3)
/obj/item/whistle/attack_self(mob/user as mob)
if (spam_flag == 0)
if (ishuman(user))
var/mob/living/carbon/human/H = user
if (H.sims)
H.sims.affectMotive("fun", 5)
spam_flag = 1
user.visible_message("<span style=\"color:red\"><B>[user]</B> blows [src]!</span>")
playsound(src.loc, src.sound_whistle, 35, 1)
for(var/obj/critter/dog/george/G in range(user,6))
if(prob(60))
G.howl()
src.add_fingerprint(user)
spawn(20)
spam_flag = 0
return
/obj/item/whistle/suicide(var/mob/user as mob)
user.visible_message("<span style=\"color:red\"><b>[user] swallows the [src.name]. \He begins to choke, the [src.name] sounding shrilly!</b></span>")
user.take_oxygen_deprivation(175)
user.updatehealth()
//fuck it that'll do
var/whistlesound = src.sound_whistle //so we can still use it when the whistle is deleted
playsound(user.loc, whistlesound, 35, 1)
spawn(20)
if(prob(50))
playsound(user.loc, whistlesound, 35, 1)
spawn(40)
if(prob(50))
playsound(user.loc, whistlesound, 35, 1)
spawn(60)
if(prob(50))
playsound(user.loc, whistlesound, 35, 1)
spawn(80)
if(prob(50))
playsound(user.loc, whistlesound, 35, 1)
spawn(100)
if(prob(50))
playsound(user.loc, whistlesound, 35, 1)
if (user)
user.suiciding = 0
qdel(src)
return 1
/obj/item/vuvuzela
name = "vuvuzela"
desc = "A loud horn made popular at soccer games-BZZZZZZZZZZZZZZZZZZZZZZZZZZZ"
icon = 'icons/obj/instruments.dmi'
icon_state = "vuvuzela"
item_state = "bike_horn"
throwforce = 3
var/spam_flag = 0
var/sound_vuvuzela = 'sound/items/vuvuzela.ogg'
stamina_damage = 6
stamina_cost = 6
stamina_crit_chance = 1
module_research = list("audio" = 7)
/obj/item/vuvuzela/attack_self(mob/user as mob)
if (spam_flag == 0)
if (ishuman(user))
var/mob/living/carbon/human/H = user
if (H.sims)
H.sims.affectMotive("fun", 5)
spam_flag = 1
for (var/mob/M in hearers(user, null))
var/ED = max(0, rand(0, 2) - get_dist(user, M))
M.take_ear_damage(ED)
boutput(M, text("<FONT size=[] color='red'>BZZZZZZZZZZZZZZZZZZZ!</FONT>", max(0, ED)))
playsound(src.loc, src.sound_vuvuzela, 80, 1)
for(var/obj/critter/dog/george/G in range(user,6))
if(prob(60))
G.howl()
src.add_fingerprint(user)
spawn(35)
spam_flag = 0
return
/obj/item/vuvuzela/is_detonator_attachment()
return 1
/obj/item/vuvuzela/detonator_act(event, var/obj/item/assembly/detonator/det)
switch (event)
if ("pulse")
playsound(det.attachedTo.loc, "sound/items/vuvuzela.ogg", 50, 1)
if ("cut")
det.attachedTo.visible_message("<span class='bold' style='color: #B7410E;'>The buzzing stops.</span>")
det.attachments.Remove(src)
if ("process")
if (prob(45))
var/times = rand(1,5)
for (var/i = 1, i <= times, i++)
spawn(4*i)
playsound(det.attachedTo.loc, "sound/items/vuvuzela.ogg", 50, 1)
if ("prime")
for (var/i = 1, i < 15, i++)
spawn(4*i)
playsound(det.attachedTo.loc, "sound/items/vuvuzela.ogg", 500, 1)
+57
View File
@@ -0,0 +1,57 @@
/obj/item/coin
name = "coin"
desc = "A small gold coin with an alien head on one side and a monkey buttocks on the other."
icon = 'icons/obj/items.dmi'
icon_state = "coin"
item_state = "coin"
w_class = 1.0
stamina_damage = 1
stamina_cost = 1
module_research = list("vice" = 3, "efficiency" = 1)
module_research_type = /obj/item/coin
/obj/item/coin/attack_self(mob/user as mob)
boutput(user, "<span style=\"color:blue\">You flip the coin</span>")
spawn(10)
if(prob(49))
boutput(user, "<span style=\"color:blue\">It comes up heads</span>")
else if(prob(49))
boutput(user, "<span style=\"color:blue\">It comes up tails</span>")
else
boutput(user, "<span style=\"color:red\">It lands on its side, fuck</span>")
/obj/item/coin/throw_impact(atom/hit_atom)
..(hit_atom)
if(prob(49))
src.visible_message("<span style=\"color:blue\">The coin comes up heads</span>")
else if(prob(49))
src.visible_message("<span style=\"color:blue\">The coin comes up tails</span>")
else
src.visible_message("<span style=\"color:blue\">The coin lands on its side</span>")
/obj/item/coin_bot
name = "Probability Disc"
desc = "A small golden disk of some sort. Possibly used in highly complex quantum experiments."
icon = 'icons/obj/items.dmi'
icon_state = "coin"
item_state = "coin"
w_class = 1.0
attack_self(var/mob/user as mob)
playsound(src.loc, "sound/misc/coindrop.ogg", 100, 1)
if (prob(50))
user.visible_message("[src] shows Heads.")
else
user.visible_message("[src] shows Tails.")
/obj/item/coin/suicide(var/mob/user as mob)
user.visible_message("<span style=\"color:red\"><b>[user] swallows the [src.name] and begins to choke!</b></span>")
user.take_oxygen_deprivation(175)
user.updatehealth()
spawn(100)
if (user)
user.suiciding = 0
qdel(src)
return 1
+139
View File
@@ -0,0 +1,139 @@
/obj/item/ctf_flag
name = "Flag"
desc = "Its a flag"
w_class = 5
icon = 'icons/misc/flags.dmi'
icon_state = "flag_neutral"
item_state = "paper"
/obj/item/ctf_flag/red
name = "The Red Flag"
desc = "Catch dat fukken flag"
icon_state = "flag_red"
/obj/item/ctf_flag/green
name = "The Green Flag"
desc = "Catch dat fukken flag"
icon_state = "flag_green"
/obj/item/ctf_flag/New()
..()
spawn(200)
process()
return
/obj/item/ctf_flag/process()
if(istype(src, /obj/item/ctf_flag/green))
var/obj/L = locate("landmark*Green-Flag")
if(locate("landmark*Green-Flag", src))
spawn(200)
process()
return
else if(!src.check_if_equipped() && L)
new /obj/item/ctf_flag/green(L.loc)
qdel(src)
if(istype(src, /obj/item/ctf_flag/red))
var/obj/L = locate("landmark*Red-Flag")
if(locate("landmark*Red-Flag", src))
spawn(200)
process()
return
else if(!src.check_if_equipped() && L)
new /obj/item/ctf_flag/red(L.loc)
qdel(src)
return
/obj/item/ctf_flag/proc/check_if_equipped()
var/equipped = 0
for(var/mob/M in mobs)
if(M &&!M.stat)
var/list/L = M.get_contents()
if(src in L)
equipped = 1
break
return equipped
/obj/machinery/red_injector
name = "Red Team Flag Injector"
desc = "Insert flag here"
anchored = 1
density = 1
var/score = 0
var/operating = 0
icon = 'icons/misc/flags.dmi'
icon_state = "red_injector"
/*
/obj/machinery/red_injector/ex_act(severity)
return
/obj/machinery/red_injector/attackby(var/obj/item/ctf_flag/C, mob/user)
if(src.operating)
boutput(user, "Cannot put a flag in right now")
return
src.operating = 1
if(istype(C, /obj/item/ctf_flag/green))
if(locate("landmark*Red-Flag", /obj/item/ctf_flag/red))
src.score++
boutput(world, "<B>[user.real_name] has scored for the red team!</B>")
if(ticker && ticker.mode && istype(ticker.mode, /datum/game_mode/ctf))
ticker.red_score++
var/obj/L = locate("landmark*Green-Flag")
if (L)
qdel(C)
new /obj/item/ctf_flag/green(L.loc)
else
boutput(world, "No green flag spawn point detected")
if(src.score >= 15)
boutput(world, "<FONT size = 3><B>The Red Team has won!</B></FONT>")
boutput(world, "<B>They have scored [score] times with the flag!</B>")
sleep(300)
world.Reboot()
else
boutput(user, "<span style=\"color:red\">You need to have your flag in the beginning position!</span>")
else if(istype(C, /obj/item/ctf_flag/red))
boutput(world, "<B>[user.real_name] has tried to score with their own flag! Idiot!</B>")
src.operating = 0
return
*/
/obj/machinery/green_injector
name = "Green Team Flag Injector"
desc = "Insert flag here"
anchored = 1
density = 1
var/operating = 0
var/score = 0
icon = 'icons/misc/flags.dmi'
icon_state = "green_injector"
/obj/machinery/green_injector/ex_act(severity)
return
/*
/obj/machinery/green_injector/attackby(var/obj/item/ctf_flag/C, mob/user)
if(src.operating)
boutput(user, "Cannot put a flag in right now")
return
src.operating = 1
if(istype(C, /obj/item/ctf_flag/red))
if(locate("landmark*Green-Flag", /obj/item/ctf_flag/green))
src.score++
boutput(world, "<B>[user.real_name] has scored for the green team!</B>")
if(ticker && ticker.mode && istype(ticker.mode, /datum/game_mode/ctf))
ticker.green_score++
var/obj/L = locate("landmark*Red-Flag")
if (L)
qdel(C)
new /obj/item/ctf_flag/red(L.loc)
else
boutput(world, "No red flag spawn point detected")
if(src.score >= 15)
boutput(world, "<FONT size = 3><B>The Green Team has won!</B></FONT>")
boutput(world, "<B>They have scored [score] times with the flag!</B>")
sleep(300)
world.Reboot()
else
boutput(user, "<span style=\"color:red\">You need to have your flag in the beginning position!</span>")
else if(istype(C, /obj/item/ctf_flag/green))
boutput(world, "<B>[user.real_name] has tried to score with their own flag! Idiot!</B>")
src.operating = 0
return
*/
+57
View File
@@ -0,0 +1,57 @@
/obj/item/decoration
icon = 'icons/obj/decoration.dmi'
flags = FPRINT | TABLEPASS
w_class = 2.0
/obj/item/decoration/flower_vase
name = "flower vase"
desc = "Some pretty flowers that really brighten up the room."
icon_state = "vase"
/obj/item/decoration/ashtray
name = "ashtray"
icon = 'icons/obj/cigarettes.dmi'
icon_state = "ashtray"
w_class = 1.0
var/butts = 0 // heh
New()
..()
src.update_icon()
attack_self(mob/user as mob)
if (src.butts)
user.visible_message("<b>[user]</b> tips out [src] onto the floor.",\
"You tip out [src] onto the floor.")
var/turf/T = get_turf(src)
new /obj/decal/cleanable/ash(T)
for (var/i = 0, i < src.butts, i++)
new /obj/item/cigbutt(T)
src.butts = 0 // pff
src.update_icon()
src.overlays = null
attackby(obj/item/W, mob/user)
if (istype(W, /obj/item/clothing/mask/cigarette) && W:lit)
W:put_out(user, "<b>[user]</b> puts out [W] in [src].")
user.u_equip(W)
qdel(W)
src.butts ++ // hehhh
src.update_icon()
src.overlays = null
src.overlays += "ashtray-smoke"
spawn(800)
src.overlays -= "ashtray-smoke"
else
return ..()
proc/update_icon()
if (src.butts <= 0)
src.icon_state = "ashtray"
else if (src.butts == 1)
src.icon_state = "ashtray2"
else if (src.butts == 2)
src.icon_state = "ashtray3"
else
src.icon_state = "ashtray4"
+364
View File
@@ -0,0 +1,364 @@
/obj/item/audio_tape
name = "compact tape"
desc = "A small audio tape. You could make some rad mix-tapes with this!"
icon = 'icons/obj/device.dmi'
icon_state = "recordertape"
w_class = 1.0
mats = 3
var/log_line = 1 //Which line of the log it's on.
var/max_lines = 60
var/list/messages = list()
var/list/speakers = list()
proc
add_message(speaker="Unknown",message, continuous)
if (!speaker || !message)
return 0
if (!continuous && (log_line >= max_lines))
return 0
log_line++
messages += "[message]"
speakers += "[speaker]"
if (continuous && (log_line > max_lines))
messages.Cut(1,2)
speakers.Cut(1,2)
log_line = messages.len
return 1
get_message(continuous)
if (log_line > messages.len)
if (continuous && messages.len)
log_line = 1
else
return null
return "[speakers.len < log_line ? "Unknown" : speakers[log_line]]|[messages[log_line]]"
next(continuous)
if (log_line >= messages.len)
if (continuous && messages.len)
log_line = 1
else
return 0
log_line++
return 1
reset()
if (messages)
messages.len = 0
else
messages = list()
if (speakers)
speakers.len = 0
else
speakers = list()
src.log_line = 1
return
use_percentage()
if (!messages)
return 0
return round((messages.len / max_lines) * 100)
/obj/item/device/audio_log
name = "Audio log"
desc = "A fairly spartan recording device."
icon_state = "recorder"
item_state = "electronic"
w_class = 2.0
var/obj/item/audio_tape/tape = null
var/mode = 0 //1 recording, 2 playing back
var/max_lines = 60
var/continuous = 1
var/list/audiolog_messages = list()
var/list/audiolog_speakers = list()
var/self_destruct = 0 //This message will self-destruct in five seconds...
mats = 4
//nuclear mode briefing log
nuke_briefing
name = "Mission Briefing"
desc = "The standard for covert mission briefing."
continuous = 0
//self_destruct = 1
New(newloc, var/nuke_area)
..()
if(!nuke_area)
nuke_area = "an unknown area. I think mission control fucked up somewhere."
src.audiolog_messages += "Your mission this time is simple, team."
src.audiolog_messages += "NanoTrasen has been causing us significant trouble recently."
src.audiolog_messages += "You are to detonate their station with a nuclear device."
src.audiolog_messages += "You must arm the bomb in [nuke_area]. Good luck and god speed."
src.audiolog_speakers.len = src.audiolog_messages.len
if (!src.tape)
src.tape = new /obj/item/audio_tape(src)
src.tape.messages = src.audiolog_messages
src.audiolog_messages = null
src.tape.speakers = src.audiolog_speakers
src.audiolog_speakers = null
return
//researchstat log #1
researchstat_log
name = "Bloody log"
desc = "There's blood on it."
continuous = 0
New(newloc)
..()
audiolog_speakers += "Scientist #1"
src.audiolog_messages += "Earlier today we began research on the Artifact recovered by our exploration team."
audiolog_speakers += "Scientist #1"
src.audiolog_messages += "It looks pretty unremarkable by all standards, but we've been getting some very strange readings."
audiolog_speakers += "Scientist #1"
src.audiolog_messages += "There seems to be some sort of energy source in it but our scans show nothing."
audiolog_speakers += "Scientist #1"
src.audiolog_messages += "When I say nothing, I mean literally nothing. There seems to be nothing AT ALL in it."
audiolog_speakers += "Scientist #1"
src.audiolog_messages += "Some crew members have reported strange noises on the station ever since we recovered the artifact, but I'm su---"
audiolog_speakers += "*static*"
src.audiolog_messages += "ZZZZZZZZZZZZZZZZZZZZZZZ"
src.audiolog_speakers.len = src.audiolog_messages.len
return
wjam_office_log
continuous = 0
audiolog_messages = list("Must I remind you, Dr. Garriott, that you are under contract?",
"You weren't there! You didn't see what I-",
"Your tone is not appreciated. If you are unable to control yourself I suggest you leave.",
"In fact, I insist. Our business is concluded-",
"Speak with me face to face you son of a bitch!",
"So you can murder me with whatever plague you have engineered in my labs? Using MY funds?",
"If you are not willing to leave I will have security escort you out, with neither suit nor shuttle to shield you.",
"Think carefully, Bruce.")
audiolog_speakers = list("Willard Jam",
"Dr. Garriott",
"Willard Jam",
"Willard Jam",
"Dr. Garriott",
"Willard Jam",
"Willard Jam",
"Willard Jam")
wall_mounted
name = "Mounted Logger"
desc = "A wall-mounted audio log device."
max_lines = 30
attack_hand(mob/user as mob)
return attack_self(user)
updateSelfDialog()
return updateUsrDialog()
attack_self(mob/user as mob)
..()
if (user.stat || user.restrained() || user.lying)
return
if ((user.contents.Find(src) || user.contents.Find(src.master) || get_dist(src, user) <= 1 && istype(src.loc, /turf)))
user.machine = src
var/dat = "<TT><b>Audio Logger</b><br>"
if (src.tape)
dat += "Memory [src.tape.use_percentage()]% Full -- <a href='byond://?src=\ref[src];command=eject'>Eject</a><br>"
else
dat += "No Tape Loaded<br>"
dat += "<table cellspacing=5><tr>"
dat += "<td><a href='byond://?src=\ref[src];command=rec'>[src.mode == 1 ? "Recording" : "Not Recording"]</a></td>"
dat += "<td><a href='byond://?src=\ref[src];command=play'>[src.mode == 2 ? "Playing" : "Not Playing"]</a></td>"
dat += "<td><a href='byond://?src=\ref[src];command=stop'>Stop</a></td>"
dat += "<td><a href='byond://?src=\ref[src];command=clear'>Clear Log</a></td>"
dat += "<td><a href='byond://?src=\ref[src];command=continuous_mode'>[continuous ? "Looping" : "No Loop"]</a></td></table></tt>"
user << browse(dat, "window=audiolog;size=400x140")
onclose(user, "audiolog")
else
user << browse(null, "window=audiolog")
user.machine = null
return
attackby(obj/item/I as obj, mob/user as mob)
if (istype(I, /obj/item/audio_tape))
if (src.tape)
boutput(user, "There is already a tape loaded.")
return
user.drop_item()
I.set_loc(src)
src.tape = I
src.tape.log_line = 1
src.icon_state = initial(src.icon_state)
src.updateSelfDialog()
user.visible_message("[user] loads a tape into [src].", "You load a tape into [src].")
else
..()
New()
..()
spawn(10)
if (!src.tape)
src.tape = new /obj/item/audio_tape(src)
if (src.audiolog_messages && src.audiolog_messages.len)
src.tape.messages = src.audiolog_messages
src.audiolog_messages = null
if (src.audiolog_speakers && src.audiolog_speakers.len)
src.tape.speakers = src.audiolog_speakers
src.audiolog_speakers = null
Topic(href, href_list)
..()
if (usr.stat || usr.restrained() || usr.lying)
return
if ((usr.contents.Find(src) || usr.contents.Find(src.master) || in_range(src, usr) && istype(src.loc, /turf)))
usr.machine = src
switch(href_list["command"])
if("rec")
src.mode = 1
processing_items.Remove(src)
if("play")
src.mode = 2
if (!(src in processing_items))
processing_items.Add(src)
if("stop")
src.mode = 0
processing_items.Remove(src)
if (src.tape)
src.tape.log_line = 1
if("clear")
src.mode = 0
processing_items.Remove(src)
if (src.tape)
src.tape.reset()
//src.audiolog_messages = list()
//src.audiolog_speakers = list()
if ("continuous_mode")
continuous = !continuous
if("eject")
src.mode = 0
processing_items.Remove(src)
src.icon_state = "[initial(src.icon_state)]-empty"
src.tape.set_loc(get_turf(src))
src.tape.log_line = 1
src.tape = null
src.add_fingerprint(usr)
src.updateSelfDialog()
else
usr << browse(null, "window=audiolog")
return
return
hear_talk(var/mob/living/carbon/speaker, messages, real_name, lang_id)
if ((src.mode != 1) || !src.tape)
return
if (speaker.mind && speaker.mind.assigned_role == "Captain")
speaker.unlock_medal("Captain's Log", 1)
var/speaker_name = speaker.real_name
if (real_name)
speaker_name = real_name
if(ishuman(speaker) && speaker.wear_mask && speaker.wear_mask.vchange)//istype(speaker.wear_mask, /obj/item/clothing/mask/gas/voice))
if(speaker:wear_id)
speaker_name = speaker:wear_id:registered
else
speaker_name = "Unknown"
var/message = (lang_id == "english" || lang_id == "") ? messages[1] : messages[2]
if (src.tape.add_message(speaker_name, message, continuous) == 0)
src.speak(src.name, "Memory full. Have a nice day.")
src.mode = 0
processing_items.Remove(src)
src.updateSelfDialog()
return
process()
if((mode != 2) || !src.tape)
src.mode = 0
processing_items.Remove(src)
src.updateSelfDialog()
if(src.self_destruct)
spawn(20)
src.explode()
return
var/speak_message = tape.get_message(continuous)
if (!speak_message)
src.mode = 0
processing_items.Remove(src)
src.updateSelfDialog()
if(src.self_destruct)
spawn(20)
src.explode()
return
var/separator = findtext(speak_message,"|")
if (!separator)
src.mode = 0
processing_items.Remove(src)
src.updateSelfDialog()
if(src.self_destruct)
spawn(20)
src.explode()
return
var/speaker = copytext(speak_message, 1, separator)
speak_message = copytext(speak_message, separator+1)
src.speak(speaker, speak_message)
if (!src.tape.next(continuous))
src.mode = 0
processing_items.Remove(src)
src.updateSelfDialog()
return
proc
speak(speaker, message)
if(!message)
return
if(!speaker)
speaker = "Unknown"
for(var/mob/O in all_hearers(5, src.loc))
O.show_message("<span class='game radio'><span class='name'>[speaker]</span><b> [bicon(src)]\[Log\]</b> <span class='message'>\"[message]\"</span></span>",2)
return
explode()
var/turf/T = get_turf(src.loc)
if (ismob(src.loc))
var/mob/M = src.loc
M.show_message("<span style=\"color:red\">Your [src] explodes!</span>", 1)
if(T)
T.hotspot_expose(700,125)
explosion(src, T, -1, -1, 2, 3)
qdel(src)
return
+344
View File
@@ -0,0 +1,344 @@
/obj/item/device/brainjar
name = "janky assembly"
desc = "What the fuck is this!?"
icon_state = "tb-blue"
w_class = 3
var/mob/living/intangible/brainmob/controller = null
var/obj/item/organ/brain/the_brain = null
var/obj/item/device/radio/rad = null
var/obj/item/device/radio/signaler/signal = null
var/obj/item/assembly/detonator/detonator_part = null
var/colour = "blue"
var/list/icon/overlays_list = list()
var/crafting_stage = 0
var/crafting_stage_max = 5
New()
..()
overlays_list["wires"] = new /icon('icons/obj/device.dmi', "bjwires")
overlays_list["radio"] = new /icon('icons/obj/device.dmi', "bjradio")
overlays_list["analyzer"] = new /icon('icons/obj/device.dmi', "bjhealthanalyzer")
overlays_list["head_01"] = new /icon('icons/obj/device.dmi', "head-nobrain")
overlays_list["head_00"] = new /icon('icons/obj/device.dmi', "head-nobrain-unpow")
overlays_list["head_11"] = new /icon('icons/obj/device.dmi', "head-brain")
overlays_list["head_10"] = new /icon('icons/obj/device.dmi', "head-brain-unpow")
controller = new(src)
controller.container = src
/*
rad = new(src)
*/
update_controller_verbs()
update_icon()
disposing()
if(controller)
controller.ghostize()
..()
Del()
if(controller)
controller.ghostize()
..()
complete
New()
rad = new(src)
crafting_stage = crafting_stage_max
..()
complete/signaller
New()
signal = new(src.controller)
..()
proc/set_appearance(var/colour="blue")
if(colour in list("blue", "red", "green", "yellow"))
src.colour = colour
update_icon()
. = 1
proc/update_controller_verbs()
if(rad)
src.verbs |= /obj/item/device/brainjar/proc/control_radio
else
src.verbs -= /obj/item/device/brainjar/proc/control_radio
if(signal)
src.verbs |= /obj/item/device/brainjar/proc/control_signaller
else
src.verbs -= /obj/item/device/brainjar/proc/control_signaller
if(detonator_part)
src.verbs |= /obj/item/device/brainjar/proc/control_canister_detonator
src.verbs |= /obj/item/device/brainjar/proc/expedite_canbomb_detonation
else
src.verbs -= /obj/item/device/brainjar/proc/control_canister_detonator
src.verbs -= /obj/item/device/brainjar/proc/expedite_canbomb_detonation
if(istype(src.master, /obj/item/device/transfer_valve))
src.verbs |= /obj/item/device/brainjar/proc/detonate_tank_transfer_valve
else
src.verbs -= /obj/item/device/brainjar/proc/detonate_tank_transfer_valve
proc/update_icon()
icon_state = "tb-[colour]"
overlays.Cut()
if(crafting_stage > 0)
overlays += overlays_list["wires"]
if(crafting_stage > 1)
overlays += overlays_list["analyzer"]
if(signal) //Is there a remote signalling device attached?
overlays += overlays_list["radio"]
overlays += overlays_list["head_[!isnull(the_brain)][crafting_stage >= 4]"]
if(crafting_stage < crafting_stage_max)
name = "janky assembly"
switch(crafting_stage)
if(0)
desc = "A cyborg's head affixed to a toolbox. Must be some kind of art."
if(1)
desc = "A cyborg's head affixed to a toolbox. Someone's put wires all over it. Huh."
if(2)
desc = "A toolbox containing a health analyzer and a cyborg's head. All components have been butchered horribly. <I>You hope objects can't feel pain.</I>"
if(3)
desc = "A toolbox containing a health analyzer and a cyborg's head. Someone has flashed a custom OS on that analyzer. What the f..."
if(4)
desc = "This looks decidedly unsafe!"
else
name = "Brain Assembly"
desc = "A mess of wires and speakers. It looks <B>extremely</B> unethical."
/obj/item/device/brainjar/attackby(var/obj/item/W, var/mob/user)
if(crafting_stage < crafting_stage_max)
switch(crafting_stage)
if(0)
if(istype(W, /obj/item/cable_coil))
var/obj/item/cable_coil/C = W
if(C.use(5))
user.show_text("You attach the wires to the cyborg head and secure them to the assembly. Needs a monitoring tool before it'll work, by all appearances.", "blue")
playsound(src.loc, "sound/weapons/Genhit.ogg", 20, 1)
crafting_stage = 1
update_icon()
else
user.show_text("There's not enough wire on \the [C]!.", "red")
return
if(1)
if(istype(W, /obj/item/device/healthanalyzer))
var/grump_text = prob(90) ? "The health analyzer isn't configured to support this, however." : "The health analyzer beeps grumpily; it didn't sign up for this shit!"
user.show_text("You wire up the sensors on the analyzer and connect the mental interface to the i/o port. [grump_text]", "blue")
user.u_equip(W)
qdel(W)
crafting_stage = 2
update_icon()
return
if(2)
if (istype(W, /obj/item/device/multitool))
user.show_text("You use the multitool to root the health analyzer, voiding the warranty! Probably won't be enough to power the assembly, though.", "blue")
playsound(src.loc, "sound/effects/brrp.ogg", 50, 1)
crafting_stage = 3
return
if(3)
if (istype(W, /obj/item/cell))
user.show_text("You attach \the [W] to the assembly. It drones slightly. Won't do much good without a comms interface, however.", "blue")
playsound(src.loc, "sound/weapons/Genhit.ogg", 20, 1)
user.u_equip(W)
qdel(W)
crafting_stage = 4
update_icon()
return
if(4)
if(istype(W, /obj/item/device/radio))
user.show_text("You hook up \the [W] to the assembly. It emits a loud screech!", "blue")
var/bad_noise = pick("sound/machines/glitch1.ogg", "sound/machines/glitch2.ogg", "sound/machines/glitch3.ogg", "sound/machines/glitch4.ogg", "sound/machines/glitch5.ogg")
playsound(src.loc, bad_noise, 50, 1)
user.u_equip(W)
rad = W
W.set_loc(src)
crafting_stage = 5
update_controller_verbs()
return
if(5)
user.show_text("Oh shit. Something went wrong. Roll 1d20 to cast Summon Coder.", "red")
return
..()
else
//Shit what is done after the assembly is complete
if(istype(W, /obj/item/organ/brain)) //Insert a brain into the assembly
if(crafting_stage < crafting_stage_max)
user.show_text("The assembly is not ready for \the [W] yet", "red")
return
if(the_brain)
user.show_text("There's already a brain inserted into \the [src]!", "red")
return
var/obj/item/organ/brain/B = W
if(B.owner && !B.owner.dnr)
the_brain = B
user.u_equip(B)
B.set_loc(src)
B.owner.transfer_to(controller)
user.show_text("You install \the [B] in \the [src].", "blue")
logTheThing("combat", user, controller, "installs %target% into a brain assembly!")
update_icon()
else
user.show_text("This brain seems unfit to use in the assembly.", "red")
update_controller_verbs()
return
else if(istype(W, /obj/item/device/radio/signaler)) //Insert a signaller
if(crafting_stage < 3)
user.show_text("The assembly is not ready for \the [W] yet", "red")
return
if(signal)
user.show_text("A remote signalling device is already installed in \the [src]", "red")
return
signal = W
user.u_equip(W)
W.set_loc(controller)
user.show_text("You hook up \the [W] to \the [src].", "blue")
update_controller_verbs()
update_icon()
return
else ..()
/obj/item/device/brainjar/is_detonator_attachment()
return crafting_stage >= crafting_stage_max && src.the_brain
/obj/item/device/brainjar/detonator_act(event, var/obj/item/assembly/detonator/det)
switch (event)
if("attach")
detonator_part = det
controller.show_text("You interface with the detonator assembly controls.", "blue")
update_controller_verbs()
if("detach")
detonator_part = null
controller.show_text("You are disconnected from the detonator assembly!", "red")
update_controller_verbs()
if ("pulse")
controller.say("[pick("BZ", "FZ", "GZ")][pick("A", "U", "O")][pick("P", "T", "ZZ")]")
playsound(get_turf(src), 'sound/voice/robot_scream.ogg', 10, 1)
if ("cut")
controller.show_text("You no longer feel connected to the [det]!", "red")
playsound(get_turf(src), 'sound/voice/robot_scream.ogg', 70, 1)
detonator_part = null
update_controller_verbs()
/obj/item/device/brainjar/hear_talk(mob/M as mob, text, real_name, lang_id)
if(!controller || M == controller) return
var/heardname = real_name ? M.name : real_name
var/rendered = "<span class='game say'>[heardname] <span class='message'>[M.say_quote(text[1])]</span></span>"
controller.show_message(rendered, 2)
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VERBS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/obj/item/device/brainjar/proc/control_radio()
set name = "Control Radio"
set desc = "Allows you to edit the settings of the assembly's built-in radio"
set category = "Brain Jar"
set src = usr.loc
if(!src.rad)
controller.show_text("Interface failure with the radio!", "red")
return
src.rad.attack_self(controller)
/obj/item/device/brainjar/proc/control_signaller()
set name = "Control Signaller"
set desc = "Allows you to edit the settings of the assembly's built-in remote signalling device"
set category = "Brain Jar"
set src = usr.loc
if(!src.signal)
controller.show_text("Interface failure with the remote signalling device!", "red")
return
src.signal.attack_self(controller)
/obj/item/device/brainjar/proc/control_canister_detonator()
set name = "Detonator Controls"
set desc = "Lets you control the various settings of the canister bomb."
set category = "Brain Jar"
set src = usr.loc
if(!src.detonator_part)
controller.show_text("Interface failure with the canister bomb!", "red")
return
if(!src.detonator_part.attachedTo)
controller.show_text("\The [detonator_part] is inert without a canister to attach it to!", "red")
return
src.detonator_part.attachedTo.attack_hand(controller)
/obj/item/device/brainjar/proc/expedite_canbomb_detonation()
set name = "Expedite detonation!"
set desc = "Man, this is taking way too long!"
set category = "Brain Jar"
set src = usr.loc
if(!src.detonator_part)
controller.show_text("Interface failure with the canister bomb!")
return
if(!src.detonator_part.attachedTo)
controller.show_text("\The [detonator_part] is inert without a canister to attach it to!", "red")
return
if(alert("Are you sure you want to expedite the detonation?", "Bomb controls.", "Yes", "No") != "Yes") return
var/obj/item/assembly/detonator/det = src.detonator_part
if(istype(det))
if(det.part_fs)
if(det.part_fs.time <= 10)
src.controller.show_text("It's less than ten seconds left until the bomb blows up!", "red")
return
var/timing = det.part_fs.timing
det.part_fs.time = 10
det.failsafe_engage()
if(timing)
AIviewers(get_turf(src)) << "<span style=\"color:red\"><B>The [src] accelerates the priming process! <I>There are only 10 seconds left!!</I></B></span>"
/obj/item/device/brainjar/proc/detonate_tank_transfer_valve()
set name = "Detonate bomb!"
set desc = "Fulfill your destiny."
set category = "Brain Jar"
set src = usr.loc
if(!istype(src.master, /obj/item/device/transfer_valve))
boutput(usr, "<span style='color:red;'>Interface failure with the valve controls!</span>")
return
var/obj/item/device/transfer_valve/TV = src.master
if(alert("Blow up?", "im bomb.", "Yes", "No") != "Yes") return
if(TV.valve_open)
controller.show_text("The valve is already open, simmer down, feller.", "red")
return
controller.show_text("You open the valve on \the [TV]! [prob(20) ? "This is gonna be good!" : null]")
TV.toggle_valve()
logTheThing("bombing", controller, null, "opened the valve on a tank-transfer bomb.")
+42
View File
@@ -0,0 +1,42 @@
/obj/item/device/camera_viewer
name = "Camera monitor"
desc = "A portable video monitor connected to a security camera network."
icon_state = "monitor"
item_state = "electronic"
w_class = 2.0
var/network = "SS13"
var/obj/machinery/camera/current = null
mats = 6
attack_self(mob/user as mob)
user.machine = src
user.unlock_medal("Peeping Tom", 1)
var/list/L = list()
for (var/obj/machinery/camera/C in machines)
L.Add(C)
L = camera_sort(L)
var/list/D = list()
D["Cancel"] = "Cancel"
for (var/obj/machinery/camera/C in L)
if (C.network == src.network)
D[text("[][]", C.c_tag, (C.status ? null : " (Deactivated)"))] = C
var/t = input(user, "Which camera should you change to?") as null|anything in D
if(!t || t == "Cancel")
user.set_eye(null)
return 0
var/obj/machinery/camera/C = D[t]
if ((!user.contents.Find(src) || !( user.canmove ) || !user.sight_check(1) || !( C.status )) && (!istype(user, /mob/living/silicon)))
user.set_eye(null)
return 0
else
user.set_eye(C)
spawn(5)
attack_self(user)
+279
View File
@@ -0,0 +1,279 @@
/obj/dummy/chameleon
name = ""
desc = ""
density = 0
anchored = 1
soundproofing = -1
var/can_move = 1
var/obj/item/device/chameleon/master = null
UpdateName()
src.name = "[name_prefix(null, 1)][src.real_name][name_suffix(null, 1)]"
attackby()
// drsingh for cannot execute null.disrupt
if (isnull(master))
return
for (var/mob/M in src)
boutput(M, "<span style=\"color:red\">Your chameleon-projector deactivates.</span>")
if (isnull(master))
return
master.disrupt()
attack_hand()
// drsingh for cannot execute null.disrupt
if (isnull(master))
return
for (var/mob/M in src)
boutput(M, "<span style=\"color:red\">Your chameleon-projector deactivates.</span>")
if (isnull(master))
return
master.disrupt()
ex_act(var/severity)
// drsingh for cannot execute null.disrupt
if (isnull(master))
return
if (isnull(master))
return
for (var/mob/M in src)
boutput(M, "<span style=\"color:red\">Your chameleon-projector deactivates.</span>")
M.ex_act(severity) //Fuck you and your TTBs.
if(master)
master.disrupt()
else
qdel(src)
bullet_act()
// drsingh for cannot execute null.disrupt
if (isnull(master))
return
for (var/mob/M in src)
boutput(M, "<span style=\"color:red\">Your chameleon-projector deactivates.</span>")
if (isnull(master))
return
master.disrupt()
relaymove(var/mob/user, direction)
if (can_move)
can_move = 0
spawn (10)
can_move = 1
step(src,direction)
return
/obj/item/device/chameleon
name = "chameleon-projector"
icon_state = "shield0"
flags = FPRINT | TABLEPASS| CONDUCT | EXTRADELAY | ONBELT | SUPPRESSATTACK
item_state = "electronic"
throwforce = 5.0
throw_speed = 1
throw_range = 5
w_class = 2.0
var/can_use = 0
var/obj/overlay/anim = null //The toggle animation overlay will also be retained
var/obj/dummy/chameleon/cham = null //No sense creating / destroying this
var/active = 0
is_syndicate = 1
mats = 14
New()
..()
src.anim = new /obj/overlay(src)
src.anim.icon = 'icons/effects/effects.dmi'
src.cham = new (src)
src.cham.master = src
dropped()
disrupt()
attack_self()
toggle()
get_desc(dist)
if (dist < 1 && !istype(src, /obj/item/device/chameleon/bomb))
if (can_use && cham)
. += "There is a small picture of \a [cham] on its screen."
else
. += "The screen on it is blank."
/*
examine()
..()
var/out = ""
if (can_use && cham)
out = "There is a small picture of \a [cham] on its screen."
else
out = "The screen on it is blank."
boutput(usr, "<span style=\"color:blue\">[out]</span>")
return null
*/
afterattack(atom/target, mob/user , flag)
scan(target, user)
proc/scan(obj/target, mob/user)
if (get_dist(src, target) > 1)
if (user && ismob(user))
user.show_text("You are too far away to do that.", "red")
return
//Okay, enough scanning shit without actual icons yo.
if (!isnull(initial(target.icon)) && !isnull(initial(target.icon_state)) && target.icon && target.icon_state && (istype(target, /obj/item) || istype(target, /obj/shrub) || istype(target, /obj/critter) || istype(target, /obj/machinery/bot))) // cogwerks - added more fun
if (!cham)
cham = new(src)
cham.master = src
playsound(src, "sound/weapons/flash.ogg", 100, 1, 1)
boutput(user, "<span style=\"color:blue\">Scanned [target].</span>")
cham.name = target.name
cham.real_name = target.name
cham.desc = target.desc
cham.real_desc = target.desc
cham.icon = target.icon
cham.icon_state = target.icon_state
cham.dir = target.dir
can_use = 1
else
user.show_text("\The [target] is not compatible with the scanner.", "red")
proc/toggle()
if (!can_use)
return
if (!anim)
anim = new(src)
if (active) //active_dummy)
active = 0
playsound(src, "sound/effects/pop.ogg", 100, 1, 1)
for (var/atom/movable/A in cham)
A.set_loc(get_turf(cham))
cham.loc = src
boutput(usr, "<span style=\"color:blue\">You deactivate the [src].</span>")
anim.loc = get_turf(src)
flick("emppulse",anim)
spawn (8)
anim.loc = src //Back in the box with ye
else
if (istype(src.loc, /obj/dummy/chameleon)) //No recursive chameleon projectors!!
boutput(usr, "<span style=\"color:red\">As your finger nears the power button, time seems to slow, and a strange silence falls. You reconsider turning on a second projector.</span>")
return
playsound(src, "sound/effects/pop.ogg", 100, 1, 1)
cham.master = src
cham.set_loc(get_turf(src))
usr.set_loc(cham)
src.active = 1
boutput(usr, "<span style=\"color:blue\">You activate the [src].</span>")
anim.loc = get_turf(src)
flick("emppulse",anim)
spawn (8)
anim.loc = src //Back in the box with ye
proc/disrupt()
if (active)
active = 0
var/datum/effects/system/spark_spread/spark_system = unpool(/datum/effects/system/spark_spread)
spark_system.set_up(5, 0, src)
spark_system.attach(src)
spark_system.start()
for (var/atom/movable/A in cham)
A.set_loc(get_turf(cham))
cham.loc = src
can_use = 0
spawn (100)
can_use = 1
/obj/item/device/chameleon/bomb
name = "chameleon bomb"
icon = 'icons/obj/items.dmi'
icon_state = "cham_bomb"
burn_possible = 0
var/strength = 32 // same as syndie pipebombs, calls the same proc
dropped()
return
UpdateName()
src.name = "[name_prefix(null, 1)][src.real_name][name_suffix(null, 1)]"
attackby(obj/item/W as obj, mob/user as mob)
if (src.active)
if (user)
message_admins("[key_name(user)] triggers a chameleon bomb ([src]) by hitting it with [W] at [log_loc(user)].")
logTheThing("bombing", user, null, "triggers a chameleon bomb ([src]) by hitting it with [W] at [log_loc(user)].")
src.disrupt()
else
return ..()
attack_hand(var/mob/user)
if (src.active && isturf(loc))
message_admins("[key_name(user)] picks up and triggers a chameleon bomb ([src]) at [log_loc(user)].")
logTheThing("bombing", user, null, "picks up and triggers a chameleon bomb ([src]) at [log_loc(user)].")
src.disrupt()
else
return ..()
ex_act()
if (src.active)
src.disrupt()
else
return ..()
bullet_act()
if (src.active)
src.disrupt()
else
return ..()
scan(obj/target, mob/user)
if (get_dist(src, target) > 1)
if (user && ismob(user))
user.show_text("You are too far away to do that.", "red")
return
if (!isnull(initial(target.icon)) && !isnull(initial(target.icon_state)) && target.icon && target.icon_state && (istype(target, /obj/item) || istype(target, /obj/shrub) || istype(target, /obj/critter) || istype(target, /obj/machinery/bot))) // cogwerks - added more fun
playsound(src, "sound/weapons/flash.ogg", 100, 1, 1)
boutput(user, "<span style=\"color:blue\">Scanned [target].</span>")
src.name = target.name
src.real_name = target.name
src.desc = target.desc
src.real_desc = target.desc
src.icon = target.icon
src.icon_state = target.icon_state
src.dir = target.dir
can_use = 1
else
user.show_text("\The [target] is not compatible with the scanner.", "red")
toggle()
if (!can_use)
return
if (!anim)
anim = new(src)
if (active)
active = 0
playsound(src, "sound/effects/pop.ogg", 100, 1, 1)
boutput(usr, "<span style=\"color:blue\">You disarm the [src].</span>")
message_admins("[key_name(usr)] disarms a chameleon bomb ([src]) at [log_loc(usr)].")
logTheThing("bombing", usr, null, "disarms a chameleon bomb ([src]) at [log_loc(usr)].")
else
playsound(src, "sound/effects/pop.ogg", 100, 1, 1)
src.active = 1
boutput(usr, "<span style=\"color:blue\">You arm the [src].</span>")
message_admins("[key_name(usr)] arms a chameleon bomb ([src]) at [log_loc(usr)].")
logTheThing("bombing", usr, null, "arms a chameleon bomb ([src]) at [log_loc(usr)].")
disrupt()
if (active)
var/datum/effects/system/spark_spread/spark_system = unpool(/datum/effects/system/spark_spread)
spark_system.set_up(5, 0, src)
spark_system.attach(src)
spark_system.start()
src.blowthefuckup(src.strength)
+31
View File
@@ -0,0 +1,31 @@
/**
* Chemicompiler
* v1.0 By volundr 9/24/14
* This device is a programmable chemistry mixing and heating device.
* The javascript code to run the frontend is in browserassets/js/chemicompiler.min.js
* which is minified javascript from browserassets/js/chemicompiler.js
* If you make changes to the uncompressed javascript, you'll need to install node.js,
* and run `npm install -g uglify-js`
* then run `uglifyjs browserassets/js/chemicompiler.js -c > browserassets/js/chemicompiler.min.js` to rebuild the compressed version.
*/
/datum/chemicompiler_core/portableCore
maxReservoir = 6
/obj/item/device/chemicompiler/
name = "sloppy-looking hackjob of a device"
desc = "you have no earthy idea what this pile of junk could be for."
icon = 'icons/obj/chemical.dmi'
icon_state = "chemicompiler"
var/datum/chemicompiler_executor/executor
New()
..()
executor = new(src, /datum/chemicompiler_core/portableCore)
attack_self(mob/user as mob)
executor.panel()
proc/topicPermissionCheck(action)
if(src.loc != usr || (executor.core.running && action != "getUIState"))
return 0
return 1
+82
View File
@@ -0,0 +1,82 @@
/obj/item/cloaking_device
name = "cloaking device"
icon = 'icons/obj/device.dmi'
icon_state = "shield0"
var/active = 0.0
flags = FPRINT | TABLEPASS| CONDUCT
item_state = "electronic"
throwforce = 10.0
throw_speed = 2
throw_range = 10
w_class = 2.0
is_syndicate = 1
mats = 15
desc = "An illegal device that bends light around the user, rendering them invislbe to regular vision."
stamina_damage = 10
stamina_cost = 10
stamina_crit_chance = 15
attack_self(mob/user as mob)
src.add_fingerprint(user)
if (src.active)
user.show_text("The [src.name] is now inactive.", "blue")
src.deactivate(user)
else
switch (src.activate(user))
if (0)
user.show_text("You can't have more than one active [src.name] on your person.", "red")
if (1)
user.show_text("The [src.name] is now active.", "blue")
return
proc/activate(mob/user as mob)
// Multiple active devices can lead to weird effects, okay (Convair880).
var/list/number_of_devices = list()
for (var/obj/item/cloaking_device/C in user)
if (C.active)
number_of_devices += C
if (number_of_devices.len > 0)
return 0
src.active = 1
src.icon_state = "shield1"
if (user && ismob(user))
user.update_inhands()
user.update_clothing()
return 1
proc/deactivate(mob/user as mob)
src.active = 0
src.icon_state = "shield0"
if (user && ismob(user))
user.update_inhands()
user.update_clothing()
// Fix for the backpack exploit. Spawn call is necessary for some reason (Convair880).
dropped(var/mob/user)
..()
spawn(0)
if (!src) return
if (!user)
src.deactivate()
return
if (ismob(src.loc) && src.loc == user) // Pockets are okay.
if (ishuman(user))
var/mob/living/carbon/human/H = user
if (H.l_store && H.l_store == src)
return
if (H.r_store && H.r_store == src)
return
src.deactivate(user)
// Need to update other mob sprite when force-equipping the cloak. Not quite sure how and
// what even calls update_clothing() (giving the other mob invisibility and overlay) BEFORE
// we set src.active to 0 here. But yeah, don't comment this out or you'll end up with in-
// visible dudes equipped with technically inactive cloaking devices.
src.deactivate(src.loc)
return
emp_act()
usr.visible_message("<span style=\"color:blue\"><b>[usr]'s cloak is disrupted!</b></span>")
src.deactivate(usr)
return
+197
View File
@@ -0,0 +1,197 @@
//Contents
//Cloak field generator
//Remote for said generator
/obj/item/cloak_gen
name = "cloaking field generator"
desc = "Its humming softly."
icon = 'icons/obj/device.dmi'
icon_state = "cloakgen_off"
var/range = 3
var/maxrange = 5
var/active = 0
var/icon_to_use = "noise2"
var/list/fields = new/list()
is_syndicate = 1
mats = 12
New()
var/obj/item/remote/cloak_gen/remote = new /obj/item/remote/cloak_gen(src.loc)
spawn(0)
remote.my_gen = src
// For whatever reason, disposing() is never called for this item and I couldn't find out why (Convair880).
Del()
//DEBUG("Del() was called for [src].")
if (src.active)
src.turn_off()
..()
return
disposing()
//DEBUG("Disposing() was called for [src] at [log_loc(src)].")
if (src.active)
src.turn_off()
..()
return
attack_self()
boutput(usr, "<span style=\"color:red\">I need to place it on the ground to use it.</span>")
// Shouldn't be required, but there have been surplus crate-related bugs in the past (Convair880).
attackby(obj/item/W as obj, mob/user as mob)
if (!W || !istype(W, /obj/item/remote/cloak_gen/))
..()
return
if (istype(W, /obj/item/remote/cloak_gen/))
var/obj/item/remote/cloak_gen/R = W
if (!R.my_gen)
user.show_text("Connection to [src.name] established", "blue")
R.my_gen = src
else
var/choice = alert("Remote is already linked to a generator. Reset and establish new connection?", "Connection override", "Yes", "No")
if (choice == "Yes")
R.my_gen = src
user.show_text("Connection to [src.name] established", "blue")
return
pickup(var/mob/living/M)
if(active) turn_off()
proc/get_cloaked_icon(turf/T)
var/icon/turf = icon(T.icon, T.icon_state, T.dir)
var/icon/noise = icon('icons/misc/old_or_unused.dmi', icon_to_use, dir=pick(cardinal))
turf.Blend(noise,ICON_MULTIPLY)
return turf
proc/turn_on()
if (active) return
if (!isturf(loc))
if (usr && ismob(usr))
boutput(usr, "<span style=\"color:red\">The field generator must be on the floor to be activated.</span>")
return
active = 1
anchored = 1
if (usr && ismob(usr))
boutput(usr, "<span style=\"color:blue\">You activate the cloak field generator.</span>")
for(var/turf/T in range(range,src))
if(!isturf(T)) continue
var/obj/overlay/O = new/obj/overlay(T)
fields += O
O.icon = get_cloaked_icon(T)
O.layer = EFFECTS_LAYER_4
O.anchored = 1
O.density = 0
O.name = T.name
proc/turn_off()
if (!active) return
active = 0
anchored = 0
if (usr && ismob(usr))
boutput(usr, "<span style=\"color:blue\">You deactivate the cloak field generator.</span>")
for(var/A in fields)
qdel(A)
/obj/item/remote/cloak_gen
name = "cloaking field generator remote"
desc = "A remote control for a cloaking field generator."
icon = 'icons/obj/porters.dmi'
icon_state = "remote"
item_state = "electronic"
is_syndicate = 1
w_class = 2.0
var/obj/item/cloak_gen/my_gen = null
var/anti_spam = 0 // Creating and deleting overlays en masse can cause noticeable lag (Convair880).
attack_self()
if (istype(usr,/mob/living))
if (my_gen)
if (my_gen.active)
src.anti_spam = world.time
my_gen.turn_off()
else
if (src.anti_spam && world.time < src.anti_spam + 100)
usr.show_text("The cloaking field generator is recharging!", "red")
return
src.anti_spam = world.time
my_gen.turn_on()
else
boutput(usr, "<span style=\"color:red\">No signal detected. Swipe remote on a cloaking generator to establish a connection.</span>")
return
verb/set_pattern()
set src in view(1)
if (!istype(usr,/mob/living) || !my_gen) return
var/input = input(usr,"Select cloaking pattern:","Set pattern","Noise") in list("Noise","Linear","Chaos","Cubic","Interference","Rotating")
switch(input)
if("Linear")
my_gen.icon_to_use = "noise1"
if("Noise")
my_gen.icon_to_use = "noise2"
if("Chaos")
my_gen.icon_to_use = "noise3"
if("Cubic")
my_gen.icon_to_use = "noise4"
if("Interference")
my_gen.icon_to_use = "noise5"
if("Rotating")
my_gen.icon_to_use = "noise6"
if(my_gen.active)
my_gen.turn_off()
my_gen.turn_on()
boutput(usr, "<span style=\"color:blue\">You set the pattern to '[input]'.</span>")
verb/set_range()
set src in view(1)
if (!istype(usr,/mob/living) || !my_gen) return
var/input = input(usr,"Range 0-[my_gen.maxrange]:","Set range",my_gen.range) as num
if(input > my_gen.maxrange || input < 0)
boutput(usr, "<span style=\"color:red\">Invalid setting.</span>")
return
my_gen.range = input
if(my_gen.active)
my_gen.turn_off()
my_gen.turn_on()
boutput(usr, "<span style=\"color:blue\">You set the range to [my_gen.range].</span>")
verb/increase_range()
set src in view(1)
if (!istype(usr,/mob/living) || !my_gen) return
if (my_gen.range + 1 > my_gen.maxrange)
boutput(usr, "<span style=\"color:red\">Maximum range reached ([my_gen.maxrange]).</span>")
return
my_gen.range++
if(my_gen.active)
my_gen.turn_off()
my_gen.turn_on()
boutput(usr, "<span style=\"color:blue\">You set the range to [my_gen.range].</span>")
verb/decrease_range()
set src in view(1)
if (!istype(usr,/mob/living) || !my_gen) return
if (my_gen.range - 1 < 0)
boutput(usr, "<span style=\"color:red\">Minimum range reached (0).</span>")
return
my_gen.range--
if(my_gen.active)
my_gen.turn_off()
my_gen.turn_on()
boutput(usr, "<span style=\"color:blue\">You set the range to [my_gen.range].</span>")
verb/turn_on()
set src in view(1)
if (!istype(usr,/mob/living) || !my_gen || my_gen.active) return
my_gen.turn_on()
boutput(usr, "<span style=\"color:blue\">You turn the cloaking field generator on.</span>")
verb/turn_off()
set src in view(1)
if (!istype(usr,/mob/living) || !my_gen || !my_gen.active) return
my_gen.turn_off()
boutput(usr, "<span style=\"color:blue\">You turn the cloaking field generator off.</span>")
+7
View File
@@ -0,0 +1,7 @@
/obj/item/device
icon = 'icons/obj/device.dmi'
inhand_image_icon = 'icons/mob/inhand/hand_tools.dmi'
stamina_damage = 5
stamina_cost = 5
stamina_crit_chance = 1
rand_pos = 1
+181
View File
@@ -0,0 +1,181 @@
/obj/item/device/disguiser
name = "holographic disguiser"
icon_state = "enshield0"
desc = "Experimental device that projects a hologram of a randomly generated appearance onto the user, hiding their real identity."
flags = FPRINT | TABLEPASS| CONDUCT | EXTRADELAY | ONBELT
item_state = "electronic"
throwforce = 5
throw_speed = 1
throw_range = 5
w_class = 2
is_syndicate = 1
mats = 8
var/anti_spam = 1 // In relation to world time.
var/on = 0
var/customization_first_color = 0
var/customization_second_color = 0
var/customization_third_color = 0
var/e_color = 0
var/s_tone = 0
var/cust1 = null
var/cust2 = null
var/cust3 = null
dropped(mob/user)
..()
spawn(0) // Ported from cloaking device. Spawn call is necessary for some reason (Convair880).
if (!src) return
if (ismob(src.loc) && src.loc == user)
if (ishuman(user))
var/mob/living/carbon/human/H = user
if (H.l_store && H.l_store == src)
return
if (H.r_store && H.r_store == src)
return
if (H.belt && H.belt == src)
return
src.disrupt(user)
return
attack_self(mob/user)
if (!src.on && (src.anti_spam && world.time < src.anti_spam + 100))
user.show_text("[src] is recharging!", "red")
return
if (ishuman(user))
var/mob/living/carbon/human/H = user
if (!H.bioHolder || !H.bioHolder.mobAppearance)
H.show_text("This device is only designed to work on humans!", "red")
return
src.toggle(H)
else
user.show_text("This device is only designed to work on humans!", "red")
return
emp_act()
if (ishuman(src.loc))
var/mob/living/carbon/human/H = src.loc
if (!H.bioHolder || !H.bioHolder.mobAppearance)
return
H.visible_message("<span style=\"color:blue\"><b>[H]'s [src.name] is disrupted!</b></span>")
src.disrupt(H)
return
// Added to 1) fix a couple bugs and 2) cut down on duplicate code.
// Also cleaned up the code a bit in general (Convair880).
proc/change_appearance(var/mob/living/carbon/human/user, var/reset_to_normal = 0)
if (!src || !user || !ishuman(user))
return
var/datum/appearanceHolder/AH = user.bioHolder.mobAppearance
if (!AH || !istype(AH, /datum/appearanceHolder))
return
// Store current appearance and generate new one.
if (!reset_to_normal)
src.real_name = user.real_name
src.s_tone = AH.s_tone
src.cust1 = AH.customization_first
src.cust2 = AH.customization_second
src.cust3 = AH.customization_third
src.customization_first_color = AH.customization_first_color
src.customization_second_color = AH.customization_second_color
src.customization_third_color = AH.customization_third_color
src.e_color = AH.e_color
randomize_look(user, 0, 0, 0, 1, 0, 0) // randomize: gender 0, blood type 0, age 0, name 1, underwear 0, remove effects 0
// Restore original appearance.
else
user.real_name = src.real_name
AH.s_tone = src.s_tone
AH.customization_first = src.cust1
AH.customization_second = src.cust2
AH.customization_third = src.cust3
AH.customization_first_color = src.customization_first_color
AH.customization_second_color = src.customization_second_color
AH.customization_third_color = src.customization_third_color
AH.e_color = src.e_color
AH.UpdateMob()
if (user.limbs)
user.limbs.reset_stone()
user.set_face_icon_dirty()
user.set_body_icon_dirty()
user.update_inhands()
user.update_clothing()
return
proc/disrupt(mob/living/carbon/human/user)
if (!src)
return
if (src.on)
src.icon_state = "enshield0"
src.on = 0
if (!user || !ishuman(user))
return
var/datum/appearanceHolder/AH = user.bioHolder.mobAppearance
if (!AH || !istype(AH, /datum/appearanceHolder))
return
var/datum/effects/system/spark_spread/spark_system = unpool(/datum/effects/system/spark_spread)
spark_system.set_up(5, 0, src)
spark_system.attach(user)
spark_system.start()
src.change_appearance(user, 1)
src.anti_spam = world.time
return
proc/toggle(mob/living/carbon/human/user)
if (!src || !user || !ishuman(user))
return
var/datum/appearanceHolder/AH = user.bioHolder.mobAppearance
if (!AH || !istype(AH, /datum/appearanceHolder))
return
if (src.on)
src.icon_state = "enshield0"
src.on = 0
var/datum/effects/system/spark_spread/spark_system = unpool(/datum/effects/system/spark_spread)
spark_system.set_up(5, 0, src)
spark_system.attach(user)
spark_system.start()
user.show_text("You deactivate the [src.name].", "blue")
src.change_appearance(user, 1)
src.anti_spam = world.time
var/obj/overlay/T = new/obj/overlay(get_turf(src))
T.icon = 'icons/effects/effects.dmi'
flick("emppulse",T)
spawn (8)
if (T) qdel(T)
else
// Multiple active devices can lead to weird effects, okay (Convair880).
var/list/number_of_devices = list()
for (var/obj/item/device/disguiser/D in user)
if (D.on)
number_of_devices += D
if (number_of_devices.len > 0)
user.show_text("You can't have more than one active [src.name] on your person.", "red")
return
src.on = 1
src.icon_state = "enshield1"
user.show_text("You active the [src.name]", "blue")
src.change_appearance(user, 0)
src.anti_spam = world.time
var/obj/overlay/T = new/obj/overlay(get_turf(src))
T.icon = 'icons/effects/effects.dmi'
flick("emppulse",T)
spawn (8)
if (T) qdel(T)
return
@@ -0,0 +1,87 @@
/obj/item/device/energy_shield
//TO-DO : Bullets. Direct attacks.
name = "Centcom prototype energy-shield"
icon_state = "enshield0"
flags = FPRINT | TABLEPASS| CONDUCT | ONBELT
item_state = "electronic"
throwforce = 5.0
throw_speed = 1
throw_range = 5
w_class = 2.0
mats = 10
var/active = 0
var/protection = 25
var/mob/user = null
var/image/shield_overlay = null
New()
work()
dropped(mob/user as mob)
turn_off()
return
pickup(mob/user)
return
equipped(var/mob/user, var/slot)
return
attack_self()
if(!active)
boutput(usr, "<span style=\"color:blue\">You activate the shield.</span>")
turn_on(usr)
else
boutput(usr, "<span style=\"color:blue\">You deactivate the shield.</span>")
turn_off()
return
proc
protect()
if(!active)
return 0
else
boutput(user, "<span style=\"color:red\">The impact temporarily weakens the shield.</span>")
var/pre_protect = protection
protection -= 5
spawn(300) protection += 5
return max(pre_protect,0)
turn_off()
if(user)
user.underlays -= shield_overlay
user.energy_shield = null
shield_overlay = null
user = null
active = 0
icon_state = "enshield0"
turn_on(var/mob/user2)
if(user2.energy_shield)
boutput(user2, "<span style=\"color:red\">Cannot activate more than one shield.</span>")
return
user = user2
if(!can_use())
turn_off()
return
icon_state = "enshield1"
user.energy_shield = src
shield_overlay = image('icons/effects/effects.dmi',user,"enshield",MOB_LAYER+1)
user.underlays += shield_overlay
active = 1
work()
if(!can_use())
turn_off()
return
spawn(10) work()
can_use()
if(!user || !ismob(loc)) return 0
if(src in user.get_equipped_items())
return 1
else
return 0
+190
View File
@@ -0,0 +1,190 @@
/obj/item/shieldwallgen
name = "Energy-Shield Generator"
desc = "Organic matter can pass through the shields generated by this generator. Can be secured to the ground using a wrench."
icon = 'icons/obj/device.dmi'
icon_state = "cloakgen_off"
density = 0
opacity = 0
anchored = 0
w_class = 2.0
pressure_resistance = 2*ONE_ATMOSPHERE
var/list/tiles = new/list()
var/active = 0
var/range = 1
var/secured = 0
var/broken_num = 0
//Save and regenerate weakened parts.
// For whatever reason, disposing() is never called for this item. Ditto for the cloak generator (Convair880).
Del()
//DEBUG("Del() was called for [src].")
if (src.active)
src.turn_off()
..()
return
disposing()
//DEBUG("Disposing() was called for [src] at [log_loc(src)].")
if (src.active)
src.turn_off()
..()
return
attackby(obj/item/W as obj, mob/user as mob)
if(istype(W,/obj/item/wrench) && isturf(loc) && !istype(loc,/turf/space))
if(secured)
boutput(usr, "<span style=\"color:red\">You unsecure the generator.</span>")
secured = 0
playsound(src, "sound/items/Ratchet.ogg", 60, 1)
else
boutput(usr, "<span style=\"color:red\">You secure the generator.</span>")
secured = 1
playsound(src, "sound/items/Ratchet.ogg", 60, 1)
attack_hand(mob/user as mob)
if(secured)
boutput(user, "<span style=\"color:red\">Its secured to the ground.</span>")
return
else
return ..()
verb/increase_range()
set src in view(1)
if (!istype(usr,/mob/living)) return
if (!isturf(loc))
boutput(usr, "<span style=\"color:red\">You must place the generator on the ground to use it.</span>")
return
range = min(range+1,3)
boutput(usr, "<span style=\"color:blue\">Range set to : [range]</span>")
if(active)
turn_off()
turn_on()
verb/decrease_range()
set src in view(1)
if (!istype(usr,/mob/living)) return
if (!isturf(loc))
boutput(usr, "<span style=\"color:red\">You must place the generator on the ground to use it.</span>")
return
range = max(range-1,1)
boutput(usr, "<span style=\"color:blue\">Range set to : [range]</span>")
if(active)
turn_off()
turn_on()
pickup(var/mob/living/M)
if(active)
turn_off()
proc/turn_on()
var/xa
var/ya
var/piece
var/atom/A
for(xa=(-range), xa<((range*2)+(1-range)), xa++)
for(ya=(-range), ya<((range*2)+(1-range)), ya++)
if ( (xa != range && xa != -range) && (ya != range && ya != -range) )
continue
if(xa == -range && ya == range) piece = NORTHWEST
if(xa == range && ya == range) piece = NORTHEAST
if(xa == -range && ya == -range) piece = SOUTHWEST
if(xa == range && ya == -range) piece = SOUTHEAST
if( (xa != range && xa != -range) && ya == range) piece = NORTH
if( (xa != range && xa != -range) && ya == -range) piece = SOUTH
if( xa == range && (ya != range && ya != -range)) piece = EAST
if( xa == -range && (ya != range && ya != -range)) piece = WEST
A = locate((src.x + xa),(src.y + ya),src.z)
if (!A.density)
var/obj/shieldwall/created = new /obj/shieldwall ( locate((src.x + xa),(src.y + ya),src.z) )
created.dir = piece
tiles += created
created.health_max = 16 - (range*2)
created.health = 16 - (range*2)
icon_state = "cloakgen_on"
src.anchored = 1
src.active = 1
var/list/breakables = tiles.Copy()
for(var/i=0, i<broken_num, i++)
if(!breakables.len) break
var/obj/shieldwall/S = pick(breakables)
S.broken = 1
S.health = 0
S.icon_state = "shield0"
S.name = "weakened shield"
spawn(200)
if(S)
S.health = S.health_max
S.check()
breakables -= S
proc/turn_off()
broken_num = 0
for(var/obj/shieldwall/A in tiles)
if(A.broken) broken_num++
qdel(A)
tiles = new/list()
icon_state = "cloakgen_off"
src.anchored = 0
src.active = 0
verb/toggle()
set src in view(1)
if (!istype(usr,/mob/living)) return
if (!isturf(loc))
boutput(usr, "<span style=\"color:red\">You must place the generator on the ground to use it.</span>")
return
if (!active)
turn_on()
boutput(usr, "<span style=\"color:blue\">You activate the generator.</span>")
else
turn_off()
boutput(usr, "<span style=\"color:blue\">You deactivate the generator.</span>")
/obj/shieldwall
name = "shield"
desc = "An energy shield."
icon = 'icons/effects/effects.dmi'
icon_state = "shield1"
density = 1
opacity = 0
anchored = 1
layer=12
var/health_max = 10
var/health = 10
var/broken = 0
CanPass(atom/A, turf/T)
if (broken) return 1
if (ismob(A)) return 1
else return 0
ex_act(severity)
if(broken) return
health--
check()
meteorhit(var/obj/O as obj)
if(broken) return
health--
check()
playsound(src, "sound/effects/shieldhit2.ogg", 40, 1)
qdel(O)
proc/check()
if(health <= 0)
broken = 1
icon_state = "shield0"
name = "weakened shield"
playsound(src, "sound/effects/shielddown2.ogg", 45, 1)
spawn(450)
health = health_max
check()
else
broken = 0
icon_state = "shield1"
name = "energy shield"
+335
View File
@@ -0,0 +1,335 @@
/obj/item/device/flash
name = "flash"
desc = "A device that emits an extremely bright light when used. Useful for briefly stunning people or starting a dance party."
icon_state = "flash"
throwforce = 5
w_class = 1.0
throw_speed = 4
throw_range = 10
flags = FPRINT | TABLEPASS| CONDUCT
item_state = "electronic"
mats = 2
module_research = list("energy" = 1, "devices" = 3)
var/status = 1 // Bulb still functional?
var/secure = 1 // Access panel still secured?
var/use = 0 // Times the flash has been used.
var/l_time = 0 // Anti-spam cooldown (in relation to world time).
var/eye_damage_mod = 0
var/range_mod = 0
var/burn_mod = 0 // De-/increases probability of bulb burning out, so not related to BURN damage.
var/stun_mod = 0
var/animation_type = "flash2"
var/turboflash = 0 // Turbo flash-specific vars.
var/obj/item/cell/cell = null
var/max_flash_power = 0
var/min_flash_power = 0
cyborg
process_burnout(mob/user)
return
attack(mob/living/M as mob, mob/user as mob)
..()
var/mob/living/silicon/robot/R = user
if (istype(R))
R.cell.use(300)
attack_self(mob/user as mob, flag)
..()
var/mob/living/silicon/robot/R = user
if (istype(R))
R.cell.use(150)
// Tweaked attack and attack_self to reduce the amount of duplicate code. Turboflashes to be precise (Convair880).
/obj/item/device/flash/attack(mob/living/M as mob, mob/user as mob)
src.add_fingerprint(user)
if (src.l_time && world.time < src.l_time + 20)
return
if (user.bioHolder && user.bioHolder.HasEffect("clumsy") && prob(50))
user.visible_message("<span style=\"color:red\"><b>[user]</b> tries to use [src], but slips and drops it!</span>")
user.drop_item()
return
if (src.status == 0)
boutput(user, "<span style=\"color:red\">The bulb has been burnt out!</span>")
return
// Handle turboflash power cell.
var/flash_power = 0
if (src.turboflash)
if (!src.cell)
user.show_text("[src] doesn't seem to be connected to a power cell.", "red")
return
if (src.cell && istype(src.cell,/obj/item/cell/erebite))
user.visible_message("<span style=\"color:red\">[user]'s flash/cell assembly violently explodes!</span>")
logTheThing("combat", user, M, "tries to blind %target% with [src] (erebite power cell) at [log_loc(user)].")
var/turf/T = get_turf(src.loc)
explosion(src, T, 0, 1, 2, 2)
spawn (1)
if (src) qdel(src)
return
if (src.cell)
if (src.cell.charge < min_flash_power)
user.show_text("[src] seems to be out of power.", "red")
return
else
flash_power = src.cell.charge / max_flash_power
if (flash_power > 1)
flash_power = 1
flash_power++
else
flash_power = 1
// Play animations.
if (isrobot(user))
spawn(0)
var/atom/movable/overlay/animation = new(user.loc)
animation.layer = user.layer + 1
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
animation.master = user
flick("blspell", animation)
sleep(5)
qdel(animation)
playsound(src.loc, "sound/weapons/flash.ogg", 100, 1)
flick(src.animation_type, src)
src.l_time = world.time
if (!src.turboflash)
src.use++
// Calculate target damage.
var/animation_duration
var/weakened
var/eye_blurry
var/eye_damage
var/burning
if (src.turboflash)
animation_duration = 60
weakened = (10 + src.stun_mod) * flash_power
eye_blurry = src.eye_damage_mod + rand(2, (4 * flash_power))
eye_damage = src.eye_damage_mod + rand(5, (10 * flash_power))
burning = 15 * flash_power
else
animation_duration = 30
weakened = (8 + src.stun_mod) * flash_power
eye_damage = src.eye_damage_mod + rand(0, (2 * flash_power))
// We're flashing somebody directly, hence the 100% chance to disrupt cloaking device at the end.
M.apply_flash(animation_duration, weakened, 0, 0, eye_blurry, eye_damage, 0, burning, 100)
// Rev mode check.
if (ticker && ticker.mode && istype(ticker.mode, /datum/game_mode/revolution))
var/datum/game_mode/revolution/R = ticker.mode
if (ishuman(M))
var/mob/living/carbon/human/H = M
var/safety = 0
if (H.eyes_protected_from_light())
safety = 1
if (safety == 0 && user.mind && (user.mind in R.head_revolutionaries))
var/list/U = R.get_unconvertables()
if (!H.client || !H.mind)
user.show_text("[H] is braindead and cannot be converted.", "red")
else if (H.mind in U)
user.show_text("[H] seems unwilling to revolt.", "red")
else if (H.mind in R.head_revolutionaries)
user.show_text("[H] is already a member of the revolution.", "red")
else
if (!(H.mind in R.revolutionaries))
R.add_revolutionary(H.mind)
else
user.show_text("[H] is already a member of the revolution.", "red")
// Log entry.
M.visible_message("<span style=\"color:red\">[user] blinds [M] with the [src.name]!</span>")
logTheThing("combat", user, M, "blinds %target% with [src] at [log_loc(user)].")
// Handle bulb wear.
if (src.turboflash)
status = 0
src.cell.use(min(src.cell.charge, max_flash_power))
boutput(user, "<span style=\"color:red\"><b>The bulb has burnt out!</b></span>")
src.icon_state = "turboflash3"
src.name = "depleted flash/cell assembly"
else
src.process_burnout(user)
// Some after attack stuff.
user.lastattacked = M
M.lastattacker = user
M.lastattackertime = world.time
return
/obj/item/device/flash/attack_self(mob/user as mob)
src.add_fingerprint(user)
if (src.l_time && world.time < src.l_time + 20)
return
if (user.bioHolder && user.bioHolder.HasEffect("clumsy") && prob(50))
user.visible_message("<span style=\"color:red\"><b>[user]</b> tries to use [src], but slips and drops it!</span>")
user.drop_item()
return
if (status == 0)
boutput(user, "<span style=\"color:red\">The bulb has been burnt out!</span>")
return
// Handle turboflash power cell.
if (src.turboflash)
if (!src.cell)
user.show_text("[src] doesn't seem to be connected to a power cell.", "red")
return
if (src.cell && src.cell.charge < min_flash_power)
user.show_text("[src] seems to be out of power.", "red")
return
if (src.cell && istype(src.cell,/obj/item/cell/erebite))
user.visible_message("<span style=\"color:red\">[user]'s flash/cell assembly violently explodes!</span>")
logTheThing("combat", user, null, "tries to area-flash with [src] (erebite power cell) at [log_loc(user)].")
var/turf/T = get_turf(src.loc)
explosion(src, T, 0, 1, 2, 2)
spawn (1)
if (src) qdel(src)
return
// Play animations.
playsound(src.loc, "sound/weapons/flash.ogg", 100, 1)
flick(src.animation_type, src)
src.l_time = world.time
if (isrobot(user))
spawn(0)
var/atom/movable/overlay/animation = new(user.loc)
animation.layer = user.layer + 1
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
animation.master = user
flick("blspell", animation)
sleep(5)
qdel(animation)
// Flash target mobs.
for (var/mob/M in oviewers((3 + src.range_mod), get_turf(src)))
if (src.turboflash)
M.apply_flash(35, 0, 0, 25)
else
M.apply_flash(20, 0)
// Handle bulb wear.
if (src.turboflash)
status = 0
src.cell.use(min(src.cell.charge, max_flash_power))
boutput(user, "<span style=\"color:red\"><b>The bulb has burnt out!</b></span>")
src.icon_state = "turboflash3"
src.name = "depleted flash/cell assembly"
else
src.use++
src.process_burnout(user)
return
/obj/item/device/flash/proc/process_burnout(mob/user as mob)
if (prob(max(0,(use*2) + burn_mod)))
status = 0
boutput(user, "<span style=\"color:red\"><b>The bulb has burnt out!</b></span>")
icon_state = "flash3"
name = "depleted flash"
return
/obj/item/device/flash/attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/cell) && !src.secure)
boutput(user, "<span style=\"color:blue\">You combine [W] and [src]...</span>")
var/obj/item/device/flash/turbo/T = new /obj/item/device/flash/turbo(user.loc)
T.cell = W
user.drop_item()
W.set_loc(T)
if(!src.status)
T.icon_state = "turboflash3"
T.status = 0
qdel(src)
return
else if (istype(W, /obj/item/screwdriver))
boutput(user, "<span style=\"color:blue\">You [src.secure ? "unscrew" : "secure"] the access panel.</span>")
secure = !secure
else if (istype(W, /obj/item/device/multitool))
if (src.status == 0)
boutput(user, "<span style=\"color:red\">The bulb has been burnt out.</span>")
else
if (src.use <= 0)
boutput(user, "<span style=\"color:blue\">The bulb is in perfect condition.</span>")
else if (src.use>0 && src.use<5)
boutput(user, "<span style=\"color:blue\">The bulb is in good condition.</span>")
else if (src.use>5 && src.use<10)
boutput(user, "<span style=\"color:blue\">The bulb is in decent condition.</span>")
else if (src.use>10 && src.use<15)
boutput(user, "<span style=\"color:blue\">The bulb is in bad condition.</span>")
else
boutput(user, "<span style=\"color:blue\">The bulb is in terrible condition.</span>")
else
return ..()
/obj/item/device/flash/is_detonator_attachment()
return 1
/obj/item/device/flash/detonator_act(event, var/obj/item/assembly/detonator/det)
switch (event)
if ("pulse")
det.attachedTo.visible_message("<span class='bold' style='color: #B7410E;'>\The [src] discharges.</span>")
for (var/mob/living/M in viewers(4, det.attachedTo))
M.apply_flash(30, 20)
if ("cut")
det.attachedTo.visible_message("<span class='bold' style='color: #B7410E;'>\The [src] goes black.</span>")
det.attachments.Remove(src)
if ("process")
if (prob(5))
det.attachedTo.visible_message("<span class='bold' style='color: #B7410E;'>\The [src] discharges.</span>")
for (var/mob/living/M in viewers(2, det.attachedTo))
M.apply_flash(30, 8)
/obj/item/device/flash/emp_act()
if(iscarbon(src.loc))
src.attack_self()
return
// The Turboflash - A flash combined with a charged energy cell to make a bigger, meaner flash (That dies after one use).
/obj/item/device/flash/turbo
name = "flash/cell assembly"
desc = "A common stun weapon with a power cell hastily wired into it. Looks dangerous."
icon_state = "turboflash"
mats = 0
animation_type = "turboflash2"
turboflash = 1
max_flash_power = 5000
min_flash_power = 500
New()
..()
spawn(10)
if(!src.cell)
src.cell = new /obj/item/cell(src)
src.cell.maxcharge = max_flash_power
src.cell.charge = src.cell.maxcharge
return
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/wrench) && !src.secure)
boutput(user, "You disassemble [src]!")
src.cell.set_loc(get_turf(src))
var/obj/item/device/flash/F = new /obj/item/device/flash( get_turf(src) )
if(!src.status)
F.status = 0
F.icon_state = "flash3"
qdel(src)
else if (istype(W, /obj/item/screwdriver))
boutput(user, "<span style=\"color:blue\">You [src.secure ? "unscrew" : "secure"] the access panel.</span>")
secure = !secure
return
+242
View File
@@ -0,0 +1,242 @@
// Note: Hard hat and engineering space helmet can be found in helments.dm, the cake hat in hats.dm.
/obj/item/device/flashlight
name = "flashlight"
desc = "A hand-held emergency light."
icon_state = "flight0"
var/on = 0
w_class = 2
item_state = "flight"
flags = FPRINT | ONBELT | TABLEPASS | CONDUCT
m_amt = 50
g_amt = 20
mats = 2
var/col_r = 0.9
var/col_g = 0.8
var/col_b = 0.7
var/datum/light/light
module_research = list("science" = 1, "devices" = 1)
New()
..()
light = new /datum/light/point
light.set_brightness(1)
light.set_color(col_r, col_g, col_b)
light.attach(src)
attack_self(mob/user)
on = !on
icon_state = "flight[on]"
if (on)
light.enable()
else
light.disable()
pickup(mob/user)
..()
light.attach(user)
dropped(mob/user)
..()
spawn(0)
if (src.loc != user)
light.attach(src)
/obj/item/device/glowstick // fuck yeah space rave
icon = 'icons/obj/lighting.dmi'
icon_state = "glowstick-off"
name = "emergency glowstick"
desc = "For emergency use only. Not for use in illegal lightswitch raves."
var/on = 0
var/datum/light/light
New()
..()
light = new /datum/light/point
light.set_brightness(0.5)
light.set_height(0.75)
light.set_color(0.0,0.9,0.1)
light.attach(src)
pickup(mob/user)
..()
light.attach(user)
dropped(mob/user)
..()
spawn(0)
if (src.loc != user)
light.attach(src)
attack_self(mob/user as mob)
if (!on)
boutput(user, "<span style=\"color:blue\">You crack [src].</span>")
on = 1
icon_state = "glowstick-on"
playsound(user.loc, "sound/effects/snap.ogg", 50, 1)
light.enable()
else
if (prob(10))
user.visible_message("<span style=\"color:blue\"><b>[user]</b> breaks [src]! What [pick("a clutz", "a putz", "a chump", "a doofus", "an oaf", "a jerk")]!</span>")
playsound(user.loc, "sound/effects/snap.ogg", 50, 1)
user.reagents.add_reagent("radium", 10)
var/turf/T = get_turf(src.loc)
new /obj/decal/cleanable/generic(T)
new /obj/decal/cleanable/greenglow(T)
qdel(src)
else
user.visible_message("<span style=\"color:blue\"><b>[user]</b> [pick("fiddles", "faffs around", "goofs around", "fusses", "messes")] with [src].</span>")
/obj/item/device/candle
name = "candle"
desc = "It's a big candle."
icon = 'icons/effects/alch.dmi'
icon_state = "candle-off"
density = 0
anchored = 0
opacity = 0
var/icon_off = "candle-off"
var/icon_on = "candle"
var/brightness = 1
var/col_r = 0.5
var/col_g = 0.3
var/col_b = 0.0
var/lit = 0
var/datum/light/light
New()
..()
light = new /datum/light/point
light.set_brightness(brightness)
light.set_color(col_r, col_g, col_b)
light.attach(src)
pickup(mob/user)
..()
light.attach(user)
dropped(mob/user)
..()
spawn(0)
if (src.loc != user)
light.attach(src)
attack_self(mob/user as mob)
if (src.lit)
var/fluff = pick("snuff", "blow")
user.visible_message("<b>[user]</b> [fluff]s out [src].",\
"You [fluff] out [src].")
src.put_out(user)
attackby(obj/item/W as obj, mob/user as mob)
if (!src.lit)
if (istype(W, /obj/item/weldingtool) && W:welding)
src.light(user, "<span style=\"color:red\"><b>[user]</b> casually lights [src] with [W], what a badass.</span>")
else if (istype(W, /obj/item/clothing/head/cakehat) && W:on)
src.light(user, "<span style=\"color:red\">Did [user] just light \his [src] with [W]? Holy Shit.</span>")
else if (istype(W, /obj/item/device/igniter))
src.light(user, "<span style=\"color:red\"><b>[user]</b> fumbles around with [W]; a small flame erupts from [src].</span>")
else if (istype(W, /obj/item/zippo) && W:lit)
src.light(user, "<span style=\"color:red\">With a single flick of their wrist, [user] smoothly lights [src] with [W]. Damn they're cool.</span>")
else if ((istype(W, /obj/item/match) || istype(W, /obj/item/device/candle)) && W:lit)
src.light(user, "<span style=\"color:red\"><b>[user] lights [src] with [W].</span>")
else if (W.burning)
src.light(user, "<span style=\"color:red\"><b>[user]</b> lights [src] with [W]. Goddamn.</span>")
else
return ..()
process()
if (src.lit)
var/turf/location = src.loc
if (ismob(location))
var/mob/M = location
if (M.find_in_hand(src))
location = M.loc
var/turf/T = get_turf(src.loc)
if (T)
T.hotspot_expose(700,5)
proc/light(var/mob/user as mob, var/message as text)
if (!src) return
if (!src.lit)
src.lit = 1
src.damtype = "fire"
src.force = 3
src.icon_state = src.icon_on
light.enable()
if (!(src in processing_items))
processing_items.Add(src)
return
proc/put_out(var/mob/user as mob)
if (!src) return
if (src.lit)
src.lit = 0
src.damtype = "brute"
src.force = 0
src.icon_state = src.icon_off
light.disable()
if (src in processing_items)
processing_items.Remove(src)
return
/obj/item/device/candle/spooky
name = "spooky candle"
desc = "It's a big candle. It's also floating."
anchored = 1
New()
..()
var/spookydegrees = rand(5, 20)
spawn(rand(1, 10))
animate(src, pixel_y = 32, transform = matrix(spookydegrees, MATRIX_ROTATE), time = 20, loop = -1, easing = SINE_EASING)
animate(pixel_y = 0, transform = matrix(spookydegrees * -1, MATRIX_ROTATE), time = 20, loop = -1, easing = SINE_EASING)
/obj/item/device/candle/haunted
name = "haunted candle"
desc = "As opposed to your more standard spooky candle. It smells horrid."
edible = 1 // eat a haunted goddamn candle every day
var/did_thing = 0
New()
..()
if (!src.reagents)
var/datum/reagents/R = new /datum/reagents(50)
src.reagents = R
R.my_atom = src
// yes this is dumb as hell but it makes me laugh a bunch
src.reagents.add_reagent("wax", 20)
src.reagents.add_reagent("black_goop", 10)
src.reagents.add_reagent("yuck", 10)
src.reagents.add_reagent("ectoplasm", 10)
return
light(var/mob/user as mob, var/message as text)
..()
if(src.lit && !src.did_thing)
src.did_thing = 1
//what should it do, other than this sound?? i tried a particle system but it didn't work :{
playsound(get_turf(src), pick('sound/ambience/ambimo1.ogg','sound/ambience/ambimo2.ogg'), 65, 0)
return
/obj/item/device/candle/small
name = "small candle"
desc = "It's a little candle."
icon = 'icons/obj/decoration.dmi'
icon_state = "lil_candle0"
icon_off = "lil_candle0"
icon_on = "lil_candle1"
brightness = 0.8
+180
View File
@@ -0,0 +1,180 @@
/obj/item/device/gps
name = "space GPS"
desc = "Tells you your coordinates based on the nearest coordinate beacon."
icon_state = "gps"
item_state = "electronic"
var/allowtrack = 1 // defaults to on so people know where you are (sort of!)
var/serial = "4200" // shouldnt show up as this
var/identifier = "NT13" // four characters max plz
var/distress = 0
flags = FPRINT | TABLEPASS| CONDUCT
w_class = 2.0
m_amt = 50
g_amt = 100
mats = 2
module_research = list("science" = 1, "devices" = 1, "miniaturization" = 8)
proc/get_z_info(var/turf/T)
. = "Landmark: Unknown"
if (!T)
return
if (!istype(T))
T = get_turf(T)
if (!T)
return
if (T.z == 1)
if (map_setting == "DESTINY")
. = "Landmark: NSS Destiny"
else
. = "Landmark: Station"
else if (T.z == 2)
. = "Landmark: Restricted"
else if (T.z == 3)
. = "Landmark: Debris Field"
return
proc/show_HTML(var/mob/user)
if (!user)
return
user.machine = src
var/HTML = "<span style='font-size:80%;text-align:right'><A href='byond://?src=\ref[src];refresh=6'>(Refresh)</A></span><br>"
HTML += "Each GPS is coined with a unique four digit number followed by a four letter identifier.<br>This GPS is assigned <b>[serial]-[identifier]</b>.<hr>"
HTML += "<A href='byond://?src=\ref[src];getcords=1'>Get Local Coordinates</A><BR>"
if (allowtrack == 0)
HTML += "<A href='byond://?src=\ref[src];track1=2'>Enable Tracking</A><BR>"
if (allowtrack == 1)
HTML += "<A href='byond://?src=\ref[src];track2=3'>Disable Tracking</A><BR>"
HTML += "<A href='byond://?src=\ref[src];changeid=4'>Change Identifier</A><BR>"
HTML += "<A href='byond://?src=\ref[src];help=5'>Toggle Distress Signal</A><BR>"
HTML += "<hr>"
HTML += "<b>GPSes</b>:<br>"
for (var/obj/item/device/gps/G in world)
if (G.allowtrack == 1)
var/turf/T = get_turf(G.loc)
if (!T)
continue
HTML += "<span style='font-size:80%'><b>[G.serial]-[G.identifier]</b> located at: [T.x], [T.y]. [src.get_z_info(T)]</span><br>"
HTML += "<span style='font-size:65%'>[G.distress ? "<font color=\"red\">(DISTRESS)</font>" : "<font color=666666>(DISTRESS)</font>"]</span><br>"
HTML += "<hr>"
HTML += "<b>Tracking Implants</b>:<br>"
for (var/obj/item/implant/tracking/imp in world)
if (iscarbon(imp.loc))
var/turf/T = get_turf(imp.loc)
if (!T)
continue
HTML += "<span style='font-size:80%'><b>[imp.loc.name]</b> located at: [T.x], [T.y]. [src.get_z_info(T)]</span><br>"
HTML += "<hr>"
HTML += "<b>Beacons</b>:<br>"
for (var/obj/machinery/beacon/B in machines)
if (B.enabled == 1)
var/turf/T = get_turf(B.loc)
HTML += "<span style='font-size:80%'><b>[B.sname]</b> located at: [T.x], [T.y]. [src.get_z_info(T)]</span><br>"
HTML += "<br>"
//user << browse(HTML, "window=gps;size=400x540")
user.Browse(HTML, "window=gps_[src];title=GPS;size=400x540")
onclose(user, "gps")
attack_self(mob/user as mob)
if ((user.contents.Find(src) || user.contents.Find(src.master) || get_dist(src, user) <= 1 && istype(src.loc, /turf)))
src.show_HTML(user)
else
//user << browse(null, "window=gps")
user.Browse(null, "window=gps_[src]")
user.machine = null
return
Topic(href, href_list)
..()
if (usr.stat || usr.restrained() || usr.lying)
return
if ((usr.contents.Find(src) || usr.contents.Find(src.master) || in_range(src, usr) && istype(src.loc, /turf)))
usr.machine = src
if(href_list["getcords"])
boutput(usr, "<span style=\"color:blue\">Located at: <b>X</b>: [usr.x], <b>Y</b>: [usr.y]</span>")
if(href_list["track1"])
boutput(usr, "<span style=\"color:blue\">Tracking enabled.</span>")
src.allowtrack = 1
if(href_list["track2"])
boutput(usr, "<span style=\"color:blue\">Tracking disabled.</span>")
src.allowtrack = 0
if(href_list["changeid"])
var/t = strip_html(input(usr, "Enter new GPS identification name (must be 4 characters)", src.identifier) as text)
if(length(t) > 4)
boutput(usr, "<span style=\"color:red\">Input too long.</span>")
return
if(length(t) < 4)
boutput(usr, "<span style=\"color:red\">Input too short.</span>")
return
if(!t)
return
src.identifier = t
if(href_list["help"])
if(!distress)
boutput(usr, "<span style=\"color:red\">Sending distress signal.</span>")
distress = 1
//IBMNOTE: This really should be changed to use the radio system, for (x in world) sucks
for(var/obj/item/device/gps/G in world)
G.visible_message("<b>[bicon(G)] [G]</b> beeps, \"NOTICE: Distress signal recieved.\".")
else
distress = 0
boutput(usr, "<span style=\"color:red\">Distress signal cleared.</span>")
for(var/obj/item/device/gps/G in world)
G.visible_message("<b>[bicon(G)] [G]</b> beeps, \"NOTICE: Distress signal cleared.\".")
if(href_list["refresh"])
..()
if (!src.master)
if (istype(src.loc, /mob))
attack_self(src.loc)
else
for(var/mob/M in viewers(1, src))
if (M.client && (M.machine == src.master || M.machine == src))
src.attack_self(M)
else
if (istype(src.master.loc, /mob))
src.attack_self(src.master.loc)
else
for(var/mob/M in viewers(1, src.master))
if (M.client && (M.machine == src.master || M.machine == src))
src.attack_self(M)
src.add_fingerprint(usr)
else
//usr << browse(null, "window=gps")
usr.Browse(null, "window=gps_[src]")
return
return
New()
serial = rand(4201,7999)
desc += " It's serial code is [src.serial]-[identifier]."
// coordinate beacons. pretty useless but whatever you never know
/obj/machinery/beacon
name = "coordinate beacon"
desc = "A coordinate beacon used for space GPSes."
icon = 'icons/obj/ship.dmi'
icon_state = "beacon"
var/sname = "unidentified"
var/enabled = 1
process()
if(enabled == 1)
use_power(50)
attack_hand()
enabled = !enabled
boutput(usr, "<span style=\"color:blue\">You switch the beacon [src.enabled ? "on" : "off"].</span>")
attack_ai(mob/user as mob)
var/t = input(user, "Enter new beacon identification name", src.sname) as text
t = strip_html(dd_replacetext(t, "'",""))
t = copytext(t, 1, 45)
if (!t)
return
src.sname = t
+156
View File
@@ -0,0 +1,156 @@
/obj/item/device/igniter
name = "igniter"
desc = "A small electronic device able to ignite combustable substances."
icon_state = "igniter"
var/status = 1.0
flags = FPRINT | TABLEPASS| CONDUCT
item_state = "electronic"
m_amt = 100
throwforce = 5
w_class = 1.0
throw_speed = 3
throw_range = 10
mats = 2
module_research = list("science" = 1, "miniaturization" = 5, "devices" = 3)
/obj/item/device/igniter/attack(mob/M as mob, mob/user as mob)
if (ishuman(M))
if (M:bleeding || (M:butt_op_stage == 4 && user.zone_sel.selecting == "chest"))
if (!src.cautery_surgery(M, user, 15))
return ..()
else return ..()
else return ..()
/obj/item/device/igniter/attackby(obj/item/W as obj, mob/user as mob)
if ((istype(W, /obj/item/device/radio/signaler) && !( src.status )))
var/obj/item/device/radio/signaler/S = W
if (!( S.b_stat ))
return
var/obj/item/assembly/rad_ignite/R = new /obj/item/assembly/rad_ignite( user )
S.set_loc(R)
R.part1 = S
S.layer = initial(S.layer)
user.u_equip(S)
user.put_in_hand_or_drop(R)
S.master = R
src.master = R
src.layer = initial(src.layer)
user.u_equip(src)
src.set_loc(R)
R.part2 = src
src.add_fingerprint(user)
else if ((istype(W, /obj/item/device/prox_sensor) && !( src.status )))
var/obj/item/assembly/prox_ignite/R = new /obj/item/assembly/prox_ignite( user )
W.set_loc(R)
R.part1 = W
W.layer = initial(W.layer)
user.u_equip(W)
user.put_in_hand_or_drop(R)
W.master = R
src.master = R
src.layer = initial(src.layer)
user.u_equip(src)
src.set_loc(R)
R.part2 = src
src.add_fingerprint(user)
else if ((istype(W, /obj/item/device/timer) && !( src.status )))
var/obj/item/assembly/time_ignite/R = new /obj/item/assembly/time_ignite( user )
W.set_loc(R)
R.part1 = W
W.layer = initial(W.layer)
user.u_equip(W)
user.put_in_hand_or_drop(R)
W.master = R
src.master = R
src.layer = initial(src.layer)
user.u_equip(src)
src.set_loc(R)
R.part2 = src
src.add_fingerprint(user)
else if ((istype(W, /obj/item/device/healthanalyzer) && !( src.status )))
var/obj/item/assembly/anal_ignite/R = new /obj/item/assembly/anal_ignite( user ) // Hehehe anal
W.set_loc(R)
R.part1 = W
W.layer = initial(W.layer)
user.u_equip(W)
user.put_in_hand_or_drop(R)
W.master = R
src.master = R
src.layer = initial(src.layer)
user.u_equip(src)
src.set_loc(R)
R.part2 = src
src.add_fingerprint(user)
else if ((istype(W, /obj/item/device/multitool) && !(src.status)))
var/obj/item/assembly/detonator/R = new /obj/item/assembly/detonator(user);
W.loc = R
W.master = R
W.layer = initial(W.layer)
src.loc = R
src.master = R
src.layer = initial(src.layer)
R.part_mt = W
R.part_ig = src
R.loc = user
user.u_equip(src)
user.u_equip(W)
user.put_in_hand_or_drop(R)
R.setDetState(0)
src.add_fingerprint(user)
user.show_message("<span style=\"color:blue\">You hook up the igniter to the multitool's panel.</span>")
if (!( istype(W, /obj/item/screwdriver) ))
return
src.status = !( src.status )
if (src.status)
user.show_message("<span style=\"color:blue\">The igniter is ready!</span>")
else
user.show_message("<span style=\"color:blue\">The igniter can now be attached!</span>")
src.add_fingerprint(user)
return
/obj/item/device/igniter/attack_self(mob/user as mob)
src.add_fingerprint(user)
spawn( 5 )
ignite()
return
return
/obj/item/device/igniter/afterattack(atom/target, mob/user as mob)
if (!ismob(target) && target.reagents)
boutput(usr, "<span style=\"color:blue\">You heat \the [target.name]</span>")
target.reagents.temperature_reagents(20000,50)
/obj/item/device/igniter/proc/ignite()
if (src.status)
var/turf/location = src.loc
if (src.master)
location = src.master.loc
location = get_turf(location)
if(location)
location.hotspot_expose((isturf(location) ? 3000 : 30000),2000)
return
/obj/item/device/igniter/examine()
set src in view()
set category = "Local"
..()
if ((in_range(src, usr) || src.loc == usr))
if (src.status)
usr.show_message("The igniter is ready!")
else
usr.show_message("The igniter can be attached!")
return
+319
View File
@@ -0,0 +1,319 @@
/*
Contains:
- Laser tripwire
- Infrared sensor
- Remote signaller/tripwire assembly
*/
//////////////////////////////////////// Laser tripwire //////////////////////////////
/obj/item/device/infra
name = "Laser Tripwire"
desc = "Emits a visible or invisible beam and is triggered when the beam is interrupted."
icon_state = "infrared0"
var/obj/beam/i_beam/first = null
var/state = 0.0
var/visible = 0.0
flags = FPRINT | TABLEPASS| CONDUCT
w_class = 2.0
item_state = "electronic"
m_amt = 150
mats = 3
///////////////////////////////////////// Infrared sensor ///////////////////////////////////////////
/obj/item/device/infra_sensor
name = "Infrared Sensor"
desc = "Scans for infrared beams in the vicinity."
icon_state = "infra_sensor"
var/passive = 1.0
flags = FPRINT | TABLEPASS| CONDUCT
item_state = "electronic"
m_amt = 150
mats = 4
/* When/if someone ever gets around to fixing these uncomment this
/obj/item/device/infra_sensor/process()
if (src.passive)
for(var/obj/beam/i_beam/I in range(2, src.loc))
I.left = 2
return 1
else
processing_items.Remove(src)
return null
/obj/item/device/infra_sensor/proc/burst()
for(var/obj/beam/i_beam/I in range(src.loc))
I.left = 10
for(var/obj/item/device/infra/I in range(src.loc))
I.visible = 1
spawn( 0 )
if ((I && I.first))
I.first.vis_spread(1)
return
for(var/obj/item/assembly/rad_infra/I in range(src.loc))
I.part2.visible = 1
spawn( 0 )
if ((I.part2 && I.part2.first))
I.part2.first.vis_spread(1)
return
return
/obj/item/device/infra_sensor/attack_self(mob/user as mob)
user.machine = src
var/dat = text("<TT><B>Infrared Sensor</B><BR><br><B>Passive Emitter</B>: []<BR><br><B>Active Emitter</B>: <A href='?src=\ref[];active=0'>Burst Fire</A><br></TT>", (src.passive ? text("<A href='?src=\ref[];passive=0'>On</A>", src) : text("<A href='?src=\ref[];passive=1'>Off</A>", src)), src)
user << browse(dat, "window=infra_sensor")
onclose(user, "infra_sensor")
return
/obj/item/device/infra_sensor/Topic(href, href_list)
..()
if (usr.stat || usr.restrained())
return
if ((usr.contents.Find(src) || (usr.contents.Find(src.master) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf)))))
usr.machine = src
if (href_list["passive"])
src.passive = !( src.passive )
if(passive && !(src in processing_items))
processing_items.Add(src)
if (href_list["active"])
spawn( 0 )
src.burst()
return
if (!( src.master ))
if (istype(src.loc, /mob))
attack_self(src.loc)
else
for(var/mob/M in viewers(1, src))
if (M.client)
src.attack_self(M)
else
if (istype(src.master.loc, /mob))
src.attack_self(src.master.loc)
else
for(var/mob/M in viewers(1, src.master))
if (M.client)
src.attack_self(M)
src.add_fingerprint(usr)
else
usr << browse(null, "window=infra_sensor")
onclose(usr, "infra_sensor")
return
return
/obj/item/device/infra/proc/hit()
if (src.master)
spawn()
var/datum/signal/signal = new
signal.data["message"] = "ACTIVATE"
src.master.receive_signal(signal)
qdel(signal)
return
else
for(var/mob/O in hearers(null, null))
O.show_message(text("[bicon()] *beep* *beep*", src), 3, "*beep* *beep*", 2)
return
/obj/item/device/infra/process()
if(!state)
processing_items.Remove(src)
return null
if ((!( src.first ) && (src.state && (istype(src.loc, /turf) || (src.master && istype(src.master.loc, /turf))))))
var/obj/beam/i_beam/I = new /obj/beam/i_beam( (src.master ? src.master.loc : src.loc) )
//boutput(world, "infra spawning beam : \ref[I]")
I.master = src
I.density = 1
I.dir = src.dir
step(I, I.dir)
if (I)
//boutput(world, "infra: beam at [I.x] [I.y] [I.z]")
I.density = 0
src.first = I
//boutput(world, "infra : vis_spread")
I.vis_spread(src.visible)
spawn( 0 )
if (I)
//boutput(world, "infra: setting limit")
I.limit = 20
//boutput(world, "infra: processing beam \ref[I]")
I.process()
return
if (!( src.state ))
//src.first = null
qdel(src.first)
return
/obj/item/device/infra/attackby(obj/item/device/radio/signaler/S as obj, mob/user as mob)
if ((!( istype(S, /obj/item/device/radio/signaler) ) || !( S.b_stat )))
return
var/obj/item/assembly/rad_infra/R = new /obj/item/assembly/rad_infra( user )
S.set_loc(R)
R.part1 = S
S.layer = initial(S.layer)
user.u_equip(S)
user.put_in_hand_or_drop(R)
S.master = R
src.master = R
src.layer = initial(src.layer)
user.u_equip(src)
src.set_loc(R)
R.part2 = src
R.dir = src.dir
src.add_fingerprint(user)
return
/obj/item/device/infra/attack_self(mob/user as mob)
user.machine = src
var/dat = text("<TT><B>Infrared Laser</B><br><B>Status</B>: []<BR><br><B>Visibility</B>: []<BR><br></TT>", (src.state ? text("<A href='?src=\ref[];state=0'>On</A>", src) : text("<A href='?src=\ref[];state=1'>Off</A>", src)), (src.visible ? text("<A href='?src=\ref[];visible=0'>Visible</A>", src) : text("<A href='?src=\ref[];visible=1'>Invisible</A>", src)))
user << browse(dat, "window=infra")
onclose(user, "infra")
return
/obj/item/device/infra/Topic(href, href_list)
..()
if (usr.stat || usr.restrained())
return
if ((usr.contents.Find(src) || usr.contents.Find(src.master) || in_range(src, usr) && istype(src.loc, /turf)))
usr.machine = src
if (href_list["state"])
src.state = !( src.state )
src.icon_state = text("infrared[]", src.state)
if (src.master)
src.master:c_state(src.state, src)
if(state && !(src in processing_items))
processing_items.Add(src)
if (href_list["visible"])
src.visible = !( src.visible )
spawn( 0 )
if (src.first)
src.first.vis_spread(src.visible)
return
if (!( src.master ))
if (istype(src.loc, /mob))
attack_self(src.loc)
else
for(var/mob/M in viewers(1, src))
if (M.client)
src.attack_self(M)
//Foreach goto(211)
else
if (istype(src.master.loc, /mob))
src.attack_self(src.master.loc)
else
for(var/mob/M in viewers(1, src.master))
if (M.client)
src.attack_self(M)
//Foreach goto(287)
else
usr << browse(null, "window=infra")
onclose(usr, "infra")
return
return
/obj/item/device/infra/attack_hand()
//src.first = null
qdel(src.first)
..()
return
/obj/item/device/infra/Move()
var/t = src.dir
..()
src.dir = t
//src.first = null
qdel(src.first)
return
/obj/item/device/infra/verb/rotate()
set src in usr
src.dir = turn(src.dir, 90)
return
*/
/////////////////////////////////////// Remote signaller/tripwire assembly /////////////////////////////////
/obj/item/assembly/rad_infra
name = "Signaller/Infrared Assembly"
desc = "An infrared-activated radio signaller"
icon_state = "infrared-radio0"
var/obj/item/device/radio/signaler/part1 = null
var/obj/item/device/infra/part2 = null
status = null
flags = FPRINT | TABLEPASS| CONDUCT
/obj/item/assembly/rad_infra/c_state(n)
src.icon_state = text("infrared-radio[]", n)
return
/*
/obj/item/assembly/rad_infra/Del()
qdel(src.part1)
qdel(src.part2)
..()
return
/obj/item/assembly/rad_infra/attackby(obj/item/W as obj, mob/user as mob)
if ((istype(W, /obj/item/wrench) && !( src.status )))
var/turf/T = src.loc
if (ismob(T))
T = T.loc
src.part1.set_loc(T)
src.part2.set_loc(T)
src.part1.master = null
src.part2.master = null
src.part1 = null
src.part2 = null
//SN src = null
qdel(src)
return
if (!( istype(W, /obj/item/screwdriver) ))
return
src.status = !( src.status )
if (src.status)
user.show_message("<span style=\"color:blue\">The infrared laser is now secured!</span>", 1)
else
user.show_message("<span style=\"color:blue\">The infrared laser is now unsecured!</span>", 1)
src.part1.b_stat = !( src.status )
src.add_fingerprint(user)
return
/obj/item/assembly/rad_infra/attack_self(mob/user as mob)
src.part1.attack_self(user, src.status)
src.part2.attack_self(user, src.status)
src.add_fingerprint(user)
return
/obj/item/assembly/rad_infra/receive_signal(datum/signal/signal)
if (signal.source == src.part2)
src.part1.send_signal("ACTIVATE")
return
/obj/item/assembly/rad_infra/verb/rotate()
set src in usr
src.dir = turn(src.dir, 90)
src.part2.dir = src.dir
src.add_fingerprint(usr)
return
/obj/item/assembly/rad_infra/Move()
var/t = src.dir
..()
src.dir = t
//src.part2.first = null
qdel(src.part2.first)
return
/obj/item/assembly/rad_infra/attack_hand(M)
qdel(src.part2.first)
..()
return
*/
+109
View File
@@ -0,0 +1,109 @@
/obj/item/device/microphone
name = "microphone"
icon = 'icons/obj/device.dmi'
icon_state = "mic"
var/max_font = 8
var/font_amp = 4
var/on = 1
get_desc()
..()
. += "It's currently [src.on ? "on" : "off"]."
attack_self(mob/user as mob)
src.on = !(src.on)
user.show_text("You switch [src] [src.on ? "on" : "off"].")
if (src.on && prob(5))
if (locate(/obj/loudspeaker) in range(2, user))
for (var/obj/loudspeaker/S in range(7, user))
S.visible_message("<span style=\"color:red\">[S] lets out a horrible [pick("shriek", "squeal", "noise", "squawk", "screech", "whine", "squeak")]!</span>")
playsound(S.loc, 'sound/items/mic_feedback.ogg', 30, 1)
hear_talk(mob/M as mob, msg, real_name, lang_id)
if (!src.on)
return
var/turf/T = get_turf(src)
if (M in range(1, T))
src.talk_into(M, msg, null, real_name, lang_id)
talk_into(mob/M as mob, messages, param, real_name, lang_id)
if (!src.on)
return
var/speakers = 0
var/turf/T = get_turf(src)
for (var/obj/loudspeaker/S in range(7, T))
speakers ++
if (!speakers)
return
speakers += font_amp // 2 ain't huge so let's give ourselves a little boost
var/stuff = M.say_quote(messages[1])
var/stuff_b = M.say_quote(messages[2])
var/list/mobs_messaged = list()
for (var/obj/loudspeaker/S in range(7, T))
for (var/mob/H in hearers(S, null))
if (H in mobs_messaged)
continue
var/U = H.say_understands(M, lang_id)
H.show_text("<font size=[min(src.max_font, max(0, speakers - round(get_dist(H, S) / 2), 1))]><b>[M.get_heard_name()]</b> [U ? stuff : stuff_b]</font>")
mobs_messaged += H
if (prob(10) && locate(/obj/loudspeaker) in range(2, T))
for (var/obj/loudspeaker/S in range(7, T))
S.visible_message("<span style=\"color:red\">[S] lets out a horrible [pick("shriek", "squeal", "noise", "squawk", "screech", "whine", "squeak")]!</span>")
playsound(S.loc, 'sound/items/mic_feedback.ogg', 30, 1)
/obj/mic_stand
name = "microphone stand"
icon = 'icons/obj/device.dmi'
icon_state = "micstand"
mats = 10
layer = FLY_LAYER
var/obj/item/device/microphone/myMic = null
New()
spawn(1)
if (!myMic)
myMic = new(src)
return ..()
attack_hand(mob/user as mob)
if (!myMic)
return ..()
user.put_in_hand_or_drop(myMic)
myMic = null
src.update_icon()
return ..()
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/device/microphone))
if (myMic)
user.show_text("There's already a microphone on [src]!", "red")
return
user.show_text("You place the [W] on [src].", "blue")
myMic = W
user.u_equip(W)
W.set_loc(src)
src.update_icon()
else
return ..()
hear_talk(mob/M as mob, msg, real_name)
if (!myMic || !myMic.on)
return
var/turf/T = get_turf(src)
if (M in range(1, T))
myMic.talk_into(M, msg)
proc/update_icon()
if (myMic)
src.icon_state = "micstand"
else
src.icon_state = "micstand-empty"
/obj/loudspeaker
name = "loudspeaker"
icon = 'icons/obj/device.dmi'
icon_state = "loudspeaker"
anchored = 1
density = 1
mats = 15
+14
View File
@@ -0,0 +1,14 @@
/obj/item/device/multitool
name = "multitool"
icon_state = "multitool"
flags = FPRINT | TABLEPASS| CONDUCT
force = 5.0
w_class = 2.0
throwforce = 5.0
throw_range = 15
throw_speed = 3
desc = "You can use this on airlocks or APCs to try to hack them without cutting wires."
m_amt = 50
g_amt = 20
mats = 6
module_research = list("tools" = 5, "devices" = 2)
+733
View File
@@ -0,0 +1,733 @@
/datum/computer/file/pda_program/os
proc
receive_os_command(list/command_list)
if((!src.holder) || (!src.master) || (!command_list) || !(command_list["command"]))
return 1
if((!istype(holder)) || (!istype(master)))
return 1
if(!(holder in src.master.contents))
if(master.active_program == src)
master.active_program = null
return 1
return 0
pda_message()
//Main os program: Provides old pda interface and four programs including file browser, notes, messenger, and atmos scan
main_os
name = "ThinkOS 7"
size = 8
var/mode = 0
//Note vars
var/note = "Congratulations, your station has chosen the Thinktronic 5150 Personal Data Assistant!"
var/note_mode = 0 //0 For note editor, 1 for note browser
var/datum/computer/file/text/note_file = null //If set, save to this file.
var/datum/computer/folder/note_folder = null //Which folder are we looking in?
//Messenger vars
var/list/detected_pdas = list()
var/message_on = 1
var/message_silent = 0 //To beep or not to beep, that is the question
var/message_mode = 0 //0 for pda list, 1 for messages
var/message_tone = "beep" //Custom ringtone
var/message_note = null //Current messages in memory (Store as separate file only later??)
var/message_last = 0 //world.time of last send for both messages and file sending.
var/last_filereq_id = null //net id of last dude to request a file transfer
var/target_filereq_id = null //Who are we trying to send a file to?
//File browser vars
var/datum/computer/folder/browse_folder = null
var/datum/computer/file/clipboard = null //Current file to copy
mess_off //Same as regular but with messaging off
message_on = 0
disposing()
if (detected_pdas)
detected_pdas.len = 0
detected_pdas = null
note_folder = null
note_file = null
browse_folder = null
clipboard = null
..()
receive_os_command(list/command_list)
if(..())
return
//boutput(world, "[command_list["command"]]")
return
return_text()
if(..())
return
. = src.return_text_header()
switch(src.mode)
if(0)
. += "<h2>PERSONAL DATA ASSISTANT</h2>"
. += "Owner: [src.master.owner]<br><br>"
. += "<h4>General Functions</h4>"
. += "<ul>"
. += "<li><a href='byond://?src=\ref[src];mode=1'>Notekeeper</a></li>"
. += "<li><a href='byond://?src=\ref[src];mode=2'>Messenger</a></li>"
. += "<li><a href='byond://?src=\ref[src];mode=3'>File Browser</a></li>"
. += "</ul>"
. += "<h4>Utilities</h4>"
. += "<ul>"
. += "<li><a href='byond://?src=\ref[src];mode=4'>Atmospheric Scan</a></li>"
. += "<li>Scanner: [src.master.scan_program ? "<a href='byond://?src=\ref[src];scanner=1'>[src.master.scan_program.name]</a>" : "None loaded"]</li>"
// . += "<li><a href='byond://?src=\ref[src];flight=1'>[src.master.fon ? "Disable" : "Enable"] Flashlight</a></li>"
if(src.master.module)
if(src.master.module.setup_allow_os_config)
. += "<li><a href='byond://?src=\ref[src];mode=5'>Module Config</a></li>"
if(src.master.module.setup_use_menu_badge)
. += "<li>[src.master.module.return_menu_badge()]</li>"
. += "</ul>"
if(1)
//Note Program. Can save/load note files.
. += "<h4>Notekeeper V2.5</h4>"
if(!src.note_mode)
if ((!isnull(src.master.uplink)) && (src.master.uplink.active))
. += "<a href='byond://?src=\ref[src];note_func=lock'>Lock</a><br>"
else
. += "<a href='byond://?src=\ref[src];input=note'>Edit</a>"
. += " | <a href='byond://?src=\ref[src];note_func=new'>New File</a>"
. += " | <a href='byond://?src=\ref[src];note_func=save'>Save</a>"
. += " | <a href='byond://?src=\ref[src];note_func=switchmenu'>Load</a><br>"
. += src.note
else
. += " <a href='byond://?src=\ref[src];note_func=switchmenu'>Back</a>"
if((!src.note_folder) || !(src.note_folder.holder in src.master))
src.note_folder = src.holding_folder
. += " | \[[src.note_folder.holder.file_amount - src.note_folder.holder.file_used]\] Free"
. += " \[<a href='byond://?src=\ref[src];note_func=drive'>[src.note_folder.holder == src.master.hd ? "MAIN" : "CART"]</a>\]<br>"
. += "<table cellspacing=5>"
for(var/datum/computer/file/text/T in src.note_folder.contents)
. += "<tr><td><a href='byond://?src=\ref[src];target=\ref[T];note_func=load'>[T.name]</a></td>"
. += "<td>[T.extension]</td>"
. += "<td>Length: [T.data ? (length(T.data)) : "0"]</td></tr>"
. += "</table>"
if(2)
//Messenger. Uses Radio. Is a messenger.
src.master.overlays = null //Remove existing alerts
. += "<h4>SpaceMessenger V4.0.5</h4>"
if (!src.message_mode)
. += "<a href='byond://?src=\ref[src];message_func=ringer'>Ringer: [src.message_silent == 1 ? "Off" : "On"]</a> | "
. += "<a href='byond://?src=\ref[src];message_func=on'>Send / Receive: [src.message_on == 1 ? "On" : "Off"]</a> | "
. += "<a href='byond://?src=\ref[src];input=tone'>Set Ringtone</a> | "
. += "<a href='byond://?src=\ref[src];message_mode=1'>Messages</a><br>"
. += "<font size=2><a href='byond://?src=\ref[src];message_func=scan'>Scan</a></font><br>"
. += "<b>Detected PDAs</b><br>"
. += "<ul>"
var/count = 0
if (src.message_on)
for (var/department_id in page_departments)
. += "<li><a href='byond://?src=\ref[src];input=message;target=[page_departments[department_id]];department=1'>DEPT-[department_id]</a></li>"
for (var/P_id in src.detected_pdas)
var/P_name = src.detected_pdas[P_id]
if (!P_name)
src.detected_pdas -= P_id
continue
else if (P_id == src.master.net_id) //I guess this can happen if somebody copies the system file.
src.detected_pdas -= P_id
continue
. += "<li><a href='byond://?src=\ref[src];input=message;target=[P_id]'>PDA-[P_name]</a>"
. += " (<a href='byond://?src=\ref[src];input=send_file;target=[P_id]'>*Send File*</a>)"
. += "</li>"
count++
. += "</ul>"
if (count == 0 && !page_departments.len)
. += "None detected.<br>"
else
. += "<a href='byond://?src=\ref[src];message_func=clear'>Clear</a> | "
. += "<a href='byond://?src=\ref[src];message_mode=0'>Back</a><br>"
. += "<h4>Messages</h4>"
. += src.message_note
. += "<br>"
if(3)
//File Browser.
//To-do(?): Setting "favorite" programs to access straight from main menu
//Not sure how needed it is, not like they have to go through 500 subfolders or whatever
if((!src.browse_folder) || !(src.browse_folder.holder in src.master))
src.browse_folder = src.holding_folder
. += " | <a href='byond://?src=\ref[src];target=\ref[src.browse_folder];browse_func=paste'>Paste</a><br>"
. += "<b>Contents of [browse_folder] | Drive ID:\[[src.browse_folder.holder.title]]</b><br>"
. += "<b>Used: \[[src.browse_folder.holder.file_used]/[src.browse_folder.holder.file_amount]\]</b><hr>"
. += "<table cellspacing=5>"
for(var/datum/computer/file/F in browse_folder.contents)
if(F == src)
. += "<tr><td>System</td><td>Size: [src.size]</td><td>SYSTEM</td></tr>"
continue
. += "<tr><td><a href='byond://?src=\ref[src];target=\ref[F];browse_func=open'>[F.name]</a></td>"
. += "<td>Size: [F.size]</td>"
. += "<td>[F.extension]</td>"
. += "<td><a href='byond://?src=\ref[src];target=\ref[F];browse_func=delete'>Del</a></td>"
. += "<td><a href='byond://?src=\ref[src];target=\ref[F];input=rename'>Rename</a></td>"
. += "<td><a href='byond://?src=\ref[src];target=\ref[F];browse_func=copy'>Copy</a></td>"
. += "</tr>"
. += "</table>"
var/datum/computer/folder/other_drive_folder
for (var/obj/item/disk/data/D in master)
if (D != src.browse_folder.holder && D.root)
other_drive_folder = D.root
break
if (other_drive_folder)
. += "<hr><b>Contents of [other_drive_folder] | Drive ID:\[[other_drive_folder.holder.title]]</b><br>"
. += "<b>Used: \[[other_drive_folder.holder.file_used]/[other_drive_folder.holder.file_amount]\]</b> | <a href='byond://?src=\ref[src];target=\ref[other_drive_folder];browse_func=paste'>Paste</a><hr>"
. += "<table cellspacing=5>"
for(var/datum/computer/file/F in other_drive_folder.contents)
if(F == src)
. += "<tr><td>System</td><td>Size: [src.size]</td><td>SYSTEM</td></tr>"
continue
. += "<tr><td><a href='byond://?src=\ref[src];target=\ref[F];browse_func=open'>[F.name]</a></td>"
. += "<td>Size: [F.size]</td>"
. += "<td>[F.extension]</td>"
. += "<td><a href='byond://?src=\ref[src];target=\ref[F];browse_func=delete'>Del</a></td>"
. += "<td><a href='byond://?src=\ref[src];target=\ref[F];input=rename'>Rename</a></td>"
. += "<td><a href='byond://?src=\ref[src];target=\ref[F];browse_func=copy'>Copy</a></td>"
. += "</tr>"
. += "</table>"
if(4)
//Atmos Scanner
. += "<h4>Atmospheric Readings</h4>"
var/turf/T = get_turf(src.master)
if (isnull(T))
. += "Unable to obtain a reading.<br>"
else
. += scan_atmospheric(T, 1) // Replaced with global proc (Convair880).
. += "<br>"
Topic(href, href_list)
if(..())
return
if(href_list["mode"])
var/newmode = text2num(href_list["mode"])
src.mode = max(newmode, 0)
// else if(href_list["flight"])
// src.master.toggle_light()
else if(href_list["scanner"])
if(src.master.scan_program)
src.master.scan_program = null
else if(href_list["input"])
switch(href_list["input"])
if("tone")
var/t = input(usr, "Please enter new ringtone", src.name, src.message_tone) as text
if (!t)
return
if (!src.master || !in_range(src.master, usr) && src.master.loc != usr)
return
if(!(src.holder in src.master))
return
if ((src.master.uplink) && (cmptext(t,src.master.uplink.lock_code)))
boutput(usr, "The PDA softly beeps.")
src.master.uplink.unlock()
else
t = copytext(sanitize(strip_html(t)), 1, 20)
src.message_tone = t
if("note")
var/inputtext = html_decode(dd_replacetext(src.note, "<br>", "\n"))
var/t = input(usr, "Please enter note", src.name, inputtext) as message
if (!t)
return
if (!src.master || !in_range(src.master, usr) && src.master.loc != usr)
return
if(!(src.holder in src.master))
return
t = dd_replacetext(t, "\n", "|||")
t = copytext(adminscrub(t), 1, MAX_MESSAGE_LEN)
t = dd_replacetext(t, "|||", "<br>")
src.note = t
if("message")
if(src.message_last + 20 > world.time) //Message sending delay
return
//var/obj/item/device/pda2/P = locate(href_list["target"])
//if(!P || !istype(P) || !P.net_id)
//return
var/is_department_page = href_list["department"] == "1"
var/target_id = href_list["target"]
var/target_name = is_department_page ? target_id : detected_pdas[target_id]
if(!target_id in src.detected_pdas)
return
var/t = input(usr, "Please enter message", target_name, null) as text
if (!t)
return
src.pda_message(target_id, target_name, t, is_department_page)
if (href_list["norefresh"])
src.master.add_fingerprint(usr)
return
if("rename")
var/datum/computer/file/F = locate(href_list["target"])
if(!F || !istype(F))
return
var/t = input(usr, "Please enter new name", src.name, F.name) as text
t = copytext(sanitize(strip_html(t)), 1, 16)
if (!t)
return
if (!in_range(src.master, usr) || !(F.holder in src.master))
return
if(F.holder.read_only)
return
F.name = capitalize(lowertext(t))
if("send_file") //Give a file send request thing for current copied file.
if(src.message_last + 20 > world.time) //File sending delay.
return
var/target_id = href_list["target"]
var/target_name = detected_pdas[target_id]
if(!target_id in src.detected_pdas)
return
if(!src.message_on || !src.clipboard || !(src.clipboard.holder in src.master))
return
var/datum/signal/signal = get_free_signal()
signal.data["command"] = "file_send_req"
signal.data["file_name"] = src.clipboard.name
signal.data["file_ext"] = src.clipboard.extension
signal.data["file_size"] = src.clipboard.size
signal.data["sender_name"] = src.master.owner
//signal.data["sender"] = src.master.net_id
signal.data["address_1"] = target_id
src.post_signal(signal)
src.message_note += "<i><b>&rarr; File Send Request to [target_name]</b></i><br>"
src.target_filereq_id = target_id
src.message_last = world.time
else if(href_list["message_func"]) //Messenger specific topic junk
switch(href_list["message_func"])
if("ringer")
src.message_silent = !src.message_silent
if("on")
src.message_on = !src.message_on
if("clear")
src.message_note = null
if("scan")
if(src.message_on)
src.detected_pdas = list()
src.master.pdasay_autocomplete = list()
var/datum/signal/signal = get_free_signal()
signal.data["command"] = "report_pda"
//signal.data["sender"] = src.master.net_id
src.post_signal(signal)
if("accfile")
if(src.message_on)
var/datum/signal/newsignal = get_free_signal()
last_filereq_id = href_list["sender"]
if(!last_filereq_id) return
newsignal.data["address_1"] = last_filereq_id
newsignal.data["command"] = "file_send_acc"
src.post_signal(newsignal)
else if(href_list["note_func"]) //Note program specific topic junk
switch(href_list["note_func"])
if("new")
src.note_file = null
src.note = null
if("save")
if(isnull(src.note_file) || !(src.note_file.holder in src.master) || src.note_file.holder.read_only)
var/datum/computer/file/text/F = new /datum/computer/file/text
if(!src.holding_folder.add_file(F))
//qdel(F)
F.dispose()
else
src.note_file = F
F.data = src.note
else
src.note_file.data = src.note
if("load")
var/datum/computer/file/text/T = locate(href_list["target"])
if(!T || !istype(T))
return
src.note_file = T
src.note = note_file.data
src.note_mode = 0
if("switchmenu")
src.note_mode = !src.note_mode
if("drive")
if(src.note_folder.holder == src.master.hd && src.master.cartridge && (src.master.cartridge.root))
src.note_folder = src.master.cartridge.root
else
src.note_folder = src.holding_folder
if("lock")
if(src.master.uplink)
src.master.uplink.active = 0
src.note = src.master.uplink.orignote
else if(href_list["browse_func"]) //File browser specific topic junk
var/datum/computer/target = locate(href_list["target"])
switch(href_list["browse_func"])
if("drive")
if(src.browse_folder.holder == src.master.hd && src.master.cartridge && (src.master.cartridge.root))
src.browse_folder = src.master.cartridge.root
else
src.browse_folder = src.holding_folder
if("open")
if(!target || !istype(target))
return
if(istype(target, /datum/computer/file/pda_program))
if(istype(target,/datum/computer/file/pda_program/os) && (src.master.host_program))
return
else
src.master.run_program(target)
src.master.updateSelfDialog()
return
else if (istype(target, /datum/computer/file/text))
if(!isnull(src.master.uplink) && src.master.uplink.active)
return
else
src.note = target:data
src.note_file = target
src.mode = 1
src.master.updateSelfDialog()
return
if("delete")
if(!target || !istype(target))
return
src.master.delete_file(target)
if("copy")
if(istype(target,/datum/computer/file) && (!target.holder || (target.holder in src.master.contents)))
src.clipboard = target
if("paste")
if(istype(target,/datum/computer/folder))
if(!src.clipboard || !src.clipboard.holder || !(src.clipboard.holder in src.master.contents))
return
if(!istype(src.clipboard))
return
src.clipboard.copy_file_to_folder(target)
/*
if("install") //Given a file on another system and the other system itself.
var/obj/item/device/pda2/source = locate(href_list["sender"])
if(!source || !istype(source) || !target || !istype(target, /datum/computer/file))
return
if(!src.message_on)
return
if(!(target.holder in source.contents))
return
if(target:copy_file_to_folder(src.holding_folder))
src.message_note += "<b><i>File Accepted from [source.owner]</b></i><br>"
*/
else if(href_list["message_mode"])
var/newmode = text2num(href_list["message_mode"])
src.message_mode = max(newmode, 0)
src.master.add_fingerprint(usr)
src.master.updateSelfDialog()
return
network_hook(datum/signal/signal)
if(signal.data["command"] == "report_pda")
if(!message_on || !signal.data["sender"] || signal.data["sender"] == master.net_id)
return
var/datum/signal/newsignal = get_free_signal()
newsignal.data["command"] = "report_reply"
newsignal.data["address_1"] = signal.data["sender"]
newsignal.data["owner"] = src.master.owner
src.post_signal(newsignal)
src.master.updateSelfDialog()
return
receive_signal(datum/signal/signal)
if(..())
return
switch(signal.data["command"])
if("text_message")
if(!message_on || !signal.data["message"])
return
if(signal.data["group"]) //Check to see if it's our ~mailgroup~
if(signal.data["group"] != src.master.mailgroup)
return
var/sender = signal.data["sender_name"]
if(!sender)
sender = "!Unknown!"
if((length(signal.data["sender"]) == 8) && (ishex(signal.data["sender"])) )
if (!(signal.data["sender"] in src.detected_pdas))
src.detected_pdas += signal.data["sender"]
//src.master.pdasay_autocomplete += sender
src.detected_pdas[signal.data["sender"]] = sender
src.master.pdasay_autocomplete[sender] = signal.data["sender"]
//Only add the reply link if the sender is another pda2.
var/senderstring = "From <a href='byond://?src=\ref[src];input=message;target=[signal.data["sender"]]'>[sender]</a>"
src.message_note += "<i><b>&larr; [senderstring]:</b></i><br>[signal.data["message"]]<br>"
var/alert_beep = null //Don't beep if set to silent.
if(!src.message_silent)
alert_beep = src.message_tone
if((signal.data["batt_adjust"] == netpass_syndicate) && (signal.data["address_1"] == src.master.net_id) && !(src.master.exploding))
if (src.master)
src.master.exploding = 1
spawn(20)
if (src.master)
src.master.explode()
src.master.display_alert(alert_beep)
if(ismob(master.loc)) //Alert the person holding us.
var/mob/M = master.loc
boutput(M, "<i><b>[bicon(master)] <a href='byond://?src=\ref[src];input=message;norefresh=1;target=[signal.data["sender"]]'>[sender]</a>:</b></i> [signal.data["message"]]")
src.master.updateSelfDialog()
if("file_send_req")
if(!message_on)
return
var/filename = signal.data["file_name"]
var/sender = signal.data["sender"]
var/sendername = signal.data["sender_name"]
var/file_ext = signal.data["file_ext"]
var/filesize = signal.data["file_size"]
if(!filename || !sender)
return
if(!sendername)
sendername = "!Unknown!"
if(!(sender in src.detected_pdas))
src.detected_pdas += sender
//src.master.pdasay_autocomplete += sendername
src.detected_pdas[sender] = sendername
src.master.pdasay_autocomplete[sendername] = signal.data["sender"]
src.message_note += {"
<i><b>&larr;File Offer From <a href='byond://?src=\ref[src];input=message;target=[sender]'>[sendername]</a>:</b></i><br>
<a href='byond://?src=\ref[src];message_func=accfile;sender=[sender]'>[filename]</a>
| Ext: [file_ext ? file_ext : "NONE"]
| Size: [filesize ? filesize : "???"]<br>"}
var/alert_beep = null //Same as with messages
if(!src.message_silent)
alert_beep = src.message_tone
src.last_filereq_id = sender
src.master.display_alert(alert_beep)
if("file_send_acc")
if(!src.message_on)
return
if(!target_filereq_id || signal.data["sender"] != target_filereq_id)
return
if(!src.clipboard || !istype(src.clipboard))
return
var/datum/signal/sendsig = new
sendsig.data_file = src.clipboard.copy_file()
sendsig.data["command"] = "file_send"
sendsig.data["sender_name"] = src.master.owner
sendsig.data["address_1"] = signal.data["sender"]
src.post_signal(sendsig)
if("file_send")
if(!message_on)
return
if(!src.message_on)
return
var/sender = signal.data["sender"]
if(sender != last_filereq_id)
return
var/sender_name = "!UNKNOWN!"
if(signal.data["sender_name"])
sender_name = signal.data["sender_name"]
if(!signal.data_file)
return
if(signal.data_file.copy_file_to_folder(src.holding_folder))
src.message_note += "<b><i>File Accepted from [sender_name]</b></i><br>"
return
// this is now in network_hook
/*
if("report_pda")
if(!message_on || !signal.data["sender"])
return
var/datum/signal/newsignal = get_free_signal()
newsignal.data["command"] = "report_reply"
newsignal.data["address_1"] = signal.data["sender"]
newsignal.data["owner"] = src.master.owner
src.post_signal(newsignal)
*/
if("report_reply")
if(!detected_pdas)
detected_pdas = new()
var/newsender = ckey(copytext(signal.data["sender"], 1, 9))
if(!newsender)
return
var/newowner = signal.data["owner"]
if(!newowner)
newowner = "!UNKNOWN!"
var/sender_name = newowner
if(!(newsender in detected_pdas))
detected_pdas += newsender
//master.pdasay_autocomplete += sender_name
detected_pdas[newsender] = sender_name
master.pdasay_autocomplete[sender_name] = newsender
src.master.updateSelfDialog()
return
return_text_header()
if(!src.master)
return
. = ""
if(src.mode)
. += " | <a href='byond://?src=\ref[src];mode=0'>Main Menu</a>"
. += " | <a href='byond://?src=\ref[src.master];refresh=1'>Refresh</a>"
else
if (!isnull(src.master.cartridge))
. += " | <a href='byond://?src=\ref[src.master];eject_cart=1'>Eject [src.master.cartridge]</a>"
if (!isnull(src.master.ID_card))
. += " | <a href='byond://?src=\ref[src.master];eject_id_card=1'>Eject [src.master.ID_card]</a>"
pda_message(var/target_id, var/target_name, var/message, var/is_department_message)
if (!src.master || (!in_range(src.master, usr) && src.master.loc != usr))
return 1
if (!target_id || !target_name || !message)
return 1
if(!(src.holder in src.master))
return 1
message = copytext(adminscrub(message), 1, 257)
if (findtext(message, "viagra") != 0 || findtext(message, "erect") != 0 || findtext(message, "pharm") != 0 || findtext(message, "girls") != 0 || findtext(message, "scient") != 0 || findtext(message, "luxury") != 0 || findtext(message, "vid") != 0 || findtext(message, "quality") != 0)
usr.unlock_medal("Spamhaus", 1)
var/datum/signal/signal = get_free_signal()
signal.data["command"] = "text_message"
signal.data["message"] = message
signal.data["sender_name"] = src.master.owner
//signal.data["sender"] = src.master.net_id
if (is_department_message)
signal.data["group"] = target_id
else
signal.data["address_1"] = target_id
src.post_signal(signal)
src.message_note += "<i><b>&rarr; To [target_name]:</b></i><br>[message]<br>"
src.message_last = world.time
logTheThing("pdamsg", null, null, "<i><b>[src.master.owner]'s PDA used by [key_name(src.master.loc)] &rarr; [target_name]:</b></i> [message]")
return 0
+184
View File
@@ -0,0 +1,184 @@
//base pda program
/datum/computer/file/pda_program
name = "blank program"
extension = "PPROG"
var/obj/item/device/pda2/master = null
var/id_tag = null
var/setup_use_process = 0 //Does the master PDA need to be on the processing item list?
os
name = "blank system program"
extension = "PSYS"
scan
name = "blank scan program"
extension = "PSCAN"
New(obj/holding as obj)
if(holding)
src.holder = holding
if(istype(src.holder.loc,/obj/item/device/pda2))
src.master = src.holder.loc
proc
return_text()
if((!src.holder) || (!src.master))
return 1
if((!istype(holder)) || (!istype(master)))
return 1
if(!(holder in src.master.contents))
//boutput(world, "Holder [holder] not in [master] of prg:[src]")
if(master.active_program == src)
master.active_program = null
return 1
return 0
build_grid(mob/user as mob, theGrid)
if (!istype(src.holder) || !istype(src.master))
return 1
if (!user || !theGrid)
return 1
if (!(holder in src.master.contents))
return 1
return 0
process()
if((!src.holder) || (!src.master))
return 1
if((!istype(holder)) || (!istype(master)))
return 1
if(!(holder in src.master.contents))
if(master.active_program == src)
master.active_program = null
return 1
if(!src.holder.root)
src.holder.root = new /datum/computer/folder
src.holder.root.holder = src
src.holder.root.name = "root"
return 0
//maybe remove this, I haven't found a good use for it yet
send_os_command(list/command_list)
if(!src.master || !src.holder || src.master.host_program || !command_list)
return 1
if(!istype(src.master.host_program) || src.master.host_program == src)
return 1
src.master.host_program.receive_os_command()
return 0
return_text_header()
if(!src.master || !src.holder)
return
. = " | <a href='byond://?src=\ref[src];quit=1'>Main Menu</a>"
. += " | <a href='byond://?src=\ref[src.master];refresh=1'>Refresh</a>"
post_signal(datum/signal/signal, newfreq)
if(master)
master.post_signal(signal, newfreq)
//else
//qdel(signal)
transfer_holder(obj/item/disk/data/newholder,datum/computer/folder/newfolder)
if((newholder.file_used + src.size) > newholder.file_amount)
return 0
if(!newholder.root)
newholder.root = new /datum/computer/folder
newholder.root.holder = newholder
newholder.root.name = "root"
if(!newfolder)
newfolder = newholder.root
if((src.holder && src.holder.read_only) || newholder.read_only)
return 0
if((src.holder) && (src.holder.root))
src.holder.root.remove_file(src)
newfolder.add_file(src)
if(istype(newholder.loc,/obj/item/device/pda2))
src.master = newholder.loc
//boutput(world, "Setting [src.holder] to [newholder]")
src.holder = newholder
return 1
receive_signal(datum/signal/signal, rx_method, rx_freq)
if((!src.holder) || (!src.master))
return 1
if((!istype(holder)) || (!istype(master)))
return 1
if(!(holder in src.master.contents))
if(master.active_program == src)
master.active_program = null
return 1
return 0
// called when a program is run
init()
return
// to allow promiscuous mode
network_hook()
return
Topic(href, href_list)
if((!src.holder) || (!src.master))
return 1
if((!istype(holder)) || (!istype(master)))
return 1
if(src.master.active_program != src)
return 1
if ((!usr.contents.Find(src.master) && (!in_range(src.master, usr) || !istype(src.master.loc, /turf))) && (!istype(usr, /mob/living/silicon)))
return 1
if(usr.stat || usr.restrained())
return 1
if(!(holder in src.master.contents))
if(master.active_program == src)
master.active_program = null
return 1
usr.machine = src.master
if (href_list["close"])
usr.machine = null
usr << browse(null, "window=pda2_\ref[src]")
return 0
if (href_list["quit"])
// src.master.processing_programs.Remove(src)
src.master.unload_active_program()
return 1
return 0
+289
View File
@@ -0,0 +1,289 @@
//CONTENTS
//Base bot control program
//Secbot control
//Mulebot control
/datum/computer/file/pda_program/bot_control
name = "bot control base"
var/list/botlist = list() // list of bots
var/obj/machinery/bot/active // the active bot; if null, show bot list
var/list/botstatus // the status signal sent by the bot
var/control_freq = 1447 //Just for sending, adjust what the actual pda hooks to for receive
proc/post_status(var/freq, var/key, var/value, var/key2, var/value2, var/key3, var/value3)
if(!src.master)
return
var/datum/signal/signal = get_free_signal()
signal.source = src
signal.transmission_method = 1
signal.data[key] = value
if(key2)
signal.data[key2] = value2
if(key3)
signal.data[key3] = value3
src.post_signal(signal, freq)
init()
//boutput(world, "<h5>Adding [master]@[master.loc]:[master.bot_freq],[master.beacon_freq]")
radio_controller.add_object(master, "[master.bot_freq]")
radio_controller.add_object(master, "[master.beacon_freq]")
/datum/computer/file/pda_program/bot_control/secbot
name = "Securitron Access"
size = 8.0
return_text()
if(..())
return
. = src.return_text_header()
. += "<h4>Securitron Interlink</h4>"
if(!src.active)
// list of bots
if(!src.botlist || (src.botlist && src.botlist.len==0))
. += "No bots found.<BR>"
else
for(var/obj/machinery/bot/secbot/B in src.botlist)
. += "<A href='byond://?src=\ref[src];op=control;bot=\ref[B]'>[B] at [get_area(B)]</A><BR>"
. += "<BR><A href='byond://?src=\ref[src];op=scanbots'>Scan for active bots</A><BR>"
else // bot selected, control it
. += "<B>[src.active]</B><BR> Status: (<A href='byond://?src=\ref[src];op=control;bot=\ref[src.active]'><i>refresh</i></A>)<BR>"
if(!src.botstatus)
. += "Waiting for response...<BR>"
else
. += "Location: [src.botstatus["loca"] ]<BR>"
. += "Mode: "
switch(src.botstatus["mode"])
if(0)
. += "Ready"
if(1)
. += "Apprehending target"
if(2,3)
. += "Arresting target"
if(4)
. += "Starting patrol"
if(5)
. += "On patrol"
if(6)
. += "Responding to summons"
. += "<BR>\[<A href='byond://?src=\ref[src];op=stop'>Stop Patrol</A>\] "
. += "\[<A href='byond://?src=\ref[src];op=go'>Start Patrol</A>\] "
. += "\[<A href='byond://?src=\ref[src];op=summon'>Summon Bot</A>\]<BR>"
. += "<HR><A href='byond://?src=\ref[src];op=botlist'>Return to bot list</A>"
Topic(href, href_list)
if(..())
return
var/obj/item/device/pda2/PDA = src.master
switch(href_list["op"])
if("control")
active = locate(href_list["bot"])
post_status(control_freq, "command", "bot_status", "active", active)
if("scanbots") // find all bots
botlist = null
post_status(control_freq, "command", "bot_status")
if("botlist")
active = null
PDA.updateSelfDialog()
if("stop", "go")
post_status(control_freq, "command", href_list["op"], "active", active)
post_status(control_freq, "command", "bot_status", "active", active)
if("summon")
post_status(control_freq, "command", "summon", "active", active, "target", get_turf(PDA) )
post_status(control_freq, "command", "bot_status", "active", active)
return
receive_signal(datum/signal/signal)
if(..())
return
/*
boutput(world, "recvd:[src.master] : [signal.source]")
for(var/d in signal.data)
boutput(world, "- [d] = [signal.data[d]]")
*/
if(signal.data["type"] == "secbot")
if(!botlist)
botlist = new()
if(!(signal.source in botlist))
botlist += signal.source
if(active == signal.source)
var/list/b = signal.data
botstatus = b.Copy()
src.master.updateSelfDialog()
return
/datum/computer/file/pda_program/bot_control/mulebot
name = "MULE Bot Control"
size = 16.0
var/list/beacons
return_text()
if(..())
return
. = src.return_text_header()
. += "<h4>M.U.L.E. bot Interlink V0.8</h4>"
if(!src.active)
// list of bots
if(!src.botlist || (src.botlist && src.botlist.len==0))
. += "No bots found.<BR>"
else
for(var/obj/machinery/bot/mulebot/B in src.botlist)
. += "<A href='byond://?src=\ref[src];op=control;bot=\ref[B]'>[B] at [get_area(B)]</A><BR>"
. += "<BR><A href='byond://?src=\ref[src];op=scanbots'>Scan for active bots</A><BR>"
else // bot selected, control it
. += "<B>[src.active]</B><BR> Status: (<A href='byond://?src=\ref[src];op=control;bot=\ref[src.active]'><i>refresh</i></A>)<BR>"
if(!src.botstatus)
. += "Waiting for response...<BR>"
else
. += "Location: [src.botstatus["loca"] ]<BR>"
. += "Mode: "
switch(src.botstatus["mode"])
if(0)
. += "Ready"
if(1)
. += "Loading/Unloading"
if(2)
. += "Navigating to Delivery Location"
if(3)
. += "Navigating to Home"
if(4)
. += "Waiting for clear path"
if(5,6)
. += "Calculating navigation path"
if(7)
. += "Unable to locate destination"
var/obj/storage/crate/C = src.botstatus["load"]
. += "<BR>Current Load: [ !C ? "<i>none</i>" : "[C.name] (<A href='byond://?src=\ref[src];op=unload'><i>unload</i></A>)" ]<BR>"
. += "<A href='byond://?src=\ref[src];op=scanbeacons'>Scan destinations</a><br>"
. += "Destination: [!src.botstatus["dest"] ? "<i>none</i>" : src.botstatus["dest"] ] (<A href='byond://?src=\ref[src];op=setdest'><i>set</i></A>)<BR>"
. += "Power: [src.botstatus["powr"]]%<BR>"
. += "Home: [!src.botstatus["home"] ? "<i>none</i>" : src.botstatus["home"] ]<BR>"
. += "Auto Return Home: [src.botstatus["retn"] ? "<B>On</B> <A href='byond://?src=\ref[src];op=retoff'>Off</A>" : "(<A href='byond://?src=\ref[src];op=reton'><i>On</i></A>) <B>Off</B>"]<BR>"
. += "Auto Pickup Crate: [src.botstatus["pick"] ? "<B>On</B> <A href='byond://?src=\ref[src];op=pickoff'>Off</A>" : "(<A href='byond://?src=\ref[src];op=pickon'><i>On</i></A>) <B>Off</B>"]<BR><BR>"
. += "\[<A href='byond://?src=\ref[src];op=stop'>Stop</A>\] "
. += "\[<A href='byond://?src=\ref[src];op=go'>Proceed</A>\] "
. += "\[<A href='byond://?src=\ref[src];op=home'>Return Home</A>\]<BR>"
. += "<HR><A href='byond://?src=\ref[src];op=botlist'>Return to bot list</A>"
Topic(href, href_list)
if(..())
return
var/obj/item/device/pda2/PDA = src.master
var/cmd = "command"
if(active) cmd = "command_[ckey(active.suffix)]"
switch(href_list["op"])
if("control")
active = locate(href_list["bot"])
post_status(control_freq, cmd, "bot_status")
if("scanbots") // find all bots
botlist = null
post_status(control_freq, "command", "bot_status")
if("scanbeacons")
beacons = null
src.post_status(src.master.beacon_freq, "findbeacon", "delivery")
if("botlist")
active = null
PDA.updateSelfDialog()
if("unload")
post_status(control_freq, cmd, "unload")
post_status(control_freq, cmd, "bot_status")
if("setdest")
if(beacons)
var/dest = input("Select Bot Destination", "Mulebot [active.suffix] Interlink", active:destination) as null|anything in beacons
if(dest)
post_status(control_freq, cmd, "target", "destination", dest)
post_status(control_freq, cmd, "bot_status")
if("retoff")
post_status(control_freq, cmd, "autoret", "value", 0)
post_status(control_freq, cmd, "bot_status")
if("reton")
post_status(control_freq, cmd, "autoret", "value", 1)
post_status(control_freq, cmd, "bot_status")
if("pickoff")
post_status(control_freq, cmd, "autopick", "value", 0)
post_status(control_freq, cmd, "bot_status")
if("pickon")
post_status(control_freq, cmd, "autopick", "value", 1)
post_status(control_freq, cmd, "bot_status")
if("stop", "go", "home")
post_status(control_freq, cmd, href_list["op"])
post_status(control_freq, cmd, "bot_status")
return
receive_signal(datum/signal/signal)
if(..())
return
if(signal.data["type"] == "mulebot")
if(!botlist)
botlist = new()
if(!(signal.source in botlist))
botlist += signal.source
if(active == signal.source)
var/list/b = signal.data
botstatus = b.Copy()
src.master.updateSelfDialog()
else if(signal.data["beacon"])
if(!beacons)
beacons = new()
beacons[signal.data["beacon"] ] = signal.source
return
+327
View File
@@ -0,0 +1,327 @@
//CONTENTS:
//Captain cart
//Head cart
//Research Director cart
//Medical cart
//Security cart
//Toxins cart
//QM cart
//Clown cart
//Janitor cart
//Atmos cart
//Syndicate cart
//Botanist cart
//Nuclear cart (syndicate cart with syndicate shuttle door control)
//Network diagnostic cart
//Game Carts
/obj/item/disk/data/cartridge
captain
name = "Value-PAK Cartridge"
desc = "Now with 200% more value!"
icon_state = "cart-c"
file_amount = 128
New()
..()
src.root.add_file( new /datum/computer/file/pda_program/manifest(src))
src.root.add_file( new /datum/computer/file/pda_program/status_display(src))
src.root.add_file( new /datum/computer/file/pda_program/signaler(src))
src.root.add_file( new /datum/computer/file/pda_program/qm_records(src))
src.root.add_file( new /datum/computer/file/pda_program/scan/forensic_scan(src))
src.root.add_file( new /datum/computer/file/pda_program/scan/health_scan(src))
src.root.add_file( new /datum/computer/file/pda_program/records/security(src))
src.root.add_file( new /datum/computer/file/pda_program/records/medical(src))
src.root.add_file( new /datum/computer/file/pda_program/security_ticket(src))
//src.root.add_file( new /datum/computer/file/pda_program/hologram_control(src))
src.file_amount = src.file_used
src.read_only = 1
head
name = "Easy-Record DELUXE"
icon_state = "cart-h"
file_amount = 64
New()
..()
src.root.add_file( new /datum/computer/file/pda_program/manifest(src))
src.root.add_file( new /datum/computer/file/pda_program/status_display(src))
src.root.add_file( new /datum/computer/file/pda_program/qm_records(src))
src.root.add_file( new /datum/computer/file/pda_program/scan/forensic_scan(src))
src.root.add_file( new /datum/computer/file/pda_program/records/security(src))
src.root.add_file( new /datum/computer/file/pda_program/security_ticket(src))
src.read_only = 1
ai
name = "AI Internal PDA Cartridge"
icon_state = "cart-h"
file_amount = 1024
New()
..()
src.root.add_file( new /datum/computer/file/pda_program/manifest(src))
src.root.add_file( new /datum/computer/file/pda_program/atmos_alerts(src))
src.root.add_file( new /datum/computer/file/pda_program/status_display(src))
src.root.add_file( new /datum/computer/file/pda_program/signaler(src))
src.root.add_file( new /datum/computer/file/pda_program/qm_records(src))
src.root.add_file( new /datum/computer/file/pda_program/records/security(src))
src.root.add_file( new /datum/computer/file/pda_program/records/medical(src))
src.root.add_file( new /datum/computer/file/pda_program/bot_control/secbot(src))
src.root.add_file( new /datum/computer/file/pda_program/bot_control/mulebot(src))
src.root.add_file( new /datum/computer/file/pda_program/pingtool(src) )
src.root.add_file( new /datum/computer/file/pda_program/packet_sniffer(src) )
src.root.add_file( new /datum/computer/file/pda_program/packet_sender(src) )
src.root.add_file( new /datum/computer/file/text/diagnostic_readme(src))
src.read_only = 1
cyborg
name = "Cyborg Internal PDA Cartridge"
icon_state = "cart-h"
file_amount = 1024
New()
..()
src.root.add_file( new /datum/computer/file/pda_program/manifest(src))
src.root.add_file( new /datum/computer/file/pda_program/atmos_alerts(src))
src.root.add_file( new /datum/computer/file/pda_program/signaler(src))
src.root.add_file( new /datum/computer/file/pda_program/qm_records(src))
src.root.add_file( new /datum/computer/file/pda_program/records/security(src))
src.root.add_file( new /datum/computer/file/pda_program/records/medical(src))
src.root.add_file( new /datum/computer/file/pda_program/scan/health_scan(src))
src.root.add_file( new /datum/computer/file/pda_program/scan/reagent_scan(src))
src.root.add_file( new /datum/computer/file/pda_program/bot_control/secbot(src))
src.root.add_file( new /datum/computer/file/pda_program/bot_control/mulebot(src))
src.root.add_file( new /datum/computer/file/pda_program/pingtool(src) )
src.root.add_file( new /datum/computer/file/pda_program/packet_sniffer(src) )
src.root.add_file( new /datum/computer/file/pda_program/packet_sender(src) )
src.root.add_file( new /datum/computer/file/text/diagnostic_readme(src))
src.read_only = 1
research_director
name = "SciMaster Cartridge"
desc = "There is a torn 'for ages 5 and up' sticker on the back."
icon_state = "cart-rd"
file_amount = 64
New()
..()
src.root.add_file( new /datum/computer/file/pda_program/manifest(src))
src.root.add_file( new /datum/computer/file/pda_program/status_display(src))
src.root.add_file( new /datum/computer/file/pda_program/scan/health_scan(src))
src.root.add_file( new /datum/computer/file/pda_program/scan/reagent_scan(src))
src.root.add_file( new /datum/computer/file/pda_program/signaler(src))
src.root.add_file( new /datum/computer/file/pda_program/portable_machinery_control/portasci(src))
src.read_only = 1
medical_director
name = "Med-Master Cartridge"
icon_state = "cart-m"
file_amount = 64
New()
..()
src.root.add_file( new /datum/computer/file/pda_program/manifest(src))
src.root.add_file( new /datum/computer/file/pda_program/status_display(src))
src.root.add_file( new /datum/computer/file/pda_program/scan/health_scan(src))
src.root.add_file( new /datum/computer/file/pda_program/scan/reagent_scan(src))
src.root.add_file( new /datum/computer/file/pda_program/records/medical(src))
src.root.add_file( new /datum/computer/file/pda_program/portable_machinery_control/portananomed(src))
src.read_only = 1
medical
name = "Med-U Cartridge"
icon_state = "cart-m"
New()
..()
src.root.add_file( new /datum/computer/file/pda_program/scan/health_scan(src))
src.root.add_file( new /datum/computer/file/pda_program/scan/reagent_scan(src))
src.root.add_file( new /datum/computer/file/pda_program/records/medical(src))
src.root.add_file( new /datum/computer/file/pda_program/portable_machinery_control/portananomed(src))
src.read_only = 1
mechanic
name = "Analysis Made Easy Cartridge"
file_amount = 64
New()
..()
src.root.add_file( new /datum/computer/file/pda_program/scan/electronics(src))
src.root.add_file( new /datum/computer/file/pda_program/pingtool(src) )
src.root.add_file( new /datum/computer/file/pda_program/packet_sniffer(src) )
src.root.add_file( new /datum/computer/file/pda_program/packet_sender(src) )
src.root.add_file( new /datum/computer/file/text/diagnostic_readme(src))
src.read_only = 1
security
name = "R.O.B.U.S.T. Cartridge"
icon_state = "cart-s"
New()
..()
src.root.add_file( new /datum/computer/file/pda_program/scan/forensic_scan(src))
src.root.add_file( new /datum/computer/file/pda_program/records/security(src))
src.root.add_file( new /datum/computer/file/pda_program/bot_control/secbot(src))
src.root.add_file( new /datum/computer/file/pda_program/portable_machinery_control/portabrig(src))
src.root.add_file( new /datum/computer/file/pda_program/security_ticket(src))
src.read_only = 1
forensic
name = "Forensic Analysis Cartridge"
icon_state = "cart-s"
file_amount = 128
New()
..()
src.root.add_file( new /datum/computer/file/pda_program/scan/forensic_scan(src))
src.root.add_file( new /datum/computer/file/pda_program/scan/health_scan(src))
src.root.add_file( new /datum/computer/file/pda_program/scan/reagent_scan(src))
src.root.add_file( new /datum/computer/file/pda_program/records/medical(src))
src.root.add_file( new /datum/computer/file/pda_program/records/security(src))
src.root.add_file( new /datum/computer/file/pda_program/bot_control/secbot(src))
src.root.add_file( new /datum/computer/file/pda_program/security_ticket(src))
src.root.add_file( new /datum/computer/file/pda_program/packet_sniffer(src) )
src.read_only = 1
hos
name = "R.O.B.U.S.T.E.R. Cartridge"
icon_state = "cart-c"
file_amount = 128
New()
..()
src.root.add_file( new /datum/computer/file/pda_program/manifest(src))
src.root.add_file( new /datum/computer/file/pda_program/status_display(src))
src.root.add_file( new /datum/computer/file/pda_program/bot_control/secbot(src))
src.root.add_file( new /datum/computer/file/pda_program/portable_machinery_control/portabrig(src))
src.root.add_file( new /datum/computer/file/pda_program/qm_records(src))
src.root.add_file( new /datum/computer/file/pda_program/scan/forensic_scan(src))
src.root.add_file( new /datum/computer/file/pda_program/scan/health_scan(src))
src.root.add_file( new /datum/computer/file/pda_program/records/security(src))
src.root.add_file( new /datum/computer/file/pda_program/security_ticket(src))
src.file_amount = src.file_used
src.read_only = 1
toxins
name = "Signal Ace 2"
desc = "The ultimate in radio signal technology."
icon_state = "cart-tox"
New()
..()
src.root.add_file( new /datum/computer/file/pda_program/scan/reagent_scan(src))
src.root.add_file( new /datum/computer/file/pda_program/signaler(src))
src.read_only = 1
genetics
name = "Deoxyribonucleic Amigo Cartridge"
desc = "The ultimate in radio signal technology."
icon_state = "cart-gen"
New()
..()
src.root.add_file( new /datum/computer/file/pda_program/scan/health_scan(src))
src.root.add_file( new /datum/computer/file/pda_program/scan/reagent_scan(src))
src.root.add_file( new /datum/computer/file/pda_program/records/medical(src))
src.read_only = 1
quartermaster
name = "Space Parts & Space Vendors Cartridge"
desc = "Perfect for the Quartermaster on the go!"
icon_state = "cart-q"
New()
..()
src.root.add_file( new /datum/computer/file/pda_program/qm_records(src))
src.root.add_file( new /datum/computer/file/pda_program/bot_control/mulebot(src))
src.read_only = 1
clown
name = "Honkworks 5.0"
icon_state = "cart-clown"
New()
..()
src.root.add_file( new /datum/computer/file/pda_program/honk_synth(src))
src.root.add_file( new /datum/computer/file/pda_program/arcade(src))
src.read_only = 1
janitor
name = "CustodiPRO Cartridge"
desc = "The ultimate in clean-room design."
icon_state = "cart-j"
New()
..()
src.root.add_file( new /datum/computer/file/pda_program/mopfinder(src))
src.root.add_file( new /datum/computer/file/pda_program/arcade(src))
src.read_only = 1
atmos
name = "AlertMaster Cartridge"
icon_state = "cart-a"
New()
..()
src.root.add_file( new /datum/computer/file/pda_program/atmos_alerts(src))
src.read_only = 1
botanist
name = "Farmer Melons' ScanCart v2"
desc = "The latest in grobusting developments."
icon_state = "cart-hy"
New()
..()
src.root.add_file( new /datum/computer/file/pda_program/scan/plant_scan(src))
src.root.add_file( new /datum/computer/file/text/handbook_botanist(src))
src.read_only = 1
syndicate
name = "Detomatix Cartridge"
desc = "This cart appears to have been manufactured by unskilled laborers."
icon_state = "cart"
mats = 0
New()
..()
src.root.add_file( new /datum/computer/file/pda_program/bomb(src))
var/datum/computer/file/pda_program/missile/detofile = new /datum/computer/file/pda_program/missile(src)
detofile.charges = 4
src.root.add_file(detofile)
src.root.add_file( new /datum/computer/file/text/bomb_manual(src))
src.read_only = 1
nuclear
name = "Syndi-Master Cartridge"
desc = "This cart uses only the finest-quality recycled soviet steel."
icon_state = "cart"
New()
..()
src.root.add_file( new /datum/computer/file/pda_program/manifest(src))
src.root.add_file( new /datum/computer/file/pda_program/bomb(src))
var/datum/computer/file/pda_program/missile/detofile = new /datum/computer/file/pda_program/missile(src)
detofile.charges = 4
src.root.add_file(detofile)
src.root.add_file( new /datum/computer/file/text/bomb_manual(src))
//src.root.add_file( new /datum/computer/file/pda_program/door_control/syndicate(src))
src.read_only = 1
diagnostics
name = "Network Diagnostics Cart"
desc = "For use only by qualified network technicians."
icon_state = "cart-nd"
file_amount = 64
New()
..()
src.root.add_file( new /datum/computer/file/pda_program/pingtool(src) )
src.root.add_file( new /datum/computer/file/pda_program/packet_sniffer(src) )
src.root.add_file( new /datum/computer/file/pda_program/packet_sender(src) )
src.root.add_file( new /datum/computer/file/text/diagnostic_readme(src))
src.read_only = 1
game_codebreaker
name = "CodeBreaker"
desc = "Irata Inc ports another of their finest titles to your handheld PDA!"
icon_state = "cart-c"
New()
..()
src.root.add_file( new /datum/computer/file/pda_program/codebreaker(src))
src.read_only = 1
+475
View File
@@ -0,0 +1,475 @@
// Network Diagnostics PDA cart programs
// pingtool
// packet sniffer
// packet sender
/datum/computer/file/pda_program/pingtool
name = "Ping Tool"
size = 8
var/send_freq = 1149 //Frequency signal is sent at, should be kept within normal radio ranges.
var/range = 32
var/mode = 0
var/tmp/list/result
init()
radio_controller.add_object(master, "[send_freq]")
return_text()
if(..())
return
var/dat = src.return_text_header()
dat +="<h4>Wireless Ping Tool</h4>"
dat += {"Freq: <tt>
<a href='byond://?src=\ref[src];adj_freq=-100'>-</a>
<a href='byond://?src=\ref[src];adj_freq=-10'>-</a>
<a href='byond://?src=\ref[src];adj_freq=-2'>-</a>
<a href='byond://?src=\ref[src];set_freq=1'>[format_frequency(send_freq)]</a>
<a href='byond://?src=\ref[src];adj_freq=2'>+</a>
<a href='byond://?src=\ref[src];adj_freq=10'>+</a>
<a href='byond://?src=\ref[src];adj_freq=100'>+</a></tt> | "}
dat += "Range: <tt>"
switch(range)
if(16)
dat += "- Low <a href='byond://?src=\ref[src];range=1'>+</A>"
if(32)
dat += "<A href='byond://?src=\ref[src];range=-1'>-</A> Med <A href='byond://?src=\ref[src];range=1'>+</A>"
if(64)
dat += "<A href='byond://?src=\ref[src];range=-1'>-</A> Max +"
dat +="</tt><br>"
if(mode == 0)
dat += "<a href='byond://?src=\ref[src];send=1'>Send ping</A><BR><HR>"
if(result && result.len > 0)
for(var/t in result)
dat+=t
else
dat += "<i>No devices found</i><br>"
else
dat += "<i>Listening...</i><br>"
return dat
Topic(href, href_list)
if(..())
return
if (href_list["send"])
spawn( 0 )
var/datum/signal/signal = get_free_signal()
signal.source = src
signal.transmission_method = TRANSMISSION_RADIO
signal.data["address_1"] = "ping"
signal.data["sender"] = master.net_id
src.post_signal(signal,"[send_freq]")
mode = 1
if(result) result.Cut()
master.updateSelfDialog()
spawn(20)
mode = 0
master.updateSelfDialog()
return
else if (href_list["range"])
var/rd = text2num(href_list["range"])
switch(range)
if(16)
range = 32
if(32)
if(rd>0)
range = 64
else
range = 16
if(64)
range = 32
else if (href_list["adj_freq"])
var/new_freq = sanitize_frequency_diagnostic(send_freq + text2num(href_list["adj_freq"]))
adjust_frequency(send_freq, new_freq)
send_freq = new_freq
else if (href_list["set_freq"])
var/new_freq = input(usr,"Target frequency (1141-1489):","Enter target frequency",send_freq) as num
new_freq = sanitize_frequency_diagnostic(new_freq)
adjust_frequency(send_freq, new_freq)
send_freq = new_freq
src.master.add_fingerprint(usr)
src.master.updateSelfDialog()
return
receive_signal(datum/signal/signal)
//boutput(world, "[master.net_id] Recieved signal from [signal.source] ([get_dist(master,signal.source)])")
//
//for(var/x in signal.data)
// boutput(world, "[x] = [signal.data[x]]")
//boutput(world, "---------------")
if(..())
return
if(signal.data["address_1"] == master.net_id && signal.data["command"] == "ping_reply")
if(!result)
result = new/list()
if(get_dist(master,signal.source) <= range)
result += "[signal.data["device"]] \[[signal.data["netid"]]\] [signal.data["data"]]<BR>"
proc/adjust_frequency(var/old_freq, var/new_freq)
radio_controller.remove_object(master, "[old_freq]")
radio_controller.add_object(master, "[new_freq]")
/datum/computer/file/pda_program/packet_sniffer
name = "Packet Sniffer"
size = 16
var/scan_freq = 1149
var/range = 32
var/mode = 0
var/tmp/list/result
init()
radio_controller.add_object(master, "[scan_freq]")
return_text()
if(..())
return
var/dat = src.return_text_header()
dat +="<h4>Wireless Network Sniffer</h4>"
dat += {"Freq: <tt>
<a href='byond://?src=\ref[src];adj_freq=-100'>-</a>
<a href='byond://?src=\ref[src];adj_freq=-10'>-</a>
<a href='byond://?src=\ref[src];adj_freq=-2'>-</a>
<a href='byond://?src=\ref[src];set_freq=1'>[format_frequency(scan_freq)]</a>
<a href='byond://?src=\ref[src];adj_freq=2'>+</a>
<a href='byond://?src=\ref[src];adj_freq=10'>+</a>
<a href='byond://?src=\ref[src];adj_freq=100'>+</a></tt> | "}
dat += "Range: <tt>"
switch(range)
if(16)
dat += "- Low <a href='byond://?src=\ref[src];range=1'>+</A>"
if(32)
dat += "<A href='byond://?src=\ref[src];range=-1'>-</A> Med <A href='byond://?src=\ref[src];range=1'>+</A>"
if(64)
dat += "<A href='byond://?src=\ref[src];range=-1'>-</A> Max +"
dat +="</tt><br>"
if(mode == 0)
dat += "<A href='byond://?src=\ref[src];run=1'>Start</A>"
else
dat += "<A href='byond://?src=\ref[src];run=0'>Stop</A>"
dat += " <A href='byond://?src=\ref[src];clear=1'>Clear</A><BR><HR>"
if(result)
for(var/r in result)
dat += "<tt>[r]</tt><BR>"
dat +="<HR>"
if(mode == 0)
dat += "<A href='byond://?src=\ref[src];run=1'>Start</A>"
else
dat += "<A href='byond://?src=\ref[src];run=0'>Stop</A>"
dat += " <A href='byond://?src=\ref[src];clear=1'>Clear</A><BR>"
return dat
Topic(href, href_list)
if(..())
return
if (href_list["adj_freq"])
var/new_freq = sanitize_frequency_diagnostic(scan_freq + text2num(href_list["adj_freq"]))
adjust_frequency(scan_freq, new_freq)
scan_freq = new_freq
else if (href_list["set_freq"])
var/new_freq = input(usr,"Target frequency (1141-1489):","Enter target frequency",scan_freq) as num
new_freq = sanitize_frequency_diagnostic(new_freq)
adjust_frequency(scan_freq, new_freq)
scan_freq = new_freq
else if (href_list["run"])
mode = text2num(href_list["run"])
else if (href_list["clear"])
if(result)
result.Cut()
else if (href_list["range"])
var/rd = text2num(href_list["range"])
switch(range)
if(16)
range = 32
if(32)
if(rd>0)
range = 64
else
range = 16
if(64)
range = 32
src.master.add_fingerprint(usr)
src.master.updateSelfDialog()
return
network_hook(datum/signal/signal, rx_method, rx_freq)
if(!mode)
return
/////
//boutput(world, "[master.net_id] Recieved signal @[rx_freq] from [signal.source] ([get_dist(master,signal.source)])")
//for(var/x in signal.data)
// boutput(world, "[x] = [signal.data[x]]")
//boutput(world, "----")
/////
if(rx_freq != "[scan_freq]")
return
if(get_dist(master, signal.source) > range)
return
//boutput(world, "====")
if(!result)
result = new/list()
var/t = "\[[time2text(world.timeofday,"mm:ss")]:[(world.timeofday%10)]\]:"
var/t2 = ""
for(var/d in signal.data)
t2 += "[d]=[signal.data[d]]; "
// look for detomax packet and obscure it (so it won't be easy to copy)
if(signal.data["command"] == "text_message" && signal.data["batt_adjust"] == netpass_syndicate)
t += "ERR_12939_CORRUPT_PACKET:"
t2 = stars(t2, 15)
result += "[t][t2]"
if(result.len > 100)
result.Cut(1,2)
master.updateSelfDialog()
proc/adjust_frequency(var/old_freq, var/new_freq)
radio_controller.remove_object(master, "[old_freq]")
radio_controller.add_object(master, "[new_freq]")
/datum/computer/file/pda_program/packet_sender
name = "Packet Sender"
size = 8
var/send_freq = 1149
var/range = 32
var/tmp/list/keyval
var/mode = 0
#define MAX_PACKET_KEYS 10
init()
radio_controller.add_object(master, "[send_freq]")
return_text()
if(..())
return
var/dat = src.return_text_header()
dat +="<h4>Manual Packet Sender</h4>"
dat += {"Freq: <tt>
<a href='byond://?src=\ref[src];adj_freq=-100'>-</a>
<a href='byond://?src=\ref[src];adj_freq=-10'>-</a>
<a href='byond://?src=\ref[src];adj_freq=-2'>-</a>
<a href='byond://?src=\ref[src];set_freq=1'>[format_frequency(send_freq)]</a>
<a href='byond://?src=\ref[src];adj_freq=2'>+</a>
<a href='byond://?src=\ref[src];adj_freq=10'>+</a>
<a href='byond://?src=\ref[src];adj_freq=100'>+</a></tt> | "}
dat += "Range: <tt>"
switch(range)
if(16)
dat += "- Low <a href='byond://?src=\ref[src];range=1'>+</A>"
if(32)
dat += "<A href='byond://?src=\ref[src];range=-1'>-</A> Med <A href='byond://?src=\ref[src];range=1'>+</A>"
if(64)
dat += "<A href='byond://?src=\ref[src];range=-1'>-</A> Max +"
dat +="</tt><br><HR><UL><TT>"
for(var/key in keyval)
dat += "<LI>[key] ... [keyval[key]]"
dat += " <small><A href='byond://?src=\ref[src];edit=1;code=[key]'>(edit)</A>"
dat += " <A href='byond://?src=\ref[src];delete=1;code=[key]'>(delete)</A></small><BR>"
dat += "</UL><small><A href='byond://?src=\ref[src];add=1;'>(add new)</A></small><BR>"
dat += "</TT>"
dat +="<HR>"
if(mode)
dat += "<I>Sending...</I><BR>"
else
dat += " <A href='byond://?src=\ref[src];send=1'>Send Packet</A><BR>"
return dat
Topic(href, href_list)
if(..())
return
if (href_list["adj_freq"])
send_freq = sanitize_frequency_diagnostic(send_freq + text2num(href_list["adj_freq"]))
else if (href_list["set_freq"])
var/new_freq = input(usr,"Target frequency (1141-1489):","Enter target frequency",send_freq) as num
new_freq = sanitize_frequency_diagnostic(new_freq)
send_freq = new_freq
else if(href_list["edit"])
var/codekey = href_list["code"]
var/newkey = copytext(ckeyEx( input("Enter Packet Key", "Packet Sender", codekey) as text|null ), 1, 16)
if(!newkey)
return
if (!src.master || !in_range(src.master, usr) && src.master.loc != usr)
return
if(!(src.holder in src.master))
return
var/codeval = html_decode(keyval[codekey])
var/newval = copytext(strip_html( input("Enter Packet Value", "Packer Sender", codeval) as text|null ), 1, 255)
if(!newval)
newval = codekey
return
if (!src.master || !in_range(src.master, usr) && src.master.loc != usr)
return
if(!(src.holder in src.master))
return
keyval.Remove(codekey)
keyval[newkey] = newval
else if(href_list["delete"])
var/codekey = href_list["code"]
keyval.Remove(codekey)
else if(href_list["add"])
if(keyval && (keyval.len >= MAX_PACKET_KEYS))
return
var/newkey = copytext(ckeyEx( input("Enter Packet Key", "Packet Sender") as text|null ), 1, 16)
if(!newkey)
return
if (!src.master || !in_range(src.master, usr) && src.master.loc != usr)
return
if(!(src.holder in src.master))
return
var/newval = copytext(strip_html( input("Enter Packet Value", "Packer Sender") as text|null ), 1, 255)
if(!newval)
newval = "1"
return
if(!keyval)
keyval = new()
if (!src.master || !in_range(src.master, usr) && src.master.loc != usr)
return
if(!(src.holder in src.master))
return
keyval[newkey] = newval
else if (href_list["send"])
mode = 1
spawn( 0 )
var/datum/signal/signal = get_free_signal()
signal.source = src
signal.transmission_method = TRANSMISSION_RADIO
for(var/key in keyval)
signal.data[key] = keyval[key]
if ((send_freq == 1149) && (!isnull(signal.data["message"])) && (signal.data["command"] == "text_message"))
logTheThing("pdamsg", null, null, "<i><b>[src.master.owner]'s PDA used by [src.master.loc.name] ([src.master.fingerprintslast]) (as [isnull(signal.data["sender_name"]) ? "Nobody" : signal.data["sender_name"]]) &rarr; [isnull(signal.data["address_1"]) ? "Everybody" : "[signal.data["address_1"]]"]:</b></i> [signal.data["message"]]")
src.post_signal(signal,"[send_freq]")
master.updateSelfDialog()
spawn(10)
mode = 0
master.updateSelfDialog()
else if (href_list["range"])
var/rd = text2num(href_list["range"])
switch(range)
if(16)
range = 32
if(32)
if(rd>0)
range = 64
else
range = 16
if(64)
range = 32
src.master.add_fingerprint(usr)
src.master.updateSelfDialog()
return
#undef MAX_PACKET_KEYS
/proc/sanitize_frequency_diagnostic(var/f)
f = round(f)
f = max(1141, f) // 114.1
f = min(1489, f) // 148.9
if ((f % 2) == 0)
f += 1
return f
+640
View File
@@ -0,0 +1,640 @@
//CONTENTS:
//Robustris
//Robustris block datum
//Arcade game
//CodeBreaker (aka Mastermind)
#define SETUP_BLOCKS_HORIZ 10
#define SETUP_BLOCKS_VERT 12
#define SETUP_BLOCK_COLOR "565D4B"
#define SETUP_PLAYFIELD_COLOR "7A856A"
#define SETUP_ROTATE_DELAY 5
/datum/computer/file/pda_program/robustris
name = "Robustris"
size = 6
setup_use_process = 1
var/tmp/list/blocks = null
var/tmp/list/blockmap = null
var/tmp/playing = 0
var/tmp/paused = 0
var/tmp/last_rotation = 0 //Don't bog down everything spinning blocks!!
var/tmp/highscore = 0
var/tmp/datum/robustris_block/active_block = null
init()
if(!src.blocks)
src.blocks = list()
src.clear_blocks()
src.playing = -1
return
/* new disposing() pattern should handle this. -singh
Del()
src.clear_blocks()
..()
*/
disposing()
src.clear_blocks()
src.blocks = null
if (src.blockmap)
src.blockmap.len = 0
src.blockmap = null
..()
return_text()
if(..())
return
var/dat = src.return_text_header()
dat += {"<center><b>Robustris<br>
Score:</b> [src.highscore]
<style type="text/css">
#playfield
{
border: 3px solid;
background-color: #[SETUP_PLAYFIELD_COLOR];
height: [16*(SETUP_BLOCKS_VERT+1)]px;
width: [(16*SETUP_BLOCKS_HORIZ)+6]px;
overflow-x: hidden;
overflow-y: hidden;
word-wrap: break-word;
position: relative;
}
.block
{
border: 1px solid
height: 16px;
width: 16px;
position: absolute;
background: #[SETUP_BLOCK_COLOR];
}
</style>
<div id="playfield"><tt>"}
for(var/datum/robustris_block/B in src.blocks)
dat += "<div class='block'style='bottom: [B.gridy*16]px;left: [B.gridx*16]px'><font color=#[SETUP_BLOCK_COLOR]>#</font></div>"
dat += "</tt></div>"
if(playing > -1)
if(paused)
dat += "<a href='byond://?src=\ref[src];resume=1'>Resume</a></b> | "
else
dat += "<a href='byond://?src=\ref[src];pause=1'>Pause</a></b>"
if(playing < 1)
dat += "<a href='byond://?src=\ref[src];newgame=1'>New Game</a></b>"
dat += {"</center>
<script language="JavaScript">
function passkey(){
var evar=window.event;
var ourKey=evar.keyCode? evar.keyCode : evar.charCode;
window.location="byond://?src=\ref[src];movedir=" + ourKey;
}
document.onkeypress=passkey
</script>
"}
return dat
process(var/speedup = 1)
if(..() || playing<1)
return
if(!active_block)
active_block = generate_new_block()
else
var/list/superblock = list(src.active_block) + src.active_block.related
var/datum/robustris_block/stop = null
for(var/datum/robustris_block/B in superblock)
var/next_y_position = B.gridy-1
if(next_y_position >= 0)
stop = blockmap[B.gridy][B.gridx+1]
if(stop)
break
else
stop = 1
break
if(stop)
var/game_over = 0
var/list/check_pass = list()
for(var/datum/robustris_block/B in superblock)
// drsingh for index out of bounds
if (blockmap.len < B.gridy + 1)
continue
var/list/blockx = blockmap[B.gridy + 1]
if (blockx.len < B.gridx + 1)
continue
blockmap[B.gridy+1][B.gridx+1] = B
if(B.gridy > SETUP_BLOCKS_VERT)
game_over = 1
if(!(B.gridy in check_pass))
check_pass += B.gridy
active_block = null
if(game_over)
src.playing = -1
else
check_completion(check_pass)
else
for(var/datum/robustris_block/B in superblock)
B.gridy--
src.master.updateSelfDialog()
if(speedup)
spawn(5) //Ugh the process loop for items is so slow most of the time
src.process(0)
return
Topic(href, href_list)
if(..())
return
if(href_list["movedir"])
if(!active_block || !playing)
return
var/movedir = href_list["movedir"]
switch(movedir)
if("97") //A
move_block(src.active_block, -1)
if("100") //D
move_block(src.active_block, 1)
if("115") //S
rotate_block(src.active_block, 1, -1)
if("119") //W
rotate_block(src.active_block, -1, 1)
if (ishuman(usr))
var/mob/living/carbon/human/H = usr
if (H.sims)
H.sims.affectMotive("fun", 0.5)
else if(href_list["newgame"])
src.clear_blocks()
src.playing = 1
src.paused = 0
else if(href_list["pause"])
src.playing = 0
src.paused = 1
else if(href_list["resume"])
src.playing = 1
src.paused = 0
src.master.add_fingerprint(usr)
src.master.updateSelfDialog()
return
proc
clear_blocks()
for(var/datum/robustris_block/B in src.blocks)
qdel(B)
if (isnull(src.blocks))
src.blocks = list()
src.blocks.len = 0
src.highscore = 0
//qdel(src.blockmap)
src.blockmap = new /list(SETUP_BLOCKS_VERT + 3, SETUP_BLOCKS_HORIZ)
return
generate_new_block()
var/datum/robustris_block/newblock = new /datum/robustris_block(rand(1,SETUP_BLOCKS_HORIZ-2),SETUP_BLOCKS_VERT)
var/block_type = pick(1,2,3,4,20;5)
switch(block_type)
if(1) //Square block
newblock.related += new /datum/robustris_block(newblock.gridx,newblock.gridy+1,newblock)
newblock.related += new /datum/robustris_block(newblock.gridx+1,newblock.gridy+1,newblock)
newblock.related += new /datum/robustris_block(newblock.gridx+1,newblock.gridy,newblock)
newblock.cannot_rotate = 1
if(2) //L block
newblock.related += new /datum/robustris_block(newblock.gridx + pick(1,-1),newblock.gridy,newblock)
newblock.related += new /datum/robustris_block(newblock.gridx,newblock.gridy+1,newblock)
newblock.related += new /datum/robustris_block(newblock.gridx,newblock.gridy+2,newblock)
if(3) //T block
newblock.related += new /datum/robustris_block(newblock.gridx+1,newblock.gridy,newblock)
newblock.related += new /datum/robustris_block(newblock.gridx-1,newblock.gridy,newblock)
newblock.related += new /datum/robustris_block(newblock.gridx,newblock.gridy+1,newblock)
if(4) //That stupid Z block
newblock.related += new /datum/robustris_block(newblock.gridx,newblock.gridy+1,newblock)
if(prob(50))
newblock.related += new /datum/robustris_block(newblock.gridx+1,newblock.gridy+1,newblock)
newblock.related += new /datum/robustris_block(newblock.gridx+1,newblock.gridy+2,newblock)
else
newblock.related += new /datum/robustris_block(newblock.gridx-1,newblock.gridy+1,newblock)
newblock.related += new /datum/robustris_block(newblock.gridx-1,newblock.gridy+2,newblock)
if(5) //The rare and treasured line block
for(var/i=1,i<=3,i++)
newblock.related += new /datum/robustris_block(newblock.gridx,newblock.gridy+i,newblock)
src.blocks += list(newblock) + newblock.related
return newblock
//Move a block left or right however far.
move_block(var/datum/robustris_block/theblock, magnitude=0)
if(!magnitude)
return 1
var/list/superblock = list(theblock) + theblock.related
for(var/datum/robustris_block/B in superblock)
var/new_x_position = B.gridx + magnitude
if(new_x_position < 0 || new_x_position >= SETUP_BLOCKS_HORIZ)
return 0
if(B.gridy < 0 || B.gridy >= SETUP_BLOCKS_VERT)
return 0
var/test = src.blockmap[B.gridy+1][new_x_position+1]
if(test)
return 0
//I guess we CAN move! Time to all move together!
for(var/datum/robustris_block/B in superblock)
B.gridx = B.gridx + magnitude
return 1
rotate_block(var/datum/robustris_block/theblock, x_adjust=1, y_adjust=-1)
if(!theblock || theblock.cannot_rotate || ( last_rotation && world.time < (last_rotation + SETUP_ROTATE_DELAY) ))
return 0
last_rotation = world.time
var/n = 0
var/list/new_posx = new /list(theblock.related.len)
var/list/new_posy = new /list(theblock.related.len)
//Determine and test new block location for collision.
for(var/datum/robustris_block/B in theblock.related)
n++
var/testx = theblock.gridx + (B.rely * x_adjust)
var/testy = theblock.gridy + (B.relx * y_adjust)
if(testx < 0 || testx >= SETUP_BLOCKS_HORIZ || testy < 0)
return 0
if(!isnull(src.blockmap[testy + 1][testx + 1]))
return 0
new_posx[n] = testx
new_posy[n] = testy
//If everything is OK then go ahead and move them.
n = 0
for(var/datum/robustris_block/B in theblock.related)
n++
B.gridx = new_posx[n]
B.relx = B.gridx - theblock.gridx
B.gridy = new_posy[n]
B.rely = B.gridy - theblock.gridy
return 1
check_completion(var/list/rows_to_shift = list())
for(var/iy in rows_to_shift)
for(var/ix=1,ix <= SETUP_BLOCKS_HORIZ, ix++)
var/datum/robustris_block/check = src.blockmap[iy+1][ix]
if(isnull(check))
rows_to_shift -= iy
break
if(rows_to_shift.len)
for(var/n in rows_to_shift)
src.blockmap.Cut(n+1,n+2)
src.blockmap += new /list(rows_to_shift.len, SETUP_BLOCKS_HORIZ)
for(var/datum/robustris_block/B in src.blocks)
if(B.gridy in rows_to_shift)
src.blocks -= B
qdel(B)
continue
else
var/shift_count = 0
for(var/n in rows_to_shift)
if(n < B.gridy)
shift_count++
B.gridy -= shift_count
src.highscore += (100 * rows_to_shift.len)
return
/datum/robustris_block
var/gridx = 0
var/gridy = 0
var/list/related = list()
var/cannot_rotate = 0 //Don't even bother trying!
var/relx = 0
var/rely = 0 //Coordinates relative to an origin block.
New(var/starting_x=0,var/starting_y=0,var/datum/robustris_block/origin)
..()
gridx = starting_x
gridy = starting_y
if(origin)
src.relx = src.gridx - origin.gridx
src.rely = src.gridy - origin.gridy
return
/datum/computer/file/pda_program/arcade
name = "Arcade 250"
size = 8
var/enemy_name = "Space Villian"
var/temp = "Winners Don't Use Spacedrugs" //Temporary message, for attack messages, etc
var/player_hp = 30 //Player health/attack points
var/player_mp = 10
var/enemy_hp = 45 //Enemy health/attack points
var/enemy_mp = 20
var/gameover = 0
var/blocked = 0 //Player cannot attack/heal while set
New(obj/holding as obj)
..()
var/name_part1 = pick("the Automatic ", "Farmer ", "Lord ", "Professor ", "the Evil ", "the Dread King ", "the Space ", "Lord ")
var/name_part2 = pick("Melonoid", "Murdertron", "Sorcerer", "Ruin", "Jeff", "Ectoplasm", "Crushulon")
src.enemy_name = dd_replacetext((name_part1 + name_part2), "the ", "")
return_text()
if(..())
return
var/dat = src.return_text_header()
dat += "<center><h4>[src.enemy_name]</h4></center>"
dat += "<br><center><h3>[src.temp]</h3></center>"
dat += "<br><center>Health: [src.player_hp] | Magic: [src.player_mp] | Enemy Health: [src.enemy_hp]</center>"
if (src.gameover)
dat += "<center><b><a href='byond://?src=\ref[src];newgame=1'>New Game</a>"
else
dat += "<center><b><a href='byond://?src=\ref[src];attack=1'>Attack</a> | "
dat += "<a href='byond://?src=\ref[src];heal=1'>Heal</a> | "
dat += "<a href='byond://?src=\ref[src];charge=1'>Recharge Power</a>"
dat += "</b></center>"
return dat
Topic(href, href_list)
if(..())
return
if (!src.blocked)
if (href_list["attack"])
src.blocked = 1
var/attackamt = rand(2,6)
src.temp = "You attack for [attackamt] damage!"
src.master.updateSelfDialog()
sleep(10)
src.enemy_hp -= attackamt
src.arcade_action()
else if (href_list["heal"])
src.blocked = 1
var/pointamt = rand(1,3)
var/healamt = rand(6,8)
src.temp = "You use [pointamt] magic to heal for [healamt] damage!"
src.master.updateSelfDialog()
sleep(10)
src.player_mp -= pointamt
src.player_hp += healamt
src.blocked = 1
src.master.updateSelfDialog()
src.arcade_action()
else if (href_list["charge"])
src.blocked = 1
var/chargeamt = rand(4,7)
src.temp = "You regain [chargeamt] points"
src.player_mp += chargeamt
src.master.updateSelfDialog()
sleep(10)
src.arcade_action()
if (href_list["newgame"]) //Reset everything
temp = "New Round"
player_hp = 30
player_mp = 10
enemy_hp = 45
enemy_mp = 20
gameover = 0
src.master.add_fingerprint(usr)
src.master.updateSelfDialog()
return
proc/arcade_action()
if ((src.enemy_mp <= 0) || (src.enemy_hp <= 0))
src.gameover = 1
src.temp = "[src.enemy_name] has fallen! Rejoice!"
else if ((src.enemy_mp <= 5) && (prob(70)))
var/stealamt = rand(2,3)
src.temp = "[src.enemy_name] steals [stealamt] of your power!"
src.player_mp -= stealamt
src.master.updateSelfDialog()
if (src.player_mp <= 0)
src.gameover = 1
sleep(10)
src.temp = "You have been drained! GAME OVER"
else if ((src.enemy_hp <= 10) && (src.enemy_mp > 4))
src.temp = "[src.enemy_name] heals for 4 health!"
src.enemy_hp += 4
src.enemy_mp -= 4
else
var/attackamt = rand(3,6)
src.temp = "[src.enemy_name] attacks for [attackamt] damage!"
src.player_hp -= attackamt
if ((src.player_mp <= 0) || (src.player_hp <= 0))
src.gameover = 1
src.temp = "You have been crushed! GAME OVER"
src.blocked = 0
return
/datum/computer/file/pda_program/codebreaker
name = "CodeBreaker"
size = 4
var/solution = ""
var/code_length = 4
var/list/code_chars = list("A","B","C","D")
var/attempts = 10
var/init_attempts = 0
var/list/attempt_log = list()
var/playing = 0
var/temp = ""
var/difficulty = "Normal"
return_text()
if(..())
return
var/dat = src.return_text_header()
dat += "<center><h4>CodeBreaker</h4></center>"
if (playing)
dat += "<br>[src.temp]"
if(playing == -1)
dat += "<br><b>The Code was</b> \"[src.solution]\""
dat += "<br><a href='byond://?src=\ref[src];menu=1'>Main Menu</a>"
else
dat += "<br><a href='byond://?src=\ref[src];guess=1'>Guess</a>"
dat += "<br><a href='byond://?src=\ref[src];giveup=1'>Give Up</a>"
dat += "<br><small>Attempts Remaining: [src.attempts]"
for(var/i=0, i < src.attempt_log.len ,i++)
dat += "<br>[attempt_log[i+1]]"
dat += "</small><br>"
else
dat += "<br><center><h3><a href='byond://?src=\ref[src];newgame=1'>New Game</a></h3></center>"
dat += "<br><center><h3><a href='byond://?src=\ref[src];difficulty=1'>Difficulty: [src.difficulty]</a></h3></center>"
return dat
Topic(href, href_list)
if(..())
return
if (href_list["newgame"])
src.playing = 1
src.solution = ""
var/length = src.code_length
while (length > 0)
length--
src.solution += "[pick(code_chars)]"
switch(src.difficulty)
if("Easy") src.attempts = 3
if("Normal") src.attempts = 10
if("Hard") src.attempts = 30
if("Ultra-Hard") src.attempts = 50
src.init_attempts = src.attempts
var/charstring = ""
for(var/X in code_chars)
charstring += "[X] "
src.temp = "This game has a [src.code_length]-character code featuring the characters \"[charstring]\". Good luck."
else if (href_list["menu"])
src.playing = 0
src.attempt_log = list()
src.temp = ""
src.solution = ""
else if (href_list["giveup"])
if(alert("Are you sure you want to give up?","CodeBreaker","Yes","No") == "Yes")
src.attempts = 0
src.playing = -1
src.temp = "<b>YOU LOSE!</b>"
else if (href_list["guess"])
var/attempt = input("Enter your guess.","CodeBreaker") as null|text
if(!attempt)
src.temp = "Illegal move."
src.master.updateSelfDialog()
return
if(lentext(attempt) != lentext(src.solution))
src.temp = "Illegal move."
src.master.updateSelfDialog()
return
if (attempt == src.solution)
src.playing = -1
src.temp = "<b>YOU WIN!</b>"
else
if (src.attempts <= 1)
src.playing = -1
src.temp = "<b>YOU LOSE!</b>"
else
src.attempts--
var/length = lentext(src.solution)
var/list/lockcode_list = list()
for(var/i=0,i < length,i++)
//lockcode_list += "[copytext(bp.lockcode,i+1,i+2)]"
lockcode_list["[copytext(src.solution,i+1,i+2)]"]++
var/correct_full = 0
var/correct_char = 0
var/current
var/seek = 0
for(var/i=0,i < length,i++)
current = copytext(attempt,i+1,i+2)
if (current == copytext(src.solution,i+1,i+2))
correct_full++
//correct_char++
//continue
seek = lockcode_list.Find(current)
if (seek)
correct_char++
lockcode_list[current]--
if (lockcode_list[current] <= 0)
lockcode_list -= current
src.attempt_log.Insert(1,"Guess [src.init_attempts - src.attempts]: [attempt] ([correct_char]/[correct_full])")
src.temp = "Incorrect. [correct_char] correct characters, [correct_full] in correct position."
else if (href_list["difficulty"])
switch(src.difficulty)
if("Ultra-Hard")
src.set_difficulty("Easy",2,3)
src.code_chars = list("A","B")
if("Easy")
src.set_difficulty("Normal",4,10)
src.code_chars = list("A","B","C","D")
if("Normal")
src.set_difficulty("Hard",5,30)
src.code_chars = list("A","B","C","D","E")
if("Hard")
src.set_difficulty("Ultra-Hard",6,50)
src.code_chars = list("A","B","C","D","E","F")
src.master.add_fingerprint(usr)
src.master.updateSelfDialog()
return
proc/set_difficulty(var/diff,var/code_length,var/attempts)
if (!diff || !code_length || !attempts || !code_chars.len)
return null
src.difficulty = diff
src.code_length = code_length
src.attempts = attempts
#undef SETUP_BLOCKS_HORIZ
#undef SETUP_BLOCKS_VERT
#undef SETUP_BLOCK_COLOR
#undef SETUP_PLAYFIELD_COLOR
#undef SETUP_ROTATE_DELAY
+184
View File
@@ -0,0 +1,184 @@
//CONTENTS
//Module base.
//Flashlight module.
//T-ray scanner module.
//Computer 3 Emulator / Associated Bits
/obj/item/device/pda_module
name = "PDA module"
desc = "A piece of expansion circuitry for PDAs."
icon = 'icons/obj/module.dmi'
icon_state = "pdamod"
w_class = 2.0
mats = 4.0
var/obj/item/device/pda2/host = null
var/setup_use_menu_badge = 0 //Should we have a line in the main menu?
var/setup_allow_os_config = 0 //Do we support a big config page?
New()
..()
if(istype(src.loc, /obj/item/device/pda2))
src.host = src.loc
src.loc:module = src
return
Topic(href, href_list)
if(!src.host || src.loc != src.host)
return 1
if ((!usr.contents.Find(src.host) && (!in_range(src.host, usr) || !istype(src.host.loc, /turf))) && (!istype(usr, /mob/living/silicon)))
return 1
if(usr.stat || usr.restrained())
return 1
src.host.add_fingerprint(usr)
return 0
disposing()
host = null
..()
proc
//Return string as part of PDA main menu, ie easy way to toggle a function. One line!!
return_menu_badge()
return null
relay_pickup(mob/user as mob)
return
relay_drop(mob/user as mob)
return
install(var/obj/item/device/pda2/pda)
if(pda)
pda.module = src
src.host = pda
return
uninstall()
if(src.host)
src.host.module = null
src.host = null
return
/obj/item/device/pda_module/flashlight
name = "flashlight module"
desc = "A flashlight module for a PDA."
icon_state = "pdamod_light"
setup_use_menu_badge = 1
var/on = 0 //Are we currently on?
var/lumlevel = 0.5 //How bright are we?
var/datum/light/light
New()
..()
light = new /datum/light/point
light.set_brightness(lumlevel)
light.set_color(1, 1, 1)
relay_pickup(mob/user)
..()
light.attach(user)
relay_drop(mob/user)
..()
spawn(0)
if (src.host.loc != user)
light.attach(src.host.loc)
high_power
name = "high-power flashlight module"
lumlevel = 1
return_menu_badge()
var/text = "<a href='byond://?src=\ref[src];toggle=1'>[src.on ? "Disable" : "Enable"] Flashlight</a>"
return text
install(var/obj/item/device/pda2/pda)
..()
light.attach(pda)
uninstall()
light.disable()
src.on = 0
..()
Topic(href, href_list)
if(..())
return
if(href_list["toggle"])
src.on = !src.on
if (ismob(src.host.loc))
light.attach(src.host.loc)
if (src.on)
light.enable()
else
light.disable()
src.host.updateSelfDialog()
return
/obj/item/device/pda_module/tray
name = "t-ray scanner module"
desc = "A terahertz-ray emitter and scanner built into a handy PDA module."
icon_state = "pdamod_tscanner"
setup_use_menu_badge = 1
var/on = 0
return_menu_badge()
var/text = "<a href='byond://?src=\ref[src];toggle=1'>[src.on ? "Disable" : "Enable"] T-Scanner</a>"
return text
Topic(href, href_list)
if(..())
return
if(href_list["toggle"])
src.on = !src.on
if(src.on && !(src in processing_items))
processing_items.Add(src)
src.host.updateSelfDialog()
return
uninstall()
..()
src.on = 0
return
process()
if(!src.on || !src.host)
processing_items.Remove(src)
return
for(var/turf/T in range(1, src.host.loc) )
if(!T.intact)
continue
for(var/obj/O in T.contents)
if(O.level != 1)
continue
if(O.invisibility == 101)
O.invisibility = 0
spawn(10)
if(O)
var/turf/U = O.loc
if(!istype(U))
return
if(U.intact)
O.invisibility = 101
var/mob/living/M = locate() in T
if(M && M.invisibility == 2)
M.invisibility = 0
spawn(2)
if(M)
M.invisibility = 2
+770
View File
@@ -0,0 +1,770 @@
//The advanced pea-green monochrome lcd of tomorrow.
/obj/item/disk/data/cartridge
name = "Cart 2.0"
desc = "A data cartridge for portable microcomputers."
icon = 'icons/obj/pda.dmi'
icon_state = "cart"
item_state = "electronic"
file_amount = 32
title = "ROM Cart"
/obj/item/device/pda2
name = "PDA"
desc = "A portable microcomputer by Thinktronic Systems, LTD. Functionality determined by an EEPROM cartridge."
icon = 'icons/obj/pda.dmi'
icon_state = "pda"
item_state = "pda"
w_class = 2.0
rand_pos = 0
flags = FPRINT | TABLEPASS | ONBELT
module_research = list("science" = 1, "miniaturization" = 5, "devices" = 5, "efficiency" = 3)
module_research_type = /obj/item/device/pda2
var/obj/item/card/id/ID_card = null // slap an ID card into that thang
var/registered = null // so we don't need to replace all the dang checks for ID cards
var/assignment = null
var/access = list()
var/image/ID_image = null
var/owner = null
var/obj/item/disk/data/cartridge/cartridge = null //current cartridge
var/datum/computer/file/pda_program/active_program = null
var/datum/computer/file/pda_program/os/host_program = null
var/datum/computer/file/pda_program/scan/scan_program = null
var/obj/item/disk/data/fixed_disk/hd = null
var/closed = 1 //Can we insert a module now?
var/obj/item/uplink/integrated/pda/uplink = null
var/obj/item/device/pda_module/module = null
var/frequency = 1149
var/bot_freq = 1447 //Bot control frequency
var/beacon_freq = 1445 //Beacon frequency for locating beacons (I love beacons)
var/datum/radio_frequency/radio_connection
var/net_id = null //Hello dude intercepting our radio transmissions, here is a number that is not just \ref
var/tmp/list/pdasay_autocomplete = list()
var/bg_color = "6F7961"
var/link_color = "000000"
var/linkbg_color = "565D4B"
var/graphic_mode = 0
var/setup_default_cartridge = null //Cartridge contains job-specific programs
var/setup_drive_size = 24 //PDAs don't have much work room at all, really.
var/setup_system_os_path = /datum/computer/file/pda_program/os/main_os //Needs an operating system to...operate!!
var/setup_scanner_on = 1 //Do we search the cart for a scanprog to start loaded?
var/setup_default_module = /obj/item/device/pda_module/flashlight //Module to have installed on spawn.
var/mailgroup = "staff" //What special mail group the PDA is part of.
var/bombproof = 0 // can't be destroyed with detomatix
var/exploding = 0
/*
* Types of pda, for the different jobs and stuff
*/
/obj/item/device/pda2
captain
icon_state = "pda-c"
setup_default_cartridge = /obj/item/disk/data/cartridge/captain
setup_drive_size = 32
mailgroup = "command"
heads
icon_state = "pda-h"
setup_default_cartridge = /obj/item/disk/data/cartridge/head
setup_drive_size = 32
mailgroup = "command"
hos
icon_state = "pda-hos"
setup_default_cartridge = /obj/item/disk/data/cartridge/hos
setup_drive_size = 32
mailgroup = "security" // should be merged with command
ai
icon_state = "pda-h"
setup_default_cartridge = /obj/item/disk/data/cartridge/ai
setup_drive_size = 1024
bombproof = 1
mailgroup = "silicon"
cyborg
icon_state = "pda-h"
setup_default_cartridge = /obj/item/disk/data/cartridge/cyborg
setup_drive_size = 1024
bombproof = 1
mailgroup = "silicon"
research_director
icon_state = "pda-rd"
setup_default_cartridge = /obj/item/disk/data/cartridge/research_director
setup_drive_size = 32
mailgroup = "science" // merge with command
medical_director
icon_state = "pda-md"
setup_default_cartridge = /obj/item/disk/data/cartridge/medical_director
setup_drive_size = 32
mailgroup = "medresearch" // merge with command
medical
icon_state = "pda-m"
setup_default_cartridge = /obj/item/disk/data/cartridge/medical
mailgroup = "medbay"
robotics
mailgroup = "medresearch"
security
icon_state = "pda-s"
setup_default_cartridge = /obj/item/disk/data/cartridge/security
mailgroup = "security"
forensic
icon_state = "pda-s"
setup_default_cartridge = /obj/item/disk/data/cartridge/forensic
mailgroup = "security"
toxins
icon_state = "pda-tox"
setup_default_cartridge = /obj/item/disk/data/cartridge/toxins
mailgroup = "science"
genetics
icon_state = "pda-gen"
setup_default_cartridge = /obj/item/disk/data/cartridge/genetics
mailgroup = "medresearch"
quartermaster
icon_state = "pda-q"
setup_default_cartridge = /obj/item/disk/data/cartridge/quartermaster
mailgroup = "cargo"
clown
icon_state = "pda-clown"
desc = "A portable microcomputer by Thinktronic Systems, LTD. The surface is coated with polytetrafluoroethylene and banana drippings."
setup_default_cartridge = /obj/item/disk/data/cartridge/clown
HasEntered(AM as mob|obj) //Clown PDA is slippery.
if (istype(src.loc, /turf/space))
return
if (iscarbon(AM))
var/mob/M = AM
if (!M.can_slip())
return
M.pulling = null
boutput(M, "<span style=\"color:blue\">You slipped on the PDA!</span>")
playsound(src.loc, "sound/misc/slip.ogg", 50, 1, -3)
if (M.bioHolder.HasEffect("clumsy"))
M.stunned = 8
M.weakened = 5
else
M.weakened = 2
janitor
icon_state = "pda-j"
setup_default_cartridge = /obj/item/disk/data/cartridge/janitor
mailgroup = "janitor"
chaplain
icon_state = "pda-holy"
mailgroup = "chaplain"
atmos
icon_state = "pda-a"
setup_default_cartridge = /obj/item/disk/data/cartridge/atmos
engine
icon_state = "pda-e"
mailgroup = "engineer"
mining
icon_state = "pda-e"
mailgroup = "mining"
chef
mailgroup = "kitchen"
barman
mailgroup = "kitchen"
mechanic
icon_state = "pda-a"
setup_default_module = /obj/item/device/pda_module/tray
setup_default_cartridge = /obj/item/disk/data/cartridge/mechanic
mailgroup = "mechanic"
botanist
icon_state = "pda-hydro"
setup_default_cartridge = /obj/item/disk/data/cartridge/botanist
mailgroup = "botany"
syndicate
icon_state = "pda-syn"
name = "Military PDA"
owner = "John Doe"
setup_default_cartridge = /obj/item/disk/data/cartridge/nuclear
setup_system_os_path = /datum/computer/file/pda_program/os/main_os/mess_off
/obj/item/device/pda2/pickup(mob/user)
if (src.module)
src.module.relay_pickup(user)
/obj/item/device/pda2/dropped(mob/user)
if(src.module)
src.module.relay_drop(user)
/obj/item/device/pda2/New()
..()
if (!src.ID_image)
src.ID_image = image(src.icon, "blank")
spawn(5)
src.hd = new /obj/item/disk/data/fixed_disk(src)
src.hd.file_amount = src.setup_drive_size
src.hd.name = "Minidrive"
src.hd.title = "Minidrive"
if(src.setup_system_os_path)
src.host_program = new src.setup_system_os_path
src.active_program = src.host_program
src.hd.file_amount = max(src.hd.file_amount, src.host_program.size)
src.host_program.transfer_holder(src.hd)
src.hd.root.add_file(new /datum/computer/file/text/pda2manual)
src.hd.root.add_file(new /datum/computer/file/pda_program/robustris)
src.hd.root.add_file(new /datum/computer/file/pda_program/emergency_alert)
src.hd.root.add_file(new /datum/computer/file/pda_program/cargo_request(src))
src.net_id = format_net_id("\ref[src]")
if(radio_controller)
radio_controller.add_object(src, "[frequency]")
if (src.setup_default_cartridge)
src.cartridge = new src.setup_default_cartridge(src)
if (src.setup_scanner_on && src.cartridge)
var/datum/computer/file/pda_program/scan/scan = locate() in src.cartridge.root.contents
if (scan && istype(scan))
src.scan_program = scan
if(src.setup_default_module)
src.module = new src.setup_default_module(src)
/obj/item/device/pda2/disposing()
if (src.cartridge)
src.cartridge.dispose()
src.cartridge = null
src.active_program = null
src.host_program = null
src.scan_program = null
if (src.hd)
src.hd.dispose()
src.hd = null
if (src.uplink)
src.uplink.dispose()
src.uplink = null
if (src.module)
src.module.dispose()
src.module = null
if (radio_connection)
radio_connection.devices -= src
radio_connection = null
var/mob/living/ourHolder = src.loc
if (istype(ourHolder))
ourHolder.u_equip(src)
..()
/obj/item/device/pda2/attack_self(mob/user as mob)
user.machine = src
var/wincheck = winexists(user, "pda2_\ref[src]")
//boutput(world, wincheck)
if(wincheck != "MAIN")
winclone(user, "pda2", "pda2_\ref[src]")
var/display_mode = src.graphic_mode
if(!src.host_program || !owner)
display_mode = 0
if (display_mode)
winset(user, "pda2_\ref[src].texto","is-visible=false")
winset(user, "pda2_\ref[src].grido","is-visible=true")
if(src.active_program)
src.active_program.build_grid(user, "pda2_\ref[src].grido")
else
if(src.host_program)
src.run_program(src.host_program)
src.active_program.build_grid(user, "pda2_\ref[src].grido")
else
winset(user, "pda2_\ref[src].texto","is-visible=true")
winset(user, "pda2_\ref[src].grido","is-visible=false")
var/dat = {"<html><head>
<style type="text/css">
hr
{
color:#000;
background-color:#000;
height:2px;
border-width:0;
}
body
{
background-color:#[src.bg_color]
}
a:link {background-color:#[src.linkbg_color];color:#[src.link_color];text-decoration:none}
a:visited {background-color:#[src.linkbg_color];color:#[src.bg_color]}
a:active {background-color:#[src.linkbg_color];color:#[src.bg_color]}
a:hover {background-color:#[src.link_color];color:#[src.bg_color]}
</style>
</head>
<body vlink='#[src.link_color]' alink='#[src.link_color]'>"}
dat += "<a href='byond://?src=\ref[src];close=1'>Close</a>"
if (!src.owner)
if (src.cartridge)
dat += " | <a href='byond://?src=\ref[src];eject_cart=1'>Eject [src.cartridge]</a>"
if (src.ID_card)
dat += " | <a href='byond://?src=\ref[src];eject_id_card=1'>Eject [src.ID_card]</a>"
dat += "<br>Warning: No owner information entered. Please swipe card.<br><br>"
dat += "<a href='byond://?src=\ref[src];refresh=1'>Retry</a>"
else
if (src.active_program)
dat += src.active_program.return_text()
else
if (src.host_program)
src.run_program(src.host_program)
dat += src.active_program.return_text()
else
if (src.cartridge)
dat += " | <a href='byond://?src=\ref[src];eject_cart=1'>Eject [src.cartridge]</a><br>"
if (src.ID_card)
dat += " | <a href='byond://?src=\ref[src];eject_id_card=1'>Eject [src.ID_card]</a>"
dat += "<center><font color=red>Fatal Error 0x17<br>"
dat += "No System Software Loaded</font></center>"
user << output(dat, "pda2_\ref[src].texto")
winshow(user,"pda2_\ref[src]",1)
onclose(user,"pda2_\ref[src]")
return
/obj/item/device/pda2/Topic(href, href_list)
..()
if (usr.contents.Find(src) || usr.contents.Find(src.master) || (istype(src.loc, /turf) && get_dist(src, usr) <= 1))
if (usr.stat || usr.restrained())
return
src.add_fingerprint(usr)
usr.machine = src
if (href_list["return_to_host"])
if (src.host_program)
src.active_program = src.host_program
src.host_program = null
else if (href_list["eject_cart"])
src.eject_cartridge()
else if (href_list["eject_id_card"])
src.eject_id_card(usr ? usr : null)
else if (href_list["refresh"])
src.updateSelfDialog()
else if (href_list["close"])
usr << browse(null, "window=pda2_\ref[src]")
usr.machine = null
src.updateSelfDialog()
return
/obj/item/device/pda2/attackby(obj/item/C as obj, mob/user as mob)
if (istype(C, /obj/item/disk/data/cartridge) && isnull(src.cartridge))
user.drop_item()
C.set_loc(src)
boutput(user, "<span style=\"color:blue\">You insert [C] into [src].</span>")
src.cartridge = C
src.updateSelfDialog()
else if (istype(C, /obj/item/device/pda_module))
if(src.closed)
boutput(user, "<span style=\"color:red\">The casing is closed!</span>")
return
if(src.module)
boutput(user, "<span style=\"color:red\">There is already a module installed!</span>")
return
user.drop_item()
C.set_loc(src)
src.module = C
C:install(src)
src.updateSelfDialog()
return
else if (istype(C, /obj/item/screwdriver))
playsound(user.loc, "sound/items/Screwdriver.ogg", 50, 1)
src.closed = !src.closed
boutput(user, "You [src.closed ? "secure" : "unscrew"] the cover.")
else if (istype(C, /obj/item/crowbar))
if(!module)
return
if(src.closed)
boutput(user, "<span style=\"color:red\">The casing is closed!</span>")
return
src.module.set_loc(get_turf(src))
src.module.uninstall()
src.module = null
boutput(user, "You pry the module out.")
src.updateSelfDialog()
else if (istype(C, /obj/item/card/id))
var/obj/item/card/id/ID = C
if (!ID.registered)
boutput(user, "<span style=\"color:red\">This ID isn't registered to anyone!</span>")
return
if (!src.owner)
src.owner = ID.registered
src.name = "PDA-[src.owner]"
boutput(user, "<span style=\"color:blue\">Card scanned.</span>")
src.updateSelfDialog()
else
if (src.ID_card)
boutput(user, "<span style=\"color:blue\">You swap [ID] and [src.ID_card].</span>")
src.eject_id_card(user)
src.insert_id_card(ID, user)
return
else if (!src.ID_card)
src.insert_id_card(ID, user)
boutput(user, "<span style=\"color:blue\">You insert [ID] into [src].</span>")
/obj/item/device/pda2/examine()
..()
boutput(usr, "The back cover is [src.closed ? "closed" : "open"].")
if (src.ID_card)
boutput(usr, "[ID_card] has been inserted into it.")
return
/obj/item/device/pda2/receive_signal(datum/signal/signal, rx_method, rx_freq)
if(!signal || signal.encryption || !src.owner) return
if(src.host_program)
src.host_program.network_hook(signal, rx_method, rx_freq)
if(src.active_program && (src.active_program != src.host_program))
src.active_program.network_hook(signal, rx_method, rx_freq)
if(signal.data["address_1"] && signal.data["address_1"] != src.net_id)
// special programs can receive all signals
if((signal.data["address_1"] == "ping") && signal.data["sender"])
var/datum/signal/pingreply = new
pingreply.source = src
pingreply.data["device"] = "NET_PDA_51XX"
pingreply.data["netid"] = src.net_id
pingreply.data["address_1"] = signal.data["sender"]
pingreply.data["command"] = "ping_reply"
pingreply.data["data"] = src.owner
spawn(5)
src.post_signal(pingreply)
return
else if(!src.mailgroup || (signal.data["group"] != src.mailgroup))
return
if(src.host_program)
src.host_program.receive_signal(signal, rx_method, rx_freq)
if(src.active_program && (src.active_program != src.host_program))
src.active_program.receive_signal(signal, rx_method, rx_freq)
return
/obj/item/device/pda2/attack(mob/M as mob, mob/user as mob)
if(src.scan_program)
return
else
..()
/obj/item/device/pda2/afterattack(atom/A as mob|obj|turf|area, mob/user as mob)
var/scan_dat = null
if (src.scan_program && istype(src.scan_program))
scan_dat = src.scan_program.scan_atom(A)
else
scan_dat = scan_atmospheric(A) // Replaced with global proc (Convair880).
if(scan_dat)
A.visible_message("<span style=\"color:red\">[user] has scanned [A]!</span>")
user.show_message(scan_dat, 1)
return
/obj/item/device/pda2/process()
if(src.active_program)
src.active_program.process()
else
if(src.host_program && src.host_program.holder && (src.host_program.holder in src.master.contents))
src.run_program(src.host_program)
else
processing_items.Remove(src)
return
/obj/item/device/pda2/MouseDrop(atom/over_object, src_location, over_location)
..()
if (over_object == usr && src.loc == usr && isliving(usr) && !usr.stat)
src.attack_self(usr)
/obj/item/device/pda2/verb/pdasay(var/target in pdasay_autocomplete, var/message as text)
set name = "PDAsay"
set desc = "Send a PDA message to somebody (You may need to scan for other PDAs first)."
set src in usr
if (!target || !message)
return
if (usr:paralysis || usr:stunned || usr:weakened || usr:stat)
return
if (istype(src.host_program))
src.host_program.pda_message(pdasay_autocomplete[target], target, message)
/obj/item/device/pda2
proc/post_signal(datum/signal/signal,var/newfreq)
spawn(0)
if(!signal)
return
var/freq = newfreq
if(!freq)
freq = src.frequency
signal.source = src
signal.data["sender"] = src.net_id
var/datum/radio_frequency/frequency = radio_controller.return_frequency("[freq]")
signal.transmission_method = TRANSMISSION_RADIO
if(frequency)
return frequency.post_signal(src, signal)
//else
//qdel(signal)
proc/eject_cartridge()
if(src.cartridge)
var/turf/T = get_turf(src)
if(src.active_program && (src.active_program.holder == src.cartridge))
src.active_program = null
if(src.host_program && (src.host_program.holder == src.cartridge))
src.host_program = null
if(src.scan_program && (src.scan_program.holder == src.cartridge))
src.scan_program = null
src.cartridge.set_loc(T)
src.cartridge = null
return
proc/eject_id_card(var/mob/user as mob)
if (src.ID_card)
src.registered = null
src.assignment = null
src.access = null
src.underlays -= src.ID_image
if (istype(user))
user.put_in_hand_or_drop(src.ID_card)
else
var/turf/T = get_turf(src)
src.ID_card.set_loc(T)
src.ID_card = null
return
proc/insert_id_card(var/obj/item/card/id/ID as obj, var/mob/user as mob)
if (!istype(ID))
return
if (src.ID_card)
src.eject_id_card(istype(user) ? user : null)
src.ID_card = ID
if (user)
user.u_equip(ID)
ID.set_loc(src)
src.registered = ID.registered
src.assignment = ID.assignment
src.access = ID.access
src.ID_image = src.ID_card.icon_state
src.underlays += src.ID_image
src.updateSelfDialog()
/*
//Toggle the built-in flashlight
toggle_light()
src.fon = (!src.fon)
if (ismob(src.loc))
if (src.fon)
src.loc.sd_SetLuminosity(src.loc.luminosity + src.f_lum)
else
src.loc.sd_SetLuminosity(src.loc.luminosity - src.f_lum)
else
src.sd_SetLuminosity(src.fon * src.f_lum)
src.updateSelfDialog()
*/
proc/display_alert(var/alert_message) //Add alert overlay and beep
if (alert_message)
playsound(get_turf(src), "sound/machines/twobeep.ogg", 50, 1)
for (var/mob/O in hearers(3, src.loc))
O.show_message(text("[bicon(src)] *[alert_message]*"))
src.overlays = null
src.overlays += image('icons/obj/pda.dmi', "pda-r")
return
proc/run_program(datum/computer/file/pda_program/program)
if((!program) || (!program.holder))
return 0
if(!(program.holder in src))
// boutput(world, "Not in src")
program = new program.type
program.transfer_holder(src.hd)
if(program.master != src)
program.master = src
if(!src.host_program && istype(program, /datum/computer/file/pda_program/os))
src.host_program = program
if(istype(program, /datum/computer/file/pda_program/scan))
if(program == src.scan_program)
src.scan_program = null
else
src.scan_program = program
return 1
src.active_program = program
program.init()
if(program.setup_use_process && !(src in processing_items))
processing_items.Add(src)
return 1
proc/unload_active_program()
if(src.active_program == src.host_program)
return 1
if(src.active_program.setup_use_process && !src.host_program.setup_use_process)
processing_items.Remove(src)
if(src.host_program && src.host_program.holder && (src.host_program.holder in src.contents))
src.run_program(src.host_program)
else
src.active_program = null
src.updateSelfDialog()
return 1
proc/delete_file(datum/computer/file/theFile)
//boutput(world, "Deleting [file]...")
if((!theFile) || (!theFile.holder) || (theFile.holder.read_only))
//boutput(world, "Cannot delete :(")
return 0
//Don't delete the running program you jerk
if(src.active_program == theFile || src.host_program == theFile)
src.active_program = null
//boutput(world, "Now calling del on [file]...")
//qdel(file)
theFile.dispose()
return 1
proc/explode()
if (src.bombproof)
if (ismob(src.loc))
boutput(src.loc, "<span style=\"color:red\"><b>ALERT:</b> An attempt to run malicious explosive code on your PDA has been blocked.</span>")
return
if(src in bible_contents)
for(var/obj/item/storage/bible/B in world)
var/turf/T = get_turf(B.loc)
if(T)
T.hotspot_expose(700,125)
explosion(src, T, -1, -1, 2, 3)
bible_contents.Remove(src)
//dispose()
//src.dispose()
qdel(src)
return
var/turf/T = get_turf(src.loc)
if (ismob(src.loc))
var/mob/M = src.loc
M.show_message("<span style=\"color:red\">Your [src] explodes!</span>", 1)
if(T)
T.hotspot_expose(700,125)
explosion(src, T, -1, -1, 2, 3)
//dispose()
//src.dispose()
qdel(src)
return
/*
* PDA 2 ~help file~
*/
/datum/computer/file/text/pda2manual
name = "Readme"
data = {"
Thinktronic 5150 Personal Data Assistant Manual<br>
Operating System: ThinkOS 7<hr>
ThinkOS 7 comes with several useful applications built in, these include:<br>
<i><ul>
<li>Notetaker: Load, edit, and save text files just like this one!</li>
<li>Messenger: Send messages between all enabled PDAs. Can also send the current file in the clipboard.</li>
<li>File Browser: Manage and execute programs in the internal drive or loaded cartridge.</li>
<li>Atmos Scanner: Using patented AirScan technology.</li>
<li>Modules: Light up your life with a flashlight, or see right through the floor with a T-Scanner! The choice is yours!</li>
</ul></i>
<b>To send a file with the messenger:</b><br>
Enter the file browser and copy the file you want to send. Now enter the messenger and select *send file*.<br>
<br>
ThinkOS 7 supports a wide variety of software solutions, ranging from robot interface systems to forensic and medical scanners.<br>
<font size=1>This technology produced by Thinktronic Systems, LTD for the NanoTrasen Corporation</font>
"}
@@ -0,0 +1,355 @@
// Contains:
// - Portable machinery remote partent
// - Port-a-Brig remote
// - Port-a-Medbay remote
// - Port-a-NanoMed remote
// - Port-a-Sci remote
// First attempt at coding a PDA program. It's probably not very good, let's face it.
// The separate remotes have also been updated and retained as a backup in porters.dm (Convair880).
/datum/computer/file/pda_program/portable_machinery_control
name = "portable machinery base"
var/list/machinerylist = list()
var/obj/our_machinery = null // Type of machinery the remote is controlling.
var/machinery_name = "" // For HTML stuff.
var/obj/active // Selected machinery. If null, show global list instead.
var/anti_spam = 0 // In relation to world time.
proc/get_machinery()
return
// As to avoid a separate lookup for every remote.
proc/teleport_sanity_check(var/obj/machinery/test_machinery, var/mob/test_mob, var/turf/test_turf, var/no_zlevel_check = 0)
// Failure states:
// 0: Tele-blocked loc, src/dest.loc/PDA is null or related errors.
// 1: Pass.
// 2: On cooldown.
// 3: There's an occupant and type of machinery requires lock to be engaged.
// 4: Obstacle at dest.loc.
// 5: Obstacle at home.loc.
if (!test_machinery || !src.master || (test_turf && !isturf(test_turf)))
return 0
if (src.anti_spam && world.time < src.anti_spam + 50)
return 2
// If we're in a pod etc and want to summon the device, or if the machinery is on the MULE.
// Both can have unexpected and bad results.
if (!isturf(test_machinery.loc) || (!test_turf && !isturf(test_mob.loc)))
return 4
if (hasvar(test_machinery, "occupant"))
if (istype(test_machinery, /obj/machinery/port_a_brig/))
var/obj/machinery/port_a_brig/PB = test_machinery
if (PB.occupant && (test_mob && ismob(test_mob)) && (PB.occupant == test_mob))
return 0 // It's not a Port-a-Sci, okay.
if (PB.occupant && !PB.locked)
return 3
if (istype(test_machinery, /obj/machinery/port_a_medbay))
var/obj/machinery/port_a_medbay/PM = test_machinery
if (PM.occupant && (test_mob && ismob(test_mob)) && (PM.occupant == test_mob))
return 0 // It's not a Port-a-Sci, okay.
var/turf/our_loc = get_turf(src.master)
// We don't have to loop through the PDA.loc checks as well if we send the device back to its home turf.
if (test_turf)
if (!no_zlevel_check && (isrestrictedz(test_turf.z) || isrestrictedz(our_loc.z))) // Somebody will find a way to abuse it if I don't put this here.
return 0
if (test_turf.density)
return 5
for (var/obj/thing in view(0, test_turf))
if (thing.density && !(thing.flags & ON_BORDER))
return 5
for (var/obj/machinery/door/D in view(0, test_turf))
return 5
for (var/turf/simulated/wall/W in view(0, test_turf))
return 5
else
if (!our_loc || !isturf(our_loc))
return 0
if (!no_zlevel_check && isrestrictedz(our_loc.z)) // Somebody will find a way to abuse it if I don't put this here.
return 0
if (our_loc.density)
return 4
for (var/obj/thing2 in view(0, our_loc))
if (thing2.density && !(thing2.flags & ON_BORDER))
return 4
for (var/obj/machinery/door/D in view(0, our_loc))
return 4
for (var/turf/simulated/wall/W in view(0, our_loc))
return 4
return 1
init()
src.get_machinery()
return
// Probably quite the mess, but I wanted to see if identical code x4 could be averted for the HTML generation as well.
// The portable machinery objects are very similar after all.
return_text()
if (..())
return
. = src.return_text_header()
. += "<h4>[src.machinery_name] Interlink</h4>"
if (!src.active) // Show us the list.
if (!src.machinerylist || (src.machinerylist && src.machinerylist.len == 0))
. += "No linkable machinery found.<BR>"
else
for (src.our_machinery in src.machinerylist)
. += "<A href='byond://?src=\ref[src];op=control;machinery=\ref[src.our_machinery]'>[src.our_machinery] at [get_area(src.our_machinery)]</A><BR>"
. += "<BR><A href='byond://?src=\ref[src];op=scanmachinery'>Scan for linkable machinery</A><BR>"
else // Control a particular piece of machinery.
. += "<B>[src.active]</B><BR> Status: (<A href='byond://?src=\ref[src];op=control;machinery=\ref[src.active]'><i>refresh</i></A>)<BR>"
if (istype(src.active, /obj/machinery/port_a_brig/))
var/obj/machinery/port_a_brig/P2 = src.active
. += "Location: [get_area(P2)] (Home: [P2.homeloc ? "[get_area(P2.homeloc)]" : "N/A"])<BR>"
. += "Occupant: [P2.occupant ? "[P2.occupant.name]" : "None"] ([P2.locked ? "locked" : "unlocked"])"
. += "<BR>\[<A href='byond://?src=\ref[src];op=lock'>Toggle lock</A>\] "
. += "\[<A href='byond://?src=\ref[src];op=summon'>Summon</A>\] "
. += "\[<A href='byond://?src=\ref[src];op=return'>Send to home turf</A>\]<BR>"
. += "<HR><A href='byond://?src=\ref[src];op=machinerylist'>Return to list</A>"
else if (istype(src.active, /obj/machinery/port_a_medbay))
var/obj/machinery/port_a_medbay/P2 = src.active
. += "Location: [get_area(P2)] (Home: [P2.homeloc ? "[get_area(P2.homeloc)]" : "N/A"])<BR>"
. += "Occupant: [P2.occupant ? "[P2.occupant.name]" : "None"]"
. += "<BR>\[<A href='byond://?src=\ref[src];op=summon'>Summon</A>\] "
. += "\[<A href='byond://?src=\ref[src];op=return'>Send to home turf</A>\]<BR>"
. += "<HR><A href='byond://?src=\ref[src];op=machinerylist'>Return to list</A>"
else if (istype(src.active, /obj/machinery/vending/port_a_nanomed/))
var/obj/machinery/vending/port_a_nanomed/P2 = src.active
. += "Location: [get_area(P2)] (Home: [P2.homeloc ? "[get_area(P2.homeloc)]" : "N/A"])"
. += "<BR>\[<A href='byond://?src=\ref[src];op=summon'>Summon</A>\] "
. += "\[<A href='byond://?src=\ref[src];op=return'>Send to home turf</A>\]<BR>"
. += "<HR><A href='byond://?src=\ref[src];op=machinerylist'>Return to list</A>"
else if (istype(src.active, /obj/storage/closet/port_a_sci/))
var/obj/storage/closet/port_a_sci/P2 = src.active
. += "Location: [get_area(P2)] (Home: [P2.homeloc ? "[get_area(P2.homeloc)]" : "N/A"])"
. += "<BR>\[<A href='byond://?src=\ref[src];op=summon'>Summon</A>\] "
. += "\[<A href='byond://?src=\ref[src];op=return'>Send to home turf</A>\]<BR>"
. += "<HR><A href='byond://?src=\ref[src];op=machinerylist'>Return to list</A>"
else
. += "An error occurred, unable to display linkable machinery.<BR>"
. += "<HR><A href='byond://?src=\ref[src];op=machinerylist'>Return to list</A>"
return
Topic(href, href_list)
if (..())
return
var/obj/item/device/pda2/PDA = src.master
switch (href_list["op"])
if ("control")
active = locate(href_list["machinery"])
if ("scanmachinery") // Get list of linkable machinery.
src.get_machinery()
if ("machinerylist")
active = null
if ("lock")
if (istype(src.active, /obj/machinery/port_a_brig/))
var/obj/machinery/port_a_brig/P3 = src.active
if (P3.locked)
P3.locked = 0
else
P3.locked = 1
if (P3.occupant)
logTheThing("station", usr, P3.occupant, "[P3.locked ? "locks" : "unlocks"] [P3.name] with %target% inside at [log_loc(P3)].")
PDA.display_alert("<span style=\"color:blue\">The [src.machinery_name] is now [P3.locked ? "locked" : "unlocked"].</span>")
else return
if ("summon")
var/obj/P4 = src.active
var/turf/our_loc = get_turf(PDA)
// Z-level check bypass for Port-a-Sci.
var/zlevel_check_bypass = 0
if (istype(P4, /obj/storage/closet/port_a_sci/))
zlevel_check_bypass = 1
switch (src.teleport_sanity_check(P4, usr, null, zlevel_check_bypass))
if (0)
PDA.display_alert("<span style=\"color:red\">Teleportation failed due to unknown interference!</span>")
if (2)
PDA.display_alert("<span style=\"color:red\">The [src.machinery_name] is recharging!</span>")
if (3)
PDA.display_alert("<span style=\"color:red\">Cannot teleport unlocked [src.machinery_name] with someone inside!</span>")
if (4)
PDA.display_alert("<span style=\"color:red\">Teleportation failed due to obstacle!</span>")
if (5)
PDA.display_alert("<span style=\"color:red\">Teleportation failed due to obstacle at home turf!</span>")
else
src.anti_spam = world.time
P4.set_loc(our_loc)
if (hasvar(P4, "occupant"))
if (istype(P4, /obj/machinery/port_a_brig/))
var/obj/machinery/port_a_brig/PB = P4
if (PB.occupant)
PB.occupant.set_loc(PB)
if (istype(P4, /obj/machinery/port_a_medbay))
var/obj/machinery/port_a_medbay/PM = P4
if (PM.occupant)
PM.occupant.set_loc(PM)
if (istype(P4, /obj/storage/closet/port_a_sci/))
var/obj/storage/closet/port_a_sci/PS = P4
PS.on_teleport()
var/datum/effects/system/spark_spread/s = unpool(/datum/effects/system/spark_spread)
s.set_up(5, 1, P4)
s.start()
if ("return")
var/obj/P5 = src.active
var/turf/dest_loc = null
if (hasvar(P5, "homeloc"))
dest_loc = get_turf(P5:homeloc) // I have sinned, though the BAD OPERATOR might be unproblematic here.
if (!dest_loc || !isturf(dest_loc))
PDA.display_alert("<span style=\"color:red\">No home turf assigned to [src.machinery_name], can't teleport!</span>")
return
// Z-level check bypass for Port-a-Sci.
var/zlevel_check_bypass = 0
if (istype(P5, /obj/storage/closet/port_a_sci/))
zlevel_check_bypass = 1
switch (src.teleport_sanity_check(P5, usr, dest_loc, zlevel_check_bypass))
if (0)
PDA.display_alert("<span style=\"color:red\">Teleportation failed due to unknown interference!</span>")
if (2)
PDA.display_alert("<span style=\"color:red\">The [src.machinery_name] is recharging!</span>")
if (3)
PDA.display_alert("<span style=\"color:red\">Cannot teleport unlocked [src.machinery_name] with someone inside!</span>")
if (4)
PDA.display_alert("<span style=\"color:red\">Teleportation failed due to obstacle!</span>")
if (5)
PDA.display_alert("<span style=\"color:red\">Teleportation failed due to obstacle at home turf!</span>")
else
src.anti_spam = world.time
P5.set_loc(dest_loc)
if (hasvar(P5, "occupant"))
if (istype(P5, /obj/machinery/port_a_brig/))
var/obj/machinery/port_a_brig/PB2 = P5
if (PB2.occupant)
PB2.occupant.set_loc(PB2)
if (istype(P5, /obj/machinery/port_a_medbay))
var/obj/machinery/port_a_medbay/PM2 = P5
if (PM2.occupant)
PM2.occupant.set_loc(PM2)
if (istype(P5, /obj/storage/closet/port_a_sci/))
var/obj/storage/closet/port_a_sci/PS2 = P5
PS2.on_teleport()
var/datum/effects/system/spark_spread/s = unpool(/datum/effects/system/spark_spread)
s.set_up(5, 1, P5)
s.start()
PDA.updateSelfDialog()
return
/datum/computer/file/pda_program/portable_machinery_control/portabrig
name = "Port-a-Brig Remote"
our_machinery = /obj/machinery/port_a_brig/
machinery_name = "Port-a-Brig"
size = 4
get_machinery()
if (!src.master)
return
for (var/obj/machinery/port_a_brig/M in world)
var/turf/M_loc = get_turf(M)
if (M && M_loc && isturf(M_loc) && isrestrictedz(M_loc.z)) // Don't show stuff in "somewhere", okay.
continue
if (!(M in src.machinerylist))
src.machinerylist += M
return
/datum/computer/file/pda_program/portable_machinery_control/portamedbay
name = "P-Medbay Remote" // Damn forced line breaks.
our_machinery = /obj/machinery/port_a_medbay
machinery_name = "Port-a-Medbay"
size = 4
get_machinery()
if (!src.master)
return
for (var/obj/machinery/port_a_medbay/M in world)
var/turf/M_loc = get_turf(M)
if (M && M_loc && isturf(M_loc) && isrestrictedz(M_loc.z)) // Don't show stuff in "somewhere", okay.
continue
if (!(M in src.machinerylist))
src.machinerylist += M
return
/datum/computer/file/pda_program/portable_machinery_control/portananomed
name = "NanoMed Remote" // Damn forced line breaks.
our_machinery = /obj/machinery/vending/port_a_nanomed/
machinery_name = "Port-a-NanoMed"
size = 4
get_machinery()
if (!src.master)
return
for (var/obj/machinery/vending/port_a_nanomed/M in world)
var/turf/M_loc = get_turf(M)
if (M && M_loc && isturf(M_loc) && isrestrictedz(M_loc.z)) // Don't show stuff in "somewhere", okay.
continue
if (!(M in src.machinerylist))
src.machinerylist += M
return
// I suppose this device would be sorta useless with tele-block checks?
/datum/computer/file/pda_program/portable_machinery_control/portasci
name = "Port-a-Sci Remote"
our_machinery = /obj/storage/closet/port_a_sci/
machinery_name = "Port-a-Sci"
size = 4
get_machinery()
if (!src.master)
return
for (var/obj/storage/closet/port_a_sci/M in world)
/*var/turf/M_loc = get_turf(M)
if (M && M_loc && isturf(M_loc) && isrestrictedz(M_loc.z)) // Don't show stuff in "somewhere", okay.
continue*/
if (!(M in src.machinerylist))
src.machinerylist += M
return
+186
View File
@@ -0,0 +1,186 @@
//CONTENTS:
//Generic records
//Security records
//Medical records
/datum/computer/file/pda_program/records
var/mode = 0
var/datum/data/record/active1 = null //General
var/datum/data/record/active2 = null //Security/Medical/Whatever
//To-do: editing arrest status/etc from pda.
/datum/computer/file/pda_program/records/security
name = "Security Records"
size = 8
return_text()
if(..())
return
var/dat = src.return_text_header()
switch(src.mode)
if(0)
dat += "<h4>Security Record List</h4>"
for (var/datum/data/record/R in data_core.general)
dat += "<a href='byond://?src=\ref[src];select_rec=\ref[R]'>[R.fields["id"]]: [R.fields["name"]]<br>"
dat += "<br>"
if(1)
dat += "<h4>Security Record</h4>"
dat += "<a href='byond://?src=\ref[src];mode=0'>Back</a><br>"
if (istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1))
dat += "Name: [src.active1.fields["name"]] ID: [src.active1.fields["id"]]<br>"
dat += "Sex: [src.active1.fields["sex"]]<br>"
dat += "Age: [src.active1.fields["age"]]<br>"
dat += "Fingerprint: [src.active1.fields["fingerprint"]]<br>"
dat += "DNA: [src.active1.fields["dna"]]<br>"
dat += "Physical Status: [src.active1.fields["p_stat"]]<br>"
dat += "Mental Status: [src.active1.fields["m_stat"]]<br>"
else
dat += "<b>Record Lost!</b><br>"
dat += "<br>"
dat += "<h4>Security Data</h4>"
if (istype(src.active2, /datum/data/record) && data_core.security.Find(src.active2))
dat += "Criminal Status: [src.active2.fields["criminal"]]<br>"
dat += "Minor Crimes: [src.active2.fields["mi_crim"]]<br>"
dat += "Details: [src.active2.fields["mi_crim"]]<br><br>"
dat += "Major Crimes: [src.active2.fields["ma_crim"]]<br>"
dat += "Details: [src.active2.fields["ma_crim_d"]]<br><br>"
dat += "Important Notes:<br>"
dat += "[src.active2.fields["notes"]]"
else
dat += "<b>Record Lost!</b><br>"
dat += "<br>"
return dat
Topic(href, href_list)
if(..())
return
if(href_list["mode"])
var/newmode = text2num(href_list["mode"])
src.mode = max(newmode, 0)
else if(href_list["select_rec"])
var/datum/data/record/R = locate(href_list["select_rec"])
var/datum/data/record/S = locate(href_list["select_rec"])
if (data_core.general.Find(R))
for (var/datum/data/record/E in data_core.security)
if ((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"]))
S = E
break
src.active1 = R
src.active2 = S
src.mode = 1
src.master.add_fingerprint(usr)
src.master.updateSelfDialog()
return
/datum/computer/file/pda_program/records/medical
name = "Medical Records"
size = 8
return_text()
if(..())
return
var/dat = src.return_text_header()
switch(src.mode)
if(0)
dat += "<h4>Medical Record List</h4>"
for (var/datum/data/record/R in data_core.general)
dat += "<a href='byond://?src=\ref[src];select_rec=\ref[R]'>[R.fields["id"]]: [R.fields["name"]]<br>"
dat += "<br>"
if(1)
dat += "<h4>Medical Record</h4>"
dat += "<a href='byond://?src=\ref[src];mode=0'>Back</a><br>"
if (istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1))
dat += "Name: [src.active1.fields["name"]] ID: [src.active1.fields["id"]]<br>"
dat += "Sex: [src.active1.fields["sex"]]<br>"
dat += "Age: [src.active1.fields["age"]]<br>"
dat += "Fingerprint: [src.active1.fields["fingerprint"]]<br>"
dat += "DNA: [src.active1.fields["dna"]]<br>"
dat += "Physical Status: [src.active1.fields["p_stat"]]<br>"
dat += "Mental Status: [src.active1.fields["m_stat"]]<br>"
else
dat += "<b>Record Lost!</b><br>"
dat += "<br>"
dat += "<h4>Medical Data</h4>"
if (istype(src.active2, /datum/data/record) && data_core.medical.Find(src.active2))
dat += "Current Health: [src.active2.fields["h_imp"]]<br><br>"
dat += "Blood Type: [src.active2.fields["bioHolder.bloodType"]]<br><br>"
dat += "Minor Disabilities: [src.active2.fields["mi_dis"]]<br>"
dat += "Details: [src.active2.fields["mi_dis_d"]]<br><br>"
dat += "Major Disabilities: [src.active2.fields["ma_dis"]]<br>"
dat += "Details: [src.active2.fields["ma_dis_d"]]<br><br>"
dat += "Allergies: [src.active2.fields["alg"]]<br>"
dat += "Details: [src.active2.fields["alg_d"]]<br><br>"
dat += "Current Diseases: [src.active2.fields["cdi"]]<br>"
dat += "Details: [src.active2.fields["cdi_d"]]<br><br>"
dat += "Traits: [src.active2.fields["traits"]]<br><br>"
dat += "Important Notes: [src.active2.fields["notes"]]<br>"
else
dat += "<b>Record Lost!</b><br>"
dat += "<br>"
return dat
Topic(href, href_list)
if(..())
return
if(href_list["mode"])
var/newmode = text2num(href_list["mode"])
src.mode = max(newmode, 0)
else if(href_list["select_rec"])
var/datum/data/record/R = locate(href_list["select_rec"])
var/datum/data/record/M = locate(href_list["select_rec"])
if (data_core.general.Find(R))
for (var/datum/data/record/E in data_core.medical)
if ((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"]))
M = E
break
src.active1 = R
src.active2 = M
src.mode = 1
src.master.add_fingerprint(usr)
src.master.updateSelfDialog()
return
+129
View File
@@ -0,0 +1,129 @@
//CONTENTS:
//Base scanner stuff
//Health scanner
//Forensic scanner
//Reagent scanner
//Plant scanner
/datum/computer/file/pda_program/scan
return_text()
return src.return_text_header()
proc/scan_atom(atom/A as mob|obj|turf|area)
if( !A || (!src.holder) || (!src.master))
return 1
if((!istype(holder)) || (!istype(master)))
return 1
if(!(holder in src.master.contents))
if(master.scan_program == src)
master.scan_program = null
return 1
return 0
//Health analyzer program
health_scan
name = "Health Scan"
size = 8
scan_atom(atom/A as mob|obj|turf|area)
if (..())
return
if (!iscarbon(A))
return
var/mob/living/carbon/C = A
. = scan_health(C, 0, 1)
update_medical_record(C)
//Forensic scanner
forensic_scan
name = "Forensic Scan"
size = 8
scan_atom(atom/A as mob|obj|turf|area)
if(..())
return
. = scan_forensic(A) // Moved to scanprocs.dm to cut down on code duplication (Convair880).
//Reagent scanning program
reagent_scan
name = "Reagent Scan"
size = 6
scan_atom(atom/A as mob|obj|turf|area)
if (..())
return
. = scan_reagents(A)
//Plant scanner
plant_scan
name = "Plant Scan"
size = 6
scan_atom(atom/A as mob|obj|turf|area)
if(..())
return
. = scan_plant(A, usr) // Moved to scanprocs.dm to cut down on code duplication (Convair880).
electronics
name = "Device Analyzer"
size = 16
var/last_address = "02000000"
scan_atom(atom/A as obj)
if (..() || !istype(A, /obj))
return
var/obj/O = A
if(istype(O,/obj/machinery/rkit))
return
if(O.mats == 0 || O.mats == "Built" || O.is_syndicate != 0)
return "<span style=\"color:red\">Unable to scan.</span>"
if (!istype(master.host_program, /datum/computer/file/pda_program/os/main_os) || !master.host_program:message_on)
return "<span style=\"color:red\">Messaging must be on to communicate with engineering kit.</span>"
var/datum/computer/file/electronics_scan/theScan = new
theScan.scannedName = initial(O.name)
theScan.scannedPath = O.mechanics_type_override ? O.mechanics_type_override : O.type
theScan.scannedMats = O.mats
var/datum/signal/signal = get_free_signal()
signal.source = src.master
signal.transmission_method = 1
if (mechanic_controls.rkit_addresses.len)
last_address = pick(mechanic_controls.rkit_addresses)
signal.data["address_1"] = last_address
signal.data["command"] = "add"
signal.data_file = theScan
post_signal(signal)
/datum/computer/file/electronics_scan
name = "scanfile"
extension = "OSCN"
var/scannedName = null
var/scannedPath = null
var/scannedMats = null
/datum/computer/file/genetics_scan
name = "DNA Scan"
extension = "GSCN"
var/subject_name = null
var/subject_uID = null
var/list/dna_pool = list()
disposing()
if (dna_pool)
dna_pool = null
..()
File diff suppressed because it is too large Load Diff
+104
View File
@@ -0,0 +1,104 @@
/datum/computer/file/text/handbook_botanist
name = "Botanist's Handbook"
data = {"
<b>Nanotrasen Botanist's Employee Handbook</b><br>
An Assignment that'll Grow On You<hr>
<b>Chapter 1 - Introduction</b><br>
Congratulations on your assignment to Station Botanist aboard one of our twenty top of the line space stations. No crew can function well on an empty stomach, as we all know -
thus the importance of your assignment on the station to keep the larders and medicine cabinets stocked cannot be understated. In a nutshell, your specific duties include:<br>
<i><ul>
<li>Ensuring the station's food provisions are not depleted</li>
<li>Bolstering the station's supply of medicine with herbal crops</li>
<li>Performing research into plant genetics</li>
<li>Provide the Chef and Chemist with ingredients for their work</li>
<li>Perform all standard crewman duties alongside your assignment</li>
</ul></i>
Your designated area on the station is Hydroponics. Please consult the maps for the station you are posted to.<hr>
<b>Chapter 2 - Your Tools</b><br>
Cultivating crops is careful work, and many factors must be taken into consideration when growing and breeding plants. The standard Hydroponics room should be stocked with
several tools to help you carry out your assignment to the best of your ability. We will now review these tools and their correct operation.<br><br>
<u>Farmer Melons AgriPot Model 106.14</u><br>
The centerpiece of your work, a standard Hydroponics room contains sixteen of these pots, freshly cleaned and ready for use. The pots automatically fabricate a powdered
mixture of nutrients and minerals essential to sustain plant growth - all that is required is that water be added to the mixture on a regular basis to prevent the plant
from dehydrating. The pots will generally be pre-watered before every shift starts, so don't worry about adding more until prompted to do so - adding too much water to the
solution is known to dilute the mixture too much and stunt the plant's growth.<br>
Take note of the three LED lights on the base of the pot - these will indicate if the pot detects an occurrance which requires attention.
<i><ul>
<li>RED: The nutrient solution is too dry. Add water.</li>
<li>BLUE: The nutrient solution is too diluted. Add no further water.</li>
<li>GREEN: The plant has achieved maximum growth. Harvest your crops!</li>
</ul></i>
To begin growing something in one of the pots, simply plant a seed in it. Nature will do the rest, provided you keep the water level balanced!<br>
Please note that the high-nutrient composition of the soil makes it very sensitive to the presence of weeds, which will take root and thrive in the pot if their reproductive
material (fungal spores, airborne microseeds, etc) comes into contact with the solution. We recommend disposing of these various types of weed as soon as you are able.<br>
We will provide more in-depth information on plants and weeds later in this handbook.<br><br>
<u>Nanotrasen Dispensing Unit Mk1.5</u><br>
A standard Nanotrasen dispenser unit, loaded with a multitude of seeds for authorised crop types.<br>
We wish to remind crewmen that opening the device should only be performed when the device is in need of repairs, and then only by a qualified technician.<br><br>
<u>Farmer Melons Seed Extractor Model 102.04</u><br>
Invaluable in the efficient reproduction of plants, especially for genetic research, the Seed Extractor unit accepts one unit of seed-bearing fruit at a time, and will
carefully and slowly sift the item for viable seeds. The fruit will be consumed in the process, but the extractor is guaranteed to extract at least one seed from the item
of produce, preserving the plant's genetic build. This makes it a very useful tool when breeding plants.<br><br>
<u>Nanotrasen Standard Issue Watering Can</u><br>
This will be your primary tool for sustaining the hydration of growing plants. It comes pre-filled with plenty of water.<br><br>
<u>Farmer Melons Nutri-H Plantmix</u><br>
A rich nutrient slurry from Farmer Melons' processing plants, this will improve the health condition of plants - note however that this advanced mixture will cause the
soil in the pot to dry out a lot quicker - if you plan on using this, make sure you have a lot of water available.<br><br>
<u>Gen-Chem Labs Atrazine Weedkiller Compound</u><br>
A bottle containing the herbicidal compound Atrazine (nitrohychloride), it will selectively target paticular types of plant and eliminate them from the inside
once absorbed through the soil, while remaining harmless to useful types of crop. Though it takes a short time to work, it is highly effective against weed infestations
of any kind.<br><br>
<u>Farmer Melons' GeneScan v2</u><br>
You will find two handheld units of these, however they are merely backups as your PDA should have a ScanCart installed.<br>
When used on a viable strain of plant, these will scan the genetic makeup of the plant and display a report on the genes relevant to plant breeding. These genes and what
to do with them will be discussed in a later chapter.<hr>
<b>Chapter 3 - Growing Crops</b><br>
The process of growing and harvesting plants is simple enough, for the most part:<br>
<ul>
<li>1) Obtain a seed from the Dispenser, and plant it in the Plant Pot.</li>
<li>2) If the red signal switches on, add water to the pot.</li>
<li>3) Periodically check the plant by hand for abnormalities.</li>
<li>4) Optionally, add compost to improve plant condition.</li>
<li>5) When the green signal switches on, harvest the produce.</li>
<li>6) Repeat until the plant reaches the end of its lifespan.</li>
</ul>
If you wish to breed plants, it may be wise to save at least one item of produce for the Seed Extractor.<br>
While plants are growing, it is prudent to keep checking both the plant itself and the surrounding pots. Certain chemicals can cause unstable or detrimental effects upon
a plant's health and genes. In paticular you should avoid pouring unusual chemicals into the plantpots, and you should keep an eye on the other pots in the hydroponics room,
paticularly for Creeper weeds which are an aggressive, fast-growing vine capable of spreading to other pots and killing other plants.<br>
The use of compost, while not vital to growing plants, is very helpful in improving the condition of a damaged plant or increasing the crop yield and lifespan of a plant.
Simply pour the compost into the plantpot to saturate the soil with rich nutrients - take note however that this will cause the water in the pot to dry out twice as quickly,
so if you wish to nurture a plant to good health then it would be wise to not stray far from the plant. Other forms of plant nutrients exist - co-operate with the chemist
and experiment to see if you can find nutrients with more potency or other beneficial effects to the standard issue compost.<hr>
<b>Chapter 3 - Plant Breeding</b><br>
Plant Scanners will be invaulable to you in this line of work. Using a plant scanner on a plant, fruit or seed will display information about mutable genes in this plant.
Different species may have different combinations of genes. Bear in mind that genes operate in concordance with the plant's normal values for it's species.
For instance, Melons normally produce two melons per harvest - a Yield gene of 1 means they would produce three. The most well-known genes are:
<ul>
<li>Maturation Rate - how quickly the plant matures from a sprout.</li>
<li>Production Rate - how quickly the plant produces a new harvest</li>
<li>Yield - how much the plant produces per harvest</li>
<li>Lifespan - how many harvests the plant can survive</li>
<li>Endurance - how resistant the plant is to damage</li>
<li>Potency - how powerful the produce of this plant is</li>
</ul>
With the exception of the Rates, higher numbers are better. Genes are passed down from plants to their fruits and seeds - when planted, a seed will mutate slightly from the
genes it already had. This is largely up to chance and any gene could be raised or lowered - experiment with various lineages and try to get as many seeds as possible if you
are breeding for a paticular kind of gene.<hr>
<font size=1>PDA technology produced by Thinktronic Systems, LTD for the NanoTrasen Corporation</font>
"}
/datum/computer/file/text/diagnostic_readme
name = "Readme"
data = {"
<b>Readme file - Nanotrasen Network Diagnostic Cartridge for Thinktronic PDA v0.9.2</b><hr><br>
<p>For use only by qualified network diagnostic technicians.
<p>No user servicable parts inside. Do not dissasemble - risque de choc electrique.
<p>Do not use in radio frequency interference (RFI) sensitive environments. Do not use attempt to use messenger, bot control or other wireless networking applications
simultaneously as a malfunction may occur.
<p>This device does not comply with part 15 of the GCC rules. Operation is subject to the following two conditions: (1) this device
may cause harmful interference, and (2) this device will not accept any interference received, including interference that may cause undesired operation. "}
+114
View File
@@ -0,0 +1,114 @@
// Powersink - used to drain station power
/obj/item/device/powersink
desc = "A nulling power sink which drains energy from electrical systems."
name = "power sink"
icon_state = "powersink0"
item_state = "electronic"
w_class = 4.0
flags = FPRINT | TABLEPASS | CONDUCT
throwforce = 5
throw_speed = 1
throw_range = 2
m_amt = 750
w_amt = 750
var/drain_rate = 400000 // amount of power to drain per tick
var/power_drained = 0 // has drained this much power
var/max_power = 2e8 // maximum power that can be drained before exploding
var/mode = 0 // 0 = off, 1=clamped (off), 2=operating
is_syndicate = 1
mats = 16
rand_pos = 0
var/obj/cable/attached // the attached cable
var/datum/light/light
New()
..()
light = new /datum/light/point
light.set_brightness(2)
light.set_height(0.5)
light.attach(src)
attackby(var/obj/item/I, var/mob/user)
if(istype(I, /obj/item/screwdriver))
if(mode == 0)
var/turf/T = loc
if(isturf(T) && !T.intact)
attached = locate() in T
if(!attached)
boutput(user, "No exposed cable here to attach to.")
return
else
anchored = 1
mode = 1
boutput(user, "You attach the device to the cable.")
for(var/mob/M in AIviewers(user))
if(M == user) continue
boutput(M, "[user] attaches the power sink to the cable.")
return
else
boutput(user, "Device must be placed over an exposed cable to attach to it.")
return
else
anchored = 0
mode = 0
boutput(user, "You detach the device from the cable.")
for(var/mob/M in AIviewers(user))
if(M == user) continue
boutput(M, "[user] detaches the power sink from the cable.")
light.disable()
icon_state = "powersink0"
processing_items.Remove(src)
return
else
..()
attack_ai()
return
attack_hand(var/mob/user)
switch(mode)
if(0)
..()
if(1)
boutput(user, "You activate the device!")
for(var/mob/M in AIviewers(user))
if(M == user) continue
boutput(M, "[user] activates the power sink!")
mode = 2
icon_state = "powersink1"
if (!(src in processing_items))
processing_items.Add(src)
process()
if(attached)
var/datum/powernet/PN = attached.get_powernet()
if(PN)
light.enable()
// found a powernet, so drain up to max power from it
var/drained = min ( drain_rate, PN.avail )
PN.newload += drained
power_drained += drained
// if tried to drain more than available on powernet
// now look for APCs and drain their cells
if(drained < drain_rate)
for(var/obj/machinery/power/terminal/T in PN.nodes)
if(istype(T.master, /obj/machinery/power/apc))
var/obj/machinery/power/apc/A = T.master
if(A.operating && A.cell)
A.cell.charge = max(0, A.cell.charge - 50)
power_drained += 50
if(power_drained > max_power * 0.95)
playsound(src, "sound/effects/screech.ogg", 100, 1, 1)
if(power_drained >= max_power)
processing_items.Remove(src)
explosion(src, src.loc, 3,6,9,12)
qdel(src)
+194
View File
@@ -0,0 +1,194 @@
/obj/item/device/prox_sensor
name = "Proximity Sensor"
icon_state = "motion0"
var/armed = 0.0
var/timing = 0.0
var/time = null
flags = FPRINT | TABLEPASS| CONDUCT
w_class = 2.0
item_state = "electronic"
m_amt = 300
mats = 2
desc = "A device which transmits a signal when it detects movement nearby."
module_research = list("science" = 2, "devices" = 1, "miniaturization" = 4)
/obj/item/device/prox_sensor/dropped()
..()
spawn(0)
src.sense()
/obj/item/device/prox_sensor/proc/update_icon()
var/n = 0
if(armed) n = 1
else if(timing) n = 2
icon_state = "motion[n]"
if(src.master)
src.master:c_state(n)
return
/obj/item/device/prox_sensor/proc/sense()
if (src.armed == 1)
if (src.master)
spawn(0)
var/datum/signal/signal = get_free_signal()
signal.source = src
signal.data["message"] = "ACTIVATE"
src.master.receive_signal(signal)
return
else
for(var/mob/O in hearers(null, null))
O.show_message("[bicon(src)] *beep* *beep*", 3, "*beep* *beep*", 2)
return
/obj/item/device/prox_sensor/process()
if (src.timing)
if (src.time > 0)
if(src.armed != 1)
src.update_icon()
src.time = round(src.time) - 1
else src.timing = 0
else
src.armed = 1
src.time = 0
src.timing = 0
src.update_icon()
if (!src.master)
if (istype(src.loc, /mob))
attack_self(src.loc)
else
for(var/mob/M in viewers(1, src))
if (M.client && (M.machine == src.master || M.machine == src))
src.attack_self(M)
else
if (istype(src.master.loc, /mob))
src.attack_self(src.master.loc)
else
for(var/mob/M in viewers(1, src.master))
if (M.client && (M.machine == src.master || M.machine == src))
src.attack_self(M)
else
processing_items.Remove(src)
return
return
/obj/item/device/prox_sensor/HasProximity(atom/movable/AM as mob|obj)
if (istype(AM, /obj/projectile))
return
if (AM.move_speed < 12)
src.sense()
return
/obj/item/device/prox_sensor/attackby(obj/item/device/radio/signaler/S as obj, mob/user as mob)
if ((!( istype(S, /obj/item/device/radio/signaler) ) || !( S.b_stat )))
return
var/obj/item/assembly/rad_prox/R = new /obj/item/assembly/rad_prox( user )
S.set_loc(R)
R.part1 = S
S.layer = initial(S.layer)
user.u_equip(S)
user.put_in_hand_or_drop(R)
S.master = R
src.master = R
src.layer = initial(src.layer)
user.u_equip(src)
src.set_loc(R)
R.part2 = src
R.dir = src.dir
src.add_fingerprint(user)
return
/obj/item/device/prox_sensor/attack_self(mob/user as mob)
if (user.stat || user.restrained() || user.lying)
return
if ((src in user) || (src.master && src.master in user) || get_dist(src, user) <= 1 && istype(src.loc, /turf))
user.machine = src
var/second = src.time % 60
var/minute = (src.time - second) / 60
var/dat = text("<TT><B>Proximity Sensor</B><br>[] []:[]<br><A href='?src=\ref[];tp=-30'>-</A> <A href='?src=\ref[];tp=-1'>-</A> <A href='?src=\ref[];tp=1'>+</A> <A href='?src=\ref[];tp=30'>+</A><br></TT>", (src.timing ? text("<A href='?src=\ref[];time=0'>Timing</A>", src) : text("<A href='?src=\ref[];time=1'>Not Timing</A>", src)), minute, second, src, src, src, src)
dat += "<BR><A href='?src=\ref[src];arm=1'>[src.armed ? "Armed":"Not Armed"]</A> (Movement sensor active when armed!)"
dat += "<BR><BR><A href='?src=\ref[src];close=1'>Close</A>"
user << browse(dat, "window=prox")
onclose(user, "prox")
else
user << browse(null, "window=prox")
user.machine = null
return
/obj/item/device/prox_sensor/Topic(href, href_list)
..()
if (usr.stat || usr.restrained() || usr.lying)
return
if ((src in usr) || (src.master && (src.master in usr)) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf)))
usr.machine = src
if (href_list["arm"])
src.armed = !src.armed
src.update_icon()
if(timing || armed && !(src in processing_items))
processing_items.Add(src)
var/turf/T = get_turf(src)
if (master && istype(master, /obj/item/device/transfer_valve))
logTheThing("bombing", usr, null, "[armed ? "armed" : "disarmed"] a proximity device on a transfer valve at [showCoords(T.x, T.y, T.z)].")
message_admins("[key_name(usr)] [armed ? "armed" : "disarmed"] a proximity device on a transfer valve at [showCoords(T.x, T.y, T.z)].")
else if (src.master && istype(src.master, /obj/item/assembly/prox_ignite)) //Prox-detonated beaker assemblies
var/obj/item/assembly/rad_ignite/RI = src.master
logTheThing("bombing", usr, null, "[armed ? "armed" : "disarmed"] a proximity device on a radio-igniter assembly at [T ? showCoords(T.x, T.y, T.z) : "horrible no-loc nowhere void"]. Contents: [log_reagents(RI.part3)]")
else if(src.master && istype(src.master, /obj/item/assembly/proximity_bomb)) //Prox-detonated single-tank bombs
logTheThing("bombing", usr, null, "[armed ? "armed" : "disarmed"] a proximity device on a single-tank bomb at [T ? showCoords(T.x, T.y, T.z) : "horrible no-loc nowhere void"].")
message_admins("[key_name(usr)] [armed ? "armed" : "disarmed"] a proximity device on a single-tank bomb at [T ? showCoords(T.x, T.y, T.z) : "horrible no-loc nowhere void"].")
if (href_list["time"])
src.timing = text2num(href_list["time"])
src.update_icon()
if(timing || armed && !(src in processing_items))
processing_items.Add(src)
var/turf/T = get_turf(src)
if (master && istype(master, /obj/item/device/transfer_valve))
logTheThing("bombing", usr, null, "[timing ? "initiated" : "defused"] a prox-arming timer on a transfer valve at [showCoords(T.x, T.y, T.z)].")
message_admins("[key_name(usr)] [timing ? "initiated" : "defused"] a prox-arming timer on a transfer valve at [showCoords(T.x, T.y, T.z)].")
else if (src.master && istype(src.master, /obj/item/assembly/prox_ignite)) //Proximity-detonated beaker assemblies
var/obj/item/assembly/rad_ignite/RI = src.master
logTheThing("bombing", usr, null, "[timing ? "initiated" : "defused"] a prox-arming timer on a radio-igniter assembly at [T ? showCoords(T.x, T.y, T.z) : "horrible no-loc nowhere void"]. Contents: [log_reagents(RI.part3)]")
else if(src.master && istype(src.master, /obj/item/assembly/proximity_bomb)) //Radio-detonated single-tank bombs
logTheThing("bombing", usr, null, "[timing ? "initiated" : "defused"] a prox-arming timer on a single-tank bomb at [T ? showCoords(T.x, T.y, T.z) : "horrible no-loc nowhere void"].")
message_admins("[key_name(usr)] [timing ? "initiated" : "defused"] a prox-arming timer on a single-tank bomb at [T ? showCoords(T.x, T.y, T.z) : "horrible no-loc nowhere void"].")
if (href_list["tp"])
var/tp = text2num(href_list["tp"])
src.time += tp
src.time = min(max(round(src.time), 0), 600)
if (href_list["close"])
usr << browse(null, "window=prox")
usr.machine = null
return
if (!src.master)
if (istype(src.loc, /mob))
attack_self(src.loc)
else
for(var/mob/M in viewers(1, src))
if (M.client && (M.machine == src.master || M.machine == src))
src.attack_self(M)
else
if (istype(src.master.loc, /mob))
src.attack_self(src.master.loc)
else
for(var/mob/M in viewers(1, src.master))
if (M.client && (M.machine == src.master || M.machine == src))
src.attack_self(M)
else
usr << browse(null, "window=prox")
return
return
/obj/item/device/prox_sensor/Move()
..()
src.sense()
return
+838
View File
@@ -0,0 +1,838 @@
/obj/item/device/radio
name = "station bounced radio"
suffix = "\[3\]"
icon_state = "walkietalkie"
item_state = "walkietalkie"
var/device_color = RADIOC_STANDARD
var/last_transmission
var/frequency = R_FREQ_DEFAULT
var/list/secure_frequencies = null
var/list/secure_colors = list("#E00000")
var/protected_radio = 0 // Cannot be picked up by radio_brain bioeffect.
var/traitor_frequency = 0.0
var/obj/item/device/radio/patch_link = null
var/obj/item/uplink/integrated/radio/traitorradio = null
var/wires = WIRE_SIGNAL | WIRE_RECEIVE | WIRE_TRANSMIT
var/b_stat = 0.0
var/broadcasting = null
var/listening = 1.0
var/list/secure_connections = null
var/datum/radio_frequency/radio_connection
var/speaker_range = 2
flags = FPRINT | TABLEPASS | ONBELT | CONDUCT
throw_speed = 2
throw_range = 9
w_class = 2.0
mats = 3
var/const
WIRE_SIGNAL = 1 //sends a signal, like to set off a bomb or electrocute someone
WIRE_RECEIVE = 2
WIRE_TRANSMIT = 4
TRANSMISSION_DELAY = 5 // only 2/second/radio
desc = "A portable, non-wearable radio for communicating over a specified frequency. Has a microphone and a speaker which can be independently toggled."
// Moved initializaiton to world/New
var/list/headset_channel_lookup
/obj/item/device/radio/New()
..()
if(radio_controller)
initialize()
/obj/item/device/radio/initialize()
if (src.frequency < 1441 || src.frequency > 1489)
world.log << "[src] ([src.type]) has a frequency of [src.frequency], sanitizing."
src.frequency = sanitize_frequency(src.frequency)
set_frequency(frequency)
if(src.secure_frequencies)
set_secure_frequencies()
/obj/item/device/radio
proc
set_frequency(new_frequency)
radio_controller.remove_object(src, "[frequency]")
frequency = new_frequency
radio_connection = radio_controller.add_object(src, "[frequency]")
set_secure_frequencies()
if(istype(src.secure_frequencies))
for (var/sayToken in src.secure_frequencies)
var/frequency_id = src.secure_frequencies["[sayToken]"]
if (frequency_id)
if (!istype(src.secure_connections))
src.secure_connections = list()
src.secure_connections["[sayToken]"] = radio_controller.add_object(src, "[frequency_id]")
else
src.secure_frequencies -= "[sayToken]"
set_secure_frequency(frequencyToken, newFrequency)
if (!istype(src.secure_frequencies) || !frequencyToken || !newFrequency)
return
var/oldFrequency = src.secure_frequencies["[frequencyToken]"]
if (oldFrequency)
radio_controller.remove_object(src, "[oldFrequency]")
src.secure_connections["[frequencyToken]"] = radio_controller.add_object(src, "[newFrequency]")
src.secure_frequencies["[frequencyToken]"] = newFrequency
return
/obj/item/device/radio/attack_self(mob/user as mob)
user.machine = src
var/t1
if (src.b_stat)
t1 = {"
-------<BR>
Green Wire: <A href='byond://?src=\ref[src];wires=4'>[src.wires & 4 ? "Cut" : "Mend"] Wire</A><BR>
Red Wire: <A href='byond://?src=\ref[src];wires=2'>[src.wires & 2 ? "Cut" : "Mend"] Wire</A><BR>
Blue Wire: <A href='byond://?src=\ref[src];wires=1'>[src.wires & 1 ? "Cut" : "Mend"] Wire</A><BR>-------<BR>"}
/*
if (istype(src.secure_frequencies) && src.secure_frequencies.len)
t1 += "Supplementary Channels:<br>"
for (var/sayToken in src.secure_frequencies)
t1 += "\[[format_frequency(src.secure_frequencies["[sayToken]"])]] (Activator: <b>[sayToken]</b>) <a href='byond://?src=\ref[src];removemodule=[sayToken]'>Remove</a><br>"
*/
else
t1 = "-------"
var/dat = {"
<TT>
Microphone: [src.broadcasting ? "<A href='byond://?src=\ref[src];talk=0'>Engaged</A>" : "<A href='byond://?src=\ref[src];talk=1'>Disengaged</A>"]<BR>
Speaker: [src.listening ? "<A href='byond://?src=\ref[src];listen=0'>Engaged</A>" : "<A href='byond://?src=\ref[src];listen=1'>Disengaged</A>"]<BR>
Frequency:
<A href='byond://?src=\ref[src];freq=-10'>-</A>
<A href='byond://?src=\ref[src];freq=-2'>-</A>
[format_frequency(src.frequency)]
<A href='byond://?src=\ref[src];freq=2'>+</A>
<A href='byond://?src=\ref[src];freq=10'>+</A><BR>"}
if (istype(src.secure_frequencies) && src.secure_frequencies.len)
dat+= "Supplementary Channels:<br>"
for (var/sayToken in src.secure_frequencies)
dat += "[ headset_channel_lookup["[src.secure_frequencies["[sayToken]"]]"] ? headset_channel_lookup["[src.secure_frequencies["[sayToken]"]]"] : "???" ]: \[[format_frequency(src.secure_frequencies["[sayToken]"])]] (Activator: <b>[sayToken]</b>)<br>"
dat += "[t1]</TT>"
user << browse(dat, "window=radio")
onclose(user, "radio")
return
/obj/item/device/radio/Topic(href, href_list)
//..()
if (usr.stat)
return
if ((istype(usr, /mob/living/silicon)) || (src in usr) || (istype(src, /obj/item/device/radio/intercom) && (get_dist(src, usr) <= 1) && (istype(src.loc, /turf))) || (usr.loc == src.loc)) // Band-aid fix for intercoms, RE 'bounds_dist' check in the 'in_range' proc. Feel free to improve the implementation (Convair880).
usr.machine = src
if (href_list["track"])
var/mob/target = locate(href_list["track"])
var/mob/living/silicon/ai/A = locate(href_list["track2"])
A.ai_actual_track(target)
return
if (href_list["freq"])
var/new_frequency = sanitize_frequency(frequency + text2num(href_list["freq"]))
set_frequency(new_frequency)
if (!isnull(src.traitorradio) && src.traitor_frequency && src.frequency == src.traitor_frequency)
usr.machine = null
usr << browse(null, "window=radio")
onclose(usr, "radio")
// now transform the regular radio, into a (disguised)syndicate uplink!
var/obj/item/uplink/integrated/radio/T = src.traitorradio
var/obj/item/device/radio/R = src
R.set_loc(T)
usr.u_equip(R)
usr.put_in_hand_or_drop(T)
R.set_loc(T)
T.attack_self(usr)
return
else if (href_list["talk"])
src.broadcasting = text2num(href_list["talk"])
else if (href_list["listen"])
src.listening = text2num(href_list["listen"])
else if (href_list["wires"])
var/t1 = text2num(href_list["wires"])
if (!( istype(usr.equipped(), /obj/item/wirecutters) ))
return
if (t1 & 1)
if (src.wires & 1)
src.wires &= 65534
else
src.wires |= 1
else
if (t1 & 2)
if (src.wires & 2)
src.wires &= 65533
else
src.wires |= 2
else
if (t1 & 4)
if (src.wires & 4)
src.wires &= 65531
else
src.wires |= 4
/*
else if (href_list["removemodule"])
var/tokenToRemove = ckey(href_list["removemodule"])
if (!tokenToRemove || !(tokenToRemove in src.secure_frequencies))
return
*/
if (!( src.master ))
if (istype(src.loc, /mob))
attack_self(src.loc)
else if (istype(src.loc, /obj))
for(var/mob/M in src.loc)
attack_self(M)
else
src.updateDialog()
else
if (istype(src.master.loc, /mob))
src.attack_self(src.master.loc)
else
src.updateDialog()
src.add_fingerprint(usr)
else
usr << browse(null, "window=radio")
/obj/item/device/radio/talk_into(mob/M as mob, messages, secure, real_name, lang_id)
// According to a pair of DEBUG calls set up for testing, no radio jammer check for the src radio was performed.
// As improbable as this sounds, there are bug reports too to back up the findings. So uhm...
if (src.radio_connection.check_for_jammer(src) != 0)
return
if (!(src.wires & 4))
return
// if (last_transmission && world.time < (last_transmission + TRANSMISSION_DELAY))
// return
var/eqjobname
if (iscarbon(M))
if (hasvar(M, "wear_id"))
if (M:wear_id)
eqjobname = M:wear_id:assignment
else
eqjobname = "No ID"
else if (isAI(M))
eqjobname = "AI"
else if (isrobot(M))
eqjobname = "Cyborg"
else if (istype(M, /obj/machinery/computer)) // :v
eqjobname = "Computer"
else
eqjobname = "Unknown"
var/list/receive = list()
var/display_freq = src.frequency //Frequency to display on radio broadcast messages
var/datum/radio_frequency/connection = null
if (secure && src.secure_connections && istype(src.secure_connections["[secure]"], /datum/radio_frequency))
connection = src.secure_connections["[secure]"]
display_freq = src.secure_frequencies["[secure]"]
else
connection = src.radio_connection
secure = 0
for (var/obj/item/device/radio/R in connection.devices)
if (connection.check_for_jammer(R))
continue
if (R.accept_rad(src, messages, connection))
for (var/i in R.send_hear())
if (!(i in receive))
receive += i
// Don't let them monitor Syndie headsets. You can get the radio_brain bioeffect at the start of the round, basically.
if (src.protected_radio != 1 && isnull(src.traitorradio))
for (var/mob/living/L in radio_brains)
receive += L
for (var/mob/dead/D in mobs)
if (D.client && (istype(D, /mob/dead/observer) || (istype(D, /mob/wraith) && !D.density)) || ((!isturf(src.loc) && src.loc == D.loc) && !istype(D, /mob/dead/target_observer)))
if (!(D in receive))
receive += D
var/list/heard_masked = list() // masked name or no real name
var/list/heard_normal = list() // normal message
var/list/heard_voice = list() // voice message
var/list/heard_garbled = list() // garbled message
// Receiving mobs
for (var/mob/R in receive)
if (R.say_understands(M, lang_id))
if (!ishuman(M) || (ishuman(M) && M.wear_mask && M.wear_mask.vchange))//istype(M.wear_mask, /obj/item/clothing/mask/gas/voice))
heard_masked += R
else
heard_normal += R
else
if (M.voice_message)
heard_voice += R
else
heard_garbled += R
//DEBUG("Message transmitted. Frequency: [display_freq]. Source: [src] at [log_loc(src)]. Receiver: [R] at [log_loc(R)].")
var/rendered
if (length(heard_masked) || length(heard_normal) || length(heard_voice) || length(heard_garbled))
var/textColor = null
if (secure)
textColor = secure_colors["[secure]"]
if (!textColor)
if (secure_colors.len)
textColor = secure_colors[1]
else
textColor = "#E00000"
var/part_a
if (ismob(M) && M.mind)
part_a = "<span class='radio' style='color: [secure ? textColor : src.device_color]'><span class='name' data-ctx='\ref[M.mind]'>"
else
part_a = "<span class='radio' style='color: [secure ? textColor : src.device_color]'><span class='name'>"
var/part_b = "</span><b> [bicon(src)]\[[format_frequency(display_freq)]\]</b> <span class='message'>"
var/part_c = "</span></span>"
if (length(heard_masked))
if (ishuman(M))
if (M:wear_id)
rendered = "[part_a][M:wear_id:registered][part_b][M.say_quote(messages[1])][part_c]"
else
rendered = "[part_a]Unknown[part_b][M.say_quote(messages[1])][part_c]"
else
rendered = "[part_a][M.name][part_b][M.say_quote(messages[1])][part_c]"
for (var/mob/R in heard_masked)
var/thisR = rendered
if (isAI(R))
thisR = "[part_a]<a href='byond://?src=\ref[src];track2=\ref[R];track=\ref[M]'>[M.name] ([eqjobname]) </a>[part_b][M.say_quote(messages[1])][part_c]"
if (R.client && R.client.holder && ismob(M) && M.mind)
thisR = "<span class='adminHearing' data-ctx='[R.client.chatOutput.ctxFlag]'>[thisR]</span>"
R.show_message(thisR, 2)
if (length(heard_normal))
rendered = "[part_a][real_name ? real_name : M.real_name][part_b][M.say_quote(messages[1])][part_c]"
for (var/mob/R in heard_normal)
var/thisR = rendered
if (isAI(R))
thisR = "[part_a]<a href='byond://?src=\ref[src];track2=\ref[R];track=\ref[M]'>[real_name ? real_name : M.real_name] ([eqjobname]) </a>[part_b][M.say_quote(messages[1])][part_c]"
if (R.client && R.client.holder && M.mind)
thisR = "<span class='adminHearing' data-ctx='[R.client.chatOutput.ctxFlag]'>[thisR]</span>"
R.show_message(thisR, 2)
if (length(heard_voice))
rendered = "[part_a][M.voice_name][part_b][M.voice_message][part_c]"
for (var/mob/R in heard_voice)
var/thisR = rendered
if (isAI(R))
thisR = "[part_a]<a href='byond://?src=\ref[src];track2=\ref[R];track=\ref[M]'>[M.voice_name] ([eqjobname]) </a>[part_b][M.voice_message][part_c]"
if (R.client && R.client.holder && M.mind)
thisR = "<span class='adminHearing' data-ctx='[R.client.chatOutput.ctxFlag]'>[thisR]</span>"
R.show_message(thisR, 2)
if (length(heard_garbled))
rendered = "[part_a][M.voice_name][part_b][M.say_quote(messages[2])][part_c]"
for (var/mob/R in heard_garbled)
var/thisR = rendered
if (isAI(R))
thisR = "[part_a]<a href='byond://?src=\ref[src];track2=\ref[R];track=\ref[M]'>[M.voice_name]</a>[part_b][M.say_quote(messages[2])][part_c]"
if (R.client && R.client.holder && M.mind)
thisR = "<span class='adminHearing' data-ctx='[R.client.chatOutput.ctxFlag]'>[thisR]</span>"
R.show_message(thisR, 2)
/obj/item/device/radio/hear_talk(mob/M as mob, msgs, real_name, lang_id)
if (src.broadcasting)
talk_into(M, msgs, null, real_name, lang_id)
// Hope I didn't butcher this, but I couldn't help but notice some odd stuff going on when I tried to debug radio jammers (Convair880).
/obj/item/device/radio/proc/accept_rad(obj/item/device/radio/R as obj, message, var/datum/radio_frequency/freq)
if (message)
// Simple frequency match. The only check that used to be here.
if (src.frequency == R.frequency)
//DEBUG("Match found for transmission from [R] at [log_loc(R)] (simple frequency match)")
return 1
// Secure channel lookup when R.frequency != src.frequency. According to DEBUG calls set up for testing,
// this meant the receiving radio would decline the message even though both share a secure channel.
else if (src.secure_connections && istype(src.secure_connections) && src.secure_connections.len && freq && istype(freq))
var/list/datum/radio_frequency/RF = list()
for (var/key in src.secure_connections)
if (!RF.Find(src.secure_connections["[key]"]) && istype(src.secure_connections["[key]"], /datum/radio_frequency))
RF.Add(src.secure_connections["[key]"])
// Secure channel match. Easy.
if (RF.Find(freq) && freq.devices.Find(src))
//DEBUG("Match found for transmission from [R] at [log_loc(R)] (list/devices match)")
return 1
// Sender didn't use a secure channel prefix, giving us the 145.9 radio frequency datum.
// The devices list is useless here, but we can still receive the message if one of our
// secure channels happens to have the same frequency as the sender's radio.
if (src.secure_frequencies && istype(src.secure_frequencies) && src.secure_frequencies.len)
for (var/freq2 in src.secure_frequencies)
if (isnum(src.secure_frequencies["[freq2]"]) && src.secure_frequencies["[freq2]"] == R.frequency)
//DEBUG("Match found for transmission from [R] at [log_loc(R)] (frequency compare)")
return 1
return 0
/obj/item/device/radio/proc/send_hear()
last_transmission = world.time
if ((src.listening && src.wires & 2))
var/list/hear = hearers(src.speaker_range, src.loc) // changed so station bounce radios will be loud and headsets will only be heard on their tile
// modified so that a mob holding the radio is always a hearer of it
// this fixes radio problems when inside something (e.g. mulebot)
if(ismob(loc))
if(! hear.Find(loc) )
hear += loc
//modified so people in the same object as it can hear it
if(istype(loc, /obj))
for(var/mob/M in loc)
if(! hear.Find(M) )
hear += M
return hear
return
/obj/item/device/radio/examine()
set src in view()
set category = "Local"
..()
if ((in_range(src, usr) || src.loc == usr))
if (src.b_stat)
usr.show_message("<span style=\"color:blue\">\the [src] can be attached and modified!</span>")
else
usr.show_message("<span style=\"color:blue\">\the [src] can not be modified or attached!</span>")
if (istype(src.secure_frequencies) && src.secure_frequencies.len)
boutput(usr, "Supplementary Channels:")
for (var/sayToken in src.secure_frequencies) //Most convoluted string of the year award 2013
boutput(usr, "[ headset_channel_lookup["[src.secure_frequencies["[sayToken]"]]"] ? headset_channel_lookup["[src.secure_frequencies["[sayToken]"]]"] : "???" ]: \[[format_frequency(src.secure_frequencies["[sayToken]"])]] (Activator: <b>[sayToken]</b>)")
return
/obj/item/device/radio/attackby(obj/item/W as obj, mob/user as mob)
user.machine = src
if (!( istype(W, /obj/item/screwdriver) ))
return
src.b_stat = !( src.b_stat )
if (src.b_stat)
user.show_message("<span style=\"color:blue\">The radio can now be attached and modified!</span>")
else
user.show_message("<span style=\"color:blue\">The radio can no longer be modified or attached!</span>")
if (istype(src.loc, /mob/living))
var/mob/living/M = src.loc
src.attack_self(M)
//Foreach goto(83)
src.add_fingerprint(user)
return
/obj/item/device/radio/emp_act()
broadcasting = 0
listening = 0
return
/obj/item/radiojammer
name = "signal jammer"
desc = "An illegal device used to jam radio signals, preventing broadcast or transmission."
icon = 'icons/obj/objects.dmi'
icon_state = "shieldoff"
w_class = 1
var/active = 0
is_syndicate = 1
mats = 10
attack_self(var/mob/user as mob)
if (!(radio_controller && istype(radio_controller)))
return
src.active = !src.active
if (src.active)
boutput(user, "You activate [src].")
src.icon_state = "shieldon"
if (!radio_controller.active_jammers.Find(src))
radio_controller.active_jammers.Add(src)
else
boutput(user, "You shut off [src].")
icon_state = "shieldoff"
if (radio_controller.active_jammers.Find(src))
radio_controller.active_jammers.Remove(src)
disposing()
if (radio_controller && istype(radio_controller) && radio_controller.active_jammers.Find(src))
radio_controller.active_jammers.Remove(src)
..()
/obj/item/device/radio/beacon
name = "Tracking Beacon"
icon_state = "beacon"
item_state = "signaler"
desc = "A small beacon that is tracked by the Teleporter Computer, allowing things to be sent to its general location."
burn_possible = 0
/obj/item/device/radio/beacon/hear_talk()
return
/obj/item/device/radio/beacon/send_hear()
return null
/obj/item/device/radio/electropack
name = "Electropack"
icon_state = "electropack0"
var/code = 2.0
var/on = 0.0
// var/e_pads = 0.0
frequency = 1451
w_class = 5.0
flags = FPRINT | TABLEPASS | ONBACK | CONDUCT
item_state = "electropack"
desc = "A device that, when signaled on the correct frequency, causes a disabling electric shock to be sent to the animal wearing it."
cant_self_remove = 1
/*
/obj/item/device/radio/electropack/examine()
set src in view()
set category = "Local"
..()
if ((in_range(src, usr) || src.loc == usr))
if (src.e_pads)
boutput(usr, "<span style=\"color:blue\">The electric pads are exposed!</span>")
return*/
/obj/item/device/radio/electropack/attackby(obj/item/W as obj, mob/user as mob)
// This doesn't seem to do anything (Convair880).
/*if (istype(W, /obj/item/screwdriver))
src.e_pads = !( src.e_pads )
if (src.e_pads)
user.show_message("<span style=\"color:blue\">The electric pads have been exposed!</span>")
else
user.show_message("<span style=\"color:blue\">The electric pads have been reinserted!</span>")
src.add_fingerprint(user)
else*/
if (istype(W, /obj/item/clothing/head/helmet))
var/obj/item/assembly/shock_kit/A = new /obj/item/assembly/shock_kit( user )
W.set_loc(A)
A.part1 = W
W.layer = initial(W.layer)
user.u_equip(W)
user.put_in_hand_or_drop(A)
W.master = A
src.master = A
src.layer = initial(src.layer)
user.u_equip(src)
src.set_loc(A)
A.part2 = src
src.add_fingerprint(user)
return
/obj/item/device/radio/electropack/Topic(href, href_list)
//..()
if (usr.stat || usr.restrained())
return
if (src in usr || (src.master && src.master in usr) || (in_range(src, usr) && istype(src.loc, /turf)))
usr.machine = src
if (href_list["freq"])
var/new_frequency = sanitize_frequency(frequency + text2num(href_list["freq"]))
set_frequency(new_frequency)
else
if (href_list["code"])
src.code += text2num(href_list["code"])
src.code = round(src.code)
src.code = min(100, src.code)
src.code = max(1, src.code)
else
if (href_list["power"])
src.on = !( src.on )
src.icon_state = text("electropack[]", src.on)
if (!( src.master ))
if (istype(src.loc, /mob))
attack_self(src.loc)
else
for(var/mob/M in viewers(1, src))
if (M.client)
src.attack_self(M)
else
if (istype(src.master.loc, /mob))
src.attack_self(src.master.loc)
else
for(var/mob/M in viewers(1, src.master))
if (M.client)
src.attack_self(M)
else
usr << browse(null, "window=radio")
return
return
/*
/obj/item/device/radio/electropack/accept_rad(obj/item/device/radio/signaler/R as obj, message)
if ((istype(R, /obj/item/device/radio/signaler) && R.frequency == src.frequency && R.code == src.code))
return 1
else
return null
return
*/
/obj/item/device/radio/electropack/receive_signal(datum/signal/signal)
if (!signal || !signal.data || ("[signal.data["code"]]" != "[code]"))//(signal.encryption != code))
return
if (ismob(src.loc) && src.on)
var/mob/M = src.loc
if (src == M.back)
M.show_message("<span style=\"color:red\"><B>You feel a sharp shock!</B></span>")
logTheThing("signalers", usr, M, "signalled an electropack worn by %target% at [log_loc(M)].") // Added (Convair880).
if(ticker && ticker.mode && istype(ticker.mode, /datum/game_mode/revolution))
if(M.mind in ticker.mode:revolutionaries && !M.mind in ticker.mode:head_revolutionaries && prob(20))
ticker.mode:remove_revolutionary(M.mind)
if (M.weakened < 10)
M.weakened = 10
if ((src.master && src.wires & 1))
src.master.receive_signal()
return
/obj/item/device/radio/electropack/attack_self(mob/user as mob, flag1)
if (!( istype(user, /mob/living/carbon/human) ))
return
user.machine = src
var/dat = {"<TT>
<A href='?src=\ref[src];power=1'>Turn [src.on ? "Off" : "On"]</A><BR>
<B>Frequency/Code</B> for electropack:<BR>
Frequency:
<A href='byond://?src=\ref[src];freq=-10'>-</A>
<A href='byond://?src=\ref[src];freq=-2'>-</A> [format_frequency(src.frequency)]
<A href='byond://?src=\ref[src];freq=2'>+</A>
<A href='byond://?src=\ref[src];freq=10'>+</A><BR>
Code:
<A href='byond://?src=\ref[src];code=-5'>-</A>
<A href='byond://?src=\ref[src];code=-1'>-</A> [src.code]
<A href='byond://?src=\ref[src];code=1'>+</A>
<A href='byond://?src=\ref[src];code=5'>+</A><BR>
</TT>"}
user << browse(dat, "window=radio")
onclose(user, "radio")
return
// ****************************************************
/obj/item/device/radio/signaler
name = "Remote Signaling Device"
icon_state = "signaller"
item_state = "signaler"
var/code = 30.0
w_class = 1.0
frequency = 1457
var/delay = 0
var/airlock_wire = null
desc = "A device used to send a coded signal over a specified frequency, with the effect depending on the device that recieves the signal."
/*
/obj/item/device/radio/signaler/examine()
set src in view()
set category = "Local"
..()
if ((in_range(src, usr) || src.loc == usr))
if (src.b_stat)
usr.show_message("<span style=\"color:blue\">The signaler can be attached and modified!</span>")
else
usr.show_message("<span style=\"color:blue\">The signaler can not be modified or attached!</span>")
return
*/
/obj/item/device/radio/signaler/attack_self(mob/user as mob, flag1)
user.machine = src
var/t1
if ((src.b_stat && !( flag1 )))
t1 = text("-------<BR><br>Green Wire: []<BR><br>Red Wire: []<BR><br>Blue Wire: []<BR><br>", (src.wires & 4 ? text("<A href='?src=\ref[];wires=4'>Cut Wire</A>", src) : text("<A href='?src=\ref[];wires=4'>Mend Wire</A>", src)), (src.wires & 2 ? text("<A href='?src=\ref[];wires=2'>Cut Wire</A>", src) : text("<A href='?src=\ref[];wires=2'>Mend Wire</A>", src)), (src.wires & 1 ? text("<A href='?src=\ref[];wires=1'>Cut Wire</A>", src) : text("<A href='?src=\ref[];wires=1'>Mend Wire</A>", src)))
else
t1 = "-------"
var/dat = {"
<TT>
Speaker: [src.listening ? "<A href='byond://?src=\ref[src];listen=0'>Engaged</A>" : "<A href='byond://?src=\ref[src];listen=1'>Disengaged</A>"]<BR>
<A href='byond://?src=\ref[src];send=1'>Send Signal</A><BR>
<B>Frequency/Code</B> for signaler:<BR>
Frequency:
<A href='byond://?src=\ref[src];freq=-10'>-</A>
<A href='byond://?src=\ref[src];freq=-2'>-</A>
[format_frequency(src.frequency)]
<A href='byond://?src=\ref[src];freq=2'>+</A>
<A href='byond://?src=\ref[src];freq=10'>+</A><BR>
Code:
<A href='byond://?src=\ref[src];code=-5'>-</A>
<A href='byond://?src=\ref[src];code=-1'>-</A>
[src.code]
<A href='byond://?src=\ref[src];code=1'>+</A>
<A href='byond://?src=\ref[src];code=5'>+</A><BR>
[t1]
</TT>"}
user << browse(dat, "window=radio")
onclose(user, "radio")
return
obj/item/device/radio/signaler/attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/bikehorn))
var/obj/item/assembly/radio_horn/A = new /obj/item/assembly/radio_horn( user )
W.set_loc(A)
A.part2 = W
W.layer = initial(W.layer)
user.u_equip(W)
user.put_in_hand_or_drop(A)
W.master = A
src.master = A
src.layer = initial(src.layer)
user.u_equip(src)
src.set_loc(A)
A.part1 = src
src.add_fingerprint(user)
boutput(user, "You open the signaler and cram the [W.name] in there!")
else
..()
return
/obj/item/device/radio/signaler/hear_talk()
return
/obj/item/device/radio/signaler/send_hear()
return
/obj/item/device/radio/signaler/receive_signal(datum/signal/signal)
if(!signal || !signal.data || "[signal.data["code"]]" != "[code]")//(signal.encryption != code))
return
if (!( src.wires & 2 ))
return
if(istype(src.loc, /obj/machinery/door/airlock) && src.airlock_wire && src.wires & 1)
// boutput(world, "/obj/.../signaler/r_signal([signal]) has master = [src.master] and type [(src.master?src.master.type : "none")]")
// boutput(world, "[src.airlock_wire] - [src] - [usr] - [signal]")
var/obj/machinery/door/airlock/A = src.loc
A.pulse(src.airlock_wire)
// src.master:r_signal(signal)
if(src.master && (src.wires & 1))
var/turf/T = get_turf(src.master)
if (src.master && istype(src.master, /obj/item/device/transfer_valve))
logTheThing("bombing", usr, null, "signalled a radio on a transfer valve at [T ? "[log_loc(T)]" : "horrible no-loc nowhere void"].")
message_admins("[key_name(usr)] signalled a radio on a transfer valve at [T ? "[log_loc(T)]" : "horrible no-loc nowhere void"].")
else if (src.master && istype(src.master, /obj/item/assembly/rad_ignite)) //Radio-detonated beaker assemblies
var/obj/item/assembly/rad_ignite/RI = src.master
logTheThing("bombing", usr, null, "signalled a radio on a radio-igniter assembly at [T ? "[log_loc(T)]" : "horrible no-loc nowhere void"]. Contents: [log_reagents(RI.part3)]")
else if(src.master && istype(src.master, /obj/item/assembly/radio_bomb)) //Radio-detonated single-tank bombs
logTheThing("bombing", usr, null, "signalled a radio on a single-tank bomb at [T ? "[log_loc(T)]" : "horrible no-loc nowhere void"].")
message_admins("[key_name(usr)] signalled a radio on a single-tank bomb at [T ? "[log_loc(T)]" : "horrible no-loc nowhere void"].")
spawn(0)
src.master.receive_signal(signal)
for(var/mob/O in hearers(1, src.loc))
O.show_message("[bicon(src)] *beep* *beep*", 3, "*beep* *beep*", 2)
return
/obj/item/device/radio/signaler/proc/send_signal(message="ACTIVATE")
if(last_transmission && world.time < (last_transmission + TRANSMISSION_DELAY))
return
last_transmission = world.time
if (!( src.wires & 4 ))
return
logTheThing("signalers", !usr && src.master ? src.master.fingerprintslast : usr, null, "used remote signaller[src.master ? " (connected to [src.master.name])" : ""] at [src.master ? "[log_loc(src.master)]" : "[log_loc(src)]"]. Frequency: [format_frequency(frequency)]/[code].")
var/datum/signal/signal = get_free_signal()
signal.source = src
//signal.encryption = code
signal.data["code"] = code
signal.data["message"] = message
radio_connection.post_signal(src, signal)
return
/obj/item/device/radio/signaler/Topic(href, href_list)
//..()
if (usr.stat)
return
var/is_detonator_trigger = 0
if (src.master)
if (istype(src.master, /obj/item/assembly/detonator/) && src.master.master)
if (istype(src.master.master, /obj/machinery/portable_atmospherics/canister/) && in_range(src.master.master, usr))
is_detonator_trigger = 1
if (is_detonator_trigger || (src in usr) || (src.master && (src.master in usr)) || (in_range(src, usr) && istype(src.loc, /turf)))
usr.machine = src
if (href_list["freq"])
var/new_frequency = sanitize_frequency(frequency + text2num(href_list["freq"]))
set_frequency(new_frequency)
else if (href_list["code"])
src.code += text2num(href_list["code"])
src.code = round(src.code)
src.code = min(100, src.code)
src.code = max(1, src.code)
else if (href_list["send"])
spawn( 0 )
src.send_signal("ACTIVATE")
return
else if (href_list["listen"])
src.listening = text2num(href_list["listen"])
else if (href_list["wires"])
var/t1 = text2num(href_list["wires"])
if (!( istype(usr.equipped(), /obj/item/wirecutters) ))
return
if ((!( src.b_stat ) && !( src.master )))
return
if (t1 & 1)
if (src.wires & 1)
src.wires &= 65534
else
src.wires |= 1
else
if (t1 & 2)
if (src.wires & 2)
src.wires &= 65533
else
src.wires |= 2
else
if (t1 & 4)
if (src.wires & 4)
src.wires &= 65531
else
src.wires |= 4
src.add_fingerprint(usr)
if (!src.master)
if (istype(src.loc, /mob))
attack_self(src.loc)
else
for(var/mob/M in viewers(1, src))
if (M.client)
src.attack_self(M)
else
if (is_detonator_trigger)
src.attack_self(usr)
if (istype(src.master.loc, /mob))
src.attack_self(src.master.loc)
else
for(var/mob/M in viewers(1, src.master))
if (M.client)
src.attack_self(M)
else
usr << browse(null, "window=radio")
return
return
+185
View File
@@ -0,0 +1,185 @@
/obj/item/device/radio/headset
name = "\improper Radio Headset"
icon_state = "headset"
item_state = "headset"
rand_pos = 0
var/protective_temperature = 0
speaker_range = 0
var/allow_deaf_hearing = 0
desc = "A standard-issue device that can be worn on a crewmember's ear to allow hands-free communication with the rest of the crew."
flags = FPRINT | TABLEPASS | CONDUCT
/obj/item/device/radio/headset/command
name = "\improper Command Headset"
desc = "A radio headset capable of communicating over additional, secure frequencies"
icon_state = "command headset"
secure_frequencies = list("h" = R_FREQ_COMMAND)
secure_colors = list("h" = RADIOC_COMMAND)
/obj/item/device/radio/headset/command/captain
secure_frequencies = list("h" = R_FREQ_COMMAND,\
"g" = R_FREQ_SECURITY,\
"e" = R_FREQ_ENGINEERING,\
"r" = R_FREQ_RESEARCH,\
"m" = R_FREQ_MEDICAL,\
"c" = R_FREQ_CIVILIAN)
secure_colors = list("h" = RADIOC_COMMAND,\
"g" = RADIOC_SECURITY,\
"e" = RADIOC_ENGINEERING,\
"r" = RADIOC_RESEARCH,\
"m" = RADIOC_MEDICAL,\
"c" = RADIOC_CIVILIAN)
/obj/item/device/radio/headset/command/hos
secure_frequencies = list("h" = R_FREQ_COMMAND,\
"g" = R_FREQ_SECURITY)
secure_colors = list("h" = RADIOC_COMMAND,\
"g" = RADIOC_SECURITY)
/obj/item/device/radio/headset/command/hop
secure_frequencies = list("h" = R_FREQ_COMMAND,\
/*"g" = R_FREQ_SECURITY,\*/
"c" = R_FREQ_CIVILIAN)
secure_colors = list("h" = RADIOC_COMMAND,\
/*"g" = RADIOC_SECURITY,\*/
"c" = RADIOC_CIVILIAN)
/obj/item/device/radio/headset/command/rd
secure_frequencies = list("h" = R_FREQ_COMMAND,\
"r" = R_FREQ_RESEARCH,\
"m" = R_FREQ_MEDICAL)
secure_colors = list("h" = RADIOC_COMMAND,\
"r" = RADIOC_RESEARCH,\
"m" = RADIOC_MEDICAL)
/obj/item/device/radio/headset/command/md
secure_frequencies = list("h" = R_FREQ_COMMAND,\
"r" = R_FREQ_RESEARCH,\
"m" = R_FREQ_MEDICAL)
secure_colors = list("h" = RADIOC_COMMAND,\
"r" = RADIOC_RESEARCH,\
"m" = RADIOC_MEDICAL)
/obj/item/device/radio/headset/command/ce
secure_frequencies = list("h" = R_FREQ_COMMAND,\
"e" = R_FREQ_ENGINEERING)
secure_colors = list("h" = RADIOC_COMMAND,\
"e" = RADIOC_ENGINEERING)
/obj/item/device/radio/headset/security
name = "\improper Security Headset"
desc = "A radio headset capable of communicating over a second, secure frequency."
icon_state = "sec headset"
secure_frequencies = list("h" = R_FREQ_SECURITY)
secure_colors = list("h" = RADIOC_SECURITY)
/obj/item/device/radio/headset/engineer
name = "\improper Engineering Headset"
desc = "A radio headset capable of communicating over a second, secure frequency."
icon_state = "engine headset"
secure_frequencies = list("h" = R_FREQ_ENGINEERING)
secure_colors = list("h" = RADIOC_ENGINEERING)
/obj/item/device/radio/headset/medical
name = "\improper Medical Headset"
desc = "A radio headset capable of communicating over a second, secure frequency."
icon_state = "med headset"
secure_frequencies = list("h" = R_FREQ_MEDICAL)
secure_colors = list("h" = RADIOC_MEDICAL)
/obj/item/device/radio/headset/research
name = "\improper Research Headset"
desc = "A radio headset capable of communicating over a second, secure frequency."
icon_state = "research headset"
secure_frequencies = list("h" = R_FREQ_RESEARCH)
secure_colors = list("h" = RADIOC_RESEARCH)
/obj/item/device/radio/headset/civilian
name = "\improper Civilian Headset"
desc = "A radio headset capable of communicating over a second, secure frequency."
icon_state = "civ headset"
secure_frequencies = list("h" = R_FREQ_CIVILIAN)
secure_colors = list("h" = RADIOC_CIVILIAN)
/obj/item/device/radio/headset/shipping
name = "\improper Shipping Headset"
desc = "A radio headset capable of communicating over additional, secure frequencies."
icon_state = "shipping headset"
secure_frequencies = list("h" = R_FREQ_ENGINEERING,\
"c" = R_FREQ_CIVILIAN)
secure_colors = list("h" = RADIOC_ENGINEERING,\
"c" = RADIOC_CIVILIAN)
// secure_colors = list("#ff6600")
/obj/item/device/radio/headset/syndicate
name = "\improper Radio Headset"
desc = "A radio headset capable of communicating over a second, secure frequency."
icon_state = "headset"
secure_frequencies = list("h" = R_FREQ_SYNDICATE)
secure_colors = list(RADIOC_SYNDICATE)
protected_radio = 1
/obj/item/device/radio/headset/deaf
name = "\improper Auditory Headset"
desc = "A radio headset that interfaces with the ear canal, allowing the deaf to hear."
icon_state = "deaf headset"
item_state = "headset"
allow_deaf_hearing = 1
/obj/item/device/radio/headset/gang
name = "\improper Gang Headset"
desc = "A radio headset to communicate privately with your fellow gang members."
secure_frequencies = list("g" = R_FREQ_GANG) //placeholder so it sets up right
secure_colors = list(RADIOC_OTHER)
protected_radio = 1
/obj/item/device/radio/headset/multifreq
name = "\improper Multi-frequency Headset"
desc = "A radio headset capable of communicating over a second, customisable frequency."
icon_state = "multi headset"
secure_frequencies = list("h" = R_FREQ_MULTI)
secure_colors = list(RADIOC_OTHER)
/obj/item/device/radio/headset/multifreq/attack_self(mob/user as mob)
user.machine = src
var/t1
if (src.b_stat)
t1 = {"
-------<BR>
Green Wire: <A href='byond://?src=\ref[src];wires=4'>[src.wires & 4 ? "Cut" : "Mend"] Wire</A><BR>
Red Wire: <A href='byond://?src=\ref[src];wires=2'>[src.wires & 2 ? "Cut" : "Mend"] Wire</A><BR>
Blue Wire: <A href='byond://?src=\ref[src];wires=1'>[src.wires & 1 ? "Cut" : "Mend"] Wire</A><BR>"}
else
t1 = "-------"
var/dat = {"
<TT>
Microphone: [src.broadcasting ? "<A href='byond://?src=\ref[src];talk=0'>Engaged</A>" : "<A href='byond://?src=\ref[src];talk=1'>Disengaged</A>"]<BR>
Speaker: [src.listening ? "<A href='byond://?src=\ref[src];listen=0'>Engaged</A>" : "<A href='byond://?src=\ref[src];listen=1'>Disengaged</A>"]<BR>
Frequency:
<A href='byond://?src=\ref[src];freq=-10'>-</A>
<A href='byond://?src=\ref[src];freq=-2'>-</A>
[format_frequency(src.frequency)]
<A href='byond://?src=\ref[src];freq=2'>+</A>
<A href='byond://?src=\ref[src];freq=10'>+</A><BR>
Secure Frequency:
<A href='byond://?src=\ref[src];sfreq=-10'>-</A>
<A href='byond://?src=\ref[src];sfreq=-2'>-</A>
[format_frequency(src.secure_frequencies["h"])]
<A href='byond://?src=\ref[src];sfreq=2'>+</A>
<A href='byond://?src=\ref[src];sfreq=10'>+</A><BR>
[t1]
</TT>"}
user << browse(dat, "window=radio")
onclose(user, "radio")
return
/obj/item/device/radio/headset/multifreq/Topic(href, href_list)
if (usr.stat)
return
if ((usr.contents.Find(src) || in_range(src, usr) && istype(src.loc, /turf)) || (usr.loc == src.loc) || (istype(usr, /mob/living/silicon)))
usr.machine = src
if (href_list["sfreq"])
var/new_frequency = sanitize_frequency(text2num("[secure_frequencies["h"]]") + text2num(href_list["sfreq"]))
set_secure_frequency("h", new_frequency)
return ..(href, href_list)
+132
View File
@@ -0,0 +1,132 @@
/obj/item/device/radio/intercom
name = "Station Intercom (Radio)"
icon_state = "intercom"
anchored = 1.0
mats = 0
device_color = RADIOC_INTERCOM
var/number = 0
rand_pos = 0
desc = "A wall-mounted radio intercom, used to communicate with the specified frequency. Usually turned off except during emergencies."
/obj/item/device/radio/intercom/attack_ai(mob/user as mob)
src.add_fingerprint(user)
spawn (0)
attack_self(user)
/obj/item/device/radio/intercom/attack_hand(mob/user as mob)
src.add_fingerprint(user)
spawn (0)
attack_self(user)
/obj/item/device/radio/intercom/send_hear()
if (src.listening)
return hearers(7, src.loc)
/obj/item/device/radio/intercom/putt
name = "Colosseum Intercommunicator"
frequency = R_FREQ_INTERCOM_COLOSSEUM
broadcasting = 1
device_color = "#aa5c00"
protected_radio = 1
initialize()
set_frequency(frequency)
// -------------------- VR --------------------
/obj/item/device/radio/intercom/virtual
desc = "Virtual radio for all your beeps and bops."
icon = 'icons/effects/VR.dmi'
protected_radio = 1
// --------------------------------------------
// ** preset intercoms to make mapping suck less augh **
/obj/item/device/radio/intercom/medical
name = "Medical Intercom"
frequency = R_FREQ_INTERCOM_MEDICAL
broadcasting = 0
device_color = "#0050FF"
pixel_y = 24
initialize()
set_frequency(frequency)
/obj/item/device/radio/intercom/security
name = "Security Intercom"
frequency = R_FREQ_INTERCOM_SECURITY
broadcasting = 0
device_color = "#FF2000"
pixel_y = 24
initialize()
set_frequency(frequency)
/obj/item/device/radio/intercom/brig
name = "Brig Intercom"
frequency = R_FREQ_INTERCOM_BRIG
broadcasting = 0
device_color = "#FF5000"
pixel_y = 24
initialize()
set_frequency(frequency)
/obj/item/device/radio/intercom/science
name = "Research Intercom"
frequency = R_FREQ_INTERCOM_RESEARCH
broadcasting = 0
device_color = "#FF2000"
pixel_y = 24
initialize()
set_frequency(frequency)
/obj/item/device/radio/intercom/engineering
name = "Engineering Intercom"
frequency = R_FREQ_INTERCOM_ENGINEERING
broadcasting = 0
device_color = "#BBBB00"
pixel_y = 24
initialize()
set_frequency(frequency)
/obj/item/device/radio/intercom/cargo
name = "Cargo Intercom"
frequency = R_FREQ_INTERCOM_CARGO
broadcasting = 0
device_color = "#9A8B0D"
pixel_y = 24
initialize()
set_frequency(frequency)
/obj/item/device/radio/intercom/catering
name = "Catering Intercom"
frequency = R_FREQ_INTERCOM_CATERING
broadcasting = 0
device_color = "#FF2000"
pixel_y = 24
initialize()
set_frequency(frequency)
/obj/item/device/radio/intercom/AI
name = "AI Intercom"
frequency = R_FREQ_INTERCOM_AI
broadcasting = 1
device_color = "#333399"
pixel_y = 24
initialize()
set_frequency(frequency)
/obj/item/device/radio/intercom/bridge
name = "Bridge Intercom"
frequency = R_FREQ_INTERCOM_BRIDGE
broadcasting = 1
device_color = "#339933"
pixel_y = 24
initialize()
set_frequency(frequency)
+405
View File
@@ -0,0 +1,405 @@
/*
Contains:
-T-ray scanner
-Forensic scanner
-Health analyzer
-Reagent scanner
-Atmospheric analyzer
-Prisoner scanner
*/
//////////////////////////////////////////////// T-ray scanner //////////////////////////////////
/obj/item/device/t_scanner
name = "T-ray scanner"
desc = "A terahertz-ray emitter and scanner used to detect underfloor objects such as cables and pipes."
icon_state = "t-ray0"
var/on = 0
flags = FPRINT|ONBELT|TABLEPASS
w_class = 2
item_state = "electronic"
m_amt = 150
mats = 5
module_research = list("analysis" = 2, "engineering" = 2, "devices" = 1)
module_research_type = /obj/item/device/t_scanner
/obj/item/device/t_scanner/attack_self(mob/user)
on = !on
icon_state = "t-ray[on]"
if(on && !(src in processing_items))
processing_items.Add(src)
/obj/item/device/t_scanner/process()
if(!on)
processing_items.Remove(src)
return null
for(var/turf/T in range(1, src.loc) )
if(!T.intact)
continue
for(var/obj/O in T.contents)
if(O.level != 1)
continue
if(O.invisibility == 101)
O.invisibility = 0
spawn(10)
if(O && isturf(O.loc))
var/turf/U = O.loc
if(U.intact)
O.invisibility = 101
var/mob/living/M = locate() in T
if(M && M.invisibility == 2)
M.invisibility = 0
spawn(6)
if(M)
M.invisibility = 2
//////////////////////////////////////// Forensic scanner ///////////////////////////////////
/obj/item/device/detective_scanner
name = "forensic scanner"
desc = "Used to scan objects for DNA and fingerprints."
icon_state = "forensicscanner"
w_class = 2 // PDA fits in a pocket, so why not the dedicated scanner (Convair880)?
item_state = "electronic"
flags = FPRINT | TABLEPASS | ONBELT | CONDUCT | SUPPRESSATTACK
mats = 3
attack_self(mob/user as mob)
src.add_fingerprint(user)
var/search = input(user, "Enter name, fingerprint or blood DNA.", "Find record", "") as null|text
if (!search || user.stat)
return
search = copytext(sanitize(search), 1, 200)
search = lowertext(search)
for (var/datum/data/record/R in data_core.general)
if (search == lowertext(R.fields["dna"]) || search == lowertext(R.fields["fingerprint"]) || search == lowertext(R.fields["name"]))
var/data = "--------------------------------<br>\
<font color='blue'>Match found in security records:<b> [R.fields["name"]]</b> ([R.fields["rank"]])</font><br>\
<br>\
<i>Fingerprint:</i><font color='blue'> [R.fields["fingerprint"]]</font><br>\
<i>Blood DNA:</i><font color='blue'> [R.fields["dna"]]</font>"
boutput(user, data)
return
user.show_text("No match found in security records.", "red")
return
afterattack(atom/A as mob|obj|turf|area, mob/user as mob)
if (get_dist(A,user) > 1) // Scanning for fingerprints over the camera network is fun, but doesn't really make sense (Convair880).
return
user.visible_message("<span style=\"color:red\"><b>[user]</b> has scanned [A].</span>")
boutput(user, scan_forensic(A)) // Moved to scanprocs.dm to cut down on code duplication (Convair880).
src.add_fingerprint(user)
return
///////////////////////////////////// Health analyzer ////////////////////////////////////////
/obj/item/device/healthanalyzer
name = "health analyzer"
icon_state = "health-no_up"
inhand_image_icon = 'icons/mob/inhand/hand_medical.dmi'
item_state = "healthanalyzer-no_up" // someone made this sprite and then this was never changed to it for some reason???
desc = "A hand-held body scanner able to distinguish vital signs of the subject."
flags = FPRINT | ONBELT | TABLEPASS | CONDUCT
throwforce = 3
w_class = 1.0
throw_speed = 5
throw_range = 10
m_amt = 200
mats = 5
var/disease_detection = 1
var/reagent_upgrade = 0
var/reagent_scan = 0
module_research = list("analysis" = 2, "medicine" = 2, "devices" = 1)
module_research_type = /obj/item/device/healthanalyzer
attack_self(mob/user as mob)
if (!src.reagent_upgrade)
boutput(user, "<span style=\"color:red\">No reagent scan upgrade detected!</span>")
return
else
src.reagent_scan = !(src.reagent_scan)
boutput(user, "<span style=\"color:blue\">Reagent scanner [src.reagent_scan ? "enabled" : "disabled"].</span>")
return
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/device/healthanalyzer_upgrade))
if (src.reagent_upgrade)
boutput(user, "<span style=\"color:red\">This analyzer already has a reagent scan upgrade!</span>")
return
else
src.reagent_upgrade = 1
src.reagent_scan = 1
src.icon_state = "health"
src.item_state = "healthanalyzer"
boutput(user, "<span style=\"color:blue\">Reagent scan upgrade installed.</span>")
playsound(src.loc ,"sound/items/Deconstruct.ogg", 80, 0)
user.u_equip(W)
qdel(W)
return
else
return ..()
attack(mob/M as mob, mob/user as mob)
if ((user.bioHolder.HasEffect("clumsy") || user.get_brain_damage() >= 60) && prob(50))
user.visible_message("<span style=\"color:red\"><b>[user]</b> slips and drops [src]'s sensors on the floor!</span>")
user.show_message("Analyzing Results for <span style=\"color:blue\">The floor:<br>&emsp; Overall Status: Healthy</span>", 1)
user.show_message("&emsp; Damage Specifics: <font color='#1F75D1'>[0]</font> - <font color='#138015'>[0]</font> - <font color='#CC7A1D'>[0]</font> - <font color='red'>[0]</font>", 1)
user.show_message("&emsp; Key: <font color='#1F75D1'>Suffocation</font>/<font color='#138015'>Toxin</font>/<font color='#CC7A1D'>Burns</font>/<font color='red'>Brute</font>", 1)
user.show_message("<span style=\"color:blue\">Body Temperature: ???</span>", 1)
return
user.visible_message("<span style=\"color:red\"><b>[user]</b> has analyzed [M]'s vitals.</span>",\
"<span style=\"color:red\">You have analyzed [M]'s vitals.</span>")
boutput(user, scan_health(M, src.reagent_scan, src.disease_detection))
update_medical_record(M)
if (M.stat > 1)
user.unlock_medal("He's dead, Jim", 1)
return
/obj/item/device/healthanalyzer/borg
icon_state = "health"
reagent_upgrade = 1
reagent_scan = 1
/obj/item/device/healthanalyzer/vr
icon = 'icons/effects/VR.dmi'
/obj/item/device/healthanalyzer_upgrade
name = "health analyzer upgrade"
desc = "A small upgrade card that allows standard health analyzers to detect reagents present in the patient, and ProDoc Healthgoggles to scan patients' health from a distance."
icon_state = "health_upgr"
flags = FPRINT | TABLEPASS | CONDUCT
throwforce = 0
w_class = 1.0
throw_speed = 5
throw_range = 10
mats = 2
///////////////////////////////////// Reagent scanner //////////////////////////////
/obj/item/device/reagentscanner
name = "reagent scanner"
icon_state = "reagentscan"
inhand_image_icon = 'icons/mob/inhand/hand_medical.dmi'
item_state = "reagentscan"
desc = "A hand-held device that scans and lists the chemicals inside the scanned subject."
flags = FPRINT | ONBELT | TABLEPASS | CONDUCT
throwforce = 3
w_class = 1.0
throw_speed = 5
throw_range = 10
m_amt = 200
mats = 5
var/scan_results = null
module_research = list("analysis" = 2, "science" = 2, "devices" = 1)
module_research_type = /obj/item/device/reagentscanner
attack(mob/M as mob, mob/user as mob)
return
afterattack(atom/A as mob|obj|turf|area, mob/user as mob)
user.visible_message("<span style=\"color:blue\"><b>[user]</b> scans [A] with [src]!</span>",\
"<span style=\"color:blue\">You scan [A] with [src]!</span>")
src.scan_results = scan_reagents(A)
if (!isnull(A.reagents))
if (A.reagents.reagent_list.len > 0)
src.icon_state = "reagentscan-results"
else
src.icon_state = "reagentscan-no"
else
src.icon_state = "reagentscan-no"
if (isnull(src.scan_results))
boutput(user, "<span style=\"color:red\">\The [src] encounters an error and crashes!</span>")
else
boutput(user, "[src.scan_results]")
attack_self(mob/user as mob)
if (isnull(src.scan_results))
boutput(user, "<span style=\"color:blue\">No previous scan results located.</span>")
return
boutput(user, "<span style=\"color:blue\">Previous scan's results:<br>[src.scan_results]</span>")
get_desc(dist)
if (dist < 3)
if (!isnull(src.scan_results))
. += "<br><span style=\"color:blue\">Previous scan's results:<br>[src.scan_results]</span>"
/////////////////////////////////////// Atmos analyzer /////////////////////////////////////
/obj/item/device/analyzer
desc = "A hand-held environmental scanner which reports current gas levels."
name = "atmospheric analyzer"
icon_state = "atmos"
item_state = "analyzer"
w_class = 2
flags = FPRINT | TABLEPASS | CONDUCT | ONBELT
throwforce = 5
w_class = 2
throw_speed = 4
throw_range = 20
mats = 3
module_research = list("analysis" = 2, "atmospherics" = 2, "devices" = 1)
module_research_type = /obj/item/device/analyzer
attack_self(mob/user as mob)
if (user.stat)
return
src.add_fingerprint(user)
var/turf/location = get_turf(user)
if (isnull(location))
user.show_text("Unable to obtain a reading.", "red")
return
user.visible_message("<span style=\"color:blue\"><b>[user]</b> takes an atmospheric reading of [location].</span>")
boutput(user, scan_atmospheric(location)) // Moved to scanprocs.dm to cut down on code duplication (Convair880).
return
afterattack(atom/A as mob|obj|turf|area, mob/user as mob)
if (get_dist(A, user) > 1)
return
if (istype(A, /obj) || isturf(A))
user.visible_message("<span style=\"color:blue\"><b>[user]</b> takes an atmospheric reading of [A].</span>")
boutput(user, scan_atmospheric(A))
src.add_fingerprint(user)
return
is_detonator_attachment()
return 1
detonator_act(event, var/obj/item/assembly/detonator/det)
switch (event)
if ("pulse")
det.attachedTo.visible_message("<span class='bold' style='color: #B7410E;'>\The [src]'s external display turns off for a moment before booting up again.</span>")
if ("cut")
det.attachedTo.visible_message("<span class='bold' style='color: #B7410E;'>\The [src]'s external display turns off.</span>")
det.attachments.Remove(src)
if ("leak")
det.attachedTo.visible_message("<style class='combat bold'>\The [src] picks up the rapid atmospheric change of the canister, and signals the detonator.</style>")
spawn(0)
det.detonate()
return
///////////////////////////////////////////////// Prisoner scanner ////////////////////////////////////
/obj/item/device/prisoner_scanner
name = "Securotron-5000"
desc = "Used to scan in prisoners and update their security records."
icon_state = "forensic0"
var/mode = 1
var/datum/data/record/active1 = null
var/datum/data/record/active2 = null
w_class = 3.0
item_state = "electronic"
flags = FPRINT | TABLEPASS | ONBELT | CONDUCT | EXTRADELAY
mats = 3
/obj/item/device/prisoner_scanner/attack(mob/living/carbon/human/M as mob, mob/user as mob)
////General Records
var/found = 0
//if( !istype(get_area(src), /area/security/prison) && !istype(get_area(src), /area/security/main))
// boutput(user, "<span style=\"color:red\">Device only works in designated security areas!</span>")
// return
boutput(user, "<span style=\"color:blue\">You scan in [M]</span>")
boutput(M, "<span style=\"color:red\">[user] scans you with the Securotron-5000</span>")
for(var/datum/data/record/R in data_core.general)
if (lowertext(R.fields["name"]) == lowertext(M.name))
//Update Information
R.fields["name"] = M.name
R.fields["sex"] = M.gender
R.fields["age"] = M.bioHolder.age
if (M.gloves)
R.fields["fingerprint"] = "Unknown"
else
R.fields["fingerprint"] = md5(M.bioHolder.Uid)
R.fields["p_stat"] = "Active"
R.fields["m_stat"] = "Stable"
src.active1 = R
found = 1
if(found == 0)
src.active1 = new /datum/data/record()
src.active1.fields["id"] = text("[]", add_zero(num2hex(rand(1, 1.6777215E7)), 6))
src.active1.fields["rank"] = "Unassigned"
//Update Information
src.active1.fields["name"] = M.name
src.active1.fields["sex"] = M.gender
src.active1.fields["age"] = M.bioHolder.age
/////Fingerprint record update
if (M.gloves)
src.active1.fields["fingerprint"] = "Unknown"
else
src.active1.fields["fingerprint"] = md5(M.bioHolder.Uid)
src.active1.fields["p_stat"] = "Active"
src.active1.fields["m_stat"] = "Stable"
data_core.general += src.active1
found = 0
////Security Records
for(var/datum/data/record/E in data_core.security)
if (E.fields["name"] == src.active1.fields["name"])
if(src.mode == 1)
E.fields["criminal"] = "Incarcerated"
else if(src.mode == 2)
E.fields["criminal"] = "Parolled"
else
E.fields["criminal"] = "Released"
return
src.active2 = new /datum/data/record()
src.active2.fields["name"] = src.active1.fields["name"]
src.active2.fields["id"] = src.active1.fields["id"]
src.active2.name = text("Security Record #[]", src.active1.fields["id"])
if(src.mode == 1)
src.active2.fields["criminal"] = "Incarcerated"
else if(src.mode == 2)
src.active2.fields["criminal"] = "Parolled"
else
src.active2.fields["criminal"] = "Released"
src.active2.fields["mi_crim"] = "None"
src.active2.fields["mi_crim_d"] = "No minor crime convictions."
src.active2.fields["ma_crim"] = "None"
src.active2.fields["ma_crim_d"] = "No major crime convictions."
src.active2.fields["notes"] = "No notes."
data_core.security += src.active2
return
/obj/item/device/prisoner_scanner/attack_self(mob/user as mob)
if (src.mode == 1)
src.mode = 2
boutput(user, "<span style=\"color:blue\">you switch the record mode to Parolled</span>")
else if (src.mode == 2)
src.mode = 3
boutput(user, "<span style=\"color:blue\">you switch the record mode to Released</span>")
else
src.mode = 1
boutput(user, "<span style=\"color:blue\">you switch the record mode to Incarcerated</span>")
add_fingerprint(user)
return
+25
View File
@@ -0,0 +1,25 @@
/obj/item/device/shield
name = "shield"
icon_state = "shield0"
var/active = 0.0
flags = FPRINT | TABLEPASS| CONDUCT
item_state = "electronic"
throwforce = 5.0
throw_speed = 1
throw_range = 5
w_class = 2.0
mats = 10
module_research = list("energy" = 10, "efficiency" = 10, "protection" = 10)
/obj/item/device/shield/attack_self(mob/user as mob)
src.active = !( src.active )
if (src.active)
boutput(user, "<span style=\"color:blue\">The shield is now active.</span>")
src.icon_state = "shield1"
user.update_inhands()
else
boutput(user, "<span style=\"color:blue\">The shield is now inactive.</span>")
src.icon_state = "shield0"
user.update_inhands()
src.add_fingerprint(user)
return
+197
View File
@@ -0,0 +1,197 @@
/obj/item/device/timer
name = "timer"
icon_state = "timer0"
item_state = "electronic"
var/timing = 0.0
var/time = null
var/last_tick = 0
flags = FPRINT | TABLEPASS| CONDUCT
w_class = 2.0
m_amt = 100
mats = 2
desc = "A device that emits a signal when the time reaches 0."
module_research = list("devices" = 1, "miniaturization" = 4)
/obj/item/device/timer/proc/time()
src.c_state(0)
if (src.master)
spawn( 0 )
var/datum/signal/signal = get_free_signal()
signal.source = src
signal.data["message"] = "ACTIVATE"
src.master.receive_signal(signal)
//qdel(signal)
return
else
for(var/mob/O in hearers(null, null))
O.show_message("[bicon(src)] *beep* *beep*", 3, "*beep* *beep*", 2)
return
//*****RM
/obj/item/device/timer/proc/c_state(n)
//src.icon_state = text("timer[]", n)
if(src.master)
src.master:c_state(n)
return
//*****
/obj/item/device/timer/process()
if (src.timing)
if (!last_tick) last_tick = world.time
var/passed_time = round(max(round(world.time - last_tick),10) / 10)
if (src.time > 0)
src.time -= passed_time
if(time<5)
src.c_state(2)
else
// they might increase the time while it is timing
src.c_state(1)
else
time()
src.time = 0
src.timing = 0
last_tick = 0
last_tick = world.time
if (!src.master)
if (istype(src.loc, /mob))
attack_self(src.loc)
else
for(var/mob/M in viewers(1, src))
if (M.client && (M.machine == src.master || M.machine == src))
src.attack_self(M)
else
if (istype(src.master.loc, /mob))
src.attack_self(src.master.loc)
else
for(var/mob/M in viewers(1, src.master))
if (M.client && (M.machine == src.master || M.machine == src))
src.attack_self(M)
else
// If it's not timing, reset the icon so it doesn't look like it's still about to go off.
src.c_state(0)
processing_items.Remove(src)
last_tick = 0
return
/obj/item/device/timer/attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/device/radio/signaler) )
var/obj/item/device/radio/signaler/S = W
if(!S.b_stat)
return
var/obj/item/assembly/rad_time/R = new /obj/item/assembly/rad_time( user )
S.set_loc(R)
R.part1 = S
S.layer = initial(S.layer)
user.u_equip(S)
user.put_in_hand_or_drop(R)
S.master = R
src.master = R
src.layer = initial(src.layer)
user.u_equip(src)
src.set_loc(R)
R.part2 = src
R.dir = src.dir
src.add_fingerprint(user)
return
/obj/item/device/timer/attack_self(mob/user as mob)
..()
if (user.stat || user.restrained() || user.lying)
return
if ((src in user) || (src.master && (src.master in user)) || (get_dist(src, user) <= 1 && istype(src.loc, /turf)) || src.is_detonator_trigger())
user.machine = src
var/second = src.time % 60
var/minute = (src.time - second) / 60
var/detonator_trigger = src.is_detonator_trigger()
var/timing_links = (src.timing ? text("<A href='?src=\ref[];time=0'>Timing</A>", src) : text("<A href='?src=\ref[];time=1'>Not Timing</A>", src))
var/timing_text = (src.timing ? "Timing - controls locked" : "Not timing - controls unlocked")
var/dat = text("<TT><B>Timing Unit</B><br>[] []:[]<br><A href='?src=\ref[];tp=-30'>-</A> <A href='?src=\ref[];tp=-1'>-</A> <A href='?src=\ref[];tp=1'>+</A> <A href='?src=\ref[];tp=30'>+</A><br></TT>", detonator_trigger ? timing_text : timing_links, minute, second, src, src, src, src)
dat += "<BR><BR><A href='?src=\ref[src];close=1'>Close</A>"
user << browse(dat, "window=timer")
onclose(user, "timer")
else
user << browse(null, "window=timer")
user.machine = null
return
/obj/item/device/timer/proc/is_detonator_trigger()
if (src.master)
if (istype(src.master, /obj/item/assembly/detonator/) && src.master.master)
if (istype(src.master.master, /obj/machinery/portable_atmospherics/canister/) && in_range(src.master.master, usr))
return 1
return 0
/obj/item/device/timer/Topic(href, href_list)
..()
if (usr.stat || usr.restrained() || usr.lying)
return
var/can_use_detonator = src.is_detonator_trigger() && !src.timing
if (can_use_detonator || (src in usr) || (src.master && src.master in usr) || in_range(src, usr) && istype(src.loc, /turf))
usr.machine = src
if (href_list["time"])
src.timing = text2num(href_list["time"])
if(timing)
src.c_state(1)
if (!(src in processing_items))
processing_items.Add(src)
if (src.master && istype(master, /obj/item/device/transfer_valve))
logTheThing("bombing", usr, null, "[timing ? "initiated" : "defused"] a timer on a transfer valve at [log_loc(src.master)].")
message_admins("[key_name(usr)] [timing ? "initiated" : "defused"] a timer on a transfer valve at [log_loc(src.master)].")
else if (src.master && istype(src.master, /obj/item/assembly/time_ignite)) //Timer-detonated beaker assemblies
var/obj/item/assembly/rad_ignite/RI = src.master
logTheThing("bombing", usr, null, "[timing ? "initiated" : "defused"] a timer on a timer-igniter assembly at [log_loc(src.master)]. Contents: [log_reagents(RI.part3)]")
else if(src.master && istype(src.master, /obj/item/assembly/time_bomb)) //Timer-detonated single-tank bombs
logTheThing("bombing", usr, null, "[timing ? "initiated" : "defused"] a timer on a single-tank bomb at [log_loc(src.master)].")
message_admins("[key_name(usr)] [timing ? "initiated" : "defused"] a timer on a single-tank bomb at [log_loc(src.master)].")
else if (src.master && istype(src.master, /obj/item/mine)) // Land mine.
logTheThing("bombing", usr, null, "[timing ? "initiated" : "defused"] a timer on a [src.master.name] at [log_loc(src.master)].")
if (href_list["tp"])
var/tp = text2num(href_list["tp"])
src.time += tp
src.time = min(max(round(src.time), 0), 600)
if (can_use_detonator && src.time < 90)
src.time = 90
if (href_list["close"])
usr << browse(null, "window=timer")
usr.machine = null
return
if (!src.master)
if (istype(src.loc, /mob))
attack_self(src.loc)
else
for(var/mob/M in viewers(1, src))
if (M.client && (M.machine == src.master || M.machine == src))
src.attack_self(M)
else
if (can_use_detonator)
src.attack_self(usr)
if (istype(src.master.loc, /mob))
src.attack_self(src.master.loc)
else
for(var/mob/M in viewers(1, src.master))
if (M.client && (M.machine == src.master || M.machine == src))
src.attack_self(M)
src.add_fingerprint(usr)
else
usr << browse(null, "window=timer")
return
return
+353
View File
@@ -0,0 +1,353 @@
/obj/item/device/transfer_valve
icon = 'icons/obj/assemblies.dmi'
name = "tank transfer valve" // because that's what it is exadv1 and don't you dare change it
icon_state = "valve_1"
desc = "Regulates the transfer of air between two tanks"
var/obj/item/tank/tank_one
var/obj/item/tank/tank_two
var/obj/item/device/attached_device
var/mob/attacher = "Unknown"
var/valve_open = 0
var/toggle = 1
var/force_dud = 0
w_class = 6 /// HEH
mats = 5
attackby(obj/item/item, mob/user)
if(istype(item, /obj/item/tank) || istype(item, /obj/item/clothing/head/butt))
if(tank_one && tank_two)
boutput(user, "<span style=\"color:red\">There are already two tanks attached, remove one first!</span>")
return
if(!tank_one)
tank_one = item
user.drop_item()
item.set_loc(src)
boutput(user, "<span style=\"color:blue\">You attach \the [item] to the transfer valve</span>")
else if(!tank_two)
tank_two = item
user.drop_item()
item.set_loc(src)
boutput(user, "<span style=\"color:blue\">You attach the \the [item] to the transfer valve!</span>")
if(tank_one && tank_two)
var/turf/T = get_turf(src)
var/butt = istype(tank_one, /obj/item/clothing/head/butt) || istype(tank_two, /obj/item/clothing/head/butt)
logTheThing("bombing", user, null, "made a transfer valve [butt ? "butt" : "bomb"] at [showCoords(T.x, T.y, T.z)].")
message_admins("[key_name(user)] made a transfer valve [butt ? "butt" : "bomb"] at [showCoords(T.x, T.y, T.z)].")
update_icon()
attacher = user
else if(istype(item, /obj/item/device/radio/signaler) || istype(item, /obj/item/device/timer) || istype(item, /obj/item/device/infra) || istype(item, /obj/item/device/prox_sensor))
if(attached_device)
boutput(user, "<span style=\"color:red\">There is already an device attached to the valve, remove it first!</span>")
return
attached_device = item
user.drop_item()
item.set_loc(src)
boutput(user, "<span style=\"color:blue\">You attach the [item] to the valve controls!</span>")
item.master = src
/*
var/extra = ""
if (istype(item, /obj/item/device/timer))
if (item:timing)
extra = "n <font color='red'>active</font>"
logTheThing("bombing", user, null, "made a bomb using a[extra] [item.name] and a transfer valve.")
message_admins("[key_name(user)] made a bomb using a[extra] [item.name] and a transfer valve.")
*/
attacher = user
update_icon()
return
attack_self(mob/user as mob)
user.machine = src
var/dat = {"<B> Valve properties: </B>
<BR> <B> Attachment one:</B> [tank_one] [tank_one ? "<A href='?src=\ref[src];tankone=1'>Remove</A>" : ""]
<BR> <B> Attachment two:</B> [tank_two] [tank_two ? "<A href='?src=\ref[src];tanktwo=1'>Remove</A>" : ""]
<BR> <B> Valve attachment:</B> [attached_device ? "<A href='?src=\ref[src];device=1'>[attached_device]</A>" : "None"] [attached_device ? "<A href='?src=\ref[src];rem_device=1'>Remove</A>" : ""]
<BR> <B> Valve status: </B> [ valve_open ? "<A href='?src=\ref[src];open=1'>Closed</A> <B>Open</B>" : "<B>Closed</B> <A href='?src=\ref[src];open=1'>Open</A>"]"}
user << browse(dat, "window=trans_valve;size=600x300")
onclose(user, "trans_valve")
return
Topic(href, href_list)
..()
if (usr.stat|| usr.restrained())
return
if (src.loc == usr)
if(href_list["tankone"])
tank_one.set_loc(get_turf(src))
tank_one = null
update_icon()
if(href_list["tanktwo"])
tank_two.set_loc(get_turf(src))
tank_two = null
update_icon()
if(href_list["open"])
if (valve_open)
var/turf/bombturf = get_turf(src)
logTheThing("bombing", usr, null, "closed the valve on a tank transfer valve at [showCoords(bombturf.x, bombturf.y, bombturf.z)].")
message_admins("[key_name(usr)] closed the valve on a tank transfer valve at [showCoords(bombturf.x, bombturf.y, bombturf.z)].")
else
var/turf/bombturf = get_turf(src)
logTheThing("bombing", usr, null, "opened the valve on a tank transfer valve at [showCoords(bombturf.x, bombturf.y, bombturf.z)].")
message_admins("[key_name(usr)] opened the valve on a tank transfer valve at [showCoords(bombturf.x, bombturf.y, bombturf.z)].")
toggle_valve()
if(href_list["rem_device"])
attached_device.set_loc(get_turf(src))
attached_device.master = null
attached_device = null
update_icon()
if(href_list["device"])
attached_device.attack_self(usr)
src.attack_self(usr)
src.add_fingerprint(usr)
return
receive_signal(signal)
if(toggle)
toggle = 0
if (ishellbanned(usr))
force_dud = 1
toggle_valve()
spawn(50) // To stop a signal being spammed from a proxy sensor constantly going off or whatever
toggle = 1
process()
proc
update_icon()
src.overlays = new/list()
src.underlays = new/list()
if(!tank_one && !tank_two && !attached_device)
icon_state = "valve_1"
return
icon_state = "valve"
var/tank_one_icon = ""
var/tank_two_icon = ""
if(tank_one)
tank_one_icon = tank_one.icon_state
if(tank_two)
tank_two_icon = tank_two.icon_state
if(tank_one)
var/image/I = new(src.icon, icon_state = "[tank_one_icon]")
//var/obj/overlay/tank_one_overlay = new
//tank_one_overlay.icon = src.icon
//tank_one_overlay.icon_state = tank_one_icon
src.underlays += I
if(tank_two)
var/image/J = new(src.icon, icon_state = "[tank_two_icon]")
if(istype(tank_two, /obj/item/clothing/head/butt))
J.transform = matrix(J.transform, -180, MATRIX_ROTATE | MATRIX_MODIFY)
J.pixel_y = -10
J.pixel_x = 1
else
J.pixel_x = -13
//var/obj/underlay/tank_two_overlay = new
//tank_two_overlay.icon = I
src.underlays += J
if(attached_device)
var/image/K = new(src.icon, icon_state = "device")
//var/obj/overlay/device_overlay = new
//device_overlay.icon = src.icon
//device_overlay.icon_state = device_icon
src.overlays += K
/*
Exadv1: I know this isn't how it's going to work, but this was just to check
it explodes properly when it gets a signal (and it does).
*/
toggle_valve()
src.valve_open = !valve_open
if(valve_open && force_dud)
message_admins("A bomb valve would have opened at [log_loc(src)] but was forced to dud! Last touched by: [src.fingerprintslast ? "[src.fingerprintslast]" : "*null*"]")
logTheThing("bombing", null, null, "A bomb valve would have opened at [log_loc(src)] but was forced to dud! Last touched by: [src.fingerprintslast ? "[src.fingerprintslast]" : "*null*"]")
return
if(valve_open && (istype(tank_one, /obj/item/clothing/head/butt) || istype(tank_two, /obj/item/clothing/head/butt))) //lol
var/obj/item/tank/T
var/obj/item/clothing/head/butt/B
if(istype(tank_one, /obj/item/tank))
T = tank_one
else if(istype(tank_one, /obj/item/clothing/head/butt))
B = tank_one
if(istype(tank_two, /obj/item/tank))
T = tank_two
else if(istype(tank_two, /obj/item/clothing/head/butt))
B = tank_two
if(!B || !T) return
var/power = min(T.air_contents.return_pressure() / TANK_RUPTURE_PRESSURE, 2)
DEBUG("Power: [power]")
if(power < 0.30) //Really weak
return
else if (power < 0.50)
visible_message("<span class='combat'>\The [src] farts [pick_string("descriptors.txt", "mopey")]</span>")
playsound(get_turf(src), 'sound/misc/poo2.ogg', 30, 2)
return
var/stun_time = 6 * power
var/fart_range = 12 * power
var/throw_speed = 30 * power
var/throw_repeat = 6 * power
var/sound_volume = 100 * power
playsound(get_turf(src), 'sound/misc/superfart.ogg', sound_volume, 2)
visible_message("<span class='combat bold' style='font-size:[100 + (100*(power-0.5))]%;'>\The [src] farts loudly!</span>")
for(var/mob/living/L in hearers(get_turf(src), fart_range))
shake_camera(L,10,5)
boutput(L, "<span style=\"color:red\">You are sent flying!</span>")
L.weakened += stun_time
while (throw_repeat > 0)
throw_repeat--
step_away(L,get_turf(src),throw_speed)
T.air_contents.zero() //I could also make it vent the gas, I guess, but then it'd be off-limits to non-antagonists. Challenge mode: make a safe ttb?
qdel(B)
spawn(10)
update_icon()
return
if(valve_open && (tank_one && tank_two))
var/turf/bombturf = get_turf(src)
var/bombarea = bombturf.loc.name
logTheThing("bombing", null, null, "Bomb valve opened in [bombarea] ([showCoords(bombturf.x, bombturf.y, bombturf.z)]). Last touched by [src.fingerprintslast]")
message_admins("Bomb valve opened in [bombarea] ([showCoords(bombturf.x, bombturf.y, bombturf.z)]). Last touched by [src.fingerprintslast]")
var/datum/gas_mixture/temp
temp = tank_one.air_contents.remove_ratio(1)
tank_two.air_contents.volume = tank_one.air_contents.volume
tank_two.air_contents.merge(temp)
// temp = tank_two.air_contents.remove_ratio(0.5)
// tank_one.air_contents.merge(temp)
spawn(20) // In case one tank bursts
src.update_icon()
// this doesn't do anything but the timer etc. expects it to be here
// eventually maybe have it update icon to show state (timer, prox etc.) like old bombs
c_state()
return
//Prox sensor handling.
Move()
..()
if(istype(attached_device,/obj/item/device/prox_sensor))
var/obj/item/device/prox_sensor/A = attached_device
A.sense()
dropped()
..()
if(istype(attached_device,/obj/item/device/prox_sensor))
var/obj/item/device/prox_sensor/A = attached_device
A.sense()
HasProximity(atom/movable/AM as mob|obj)
if(istype(attached_device,/obj/item/device/prox_sensor))
if (istype(AM, /obj/projectile))
return
if (AM.move_speed < 12)
var/obj/item/device/prox_sensor/A = attached_device
A.sense()
suicide(var/mob/user as mob)
user.visible_message("<span style=\"color:red\"><b>[user] drops the [src.name], takes a short run up and kicks the valve as hard as \he can, knocking it [valve_open ? "closed" : "open"]!</b></span>")
user.u_equip(src)
src.set_loc(user.loc)
toggle_valve()
spawn(20)
if (user)
user.suiciding = 0
if(user.stat == 0 && src && get_dist(user,src) <= 7)
user.visible_message("<span style=\"color:red\">[user] stares at the [src.name], a confused expression on \his face.</span>") //It didn't blow up!
return 1
/obj/item/device/transfer_valve/briefcase
name = "briefcase"
icon_state = "briefcase"
var/obj/item/storage/briefcase/B = null
mats = 8
update_icon()
return
/obj/item/device/transfer_valve/vr
name = "VR explosive"
var/obj/machinery/networked/storage/bomb_tester/tester = null
var/updates_before_halt = 10 //So we don't keep updating on a dud bomb forever.
var/update_counter = 0
attack_hand(mob/user as mob)
return
disposing()
processing_items.Remove(src)
if(tester)
tester.update_bomb_log("VR Bomb deleted.", 1)
if(ismob(src.loc))
boutput(src.loc, "<span style=\"color:red\">[src] fades away!</span>")
else
src.visible_message("<span style=\"color:red\">[src] fades away!</span>")
..()
toggle_valve()
if(tester)
tester.update_bomb_log("Valve Opened.")
if (!(src in processing_items))
processing_items.Add(src)
..()
return
process()
if(!tester || !src.valve_open)
return
if(update_counter >= updates_before_halt)
tester.update_bomb_log("VR bomb monitor timeout.", 1)
processing_items.Remove(src)
return
update_counter++
var/tankslost = 2
var/log_message = "[time2text(world.timeofday, "mm:ss")]:"
var/tpressure = 0
if(tank_one && tank_one.air_contents)
tankslost--
var/t1pressure = tank_one.air_contents.return_pressure()
tpressure += round(t1pressure,0.1)
if(tank_two && tank_two.air_contents)
tankslost--
var/t2pressure = tank_two.air_contents.return_pressure()
tpressure += round(t2pressure,0.1)
log_message += " Pressure:[tpressure] kPa"
if(tankslost)
log_message += " [tankslost == 2 ? "Both" : "One"] Tank(s) Lost!"
tester.update_bomb_log(log_message)
return
+233
View File
@@ -0,0 +1,233 @@
/obj/dummy/voltron
icon = null
name = "Sparks"
desc = "Dangerous looking sparks."
anchored = 1
density = 0
opacity = 0
var/can_move = 1
var/speed = 1
var/image/img = null
var/list/cableimgs = new/list()
var/mob/the_user = null
//Prolonged use causes damage.
New(mob/target, atom/location)
src.set_loc(location)
the_user = target
target.set_loc(src)
img = image('icons/effects/effects.dmi',src ,"energyorb")
target << img
spawn(0) check()
remove_air(amount as num)
var/datum/gas_mixture/Air = unpool(/datum/gas_mixture)
Air.oxygen = amount
Air.temperature = 310
return Air
proc/spawn_sparks()
spawn(0)
// Check spawn limits
if(limiter.canISpawn(/obj/effects/sparks))
var/obj/effects/sparks/O = unpool(/obj/effects/sparks)
O.set_loc(src.loc)
spawn(20) if (O) pool(O)
relaymove(mob/user, direction)
var/turf/new_loc = get_step(src, direction)
if(can_move)
var/list/allowed = new/list()
for(var/obj/cable/C in src.loc)
allowed += C.d1
allowed += C.d2
if(direction in allowed)
if(!locate(/obj/cable) in new_loc) return
if (prob(10)) spawn_sparks()
src.set_loc(new_loc)
can_move = 0
spawn(speed) can_move = 1
return
disposing()
the_user.client.images -= cableimgs
the_user = null
return ..()
proc/check()
while (!disposed)
for(var/obj/item/I in src)
I.set_loc(src.loc)
the_user.client.images -= cableimgs
cableimgs.Cut()
for(var/obj/cable/C in range(3, src.loc))
cableimgs += C.cableimg
the_user.client.images += cableimgs
sleep(10)
/obj/item/device/voltron
name = "Voltron"
desc = "Converts matter into energy and back. Needs to be used while standing on a cable."
icon = 'icons/obj/device.dmi'
icon_state = "voltron"
item_state = "electronic"
var/active = 0
var/mob/target = null
var/obj/dummy/voltron/D = null
var/activating = 0
var/on_cooldown = 0
var/power = 100
var/power_icon = ""
module_research = list("devices" = 5, "energy" = 20, "miniaturization" = 20)
New()
handle_overlay()
spawn(0)
check()
return ..()
pickup()
power_icon = ""
handle_overlay()
return ..()
dropped()
power_icon = ""
handle_overlay()
if(active)
src.set_loc(get_turf(target))
deactivate()
return ..()
proc/handle_overlay()
var/rebuild_overlay = 0
switch(power)
if(0 to 20)
if(power_icon != "volt1")
power_icon = "volt1"
rebuild_overlay = 1
if(21 to 40)
if(power_icon != "volt2")
power_icon = "volt2"
rebuild_overlay = 1
if(41 to 60)
if(power_icon != "volt3")
power_icon = "volt3"
rebuild_overlay = 1
if(61 to 80)
if(power_icon != "volt4")
power_icon = "volt4"
rebuild_overlay = 1
if(81 to 100)
if(power_icon != "volt5")
power_icon = "volt5"
rebuild_overlay = 1
if(rebuild_overlay)
overlays.Cut()
overlays += image('icons/obj/device.dmi',src,power_icon)
proc/check()
while (!disposed)
if(!active)
if(power < 100) power += 0.35
handle_overlay()
sleep(10)
else
power = round(power)
power--
handle_overlay()
if(power == 20)
boutput(target, "<span style=\"color:red\">The [src] is dangerously low on power. Your energy pattern is destabilizing.</span>")
if(power < 20)
random_brute_damage(target, 4)
target.updatehealth()
if(power <= 0)
boutput(target, "<span style=\"color:red\">The [src] is out of energy.</span>")
var/mob/old_trg = target
deactivate()
old_trg.stunned = 20
sleep(10)
proc/deactivate()
if(activating) return
activating = 1
on_cooldown = 1
spawn(30) on_cooldown = 0
var/atom/dummy = target.loc
dummy.invisibility = 101
playsound(src, "sound/effects/shielddown2.ogg", 40, 1)
var/obj/overlay/O = new/obj/overlay(get_turf(target))
O.name = "Energy"
O.anchored = 1
O.layer = MOB_EFFECT_LAYER
target.transforming = 1
O.icon = 'icons/effects/effects.dmi'
O.icon_state = "energytwirlout"
sleep(5)
target.transforming = 0
qdel(O)
target.set_loc(get_turf(target))
qdel(dummy)
active = 0
target = null
activating = 0
proc/activate()
if(activating) return
if(locate(/obj/cable) in get_turf(src))
if(on_cooldown)
boutput(usr, "<span style=\"color:red\">The [src] is still recharging.</span>")
return
activating = 1
playsound(src, "sound/effects/singsuck.ogg", 40, 1)
var/obj/overlay/O = new/obj/overlay(get_turf(usr))
O.name = "Energy"
O.anchored = 1
O.layer = MOB_EFFECT_LAYER
usr:transforming = 1
O.icon = 'icons/effects/effects.dmi'
O.icon_state = "energytwirlin"
sleep(5)
usr:transforming = 0
qdel(O)
D = new/obj/dummy/voltron(usr, get_turf(src))
target = usr
active = 1
activating = 0
else
boutput(usr, "<span style=\"color:red\">This needs to be used while standing on a cable.</span>")
attack_self(mob/user as mob)
if(activating) return
if(active)
boutput(target, "<span style=\"color:blue\">You deactivate the [src].</span>")
deactivate()
else
boutput(user, "<span style=\"color:blue\">You activate the [src].</span>")
activate()
power -= 5
handle_overlay()
return
+275
View File
@@ -0,0 +1,275 @@
#define MAX_DICE_GROUP 6
#define ROLL_WAIT_TIME 30
/obj/item/dice
name = "die"
desc = "A six-sided die."
icon = 'icons/obj/items.dmi'
icon_state = "dice"
throwforce = 0
w_class = 1.0
stamina_damage = 2
stamina_cost = 2
var/sides = 6
var/last_roll = null
var/last_roll_time = null
var/list/dicePals = list() // for combined dice rolls, up to 9 in a stack
var/sound_roll = 'sound/misc/dicedrop.ogg'
module_research = list("vice" = 5)
module_research_type = /obj/item/dice
rand_pos = 1
get_desc()
if (src.last_roll && !src.dicePals.len)
if (isnum(src.last_roll))
. += "<br>[src] currently shows [get_english_num(src.last_roll)]."
else
. += "<br>[src] currently shows [src.last_roll]."
suicide(var/mob/user as mob)
user.visible_message("<span style=\"color:red\"><b>[user] attempts to swallow [src] and chokes on it.</b></span>")
user.take_oxygen_deprivation(160)
user.updatehealth()
spawn(100)
if (user)
user.suiciding = 0
return 1
proc/roll_dat_thang() // fine if I can't use proc/roll() then we'll all just have to suffer this
if (src.last_roll_time && world.time < (src.last_roll_time + ROLL_WAIT_TIME))
return
var/roll_total = null
if (src.sound_roll)
playsound(get_turf(src), src.sound_roll, 100, 1)
src.set_loc(get_turf(src))
src.pixel_y = rand(-8,8)
src.pixel_x = rand(-8,8)
src.name = initial(src.name)
src.desc = initial(src.desc)
src.overlays = null
if (src.sides && isnum(src.sides))
src.last_roll = rand(1, src.sides)
roll_total = src.last_roll
src.visible_message("[src] shows [get_english_num(src.last_roll)].")
#ifdef HALLOWEEN
if (last_roll == 13 && prob(5))
var/turf/T = get_turf(src)
for (var/obj/machinery/power/apc/apc in get_area(T))
apc.overload_lighting()
playsound(T, 'sound/effects/ghost.ogg', 75, 0)
new /obj/critter/bloodling(T)
#endif
else if (src.sides && islist(src.sides) && src.sides:len)
src.last_roll = pick(src.sides)
src.visible_message("[src] shows <i>[src.last_roll]</i>.")
else
src.last_roll = null
src.visible_message("[src] shows... um. Something. It hurts to look at. [pick("What the fuck?", "You should probably find the chaplain.")]")
if (src.dicePals.len)
shuffle(src.dicePals) // so they don't all roll in the same order they went into the pile
for (var/obj/item/dice/D in src.dicePals)
D.set_loc(get_turf(src))
if (prob(75))
step_rand(D)
roll_total += D.roll_dat_thang()
src.dicePals = list()
src.visible_message("<b>The total of all the dice is [roll_total < 999999 ? "[get_english_num(roll_total)]" : "[roll_total]"].</b>")
return roll_total
proc/addPal(var/obj/item/dice/Pal, var/mob/user as mob)
if (!Pal || Pal == src || !istype(Pal, /obj/item/dice) || (src.dicePals.len + Pal.dicePals.len) >= MAX_DICE_GROUP)
return 0
if (istype(Pal.loc, /obj/item/storage))
return 0
src.dicePals += Pal
if (Pal.dicePals.len)
for (var/obj/item/dice/D in Pal.dicePals)
if (istype(D.loc, /obj/item/storage))
Pal.dicePals -= D
continue
if (ismob(D.loc))
D.loc:u_equip(D)
D.set_loc(src)
src.dicePals |= Pal.dicePals // |= adds things to lists that aren't already present
Pal.dicePals = list()
if (ismob(Pal.loc))
Pal.loc:u_equip(Pal)
Pal.set_loc(src)
var/image/die_overlay = image(Pal.icon, Pal.icon_state)
die_overlay.pixel_y = Pal.pixel_y
die_overlay.pixel_x = Pal.pixel_x
src.overlays += die_overlay
src.name = "bunch of dice"
src.desc = "Some dice, bunched up together and ready to be thrown."
return 1
attackby(obj/item/W, mob/user)
if (istype(W, /obj/item/dice))
if (src.addPal(W, user))
user.show_text("You add [W] to [src].")
else
return ..()
attack_self(mob/user as mob)
user.u_equip(src)
src.roll_dat_thang()
throw_impact(var/turf/T)
..()
src.roll_dat_thang()
MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob)
if (istype(O, /obj/item/dice))
if (src.addPal(O, user))
user.visible_message("<b>[user]</b> gathers up some dice.",\
"You gather up some dice.")
spawn(2)
for (var/obj/item/dice/D in range(1, user))
if (D == src)
continue
if (!src.addPal(D, user))
break
else
sleep(2)
return
else
return ..()
/obj/item/dice/coin // dumb but it helped test non-numeric rolls
name = "coin"
desc = "A little coin that will probably vanish into a couch eventually."
icon_state = "coin-silver"
sides = list("heads", "tails")
sound_roll = 'sound/misc/coindrop.ogg'
/obj/item/dice/magic8ball // farte
name = "magic 8 ball"
desc = "Think of a yes-or-no question, shake it, and it'll tell you the answer! You probably shouldn't use it for playing an actual game of pool."
icon_state = "8ball"
sides = list("It is certain",\
"It is decidedly so",\
"Without a doubt",\
"Yes definitely",\
"You may rely on it",\
"As I see it, yes",\
"Most likely",\
"Outlook good",\
"Yes",\
"Signs point to yes",\
"Reply hazy try again",\
"Ask again later",\
"Better not tell you now",\
"Cannot predict now",\
"Concentrate and ask again",\
"Don't count on it",\
"My reply is no",\
"My sources say no",\
"Outlook not so good",\
"Very doubtful")
sound_roll = 'sound/items/liquid_shake.ogg'
addPal()
return 0
suicide(var/mob/user as mob)
user.visible_message("<span style=\"color:red\"><b>[user] drop kicks the [src], but it barely moves!</b></span>")
user.visible_message("[src] shows <i>[pick("Goodbye","You done fucked up now","Time to die","Outlook terrible","That was a mistake","You should not have done that","Foolish","Very well")]</i>.")
user.u_equip(src)
src.set_loc(user.loc)
spawn(10)
user.visible_message("<span style=\"color:red\"><b>[user] is crushed into a bloody ball by an unseen force, and vanishes into nothingness!</b></span>")
user.implode()
return 1
/obj/item/dice/d4
name = "\improper D4"
desc = "A tetrahedral die informally known as a D4."
icon_state = "d4"
sides = 4
/obj/item/dice/d10
name = "\improper D10"
desc = "A decahedral die informally known as a D10."
icon_state = "d20"
sides = 10
/obj/item/dice/d12
name = "\improper D12"
desc = "A dodecahedral die informally known as a D12."
icon_state = "d20"
sides = 12
/obj/item/dice/d20
name = "\improper D20"
desc = "An icosahedral die informally known as a D20."
icon_state = "d20"
sides = 20
/obj/item/dice/d100
name = "\improper D100"
desc = "It's not so much a die as much as it is a ball with numbers on it."
icon_state = "d100"
sides = 100
/obj/item/dice/d1
name = "\improper D1"
desc = "Uh. It has... one side? I guess? Maybe?"
icon_state = "dice"
sides = 1
/obj/item/dice_bot
name = "Probability Cube"
desc = "A device for the calculation of random probabilities. Especially ones between one and six."
icon = 'icons/obj/items.dmi'
icon_state = "dice"
w_class = 1.0
var/sides = 6
var/last_roll = null
New()
..()
name = "[initial(name)] (d[sides])"
proc/roll_dat_thang()
playsound(get_turf(src), "sound/misc/dicedrop.ogg", 100, 1)
if (src.sides && isnum(src.sides))
src.last_roll = get_english_num(rand(1, src.sides))
src.visible_message("[src] shows [src.last_roll].")
else
src.last_roll = null
src.visible_message("[src] shows... um. This isn't a number. It hurts to look at. [pick("What the fuck?", "You should probably find the chaplain.")]")
attack_self(var/mob/user as mob)
src.roll_dat_thang()
d4
icon_state = "d4"
sides = 4
d10
icon_state = "d20"
sides = 10
d12
icon_state = "d20"
sides = 12
d20
icon_state = "d20"
sides = 20
d100
icon_state = "d100"
sides = 100
#undef MAX_DICE_GROUP
+202
View File
@@ -0,0 +1,202 @@
// FINGERPRINT HOLDER
// All of this was phased out with the forensic scanner overhaul. Was useless anyway (Convair880).
/obj/item/fcardholder
name = "Finger Print Case"
icon = 'icons/obj/items.dmi'
icon_state = "fcardholder0"
item_state = "clipboard"
stamina_damage = 2
stamina_cost = 2
stamina_crit_chance = 1
/obj/item/fcardholder/attack_self(mob/user as mob)
var/dat = "<B>Clipboard</B><BR>"
for(var/obj/item/f_card/P in src)
dat += text("<A href='?src=\ref[];read=\ref[]'>[]</A> <A href='?src=\ref[];remove=\ref[]'>Remove</A><BR>", src, P, P.name, src, P)
user << browse(dat, "window=fcardholder")
onclose(user, "fcardholder")
return
/obj/item/fcardholder/Topic(href, href_list)
..()
if ((usr.stat || usr.restrained()))
return
if (usr.contents.Find(src))
usr.machine = src
if (href_list["remove"])
var/obj/item/P = locate(href_list["remove"])
if (P && P.loc == src)
usr.put_in_hand_or_drop(P)
src.add_fingerprint(usr)
src.update()
if (href_list["read"])
var/obj/item/f_card/P = locate(href_list["read"])
if ((P && P.loc == src))
if (!( istype(usr, /mob/living/carbon/human) ))
usr << browse(text("<HTML><HEAD><TITLE>[]</TITLE></HEAD><BODY><TT>[]</TT></BODY></HTML>", P.name, P.display()), text("window=[]", P.name))
onclose(usr, "[P.name]")
else
usr << browse(text("<HTML><HEAD><TITLE>[]</TITLE></HEAD><BODY><TT>[]</TT></BODY></HTML>", P.name, P.display()), text("window=[]", P.name))
onclose(usr, "[P.name]")
src.add_fingerprint(usr)
if (ismob(src.loc))
var/mob/M = src.loc
if (M.machine == src)
spawn( 0 )
src.attack_self(M)
return
return
/obj/item/fcardholder/attack_hand(mob/user as mob)
if (user.contents.Find(src))
spawn( 0 )
src.attack_self(user)
return
src.add_fingerprint(user)
else
return ..()
return
/obj/item/fcardholder/attackby(obj/item/P as obj, mob/user as mob)
if (istype(P, /obj/item/f_card))
if (src.contents.len < 30)
user.drop_item()
P.set_loc(src)
add_fingerprint(user)
src.add_fingerprint(user)
else
boutput(user, "<span style=\"color:blue\">Not enough space!!!</span>")
else
if (istype(P, /obj/item/pen))
var/t = input(user, "Holder Label:", text("[]", src.name), null) as text
if (user.equipped() != P)
return
if ((!in_range(src, usr) && src.loc != user))
return
t = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
if (t)
src.name = text("FPCase- '[]'", t)
else
src.name = "Finger Print Case"
else
return
src.update()
spawn( 0 )
attack_self(user)
return
return
/obj/item/fcardholder/proc/update()
var/i = 0
for(var/obj/item/f_card/F in src)
i = 1
break
src.icon_state = text("fcardholder[]", (i ? "1" : "0"))
return
// FINGERPRINT CARD
/obj/item/f_card
name = "Finger Print Card"
icon = 'icons/obj/card.dmi'
icon_state = "fingerprint0"
amount = 10.0
item_state = "paper"
throwforce = 1
w_class = 1.0
throw_speed = 3
throw_range = 5
max_stack = 10
/obj/item/f_card/examine()
set src in view(2)
set category = "Local"
..()
boutput(usr, text("<span style=\"color:blue\">There are [] on the stack!</span>", src.amount))
usr << browse(text("<HTML><HEAD><TITLE>[]</TITLE></HEAD><BODY><TT>[]</TT></BODY></HTML>", src.name, display()), text("window=[]", src.name))
onclose(usr, "[src.name]")
return
/obj/item/f_card/proc/display()
if (src.fingerprints)
var/dat = "<B>Fingerprints on Card</B><HR>"
var/L = params2list(src.fingerprints)
for(var/i in L)
dat += text("[]<BR>", i)
//Foreach goto(41)
return dat
else
return "<B>There are no fingerprints on this card.</B>"
return
/obj/item/f_card/attack_hand(mob/user as mob)
if ((user.r_hand == src || user.l_hand == src))
src.add_fingerprint(user)
var/obj/item/f_card/F = new /obj/item/f_card( user )
F.amount = 1
src.amount--
user.put_in_hand_or_drop(F)
if (ishuman(user) && !user:gloves)
F.add_fingerprint(user)
if (src.amount < 1)
//SN src = null
qdel(src)
return
else
..()
return
/obj/item/f_card/attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/f_card))
if ((src.fingerprints || W.fingerprints))
return
if (src.amount == 10)
return
if (W:amount + src.amount > 10)
src.amount = 10
W:amount = W:amount + src.amount - 10
else
src.amount += W:amount
//W = null
qdel(W)
src.add_fingerprint(user)
if (W)
W.add_fingerprint(user)
else
if (istype(W, /obj/item/pen))
var/t = input(user, "Card Label:", text("[]", src.name), null) as text
if (user.equipped() != W)
return
if ((!in_range(src, usr) && src.loc != user))
return
t = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
if (t)
src.name = text("FPrintC- '[]'", t)
else
src.name = "Finger Print Card"
W.add_fingerprint(user)
src.add_fingerprint(user)
return
/obj/item/f_card/add_fingerprint()
..()
if (!istype(usr, /mob/living/silicon))
if (src.fingerprints)
if (src.amount > 1)
var/obj/item/f_card/F = new /obj/item/f_card( (ismob(src.loc) ? src.loc.loc : src.loc) )
F.amount = --src.amount
src.amount = 1
src.icon_state = "fingerprint1"
return
+537
View File
@@ -0,0 +1,537 @@
/*
CONTAINS:
GETLINEEEEEEEEEEEEEEEEEEEEE
(well not really but it should)
*/
/obj/item/flamethrower
name = "flamethrower"
icon = 'icons/obj/weapons.dmi'
inhand_image_icon = 'icons/mob/inhand/hand_weapons.dmi'
icon_state = "flamethrower_no_oxy_no_fuel"
item_state = "flamethrower0"
desc = "You are a firestarter!"
flags = FPRINT | TABLEPASS | CONDUCT | EXTRADELAY
force = 3.0
throwforce = 10.0
throw_speed = 1
throw_range = 5
w_class = 4
var/mode = 1
var/processing = 0
var/operating = 0
var/throw_amount = 100
var/lit = 0 //on or off
var/base_temperature = 700
var/temp_loss_per_tile = 35
var/obj/item/weldingtool/part1 = null
var/obj/item/rods/part2 = null
var/obj/item/device/igniter/part3 = null
var/obj/item/tank/part4 = null
var/obj/item/reagent_containers/food/drinks/fueltank/part5 = null
contraband = 5 //Heh
m_amt = 500
stamina_damage = 5
stamina_cost = 5
stamina_crit_chance = 1
/obj/item/flamethrower/loaded/
icon_state = "flamethrower_oxy_fuel"
// PantsNote: Dumping this shit in here until I'm sure it works.
/obj/item/assembly/weld_rod
desc = "A welding torch with metal rods attached to the flame tip."
name = "Welder/Rods Assembly"
icon_state = "welder-rods"
item_state = "welder"
var/obj/item/weldingtool/part1 = null
var/obj/item/rods/part2 = null
status = null
flags = FPRINT | TABLEPASS| CONDUCT
force = 3.0
throwforce = 5.0
throw_speed = 1
throw_range = 5
w_class = 2.0
/obj/item/assembly/weld_rod/New()
part1 = new /obj/item/weldingtool
part2 = new /obj/item/rods
/obj/item/assembly/w_r_ignite
desc = "A welding torch and igniter connected by metal rods."
name = "Welder/Rods/Igniter Assembly"
icon_state = "welder-rods-igniter"
item_state = "welder"
var/obj/item/weldingtool/part1 = null
var/obj/item/rods/part2 = null
var/obj/item/device/igniter/part3 = null
status = null
flags = FPRINT | TABLEPASS| CONDUCT
force = 3.0
throwforce = 5.0
throw_speed = 1
throw_range = 5
w_class = 2.0
/obj/item/assembly/w_r_ignite/New()
part1 = new /obj/item/weldingtool
part2 = new /obj/item/rods
part3 = new /obj/item/device/igniter
/obj/item/flamethrower/loaded/New()
part1 = new /obj/item/weldingtool
part2 = new /obj/item/rods
part3 = new /obj/item/device/igniter
part4 = new /obj/item/tank/oxygen
part5 = new /obj/item/reagent_containers/food/drinks/fueltank
/obj/item/flamethrower/New()
part1 = new /obj/item/weldingtool
part2 = new /obj/item/rods
part3 = new /obj/item/device/igniter
/obj/item/assembly/weld_rod/Del()
//src.part1 = null
qdel(src.part1)
//src.part2 = null
qdel(src.part2)
..()
return
/obj/item/assembly/w_r_ignite/Del()
//src.part1 = null
qdel(src.part1)
//src.part2 = null
qdel(src.part2)
//src.part3 = null
qdel(src.part3)
..()
return
/obj/item/flamethrower/Del()
//src.part1 = null
qdel(src.part1)
qdel(src.part2)
qdel(src.part3)
qdel(src.part4)
qdel(src.part5)
..()
return
/obj/item/assembly/weld_rod/attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/wrench) )
var/turf/T = src.loc
if (ismob(T))
T = T.loc
src.part1.set_loc(T)
src.part2.set_loc(T)
src.part1.master = null
src.part2.master = null
src.part1 = null
src.part2 = null
qdel(src)
if (istype(W, /obj/item/device/igniter))
if (src.loc != user)
boutput(user, "<span style=\"color:red\">You need to be holding [src] to work on it!</span>")
return
var/obj/item/device/igniter/I = W
if (!( I.status ))
return
var/obj/item/assembly/weld_rod/S = src
var/obj/item/assembly/w_r_ignite/R = new /obj/item/assembly/w_r_ignite( user )
R.part1 = S.part1
S.part1.set_loc(R)
S.part1.master = R
R.part2 = S.part2
S.part2.set_loc(R)
S.part2.master = R
S.layer = initial(S.layer)
user.u_equip(S)
user.put_in_hand_or_drop(R)
I.master = R
I.layer = initial(I.layer)
user.u_equip(I)
I.set_loc(R)
src.set_loc(R)
R.part3 = I
S.part1 = null
S.part2 = null
//S = null
qdel(S)
src.add_fingerprint(user)
return
/obj/item/assembly/w_r_ignite/attackby(obj/item/W as obj, mob/user as mob)
if ((istype(W, /obj/item/wrench) && !( src.status )))
var/turf/T = src.loc
if (ismob(T))
T = T.loc
src.part1.set_loc(T)
src.part2.set_loc(T)
src.part3.set_loc(T)
src.part1.master = null
src.part2.master = null
src.part3.master = null
src.part1 = null
src.part2 = null
src.part3 = null
qdel(src)
return
if (istype(W, /obj/item/screwdriver))
user.show_message("<span style=\"color:blue\">The igniter is now secured!</span>", 1)
var/obj/item/flamethrower/R = new /obj/item/flamethrower(src.loc)
var/obj/item/assembly/w_r_ignite/S = src
R.part1 = S.part1
S.part1.set_loc(R)
S.part1.master = R
R.part2 = S.part2
S.part2.set_loc(R)
S.part2.master = R
R.part3 = S.part3
S.part3.set_loc(R)
S.part3.master = R
S.layer = initial(S.layer)
S.master = R
S.layer = initial(S.layer)
user.u_equip(S)
user.put_in_hand_or_drop(R)
S.set_loc(R)
S.part1 = null
S.part2 = null
S.part3 = null
//S = null
qdel(S)
return
/obj/item/flamethrower/process()
if(!lit)
processing_items.Remove(src)
return null
var/turf/location = src.loc
if(istype(location, /mob/))
var/mob/M = location
if(M.l_hand == src || M.r_hand == src)
location = M.loc
if(isturf(location)) //start a fire if possible
location.hotspot_expose(700, 2)
/obj/item/flamethrower/attackby(obj/W, mob/user as mob)
if(user.stat || user.restrained() || user.lying)
return
if (istype(W,/obj/item/tank/air) || istype(W,/obj/item/tank/oxygen))
if(src.part4)
boutput(user, "<span style=\"color:red\">There already is an air tank loaded in the flamethrower!</span>")
return
src.part4 = W
W.set_loc(src)
user.u_equip(W)
lit = 0
force = 3
damtype = "brute"
var/fuel = "_no_fuel"
if(src.part5)
fuel = "_fuel"
icon_state = "flamethrower_oxy[fuel]"
if(istype(W,/obj/item/reagent_containers/food/drinks/fueltank))
if(src.part5)
boutput(user, "<span style=\"color:red\">There already is a fuel tank loaded in the flamethrower!</span>")
return
src.part5 = W
W.set_loc(src)
user.u_equip(W)
lit = 0
force = 3
damtype = "brute"
var/oxy = "_no_oxy"
if(src.part4)
oxy = "_oxy"
icon_state = "flamethrower[oxy]_fuel"
// PantsNote: Flamethrower disassmbly.
else if (istype(W, /obj/item/screwdriver))
var/obj/item/flamethrower/S = src
if (( S.part4 ))
return
var/obj/item/assembly/w_r_ignite/R = new /obj/item/assembly/w_r_ignite( user )
R.part1 = S.part1
S.part1.set_loc(R)
S.part1.master = R
R.part2 = S.part2
S.part2.set_loc(R)
S.part2.master = R
R.part3 = S.part3
S.part3.set_loc(R)
S.part3.master = R
S.layer = initial(S.layer)
user.u_equip(S)
user.put_in_hand_or_drop(R)
src.master = R
src.layer = initial(src.layer)
user.u_equip(src)
src.set_loc(R)
S.part1 = null
S.part2 = null
S.part3 = null
//S = null
qdel(S)
boutput(user, "<span style=\"color:blue\">The igniter is now unsecured!</span>")
else return ..()
return
/obj/item/flamethrower/afterattack(atom/target, mob/user, inrange)
if (inrange)
return
src.flame_turf(getline(user, target), user, target)
/obj/item/flamethrower/Topic(href,href_list[])
if (href_list["close"])
usr.machine = null
usr << browse(null, "window=flamethrower")
return
if(usr.stat || usr.restrained() || usr.lying)
return
usr.machine = src
if (href_list["light"])
if(!src.part4 || !src.part5) return
lit = !(lit)
if(lit)
icon_state = "flamethrower_ignite_on"
item_state = "flamethrower1"
force = 17
damtype = "fire"
if (!(src in processing_items))
processing_items.Add(src)
else
icon_state = "flamethrower_oxy_fuel"
force = 3
damtype = "brute"
if (href_list["removeair"])
if(!src.part4) return
var/obj/item/tank/A = src.part4
A.set_loc(get_turf(src))
A.layer = initial(A.layer)
src.part4 = null
lit = 0
force = 3
damtype = "brute"
var/fuel = "_no_fuel"
if(src.part5)
fuel = "_fuel"
icon_state = "flamethrower_no_oxy[fuel]"
item_state = "flamethrower0"
usr.machine = null
usr << browse(null, "window=flamethrower")
if (href_list["removefuel"])
if(!src.part5) return
var/obj/item/reagent_containers/food/drinks/fueltank/A = src.part5
A.set_loc(get_turf(src))
A.layer = initial(A.layer)
src.part5 = null
lit = 0
force = 3
damtype = "brute"
var/oxy = "_no_oxy"
if(src.part4)
oxy = "_oxy"
icon_state = "flamethrower[oxy]_no_fuel"
item_state = "flamethrower0"
usr.machine = null
usr << browse(null, "window=flamethrower")
if (href_list["mode"])
mode = text2num(href_list["mode"])
for(var/mob/M in viewers(1, src.loc))
if ((M.client && M.machine == src))
src.attack_self(M)
return
/obj/item/flamethrower/attack_self(mob/user as mob)
if(user.stat || user.restrained() || user.lying)
return
user.machine = src
var/dat = text("<TT><B>Flamethrower")
if(src.part4 && src.part5)
dat += text("(<A HREF='?src=\ref[src];light=1'>[lit ? "<font color='red'>Lit</font>" : "Unlit"]</a>)</B><BR>")
else
dat += text("</B><BR>")
if (src.part4)
dat += text("<br>Air Tank Pressure: [src.part4.air_contents.return_pressure()] (<A HREF='?src=\ref[src];removeair=1'>Remove Air Tank</A>)<BR>")
else
dat += text("<br>No Air Tank Attached!<BR>")
if(src.part5)
dat += text("<br>Fuel Tank: [src.part5.reagents.total_volume] units of fuel mixture (<A HREF='?src=\ref[src];removefuel=1'>Remove Fuel Tank</A>)<BR>")
else
dat += text("<br>No Fuel Tank Attached!<BR>")
dat += "<BR><B>Spray mode:</B> "
if (mode == 1)
dat += "<B>Incremental</B> | "
else
dat += "<a href='?src=\ref[src];mode=1'>Incremental</a> | "
if (mode == 2)
dat += "<B>Stream of 5</B> | "
else
dat += "<a href='?src=\ref[src];mode=2'>Stream of 5</a> | "
if (mode == 3)
dat += "<B>Stream of 10 (dangerous)</B>"
else
dat += "<a href='?src=\ref[src];mode=3'>Stream of 10 (dangerous)</a>"
dat += text("<BR><br><A HREF='?src=\ref[src];close=1'>Close</A></TT>")
user << browse(dat, "window=flamethrower;size=600x300")
onclose(user, "flamethrower")
return
// gets this from turf.dm turf/dblclick
/obj/item/flamethrower/proc/flame_turf(var/list/turflist, var/mob/user, var/atom/target) //Passing user and target for logging purposes
if(operating) return
operating = 1
//get up to 25 reagent
if(!part5 || !part5.reagents)
operating = 0
return
var/turf/own = get_turf(src)
var/turfs_to_spray = turflist.len - 1
if (!turfs_to_spray)
operating = 0
return
var/increment
var/reagentlefttotransfer
var/reagentperturf
if (part5.reagents.total_volume < 5)
boutput(usr, "<span style=\"color:red\">The fuel tank is empty.</span>")
operating = 0
return
if(user && target)
var/turf/T = get_turf(target)
if (T) //Wire: Fix for Cannot read null.x
logTheThing("combat", user, null, "fires a flamethrower [log_reagents(part5)] from [log_loc(user)], vector: ([T.x - user.x], [T.y - user.y]), dir: <I>[dir2text(get_dir(user, target))]</I>")
if (mode == 1)
increment = turfs_to_spray > 1 ? (7.5 / (turfs_to_spray - 1)) : 0
// a + (a + i) + (a + 2i) + (a + 3i) = T * a + (T * (T - 1)) / 2
var/total_needed = increment == 0 ? 12.5 : (turfs_to_spray * (7.5 + (turfs_to_spray - 1) * 0.5 * increment))
reagentlefttotransfer = min(total_needed,part5.reagents.total_volume)
var/ratio = reagentlefttotransfer / total_needed
increment *= ratio
//distribute if we can
reagentperturf = increment == 0 ? reagentlefttotransfer : 5 * ratio
else if (mode == 2 || mode == 3)
reagentperturf = mode == 2 ? 5 : 10
increment = 0
var/total_needed = turfs_to_spray * reagentperturf
reagentlefttotransfer = min(total_needed,part5.reagents.total_volume)
if (reagentlefttotransfer < total_needed)
reagentperturf = reagentlefttotransfer / turfs_to_spray
var/turf/currentturf = null
var/turf/previousturf = null
var/halt = 0
playsound(src.loc, "sound/effects/spray.ogg", 50, 1, 0, 0.75)
var/spray_temperature = base_temperature
var/mobHitList
for(var/turf/T in turflist)
previousturf = currentturf
currentturf = T
if (T == own)
continue
//Too little pressure to spray
var/datum/gas_mixture/environment = currentturf.return_air()
if(!part4 ||!part4.air_contents || !environment) break
if(environment.return_pressure() > part4.air_contents.return_pressure())
if(!previousturf && length(turflist)>1)
break
reagentperturf = reagentlefttotransfer
currentturf = previousturf
halt = 1
if(!previousturf && length(turflist)>1)
previousturf = get_turf(src)
continue //so we don't burn the tile we be standin on
//Dense object -> dump the rest at the previous turf.
if(currentturf.density || istype(currentturf, /turf/space))
//reagentperturf = reagentlefttotransfer
currentturf = previousturf
halt = 1
var/obj/blob/B = locate() in currentturf
if(B)
if (B.opacity)
part5.reagents.reaction(B, TOUCH, reagentperturf)
part5.reagents.remove_any(reagentperturf)
halt = 1
if(previousturf && LinkBlocked(previousturf, currentturf))
// reagentperturf = reagentlefttotransfer
currentturf = previousturf
halt = 1
// if (halt)
// break
reagentlefttotransfer -= reagentperturf
spray_turf(currentturf,reagentperturf)
reagentperturf += increment
if(lit)
//currentturf.hotspot_expose(spray_temperature,2)
currentturf.reagents.set_reagent_temp(spray_temperature)
currentturf.reagents.temperature_react()
spray_temperature = max(0,min(spray_temperature - temp_loss_per_tile, 700))
var/logString = log_reagents(part5)
for (var/mob/living/carbon/human/theMob in currentturf.contents)
logTheThing("combat", usr, theMob, "blasts %target% with a flamethrower [logString] at [log_loc(theMob)].")
mobHitList += "[key_name(theMob)], "
if(halt)
break
sleep(1)
operating = 0
for(var/mob/M in viewers(1, src.loc))
if ((M.client && M.machine == src))
src.attack_self(M)
return 1
/obj/item/flamethrower/proc/spray_turf(turf/target,var/transferamt)
var/rem_ratio = 0.01
if (mode == 1)
rem_ratio = 0.02
if (mode == 3)
rem_ratio = 0.03
var/datum/gas_mixture/air_transfer = part4.air_contents.remove_ratio(rem_ratio)
target.assume_air(air_transfer)
//Transfer reagents
var/datum/reagents/copied = new/datum/reagents(transferamt)
copied = part5.reagents.copy_to(copied, transferamt/part5.reagents.maximum_volume)
if(!target.reagents)
target.create_reagents(50)
for(var/atom/A in target.contents)
copied.reaction(A, TOUCH)
if(A.reagents)
copied.copy_to(A.reagents, 1)
copied.reaction(target, TOUCH)
part5.reagents.trans_to(target, transferamt)
particleMaster.SpawnSystem(new /datum/particleSystem/chemspray(src.loc, target, part5.reagents))
+417
View File
@@ -0,0 +1,417 @@
/obj/item/reagent_containers/food/drinks/bottle/beer
name = "Space Beer"
desc = "Beer. in space."
icon_state = "bottle-brown"
heal_amt = 1
g_amt = 40
bottle_style = "brown"
label = "alcohol1"
initial_volume = 50
module_research = list("vice" = 5)
module_research_type = /obj/item/reagent_containers/food/drinks/bottle/beer
New()
..()
reagents.add_reagent("beer", 30)
/obj/item/reagent_containers/food/drinks/bottle/beer/borg
unbreakable = 1
/obj/item/reagent_containers/food/drinks/bottle/fancy_beer
name = "Fancy Beer"
desc = "Some kind of fancy-pants IPA or lager or ale. Some sort of beer-type thing."
icon_state = "bottle-green"
initial_volume = 50
module_research = list("vice" = 5)
module_research_type = /obj/item/reagent_containers/food/drinks/bottle/beer
New()
..()
name = "[pick(BOOZE_prefixes)] [pick(BEER_suffixes)]"
bottle_style = pick("clear", "black", "barf", "brown", "red", "orange", "yellow", "green", "cyan", "blue", "purple")
label = pick("alcohol1","alcohol2","alcohol3","alcohol4","alcohol5","alcohol6","alcohol7")
reagents.add_reagent("beer", 25)
reagents.add_reagent("ethanol", 5)
var/flavors = 1
var/adulterants = 1
while(flavors > 0)
flavors--
reagents.add_reagent(pick(BOOZE_flavors),rand(1,3))
while(adulterants > 0)
adulterants--
reagents.add_reagent(pick(CYBERPUNK_drug_adulterants), rand(1,3))
update_icon()
///////////
/var/list/BOOZE_prefixes = strings("chemistry_tools.txt", "BOOZE_prefixes")
/var/list/WINE_suffixes = strings("chemistry_tools.txt", "WINE_suffixes")
/var/list/BEER_suffixes = strings("chemistry_tools.txt", "BEER_suffixes")
/var/list/BOOZE_flavors = strings("chemistry_tools.txt", "BOOZE_flavors")
////////////
/obj/item/reagent_containers/food/drinks/bottle/wine
name = "Wine"
desc = "Not to be confused with pubbie tears."
icon_state = "bottle-purple"
heal_amt = 1
g_amt = 40
bottle_style = "purple"
label = "alcohol2"
initial_volume = 50
module_research = list("vice" = 5)
module_research_type = /obj/item/reagent_containers/food/drinks/bottle/beer
New()
..()
reagents.add_reagent("wine", 30)
/obj/item/reagent_containers/food/drinks/bottle/hobo_wine
name = "Fortified Wine"
desc = "Some sort of bottom-shelf booze. Wasn't this brand banned awhile ago?"
icon_state = "bottle-vermouth"
heal_amt = 1
g_amt = 40
bottle_style = "vermouth"
fluid_style = "vermouth"
label = "vermouth"
var/safe
initial_volume = 50
module_research = list("vice" = 5)
module_research_type = /obj/item/reagent_containers/food/drinks/bottle/beer
New()
..()
name = "[pick(BOOZE_prefixes)] [pick(WINE_suffixes)]"
bottle_style = pick("vermouthR", "vermouthO", "vermouthY", "vermouth", "vermouthC", "vermouthB", "vermouthP")
reagents.add_reagent("wine", 20)
reagents.add_reagent("ethanol", 5)
var/adulterant_safety = safe ? "CYBERPUNK_drug_adulterants_safe" : "CYBERPUNK_drug_adulterants"
var/flavors = rand(1,3)
var/adulterants = rand(2,4)
if(safe)
name = "Watered Down [name]"
reagents.add_reagent("water", 1) // how is this safe?
while(flavors > 0)
flavors--
reagents.add_reagent(pick(BOOZE_flavors),rand(2,5))
while(adulterants > 0)
adulterants--
reagents.add_reagent(pick(adulterant_safety), rand(1,3))
/obj/item/reagent_containers/food/drinks/bottle/hobo_wine/safe
safe = 1
/obj/item/reagent_containers/food/drinks/bottle/champagne
name = "Champagne"
desc = "Fizzy wine used in celebrations. It's not technically champagne if it's not made using grapes from the Champagne region of France."
icon_state = "bottle-champagneG"
bottle_style = "champagneG"
fluid_style = "champagne"
label = "champagne"
heal_amt = 1
g_amt = 60
initial_volume = 50
module_research = list("vice" = 5)
module_research_type = /obj/item/reagent_containers/food/drinks/bottle/beer
New()
..()
reagents.add_reagent("champagne", 30)
afterattack(obj/O as obj, mob/user as mob)
if (istype(O, /obj/machinery/vehicle) || istype(O, /obj/vehicle) && user.a_intent == "harm")
var/turf/U = user.loc
if (src.broken)
boutput(user, "You can't christen something with a bottle in that state! Are you some kind of unsophisticated ANIMAL?!")
return
if (prob(50))
user.visible_message("<span style=\"color:red\"><b>[user]</b> hits [O] with [src], shattering it open!</span>")
playsound(U, pick('sound/effects/Glassbr1.ogg','sound/effects/Glassbr2.ogg','sound/effects/Glassbr3.ogg'), 100, 1)
new /obj/item/raw_material/shard/glass(U)
src.broken = 1
src.reagents.reaction(U)
src.create_reagents(0)
src.update_icon()
var/new_name = input(usr, "Enter new name for [O]", "Rename [O]", O.name) as text
logTheThing("station", user, null, "renamed [O] to [new_name] in [get_area(user)] ([showCoords(user.x, user.y, user.z)])")
new_name = copytext(html_encode(new_name), 1, 32)
O.name = new_name
return
/obj/item/reagent_containers/food/drinks/bottle/cider
name = "Cider"
desc = "Made from apples."
icon_state = "bottle-green"
heal_amt = 1
g_amt = 40
bottle_style = "green"
label = "alcohol1"
initial_volume = 50
module_research = list("vice" = 5)
module_research_type = /obj/item/reagent_containers/food/drinks/bottle/beer
New()
..()
reagents.add_reagent("cider", 30)
/obj/item/reagent_containers/food/drinks/rum
name = "Rum"
desc = "Yo ho ho and all that."
icon_state = "rum"
heal_amt = 1
initial_volume = 50
module_research = list("vice" = 5)
module_research_type = /obj/item/reagent_containers/food/drinks/bottle/beer
New()
..()
reagents.add_reagent("rum", 30)
/obj/item/reagent_containers/food/drinks/rum_spaced
name = "Spaced Rum"
desc = "Rum which has been exposed to cosmic radiation. Don't worry, radiation does everything!"
icon_state = "rum"
heal_amt = 1
initial_volume = 60
module_research = list("vice" = 5)
module_research_type = /obj/item/reagent_containers/food/drinks/bottle/beer
New()
..()
reagents.add_reagent("rum", 30)
reagents.add_reagent("yobihodazine", 30)
/obj/item/reagent_containers/food/drinks/grog
name = "Ye Olde Grogge"
desc = "The dusty glass bottle has caustic fumes wafting out of it. You're not sure drinking it is a good idea."
icon_state = "moonshine"
heal_amt = 0
initial_volume = 60
module_research = list("vice" = 5)
New()
..()
reagents.add_reagent("grog", 60)
/obj/item/reagent_containers/food/drinks/bottle/mead
name = "Mead"
desc = "A pillager's tipple."
icon_state = "bottle-barf"
heal_amt = 1
g_amt = 40
bottle_style = "barf"
label = "alcohol5"
initial_volume = 50
module_research = list("vice" = 5)
module_research_type = /obj/item/reagent_containers/food/drinks/bottle/beer
New()
..()
reagents.add_reagent("mead", 30)
/obj/item/reagent_containers/food/drinks/bottle/vintage
name = "2010 Vintage"
desc = "A bottle marked '2010 Vintage'. ...wait, this isn't wine..."
icon_state = "bottle-barf"
heal_amt = 1
g_amt = 40
bottle_style = "barf"
label = "alcohol5"
initial_volume = 50
module_research = list("vice" = 2)
New()
..()
reagents.add_reagent("urine", 30)
/obj/item/reagent_containers/food/drinks/bottle/vodka
name = "Vodka"
desc = "Russian stuff. Pretty good quality."
icon_state = "bottle-vodka"
bottle_style = "vodka"
fluid_style = "vodka"
label = "none"
heal_amt = 1
g_amt = 60
initial_volume = 50
module_research = list("vice" = 5)
module_research_type = /obj/item/reagent_containers/food/drinks/bottle/beer
New()
..()
reagents.add_reagent("vodka", 30)
/obj/item/reagent_containers/food/drinks/bottle/vodka/vr
icon_state = "vr_vodka"
bottle_style = "vr_vodka"
/obj/item/reagent_containers/food/drinks/bottle/tequila
name = "Tequila"
desc = "Guadalajara is a crazy place, man, lemme tell you."
icon_state = "bottle-tequila"
bottle_style = "tequila"
fluid_style = "none"
label = "none"
heal_amt = 1
g_amt = 60
initial_volume = 50
module_research = list("vice" = 5)
module_research_type = /obj/item/reagent_containers/food/drinks/bottle/beer
New()
..()
reagents.add_reagent("tequila", 30)
/obj/item/reagent_containers/food/drinks/bottle/gin
name = "Gin"
desc = "Gin is technically just a kind of alcohol that tastes strongly of juniper berries. Would juniper-flavored vodka count as a gin?"
icon_state = "bottle-gin"
bottle_style = "gin"
fluid_style = "gin"
label = "gin"
heal_amt = 1
g_amt = 60
initial_volume = 50
module_research = list("vice" = 5)
module_research_type = /obj/item/reagent_containers/food/drinks/bottle/beer
New()
..()
reagents.add_reagent("gin", 30)
/obj/item/reagent_containers/food/drinks/bottle/ntbrew
name = "NanoTrasen Brew"
desc = "Jesus, how long has this even been here?"
icon_state = "bottle-vermouth"
bottle_style = "vermouth"
fluid_style = "vermouth"
label = "vermouth"
heal_amt = 1
g_amt = 60
initial_volume = 250
module_research = list("vice" = 2)
New()
..()
reagents.add_reagent("wine", 40)
reagents.add_reagent("charcoal", 20)
/obj/item/reagent_containers/food/drinks/bottle/thegoodstuff
name = "Stinkeye's Special Reserve"
desc = "An old bottle labelled 'The Good Stuff'. This probably has enough kick to knock an elephant on its ass."
icon_state = "bottle-whiskey"
bottle_style = "whiskey"
fluid_style = "whiskey"
label = "whiskey"
heal_amt = 1
g_amt = 60
initial_volume = 250
module_research = list("vice" = 10)
New()
..()
reagents.add_reagent("beer", 30)
reagents.add_reagent("wine", 30)
reagents.add_reagent("cider", 30)
reagents.add_reagent("vodka", 30)
reagents.add_reagent("ethanol", 30)
reagents.add_reagent("eyeofnewt", 30);
/obj/item/reagent_containers/food/drinks/bottle/bojackson
name = "Bo Jack Daniel's"
desc = "Bo knows how to get you drunk, by diddley!"
icon_state = "bottle-spicedrum"
bottle_style = "spicedrum"
fluid_style = "none"
label = "none"
heal_amt = 1
g_amt = 40
initial_volume = 60
module_research = list("vice" = 5)
module_research_type = /obj/item/reagent_containers/food/drinks/bottle/beer
New()
..()
reagents.add_reagent("bojack", 60)
/obj/item/reagent_containers/food/drinks/moonshine
name = "Jug of Moonshine"
desc = "A jug of an illegaly brewed alchoholic beverage, which is quite potent."
icon_state = "moonshine"
heal_amt = 1
rc_flags = RC_FULLNESS
initial_volume = 250
module_research = list("vice" = 100)
New()
..()
reagents.add_reagent("moonshine", 250)
// nicknacks for making fancy drinks
/obj/item/cocktail_stuff
name = "cocktail doodad"
desc = "Some kinda li'l thing to put in a cocktail. How are you seeing this?"
icon = 'icons/obj/drink.dmi'
flags = FPRINT | TABLEPASS
var/food = 0
w_class = 1.0
attack(mob/M as mob, mob/user as mob)
if (!src.food)
return
if (user == M)
boutput(user, "<span style=\"color:red\">You eat [src]. Yum!</span>")
user.visible_message("<b>[user]</b> eats [src].")
else
boutput(M, "<span style=\"color:red\">You eat [src]. Yum!</span>")
user.visible_message("<span style=\"color:red\"><b>[user]</b> sticks [src] into [M]'s mouth.</span>")
playsound(usr.loc,"sound/items/eatfood.ogg", rand(10,50), 1)
qdel(src)
..()
drink_umbrella
name = "drink umbrella"
desc = "A tiny little umbrella, to put into drinks. I guess it makes you feel like you're on the beach, even when you're actually in a vomit-, piss- and blood-covered bar in the middle of some shitty dump of a space station. Maybe."
var/umbrella_color = null
New()
..()
umbrella_color = rand(1,6)
update_icon()
proc/update_icon()
if (umbrella_color)
icon_state = "cocktail-umbrella[umbrella_color]"
return
maraschino_cherry
name = "maraschino cherry"
desc = "A sweet, vibrantly red little cherry, which has been preserved in maraschino liquer, which is made from maraschino cherries. Huh."
icon_state = "cocktail-cherry"
food = 1
cocktail_olive
name = "cocktail olive"
desc = "An olive on a toothpick, to put in a drink. I dunno what this accomplishes for the taste of the drink, but hey, you get an olive to eat."
icon_state = "cocktail-olive"
food = 1
celery
name = "celery stick"
desc = "A stick of celery. Does not feature ants. Unless you leave it on the floor, but those would probably not be very tasty. I dunno, though, I've never eaten an ant. They might be delicious."
icon_state = "cocktail-celery"
food = 1
+330
View File
@@ -0,0 +1,330 @@
/obj/item/reagent_containers/food/snacks/breadloaf
name = "loaf of bread"
desc = "I'm loafin' it!"
icon = 'icons/obj/foodNdrink/food_bread.dmi'
icon_state = "breadloaf"
amount = 1
heal_amt = 1
food_color = "#FFFFCC"
real_name = "bread"
var/slicetype = /obj/item/reagent_containers/food/snacks/breadslice
initial_volume = 30
attack(mob/M as mob, mob/user as mob, def_zone)
if (user == M)
boutput(user, "<span style=\"color:red\">You can't just cram that in your mouth, you greedy beast!</span>")
user.visible_message("<b>[user]</b> stares at [src] in a confused manner.")
return
else
user.visible_message("<span style=\"color:red\"><b>[user]</b> futilely attempts to shove [src] into [M]'s mouth!</span>")
return
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/axe) || istype(W, /obj/item/circular_saw) || istype(W, /obj/item/kitchen/utensil/knife) || istype(W, /obj/item/scalpel) || istype(W, /obj/item/sword) || istype(W,/obj/item/knife_butcher))
if(user.bioHolder.HasEffect("clumsy") && prob(50))
user.visible_message("<span style=\"color:red\"><b>[user]</b> fumbles and jabs \himself in the eye with [W].</span>")
user.change_eye_blurry(5)
user.weakened = max(3, user.weakened)
return
var/turf/T = get_turf(src)
user.visible_message("[user] cuts [src] into slices.", "You cut [src] into slices.")
var/makeslices = 6
while (makeslices > 0)
new slicetype (T)
makeslices -= 1
qdel (src)
else ..()
New()
..()
reagents.add_reagent("bread", 30)
/obj/item/reagent_containers/food/snacks/breadloaf/honeywheat
name = "loaf of honey-wheat bread"
desc = "A bread made with honey. Right there in the name, first thing, top billing."
icon_state = "honeyloaf"
amount = 1
heal_amt = 1
real_name = "honey-wheat bread"
slicetype = /obj/item/reagent_containers/food/snacks/breadslice/honeywheat
/obj/item/reagent_containers/food/snacks/breadloaf/banana
name = "loaf of banana bread"
desc = "A bread commonly found near clowns."
icon_state = "bananabread"
amount = 1
heal_amt = 1
real_name = "banana bread"
slicetype = /obj/item/reagent_containers/food/snacks/breadslice/banana
/obj/item/reagent_containers/food/snacks/breadloaf/brain
name = "loaf of brain bread"
desc = "A pretty smart way to eat."
icon_state = "brainbread"
amount = 1
heal_amt = 1
real_name = "brain bread"
slicetype = /obj/item/reagent_containers/food/snacks/breadslice/brain
/obj/item/reagent_containers/food/snacks/breadloaf/pumpkin
name = "loaf of pumpkin bread"
desc = "A very seasonal quickbread! It tastes like Fall."
icon_state = "pumpkinbread"
amount = 1
heal_amt = 1
real_name = "pumpkin bread"
slicetype = /obj/item/reagent_containers/food/snacks/breadslice/pumpkin
/obj/item/reagent_containers/food/snacks/breadloaf/elvis
name = "loaf of elvis bread"
desc = "Fattening and delicious, despite the hair. It tastes like the soul of rock and roll."
icon_state = "elvisbread"
amount = 1
heal_amt = 1
real_name ="elvis bread"
slicetype = /obj/item/reagent_containers/food/snacks/breadslice/elvis
/obj/item/reagent_containers/food/snacks/breadloaf/spooky
name = "loaf of dread"
desc = "The bread of the damned."
icon_state = "dreadloaf"
amount = 1
heal_amt = 1
real_name = "dread"
slicetype = /obj/item/reagent_containers/food/snacks/breadslice/spooky
/obj/item/reagent_containers/food/snacks/breadloaf/corn
name = "southern-style cornbread"
desc = "A maize-based quickbread. This variety, popular in the Southern United States, is not particularly sweet."
icon_state= "cornbread"
amount = 1
heal_amt = 1
real_name = "cornbread"
slicetype = /obj/item/reagent_containers/food/snacks/breadslice/corn
sweet
name = "northern-style cornbread"
desc = "A chunk of sweet maize-based quickbread."
slicetype = /obj/item/reagent_containers/food/snacks/breadslice/corn/sweet
honey
name = "honey cornbread"
desc = "A chunk of honey-sweetened maize-based quickbread."
slicetype = /obj/item/reagent_containers/food/snacks/breadslice/corn/sweet/honey
/obj/item/reagent_containers/food/snacks/breadslice
name = "slice of bread"
desc = "That's slice."
icon = 'icons/obj/foodNdrink/food_bread.dmi'
icon_state = "breadslice"
amount = 1
heal_amt = 1
food_color = "#FFFFCC"
real_name = "bread"
honeywheat
name = "slice of honey-wheat bread"
desc = "A slice of bread distinguished by the use of honey in its creation. Also wheat."
icon_state = "honeyslice"
real_name = "honey-wheat bread"
food_color = "#C07D1E"
banana
name = "slice of banana bread"
desc = "It's a slice. A slice of banana bread."
icon_state = "bananabreadslice"
amount = 1
heal_amt = 4
real_name = "banana bread"
food_color = "#633821"
brain
name = "slice of brain bread"
desc = "A slice of bread that may or may not be plotting world domination."
icon_state = "brainbreadslice"
amount = 1
heal_amt = 3
real_name = "brain bread"
food_color = "#DD90A3"
pumpkin
name = "slice of pumpkin bread"
desc = "A slice of a festive seasonal bread, vaguely like eating a loaf of pumpkin pie."
icon_state = "pumpkinbreadslice"
amount = 1
heal_amt = 5
real_name = "pumpkin bread"
food_color = "#D99C1B"
elvis
name = "slice of elvis bread"
desc = "A slice of the most incredible bread you have ever seen."
icon_state = "elvisslice"
amount = 1
heal_amt = 6
real_name = "elvis bread"
initial_volume = 30
New()
..()
reagents.add_reagent("essenceofelvis",25)
spooky
name = "slice of dread"
desc = "A slice of the scariest bread imaginable, even scarier than the buns on a microwaved vending machine hamburger."
icon_state = "dreadslice"
amount = 1
heal_amt = 2
real_name = "dread"
initial_volume = 30
New()
..()
reagents.add_reagent("ectoplasm",10)
corn
name = "piece of southern cornbread"
desc = "A chunk of maize-based quickbread. This variety, popular in the Southern United States, is not particularly sweet."
icon_state = "cornbreadslice"
heal_amt = 3
real_name = "cornbread"
food_color = "#BAAC2C"
corn/sweet
name = "piece of northern cornbread"
desc = "A chunk of sweet maize-based quickbread."
initial_volume = 25
New()
..()
reagents.add_reagent("cornsyrup",5)
corn/sweet/honey
name = "piece of honey cornbread"
initial_volume = 25
New()
..()
reagents.add_reagent("honey",10)
New()
..()
src.pixel_x += rand(-3,3)
src.pixel_y += rand(-3,3)
/obj/item/reagent_containers/food/snacks/breadslice/New()
..()
var/datum/reagents/R = new/datum/reagents(5)
reagents = R
R.my_atom = src
R.add_reagent("bread", 5)
/obj/item/reagent_containers/food/snacks/breadslice/toastslice
name = "slice of toast"
desc = "Crispy cooked bread."
icon = 'icons/obj/foodNdrink/food_bread.dmi'
icon_state = "toast"
amount = 2
heal_amt = 1
food_color = "#CC9966"
real_name = "toast"
banana
name = "slice of banana toast"
desc = "A less conventional form of crispy bread."
icon_state = "bananatoast"
amount = 2
heal_amt = 4
brain
name = "slice of brain toast"
desc = "Historians believe that brain toast originated due to a garbled request for crispy bread made from wheat bran."
icon_state = "braintoast"
amount = 2
heal_amt = 3
real_name = "brain toast"
elvis
name = "slice of elvis toast"
desc = "Just when you thought Elvis couldn't get any hotter."
icon_state = "elvistoast"
amount = 2
heal_amt = 5
real_name = "elvis toast"
initial_volume = 25
New()
..()
reagents.add_reagent("essenceofelvis",25)
spooky
name = "slice of terror toast"
desc = "It's scarier than regular toast. That doesn't really say much unless you are going low-carb though."
icon_state = "terrortoast"
amount = 2
heal_amt = 2
real_name = "terror toast"
New()
..()
src.pixel_x += rand(-3,3)
src.pixel_y += rand(-3,3)
/obj/item/reagent_containers/food/snacks/toastcheese
name = "cheese on toast"
desc = "A quick cheesy snack."
icon = 'icons/obj/foodNdrink/food_bread.dmi'
icon_state = "cheesetoast"
amount = 2
heal_amt = 2
food_color = "#CC9966"
real_name = "toast cheese"
elvis
name = "cheese on elvis toast"
desc = "The king of cheesy toast."
icon_state = "cheesyelvis"
amount = 3
heal_amt = 6
real_name = "elvis cheese toast"
initial_volume = 30
New()
..()
reagents.add_reagent("essenceofelvis",25)
New()
..()
src.pixel_x += rand(-3,3)
src.pixel_y += rand(-3,3)
/obj/item/reagent_containers/food/snacks/toastbacon
name = "bacon on toast"
desc = "Is this a real snack anywhere? Honestly?"
icon = 'icons/obj/foodNdrink/food_bread.dmi'
icon_state = "bacontoast"
amount = 2
heal_amt = 3
food_color = "#CC9966"
real_name = "bacon toast"
initial_volume = 30
elvis
name = "bacon on elvis toast"
desc = "Oh, come on. That just does not look healthy."
icon_state = "baconelvis"
amount = 3
heal_amt = 4
real_name ="bacon elvis toast"
New()
..()
reagents.add_reagent("essenceofelvis",25)
New()
..()
src.pixel_x += rand(-3,3)
src.pixel_y += rand(-3,3)
reagents.add_reagent("porktonium", 5)
+209
View File
@@ -0,0 +1,209 @@
/obj/item/reagent_containers/food/snacks/yellow_cake_uranium_cake
name = "yellow cake"
desc = "A decent yellow cake that seems to be glowing a bit. Is this safe?"
icon = 'icons/obj/foodNdrink/food_dessert.dmi'
icon_state = "yellowcake"
w_class = 1
amount = 1
heal_amt = 2
initial_volume = 5
New()
..()
src.reagents.add_reagent("uranium", 5)
/obj/item/reagent_containers/food/snacks/cake/
name = "sponge cake"
desc = "A plain sponge cake. Could be better, could be worse."
icon = 'icons/obj/foodNdrink/food_dessert.dmi'
icon_state = "cake_batter"
amount = 12
heal_amt = 2
custom_food = 0
w_class = 3
/obj/item/reagent_containers/food/snacks/cake/custom
name = "cake"
desc = "a cake"
icon_state = "cake"
amount = 10
heal_amt = 2
var/icing = 0
var/sliced = 0
var/icing_color = "#FFFFFF"
flags = FPRINT | TABLEPASS | NOSPLASH
initial_volume = 100
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/axe) || istype(W, /obj/item/circular_saw) || istype(W, /obj/item/kitchen/utensil/knife) || istype(W, /obj/item/scalpel) || istype(W, /obj/item/sword) || istype(W,/obj/item/saw) || istype(W,/obj/item/knife_butcher))
if (src.sliced == 1)
boutput(user, "<span style=\"color:red\">This has already been sliced.</span>")
return
if (!icing)
boutput(user, "<span style=\"color:red\">You need to add icing first!</span>")
return
boutput(user, "<span style=\"color:blue\">You cut the cake into slices.</span>")
var/makeslices = src.amount
while (makeslices > 0)
var/obj/item/reagent_containers/food/snacks/cake/custom/P = new src.type(get_turf(src))
P.sliced = 1
P.amount = 1
P.w_class = 1
P.icon_state = "cake_slice"
P.quality = src.quality
P.name = src.name
P.desc = src.desc
P.food_color = src.food_color
P.update_icon(1)
P.icing_color = src.icing_color
P.update_icing(1)
src.reagents.trans_to(P, src.reagents.total_volume/makeslices)
P.pixel_x = rand(-6, 6)
P.pixel_y = rand(-6, 6)
makeslices--
qdel (src)
if(istype(W, /obj/item/reagent_containers/glass/bottle/icing) && !(icing) &&(!sliced) && (W.reagents.total_volume))
if(W.reagents.total_volume == 50)
boutput(user, "<span style=\"color:blue\">You add the icing to the cake.</span>")
icing = 1
src.desc += "<br>It has " + W.reagents.get_master_reagent_name() + " icing."
icing_color = W.reagents.get_master_color()
src.update_icing(0)
W.reagents.trans_to(src, W.reagents.total_volume)
else
boutput(user, "<span style=\"color:red\">The icing tube must be full!</span>")
else
..()
attack(mob/M as mob, mob/user as mob, def_zone)
if (!src.sliced)
if (user == M)
boutput(user, "<span style=\"color:red\">You can't just cram that in your mouth, you greedy beast!</span>")
user.visible_message("<b>[user]</b> stares at [src] in a confused manner.")
return
else
user.visible_message("<span style=\"color:red\"><b>[user]</b> futilely attempts to shove [src] into [M]'s mouth!</span>")
return
else
..()
//Update the base cake icon
proc/update_icon(var/num)
if(num== 0)
var/icon/I = new /icon('icons/obj/foodNdrink/food_dessert.dmi',"cake")
I.Blend(food_color, ICON_ADD)
src.icon = I
else
var/icon/I = new /icon('icons/obj/foodNdrink/food_dessert.dmi',"cake_slice")
I.Blend(food_color, ICON_ADD)
src.icon = I
//Update the icing sprite
proc/update_icing(var/num)
if(num == 0)
var/icon/I = new /icon('icons/obj/foodNdrink/food_dessert.dmi', "cake_icing")
I.Blend(icing_color, ICON_ADD)
src.overlays += I
else
var/icon/I = new /icon('icons/obj/foodNdrink/food_dessert.dmi', "cake_slice_icing")
I.Blend(icing_color, ICON_ADD)
src.overlays += I
/obj/item/reagent_containers/food/snacks/cake/batter
name = "cake batter"
desc = "An uncooked bit of cake batter. Eating it like this won't be very nice."
icon_state = "cake_batter"
amount = 12
heal_amt = 1
var/obj/item/reagent_containers/custom_item
initial_volume = 50
/obj/item/reagent_containers/food/snacks/cake/cream
name = "cream sponge cake"
desc = "Mmm! A delicious-looking cream sponge cake!"
icon_state = "cake_cream"
amount = 12
heal_amt = 2
initial_volume = 50
New()
..()
reagents.add_reagent("sugar", 30)
/obj/item/reagent_containers/food/snacks/cake/chocolate
name = "chocolate sponge cake"
desc = "Mmm! A delicious-looking chocolate sponge cake!"
icon_state = "cake_chocolate"
amount = 12
heal_amt = 3
initial_volume = 50
New()
..()
reagents.add_reagent("chocolate", 50)
/obj/item/reagent_containers/food/snacks/cake/meat
name = "meat cake"
desc = "Uh... well... wow. What is this?"
var/hname = ""
var/job = null
icon_state = "cake_meat"
amount = 12
heal_amt = 3
initial_volume = 50
New()
..()
reagents.add_reagent("blood", 50)
/obj/item/reagent_containers/food/snacks/cake/bacon
name = "bacon cake"
desc = "This...this is just terrible."
icon_state = "cake_bacon"
amount = 12
heal_amt = 4
initial_volume = 250
New()
..()
reagents.add_reagent("porktonium", 250)
heal(var/mob/M)
M.nutrition += 500
return
/obj/item/reagent_containers/food/snacks/cake/downs
name = "droopy cake"
desc = "This cake looks all weird and droopy."
icon_state = "cake_downs"
amount = 12
heal_amt = 4
initial_volume = 250
New()
..()
reagents.add_reagent("downbrosia", 250)
heal(var/mob/M)
M.nutrition += 500
return
/obj/item/cake_item
name = "cream sponge cake"
desc = "Mmm! A delicious-looking cream sponge cake! There's a lump in it..."
icon = 'icons/obj/foodNdrink/food_dessert.dmi'
inhand_image_icon = 'icons/mob/inhand/hand_food.dmi'
icon_state = "cake_cream"
/obj/item/cake_item/attack(target as mob, mob/user as mob)
var/iteminside = src.contents.len
if(!iteminside)
boutput(user, "<span style=\"color:red\">The cake crumbles away!</span>")
qdel(src)
boutput(user, "<span style=\"color:blue\">You bite down on something odd! You open up the cake...</span>")
for(var/obj/item/I in src.contents)
I.set_loc(user.loc)
I.add_fingerprint(user)
qdel(src)
return
+219
View File
@@ -0,0 +1,219 @@
// Condiments
/obj/item/reagent_containers/food/snacks/condiment
name = "condiment"
desc = "you shouldnt be able to see this"
icon = 'icons/obj/foodNdrink/food_ingredient.dmi'
amount = 1
heal_amt = 0
heal(var/mob/M)
boutput(M, "<span style=\"color:red\">It's just not good enough on its own...</span>")
afterattack(atom/target, mob/user, flag)
if (istype(target, /obj/item/reagent_containers/food/snacks/))
user.visible_message("<span style=\"color:blue\">[user] adds [src] to [target].</span>", "<span style=\"color:blue\">You add [src] to [target].</span>")
if (src.reagents)
src.reagents.trans_to(target, 100)
qdel (src)
else return
/obj/item/reagent_containers/food/snacks/condiment/ironfilings
name = "iron filings"
desc = "You probably shouldn't eat these."
icon_state = "ironfilings"
heal_amt = 0
amount = 1
/obj/item/reagent_containers/food/snacks/condiment/ketchup
name = "ketchup"
desc = "Pureéd tomatoes as a sauce."
icon_state = "ketchup"
initial_volume = 30
New()
..()
reagents.add_reagent("ketchup", 20)
/obj/item/reagent_containers/food/snacks/condiment/syrup
name = "maple syrup"
desc = "Made with real artificial maple syrup!"
icon_state = "syrup"
/obj/item/reagent_containers/food/snacks/condiment/mayo
name = "mayonnaise"
desc = "The subject of many a tiresome innuendo."
icon_state = "cookie_light"
/obj/item/reagent_containers/food/snacks/condiment/hotsauce
name = "hot sauce"
desc = "Dangerously spicy!"
icon_state = "hot_sauce"
initial_volume = 100
New()
..()
reagents.add_reagent("capsaicin", 100)
/obj/item/reagent_containers/food/snacks/condiment/coldsauce
name = "cold sauce"
desc = "This isn't very hot at all!"
icon_state = "cold_sauce"
initial_volume = 100
New()
..()
reagents.add_reagent("cryostylane", 100)
/obj/item/reagent_containers/food/snacks/condiment/hotsauce/ghostchilisauce
name = "incredibly hot sauce"
desc = "Extraordinarily spicy!"
icon_state = "hot_sauce"
initial_volume = 100
New()
..()
reagents.add_reagent("ghostchilijuice", 50)
/obj/item/reagent_containers/food/snacks/condiment/syndisauce
name = "syndicate sauce"
desc = "Traitorous tang."
icon_state = "cold_sauce"
initial_volume = 100
New()
..()
reagents.add_reagent("amanitin", 50)
/obj/item/reagent_containers/food/snacks/condiment/cream
name = "cream"
desc = "Not related to any kind of crop."
icon_state = "cookie_light"
food_color = "#F8F8F8"
/obj/item/reagent_containers/food/snacks/condiment/custard
name = "custard"
desc = "A perennial favourite of clowns."
icon_state = "custard"
needspoon = 1
amount = 2
heal_amt = 3
/obj/item/reagent_containers/food/snacks/condiment/chocchips
name = "chocolate chips"
desc = "Mmm! Little bits of chocolate! Or rabbit droppings. Either or."
icon_state = "chocchips"
amount = 5
heal_amt = 1
initial_volume = 10
New()
..()
reagents.add_reagent("chocolate", 10)
afterattack(atom/target, mob/user, flag)
if (istype(target, /obj/item/reagent_containers/food/snacks/) && src.reagents) //Wire: fix for Cannot execute null.trans to()
user.visible_message("<span style=\"color:blue\">[user] sprinkles [src] onto [target].</span>", "<span style=\"color:blue\">You sprinkle [src] onto [target].</span>")
src.reagents.trans_to(target, 20)
qdel (src)
else return
/obj/item/shaker
name = "shaker"
desc = "A little bottle for shaking things onto other things."
icon = 'icons/obj/food.dmi'
icon_state = "shaker"
flags = FPRINT | TABLEPASS
w_class = 2.0
g_amt = 10
var/stuff = null
var/shakes = 0
var/myVerb = "shake"
afterattack(atom/A, mob/user as mob)
if (istype(A, /obj/item/reagent_containers/food))
A.reagents.add_reagent("[src.stuff]", 2)
src.shakes ++
user.show_text("You put some [src.stuff] onto [A].")
else
return ..()
attack(mob/M as mob, mob/user as mob)
if (src.shakes >= 15)
user.show_text("[src] is empty!", "red")
return
if (ishuman(M))
var/mob/living/carbon/human/H = M
if ((H.head && H.head.c_flags & COVERSEYES) || (H.wear_mask && H.wear_mask.c_flags & COVERSEYES) || (H.glasses && H.glasses.c_flags & COVERSEYES))
H.tri_message("<span style=\"color:red\"><b>[user]</b> uselessly [myVerb]s some [src.stuff] onto [H]'s headgear!</span>",\
H, "<span style=\"color:red\">[H == user ? "You uselessly [myVerb]" : "[user] uselessly [myVerb]s"] some [src.stuff] onto your headgear! Okay then.</span>",\
user, "<span style=\"color:red\">You uselessly [myVerb] some [src.stuff] onto [user == H ? "your" : "[H]'s"] headgear![user == H ? " Okay then." : null]</span>")
src.shakes ++
return
else if (src.stuff == "salt")
H.tri_message("<span style=\"color:red\"><b>[user]</b> [myVerb]s something into [H]'s eyes!</span>",\
H, "<span style=\"color:red\">[H == user ? "You [myVerb]" : "[user] [myVerb]s"] some salt into your eyes! <B>FUCK!</B></span>",\
user, "<span style=\"color:red\">You [myVerb] some salt into [user == H ? "your" : "[H]'s"] eyes![user == H ? " <B>FUCK!</B>" : null]</span>")
H.emote("scream")
random_brute_damage(user, 1)
src.shakes ++
return
else if (src.stuff == "pepper")
H.tri_message("<span style=\"color:red\"><b>[user]</b> [myVerb]s something onto [H]'s nose!</span>",\
H, "<span style=\"color:red\">[H == user ? "You [myVerb]" : "[user] [myVerb]s"] some pepper onto your nose! <B>Why?!</B></span>",\
user, "<span style=\"color:red\">You [myVerb] some pepper onto [user == H ? "your" : "[H]'s"] nose![user == H ? " <B>Why?!</B>" : null]</span>")
H.emote("sneeze")
src.shakes ++
for (var/i = 1, i <= 30, i++)
spawn(50*i)
if (H && prob(20)) //Wire: Fix for Cannot execute null.emote().
H.emote("sneeze")
return
else
H.tri_message("<span style=\"color:red\"><b>[user]</b> [myVerb]s some [src.stuff] at [H]'s head!</span>",\
H, "<span style=\"color:red\">[H == user ? "You [myVerb]" : "[user] [myVerb]s"] some [src.stuff] at your head! Fuck!</span>",\
user, "<span style=\"color:red\">You [myVerb] some [src.stuff] at [user == H ? "your" : "[H]'s"] head![user == H ? " Fuck!" : null]</span>")
src.shakes ++
return
else
return ..()
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/reagent_containers/))
if (W.reagents.has_reagent("[src.stuff]") && W.reagents.get_reagent_amount("[src.stuff]") >= 15)
user.show_text("You refill [src].", "blue")
W.reagents.remove_reagent("[src.stuff]", 15)
src.shakes = 0
return
else
user.show_text("There isn't enough [src.stuff] in here to refill [src]!", "red")
return
else
return ..()
salt
name = "salt shaker"
desc = "A little bottle for shaking things onto other things. It has some salt in it."
icon_state = "shaker-salt"
stuff = "salt"
pepper
name = "pepper shaker"
desc = "A little bottle for shaking things onto other things. It has some pepper in it."
icon_state = "shaker-pepper"
stuff = "pepper"
ketchup
name = "ketchup bottle"
desc = "A little bottle for putting condiments on stuff. It has some ketchup in it."
icon_state = "bottle-ketchup"
stuff = "ketchup"
myVerb = "squirt"
mustard
name = "mustard bottle"
desc = "A little bottle for putting condiments on stuff. It has some mustard in it."
icon_state = "bottle-mustard"
stuff = "mustard"
myVerb = "squirt"
+279
View File
@@ -0,0 +1,279 @@
/obj/item/reagent_containers/food/drinks/noodlecup
name = "Discount Dan's Quik-Noodles"
desc = "A self-heating cup of noodles. There's enough sodium in these to put the Dead Sea to shame."
icon_state = "noodlecup"
heal_amt = 1
var/activated = 0
initial_volume = 60
New()
..()
//ensure_reagent_holder()
var/datum/reagents/R = reagents
R.add_reagent("chickensoup", 10)
if (prob(75))
R.add_reagent("grease", 1)
else
R.add_reagent("badgrease",1)
R.add_reagent("msg",9)
R.add_reagent("salt",10)
R.add_reagent("nicotine",8)
switch( rand(1, 14))
if (1)
name = "Discount Dan's Quik-Noodles - Gamer Grubs Flavor"
R.add_reagent("yuck", 10)
R.add_reagent("potassium",5)
if (2)
name = "Discount Deng's Quik-Noodles - Teriyaki TVP Flavor"
R.add_reagent("synthflesh",5)
R.add_reagent("msg",5)
if (3)
name = "Discount Dan's Quik-Noodles - Macaroni and Imitation Processed Cheese Product Flavor"
R.add_reagent("fakecheese",2)
R.add_reagent("grease",8)
if (4)
name = "Comrade Dan's Quik-Noodles - Beef Perestroikanoff Flavor"
R.add_reagent("milk",3)
R.add_reagent("denatured_enzyme",3)
R.add_reagent("beff",4)
if (5)
name = "Pirate Dan's Quik-Noodles - Spicy Imitation Crab Meat Paste Flavor"
R.add_reagent("synthflesh",3)
R.add_reagent("saltpetre",3)
R.add_reagent("capsaicin",14)
if (6)
name = "Frycook Dan's Quik-Noodles - Mushroom-Swiss Burger-Bake Flavor"
R.add_reagent("beff",2)
R.add_reagent("gcheese",2)
R.add_reagent("psilocybin",6)
if (7)
name = "Discount Deng's Quik-Noodles - Sweet and Sour Lo Mein Flavor"
R.add_reagent("acid",3)
R.add_reagent("VHFCS",7)
if (8)
name = "Descuento Danito's Quik-Noodles - Tuna Melt Taco Fiesta Flavor"
R.add_reagent("fakecheese",3)
R.add_reagent("mercury",3)
R.add_reagent("capsaicin",4)
if (9)
name = "Sconto Danilo's Quik-Noodles - Italian Strozzapreti Lunare Flavor"
R.add_reagent("juice_tomato",4) //I guess the lunar style of pasta is with a tomato wine red sauce
R.add_reagent("wine",2)
R.add_reagent("water_holy",2)
R.add_reagent("venom",2)
if (10)
name = "Rabatt Dan's Snabb-Nudlar - Inkokt Lax Smörgåsbord Smak"
R.add_reagent("cleaner",2)
R.add_reagent("mercury",2)
R.add_reagent("swedium",6)
if (11)
name = "Frycook Dan's Quik-Noodles - Curly Fry Ketchup Hoedown Flavor"
R.add_reagent("juice_tomato",3)
R.add_reagent("mugwort",3)
R.add_reagent("capsaicin",3)
R.add_reagent("mashedpotatoes",3)
if (12)
name = "Morning Dan's Quik-Noodles - Mechanically Reclaimed Sausage Biscuit Flavor"
R.add_reagent("ammonia",3)
R.add_reagent("gravy",4)
R.add_reagent("badgrease",3)
R.add_reagent("coffee",3)
if (prob(5))
R.add_reagent("prions",2.5)
if (13)
name = "Devil Dan's Quik-Noodles - Brimstone BBQ Flavor"
R.add_reagent("sulfur",5)
R.add_reagent("beff",5)
R.add_reagent("ghostchilijuice",5)
if (14)
name = "Dessert Dan's Quik-Noodles - Sweet Sundae Noodle Flavor"
R.add_reagent("VHFCS", 10)
R.add_reagent("chocolate", 5)
R.add_reagent("vanilla", 2)
R.add_reagent("milk", 3)
attack_self(mob/user as mob)
if (activated)
return
src.activated = 1
if (reagents)
reagents.add_reagent("thalmerite",2)
reagents.add_reagent("oxygen", 2)
reagents.handle_reactions()
spawn(100)
reagents.del_reagent("thalmerite")
boutput(user, "The cup emits a soft clack as the heater triggers.")
return
/obj/item/reagent_containers/food/snacks/burrito
name = "Descuento Danito's Burritos"
desc = "A self-heating convenience reinterpretation of Mexican cuisine. The exact mechanism used to heat it is probably best left to speculation."
icon = 'icons/obj/foodNdrink/food_snacks.dmi'
icon_state = "burrito"
amount = 3
heal_amt = 2
doants = 0 //Ants aren't dumb enough to try to eat these.
var/activated = 0
initial_volume = 50
New()
..()
//ensure_reagent_holder()
var/datum/reagents/R = reagents
if (prob(75))
R.add_reagent("grease", 3)
else
R.add_reagent("badgrease",3)
R.add_reagent("msg",9)
switch(rand(1, 9))
if (1)
src.name = "Descuento Danito's Burritos - Beff and Bean Flavor"
R.add_reagent("uranium", 2)
R.add_reagent("beff", 4)
R.add_reagent("fakecheese",4)
R.add_reagent("refried_beans", 10)
if (2)
src.name = "Descuento Danito's Burritos - Strawberrito Churro Flavor"
desc = "There is no way anyone could possibly justify this."
R.add_reagent("VHFCS", 8)
R.add_reagent("oil", 2)
if (3)
src.name = "Descuento Danito's Burritos - Spicy Beans and Wieners Ole! Flavor"
R.add_reagent("lithium", 4)
R.add_reagent("capsaicin", 6)
R.add_reagent("refried_beans", 10)
if (4)
src.name = "Descuento Danito's Burritos - Pancake Sausage Brunch Flavor"
desc = "A self-heating breakfast burrito with a buttermilk pancake in lieu of a tortilla. A little frightening."
R.add_reagent("porktonium", 4)
R.add_reagent("VHFCS", 2)
R.add_reagent("coffee", 4)
if (5)
src.name = "Descuento Danito's Burritos - Homestyle Comfort Flavor"
desc = "A self-heating burrito just like Mom used to make, if your mother was a souless, automated burrito production line."
R.add_reagent("mashedpotatoes", 5)
R.add_reagent("gravy", 3)
R.add_reagent("diethylamine", 2)
if (6)
src.name = "Spooky Dan's BOO-ritos - Texas Toast Chainsaw Massacre Flavor"
desc = "A self-heating burrito. Isn't that concept scary enough on its own?"
R.add_reagent("fakecheese",3)
R.add_reagent("space_drugs",3)
R.add_reagent("bloodc",4)
if (7)
src.name = "Spooky Dan's BOO-ritos - Nightmare on Elm Meat Flavor"
desc = "A self-heating burrito that purports to contain elm-smoked meat. Of some sort. Probably from an animal."
R.add_reagent("beff",3)
R.add_reagent("synthflesh",2)
R.add_reagent("tongueofdog",5)
if (8)
src.name = "Sconto Danilo's Burritos - 50% Real Mozzarella Pepperoni Pizza Party Flavor"
desc = "A self-heating pizza burrito."
R.add_reagent("fakecheese",3)
R.add_reagent("cheese",3)
R.add_reagent("pepperoni",3)
if (9)
src.name = "Descuento Danito's Burritos - Inside Out Burrito"
desc = "You're not even really sure how to eat this."
icon_state = "burrito_rev"
R.add_reagent("reversium",5)
R.add_reagent("refried_beans", 10)
R.add_reagent("beff",3)
R.add_reagent("fakecheese",3)
attack_self(mob/user as mob)
if (activated)
return
if (prob(10) || user.bioHolder.HasEffect("hulk"))
user.visible_message("<span style=\"color:red\"><b>[user]</b> snaps the burrito in half!</span>", "<span style=\"color:red\">You accidentally snap the burrito apart. Fuck!</span>")
src.splat()
return
src.activated = 1
if (reagents)
reagents.add_reagent("thalmerite",2)
reagents.add_reagent("oxygen", 2)
reagents.handle_reactions()
boutput(user, "You crack the burrito like a glow stick, activating the heater mechanism.")
return
throw_impact(var/turf/T)
if (prob(10) && T)
src.splat()
else
..()
proc/splat()
var/turf/T = get_turf(src)
if(!locate(/obj/decal/cleanable/vomit) in T)
playsound(T, "sound/effects/splat.ogg", 50, 1)
var/obj/decal/cleanable/vomit/filling = new /obj/decal/cleanable/vomit(src)
var/icon/fillicon = icon(filling.icon, filling.icon_state)
fillicon.MapColors(0.50, 0.25, 0)
filling.icon = fillicon
filling.name = "burrito filling"
filling.desc = "The evacuated contents of a burrito."
filling.reagents = src.reagents
filling.set_loc(T)
qdel(src)
/obj/item/reagent_containers/food/snacks/snack_cake
name = "Little Danny's Snack Cake"
desc = "A highly-processed miniature cake, coated with a thin layer of solid pseudofrosting."
icon = 'icons/obj/foodNdrink/food_snacks.dmi'
icon_state = "snackcake"
amount = 2
heal_amt = 2
var/color_prob = 100
initial_volume = 50
golden
name = "Little Danny's Legally-Distinct Creme-Filled Snack Loaf"
desc = "A highly-processed miniature sponge cake, filled with some manner of creme."
icon_state = "snackcake2"
color_prob = 10
New()
..()
reagents.add_reagent("badgrease",3)
reagents.add_reagent("VHFCS",9)
pixel_x = rand(-3,3)
pixel_y = rand(-3,3)
var/i = 3
while(i-- > 0)
reagents.add_reagent(pick("beff","sugar","eggnog","chocolate","vanilla","cleaner","luminol","poo","urine","nicotine","weedkiller","venom","jenkem","ethanol","ectoplasm"), 5)
if (prob(color_prob))
var/icon/newicon = icon(src.icon, src.icon_state)
newicon.Blend( pick(rgb(0,0,255),rgb(204,0,102),rgb(255,255,0),rgb(51,153,0),rgb(219,161,40),rgb(84,32,0)) )
src.icon= newicon
+308
View File
@@ -0,0 +1,308 @@
// Drinks
/obj/item/reagent_containers/food/drinks/bottle/red
name = "Robust-Eez"
desc = "A carbonated robustness tonic. It has quite a kick."
label = "robust"
heal_amt = 1
labeled = 1
initial_volume = 50
New()
..()
reagents.add_reagent("methamphetamine", 3)
reagents.add_reagent("VHFCS", 10)
reagents.add_reagent("cola", 17)
/obj/item/reagent_containers/food/drinks/bottle/blue
name = "Grife-O"
desc = "The carbonated beverage of a space generation. Contains actual space dust!"
label = "grife"
labeled = 1
initial_volume = 50
New()
..()
reagents.add_reagent("radium", 3)
reagents.add_reagent("ephedrine", 6)
reagents.add_reagent("VHFCS", 10)
reagents.add_reagent("cola", 11)
/obj/item/reagent_containers/food/drinks/bottle/pink
name = "Dr. Pubber"
desc = "The beverage of an original crowd. Tastes like an industrial tranquilizer."
label = "pubber"
labeled = 1
initial_volume = 50
New()
..()
reagents.add_reagent("haloperidol", 4)
reagents.add_reagent("morphine", 4)
reagents.add_reagent("VHFCS", 10)
reagents.add_reagent("cola", 12)
/obj/item/reagent_containers/food/drinks/bottle/lime
name = "Lime-Aid"
desc = "Antihol mixed with lime juice. A well-known cure for hangovers."
label = "limeaid"
labeled = 1
initial_volume = 50
New()
..()
reagents.add_reagent("antihol", 20)
reagents.add_reagent("juice_lime", 20)
/obj/item/reagent_containers/food/drinks/bottle/spooky
name = "Spooky Dan's Runoff Cola"
desc = "A spoooky cola for Halloween! Rumors that Runoff Cola contains actual industrial runoff are unsubstantiated."
label = "spooky"
labeled = 1
initial_volume = 50
New()
..()
reagents.add_reagent("chlorine", 5)
reagents.add_reagent("phosphorus", 5)
reagents.add_reagent("mercury", 5)
reagents.add_reagent("VHFCS", 10)
reagents.add_reagent("cola", 15)
/obj/item/reagent_containers/food/drinks/bottle/spooky2
name = "Spooky Dan's Horrortastic Cola"
desc = "A terrifying Halloween soda. It's especially frightening if you're diabetic."
label = "spooky"
labeled = 1
initial_volume = 50
New()
..()
reagents.add_reagent("ectoplasm", 10)
reagents.add_reagent("sulfur", 5)
reagents.add_reagent("VHFCS", 5)
reagents.add_reagent("cola", 20)
/obj/item/reagent_containers/food/drinks/bottle/xmas
name = "Happy Elf Hot Chocolate"
desc = "Surprising to see this here, in a world of corporate plutocrat lunatics."
label = "choco"
labeled = 1
initial_volume = 50
New()
..()
reagents.add_reagent("chocolate", 45)
if(prob(10))
reagents.add_reagent("grognardium", 5)
/obj/item/reagent_containers/food/drinks/bottle/bottledwater
name = "Decirprevo Bottled Water"
desc = "Bottled from our cool natural springs on Europa."
label = "water"
labeled = 1
initial_volume = 50
New()
..()
reagents.add_reagent("iodine", 5)
reagents.add_reagent("water", 45)
/obj/item/reagent_containers/food/drinks/bottle/grones
name = "Grones Soda"
desc = "They make all kinds of flavors these days, good lord."
label = "grones"
heal_amt = 1
labeled = 1
initial_volume = 50
New()
..()
var/flavor = rand(1,14)
switch(flavor)
if(1)
src.desc = "Wicked Sick Pumpkin Prolapse flavor."
reagents.add_reagent("diarrhea", 10)
if(2)
src.desc = "Ballin' Banana Testicular Torsion flavor."
reagents.add_reagent("urine", 10)
if(3)
src.desc = "Radical Roadkill Rampage flavor."
reagents.add_reagent("bloodc", 10) // heh
if(4)
src.desc = "Sweet Cherry Brain Haemorrhage flavor."
reagents.add_reagent("impedrezine", 10)
if(5)
src.desc = "Awesome Asbestos Candy Apple flavor."
reagents.add_reagent("lithium", 10)
if(6)
src.desc = "Salt-Free Senile Dementia flavor."
reagents.add_reagent("mercury", 10)
if(7)
src.desc = "High Fructose Traumatic Stress Disorder flavor."
reagents.add_reagent("atropine", 10)
if(8)
src.desc = "Tangy Dismembered Orphan Tears flavor."
reagents.add_reagent("epinephrine", 10)
if(9)
src.desc = "Chunky Infected Laceration Salsa flavor."
reagents.add_reagent("charcoal", 10)
if(10)
src.desc = "Manic Depressive Multivitamin Dewberry flavor."
reagents.add_reagent("ephedrine", 10)
if(11)
src.desc = "Anti-Bacterial Air Freshener flavor."
reagents.add_reagent("spaceacillin", 10)
if(12)
src.desc = "Old Country Hay Fever flavor."
reagents.add_reagent("antihistamine", 10)
if(13)
src.desc = "Minty Restraining Order Pepper Spray flavor."
reagents.add_reagent("capsaicin", 10)
if(14)
src.desc = "Cool Keratin Rush flavor."
reagents.add_reagent("hairgrownium", 10)
reagents.add_reagent("cola", 20)
/obj/item/reagent_containers/food/drinks/bottle/orange
name = "Orange-Aid"
desc = "A vitamin tonic that promotes good eyesight and health."
label = "orangeaid"
heal_amt = 1
labeled = 1
initial_volume = 50
New()
..()
reagents.add_reagent("oculine", 20)
reagents.add_reagent("juice_orange", 20)
/obj/item/reagent_containers/food/drinks/water
name = "water bottle"
desc = "I wonder if this is still fresh?"
icon = 'icons/obj/items.dmi'
icon_state = "bottlewater"
item_state = "contliquid"
initial_volume = 50
New()
..()
reagents.add_reagent("water", 50)
/obj/item/reagent_containers/food/drinks/tea
name = "tea"
desc = "A fine cup of tea. Possibly Earl Grey. Temperature undetermined."
icon_state = "tea0"
item_state = "coffee"
initial_volume = 50
New()
..()
reagents.add_reagent("tea", 50)
/obj/item/reagent_containers/food/drinks/tea/mugwort
name = "mugwort tea"
desc = "Rumored to have mystical powers of protection.<br>It has a message written on it: 'To the world's greatest wizard - love, Dad'"
icon_state = "tea1"
initial_volume = 50
New()
..()
reagents.add_reagent("tea", 30)
reagents.add_reagent("mugwort",20)
/obj/item/reagent_containers/food/drinks/coffee
name = "Robust Coffee"
desc = "Careful, the beverage you're about to enjoy is extremely hot."
icon_state = "coffee"
heal_amt = 1
initial_volume = 50
module_research = list("vice" = 5)
New()
..()
reagents.add_reagent("coffee", 30)
/obj/item/reagent_containers/food/drinks/eggnog
name = "Egg Nog"
desc = "A festive beverage made with eggs. Please eat the eggs. Eat the eggs up."
icon_state = "nog"
heal_amt = 1
festivity = 1
rc_flags = RC_FULLNESS
initial_volume = 50
module_research = list("vice" = 5)
module_research_type = /obj/item/reagent_containers/food/drinks/bottle/beer
New()
..()
reagents.add_reagent("eggnog", 40)
/obj/item/reagent_containers/food/drinks/chickensoup
name = "Chicken Soup"
desc = "Got something to do with souls. Maybe. Do chickens even have souls?"
icon_state = "coffee"
heal_amt = 1
rc_flags = RC_FULLNESS | RC_VISIBLE | RC_SPECTRO
initial_volume = 50
New()
..()
reagents.add_reagent("chickensoup", 30)
/obj/item/reagent_containers/food/drinks/weightloss_shake
name = "Weight-Loss Shake"
desc = "A shake designed to cause weight loss. The package proudly proclaims that it is 'tapeworm free.'"
icon_state = "shake"
heal_amt = 1
rc_flags = RC_FULLNESS
initial_volume = 50
New()
..()
reagents.add_reagent("lipolicide", 30)
reagents.add_reagent("chocolate", 5)
/obj/item/reagent_containers/food/drinks/cola
name = "space cola"
desc = "Cola. in space."
icon_state = "cola"
heal_amt = 1
rc_flags = RC_FULLNESS
initial_volume = 50
New()
..()
reagents.add_reagent("cola", 20)
reagents.add_reagent("VHFCS", 10)
if(prob(50))
src.icon_state = "cola-blue"
/obj/item/reagent_containers/food/drinks/milk
name = "Creaca's Space Milk"
desc = "A bottle of fresh space milk from happy, free-roaming space cows."
icon_state = "milk"
heal_amt = 1
initial_volume = 50
New()
..()
reagents.add_reagent("milk", 50)
/obj/item/reagent_containers/food/drinks/milk/rancid
name = "Rancid Space Milk"
desc = "A bottle of rancid space milk. Better not drink this stuff."
icon_state = "milk"
heal_amt = 1
initial_volume = 50
New()
..()
reagents.add_reagent("milk", 25)
reagents.add_reagent("toxin", 25)
/obj/item/reagent_containers/food/drinks/milk/soy
name = "Creaca's Space Soy Milk"
desc = "A bottle of fresh space soy milk from happy, free-roaming space soybean plants. The plant pots just float around untethered."
+111
View File
@@ -0,0 +1,111 @@
/obj/item/reagent_containers/food/snacks/ice_cream_cone
name = "ice cream cone"
desc = "A cone designed in 1937 by members of FDR's brain trust. Its purpose? To hold as much ice cream as possible."
icon = 'icons/obj/foodNdrink/food_snacks.dmi'
icon_state = "icecream"
amount = 1
/obj/item/reagent_containers/food/snacks/ice_cream
name = "ice cream"
desc = "You scream, I scream, we all scream, but nobody hears it. This is space."
icon = 'icons/obj/foodNdrink/food_snacks.dmi'
icon_state = "icecream"
amount = 4
heal_amt = 4
food_color = null
initial_volume = 40
New()
..()
spawn(12)
var/icecream_name = src.reagents.get_master_reagent_name()
src.food_color = src.reagents.get_master_color()
if(icecream_name)
src.name ="[icecream_name]-flavored ice cream"
src.update_cone()
return
heal(var/mob/M)
..()
src.update_cone()
M.bodytemperature = min(M.base_body_temp, M.bodytemperature-20)
return
suicide(var/mob/user as mob)
var/icecount = 0
if(istype(user.l_hand,/obj/item/reagent_containers/food/snacks/ice_cream) && user.l_hand.amount)
var/obj/item/reagent_containers/food/snacks/ice_cream/I = user.l_hand
icecount += I.amount
I.amount = 1
I.update_cone()
if(istype(user.r_hand,/obj/item/reagent_containers/food/snacks/ice_cream) && user.r_hand.amount)
var/obj/item/reagent_containers/food/snacks/ice_cream/I = user.r_hand
icecount += I.amount
I.amount = 1
I.update_cone()
if(!icecount) return
user.visible_message("<span style=\"color:red\"><b>[user] eats the ice cream in one bite and collapses from brainfreeze.</b></span>")
user.TakeDamage("head", 0, 50 * icecount)
user.paralysis += icecount //in case the damage isn't enough to crit
user.bodytemperature -= 100
user.updatehealth()
spawn(100)
if (user)
user.suiciding = 0
return 1
proc/update_cone()
src.overlays.len = 0
var/cream_level = (100 * round(amount/initial(amount),0.25))
if(!food_color)
food_color = src.reagents.get_master_color()
var/icon/I = new /icon('icons/obj/foodNdrink/food_snacks.dmi',"ice[cream_level]")
I.Blend(food_color, ICON_ADD)
src.overlays += I
return
/obj/item/reagent_containers/food/snacks/ice_cream/gross
New()
..()
src.reagents.add_reagent("vomit", 40)
/obj/item/reagent_containers/food/snacks/ice_cream/random
New()
..()
spawn (10)
var/flavor = null
if (all_functional_reagent_ids.len > 1)
flavor = pick(all_functional_reagent_ids)
else
flavor = "vanilla"
src.reagents.add_reagent(flavor, 40)
/obj/item/reagent_containers/food/snacks/ice_cream/goodrandom
New()
..()
var/randreag = pick("coffee","chocolate","vanilla")
src.reagents.add_reagent(randreag, 40)
/obj/item/reagent_containers/food/snacks/yoghurt
name = "yoghurt"
desc = "A plain yoghurt."
icon = 'icons/obj/foodNdrink/food_snacks.dmi'
icon_state = "yoghurt"
needspoon = 1
amount = 6
heal_amt = 1
/obj/item/reagent_containers/food/snacks/yoghurt/frozen
name = "frozen yoghurt"
desc = "A delightful tub of frozen yoghurt."
heal_amt = 2
initial_volume = 30
New()
..()
reagents.add_reagent("cryostylane", 20)
+428
View File
@@ -0,0 +1,428 @@
// Ingredients
/obj/item/reagent_containers/food/snacks/ingredient/
name = "ingredient"
desc = "you shouldnt be able to see this"
icon = 'icons/obj/foodNdrink/food_ingredient.dmi'
amount = 1
heal_amt = 0
custom_food = 0
/obj/item/reagent_containers/food/snacks/ingredient/meat/
name = "raw meat"
desc = "you shouldnt be able to see this either!!"
icon_state = "meat"
amount = 1
heal_amt = 0
custom_food = 1
heal(var/mob/living/M)
if (prob(33))
boutput(M, "<span style=\"color:red\">You briefly think you probably shouldn't be eating raw meat.</span>")
M.contract_disease(/datum/ailment/disease/food_poisoning, null, null, 1) // path, name, strain, bypass resist
throw_impact(var/turf/T)
playsound(src.loc, "sound/effects/splat.ogg", 100, 1)
if (istype(T))
new /obj/decal/cleanable/blood(T)
..()
/obj/item/reagent_containers/food/snacks/ingredient/meat/humanmeat
name = "-meat"
desc = "A slab of meat."
var/subjectname = ""
var/subjectjob = null
amount = 1
/obj/item/reagent_containers/food/snacks/ingredient/meat/monkeymeat
name = "monkeymeat"
desc = "A slab of meat from a monkey."
amount = 1
/obj/item/reagent_containers/food/snacks/ingredient/meat/fish
name = "fish fillet"
desc = "A slab of meat from a fish."
icon_state = "fillet_pink"
amount = 1
food_color = "#FF6699"
real_name = "fish"
salmon
name = "salmon fillet"
icon_state = "fillet_orange"
food_color = "#FF9900"
real_name = "salmon"
white
name = "white fish fillet"
icon_state = "fillet_white"
food_color = "#FFFFFF"
real_name = "white fish"
/obj/item/reagent_containers/food/snacks/ingredient/meat/synthmeat
name = "synthmeat"
desc = "Synthetic meat grown in hydroponics."
amount = 1
/obj/item/reagent_containers/food/snacks/ingredient/meat/mysterymeat
name = "mystery meat"
desc = "What the fuck is this??"
icon_state = "mysterymeat"
amount = 1
/obj/item/reagent_containers/food/snacks/ingredient/meat/bacon
name = "bacon"
desc = "A strip of salty cured pork. Many disgusting nerds have a bizarre fascination with this meat, going so far as to construct tiny houses out of it."
icon_state = "bacon"
amount = 1
New()
..()
src.pixel_x += rand(-4,4)
src.pixel_y += rand(-4,4)
var/datum/reagents/R = new/datum/reagents(20)
reagents = R
R.my_atom = src
R.add_reagent("porktonium", 10)
heal(var/mob/M)
M.nutrition += 20
return
raw
name = "raw bacon"
desc = "A strip of salty raw cured pork. It really should be cooked first."
icon_state = "bacon_raw"
amount = 1
real_name = "bacon"
/obj/item/reagent_containers/food/snacks/ingredient/meat/mysterymeat/nugget
name = "chicken nugget"
desc = "A breaded wad of poultry, far too processed to have a more specific label than 'nugget.'"
icon = 'icons/obj/foodNdrink/food_ingredient.dmi'
icon_state = "nugget0"
amount = 2
New()
..()
src.pixel_x += rand(-4,4)
src.pixel_y += rand(-4,4)
var/datum/reagents/R = new/datum/reagents(15)
reagents = R
R.my_atom = src
heal(var/mob/M)
if (icon_state == "nugget0")
icon_state = "nugget1"
return ..()
/obj/item/reagent_containers/food/snacks/ingredient/egg
name = "egg"
desc = "An egg!"
icon_state = "egg"
food_color = "#FFFFFF"
initial_volume = 20
New()
..()
reagents.add_reagent("egg", 5)
throw_impact(var/turf/T)
src.visible_message("<span style=\"color:red\">[src] splats onto the floor messily!</span>")
playsound(src.loc, "sound/effects/splat.ogg", 100, 1)
new/obj/decal/cleanable/eggsplat(T)
qdel (src)
/obj/item/reagent_containers/food/snacks/ingredient/flour
name = "flour"
desc = "Some flour."
icon_state = "flour"
amount = 1
food_color = "#FFFFFF"
/obj/item/reagent_containers/food/snacks/ingredient/rice
name = "rice"
desc = "A sprig of rice. There's probably a decent amount in it, thankfully."
icon_state = "rice"
amount = 1
food_color = "#FFFFAA"
/obj/item/reagent_containers/food/snacks/ingredient/bean
name = "bean pod"
desc = "This bean pod contains an inordinately large amount of beans due to genetic engineering. How convenient."
icon_state = "beanpod"
amount = 1
food_color = "#CCFFCC"
/obj/item/reagent_containers/food/snacks/ingredient/sugar
name = "sugar"
desc = "How sweet."
icon_state = "sugar"
amount = 1
food_color = "#FFFFFF"
custom_food = 1
initial_volume = 50
brewable = 1
brew_result = "rum"
New()
..()
reagents.add_reagent("sugar", 25)
/obj/item/reagent_containers/food/snacks/ingredient/peanutbutter
name = "peanut butter"
desc = "A jar of GRIF peanut butter."
icon_state = "peanutbutter"
amount = 3
heal_amt = 1
food_color = "#996600"
custom_food = 1
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/reagent_containers/food/snacks/candy) && W.reagents && W.reagents.has_reagent("chocolate"))
if (istype(W, /obj/item/reagent_containers/food/snacks/candy/pbcup))
return
boutput(user, "You get chocolate in the peanut butter! Or maybe the other way around?")
var/obj/item/reagent_containers/food/snacks/candy/pbcup/A = new /obj/item/reagent_containers/food/snacks/candy/pbcup
user.u_equip(W)
user.put_in_hand_or_drop(A)
qdel(W)
if (src.amount-- < 1)
qdel(src)
else
..()
return
/obj/item/reagent_containers/food/snacks/ingredient/oatmeal
name = "oatmeal"
desc = "A breakfast staple."
icon_state = "oatmeal"
amount = 1
food_color = "#CC9966"
custom_food = 1
/obj/item/reagent_containers/food/snacks/ingredient/honey
name = "honey"
desc = "A sweet nectar derivative produced by bees."
icon_state = "honeyblob"
amount = 1
food_color = "#C0C013"
custom_food = 1
doants = 0
initial_volume = 50
brewable = 1
brew_result = "mead"
New()
..()
spawn(10)
if (!reagents.total_volume)
reagents.add_reagent("honey", 15)
/obj/item/reagent_containers/food/snacks/ingredient/royal_jelly
name = "royal jelly"
desc = "A blob of nutritive gel for larval bees."
icon_state = "jellyblob"
amount = 1
food_color = "#990066"
custom_food = 1
doants = 0
initial_volume = 50
New()
..()
spawn(10)
if (!reagents.total_volume)
reagents.add_reagent("royal_jelly", 25)
/obj/item/reagent_containers/food/snacks/ingredient/peeled_banana
name = "peeled banana"
icon = 'icons/obj/foodNdrink/food_produce.dmi'
icon_state = "banana_fruit"
/obj/item/reagent_containers/food/snacks/ingredient/cheese
name = "cheese"
desc = "Some kind of curdled milk product."
icon_state = "cheese"
amount = 2
heal_amt = 1
food_color = "#FFD700"
custom_food = 1
/obj/item/reagent_containers/food/snacks/ingredient/gcheese
name = "weird cheese"
desc = "Some kind of... gooey, messy, gloopy thing. Similar to cheese, but only in the looser sense of the word."
icon_state = "gcheese"
amount = 2
heal_amt = 1
food_color = "#669966"
custom_food = 1
initial_volume = 50
New()
..()
reagents.add_reagent("mercury", 5)
reagents.add_reagent("LSD", 5)
reagents.add_reagent("ethanol", 5)
reagents.add_reagent("gcheese", 5)
/obj/item/reagent_containers/food/snacks/ingredient/pancake_batter
name = "pancake batter"
desc = "Used for making pancakes."
icon_state = "pancake"
amount = 1
food_color = "#FFFFFF"
/obj/item/reagent_containers/food/snacks/ingredient/meatpaste
name = "meatpaste"
desc = "A meaty paste"
icon_state = "meatpaste"
amount = 1
custom_food = 1
initial_volume = 50
New()
..()
reagents.add_reagent("meat_slurry", 15)
/obj/item/reagent_containers/food/snacks/ingredient/dough
name = "dough"
desc = "Used for making bready things."
icon_state = "dough"
amount = 1
food_color = "#FFFFFF"
custom_food = 0
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/reagent_containers/food/snacks/ingredient/sugar))
boutput(user, "<span style=\"color:blue\">You add [W] to [src] to make sweet dough!</span>")
var/obj/item/reagent_containers/food/snacks/ingredient/dough_s/D = new /obj/item/reagent_containers/food/snacks/ingredient/dough_s(W.loc)
user.u_equip(W)
user.put_in_hand_or_drop(D)
qdel(W)
qdel(src)
else if (istype(W, /obj/item/kitchen/rollingpin))
boutput(user, "<span style=\"color:blue\">You flatten out the dough.</span>")
var/obj/item/reagent_containers/food/snacks/ingredient/pizza1/P = new /obj/item/reagent_containers/food/snacks/ingredient/pizza1(src.loc)
user.u_equip(src)
user.put_in_hand_or_drop(P)
qdel(src)
else ..()
/obj/item/reagent_containers/food/snacks/ingredient/dough_s
name = "sweet dough"
desc = "Used for making cakey things."
icon_state = "dough_s"
amount = 1
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/axe) || istype(W, /obj/item/circular_saw) || istype(W, /obj/item/kitchen/utensil/knife) || istype(W, /obj/item/scalpel) || istype(W, /obj/item/sword) || istype(W,/obj/item/saw) || istype(W,/obj/item/knife_butcher))
boutput(user, "<span style=\"color:blue\">You cut [src] into smaller pieces...</span>")
for(var/i = 1, i <= 4, i++)
new /obj/item/reagent_containers/food/snacks/ingredient/dough_cookie(get_turf(src))
qdel(src)
else ..()
/obj/item/reagent_containers/food/snacks/ingredient/dough_cookie
name = "cookie dough"
desc = "Probably shouldn't be eaten raw, not that THAT'S ever stopped anyone."
icon_state = "cookie_dough"
amount = 1
custom_food = 1
New()
..()
src.pixel_x = rand(-6, 6)
src.pixel_y = rand(-6, 6)
heal(var/mob/M)
if(prob(15))
wrap_pathogen(M.reagents, generate_indigestion_pathogen(), 15)
boutput(M, "<span style=\"color:red\">That tasted a little bit...off.</span>")
..()
/obj/item/reagent_containers/food/snacks/ingredient/tortilla
name = "uncooked tortilla"
desc = "An uncooked flour tortilla."
amount = 1
icon_state = "tortillabase"
food_color = "#FFFFFF"
New()
..()
src.pixel_x = rand(-8, 8)
src.pixel_y = rand(-8, 8)
/obj/item/reagent_containers/food/snacks/ingredient/pizza1
name = "unfinished pizza base"
desc = "You need to add tomatoes..."
icon_state = "pizzabase"
amount = 1
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/reagent_containers/food/snacks/condiment/ketchup) || istype(W, /obj/item/reagent_containers/food/snacks/plant/tomato))
boutput(user, "<span style=\"color:blue\">You add [W] to [src].</span>")
var/obj/item/reagent_containers/food/snacks/ingredient/pizza2/D=new /obj/item/reagent_containers/food/snacks/ingredient/pizza2(W.loc)
user.u_equip(W)
user.put_in_hand_or_drop(D)
qdel(W)
qdel(src)
else if (istype(W, /obj/item/axe) || istype(W, /obj/item/circular_saw) || istype(W, /obj/item/kitchen/utensil/knife) || istype(W, /obj/item/scalpel) || istype(W, /obj/item/sword) || istype(W,/obj/item/saw) || istype(W,/obj/item/knife_butcher))
boutput(user, "<span style=\"color:blue\">You cut [src] into smaller pieces...</span>")
for(var/i = 1, i <= 3, i++)
new /obj/item/reagent_containers/food/snacks/ingredient/tortilla(get_turf(src))
qdel(src)
else ..()
attack_self(var/mob/user as mob)
boutput(user, "<span style=\"color:blue\">You knead the [src] back into a blob.</span>")
new /obj/item/reagent_containers/food/snacks/ingredient/dough(get_turf(src))
qdel (src)
/obj/item/reagent_containers/food/snacks/ingredient/pizza2
name = "half-finished pizza base"
desc = "You need to add cheese..."
icon_state = "pizzabase2"
amount = 1
custom_food = 0
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/reagent_containers/food/snacks/ingredient/cheese))
boutput(user, "<span style=\"color:blue\">You add [W] to [src].</span>")
var/obj/item/reagent_containers/food/snacks/pizza/D = new /obj/item/reagent_containers/food/snacks/pizza(W.loc)
user.u_equip(W)
user.put_in_hand_or_drop(D)
qdel(W)
qdel(src)
else ..()
/obj/item/reagent_containers/food/snacks/ingredient/chips
name = "uncooked chips"
desc = "Cook them up into some nice fries."
icon_state = "pchips"
amount = 6
heal_amt = 0
food_color = "#FFFF99"
heal(var/mob/M)
boutput(M, "<span style=\"color:red\">Raw potato tastes pretty nasty...</span>") // does it?
/obj/item/reagent_containers/food/snacks/ingredient/spaghetti
name = "sperghetti noodles"
desc = "Original italian sperghetti spaghetti noodles."
icon_state = "sperghetti"
heal_amt = 0
amount = 1
attackby(obj/item/W as obj, mob/user as mob)
if(istype(W,/obj/item/reagent_containers/food/snacks/condiment/ketchup))
boutput(user, "<span style=\"color:blue\">You create sperghetti with tomato sauce...</span>")
var/obj/item/reagent_containers/food/snacks/spaghetti/sauce/D = new/obj/item/reagent_containers/food/snacks/spaghetti/sauce(W.loc)
user.u_equip(W)
user.put_in_hand_or_drop(D)
qdel(W)
qdel(src)
heal(var/mob/M)
boutput(M, "<span style=\"color:red\">The noodles taste terrible uncooked...</span>")
..()
+178
View File
@@ -0,0 +1,178 @@
/obj/item/reagent_containers/food/snacks/pie
name = "pie"
icon = 'icons/obj/foodNdrink/food_dessert.dmi'
desc = "A null pie. You shouldn't be able to see this!"
needspoon = 1
var/splat = 0 // for thrown pies
throw_impact(atom/hit_atom)
if (ismob(hit_atom) && src.splat)
var/mob/M = hit_atom
src.visible_message("<span style=\"color:red\">[src] splats in [M]'s face!</span>")
playsound(get_turf(src), "sound/effects/splat.ogg", 100, 1)
M.change_eye_blurry(rand(5,10))
M.take_eye_damage(rand(0, 2), 1)
else
..()
/obj/item/reagent_containers/food/snacks/pie/custard
name = "custard pie"
desc = "It smells delicious. You just want to plant your face in it."
icon_state = "pie"
splat = 1
needspoon = 1
amount = 3
throwforce = 0
force = 0
/obj/item/reagent_containers/food/snacks/pie/apple
name = "apple pie"
desc = "It smells delicious."
icon_state = "pie"
amount = 3
heal_amt = 4
/obj/item/reagent_containers/food/snacks/pie/lime
name = "key lime pie"
desc = "Shouldn't the topping be white? Space is weird."
icon_state = "limepie"
amount = 3
heal_amt = 4
var/has_key = 0
var/static/had_key = 0
initial_volume = 30
New()
..()
if (prob(6) && !had_key)
had_key = 1
src.has_key = 1
reagents.add_reagent("juice_lime", 15)
return
heal(var/mob/M)
..()
if (has_key)
src.has_key = 0
M.visible_message("<span style=\"color:red\">[M] pulls a key out of [src]!</span>","<span style=\"color:red\">You discover an iron key in [src]! Gross!</span>")
new /obj/item/device/key/haunted(get_turf(src))
return
/obj/item/reagent_containers/food/snacks/pie/lemon
name = "lemon meringue pie"
desc = "A fine use of fruit curd."
icon_state = "lemonpie"
amount = 3
heal_amt = 4
initial_volume = 30
New()
..()
reagents.add_reagent("juice_lemon", 15)
/obj/item/reagent_containers/food/snacks/pie/strawberry
name = "strawberry pie"
desc = "It smells delicious."
icon_state = "strawberrypie"
amount = 3
heal_amt = 4
initial_volume = 30
New()
..()
reagents.add_reagent("juice_strawberry", 15)
/obj/item/reagent_containers/food/snacks/pie/pumpkin
name = "pumpkin pie"
desc = "An autumn favourite."
icon_state = "pumpie"
amount = 3
heal_amt = 4
/obj/item/reagent_containers/food/snacks/pie/cream
name = "cream pie"
desc = "More often used in pranks than culinary matters..."
icon_state = "creampie"
splat = 1
needspoon = 1
throwforce = 0
force = 0
amount = 2
heal_amt = 6
/obj/item/reagent_containers/food/snacks/pie/anything
name = "anything pie"
desc = "An empty anything pie. You shouldn't be able to see this!"
icon_state = "pie"
amount = 3
heal_amt = 4
throw_impact(atom/hit_atom)
if (contents)
var/atom/randomContent
if (contents.len >= 1)
randomContent = pick(contents)
else
randomContent = src
if (randomContent != src)
randomContent.throw_impact(hit_atom)
hit_atom.attackby(randomContent, usr)
if (ismob(hit_atom))
playsound(src.loc, "sound/effects/splat.ogg", 100, 1)
var/mob/M = hit_atom
if (M == usr)
src.visible_message("<span style=\"color:red\">[usr] fumbles and smacks the [src] into their own face!</span>")
else
src.visible_message("<span style=\"color:red\">[src] smacks into [M]!</span>")
/obj/item/reagent_containers/food/snacks/pie/slurry
name = "slurry pie"
desc = "Though dangerous to eat raw, the slurrypod produces a fine, tart pie noted for its curative properties."
icon_state = "slurrypie"
amount = 3
heal_amt = 5
initial_volume = 30
New()
..()
reagents.add_reagent("mutadone", 15)
/obj/item/reagent_containers/food/snacks/pie/bacon
name = "bacon pie"
desc = "Named in honor of Sir Francis Bacon, who tragically died as the result of an early experiment into the field of bacon ice cream."
icon_state = "baconpie"
amount = 3
heal_amt = 6
initial_volume = 80
New()
..()
reagents.add_reagent("porktonium", 75)
heal(var/mob/M)
M.nutrition += 500
return
/obj/item/reagent_containers/food/snacks/pie/ass
name = "asspie"
desc = "Awkward."
icon_state = "asspie"
splat = 1
throwforce = 0
force = 0
amount = 3
heal_amt = 2
/obj/item/reagent_containers/food/snacks/pie/pot
name = "space-chicken pot pie"
desc = "Space-chickens are identical to regular chickens, but in space. This is a pastry filled with their cooked flesh, some vegetables, and a cream gravy."
icon_state = "pie"
heal_amt = 6
amount = 3
initial_volume = 30
New()
..()
reagents.add_reagent("chickensoup", 20)
+774
View File
@@ -0,0 +1,774 @@
/obj/item/reagent_containers/food/snacks/plant/
name = "fruit or vegetable"
icon = 'icons/obj/foodNdrink/food_produce.dmi'
var/datum/plant/planttype = null
var/datum/plantgenes/plantgenes = null
edible = 1 // Can this just be eaten as-is?
var/generation = 0 // For genetics tracking.
var/plant_reagent = null
New()
..()
var/datum/plant/species = HY_get_species_from_path(src.planttype)
if (species)
src.planttype = species
else
if (ispath(src.planttype))
src.planttype = new src.planttype(src)
else
qdel(src)
return
src.plantgenes = new /datum/plantgenes(src)
attack(mob/M as mob, mob/user as mob, def_zone)
if (src.edible == 0)
if (user == M)
boutput(user, "<span style=\"color:red\">You can't just cram that in your mouth, you greedy beast!</span>")
user.visible_message("<b>[user]</b> stares at [src] in a confused manner.")
else
user.visible_message("<span style=\"color:red\"><b>[user]</b> futilely attempts to shove [src] into [M]'s mouth!</span>")
return
..()
streak(var/list/directions)
spawn (0)
var/direction = pick(directions)
for (var/i = 0, i < pick(1, 200; 2, 150; 3, 50; 4), i++)
sleep(3)
if (step_to(src, get_step(src, direction), 0))
break
throw_impact(get_turf(src))
/obj/item/reagent_containers/food/snacks/plant/tomato/
name = "tomato"
desc = "You say tomato, I toolbox you."
icon_state = "tomato"
planttype = /datum/plant/tomato
amount = 1
heal_amt = 1
throwforce = 0
force = 0
plant_reagent = "juice_tomato"
throw_impact(var/turf/T)
..()
src.visible_message("<span style=\"color:red\">[src] splats onto the floor messily!</span>")
playsound(src.loc, "sound/effects/splat.ogg", 100, 1)
new /obj/decal/cleanable/tomatosplat(T)
qdel(src)
/obj/item/reagent_containers/food/snacks/plant/tomato/explosive
name = "tomato"
desc = "You say tomato, I toolbox you."
var/lit = 0
proc/ignite()
if(src.lit) return
src.lit = 1
src.visible_message("<span style=\"color:red\">[src] catches fire!</span>")
icon_state = "tomato-fire"
sleep(rand(30,60))
src.visible_message("<span style=\"color:red\">[src] explodes violently!</span>")
playsound(src.loc, "sound/effects/splat.ogg", 100, 1)
var/turf/T = get_turf(src) // we might have moved during the sleep, so figure out where we are
if (T)
new /obj/decal/cleanable/tomatosplat(T)
T.hotspot_expose(700,125)
explosion(src, T, -1, -1, 0, 1)
qdel (src)
throw_impact(var/turf/T)
..()
ignite()
ex_act()
..()
ignite() //Griff
/obj/item/reagent_containers/food/snacks/plant/corn
name = "corn cob"
desc = "The assistants call it maize."
icon_state = "corn"
planttype = /datum/plant/corn
amount = 3
heal_amt = 1
throwforce = 0
force = 0
food_color = "#FFFF00"
plant_reagent = "cornstarch"
var/popping = 0
brewable = 1
brew_result = "bourbon"
temperature_expose(datum/gas_mixture/air, temperature, volume)
if ((temperature > T0C + 232) && prob(50)) //Popcorn pops at about 232 degrees celsius.
src.pop()
return
proc/pop() //Pop that corn!!
if (popping)
return
popping = 1
src.visible_message("<span style=\"color:red\">[src] pops violently!</span>")
playsound(src.loc, "sound/effects/pop.ogg", 50, 1)
flick("cornsplode", src)
spawn(10)
new /obj/item/reagent_containers/food/snacks/popcorn(get_turf(src))
qdel(src)
/obj/item/reagent_containers/food/snacks/plant/soy
name = "soybean pod"
desc = "These soybeans are as close as two beans in a pod. Probably because they are literally beans in a pod."
planttype = /datum/plant/soy
icon_state = "soy"
amount = 3
heal_amt = 1
throwforce = 0
force = 0
food_color = "#4A7402"
plant_reagent = "grease"
/obj/item/reagent_containers/food/snacks/plant/soylent
name = "soylent chartreuse"
desc = "Contains high-energy plankton!"
planttype = /datum/plant/soy
icon_state = "soylent"
amount = 3
heal_amt = 2
throwforce = 0
force = 0
food_color = "#BBF33D"
/obj/item/reagent_containers/food/snacks/plant/orange/
name = "orange"
desc = "Bitter."
icon_state = "orange"
planttype = /datum/plant/orange
amount = 3
heal_amt = 1
food_color = "#FF8C00"
plant_reagent = "juice_orange"
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/reagent_containers/food/snacks/ingredient/meat/synthmeat))
boutput(user, "<span style=\"color:blue\">You combine the [src] and [W] to create a Synthorange!</span>")
var/obj/item/reagent_containers/food/snacks/plant/orange/synth/P = new(W.loc)
user.u_equip(W)
user.put_in_hand_or_drop(P)
var/datum/plantgenes/DNA = src.plantgenes
var/datum/plantgenes/PDNA = P.plantgenes
HYPpassplantgenes(DNA,PDNA)
qdel(W)
qdel(src)
else if (istype(W, /obj/item/axe) || istype(W, /obj/item/circular_saw) || istype(W, /obj/item/kitchen/utensil/knife) || istype(W, /obj/item/scalpel) || istype(W, /obj/item/sword) || istype(W,/obj/item/saw) || istype(W,/obj/item/knife_butcher) && !istype (src, /obj/item/reagent_containers/food/snacks/plant/orange/wedge))
if (istype (src, /obj/item/reagent_containers/food/snacks/plant/orange/wedge))
boutput(user, "<span style=\"color:red\">You can't cut wedges into wedges! What kind of insanity is that!?</span>")
return
var/turf/T = get_turf(src)
user.visible_message("[user] cuts [src] into slices.", "You cut [src] into slices.")
var/makeslices = 6
while (makeslices > 0)
var/obj/item/reagent_containers/food/snacks/plant/orange/wedge/P = new(T)
var/datum/plantgenes/DNA = src.plantgenes
var/datum/plantgenes/PDNA = P.plantgenes
HYPpassplantgenes(DNA,PDNA)
makeslices -= 1
qdel (src)
..()
/obj/item/reagent_containers/food/snacks/plant/orange/wedge
name = "orange wedge"
icon = 'icons/obj/drink.dmi'
icon_state = "old-orange"
initial_volume = 6
throwforce = 0
w_class = 1.0
amount = 1
New()
..()
reagents.add_reagent("juice_orange",5)
/obj/item/reagent_containers/food/snacks/plant/orange/clockwork
name = "clockwork orange"
desc = "You probably shouldn't eat this, unless you happen to be able to eat metal."
icon_state = "orange-clockwork"
get_desc()
. += "[pick("The time is", "It's", "It's currently", "It reads", "It says")] [o_clock_time()]."
heal(var/mob/living/M)
..()
boutput(M, "<span style=\"color:red\">Eating that was a terrible idea!</span>")
random_brute_damage(M, rand(5, 15))
M.updatehealth()
/obj/item/reagent_containers/food/snacks/plant/orange/synth
name = "synthorange"
desc = "Bitter. Moreso."
icon_state = "orange"
amount = 3
heal_amt = 2
/obj/item/reagent_containers/food/snacks/plant/grape/
name = "grapes"
desc = "Not the green ones."
icon_state = "grapes"
planttype = /datum/plant/grape
amount = 5
heal_amt = 1
food_color = "#FF00FF"
brewable = 1
brew_result = "wine"
/obj/item/reagent_containers/food/snacks/plant/grape/green
name = "grapes"
desc = "Not the purple ones."
icon_state = "Ggrapes"
amount = 5
heal_amt = 2
food_color = "#AAFFAA"
brew_result = "white_wine"
/obj/item/reagent_containers/food/snacks/plant/melon/
name = "melon"
desc = "You should cut it into slices first!"
icon_state = "melon"
planttype = /datum/plant/melon
throwforce = 8
w_class = 3.0
edible = 0
food_color = "#7FFF00"
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/axe) || istype(W, /obj/item/circular_saw) || istype(W, /obj/item/kitchen/utensil/knife) || istype(W, /obj/item/scalpel) || istype(W, /obj/item/sword) || istype(W,/obj/item/saw) || istype(W,/obj/item/knife_butcher))
var/turf/T = get_turf(src)
user.visible_message("[user] cuts [src] into slices.", "You cut [src] into slices.")
var/makeslices = 6
while (makeslices > 0)
var/obj/item/reagent_containers/food/snacks/plant/melonslice/P = new(T)
var/datum/plantgenes/DNA = src.plantgenes
var/datum/plantgenes/PDNA = P.plantgenes
HYPpassplantgenes(DNA,PDNA)
makeslices -= 1
qdel (src)
..()
/obj/item/reagent_containers/food/snacks/plant/melonslice/
name = "melon slice"
desc = "That's better!"
icon_state = "melon_slice"
planttype = /datum/plant/melon
throwforce = 0
w_class = 1.0
amount = 1
heal_amt = 2
food_color = "#7FFF00"
/obj/item/reagent_containers/food/snacks/plant/melon/george
name = "rainbow melon"
desc = "Sometime in the year 2472 these melons were required to have their name legally changed to protect the not-so-innocent. Also for tax evasion reasons."
icon_state = "george_melon"
throwforce = 0
w_class = 3.0
edible = 0
initial_volume = 60
New()
..()
reagents.add_reagent("george_melonium",50)
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/axe) || istype(W, /obj/item/circular_saw) || istype(W, /obj/item/kitchen/utensil/knife) || istype(W, /obj/item/scalpel) || istype(W, /obj/item/sword) || istype(W,/obj/item/saw) || istype(W,/obj/item/knife_butcher))
var/turf/T = get_turf(src)
user.visible_message("[user] cuts [src] into slices.", "You cut [src] into slices.")
var/makeslices = 6
while (makeslices > 0)
var/obj/item/reagent_containers/food/snacks/plant/melonslice/george/P = new(T)
var/datum/plantgenes/DNA = src.plantgenes
var/datum/plantgenes/PDNA = P.plantgenes
HYPpassplantgenes(DNA,PDNA)
makeslices -= 1
qdel (src)
..()
throw_impact(atom/hit_atom)
..()
if (ismob(hit_atom) && prob(50))
var/mob/M = hit_atom
hit_atom.visible_message("<span style=\"color:red\">[src] explodes from the sheer force of the blow!</span>")
playsound(src.loc, "sound/effects/bang.ogg", 100, 1)
random_brute_damage(M, 10)
if (istype(M, /mob/living/carbon/))
M.paralysis += 2
M.stunned += 6
M.take_brain_damage(15)
qdel (src)
/obj/item/reagent_containers/food/snacks/plant/melonslice/george
name = "rainbow melon slice"
desc = "A slice of a particularly special melon. Previously went by a different name but then it got married or something THIS IS HOW MELON NAMES WORK OKAY"
icon_state = "george_melon_slice"
throwforce = 5
w_class = 1.0
amount = 1
heal_amt = 2
plant_reagent = "george_melonium"
initial_volume = 30
New()
..()
reagents.add_reagent("george_melonium",25)
/obj/item/reagent_containers/food/snacks/plant/chili/
name = "chili pepper"
desc = "Caution: May or may not be red hot."
icon_state = "chili"
planttype = /datum/plant/chili
w_class = 1.0
amount = 1
heal_amt = 2
plant_reagent = "capsaicin"
initial_volume = 100
New()
..()
var/datum/plantgenes/DNA = src.plantgenes
reagents.add_reagent("capsaicin", DNA.potency)
/obj/item/reagent_containers/food/snacks/plant/chili/chilly
name = "chilly pepper"
desc = "It's cold to the touch."
icon_state = "chilly"
//planttype = /datum/plant/chili
w_class = 1.0
amount = 1
heal_amt = 2
food_color = "#00CED1"
plant_reagent = "cryostylane"
initial_volume = 100
New()
..()
var/datum/plantgenes/DNA = src.plantgenes
reagents.add_reagent("cryostylane", DNA.potency)
heal(var/mob/M)
M:emote("shiver")
var/datum/plantgenes/DNA = src.plantgenes
M.bodytemperature -= DNA.potency
boutput(M, "<span style=\"color:red\">You feel cold!</span>")
/obj/item/reagent_containers/food/snacks/plant/chili/ghost_chili
name = "ghostlier chili"
desc = "Naga Jolokia, or Ghost Chili, is a chili pepper previously recognized by Guinness World Records as the hottest pepper in the world. This one, found in space, is even hotter."
icon_state = "ghost_chili"
//planttype = /datum/plant/chili
w_class = 1.0
amount = 1
heal_amt = 1
food_color = "#FFFF00"
plant_reagent = "ghostchilijuice"
initial_volume = 30
New()
..()
reagents.add_reagent("ghostchilijuice",25)
heal(var/mob/M)
M:emote("twitch")
var/datum/plantgenes/DNA = src.plantgenes
boutput(M, "<span style=\"color:red\">Fuck! Your mouth feels like it's on fire!</span>")
M.bodytemperature += (DNA.potency * 5)
/obj/item/reagent_containers/food/snacks/plant/lettuce/
name = "lettuce leaf"
desc = "Not spinach at all. Nope. Nuh-uh."
icon_state = "spinach"
planttype = /datum/plant/lettuce
w_class = 1.0
amount = 1
heal_amt = 1
food_color = "#008000"
/obj/item/reagent_containers/food/snacks/plant/cucumber/
name = "cucumber"
desc = "A widely-cultivated gourd, often served on sandwiches or pickled. Not actually known for saving any kingdoms."
icon_state = "cucumber"
planttype = /datum/plant/cucumber
w_class = 1
amount = 2
heal_amt = 1
food_color = "#008000"
/obj/item/reagent_containers/food/snacks/plant/strawberry/
name = "strawberry"
desc = "A freshly picked strawberry."
icon_state = "strawberry"
planttype = /datum/plant/strawberry
amount = 1
heal_amt = 1
food_color = "#FF2244"
plant_reagent = "juice_strawberry"
/obj/item/reagent_containers/food/snacks/plant/apple/
name = "apple"
desc = "Implied by folklore to repel medical staff."
icon_state = "apple"
planttype = /datum/plant/apple
amount = 3
heal_amt = 1
brewable = 1
brew_result = "cider"
heal(var/mob/M)
M.HealDamage("All", src.heal_amt, src.heal_amt)
M.take_toxin_damage(0 - src.heal_amt)
M.take_oxygen_deprivation(0 - src.heal_amt)
M.take_brain_damage(0 - src.heal_amt)
attackby(obj/item/W as obj, mob/user as mob)
if(istype(W,/obj/item/rods))
boutput(user, "<span style=\"color:blue\">You create an apple on a stick...</span>")
new/obj/item/reagent_containers/food/snacks/plant/apple/stick(get_turf(src))
W:amount--
if(!W:amount) qdel(W)
qdel(src)
else ..()
//Apple on a stick
/obj/item/reagent_containers/food/snacks/plant/apple/stick
name = "apple on a stick"
desc = "An apple on a stick."
icon_state = "apple stick"
/obj/item/reagent_containers/food/snacks/plant/banana
name = "unpeeled banana"
desc = "Cavendish, of course."
icon_state = "banana"
planttype = /datum/plant/banana
amount = 2
heal_amt = 2
food_color = "#FFFF00"
plant_reagent = "potassium"
heal(var/mob/M)
if (src.icon_state == "banana")
M.visible_message("<span style=\"color:red\">[M] eats [src] without peeling it. What a dumb beast!</span>")
M.take_toxin_damage(5)
qdel (src)
attack_self(var/mob/user as mob)
if (src.icon_state == "banana")
if(user.bioHolder.HasEffect("clumsy") && prob(50))
user.visible_message("<span style=\"color:red\"><b>[user]</b> fumbles and pokes \himself in the eye with [src].</span>")
user.change_eye_blurry(5)
user.weakened = max(3, user.weakened)
return
boutput(user, "<span style=\"color:blue\">You peel [src].</span>")
src.name = "banana"
src.icon_state = "banana-fruit"
new /obj/item/bananapeel(user.loc)
/obj/item/reagent_containers/food/snacks/plant/carrot
name = "carrot"
desc = "Think of how many snowmen were mutilated to power the carrot industry."
icon_state = "carrot"
planttype = /datum/plant/carrot
w_class = 1.0
amount = 3
heal_amt = 1
food_color = "#FF9900"
/obj/item/reagent_containers/food/snacks/plant/pumpkin
name = "pumpkin"
desc = "Spooky!"
planttype = /datum/plant/pumpkin
icon_state = "pumpkin"
edible = 0
food_color = "#CC6600"
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/axe) || istype(W, /obj/item/circular_saw) || istype(W, /obj/item/kitchen/utensil/knife) || istype(W, /obj/item/scalpel) || istype(W, /obj/item/sword) || istype(W,/obj/item/saw) || istype(W,/obj/item/knife_butcher))
user.visible_message("[user] carefully and creatively carves [src].", "You carefully and creatively carve [src]. Spooky!")
new /obj/item/clothing/head/pumpkin(user.loc)
qdel (src)
/obj/item/clothing/head/pumpkin
name = "carved pumpkin"
desc = "Spookier!"
icon_state = "pumpkin"
c_flags = COVERSEYES | COVERSMOUTH
see_face = 0.0
item_state = "pumpkin"
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/device/flashlight))
user.visible_message("[user] adds [W] to [src].", "You add [W] to [src].")
W.name = "pumpkin lantern"
W.desc = "Spookiest!"
W.icon = 'icons/misc/halloween.dmi'
W.icon_state = "flight[W:on]"
W.item_state = "pumpkin"
qdel (src)
else
..()
/obj/item/reagent_containers/food/snacks/plant/lime
name = "lime"
desc = "A very sour green fruit."
icon_state = "lime"
planttype = /datum/plant/lime
amount = 2
heal_amt = 1
food_color = "#008000"
plant_reagent = "juice_lime"
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/axe) || istype(W, /obj/item/circular_saw) || istype(W, /obj/item/kitchen/utensil/knife) || istype(W, /obj/item/scalpel) || istype(W, /obj/item/sword) || istype(W,/obj/item/saw) || istype(W,/obj/item/knife_butcher))
if (istype (src, /obj/item/reagent_containers/food/snacks/plant/lime/wedge))
boutput(user, "<span style=\"color:red\">You can't cut wedges into wedges! What kind of insanity is that!?</span>")
return
var/turf/T = get_turf(src)
user.visible_message("[user] cuts [src] into slices.", "You cut [src] into slices.")
var/makeslices = 6
while (makeslices > 0)
var/obj/item/reagent_containers/food/snacks/plant/lime/wedge/P = new(T)
var/datum/plantgenes/DNA = src.plantgenes
var/datum/plantgenes/PDNA = P.plantgenes
HYPpassplantgenes(DNA,PDNA)
makeslices -= 1
qdel (src)
..()
/obj/item/reagent_containers/food/snacks/plant/lime/wedge
name = "lime wedge"
icon = 'icons/obj/drink.dmi'
icon_state = "old-lime"
throwforce = 0
w_class = 1.0
amount = 1
initial_volume = 6
New()
..()
reagents.add_reagent("juice_lime",5)
/obj/item/reagent_containers/food/snacks/plant/lemon/
name = "lemon"
desc = "Suprisingly not a commentary on the station's workmanship."
icon_state = "lemon"
planttype = /datum/plant/lemon
amount = 2
heal_amt = 1
food_color = "#FFFF00"
plant_reagent = "juice_lemon"
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/axe) || istype(W, /obj/item/circular_saw) || istype(W, /obj/item/kitchen/utensil/knife) || istype(W, /obj/item/scalpel) || istype(W, /obj/item/sword) || istype(W,/obj/item/saw) || istype(W,/obj/item/knife_butcher))
if (istype (src, /obj/item/reagent_containers/food/snacks/plant/lemon/wedge))
boutput(user, "<span style=\"color:red\">You can't cut wedges into wedges! What kind of insanity is that!?</span>")
return
var/turf/T = get_turf(src)
user.visible_message("[user] cuts [src] into slices.", "You cut [src] into slices.")
var/makeslices = 6
while (makeslices > 0)
var/obj/item/reagent_containers/food/snacks/plant/lemon/wedge/P = new(T)
var/datum/plantgenes/DNA = src.plantgenes
var/datum/plantgenes/PDNA = P.plantgenes
HYPpassplantgenes(DNA,PDNA)
makeslices -= 1
qdel (src)
..()
/obj/item/reagent_containers/food/snacks/plant/lemon/wedge
name = "lemon wedge"
icon = 'icons/obj/drink.dmi'
icon_state = "old-lemon"
throwforce = 0
w_class = 1.0
amount = 1
initial_volume = 6
New()
..()
reagents.add_reagent("juice_lemon",5)
/obj/item/reagent_containers/food/snacks/plant/slurryfruit/
name = "slurrypod"
desc = "An extremely poisonous, bitter fruit. The slurrypod fruit is regarded as a delicacy in some outer colony worlds."
icon_state = "slurry"
planttype = /datum/plant/slurrypod
amount = 1
heal_amt = -1
food_color = "#008000"
plant_reagent = "toxic_slurry"
initial_volume = 50
New()
..()
reagents.add_reagent("toxic_slurry", rand(10,50))
/obj/item/reagent_containers/food/snacks/plant/slurryfruit/omega
name = "omega slurrypod"
desc = "An extremely poisonous, bitter fruit. A strange light pulses from within."
icon_state = "slurrymut"
amount = 1
heal_amt = -1
initial_volume = 50
New()
..()
reagents.add_reagent("toxic_slurry", rand(30,45))
if(prob(50))
reagents.add_reagent("omega_mutagen",5)
/obj/item/reagent_containers/food/snacks/plant/peanuts
name = "peanuts"
desc = "A pile of peanuts."
icon_state = "peanuts"
planttype = /datum/plant/peanut
amount = 1
heal_amt = 2
food_color = "#D2691E"
/* drsingh todo: peanut shells and requiring roasting shelling
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/kitchen/utensil/knife) || istype(W,/obj/item/knife_butcher))
if (src.icon_state == "potato")
user.visible_message("[user] peels [src].", "You peel [src].")
src.icon_state = "potato-peeled"
src.desc = "It needs to be cooked."
else if (src.icon_state == "potato-peeled")
user.visible_message("[user] chops up [src].", "You chop up [src].")
new /obj/item/reagent_containers/food/snacks/ingredient/chips(get_turf(src))
qdel (src)
else ..()
*/
/obj/item/reagent_containers/food/snacks/plant/potato/
name = "potato"
desc = "It needs peeling first."
icon_state = "potato"
planttype = /datum/plant/potato
amount = 1
heal_amt = 0
food_color = "#F0E68C"
brewable = 1
brew_result = "vodka"
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/kitchen/utensil/knife) || istype(W,/obj/item/knife_butcher))
if (src.icon_state == "potato")
user.visible_message("[user] peels [src].", "You peel [src].")
src.icon_state = "potato-peeled"
src.desc = "It needs to be cooked."
else if (src.icon_state == "potato-peeled")
user.visible_message("[user] chops up [src].", "You chop up [src].")
new /obj/item/reagent_containers/food/snacks/ingredient/chips(get_turf(src))
qdel (src)
else ..()
heal(var/mob/M)
boutput(M, "<span style=\"color:red\">Raw potato tastes pretty nasty...</span>")
/obj/item/reagent_containers/food/snacks/plant/onion
name = "onion"
desc = "A yellow onion bulb. This little bundle of fun tends to irritate eyes when cut as a result of a fascinating chemical reaction."
icon_state = "onion"
planttype = /datum/plant/onion
food_color = "#FF9933"
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/kitchen/utensil/knife) || istype(W,/obj/item/knife_butcher))
user.visible_message("[user] chops up [src].", "You chop up [src].")
for (var/mob/living/carbon/M in range(user, 2))
if (prob(50) && M.stat != 2)
M.emote("cry")
var/x = rand(3,5)
var/turf/T = get_turf(user)
while (x-- > 0)
new /obj/item/reagent_containers/food/snacks/onion_slice(T)
qdel(src)
else
..()
/obj/item/reagent_containers/food/snacks/onion_slice
name = "onion ring"
desc = "A sliced ring of onion. When fried, makes a side dish perfectly suited to being overlooked in favor of french fries."
icon = 'icons/obj/foodNdrink/food_snacks.dmi'
icon_state = "onion_ring"
food_color = "#B923EB"
amount = 1
/obj/item/reagent_containers/food/snacks/plant/garlic
name = "garlic"
desc = "The natural enemy of the common Dracula (H. Sapiens Lugosi)."
icon_state = "garlic"
planttype = /datum/plant/garlic
food_color = "#FEFEFE"
initial_volume = 10
New()
..()
reagents.add_reagent("water_holy", 10)
/obj/item/reagent_containers/food/snacks/plant/avocado
name = "avocado"
desc = "The immense berry of a Mexican tree, the avocado is rich in monounsaturated fat, fiber, and potassium. It is also poisonous to birds and horses."
icon_state = "avocado"
planttype = /datum/plant/avocado
food_color = "#007B1C"
heal_amt = 2
/obj/item/reagent_containers/food/snacks/plant/eggplant
name = "eggplant"
desc = "A close relative of the tomato and potato, the eggplant is notable for being large and purple."
icon_state = "eggplant"
planttype = /datum/plant/eggplant
food_color = "#420042"
initial_volume = 50
New()
..()
reagents.add_reagent("nicotine", 4.58) //EGGPLANT FACT: They contain about 1.1% the nicotine of a cigarette per 100g.
/obj/item/reagent_containers/food/snacks/plant/lashberry/
name = "lashberry"
desc = "Not nearly as violent as the plant it came from."
icon_state = "lashberry"
planttype = /datum/plant/lasher
amount = 4
heal_amt = 2
food_color = "#FF00FF"
// Weird alien fruit
/obj/item/reagent_containers/food/snacks/plant/purplegoop
name = "wad of purple goop"
desc = "Um... okay then."
icon_state = "yuckpurple"
planttype = /datum/plant/artifact/dripper
amount = 1
heal_amt = 0
food_color = "#9865c5"
initial_volume = 25
New()
..()
reagents.add_reagent("yuck", 20)
/obj/item/reagent_containers/food/snacks/plant/glowfruit
name = "glowing fruit"
desc = "This might be a handy light source."
icon_state = "glowfruit"
planttype = /datum/plant/artifact/litelotus
amount = 4
heal_amt = 1
luminosity = 3
food_color = "#ccccff"
+397
View File
@@ -0,0 +1,397 @@
/obj/item/reagent_containers/food/snacks/sandwich/
icon = 'icons/obj/foodNdrink/food_bread.dmi'
amount = 4
heal_amt = 2
var/hname = null
var/job = null
food_color = "#FFFFCC"
custom_food = 0
initial_volume = 30
meat_h
name = "manwich"
desc = "Human meat between two slices of bread."
icon_state = "sandwich_m"
meat_m
name = "monkey sandwich"
desc = "Meat between two slices of bread."
icon_state = "sandwich_m"
pb
name = "peanut butter sandwich"
desc = "Peanut butter between two slices of bread."
icon_state = "sandwich_p"
pbh
name = "peanut butter and honey sandwich"
desc = "Peanut butter and honey between two slices of bread."
icon_state = "sandwich_p"
New()
..()
reagents.add_reagent("honey",10)
meat_s
name = "synthmeat sandwich"
desc = "Synthetic meat between two slices of bread."
icon_state = "sandwich_m"
cheese
name = "cheese sandwich"
desc = "Cheese between two slices of bread."
icon_state = "sandwich_c"
elvis_meat_h
name = "elvismanwich"
desc = "Human meat between two slices of elvis bread."
icon_state = "elviswich_m"
New()
..()
reagents.add_reagent("essenceofelvis",25)
elvis_meat_m
name = "monkey elviswich"
desc = "Meat between two slices of elvis bread."
icon_state = "elviswich_m"
New()
..()
reagents.add_reagent("essenceofelvis",25)
elvis_pb
name = "peanut butter elviswich"
desc = "Peanut butter between two slices of elvis bread."
icon_state = "elviswich_p"
New()
..()
reagents.add_reagent("essenceofelvis",25)
elvis_pbh
name = "peanut butter and honey elviswich"
desc = "Peanut butter and honey between two slices of elvis bread."
icon_state = "elviswich_p"
New()
..()
reagents.add_reagent("essenceofelvis",15)
reagents.add_reagent("honey",10)
elvis_meat_s
name = "synthmeat elviswich"
desc = "Synthetic meat between two slices of elvis bread."
icon_state = "elviswich_m"
New()
..()
reagents.add_reagent("essenceofelvis",25)
elvis_cheese
name = "cheese elviswich"
desc = "Cheese between two slices of elvis bread."
icon_state = "elviswich_c"
New()
..()
reagents.add_reagent("essenceofelvis",25)
spooky_cheese
name = "killed cheese sandwich"
desc = "Cheese that has been murdered and buried in a hasty grave of dread."
icon_state = "scarewich_c"
New()
..()
reagents.add_reagent("ectoplasm",15)
reagents.add_reagent("cheese", 10)
spooky_pb
name = "peanut butter and jelly meet breadula"
desc = "It's probably rather frightening if you have a nut allergy."
icon_state = "scarewich_pb"
New()
..()
reagents.add_reagent("ectoplasm",15)
reagents.add_reagent("eyeofnewt",10)
spooky_pbh
name = "killer beenut butter sandwich"
desc = "A peanut butter sandwich with a terrifying twist: Honey!"
icon_state = "scarewich_pb"
New()
..()
reagents.add_reagent("ectoplasm",10)
reagents.add_reagent("tongueofdog",5)
reagents.add_reagent("honey",10)
spooky_meat_h
name = "murderwich"
desc = "Dawn of the bread."
icon_state = "scarewich_m"
New()
..()
reagents.add_reagent("ectoplasm",15)
reagents.add_reagent("blood", 10)
spooky_meat_m
name = "scare wich project"
desc = "What's a ghost's favorite sandwich meat? BOO-loney!"
icon_state = "scarewich_m"
New()
..()
reagents.add_reagent("ectoplasm",15)
reagents.add_reagent("blood", 10)
spooky_meat_s
name = "synthmeat steinwich"
desc = "A dreadful sandwich of flesh borne not of man or beast, but of twisted science."
icon_state = "scarewich_m"
New()
..()
reagents.add_reagent("ectoplasm",15)
reagents.add_reagent("synthflesh", 10)
meatball
name = "meatball sub"
desc = "A submarine sandwich consisting of meatballs, cheese, and marinara sauce."
icon_state = "meatball_sub"
amount = 6
heal_amt = 4
/obj/item/reagent_containers/food/snacks/burger/
name = "burger"
desc = "A burger."
icon = 'icons/obj/foodNdrink/food_meals.dmi'
icon_state = "hburger"
amount = 5
heal_amt = 2
food_color ="#663300"
initial_volume = 15
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/reagent_containers/food/snacks/condiment/)) src.amount += 1
New()
..()
reagents.add_reagent("cholesterol",4)
/obj/item/reagent_containers/food/snacks/burger/assburger
name = "assburger"
desc = "This burger gives off an air of awkwardness."
icon_state = "assburger"
/obj/item/reagent_containers/food/snacks/burger/heartburger
name = "heartburger"
desc = "This burger tastes kind of offal."
icon_state = "heartburger"
/obj/item/reagent_containers/food/snacks/burger/brainburger
name = "brainburger"
desc = "A strange looking burger. It looks almost sentient."
icon_state = "brainburger"
initial_volume = 15
New()
..()
reagents.add_reagent("prions", 10)
/obj/item/reagent_containers/food/snacks/burger/humanburger
name = "burger"
var/hname = ""
desc = "A bloody burger."
icon_state = "hburger"
/obj/item/reagent_containers/food/snacks/burger/monkeyburger
name = "monkeyburger"
desc = "The cornerstone of every nutritious breakfast."
icon_state = "mburger"
/obj/item/reagent_containers/food/snacks/burger/fishburger
name = "Fish-Fil-A"
desc = "A delicious alternative to heart-grinding beef patties."
icon_state = "fishburger"
/obj/item/reagent_containers/food/snacks/burger/moldy
name = "moldy burger"
desc = "A rather disgusting looking burger."
icon_state ="moldyburger"
amount = 1
heal_amt = 1
initial_volume = 15
New()
..()
wrap_pathogen(reagents, generate_flu_pathogen(), 7)
wrap_pathogen(reagents, generate_cold_pathogen(), 8)
/obj/item/reagent_containers/food/snacks/burger/plague
name = "burgle"
desc = "The plagueburger."
icon_state = "moldyburger"
amount = 1
heal_amt = 1
initial_volume = 15
New()
..()
wrap_pathogen(reagents, generate_random_pathogen(), 15)
/obj/item/reagent_containers/food/snacks/burger/roburger
name = "roburger"
desc = "The lettuce is the only organic component. Beep."
icon_state = "roburger"
amount = 3
heal_amt = 1
food_color = "#C8C8C8"
initial_volume = 10
brewable = 1
brew_result = "beepskybeer"
New()
..()
reagents.add_reagent("nanites", 10)
/obj/item/reagent_containers/food/snacks/burger/synthburger
name = "synthburger"
desc = "A thoroughly artificial snack."
icon_state = "mburger"
amount = 5
heal_amt = 2
/obj/item/reagent_containers/food/snacks/burger/baconburger
name = "baconatrix"
desc = "The official food of the Lunar Football League! Also possibly one of the worst things you could ever eat."
icon_state = "baconburger"
amount = 5
heal_amt = 1
initial_volume = 50
New()
..()
reagents.add_reagent("porktonium", 50)
heal(var/mob/M)
if(prob(25))
M.nutrition += 100
..()
/obj/item/reagent_containers/food/snacks/burger/sloppyjoe
name = "sloppy joe"
desc = "A rather messy burger."
icon_state = "sloppyjoe"
amount = 5
heal_amt = 2
heal(var/mob/M)
if(prob(20))
var/obj/decal/cleanable/blood/gibs/gib = new /obj/decal/cleanable/blood/gibs( get_turf(src) )
gib.streak(M.dir)
boutput(M, "<span style=\"color:red\">You drip some meat on the floor</span>")
M.visible_message("<span style=\"color:red\">[M] drips some meat on the floor!</span>")
playsound(M.loc, "sound/effects/splat.ogg", 50, 1)
else
..()
/obj/item/reagent_containers/food/snacks/burger/mysteryburger
name = "dubious burger"
desc = "A burger of indeterminate meat type."
icon_state = "brainburger"
amount = 5
heal_amt = 1
heal(var/mob/M)
if(prob(8))
var/effect = rand(1,4)
switch(effect)
if(1)
boutput(M, "<span style=\"color:red\">Ugh. Tasted all greasy and gristly.</span>")
M.nutrition += 20
if(2)
boutput(M, "<span style=\"color:red\">Good grief, that tasted awful!</span>")
M.take_toxin_damage(2)
if(3)
boutput(M, "<span style=\"color:red\">There was a cyst in that burger. Now your mouth is full of pus OH JESUS THATS DISGUSTING OH FUCK</span>")
M.nutrition -= 20
M.visible_message("<span style=\"color:red\">[M] suddenly and violently vomits!</span>")
playsound(M.loc, "sound/effects/splat.ogg", 50, 1)
new /obj/decal/cleanable/vomit(M.loc)
if(4)
boutput(M, "<span style=\"color:red\">You bite down on a chunk of bone, hurting your teeth.</span>")
random_brute_damage(M, 2)
..()
/obj/item/reagent_containers/food/snacks/burger/cheeseburger
name = "cheeseburger"
desc = "Tasty, but not paticularly healthy."
icon_state = "hburger"
amount = 6
heal_amt = 2
/obj/item/reagent_containers/food/snacks/burger/cheeseburger_m
name = "monkey cheese burger"
desc = "How very dadaist."
icon_state = "hburger"
amount = 6
heal_amt = 2
heal(var/mob/M)
if(prob(3) && ishuman(M))
boutput(M, "<span style=\"color:red\">You wackily and randomly turn into a lizard.</span>")
M.set_mutantrace(/datum/mutantrace/lizard)
M:update_face()
M:update_body()
if(prob(3))
boutput(M, "<span style=\"color:red\">You wackily and randomly turn into a monkey.</span>")
M:monkeyize()
..()
/obj/item/reagent_containers/food/snacks/burger/bigburger
name = "Coronator"
desc = "The king of burgers. You can feel your digestive system shutting down just LOOKING at it."
icon_state = "bigburger"
amount = 10
heal_amt = 5
initial_volume = 100
New()
..()
reagents.add_reagent("cholesterol", 50)
/obj/item/reagent_containers/food/snacks/burger/monsterburger
name = "THE MONSTER"
desc = "There are no words to describe the sheer unhealthiness of this abomination."
icon_state = "giantburger"
amount = 1
heal_amt = 50
throwforce = 10
initial_volume = 330
New()
..()
reagents.add_reagent("cholesterol",200)
/obj/item/reagent_containers/food/snacks/burger/vr
icon = 'icons/effects/VR.dmi'
/obj/item/reagent_containers/food/snacks/fries
name = "fries"
desc = "Lightly salted potato fingers."
icon = 'icons/obj/foodNdrink/food_snacks.dmi'
icon_state = "fries"
amount = 6
heal_amt = 1
initial_volume = 5
New()
..()
reagents.add_reagent("cholesterol",1)
File diff suppressed because it is too large Load Diff
+149
View File
@@ -0,0 +1,149 @@
/*
CONTAINS:
THAT STUPID GAME KIT
*/
/obj/item/game_kit
name = "Gaming Kit"
icon = 'icons/obj/items.dmi'
icon_state = "game_kit"
var/selected = null
var/board_stat = null
var/data = ""
//var/base_url = "http://svn.slurm.us/public/spacestation13/misc/game_kit"
item_state = "sheet-metal"
w_class = 5.0
desc = "Play chess or checkers. Or don't. Probably don't."
stamina_damage = 5
stamina_cost = 5
stamina_crit_chance = 5
/obj/item/game_kit/New()
src.board_stat = "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"
src.selected = "CR"
/obj/item/game_kit/MouseDrop(mob/user as mob)
if (user == usr && !usr.restrained() && !usr.stat && (usr.contents.Find(src) || in_range(src, usr)))
if (usr.hand)
if (!usr.l_hand)
spawn (0)
src.attack_hand(usr, 1, 1)
else
if (!usr.r_hand)
spawn (0)
src.attack_hand(usr, 0, 1)
/obj/item/game_kit/proc/update()
var/dat = text("<CENTER><B>Game Board</B></CENTER><BR><a href='?src=\ref[];mode=hia'>[]</a> <a href='?src=\ref[];mode=remove'>remove</a><HR><table width= 256 border= 0 height= 256 cellspacing= 0 cellpadding= 0 >", src, (src.selected ? text("Selected: []", src.selected) : "Nothing Selected"), src)
for (var/y = 1 to 8)
dat += "<tr>"
for (var/x = 1 to 8)
var/tilecolor = (y + x) % 2 ? "#ffffff" : "#999999"
var/piece = copytext(src.board_stat, ((y - 1) * 8 + x) * 2 - 1, ((y - 1) * 8 + x) * 2 + 1)
dat += "<td>"
dat += "<td style='background-color:[tilecolor]' width=32 height=32>"
if (piece != "BB")
dat += "<a href='?src=\ref[src];s_board=[x] [y]'><img src='[resource("images/chess/board_[piece].png")]' width=32 height=32 border=0>"
else
dat += "<a href='?src=\ref[src];s_board=[x] [y]'><img src='[resource("images/chess/board_none.png")]' width=32 height=32 border=0>"
dat += "</td>"
dat += "</tr>"
dat += "</table><HR><B>Chips:</B><BR>"
for (var/piece in list("CB", "CR"))
dat += "<a href='?src=\ref[src];s_piece=[piece]'><img src='[resource("images/chess/board_[piece].png")]' width=32 height=32 border=0></a>"
dat += "<HR><B>Chess pieces:</B><BR>"
for (var/piece in list("WP", "WK", "WQ", "WI", "WN", "WR"))
dat += "<a href='?src=\ref[src];s_piece=[piece]'><img src='[resource("images/chess/board_[piece].png")]' width=32 height=32 border=0></a>"
dat += "<br>"
for (var/piece in list("BP", "BK", "BQ", "BI", "BN", "BR"))
dat += "<a href='?src=\ref[src];s_piece=[piece]'><img src='[resource("images/chess/board_[piece].png")]' width=32 height=32 border=0></a>"
src.data = dat
/obj/item/game_kit/attack_hand(mob/user as mob, unused, flag)
if (flag)
return ..()
else
user.machine = src
if (!( src.data ))
update()
user << browse(src.data, "window=game_kit;size=325x550")
onclose(user, "game_kit")
return
return
/obj/item/game_kit/Topic(href, href_list)
..()
if ((usr.stat || usr.restrained()))
return
if (usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf)))
if (href_list["s_piece"])
src.selected = href_list["s_piece"]
else if (href_list["mode"])
if (href_list["mode"] == "remove")
src.selected = "remove"
else
src.selected = null
else if (href_list["s_board"])
if (!( src.selected ))
src.selected = href_list["s_board"]
else
var/tx = text2num(copytext(href_list["s_board"], 1, 2))
var/ty = text2num(copytext(href_list["s_board"], 3, 4))
if ((copytext(src.selected, 2, 3) == " " && length(src.selected) == 3))
var/sx = text2num(copytext(src.selected, 1, 2))
var/sy = text2num(copytext(src.selected, 3, 4))
var/place = ((sy - 1) * 8 + sx) * 2 - 1
src.selected = copytext(src.board_stat, place, place + 2)
if (place == 1)
src.board_stat = text("BB[]", copytext(src.board_stat, 3, 129))
else
if (place == 127)
src.board_stat = text("[]BB", copytext(src.board_stat, 1, 127))
else
if (place)
src.board_stat = text("[]BB[]", copytext(src.board_stat, 1, place), copytext(src.board_stat, place + 2, 129))
place = ((ty - 1) * 8 + tx) * 2 - 1
if (place == 1)
src.board_stat = text("[][]", src.selected, copytext(src.board_stat, 3, 129))
else
if (place == 127)
src.board_stat = text("[][]", copytext(src.board_stat, 1, 127), src.selected)
else
if (place)
src.board_stat = text("[][][]", copytext(src.board_stat, 1, place), src.selected, copytext(src.board_stat, place + 2, 129))
src.selected = null
else
if (src.selected == "remove")
var/place = ((ty - 1) * 8 + tx) * 2 - 1
if (place == 1)
src.board_stat = text("BB[]", copytext(src.board_stat, 3, 129))
else
if (place == 127)
src.board_stat = text("[]BB", copytext(src.board_stat, 1, 127))
else
if (place)
src.board_stat = text("[]BB[]", copytext(src.board_stat, 1, place), copytext(src.board_stat, place + 2, 129))
else
if (length(src.selected) == 2)
var/place = ((ty - 1) * 8 + tx) * 2 - 1
if (place == 1)
src.board_stat = text("[][]", src.selected, copytext(src.board_stat, 3, 129))
else
if (place == 127)
src.board_stat = text("[][]", copytext(src.board_stat, 1, 127), src.selected)
else
if (place)
src.board_stat = text("[][][]", copytext(src.board_stat, 1, place), src.selected, copytext(src.board_stat, place + 2, 129))
src.add_fingerprint(usr)
update()
for(var/mob/M in viewers(1, src))
if ((M.client && M.machine == src))
src.attack_hand(M)
+229
View File
@@ -0,0 +1,229 @@
/obj/item/item_box // for when you want something that "contains" a certain amount of an item
name = "box"
desc = "A little cardboard box for keeping stuff in. Woah! We're truly in the future with technology like this."
icon = 'icons/obj/storage.dmi'
icon_state = "item_box"
force = 1
throwforce = 1
w_class = 2
var/contained_item = /obj/item/sticker/gold_star
var/item_amount = -1 // how many of thing to start with, -1 for infinite
var/max_item_amount = -1 // how many can the thing hold total, -1 for infinite
var/open = 0
var/icon_closed = "item_box"
var/icon_open = "item_box-open"
var/icon_empty = "item_box-empty"
var/reusable = 1
gold_star
name = "box of gold star stickers"
banana
name = "box of banana stickers"
contained_item = /obj/item/sticker/banana
clover
name = "box of clover stickers"
contained_item = /obj/item/sticker/clover
umbrella
name = "box of umbrella stickers"
contained_item = /obj/item/sticker/umbrella
skull
name = "box of skull stickers"
contained_item = /obj/item/sticker/skull
no
name = "box of \"no\" stickers"
contained_item = /obj/item/sticker/no
left_arrow
name = "box of left arrow stickers"
contained_item = /obj/item/sticker/left_arrow
right_arrow
name = "box of right arrow stickers"
contained_item = /obj/item/sticker/right_arrow
heart
name = "box of heart stickers"
contained_item = /obj/item/sticker/heart
moon
name = "box of moon stickers"
contained_item = /obj/item/sticker/moon
smile
name = "box of smile stickers"
contained_item = /obj/item/sticker/smile
frown
name = "box of frown stickers"
contained_item = /obj/item/sticker/frown
balloon
name = "box of red balloon stickers"
contained_item = /obj/item/sticker/balloon
rainbow
name = "box of rainbow stickers"
contained_item = /obj/item/sticker/rainbow
horseshoe
name = "box of horseshoe stickers"
contained_item = /obj/item/sticker/horseshoe
award_ribbon
name = "box of award ribbons"
contained_item = /obj/item/sticker/ribbon
first_place
name = "box of 1st place ribbons"
contained_item = /obj/item/sticker/ribbon/first_place
second_place
name = "box of 2nd place ribbons"
contained_item = /obj/item/sticker/ribbon/second_place
third_place
name = "box of 3rd place ribbons"
contained_item = /obj/item/sticker/ribbon/third_place
participant
name = "box of participation ribbons"
contained_item = /obj/item/sticker/ribbon/participant
medical_patches
name = "box of patches"
contained_item = /obj/item/reagent_containers/patch
item_amount = 0
icon_closed = "patchbox"
icon_open = "patchbox-open"
icon_empty = "patchbox-empty"
styptic
name = "box of healing patches"
contained_item = /obj/item/reagent_containers/patch/bruise
item_amount = 10
max_item_amount = 10
silver_sulf
name = "box of burn patches"
contained_item = /obj/item/reagent_containers/patch/burn
item_amount = 10
max_item_amount = 10
synthflesh
name = "box of synthflesh patches"
contained_item = /obj/item/reagent_containers/patch/synthflesh
item_amount = 10
max_item_amount = 10
mini_styptic
name = "box of mini healing patches"
contained_item = /obj/item/reagent_containers/patch/mini/bruise
item_amount = 10
max_item_amount = 10
mini_silver_sulf
name = "box of mini burn patches"
contained_item = /obj/item/reagent_containers/patch/mini/burn
item_amount = 10
max_item_amount = 10
mini_synthflesh
name = "box of mini synthflesh patches"
contained_item = /obj/item/reagent_containers/patch/mini/synthflesh
item_amount = 10
max_item_amount = 10
New()
..()
spawn(10)
if (!ispath(src.contained_item))
logTheThing("debug", src, null, "has a non-path contained_item, \"[src.contained_item]\", and is being disposed of to prevent errors")
qdel(src)
return
get_desc(dist)
if (src.item_amount == -1)
. += "There's a whole, whole lot of things inside. Dang!"
else if (src.item_amount >= 1)
. += "There's [src.item_amount] thing[src.item_amount == 1 ? "" : "s"] inside."
else
. += "It's empty."
attack_self(mob/user as mob)
if (src.reusable)
src.open = !src.open
else if (!src.open)
src.open = 1
else
boutput(user, "<span style=\"color:red\">[src] is already open!</span>")
src.update_icon()
return
attackby(obj/item/W as obj, mob/living/user as mob)
if (!src.add_to(W, user))
return ..()
attack_hand(mob/user as mob)
src.add_fingerprint(user)
if (src.loc == user && src.open)
var/obj/item/I = src.take_from()
if (I)
user.put_in_hand_or_drop(I)
boutput(user, "You take \an [I] out of [src].")
src.update_icon()
return
else
boutput(user, "<span style=\"color:red\">[src] is empty!</span>")
return ..()
else
return ..()
proc/take_from()
var/obj/item/myItem = locate(src.contained_item) in src
if (myItem)
if (src.item_amount >= 1)
src.item_amount--
src.update_icon()
return myItem
else if (src.item_amount != 0) // should be either a positive number or -1
if (src.item_amount >= 1)
src.item_amount--
var/obj/item/newItem = new src.contained_item(src)
src.update_icon()
return newItem
else
return 0
proc/add_to(var/obj/item/I, var/mob/user)
if (!I)
return 0
if (!user && usr)
user = usr
if (!istype(I, src.contained_item))
if (user)
boutput(user, "<span style=\"color:red\">[I] doesn't fit in [src]!</span>")
return 0
if (src.reusable && !(src.item_amount >= src.max_item_amount || src.max_item_amount == -1))
if (!src.open)
if (user)
boutput(user, "<span style=\"color:red\">[src] isn't open, you goof!</span>")
return 0
if (src.item_amount != -1)
src.item_amount ++
src.update_icon()
if (user)
boutput(user, "You stuff [I] into [src].")
user.u_equip(I)
I.set_loc(src)
return 1
else
if (user)
boutput(user, "<span style=\"color:red\">You can't seem to make [I] fit into [src].</span>")
return 0
proc/update_icon()
if (src.open && !src.item_amount)
src.icon_state = src.icon_empty
else if (src.open && src.item_amount)
src.icon_state = src.icon_open
else
src.icon_state = src.icon_closed
+178
View File
@@ -0,0 +1,178 @@
// GIFTS
/obj/item/wrapping_paper
name = "wrapping paper"
icon = 'icons/obj/items.dmi'
icon_state = "wrap_paper-r"
amount = 20.0
desc = "Used for wrapping gifts. Its got a neat design!"
stamina_damage = 1
stamina_cost = 1
stamina_crit_chance = 1
var/style = "r"
New()
..()
src.style = pick("r", "rs", "g", "gs")
src.icon_state = "wrap_paper-[src.style]"
/obj/item/wrapping_paper/attackby(obj/item/W as obj, mob/user as mob)
if (!( locate(/obj/table, src.loc) ))
boutput(user, "<span style=\"color:blue\">You MUST put the paper on a table!</span>")
return
if (W.w_class < 4)
if (user.find_type_in_hand(/obj/item/wirecutters) || user.find_type_in_hand(/obj/item/scissors))
var/a_used = 2 ** (src.w_class - 1)
if (src.amount < a_used)
boutput(user, "<span style=\"color:blue\">You need more paper!</span>")
return
else
src.amount -= a_used
user.drop_item()
var/obj/item/gift/G = new /obj/item/gift(src.loc)
G.size = W.w_class
G.w_class = G.size + 1
G.icon_state = "gift[minmax(G.size, 1, 3)]-[src.style]"
G.gift = W
W.set_loc(G)
G.add_fingerprint(user)
W.add_fingerprint(user)
src.add_fingerprint(user)
modify_christmas_cheer(1)
user.put_in_hand_or_drop(G)
if (src.amount <= 0)
user.u_equip(src)
var/obj/item/c_tube/C = new /obj/item/c_tube(src.loc)
user.put_in_hand_or_drop(C)
qdel(src)
return
else
boutput(user, "<span style=\"color:blue\">You need something to cut [src] with!</span>")
else
boutput(user, "<span style=\"color:blue\">The object is FAR too large!</span>")
return
/obj/item/wrapping_paper/get_desc(dist)
if (dist > 2)
return
. += "There is about [src.amount] square units of paper left!"
/obj/item/wrapping_paper/attack(mob/target as mob, mob/user as mob)
if (!ishuman(target))
return
if (target.stat == 2)
if (src.amount > 2)
var/obj/spresent/present = new /obj/spresent (target.loc)
present.icon_state = "strange-[src.style]"
src.amount -= 2
target.set_loc(present)
else
boutput(user, "<span style=\"color:blue\">You need more paper.</span>")
else
boutput(user, "They're moving around too much.")
/obj/item/gift
desc = "For me!?"
name = "gift"
icon = 'icons/obj/items.dmi'
icon_state = "gift2-r"
item_state = "gift"
var/size = 3.0
var/obj/item/gift = null
w_class = 4.0
stamina_damage = 1
stamina_cost = 1
stamina_crit_chance = 0
/obj/item/gift/attack_self(mob/user as mob)
if(!src.gift)
boutput(user, "<span style=\"color:blue\">The gift was empty!</span>")
qdel(src)
return
user.u_equip(src)
user.put_in_hand_or_drop(src.gift)
modify_christmas_cheer(2)
qdel(src)
return
/obj/item/a_gift
name = "gift"
icon = 'icons/obj/items.dmi'
icon_state = "gift2-r"
item_state = "gift"
pressure_resistance = 70
desc = "I wonder what's inside!?"
var/list/giftpaths = list()
New()
..()
src.icon_state = "gift[rand(1,3)]-[pick("r", "rs", "g", "gs")]"
dangerous
giftpaths = list(/obj/item/device/flash, /obj/item/gun/energy/taser_gun, /obj/item/sword, /obj/item/axe, /obj/item/knife_butcher, /obj/item/old_grenade/light_gimmick)
festive
giftpaths = list(/obj/item/basketball, /obj/item/clothing/head/cakehat, /obj/item/clothing/mask/melons, /obj/item/old_grenade/banana,
/obj/item/bikehorn, /obj/item/luggable_computer, /obj/item/horseshoe, /obj/item/clothing/suit/sweater/red, /obj/item/clothing/suit/sweater,
/obj/item/clothing/suit/sweater/green, /obj/item/clothing/glasses/monocle)
easter
name = "easter egg"
icon_state = "easter_egg"
giftpaths = list(/obj/item/bikehorn, /obj/item/vuvuzela, /obj/item/horseshoe, /obj/item/clothing/glasses/monocle, /obj/item/coin, /obj/item/clothing/gloves/fingerless,
/obj/item/clothing/mask/spiderman, /obj/item/clothing/shoes/flippers, /obj/item/clothing/under/gimmick/cosby, /obj/item/clothing/head/waldohat, /obj/item/emeter, /obj/item/football,
/obj/item/skull, /obj/racing_clowncar/kart, /obj/item/old_grenade/moustache, /obj/item/implanter/microbomb, /obj/item/reagent_containers/food/snacks/cereal_box, /obj/item/reagent_containers/food/snacks/candy/wrapped_pbcup)
New()
return
easter/duck
giftpaths = list(/obj/item/bikehorn, /obj/item/vuvuzela, /obj/item/horseshoe, /obj/item/clothing/glasses/monocle, /obj/item/coin, /obj/item/clothing/gloves/fingerless, /obj/item/saxophone, /obj/item/clothing/mask/cursedclown_hat, /obj/item/clothing/mask/spiderman, /obj/item/clothing/shoes/flippers, /obj/item/clothing/under/gimmick/cosby, /obj/item/clothing/head/waldohat, /obj/item/emeter,
/obj/item/skull, /obj/item/reagent_containers/food/snacks/cereal_box, /obj/item/reagent_containers/food/snacks/candy/wrapped_pbcup)
/obj/item/a_gift/attack_self(mob/M as mob)
if (!giftpaths.len)
boutput(M, "<span style=\"color:blue\">The gift was empty!</span>")
qdel(src)
return
var/prizepath = pick(giftpaths)
var/obj/item/prize = new prizepath
if (!istype(prize) && prize)
prize.set_loc(get_turf(M))
qdel(src)
return
M.u_equip(src)
M.put_in_hand_or_drop(prize)
modify_christmas_cheer(2)
qdel(src)
/obj/item/a_gift/ex_act()
qdel(src)
return
/obj/spresent // bandaid fix for presents having no icon or name other than "spresent"
name = "present"
desc = "What could it be?"
icon = 'icons/obj/items.dmi'
icon_state = "strange-r"
/obj/spresent/relaymove(mob/user as mob)
if (user.stat)
return
boutput(user, "<span style=\"color:blue\">You can't move.</span>")
/obj/spresent/attackby(obj/item/W as obj, mob/user as mob)
if (!istype(W, /obj/item/wirecutters))
boutput(user, "<span style=\"color:blue\">I need wirecutters for that.</span>")
return
boutput(user, "<span style=\"color:blue\">You cut open the present.</span>")
for(var/mob/M in src) //Should only be one but whatever.
M.set_loc(src.loc)
qdel(src)
+337
View File
@@ -0,0 +1,337 @@
/*
CONTAINS:
GLASS SHEET
REINFORCED GLASS SHEET
SHARDS
*/
/obj/item/sheet/glass
name = "glass"
icon = 'icons/obj/glass.dmi'
icon_state = "sheet"
force = 5.0
g_amt = 3750
throwforce = 5
w_class = 3.0
var/crystal = 0
var/reinforced = 0
throw_speed = 3
throw_range = 3
desc = "A collection of chemically treated and strengthened sheets of glass. Useful for construction, especially for windows."
//cogwerks - burn vars
burn_point = 7000
burn_output = 7500
burn_possible = 1
health = 5
burn_type = 1
before_stack(atom/movable/O as obj, mob/user as mob)
user.visible_message("<span style=\"color:blue\">[user] begins stacking glass sheets!</span>")
after_stack(atom/movable/O as obj, mob/user as mob, var/added)
boutput(user, "<span style=\"color:blue\">You finish stacking glass.</span>")
attack_hand(mob/user as mob)
if((user.r_hand == src || user.l_hand == src) && src.amount > 1)
var/splitnum = round(input("How many sheets do you want to take from the stack?","Stack of [src.amount]",1) as num)
var/diff = src.amount - splitnum
if (splitnum >= amount || splitnum < 1)
boutput(user, "<span style=\"color:red\">Invalid entry, try again.</span>")
return
boutput(usr, "<span style=\"color:blue\">You take [splitnum] sheets from the stack, leaving [diff] sheets behind.</span>")
src.amount = diff
var/obj/item/sheet/glass/new_stack = new src.type(usr.loc, diff)
new_stack.amount = splitnum
new_stack.attack_hand(user)
new_stack.add_fingerprint(user)
else
..(user)
attackby(obj/item/W, mob/user)
//if ( istype(W, /obj/item/sheet/glass) )
if ( W.type == src.type )
var/obj/item/sheet/glass/G = W
if (G.amount >= src.max_stack)
boutput(user, "<span style=\"color:red\">You can't put any more sheets in this stack!</span>")
return
if (G.amount + src.amount > src.max_stack)
src.amount = min(G.amount + src.amount, src.max_stack)
G.amount = 5
boutput(user, "<span style=\"color:blue\">You add the glass sheets to the stack. It now has [G.amount] sheets.</span>")
else
G.amount += src.amount
boutput(user, "<span style=\"color:blue\">You add the glass sheet to the stack. It now has [G.amount] sheets.</span>")
//SN src = null
qdel(src)
return
return
else if( istype(W, /obj/item/rods) && !reinforced)
var/obj/item/rods/V = W
var/obj/item/sheet/glass/R
if(crystal)
R = new /obj/item/sheet/glass/crystal/reinforced(user.loc)
else
R = new /obj/item/sheet/glass/reinforced(user.loc)
R.set_loc(user.loc)
R.add_fingerprint(user)
if(V.amount == 1)
user.u_equip(W)
qdel(W)
else
V.amount--
if(src.amount == 1)
user.u_equip(src)
qdel(src)
else
src.amount--
return
examine()
set src in view(1)
..()
boutput(usr, text("There are [] glass sheet\s on the stack.", src.amount))
return
attack_self(mob/user as mob)
if (!( istype(usr.loc, /turf/simulated) ))
return
switch(alert("Sheet-Glass", "Would you like full tile glass or one direction?", "one direct", "full (2 sheets)", "cancel", null))
if("one direct")
var/obj/window/W
if(!crystal && !reinforced)
W = new /obj/window( usr.loc )
if(src.material) W.setMaterial(src.material)
logTheThing("station", usr, null, "builds a Window in [usr.loc.loc] ([showCoords(usr.x, usr.y, usr.z)])")
else if(!crystal && reinforced)
W = new /obj/window/reinforced( usr.loc )
if(src.material) W.setMaterial(src.material)
logTheThing("station", usr, null, "builds a Reinforced Window in [usr.loc.loc] ([showCoords(usr.x, usr.y, usr.z)])")
else if(crystal && !reinforced)
W = new /obj/window/crystal( usr.loc )
if(src.material) W.setMaterial(src.material)
logTheThing("station", usr, null, "builds a Crystal Window in [usr.loc.loc] ([showCoords(usr.x, usr.y, usr.z)])")
else if(crystal && reinforced)
W = new /obj/window/crystal/reinforced( usr.loc )
if(src.material) W.setMaterial(src.material)
logTheThing("station", usr, null, "builds a Reinforced Crystal Window in [usr.loc.loc] ([showCoords(usr.x, usr.y, usr.z)])")
W.anchored = 0
W.state = 0
W.dir = 2
W.ini_dir = 2
if (src.amount < 1)
return
src.amount--
if("full (2 sheets)")
if (src.amount < 2)
return
src.amount -= 2
var/obj/window/W
if(!crystal && !reinforced)
W = new /obj/window( usr.loc )
if(src.material) W.setMaterial(src.material)
logTheThing("station", usr, null, "builds a Full Window in [usr.loc.loc] ([showCoords(usr.x, usr.y, usr.z)])")
else if(!crystal && reinforced)
W = new /obj/window/reinforced( usr.loc )
if(src.material) W.setMaterial(src.material)
logTheThing("station", usr, null, "builds a Full Reinforced Window in [usr.loc.loc] ([showCoords(usr.x, usr.y, usr.z)])")
else if(crystal && !reinforced)
W = new /obj/window/crystal( usr.loc )
if(src.material) W.setMaterial(src.material)
logTheThing("station", usr, null, "builds a Full Crystal Window in [usr.loc.loc] ([showCoords(usr.x, usr.y, usr.z)])")
else if(crystal && reinforced)
W = new /obj/window/crystal/reinforced( usr.loc )
if(src.material) W.setMaterial(src.material)
logTheThing("station", usr, null, "builds a Full Reinforced Crystal Window in [usr.loc.loc] ([showCoords(usr.x, usr.y, usr.z)])")
W.dir = SOUTHWEST
W.ini_dir = SOUTHWEST
W.anchored = 0
W.state = 0
else
if (src.amount <= 0)
user.u_equip(src)
qdel(src)
return
return
// REINFORCED GLASS
/obj/item/sheet/glass/reinforced
name = "reinforced glass"
icon = 'icons/obj/glass.dmi'
icon_state = "sheet-r"
item_state = "sheet-rglass"
force = 6.0
g_amt = 3750
m_amt = 1875
throwforce = 5
w_class = 3.0
throw_speed = 3
throw_range = 3
reinforced = 1
desc = "A collection of strong glass reinforced with metal rods. Used to make tough windows."
/obj/item/sheet/glass/crystal/reinforced
name = "reinforced crystal glass"
icon = 'icons/obj/glass.dmi'
icon_state = "sheet-cr"
item_state = "sheet-crglass"
force = 6.0
g_amt = 4750
m_amt = 2875
throwforce = 5
w_class = 3.0
throw_speed = 3
throw_range = 3
reinforced = 1
crystal = 1
desc = "A collection of plasma crystal glass, reinforced with metal rods. Used to make extremely tough windows."
/obj/item/sheet/glass/crystal
name = "crystal glass"
icon = 'icons/obj/glass.dmi'
icon_state = "sheet-c"
item_state = "sheet-cglass"
force = 6.0
g_amt = 4750
throwforce = 5
w_class = 3.0
throw_speed = 3
throw_range = 3
crystal = 1
desc = "A collection of plasma crystal glass. Used to make very tough windows."
// SHARDS
/obj/item/shard
name = "shard"
icon = 'shards.dmi'
inhand_image_icon = 'icons/mob/inhand/hand_tools.dmi'
icon_state = "large"
desc = "Could probably be used as ... a throwing weapon?"
w_class = 3.0
force = 5.0
throwforce = 15.0
item_state = "shard-glass"
g_amt = 3750
burn_type = 1
stamina_damage = 5
stamina_cost = 15
stamina_crit_chance = 35
/obj/item/shard/Bump()
spawn( 0 )
if (prob(20))
src.force = 15
else
src.force = 4
..()
return
return
/obj/item/shard/New()
//****RM
//boutput(world, "New shard at [x],[y],[z]")
src.icon_state = pick("large", "medium", "small")
switch(src.icon_state)
if("small")
src.pixel_x = rand(1, 18)
src.pixel_y = rand(1, 18)
if("medium")
src.pixel_x = rand(1, 16)
src.pixel_y = rand(1, 16)
if("large")
src.pixel_x = rand(1, 10)
src.pixel_y = rand(1, 5)
else
return
/obj/item/shard/attackby(obj/item/W as obj, mob/user as mob)
..()
if (!( istype(W, /obj/item/weldingtool) && W:welding ))
return
W:eyecheck(user)
var/atom/A = new /obj/item/sheet/glass( user.loc )
if(src.material) A.setMaterial(src.material)
//SN src = null
qdel(src)
return
/obj/item/shard/HasEntered(AM as mob|obj)
if(ismob(AM))
var/mob/M = AM
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(istype(H.mutantrace, /datum/mutantrace/abomination))
return
if(!H.shoes)
boutput(H, "<span style=\"color:red\"><B>You step in the broken glass!</B></span>")
playsound(src.loc, "sound/misc/glass_step.ogg", 50, 1)
var/obj/item/affecting = H.organs[pick("l_leg", "r_leg")]
H.weakened = max(3, H.weakened)
affecting.take_damage(5, 0)
H.UpdateDamageIcon()
H.updatehealth()
..()
// CRYSTAL
/obj/item/shard/crystal
name = "crystal shard"
icon = 'shards.dmi'
icon_state = "clarge"
desc = "A shard of Plasma Crystal. Very hard and sharp."
w_class = 3.0
force = 10.0
throwforce = 20.0
item_state = "shard-glass"
g_amt = 0
New()
src.icon_state = pick("clarge", "cmedium", "csmall")
switch(src.icon_state)
if("csmall")
src.pixel_x = rand(1, 18)
src.pixel_y = rand(1, 18)
if("cmedium")
src.pixel_x = rand(1, 16)
src.pixel_y = rand(1, 16)
if("clarge")
src.pixel_x = rand(1, 10)
src.pixel_y = rand(1, 5)
else
return
attackby(obj/item/W as obj, mob/user as mob)
if (!( istype(W, /obj/item/weldingtool) && W:welding ))
return
W:eyecheck(user)
var/atom/A = new /obj/item/sheet/glass/crystal( user.loc )
if(src.material) A.setMaterial(src.material)
qdel(src)
return
HasEntered(AM as mob|obj)
if(ismob(AM))
var/mob/M = AM
boutput(M, "<span style=\"color:red\"><B>You step on the crystal shard!</B></span>")
playsound(src.loc, "sound/misc/glass_step.ogg", 50, 1)
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/obj/item/affecting = H.organs[pick("l_leg", "r_leg")]
H.weakened = max(3, H.weakened)
affecting.take_damage(10, 0)
H.UpdateDamageIcon()
H.updatehealth()
+156
View File
@@ -0,0 +1,156 @@
/obj/item/grab
flags = SUPPRESSATTACK
var/mob/living/assailant
var/mob/living/affecting
var/state = 0 // 0 = passive, 1 aggressive, 2 neck, 3 kill
var/choke_count = 0
icon = 'icons/mob/hud_human_new.dmi'
icon_state = "reinforce"
name = "grab"
w_class = 5
New()
..()
spawn(0)
var/icon/hud_style = hud_style_selection[get_hud_style(src.assailant)]
if (isicon(hud_style))
src.icon = hud_style
disposing()
if(affecting)
if (state == 3)
logTheThing("combat", src.assailant, src.affecting, "releases their choke on %target% after [choke_count] cycles")
else
logTheThing("combat", src.assailant, src.affecting, "drops their grab on %target%")
affecting.grabbed_by -= src
affecting = null
assailant = null
..()
dropped()
qdel(src)
process()
if (check())
return
var/mob/living/carbon/human/H
if(istype(src.affecting, /mob/living/carbon/human))
H = src.affecting
if (src.state >= 2)
if (!src.affecting.buckled)
src.affecting.set_loc(src.assailant.loc)
if(H) H.remove_stamina(STAMINA_REGEN+7)
if (src.state == 3)
//src.affecting.losebreath++
//if (src.affecting.paralysis < 2)
// src.affecting.paralysis = 2
if(H)
choke_count++
H.remove_stamina(STAMINA_REGEN+7)
H.stamina_stun()
if(H.stamina <= -75)
H.losebreath += 2
else if(H.stamina <= -50)
H.losebreath++
else if(H.stamina <= -33)
if(prob(33)) H.losebreath++
update_icon()
attack(atom/target, mob/user)
if (check())
return
if (target == src.affecting)
attack_self()
return
attack_hand(mob/user)
return
attack_self(mob/user)
if (!user)
return
if (check())
return
switch (src.state)
if (0)
if (prob(75))
logTheThing("combat", src.assailant, src.affecting, "'s grip upped to aggressive on %target%")
for(var/mob/O in AIviewers(src.assailant, null))
O.show_message("<span style=\"color:red\">[src.assailant] has grabbed [src.affecting] aggressively (now hands)!</span>", 1)
icon_state = "reinforce"
src.state = 1
else
for(var/mob/O in AIviewers(src.assailant, null))
O.show_message("<span style=\"color:red\">[src.assailant] has failed to grab [src.affecting] aggressively!</span>", 1)
/*if (!disable_next_click) this actually is always gunna be a mob so we want to use next click even if disabled
*/user.next_click = world.time + 10
if (1)
if (ishuman(src.affecting))
var/mob/living/carbon/human/H = src.affecting
if (H.bioHolder.HasEffect("fat"))
boutput(src.assailant, "<span style=\"color:blue\">You can't strangle [src.affecting] through all that fat!</span>")
return
for (var/obj/item/clothing/C in list(H.head, H.wear_suit, H.wear_mask, H.w_uniform))
if (C.body_parts_covered & HEAD)
boutput(src.assailant, "<span style=\"color:blue\">You have to take off [src.affecting]'s [C.name] first!</span>")
return
icon_state = "!reinforce"
src.state = 2
if (!src.affecting.buckled)
src.affecting.set_loc(src.assailant.loc)
src.assailant.lastattacked = src.affecting
src.affecting.lastattacker = src.assailant
src.affecting.lastattackertime = world.time
logTheThing("combat", src.assailant, src.affecting, "'s grip upped to neck on %target%")
for(var/mob/O in AIviewers(src.assailant, null))
O.show_message("<span style=\"color:red\">[src.assailant] has reinforced [his_or_her(assailant)] grip on [src.affecting] (now neck)!</span>", 1)
if (2)
icon_state = "disarm/kill"
logTheThing("combat", src.assailant, src.affecting, "chokes %target%")
choke_count = 0
for (var/mob/O in AIviewers(src.assailant, null))
O.show_message("<span style=\"color:red\">[src.assailant] has tightened [his_or_her(assailant)] grip on [src.affecting]'s neck!</span>", 1)
src.state = 3
src.assailant.lastattacked = src.affecting
src.affecting.lastattacker = src.assailant
src.affecting.lastattackertime = world.time
if (!src.affecting.buckled)
src.affecting.set_loc(src.assailant.loc)
if (src.assailant.bioHolder.HasEffect("fat"))
src.affecting.unlock_medal("Bear Hug", 1)
//src.affecting.losebreath++
//if (src.affecting.paralysis < 2)
// src.affecting.paralysis = 2
src.affecting.stunned = max(src.affecting.stunned, 3)
if (ishuman(src.affecting))
var/mob/living/carbon/human/H = src.affecting
H.set_stamina(min(0, H.stamina))
if (/*!disable_next_click && */user)
user.next_click = world.time + 10
if (3)
src.state = 2
logTheThing("combat", src.assailant, src.affecting, "releases their choke on %target% after [choke_count] cycles")
for (var/mob/O in AIviewers(src.assailant, null))
O.show_message("<span style=\"color:red\">[src.assailant] has loosened [his_or_her(assailant)] grip on [src.affecting]'s neck!</span>", 1)
/*if (!disable_next_click) same as before
*/user.next_click = world.time + 10
update_icon()
proc/check()
if (!src.affecting || get_dist(src.assailant, src.affecting) > 1 || src.loc != src.assailant)
qdel(src)
return 1
return 0
proc/update_icon()
switch (src.state)
if (0)
icon_state = "reinforce"
if (1)
icon_state = "!reinforce"
if (2)
icon_state = "disarm/kill"
if (3)
icon_state = "disarm/kill1"
File diff suppressed because it is too large Load Diff
+679
View File
@@ -0,0 +1,679 @@
//////////////////////////////// Parent ////////////////////////////
/obj/item/ammo
name = "ammo"
var/sname = "Generic Ammo"
icon = 'icons/obj/ammo.dmi'
flags = FPRINT | TABLEPASS| CONDUCT
item_state = "syringe_kit"
m_amt = 40000
g_amt = 0
throwforce = 2
w_class = 1.0
throw_speed = 4
throw_range = 20
var/datum/projectile/ammo_type
var/caliber = null
stamina_damage = 5
stamina_cost = 5
stamina_crit_chance = 5
proc
update_icon()
return
swap(var/obj/item/ammo/A)
return
use(var/amt = 0)
return 0
/////////////////////////////// Bullets for kinetic firearms /////////////////////////////////
// caliber list: update as needed
// 0.308 - rifles
// 0.357 - revolver
// 0.38 - detective
// 0.41 - derringer
// 0.72 - shotgun shell, 12ga
// 1.57 - 40mm grenade shell
// 1.58 - RPG-7 (Tube is 40mm too, though warheads are usually larger in diameter.)
/obj/item/ammo/bullets
name = "Ammo box"
sname = "Bullets"
desc = "A box of ammo"
icon = 'icons/obj/ammo.dmi'
icon_state = "power_cell"
m_amt = 40000
g_amt = 0
var/amount_left = 0.0
var/max_amount = 1000
ammo_type = new/datum/projectile/bullet
module_research = list("weapons" = 2, "miniaturization" = 5)
module_research_type = /obj/item/ammo/bullets
var/icon_dynamic = 0 // For dynamic desc and/or icon updates (Convair880).
var/icon_short = null // If dynamic = 1, the short icon_state has to be specified as well.
var/icon_empty = null
// This is needed to avoid duplicating empty magazines (Convair880).
var/delete_on_reload = 0
New()
spawn(20)
src.update_icon() // So we get dynamic updates right off the bat. Screw static descs.
return
use(var/amt = 0)
if(amount_left >= amt)
amount_left -= amt
update_icon()
return 1
else
src.update_icon()
return 0
swap(var/obj/item/ammo/bullets/A, var/obj/item/gun/kinetic/K)
// I tweaked this for improved user feedback and to support zip guns (Convair880).
var/check = 0
if (!A || !K)
check = 0
if (K.sanitycheck() == 0)
check = 0
if (A.caliber == K.caliber)
check = 1
else if (A.caliber in K.caliber) // Some guns can have multiple calibers.
check = 1
else if (K.caliber == null) // Special treatment for zip guns, huh.
check = 1
if (!check)
return 0
//DEBUG("Couldn't swap [K]'s ammo ([K.ammo.type]) with [A.type].")
// The gun may have been fired; eject casings if so.
K.ejectcasings()
// We can't delete A here, because there's going to be ammo left over.
if (K.max_ammo_capacity < A.amount_left)
// Some ammo boxes have dynamic icon/desc updates we can't get otherwise.
var/obj/item/ammo/bullets/ammoDrop = new K.ammo.type
ammoDrop.amount_left = K.ammo.amount_left
ammoDrop.name = K.ammo.name
ammoDrop.icon = K.ammo.icon
ammoDrop.icon_state = K.ammo.icon_state
ammoDrop.ammo_type = K.ammo.ammo_type
ammoDrop.delete_on_reload = 1 // No duplicating empty magazines, please.
ammoDrop.update_icon()
usr.put_in_hand_or_drop(ammoDrop)
K.ammo.amount_left = 0 // Make room for the new ammo.
K.ammo.loadammo(A, K) // Let the other proc do the work for us.
//DEBUG("Swapped [K]'s ammo with [A.type]. There are [A.amount_left] round left over.")
return 2
else
usr.u_equip(A) // We need a free hand for ammoHand first.
// Some ammo boxes have dynamic icon/desc updates we can't get otherwise.
var/obj/item/ammo/bullets/ammoHand = new K.ammo.type
ammoHand.amount_left = K.ammo.amount_left
ammoHand.name = K.ammo.name
ammoHand.icon = K.ammo.icon
ammoHand.icon_state = K.ammo.icon_state
ammoHand.ammo_type = K.ammo.ammo_type
ammoHand.delete_on_reload = 1 // No duplicating empty magazines, please.
ammoHand.update_icon()
usr.put_in_hand_or_drop(ammoHand)
var/obj/item/ammo/bullets/ammoGun = new A.type // Ditto.
ammoGun.amount_left = A.amount_left
ammoGun.name = A.name
ammoGun.icon = A.icon
ammoGun.icon_state = A.icon_state
ammoGun.ammo_type = A.ammo_type
//DEBUG("Swapped [K]'s ammo with [A.type].")
qdel(K.ammo) // Make room for the new ammo.
qdel(A) // We don't need you anymore.
ammoGun.set_loc(K)
K.ammo = ammoGun
K.current_projectile = ammoGun.ammo_type
K.update_icon()
return 1
proc/loadammo(var/obj/item/ammo/bullets/A, var/obj/item/gun/kinetic/K)
// Also see attackby() in kinetic.dm.
if (!A || !K)
return 0 // Error message.
if (K.sanitycheck() == 0)
return 0
var/check = 0
if (A.caliber == K.caliber)
check = 1
else if (A.caliber in K.caliber)
check = 1
else if (K.caliber == null)
check = 1 // For zip guns.
if (!check)
return 1
K.add_fingerprint(usr)
A.add_fingerprint(usr)
if (K.ammo.amount_left < 0)
K.ammo.amount_left = 0
if (A.amount_left < 1)
return 2 // Magazine's empty.
if (K.ammo.amount_left >= K.max_ammo_capacity)
if (K.ammo.ammo_type.type != A.ammo_type.type)
return 6 // Call swap().
return 3 // Gun's full.
if (K.ammo.amount_left > 0 && K.ammo.ammo_type.type != A.ammo_type.type)
return 6 // Call swap().
else
// The gun may have been fired; eject casings if so (Convair880).
K.ejectcasings()
// Required for swap() to work properly (Convair880).
if (K.ammo.type != A.type)
var/obj/item/ammo/bullets/ammoGun = new A.type
ammoGun.amount_left = K.ammo.amount_left
ammoGun.ammo_type = K.ammo.ammo_type
qdel(K.ammo)
ammoGun.set_loc(K)
K.ammo = ammoGun
//DEBUG("Equalized [K]'s ammo type to [A.type]")
while ((A.amount_left > 0) && (K.ammo.amount_left < K.max_ammo_capacity))
A.amount_left--
K.ammo.amount_left++
K.ammo.ammo_type = A.ammo_type
K.current_projectile = A.ammo_type
if ((A.amount_left < 1) && (K.ammo.amount_left < K.max_ammo_capacity))
A.update_icon()
K.update_icon()
K.ammo.update_icon()
if (A.delete_on_reload)
//DEBUG("[K]: [A.type] (now empty) was deleted on partial reload.")
qdel(A) // No duplicating empty magazines, please (Convair880).
return 4 // Couldn't fully reload the gun.
if ((A.amount_left >= 0) && (K.ammo.amount_left == K.max_ammo_capacity))
A.update_icon()
K.update_icon()
K.ammo.update_icon()
if (A.amount_left == 0)
if (A.delete_on_reload)
//DEBUG("[K]: [A.type] (now empty) was deleted on full reload.")
qdel(A) // No duplicating empty magazines, please (Convair880).
return 5 // Full reload or ammo left over.
update_icon()
if (src.amount_left < 0)
src.amount_left = 0
src.desc = text("There are [] bullet\s left!", src.amount_left)
if (src.amount_left > 0)
if (src.icon_dynamic && src.icon_short)
src.icon_state = text("[src.icon_short]-[src.amount_left]")
else
if (src.icon_empty)
src.icon_state = src.icon_empty
return
/obj/item/ammo/bullets/derringer
sname = ".41 RF"
name = ".41 ammo box"
icon_state = "357-2"
amount_left = 2.0
max_amount = 2.0
ammo_type = new/datum/projectile/bullet/derringer
caliber = 0.41
icon_dynamic = 1
icon_short = "357"
icon_empty = "357-0"
/obj/item/ammo/bullets/custom
sname = ".22 LR Custom"
name = "custom .22 ammo box"
icon_state = "custom-8"
amount_left = 8.0
max_amount = 8.0
ammo_type = new/datum/projectile/bullet/custom
caliber = 0.22
icon_dynamic = 1
icon_short = "custom"
icon_empty = "custom-0"
onMaterialChanged()
ammo_type.material = src.material
if(src.material)
ammo_type.power = round(material.getProperty(PROP_HARDNESS) / 3)
ammo_type.dissipation_delay = material.getProperty(PROP_TOUGHNESS)
ammo_type.ks_ratio = max(0,round(material.getProperty(PROP_COMPRESSIVE) / 75))
if((src.material.material_flags & MATERIAL_CRYSTAL))
ammo_type.damage_type = D_PIERCING
if((src.material.material_flags & MATERIAL_METAL))
ammo_type.damage_type = D_KINETIC
if((src.material.material_flags & MATERIAL_ORGANIC))
ammo_type.damage_type = D_TOXIC
if((src.material.material_flags & MATERIAL_ENERGY))
ammo_type.damage_type = D_ENERGY
if((src.material.material_flags & MATERIAL_METAL) && (src.material.material_flags & MATERIAL_CRYSTAL))
ammo_type.damage_type = D_SLASHING
if((src.material.material_flags & MATERIAL_ENERGY) && (src.material.material_flags & MATERIAL_ORGANIC))
ammo_type.damage_type = D_BURNING
if((src.material.material_flags & MATERIAL_ENERGY) && (src.material.material_flags & MATERIAL_METAL))
ammo_type.damage_type = D_RADIOACTIVE
return ..()
/obj/item/ammo/bullets/bullet_22
sname = ".22 LR"
name = ".22 magazine"
icon_state = "pistol_clip"
amount_left = 10.0
max_amount = 10.0
ammo_type = new/datum/projectile/bullet/bullet_22
caliber = 0.22
/obj/item/ammo/bullets/a357
sname = ".357 Mag"
name = ".357 speedloader"
icon_state = "38-7"
amount_left = 7.0
max_amount = 7.0
ammo_type = new/datum/projectile/bullet/revolver_357
caliber = 0.357
icon_dynamic = 1
icon_short = "38"
icon_empty = "speedloader_empty"
/obj/item/ammo/bullets/a357/AP
sname = ".357 Mag AP"
name = ".357 AP speedloader"
icon_state = "38A-7"
ammo_type = new/datum/projectile/bullet/revolver_357/AP
icon_dynamic = 1
icon_short = "38A"
icon_empty = "speedloader_empty"
/obj/item/ammo/bullets/a38
sname = ".38 Spc"
name = ".38 speedloader"
icon_state = "38-7"
amount_left = 7.0
max_amount = 7.0
ammo_type = new/datum/projectile/bullet/revolver_38
caliber = 0.38
icon_dynamic = 1
icon_short = "38"
icon_empty = "speedloader_empty"
/obj/item/ammo/bullets/a38/AP
sname = ".38 Spc AP"
name = ".38 AP speedloader"
icon_state = "38A-7"
amount_left = 7.0
max_amount = 7.0
ammo_type = new/datum/projectile/bullet/revolver_38/AP
icon_dynamic = 1
icon_short = "38A"
icon_empty = "speedloader_empty"
/obj/item/ammo/bullets/a38/stun
sname = ".38 Spc Stun"
name = ".38 Stun speedloader"
icon_state = "38S-7"
amount_left = 7.0
max_amount = 7.0
ammo_type = new/datum/projectile/bullet/revolver_38/stunners
icon_dynamic = 1
icon_short = "38S"
icon_empty = "speedloader_empty"
/obj/item/ammo/bullets/a12
sname = "12ga Buckshot"
name = "12ga buckshot ammo box"
ammo_type = new/datum/projectile/bullet/a12
icon_state = "12"
amount_left = 8.0
max_amount = 8.0
caliber = 0.72
icon_dynamic = 0
icon_empty = "12-0"
/obj/item/ammo/bullets/aex
sname = "12ga AEX"
name = "12ga AEX ammo box"
ammo_type = new/datum/projectile/bullet/aex
icon_state = "AEX"
amount_left = 8.0
max_amount = 8.0
caliber = 0.72
icon_dynamic = 0
icon_empty = "AEX-0"
/obj/item/ammo/bullets/abg
sname = "12ga Rubber Slug"
name = "12ga rubber slugs"
ammo_type = new/datum/projectile/bullet/abg
icon_state = "bg"
amount_left = 8.0
max_amount = 8.0
caliber = 0.72
icon_dynamic = 0
icon_empty = "bg-0"
/obj/item/ammo/bullets/ak47
sname = ".308 Auto" // This makes little sense, but they're all chambered in the same caliber, okay (Convair880)?
name = "AK magazine"
ammo_type = new/datum/projectile/bullet/ak47
icon_state = "ak47"
amount_left = 30.0
max_amount = 30.0
caliber = 0.308
/obj/item/ammo/bullets/rifle_3006
sname = ".308 AP"
name = ".308 rifle magazine"
ammo_type = new/datum/projectile/bullet/rifle_3006
icon_state = "rifle_clip"
amount_left = 4
max_amount = 4
caliber = 0.308
/obj/item/ammo/bullets/tranq_darts
sname = ".308 Tranquilizer"
name = ".308 tranquilizer darts"
ammo_type = new/datum/projectile/bullet/tranq_dart
icon_state = "tranq_clip"
amount_left = 4
max_amount = 4
caliber = 0.308
syndicate
sname = ".308 Tranquilizer Deluxe"
ammo_type = new/datum/projectile/bullet/tranq_dart/syndicate
anti_mutant
sname = ".308 Mutadone"
name = ".308 mutadone darts"
ammo_type = new/datum/projectile/bullet/tranq_dart/anti_mutant
/obj/item/ammo/bullets/vbullet
sname = "VR bullets"
name = "VR magazine"
ammo_type = new/datum/projectile/bullet/vbullet
icon_state = "ak47"
amount_left = 200
/obj/item/ammo/bullets/flare
sname = "12ga Flare"
name = "12ga flares"
amount_left = 8
max_amount = 8
icon_state = "12"
ammo_type = new/datum/projectile/bullet/flare
caliber = 0.72
icon_dynamic = 0
icon_empty = "12-0"
single
amount_left = 1
max_amount = 1
/obj/item/ammo/bullets/autocannon
sname = "40mm HE"
name = "40mm HE shells"
amount_left = 2
max_amount = 2
icon_state = "40mmR"
ammo_type = new/datum/projectile/bullet/autocannon
caliber = 1.57
w_class = 3
icon_dynamic = 0
icon_empty = "40mmR-0"
single
amount_left = 1
max_amount = 1
/obj/item/ammo/bullets/smoke
sname = "40mm Smoke"
name = "40mm smoke shells"
amount_left = 5
max_amount = 5
icon_state = "40mmB"
ammo_type = new/datum/projectile/bullet/smoke
caliber = 1.57
w_class = 3
icon_dynamic = 0
icon_empty = "40mmB-0"
single
amount_left = 1
max_amount = 1
// Ported from old, non-gun RPG-7 object class (Convair880).
/obj/item/ammo/bullets/rpg
sname = "MPRT rocket"
name = "MPRT rocket"
amount_left = 1
max_amount = 1
icon = 'icons/obj/projectiles.dmi'
icon_state = "rpg_rocket"
ammo_type = new /datum/projectile/bullet/rpg
caliber = 1.58
w_class = 3
delete_on_reload = 1
/obj/item/ammo/bullets/rod
sname = "metal rod"
name = "metal rod"
force = 4
amount_left = 2
max_amount = 2
icon = 'icons/obj/projectiles.dmi'
icon_state = "rod_1"
ammo_type = new/datum/projectile/bullet/rod
caliber = 1.0
//////////////////////////////////// Power cells for eguns //////////////////////////
/obj/item/ammo/power_cell
name = "Power Cell"
desc = "A power cell that holds a max of 100PU"
icon = 'icons/obj/ammo.dmi'
icon_state = "power_cell"
m_amt = 10000
g_amt = 20000
var/charge = 100.0
var/max_charge = 100.0
module_research = list("weapons" = 1, "energy" = 5, "miniaturization" = 5)
module_research_type = /obj/item/ammo/power_cell
onMaterialChanged()
..()
if(istype(src.material))
max_charge = round((material.getProperty(PROP_ELECTRICAL) + material.getProperty(PROP_DIELECTRIC)) * 1.5)
charge = max_charge
return
New()
update_icon()
..()
disposing()
if (src in processing_items)
processing_items.Remove(src)
..()
emp_act()
src.use(INFINITY)
return
update_icon()
if (src.artifact) return
overlays = null
var/ratio = src.charge / src.max_charge
ratio = round(ratio, 0.20) * 100
switch(ratio)
if(20)
overlays += "cell_1/5"
if(40)
overlays += "cell_2/5"
if(60)
overlays += "cell_3/5"
if(80)
overlays += "cell_4/5"
if(100)
overlays += "cell_5/5"
return
examine()
if (src.artifact)
boutput(usr, text("You have no idea what this thing is!"))
return
..()
boutput(usr, "There are [src.charge]/[src.max_charge] PU left!")
return
use(var/amt = 0)
if (src.charge <= 0)
src.charge = 0
return 0
else
if (amt > 0)
src.charge = max(0, src.charge - amt)
src.update_icon()
return 1
else
return 0
swap(var/obj/item/gun/energy/E)
if(!istype(E.cell,/obj/item/ammo/power_cell))
return 0
var/obj/item/ammo/power_cell/temp = E.cell
var/mob/living/M = src.loc
if(!istype(M) || src != M.equipped())
return 0
M.u_equip(src) // Fixed an instance of item teleportation here (Convair880).
src.set_loc(E)
E.cell = src
M.put_in_hand_or_drop(temp)
src.add_fingerprint(M)
E.update_icon()
temp.update_icon()
src.update_icon()
return 1
proc
charge(var/amt = 0)
if (src.charge >= src.max_charge)
src.charge = src.max_charge
return 0
else
if (amt > 0)
src.charge = min(src.charge + amt, src.max_charge)
src.update_icon()
return 1
else
return 0
/obj/item/ammo/power_cell/med_power
name = "Power Cell - 200"
desc = "A power cell that holds a max of 200PU"
icon = 'icons/obj/ammo.dmi'
icon_state = "power_cell"
m_amt = 15000
g_amt = 30000
charge = 200.0
max_charge = 200.0
/obj/item/ammo/power_cell/high_power
name = "Power Cell - 300"
desc = "A power cell that holds a max of 300PU"
icon = 'icons/obj/ammo.dmi'
icon_state = "power_cell"
m_amt = 20000
g_amt = 40000
charge = 300.0
max_charge = 300.0
/obj/item/ammo/power_cell/self_charging
name = "Power Cell - Atomic"
desc = "A self-contained radioisotope power cell that slowly recharges an internal capacitor. Holds 40PU."
icon = 'icons/obj/ammo.dmi'
icon_state = "recharger_cell"
m_amt = 18000
g_amt = 38000
charge = 40.0
max_charge = 40.0
var/cycle = 0 //Recharge every other tick.
var/recharge_rate = 5.0
New()
if (!(src in processing_items))
processing_items.Add(src)
..()
return
charge(var/amt = 0)
if (src.charge < src.max_charge)
if (!(src in processing_items))
processing_items.Add(src)
return ..()
use(var/amt = 0)
if (!(src in processing_items))
processing_items.Add(src)
return ..()
process()
src.cycle = !src.cycle // Charge every four seconds.
if (src.cycle)
return
src.charge = min(charge + recharge_rate, max_charge)
src.update_icon()
if (src.charge >= src.max_charge)
processing_items.Remove(src)
return
/obj/item/ammo/power_cell/self_charging/slowcharge
name = "Power Cell - Atomic Slowcharge"
desc = "A self-contained radioisotope power cell that very slowly recharges an internal capacitor. Holds 40PU."
recharge_rate = 2.5 // cogwerks: raised from 1.0 because radbows were terrible!!!!!
/obj/item/ammo/power_cell/self_charging/disruptor
name = "Power Cell - Disruptor Charger"
desc = "A self-contained radioisotope power cell that slowly recharges an internal capacitor. Holds 100PU."
icon = 'icons/obj/ammo.dmi'
icon_state = "recharger_cell"
m_amt = 18000
g_amt = 38000
charge = 100.0
max_charge = 100.0
cycle = 0
recharge_rate = 5.0
/obj/item/ammo/power_cell/self_charging/big
name = "Power Cell - Fusion"
desc = "A self-contained cold fusion power cell that quickly recharges an internal capacitor. Holds 400PU."
icon = 'icons/obj/ammo.dmi'
icon_state = "recharger_cell"
m_amt = 18000
g_amt = 38000
charge = 400.0
max_charge = 400.0
cycle = 0
recharge_rate = 40.0
+724
View File
@@ -0,0 +1,724 @@
/obj/item/gun/energy
name = "energy weapon"
icon = 'icons/obj/gun.dmi'
item_state = "gun"
m_amt = 2000
g_amt = 1000
mats = 16
add_residue = 0 // Does this gun add gunshot residue when fired? Energy guns shouldn't.
var/rechargeable = 1 // Can we put this gun in a recharger? False should be a very rare exception.
var/robocharge = 800
var/obj/item/ammo/power_cell/cell = null
var/custom_cell_max_capacity = null // Is there a limit as to what power cell (in PU) we can use?
var/wait_cycle = 0 // Using a self-charging cell should auto-update the gun's sprite.
New()
if (!cell)
cell = new/obj/item/ammo/power_cell
if (!(src in processing_items)) // No self-charging cell? Will be kicked out after the first tick (Convair880).
processing_items.Add(src)
..()
disposing()
if (src in processing_items)
processing_items.Remove(src)
..()
examine()
set src in usr
if(src.cell)
src.desc = "[src.projectiles ? "It is set to [src.current_projectile.sname]. " : ""]There are [src.cell.charge]/[src.cell.max_charge] PUs left!"
else
src.desc = "There is no cell loaded!"
if(current_projectile)
src.desc += " Each shot will currently use [src.current_projectile.cost] PUs!"
else
src.desc += "<span style=\"color:red\">*ERROR* No output selected!</span>"
..()
return
update_icon()
return 0
emp_act()
if (src.cell && istype(src.cell))
src.cell.use(INFINITY)
src.update_icon()
return
process()
src.wait_cycle = !src.wait_cycle // Self-charging cells recharge every other tick (Convair880).
if (src.wait_cycle)
return
if (!(src in processing_items))
logTheThing("debug", null, null, "<b>Convair880</b>: Process() was called for an egun ([src]) that wasn't in the item loop. Last touched by: [src.fingerprintslast]")
processing_items.Add(src)
return
if (!src.cell)
processing_items.Remove(src)
return
if (!istype(src.cell, /obj/item/ammo/power_cell/self_charging)) // Plain cell? No need for dynamic updates then (Convair880).
processing_items.Remove(src)
return
if (src.cell.charge == src.cell.max_charge) // Keep them in the loop, as we might fire the gun later (Convair880).
return
src.update_icon()
return
canshoot()
if(src.cell && src.cell:charge && src.current_projectile)
if(src.cell:charge >= src.current_projectile:cost)
return 1
return 0
process_ammo(var/mob/user)
if(istype(user,/mob/living/silicon/robot))
var/mob/living/silicon/robot/R = user
if(R.cell)
if(R.cell.charge >= src.robocharge)
R.cell.charge -= src.robocharge
return 1
return 0
else
if(src.cell && src.current_projectile)
if(src.cell.use(src.current_projectile.cost))
return 1
boutput(user, "<span style=\"color:red\">*click* *click*</span>")
return 0
attackby(obj/item/b as obj, mob/user as mob)
if (src.custom_cell_max_capacity && (b:max_charge > src.custom_cell_max_capacity))
user.show_text("This power cell won't fit!", "red")
return
if (istype(b, /obj/item/ammo/power_cell) && !rechargeable)
src.logme_temp(user, src, b)
if (istype(b, /obj/item/ammo/power_cell/self_charging) && !(src in processing_items)) // Again, we want dynamic updates here (Convair880).
processing_items.Add(src)
if(src.cell)
if(b:swap(src))
user.visible_message("<span style=\"color:red\">[user] swaps [src]'s power cell.</span>")
else
src.cell = b
user.drop_item()
b.set_loc(src)
user.visible_message("<span style=\"color:red\">[user] swaps [src]'s power cell.</span>")
else
..()
attack_hand(mob/user as mob)
if ((user.r_hand == src || user.l_hand == src) && src.contents && src.contents.len)
if (src.cell&&!src.rechargeable)
var/obj/item/ammo/power_cell/W = src.cell
user.put_in_hand_or_drop(W)
src.cell = null
update_icon()
src.add_fingerprint(user)
else
return ..()
return
////////////////////////////////////TASERGUN
/obj/item/gun/energy/taser_gun
name = "taser gun"
icon_state = "taser"
force = 1.0
desc = "A weapon that produces an cohesive electrical charge that stuns its target."
module_research = list("weapons" = 4, "energy" = 4, "miniaturization" = 2)
New()
current_projectile = new/datum/projectile/energy_bolt
projectiles = list(current_projectile,new/datum/projectile/energy_bolt/burst)
..()
update_icon()
if(cell)
var/ratio = min(1, src.cell.charge / src.cell.max_charge)
ratio = round(ratio, 0.25) * 100
src.icon_state = "taser[ratio]"
return
borg
New()
cell = new/obj/item/ammo/power_cell/self_charging/slowcharge
cell.max_charge = 100
cell.charge = 100
..()
/////////////////////////////////////LASERGUN
/obj/item/gun/energy/laser_gun
name = "laser gun"
icon_state = "laser"
force = 7.0
desc = "A gun that produces a harmful laser, causing substantial damage."
module_research = list("weapons" = 4, "energy" = 4)
New()
cell = new/obj/item/ammo/power_cell/med_power
current_projectile = new/datum/projectile/laser
projectiles = list(current_projectile)
..()
virtual
icon = 'icons/effects/VR.dmi'
New()
..()
current_projectile = new /datum/projectile/laser/virtual
projectiles.len = 0
projectiles += current_projectile
update_icon()
if(cell)
//Wire: Fix for Division by zero runtime
var/maxCharge = (src.cell.max_charge > 0 ? src.cell.max_charge : 0)
var/ratio = min(1, src.cell.charge / maxCharge)
ratio = round(ratio, 0.25) * 100
src.icon_state = "laser[ratio]"
return
////////////////////////////////////// Antique laser gun
// Part of a mini-quest thing (see displaycase.dm). Typically, the gun's properties (cell, projectile)
// won't be the default ones specified here, it's here to make it admin-spawnable (Convair880).
/obj/item/gun/energy/laser_gun/antique
name = "antique laser gun"
icon_state = "caplaser"
desc = "Wait, that's not a plastic toy..."
New()
if (!src.cell)
src.cell = new /obj/item/ammo/power_cell/med_power
if (!src.current_projectile)
src.current_projectile = new /datum/projectile/laser
if (isnull(src.projectiles))
src.projectiles = list(src.current_projectile)
src.update_icon()
..()
update_icon()
if (src.cell)
var/maxCharge = (src.cell.max_charge > 0 ? src.cell.max_charge : 0)
var/ratio = min(1, src.cell.charge / maxCharge)
ratio = round(ratio, 0.25) * 100
src.icon_state = "caplaser[ratio]"
return
//////////////////////////////////////// Phaser
/obj/item/gun/energy/phaser_gun
name = "phaser gun"
icon_state = "phaser-new"
force = 7.0
desc = "A gun that produces a harmful phaser bolt, causing substantial damage."
module_research = list("weapons" = 4, "energy" = 4)
New()
cell = new/obj/item/ammo/power_cell/med_power
current_projectile = new/datum/projectile/laser/light
projectiles = list(current_projectile)
..()
update_icon()
if(cell)
var/ratio = min(1, src.cell.charge / src.cell.max_charge)
ratio = round(ratio, 0.25) * 100
src.icon_state = "phaser-new[ratio]"
return
///////////////////////////////////////Rad Crossbow
/obj/item/gun/energy/crossbow
name = "mini rad-poison-crossbow"
desc = "A weapon favored by many of the syndicate's stealth specialists, which does damage over time using a slow-acting radioactive poison. Utilizes a self-recharging atomic power cell."
icon_state = "crossbow"
w_class = 2.0
item_state = "crossbow"
force = 4.0
throw_speed = 3
throw_range = 10
rechargeable = 0 // Cannot be recharged manually.
cell = new/obj/item/ammo/power_cell/self_charging/slowcharge
current_projectile = new/datum/projectile/rad_bolt
projectiles = null
is_syndicate = 1
silenced = 1 // No conspicuous text messages, please (Convair880).
custom_cell_max_capacity = 100 // Those self-charging ten-shot radbows were a bit overpowered (Convair880)
module_research = list("medicine" = 2, "science" = 2, "weapons" = 2, "energy" = 2, "miniaturization" = 10)
New()
current_projectile = new/datum/projectile/rad_bolt
projectiles = list(current_projectile)
..()
////////////////////////////////////////EGun
/obj/item/gun/energy/egun
name = "energy gun"
icon_state = "energy"
desc = "Its a gun that has two modes, stun and kill"
item_state = "gun"
force = 5.0
module_research = list("weapons" = 5, "energy" = 4, "miniaturization" = 5)
New()
cell = new/obj/item/ammo/power_cell/med_power
current_projectile = new/datum/projectile/energy_bolt
projectiles = list(current_projectile,new/datum/projectile/laser)
..()
update_icon()
if(cell)
var/ratio = min(1, src.cell.charge / src.cell.max_charge)
ratio = round(ratio, 0.25) * 100
if(current_projectile.type == /datum/projectile/energy_bolt)
src.icon_state = "energystun[ratio]"
else if (current_projectile.type == /datum/projectile/laser)
src.icon_state = "energykill[ratio]"
else
src.icon_state = "energy[ratio]"
attack_self()
..()
update_icon()
////////////////////////////////////VUVUV
/obj/item/gun/energy/vuvuzela_gun
name = "amplified vuvuzela"
icon_state = "vuvuzela"
item_state = "bike_horn"
desc = "BZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZT, *fart*"
is_syndicate = 1
New()
cell = new/obj/item/ammo/power_cell/med_power
current_projectile = new/datum/projectile/energy_bolt_v
projectiles = list(current_projectile)
..()
update_icon()
if(cell)
var/ratio = min(1, src.cell.charge / src.cell.max_charge)
ratio = round(ratio, 0.25) * 100
src.icon_state = "vuvuzela[ratio]"
//////////////////////////////////////Disruptor
/obj/item/gun/energy/disruptor
name = "Disruptor"
icon_state = "disruptor"
desc = "Disruptor Blaster - Comes equipped with self-charging powercell."
m_amt = 4000
force = 6.0
New()
cell = new/obj/item/ammo/power_cell/self_charging/disruptor
current_projectile = new/datum/projectile/disruptor
projectiles = list(current_projectile,new/datum/projectile/disruptor/burst,new/datum/projectile/disruptor/high)
src.update_icon()
..()
update_icon()
if (src.cell)
var/ratio = min(1, src.cell.charge / src.cell.max_charge)
ratio = round(ratio, 0.20) * 100
src.icon_state = "disruptor[ratio]"
return
////////////////////////////////////Wave Gun
/obj/item/gun/energy/wavegun
name = "Wave Gun"
icon = 'icons/obj/gun.dmi'
icon_state = "phaser"
m_amt = 4000
force = 6.0
module_research = list("weapons" = 2, "energy" = 2, "miniaturization" = 3)
New()
cell = new/obj/item/ammo/power_cell/med_power
current_projectile = new/datum/projectile/wavegun
projectiles = list(current_projectile,new/datum/projectile/wavegun/burst,new/datum/projectile/wavegun/paralyze)
..()
// Old phasers aren't around anymore, so the wave gun might as well use their better sprite (Convair880).
update_icon()
if (src.cell)
var/ratio = min(1, src.cell.charge / src.cell.max_charge)
ratio = round(ratio, 0.25) * 100
src.icon_state = "phaser[ratio]"
return
////////////////////////////////////BFG
/obj/item/gun/energy/bfg
name = "BFG 9000"
icon = 'icons/obj/gun.dmi'
icon_state = "bfg"
m_amt = 4000
force = 6.0
desc = "I think it stands for Banned For Griefing?"
module_research = list("weapons" = 25, "energy" = 25)
New()
cell = new/obj/item/ammo/power_cell/high_power
current_projectile = new/datum/projectile/bfg
projectiles = list(new/datum/projectile/bfg)
..()
update_icon()
return
shoot(var/target,var/start,var/mob/user)
if (canshoot()) // No more attack messages for empty guns (Convair880).
playsound(user, "sound/weapons/DSBFG.ogg", 75)
sleep(9)
return ..(target, start, user)
/obj/item/gun/energy/bfg/vr
icon = 'icons/effects/VR.dmi'
///////////////////////////////////////Telegun
/obj/item/gun/energy/teleport
name = "teleport gun"
desc = "A hacked together combination of a taser and a handheld teleportation unit."
icon_state = "teleport"
w_class = 3.0
item_state = "gun"
force = 10.0
throw_speed = 2
throw_range = 10
mats = 0
var/obj/item/our_target = null
var/obj/machinery/computer/teleporter/our_teleporter = null // For checks before firing (Convair880).
module_research = list("weapons" = 3, "energy" = 2, "science" = 10)
New()
cell = new/obj/item/ammo/power_cell/med_power
current_projectile = new /datum/projectile/tele_bolt
projectiles = list(current_projectile)
..()
update_icon()
if (!cell)
icon_state = "teleport"
return
icon_state = "teleport[round((src.cell.charge / src.cell.max_charge), 0.25) * 100]"
return
// I overhauled everything down there. Old implementation made the telegun unreliable and crap, to be frank (Convair880).
attack_self(mob/user as mob)
src.add_fingerprint(user)
var/list/L = list()
L += "None (Cancel)" // So we'll always get a list, even if there's only one teleporter in total.
for(var/obj/machinery/teleport/portal_generator/PG in machines)
if (!PG.linked_computer || !PG.linked_rings)
continue
var/turf/PG_loc = get_turf(PG)
if (PG && isrestrictedz(PG_loc.z)) // Don't show teleporters in "somewhere", okay.
continue
var/obj/machinery/computer/teleporter/Control = PG.linked_computer
if (Control)
switch (Control.check_teleporter())
if (0) // It's busted, Jim.
continue
if (1)
L["Tele at [get_area(Control)]: Locked in ([ismob(Control.locked.loc) ? "[Control.locked.loc.name]" : "[get_area(Control.locked)]"])"] += Control
if (2)
L["Tele at [get_area(Control)]: *NOPOWER*"] += Control
if (3)
L["Tele at [get_area(Control)]: Inactive"] += Control
else
continue
if (L.len < 2)
user.show_text("Error: no working teleporters detected.", "red")
return
var/t1 = input(user, "Please select a teleporter to lock in on.", "Target Selection") in L
if ((user.equipped() != src) || user.stat || user.restrained())
return
if (t1 == "None (Cancel)")
return
var/obj/machinery/computer/teleporter/Control2 = L[t1]
if (Control2)
src.our_teleporter = null
src.our_target = null
switch (Control2.check_teleporter())
if (0)
user.show_text("Error: selected teleporter is out of order.", "red")
return
if (1)
src.our_target = Control2.locked
if (!our_target)
user.show_text("Error: selected teleporter is locked in to invalid coordinates.", "red")
return
else
user.show_text("Teleporter selected. Locked in on [ismob(Control2.locked.loc) ? "[Control2.locked.loc.name]" : "beacon"] in [get_area(Control2.locked)].", "blue")
src.our_teleporter = Control2
return
if (2)
user.show_text("Error: selected teleporter is unpowered.", "red")
return
if (3)
user.show_text("Error: selected teleporter is not locked in.", "red")
return
else
user.show_text("Error: couldn't establish connection to selected teleporter.", "red")
return
attack(mob/M as mob, mob/user as mob)
if (!src.our_target)
user.show_text("Error: no target set. Please select a teleporter first.", "red")
return
if (!src.our_teleporter || (src.our_teleporter.check_teleporter() != 1))
user.show_text("Error: linked teleporter is out of order.", "red")
return
var/datum/projectile/tele_bolt/TB = current_projectile
TB.target = our_target
return ..(M, user)
shoot(var/target, var/start, var/mob/user)
if (!src.our_target)
user.show_text("Error: no target set. Please select a teleporter first.", "red")
return
if (!src.our_teleporter || (src.our_teleporter.check_teleporter() != 1))
user.show_text("Error: linked teleporter is out of order.", "red")
return
var/datum/projectile/tele_bolt/TB = current_projectile
TB.target = our_target
return ..(target, start, user)
///////////////////////////////////////Ghost Gun
/obj/item/gun/energy/ghost
name = "ectoplasmic destabilizer"
desc = "If this had streams, it would be inadvisable to cross them. But no, it fires bolts instead. Don't throw it into a stream, I guess?"
icon_state = "ghost"
w_class = 3.0
item_state = "gun"
force = 10.0
throw_speed = 2
throw_range = 10
mats = 0
module_research = list("weapons" = 1, "energy" = 5, "science" = 10)
New()
cell = new/obj/item/ammo/power_cell/med_power
current_projectile = new /datum/projectile/energy_bolt_antighost
projectiles = list(current_projectile)
..()
///////////////////////////////////////Modular Gun
/obj/item/gun/energy/mod
name = "phaser"
desc = "A modular energy sidearm. Can be upgraded with different kinds of modules. (WORK IN PROGRESS)"
icon = 'icons/obj/gun_mod.dmi'
icon_state = "pistol"
w_class = 3.0
force = 5.0
mats = 0
var/obj/item/gun_parts/emitter/emitter = null
var/obj/item/gun_parts/back/back = null
var/obj/item/gun_parts/top_rail/top_rail = null
var/obj/item/gun_parts/bottom_rail/bottom_rail = null
var/heat = 0 // for overheating stuff
New()
if (!emitter)
emitter = new /obj/item/gun_parts/emitter
if(!current_projectile)
current_projectile = src.emitter.projectile
projectiles = list(current_projectile)
..()
//handle gun mods at a workbench
examine()
set src in view()
boutput(usr, "<span style=\"color:blue\">Installed components:</span><br>")
if(emitter)
boutput(usr, "<span style=\"color:blue\">[src.emitter.name]</span>")
if(cell)
boutput(usr, "<span style=\"color:blue\">[src.cell.name]</span>")
if(back)
boutput(usr, "<span style=\"color:blue\">[src.back.name]</span>")
if(top_rail)
boutput(usr, "<span style=\"color:blue\">[src.top_rail.name]</span>")
if(bottom_rail)
boutput(usr, "<span style=\"color:blue\">[src.bottom_rail.name]</span>")
..()
/*proc/generate_overlays()
src.overlays = null
if(extension_mod)
src.overlays += icon('icons/obj/gun_mod.dmi',extension_mod.overlay_name)
if(converter_mod)
src.overlays += icon('icons/obj/gun_mod.dmi',converter_mod.overlay_name)*/
/*proc/update_icon()
var/ratio = src.charges / maximum_charges
ratio = round(ratio, 0.25) * 100
src.icon_state = text("phaser[]", ratio)*/
///////////modular components - putting them her so it's easier to work on for now////////
/obj/item/gun_parts
name = "gun parts"
desc = "Components for building custom sidearms."
item_state = "table_parts"
inhand_image_icon = 'icons/mob/inhand/hand_tools.dmi'
icon = 'icons/obj/gun_mod.dmi'
icon_state = "frame" // todo: make more item icons
mats = 0
/obj/item/gun_parts/emitter
name = "optical pulse emitter"
desc = "Generates a pulsed burst of energy."
icon_state = "emitter"
var/datum/projectile/laser/light/projectile = new/datum/projectile/laser/light
var/obj/item/device/flash/flash = new/obj/item/device/flash
//use flash as the core of the device
// inherit material vars from the flash
/obj/item/gun_parts/back
name = "phaser stock"
desc = "A gun stock for a modular phaser. Does this even do anything? Probably not."
icon_state = "mod-stock"
/obj/item/gun_parts/top_rail
name = "phaser pulse modifier"
desc = "Modifies the beam path of modular phaser."
icon_state = "mod-range"
range
name = "beam collimator"
icon_state = "mod-range"
width
name = "beam spreader"
icon_state = "mod-aoe"
/obj/item/gun_parts/bottom_rail
name = "Phaser accessory"
sight
name = "phaser dot accessory"
icon_state = "mod-sight"
// idk what the hell this would even do
flashlight
name = "phaser flashlight accessory"
icon_state = "mod-flashlight"
heatsink
name = "phaser heatsink"
icon_state = "mod-heatsink"
grip // tacticool
name = "fore grip"
icon_state = "mod-grip"
///////////////////////////////////////Owl Gun
/obj/item/gun/energy/owl
name = "Owl gun"
desc = "Its a gun that has two modes, Owl and Owler"
item_state = "gun"
force = 5.0
icon_state = "ghost"
New()
cell = new/obj/item/ammo/power_cell/med_power
current_projectile = new/datum/projectile/owl
projectiles = list(current_projectile,new/datum/projectile/owl/owlate)
..()
update_icon()
if(cell)
var/ratio = min(1, src.cell.charge / src.cell.max_charge)
ratio = round(ratio, 0.25) * 100
src.icon_state = "energy[ratio]"
/obj/item/gun/energy/owl_safe
name = "Owl gun"
desc = "Hoot!"
item_state = "gun"
force = 5.0
icon_state = "ghost"
New()
cell = new/obj/item/ammo/power_cell/med_power
current_projectile = new/datum/projectile/owl
projectiles = list(current_projectile)
..()
update_icon()
if(cell)
var/ratio = min(1, src.cell.charge / src.cell.max_charge)
ratio = round(ratio, 0.25) * 100
src.icon_state = "energy[ratio]"
///////////////////////////////////////Shrink Ray
/obj/item/gun/energy/shrinkray
name = "Shrink ray"
item_state = "gun"
force = 5.0
icon_state = "ghost"
New()
cell = new/obj/item/ammo/power_cell/med_power
current_projectile = new/datum/projectile/shrink_beam
projectiles = list(current_projectile)
..()
update_icon()
if(cell)
var/ratio = min(1, src.cell.charge / src.cell.max_charge)
ratio = round(ratio, 0.25) * 100
src.icon_state = "energy[ratio]"
///////////////////////////////////////Glitch Gun
/obj/item/gun/energy/glitch_gun
name = "Glitch Gun"
icon = 'icons/obj/gun.dmi'
icon_state = "airzooka"
m_amt = 4000
force = 0.0
desc = "It's humming with some sort of disturbing energy. Do you really wanna hold this?"
New()
cell = new/obj/item/ammo/power_cell/high_power
current_projectile = new/datum/projectile/bullet/glitch/gun
projectiles = list(new/datum/projectile/bullet/glitch/gun)
..()
update_icon()
return
shoot(var/target,var/start,var/mob/user,var/POX,var/POY)
if (canshoot()) // No more attack messages for empty guns (Convair880).
playsound(user, "sound/weapons/DSBFG.ogg", 75)
sleep(1)
return ..(target, start, user)
///////////////////////////////////////Predator
/obj/item/gun/energy/laser_gun/pred // Made use of a spare sprite here (Convair880).
name = "laser rifle"
desc = "This advanced bullpup rifle contains a self-recharging power cell."
icon_state = "bullpup"
force = 5.0
New()
..()
cell = new/obj/item/ammo/power_cell/self_charging/big
current_projectile = new/datum/projectile/laser/pred
projectiles = list(new/datum/projectile/laser/pred)
update_icon()
if(cell)
var/ratio = min(1, src.cell.charge / src.cell.max_charge)
ratio = round(ratio, 0.25) * 100
src.icon_state = "bullpup[ratio]"
return
/obj/item/gun/energy/laser_gun/pred/vr
name = "advanced laser gun"
icon = 'icons/effects/VR.dmi'
icon_state = "wavegun"
update_icon() // Necessary. Parent's got a different sprite now (Convair880).
return
+235
View File
@@ -0,0 +1,235 @@
var/list/forensic_IDs = new/list() //Global list of all guns, based on bioholder uID stuff
/obj/item/gun
name = "gun"
icon = 'icons/obj/gun.dmi'
inhand_image_icon = 'icons/mob/inhand/hand_weapons.dmi'
flags = FPRINT | TABLEPASS | CONDUCT | ONBELT | USEDELAY | EXTRADELAY
item_state = "gun"
m_amt = 2000
force = 10.0
throwforce = 5
w_class = 3.0
throw_speed = 4
throw_range = 6
contraband = 4
var/spread_angle = 0
var/datum/projectile/current_projectile = null
var/list/projectiles = null
var/current_projectile_num = 1
var/silenced = 0
var/forensic_ID = null
var/add_residue = 0 // Does this gun add gunshot residue when fired (Convair880)?
New()
spawn(20)
src.forensic_ID = src.CreateID()
forensic_IDs.Add(src.forensic_ID)
return
/obj/item/gun/proc/CreateID() //Creates a new tracking id for the gun and returns it.
var/newID = ""
do
for(var/i = 1 to 10) // 20 characters are way too fuckin' long for anyone to care about
newID += "[pick(numbersAndLetters)]"
while(forensic_IDs.Find(newID))
return newID
///CHECK_LOCK
///Call to run a weaponlock check vs the users implant
///Return 0 for fail
/obj/item/gun/proc/check_lock(var/user as mob)
return 1
///CHECK_VALID_SHOT
///Call to check and make sure the shot is ok
///Not called much atm might remove, is now inside shoot
/obj/item/gun/proc/check_valid_shot(atom/target as mob|obj|turf|area, mob/user as mob)
var/turf/T = get_turf(user)
var/turf/U = get_turf(target)
if(!istype(T) || !istype(U))
return 0
if (U == T)
//user.bullet_act(current_projectile)
return 0
return 1
/*
/obj/item/gun/proc/emag(obj/item/A as obj, mob/user as mob)
if(istype(A, /obj/item/card/emag))
boutput(user, "<span style=\"color:red\">No lock to break!</span>")
return 1
return 0
*/
/obj/item/gun/emag_act(var/mob/user, var/obj/item/card/emag/E)
if (user)
boutput(user, "<span style=\"color:red\">No lock to break!</span>")
return 0
/obj/item/gun/attack_self(mob/user as mob)
if(src.projectiles && src.projectiles.len > 1)
src.current_projectile_num = ((src.current_projectile_num) % src.projectiles.len) + 1
src.current_projectile = src.projectiles[src.current_projectile_num]
boutput(user, "<span style=\"color:blue\">you set the output to [src.current_projectile.sname].</span>")
return
/obj/item/gun/pixelaction(atom/target, params, mob/user, reach)
if (reach)
return 0
if (!isturf(user.loc))
return 0
var/pox = text2num(params["icon-x"]) - 16
var/poy = text2num(params["icon-y"]) - 16
shoot(get_turf(target), get_turf(user), user, pox, poy)
return 1
/obj/item/gun/attack(mob/M as mob, mob/user as mob)
user.lastattacked = M
M.lastattacker = user
M.lastattackertime = world.time
if(user.a_intent != "help" && isliving(M))
src.shoot_point_blank(M, user)
else
..()
#ifdef DATALOGGER
game_stats.Increment("violence")
#endif
return
/obj/item/gun/proc/shoot_point_blank(var/mob/M as mob, var/mob/user as mob)
if (!M || !user)
return
if (!canshoot())
if (!silenced)
M.visible_message("<span style=\"color:red\"><B>[user] tries to shoot [M] with [src] point-blank, but it was empty!</B></span>")
else
user.show_text("*click* *click*", "red")
return
if (ishuman(user) && src.add_residue) // Additional forensic evidence for kinetic firearms (Convair880).
var/mob/living/carbon/human/H = user
H.gunshot_residue = 1
if (!src.silenced)
for (var/mob/O in AIviewers(M, null))
if (O.client)
O.show_message("<span style=\"color:red\"><B>[user] shoots [M] point-blank with [src]!</B></span>")
else
user.show_text("<span style=\"color:red\">You silently shoot [M] point-blank with [src]!</span>") // Was non-functional (Convair880).
if (!process_ammo(user))
return
var/obj/projectile/P = initialize_projectile_ST(user, current_projectile, M)
if (!P)
return
if (user == M)
P.shooter = null
P.mob_shooter = user
alter_projectile(P)
P.forensic_ID = src.forensic_ID // Was missing (Convair880).
P.was_pointblank = 1
hit_with_existing_projectile(P, M) // Includes log entry.
var/mob/living/L = M
if (M && M.stat == 0)
L.lastgasp()
M.set_clothing_icon_dirty()
src.update_icon()
/obj/item/gun/afterattack(atom/target as mob|obj|turf|area, mob/user as mob, flag)
src.add_fingerprint(user)
if (flag)
return
/obj/item/gun/proc/alter_projectile(var/obj/projectile/P)
return
/obj/item/gun/proc/shoot(var/target,var/start,var/mob/user,var/POX,var/POY)
if(!canshoot())
if (ismob(user))
user.show_text("*click* *click*", "red") // No more attack messages for empty guns (Convair880).
return
if(!process_ammo(user))
return
if (!istype(target, /turf) || !istype(start, /turf))
return
if (!istype(src.current_projectile,/datum/projectile/))
return
var/obj/projectile/P = shoot_projectile_ST_pixel_spread(user, current_projectile, target, POX, POY, spread_angle)
if (P)
alter_projectile(P)
P.forensic_ID = src.forensic_ID
if(user)
if(!src.silenced)
for(var/mob/O in AIviewers(user, null))
O.show_message("<span style=\"color:red\"><B>[user] fires [src] at [target]!</B></span>", 1, "<span style=\"color:red\">You hear a gunshot</span>", 2)
else
if (ismob(user)) // Fix for: undefined proc or verb /obj/item/mechanics/gunholder/show text().
user.show_text("<span style=\"color:red\">You silently fire the [src] at [target]!</span>") // Some user feedback for silenced guns would be nice (Convair880).
var/turf/T = target
logTheThing("combat", user, null, "fires \a [src] from [log_loc(user)], vector: ([T.x - user.x], [T.y - user.y]), dir: <I>[dir2text(get_dir(user, target))]</I>, projectile: <I>[P.name]</I>[P.proj_data && P.proj_data.type ? ", [P.proj_data.type]" : null]")
if (ismob(user))
var/mob/M = user
if (ishuman(M) && src.add_residue) // Additional forensic evidence for kinetic firearms (Convair880).
var/mob/living/carbon/human/H = user
H.gunshot_residue = 1
/*if (!disable_next_click) aggressive thing, so disable_next_click shouldn't affect this
*/M.next_click = world.time + 4
src.update_icon()
/obj/item/gun/proc/canshoot()
return 0
/obj/item/gun/examine()
set src in usr
set category = "Local"
if (src.artifact)
boutput(usr, "You have no idea what the hell this thing is!")
return
..()
return
/obj/item/gun/proc/update_icon()
return 0
/obj/item/gun/proc/process_ammo(var/mob/user)
boutput(user, "<span style=\"color:red\">*click* *click*</span>")
return 0
// Could be useful in certain situations (Convair880).
/obj/item/gun/proc/logme_temp(mob/user as mob, obj/item/gun/G as obj, obj/item/ammo/A as obj)
if (!user || !G || !A)
return
else if (istype(G, /obj/item/gun/kinetic) && istype(A, /obj/item/ammo/bullets))
logTheThing("combat", user, null, "reloads [G] (<b>Ammo type:</b> <i>[G.current_projectile.type]</i>) at [log_loc(user)].")
return
else if (istype(G, /obj/item/gun/energy) && istype(A, /obj/item/ammo/power_cell))
logTheThing("combat", user, null, "reloads [G] (<b>Cell type:</b> <i>[A.type]</i>) at [log_loc(user)].")
return
else return
/obj/item/gun/on_spin_emote(var/mob/living/carbon/human/user as mob)
if ((user.bioHolder && user.bioHolder.HasEffect("clumsy") && prob(50)) || (user.reagents && prob(user.reagents.get_reagent_amount("ethanol") / 2)) || prob(5))
user.visible_message("<span style=\"color:red\"><b>[user] accidentally shoots [him_or_her(user)]self with [src]!</b></span>")
src.shoot_point_blank(user, user)

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