mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-16 01:23:41 +01:00
Merge tgstation13 r4570 into bs12_with_tgport
Conflicts: baystation12.dme code/defines/obj.dm code/defines/procs/helpers.dm code/defines/turf.dm code/game/gamemodes/changeling/modularchangling.dm code/game/gamemodes/cult/cult_structures.dm code/game/gamemodes/events.dm code/game/machinery/telecomms/machine_interactions.dm code/game/master_controller.dm code/game/objects/items/blueprints.dm code/game/objects/items/devices/uplinks.dm code/game/objects/items/item.dm code/game/objects/items/weapons/gift_wrappaper.dm code/game/objects/items/weapons/wires.dm code/game/objects/weapons.dm code/game/turfs/turf.dm code/modules/clothing/head/hardhat.dm code/modules/mining/mine_items.dm code/modules/mining/mine_turfs.dm code/modules/mob/living/silicon/robot/life.dm code/modules/mob/mob_defines.dm code/modules/mob/new_player/login.dm code/modules/paperwork/pen.dm code/modules/paperwork/stamps.dm code/unused/toilets.dm html/changelog.html icons/effects/alert.dmi Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
@@ -235,33 +235,4 @@ move an amendment</a> to the drawing.</p>
|
||||
if(BORDER_SPACE)
|
||||
return ROOM_ERR_SPACE
|
||||
found+=T
|
||||
return found
|
||||
|
||||
/*
|
||||
/proc/check_apc(var/area/A)
|
||||
for(var/area/RA in A.related)
|
||||
for(var/obj/machinery/power/apc/FINDME in RA)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/fuckingfreemachinery()
|
||||
for(var/obj/machinery/machine in machines)
|
||||
if (istype(machine,/obj/machinery/power/solar))
|
||||
continue
|
||||
var/area/A = machine.loc.loc // make sure it's in an area
|
||||
if (istype(A,/area/tdome))
|
||||
continue
|
||||
if (istype(A,/area/shuttle))
|
||||
continue
|
||||
if(!A || !isarea(A))
|
||||
world << "DEBUG: @[machine.x],[machine.y],[machine.z] ([A.name]) machine \"[machine.name]\" ([machine.type]) hasnt area!"
|
||||
continue
|
||||
A = A.master
|
||||
if (A.name=="Space")
|
||||
world << "DEBUG: @[machine.x],[machine.y],[machine.z] ([A.name]) machine \"[machine.name]\" ([machine.type]) work in space!"
|
||||
continue
|
||||
if (!check_apc(A))
|
||||
world << "DEBUG: @[machine.x],[machine.y],[machine.z] ([A.name]) machine \"[machine.name]\" ([machine.type]) work without APC!"
|
||||
world << "\red END ====="
|
||||
|
||||
*/
|
||||
return found
|
||||
@@ -0,0 +1,91 @@
|
||||
//Also contains /obj/structure/closet/body_bag because I doubt anyone would think to look for bodybags in /object/structures
|
||||
|
||||
/obj/item/bodybag
|
||||
name = "body bag"
|
||||
desc = "A folded bag designed to contain dead things."
|
||||
icon = 'icons/obj/bodybag.dmi'
|
||||
icon_state = "bodybag_folded"
|
||||
|
||||
attack_self(mob/user)
|
||||
var/obj/structure/closet/body_bag/R = new /obj/structure/closet/body_bag(user.loc)
|
||||
R.add_fingerprint(user)
|
||||
del(src)
|
||||
|
||||
|
||||
/obj/item/weapon/storage/body_bag_box
|
||||
name = "body bags"
|
||||
desc = "This box contains body bags."
|
||||
icon_state = "bodybags"
|
||||
item_state = "syringe_kit"
|
||||
foldable = /obj/item/stack/sheet/cardboard //BubbleWrap
|
||||
|
||||
|
||||
New()
|
||||
new /obj/item/bodybag(src)
|
||||
new /obj/item/bodybag(src)
|
||||
new /obj/item/bodybag(src)
|
||||
new /obj/item/bodybag(src)
|
||||
new /obj/item/bodybag(src)
|
||||
new /obj/item/bodybag(src)
|
||||
new /obj/item/bodybag(src)
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/body_bag
|
||||
name = "body bag"
|
||||
desc = "A bag designed to contain dead things."
|
||||
icon = 'icons/obj/bodybag.dmi'
|
||||
icon_state = "bodybag_closed"
|
||||
icon_closed = "bodybag_closed"
|
||||
icon_opened = "bodybag_open"
|
||||
density = 0
|
||||
|
||||
|
||||
attackby(W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/pen))
|
||||
var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text
|
||||
if (user.get_active_hand() != W)
|
||||
return
|
||||
if (!in_range(src, user) && src.loc != user)
|
||||
return
|
||||
t = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
|
||||
if (t)
|
||||
src.name = "body bag - "
|
||||
src.name += t
|
||||
src.overlays += image(src.icon, "bodybag_label")
|
||||
else
|
||||
src.name = "body bag"
|
||||
//..() //Doesn't need to run the parent. Since when can fucking bodybags be welded shut? -Agouri
|
||||
return
|
||||
else if(istype(W, /obj/item/weapon/wirecutters))
|
||||
user << "You cut the tag off the bodybag"
|
||||
src.name = "body bag"
|
||||
src.overlays = null
|
||||
return
|
||||
|
||||
|
||||
close()
|
||||
if(..())
|
||||
density = 0
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
MouseDrop(over_object, src_location, over_location)
|
||||
..()
|
||||
if((over_object == usr && (in_range(src, usr) || usr.contents.Find(src))))
|
||||
if(!ishuman(usr)) return
|
||||
if(opened) return 0
|
||||
if(contents.len) return 0
|
||||
visible_message("[usr] folds up the [src.name]")
|
||||
new/obj/item/bodybag(get_turf(src))
|
||||
spawn(0)
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/structure/closet/bodybag/update_icon()
|
||||
if(!opened)
|
||||
icon_state = icon_closed
|
||||
else
|
||||
icon_state = icon_opened
|
||||
@@ -1,7 +1,3 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
|
||||
|
||||
#define CANDLE_LUM 3
|
||||
|
||||
/obj/item/candle
|
||||
name = "red candle"
|
||||
desc = "a candle"
|
||||
@@ -52,7 +48,7 @@
|
||||
//src.damtype = "fire"
|
||||
for(var/mob/O in viewers(usr, null))
|
||||
O.show_message(flavor_text, 1)
|
||||
sd_SetLuminosity(CANDLE_LUM)
|
||||
SetLuminosity(CANDLE_LUM)
|
||||
processing_objects.Add(src)
|
||||
|
||||
|
||||
@@ -75,17 +71,17 @@
|
||||
if(lit)
|
||||
lit = 0
|
||||
update_icon()
|
||||
sd_SetLuminosity(0)
|
||||
user.total_luminosity -= CANDLE_LUM
|
||||
SetLuminosity(0)
|
||||
user.SetLuminosity(user.luminosity - CANDLE_LUM)
|
||||
|
||||
|
||||
pickup(mob/user)
|
||||
if(lit)
|
||||
src.sd_SetLuminosity(0)
|
||||
user.total_luminosity += CANDLE_LUM
|
||||
SetLuminosity(0)
|
||||
user.SetLuminosity(user.luminosity + CANDLE_LUM)
|
||||
|
||||
|
||||
dropped(mob/user)
|
||||
if(lit)
|
||||
user.total_luminosity -= CANDLE_LUM
|
||||
src.sd_SetLuminosity(CANDLE_LUM)
|
||||
user.SetLuminosity(user.luminosity - CANDLE_LUM)
|
||||
SetLuminosity(CANDLE_LUM)
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
/obj/item/toy/crayon/red
|
||||
icon_state = "crayonred"
|
||||
colour = "#DA0000"
|
||||
shadeColour = "#810C0C"
|
||||
colourName = "red"
|
||||
|
||||
/obj/item/toy/crayon/orange
|
||||
icon_state = "crayonorange"
|
||||
colour = "#FF9300"
|
||||
shadeColour = "#A55403"
|
||||
colourName = "orange"
|
||||
|
||||
/obj/item/toy/crayon/yellow
|
||||
icon_state = "crayonyellow"
|
||||
colour = "#FFF200"
|
||||
shadeColour = "#886422"
|
||||
colourName = "yellow"
|
||||
|
||||
/obj/item/toy/crayon/green
|
||||
icon_state = "crayongreen"
|
||||
colour = "#A8E61D"
|
||||
shadeColour = "#61840F"
|
||||
colourName = "green"
|
||||
|
||||
/obj/item/toy/crayon/blue
|
||||
icon_state = "crayonblue"
|
||||
colour = "#00B7EF"
|
||||
shadeColour = "#0082A8"
|
||||
colourName = "blue"
|
||||
|
||||
/obj/item/toy/crayon/purple
|
||||
icon_state = "crayonpurple"
|
||||
colour = "#DA00FF"
|
||||
shadeColour = "#810CFF"
|
||||
colourName = "purple"
|
||||
|
||||
/obj/item/toy/crayon/mime
|
||||
icon_state = "crayonmime"
|
||||
desc = "A very sad-looking crayon."
|
||||
colour = "#FFFFFF"
|
||||
shadeColour = "#000000"
|
||||
colourName = "mime"
|
||||
uses = 0
|
||||
|
||||
/obj/item/toy/crayon/mime/attack_self(mob/living/user as mob) //inversion
|
||||
if(colour != "#FFFFFF" && shadeColour != "#000000")
|
||||
colour = "#FFFFFF"
|
||||
shadeColour = "#000000"
|
||||
user << "You will now draw in white and black with this crayon."
|
||||
else
|
||||
colour = "#000000"
|
||||
shadeColour = "#FFFFFF"
|
||||
user << "You will now draw in black and white with this crayon."
|
||||
return
|
||||
|
||||
/obj/item/toy/crayon/rainbow
|
||||
icon_state = "crayonrainbow"
|
||||
colour = "#FFF000"
|
||||
shadeColour = "#000FFF"
|
||||
colourName = "rainbow"
|
||||
uses = 0
|
||||
|
||||
/obj/item/toy/crayon/rainbow/attack_self(mob/living/user as mob)
|
||||
colour = input(user, "Please select the main colour.", "Crayon colour") as color
|
||||
shadeColour = input(user, "Please select the shade colour.", "Crayon colour") as color
|
||||
return
|
||||
|
||||
/obj/item/toy/crayon/afterattack(atom/target, mob/user as mob)
|
||||
if(istype(target,/turf/simulated/floor))
|
||||
var/drawtype = input("Choose what you'd like to draw.", "Crayon scribbles") in list("graffiti","rune","letter")
|
||||
switch(drawtype)
|
||||
if("letter")
|
||||
drawtype = input("Choose the letter.", "Crayon scribbles") in list("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z")
|
||||
user << "You start drawing a letter on the [target.name]."
|
||||
if("graffiti")
|
||||
user << "You start drawing graffiti on the [target.name]."
|
||||
if("rune")
|
||||
user << "You start drawing a rune on the [target.name]."
|
||||
if(instant || do_after(user, 50))
|
||||
new /obj/effect/decal/cleanable/crayon(target,colour,shadeColour,drawtype)
|
||||
user << "You finish drawing."
|
||||
if(uses)
|
||||
uses--
|
||||
if(!uses)
|
||||
user << "\red You used up your crayon!"
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/item/toy/crayon/attack(mob/M as mob, mob/user as mob)
|
||||
if(M == user)
|
||||
user << "You take a bite of the crayon. Delicious!"
|
||||
user.nutrition += 5
|
||||
if(uses)
|
||||
uses -= 5
|
||||
if(uses <= 0)
|
||||
user << "\red You ate your crayon!"
|
||||
del(src)
|
||||
else
|
||||
..()
|
||||
Executable
+1136
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,712 @@
|
||||
/obj/item/weapon/cartridge
|
||||
name = "generic cartridge"
|
||||
desc = "A data cartridge for portable microcomputers."
|
||||
icon = 'icons/obj/pda.dmi'
|
||||
icon_state = "cart"
|
||||
item_state = "electronic"
|
||||
w_class = 1
|
||||
|
||||
var/obj/item/radio/integrated/radio = null
|
||||
var/access_security = 0
|
||||
var/access_engine = 0
|
||||
var/access_medical = 0
|
||||
var/access_manifest = 0
|
||||
var/access_clown = 0
|
||||
var/access_mime = 0
|
||||
var/access_janitor = 0
|
||||
// var/access_flora = 0
|
||||
var/access_reagent_scanner = 0
|
||||
var/access_remote_door = 0 //Control some blast doors remotely!!
|
||||
var/remote_door_id = ""
|
||||
var/access_status_display = 0
|
||||
var/access_quartermaster = 0
|
||||
var/access_hydroponics = 0
|
||||
var/mode = null
|
||||
var/menu
|
||||
var/datum/data/record/active1 = null //General
|
||||
var/datum/data/record/active2 = null //Medical
|
||||
var/datum/data/record/active3 = null //Security
|
||||
var/obj/machinery/power/monitor/powmonitor = null // Power Monitor
|
||||
var/list/powermonitors = list()
|
||||
var/message1 // used for status_displays
|
||||
var/message2
|
||||
var/list/stored_data = list()
|
||||
|
||||
engineering
|
||||
name = "Power-ON Cartridge"
|
||||
icon_state = "cart-e"
|
||||
access_engine = 1
|
||||
|
||||
medical
|
||||
name = "Med-U Cartridge"
|
||||
icon_state = "cart-m"
|
||||
access_medical = 1
|
||||
|
||||
chemistry
|
||||
name = "ChemWhiz Cartridge"
|
||||
icon_state = "cart-chem"
|
||||
access_reagent_scanner = 1
|
||||
|
||||
security
|
||||
name = "R.O.B.U.S.T. Cartridge"
|
||||
icon_state = "cart-s"
|
||||
access_security = 1
|
||||
|
||||
New()
|
||||
..()
|
||||
spawn(5)
|
||||
radio = new /obj/item/radio/integrated/beepsky(src)
|
||||
|
||||
detective
|
||||
name = "D.E.T.E.C.T. Cartridge"
|
||||
icon_state = "cart-s"
|
||||
access_security = 1
|
||||
access_medical = 1
|
||||
access_manifest = 1
|
||||
|
||||
|
||||
janitor
|
||||
name = "CustodiPRO Cartridge"
|
||||
desc = "The ultimate in clean-room design."
|
||||
icon_state = "cart-j"
|
||||
access_janitor = 1
|
||||
|
||||
lawyer
|
||||
name = "P.R.O.V.E. Cartridge"
|
||||
icon_state = "cart-s"
|
||||
access_security = 1
|
||||
|
||||
clown
|
||||
name = "Honkworks 5.0"
|
||||
icon_state = "cart-clown"
|
||||
access_clown = 1
|
||||
var/honk_charges = 5
|
||||
|
||||
mime
|
||||
name = "Gestur-O 1000"
|
||||
icon_state = "cart-mi"
|
||||
access_mime = 1
|
||||
var/mime_charges = 5
|
||||
/*
|
||||
botanist
|
||||
name = "Green Thumb v4.20"
|
||||
icon_state = "cart-b"
|
||||
access_flora = 1
|
||||
*/
|
||||
|
||||
signal
|
||||
name = "generic signaler cartridge"
|
||||
desc = "A data cartridge with an integrated radio signaler module."
|
||||
|
||||
toxins
|
||||
name = "Signal Ace 2"
|
||||
desc = "Complete with integrated radio signaler!"
|
||||
icon_state = "cart-tox"
|
||||
// access_reagent_scanner = 1
|
||||
|
||||
New()
|
||||
..()
|
||||
spawn(5)
|
||||
radio = new /obj/item/radio/integrated/signal(src)
|
||||
|
||||
|
||||
|
||||
quartermaster
|
||||
name = "Space Parts & Space Vendors Cartridge"
|
||||
desc = "Perfect for the Quartermaster on the go!"
|
||||
icon_state = "cart-q"
|
||||
access_quartermaster = 1
|
||||
|
||||
New()
|
||||
..()
|
||||
spawn(5)
|
||||
radio = new /obj/item/radio/integrated/mule(src)
|
||||
|
||||
head
|
||||
name = "Easy-Record DELUXE"
|
||||
icon_state = "cart-h"
|
||||
access_manifest = 1
|
||||
access_status_display = 1
|
||||
|
||||
hop
|
||||
name = "HumanResources9001"
|
||||
icon_state = "cart-h"
|
||||
access_manifest = 1
|
||||
access_status_display = 1
|
||||
access_quartermaster = 1
|
||||
|
||||
New()
|
||||
..()
|
||||
spawn(5)
|
||||
radio = new /obj/item/radio/integrated/mule(src)
|
||||
|
||||
hos
|
||||
name = "R.O.B.U.S.T. DELUXE"
|
||||
icon_state = "cart-hos"
|
||||
access_manifest = 1
|
||||
access_status_display = 1
|
||||
access_security = 1
|
||||
|
||||
New()
|
||||
..()
|
||||
spawn(5)
|
||||
radio = new /obj/item/radio/integrated/beepsky(src)
|
||||
|
||||
ce
|
||||
name = "Power-On DELUXE"
|
||||
icon_state = "cart-ce"
|
||||
access_manifest = 1
|
||||
access_status_display = 1
|
||||
access_engine = 1
|
||||
|
||||
cmo
|
||||
name = "Med-U DELUXE"
|
||||
icon_state = "cart-cmo"
|
||||
access_manifest = 1
|
||||
access_status_display = 1
|
||||
access_reagent_scanner = 1
|
||||
access_medical = 1
|
||||
|
||||
rd
|
||||
name = "Signal Ace DELUXE"
|
||||
icon_state = "cart-rd"
|
||||
access_manifest = 1
|
||||
access_status_display = 1
|
||||
// access_reagent_scanner = 1
|
||||
|
||||
New()
|
||||
..()
|
||||
spawn(5)
|
||||
radio = new /obj/item/radio/integrated/signal(src)
|
||||
|
||||
captain
|
||||
name = "Value-PAK Cartridge"
|
||||
desc = "Now with 200% more value!"
|
||||
icon_state = "cart-c"
|
||||
access_manifest = 1
|
||||
access_engine = 1
|
||||
access_security = 1
|
||||
access_medical = 1
|
||||
access_reagent_scanner = 1
|
||||
access_status_display = 1
|
||||
|
||||
syndicate
|
||||
name = "Detomatix Cartridge"
|
||||
icon_state = "cart"
|
||||
access_remote_door = 1
|
||||
remote_door_id = "syndicate" //Make sure this matches the syndicate shuttle's shield/door id!!
|
||||
var/shock_charges = 4
|
||||
|
||||
proc/unlock()
|
||||
if (!istype(loc, /obj/item/device/pda))
|
||||
return
|
||||
|
||||
generate_menu()
|
||||
print_to_host(menu)
|
||||
return
|
||||
|
||||
proc/print_to_host(var/text)
|
||||
if (!istype(loc, /obj/item/device/pda))
|
||||
return
|
||||
loc:cart = text
|
||||
|
||||
for (var/mob/M in viewers(1, loc.loc))
|
||||
if (M.client && M.machine == loc)
|
||||
loc:attack_self(M)
|
||||
|
||||
return
|
||||
|
||||
proc/post_status(var/command, var/data1, var/data2)
|
||||
|
||||
var/datum/radio_frequency/frequency = radio_controller.return_frequency(1435)
|
||||
|
||||
if(!frequency) return
|
||||
|
||||
var/datum/signal/status_signal = new
|
||||
status_signal.source = src
|
||||
status_signal.transmission_method = 1
|
||||
status_signal.data["command"] = command
|
||||
|
||||
switch(command)
|
||||
if("message")
|
||||
status_signal.data["msg1"] = data1
|
||||
status_signal.data["msg2"] = data2
|
||||
if("alert")
|
||||
status_signal.data["picture_state"] = data1
|
||||
|
||||
frequency.post_signal(src, status_signal)
|
||||
|
||||
proc/generate_menu()
|
||||
switch(mode)
|
||||
if(40) //signaller
|
||||
menu = "<h4><img src=pda_signaler.png> Remote Signaling System</h4>"
|
||||
|
||||
menu += {"
|
||||
<a href='byond://?src=\ref[src];choice=Send Signal'>Send Signal</A><BR>
|
||||
Frequency:
|
||||
<a href='byond://?src=\ref[src];choice=Signal Frequency;sfreq=-10'>-</a>
|
||||
<a href='byond://?src=\ref[src];choice=Signal Frequency;sfreq=-2'>-</a>
|
||||
[format_frequency(radio:frequency)]
|
||||
<a href='byond://?src=\ref[src];choice=Signal Frequency;sfreq=2'>+</a>
|
||||
<a href='byond://?src=\ref[src];choice=Signal Frequency;sfreq=10'>+</a><br>
|
||||
<br>
|
||||
Code:
|
||||
<a href='byond://?src=\ref[src];choice=Signal Code;scode=-5'>-</a>
|
||||
<a href='byond://?src=\ref[src];choice=Signal Code;scode=-1'>-</a>
|
||||
[radio:code]
|
||||
<a href='byond://?src=\ref[src];choice=Signal Code;scode=1'>+</a>
|
||||
<a href='byond://?src=\ref[src];choice=Signal Code;scode=5'>+</a><br>"}
|
||||
if (41) //crew manifest
|
||||
|
||||
menu = "<h4><img src=pda_notes.png> Crew Manifest</h4>"
|
||||
menu += "Entries cannot be modified from this terminal.<br><br>"
|
||||
if(!isnull(data_core.general))
|
||||
for (var/datum/data/record/t in sortRecord(data_core.general))
|
||||
menu += "[t.fields["name"]] - [t.fields["rank"]]<br>"
|
||||
menu += "<br>"
|
||||
|
||||
|
||||
if (42) //status displays
|
||||
menu = "<h4><img src=pda_status.png> Station Status Display Interlink</h4>"
|
||||
|
||||
menu += "\[ <A HREF='?src=\ref[src];choice=Status;statdisp=blank'>Clear</A> \]<BR>"
|
||||
menu += "\[ <A HREF='?src=\ref[src];choice=Status;statdisp=shuttle'>Shuttle ETA</A> \]<BR>"
|
||||
menu += "\[ <A HREF='?src=\ref[src];choice=Status;statdisp=message'>Message</A> \]"
|
||||
menu += "<ul><li> Line 1: <A HREF='?src=\ref[src];choice=Status;statdisp=setmsg1'>[ message1 ? message1 : "(none)"]</A>"
|
||||
menu += "<li> Line 2: <A HREF='?src=\ref[src];choice=Status;statdisp=setmsg2'>[ message2 ? message2 : "(none)"]</A></ul><br>"
|
||||
menu += "\[ Alert: <A HREF='?src=\ref[src];choice=Status;statdisp=alert;alert=default'>None</A> |"
|
||||
menu += " <A HREF='?src=\ref[src];choice=Status;statdisp=alert;alert=redalert'>Red Alert</A> |"
|
||||
menu += " <A HREF='?src=\ref[src];choice=Status;statdisp=alert;alert=lockdown'>Lockdown</A> |"
|
||||
menu += " <A HREF='?src=\ref[src];choice=Status;statdisp=alert;alert=biohazard'>Biohazard</A> \]<BR>"
|
||||
|
||||
if (43) //Muskets' and Rockdtben's power monitor :D
|
||||
menu = "<h4><img src=pda_power.png> Power Monitors - Please select one</h4><BR>"
|
||||
powmonitor = null
|
||||
powermonitors = null
|
||||
powermonitors = list()
|
||||
var/powercount = 0
|
||||
|
||||
|
||||
|
||||
for(var/obj/machinery/power/monitor/pMon in world)
|
||||
if(!(pMon.stat & (NOPOWER|BROKEN)) )
|
||||
powercount++
|
||||
powermonitors += pMon
|
||||
|
||||
|
||||
if(!powercount)
|
||||
menu += "\red No connection<BR>"
|
||||
else
|
||||
|
||||
menu += "<FONT SIZE=-1>"
|
||||
var/count = 0
|
||||
for(var/obj/machinery/power/monitor/pMon in powermonitors)
|
||||
count++
|
||||
menu += "<a href='byond://?src=\ref[src];choice=Power Select;target=[count]'> [pMon] </a><BR>"
|
||||
|
||||
menu += "</FONT>"
|
||||
|
||||
if (433) //Muskets' and Rockdtben's power monitor :D
|
||||
menu = "<h4><img src=pda_power.png> Power Monitor </h4><BR>"
|
||||
if(!powmonitor)
|
||||
menu += "\red No connection<BR>"
|
||||
else
|
||||
var/list/L = list()
|
||||
for(var/obj/machinery/power/terminal/term in powmonitor.powernet.nodes)
|
||||
if(istype(term.master, /obj/machinery/power/apc))
|
||||
var/obj/machinery/power/apc/A = term.master
|
||||
L += A
|
||||
|
||||
menu += "<PRE>Total power: [powmonitor.powernet.avail] W<BR>Total load: [num2text(powmonitor.powernet.viewload,10)] W<BR>"
|
||||
|
||||
menu += "<FONT SIZE=-1>"
|
||||
|
||||
if(L.len > 0)
|
||||
menu += "Area Eqp./Lgt./Env. Load Cell<HR>"
|
||||
|
||||
var/list/S = list(" Off","AOff"," On", " AOn")
|
||||
var/list/chg = list("N","C","F")
|
||||
|
||||
for(var/obj/machinery/power/apc/A in L)
|
||||
menu += copytext(add_tspace(A.area.name, 30), 1, 30)
|
||||
menu += " [S[A.equipment+1]] [S[A.lighting+1]] [S[A.environ+1]] [add_lspace(A.lastused_total, 6)] [A.cell ? "[add_lspace(round(A.cell.percent()), 3)]% [chg[A.charging+1]]" : " N/C"]<BR>"
|
||||
|
||||
menu += "</FONT></PRE>"
|
||||
|
||||
if (44) //medical records //This thing only displays a single screen so it's hard to really get the sub-menu stuff working.
|
||||
menu = "<h4><img src=pda_medical.png> Medical Record List</h4>"
|
||||
if(!isnull(data_core.general))
|
||||
for (var/datum/data/record/R in sortRecord(data_core.general))
|
||||
menu += "<a href='byond://?src=\ref[src];choice=Medical Records;target=\ref[R]'>[R.fields["id"]]: [R.fields["name"]]<br>"
|
||||
menu += "<br>"
|
||||
if(441)
|
||||
menu = "<h4><img src=pda_medical.png> Medical Record</h4>"
|
||||
|
||||
if (istype(active1, /datum/data/record) && (active1 in data_core.general))
|
||||
menu += "Name: [active1.fields["name"]] ID: [active1.fields["id"]]<br>"
|
||||
menu += "Sex: [active1.fields["sex"]]<br>"
|
||||
menu += "Age: [active1.fields["age"]]<br>"
|
||||
menu += "Rank: [active1.fields["rank"]]<br>"
|
||||
menu += "Fingerprint: [active1.fields["fingerprint"]]<br>"
|
||||
menu += "Physical Status: [active1.fields["p_stat"]]<br>"
|
||||
menu += "Mental Status: [active1.fields["m_stat"]]<br>"
|
||||
else
|
||||
menu += "<b>Record Lost!</b><br>"
|
||||
|
||||
menu += "<br>"
|
||||
|
||||
menu += "<h4><img src=pda_medical.png> Medical Data</h4>"
|
||||
if (istype(active2, /datum/data/record) && (active2 in data_core.medical))
|
||||
menu += "Blood Type: [active2.fields["b_type"]]<br><br>"
|
||||
|
||||
menu += "Minor Disabilities: [active2.fields["mi_dis"]]<br>"
|
||||
menu += "Details: [active2.fields["mi_dis_d"]]<br><br>"
|
||||
|
||||
menu += "Major Disabilities: [active2.fields["ma_dis"]]<br>"
|
||||
menu += "Details: [active2.fields["ma_dis_d"]]<br><br>"
|
||||
|
||||
menu += "Allergies: [active2.fields["alg"]]<br>"
|
||||
menu += "Details: [active2.fields["alg_d"]]<br><br>"
|
||||
|
||||
menu += "Current Diseases: [active2.fields["cdi"]]<br>"
|
||||
menu += "Details: [active2.fields["cdi_d"]]<br><br>"
|
||||
|
||||
menu += "Important Notes: [active2.fields["notes"]]<br>"
|
||||
else
|
||||
menu += "<b>Record Lost!</b><br>"
|
||||
|
||||
menu += "<br>"
|
||||
if (45) //security records
|
||||
menu = "<h4><img src=pda_cuffs.png> Security Record List</h4>"
|
||||
if(!isnull(data_core.general))
|
||||
for (var/datum/data/record/R in sortRecord(data_core.general))
|
||||
menu += "<a href='byond://?src=\ref[src];choice=Security Records;target=\ref[R]'>[R.fields["id"]]: [R.fields["name"]]<br>"
|
||||
|
||||
menu += "<br>"
|
||||
if(451)
|
||||
menu = "<h4><img src=pda_cuffs.png> Security Record</h4>"
|
||||
|
||||
if (istype(active1, /datum/data/record) && (active1 in data_core.general))
|
||||
menu += "Name: [active1.fields["name"]] ID: [active1.fields["id"]]<br>"
|
||||
menu += "Sex: [active1.fields["sex"]]<br>"
|
||||
menu += "Age: [active1.fields["age"]]<br>"
|
||||
menu += "Rank: [active1.fields["rank"]]<br>"
|
||||
menu += "Fingerprint: [active1.fields["fingerprint"]]<br>"
|
||||
menu += "Physical Status: [active1.fields["p_stat"]]<br>"
|
||||
menu += "Mental Status: [active1.fields["m_stat"]]<br>"
|
||||
else
|
||||
menu += "<b>Record Lost!</b><br>"
|
||||
|
||||
menu += "<br>"
|
||||
|
||||
menu += "<h4><img src=pda_cuffs.png> Security Data</h4>"
|
||||
if (istype(active3, /datum/data/record) && (active3 in data_core.security))
|
||||
menu += "Criminal Status: [active3.fields["criminal"]]<br>"
|
||||
|
||||
menu += "Minor Crimes: [active3.fields["mi_crim"]]<br>"
|
||||
menu += "Details: [active3.fields["mi_crim"]]<br><br>"
|
||||
|
||||
menu += "Major Crimes: [active3.fields["ma_crim"]]<br>"
|
||||
menu += "Details: [active3.fields["ma_crim_d"]]<br><br>"
|
||||
|
||||
menu += "Important Notes:<br>"
|
||||
menu += "[active3.fields["notes"]]"
|
||||
else
|
||||
menu += "<b>Record Lost!</b><br>"
|
||||
|
||||
menu += "<br>"
|
||||
if (46) //beepsky control
|
||||
var/obj/item/radio/integrated/beepsky/SC = radio
|
||||
if(!SC)
|
||||
menu = "Interlink Error - Please reinsert cartridge."
|
||||
return
|
||||
|
||||
menu = "<h4><img src=pda_cuffs.png> Securitron Interlink</h4>"
|
||||
|
||||
if(!SC.active)
|
||||
// list of bots
|
||||
if(!SC.botlist || (SC.botlist && SC.botlist.len==0))
|
||||
menu += "No bots found.<BR>"
|
||||
|
||||
else
|
||||
for(var/obj/machinery/bot/secbot/B in SC.botlist)
|
||||
menu += "<A href='byond://?src=\ref[SC];op=control;bot=\ref[B]'>[B] at [B.loc.loc]</A><BR>"
|
||||
|
||||
menu += "<BR><A href='byond://?src=\ref[SC];op=scanbots'><img src=pda_scanner.png> Scan for active bots</A><BR>"
|
||||
|
||||
else // bot selected, control it
|
||||
|
||||
menu += "<B>[SC.active]</B><BR> Status: (<A href='byond://?src=\ref[SC];op=control;bot=\ref[SC.active]'><img src=pda_refresh.png><i>refresh</i></A>)<BR>"
|
||||
|
||||
if(!SC.botstatus)
|
||||
menu += "Waiting for response...<BR>"
|
||||
else
|
||||
|
||||
menu += "Location: [SC.botstatus["loca"] ]<BR>"
|
||||
menu += "Mode: "
|
||||
|
||||
switch(SC.botstatus["mode"])
|
||||
if(0)
|
||||
menu += "Ready"
|
||||
if(1)
|
||||
menu += "Apprehending target"
|
||||
if(2,3)
|
||||
menu += "Arresting target"
|
||||
if(4)
|
||||
menu += "Starting patrol"
|
||||
if(5)
|
||||
menu += "On patrol"
|
||||
if(6)
|
||||
menu += "Responding to summons"
|
||||
|
||||
menu += "<BR>\[<A href='byond://?src=\ref[SC];op=stop'>Stop Patrol</A>\] "
|
||||
menu += "\[<A href='byond://?src=\ref[SC];op=go'>Start Patrol</A>\] "
|
||||
menu += "\[<A href='byond://?src=\ref[SC];op=summon'>Summon Bot</A>\]<BR>"
|
||||
menu += "<HR><A href='byond://?src=\ref[SC];op=botlist'><img src=pda_back.png>Return to bot list</A>"
|
||||
|
||||
if (47) //quartermaster order records
|
||||
menu = "<h4><img src=pda_crate.png> Supply Record Interlink</h4>"
|
||||
|
||||
menu += "<BR><B>Supply shuttle</B><BR>"
|
||||
menu += "Location: [supply_shuttle.moving ? "Moving to station ([supply_shuttle.eta] Mins.)":supply_shuttle.at_station ? "Station":"Dock"]<BR>"
|
||||
menu += "Current approved orders: <BR><ol>"
|
||||
for(var/S in supply_shuttle.shoppinglist)
|
||||
var/datum/supply_order/SO = S
|
||||
menu += "<li>#[SO.ordernum] - [SO.object.name] approved by [SO.orderedby] [SO.comment ? "([SO.comment])":""]</li>"
|
||||
menu += "</ol>"
|
||||
|
||||
menu += "Current requests: <BR><ol>"
|
||||
for(var/S in supply_shuttle.requestlist)
|
||||
var/datum/supply_order/SO = S
|
||||
menu += "<li>#[SO.ordernum] - [SO.object.name] requested by [SO.orderedby]</li>"
|
||||
menu += "</ol><font size=\"-3\">Upgrade NOW to Space Parts & Space Vendors PLUS for full remote order control and inventory management."
|
||||
|
||||
if (48) //mulebot control
|
||||
var/obj/item/radio/integrated/mule/QC = radio
|
||||
if(!QC)
|
||||
menu = "Interlink Error - Please reinsert cartridge."
|
||||
return
|
||||
|
||||
menu = "<h4><img src=pda_mule.png> M.U.L.E. bot Interlink V0.8</h4>"
|
||||
|
||||
if(!QC.active)
|
||||
// list of bots
|
||||
if(!QC.botlist || (QC.botlist && QC.botlist.len==0))
|
||||
menu += "No bots found.<BR>"
|
||||
|
||||
else
|
||||
for(var/obj/machinery/bot/mulebot/B in QC.botlist)
|
||||
menu += "<A href='byond://?src=\ref[QC];op=control;bot=\ref[B]'>[B] at [B.loc.loc]</A><BR>"
|
||||
|
||||
menu += "<BR><A href='byond://?src=\ref[QC];op=scanbots'><img src=pda_scanner.png> Scan for active bots</A><BR>"
|
||||
|
||||
else // bot selected, control it
|
||||
|
||||
menu += "<B>[QC.active]</B><BR> Status: (<A href='byond://?src=\ref[QC];op=control;bot=\ref[QC.active]'><img src=pda_refresh.png><i>refresh</i></A>)<BR>"
|
||||
|
||||
if(!QC.botstatus)
|
||||
menu += "Waiting for response...<BR>"
|
||||
else
|
||||
|
||||
menu += "Location: [QC.botstatus["loca"] ]<BR>"
|
||||
menu += "Mode: "
|
||||
|
||||
switch(QC.botstatus["mode"])
|
||||
if(0)
|
||||
menu += "Ready"
|
||||
if(1)
|
||||
menu += "Loading/Unloading"
|
||||
if(2)
|
||||
menu += "Navigating to Delivery Location"
|
||||
if(3)
|
||||
menu += "Navigating to Home"
|
||||
if(4)
|
||||
menu += "Waiting for clear path"
|
||||
if(5,6)
|
||||
menu += "Calculating navigation path"
|
||||
if(7)
|
||||
menu += "Unable to locate destination"
|
||||
var/obj/structure/closet/crate/C = QC.botstatus["load"]
|
||||
menu += "<BR>Current Load: [ !C ? "<i>none</i>" : "[C.name] (<A href='byond://?src=\ref[QC];op=unload'><i>unload</i></A>)" ]<BR>"
|
||||
menu += "Destination: [!QC.botstatus["dest"] ? "<i>none</i>" : QC.botstatus["dest"] ] (<A href='byond://?src=\ref[QC];op=setdest'><i>set</i></A>)<BR>"
|
||||
menu += "Power: [QC.botstatus["powr"]]%<BR>"
|
||||
menu += "Home: [!QC.botstatus["home"] ? "<i>none</i>" : QC.botstatus["home"] ]<BR>"
|
||||
menu += "Auto Return Home: [QC.botstatus["retn"] ? "<B>On</B> <A href='byond://?src=\ref[QC];op=retoff'>Off</A>" : "(<A href='byond://?src=\ref[QC];op=reton'><i>On</i></A>) <B>Off</B>"]<BR>"
|
||||
menu += "Auto Pickup Crate: [QC.botstatus["pick"] ? "<B>On</B> <A href='byond://?src=\ref[QC];op=pickoff'>Off</A>" : "(<A href='byond://?src=\ref[QC];op=pickon'><i>On</i></A>) <B>Off</B>"]<BR><BR>"
|
||||
|
||||
menu += "\[<A href='byond://?src=\ref[QC];op=stop'>Stop</A>\] "
|
||||
menu += "\[<A href='byond://?src=\ref[QC];op=go'>Proceed</A>\] "
|
||||
menu += "\[<A href='byond://?src=\ref[QC];op=home'>Return Home</A>\]<BR>"
|
||||
menu += "<HR><A href='byond://?src=\ref[QC];op=botlist'><img src=pda_back.png>Return to bot list</A>"
|
||||
|
||||
if (49) //janitorial locator
|
||||
menu = "<h4><img src=pda_bucket.png> Persistent Custodial Object Locator</h4>"
|
||||
|
||||
var/turf/cl = get_turf(src)
|
||||
if (cl)
|
||||
menu += "Current Orbital Location: <b>\[[cl.x],[cl.y]\]</b>"
|
||||
|
||||
menu += "<h4>Located Mops:</h4>"
|
||||
|
||||
var/ldat
|
||||
for (var/obj/item/weapon/mop/M in world)
|
||||
var/turf/ml = get_turf(M)
|
||||
|
||||
if(ml)
|
||||
if (ml.z != cl.z)
|
||||
continue
|
||||
var/direction = get_dir(src, M)
|
||||
ldat += "Mop - <b>\[[ml.x],[ml.y] ([uppertext(dir2text(direction))])\]</b> - [M.reagents.total_volume ? "Wet" : "Dry"]<br>"
|
||||
|
||||
if (!ldat)
|
||||
menu += "None"
|
||||
else
|
||||
menu += "[ldat]"
|
||||
|
||||
menu += "<h4>Located Mop Buckets:</h4>"
|
||||
|
||||
ldat = null
|
||||
for (var/obj/structure/mopbucket/B in world)
|
||||
var/turf/bl = get_turf(B)
|
||||
|
||||
if(bl)
|
||||
if (bl.z != cl.z)
|
||||
continue
|
||||
var/direction = get_dir(src, B)
|
||||
ldat += "Bucket - <b>\[[bl.x],[bl.y] ([uppertext(dir2text(direction))])\]</b> - Water level: [B.reagents.total_volume]/100<br>"
|
||||
|
||||
if (!ldat)
|
||||
menu += "None"
|
||||
else
|
||||
menu += "[ldat]"
|
||||
|
||||
menu += "<h4>Located Cleanbots:</h4>"
|
||||
|
||||
ldat = null
|
||||
for (var/obj/machinery/bot/cleanbot/B in world)
|
||||
var/turf/bl = get_turf(B)
|
||||
|
||||
if(bl)
|
||||
if (bl.z != cl.z)
|
||||
continue
|
||||
var/direction = get_dir(src, B)
|
||||
ldat += "Cleanbot - <b>\[[bl.x],[bl.y] ([uppertext(dir2text(direction))])\]</b> - [B.on ? "Online" : "Offline"]<br>"
|
||||
|
||||
if (!ldat)
|
||||
menu += "None"
|
||||
else
|
||||
menu += "[ldat]"
|
||||
|
||||
else
|
||||
menu += "ERROR: Unable to determine current location."
|
||||
menu += "<br><br><A href='byond://?src=\ref[src];choice=49'>Refresh GPS Locator</a>"
|
||||
|
||||
proc/add_data(atom/A as mob|obj|turf|area)
|
||||
//I love hashtables.
|
||||
var/list/data_entry = stored_data["\ref [A]"]
|
||||
if(islist(data_entry)) //Yay, it was already stored!
|
||||
//Merge the fingerprints.
|
||||
var/list/data_prints = data_entry[1]
|
||||
for(var/print in A.fingerprints)
|
||||
var/merged_print = data_prints[print]
|
||||
if(!merged_print)
|
||||
data_prints[print] = A.fingerprints[print]
|
||||
else
|
||||
data_prints[print] = stringmerge(data_prints[print],A.fingerprints[print])
|
||||
|
||||
//Now the fibers
|
||||
var/list/fibers = data_entry[2]
|
||||
if(!fibers)
|
||||
fibers = list()
|
||||
if(A.suit_fibers && A.suit_fibers.len)
|
||||
for(var/j = 1, j <= A.suit_fibers.len, j++) //Fibers~~~
|
||||
if(!fibers.Find(A.suit_fibers[j])) //It isn't! Add!
|
||||
fibers += A.suit_fibers[j]
|
||||
var/list/blood = data_entry[3]
|
||||
if(!blood)
|
||||
blood = list()
|
||||
if(A.blood_DNA && A.blood_DNA.len)
|
||||
for(var/main_blood in A.blood_DNA)
|
||||
if(!blood[main_blood])
|
||||
blood[main_blood] = A.blood_DNA[blood]
|
||||
return 1
|
||||
var/list/sum_list[4] //Pack it back up!
|
||||
sum_list[1] = A.fingerprints
|
||||
sum_list[2] = A.suit_fibers
|
||||
sum_list[3] = A.blood_DNA
|
||||
sum_list[4] = "\The [A] in \the [get_area(A)]"
|
||||
stored_data["\ref [A]"] = sum_list
|
||||
return 0
|
||||
|
||||
/obj/item/weapon/cartridge/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if (!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
|
||||
usr.machine = null
|
||||
usr << browse(null, "window=pda")
|
||||
return
|
||||
|
||||
switch(href_list["choice"])
|
||||
if("Medical Records")
|
||||
var/datum/data/record/R = locate(href_list["target"])
|
||||
var/datum/data/record/M = locate(href_list["target"])
|
||||
loc:mode = 441
|
||||
mode = 441
|
||||
if (R in data_core.general)
|
||||
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
|
||||
active1 = R
|
||||
active2 = M
|
||||
|
||||
if("Security Records")
|
||||
var/datum/data/record/R = locate(href_list["target"])
|
||||
var/datum/data/record/S = locate(href_list["target"])
|
||||
loc:mode = 451
|
||||
mode = 451
|
||||
if (R in data_core.general)
|
||||
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
|
||||
active1 = R
|
||||
active3 = S
|
||||
|
||||
if("Send Signal")
|
||||
spawn( 0 )
|
||||
radio:send_signal("ACTIVATE")
|
||||
return
|
||||
|
||||
if("Signal Frequency")
|
||||
var/new_frequency = sanitize_frequency(radio:frequency + text2num(href_list["sfreq"]))
|
||||
radio:set_frequency(new_frequency)
|
||||
|
||||
if("Signal Code")
|
||||
radio:code += text2num(href_list["scode"])
|
||||
radio:code = round(radio:code)
|
||||
radio:code = min(100, radio:code)
|
||||
radio:code = max(1, radio:code)
|
||||
|
||||
if("Status")
|
||||
switch(href_list["statdisp"])
|
||||
if("message")
|
||||
post_status("message", message1, message2)
|
||||
if("alert")
|
||||
post_status("alert", href_list["alert"])
|
||||
if("setmsg1")
|
||||
message1 = input("Line 1", "Enter Message Text", message1) as text|null
|
||||
updateSelfDialog()
|
||||
if("setmsg2")
|
||||
message2 = input("Line 2", "Enter Message Text", message2) as text|null
|
||||
updateSelfDialog()
|
||||
else
|
||||
post_status(href_list["statdisp"])
|
||||
if("Power Select")
|
||||
var/pnum = text2num(href_list["target"])
|
||||
powmonitor = powermonitors[pnum]
|
||||
loc:mode = 433
|
||||
mode = 433
|
||||
|
||||
generate_menu()
|
||||
print_to_host(menu)
|
||||
@@ -0,0 +1,16 @@
|
||||
var/list/chatrooms = list()
|
||||
|
||||
/datum/chatroom
|
||||
var/name = "Generic Chatroom"
|
||||
var/list/logged_in = list()
|
||||
var/list/logs = list() // chat logs
|
||||
var/list/banned = list() // banned users
|
||||
var/list/whitelist = list() // whitelisted users
|
||||
var/list/muted = list()
|
||||
var/topic = "" // topic message for the chatroom
|
||||
var/password = "" // blank for no password.
|
||||
var/operator = "" // name of the operator
|
||||
|
||||
/datum/chatroom/proc/attempt_connect(var/obj/item/device/pda/device, var/obj/password)
|
||||
if(!device)
|
||||
return
|
||||
@@ -0,0 +1,259 @@
|
||||
/obj/item/radio/integrated
|
||||
name = "PDA radio module"
|
||||
desc = "An electronic radio system of nanotrasen origin."
|
||||
icon = 'icons/obj/module.dmi'
|
||||
icon_state = "power_mod"
|
||||
var/obj/item/device/pda/hostpda = null
|
||||
|
||||
var/on = 0 //Are we currently active??
|
||||
var/menu_message = ""
|
||||
|
||||
New()
|
||||
..()
|
||||
if (istype(loc.loc, /obj/item/device/pda))
|
||||
hostpda = loc.loc
|
||||
|
||||
proc/post_signal(var/freq, var/key, var/value, var/key2, var/value2, var/key3, var/value3, s_filter)
|
||||
|
||||
//world << "Post: [freq]: [key]=[value], [key2]=[value2]"
|
||||
var/datum/radio_frequency/frequency = radio_controller.return_frequency(freq)
|
||||
|
||||
if(!frequency) return
|
||||
|
||||
var/datum/signal/signal = new()
|
||||
signal.source = src
|
||||
signal.transmission_method = 1
|
||||
signal.data[key] = value
|
||||
if(key2)
|
||||
signal.data[key2] = value2
|
||||
if(key3)
|
||||
signal.data[key3] = value3
|
||||
|
||||
frequency.post_signal(src, signal, filter = s_filter)
|
||||
|
||||
proc/print_to_host(var/text)
|
||||
if (isnull(src.hostpda))
|
||||
return
|
||||
src.hostpda.cart = text
|
||||
|
||||
for (var/mob/M in viewers(1, src.hostpda.loc))
|
||||
if (M.client && M.machine == src.hostpda)
|
||||
src.hostpda.cartridge.unlock()
|
||||
|
||||
return
|
||||
|
||||
proc/generate_menu()
|
||||
|
||||
/obj/item/radio/integrated/beepsky
|
||||
var/list/botlist = null // list of bots
|
||||
var/obj/machinery/bot/secbot/active // the active bot; if null, show bot list
|
||||
var/list/botstatus // the status signal sent by the bot
|
||||
|
||||
var/control_freq = 1447
|
||||
|
||||
// create a new QM cartridge, and register to receive bot control & beacon message
|
||||
New()
|
||||
..()
|
||||
spawn(5)
|
||||
if(radio_controller)
|
||||
radio_controller.add_object(src, control_freq, filter = RADIO_SECBOT)
|
||||
|
||||
// receive radio signals
|
||||
// can detect bot status signals
|
||||
// create/populate list as they are recvd
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
// var/obj/item/device/pda/P = src.loc
|
||||
|
||||
/*
|
||||
world << "recvd:[P] : [signal.source]"
|
||||
for(var/d in signal.data)
|
||||
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()
|
||||
|
||||
// if (istype(P)) P.updateSelfDialog()
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
var/obj/item/device/pda/PDA = src.hostpda
|
||||
|
||||
switch(href_list["op"])
|
||||
|
||||
if("control")
|
||||
active = locate(href_list["bot"])
|
||||
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = RADIO_SECBOT)
|
||||
|
||||
if("scanbots") // find all bots
|
||||
botlist = null
|
||||
post_signal(control_freq, "command", "bot_status", s_filter = RADIO_SECBOT)
|
||||
|
||||
if("botlist")
|
||||
active = null
|
||||
|
||||
if("stop", "go")
|
||||
post_signal(control_freq, "command", href_list["op"], "active", active, s_filter = RADIO_SECBOT)
|
||||
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = RADIO_SECBOT)
|
||||
|
||||
if("summon")
|
||||
post_signal(control_freq, "command", "summon", "active", active, "target", get_turf(PDA) , s_filter = RADIO_SECBOT)
|
||||
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = RADIO_SECBOT)
|
||||
PDA.cartridge.unlock()
|
||||
|
||||
/obj/item/radio/integrated/mule
|
||||
var/list/botlist = null // list of bots
|
||||
var/obj/machinery/bot/mulebot/active // the active bot; if null, show bot list
|
||||
var/list/botstatus // the status signal sent by the bot
|
||||
var/list/beacons
|
||||
|
||||
var/beacon_freq = 1400
|
||||
var/control_freq = 1447
|
||||
|
||||
// create a new QM cartridge, and register to receive bot control & beacon message
|
||||
New()
|
||||
..()
|
||||
spawn(5)
|
||||
if(radio_controller)
|
||||
radio_controller.add_object(src, control_freq, filter = RADIO_MULEBOT)
|
||||
radio_controller.add_object(src, beacon_freq, filter = RADIO_NAVBEACONS)
|
||||
spawn(10)
|
||||
post_signal(beacon_freq, "findbeacon", "delivery", s_filter = RADIO_NAVBEACONS)
|
||||
|
||||
// receive radio signals
|
||||
// can detect bot status signals
|
||||
// and beacon locations
|
||||
// create/populate lists as they are recvd
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
// var/obj/item/device/pda/P = src.loc
|
||||
|
||||
/*
|
||||
world << "recvd:[P] : [signal.source]"
|
||||
for(var/d in signal.data)
|
||||
world << "- [d] = [signal.data[d]]"
|
||||
*/
|
||||
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()
|
||||
|
||||
else if(signal.data["beacon"])
|
||||
if(!beacons)
|
||||
beacons = new()
|
||||
|
||||
beacons[signal.data["beacon"] ] = signal.source
|
||||
|
||||
|
||||
// if(istype(P)) P.updateSelfDialog()
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
var/obj/item/device/pda/PDA = src.hostpda
|
||||
var/cmd = "command"
|
||||
if(active) cmd = "command [active.suffix]"
|
||||
|
||||
switch(href_list["op"])
|
||||
|
||||
if("control")
|
||||
active = locate(href_list["bot"])
|
||||
post_signal(control_freq, cmd, "bot_status", s_filter = RADIO_MULEBOT)
|
||||
|
||||
if("scanbots") // find all bots
|
||||
botlist = null
|
||||
post_signal(control_freq, "command", "bot_status", s_filter = RADIO_MULEBOT)
|
||||
|
||||
if("botlist")
|
||||
active = null
|
||||
|
||||
|
||||
if("unload")
|
||||
post_signal(control_freq, cmd, "unload", s_filter = RADIO_MULEBOT)
|
||||
post_signal(control_freq, cmd, "bot_status", s_filter = RADIO_MULEBOT)
|
||||
if("setdest")
|
||||
if(beacons)
|
||||
var/dest = input("Select Bot Destination", "Mulebot [active.suffix] Interlink", active.destination) as null|anything in beacons
|
||||
if(dest)
|
||||
post_signal(control_freq, cmd, "target", "destination", dest, s_filter = RADIO_MULEBOT)
|
||||
post_signal(control_freq, cmd, "bot_status", s_filter = RADIO_MULEBOT)
|
||||
|
||||
if("retoff")
|
||||
post_signal(control_freq, cmd, "autoret", "value", 0, s_filter = RADIO_MULEBOT)
|
||||
post_signal(control_freq, cmd, "bot_status", s_filter = RADIO_MULEBOT)
|
||||
if("reton")
|
||||
post_signal(control_freq, cmd, "autoret", "value", 1, s_filter = RADIO_MULEBOT)
|
||||
post_signal(control_freq, cmd, "bot_status", s_filter = RADIO_MULEBOT)
|
||||
|
||||
if("pickoff")
|
||||
post_signal(control_freq, cmd, "autopick", "value", 0, s_filter = RADIO_MULEBOT)
|
||||
post_signal(control_freq, cmd, "bot_status", s_filter = RADIO_MULEBOT)
|
||||
if("pickon")
|
||||
post_signal(control_freq, cmd, "autopick", "value", 1, s_filter = RADIO_MULEBOT)
|
||||
post_signal(control_freq, cmd, "bot_status", s_filter = RADIO_MULEBOT)
|
||||
|
||||
if("stop", "go", "home")
|
||||
post_signal(control_freq, cmd, href_list["op"], s_filter = RADIO_MULEBOT)
|
||||
post_signal(control_freq, cmd, "bot_status", s_filter = RADIO_MULEBOT)
|
||||
PDA.cartridge.unlock()
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Radio Cartridge, essentially a signaler.
|
||||
*/
|
||||
|
||||
|
||||
/obj/item/radio/integrated/signal
|
||||
var/frequency = 1457
|
||||
var/code = 30.0
|
||||
var/last_transmission
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
New()
|
||||
..()
|
||||
if(radio_controller)
|
||||
initialize()
|
||||
|
||||
initialize()
|
||||
if (src.frequency < 1441 || src.frequency > 1489)
|
||||
src.frequency = sanitize_frequency(src.frequency)
|
||||
|
||||
set_frequency(frequency)
|
||||
|
||||
proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, frequency)
|
||||
|
||||
proc/send_signal(message="ACTIVATE")
|
||||
|
||||
if(last_transmission && world.time < (last_transmission + 5))
|
||||
return
|
||||
last_transmission = world.time
|
||||
|
||||
var/time = time2text(world.realtime,"hh:mm:ss")
|
||||
var/turf/T = get_turf(src)
|
||||
lastsignalers.Add("[time] <B>:</B> [usr.key] used [src] @ location ([T.x],[T.y],[T.z]) <B>:</B> [format_frequency(frequency)]/[code]")
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.source = src
|
||||
signal.encryption = code
|
||||
signal.data["message"] = message
|
||||
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
return
|
||||
@@ -0,0 +1,128 @@
|
||||
/obj/item/device/aicard
|
||||
name = "inteliCard"
|
||||
icon = 'icons/obj/pda.dmi'
|
||||
icon_state = "aicard" // aicard-full
|
||||
item_state = "electronic"
|
||||
w_class = 2.0
|
||||
flags = FPRINT | TABLEPASS
|
||||
slot_flags = SLOT_BELT
|
||||
var/flush = null
|
||||
origin_tech = "programming=4;materials=4"
|
||||
|
||||
|
||||
attack(mob/living/silicon/ai/M as mob, mob/user as mob)
|
||||
if(!istype(M, /mob/living/silicon/ai))//If target is not an AI.
|
||||
return ..()
|
||||
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been carded with [src.name] by [user.name] ([user.ckey])</font>")
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to card [M.name] ([M.ckey])</font>")
|
||||
|
||||
log_attack("<font color='red'>[user.name] ([user.ckey]) used the [src.name] to card [M.name] ([M.ckey])</font>")
|
||||
|
||||
|
||||
transfer_ai("AICORE", "AICARD", M, user)
|
||||
return
|
||||
|
||||
attack(mob/living/silicon/decoy/M as mob, mob/user as mob)
|
||||
if (!istype (M, /mob/living/silicon/decoy))
|
||||
return ..()
|
||||
else
|
||||
M.death()
|
||||
user << "<b>ERROR ERROR ERROR</b>"
|
||||
|
||||
attack_self(mob/user)
|
||||
if (!in_range(src, user))
|
||||
return
|
||||
user.machine = src
|
||||
var/dat = "<TT><B>Intelicard</B><BR>"
|
||||
var/laws
|
||||
for(var/mob/living/silicon/ai/A in src)
|
||||
dat += "Stored AI: [A.name]<br>System integrity: [(A.health+100)/2]%<br>"
|
||||
|
||||
for (var/index = 1, index <= A.laws.ion.len, index++)
|
||||
var/law = A.laws.ion[index]
|
||||
if (length(law) > 0)
|
||||
var/num = ionnum()
|
||||
laws += "[num]. [law]"
|
||||
|
||||
if (A.laws.zeroth)
|
||||
laws += "0: [A.laws.zeroth]<BR>"
|
||||
|
||||
var/number = 1
|
||||
for (var/index = 1, index <= A.laws.inherent.len, index++)
|
||||
var/law = A.laws.inherent[index]
|
||||
if (length(law) > 0)
|
||||
laws += "[number]: [law]<BR>"
|
||||
number++
|
||||
|
||||
for (var/index = 1, index <= A.laws.supplied.len, index++)
|
||||
var/law = A.laws.supplied[index]
|
||||
if (length(law) > 0)
|
||||
laws += "[number]: [law]<BR>"
|
||||
number++
|
||||
|
||||
dat += "Laws:<br>[laws]<br>"
|
||||
|
||||
if (A.stat == 2)
|
||||
dat += "<b>AI nonfunctional</b>"
|
||||
else
|
||||
if (!src.flush)
|
||||
dat += {"<A href='byond://?src=\ref[src];choice=Wipe'>Wipe AI</A>"}
|
||||
else
|
||||
dat += "<b>Wipe in progress</b>"
|
||||
dat += "<br>"
|
||||
dat += {"<a href='byond://?src=\ref[src];choice=Wireless'>[A.control_disabled ? "Enable" : "Disable"] Wireless Activity</a>"}
|
||||
dat += "<br>"
|
||||
dat += {"<a href='byond://?src=\ref[src];choice=Close'> Close</a>"}
|
||||
user << browse(dat, "window=aicard")
|
||||
onclose(user, "aicard")
|
||||
return
|
||||
|
||||
Topic(href, href_list)
|
||||
var/mob/U = usr
|
||||
if (!in_range(src, U)||U.machine!=src)//If they are not in range of 1 or less or their machine is not the card (ie, clicked on something else).
|
||||
U << browse(null, "window=aicard")
|
||||
U.machine = null
|
||||
return
|
||||
|
||||
add_fingerprint(U)
|
||||
U.machine = src
|
||||
|
||||
switch(href_list["choice"])//Now we switch based on choice.
|
||||
if ("Close")
|
||||
U << browse(null, "window=aicard")
|
||||
U.machine = null
|
||||
return
|
||||
|
||||
if ("Wipe")
|
||||
var/confirm = alert("Are you sure you want to wipe this card's memory? This cannot be undone once started.", "Confirm Wipe", "Yes", "No")
|
||||
if(confirm == "Yes")
|
||||
if(isnull(src)||!in_range(src, U)||U.machine!=src)
|
||||
U << browse(null, "window=aicard")
|
||||
U.machine = null
|
||||
return
|
||||
else
|
||||
flush = 1
|
||||
for(var/mob/living/silicon/ai/A in src)
|
||||
A.suiciding = 1
|
||||
A << "Your core files are being wiped!"
|
||||
while (A.stat != 2)
|
||||
A.adjustOxyLoss(2)
|
||||
A.updatehealth()
|
||||
sleep(10)
|
||||
flush = 0
|
||||
|
||||
if ("Wireless")
|
||||
for(var/mob/living/silicon/ai/A in src)
|
||||
A.control_disabled = !A.control_disabled
|
||||
A << "The intelicard's wireless port has been [A.control_disabled ? "disabled" : "enabled"]!"
|
||||
if (A.control_disabled)
|
||||
overlays -= image('icons/obj/pda.dmi', "aicard-on")
|
||||
else
|
||||
overlays += image('icons/obj/pda.dmi', "aicard-on")
|
||||
attack_self(U)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
/obj/item/device/chameleon
|
||||
name = "chameleon-projector"
|
||||
icon_state = "shield0"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT | USEDELAY
|
||||
slot_flags = SLOT_BELT
|
||||
item_state = "electronic"
|
||||
throwforce = 5.0
|
||||
throw_speed = 1
|
||||
throw_range = 5
|
||||
w_class = 2.0
|
||||
origin_tech = "syndicate=4;magnets=4"
|
||||
var/can_use = 1
|
||||
var/obj/effect/dummy/chameleon/active_dummy = null
|
||||
var/saved_item = "/obj/item/weapon/cigbutt"
|
||||
|
||||
dropped()
|
||||
disrupt()
|
||||
|
||||
attack_self()
|
||||
toggle()
|
||||
|
||||
afterattack(atom/target, mob/user , flag)
|
||||
if(istype(target,/obj/item))
|
||||
playsound(src, 'sound/weapons/flash.ogg', 100, 1, 1)
|
||||
user << "\blue Scanned [target]."
|
||||
saved_item = target.type
|
||||
|
||||
proc/toggle()
|
||||
if(!can_use || !saved_item) return
|
||||
if(active_dummy)
|
||||
playsound(src, 'sound/effects/pop.ogg', 100, 1, 1)
|
||||
for(var/atom/movable/A in active_dummy)
|
||||
A.loc = active_dummy.loc
|
||||
if(ismob(A))
|
||||
if(A:client)
|
||||
A:client:eye = A
|
||||
del(active_dummy)
|
||||
active_dummy = null
|
||||
usr << "\blue You deactivate the [src]."
|
||||
var/obj/effect/overlay/T = new/obj/effect/overlay(get_turf(src))
|
||||
T.icon = 'icons/effects/effects.dmi'
|
||||
flick("emppulse",T)
|
||||
spawn(8) del(T)
|
||||
else
|
||||
playsound(src, 'sound/effects/pop.ogg', 100, 1, 1)
|
||||
var/obj/O = new saved_item(src)
|
||||
if(!O) return
|
||||
var/obj/effect/dummy/chameleon/C = new/obj/effect/dummy/chameleon(usr.loc)
|
||||
C.name = O.name
|
||||
C.desc = O.desc
|
||||
C.icon = O.icon
|
||||
C.icon_state = O.icon_state
|
||||
C.dir = O.dir
|
||||
usr.loc = C
|
||||
C.master = src
|
||||
src.active_dummy = C
|
||||
del(O)
|
||||
usr << "\blue You activate the [src]."
|
||||
var/obj/effect/overlay/T = new/obj/effect/overlay(get_turf(src))
|
||||
T.icon = 'icons/effects/effects.dmi'
|
||||
flick("emppulse",T)
|
||||
spawn(8) del(T)
|
||||
|
||||
proc/disrupt()
|
||||
if(active_dummy)
|
||||
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread
|
||||
spark_system.set_up(5, 0, src)
|
||||
spark_system.attach(src)
|
||||
spark_system.start()
|
||||
for(var/atom/movable/A in active_dummy)
|
||||
A.loc = active_dummy.loc
|
||||
if(ismob(A))
|
||||
if(A:client)
|
||||
A:client:eye = A
|
||||
del(active_dummy)
|
||||
active_dummy = null
|
||||
can_use = 0
|
||||
spawn(100) can_use = 1
|
||||
|
||||
|
||||
/obj/effect/dummy/chameleon
|
||||
name = ""
|
||||
desc = ""
|
||||
density = 0
|
||||
anchored = 1
|
||||
var/can_move = 1
|
||||
var/obj/item/device/chameleon/master = null
|
||||
attackby()
|
||||
for(var/mob/M in src)
|
||||
M << "\red Your chameleon-projector deactivates."
|
||||
master.disrupt()
|
||||
attack_hand()
|
||||
for(var/mob/M in src)
|
||||
M << "\red Your chameleon-projector deactivates."
|
||||
master.disrupt()
|
||||
ex_act()
|
||||
for(var/mob/M in src)
|
||||
M << "\red Your chameleon-projector deactivates."
|
||||
master.disrupt()
|
||||
bullet_act()
|
||||
for(var/mob/M in src)
|
||||
M << "\red Your chameleon-projector deactivates."
|
||||
..()
|
||||
master.disrupt()
|
||||
relaymove(var/mob/user, direction)
|
||||
if(istype(loc, /turf/space)) return //No magical space movement!
|
||||
|
||||
if(can_move)
|
||||
can_move = 0
|
||||
switch(usr.bodytemperature)
|
||||
if(300 to INFINITY)
|
||||
spawn(10) can_move = 1
|
||||
if(295 to 300)
|
||||
spawn(13) can_move = 1
|
||||
if(280 to 295)
|
||||
spawn(16) can_move = 1
|
||||
if(260 to 280)
|
||||
spawn(20) can_move = 1
|
||||
else
|
||||
spawn(25) can_move = 1
|
||||
step(src,direction)
|
||||
return
|
||||
@@ -0,0 +1,214 @@
|
||||
/obj/item/device/flash
|
||||
name = "flash"
|
||||
desc = "Used for blinding and being an asshole."
|
||||
icon_state = "flash"
|
||||
item_state = "flashbang" //looks exactly like a flash (and nothing like a flashbang)
|
||||
throwforce = 5
|
||||
w_class = 1.0
|
||||
throw_speed = 4
|
||||
throw_range = 10
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
origin_tech = "magnets=2;combat=1"
|
||||
|
||||
var/times_used = 0 //Number of times it's been used.
|
||||
var/broken = 0 //Is the flash burnt out?
|
||||
var/last_used = 0 //last world.time it was used.
|
||||
|
||||
/obj/item/device/flash/proc/clown_check(var/mob/user)
|
||||
if(user && (CLUMSY in user.mutations) && prob(50))
|
||||
user << "\red \The [src] slips out of your hand."
|
||||
user.drop_item()
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/item/device/flash/proc/flash_recharge()
|
||||
//capacitor recharges over time
|
||||
for(var/i=0, i<3, i++)
|
||||
if(last_used+600 > world.time)
|
||||
break
|
||||
last_used += 600
|
||||
times_used -= 2
|
||||
last_used = world.time
|
||||
times_used = max(0,round(times_used)) //sanity
|
||||
|
||||
|
||||
/obj/item/device/flash/attack(mob/living/M as mob, mob/user as mob)
|
||||
if(!user || !M) return //sanity
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been flashed (attempt) with [src.name] by [user.name] ([user.ckey])</font>")
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to flash [M.name] ([M.ckey])</font>")
|
||||
|
||||
log_attack("<font color='red'>[user.name] ([user.ckey]) Used the [src.name] to flash [M.name] ([M.ckey])</font>")
|
||||
|
||||
|
||||
if(!clown_check(user)) return
|
||||
if(broken)
|
||||
user << "<span class='warning'>\The [src] is broken.</span>"
|
||||
return
|
||||
|
||||
flash_recharge()
|
||||
|
||||
//spamming the flash before it's fully charged (60seconds) increases the chance of it breaking
|
||||
//It will never break on the first use.
|
||||
switch(times_used)
|
||||
if(0 to 5)
|
||||
last_used = world.time
|
||||
if(prob(times_used)) //if you use it 5 times in a minute it has a 10% chance to break!
|
||||
broken = 1
|
||||
user << "<span class='warning'>The bulb has burnt out!</span>"
|
||||
icon_state = "flashburnt"
|
||||
return
|
||||
times_used++
|
||||
else //can only use it 5 times a minute
|
||||
user << "<span class='warning'>*click* *click*</span>"
|
||||
return
|
||||
playsound(src.loc, 'sound/weapons/flash.ogg', 100, 1)
|
||||
var/flashfail = 0
|
||||
|
||||
if(iscarbon(M))
|
||||
var/safety = M:eyecheck()
|
||||
if(safety <= 0)
|
||||
M.Weaken(10)
|
||||
flick("e_flash", M.flash)
|
||||
|
||||
if(ishuman(M) && ishuman(user) && M.stat!=DEAD)
|
||||
if(user.mind && user.mind in ticker.mode.head_revolutionaries)
|
||||
var/revsafe = 0
|
||||
for(var/obj/item/weapon/implant/loyalty/L in M)
|
||||
if(L && L.implanted)
|
||||
revsafe = 1
|
||||
break
|
||||
M.mind_initialize() //give them a mind datum if they don't have one.
|
||||
if(M.mind.has_been_rev)
|
||||
revsafe = 2
|
||||
if(!revsafe)
|
||||
M.mind.has_been_rev = 1
|
||||
ticker.mode.add_revolutionary(M.mind)
|
||||
else if(revsafe == 1)
|
||||
user << "<span class='warning'>Something seems to be blocking the flash!</span>"
|
||||
else
|
||||
user << "<span class='warning'>This mind seems resistant to the flash!</span>"
|
||||
user << "<span class='warning'>This mind is so vacant that it is not susceptible to influence!</span>"
|
||||
else
|
||||
flashfail = 1
|
||||
|
||||
else if(issilicon(M))
|
||||
M.Weaken(rand(5,10))
|
||||
else
|
||||
flashfail = 1
|
||||
|
||||
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)
|
||||
del(animation)
|
||||
|
||||
if(!flashfail)
|
||||
flick("flash2", src)
|
||||
if(!issilicon(M))
|
||||
|
||||
user.visible_message("<span class='disarm'>[user] blinds [M] with the flash!</span>")
|
||||
else
|
||||
|
||||
user.visible_message("<span class='notice'>[user] overloads [M]'s sensors with the flash!</span>")
|
||||
else
|
||||
|
||||
user.visible_message("<span class='notice'>[user] fails to blind [M] with the flash!</span>")
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/item/device/flash/attack_self(mob/living/carbon/user as mob, flag = 0, emp = 0)
|
||||
if(!user || !clown_check(user)) return
|
||||
if(broken)
|
||||
user.show_message("<span class='warning'>The [src.name] is broken</span>", 2)
|
||||
return
|
||||
|
||||
flash_recharge()
|
||||
|
||||
//spamming the flash before it's fully charged (60seconds) increases the chance of it breaking
|
||||
//It will never break on the first use.
|
||||
switch(times_used)
|
||||
if(0 to 5)
|
||||
if(prob(2*times_used)) //if you use it 5 times in a minute it has a 10% chance to break!
|
||||
broken = 1
|
||||
user << "<span class='warning'>The bulb has burnt out!</span>"
|
||||
icon_state = "flashburnt"
|
||||
return
|
||||
times_used++
|
||||
else //can only use it 5 times a minute
|
||||
user.show_message("<span class='warning'>*click* *click*</span>", 2)
|
||||
return
|
||||
playsound(src.loc, 'sound/weapons/flash.ogg', 100, 1)
|
||||
flick("flash2", src)
|
||||
if(user && 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)
|
||||
del(animation)
|
||||
|
||||
for(var/mob/living/carbon/M in oviewers(3, null))
|
||||
if(prob(50))
|
||||
if (locate(/obj/item/weapon/cloaking_device, M))
|
||||
for(var/obj/item/weapon/cloaking_device/S in M)
|
||||
S.active = 0
|
||||
S.icon_state = "shield0"
|
||||
var/safety = M:eyecheck()
|
||||
if(!safety)
|
||||
if(!M.blinded)
|
||||
flick("flash", M.flash)
|
||||
|
||||
return
|
||||
|
||||
/obj/item/device/flash/emp_act(severity)
|
||||
if(broken) return
|
||||
flash_recharge()
|
||||
switch(times_used)
|
||||
if(0 to 5)
|
||||
if(prob(2*times_used))
|
||||
broken = 1
|
||||
icon_state = "flashburnt"
|
||||
return
|
||||
times_used++
|
||||
if(istype(loc, /mob/living/carbon))
|
||||
var/mob/living/carbon/M = loc
|
||||
var/safety = M.eyecheck()
|
||||
if(safety <= 0)
|
||||
M.Weaken(10)
|
||||
flick("e_flash", M.flash)
|
||||
for(var/mob/O in viewers(M, null))
|
||||
O.show_message("<span class='disarm'>[M] is blinded by the flash!</span>")
|
||||
..()
|
||||
|
||||
/obj/item/device/flash/synthetic
|
||||
name = "synthetic flash"
|
||||
desc = "When a problem arises, SCIENCE is the solution."
|
||||
icon_state = "sflash"
|
||||
origin_tech = "magnets=2;combat=1"
|
||||
var/construction_cost = list("metal"=750,"glass"=750)
|
||||
var/construction_time=100
|
||||
|
||||
/obj/item/device/flash/synthetic/attack(mob/living/M as mob, mob/user as mob)
|
||||
..()
|
||||
if(!broken)
|
||||
broken = 1
|
||||
user << "\red The bulb has burnt out!"
|
||||
icon_state = "flashburnt"
|
||||
|
||||
/obj/item/device/flash/synthetic/attack_self(mob/living/carbon/user as mob, flag = 0, emp = 0)
|
||||
..()
|
||||
if(!broken)
|
||||
broken = 1
|
||||
user << "\red The bulb has burnt out!"
|
||||
icon_state = "flashburnt"
|
||||
@@ -0,0 +1,167 @@
|
||||
/obj/item/device/flashlight
|
||||
name = "flashlight"
|
||||
desc = "A hand-held emergency light."
|
||||
icon_state = "flight0"
|
||||
w_class = 2
|
||||
item_state = "flight"
|
||||
flags = FPRINT | TABLEPASS | CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
m_amt = 50
|
||||
g_amt = 20
|
||||
icon_action_button = "action_flashlight"
|
||||
var/on = 0
|
||||
var/brightness_on = 4 //luminosity when on
|
||||
var/icon_on = "flight1"
|
||||
var/icon_off = "flight0"
|
||||
|
||||
/obj/item/device/flashlight/initialize()
|
||||
..()
|
||||
if (on)
|
||||
icon_state = icon_on
|
||||
src.SetLuminosity(brightness_on)
|
||||
else
|
||||
icon_state = icon_off
|
||||
src.SetLuminosity(0)
|
||||
|
||||
/obj/item/device/flashlight/proc/update_brightness(var/mob/user = null)
|
||||
if(on)
|
||||
icon_state = icon_on
|
||||
if(src.loc == user)
|
||||
user.SetLuminosity(user.luminosity + brightness_on)
|
||||
else if(isturf(loc))
|
||||
SetLuminosity(brightness_on)
|
||||
else
|
||||
icon_state = icon_off
|
||||
if(src.loc == user)
|
||||
user.SetLuminosity(user.luminosity - brightness_on)
|
||||
else if(isturf(loc))
|
||||
SetLuminosity(0)
|
||||
|
||||
/obj/item/device/flashlight/attack_self(mob/user)
|
||||
if(!isturf(user.loc))
|
||||
user << "You cannot turn the light on while in this [user.loc]" //To prevent some lighting anomalities.
|
||||
return
|
||||
on = !on
|
||||
update_brightness(user)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/flashlight/attack(mob/living/M as mob, mob/living/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
if(src.on && user.zone_sel.selecting == "eyes")
|
||||
|
||||
if (((CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50))//too dumb to use flashlight properly
|
||||
return ..()//just hit them in the head
|
||||
|
||||
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")//don't have dexterity
|
||||
usr.show_message("\red You don't have the dexterity to do this!",1)
|
||||
return
|
||||
|
||||
var/mob/living/carbon/human/H = M//mob has protective eyewear
|
||||
if(istype(M, /mob/living/carbon/human) && ((H.head && H.head.flags & HEADCOVERSEYES) || (H.wear_mask && H.wear_mask.flags & MASKCOVERSEYES) || (H.glasses && H.glasses.flags & GLASSESCOVERSEYES)))
|
||||
user << text("\blue You're going to need to remove that [] first.", ((H.head && H.head.flags & HEADCOVERSEYES) ? "helmet" : ((H.wear_mask && H.wear_mask.flags & MASKCOVERSEYES) ? "mask": "glasses")))
|
||||
return
|
||||
|
||||
for(var/mob/O in viewers(M, null))//echo message
|
||||
if ((O.client && !(O.blinded )))
|
||||
O.show_message("\blue [(O==user?"You direct":"[user] directs")] [src] to [(M==user? "your":"[M]")] eyes", 1)
|
||||
|
||||
if(istype(M, /mob/living/carbon/human) || istype(M, /mob/living/carbon/monkey))//robots and aliens are unaffected
|
||||
if(M.stat == DEAD || M.sdisabilities & BLIND)//mob is dead or fully blind
|
||||
if(M!=user)
|
||||
user.show_message("\red [M] pupils does not react to the light!",1)
|
||||
else if(XRAY in M.mutations)//mob has X-RAY vision
|
||||
if(M!=user)
|
||||
user.show_message("\red [M] pupils give an eerie glow!",1)
|
||||
else //nothing wrong
|
||||
if(!M.blinded)
|
||||
flick("flash", M.flash)//flash the affected mob
|
||||
if(M!=user)
|
||||
user.show_message("\blue [M] pupils narrow",1)
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/device/flashlight/pickup(mob/user)
|
||||
if(on)
|
||||
user.SetLuminosity(user.luminosity + brightness_on)
|
||||
SetLuminosity(0)
|
||||
|
||||
|
||||
/obj/item/device/flashlight/dropped(mob/user)
|
||||
if(on)
|
||||
user.SetLuminosity(user.luminosity - brightness_on)
|
||||
SetLuminosity(brightness_on)
|
||||
|
||||
|
||||
/obj/item/device/flashlight/pen
|
||||
name = "penlight"
|
||||
desc = "A pen-sized light. It shines as well as a flashlight."
|
||||
icon_state = "plight0"
|
||||
flags = FPRINT | TABLEPASS | CONDUCT
|
||||
item_state = ""
|
||||
icon_on = "plight1"
|
||||
icon_off = "plight0"
|
||||
brightness_on = 3
|
||||
|
||||
|
||||
|
||||
/obj/item/device/flashlight/pen/paralysis/attack(mob/M as mob, mob/user as mob)
|
||||
if(!ismob(M))
|
||||
return
|
||||
user << "\red You stab [M] with the pen."
|
||||
M << "\red You feel a tiny prick!"
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been stabbed with [src.name] by [user.name] ([user.ckey])</font>")
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to stab [M.name] ([M.ckey])</font>")
|
||||
|
||||
log_attack("<font color='red'>[user.name] ([user.ckey]) Used the [src.name] to stab [M.name] ([M.ckey])</font>")
|
||||
|
||||
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/device/flashlight/pen/paralysis/New()
|
||||
var/datum/reagents/R = new/datum/reagents(15)
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
R.add_reagent("zombiepowder", 15)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/device/flashlight/pen/paralysis/attack(mob/M as mob, mob/user as mob)
|
||||
if (!( istype(M, /mob) ))
|
||||
return
|
||||
..()
|
||||
if (reagents.total_volume)
|
||||
if(M.reagents) reagents.trans_to(M, 15)
|
||||
return
|
||||
|
||||
// the desk lamps are a bit special
|
||||
/obj/item/device/flashlight/lamp
|
||||
name = "desk lamp"
|
||||
desc = "A desk lamp"
|
||||
icon = 'icons/obj/lighting.dmi'
|
||||
icon_state = "lamp0"
|
||||
brightness_on = 5
|
||||
icon_on = "lamp1"
|
||||
icon_off = "lamp0"
|
||||
w_class = 4
|
||||
flags = FPRINT | TABLEPASS | CONDUCT
|
||||
m_amt = 0
|
||||
g_amt = 0
|
||||
on = 1
|
||||
|
||||
// green-shaded desk lamp
|
||||
/obj/item/device/flashlight/lamp/green
|
||||
icon_state = "green0"
|
||||
icon_on = "green1"
|
||||
icon_off = "green0"
|
||||
desc = "A green-shaded desk lamp"
|
||||
|
||||
/obj/item/device/flashlight/lamp/verb/toggle_light()
|
||||
set name = "Toggle light"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(!usr.stat)
|
||||
attack_self(usr)
|
||||
@@ -0,0 +1,210 @@
|
||||
|
||||
// Light Replacer (LR)
|
||||
//
|
||||
// ABOUT THE DEVICE
|
||||
//
|
||||
// This is a device supposedly to be used by Janitors and Janitor Cyborgs which will
|
||||
// allow them to easily replace lights. This was mostly designed for Janitor Cyborgs since
|
||||
// they don't have hands or a way to replace lightbulbs.
|
||||
//
|
||||
// HOW IT WORKS
|
||||
//
|
||||
// You attack a light fixture with it, if the light fixture is broken it will replace the
|
||||
// light fixture with a working light; the broken light is then placed on the floor for the
|
||||
// user to then pickup with a trash bag. If it's empty then it will just place a light in the fixture.
|
||||
//
|
||||
// HOW TO REFILL THE DEVICE
|
||||
//
|
||||
// It will need to be manually refilled with lights.
|
||||
// If it's part of a robot module, it will charge when the Robot is inside a Recharge Station.
|
||||
//
|
||||
// EMAGGED FEATURES
|
||||
//
|
||||
// NOTICE: The Cyborg cannot use the emagged Light Replacer and the light's explosion was nerfed. It cannot create holes in the station anymore.
|
||||
//
|
||||
// I'm not sure everyone will react the emag's features so please say what your opinions are of it.
|
||||
//
|
||||
// When emagged it will rig every light it replaces, which will explode when the light is on.
|
||||
// This is VERY noticable, even the device's name changes when you emag it so if anyone
|
||||
// examines you when you're holding it in your hand, you will be discovered.
|
||||
// It will also be very obvious who is setting all these lights off, since only Janitor Borgs and Janitors have easy
|
||||
// access to them, and only one of them can emag their device.
|
||||
//
|
||||
// The explosion cannot insta-kill anyone with 30% or more health.
|
||||
|
||||
#define LIGHT_OK 0
|
||||
#define LIGHT_EMPTY 1
|
||||
#define LIGHT_BROKEN 2
|
||||
#define LIGHT_BURNED 3
|
||||
|
||||
|
||||
/obj/item/device/lightreplacer
|
||||
|
||||
name = "light replacer"
|
||||
desc = "A device to automatically replace lights. Refill with working lightbulbs."
|
||||
|
||||
icon = 'icons/obj/janitor.dmi'
|
||||
icon_state = "lightreplacer0"
|
||||
item_state = "electronic"
|
||||
|
||||
flags = FPRINT | CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
origin_tech = "magnets=3;materials=2"
|
||||
|
||||
var/max_uses = 20
|
||||
var/uses = 0
|
||||
var/inuse = 0
|
||||
var/emagged = 0
|
||||
var/failmsg = ""
|
||||
// How much to increase per each glass?
|
||||
var/increment = 5
|
||||
// How much to take from the glass?
|
||||
var/decrement = 1
|
||||
var/charge = 1
|
||||
|
||||
/obj/item/device/lightreplacer/New()
|
||||
uses = max_uses / 2
|
||||
failmsg = "The [name]'s refill light blinks red."
|
||||
..()
|
||||
|
||||
/obj/item/device/lightreplacer/examine()
|
||||
set src in view(2)
|
||||
..()
|
||||
usr << "It has [uses] lights remaining."
|
||||
|
||||
/obj/item/device/lightreplacer/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/weapon/card/emag) && emagged == 0)
|
||||
Emag()
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/stack/sheet/glass))
|
||||
var/obj/item/stack/sheet/glass/G = W
|
||||
if(G.amount - decrement >= 0 && uses < max_uses)
|
||||
var/remaining = max(G.amount - decrement, 0)
|
||||
if(!remaining && !(G.amount - decrement) == 0)
|
||||
user << "There isn't enough glass."
|
||||
return
|
||||
G.amount = remaining
|
||||
if(!G.amount)
|
||||
user.drop_item()
|
||||
del(G)
|
||||
AddUses(increment)
|
||||
user << "You insert a piece of glass into the [src.name]. You have [uses] lights remaining."
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/light))
|
||||
var/obj/item/weapon/light/L = W
|
||||
if(L.status == 0) // LIGHT OKAY
|
||||
if(uses < max_uses)
|
||||
AddUses(1)
|
||||
user << "You insert the [L.name] into the [src.name]. You have [uses] lights remaining."
|
||||
user.drop_item()
|
||||
del(L)
|
||||
return
|
||||
else
|
||||
user << "You need a working light."
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/lightreplacer/attack_self(mob/user)
|
||||
/* // This would probably be a bit OP. If you want it though, uncomment the code.
|
||||
if(isrobot(user))
|
||||
var/mob/living/silicon/robot/R = user
|
||||
if(R.emagged)
|
||||
src.Emag()
|
||||
usr << "You shortcircuit the [src]."
|
||||
return
|
||||
*/
|
||||
usr << "It has [uses] lights remaining."
|
||||
|
||||
/obj/item/device/lightreplacer/update_icon()
|
||||
icon_state = "lightreplacer[emagged]"
|
||||
|
||||
|
||||
/obj/item/device/lightreplacer/proc/Use(var/mob/user)
|
||||
|
||||
if(inuse) return
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
|
||||
var/pass = 0
|
||||
inuse = 1
|
||||
if(do_after(user, 30))
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
AddUses(-1)
|
||||
pass = 1
|
||||
inuse = 0
|
||||
return pass
|
||||
|
||||
// Negative numbers will subtract
|
||||
/obj/item/device/lightreplacer/proc/AddUses(var/amount = 1)
|
||||
uses = min(max(uses + amount, 0), max_uses)
|
||||
|
||||
/obj/item/device/lightreplacer/proc/Charge(var/mob/user)
|
||||
charge += 1
|
||||
if(charge > 7)
|
||||
AddUses(1)
|
||||
charge = 1
|
||||
|
||||
/obj/item/device/lightreplacer/proc/ReplaceLight(var/obj/machinery/light/target, var/mob/living/U)
|
||||
|
||||
if(target.status != LIGHT_OK)
|
||||
if(CanUse(U))
|
||||
if(!Use(U)) return
|
||||
U << "<span class='notice'>You replace the [target.fitting] with the [src].</span>"
|
||||
|
||||
if(target.status != LIGHT_EMPTY)
|
||||
|
||||
var/obj/item/weapon/light/L1 = new target.light_type(target.loc)
|
||||
L1.status = target.status
|
||||
L1.rigged = target.rigged
|
||||
L1.brightness = target.brightness
|
||||
L1.switchcount = target.switchcount
|
||||
target.switchcount = 0
|
||||
L1.update()
|
||||
|
||||
target.status = LIGHT_EMPTY
|
||||
target.update()
|
||||
|
||||
var/obj/item/weapon/light/L2 = new target.light_type()
|
||||
|
||||
target.status = L2.status
|
||||
target.switchcount = L2.switchcount
|
||||
target.rigged = emagged
|
||||
target.brightness = L2.brightness
|
||||
target.on = target.has_power()
|
||||
target.update()
|
||||
del(L2)
|
||||
|
||||
if(target.on && target.rigged)
|
||||
target.explode()
|
||||
return
|
||||
|
||||
else
|
||||
U << failmsg
|
||||
return
|
||||
else
|
||||
U << "There is a working [target.fitting] already inserted."
|
||||
return
|
||||
|
||||
/obj/item/device/lightreplacer/proc/Emag()
|
||||
emagged = !emagged
|
||||
playsound(src.loc, "sparks", 100, 1)
|
||||
if(emagged)
|
||||
name = "Shortcircuited [initial(name)]"
|
||||
else
|
||||
name = initial(name)
|
||||
update_icon()
|
||||
|
||||
//Can you use it?
|
||||
|
||||
/obj/item/device/lightreplacer/proc/CanUse(var/mob/living/user)
|
||||
src.add_fingerprint(user)
|
||||
//Not sure what else to check for. Maybe if clumsy?
|
||||
if(uses > 0)
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
#undef LIGHT_OK
|
||||
#undef LIGHT_EMPTY
|
||||
#undef LIGHT_BROKEN
|
||||
#undef LIGHT_BURNED
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Multitool -- A multitool is used for hacking electronic devices.
|
||||
* TO-DO -- Using it as a power measurement tool for cables etc. Nannek.
|
||||
*
|
||||
*/
|
||||
/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
|
||||
origin_tech = "magnets=1"
|
||||
@@ -0,0 +1,136 @@
|
||||
/obj/item/device/paicard
|
||||
name = "personal AI device"
|
||||
icon = 'icons/obj/pda.dmi'
|
||||
icon_state = "pai"
|
||||
item_state = "electronic"
|
||||
w_class = 2.0
|
||||
flags = FPRINT | TABLEPASS
|
||||
slot_flags = SLOT_BELT
|
||||
origin_tech = "programming=2"
|
||||
var/obj/item/device/radio/radio
|
||||
var/looking_for_personality = 0
|
||||
var/mob/living/silicon/pai/pai
|
||||
|
||||
/obj/item/device/paicard/New()
|
||||
..()
|
||||
overlays += "pai-off"
|
||||
|
||||
/obj/item/device/paicard/Del()
|
||||
//Will stop people throwing friend pAIs into the singularity so they can respawn
|
||||
if(!isnull(pai))
|
||||
pai.death(0)
|
||||
..()
|
||||
|
||||
/obj/item/device/paicard/attack_self(mob/user)
|
||||
if (!in_range(src, user))
|
||||
return
|
||||
user.machine = src
|
||||
var/dat = "<TT><B>Personal AI Device</B><BR>"
|
||||
if(pai && (!pai.master_dna || !pai.master))
|
||||
dat += "<a href='byond://?src=\ref[src];setdna=1'>Imprint Master DNA</a><br>"
|
||||
if(pai)
|
||||
dat += "Installed Personality: [pai.name]<br>"
|
||||
dat += "Prime directive: <br>[pai.pai_law0]<br>"
|
||||
dat += "Additional directives: <br>[pai.pai_laws]<br>"
|
||||
dat += "<a href='byond://?src=\ref[src];setlaws=1'>Configure Directives</a><br>"
|
||||
dat += "<br>"
|
||||
dat += "<h3>Device Settings</h3><br>"
|
||||
if(radio)
|
||||
dat += "<b>Radio Uplink</b><br>"
|
||||
dat += "Transmit: <A href='byond://?src=\ref[src];wires=4'>[(radio.wires & 4) ? "Enabled" : "Disabled"]</A><br>"
|
||||
dat += "Receive: <A href='byond://?src=\ref[src];wires=2'>[(radio.wires & 2) ? "Enabled" : "Disabled"]</A><br>"
|
||||
dat += "Signal Pulser: <A href='byond://?src=\ref[src];wires=1'>[(radio.wires & 1) ? "Enabled" : "Disabled"]</A><br>"
|
||||
else
|
||||
dat += "<b>Radio Uplink</b><br>"
|
||||
dat += "<font color=red><i>Radio firmware not loaded. Please install a pAI personality to load firmware.</i></font><br>"
|
||||
dat += "<A href='byond://?src=\ref[src];wipe=1'>\[Wipe current pAI personality\]</a><br>"
|
||||
else
|
||||
if(looking_for_personality)
|
||||
dat += "Searching for a personality..."
|
||||
dat += "<A href='byond://?src=\ref[src];request=1'>\[View available personalities\]</a><br>"
|
||||
else
|
||||
dat += "No personality is installed.<br>"
|
||||
dat += "<A href='byond://?src=\ref[src];request=1'>\[Request personal AI personality\]</a><br>"
|
||||
dat += "Each time this button is pressed, a request will be sent out to any available personalities. Check back often and alot time for personalities to respond. This process could take anywhere from 15 seconds to several minutes, depending on the available personalities' timeliness."
|
||||
user << browse(dat, "window=paicard")
|
||||
onclose(user, "paicard")
|
||||
return
|
||||
|
||||
/obj/item/device/paicard/Topic(href, href_list)
|
||||
|
||||
if(href_list["setdna"])
|
||||
if(pai.master_dna)
|
||||
return
|
||||
var/mob/M = usr
|
||||
if(!istype(M, /mob/living/carbon))
|
||||
usr << "<font color=blue>You don't have any DNA, or your DNA is incompatible with this device.</font>"
|
||||
else
|
||||
var/datum/dna/dna = usr.dna
|
||||
pai.master = M.real_name
|
||||
pai.master_dna = dna.unique_enzymes
|
||||
pai << "<font color = red><h3>You have been bound to a new master.</h3></font>"
|
||||
if(href_list["request"])
|
||||
src.looking_for_personality = 1
|
||||
paiController.findPAI(src, usr)
|
||||
if(href_list["wipe"])
|
||||
var/confirm = input("Are you CERTAIN you wish to delete the current personality? This action cannot be undone.", "Personality Wipe") in list("Yes", "No")
|
||||
if(confirm == "Yes")
|
||||
for(var/mob/M in src)
|
||||
M << "<font color = #ff0000><h2>You feel yourself slipping away from reality.</h2></font>"
|
||||
M << "<font color = #ff4d4d><h3>Byte by byte you lose your sense of self.</h3></font>"
|
||||
M << "<font color = #ff8787><h4>Your mental faculties leave you.</h4></font>"
|
||||
M << "<font color = #ffc4c4><h5>oblivion... </h5></font>"
|
||||
M.death(0)
|
||||
removePersonality()
|
||||
if(href_list["wires"])
|
||||
var/t1 = text2num(href_list["wires"])
|
||||
if (radio.wires & t1)
|
||||
radio.wires &= ~t1
|
||||
else
|
||||
radio.wires |= t1
|
||||
if(href_list["setlaws"])
|
||||
var/newlaws = copytext(sanitize(input("Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws) as message),1,MAX_MESSAGE_LEN)
|
||||
if(newlaws)
|
||||
pai.pai_laws = newlaws
|
||||
pai << "Your supplemental directives have been updated. Your new directives are:"
|
||||
pai << "Prime Directive : <br>[pai.pai_law0]"
|
||||
pai << "Supplemental Directives: <br>[pai.pai_laws]"
|
||||
attack_self(usr)
|
||||
|
||||
// WIRE_SIGNAL = 1
|
||||
// WIRE_RECEIVE = 2
|
||||
// WIRE_TRANSMIT = 4
|
||||
|
||||
/obj/item/device/paicard/proc/setPersonality(mob/living/silicon/pai/personality)
|
||||
src.pai = personality
|
||||
src.overlays += "pai-happy"
|
||||
|
||||
/obj/item/device/paicard/proc/removePersonality()
|
||||
src.pai = null
|
||||
src.overlays = null
|
||||
src.overlays += "pai-off"
|
||||
|
||||
/obj/item/device/paicard/proc/setEmotion(var/emotion)
|
||||
if(pai)
|
||||
src.overlays = null
|
||||
switch(emotion)
|
||||
if(1) src.overlays += "pai-happy"
|
||||
if(2) src.overlays += "pai-cat"
|
||||
if(3) src.overlays += "pai-extremely-happy"
|
||||
if(4) src.overlays += "pai-face"
|
||||
if(5) src.overlays += "pai-laugh"
|
||||
if(6) src.overlays += "pai-off"
|
||||
if(7) src.overlays += "pai-sad"
|
||||
if(8) src.overlays += "pai-angry"
|
||||
if(9) src.overlays += "pai-what"
|
||||
|
||||
/obj/item/device/paicard/proc/alertUpdate()
|
||||
var/turf/T = get_turf_or_move(src.loc)
|
||||
for (var/mob/M in viewers(T))
|
||||
M.show_message("\blue [src] flashes a message across its screen, \"Additional personalities available for download.\"", 3, "\blue [src] bleeps electronically.", 2)
|
||||
|
||||
/obj/item/device/paicard/emp_act(severity)
|
||||
for(var/mob/M in src)
|
||||
M.emp_act(severity)
|
||||
..()
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
// 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
|
||||
origin_tech = "powerstorage=3;syndicate=5"
|
||||
var/drain_rate = 600000 // amount of power to drain per tick
|
||||
var/power_drained = 0 // has drained this much power
|
||||
var/max_power = 1e8 // maximum power that can be drained before exploding
|
||||
var/mode = 0 // 0 = off, 1=clamped (off), 2=operating
|
||||
|
||||
|
||||
var/obj/structure/cable/attached // the attached cable
|
||||
|
||||
attackby(var/obj/item/I, var/mob/user)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
if(mode == 0)
|
||||
var/turf/T = loc
|
||||
if(isturf(T) && !T.intact)
|
||||
attached = locate() in T
|
||||
if(!attached)
|
||||
user << "No exposed cable here to attach to."
|
||||
return
|
||||
else
|
||||
anchored = 1
|
||||
mode = 1
|
||||
user << "You attach the device to the cable."
|
||||
for(var/mob/M in viewers(user))
|
||||
if(M == user) continue
|
||||
M << "[user] attaches the power sink to the cable."
|
||||
return
|
||||
else
|
||||
user << "Device must be placed over an exposed cable to attach to it."
|
||||
return
|
||||
else
|
||||
if (mode == 2)
|
||||
processing_objects.Remove(src) // Now the power sink actually stops draining the station's power if you unhook it. --NeoFite
|
||||
anchored = 0
|
||||
mode = 0
|
||||
user << "You detach the device from the cable."
|
||||
for(var/mob/M in viewers(user))
|
||||
if(M == user) continue
|
||||
M << "[user] detaches the power sink from the cable."
|
||||
SetLuminosity(0)
|
||||
icon_state = "powersink0"
|
||||
|
||||
return
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
|
||||
attack_paw()
|
||||
return
|
||||
|
||||
attack_ai()
|
||||
return
|
||||
|
||||
attack_hand(var/mob/user)
|
||||
switch(mode)
|
||||
if(0)
|
||||
..()
|
||||
|
||||
if(1)
|
||||
user << "You activate the device!"
|
||||
for(var/mob/M in viewers(user))
|
||||
if(M == user) continue
|
||||
M << "[user] activates the power sink!"
|
||||
mode = 2
|
||||
icon_state = "powersink1"
|
||||
processing_objects.Add(src)
|
||||
|
||||
if(2) //This switch option wasn't originally included. It exists now. --NeoFite
|
||||
user << "You deactivate the device!"
|
||||
for(var/mob/M in viewers(user))
|
||||
if(M == user) continue
|
||||
M << "[user] deactivates the power sink!"
|
||||
mode = 1
|
||||
SetLuminosity(0)
|
||||
icon_state = "powersink0"
|
||||
processing_objects.Remove(src)
|
||||
|
||||
process()
|
||||
if(attached)
|
||||
var/datum/powernet/PN = attached.get_powernet()
|
||||
if(PN)
|
||||
SetLuminosity(12)
|
||||
|
||||
// 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_objects.Remove(src)
|
||||
explosion(src.loc, 3,6,9,12)
|
||||
del(src)
|
||||
@@ -0,0 +1,49 @@
|
||||
/obj/item/device/radio/beacon
|
||||
name = "Tracking Beacon"
|
||||
desc = "A beacon used by a teleporter."
|
||||
icon_state = "beacon"
|
||||
item_state = "signaler"
|
||||
var/code = "electronic"
|
||||
origin_tech = "bluespace=1"
|
||||
|
||||
/obj/item/device/radio/beacon/hear_talk()
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/radio/beacon/send_hear()
|
||||
return null
|
||||
|
||||
|
||||
/obj/item/device/radio/beacon/verb/alter_signal(t as text)
|
||||
set name = "Alter Beacon's Signal"
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
if ((usr.canmove && !( usr.restrained() )))
|
||||
src.code = t
|
||||
if (!( src.code ))
|
||||
src.code = "beacon"
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/radio/beacon/bacon //Probably a better way of doing this, I'm lazy.
|
||||
proc/digest_delay()
|
||||
spawn(600)
|
||||
del(src)
|
||||
|
||||
|
||||
// SINGULO BEACON SPAWNER
|
||||
|
||||
/obj/item/device/radio/beacon/syndicate
|
||||
name = "suspicious beacon"
|
||||
desc = "A label on it reads: <i>Activate to have a singularity beacon teleported to your location</i>."
|
||||
origin_tech = "bluespace=1;syndicate=7"
|
||||
|
||||
/obj/item/device/radio/beacon/syndicate/attack_self(mob/user as mob)
|
||||
if(user)
|
||||
user << "\blue Locked In"
|
||||
new /obj/machinery/singularity_beacon/syndicate( user.loc )
|
||||
playsound(src, 'sound/effects/pop.ogg', 100, 1, 1)
|
||||
del(src)
|
||||
return
|
||||
@@ -0,0 +1,164 @@
|
||||
/obj/item/device/radio/electropack
|
||||
name = "Electropack"
|
||||
desc = "Dance my monkeys! DANCE!!!"
|
||||
icon_state = "electropack0"
|
||||
var/code = 2
|
||||
var/e_pads = 0.0
|
||||
g_amt = 2500
|
||||
m_amt = 10000
|
||||
frequency = 1449
|
||||
w_class = 5.0
|
||||
flags = FPRINT | CONDUCT | TABLEPASS
|
||||
slot_flags = SLOT_BACK
|
||||
item_state = "electropack"
|
||||
|
||||
/obj/item/device/radio/electropack/examine()
|
||||
set src in view()
|
||||
|
||||
..()
|
||||
if ((in_range(src, usr) || src.loc == usr))
|
||||
if (src.e_pads)
|
||||
usr << "\blue The electric pads are exposed!"
|
||||
return
|
||||
|
||||
/obj/item/device/radio/electropack/attack_paw(mob/user as mob)
|
||||
|
||||
return src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/item/device/radio/electropack/attack_hand(mob/user as mob)
|
||||
|
||||
if (src == user.back)
|
||||
user << "\blue You need help taking this off!"
|
||||
return
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/device/radio/electropack/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
|
||||
if (istype(W, /obj/item/weapon/screwdriver))
|
||||
src.e_pads = !( src.e_pads )
|
||||
if (src.e_pads)
|
||||
user.show_message("\blue The electric pads have been exposed!")
|
||||
else
|
||||
user.show_message("\blue The electric pads have been reinserted!")
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
else
|
||||
if (istype(W, /obj/item/clothing/head/helmet))
|
||||
var/obj/item/assembly/shock_kit/A = new /obj/item/assembly/shock_kit( user )
|
||||
A.icon = 'icons/obj/assemblies.dmi'
|
||||
|
||||
user.drop_from_inventory(W)
|
||||
W.loc = A
|
||||
W.master = A
|
||||
A.part1 = W
|
||||
|
||||
user.drop_from_inventory(src)
|
||||
src.loc = A
|
||||
src.master = A
|
||||
A.part2 = src
|
||||
|
||||
user.put_in_hands(A)
|
||||
A.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/device/radio/electropack/Topic(href, href_list)
|
||||
//..()
|
||||
if (usr.stat || usr.restrained())
|
||||
return
|
||||
if (((istype(usr, /mob/living/carbon/human) && ((!( ticker ) || (ticker && ticker.mode != "monkey")) && usr.contents.Find(src))) || (usr.contents.Find(src.master) || (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)
|
||||
//Foreach goto(308)
|
||||
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(384)
|
||||
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.encryption != code))
|
||||
return
|
||||
|
||||
if ((ismob(src.loc) && src.on))
|
||||
|
||||
var/mob/M = src.loc
|
||||
var/turf/T = M.loc
|
||||
if ((istype(T, /turf)))
|
||||
if (!M.moved_recently && M.last_move)
|
||||
M.moved_recently = 1
|
||||
step(M, M.last_move)
|
||||
sleep 50
|
||||
if(M)
|
||||
M.moved_recently = 0
|
||||
M.show_message("\red <B>You feel a sharp shock!</B>")
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(3, 1, M)
|
||||
s.start()
|
||||
|
||||
M.Weaken(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
|
||||
@@ -0,0 +1,128 @@
|
||||
|
||||
/obj/item/device/encryptionkey/
|
||||
name = "Standard Encrpytion Key"
|
||||
desc = "An encyption key for a radio headset. Has no special codes in it. WHY DOES IT EXIST? ASK NANOTRASEN."
|
||||
icon = 'icons/obj/radio.dmi'
|
||||
icon_state = "cypherkey"
|
||||
item_state = ""
|
||||
var/translate_binary = 0
|
||||
var/translate_hive = 0
|
||||
var/syndie = 0
|
||||
var/list/channels = list()
|
||||
|
||||
|
||||
/obj/item/device/encryptionkey/New()
|
||||
|
||||
/obj/item/device/encryptionkey/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
/obj/item/device/encryptionkey/syndicate
|
||||
icon_state = "cypherkey"
|
||||
channels = list("Syndicate" = 1)
|
||||
origin_tech = "syndicate=3"
|
||||
syndie = 1//Signifies that it de-crypts Syndicate transmissions
|
||||
|
||||
/obj/item/device/encryptionkey/binary
|
||||
icon_state = "cypherkey"
|
||||
translate_binary = 1
|
||||
origin_tech = "syndicate=3"
|
||||
|
||||
/obj/item/device/encryptionkey/headset_sec
|
||||
name = "Security Radio Encryption Key"
|
||||
desc = "An encyption key for a radio headset. Contains cypherkeys."
|
||||
icon_state = "sec_cypherkey"
|
||||
channels = list("Security" = 1)
|
||||
|
||||
/obj/item/device/encryptionkey/headset_eng
|
||||
name = "Engineering Radio Encryption Key"
|
||||
desc = "An encyption key for a radio headset. Contains cypherkeys."
|
||||
icon_state = "eng_cypherkey"
|
||||
channels = list("Engineering" = 1)
|
||||
|
||||
/obj/item/device/encryptionkey/headset_rob
|
||||
name = "Robotics Radio Encryption Key"
|
||||
desc = "An encyption key for a radio headset. Contains cypherkeys."
|
||||
icon_state = "rob_cypherkey"
|
||||
channels = list("Engineering" = 1, "Science" = 1)
|
||||
|
||||
/obj/item/device/encryptionkey/headset_med
|
||||
name = "Medical Radio Encryption Key"
|
||||
desc = "An encyption key for a radio headset. Contains cypherkeys."
|
||||
icon_state = "med_cypherkey"
|
||||
channels = list("Medical" = 1)
|
||||
|
||||
/obj/item/device/encryptionkey/headset_sci
|
||||
name = "Science Radio Encryption Key"
|
||||
desc = "An encyption key for a radio headset. Contains cypherkeys."
|
||||
icon_state = "sci_cypherkey"
|
||||
channels = list("Science" = 1)
|
||||
|
||||
/obj/item/device/encryptionkey/headset_medsci
|
||||
name = "Medical Research Radio Encryption Key"
|
||||
desc = "An encyption key for a radio headset. Contains cypherkeys."
|
||||
icon_state = "medsci_cypherkey"
|
||||
channels = list("Medical" = 1, "Science" = 1)
|
||||
|
||||
/obj/item/device/encryptionkey/headset_com
|
||||
name = "Command Radio Encryption Key"
|
||||
desc = "An encyption key for a radio headset. Contains cypherkeys."
|
||||
icon_state = "com_cypherkey"
|
||||
channels = list("Command" = 1)
|
||||
|
||||
/obj/item/device/encryptionkey/heads/captain
|
||||
name = "Captain's Encryption Key"
|
||||
desc = "An encyption key for a radio headset. Contains cypherkeys."
|
||||
icon_state = "cap_cypherkey"
|
||||
channels = list("Command" = 1, "Science" = 0, "Medical" = 0, "Security" = 1, "Engineering" = 0, "Mining" = 0, "Cargo" = 0)
|
||||
|
||||
/obj/item/device/encryptionkey/heads/rd
|
||||
name = "Research Director's Encryption Key"
|
||||
desc = "An encyption key for a radio headset. Contains cypherkeys."
|
||||
icon_state = "rd_cypherkey"
|
||||
channels = list("Science" = 1, "Command" = 1)
|
||||
|
||||
/obj/item/device/encryptionkey/heads/hos
|
||||
name = "Head of Security's Encryption Key"
|
||||
desc = "An encyption key for a radio headset. Contains cypherkeys."
|
||||
icon_state = "hos_cypherkey"
|
||||
channels = list("Security" = 1, "Command" = 1)
|
||||
|
||||
/obj/item/device/encryptionkey/heads/ce
|
||||
name = "Chief Engineer's Encryption Key"
|
||||
desc = "An encyption key for a radio headset. Contains cypherkeys."
|
||||
icon_state = "ce_cypherkey"
|
||||
channels = list("Engineering" = 1, "Command" = 1)
|
||||
|
||||
/obj/item/device/encryptionkey/heads/cmo
|
||||
name = "Chief Medical Officer's Encryption Key"
|
||||
desc = "An encyption key for a radio headset. Contains cypherkeys."
|
||||
icon_state = "cmo_cypherkey"
|
||||
channels = list("Medical" = 1, "Command" = 1)
|
||||
|
||||
/obj/item/device/encryptionkey/heads/hop
|
||||
name = "Head of Personnel's Encryption Key"
|
||||
desc = "An encyption key for a radio headset. Contains cypherkeys."
|
||||
icon_state = "hop_cypherkey"
|
||||
channels = list("Command" = 1, "Security" = 0, "Cargo" = 1, "Mining" = 0)
|
||||
|
||||
/obj/item/device/encryptionkey/headset_mine
|
||||
name = "Mining Radio Encryption Key"
|
||||
desc = "An encyption key for a radio headset. Contains cypherkeys."
|
||||
icon_state = "mine_cypherkey"
|
||||
channels = list("Mining" = 1)
|
||||
|
||||
/obj/item/device/encryptionkey/heads/qm
|
||||
name = "Quartermaster's Encryption Key"
|
||||
desc = "An encyption key for a radio headset. Contains cypherkeys."
|
||||
icon_state = "qm_cypherkey"
|
||||
channels = list("Cargo" = 1, "Mining" = 1)
|
||||
|
||||
/obj/item/device/encryptionkey/headset_cargo
|
||||
name = "Cargo Radio Encryption Key"
|
||||
desc = "An encyption key for a radio headset. Contains cypherkeys."
|
||||
icon_state = "cargo_cypherkey"
|
||||
channels = list("Cargo" = 1)
|
||||
|
||||
/obj/item/device/encryptionkey/ert
|
||||
name = "NanoTrasen ERT Radio Encryption Key"
|
||||
desc = "An encyption key for a radio headset. Contains cypherkeys."
|
||||
channels = list("Response Team" = 1, "Science" = 1, "Command" = 1, "Medical" = 1, "Engineering" = 1, "Security" = 1, "Mining" = 1, "Cargo" = 1,)
|
||||
@@ -0,0 +1,264 @@
|
||||
/obj/item/device/radio/headset
|
||||
name = "radio headset"
|
||||
desc = "An updated, modular intercom that fits over the head. Takes encryption keys"
|
||||
icon_state = "headset"
|
||||
item_state = "headset"
|
||||
g_amt = 0
|
||||
m_amt = 75
|
||||
subspace_transmission = 1
|
||||
canhear_range = 1 // can't hear headsets from very far away
|
||||
|
||||
slot_flags = SLOT_EARS
|
||||
var/translate_binary = 0
|
||||
var/translate_hive = 0
|
||||
var/obj/item/device/encryptionkey/keyslot1 = null
|
||||
var/obj/item/device/encryptionkey/keyslot2 = null
|
||||
maxf = 1489
|
||||
|
||||
/obj/item/device/radio/headset/New()
|
||||
..()
|
||||
keyslot1 = new /obj/item/device/encryptionkey/
|
||||
recalculateChannels()
|
||||
|
||||
/obj/item/device/radio/headset/syndicate
|
||||
origin_tech = "syndicate=3"
|
||||
/obj/item/device/radio/headset/syndicate/New()
|
||||
..()
|
||||
del(keyslot1)
|
||||
keyslot1 = new /obj/item/device/encryptionkey/syndicate
|
||||
syndie = 1
|
||||
recalculateChannels()
|
||||
|
||||
/obj/item/device/radio/headset/binary
|
||||
origin_tech = "syndicate=3"
|
||||
/obj/item/device/radio/headset/binary/New()
|
||||
..()
|
||||
del(keyslot1)
|
||||
keyslot1 = new /obj/item/device/encryptionkey/binary
|
||||
recalculateChannels()
|
||||
|
||||
/obj/item/device/radio/headset/headset_sec
|
||||
name = "security radio headset"
|
||||
desc = "This is used by your elite security force. To access the security channel, use :s."
|
||||
icon_state = "sec_headset"
|
||||
item_state = "headset"
|
||||
keyslot2 = new /obj/item/device/encryptionkey/headset_sec
|
||||
|
||||
/obj/item/device/radio/headset/headset_eng
|
||||
name = "engineering radio headset"
|
||||
desc = "When the engineers wish to chat like girls. To access the engineering channel, use :e. "
|
||||
icon_state = "eng_headset"
|
||||
item_state = "headset"
|
||||
keyslot2 = new /obj/item/device/encryptionkey/headset_eng
|
||||
|
||||
/obj/item/device/radio/headset/headset_rob
|
||||
name = "robotics radio headset"
|
||||
desc = "Made specifically for the roboticists who cannot decide between departments. To access the engineering channel, use :e. For research, use :n."
|
||||
icon_state = "rob_headset"
|
||||
item_state = "headset"
|
||||
keyslot2 = new /obj/item/device/encryptionkey/headset_rob
|
||||
|
||||
/obj/item/device/radio/headset/headset_med
|
||||
name = "medical radio headset"
|
||||
desc = "A headset for the trained staff of the medbay. To access the medical channel, use :m."
|
||||
icon_state = "med_headset"
|
||||
item_state = "headset"
|
||||
keyslot2 = new /obj/item/device/encryptionkey/headset_med
|
||||
|
||||
/obj/item/device/radio/headset/headset_sci
|
||||
name = "science radio headset"
|
||||
desc = "A sciency headset. Like usual. To access the science channel, use :n."
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
keyslot2 = new /obj/item/device/encryptionkey/headset_sci
|
||||
|
||||
/obj/item/device/radio/headset/headset_medsci
|
||||
name = "medical research radio headset"
|
||||
desc = "A headset that is a result of the mating between medical and science. To access the medical channel, use :m. For science, use :n."
|
||||
icon_state = "med_headset"
|
||||
item_state = "headset"
|
||||
keyslot2 = new /obj/item/device/encryptionkey/headset_medsci
|
||||
|
||||
/obj/item/device/radio/headset/headset_com
|
||||
name = "command radio headset"
|
||||
desc = "A headset with a commanding channel. To access the command channel, use :c."
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
keyslot2 = new /obj/item/device/encryptionkey/headset_com
|
||||
|
||||
/obj/item/device/radio/headset/heads/captain
|
||||
name = "captain's headset"
|
||||
desc = "The headset of the boss. Channels are as follows: :c - command, :s - security, :e - engineering, :d - mining, :q - cargo, :m - medical, :n - science."
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
keyslot2 = new /obj/item/device/encryptionkey/heads/captain
|
||||
|
||||
/obj/item/device/radio/headset/heads/rd
|
||||
name = "Research Director's headset"
|
||||
desc = "Headset of the researching God. To access the science channel, use :n. For command, use :c."
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
keyslot2 = new /obj/item/device/encryptionkey/heads/rd
|
||||
|
||||
/obj/item/device/radio/headset/heads/hos
|
||||
name = "head of security's headset"
|
||||
desc = "The headset of the man who protects your worthless lifes. To access the security channel, use :s. For command, use :c."
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
keyslot2 = new /obj/item/device/encryptionkey/heads/hos
|
||||
|
||||
/obj/item/device/radio/headset/heads/ce
|
||||
name = "chief engineer's headset"
|
||||
desc = "The headset of the guy who is in charge of morons. To access the engineering channel, use :e. For command, use :c."
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
keyslot2 = new /obj/item/device/encryptionkey/heads/ce
|
||||
|
||||
/obj/item/device/radio/headset/heads/cmo
|
||||
name = "chief medical officer's headset"
|
||||
desc = "The headset of the highly trained medical chief. To access the medical channel, use :m. For command, use :c."
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
keyslot2 = new /obj/item/device/encryptionkey/heads/cmo
|
||||
|
||||
/obj/item/device/radio/headset/heads/hop
|
||||
name = "head of personnel's headset"
|
||||
desc = "The headset of the guy who will one day be captain. Channels are as follows: :c - command, :s - security, :q - cargo, :d - mining."
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
keyslot2 = new /obj/item/device/encryptionkey/heads/hop
|
||||
|
||||
/obj/item/device/radio/headset/headset_mine
|
||||
name = "mining radio headset"
|
||||
desc = "Headset used by miners. How useless. To access the mining channel, use :d."
|
||||
icon_state = "mine_headset"
|
||||
item_state = "headset"
|
||||
keyslot2 = new /obj/item/device/encryptionkey/headset_mine
|
||||
|
||||
/obj/item/device/radio/headset/heads/qm
|
||||
name = "quartermaster's headset"
|
||||
desc = "The headset of the man who control your toiletpaper supply. To access the cargo channel, use :q. For mining, use :d."
|
||||
icon_state = "cargo_headset"
|
||||
item_state = "headset"
|
||||
keyslot2 = new /obj/item/device/encryptionkey/heads/qm
|
||||
|
||||
/obj/item/device/radio/headset/headset_cargo
|
||||
name = "cargo radio headset"
|
||||
desc = "Headset used by the QM's slaves. To access the cargo channel, use :q."
|
||||
icon_state = "cargo_headset"
|
||||
item_state = "headset"
|
||||
keyslot2 = new /obj/item/device/encryptionkey/headset_cargo
|
||||
|
||||
/obj/item/device/radio/headset/ert
|
||||
name = "CentCom Response Team headset"
|
||||
desc = "The headset of the boss's boss. Channels are as follows: :h - Response Team :c - command, :s - security, :e - engineering, :d - mining, :q - cargo, :m - medical, :n - science."
|
||||
icon_state = "com_headset"
|
||||
item_state = "headset"
|
||||
freerange = 1
|
||||
keyslot2 = new /obj/item/device/encryptionkey/ert
|
||||
|
||||
/obj/item/device/radio/headset/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
// ..()
|
||||
user.machine = src
|
||||
if (!( istype(W, /obj/item/weapon/screwdriver) || (istype(W, /obj/item/device/encryptionkey/ ))))
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
if(keyslot1 || keyslot2)
|
||||
|
||||
|
||||
for(var/ch_name in channels)
|
||||
radio_controller.remove_object(src, radiochannels[ch_name])
|
||||
secure_radio_connections[ch_name] = null
|
||||
|
||||
|
||||
if(keyslot1)
|
||||
var/turf/T = get_turf(user)
|
||||
if(T)
|
||||
keyslot1.loc = T
|
||||
keyslot1 = null
|
||||
|
||||
|
||||
|
||||
if(keyslot2)
|
||||
var/turf/T = get_turf(user)
|
||||
if(T)
|
||||
keyslot2.loc = T
|
||||
keyslot2 = null
|
||||
|
||||
recalculateChannels()
|
||||
user << "You pop out the encryption keys in the headset!"
|
||||
|
||||
else
|
||||
user << "This headset doesn't have any encryption keys! How useless..."
|
||||
|
||||
if(istype(W, /obj/item/device/encryptionkey/))
|
||||
if(keyslot1 && keyslot2)
|
||||
user << "The headset can't hold another key!"
|
||||
return
|
||||
|
||||
if(!keyslot1)
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
keyslot1 = W
|
||||
|
||||
else
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
keyslot2 = W
|
||||
|
||||
|
||||
recalculateChannels()
|
||||
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/radio/headset/proc/recalculateChannels()
|
||||
src.channels = list()
|
||||
src.translate_binary = 0
|
||||
src.translate_hive = 0
|
||||
src.syndie = 0
|
||||
|
||||
if(keyslot1)
|
||||
for(var/ch_name in keyslot1.channels)
|
||||
if(ch_name in src.channels)
|
||||
continue
|
||||
src.channels += ch_name
|
||||
src.channels[ch_name] = keyslot1.channels[ch_name]
|
||||
|
||||
if(keyslot1.translate_binary)
|
||||
src.translate_binary = 1
|
||||
|
||||
if(keyslot1.translate_hive)
|
||||
src.translate_hive = 1
|
||||
|
||||
if(keyslot1.syndie)
|
||||
src.syndie = 1
|
||||
|
||||
if(keyslot2)
|
||||
for(var/ch_name in keyslot2.channels)
|
||||
if(ch_name in src.channels)
|
||||
continue
|
||||
src.channels += ch_name
|
||||
src.channels[ch_name] = keyslot2.channels[ch_name]
|
||||
|
||||
if(keyslot2.translate_binary)
|
||||
src.translate_binary = 1
|
||||
|
||||
if(keyslot2.translate_hive)
|
||||
src.translate_hive = 1
|
||||
|
||||
if(keyslot2.syndie)
|
||||
src.syndie = 1
|
||||
|
||||
|
||||
for (var/ch_name in channels)
|
||||
if(!radio_controller)
|
||||
sleep(30) // Waiting for the radio_controller to be created.
|
||||
if(!radio_controller)
|
||||
src.name = "broken radio headset"
|
||||
return
|
||||
|
||||
secure_radio_connections[ch_name] = radio_controller.add_object(src, radiochannels[ch_name], RADIO_CHAT)
|
||||
|
||||
return
|
||||
@@ -0,0 +1,73 @@
|
||||
/obj/item/device/radio/intercom
|
||||
name = "station intercom"
|
||||
desc = "Talk through this."
|
||||
icon_state = "intercom"
|
||||
anchored = 1
|
||||
w_class = 4.0
|
||||
canhear_range = 4
|
||||
var/number = 0
|
||||
var/anyai = 1
|
||||
var/mob/living/silicon/ai/ai = list()
|
||||
|
||||
/obj/item/device/radio/intercom/New()
|
||||
spawn(5)
|
||||
checkpower()
|
||||
..()
|
||||
|
||||
/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_paw(mob/user as mob)
|
||||
return src.attack_hand(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/receive_range(freq, level)
|
||||
if (!on)
|
||||
return 0
|
||||
if (!(src.wires & WIRE_RECEIVE))
|
||||
return 0
|
||||
if(level != 0)
|
||||
var/turf/position = get_turf(src)
|
||||
if(isnull(position) || position.z != level)
|
||||
return 0
|
||||
if (!src.listening)
|
||||
return 0
|
||||
if(freq == SYND_FREQ)
|
||||
if(!(src.syndie))
|
||||
return 0//Prevents broadcast of messages over devices lacking the encryption
|
||||
|
||||
return canhear_range
|
||||
|
||||
|
||||
/obj/item/device/radio/intercom/hear_talk(mob/M as mob, msg)
|
||||
if(!src.anyai && !(M in src.ai))
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/device/radio/intercom/proc/checkpower()
|
||||
|
||||
// Simple loop, checks for power. Strictly for intercoms
|
||||
while(src)
|
||||
|
||||
if(!src.loc)
|
||||
on = 0
|
||||
else
|
||||
var/area/A = src.loc.loc
|
||||
if(!A || !isarea(A) || !A.master)
|
||||
on = 0
|
||||
else
|
||||
on = A.master.powered(EQUIP) // set "on" to the power status
|
||||
|
||||
if(!on)
|
||||
icon_state = "intercom-p"
|
||||
else
|
||||
icon_state = "intercom"
|
||||
|
||||
sleep(30)
|
||||
@@ -0,0 +1,779 @@
|
||||
var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
// 0 = old radios
|
||||
// 1 = new radios (subspace technology)
|
||||
|
||||
|
||||
/obj/item/device/radio
|
||||
icon = 'icons/obj/radio.dmi'
|
||||
name = "station bounced radio"
|
||||
suffix = "\[3\]"
|
||||
icon_state = "walkietalkie"
|
||||
item_state = "walkietalkie"
|
||||
var/on = 1 // 0 for off
|
||||
var/last_transmission
|
||||
var/frequency = 1459 //common chat
|
||||
var/traitor_frequency = 0 //tune to frequency to unlock traitor supplies
|
||||
var/canhear_range = 3 // the range which mobs can hear this radio from
|
||||
var/obj/item/device/radio/patch_link = null
|
||||
var/wires = WIRE_SIGNAL | WIRE_RECEIVE | WIRE_TRANSMIT
|
||||
var/b_stat = 0
|
||||
var/broadcasting = 0
|
||||
var/listening = 1
|
||||
var/freerange = 0 // 0 - Sanitize frequencies, 1 - Full range
|
||||
var/list/channels = list() //see communications.dm for full list. First channes is a "default" for :h
|
||||
var/subspace_transmission = 0
|
||||
var/syndie = 0//Holder to see if it's a syndicate encrpyed radio
|
||||
var/maxf = 1499
|
||||
// "Example" = FREQ_LISTENING|FREQ_BROADCASTING
|
||||
flags = FPRINT | CONDUCT | TABLEPASS
|
||||
slot_flags = SLOT_BELT
|
||||
throw_speed = 2
|
||||
throw_range = 9
|
||||
w_class = 2
|
||||
g_amt = 25
|
||||
m_amt = 75
|
||||
var/const/WIRE_SIGNAL = 1 //sends a signal, like to set off a bomb or electrocute someone
|
||||
var/const/WIRE_RECEIVE = 2
|
||||
var/const/WIRE_TRANSMIT = 4
|
||||
var/const/TRANSMISSION_DELAY = 5 // only 2/second/radio
|
||||
var/const/FREQ_LISTENING = 1
|
||||
//FREQ_BROADCASTING = 2
|
||||
|
||||
/obj/item/device/radio
|
||||
var/datum/radio_frequency/radio_connection
|
||||
var/list/datum/radio_frequency/secure_radio_connections = new
|
||||
|
||||
proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT)
|
||||
|
||||
/obj/item/device/radio/New()
|
||||
..()
|
||||
if(radio_controller)
|
||||
initialize()
|
||||
|
||||
|
||||
/obj/item/device/radio/initialize()
|
||||
|
||||
if(freerange)
|
||||
if(frequency < 1200 || frequency > 1600)
|
||||
frequency = sanitize_frequency(frequency, maxf)
|
||||
// The max freq is higher than a regular headset to decrease the chance of people listening in, if you use the higher channels.
|
||||
else if (frequency < 1441 || frequency > maxf)
|
||||
//world.log << "[src] ([type]) has a frequency of [frequency], sanitizing."
|
||||
frequency = sanitize_frequency(frequency, maxf)
|
||||
|
||||
set_frequency(frequency)
|
||||
|
||||
for (var/ch_name in channels)
|
||||
secure_radio_connections[ch_name] = radio_controller.add_object(src, radiochannels[ch_name], RADIO_CHAT)
|
||||
|
||||
|
||||
/obj/item/device/radio/attack_self(mob/user as mob)
|
||||
user.machine = src
|
||||
interact(user)
|
||||
|
||||
/obj/item/device/radio/proc/interact(mob/user as mob)
|
||||
if(!on)
|
||||
return
|
||||
|
||||
if(active_uplink_check(user))
|
||||
return
|
||||
|
||||
var/dat = "<html><head><title>[src]</title></head><body><TT>"
|
||||
|
||||
if(!istype(src, /obj/item/device/radio/headset)) //Headsets dont get a mic button
|
||||
dat += "Microphone: [broadcasting ? "<A href='byond://?src=\ref[src];talk=0'>Engaged</A>" : "<A href='byond://?src=\ref[src];talk=1'>Disengaged</A>"]<BR>"
|
||||
|
||||
dat += {"
|
||||
Speaker: [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(frequency)]
|
||||
<A href='byond://?src=\ref[src];freq=2'>+</A>
|
||||
<A href='byond://?src=\ref[src];freq=10'>+</A><BR>
|
||||
"}
|
||||
|
||||
for (var/ch_name in channels)
|
||||
dat+=text_sec_channel(ch_name, channels[ch_name])
|
||||
dat+={"[text_wires()]</TT></body></html>"}
|
||||
user << browse(dat, "window=radio")
|
||||
onclose(user, "radio")
|
||||
return
|
||||
|
||||
/obj/item/device/radio/proc/text_wires()
|
||||
if (!b_stat)
|
||||
return ""
|
||||
return {"
|
||||
<hr>
|
||||
Green Wire: <A href='byond://?src=\ref[src];wires=4'>[(wires & 4) ? "Cut" : "Mend"] Wire</A><BR>
|
||||
Red Wire: <A href='byond://?src=\ref[src];wires=2'>[(wires & 2) ? "Cut" : "Mend"] Wire</A><BR>
|
||||
Blue Wire: <A href='byond://?src=\ref[src];wires=1'>[(wires & 1) ? "Cut" : "Mend"] Wire</A><BR>
|
||||
"}
|
||||
|
||||
|
||||
/obj/item/device/radio/proc/text_sec_channel(var/chan_name, var/chan_stat)
|
||||
var/list = !!(chan_stat&FREQ_LISTENING)!=0
|
||||
return {"
|
||||
<B>[chan_name]</B><br>
|
||||
Speaker: <A href='byond://?src=\ref[src];ch_name=[chan_name];listen=[!list]'>[list ? "Engaged" : "Disengaged"]</A><BR>
|
||||
"}
|
||||
|
||||
/obj/item/device/radio/Topic(href, href_list)
|
||||
//..()
|
||||
if (usr.stat || !on)
|
||||
return
|
||||
|
||||
if (!(issilicon(usr) || (usr.contents.Find(src) || ( in_range(src, usr) && istype(loc, /turf) ))))
|
||||
usr << browse(null, "window=radio")
|
||||
return
|
||||
usr.machine = src
|
||||
if (href_list["track"])
|
||||
var/mob/target = locate(href_list["track"])
|
||||
var/mob/living/silicon/ai/A = locate(href_list["track2"])
|
||||
if(A && target)
|
||||
A.ai_actual_track(target)
|
||||
return
|
||||
|
||||
else if (href_list["faketrack"])
|
||||
var/mob/target = locate(href_list["track"])
|
||||
var/mob/living/silicon/ai/A = locate(href_list["track2"])
|
||||
if(A && target)
|
||||
|
||||
A:cameraFollow = target
|
||||
A << text("Now tracking [] on camera.", target.name)
|
||||
if (usr.machine == null)
|
||||
usr.machine = usr
|
||||
|
||||
while (usr:cameraFollow == target)
|
||||
usr << "Target is not on or near any active cameras on the station. We'll check again in 5 seconds (unless you use the cancel-camera verb)."
|
||||
sleep(40)
|
||||
continue
|
||||
|
||||
return
|
||||
|
||||
else if (href_list["freq"])
|
||||
var/new_frequency = (frequency + text2num(href_list["freq"]))
|
||||
if (!freerange || (frequency < 1200 || frequency > 1600))
|
||||
new_frequency = sanitize_frequency(new_frequency, maxf)
|
||||
set_frequency(new_frequency)
|
||||
if(hidden_uplink)
|
||||
if(hidden_uplink.check_trigger(usr, frequency, traitor_frequency))
|
||||
usr << browse(null, "window=radio")
|
||||
return
|
||||
|
||||
else if (href_list["talk"])
|
||||
broadcasting = text2num(href_list["talk"])
|
||||
else if (href_list["listen"])
|
||||
var/chan_name = href_list["ch_name"]
|
||||
if (!chan_name)
|
||||
listening = text2num(href_list["listen"])
|
||||
else
|
||||
if (channels[chan_name] & FREQ_LISTENING)
|
||||
channels[chan_name] &= ~FREQ_LISTENING
|
||||
else
|
||||
channels[chan_name] |= FREQ_LISTENING
|
||||
else if (href_list["wires"])
|
||||
var/t1 = text2num(href_list["wires"])
|
||||
if (!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) ))
|
||||
return
|
||||
if (wires & t1)
|
||||
wires &= ~t1
|
||||
else
|
||||
wires |= t1
|
||||
if (!( master ))
|
||||
if (istype(loc, /mob))
|
||||
interact(loc)
|
||||
else
|
||||
updateDialog()
|
||||
else
|
||||
if (istype(master.loc, /mob))
|
||||
interact(master.loc)
|
||||
else
|
||||
updateDialog()
|
||||
add_fingerprint(usr)
|
||||
|
||||
/obj/item/device/radio/talk_into(mob/M as mob, message, channel)
|
||||
|
||||
if(!on) return // the device has to be on
|
||||
// Fix for permacell radios, but kinda eh about actually fixing them.
|
||||
|
||||
// Uncommenting this. To the above comment:
|
||||
// The permacell radios aren't suppose to be able to transmit, this isn't a bug and this "fix" is just making radio wires useless. -Giacom
|
||||
if(!(src.wires & WIRE_TRANSMIT)) // The device has to have all its wires and shit intact
|
||||
return
|
||||
|
||||
|
||||
if(GLOBAL_RADIO_TYPE == 1) // NEW RADIO SYSTEMS: By Doohl
|
||||
|
||||
/* Quick introduction:
|
||||
This new radio system uses a very robust FTL signaling technology unoriginally
|
||||
dubbed "subspace" which is somewhat similar to 'blue-space' but can't
|
||||
actually transmit large mass. Headsets are the only radio devices capable
|
||||
of sending subspace transmissions to the Communications Satellite.
|
||||
|
||||
A headset sends a signal to a subspace listener/reciever elsewhere in space,
|
||||
the signal gets processed and logged, and an audible transmission gets sent
|
||||
to each individual headset.
|
||||
*/
|
||||
|
||||
//#### Grab the connection datum ####//
|
||||
var/datum/radio_frequency/connection = null
|
||||
if(channel && channels && channels.len > 0)
|
||||
if (channel == "department")
|
||||
//world << "DEBUG: channel=\"[channel]\" switching to \"[channels[1]]\""
|
||||
channel = channels[1]
|
||||
connection = secure_radio_connections[channel]
|
||||
else
|
||||
connection = radio_connection
|
||||
channel = null
|
||||
if (!istype(connection))
|
||||
return
|
||||
if (!connection)
|
||||
return
|
||||
|
||||
var/turf/position = get_turf(src)
|
||||
|
||||
//#### Tagging the signal with all appropriate identity values ####//
|
||||
|
||||
// ||-- The mob's name identity --||
|
||||
var/displayname = M.name // grab the display name (name you get when you hover over someone's icon)
|
||||
var/real_name = M.real_name // mob's real name
|
||||
var/mobkey = "none" // player key associated with mob
|
||||
var/voicemask = 0 // the speaker is wearing a voice mask
|
||||
if(M.client)
|
||||
mobkey = M.key // assign the mob's key
|
||||
|
||||
|
||||
var/jobname // the mob's "job"
|
||||
|
||||
// --- Human: use their actual job ---
|
||||
if (ishuman(M))
|
||||
jobname = M:get_assignment()
|
||||
|
||||
// --- Carbon Nonhuman ---
|
||||
else if (iscarbon(M)) // Nonhuman carbon mob
|
||||
jobname = "No id"
|
||||
|
||||
// --- AI ---
|
||||
else if (isAI(M))
|
||||
jobname = "AI"
|
||||
|
||||
// --- Cyborg ---
|
||||
else if (isrobot(M))
|
||||
jobname = "Cyborg"
|
||||
|
||||
// --- Personal AI (pAI) ---
|
||||
else if (istype(M, /mob/living/silicon/pai))
|
||||
jobname = "Personal AI"
|
||||
|
||||
// --- Unidentifiable mob ---
|
||||
else
|
||||
jobname = "Unknown"
|
||||
|
||||
|
||||
// --- Modifications to the mob's identity ---
|
||||
|
||||
// The mob is disguising their identity:
|
||||
if (istype(M.wear_mask, /obj/item/clothing/mask/gas/voice))
|
||||
if(M.wear_mask:vchange)
|
||||
displayname = M.wear_mask:voice
|
||||
jobname = "Unknown"
|
||||
voicemask = 1
|
||||
|
||||
|
||||
|
||||
/* ###### Radio headsets can only broadcast through subspace ###### */
|
||||
|
||||
if(subspace_transmission)
|
||||
// First, we want to generate a new radio signal
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 2 // 2 would be a subspace transmission.
|
||||
// transmission_method could probably be enumerated through #define. Would be neater.
|
||||
|
||||
// --- Finally, tag the actual signal with the appropriate values ---
|
||||
signal.data = list(
|
||||
// Identity-associated tags:
|
||||
"mob" = M, // store a reference to the mob
|
||||
"mobtype" = M.type, // the mob's type
|
||||
"realname" = real_name, // the mob's real name
|
||||
"name" = displayname, // the mob's display name
|
||||
"job" = jobname, // the mob's job
|
||||
"key" = mobkey, // the mob's key
|
||||
"vmessage" = M.voice_message, // the message to display if the voice wasn't understood
|
||||
"vname" = M.voice_name, // the name to display if the voice wasn't understood
|
||||
"vmask" = voicemask, // 1 if the mob is using a voice gas mask
|
||||
|
||||
// We store things that would otherwise be kept in the actual mob
|
||||
// so that they can be logged even AFTER the mob is deleted or something
|
||||
|
||||
// Other tags:
|
||||
"compression" = rand(45,50), // compressed radio signal
|
||||
"message" = message, // the actual sent message
|
||||
"connection" = connection, // the radio connection to use
|
||||
"radio" = src, // stores the radio used for transmission
|
||||
"slow" = 0, // how much to sleep() before broadcasting - simulates net lag
|
||||
"traffic" = 0, // dictates the total traffic sum that the signal went through
|
||||
"type" = 0, // determines what type of radio input it is: normal broadcast
|
||||
"server" = null, // the last server to log this signal
|
||||
"reject" = 0, // if nonzero, the signal will not be accepted by any broadcasting machinery
|
||||
"level" = position.z // The source's z level
|
||||
)
|
||||
signal.frequency = connection.frequency // Quick frequency set
|
||||
|
||||
//#### Sending the signal to all subspace receivers ####//
|
||||
|
||||
for(var/obj/machinery/telecomms/receiver/R in telecomms_list)
|
||||
R.receive_signal(signal)
|
||||
|
||||
// Allinone can act as receivers.
|
||||
for(var/obj/machinery/telecomms/allinone/R in telecomms_list)
|
||||
R.receive_signal(signal)
|
||||
|
||||
// Receiving code can be located in Telecommunications.dm
|
||||
return
|
||||
|
||||
|
||||
/* ###### Intercoms and station-bounced radios ###### */
|
||||
|
||||
var/filter_type = 2
|
||||
|
||||
/* --- Intercoms can only broadcast to other intercoms, but bounced radios can broadcast to bounced radios and intercoms --- */
|
||||
if(istype(src, /obj/item/device/radio/intercom))
|
||||
filter_type = 1
|
||||
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 2
|
||||
|
||||
|
||||
/* --- Try to send a normal subspace broadcast first */
|
||||
|
||||
signal.data = list(
|
||||
|
||||
"mob" = M, // store a reference to the mob
|
||||
"mobtype" = M.type, // the mob's type
|
||||
"realname" = real_name, // the mob's real name
|
||||
"name" = displayname, // the mob's display name
|
||||
"job" = jobname, // the mob's job
|
||||
"key" = mobkey, // the mob's key
|
||||
"vmessage" = M.voice_message, // the message to display if the voice wasn't understood
|
||||
"vname" = M.voice_name, // the name to display if the voice wasn't understood
|
||||
"vmask" = voicemask, // 1 if the mob is using a voice gas mas
|
||||
|
||||
"compression" = 0, // uncompressed radio signal
|
||||
"message" = message, // the actual sent message
|
||||
"connection" = connection, // the radio connection to use
|
||||
"radio" = src, // stores the radio used for transmission
|
||||
"slow" = 0,
|
||||
"traffic" = 0,
|
||||
"type" = 0,
|
||||
"server" = null,
|
||||
"reject" = 0,
|
||||
"level" = position.z
|
||||
)
|
||||
signal.frequency = connection.frequency // Quick frequency set
|
||||
|
||||
for(var/obj/machinery/telecomms/receiver/R in telecomms_list)
|
||||
R.receive_signal(signal)
|
||||
|
||||
|
||||
sleep(rand(10,25)) // wait a little...
|
||||
|
||||
if(signal.data["done"])
|
||||
// we're done here.
|
||||
return
|
||||
|
||||
// Oh my god; the comms are down or something because the signal hasn't been broadcasted yet.
|
||||
// Send a mundane broadcast with limited targets:
|
||||
|
||||
//THIS IS TEMPORARY.
|
||||
if(!connection) return //~Carn
|
||||
|
||||
Broadcast_Message(connection, M, voicemask, M.voice_message,
|
||||
src, message, displayname, jobname, real_name, M.voice_name,
|
||||
filter_type, signal.data["compression"], position.z)
|
||||
|
||||
|
||||
|
||||
else // OLD RADIO SYSTEMS: By Goons?
|
||||
|
||||
var/datum/radio_frequency/connection = null
|
||||
if(channel && channels && channels.len > 0)
|
||||
if (channel == "department")
|
||||
//world << "DEBUG: channel=\"[channel]\" switching to \"[channels[1]]\""
|
||||
channel = channels[1]
|
||||
connection = secure_radio_connections[channel]
|
||||
else
|
||||
connection = radio_connection
|
||||
channel = null
|
||||
if (!istype(connection))
|
||||
return
|
||||
var/display_freq = connection.frequency
|
||||
|
||||
//world << "DEBUG: used channel=\"[channel]\" frequency= \"[display_freq]\" connection.devices.len = [connection.devices.len]"
|
||||
|
||||
var/eqjobname
|
||||
|
||||
if (ishuman(M))
|
||||
eqjobname = M:get_assignment()
|
||||
else if (iscarbon(M))
|
||||
eqjobname = "No id" //only humans can wear ID
|
||||
else if (isAI(M))
|
||||
eqjobname = "AI"
|
||||
else if (isrobot(M))
|
||||
eqjobname = "Cyborg"//Androids don't really describe these too well, in my opinion.
|
||||
else if (istype(M, /mob/living/silicon/pai))
|
||||
eqjobname = "Personal AI"
|
||||
else
|
||||
eqjobname = "Unknown"
|
||||
|
||||
if (!(wires & WIRE_TRANSMIT))
|
||||
return
|
||||
|
||||
var/list/receive = list()
|
||||
|
||||
//for (var/obj/item/device/radio/R in radio_connection.devices)
|
||||
for (var/obj/item/device/radio/R in connection.devices["[RADIO_CHAT]"]) // Modified for security headset code -- TLE
|
||||
//if(R.accept_rad(src, message))
|
||||
receive |= R.send_hear(display_freq, 0)
|
||||
|
||||
//world << "DEBUG: receive.len=[receive.len]"
|
||||
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
|
||||
|
||||
for (var/mob/R in receive)
|
||||
if (R.client && R.client.STFU_radio) //Adminning with 80 people on can be fun when you're trying to talk and all you can hear is radios.
|
||||
continue
|
||||
if (R.say_understands(M))
|
||||
if (!ishuman(M) || 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
|
||||
|
||||
if (length(heard_masked) || length(heard_normal) || length(heard_voice) || length(heard_garbled))
|
||||
var/part_a = "<span class='radio'><span class='name'>"
|
||||
//var/part_b = "</span><b> \icon[src]\[[format_frequency(frequency)]\]</b> <span class='message'>"
|
||||
var/freq_text
|
||||
switch(display_freq)
|
||||
if(SYND_FREQ)
|
||||
freq_text = "#unkn"
|
||||
if(COMM_FREQ)
|
||||
freq_text = "Command"
|
||||
if(1351)
|
||||
freq_text = "Science"
|
||||
if(1355)
|
||||
freq_text = "Medical"
|
||||
if(1357)
|
||||
freq_text = "Engineering"
|
||||
if(1359)
|
||||
freq_text = "Security"
|
||||
if(1349)
|
||||
freq_text = "Mining"
|
||||
if(1347)
|
||||
freq_text = "Cargo"
|
||||
//There's probably a way to use the list var of channels in code\game\communications.dm to make the dept channels non-hardcoded, but I wasn't in an experimentive mood. --NEO
|
||||
|
||||
if(!freq_text)
|
||||
freq_text = format_frequency(display_freq)
|
||||
|
||||
var/part_b = "</span><b> \icon[src]\[[freq_text]\]</b> <span class='message'>" // Tweaked for security headsets -- TLE
|
||||
var/part_c = "</span></span>"
|
||||
|
||||
if (display_freq==SYND_FREQ)
|
||||
part_a = "<span class='syndradio'><span class='name'>"
|
||||
else if (display_freq==COMM_FREQ)
|
||||
part_a = "<span class='comradio'><span class='name'>"
|
||||
else if (display_freq in DEPT_FREQS)
|
||||
part_a = "<span class='deptradio'><span class='name'>"
|
||||
|
||||
var/quotedmsg = M.say_quote(message)
|
||||
|
||||
//This following recording is intended for research and feedback in the use of department radio channels.
|
||||
|
||||
var/part_blackbox_b = "</span><b> \[[freq_text]\]</b> <span class='message'>" // Tweaked for security headsets -- TLE
|
||||
var/blackbox_msg = "[part_a][M.name][part_blackbox_b][quotedmsg][part_c]"
|
||||
//var/blackbox_admin_msg = "[part_a][M.name] (Real name: [M.real_name])[part_blackbox_b][quotedmsg][part_c]"
|
||||
if(istype(blackbox))
|
||||
//BR.messages_admin += blackbox_admin_msg
|
||||
switch(display_freq)
|
||||
if(1459)
|
||||
blackbox.msg_common += blackbox_msg
|
||||
if(1351)
|
||||
blackbox.msg_science += blackbox_msg
|
||||
if(1353)
|
||||
blackbox.msg_command += blackbox_msg
|
||||
if(1355)
|
||||
blackbox.msg_medical += blackbox_msg
|
||||
if(1357)
|
||||
blackbox.msg_engineering += blackbox_msg
|
||||
if(1359)
|
||||
blackbox.msg_security += blackbox_msg
|
||||
if(1441)
|
||||
blackbox.msg_deathsquad += blackbox_msg
|
||||
if(1213)
|
||||
blackbox.msg_syndicate += blackbox_msg
|
||||
if(1349)
|
||||
blackbox.msg_mining += blackbox_msg
|
||||
if(1347)
|
||||
blackbox.msg_cargo += blackbox_msg
|
||||
else
|
||||
blackbox.messages += blackbox_msg
|
||||
|
||||
//End of research and feedback code.
|
||||
|
||||
if (length(heard_masked))
|
||||
var/N = M.name
|
||||
var/J = eqjobname
|
||||
if (istype(M.wear_mask, /obj/item/clothing/mask/gas/voice)&&M.wear_mask:vchange)
|
||||
//To properly have the ninja show up on radio. Could also be useful for similar items.
|
||||
//Would not be necessary but the mob could be wearing a mask that is not a voice changer.
|
||||
N = M.wear_mask:voice
|
||||
J = "Unknown"
|
||||
var/rendered = "[part_a][N][part_b][quotedmsg][part_c]"
|
||||
for (var/mob/R in heard_masked)
|
||||
if(istype(R, /mob/living/silicon/ai))
|
||||
R.show_message("[part_a]<a href='byond://?src=\ref[src];track2=\ref[R];track=\ref[M]'>[N] ([J]) </a>[part_b][quotedmsg][part_c]", 2)
|
||||
else
|
||||
R.show_message(rendered, 2)
|
||||
|
||||
if (length(heard_normal))
|
||||
var/rendered = "[part_a][M.real_name][part_b][quotedmsg][part_c]"
|
||||
|
||||
for (var/mob/R in heard_normal)
|
||||
if(istype(R, /mob/living/silicon/ai))
|
||||
R.show_message("[part_a]<a href='byond://?src=\ref[src];track2=\ref[R];track=\ref[M]'>[M.real_name] ([eqjobname]) </a>[part_b][quotedmsg][part_c]", 2)
|
||||
else
|
||||
R.show_message(rendered, 2)
|
||||
|
||||
if (length(heard_voice))
|
||||
var/rendered = "[part_a][M.voice_name][part_b][M.voice_message][part_c]"
|
||||
|
||||
for (var/mob/R in heard_voice)
|
||||
if(istype(R, /mob/living/silicon/ai))
|
||||
R.show_message("[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]", 2)
|
||||
else
|
||||
R.show_message(rendered, 2)
|
||||
|
||||
if (length(heard_garbled))
|
||||
quotedmsg = M.say_quote(stars(message))
|
||||
var/rendered = "[part_a][M.voice_name][part_b][quotedmsg][part_c]"
|
||||
|
||||
for (var/mob/R in heard_voice)
|
||||
if(istype(R, /mob/living/silicon/ai))
|
||||
R.show_message("[part_a]<a href='byond://?src=\ref[src];track2=\ref[R];track=\ref[M]'>[M.voice_name]</a>[part_b][quotedmsg][part_c]", 2)
|
||||
else
|
||||
R.show_message(rendered, 2)
|
||||
|
||||
/obj/item/device/radio/hear_talk(mob/M as mob, msg)
|
||||
|
||||
if (broadcasting)
|
||||
talk_into(M, msg)
|
||||
/*
|
||||
/obj/item/device/radio/proc/accept_rad(obj/item/device/radio/R as obj, message)
|
||||
|
||||
if ((R.frequency == frequency && message))
|
||||
return 1
|
||||
else if
|
||||
|
||||
else
|
||||
return null
|
||||
return
|
||||
*/
|
||||
|
||||
|
||||
/obj/item/device/radio/proc/receive_range(freq, level)
|
||||
// check if this radio can receive on the given frequency, and if so,
|
||||
// what the range is in which mobs will hear the radio
|
||||
// returns: 0 if can't receive, range otherwise
|
||||
|
||||
if (!(wires & WIRE_RECEIVE))
|
||||
return 0
|
||||
if(!listening)
|
||||
return 0
|
||||
if(level != 0)
|
||||
var/turf/position = get_turf(src)
|
||||
if(isnull(position) || position.z != level)
|
||||
return 0
|
||||
if(freq == SYND_FREQ)
|
||||
if(!(src.syndie))//Checks to see if it's allowed on that frequency, based on the encryption keys
|
||||
return 0
|
||||
if (!on)
|
||||
return 0
|
||||
if (!freq) //recieved on main frequency
|
||||
if (!listening)
|
||||
return 0
|
||||
else
|
||||
var/accept = (freq==frequency && listening)
|
||||
if (!accept)
|
||||
for (var/ch_name in channels)
|
||||
var/datum/radio_frequency/RF = secure_radio_connections[ch_name]
|
||||
if (RF.frequency==freq && (channels[ch_name]&FREQ_LISTENING))
|
||||
accept = 1
|
||||
break
|
||||
if (!accept)
|
||||
return 0
|
||||
|
||||
return canhear_range
|
||||
|
||||
/obj/item/device/radio/proc/send_hear(freq, level)
|
||||
|
||||
var/range = receive_range(freq, level)
|
||||
if(range > 0)
|
||||
return get_mobs_in_view(canhear_range, src)
|
||||
|
||||
|
||||
/obj/item/device/radio/examine()
|
||||
set src in view()
|
||||
|
||||
..()
|
||||
if ((in_range(src, usr) || loc == usr))
|
||||
if (b_stat)
|
||||
usr.show_message("\blue \the [src] can be attached and modified!")
|
||||
else
|
||||
usr.show_message("\blue \the [src] can not be modified or attached!")
|
||||
return
|
||||
|
||||
/obj/item/device/radio/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
user.machine = src
|
||||
if (!( istype(W, /obj/item/weapon/screwdriver) ))
|
||||
return
|
||||
b_stat = !( b_stat )
|
||||
if(!istype(src, /obj/item/device/radio/beacon))
|
||||
if (b_stat)
|
||||
user.show_message("\blue The radio can now be attached and modified!")
|
||||
else
|
||||
user.show_message("\blue The radio can no longer be modified or attached!")
|
||||
updateDialog()
|
||||
//Foreach goto(83)
|
||||
add_fingerprint(user)
|
||||
return
|
||||
else return
|
||||
|
||||
/obj/item/device/radio/emp_act(severity)
|
||||
broadcasting = 0
|
||||
listening = 0
|
||||
for (var/ch_name in channels)
|
||||
channels[ch_name] = 0
|
||||
..()
|
||||
|
||||
///////////////////////////////
|
||||
//////////Borg Radios//////////
|
||||
///////////////////////////////
|
||||
//Giving borgs their own radio to have some more room to work with -Sieve
|
||||
|
||||
/obj/item/device/radio/borg
|
||||
var/obj/item/device/encryptionkey/keyslot = null//Borg radios can handle a single encryption key
|
||||
|
||||
/obj/item/device/radio/borg/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
// ..()
|
||||
user.machine = src
|
||||
if (!( istype(W, /obj/item/weapon/screwdriver) || (istype(W, /obj/item/device/encryptionkey/ ))))
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
if(keyslot)
|
||||
|
||||
|
||||
for(var/ch_name in channels)
|
||||
radio_controller.remove_object(src, radiochannels[ch_name])
|
||||
secure_radio_connections[ch_name] = null
|
||||
|
||||
|
||||
if(keyslot)
|
||||
var/turf/T = get_turf(user)
|
||||
if(T)
|
||||
keyslot.loc = T
|
||||
keyslot = null
|
||||
|
||||
recalculateChannels()
|
||||
user << "You pop out the encryption key in the radio!"
|
||||
|
||||
else
|
||||
user << "This radio doesn't have any encryption keys!"
|
||||
|
||||
if(istype(W, /obj/item/device/encryptionkey/))
|
||||
if(keyslot)
|
||||
user << "The radio can't hold another key!"
|
||||
return
|
||||
|
||||
if(!keyslot)
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
keyslot = W
|
||||
|
||||
recalculateChannels()
|
||||
|
||||
return
|
||||
|
||||
/obj/item/device/radio/borg/proc/recalculateChannels()
|
||||
src.channels = list()
|
||||
src.syndie = 0
|
||||
|
||||
if(keyslot)
|
||||
for(var/ch_name in keyslot.channels)
|
||||
if(ch_name in src.channels)
|
||||
continue
|
||||
src.channels += ch_name
|
||||
src.channels[ch_name] = keyslot.channels[ch_name]
|
||||
|
||||
if(keyslot.syndie)
|
||||
src.syndie = 1
|
||||
|
||||
|
||||
for (var/ch_name in channels)
|
||||
if(!radio_controller)
|
||||
sleep(30) // Waiting for the radio_controller to be created.
|
||||
if(!radio_controller)
|
||||
src.name = "broken radio"
|
||||
return
|
||||
|
||||
secure_radio_connections[ch_name] = radio_controller.add_object(src, radiochannels[ch_name], RADIO_CHAT)
|
||||
|
||||
return
|
||||
|
||||
/obj/item/device/radio/borg/Topic(href, href_list)
|
||||
if(usr.stat || !on)
|
||||
return
|
||||
if (href_list["mode"])
|
||||
subspace_transmission = !subspace_transmission
|
||||
if(!subspace_transmission)//Simple as fuck, clears the channel list to prevent talking/listening over them if subspace transmission is disabled
|
||||
channels = list()
|
||||
else
|
||||
recalculateChannels()
|
||||
usr << "Subspace Transmission is [(subspace_transmission) ? "enabled" : "disabled"]"
|
||||
..()
|
||||
|
||||
/obj/item/device/radio/borg/interact(mob/user as mob)
|
||||
if(!on)
|
||||
return
|
||||
|
||||
var/dat = "<html><head><title>[src]</title></head><body><TT>"
|
||||
dat += {"
|
||||
Speaker: [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(frequency)]
|
||||
<A href='byond://?src=\ref[src];freq=2'>+</A>
|
||||
<A href='byond://?src=\ref[src];freq=10'>+</A><BR>
|
||||
<A href='byond://?src=\ref[src];mode=1'>Toggle Broadcast Mode</A><BR>
|
||||
"}
|
||||
|
||||
if(subspace_transmission)//Don't even bother if subspace isn't turned on
|
||||
for (var/ch_name in channels)
|
||||
dat+=text_sec_channel(ch_name, channels[ch_name])
|
||||
dat+={"[text_wires()]</TT></body></html>"}
|
||||
user << browse(dat, "window=radio")
|
||||
onclose(user, "radio")
|
||||
return
|
||||
@@ -0,0 +1,267 @@
|
||||
|
||||
/*
|
||||
CONTAINS:
|
||||
T-RAY
|
||||
DETECTIVE SCANNER
|
||||
HEALTH ANALYZER
|
||||
GAS ANALYZER
|
||||
PLANT ANALYZER
|
||||
MASS SPECTROMETER
|
||||
|
||||
*/
|
||||
/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 | TABLEPASS
|
||||
slot_flags = SLOT_BELT
|
||||
w_class = 2
|
||||
item_state = "electronic"
|
||||
m_amt = 150
|
||||
origin_tech = "magnets=1;engineering=1"
|
||||
|
||||
/obj/item/device/t_scanner/attack_self(mob/user)
|
||||
|
||||
on = !on
|
||||
icon_state = "t-ray[on]"
|
||||
|
||||
if(on)
|
||||
processing_objects.Add(src)
|
||||
|
||||
|
||||
/obj/item/device/t_scanner/process()
|
||||
if(!on)
|
||||
processing_objects.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)
|
||||
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(2)
|
||||
if(M)
|
||||
M.invisibility = INVISIBILITY_LEVEL_TWO
|
||||
|
||||
|
||||
/obj/item/device/healthanalyzer
|
||||
name = "Health Analyzer"
|
||||
icon_state = "health"
|
||||
item_state = "analyzer"
|
||||
desc = "A hand-held body scanner able to distinguish vital signs of the subject."
|
||||
flags = FPRINT | TABLEPASS | CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
throwforce = 3
|
||||
w_class = 1.0
|
||||
throw_speed = 5
|
||||
throw_range = 10
|
||||
m_amt = 200
|
||||
origin_tech = "magnets=1;biotech=1"
|
||||
var/mode = 1;
|
||||
|
||||
/obj/item/device/healthanalyzer/attack(mob/living/M as mob, mob/living/user as mob)
|
||||
if (( (CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50))
|
||||
user << text("\red You try to analyze the floor's vitals!")
|
||||
for(var/mob/O in viewers(M, null))
|
||||
O.show_message(text("\red [user] has analyzed the floor's vitals!"), 1)
|
||||
user.show_message(text("\blue Analyzing Results for The floor:\n\t Overall Status: Healthy"), 1)
|
||||
user.show_message(text("\blue \t Damage Specifics: [0]-[0]-[0]-[0]"), 1)
|
||||
user.show_message("\blue Key: Suffocation/Toxin/Burns/Brute", 1)
|
||||
user.show_message("\blue Body Temperature: ???", 1)
|
||||
return
|
||||
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
for(var/mob/O in viewers(M, null))
|
||||
O.show_message(text("\red [] has analyzed []'s vitals!", user, M), 1)
|
||||
//Foreach goto(67)
|
||||
var/fake_oxy = max(rand(1,40), M.getOxyLoss(), (300 - (M.getToxLoss() + M.getFireLoss() + M.getBruteLoss())))
|
||||
if(M.status_flags & FAKEDEATH)
|
||||
user.show_message(text("\blue Analyzing Results for []:\n\t Overall Status: []", M, "dead"), 1)
|
||||
user.show_message(text("\blue \t Damage Specifics: []-[]-[]-[]", fake_oxy < 50 ? "\red [fake_oxy]" : fake_oxy , M.getToxLoss() > 50 ? "\red [M.getToxLoss()]" : M.getToxLoss(), M.getFireLoss() > 50 ? "\red[M.getFireLoss()]" : M.getFireLoss(), M.getBruteLoss() > 50 ? "\red[M.getBruteLoss()]" : M.getBruteLoss()), 1)
|
||||
else
|
||||
user.show_message(text("\blue Analyzing Results for []:\n\t Overall Status: []", M, (M.stat > 1 ? "dead" : text("[]% healthy", M.health - M.halloss))), 1)
|
||||
user.show_message(text("\blue \t Damage Specifics: []-[]-[]-[]", M.getOxyLoss() > 50 ? "\red [M.getOxyLoss()]" : M.getOxyLoss(), M.getToxLoss() > 50 ? "\red [M.getToxLoss()]" : M.getToxLoss(), M.getFireLoss() > 50 ? "\red[M.getFireLoss()]" : M.getFireLoss(), M.getBruteLoss() > 50 ? "\red[M.getBruteLoss()]" : M.getBruteLoss()), 1)
|
||||
user.show_message("\blue Key: Suffocation/Toxin/Burns/Brute", 1)
|
||||
user.show_message("\blue Body Temperature: [M.bodytemperature-T0C]°C ([M.bodytemperature*1.8-459.67]°F)", 1)
|
||||
if(M.tod && (M.stat == DEAD || (M.status_flags & FAKEDEATH)))
|
||||
user.show_message("\blue Time of Death: [M.tod]")
|
||||
if(istype(M, /mob/living/carbon/human) && mode == 1)
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/list/damaged = H.get_damaged_organs(1,1)
|
||||
user.show_message("\blue Localized Damage, Brute/Burn:",1)
|
||||
if(length(damaged)>0)
|
||||
for(var/datum/organ/external/org in damaged)
|
||||
user.show_message(text("\blue \t []: []\blue-[]",capitalize(org.getDisplayName()),(org.brute_dam > 0)?"\red [org.brute_dam]":0,(org.burn_dam > 0)?"\red [org.burn_dam]":0),1)
|
||||
else
|
||||
user.show_message("\blue \t Limbs are OK.",1)
|
||||
|
||||
if(M.status_flags & FAKEDEATH)
|
||||
user.show_message(text("\blue [] | [] | [] | []", fake_oxy > 50 ? "\red Severe oxygen deprivation detected\blue" : "Subject bloodstream oxygen level normal", M.getToxLoss() > 50 ? "\red Dangerous amount of toxins detected\blue" : "Subject bloodstream toxin level minimal", M.getFireLoss() > 50 ? "\red Severe burn damage detected\blue" : "Subject burn injury status O.K", M.getBruteLoss() > 50 ? "\red Severe anatomical damage detected\blue" : "Subject brute-force injury status O.K"), 1)
|
||||
else
|
||||
user.show_message(text("\blue [] | [] | [] | []", M.getOxyLoss() > 50 ? "\red Severe oxygen deprivation detected\blue" : "Subject bloodstream oxygen level normal", M.getToxLoss() > 50 ? "\red Dangerous amount of toxins detected\blue" : "Subject bloodstream toxin level minimal", M.getFireLoss() > 50 ? "\red Severe burn damage detected\blue" : "Subject burn injury status O.K", M.getBruteLoss() > 50 ? "\red Severe anatomical damage detected\blue" : "Subject brute-force injury status O.K"), 1)
|
||||
if (M.getCloneLoss())
|
||||
user.show_message(text("\red Subject appears to have been imperfectly cloned."), 1)
|
||||
for(var/datum/disease/D in M.viruses)
|
||||
if(!D.hidden[SCANNER])
|
||||
user.show_message(text("\red <b>Warning: [D.form] Detected</b>\nName: [D.name].\nType: [D.spread].\nStage: [D.stage]/[D.max_stages].\nPossible Cure: [D.cure]"))
|
||||
if (M.reagents && M.reagents.get_reagent_amount("inaprovaline"))
|
||||
user.show_message(text("\blue Bloodstream Analysis located [M.reagents:get_reagent_amount("inaprovaline")] units of rejuvenation chemicals."), 1)
|
||||
if (M.getBrainLoss() >= 100 || istype(M, /mob/living/carbon/human) && M:brain_op_stage == 4.0)
|
||||
user.show_message(text("\red Subject is brain dead."), 1)
|
||||
else if (M.getBrainLoss() >= 60)
|
||||
user.show_message(text("\red Severe brain damage detected. Subject likely to have mental retardation."), 1)
|
||||
else if (M.getBrainLoss() >= 10)
|
||||
user.show_message(text("\red Significant brain damage detected. Subject may have had a concussion."), 1)
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/device/healthanalyzer/verb/toggle_mode()
|
||||
set name = "Switch Verbosity"
|
||||
set category = "Object"
|
||||
|
||||
mode = !mode
|
||||
switch (mode)
|
||||
if(1)
|
||||
usr << "The scanner now shows specific limb damage."
|
||||
if(0)
|
||||
usr << "The scanner no longer shows limb damage."
|
||||
|
||||
|
||||
/obj/item/device/analyzer
|
||||
desc = "A hand-held environmental scanner which reports current gas levels."
|
||||
name = "analyzer"
|
||||
icon_state = "atmos"
|
||||
item_state = "analyzer"
|
||||
w_class = 2.0
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
throwforce = 5
|
||||
throw_speed = 4
|
||||
throw_range = 20
|
||||
m_amt = 30
|
||||
g_amt = 20
|
||||
origin_tech = "magnets=1;engineering=1"
|
||||
|
||||
/obj/item/device/analyzer/attack_self(mob/user as mob)
|
||||
|
||||
if (user.stat)
|
||||
return
|
||||
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
|
||||
var/turf/location = user.loc
|
||||
if (!( istype(location, /turf) ))
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/environment = location.return_air()
|
||||
|
||||
var/pressure = environment.return_pressure()
|
||||
var/total_moles = environment.total_moles()
|
||||
|
||||
user.show_message("\blue <B>Results:</B>", 1)
|
||||
if(abs(pressure - ONE_ATMOSPHERE) < 10)
|
||||
user.show_message("\blue Pressure: [round(pressure,0.1)] kPa", 1)
|
||||
else
|
||||
user.show_message("\red Pressure: [round(pressure,0.1)] kPa", 1)
|
||||
if(total_moles)
|
||||
var/o2_concentration = environment.oxygen/total_moles
|
||||
var/n2_concentration = environment.nitrogen/total_moles
|
||||
var/co2_concentration = environment.carbon_dioxide/total_moles
|
||||
var/plasma_concentration = environment.toxins/total_moles
|
||||
|
||||
var/unknown_concentration = 1-(o2_concentration+n2_concentration+co2_concentration+plasma_concentration)
|
||||
if(abs(n2_concentration - N2STANDARD) < 20)
|
||||
user.show_message("\blue Nitrogen: [round(n2_concentration*100)]%", 1)
|
||||
else
|
||||
user.show_message("\red Nitrogen: [round(n2_concentration*100)]%", 1)
|
||||
|
||||
if(abs(o2_concentration - O2STANDARD) < 2)
|
||||
user.show_message("\blue Oxygen: [round(o2_concentration*100)]%", 1)
|
||||
else
|
||||
user.show_message("\red Oxygen: [round(o2_concentration*100)]%", 1)
|
||||
|
||||
if(co2_concentration > 0.01)
|
||||
user.show_message("\red CO2: [round(co2_concentration*100)]%", 1)
|
||||
else
|
||||
user.show_message("\blue CO2: [round(co2_concentration*100)]%", 1)
|
||||
|
||||
if(plasma_concentration > 0.01)
|
||||
user.show_message("\red Plasma: [round(plasma_concentration*100)]%", 1)
|
||||
|
||||
if(unknown_concentration > 0.01)
|
||||
user.show_message("\red Unknown: [round(unknown_concentration*100)]%", 1)
|
||||
|
||||
user.show_message("\blue Temperature: [round(environment.temperature-T0C)]°C", 1)
|
||||
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/device/mass_spectrometer/New()
|
||||
..()
|
||||
var/datum/reagents/R = new/datum/reagents(5)
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
|
||||
/obj/item/device/mass_spectrometer/on_reagent_change()
|
||||
if(reagents.total_volume)
|
||||
icon_state = initial(icon_state) + "_s"
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
|
||||
/obj/item/device/mass_spectrometer/attack_self(mob/user as mob)
|
||||
if (user.stat)
|
||||
return
|
||||
if (crit_fail)
|
||||
user << "\red This device has critically failed and is no longer functional!"
|
||||
return
|
||||
if (!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
|
||||
user << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
if(reagents.total_volume)
|
||||
var/list/blood_traces = list()
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
if(R.id != "blood")
|
||||
reagents.clear_reagents()
|
||||
user << "\red The sample was contaminated! Please insert another sample"
|
||||
return
|
||||
else
|
||||
blood_traces = params2list(R.data["trace_chem"])
|
||||
break
|
||||
var/dat = "Trace Chemicals Found: "
|
||||
for(var/R in blood_traces)
|
||||
if(prob(reliability))
|
||||
if(details)
|
||||
dat += "[R] ([blood_traces[R]] units) "
|
||||
else
|
||||
dat += "[R] "
|
||||
recent_fail = 0
|
||||
else
|
||||
if(recent_fail)
|
||||
crit_fail = 1
|
||||
reagents.clear_reagents()
|
||||
return
|
||||
else
|
||||
recent_fail = 1
|
||||
user << "[dat]"
|
||||
reagents.clear_reagents()
|
||||
return
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/obj/item/weapon/cloaking_device
|
||||
name = "cloaking device"
|
||||
desc = "Use this to become invisible to the human eyesocket."
|
||||
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
|
||||
origin_tech = "magnets=3;syndicate=4"
|
||||
|
||||
|
||||
/obj/item/weapon/cloaking_device/attack_self(mob/user as mob)
|
||||
src.active = !( src.active )
|
||||
if (src.active)
|
||||
user << "\blue The cloaking device is now active."
|
||||
src.icon_state = "shield1"
|
||||
else
|
||||
user << "\blue The cloaking device is now inactive."
|
||||
src.icon_state = "shield0"
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/weapon/cloaking_device/emp_act(severity)
|
||||
active = 0
|
||||
icon_state = "shield0"
|
||||
if(ismob(loc))
|
||||
loc:update_icons()
|
||||
..()
|
||||
@@ -0,0 +1,263 @@
|
||||
/obj/item/device/taperecorder
|
||||
desc = "A device that can record up to an hour of dialogue and play it back. It automatically translates the content in playback."
|
||||
name = "universal recorder"
|
||||
icon_state = "taperecorderidle"
|
||||
item_state = "analyzer"
|
||||
w_class = 1.0
|
||||
m_amt = 60
|
||||
g_amt = 30
|
||||
var/emagged = 0.0
|
||||
var/recording = 0.0
|
||||
var/playing = 0.0
|
||||
var/timerecorded = 0.0
|
||||
var/playsleepseconds = 0.0
|
||||
var/list/storedinfo = new/list()
|
||||
var/list/timestamp = new/list()
|
||||
var/canprint = 1
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
throwforce = 2
|
||||
throw_speed = 4
|
||||
throw_range = 20
|
||||
|
||||
/obj/item/device/taperecorder/hear_talk(mob/living/M as mob, msg)
|
||||
if (recording)
|
||||
var/ending = copytext(msg, length(msg))
|
||||
src.timestamp+= src.timerecorded
|
||||
if (M.stuttering)
|
||||
src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] [M.name] stammers, \"[msg]\""
|
||||
return
|
||||
if (M.getBrainLoss() >= 60)
|
||||
src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] [M.name] gibbers, \"[msg]\""
|
||||
return
|
||||
if (ending == "?")
|
||||
src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] [M.name] asks, \"[msg]\""
|
||||
return
|
||||
else if (ending == "!")
|
||||
src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] [M.name] exclaims, \"[msg]\""
|
||||
return
|
||||
src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] [M.name] says, \"[msg]\""
|
||||
return
|
||||
|
||||
/obj/item/device/taperecorder/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (istype(W, /obj/item/weapon/card/emag))
|
||||
if (src.emagged == 0)
|
||||
src.emagged = 1
|
||||
src.recording = 0
|
||||
user << "\red PZZTTPFFFT"
|
||||
src.icon_state = "taperecorderidle"
|
||||
else
|
||||
user << "\red That is already emagged!"
|
||||
|
||||
/obj/item/device/taperecorder/proc/explode()
|
||||
var/turf/T = get_turf(src.loc)
|
||||
if (ismob(src.loc))
|
||||
var/mob/M = src.loc
|
||||
M.show_message("\red The [src] explodes!", 1)
|
||||
if(T)
|
||||
T.hotspot_expose(700,125)
|
||||
explosion(T, -1, -1, 0, 4)
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/item/device/taperecorder/verb/record()
|
||||
set name = "Start Recording"
|
||||
set category = "Object"
|
||||
if(usr.stat)
|
||||
usr << "Not when you're incapacitated."
|
||||
return
|
||||
if(src.emagged == 1)
|
||||
usr << "\red The tape recorder makes a scratchy noise."
|
||||
return
|
||||
src.icon_state = "taperecorderrecording"
|
||||
if(src.timerecorded < 3600 && src.playing == 0)
|
||||
usr << "\blue Recording started."
|
||||
src.recording = 1
|
||||
src.timestamp+= src.timerecorded
|
||||
src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] Recording started."
|
||||
for(src.timerecorded, src.timerecorded<3600)
|
||||
if(src.recording == 0)
|
||||
break
|
||||
src.timerecorded++
|
||||
sleep(10)
|
||||
src.recording = 0
|
||||
src.icon_state = "taperecorderidle"
|
||||
return
|
||||
else
|
||||
usr << "\red Either your tape recorder's memory is full, or it is currently playing back its memory."
|
||||
|
||||
|
||||
/obj/item/device/taperecorder/verb/stop()
|
||||
set name = "Stop"
|
||||
set category = "Object"
|
||||
|
||||
if(usr.stat)
|
||||
usr << "Not when you're incapacitated."
|
||||
return
|
||||
if (src.recording == 1)
|
||||
src.recording = 0
|
||||
src.timestamp+= src.timerecorded
|
||||
src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] Recording stopped."
|
||||
usr << "\blue Recording stopped."
|
||||
src.icon_state = "taperecorderidle"
|
||||
return
|
||||
else if (src.playing == 1)
|
||||
src.playing = 0
|
||||
var/turf/T = get_turf(src)
|
||||
for(var/mob/O in hearers(world.view-1, T))
|
||||
O.show_message("<font color=Maroon><B>Tape Recorder</B>: Playback stopped.</font>",2)
|
||||
src.icon_state = "taperecorderidle"
|
||||
return
|
||||
else
|
||||
usr << "\red Stop what?"
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/taperecorder/verb/clear_memory()
|
||||
set name = "Clear Memory"
|
||||
set category = "Object"
|
||||
|
||||
if(usr.stat)
|
||||
usr << "Not when you're incapicated."
|
||||
return
|
||||
if(src.emagged == 1)
|
||||
usr << "\red The tape recorder makes a scratchy noise."
|
||||
return
|
||||
if (src.recording == 1 || src.playing == 1)
|
||||
usr << "\red You can't clear the memory while playing or recording!"
|
||||
return
|
||||
else
|
||||
src.storedinfo -= src.storedinfo
|
||||
src.timestamp -= src.timestamp
|
||||
src.timerecorded = 0
|
||||
usr << "\blue Memory cleared."
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/taperecorder/verb/playback_memory()
|
||||
set name = "Playback Memory"
|
||||
set category = "Object"
|
||||
|
||||
if(usr.stat)
|
||||
usr << "Not when you're incapicated."
|
||||
return
|
||||
if (src.recording == 1)
|
||||
usr << "\red You can't playback when recording!"
|
||||
return
|
||||
if (src.playing == 1)
|
||||
usr << "\red You're already playing!"
|
||||
return
|
||||
src.playing = 1
|
||||
src.icon_state = "taperecorderplaying"
|
||||
usr << "\blue Playing started."
|
||||
for(var/i=1,src.timerecorded<3600,sleep(10 * (src.playsleepseconds) ))
|
||||
if (src.playing == 0)
|
||||
break
|
||||
if (src.storedinfo.len < i)
|
||||
break
|
||||
var/turf/T = get_turf(src)
|
||||
for(var/mob/O in hearers(world.view-1, T))
|
||||
O.show_message("<font color=Maroon><B>Tape Recorder</B>: [src.storedinfo[i]]</font>",2)
|
||||
if (src.storedinfo.len < i+1)
|
||||
src.playsleepseconds = 1
|
||||
sleep(10)
|
||||
T = get_turf(src)
|
||||
for(var/mob/O in hearers(world.view-1, T))
|
||||
O.show_message("<font color=Maroon><B>Tape Recorder</B>: End of recording.</font>",2)
|
||||
else
|
||||
src.playsleepseconds = src.timestamp[i+1] - src.timestamp[i]
|
||||
if (src.playsleepseconds > 19)
|
||||
sleep(10)
|
||||
T = get_turf(src)
|
||||
for(var/mob/O in hearers(world.view-1, T))
|
||||
O.show_message("<font color=Maroon><B>Tape Recorder</B>: Skipping [src.playsleepseconds] seconds of silence</font>",2)
|
||||
src.playsleepseconds = 1
|
||||
i++
|
||||
src.icon_state = "taperecorderidle"
|
||||
src.playing = 0
|
||||
if (src.emagged == 1.0)
|
||||
for(var/mob/O in hearers(world.view-1, get_turf(src)))
|
||||
O.show_message("Tape Recorder: This tape recorder will self destruct in <B>5</B>",2)
|
||||
sleep(10)
|
||||
for(var/mob/O in hearers(world.view-1, get_turf(src)))
|
||||
O.show_message("<B>4</B>",2)
|
||||
sleep(10)
|
||||
for(var/mob/O in hearers(world.view-1, get_turf(src)))
|
||||
O.show_message("<B>3</B>",2)
|
||||
sleep(10)
|
||||
for(var/mob/O in hearers(world.view-1, get_turf(src)))
|
||||
O.show_message("<B>2</B>",2)
|
||||
sleep(10)
|
||||
for(var/mob/O in hearers(world.view-1, get_turf(src)))
|
||||
O.show_message("<B>1</B>",2)
|
||||
sleep(10)
|
||||
src.explode()
|
||||
|
||||
|
||||
/obj/item/device/taperecorder/verb/print_transcript()
|
||||
set name = "Print Transcript"
|
||||
set category = "Object"
|
||||
|
||||
if (!canprint)
|
||||
usr << "\red The recorder can't print that fast!"
|
||||
return
|
||||
if (src.recording == 1 || src.playing == 1)
|
||||
usr << "\red You can't print the transcript while playing or recording!"
|
||||
return
|
||||
usr << "\blue Transcript printed."
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(get_turf(src))
|
||||
var/t1 = "<B>Transcript:</B><BR><BR>"
|
||||
for(var/i=1,src.storedinfo.len >= i,i++)
|
||||
t1 += "[src.storedinfo[i]]<BR>"
|
||||
P.info = t1
|
||||
P.name = "paper- 'Transcript'"
|
||||
canprint = 0
|
||||
sleep(300)
|
||||
canprint = 1
|
||||
|
||||
|
||||
/obj/item/device/taperecorder/attack_self(mob/user)
|
||||
if(src.recording == 0 && src.playing == 0)
|
||||
if(usr.stat)
|
||||
usr << "Not when you're incapacitated."
|
||||
return
|
||||
if(src.emagged == 1)
|
||||
usr << "\red The tape recorder makes a scratchy noise."
|
||||
return
|
||||
src.icon_state = "taperecorderrecording"
|
||||
if(src.timerecorded < 3600 && src.playing == 0)
|
||||
usr << "\blue Recording started."
|
||||
src.recording = 1
|
||||
src.timestamp+= src.timerecorded
|
||||
src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] Recording started."
|
||||
for(src.timerecorded, src.timerecorded<3600)
|
||||
if(src.recording == 0)
|
||||
break
|
||||
src.timerecorded++
|
||||
sleep(10)
|
||||
src.recording = 0
|
||||
src.icon_state = "taperecorderidle"
|
||||
return
|
||||
else
|
||||
usr << "\red Either your tape recorder's memory is full, or it is currently playing back its memory."
|
||||
else
|
||||
if(usr.stat)
|
||||
usr << "Not when you're incapacitated."
|
||||
return
|
||||
if (src.recording == 1)
|
||||
src.recording = 0
|
||||
src.timestamp+= src.timerecorded
|
||||
src.storedinfo += "\[[time2text(src.timerecorded*10,"mm:ss")]\] Recording stopped."
|
||||
usr << "\blue Recording stopped."
|
||||
src.icon_state = "taperecorderidle"
|
||||
return
|
||||
else if (src.playing == 1)
|
||||
src.playing = 0
|
||||
var/turf/T = get_turf(src)
|
||||
for(var/mob/O in hearers(world.view-1, T))
|
||||
O.show_message("<font color=Maroon><B>Tape Recorder</B>: Playback stopped.</font>",2)
|
||||
src.icon_state = "taperecorderidle"
|
||||
return
|
||||
else
|
||||
usr << "\red Stop what?"
|
||||
return
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
|
||||
Miscellaneous traitor devices
|
||||
|
||||
BATTERER
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
The Batterer, like a flashbang but 50% chance to knock people over. Can be either very
|
||||
effective or pretty fucking useless.
|
||||
|
||||
*/
|
||||
|
||||
/obj/item/device/batterer
|
||||
name = "mind batterer"
|
||||
desc = "A strange device with twin antennas."
|
||||
icon_state = "batterer"
|
||||
throwforce = 5
|
||||
w_class = 1.0
|
||||
throw_speed = 4
|
||||
throw_range = 10
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
item_state = "electronic"
|
||||
origin_tech = "magnets=3;combat=3;syndicate=3"
|
||||
|
||||
var/times_used = 0 //Number of times it's been used.
|
||||
var/max_uses = 2
|
||||
|
||||
|
||||
/obj/item/device/batterer/attack_self(mob/living/carbon/user as mob, flag = 0, emp = 0)
|
||||
if(!user) return
|
||||
if(times_used >= max_uses)
|
||||
user << "\red The mind batterer has been burnt out!"
|
||||
return
|
||||
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used [src] to knock down people in the area.</font>")
|
||||
|
||||
for(var/mob/living/carbon/human/M in orange(10, user))
|
||||
spawn()
|
||||
if(prob(50))
|
||||
|
||||
M.Weaken(rand(10,20))
|
||||
if(prob(25))
|
||||
M.Stun(rand(5,10))
|
||||
M << "\red <b>You feel a tremendous, paralyzing wave flood your mind.</b>"
|
||||
|
||||
else
|
||||
M << "\red <b>You feel a sudden, electric jolt travel through your head.</b>"
|
||||
|
||||
playsound(src.loc, 'sound/misc/interference.ogg', 50, 1)
|
||||
user << "\blue You trigger [src]."
|
||||
times_used += 1
|
||||
if(times_used >= max_uses)
|
||||
icon_state = "battererburnt"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
/obj/item/device/transfer_valve
|
||||
icon = 'icons/obj/assemblies.dmi'
|
||||
name = "tank transfer valve"
|
||||
icon_state = "valve_1"
|
||||
desc = "Regulates the transfer of air between two tanks"
|
||||
var/obj/item/weapon/tank/tank_one
|
||||
var/obj/item/weapon/tank/tank_two
|
||||
var/obj/item/device/attached_device
|
||||
var/mob/attacher = "Unknown"
|
||||
var/valve_open = 0
|
||||
var/toggle = 1
|
||||
|
||||
/obj/item/device/transfer_valve/proc/process_activation(var/obj/item/device/D)
|
||||
|
||||
/obj/item/device/transfer_valve/IsAssemblyHolder()
|
||||
return 1
|
||||
|
||||
/obj/item/device/transfer_valve/attackby(obj/item/item, mob/user)
|
||||
if(istype(item, /obj/item/weapon/tank))
|
||||
if(tank_one && tank_two)
|
||||
user << "<span class='warning'>There are already two tanks attached, remove one first.</span>"
|
||||
return
|
||||
|
||||
if(!tank_one)
|
||||
tank_one = item
|
||||
user.drop_item()
|
||||
item.loc = src
|
||||
user << "<span class='notice'>You attach the tank to the transfer valve.</span>"
|
||||
else if(!tank_two)
|
||||
tank_two = item
|
||||
user.drop_item()
|
||||
item.loc = src
|
||||
user << "<span class='notice'>You attach the tank to the transfer valve.</span>"
|
||||
|
||||
update_icon()
|
||||
//TODO: Have this take an assemblyholder
|
||||
else if(isassembly(item))
|
||||
var/obj/item/device/assembly/A = item
|
||||
if(A.secured)
|
||||
user << "<span class='notice'>The device is secured.</span>"
|
||||
return
|
||||
if(attached_device)
|
||||
user << "<span class='warning'>There is already an device attached to the valve, remove it first.</span>"
|
||||
return
|
||||
user.remove_from_mob(item)
|
||||
attached_device = A
|
||||
A.loc = src
|
||||
user << "<span class='notice'>You attach the [item] to the valve controls and secure it.</span>"
|
||||
A.holder = src
|
||||
A.toggle_secure()
|
||||
|
||||
bombers += "[key_name(user)] attached a [item] to a transfer valve."
|
||||
message_admins("[key_name_admin(user)] attached a [item] to a transfer valve.")
|
||||
log_game("[key_name_admin(user)] attached a [item] to a transfer valve.")
|
||||
attacher = key_name(user)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/transfer_valve/HasProximity(atom/movable/AM as mob|obj)
|
||||
if(!attached_device) return
|
||||
attached_device.HasProximity(AM)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/transfer_valve/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
|
||||
|
||||
/obj/item/device/transfer_valve/Topic(href, href_list)
|
||||
..()
|
||||
if ( usr.stat || usr.restrained() )
|
||||
return
|
||||
if (src.loc == usr)
|
||||
if(tank_one && href_list["tankone"])
|
||||
split_gases()
|
||||
valve_open = 0
|
||||
tank_one.loc = get_turf(src)
|
||||
tank_one = null
|
||||
update_icon()
|
||||
else if(tank_two && href_list["tanktwo"])
|
||||
split_gases()
|
||||
valve_open = 0
|
||||
tank_two.loc = get_turf(src)
|
||||
tank_two = null
|
||||
update_icon()
|
||||
else if(href_list["open"])
|
||||
toggle_valve()
|
||||
else if(attached_device)
|
||||
if(href_list["rem_device"])
|
||||
attached_device.loc = get_turf(src)
|
||||
attached_device:holder = null
|
||||
attached_device = null
|
||||
update_icon()
|
||||
if(href_list["device"])
|
||||
attached_device.attack_self(usr)
|
||||
|
||||
src.attack_self(usr)
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/device/transfer_valve/process_activation(var/obj/item/device/D)
|
||||
if(toggle)
|
||||
toggle = 0
|
||||
toggle_valve()
|
||||
spawn(50) // To stop a signal being spammed from a proxy sensor constantly going off or whatever
|
||||
toggle = 1
|
||||
|
||||
/obj/item/device/transfer_valve/update_icon()
|
||||
overlays = null
|
||||
underlays = null
|
||||
|
||||
if(!tank_one && !tank_two && !attached_device)
|
||||
icon_state = "valve_1"
|
||||
return
|
||||
icon_state = "valve"
|
||||
|
||||
if(tank_one)
|
||||
overlays += "[tank_one.icon_state]"
|
||||
if(tank_two)
|
||||
var/icon/J = new(icon, icon_state = "[tank_two.icon_state]")
|
||||
J.Shift(WEST, 13)
|
||||
underlays += J
|
||||
if(attached_device)
|
||||
overlays += "device"
|
||||
|
||||
/obj/item/device/transfer_valve/proc/merge_gases()
|
||||
tank_two.air_contents.volume += tank_one.air_contents.volume
|
||||
var/datum/gas_mixture/temp
|
||||
temp = tank_one.air_contents.remove_ratio(1)
|
||||
tank_two.air_contents.merge(temp)
|
||||
|
||||
/obj/item/device/transfer_valve/proc/split_gases()
|
||||
if (!valve_open || !tank_one || !tank_two)
|
||||
return
|
||||
var/ratio1 = tank_one.air_contents.volume/tank_two.air_contents.volume
|
||||
var/datum/gas_mixture/temp
|
||||
temp = tank_two.air_contents.remove_ratio(ratio1)
|
||||
tank_one.air_contents.merge(temp)
|
||||
tank_two.air_contents.volume -= tank_one.air_contents.volume
|
||||
|
||||
/*
|
||||
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).
|
||||
*/
|
||||
|
||||
/obj/item/device/transfer_valve/proc/toggle_valve()
|
||||
if(valve_open==0 && (tank_one && tank_two))
|
||||
valve_open = 1
|
||||
var/turf/bombturf = get_turf(src)
|
||||
var/bombarea = bombturf.loc.name
|
||||
var/log_str = "Bomb valve opened in [bombarea] with device attacher: [attacher]. Last touched by: [src.fingerprintslast]"
|
||||
bombers += log_str
|
||||
message_admins(log_str)
|
||||
log_game(log_str)
|
||||
merge_gases()
|
||||
spawn(20) // In case one tank bursts
|
||||
for (var/i=0,i<5,i++)
|
||||
src.update_icon()
|
||||
sleep(10)
|
||||
src.update_icon()
|
||||
|
||||
else if(valve_open==1 && (tank_one && tank_two))
|
||||
split_gases()
|
||||
valve_open = 0
|
||||
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
|
||||
/obj/item/device/transfer_valve/proc/c_state()
|
||||
return
|
||||
@@ -0,0 +1,385 @@
|
||||
//This could either be split into the proper DM files or placed somewhere else all together, but it'll do for now -Nodrak
|
||||
|
||||
/*
|
||||
|
||||
SYNDICATE UPLINKS
|
||||
|
||||
TO-DO:
|
||||
Once wizard is fixed, make sure the uplinks work correctly for it. wizard.dm is right now uncompiled and with broken code in it.
|
||||
|
||||
Clean the code up and comment it. Part of it is right now copy-pasted, with the general Topic() and modifications by Abi79.
|
||||
|
||||
I should take a more in-depth look at both the copy-pasted code for the individual uplinks below, and at each gamemode's code
|
||||
to see how uplinks are assigned and if there are any bugs with those.
|
||||
|
||||
|
||||
A list of items and costs is stored under the datum of every game mode, alongside the number of crystals, and the welcoming message.
|
||||
|
||||
*/
|
||||
|
||||
/obj/item/device/uplink
|
||||
var/welcome // Welcoming menu message
|
||||
var/items // List of items
|
||||
var/item_data // raw item text
|
||||
var/list/ItemList // Parsed list of items
|
||||
var/uses // Numbers of crystals
|
||||
// List of items not to shove in their hands.
|
||||
var/list/NotInHand = list(/obj/machinery/singularity_beacon/syndicate)
|
||||
|
||||
/obj/item/device/uplink/New()
|
||||
welcome = ticker.mode.uplink_welcome
|
||||
if(!item_data)
|
||||
items = dd_replacetext(ticker.mode.uplink_items, "\n", "") // Getting the text string of items
|
||||
else
|
||||
items = dd_replacetext(item_data)
|
||||
ItemList = dd_text2list(src.items, ";") // Parsing the items text string
|
||||
uses = ticker.mode.uplink_uses
|
||||
|
||||
//Let's build a menu!
|
||||
/obj/item/device/uplink/proc/generate_menu()
|
||||
|
||||
var/dat = "<B>[src.welcome]</B><BR>"
|
||||
dat += "Tele-Crystals left: [src.uses]<BR>"
|
||||
dat += "<HR>"
|
||||
dat += "<B>Request item:</B><BR>"
|
||||
dat += "<I>Each item costs a number of tele-crystals as indicated by the number following their name.</I><br><BR>"
|
||||
|
||||
var/cost
|
||||
var/item
|
||||
var/name
|
||||
var/path_obj
|
||||
var/path_text
|
||||
var/category_items = 1 //To prevent stupid :P
|
||||
|
||||
for(var/D in ItemList)
|
||||
var/list/O = stringsplit(D, ":")
|
||||
if(O.len != 3) //If it is not an actual item, make a break in the menu.
|
||||
if(O.len == 1) //If there is one item, it's probably a title
|
||||
dat += "<b>[O[1]]</b><br>"
|
||||
category_items = 0
|
||||
else //Else, it's a white space.
|
||||
if(category_items < 1) //If there were no itens in the last category...
|
||||
dat += "<i>We apologize, as you could not afford anything from this category.</i><br>"
|
||||
dat += "<br>"
|
||||
continue
|
||||
|
||||
path_text = O[1]
|
||||
cost = text2num(O[2])
|
||||
|
||||
if(cost>uses)
|
||||
continue
|
||||
|
||||
path_obj = text2path(path_text)
|
||||
item = new path_obj()
|
||||
name = O[3]
|
||||
del item
|
||||
|
||||
dat += "<A href='byond://?src=\ref[src];buy_item=[path_text];cost=[cost]'>[name]</A> ([cost])<BR>"
|
||||
category_items++
|
||||
|
||||
dat += "<A href='byond://?src=\ref[src];buy_item=random'>Random Item (??)</A><br>"
|
||||
dat += "<HR>"
|
||||
return dat
|
||||
|
||||
//If 'random' was selected
|
||||
/obj/item/device/uplink/proc/chooseRandomItem()
|
||||
var/list/randomItems = list()
|
||||
|
||||
//Sorry for all the ifs, but it makes it 1000 times easier for other people/servers to add or remove items from this list
|
||||
//Add only items the player can afford:
|
||||
if(uses > 19)
|
||||
randomItems.Add("/obj/item/weapon/circuitboard/teleporter") //Teleporter Circuit Board (costs 20, for nuke ops)
|
||||
|
||||
if(uses > 9)
|
||||
randomItems.Add("/obj/item/toy/syndicateballoon")//Syndicate Balloon
|
||||
randomItems.Add("/obj/item/weapon/storage/syndie_kit/imp_uplink") //Uplink Implanter
|
||||
randomItems.Add("/obj/item/weapon/storage/box/syndicate") //Syndicate bundle
|
||||
|
||||
//if(uses > 8) //Nothing... yet.
|
||||
//if(uses > 7) //Nothing... yet.
|
||||
|
||||
if(uses > 6)
|
||||
randomItems.Add("/obj/item/weapon/aiModule/syndicate") //Hacked AI Upload Module
|
||||
randomItems.Add("/obj/item/device/radio/beacon/syndicate") //Singularity Beacon
|
||||
|
||||
if(uses > 5)
|
||||
randomItems.Add("/obj/item/weapon/gun/projectile") //Revolver
|
||||
|
||||
if(uses > 4)
|
||||
randomItems.Add("/obj/item/weapon/gun/energy/crossbow") //Energy Crossbow
|
||||
randomItems.Add("/obj/item/device/powersink") //Powersink
|
||||
|
||||
if(uses > 3)
|
||||
randomItems.Add("/obj/item/weapon/melee/energy/sword") //Energy Sword
|
||||
randomItems.Add("/obj/item/clothing/mask/gas/voice") //Voice Changer
|
||||
randomItems.Add("/obj/item/device/chameleon") //Chameleon Projector
|
||||
|
||||
if(uses > 2)
|
||||
randomItems.Add("/obj/item/weapon/storage/emp_kit") //EMP Grenades
|
||||
randomItems.Add("/obj/item/weapon/pen/paralysis") //Paralysis Pen
|
||||
randomItems.Add("/obj/item/weapon/cartridge/syndicate") //Detomatix Cartridge
|
||||
randomItems.Add("/obj/item/clothing/under/chameleon") //Chameleon Jumpsuit
|
||||
randomItems.Add("/obj/item/weapon/card/id/syndicate") //Agent ID Card
|
||||
randomItems.Add("/obj/item/weapon/card/emag") //Cryptographic Sequencer
|
||||
randomItems.Add("/obj/item/weapon/storage/syndie_kit/space") //Syndicate Space Suit
|
||||
randomItems.Add("/obj/item/device/encryptionkey/binary") //Binary Translator Key
|
||||
randomItems.Add("/obj/item/weapon/storage/syndie_kit/imp_freedom") //Freedom Implant
|
||||
randomItems.Add("/obj/item/clothing/glasses/thermal/syndi") //Thermal Imaging Goggles
|
||||
|
||||
if(uses > 1)
|
||||
/*
|
||||
var/list/usrItems = usr.get_contents() //Checks to see if the user has a revolver before giving ammo
|
||||
var/hasRevolver = 0
|
||||
for(var/obj/I in usrItems) //Only add revolver ammo if the user has a gun that can shoot it
|
||||
if(istype(I,/obj/item/weapon/gun/projectile))
|
||||
hasRevolver = 1
|
||||
|
||||
if(hasRevolver) randomItems.Add("/obj/item/ammo_magazine/a357") //Revolver ammo
|
||||
*/
|
||||
randomItems.Add("/obj/item/ammo_magazine/a357") //Revolver ammo
|
||||
randomItems.Add("/obj/item/clothing/shoes/syndigaloshes") //No-Slip Syndicate Shoes
|
||||
randomItems.Add("/obj/item/weapon/plastique") //C4
|
||||
|
||||
if(uses > 0)
|
||||
randomItems.Add("/obj/item/weapon/soap/syndie") //Syndicate Soap
|
||||
randomItems.Add("/obj/item/weapon/storage/toolbox/syndicate") //Syndicate Toolbox
|
||||
|
||||
if(!randomItems.len)
|
||||
del(randomItems)
|
||||
return 0
|
||||
else
|
||||
var/buyItem = pick(randomItems)
|
||||
|
||||
switch(buyItem) //Ok, this gets a little messy, sorry.
|
||||
if("/obj/item/weapon/circuitboard/teleporter")
|
||||
uses -= 20
|
||||
if("/obj/item/toy/syndicateballoon" , "/obj/item/weapon/storage/syndie_kit/imp_uplink" , "/obj/item/weapon/storage/box/syndicate")
|
||||
uses -= 10
|
||||
if("/obj/item/weapon/aiModule/syndicate" , "/obj/item/device/radio/beacon/syndicate")
|
||||
uses -= 7
|
||||
if("/obj/item/weapon/gun/projectile")
|
||||
uses -= 6
|
||||
if("/obj/item/weapon/gun/energy/crossbow" , "/obj/item/device/powersink")
|
||||
uses -= 5
|
||||
if("/obj/item/weapon/melee/energy/sword" , "/obj/item/clothing/mask/gas/voice" , "/obj/item/device/chameleon")
|
||||
uses -= 4
|
||||
if("/obj/item/weapon/storage/emp_kit" , "/obj/item/weapon/pen/paralysis" , "/obj/item/weapon/cartridge/syndicate" , "/obj/item/clothing/under/chameleon" , \
|
||||
"/obj/item/weapon/card/id/syndicate" , "/obj/item/weapon/card/emag" , "/obj/item/weapon/storage/syndie_kit/space" , "/obj/item/device/encryptionkey/binary" , \
|
||||
"/obj/item/weapon/storage/syndie_kit/imp_freedom" , "/obj/item/clothing/glasses/thermal/syndi")
|
||||
uses -= 3
|
||||
if("/obj/item/ammo_magazine/a357" , "/obj/item/clothing/shoes/syndigaloshes" , "/obj/item/weapon/plastique")
|
||||
uses -= 2
|
||||
if("/obj/item/weapon/soap/syndie" , "/obj/item/weapon/storage/toolbox/syndicate")
|
||||
uses -= 1
|
||||
del(randomItems)
|
||||
return buyItem
|
||||
|
||||
/obj/item/device/uplink/proc/handleStatTracking(var/boughtItem)
|
||||
//For stat tracking, sorry for making it so ugly
|
||||
if(!boughtItem) return
|
||||
|
||||
switch(boughtItem)
|
||||
if("/obj/item/weapon/circuitboard/teleporter")
|
||||
feedback_add_details("traitor_uplink_items_bought","TP")
|
||||
if("/obj/item/toy/syndicateballoon")
|
||||
feedback_add_details("traitor_uplink_items_bought","BS")
|
||||
if("/obj/item/weapon/storage/syndie_kit/imp_uplink")
|
||||
feedback_add_details("traitor_uplink_items_bought","UI")
|
||||
if("/obj/item/weapon/storage/box/syndicate")
|
||||
feedback_add_details("traitor_uplink_items_bought","BU")
|
||||
if("/obj/item/weapon/aiModule/syndicate")
|
||||
feedback_add_details("traitor_uplink_items_bought","AI")
|
||||
if("/obj/item/device/radio/beacon/syndicate")
|
||||
feedback_add_details("traitor_uplink_items_bought","SB")
|
||||
if("/obj/item/weapon/gun/projectile")
|
||||
feedback_add_details("traitor_uplink_items_bought","RE")
|
||||
if("/obj/item/weapon/gun/energy/crossbow")
|
||||
feedback_add_details("traitor_uplink_items_bought","XB")
|
||||
if("/obj/item/device/powersink")
|
||||
feedback_add_details("traitor_uplink_items_bought","PS")
|
||||
if("/obj/item/weapon/melee/energy/sword")
|
||||
feedback_add_details("traitor_uplink_items_bought","ES")
|
||||
if("/obj/item/clothing/mask/gas/voice")
|
||||
feedback_add_details("traitor_uplink_items_bought","VC")
|
||||
if("/obj/item/device/chameleon")
|
||||
feedback_add_details("traitor_uplink_items_bought","CP")
|
||||
if("/obj/item/weapon/storage/emp_kit")
|
||||
feedback_add_details("traitor_uplink_items_bought","EM")
|
||||
if("/obj/item/weapon/pen/paralysis")
|
||||
feedback_add_details("traitor_uplink_items_bought","PP")
|
||||
if("/obj/item/weapon/cartridge/syndicate")
|
||||
feedback_add_details("traitor_uplink_items_bought","DC")
|
||||
if("/obj/item/clothing/under/chameleon")
|
||||
feedback_add_details("traitor_uplink_items_bought","CJ")
|
||||
if("/obj/item/weapon/card/id/syndicate")
|
||||
feedback_add_details("traitor_uplink_items_bought","AC")
|
||||
if("/obj/item/weapon/card/emag")
|
||||
feedback_add_details("traitor_uplink_items_bought","EC")
|
||||
if("/obj/item/weapon/storage/syndie_kit/space")
|
||||
feedback_add_details("traitor_uplink_items_bought","SS")
|
||||
if("/obj/item/device/encryptionkey/binary")
|
||||
feedback_add_details("traitor_uplink_items_bought","BT")
|
||||
if("/obj/item/weapon/storage/syndie_kit/imp_freedom")
|
||||
feedback_add_details("traitor_uplink_items_bought","FI")
|
||||
if("/obj/item/clothing/glasses/thermal/syndi")
|
||||
feedback_add_details("traitor_uplink_items_bought","TM")
|
||||
if("/obj/item/ammo_magazine/a357")
|
||||
feedback_add_details("traitor_uplink_items_bought","RA")
|
||||
if("/obj/item/clothing/shoes/syndigaloshes")
|
||||
feedback_add_details("traitor_uplink_items_bought","SH")
|
||||
if("/obj/item/weapon/plastique")
|
||||
feedback_add_details("traitor_uplink_items_bought","C4")
|
||||
if("/obj/item/weapon/soap/syndie")
|
||||
feedback_add_details("traitor_uplink_items_bought","SP")
|
||||
if("/obj/item/weapon/storage/toolbox/syndicate")
|
||||
feedback_add_details("traitor_uplink_items_bought","ST")
|
||||
|
||||
/obj/item/device/uplink/Topic(href, href_list)
|
||||
|
||||
if (href_list["buy_item"])
|
||||
if(href_list["buy_item"] == "random")
|
||||
var/boughtItem = chooseRandomItem()
|
||||
if(boughtItem)
|
||||
href_list["buy_item"] = boughtItem
|
||||
feedback_add_details("traitor_uplink_items_bought","RN")
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
else
|
||||
if(text2num(href_list["cost"]) > uses) // Not enough crystals for the item
|
||||
return 0
|
||||
|
||||
//if(usr:mind && ticker.mode.traitors[usr:mind])
|
||||
//var/datum/traitorinfo/info = ticker.mode.traitors[usr:mind]
|
||||
//info.spawnlist += href_list["buy_item"]
|
||||
|
||||
uses -= text2num(href_list["cost"])
|
||||
handleStatTracking(href_list["buy_item"]) //Note: chooseRandomItem handles it's own stat tracking. This proc is not meant for 'random'.
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
// HIDDEN UPLINK - Can be stored in anything but the host item has to have a trigger for it.
|
||||
/* How to create an uplink in 3 easy steps!
|
||||
|
||||
1. All obj/item 's have a hidden_uplink var. By default it's null. Give the item one with "new(src)", it must be in it's contents. Feel free to add "uses".
|
||||
|
||||
2. Code in the triggers. Use check_trigger for this, I recommend closing the item's menu with "usr << browse(null, "window=windowname") if it returns true.
|
||||
The var/value is the value that will be compared with the var/target. If they are equal it will activate the menu.
|
||||
|
||||
3. If you want the menu to stay until the users locks his uplink, add an active_uplink_check(mob/user as mob) in your interact/attack_hand proc.
|
||||
Then check if it's true, if true return. This will stop the normal menu appearing and will instead show the uplink menu.
|
||||
*/
|
||||
|
||||
/obj/item/device/uplink/hidden
|
||||
name = "Hidden Uplink."
|
||||
desc = "There is something wrong if you're examining this."
|
||||
var/active = 0
|
||||
var/list/purchase_log = list()
|
||||
|
||||
// The hidden uplink MUST be inside an obj/item's contents.
|
||||
/obj/item/device/uplink/hidden/New()
|
||||
spawn(2)
|
||||
if(!istype(src.loc, /obj/item))
|
||||
del(src)
|
||||
..()
|
||||
|
||||
// Toggles the uplink on and off. Normally this will bypass the item's normal functions and go to the uplink menu, if activated.
|
||||
/obj/item/device/uplink/hidden/proc/toggle()
|
||||
active = !active
|
||||
|
||||
// Directly trigger the uplink. Turn on if it isn't already.
|
||||
/obj/item/device/uplink/hidden/proc/trigger(mob/user as mob)
|
||||
if(!active)
|
||||
toggle()
|
||||
interact(user)
|
||||
|
||||
// Checks to see if the value meets the target. Like a frequency being a traitor_frequency, in order to unlock a headset.
|
||||
// If true, it accesses trigger() and returns 1. If it fails, it returns false. Use this to see if you need to close the
|
||||
// current item's menu.
|
||||
/obj/item/device/uplink/hidden/proc/check_trigger(mob/user as mob, var/value, var/target)
|
||||
if(value == target)
|
||||
trigger(user)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
// Interaction code. Gathers a list of items purchasable from the paren't uplink and displays it. It also adds a lock button.
|
||||
/obj/item/device/uplink/hidden/proc/interact(mob/user as mob)
|
||||
|
||||
var/dat = "<body link='yellow' alink='white' bgcolor='#601414'><font color='white'>"
|
||||
dat += src.generate_menu()
|
||||
dat += "<A href='byond://?src=\ref[src];lock=1'>Lock</a>"
|
||||
dat += "</font></body>"
|
||||
user << browse(dat, "window=hidden")
|
||||
onclose(user, "hidden")
|
||||
return
|
||||
|
||||
// The purchasing code.
|
||||
/obj/item/device/uplink/hidden/Topic(href, href_list)
|
||||
|
||||
if (usr.stat || usr.restrained())
|
||||
return
|
||||
|
||||
if (!( istype(usr, /mob/living/carbon/human)))
|
||||
return 0
|
||||
|
||||
if ((usr.contents.Find(src.loc) || (in_range(src.loc, usr) && istype(src.loc.loc, /turf))))
|
||||
usr.machine = src
|
||||
if(href_list["lock"])
|
||||
toggle()
|
||||
usr << browse(null, "window=hidden")
|
||||
return 1
|
||||
|
||||
if(..(href, href_list) == 1)
|
||||
var/path_obj = text2path(href_list["buy_item"])
|
||||
var/obj/I = new path_obj(get_turf(usr))
|
||||
if(ishuman(usr))
|
||||
var/mob/living/carbon/human/A = usr
|
||||
A.put_in_any_hand_if_possible(I)
|
||||
purchase_log += "[usr] ([usr.ckey]) bought [I]."
|
||||
interact(usr)
|
||||
return
|
||||
|
||||
// I placed this here because of how relevant it is.
|
||||
// You place this in your uplinkable item to check if an uplink is active or not.
|
||||
// If it is, it will display the uplink menu and return 1, else it'll return false.
|
||||
// If it returns true, I recommend closing the item's normal menu with "user << browse(null, "window=name")"
|
||||
/obj/item/proc/active_uplink_check(mob/user as mob)
|
||||
// Activates the uplink if it's active
|
||||
if(src.hidden_uplink)
|
||||
if(src.hidden_uplink.active)
|
||||
src.hidden_uplink.trigger(user)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
// PRESET UPLINKS
|
||||
// A collection of preset uplinks.
|
||||
//
|
||||
// Includes normal radio uplink, multitool uplink,
|
||||
// implant uplink (not the implant tool) and a preset headset uplink.
|
||||
|
||||
/obj/item/device/radio/uplink/New()
|
||||
hidden_uplink = new(src)
|
||||
|
||||
/obj/item/device/radio/uplink/attack_self(mob/user as mob)
|
||||
if(hidden_uplink)
|
||||
hidden_uplink.trigger(user)
|
||||
|
||||
/obj/item/device/multitool/uplink/New()
|
||||
hidden_uplink = new(src)
|
||||
|
||||
/obj/item/device/multitool/uplink/attack_self(mob/user as mob)
|
||||
if(hidden_uplink)
|
||||
hidden_uplink.trigger(user)
|
||||
|
||||
/obj/item/device/radio/headset/uplink
|
||||
traitor_frequency = 1445
|
||||
|
||||
/obj/item/device/radio/headset/uplink/New()
|
||||
..()
|
||||
hidden_uplink = new(src)
|
||||
hidden_uplink.uses = 10
|
||||
|
||||
|
||||
|
||||
@@ -1,120 +0,0 @@
|
||||
/proc/parse_zone(zone)
|
||||
if(zone == "r_hand") return "right hand"
|
||||
else if (zone == "l_hand") return "left hand"
|
||||
else if (zone == "l_arm") return "left arm"
|
||||
else if (zone == "r_arm") return "right arm"
|
||||
else if (zone == "l_leg") return "left leg"
|
||||
else if (zone == "r_leg") return "right leg"
|
||||
else if (zone == "l_foot") return "left foot"
|
||||
else if (zone == "r_foot") return "right foot"
|
||||
else return zone
|
||||
|
||||
/proc/text2dir(direction)
|
||||
switch(uppertext(direction))
|
||||
if("NORTH")
|
||||
return 1
|
||||
if("SOUTH")
|
||||
return 2
|
||||
if("EAST")
|
||||
return 4
|
||||
if("WEST")
|
||||
return 8
|
||||
if("NORTHEAST")
|
||||
return 5
|
||||
if("NORTHWEST")
|
||||
return 9
|
||||
if("SOUTHEAST")
|
||||
return 6
|
||||
if("SOUTHWEST")
|
||||
return 10
|
||||
else
|
||||
return
|
||||
|
||||
/proc/get_turf(turf/location)
|
||||
while(location)
|
||||
if(isturf(location))
|
||||
return location
|
||||
location = location.loc
|
||||
return null
|
||||
|
||||
/proc/get_turf_or_move(turf/location)
|
||||
return get_turf(location)
|
||||
|
||||
|
||||
|
||||
/proc/dir2text(direction)
|
||||
switch(direction)
|
||||
if(1.0)
|
||||
return "north"
|
||||
if(2.0)
|
||||
return "south"
|
||||
if(4.0)
|
||||
return "east"
|
||||
if(8.0)
|
||||
return "west"
|
||||
if(5.0)
|
||||
return "northeast"
|
||||
if(6.0)
|
||||
return "southeast"
|
||||
if(9.0)
|
||||
return "northwest"
|
||||
if(10.0)
|
||||
return "southwest"
|
||||
else
|
||||
return
|
||||
|
||||
/proc/is_type_in_list(var/atom/A, var/list/L)
|
||||
for(var/type in L)
|
||||
if(istype(A, type))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
//Quick type checks for some tools
|
||||
var/global/list/common_tools = list(
|
||||
/obj/item/weapon/cable_coil,
|
||||
/obj/item/weapon/wrench,
|
||||
/obj/item/weapon/weldingtool,
|
||||
/obj/item/weapon/screwdriver,
|
||||
/obj/item/weapon/wirecutters,
|
||||
/obj/item/device/multitool,
|
||||
/obj/item/weapon/crowbar)
|
||||
|
||||
/proc/istool(O)
|
||||
if(O && is_type_in_list(O, common_tools))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/iswrench(O)
|
||||
if(istype(O, /obj/item/weapon/wrench))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/iswelder(O)
|
||||
if(istype(O, /obj/item/weapon/weldingtool))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/iscoil(O)
|
||||
if(istype(O, /obj/item/weapon/cable_coil))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/iswirecutter(O)
|
||||
if(istype(O, /obj/item/weapon/wirecutters))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isscrewdriver(O)
|
||||
if(istype(O, /obj/item/weapon/screwdriver))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/ismultitool(O)
|
||||
if(istype(O, /obj/item/device/multitool))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/iscrowbar(O)
|
||||
if(istype(O, /obj/item/weapon/crowbar))
|
||||
return 1
|
||||
return 0
|
||||
@@ -0,0 +1,48 @@
|
||||
/obj/item/latexballon
|
||||
name = "Latex glove"
|
||||
desc = "" //todo
|
||||
icon_state = "latexballon"
|
||||
item_state = "lgloves"
|
||||
force = 0
|
||||
throwforce = 0
|
||||
w_class = 1.0
|
||||
throw_speed = 1
|
||||
throw_range = 15
|
||||
var/state
|
||||
var/datum/gas_mixture/air_contents = null
|
||||
|
||||
/obj/item/latexballon/proc/blow(obj/item/weapon/tank/tank)
|
||||
if (icon_state == "latexballon_bursted")
|
||||
return
|
||||
src.air_contents = tank.remove_air_volume(3)
|
||||
icon_state = "latexballon_blow"
|
||||
item_state = "latexballon"
|
||||
|
||||
/obj/item/latexballon/proc/burst()
|
||||
if (!air_contents)
|
||||
return
|
||||
playsound(src, 'sound/weapons/Gunshot.ogg', 100, 1)
|
||||
icon_state = "latexballon_bursted"
|
||||
item_state = "lgloves"
|
||||
loc.assume_air(air_contents)
|
||||
|
||||
/obj/item/latexballon/ex_act(severity)
|
||||
burst()
|
||||
switch(severity)
|
||||
if (1)
|
||||
del(src)
|
||||
if (2)
|
||||
if (prob(50))
|
||||
del(src)
|
||||
|
||||
/obj/item/latexballon/bullet_act()
|
||||
burst()
|
||||
|
||||
/obj/item/latexballon/temperature_expose(datum/gas_mixture/air, temperature, volume)
|
||||
if(temperature > T0C+100)
|
||||
burst()
|
||||
return
|
||||
|
||||
/obj/item/latexballon/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if (is_sharp(W))
|
||||
burst()
|
||||
@@ -1,56 +0,0 @@
|
||||
/obj/item/assembly/shock_kit
|
||||
name = "Shock Kit"
|
||||
desc = "This appears to be made from both an Electric Pack and a Helmet."
|
||||
icon_state = "shock_kit"
|
||||
var/obj/item/clothing/head/helmet/part1 = null
|
||||
var/obj/item/device/radio/electropack/part2 = null
|
||||
var/status = 0.0
|
||||
w_class = 5.0
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
|
||||
/obj/item/assembly/shock_kit/Del()
|
||||
//src.part1 = null
|
||||
del(src.part1)
|
||||
//src.part2 = null
|
||||
del(src.part2)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/assembly/shock_kit/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if ((istype(W, /obj/item/weapon/wrench) && !( src.status )))
|
||||
var/turf/T = src.loc
|
||||
if (ismob(T))
|
||||
T = T.loc
|
||||
src.part1.loc = T
|
||||
src.part2.loc = T
|
||||
src.part1.master = null
|
||||
src.part2.master = null
|
||||
src.part1 = null
|
||||
src.part2 = null
|
||||
del(src)
|
||||
return
|
||||
if (!( istype(W, /obj/item/weapon/screwdriver) ))
|
||||
return
|
||||
src.status = !( src.status )
|
||||
if (!src.status)
|
||||
user.show_message("\blue The shock pack is now secured!", 1)
|
||||
else
|
||||
user.show_message("\blue The shock pack is now unsecured!", 1)
|
||||
src.add_fingerprint(user)
|
||||
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()
|
||||
//*****
|
||||
//world << "Shock kit got r_signal"
|
||||
if (istype(src.loc, /obj/structure/stool/bed/chair/e_chair))
|
||||
var/obj/structure/stool/bed/chair/e_chair/C = src.loc
|
||||
//world << "Shock kit sending shock to EC"
|
||||
C.shock()
|
||||
return
|
||||
@@ -0,0 +1,181 @@
|
||||
// Targets, the things that actually get shot!
|
||||
/obj/item/target
|
||||
name = "shooting target"
|
||||
desc = "A shooting target."
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "target_h"
|
||||
density = 0
|
||||
var/hp = 1800
|
||||
var/icon/virtualIcon
|
||||
var/list/bulletholes = list()
|
||||
|
||||
Del()
|
||||
// if a target is deleted and associated with a stake, force stake to forget
|
||||
for(var/obj/structure/target_stake/T in view(3,src))
|
||||
if(T.pinned_target == src)
|
||||
T.pinned_target = null
|
||||
T.density = 1
|
||||
break
|
||||
..() // delete target
|
||||
|
||||
Move()
|
||||
..()
|
||||
// After target moves, check for nearby stakes. If associated, move to target
|
||||
for(var/obj/structure/target_stake/M in view(3,src))
|
||||
if(M.density == 0 && M.pinned_target == src)
|
||||
M.loc = loc
|
||||
|
||||
// This may seem a little counter-intuitive but I assure you that's for a purpose.
|
||||
// Stakes are the ones that carry targets, yes, but in the stake code we set
|
||||
// a stake's density to 0 meaning it can't be pushed anymore. Instead of pushing
|
||||
// the stake now, we have to push the target.
|
||||
|
||||
|
||||
|
||||
attackby(obj/item/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(WT.remove_fuel(0, user))
|
||||
overlays = null
|
||||
usr << "You slice off [src]'s uneven chunks of aluminum and scorch marks."
|
||||
return
|
||||
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
// taking pinned targets off!
|
||||
var/obj/structure/target_stake/stake
|
||||
for(var/obj/structure/target_stake/T in view(3,src))
|
||||
if(T.pinned_target == src)
|
||||
stake = T
|
||||
break
|
||||
|
||||
if(stake)
|
||||
if(stake.pinned_target)
|
||||
stake.density = 1
|
||||
density = 0
|
||||
layer = OBJ_LAYER
|
||||
|
||||
loc = user.loc
|
||||
if(ishuman(user))
|
||||
if(!user.get_active_hand())
|
||||
user.put_in_hands(src)
|
||||
user << "You take the target out of the stake."
|
||||
else
|
||||
src.loc = get_turf_loc(user)
|
||||
user << "You take the target out of the stake."
|
||||
|
||||
stake.pinned_target = null
|
||||
return
|
||||
|
||||
else
|
||||
..()
|
||||
|
||||
syndicate
|
||||
icon_state = "target_s"
|
||||
desc = "A shooting target that looks like a syndicate scum."
|
||||
hp = 2600 // i guess syndie targets are sturdier?
|
||||
alien
|
||||
icon_state = "target_q"
|
||||
desc = "A shooting target that looks like a xenomorphic alien."
|
||||
hp = 2350 // alium onest too kinda
|
||||
|
||||
/obj/item/target/bullet_act(var/obj/item/projectile/Proj)
|
||||
var/p_x = Proj.p_x + pick(0,0,0,0,0,-1,1) // really ugly way of coding "sometimes offset Proj.p_x!"
|
||||
var/p_y = Proj.p_y + pick(0,0,0,0,0,-1,1)
|
||||
var/decaltype = 1 // 1 - scorch, 2 - bullet
|
||||
|
||||
if(istype(/obj/item/projectile/bullet, Proj))
|
||||
decaltype = 2
|
||||
|
||||
|
||||
virtualIcon = new(icon, icon_state)
|
||||
|
||||
if( virtualIcon.GetPixel(p_x, p_y) ) // if the located pixel isn't blank (null)
|
||||
|
||||
hp -= Proj.damage
|
||||
if(hp <= 0)
|
||||
for(var/mob/O in oviewers())
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << "\red [src] breaks into tiny pieces and collapses!"
|
||||
del(src)
|
||||
|
||||
// Create a temporary object to represent the damage
|
||||
var/obj/bmark = new
|
||||
bmark.pixel_x = p_x
|
||||
bmark.pixel_y = p_y
|
||||
bmark.icon = 'icons/effects/effects.dmi'
|
||||
bmark.layer = 3.5
|
||||
bmark.icon_state = "scorch"
|
||||
|
||||
if(decaltype == 1)
|
||||
// Energy weapons are hot. they scorch!
|
||||
|
||||
// offset correction
|
||||
bmark.pixel_x--
|
||||
bmark.pixel_y--
|
||||
|
||||
if(Proj.damage >= 20 || istype(Proj, /obj/item/projectile/practice))
|
||||
bmark.icon_state = "scorch"
|
||||
bmark.dir = pick(NORTH,SOUTH,EAST,WEST) // random scorch design
|
||||
|
||||
|
||||
else
|
||||
bmark.icon_state = "light_scorch"
|
||||
else
|
||||
|
||||
// Bullets are hard. They make dents!
|
||||
bmark.icon_state = "dent"
|
||||
|
||||
if(Proj.damage >= 10 && bulletholes.len <= 35) // maximum of 35 bullet holes
|
||||
if(decaltype == 2) // bullet
|
||||
if(prob(Proj.damage+30)) // bullets make holes more commonly!
|
||||
new/datum/bullethole(src, bmark.pixel_x, bmark.pixel_y) // create new bullet hole
|
||||
else // Lasers!
|
||||
if(prob(Proj.damage-10)) // lasers make holes less commonly
|
||||
new/datum/bullethole(src, bmark.pixel_x, bmark.pixel_y) // create new bullet hole
|
||||
|
||||
// draw bullet holes
|
||||
for(var/datum/bullethole/B in bulletholes)
|
||||
|
||||
virtualIcon.DrawBox(null, B.b1x1, B.b1y, B.b1x2, B.b1y) // horizontal line, left to right
|
||||
virtualIcon.DrawBox(null, B.b2x, B.b2y1, B.b2x, B.b2y2) // vertical line, top to bottom
|
||||
|
||||
overlays += bmark // add the decal
|
||||
|
||||
icon = virtualIcon // apply bulletholes over decals
|
||||
|
||||
return
|
||||
|
||||
return -1 // the bullet/projectile goes through the target! Ie, you missed
|
||||
|
||||
|
||||
// Small memory holder entity for transparent bullet holes
|
||||
/datum/bullethole
|
||||
// First box
|
||||
var/b1x1 = 0
|
||||
var/b1x2 = 0
|
||||
var/b1y = 0
|
||||
|
||||
// Second box
|
||||
var/b2x = 0
|
||||
var/b2y1 = 0
|
||||
var/b2y2 = 0
|
||||
|
||||
New(var/obj/item/target/Target, var/pixel_x = 0, var/pixel_y = 0)
|
||||
if(!Target) return
|
||||
|
||||
// Randomize the first box
|
||||
b1x1 = pixel_x - pick(1,1,1,1,2,2,3,3,4)
|
||||
b1x2 = pixel_x + pick(1,1,1,1,2,2,3,3,4)
|
||||
b1y = pixel_y
|
||||
if(prob(35))
|
||||
b1y += rand(-4,4)
|
||||
|
||||
// Randomize the second box
|
||||
b2x = pixel_x
|
||||
if(prob(35))
|
||||
b2x += rand(-4,4)
|
||||
b2y1 = pixel_y + pick(1,1,1,1,2,2,3,3,4)
|
||||
b2y2 = pixel_y - pick(1,1,1,1,2,2,3,3,4)
|
||||
|
||||
Target.bulletholes.Add(src)
|
||||
@@ -0,0 +1,267 @@
|
||||
/*
|
||||
CONTAINS:
|
||||
GLASS SHEET
|
||||
REINFORCED GLASS SHEET
|
||||
SHARDS
|
||||
|
||||
*/
|
||||
|
||||
// GLASS
|
||||
|
||||
/obj/item/stack/sheet/glass/attack_self(mob/user as mob)
|
||||
construct_window(user)
|
||||
|
||||
/obj/item/stack/sheet/glass/attackby(obj/item/W, mob/user)
|
||||
..()
|
||||
if(istype(W,/obj/item/weapon/cable_coil))
|
||||
var/obj/item/weapon/cable_coil/CC = W
|
||||
if(CC.amount < 5)
|
||||
user << "\b There is not enough wire in this coil. You need 5 lengths."
|
||||
return
|
||||
CC.use(5)
|
||||
user << "\blue You attach wire to the [name]."
|
||||
new /obj/item/stack/light_w(user.loc)
|
||||
src.use(1)
|
||||
else if( istype(W, /obj/item/stack/rods) )
|
||||
var/obj/item/stack/rods/V = W
|
||||
var/obj/item/stack/sheet/rglass/RG = new (user.loc)
|
||||
RG.add_fingerprint(user)
|
||||
RG.add_to_stacks(user)
|
||||
V.use(1)
|
||||
var/obj/item/stack/sheet/glass/G = src
|
||||
src = null
|
||||
var/replace = (user.get_inactive_hand()==G)
|
||||
G.use(1)
|
||||
if (!G && !RG && replace)
|
||||
user.put_in_hands(RG)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/stack/sheet/glass/proc/construct_window(mob/user as mob)
|
||||
if(!user || !src) return 0
|
||||
if(!istype(user.loc,/turf)) return 0
|
||||
if(!user.IsAdvancedToolUser())
|
||||
user << "\red You don't have the dexterity to do this!"
|
||||
return 0
|
||||
var/title = "Sheet-Glass"
|
||||
title += " ([src.amount] sheet\s left)"
|
||||
switch(alert(title, "Would you like full tile glass or one direction?", "One Direction", "Full Window", "Cancel", null))
|
||||
if("One Direction")
|
||||
if(!src) return 1
|
||||
if(src.loc != user) return 1
|
||||
|
||||
var/list/directions = new/list(cardinal)
|
||||
var/i = 0
|
||||
for (var/obj/structure/window/win in user.loc)
|
||||
i++
|
||||
if(i >= 4)
|
||||
user << "\red There are too many windows in this location."
|
||||
return 1
|
||||
directions-=win.dir
|
||||
if(!(win.ini_dir in cardinal))
|
||||
user << "\red Can't let you do that."
|
||||
return 1
|
||||
|
||||
//Determine the direction. It will first check in the direction the person making the window is facing, if it finds an already made window it will try looking at the next cardinal direction, etc.
|
||||
var/dir_to_set = 2
|
||||
for(var/direction in list( user.dir, turn(user.dir,90), turn(user.dir,180), turn(user.dir,270) ))
|
||||
var/found = 0
|
||||
for(var/obj/structure/window/WT in user.loc)
|
||||
if(WT.dir == direction)
|
||||
found = 1
|
||||
if(!found)
|
||||
dir_to_set = direction
|
||||
break
|
||||
|
||||
var/obj/structure/window/W
|
||||
W = new /obj/structure/window/basic( user.loc, 0 )
|
||||
W.dir = dir_to_set
|
||||
W.ini_dir = W.dir
|
||||
W.anchored = 0
|
||||
src.use(1)
|
||||
if("Full Window")
|
||||
if(!src) return 1
|
||||
if(src.loc != user) return 1
|
||||
if(src.amount < 2)
|
||||
user << "\red You need more glass to do that."
|
||||
return 1
|
||||
if(locate(/obj/structure/window) in user.loc)
|
||||
user << "\red There is a window in the way."
|
||||
return 1
|
||||
var/obj/structure/window/W
|
||||
W = new /obj/structure/window/basic( user.loc, 0 )
|
||||
W.dir = SOUTHWEST
|
||||
W.ini_dir = SOUTHWEST
|
||||
W.anchored = 0
|
||||
src.use(2)
|
||||
return 0
|
||||
|
||||
|
||||
// REINFORCED GLASS
|
||||
|
||||
/obj/item/stack/sheet/rglass/attack_self(mob/user as mob)
|
||||
construct_window(user)
|
||||
|
||||
/obj/item/stack/sheet/rglass/proc/construct_window(mob/user as mob)
|
||||
if(!user || !src) return 0
|
||||
if(!istype(user.loc,/turf)) return 0
|
||||
if(!user.IsAdvancedToolUser())
|
||||
user << "\red You don't have the dexterity to do this!"
|
||||
return 0
|
||||
var/title = "Sheet Reinf. Glass"
|
||||
title += " ([src.amount] sheet\s left)"
|
||||
switch(input(title, "Would you like full tile glass a one direction glass pane or a windoor?") in list("One Direction", "Full Window", "Windoor", "Cancel"))
|
||||
if("One Direction")
|
||||
if(!src) return 1
|
||||
if(src.loc != user) return 1
|
||||
var/list/directions = new/list(cardinal)
|
||||
var/i = 0
|
||||
for (var/obj/structure/window/win in user.loc)
|
||||
i++
|
||||
if(i >= 4)
|
||||
user << "\red There are too many windows in this location."
|
||||
return 1
|
||||
directions-=win.dir
|
||||
if(!(win.ini_dir in cardinal))
|
||||
user << "\red Can't let you do that."
|
||||
return 1
|
||||
|
||||
//Determine the direction. It will first check in the direction the person making the window is facing, if it finds an already made window it will try looking at the next cardinal direction, etc.
|
||||
var/dir_to_set = 2
|
||||
for(var/direction in list( user.dir, turn(user.dir,90), turn(user.dir,180), turn(user.dir,270) ))
|
||||
var/found = 0
|
||||
for(var/obj/structure/window/WT in user.loc)
|
||||
if(WT.dir == direction)
|
||||
found = 1
|
||||
if(!found)
|
||||
dir_to_set = direction
|
||||
break
|
||||
|
||||
var/obj/structure/window/W
|
||||
W = new /obj/structure/window/reinforced( user.loc, 1 )
|
||||
W.state = 0
|
||||
W.dir = dir_to_set
|
||||
W.ini_dir = W.dir
|
||||
W.anchored = 0
|
||||
src.use(1)
|
||||
|
||||
if("Full Window")
|
||||
if(!src) return 1
|
||||
if(src.loc != user) return 1
|
||||
if(src.amount < 2)
|
||||
user << "\red You need more glass to do that."
|
||||
return 1
|
||||
if(locate(/obj/structure/window) in user.loc)
|
||||
user << "\red There is a window in the way."
|
||||
return 1
|
||||
var/obj/structure/window/W
|
||||
W = new /obj/structure/window/reinforced( user.loc, 1 )
|
||||
W.state = 0
|
||||
W.dir = SOUTHWEST
|
||||
W.ini_dir = SOUTHWEST
|
||||
W.anchored = 0
|
||||
src.use(2)
|
||||
|
||||
if("Windoor")
|
||||
if(!src || src.loc != user) return 1
|
||||
|
||||
if(isturf(user.loc) && locate(/obj/structure/windoor_assembly/, user.loc))
|
||||
user << "\red There is already a windoor assembly in that location."
|
||||
return 1
|
||||
|
||||
if(isturf(user.loc) && locate(/obj/machinery/door/window/, user.loc))
|
||||
user << "\red There is already a windoor in that location."
|
||||
return 1
|
||||
|
||||
if(src.amount < 5)
|
||||
user << "\red You need more glass to do that."
|
||||
return 1
|
||||
|
||||
var/obj/structure/windoor_assembly/WD
|
||||
WD = new /obj/structure/windoor_assembly(user.loc)
|
||||
WD.state = "01"
|
||||
WD.anchored = 0
|
||||
src.use(5)
|
||||
switch(user.dir)
|
||||
if(SOUTH)
|
||||
WD.dir = SOUTH
|
||||
WD.ini_dir = SOUTH
|
||||
if(EAST)
|
||||
WD.dir = EAST
|
||||
WD.ini_dir = EAST
|
||||
if(WEST)
|
||||
WD.dir = WEST
|
||||
WD.ini_dir = WEST
|
||||
else//If the user is facing northeast. northwest, southeast, southwest or north, default to north
|
||||
WD.dir = NORTH
|
||||
WD.ini_dir = NORTH
|
||||
else
|
||||
return 1
|
||||
|
||||
|
||||
return 0
|
||||
|
||||
// SHARDS
|
||||
|
||||
/obj/item/weapon/shard/Bump()
|
||||
|
||||
spawn( 0 )
|
||||
if (prob(20))
|
||||
src.force = 15
|
||||
else
|
||||
src.force = 4
|
||||
..()
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/weapon/shard/New()
|
||||
|
||||
//****RM
|
||||
//world<<"New shard at [x],[y],[z]"
|
||||
|
||||
src.icon_state = pick("large", "medium", "small")
|
||||
switch(src.icon_state)
|
||||
if("small")
|
||||
src.pixel_x = rand(-12, 12)
|
||||
src.pixel_y = rand(-12, 12)
|
||||
if("medium")
|
||||
src.pixel_x = rand(-8, 8)
|
||||
src.pixel_y = rand(-8, 8)
|
||||
if("large")
|
||||
src.pixel_x = rand(-5, 5)
|
||||
src.pixel_y = rand(-5, 5)
|
||||
else
|
||||
return
|
||||
|
||||
/obj/item/weapon/shard/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if ( istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(WT.remove_fuel(0, user))
|
||||
var/obj/item/stack/sheet/glass/NG = new (user.loc)
|
||||
for (var/obj/item/stack/sheet/glass/G in user.loc)
|
||||
if(G==NG)
|
||||
continue
|
||||
if(G.amount>=G.max_amount)
|
||||
continue
|
||||
G.attackby(NG, user)
|
||||
usr << "You add the newly-formed glass to the stack. It now contains [NG.amount] sheets."
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/shard/HasEntered(AM as mob|obj)
|
||||
if(ismob(AM))
|
||||
var/mob/M = AM
|
||||
M << "\red <B>You step in the broken glass!</B>"
|
||||
playsound(src.loc, 'sound/effects/glass_step.ogg', 50, 1)
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(!H.shoes)
|
||||
var/datum/organ/external/affecting = H.get_organ(pick("l_leg", "r_leg"))
|
||||
H.Weaken(3)
|
||||
if(affecting.take_damage(5, 0))
|
||||
H.UpdateDamageIcon()
|
||||
H.updatehealth()
|
||||
..()
|
||||
@@ -1,10 +1,3 @@
|
||||
/*
|
||||
CONTAINS:
|
||||
MEDICAL
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/obj/item/stack/medical/attack(mob/living/carbon/M as mob, mob/user as mob)
|
||||
if (M.stat == 2)
|
||||
@@ -0,0 +1,163 @@
|
||||
/*
|
||||
CONTAINS:
|
||||
RODS
|
||||
METAL
|
||||
REINFORCED METAL
|
||||
FLOOR TILES
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// RODS
|
||||
|
||||
/obj/item/stack/rods/attackby(obj/item/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
|
||||
if(amount < 2)
|
||||
user << "\red You need at least two rods to do this."
|
||||
return
|
||||
|
||||
if(WT.remove_fuel(0,user))
|
||||
var/obj/item/stack/sheet/metal/new_item = new(usr.loc)
|
||||
new_item.add_to_stacks(usr)
|
||||
for (var/mob/M in viewers(src))
|
||||
M.show_message("\red [src] is shaped into metal by [user.name] with the weldingtool.", 3, "\red You hear welding.", 2)
|
||||
var/obj/item/stack/rods/R = src
|
||||
src = null
|
||||
var/replace = (user.get_inactive_hand()==R)
|
||||
R.use(2)
|
||||
if (!R && replace)
|
||||
user.put_in_hands(new_item)
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
/obj/item/stack/rods/attack_self(mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
|
||||
if(!istype(user.loc,/turf)) return 0
|
||||
|
||||
if (locate(/obj/structure/grille, usr.loc))
|
||||
for(var/obj/structure/grille/G in usr.loc)
|
||||
if (G.destroyed)
|
||||
G.health = 10
|
||||
G.density = 1
|
||||
G.destroyed = 0
|
||||
G.icon_state = "grille"
|
||||
use(1)
|
||||
else
|
||||
return 1
|
||||
else
|
||||
if(amount < 2)
|
||||
user << "\blue You need at least two rods to do this."
|
||||
return
|
||||
usr << "\blue Assembling grille..."
|
||||
if (!do_after(usr, 10))
|
||||
return
|
||||
var/obj/structure/grille/F = new /obj/structure/grille/ ( usr.loc )
|
||||
usr << "\blue You assemble a grille"
|
||||
F.add_fingerprint(usr)
|
||||
use(2)
|
||||
return
|
||||
|
||||
|
||||
|
||||
// METAL SHEET
|
||||
|
||||
// /datum/stack_recipe/New(title, result_type, req_amount, res_amount, max_res_amount, time, one_per_turf, on_floor = 0)
|
||||
var/global/list/datum/stack_recipe/metal_recipes = list ( \
|
||||
new/datum/stack_recipe("stool", /obj/structure/stool, one_per_turf = 1, on_floor = 1), \
|
||||
new/datum/stack_recipe("chair", /obj/structure/stool/bed/chair, one_per_turf = 1, on_floor = 1), \
|
||||
new/datum/stack_recipe("bed", /obj/structure/stool/bed, 2, one_per_turf = 1, on_floor = 1), \
|
||||
new/datum/stack_recipe("table parts", /obj/item/weapon/table_parts, 2), \
|
||||
new/datum/stack_recipe("rack parts", /obj/item/weapon/rack_parts), \
|
||||
new/datum/stack_recipe("closet", /obj/structure/closet, 2, time = 15, one_per_turf = 1, on_floor = 1), \
|
||||
null, \
|
||||
new/datum/stack_recipe("canister", /obj/machinery/portable_atmospherics/canister, 10, time = 15, one_per_turf = 1, on_floor = 1), \
|
||||
null, \
|
||||
new/datum/stack_recipe("floor tile", /obj/item/stack/tile/plasteel, 1, 4, 20), \
|
||||
new/datum/stack_recipe("metal rod", /obj/item/stack/rods, 1, 2, 60), \
|
||||
null, \
|
||||
new/datum/stack_recipe("computer frame", /obj/structure/computerframe, 5, time = 25, one_per_turf = 1, on_floor = 1), \
|
||||
new/datum/stack_recipe("wall girders", /obj/structure/girder, 2, time = 50, one_per_turf = 1, on_floor = 1), \
|
||||
new/datum/stack_recipe("airlock assembly", /obj/structure/door_assembly, 4, time = 50, one_per_turf = 1, on_floor = 1), \
|
||||
new/datum/stack_recipe("machine frame", /obj/machinery/constructable_frame/machine_frame, 5, time = 25, one_per_turf = 1, on_floor = 1), \
|
||||
new/datum/stack_recipe("turret frame", /obj/machinery/porta_turret_construct, 5, time = 25, one_per_turf = 1, on_floor = 1), \
|
||||
null, \
|
||||
new/datum/stack_recipe("apc frame", /obj/item/apc_frame, 2), \
|
||||
new/datum/stack_recipe("grenade casing", /obj/item/weapon/grenade/chem_grenade), \
|
||||
new/datum/stack_recipe("light fixture frame", /obj/item/light_fixture_frame, 2), \
|
||||
new/datum/stack_recipe("small light fixture frame", /obj/item/light_fixture_frame/small, 1), \
|
||||
null, \
|
||||
new/datum/stack_recipe("iron door", /obj/structure/mineral_door/iron, 20, one_per_turf = 1, on_floor = 1), \
|
||||
)
|
||||
|
||||
/obj/item/stack/sheet/metal
|
||||
New(var/loc, var/amount=null)
|
||||
recipes = metal_recipes
|
||||
return ..()
|
||||
|
||||
// REINFORCED METAL SHEET
|
||||
|
||||
// /datum/stack_recipe/New(title, result_type, req_amount, res_amount, max_res_amount, time, one_per_turf, on_floor = 0)
|
||||
var/global/list/datum/stack_recipe/plasteel_recipes = list ( \
|
||||
new/datum/stack_recipe("AI core", /obj/structure/AIcore, 4, time = 50, one_per_turf = 1), \
|
||||
)
|
||||
|
||||
/obj/item/stack/sheet/plasteel
|
||||
New(var/loc, var/amount=null)
|
||||
recipes = plasteel_recipes
|
||||
return ..()
|
||||
|
||||
|
||||
|
||||
// TILES
|
||||
|
||||
/obj/item/stack/tile/plasteel/New(var/loc, var/amount=null)
|
||||
..()
|
||||
src.pixel_x = rand(1, 14)
|
||||
src.pixel_y = rand(1, 14)
|
||||
return
|
||||
|
||||
/*
|
||||
/obj/item/stack/tile/plasteel/attack_self(mob/user as mob)
|
||||
if (usr.stat)
|
||||
return
|
||||
var/T = user.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
user << "\red You must be on the ground!"
|
||||
return
|
||||
if (!( istype(T, /turf/space) ))
|
||||
user << "\red You cannot build on or repair this turf!"
|
||||
return
|
||||
src.build(T)
|
||||
src.add_fingerprint(user)
|
||||
use(1)
|
||||
return
|
||||
*/
|
||||
|
||||
/obj/item/stack/tile/plasteel/proc/build(turf/S as turf)
|
||||
S.ReplaceWithPlating()
|
||||
// var/turf/simulated/floor/W = S.ReplaceWithFloor()
|
||||
// W.make_plating()
|
||||
return
|
||||
|
||||
// CARDBOARD SHEET - BubbleWrap
|
||||
|
||||
// /datum/stack_recipe/New(title, result_type, req_amount, res_amount, max_res_amount, time, one_per_turf, on_floor = 0)
|
||||
var/global/list/datum/stack_recipe/cardboard_recipes = list ( \
|
||||
new/datum/stack_recipe("box", /obj/item/weapon/storage/box), \
|
||||
new/datum/stack_recipe("light tubes", /obj/item/weapon/storage/lightbox/tubes), \
|
||||
new/datum/stack_recipe("light bulbs", /obj/item/weapon/storage/lightbox/bulbs), \
|
||||
new/datum/stack_recipe("mouse traps", /obj/item/weapon/storage/mousetraps), \
|
||||
new/datum/stack_recipe("cardborg suit", /obj/item/clothing/suit/cardborg, 3), \
|
||||
new/datum/stack_recipe("cardborg helmet", /obj/item/clothing/head/cardborg), \
|
||||
new/datum/stack_recipe("pizza box", /obj/item/pizzabox), \
|
||||
)
|
||||
|
||||
/obj/item/stack/sheet/cardboard
|
||||
New(var/loc, var/amount=null)
|
||||
recipes = cardboard_recipes
|
||||
return ..()
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
CONTAINS:
|
||||
SANDSTONE
|
||||
DIAMOND
|
||||
URANIUM
|
||||
PLASMA
|
||||
GOLD
|
||||
SILVER
|
||||
*/
|
||||
|
||||
//Sandstone
|
||||
var/global/list/datum/stack_recipe/sandstone_recipes = list ( \
|
||||
new/datum/stack_recipe("pile of dirt", /obj/machinery/hydroponics/soil, 3, time = 10, one_per_turf = 1, on_floor = 1), \
|
||||
new/datum/stack_recipe("sandstone door", /obj/structure/mineral_door/sandstone, 10, one_per_turf = 1, on_floor = 1), \
|
||||
/* new/datum/stack_recipe("sandstone wall", ???), \
|
||||
new/datum/stack_recipe("sandstone floor", ???),\*/
|
||||
)
|
||||
|
||||
/obj/item/stack/sheet/sandstone
|
||||
New(var/loc, var/amount=null)
|
||||
recipes = sandstone_recipes
|
||||
return ..()
|
||||
|
||||
//Diamond
|
||||
var/global/list/datum/stack_recipe/diamond_recipes = list ( \
|
||||
new/datum/stack_recipe("diamond door", /obj/structure/mineral_door/transparent/diamond, 10, one_per_turf = 1, on_floor = 1), \
|
||||
)
|
||||
|
||||
/obj/item/stack/sheet/diamond
|
||||
New(var/loc, var/amount=null)
|
||||
recipes = diamond_recipes
|
||||
return ..()
|
||||
|
||||
//Uranium
|
||||
var/global/list/datum/stack_recipe/uranium_recipes = list ( \
|
||||
new/datum/stack_recipe("uranium door", /obj/structure/mineral_door/uranium, 10, one_per_turf = 1, on_floor = 1), \
|
||||
)
|
||||
|
||||
/obj/item/stack/sheet/uranium
|
||||
New(var/loc, var/amount=null)
|
||||
recipes = uranium_recipes
|
||||
return ..()
|
||||
|
||||
//Plasma
|
||||
var/global/list/datum/stack_recipe/plasma_recipes = list ( \
|
||||
new/datum/stack_recipe("plasma door", /obj/structure/mineral_door/transparent/plasma, 10, one_per_turf = 1, on_floor = 1), \
|
||||
)
|
||||
|
||||
/obj/item/stack/sheet/plasma
|
||||
New(var/loc, var/amount=null)
|
||||
recipes = plasma_recipes
|
||||
return ..()
|
||||
|
||||
//Gold
|
||||
var/global/list/datum/stack_recipe/gold_recipes = list ( \
|
||||
new/datum/stack_recipe("golden door", /obj/structure/mineral_door/gold, 10, one_per_turf = 1, on_floor = 1), \
|
||||
)
|
||||
|
||||
/obj/item/stack/sheet/gold
|
||||
New(var/loc, var/amount=null)
|
||||
recipes = gold_recipes
|
||||
return ..()
|
||||
|
||||
//Silver
|
||||
var/global/list/datum/stack_recipe/silver_recipes = list ( \
|
||||
new/datum/stack_recipe("silver door", /obj/structure/mineral_door/silver, 10, one_per_turf = 1, on_floor = 1), \
|
||||
)
|
||||
|
||||
/obj/item/stack/sheet/silver
|
||||
New(var/loc, var/amount=null)
|
||||
recipes = silver_recipes
|
||||
return ..()
|
||||
@@ -0,0 +1,223 @@
|
||||
/*
|
||||
Base object for stackable items.
|
||||
Stackable items are:
|
||||
metal
|
||||
rmetal
|
||||
glass
|
||||
rglass
|
||||
wood planks
|
||||
floor tiles
|
||||
metal rods
|
||||
*/
|
||||
|
||||
/obj/item/stack/New(var/loc, var/amount=null)
|
||||
..()
|
||||
if (amount)
|
||||
src.amount=amount
|
||||
|
||||
return
|
||||
|
||||
/obj/item/stack/examine()
|
||||
set src in view(1)
|
||||
..()
|
||||
usr << "There are [src.amount] [src.singular_name]\s in the stack."
|
||||
return
|
||||
|
||||
/obj/item/stack/proc/use(var/amount)
|
||||
src.amount-=amount
|
||||
if (src.amount<=0)
|
||||
var/oldsrc = src
|
||||
src = null //dont kill proc after del()
|
||||
if(usr)
|
||||
usr.before_take_item(oldsrc)
|
||||
del(oldsrc)
|
||||
return
|
||||
|
||||
/obj/item/stack/proc/add_to_stacks(mob/usr as mob)
|
||||
var/obj/item/stack/oldsrc = src
|
||||
src = null
|
||||
for (var/obj/item/stack/item in usr.loc)
|
||||
if (item==oldsrc)
|
||||
continue
|
||||
if (!istype(item, oldsrc.type))
|
||||
continue
|
||||
if (item.amount>=item.max_amount)
|
||||
continue
|
||||
oldsrc.attackby(item, usr)
|
||||
usr << "You add new [item.singular_name] to the stack. It now contains [item.amount] [item.singular_name]\s."
|
||||
if(!oldsrc)
|
||||
break
|
||||
|
||||
/obj/item/stack/attack_hand(mob/user as mob)
|
||||
if (user.get_inactive_hand() == src)
|
||||
var/obj/item/stack/F = new src.type( user, amount=1)
|
||||
F.copy_evidences(src)
|
||||
user.put_in_hands(F)
|
||||
src.add_fingerprint(user)
|
||||
F.add_fingerprint(user)
|
||||
use(1)
|
||||
if (src && usr.machine==src)
|
||||
spawn(0) src.interact(usr)
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/stack/attackby(obj/item/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (istype(W, src.type))
|
||||
var/obj/item/stack/S = W
|
||||
if (S.amount >= max_amount)
|
||||
return 1
|
||||
var/to_transfer as num
|
||||
if (user.get_inactive_hand()==src)
|
||||
to_transfer = 1
|
||||
else
|
||||
to_transfer = min(src.amount, S.max_amount-S.amount)
|
||||
S.amount+=to_transfer
|
||||
if (S && usr.machine==S)
|
||||
spawn(0) S.interact(usr)
|
||||
src.use(to_transfer)
|
||||
if (src && usr.machine==src)
|
||||
spawn(0) src.interact(usr)
|
||||
else return ..()
|
||||
|
||||
/obj/item/stack/proc/copy_evidences(obj/item/stack/from as obj)
|
||||
src.blood_DNA = from.blood_DNA
|
||||
src.fingerprints = from.fingerprints
|
||||
src.fingerprintshidden = from.fingerprintshidden
|
||||
src.fingerprintslast = from.fingerprintslast
|
||||
//TODO bloody overlay
|
||||
|
||||
/datum/stack_recipe
|
||||
var/title = "ERROR"
|
||||
var/result_type
|
||||
var/req_amount = 1
|
||||
var/res_amount = 1
|
||||
var/max_res_amount = 1
|
||||
var/time = 0
|
||||
var/one_per_turf = 0
|
||||
var/on_floor = 0
|
||||
New(title, result_type, req_amount = 1, res_amount = 1, max_res_amount = 1, time = 0, one_per_turf = 0, on_floor = 0)
|
||||
src.title = title
|
||||
src.result_type = result_type
|
||||
src.req_amount = req_amount
|
||||
src.res_amount = res_amount
|
||||
src.max_res_amount = max_res_amount
|
||||
src.time = time
|
||||
src.one_per_turf = one_per_turf
|
||||
src.on_floor = on_floor
|
||||
|
||||
/obj/item/stack
|
||||
var/list/datum/stack_recipe/recipes
|
||||
origin_tech = "materials=1"
|
||||
|
||||
/obj/item/stack/attack_self(mob/user as mob)
|
||||
interact(user)
|
||||
|
||||
/obj/item/stack/proc/interact(mob/user as mob)
|
||||
if (!recipes)
|
||||
return
|
||||
if (!src || amount<=0)
|
||||
user << browse(null, "window=stack")
|
||||
user.machine = src //for correct work of onclose
|
||||
var/t1 = text("<HTML><HEAD><title>Constructions from []</title></HEAD><body><TT>Amount Left: []<br>", src, src.amount)
|
||||
for(var/i=1;i<=recipes.len,i++)
|
||||
var/datum/stack_recipe/R = recipes[i]
|
||||
if (isnull(R))
|
||||
t1 += "<hr>"
|
||||
continue
|
||||
if (i>1 && !isnull(recipes[i-1]))
|
||||
t1+="<br>"
|
||||
var/max_multiplier = round(src.amount / R.req_amount)
|
||||
var/title as text
|
||||
var/can_build = 1
|
||||
can_build = can_build && (max_multiplier>0)
|
||||
/*
|
||||
if (R.one_per_turf)
|
||||
can_build = can_build && !(locate(R.result_type) in usr.loc)
|
||||
if (R.on_floor)
|
||||
can_build = can_build && istype(usr.loc, /turf/simulated/floor)
|
||||
*/
|
||||
if (R.res_amount>1)
|
||||
title+= "[R.res_amount]x [R.title]\s"
|
||||
else
|
||||
title+= "[R.title]"
|
||||
title+= " ([R.req_amount] [src.singular_name]\s)"
|
||||
if (can_build)
|
||||
t1 += text("<A href='?src=\ref[];make=[]'>[]</A> ", src, i, title)
|
||||
else
|
||||
t1 += text("[]", title)
|
||||
continue
|
||||
if (R.max_res_amount>1 && max_multiplier>1)
|
||||
max_multiplier = min(max_multiplier, round(R.max_res_amount/R.res_amount))
|
||||
t1 += " |"
|
||||
var/list/multipliers = list(5,10,25)
|
||||
for (var/n in multipliers)
|
||||
if (max_multiplier>=n)
|
||||
t1 += " <A href='?src=\ref[src];make=[i];multiplier=[n]'>[n*R.res_amount]x</A>"
|
||||
if (!(max_multiplier in multipliers))
|
||||
t1 += " <A href='?src=\ref[src];make=[i];multiplier=[max_multiplier]'>[max_multiplier*R.res_amount]x</A>"
|
||||
|
||||
t1 += "</TT></body></HTML>"
|
||||
user << browse(t1, "window=stack")
|
||||
onclose(user, "stack")
|
||||
return
|
||||
|
||||
/obj/item/stack/Topic(href, href_list)
|
||||
..()
|
||||
if ((usr.restrained() || usr.stat || usr.get_active_hand() != src))
|
||||
return
|
||||
if (href_list["make"])
|
||||
if (src.amount < 1) del(src) //Never should happen
|
||||
|
||||
var/datum/stack_recipe/R = recipes[text2num(href_list["make"])]
|
||||
var/multiplier = text2num(href_list["multiplier"])
|
||||
if (!multiplier) multiplier = 1
|
||||
if (src.amount < R.req_amount*multiplier)
|
||||
if (R.req_amount*multiplier>1)
|
||||
usr << "\red You haven't got enough [src] to build \the [R.req_amount*multiplier] [R.title]\s!"
|
||||
else
|
||||
usr << "\red You haven't got enough [src] to build \the [R.title]!"
|
||||
return
|
||||
if (R.one_per_turf && (locate(R.result_type) in usr.loc))
|
||||
usr << "\red There is another [R.title] here!"
|
||||
return
|
||||
if (R.on_floor && !istype(usr.loc, /turf/simulated/floor))
|
||||
usr << "\red \The [R.title] must be constructed on the floor!"
|
||||
return
|
||||
if (R.time)
|
||||
usr << "\blue Building [R.title] ..."
|
||||
if (!do_after(usr, R.time))
|
||||
return
|
||||
if (src.amount < R.req_amount*multiplier)
|
||||
return
|
||||
var/atom/O = new R.result_type( usr.loc )
|
||||
O.dir = usr.dir
|
||||
if (R.max_res_amount>1)
|
||||
var/obj/item/stack/new_item = O
|
||||
new_item.amount = R.res_amount*multiplier
|
||||
//new_item.add_to_stacks(usr)
|
||||
src.amount-=R.req_amount*multiplier
|
||||
if (src.amount<=0)
|
||||
var/oldsrc = src
|
||||
src = null //dont kill proc after del()
|
||||
usr.before_take_item(oldsrc)
|
||||
del(oldsrc)
|
||||
if (istype(O,/obj/item))
|
||||
usr.put_in_hands(O)
|
||||
O.add_fingerprint(usr)
|
||||
//BubbleWrap - so newly formed boxes are empty
|
||||
if ( istype(O, /obj/item/weapon/storage) )
|
||||
for (var/obj/item/I in O)
|
||||
del(I)
|
||||
//BubbleWrap END
|
||||
if (src && usr.machine==src) //do not reopen closed window
|
||||
spawn( 0 )
|
||||
src.interact(usr)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/stack/Del()
|
||||
if (src && usr && usr.machine==src)
|
||||
usr << browse(null, "window=stack")
|
||||
..()
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
CONTAINS:
|
||||
WOOD PLANKS
|
||||
*/
|
||||
|
||||
var/global/list/datum/stack_recipe/wood_recipes = list ( \
|
||||
new/datum/stack_recipe("wooden sandals", /obj/item/clothing/shoes/sandal, 1), \
|
||||
new/datum/stack_recipe("table parts", /obj/item/weapon/table_parts/wood, 2), \
|
||||
new/datum/stack_recipe("wood floor tile", /obj/item/stack/tile/wood, 1, 4, 20), \
|
||||
new/datum/stack_recipe("wooden barricade", /obj/structure/barricade/wooden, 5, time = 50, one_per_turf = 1, on_floor = 1), \
|
||||
new/datum/stack_recipe("wooden door", /obj/structure/mineral_door/wood, 10, time = 20, one_per_turf = 1, on_floor = 1), \
|
||||
new/datum/stack_recipe("coffin", /obj/structure/closet/coffin, 5, time = 15, one_per_turf = 1, on_floor = 1), \
|
||||
)
|
||||
|
||||
/obj/item/stack/sheet/wood/New(var/loc, var/amount=null)
|
||||
recipes = wood_recipes
|
||||
return ..()
|
||||
@@ -1,3 +1,6 @@
|
||||
//Items labled as 'trash' for the trash bag.
|
||||
//TODO: Make this an item var or something...
|
||||
|
||||
//Added by Jack Rost
|
||||
/obj/item/trash
|
||||
icon = 'icons/obj/trash.dmi'
|
||||
@@ -51,80 +54,4 @@
|
||||
icon_state = "liquidfood"
|
||||
|
||||
/obj/item/trash/attack(mob/M as mob, mob/living/user as mob)
|
||||
return
|
||||
|
||||
/obj/item/weapon/trashbag
|
||||
icon = 'icons/obj/trash.dmi'
|
||||
icon_state = "trashbag0"
|
||||
item_state = "trashbag"
|
||||
name = "Trash bag"
|
||||
desc = "A heavy-duty, no fun allowed trash bag."
|
||||
var/mode = 1; //0 = pick one at a time, 1 = pick all on tile
|
||||
var/capacity = 25; //the number of trash it can carry.
|
||||
flags = FPRINT | TABLEPASS
|
||||
slot_flags = SLOT_BELT
|
||||
w_class = 2.0
|
||||
|
||||
/obj/item/weapon/trashbag/update_icon()
|
||||
if(contents.len == 0)
|
||||
icon_state = "trashbag0"
|
||||
else if(contents.len < 12)
|
||||
icon_state = "trashbag1"
|
||||
else if(contents.len < 25)
|
||||
icon_state = "trashbag2"
|
||||
else icon_state = "trashbag3"
|
||||
|
||||
/obj/item/weapon/trashbag/attackby(obj/item/W as obj, mob/living/user as mob)
|
||||
..()
|
||||
if (contents.len < capacity)
|
||||
if (istype(W, /obj/item))
|
||||
if (W.w_class <= 2)
|
||||
var/obj/item/O = W
|
||||
src.contents += O
|
||||
else
|
||||
user << "\blue The bag is full!"
|
||||
|
||||
/obj/item/weapon/trashbag/attack_self(mob/living/user as mob)
|
||||
|
||||
if(contents.len > 0)
|
||||
for(var/obj/item/I in src.contents)
|
||||
I.loc = user.loc
|
||||
update_icon()
|
||||
user << "\blue You drop all the trash onto the floor."
|
||||
|
||||
/obj/item/weapon/trashbag/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, flag)
|
||||
if(istype(target, /obj/item))
|
||||
var/obj/item/W = target
|
||||
if(W.w_class <= 2)
|
||||
if(mode == 1)
|
||||
if(contents.len < capacity) //slightly redundant, but it makes it prettier in the chatbox. -Pete
|
||||
user << "\blue You pick up all the trash."
|
||||
for(var/obj/item/O in get_turf(W))
|
||||
if(istype(O, /obj/item/weapon/disk/nuclear)) continue //No nuke disks - Nodrak
|
||||
if(contents.len < capacity)
|
||||
if(O.w_class <= 2)
|
||||
contents += O;
|
||||
else
|
||||
user << "\blue The bag is full!"
|
||||
break
|
||||
else
|
||||
user << "\blue The bag is full!"
|
||||
else
|
||||
if(istype(W, /obj/item/weapon/disk/nuclear)) return //No nuke disks - Nodrak
|
||||
if(contents.len < capacity)
|
||||
contents += W;
|
||||
else
|
||||
user << "\blue The bag is full!"
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/trashbag/verb/toggle_mode()
|
||||
set name = "Switch Bag Method"
|
||||
set category = "Object"
|
||||
|
||||
mode = !mode
|
||||
switch (mode)
|
||||
if(1)
|
||||
usr << "The bag now picks up all trash in a tile at once."
|
||||
else
|
||||
usr << "The bag now picks up one piece of trash at a time."
|
||||
return
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/obj/item/weapon/bedsheet/ex_act(severity)
|
||||
if (severity <= 2)
|
||||
del(src)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/weapon/bedsheet/attack_self(mob/user as mob)
|
||||
user.drop_item()
|
||||
if(layer == initial(layer))
|
||||
layer = 5
|
||||
else
|
||||
layer = initial(layer)
|
||||
add_fingerprint(user)
|
||||
return
|
||||
@@ -1,17 +1,16 @@
|
||||
/* Cards
|
||||
* Contains:
|
||||
* DATA CARD
|
||||
* ID CARD
|
||||
* FINGERPRINT CARD HOLDER
|
||||
* FINGERPRINT CARD
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
CONTAINS:
|
||||
DATA CARD
|
||||
ID CARD
|
||||
FINGERPRINT CARD HOLDER
|
||||
FINGERPRINT CARD
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
// DATA CARDS
|
||||
|
||||
* DATA CARDS - Used for the teleporter
|
||||
*/
|
||||
/obj/item/weapon/card/data/verb/label(t as text)
|
||||
set name = "Label Disk"
|
||||
set category = "Object"
|
||||
@@ -25,10 +24,9 @@ FINGERPRINT CARD
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
// ID CARDS
|
||||
|
||||
/*
|
||||
* ID CARDS
|
||||
*/
|
||||
/obj/item/weapon/card/id/attack_self(mob/user as mob)
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("[] shows you: \icon[] []: assignment: []", user, src, src.name, src.assignment), 1)
|
||||
@@ -73,8 +71,9 @@ FINGERPRINT CARD
|
||||
..()
|
||||
|
||||
|
||||
// FINGERPRINT HOLDER
|
||||
|
||||
/*
|
||||
* FINGERPRINT HOLDER
|
||||
*/
|
||||
/obj/item/weapon/fcardholder/attack_self(mob/user as mob)
|
||||
var/dat = "<B>Clipboard</B><BR>"
|
||||
for(var/obj/item/weapon/f_card/P in src)
|
||||
@@ -168,10 +167,9 @@ FINGERPRINT CARD
|
||||
|
||||
|
||||
|
||||
|
||||
// FINGERPRINT CARD
|
||||
|
||||
|
||||
/*
|
||||
* FINGERPRINT CARD
|
||||
*/
|
||||
/obj/item/weapon/f_card/examine()
|
||||
set src in view(2)
|
||||
|
||||
@@ -191,25 +189,6 @@ FINGERPRINT CARD
|
||||
return dat
|
||||
return
|
||||
|
||||
/*
|
||||
/obj/item/weapon/f_card/attack_hand(mob/user as mob)
|
||||
|
||||
if ((user.r_hand == src || user.l_hand == src))
|
||||
src.add_fingerprint(user)
|
||||
var/obj/item/weapon/f_card/F = new /obj/item/weapon/f_card( user )
|
||||
F.amount = 1
|
||||
src.amount--
|
||||
user.put_in_hands(F)
|
||||
F.add_fingerprint(user)
|
||||
if (src.amount < 1)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
else
|
||||
..()
|
||||
return
|
||||
*/
|
||||
|
||||
/obj/item/weapon/f_card/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (istype(W, /obj/item/weapon/f_card))
|
||||
|
||||
@@ -106,9 +106,6 @@ ZIPPO
|
||||
if(M.lit > 0)
|
||||
light("\red [user] lights their [name] with their [W].")
|
||||
|
||||
else if(istype(W, /obj/item/device/assembly/igniter))
|
||||
light("\red [user] fiddles with [W], and manages to light their [name].")
|
||||
|
||||
//can't think of any other way to update the overlays :<
|
||||
user.update_inv_wear_mask(0)
|
||||
user.update_inv_l_hand(0)
|
||||
@@ -456,7 +453,7 @@ ZIPPO
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message("\red After a few attempts, [user] manages to light the [src], they however burn their finger in the process.", 1)
|
||||
|
||||
user.total_luminosity += 2
|
||||
user.SetLuminosity(user.luminosity + 2)
|
||||
processing_objects.Add(src)
|
||||
else
|
||||
src.lit = 0
|
||||
@@ -469,7 +466,7 @@ ZIPPO
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message("\red [user] quietly shuts off the [src].", 1)
|
||||
|
||||
user.total_luminosity -= 2
|
||||
user.SetLuminosity(user.luminosity - 2)
|
||||
processing_objects.Remove(src)
|
||||
else
|
||||
return ..()
|
||||
@@ -498,13 +495,13 @@ ZIPPO
|
||||
|
||||
pickup(mob/user)
|
||||
if(lit)
|
||||
src.sd_SetLuminosity(0)
|
||||
user.total_luminosity += 2
|
||||
src.SetLuminosity(0)
|
||||
user.SetLuminosity(user.luminosity+2)
|
||||
return
|
||||
|
||||
|
||||
dropped(mob/user)
|
||||
if(lit)
|
||||
user.total_luminosity -= 2
|
||||
src.sd_SetLuminosity(2)
|
||||
user.SetLuminosity(user.luminosity-2)
|
||||
src.SetLuminosity(2)
|
||||
return
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
/* Clown Items
|
||||
* Contains:
|
||||
* Banana Peels
|
||||
* Soap
|
||||
* Bike Horns
|
||||
*/
|
||||
|
||||
/*
|
||||
CONTAINS:
|
||||
NO MORE BANANA, NOW YOU CAN EAT IT. GO SEE OTHER FOOD STUFFS.
|
||||
BANANA PEEL
|
||||
SOAP
|
||||
BIKE HORN
|
||||
|
||||
*/
|
||||
|
||||
* Banana Peals
|
||||
*/
|
||||
/obj/item/weapon/bananapeel/HasEntered(AM as mob|obj)
|
||||
if (istype(AM, /mob/living/carbon))
|
||||
var/mob/M = AM
|
||||
@@ -19,6 +20,9 @@ BIKE HORN
|
||||
M.Stun(4)
|
||||
M.Weaken(2)
|
||||
|
||||
/*
|
||||
* Soap
|
||||
*/
|
||||
/obj/item/weapon/soap/HasEntered(AM as mob|obj) //EXACTLY the same as bananapeel for now, so it makes sense to put it in the same dm -- Urist
|
||||
if (istype(AM, /mob/living/carbon))
|
||||
var/mob/M = AM
|
||||
@@ -50,6 +54,9 @@ BIKE HORN
|
||||
return
|
||||
..()
|
||||
|
||||
/*
|
||||
* Bike Horns
|
||||
*/
|
||||
/obj/item/weapon/bikehorn/attack_self(mob/user as mob)
|
||||
if (spam_flag == 0)
|
||||
spam_flag = 1
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/obj/item/weapon/dice
|
||||
name = "d6"
|
||||
desc = "A dice with six sides."
|
||||
var/sides = 6
|
||||
icon = 'icons/obj/dice.dmi'
|
||||
icon_state = "d66"
|
||||
|
||||
/obj/item/weapon/dice/New()
|
||||
icon_state = "[name][rand(sides)]"
|
||||
|
||||
/obj/item/weapon/dice/d20
|
||||
name = "d20"
|
||||
desc = "A dice with twenty sides."
|
||||
sides = 20
|
||||
icon_state = "d2020"
|
||||
|
||||
/obj/item/weapon/dice/attack_self(mob/user as mob)
|
||||
var/result = rand(1, sides)
|
||||
var/comment = ""
|
||||
if(sides == 20 && result == 20)
|
||||
comment = "Nat 20!"
|
||||
else if(sides == 20 && result == 1)
|
||||
comment = "Ouch, bad luck."
|
||||
icon_state = "[name][result]"
|
||||
user.visible_message("<span class='notice'>[user] has thrown [src]. It lands on [result]. [comment]</span>", \
|
||||
"<span class='notice'>You throw [src]. It lands on a [result]. [comment]</span>", \
|
||||
"<span class='notice'>You hear [src] landing on a [result]. [comment]</span>")
|
||||
@@ -0,0 +1,132 @@
|
||||
/obj/item/weapon/extinguisher
|
||||
name = "fire extinguisher"
|
||||
desc = "A traditional red fire extinguisher."
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "fire_extinguisher0"
|
||||
item_state = "fire_extinguisher"
|
||||
hitsound = 'sound/weapons/smash.ogg'
|
||||
flags = FPRINT | USEDELAY | TABLEPASS | CONDUCT
|
||||
throwforce = 10
|
||||
w_class = 3.0
|
||||
throw_speed = 2
|
||||
throw_range = 10
|
||||
force = 10.0
|
||||
m_amt = 90
|
||||
attack_verb = list("slammed", "whacked", "bashed", "thunked", "battered", "bludgeoned", "thrashed")
|
||||
var/max_water = 50
|
||||
var/last_use = 1.0
|
||||
var/safety = 1
|
||||
var/sprite_name = "fire_extinguisher"
|
||||
|
||||
/obj/item/weapon/extinguisher/mini
|
||||
name = "fire extinguisher"
|
||||
desc = "A light and compact fibreglass-framed model fire extinguisher."
|
||||
icon_state = "miniFE0"
|
||||
item_state = "miniFE"
|
||||
hitsound = null //it is much lighter, after all.
|
||||
flags = FPRINT | USEDELAY | TABLEPASS
|
||||
throwforce = 2
|
||||
w_class = 2.0
|
||||
force = 3.0
|
||||
m_amt = 0
|
||||
max_water = 30
|
||||
sprite_name = "miniFE"
|
||||
|
||||
/obj/item/weapon/extinguisher/New()
|
||||
var/datum/reagents/R = new/datum/reagents(max_water)
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
R.add_reagent("water", max_water)
|
||||
|
||||
/obj/item/weapon/extinguisher/examine()
|
||||
set src in usr
|
||||
|
||||
usr << text("\icon[] [] contains [] units of water left!", src, src.name, src.reagents.total_volume)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/extinguisher/attack_self(mob/user as mob)
|
||||
safety = !safety
|
||||
src.icon_state = "[sprite_name][!safety]"
|
||||
src.desc = "The safety is [safety ? "on" : "off"]."
|
||||
user << "The safety is [safety ? "on" : "off"]."
|
||||
return
|
||||
|
||||
/obj/item/weapon/extinguisher/afterattack(atom/target, mob/user , flag)
|
||||
//TODO; Add support for reagents in water.
|
||||
|
||||
if( istype(target, /obj/structure/reagent_dispensers/watertank) && get_dist(src,target) <= 1)
|
||||
var/obj/o = target
|
||||
o.reagents.trans_to(src, 50)
|
||||
user << "\blue \The [src] is now refilled"
|
||||
playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6)
|
||||
return
|
||||
|
||||
if (!safety)
|
||||
if (src.reagents.total_volume < 1)
|
||||
usr << "\red \The [src] is empty."
|
||||
return
|
||||
|
||||
if (world.time < src.last_use + 20)
|
||||
return
|
||||
|
||||
src.last_use = world.time
|
||||
|
||||
playsound(src.loc, 'sound/effects/extinguish.ogg', 75, 1, -3)
|
||||
|
||||
var/direction = get_dir(src,target)
|
||||
|
||||
if(usr.buckled && isobj(usr.buckled) && !usr.buckled.anchored )
|
||||
spawn(0)
|
||||
var/obj/B = usr.buckled
|
||||
var/movementdirection = turn(direction,180)
|
||||
B.Move(get_step(usr,movementdirection), movementdirection)
|
||||
sleep(1)
|
||||
B.Move(get_step(usr,movementdirection), movementdirection)
|
||||
sleep(1)
|
||||
B.Move(get_step(usr,movementdirection), movementdirection)
|
||||
sleep(1)
|
||||
B.Move(get_step(usr,movementdirection), movementdirection)
|
||||
sleep(2)
|
||||
B.Move(get_step(usr,movementdirection), movementdirection)
|
||||
sleep(2)
|
||||
B.Move(get_step(usr,movementdirection), movementdirection)
|
||||
sleep(3)
|
||||
B.Move(get_step(usr,movementdirection), movementdirection)
|
||||
sleep(3)
|
||||
B.Move(get_step(usr,movementdirection), movementdirection)
|
||||
sleep(3)
|
||||
B.Move(get_step(usr,movementdirection), movementdirection)
|
||||
|
||||
var/turf/T = get_turf(target)
|
||||
var/turf/T1 = get_step(T,turn(direction, 90))
|
||||
var/turf/T2 = get_step(T,turn(direction, -90))
|
||||
|
||||
var/list/the_targets = list(T,T1,T2)
|
||||
|
||||
for(var/a=0, a<5, a++)
|
||||
spawn(0)
|
||||
var/obj/effect/effect/water/W = new /obj/effect/effect/water( get_turf(src) )
|
||||
var/turf/my_target = pick(the_targets)
|
||||
var/datum/reagents/R = new/datum/reagents(5)
|
||||
if(!W) return
|
||||
W.reagents = R
|
||||
R.my_atom = W
|
||||
if(!W || !src) return
|
||||
src.reagents.trans_to(W,1)
|
||||
for(var/b=0, b<5, b++)
|
||||
step_towards(W,my_target)
|
||||
if(!W) return
|
||||
W.reagents.reaction(get_turf(W))
|
||||
for(var/atom/atm in get_turf(W))
|
||||
if(!W) return
|
||||
W.reagents.reaction(atm)
|
||||
if(W.loc == my_target) break
|
||||
sleep(2)
|
||||
|
||||
if((istype(usr.loc, /turf/space)) || (usr.lastarea.has_gravity == 0))
|
||||
user.inertia_dir = get_dir(target, user)
|
||||
step(user, user.inertia_dir)
|
||||
else
|
||||
return ..()
|
||||
return
|
||||
@@ -1,17 +1,5 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
|
||||
|
||||
/obj/item/weapon/flamethrower/full/New(var/loc)
|
||||
..()
|
||||
weldtool = new/obj/item/weapon/weldingtool(src)
|
||||
weldtool.status = 0
|
||||
igniter = new/obj/item/device/assembly/igniter(src)
|
||||
igniter.secured = 0
|
||||
src.status = 1
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/flamethrower
|
||||
name = "flamethrower"
|
||||
icon = 'icons/obj/flamethrower.dmi'
|
||||
@@ -245,3 +233,14 @@
|
||||
target.hotspot_expose((ptank.air_contents.temperature*2) + 380,500) // -- More of my "how do I shot fire?" dickery. -- TLE
|
||||
//location.hotspot_expose(1000,500,1)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/flamethrower/full/New(var/loc)
|
||||
..()
|
||||
weldtool = new/obj/item/weapon/weldingtool(src)
|
||||
weldtool.status = 0
|
||||
igniter = new/obj/item/device/assembly/igniter(src)
|
||||
igniter.secured = 0
|
||||
src.status = 1
|
||||
update_icon()
|
||||
return
|
||||
+67
-119
@@ -1,86 +1,12 @@
|
||||
/* Gifts and wrapping paper
|
||||
* Contains:
|
||||
* Gifts
|
||||
* Wrapping Paper
|
||||
*/
|
||||
|
||||
/*
|
||||
CONTAINS:
|
||||
WRAPPING PAPER
|
||||
GIFTS
|
||||
BEDSHEET BIN
|
||||
PHOTOGRAPHS
|
||||
|
||||
*/
|
||||
// WRAPPING PAPER
|
||||
|
||||
/obj/item/weapon/wrapping_paper/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (!( locate(/obj/structure/table, src.loc) ))
|
||||
user << "\blue You MUST put the paper on a table!"
|
||||
if (W.w_class < 4)
|
||||
if ((istype(user.l_hand, /obj/item/weapon/wirecutters) || istype(user.r_hand, /obj/item/weapon/wirecutters)))
|
||||
var/a_used = 2 ** (src.w_class - 1)
|
||||
if (src.amount < a_used)
|
||||
user << "\blue You need more paper!"
|
||||
return
|
||||
else
|
||||
if(istype(W, /obj/item/smallDelivery) || istype(W, /obj/item/weapon/gift)) //No gift wrapping gifts!
|
||||
return
|
||||
|
||||
src.amount -= a_used
|
||||
user.drop_item()
|
||||
var/obj/item/weapon/gift/G = new /obj/item/weapon/gift( src.loc )
|
||||
G.size = W.w_class
|
||||
G.w_class = G.size + 1
|
||||
G.icon_state = text("gift[]", G.size)
|
||||
G.gift = W
|
||||
W.loc = G
|
||||
G.add_fingerprint(user)
|
||||
W.add_fingerprint(user)
|
||||
src.add_fingerprint(user)
|
||||
if (src.amount <= 0)
|
||||
new /obj/item/weapon/c_tube( src.loc )
|
||||
del(src)
|
||||
return
|
||||
else
|
||||
user << "\blue You need scissors!"
|
||||
else
|
||||
user << "\blue The object is FAR too large!"
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/wrapping_paper/examine()
|
||||
set src in oview(1)
|
||||
|
||||
..()
|
||||
usr << text("There is about [] square units of paper left!", src.amount)
|
||||
return
|
||||
|
||||
/obj/item/weapon/wrapping_paper/attack(mob/target as mob, mob/user as mob)
|
||||
if (!istype(target, /mob/living/carbon/human)) return
|
||||
var/mob/living/carbon/human/H = target
|
||||
|
||||
if (istype(H.wear_suit, /obj/item/clothing/suit/straight_jacket) || H.stat)
|
||||
if (src.amount > 2)
|
||||
var/obj/effect/spresent/present = new /obj/effect/spresent (H.loc)
|
||||
src.amount -= 2
|
||||
|
||||
if (H.client)
|
||||
H.client.perspective = EYE_PERSPECTIVE
|
||||
H.client.eye = present
|
||||
|
||||
H.loc = present
|
||||
H.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been wrapped with [src.name] by [user.name] ([user.ckey])</font>")
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to wrap [H.name] ([H.ckey])</font>")
|
||||
|
||||
log_attack("<font color='red'>[user.name] ([user.ckey]) used the [src.name] to wrap [H.name] ([H.ckey])</font>")
|
||||
|
||||
else
|
||||
user << "\blue You need more paper."
|
||||
else
|
||||
user << "Theyre moving around too much. a Straitjacket would help."
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// GIFTS
|
||||
|
||||
* Gifts
|
||||
*/
|
||||
/obj/item/weapon/gift/attack_self(mob/user as mob)
|
||||
user.drop_item()
|
||||
if(src.gift)
|
||||
@@ -154,50 +80,72 @@ PHOTOGRAPHS
|
||||
else
|
||||
return
|
||||
|
||||
// BEDSHEET BIN
|
||||
/*
|
||||
* Wrapping Paper
|
||||
*/
|
||||
/obj/item/weapon/wrapping_paper/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (!( locate(/obj/structure/table, src.loc) ))
|
||||
user << "\blue You MUST put the paper on a table!"
|
||||
if (W.w_class < 4)
|
||||
if ((istype(user.l_hand, /obj/item/weapon/wirecutters) || istype(user.r_hand, /obj/item/weapon/wirecutters)))
|
||||
var/a_used = 2 ** (src.w_class - 1)
|
||||
if (src.amount < a_used)
|
||||
user << "\blue You need more paper!"
|
||||
return
|
||||
else
|
||||
if(istype(W, /obj/item/smallDelivery) || istype(W, /obj/item/weapon/gift)) //No gift wrapping gifts!
|
||||
return
|
||||
|
||||
/obj/structure/bedsheetbin/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/bedsheet))
|
||||
del(W)
|
||||
src.amount++
|
||||
src.amount -= a_used
|
||||
user.drop_item()
|
||||
var/obj/item/weapon/gift/G = new /obj/item/weapon/gift( src.loc )
|
||||
G.size = W.w_class
|
||||
G.w_class = G.size + 1
|
||||
G.icon_state = text("gift[]", G.size)
|
||||
G.gift = W
|
||||
W.loc = G
|
||||
G.add_fingerprint(user)
|
||||
W.add_fingerprint(user)
|
||||
src.add_fingerprint(user)
|
||||
if (src.amount <= 0)
|
||||
new /obj/item/weapon/c_tube( src.loc )
|
||||
del(src)
|
||||
return
|
||||
else
|
||||
user << "\blue You need scissors!"
|
||||
else
|
||||
user << "\blue The object is FAR too large!"
|
||||
return
|
||||
|
||||
/obj/structure/bedsheetbin/attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/structure/bedsheetbin/attack_hand(mob/user as mob)
|
||||
if (src.amount >= 1)
|
||||
src.amount--
|
||||
new /obj/item/weapon/bedsheet( src.loc )
|
||||
add_fingerprint(user)
|
||||
|
||||
/obj/structure/bedsheetbin/examine()
|
||||
/obj/item/weapon/wrapping_paper/examine()
|
||||
set src in oview(1)
|
||||
|
||||
src.amount = round(src.amount)
|
||||
if (src.amount <= 0)
|
||||
src.amount = 0
|
||||
usr << "There are no bed sheets in the bin."
|
||||
else
|
||||
if (src.amount == 1)
|
||||
usr << "There is one bed sheet in the bin."
|
||||
else
|
||||
usr << text("There are [] bed sheets in the bin.", src.amount)
|
||||
return
|
||||
|
||||
// PHOTOGRAPH
|
||||
|
||||
/obj/item/weapon/paper/photograph/New()
|
||||
|
||||
..()
|
||||
src.pixel_y = 0
|
||||
src.pixel_x = 0
|
||||
usr << text("There is about [] square units of paper left!", src.amount)
|
||||
return
|
||||
|
||||
/obj/item/weapon/paper/photograph/attack_self(mob/user as mob)
|
||||
/obj/item/weapon/wrapping_paper/attack(mob/target as mob, mob/user as mob)
|
||||
if (!istype(target, /mob/living/carbon/human)) return
|
||||
var/mob/living/carbon/human/H = target
|
||||
|
||||
var/n_name = copytext(sanitize(input(user, "What would you like to label the photo?", "Paper Labelling", null) as text),1,32)
|
||||
if ((src.loc == user && user.stat == 0))
|
||||
src.name = text("photo[]", (n_name ? text("- '[]'", n_name) : null))
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
if (istype(H.wear_suit, /obj/item/clothing/suit/straight_jacket) || H.stat)
|
||||
if (src.amount > 2)
|
||||
var/obj/effect/spresent/present = new /obj/effect/spresent (H.loc)
|
||||
src.amount -= 2
|
||||
|
||||
if (H.client)
|
||||
H.client.perspective = EYE_PERSPECTIVE
|
||||
H.client.eye = present
|
||||
|
||||
H.loc = present
|
||||
H.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been wrapped with [src.name] by [user.name] ([user.ckey])</font>")
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to wrap [H.name] ([H.ckey])</font>")
|
||||
|
||||
log_attack("<font color='red'>[user.name] ([user.ckey]) used the [src.name] to wrap [H.name] ([H.ckey])</font>")
|
||||
|
||||
else
|
||||
user << "\blue You need more paper."
|
||||
else
|
||||
user << "Theyre moving around too much. a Straitjacket would help."
|
||||
@@ -0,0 +1,284 @@
|
||||
/obj/item/weapon/grenade/chem_grenade
|
||||
name = "Grenade Casing"
|
||||
icon_state = "chemg"
|
||||
item_state = "flashbang"
|
||||
w_class = 2.0
|
||||
force = 2.0
|
||||
var/stage = 0
|
||||
var/state = 0
|
||||
var/path = 0
|
||||
var/motion = 0
|
||||
var/direct = "SOUTH"
|
||||
var/obj/item/weapon/circuitboard/circuit = null
|
||||
var/list/beakers = new/list()
|
||||
var/list/allowed_containers = list("/obj/item/weapon/reagent_containers/glass/beaker", "/obj/item/weapon/reagent_containers/glass/dispenser", "/obj/item/weapon/reagent_containers/glass/bottle")
|
||||
var/affected_area = 3
|
||||
|
||||
New()
|
||||
var/datum/reagents/R = new/datum/reagents(1000)
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
|
||||
attack_self(mob/user as mob)
|
||||
if(stage > 1)
|
||||
..()
|
||||
|
||||
attackby(obj/item/weapon/W as obj, mob/user as mob)//TODO:Have grenades use the new assembly things
|
||||
|
||||
if(istype(W,/obj/item/device/assembly_holder) && !stage && path != 2)
|
||||
path = 1
|
||||
user << "\blue You add [W] to the metal casing."
|
||||
playsound(src.loc, 'sound/items/Screwdriver2.ogg', 25, -3)
|
||||
del(W) //Okay so we're not really adding anything here. cheating.
|
||||
icon_state = initial(icon_state) +"_ass"
|
||||
name = "unsecured grenade"
|
||||
stage = 1
|
||||
else if(istype(W,/obj/item/weapon/screwdriver) && stage == 1 && path != 2)
|
||||
path = 1
|
||||
if(beakers.len)
|
||||
user << "\blue You lock the assembly."
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 25, -3)
|
||||
name = "grenade"
|
||||
icon_state = initial(icon_state) +"_locked"
|
||||
stage = 2
|
||||
else
|
||||
user << "\red You need to add at least one beaker before locking the assembly."
|
||||
else if((istype(W,/obj/item/weapon/reagent_containers/glass/beaker) || istype(W,/obj/item/weapon/reagent_containers/glass/bottle)) && stage == 1 && path != 2)
|
||||
path = 1
|
||||
if(beakers.len == 2)
|
||||
user << "\red The grenade can not hold more containers."
|
||||
return
|
||||
else
|
||||
if(W.reagents.total_volume)
|
||||
user << "\blue You add \the [W] to the assembly."
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
beakers += W
|
||||
else
|
||||
user << "\red \the [W] is empty."
|
||||
|
||||
else if(path != 1)
|
||||
if(!istype(src.loc,/turf))
|
||||
user << "\red You need to put the canister on the ground to do that!"
|
||||
else
|
||||
switch(state)
|
||||
if(0)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
user << "\blue You wrench the canister in place."
|
||||
src.name = "Camera Assembly"
|
||||
src.anchored = 1
|
||||
src.state = 1
|
||||
path = 2
|
||||
if(1)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
user << "\blue You unfasten the canister."
|
||||
src.name = "Grenade Casing"
|
||||
src.anchored = 0
|
||||
src.state = 0
|
||||
path = 0
|
||||
if(istype(W, /obj/item/device/multitool))
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user << "\blue You place the electronics inside the canister."
|
||||
src.circuit = W
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
if(istype(W, /obj/item/weapon/screwdriver) && circuit)
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
user << "\blue You screw the circuitry into place."
|
||||
src.state = 2
|
||||
if(istype(W, /obj/item/weapon/crowbar) && circuit)
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
user << "\blue You remove the circuitry."
|
||||
src.state = 1
|
||||
circuit.loc = src.loc
|
||||
src.circuit = null
|
||||
if(2)
|
||||
if(istype(W, /obj/item/weapon/screwdriver) && circuit)
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
user << "\blue You unfasten the circuitry."
|
||||
src.state = 1
|
||||
if(istype(W, /obj/item/weapon/cable_coil))
|
||||
if(W:amount >= 1)
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
W:amount -= 1
|
||||
if(!W:amount) del(W)
|
||||
user << "\blue You add cabling to the canister."
|
||||
src.state = 3
|
||||
if(3)
|
||||
if(istype(W, /obj/item/weapon/wirecutters))
|
||||
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
|
||||
user << "\blue You remove the cabling."
|
||||
src.state = 2
|
||||
var/obj/item/weapon/cable_coil/A = new /obj/item/weapon/cable_coil( src.loc )
|
||||
A.amount = 1
|
||||
if(issignaler(W))
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user << "\blue You attach the wireless signaller unit to the circutry."
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
src.state = 4
|
||||
if(4)
|
||||
if(istype(W, /obj/item/weapon/crowbar) && !motion)
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
user << "\blue You remove the remote signalling device."
|
||||
src.state = 3
|
||||
new /obj/item/device/assembly/signaler( src.loc, 1 )
|
||||
if(isprox(W) && motion == 0)
|
||||
// if(W:amount >= 1)
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
// W:use(1)
|
||||
user << "\blue You attach the proximity sensor."
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
motion = 1
|
||||
if(istype(W, /obj/item/weapon/crowbar) && motion)
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
user << "\blue You remove the proximity sensor."
|
||||
new /obj/item/device/assembly/prox_sensor( src.loc, 1 )
|
||||
motion = 0
|
||||
if(istype(W, /obj/item/stack/sheet/glass))
|
||||
if(W:amount >= 1)
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
W:use(1)
|
||||
user << "\blue You put in the glass lens."
|
||||
src.state = 5
|
||||
if(5)
|
||||
if(istype(W, /obj/item/weapon/crowbar))
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
user << "\blue You remove the glass lens."
|
||||
src.state = 4
|
||||
new /obj/item/stack/sheet/glass( src.loc, 2 )
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
user << "\blue You connect the lense."
|
||||
var/obj/machinery/camera/B = null
|
||||
if(motion == 1)
|
||||
B = new /obj/machinery/camera/motion( src.loc )
|
||||
else
|
||||
B = new /obj/machinery/camera( src.loc )
|
||||
// To prevent people exploiting the fact that it doesn't delete the assembly until the user is done
|
||||
// entering the camera options.
|
||||
src.loc = B
|
||||
|
||||
//Auto detect walls and turn camera based on wall locations.
|
||||
B.auto_turn()
|
||||
|
||||
B.network = "SS13"
|
||||
B.network = input(usr, "Which network would you like to connect this camera to?", "Set Network", "SS13")
|
||||
|
||||
for(var/i = 5; i >= 0; i -= 1)
|
||||
direct = input(user, "Direction?", "Assembling Camera", null) in list("LEAVE IT", "NORTH", "EAST", "SOUTH", "WEST" )
|
||||
if(direct != "LEAVE IT")
|
||||
B.dir = text2dir(direct)
|
||||
if(i != 0)
|
||||
var/confirm = alert(user, "Is this what you want? Chances Remaining: [i]", "Confirmation", "Yes", "No")
|
||||
if(confirm == "Yes")
|
||||
break
|
||||
del(src)
|
||||
|
||||
prime()
|
||||
if(prob(reliability))
|
||||
var/has_reagents = 0
|
||||
for(var/obj/item/weapon/reagent_containers/glass/G in beakers)
|
||||
if(G.reagents.total_volume) has_reagents = 1
|
||||
|
||||
if(!has_reagents)
|
||||
playsound(src.loc, 'sound/items/Screwdriver2.ogg', 50, 1)
|
||||
state = 0
|
||||
return
|
||||
|
||||
playsound(src.loc, 'sound/effects/bamf.ogg', 50, 1)
|
||||
|
||||
for(var/obj/item/weapon/reagent_containers/glass/G in beakers)
|
||||
G.reagents.trans_to(src, G.reagents.total_volume)
|
||||
|
||||
if(src.reagents.total_volume) //The possible reactions didnt use up all reagents.
|
||||
var/datum/effect/effect/system/steam_spread/steam = new /datum/effect/effect/system/steam_spread()
|
||||
steam.set_up(10, 0, get_turf(src))
|
||||
steam.attach(src)
|
||||
steam.start()
|
||||
|
||||
for(var/atom/A in view(affected_area, src.loc))
|
||||
if( A == src ) continue
|
||||
src.reagents.reaction(A, 1, 10)
|
||||
|
||||
|
||||
invisibility = INVISIBILITY_MAXIMUM //Why am i doing this?
|
||||
spawn(50) //To make sure all reagents can work
|
||||
del(src) //correctly before deleting the grenade.
|
||||
else
|
||||
icon_state = initial(icon_state) + "_locked"
|
||||
crit_fail = 1
|
||||
for(var/obj/item/weapon/reagent_containers/glass/G in beakers)
|
||||
G.loc = get_turf(src.loc)
|
||||
|
||||
/obj/item/weapon/grenade/chem_grenade/large
|
||||
name = "Large Chem Grenade"
|
||||
desc = "An oversized grenade that affects a larger area."
|
||||
icon_state = "large_grenade"
|
||||
allowed_containers = list("/obj/item/weapon/reagent_containers/glass")
|
||||
origin_tech = "combat=3;materials=3"
|
||||
affected_area = 4
|
||||
|
||||
/obj/item/weapon/grenade/chem_grenade/metalfoam
|
||||
name = "Metal-Foam Grenade"
|
||||
desc = "Used for emergency sealing of air breaches."
|
||||
path = 1
|
||||
stage = 2
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker/B1 = new(src)
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker/B2 = new(src)
|
||||
|
||||
B1.reagents.add_reagent("aluminum", 30)
|
||||
B2.reagents.add_reagent("foaming_agent", 10)
|
||||
B2.reagents.add_reagent("pacid", 10)
|
||||
|
||||
beakers += B1
|
||||
beakers += B2
|
||||
icon_state = "grenade"
|
||||
|
||||
/obj/item/weapon/grenade/chem_grenade/incendiary
|
||||
name = "Incendiary Grenade"
|
||||
desc = "Used for clearing rooms of living things."
|
||||
path = 1
|
||||
stage = 2
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker/B1 = new(src)
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker/B2 = new(src)
|
||||
|
||||
B1.reagents.add_reagent("aluminum", 25)
|
||||
B2.reagents.add_reagent("plasma", 25)
|
||||
B2.reagents.add_reagent("sacid", 25)
|
||||
|
||||
beakers += B1
|
||||
beakers += B2
|
||||
icon_state = "grenade"
|
||||
|
||||
/obj/item/weapon/grenade/chem_grenade/cleaner
|
||||
name = "Cleaner Grenade"
|
||||
desc = "BLAM!-brand foaming space cleaner. In a special applicator for rapid cleaning of wide areas."
|
||||
stage = 2
|
||||
path = 1
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker/B1 = new(src)
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker/B2 = new(src)
|
||||
|
||||
B1.reagents.add_reagent("fluorosurfactant", 40)
|
||||
B2.reagents.add_reagent("water", 40)
|
||||
B2.reagents.add_reagent("cleaner", 10)
|
||||
|
||||
beakers += B1
|
||||
beakers += B2
|
||||
icon_state = "grenade"
|
||||
@@ -0,0 +1,11 @@
|
||||
/obj/item/weapon/grenade/empgrenade
|
||||
name = "emp grenade"
|
||||
icon_state = "emp"
|
||||
item_state = "emp"
|
||||
origin_tech = "materials=2;magnets=3"
|
||||
|
||||
prime()
|
||||
..()
|
||||
if(empulse(src, 5, 7))
|
||||
del(src)
|
||||
return
|
||||
@@ -0,0 +1,172 @@
|
||||
/obj/item/weapon/grenade/flashbang
|
||||
name = "flashbang"
|
||||
icon_state = "flashbang"
|
||||
item_state = "flashbang"
|
||||
origin_tech = "materials=2;combat=1"
|
||||
var/banglet = 0
|
||||
|
||||
prime()
|
||||
..()
|
||||
for(var/obj/structure/closet/L in view(get_turf(src), null))
|
||||
if(locate(/mob/living/carbon/, L))
|
||||
for(var/mob/living/carbon/M in L)
|
||||
bang(get_turf(src), M)
|
||||
|
||||
|
||||
for(var/mob/living/carbon/M in viewers(get_turf(src), null))
|
||||
bang(get_turf(src), M)
|
||||
|
||||
for(var/obj/effect/blob/B in view(8,get_turf(src))) //Blob damage here
|
||||
var/damage = round(30/(get_dist(B,get_turf(src))+1))
|
||||
B.health -= damage
|
||||
B.update_icon()
|
||||
del(src)
|
||||
return
|
||||
|
||||
proc/bang(var/turf/T , var/mob/living/carbon/M) // Added a new proc called 'bang' that takes a location and a person to be banged.
|
||||
if (locate(/obj/item/weapon/cloaking_device, M)) // Called during the loop that bangs people in lockers/containers and when banging
|
||||
for(var/obj/item/weapon/cloaking_device/S in M) // people in normal view. Could theroetically be called during other explosions.
|
||||
S.active = 0 // -- Polymorph
|
||||
S.icon_state = "shield0"
|
||||
|
||||
M << "\red <B>BANG</B>"
|
||||
playsound(src.loc, 'sound/effects/bang.ogg', 25, 1)
|
||||
|
||||
//Checking for protections
|
||||
var/eye_safety = 0
|
||||
var/ear_safety = 0
|
||||
if(iscarbon(M))
|
||||
eye_safety = M.eyecheck()
|
||||
if(ishuman(M))
|
||||
if(istype(M:ears, /obj/item/clothing/ears/earmuffs))
|
||||
ear_safety += 2
|
||||
if(HULK in M.mutations)
|
||||
ear_safety += 1
|
||||
if(istype(M:head, /obj/item/clothing/head/helmet))
|
||||
ear_safety += 1
|
||||
|
||||
//Flashing everyone
|
||||
if(eye_safety < 1)
|
||||
flick("e_flash", M.flash)
|
||||
M.eye_stat += rand(1, 3)
|
||||
M.Stun(2)
|
||||
M.Weaken(10)
|
||||
|
||||
|
||||
|
||||
//Now applying sound
|
||||
if((get_dist(M, T) <= 2 || src.loc == M.loc || src.loc == M))
|
||||
if(ear_safety > 0)
|
||||
M.Stun(2)
|
||||
M.Weaken(1)
|
||||
else
|
||||
M.Stun(10)
|
||||
M.Weaken(3)
|
||||
if ((prob(14) || (M == src.loc && prob(70))))
|
||||
M.ear_damage += rand(1, 10)
|
||||
else
|
||||
M.ear_damage += rand(0, 5)
|
||||
M.ear_deaf = max(M.ear_deaf,15)
|
||||
|
||||
else if(get_dist(M, T) <= 5)
|
||||
if(!ear_safety)
|
||||
M.Stun(8)
|
||||
M.ear_damage += rand(0, 3)
|
||||
M.ear_deaf = max(M.ear_deaf,10)
|
||||
|
||||
else if(!ear_safety)
|
||||
M.Stun(4)
|
||||
M.ear_damage += rand(0, 1)
|
||||
M.ear_deaf = max(M.ear_deaf,5)
|
||||
|
||||
//This really should be in mob not every check
|
||||
if (M.eye_stat >= 20)
|
||||
M << "\red Your eyes start to burn badly!"
|
||||
M.disabilities |= NEARSIGHTED
|
||||
if(!banglet && !(istype(src , /obj/item/weapon/grenade/flashbang/clusterbang)))
|
||||
if (prob(M.eye_stat - 20 + 1))
|
||||
M << "\red You can't see anything!"
|
||||
M.sdisabilities |= BLIND
|
||||
if (M.ear_damage >= 15)
|
||||
M << "\red Your ears start to ring badly!"
|
||||
if(!banglet && !(istype(src , /obj/item/weapon/grenade/flashbang/clusterbang)))
|
||||
if (prob(M.ear_damage - 10 + 5))
|
||||
M << "\red You can't hear anything!"
|
||||
M.sdisabilities |= DEAF
|
||||
else
|
||||
if (M.ear_damage >= 5)
|
||||
M << "\red Your ears start to ring!"
|
||||
M.update_icons()
|
||||
|
||||
|
||||
/obj/item/weapon/grenade/flashbang/clusterbang//Created by Polymorph, fixed by Sieve
|
||||
desc = "Use of this weapon may constiute a war crime in your area, consult your local captain."
|
||||
name = "clusterbang"
|
||||
icon = 'icons/obj/grenade.dmi'
|
||||
icon_state = "clusterbang"
|
||||
|
||||
/obj/item/weapon/grenade/flashbang/clusterbang/prime()
|
||||
var/numspawned = rand(4,8)
|
||||
var/again = 0
|
||||
for(var/more = numspawned,more > 0,more--)
|
||||
if(prob(35))
|
||||
again++
|
||||
numspawned --
|
||||
|
||||
for(,numspawned > 0, numspawned--)
|
||||
spawn(0)
|
||||
new /obj/item/weapon/grenade/flashbang/cluster(src.loc)//Launches flashbangs
|
||||
playsound(src.loc, 'sound/weapons/armbomb.ogg', 75, 1, -3)
|
||||
|
||||
for(,again > 0, again--)
|
||||
spawn(0)
|
||||
new /obj/item/weapon/grenade/flashbang/clusterbang/segment(src.loc)//Creates a 'segment' that launches a few more flashbangs
|
||||
playsound(src.loc, 'sound/weapons/armbomb.ogg', 75, 1, -3)
|
||||
spawn(0)
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/grenade/flashbang/clusterbang/segment
|
||||
desc = "A smaller segment of a clusterbang. Better run."
|
||||
name = "clusterbang segment"
|
||||
icon = 'icons/obj/grenade.dmi'
|
||||
icon_state = "clusterbang_segment"
|
||||
|
||||
/obj/item/weapon/grenade/flashbang/clusterbang/segment/New()//Segments should never exist except part of the clusterbang, since these immediately 'do their thing' and asplode
|
||||
icon_state = "clusterbang_segment_active"
|
||||
active = 1
|
||||
banglet = 1
|
||||
var/stepdist = rand(1,4)//How far to step
|
||||
var/temploc = src.loc//Saves the current location to know where to step away from
|
||||
walk_away(src,temploc,stepdist)//I must go, my people need me
|
||||
var/dettime = rand(15,60)
|
||||
spawn(dettime)
|
||||
prime()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/grenade/flashbang/clusterbang/segment/prime()
|
||||
var/numspawned = rand(4,8)
|
||||
for(var/more = numspawned,more > 0,more--)
|
||||
if(prob(35))
|
||||
numspawned --
|
||||
|
||||
for(,numspawned > 0, numspawned--)
|
||||
spawn(0)
|
||||
new /obj/item/weapon/grenade/flashbang/cluster(src.loc)
|
||||
playsound(src.loc, 'sound/weapons/armbomb.ogg', 75, 1, -3)
|
||||
spawn(0)
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/grenade/flashbang/cluster/New()//Same concept as the segments, so that all of the parts don't become reliant on the clusterbang
|
||||
spawn(0)
|
||||
icon_state = "flashbang_active"
|
||||
active = 1
|
||||
banglet = 1
|
||||
var/stepdist = rand(1,3)
|
||||
var/temploc = src.loc
|
||||
walk_away(src,temploc,stepdist)
|
||||
var/dettime = rand(15,60)
|
||||
spawn(dettime)
|
||||
prime()
|
||||
..()
|
||||
@@ -0,0 +1,106 @@
|
||||
/obj/item/weapon/grenade
|
||||
name = "grenade"
|
||||
desc = "A hand held grenade, with an adjustable timer."
|
||||
w_class = 2.0
|
||||
icon = 'icons/obj/grenade.dmi'
|
||||
icon_state = "grenade"
|
||||
item_state = "flashbang"
|
||||
throw_speed = 4
|
||||
throw_range = 20
|
||||
flags = FPRINT | TABLEPASS | CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
var/active = 0
|
||||
var/det_time = 50
|
||||
|
||||
/obj/item/weapon/grenade/proc/clown_check(var/mob/living/user)
|
||||
if((CLUMSY in user.mutations) && prob(50))
|
||||
user << "<span class='warning'>Huh? How does this thing work?</span>"
|
||||
active = 1
|
||||
icon_state = initial(icon_state) + "_active"
|
||||
playsound(loc, 'sound/weapons/armbomb.ogg', 75, 1, -3)
|
||||
spawn(5)
|
||||
if(user)
|
||||
user.drop_item()
|
||||
prime()
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
/*/obj/item/weapon/grenade/afterattack(atom/target as mob|obj|turf|area, mob/user as mob)
|
||||
if (istype(target, /obj/item/weapon/storage)) return ..() // Trying to put it in a full container
|
||||
if (istype(target, /obj/item/weapon/gun/grenadelauncher)) return ..()
|
||||
if((user.get_active_hand() == src) && (!active) && (clown_check(user)) && target.loc != src.loc)
|
||||
user << "<span class='warning'>You prime the [name]! [det_time/10] seconds!</span>"
|
||||
active = 1
|
||||
icon_state = initial(icon_state) + "_active"
|
||||
playsound(loc, 'sound/weapons/armbomb.ogg', 75, 1, -3)
|
||||
spawn(det_time)
|
||||
prime()
|
||||
return
|
||||
user.dir = get_dir(user, target)
|
||||
user.drop_item()
|
||||
var/t = (isturf(target) ? target : target.loc)
|
||||
walk_towards(src, t, 3)
|
||||
return*/
|
||||
|
||||
|
||||
/obj/item/weapon/grenade/examine()
|
||||
set src in usr
|
||||
usr << desc
|
||||
if(det_time > 1)
|
||||
usr << "The timer is set to [det_time/10] seconds."
|
||||
return
|
||||
usr << "\The [src] is set for instant detonation."
|
||||
|
||||
|
||||
/obj/item/weapon/grenade/attack_self(mob/user as mob)
|
||||
if(!active)
|
||||
if(clown_check(user))
|
||||
user << "<span class='warning'>You prime the [name]! [det_time/10] seconds!</span>"
|
||||
active = 1
|
||||
icon_state = initial(icon_state) + "_active"
|
||||
add_fingerprint(user)
|
||||
if(iscarbon(user))
|
||||
var/mob/living/carbon/C = user
|
||||
C.throw_mode_on()
|
||||
spawn(det_time)
|
||||
if(user)
|
||||
user.drop_item()
|
||||
prime()
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/grenade/proc/prime()
|
||||
// playsound(loc, 'sound/items/Welder2.ogg', 25, 1)
|
||||
var/turf/T = get_turf(src)
|
||||
if(T)
|
||||
T.hotspot_expose(700,125)
|
||||
|
||||
|
||||
/obj/item/weapon/grenade/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(isscrewdriver(W))
|
||||
switch(det_time)
|
||||
if ("1")
|
||||
det_time = 10
|
||||
user << "<span class='notice'>You set the [name] for 1 second detonation time.</span>"
|
||||
if ("10")
|
||||
det_time = 30
|
||||
user << "<span class='notice'>You set the [name] for 3 second detonation time.</span>"
|
||||
if ("30")
|
||||
det_time = 50
|
||||
user << "<span class='notice'>You set the [name] for 5 second detonation time.</span>"
|
||||
if ("50")
|
||||
det_time = 1
|
||||
user << "<span class='notice'>You set the [name] for instant detonation.</span>"
|
||||
add_fingerprint(user)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/grenade/attack_hand()
|
||||
walk(src, null, null)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/grenade/attack_paw(mob/user as mob)
|
||||
return attack_hand(user)
|
||||
@@ -0,0 +1,35 @@
|
||||
/obj/item/weapon/grenade/smokebomb
|
||||
desc = "It is set to detonate in 2 seconds."
|
||||
name = "smoke bomb"
|
||||
icon = 'icons/obj/grenade.dmi'
|
||||
icon_state = "flashbang"
|
||||
det_time = 20
|
||||
item_state = "flashbang"
|
||||
flags = FPRINT | TABLEPASS | USEDELAY
|
||||
slot_flags = SLOT_BELT
|
||||
var/datum/effect/effect/system/bad_smoke_spread/smoke
|
||||
|
||||
New()
|
||||
..()
|
||||
src.smoke = new /datum/effect/effect/system/bad_smoke_spread
|
||||
src.smoke.attach(src)
|
||||
src.smoke.set_up(10, 0, usr.loc)
|
||||
|
||||
prime()
|
||||
playsound(src.loc, 'sound/effects/smoke.ogg', 50, 1, -3)
|
||||
spawn(0)
|
||||
src.smoke.start()
|
||||
sleep(10)
|
||||
src.smoke.start()
|
||||
sleep(10)
|
||||
src.smoke.start()
|
||||
sleep(10)
|
||||
src.smoke.start()
|
||||
|
||||
for(var/obj/effect/blob/B in view(8,src))
|
||||
var/damage = round(30/(get_dist(B,src)+1))
|
||||
B.health -= damage
|
||||
B.update_icon()
|
||||
sleep(80)
|
||||
del(src)
|
||||
return
|
||||
@@ -0,0 +1,52 @@
|
||||
/obj/item/weapon/grenade/spawnergrenade
|
||||
desc = "It is set to detonate in 5 seconds. It will unleash unleash an unspecified anomaly into the vicinity."
|
||||
name = "delivery grenade"
|
||||
icon = 'icons/obj/grenade.dmi'
|
||||
icon_state = "delivery"
|
||||
item_state = "flashbang"
|
||||
origin_tech = "materials=3;magnets=4"
|
||||
var/banglet = 0
|
||||
var/spawner_type = null // must be an object path
|
||||
var/deliveryamt = 1 // amount of type to deliver
|
||||
|
||||
prime() // Prime now just handles the two loops that query for people in lockers and people who can see it.
|
||||
|
||||
if(spawner_type && deliveryamt)
|
||||
// Make a quick flash
|
||||
var/turf/T = get_turf(src)
|
||||
playsound(T, 'sound/effects/phasein.ogg', 100, 1)
|
||||
for(var/mob/living/carbon/human/M in viewers(T, null))
|
||||
if(M:eyecheck() <= 0)
|
||||
flick("e_flash", M.flash) // flash dose faggots
|
||||
|
||||
for(var/i=1, i<=deliveryamt, i++)
|
||||
var/atom/movable/x = new spawner_type
|
||||
x.loc = T
|
||||
if(prob(50))
|
||||
for(var/j = 1, j <= rand(1, 3), j++)
|
||||
step(x, pick(NORTH,SOUTH,EAST,WEST))
|
||||
|
||||
// Spawn some hostile syndicate critters
|
||||
if(istype(x, /obj/effect/critter))
|
||||
var/obj/effect/critter/C = x
|
||||
|
||||
C.atkcarbon = 1
|
||||
C.atksilicon = 1
|
||||
C.atkmech = 0
|
||||
C.atksynd = 0
|
||||
C.aggressive = 1
|
||||
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/grenade/spawnergrenade/manhacks
|
||||
name = "manhack delivery grenade"
|
||||
spawner_type = /obj/effect/critter/manhack
|
||||
deliveryamt = 5
|
||||
origin_tech = "materials=3;magnets=4;syndicate=4"
|
||||
|
||||
/obj/item/weapon/grenade/spawnergrenade/spesscarp
|
||||
name = "carp delivery grenade"
|
||||
spawner_type = /mob/living/simple_animal/carp
|
||||
deliveryamt = 5
|
||||
origin_tech = "materials=3;magnets=4;syndicate=4"
|
||||
@@ -0,0 +1,76 @@
|
||||
/obj/item/weapon/handcuffs/attack(mob/M as mob, mob/user as mob)
|
||||
if(istype(src, /obj/item/weapon/handcuffs/cyborg) && isrobot(user))
|
||||
if(!M.handcuffed)
|
||||
var/turf/p_loc = user.loc
|
||||
var/turf/p_loc_m = M.loc
|
||||
playsound(src.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -2)
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message("\red <B>[user] is trying to put handcuffs on [M]!</B>", 1)
|
||||
spawn(30)
|
||||
if(!M) return
|
||||
if(p_loc == user.loc && p_loc_m == M.loc)
|
||||
M.handcuffed = new /obj/item/weapon/handcuffs(M)
|
||||
M.update_inv_handcuffed()
|
||||
|
||||
else
|
||||
if ((CLUMSY in usr.mutations) && prob(50))
|
||||
usr << "\red Uh ... how do those things work?!"
|
||||
if (istype(M, /mob/living/carbon/human))
|
||||
if(!M.handcuffed)
|
||||
var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( )
|
||||
O.source = user
|
||||
O.target = user
|
||||
O.item = user.get_active_hand()
|
||||
O.s_loc = user.loc
|
||||
O.t_loc = user.loc
|
||||
O.place = "handcuff"
|
||||
M.requests += O
|
||||
spawn( 0 )
|
||||
O.process()
|
||||
return
|
||||
return
|
||||
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
if (istype(M, /mob/living/carbon/human))
|
||||
if(!M.handcuffed)
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been handcuffed (attempt) by [user.name] ([user.ckey])</font>")
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to handcuff [M.name] ([M.ckey])</font>")
|
||||
|
||||
log_attack("<font color='red'>[user.name] ([user.ckey]) Attempted to handcuff [M.name] ([M.ckey])</font>")
|
||||
|
||||
var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( )
|
||||
O.source = user
|
||||
O.target = M
|
||||
O.item = user.get_active_hand()
|
||||
O.s_loc = user.loc
|
||||
O.t_loc = M.loc
|
||||
O.place = "handcuff"
|
||||
M.requests += O
|
||||
spawn( 0 )
|
||||
if(istype(src, /obj/item/weapon/handcuffs/cable))
|
||||
feedback_add_details("handcuffs","C")
|
||||
playsound(src.loc, 'sound/weapons/cablecuff.ogg', 30, 1, -2)
|
||||
else
|
||||
feedback_add_details("handcuffs","H")
|
||||
playsound(src.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -2)
|
||||
O.process()
|
||||
return
|
||||
else
|
||||
if(!M.handcuffed)
|
||||
var/obj/effect/equip_e/monkey/O = new /obj/effect/equip_e/monkey( )
|
||||
O.source = user
|
||||
O.target = M
|
||||
O.item = user.get_active_hand()
|
||||
O.s_loc = user.loc
|
||||
O.t_loc = M.loc
|
||||
O.place = "handcuff"
|
||||
M.requests += O
|
||||
spawn( 0 )
|
||||
if(istype(src, /obj/item/weapon/handcuffs/cable))
|
||||
playsound(src.loc, 'sound/weapons/cablecuff.ogg', 30, 1, -2)
|
||||
else
|
||||
playsound(src.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -2)
|
||||
O.process()
|
||||
return
|
||||
return
|
||||
@@ -1,22 +1,56 @@
|
||||
/* Hydroponic stuff
|
||||
* Contains:
|
||||
* Plant Bags
|
||||
* Sunflowers
|
||||
* Nettle
|
||||
* Deathnettle
|
||||
* Corbcob
|
||||
*/
|
||||
|
||||
/*
|
||||
* Plant Bags
|
||||
*/
|
||||
/obj/item/weapon/plantbag
|
||||
icon = 'icons/obj/hydroponics.dmi'
|
||||
icon_state = "plantbag"
|
||||
name = "Plant Bag"
|
||||
var/mode = 1; //0 = pick one at a time, 1 = pick all on tile
|
||||
var/capacity = 50; //the number of plant pieces it can carry.
|
||||
flags = FPRINT | TABLEPASS
|
||||
slot_flags = SLOT_BELT
|
||||
w_class = 1
|
||||
|
||||
CONTAINS:
|
||||
Plant-B-Gone
|
||||
Nettle
|
||||
Deathnettle
|
||||
Craftables (Cob pipes, potato batteries, pumpkinheads)
|
||||
/obj/item/weapon/plantbag/attack_self(mob/user as mob)
|
||||
for (var/obj/item/weapon/reagent_containers/food/snacks/grown/O in contents)
|
||||
contents -= O
|
||||
O.loc = user.loc
|
||||
user << "\blue You empty the plant bag."
|
||||
return
|
||||
|
||||
*/
|
||||
/obj/item/weapon/plantbag/verb/toggle_mode()
|
||||
set name = "Switch Bagging Method"
|
||||
set category = "Object"
|
||||
|
||||
mode = !mode
|
||||
switch (mode)
|
||||
if(1)
|
||||
usr << "The bag now picks up all plants in a tile at once."
|
||||
if(0)
|
||||
usr << "The bag now picks up one plant at a time."
|
||||
|
||||
|
||||
/*
|
||||
* Sunflower
|
||||
*/
|
||||
|
||||
// Sunflower
|
||||
/obj/item/weapon/grown/sunflower/attack(mob/M as mob, mob/user as mob)
|
||||
M << "<font color='green'><b> [user] smacks you with a sunflower!</font><font color='yellow'><b>FLOWER POWER<b></font>"
|
||||
user << "<font color='green'> Your sunflower's </font><font color='yellow'><b>FLOWER POWER</b></font><font color='green'> strikes [M]</font>"
|
||||
|
||||
|
||||
// Nettle
|
||||
/*
|
||||
* Nettle
|
||||
*/
|
||||
/obj/item/weapon/grown/nettle/pickup(mob/living/carbon/human/user as mob)
|
||||
if(!user.gloves)
|
||||
user << "\red The nettle burns your bare hand!"
|
||||
@@ -39,8 +73,10 @@ Craftables (Cob pipes, potato batteries, pumpkinheads)
|
||||
potency = newValue
|
||||
force = round((5+potency/5), 1)
|
||||
|
||||
/*
|
||||
* Deathnettle
|
||||
*/
|
||||
|
||||
// Deathnettle
|
||||
/obj/item/weapon/grown/deathnettle/pickup(mob/living/carbon/human/user as mob)
|
||||
if(!user.gloves)
|
||||
if(istype(user, /mob/living/carbon/human))
|
||||
@@ -82,7 +118,9 @@ Craftables (Cob pipes, potato batteries, pumpkinheads)
|
||||
force = round((5+potency/2.5), 1)
|
||||
|
||||
|
||||
//Crafting
|
||||
/*
|
||||
* Corncob
|
||||
*/
|
||||
/obj/item/weapon/corncob/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || istype(W, /obj/item/weapon/kitchen/utensil/knife))
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
CONTAINS:
|
||||
FORK
|
||||
ROLLING PIN
|
||||
KNIFE
|
||||
|
||||
*/
|
||||
/* Kitchen tools
|
||||
* Contains:
|
||||
* Forks
|
||||
* Knives
|
||||
* Rolling Pins
|
||||
* Trays
|
||||
*/
|
||||
|
||||
|
||||
/obj/item/weapon/kitchen/utensil/New()
|
||||
@@ -15,8 +15,9 @@ KNIFE
|
||||
|
||||
|
||||
|
||||
|
||||
// FORK
|
||||
/*
|
||||
* Forks
|
||||
*/
|
||||
|
||||
/obj/item/weapon/kitchen/utensil/fork/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
if(!istype(M))
|
||||
@@ -41,10 +42,19 @@ KNIFE
|
||||
M = user
|
||||
return eyestab(M,user)
|
||||
|
||||
/*
|
||||
* Knives
|
||||
*/
|
||||
/obj/item/weapon/kitchen/utensil/knife/attack(target as mob, mob/living/user as mob)
|
||||
if ((CLUMSY in user.mutations) && prob(50))
|
||||
user << "\red You accidentally cut yourself with the [src]."
|
||||
user.take_organ_damage(20)
|
||||
return
|
||||
return ..()
|
||||
|
||||
|
||||
|
||||
// ROLLING PIN
|
||||
/*
|
||||
* Rolling Pins
|
||||
*/
|
||||
|
||||
/obj/item/weapon/kitchen/rollingpin/attack(mob/living/M as mob, mob/living/user as mob)
|
||||
if ((CLUMSY in user.mutations) && prob(50))
|
||||
@@ -80,21 +90,9 @@ KNIFE
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// KNIFE
|
||||
|
||||
/obj/item/weapon/kitchen/utensil/knife/attack(target as mob, mob/living/user as mob)
|
||||
if ((CLUMSY in user.mutations) && prob(50))
|
||||
user << "\red You accidentally cut yourself with the [src]."
|
||||
user.take_organ_damage(20)
|
||||
return
|
||||
return ..()
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////// TRAY -Agouri :3 ///////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
* Trays - Agouri
|
||||
*/
|
||||
/obj/item/weapon/tray/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
|
||||
// Drop all the things. All of them.
|
||||
|
||||
+65
-33
@@ -1,37 +1,13 @@
|
||||
/obj/item/weapon/storage/photo_album
|
||||
name = "Photo album"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "album"
|
||||
item_state = "briefcase"
|
||||
can_hold = list("/obj/item/weapon/photo",)
|
||||
|
||||
/obj/item/weapon/storage/photo_album/MouseDrop(obj/over_object as obj)
|
||||
|
||||
if ((istype(usr, /mob/living/carbon/human) || (ticker && ticker.mode.name == "monkey")))
|
||||
var/mob/M = usr
|
||||
if (!( istype(over_object, /obj/screen) ))
|
||||
return ..()
|
||||
playsound(src.loc, "rustle", 50, 1, -5)
|
||||
if ((!( M.restrained() ) && !( M.stat ) && M.back == src))
|
||||
switch(over_object.name)
|
||||
if("r_hand")
|
||||
M.u_equip(src)
|
||||
M.put_in_r_hand(src)
|
||||
if("l_hand")
|
||||
M.u_equip(src)
|
||||
M.put_in_l_hand(src)
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
if(over_object == usr && in_range(src, usr) || usr.contents.Find(src))
|
||||
if (usr.s_active)
|
||||
usr.s_active.close(usr)
|
||||
src.show_to(usr)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/photo_album/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
/* Photography!
|
||||
* Contains:
|
||||
* Camera
|
||||
* Photos
|
||||
* Photo Albums
|
||||
*/
|
||||
|
||||
/*
|
||||
* Camera
|
||||
*/
|
||||
/obj/item/weapon/camera_test
|
||||
name = "camera"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
@@ -160,3 +136,59 @@
|
||||
can_use = 0
|
||||
spawn(50) can_use = 1
|
||||
|
||||
/*
|
||||
* Photos
|
||||
*/
|
||||
/obj/item/weapon/paper/photograph/New()
|
||||
|
||||
..()
|
||||
src.pixel_y = 0
|
||||
src.pixel_x = 0
|
||||
return
|
||||
|
||||
/obj/item/weapon/paper/photograph/attack_self(mob/user as mob)
|
||||
|
||||
var/n_name = copytext(sanitize(input(user, "What would you like to label the photo?", "Paper Labelling", null) as text),1,32)
|
||||
if ((src.loc == user && user.stat == 0))
|
||||
src.name = text("photo[]", (n_name ? text("- '[]'", n_name) : null))
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Photo Albums
|
||||
*/
|
||||
/obj/item/weapon/storage/photo_album
|
||||
name = "Photo album"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "album"
|
||||
item_state = "briefcase"
|
||||
can_hold = list("/obj/item/weapon/photo",)
|
||||
|
||||
/obj/item/weapon/storage/photo_album/MouseDrop(obj/over_object as obj)
|
||||
|
||||
if ((istype(usr, /mob/living/carbon/human) || (ticker && ticker.mode.name == "monkey")))
|
||||
var/mob/M = usr
|
||||
if (!( istype(over_object, /obj/screen) ))
|
||||
return ..()
|
||||
playsound(src.loc, "rustle", 50, 1, -5)
|
||||
if ((!( M.restrained() ) && !( M.stat ) && M.back == src))
|
||||
switch(over_object.name)
|
||||
if("r_hand")
|
||||
M.u_equip(src)
|
||||
M.put_in_r_hand(src)
|
||||
if("l_hand")
|
||||
M.u_equip(src)
|
||||
M.put_in_l_hand(src)
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
if(over_object == usr && in_range(src, usr) || usr.contents.Find(src))
|
||||
if (usr.s_active)
|
||||
usr.s_active.close(usr)
|
||||
src.show_to(usr)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/photo_album/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
@@ -1,176 +0,0 @@
|
||||
|
||||
/**********************Plant Bag**************************/
|
||||
|
||||
/obj/item/weapon/plantbag
|
||||
icon = 'icons/obj/hydroponics.dmi'
|
||||
icon_state = "plantbag"
|
||||
name = "Plant Bag"
|
||||
var/mode = 1; //0 = pick one at a time, 1 = pick all on tile
|
||||
var/capacity = 50; //the number of plant pieces it can carry.
|
||||
flags = FPRINT | TABLEPASS
|
||||
slot_flags = SLOT_BELT
|
||||
w_class = 1
|
||||
|
||||
/obj/item/weapon/plantbag/attack_self(mob/user as mob)
|
||||
for (var/obj/item/weapon/reagent_containers/food/snacks/grown/O in contents)
|
||||
contents -= O
|
||||
O.loc = user.loc
|
||||
user << "\blue You empty the plant bag."
|
||||
return
|
||||
|
||||
/obj/item/weapon/plantbag/verb/toggle_mode()
|
||||
set name = "Switch Bagging Method"
|
||||
set category = "Object"
|
||||
|
||||
mode = !mode
|
||||
switch (mode)
|
||||
if(1)
|
||||
usr << "The bag now picks up all plants in a tile at once."
|
||||
if(0)
|
||||
usr << "The bag now picks up one plant at a time."
|
||||
|
||||
|
||||
/obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
..()
|
||||
if (istype(O, /obj/item/weapon/plantbag))
|
||||
src.attack_hand(user)
|
||||
var/obj/item/weapon/plantbag/S = O
|
||||
for (var/obj/item/weapon/reagent_containers/food/snacks/grown/G in locate(user.x,user.y,user.z))
|
||||
if (S.contents.len < S.capacity)
|
||||
S.contents += G;
|
||||
else
|
||||
user << "\blue The plant bag is full."
|
||||
return
|
||||
|
||||
|
||||
/* SmartFridge. Much todo
|
||||
*/
|
||||
/obj/machinery/smartfridge
|
||||
name = "\improper SmartFridge"
|
||||
icon = 'icons/obj/vending.dmi'
|
||||
icon_state = "smartfridge"
|
||||
layer = 2.9
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
idle_power_usage = 5
|
||||
active_power_usage = 100
|
||||
flags = NOREACT
|
||||
var/global/max_n_of_items = 200
|
||||
var/item_quants = list()
|
||||
var/ispowered = 1 //starts powered
|
||||
var/isbroken = 0
|
||||
|
||||
|
||||
/obj/machinery/smartfridge/power_change()
|
||||
if( powered() )
|
||||
src.ispowered = 1
|
||||
stat &= ~NOPOWER
|
||||
if(!isbroken)
|
||||
icon_state = "smartfridge"
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.ispowered = 0
|
||||
stat |= NOPOWER
|
||||
if(!isbroken)
|
||||
icon_state = "smartfridge-off"
|
||||
|
||||
|
||||
/*******************
|
||||
* Item Adding
|
||||
********************/
|
||||
|
||||
/obj/machinery/smartfridge/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(!src.ispowered)
|
||||
user << "<span class='notice'>\The [src] is unpowered and useless.</span>"
|
||||
return
|
||||
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/grown/))
|
||||
if(contents.len >= max_n_of_items)
|
||||
user << "<span class='notice'>\The [src] is full.</span>"
|
||||
return 1
|
||||
else
|
||||
user.before_take_item(O)
|
||||
O.loc = src
|
||||
if(item_quants[O.name])
|
||||
item_quants[O.name]++
|
||||
else
|
||||
item_quants[O.name] = 1
|
||||
user.visible_message("<span class='notice'>[user] has added \the [O] to \the [src].", \
|
||||
"<span class='notice'>You add \the [O] to \the [src].")
|
||||
|
||||
else if(istype(O, /obj/item/weapon/plantbag))
|
||||
user.visible_message("<span class='notice'>[user] loads \the [src] with \the [O].</span>", \
|
||||
"<span class='notice'>You load \the [src] with \the [O].</span>")
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in O.contents)
|
||||
if(contents.len >= max_n_of_items)
|
||||
user << "<span class='notice'>\The [src] is full.</span>"
|
||||
return 1
|
||||
else
|
||||
O.contents -= G
|
||||
G.loc = src
|
||||
if(item_quants[G.name])
|
||||
item_quants[G.name]++
|
||||
else
|
||||
item_quants[G.name] = 1
|
||||
|
||||
else
|
||||
user << "<span class='notice'>\The [src] smartly refuses [O].</span>"
|
||||
return 1
|
||||
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/smartfridge/attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/smartfridge/attack_ai(mob/user as mob)
|
||||
return 0
|
||||
|
||||
/obj/machinery/smartfridge/attack_hand(mob/user as mob)
|
||||
user.machine = src
|
||||
interact(user)
|
||||
|
||||
/*******************
|
||||
* SmartFridge Menu
|
||||
********************/
|
||||
|
||||
/obj/machinery/smartfridge/proc/interact(mob/user as mob)
|
||||
if(!src.ispowered)
|
||||
return
|
||||
|
||||
var/dat = "<TT><b>Select an item:</b><br>"
|
||||
|
||||
if (contents.len == 0)
|
||||
dat += "<font color = 'red'>No product loaded!</font>"
|
||||
else
|
||||
for (var/O in item_quants)
|
||||
if(item_quants[O] > 0)
|
||||
var/N = item_quants[O]
|
||||
dat += "<FONT color = 'blue'><B>[capitalize(O)]</B>:"
|
||||
dat += " [N] </font>"
|
||||
dat += "<a href='byond://?src=\ref[src];vend=[O]'>Vend</A>"
|
||||
dat += "<br>"
|
||||
|
||||
dat += "</TT>"
|
||||
user << browse("<HEAD><TITLE>SmartFridge Supplies</TITLE></HEAD><TT>[dat]</TT>", "window=smartfridge")
|
||||
onclose(user, "smartfridge")
|
||||
return
|
||||
|
||||
/obj/machinery/smartfridge/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
usr.machine = src
|
||||
|
||||
var/N = href_list["vend"]
|
||||
|
||||
if(item_quants[N] <= 0) // Sanity check, there are probably ways to press the button when it shouldn't be possible.
|
||||
return
|
||||
|
||||
item_quants[N] -= 1
|
||||
for(var/obj/O in contents)
|
||||
if(O.name == N)
|
||||
O.loc = src.loc
|
||||
break
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
@@ -0,0 +1,32 @@
|
||||
/obj/item/weapon/teleportation_scroll/attack_self(mob/user as mob)
|
||||
user.machine = src
|
||||
var/dat = "<B>Teleportation Scroll:</B><BR>"
|
||||
dat += "Number of uses: [src.uses]<BR>"
|
||||
dat += "<HR>"
|
||||
dat += "<B>Four uses use them wisely:</B><BR>"
|
||||
dat += "<A href='byond://?src=\ref[src];spell_teleport=1'>Teleport</A><BR>"
|
||||
dat += "Kind regards,<br>Wizards Federation<br><br>P.S. Don't forget to bring your gear, you'll need it to cast most spells.<HR>"
|
||||
user << browse(dat, "window=scroll")
|
||||
onclose(user, "scroll")
|
||||
return
|
||||
|
||||
/obj/item/weapon/teleportation_scroll/Topic(href, href_list)
|
||||
..()
|
||||
if (usr.stat || usr.restrained())
|
||||
return
|
||||
var/mob/living/carbon/human/H = usr
|
||||
if (!( istype(H, /mob/living/carbon/human)))
|
||||
return 1
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))))
|
||||
usr.machine = src
|
||||
if (href_list["spell_teleport"])
|
||||
if (src.uses >= 1)
|
||||
src.uses -= 1
|
||||
usr.teleportscroll()
|
||||
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)
|
||||
return
|
||||
@@ -0,0 +1,53 @@
|
||||
/obj/item/weapon/secstorage/sbriefcase
|
||||
name = "secure briefcase"
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
icon_state = "secure"
|
||||
item_state = "sec-case"
|
||||
desc = "A large briefcase with a digital locking system."
|
||||
flags = FPRINT | TABLEPASS
|
||||
force = 8.0
|
||||
throw_speed = 1
|
||||
throw_range = 4
|
||||
w_class = 4.0
|
||||
|
||||
/obj/item/weapon/secstorage/sbriefcase/New()
|
||||
..()
|
||||
new /obj/item/weapon/paper(src)
|
||||
new /obj/item/weapon/pen(src)
|
||||
|
||||
/obj/item/weapon/secstorage/sbriefcase/attack(mob/M as mob, mob/living/user as mob)
|
||||
if ((CLUMSY in user.mutations) && prob(50))
|
||||
user << "\red The [src] slips out of your hand and hits your head."
|
||||
user.take_organ_damage(10)
|
||||
user.Paralyse(2)
|
||||
return
|
||||
|
||||
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been attacked with [src.name] by [user.name] ([user.ckey])</font>")
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to attack [M.name] ([M.ckey])</font>")
|
||||
|
||||
log_attack("<font color='red'>[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>")
|
||||
|
||||
var/t = user:zone_sel.selecting
|
||||
if (t == "head")
|
||||
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if (H.stat < 2 && H.health < 50 && prob(90))
|
||||
// ******* Check
|
||||
if (istype(H, /obj/item/clothing/head) && H.flags & 8 && prob(80))
|
||||
H << "\red The helmet protects you from being hit hard in the head!"
|
||||
return
|
||||
var/time = rand(2, 6)
|
||||
if (prob(75))
|
||||
H.Paralyse(time)
|
||||
else
|
||||
H.Stun(time)
|
||||
if(H.stat != 2) H.stat = 1
|
||||
for(var/mob/O in viewers(H, null))
|
||||
O.show_message(text("\red <B>[] has been knocked unconscious!</B>", H), 1, "\red You hear someone fall.", 2)
|
||||
else
|
||||
H << text("\red [] tried to knock you unconcious!",user)
|
||||
H.eye_blurry += 3
|
||||
|
||||
return
|
||||
@@ -0,0 +1,273 @@
|
||||
/obj/item/weapon/secstorage
|
||||
name = "secstorage"
|
||||
var/obj/screen/storage/boxes = null
|
||||
var/obj/screen/close/closer = null
|
||||
var/icon_locking = "secureb"
|
||||
var/icon_sparking = "securespark"
|
||||
var/icon_opened = "secure0"
|
||||
var/locked = 1
|
||||
var/code = ""
|
||||
var/l_code = null
|
||||
var/l_set = 0
|
||||
var/l_setshort = 0
|
||||
var/l_hacking = 0
|
||||
var/emagged = 0
|
||||
var/open = 0
|
||||
var/internalstorage = 3
|
||||
w_class = 3.0
|
||||
|
||||
/obj/item/weapon/secstorage/examine()
|
||||
set src in oview(1)
|
||||
|
||||
..()
|
||||
usr << text("The service panel is [src.open ? "open" : "closed"].")
|
||||
return
|
||||
|
||||
/obj/item/weapon/secstorage/proc/return_inv()
|
||||
|
||||
var/list/L = list( )
|
||||
|
||||
L += src.contents
|
||||
|
||||
for(var/obj/item/weapon/secstorage/S in src)
|
||||
L += S.return_inv()
|
||||
for(var/obj/item/weapon/gift/G in src)
|
||||
L += G.gift
|
||||
if (istype(G.gift, /obj/item/weapon/secstorage))
|
||||
L += G.gift:return_inv()
|
||||
return L
|
||||
|
||||
/obj/item/weapon/secstorage/proc/show_to(mob/user as mob)
|
||||
|
||||
user.client.screen -= src.boxes
|
||||
user.client.screen -= src.closer
|
||||
user.client.screen -= src.contents
|
||||
user.client.screen += src.boxes
|
||||
user.client.screen += src.closer
|
||||
user.client.screen += src.contents
|
||||
user.s_active = src
|
||||
return
|
||||
|
||||
/obj/item/weapon/secstorage/proc/hide_from(mob/user as mob)
|
||||
|
||||
if(!user.client)
|
||||
return
|
||||
user.client.screen -= src.boxes
|
||||
user.client.screen -= src.closer
|
||||
user.client.screen -= src.contents
|
||||
return
|
||||
|
||||
/obj/item/weapon/secstorage/proc/close(mob/user as mob)
|
||||
|
||||
src.hide_from(user)
|
||||
user.s_active = null
|
||||
return
|
||||
|
||||
/obj/item/weapon/secstorage/proc/orient_objs(tx, ty, mx, my)
|
||||
|
||||
var/cx = tx
|
||||
var/cy = ty
|
||||
src.boxes.screen_loc = "[tx],[ty] to [mx],[my]"
|
||||
for(var/obj/O in src.contents)
|
||||
O.screen_loc = "[cx],[cy]"
|
||||
O.layer = 20
|
||||
cx++
|
||||
if (cx > mx)
|
||||
cx = tx
|
||||
cy--
|
||||
//Foreach goto(56)
|
||||
src.closer.screen_loc = "[mx],[my]"
|
||||
return
|
||||
|
||||
//This proc draws out the inventory and places the items on it. It uses the standard position.
|
||||
/obj/item/weapon/secstorage/proc/standard_orient_objs()
|
||||
var/rows = 0
|
||||
var/cols = 6
|
||||
var/cx = 4
|
||||
var/cy = 2+rows
|
||||
src.boxes.screen_loc = "4:16,2:16 to [4+cols]:16,[2+rows]:16"
|
||||
for(var/obj/O in src.contents)
|
||||
O.screen_loc = "[cx]:16,[cy]:16"
|
||||
O.layer = 20
|
||||
cx++
|
||||
if (cx > (4+cols))
|
||||
cx = 4
|
||||
cy--
|
||||
src.closer.screen_loc = "11:16,2:16"
|
||||
return
|
||||
|
||||
/obj/item/weapon/secstorage/proc/orient2hud(mob/user as mob)
|
||||
standard_orient_objs()
|
||||
return
|
||||
|
||||
/obj/item/weapon/secstorage/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if ( (istype(W, /obj/item/weapon/card/emag)||istype(W, /obj/item/weapon/melee/energy/blade)) && (src.locked == 1) && (!src.emagged))
|
||||
if(istype(W, /obj/item/weapon/card/emag))
|
||||
var/obj/item/weapon/card/emag/E = W
|
||||
if(E.uses)
|
||||
E.uses--
|
||||
else
|
||||
return
|
||||
emagged = 1
|
||||
src.overlays += image('icons/obj/storage.dmi', icon_sparking)
|
||||
sleep(6)
|
||||
src.overlays = null
|
||||
overlays += image('icons/obj/storage.dmi', icon_locking)
|
||||
locked = 0
|
||||
if(istype(W, /obj/item/weapon/melee/energy/blade))
|
||||
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
|
||||
spark_system.set_up(5, 0, src.loc)
|
||||
spark_system.start()
|
||||
playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
|
||||
playsound(src.loc, "sparks", 50, 1)
|
||||
user << "You slice through the lock on [src]."
|
||||
else
|
||||
user << "You short out the lock on [src]."
|
||||
return
|
||||
if ((W.w_class > internalstorage || istype(W, /obj/item/weapon/secstorage)))
|
||||
return
|
||||
if ((istype(W, /obj/item/weapon/screwdriver)) && (src.locked == 1))
|
||||
sleep(6)
|
||||
src.open =! src.open
|
||||
user.show_message(text("\blue You [] the service panel.", (src.open ? "open" : "close")))
|
||||
return
|
||||
if ((istype(W, /obj/item/device/multitool)) && (src.open == 1) && (src.locked ==1) && (!src.l_hacking))
|
||||
user.show_message(text("\red Now attempting to reset internal memory, please hold."), 1)
|
||||
src.l_hacking = 1
|
||||
if (do_after(usr, 100))
|
||||
if (prob(40))
|
||||
src.l_setshort = 1
|
||||
src.l_set = 0
|
||||
user.show_message(text("\red Internal memory reset. Please give it a few seconds to reinitialize."), 1)
|
||||
sleep(80)
|
||||
src.l_setshort = 0
|
||||
src.l_hacking = 0
|
||||
else
|
||||
user.show_message(text("\red Unable to reset internal memory."), 1)
|
||||
src.l_hacking = 0
|
||||
else src.l_hacking = 0
|
||||
return
|
||||
if (src.contents.len >= 7)
|
||||
return
|
||||
if (src.locked == 1)
|
||||
return
|
||||
user.u_equip(W)
|
||||
W.loc = src
|
||||
if ((user.client && user.s_active != src))
|
||||
user.client.screen -= W
|
||||
src.orient2hud(user)
|
||||
W.dropped(user)
|
||||
add_fingerprint(user)
|
||||
//if (istype(W, /obj/item/weapon/gun/energy/crossbow)) return //STEALTHY
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("\blue [] has added [] to []!", user, W, src), 1)
|
||||
//Foreach goto(139)
|
||||
return
|
||||
|
||||
/obj/item/weapon/secstorage/dropped(mob/user as mob)
|
||||
|
||||
standard_orient_objs()
|
||||
return
|
||||
|
||||
/obj/item/weapon/secstorage/MouseDrop(over_object, src_location, over_location)
|
||||
..()
|
||||
if (src.locked == 1)
|
||||
return
|
||||
|
||||
orient2hud(usr)
|
||||
if ((over_object == usr && ((get_dist(src, usr) <= 1 ||src.locked == 0) || usr.contents.Find(src)))) //|| usr.telekinesis == 1
|
||||
if (usr.s_active)
|
||||
usr.s_active.close(usr)
|
||||
src.show_to(usr)
|
||||
return
|
||||
|
||||
/obj/item/weapon/secstorage/attack_paw(mob/user as mob)
|
||||
playsound(src.loc, "rustle", 50, 1, -5)
|
||||
return src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/item/weapon/secstorage/attack_hand(mob/user as mob)
|
||||
if ((src.loc == user) && (src.locked == 1))
|
||||
usr << "\red [src] is locked and cannot be opened!"
|
||||
else if ((src.loc == user) && (!src.locked))
|
||||
playsound(src.loc, "rustle", 50, 1, -5)
|
||||
if (user.s_active == src)
|
||||
user.s_active.close(user) //Close and re-open
|
||||
src.show_to(user)
|
||||
else
|
||||
user.s_active.close(user) //Just close
|
||||
else
|
||||
..()
|
||||
for(var/mob/M in range(1))
|
||||
if (M.s_active == src)
|
||||
src.close(M)
|
||||
src.orient2hud(user)
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/weapon/secstorage/attack_self(mob/user as mob)
|
||||
user.machine = src
|
||||
var/dat = text("<TT><B>[]</B><BR>\n\nLock Status: []",src, (src.locked ? "LOCKED" : "UNLOCKED"))
|
||||
var/message = "Code"
|
||||
if ((src.l_set == 0) && (!src.emagged) && (!src.l_setshort))
|
||||
dat += text("<p>\n<b>5-DIGIT PASSCODE NOT SET.<br>ENTER NEW PASSCODE.</b>")
|
||||
if (src.emagged)
|
||||
dat += text("<p>\n<font color=red><b>LOCKING SYSTEM ERROR - 1701</b></font>")
|
||||
if (src.l_setshort)
|
||||
dat += text("<p>\n<font color=red><b>ALERT: MEMORY SYSTEM ERROR - 6040 201</b></font>")
|
||||
message = text("[]", src.code)
|
||||
if (!src.locked)
|
||||
message = "*****"
|
||||
dat += text("<HR>\n>[]<BR>\n<A href='?src=\ref[];type=1'>1</A>-<A href='?src=\ref[];type=2'>2</A>-<A href='?src=\ref[];type=3'>3</A><BR>\n<A href='?src=\ref[];type=4'>4</A>-<A href='?src=\ref[];type=5'>5</A>-<A href='?src=\ref[];type=6'>6</A><BR>\n<A href='?src=\ref[];type=7'>7</A>-<A href='?src=\ref[];type=8'>8</A>-<A href='?src=\ref[];type=9'>9</A><BR>\n<A href='?src=\ref[];type=R'>R</A>-<A href='?src=\ref[];type=0'>0</A>-<A href='?src=\ref[];type=E'>E</A><BR>\n</TT>", message, src, src, src, src, src, src, src, src, src, src, src, src)
|
||||
user << browse(dat, "window=caselock;size=300x280")
|
||||
|
||||
/obj/item/weapon/secstorage/Topic(href, href_list)
|
||||
..()
|
||||
if ((usr.stat || usr.restrained()) || (get_dist(src, usr) > 1))
|
||||
return
|
||||
if (href_list["type"])
|
||||
if (href_list["type"] == "E")
|
||||
if ((src.l_set == 0) && (length(src.code) == 5) && (!src.l_setshort) && (src.code != "ERROR"))
|
||||
src.l_code = src.code
|
||||
src.l_set = 1
|
||||
else if ((src.code == src.l_code) && (src.emagged == 0) && (src.l_set == 1))
|
||||
src.locked = 0
|
||||
src.overlays = null
|
||||
overlays += image('icons/obj/storage.dmi', icon_opened)
|
||||
src.code = null
|
||||
else
|
||||
src.code = "ERROR"
|
||||
else
|
||||
if ((href_list["type"] == "R") && (src.emagged == 0) && (!src.l_setshort))
|
||||
src.locked = 1
|
||||
src.overlays = null
|
||||
src.code = null
|
||||
src.close(usr)
|
||||
else
|
||||
src.code += text("[]", href_list["type"])
|
||||
if (length(src.code) > 5)
|
||||
src.code = "ERROR"
|
||||
src.add_fingerprint(usr)
|
||||
for(var/mob/M in viewers(1, src.loc))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_self(M)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/weapon/secstorage/New()
|
||||
|
||||
src.boxes = new /obj/screen/storage( )
|
||||
src.boxes.name = "storage"
|
||||
src.boxes.master = src
|
||||
src.boxes.icon_state = "block"
|
||||
src.boxes.screen_loc = "7,7 to 10,8"
|
||||
src.boxes.layer = 19
|
||||
src.closer = new /obj/screen/close( )
|
||||
src.closer.master = src
|
||||
src.closer.icon_state = "x"
|
||||
src.closer.layer = 20
|
||||
spawn( 5 )
|
||||
standard_orient_objs()
|
||||
return
|
||||
return
|
||||
@@ -0,0 +1,25 @@
|
||||
/obj/item/weapon/secstorage/ssafe
|
||||
name = "secure safe"
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
icon_state = "safe"
|
||||
icon_opened = "safe0"
|
||||
icon_locking = "safeb"
|
||||
icon_sparking = "safespark"
|
||||
flags = FPRINT | TABLEPASS
|
||||
force = 8.0
|
||||
w_class = 8.0
|
||||
internalstorage = 8
|
||||
anchored = 1.0
|
||||
density = 0
|
||||
|
||||
/obj/item/weapon/secstorage/ssafe/New()
|
||||
..()
|
||||
new /obj/item/weapon/paper(src)
|
||||
new /obj/item/weapon/pen(src)
|
||||
|
||||
/obj/item/weapon/secstorage/ssafe/HoS/New()
|
||||
..()
|
||||
//new /obj/item/weapon/storage/lockbox/clusterbang(src) This item is currently broken... and probably shouldnt exist to begin with (even though it's cool)
|
||||
|
||||
/obj/item/weapon/secstorage/ssafe/attack_hand(mob/user as mob)
|
||||
return attack_self(user)
|
||||
@@ -1,197 +0,0 @@
|
||||
/obj/item/weapon/reagent_containers/spray
|
||||
name = "spray bottle"
|
||||
desc = "A spray bottle, with an unscrewable top."
|
||||
icon = 'icons/obj/janitor.dmi'
|
||||
icon_state = "cleaner"
|
||||
item_state = "cleaner"
|
||||
flags = TABLEPASS|OPENCONTAINER|FPRINT|USEDELAY
|
||||
slot_flags = SLOT_BELT
|
||||
throwforce = 3
|
||||
w_class = 2.0
|
||||
throw_speed = 2
|
||||
throw_range = 10
|
||||
amount_per_transfer_from_this = 5
|
||||
volume = 250
|
||||
possible_transfer_amounts = null
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/spray/afterattack(atom/A as mob|obj, mob/user as mob)
|
||||
if(istype(A, /obj/item/weapon/storage) || istype(A, /obj/structure/table) || istype(A, /obj/structure/rack) || istype(A, /obj/structure/closet) \
|
||||
|| istype(A, /obj/item/weapon/reagent_containers) || istype(A, /obj/structure/sink))
|
||||
return
|
||||
|
||||
if(istype(A, /obj/effect/proc_holder/spell))
|
||||
return
|
||||
|
||||
if(istype(A, /obj/structure/reagent_dispensers)) //this block copypasted from reagent_containers/glass, for lack of a better solution
|
||||
if(!A.reagents.total_volume && A.reagents)
|
||||
user << "<span class='notice'>\The [A] is empty.</span>"
|
||||
return
|
||||
|
||||
if(reagents.total_volume >= reagents.maximum_volume)
|
||||
user << "<span class='notice'>\The [src] is full.</span>"
|
||||
return
|
||||
|
||||
var/trans = A.reagents.trans_to(src, A:amount_per_transfer_from_this)
|
||||
user << "<span class='notice'>You fill \the [src] with [trans] units of the contents of \the [A].</span>"
|
||||
return
|
||||
|
||||
if(reagents.total_volume < amount_per_transfer_from_this)
|
||||
user << "<span class='notice'>\The [src] is empty!</span>"
|
||||
return
|
||||
|
||||
var/obj/effect/decal/D = new/obj/effect/decal(get_turf(src))
|
||||
D.create_reagents(amount_per_transfer_from_this)
|
||||
reagents.trans_to(D, amount_per_transfer_from_this)
|
||||
|
||||
D.name = "chemicals"
|
||||
D.icon = 'icons/obj/chempuff.dmi'
|
||||
|
||||
D.icon += mix_color_from_reagents(D.reagents.reagent_list)
|
||||
|
||||
spawn(0)
|
||||
for(var/i=0, i<3, i++)
|
||||
step_towards(D,A)
|
||||
D.reagents.reaction(get_turf(D))
|
||||
for(var/atom/T in get_turf(D))
|
||||
D.reagents.reaction(T)
|
||||
sleep(3)
|
||||
del(D)
|
||||
|
||||
playsound(src.loc, 'sound/effects/spray2.ogg', 50, 1, -6)
|
||||
|
||||
if(reagents.has_reagent("sacid"))
|
||||
message_admins("[key_name_admin(user)] fired sulphuric acid from a spray bottle.")
|
||||
log_game("[key_name(user)] fired sulphuric acid from a spray bottle.")
|
||||
if(reagents.has_reagent("pacid"))
|
||||
message_admins("[key_name_admin(user)] fired Polyacid from a spray bottle.")
|
||||
log_game("[key_name(user)] fired Polyacid from a spray bottle.")
|
||||
if(reagents.has_reagent("lube"))
|
||||
message_admins("[key_name_admin(user)] fired Space lube from a spray bottle.")
|
||||
log_game("[key_name(user)] fired Space lube from a spray bottle.")
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/spray/examine()
|
||||
set src in usr
|
||||
..()
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
usr << "[round(R.volume)] units of [R.name] left."
|
||||
return
|
||||
|
||||
|
||||
//space cleaner
|
||||
/obj/item/weapon/reagent_containers/spray/cleaner
|
||||
name = "space cleaner"
|
||||
desc = "BLAM!-brand non-foaming space cleaner!"
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/spray/cleaner/New()
|
||||
..()
|
||||
reagents.add_reagent("cleaner", 250)
|
||||
|
||||
//pepperspray
|
||||
/obj/item/weapon/reagent_containers/spray/pepper
|
||||
name = "pepperspray"
|
||||
desc = "Manufactured by UhangInc, used to blind and down an opponent quickly."
|
||||
icon = 'icons/obj/weapons.dmi'
|
||||
icon_state = "pepperspray"
|
||||
item_state = "pepperspray"
|
||||
volume = 40
|
||||
amount_per_transfer_from_this = 10
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/spray/pepper/New()
|
||||
..()
|
||||
reagents.add_reagent("condensedcapsaicin", 40)
|
||||
|
||||
|
||||
//chemsprayer
|
||||
/obj/item/weapon/reagent_containers/spray/chemsprayer
|
||||
name = "chem sprayer"
|
||||
desc = "A utility used to spray large amounts of reagent in a given area."
|
||||
icon = 'icons/obj/gun.dmi'
|
||||
icon_state = "chemsprayer"
|
||||
item_state = "chemsprayer"
|
||||
throwforce = 3
|
||||
w_class = 3.0
|
||||
volume = 600
|
||||
origin_tech = "combat=3;materials=3;engineering=3"
|
||||
|
||||
|
||||
//this is a big copypasta clusterfuck, but it's still better than it used to be!
|
||||
/obj/item/weapon/reagent_containers/spray/chemsprayer/afterattack(atom/A as mob|obj, mob/user as mob)
|
||||
if(istype(A, /obj/item/weapon/storage) || istype(A, /obj/structure/table) || istype(A, /obj/structure/rack) || istype(A, /obj/structure/closet) \
|
||||
|| istype(A, /obj/item/weapon/reagent_containers) || istype(A, /obj/structure/sink))
|
||||
return
|
||||
|
||||
if(istype(A, /obj/effect/proc_holder/spell))
|
||||
return
|
||||
|
||||
if(istype(A, /obj/structure/reagent_dispensers)) //this block copypasted from reagent_containers/glass, for lack of a better solution
|
||||
if(!A.reagents.total_volume && A.reagents)
|
||||
user << "<span class='notice'>\The [A] is empty.</span>"
|
||||
return
|
||||
|
||||
if(reagents.total_volume >= reagents.maximum_volume)
|
||||
user << "<span class='notice'>\The [src] is full.</span>"
|
||||
return
|
||||
|
||||
var/trans = A.reagents.trans_to(src, A:amount_per_transfer_from_this)
|
||||
user << "<span class='notice'>You fill \the [src] with [trans] units of the contents of \the [A].</span>"
|
||||
return
|
||||
|
||||
if(reagents.total_volume < amount_per_transfer_from_this)
|
||||
user << "<span class='notice'>\The [src] is empty!</span>"
|
||||
return
|
||||
|
||||
var/Sprays[3]
|
||||
for(var/i=1, i<=3, i++) // intialize sprays
|
||||
if(src.reagents.total_volume < 1) break
|
||||
var/obj/effect/decal/D = new/obj/effect/decal(get_turf(src))
|
||||
D.name = "chemicals"
|
||||
D.icon = 'icons/obj/chempuff.dmi'
|
||||
D.create_reagents(amount_per_transfer_from_this)
|
||||
src.reagents.trans_to(D, amount_per_transfer_from_this)
|
||||
|
||||
D.icon += mix_color_from_reagents(D.reagents.reagent_list)
|
||||
|
||||
Sprays[i] = D
|
||||
|
||||
var/direction = get_dir(src, A)
|
||||
var/turf/T = get_turf(A)
|
||||
var/turf/T1 = get_step(T,turn(direction, 90))
|
||||
var/turf/T2 = get_step(T,turn(direction, -90))
|
||||
var/list/the_targets = list(T,T1,T2)
|
||||
|
||||
for(var/i=1, i<=Sprays.len, i++)
|
||||
spawn()
|
||||
var/obj/effect/decal/D = Sprays[i]
|
||||
if(!D) continue
|
||||
|
||||
// Spreads the sprays a little bit
|
||||
var/turf/my_target = pick(the_targets)
|
||||
the_targets -= my_target
|
||||
|
||||
for(var/j=1, j<=rand(6,8), j++)
|
||||
step_towards(D, my_target)
|
||||
D.reagents.reaction(get_turf(D))
|
||||
for(var/atom/t in get_turf(D))
|
||||
D.reagents.reaction(t)
|
||||
sleep(2)
|
||||
del(D)
|
||||
|
||||
playsound(src.loc, 'sound/effects/spray2.ogg', 50, 1, -6)
|
||||
|
||||
if(reagents.has_reagent("sacid"))
|
||||
message_admins("[key_name_admin(user)] fired sulphuric acid from a chem sprayer.")
|
||||
log_game("[key_name(user)] fired sulphuric acid from a chem sprayer.")
|
||||
if(reagents.has_reagent("pacid"))
|
||||
message_admins("[key_name_admin(user)] fired Polyacid from a chem sprayer.")
|
||||
log_game("[key_name(user)] fired Polyacid from a chem sprayer.")
|
||||
if(reagents.has_reagent("lube"))
|
||||
message_admins("[key_name_admin(user)] fired Space lube from a chem sprayer.")
|
||||
log_game("[key_name(user)] fired Space lube from a chem sprayer.")
|
||||
return
|
||||
|
||||
//looking for plant-b-gone? it's in code/game/objects/items/weapons/hydroponics.dm
|
||||
@@ -0,0 +1,86 @@
|
||||
/obj/item/weapon/storage/MouseDrop(obj/over_object as obj)
|
||||
if (ishuman(usr) || ismonkey(usr)) //so monkeys can take off their backpacks -- Urist
|
||||
var/mob/M = usr
|
||||
if (!( istype(over_object, /obj/screen) ))
|
||||
return ..()
|
||||
if (!(src.loc == usr) || (src.loc && src.loc.loc == usr))
|
||||
return
|
||||
playsound(src.loc, "rustle", 50, 1, -5)
|
||||
if (!( M.restrained() ) && !( M.stat ))
|
||||
switch(over_object.name)
|
||||
if("r_hand")
|
||||
M.u_equip(src)
|
||||
M.put_in_r_hand(src)
|
||||
if("l_hand")
|
||||
M.u_equip(src)
|
||||
M.put_in_l_hand(src)
|
||||
M.update_inv_l_hand()
|
||||
M.update_inv_r_hand()
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
if(over_object == usr && in_range(src, usr) || usr.contents.Find(src))
|
||||
if (usr.s_active)
|
||||
usr.s_active.close(usr)
|
||||
src.show_to(usr)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/backpack/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
playsound(src.loc, "rustle", 50, 1, -5)
|
||||
..()
|
||||
|
||||
|
||||
/obj/item/weapon/storage/backpack/holding
|
||||
name = "Bag of Holding"
|
||||
desc = "A backpack that opens into a localized pocket of Blue Space."
|
||||
origin_tech = "bluespace=4"
|
||||
icon_state = "holdingpack"
|
||||
max_w_class = 4
|
||||
max_combined_w_class = 28
|
||||
|
||||
New()
|
||||
..()
|
||||
return
|
||||
|
||||
attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(crit_fail)
|
||||
user << "\red The Bluespace generator isn't working."
|
||||
return
|
||||
if(istype(W, /obj/item/weapon/storage/backpack/holding) && !W.crit_fail)
|
||||
investigate_log("has become a singularity. Caused by [user.key]","singulo")
|
||||
user << "\red The Bluespace interfaces of the two devices catastrophically malfunction!"
|
||||
del(W)
|
||||
var/obj/machinery/singularity/singulo = new /obj/machinery/singularity (get_turf(src))
|
||||
singulo.energy = 300 //should make it a bit bigger~
|
||||
message_admins("[key_name_admin(user)] detonated a bag of holding")
|
||||
log_game("[key_name(user)] detonated a bag of holding")
|
||||
del(src)
|
||||
return
|
||||
..()
|
||||
|
||||
proc/failcheck(mob/user as mob)
|
||||
if (prob(src.reliability)) return 1 //No failure
|
||||
if (prob(src.reliability))
|
||||
user << "\red The Bluespace portal resists your attempt to add another item." //light failure
|
||||
else
|
||||
user << "\red The Bluespace generator malfunctions!"
|
||||
for (var/obj/O in src.contents) //it broke, delete what was in it
|
||||
del(O)
|
||||
crit_fail = 1
|
||||
icon_state = "brokenpack"
|
||||
|
||||
|
||||
/obj/item/weapon/storage/backpack/santabag
|
||||
name = "Santa's Gift Bag"
|
||||
desc = "Space Santa uses this to deliver toys to all the nice children in space in Christmas! Wow, it's pretty big!"
|
||||
icon_state = "giftbag0"
|
||||
item_state = "giftbag"
|
||||
w_class = 4.0
|
||||
storage_slots = 20
|
||||
max_w_class = 3
|
||||
max_combined_w_class = 400 // can store a ton of shit!
|
||||
|
||||
New()
|
||||
..()
|
||||
return
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
/obj/item/weapon/storage/belt
|
||||
name = "belt"
|
||||
desc = "Can hold various things."
|
||||
icon = 'icons/obj/clothing/belts.dmi'
|
||||
icon_state = "utilitybelt"
|
||||
item_state = "utility"
|
||||
flags = FPRINT | TABLEPASS
|
||||
slot_flags = SLOT_BELT
|
||||
attack_verb = list("whipped", "lashed", "disciplined")
|
||||
|
||||
|
||||
/obj/item/weapon/storage/belt/proc/can_use()
|
||||
if(!ismob(loc)) return 0
|
||||
var/mob/M = loc
|
||||
if(src in M.get_equipped_items())
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
|
||||
/obj/item/weapon/storage/belt/MouseDrop(obj/over_object as obj, src_location, over_location)
|
||||
var/mob/M = usr
|
||||
if(!istype(over_object, /obj/screen))
|
||||
return ..()
|
||||
playsound(src.loc, "rustle", 50, 1, -5)
|
||||
if (!M.restrained() && !M.stat && can_use())
|
||||
switch(over_object.name)
|
||||
if("r_hand")
|
||||
M.u_equip(src)
|
||||
M.put_in_r_hand(src)
|
||||
if("l_hand")
|
||||
M.u_equip(src)
|
||||
M.put_in_l_hand(src)
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/storage/belt/utility
|
||||
name = "tool-belt" //Carn: utility belt is nicer, but it bamboozles the text parsing.
|
||||
desc = "Can hold various tools."
|
||||
icon_state = "utilitybelt"
|
||||
item_state = "utility"
|
||||
can_hold = list(
|
||||
"/obj/item/weapon/crowbar",
|
||||
"/obj/item/weapon/screwdriver",
|
||||
"/obj/item/weapon/weldingtool",
|
||||
"/obj/item/weapon/wirecutters",
|
||||
"/obj/item/weapon/wrench",
|
||||
"/obj/item/device/multitool",
|
||||
"/obj/item/device/flashlight",
|
||||
"/obj/item/weapon/cable_coil",
|
||||
"/obj/item/device/t_scanner",
|
||||
"/obj/item/device/analyzer")
|
||||
|
||||
|
||||
/obj/item/weapon/storage/belt/utility/full/New()
|
||||
..()
|
||||
new /obj/item/weapon/screwdriver(src)
|
||||
new /obj/item/weapon/wrench(src)
|
||||
new /obj/item/weapon/weldingtool(src)
|
||||
new /obj/item/weapon/crowbar(src)
|
||||
new /obj/item/weapon/wirecutters(src)
|
||||
new /obj/item/weapon/cable_coil(src,30,pick("red","yellow","orange"))
|
||||
|
||||
|
||||
/obj/item/weapon/storage/belt/utility/atmostech/New()
|
||||
..()
|
||||
new /obj/item/weapon/screwdriver(src)
|
||||
new /obj/item/weapon/wrench(src)
|
||||
new /obj/item/weapon/weldingtool(src)
|
||||
new /obj/item/weapon/crowbar(src)
|
||||
new /obj/item/weapon/wirecutters(src)
|
||||
new /obj/item/device/analyzer(src)
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/storage/belt/medical
|
||||
name = "medical belt"
|
||||
desc = "Can hold various medical equipment."
|
||||
icon_state = "medicalbelt"
|
||||
item_state = "medical"
|
||||
can_hold = list(
|
||||
"/obj/item/device/healthanalyzer",
|
||||
"/obj/item/weapon/dnainjector",
|
||||
"/obj/item/weapon/reagent_containers/dropper",
|
||||
"/obj/item/weapon/reagent_containers/glass/beaker",
|
||||
"/obj/item/weapon/reagent_containers/glass/bottle",
|
||||
"/obj/item/weapon/reagent_containers/pill",
|
||||
"/obj/item/weapon/reagent_containers/syringe",
|
||||
"/obj/item/weapon/reagent_containers/glass/dispenser",
|
||||
"/obj/item/weapon/lighter/zippo",
|
||||
"/obj/item/weapon/cigpacket",
|
||||
"/obj/item/weapon/storage/pill_bottle",
|
||||
"/obj/item/stack/medical",
|
||||
"/obj/item/device/flashlight/pen"
|
||||
)
|
||||
|
||||
|
||||
/obj/item/weapon/storage/belt/security
|
||||
name = "security belt"
|
||||
desc = "Can hold security gear like handcuffs and flashes."
|
||||
icon_state = "securitybelt"
|
||||
item_state = "security"//Could likely use a better one.
|
||||
storage_slots = 4
|
||||
can_hold = list(
|
||||
"/obj/item/weapon/grenade/flashbang",
|
||||
"/obj/item/weapon/reagent_containers/spray/pepper",
|
||||
"/obj/item/weapon/handcuffs",
|
||||
"/obj/item/device/flash",
|
||||
"/obj/item/clothing/glasses",
|
||||
"/obj/item/ammo_casing/shotgun",
|
||||
"/obj/item/ammo_magazine",
|
||||
"/obj/item/weapon/reagent_containers/food/snacks/donut/normal",
|
||||
"/obj/item/weapon/reagent_containers/food/snacks/donut/jelly"
|
||||
)
|
||||
|
||||
/obj/item/weapon/storage/belt/soulstone
|
||||
name = "soul stone belt"
|
||||
desc = "Designed for ease of access to the shards during a fight, as to not let a single enemy spirit slip away"
|
||||
icon_state = "soulstonebelt"
|
||||
item_state = "soulstonebelt"
|
||||
storage_slots = 6
|
||||
can_hold = list(
|
||||
"/obj/item/device/soulstone"
|
||||
)
|
||||
|
||||
/obj/item/weapon/storage/belt/soulstone/full/New()
|
||||
..()
|
||||
new /obj/item/device/soulstone(src)
|
||||
new /obj/item/device/soulstone(src)
|
||||
new /obj/item/device/soulstone(src)
|
||||
new /obj/item/device/soulstone(src)
|
||||
new /obj/item/device/soulstone(src)
|
||||
new /obj/item/device/soulstone(src)
|
||||
|
||||
|
||||
/obj/item/weapon/storage/belt/champion
|
||||
name = "championship belt"
|
||||
desc = "Proves to the world that you are the strongest!"
|
||||
icon_state = "championbelt"
|
||||
item_state = "champion"
|
||||
storage_slots = 1
|
||||
can_hold = list(
|
||||
"/obj/item/clothing/mask/luchador"
|
||||
)
|
||||
@@ -0,0 +1,88 @@
|
||||
/obj/item/weapon/storage/bible/booze/New()
|
||||
..()
|
||||
new /obj/item/weapon/reagent_containers/food/drinks/beer(src)
|
||||
new /obj/item/weapon/reagent_containers/food/drinks/beer(src)
|
||||
new /obj/item/weapon/spacecash(src)
|
||||
new /obj/item/weapon/spacecash(src)
|
||||
new /obj/item/weapon/spacecash(src)
|
||||
|
||||
/obj/item/weapon/storage/bible/proc/bless(mob/living/carbon/M as mob)
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/heal_amt = 10
|
||||
for(var/datum/organ/external/affecting in H.organs)
|
||||
if(affecting.heal_damage(heal_amt, heal_amt))
|
||||
H.UpdateDamageIcon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/bible/attack(mob/living/M as mob, mob/living/user as mob)
|
||||
|
||||
var/chaplain = 0
|
||||
if(user.mind && (user.mind.assigned_role == "Chaplain"))
|
||||
chaplain = 1
|
||||
|
||||
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been attacked with [src.name] by [user.name] ([user.ckey])</font>")
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to attack [M.name] ([M.ckey])</font>")
|
||||
|
||||
log_attack("<font color='red'>[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>")
|
||||
|
||||
if (!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
|
||||
user << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
if(!chaplain)
|
||||
user << "\red The book sizzles in your hands."
|
||||
user.take_organ_damage(0,10)
|
||||
return
|
||||
|
||||
if ((CLUMSY in user.mutations) && prob(50))
|
||||
user << "\red The [src] slips out of your hand and hits your head."
|
||||
user.take_organ_damage(10)
|
||||
user.Paralyse(20)
|
||||
return
|
||||
|
||||
// if(..() == BLOCKED)
|
||||
// return
|
||||
|
||||
if (M.stat !=2)
|
||||
if(M.mind && (M.mind.assigned_role == "Chaplain"))
|
||||
user << "\red You can't heal yourself!"
|
||||
return
|
||||
/*if((M.mind in ticker.mode.cult) && (prob(20)))
|
||||
M << "\red The power of [src.deity_name] clears your mind of heresy!"
|
||||
user << "\red You see how [M]'s eyes become clear, the cult no longer holds control over him!"
|
||||
ticker.mode.remove_cultist(M.mind)*/
|
||||
if ((istype(M, /mob/living/carbon/human) && prob(60)))
|
||||
bless(M)
|
||||
for(var/mob/O in viewers(M, null))
|
||||
O.show_message(text("\red <B>[] heals [] with the power of [src.deity_name]!</B>", user, M), 1)
|
||||
M << "\red May the power of [src.deity_name] compel you to be healed!"
|
||||
playsound(src.loc, "punch", 25, 1, -1)
|
||||
else
|
||||
if(ishuman(M) && !istype(M:head, /obj/item/clothing/head/helmet))
|
||||
M.adjustBrainLoss(10)
|
||||
M << "\red You feel dumber."
|
||||
for(var/mob/O in viewers(M, null))
|
||||
O.show_message(text("\red <B>[] beats [] over the head with []!</B>", user, M, src), 1)
|
||||
playsound(src.loc, "punch", 25, 1, -1)
|
||||
else if(M.stat == 2)
|
||||
for(var/mob/O in viewers(M, null))
|
||||
O.show_message(text("\red <B>[] smacks []'s lifeless corpse with [].</B>", user, M, src), 1)
|
||||
playsound(src.loc, "punch", 25, 1, -1)
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/bible/afterattack(atom/A, mob/user as mob)
|
||||
if (istype(A, /turf/simulated/floor))
|
||||
user << "\blue You hit the floor with the bible."
|
||||
if(user.mind && (user.mind.assigned_role == "Chaplain"))
|
||||
call(/obj/effect/rune/proc/revealrunes)(src)
|
||||
if(user.mind && (user.mind.assigned_role == "Chaplain"))
|
||||
if(A.reagents && A.reagents.has_reagent("water")) //blesses all the water in the holder
|
||||
user << "\blue You bless [A]."
|
||||
var/water2holy = A.reagents.get_reagent_amount("water")
|
||||
A.reagents.del_reagent("water")
|
||||
A.reagents.add_reagent("holywater",water2holy)
|
||||
|
||||
/obj/item/weapon/storage/bible/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
playsound(src.loc, "rustle", 50, 1, -5)
|
||||
..()
|
||||
@@ -0,0 +1,44 @@
|
||||
/obj/item/weapon/storage/briefcase/New()
|
||||
..()
|
||||
new /obj/item/weapon/paper(src)
|
||||
new /obj/item/weapon/paper(src)
|
||||
new /obj/item/weapon/paper(src)
|
||||
new /obj/item/weapon/paper(src)
|
||||
new /obj/item/weapon/paper(src)
|
||||
new /obj/item/weapon/paper(src)
|
||||
new /obj/item/weapon/pen(src)
|
||||
|
||||
/obj/item/weapon/storage/briefcase/attack(mob/living/M as mob, mob/living/user as mob)
|
||||
//..()
|
||||
|
||||
if ((CLUMSY in user.mutations) && prob(50))
|
||||
user << "\red The [src] slips out of your hand and hits your head."
|
||||
user.take_organ_damage(10)
|
||||
user.Paralyse(2)
|
||||
return
|
||||
|
||||
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been attacked with [src.name] by [user.name] ([user.ckey])</font>")
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to attack [M.name] ([M.ckey])</font>")
|
||||
|
||||
log_attack("<font color='red'>[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>")
|
||||
|
||||
if (M.stat < 2 && M.health < 50 && prob(90))
|
||||
var/mob/H = M
|
||||
// ******* Check
|
||||
if ((istype(H, /mob/living/carbon/human) && istype(H, /obj/item/clothing/head) && H.flags & 8 && prob(80)))
|
||||
M << "\red The helmet protects you from being hit hard in the head!"
|
||||
return
|
||||
var/time = rand(2, 6)
|
||||
if (prob(75))
|
||||
M.Paralyse(time)
|
||||
else
|
||||
M.Stun(time)
|
||||
if(M.stat != 2) M.stat = 1
|
||||
for(var/mob/O in viewers(M, null))
|
||||
O.show_message(text("\red <B>[] has been knocked unconscious!</B>", M), 1, "\red You hear someone fall.", 2)
|
||||
else
|
||||
M << text("\red [] tried to knock you unconcious!",user)
|
||||
M.eye_blurry += 3
|
||||
|
||||
return
|
||||
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* The 'fancy' path is for objects like donut boxes that show how many items are in the storage item on the sprite itself
|
||||
* .. Sorry for the shitty path name, I couldnt think of a better one.
|
||||
*
|
||||
* WARNING: var/icon_type is used for both examine text and sprite name. Please look at the procs below and adjust your sprite names accordingly
|
||||
*
|
||||
* Contains:
|
||||
* Donut Box
|
||||
* Egg Box
|
||||
* Candle Box
|
||||
*/
|
||||
|
||||
/obj/item/weapon/storage/fancy/
|
||||
icon = 'icons/obj/food.dmi'
|
||||
icon_state = "donutbox6"
|
||||
name = "donut box"
|
||||
var/icon_type = "donut"
|
||||
|
||||
/obj/item/weapon/storage/fancy/update_icon(var/itemremoved = 0)
|
||||
var/total_contents = src.contents.len - itemremoved
|
||||
src.icon_state = "[src.icon_type]box[total_contents]"
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/fancy/examine()
|
||||
set src in oview(1)
|
||||
|
||||
if(contents.len <= 0)
|
||||
usr << "There are no [src.icon_type]s left in the box."
|
||||
else if(contents.len == 1)
|
||||
usr << "There is one [src.icon_type] left in the box."
|
||||
else
|
||||
usr << "There are [src.contents.len] [src.icon_type]s in the box."
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Donut Box
|
||||
*/
|
||||
|
||||
/obj/item/weapon/storage/fancy/donut_box
|
||||
icon = 'icons/obj/food.dmi'
|
||||
icon_state = "donutbox6"
|
||||
icon_type = "donut"
|
||||
name = "donut box"
|
||||
storage_slots = 6
|
||||
can_hold = list("/obj/item/weapon/reagent_containers/food/snacks/donut")
|
||||
|
||||
|
||||
/obj/item/weapon/storage/fancy/donut_box/New()
|
||||
..()
|
||||
for(var/i=1; i <= storage_slots; i++)
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/donut/normal(src)
|
||||
return
|
||||
|
||||
/*
|
||||
* Egg Box
|
||||
*/
|
||||
|
||||
/obj/item/weapon/storage/fancy/egg_box
|
||||
icon = 'icons/obj/food.dmi'
|
||||
icon_state = "eggbox"
|
||||
icon_type = "egg"
|
||||
name = "egg box"
|
||||
storage_slots = 12
|
||||
can_hold = list("/obj/item/weapon/reagent_containers/food/snacks/egg")
|
||||
|
||||
/obj/item/weapon/storage/fancy/egg_box/New()
|
||||
..()
|
||||
for(var/i=1; i <= storage_slots; i++)
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/egg(src)
|
||||
return
|
||||
|
||||
/*
|
||||
* Candle Box
|
||||
*/
|
||||
|
||||
/obj/item/weapon/storage/fancy/candle_box
|
||||
name = "Candle pack"
|
||||
desc = "A pack of red candles."
|
||||
icon = 'icons/obj/candle.dmi'
|
||||
icon_state = "candlebox5"
|
||||
icon_type = "candle"
|
||||
item_state = "candlebox5"
|
||||
storage_slots = 5
|
||||
throwforce = 2
|
||||
flags = TABLEPASS
|
||||
slot_flags = SLOT_BELT
|
||||
|
||||
|
||||
/obj/item/weapon/storage/fancy/candle_box/New()
|
||||
..()
|
||||
for(var/i=1; i <= storage_slots; i++)
|
||||
new /obj/item/candle(src)
|
||||
return
|
||||
@@ -0,0 +1,133 @@
|
||||
|
||||
/obj/item/weapon/storage/firstaid/fire/New()
|
||||
..()
|
||||
if (empty) return
|
||||
|
||||
icon_state = pick("ointment","firefirstaid")
|
||||
|
||||
new /obj/item/device/healthanalyzer( src )
|
||||
new /obj/item/stack/medical/ointment( src )
|
||||
new /obj/item/stack/medical/ointment( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/kelotane( src ) //Replaced ointment with these since they actually work --Errorage
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/syringes/New()
|
||||
..()
|
||||
new /obj/item/weapon/reagent_containers/syringe( src )
|
||||
new /obj/item/weapon/reagent_containers/syringe( src )
|
||||
new /obj/item/weapon/reagent_containers/syringe( src )
|
||||
new /obj/item/weapon/reagent_containers/syringe( src )
|
||||
new /obj/item/weapon/reagent_containers/syringe( src )
|
||||
new /obj/item/weapon/reagent_containers/syringe( src )
|
||||
new /obj/item/weapon/reagent_containers/syringe( src )
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/firstaid/regular/New()
|
||||
..()
|
||||
if (empty) return
|
||||
new /obj/item/weapon/reagent_containers/hypospray/autoinjector( src )
|
||||
new /obj/item/stack/medical/bruise_pack(src)
|
||||
new /obj/item/stack/medical/bruise_pack(src)
|
||||
new /obj/item/stack/medical/bruise_pack(src)
|
||||
new /obj/item/stack/medical/ointment(src)
|
||||
new /obj/item/stack/medical/ointment(src)
|
||||
new /obj/item/stack/medical/ointment(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/firstaid/toxin/New()
|
||||
..()
|
||||
if (empty) return
|
||||
|
||||
icon_state = pick("antitoxin","antitoxfirstaid","antitoxfirstaid2","antitoxfirstaid3")
|
||||
|
||||
new /obj/item/device/healthanalyzer( src )
|
||||
new /obj/item/weapon/reagent_containers/syringe/antitoxin( src )
|
||||
new /obj/item/weapon/reagent_containers/syringe/antitoxin( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/antitox( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/antitox( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/antitox( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/antitox( src )
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/firstaid/o2/New()
|
||||
..()
|
||||
if (empty) return
|
||||
new /obj/item/device/healthanalyzer( src )
|
||||
new /obj/item/weapon/reagent_containers/syringe/inaprovaline( src )
|
||||
new /obj/item/weapon/reagent_containers/syringe/inaprovaline( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/dexalin( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/dexalin( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/dexalin( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/dexalin( src )
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/firstaid/adv/New()
|
||||
..()
|
||||
if (empty) return
|
||||
new /obj/item/weapon/reagent_containers/hypospray/autoinjector( src )
|
||||
new /obj/item/stack/medical/advanced/bruise_pack(src)
|
||||
new /obj/item/stack/medical/advanced/bruise_pack(src)
|
||||
new /obj/item/stack/medical/advanced/bruise_pack(src)
|
||||
new /obj/item/stack/medical/advanced/ointment(src)
|
||||
new /obj/item/stack/medical/advanced/ointment(src)
|
||||
new /obj/item/stack/medical/splint(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/pill_bottle/kelotane
|
||||
name = "Pill bottle (kelotane)"
|
||||
desc = "Contains pills used to treat burns."
|
||||
|
||||
/obj/item/weapon/storage/pill_bottle/kelotane/New()
|
||||
..()
|
||||
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/kelotane( src )
|
||||
|
||||
/obj/item/weapon/storage/pill_bottle/tramadol
|
||||
name = "Pill bottle (tramadol)"
|
||||
desc = "Contains painkiller pills."
|
||||
|
||||
/obj/item/weapon/storage/pill_bottle/tramadol/New()
|
||||
..()
|
||||
new /obj/item/weapon/reagent_containers/pill/tramadol( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/tramadol( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/tramadol( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/tramadol( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/tramadol( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/tramadol( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/tramadol( src )
|
||||
|
||||
/obj/item/weapon/storage/pill_bottle/antitox
|
||||
name = "Pill bottle (Anti-toxin)"
|
||||
desc = "Contains pills used to counter toxins."
|
||||
|
||||
/obj/item/weapon/storage/pill_bottle/antitox/New()
|
||||
..()
|
||||
new /obj/item/weapon/reagent_containers/pill/antitox( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/antitox( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/antitox( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/antitox( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/antitox( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/antitox( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/antitox( src )
|
||||
|
||||
/obj/item/weapon/storage/pill_bottle/inaprovaline
|
||||
name = "Pill bottle (inaprovaline)"
|
||||
desc = "Contains pills used to stabilize patients."
|
||||
|
||||
/obj/item/weapon/storage/pill_bottle/inaprovaline/New()
|
||||
..()
|
||||
new /obj/item/weapon/reagent_containers/pill/inaprovaline( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/inaprovaline( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/inaprovaline( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/inaprovaline( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/inaprovaline( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/inaprovaline( src )
|
||||
new /obj/item/weapon/reagent_containers/pill/inaprovaline( src )
|
||||
@@ -0,0 +1,209 @@
|
||||
/obj/item/weapon/storage/lglo_kit/New()
|
||||
|
||||
new /obj/item/clothing/gloves/latex(src)
|
||||
new /obj/item/clothing/gloves/latex(src)
|
||||
new /obj/item/clothing/gloves/latex(src)
|
||||
new /obj/item/clothing/gloves/latex(src)
|
||||
new /obj/item/clothing/gloves/latex(src)
|
||||
new /obj/item/clothing/gloves/latex(src)
|
||||
new /obj/item/clothing/gloves/latex(src)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/blankbox/New()
|
||||
|
||||
new /obj/item/ammo_casing/shotgun/blank(src)
|
||||
new /obj/item/ammo_casing/shotgun/blank(src)
|
||||
new /obj/item/ammo_casing/shotgun/blank(src)
|
||||
new /obj/item/ammo_casing/shotgun/blank(src)
|
||||
new /obj/item/ammo_casing/shotgun/blank(src)
|
||||
new /obj/item/ammo_casing/shotgun/blank(src)
|
||||
new /obj/item/ammo_casing/shotgun/blank(src)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/flashbang_kit/New()
|
||||
|
||||
new /obj/item/weapon/grenade/flashbang(src)
|
||||
new /obj/item/weapon/grenade/flashbang(src)
|
||||
new /obj/item/weapon/grenade/flashbang(src)
|
||||
new /obj/item/weapon/grenade/flashbang(src)
|
||||
new /obj/item/weapon/grenade/flashbang(src)
|
||||
new /obj/item/weapon/grenade/flashbang(src)
|
||||
new /obj/item/weapon/grenade/flashbang(src)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/emp_kit/New()
|
||||
|
||||
new /obj/item/weapon/grenade/empgrenade(src)
|
||||
new /obj/item/weapon/grenade/empgrenade(src)
|
||||
new /obj/item/weapon/grenade/empgrenade(src)
|
||||
new /obj/item/weapon/grenade/empgrenade(src)
|
||||
new /obj/item/weapon/grenade/empgrenade(src)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/stma_kit/New()
|
||||
|
||||
new /obj/item/clothing/mask/surgical(src)
|
||||
new /obj/item/clothing/mask/surgical(src)
|
||||
new /obj/item/clothing/mask/surgical(src)
|
||||
new /obj/item/clothing/mask/surgical(src)
|
||||
new /obj/item/clothing/mask/surgical(src)
|
||||
new /obj/item/clothing/mask/surgical(src)
|
||||
new /obj/item/clothing/mask/surgical(src)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/gl_kit/New()
|
||||
|
||||
new /obj/item/clothing/glasses/regular(src)
|
||||
new /obj/item/clothing/glasses/regular(src)
|
||||
new /obj/item/clothing/glasses/regular(src)
|
||||
new /obj/item/clothing/glasses/regular(src)
|
||||
new /obj/item/clothing/glasses/sunglasses/prescription(src)
|
||||
new /obj/item/clothing/glasses/sunglasses/prescription(src)
|
||||
new /obj/item/clothing/glasses/meson/prescription(src)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/trackimp_kit/New()
|
||||
|
||||
new /obj/item/weapon/implantcase/tracking(src)
|
||||
new /obj/item/weapon/implantcase/tracking(src)
|
||||
new /obj/item/weapon/implantcase/tracking(src)
|
||||
new /obj/item/weapon/implantcase/tracking(src)
|
||||
new /obj/item/weapon/implanter(src)
|
||||
new /obj/item/weapon/implantpad(src)
|
||||
new /obj/item/weapon/locator(src)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/chemimp_kit/New()
|
||||
|
||||
new /obj/item/weapon/implantcase/chem(src)
|
||||
new /obj/item/weapon/implantcase/chem(src)
|
||||
new /obj/item/weapon/implantcase/chem(src)
|
||||
new /obj/item/weapon/implantcase/chem(src)
|
||||
new /obj/item/weapon/implantcase/chem(src)
|
||||
new /obj/item/weapon/implanter(src)
|
||||
new /obj/item/weapon/implantpad(src)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/injectbox/New()
|
||||
|
||||
new /obj/item/weapon/dnainjector/h2m(src)
|
||||
new /obj/item/weapon/dnainjector/h2m(src)
|
||||
new /obj/item/weapon/dnainjector/h2m(src)
|
||||
new /obj/item/weapon/dnainjector/m2h(src)
|
||||
new /obj/item/weapon/dnainjector/m2h(src)
|
||||
new /obj/item/weapon/dnainjector/m2h(src)
|
||||
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/fcard_kit/New()
|
||||
|
||||
new /obj/item/weapon/f_card(src)
|
||||
new /obj/item/weapon/f_card(src)
|
||||
new /obj/item/weapon/f_card(src)
|
||||
new /obj/item/weapon/f_card(src)
|
||||
new /obj/item/weapon/f_card(src)
|
||||
new /obj/item/weapon/f_card(src)
|
||||
new /obj/item/weapon/f_card(src)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/id_kit/New()
|
||||
|
||||
new /obj/item/weapon/card/id(src)
|
||||
new /obj/item/weapon/card/id(src)
|
||||
new /obj/item/weapon/card/id(src)
|
||||
new /obj/item/weapon/card/id(src)
|
||||
new /obj/item/weapon/card/id(src)
|
||||
new /obj/item/weapon/card/id(src)
|
||||
new /obj/item/weapon/card/id(src)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/handcuff_kit/New()
|
||||
|
||||
new /obj/item/weapon/handcuffs(src)
|
||||
new /obj/item/weapon/handcuffs(src)
|
||||
new /obj/item/weapon/handcuffs(src)
|
||||
new /obj/item/weapon/handcuffs(src)
|
||||
new /obj/item/weapon/handcuffs(src)
|
||||
new /obj/item/weapon/handcuffs(src)
|
||||
new /obj/item/weapon/handcuffs(src)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/seccart_kit/New()
|
||||
new /obj/item/weapon/cartridge/security(src)
|
||||
new /obj/item/weapon/cartridge/security(src)
|
||||
new /obj/item/weapon/cartridge/security(src)
|
||||
new /obj/item/weapon/cartridge/security(src)
|
||||
new /obj/item/weapon/cartridge/security(src)
|
||||
new /obj/item/weapon/cartridge/security(src)
|
||||
new /obj/item/weapon/cartridge/security(src)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/donkpocket_kit/New()
|
||||
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/donkpocket(src)
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/donkpocket(src)
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/donkpocket(src)
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/donkpocket(src)
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/donkpocket(src)
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/donkpocket(src)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/condimentbottles/New()
|
||||
|
||||
new /obj/item/weapon/reagent_containers/food/condiment(src)
|
||||
new /obj/item/weapon/reagent_containers/food/condiment(src)
|
||||
new /obj/item/weapon/reagent_containers/food/condiment(src)
|
||||
new /obj/item/weapon/reagent_containers/food/condiment(src)
|
||||
new /obj/item/weapon/reagent_containers/food/condiment(src)
|
||||
new /obj/item/weapon/reagent_containers/food/condiment(src)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/drinkingglasses/New()
|
||||
|
||||
new /obj/item/weapon/reagent_containers/food/drinks/drinkingglass(src)
|
||||
new /obj/item/weapon/reagent_containers/food/drinks/drinkingglass(src)
|
||||
new /obj/item/weapon/reagent_containers/food/drinks/drinkingglass(src)
|
||||
new /obj/item/weapon/reagent_containers/food/drinks/drinkingglass(src)
|
||||
new /obj/item/weapon/reagent_containers/food/drinks/drinkingglass(src)
|
||||
new /obj/item/weapon/reagent_containers/food/drinks/drinkingglass(src)
|
||||
..()
|
||||
return
|
||||
|
||||
/*
|
||||
/obj/item/weapon/storage/disk_kit/disks/New()
|
||||
|
||||
new /obj/item/weapon/card/data(src)
|
||||
new /obj/item/weapon/card/data(src)
|
||||
new /obj/item/weapon/card/data(src)
|
||||
new /obj/item/weapon/card/data(src)
|
||||
new /obj/item/weapon/card/data(src)
|
||||
new /obj/item/weapon/card/data(src)
|
||||
new /obj/item/weapon/card/data(src)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/disk_kit/disks2/New()
|
||||
|
||||
spawn( 2 )
|
||||
for(var/obj/item/weapon/card/data/D in src.loc)
|
||||
D.loc = src
|
||||
//Foreach goto(23)
|
||||
return
|
||||
..()
|
||||
return
|
||||
*/
|
||||
@@ -0,0 +1,88 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
|
||||
|
||||
/obj/item/weapon/storage/lockbox
|
||||
name = "lockbox"
|
||||
desc = "A locked box."
|
||||
icon_state = "lockbox+l"
|
||||
item_state = "syringe_kit"
|
||||
w_class = 4
|
||||
max_w_class = 3
|
||||
max_combined_w_class = 14 //The sum of the w_classes of all the items in this storage item.
|
||||
storage_slots = 4
|
||||
req_access = list(access_armory)
|
||||
var/locked = 1
|
||||
var/broken = 0
|
||||
var/icon_locked = "lockbox+l"
|
||||
var/icon_closed = "lockbox"
|
||||
var/icon_broken = "lockbox+b"
|
||||
|
||||
|
||||
attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/card/id))
|
||||
if(src.broken)
|
||||
user << "\red It appears to be broken."
|
||||
return
|
||||
if(src.allowed(user))
|
||||
src.locked = !( src.locked )
|
||||
if(src.locked)
|
||||
src.icon_state = src.icon_locked
|
||||
user << "\red You lock the [src.name]!"
|
||||
return
|
||||
else
|
||||
src.icon_state = src.icon_closed
|
||||
user << "\red You unlock the [src.name]!"
|
||||
return
|
||||
else
|
||||
user << "\red Access Denied"
|
||||
else if((istype(W, /obj/item/weapon/card/emag)||istype(W, /obj/item/weapon/melee/energy/blade)) && !src.broken)
|
||||
broken = 1
|
||||
locked = 0
|
||||
desc = "It appears to be broken."
|
||||
icon_state = src.icon_broken
|
||||
if(istype(W, /obj/item/weapon/melee/energy/blade))
|
||||
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
|
||||
spark_system.set_up(5, 0, src.loc)
|
||||
spark_system.start()
|
||||
playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
|
||||
playsound(src.loc, "sparks", 50, 1)
|
||||
for(var/mob/O in viewers(user, 3))
|
||||
O.show_message(text("\blue The locker has been sliced open by [] with an energy blade!", user), 1, text("\red You hear metal being sliced and sparks flying."), 2)
|
||||
else
|
||||
for(var/mob/O in viewers(user, 3))
|
||||
O.show_message(text("\blue The locker has been broken by [] with an electromagnetic card!", user), 1, text("You hear a faint electrical spark."), 2)
|
||||
|
||||
if(!locked)
|
||||
..()
|
||||
else
|
||||
user << "\red Its locked!"
|
||||
return
|
||||
|
||||
|
||||
show_to(mob/user as mob)
|
||||
if(locked)
|
||||
user << "\red Its locked!"
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/storage/lockbox/loyalty
|
||||
name = "Lockbox (Loyalty Implants)"
|
||||
req_access = list(access_security)
|
||||
|
||||
New()
|
||||
..()
|
||||
new /obj/item/weapon/implantcase/loyalty(src)
|
||||
new /obj/item/weapon/implantcase/loyalty(src)
|
||||
new /obj/item/weapon/implantcase/loyalty(src)
|
||||
new /obj/item/weapon/implanter/loyalty(src)
|
||||
|
||||
|
||||
/obj/item/weapon/storage/lockbox/clusterbang
|
||||
name = "lockbox (clusterbang)"
|
||||
desc = "You have a bad feeling about opening this."
|
||||
req_access = list(access_security)
|
||||
|
||||
New()
|
||||
..()
|
||||
new /obj/item/weapon/grenade/flashbang/clusterbang(src)
|
||||
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* Contains:
|
||||
* Monkey Cube Box
|
||||
* Candle Packs
|
||||
* Snap Pop Box
|
||||
* Crayon Box
|
||||
*/
|
||||
|
||||
/*
|
||||
* Monkey Cube Box
|
||||
*/
|
||||
|
||||
/obj/item/weapon/storage/monkeycube_box
|
||||
name = "monkey cube box"
|
||||
desc = "Drymate brand monkey cubes. Just add water!"
|
||||
icon = 'icons/obj/food.dmi'
|
||||
icon_state = "monkeycubebox"
|
||||
storage_slots = 7
|
||||
can_hold = list("/obj/item/weapon/reagent_containers/food/snacks/monkeycube")
|
||||
|
||||
|
||||
/obj/item/weapon/storage/monkeycube_box/New()
|
||||
..()
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped(src)
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped(src)
|
||||
return
|
||||
|
||||
/*
|
||||
* Snap Pop Box
|
||||
*/
|
||||
|
||||
/obj/item/weapon/storage/snappopbox
|
||||
name = "snap pop box"
|
||||
desc = "Eight wrappers of fun! Ages 8 and up. Not suitable for children."
|
||||
icon = 'icons/obj/toy.dmi'
|
||||
icon_state = "spbox"
|
||||
storage_slots = 8
|
||||
can_hold = list("/obj/item/toy/snappop")
|
||||
|
||||
/obj/item/weapon/storage/snappopbox/New()
|
||||
..()
|
||||
for(var/i=1; i <= storage_slots; i++)
|
||||
new /obj/item/toy/snappop(src)
|
||||
|
||||
/*
|
||||
* Match Box
|
||||
*/
|
||||
|
||||
/obj/item/weapon/storage/matchbox
|
||||
name = "Matchbox"
|
||||
desc = "A small box of Almost But Not Quite Plasma Premium Matches."
|
||||
icon = 'icons/obj/cigarettes.dmi'
|
||||
icon_state = "matchbox"
|
||||
item_state = "zippo"
|
||||
storage_slots = 10
|
||||
w_class = 1
|
||||
flags = TABLEPASS
|
||||
slot_flags = SLOT_BELT
|
||||
|
||||
|
||||
/obj/item/weapon/storage/matchbox/New()
|
||||
..()
|
||||
for(var/i=1; i <= storage_slots; i++)
|
||||
new /obj/item/weapon/match(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/matchbox/attackby(obj/item/weapon/match/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/match) && W.lit == 0)
|
||||
W.lit = 1
|
||||
W.icon_state = "match_lit"
|
||||
processing_objects.Add(W)
|
||||
W.update_icon()
|
||||
return
|
||||
|
||||
/*
|
||||
* Crayon Box
|
||||
*/
|
||||
|
||||
/obj/item/weapon/storage/crayonbox/New()
|
||||
..()
|
||||
new /obj/item/toy/crayon/red(src)
|
||||
new /obj/item/toy/crayon/orange(src)
|
||||
new /obj/item/toy/crayon/yellow(src)
|
||||
new /obj/item/toy/crayon/green(src)
|
||||
new /obj/item/toy/crayon/blue(src)
|
||||
new /obj/item/toy/crayon/purple(src)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/storage/crayonbox/update_icon()
|
||||
overlays = list() //resets list
|
||||
overlays += image('icons/obj/crayons.dmi',"crayonbox")
|
||||
for(var/obj/item/toy/crayon/crayon in contents)
|
||||
overlays += image('icons/obj/crayons.dmi',crayon.colourName)
|
||||
|
||||
/obj/item/weapon/storage/crayonbox/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/toy/crayon))
|
||||
switch(W:colourName)
|
||||
if("mime")
|
||||
usr << "This crayon is too sad to be contained in this box."
|
||||
return
|
||||
if("rainbow")
|
||||
usr << "This crayon is too powerful to be contained in this box."
|
||||
return
|
||||
..()
|
||||
@@ -0,0 +1,557 @@
|
||||
/obj/item/weapon/storage
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
name = "storage"
|
||||
var/list/can_hold = new/list() //List of objects which this item can store (if set, it can't store anything else)
|
||||
var/list/cant_hold = new/list() //List of objects which this item can't store (in effect only if can_hold isn't set)
|
||||
var/max_w_class = 2 //Max size of objects that this object can store (in effect only if can_hold isn't set)
|
||||
var/max_combined_w_class = 14 //The sum of the w_classes of all the items in this storage item.
|
||||
var/storage_slots = 7 //The number of storage slots in this container.
|
||||
var/obj/screen/storage/boxes = null
|
||||
var/obj/screen/close/closer = null
|
||||
var/use_to_pickup //Set this to make it possible to use this item in an inverse way, so you can have the item in your hand and click items on the floor to pick them up.
|
||||
var/display_contents_with_number //Set this to make the storage item group contents of the same type and display them as a number.
|
||||
var/allow_quick_empty //Set this variable to allow the object to have the 'empty' verb, which dumps all the contents on the floor.
|
||||
var/allow_quick_gather //Set this variable to allow the object to have the 'toggle mode' verb, which quickly collects all items from a tile.
|
||||
var/collection_mode = 1; //0 = pick one at a time, 1 = pick all on tile
|
||||
w_class = 3.0
|
||||
var/foldable = null // BubbleWrap - if set, can be folded (when empty) into a sheet of cardboard
|
||||
|
||||
/obj/item/weapon/storage/proc/return_inv()
|
||||
|
||||
var/list/L = list( )
|
||||
|
||||
L += src.contents
|
||||
|
||||
for(var/obj/item/weapon/storage/S in src)
|
||||
L += S.return_inv()
|
||||
for(var/obj/item/weapon/gift/G in src)
|
||||
L += G.gift
|
||||
if (istype(G.gift, /obj/item/weapon/storage))
|
||||
L += G.gift:return_inv()
|
||||
return L
|
||||
|
||||
/obj/item/weapon/storage/proc/show_to(mob/user as mob)
|
||||
if(user.s_active)
|
||||
user.s_active.hide_from(user)
|
||||
for(var/obj/item/weapon/mousetrap/MT in src)
|
||||
if(MT.armed)
|
||||
for(var/mob/O in viewers(user, null))
|
||||
if(O == user)
|
||||
user.show_message(text("\red <B>You reach into the [src.name], but there was a live mousetrap in there!</B>"), 1)
|
||||
else
|
||||
user.show_message(text("\red <B>[user] reaches into the [src.name] and sets off a hidden mousetrap!</B>"), 1)
|
||||
user.drop_from_inventory(MT)
|
||||
MT.triggered(user, user.hand ? "l_hand" : "r_hand")
|
||||
return
|
||||
user.client.screen -= src.boxes
|
||||
user.client.screen -= src.closer
|
||||
user.client.screen -= src.contents
|
||||
user.client.screen += src.boxes
|
||||
user.client.screen += src.closer
|
||||
user.client.screen += src.contents
|
||||
user.s_active = src
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/proc/hide_from(mob/user as mob)
|
||||
|
||||
if(!user.client)
|
||||
return
|
||||
user.client.screen -= src.boxes
|
||||
user.client.screen -= src.closer
|
||||
user.client.screen -= src.contents
|
||||
if(user.s_active == src)
|
||||
user.s_active = null
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/proc/close(mob/user as mob)
|
||||
|
||||
src.hide_from(user)
|
||||
user.s_active = null
|
||||
return
|
||||
|
||||
//This proc draws out the inventory and places the items on it. tx and ty are the upper left tile and mx, my are the bottm right.
|
||||
//The numbers are calculated from the bottom-left The bottom-left slot being 1,1.
|
||||
/obj/item/weapon/storage/proc/orient_objs(tx, ty, mx, my)
|
||||
var/cx = tx
|
||||
var/cy = ty
|
||||
src.boxes.screen_loc = "[tx]:,[ty] to [mx],[my]"
|
||||
for(var/obj/O in src.contents)
|
||||
O.screen_loc = "[cx],[cy]"
|
||||
O.layer = 20
|
||||
cx++
|
||||
if (cx > mx)
|
||||
cx = tx
|
||||
cy--
|
||||
src.closer.screen_loc = "[mx+1],[my]"
|
||||
return
|
||||
|
||||
//This proc draws out the inventory and places the items on it. It uses the standard position.
|
||||
/obj/item/weapon/storage/proc/standard_orient_objs(var/rows, var/cols, var/list/obj/item/display_contents)
|
||||
var/cx = 4
|
||||
var/cy = 2+rows
|
||||
src.boxes.screen_loc = "4:16,2:16 to [4+cols]:16,[2+rows]:16"
|
||||
|
||||
if(display_contents_with_number)
|
||||
for(var/datum/numbered_display/ND in display_contents)
|
||||
ND.sample_object.screen_loc = "[cx]:16,[cy]:16"
|
||||
ND.sample_object.maptext = "<font color='white'>[(ND.number > 1)? "[ND.number]" : ""]</font>"
|
||||
ND.sample_object.layer = 20
|
||||
cx++
|
||||
if (cx > (4+cols))
|
||||
cx = 4
|
||||
cy--
|
||||
else
|
||||
for(var/obj/O in contents)
|
||||
O.screen_loc = "[cx]:16,[cy]:16"
|
||||
O.maptext = ""
|
||||
O.layer = 20
|
||||
cx++
|
||||
if (cx > (4+cols))
|
||||
cx = 4
|
||||
cy--
|
||||
src.closer.screen_loc = "[4+cols+1]:16,2:16"
|
||||
return
|
||||
|
||||
/datum/numbered_display
|
||||
var/obj/item/sample_object
|
||||
var/number
|
||||
|
||||
New(obj/item/sample as obj)
|
||||
if(!istype(sample))
|
||||
del(src)
|
||||
sample_object = sample
|
||||
number = 1
|
||||
|
||||
//This proc determins the size of the inventory to be displayed. Please touch it only if you know what you're doing.
|
||||
/obj/item/weapon/storage/proc/orient2hud(mob/user as mob)
|
||||
|
||||
var/adjusted_contents = contents.len
|
||||
|
||||
//Numbered contents display
|
||||
var/list/datum/numbered_display/numbered_contents
|
||||
if(display_contents_with_number)
|
||||
numbered_contents = list()
|
||||
adjusted_contents = 0
|
||||
for(var/obj/item/I in contents)
|
||||
var/found = 0
|
||||
for(var/datum/numbered_display/ND in numbered_contents)
|
||||
if(ND.sample_object.type == I.type)
|
||||
ND.number++
|
||||
found = 1
|
||||
break
|
||||
if(!found)
|
||||
adjusted_contents++
|
||||
numbered_contents.Add( new/datum/numbered_display(I) )
|
||||
|
||||
//var/mob/living/carbon/human/H = user
|
||||
var/row_num = 0
|
||||
var/col_count = min(7,storage_slots) -1
|
||||
if (adjusted_contents > 7)
|
||||
row_num = round((adjusted_contents-1) / 7) // 7 is the maximum allowed width.
|
||||
src.standard_orient_objs(row_num, col_count, numbered_contents)
|
||||
return
|
||||
|
||||
//This proc return 1 if the item can be picked up and 0 if it can't.
|
||||
//Set the stop_messages to stop it from printing emssages
|
||||
/obj/item/weapon/storage/proc/can_be_inserted(obj/item/W as obj, stop_messages = 0)
|
||||
if(!istype(W)) return //Not an item
|
||||
|
||||
if(src.loc == W)
|
||||
return 0 //Means the item is already in the storage item
|
||||
if(contents.len >= storage_slots)
|
||||
if(!stop_messages)
|
||||
usr << "\red The [src] is full, make some space."
|
||||
return 0 //Storage item is full
|
||||
|
||||
if(can_hold.len)
|
||||
var/ok = 0
|
||||
for(var/A in can_hold)
|
||||
if(istype(W, text2path(A) ))
|
||||
ok = 1
|
||||
break
|
||||
if(!ok)
|
||||
if(!stop_messages)
|
||||
usr << "\red This [src] cannot hold [W]."
|
||||
return 0
|
||||
|
||||
for(var/A in cant_hold) //Check for specific items which this container can't hold.
|
||||
if(istype(W, text2path(A) ))
|
||||
if(!stop_messages)
|
||||
usr << "\red This [src] cannot hold [W]."
|
||||
return 0
|
||||
|
||||
if (W.w_class > max_w_class)
|
||||
if(!stop_messages)
|
||||
usr << "\red This [W] is too big for this [src]"
|
||||
return 0
|
||||
|
||||
var/sum_w_class = W.w_class
|
||||
for(var/obj/item/I in contents)
|
||||
sum_w_class += I.w_class //Adds up the combined w_classes which will be in the storage item if the item is added to it.
|
||||
|
||||
if(sum_w_class > max_combined_w_class)
|
||||
if(!stop_messages)
|
||||
usr << "\red The [src] is full, make some space."
|
||||
return 0
|
||||
|
||||
if(W.w_class >= src.w_class && (istype(W, /obj/item/weapon/storage)))
|
||||
if(!istype(src, /obj/item/weapon/storage/backpack/holding)) //bohs should be able to hold backpacks again. The override for putting a boh in a boh is in backpack.dm.
|
||||
if(!stop_messages)
|
||||
usr << "\red The [src] cannot hold [W] as it's a storage item of the same size."
|
||||
return 0 //To prevent the stacking of same sized storage items.
|
||||
|
||||
return 1
|
||||
|
||||
//This proc handles items being inserted. It does not perform any checks of whether an item can or can't be inserted. That's done by can_be_inserted()
|
||||
//The stop_warning parameter will stop the insertion message from being displayed. It is intended for cases where you are inserting multiple items at once,
|
||||
//such as when picking up all the items on a tile with one click.
|
||||
/obj/item/weapon/storage/proc/handle_item_insertion(obj/item/W as obj, prevent_warning = 0)
|
||||
if(!istype(W)) return
|
||||
if(usr)
|
||||
usr.u_equip(W)
|
||||
usr.update_icons() //update our overlays
|
||||
W.loc = src
|
||||
W.on_enter_storage(src)
|
||||
if(usr)
|
||||
if (usr.client && usr.s_active != src)
|
||||
usr.client.screen -= W
|
||||
W.dropped(usr)
|
||||
add_fingerprint(usr)
|
||||
|
||||
if(!prevent_warning && !istype(W, /obj/item/weapon/gun/energy/crossbow))
|
||||
for(var/mob/M in viewers(usr, null))
|
||||
if (M == usr)
|
||||
usr << "\blue You put the [W] into [src]."
|
||||
else if (M in range(1)) //If someone is standing close enough, they can tell what it is...
|
||||
M.show_message("\blue [usr] puts [W] into [src].")
|
||||
else if (W && W.w_class >= 3.0) //Otherwise they can only see large or normal items from a distance...
|
||||
M.show_message("\blue [usr] puts [W] into [src].")
|
||||
|
||||
src.orient2hud(usr)
|
||||
if(usr.s_active)
|
||||
usr.s_active.show_to(usr)
|
||||
update_icon()
|
||||
|
||||
//Call this proc to handle the removal of an item from the storage item. The item will be moved to the atom sent as new_target
|
||||
/obj/item/weapon/storage/proc/remove_from_storage(obj/item/W as obj, atom/new_location)
|
||||
if(!istype(W)) return
|
||||
|
||||
if(istype(src, /obj/item/weapon/storage/fancy))
|
||||
var/obj/item/weapon/storage/fancy/F = src
|
||||
F.update_icon(1)
|
||||
|
||||
for(var/mob/M in range(1, src.loc))
|
||||
if (M.s_active == src.loc)
|
||||
if (M.client)
|
||||
M.client.screen -= src
|
||||
|
||||
if(new_location)
|
||||
if(ismob(loc))
|
||||
W.dropped(usr)
|
||||
if(ismob(new_location))
|
||||
W.layer = 20
|
||||
else
|
||||
W.layer = initial(W.layer)
|
||||
W.loc = new_location
|
||||
else
|
||||
W.loc = get_turf(src)
|
||||
|
||||
if(usr)
|
||||
src.orient2hud(usr)
|
||||
if(usr.s_active)
|
||||
usr.s_active.show_to(usr)
|
||||
if(W.maptext)
|
||||
W.maptext = ""
|
||||
W.on_exit_storage(src)
|
||||
update_icon()
|
||||
|
||||
//This proc is called when you want to place an item into the storage item.
|
||||
/obj/item/weapon/storage/attackby(obj/item/W as obj, mob/user as mob)
|
||||
..()
|
||||
|
||||
if(isrobot(user))
|
||||
user << "\blue You're a robot. No."
|
||||
return //Robots can't interact with storage items.
|
||||
|
||||
if(!can_be_inserted(W))
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/tray))
|
||||
var/obj/item/weapon/tray/T = W
|
||||
if(T.calc_carry() > 0)
|
||||
if(prob(85))
|
||||
user << "\red The tray won't fit in [src]."
|
||||
return
|
||||
else
|
||||
W.loc = user.loc
|
||||
if ((user.client && user.s_active != src))
|
||||
user.client.screen -= W
|
||||
W.dropped(user)
|
||||
user << "\red God damnit!"
|
||||
|
||||
handle_item_insertion(W)
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/dropped(mob/user as mob)
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/MouseDrop(over_object, src_location, over_location)
|
||||
..()
|
||||
orient2hud(usr)
|
||||
if ((over_object == usr && (in_range(src, usr) || usr.contents.Find(src))))
|
||||
if (usr.s_active)
|
||||
usr.s_active.close(usr)
|
||||
src.show_to(usr)
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/attack_hand(mob/user as mob)
|
||||
playsound(src.loc, "rustle", 50, 1, -5)
|
||||
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(H.l_store == src && !H.get_active_hand()) //Prevents opening if it's in a pocket.
|
||||
H.put_in_hands(src)
|
||||
H.l_store = null
|
||||
return
|
||||
if(H.r_store == src && !H.get_active_hand())
|
||||
H.put_in_hands(src)
|
||||
H.r_store = null
|
||||
return
|
||||
|
||||
src.orient2hud(user)
|
||||
if (src.loc == user)
|
||||
if (user.s_active)
|
||||
user.s_active.close(user)
|
||||
src.show_to(user)
|
||||
else
|
||||
..()
|
||||
for(var/mob/M in range(1))
|
||||
if (M.s_active == src)
|
||||
src.close(M)
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/verb/toggle_gathering_mode()
|
||||
set name = "Switch Gathering Method"
|
||||
set category = "Object"
|
||||
|
||||
collection_mode = !collection_mode
|
||||
switch (collection_mode)
|
||||
if(1)
|
||||
usr << "The [src] now picks up all ore in a tile at once."
|
||||
if(0)
|
||||
usr << "The [src] now picks up one ore at a time."
|
||||
|
||||
|
||||
/obj/item/weapon/storage/verb/quick_empty()
|
||||
set name = "Empty Contents"
|
||||
set category = "Object"
|
||||
|
||||
if(!ishuman(usr) || usr.stat || usr.restrained())
|
||||
return
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
for(var/obj/item/I in contents)
|
||||
remove_from_storage(I, T)
|
||||
|
||||
/obj/item/weapon/storage/New()
|
||||
|
||||
if(allow_quick_empty)
|
||||
verbs += /obj/item/weapon/storage/verb/quick_empty
|
||||
else
|
||||
verbs -= /obj/item/weapon/storage/verb/quick_empty
|
||||
|
||||
if(allow_quick_gather)
|
||||
verbs += /obj/item/weapon/storage/verb/toggle_gathering_mode
|
||||
else
|
||||
verbs -= /obj/item/weapon/storage/verb/toggle_gathering_mode
|
||||
|
||||
src.boxes = new /obj/screen/storage( )
|
||||
src.boxes.name = "storage"
|
||||
src.boxes.master = src
|
||||
src.boxes.icon_state = "block"
|
||||
src.boxes.screen_loc = "7,7 to 10,8"
|
||||
src.boxes.layer = 19
|
||||
src.closer = new /obj/screen/close( )
|
||||
src.closer.master = src
|
||||
src.closer.icon_state = "x"
|
||||
src.closer.layer = 20
|
||||
orient2hud()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/emp_act(severity)
|
||||
if(!istype(src.loc, /mob/living))
|
||||
for(var/obj/O in contents)
|
||||
O.emp_act(severity)
|
||||
..()
|
||||
|
||||
// BubbleWrap - A box can be folded up to make card
|
||||
/obj/item/weapon/storage/attack_self(mob/user as mob)
|
||||
|
||||
//Clicking on itself will empty it, if it has the verb to do that.
|
||||
if(user.get_active_hand() == src)
|
||||
if(src.verbs.Find(/obj/item/weapon/storage/verb/quick_empty))
|
||||
src.quick_empty()
|
||||
return
|
||||
|
||||
//Otherwise we'll try to fold it.
|
||||
if ( contents.len )
|
||||
return
|
||||
|
||||
if ( !ispath(src.foldable) )
|
||||
return
|
||||
var/found = 0
|
||||
// Close any open UI windows first
|
||||
for(var/mob/M in range(1))
|
||||
if (M.s_active == src)
|
||||
src.close(M)
|
||||
if ( M == user )
|
||||
found = 1
|
||||
if ( !found ) // User is too far away
|
||||
return
|
||||
// Now make the cardboard
|
||||
user << "\blue You fold [src] flat."
|
||||
new src.foldable(get_turf(src))
|
||||
del(src)
|
||||
//BubbleWrap END
|
||||
|
||||
/obj/item/weapon/storage/box/
|
||||
foldable = /obj/item/stack/sheet/cardboard //BubbleWrap
|
||||
|
||||
/obj/item/weapon/storage/box/survival/New()
|
||||
..()
|
||||
contents = list()
|
||||
sleep(1)
|
||||
new /obj/item/clothing/mask/breath( src )
|
||||
new /obj/item/weapon/tank/emergency_oxygen( src )
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/box/engineer/New()
|
||||
..()
|
||||
contents = list()
|
||||
sleep(1)
|
||||
new /obj/item/clothing/mask/breath( src )
|
||||
new /obj/item/weapon/tank/emergency_oxygen/engi( src )
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/box/syndicate/New()
|
||||
..()
|
||||
switch (pickweight(list("bloodyspai" = 1, "stealth" = 1, "screwed" = 1, "guns" = 1, "murder" = 1, "freedom" = 1, "hacker" = 1, "lordsingulo" = 1)))
|
||||
if ("bloodyspai")
|
||||
new /obj/item/clothing/under/chameleon(src)
|
||||
new /obj/item/clothing/mask/gas/voice(src)
|
||||
new /obj/item/weapon/card/id/syndicate(src)
|
||||
new /obj/item/clothing/shoes/syndigaloshes(src)
|
||||
return
|
||||
|
||||
if ("stealth")
|
||||
new /obj/item/weapon/gun/energy/crossbow(src)
|
||||
new /obj/item/weapon/pen/paralysis(src)
|
||||
new /obj/item/device/chameleon(src)
|
||||
return
|
||||
|
||||
if ("screwed")
|
||||
new /obj/effect/spawner/newbomb/timer/syndicate(src)
|
||||
new /obj/effect/spawner/newbomb/timer/syndicate(src)
|
||||
new /obj/item/device/powersink(src)
|
||||
new /obj/item/clothing/suit/space/syndicate(src)
|
||||
new /obj/item/clothing/head/helmet/space/syndicate(src)
|
||||
return
|
||||
|
||||
if ("guns")
|
||||
new /obj/item/weapon/gun/projectile(src)
|
||||
new /obj/item/ammo_magazine/a357(src)
|
||||
new /obj/item/weapon/card/emag(src)
|
||||
new /obj/item/weapon/plastique(src)
|
||||
return
|
||||
|
||||
if ("murder")
|
||||
new /obj/item/weapon/melee/energy/sword(src)
|
||||
new /obj/item/clothing/glasses/thermal/syndi(src)
|
||||
new /obj/item/weapon/card/emag(src)
|
||||
new /obj/item/clothing/shoes/syndigaloshes(src)
|
||||
return
|
||||
|
||||
if("freedom")
|
||||
var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(src)
|
||||
O.imp = new /obj/item/weapon/implant/freedom(O)
|
||||
var/obj/item/weapon/implanter/U = new /obj/item/weapon/implanter(src)
|
||||
U.imp = new /obj/item/weapon/implant/uplink(U)
|
||||
return
|
||||
|
||||
if ("hacker")
|
||||
new /obj/item/weapon/aiModule/syndicate(src)
|
||||
new /obj/item/weapon/card/emag(src)
|
||||
new /obj/item/device/encryptionkey/binary(src)
|
||||
return
|
||||
|
||||
if ("lordsingulo")
|
||||
new /obj/item/device/radio/beacon/syndicate(src)
|
||||
new /obj/item/clothing/suit/space/syndicate(src)
|
||||
new /obj/item/clothing/head/helmet/space/syndicate(src)
|
||||
new /obj/item/weapon/card/emag(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/dice/New()
|
||||
new /obj/item/weapon/dice( src )
|
||||
new /obj/item/weapon/dice/d20( src )
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/mousetraps/New()
|
||||
new /obj/item/weapon/mousetrap( src )
|
||||
new /obj/item/weapon/mousetrap( src )
|
||||
new /obj/item/weapon/mousetrap( src )
|
||||
new /obj/item/weapon/mousetrap( src )
|
||||
new /obj/item/weapon/mousetrap( src )
|
||||
new /obj/item/weapon/mousetrap( src )
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/pill_bottle/MouseDrop(obj/over_object as obj) //Quick pillbottle fix. -Agouri
|
||||
|
||||
if (ishuman(usr) || ismonkey(usr)) //Can monkeys even place items in the pocket slots? Leaving this in just in case~
|
||||
var/mob/M = usr
|
||||
if (!( istype(over_object, /obj/screen) ))
|
||||
return ..()
|
||||
if ((!( M.restrained() ) && !( M.stat ) /*&& M.pocket == src*/))
|
||||
switch(over_object.name)
|
||||
if("r_hand")
|
||||
M.u_equip(src)
|
||||
M.put_in_r_hand(src)
|
||||
if("l_hand")
|
||||
M.u_equip(src)
|
||||
M.put_in_l_hand(src)
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
if(over_object == usr && in_range(src, usr) || usr.contents.Find(src))
|
||||
if (usr.s_active)
|
||||
usr.s_active.close(usr)
|
||||
src.show_to(usr)
|
||||
return
|
||||
return ///////////////////////////////////////////////////////Alright, that should do it. *MARKER* for any possible runtimes
|
||||
|
||||
|
||||
/obj/item/weapon/storage/pill_bottle/verb/toggle_mode()
|
||||
set name = "Switch Pill Bottle Method"
|
||||
set category = "Object"
|
||||
|
||||
mode = !mode
|
||||
switch (mode)
|
||||
if(1)
|
||||
usr << "The pill bottle now picks up all pills in a tile at once."
|
||||
if(0)
|
||||
usr << "The pill bottle now picks up one pill at a time."
|
||||
|
||||
/obj/item/weapon/storage/pillbottlebox/New()
|
||||
new /obj/item/weapon/storage/pill_bottle( src )
|
||||
new /obj/item/weapon/storage/pill_bottle( src )
|
||||
new /obj/item/weapon/storage/pill_bottle( src )
|
||||
new /obj/item/weapon/storage/pill_bottle( src )
|
||||
new /obj/item/weapon/storage/pill_bottle( src )
|
||||
new /obj/item/weapon/storage/pill_bottle( src )
|
||||
new /obj/item/weapon/storage/pill_bottle( src )
|
||||
..()
|
||||
return
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -0,0 +1,41 @@
|
||||
/obj/item/weapon/storage/toolbox/emergency/New()
|
||||
..()
|
||||
new /obj/item/weapon/crowbar/red(src)
|
||||
new /obj/item/weapon/extinguisher/mini(src)
|
||||
if(prob(50))
|
||||
new /obj/item/device/flashlight(src)
|
||||
new /obj/item/device/radio(src)
|
||||
|
||||
/obj/item/weapon/storage/toolbox/mechanical/New()
|
||||
..()
|
||||
new /obj/item/weapon/screwdriver(src)
|
||||
new /obj/item/weapon/wrench(src)
|
||||
new /obj/item/weapon/weldingtool(src)
|
||||
new /obj/item/weapon/crowbar(src)
|
||||
new /obj/item/device/analyzer(src)
|
||||
new /obj/item/weapon/wirecutters(src)
|
||||
|
||||
/obj/item/weapon/storage/toolbox/electrical/New()
|
||||
..()
|
||||
var/color = pick("red","yellow","green","blue","pink","orange","cyan","white")
|
||||
new /obj/item/weapon/screwdriver(src)
|
||||
new /obj/item/weapon/wirecutters(src)
|
||||
new /obj/item/device/t_scanner(src)
|
||||
new /obj/item/weapon/crowbar(src)
|
||||
new /obj/item/weapon/cable_coil(src,30,color)
|
||||
new /obj/item/weapon/cable_coil(src,30,color)
|
||||
if(prob(5))
|
||||
new /obj/item/clothing/gloves/yellow(src)
|
||||
else
|
||||
new /obj/item/weapon/cable_coil(src,30,color)
|
||||
|
||||
/obj/item/weapon/storage/toolbox/syndicate/New()
|
||||
..()
|
||||
var/color = pick("red","yellow","green","blue","pink","orange","cyan","white")
|
||||
new /obj/item/weapon/screwdriver(src)
|
||||
new /obj/item/weapon/wrench(src)
|
||||
new /obj/item/weapon/weldingtool(src)
|
||||
new /obj/item/weapon/crowbar(src)
|
||||
new /obj/item/weapon/cable_coil(src,30,color)
|
||||
new /obj/item/weapon/wirecutters(src)
|
||||
new /obj/item/device/multitool(src)
|
||||
@@ -0,0 +1,53 @@
|
||||
/obj/item/weapon/storage/syndie_kit
|
||||
name = "Box"
|
||||
desc = "A sleek, sturdy box"
|
||||
icon_state = "box_of_doom"
|
||||
item_state = "syringe_kit"
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/imp_freedom
|
||||
name = "Freedom Implant (with injector)"
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/imp_freedom/New()
|
||||
var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(src)
|
||||
O.imp = new /obj/item/weapon/implant/freedom(O)
|
||||
O.update()
|
||||
..()
|
||||
return
|
||||
|
||||
/*/obj/item/weapon/storage/syndie_kit/imp_compress
|
||||
name = "Compressed Matter Implant (with injector)"
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/imp_compress/New()
|
||||
new /obj/item/weapon/implanter/compressed(src)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/imp_explosive
|
||||
name = "Explosive Implant (with injector)"
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/imp_explosive/New()
|
||||
var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(src)
|
||||
O.imp = new /obj/item/weapon/implant/explosive(O)
|
||||
O.name = "(BIO-HAZARD) BIO-detpack"
|
||||
O.update()
|
||||
..()
|
||||
return*/
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/imp_uplink
|
||||
name = "Uplink Implant (with injector)"
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/imp_uplink/New()
|
||||
var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(src)
|
||||
O.imp = new /obj/item/weapon/implant/uplink(O)
|
||||
O.update()
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/space
|
||||
name = "Space Suit and Helmet"
|
||||
|
||||
/obj/item/weapon/storage/syndie_kit/space/New()
|
||||
new /obj/item/clothing/suit/space/syndicate(src)
|
||||
new /obj/item/clothing/head/helmet/space/syndicate(src)
|
||||
..()
|
||||
return
|
||||
@@ -1,54 +0,0 @@
|
||||
/obj/item/clothing/gloves/attackby(obj/item/weapon/W, mob/user)
|
||||
if(istype(src, /obj/item/clothing/gloves/boxing)) //quick fix for stunglove overlay not working nicely with boxing gloves.
|
||||
user << "<span class='notice'>That won't work.</span>" //i'm not putting my lips on that!
|
||||
..()
|
||||
return
|
||||
if(istype(W, /obj/item/weapon/cable_coil))
|
||||
var/obj/item/weapon/cable_coil/C = W
|
||||
if(!wired)
|
||||
if(C.amount >= 2)
|
||||
C.amount -= 2
|
||||
wired = 1
|
||||
siemens_coefficient = 1
|
||||
user << "<span class='notice'>You wrap some wires around [src].</span>"
|
||||
update_icon()
|
||||
else
|
||||
user << "<span class='notice'>There is not enough wire to cover [src].</span>"
|
||||
else
|
||||
user << "<span class='notice'>[src] are already wired.</span>"
|
||||
|
||||
else if(istype(W, /obj/item/weapon/cell))
|
||||
if(!wired)
|
||||
user << "<span class='notice'>[src] need to be wired first.</span>"
|
||||
else if(!cell)
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
cell = W
|
||||
user << "<span class='notice'>You attach a cell to [src].</span>"
|
||||
update_icon()
|
||||
else
|
||||
user << "<span class='notice'>[src] already have a cell.</span>"
|
||||
|
||||
else if(istype(W, /obj/item/weapon/wirecutters))
|
||||
if(cell)
|
||||
cell.updateicon()
|
||||
cell.loc = get_turf(src.loc)
|
||||
cell = null
|
||||
user << "<span class='notice'>You cut the cell away from [src].</span>"
|
||||
update_icon()
|
||||
return
|
||||
if(wired) //wires disappear into the void because fuck that shit
|
||||
wired = 0
|
||||
siemens_coefficient = initial(siemens_coefficient)
|
||||
user << "<span class='notice'>You cut the wires away from [src].</span>"
|
||||
update_icon()
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/clothing/gloves/update_icon()
|
||||
..()
|
||||
overlays = null
|
||||
if(wired)
|
||||
overlays += "gloves_wire"
|
||||
if(cell)
|
||||
overlays += "gloves_cell"
|
||||
@@ -1,17 +1,16 @@
|
||||
/* Surgery Tools
|
||||
* Contains:
|
||||
* Retractor
|
||||
* Hemostat
|
||||
* Cautery
|
||||
* Surgical Drill - MIA!
|
||||
* Scalpel
|
||||
* Circular Saw
|
||||
*/
|
||||
|
||||
/*
|
||||
CONTAINS:
|
||||
RETRACTOR
|
||||
HEMOSTAT
|
||||
CAUTERY
|
||||
SURGICAL DRILL
|
||||
SCALPEL
|
||||
CIRCULAR SAW
|
||||
|
||||
*/
|
||||
|
||||
/////////////
|
||||
//RETRACTOR//
|
||||
/////////////
|
||||
* Retractor
|
||||
*/
|
||||
/obj/item/weapon/retractor/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
if(!istype(M))
|
||||
return
|
||||
@@ -82,10 +81,9 @@ CIRCULAR SAW
|
||||
|
||||
return
|
||||
|
||||
////////////
|
||||
//Hemostat//
|
||||
////////////
|
||||
|
||||
/*
|
||||
* Hemostat
|
||||
*/
|
||||
/obj/item/weapon/hemostat/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
if(!istype(M))
|
||||
return
|
||||
@@ -168,10 +166,9 @@ CIRCULAR SAW
|
||||
|
||||
return
|
||||
|
||||
///////////
|
||||
//Cautery//
|
||||
///////////
|
||||
|
||||
/*
|
||||
* Cautery
|
||||
*/
|
||||
/obj/item/weapon/cautery/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
if(!istype(M))
|
||||
return
|
||||
@@ -246,13 +243,15 @@ CIRCULAR SAW
|
||||
|
||||
return
|
||||
|
||||
|
||||
/*
|
||||
* Surgical Drill
|
||||
*/
|
||||
//obj/item/weapon/surgicaldrill
|
||||
|
||||
|
||||
///////////
|
||||
//SCALPEL//
|
||||
///////////
|
||||
/*
|
||||
* Scalpel
|
||||
*/
|
||||
/obj/item/weapon/scalpel/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
if(!istype(M))
|
||||
return ..()
|
||||
@@ -452,9 +451,9 @@ CIRCULAR SAW
|
||||
return
|
||||
|
||||
|
||||
////////////////
|
||||
//CIRCULAR SAW//
|
||||
////////////////
|
||||
/*
|
||||
* Circular Saw
|
||||
*/
|
||||
/obj/item/weapon/circular_saw/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
if(!istype(M))
|
||||
return ..()
|
||||
|
||||
@@ -1,19 +1,23 @@
|
||||
/*
|
||||
CONTAINS:
|
||||
BANHAMMER
|
||||
SWORD
|
||||
BLADE
|
||||
AXE
|
||||
CLASSIC BATON
|
||||
ENERGY SHIELD (where else should i even put this)
|
||||
*/
|
||||
/* Weapons
|
||||
* Contains:
|
||||
* Banhammer
|
||||
* Sword
|
||||
* Classic Baton
|
||||
* Energy Blade
|
||||
* Energy Axe
|
||||
* Energy Shield
|
||||
*/
|
||||
|
||||
//BANHAMMER
|
||||
/*
|
||||
* Banhammer
|
||||
*/
|
||||
/obj/item/weapon/banhammer/attack(mob/M as mob, mob/user as mob)
|
||||
M << "<font color='red'><b> You have been banned FOR NO REISIN by [user]<b></font>"
|
||||
user << "<font color='red'> You have <b>BANNED</b> [M]</font>"
|
||||
|
||||
// SWORD
|
||||
/*
|
||||
* Sword
|
||||
*/
|
||||
/obj/item/weapon/melee/energy/sword/IsShield()
|
||||
if(active)
|
||||
return 1
|
||||
@@ -51,52 +55,9 @@ ENERGY SHIELD (where else should i even put this)
|
||||
add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/green
|
||||
New()
|
||||
color = "green"
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/red
|
||||
New()
|
||||
color = "red"
|
||||
|
||||
|
||||
// BLADE
|
||||
//Most of the other special functions are handled in their own files.
|
||||
|
||||
/obj/item/weapon/melee/energy/blade/New()
|
||||
spark_system = new /datum/effect/effect/system/spark_spread()
|
||||
spark_system.set_up(5, 0, src)
|
||||
spark_system.attach(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/melee/energy/blade/dropped()
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/melee/energy/blade/proc/throw()
|
||||
del(src)
|
||||
return
|
||||
|
||||
// AXE
|
||||
/obj/item/weapon/melee/energy/axe/attack(target as mob, mob/user as mob)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/melee/energy/axe/attack_self(mob/user as mob)
|
||||
src.active = !( src.active )
|
||||
if (src.active)
|
||||
user << "\blue The axe is now energised."
|
||||
src.force = 150
|
||||
src.icon_state = "axe1"
|
||||
src.w_class = 5
|
||||
else
|
||||
user << "\blue The axe can now be concealed."
|
||||
src.force = 40
|
||||
src.icon_state = "axe0"
|
||||
src.w_class = 5
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
// CLASSIC BATON
|
||||
/*
|
||||
* Classic Baton
|
||||
*/
|
||||
/obj/item/weapon/melee/classic_baton
|
||||
name = "police baton"
|
||||
desc = "A wooden truncheon for beating criminal scum."
|
||||
@@ -141,7 +102,58 @@ ENERGY SHIELD (where else should i even put this)
|
||||
for(var/mob/O in viewers(M))
|
||||
if (O.client) O.show_message("\red <B>[M] has been stunned with the police baton by [user]!</B>", 1, "\red You hear someone fall", 2)
|
||||
|
||||
//ENERGY SHIELD
|
||||
/*
|
||||
*Energy Blade
|
||||
*/
|
||||
//Most of the other special functions are handled in their own files.
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/green
|
||||
New()
|
||||
color = "green"
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/red
|
||||
New()
|
||||
color = "red"
|
||||
|
||||
/obj/item/weapon/melee/energy/blade/New()
|
||||
spark_system = new /datum/effect/effect/system/spark_spread()
|
||||
spark_system.set_up(5, 0, src)
|
||||
spark_system.attach(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/melee/energy/blade/dropped()
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/melee/energy/blade/proc/throw()
|
||||
del(src)
|
||||
return
|
||||
|
||||
/*
|
||||
* Energy Axe
|
||||
*/
|
||||
/obj/item/weapon/melee/energy/axe/attack(target as mob, mob/user as mob)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/melee/energy/axe/attack_self(mob/user as mob)
|
||||
src.active = !( src.active )
|
||||
if (src.active)
|
||||
user << "\blue The axe is now energised."
|
||||
src.force = 150
|
||||
src.icon_state = "axe1"
|
||||
src.w_class = 5
|
||||
else
|
||||
user << "\blue The axe can now be concealed."
|
||||
src.force = 40
|
||||
src.icon_state = "axe0"
|
||||
src.w_class = 5
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
|
||||
/*
|
||||
* Energy Shield
|
||||
*/
|
||||
/obj/item/weapon/shield/energy/IsShield()
|
||||
if(active)
|
||||
return 1
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
/* Table parts and rack parts
|
||||
* Contains:
|
||||
* Table Parts
|
||||
* Reinforced Table Parts
|
||||
* Wooden Table Parts
|
||||
* Rack Parts
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
CONTAINS:
|
||||
TABLE PARTS
|
||||
REINFORCED TABLE PARTS
|
||||
WOODEN TABLE PARTS
|
||||
RACK PARTS
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// TABLE PARTS
|
||||
|
||||
* Table Parts
|
||||
*/
|
||||
/obj/item/weapon/table_parts/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
@@ -31,20 +32,10 @@ RACK PARTS
|
||||
del(src)
|
||||
return
|
||||
|
||||
// WOODEN TABLE PARTS
|
||||
/obj/item/weapon/table_parts/wood/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
new /obj/item/stack/sheet/wood( src.loc )
|
||||
del(src)
|
||||
|
||||
/obj/item/weapon/table_parts/wood/attack_self(mob/user as mob)
|
||||
new /obj/structure/table/woodentable( user.loc )
|
||||
user.drop_item()
|
||||
del(src)
|
||||
return
|
||||
|
||||
|
||||
// REINFORCED TABLE PARTS
|
||||
/*
|
||||
* Reinforced Table Parts
|
||||
*/
|
||||
/obj/item/weapon/table_parts/reinforced/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
new /obj/item/stack/sheet/metal( src.loc )
|
||||
@@ -57,11 +48,23 @@ RACK PARTS
|
||||
del(src)
|
||||
return
|
||||
|
||||
/*
|
||||
* Wooden Table Parts
|
||||
*/
|
||||
/obj/item/weapon/table_parts/wood/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
new /obj/item/stack/sheet/wood( src.loc )
|
||||
del(src)
|
||||
|
||||
/obj/item/weapon/table_parts/wood/attack_self(mob/user as mob)
|
||||
new /obj/structure/table/woodentable( user.loc )
|
||||
user.drop_item()
|
||||
del(src)
|
||||
return
|
||||
|
||||
|
||||
|
||||
// RACK PARTS
|
||||
/*
|
||||
* Rack Parts
|
||||
*/
|
||||
/obj/item/weapon/rack_parts/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
|
||||
|
||||
/obj/item/weapon/tank/jetpack
|
||||
name = "Jetpack (Empty)"
|
||||
desc = "A tank of compressed gas for use as propulsion in zero-gravity areas. Use with caution."
|
||||
icon_state = "jetpack"
|
||||
w_class = 4.0
|
||||
item_state = "jetpack"
|
||||
distribute_pressure = ONE_ATMOSPHERE*O2STANDARD
|
||||
var/datum/effect/effect/system/ion_trail_follow/ion_trail
|
||||
var/on = 0.0
|
||||
var/stabilization_on = 0
|
||||
var/volume_rate = 500 //Needed for borg jetpack transfer
|
||||
icon_action_button = "action_jetpack"
|
||||
|
||||
New()
|
||||
..()
|
||||
src.ion_trail = new /datum/effect/effect/system/ion_trail_follow()
|
||||
src.ion_trail.set_up(src)
|
||||
return
|
||||
|
||||
|
||||
examine()
|
||||
set src in usr
|
||||
..()
|
||||
if(air_contents.oxygen < 10)
|
||||
usr << text("\red <B>The meter on the [src.name] indicates you are almost out of air!</B>")
|
||||
playsound(usr, 'sound/effects/alert.ogg', 50, 1)
|
||||
return
|
||||
|
||||
|
||||
verb/toggle_rockets()
|
||||
set name = "Toggle Jetpack Stabilization"
|
||||
set category = "Object"
|
||||
src.stabilization_on = !( src.stabilization_on )
|
||||
usr << "You toggle the stabilization [stabilization_on? "on":"off"]."
|
||||
return
|
||||
|
||||
|
||||
verb/toggle()
|
||||
set name = "Toggle Jetpack"
|
||||
set category = "Object"
|
||||
on = !on
|
||||
if(on)
|
||||
icon_state = "[icon_state]-on"
|
||||
// item_state = "[item_state]-on"
|
||||
ion_trail.start()
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
// item_state = initial(item_state)
|
||||
ion_trail.stop()
|
||||
return
|
||||
|
||||
|
||||
proc/allow_thrust(num, mob/living/user as mob)
|
||||
if(!(src.on))
|
||||
return 0
|
||||
if((num < 0.005 || src.air_contents.total_moles() < num))
|
||||
src.ion_trail.stop()
|
||||
return 0
|
||||
|
||||
var/datum/gas_mixture/G = src.air_contents.remove(num)
|
||||
|
||||
var/allgases = G.carbon_dioxide + G.nitrogen + G.oxygen + G.toxins //fuck trace gases -Pete
|
||||
if(allgases >= 0.005)
|
||||
return 1
|
||||
|
||||
del(G)
|
||||
return
|
||||
|
||||
ui_action_click()
|
||||
toggle()
|
||||
|
||||
|
||||
/obj/item/weapon/tank/jetpack/void
|
||||
name = "Void Jetpack (Oxygen)"
|
||||
desc = "It works well in a void."
|
||||
icon_state = "jetpack-void"
|
||||
item_state = "jetpack-void"
|
||||
|
||||
New()
|
||||
..()
|
||||
src.air_contents.oxygen = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
return
|
||||
|
||||
/obj/item/weapon/tank/jetpack/oxygen
|
||||
name = "Jetpack (Oxygen)"
|
||||
desc = "A tank of compressed oxygen for use as propulsion in zero-gravity areas. Use with caution."
|
||||
icon_state = "jetpack"
|
||||
item_state = "jetpack"
|
||||
|
||||
New()
|
||||
..()
|
||||
src.air_contents.oxygen = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
return
|
||||
|
||||
/obj/item/weapon/tank/jetpack/carbondioxide
|
||||
name = "Jetpack (Carbon Dioxide)"
|
||||
desc = "A tank of compressed carbon dioxide for use as propulsion in zero-gravity areas. Painted black to indicate that it should not be used as a source for internals."
|
||||
distribute_pressure = 0
|
||||
icon_state = "jetpack-black"
|
||||
item_state = "jetpack-black"
|
||||
|
||||
New()
|
||||
..()
|
||||
src.ion_trail = new /datum/effect/effect/system/ion_trail_follow()
|
||||
src.ion_trail.set_up(src)
|
||||
src.air_contents.carbon_dioxide = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
return
|
||||
|
||||
examine()
|
||||
set src in usr
|
||||
..()
|
||||
if(air_contents.carbon_dioxide < 10)
|
||||
usr << text("\red <B>The meter on the [src.name] indicates you are almost out of air!</B>")
|
||||
playsound(usr, 'sound/effects/alert.ogg', 50, 1)
|
||||
return
|
||||
@@ -0,0 +1,190 @@
|
||||
/* Types of tanks!
|
||||
* Contains:
|
||||
* Oxygen
|
||||
* Anesthetic
|
||||
* Air
|
||||
* Plasma
|
||||
* Emergency Oxygen
|
||||
*/
|
||||
|
||||
/*
|
||||
* Oxygen
|
||||
*/
|
||||
/obj/item/weapon/tank/oxygen
|
||||
name = "Gas Tank (Oxygen)"
|
||||
desc = "A tank of oxygen"
|
||||
icon_state = "oxygen"
|
||||
distribute_pressure = ONE_ATMOSPHERE*O2STANDARD
|
||||
|
||||
|
||||
New()
|
||||
..()
|
||||
src.air_contents.oxygen = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
return
|
||||
|
||||
|
||||
examine()
|
||||
set src in usr
|
||||
..()
|
||||
if(air_contents.oxygen < 10)
|
||||
usr << text("\red <B>The meter on the [src.name] indicates you are almost out of air!</B>")
|
||||
playsound(usr, 'sound/effects/alert.ogg', 50, 1)
|
||||
|
||||
|
||||
/obj/item/weapon/tank/oxygen/yellow
|
||||
name = "Gas Tank (Oxygen)"
|
||||
desc = "A tank of oxygen, this one is yellow."
|
||||
icon_state = "oxygen_f"
|
||||
|
||||
/obj/item/weapon/tank/oxygen/red
|
||||
name = "Gas Tank (Oxygen)"
|
||||
desc = "A tank of oxygen, this one is red."
|
||||
icon_state = "oxygen_fr"
|
||||
|
||||
|
||||
/*
|
||||
* Anesthetic
|
||||
*/
|
||||
/obj/item/weapon/tank/anesthetic
|
||||
name = "Gas Tank (Sleeping Agent)"
|
||||
desc = "A N2O/O2 gas mix"
|
||||
icon_state = "anesthetic"
|
||||
item_state = "an_tank"
|
||||
|
||||
/obj/item/weapon/tank/anesthetic/New()
|
||||
..()
|
||||
|
||||
src.air_contents.oxygen = (3*ONE_ATMOSPHERE)*70/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD
|
||||
|
||||
var/datum/gas/sleeping_agent/trace_gas = new()
|
||||
trace_gas.moles = (3*ONE_ATMOSPHERE)*70/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD
|
||||
|
||||
src.air_contents.trace_gases += trace_gas
|
||||
return
|
||||
|
||||
/*
|
||||
* Air
|
||||
*/
|
||||
/obj/item/weapon/tank/air
|
||||
name = "Gas Tank (Air Mix)"
|
||||
desc = "Mixed anyone?"
|
||||
icon_state = "oxygen"
|
||||
|
||||
|
||||
examine()
|
||||
set src in usr
|
||||
..()
|
||||
if(air_contents.oxygen < 1 && loc==usr)
|
||||
usr << "\red <B>The meter on the [src.name] indicates you are almost out of air!</B>"
|
||||
usr << sound('sound/effects/alert.ogg')
|
||||
|
||||
/obj/item/weapon/tank/air/New()
|
||||
..()
|
||||
|
||||
src.air_contents.oxygen = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD
|
||||
src.air_contents.nitrogen = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD
|
||||
return
|
||||
|
||||
|
||||
/*
|
||||
* Plasma
|
||||
*/
|
||||
/obj/item/weapon/tank/plasma
|
||||
name = "Gas Tank (BIOHAZARD)"
|
||||
desc = "Contains dangerous plasma. Do not inhale."
|
||||
icon_state = "plasma"
|
||||
flags = FPRINT | TABLEPASS | CONDUCT
|
||||
slot_flags = null //they have no straps!
|
||||
|
||||
|
||||
/obj/item/weapon/tank/plasma/New()
|
||||
..()
|
||||
|
||||
src.air_contents.toxins = (3*ONE_ATMOSPHERE)*70/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/tank/plasma/proc/release()
|
||||
var/datum/gas_mixture/removed = air_contents.remove(air_contents.total_moles())
|
||||
|
||||
loc.assume_air(removed)
|
||||
|
||||
/obj/item/weapon/tank/plasma/proc/ignite()
|
||||
var/fuel_moles = air_contents.toxins + air_contents.oxygen/6
|
||||
var/strength = 1
|
||||
|
||||
var/turf/ground_zero = get_turf(loc)
|
||||
loc = null
|
||||
|
||||
if(air_contents.temperature > (T0C + 400))
|
||||
strength = fuel_moles/15
|
||||
|
||||
explosion(ground_zero, strength, strength*2, strength*3, strength*4)
|
||||
|
||||
else if(air_contents.temperature > (T0C + 250))
|
||||
strength = fuel_moles/20
|
||||
|
||||
explosion(ground_zero, 0, strength, strength*2, strength*3)
|
||||
|
||||
else if(air_contents.temperature > (T0C + 100))
|
||||
strength = fuel_moles/25
|
||||
|
||||
explosion(ground_zero, 0, 0, strength, strength*3)
|
||||
|
||||
else
|
||||
ground_zero.assume_air(air_contents)
|
||||
ground_zero.hotspot_expose(1000, 125)
|
||||
|
||||
if(src.master)
|
||||
del(src.master)
|
||||
del(src)
|
||||
|
||||
/obj/item/weapon/tank/plasma/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
|
||||
if (istype(W, /obj/item/weapon/flamethrower))
|
||||
var/obj/item/weapon/flamethrower/F = W
|
||||
if ((!F.status)||(F.ptank)) return
|
||||
src.master = F
|
||||
F.ptank = src
|
||||
user.before_take_item(src)
|
||||
src.loc = F
|
||||
return
|
||||
|
||||
/*
|
||||
* Emergency Oxygen
|
||||
*/
|
||||
/obj/item/weapon/tank/emergency_oxygen
|
||||
name = "emergency oxygen tank"
|
||||
desc = "Used for emergencies. Contains very little oxygen, so try to conserve it until you actually need it."
|
||||
icon_state = "emergency"
|
||||
flags = FPRINT | TABLEPASS | CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
w_class = 2.0
|
||||
force = 4.0
|
||||
distribute_pressure = ONE_ATMOSPHERE*O2STANDARD
|
||||
volume = 3 //Tiny. Real life equivalents only have 21 breaths of oxygen in them. They're EMERGENCY tanks anyway -errorage (dangercon 2011)
|
||||
|
||||
|
||||
New()
|
||||
..()
|
||||
src.air_contents.oxygen = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
return
|
||||
|
||||
|
||||
examine()
|
||||
set src in usr
|
||||
..()
|
||||
if(air_contents.oxygen < 0.2 && loc==usr)
|
||||
usr << text("\red <B>The meter on the [src.name] indicates you are almost out of air!</B>")
|
||||
usr << sound('sound/effects/alert.ogg')
|
||||
|
||||
/obj/item/weapon/tank/emergency_oxygen/engi
|
||||
icon_state = "emergency_engi"
|
||||
name = "extended-capacity emergency oxygen tank"
|
||||
volume = 6
|
||||
|
||||
/obj/item/weapon/tank/emergency_oxygen/double
|
||||
icon_state = "emergency_double"
|
||||
name = "Double Emergency Oxygen Tank"
|
||||
volume = 10
|
||||
@@ -0,0 +1,256 @@
|
||||
/obj/item/weapon/tank
|
||||
name = "tank"
|
||||
icon = 'icons/obj/tank.dmi'
|
||||
flags = FPRINT | TABLEPASS | CONDUCT
|
||||
slot_flags = SLOT_BACK
|
||||
|
||||
pressure_resistance = ONE_ATMOSPHERE*5
|
||||
|
||||
force = 5.0
|
||||
throwforce = 10.0
|
||||
throw_speed = 1
|
||||
throw_range = 4
|
||||
|
||||
var/datum/gas_mixture/air_contents = null
|
||||
var/distribute_pressure = ONE_ATMOSPHERE
|
||||
var/integrity = 3
|
||||
var/volume = 70
|
||||
|
||||
/obj/item/weapon/tank/New()
|
||||
..()
|
||||
|
||||
src.air_contents = new /datum/gas_mixture()
|
||||
src.air_contents.volume = volume //liters
|
||||
src.air_contents.temperature = T20C
|
||||
|
||||
processing_objects.Add(src)
|
||||
|
||||
return
|
||||
|
||||
/obj/item/weapon/tank/Del()
|
||||
if(air_contents)
|
||||
del(air_contents)
|
||||
|
||||
processing_objects.Remove(src)
|
||||
|
||||
..()
|
||||
|
||||
/obj/item/weapon/tank/examine()
|
||||
var/obj/icon = src
|
||||
if (istype(src.loc, /obj/item/assembly))
|
||||
icon = src.loc
|
||||
if (!in_range(src, usr))
|
||||
if (icon == src) usr << "\blue It's \a \icon[icon][src]! If you want any more information you'll need to get closer."
|
||||
return
|
||||
|
||||
var/celsius_temperature = src.air_contents.temperature-T0C
|
||||
var/descriptive
|
||||
|
||||
if (celsius_temperature < 20)
|
||||
descriptive = "cold"
|
||||
else if (celsius_temperature < 40)
|
||||
descriptive = "room temperature"
|
||||
else if (celsius_temperature < 80)
|
||||
descriptive = "lukewarm"
|
||||
else if (celsius_temperature < 100)
|
||||
descriptive = "warm"
|
||||
else if (celsius_temperature < 300)
|
||||
descriptive = "hot"
|
||||
else
|
||||
descriptive = "furiously hot"
|
||||
|
||||
usr << "\blue \The \icon[icon][src] feels [descriptive]"
|
||||
|
||||
return
|
||||
|
||||
/obj/item/weapon/tank/blob_act()
|
||||
if(prob(50))
|
||||
var/turf/location = src.loc
|
||||
if (!( istype(location, /turf) ))
|
||||
del(src)
|
||||
|
||||
if(src.air_contents)
|
||||
location.assume_air(air_contents)
|
||||
|
||||
del(src)
|
||||
|
||||
/obj/item/weapon/tank/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
var/obj/icon = src
|
||||
if (istype(src.loc, /obj/item/assembly))
|
||||
icon = src.loc
|
||||
if ((istype(W, /obj/item/device/analyzer) || (istype(W, /obj/item/device/pda))) && get_dist(user, src) <= 1)
|
||||
|
||||
for (var/mob/O in viewers(user, null))
|
||||
O << "\red [user] has used [W] on \icon[icon] [src]"
|
||||
|
||||
var/pressure = air_contents.return_pressure()
|
||||
|
||||
var/total_moles = air_contents.total_moles()
|
||||
|
||||
user << "\blue Results of analysis of \icon[icon]"
|
||||
if (total_moles>0)
|
||||
var/o2_concentration = air_contents.oxygen/total_moles
|
||||
var/n2_concentration = air_contents.nitrogen/total_moles
|
||||
var/co2_concentration = air_contents.carbon_dioxide/total_moles
|
||||
var/plasma_concentration = air_contents.toxins/total_moles
|
||||
|
||||
var/unknown_concentration = 1-(o2_concentration+n2_concentration+co2_concentration+plasma_concentration)
|
||||
|
||||
user << "\blue Pressure: [round(pressure,0.1)] kPa"
|
||||
user << "\blue Nitrogen: [round(n2_concentration*100)]%"
|
||||
user << "\blue Oxygen: [round(o2_concentration*100)]%"
|
||||
user << "\blue CO2: [round(co2_concentration*100)]%"
|
||||
user << "\blue Plasma: [round(plasma_concentration*100)]%"
|
||||
if(unknown_concentration>0.01)
|
||||
user << "\red Unknown: [round(unknown_concentration*100)]%"
|
||||
user << "\blue Temperature: [round(air_contents.temperature-T0C)]°C"
|
||||
else
|
||||
user << "\blue Tank is empty!"
|
||||
src.add_fingerprint(user)
|
||||
else if (istype(W,/obj/item/latexballon))
|
||||
var/obj/item/latexballon/LB = W
|
||||
LB.blow(src)
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/tank/attack_self(mob/user as mob)
|
||||
if (!(src.air_contents))
|
||||
return
|
||||
user.machine = src
|
||||
|
||||
var/using_internal
|
||||
if(istype(loc,/mob/living/carbon))
|
||||
var/mob/living/carbon/location = loc
|
||||
if(location.internal==src)
|
||||
using_internal = 1
|
||||
|
||||
var/message = {"
|
||||
<b>Tank</b><BR>
|
||||
<FONT color='blue'><b>Tank Pressure:</b> [air_contents.return_pressure()]</FONT><BR>
|
||||
<BR>
|
||||
<b>Mask Release Pressure:</b> <A href='?src=\ref[src];dist_p=-10'>-</A> <A href='?src=\ref[src];dist_p=-1'>-</A> [distribute_pressure] <A href='?src=\ref[src];dist_p=1'>+</A> <A href='?src=\ref[src];dist_p=10'>+</A><BR>
|
||||
<b>Mask Release Valve:</b> <A href='?src=\ref[src];stat=1'>[using_internal?("Open"):("Closed")]</A>
|
||||
"}
|
||||
user << browse(message, "window=tank;size=600x300")
|
||||
onclose(user, "tank")
|
||||
return
|
||||
|
||||
/obj/item/weapon/tank/Topic(href, href_list)
|
||||
..()
|
||||
if (usr.stat|| usr.restrained())
|
||||
return
|
||||
if (src.loc == usr)
|
||||
usr.machine = src
|
||||
if (href_list["dist_p"])
|
||||
var/cp = text2num(href_list["dist_p"])
|
||||
src.distribute_pressure += cp
|
||||
src.distribute_pressure = min(max(round(src.distribute_pressure), 0), 3*ONE_ATMOSPHERE)
|
||||
if (href_list["stat"])
|
||||
if(istype(loc,/mob/living/carbon))
|
||||
var/mob/living/carbon/location = loc
|
||||
if(location.internal == src)
|
||||
location.internal = null
|
||||
location.internals.icon_state = "internal0"
|
||||
usr << "\blue You close the tank release valve."
|
||||
if (location.internals)
|
||||
location.internals.icon_state = "internal0"
|
||||
else
|
||||
if(location.wear_mask && (location.wear_mask.flags & MASKINTERNALS))
|
||||
location.internal = src
|
||||
usr << "\blue You open \the [src] valve."
|
||||
if (location.internals)
|
||||
location.internals.icon_state = "internal1"
|
||||
else
|
||||
usr << "\blue You need something to connect to \the [src]."
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
/*
|
||||
* the following is needed for a tank lying on the floor. But currently we restrict players to use not weared tanks as intrals. --rastaf
|
||||
for(var/mob/M in viewers(1, src.loc))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_self(M)
|
||||
*/
|
||||
src.attack_self(usr)
|
||||
else
|
||||
usr << browse(null, "window=tank")
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/tank/remove_air(amount)
|
||||
return air_contents.remove(amount)
|
||||
|
||||
/obj/item/weapon/tank/return_air()
|
||||
return air_contents
|
||||
|
||||
/obj/item/weapon/tank/assume_air(datum/gas_mixture/giver)
|
||||
air_contents.merge(giver)
|
||||
|
||||
check_status()
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/tank/proc/remove_air_volume(volume_to_return)
|
||||
if(!air_contents)
|
||||
return null
|
||||
|
||||
var/tank_pressure = air_contents.return_pressure()
|
||||
if(tank_pressure < distribute_pressure)
|
||||
distribute_pressure = tank_pressure
|
||||
|
||||
var/moles_needed = distribute_pressure*volume_to_return/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
|
||||
return remove_air(moles_needed)
|
||||
|
||||
/obj/item/weapon/tank/process()
|
||||
//Allow for reactions
|
||||
air_contents.react()
|
||||
check_status()
|
||||
|
||||
|
||||
/obj/item/weapon/tank/proc/check_status()
|
||||
//Handle exploding, leaking, and rupturing of the tank
|
||||
|
||||
if(!air_contents)
|
||||
return 0
|
||||
|
||||
var/pressure = air_contents.return_pressure()
|
||||
if(pressure > TANK_FRAGMENT_PRESSURE)
|
||||
if(!istype(src.loc,/obj/item/device/transfer_valve))
|
||||
message_admins("Explosive tank rupture! last key to touch the tank was [src.fingerprintslast].")
|
||||
log_game("Explosive tank rupture! last key to touch the tank was [src.fingerprintslast].")
|
||||
//world << "\blue[x],[y] tank is exploding: [pressure] kPa"
|
||||
//Give the gas a chance to build up more pressure through reacting
|
||||
air_contents.react()
|
||||
air_contents.react()
|
||||
air_contents.react()
|
||||
pressure = air_contents.return_pressure()
|
||||
var/range = (pressure-TANK_FRAGMENT_PRESSURE)/TANK_FRAGMENT_SCALE
|
||||
range = min(range, MAX_EXPLOSION_RANGE) // was 8 - - - Changed to a configurable define -- TLE
|
||||
var/turf/epicenter = get_turf(loc)
|
||||
|
||||
//world << "\blue Exploding Pressure: [pressure] kPa, intensity: [range]"
|
||||
|
||||
explosion(epicenter, round(range*0.25), round(range*0.5), round(range), round(range*1.5))
|
||||
del(src)
|
||||
|
||||
else if(pressure > TANK_RUPTURE_PRESSURE)
|
||||
//world << "\blue[x],[y] tank is rupturing: [pressure] kPa, integrity [integrity]"
|
||||
if(integrity <= 0)
|
||||
loc.assume_air(air_contents)
|
||||
playsound(src.loc, 'sound/effects/spray.ogg', 10, 1, -3)
|
||||
del(src)
|
||||
else
|
||||
integrity--
|
||||
|
||||
else if(pressure > TANK_LEAK_PRESSURE)
|
||||
//world << "\blue[x],[y] tank is leaking: [pressure] kPa, integrity [integrity]"
|
||||
if(integrity <= 0)
|
||||
var/datum/gas_mixture/leaked_gas = air_contents.remove_ratio(0.25)
|
||||
loc.assume_air(leaked_gas)
|
||||
else
|
||||
integrity--
|
||||
|
||||
else if(integrity < 3)
|
||||
integrity++
|
||||
@@ -1,10 +1,12 @@
|
||||
/* Teleportation devices.
|
||||
* Contains:
|
||||
* Locator
|
||||
* Hand-tele
|
||||
*/
|
||||
|
||||
/*
|
||||
CONTAINS:
|
||||
LOCATOR
|
||||
HAND_TELE
|
||||
|
||||
*/
|
||||
|
||||
* Locator
|
||||
*/
|
||||
/obj/item/weapon/locator/attack_self(mob/user as mob)
|
||||
user.machine = src
|
||||
var/dat
|
||||
@@ -99,8 +101,10 @@ Frequency:
|
||||
src.attack_self(M)
|
||||
return
|
||||
|
||||
/// HAND TELE
|
||||
|
||||
/*
|
||||
* Hand-tele
|
||||
*/
|
||||
/obj/item/weapon/hand_tele/attack_self(mob/user as mob)
|
||||
var/turf/current_location = get_turf(user)//What turf is the user on?
|
||||
if(!current_location||current_location.z==2||current_location.z>=7)//If turf was not found or they're on z level 2 or >7 which does not currently exist.
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
|
||||
|
||||
/* Tools!
|
||||
* Note: Multitools are /obj/item/device
|
||||
*
|
||||
* Contains:
|
||||
* Wrench
|
||||
* Screwdriver
|
||||
* Wirecutters
|
||||
* Welding Tool
|
||||
*/
|
||||
|
||||
/*
|
||||
CONTAINS:
|
||||
|
||||
WRENCH
|
||||
SCREWDRIVER
|
||||
WELDINGTOOOL
|
||||
WIRECUTTERS
|
||||
*/
|
||||
|
||||
|
||||
// WRENCH
|
||||
* Wrench
|
||||
*/
|
||||
/obj/item/weapon/wrench
|
||||
name = "wrench"
|
||||
desc = "A wrench with common uses. Can be found in your hand."
|
||||
@@ -26,7 +28,9 @@ WIRECUTTERS
|
||||
attack_verb = list("bashed", "battered", "bludgeoned", "whacked")
|
||||
|
||||
|
||||
// SCREWDRIVER
|
||||
/*
|
||||
* Screwdriver
|
||||
*/
|
||||
/obj/item/weapon/screwdriver/New()
|
||||
switch(pick("red","blue","purple","brown","green","cyan","yellow"))
|
||||
if ("red")
|
||||
@@ -63,9 +67,43 @@ WIRECUTTERS
|
||||
M = user
|
||||
return eyestab(M,user)
|
||||
|
||||
/*
|
||||
* Wirecutters
|
||||
*/
|
||||
/obj/item/weapon/wirecutters
|
||||
name = "wirecutters"
|
||||
desc = "This cuts wires."
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "cutters"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
force = 6.0
|
||||
throw_speed = 2
|
||||
throw_range = 9
|
||||
w_class = 2.0
|
||||
m_amt = 80
|
||||
origin_tech = "materials=1;engineering=1"
|
||||
attack_verb = list("pinched", "nipped")
|
||||
|
||||
/obj/item/weapon/wirecutters/New()
|
||||
if(prob(50))
|
||||
icon_state = "cutters-y"
|
||||
item_state = "cutters_yellow"
|
||||
|
||||
// WELDING TOOL
|
||||
/obj/item/weapon/wirecutters/attack(mob/M as mob, mob/user as mob)
|
||||
if((M.handcuffed) && (istype(M:handcuffed, /obj/item/weapon/handcuffs/cable)))
|
||||
usr.visible_message("\The [usr] cuts \the [M]'s restraints with \the [src]!",\
|
||||
"You cut \the [M]'s restraints with \the [src]!",\
|
||||
"You hear cable being cut.")
|
||||
M.handcuffed = null
|
||||
M.update_inv_handcuffed()
|
||||
return
|
||||
else
|
||||
..()
|
||||
|
||||
/*
|
||||
* Welding Tool
|
||||
*/
|
||||
/obj/item/weapon/weldingtool
|
||||
name = "welding tool"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
@@ -355,38 +393,4 @@ WIRECUTTERS
|
||||
var/gen_amount = ((world.time-last_gen)/25)
|
||||
reagents += (gen_amount)
|
||||
if(reagents > max_fuel)
|
||||
reagents = max_fuel
|
||||
|
||||
|
||||
|
||||
//WIRECUTTERS
|
||||
/obj/item/weapon/wirecutters
|
||||
name = "wirecutters"
|
||||
desc = "This cuts wires."
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "cutters"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
force = 6.0
|
||||
throw_speed = 2
|
||||
throw_range = 9
|
||||
w_class = 2.0
|
||||
m_amt = 80
|
||||
origin_tech = "materials=1;engineering=1"
|
||||
attack_verb = list("pinched", "nipped")
|
||||
|
||||
/obj/item/weapon/wirecutters/New()
|
||||
if(prob(50))
|
||||
icon_state = "cutters-y"
|
||||
item_state = "cutters_yellow"
|
||||
|
||||
/obj/item/weapon/wirecutters/attack(mob/M as mob, mob/user as mob)
|
||||
if((M.handcuffed) && (istype(M:handcuffed, /obj/item/weapon/handcuffs/cable)))
|
||||
usr.visible_message("\The [usr] cuts \the [M]'s restraints with \the [src]!",\
|
||||
"You cut \the [M]'s restraints with \the [src]!",\
|
||||
"You hear cable being cut.")
|
||||
M.handcuffed = null
|
||||
M.update_inv_handcuffed()
|
||||
return
|
||||
else
|
||||
..()
|
||||
reagents = max_fuel
|
||||
@@ -0,0 +1,75 @@
|
||||
/obj/item/weapon/trashbag
|
||||
icon = 'icons/obj/trash.dmi'
|
||||
icon_state = "trashbag0"
|
||||
item_state = "trashbag"
|
||||
name = "Trash bag"
|
||||
desc = "A heavy-duty, no fun allowed trash bag."
|
||||
var/mode = 1; //0 = pick one at a time, 1 = pick all on tile
|
||||
var/capacity = 25; //the number of trash it can carry.
|
||||
flags = FPRINT | TABLEPASS
|
||||
slot_flags = SLOT_BELT
|
||||
w_class = 2.0
|
||||
|
||||
/obj/item/weapon/trashbag/update_icon()
|
||||
if(contents.len == 0)
|
||||
icon_state = "trashbag0"
|
||||
else if(contents.len < 12)
|
||||
icon_state = "trashbag1"
|
||||
else if(contents.len < 25)
|
||||
icon_state = "trashbag2"
|
||||
else icon_state = "trashbag3"
|
||||
|
||||
/obj/item/weapon/trashbag/attackby(obj/item/W as obj, mob/living/user as mob)
|
||||
..()
|
||||
if (contents.len < capacity)
|
||||
if (istype(W, /obj/item))
|
||||
if (W.w_class <= 2)
|
||||
var/obj/item/O = W
|
||||
src.contents += O
|
||||
else
|
||||
user << "\blue The bag is full!"
|
||||
|
||||
/obj/item/weapon/trashbag/attack_self(mob/living/user as mob)
|
||||
|
||||
if(contents.len > 0)
|
||||
for(var/obj/item/I in src.contents)
|
||||
I.loc = user.loc
|
||||
update_icon()
|
||||
user << "\blue You drop all the trash onto the floor."
|
||||
|
||||
/obj/item/weapon/trashbag/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, flag)
|
||||
if(istype(target, /obj/item))
|
||||
var/obj/item/W = target
|
||||
if(W.w_class <= 2)
|
||||
if(mode == 1)
|
||||
if(contents.len < capacity) //slightly redundant, but it makes it prettier in the chatbox. -Pete
|
||||
user << "\blue You pick up all the trash."
|
||||
for(var/obj/item/O in get_turf(W))
|
||||
if(istype(O, /obj/item/weapon/disk/nuclear)) continue //No nuke disks - Nodrak
|
||||
if(contents.len < capacity)
|
||||
if(O.w_class <= 2)
|
||||
contents += O;
|
||||
else
|
||||
user << "\blue The bag is full!"
|
||||
break
|
||||
else
|
||||
user << "\blue The bag is full!"
|
||||
else
|
||||
if(istype(W, /obj/item/weapon/disk/nuclear)) return //No nuke disks - Nodrak
|
||||
if(contents.len < capacity)
|
||||
contents += W;
|
||||
else
|
||||
user << "\blue The bag is full!"
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/trashbag/verb/toggle_mode()
|
||||
set name = "Switch Bag Method"
|
||||
set category = "Object"
|
||||
|
||||
mode = !mode
|
||||
switch (mode)
|
||||
if(1)
|
||||
usr << "The bag now picks up all trash in a tile at once."
|
||||
else
|
||||
usr << "The bag now picks up one piece of trash at a time."
|
||||
@@ -1,3 +1,10 @@
|
||||
/* Two-handed Weapons
|
||||
* Contains:
|
||||
* Twohanded
|
||||
* Fireaxe
|
||||
* Double-Bladed Energy Swords
|
||||
*/
|
||||
|
||||
/*##################################################################
|
||||
##################### TWO HANDED WEAPONS BE HERE~ -Agouri :3 ########
|
||||
####################################################################*/
|
||||
@@ -6,10 +13,15 @@
|
||||
//This rewrite means we don't have two variables for EVERY item which are used only by a few weapons.
|
||||
//It also tidies stuff up elsewhere.
|
||||
|
||||
/*
|
||||
* Twohanded
|
||||
*/
|
||||
/obj/item/weapon/twohanded
|
||||
var/wielded = 0
|
||||
var/force_unwielded = 0
|
||||
var/force_wielded = 0
|
||||
var/wieldsound = null
|
||||
var/unwieldsound = null
|
||||
|
||||
/obj/item/weapon/twohanded/proc/unwield()
|
||||
wielded = 0
|
||||
@@ -54,6 +66,8 @@
|
||||
if(wielded) //Trying to unwield it
|
||||
unwield()
|
||||
user << "<span class='notice'>You are now carrying the [name] with one hand.</span>"
|
||||
if (src.unwieldsound)
|
||||
playsound(src.loc, unwieldsound, 50, 1)
|
||||
|
||||
var/obj/item/weapon/twohanded/offhand/O = user.get_inactive_hand()
|
||||
if(O && istype(O))
|
||||
@@ -66,6 +80,8 @@
|
||||
return
|
||||
wield()
|
||||
user << "<span class='notice'>You grab the [initial(name)] with both hands.</span>"
|
||||
if (src.wieldsound)
|
||||
playsound(src.loc, wieldsound, 50, 1)
|
||||
|
||||
var/obj/item/weapon/twohanded/offhand/O = new(user) ////Let's reserve his other hand~
|
||||
O.name = "[initial(name)] - offhand"
|
||||
@@ -85,7 +101,9 @@
|
||||
wield()
|
||||
del(src)
|
||||
|
||||
////////////FIREAXE!//////////////
|
||||
/*
|
||||
* Fireaxe
|
||||
*/
|
||||
/obj/item/weapon/twohanded/fireaxe // DEM AXES MAN, marker -Agouri
|
||||
icon_state = "fireaxe0"
|
||||
name = "fire axe"
|
||||
@@ -113,4 +131,47 @@
|
||||
if (W.dir == SOUTHWEST)
|
||||
new /obj/item/weapon/shard( W.loc )
|
||||
if(W.reinf) new /obj/item/stack/rods( W.loc)
|
||||
del(A)
|
||||
del(A)
|
||||
|
||||
|
||||
/*
|
||||
* Double-Bladed Energy Swords - Cheridan
|
||||
*/
|
||||
/obj/item/weapon/twohanded/dualsaber
|
||||
icon_state = "dualsaber0"
|
||||
name = "double-bladed energy sword"
|
||||
desc = "Handle with care."
|
||||
force = 3
|
||||
throwforce = 5.0
|
||||
throw_speed = 1
|
||||
throw_range = 5
|
||||
w_class = 2.0
|
||||
force_unwielded = 3
|
||||
force_wielded = 30
|
||||
wieldsound = 'sound/weapons/saberon.ogg'
|
||||
unwieldsound = 'sound/weapons/saberoff.ogg'
|
||||
flags = FPRINT | TABLEPASS | NOSHIELD
|
||||
origin_tech = "magnets=3;syndicate=4"
|
||||
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
|
||||
|
||||
/obj/item/weapon/twohanded/dualsaber/update_icon()
|
||||
icon_state = "dualsaber[wielded]"
|
||||
return
|
||||
|
||||
/obj/item/weapon/twohanded/dualsaber/attack(target as mob, mob/living/user as mob)
|
||||
..()
|
||||
if((CLUMSY in user.mutations) && (wielded) &&prob(40))
|
||||
user << "\red You twirl around a bit before losing your balance and impaling yourself on the [src]."
|
||||
user.take_organ_damage(20,25)
|
||||
return
|
||||
if((wielded) && prob(50))
|
||||
spawn(0)
|
||||
for(var/i in list(1,2,4,8,4,2,1,2,4,8,4,2))
|
||||
user.dir = i
|
||||
sleep(1)
|
||||
|
||||
/obj/item/weapon/twohanded/dualsaber/IsShield()
|
||||
if(wielded)
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
@@ -0,0 +1,20 @@
|
||||
// WIRES
|
||||
|
||||
/obj/item/weapon/wire/proc/update()
|
||||
if (src.amount > 1)
|
||||
src.icon_state = "spool_wire"
|
||||
src.desc = text("This is just spool of regular insulated wire. It consists of about [] unit\s of wire.", src.amount)
|
||||
else
|
||||
src.icon_state = "item_wire"
|
||||
src.desc = "This is just a simple piece of regular insulated wire."
|
||||
return
|
||||
|
||||
/obj/item/weapon/wire/attack_self(mob/user as mob)
|
||||
if (src.laying)
|
||||
src.laying = 0
|
||||
user << "\blue You're done laying wire!"
|
||||
else
|
||||
user << "\blue You are not using this to lay wire..."
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user