You have purchased the latest in listening equipment. The telecommunication setup we created is the best in listening to common and private radio fequencies. Here is a step by step guide to start listening in on those saucy radio channels:
Equip yourself with a multi-tool
Use the multitool on each machine, that is the broadcaster, receiver and the relay.
Turn all the machines on, it has already been configured for you to listen on.
Simple as that. Now to listen to the private channels, you'll have to configure the intercoms, located on the front desk. Here is a list of frequencies for you to listen on.
"
- //gamemode
- if(admin || config.allow_vote_mode)
- . += "GameMode"
- else
- . += "GameMode (Disallowed)"
- if(admin)
- . += "\t([config.allow_vote_mode?"Allowed":"Disallowed"])"
+ text += "The vote has ended." // What will be shown if it is a gamemode vote that isn't extended
- . += "
"
@@ -234,6 +233,7 @@
body += ""
body += ""
+ body += ""
if(ismob(D))
body += ""
@@ -293,18 +293,18 @@
body += ""
var/list/names = list()
- for (var/V in D.vars)
+ for(var/V in D.vars)
names += V
names = sortList(names)
- for (var/V in names)
+ for(var/V in names)
body += debug_variable(V, D.vars[V], 0, D)
body += ""
var/html = ""
- if (title)
+ if(title)
html += "[title]"
html += {"
-
-
-
[name]
[show_sensors ? "
Sensor Data:
" + sensor_data : ""]
"}
diff --git a/code/game/machinery/atmoalter/area_atmos_computer.dm b/code/game/machinery/atmoalter/area_atmos_computer.dm
index 0b1be444c7c..a75c3afac88 100644
--- a/code/game/machinery/atmoalter/area_atmos_computer.dm
+++ b/code/game/machinery/atmoalter/area_atmos_computer.dm
@@ -85,7 +85,9 @@
[zone]
"}
- user << browse("[dat]", "window=miningshuttle;size=400x400")
+ var/datum/browser/popup = new(user, "area_atmos", name, 400, 400)
+ popup.set_content(dat)
+ popup.open(0)
status = ""
Topic(href, href_list)
@@ -111,6 +113,7 @@
scrubber.update_icon()
proc/validscrubber( var/obj/machinery/portable_atmospherics/scrubber/huge/scrubber as obj )
+ // TODO: Tie into space manager
if(!isobj(scrubber) || get_dist(scrubber.loc, src.loc) > src.range || scrubber.loc.z != src.loc.z)
return 0
@@ -174,4 +177,4 @@
if(!found)
status = "ERROR: No scrubber found!"
- src.updateUsrDialog()
\ No newline at end of file
+ src.updateUsrDialog()
diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm
index 14b3ca3fc59..7eb01d06988 100644
--- a/code/game/machinery/atmoalter/canister.dm
+++ b/code/game/machinery/atmoalter/canister.dm
@@ -178,7 +178,7 @@ update_flag
(note: colors and decals has to be applied every icon update)
*/
- if (src.destroyed)
+ if(src.destroyed)
src.overlays = 0
src.icon_state = text("[]-1", src.canister_color["prim"])//yes, I KNOW the colours don't reflect when the can's borked, whatever.
@@ -217,27 +217,27 @@ update_flag
//template modification exploit prevention, used in Topic()
/obj/machinery/portable_atmospherics/canister/proc/is_a_color(var/inputVar, var/checkColor = "all")
- if (checkColor == "prim" || checkColor == "all")
+ if(checkColor == "prim" || checkColor == "all")
for(var/list/L in canister_icon_container.possiblemaincolor)
- if (L["icon"] == inputVar)
+ if(L["icon"] == inputVar)
return 1
- if (checkColor == "sec" || checkColor == "all")
+ if(checkColor == "sec" || checkColor == "all")
for(var/list/L in canister_icon_container.possibleseccolor)
- if (L["icon"] == inputVar)
+ if(L["icon"] == inputVar)
return 1
- if (checkColor == "ter" || checkColor == "all")
+ if(checkColor == "ter" || checkColor == "all")
for(var/list/L in canister_icon_container.possibletertcolor)
- if (L["icon"] == inputVar)
+ if(L["icon"] == inputVar)
return 1
- if (checkColor == "quart" || checkColor == "all")
+ if(checkColor == "quart" || checkColor == "all")
for(var/list/L in canister_icon_container.possiblequartcolor)
- if (L["icon"] == inputVar)
+ if(L["icon"] == inputVar)
return 1
return 0
/obj/machinery/portable_atmospherics/canister/proc/is_a_decal(var/inputVar)
for(var/list/L in canister_icon_container.possibledecals)
- if (L["icon"] == inputVar)
+ if(L["icon"] == inputVar)
return 1
return 0
@@ -250,7 +250,7 @@ update_flag
if(destroyed)
return 1
- if (src.health <= 10)
+ if(src.health <= 10)
var/atom/location = src.loc
location.assume_air(air_contents)
air_update_turf()
@@ -260,7 +260,7 @@ update_flag
src.density = 0
update_icon()
- if (src.holding)
+ if(src.holding)
src.holding.loc = src.loc
src.holding = null
@@ -269,7 +269,7 @@ update_flag
return 1
/obj/machinery/portable_atmospherics/canister/process()
- if (destroyed)
+ if(destroyed)
return
..()
@@ -383,7 +383,7 @@ update_flag
return src.ui_interact(user)
/obj/machinery/portable_atmospherics/canister/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
- if (src.destroyed)
+ if(src.destroyed)
return
init_data_vars() //set up var/colorcontainer and var/possibledecals
@@ -404,12 +404,12 @@ update_flag
data["valveOpen"] = valve_open ? 1 : 0
data["hasHoldingTank"] = holding ? 1 : 0
- if (holding)
+ if(holding)
data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure()))
// update the ui if it exists, returns null if no ui is passed/found
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
ui = new(user, src, ui_key, "canister.tmpl", "Canister", 480, 400, state = physical_state)
@@ -428,18 +428,18 @@ update_flag
if(..())
return 1
- if (href_list["choice"] == "menu")
+ if(href_list["choice"] == "menu")
menu = text2num(href_list["mode_target"])
if(href_list["toggle"])
var/logmsg
- if (valve_open)
- if (holding)
+ if(valve_open)
+ if(holding)
logmsg = "Valve was closed by [usr] ([usr.ckey]), stopping the transfer into the [holding] "
else
logmsg = "Valve was closed by [usr] ([usr.ckey]), stopping the transfer into the air "
else
- if (holding)
+ if(holding)
logmsg = "Valve was opened by [usr] ([usr.ckey]), starting the transfer into the [holding] "
else
logmsg = "Valve was opened by [usr] ([usr.ckey]), starting the transfer into the air "
@@ -454,53 +454,53 @@ update_flag
release_log += logmsg
valve_open = !valve_open
- if (href_list["remove_tank"])
+ if(href_list["remove_tank"])
if(holding)
- if (valve_open)
+ if(valve_open)
valve_open = 0
release_log += "Valve was closed by [usr] ([usr.ckey]), stopping the transfer into the [holding] "
holding.loc = loc
holding = null
- if (href_list["pressure_adj"])
+ if(href_list["pressure_adj"])
var/diff = text2num(href_list["pressure_adj"])
if(diff > 0)
release_pressure = min(10*ONE_ATMOSPHERE, release_pressure+diff)
else
release_pressure = max(ONE_ATMOSPHERE/10, release_pressure+diff)
- if (href_list["rename"])
- if (can_label)
+ if(href_list["rename"])
+ if(can_label)
var/T = sanitize(copytext(input("Choose canister label", "Name", name) as text|null,1,MAX_NAME_LEN))
- if (can_label) //Exploit prevention
- if (T)
+ if(can_label) //Exploit prevention
+ if(T)
name = T
else
name = "canister"
else
to_chat(usr, "\red As you attempted to rename it the pressure rose!")
- if (href_list["choice"] == "Primary color")
- if (is_a_color(href_list["icon"],"prim"))
+ if(href_list["choice"] == "Primary color")
+ if(is_a_color(href_list["icon"],"prim"))
canister_color["prim"] = href_list["icon"]
- if (href_list["choice"] == "Secondary color")
- if (href_list["icon"] == "none")
+ if(href_list["choice"] == "Secondary color")
+ if(href_list["icon"] == "none")
canister_color["sec"] = "none"
- else if (is_a_color(href_list["icon"],"sec"))
+ else if(is_a_color(href_list["icon"],"sec"))
canister_color["sec"] = href_list["icon"]
- if (href_list["choice"] == "Tertiary color")
- if (href_list["icon"] == "none")
+ if(href_list["choice"] == "Tertiary color")
+ if(href_list["icon"] == "none")
canister_color["ter"] = "none"
- else if (is_a_color(href_list["icon"],"ter"))
+ else if(is_a_color(href_list["icon"],"ter"))
canister_color["ter"] = href_list["icon"]
- if (href_list["choice"] == "Quaternary color")
- if (href_list["icon"] == "none")
+ if(href_list["choice"] == "Quaternary color")
+ if(href_list["icon"] == "none")
canister_color["quart"] = "none"
- else if (is_a_color(href_list["icon"],"quart"))
+ else if(is_a_color(href_list["icon"],"quart"))
canister_color["quart"] = href_list["icon"]
- if (href_list["choice"] == "decals")
- if (is_a_decal(href_list["icon"]))
+ if(href_list["choice"] == "decals")
+ if(is_a_decal(href_list["icon"]))
decals[href_list["icon"]] = (decals[href_list["icon"]] == 0)
src.add_fingerprint(usr)
@@ -577,8 +577,8 @@ update_flag
trace_gas.moles = 9*4000
spawn(100)
var/turf/simulated/location = src.loc
- if (istype(src.loc))
- while (!location.air)
+ if(istype(src.loc))
+ while(!location.air)
sleep(1000)
location.assume_air(air_contents)
air_contents = new
diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm
index b2b7b1efc06..560ad7642b7 100644
--- a/code/game/machinery/atmoalter/meter.dm
+++ b/code/game/machinery/atmoalter/meter.dm
@@ -28,7 +28,8 @@
return ..()
/obj/machinery/meter/initialize()
- if (!target)
+ ..()
+ if(!target)
target = locate(/obj/machinery/atmospherics/pipe) in loc
/obj/machinery/meter/process()
@@ -78,7 +79,7 @@
/obj/machinery/meter/proc/status()
var/t = ""
- if (target)
+ if(target)
var/datum/gas_mixture/environment = target.return_air()
if(environment)
t += "The pressure gauge reads [round(environment.return_pressure(), 0.01)] kPa; [round(environment.temperature,0.01)]°K ([round(environment.temperature-T0C,0.01)]°C)"
@@ -120,11 +121,11 @@
update_multitool_menu(user)
return 1
- if (!istype(W, /obj/item/weapon/wrench))
+ if(!istype(W, /obj/item/weapon/wrench))
return ..()
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
to_chat(user, "\blue You begin to unfasten \the [src]...")
- if (do_after(user, 40, target = src))
+ if(do_after(user, 40, target = src))
user.visible_message( \
"[user] unfastens \the [src].", \
"\blue You have unfastened \the [src].", \
@@ -141,8 +142,9 @@
/obj/machinery/meter/turf/initialize()
- if (!target)
+ if(!target)
target = loc
+ ..()
/obj/machinery/meter/turf/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params)
return
@@ -153,4 +155,4 @@
"
@@ -501,7 +498,7 @@ What a mess.*/
if("rank")
var/list/L = list( "Head of Personnel", "Captain", "AI" )
//This was so silly before the change. Now it actually works without beating your head against the keyboard. /N
- if ((istype(active1, /datum/data/record) && L.Find(rank)))
+ if((istype(active1, /datum/data/record) && L.Find(rank)))
temp = "
Rank:
"
temp += "
"
for(var/rank in joblist)
@@ -510,9 +507,9 @@ What a mess.*/
else
alert(usr, "You do not have the required rank to do this!")
if("species")
- if (istype(active1, /datum/data/record))
+ if(istype(active1, /datum/data/record))
var/t1 = copytext(trim(sanitize(input("Please enter race:", "General records", active1.fields["species"], null) as message)),1,MAX_MESSAGE_LEN)
- if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
+ if((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return
active1.fields["species"] = t1
@@ -520,14 +517,14 @@ What a mess.*/
else//To properly clear as per clear screen.
temp=null
switch(href_list["choice"])
- if ("Change Rank")
- if (active1)
+ if("Change Rank")
+ if(active1)
active1.fields["rank"] = href_list["rank"]
if(href_list["rank"] in joblist)
active1.fields["real_rank"] = href_list["real_rank"]
- if ("Change Criminal Status")
- if (active2)
+ if("Change Criminal Status")
+ if(active2)
switch(href_list["criminal2"])
if("none")
active2.fields["criminal"] = "None"
@@ -543,18 +540,18 @@ What a mess.*/
for(var/mob/living/carbon/human/H in mob_list)
H.sec_hud_set_security_status()
- if ("Delete Record (Security) Execute")
- if (active2)
+ if("Delete Record (Security) Execute")
+ if(active2)
qdel(active2)
- if ("Delete Record (ALL) Execute")
- if (active1)
+ if("Delete Record (ALL) Execute")
+ if(active1)
for(var/datum/data/record/R in data_core.medical)
- if ((R.fields["name"] == active1.fields["name"] || R.fields["id"] == active1.fields["id"]))
+ if((R.fields["name"] == active1.fields["name"] || R.fields["id"] == active1.fields["id"]))
qdel(R)
else
qdel(active1)
- if (active2)
+ if(active2)
qdel(active2)
else
temp = "This function does not appear to be working at the moment. Our apologies."
diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm
index d2f44de6011..7c0680f26d3 100644
--- a/code/game/machinery/computer/skills.dm
+++ b/code/game/machinery/computer/skills.dm
@@ -40,16 +40,18 @@
/obj/machinery/computer/skills/attack_hand(mob/user as mob)
if(..())
return
- if (src.z > 6)
- to_chat(user, "\red Unable to establish a connection: \black You're too far away from the station!")
+
+ // TODO: Tie into space manager
+ if(src.z > ZLEVEL_DERELICT)
+ to_chat(user, "Unable to establish a connection: You're too far away from the station!")
return
var/dat
- if (temp)
+ if(temp)
dat = text("[]
Clear Screen", temp, src)
else
dat = text("Confirm Identity: []", src, (scan ? text("[]", scan.name) : "----------"))
- if (authenticated)
+ if(authenticated)
switch(screen)
if(1.0)
dat += {"
@@ -86,11 +88,7 @@
dat += " Delete All Records
\n", src)
- user << browse(t1, "window=airlock_electronics")
+ var/datum/browser/popup = new(user, "airlock_electronics", name, 400, 400)
+ popup.set_content(t1)
+ popup.open(0)
onclose(user, "airlock")
Topic(href, href_list)
..()
- if (usr.stat || usr.restrained() || (!ishuman(usr) && !istype(usr,/mob/living/silicon)))
+ if(usr.stat || usr.restrained() || (!ishuman(usr) && !istype(usr,/mob/living/silicon)))
return
- if (href_list["close"])
+ if(href_list["close"])
usr << browse(null, "window=airlock")
return
- if (href_list["login"])
+ if(href_list["login"])
if(istype(usr,/mob/living/silicon))
src.locked = 0
src.last_configurator = usr.name
else
var/obj/item/I = usr.get_active_hand()
- if (istype(I, /obj/item/device/pda))
+ if(istype(I, /obj/item/device/pda))
var/obj/item/device/pda/pda = I
I = pda.id
- if (I && src.check_access(I))
+ if(I && src.check_access(I))
src.locked = 0
src.last_configurator = I:registered_name
- if (locked)
+ if(locked)
return
- if (href_list["logout"])
+ if(href_list["logout"])
locked = 1
- if (href_list["one_access"])
+ if(href_list["one_access"])
one_access = !one_access
- if (href_list["access"])
+ if(href_list["access"])
toggle_access(href_list["access"])
attack_self(usr)
proc
toggle_access(var/acc)
- if (acc == "all")
+ if(acc == "all")
conf_access = null
else
var/req = text2num(acc)
- if (conf_access == null)
+ if(conf_access == null)
conf_access = list()
- if (!(req in conf_access))
+ if(!(req in conf_access))
conf_access += req
else
conf_access -= req
- if (!conf_access.len)
+ if(!conf_access.len)
conf_access = null
diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm
index 3e611b8dea4..b0be899942d 100644
--- a/code/game/machinery/doors/brigdoors.dm
+++ b/code/game/machinery/doors/brigdoors.dm
@@ -31,19 +31,19 @@
maptext_height = 26
maptext_width = 32
-/obj/machinery/door_timer/New()
+/obj/machinery/door_timer/initialize()
..()
Radio = new /obj/item/device/radio(src)
Radio.listening = 0
Radio.config(list("Security" = 0))
- pixel_x = ((src.dir & 3)? (0) : (src.dir == 4 ? 32 : -32))
- pixel_y = ((src.dir & 3)? (src.dir ==1 ? 24 : -32) : (0))
+ pixel_x = ((dir & 3)? (0) : (dir == 4 ? 32 : -32))
+ pixel_y = ((dir & 3)? (dir ==1 ? 24 : -32) : (0))
spawn(20)
for(var/obj/machinery/door/window/brigdoor/M in airlocks)
- if (M.id == id)
+ if(M.id == id)
targets += M
for(var/obj/machinery/flasher/F in machines)
@@ -53,7 +53,7 @@
for(var/obj/structure/closet/secure_closet/brig/C in world)
if(C.id == id)
targets += C
-
+
for(var/obj/machinery/treadmill_monitor/T in machines)
if(T.id == id)
targets += T
@@ -61,15 +61,14 @@
if(targets.len==0)
stat |= BROKEN
update_icon()
- return
- return
//Main door timer loop, if it's timing and time is >0 reduce time by 1.
// if it's less than 0, open door, reset timer
// update the door_timer window and the icon
/obj/machinery/door_timer/process()
- if(stat & (NOPOWER|BROKEN)) return
+ if(stat & (NOPOWER|BROKEN))
+ return
if(timing)
if(timeleft() <= 0)
Radio.autosay("Timer has expired. Releasing prisoner.", name, "Security", list(z))
@@ -77,8 +76,8 @@
timing = 0
. = PROCESS_KILL
- src.updateUsrDialog()
- src.update_icon()
+ updateUsrDialog()
+ update_icon()
else
timer_end()
return PROCESS_KILL
@@ -87,7 +86,6 @@
/obj/machinery/door_timer/power_change()
..()
update_icon()
- return
// open/closedoor checks if door_timer has power, if so it checks if the
@@ -95,7 +93,8 @@
// Closes and locks doors, power check
/obj/machinery/door_timer/proc/timer_start()
- if(stat & (NOPOWER|BROKEN)) return 0
+ if(stat & (NOPOWER|BROKEN))
+ return 0
// Set releasetime
releasetime = world.timeofday + timetoset
@@ -103,16 +102,19 @@
addAtProcessing()
for(var/obj/machinery/door/window/brigdoor/door in targets)
- if(door.density) continue
+ if(door.density)
+ continue
spawn(0)
door.close()
for(var/obj/structure/closet/secure_closet/brig/C in targets)
- if(C.broken) continue
- if(C.opened && !C.close()) continue
+ if(C.broken)
+ continue
+ if(C.opened && !C.close())
+ continue
C.locked = 1
C.icon_state = C.icon_locked
-
+
for(var/obj/machinery/treadmill_monitor/T in targets)
T.total_joules = 0
T.on = 1
@@ -122,19 +124,23 @@
// Opens and unlocks doors, power check
/obj/machinery/door_timer/proc/timer_end()
- if(stat & (NOPOWER|BROKEN)) return 0
+ if(stat & (NOPOWER|BROKEN))
+ return 0
// Reset releasetime
releasetime = 0
for(var/obj/machinery/door/window/brigdoor/door in targets)
- if(!door.density) continue
+ if(!door.density)
+ continue
spawn(0)
door.open()
for(var/obj/structure/closet/secure_closet/brig/C in targets)
- if(C.broken) continue
- if(C.opened) continue
+ if(C.broken)
+ continue
+ if(C.opened)
+ continue
C.locked = 0
C.icon_state = C.icon_closed
@@ -156,7 +162,7 @@
return time / 10
// Set timetoset
-/obj/machinery/door_timer/proc/timeset(var/seconds)
+/obj/machinery/door_timer/proc/timeset(seconds)
timetoset = seconds * 10
if(timetoset <= 0)
@@ -165,15 +171,15 @@
return
//Allows AIs to use door_timer, see human attack_hand function below
-/obj/machinery/door_timer/attack_ai(var/mob/user as mob)
- return src.attack_hand(user)
+/obj/machinery/door_timer/attack_ai(mob/user)
+ return attack_hand(user)
//Allows humans to use door_timer
//Opens dialog window when someone clicks on door timer
// Allows altering timer and the timing boolean.
// Flasher activation limited to 150 seconds
-/obj/machinery/door_timer/attack_hand(var/mob/user as mob)
+/obj/machinery/door_timer/attack_hand(mob/user)
if(..())
return
@@ -188,13 +194,11 @@
user.set_machine(src)
// dat
- var/dat = ""
-
- dat += "Timer System:"
- dat += " Door [src.id] controls "
+ var/dat = "Timer System:"
+ dat += " Door [id] controls "
// Start/Stop timer
- if (src.timing)
+ if(timing)
dat += "Stop Timer and open door "
else
dat += "Activate Timer and close door "
@@ -204,7 +208,7 @@
dat += " "
// Set Timer display (uses timetoset)
- if(src.timing)
+ if(timing)
dat += "Set Timer: [(setminute ? text("[setminute]:") : null)][setsecond] Set "
else
dat += "Set Timer: [(setminute ? text("[setminute]:") : null)][setsecond] "
@@ -220,11 +224,10 @@
dat += " Activate Flash"
dat += "
Close"
- dat += ""
- user << browse(dat, "window=computer;size=400x500")
- onclose(user, "computer")
- return
+ var/datum/browser/popup = new(user, "door_timer", name, 400, 500)
+ popup.set_content(dat)
+ popup.open()
//Function for using door_timer dialog input, checks if user has permission
@@ -237,18 +240,18 @@
/obj/machinery/door_timer/Topic(href, href_list)
if(..())
return
- if(!src.allowed(usr))
+ if(!allowed(usr))
return
usr.set_machine(src)
if(href_list["timing"])
- src.timing = text2num(href_list["timing"])
+ timing = text2num(href_list["timing"])
- if(src.timing)
- src.timer_start()
+ if(timing)
+ timer_start()
else
- src.timer_end()
+ timer_end()
else
if(href_list["tp"]) //adjust timer, close door if not already closed
@@ -264,19 +267,11 @@
F.flash()
if(href_list["change"])
- src.timer_start()
+ timer_start()
- src.add_fingerprint(usr)
- src.updateUsrDialog()
- src.update_icon()
-
- /* if(src.timing)
- src.timer_start()
-
- else
- src.timer_end() */
-
- return
+ add_fingerprint(usr)
+ updateUsrDialog()
+ update_icon()
//icon update function
@@ -290,7 +285,7 @@
if(stat & (BROKEN))
set_picture("ai_bsod")
return
- if(src.timing)
+ if(timing)
var/disp1 = id
var/timeleft = timeleft()
var/disp2 = "[add_zero(num2text((timeleft / 60) % 60),2)]~[add_zero(num2text(timeleft % 60), 2)]"
@@ -299,11 +294,10 @@
update_display(disp1, disp2)
else
if(maptext) maptext = ""
- return
// Adds an icon in case the screen is broken/off, stolen from status_display.dm
-/obj/machinery/door_timer/proc/set_picture(var/state)
+/obj/machinery/door_timer/proc/set_picture(state)
picture_state = state
overlays.Cut()
overlays += image('icons/obj/status_display.dmi', icon_state=picture_state)
@@ -311,7 +305,7 @@
//Checks to see if there's 1 line or 2, adds text-icons-numbers/letters over display
// Stolen from status_display
-/obj/machinery/door_timer/proc/update_display(var/line1, var/line2)
+/obj/machinery/door_timer/proc/update_display(line1, line2)
var/new_text = {"
[line1] [line2]
"}
if(maptext != new_text)
maptext = new_text
@@ -319,7 +313,7 @@
//Actual string input to icon display for loop, with 5 pixel x offsets for each letter.
//Stolen from status_display
-/obj/machinery/door_timer/proc/texticon(var/tn, var/px = 0, var/py = 0)
+/obj/machinery/door_timer/proc/texticon(tn, px = 0, py = 0)
var/image/I = image('icons/obj/status_display.dmi', "blank")
var/len = lentext(tn)
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index fd5f1b19219..6c9537667fb 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -45,11 +45,13 @@
bound_width = world.icon_size
bound_height = width * world.icon_size
- air_update_turf(1)
update_freelook_sight()
airlocks += src
return
+/obj/machinery/door/initialize()
+ air_update_turf(1)
+ ..()
/obj/machinery/door/Destroy()
density = 0
diff --git a/code/game/machinery/doors/poddoor.dm b/code/game/machinery/doors/poddoor.dm
index 1b3f13955d0..de3c4514bb5 100644
--- a/code/game/machinery/doors/poddoor.dm
+++ b/code/game/machinery/doors/poddoor.dm
@@ -44,9 +44,9 @@
/obj/machinery/door/poddoor/attackby(obj/item/weapon/C as obj, mob/user as mob, params)
src.add_fingerprint(user)
- if (!( istype(C, /obj/item/weapon/crowbar) || (istype(C, /obj/item/weapon/twohanded/fireaxe) && C:wielded == 1) ))
+ if(!( istype(C, /obj/item/weapon/crowbar) || (istype(C, /obj/item/weapon/twohanded/fireaxe) && C:wielded == 1) ))
return
- if ((src.density && (stat & NOPOWER) && !( src.operating )))
+ if((src.density && (stat & NOPOWER) && !( src.operating )))
spawn( 0 )
src.operating = 1
flick("pdoorc0", src)
@@ -59,9 +59,9 @@
return
/obj/machinery/door/poddoor/open()
- if (src.operating == 1) //doors can still open when emag-disabled
+ if(src.operating == 1) //doors can still open when emag-disabled
return
- if (!ticker)
+ if(!ticker)
return 0
if(!src.operating) //in case of emag
src.operating = 1
@@ -82,7 +82,7 @@
return 1
/obj/machinery/door/poddoor/close()
- if (src.operating)
+ if(src.operating)
return
src.operating = 1
flick("pdoorc1", src)
diff --git a/code/game/machinery/doors/spacepod.dm b/code/game/machinery/doors/spacepod.dm
index 244642021ad..021509a13ed 100644
--- a/code/game/machinery/doors/spacepod.dm
+++ b/code/game/machinery/doors/spacepod.dm
@@ -7,7 +7,7 @@
density = 0
anchored = 1
-/obj/structure/spacepoddoor/New()
+/obj/structure/spacepoddoor/initialize()
..()
air_update_turf(1)
@@ -21,4 +21,4 @@
/obj/structure/spacepoddoor/CanPass(atom/movable/A, turf/T)
if(istype(A, /obj/spacepod))
return ..()
- else return 0
\ No newline at end of file
+ else return 0
diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm
index 39ed81b3360..cbad06fab9c 100644
--- a/code/game/machinery/doors/windowdoor.dm
+++ b/code/game/machinery/doors/windowdoor.dm
@@ -13,7 +13,7 @@
/obj/machinery/door/window/New()
..()
- if (src.req_access && src.req_access.len)
+ if(src.req_access && src.req_access.len)
src.icon_state = "[src.icon_state]"
src.base_state = src.icon_state
@@ -42,7 +42,7 @@
/obj/machinery/door/window/Bumped(atom/movable/AM as mob|obj)
if(operating || !density)
return
- if (!ismob(AM))
+ if(!ismob(AM))
if(istype(AM, /obj/mecha))
var/obj/mecha/mecha = AM
if(mecha.occupant && src.allowed(mecha.occupant))
@@ -50,7 +50,7 @@
else
flick(text("[]deny", src.base_state), src)
return
- if (!ticker)
+ if(!ticker)
return
var/mob/M = AM
if(!M.restrained() && !M.small)
@@ -97,9 +97,9 @@
return 1
/obj/machinery/door/window/open(var/forced=0)
- if (src.operating == 1) //doors can still open when emag-disabled
+ if(src.operating == 1) //doors can still open when emag-disabled
return 0
- if (!ticker)
+ if(!ticker)
return 0
if(!forced)
if(stat & NOPOWER)
@@ -124,7 +124,7 @@
return 1
/obj/machinery/door/window/close(var/forced=0)
- if (src.operating)
+ if(src.operating)
return 0
if(!forced)
if(stat & NOPOWER)
@@ -149,7 +149,7 @@
/obj/machinery/door/window/proc/take_damage(var/damage)
src.health = max(0, src.health - damage)
- if (src.health <= 0)
+ if(src.health <= 0)
var/debris = list(
new /obj/item/weapon/shard(src.loc),
new /obj/item/weapon/shard(src.loc),
@@ -248,13 +248,13 @@
/obj/machinery/door/window/attackby(obj/item/weapon/I as obj, mob/living/user as mob, params)
//If it's in the process of opening/closing, ignore the click
- if (src.operating)
+ if(src.operating)
return
add_fingerprint(user)
//Ninja swords? You may pass.
- if (src.density && (istype(I, /obj/item/weapon/card/emag)||istype(I, /obj/item/weapon/melee/energy/blade)))
+ if(src.density && (istype(I, /obj/item/weapon/card/emag)||istype(I, /obj/item/weapon/melee/energy/blade)))
emag_act(user,I)
return 1
@@ -307,7 +307,7 @@
src.check_access()
if(src.req_access.len)
ae.conf_access = src.req_access
- else if (src.req_one_access.len)
+ else if(src.req_one_access.len)
ae.conf_access = src.req_one_access
ae.one_access = 1
else
@@ -341,17 +341,17 @@
take_damage(aforce)
return
- if (!src.requiresID())
+ if(!src.requiresID())
//don't care who they are or what they have, act as if they're NOTHING
user = null
- if (src.allowed(user))
- if (src.density)
+ if(src.allowed(user))
+ if(src.density)
open()
else
close()
- else if (src.density)
+ else if(src.density)
flick(text("[]deny", src.base_state), src)
return
diff --git a/code/game/machinery/drying_rack.dm b/code/game/machinery/drying_rack.dm
deleted file mode 100644
index 9ec3974483f..00000000000
--- a/code/game/machinery/drying_rack.dm
+++ /dev/null
@@ -1,105 +0,0 @@
-/obj/machinery/drying_rack
- name = "drying rack"
- desc = "A large rack with a heater built into the base. Used for drying things out."
- icon = 'icons/obj/hydroponics.dmi'
- icon_state = "drying_rack"
- layer = 2.9
- density = 1
- anchored = 1
- use_power = 1
- idle_power_usage = 5
- active_power_usage = 50
- var/list/accepted = list()
- var/running = 0
- var/volume = 100
-
-/obj/machinery/drying_rack/New()
- ..()
- flags |= NOREACT
- create_reagents(volume)
- accepted = list(/obj/item/weapon/reagent_containers/food/snacks/grown/coffee_arabica,
- /obj/item/weapon/reagent_containers/food/snacks/grown/coffee_robusta,
- /obj/item/weapon/reagent_containers/food/snacks/grown/tobacco,
- /obj/item/weapon/reagent_containers/food/snacks/grown/tobacco_space,
- /obj/item/weapon/reagent_containers/food/snacks/grown/tea_aspera,
- /obj/item/weapon/reagent_containers/food/snacks/grown/tea_astra,
- /obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiavulgaris,
- /obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiadeus,
- /obj/item/weapon/reagent_containers/food/snacks/meat,
- /obj/item/weapon/reagent_containers/food/snacks/grown/grapes,
- /obj/item/weapon/reagent_containers/food/snacks/grown/greengrapes)
-
-
-
-/obj/machinery/drying_rack/attackby(var/obj/item/W as obj, var/mob/user as mob, params)
- if(is_type_in_list(W,accepted))
- if(!running)
- if(istype(W,/obj/item/weapon/reagent_containers/food/snacks/meat))
- user.unEquip(W)
- del(W)
- to_chat(user, "You add the meat to the drying rack.")
- src.running = 1
- use_power = 2
- icon_state = "drying_rack_on"
- sleep(60)
- icon_state = "drying_rack"
- new /obj/item/weapon/reagent_containers/food/snacks/sosjerky(src.loc)
- use_power = 1
- src.running = 0
- return
- if(istype(W,/obj/item/weapon/reagent_containers/food/snacks/grown/grapes))
- user.unEquip(W)
- del(W)
- to_chat(user, "You add the grapes to the drying rack.")
- src.running = 1
- use_power = 2
- icon_state = "drying_rack_on"
- sleep(60)
- icon_state = "drying_rack"
- new /obj/item/weapon/reagent_containers/food/snacks/no_raisin(src.loc)
- use_power = 1
- src.running = 0
- return
- if(istype(W,/obj/item/weapon/reagent_containers/food/snacks/grown/greengrapes))
- user.unEquip(W)
- del(W)
- to_chat(user, "You add the green grapes to the drying rack.")
- src.running = 1
- use_power = 2
- icon_state = "drying_rack_on"
- sleep(60)
- icon_state = "drying_rack"
- new /obj/item/weapon/reagent_containers/food/snacks/no_raisin(src.loc)
- use_power = 1
- src.running = 0
- return
- else
- if(W:dry == 0)
- var/J = W.type
- var/obj/item/weapon/reagent_containers/food/snacks/grown/B = W
- B.reagents.trans_to(src, B.reagents.total_volume)
- to_chat(user, "You add the [W] to the drying rack.")
- user.unEquip(W)
- del(W)
- src.running = 1
- use_power = 2
- icon_state = "drying_rack_on"
- sleep(60)
- icon_state = "drying_rack"
- var/obj/item/weapon/reagent_containers/food/snacks/grown/D = new J(src.loc)
- to_chat(user, "\blue You finish drying the [D]")
- D.icon_state = "[D.icon_state]_dry"
- D.dry = 1
- D.reagents.remove_any(50)
- src.reagents.trans_to(D, src.reagents.total_volume)
- use_power = 1
- src.running = 0
- return
- else
- to_chat(user, "\red That has already been dried!")
- else
- to_chat(user, "\red Please wait until the last item has dried.")
- else
- to_chat(user, "\red You cannot add that to the drying rack.")
-
-
diff --git a/code/game/machinery/dye_generator.dm b/code/game/machinery/dye_generator.dm
index c73996abd29..151478ddee6 100644
--- a/code/game/machinery/dye_generator.dm
+++ b/code/game/machinery/dye_generator.dm
@@ -9,6 +9,7 @@
var/dye_color = "#FFFFFF"
/obj/machinery/dye_generator/initialize()
+ ..()
power_change()
/obj/machinery/dye_generator/power_change()
@@ -32,7 +33,7 @@
qdel(src)
return
if(2.0)
- if (prob(50))
+ if(prob(50))
qdel(src)
return
if(3.0)
@@ -73,7 +74,7 @@
throw_speed = 4
throw_range = 7
force = 0
- w_class = 1.0
+ w_class = 1
var/dye_color = "#FFFFFF"
/obj/item/hair_dye_bottle/New()
@@ -127,4 +128,4 @@
var/b_skin = hex2num(copytext(dye_color, 6, 8))
if(H.change_skin_color(r_skin, g_skin, b_skin))
H.update_dna()
- user.visible_message("[user] finishes dying [M]'s [what_to_dye]!", "You finish dying [M]'s [what_to_dye]!")
\ No newline at end of file
+ user.visible_message("[user] finishes dying [M]'s [what_to_dye]!", "You finish dying [M]'s [what_to_dye]!")
diff --git a/code/game/machinery/embedded_controller/airlock_controllers.dm b/code/game/machinery/embedded_controller/airlock_controllers.dm
index bf6fe4f0fe7..2b336859127 100644
--- a/code/game/machinery/embedded_controller/airlock_controllers.dm
+++ b/code/game/machinery/embedded_controller/airlock_controllers.dm
@@ -34,7 +34,7 @@
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, "advanced_airlock_console.tmpl", name, 470, 290)
ui.set_initial_data(data)
@@ -90,7 +90,7 @@
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, "simple_airlock_console.tmpl", name, 470, 290)
ui.set_initial_data(data)
@@ -154,7 +154,7 @@
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, "door_access_console.tmpl", name, 330, 220)
ui.set_initial_data(data)
diff --git a/code/game/machinery/embedded_controller/airlock_docking_controller.dm b/code/game/machinery/embedded_controller/airlock_docking_controller.dm
deleted file mode 100644
index 0ffb9c3d7dc..00000000000
--- a/code/game/machinery/embedded_controller/airlock_docking_controller.dm
+++ /dev/null
@@ -1,180 +0,0 @@
-//a docking port based on an airlock
-/obj/machinery/embedded_controller/radio/airlock/docking_port
- name = "docking port controller"
- var/datum/computer/file/embedded_program/airlock/docking/airlock_program
- var/datum/computer/file/embedded_program/docking/airlock/docking_program
- tag_secure = 1
-
-/obj/machinery/embedded_controller/radio/airlock/docking_port/initialize()
- ..()
- airlock_program = new/datum/computer/file/embedded_program/airlock/docking(src)
- docking_program = new/datum/computer/file/embedded_program/docking/airlock(src, airlock_program)
- program = docking_program
-
-/obj/machinery/embedded_controller/radio/airlock/docking_port/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
- var/data[0]
-
- data = list(
- "chamber_pressure" = round(airlock_program.memory["chamber_sensor_pressure"]),
- "exterior_status" = airlock_program.memory["exterior_status"],
- "interior_status" = airlock_program.memory["interior_status"],
- "processing" = airlock_program.memory["processing"],
- "docking_status" = docking_program.get_docking_status(),
- "airlock_disabled" = !(docking_program.undocked() || docking_program.override_enabled),
- "override_enabled" = docking_program.override_enabled,
- )
-
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
-
- if (!ui)
- ui = new(user, src, ui_key, "docking_airlock_console.tmpl", name, 470, 290)
- ui.set_initial_data(data)
- ui.open()
- ui.set_auto_update(1)
-
-/obj/machinery/embedded_controller/radio/airlock/docking_port/Topic(href, href_list)
- if(..())
- return
-
- usr.set_machine(src)
- src.add_fingerprint(usr)
-
- var/clean = 0
- switch(href_list["command"]) //anti-HTML-hacking checks
- if("cycle_ext")
- clean = 1
- if("cycle_int")
- clean = 1
- if("force_ext")
- clean = 1
- if("force_int")
- clean = 1
- if("abort")
- clean = 1
- if("toggle_override")
- clean = 1
-
- if(clean)
- program.receive_user_command(href_list["command"])
-
- return 1
-
-
-
-//A docking controller for an airlock based docking port
-/datum/computer/file/embedded_program/docking/airlock
- var/datum/computer/file/embedded_program/airlock/docking/airlock_program
-
-/datum/computer/file/embedded_program/docking/airlock/New(var/obj/machinery/embedded_controller/M, var/datum/computer/file/embedded_program/airlock/docking/A)
- ..(M)
- airlock_program = A
- airlock_program.master_prog = src
-
-/datum/computer/file/embedded_program/docking/airlock/receive_user_command(command)
- if (command == "toggle_override")
- if (override_enabled)
- disable_override()
- else
- enable_override()
- return
-
- ..(command)
- airlock_program.receive_user_command(command) //pass along to subprograms
-
-/datum/computer/file/embedded_program/docking/airlock/process()
- airlock_program.process()
- ..()
-
-/datum/computer/file/embedded_program/docking/airlock/receive_signal(datum/signal/signal, receive_method, receive_param)
- airlock_program.receive_signal(signal, receive_method, receive_param) //pass along to subprograms
- ..(signal, receive_method, receive_param)
-
-//tell the docking port to start getting ready for docking - e.g. pressurize
-/datum/computer/file/embedded_program/docking/airlock/prepare_for_docking()
- airlock_program.begin_cycle_in()
-
-//are we ready for docking?
-/datum/computer/file/embedded_program/docking/airlock/ready_for_docking()
- return airlock_program.done_cycling()
-
-//we are docked, open the doors or whatever.
-/datum/computer/file/embedded_program/docking/airlock/finish_docking()
- airlock_program.enable_mech_regulators()
- airlock_program.open_doors()
-
-//tell the docking port to start getting ready for undocking - e.g. close those doors.
-/datum/computer/file/embedded_program/docking/airlock/prepare_for_undocking()
- airlock_program.stop_cycling()
- airlock_program.close_doors()
- airlock_program.disable_mech_regulators()
-
-//are we ready for undocking?
-/datum/computer/file/embedded_program/docking/airlock/ready_for_undocking()
- var/ext_closed = airlock_program.check_exterior_door_secured()
- var/int_closed = airlock_program.check_interior_door_secured()
- return (ext_closed || int_closed)
-
-//An airlock controller to be used by the airlock-based docking port controller.
-//Same as a regular airlock controller but allows disabling of the regular airlock functions when docking
-/datum/computer/file/embedded_program/airlock/docking
- var/datum/computer/file/embedded_program/docking/airlock/master_prog
-
-/datum/computer/file/embedded_program/airlock/docking/receive_user_command(command)
- if (master_prog.undocked() || master_prog.override_enabled) //only allow the port to be used as an airlock if nothing is docked here or the override is enabled
- ..(command)
-
-/datum/computer/file/embedded_program/airlock/docking/proc/enable_mech_regulators()
- enable_mech_regulation()
-
-/datum/computer/file/embedded_program/airlock/docking/proc/disable_mech_regulators()
- disable_mech_regulation()
-
-/datum/computer/file/embedded_program/airlock/docking/proc/open_doors()
- toggleDoor(memory["interior_status"], tag_interior_door, memory["secure"], "open")
- toggleDoor(memory["exterior_status"], tag_exterior_door, memory["secure"], "open")
-
-/datum/computer/file/embedded_program/airlock/docking/cycleDoors(var/target)
- if (master_prog.undocked() || master_prog.override_enabled) //only allow the port to be used as an airlock if nothing is docked here or the override is enabled
- ..(target)
-
-/*** DEBUG VERBS ***
-
-/datum/computer/file/embedded_program/docking/proc/print_state()
- to_chat(world, "id_tag: [id_tag]")
- to_chat(world, "dock_state: [dock_state]")
- to_chat(world, "control_mode: [control_mode]")
- to_chat(world, "tag_target: [tag_target]")
- to_chat(world, "response_sent: [response_sent]")
-
-/datum/computer/file/embedded_program/docking/post_signal(datum/signal/signal, comm_line)
- to_chat(world, "Program [id_tag] sent a message!")
- print_state()
- to_chat(world, "[id_tag] sent command \"[signal.data["command"]]\" to \"[signal.data["recipient"]]\"")
- ..(signal)
-
-/obj/machinery/embedded_controller/radio/airlock/docking_port/verb/view_state()
- set category = "Debug"
- set src in view(1)
- src.program:print_state()
-
-/obj/machinery/embedded_controller/radio/airlock/docking_port/verb/spoof_signal(var/command as text, var/sender as text)
- set category = "Debug"
- set src in view(1)
- var/datum/signal/signal = new
- signal.data["tag"] = sender
- signal.data["command"] = command
- signal.data["recipient"] = id_tag
-
- src.program:receive_signal(signal)
-
-/obj/machinery/embedded_controller/radio/airlock/docking_port/verb/debug_init_dock(var/target as text)
- set category = "Debug"
- set src in view(1)
- src.program:initiate_docking(target)
-
-/obj/machinery/embedded_controller/radio/airlock/docking_port/verb/debug_init_undock()
- set category = "Debug"
- set src in view(1)
- src.program:initiate_undocking()
-
-*/
\ No newline at end of file
diff --git a/code/game/machinery/embedded_controller/airlock_docking_controller_multi.dm b/code/game/machinery/embedded_controller/airlock_docking_controller_multi.dm
deleted file mode 100644
index f7ca5b1339a..00000000000
--- a/code/game/machinery/embedded_controller/airlock_docking_controller_multi.dm
+++ /dev/null
@@ -1,153 +0,0 @@
-//a controller for a docking port with multiple independent airlocks
-//this is the master controller, that things will try to dock with.
-/obj/machinery/embedded_controller/radio/docking_port_multi
- name = "docking port controller"
-
- var/child_tags_txt
- var/child_names_txt
- var/list/child_names = list()
-
- var/datum/computer/file/embedded_program/docking/multi/docking_program
-
-/obj/machinery/embedded_controller/radio/docking_port_multi/initialize()
- ..()
- docking_program = new/datum/computer/file/embedded_program/docking/multi(src)
- program = docking_program
-
- var/list/names = splittext(child_names_txt, ";")
- var/list/tags = splittext(child_tags_txt, ";")
-
- if (names.len == tags.len)
- for (var/i = 1; i <= tags.len; i++)
- child_names[tags[i]] = names[i]
-
-
-/obj/machinery/embedded_controller/radio/docking_port_multi/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
- var/data[0]
-
- var/list/airlocks[child_names.len]
- var/i = 1
- for (var/child_tag in child_names)
- airlocks[i++] = list("name"=child_names[child_tag], "override_enabled"=(docking_program.children_override[child_tag] == "enabled"))
-
- data = list(
- "docking_status" = docking_program.get_docking_status(),
- "airlocks" = airlocks,
- )
-
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
-
- if (!ui)
- ui = new(user, src, ui_key, "multi_docking_console.tmpl", name, 470, 290)
- ui.set_initial_data(data)
- ui.open()
- ui.set_auto_update(1)
-
-/obj/machinery/embedded_controller/radio/docking_port_multi/Topic(href, href_list)
- return
-
-
-
-//a docking port based on an airlock
-/obj/machinery/embedded_controller/radio/airlock/docking_port_multi
- name = "docking port controller"
- var/master_tag //for mapping
- var/datum/computer/file/embedded_program/airlock/multi_docking/airlock_program
- tag_secure = 1
-
-/obj/machinery/embedded_controller/radio/airlock/docking_port_multi/initialize()
- ..()
- airlock_program = new/datum/computer/file/embedded_program/airlock/multi_docking(src)
- program = airlock_program
-
-/obj/machinery/embedded_controller/radio/airlock/docking_port_multi/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
- var/data[0]
-
- data = list(
- "chamber_pressure" = round(airlock_program.memory["chamber_sensor_pressure"]),
- "exterior_status" = airlock_program.memory["exterior_status"],
- "interior_status" = airlock_program.memory["interior_status"],
- "processing" = airlock_program.memory["processing"],
- "docking_status" = airlock_program.master_status,
- "airlock_disabled" = (airlock_program.docking_enabled && !airlock_program.override_enabled),
- "override_enabled" = airlock_program.override_enabled,
- )
-
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
-
- if (!ui)
- ui = new(user, src, ui_key, "docking_airlock_console.tmpl", name, 470, 290)
- ui.set_initial_data(data)
- ui.open()
- ui.set_auto_update(1)
-
-/obj/machinery/embedded_controller/radio/airlock/docking_port_multi/Topic(href, href_list)
- if(..())
- return
-
- usr.set_machine(src)
- src.add_fingerprint(usr)
-
- var/clean = 0
- switch(href_list["command"]) //anti-HTML-hacking checks
- if("cycle_ext")
- clean = 1
- if("cycle_int")
- clean = 1
- if("force_ext")
- clean = 1
- if("force_int")
- clean = 1
- if("abort")
- clean = 1
- if("toggle_override")
- clean = 1
-
- if(clean)
- program.receive_user_command(href_list["command"])
-
- return 1
-
-
-
-/*** DEBUG VERBS ***
-
-/datum/computer/file/embedded_program/docking/multi/proc/print_state()
- to_chat(world, "id_tag: [id_tag]")
- to_chat(world, "dock_state: [dock_state]")
- to_chat(world, "control_mode: [control_mode]")
- to_chat(world, "tag_target: [tag_target]")
- to_chat(world, "response_sent: [response_sent]")
-
-/datum/computer/file/embedded_program/docking/multi/post_signal(datum/signal/signal, comm_line)
- to_chat(world, "Program [id_tag] sent a message!")
- print_state()
- to_chat(world, "[id_tag] sent command \"[signal.data["command"]]\" to \"[signal.data["recipient"]]\"")
- ..(signal)
-
-/obj/machinery/embedded_controller/radio/docking_port_multi/verb/view_state()
- set category = "Debug"
- set src in view(1)
- src.program:print_state()
-
-/obj/machinery/embedded_controller/radio/docking_port_multi/verb/spoof_signal(var/command as text, var/sender as text)
- set category = "Debug"
- set src in view(1)
- var/datum/signal/signal = new
- signal.data["tag"] = sender
- signal.data["command"] = command
- signal.data["recipient"] = id_tag
-
- src.program:receive_signal(signal)
-
-/obj/machinery/embedded_controller/radio/docking_port_multi/verb/debug_init_dock(var/target as text)
- set category = "Debug"
- set src in view(1)
- src.program:initiate_docking(target)
-
-/obj/machinery/embedded_controller/radio/docking_port_multi/verb/debug_init_undock()
- set category = "Debug"
- set src in view(1)
- src.program:initiate_undocking()
-
-*/
diff --git a/code/game/machinery/embedded_controller/airlock_program.dm b/code/game/machinery/embedded_controller/airlock_program.dm
index 8cb3abb9980..670cce47785 100644
--- a/code/game/machinery/embedded_controller/airlock_program.dm
+++ b/code/game/machinery/embedded_controller/airlock_program.dm
@@ -36,7 +36,7 @@
memory["purge"] = 0
memory["secure"] = 0
- if (istype(M, /obj/machinery/embedded_controller/radio/airlock)) //if our controller is an airlock controller than we can auto-init our tags
+ if(istype(M, /obj/machinery/embedded_controller/radio/airlock)) //if our controller is an airlock controller than we can auto-init our tags
var/obj/machinery/embedded_controller/radio/airlock/controller = M
tag_exterior_door = controller.tag_exterior_door? controller.tag_exterior_door : "[id_tag]_outer"
tag_interior_door = controller.tag_interior_door? controller.tag_interior_door : "[id_tag]_inner"
@@ -177,13 +177,13 @@
if(memory["pump_status"] != "off") //send a signal to stop pumping
signalPump(tag_airpump, 0)
- if ((state == STATE_PRESSURIZE || state == STATE_DEPRESSURIZE) && !check_doors_secured())
+ if((state == STATE_PRESSURIZE || state == STATE_DEPRESSURIZE) && !check_doors_secured())
//the airlock will not allow itself to continue to cycle when any of the doors are forced open.
stop_cycling()
switch(state)
if(STATE_PREPARE)
- if (check_doors_secured())
+ if(check_doors_secured())
var/chamber_pressure = memory["chamber_sensor_pressure"]
var/target_pressure = memory["target_pressure"]
diff --git a/code/game/machinery/embedded_controller/docking_program.dm b/code/game/machinery/embedded_controller/docking_program.dm
deleted file mode 100644
index aa938c663bc..00000000000
--- a/code/game/machinery/embedded_controller/docking_program.dm
+++ /dev/null
@@ -1,286 +0,0 @@
-
-#define STATE_UNDOCKED 0
-#define STATE_DOCKING 1
-#define STATE_UNDOCKING 2
-#define STATE_DOCKED 3
-
-#define MODE_NONE 0
-#define MODE_SERVER 1
-#define MODE_CLIENT 2 //The one who initiated the docking, and who can initiate the undocking. The server cannot initiate undocking, and is the one responsible for deciding to accept a docking request and signals when docking and undocking is complete. (Think server == station, client == shuttle)
-
-#define MESSAGE_RESEND_TIME 5 //how long (in seconds) do we wait before resending a message
-
-/*
- *** STATE TABLE ***
-
- MODE_CLIENT|STATE_UNDOCKED sent a request for docking and now waiting for a reply.
- MODE_CLIENT|STATE_DOCKING server told us they are OK to dock, waiting for our docking port to be ready.
- MODE_CLIENT|STATE_DOCKED idle - docked as client.
- MODE_CLIENT|STATE_UNDOCKING we are either waiting for our docking port to be ready or for the server to give us the OK to finish undocking.
-
- MODE_SERVER|STATE_UNDOCKED should never happen.
- MODE_SERVER|STATE_DOCKING someone requested docking, we are waiting for our docking port to be ready.
- MODE_SERVER|STATE_DOCKED idle - docked as server
- MODE_SERVER|STATE_UNDOCKING client requested undocking, we are waiting for our docking port to be ready.
-
- MODE_NONE|STATE_UNDOCKED idle - not docked.
- MODE_NONE|anything else should never happen.
-
- *** Docking Signals ***
-
- Docking
- Client sends request_dock
-
- Server sends confirm_dock to say that yes, we will serve your request
- When client is ready, sends confirm_dock
- Server sends confirm_dock back to indicate that docking is complete
-
- Undocking
- Client sends request_undock
- When client is ready, sends confirm_undock
- Server sends confirm_undock back to indicate that docking is complete
-
- Note that in both cases each side exchanges confirm_dock before the docking operation is considered done.
- The client first sends a confirm message to indicate it is ready, and then finally the server will send it's
- confirm message to indicate that the operation is complete.
-
- Note also that when docking, the server sends an additional confirm message. This is because before docking,
- the server and client do not have a defined relationship. Before undocking, the server and client are already
- related to each other, thus the extra confirm message is not needed.
-
- *** Override, what is it? ***
-
- The purpose of enabling the override is to prevent the docking program from automatically doing things with the docking port when docking or undocking.
- Maybe the shuttle is full of plasma for some reason, and you don't want the door to automatically open, or the airlock to cycle.
- This means that the prepare_for_docking/undocking and finish_docking/undocking procs don't get called.
-
- The docking controller will still check the state of the docking port, and thus prevent the shuttle from launching unless they force the launch (handling forced
- launches is not the docking controller's responsibility). In this case it is up to the players to manually get the docking port into a good state to undock
- (which usually just means closing and locking the doors).
-
- In line with this, docking controllers should prevent players from manually doing things when the override is NOT enabled.
-*/
-
-
-/datum/computer/file/embedded_program/docking
- var/tag_target //the tag of the docking controller that we are trying to dock with
- var/dock_state = STATE_UNDOCKED
- var/control_mode = MODE_NONE
- var/response_sent = 0 //so we don't spam confirmation messages
- var/resend_counter = 0 //for periodically resending confirmation messages in case they are missed
-
- var/override_enabled = 0 //when enabled, do not open/close doors or cycle airlocks and wait for the player to do it manually
- var/received_confirm = 0 //for undocking, whether the server has recieved a confirmation from the client
-
-/datum/computer/file/embedded_program/docking/receive_signal(datum/signal/signal, receive_method, receive_param)
- var/receive_tag = signal.data["tag"] //for docking signals, this is the sender id
- var/command = signal.data["command"]
- var/recipient = signal.data["recipient"] //the intended recipient of the docking signal
-
- if (recipient != id_tag)
- return //this signal is not for us
-
- switch (command)
- if ("confirm_dock")
- if (control_mode == MODE_CLIENT && dock_state == STATE_UNDOCKED && receive_tag == tag_target)
- dock_state = STATE_DOCKING
- broadcast_docking_status()
- if (!override_enabled)
- prepare_for_docking()
-
- else if (control_mode == MODE_CLIENT && dock_state == STATE_DOCKING && receive_tag == tag_target)
- dock_state = STATE_DOCKED
- broadcast_docking_status()
- if (!override_enabled)
- finish_docking() //client done docking!
- response_sent = 0
- else if (control_mode == MODE_SERVER && dock_state == STATE_DOCKING && receive_tag == tag_target) //client just sent us the confirmation back, we're done with the docking process
- received_confirm = 1
-
- if ("request_dock")
- if (control_mode == MODE_NONE && dock_state == STATE_UNDOCKED)
- control_mode = MODE_SERVER
-
- dock_state = STATE_DOCKING
- broadcast_docking_status()
-
- tag_target = receive_tag
- if (!override_enabled)
- prepare_for_docking()
- send_docking_command(tag_target, "confirm_dock") //acknowledge the request
-
- if ("confirm_undock")
- if (control_mode == MODE_CLIENT && dock_state == STATE_UNDOCKING && receive_tag == tag_target)
- if (!override_enabled)
- finish_undocking()
- reset() //client is done undocking!
- else if (control_mode == MODE_SERVER && dock_state == STATE_UNDOCKING && receive_tag == tag_target)
- received_confirm = 1
-
- if ("request_undock")
- if (control_mode == MODE_SERVER && dock_state == STATE_DOCKED && receive_tag == tag_target)
- dock_state = STATE_UNDOCKING
- broadcast_docking_status()
-
- if (!override_enabled)
- prepare_for_undocking()
-
- if ("dock_error")
- if (receive_tag == tag_target)
- reset()
-
-/datum/computer/file/embedded_program/docking/process()
- switch(dock_state)
- if (STATE_DOCKING) //waiting for our docking port to be ready for docking
- if (ready_for_docking())
- if (control_mode == MODE_CLIENT)
- if (!response_sent)
- send_docking_command(tag_target, "confirm_dock") //tell the server we're ready
- response_sent = 1
-
- else if (control_mode == MODE_SERVER && received_confirm)
- send_docking_command(tag_target, "confirm_dock") //tell the client we are done docking.
-
- dock_state = STATE_DOCKED
- broadcast_docking_status()
-
- if (!override_enabled)
- finish_docking() //server done docking!
- response_sent = 0
- received_confirm = 0
-
- if (STATE_UNDOCKING)
- if (ready_for_undocking())
- if (control_mode == MODE_CLIENT)
- if (!response_sent)
- send_docking_command(tag_target, "confirm_undock") //tell the server we are OK to undock.
- response_sent = 1
-
- else if (control_mode == MODE_SERVER && received_confirm)
- send_docking_command(tag_target, "confirm_undock") //tell the client we are done undocking.
- if (!override_enabled)
- finish_undocking()
- reset() //server is done undocking!
-
- if (response_sent || resend_counter > 0)
- resend_counter++
-
- if (resend_counter >= MESSAGE_RESEND_TIME || (dock_state != STATE_DOCKING && dock_state != STATE_UNDOCKING))
- response_sent = 0
- resend_counter = 0
-
- //handle invalid states
- if (control_mode == MODE_NONE && dock_state != STATE_UNDOCKED)
- if (tag_target)
- send_docking_command(tag_target, "dock_error")
- reset()
- if (control_mode == MODE_SERVER && dock_state == STATE_UNDOCKED)
- control_mode = MODE_NONE
-
-
-/datum/computer/file/embedded_program/docking/proc/initiate_docking(var/target)
- if (dock_state != STATE_UNDOCKED || control_mode == MODE_SERVER) //must be undocked and not serving another request to begin a new docking handshake
- return
-
- tag_target = target
- control_mode = MODE_CLIENT
-
- send_docking_command(tag_target, "request_dock")
-
-/datum/computer/file/embedded_program/docking/proc/initiate_undocking()
- if (dock_state != STATE_DOCKED || control_mode != MODE_CLIENT) //must be docked and must be client to start undocking
- return
-
- dock_state = STATE_UNDOCKING
- broadcast_docking_status()
-
- if (!override_enabled)
- prepare_for_undocking()
-
- send_docking_command(tag_target, "request_undock")
-
-//tell the docking port to start getting ready for docking - e.g. pressurize
-/datum/computer/file/embedded_program/docking/proc/prepare_for_docking()
- return
-
-//are we ready for docking?
-/datum/computer/file/embedded_program/docking/proc/ready_for_docking()
- return 1
-
-//we are docked, open the doors or whatever.
-/datum/computer/file/embedded_program/docking/proc/finish_docking()
- return
-
-//tell the docking port to start getting ready for undocking - e.g. close those doors.
-/datum/computer/file/embedded_program/docking/proc/prepare_for_undocking()
- return
-
-//we are docked, open the doors or whatever.
-/datum/computer/file/embedded_program/docking/proc/finish_undocking()
- return
-
-//are we ready for undocking?
-/datum/computer/file/embedded_program/docking/proc/ready_for_undocking()
- return 1
-
-/datum/computer/file/embedded_program/docking/proc/enable_override()
- override_enabled = 1
-
-/datum/computer/file/embedded_program/docking/proc/disable_override()
- override_enabled = 0
-
-/datum/computer/file/embedded_program/docking/proc/reset()
- dock_state = STATE_UNDOCKED
- broadcast_docking_status()
-
- control_mode = MODE_NONE
- tag_target = null
- response_sent = 0
- received_confirm = 0
-
-/datum/computer/file/embedded_program/docking/proc/force_undock()
-// to_chat(world, "[id_tag]: forcing undock")
- if (tag_target)
- send_docking_command(tag_target, "dock_error")
- reset()
-
-/datum/computer/file/embedded_program/docking/proc/docked()
- return (dock_state == STATE_DOCKED)
-
-/datum/computer/file/embedded_program/docking/proc/undocked()
- return (dock_state == STATE_UNDOCKED)
-
-//returns 1 if we are saftely undocked (and the shuttle can leave)
-/datum/computer/file/embedded_program/docking/proc/can_launch()
- return undocked()
-
-/datum/computer/file/embedded_program/docking/proc/send_docking_command(var/recipient, var/command)
- var/datum/signal/signal = new
- signal.data["tag"] = id_tag
- signal.data["command"] = command
- signal.data["recipient"] = recipient
- post_signal(signal)
-
-/datum/computer/file/embedded_program/docking/proc/broadcast_docking_status()
- var/datum/signal/signal = new
- signal.data["tag"] = id_tag
- signal.data["dock_status"] = get_docking_status()
- post_signal(signal)
-
-//this is mostly for NanoUI
-/datum/computer/file/embedded_program/docking/proc/get_docking_status()
- switch (dock_state)
- if (STATE_UNDOCKED) return "undocked"
- if (STATE_DOCKING) return "docking"
- if (STATE_UNDOCKING) return "undocking"
- if (STATE_DOCKED) return "docked"
-
-
-#undef STATE_UNDOCKED
-#undef STATE_DOCKING
-#undef STATE_UNDOCKING
-#undef STATE_DOCKED
-
-#undef MODE_NONE
-#undef MODE_SERVER
-#undef MODE_CLIENT
\ No newline at end of file
diff --git a/code/game/machinery/embedded_controller/docking_program_multi.dm b/code/game/machinery/embedded_controller/docking_program_multi.dm
deleted file mode 100644
index dc582b915f9..00000000000
--- a/code/game/machinery/embedded_controller/docking_program_multi.dm
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- These programs are for docking controllers that consist of multiple independent airlocks
- Each airlock has an airlock controller running the child program, and there is one docking controller running the master program
-*/
-
-/*
- the master program
-*/
-/datum/computer/file/embedded_program/docking/multi
- var/list/children_tags
- var/list/children_ready
- var/list/children_override
-
-/datum/computer/file/embedded_program/docking/multi/New(var/obj/machinery/embedded_controller/M)
- ..(M)
-
- if (istype(M,/obj/machinery/embedded_controller/radio/docking_port_multi)) //if our parent controller is the right type, then we can auto-init stuff at construction
- var/obj/machinery/embedded_controller/radio/docking_port_multi/controller = M
- //parse child_tags_txt and create child tags
- children_tags = splittext(controller.child_tags_txt, ";")
-
- children_ready = list()
- children_override = list()
- for (var/child_tag in children_tags)
- children_ready[child_tag] = 0
- children_override[child_tag] = "disabled"
-
-/datum/computer/file/embedded_program/docking/multi/proc/clear_children_ready_status()
- for (var/child_tag in children_tags)
- children_ready[child_tag] = 0
-
-/datum/computer/file/embedded_program/docking/multi/receive_signal(datum/signal/signal, receive_method, receive_param)
- var/receive_tag = signal.data["tag"] //for docking signals, this is the sender id
- var/command = signal.data["command"]
- var/recipient = signal.data["recipient"] //the intended recipient of the docking signal
-
- if (receive_tag in children_tags)
-
- //track children status
- if (signal.data["override_status"])
- children_override[receive_tag] = signal.data["override_status"]
-
- if (recipient == id_tag)
- switch (command)
- if ("ready_for_docking")
- children_ready[receive_tag] = 1
- if ("ready_for_undocking")
- children_ready[receive_tag] = 1
- if ("status_override_enabled")
- children_override[receive_tag] = 1
- if ("status_override_disabled")
- children_override[receive_tag] = 0
-
- ..(signal, receive_method, receive_param)
-
-/datum/computer/file/embedded_program/docking/multi/prepare_for_docking()
- //clear children ready status
- clear_children_ready_status()
-
- //tell children to prepare for docking
- for (var/child_tag in children_tags)
- send_docking_command(child_tag, "prepare_for_docking")
-
-/datum/computer/file/embedded_program/docking/multi/ready_for_docking()
- //check children ready status
- for (var/child_tag in children_tags)
- if (!children_ready[child_tag])
- return 0
- return 1
-
-/datum/computer/file/embedded_program/docking/multi/finish_docking()
- //tell children to finish docking
- for (var/child_tag in children_tags)
- send_docking_command(child_tag, "finish_docking")
-
- //clear ready flags
- clear_children_ready_status()
-
-/datum/computer/file/embedded_program/docking/multi/prepare_for_undocking()
- //clear children ready status
- clear_children_ready_status()
-
- //tell children to prepare for undocking
- for (var/child_tag in children_tags)
- send_docking_command(child_tag, "prepare_for_undocking")
-
-/datum/computer/file/embedded_program/docking/multi/ready_for_undocking()
- //check children ready status
- for (var/child_tag in children_tags)
- if (!children_ready[child_tag])
- return 0
- return 1
-
-/datum/computer/file/embedded_program/docking/multi/finish_undocking()
- //tell children to finish undocking
- for (var/child_tag in children_tags)
- send_docking_command(child_tag, "finish_undocking")
-
- //clear ready flags
- clear_children_ready_status()
-
-
-
-
-/*
- the child program
- technically should be "slave" but eh... I'm too politically correct.
-*/
-/datum/computer/file/embedded_program/airlock/multi_docking
- var/master_tag
-
- var/master_status = "undocked"
- var/override_enabled = 0
- var/docking_enabled = 0
- var/docking_mode = 0 //0 = docking, 1 = undocking
- var/response_sent = 0
-
-/datum/computer/file/embedded_program/airlock/multi_docking/New(var/obj/machinery/embedded_controller/M)
- ..(M)
-
- if (istype(M, /obj/machinery/embedded_controller/radio/airlock/docking_port_multi)) //if our parent controller is the right type, then we can auto-init stuff at construction
- var/obj/machinery/embedded_controller/radio/airlock/docking_port_multi/controller = M
- src.master_tag = controller.master_tag
-
-/datum/computer/file/embedded_program/airlock/multi_docking/receive_user_command(command)
- if (command == "toggle_override")
- if (override_enabled)
- override_enabled = 0
- broadcast_override_status()
- else
- override_enabled = 1
- broadcast_override_status()
- return
-
- if (!docking_enabled|| override_enabled) //only allow the port to be used as an airlock if nothing is docked here or the override is enabled
- ..(command)
-
-/datum/computer/file/embedded_program/airlock/multi_docking/receive_signal(datum/signal/signal, receive_method, receive_param)
- ..()
-
- var/receive_tag = signal.data["tag"] //for docking signals, this is the sender id
- var/command = signal.data["command"]
- var/recipient = signal.data["recipient"] //the intended recipient of the docking signal
-
- if (receive_tag != master_tag)
- return //only respond to master
-
- //track master's status
- if (signal.data["dock_status"])
- master_status = signal.data["dock_status"]
-
- if (recipient != id_tag)
- return //this signal is not for us
-
- switch (command)
- if ("prepare_for_docking")
- docking_enabled = 1
- docking_mode = 0
- response_sent = 0
-
- if (!override_enabled)
- begin_cycle_in()
-
- if ("prepare_for_undocking")
- docking_mode = 1
- response_sent = 0
-
- if (!override_enabled)
- stop_cycling()
- close_doors()
- disable_mech_regulation()
-
- if ("finish_docking")
- if (!override_enabled)
- enable_mech_regulation()
- open_doors()
-
- if ("finish_undocking")
- docking_enabled = 0
-
-/datum/computer/file/embedded_program/airlock/multi_docking/process()
- ..()
-
- if (docking_enabled && !response_sent)
-
- switch (docking_mode)
- if (0) //docking
- if (ready_for_docking())
- send_signal_to_master("ready_for_docking")
- response_sent = 1
- if (1) //undocking
- if (ready_for_undocking())
- send_signal_to_master("ready_for_undocking")
- response_sent = 1
-
-//checks if we are ready for docking
-/datum/computer/file/embedded_program/airlock/multi_docking/proc/ready_for_docking()
- return done_cycling()
-
-//checks if we are ready for undocking
-/datum/computer/file/embedded_program/airlock/multi_docking/proc/ready_for_undocking()
- return check_doors_secured()
-
-/datum/computer/file/embedded_program/airlock/multi_docking/proc/open_doors()
- toggleDoor(memory["interior_status"], tag_interior_door, memory["secure"], "open")
- toggleDoor(memory["exterior_status"], tag_exterior_door, memory["secure"], "open")
-
-/datum/computer/file/embedded_program/airlock/multi_docking/cycleDoors(var/target)
- if (!docking_enabled|| override_enabled) //only allow the port to be used as an airlock if nothing is docked here or the override is enabled
- ..(target)
-
-/datum/computer/file/embedded_program/airlock/multi_docking/proc/send_signal_to_master(var/command)
- var/datum/signal/signal = new
- signal.data["tag"] = id_tag
- signal.data["command"] = command
- signal.data["recipient"] = master_tag
- post_signal(signal)
-
-/datum/computer/file/embedded_program/airlock/multi_docking/proc/broadcast_override_status()
- var/datum/signal/signal = new
- signal.data["tag"] = id_tag
- signal.data["override_status"] = override_enabled? "enabled" : "disabled"
- post_signal(signal)
diff --git a/code/game/machinery/embedded_controller/embedded_controller_base.dm b/code/game/machinery/embedded_controller/embedded_controller_base.dm
index 06a5266d17e..a4a656fa5d6 100644
--- a/code/game/machinery/embedded_controller/embedded_controller_base.dm
+++ b/code/game/machinery/embedded_controller/embedded_controller_base.dm
@@ -27,8 +27,8 @@
src.updateDialog()
/obj/machinery/embedded_controller/attack_ghost(mob/user as mob)
- src.ui_interact(user)
-
+ src.ui_interact(user)
+
/obj/machinery/embedded_controller/attack_ai(mob/user as mob)
src.ui_interact(user)
@@ -55,6 +55,7 @@
unacidable = 1
/obj/machinery/embedded_controller/radio/initialize()
+ ..()
set_frequency(frequency)
/obj/machinery/embedded_controller/radio/update_icon()
@@ -77,4 +78,4 @@
/obj/machinery/embedded_controller/radio/proc/set_frequency(new_frequency)
radio_controller.remove_object(src, frequency)
frequency = new_frequency
- radio_connection = radio_controller.add_object(src, frequency, radio_filter)
\ No newline at end of file
+ radio_connection = radio_controller.add_object(src, frequency, radio_filter)
diff --git a/code/game/machinery/embedded_controller/embedded_program_base.dm b/code/game/machinery/embedded_controller/embedded_program_base.dm
index 06507d9d5f9..1fe527df13b 100644
--- a/code/game/machinery/embedded_controller/embedded_program_base.dm
+++ b/code/game/machinery/embedded_controller/embedded_program_base.dm
@@ -7,7 +7,7 @@
/datum/computer/file/embedded_program/New(var/obj/machinery/embedded_controller/M)
master = M
- if (istype(M, /obj/machinery/embedded_controller/radio))
+ if(istype(M, /obj/machinery/embedded_controller/radio))
var/obj/machinery/embedded_controller/radio/R = M
id_tag = R.id_tag
diff --git a/code/game/machinery/embedded_controller/simple_docking_controller.dm b/code/game/machinery/embedded_controller/simple_docking_controller.dm
deleted file mode 100644
index 1883d363987..00000000000
--- a/code/game/machinery/embedded_controller/simple_docking_controller.dm
+++ /dev/null
@@ -1,158 +0,0 @@
-//a docking port that uses a single door
-/obj/machinery/embedded_controller/radio/simple_docking_controller
- name = "docking hatch controller"
- var/tag_door
- var/datum/computer/file/embedded_program/docking/simple/docking_program
-
-/obj/machinery/embedded_controller/radio/simple_docking_controller/initialize()
- ..()
- docking_program = new/datum/computer/file/embedded_program/docking/simple(src)
- program = docking_program
-
-/obj/machinery/embedded_controller/radio/simple_docking_controller/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
- var/data[0]
-
- data = list(
- "docking_status" = docking_program.get_docking_status(),
- "override_enabled" = docking_program.override_enabled,
- "door_state" = docking_program.memory["door_status"]["state"],
- "door_lock" = docking_program.memory["door_status"]["lock"],
- )
-
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
-
- if (!ui)
- ui = new(user, src, ui_key, "simple_docking_console.tmpl", name, 470, 290)
- ui.set_initial_data(data)
- ui.open()
- ui.set_auto_update(1)
-
-/obj/machinery/embedded_controller/radio/simple_docking_controller/Topic(href, href_list)
- if(..())
- return 1
-
- usr.set_machine(src)
- src.add_fingerprint(usr)
-
- var/clean = 0
- switch(href_list["command"]) //anti-HTML-hacking checks
- if("force_door")
- clean = 1
- if("toggle_override")
- clean = 1
-
- if(clean)
- program.receive_user_command(href_list["command"])
-
- return 0
-
-
-//A docking controller program for a simple door based docking port
-/datum/computer/file/embedded_program/docking/simple
- var/tag_door
-
-/datum/computer/file/embedded_program/docking/simple/New(var/obj/machinery/embedded_controller/M)
- ..(M)
- memory["door_status"] = list(state = "closed", lock = "locked") //assume closed and locked in case the doors dont report in
-
- if (istype(M, /obj/machinery/embedded_controller/radio/simple_docking_controller))
- var/obj/machinery/embedded_controller/radio/simple_docking_controller/controller = M
-
- tag_door = controller.tag_door? controller.tag_door : "[id_tag]_hatch"
-
- spawn(10)
- signal_door("update") //signals connected doors to update their status
-
-
-/datum/computer/file/embedded_program/docking/simple/receive_signal(datum/signal/signal, receive_method, receive_param)
- var/receive_tag = signal.data["tag"]
-
- if(!receive_tag) return
-
- if(receive_tag==tag_door)
- memory["door_status"]["state"] = signal.data["door_status"]
- memory["door_status"]["lock"] = signal.data["lock_status"]
-
- ..(signal, receive_method, receive_param)
-
-/datum/computer/file/embedded_program/docking/simple/receive_user_command(command)
- switch(command)
- if("force_door")
- if (override_enabled)
- if(memory["door_status"]["state"] == "open")
- close_door()
- else
- open_door()
- if("toggle_override")
- if (override_enabled)
- disable_override()
- else
- enable_override()
-
-
-/datum/computer/file/embedded_program/docking/simple/proc/signal_door(var/command)
- var/datum/signal/signal = new
- signal.data["tag"] = tag_door
- signal.data["command"] = command
- post_signal(signal)
-
-/datum/computer/file/embedded_program/docking/simple/proc/open_door()
- if(memory["door_status"]["state"] == "closed")
- signal_door("secure_open")
- else if(memory["door_status"]["lock"] == "unlocked")
- signal_door("lock")
-
-/datum/computer/file/embedded_program/docking/simple/proc/close_door()
- if(memory["door_status"]["state"] == "open")
- signal_door("secure_close")
- else if(memory["door_status"]["lock"] == "unlocked")
- signal_door("lock")
-
-//tell the docking port to start getting ready for docking - e.g. pressurize
-/datum/computer/file/embedded_program/docking/simple/prepare_for_docking()
- return //don't need to do anything
-
-//are we ready for docking?
-/datum/computer/file/embedded_program/docking/simple/ready_for_docking()
- return 1 //don't need to do anything
-
-//we are docked, open the doors or whatever.
-/datum/computer/file/embedded_program/docking/simple/finish_docking()
- open_door()
-
-//tell the docking port to start getting ready for undocking - e.g. close those doors.
-/datum/computer/file/embedded_program/docking/simple/prepare_for_undocking()
- close_door()
-
-//are we ready for undocking?
-/datum/computer/file/embedded_program/docking/simple/ready_for_undocking()
- return (memory["door_status"]["state"] == "closed" && memory["door_status"]["lock"] == "locked")
-
-/*** DEBUG VERBS ***
-
-/obj/machinery/embedded_controller/radio/simple_docking_controller/verb/view_state()
- set category = "Debug"
- set src in view(1)
- src.program:print_state()
-
-/obj/machinery/embedded_controller/radio/simple_docking_controller/verb/spoof_signal(var/command as text, var/sender as text)
- set category = "Debug"
- set src in view(1)
- var/datum/signal/signal = new
- signal.data["tag"] = sender
- signal.data["command"] = command
- signal.data["recipient"] = id_tag
-
- src.program:receive_signal(signal)
-
-/obj/machinery/embedded_controller/radio/simple_docking_controller/verb/debug_init_dock(var/target as text)
- set category = "Debug"
- set src in view(1)
- src.program:initiate_docking(target)
-
-/obj/machinery/embedded_controller/radio/simple_docking_controller/verb/debug_init_undock()
- set category = "Debug"
- set src in view(1)
- src.program:initiate_undocking()
-
-*/
diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm
index 3426023f13c..9b2e0bdf957 100644
--- a/code/game/machinery/firealarm.dm
+++ b/code/game/machinery/firealarm.dm
@@ -110,7 +110,9 @@ FIRE ALARM
else if(istype(W, /obj/item/weapon/crowbar))
to_chat(user, "You pry out the circuit!")
playsound(get_turf(src), 'sound/items/Crowbar.ogg', 50, 1)
- spawn(20)
+ if(do_after(user, 20, target = src))
+ if(buildstage != 1)
+ return
var/obj/item/weapon/firealarm_electronics/circuit = new /obj/item/weapon/firealarm_electronics()
circuit.loc = user.loc
buildstage = 0
@@ -174,14 +176,14 @@ FIRE ALARM
var/area/A = src.loc
var/d1
var/d2
- if (ishuman(user) || issilicon(user) || isobserver(user))
+ if(ishuman(user) || issilicon(user) || isobserver(user))
A = A.loc
- if (A.fire)
+ if(A.fire)
d1 = text("Reset - Lockdown", src)
else
d1 = text("Alarm - Lockdown", src)
- if (src.timing)
+ if(src.timing)
d2 = text("Stop Time Lock", src)
else
d2 = text("Initiate Time Lock", src)
@@ -192,11 +194,11 @@ FIRE ALARM
onclose(user, "firealarm")
else
A = A.loc
- if (A.fire)
+ if(A.fire)
d1 = text("[]", src, stars("Reset - Lockdown"))
else
d1 = text("[]", src, stars("Alarm - Lockdown"))
- if (src.timing)
+ if(src.timing)
d2 = text("[]", src, stars("Stop Time Lock"))
else
d2 = text("[]", src, stars("Initiate Time Lock"))
@@ -258,7 +260,7 @@ FIRE ALARM
time = min(max(round(src.time), 0), 120)
/obj/machinery/firealarm/proc/reset()
- if (!( src.working ))
+ if(!( src.working ))
return
var/area/A = get_area(src)
A.fire_reset()
@@ -267,7 +269,7 @@ FIRE ALARM
return
/obj/machinery/firealarm/proc/alarm(var/duration = 0)
- if (!( src.working))
+ if(!( src.working))
return
var/area/A = get_area(src)
for(var/obj/machinery/firealarm/FA in A)
@@ -291,6 +293,8 @@ FIRE ALARM
pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24)
pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0
+ // TODO: Tie into space manager
+ // also hwat
if(z == ZLEVEL_STATION || ZLEVEL_ASTEROID == 5)
if(security_level)
src.overlays += image('icons/obj/monitors.dmi', "overlay_[get_security_level()]")
@@ -308,7 +312,7 @@ Just a object used in constructing fire alarms
icon = 'icons/obj/doors/door_assembly.dmi'
icon_state = "door_electronics"
desc = "A circuit. It has a label on it, it says \"Can handle heat levels up to 40 degrees celsius!\""
- w_class = 2.0
+ w_class = 2
materials = list(MAT_METAL=50, MAT_GLASS=50)
/obj/machinery/partyalarm
@@ -330,7 +334,7 @@ Just a object used in constructing fire alarms
/obj/machinery/partyalarm/New()
var/area/A = get_area_master(src)
- if (!( istype(A, /area) ))
+ if(!( istype(A, /area) ))
return
master_area=A
@@ -343,13 +347,13 @@ Just a object used in constructing fire alarms
ASSERT(isarea(A))
var/d1
var/d2
- if (istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon/ai))
+ if(istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon/ai))
- if (A.party)
+ if(A.party)
d1 = text("No Party :(", src)
else
d1 = text("PARTY!!!", src)
- if (timing)
+ if(timing)
d2 = text("Stop Time Lock", src)
else
d2 = text("Initiate Time Lock", src)
@@ -359,11 +363,11 @@ Just a object used in constructing fire alarms
user << browse(dat, "window=partyalarm")
onclose(user, "partyalarm")
else
- if (A.fire)
+ if(A.fire)
d1 = text("[]", src, stars("No Party :("))
else
d1 = text("[]", src, stars("PARTY!!!"))
- if (timing)
+ if(timing)
d2 = text("[]", src, stars("Stop Time Lock"))
else
d2 = text("[]", src, stars("Initiate Time Lock"))
@@ -375,7 +379,7 @@ Just a object used in constructing fire alarms
return
/obj/machinery/partyalarm/proc/reset()
- if (!( working ))
+ if(!( working ))
return
var/area/A = get_area(src)
ASSERT(isarea(A))
@@ -383,7 +387,7 @@ Just a object used in constructing fire alarms
return
/obj/machinery/partyalarm/proc/alarm()
- if (!( working ))
+ if(!( working ))
return
var/area/A = get_area(src)
ASSERT(isarea(A))
@@ -392,20 +396,20 @@ Just a object used in constructing fire alarms
/obj/machinery/partyalarm/Topic(href, href_list)
..()
- if (usr.stat || stat & (BROKEN|NOPOWER))
+ if(usr.stat || stat & (BROKEN|NOPOWER))
return
- if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
+ if((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
usr.machine = src
- if (href_list["reset"])
+ if(href_list["reset"])
reset()
else
- if (href_list["alarm"])
+ if(href_list["alarm"])
alarm()
else
- if (href_list["time"])
+ if(href_list["time"])
timing = text2num(href_list["time"])
else
- if (href_list["tp"])
+ if(href_list["tp"])
var/tp = text2num(href_list["tp"])
time += tp
time = min(max(round(time), 0), 120)
diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm
index 01f95d81ab6..655ffd11634 100644
--- a/code/game/machinery/flasher.dm
+++ b/code/game/machinery/flasher.dm
@@ -28,7 +28,7 @@
src.sd_set_light(2)
*/
/obj/machinery/flasher/power_change()
- if ( powered() )
+ if( powered() )
stat &= ~NOPOWER
icon_state = "[base_state]1"
// src.sd_set_light(2)
@@ -39,26 +39,26 @@
//Don't want to render prison breaks impossible
/obj/machinery/flasher/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
- if (istype(W, /obj/item/weapon/wirecutters))
+ if(istype(W, /obj/item/weapon/wirecutters))
add_fingerprint(user)
src.disable = !src.disable
- if (src.disable)
+ if(src.disable)
user.visible_message("\red [user] has disconnected the [src]'s flashbulb!", "\red You disconnect the [src]'s flashbulb!")
- if (!src.disable)
+ if(!src.disable)
user.visible_message("\red [user] has connected the [src]'s flashbulb!", "\red You connect the [src]'s flashbulb!")
//Let the AI trigger them directly.
/obj/machinery/flasher/attack_ai()
- if (src.anchored)
+ if(src.anchored)
return src.flash()
else
return
/obj/machinery/flasher/proc/flash()
- if (!(powered()))
+ if(!(powered()))
return
- if ((src.disable) || (src.last_flash && world.time < src.last_flash + 150))
+ if((src.disable) || (src.last_flash && world.time < src.last_flash + 150))
return
playsound(src.loc, 'sound/weapons/flash.ogg', 100, 1)
@@ -67,7 +67,7 @@
use_power(1000)
for(var/mob/living/L in viewers(src, null))
- if (get_dist(src, L) > src.range)
+ if(get_dist(src, L) > src.range)
continue
if(L.flash_eyes(affect_silicon = 1))
@@ -85,24 +85,24 @@
..(severity)
/obj/machinery/flasher/portable/HasProximity(atom/movable/AM as mob|obj)
- if ((src.disable) || (src.last_flash && world.time < src.last_flash + 150))
+ if((src.disable) || (src.last_flash && world.time < src.last_flash + 150))
return
if(istype(AM, /mob/living/carbon))
var/mob/living/carbon/M = AM
- if ((M.m_intent != "walk") && (src.anchored))
+ if((M.m_intent != "walk") && (src.anchored))
src.flash()
/obj/machinery/flasher/portable/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
- if (istype(W, /obj/item/weapon/wrench))
+ if(istype(W, /obj/item/weapon/wrench))
add_fingerprint(user)
src.anchored = !src.anchored
- if (!src.anchored)
+ if(!src.anchored)
user.show_message(text("\red [src] can now be moved."))
src.overlays.Cut()
- else if (src.anchored)
+ else if(src.anchored)
user.show_message(text("\red [src] is now secured."))
src.overlays += "[base_state]-s"
diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm
index 7c5e152529f..cee7706d256 100644
--- a/code/game/machinery/floodlight.dm
+++ b/code/game/machinery/floodlight.dm
@@ -19,6 +19,12 @@
src.cell = new(src)
..()
+/obj/machinery/floodlight/Destroy()
+ if(cell)
+ qdel(cell)
+ cell = null
+ return ..()
+
/obj/machinery/floodlight/proc/updateicon()
icon_state = "flood[open ? "o" : ""][open && cell ? "b" : ""]0[on]"
@@ -31,7 +37,7 @@
set_light(0)
src.visible_message("[src] shuts down due to lack of power!")
return
-
+
/obj/machinery/floodlight/attack_ai(mob/user as mob)
return
@@ -69,7 +75,7 @@
/obj/machinery/floodlight/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/weapon/wrench))
- if (!anchored && !isinspace())
+ if(!anchored && !isinspace())
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user.visible_message( \
"[user] tightens \the [src]'s casters.", \
@@ -83,8 +89,8 @@
" You have loosened \the [src]'s casters.", \
"You hear ratchet.")
anchored = 0
- if (istype(W, /obj/item/weapon/screwdriver))
- if (!open)
+ if(istype(W, /obj/item/weapon/screwdriver))
+ if(!open)
if(unlocked)
unlocked = 0
to_chat(user, "You screw the battery panel in place.")
@@ -92,7 +98,7 @@
unlocked = 1
to_chat(user, "You unscrew the battery panel.")
- if (istype(W, /obj/item/weapon/crowbar))
+ if(istype(W, /obj/item/weapon/crowbar))
if(unlocked)
if(open)
open = 0
@@ -103,7 +109,7 @@
open = 1
to_chat(user, "You remove the battery panel.")
- if (istype(W, /obj/item/weapon/stock_parts/cell))
+ if(istype(W, /obj/item/weapon/stock_parts/cell))
if(open)
if(cell)
to_chat(user, "There is a power cell already installed.")
diff --git a/code/game/machinery/guestpass.dm b/code/game/machinery/guestpass.dm
index bf1d69e7437..512ed47263a 100644
--- a/code/game/machinery/guestpass.dm
+++ b/code/game/machinery/guestpass.dm
@@ -11,19 +11,19 @@
var/reason = "NOT SPECIFIED"
/obj/item/weapon/card/id/guest/GetAccess()
- if (world.time > expiration_time)
+ if(world.time > expiration_time)
return access
else
return temp_access
/obj/item/weapon/card/id/guest/examine(mob/user)
..(user)
- if (world.time < expiration_time)
+ if(world.time < expiration_time)
to_chat(user, "This pass expires at [worldtime2text(expiration_time)].")
else
to_chat(user, "It expired at [worldtime2text(expiration_time)].")
to_chat(user, "It grants access to following areas:")
- for (var/A in temp_access)
+ for(var/A in temp_access)
to_chat(user, "[get_access_desc(A)].")
to_chat(user, "Issuing reason: [reason].")
@@ -72,9 +72,9 @@
user.set_machine(src)
var/dat
- if (mode == 1) //Logs
+ if(mode == 1) //Logs
dat += "
Activity log
"
- for (var/entry in internal_log)
+ for(var/entry in internal_log)
dat += "[entry] "
dat += "Print "
dat += "Back "
@@ -86,15 +86,17 @@
dat += "Reason: [reason] "
dat += "Duration (minutes): [duration] m "
dat += "Access to areas: "
- if (giver && giver.access)
- for (var/A in get_changeable_accesses())
+ if(giver && giver.access)
+ for(var/A in get_changeable_accesses())
var/area = get_access_desc(A)
- if (A in accesses)
+ if(A in accesses)
area = "[area]"
dat += "[area] "
dat += " Issue pass "
- user << browse(dat, "window=guestpass;size=400x520")
+ var/datum/browser/popup = new(user, "guestpass", name, 400, 520)
+ popup.set_content(dat)
+ popup.open(0)
onclose(user, "guestpass")
@@ -102,37 +104,37 @@
if(..())
return 1
usr.set_machine(src)
- if (href_list["mode"])
+ if(href_list["mode"])
mode = text2num(href_list["mode"])
- if (href_list["choice"])
+ if(href_list["choice"])
switch(href_list["choice"])
- if ("giv_name")
+ if("giv_name")
var/nam = strip_html_simple(input("Person pass is issued to", "Name", giv_name) as text|null)
- if (nam)
+ if(nam)
giv_name = nam
- if ("reason")
+ if("reason")
var/reas = strip_html_simple(input("Reason why pass is issued", "Reason", reason) as text|null)
if(reas)
reason = reas
- if ("duration")
+ if("duration")
var/dur = input("Duration (in minutes) during which pass is valid (up to 30 minutes).", "Duration") as num|null
- if (dur)
- if (dur > 0 && dur <= 30)
+ if(dur)
+ if(dur > 0 && dur <= 30)
duration = dur
else
to_chat(usr, "Invalid duration.")
- if ("access")
+ if("access")
var/A = text2num(href_list["access"])
- if (A in accesses)
+ if(A in accesses)
accesses.Remove(A)
else
if(giver && giver.access && (A in get_changeable_accesses()))
accesses.Add(A)
- if (href_list["action"])
+ if(href_list["action"])
switch(href_list["action"])
- if ("id")
- if (giver)
+ if("id")
+ if(giver)
if(ishuman(usr))
giver.loc = usr.loc
if(!usr.get_active_hand())
@@ -144,15 +146,15 @@
accesses.Cut()
else
var/obj/item/I = usr.get_active_hand()
- if (istype(I, /obj/item/weapon/card/id))
+ if(istype(I, /obj/item/weapon/card/id))
usr.drop_item()
I.loc = src
giver = I
updateUsrDialog()
- if ("print")
+ if("print")
var/dat = "
Activity log of guest pass terminal #[uid]
"
- for (var/entry in internal_log)
+ for(var/entry in internal_log)
dat += "[entry] "
// to_chat(usr, "Printing the log, standby...")
//sleep(50)
@@ -161,13 +163,13 @@
P.name = "activity log"
P.info = dat
- if ("issue")
- if (giver)
+ if("issue")
+ if(giver)
var/number = add_zero("[rand(0,9999)]", 4)
var/entry = "\[[worldtime2text()]\] Pass #[number] issued by [giver.registered_name] ([giver.assignment]) to [giv_name]. Reason: [reason]. Grants access to following areas: "
- for (var/i=1 to accesses.len)
+ for(var/i=1 to accesses.len)
var/A = accesses[i]
- if (A)
+ if(A)
var/area = get_access_desc(A)
entry += "[i > 1 ? ", [area]" : "[area]"]"
entry += ". Expires at [worldtime2text(world.time + duration*10*60)]."
diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm
index c8e16257858..abe99777410 100644
--- a/code/game/machinery/hologram.dm
+++ b/code/game/machinery/hologram.dm
@@ -81,7 +81,7 @@ var/const/HOLOPAD_MODE = 0
to_chat(user, "A request for AI presence was already sent recently.")
/obj/machinery/hologram/holopad/attack_ai(mob/living/silicon/ai/user)
- if (!istype(user))
+ if(!istype(user))
return
/*There are pretty much only three ways to interact here.
I don't need to check for client since they're clicking on an object.
@@ -100,9 +100,9 @@ var/const/HOLOPAD_MODE = 0
create_holo(user)//Create one.
src.visible_message("A holographic image of [user] flicks to life right before your eyes!")
else
- to_chat(user, "\red ERROR: \black Image feed in progress.")
+ to_chat(user, "ERROR: Image feed in progress.")
else
- to_chat(user, "\red ERROR: \black Unable to project hologram.")
+ to_chat(user, "ERROR: Unable to project hologram.")
return
/*This is the proc for special two-way communication between AI and holopad/people talking near holopad.
@@ -123,7 +123,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
rendered = "Holopad received, [name_used] [verb], \"[text]\""
master.show_message(rendered, 2)
return
-
+
/obj/machinery/hologram/holopad/hear_message(mob/living/M, text)
if(M&&hologram&&master)//Master is mostly a safety in case lag hits or something.
var/name_used = M.GetVoice()
@@ -165,7 +165,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
if((HOLOPAD_MODE == 0 && (get_dist(master.eyeobj, src) <= holo_range)))
return 1
- else if (HOLOPAD_MODE == 1)
+ else if(HOLOPAD_MODE == 1)
var/area/holo_area = get_area(src)
var/area/eye_area = get_area(master.eyeobj)
@@ -219,10 +219,10 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
if(1.0)
qdel(src)
if(2.0)
- if (prob(50))
+ if(prob(50))
qdel(src)
if(3.0)
- if (prob(5))
+ if(prob(5))
qdel(src)
return
diff --git a/code/game/machinery/holosign.dm b/code/game/machinery/holosign.dm
index 687a07ced0f..d44ee2e3930 100644
--- a/code/game/machinery/holosign.dm
+++ b/code/game/machinery/holosign.dm
@@ -10,19 +10,19 @@
var/on_icon = "sign_on"
proc/toggle()
- if (stat & (BROKEN|NOPOWER))
+ if(stat & (BROKEN|NOPOWER))
return
lit = !lit
update_icon()
update_icon()
- if (!lit)
+ if(!lit)
icon_state = "sign_off"
else
icon_state = on_icon
power_change()
- if (stat & NOPOWER)
+ if(stat & NOPOWER)
lit = 0
update_icon()
@@ -67,7 +67,7 @@
icon_state = "light0"
for(var/obj/machinery/holosign/M in world)
- if (M.id == src.id)
+ if(M.id == src.id)
spawn( 0 )
M.toggle()
return
diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm
index d6e41d29fa2..7cb51574a60 100755
--- a/code/game/machinery/igniter.dm
+++ b/code/game/machinery/igniter.dm
@@ -25,9 +25,9 @@
return
/obj/machinery/igniter/process() //ugh why is this even in process()?
- if (src.on && !(stat & NOPOWER) )
+ if(src.on && !(stat & NOPOWER) )
var/turf/location = src.loc
- if (isturf(location))
+ if(isturf(location))
location.hotspot_expose(1000,500,1)
return 1
@@ -58,7 +58,7 @@
..()
/obj/machinery/sparker/power_change()
- if ( powered() && disable == 0 )
+ if( powered() && disable == 0 )
stat &= ~NOPOWER
icon_state = "[base_state]"
// src.sd_set_light(2)
@@ -70,13 +70,13 @@
/obj/machinery/sparker/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/device/detective_scanner))
return
- if (istype(W, /obj/item/weapon/screwdriver))
+ if(istype(W, /obj/item/weapon/screwdriver))
add_fingerprint(user)
src.disable = !src.disable
- if (src.disable)
+ if(src.disable)
user.visible_message("\red [user] has disabled the [src]!", "\red You disable the connection to the [src].")
icon_state = "[base_state]-d"
- if (!src.disable)
+ if(!src.disable)
user.visible_message("\red [user] has reconnected the [src]!", "\red You fix the connection to the [src].")
if(src.powered())
icon_state = "[base_state]"
@@ -84,16 +84,16 @@
icon_state = "[base_state]-p"
/obj/machinery/sparker/attack_ai()
- if (src.anchored)
+ if(src.anchored)
return src.spark()
else
return
/obj/machinery/sparker/proc/spark()
- if (!(powered()))
+ if(!(powered()))
return
- if ((src.disable) || (src.last_spark && world.time < src.last_spark + 50))
+ if((src.disable) || (src.last_spark && world.time < src.last_spark + 50))
return
@@ -104,7 +104,7 @@
src.last_spark = world.time
use_power(1000)
var/turf/location = src.loc
- if (isturf(location))
+ if(isturf(location))
location.hotspot_expose(1000,500,1)
return 1
diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm
index 5caff96d4ea..fb55eee1200 100644
--- a/code/game/machinery/iv_drip.dm
+++ b/code/game/machinery/iv_drip.dm
@@ -1,101 +1,127 @@
/obj/machinery/iv_drip
name = "\improper IV drip"
icon = 'icons/obj/iv_drip.dmi'
+ icon_state = "iv_drip"
anchored = 0
density = 1
+ var/mob/living/carbon/human/attached = null
+ var/mode = 1 // 1 is injecting, 0 is taking blood.
+ var/obj/item/weapon/reagent_containers/beaker = null
+/obj/machinery/iv_drip/New()
+ ..()
+ update_icon()
-/obj/machinery/iv_drip/var/mob/living/carbon/human/attached = null
-/obj/machinery/iv_drip/var/mode = 1 // 1 is injecting, 0 is taking blood.
-/obj/machinery/iv_drip/var/obj/item/weapon/reagent_containers/beaker = null
+/obj/machinery/iv_drip/Destroy()
+ attached = null
+ if(beaker)
+ qdel(beaker)
+ beaker = null
+ return ..()
/obj/machinery/iv_drip/update_icon()
- if(src.attached)
- icon_state = "hooked"
+ if(attached)
+ if(mode)
+ icon_state = "injecting"
+ else
+ icon_state = "donating"
else
- icon_state = ""
+ if(mode)
+ icon_state = "injectidle"
+ else
+ icon_state = "donateidle"
- overlays = null
+ overlays.Cut()
if(beaker)
- var/datum/reagents/reagents = beaker.reagents
- if(reagents.total_volume)
+ if(attached)
+ overlays += "beakeractive"
+ else
+ overlays += "beakeridle"
+ if(beaker.reagents.total_volume)
var/image/filling = image('icons/obj/iv_drip.dmi', src, "reagent")
- var/percent = round((reagents.total_volume / beaker.volume) * 100)
+ var/percent = round((beaker.reagents.total_volume / beaker.volume) * 100)
switch(percent)
- if(0 to 9) filling.icon_state = "reagent0"
- if(10 to 24) filling.icon_state = "reagent10"
- if(25 to 49) filling.icon_state = "reagent25"
- if(50 to 74) filling.icon_state = "reagent50"
- if(75 to 79) filling.icon_state = "reagent75"
- if(80 to 90) filling.icon_state = "reagent80"
- if(91 to INFINITY) filling.icon_state = "reagent100"
+ if(0 to 9)
+ filling.icon_state = "reagent0"
+ if(10 to 24)
+ filling.icon_state = "reagent10"
+ if(25 to 49)
+ filling.icon_state = "reagent25"
+ if(50 to 74)
+ filling.icon_state = "reagent50"
+ if(75 to 79)
+ filling.icon_state = "reagent75"
+ if(80 to 90)
+ filling.icon_state = "reagent80"
+ if(91 to INFINITY)
+ filling.icon_state = "reagent100"
- filling.icon += mix_color_from_reagents(reagents.reagent_list)
+ filling.icon += mix_color_from_reagents(beaker.reagents.reagent_list)
overlays += filling
-/obj/machinery/iv_drip/MouseDrop(over_object, src_location, over_location)
- ..()
-
- if(!ishuman(usr) && !isrobot(usr))
- return
-
- var/turf/T = get_turf(src)
- if(!usr in range(1, T))
+/obj/machinery/iv_drip/MouseDrop(mob/living/target)
+ if(!ishuman(usr))
return
if(attached)
- visible_message("[src.attached] is detached from \the [src]")
- src.attached = null
- src.update_icon()
+ visible_message("[attached] is detached from [src].")
+ attached = null
+ update_icon()
return
- if(in_range(src, usr) && ishuman(over_object) && get_dist(over_object, src) <= 1)
- visible_message("[usr] attaches \the [src] to \the [over_object].")
- src.attached = over_object
- src.update_icon()
+ if(!target.dna)
+ to_chat(usr, "The drip beeps: Warning, incompatible creature!")
+ return
-
-/obj/machinery/iv_drip/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
- if (istype(W, /obj/item/weapon/reagent_containers))
- if(!isnull(src.beaker))
- to_chat(user, "There is already a reagent container loaded!")
- return
-
- if(user.drop_item())
- W.forceMove(src)
- src.beaker = W
- to_chat(user, "You attach \the [W] to \the [src].")
- src.update_icon()
- return
+ if(Adjacent(target) && usr.Adjacent(target))
+ if(beaker)
+ usr.visible_message("[usr] attaches [src] to [target].", "You attach [src] to [target].")
+ attached = target
+ addAtProcessing()
+ update_icon()
else
- to_chat(user, "\The [W] is stuck to you!")
+ to_chat(usr, "There's nothing attached to the IV drip!")
+
+/obj/machinery/iv_drip/attackby(obj/item/weapon/W, mob/user, params)
+ if(istype(W, /obj/item/weapon/reagent_containers))
+ if(beaker)
+ to_chat(user, "There is already a reagent container loaded!")
+ return
+ if(!user.drop_item())
+ return
+
+ W.forceMove(src)
+ beaker = W
+ to_chat(user, "You attach [W] to [src].")
+ update_icon()
else
return ..()
/obj/machinery/iv_drip/process()
- //set background = 1
+ if(!attached)
+ return PROCESS_KILL
- if(src.attached)
+ if(get_dist(src, attached) > 1 && isturf(attached.loc))
+ to_chat(attached, "The IV drip needle is ripped out of you!")
+ attached.apply_damage(3, BRUTE, pick("r_arm", "l_arm"))
+ attached = null
+ update_icon()
+ return PROCESS_KILL
- if(!(get_dist(src, src.attached) <= 1 && isturf(src.attached.loc)))
- visible_message("The needle is ripped out of [src.attached], doesn't that hurt?")
- src.attached:apply_damage(3, BRUTE, pick("r_arm", "l_arm"))
- src.attached = null
- src.update_icon()
- return
-
- if(src.attached && src.beaker)
+ if(beaker)
// Give blood
if(mode)
- if(src.beaker.volume > 0)
- var/transfer_amount = REAGENTS_METABOLISM
- if(istype(src.beaker, /obj/item/weapon/reagent_containers/blood))
+ if(beaker.volume > 0)
+ var/transfer_amount = 5
+ if(istype(beaker, /obj/item/weapon/reagent_containers/blood))
// speed up transfer on blood packs
- transfer_amount = 4
- src.beaker.reagents.trans_to(src.attached, transfer_amount)
+ transfer_amount = 10
+ var/fraction = min(transfer_amount/beaker.volume, 1) //the fraction that is transfered of the total volume
+ beaker.reagents.reaction(attached, INGEST, fraction) //make reagents reacts, but don't spam messages
+ beaker.reagents.trans_to(attached, transfer_amount)
update_icon()
// Take blood
@@ -104,69 +130,111 @@
amount = min(amount, 4)
// If the beaker is full, ping
if(amount == 0)
- if(prob(5)) visible_message("\The [src] pings.")
+ if(prob(5))
+ visible_message("[src] pings.")
return
var/mob/living/carbon/human/T = attached
- if(!istype(T)) return
+ if(!ishuman(T))
+ return
+
if(!T.dna)
return
+
if(NOCLONE in T.mutations)
return
- if(T.species && T.species.flags & NO_BLOOD)
+ if(T.species.flags & NO_BLOOD)
return
- // If the human is losing too much blood, beep.
- if(T.vessel.get_reagent_amount("blood") < BLOOD_VOLUME_SAFE) if(prob(5))
- visible_message("\The [src] beeps loudly.")
-
- var/datum/reagent/B = T.take_blood(beaker,amount)
-
- if (B)
- beaker.reagents.reagent_list |= B
- beaker.reagents.update_total()
- beaker.on_reagent_change()
- beaker.reagents.handle_reactions()
+ if(T.species.exotic_blood)
+ T.vessel.trans_to(beaker, amount)
update_icon()
+ else
+ var/datum/reagent/B = T.take_blood(beaker, amount)
-/obj/machinery/iv_drip/attack_hand(mob/user as mob)
- if(src.beaker)
- src.beaker.loc = get_turf(src)
- src.beaker = null
+ if(B)
+ beaker.reagents.reagent_list |= B
+ beaker.reagents.update_total()
+ beaker.on_reagent_change()
+ beaker.reagents.handle_reactions()
+ update_icon()
+
+ // If attached is losing too much blood, beep.
+ var/blood_type = attached.get_blood_name()
+ if(T.vessel.get_reagent_amount(blood_type) < BLOOD_VOLUME_SAFE && prob(5))
+ visible_message("[src] beeps loudly.")
+ playsound(loc, 'sound/machines/twobeep.ogg', 50, 1)
+
+/obj/machinery/iv_drip/attack_hand(mob/user)
+ if(!ishuman(user))
+ return
+ if(attached)
+ visible_message("[attached] is detached from [src]")
+ attached = null
update_icon()
+ return
+ else if(beaker)
+ eject_beaker(user)
else
- return ..()
+ toggle_mode()
+/obj/machinery/iv_drip/AltClick(mob/user)
+ ..()
+ if(user.incapacitated())
+ to_chat(user, "You can't do that right now!")
+ return
+ if(!Adjacent(user))
+ return
+ toggle_mode()
-/obj/machinery/iv_drip/verb/toggle_mode()
- set name = "Toggle Mode"
+/obj/machinery/iv_drip/verb/eject_beaker(mob/user)
set category = "Object"
+ set name = "Remove IV Container"
set src in view(1)
- if(!istype(usr, /mob/living))
- to_chat(usr, "\red You can't do that.")
+ if(!iscarbon(usr))
+ to_chat(usr, "You can't do that!")
return
- if(usr.stat)
+ if(usr.incapacitated())
+ return
+
+ if(beaker)
+ beaker.forceMove(get_turf(src))
+ beaker = null
+ update_icon()
+
+/obj/machinery/iv_drip/verb/toggle_mode()
+ set category = "Object"
+ set name = "Toggle Mode"
+ set src in view(1)
+
+ if(!iscarbon(usr))
+ to_chat(usr, "You can't do that!")
+ return
+
+ if(usr.incapacitated())
return
mode = !mode
to_chat(usr, "The IV drip is now [mode ? "injecting" : "taking blood"].")
+ update_icon()
/obj/machinery/iv_drip/examine(mob/user)
..(user)
- if (!(user in view(2)) && usr != src.loc) return
+ if(!(user in view(2)) && user != loc)
+ return
- to_chat(usr, "The IV drip is [mode ? "injecting" : "taking blood"].")
+ to_chat(user, "The IV drip is [mode ? "injecting" : "taking blood"].")
if(beaker)
if(beaker.reagents && beaker.reagents.reagent_list.len)
- to_chat(user, "\blue Attached is \a [beaker] with [beaker.reagents.total_volume] units of liquid.")
+ to_chat(user, "Attached is \a [beaker] with [beaker.reagents.total_volume] units of liquid.")
else
- to_chat(user, "\blue Attached is an empty [beaker].")
+ to_chat(user, "Attached is an empty [beaker].")
else
- to_chat(user, "\blue No chemicals are attached.")
+ to_chat(user, "No chemicals are attached.")
- to_chat(user, "\blue [attached ? attached : "No one"] is attached.")
+ to_chat(user, "[attached ? attached : "No one"] is attached.")
diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm
index 3bc2bec5ec4..08e88b9c8c9 100644
--- a/code/game/machinery/lightswitch.dm
+++ b/code/game/machinery/lightswitch.dm
@@ -39,7 +39,7 @@
src.area = locate(text2path("/area/[otherarea]"))
if(!name)
- name = "light switch ([area.name])"
+ name = "light switch([area.name])"
src.on = src.area.lightswitch
updateicon()
diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm
index 5ad3ba4a048..c0ecd475f5e 100644
--- a/code/game/machinery/machinery.dm
+++ b/code/game/machinery/machinery.dm
@@ -47,7 +47,7 @@ Class Variables:
Currently unused.
Class Procs:
- New() 'game/machinery/machine.dm'
+ initialize() 'game/machinery/machine.dm'
Destroy() 'game/machinery/machine.dm'
@@ -117,24 +117,25 @@ Class Procs:
var/use_log = list()
var/list/settagwhitelist = list()//WHITELIST OF VARIABLES THAT THE set_tag HREF CAN MODIFY, DON'T PUT SHIT YOU DON'T NEED ON HERE, AND IF YOU'RE GONNA USE set_tag (format_tag() proc), ADD TO THIS LIST.
-/obj/machinery/New()
+/obj/machinery/initialize()
addAtProcessing()
- return ..()
+ . = ..()
+ power_change()
/obj/machinery/proc/addAtProcessing()
- if (use_power)
+ if(use_power)
myArea = get_area_master(src)
machines += src
/obj/machinery/proc/removeAtProcessing()
- if (myArea)
+ if(myArea)
myArea = null
machines -= src
/obj/machinery/Destroy()
- if (src in machines)
+ if(src in machines)
removeAtProcessing()
return ..()
@@ -158,11 +159,11 @@ Class Procs:
qdel(src)
return
if(2.0)
- if (prob(50))
+ if(prob(50))
qdel(src)
return
if(3.0)
- if (prob(25))
+ if(prob(25))
qdel(src)
return
else
@@ -232,7 +233,7 @@ Class Procs:
if("unlink" in href_list)
var/idx = text2num(href_list["unlink"])
- if (!idx)
+ if(!idx)
return 1
var/obj/O = getLink(idx)
@@ -255,7 +256,7 @@ Class Procs:
if(!canLink(O,href_list))
to_chat(usr, "\red You can't link with that device.")
return 1
- if (isLinkedWith(O))
+ if(isLinkedWith(O))
to_chat(usr, "\red A red light flashes on \the [P]. The two devices are already linked.")
return 1
@@ -324,14 +325,13 @@ Class Procs:
////////////////////////////////////////////////////////////////////////////////////////////
-/obj/machinery/attack_ai(var/mob/user as mob)
- if(isrobot(user))
- // For some reason attack_robot doesn't work
- // This is to stop robots from using cameras to remotely control machines.
- if(user.client && user.client.eye == user)
- return src.attack_hand(user)
+/obj/machinery/attack_ai(mob/user)
+ if(isrobot(user))// For some reason attack_robot doesn't work
+ var/mob/living/silicon/robot/R = user
+ if(R.client && R.client.eye == R && !R.low_power_mode)// This is to stop robots from using cameras to remotely control machines; and from using machines when the borg has no power.
+ return attack_hand(user)
else
- return src.attack_hand(user)
+ return attack_hand(user)
/obj/machinery/attack_hand(mob/user as mob)
if(user.lying || user.stat)
@@ -341,7 +341,7 @@ Class Procs:
to_chat(user, "You don't have the dexterity to do this!")
return 1
- if (ishuman(user))
+ if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.getBrainLoss() >= 60)
visible_message("[H] stares cluelessly at [src] and drools.")
@@ -361,9 +361,9 @@ Class Procs:
return ..()
-/obj/machinery/CheckParts()
+/obj/machinery/CheckParts(list/parts_list)
+ ..()
RefreshParts()
- return
/obj/machinery/proc/RefreshParts() //Placeholder proc for machines that are built using frames.
return
@@ -420,10 +420,10 @@ Class Procs:
/obj/machinery/proc/state(var/msg)
for(var/mob/O in hearers(src, null))
- O.show_message("\icon[src] [msg]", 2)
+ O.show_message("[bicon(src)] [msg]", 2)
/obj/machinery/proc/ping(text=null)
- if (!text)
+ if(!text)
text = "\The [src] pings."
state(text, "blue")
@@ -465,7 +465,7 @@ Class Procs:
/obj/machinery/proc/display_parts(mob/user)
to_chat(user, "Following parts detected in the machine:")
for(var/obj/item/C in component_parts)
- to_chat(user, "\icon[C] [C.name]")
+ to_chat(user, "[bicon(C)] [C.name]")
/obj/machinery/examine(mob/user)
..(user)
@@ -547,7 +547,7 @@ Class Procs:
var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
- if (electrocute_mob(user, get_area(src), src, 0.7))
+ if(electrocute_mob(user, get_area(src), src, 0.7))
if(user.stunned)
return 1
return 0
diff --git a/code/game/machinery/mass_driver.dm b/code/game/machinery/mass_driver.dm
index 0bd5fff9fba..7953f738a40 100644
--- a/code/game/machinery/mass_driver.dm
+++ b/code/game/machinery/mass_driver.dm
@@ -211,7 +211,7 @@
set name = "Rotate Frame"
set src in view(1)
- if ( usr.stat || usr.restrained() || (usr.status_flags & FAKEDEATH))
+ if( usr.stat || usr.restrained() || (usr.status_flags & FAKEDEATH))
return
src.dir = turn(src.dir, -90)
diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm
index 79579e1bb66..5b6cfb5e73d 100644
--- a/code/game/machinery/navbeacon.dm
+++ b/code/game/machinery/navbeacon.dm
@@ -86,9 +86,9 @@
updateicon()
- else if (istype(I, /obj/item/weapon/card/id)||istype(I, /obj/item/device/pda))
+ else if(istype(I, /obj/item/weapon/card/id)||istype(I, /obj/item/device/pda))
if(open)
- if (src.allowed(user))
+ if(src.allowed(user))
src.locked = !src.locked
to_chat(user, "Controls are now [src.locked ? "locked" : "unlocked"].")
else
diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm
index d991e7c5235..3a6ef2dbd81 100644
--- a/code/game/machinery/newscaster.dm
+++ b/code/game/machinery/newscaster.dm
@@ -12,6 +12,7 @@
var/is_admin_message = 0
var/icon/img = null
var/icon/backup_img
+ var/view_count = 0
/datum/feed_channel
var/channel_name=""
@@ -22,6 +23,7 @@
var/backup_author=""
var/censored=0
var/is_admin_channel=0
+ var/total_view_count = 0
//var/page = null //For newspapers
/datum/feed_message/proc/clear()
@@ -31,6 +33,7 @@
src.backup_author = ""
src.img = null
src.backup_img = null
+ view_count = 0
/datum/feed_channel/proc/clear()
src.channel_name = ""
@@ -40,6 +43,7 @@
src.backup_author = ""
src.censored = 0
src.is_admin_channel = 0
+ total_view_count = 0
/datum/feed_channel/proc/announce_news()
return "Breaking news from [channel_name]!"
@@ -98,6 +102,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
var/c_locked=0; //Will our new channel be locked to public submissions?
var/hitstaken = 0 //Death at 3 hits from an item with force>=15
var/datum/feed_channel/viewing_channel = null
+ var/silence = 0
light_range = 0
anchored = 1
@@ -199,8 +204,12 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
dat+= {" Create Feed Channel View Feed Channels Submit new Feed story
- Print newspaper
- Re-scan User
+ Print newspaper"}
+ if(!silence)
+ dat+= " Silence unit"
+ else
+ dat+= " Unsilence unit"
+ dat+= {" Re-scan User
Exit"}
if(src.securityCaster)
var/wanted_already = 0
@@ -219,7 +228,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
else
for(var/datum/feed_channel/CHANNEL in news_network.network_channels)
if(CHANNEL.is_admin_channel)
- dat+="[CHANNEL.channel_name] "
+ dat+="[CHANNEL.channel_name] "
else
dat+="[CHANNEL.channel_name] [(CHANNEL.censored) ? ("***") : ()] "
/*for(var/datum/feed_channel/CHANNEL in src.channel_list)
@@ -254,11 +263,11 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
if(6)
dat+="ERROR: Could not submit Feed story to Network. "
if(src.channel_name=="")
- dat+="•Invalid receiving channel name. "
+ dat+="Invalid receiving channel name. "
if(src.scanned_user=="Unknown")
- dat+="•Channel author unverified. "
+ dat+="Channel author unverified. "
if(src.msg == "" || src.msg == "\[REDACTED\]")
- dat+="•Invalid message body. "
+ dat+="Invalid message body. "
dat+=" Return "
if(7)
@@ -272,18 +281,18 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
else
existing_authors += FC.author
if(src.scanned_user in existing_authors)
- dat+="•There already exists a Feed channel under your name. "
+ dat+="There already exists a Feed channel under your name. "
if(src.channel_name=="" || src.channel_name == "\[REDACTED\]")
- dat+="•Invalid channel name. "
+ dat+="Invalid channel name. "
var/check = 0
for(var/datum/feed_channel/FC in news_network.network_channels)
if(FC.channel_name == src.channel_name)
check = 1
break
if(check)
- dat+="•Channel name already in use. "
+ dat+="Channel name already in use. "
if(src.scanned_user=="Unknown")
- dat+="•Channel author unverified. "
+ dat+="Channel author unverified. "
dat+=" Return "
if(8)
var/total_num=length(news_network.network_channels)
@@ -299,7 +308,9 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
dat+="
Print Paper"
dat+=" Cancel"
if(9)
- dat+="[src.viewing_channel.channel_name]: \[created by: [src.viewing_channel.author]\]"
+ dat+="[src.viewing_channel.channel_name]: \[created by: [src.viewing_channel.author]\] "
+ dat+="Feed view count: [viewing_channel.total_view_count]"
+ viewing_channel.total_view_count++
if(src.viewing_channel.censored)
dat+="ATTENTION: This channel has been deemed as threatening to the welfare of the station, and marked with a Nanotrasen D-Notice. "
dat+="No further feed story additions are allowed while the D-Notice is in effect.
"
@@ -315,6 +326,8 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
usr << browse_rsc(MESSAGE.img, "tmp_photo[i].png")
dat+="
"
dat+="\[[MESSAGE.message_type] by [MESSAGE.author]\] "
+ dat+="Message view count: [MESSAGE.view_count] "
+ MESSAGE.view_count++
dat+=" Refresh"
dat+=" Back"
if(10)
@@ -394,11 +407,11 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
if(16)
dat+="ERROR: Wanted Issue rejected by Network. "
if(src.channel_name=="" || src.channel_name == "\[REDACTED\]")
- dat+="•Invalid name for person wanted. "
+ dat+="Invalid name for person wanted. "
if(src.scanned_user=="Unknown")
- dat+="•Issue author unverified. "
+ dat+="Issue author unverified. "
if(src.msg == "" || src.msg == "\[REDACTED\]")
- dat+="•Invalid description. "
+ dat+="Invalid description. "
dat+=" Return "
if(17)
dat+="Wanted Issue successfully deleted from Circulation "
@@ -427,7 +440,9 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
dat+="I'm sorry to break your immersion. This shit's bugged. Report this bug to Agouri, polyxenitopalidou@gmail.com"
- human_or_robot_user << browse(dat, "window=newscaster_main;size=400x600")
+ var/datum/browser/popup = new(user, "newscaster_main", name, 400, 600)
+ popup.set_content(dat)
+ popup.open(0)
onclose(human_or_robot_user, "newscaster_main")
/*if(src.isbroken) //debugging shit
@@ -441,11 +456,11 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
/obj/machinery/newscaster/Topic(href, href_list)
if(..())
return 1
-
+
usr.set_machine(src)
if(href_list["set_channel_name"])
src.channel_name = sanitizeSQL(strip_html_simple(input(usr, "Provide a Feed Channel Name", "Network Channel Handler", "")))
- while (findtext(src.channel_name," ") == 1)
+ while(findtext(src.channel_name," ") == 1)
src.channel_name = copytext(src.channel_name,2,lentext(src.channel_name)+1)
src.updateUsrDialog()
//src.update_icon()
@@ -497,7 +512,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
else if(href_list["set_new_message"])
src.msg = strip_html(input(usr, "Write your feed story", "Network Channel Handler", ""))
- while (findtext(src.msg," ") == 1)
+ while(findtext(src.msg," ") == 1)
src.msg = copytext(src.msg,2,lentext(src.msg)+1)
src.updateUsrDialog()
@@ -546,6 +561,14 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
src.screen = 20
src.updateUsrDialog()
+ else if(href_list["silence_unit"])
+ silence=1
+ updateUsrDialog()
+
+ else if(href_list["unsilence_unit"])
+ silence=0
+ updateUsrDialog()
+
else if(href_list["menu_censor_story"])
src.screen=10
src.updateUsrDialog()
@@ -567,13 +590,13 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
else if(href_list["set_wanted_name"])
src.channel_name = strip_html(input(usr, "Provide the name of the Wanted person", "Network Security Handler", ""))
- while (findtext(src.channel_name," ") == 1)
+ while(findtext(src.channel_name," ") == 1)
src.channel_name = copytext(src.channel_name,2,lentext(src.channel_name)+1)
src.updateUsrDialog()
else if(href_list["set_wanted_desc"])
src.msg = strip_html(input(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", ""))
- while (findtext(src.msg," ") == 1)
+ while(findtext(src.msg," ") == 1)
src.msg = copytext(src.msg,2,lentext(src.msg)+1)
src.updateUsrDialog()
@@ -685,7 +708,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
else if(href_list["setScreen"]) //Brings us to the main menu and resets all fields~
src.screen = text2num(href_list["setScreen"])
- if (src.screen == 0)
+ if(src.screen == 0)
src.scanned_user = "Unknown";
msg = "";
src.c_locked=0;
@@ -718,7 +741,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
qdel(src)
return
- if (isbroken)
+ if(isbroken)
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 100, 1)
visible_message("[user.name] further abuses the shattered [src.name].", null, 5 )
else
@@ -759,7 +782,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
if(!camera)
return
var/datum/picture/selection = camera.selectpicture()
- if (!selection)
+ if(!selection)
return
var/obj/item/weapon/photo/P = new/obj/item/weapon/photo()
@@ -794,7 +817,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
switch(screen)
if(0) //Cover
dat+="
"
@@ -869,7 +892,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
obj/item/weapon/newspaper/Topic(href, href_list)
var/mob/living/U = usr
..()
- if ((src in U.contents) || ( istype(loc, /turf) && in_range(src, U) ))
+ if((src in U.contents) || ( istype(loc, /turf) && in_range(src, U) ))
U.set_machine(src)
if(href_list["next_page"])
if(curr_page==src.pages+1)
@@ -894,7 +917,7 @@ obj/item/weapon/newspaper/Topic(href, href_list)
src.curr_page--
playsound(src.loc, "pageturn", 50, 1)
- if (istype(src.loc, /mob))
+ if(istype(src.loc, /mob))
src.attack_self(src.loc)
@@ -905,9 +928,9 @@ obj/item/weapon/newspaper/attackby(obj/item/weapon/W as obj, mob/user as mob, pa
else
var/s = strip_html( input(user, "Write something", "Newspaper", "") )
s = sanitize(copytext(s, 1, MAX_MESSAGE_LEN))
- if (!s)
+ if(!s)
return
- if (!in_range(src, usr) && src.loc != usr)
+ if(!in_range(src, usr) && src.loc != usr)
return
src.scribble_page = src.curr_page
src.scribble = s
@@ -958,6 +981,7 @@ obj/item/weapon/newspaper/attackby(obj/item/weapon/W as obj, mob/user as mob, pa
/obj/machinery/newscaster/proc/newsAlert(var/news_call) //This isn't Agouri's work, for it is ugly and vile.
var/turf/T = get_turf(src) //Who the fuck uses spawn(600) anyway, jesus christ
if(news_call)
+
for(var/mob/O in hearers(world.view-1, T))
O.show_message("[src.name] beeps, \"[news_call]\"",2)
src.alert = 1
@@ -965,7 +989,8 @@ obj/item/weapon/newspaper/attackby(obj/item/weapon/W as obj, mob/user as mob, pa
spawn(300)
src.alert = 0
src.update_icon()
- playsound(src.loc, 'sound/machines/twobeep.ogg', 75, 1)
+ if(!silence)
+ playsound(src.loc, 'sound/machines/twobeep.ogg', 75, 1)
else
for(var/mob/O in hearers(world.view-1, T))
O.show_message("[src.name] beeps, \"Attention! Wanted issue distributed!\"",2)
diff --git a/code/game/machinery/overview.dm b/code/game/machinery/overview.dm
index 2b56b71fc43..734bb09f60b 100644
--- a/code/game/machinery/overview.dm
+++ b/code/game/machinery/overview.dm
@@ -151,7 +151,7 @@
var/icon/I2 = imap[2+(ix + icx*iy)*2]
-// to_chat(world, "icon: \icon[I]")
+// to_chat(world, "icon: [bicon(I)]")
I.DrawBox(colour, rx, ry, rx+1, ry+1)
@@ -168,7 +168,7 @@
H.screen_loc = "[5 + i%icx],[6+ round(i/icx)]"
-// to_chat(world, "\icon[I] at [H.screen_loc]")
+// to_chat(world, "[bicon(I)] at [H.screen_loc]")
H.name = (i==0)?"maprefresh":"map"
@@ -184,6 +184,7 @@
qdel(J)
H.icon = HI
H.layer = 25
+ H.plane = HUD_PLANE
usr.mapobjs += H
#else
@@ -284,7 +285,7 @@
var/icon/I = imap[1+(ix + icx*iy)]
-// to_chat(world, "icon: \icon[I]")
+// to_chat(world, "icon: [bicon(I)]")
I.DrawBox(colour, rx, ry, rx, ry)
@@ -299,7 +300,7 @@
H.screen_loc = "[5 + i%icx],[6+ round(i/icx)]"
-// to_chat(world, "\icon[I] at [H.screen_loc]")
+// to_chat(world, "[bicon(I)] at [H.screen_loc]")
H.name = (i==0)?"maprefresh":"map"
@@ -308,6 +309,7 @@
H.icon = I
qdel(I)
H.layer = 25
+ H.plane = HUD_PLANE
usr.mapobjs += H
#endif
diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm
index ad54eb2e8e9..afe79ca48e3 100644
--- a/code/game/machinery/pipe/construction.dm
+++ b/code/game/machinery/pipe/construction.dm
@@ -54,16 +54,16 @@
/obj/item/pipe/New(loc, pipe_type, dir, obj/machinery/atmospherics/make_from)
..()
- if (make_from)
+ if(make_from)
src.dir = make_from.dir
src.pipename = make_from.name
color = make_from.pipe_color
var/is_bent
- if (make_from.initialize_directions in list(NORTH|SOUTH, WEST|EAST))
+ if(make_from.initialize_directions in list(NORTH|SOUTH, WEST|EAST))
is_bent = 0
else
is_bent = 1
- if (istype(make_from, /obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction))
+ if(istype(make_from, /obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction))
src.pipe_type = PIPE_JUNCTION
else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple/heat_exchanging))
src.pipe_type = PIPE_HE_STRAIGHT + is_bent
@@ -158,13 +158,13 @@
else
src.pipe_type = pipe_type
src.dir = dir
- if (pipe_type == PIPE_SUPPLY_STRAIGHT || pipe_type == PIPE_SUPPLY_BENT || pipe_type == PIPE_SUPPLY_MANIFOLD || pipe_type == PIPE_SUPPLY_MANIFOLD4W || pipe_type == PIPE_SUPPLY_CAP)
+ if(pipe_type == PIPE_SUPPLY_STRAIGHT || pipe_type == PIPE_SUPPLY_BENT || pipe_type == PIPE_SUPPLY_MANIFOLD || pipe_type == PIPE_SUPPLY_MANIFOLD4W || pipe_type == PIPE_SUPPLY_CAP)
connect_types = list(2)
src.color = PIPE_COLOR_BLUE
- else if (pipe_type == PIPE_SCRUBBERS_STRAIGHT || pipe_type == PIPE_SCRUBBERS_BENT || pipe_type == PIPE_SCRUBBERS_MANIFOLD || pipe_type == PIPE_SCRUBBERS_MANIFOLD4W || pipe_type == PIPE_SCRUBBERS_CAP)
+ else if(pipe_type == PIPE_SCRUBBERS_STRAIGHT || pipe_type == PIPE_SCRUBBERS_BENT || pipe_type == PIPE_SCRUBBERS_MANIFOLD || pipe_type == PIPE_SCRUBBERS_MANIFOLD4W || pipe_type == PIPE_SCRUBBERS_CAP)
connect_types = list(3)
src.color = PIPE_COLOR_RED
- else if (pipe_type == PIPE_UNIVERSAL)
+ else if(pipe_type == PIPE_UNIVERSAL)
connect_types = list(1,2,3)
update(make_from)
@@ -278,7 +278,7 @@
set name = "Rotate Pipe"
set src in view(1)
- if ( usr.stat || usr.restrained() )
+ if( usr.stat || usr.restrained() )
return
src.dir = turn(src.dir, -90)
@@ -292,10 +292,10 @@
set name = "Flip Pipe"
set src in view(1)
- if (usr.stat || usr.restrained())
+ if(usr.stat || usr.restrained())
return
- if (pipe_type in list(PIPE_GAS_FILTER, PIPE_GAS_MIXER, PIPE_TVALVE, PIPE_DTVALVE))
+ if(pipe_type in list(PIPE_GAS_FILTER, PIPE_GAS_MIXER, PIPE_TVALVE, PIPE_DTVALVE))
if(flipped)
icon_state = copytext(icon_state,3)
else
@@ -311,10 +311,10 @@
/obj/item/pipe/Move()
..()
- if (is_bent_pipe() \
+ if(is_bent_pipe() \
&& (src.dir in cardinal))
src.dir = src.dir|turn(src.dir, 90)
- else if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_UNIVERSAL, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE, PIPE_DVALVE))
+ else if(pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_UNIVERSAL, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE, PIPE_DVALVE))
if(dir==2)
dir = 1
else if(dir==8)
@@ -324,7 +324,7 @@
// returns all pipe's endpoints
/obj/item/pipe/proc/get_pipe_dir()
- if (!dir)
+ if(!dir)
return 0
var/direct = dir
@@ -374,7 +374,7 @@
// var/cw = turn(dir, -90)
// var/acw = turn(dir, 90)
- if (!(pipe_type in list(PIPE_HE_STRAIGHT, PIPE_HE_BENT, PIPE_JUNCTION)))
+ if(!(pipe_type in list(PIPE_HE_STRAIGHT, PIPE_HE_BENT, PIPE_JUNCTION)))
return get_pipe_dir()
switch(pipe_type)
if(PIPE_HE_STRAIGHT,PIPE_HE_BENT)
@@ -408,12 +408,12 @@
//Helper to clean up dir
/obj/item/pipe/proc/fixdir()
- if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE, PIPE_DVALVE))
+ if(pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE, PIPE_DVALVE))
if(dir==2)
dir = 1
else if(dir==8)
dir = 4
- else if (pipe_type in list(PIPE_MANIFOLD4W, PIPE_SUPPLY_MANIFOLD4W, PIPE_SCRUBBERS_MANIFOLD4W, PIPE_OMNI_MIXER, PIPE_OMNI_FILTER))
+ else if(pipe_type in list(PIPE_MANIFOLD4W, PIPE_SUPPLY_MANIFOLD4W, PIPE_SCRUBBERS_MANIFOLD4W, PIPE_OMNI_MIXER, PIPE_OMNI_FILTER))
dir = 2
/obj/item/pipe/attack_self(mob/user as mob)
@@ -422,10 +422,10 @@
/obj/item/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params)
..()
- if (!istype(W, /obj/item/weapon/wrench))
+ if(!istype(W, /obj/item/weapon/wrench))
return ..()
- if (!isturf(src.loc))
+ if(!isturf(src.loc))
return 1
fixdir()
@@ -461,7 +461,7 @@
if(PIPE_CONNECTOR) // connector
var/obj/machinery/atmospherics/unary/portables_connector/C = new( src.loc )
- if (pipename)
+ if(pipename)
C.name = pipename
C.construction(dir, pipe_dir, color)
@@ -500,13 +500,13 @@
if(PIPE_MVALVE) //manual valve
var/obj/machinery/atmospherics/binary/valve/V = new( src.loc)
- if (pipename)
+ if(pipename)
V.name = pipename
V.construction(dir, get_pdir(), color)
if(PIPE_DVALVE)
var/obj/machinery/atmospherics/binary/valve/digital/V = new( src.loc )
- if (pipename)
+ if(pipename)
V.name = pipename
V.construction(dir, get_pdir(), color)
@@ -526,13 +526,13 @@
if(PIPE_DTVALVE)
P = new /obj/machinery/atmospherics/trinary/tvalve/digital(src.loc)
P.flipped = flipped
- if (pipename)
+ if(pipename)
P.name = pipename
P.construction(unflip(dir), pipe_dir, color)
if(PIPE_SCRUBBER) //scrubber
var/obj/machinery/atmospherics/unary/vent_scrubber/S = new(src.loc)
- if (pipename)
+ if(pipename)
S.name = pipename
S.construction(dir, pipe_dir, color)
@@ -554,37 +554,37 @@
if(PIPE_PASSIVE_GATE) //passive gate
var/obj/machinery/atmospherics/binary/passive_gate/P = new(src.loc)
- if (pipename)
+ if(pipename)
P.name = pipename
P.construction(dir, pipe_dir, color)
if(PIPE_VOLUME_PUMP) //volume pump
var/obj/machinery/atmospherics/binary/volume_pump/P = new(src.loc)
- if (pipename)
+ if(pipename)
P.name = pipename
P.construction(dir, pipe_dir, color)
if(PIPE_HEAT_EXCHANGE) // heat exchanger
var/obj/machinery/atmospherics/unary/heat_exchanger/C = new( src.loc )
- if (pipename)
+ if(pipename)
C.name = pipename
C.construction(dir, pipe_dir, color)
if(PIPE_INJECTOR) // air injector
var/obj/machinery/atmospherics/unary/outlet_injector/P = new( src.loc )
- if (pipename)
+ if(pipename)
P.name = pipename
P.construction(dir, pipe_dir, color)
if(PIPE_DP_VENT)
var/obj/machinery/atmospherics/binary/dp_vent_pump/P = new(src.loc)
- if (pipename)
+ if(pipename)
P.name = pipename
P.construction(dir, pipe_dir, color)
if(PIPE_PASV_VENT)
var/obj/machinery/atmospherics/unary/passive_vent/P = new(src.loc)
- if (pipename)
+ if(pipename)
P.name = pipename
P.construction(dir, pipe_dir, color)
@@ -616,7 +616,7 @@
/obj/item/pipe_meter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params)
..()
- if (!istype(W, /obj/item/weapon/wrench))
+ if(!istype(W, /obj/item/weapon/wrench))
return ..()
if(!locate(/obj/machinery/atmospherics/pipe, src.loc))
to_chat(user, "\red You need to fasten it to a pipe")
@@ -636,7 +636,7 @@
/obj/item/pipe_gsensor/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
..()
- if (!istype(W, /obj/item/weapon/wrench))
+ if(!istype(W, /obj/item/weapon/wrench))
return ..()
new/obj/machinery/air_sensor( src.loc )
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)
diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm
index 9214178e9e4..7a5ebc784b0 100644
--- a/code/game/machinery/pipe/pipe_dispenser.dm
+++ b/code/game/machinery/pipe/pipe_dispenser.dm
@@ -61,7 +61,9 @@
//What number the make points to is in the define # at the top of construction.dm in same folder
//which for some reason couldn't just be left defined, so it could be used here, top kek
- user << browse("[src][dat]", "window=pipedispenser")
+ var/datum/browser/popup = new(user, "pipedispenser", name, 400, 400)
+ popup.set_content(dat)
+ popup.open(0)
onclose(user, "pipedispenser")
return
@@ -99,16 +101,16 @@
/obj/machinery/pipedispenser/attackby(var/obj/item/W as obj, var/mob/user as mob, params)
src.add_fingerprint(usr)
- if (istype(W, /obj/item/pipe) || istype(W, /obj/item/pipe_meter) || istype(W, /obj/item/pipe_gsensor))
+ if(istype(W, /obj/item/pipe) || istype(W, /obj/item/pipe_meter) || istype(W, /obj/item/pipe_gsensor))
to_chat(usr, "\blue You put [W] back to [src].")
user.drop_item()
qdel(W)
return
- else if (istype(W, /obj/item/weapon/wrench))
- if (unwrenched==0)
+ else if(istype(W, /obj/item/weapon/wrench))
+ if(unwrenched==0)
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
to_chat(user, "\blue You begin to unfasten \the [src] from the floor...")
- if (do_after(user, 40, target = src))
+ if(do_after(user, 40, target = src))
user.visible_message( \
"[user] unfastens \the [src].", \
"\blue You have unfastened \the [src]. Now it can be pulled somewhere else.", \
@@ -116,12 +118,12 @@
src.anchored = 0
src.stat |= MAINT
src.unwrenched = 1
- if (usr.machine==src)
+ if(usr.machine==src)
usr << browse(null, "window=pipedispenser")
- else /*if (unwrenched==1)*/
+ else /*if(unwrenched==1)*/
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
to_chat(user, "\blue You begin to fasten \the [src] to the floor...")
- if (do_after(user, 20, target = src))
+ if(do_after(user, 20, target = src))
user.visible_message( \
"[user] fastens \the [src].", \
"\blue You have fastened \the [src]. Now it can dispense pipes.", \
@@ -155,10 +157,10 @@ Nah
if(!usr.canmove || usr.stat || usr.restrained())
return
- if (!istype(pipe) || get_dist(usr, src) > 1 || get_dist(src,pipe) > 1 )
+ if(!istype(pipe) || get_dist(usr, src) > 1 || get_dist(src,pipe) > 1 )
return
- if (pipe.anchored)
+ if(pipe.anchored)
return
qdel(pipe)
@@ -178,7 +180,9 @@ Nah
Chute
"}
- user << browse("[src][dat]", "window=pipedispenser")
+ var/datum/browser/popup = new(user, "pipedispenser", name, 400, 400)
+ popup.set_content(dat)
+ popup.open()
return
// 0=straight, 1=bent, 2=junction-j1, 3=junction-j2, 4=junction-y, 5=trunk
diff --git a/code/game/machinery/podmen.dm b/code/game/machinery/podmen.dm
index 54585c0eb26..c0ca39c3e12 100644
--- a/code/game/machinery/podmen.dm
+++ b/code/game/machinery/podmen.dm
@@ -57,7 +57,7 @@ Growing it to term with nothing injected will grab a ghost from the observers. *
to_chat(user, "Nothing happens.")
return
- if (!istype(source))
+ if(!istype(source))
return
if(source.ckey)
@@ -108,17 +108,17 @@ Growing it to term with nothing injected will grab a ghost from the observers. *
callHook("harvest_podman", list(podman))
switch(ticker.mode.name)
- if ("revolution")
- if (podman.mind in ticker.mode:revolutionaries)
+ if("revolution")
+ if(podman.mind in ticker.mode:revolutionaries)
ticker.mode:add_revolutionary(podman.mind)
ticker.mode:update_all_rev_icons() //So the icon actually appears
- if (podman.mind in ticker.mode:head_revolutionaries)
+ if(podman.mind in ticker.mode:head_revolutionaries)
ticker.mode:update_all_rev_icons()
- if ("nuclear emergency")
- if (podman.mind in ticker.mode:syndicates)
+ if("nuclear emergency")
+ if(podman.mind in ticker.mode:syndicates)
ticker.mode:update_all_synd_icons()
- if ("cult")
- if (podman.mind in ticker.mode:cult)
+ if("cult")
+ if(podman.mind in ticker.mode:cult)
ticker.mode:add_cultist(podman.mind)
ticker.mode:update_all_cult_icons() //So the icon actually appears
// -- End mode specific stuff
diff --git a/code/game/machinery/portable_tag_turret.dm b/code/game/machinery/portable_tag_turret.dm
index 963dc0c803a..deafad7f9b7 100644
--- a/code/game/machinery/portable_tag_turret.dm
+++ b/code/game/machinery/portable_tag_turret.dm
@@ -50,7 +50,7 @@
data["is_lethal"] = 0
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, "turret_control.tmpl", "Turret Controls", 500, 300)
ui.set_initial_data(data)
ui.open()
diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm
index eab12bb22d5..83f2dfef93f 100644
--- a/code/game/machinery/portable_turret.dm
+++ b/code/game/machinery/portable_turret.dm
@@ -99,13 +99,12 @@
one_access = 0
/obj/machinery/porta_turret/proc/setup()
- var/obj/item/weapon/gun/energy/E = installation //All energy-based weapons are applicable
- if(istext(installation)) E = text2path(installation)
- //var/obj/item/ammo_casing/shottype = E.projectile_type
+ var/obj/item/weapon/gun/energy/E= new installation //All energy-based weapons are applicable
+ var/obj/item/ammo_casing/shottype = E.ammo_type[1]
- projectile = initial(E.projectile_type)
+ projectile = shottype.projectile_type
eprojectile = projectile
- shot_sound = initial(E.fire_sound)
+ shot_sound = shottype.fire_sound
eshot_sound = shot_sound
weapon_setup(installation)
@@ -216,7 +215,7 @@ var/list/turret_icons
data["one_access"] = one_access
var/accesses[0]
var/list/access_list = get_all_accesses()
- for (var/access in access_list)
+ for(var/access in access_list)
var/name = get_access_desc(access)
var/active
if(one_access)
@@ -227,7 +226,7 @@ var/list/turret_icons
data["accesses"] = accesses
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, "turret_control.tmpl", "Turret Controls", 500, 320)
ui.set_initial_data(data)
ui.open()
@@ -438,7 +437,7 @@ var/list/turret_icons
return
health -= force
- if (force > 5 && prob(45))
+ if(force > 5 && prob(45))
spark_system.start()
if(health <= 0)
die() //the death process :(
@@ -480,15 +479,15 @@ var/list/turret_icons
..()
/obj/machinery/porta_turret/ex_act(severity)
- switch (severity)
- if (1)
+ switch(severity)
+ if(1)
qdel(src)
- if (2)
- if (prob(25))
+ if(2)
+ if(prob(25))
qdel(src)
else
take_damage(initial(health) * 8) //should instakill most turrets
- if (3)
+ if(3)
take_damage(initial(health) * 8 / 3)
/obj/machinery/porta_turret/proc/die() //called when the turret dies, ie, health <= 0
@@ -561,9 +560,6 @@ var/list/turret_icons
if(get_dist(src, L) > 7) //if it's too far away, why bother?
return TURRET_NOT_TARGET
- if(!check_trajectory(L, src)) //check if we have true line of sight
- return TURRET_NOT_TARGET
-
if(emagged) // If emagged not even the dead get a rest
return L.stat ? TURRET_SECONDARY_TARGET : TURRET_PRIORITY_TARGET
@@ -670,6 +666,8 @@ var/list/turret_icons
return
/obj/machinery/porta_turret/proc/shootAt(var/mob/living/target)
+ if(!raised) //the turret has to be raised in order to fire - makes sense, right?
+ return
//any emagged turrets will shoot extremely fast! This not only is deadly, but drains a lot power!
if(!emagged) //if it hasn't been emagged, it has to obey a cooldown rate
if(last_fired || !raised) //prevents rapid-fire shooting, unless it's been emagged
@@ -684,10 +682,6 @@ var/list/turret_icons
if(!istype(T) || !istype(U))
return
- if(!raised) //the turret has to be raised in order to fire - makes sense, right?
- return
-
-
update_icon()
var/obj/item/projectile/A
if(emagged || lethal)
@@ -698,18 +692,17 @@ var/list/turret_icons
if(projectile)
A = new projectile(loc)
playsound(loc, shot_sound, 75, 1)
- A.original = target
// Lethal/emagged turrets use twice the power due to higher energy beams
// Emagged turrets again use twice as much power due to higher firing rates
use_power(reqpower * (2 * (emagged || lethal)) * (2 * emagged))
- //Shooting Code:
+ A.original = target
A.current = T
A.yo = U.y - T.y
A.xo = U.x - T.x
- spawn(1)
- A.process()
+ A.fire()
+ return A
/datum/turret_checks
var/enabled
diff --git a/code/game/machinery/programmable_unloader.dm b/code/game/machinery/programmable_unloader.dm
index f061f9906e6..a095d1cc93c 100644
--- a/code/game/machinery/programmable_unloader.dm
+++ b/code/game/machinery/programmable_unloader.dm
@@ -197,10 +197,10 @@
/obj/machinery/programmable/attackby(obj/item/I as obj, mob/user as mob, params)
if(istype(I,/obj/item/weapon/wrench)) // code borrowed from pipe dispenser
- if (unwrenched==0)
+ if(unwrenched==0)
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
to_chat(user, "\blue You begin to unfasten \the [src] from the floor...")
- if (do_after(user, 40, target = src))
+ if(do_after(user, 40, target = src))
user.visible_message( \
"[user] unfastens \the [src].", \
"\blue You have unfastened \the [src]. Now it can be pulled somewhere else.", \
@@ -208,12 +208,12 @@
src.anchored = 0
src.stat |= MAINT
src.unwrenched = 1
- if (usr.machine==src)
+ if(usr.machine==src)
usr << browse(null, "window=pipedispenser")
else /* unwrenched */
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
to_chat(user, "\blue You begin to fasten \the [src] to the floor...")
- if (do_after(user, 20, target = src))
+ if(do_after(user, 20, target = src))
user.visible_message( \
"[user] fastens \the [src].", \
"\blue You fastened \the [src] into place.", \
@@ -283,7 +283,7 @@
return
/obj/machinery/programmable/process()
- if (!output || !input)
+ if(!output || !input)
return
if(!on || stat || sleep)
@@ -330,7 +330,7 @@
if(sleep)
return // something stopped the machine
- for (var/obj/A in input.contents)// I fully expect this to cause unreasonable lag
+ for(var/obj/A in input.contents)// I fully expect this to cause unreasonable lag
if(!A)
break
if(work > workmax)
diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm
index be126aec5ff..6db7199a7f0 100644
--- a/code/game/machinery/recharger.dm
+++ b/code/game/machinery/recharger.dm
@@ -34,7 +34,7 @@
to_chat(user, "\red The [name] blinks red as you try to insert the item!")
return
- if (istype(G, /obj/item/weapon/gun/energy))
+ if(istype(G, /obj/item/weapon/gun/energy))
var/obj/item/weapon/gun/energy/E = G
if(!E.can_charge)
to_chat(user, "Your gun has no external power connector.")
diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm
index 92bca16c5b7..342b24fa055 100644
--- a/code/game/machinery/rechargestation.dm
+++ b/code/game/machinery/rechargestation.dm
@@ -71,14 +71,14 @@
qdel(src)
return
if(2.0)
- if (prob(50))
+ if(prob(50))
for(var/atom/movable/A as mob|obj in src)
A.forceMove(src.loc)
A.ex_act(severity)
qdel(src)
return
if(3.0)
- if (prob(25))
+ if(prob(25))
for(var/atom/movable/A as mob|obj in src)
A.forceMove(src.loc)
A.ex_act(severity)
@@ -131,7 +131,7 @@
icon_state = "borgcharger0"
/obj/machinery/recharge_station/attackby(obj/item/P as obj, mob/user as mob, params)
- if (istype(P, /obj/item/weapon/screwdriver))
+ if(istype(P, /obj/item/weapon/screwdriver))
if(src.occupant)
to_chat(user, "The maintenance panel is locked.")
return
@@ -145,7 +145,7 @@
/obj/machinery/recharge_station/proc/process_occupant()
if(src.occupant)
- if (istype(occupant, /mob/living/silicon/robot))
+ if(istype(occupant, /mob/living/silicon/robot))
var/mob/living/silicon/robot/R = occupant
restock_modules()
if(repairs)
@@ -170,7 +170,7 @@
return
//for(var/obj/O in src)
// O.loc = src.loc
- if (src.occupant.client)
+ if(src.occupant.client)
src.occupant.client.eye = src.occupant.client.mob
src.occupant.client.perspective = MOB_PERSPECTIVE
src.occupant.loc = src.loc
@@ -203,7 +203,8 @@
if(istype(O,/obj/item/weapon/gun/energy/disabler/cyborg))
var/obj/item/weapon/gun/energy/disabler/cyborg/D = O
if(D.power_supply.charge < D.power_supply.maxcharge)
- D.power_supply.give(D.charge_cost)
+ var/obj/item/ammo_casing/energy/E = D.ammo_type[D.select]
+ D.power_supply.give(E.e_cost)
D.update_icon()
else
D.charge_tick = 0
@@ -215,17 +216,15 @@
if(istype(O,/obj/item/weapon/reagent_containers/food/condiment/enzyme))
if(O.reagents.get_reagent_amount("enzyme") < 50)
O.reagents.add_reagent("enzyme", 2 * coeff)
- //Medical
- if(istype(O,/obj/item/weapon/reagent_containers/glass/bottle/robot))
- var/obj/item/weapon/reagent_containers/glass/bottle/robot/B = O
- if(B.reagent && (B.reagents.get_reagent_amount(B.reagent) < B.volume))
- B.reagents.add_reagent(B.reagent, 2 * coeff)
//Janitor
if(istype(O, /obj/item/device/lightreplacer))
var/obj/item/device/lightreplacer/LR = O
var/i = 1
for(1, i <= coeff, i++)
LR.Charge(occupant)
+ if(istype(O,/obj/item/weapon/mop/advanced))
+ if(O.reagents.get_reagent_amount("water") < 40)
+ O.reagents.add_reagent("water", 0.5 * coeff)
if(R)
if(R.module)
R.module.respawn_consumable(R)
@@ -245,7 +244,7 @@
/obj/machinery/recharge_station/verb/move_eject()
set category = "Object"
set src in oview(1)
- if (usr.stat != 0)
+ if(usr.stat != 0)
return
src.go_out()
add_fingerprint(usr)
@@ -257,14 +256,14 @@
if(!user || !usr)
return
- if (usr.stat != CONSCIOUS)
+ if(usr.stat != CONSCIOUS)
return
if(get_dist(src, user) > 2 || get_dist(usr, user) > 1)
to_chat(usr, "They are too far away to put inside")
return
- if (panel_open)
+ if(panel_open)
to_chat(usr, "Close the maintenance panel first.")
return
diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm
index 9bcf3de53a8..c7ddfc84c38 100644
--- a/code/game/machinery/recycler.dm
+++ b/code/game/machinery/recycler.dm
@@ -129,7 +129,7 @@ var/const/SAFETY_COOLDOWN = 100
return
if(sound)
- playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
+ playsound(src.loc, 'sound/machines/recycler.ogg', 100, 0)
var/material_amount = materials.get_item_material_amount(I)
if(!material_amount)
qdel(I)
@@ -155,7 +155,7 @@ var/const/SAFETY_COOLDOWN = 100
L.loc = src.loc
if(issilicon(L))
- playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
+ playsound(src.loc, 'sound/machines/recycler.ogg', 100, 0)
else
playsound(src.loc, 'sound/effects/splat.ogg', 50, 1)
@@ -194,7 +194,7 @@ var/const/SAFETY_COOLDOWN = 100
if(usr.stat || !usr.canmove || usr.restrained())
return
- if (src.anchored)
+ if(src.anchored)
to_chat(usr, "[src] is fastened to the floor!")
return 0
eat_dir = turn(eat_dir, 270)
@@ -210,7 +210,7 @@ var/const/SAFETY_COOLDOWN = 100
if(usr.stat || !usr.canmove || usr.restrained())
return
- if (src.anchored)
+ if(src.anchored)
to_chat(usr, "[src] is fastened to the floor!")
return 0
eat_dir = turn(eat_dir, 90)
@@ -219,4 +219,4 @@ var/const/SAFETY_COOLDOWN = 100
/obj/item/weapon/paper/recycler
name = "paper - 'garbage duty instructions'"
- info = "
New Assignment
You have been assigned to collect garbage from trash bins, located around the station. The crewmembers will put their trash into it and you will collect the said trash.
There is a recycling machine near your closet, inside maintenance; use it to recycle the trash for a small chance to get useful minerals. Then deliver these minerals to cargo or engineering. You are our last hope for a clean station, do not screw this up!"
\ No newline at end of file
+ info = "
New Assignment
You have been assigned to collect garbage from trash bins, located around the station. The crewmembers will put their trash into it and you will collect the said trash.
There is a recycling machine near your closet, inside maintenance; use it to recycle the trash for a small chance to get useful minerals. Then deliver these minerals to cargo or engineering. You are our last hope for a clean station, do not screw this up!"
diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm
index bfd4939dc3b..9b2515e8914 100644
--- a/code/game/machinery/requests_console.dm
+++ b/code/game/machinery/requests_console.dm
@@ -72,11 +72,11 @@ var/list/obj/machinery/requests_console/allConsoles = list()
name = "[department] Requests Console"
allConsoles += src
- if (departmentType & RC_ASSIST)
+ if(departmentType & RC_ASSIST)
req_console_assistance |= department
- if (departmentType & RC_SUPPLY)
+ if(departmentType & RC_SUPPLY)
req_console_supplies |= department
- if (departmentType & RC_INFO)
+ if(departmentType & RC_INFO)
req_console_information |= department
set_light(1)
@@ -84,16 +84,16 @@ var/list/obj/machinery/requests_console/allConsoles = list()
/obj/machinery/requests_console/Destroy()
allConsoles -= src
var/lastDeptRC = 1
- for (var/obj/machinery/requests_console/Console in allConsoles)
- if (Console.department == department)
+ for(var/obj/machinery/requests_console/Console in allConsoles)
+ if(Console.department == department)
lastDeptRC = 0
break
if(lastDeptRC)
- if (departmentType & RC_ASSIST)
+ if(departmentType & RC_ASSIST)
req_console_assistance -= department
- if (departmentType & RC_SUPPLY)
+ if(departmentType & RC_SUPPLY)
req_console_supplies -= department
- if (departmentType & RC_INFO)
+ if(departmentType & RC_INFO)
req_console_information -= department
return ..()
@@ -130,7 +130,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
data["announceAuth"] = announceAuth
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, "request_console.tmpl", "[department] Request Console", 520, 410)
ui.set_initial_data(data)
ui.open()
@@ -172,7 +172,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
var/log_msg = message
var/pass = 0
screen = RCS_SENTFAIL
- for (var/obj/machinery/message_server/MS in world)
+ for(var/obj/machinery/message_server/MS in world)
if(!MS.active) continue
MS.send_rc_message(ckey(href_list["department"]),department,log_msg,msgStamped,msgVerified,priority)
pass = 1
@@ -180,7 +180,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
screen = RCS_SENTPASS
message_log += "Message sent to [recipient] [message]"
else
- audible_message(text("\icon[src] *The Requests Console beeps: 'NOTICE: No server detected!'"),,4)
+ audible_message(text("[bicon(src)] *The Requests Console beeps: 'NOTICE: No server detected!'"),,4)
//Handle screen switching
if(href_list["setScreen"])
@@ -188,8 +188,8 @@ var/list/obj/machinery/requests_console/allConsoles = list()
if(tempScreen == RCS_ANNOUNCE && !announcementConsole)
return
if(tempScreen == RCS_VIEWMSGS)
- for (var/obj/machinery/requests_console/Console in allConsoles)
- if (Console.department == department)
+ for(var/obj/machinery/requests_console/Console in allConsoles)
+ if(Console.department == department)
Console.newmessagepriority = 0
Console.icon_state = "req_comp0"
Console.set_light(1)
@@ -207,7 +207,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
//err... hacking code, which has no reason for existing... but anyway... it was once supposed to unlock priority 3 messanging on that console (EXTREME priority...), but the code for that was removed.
/obj/machinery/requests_console/attackby(var/obj/item/weapon/O as obj, var/mob/user as mob)
/*
- if (istype(O, /obj/item/weapon/crowbar))
+ if(istype(O, /obj/item/weapon/crowbar))
if(open)
open = 0
icon_state="req_comp0"
@@ -217,7 +217,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
icon_state="req_comp_open"
else if(hackState == 1)
icon_state="req_comp_rewired"
- if (istype(O, /obj/item/weapon/screwdriver))
+ if(istype(O, /obj/item/weapon/screwdriver))
if(open)
if(hackState == 0)
hackState = 1
@@ -228,7 +228,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
else
to_chat(user, "You can't do much with that.")*/
- if (istype(O, /obj/item/weapon/card/id))
+ if(istype(O, /obj/item/weapon/card/id))
if(inoperable(MAINT)) return
if(screen == RCS_MESSAUTH)
var/obj/item/weapon/card/id/T = O
@@ -236,14 +236,14 @@ var/list/obj/machinery/requests_console/allConsoles = list()
updateUsrDialog()
if(screen == RCS_ANNOUNCE)
var/obj/item/weapon/card/id/ID = O
- if (access_RC_announce in ID.GetAccess())
+ if(access_RC_announce in ID.GetAccess())
announceAuth = 1
announcement.announcer = ID.assignment ? "[ID.assignment] [ID.registered_name]" : ID.registered_name
else
reset_message()
to_chat(user, "You are not authorized to send announcements.")
updateUsrDialog()
- if (istype(O, /obj/item/weapon/stamp))
+ if(istype(O, /obj/item/weapon/stamp))
if(inoperable(MAINT)) return
if(screen == RCS_MESSAUTH)
var/obj/item/weapon/stamp/T = O
diff --git a/code/game/machinery/robot_fabricator.dm b/code/game/machinery/robot_fabricator.dm
index 44455884bd8..78b873e6ca1 100644
--- a/code/game/machinery/robot_fabricator.dm
+++ b/code/game/machinery/robot_fabricator.dm
@@ -12,8 +12,8 @@
active_power_usage = 5000
/obj/machinery/robotic_fabricator/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
- if (istype(O, /obj/item/stack/sheet/metal))
- if (src.metal_amount < 150000.0)
+ if(istype(O, /obj/item/stack/sheet/metal))
+ if(src.metal_amount < 150000.0)
var/count = 0
src.overlays += "fab-load-metal"
spawn(15)
@@ -25,7 +25,7 @@
O:amount--
count++
- if (O:amount < 1)
+ if(O:amount < 1)
qdel(O)
to_chat(user, "You insert [count] metal sheet\s into the fabricator.")
@@ -35,17 +35,17 @@
to_chat(user, "The robot part maker is full. Please remove metal from the robot part maker in order to insert more.")
/obj/machinery/robotic_fabricator/power_change()
- if (powered())
+ if(powered())
stat &= ~NOPOWER
else
stat |= NOPOWER
/obj/machinery/robotic_fabricator/attack_hand(user as mob)
var/dat
- if (..())
+ if(..())
return
- if (src.operating)
+ if(src.operating)
dat = {"
Building [src.being_built.name].
Please wait until completion...
@@ -69,59 +69,59 @@ Please wait until completion...
return
/obj/machinery/robotic_fabricator/Topic(href, href_list)
- if (..())
+ if(..())
return
usr.set_machine(src)
src.add_fingerprint(usr)
- if (href_list["make"])
- if (!src.operating)
+ if(href_list["make"])
+ if(!src.operating)
var/part_type = text2num(href_list["make"])
var/build_type = ""
var/build_time = 200
var/build_cost = 25000
- switch (part_type)
- if (1)
+ switch(part_type)
+ if(1)
build_type = "/obj/item/robot_parts/l_arm"
build_time = 200
build_cost = 10000
- if (2)
+ if(2)
build_type = "/obj/item/robot_parts/r_arm"
build_time = 200
build_cost = 10000
- if (3)
+ if(3)
build_type = "/obj/item/robot_parts/l_leg"
build_time = 200
build_cost = 10000
- if (4)
+ if(4)
build_type = "/obj/item/robot_parts/r_leg"
build_time = 200
build_cost = 10000
- if (5)
+ if(5)
build_type = "/obj/item/robot_parts/chest"
build_time = 350
build_cost = 40000
- if (6)
+ if(6)
build_type = "/obj/item/robot_parts/head"
build_time = 350
build_cost = 5000
- if (7)
+ if(7)
build_type = "/obj/item/robot_parts/robot_suit"
build_time = 600
build_cost = 15000
var/building = text2path(build_type)
- if (!isnull(building))
- if (src.metal_amount >= build_cost)
+ if(!isnull(building))
+ if(src.metal_amount >= build_cost)
src.operating = 1
src.use_power = 2
@@ -133,7 +133,7 @@ Please wait until completion...
src.updateUsrDialog()
spawn (build_time)
- if (!isnull(src.being_built))
+ if(!isnull(src.being_built))
src.being_built.loc = get_turf(src)
src.being_built = null
src.use_power = 1
@@ -141,6 +141,6 @@ Please wait until completion...
src.overlays -= "fab-active"
return
- for (var/mob/M in viewers(1, src))
- if (M.client && M.machine == src)
+ for(var/mob/M in viewers(1, src))
+ if(M.client && M.machine == src)
src.attack_hand(M)
diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm
index 323937075ad..a3f7ee5189a 100644
--- a/code/game/machinery/shieldgen.dm
+++ b/code/game/machinery/shieldgen.dm
@@ -13,7 +13,10 @@
/obj/machinery/shield/New()
src.dir = pick(1,2,3,4)
..()
+
+/obj/machinery/shield/initialize()
air_update_turf(1)
+ ..()
/obj/machinery/shield/Destroy()
opacity = 0
@@ -45,7 +48,7 @@
playsound(src.loc, 'sound/effects/EMPulse.ogg', 75, 1)
- if (src.health <= 0)
+ if(src.health <= 0)
visible_message("\blue The [src] dissipates")
qdel(src)
return
@@ -68,13 +71,13 @@
/obj/machinery/shield/ex_act(severity)
switch(severity)
if(1.0)
- if (prob(75))
+ if(prob(75))
qdel(src)
if(2.0)
- if (prob(50))
+ if(prob(50))
qdel(src)
if(3.0)
- if (prob(25))
+ if(prob(25))
qdel(src)
return
@@ -105,7 +108,7 @@
playsound(src.loc, 'sound/effects/EMPulse.ogg', 100, 1)
//Handle the destruction of the shield
- if (src.health <= 0)
+ if(src.health <= 0)
visible_message("\blue The [src] dissipates")
qdel(src)
return
@@ -151,8 +154,8 @@
update_icon()
for(var/turf/target_tile in range(2, src))
- if (istype(target_tile,/turf/space) && !(locate(/obj/machinery/shield) in target_tile))
- if (malfunction && prob(33) || !malfunction)
+ if(istype(target_tile,/turf/space) && !(locate(/obj/machinery/shield) in target_tile))
+ if(malfunction && prob(33) || !malfunction)
deployed_shields += new /obj/machinery/shield(target_tile)
/obj/machinery/shieldgen/proc/shields_down()
@@ -186,7 +189,7 @@
src.checkhp()
if(2.0)
src.health -= 30
- if (prob(15))
+ if(prob(15))
src.malfunction = 1
src.checkhp()
if(3.0)
@@ -214,15 +217,15 @@
to_chat(user, "The panel must be closed before operating this machine.")
return
- if (src.active)
- user.visible_message("\blue \icon[src] [user] deactivated the shield generator.", \
- "\blue \icon[src] You deactivate the shield generator.", \
+ if(src.active)
+ user.visible_message("\blue [bicon(src)] [user] deactivated the shield generator.", \
+ "\blue [bicon(src)] You deactivate the shield generator.", \
"You hear heavy droning fade out.")
src.shields_down()
else
if(anchored)
- user.visible_message("\blue \icon[src] [user] activated the shield generator.", \
- "\blue \icon[src] You activate the shield generator.", \
+ user.visible_message("\blue [bicon(src)] [user] activated the shield generator.", \
+ "\blue [bicon(src)] You activate the shield generator.", \
"You hear heavy droning.")
src.shields_up()
else
@@ -470,7 +473,7 @@
return
if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
- if (src.allowed(user))
+ if(src.allowed(user))
src.locked = !src.locked
to_chat(user, "Controls are now [src.locked ? "locked." : "unlocked."]")
else
@@ -602,7 +605,7 @@
if(istype(mover) && mover.checkpass(PASSGLASS))
return prob(20)
else
- if (istype(mover, /obj/item/projectile))
+ if(istype(mover, /obj/item/projectile))
return prob(10)
else
- return !src.density
\ No newline at end of file
+ return !src.density
diff --git a/code/game/machinery/slotmachine.dm b/code/game/machinery/slotmachine.dm
index 8a4ef1bc330..9705ef9dedd 100644
--- a/code/game/machinery/slotmachine.dm
+++ b/code/game/machinery/slotmachine.dm
@@ -31,7 +31,7 @@
data["resultlvl"] = resultlvl
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, "slotmachine.tmpl", name, 350, 200)
ui.set_initial_data(data)
ui.open()
@@ -43,9 +43,9 @@
if(href_list["ops"])
var/operation = text2num(href_list["ops"])
if(operation == 1) // Play
- if (working == 1)
+ if(working == 1)
return
- if (!account || account.money < 10)
+ if(!account || account.money < 10)
return
if(!account.charge(10, transaction_purpose = "Bet", dest_name = name))
return
@@ -55,39 +55,39 @@
var/roll = rand(1,1350)
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
spawn(25)
- if (roll == 1)
+ if(roll == 1)
visible_message("[src] says, 'JACKPOT! [usr.name] has won a MILLION CREDITS!'")
command_announcement.Announce("Congratulations to [usr.name] on winning the Jackpot of ONE MILLION CREDITS!", "Jackpot Winner")
result = "JACKPOT! You win one million credits!"
resultlvl = "highlight"
win_money(1000000, 'sound/goonstation/misc/airraid_loop.ogg')
- else if (roll > 1 && roll <= 5)
+ else if(roll > 1 && roll <= 5)
visible_message("[src] says, 'Big Winner! [usr.name] has won a hundred thousand credits!'")
command_announcement.Announce("Congratulations to [usr.name] on winning a hundred thousand credits!", "Big Winner")
result = "Big Winner! You win a hundred thousand credits!"
resultlvl = "good"
win_money(100000, 'sound/goonstation/misc/klaxon.ogg')
- else if (roll > 5 && roll <= 25)
+ else if(roll > 5 && roll <= 25)
visible_message("[src] says, 'Big Winner! [usr.name] has won ten thousand credits!'")
result = "You win ten thousand credits!"
resultlvl = "good"
win_money(10000, 'sound/goonstation/misc/klaxon.ogg')
- else if (roll > 25 && roll <= 50)
+ else if(roll > 25 && roll <= 50)
visible_message("[src] says, 'Winner! [usr.name] has won a thousand credits!'")
result = "You win a thousand credits!"
resultlvl = "good"
win_money(1000, 'sound/goonstation/misc/bell.ogg')
- else if (roll > 50 && roll <= 100)
+ else if(roll > 50 && roll <= 100)
visible_message("[src] says, 'Winner! [usr.name] has won a hundred credits!'")
result = "You win a hundred credits!"
resultlvl = "good"
win_money(100, 'sound/goonstation/misc/bell.ogg')
- else if (roll > 100 && roll <= 200)
+ else if(roll > 100 && roll <= 200)
visible_message("[src] says, 'Winner! [usr.name] has won fifty credits!'")
result = "You win fifty credits!"
resultlvl = "good"
win_money(50)
- else if (roll > 200 && roll <= 500)
+ else if(roll > 200 && roll <= 500)
visible_message("[src] says, 'Winner! [usr.name] has won ten credits!'")
result = "You win ten credits!"
resultlvl = "good"
diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm
index 6ba798cebee..68c4ab10a34 100644
--- a/code/game/machinery/spaceheater.dm
+++ b/code/game/machinery/spaceheater.dm
@@ -19,6 +19,12 @@
update_icon()
return
+/obj/machinery/space_heater/Destroy()
+ if(cell)
+ qdel(cell)
+ cell = null
+ return ..()
+
/obj/machinery/space_heater/update_icon()
overlays.Cut()
icon_state = "sheater[on]"
@@ -107,9 +113,9 @@
/obj/machinery/space_heater/Topic(href, href_list)
- if (..())
+ if(..())
return 1
- if ((in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon)))
+ if((in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
switch(href_list["op"])
diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm
index 9cb2c7db4d6..325977b44df 100644
--- a/code/game/machinery/suit_storage_unit.dm
+++ b/code/game/machinery/suit_storage_unit.dm
@@ -134,10 +134,10 @@
return 0
if(src.panelopen) //The maintenance panel is open. Time for some shady stuff
dat+= "Suit storage unit: Maintenance panel"
- dat+= "Maintenance panel controls"
+ dat+= "Maintenance panel controls"
dat+= "The panel is ridden with controls, button and meters, labeled in strange signs and symbols that you cannot understand. Probably the manufactoring world's language. Among other things, a few controls catch your eye.
"
- dat+= text("A small dial with a \"ë\" symbol embroidded on it. It's pointing towards a gauge that reads []. Turn towards [] ",(src.issuperUV ? "15nm" : "185nm"),src,(src.issuperUV ? "185nm" : "15nm") )
- dat+= text("A thick old-style button, with 2 grimy LED lights next to it. The [] LED is on. Press button",(src.safetieson? "GREEN" : "RED"),src)
+ dat+= text("A small dial with a \"�\" symbol embroidded on it. It's pointing towards a gauge that reads []. Turn towards [] ",(src.issuperUV ? "15nm" : "185nm"),src,(src.issuperUV ? "185nm" : "15nm") )
+ dat+= text("A thick old-style button, with 2 grimy LED lights next to it. The [] LED is on. Press button",(src.safetieson? "GREEN" : "RED"),src)
dat+= text(" Close panel", user)
//user << browse(dat, "window=ssu_m_panel;size=400x500")
//onclose(user, "ssu_m_panel")
@@ -150,26 +150,24 @@
else
if(!src.isbroken)
- dat+= "Suit storage unit"
- dat+= "U-Stor-It Suit Storage Unit, model DS1900 "
dat+= "Welcome to the Unit control panel."
- dat+= text("Helmet storage compartment: [] ",(src.HELMET ? HELMET.name : "No helmet detected.") )
+ dat+= text("Helmet storage compartment: [] ",(src.HELMET ? HELMET.name : "No helmet detected.") )
if(HELMET && src.isopen)
dat+=text("Dispense helmet ",src)
- dat+= text("Suit storage compartment: [] ",(src.SUIT ? SUIT.name : "No exosuit detected.") )
+ dat+= text("Suit storage compartment: [] ",(src.SUIT ? SUIT.name : "No exosuit detected.") )
if(SUIT && src.isopen)
dat+=text("Dispense suit ",src)
- dat+= text("Breathmask storage compartment: [] ",(src.MASK ? MASK.name : "No breathmask detected.") )
+ dat+= text("Breathmask storage compartment: [] ",(src.MASK ? MASK.name : "No breathmask detected.") )
if(MASK && src.isopen)
dat+=text("Dispense mask ",src)
if(src.OCCUPANT)
dat+= "WARNING: Biological entity detected inside the Unit's storage. Please remove. "
dat+= "Eject extra load"
- dat+= text("Unit is: [] - [] Unit ",(src.isopen ? "Open" : "Closed"),src,(src.isopen ? "Close" : "Open"))
+ dat+= text("Unit is: [] - [] Unit ",(src.isopen ? "Open" : "Closed"),src,(src.isopen ? "Close" : "Open"))
if(src.isopen)
dat+=""
else
- dat+= text(" - *[] Unit*",src,(src.islocked ? "Unlock" : "Lock") )
+ dat+= text(" - *[] Unit*",src,(src.islocked ? "Unlock" : "Lock") )
dat+= text("Unit status: []",(src.islocked? "**LOCKED** " : "**UNLOCKED** ") )
dat+= text("Start Disinfection cycle ",src)
dat += text("
Close control panel", user)
@@ -182,7 +180,9 @@
//user << browse(dat, "window=suit_storage_unit;size=400x500")
//onclose(user, "suit_storage_unit")
- user << browse(dat, "window=suit_storage_unit;size=400x500")
+ var/datum/browser/popup = new(user, "suit_storage_unit", name, 400, 500)
+ popup.set_content(dat)
+ popup.open(0)
onclose(user, "suit_storage_unit")
return
@@ -190,45 +190,45 @@
/obj/machinery/suit_storage_unit/Topic(href, href_list) //I fucking HATE this proc
if(..())
return 1
- if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
+ if((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
usr.set_machine(src)
- if (href_list["toggleUV"])
+ if(href_list["toggleUV"])
src.toggleUV(usr)
src.updateUsrDialog()
src.update_icon()
- if (href_list["togglesafeties"])
+ if(href_list["togglesafeties"])
src.togglesafeties(usr)
src.updateUsrDialog()
src.update_icon()
- if (href_list["dispense_helmet"])
+ if(href_list["dispense_helmet"])
src.dispense_helmet(usr)
src.updateUsrDialog()
src.update_icon()
- if (href_list["dispense_suit"])
+ if(href_list["dispense_suit"])
src.dispense_suit(usr)
src.updateUsrDialog()
src.update_icon()
- if (href_list["dispense_mask"])
+ if(href_list["dispense_mask"])
src.dispense_mask(usr)
src.updateUsrDialog()
src.update_icon()
- if (href_list["toggle_open"])
+ if(href_list["toggle_open"])
src.toggle_open(usr)
src.updateUsrDialog()
src.update_icon()
- if (href_list["toggle_lock"])
+ if(href_list["toggle_lock"])
src.toggle_lock(usr)
src.updateUsrDialog()
src.update_icon()
- if (href_list["start_UV"])
+ if(href_list["start_UV"])
src.start_UV(usr)
src.updateUsrDialog()
src.update_icon()
- if (href_list["eject_guy"])
+ if(href_list["eject_guy"])
src.eject_occupant(usr)
src.updateUsrDialog()
src.update_icon()
- /*if (href_list["refresh"])
+ /*if(href_list["refresh"])
src.updateUsrDialog()*/
src.add_fingerprint(usr)
return
@@ -430,15 +430,15 @@
/obj/machinery/suit_storage_unit/proc/eject_occupant(mob/user as mob)
- if (src.islocked)
+ if(src.islocked)
return
- if (!src.OCCUPANT)
+ if(!src.OCCUPANT)
return
// for(var/obj/O in src)
// O.loc = src.loc
- if (src.OCCUPANT.client)
+ if(src.OCCUPANT.client)
if(user != OCCUPANT)
to_chat(OCCUPANT, "The machine kicks you out!")
if(user.loc != src.loc)
@@ -459,7 +459,7 @@
set category = "Object"
set src in oview(1)
- if (usr.stat != 0)
+ if(usr.stat != 0)
return
src.eject_occupant(usr)
add_fingerprint(usr)
@@ -473,15 +473,15 @@
set category = "Object"
set src in oview(1)
- if (usr.stat != 0)
+ if(usr.stat != 0)
return
- if (!src.isopen)
+ if(!src.isopen)
to_chat(usr, "The unit's doors are shut.")
return
- if (!src.ispowered || src.isbroken)
+ if(!src.ispowered || src.isbroken)
to_chat(usr, "The unit is not operational.")
return
- if ( (src.OCCUPANT) || (src.HELMET) || (src.SUIT) )
+ if( (src.OCCUPANT) || (src.HELMET) || (src.SUIT) )
to_chat(usr, "It's too cluttered inside for you to fit in!")
return
visible_message("[usr] starts squeezing into the suit storage unit!")
@@ -515,24 +515,24 @@
to_chat(user, text("You [] the unit's maintenance panel.",(src.panelopen ? "open up" : "close") ))
src.updateUsrDialog()
return
- if ( istype(I, /obj/item/weapon/grab) )
+ if( istype(I, /obj/item/weapon/grab) )
var/obj/item/weapon/grab/G = I
if( !(ismob(G.affecting)) )
return
- if (!src.isopen)
+ if(!src.isopen)
to_chat(usr, "The unit's doors are shut.")
return
- if (!src.ispowered || src.isbroken)
+ if(!src.ispowered || src.isbroken)
to_chat(usr, "The unit is not operational.")
return
- if ( (src.OCCUPANT) || (src.HELMET) || (src.SUIT) ) //Unit needs to be absolutely empty
+ if( (src.OCCUPANT) || (src.HELMET) || (src.SUIT) ) //Unit needs to be absolutely empty
to_chat(user, "The unit's storage area is too cluttered.")
return
visible_message("[user] starts putting [G.affecting.name] into the Suit Storage Unit.")
if(do_after(user, 20, target = G:affecting))
if(!G || !G.affecting) return //derpcheck
var/mob/M = G.affecting
- if (M.client)
+ if(M.client)
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src
M.loc = src
@@ -690,7 +690,7 @@
if(do_after(user, 20, target = G:affecting))
if(!G || !G.affecting) return
var/mob/M = G.affecting
- if (M.client)
+ if(M.client)
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src
M.loc = src
@@ -838,7 +838,9 @@
dat += "The red light is [safeties ? "blinking" : "off"]. "
dat += "The yellow light is [locked ? "on" : "off"]. " */
- user << browse(dat, "window=suit_cycler")
+ var/datum/browser/popup = new(user, "suit_cycler", name, 400, 400)
+ popup.set_content(dat)
+ popup.open(0)
onclose(user, "suit_cycler")
return
@@ -909,22 +911,22 @@
if(radiation_level > 1)
suit.clean_blood()
-/* else if ((href_list["cutwire"]) && (src.panel_open))
+/* else if((href_list["cutwire"]) && (src.panel_open))
var/twire = text2num(href_list["cutwire"])
- if (!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) ))
+ if(!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) ))
to_chat(usr, "You need wirecutters!")
return
- if (src.isWireColorCut(twire))
+ if(src.isWireColorCut(twire))
src.mend(twire)
else
src.cut(twire)
- else if ((href_list["pulsewire"]) && (src.panel_open))
+ else if((href_list["pulsewire"]) && (src.panel_open))
var/twire = text2num(href_list["pulsewire"])
- if (!istype(usr.get_active_hand(), /obj/item/device/multitool))
+ if(!istype(usr.get_active_hand(), /obj/item/device/multitool))
to_chat(usr, "You need a multitool!")
return
- if (src.isWireColorCut(twire))
+ if(src.isWireColorCut(twire))
to_chat(usr, "You can't pulse a cut wire.")
return
else
@@ -983,7 +985,7 @@
set category = "Object"
set src in oview(1)
- if (usr.stat != 0)
+ if(usr.stat != 0)
return
eject_occupant(usr)
@@ -994,10 +996,10 @@
to_chat(user, "\red The cycler is locked.")
return
- if (!occupant)
+ if(!occupant)
return
- if (occupant.client)
+ if(occupant.client)
occupant.client.eye = occupant.client.mob
occupant.client.perspective = MOB_PERSPECTIVE
@@ -1029,7 +1031,7 @@
safeties = 0
if(WIRE_SHOCK)
electrified = -1
- if (WIRE_SCANID)
+ if(WIRE_SCANID)
locked = 0
/obj/machinery/suit_cycler/proc/mend(var/wireColor)
@@ -1047,7 +1049,7 @@
safeties = !locked
if(WIRE_SHOCK)
electrified = 30
- if (WIRE_SCANID)
+ if(WIRE_SCANID)
locked = !locked
*/
diff --git a/code/game/machinery/supply_display.dm b/code/game/machinery/supply_display.dm
index 3b55d8423f7..caf0c9c67d9 100644
--- a/code/game/machinery/supply_display.dm
+++ b/code/game/machinery/supply_display.dm
@@ -5,6 +5,7 @@
/obj/machinery/status_display/supply_display/update()
if(!..() && mode == STATUS_DISPLAY_CUSTOM)
if(shuttle_master.supply.mode == SHUTTLE_IDLE)
+ // TODO: Tie into space manager
if(shuttle_master.supply.z == ZLEVEL_STATION)
message1 = "CARGO"
message2 = "Docked"
diff --git a/code/game/machinery/syndicatebomb.dm b/code/game/machinery/syndicatebomb.dm
index fe443662616..bf4300351fa 100644
--- a/code/game/machinery/syndicatebomb.dm
+++ b/code/game/machinery/syndicatebomb.dm
@@ -10,7 +10,7 @@
unacidable = 1
var/datum/wires/syndicatebomb/wires = null
- var/timer = 60
+ var/timer = 120
var/open_panel = 0 //are the wires exposed?
var/active = 0 //is the bomb counting down?
var/defused = 0 //is the bomb capable of exploding?
@@ -19,12 +19,12 @@
/obj/machinery/syndicatebomb/process()
if(active && !defused && (timer > 0)) //Tick Tock
- var/volume = (timer <= 10 ? 40 : 10) // Tick louder when the bomb is closer to being detonated.
+ var/volume = (timer <= 20 ? 40 : 10) // Tick louder when the bomb is closer to being detonated.
playsound(loc, beepsound, volume, 0)
- timer--
+ timer = max(timer - 2,0) // 2 seconds per process()
if(active && !defused && (timer <= 0)) //Boom
active = 0
- timer = 60
+ timer = 120
update_icon()
if(payload in src)
payload.detonate()
@@ -88,7 +88,7 @@
payload = null
else
to_chat(user, "There isn't anything in here to remove!")
- else if (open_panel)
+ else if(open_panel)
to_chat(user, "The wires conneting the shell to the explosives are holding it down!")
else
to_chat(user, "The cover is screwed on, it won't pry off!")
@@ -123,17 +123,17 @@
/obj/machinery/syndicatebomb/proc/settings(var/mob/user)
var/newtime = input(user, "Please set the timer.", "Timer", "[timer]") as num
- newtime = Clamp(newtime, 60, 60000)
+ newtime = Clamp(newtime, 120, 60000)
if(in_range(src, user) && isliving(user)) //No running off and setting bombs from across the station
timer = newtime
- src.loc.visible_message("\icon[src] timer set for [timer] seconds.")
+ src.loc.visible_message("[bicon(src)] timer set for [timer] seconds.")
if(alert(user,"Would you like to start the countdown now?",,"Yes","No") == "Yes" && in_range(src, user) && isliving(user))
if(defused || active)
if(defused)
- src.loc.visible_message("\icon[src] Device error: User intervention required.")
+ src.loc.visible_message("[bicon(src)] Device error: User intervention required.")
return
else
- src.loc.visible_message("\icon[src] [timer] seconds until detonation, please clear the area.")
+ src.loc.visible_message("[bicon(src)] [timer] seconds until detonation, please clear the area.")
playsound(loc, 'sound/machines/click.ogg', 30, 1)
active = 1
update_icon()
@@ -180,8 +180,9 @@
icon = 'icons/obj/assemblies.dmi'
icon_state = "bombcore"
item_state = "eshield0"
- w_class = 3.0
+ w_class = 3
origin_tech = "syndicate=6;combat=5"
+ burn_state = FLAMMABLE //Burnable (but the casing isn't)
var/adminlog = null
/obj/item/weapon/bombcore/ex_act(severity) //Little boom can chain a big boom
@@ -223,7 +224,7 @@
var/obj/machinery/syndicatebomb/holder = src.loc
if(istype(holder))
attempts++
- holder.loc.visible_message("\icon[holder] Alert: Bomb has detonated. Your score is now [defusals] for [attempts]. Resetting wires...")
+ holder.loc.visible_message("[bicon(holder)] Alert: Bomb has detonated. Your score is now [defusals] for [attempts]. Resetting wires...")
reset()
else
qdel(src)
@@ -233,7 +234,7 @@
if(istype(holder))
attempts++
defusals++
- holder.loc.visible_message("\icon[holder] Alert: Bomb has been defused. Your score is now [defusals] for [attempts]! Resetting wires in 5 seconds...")
+ holder.loc.visible_message("[bicon(holder)] Alert: Bomb has been defused. Your score is now [defusals] for [attempts]! Resetting wires in 5 seconds...")
sleep(50) //Just in case someone is trying to remove the bomb core this gives them a little window to crowbar it out
if(istype(holder))
reset()
@@ -296,7 +297,7 @@
icon = 'icons/obj/assemblies.dmi'
icon_state = "bigred"
item_state = "electronic"
- w_class = 1.0
+ w_class = 1
origin_tech = "syndicate=2"
var/cooldown = 0
var/detonated = 0
diff --git a/code/game/machinery/telecomms/broadcaster.dm b/code/game/machinery/telecomms/broadcaster.dm
index 5d6aa95b56f..7ddb0f4b963 100644
--- a/code/game/machinery/telecomms/broadcaster.dm
+++ b/code/game/machinery/telecomms/broadcaster.dm
@@ -234,7 +234,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
if(data == 1)
- for (var/obj/item/device/radio/intercom/R in connection.devices["[RADIO_CHAT]"])
+ for(var/obj/item/device/radio/intercom/R in connection.devices["[RADIO_CHAT]"])
if(R.receive_range(display_freq, level) > -1)
radios += R
@@ -242,7 +242,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
else if(data == 2)
- for (var/obj/item/device/radio/R in connection.devices["[RADIO_CHAT]"])
+ for(var/obj/item/device/radio/R in connection.devices["[RADIO_CHAT]"])
if(istype(R, /obj/item/device/radio/headset))
continue
@@ -255,7 +255,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
else if(data == 3)
for(var/antag_freq in ANTAG_FREQS)
var/datum/radio_frequency/antag_connection = radio_controller.return_frequency(antag_freq)
- for (var/obj/item/device/radio/R in antag_connection.devices["[RADIO_CHAT]"])
+ for(var/obj/item/device/radio/R in antag_connection.devices["[RADIO_CHAT]"])
if(R.receive_range(antag_freq, level) > -1)
radios += R
@@ -263,7 +263,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
else
- for (var/obj/item/device/radio/R in connection.devices["[RADIO_CHAT]"])
+ for(var/obj/item/device/radio/R in connection.devices["[RADIO_CHAT]"])
if(R.receive_range(display_freq, level) > -1)
radios += R
@@ -281,11 +281,11 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
var/list/heard_garbled = list() // garbled message (ie "f*c* **u, **i*er!")
var/list/heard_gibberish= list() // completely screwed over message (ie "F%! (O*# *#!<>&**%!")
- for (var/mob/R in receive)
+ for(var/mob/R in receive)
/* --- Loop through the receivers and categorize them --- */
- if (R.client && R.client.holder && !(R.client.prefs.toggles & CHAT_RADIO)) //Adminning with 80 people on can be fun when you're trying to talk and all you can hear is radios.
+ if(R.client && R.client.holder && !(R.client.prefs.toggles & CHAT_RADIO)) //Adminning with 80 people on can be fun when you're trying to talk and all you can hear is radios.
continue
if(istype(R, /mob/new_player)) // we don't want new players to hear messages. rare but generates runtimes.
@@ -302,10 +302,10 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
// --- Can understand the speech ---
- if (!M || R.say_understands(M))
+ if(!M || R.say_understands(M))
// - Not human or wearing a voice mask -
- if (!M || !ishuman(M) || vmask)
+ if(!M || !ishuman(M) || vmask)
heard_masked += R
// - Human and not wearing voice mask -
@@ -316,7 +316,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
else
// - The speaker has a prespecified "voice message" to display if not understood -
- if (vmessage)
+ if(vmessage)
heard_voice += R
// - Just display a garbled message -
@@ -325,7 +325,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
/* ###### Begin formatting and sending the message ###### */
- if (length(heard_masked) || length(heard_normal) || length(heard_voice) || length(heard_garbled) || length(heard_gibberish))
+ if(length(heard_masked) || length(heard_normal) || length(heard_voice) || length(heard_garbled) || length(heard_gibberish))
/* --- Some miscellaneous variables to format the string output --- */
var/freq_text = get_frequency_name(display_freq)
@@ -333,7 +333,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
var/part_b_extra = ""
if(data == 3) // intercepted radio message
part_b_extra = " (Intercepted)"
- var/part_a = "\icon[radio]\[[freq_text]\][part_b_extra]" // goes in the actual output
+ var/part_a = "[bicon(radio)]\[[freq_text]\][part_b_extra]" // goes in the actual output
// --- Some more pre-message formatting ---
var/part_b = "" // Tweaked for security headsets -- TLE
@@ -387,34 +387,34 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
/* --- Process all the mobs that heard a masked voice (understood) --- */
- if (length(heard_masked))
- for (var/mob/R in heard_masked)
+ if(length(heard_masked))
+ for(var/mob/R in heard_masked)
R.hear_radio(message,verbage, speaking, part_a, part_b, M, 0, name, follow_target=follow_target)
/* --- Process all the mobs that heard the voice normally (understood) --- */
- if (length(heard_normal))
- for (var/mob/R in heard_normal)
+ if(length(heard_normal))
+ for(var/mob/R in heard_normal)
R.hear_radio(message, verbage, speaking, part_a, part_b, M, 0, realname, follow_target=follow_target)
/* --- Process all the mobs that heard the voice normally (did not understand) --- */
- if (length(heard_voice))
- for (var/mob/R in heard_voice)
+ if(length(heard_voice))
+ for(var/mob/R in heard_voice)
R.hear_radio(message,verbage, speaking, part_a, part_b, M,0, vname, follow_target=follow_target)
/* --- Process all the mobs that heard a garbled voice (did not understand) --- */
// Displays garbled message (ie "f*c* **u, **i*er!")
- if (length(heard_garbled))
- for (var/mob/R in heard_garbled)
+ if(length(heard_garbled))
+ for(var/mob/R in heard_garbled)
R.hear_radio(message, verbage, speaking, part_a, part_b, M, 1, vname, follow_target=follow_target)
/* --- Complete gibberish. Usually happens when there's a compressed message --- */
- if (length(heard_gibberish))
- for (var/mob/R in heard_gibberish)
+ if(length(heard_gibberish))
+ for(var/mob/R in heard_gibberish)
R.hear_radio(message, verbage, speaking, part_a, part_b, M, 1, follow_target=follow_target)
return 1
@@ -437,8 +437,9 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
// --- Broadcast only to intercom devices ---
if(data == 1)
- for (var/obj/item/device/radio/intercom/R in connection.devices["[RADIO_CHAT]"])
+ for(var/obj/item/device/radio/intercom/R in connection.devices["[RADIO_CHAT]"])
var/turf/position = get_turf(R)
+ // TODO: Tie into space manager
if(position && position.z == level)
receive |= R.send_hear(display_freq, level)
@@ -446,11 +447,12 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
// --- Broadcast only to intercoms and station-bounced radios ---
else if(data == 2)
- for (var/obj/item/device/radio/R in connection.devices["[RADIO_CHAT]"])
+ for(var/obj/item/device/radio/R in connection.devices["[RADIO_CHAT]"])
if(istype(R, /obj/item/device/radio/headset))
continue
var/turf/position = get_turf(R)
+ // TODO: Tie into space manager
if(position && position.z == level)
receive |= R.send_hear(display_freq)
@@ -460,8 +462,9 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
else if(data == 3)
for(var/freq in ANTAG_FREQS)
var/datum/radio_frequency/antag_connection = radio_controller.return_frequency(freq)
- for (var/obj/item/device/radio/R in antag_connection.devices["[RADIO_CHAT]"])
+ for(var/obj/item/device/radio/R in antag_connection.devices["[RADIO_CHAT]"])
var/turf/position = get_turf(R)
+ // TODO: Tie into space manager
if(position && position.z == level)
receive |= R.send_hear(freq)
@@ -469,8 +472,9 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
// --- Broadcast to ALL radio devices ---
else
- for (var/obj/item/device/radio/R in connection.devices["[RADIO_CHAT]"])
+ for(var/obj/item/device/radio/R in connection.devices["[RADIO_CHAT]"])
var/turf/position = get_turf(R)
+ // TODO: Tie into space manager
if(position && position.z == level)
receive |= R.send_hear(display_freq)
@@ -484,11 +488,11 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
var/list/heard_garbled = list() // garbled message (ie "f*c* **u, **i*er!")
var/list/heard_gibberish= list() // completely screwed over message (ie "F%! (O*# *#!<>&**%!")
- for (var/mob/R in receive)
+ for(var/mob/R in receive)
/* --- Loop through the receivers and categorize them --- */
- if (R.client && !(R.client.prefs.toggles & CHAT_RADIO)) //Adminning with 80 people on can be fun when you're trying to talk and all you can hear is radios.
+ if(R.client && !(R.client.prefs.toggles & CHAT_RADIO)) //Adminning with 80 people on can be fun when you're trying to talk and all you can hear is radios.
continue
@@ -500,7 +504,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
// --- Can understand the speech ---
- if (R.say_understands(M))
+ if(R.say_understands(M))
heard_normal += R
@@ -513,7 +517,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
/* ###### Begin formatting and sending the message ###### */
- if (length(heard_normal) || length(heard_garbled) || length(heard_gibberish))
+ if(length(heard_normal) || length(heard_garbled) || length(heard_gibberish))
/* --- Some miscellaneous variables to format the string output --- */
var/part_a = "" // goes in the actual output
@@ -528,7 +532,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
// Create a radio headset for the sole purpose of using its icon
var/obj/item/device/radio/headset/radio = new
- var/part_b = " \icon[radio]\[[freq_text]\][part_b_extra]" // Tweaked for security headsets -- TLE
+ var/part_b = " [bicon(radio)]\[[freq_text]\][part_b_extra]" // Tweaked for security headsets -- TLE
var/part_blackbox_b = " \[[freq_text]\]"
var/part_c = ""
@@ -566,30 +570,30 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
/* --- Process all the mobs that heard the voice normally (understood) --- */
- if (length(heard_normal))
+ if(length(heard_normal))
var/rendered = "[part_a][source][part_b]\"[text]\"[part_c]"
- for (var/mob/R in heard_normal)
+ for(var/mob/R in heard_normal)
R.show_message(rendered, 2)
/* --- Process all the mobs that heard a garbled voice (did not understand) --- */
// Displays garbled message (ie "f*c* **u, **i*er!")
- if (length(heard_garbled))
+ if(length(heard_garbled))
var/quotedmsg = "\"[stars(text)]\""
var/rendered = "[part_a][source][part_b][quotedmsg][part_c]"
- for (var/mob/R in heard_garbled)
+ for(var/mob/R in heard_garbled)
R.show_message(rendered, 2)
/* --- Complete gibberish. Usually happens when there's a compressed message --- */
- if (length(heard_gibberish))
+ if(length(heard_gibberish))
var/quotedmsg = "\"[Gibberish(text, compression + 50)]\""
var/rendered = "[part_a][Gibberish(source, compression + 50)][part_b][quotedmsg][part_c]"
- for (var/mob/R in heard_gibberish)
+ for(var/mob/R in heard_gibberish)
R.show_message(rendered, 2)
//Use this to test if an obj can communicate with a Telecommunications Network
@@ -597,6 +601,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
/atom/proc/test_telecomms()
var/datum/signal/signal = src.telecomms_process()
var/turf/position = get_turf(src)
+ // TODO: Tie into space manager
return (position.z in signal.data["level"]) && signal.data["done"]
/atom/proc/telecomms_process(var/do_sleep = 1)
@@ -615,6 +620,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
"type" = 4, // determines what type of radio input it is: test broadcast
"reject" = 0,
"done" = 0,
+ // TODO: Tie into space manager
"level" = pos.z // The level it is being broadcasted at.
)
signal.frequency = PUB_FREQ// Common channel
@@ -630,4 +636,3 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
//log_to_dd("Level: [signal.data["level"]] - Done: [signal.data["done"]]")
return signal
-
diff --git a/code/game/machinery/telecomms/logbrowser.dm b/code/game/machinery/telecomms/logbrowser.dm
index 5e46a20dd6d..a97e5a7d4c2 100644
--- a/code/game/machinery/telecomms/logbrowser.dm
+++ b/code/game/machinery/telecomms/logbrowser.dm
@@ -224,12 +224,12 @@
if(istype(D, /obj/item/weapon/screwdriver))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
if(do_after(user, 20, target = src))
- if (src.stat & BROKEN)
+ if(src.stat & BROKEN)
to_chat(user, "\blue The broken glass falls out.")
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
new /obj/item/weapon/shard(loc)
var/obj/item/weapon/circuitboard/comm_server/M = new /obj/item/weapon/circuitboard/comm_server( A )
- for (var/obj/C in src)
+ for(var/obj/C in src)
C.loc = src.loc
A.circuit = M
A.state = 3
@@ -240,7 +240,7 @@
to_chat(user, "\blue You disconnect the monitor.")
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
var/obj/item/weapon/circuitboard/comm_server/M = new /obj/item/weapon/circuitboard/comm_server( A )
- for (var/obj/C in src)
+ for(var/obj/C in src)
C.loc = src.loc
A.circuit = M
A.state = 4
diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm
index da9fe5a046e..0c0dfd178fe 100644
--- a/code/game/machinery/telecomms/machine_interactions.dm
+++ b/code/game/machinery/telecomms/machine_interactions.dm
@@ -180,6 +180,7 @@
var/turf/position = get_turf(src)
// Toggle on/off getting signals from the station or the current Z level
+ // TODO: Tie into space manager
if(src.listening_level == ZLEVEL_STATION) // equals the station
src.listening_level = position.z
return 1
@@ -393,4 +394,3 @@
if(issilicon(user) || in_range(user, src))
return 1
return 0
-
diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm
index 290e3352ea8..22c7863a3bb 100644
--- a/code/game/machinery/telecomms/telecomunications.dm
+++ b/code/game/machinery/telecomms/telecomunications.dm
@@ -56,40 +56,17 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
continue
if(amount && send_count >= amount)
break
+ // TODO: Tie into space manager
if(machine.loc.z != listening_level)
if(long_range_link == 0 && machine.long_range_link == 0)
continue
// If we're sending a copy, be sure to create the copy for EACH machine and paste the data
- var/datum/signal/copy = new
+ var/datum/signal/copy
if(copysig)
-
+ copy = new
copy.transmission_method = 2
copy.frequency = signal.frequency
- // Copy the main data contents! Workaround for some nasty bug where the actual array memory is copied and not its contents.
- copy.data = list(
-
- "mob" = signal.data["mob"],
- "mobtype" = signal.data["mobtype"],
- "realname" = signal.data["realname"],
- "name" = signal.data["name"],
- "job" = signal.data["job"],
- "key" = signal.data["key"],
- "vmessage" = signal.data["vmessage"],
- "vname" = signal.data["vname"],
- "vmask" = signal.data["vmask"],
- "compression" = signal.data["compression"],
- "message" = signal.data["message"],
- "connection" = signal.data["connection"],
- "radio" = signal.data["radio"],
- "slow" = signal.data["slow"],
- "traffic" = signal.data["traffic"],
- "type" = signal.data["type"],
- "server" = signal.data["server"],
- "reject" = signal.data["reject"],
- "level" = signal.data["level"],
- "verb" = signal.data["verb"],
- "language" = signal.data["language"]
- )
+ copy.data = signal.data.Copy()
// Keep the "original" signal constant
if(!signal.data["original"])
@@ -97,15 +74,11 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
else
copy.data["original"] = signal.data["original"]
- else
- qdel(copy)
-
-
send_count++
if(machine.is_freq_listening(signal))
machine.traffic++
- if(copysig && copy)
+ if(copysig)
machine.receive_information(copy, src)
else
machine.receive_information(signal, src)
@@ -142,9 +115,11 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
if(!listening_level)
//Defaults to our Z level!
var/turf/position = get_turf(src)
+ // TODO: Tie into space manager
listening_level = position.z
/obj/machinery/telecomms/initialize()
+ ..()
if(autolinkers.len)
// Links nearby machines
if(!long_range_link)
@@ -166,6 +141,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
/obj/machinery/telecomms/proc/add_link(var/obj/machinery/telecomms/T)
var/turf/position = get_turf(src)
var/turf/T_position = get_turf(T)
+ // TODO: Tie into space manager
if((position.z == T_position.z) || (src.long_range_link && T.long_range_link))
for(var/x in autolinkers)
if(T.autolinkers.Find(x))
@@ -584,10 +560,3 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
var/name = "data packet (#)"
var/garbage_collector = 1 // if set to 0, will not be garbage collected
var/input_type = "Speech File"
-
-
-
-
-
-
-
diff --git a/code/game/machinery/telecomms/telemonitor.dm b/code/game/machinery/telecomms/telemonitor.dm
index 16528b73d0e..57136b46dc9 100644
--- a/code/game/machinery/telecomms/telemonitor.dm
+++ b/code/game/machinery/telecomms/telemonitor.dm
@@ -130,12 +130,12 @@
if(istype(D, /obj/item/weapon/screwdriver))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
if(do_after(user, 20, target = src))
- if (src.stat & BROKEN)
+ if(src.stat & BROKEN)
to_chat(user, "\blue The broken glass falls out.")
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
new /obj/item/weapon/shard(loc)
var/obj/item/weapon/circuitboard/comm_monitor/M = new /obj/item/weapon/circuitboard/comm_monitor( A )
- for (var/obj/C in src)
+ for(var/obj/C in src)
C.loc = src.loc
A.circuit = M
A.state = 3
@@ -146,7 +146,7 @@
to_chat(user, "\blue You disconnect the monitor.")
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
var/obj/item/weapon/circuitboard/comm_monitor/M = new /obj/item/weapon/circuitboard/comm_monitor( A )
- for (var/obj/C in src)
+ for(var/obj/C in src)
C.loc = src.loc
A.circuit = M
A.state = 4
diff --git a/code/game/machinery/telecomms/traffic_control.dm b/code/game/machinery/telecomms/traffic_control.dm
index a5ee6631037..dbbf6682e4e 100644
--- a/code/game/machinery/telecomms/traffic_control.dm
+++ b/code/game/machinery/telecomms/traffic_control.dm
@@ -342,12 +342,12 @@
if(istype(D, /obj/item/weapon/screwdriver))
playsound(get_turf(src), 'sound/items/Screwdriver.ogg', 50, 1)
if(do_after(user, 20, target = src))
- if (src.stat & BROKEN)
+ if(src.stat & BROKEN)
to_chat(user, "\blue The broken glass falls out.")
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
new /obj/item/weapon/shard(loc)
var/obj/item/weapon/circuitboard/comm_traffic/M = new /obj/item/weapon/circuitboard/comm_traffic( A )
- for (var/obj/C in src)
+ for(var/obj/C in src)
C.loc = src.loc
A.circuit = M
A.state = 3
@@ -358,7 +358,7 @@
to_chat(user, "\blue You disconnect the monitor.")
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
var/obj/item/weapon/circuitboard/comm_traffic/M = new /obj/item/weapon/circuitboard/comm_traffic( A )
- for (var/obj/C in src)
+ for(var/obj/C in src)
C.loc = src.loc
A.circuit = M
A.state = 4
diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm
index 9c1d90ce67a..6ecc675fdef 100644
--- a/code/game/machinery/teleporter.dm
+++ b/code/game/machinery/teleporter.dm
@@ -20,11 +20,12 @@
return
/obj/machinery/computer/teleporter/initialize()
+ ..()
link_power_station()
update_icon()
/obj/machinery/computer/teleporter/Destroy()
- if (power_station)
+ if(power_station)
power_station.teleporter_console = null
power_station = null
return ..()
@@ -88,7 +89,7 @@
// Set up the Nano UI
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, "teleporter_console.tmpl", "Teleporter Console UI", 400, 400)
ui.set_initial_data(data)
ui.open()
@@ -179,9 +180,10 @@
for(var/obj/item/device/radio/beacon/R in beacons)
var/turf/T = get_turf(R)
- if (!T)
+ if(!T)
continue
- if((T.z in config.admin_levels) || T.z > 7)
+ // TODO: Tie into space manager
+ if((T.z in config.admin_levels) || T.z > ZLEVEL_EMPTY)
continue
if(R.syndicate == 1 && emagged == 0)
continue
@@ -192,16 +194,17 @@
areaindex[tmpname] = 1
L[tmpname] = R
- for (var/obj/item/weapon/implant/tracking/I in tracked_implants)
- if (!I.implanted || !ismob(I.loc))
+ for(var/obj/item/weapon/implant/tracking/I in tracked_implants)
+ if(!I.implanted || !ismob(I.loc))
continue
else
var/mob/M = I.loc
- if (M.stat == 2)
- if (M.timeofdeath + 6000 < world.time)
+ if(M.stat == 2)
+ if(M.timeofdeath + 6000 < world.time)
continue
var/turf/T = get_turf(M)
if(!T) continue
+ // TODO: Tie into space manager
if((T.z in config.admin_levels)) continue
var/tmpname = M.real_name
if(areaindex[tmpname])
@@ -222,9 +225,10 @@
return
for(var/obj/machinery/teleport/station/R in S)
var/turf/T = get_turf(R)
- if (!T || !R.teleporter_hub || !R.teleporter_console)
+ if(!T || !R.teleporter_hub || !R.teleporter_console)
continue
- if((T.z in config.admin_levels) || T.z > 7)
+ // TODO: Tie into space manager
+ if((T.z in config.admin_levels) || T.z > ZLEVEL_EMPTY)
continue
var/tmpname = T.loc.name
if(areaindex[tmpname])
@@ -247,7 +251,7 @@
return
/proc/find_loc(obj/R as obj)
- if (!R) return null
+ if(!R) return null
var/turf/T = R.loc
while(!istype(T, /turf))
T = T.loc
@@ -270,6 +274,7 @@
active_power_usage = 2000
var/obj/machinery/teleport/station/power_station
var/calibrated //Calibration prevents mutation
+ var/admin_usage = 0 // if 1, works on z2. If 0, doesn't. Used for admin room teleport.
/obj/machinery/teleport/hub/New()
..()
@@ -293,10 +298,11 @@
RefreshParts()
/obj/machinery/teleport/hub/initialize()
+ ..()
link_power_station()
/obj/machinery/teleport/hub/Destroy()
- if (power_station)
+ if(power_station)
power_station.teleporter_hub = null
power_station = null
return ..()
@@ -317,7 +323,7 @@
return power_station
/obj/machinery/teleport/hub/Bumped(M as mob|obj)
- if(z == ZLEVEL_CENTCOMM)
+ if(z == ZLEVEL_CENTCOMM && !admin_usage)
to_chat(M, "You can't use this here.")
return
if(power_station && power_station.engaged && !panel_open)
@@ -350,12 +356,12 @@
/obj/machinery/teleport/hub/proc/teleport(atom/movable/M as mob|obj, turf/T)
var/obj/machinery/computer/teleporter/com = power_station.teleporter_console
- if (!com)
+ if(!com)
return
- if (!com.target)
+ if(!com.target)
visible_message("Cannot authenticate locked on coordinates. Please reinstate coordinate matrix.")
return
- if (istype(M, /atom/movable))
+ if(istype(M, /atom/movable))
if(!calibrated && prob(25 - ((accurate) * 10))) //oh dear a problem
do_teleport(M, locate(rand((2*TRANSITIONEDGE), world.maxx - (2*TRANSITIONEDGE)), rand((2*TRANSITIONEDGE), world.maxy - (2*TRANSITIONEDGE)), 3), 2)
else
@@ -379,7 +385,7 @@
use_power = 1
idle_power_usage = 10
active_power_usage = 2000
-
+
var/target
var/tele_delay = 50
@@ -414,7 +420,7 @@
else
do_teleport(M, target)
use_power(5000)
-
+
if(tele_delay)
recalibrating = 1
update_icon()
@@ -471,6 +477,7 @@
link_console_and_hub()
/obj/machinery/teleport/station/initialize()
+ ..()
link_console_and_hub()
/obj/machinery/teleport/station/RefreshParts()
@@ -498,7 +505,7 @@
teleporter_hub.power_station = null
teleporter_hub.update_icon()
teleporter_hub = null
- if (teleporter_console)
+ if(teleporter_console)
teleporter_console.power_station = null
teleporter_console = null
return ..()
@@ -548,12 +555,12 @@
to_chat(user, "Close the maintenance panel first.")
/obj/machinery/teleport/station/proc/toggle(mob/user)
- if (stat & (BROKEN|NOPOWER) || !teleporter_hub || !teleporter_console)
+ if(stat & (BROKEN|NOPOWER) || !teleporter_hub || !teleporter_console)
return
- if (teleporter_hub.panel_open)
+ if(teleporter_hub.panel_open)
to_chat(user, "Close the hub's maintenance panel first.")
return
- if (teleporter_console.target)
+ if(teleporter_console.target)
src.engaged = !src.engaged
use_power(5000)
visible_message("Teleporter [engaged ? "" : "dis"]engaged!")
diff --git a/code/game/machinery/transformer.dm b/code/game/machinery/transformer.dm
index d117961ff88..f34e28dcd18 100644
--- a/code/game/machinery/transformer.dm
+++ b/code/game/machinery/transformer.dm
@@ -227,7 +227,7 @@
playsound(src.loc, 'sound/effects/alert.ogg', 50, 0)
sleep(5)
H.apply_effect((rand(150,200)),IRRADIATE,0)
- if (prob(5))
+ if(prob(5))
if(prob(75))
randmutb(H) // Applies bad mutation
domutcheck(H,null,1)
@@ -244,7 +244,7 @@
badcount++
for(var/obj/item/weapon/kitchen/knife/K in src.loc)
badcount++
- for(var/obj/item/weapon/c4/KK in src.loc)
+ for(var/obj/item/weapon/grenade/plastic/c4/KK in src.loc)
badcount++
for(var/obj/item/weapon/melee/ML in src.loc)
badcount++
diff --git a/code/game/machinery/turntable.dm b/code/game/machinery/turntable.dm
index bb69783db22..9b5f37d33bb 100644
--- a/code/game/machinery/turntable.dm
+++ b/code/game/machinery/turntable.dm
@@ -53,7 +53,7 @@
//for(var/mob/M in world)
// if(M.loc.loc == src.loc.loc && M.music == 0)
// to_chat(world, "Found the song...")
-// to_chat(M, S)
+// M << S
// M.music = 1
var/area/A = src.loc.loc
@@ -64,12 +64,12 @@
for(var/mob/M in world)
if((M.loc.loc in A) && M.music == 0)
// to_chat(world, "Found the song...")
- to_chat(M, S)
+ M << S
M.music = 1
else if(!(M.loc.loc in A) && M.music == 1)
var/sound/Soff = sound(null)
Soff.channel = 10
- to_chat(M, Soff)
+ M << Soff
M.music = 0
sleep(10)
return
@@ -85,7 +85,7 @@
//for(var/mob/M in world)
// if(M.loc.loc == src.loc.loc && M.music == 0)
// to_chat(world, "Found the song...")
-// to_chat(M, S)
+// M << S
// M.music = 1
var/area/A = src.loc.loc
for(var/obj/machinery/party/lasermachine/L in A)
@@ -95,12 +95,12 @@
for(var/mob/M in world)
if(M.loc.loc == src.loc.loc && M.music == 0)
// to_chat(world, "Found the song...")
- to_chat(M, S)
+ M << S
M.music = 1
else if(M.loc.loc != src.loc.loc && M.music == 1)
var/sound/Soff = sound(null)
Soff.channel = 10
- to_chat(M, Soff)
+ M << Soff
M.music = 0
sleep(10)
return
@@ -116,7 +116,7 @@
//for(var/mob/M in world)
// if(M.loc.loc == src.loc.loc && M.music == 0)
// to_chat(world, "Found the song...")
-// to_chat(M, S)
+// M << S
// M.music = 1
var/area/A = src.loc.loc
for(var/obj/machinery/party/lasermachine/L in A)
@@ -126,12 +126,12 @@
for(var/mob/M in world)
if(M.loc.loc == src.loc.loc && M.music == 0)
// to_chat(world, "Found the song...")
- to_chat(M, S)
+ M << S
M.music = 1
else if(M.loc.loc != src.loc.loc && M.music == 1)
var/sound/Soff = sound(null)
Soff.channel = 10
- to_chat(M, Soff)
+ M << Soff
M.music = 0
sleep(10)
return
@@ -143,7 +143,7 @@
S.channel = 10
S.wait = 1
for(var/mob/M in world)
- to_chat(M, S)
+ M << S
M.music = 0
playing = 0
var/area/A = src.loc.loc
diff --git a/code/game/machinery/turret_control.dm b/code/game/machinery/turret_control.dm
index 0deb0d947a3..d27df18523a 100644
--- a/code/game/machinery/turret_control.dm
+++ b/code/game/machinery/turret_control.dm
@@ -45,6 +45,7 @@
return ..()
/obj/machinery/turretid/initialize()
+ ..()
if(!control_area)
control_area = get_area(src)
else if(istext(control_area))
@@ -136,7 +137,7 @@
data["settings"] = settings
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, "turret_control.tmpl", "Turret Controls", 500, 300)
ui.set_initial_data(data)
ui.open()
@@ -184,7 +185,7 @@
TC.ailock = ailock
if(istype(control_area))
- for (var/obj/machinery/porta_turret/aTurret in control_area)
+ for(var/obj/machinery/porta_turret/aTurret in control_area)
aTurret.setState(TC)
update_icon()
@@ -199,8 +200,8 @@
if(stat & NOPOWER)
icon_state = "control_off"
set_light(0)
- else if (enabled)
- if (lethal)
+ else if(enabled)
+ if(lethal)
icon_state = "control_kill"
set_light(1.5, 1,"#990000")
else
diff --git a/code/game/machinery/turrets.dm b/code/game/machinery/turrets.dm
index 82060d47bc2..2589f2620c4 100644
--- a/code/game/machinery/turrets.dm
+++ b/code/game/machinery/turrets.dm
@@ -97,8 +97,8 @@
icon_state = "grey_target_prism"
else
if( powered() )
- if (src.enabled)
- if (src.lasers)
+ if(src.enabled)
+ if(src.lasers)
icon_state = "orange_target_prism"
else
icon_state = "target_prism"
@@ -219,24 +219,23 @@
/obj/machinery/turret/proc/shootAt(var/atom/movable/target)
var/turf/T = get_turf(src)
var/turf/U = get_turf(target)
- if (!T || !U)
+ if(!T || !U)
return
var/obj/item/projectile/A
- if (src.lasers)
+ if(src.lasers)
switch(lasertype)
if(1)
A = new /obj/item/projectile/beam(loc)
if(2)
- A = new /obj/item/projectile/beam/heavylaser(loc)
+ A = new /obj/item/projectile/beam/laser/heavylaser(loc)
if(3)
A = new /obj/item/projectile/beam/pulse(loc)
if(4)
A = new /obj/item/projectile/magic/change(loc)
if(5)
- A = new /obj/item/projectile/lasertag/blue(loc)
+ A = new /obj/item/projectile/beam/lasertag/bluetag(loc)
if(6)
- A = new /obj/item/projectile/lasertag/red(loc)
- A.original = target
+ A = new /obj/item/projectile/beam/lasertag/redtag(loc)
use_power(500)
else
A = new /obj/item/projectile/energy/electrode( loc )
@@ -245,37 +244,37 @@
playsound(get_turf(src), 'sound/weapons/Laser.ogg', 60, 1)
else
playsound(get_turf(src), 'sound/weapons/Taser.ogg', 60, 1)
+ A.original = target
A.current = T
A.yo = U.y - T.y
A.xo = U.x - T.x
- spawn( 0 )
- A.process()
- return
+ A.fire()
+ return A
/obj/machinery/turret/proc/isDown()
return (invisibility!=0)
/obj/machinery/turret/proc/popUp()
- if ((!isPopping()) || src.popping==-1)
+ if((!isPopping()) || src.popping==-1)
invisibility = 0
popping = 1
playsound(get_turf(src), 'sound/effects/turret/open.wav', 60, 1)
- if (src.cover!=null)
+ if(src.cover!=null)
flick("popup", src.cover)
src.cover.icon_state = "openTurretCover"
spawn(10)
- if (popping==1) popping = 0
+ if(popping==1) popping = 0
/obj/machinery/turret/proc/popDown()
- if ((!isPopping()) || src.popping==1)
+ if((!isPopping()) || src.popping==1)
popping = -1
playsound(get_turf(src), 'sound/effects/turret/open.wav', 60, 1)
- if (src.cover!=null)
+ if(src.cover!=null)
flick("popdown", src.cover)
src.cover.icon_state = "turretCover"
spawn(10)
- if (popping==-1)
+ if(popping==-1)
invisibility = INVISIBILITY_LEVEL_TWO
popping = 0
@@ -285,7 +284,7 @@
..()
if(prob(45) && Proj.damage > 0) src.spark_system.start()
qdel(Proj)
- if (src.health <= 0)
+ if(src.health <= 0)
src.die()
return
@@ -295,7 +294,7 @@
playsound(src.loc, 'sound/weapons/smash.ogg', 60, 1)
src.spark_system.start()
src.health -= W.force * 0.5
- if (src.health <= 0)
+ if(src.health <= 0)
src.die()
return
@@ -316,7 +315,7 @@
src.density = 0
src.stat |= BROKEN
src.icon_state = "destroyed_target_prism"
- if (cover!=null)
+ if(cover!=null)
qdel(cover)
sleep(3)
flick("explosion", src)
@@ -333,7 +332,7 @@
add_logs(M, src, "attacked", admin=0)
//src.attack_log += text("\[[time_stamp()]\] was attacked by [M.name] ([M.ckey])")
src.health -= M.melee_damage_upper
- if (src.health <= 0)
+ if(src.health <= 0)
src.die()
else
to_chat(M, "That object is useless to you.")
@@ -349,7 +348,7 @@
playsound(src.loc, 'sound/weapons/slash.ogg', 25, 1, -1)
visible_message("[M] has slashed at [src]!")
src.health -= 15
- if (src.health <= 0)
+ if(src.health <= 0)
src.die()
else
to_chat(M, "\green That object is useless to you.")
@@ -360,22 +359,22 @@
/obj/machinery/turretid/Topic(href, href_list, var/nowindow = 0)
if(..(href, href_list))
return 1
- if (src.locked)
- if (!istype(usr, /mob/living/silicon))
+ if(src.locked)
+ if(!istype(usr, /mob/living/silicon))
to_chat(usr, "Control panel is locked!")
return
- if (href_list["toggleOn"])
+ if(href_list["toggleOn"])
src.enabled = !src.enabled
src.updateTurrets()
- else if (href_list["toggleLethal"])
+ else if(href_list["toggleLethal"])
src.lethal = !src.lethal
src.updateTurrets()
if(!nowindow)
src.attack_hand(usr)
/obj/machinery/turretid/proc/update_icons()
- if (src.enabled)
- if (src.lethal)
+ if(src.enabled)
+ if(src.lethal)
icon_state = "control_kill"
else
icon_state = "control_stun"
@@ -383,7 +382,7 @@
icon_state = "control_standby"
//CODE FIXED BUT REMOVED
// if(control_area) //USE: updates other controls in the area
-// for (var/obj/machinery/turretid/Turret_Control in world) //I'm not sure if this is what it was
+// for(var/obj/machinery/turretid/Turret_Control in world) //I'm not sure if this is what it was
// if( Turret_Control.control_area != src.control_area ) continue //supposed to do. Or whether the person
// Turret_Control.icon_state = icon_state //who coded it originally was just tired
// Turret_Control.enabled = enabled //or something. I don't see any situation
@@ -513,6 +512,8 @@
continue
if(faction in M.faction)
continue
+ if(ispAI(M))
+ continue
pos_targets += M
for(var/obj/mecha/M in oview(scan_range, src))
if(M.occupant)
@@ -543,17 +544,17 @@
if(!src)
return
var/turf/curloc = get_turf(src)
- if (!targloc || !curloc)
+ if(!targloc || !curloc)
return
- if (targloc == curloc)
+ if(targloc == curloc)
return
playsound(get_turf(src), firing_sound, 60, 1)
var/obj/item/projectile/A = new bullet_type(curloc)
+ A.original = target
A.current = curloc
A.yo = targloc.y - curloc.y
A.xo = targloc.x - curloc.x
- spawn(0)
- A.process()
+ A.fire()
return
diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm
index 29880e519ec..feb034b4b0f 100644
--- a/code/game/machinery/vending.dm
+++ b/code/game/machinery/vending.dm
@@ -159,7 +159,7 @@
qdel(src)
return
if(2.0)
- if (prob(50))
+ if(prob(50))
qdel(src)
return
if(3.0)
@@ -208,16 +208,21 @@
break
return total
-/obj/machinery/vending/attackby(obj/item/weapon/W, mob/user, params)
- if (currently_vending && vendor_account && !vendor_account.suspended)
+/obj/machinery/vending/attackby(obj/item/I, mob/user, params)
+ if(currently_vending && vendor_account && !vendor_account.suspended)
var/paid = 0
var/handled = 0
- if(istype(W, /obj/item/weapon/card/id))
- var/obj/item/weapon/card/id/C = W
+ if(istype(I, /obj/item/weapon/card/id))
+ var/obj/item/weapon/card/id/C = I
paid = pay_with_card(C)
handled = 1
- else if (istype(W, /obj/item/weapon/spacecash))
- var/obj/item/weapon/spacecash/C = W
+ if(istype(I, /obj/item/device/pda))
+ var/obj/item/device/pda/PDA = I
+ if(PDA.id)
+ paid = pay_with_card(PDA.id)
+ handled = 1
+ else if(istype(I, /obj/item/weapon/spacecash))
+ var/obj/item/weapon/spacecash/C = I
paid = pay_with_cash(C, user)
handled = 1
@@ -228,10 +233,10 @@
nanomanager.update_uis(src)
return // don't smack that machine with your 2 thalers
- if(default_unfasten_wrench(user, W, time = 60))
+ if(default_unfasten_wrench(user, I, time = 60))
return
- if(istype(W, /obj/item/weapon/screwdriver) && anchored)
+ if(istype(I, /obj/item/weapon/screwdriver) && anchored)
playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1)
panel_open = !panel_open
to_chat(user, "You [panel_open ? "open" : "close"] the maintenance panel.")
@@ -242,9 +247,9 @@
return
if(panel_open)
- if(istype(W, /obj/item/device/multitool)||istype(W, /obj/item/weapon/wirecutters))
+ if(istype(I, /obj/item/device/multitool)||istype(I, /obj/item/weapon/wirecutters))
return attack_hand(user)
- if(component_parts && istype(W, /obj/item/weapon/crowbar))
+ if(component_parts && istype(I, /obj/item/weapon/crowbar))
var/datum/data/vending_product/machine = product_records
for(var/datum/data/vending_product/machine_content in machine)
while(machine_content.amount !=0)
@@ -253,21 +258,21 @@
machine_content.amount--
if(!machine_content.amount)
break
- default_deconstruction_crowbar(W)
- if(istype(W, /obj/item/weapon/coin) && premium.len > 0)
+ default_deconstruction_crowbar(I)
+ if(istype(I, /obj/item/weapon/coin) && premium.len > 0)
user.drop_item()
- W.loc = src
- coin = W
+ I.loc = src
+ coin = I
categories |= CAT_COIN
- to_chat(user, "\blue You insert the [W] into the [src]")
+ to_chat(user, "\blue You insert the [I] into the [src]")
nanomanager.update_uis(src)
return
- else if(istype(W, refill_canister) && refill_canister != null)
+ else if(istype(I, refill_canister) && refill_canister != null)
if(stat & (BROKEN|NOPOWER))
to_chat(user, "It does nothing.")
else if(panel_open)
//if the panel is open we attempt to refill the machine
- var/obj/item/weapon/vending_refill/canister = W
+ var/obj/item/weapon/vending_refill/canister = I
if(canister.charges == 0)
to_chat(user, "This [canister.name] is empty!")
else
@@ -296,7 +301,7 @@
if(currently_vending.price > cashmoney.get_total())
// This is not a status display message, since it's something the character
// themselves is meant to see BEFORE putting the money in
- to_chat(usr, "\icon[cashmoney] That is not enough money.")
+ to_chat(usr, "[bicon(cashmoney)] That is not enough money.")
return 0
// Bills (banknotes) cannot really have worth different than face value,
@@ -327,7 +332,7 @@
return pay_with_account(get_card_account(I))
/obj/machinery/vending/proc/pay_with_account(var/datum/money_account/customer_account)
- if (!customer_account)
+ if(!customer_account)
src.status_message = "Error: Unable to access account. Please contact technical support if problem persists."
src.status_error = 1
return 0
@@ -443,7 +448,7 @@
data["panel"] = 0
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, "vending_machine.tmpl", src.name, 440, 600)
ui.set_initial_data(data)
ui.open()
@@ -462,7 +467,7 @@
to_chat(usr, "\blue You remove the [coin] from the [src]")
categories &= ~CAT_COIN
- if (href_list["pay"])
+ if(href_list["pay"])
if(currently_vending && vendor_account && !vendor_account.suspended)
var/paid = 0
var/handled = 0
@@ -480,8 +485,8 @@
nanomanager.update_uis(src)
return // don't smack that machine with your 2 credits
- if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))))
- if ((href_list["vend"]) && (src.vend_ready) && (!currently_vending))
+ if((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))))
+ if((href_list["vend"]) && (src.vend_ready) && (!currently_vending))
if(issilicon(usr) && !isrobot(usr))
to_chat(usr, "The vending machine refuses to interface with you, as you are not in its target demographic!")
@@ -511,10 +516,10 @@
src.status_message = "Please swipe a card or insert cash to pay for the item."
src.status_error = 0
- else if (href_list["cancelpurchase"])
+ else if(href_list["cancelpurchase"])
src.currently_vending = null
- else if ((href_list["togglevoice"]) && (src.panel_open))
+ else if((href_list["togglevoice"]) && (src.panel_open))
src.shut_up = !src.shut_up
src.add_fingerprint(usr)
@@ -534,7 +539,7 @@
src.status_error = 0
nanomanager.update_uis(src)
- if (R.category & CAT_COIN)
+ if(R.category & CAT_COIN)
if(!coin)
to_chat(user, "\blue You need to insert a coin to get this item.")
return
@@ -559,7 +564,7 @@
src.last_reply = world.time
use_power(vend_power_usage) //actuators and stuff
- if (src.icon_vend) //Show the vending animation if needed
+ if(src.icon_vend) //Show the vending animation if needed
flick(src.icon_vend,src)
spawn(src.vend_delay)
new R.product_path(get_turf(src))
@@ -601,7 +606,7 @@
if(stat & NOPOWER)
return
- if (!message)
+ if(!message)
return
for(var/mob/O in hearers(src, null))
@@ -623,10 +628,10 @@
//Oh no we're malfunctioning! Dump out some product and break.
/obj/machinery/vending/proc/malfunction()
for(var/datum/data/vending_product/R in src.product_records)
- if (R.amount <= 0) //Try to use a record that actually has something to dump.
+ if(R.amount <= 0) //Try to use a record that actually has something to dump.
continue
var/dump_path = R.product_path
- if (!dump_path)
+ if(!dump_path)
continue
while(R.amount>0)
@@ -646,16 +651,16 @@
return 0
for(var/datum/data/vending_product/R in src.product_records)
- if (R.amount <= 0) //Try to use a record that actually has something to dump.
+ if(R.amount <= 0) //Try to use a record that actually has something to dump.
continue
var/dump_path = R.product_path
- if (!dump_path)
+ if(!dump_path)
continue
R.amount--
throw_item = new dump_path(src.loc)
break
- if (!throw_item)
+ if(!throw_item)
return 0
spawn(0)
throw_item.throw_at(target, 16, 3, src)
@@ -698,7 +703,7 @@
icon_deny = "boozeomat-deny"
products = list(/obj/item/weapon/reagent_containers/food/drinks/bottle/gin = 5,
/obj/item/weapon/reagent_containers/food/drinks/bottle/whiskey = 5,
- /obj/item/weapon/reagent_containers/food/drinks/bottle/tequilla = 5,
+ /obj/item/weapon/reagent_containers/food/drinks/bottle/tequila = 5,
/obj/item/weapon/reagent_containers/food/drinks/bottle/vodka = 5,
/obj/item/weapon/reagent_containers/food/drinks/bottle/vermouth = 5,
/obj/item/weapon/reagent_containers/food/drinks/bottle/rum = 5,
@@ -849,7 +854,7 @@
product_ads = "Float like an astronaut, sting like a bullet!;Express your second amendment today!;Guns don't kill people, but you can!;Who needs responsibilities when you have guns?"
vend_reply = "Remember the name: Liberation Station!"
products = list(/obj/item/weapon/gun/projectile/automatic/pistol/deagle/gold = 2,/obj/item/weapon/gun/projectile/automatic/pistol/deagle/camo = 2,
- /obj/item/weapon/gun/projectile/automatic/pistol/m2411 = 2,/obj/item/weapon/gun/projectile/automatic/proto = 2,
+ /obj/item/weapon/gun/projectile/automatic/pistol/m1911 = 2,/obj/item/weapon/gun/projectile/automatic/proto = 2,
/obj/item/weapon/gun/projectile/shotgun/automatic/combat = 2,/obj/item/weapon/gun/projectile/automatic/gyropistol = 1,
/obj/item/weapon/gun/projectile/shotgun = 2,/obj/item/weapon/gun/projectile/automatic/ar = 2)
premium = list(/obj/item/ammo_box/magazine/smgm9mm = 2,/obj/item/ammo_box/magazine/m50 = 4,/obj/item/ammo_box/magazine/m45 = 2,/obj/item/ammo_box/magazine/m75 = 2)
@@ -888,8 +893,8 @@
products = list(/obj/item/weapon/reagent_containers/glass/bottle/charcoal = 4,/obj/item/weapon/reagent_containers/glass/bottle/morphine = 4,/obj/item/weapon/reagent_containers/glass/bottle/ether = 4,/obj/item/weapon/reagent_containers/glass/bottle/epinephrine = 4,
/obj/item/weapon/reagent_containers/glass/bottle/toxin = 4,/obj/item/weapon/reagent_containers/syringe/antiviral = 6,/obj/item/weapon/reagent_containers/syringe/insulin = 4,
/obj/item/weapon/reagent_containers/syringe = 12,/obj/item/device/healthanalyzer = 5,/obj/item/device/healthupgrade = 5,/obj/item/weapon/reagent_containers/glass/beaker = 4,
- /obj/item/weapon/reagent_containers/dropper = 2,/obj/item/stack/medical/advanced/bruise_pack = 3, /obj/item/stack/medical/advanced/ointment = 3,
- /obj/item/stack/medical/bruise_pack = 3,/obj/item/stack/medical/splint = 2, /obj/item/device/sensor_device = 2)
+ /obj/item/weapon/reagent_containers/dropper = 2,/obj/item/stack/medical/bruise_pack/advanced = 3, /obj/item/stack/medical/ointment/advanced = 3,
+ /obj/item/stack/medical/bruise_pack = 3,/obj/item/stack/medical/splint = 4, /obj/item/device/sensor_device = 2)
contraband = list(/obj/item/weapon/reagent_containers/glass/bottle/pancuronium = 1,/obj/item/weapon/reagent_containers/glass/bottle/sulfonal = 1)
@@ -942,7 +947,7 @@
icon_deny = "sec-deny"
req_access_txt = "1"
products = list(/obj/item/weapon/restraints/handcuffs = 8,/obj/item/weapon/restraints/handcuffs/cable/zipties = 8,/obj/item/weapon/grenade/flashbang = 4,/obj/item/device/flash = 5,
- /obj/item/weapon/reagent_containers/food/snacks/donut/normal = 12,/obj/item/weapon/storage/box/evidence = 6,/obj/item/device/flashlight/seclite = 4)
+ /obj/item/weapon/reagent_containers/food/snacks/donut/normal = 12,/obj/item/weapon/storage/box/evidence = 6,/obj/item/device/flashlight/seclite = 4,/obj/item/weapon/restraints/legcuffs/bola/energy = 7)
contraband = list(/obj/item/clothing/glasses/sunglasses = 2,/obj/item/weapon/storage/fancy/donut_box = 2,/obj/item/device/hailer = 5)
/obj/machinery/vending/hydronutrients
@@ -1114,7 +1119,7 @@
icon_state = "engi"
icon_deny = "engi-deny"
req_access_txt = "11"
- products = list(/obj/item/clothing/under/rank/chief_engineer = 4,/obj/item/clothing/under/rank/engineer = 4,/obj/item/clothing/shoes/orange = 4,/obj/item/clothing/head/hardhat = 4,
+ products = list(/obj/item/clothing/under/rank/chief_engineer = 4,/obj/item/clothing/under/rank/engineer = 4,/obj/item/clothing/shoes/workboots = 4,/obj/item/clothing/head/hardhat = 4,
/obj/item/weapon/storage/belt/utility = 4,/obj/item/clothing/glasses/meson = 4,/obj/item/clothing/gloves/color/yellow = 4, /obj/item/weapon/screwdriver = 12,
/obj/item/weapon/crowbar = 12,/obj/item/weapon/wirecutters = 12,/obj/item/device/multitool = 12,/obj/item/weapon/wrench = 12,/obj/item/device/t_scanner = 12,
/obj/item/stack/cable_coil/heavyduty = 8, /obj/item/weapon/stock_parts/cell = 8, /obj/item/weapon/weldingtool = 8,/obj/item/clothing/head/welding = 8,
@@ -1152,7 +1157,7 @@
icon_state = "sustenance"
products = list(/obj/item/weapon/reagent_containers/food/snacks/tofu = 24,
/obj/item/weapon/reagent_containers/food/drinks/ice = 12,
- /obj/item/weapon/reagent_containers/food/snacks/candy_corn = 6)
+ /obj/item/weapon/reagent_containers/food/snacks/candy/candy_corn = 6)
contraband = list(/obj/item/weapon/kitchen/knife = 6)
/obj/machinery/vending/hatdispenser
diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm
index 6889cf67c42..e075457a9e5 100644
--- a/code/game/machinery/washing_machine.dm
+++ b/code/game/machinery/washing_machine.dm
@@ -145,7 +145,7 @@
G.desc = new_desc
if(new_shoe_icon_state && new_shoe_name)
for(var/obj/item/clothing/shoes/S in contents)
- if (S.chained == 1)
+ if(S.chained == 1)
S.chained = 0
S.slowdown = SHOES_SLOWDOWN
new /obj/item/weapon/restraints/handcuffs( src )
@@ -229,43 +229,43 @@
istype(W,/obj/item/weapon/bedsheet))
//YES, it's hardcoded... saves a var/can_be_washed for every single clothing item.
- if ( istype(W,/obj/item/clothing/suit/space ) )
+ if( istype(W,/obj/item/clothing/suit/space ) )
to_chat(user, "This item does not fit.")
return
- if ( istype(W,/obj/item/clothing/suit/syndicatefake ) )
+ if( istype(W,/obj/item/clothing/suit/syndicatefake ) )
to_chat(user, "This item does not fit.")
return
-// if ( istype(W,/obj/item/clothing/suit/powered ) )
+// if( istype(W,/obj/item/clothing/suit/powered ) )
// to_chat(user, "This item does not fit.")
// return
- if ( istype(W,/obj/item/clothing/suit/cyborg_suit ) )
+ if( istype(W,/obj/item/clothing/suit/cyborg_suit ) )
to_chat(user, "This item does not fit.")
return
- if ( istype(W,/obj/item/clothing/suit/bomb_suit ) )
+ if( istype(W,/obj/item/clothing/suit/bomb_suit ) )
to_chat(user, "This item does not fit.")
return
- if ( istype(W,/obj/item/clothing/suit/armor ) )
+ if( istype(W,/obj/item/clothing/suit/armor ) )
to_chat(user, "This item does not fit.")
return
- if ( istype(W,/obj/item/clothing/suit/armor ) )
+ if( istype(W,/obj/item/clothing/suit/armor ) )
to_chat(user, "This item does not fit.")
return
- if ( istype(W,/obj/item/clothing/mask/gas ) )
+ if( istype(W,/obj/item/clothing/mask/gas ) )
to_chat(user, "This item does not fit.")
return
- if ( istype(W,/obj/item/clothing/mask/cigarette ) )
+ if( istype(W,/obj/item/clothing/mask/cigarette ) )
to_chat(user, "This item does not fit.")
return
- if ( istype(W,/obj/item/clothing/head/syndicatefake ) )
+ if( istype(W,/obj/item/clothing/head/syndicatefake ) )
to_chat(user, "This item does not fit.")
return
-// if ( istype(W,/obj/item/clothing/head/powered ) )
+// if( istype(W,/obj/item/clothing/head/powered ) )
// to_chat(user, "This item does not fit.")
// return
- if ( istype(W,/obj/item/clothing/head/helmet ) )
+ if( istype(W,/obj/item/clothing/head/helmet ) )
to_chat(user, "This item does not fit.")
return
- if ( istype(W,/obj/item/clothing/gloves/furgloves ) )
+ if( istype(W,/obj/item/clothing/gloves/furgloves ) )
to_chat(user, "This item does not fit.")
return
if(W.flags & NODROP) //if "can't drop" item
@@ -273,7 +273,7 @@
return
if(contents.len < 5)
- if ( state in list(1, 3) )
+ if( state in list(1, 3) )
user.drop_item()
W.loc = src
state = 3
diff --git a/code/game/mecha/combat/durand.dm b/code/game/mecha/combat/durand.dm
index a5a8e44e165..cfe94888123 100644
--- a/code/game/mecha/combat/durand.dm
+++ b/code/game/mecha/combat/durand.dm
@@ -71,7 +71,7 @@
/obj/mecha/combat/durand/Topic(href, href_list)
..()
- if (href_list["toggle_defence_mode"])
+ if(href_list["toggle_defence_mode"])
src.defence_mode()
return
diff --git a/code/game/mecha/combat/gygax.dm b/code/game/mecha/combat/gygax.dm
index 26d9d066fd8..09caf2fcaf0 100644
--- a/code/game/mecha/combat/gygax.dm
+++ b/code/game/mecha/combat/gygax.dm
@@ -113,6 +113,6 @@
/obj/mecha/combat/gygax/Topic(href, href_list)
..()
- if (href_list["toggle_leg_overload"])
+ if(href_list["toggle_leg_overload"])
src.overload()
return
\ No newline at end of file
diff --git a/code/game/mecha/combat/honker.dm b/code/game/mecha/combat/honker.dm
index d8ef8c8b9fe..4bfd5f9a161 100644
--- a/code/game/mecha/combat/honker.dm
+++ b/code/game/mecha/combat/honker.dm
@@ -139,7 +139,7 @@
obj/mecha/combat/honker/Topic(href, href_list)
..()
- if (href_list["play_sound"])
+ if(href_list["play_sound"])
switch(href_list["play_sound"])
if("sadtrombone")
playsound(src, 'sound/misc/sadtrombone.ogg', 50)
@@ -148,7 +148,7 @@ obj/mecha/combat/honker/Topic(href, href_list)
proc/rand_hex_color()
var/list/colors = list("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f")
var/color=""
- for (var/i=0;i<6;i++)
+ for(var/i=0;i<6;i++)
color = color+pick(colors)
return color
diff --git a/code/game/mecha/combat/marauder.dm b/code/game/mecha/combat/marauder.dm
index 0d7676d75b7..b34897764e2 100644
--- a/code/game/mecha/combat/marauder.dm
+++ b/code/game/mecha/combat/marauder.dm
@@ -8,6 +8,7 @@
deflect_chance = 25
damage_absorption = list("brute"=0.5,"fire"=0.7,"bullet"=0.45,"laser"=0.6,"energy"=0.7,"bomb"=0.7)
max_temperature = 60000
+ burn_state = LAVA_PROOF
infra_luminosity = 3
var/zoom = 0
var/thrusters = 0
@@ -188,10 +189,10 @@
/obj/mecha/combat/marauder/Topic(href, href_list)
..()
- if (href_list["toggle_thrusters"])
+ if(href_list["toggle_thrusters"])
src.toggle_thrusters()
- if (href_list["smoke"])
+ if(href_list["smoke"])
src.smoke()
- if (href_list["toggle_zoom"])
+ if(href_list["toggle_zoom"])
src.zoom()
return
\ No newline at end of file
diff --git a/code/game/mecha/combat/phazon.dm b/code/game/mecha/combat/phazon.dm
index a4edcb4a89a..595fa67ea00 100644
--- a/code/game/mecha/combat/phazon.dm
+++ b/code/game/mecha/combat/phazon.dm
@@ -85,9 +85,9 @@
/obj/mecha/combat/phazon/Topic(href, href_list)
..()
- if (href_list["switch_damtype"])
+ if(href_list["switch_damtype"])
src.switch_damtype()
- if (href_list["phasing"])
+ if(href_list["phasing"])
phasing = !phasing
send_byjax(src.occupant,"exosuit.browser","phasing_command","[phasing?"Dis":"En"]able phasing")
src.occupant_message("En":"#f00\">Dis"]abled phasing.")
diff --git a/code/game/mecha/equipment/mecha_equipment.dm b/code/game/mecha/equipment/mecha_equipment.dm
index 1967f1e6645..b7aeaed66cc 100644
--- a/code/game/mecha/equipment/mecha_equipment.dm
+++ b/code/game/mecha/equipment/mecha_equipment.dm
@@ -133,7 +133,7 @@
/obj/item/mecha_parts/mecha_equipment/proc/occupant_message(message)
if(chassis)
- chassis.occupant_message("\icon[src] [message]")
+ chassis.occupant_message("[bicon(src)] [message]")
return
/obj/item/mecha_parts/mecha_equipment/proc/log_message(message)
diff --git a/code/game/mecha/equipment/tools/medical_tools.dm b/code/game/mecha/equipment/tools/medical_tools.dm
index f79c43068ee..05b3dac0e63 100644
--- a/code/game/mecha/equipment/tools/medical_tools.dm
+++ b/code/game/mecha/equipment/tools/medical_tools.dm
@@ -384,7 +384,7 @@
/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun
name = "Syringe Gun"
desc = "Exosuit-mounted chem synthesizer with syringe gun. Reagents inside are held in stasis, so no reactions will occur. (Can be attached to: Medical Exosuits)"
- icon = 'icons/obj/gun.dmi'
+ icon = 'icons/obj/guns/projectile.dmi'
icon_state = "syringegun"
item_state = "syringegun"
lefthand_file = 'icons/mob/inhands/guns_lefthand.dmi'
@@ -666,4 +666,4 @@
for(var/reagent in S.processed_reagents)
S.reagents.add_reagent(reagent,amount)
S.chassis.use_power(energy_drain)
- return 1
\ No newline at end of file
+ return 1
diff --git a/code/game/mecha/equipment/tools/tools.dm b/code/game/mecha/equipment/tools/tools.dm
index 98db55e0f25..cb55c783005 100644
--- a/code/game/mecha/equipment/tools/tools.dm
+++ b/code/game/mecha/equipment/tools/tools.dm
@@ -296,7 +296,7 @@
//meh
switch(mode)
if(0)
- if (istype(target, /turf/simulated/wall))
+ if(istype(target, /turf/simulated/wall))
if(istype(target, /turf/simulated/wall/r_wall) && !canRwall)
return 0
occupant_message("Deconstructing [target]...")
@@ -306,7 +306,7 @@
target:ChangeTurf(/turf/simulated/floor/plating)
playsound(target, 'sound/items/Deconstruct.ogg', 50, 1)
chassis.use_power(energy_drain)
- else if (istype(target, /turf/simulated/floor))
+ else if(istype(target, /turf/simulated/floor))
occupant_message("Deconstructing [target]...")
set_ready_state(0)
if(do_after_cooldown(target))
@@ -314,7 +314,7 @@
target:ChangeTurf(/turf/space)
playsound(target, 'sound/items/Deconstruct.ogg', 50, 1)
chassis.use_power(energy_drain)
- else if (istype(target, /obj/machinery/door/airlock))
+ else if(istype(target, /obj/machinery/door/airlock))
occupant_message("Deconstructing [target]...")
set_ready_state(0)
if(do_after_cooldown(target))
@@ -382,6 +382,7 @@
range = RANGED
action(atom/target)
+ // TODO: Tie into space manager
if(!action_checks(target) || (src.loc.z in config.admin_levels)) return
var/turf/T = get_turf(target)
if(T)
@@ -403,6 +404,7 @@
action(atom/target)
+ // TODO: Tie into space manager
if(!action_checks(target) || (src.loc.z in config.admin_levels)) return
var/list/theareas = list()
for(var/area/AR in orange(100, chassis))
@@ -1144,4 +1146,4 @@
if(do_after_cooldown(target))
new /obj/structure/barricade/mime/mrcd(target)
chassis.spark_system.start()
- chassis.use_power(energy_drain*2)
\ No newline at end of file
+ chassis.use_power(energy_drain*2)
diff --git a/code/game/mecha/equipment/weapons/weapons.dm b/code/game/mecha/equipment/weapons/weapons.dm
index d95cbaff799..00d2fcef75b 100644
--- a/code/game/mecha/equipment/weapons/weapons.dm
+++ b/code/game/mecha/equipment/weapons/weapons.dm
@@ -5,6 +5,10 @@
var/projectile
var/fire_sound
var/size=0
+ var/projectiles_per_shot = 1
+ var/variance = 0
+ var/randomspread = 0 //use random spread for machineguns, instead of shotgun scatter
+ var/projectile_delay = 0
/obj/item/mecha_parts/mecha_equipment/weapon/can_attach(var/obj/mecha/combat/M as obj)
if(..())
@@ -12,36 +16,55 @@
if(size > M.maxsize)
return 0
return 1
- else if (M.emagged == 1)
+ else if(M.emagged == 1)
return 1
return 0
+/obj/item/mecha_parts/mecha_equipment/weapon/proc/get_shot_amount()
+ return projectiles_per_shot
-/obj/item/mecha_parts/mecha_equipment/weapon/energy
- name = "General Energy Weapon"
- size = 2
- action(target)
- if(!action_checks(target)) return
- var/turf/curloc = chassis.loc
- var/atom/targloc = get_turf(target)
- if (!targloc || !istype(targloc, /turf) || !curloc)
- return
- if (targloc == curloc)
- return
- set_ready_state(0)
- playsound(chassis, fire_sound, 50, 1)
+/obj/item/mecha_parts/mecha_equipment/weapon/action(target, params)
+ if(!action_checks(target))
+ return 0
+
+ var/turf/curloc = get_turf(chassis)
+ var/turf/targloc = get_turf(target)
+ if(!targloc || !istype(targloc) || !curloc)
+ return 0
+ if(targloc == curloc)
+ return 0
+
+ set_ready_state(0)
+ for(var/i=1 to get_shot_amount())
var/obj/item/projectile/A = new projectile(curloc)
A.firer = chassis.occupant
A.original = target
A.current = curloc
- A.yo = targloc.y - curloc.y
- A.xo = targloc.x - curloc.x
- chassis.use_power(energy_drain)
- A.process()
- chassis.log_message("Fired from [src.name], targeting [target].")
- do_after_cooldown()
- return
+ var/spread = 0
+ if(variance)
+ if(randomspread)
+ spread = round((rand() - 0.5) * variance)
+ else
+ spread = round((i / projectiles_per_shot - 0.5) * variance)
+ A.preparePixelProjectile(target, targloc, chassis.occupant, params, spread)
+
+ chassis.use_power(energy_drain)
+ A.fire()
+ playsound(chassis, fire_sound, 50, 1)
+
+ sleep(max(0, projectile_delay))
+ set_ready_state(0)
+ log_message("Fired from [name], targeting [target].")
+ var/turf/T = get_turf(src)
+ msg_admin_attack("[key_name_admin(chassis.occupant)] fired a [src] in ([T.x], [T.y], [T.z] - JMP)")
+ log_game("[key_name(chassis.occupant)] fired a [src] in [T.x], [T.y], [T.z]")
+ do_after_cooldown()
+ return
+
+/obj/item/mecha_parts/mecha_equipment/weapon/energy
+ name = "General Energy Weapon"
+ size = 2
/obj/item/mecha_parts/mecha_equipment/weapon/energy/laser
equip_cooldown = 8
@@ -56,7 +79,7 @@
name = "CH-LC \"Solaris\" Laser Cannon"
icon_state = "mecha_laser"
energy_drain = 40
- projectile = /obj/item/projectile/beam/heavylaser
+ projectile = /obj/item/projectile/beam/laser/heavylaser
fire_sound = 'sound/weapons/lasercannonfire.ogg'
/obj/item/mecha_parts/mecha_equipment/weapon/energy/ion
@@ -82,25 +105,25 @@
icon_state = "pulse1_bl"
var/life = 20
- Bump(atom/A)
- A.bullet_act(src, def_zone)
- src.life -= 10
- if(ismob(A))
- var/mob/M = A
- if(istype(firer, /mob))
- M.attack_log += "\[[time_stamp()]\] [firer]/[firer.ckey] shot [M]/[M.ckey] with a [src]"
- firer.attack_log += "\[[time_stamp()]\] [firer]/[firer.ckey] shot [M]/[M.ckey] with a [src]"
- log_attack("[firer] ([firer.ckey]) shot [M] ([M.ckey]) with a [src]")
- if(!iscarbon(firer))
- M.LAssailant = null
- else
- M.LAssailant = firer
+/obj/item/projectile/beam/pulse/heavy/Bump(atom/A)
+ A.bullet_act(src, def_zone)
+ life -= 10
+ if(ismob(A))
+ var/mob/M = A
+ if(istype(firer, /mob))
+ M.attack_log += "\[[time_stamp()]\] [firer]/[firer.ckey] shot [M]/[M.ckey] with a [src]"
+ firer.attack_log += "\[[time_stamp()]\] [firer]/[firer.ckey] shot [M]/[M.ckey] with a [src]"
+ log_attack("[firer] ([firer.ckey]) shot [M] ([M.ckey]) with a [src]")
+ if(!iscarbon(firer))
+ M.LAssailant = null
else
- M.attack_log += "\[[time_stamp()]\] UNKNOWN SUBJECT (No longer exists) shot [M]/[M.ckey] with a [src]"
- log_attack("UNKNOWN shot [M] ([M.ckey]) with a [src]")
- if(life <= 0)
- qdel(src)
- return
+ M.LAssailant = firer
+ else
+ M.attack_log += "\[[time_stamp()]\] UNKNOWN SUBJECT (No longer exists) shot [M]/[M.ckey] with a [src]"
+ log_attack("UNKNOWN shot [M] ([M.ckey]) with a [src]")
+ if(life <= 0)
+ qdel(src)
+ return
/obj/item/mecha_parts/mecha_equipment/weapon/energy/taser
@@ -119,89 +142,89 @@
equip_cooldown = 150
range = MELEE|RANGED
- can_attach(obj/mecha/combat/honker/M as obj)
- if(..())
- if(istype(M))
- return 1
+/obj/item/mecha_parts/mecha_equipment/weapon/honker/can_attach(obj/mecha/combat/honker/M as obj)
+ if(..())
+ if(istype(M))
+ return 1
+ return 0
+
+/obj/item/mecha_parts/mecha_equipment/weapon/honker/action(target, params)
+ if(!chassis)
+ return 0
+ if(energy_drain && chassis.get_charge() < energy_drain)
+ return 0
+ if(!equip_ready)
return 0
- action(target)
- if(!chassis)
- return 0
- if(energy_drain && chassis.get_charge() < energy_drain)
- return 0
- if(!equip_ready)
- return 0
+ playsound(chassis, 'sound/items/AirHorn.ogg', 100, 1)
+ chassis.occupant_message("HONK")
+ for(var/mob/living/carbon/M in ohearers(6, chassis))
+ if(istype(M, /mob/living/carbon/human))
+ var/mob/living/carbon/human/H = M
+ if(istype(H.l_ear, /obj/item/clothing/ears/earmuffs) || istype(H.r_ear, /obj/item/clothing/ears/earmuffs))
+ continue
+ to_chat(M, "HONK")
+ M.sleeping = 0
+ M.stuttering = 20
+ M.adjustEarDamage(0,30)
+ M.Weaken(3)
+ if(prob(30))
+ M.Stun(10)
+ M.Paralyse(4)
+ else
+ M.Jitter(500)
+ ///else the mousetraps are useless
+ if(istype(M, /mob/living/carbon/human))
+ var/mob/living/carbon/human/H = M
+ if(isobj(H.shoes))
+ var/thingy = H.shoes
+ H.unEquip(H.shoes)
+ walk_away(thingy,chassis,15,2)
+ spawn(20)
+ if(thingy)
+ walk(thingy,0)
+ for(var/obj/mecha/combat/recitence/R in oview(6, chassis))
+ R.occupant_message("\The [R] has protected you from [chassis]'s HONK at the cost of some power.")
+ R.use_power(R.get_charge() / 4)
- playsound(chassis, 'sound/items/AirHorn.ogg', 100, 1)
- chassis.occupant_message("HONK")
- for(var/mob/living/carbon/M in ohearers(6, chassis))
- if(istype(M, /mob/living/carbon/human))
- var/mob/living/carbon/human/H = M
- if(istype(H.l_ear, /obj/item/clothing/ears/earmuffs) || istype(H.r_ear, /obj/item/clothing/ears/earmuffs))
- continue
- to_chat(M, "HONK")
- M.sleeping = 0
- M.stuttering = 20
- M.ear_deaf = 30
- M.Weaken(3)
- if(prob(30))
- M.Stun(10)
- M.Paralyse(4)
- else
- M.Jitter(500)
- ///else the mousetraps are useless
- if(istype(M, /mob/living/carbon/human))
- var/mob/living/carbon/human/H = M
- if(isobj(H.shoes))
- var/thingy = H.shoes
- H.unEquip(H.shoes)
- walk_away(thingy,chassis,15,2)
- spawn(20)
- if(thingy)
- walk(thingy,0)
- for(var/obj/mecha/combat/recitence/R in oview(6, chassis))
- R.occupant_message("\The [R] has protected you from [chassis]'s HONK at the cost of some power.")
- R.use_power(R.get_charge() / 4)
-
- chassis.use_power(energy_drain)
- log_message("Honked from [src.name]. HONK!")
- var/turf/T = get_turf(src)
- msg_admin_attack("[key_name_admin(chassis.occupant)] used a Mecha Honker in ([T.x], [T.y], [T.z] - JMP)")
- log_game("[key_name(chassis.occupant)] used a Mecha Honker in [T.x], [T.y], [T.z]")
- do_after_cooldown()
- return
+ chassis.use_power(energy_drain)
+ log_message("Honked from [name]. HONK!")
+ var/turf/T = get_turf(src)
+ msg_admin_attack("[key_name_admin(chassis.occupant)] used a Mecha Honker in ([T.x], [T.y], [T.z] - JMP)")
+ log_game("[key_name(chassis.occupant)] used a Mecha Honker in [T.x], [T.y], [T.z]")
+ do_after_cooldown()
+ return
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic
name = "General Ballisic Weapon"
var/projectiles
var/projectile_energy_cost
size = 2
- action_checks(atom/target)
- if(..())
- if(projectiles > 0)
- return 1
- return 0
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/action_checks(atom/target)
+ if(..())
+ if(projectiles > 0)
+ return 1
+ return 0
- get_equip_info()
- return "[..()]\[[src.projectiles]\][(src.projectiles < initial(src.projectiles))?" - Rearm":null]"
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/get_equip_info()
+ return "[..()]\[[projectiles]\][(projectiles < initial(projectiles))?" - Rearm":null]"
- proc/rearm()
- if(projectiles < initial(projectiles))
- var/projectiles_to_add = initial(projectiles) - projectiles
- while(chassis.get_charge() >= projectile_energy_cost && projectiles_to_add)
- projectiles++
- projectiles_to_add--
- chassis.use_power(projectile_energy_cost)
- send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
- log_message("Rearmed [src.name].")
- return
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/proc/rearm()
+ if(projectiles < initial(projectiles))
+ var/projectiles_to_add = initial(projectiles) - projectiles
+ while(chassis.get_charge() >= projectile_energy_cost && projectiles_to_add)
+ projectiles++
+ projectiles_to_add--
+ chassis.use_power(projectile_energy_cost)
+ send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",get_equip_info())
+ log_message("Rearmed [name].")
+ return
- Topic(href, href_list)
- ..()
- if (href_list["rearm"])
- src.rearm()
- return
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/Topic(href, href_list)
+ ..()
+ if(href_list["rearm"])
+ rearm()
+ return
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/carbine
name = "FNX-66 Carbine"
@@ -211,41 +234,6 @@
fire_sound = 'sound/weapons/Gunshot.ogg'
projectiles = 24
projectile_energy_cost = 15
- var/projectiles_per_shot = 1
- var/deviation = 0.0
-
- action(atom/target)
- if(!action_checks(target)) return
- var/turf/targloc = get_turf(target)
- var/target_x = targloc.x
- var/target_y = targloc.y
- var/target_z = targloc.z
- targloc = null
- spawn for(var/i=1 to min(projectiles, projectiles_per_shot))
- if(!chassis) break
- var/turf/curloc = get_turf(chassis)
- targloc = locate(target_x+GaussRandRound(deviation,1),target_y+GaussRandRound(deviation,1),target_z)
- if (!targloc || !curloc)
- continue
- if (targloc == curloc)
- continue
-
- playsound(chassis, fire_sound, 50, 1)
- var/obj/item/projectile/A = new projectile(curloc)
- src.projectiles--
- A.original = target
- A.current = curloc
- A.yo = targloc.y - curloc.y
- A.xo = targloc.x - curloc.x
- A.process()
- sleep(2)
- set_ready_state(0)
- log_message("Fired from [src.name], targeting [target].")
- var/turf/T = get_turf(src)
- msg_admin_attack("[key_name_admin(chassis.occupant)] fired a [src] in ([T.x], [T.y], [T.z] - JMP)")
- log_game("[key_name(chassis.occupant)] fired a [src] in [T.x], [T.y], [T.z]")
- do_after_cooldown()
- return
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/carbine/silenced
name = "\improper S.H.H. \"Quietus\" Carbine"
@@ -270,36 +258,8 @@
fire_sound = 'sound/weapons/Gunshot.ogg'
projectiles = 40
projectile_energy_cost = 25
- var/projectiles_per_shot = 4
- var/deviation = 0.7
-
- action(atom/target)
- if(!action_checks(target)) return
- var/turf/curloc = get_turf(chassis)
- var/turf/targloc = get_turf(target)
- if(!curloc || !targloc) return
- var/target_x = targloc.x
- var/target_y = targloc.y
- var/target_z = targloc.z
- targloc = null
- for(var/i=1 to min(projectiles, projectiles_per_shot))
- targloc = locate(target_x+GaussRandRound(deviation,1),target_y+GaussRandRound(deviation,1),target_z)
- if(!targloc || targloc == curloc)
- break
- playsound(chassis, fire_sound, 80, 1)
- var/obj/item/projectile/A = new projectile(curloc)
- src.projectiles--
- A.original = target
- A.current = curloc
- A.yo = targloc.y - curloc.y
- A.xo = targloc.x - curloc.x
- set_ready_state(0)
- A.process()
- log_message("Fired from [src.name], targeting [target].")
- do_after_cooldown()
- return
-
-
+ projectiles_per_shot = 4
+ variance = 25
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/lmg
name = "Ultra AC 2"
@@ -309,38 +269,9 @@
fire_sound = 'sound/weapons/Gunshot.ogg'
projectiles = 300
projectile_energy_cost = 20
- var/projectiles_per_shot = 3
- var/deviation = 0.3
-
- action(atom/target)
- if(!action_checks(target)) return
- var/turf/targloc = get_turf(target)
- var/target_x = targloc.x
- var/target_y = targloc.y
- var/target_z = targloc.z
- targloc = null
- spawn for(var/i=1 to min(projectiles, projectiles_per_shot))
- if(!chassis) break
- var/turf/curloc = get_turf(chassis)
- targloc = locate(target_x+GaussRandRound(deviation,1),target_y+GaussRandRound(deviation,1),target_z)
- if (!targloc || !curloc)
- continue
- if (targloc == curloc)
- continue
-
- playsound(chassis, fire_sound, 50, 1)
- var/obj/item/projectile/A = new projectile(curloc)
- src.projectiles--
- A.original = target
- A.current = curloc
- A.yo = targloc.y - curloc.y
- A.xo = targloc.x - curloc.x
- A.process()
- sleep(2)
- set_ready_state(0)
- log_message("Fired from [src.name], targeting [target].")
- do_after_cooldown()
- return
+ projectiles_per_shot = 3
+ variance = 6
+ projectile_delay = 2
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack
name = "SRM-8 Missile Rack"
@@ -353,20 +284,21 @@
var/missile_speed = 2
var/missile_range = 30
- action(target)
- if(!action_checks(target)) return
- set_ready_state(0)
- var/obj/item/missile/M = new projectile(chassis.loc)
- M.primed = 1
- playsound(chassis, fire_sound, 50, 1)
- M.throw_at(target, missile_range, missile_speed, chassis)
- projectiles--
- log_message("Fired from [src.name], targeting [target].")
- var/turf/T = get_turf(src)
- msg_admin_attack("[key_name_admin(chassis.occupant)] fired a [src] in ([T.x], [T.y], [T.z] - JMP)")
- log_game("[key_name(chassis.occupant)] fired a [src] in [T.x], [T.y], [T.z]")
- do_after_cooldown()
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/action(target, params)
+ if(!action_checks(target))
return
+ set_ready_state(0)
+ var/obj/item/missile/M = new projectile(chassis.loc)
+ M.primed = 1
+ playsound(chassis, fire_sound, 50, 1)
+ M.throw_at(target, missile_range, missile_speed, chassis)
+ projectiles--
+ log_message("Fired from [name], targeting [target].")
+ var/turf/T = get_turf(src)
+ msg_admin_attack("[key_name_admin(chassis.occupant)] fired a [src] in ([T.x], [T.y], [T.z] - JMP)")
+ log_game("[key_name(chassis.occupant)] fired a [src] in [T.x], [T.y], [T.z]")
+ do_after_cooldown()
+ return
/obj/item/missile
@@ -375,13 +307,13 @@
var/primed = null
throwforce = 15
- throw_impact(atom/hit_atom)
- if(primed)
- explosion(hit_atom, 0, 0, 2, 4, 0)
- qdel(src)
- else
- ..()
- return
+/obj/item/missile/throw_impact(atom/hit_atom)
+ if(primed)
+ explosion(hit_atom, 0, 0, 2, 4, 0)
+ qdel(src)
+ else
+ ..()
+ return
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang
name = "SGL-6 Grenade Launcher"
@@ -394,18 +326,19 @@
equip_cooldown = 60
var/det_time = 20
size=1
- action(target)
- if(!action_checks(target)) return
- set_ready_state(0)
- var/obj/item/weapon/grenade/flashbang/F = new projectile(chassis.loc)
- playsound(chassis, fire_sound, 50, 1)
- F.throw_at(target, missile_range, missile_speed, chassis)
- projectiles--
- log_message("Fired from [src.name], targeting [target].")
- spawn(det_time)
- F.prime()
- do_after_cooldown()
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/action(target, params)
+ if(!action_checks(target))
return
+ set_ready_state(0)
+ var/obj/item/weapon/grenade/flashbang/F = new projectile(chassis.loc)
+ playsound(chassis, fire_sound, 50, 1)
+ F.throw_at(target, missile_range, missile_speed, chassis)
+ projectiles--
+ log_message("Fired from [name], targeting [target].")
+ spawn(det_time)
+ F.prime()
+ do_after_cooldown()
+ return
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/clusterbang//Because I am a heartless bastard -Sieve
name = "SOB-3 Grenade Launcher"
@@ -417,7 +350,7 @@
size=1
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/clusterbang/limited/get_equip_info()//Limited version of the clusterbang launcher that can't reload
- return "* [chassis.selected==src?"":""][src.name][chassis.selected==src?"":""]\[[src.projectiles]\]"
+ return "* [chassis.selected==src?"":""][name][chassis.selected==src?"":""]\[[projectiles]\]"
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/clusterbang/limited/rearm()
return//Extra bit of security
@@ -432,22 +365,23 @@
projectile_energy_cost = 100
equip_cooldown = 20
- can_attach(obj/mecha/combat/honker/M as obj)
- if(..())
- if(istype(M))
- return 1
- return 0
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/banana_mortar/can_attach(obj/mecha/combat/honker/M as obj)
+ if(..())
+ if(istype(M))
+ return 1
+ return 0
- action(target)
- if(!action_checks(target)) return
- set_ready_state(0)
- var/obj/item/weapon/bananapeel/B = new projectile(chassis.loc)
- playsound(chassis, fire_sound, 60, 1)
- B.throw_at(target, missile_range, missile_speed, chassis)
- projectiles--
- log_message("Bananed from [src.name], targeting [target]. HONK!")
- do_after_cooldown()
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/banana_mortar/action(target, params)
+ if(!action_checks(target))
return
+ set_ready_state(0)
+ var/obj/item/weapon/bananapeel/B = new projectile(chassis.loc)
+ playsound(chassis, fire_sound, 60, 1)
+ B.throw_at(target, missile_range, missile_speed, chassis)
+ projectiles--
+ log_message("Bananed from [name], targeting [target]. HONK!")
+ do_after_cooldown()
+ return
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/mousetrap_mortar
@@ -460,28 +394,29 @@
projectile_energy_cost = 100
equip_cooldown = 10
- can_attach(obj/mecha/combat/honker/M as obj)
- if(..())
- if(istype(M))
- return 1
- return 0
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/mousetrap_mortar/can_attach(obj/mecha/combat/honker/M as obj)
+ if(..())
+ if(istype(M))
+ return 1
+ return 0
- action(target)
- if(!action_checks(target)) return
- set_ready_state(0)
- var/obj/item/device/assembly/mousetrap/M = new projectile(chassis.loc)
- M.secured = 1
- playsound(chassis, fire_sound, 60, 1)
- M.throw_at(target, missile_range, missile_speed, chassis)
- projectiles--
- log_message("Launched a mouse-trap from [src.name], targeting [target]. HONK!")
- do_after_cooldown()
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/mousetrap_mortar/action(target, params)
+ if(!action_checks(target))
return
+ set_ready_state(0)
+ var/obj/item/device/assembly/mousetrap/M = new projectile(chassis.loc)
+ M.secured = 1
+ playsound(chassis, fire_sound, 60, 1)
+ M.throw_at(target, missile_range, missile_speed, chassis)
+ projectiles--
+ log_message("Launched a mouse-trap from [name], targeting [target]. HONK!")
+ do_after_cooldown()
+ return
-/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/bolas
- name = "PCMK-6 Bolas Launcher"
- icon_state = "mecha_bolas"
- projectile = /obj/item/weapon/legcuffs/bolas
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/bola
+ name = "PCMK-6 Bola Launcher"
+ icon_state = "mecha_bola"
+ projectile = /obj/item/weapon/restraints/legcuffs/bola
fire_sound = 'sound/weapons/whip.ogg'
projectiles = 10
missile_speed = 1
@@ -489,23 +424,23 @@
projectile_energy_cost = 50
equip_cooldown = 10
- can_attach(obj/mecha/combat/gygax/M as obj)
- if(..())
- if(istype(M))
- return 1
- return 0
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/bola/can_attach(obj/mecha/combat/gygax/M as obj)
+ if(..())
+ if(istype(M))
+ return 1
+ return 0
- action(target)
- if(!action_checks(target)) return
- set_ready_state(0)
- var/obj/item/weapon/legcuffs/bolas/M = new projectile(chassis.loc)
- playsound(chassis, fire_sound, 50, 1)
- M.thrown_from = src
- M.throw_at(target, missile_range, missile_speed)
- projectiles--
- log_message("Fired from [src.name], targeting [target].")
- do_after_cooldown()
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/bola/action(target, params)
+ if(!action_checks(target))
return
+ set_ready_state(0)
+ var/obj/item/weapon/restraints/legcuffs/bola/M = new projectile(chassis.loc)
+ playsound(chassis, fire_sound, 50, 1)
+ M.throw_at(target, missile_range, missile_speed)
+ projectiles--
+ log_message("Fired from [name], targeting [target].")
+ do_after_cooldown()
+ return
/obj/item/mecha_parts/mecha_equipment/weapon/energy/plasma
equip_cooldown = 20
diff --git a/code/game/mecha/mech_bay.dm b/code/game/mecha/mech_bay.dm
index 4eae22d7646..46c92271308 100644
--- a/code/game/mecha/mech_bay.dm
+++ b/code/game/mecha/mech_bay.dm
@@ -283,7 +283,7 @@
else
data["has_mech"] = 0
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
ui = new(user, src, ui_key, "mech_bay_console.tmpl", "Mech Bay Control Console", 500, 325)
diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm
index a88d1c49bad..22071dea277 100644
--- a/code/game/mecha/mech_fabricator.dm
+++ b/code/game/mecha/mech_fabricator.dm
@@ -153,7 +153,7 @@
I.loc = get_step(src,SOUTH)
I.materials[MAT_METAL] = get_resource_cost_w_coeff(D,MAT_METAL)
I.materials[MAT_GLASS] = get_resource_cost_w_coeff(D,MAT_GLASS)
- visible_message("\icon[src] \The [src] beeps, \"\The [I] is complete.\"")
+ visible_message("[bicon(src)] \The [src] beeps, \"\The [I] is complete.\"")
being_built = null
updateUsrDialog()
@@ -196,14 +196,14 @@
if(stat&(NOPOWER|BROKEN))
return 0
if(!check_resources(D))
- visible_message("\icon[src] \The [src] beeps, \"Not enough resources. Queue processing stopped.\"")
+ visible_message("[bicon(src)] \The [src] beeps, \"Not enough resources. Queue processing stopped.\"")
temp = {"Not enough resources to build next part. Try again | Return"}
return 0
remove_from_queue(1)
build_part(D)
D = listgetindex(queue, 1)
- visible_message("\icon[src] \The [src] beeps, \"Queue processing finished successfully.\"")
+ visible_message("[bicon(src)] \The [src] beeps, \"Queue processing finished successfully.\"")
/obj/machinery/mecha_part_fabricator/proc/list_queue()
var/output = "Queue contains:"
@@ -240,7 +240,7 @@
temp += "Return"
updateUsrDialog()
- visible_message("\icon[src] \The [src] beeps, \"Successfully synchronized with R&D server.\"")
+ visible_message("[bicon(src)] \The [src] beeps, \"Successfully synchronized with R&D server.\"")
return
temp = "Unable to connect to local R&D Database. Please check your connections and try again. Return"
@@ -266,12 +266,12 @@
/obj/machinery/mecha_part_fabricator/interact(mob/user as mob)
var/dat, left_part
- if (..())
+ if(..())
return
user.set_machine(src)
var/turf/exit = get_step(src,SOUTH)
if(exit.density)
- visible_message("\icon[src] \The [src] beeps, \"Error! Part outlet is obstructed.\"")
+ visible_message("[bicon(src)] \The [src] beeps, \"Error! Part outlet is obstructed.\"")
return
if(temp)
left_part = temp
@@ -289,9 +289,8 @@
if("parts")
left_part += output_parts_list(part_set)
left_part += "Return"
- dat = {"
-
- [name]
+ dat = {"
+ [name]
+
+
+
+
+
Faxes are your main method of communicating with the NAS Trurl, better known as Central Command.
+
Faxes allow personnel on the station to maintain open lines of communication with the NAS Trurl, allowing for vital information to flow both ways.
+
Being written communications, proper grammar, syntax and typography is required, in addition to a signature and, if applicable, a stamp. Failure to sign faxes will lead to an automatic rejection.
+
We at NanoTrasen provide Fax Machines to every Head of Staff, in addition to the Magistrate, NanoTrasen Representative, and Internal Affairs Agents.
+
This means that we trust the recipients of these fax machines to only use them in the proper circumstances (see When to Fax?).
While it is up to the discretion of each individual person to decide when to fax Central Command, there are some simple guidelines on when to do this.
+
Firstly, any situation that can reasonably be solved on-site, should be handled on-site. Knowledge of Standard Operating Procedure is mandatory for everyone with access to a fax machine.
+
Resolving issues on-site not only leads to more expedient problem-solving, it also frees up company resources and provides valuable work experience for all parties involved.
+
This means that you should work with the Heads of Staff concerning personnel and workplace issues, and attempt to resolve situations with them. If, for whatever reason, the relevent Head of Staff is not available or receptive, consider speaking with the Captain and/or NanoTrasen Representative.
+
If, for whatever reason, these issues cannot be solved on-site, either due to incompetence or just plain refusal to cooperate, faxing Central Command becomes a viable option.
+
Secondly, station status reports should be sent occasionally, but never at the start of the shift. Remember, we assign personnel to the station. We do not need a repeat of what we just signed off on.
+
Thirdly, staff/departmental evaluations are always welcome, especially in cases of noticeable (in)competence. Just as a brilliant coworker can be rewarded, an incompetent one can be punished.
+
Fourthly, do not issue faxes asking for sentences. You have an entire Security department and an associated Detective, not to mention on-site Space Law manuals.
+
Lastly, please pay attention to context. If the station is facing a massive emergency, such as a Class 7-10 Blob Organism, most, if not all, non-relevant faxes will be duly ignored.
Sending a fax is simple. Simply insert your ID into the fax machine, then log in.
+
Once logged in, insert a piece of paper and select the destination from the provided list. Remember, you can rename your fax from within the fax machine's menu.
+
You can send faxes to any other fax machine on the station, which can be a very useful tool when you need to issue broad communications to all of the Heads of Staff.
+
To send a fax to Central Command, simply select the correct destination, and send the fax. Keep in mind, the communication arrays need to recharge after sending a fax to Central Command, so make sure you sent everything you need.
+
Lastly, paper bundles can also be faxed as a single item, so feel free to bundle up all relevant documentation and send it in at once.
+
+
+
+
+
+ "}
+
/obj/item/weapon/book/manual/sop_science
name = "Science Standard Operating Procedures"
desc = "A set of guidelines aiming at the safe conduct of all scientific activities."
@@ -1483,7 +1542,7 @@
Attending Surgeon is to keep the Operating Room in an hygienic condition at all times, again, to prevent infection;
Attending Surgeon is to wash his/her hands between different patients, again, to prevent infection;
Attending Surgeon is to use either Anesthetics or Sedatives (for species that cannot breathe Anesthetics) during Surgical Procedures. Exception is made if the patient requests otherwise;
-
Attending Surgeon is not to remove any legal Implants (such as Loyalty or Tracking Implants) from the patient, unless requested by Security;
+
Attending Surgeon is not to remove any legal Implants (such as Mindshield or Tracking Implants) from the patient, unless requested by Security;
If a patient requests that a lost limb be replaced with an organic, rather than mechanical, substitute, said limb must be harvested from a compatible humanized Test Animal (such as Monkeys for Humans, or Farwas for Tajarans). Exception is made if the patient deliberately requests otherwise;
Attending Surgeon is not to bring any of the Surgical Tools outside of their respective Operating Room, and must in fact ensure the Operating Room maintains its proper inventory. This includes ensuring that the Anesthetics Equipment be kept inside the OR
@@ -2141,7 +2200,7 @@
Prisoner must then be borged, fired into space via mass driver, cremated, or placed in the morgue with a DNR Notice, at the discretion of the Magistrate, Captain or Head of Security.
Prisoner must be bucklecuffed to the electric chair or bed.
@@ -2150,7 +2209,7 @@
Prisoner must then be borged, fired into space via mass driver, cremated, or placed in the morgue with a DNR Notice, at the discretion of the Magistrate, Captain or Head of Security.
@@ -2164,7 +2223,7 @@
"}
-
+
/obj/item/weapon/book/manual/sop_general
name = "Standard Operating Procedures"
desc = "A set of guidelines aiming at the safe conduct of all station activities."
@@ -2212,7 +2271,7 @@
All clear.
- Default operating level. No immediate or clear threat to the station. All departments may carry out work as normal.
+ Default operating level. No immediate or clear threat to the station. All departments may carry out work as normal.
This alert level can be set at the Communications Console with a Captain level ID. All threats to the station have passed. All weapons need to be holstered and privacy laws are once again fully enforced.
There is a suspected threat.
Raised alert level. Suspected threat to the station. Issued by Central Command, the Captain, or a Head of Staff vote. This alert level can be set at the Communications Console with a Captain level ID.
@@ -2255,10 +2314,10 @@
Crew:
Employees are recommended to comply with all security requests.
-
Suit sensors are mandatory, but coordinate positions are not required.
+
Suit sensors are mandatory, but coordinate positions are not required.
There is a confirmed threat.
Maximum alert level. Confirmed threat to the station or severe damage. Issued by Central Command, the Captain, or a Head of Staff vote. This alert level can only be set via the Keycard Authentication Devices in each Heads of Staff office and by swiping two Heads of Staff ID cards simultaneously.
@@ -2279,12 +2338,12 @@
Crew:
Suit sensors and coordinate positions are mandatory.
-
All crew members must remain in their departments.
-
Employees are required to comply with all security requests.
-
Emergency Response Team may be authorised. All crew are to comply with their direction.
+
All crew members must remain in their departments.
+
Employees are required to comply with all security requests.
+
Emergency Response Team may be authorised. All crew are to comply with their direction.
Extremely hostile threat onboard the station.
GAMMA Security level has been set by Centcom.
@@ -2306,21 +2365,21 @@
Crew:
Employees are required to comply with all security requests.
-
All civilians are to seek their nearest head for transportation to a safe location.
+
All civilians are to seek their nearest head for transportation to a safe location.
All personnel are required to defend the station and help security with dealing with the threat. All crew must follow direct orders from Security Personell or Head of Staff.
Authorisation from the relevant Department Head is required to be hired into a Department. If none exists, the HoP or Captain's authorisation is required.
Promotion to a Department Head requires authorisation from the Captain or Acting Captain.
CentComm Authorisation is required for hiring the following: Blueshield, Security Pod Pilot, Magistrate, Brig Physician, Nanotrasen Representative, Mechanic.
If no Department Head has yet been sent, any promotion to said position is on a temporary basis until one arrives.
-
All Security personnel are to be loyalty implanted.
+
All Security personnel are to be mindshield implanted.
The following situations have specific SoP. Failure to follow these may result in demotion/dismissal, or detaining by security if failure to follow them presents a significant risk.
Definition: A Viral Outbreak is defined as a situation where a Viral Pathogen has infected a significant portion of the crew (>10%)
@@ -2376,7 +2435,7 @@
Once the Viral Outbreak is over, all personnel are to return to regular duties.
"}
- if (2)
+ if(2)
if(check_rights((R_SERVER|R_EVENT),0))
dat += {"
@@ -104,6 +107,7 @@
Dodgeball (TDM)! Round-enders The floor is lava! (DANGEROUS: extremely lame)
+ The floor is fake-lava! (non-harmful) Turn all humans into monkeys Make all items look like guns Warp all Players to Prison
diff --git a/code/modules/admin/sql_notes.dm b/code/modules/admin/sql_notes.dm
index df02b6f0c9c..338993af58c 100644
--- a/code/modules/admin/sql_notes.dm
+++ b/code/modules/admin/sql_notes.dm
@@ -33,7 +33,7 @@
return
var/admin_sql_ckey = sanitizeSQL(adminckey)
if(!server)
- if (config && config.server_name)
+ if(config && config.server_name)
server = config.server_name
server = sanitizeSQL(server)
var/DBQuery/query_noteadd = dbcon.NewQuery("INSERT INTO [format_table_name("notes")] (ckey, timestamp, notetext, adminckey, server) VALUES ('[target_sql_ckey]', '[timestamp]', '[notetext]', '[admin_sql_ckey]', '[server]')")
diff --git a/code/modules/admin/stickyban.dm b/code/modules/admin/stickyban.dm
index a772edc2608..bddebcff602 100644
--- a/code/modules/admin/stickyban.dm
+++ b/code/modules/admin/stickyban.dm
@@ -2,32 +2,32 @@
if(!check_rights(R_BAN))
return
- switch (action)
- if ("show")
+ switch(action)
+ if("show")
stickyban_show()
return
- if ("add")
+ if("add")
var/list/ban = list()
var/ckey
ban["admin"] = usr.key
ban["type"] = list("sticky")
ban["reason"] = "(InGameBan)([usr.key])" //this will be displayed in dd only
- if (data["ckey"])
+ if(data["ckey"])
ckey = ckey(data["ckey"])
else
ckey = input(usr,"Ckey","Ckey","") as text|null
- if (!ckey)
+ if(!ckey)
return
ckey = ckey(ckey)
- if (get_stickyban_from_ckey(ckey))
+ if(get_stickyban_from_ckey(ckey))
to_chat(usr, "Error: Can not add a stickyban: User already has a current sticky ban")
- if (data["reason"])
+ if(data["reason"])
ban["message"] = data["reason"]
else
var/reason = input(usr,"Reason","Reason","Ban Evasion") as text|null
- if (!reason)
+ if(!reason)
return
ban["message"] = "[reason]"
@@ -36,18 +36,18 @@
log_admin("[key_name(usr)] has stickybanned [ckey].\nReason: [ban["message"]]")
message_admins("[key_name_admin(usr)] has stickybanned [ckey].\nReason: [ban["message"]]")
- if ("remove")
- if (!data["ckey"])
+ if("remove")
+ if(!data["ckey"])
return
var/ckey = data["ckey"]
var/ban = get_stickyban_from_ckey(ckey)
- if (!ban)
+ if(!ban)
to_chat(usr, "Error: No sticky ban for [ckey] found!")
return
- if (alert("Are you sure you want to remove the sticky ban on [ckey]?","Are you sure","Yes","No") == "No")
+ if(alert("Are you sure you want to remove the sticky ban on [ckey]?","Are you sure","Yes","No") == "No")
return
- if (!get_stickyban_from_ckey(ckey))
+ if(!get_stickyban_from_ckey(ckey))
to_chat(usr, "Error: The ban disappeared.")
return
world.SetConfig("ban", ckey, null)
@@ -55,46 +55,46 @@
log_admin("[key_name(usr)] removed [ckey]'s stickyban")
message_admins("[key_name_admin(usr)] removed [ckey]'s stickyban")
- if ("remove_alt")
- if (!data["ckey"])
+ if("remove_alt")
+ if(!data["ckey"])
return
var/ckey = data["ckey"]
- if (!data["alt"])
+ if(!data["alt"])
return
var/alt = ckey(data["alt"])
var/ban = get_stickyban_from_ckey(ckey)
- if (!ban)
+ if(!ban)
to_chat(usr, "Error: No sticky ban for [ckey] found!")
return
var/found = 0
//we have to do it this way because byond keeps the case in its sticky ban matches WHY!!!
- for (var/key in ban["keys"])
- if (ckey(key) == alt)
+ for(var/key in ban["keys"])
+ if(ckey(key) == alt)
found = 1
break
- if (!found)
+ if(!found)
to_chat(usr, "Error: [alt] is not linked to [ckey]'s sticky ban!")
return
- if (alert("Are you sure you want to disassociate [alt] from [ckey]'s sticky ban? \nNote: Nothing stops byond from re-linking them","Are you sure","Yes","No") == "No")
+ if(alert("Are you sure you want to disassociate [alt] from [ckey]'s sticky ban? \nNote: Nothing stops byond from re-linking them","Are you sure","Yes","No") == "No")
return
//we have to do this again incase something changes
ban = get_stickyban_from_ckey(ckey)
- if (!ban)
+ if(!ban)
to_chat(usr, "Error: The ban disappeared.")
return
found = 0
- for (var/key in ban["keys"])
- if (ckey(key) == alt)
+ for(var/key in ban["keys"])
+ if(ckey(key) == alt)
ban["keys"] -= key
found = 1
break
- if (!found)
+ if(!found)
to_chat(usr, "Error: [alt] link to [ckey]'s sticky ban disappeared.")
return
@@ -103,21 +103,21 @@
log_admin("[key_name(usr)] has disassociated [alt] from [ckey]'s sticky ban")
message_admins("[key_name_admin(usr)] has disassociated [alt] from [ckey]'s sticky ban")
- if ("edit")
- if (!data["ckey"])
+ if("edit")
+ if(!data["ckey"])
return
var/ckey = data["ckey"]
var/ban = get_stickyban_from_ckey(ckey)
- if (!ban)
+ if(!ban)
to_chat(usr, "Error: No sticky ban for [ckey] found!")
return
var/oldreason = ban["message"]
var/reason = input(usr,"Reason","Reason","[ban["message"]]") as text|null
- if (!reason || reason == oldreason)
+ if(!reason || reason == oldreason)
return
//we have to do this again incase something changed while we waited for input
ban = get_stickyban_from_ckey(ckey)
- if (!ban)
+ if(!ban)
to_chat(usr, "Error: The ban disappeared.")
return
ban["message"] = "[reason]"
@@ -133,13 +133,13 @@
/datum/admins/proc/stickyban_gethtml(ckey, ban)
. = "\[-\][ckey] "
. += "[ban["message"]] \[Edit\] "
- if (ban["admin"])
+ if(ban["admin"])
. += "[ban["admin"]] "
else
. += "LEGACY "
. += "Caught keys \n"
- for (var/key in ban["keys"])
- if (ckey(key) == ckey)
+ for(var/key in ban["keys"])
+ if(ckey(key) == ckey)
continue
. += "
"
. += "\n"
@@ -168,17 +168,17 @@
usr << browse(html,"window=stickybans;size=700x400")
/proc/get_stickyban_from_ckey(var/ckey)
- if (!ckey)
+ if(!ckey)
return null
ckey = ckey(ckey)
. = null
- for (var/key in world.GetConfig("ban"))
- if (ckey(key) == ckey)
+ for(var/key in world.GetConfig("ban"))
+ if(ckey(key) == ckey)
. = stickyban2list(world.GetConfig("ban",key))
break
/proc/stickyban2list(var/ban)
- if (!ban)
+ if(!ban)
return null
. = params2list(ban)
.["keys"] = splittext(.["keys"], ",")
@@ -187,16 +187,16 @@
.["computer_id"] = splittext(.["computer_id"], ",")
/proc/list2stickyban(var/list/ban)
- if (!ban || !islist(ban))
+ if(!ban || !islist(ban))
return null
. = ban.Copy()
- if (.["keys"])
+ if(.["keys"])
.["keys"] = jointext(.["keys"], ",")
- if (.["type"])
+ if(.["type"])
.["type"] = jointext(.["type"], ",")
- if (.["IP"])
+ if(.["IP"])
.["IP"] = jointext(.["IP"], ",")
- if (.["computer_id"])
+ if(.["computer_id"])
.["computer_id"] = jointext(.["computer_id"], ",")
. = list2params(.)
diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm
index 090955de57a..252636abcda 100644
--- a/code/modules/admin/topic.dm
+++ b/code/modules/admin/topic.dm
@@ -877,7 +877,7 @@
else if(href_list["boot2"])
var/mob/M = locate(href_list["boot2"])
- if (ismob(M))
+ if(ismob(M))
if(!check_if_greater_rights_than(M.client))
return
to_chat(M, "\red You have been kicked from the server")
@@ -1094,7 +1094,7 @@
else if(href_list["c_mode2"])
if(!check_rights(R_ADMIN|R_SERVER)) return
- if (ticker && ticker.mode)
+ if(ticker && ticker.mode)
return alert(usr, "The game has already started.", null, null, null, null)
master_mode = href_list["c_mode2"]
log_admin("[key_name(usr)] set the mode as [master_mode].")
@@ -1124,6 +1124,8 @@
if(!istype(H))
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
return
+ if(alert(usr, "Confirm make monkey?",, "Yes", "No") != "Yes")
+ return
log_admin("[key_name(usr)] attempting to monkeyize [key_name(H)]")
message_admins("\blue [key_name_admin(usr)] attempting to monkeyize [key_name_admin(H)]", 1)
@@ -1138,6 +1140,9 @@
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
return
+ if(alert(usr, "Confirm make corgi?",, "Yes", "No") != "Yes")
+ return
+
log_admin("[key_name(usr)] attempting to corgize [key_name(H)]")
message_admins("\blue [key_name_admin(usr)] attempting to corgize [key_name_admin(H)]", 1)
H.corgize()
@@ -1149,6 +1154,8 @@
if(!istype(H))
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
return
+ if(alert(usr, "Confirm make pai?",, "Yes", "No") != "Yes")
+ return
var/painame = "Default"
var/name = ""
@@ -1205,6 +1212,7 @@
if(I)
I.loc = locker
I.layer = initial(I.layer)
+ I.plane = initial(I.plane)
I.dropped(M)
M.update_icons()
@@ -1244,6 +1252,7 @@
message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] back to the Lobby.")
var/mob/new_player/NP = new()
+ non_respawnable_keys -= M.ckey
NP.ckey = M.ckey
qdel(M)
@@ -1266,6 +1275,7 @@
if(I)
I.loc = M.loc
I.layer = initial(I.layer)
+ I.plane = initial(I.plane)
I.dropped(M)
M.Paralyse(5)
@@ -1295,6 +1305,7 @@
if(I)
I.loc = M.loc
I.layer = initial(I.layer)
+ I.plane = initial(I.plane)
I.dropped(M)
M.Paralyse(5)
@@ -1346,6 +1357,7 @@
if(I)
I.loc = M.loc
I.layer = initial(I.layer)
+ I.plane = initial(I.plane)
I.dropped(M)
if(istype(M, /mob/living/carbon/human))
@@ -1403,6 +1415,9 @@
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
return
+ if(alert(usr, "Confirm make ai?",, "Yes", "No") != "Yes")
+ return
+
message_admins("\red Admin [key_name_admin(usr)] AIized [key_name_admin(H)]!", 1)
log_admin("[key_name(usr)] AIized [key_name(H)]")
H.AIize()
@@ -1410,6 +1425,10 @@
else if(href_list["makemask"])
if(!check_rights(R_SPAWN)) return
+
+ if(alert(usr, "Confirm make mask?",, "Yes", "No") != "Yes")
+ return
+
var/mob/currentMob = locate(href_list["makemask"])
message_admins("\red Admin [key_name_admin(usr)] made [key_name_admin(currentMob)] into a Mask of Nar'Sie!", 1)
log_admin("[key_name(usr)] made [key_name(currentMob)] into a Mask of Nar'Sie!")
@@ -1423,6 +1442,8 @@
if(!istype(H))
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
return
+ if(alert(usr, "Confirm make alien?",, "Yes", "No") != "Yes")
+ return
usr.client.cmd_admin_alienize(H)
@@ -1433,6 +1454,8 @@
if(!istype(H))
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
return
+ if(alert(usr, "Confirm make slime?",, "Yes", "No") != "Yes")
+ return
usr.client.cmd_admin_slimeize(H)
@@ -1444,6 +1467,9 @@
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
return
+ if(alert(usr, "Confirm make superhero?",, "Yes", "No") != "Yes")
+ return
+
usr.client.cmd_admin_super(H)
else if(href_list["makerobot"])
@@ -1453,6 +1479,8 @@
if(!istype(H))
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
return
+ if(alert(usr, "Confirm make robot?",, "Yes", "No") != "Yes")
+ return
usr.client.cmd_admin_robotize(H)
@@ -1463,6 +1491,8 @@
if(istype(M, /mob/new_player))
to_chat(usr, "This cannot be used on instances of type /mob/new_player")
return
+ if(alert(usr, "Confirm make animal?",, "Yes", "No") != "Yes")
+ return
usr.client.cmd_admin_animalize(M)
@@ -1536,53 +1566,7 @@
else if(href_list["adminmoreinfo"])
var/mob/M = locate(href_list["adminmoreinfo"])
- if(!ismob(M))
- to_chat(usr, "This can only be used on instances of type /mob")
- return
-
- var/location_description = ""
- var/special_role_description = ""
- var/health_description = ""
- var/gender_description = ""
- var/turf/T = get_turf(M)
-
- //Location
- if(isturf(T))
- if(isarea(T.loc))
- location_description = "([M.loc == T ? "at coordinates " : "in [M.loc] at coordinates "] [T.x], [T.y], [T.z] in area [T.loc])"
- else
- location_description = "([M.loc == T ? "at coordinates " : "in [M.loc] at coordinates "] [T.x], [T.y], [T.z])"
-
- //Job + antagonist
- if(M.mind)
- special_role_description = "Role: [M.mind.assigned_role]; Antagonist: [M.mind.special_role]; Has been rev: [(M.mind.has_been_rev)?"Yes":"No"]"
- else
- special_role_description = "Role: Mind datum missing Antagonist: Mind datum missing; Has been rev: Mind datum missing;"
-
- //Health
- if(isliving(M))
- var/mob/living/L = M
- var/status
- switch (M.stat)
- if (0) status = "Alive"
- if (1) status = "Unconscious"
- if (2) status = "Dead"
- health_description = "Status = [status]"
- health_description += " Oxy: [L.getOxyLoss()] - Tox: [L.getToxLoss()] - Fire: [L.getFireLoss()] - Brute: [L.getBruteLoss()] - Clone: [L.getCloneLoss()] - Brain: [L.getBrainLoss()]"
- else
- health_description = "This mob type has no health to speak of."
-
- //Gener
- switch(M.gender)
- if(MALE,FEMALE) gender_description = "[M.gender]"
- else gender_description = "[M.gender]"
-
- to_chat(src.owner, "Info about [M.name]: ")
- to_chat(src.owner, "Mob type = [M.type]; Gender = [gender_description] Damage = [health_description]")
- to_chat(src.owner, "Name = [M.name]; Real_name = [M.real_name]; Mind_name = [M.mind?"[M.mind.name]":""]; Key = [M.key];")
- to_chat(src.owner, "Location = [location_description];")
- to_chat(src.owner, "[special_role_description]")
- to_chat(src.owner, "(PM) (PP) (VV) (SM) (FLW) (CA)")
+ admin_mob_info(M)
else if(href_list["adminspawncookie"])
if(!check_rights(R_ADMIN|R_EVENT)) return
@@ -1671,10 +1655,113 @@
message_admins("[key_name_admin(src.owner)] replied to [key_name_admin(H)]'s Centcom message with: \"[input]\"")
to_chat(H, "You hear something crackle in your headset for a moment before a voice speaks. \"Please stand by for a message from Central Command. Message as follows. [input]. Message ends.\"")
+ else if(href_list["EvilFax"])
+ if(!check_rights(R_ADMIN))
+ return
+ var/mob/living/carbon/human/H = locate(href_list["EvilFax"])
+ if(!istype(H))
+ to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
+ return
+ var/etypes = list("Borgification","Corgification","Death By Fire","Total Brain Death","Honk Tumor","Cluwne","Demotion Notice")
+ var/eviltype = input(src.owner, "Which type of evil fax do you wish to send [H]?","Its good to be baaaad...", "") as null|anything in etypes
+ if(!(eviltype in etypes))
+ return
+ var/customname = input(src.owner, "Pick a title for the evil fax.", "Fax Title") as text|null
+ if(!customname)
+ customname = "paper"
+ var/obj/item/weapon/paper/evilfax/P = new /obj/item/weapon/paper/evilfax(null)
+ var/obj/machinery/photocopier/faxmachine/fax = locate(href_list["originfax"])
+
+ P.name = "Central Command - [customname]"
+ P.info = "You really should've known better."
+ P.myeffect = eviltype
+ P.mytarget = H
+ if(alert("Do you want the Evil Fax to activate automatically if [H] tries to ignore it?",,"Yes", "No") == "Yes")
+ P.activate_on_timeout = 1
+ P.x = rand(-2, 0)
+ P.y = rand(-1, 2)
+ P.offset_x += P.x
+ P.offset_y += P.y
+ P.update_icon()
+ var/stampvalue = "cent"
+ var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
+ stampoverlay.icon_state = "paper_stamp-[stampvalue]"
+ stampoverlay.pixel_x = P.x
+ stampoverlay.pixel_y = P.y
+ P.stamped = list()
+ P.stamped += /obj/item/weapon/stamp/centcom
+ if(!P.ico)
+ P.ico = new
+ P.ico += "paper_stamp-[stampvalue]"
+ P.overlays += stampoverlay
+ P.stamps += ""
+ P.update_icon()
+ //fax.receivefax(P) // this does not work, it does not preserve the type, we have to physically teleport the fax paper instead
+ P.loc = fax.loc
+ if(istype(H) && H.stat == CONSCIOUS && (istype(H.l_ear, /obj/item/device/radio/headset) || istype(H.r_ear, /obj/item/device/radio/headset)))
+ to_chat(H, "Your headset pings, notifying you that a reply to your fax has arrived.")
+ to_chat(src.owner, "You sent a [eviltype] fax to [H]")
+ log_admin("[key_name(src.owner)] sent [key_name(H)] a [eviltype] fax")
+ message_admins("[key_name_admin(src.owner)] replied to [key_name_admin(H)] with a [eviltype] fax")
+ else if(href_list["FaxReplyTemplate"])
+ if(!check_rights(R_ADMIN))
+ return
+ var/mob/living/carbon/human/H = locate(href_list["FaxReplyTemplate"])
+ if(!istype(H))
+ to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
+ return
+ var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(null)
+ var/obj/machinery/photocopier/faxmachine/fax = locate(href_list["originfax"])
+ P.name = "Central Command - paper"
+ var/stypes = list("Handle it yourselves!","Illegible fax","Fax not signed","Not Right Now","You are wasting our time", "Keep up the good work", "ERT Instructions")
+ var/stype = input(src.owner, "Which type of standard reply do you wish to send to [H]?","Choose your paperwork", "") as null|anything in stypes
+ var/tmsg = "
NanoTrasen Science Station Cyberiad
NAS Trurl Communications Department Report
"
+ if(stype == "Handle it yourselves!")
+ tmsg += "Greetings, esteemed crewmember. Your fax has been DECLINED automatically by NAS Trurl Fax Registration.
Please proceed in accordance with Standard Operating Procedure and/or Space Law. You are fully trained to handle this situation without Central Command intervention.
This is an automatic message."
+ else if(stype == "Illegible fax")
+ tmsg += "Greetings, esteemed crewmember. Your fax has been DECLINED automatically by NAS Trurl Fax Registration.
Your fax's grammar, syntax and/or typography are of a sub-par level and do not allow us to understand the contents of the message.
Please consult your nearest dictionary and/or thesaurus and try again.
This is an automatic message."
+ else if(stype == "Fax not signed")
+ tmsg += "Greetings, esteemed crewmember. Your fax has been DECLINED automatically by NAS Trurl Fax Registration.
Your fax has not been correctly signed and, as such, we cannot verify your identity.
Please sign your faxes before sending them so that we may verify your identity.
This is an automatic message."
+ else if(stype == "Not Right Now")
+ tmsg += "Greetings, esteemed crewmember. Your fax has been DECLINED automatically by NAS Trurl Fax Registration.
Due to pressing concerns of a matter above your current paygrade, we are unable to provide assistance in whatever matter your fax referenced.
This can be either due to a power outage, bureaucratic audit, pest infestation, Ascendance Event, corgi outbreak, or any other situation that would affect the proper functioning of the NAS Trurl.
Please try again later.
This is an automatic message."
+ else if(stype == "You are wasting our time")
+ tmsg += "Greetings, esteemed crewmember. Your fax has been DECLINED automatically by NAS Trurl Fax Registration.
In the interest of preventing further mismanagement of company resources, please avoid wasting our time with such petty drivel.
Do kindly remember that we expect our workforce to maintain at least a semi-decent level of profesionalism. Do not test our patience.
This is an automatic message."
+ else if(stype == "Keep up the good work")
+ tmsg += "Greetings, esteemed crewmember. Your fax has been received successfully by NAS Trurl Fax Registration.
We at the NAS Trurl appreciate the good work that you have done here, and sincerely recommend that you continue such a display of dedication to the company.
This is absolutely not an automated message."
+ else if(stype == "ERT Instructions")
+ tmsg += "Greetings, esteemed crewmember. Your fax has been DECLINED automatically by NAS Trurl Fax Registration.
Please utilize the Card Swipers if you wish to call for an ERT.
This is an automated message."
+ else
+ return
+ tmsg += ""
+ P.info = tmsg
+ P.x = rand(-2, 0)
+ P.y = rand(-1, 2)
+ P.offset_x += P.x
+ P.offset_y += P.y
+ P.update_icon()
+ var/stampvalue = "cent"
+ var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
+ stampoverlay.icon_state = "paper_stamp-[stampvalue]"
+ stampoverlay.pixel_x = P.x
+ stampoverlay.pixel_y = P.y
+ P.stamped = list()
+ P.stamped += /obj/item/weapon/stamp/centcom
+ if(!P.ico)
+ P.ico = new
+ P.ico += "paper_stamp-[stampvalue]"
+ P.overlays += stampoverlay
+ P.stamps += ""
+ P.update_icon()
+ fax.receivefax(P)
+ if(istype(H) && H.stat == CONSCIOUS && (istype(H.l_ear, /obj/item/device/radio/headset) || istype(H.r_ear, /obj/item/device/radio/headset)))
+ to_chat(H, "Your headset pings, notifying you that a reply to your fax has arrived.")
+ to_chat(src.owner, "You sent a standard '[stype]' fax to [H]")
+ log_admin("[key_name(src.owner)] sent [key_name(H)] a standard '[stype]' fax")
+ message_admins("[key_name_admin(src.owner)] replied to [key_name_admin(H)] with a standard '[stype]' fax")
+
else if(href_list["SyndicateReply"])
if(!check_rights(R_ADMIN))
return
-
var/mob/living/carbon/human/H = locate(href_list["SyndicateReply"])
if(!istype(H))
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
@@ -1685,10 +1772,9 @@
if(!istype(H.l_ear, /obj/item/device/radio/headset) && !istype(H.r_ear, /obj/item/device/radio/headset))
to_chat(usr, "The person you are trying to contact is not wearing a headset")
return
-
var/input = input(src.owner, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from The Syndicate", "")
- if(!input) return
-
+ if(!input)
+ return
to_chat(src.owner, "You sent [input] to [H] via a secure channel.")
log_admin("[src.owner] replied to [key_name(H)]'s Syndicate message with the message [input].")
to_chat(H, "You hear something crackle in your headset for a moment before a voice speaks. \"Please stand by for a message from your benefactor. Message as follows, agent. [input]. Message ends.\"")
@@ -1727,7 +1813,7 @@
var/input = input(src.owner, "Please enter a reason for denying [key_name(H)]'s ERT request.","Outgoing message from CentComm", "")
if(!input) return
-
+ ert_request_answered = 1
to_chat(src.owner, "You sent [input] to [H] via a secure channel.")
log_admin("[src.owner] denied [key_name(H)]'s ERT request with the message [input].")
to_chat(H, "You hear something crackle in your headset for a moment before a voice speaks. \"Your ERT request has been denied for the following reasons: [input]. Message ends.\"")
@@ -1740,19 +1826,19 @@
return
var/obj/item/fax = locate(href_list["AdminFaxView"])
- if (istype(fax, /obj/item/weapon/paper))
+ if(istype(fax, /obj/item/weapon/paper))
var/obj/item/weapon/paper/P = fax
P.show_content(usr,1)
- else if (istype(fax, /obj/item/weapon/photo))
+ else if(istype(fax, /obj/item/weapon/photo))
var/obj/item/weapon/photo/H = fax
H.show(usr)
- else if (istype(fax, /obj/item/weapon/paper_bundle))
+ else if(istype(fax, /obj/item/weapon/paper_bundle))
//having multiple people turning pages on a paper_bundle can cause issues
//open a browse window listing the contents instead
var/data = ""
var/obj/item/weapon/paper_bundle/B = fax
- for (var/page = 1, page <= B.amount + 1, page++)
+ for(var/page = 1, page <= B.amount + 1, page++)
var/obj/pageobj = B.contents[page]
data += "Page [page] - [pageobj.name] "
@@ -1760,19 +1846,19 @@
else
to_chat(usr, "\red The faxed item is not viewable. This is probably a bug, and should be reported on the tracker: [fax.type]")
- else if (href_list["AdminFaxViewPage"])
+ else if(href_list["AdminFaxViewPage"])
if(!check_rights(R_ADMIN))
return
var/page = text2num(href_list["AdminFaxViewPage"])
var/obj/item/weapon/paper_bundle/bundle = locate(href_list["paper_bundle"])
- if (!bundle) return
+ if(!bundle) return
- if (istype(bundle.contents[page], /obj/item/weapon/paper))
+ if(istype(bundle.contents[page], /obj/item/weapon/paper))
var/obj/item/weapon/paper/P = bundle.contents[page]
P.show_content(usr, 1)
- else if (istype(bundle.contents[page], /obj/item/weapon/photo))
+ else if(istype(bundle.contents[page], /obj/item/weapon/photo))
var/obj/item/weapon/photo/H = bundle.contents[page]
H.show(usr)
return
@@ -1894,6 +1980,7 @@
return
else
for(var/obj/machinery/photocopier/faxmachine/F in allfaxes)
+ // TODO: Tie into space manager
if((F.z in config.station_levels))
spawn(0)
if(!F.receivefax(P))
@@ -1997,9 +2084,9 @@
var/atom/loc = usr.loc
var/dirty_paths
- if (istext(href_list["object_list"]))
+ if(istext(href_list["object_list"]))
dirty_paths = list(href_list["object_list"])
- else if (istype(href_list["object_list"], /list))
+ else if(istype(href_list["object_list"], /list))
dirty_paths = href_list["object_list"]
var/paths = list()
@@ -2033,22 +2120,22 @@
var/atom/target //Where the object will be spawned
var/where = href_list["object_where"]
- if (!( where in list("onfloor","inhand","inmarked") ))
+ if(!( where in list("onfloor","inhand","inmarked") ))
where = "onfloor"
switch(where)
if("inhand")
- if (!iscarbon(usr) && !isrobot(usr))
+ if(!iscarbon(usr) && !isrobot(usr))
to_chat(usr, "Can only spawn in hand when you're a carbon mob or cyborg.")
where = "onfloor"
target = usr
if("onfloor")
switch(href_list["offset_type"])
- if ("absolute")
+ if("absolute")
target = locate(0 + X,0 + Y,0 + Z)
- if ("relative")
+ if("relative")
target = locate(loc.x + X,loc.y + Y,loc.z + Z)
if("inmarked")
if(!marked_datum)
@@ -2061,8 +2148,8 @@
target = marked_datum
if(target)
- for (var/path in paths)
- for (var/i = 0; i < number; i++)
+ for(var/path in paths)
+ for(var/i = 0; i < number; i++)
if(path in typesof(/turf))
var/turf/O = target
var/turf/N = O.ChangeTurf(path)
@@ -2090,7 +2177,7 @@
R.activate_module(I)
R.module.fix_modules()
- if (number == 1)
+ if(number == 1)
log_admin("[key_name(usr)] created a [english_list(paths)]")
for(var/path in paths)
if(ispath(path, /mob))
@@ -2160,7 +2247,7 @@
/* for(var/obj/machinery/vehicle/pod/O in world)
for(var/mob/M in src)
M.loc = src.loc
- if (M.client)
+ if(M.client)
M.client.perspective = MOB_PERSPECTIVE
M.client.eye = M
qdel(O)
@@ -2241,6 +2328,7 @@
for(var/mob/living/carbon/human/H in mob_list)
var/turf/loc = find_loc(H)
var/security = 0
+ // TODO: Tie into space manager
if(!(loc.z in config.station_levels) || prisonwarped.Find(H))
//don't warp them if they aren't ready or are already there
@@ -2258,12 +2346,13 @@
continue
//don't strip organs
H.unEquip(W)
- if (H.client)
+ if(H.client)
H.client.screen -= W
- if (W)
+ if(W)
W.loc = H.loc
W.dropped(H)
W.layer = initial(W.layer)
+ W.plane = initial(W.plane)
//teleport person to cell
H.loc = pick(prisonwarp)
H.equip_to_slot_or_del(new /obj/item/clothing/under/color/orange(H), slot_w_uniform)
@@ -2311,9 +2400,9 @@
feedback_add_details("admin_secrets_fun_used","BC")
var/newBombCap = input(usr,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be between 4 and 128)", "New Bomb Cap", MAX_EX_LIGHT_RANGE) as num|null
- if (newBombCap < 4)
+ if(newBombCap < 4)
return
- if (newBombCap > 128)
+ if(newBombCap > 128)
newBombCap = 128
MAX_EX_DEVESTATION_RANGE = round(newBombCap/4)
@@ -2416,60 +2505,37 @@
L.fix()
message_admins("[key_name_admin(usr)] fixed all lights", 1)
if("floorlava")
- if(floorIsLava)
- to_chat(usr, "The floor is lava already.")
+ feedback_inc("admin_secrets_fun_used", 1)
+ feedback_add_details("admin_secrets_fun_used", "LF")
+ var/sure = alert(usr, "Are you sure you want to do this?", "Confirmation", "Yes", "No")
+ if(sure == "No")
return
- feedback_inc("admin_secrets_fun_used",1)
- feedback_add_details("admin_secrets_fun_used","LF")
-
- //Options
- var/length = input(usr, "How long will the lava last? (in seconds)", "Length", 180) as num
- length = min(abs(length), 1200)
-
- var/damage = input(usr, "How deadly will the lava be?", "Damage", 2) as num
- damage = min(abs(damage), 100)
-
- var/sure = alert(usr, "Are you sure you want to do this?", "Confirmation", "YES!", "Nah")
- if(sure == "Nah")
+ weather_master.run_weather("the floor is lava")
+ message_admins("[key_name_admin(usr)] made the floor lava")
+ if("fakelava")
+ feedback_inc("admin_secrets_fun_used", 1)
+ feedback_add_details("admin_secrets_fun_used", "LZ")
+ var/sure = alert(usr, "Are you sure you want to do this?", "Confirmation", "Yes", "No")
+ if(sure == "No")
return
- floorIsLava = 1
-
- message_admins("[key_name_admin(usr)] made the floor LAVA! It'll last [length] seconds and it will deal [damage] damage to everyone.", 1)
-
- for(var/turf/simulated/floor/F in world)
- if((F.z in config.station_levels))
- F.name = "lava"
- F.desc = "The floor is LAVA!"
- F.overlays += "lava"
- F.lava = 1
-
- spawn(0)
- for(var/i = i, i < length, i++) // 180 = 3 minutes
- if(damage)
- for(var/mob/living/carbon/L in living_mob_list)
- if(istype(L.loc, /turf/simulated/floor)) // Are they on LAVA?!
- var/turf/simulated/floor/F = L.loc
- if(F.lava)
- var/safe = 0
- for(var/obj/structure/O in F.contents)
- if(O.level > F.level && !istype(O, /obj/structure/window)) // Something to stand on and it isn't under the floor!
- safe = 1
- break
- if(!safe)
- L.adjustFireLoss(damage)
-
-
- sleep(10)
-
- for(var/turf/simulated/floor/F in world) // Reset everything.
- if((F.z in config.station_levels))
- F.name = initial(F.name)
- F.desc = initial(F.desc)
- F.overlays.Cut()
- F.lava = 0
- F.update_icon()
- floorIsLava = 0
- return
+ weather_master.run_weather("fake lava")
+ message_admins("[key_name_admin(usr)] made aesthetic lava on the floor")
+ if("weatherashstorm")
+ feedback_inc("admin_secrets_fun_used", 1)
+ feedback_add_details("admin_secrets_fun_used", "WA")
+ var/sure = alert(usr, "Are you sure you want to do this?", "Confirmation", "Yes", "No")
+ if(sure == "No")
+ return
+ weather_master.run_weather("ash storm")
+ message_admins("[key_name_admin(usr)] spawned an ash storm on the mining asteroid")
+ if("weatherdarkness")
+ feedback_inc("admin_secrets_fun_used", 1)
+ feedback_add_details("admin_secrets_fun_used", "WD")
+ var/sure = alert(usr, "Are you sure you want to do this?", "Confirmation", "Yes", "No")
+ if(sure == "No")
+ return
+ weather_master.run_weather("advanced darkness")
+ message_admins("[key_name_admin(usr)] made the station go through advanced darkness")
if("retardify")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","RET")
@@ -2483,7 +2549,7 @@
for(var/obj/item/W in world)
if(istype(W, /obj/item/clothing) || istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/weapon/disk) || istype(W, /obj/item/weapon/tank))
continue
- W.icon = 'icons/obj/gun.dmi'
+ W.icon = 'icons/obj/guns/projectile.dmi'
W.icon_state = "revolver"
W.item_state = "gun"
message_admins("[key_name_admin(usr)] made every item look like a gun")
@@ -2495,11 +2561,12 @@
W.item_state = "w_suit"
W.item_color = "schoolgirl"
message_admins("[key_name_admin(usr)] activated Japanese Animes mode")
- to_chat(world, sound('sound/AI/animes.ogg'))
+ world << sound('sound/AI/animes.ogg')
if("eagles")//SCRAW
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","EgL")
- for(var/obj/machinery/door/airlock/W in world)
+ for(var/obj/machinery/door/airlock/W in airlocks)
+ // TODO: Tie into space manager
if((W.z in config.station_levels) && !istype(get_area(W), /area/bridge) && !istype(get_area(W), /area/crew_quarters) && !istype(get_area(W), /area/security/prison))
W.req_access = list()
message_admins("[key_name_admin(usr)] activated Egalitarian Station mode")
@@ -2600,7 +2667,7 @@
if(usr)
log_admin("[key_name(usr)] used secret [href_list["secretsfun"]]")
- if (ok)
+ if(ok)
to_chat(world, text("A secret has been activated by []!", usr.key))
else if(href_list["secretsadmin"])
@@ -2640,7 +2707,7 @@
if("showgm")
if(!ticker)
alert("The game hasn't started yet!")
- else if (ticker.mode)
+ else if(ticker.mode)
alert("The game mode is [ticker.mode.name]")
else alert("For some reason there's a ticker, but not a game mode")
if("manifest")
@@ -2675,9 +2742,9 @@
dat += "
"
usr << browse(dat, "window=fingerprints;size=440x410")
else
- if (usr)
+ if(usr)
log_admin("[key_name(usr)] used secret [href_list["secretsadmin"]]")
- if (ok)
+ if(ok)
to_chat(world, text("A secret has been activated by []!", usr.key))
else if(href_list["secretscoder"])
@@ -2692,13 +2759,13 @@
dat += "No-one has done anything this round!"
usr << browse(dat, "window=admin_log")
if("maint_access_brig")
- for(var/obj/machinery/door/airlock/maintenance/M in world)
- if (access_maint_tunnels in M.req_access)
+ for(var/obj/machinery/door/airlock/maintenance/M in airlocks)
+ if(access_maint_tunnels in M.req_access)
M.req_access = list(access_brig)
message_admins("[key_name_admin(usr)] made all maint doors brig access-only.")
if("maint_access_engiebrig")
- for(var/obj/machinery/door/airlock/maintenance/M in world)
- if (access_maint_tunnels in M.req_access)
+ for(var/obj/machinery/door/airlock/maintenance/M in airlocks)
+ if(access_maint_tunnels in M.req_access)
M.req_access = list()
M.req_one_access = list(access_brig,access_engine)
message_admins("[key_name_admin(usr)] made all maint doors engineering and brig access-only.")
@@ -2715,7 +2782,7 @@
else if(href_list["ac_set_channel_name"])
src.admincaster_feed_channel.channel_name = strip_html_simple(input(usr, "Provide a Feed Channel Name", "Network Channel Handler", ""))
- while (findtext(src.admincaster_feed_channel.channel_name," ") == 1)
+ while(findtext(src.admincaster_feed_channel.channel_name," ") == 1)
src.admincaster_feed_channel.channel_name = copytext(src.admincaster_feed_channel.channel_name,2,lentext(src.admincaster_feed_channel.channel_name)+1)
src.access_news_network()
@@ -2754,7 +2821,7 @@
else if(href_list["ac_set_new_message"])
src.admincaster_feed_message.body = adminscrub(input(usr, "Write your Feed story", "Network Channel Handler", ""))
- while (findtext(src.admincaster_feed_message.body," ") == 1)
+ while(findtext(src.admincaster_feed_message.body," ") == 1)
src.admincaster_feed_message.body = copytext(src.admincaster_feed_message.body,2,lentext(src.admincaster_feed_message.body)+1)
src.access_news_network()
@@ -2808,13 +2875,13 @@
else if(href_list["ac_set_wanted_name"])
src.admincaster_feed_message.author = adminscrub(input(usr, "Provide the name of the Wanted person", "Network Security Handler", ""))
- while (findtext(src.admincaster_feed_message.author," ") == 1)
+ while(findtext(src.admincaster_feed_message.author," ") == 1)
src.admincaster_feed_message.author = copytext(admincaster_feed_message.author,2,lentext(admincaster_feed_message.author)+1)
src.access_news_network()
else if(href_list["ac_set_wanted_desc"])
src.admincaster_feed_message.body = adminscrub(input(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", ""))
- while (findtext(src.admincaster_feed_message.body," ") == 1)
+ while(findtext(src.admincaster_feed_message.body," ") == 1)
src.admincaster_feed_message.body = copytext(src.admincaster_feed_message.body,2,lentext(src.admincaster_feed_message.body)+1)
src.access_news_network()
@@ -2897,7 +2964,7 @@
else if(href_list["ac_setScreen"]) //Brings us to the main menu and resets all fields~
src.admincaster_screen = text2num(href_list["ac_setScreen"])
- if (src.admincaster_screen == 0)
+ if(src.admincaster_screen == 0)
if(src.admincaster_feed_channel)
src.admincaster_feed_channel = new /datum/feed_channel
if(src.admincaster_feed_message)
@@ -2930,6 +2997,16 @@
Secrets(usr)
return 1
+ else if(href_list["viewruntime"])
+ var/datum/ErrorViewer/error_viewer = locate(href_list["viewruntime"])
+ if(!istype(error_viewer))
+ to_chat(usr, "That runtime viewer no longer exists.")
+ return
+ if(href_list["viewruntime_backto"])
+ error_viewer.showTo(usr, locate(href_list["viewruntime_backto"]), href_list["viewruntime_linear"])
+ else
+ error_viewer.showTo(usr, null, href_list["viewruntime_linear"])
+
/proc/admin_jump_link(var/atom/target, var/source)
if(!target) return
// The way admin jump links handle their src is weirdly inconsistent...
diff --git a/code/modules/admin/verbs/SDQL2/SDQL_2.dm b/code/modules/admin/verbs/SDQL2/SDQL_2.dm
index b46e5401528..e07bda7c8ee 100644
--- a/code/modules/admin/verbs/SDQL2/SDQL_2.dm
+++ b/code/modules/admin/verbs/SDQL2/SDQL_2.dm
@@ -89,7 +89,7 @@
if("delete")
for(var/datum/d in objs)
- del(d)
+ qdel(d)
if("select")
var/text = ""
@@ -412,7 +412,7 @@
else if(expression[start + 1] == "\[" && islist(v))
var/list/L = v
var/index = SDQL_expression(source, expression[start + 2])
- if (isnum(index) && (!IsInteger(index) || L.len < index))
+ if(isnum(index) && (!IsInteger(index) || L.len < index))
to_chat(world, "Invalid list index: [index]")
return null
return L[index]
@@ -424,7 +424,7 @@
for(var/arg in arguments)
new_args[++new_args.len] = SDQL_expression(source, arg)
- if (object == world) // Global proc.
+ if(object == world) // Global proc.
procname = "/proc/[procname]"
return call(procname)(arglist(new_args))
diff --git a/code/modules/admin/verbs/SDQL2/SDQL_2_parser.dm b/code/modules/admin/verbs/SDQL2/SDQL_2_parser.dm
index 5aa2aa0dc93..0d0573e3760 100644
--- a/code/modules/admin/verbs/SDQL2/SDQL_2_parser.dm
+++ b/code/modules/admin/verbs/SDQL2/SDQL_2_parser.dm
@@ -358,7 +358,7 @@
else if(token(i + 1) == "\[") // list index
var/list/expression = list()
i = expression(i + 2, expression)
- if (token(i) != "]")
+ if(token(i) != "]")
parse_error("Missing ] at the end of list access.")
L += "\["
diff --git a/code/modules/admin/verbs/adminjump.dm b/code/modules/admin/verbs/adminjump.dm
index 5cbb8dd26d5..2512171e80d 100644
--- a/code/modules/admin/verbs/adminjump.dm
+++ b/code/modules/admin/verbs/adminjump.dm
@@ -24,7 +24,8 @@
admin_forcemove(usr, T)
log_admin("[key_name(usr)] jumped to [A]")
- message_admins("[key_name_admin(usr)] jumped to [A]")
+ if(!isobserver(usr))
+ message_admins("[key_name_admin(usr)] jumped to [A]")
feedback_add_details("admin_verb","JA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/jumptoturf(var/turf/T in world)
@@ -35,7 +36,8 @@
return
log_admin("[key_name(usr)] jumped to [T.x], [T.y], [T.z] in [T.loc]")
- message_admins("[key_name_admin(usr)] jumped to [T.x], [T.y], [T.z] in [T.loc]", 1)
+ if(!isobserver(usr))
+ message_admins("[key_name_admin(usr)] jumped to [T.x], [T.y], [T.z] in [T.loc]", 1)
admin_forcemove(usr, T)
feedback_add_details("admin_verb","JT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return
@@ -48,7 +50,8 @@
return
log_admin("[key_name(usr)] jumped to [key_name(M)]")
- message_admins("[key_name_admin(usr)] jumped to [key_name_admin(M)]", 1)
+ if(!isobserver(usr))
+ message_admins("[key_name_admin(usr)] jumped to [key_name_admin(M)]", 1)
if(src.mob)
var/mob/A = src.mob
var/turf/T = get_turf(M)
@@ -69,7 +72,8 @@
if(T)
admin_forcemove(usr, T)
feedback_add_details("admin_verb","JC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
- message_admins("[key_name_admin(usr)] jumped to coordinates [tx], [ty], [tz]")
+ if(!isobserver(usr))
+ message_admins("[key_name_admin(usr)] jumped to coordinates [tx], [ty], [tz]")
/client/proc/jumptokey()
set category = "Admin"
@@ -87,7 +91,8 @@
return
var/mob/M = selection:mob
log_admin("[key_name(usr)] jumped to [key_name(M)]")
- message_admins("[key_name_admin(usr)] jumped to [key_name_admin(M)]", 1)
+ if(!isobserver(usr))
+ message_admins("[key_name_admin(usr)] jumped to [key_name_admin(M)]", 1)
admin_forcemove(usr, M.loc)
diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm
index e533a4716b6..319830d0235 100644
--- a/code/modules/admin/verbs/adminpm.dm
+++ b/code/modules/admin/verbs/adminpm.dm
@@ -99,7 +99,7 @@
adminhelp(msg) //admin we are replying to has vanished, adminhelp instead
return
- if (src.handle_spam_prevention(msg,MUTE_ADMINHELP))
+ if(src.handle_spam_prevention(msg,MUTE_ADMINHELP))
return
//clean the message if it's not sent by a high-rank admin
diff --git a/code/modules/admin/verbs/adminsay.dm b/code/modules/admin/verbs/adminsay.dm
index 3f116b0a0d5..784f924966f 100644
--- a/code/modules/admin/verbs/adminsay.dm
+++ b/code/modules/admin/verbs/adminsay.dm
@@ -27,7 +27,7 @@
msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
log_admin("MOD: [key_name(src)] : [msg]")
- if (!msg)
+ if(!msg)
return
var/spanclass = "mod_channel"
diff --git a/code/modules/admin/verbs/atmosdebug.dm b/code/modules/admin/verbs/atmosdebug.dm
index e1225275e17..85591ee3159 100644
--- a/code/modules/admin/verbs/atmosdebug.dm
+++ b/code/modules/admin/verbs/atmosdebug.dm
@@ -6,37 +6,41 @@
to_chat(src, "Only administrators may use this command.")
return
feedback_add_details("admin_verb","CP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
-
+
if(alert("WARNING: This command should not be run on a live server. Do you want to continue?", "Check Piping", "No", "Yes") == "No")
return
to_chat(usr, "Checking for disconnected pipes...")
//all plumbing - yes, some things might get stated twice, doesn't matter.
- for (var/obj/machinery/atmospherics/plumbing in world)
- if (plumbing.nodealert)
+ for(var/obj/machinery/atmospherics/plumbing in world)
+ if(plumbing.nodealert)
to_chat(usr, "Unconnected [plumbing.name] located at [plumbing.x],[plumbing.y],[plumbing.z] ([get_area(plumbing.loc)])")
//Manifolds
- for (var/obj/machinery/atmospherics/pipe/manifold/pipe in world)
- if (!pipe.node1 || !pipe.node2 || !pipe.node3)
+ for(var/obj/machinery/atmospherics/pipe/manifold/pipe in world)
+ if(!pipe.node1 || !pipe.node2 || !pipe.node3)
to_chat(usr, "Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])")
//Pipes
- for (var/obj/machinery/atmospherics/pipe/simple/pipe in world)
- if (!pipe.node1 || !pipe.node2)
+ for(var/obj/machinery/atmospherics/pipe/simple/pipe in world)
+ if(!pipe.node1 || !pipe.node2)
to_chat(usr, "Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])")
to_chat(usr, "Checking for overlapping pipes...")
- next_turf:
- for(var/turf/T in world)
- for(var/dir in cardinal)
- var/check = 0
- for(var/obj/machinery/atmospherics/pipe in T)
- if(dir & pipe.initialize_directions)
- check++
- if(check > 1)
+ for(var/turf/T in world)
+ for(var/dir in cardinal)
+ var/list/check = list(0, 0, 0)
+ var/done = 0
+ for(var/obj/machinery/atmospherics/pipe in T)
+ if(dir & pipe.initialize_directions)
+ for(var/ct in pipe.connect_types)
+ check[ct]++
+ if(check[ct] > 1)
to_chat(usr, "Overlapping pipe ([pipe.name]) located at [T.x],[T.y],[T.z] ([get_area(T)])")
- continue next_turf
+ done = 1
+ break
+ if(done)
+ break
to_chat(usr, "Done")
/client/proc/powerdebug()
@@ -47,13 +51,13 @@
return
feedback_add_details("admin_verb","CPOW") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
- for (var/datum/powernet/PN in powernets)
- if (!PN.nodes || !PN.nodes.len)
+ for(var/datum/powernet/PN in powernets)
+ if(!PN.nodes || !PN.nodes.len)
if(PN.cables && (PN.cables.len > 1))
var/obj/structure/cable/C = PN.cables[1]
to_chat(usr, "Powernet with no nodes! (number [PN.number]) - example cable at [C.x], [C.y], [C.z] in area [get_area(C.loc)]")
- if (!PN.cables || (PN.cables.len < 10))
+ if(!PN.cables || (PN.cables.len < 10))
if(PN.cables && (PN.cables.len > 1))
var/obj/structure/cable/C = PN.cables[1]
to_chat(usr, "Powernet with fewer than 10 cables! (number [PN.number]) - example cable at [C.x], [C.y], [C.z] in area [get_area(C.loc)]")
diff --git a/code/modules/admin/verbs/cinematic.dm b/code/modules/admin/verbs/cinematic.dm
index 570d73e19a8..3449350e11f 100644
--- a/code/modules/admin/verbs/cinematic.dm
+++ b/code/modules/admin/verbs/cinematic.dm
@@ -1,17 +1,17 @@
-/client/proc/cinematic(var/cinematic as anything in list("explosion",null))
- set name = "Play cinematic"
+/client/proc/cinematic(cinematic as anything in list("explosion", null))
+ set name = "cinematic"
set category = "Debug"
- set desc = "Shows a cinematic, will work like a normal nuke" // Intended for testing but I thought it might be nice for events on the rare occasion Feel free to comment it out if it's not wanted.
- if(alert("Are you sure you want to run [cinematic]?","Confirmation","Yes","No")=="No") return
- if(!ticker) return
+ set desc = "Shows a cinematic." // Intended for testing but I thought it might be nice for events on the rare occasion Feel free to comment it out if it's not wanted.
+ set hidden = 1
+ if(!ticker)
+ return
switch(cinematic)
if("explosion")
- var/parameter = input(src,"station_missed = ?","Enter Parameter",0) as num
+ var/parameter = input(src, "station_missed = ?", "Enter Parameter", 0) as num
var/override
switch(parameter)
if(1)
- override = input(src,"mode = ?","Enter Parameter",null) as anything in list("nuclear emergency","no override")
+ override = input(src, "mode = ?","Enter Parameter", null) as anything in list("nuclear emergency", "fake", "no override")
if(0)
- override = input(src,"mode = ?","Enter Parameter",null) as anything in list("blob","nuclear emergency","AI malfunction","no override")
- ticker.station_explosion_cinematic(parameter,override)
- return
\ No newline at end of file
+ override = input(src, "mode = ?","Enter Parameter", null) as anything in list("blob", "nuclear emergency", "AI malfunction", "no override")
+ ticker.station_explosion_cinematic(parameter, override)
\ No newline at end of file
diff --git a/code/modules/admin/verbs/deadsay.dm b/code/modules/admin/verbs/deadsay.dm
index 74596c333cc..690cac87536 100644
--- a/code/modules/admin/verbs/deadsay.dm
+++ b/code/modules/admin/verbs/deadsay.dm
@@ -17,24 +17,24 @@
to_chat(src, "You have deadchat muted.")
return
- if (handle_spam_prevention(msg,MUTE_DEADCHAT))
+ if(handle_spam_prevention(msg,MUTE_DEADCHAT))
return
var/stafftype = null
- if (check_rights(R_MENTOR, 0))
+ if(check_rights(R_MENTOR, 0))
stafftype = "MENTOR"
- if (check_rights(R_MOD, 0))
+ if(check_rights(R_MOD, 0))
stafftype = "MOD"
- if (check_rights(R_ADMIN, 0))
+ if(check_rights(R_ADMIN, 0))
stafftype = "ADMIN"
msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
log_admin("[key_name(src)] : [msg]")
- if (!msg)
+ if(!msg)
return
var/prefix = "[stafftype] ([src.key])"
diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm
index 6b3c78cf954..2c930080edc 100644
--- a/code/modules/admin/verbs/debug.dm
+++ b/code/modules/admin/verbs/debug.dm
@@ -194,7 +194,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
return
var/turf/T = mob.loc
- if (!( istype(T, /turf) ))
+ if(!( istype(T, /turf) ))
return
var/datum/gas_mixture/env = T.return_air()
@@ -373,6 +373,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
for(var/I in singularities)
var/obj/singularity/S = I
+ // TODO: Tie into space manager
if(S.z == ZLEVEL_CENTCOMM || S.z >= MAX_Z)
continue
qdel(S)
@@ -399,12 +400,12 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
if(!check_rights(R_EVENT))
return
- if (!ticker)
+ if(!ticker)
alert("Wait until the game starts")
return
- if (istype(M, /mob/living/carbon/human))
+ if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
- if (H.wear_id)
+ if(H.wear_id)
var/obj/item/weapon/card/id/id = H.wear_id
if(istype(H.wear_id, /obj/item/device/pda))
var/obj/item/device/pda/pda = H.wear_id
@@ -593,66 +594,85 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
"tournament janitor",
"pirate",
"space pirate",
+ "soviet tourist",
+ "soviet soldier",
"soviet admiral",
"tunnel clown",
+ "mime assassin",
+ "survivor",
+ "greytide",
+ "greytide leader",
+ "greytide xeno",
"masked killer",
"singuloth knight",
"dark lord",
"assassin",
+ "spy",
+ "vox",
"death commando",
- "syndicate commando",
+ "syndicate agent",
+ "syndicate operative",
+ "syndicate bomber",
+ "syndicate strike team",
+ "syndicate officer",
"chrono legionnaire",
- "special ops officer",
- "special ops formal",
"blue wizard",
"red wizard",
"marisa wizard",
"emergency response team member",
"emergency response team leader",
- "nanotrasen officer",
- "nanotrasen captain",
+ "nt vip guest",
+ "nt navy officer", // now in jobs list
+ "nt navy captain",
+ "nt special ops officer", // now in jobs list
+ "nt special ops formal",
)
- var/dostrip = input("Do you want to strip [M] before equipping them? (0=no, 1=yes)", "STRIPTEASE") as null|anything in list(0,1)
- if(isnull(dostrip))
- return
+ var/dostrip = 0
+ switch(alert("Strip [M] before dressing?", "Strip?", "Yes", "No", "Cancel"))
+ if("Yes")
+ dostrip = 1
+ if("Cancel")
+ return
var/dresscode = input("Select dress for [M]", "Robust quick dress shop") as null|anything in dresspacks
- if (isnull(dresscode))
+ if(isnull(dresscode))
return
-
var/datum/job/jobdatum
- if (dresscode == "as job...")
+ if(dresscode == "as job...")
var/jobname = input("Select job", "Robust quick dress shop") as null|anything in get_all_jobs()
jobdatum = job_master.GetJob(jobname)
- feedback_add_details("admin_verb","SEQ") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+ feedback_add_details("admin_verb", "SEQ") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
if(dostrip)
- for (var/obj/item/I in M)
- if (istype(I, /obj/item/weapon/implant))
+ for(var/obj/item/I in M)
+ if(istype(I, /obj/item/weapon/implant))
continue
if(istype(I, /obj/item/organ))
continue
qdel(I)
switch(dresscode)
- if ("strip")
+ if("strip")
//do nothing
- if ("as job...")
+ if("as job...")
if(jobdatum)
dresscode = "[jobdatum.title]"
jobdatum.equip(M)
+ equip_special_id(M,jobdatum.access,jobdatum.title, jobdatum.idtype)
- if ("standard space gear")
+ if("standard space gear")
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
-
M.equip_to_slot_or_del(new /obj/item/clothing/under/color/grey(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space(M), slot_head)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
var /obj/item/weapon/tank/jetpack/J = new /obj/item/weapon/tank/jetpack/oxygen(M)
M.equip_to_slot_or_del(J, slot_back)
- J.toggle()
+ J.turn_on()
M.equip_to_slot_or_del(new /obj/item/clothing/mask/breath(M), slot_wear_mask)
J.Topic(null, list("stat" = 1))
- if ("Engineer RIG","CE RIG","Mining RIG","Syndi RIG","Wizard RIG","Medical RIG","Atmos RIG")
+ equip_special_id(M,get_all_accesses(), "Space Explorer", /obj/item/weapon/card/id)
+
+ if("Engineer RIG", "CE RIG", "Mining RIG", "Syndi RIG", "Wizard RIG", "Medical RIG", "Atmos RIG")
if(dresscode=="Engineer RIG")
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/rig(M), slot_head)
@@ -676,61 +696,53 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/rig/atmos(M), slot_head)
var /obj/item/weapon/tank/jetpack/J = new /obj/item/weapon/tank/jetpack/oxygen(M)
M.equip_to_slot_or_del(J, slot_back)
- J.toggle()
+ J.turn_on()
M.equip_to_slot_or_del(new /obj/item/clothing/mask/breath(M), slot_wear_mask)
+ equip_special_id(M,get_all_accesses(), "RIG Tester", /obj/item/weapon/card/id)
J.Topic(null, list("stat" = 1))
- if ("tournament standard red","tournament standard green") //we think stunning weapon is too overpowered to use it on tournaments. --rastaf0
- if (dresscode=="tournament standard red")
+ if("tournament standard red", "tournament standard green") //we think stunning weapon is too overpowered to use it on tournaments. --rastaf0
+ if(dresscode=="tournament standard red")
M.equip_to_slot_or_del(new /obj/item/clothing/under/color/red(M), slot_w_uniform)
else
M.equip_to_slot_or_del(new /obj/item/clothing/under/color/green(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
-
M.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/thunderdome(M), slot_head)
-
- M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle/destroyer(M), slot_r_hand)
+ M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse/destroyer(M), slot_r_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/kitchen/knife(M), slot_l_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/grenade/smokebomb(M), slot_r_store)
-
- if ("tournament gangster") //gangster are supposed to fight each other. --rastaf0
+ if("tournament gangster") //gangster are supposed to fight each other. --rastaf0
M.equip_to_slot_or_del(new /obj/item/clothing/under/det(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
-
M.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/det_suit(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/monocle(M), slot_glasses)
M.equip_to_slot_or_del(new /obj/item/clothing/head/det_hat(M), slot_head)
-
-
M.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/automatic/proto(M), slot_r_hand)
M.equip_to_slot_or_del(new /obj/item/ammo_box/a357(M), slot_l_store)
- if ("tournament chef") //Steven Seagal FTW
+ if("tournament chef") //Steven Seagal FTW
M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chef(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/chef(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/head/chefhat(M), slot_head)
-
M.equip_to_slot_or_del(new /obj/item/weapon/kitchen/rollingpin(M), slot_r_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/kitchen/knife(M), slot_l_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/kitchen/knife(M), slot_r_store)
M.equip_to_slot_or_del(new /obj/item/weapon/kitchen/knife(M), slot_s_store)
- if ("tournament janitor")
+ if("tournament janitor")
M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/janitor(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
var/obj/item/weapon/storage/backpack/backpack = new(M)
for(var/obj/item/I in backpack)
- del(I)
+ qdel(I)
M.equip_to_slot_or_del(backpack, slot_back)
-
M.equip_to_slot_or_del(new /obj/item/weapon/mop(M), slot_r_hand)
var/obj/item/weapon/reagent_containers/glass/bucket/bucket = new(M)
bucket.reagents.add_reagent("water", 70)
M.equip_to_slot_or_del(bucket, slot_l_hand)
-
M.equip_to_slot_or_del(new /obj/item/weapon/grenade/chem_grenade/cleaner(M), slot_r_store)
M.equip_to_slot_or_del(new /obj/item/weapon/grenade/chem_grenade/cleaner(M), slot_l_store)
M.equip_to_slot_or_del(new /obj/item/stack/tile/plasteel(M), slot_in_backpack)
@@ -741,51 +753,141 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/stack/tile/plasteel(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/stack/tile/plasteel(M), slot_in_backpack)
- if ("pirate")
+ if("pirate")
M.equip_to_slot_or_del(new /obj/item/clothing/under/pirate(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/head/bandana(M), slot_head)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/eyepatch(M), slot_glasses)
M.equip_to_slot_or_del(new /obj/item/weapon/melee/energy/sword/pirate(M), slot_r_hand)
+ equip_special_id(M,list(access_maint_tunnels), "Pirate", /obj/item/weapon/card/id)
- if ("space pirate")
+ if("space pirate") // not spaceworthy, just has fancier coat.
M.equip_to_slot_or_del(new /obj/item/clothing/under/pirate(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/pirate(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/pirate(M), slot_head)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/eyepatch(M), slot_glasses)
-
M.equip_to_slot_or_del(new /obj/item/weapon/melee/energy/sword/pirate(M), slot_r_hand)
+ equip_special_id(M,list(access_maint_tunnels), "Space Pirate", /obj/item/weapon/card/id)
- if ("soviet soldier")
- M.equip_to_slot_or_del(new /obj/item/clothing/under/soviet(M), slot_w_uniform)
- M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
- M.equip_to_slot_or_del(new /obj/item/clothing/head/ushanka(M), slot_head)
-
- if("tunnel clown")//Tunnel clowns rule!
+ if("tunnel clown")
M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/clown(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/clown_shoes(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/black(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/clown_hat(M), slot_wear_mask)
M.equip_to_slot_or_del(new /obj/item/clothing/head/chaplain_hood(M), slot_head)
M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/utility/full/multitool(M), slot_belt)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/monocle(M), slot_glasses)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/chaplain_hoodie(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/food/snacks/grown/banana(M), slot_l_store)
M.equip_to_slot_or_del(new /obj/item/weapon/bikehorn(M), slot_r_store)
-
- var/obj/item/weapon/card/id/W = new(M)
- W.name = "[M.real_name]'s ID Card (Tunnel Clown!)"
- W.access = get_all_accesses()
- W.assignment = "Tunnel Clown!"
- W.registered_name = M.real_name
- M.equip_to_slot_or_del(W, slot_wear_id)
-
+ equip_special_id(M,list(access_clown, access_theatre, access_maint_tunnels), "Tunnel Clown", /obj/item/weapon/card/id)
+ M.equip_to_slot_or_del(new /obj/item/device/flashlight(M), slot_in_backpack)
var/obj/item/weapon/twohanded/fireaxe/fire_axe = new(M)
M.equip_to_slot_or_del(fire_axe, slot_r_hand)
+
+ if("mime assassin")
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/mime(M), slot_back)
+ if(M.gender == FEMALE)
+ M.equip_or_collect(new /obj/item/clothing/under/sexymime(M), slot_w_uniform)
+ M.equip_or_collect(new /obj/item/clothing/mask/gas/sexymime(M), slot_wear_mask)
+ else
+ M.equip_or_collect(new /obj/item/clothing/under/mime(M), slot_w_uniform)
+ M.equip_or_collect(new /obj/item/clothing/mask/gas/mime(M), slot_wear_mask)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/white(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/clothing/head/beret(M), slot_head)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/utility/full/multitool(M), slot_belt)
+ M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/monocle(M), slot_glasses)
+ M.equip_to_slot_or_del(new /obj/item/clothing/suit/suspenders(M), slot_wear_suit)
+ M.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/food/drinks/bottle/bottleofnothing(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/syndie_kit/caneshotgun, slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/toy/crayon/mime, slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/automatic/pistol(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/suppressor(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/ammo_casing/shotgun/incendiary/dragonsbreath(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/ammo_casing/shotgun/incendiary/dragonsbreath(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/pen/sleepy(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/reagent_containers/food/snacks/syndidonkpocket(M), slot_in_backpack)
+ var/obj/item/device/pda/mime/pda = new(M)
+ pda.owner = M.real_name
+ pda.ownjob = "Mime"
+ pda.name = "PDA-[M.real_name] ([pda.ownjob])"
+ M.equip_to_slot_or_del(pda, slot_wear_pda)
+ equip_special_id(M,list(access_mime, access_theatre, access_maint_tunnels), "Mime", /obj/item/weapon/card/id/syndicate)
+ M.equip_to_slot_or_del(new /obj/item/device/flashlight(M), slot_in_backpack)
+
+ if("survivor")
+ M.equip_to_slot_or_del(new /obj/item/clothing/under/overalls(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/latex(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
+ equip_special_id(M,list(access_maint_tunnels), "Survivor", /obj/item/weapon/card/id)
+ for(var/obj/item/carried_item in M.contents)
+ if(!istype(carried_item, /obj/item/weapon/implant))
+ carried_item.add_blood(M)
+
+ if("greytide")
+ M.equip_to_slot_or_del(new /obj/item/clothing/under/color/grey(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(M), slot_wear_mask)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/toolbox/mechanical(M), slot_l_hand)
+ M.equip_to_slot_or_del(new /obj/item/flag/grey(M), slot_r_hand)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/device/flashlight(M), slot_in_backpack)
+ equip_special_id(M,list(access_maint_tunnels), "Greytide", /obj/item/weapon/card/id)
+
+ if("greytide leader")
+ M.equip_to_slot_or_del(new /obj/item/clothing/under/color/grey(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(M), slot_wear_mask)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/toolbox/mechanical(M), slot_l_hand)
+ M.equip_to_slot_or_del(new /obj/item/flag/grey(M), slot_r_hand)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/yellow(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/utility/full/multitool(M), slot_belt)
+ M.equip_to_slot_or_del(new /obj/item/clothing/head/welding(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/flashlight(M), slot_in_backpack)
+ equip_special_id(M,list(access_maint_tunnels), "Greytide Leader", /obj/item/weapon/card/id)
+
+ if("greytide xeno")
+ M.equip_to_slot_or_del(new /obj/item/clothing/under/color/black(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(M), slot_wear_mask)
+ M.equip_to_slot_or_del(new /obj/item/clothing/suit/xenos(M), slot_wear_suit)
+ M.equip_to_slot_or_del(new /obj/item/clothing/head/xenos(M), slot_head)
+ M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal(M), slot_glasses)
+ M.equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen/double/full(M), slot_l_store)
+ M.equip_to_slot_or_del(new /obj/item/toy/toy_xeno(M), slot_r_store)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/yellow(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/utility/full/multitool(M), slot_belt)
+ M.equip_to_slot_or_del(new /obj/item/clothing/head/welding(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/flashlight(M), slot_in_backpack)
+ equip_special_id(M,list(access_maint_tunnels), "Legit Xenomorph", /obj/item/weapon/card/id)
+
if("masked killer")
M.equip_to_slot_or_del(new /obj/item/clothing/under/overalls(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/latex(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/clothing/mask/surgical(M), slot_wear_mask)
@@ -795,46 +897,42 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/clothing/suit/apron(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/weapon/kitchen/knife(M), slot_l_store)
M.equip_to_slot_or_del(new /obj/item/weapon/scalpel(M), slot_r_store)
-
+ M.equip_to_slot_or_del(new /obj/item/device/flashlight(M), slot_in_backpack)
+ equip_special_id(M,list(access_maint_tunnels), "Masked Killer", /obj/item/weapon/card/id/syndicate, "syndie")
var/obj/item/weapon/twohanded/fireaxe/fire_axe = new(M)
M.equip_to_slot_or_del(fire_axe, slot_r_hand)
-
for(var/obj/item/carried_item in M.contents)
- if(!istype(carried_item, /obj/item/weapon/implant))//If it's not an implant.
+ if(!istype(carried_item, /obj/item/weapon/implant))
carried_item.add_blood(M)//Oh yes, there will be blood...
if("dark lord")
M.equip_to_slot_or_del(new /obj/item/clothing/under/color/black(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/black(M), slot_gloves)
- M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/flashlight(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset/syndicate(M), slot_l_ear)
M.equip_to_slot_or_del(new /obj/item/weapon/twohanded/dualsaber/red(M), slot_l_hand)
-
var/obj/item/clothing/head/chaplain_hood/hood = new(M)
hood.name = "dark lord hood"
M.equip_to_slot_or_del(hood, slot_head)
-
var/obj/item/clothing/suit/chaplain_hoodie/robe = new(M)
robe.name = "dark lord robes"
M.equip_to_slot_or_del(robe, slot_wear_suit)
-
- var/obj/item/weapon/card/id/syndicate/W = new(M)
- W.name = "[M.real_name]'s ID Card (Dark Lord)"
- W.icon_state = "syndie"
- W.access = get_all_accesses()
- W.assignment = "Dark Lord"
- W.registered_name = M.real_name
- M.equip_to_slot_or_del(W, slot_wear_id)
+ equip_special_id(M,get_all_accesses(), "Dark Lord", /obj/item/weapon/card/id/syndicate, "syndie")
if("assassin")
M.equip_to_slot_or_del(new /obj/item/clothing/under/suit_jacket(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/black(M), slot_gloves)
- M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset/syndicate(M), slot_l_ear)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(M), slot_glasses)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/wcoat(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/weapon/melee/energy/sword/saber(M), slot_l_store)
-
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/flashlight(M), slot_in_backpack)
var/obj/item/weapon/storage/secure/briefcase/sec_briefcase = new(M)
for(var/obj/item/briefcase_item in sec_briefcase)
qdel(briefcase_item)
@@ -843,163 +941,282 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
sec_briefcase.contents += new /obj/item/weapon/gun/energy/kinetic_accelerator/crossbow
sec_briefcase.contents += new /obj/item/weapon/gun/projectile/revolver/mateba
sec_briefcase.contents += new /obj/item/ammo_box/a357
- sec_briefcase.contents += new /obj/item/weapon/c4
+ sec_briefcase.contents += new /obj/item/weapon/grenade/plastic/c4
+ // briefcase must be unlocked by setting the code.
M.equip_to_slot_or_del(sec_briefcase, slot_l_hand)
-
+ var/obj/item/weapon/implant/dust/DUST = new /obj/item/weapon/implant/dust(M)
+ DUST.implant(M)
var/obj/item/device/pda/heads/pda = new(M)
pda.owner = M.real_name
pda.ownjob = "Reaper"
pda.name = "PDA-[M.real_name] ([pda.ownjob])"
+ M.equip_to_slot_or_del(pda, slot_wear_pda)
+ equip_special_id(M,get_all_accesses(), "Reaper", /obj/item/weapon/card/id/syndicate, "syndie")
+ if("spy")
+ M.equip_to_slot_or_del(new /obj/item/clothing/under/suit_jacket/really_black(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/automatic/pistol(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/suppressor(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/card/emag(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/flashlight(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/clothing/glasses/hud/security/chameleon(M), slot_glasses)
+ var/obj/item/clothing/gloves/combat/G = new /obj/item/clothing/gloves/combat(src)
+ G.name = "black gloves"
+ M.equip_to_slot_or_del(G, slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset/syndicate(M), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/weapon/melee/energy/sword/saber(M), slot_l_store)
+ M.equip_to_slot_or_del(new /obj/item/weapon/pen/sleepy(M), slot_r_store)
+ var/obj/item/weapon/implant/dust/DUST = new /obj/item/weapon/implant/dust(M)
+ DUST.implant(M)
+ M.equip_to_slot_or_del(new /obj/item/weapon/implanter/storage(M), slot_in_backpack)
+ var/obj/item/device/pda/heads/pda = new(M)
+ pda.owner = M.real_name
+ pda.ownjob = "Spy"
+ pda.name = "PDA-[M.real_name] ([pda.ownjob])"
M.equip_to_slot_or_del(pda, slot_belt)
+ equip_special_id(M,list(access_maint_tunnels), "Spy", /obj/item/weapon/card/id/syndicate, "syndie")
- var/obj/item/weapon/card/id/syndicate/W = new(M)
- W.name = "[M.real_name]'s ID Card (Reaper)"
- W.icon_state = "syndie"
- W.access = get_all_accesses()
- W.assignment = "Reaper"
- W.registered_name = M.real_name
- M.equip_to_slot_or_del(W, slot_wear_id)
- if("death commando")//Was looking to add this for a while.
+ if("vox")
+ if(istype(M, /mob/living/carbon/human/voxarmalis)) // have to do this, they cannot wear normal vox gear!
+ M.equip_to_slot_or_del(new /obj/item/clothing/under/vox_grey(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/syndicate(M), slot_wear_mask)
+ M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/vox/carapace(M), slot_wear_suit)
+ M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/vox/carapace(M), slot_head)
+ M.equip_to_slot_or_del(new /obj/item/clothing/under/vox/vox_robes (M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/magboots/vox(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/weapon/card/id/syndicate/vox(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset/syndicate, slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/yellow/vox, slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/weapon/melee/classic_baton/telescopic, slot_l_store)
+ M.equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen/vox, slot_r_store)
+ M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/monocle, slot_glasses)
+ M.equip_to_slot_or_del(new /obj/item/device/flashlight, slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/restraints/handcuffs/cable/zipties, slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/flash, slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/noisecannon, slot_in_backpack)
+ equip_special_id(M,get_all_accesses(), "Vox Armalis", /obj/item/weapon/card/id/syndicate/vox, "syndie")
+ else
+ M.equip_vox_raider()
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_l_hand)
+ M.regenerate_icons()
+
+ if("death commando")
M.equip_death_commando()
- if("syndicate commando")
+ if("syndicate agent")
+ M.equip_or_collect(new /obj/item/clothing/under/syndicate(M), slot_w_uniform)
+ M.equip_or_collect(new /obj/item/clothing/shoes/combat(M), slot_shoes)
+ M.equip_or_collect(new /obj/item/clothing/gloves/combat(M), slot_gloves)
+ M.equip_or_collect(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_or_collect(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/device/flashlight(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/card/emag(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/storage/belt/utility/full/multitool(M), slot_belt)
+ M.equip_or_collect(new /obj/item/weapon/reagent_containers/food/snacks/syndidonkpocket(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/device/radio/headset/syndicate(M), slot_l_ear)
+ equip_special_id(M,get_syndicate_access("Syndicate Operative"), "Syndicate Agent", /obj/item/weapon/card/id/syndicate, "syndie")
+ var/obj/item/device/radio/uplink/U = new /obj/item/device/radio/uplink(M)
+ U.hidden_uplink.uplink_owner="[M.key]"
+ U.hidden_uplink.uses = 20
+ M.equip_to_slot_or_del(U, slot_r_store)
+
+ if("syndicate bomber")
+ M.equip_or_collect(new /obj/item/clothing/under/syndicate(M), slot_w_uniform)
+ M.equip_or_collect(new /obj/item/clothing/shoes/combat(M), slot_shoes)
+ M.equip_or_collect(new /obj/item/clothing/gloves/combat(M), slot_gloves)
+ M.equip_or_collect(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_or_collect(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/device/flashlight(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/card/emag(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/beacon/syndicate/bomb(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/beacon/syndicate/bomb(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/syndicatedetonator(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/storage/belt/utility/full/multitool(M), slot_belt)
+ M.equip_or_collect(new /obj/item/weapon/reagent_containers/food/snacks/syndidonkpocket(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/device/radio/headset/syndicate(M), slot_l_ear)
+ equip_special_id(M,get_syndicate_access("Syndicate Operative"), "Syndicate Bomber", /obj/item/weapon/card/id/syndicate, "syndie")
+
+ if("syndicate operative")
+ M.equip_or_collect(new /obj/item/clothing/under/syndicate(M), slot_w_uniform)
+ M.equip_or_collect(new /obj/item/clothing/shoes/combat(M), slot_shoes)
+ M.equip_or_collect(new /obj/item/clothing/gloves/combat(M), slot_gloves)
+ M.equip_or_collect(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_or_collect(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/reagent_containers/food/pill/initropidril(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/gun/projectile/automatic/pistol(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/ammo_box/magazine/m10mm(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/crowbar/red(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/clothing/glasses/night(M), slot_glasses)
+ M.equip_or_collect(new /obj/item/weapon/storage/belt/military(M), slot_belt)
+ M.equip_or_collect(new /obj/item/weapon/grenade/plastic/c4(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/pinpointer/advpinpointer(M), slot_l_store)
+ M.equip_or_collect(new /obj/item/weapon/reagent_containers/food/snacks/syndidonkpocket(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/device/flashlight(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/clothing/mask/gas/syndicate(M), slot_wear_mask)
+ M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/syndi(M), slot_wear_suit)
+ M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/rig/syndi(M), slot_head)
+ var/obj/item/device/radio/R = new /obj/item/device/radio/headset/syndicate/alt(M)
+ R.set_frequency(SYND_FREQ)
+ M.equip_to_slot_or_del(R, slot_l_ear)
+ var/obj/item/device/radio/uplink/U = new /obj/item/device/radio/uplink(M)
+ U.hidden_uplink.uplink_owner="[M.key]"
+ U.hidden_uplink.uses = 20
+ M.equip_to_slot_or_del(U, slot_r_store)
+ M.equip_or_collect(new /obj/item/weapon/tank/jetpack/oxygen/harness(M), slot_in_backpack)
+ equip_special_id(M,get_syndicate_access("Syndicate Operative"), "Syndicate Operative", /obj/item/weapon/card/id/syndicate, "syndie")
+ var/obj/item/weapon/implant/explosive/E = new/obj/item/weapon/implant/explosive(M)
+ E.implant(M)
+
+ if("syndicate strike team")
M.equip_syndicate_commando()
- if("nanotrasen officer")
+ if("syndicate officer")
+ M.equip_or_collect(new /obj/item/clothing/under/syndicate(M), slot_w_uniform)
+ M.equip_or_collect(new /obj/item/clothing/shoes/combat(M), slot_shoes)
+ M.equip_or_collect(new /obj/item/clothing/gloves/combat(M), slot_gloves)
+ M.equip_or_collect(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_or_collect(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/reagent_containers/food/pill/initropidril(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/clothing/glasses/thermal(M), slot_glasses)
+ M.equip_or_collect(new /obj/item/weapon/storage/belt/military(M), slot_belt)
+ M.equip_or_collect(new /obj/item/weapon/pinpointer/advpinpointer(M), slot_l_store)
+ M.equip_or_collect(new /obj/item/weapon/reagent_containers/food/snacks/syndidonkpocket(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/clothing/mask/gas/syndicate(M), slot_wear_mask)
+ M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/syndicate/black/red/strike(M), slot_wear_suit)
+ M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/syndicate/black/red/strike(M), slot_head)
+ var/obj/item/device/radio/R = new /obj/item/device/radio/headset/syndicate/alt(M)
+ R.set_frequency(SYND_FREQ)
+ M.equip_to_slot_or_del(R, slot_l_ear)
+ var/obj/item/device/radio/uplink/U = new /obj/item/device/radio/uplink(M)
+ U.hidden_uplink.uplink_owner="[M.key]"
+ U.hidden_uplink.uses = 50
+ M.equip_to_slot_or_del(U, slot_r_store)
+ M.equip_or_collect(new /obj/item/weapon/tank/jetpack/oxygen/harness(M), slot_in_backpack)
+ equip_special_id(M,get_all_accesses() + get_syndicate_access("Syndicate Commando"), "Syndicate Officer", /obj/item/weapon/card/id/syndicate, "commander")
+ var/obj/item/weapon/implant/dust/DUST = new /obj/item/weapon/implant/dust(M)
+ DUST.implant(M)
+ if("nt vip guest")
+ M.equip_or_collect(new /obj/item/clothing/under/suit_jacket/really_black(M), slot_w_uniform)
+ M.equip_or_collect(new /obj/item/clothing/shoes/black(M), slot_shoes)
+ M.equip_or_collect(new /obj/item/clothing/gloves/color/black(M), slot_gloves)
+ M.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
+ M.equip_or_collect(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/clothing/head/that(M), slot_head)
+ M.equip_or_collect(new /obj/item/device/radio/headset/ert(M), slot_l_ear)
+ M.equip_or_collect(new /obj/item/device/pda/(M), slot_wear_pda)
+ equip_special_id(M,get_centcom_access("VIP Guest"), "VIP Guest", /obj/item/weapon/card/id/centcom)
+
+ if("nt navy officer")
+ M.equip_or_collect(new /obj/item/clothing/under/rank/centcom/officer(M), slot_w_uniform)
M.equip_or_collect(new /obj/item/clothing/shoes/centcom(M), slot_shoes)
M.equip_or_collect(new /obj/item/clothing/gloves/color/white(M), slot_gloves)
- M.equip_or_collect(new /obj/item/device/radio/headset/heads/captain/alt(M), slot_l_ear)
+ M.equip_or_collect(new /obj/item/device/radio/headset/centcom(M), slot_l_ear)
M.equip_or_collect(new /obj/item/clothing/head/beret/centcom/officer(M), slot_head)
+ M.equip_or_collect(new /obj/item/device/pda/centcom(M), slot_wear_pda)
+ M.equip_or_collect(new /obj/item/clothing/glasses/hud/security/sunglasses(M), slot_glasses)
+ M.equip_or_collect(new /obj/item/weapon/gun/energy/pulse/pistol(M), slot_belt)
+ M.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
+ M.equip_or_collect(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/implanter/dust(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/implanter/death_alarm(M), slot_in_backpack)
+ var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(M)
+ L.imp_in = M
+ L.implanted = 1
+ M.sec_hud_set_implants()
+ equip_special_id(M,get_centcom_access("Nanotrasen Navy Officer"), "Nanotrasen Navy Officer", /obj/item/weapon/card/id/centcom)
- var/obj/item/device/pda/centcom/pda = new(M)
- pda.owner = M.real_name
- pda.ownjob = "Nanotrasen Navy Officer"
- pda.name = "PDA-[M.real_name] ([pda.ownjob])"
-
- M.equip_or_collect(pda, slot_r_store)
- M.equip_or_collect(new /obj/item/clothing/glasses/sunglasses(M), slot_l_store)
- M.equip_or_collect(new /obj/item/weapon/gun/energy/pulse_rifle/pistol(M), slot_belt)
-
- var/obj/item/weapon/card/id/centcom/W = new(M)
- W.name = "[M.real_name]'s ID Card (Nanotrasen Navy Officer)"
- W.assignment = "Nanotrasen Navy Officer"
- W.access = get_centcom_access(W.assignment)
- W.registered_name = M.real_name
- M.equip_or_collect(W, slot_wear_id)
-
- if("nanotrasen captain")
+ if("nt navy captain")
M.equip_or_collect(new /obj/item/clothing/under/rank/centcom/captain(M), slot_w_uniform)
M.equip_or_collect(new /obj/item/clothing/shoes/centcom(M), slot_shoes)
M.equip_or_collect(new /obj/item/clothing/gloves/color/white(M), slot_gloves)
- M.equip_or_collect(new /obj/item/device/radio/headset/heads/captain/alt(M), slot_l_ear)
+ M.equip_or_collect(new /obj/item/device/radio/headset/centcom(M), slot_l_ear)
M.equip_or_collect(new /obj/item/clothing/head/beret/centcom/captain(M), slot_head)
+ M.equip_or_collect(new /obj/item/device/pda/centcom(M), slot_wear_pda)
+ M.equip_or_collect(new /obj/item/clothing/glasses/hud/security/sunglasses(M), slot_glasses)
+ M.equip_or_collect(new /obj/item/weapon/gun/energy/pulse/pistol(M), slot_belt)
+ M.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
+ M.equip_or_collect(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/implanter/dust(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/implanter/death_alarm(M), slot_in_backpack)
+ var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(M)
+ L.imp_in = M
+ L.implanted = 1
+ M.sec_hud_set_implants()
+ equip_special_id(M,get_centcom_access("Nanotrasen Navy Captain"), "Nanotrasen Navy Captain", /obj/item/weapon/card/id/centcom)
- var/obj/item/device/pda/centcom/pda = new(M)
- pda.owner = M.real_name
- pda.ownjob = "Nanotrasen Navy Captain"
- pda.name = "PDA-[M.real_name] ([pda.ownjob])"
+ if("emergency response team member", "emergency response team leader")
+ var/datum/response_team/equip_team = null
+ switch(alert("Level", "Emergency Response Team", "Amber", "Red", "Gamma"))
+ if("Amber")
+ equip_team = new /datum/response_team/amber
+ if("Red")
+ equip_team = new /datum/response_team/red
+ if("Gamma")
+ equip_team = new /datum/response_team/gamma
+ if(!equip_team)
+ return
+ if(dresscode == "emergency response team leader")
+ equip_team.equip_officer("Commander", M)
+ else
+ switch(alert("Loadout Type", "Emergency Response Team", "Security", "Engineer", "Medic"))
+ if("Commander")
+ equip_team.equip_officer("Commander", M)
+ if("Security")
+ equip_team.equip_officer("Security", M)
+ if("Engineer")
+ equip_team.equip_officer("Engineer", M)
+ if("Medic")
+ equip_team.equip_officer("Medic", M)
+ else
+ to_chat(src, "Invalid ERT Loadout selected")
- M.equip_or_collect(pda, slot_r_store)
- M.equip_or_collect(new /obj/item/clothing/glasses/sunglasses(M), slot_l_store)
- M.equip_or_collect(new /obj/item/weapon/gun/energy/pulse_rifle/pistol(M), slot_belt)
-
- var/obj/item/weapon/card/id/centcom/W = new(M)
- W.name = "[M.real_name]'s ID Card (Nanotrasen Navy Captain)"
- W.access = get_all_accesses()
- W.assignment = "Nanotrasen Navy Captain"
- W.access = get_centcom_access(W.assignment)
- W.registered_name = M.real_name
- M.equip_or_collect(W, slot_wear_id)
-
- if("emergency response team member")
- M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_officer(M), slot_w_uniform)
- M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes)
- M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
- M.equip_to_slot_or_del(new /obj/item/device/radio/headset/ert/alt(M), slot_l_ear)
- M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/gun(M), slot_belt)
- M.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(M), slot_glasses)
- M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/ert(M), slot_back)
-
- var/obj/item/weapon/card/id/W = new(M)
- W.name = "[M.real_name]'s ID Card (Emergency Response Team - Member)"
- W.icon_state = "ERT_empty"
- W.assignment = "Emergency Response Team Member"
- W.access = get_centcom_access(W.assignment)
- W.registered_name = M.real_name
- M.equip_to_slot_or_del(W, slot_wear_id)
-
- var/obj/item/device/pda/centcom/pda = new(M)
- pda.owner = M.real_name
- pda.ownjob = "Emergency Response Team"
- pda.name = "PDA-[M.real_name] ([pda.ownjob])"
-
- if("emergency response team leader")
- M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_officer(M), slot_w_uniform)
- M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes)
- M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
- M.equip_to_slot_or_del(new /obj/item/device/radio/headset/ert/alt(M), slot_l_ear)
- M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/gun(M), slot_belt)
- M.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(M), slot_glasses)
- M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/ert/commander(M), slot_back)
-
- var/obj/item/weapon/card/id/W = new(M)
- W.name = "[M.real_name]'s ID Card (Emergency Response Team - Leader)"
- W.icon_state = "ERT_leader"
- W.assignment = "Emergency Response Team Leader"
- W.access = get_centcom_access(W.assignment)
- W.registered_name = M.real_name
- M.equip_to_slot_or_del(W, slot_wear_id)
-
- var/obj/item/device/pda/centcom/pda = new(M)
- pda.owner = M.real_name
- pda.ownjob = "Emergency Response Team Leader"
- pda.name = "PDA-[M.real_name] ([pda.ownjob])"
-
- if("special ops officer")
+ if("nt special ops officer")
M.equip_to_slot_or_del(new /obj/item/clothing/under/syndicate/combat(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset/centcom(src), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/deathsquad/beret(M), slot_head) // job has /obj/item/clothing/head/beret/centcom/officer/navy
+ M.equip_to_slot_or_del(new /obj/item/device/pda/centcom(M), slot_wear_pda)
+ M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/cyber(M), slot_glasses) // job has /obj/item/clothing/glasses/hud/security/sunglasses
+ M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse/pistol/m1911(M), slot_belt)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security(M), slot_back)
+ M.equip_or_collect(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/deathsquad/officer(M), slot_wear_suit)
- M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes)
- M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
- M.equip_to_slot_or_del(new /obj/item/device/radio/headset/ert/alt(src), slot_l_ear)
- M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/cyber(M), slot_glasses)
- M.equip_to_slot_or_del(new /obj/item/clothing/mask/cigarette/cigar/cohiba(M), slot_wear_mask)
- M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/deathsquad/beret(M), slot_head)
- M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle/pistol/m1911(M), slot_belt)
- M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/matches(M), slot_r_store)
- M.equip_to_slot_or_del(new /obj/item/weapon/twohanded/dualsaber/red(M), slot_l_store)
-
- M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
- M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/sechailer/swat(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen/double/full(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/implanter/dust(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/implanter/death_alarm(M), slot_in_backpack)
+ equip_special_id(M,get_centcom_access("Special Operations Officer"), "Special Operations Officer", /obj/item/weapon/card/id/centcom)
+ // The following items are unique to this outfit - the special ops officer job does not spawn with them.
+ M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/sechailer/swat(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/twohanded/dualsaber/red(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/pinpointer/advpinpointer(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/hypospray/combat/nanites(M), slot_in_backpack)
- M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/flashbangs(src), slot_in_backpack)
- M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/zipties(src), slot_in_backpack)
- M.equip_to_slot_or_del(new /obj/item/clothing/shoes/magboots/syndie/advance(src), slot_in_backpack)
-
-
- var/obj/item/weapon/card/id/W = new(M)
- W.name = "[M.real_name]'s ID Card"
- W.icon_state = "commander"
- W.assignment = "Special Operations Officer"
- W.access = get_centcom_access(W.assignment)
- W.registered_name = M.real_name
- M.equip_to_slot_or_del(W, slot_wear_id)
-
- if("special ops formal")
- M.equip_or_collect(new /obj/item/clothing/under/rank/centcom/captain(M), slot_w_uniform)
- M.equip_to_slot_or_del(new /obj/item/device/radio/headset/ert/alt(src), slot_l_ear)
- M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
- M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes)
- M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/deathsquad/beret(M), slot_head)
- M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/cyber(M), slot_glasses)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/flashbangs(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/zipties(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/clothing/mask/cigarette/cigar/cohiba(M), slot_wear_mask)
- M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle/pistol/m1911(M), slot_belt)
- M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/matches(M), slot_r_store)
- M.equip_or_collect(new /obj/item/weapon/melee/classic_baton/telescopic(M), slot_l_store)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/magboots/advance(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/implanter/loyalty(M), slot_in_backpack)
+
+ if("nt special ops formal")
+ M.equip_or_collect(new /obj/item/clothing/under/rank/centcom/captain(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset/centcom(src), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/deathsquad/beret(M), slot_head)
+ M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/cyber(M), slot_glasses) // special
+ M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse/pistol/m1911(M), slot_belt)
+ M.equip_to_slot_or_del(new /obj/item/clothing/mask/cigarette/cigar/cohiba(M), slot_wear_mask)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
+ M.equip_or_collect(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/matches(M), slot_r_store)
+ M.equip_or_collect(new /obj/item/weapon/melee/classic_baton/telescopic(M), slot_in_backpack)
var/obj/item/device/pda/centcom/pda = new(M)
pda.owner = M.real_name
@@ -1009,17 +1226,9 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
pda.desc = "A portable microcomputer by Thinktronic Systems, LTD. This is model is a special edition designed for military field work."
M.equip_or_collect(pda, slot_wear_pda)
-
- M.equip_or_collect(new /obj/item/clothing/glasses/sunglasses(M), slot_l_store)
- M.equip_or_collect(new /obj/item/weapon/melee/classic_baton/telescopic(M), slot_r_store)
-
- var/obj/item/weapon/card/id/W = new(M)
- W.name = "[M.real_name]'s ID Card (Special Operations Officer)"
- W.icon_state = "commander"
- W.assignment = "Special Operations Officer"
- W.access = get_centcom_access(W.assignment)
- W.registered_name = M.real_name
- M.equip_to_slot_or_del(W, slot_wear_id)
+ M.equip_or_collect(new /obj/item/weapon/implanter/dust(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/implanter/death_alarm(M), slot_in_backpack)
+ equip_special_id(M,get_centcom_access("Special Operations Officer"), "Special Operations Officer", /obj/item/weapon/card/id/centcom)
if("singuloth knight")
M.equip_to_slot_or_del(new /obj/item/clothing/under/syndicate/combat(M), slot_w_uniform)
@@ -1033,16 +1242,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/weapon/claymore/ceremonial(M), slot_belt)
M.equip_to_slot_or_del(new /obj/item/weapon/tank/oxygen(M), slot_s_store)
M.equip_to_slot_or_del(new /obj/item/weapon/twohanded/knighthammer(M), slot_back)
-
-
- var/obj/item/weapon/card/id/W = new(M)
- W.name = "[M.real_name]'s ID Card (Singuloth Knight)"
- W.icon_state = "syndie"
- W.access = get_all_accesses()
- W.access += get_all_centcom_access()
- W.assignment = "Singuloth Knight"
- W.registered_name = M.real_name
- M.equip_to_slot_or_del(W, slot_wear_id)
+ equip_special_id(M,get_all_accesses(), "Singuloth Knight", /obj/item/weapon/card/id)
if("blue wizard")
M.equip_to_slot_or_del(new /obj/item/clothing/under/color/lightpurple(M), slot_w_uniform)
@@ -1054,7 +1254,8 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/weapon/spellbook(M), slot_r_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/twohanded/staff(M), slot_l_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
- M.equip_to_slot_or_del(new /obj/item/weapon/storage/box(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ equip_special_id(M,get_all_accesses(), "Wizard", /obj/item/weapon/card/id)
if("red wizard")
M.equip_to_slot_or_del(new /obj/item/clothing/under/color/lightpurple(M), slot_w_uniform)
@@ -1066,7 +1267,8 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/weapon/spellbook(M), slot_r_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/twohanded/staff(M), slot_l_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
- M.equip_to_slot_or_del(new /obj/item/weapon/storage/box(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ equip_special_id(M,get_all_accesses(), "Wizard", /obj/item/weapon/card/id)
if("marisa wizard")
M.equip_to_slot_or_del(new /obj/item/clothing/under/color/lightpurple(M), slot_w_uniform)
@@ -1078,26 +1280,54 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/weapon/spellbook(M), slot_r_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/twohanded/staff(M), slot_l_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
- M.equip_to_slot_or_del(new /obj/item/weapon/storage/box(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ equip_special_id(M,get_all_accesses(), "Wizard", /obj/item/weapon/card/id)
+
+ if("soviet tourist")
+ M.equip_to_slot_or_del(new /obj/item/clothing/under/soviet(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/clothing/head/ushanka(M), slot_head)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/black(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
+ equip_special_id(M,list(access_maint_tunnels), "Soviet Tourist", /obj/item/weapon/card/id)
+
+ if("soviet soldier")
+ M.equip_to_slot_or_del(new /obj/item/clothing/under/soviet(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/clothing/head/ushanka(M), slot_head)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset/syndicate(M), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(M), slot_glasses)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/card/emag(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/flashlight(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/grenade/plastic/c4(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/grenade/plastic/c4(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/revolver/mateba(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/ammo_box/a357(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/ammo_box/a357(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/ammo_box/a357(M), slot_in_backpack)
+ equip_special_id(M,list(access_maint_tunnels), "Soviet Soldier", /obj/item/weapon/card/id)
if("soviet admiral")
+ M.equip_to_slot_or_del(new /obj/item/clothing/under/soviet(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/head/hgpiratecap(M), slot_head)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
- M.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/captain(M), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset/syndicate(M), slot_l_ear)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/eyepatch(M), slot_glasses)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/hgpirate(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
- M.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/revolver/mateba(M), slot_belt)
- M.equip_to_slot_or_del(new /obj/item/clothing/under/soviet(M), slot_w_uniform)
- var/obj/item/weapon/card/id/W = new(M)
- W.name = "[M.real_name]'s ID Card"
- W.icon_state = "commander"
- W.access = get_all_accesses()
- W.access += get_all_centcom_access()
- W.assignment = "Admiral"
- W.registered_name = M.real_name
- M.equip_to_slot_or_del(W, slot_wear_id)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/revolver/mateba(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/ammo_box/a357(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/ammo_box/a357(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/ammo_box/a357(M), slot_in_backpack)
+ equip_special_id(M,get_all_accesses() + get_all_centcom_access(), "Soviet Admiral", /obj/item/weapon/card/id, "commander")
+ //W.icon_state = "commander"
if("chrono legionnaire")
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/chronos(M), slot_head)
@@ -1109,12 +1339,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/weapon/chrono_eraser(M), slot_back)
M.equip_to_slot_or_del(new /obj/item/clothing/under/syndicate(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen/double/full(src), slot_s_store)
- var/obj/item/weapon/card/id/W = new(M)
- W.name = "[M.real_name]'s ID Card"
- W.icon_state = "syndie"
- W.assignment = "Chrono Legionnaire"
- W.registered_name = M.real_name
- M.equip_to_slot_or_del(W, slot_wear_id)
+ equip_special_id(M,get_all_accesses() + get_all_centcom_access(), "Chrono Legionnaire", /obj/item/weapon/card/id/syndicate, "syndie")
M.regenerate_icons()
@@ -1122,6 +1347,19 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
message_admins("\blue [key_name_admin(usr)] changed the equipment of [key_name_admin(M)] to [dresscode].", 1)
return
+/client/proc/equip_special_id(var/mob/living/carbon/human/H, var/list/theaccess = null, var/jobtext, var/obj/item/weapon/card/id/id_type = /obj/item/weapon/card/id, var/special_icon = null)
+ if(!check_rights(R_EVENT))
+ return
+
+ var/obj/item/weapon/card/id/W = new id_type(H)
+ if(special_icon)
+ W.icon_state = special_icon
+ W.name = "[H.real_name]'s ID Card ([jobtext])"
+ W.access = theaccess
+ W.assignment = "[jobtext]"
+ W.registered_name = H.real_name
+ H.equip_to_slot_or_del(W, slot_wear_id)
+
/client/proc/startSinglo()
set category = "Debug"
set name = "Start Singularity"
@@ -1133,19 +1371,25 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
if(alert("Are you sure? This will start up the engine. Should only be used during debug!",,"Yes","No") != "Yes")
return
- for(var/obj/machinery/power/emitter/E in world)
+ for(var/obj/machinery/power/emitter/E in machines)
if(E.anchored)
E.active = 1
- for(var/obj/machinery/field/generator/F in world)
- if(F.anchored)
- F.Varedit_start = 1
+ for(var/obj/machinery/field/generator/F in machines)
+ if(F.active == 0)
+ F.active = 1
+ F.state = 2
+ F.power = 250
+ F.anchored = 1
+ F.warming_up = 3
+ F.start_fields()
+ F.update_icon()
+
spawn(30)
- for(var/obj/machinery/the_singularitygen/G in world)
+ for(var/obj/machinery/the_singularitygen/G in machines)
if(G.anchored)
var/obj/singularity/S = new /obj/singularity(get_turf(G), 50)
- spawn(0)
- qdel(G)
+// qdel(G)
S.energy = 1750
S.current_size = 7
S.icon = 'icons/effects/224x224.dmi'
@@ -1159,7 +1403,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
//S.dissipate_track = 0
//S.dissipate_strength = 10
- for(var/obj/machinery/power/rad_collector/Rad in world)
+ for(var/obj/machinery/power/rad_collector/Rad in machines)
if(Rad.anchored)
if(!Rad.P)
var/obj/item/weapon/tank/plasma/Plasma = new/obj/item/weapon/tank/plasma(Rad)
@@ -1171,7 +1415,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
if(!Rad.active)
Rad.toggle_power()
- for(var/obj/machinery/power/smes/SMES in world)
+ for(var/obj/machinery/power/smes/SMES in machines)
if(SMES.anchored)
SMES.input_attempt = 1
@@ -1233,4 +1477,14 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
assets.register()
// Clear the user's cache so they get resent.
- usr.client.cache = list()
\ No newline at end of file
+ usr.client.cache = list()
+
+/client/proc/view_runtimes()
+ set category = "Debug"
+ set name = "View Runtimes"
+ set desc = "Open the Runtime Viewer"
+
+ if(!check_rights(R_DEBUG))
+ return
+
+ error_cache.showTo(usr)
diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm
index 70505b8abdf..9b9a7c6caae 100644
--- a/code/modules/admin/verbs/diagnostics.dm
+++ b/code/modules/admin/verbs/diagnostics.dm
@@ -83,20 +83,20 @@
"_default" = "NO_FILTER"
)
var/output = "Radio Report"
- for (var/fq in radio_controller.frequencies)
+ for(var/fq in radio_controller.frequencies)
output += "Freq: [fq] "
var/list/datum/radio_frequency/fqs = radio_controller.frequencies[fq]
- if (!fqs)
+ if(!fqs)
output += " ERROR "
continue
- for (var/filter in fqs.devices)
+ for(var/filter in fqs.devices)
var/list/f = fqs.devices[filter]
- if (!f)
+ if(!f)
output += " [filters[filter]]: ERROR "
continue
output += " [filters[filter]]: [f.len] "
- for (var/device in f)
- if (isobj(device))
+ for(var/device in f)
+ if(isobj(device))
output += " [device] ([device:x],[device:y],[device:z] in area [get_area(device:loc)]) "
else
output += " [device] "
diff --git a/code/modules/admin/verbs/freeze.dm b/code/modules/admin/verbs/freeze.dm
index f6d31d6bede..3537dd3d6df 100644
--- a/code/modules/admin/verbs/freeze.dm
+++ b/code/modules/admin/verbs/freeze.dm
@@ -93,7 +93,7 @@ var/global/list/frozen_mob_list = list()
return
else
if(usr)
- if (usr.client)
+ if(usr.client)
if(usr.client.holder)
var/adminomaly = new/obj/effect/overlay/adminoverlay
if(M.can_move == 1)
diff --git a/code/modules/admin/verbs/honksquad.dm b/code/modules/admin/verbs/honksquad.dm
index 75fc6af84d9..1b49cb4c294 100644
--- a/code/modules/admin/verbs/honksquad.dm
+++ b/code/modules/admin/verbs/honksquad.dm
@@ -50,7 +50,7 @@ var/global/sent_honksquad = 0
//Spawns HONKsquad and equips them.
for(var/obj/effect/landmark/L in landmarks_list)
if(honksquad_number<=0) break
- if (L.name == "HONKsquad")
+ if(L.name == "HONKsquad")
honk_leader_selected = honksquad_number == 1?1:0
var/mob/living/carbon/human/new_honksquad = create_honksquad(L, honk_leader_selected)
@@ -59,7 +59,7 @@ var/global/sent_honksquad = 0
new_honksquad.key = pick(commandos)
commandos -= new_honksquad.key
new_honksquad.internal = new_honksquad.s_store
- new_honksquad.internals.icon_state = "internal1"
+ new_honksquad.update_internals_hud_icon(1)
//So they don't forget their code or mission.
new_honksquad.mind.store_memory("Mission: \red [input].")
@@ -121,7 +121,7 @@ var/global/sent_honksquad = 0
if(prob(50))
equip_to_slot_or_del(new /obj/item/weapon/gun/energy/clown(src), slot_in_backpack)
else
- equip_to_slot_or_del(new /obj/item/weapon/gun/grenadelauncher/piecannon(src), slot_in_backpack)
+ equip_to_slot_or_del(new /obj/item/weapon/gun/throw/piecannon(src), slot_in_backpack)
src.mutations.Add(CLUMSY)
@@ -134,4 +134,4 @@ var/global/sent_honksquad = 0
W.registered_name = real_name
equip_to_slot_or_del(W, slot_wear_id)
- return 1
\ No newline at end of file
+ return 1
diff --git a/code/modules/admin/verbs/map_template_loadverb.dm b/code/modules/admin/verbs/map_template_loadverb.dm
index fc010de8a43..f447810d860 100644
--- a/code/modules/admin/verbs/map_template_loadverb.dm
+++ b/code/modules/admin/verbs/map_template_loadverb.dm
@@ -1,10 +1,9 @@
/client/proc/map_template_load()
set category = "Debug"
- set name = "Map Template - Place"
+ set name = "Map template - Place"
if(!holder)
return
-
var/datum/map_template/template
var/map = input(usr, "Choose a Map Template to place at your CURRENT LOCATION","Place Map Template") as null|anything in map_templates
@@ -16,22 +15,27 @@
if(!T)
return
+ if(!template.fits_in_map_bounds(T, centered = TRUE))
+ to_chat(usr, "Map is too large to fit in bounds. Map's dimensions: ([template.width], [template.height])")
+ return
+
var/list/preview = list()
for(var/S in template.get_affected_turfs(T,centered = TRUE))
preview += image('icons/turf/overlays.dmi',S,"greenOverlay")
usr.client.images += preview
if(alert(usr,"Confirm location.","Template Confirm","Yes","No") == "Yes")
- template.load(T, centered = TRUE)
- message_admins("[key_name_admin(usr)] has placed a map template ([template.name]) at (JMP)")
+ var/timer = start_watch()
+ message_admins("[key_name_admin(usr)] has started to place the map template ([template.name]) at (JMP)")
+ if(template.load(T, centered = TRUE))
+ message_admins("[key_name_admin(usr)] has placed a map template ([template.name]) at (JMP). Took [stop_watch(timer)]s.")
+ else
+ to_chat(usr, "Failed to place map")
usr.client.images -= preview
/client/proc/map_template_upload()
set category = "Debug"
set name = "Map Template - Upload"
- if(!holder)
- return
-
var/map = input(usr, "Choose a Map Template to upload to template storage","Upload Map Template") as null|file
if(!map)
return
@@ -39,7 +43,12 @@
to_chat(usr, "Bad map file: [map]")
return
+ var/timer = start_watch()
+ message_admins("[key_name_admin(usr)] has begun uploading a map template ([map])")
var/datum/map_template/M = new(map=map, rename="[map]")
- M.preload_size(map)
- map_templates[M.name] = M
- message_admins("[key_name_admin(usr)] has uploaded a map template ([map])")
+ if(M.preload_size(map))
+ to_chat(usr, "Map template '[map]' ready to place ([M.width]x[M.height])")
+ map_templates[M.name] = M
+ message_admins("[key_name_admin(usr)] has uploaded a map template ([map]). Took [stop_watch(timer)]s.")
+ else
+ to_chat(usr, "Map template '[map]' failed to load properly")
diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm
index c59cd417c91..d58e51971dd 100644
--- a/code/modules/admin/verbs/mapping.dm
+++ b/code/modules/admin/verbs/mapping.dm
@@ -86,7 +86,7 @@ var/intercom_range_display_status = 0
if(!(locate(/obj/structure/grille,T)))
var/window_check = 0
for(var/obj/structure/window/W in T)
- if (W.dir == turn(C1.dir,180) || W.is_fulltile() )
+ if(W.dir == turn(C1.dir,180) || W.is_fulltile() )
window_check = 1
break
if(!window_check)
@@ -115,7 +115,7 @@ var/intercom_range_display_status = 0
for(var/obj/item/device/radio/intercom/I in world)
for(var/turf/T in orange(7,I))
var/obj/effect/debugging/marker/F = new/obj/effect/debugging/marker(T)
- if (!(F in view(7,I.loc)))
+ if(!(F in view(7,I.loc)))
qdel(F)
feedback_add_details("admin_verb","mIRD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -139,7 +139,9 @@ var/list/admin_verbs_show_debug_verbs = list(
/client/proc/print_jobban_old_filter,
/client/proc/forceEvent,
/client/proc/nanomapgen_DumpImage,
- /client/proc/reload_nanoui_resources
+ /client/proc/reload_nanoui_resources,
+ /client/proc/admin_redo_space_transitions,
+ /client/proc/make_turf_space_map
)
/client/proc/enable_debug_verbs()
diff --git a/code/modules/admin/verbs/massmodvar.dm b/code/modules/admin/verbs/massmodvar.dm
index 185d513d2fc..c416f224cf9 100644
--- a/code/modules/admin/verbs/massmodvar.dm
+++ b/code/modules/admin/verbs/massmodvar.dm
@@ -34,7 +34,7 @@
return
var/list/names = list()
- for (var/V in O.vars)
+ for(var/V in O.vars)
names += V
names = sortList(names)
@@ -72,7 +72,7 @@
else if(isicon(var_value))
to_chat(usr, "Variable appears to be ICON.")
- var_value = "\icon[var_value]"
+ var_value = "[bicon(var_value)]"
default = "icon"
else if(istype(var_value,/atom) || istype(var_value,/datum))
@@ -123,7 +123,7 @@
var/original_name
- if (!istype(O, /atom))
+ if(!istype(O, /atom))
original_name = "\ref[O] ([O])"
else
original_name = O:name
@@ -135,33 +135,33 @@
if(method)
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if ( istype(M , O.type) )
+ if( istype(M , O.type) )
M.vars[variable] = O.vars[variable]
else if(istype(O, /obj))
for(var/obj/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
else if(istype(O, /turf))
for(var/turf/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
else
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if (M.type == O.type)
+ if(M.type == O.type)
M.vars[variable] = O.vars[variable]
else if(istype(O, /obj))
for(var/obj/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
A.vars[variable] = O.vars[variable]
else if(istype(O, /turf))
for(var/turf/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
A.vars[variable] = O.vars[variable]
if("edit referenced object")
@@ -175,32 +175,32 @@
if(method)
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if ( istype(M , O.type) )
+ if( istype(M , O.type) )
M.vars[variable] = O.vars[variable]
else if(istype(O, /obj))
for(var/obj/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
else if(istype(O, /turf))
for(var/turf/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
else
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if (M.type == O.type)
+ if(M.type == O.type)
M.vars[variable] = O.vars[variable]
else if(istype(O, /obj))
for(var/obj/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
A.vars[variable] = O.vars[variable]
else if(istype(O, /turf))
for(var/turf/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
A.vars[variable] = O.vars[variable]
if("num")
@@ -216,7 +216,7 @@
if(method)
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if ( istype(M , O.type) )
+ if( istype(M , O.type) )
if(variable=="light_range")
M.set_light(new_value)
else
@@ -224,7 +224,7 @@
else if(istype(O, /obj))
for(var/obj/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
if(variable=="light_range")
A.set_light(new_value)
else
@@ -232,7 +232,7 @@
else if(istype(O, /turf))
for(var/turf/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
if(variable=="light_range")
A.set_light(new_value)
else
@@ -241,7 +241,7 @@
else
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if (M.type == O.type)
+ if(M.type == O.type)
if(variable=="light_range")
M.set_light(new_value)
else
@@ -249,7 +249,7 @@
else if(istype(O, /obj))
for(var/obj/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
if(variable=="light_range")
A.set_light(new_value)
else
@@ -257,7 +257,7 @@
else if(istype(O, /turf))
for(var/turf/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
if(variable=="light_range")
A.set_light(new_value)
else
@@ -271,32 +271,32 @@
if(method)
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if ( istype(M , O.type) )
+ if( istype(M , O.type) )
M.vars[variable] = O.vars[variable]
else if(istype(O, /obj))
for(var/obj/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
else if(istype(O, /turf))
for(var/turf/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
else
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if (M.type == O.type)
+ if(M.type == O.type)
M.vars[variable] = O.vars[variable]
else if(istype(O, /obj))
for(var/obj/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
A.vars[variable] = O.vars[variable]
else if(istype(O, /turf))
for(var/turf/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
A.vars[variable] = O.vars[variable]
if("file")
@@ -307,32 +307,32 @@
if(method)
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if ( istype(M , O.type) )
+ if( istype(M , O.type) )
M.vars[variable] = O.vars[variable]
else if(istype(O.type, /obj))
for(var/obj/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
else if(istype(O.type, /turf))
for(var/turf/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
else
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if (M.type == O.type)
+ if(M.type == O.type)
M.vars[variable] = O.vars[variable]
else if(istype(O.type, /obj))
for(var/obj/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
A.vars[variable] = O.vars[variable]
else if(istype(O.type, /turf))
for(var/turf/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
A.vars[variable] = O.vars[variable]
if("icon")
@@ -342,33 +342,33 @@
if(method)
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if ( istype(M , O.type) )
+ if( istype(M , O.type) )
M.vars[variable] = O.vars[variable]
else if(istype(O, /obj))
for(var/obj/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
else if(istype(O, /turf))
for(var/turf/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
else
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if (M.type == O.type)
+ if(M.type == O.type)
M.vars[variable] = O.vars[variable]
else if(istype(O, /obj))
for(var/obj/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
A.vars[variable] = O.vars[variable]
else if(istype(O, /turf))
for(var/turf/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
A.vars[variable] = O.vars[variable]
log_admin("[key_name(src)] mass modified [original_name]'s [variable] to [O.vars[variable]]")
diff --git a/code/modules/admin/verbs/modifyvariables.dm b/code/modules/admin/verbs/modifyvariables.dm
index 966e584f15e..0be55889bc2 100644
--- a/code/modules/admin/verbs/modifyvariables.dm
+++ b/code/modules/admin/verbs/modifyvariables.dm
@@ -17,7 +17,7 @@ var/list/forbidden_varedit_object_types = list(
set category = "Debug"
set name = "Edit Ticker Variables"
- if (ticker == null)
+ if(ticker == null)
to_chat(src, "Game hasn't started yet.")
else
src.modify_variables(ticker)
@@ -308,7 +308,7 @@ var/list/forbidden_varedit_object_types = list(
else
var/list/names = list()
- for (var/V in O.vars)
+ for(var/V in O.vars)
names += V
names = sortList(names)
@@ -328,7 +328,7 @@ var/list/forbidden_varedit_object_types = list(
if(default == "num")
dir = 1
else if(default == "icon")
- var_value = "\icon[var_value]"
+ var_value = "[bicon(var_value)]"
to_chat(usr, "Variable contains: [var_value]")
if(dir)
@@ -347,7 +347,7 @@ var/list/forbidden_varedit_object_types = list(
var/original_name
- if (!istype(O, /atom))
+ if(!istype(O, /atom))
original_name = "\ref[O] ([O])"
else
original_name = O:name
@@ -465,7 +465,7 @@ var/list/forbidden_varedit_object_types = list(
else if(isicon(variable))
to_chat(usr, "Variable appears to be ICON.")
- variable = "\icon[variable]"
+ variable = "[bicon(variable)]"
class = "icon"
else if(istype(variable,/matrix))
diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm
index 46972243a06..8da22a71b62 100644
--- a/code/modules/admin/verbs/one_click_antag.dm
+++ b/code/modules/admin/verbs/one_click_antag.dm
@@ -62,7 +62,7 @@ client/proc/one_click_antag()
if(player_old_enough_antag(applicant.client,ROLE_TRAITOR))
if(!applicant.stat)
if(applicant.mind)
- if (!applicant.mind.special_role)
+ if(!applicant.mind.special_role)
if(!jobban_isbanned(applicant, "traitor") && !jobban_isbanned(applicant, "Syndicate"))
if(!(applicant.mind.assigned_role in temp.restricted_jobs))
if(!(applicant.client.prefs.species in temp.protected_species))
@@ -96,7 +96,7 @@ client/proc/one_click_antag()
if(player_old_enough_antag(applicant.client,ROLE_CHANGELING))
if(!applicant.stat)
if(applicant.mind)
- if (!applicant.mind.special_role)
+ if(!applicant.mind.special_role)
if(!jobban_isbanned(applicant, "changeling") && !jobban_isbanned(applicant, "Syndicate"))
if(!(applicant.mind.assigned_role in temp.restricted_jobs))
if(!(applicant.client.prefs.species in temp.protected_species))
@@ -146,40 +146,16 @@ client/proc/one_click_antag()
return 0
/datum/admins/proc/makeWizard()
- var/list/mob/candidates = list()
- var/mob/theghost = null
- var/time_passed = world.time
- for(var/mob/G in respawnable_list)
- if(istype(G) && G.client && (ROLE_WIZARD in G.client.prefs.be_special))
- if(!jobban_isbanned(G, "wizard") && !jobban_isbanned(G, "Syndicate"))
- if(player_old_enough_antag(G.client,ROLE_WIZARD))
- spawn(0)
- switch(G.timed_alert("Do you wish to be considered for the position of Space Wizard Foundation 'diplomat'?","Please answer in 30 seconds!","No",300,"Yes","No"))//alert(G, "Do you wish to be considered for the position of Space Wizard Foundation 'diplomat'?","Please answer in 30 seconds!","Yes","No"))
- if("Yes")
- if((world.time-time_passed)>300)//If more than 30 game seconds passed.
- return
- candidates += G
- if("No")
- return
- else
- return
-
- sleep(300)
+ var/list/candidates = pollCandidates("Do you wish to be considered for the position of a Wizard Foundation 'diplomat'?", "wizard")
if(candidates.len)
- candidates = shuffle(candidates)
- for(var/mob/dead/observer/i in candidates)
- if(!i || !i.client) continue //Dont bother removing them from the list since we only grab one wizard
+ var/mob/dead/observer/selected = pick(candidates)
+ candidates -= selected
- theghost = i
- break
-
- if(theghost)
- var/mob/living/carbon/human/new_character=makeBody(theghost)
+ var/mob/living/carbon/human/new_character = makeBody(selected)
new_character.mind.make_Wizard()
return 1
-
return 0
@@ -277,13 +253,13 @@ client/proc/one_click_antag()
if(closet_spawn)
new /obj/structure/closet/syndicate/nuclear(closet_spawn.loc)
- for (var/obj/effect/landmark/A in /area/syndicate_station/start)//Because that's the only place it can BE -Sieve
- if (A.name == "Syndicate-Gear-Closet")
+ for(var/obj/effect/landmark/A in /area/syndicate_station/start)//Because that's the only place it can BE -Sieve
+ if(A.name == "Syndicate-Gear-Closet")
new /obj/structure/closet/syndicate/personal(A.loc)
qdel(A)
continue
- if (A.name == "Syndicate-Bomb")
+ if(A.name == "Syndicate-Bomb")
new /obj/effect/spawner/newbomb/timer/syndicate(A.loc)
qdel(A)
continue
@@ -303,7 +279,7 @@ client/proc/one_click_antag()
var/I = image('icons/mob/mob.dmi', loc = synd_mind_1.current, icon_state = "synd")
synd_mind.current.client.images += I
- for (var/obj/machinery/nuclearbomb/bomb in world)
+ for(var/obj/machinery/nuclearbomb/bomb in world)
bomb.r_code = nuke_code // All the nukes are set to this code.
return 1
@@ -356,10 +332,10 @@ client/proc/one_click_antag()
if(candidates.len)
var/numagents = 6
//Spawns commandos and equips them.
- for (var/obj/effect/landmark/L in /area/syndicate_mothership/elite_squad)
+ for(var/obj/effect/landmark/L in /area/syndicate_mothership/elite_squad)
if(numagents<=0)
break
- if (L.name == "Syndicate-Commando")
+ if(L.name == "Syndicate-Commando")
syndicate_leader_selected = numagents == 1?1:0
var/mob/living/carbon/human/new_syndicate_commando = create_syndicate_death_commando(L, syndicate_leader_selected)
@@ -375,7 +351,7 @@ client/proc/one_click_antag()
new_syndicate_commando.key = theghost.key
new_syndicate_commando.internal = new_syndicate_commando.s_store
- new_syndicate_commando.internals.icon_state = "internal1"
+ new_syndicate_commando.update_internals_hud_icon(1)
//So they don't forget their code or mission.
@@ -386,8 +362,8 @@ client/proc/one_click_antag()
if(numagents >= 6)
return 0
- for (var/obj/effect/landmark/L in /area/shuttle/syndicate_elite)
- if (L.name == "Syndicate-Commando-Bomb")
+ for(var/obj/effect/landmark/L in /area/shuttle/syndicate_elite)
+ if(L.name == "Syndicate-Commando-Bomb")
new /obj/effect/spawner/newbomb/timer/syndicate(L.loc)
return 1
@@ -469,7 +445,7 @@ client/proc/one_click_antag()
var/max_raiders = 1
var/raiders = max_raiders
//Spawns vox raiders and equips them.
- for (var/obj/effect/landmark/L in world)
+ for(var/obj/effect/landmark/L in world)
if(L.name == "voxstart")
if(raiders<=0)
break
@@ -485,6 +461,8 @@ client/proc/one_click_antag()
break
new_vox.key = theghost.key
+ ticker.mode.traitors += new_vox.mind
+
to_chat(new_vox, "\blue You are a Vox Primalis, fresh out of the Shoal. Your ship has arrived at the Tau Ceti system hosting the NSV Exodus... or was it the Luna? NSS? Utopia? Nobody is really sure, but everyong is raring to start pillaging! Your current goal is: \red [input]")
to_chat(new_vox, "\red Don't forget to turn on your nitrogen internals!")
@@ -497,9 +475,6 @@ client/proc/one_click_antag()
/datum/admins/proc/create_vox_raider(obj/spawn_location, leader_chosen = 0)
- var/mob/living/carbon/human/new_vox = new(spawn_location.loc, "Vox")
- var/obj/item/organ/external/head/head_organ = new_vox.get_organ("head")
-
var/sounds = rand(2,8)
var/i = 0
var/newname = ""
@@ -508,17 +483,21 @@ client/proc/one_click_antag()
i++
newname += pick(list("ti","hi","ki","ya","ta","ha","ka","ya","chi","cha","kah"))
+ var/mob/living/carbon/human/new_vox = new /mob/living/carbon/human/vox(spawn_location.loc)
+
+ new_vox.add_language("Tradeband")
new_vox.real_name = capitalize(newname)
+ new_vox.dna.real_name = new_vox.real_name
new_vox.name = new_vox.real_name
new_vox.age = rand(12,20)
- new_vox.set_species("Vox")
- new_vox.languages = list() // Removing language from chargen.
new_vox.flavor_text = ""
- new_vox.add_language("Vox-pidgin")
- new_vox.add_language("Galactic Common")
- new_vox.add_language("Tradeband")
- head_organ.h_style = "Short Vox Quills"
- head_organ.f_style = "Shaved"
+ new_vox.change_eye_color(rand(1, 255), rand(1, 255), rand(1, 255))
+ new_vox.s_tone = rand(1, 6)
+
+ // Do the initial caching of the player's body icons.
+ new_vox.force_update_limbs()
+ new_vox.update_dna()
+ new_vox.update_eyes()
for(var/obj/item/organ/external/limb in new_vox.organs)
limb.status &= ~(ORGAN_DESTROYED | ORGAN_ROBOT)
@@ -529,8 +508,8 @@ client/proc/one_click_antag()
I.implanted = 1
cortical_stacks += I
- ticker.mode.traitors += new_vox.mind
new_vox.equip_vox_raider()
+ new_vox.regenerate_icons()
return new_vox
@@ -548,7 +527,7 @@ client/proc/one_click_antag()
if(player_old_enough_antag(applicant.client,ROLE_VAMPIRE))
if(!applicant.stat)
if(applicant.mind)
- if (!applicant.mind.special_role)
+ if(!applicant.mind.special_role)
if(!jobban_isbanned(applicant, "vampire") && !jobban_isbanned(applicant, "Syndicate"))
if(!(applicant.job in temp.restricted_jobs))
if(!(applicant.client.prefs.species in temp.protected_species))
@@ -597,7 +576,7 @@ client/proc/one_click_antag()
var/teamOneMembers = 5
var/teamTwoMembers = 5
var/datum/preferences/A = new()
- for (var/obj/effect/landmark/L in world)
+ for(var/obj/effect/landmark/L in world)
if(L.name == "tdome1")
if(teamOneMembers<=0)
break
diff --git a/code/modules/admin/verbs/onlyone.dm b/code/modules/admin/verbs/onlyone.dm
index 4eeab674a88..6723299c5a8 100644
--- a/code/modules/admin/verbs/onlyone.dm
+++ b/code/modules/admin/verbs/onlyone.dm
@@ -27,8 +27,8 @@
to_chat(H, "Objective #[obj_count]: [OBJ.explanation_text]")
obj_count++
- for (var/obj/item/I in H)
- if (istype(I, /obj/item/weapon/implant))
+ for(var/obj/item/I in H)
+ if(istype(I, /obj/item/weapon/implant))
continue
if(istype(I, /obj/item/organ))
continue
@@ -55,7 +55,7 @@
message_admins("[key_name_admin(usr)] used THERE CAN BE ONLY ONE! -NO ATTACK LOGS WILL BE SENT TO ADMINS FROM THIS POINT FORTH-", 1)
log_admin("[key_name(usr)] used there can be only one.")
nologevent = 1
- to_chat(world, sound('sound/music/THUNDERDOME.ogg'))
+ world << sound('sound/music/THUNDERDOME.ogg')
/client/proc/only_me()
if(!ticker)
@@ -101,4 +101,4 @@
message_admins("[key_name_admin(usr)] used THERE CAN BE ONLY ME! -NO ATTACK LOGS WILL BE SENT TO ADMINS FROM THIS POINT FORTH-", 1)
log_admin("[key_name(usr)] used there can be only me.")
nologevent = 1
- to_chat(world, sound('sound/music/THUNDERDOME.ogg'))
+ world << sound('sound/music/THUNDERDOME.ogg')
diff --git a/code/modules/admin/verbs/onlyoneteam.dm b/code/modules/admin/verbs/onlyoneteam.dm
index 5072b43383e..a88270077d6 100644
--- a/code/modules/admin/verbs/onlyoneteam.dm
+++ b/code/modules/admin/verbs/onlyoneteam.dm
@@ -15,8 +15,8 @@
var/datum/preferences/A = new() // Randomize appearance
A.copy_to(H)
- for (var/obj/item/I in H)
- if (istype(I, /obj/item/weapon/implant))
+ for(var/obj/item/I in H)
+ if(istype(I, /obj/item/weapon/implant))
continue
if(istype (I, /obj/item/organ))
continue
diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm
index 47c7da15724..660a1c8f199 100644
--- a/code/modules/admin/verbs/playsound.dm
+++ b/code/modules/admin/verbs/playsound.dm
@@ -81,6 +81,7 @@ var/list/sounds_cache = list()
for(var/O in global_intercoms)
var/obj/item/device/radio/intercom/I = O
+ // TODO: Tie into space manager
if(I.z != ZLEVEL_STATION && !ignore_z)
continue
if(!I.on && !ignore_power)
diff --git a/code/modules/admin/verbs/pray.dm b/code/modules/admin/verbs/pray.dm
index 0ef6a64373f..c35b4d7596e 100644
--- a/code/modules/admin/verbs/pray.dm
+++ b/code/modules/admin/verbs/pray.dm
@@ -13,12 +13,11 @@
return
var/image/cross = image('icons/obj/storage.dmi',"bible")
- msg = "\blue \icon[cross] PRAY: [key_name(src, 1)] (?) (PP) (VV) (SM) ([admin_jump_link(src, "holder")]) (CA) (SC): [msg]"
+ msg = "\blue [bicon(cross)] PRAY: [key_name(src, 1)] (?) (PP) (VV) (SM) ([admin_jump_link(src, "holder")]) (CA) (SC): [msg]"
for(var/client/X in admins)
if(check_rights(R_EVENT,0,X.mob))
to_chat(X, msg)
-
to_chat(usr, "Your prayers have been received by the gods.")
feedback_add_details("admin_verb","PR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -27,41 +26,48 @@
/proc/Centcomm_announce(var/text , var/mob/Sender)
var/msg = sanitize(copytext(text, 1, MAX_MESSAGE_LEN))
msg = "\blue CENTCOMM: [key_name(Sender, 1)] (PP) (VV) (SM) ([admin_jump_link(Sender, "holder")]) (CA) (BSA) (RPLY): [msg]"
-
for(var/client/X in admins)
if(R_EVENT & X.holder.rights)
to_chat(X, msg)
+ if(X.prefs.sound & SOUND_ADMINHELP)
+ X << 'sound/effects/adminhelp.ogg'
/proc/Syndicate_announce(var/text , var/mob/Sender)
var/msg = sanitize(copytext(text, 1, MAX_MESSAGE_LEN))
msg = "\blue SYNDICATE: [key_name(Sender, 1)] (PP) (VV) (SM) ([admin_jump_link(Sender, "holder")]) (CA) (BSA) (REPLY): [msg]"
-
for(var/client/X in admins)
if(check_rights(R_EVENT,0,X.mob))
to_chat(X, msg)
+ if(X.prefs.sound & SOUND_ADMINHELP)
+ X << 'sound/effects/adminhelp.ogg'
/proc/HONK_announce(var/text , var/mob/Sender)
var/msg = sanitize(copytext(text, 1, MAX_MESSAGE_LEN))
msg = "\blue HONK: [key_name(Sender, 1)] (PP) (VV) (SM) ([admin_jump_link(Sender, "holder")]) (CA) (BSA) (RPLY): [msg]"
-
for(var/client/X in admins)
if(R_EVENT & X.holder.rights)
to_chat(X, msg)
+ if(X.prefs.sound & SOUND_ADMINHELP)
+ X << 'sound/effects/adminhelp.ogg'
-/proc/ERT_Announce(var/text , var/mob/Sender)
+/proc/ERT_Announce(var/text , var/mob/Sender, var/repeat_warning)
var/msg = sanitize(copytext(text, 1, MAX_MESSAGE_LEN))
- msg = "\blue ERT REQUEST: [key_name(Sender, 1)] (PP) (VV) (SM) ([admin_jump_link(Sender, "holder")]) (CA) (BSA) (REPLY): [msg]"
-
+ msg = "ERT REQUEST: [key_name(Sender, 1)] (PP) (VV) (SM) ([admin_jump_link(Sender, "holder")]) (CA) (BSA) (RESPOND): [msg]"
+ if(repeat_warning)
+ msg += " WARNING: ERT request has gone 5 minutes with no reply!"
for(var/client/X in admins)
if(check_rights(R_EVENT,0,X.mob))
to_chat(X, msg)
+ if(X.prefs.sound & SOUND_ADMINHELP)
+ X << 'sound/effects/adminhelp.ogg'
/proc/Nuke_request(text , mob/Sender)
var/nuke_code = get_nuke_code()
var/msg = sanitize(copytext(text, 1, MAX_MESSAGE_LEN))
msg = "NUKE CODE REQUEST: [key_name(Sender)] (PP) (VV) (SM) ([admin_jump_link(Sender, "holder")]) (CA) (BSA) (RPLY): [msg]"
-
for(var/client/X in admins)
if(check_rights(R_EVENT,0,X.mob))
to_chat(X, msg)
to_chat(X, "The nuke code is [nuke_code].")
+ if(X.prefs.sound & SOUND_ADMINHELP)
+ X << 'sound/effects/adminhelp.ogg'
\ No newline at end of file
diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm
index c236432e9d2..e0a2f35e05d 100644
--- a/code/modules/admin/verbs/randomverbs.dm
+++ b/code/modules/admin/verbs/randomverbs.dm
@@ -23,7 +23,7 @@
if(!check_rights(R_ADMIN))
return
- if (ismob(M))
+ if(ismob(M))
if(istype(M, /mob/living/silicon/ai))
alert("The AI can't be sent to prison you jerk!", null, null, null, null, null)
return
@@ -56,10 +56,10 @@
var/msg = input("Message:", text("Subtle PM to [M.key]")) as text
- if (!msg)
+ if(!msg)
return
if(usr)
- if (usr.client)
+ if(usr.client)
if(usr.client.holder)
to_chat(M, "\bold You hear a voice in your head... \italic [msg]")
@@ -108,7 +108,7 @@
var/msg = input("Message:", text("Enter the text you wish to appear to everyone:")) as text
- if (!msg)
+ if(!msg)
return
to_chat(world, "[msg]")
log_admin("GlobalNarrate: [key_name(usr)] : [msg]")
@@ -407,7 +407,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if("Death Commando")//Leaves them at late-join spawn.
new_character.equip_death_commando()
new_character.internal = new_character.s_store
- new_character.internals.icon_state = "internal1"
+ new_character.update_internals_hud_icon(1)
else//They may also be a cyborg or AI.
switch(new_character.mind.assigned_role)
if("Cyborg")//More rigging to make em' work and check if they're traitor.
@@ -561,7 +561,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if("No")
to_chat(world, "\red [from] available at all communications consoles.")
- for (var/obj/machinery/computer/communications/C in machines)
+ for(var/obj/machinery/computer/communications/C in machines)
if(! (C.stat & (BROKEN|NOPOWER) ) )
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( C.loc )
P.name = "[from]"
@@ -581,7 +581,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if("No")
to_chat(world, "\red New Nanotrasen Update available at all communication consoles.")
- for (var/obj/machinery/computer/communications/C in machines)
+ for(var/obj/machinery/computer/communications/C in machines)
if(! (C.stat & (BROKEN|NOPOWER) ) )
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( C.loc )
P.name = "'[command_name()] Update.'"
@@ -590,7 +590,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
C.messagetitle.Add("[command_name()] Update")
C.messagetext.Add(P.info)
-// to_chat(world, sound('sound/AI/commandreport.ogg'))
+// world << sound('sound/AI/commandreport.ogg')
log_admin("[key_name(src)] has created a communications report: [input]")
message_admins("[key_name_admin(src)] has created a communications report", 1)
feedback_add_details("admin_verb","CCR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -603,7 +603,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!check_rights(R_ADMIN))
return
- if (alert(src, "Are you sure you want to delete:\n[O]\nat ([O.x], [O.y], [O.z])?", "Confirmation", "Yes", "No") == "Yes")
+ if(alert(src, "Are you sure you want to delete:\n[O]\nat ([O.x], [O.y], [O.z])?", "Confirmation", "Yes", "No") == "Yes")
log_admin("[key_name(usr)] deleted [O] at ([O.x],[O.y],[O.z])")
message_admins("[key_name_admin(usr)] deleted [O] at ([O.x],[O.y],[O.z])", 1)
feedback_add_details("admin_verb","DEL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -643,9 +643,9 @@ Traitors and the like can also be revived with the previous role mostly intact.
var/flames = input("Range of flames. -1 to none", text("Input")) as num|null
if(flames == null) return
- if ((devastation != -1) || (heavy != -1) || (light != -1) || (flash != -1) || (flames != -1))
- if ((devastation > 20) || (heavy > 20) || (light > 20) || (flames > 20))
- if (alert(src, "Are you sure you want to do this? It will laaag.", "Confirmation", "Yes", "No") == "No")
+ if((devastation != -1) || (heavy != -1) || (light != -1) || (flash != -1) || (flames != -1))
+ if((devastation > 20) || (heavy > 20) || (light > 20) || (flames > 20))
+ if(alert(src, "Are you sure you want to do this? It will laaag.", "Confirmation", "Yes", "No") == "No")
return
explosion(O, devastation, heavy, light, flash, null, null,flames)
@@ -668,7 +668,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
var/light = input("Range of light pulse.", text("Input")) as num|null
if(light == null) return
- if (heavy || light)
+ if(heavy || light)
empulse(O, heavy, light)
log_admin("[key_name(usr)] created an EM pulse ([heavy], [light]) at ([O.x],[O.y],[O.z])")
@@ -710,7 +710,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No")
if(confirm == "Yes")
- if (istype(mob, /mob/dead/observer)) // so they don't spam gibs everywhere
+ if(istype(mob, /mob/dead/observer)) // so they don't spam gibs everywhere
return
else
mob.gib()
@@ -791,7 +791,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
set category = "Admin"
set name = "Toggle Deny Shuttle"
- if (!ticker)
+ if(!ticker)
return
if(!check_rights(R_ADMIN))
@@ -824,7 +824,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!check_rights(R_SERVER|R_EVENT))
return
- if (ticker && ticker.mode)
+ if(ticker && ticker.mode)
to_chat(usr, "Nope you can't do this, the game's already started. This only works before rounds!")
return
@@ -868,6 +868,29 @@ Traitors and the like can also be revived with the previous role mostly intact.
message_admins("Admin [key_name_admin(usr)] has disabled random events.", 1)
feedback_add_details("admin_verb","TRE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+/client/proc/reset_all_tcs()
+ set category = "Admin"
+ set name = "Reset Telecomms Scripts"
+ set desc = "Blanks all telecomms scripts from all telecomms servers"
+
+ if(!check_rights(R_ADMIN, 1, src))
+ return
+
+ var/confirm = alert(src, "You sure you want to blank all NTSL scripts?", "Confirm", "Yes", "No")
+ if(confirm != "Yes")
+ return
+
+ for(var/obj/machinery/telecomms/server/S in telecomms_list)
+ var/datum/TCS_Compiler/C = S.Compiler
+ S.rawcode = ""
+ C.Compile("")
+ for(var/obj/machinery/computer/telecomms/traffic/T in machines)
+ T.storedcode = ""
+ log_admin("[key_name(usr)] blanked all telecomms scripts.")
+ message_admins("[key_name_admin(usr)] blanked all telecomms scripts.")
+ feedback_add_details("admin_verb","RAT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+
+
/client/proc/toggle_ert_calling()
set category = "Event"
set name = "Toggle ERT"
@@ -886,4 +909,3 @@ Traitors and the like can also be revived with the previous role mostly intact.
to_chat(usr, "\red ERT has been Disabled.")
log_admin("Admin [key_name(src)] has disabled ERT calling.")
message_admins("Admin [key_name_admin(usr)] has disabled ERT calling.", 1)
-
diff --git a/code/modules/admin/verbs/serialization.dm b/code/modules/admin/verbs/serialization.dm
new file mode 100644
index 00000000000..41ba5d11aa1
--- /dev/null
+++ b/code/modules/admin/verbs/serialization.dm
@@ -0,0 +1,26 @@
+/client/proc/admin_serialize()
+ set name = "Serialize Marked Datum"
+ set desc = "Turns your marked object into a JSON string you can later use to re-create the object"
+ set category = "Debug"
+
+ if(!check_rights(R_ADMIN))
+ return
+
+ if(!istype(holder.marked_datum, /atom/movable))
+ to_chat(src, "The marked datum is not an atom/movable!")
+ return
+
+ var/atom/movable/AM = holder.marked_datum
+ to_chat(src, json_encode(AM.serialize()))
+
+/client/proc/admin_deserialize()
+ set name = "Deserialize JSON datum"
+ set desc = "Creates an object from a JSON string"
+ set category = "Debug"
+
+ if(!check_rights(R_ADMIN|R_DEBUG))
+ return
+
+ var/json_text = input("Enter the JSON code:","Text") as message|null
+ if(json_text)
+ json_to_object(json_text, get_turf(usr))
\ No newline at end of file
diff --git a/code/modules/admin/verbs/space_transitions.dm b/code/modules/admin/verbs/space_transitions.dm
new file mode 100644
index 00000000000..eda17996c65
--- /dev/null
+++ b/code/modules/admin/verbs/space_transitions.dm
@@ -0,0 +1,41 @@
+/client/proc/admin_redo_space_transitions()
+ set name = "Remake Space Transitions"
+ set desc = "Re-assigns all space transitions"
+ set category = "Debug"
+
+ if(!check_rights(R_ADMIN|R_DEBUG))
+ return
+
+ var/choice = alert("Do you want to rebuild space transitions?",,"Yes", "No")
+
+ if(choice == "No")
+ return
+
+
+ message_admins("[key_name_admin(usr)] re-assigned all space transitions")
+ space_manager.do_transition_setup()
+ log_admin("[key_name(usr)] re-assigned all space transitions")
+
+ feedback_add_details("admin_verb","SPCRST") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+
+
+
+
+/client/proc/make_turf_space_map()
+ set name = "Make Space Map"
+ set desc = "Create a map of the space levels as turfs at your feet"
+ set category = "Debug"
+
+ if(!check_rights(R_ADMIN|R_DEBUG))
+ return
+
+ var/choice = alert("Are you sure you want to make a space map out of turfs?",,"Yes","No")
+
+ if(choice == "No")
+ return
+
+ message_admins("[key_name_admin(usr)] made a space map")
+
+
+ space_manager.map_as_turfs(get_turf(usr))
+ log_admin("[key_name(usr)] made a space map")
diff --git a/code/modules/admin/verbs/striketeam.dm b/code/modules/admin/verbs/striketeam.dm
index a5b98bc888c..e76545f4748 100644
--- a/code/modules/admin/verbs/striketeam.dm
+++ b/code/modules/admin/verbs/striketeam.dm
@@ -55,7 +55,7 @@ var/global/sent_strike_team = 0
//Spawns commandos and equips them.
for(var/obj/effect/landmark/L in landmarks_list)
if(commando_number<=0) break
- if (L.name == "Commando")
+ if(L.name == "Commando")
leader_selected = commando_number == 1?1:0
var/mob/living/carbon/human/new_commando = create_death_commando(L, leader_selected)
@@ -64,7 +64,7 @@ var/global/sent_strike_team = 0
new_commando.key = pick(commandos)
commandos -= new_commando.key
new_commando.internal = new_commando.s_store
- new_commando.internals.icon_state = "internal1"
+ new_commando.update_internals_hud_icon(1)
//So they don't forget their code or mission.
if(nuke_code)
@@ -76,8 +76,8 @@ var/global/sent_strike_team = 0
commando_number--
//Spawns the rest of the commando gear.
- for (var/obj/effect/landmark/L in landmarks_list)
- if (L.name == "Commando_Manual")
+ for(var/obj/effect/landmark/L in landmarks_list)
+ if(L.name == "Commando_Manual")
//new /obj/item/weapon/gun/energy/pulse_rifle(L.loc)
var/obj/item/weapon/paper/P = new(L.loc)
P.info = "
Good morning soldier!. This compact guide will familiarize you with standard operating procedure. There are three basic rules to follow: #1 Work as a team. #2 Accomplish your objective at all costs. #3 Leave no witnesses. You are fully equipped and stocked for your mission--before departing on the Spec. Ops. Shuttle due South, make sure that all operatives are ready. Actual mission objective will be relayed to you by Central Command through your headsets. If deemed appropriate, Central Command will also allow members of your team to equip assault power-armor for the mission. You will find the armor storage due West of your position. Once you are ready to leave, utilize the Special Operations shuttle console and toggle the hull doors via the other console.
In the event that the team does not accomplish their assigned objective in a timely manner, or finds no other way to do so, attached below are instructions on how to operate a Nanotrasen Nuclear Device. Your operations LEADER is provided with a nuclear authentication disk and a pin-pointer for this reason. You may easily recognize them by their rank: Lieutenant, Captain, or Major. The nuclear device itself will be present somewhere on your destination.
Hello and thank you for choosing Nanotrasen for your nuclear information needs. Today's crash course will deal with the operation of a Fission Class Nanotrasen made Nuclear Device. First and foremost, DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE. Pressing any button on the compacted bomb will cause it to extend and bolt itself into place. If this is done to unbolt it one must completely log in which at this time may not be possible. To make the device functional: #1 Place bomb in designated detonation zone #2 Extend and anchor bomb (attack with hand). #3 Insert Nuclear Auth. Disk into slot. #4 Type numeric code into keypad ([nuke_code]). Note: If you make a mistake press R to reset the device. #5 Press the E button to log onto the device. You now have activated the device. To deactivate the buttons at anytime, for example when you have already prepped the bomb for detonation, remove the authentication disk OR press the R on the keypad. Now the bomb CAN ONLY be detonated using the timer. A manual detonation is not an option. Note: Toggle off the SAFETY. Use the - - and + + to set a detonation time between 5 seconds and 10 minutes. Then press the timer toggle button to start the countdown. Now remove the authentication disk so that the buttons deactivate. Note: THE BOMB IS STILL SET AND WILL DETONATE Now before you remove the disk if you need to move the bomb you can: Toggle off the anchor, move it, and re-anchor.
The nuclear authorization code is: [nuke_code ? nuke_code : "None provided"]
Good luck, soldier!
"
@@ -87,8 +87,8 @@ var/global/sent_strike_team = 0
P.stamp(stamp)
qdel(stamp)
- for (var/obj/effect/landmark/L in landmarks_list)
- if (L.name == "Commando-Bomb")
+ for(var/obj/effect/landmark/L in landmarks_list)
+ if(L.name == "Commando-Bomb")
new /obj/effect/spawner/newbomb/timer/syndicate(L.loc)
qdel(L)
@@ -125,7 +125,7 @@ var/global/sent_strike_team = 0
var/obj/item/device/radio/R = new /obj/item/device/radio/headset/alt(src)
R.set_frequency(DTH_FREQ)
equip_to_slot_or_del(R, slot_l_ear)
- if (leader_selected == 0)
+ if(leader_selected == 0)
equip_to_slot_or_del(new /obj/item/clothing/under/color/green(src), slot_w_uniform)
else
equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_officer(src), slot_w_uniform)
@@ -143,8 +143,8 @@ var/global/sent_strike_team = 0
equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/hypospray/combat/nanites(src), slot_in_backpack)
equip_to_slot_or_del(new /obj/item/weapon/storage/box/flashbangs(src), slot_in_backpack)
equip_to_slot_or_del(new /obj/item/device/flashlight(src), slot_in_backpack)
- if (!leader_selected)
- equip_to_slot_or_del(new /obj/item/weapon/c4(src), slot_in_backpack)
+ if(!leader_selected)
+ equip_to_slot_or_del(new /obj/item/weapon/grenade/plastic/x4(src), slot_in_backpack)
else
equip_to_slot_or_del(new /obj/item/weapon/pinpointer(src), slot_in_backpack)
equip_to_slot_or_del(new /obj/item/weapon/disk/nuclear(src), slot_in_backpack)
@@ -154,7 +154,7 @@ var/global/sent_strike_team = 0
equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen/double/full(src), slot_s_store)
equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/revolver/mateba(src), slot_belt)
- equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle(src), slot_r_hand)
+ equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse(src), slot_r_hand)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(src)//Here you go Deuryn
@@ -170,4 +170,4 @@ var/global/sent_strike_team = 0
W.registered_name = real_name
equip_to_slot_or_del(W, slot_wear_id)
- return 1
\ No newline at end of file
+ return 1
diff --git a/code/modules/admin/verbs/striketeam_syndicate.dm b/code/modules/admin/verbs/striketeam_syndicate.dm
index 6131962b881..3669ba2ba13 100644
--- a/code/modules/admin/verbs/striketeam_syndicate.dm
+++ b/code/modules/admin/verbs/striketeam_syndicate.dm
@@ -32,7 +32,7 @@ var/global/sent_syndicate_strike_team = 0
sent_syndicate_strike_team = 1
- //if (emergency_shuttle.can_recall())
+ //if(emergency_shuttle.can_recall())
// emergency_shuttle.recall() //why, exactly? Admins can do this themselves.
var/syndicate_commando_number = syndicate_commandos_possible //for selecting a leader
@@ -62,7 +62,7 @@ var/global/sent_syndicate_strike_team = 0
//Spawns commandos and equips them.
for(var/obj/effect/landmark/L in landmarks_list)
if(syndicate_commando_number<=0) break
- if (L.name == "Syndicate-Commando")
+ if(L.name == "Syndicate-Commando")
syndicate_leader_selected = syndicate_commando_number == 1?1:0
var/mob/living/carbon/human/new_syndicate_commando = create_syndicate_death_commando(L, syndicate_leader_selected)
@@ -71,7 +71,7 @@ var/global/sent_syndicate_strike_team = 0
new_syndicate_commando.key = pick(commandos)
commandos -= new_syndicate_commando.key
new_syndicate_commando.internal = new_syndicate_commando.s_store
- new_syndicate_commando.internals.icon_state = "internal1"
+ new_syndicate_commando.update_internals_hud_icon(1)
//So they don't forget their code or mission.
if(nuke_code)
@@ -83,15 +83,15 @@ var/global/sent_syndicate_strike_team = 0
syndicate_commando_number--
//Spawns the rest of the commando gear.
-// for (var/obj/effect/landmark/L)
- // if (L.name == "Commando_Manual")
+// for(var/obj/effect/landmark/L)
+ // if(L.name == "Commando_Manual")
//new /obj/item/weapon/gun/energy/pulse_rifle(L.loc)
// var/obj/item/weapon/paper/P = new(L.loc)
// P.info = "
Good morning soldier!. This compact guide will familiarize you with standard operating procedure. There are three basic rules to follow: #1 Work as a team. #2 Accomplish your objective at all costs. #3 Leave no witnesses. You are fully equipped and stocked for your mission--before departing on the Spec. Ops. Shuttle due South, make sure that all operatives are ready. Actual mission objective will be relayed to you by Central Command through your headsets. If deemed appropriate, Central Command will also allow members of your team to equip assault power-armor for the mission. You will find the armor storage due West of your position. Once you are ready to leave, utilize the Special Operations shuttle console and toggle the hull doors via the other console.
In the event that the team does not accomplish their assigned objective in a timely manner, or finds no other way to do so, attached below are instructions on how to operate a Nanotrasen Nuclear Device. Your operations LEADER is provided with a nuclear authentication disk and a pin-pointer for this reason. You may easily recognize them by their rank: Lieutenant, Captain, or Major. The nuclear device itself will be present somewhere on your destination.
Hello and thank you for choosing Nanotrasen for your nuclear information needs. Today's crash course will deal with the operation of a Fission Class Nanotrasen made Nuclear Device. First and foremost, DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE. Pressing any button on the compacted bomb will cause it to extend and bolt itself into place. If this is done to unbolt it one must completely log in which at this time may not be possible. To make the device functional: #1 Place bomb in designated detonation zone #2 Extend and anchor bomb (attack with hand). #3 Insert Nuclear Auth. Disk into slot. #4 Type numeric code into keypad ([nuke_code]). Note: If you make a mistake press R to reset the device. #5 Press the E button to log onto the device. You now have activated the device. To deactivate the buttons at anytime, for example when you have already prepped the bomb for detonation, remove the authentication disk OR press the R on the keypad. Now the bomb CAN ONLY be detonated using the timer. A manual detonation is not an option. Note: Toggle off the SAFETY. Use the - - and + + to set a detonation time between 5 seconds and 10 minutes. Then press the timer toggle button to start the countdown. Now remove the authentication disk so that the buttons deactivate. Note: THE BOMB IS STILL SET AND WILL DETONATE Now before you remove the disk if you need to move the bomb you can: Toggle off the anchor, move it, and re-anchor.
The nuclear authorization code is: [nuke_code ? nuke_code : "None provided"]
Good luck, soldier!
"
// P.name = "Spec. Ops. Manual"
- for (var/obj/effect/landmark/L in landmarks_list)
- if (L.name == "Syndicate-Commando-Bomb")
+ for(var/obj/effect/landmark/L in landmarks_list)
+ if(L.name == "Syndicate-Commando-Bomb")
new /obj/effect/spawner/newbomb/timer/syndicate(L.loc)
qdel(L)
@@ -131,12 +131,12 @@ var/global/sent_syndicate_strike_team = 0
equip_to_slot_or_del(R, slot_l_ear)
equip_to_slot_or_del(new /obj/item/clothing/under/syndicate(src), slot_w_uniform)
equip_to_slot_or_del(new /obj/item/clothing/shoes/magboots/syndie/advance(src), slot_shoes)
- if (!syndicate_leader_selected)
+ if(!syndicate_leader_selected)
equip_to_slot_or_del(new /obj/item/clothing/suit/space/syndicate/black/strike(src), slot_wear_suit)
else
equip_to_slot_or_del(new /obj/item/clothing/suit/space/syndicate/black/red/strike(src), slot_wear_suit)
equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(src), slot_gloves)
- if (!syndicate_leader_selected)
+ if(!syndicate_leader_selected)
equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/syndicate/black/strike(src), slot_head)
else
equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/syndicate/black/red/strike(src), slot_head)
@@ -144,14 +144,14 @@ var/global/sent_syndicate_strike_team = 0
equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal(src), slot_glasses)
equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security(src), slot_back)
- equip_to_slot_or_del(new /obj/item/ammo_box/magazine/m762, slot_in_backpack)
+ equip_to_slot_or_del(new /obj/item/ammo_box/magazine/mm556x45)
equip_to_slot_or_del(new /obj/item/ammo_box/magazine/m45(src), slot_in_backpack)
equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/hypospray/combat/nanites(src), slot_in_backpack)
- equip_to_slot_or_del(new /obj/item/weapon/c4(src), slot_in_backpack)
+ equip_to_slot_or_del(new /obj/item/weapon/grenade/plastic/x4(src), slot_in_backpack)
equip_to_slot_or_del(new /obj/item/device/flashlight(src), slot_in_backpack)
- if (!syndicate_leader_selected)
- equip_to_slot_or_del(new /obj/item/weapon/c4(src), slot_in_backpack)
+ if(!syndicate_leader_selected)
+ equip_to_slot_or_del(new /obj/item/weapon/grenade/plastic/x4(src), slot_in_backpack)
equip_to_slot_or_del(new /obj/item/weapon/card/emag(src), slot_in_backpack)
else
equip_to_slot_or_del(new /obj/item/weapon/pinpointer(src), slot_in_backpack)
@@ -160,7 +160,7 @@ var/global/sent_syndicate_strike_team = 0
equip_to_slot_or_del(new /obj/item/weapon/melee/energy/sword/saber(src), slot_l_store)
equip_to_slot_or_del(new /obj/item/weapon/grenade/empgrenade(src), slot_r_store)
equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen/double/full(src), slot_s_store)
- equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/automatic/pistol/m2411(src), slot_belt)
+ equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/automatic/pistol/m1911(src), slot_belt)
equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/automatic/l6_saw(src), slot_r_hand)
@@ -173,4 +173,4 @@ var/global/sent_syndicate_strike_team = 0
W.registered_name = real_name
equip_to_slot_or_del(W, slot_wear_id)
- return 1
\ No newline at end of file
+ return 1
diff --git a/code/modules/admin/verbs/vox_raiders.dm b/code/modules/admin/verbs/vox_raiders.dm
index c5e370f06f7..251ec478381 100644
--- a/code/modules/admin/verbs/vox_raiders.dm
+++ b/code/modules/admin/verbs/vox_raiders.dm
@@ -18,7 +18,7 @@ var/global/vox_tick = 1
equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/monocle(src), slot_glasses) // REPLACE WITH CODED VOX ALTERNATIVE.
equip_to_slot_or_del(new /obj/item/device/chameleon(src), slot_l_store)
- var/obj/item/weapon/gun/launcher/spikethrower/W = new(src)
+ var/obj/item/weapon/gun/projectile/automatic/spikethrower/W = new(src)
equip_to_slot_or_del(W, slot_r_hand)
@@ -48,7 +48,7 @@ var/global/vox_tick = 1
equip_to_slot_or_del(new /obj/item/weapon/circular_saw(src), slot_l_store)
equip_to_slot_or_del(new /obj/item/weapon/gun/dartgun/vox/medical, slot_r_hand)
- equip_to_slot_or_del(new /obj/item/clothing/mask/breath(src), slot_wear_mask)
+ equip_to_slot_or_del(new /obj/item/clothing/mask/breath/vox(src), slot_wear_mask)
equip_to_slot_or_del(new /obj/item/weapon/tank/nitrogen(src), slot_back)
equip_to_slot_or_del(new /obj/item/device/flashlight(src), slot_r_store)
@@ -75,6 +75,6 @@ var/global/vox_tick = 1
*/
vox_tick++
- if (vox_tick > 4) vox_tick = 1
+ if(vox_tick > 4) vox_tick = 1
- return 1
\ No newline at end of file
+ return 1
diff --git a/code/modules/alarm/alarm_handler.dm b/code/modules/alarm/alarm_handler.dm
index bfa2b5f44ed..9878a4b5e5e 100644
--- a/code/modules/alarm/alarm_handler.dm
+++ b/code/modules/alarm/alarm_handler.dm
@@ -54,7 +54,7 @@
return alarms
/datum/alarm_handler/proc/check_alarm_cleared(var/datum/alarm/alarm)
- if ((alarm.end_time && world.time > alarm.end_time) || !alarm.sources.len)
+ if((alarm.end_time && world.time > alarm.end_time) || !alarm.sources.len)
alarms -= alarm
alarms_assoc -= alarm.origin
on_alarm_change(alarm, ALARM_CLEARED)
diff --git a/code/modules/arcade/arcade_base.dm b/code/modules/arcade/arcade_base.dm
index 2835d2451e3..d886fa3f4be 100644
--- a/code/modules/arcade/arcade_base.dm
+++ b/code/modules/arcade/arcade_base.dm
@@ -84,7 +84,7 @@
/obj/machinery/arcade/proc/pay_with_cash(var/obj/item/weapon/spacecash/cashmoney, var/mob/user)
if(cashmoney.get_total() < token_price)
- to_chat(user, "\icon[cashmoney] That is not enough money.")
+ to_chat(user, "[bicon(cashmoney)] That is not enough money.")
return 0
visible_message("[usr] inserts a credit chip into [src].")
var/left = cashmoney.get_total() - token_price
@@ -97,7 +97,7 @@
/obj/machinery/arcade/proc/pay_with_card(var/obj/item/weapon/card/id/I, var/mob/user)
visible_message("[usr] swipes a card through [src].")
var/datum/money_account/customer_account = attempt_account_access_nosec(I.associated_account_number)
- if (!customer_account)
+ if(!customer_account)
to_chat(user, "Error: Unable to access account. Please contact technical support if problem persists.")
return 0
diff --git a/code/modules/arcade/arcade_prize.dm b/code/modules/arcade/arcade_prize.dm
index f57a64de03c..d3457696268 100644
--- a/code/modules/arcade/arcade_prize.dm
+++ b/code/modules/arcade/arcade_prize.dm
@@ -67,7 +67,7 @@
throwforce = 0
throw_speed = 1
throw_range = 1
- w_class = 1.0
+ w_class = 1
max_amount = 9999 //Dang that's a lot of tickets
/obj/item/stack/tickets/New(var/loc, var/amount=null)
diff --git a/code/modules/arcade/prize_counter.dm b/code/modules/arcade/prize_counter.dm
index 5f66881cea6..e45d3d1bfe0 100644
--- a/code/modules/arcade/prize_counter.dm
+++ b/code/modules/arcade/prize_counter.dm
@@ -171,7 +171,7 @@ td.cost.toomuch {
if(href_list["eject"])
print_tickets()
- if (href_list["buy"])
+ if(href_list["buy"])
var/itemID = text2num(href_list["buy"])
var/datum/prize_item/item = global_prizes.prizes[itemID]
var/sure = alert(usr,"Are you sure you wish to purchase [item.name] for [item.cost] tickets?","You sure?","Yes","No") in list("Yes","No")
diff --git a/code/modules/assembly/assembly.dm b/code/modules/assembly/assembly.dm
index 9a61921764d..84e10835215 100644
--- a/code/modules/assembly/assembly.dm
+++ b/code/modules/assembly/assembly.dm
@@ -4,7 +4,7 @@
icon = 'icons/obj/assemblies/new_assemblies.dmi'
icon_state = ""
flags = CONDUCT
- w_class = 2.0
+ w_class = 2
materials = list(MAT_METAL=100)
throwforce = 2
throw_speed = 3
diff --git a/code/modules/assembly/bomb.dm b/code/modules/assembly/bomb.dm
index 3bf0775473c..f6019ace266 100644
--- a/code/modules/assembly/bomb.dm
+++ b/code/modules/assembly/bomb.dm
@@ -3,13 +3,14 @@
icon = 'icons/obj/tank.dmi'
item_state = "assembly"
throwforce = 5
- w_class = 3.0
+ w_class = 3
throw_speed = 2
throw_range = 4
flags = CONDUCT //Copied this from old code, so this may or may not be necessary
var/status = 0 //0 - not readied //1 - bomb finished with welder
var/obj/item/device/assembly_holder/bombassembly = null //The first part of the bomb is an assembly holder, holding an igniter+some device
var/obj/item/weapon/tank/bombtank = null //the second part of the bomb is a plasma tank
+ origin_tech = "materials=1;engineering=1"
/obj/item/device/onetankbomb/examine(mob/user)
..(user)
@@ -60,7 +61,7 @@
return
/obj/item/device/onetankbomb/receive_signal() //This is mainly called by the sensor through sense() to the holder, and from the holder to here.
- visible_message("\icon[src] *beep* *beep*", "*beep* *beep*")
+ visible_message("[bicon(src)] *beep* *beep*", "*beep* *beep*")
sleep(10)
if(!src)
return
@@ -140,7 +141,7 @@
if(strength >=1)
explosion(ground_zero, 0, round(strength,1), round(strength*2,1), round(strength*3,1))
- else if (strength >=0.5)
+ else if(strength >=0.5)
explosion(ground_zero, -1, 0, 1, 2)
else
ground_zero.assume_air(air_contents)
@@ -149,7 +150,7 @@
else if(air_contents.temperature > (T0C + 100))
strength = (fuel_moles/25)
- if (strength >=1)
+ if(strength >=1)
explosion(ground_zero, -1, 0, round(strength,1), round(strength*3,1))
else
ground_zero.assume_air(air_contents)
diff --git a/code/modules/assembly/health.dm b/code/modules/assembly/health.dm
index f1a3f402336..5c67f780a5f 100644
--- a/code/modules/assembly/health.dm
+++ b/code/modules/assembly/health.dm
@@ -55,7 +55,7 @@
health_scan = M.health
if(health_scan <= alarm_health)
pulse()
- audible_message("\icon[src] *beep* *beep*", "*beep* *beep*")
+ audible_message("[bicon(src)] *beep* *beep*", "*beep* *beep*")
toggle_scan()
return
return
@@ -76,7 +76,9 @@
var/dat = text("Health Sensor[scanning?"On":"Off"]")
if(scanning && health_scan)
dat += " Health: [health_scan]"
- user << browse(dat, "window=hscan")
+ var/datum/browser/popup = new(user, "hscan", name, 400, 400)
+ popup.set_content(dat)
+ popup.open(0)
onclose(user, "hscan")
return
diff --git a/code/modules/assembly/holder.dm b/code/modules/assembly/holder.dm
index 6333fbca635..f4cafef9c97 100644
--- a/code/modules/assembly/holder.dm
+++ b/code/modules/assembly/holder.dm
@@ -5,7 +5,7 @@
item_state = "assembly"
flags = CONDUCT
throwforce = 5
- w_class = 2.0
+ w_class = 2
throw_speed = 3
throw_range = 10
@@ -68,8 +68,8 @@
examine(mob/user)
..(user)
- if ((in_range(src, user) || src.loc == user))
- if (src.secured)
+ if((in_range(src, user) || src.loc == user))
+ if(src.secured)
to_chat(user, "\The [src] is ready!")
else
to_chat(user, "\The [src] can be attached!")
@@ -202,11 +202,11 @@
qdel(src)
return
if(2.0)
- if (prob(50))
+ if(prob(50))
qdel(src)
return
if(3.0)
- if (prob(25))
+ if(prob(25))
qdel(src)
return
return
diff --git a/code/modules/assembly/igniter.dm b/code/modules/assembly/igniter.dm
index a5485a59078..e6505e385ad 100644
--- a/code/modules/assembly/igniter.dm
+++ b/code/modules/assembly/igniter.dm
@@ -25,12 +25,12 @@
if(!..()) return 0//Cooldown check
var/turf/location = get_turf(loc)
if(location) location.hotspot_expose(1000,1000)
- if (istype(src.loc,/obj/item/device/assembly_holder))
- if (istype(src.loc.loc, /obj/structure/reagent_dispensers/fueltank/))
+ if(istype(src.loc,/obj/item/device/assembly_holder))
+ if(istype(src.loc.loc, /obj/structure/reagent_dispensers/fueltank/))
var/obj/structure/reagent_dispensers/fueltank/tank = src.loc.loc
- if (tank)
+ if(tank)
tank.boom()
- if (istype(src.loc.loc, /obj/item/weapon/reagent_containers/glass/beaker/))
+ if(istype(src.loc.loc, /obj/item/weapon/reagent_containers/glass/beaker/))
var/obj/item/weapon/reagent_containers/glass/beaker/beakerbomb = src.loc.loc
if(beakerbomb)
beakerbomb.heat_beaker()
diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm
index a2810d04e98..2a23732a90b 100644
--- a/code/modules/assembly/infrared.dm
+++ b/code/modules/assembly/infrared.dm
@@ -124,7 +124,7 @@
if(!secured || !on || cooldown > 0)
return 0
pulse(0)
- audible_message("\icon[src] *beep* *beep*", null, 3)
+ audible_message("[bicon(src)] *beep* *beep*", null, 3)
cooldown = 2
spawn(10)
process_cooldown()
@@ -139,7 +139,9 @@
Close"}
- user << browse(dat, "window=timer")
+ var/datum/browser/popup = new(user, "timer", name, 400, 400)
+ popup.set_content(dat)
+ popup.open(0)
onclose(user, "timer")
return
diff --git a/code/modules/assembly/voice.dm b/code/modules/assembly/voice.dm
index 4c15b5f860e..af9138724e6 100644
--- a/code/modules/assembly/voice.dm
+++ b/code/modules/assembly/voice.dm
@@ -30,12 +30,12 @@
recorded_type = type
listening = 0
var/turf/T = get_turf(src) //otherwise it won't work in hand
- T.visible_message("\icon[src] beeps, \"Activation message is [type ? "the sound when one [recorded]" : "'[recorded]'."]\"")
+ T.visible_message("[bicon(src)] beeps, \"Activation message is [type ? "the sound when one [recorded]" : "'[recorded]'."]\"")
else
if(findtext(msg, recorded) && type == recorded_type)
pulse(0)
var/turf/T = get_turf(src) //otherwise it won't work in hand
- T.visible_message("\icon[src] \red beeps!")
+ T.visible_message("[bicon(src)] \red beeps!")
activate()
return // previously this toggled listning when not in a holder, that's a little silly. It was only called in attack_self that way.
@@ -46,7 +46,7 @@
listening = !listening
var/turf/T = get_turf(src)
- T.visible_message("\icon[src] beeps, \"[listening ? "Now" : "No longer"] recording input.\"")
+ T.visible_message("[bicon(src)] beeps, \"[listening ? "Now" : "No longer"] recording input.\"")
return 1
diff --git a/code/modules/atmos_automation/console.dm b/code/modules/atmos_automation/console.dm
index c567a45e108..201a6f63e4d 100644
--- a/code/modules/atmos_automation/console.dm
+++ b/code/modules/atmos_automation/console.dm
@@ -61,7 +61,7 @@
if(!(A.returntype in valid_returntypes))
continue
choices[A.name]=A
- if (choices.len==0)
+ if(choices.len==0)
testing("Unable to find automations with returntype in [english_list(valid_returntypes)]!")
return 0
var/label=input(user, "Select new automation:", "Automations", "Cancel") as null|anything in choices
diff --git a/code/modules/awaymissions/bluespaceartillery.dm b/code/modules/awaymissions/bluespaceartillery.dm
index 670d8143390..00263352325 100644
--- a/code/modules/awaymissions/bluespaceartillery.dm
+++ b/code/modules/awaymissions/bluespaceartillery.dm
@@ -32,7 +32,7 @@
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, "bluespace_artillery.tmpl", "Bluespace Control", 400, 260)
ui.set_initial_data(data)
ui.open()
diff --git a/code/modules/awaymissions/corpse.dm b/code/modules/awaymissions/corpse.dm
index 4612979c125..b2864d1c7cc 100644
--- a/code/modules/awaymissions/corpse.dm
+++ b/code/modules/awaymissions/corpse.dm
@@ -7,6 +7,7 @@
/obj/effect/landmark/corpse
name = "Unknown"
var/mobname = "Unknown" //Unused now but it'd fuck up maps to remove it now
+ var/mob_species = null //Set to make a mob of another race, currently used only in ruins
var/corpseuniform = null //Set this to an object path to have the slot filled with said object on the corpse.
var/corpsesuit = null
var/corpseshoes = null
@@ -37,6 +38,8 @@
M.real_name = src.name
M.death(1) //Kills the new mob
M.timeofdeath = timeofdeath
+ if(src.mob_species)
+ M.set_species(src.mob_species)
if(src.corpseuniform)
M.equip_to_slot_or_del(new src.corpseuniform(M), slot_w_uniform)
if(src.corpsesuit)
@@ -159,7 +162,7 @@
corpseradio = /obj/item/device/radio/headset/headset_eng
corpseuniform = /obj/item/clothing/under/rank/engineer
corpseback = /obj/item/weapon/storage/backpack/industrial
- corpseshoes = /obj/item/clothing/shoes/orange
+ corpseshoes = /obj/item/clothing/shoes/workboots
corpsebelt = /obj/item/weapon/storage/belt/utility/full
corpsegloves = /obj/item/clothing/gloves/color/yellow
corpsehelmet = /obj/item/clothing/head/hardhat
@@ -285,3 +288,10 @@
corpseid = 1
corpseidjob = "Commander"
corpseidaccess = "Captain"
+
+/obj/effect/landmark/corpse/abductor //Connected to ruins, for some reason?
+ name = "abductor"
+ mobname = "???"
+ mob_species = "abductor"
+ corpseuniform = /obj/item/clothing/under/color/grey
+ corpseshoes = /obj/item/clothing/shoes/combat
diff --git a/code/modules/awaymissions/exile.dm b/code/modules/awaymissions/exile.dm
index 4e6a69d591b..8e2592b010b 100644
--- a/code/modules/awaymissions/exile.dm
+++ b/code/modules/awaymissions/exile.dm
@@ -32,7 +32,7 @@
/obj/structure/closet/secure_closet/exile
name = "exile implants"
- req_access = list(access_hos)
+ req_access = list(access_armory)
/obj/structure/closet/secure_closet/exile/New()
..()
diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm
index 39ac1f49676..5045b5369a1 100644
--- a/code/modules/awaymissions/gateway.dm
+++ b/code/modules/awaymissions/gateway.dm
@@ -149,7 +149,7 @@ obj/machinery/gateway/centerstation/process()
/obj/machinery/gateway/centerstation/attackby(obj/item/device/W as obj, mob/user as mob, params)
if(istype(W,/obj/item/device/multitool))
- to_chat(user, "\black The gate is already calibrated, there is no work for you to do here.")
+ to_chat(user, "The gate is already calibrated, there is no work for you to do here.")
return
/////////////////////////////////////Away////////////////////////
@@ -236,10 +236,10 @@ obj/machinery/gateway/centerstation/process()
if(!ready) return
if(!active) return
if(istype(M, /mob/living/carbon))
- if (exilecheck(M)) return
+ if(exilecheck(M)) return
if(istype(M, /obj))
for(var/mob/living/carbon/F in M)
- if (exilecheck(F)) return
+ if(exilecheck(F)) return
M.forceMove(get_step(stationgate.loc, SOUTH))
M.dir = SOUTH
diff --git a/code/modules/awaymissions/map_rng.dm b/code/modules/awaymissions/map_rng.dm
new file mode 100644
index 00000000000..147d41171c4
--- /dev/null
+++ b/code/modules/awaymissions/map_rng.dm
@@ -0,0 +1,51 @@
+/obj/effect/landmark/map_loader
+ name = "map loader"
+ icon = 'icons/mob/screen_gen.dmi'
+ icon_state = "x2"
+ invisibility = 101
+ anchored = 1
+ density = 0
+ opacity = 0
+ var/template_name = null
+ var/datum/map_template/template = null
+ var/centered = 1
+ var/loaded = 0
+
+/obj/effect/landmark/map_loader/New(turf/loc, tname)
+ ..()
+
+ if(tname)
+ template_name = tname
+ if(template_name)
+ template = map_templates[template_name]
+
+/obj/effect/landmark/map_loader/initialize()
+ ..()
+ if(template)
+ load(template)
+
+/obj/effect/landmark/map_loader/set_tag()
+ return
+
+/obj/effect/landmark/map_loader/proc/load(datum/map_template/t)
+ if(!t)
+ return
+ if(loaded) // I wanna be super sure this loads only once
+ return
+ loaded = 1
+ var/turf/pos = get_turf(src)
+ // Hop to nullspace so we don't get re-initialized by the map we're loading
+ loc = null
+ t.load(pos, centered = centered)
+ t.loaded++
+ qdel(src)
+
+/obj/effect/landmark/map_loader/random
+ var/template_list = ""
+
+/obj/effect/landmark/map_loader/random/initialize()
+ ..()
+ if(template_list)
+ template_name = safepick(splittext(template_list, ";"))
+ template = map_templates[template_name]
+ load(template)
diff --git a/code/modules/awaymissions/maploader/reader.dm b/code/modules/awaymissions/maploader/reader.dm
index e58714de9f3..ea59dd1d518 100644
--- a/code/modules/awaymissions/maploader/reader.dm
+++ b/code/modules/awaymissions/maploader/reader.dm
@@ -2,10 +2,22 @@
//SS13 Optimized Map loader
//////////////////////////////////////////////////////////////
+//As of 3.6.2016
//global datum that will preload variables on atoms instanciation
var/global/use_preloader = FALSE
var/global/dmm_suite/preloader/_preloader = new
+/dmm_suite
+ // These regexes are global - meaning that starting the maploader again mid-load will
+ // reset progress - which means we need to track our index per-map, or we'll
+ // eternally recurse
+ // /"([a-zA-Z]+)" = \(((?:.|\n)*?)\)\n(?!\t)|\((\d+),(\d+),(\d+)\) = \{"([a-zA-Z\n]*)"\}/g
+ var/static/regex/dmmRegex = new/regex({""(\[a-zA-Z]+)" = \\(((?:.|\n)*?)\\)\n(?!\t)|\\((\\d+),(\\d+),(\\d+)\\) = \\{"(\[a-zA-Z\n]*)"\\}"}, "g")
+ // /^[\s\n]+"?|"?[\s\n]+$|^"|"$/g
+ var/static/regex/trimQuotesRegex = new/regex({"^\[\\s\n]+"?|"?\[\\s\n]+$|^"|"$"}, "g")
+ // /^[\s\n]+|[\s\n]+$/
+ var/static/regex/trimRegex = new/regex("^\[\\s\n]+|\[\\s\n]+$", "g")
+ var/static/list/modelCache = list()
/**
* Construct the model map and control the loading process
@@ -16,87 +28,156 @@ var/global/dmm_suite/preloader/_preloader = new
* e.g aa = /turf/unsimulated/wall{icon_state = "rock"}
* 2) Read the map line by line, parsing the result (using parse_grid)
*
+ * If `measureOnly` is set, then no atoms will be created, and all this will do
+ * is return the bounds after parsing the file
+ *
+ * If you need to freeze init while you're working, you can use the spacial allocator's
+ * "add_dirt" and "remove_dirt" which will put initializations on hold until you say
+ * the word. This is important for loading large maps such as the cyberiad, where
+ * atmos will attempt to start before it's ready, causing runtimes galore if init is
+ * allowed to romp unchecked.
*/
-/dmm_suite/load_map(dmm_file as file, x_offset = 0 as num, y_offset = 0 as num, z_offset as num, do_sleep = 1 as num)
- if(!z_offset)//what z_level we are creating the map on
+/dmm_suite/load_map(dmm_file as file, x_offset as num, y_offset as num, z_offset as num, cropMap as num, measureOnly as num)
+ var/tfile = dmm_file//the map file we're creating
+ var/fname = "Lambda"
+ if(isfile(tfile))
+ fname = "[tfile]"
+ tfile = file2text(tfile)
+
+ if(!x_offset)
+ x_offset = 1
+ if(!y_offset)
+ y_offset = 1
+ if(!z_offset)
z_offset = world.maxz + 1
- var/quote = ascii2text(34)
- var/tfile = file2text(dmm_file)//the map file we're creating
- var/tfile_len = length(tfile)
- var/lpos = 1 // the models definition index
-
- ///////////////////////////////////////////////////////////////////////////////////////
- //first let's map model keys (e.g "aa") to their contents (e.g /turf/space{variables})
- ///////////////////////////////////////////////////////////////////////////////////////
+ var/list/bounds = list(1.#INF, 1.#INF, 1.#INF, -1.#INF, -1.#INF, -1.#INF)
var/list/grid_models = list()
- var/key_len = length(copytext(tfile,2,findtext(tfile,quote,2,0)))//the length of the model key (e.g "aa" or "aba")
+ var/key_len = 0
- //proceed line by line
- for(lpos=1; lpos world.maxz)
+ if(cropMap)
+ continue
+ else
+ space_manager.increase_max_zlevel_to(zcrd) //create a new z_level if needed
- var/y_depth = z_depth / (x_depth+1)//x_depth + 1 because we're counting the '\n' characters in z_depth
- if(world.maxy 1)
+ gridLines.Cut(1, leadingBlanks) // Remove all leading blank lines.
- //fill the current square using the model map
- xcrd=0
+ if(!gridLines.len) // Skip it if only blank lines exist.
+ continue
- for(var/mpos in 1 to x_depth step key_len)
- xcrd++
- var/model_key = copytext(grid_line,mpos,mpos+key_len)
- parse_grid(grid_models[model_key], xcrd + x_offset, ycrd + y_offset, zcrd + z_offset, do_sleep)
+ if(gridLines.len && gridLines[gridLines.len] == "")
+ gridLines.Cut(gridLines.len) // Remove only one blank line at the end.
- //reached end of current map
- if(gpos+x_depth+1>z_depth)
- break
+ bounds[MAP_MINY] = min(bounds[MAP_MINY], ycrd)
+ ycrd += gridLines.len - 1 // Start at the top and work down
- ycrd--
- if(do_sleep)
- sleep(-1)
+ if(!cropMap && ycrd > world.maxy)
+ if(!measureOnly)
+ world.maxy = ycrd // Expand Y here. X is expanded in the loop below
+ bounds[MAP_MAXY] = max(bounds[MAP_MAXY], ycrd)
+ else
+ bounds[MAP_MAXY] = max(bounds[MAP_MAXY], min(ycrd, world.maxy))
- //reached End Of File
- if(findtext(tfile,quote+"}",zpos,0)+2==tfile_len)
- break
- if(do_sleep)
- sleep(-1)
+ var/maxx = xcrdStart
+ if(measureOnly)
+ for(var/line in gridLines)
+ maxx = max(maxx, xcrdStart + length(line) / key_len - 1)
+ else
+ for(var/line in gridLines)
+ if(ycrd <= world.maxy && ycrd >= 1)
+ xcrd = xcrdStart
+ for(var/tpos = 1 to length(line) - key_len + 1 step key_len)
+ if(xcrd > world.maxx)
+ if(cropMap)
+ break
+ else
+ world.maxx = xcrd
+
+ if(xcrd >= 1)
+ var/model_key = copytext(line, tpos, tpos + key_len)
+ if(!grid_models[model_key])
+ throw EXCEPTION("Undefined model key in DMM: [model_key]. Map file: [fname].")
+ parse_grid(grid_models[model_key], xcrd, ycrd, zcrd, LM)
+ // After this call, it is NOT safe to reference `dmmRegex` without another call to
+ // "Find" - we might've hit a map loader here and changed its state
+ CHECK_TICK
+
+ maxx = max(maxx, xcrd)
+ ++xcrd
+ --ycrd
+
+ bounds[MAP_MAXX] = max(bounds[MAP_MAXX], cropMap ? min(maxx, world.maxx) : maxx)
+
+ CHECK_TICK
+ catch(var/exception/e)
+ _preloader.reset()
+ throw e
+
+ _preloader.reset()
+ log_debug("Loaded map in [stop_watch(watch)]s.")
+ qdel(LM)
+ if(bounds[MAP_MINX] == 1.#INF) // Shouldn't need to check every item
+ log_debug("Min x: bounds[MAP_MINX]")
+ log_debug("Min y: bounds[MAP_MINY]")
+ log_debug("Min z: bounds[MAP_MINZ]")
+ log_debug("Max x: bounds[MAP_MAXX]")
+ log_debug("Max y: bounds[MAP_MAXY]")
+ log_debug("Max z: bounds[MAP_MAXZ]")
+ return null
+ else
+ if(!measureOnly)
+ for(var/t in block(locate(bounds[MAP_MINX], bounds[MAP_MINY], bounds[MAP_MINZ]), locate(bounds[MAP_MAXX], bounds[MAP_MAXY], bounds[MAP_MAXZ])))
+ var/turf/T = t
+ //we do this after we load everything in. if we don't; we'll have weird atmos bugs regarding atmos adjacent turfs
+ T.AfterChange(1,keep_cabling = TRUE)
+ return bounds
/**
* Fill a given tile with its area/turf/objects/mobs
@@ -115,48 +196,60 @@ var/global/dmm_suite/preloader/_preloader = new
* 4) Instanciates the atom with its variables
*
*/
-/dmm_suite/proc/parse_grid(model as text, xcrd as num, ycrd as num, zcrd as num, do_sleep = 1)
+/dmm_suite/proc/parse_grid(model as text,xcrd as num,ycrd as num,zcrd as num, dmm_suite/loaded_map/LM)
/*Method parse_grid()
- Accepts a text string containing a comma separated list of type paths of the
same construction as those contained in a .dmm file, and instantiates them.
*/
- var/list/members = list()//will contain all members (paths) in model (in our example : /turf/unsimulated/wall and /area/mine/explored)
- var/list/members_attributes = list()//will contain lists filled with corresponding variables, if any (in our example : list(icon_state = "rock") and list())
+ var/list/members //will contain all members (paths) in model (in our example : /turf/unsimulated/wall and /area/mine/explored)
+ var/list/members_attributes //will contain lists filled with corresponding variables, if any (in our example : list(icon_state = "rock") and list())
+ var/list/cached = modelCache[model]
+ var/index
+ if(cached)
+ members = cached[1]
+ members_attributes = cached[2]
+ else
+ /////////////////////////////////////////////////////////
+ //Constructing members and corresponding variables lists
+ ////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////
- //Constructing members and corresponding variables lists
- ////////////////////////////////////////////////////////
+ members = list()
+ members_attributes = list()
+ index = 1
- var/index=1
- var/old_position = 1
- var/dpos
+ var/old_position = 1
+ var/dpos
- do
- //finding next member (e.g /turf/unsimulated/wall{icon_state = "rock"} or /area/mine/explored)
- dpos= find_next_delimiter_position(model,old_position,",","{","}")//find next delimiter (comma here) that's not within {...}
+ do
+ //finding next member (e.g /turf/unsimulated/wall{icon_state = "rock"} or /area/mine/explored)
+ dpos = find_next_delimiter_position(model, old_position, ",", "{", "}") //find next delimiter (comma here) that's not within {...}
- var/full_def = copytext(model,old_position,dpos)//full definition, e.g : /obj/foo/bar{variables=derp}
- var/atom_def = text2path(copytext(full_def,1,findtext(full_def,"{")))//path definition, e.g /obj/foo/bar
- members.Add(atom_def)
- old_position = dpos + 1
+ var/full_def = trim_text(copytext(model, old_position, dpos)) //full definition, e.g : /obj/foo/bar{variables=derp}
+ var/variables_start = findtext(full_def, "{")
+ var/atom_def = text2path(trim_text(copytext(full_def, 1, variables_start))) //path definition, e.g /obj/foo/bar
+ old_position = dpos + 1
- //transform the variables in text format into a list (e.g {var1="derp"; var2; var3=7} => list(var1="derp", var2, var3=7))
- var/list/fields = list()
+ if(!atom_def) // Skip the item if the path does not exist. Fix your crap, mappers!
+ continue
+ members.Add(atom_def)
- var/variables_start = findtext(full_def,"{")
- if(variables_start)//if there's any variable
- full_def = copytext(full_def,variables_start+1,length(full_def))//removing the last '}'
- fields = readlist(full_def, ";")
+ //transform the variables in text format into a list (e.g {var1="derp"; var2; var3=7} => list(var1="derp", var2, var3=7))
+ var/list/fields = list()
- //then fill the members_attributes list with the corresponding variables
- members_attributes.len++
- members_attributes[index++] = fields
+ if(variables_start)//if there's any variable
+ full_def = copytext(full_def,variables_start+1,length(full_def))//removing the last '}'
+ fields = readlist(full_def, ";")
- if(do_sleep)
- sleep(-1)
- while(dpos != 0)
+ //then fill the members_attributes list with the corresponding variables
+ members_attributes.len++
+ members_attributes[index++] = fields
+
+ CHECK_TICK
+ while(dpos != 0)
+
+ modelCache[model] = list(members, members_attributes)
////////////////
@@ -165,24 +258,25 @@ var/global/dmm_suite/preloader/_preloader = new
//The next part of the code assumes there's ALWAYS an /area AND a /turf on a given tile
- //in case of multiples turfs on one tile,
- //will contains the images of all underlying turfs, to simulate the DMM multiple tiles piling
- var/list/turfs_underlays = list()
-
//first instance the /area and remove it from the members list
index = members.len
+
+ var/turf/crds = locate(xcrd,ycrd,zcrd)
if(members[index] != /area/template_noop)
+ // We assume `members[index]` is an area path, as above, yes? I will operate
+ // on that assumption.
+ if(!ispath(members[index], /area))
+ throw EXCEPTION("Oh no, I thought this was an area!")
+
var/atom/instance
_preloader.setup(members_attributes[index])//preloader for assigning set variables on atom creation
+ instance = LM.area_path_to_real_area(members[index])
- instance = locate(members[index])
- var/turf/crds = locate(xcrd,ycrd,zcrd)
if(crds)
instance.contents.Add(crds)
if(use_preloader && instance)
_preloader.load(instance)
- members.Remove(members[index])
//then instance the /turf and, if multiple tiles are presents, simulates the DMM underlays piling effect
@@ -198,18 +292,20 @@ var/global/dmm_suite/preloader/_preloader = new
if(T)
//if others /turf are presents, simulates the underlays piling effect
index = first_turf_index + 1
- while(index <= members.len)
- turfs_underlays.Insert(1,image(T.icon,null,T.icon_state,T.layer,T.dir))//add the current turf image to the underlays list
- var/turf/UT = instance_atom(members[index],members_attributes[index],xcrd,ycrd,zcrd)//instance new turf
- add_underlying_turf(UT,T,turfs_underlays)//simulates the DMM piling effect
- T = UT
+ while(index <= members.len - 1) // Last item is an /area
+ var/underlay
+ if(istype(T, /turf)) // I blame this on the stupid clown who coded the BYOND map editor
+ underlay = T.appearance
+ T = instance_atom(members[index],members_attributes[index],xcrd,ycrd,zcrd)//instance new turf
+ if(ispath(members[index],/turf))
+ T.underlays += underlay
+
index++
//finally instance all remainings objects/mobs
- for(index in 1 to first_turf_index - 1)
+ for(index in 1 to first_turf_index-1)
instance_atom(members[index],members_attributes[index],xcrd,ycrd,zcrd)
- if(do_sleep)
- sleep(-1)
+ CHECK_TICK
////////////////
//Helpers procs
@@ -222,7 +318,13 @@ var/global/dmm_suite/preloader/_preloader = new
var/turf/T = locate(x,y,z)
if(T)
- instance = new path (T)//first preloader pass
+ if(ispath(path, /turf))
+ T.ChangeTurf(path, 1, 0)
+ instance = T
+ else if(ispath(path, /area))
+
+ else
+ instance = new path (T)//first preloader pass
if(use_preloader && instance)//second preloader pass, for those atoms that don't ..() in New()
_preloader.load(instance)
@@ -232,16 +334,11 @@ var/global/dmm_suite/preloader/_preloader = new
//text trimming (both directions) helper proc
//optionally removes quotes before and after the text (for variable name)
/dmm_suite/proc/trim_text(what as text,trim_quotes=0)
- while(length(what) && (findtext(what," ",1,2)))
- what=copytext(what,2,0)
- while(length(what) && (findtext(what," ",length(what),0)))
- what=copytext(what,1,length(what))
if(trim_quotes)
- while(length(what) && (findtext(what,quote,1,2)))
- what=copytext(what,2,0)
- while(length(what) && (findtext(what,quote,length(what),0)))
- what=copytext(what,1,length(what))
- return what
+ return trimQuotesRegex.Replace(what, "")
+ else
+ return trimRegex.Replace(what, "")
+
//find the position of the next delimiter,skipping whatever is comprised between opening_escape and closing_escape
//returns 0 if reached the last delimiter
@@ -313,14 +410,6 @@ var/global/dmm_suite/preloader/_preloader = new
return to_return
-//simulates the DM multiple turfs on one tile underlaying
-/dmm_suite/proc/add_underlying_turf(turf/placed,turf/underturf, list/turfs_underlays)
- if(underturf.density)
- placed.density = 1
- if(underturf.opacity)
- placed.opacity = 1
- placed.underlays += turfs_underlays
-
//atom creation method that preloads variables at creation
/atom/New()
if(use_preloader && (src.type == _preloader.target_path))//in case the instanciated atom is creating other atoms in New()
@@ -336,6 +425,7 @@ var/global/dmm_suite/preloader/_preloader = new
//Preloader datum
//////////////////
+// This ain't re-entrant, but we had this before the maploader update
/dmm_suite/preloader
parent_type = /datum
var/list/attributes
@@ -349,11 +439,41 @@ var/global/dmm_suite/preloader/_preloader = new
/dmm_suite/preloader/proc/load(atom/what)
for(var/attribute in attributes)
- what.vars[attribute] = attributes[attribute]
+ var/value = attributes[attribute]
+ if(islist(value))
+ value = deepCopyList(value)
+ what.vars[attribute] = value
use_preloader = FALSE
+// If the map loader fails, make this safe
+/dmm_suite/preloader/proc/reset()
+ use_preloader = FALSE
+ attributes = list()
+ target_path = null
+
+// A datum for use within the context of loading a single map,
+// so that one can have separate "unpowered" areas for ruins or whatever,
+// yet have a single area type for use of mapping, instead of creating
+// a new area type for each new ruin
+/dmm_suite/loaded_map
+ parent_type = /datum
+ var/list/area_list = list()
+ var/index = 1 // To store the state of the regex
+
+/dmm_suite/loaded_map/proc/area_path_to_real_area(area/A)
+ if(!ispath(A, /area))
+ throw EXCEPTION("Wrong argument to `area_path_to_real_area`")
+
+ if(!(A in area_list))
+ if(initial(A.there_can_be_many))
+ area_list[A] = new A
+ else
+ area_list[A] = locate(A)
+
+ return area_list[A]
+
/area/template_noop
name = "Area Passthrough"
/turf/template_noop
- name = "Turf Passthrough"
\ No newline at end of file
+ name = "Turf Passthrough"
diff --git a/code/modules/awaymissions/maploader/swapmaps.dm b/code/modules/awaymissions/maploader/swapmaps.dm
index 8dc9f9f6c99..fab504b150d 100644
--- a/code/modules/awaymissions/maploader/swapmaps.dm
+++ b/code/modules/awaymissions/maploader/swapmaps.dm
@@ -326,7 +326,7 @@ swapmap
x2+=x1-1
y2+=y1-1
z2+=z1-1
- world.maxz=max(z2,world.maxz) // stretch z if necessary
+ space_manager.increase_max_zlevel_to(z2) // stretch z if necessary
if(!ischunk)
swapmaps_loaded[src]=null
swapmaps_byname[id]=src
@@ -373,7 +373,7 @@ swapmap
mz=max(mz,M.z2)
world.maxx=mx
world.maxy=my
- world.maxz=mz
+ space_manager.cut_levels_downto(mz)
// save and delete
proc/Unload()
diff --git a/code/modules/awaymissions/mission_code/spacehotel.dm b/code/modules/awaymissions/mission_code/spacehotel.dm
new file mode 100644
index 00000000000..b7670737193
--- /dev/null
+++ b/code/modules/awaymissions/mission_code/spacehotel.dm
@@ -0,0 +1,308 @@
+#define PAY_INTERVAL 6000 // amount of ticks between payment
+
+/area/awaymission/spacehotel
+ name = "Deep Space Hotel 419"
+ requires_power = 0
+
+/area/awaymission/spacehotel/kitchen
+ name = "Hotel Kitchen"
+ icon_state = "kitchen"
+
+/area/awaymission/spacehotel/reception
+ name = "Hotel Reception"
+ icon_state = "entry"
+
+// "Directional" map template loader for N or S hotel room
+/obj/effect/landmark/map_loader/hotel_room
+ icon = 'icons/testing/turf_analysis.dmi'
+ icon_state = "arrow"
+
+/obj/item/weapon/paper/crumpled/hotel_scrap_1
+ name = "paper scrap"
+ info = "I can't believe this shitty hotel assigned me a purple-themed room. Why does the shower dump grape drink everywhere??"
+
+/obj/item/weapon/paper/hotel_scrap_2
+ name = "Journal Entry #2"
+ info = "
Day 7:
Today, I stepped into my bathroom, only to discover that it had become a mountainside wilderness. I tried to wash my hands with snow, but it didn't particularly pan out. I contacting the front desk regarding the issue, but the receptionist just stared at me with dead eyes and spouted unrepeatable curses at me. However, I convinced them to reassign me to an upgraded suite."
+
+/obj/item/weapon/paper/hotel_scrap_3
+ name = "Journal Entry #3"
+ info = "
Day 26:
Well, that sucked royally. The queen-sized bed was nice, but the hottub in my room was, well, my wife described it as \"a portal to hell\". I don't know, I guess the lava and weird blood gave it that impression, but it was pretty nicely warm. However, \"we\" decided to get assigned to a new room. Whatever."
+
+/obj/item/weapon/paper/hotel_scrap_4
+ name = "Diary Page"
+ info = "Day 7 of Bad Vacation Thanks Qzxor this shit vacation is ending today. The novelty of the trashy pool wore off 2 days in and I'm not allowed in the bar. The tiny box they called a room that, we had to cram into, just had a poster and a couple of beds. Only one bedsheet to spare. Shower had brown water and sink just dumped its water back out the ceiling, somehow.
PS: The receptionist isn't paying attention to us when we try to check out. Apparently, we're staying another day."
+
+/obj/item/weapon/paper/hotel_scrap_5
+ name = "Journal Entry #5"
+ info = "
Day 185:
I feel like the restaurant's chef is just making random dishes to mess with me. I request something from the menu, and he throws out something nobody asked for on the counter. The bartender isn't much better. At least both of them can make some nice food and drinks. I would complain to the management... but they never seem to care."
+
+/obj/item/weapon/paper/crumpled/hotel_scrap_6
+ name = "Journal Entry #6"
+ info = "
Day 386:
AMBGAT MEZLBNU. Something wrong. Can't stop hugging plushies."
+
+/obj/item/weapon/paper/crumpled/hotel_scrap_7
+ name = "Journal Entry #8"
+ info = "ASGATDHU NAMSPA KER OKS O OKDOFLI OSDSFKO OASKDAFO AOSDKF OINAIS ISJDDEF OSKFEREAODIK OSI ODIFOSA OEKRRO ASODFKAO PSSDOF SDFK OSDKF OSDKFSASPODFIOSASD UHGU DFYG FPO ASDFOS DFOASSD FAPSO FSPDFOIER OPWASDSA PS DODIOF OSDI pizza OKSDFO AL OKEWORK CVBUASO SDFO AOE RAOWEIK SODDFI"
+
+/obj/item/weapon/paper/hotel_scrap_8
+ name = "Mysterious Note"
+ icon_state = "paper_talisman"
+ info = "
There is only one way to leave.
"
+
+/obj/item/weapon/paper/pamphlet/hotel
+ name = "space hotel pamphlet"
+ info = "
Welcome to Deep Space Hotel 419!
Thank you for choosing our hotel. Simply hand your credit or debit card to the concierge and get your room key! To check out, hand your credit card back.
Conditions:
The hotel is not responsible for any losses due to time or space anomalies.
The hotel is not responsible for events that occur outside of the hotel station, including, but not limited to, events that occur inside of dimensional pockets.
The hotel is not responsible for overcharging your account.
The hotel is not responsible for missing persons.
The hotel is not responsible for mind-altering effects due to drugs, magic, demons, or space worms.
"
+
+/obj/effect/landmark/map_loader/hotel_room/initialize()
+ ..()
+ // load and randomly assign rooms
+ var/global/list/south_room_templates = list()
+ var/global/list/north_room_templates = list()
+ var/static/path = "_maps/map_files/templates/spacehotel/"
+ var/global/loaded = 0
+ if(!loaded)
+ loaded = 1
+ for(var/map in flist(path))
+ if(cmptext(copytext(map, length(map) - 3), ".dmm"))
+ var/datum/map_template/T = new(path = "[path][map]", rename = "[map]")
+ if(copytext(map, 1, 3) == "n_")
+ north_room_templates += T
+ else if(copytext(map, 1, 3) == "s_")
+ south_room_templates += T
+ else
+ // omnidirectional rooms are randomly assigned
+ if(prob(50))
+ north_room_templates += T
+ else
+ south_room_templates += T
+
+ var/datum/map_template/M = safepick(dir == NORTH ? north_room_templates : south_room_templates)
+ if(M)
+ template = M
+ if(dir == NORTH)
+ north_room_templates -= M
+ else
+ south_room_templates -= M
+ load(M)
+
+// The door to a hotel room, but also metadata for the room itself
+/obj/machinery/door/unpowered/hotel_door
+ name = "Room Door"
+ icon = 'icons/obj/doors/Doorsand.dmi'
+ icon_state = "door_closed"
+ autoclose = 1
+ atom_say_verb = "beeps"
+ var/doorOpen = 'sound/machines/airlock.ogg'
+ var/doorClose = 'sound/machines/airlock.ogg'
+ var/doorDeni = 'sound/machines/DeniedBeep.ogg'
+ var/id // the room number, eg 101
+ var/obj/item/weapon/card/hotel_card/card// room's key card
+ var/mob/living/occupant = null // the current room occupant
+ var/datum/money_account/account // Account we're pulling from
+ var/roomtimer // timer PS handle for updating room
+
+/obj/machinery/door/unpowered/hotel_door/New()
+ ..()
+ if(id)
+ name = "Room [id]"
+
+ // in case we spawned after hotel
+ var/obj/effect/hotel_controller/H
+ H = H.controller
+ if(H)
+ H.add_room(src)
+
+/obj/machinery/door/unpowered/hotel_door/Destroy()
+ if(roomtimer)
+ deltimer(roomtimer)
+ roomtimer = null
+ qdel(card)
+ card = null
+ return ..()
+
+/obj/machinery/door/unpowered/hotel_door/examine(mob/user)
+ ..()
+ to_chat(user, "This room is currently [occupant ? "" : "un"]occupied.")
+
+/obj/machinery/door/unpowered/hotel_door/allowed(mob/living/carbon/user)
+ for(var/obj/item/weapon/card/hotel_card/C in user.get_all_slots())
+ if(C == card && occupant)
+ atom_say("Welcome, [occupant.real_name]!")
+ return 1
+ return 0
+
+/obj/machinery/door/unpowered/hotel_door/update_icon()
+ overlays.Cut()
+ if(density)
+ icon_state = "door_closed"
+ else
+ icon_state = "door_open"
+
+/obj/machinery/door/unpowered/hotel_door/do_animate(animation)
+ switch(animation)
+ if("opening")
+ playsound(loc, doorOpen, 30, 1)
+ flick("door_opening", src)
+ if("closing")
+ playsound(loc, doorClose, 30, 1)
+ flick("door_closing", src)
+ if("deny")
+ playsound(src.loc, doorDeni, 50, 0, 3)
+ flick("door_deny", src)
+
+/obj/machinery/door/unpowered/hotel_door/autoclose()
+ if(!density && !operating && autoclose)
+ close()
+
+/obj/machinery/door/unpowered/hotel_door/emag_act(mob/user)
+ if(isliving(user) && density)
+ var/obj/effect/hotel_controller/H
+ if(H.controller)
+ H.controller.deploy_sec(user)
+ ..()
+
+/obj/item/weapon/card/hotel_card
+ name = "Key Card"
+ icon_state = "guest"
+ color = "#0CF"
+ var/id
+
+/obj/item/weapon/card/hotel_card/New(loc, ID)
+ ..()
+ if(ID)
+ id = ID
+ if(id)
+ name = "Key Card - [id]"
+ desc = "A key card to room [id]. Use it to open the door."
+
+/obj/item/weapon/card/hotel_card/Destroy()
+ var/mob/user = get(loc, /mob)
+ if(user)
+ to_chat(user, "\The [src] suddenly disappears in a flash!")
+ return ..()
+
+/obj/effect/hotel_controller
+ var/global/obj/effect/hotel_controller/controller
+
+ name = "Deep Space Hotel 419"
+ icon = 'icons/mob/screen_gen.dmi'
+ icon_state = "x"
+ invisibility = 101
+ anchored = 1
+ density = 0
+ opacity = 0
+ var/list/room_doors[0] // assoc list of [room id]=hotel_door
+ var/list/vacant_rooms[0] // list of vacant room doors
+ var/list/guests[0] // assoc list of [guest mob]=room id
+
+ var/obj/item/device/radio/radio // for shouting at deadbeats
+
+/obj/effect/hotel_controller/New()
+ ..()
+ if(controller)
+ qdel(src)
+ controller = src
+
+ radio = new()
+ radio.broadcasting = 0
+ radio.listening = 0
+
+ // get room doors
+ for(var/obj/machinery/door/unpowered/hotel_door/D in get_area(src))
+ add_room(D)
+
+/obj/effect/hotel_controller/proc/add_room(obj/machinery/door/unpowered/hotel_door/D)
+ room_doors["[D.id]"] = D
+ vacant_rooms += D
+
+/obj/effect/hotel_controller/Destroy()
+ room_doors.Cut()
+ vacant_rooms.Cut()
+ guests.Cut()
+
+ if(radio)
+ qdel(radio)
+ radio = null
+
+ return ..()
+
+// to check a person into a room; no financial stuff; returns the keycard
+/obj/effect/hotel_controller/proc/checkin(roomid, mob/living/carbon/occupant, obj/item/weapon/card/id/id)
+ if(!istype(occupant))
+ return null
+ var/obj/machinery/door/unpowered/hotel_door/D = room_doors["[roomid]"]
+ if(!D || D.occupant || (occupant in guests))
+ return null
+
+ D.account = get_card_account(id, occupant)
+ if(!D.account)
+ return null
+ if(!D.account.charge(100, transaction_purpose = "10 minutes", dest_name = name))
+ return null
+
+ D.occupant = occupant
+ D.roomtimer = addtimer(src, "process_room", PAY_INTERVAL, 0, roomid)
+ vacant_rooms -= D
+ guests[occupant] = roomid
+
+ var/obj/item/weapon/card/hotel_card/C = new(ID = roomid)
+ D.card = C
+ return C
+
+/obj/effect/hotel_controller/proc/process_room(roomid)
+ var/obj/machinery/door/unpowered/hotel_door/D = room_doors["[roomid]"]
+ if(!D || !D.occupant)
+ return
+
+ if(D.account.charge(100, transaction_purpose = "10 minutes", dest_name = name))
+ D.roomtimer = addtimer(src, "process_room", PAY_INTERVAL, 0, roomid)
+ else
+ force_checkout(roomid)
+
+// Checks a person out of a room; no financial stuff
+/obj/effect/hotel_controller/proc/checkout(roomid)
+ var/obj/machinery/door/unpowered/hotel_door/D = room_doors["[roomid]"]
+ if(!D || !D.occupant)
+ return 0
+
+ guests -= D.occupant
+ D.occupant = null
+ D.account = null
+ deltimer(D.roomtimer)
+ D.roomtimer = null
+ qdel(D.card)
+ vacant_rooms += D
+ return 1
+
+// The person's card bounced mid-stay
+/obj/effect/hotel_controller/proc/force_checkout(roomid)
+ var/obj/machinery/door/unpowered/hotel_door/D = room_doors["[roomid]"]
+ if(!D || !D.occupant)
+ return 0
+
+ var/mob/deadbeat = D.occupant
+
+ radio.autosay("[deadbeat], your card has been rejected. You have 30 seconds to check out.", name, zlevel = list(z))
+ spawn(300)
+ if(D.occupant == deadbeat)
+ // they still haven't checked out...
+ deploy_sec(deadbeat)
+ checkout(roomid)
+
+/obj/effect/hotel_controller/proc/deploy_sec(mob/living/target)
+ if(!istype(target) || !istype(get_area(target), /area/awaymission/spacehotel))
+ return
+
+ var/list/secs[0]
+ for(var/mob/living/carbon/human/interactive/away/hotel/guard/M in get_area(src))
+ if(!M.retal)
+ secs += M
+ var/mob/living/carbon/human/interactive/away/hotel/guard/S = safepick(secs)
+ if(!S)
+ return
+
+ S.retal_target = target
+ S.retal = 1
+
+#undef CHECKOUT_TIME
diff --git a/code/modules/awaymissions/mission_code/spacehotel_npcs.dm b/code/modules/awaymissions/mission_code/spacehotel_npcs.dm
new file mode 100644
index 00000000000..d113731837d
--- /dev/null
+++ b/code/modules/awaymissions/mission_code/spacehotel_npcs.dm
@@ -0,0 +1,118 @@
+/mob/living/carbon/human/interactive/away/hotel
+ away_area = /area/awaymission/spacehotel
+ override_under = /obj/item/clothing/under/mafia
+ chattyness = SNPC_CHANCE_TALK / 4
+
+/mob/living/carbon/human/interactive/away/hotel/New(loc)
+ ..(loc, "Skrell")
+
+/mob/living/carbon/human/interactive/away/hotel/doSetup()
+ ..()
+ MYID.access += access_syndicate
+ RPID.access += access_syndicate
+
+/mob/living/carbon/human/interactive/away/hotel/guard
+ default_job = /datum/job/officer
+
+/mob/living/carbon/human/interactive/away/hotel/guard/doSetup()
+ ..("Guard")
+
+/mob/living/carbon/human/interactive/away/hotel/chef
+ default_job = /datum/job/chef
+ away_area = /area/awaymission/spacehotel/kitchen
+ override_under = /obj/item/clothing/under/mafia/vest
+
+/mob/living/carbon/human/interactive/away/hotel/bartender
+ default_job = /datum/job/bartender
+ override_under = /obj/item/clothing/under/mafia/vest
+
+/mob/living/carbon/human/interactive/away/hotel/concierge
+ override_under = /obj/item/clothing/under/mafia/white
+ away_area = /area/awaymission/spacehotel/reception
+ var/list/known_guests[0]
+ var/obj/effect/hotel_controller/hotel
+ var/obj/item/weapon/card/id/last_seen_id = null
+
+/mob/living/carbon/human/interactive/away/hotel/concierge/random()
+ ..()
+ equip_or_collect(new /obj/item/weapon/clipboard(src), slot_l_hand)
+
+/mob/living/carbon/human/interactive/away/hotel/concierge/doSetup()
+ ..("Concierge")
+
+/mob/living/carbon/human/interactive/away/hotel/concierge/setup_job()
+ favoured_types = list(/obj/item/weapon/paper, /obj/item/weapon/clipboard)
+ functions += list("stamping", "concierge")
+ restrictedJob = 1
+
+/mob/living/carbon/human/interactive/away/hotel/concierge/proc/concierge()
+ if(!hotel)
+ hotel = hotel.controller
+ if(!hotel)
+ return
+
+ var/verbs_use = pick_list(speak_file, "verbs_use")
+ var/verbs_touch = pick_list(speak_file, "verbs_touch")
+ var/verbs_move = pick_list(speak_file, "verbs_move")
+ var/nouns_generic = pick_list(speak_file, "nouns_generic")
+ var/adjective_insult = pick_list(speak_file, "adjective_insult")
+ var/adjective_objects = pick_list(speak_file, "adjective_objects")
+ var/adjective_generic = pick_list(speak_file, "adjective_generic")
+ var/curse_words = pick_list(speak_file, "curse_words")
+
+ var/found = 0
+ for(var/mob/living/carbon/human/H in nearby - known_guests)
+ pointed(H)
+ known_guests += H
+ found = 1
+ if(found)
+ say("Welcome to [hotel], [nouns_generic]! Please check in by [ing_verb(verbs_move)] and [ing_verb(verbs_use)] your [adjective_objects] ID onto the table.")
+ return
+
+ var/obj/item/weapon/card/id
+ var/id_seen = 0
+ for(var/obj/item/weapon/card/id/I in get_area(src))
+ id_seen = 1
+ if(I != last_seen_id)
+ id = I
+ if(!id_seen)
+ last_seen_id = null
+ return
+ if(!id)
+ return
+ var/turf/idloc = get_turf(id)
+ if(!Adjacent(idloc))
+ tryWalk(idloc)
+ else
+ // is the last jerk that touched it over here?
+ var/mob/id_owner
+ for(var/mob/living/carbon/human/H in nearby)
+ if(H.ckey == id.fingerprintslast)
+ id_owner = H
+ break
+
+ if(!id_owner)
+ say("Whose card is this?")
+ pointed(id)
+ return
+
+ last_seen_id = id
+ // Checking in or out?
+ if(id_owner in hotel.guests)
+ // Check out
+ say ("Hope you enjoyed your [adjective_objects] stay at our [adjective_generic] hotel!")
+ hotel.checkout(hotel.guests[id_owner])
+ else
+ // pick a room
+ var/obj/machinery/door/unpowered/hotel_door/D = safepick(hotel.vacant_rooms)
+ if(!D)
+ say("Sorry, all the [adjective_objects] are occupied currently.")
+ else
+ // Check in
+ say("$100 per 10 minutes. The cost will be automatically [past_verb(verbs_touch)] while you're checked in.")
+
+ var/obj/item/weapon/card/hotel_card/K = hotel.checkin(D.id, id_owner, id)
+ if(K)
+ K.forceMove(idloc)
+ else
+ say("Your [adjective_insult] [curse_words] card was rejected.")
\ No newline at end of file
diff --git a/code/modules/awaymissions/mission_code/stationCollision.dm b/code/modules/awaymissions/mission_code/stationCollision.dm
index 0adf55229e0..7a6480943a7 100644
--- a/code/modules/awaymissions/mission_code/stationCollision.dm
+++ b/code/modules/awaymissions/mission_code/stationCollision.dm
@@ -61,10 +61,8 @@
*/
//Captain's retro laser - Fires practice laser shots instead.
obj/item/weapon/gun/energy/laser/retro/sc_retro
- name ="retro laser"
- icon_state = "retro"
desc = "An older model of the basic lasergun, no longer used by Nanotrasen's security or military forces."
-// projectile_type = "/obj/item/projectile/practice"
+ ammo_type = list(/obj/item/ammo_casing/energy/laser/practice)
clumsy_check = 0 //No sense in having a harmless gun blow up in the clowns face
//Syndicate sub-machine guns.
@@ -177,7 +175,7 @@ var/sc_safecode5 = "[rand(0,9)]"
/obj/singularity/narsie/sc_Narsie/consume(var/atom/A)
if(is_type_in_list(A, uneatable))
return 0
- if (istype(A,/mob/living))
+ if(istype(A,/mob/living))
var/mob/living/L = A
L.gib()
else if(istype(A,/obj/))
@@ -196,4 +194,4 @@ var/sc_safecode5 = "[rand(0,9)]"
return
/obj/singularity/narsie/sc_Narsie/ex_act()
- return
\ No newline at end of file
+ return
diff --git a/code/modules/awaymissions/mission_code/wildwest.dm b/code/modules/awaymissions/mission_code/wildwest.dm
index d28d67f1f35..3db7ff86668 100644
--- a/code/modules/awaymissions/mission_code/wildwest.dm
+++ b/code/modules/awaymissions/mission_code/wildwest.dm
@@ -65,7 +65,7 @@
else if(is_special_character(user))
to_chat(user, "Even to a heart as dark as yours, you know nothing good will come of this. Something instinctual makes you pull away.")
- else if (!insistinga)
+ else if(!insistinga)
to_chat(user, "Your first touch makes the Wish Granter stir, listening to you. Are you really sure you want to do this?")
insistinga++
@@ -172,7 +172,7 @@
if(istype(M, /mob/living/carbon/human))
for(var/mob/O in viewers(world.view, src.loc))
- to_chat(O, "[M] triggered the \icon[src] [src]")
+ to_chat(O, "[M] triggered the [bicon(src)] [src]")
triggered = 1
call(src,triggerproc)(M)
diff --git a/code/modules/awaymissions/snpc.dm b/code/modules/awaymissions/snpc.dm
new file mode 100644
index 00000000000..bd7046e3b2c
--- /dev/null
+++ b/code/modules/awaymissions/snpc.dm
@@ -0,0 +1,83 @@
+/mob/living/carbon/human/interactive/away
+ var/away_area = /area/awaymission // their overriden job area
+ var/override_under = null // optional type for uniform, else default for job
+ var/squad_member = 0 // was spawned by squad
+ var/home_z
+
+/mob/living/carbon/human/interactive/away/New()
+ ..()
+ TRAITS |= TRAIT_ROBUST
+ faction += "away"
+
+/mob/living/carbon/human/interactive/away/random()
+ if(ispath(override_under, /obj/item/clothing/under))
+ equip_to_slot(new override_under(src), slot_w_uniform)
+ ..()
+
+/mob/living/carbon/human/interactive/away/doSetup()
+ ..()
+ var/datum/data/pda/app/messenger/M = MYPDA.find_program(/datum/data/pda/app/messenger)
+ M.toff = 1
+ var/datum/data/pda/app/chatroom/C = MYPDA.find_program(/datum/data/pda/app/chatroom)
+ C.toff = 1
+
+/mob/living/carbon/human/interactive/away/job2area()
+ return away_area
+
+/mob/living/carbon/human/interactive/away/doProcess()
+ if(!home_z)
+ home_z = get_turf(z)
+ if(home_z != get_turf(z))
+ gib()
+ ..()
+
+/obj/effect/spawner/snpc_squad
+ name = "squad spawner"
+ icon = 'icons/mob/screen_gen.dmi'
+ icon_state = "x"
+ density = 0
+ opacity = 0
+ invisibility = 101
+ var/squad_type = /mob/living/carbon/human/interactive/away
+ var/squad_size = 3
+
+ var/global/list/squads[0]
+ var/list/squad
+
+/obj/effect/spawner/snpc_squad/New()
+ processing_objects += src
+
+ squad = squads[squad_type]
+ if(!squad)
+ squad = list()
+ squads[squad_type] = squad
+ squad += src
+
+/obj/effect/spawner/snpc_squad/Destroy()
+ squad = null
+ processing_objects -= src
+ return ..()
+
+/obj/effect/spawner/snpc_squad/process()
+ // check squad memebers
+ var/living = 0
+ for(var/mob/living/carbon/human/interactive/away/A in squad)
+ if(!A.stat)
+ living++
+ else
+ // see if anyone's looking, if not, despawn
+ var/can_despawn = 1
+ for(var/mob/living/M in viewers(A, world.view + 1))
+ if(M.client)
+ living++ // dead guy that can be seen still takes up a slot
+ can_despawn = 0
+ break
+ if(can_despawn)
+ squad -= A
+ qdel(A)
+
+ // spawn new ones
+ if(living < squad_size && !length(viewers(src, world.view)))
+ var/mob/living/carbon/human/interactive/away/A = new squad_type(loc)
+ squad += A
+ A.squad_member = 1
\ No newline at end of file
diff --git a/code/modules/awaymissions/zlevel.dm b/code/modules/awaymissions/zlevel.dm
index 321e4033f0e..da6515a591d 100644
--- a/code/modules/awaymissions/zlevel.dm
+++ b/code/modules/awaymissions/zlevel.dm
@@ -1,14 +1,27 @@
+var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away_mission_config.txt")
+
+// Call this before you remove the last dirt on a z level - that way, all objects
+// will have proper atmos and other important enviro things
/proc/late_setup_level(turfs, smoothTurfs)
+ var/total_timer = start_watch()
+ var/subtimer = start_watch()
if(!smoothTurfs)
smoothTurfs = turfs
+ log_debug("Setting up atmos")
if(air_master)
air_master.setup_allturfs(turfs)
+ log_debug("\tTook [stop_watch(subtimer)]s")
+
+ subtimer = start_watch()
+ log_debug("Initializing lighting")
for(var/turf/T in turfs)
if(T.dynamic_lighting)
T.lighting_build_overlays()
- for(var/obj/structure/cable/PC in T)
- makepowernet_for(PC)
+ log_debug("\tTook [stop_watch(subtimer)]s")
+
+ subtimer = start_watch()
+ log_debug("Smoothing tiles")
for(var/turf/T in smoothTurfs)
if(T.smooth)
smooth_icon(T)
@@ -16,59 +29,45 @@
var/atom/A = R
if(A.smooth)
smooth_icon(A)
+ if(istype(T, /turf/simulated/mineral)) // For the listening post, among other maps
+ var/turf/simulated/mineral/MT = T
+ MT.add_edges()
+ log_debug("\tTook [stop_watch(subtimer)]s")
+ log_debug("Late setup finished - took [stop_watch(total_timer)]s")
+
+/proc/empty_rect(low_x,low_y, hi_x,hi_y, z)
+ var/timer = start_watch()
+ log_debug("Emptying region: ([low_x], [low_y]) to ([hi_x], [hi_y]) on z '[z]'")
+ empty_region(block(locate(low_x, low_y, z), locate(hi_x, hi_y, z)))
+ log_debug("Took [stop_watch(timer)]s")
+
+/proc/empty_region(list/turfs)
+ for(var/thing in turfs)
+ var/turf/T = thing
+ for(var/otherthing in T)
+ qdel(otherthing)
+ T.ChangeTurf(/turf/space)
/proc/createRandomZlevel()
if(awaydestinations.len) //crude, but it saves another var!
return
- var/list/potentialRandomZlevels = list()
- log_startup_progress("Searching for away missions...")
- var/list/Lines
- if(fexists("config/away_mission_config.txt"))
- Lines = file2list("config/away_mission_config.txt")
- else
- Lines = file2list("config/example/away_mission_config.txt")
-
- if(!Lines.len) return
- for (var/t in Lines)
- if (!t)
- continue
-
- t = trim(t)
- if (length(t) == 0)
- continue
- else if (copytext(t, 1, 2) == "#")
- continue
-
- var/pos = findtext(t, " ")
- var/name = null
- // var/value = null
-
- if (pos)
- name = lowertext(copytext(t, 1, pos))
- // value = copytext(t, pos + 1)
- else
- name = lowertext(t)
-
- if (!name)
- continue
-
- potentialRandomZlevels.Add(t)
-
-
- if(potentialRandomZlevels.len)
+ if(potentialRandomZlevels && potentialRandomZlevels.len)
var/watch = start_watch()
log_startup_progress("Loading away mission...")
var/map = pick(potentialRandomZlevels)
var/file = file(map)
if(isfile(file))
- maploader.load_map(file, do_sleep = 0)
- late_setup_level(block(locate(1, 1, world.maxz), locate(world.maxx, world.maxy, world.maxz)))
+ var/zlev = space_manager.add_new_zlevel(AWAY_MISSION, linkage = UNAFFECTED)
+ space_manager.add_dirt(zlev)
+ maploader.load_map(file, z_offset = zlev)
+ late_setup_level(block(locate(1, 1, zlev), locate(world.maxx, world.maxy, zlev)))
+ space_manager.remove_dirt(zlev)
log_to_dd(" Away mission loaded: [map]")
for(var/obj/effect/landmark/L in landmarks_list)
- if (L.name != "awaystart")
+ if(L.name != "awaystart")
continue
awaydestinations.Add(L)
@@ -76,4 +75,137 @@
else
log_startup_progress(" No away missions found.")
- return
\ No newline at end of file
+ return
+
+/proc/createALLZlevels()
+ if(awaydestinations.len) //crude, but it saves another var!
+ return
+
+ if(potentialRandomZlevels && potentialRandomZlevels.len)
+ var/watch = start_watch()
+ log_startup_progress("Loading away missions...")
+
+ for(var/map in potentialRandomZlevels)
+ var/file = file(map)
+ if(isfile(file))
+ log_startup_progress("Loading away mission: [map]")
+ var/zlev = space_manager.add_new_zlevel()
+ space_manager.add_dirt(zlev)
+ maploader.load_map(file, z_offset = zlev)
+ late_setup_level(block(locate(1, 1, zlev), locate(world.maxx, world.maxy, zlev)))
+ space_manager.remove_dirt(zlev)
+ log_to_dd(" Away mission loaded: [map]")
+
+ //map_transition_config.Add(AWAY_MISSION_LIST)
+
+ for(var/obj/effect/landmark/L in landmarks_list)
+ if(L.name != "awaystart")
+ continue
+ awaydestinations.Add(L)
+
+ log_startup_progress(" Away mission loaded in [stop_watch(watch)]s.")
+ watch = start_watch()
+
+ else
+ log_startup_progress(" No away missions found.")
+ return
+
+/proc/generateMapList(filename)
+ var/list/potentialMaps = list()
+ var/list/Lines = file2list(filename)
+
+ if(!Lines.len)
+ return
+ for(var/t in Lines)
+ if(!t)
+ continue
+
+ t = trim(t)
+ if(length(t) == 0)
+ continue
+ else if(copytext(t, 1, 2) == "#")
+ continue
+
+ var/pos = findtext(t, " ")
+ var/name = null
+
+ if(pos)
+ name = lowertext(copytext(t, 1, pos))
+
+ else
+ name = lowertext(t)
+
+ if(!name)
+ continue
+
+ potentialMaps.Add(t)
+
+ return potentialMaps
+
+
+/proc/seedRuins(z_level = 1, budget = 0, whitelist = /area/space, list/potentialRuins = space_ruins_templates)
+ var/overall_sanity = 100
+ var/ruins = potentialRuins.Copy()
+ var/initialbudget = budget
+ var/watch = start_watch()
+
+ while(budget > 0 && overall_sanity > 0)
+ // Pick a ruin
+ var/datum/map_template/ruin/ruin = ruins[pick(ruins)]
+ // Can we afford it
+ if(ruin.cost > budget)
+ overall_sanity--
+ continue
+ // If so, try to place it
+ var/sanity = 100
+ // And if we can't fit it anywhere, give up, try again
+
+ while(sanity > 0)
+ sanity--
+ var/turf/T = locate(rand(25, world.maxx - 25), rand(25, world.maxy - 25), z_level)
+ var/valid = 1
+
+ for(var/turf/check in ruin.get_affected_turfs(T,1))
+ var/area/new_area = get_area(check)
+ if(!(istype(new_area, whitelist)))
+ valid = 0
+ break
+
+ if(!valid)
+ continue
+
+ log_to_dd(" Ruin \"[ruin.name]\" loaded in [stop_watch(watch)]s at ([T.x], [T.y], [T.z]).")
+
+ var/obj/effect/ruin_loader/R = new /obj/effect/ruin_loader(T)
+ R.Load(ruins,ruin)
+ budget -= ruin.cost
+ if(!ruin.allow_duplicates)
+ ruins -= ruin.name
+ break
+
+
+ if(initialbudget == budget) //Kill me
+ log_to_dd(" No ruins loaded.")
+
+
+/obj/effect/ruin_loader
+ name = "random ruin"
+ desc = "If you got lucky enough to see this..."
+ icon = 'icons/obj/weapons.dmi'
+ icon_state = "syndballoon"
+ invisibility = 0
+
+/obj/effect/ruin_loader/proc/Load(list/potentialRuins = space_ruins_templates, datum/map_template/template = null)
+ var/list/possible_ruins = list()
+ for(var/A in potentialRuins)
+ var/datum/map_template/T = potentialRuins[A]
+ if(!T.loaded)
+ possible_ruins += T
+ if(!template && possible_ruins.len)
+ template = safepick(possible_ruins)
+ if(!template)
+ return 0
+ template.load(get_turf(src),centered = 1)
+ template.loaded++
+ qdel(src)
+ return 1
diff --git a/code/modules/awaymissions/zvis.dm b/code/modules/awaymissions/zvis.dm
new file mode 100644
index 00000000000..06d60f3389f
--- /dev/null
+++ b/code/modules/awaymissions/zvis.dm
@@ -0,0 +1,369 @@
+/area/awaymission/upperlevel
+ name = "Open Space"
+ color = "#888"
+ lighting_use_dynamic = 0
+ requires_power = 0
+
+// Used by /turf/unsimulated/floor/upperlevel as a reference for where the other floor is
+/obj/effect/levelref
+ name = "level reference"
+ icon = 'icons/mob/screen_gen.dmi'
+ icon_state = "x2"
+ invisibility = 101
+
+ var/id = null
+ var/obj/effect/levelref/other = null
+ var/offset_x
+ var/offset_y
+ var/offset_z
+ var/global/list/levels[0]
+
+/obj/effect/levelref/New()
+ ..()
+ levels += src
+
+/obj/effect/levelref/initialize()
+ ..()
+ for(var/obj/effect/levelref/O in levels)
+ if(id == O.id && O != src)
+ other = O
+ update_offset()
+ O.other = src
+ O.update_offset()
+ for(var/turf/unsimulated/floor/upperlevel/U in get_area(loc))
+ U.init(src)
+ return
+
+/obj/effect/levelref/Destroy()
+ levels -= src
+ return ..()
+
+/obj/effect/levelref/proc/update_offset()
+ offset_x = other.x - x
+ offset_y = other.y - y
+ offset_z = other.z - z
+
+// Used by /turf/unsimulated/floor/upperlevel and /obj/effect/view_portal/visual
+// to know if the world changed on the remote side
+/obj/effect/portal_sensor
+ invisibility = 101
+ var/light_hash = -1
+ var/triggered_this_tick = 0
+ var/datum/owner // owner that receive signals
+ var/list/params[0] // what to send to the main object to indicate which sensor
+ var/trigger_limit = 5 // number of time we're allowed to trigger per ptick
+
+/obj/effect/portal_sensor/New(loc, o, ...)
+ ..()
+ owner = o
+ if(args.len >= 3)
+ params = args.Copy(3)
+ processing_objects += src
+ trigger()
+
+/obj/effect/portal_sensor/Destroy()
+ processing_objects -= src
+ return ..()
+
+/obj/effect/portal_sensor/Crossed(A)
+ trigger()
+
+/obj/effect/portal_sensor/Uncrossed(A)
+ trigger()
+
+/obj/effect/portal_sensor/process()
+ check_light()
+ if(triggered_this_tick >= trigger_limit)
+ call(owner, "trigger")(arglist(params))
+ triggered_this_tick = 0
+
+/obj/effect/portal_sensor/proc/trigger()
+ triggered_this_tick++
+ if(triggered_this_tick < trigger_limit)
+ call(owner, "trigger")(arglist(params))
+
+/obj/effect/portal_sensor/proc/check_light()
+ var/turf/T = loc
+ if(istype(T) && T.lighting_overlay && !T.lighting_overlay.needs_update)
+ var/atom/movable/lighting_overlay/O = T.lighting_overlay
+ var/hash = O.lum_r + O.lum_g + O.lum_b
+ if(hash != light_hash)
+ light_hash = hash
+ trigger()
+ else
+ if(light_hash != -1)
+ light_hash = -1
+ trigger()
+
+// for second floor showing floor below
+/turf/unsimulated/floor/upperlevel
+ icon = 'icons/turf/areas.dmi'
+ icon_state = "dark128"
+ layer = AREA_LAYER + 0.5
+ appearance_flags = TILE_BOUND | KEEP_TOGETHER
+ var/turf/lower_turf
+ var/obj/effect/portal_sensor/sensor
+
+/turf/unsimulated/floor/upperlevel/New()
+ ..()
+ var/obj/effect/levelref/R = locate() in get_area(src)
+ if(R && R.other)
+ init(R)
+
+/turf/unsimulated/floor/upperlevel/Destroy()
+ qdel(sensor)
+ sensor = null
+ return ..()
+
+/turf/unsimulated/floor/upperlevel/proc/init(var/obj/effect/levelref/R)
+ lower_turf = locate(x + R.offset_x, y + R.offset_y, z + R.offset_z)
+ if(lower_turf)
+ sensor = new(lower_turf, src)
+
+/turf/unsimulated/floor/upperlevel/Entered(atom/movable/AM, atom/OL, ignoreRest = 0)
+ if(isliving(AM) || istype(AM, /obj))
+ if(isliving(AM))
+ var/mob/living/M = AM
+ M.emote("scream")
+ M.SpinAnimation(5, 1)
+ AM.forceMove(lower_turf)
+
+/turf/unsimulated/floor/upperlevel/attack_ghost(mob/user)
+ user.forceMove(lower_turf)
+
+/turf/unsimulated/floor/upperlevel/proc/trigger()
+ name = lower_turf.name
+ desc = lower_turf.desc
+
+ // render each atom
+ underlays.Cut()
+ for(var/X in list(lower_turf) + lower_turf.contents)
+ var/atom/A = X
+ if(A && A.invisibility <= SEE_INVISIBLE_LIVING)
+ var/image/I = image(A, layer = AREA_LAYER + A.layer * 0.01, dir = A.dir)
+ I.pixel_x = A.pixel_x
+ I.pixel_y = A.pixel_y
+ underlays += I
+
+// remote end of narnia portal
+/obj/effect/view_portal
+ name = "portal target"
+ icon = 'icons/mob/screen_gen.dmi'
+ icon_state = "x2"
+ invisibility = 101
+ anchored = 1
+
+ var/id = null // id of other portal turf we connect to
+
+ var/obj/effect/view_portal/other = null
+ var/global/list/portals[0]
+
+/obj/effect/view_portal/New()
+ ..()
+ portals += src
+
+/obj/effect/view_portal/initialize()
+ ..()
+ if(id)
+ for(var/obj/effect/view_portal/O in portals)
+ if(id == O.id && O != src && can_link(O))
+ other = O
+ O.other = src
+ linkup()
+ O.linkup()
+ if(other)
+ return
+
+/obj/effect/view_portal/Destroy()
+ portals -= src
+ return ..()
+
+/obj/effect/view_portal/proc/can_link(obj/effect/view_portal/P)
+ return P.type == /obj/effect/view_portal/visual && !P.other
+
+/obj/effect/view_portal/proc/linkup()
+ // allow it to link to multiple visual nodes
+ other = null
+
+// near end of nania portal
+/obj/effect/view_portal/visual
+ name = "???"
+ desc = "You'll have to get closer to clearly see what this is."
+
+ icon = 'icons/turf/floors.dmi'
+ icon_state = "loadingarea"
+ opacity = 1
+ density = 1
+ invisibility = 0
+ appearance_flags = TILE_BOUND | KEEP_TOGETHER
+ var/dist = 6 // dist that we render out
+ var/radius = 3 // dist we render on other axis, in each direction
+ var/frustrum = 0 // if 1, get wider and wider at each step outward
+ var/teleport = 1 // should teleport?
+
+ var/list/render_block
+ var/list/sensors[0]
+ var/list/tiles[0]
+
+ var/list/near_render_block
+ var/turf/near_viewpoint
+
+/obj/effect/view_portal/visual/Destroy()
+ for(var/T in sensors)
+ qdel(sensors[T])
+ sensors.Cut()
+ sensors = null
+ for(var/T in tiles)
+ qdel(tiles[T])
+ tiles.Cut()
+ tiles = null
+ render_block = null
+ near_render_block = null
+ near_viewpoint = null
+ return ..()
+
+/obj/effect/view_portal/visual/can_link(obj/effect/view_portal/P)
+ return P.type == /obj/effect/view_portal
+
+/obj/effect/view_portal/visual/linkup()
+ icon = null
+ icon_state = null
+ var/turf/Tloc = get_turf(loc)
+ if(Tloc)
+ Tloc.icon = null
+ Tloc.icon_state = null
+ Tloc.dynamic_lighting = 0
+ layer = AREA_LAYER + 0.5
+
+ // setup references
+ var/crossdir = angle2dir((dir2angle(dir) + 90) % 360)
+ near_viewpoint = get_step(get_turf(src), GetOppositeDir(dir))
+
+ // setup far turfs
+ var/turf/T1 = get_turf(other)
+ var/turf/T2 = T1
+
+ for(var/i in 1 to radius)
+ T1 = get_step(T1, crossdir)
+ T2 = get_step(T2, GetOppositeDir(crossdir))
+ if(frustrum)
+ // make a trapazoid, with length dist, short end radius*2 long,
+ // and 45 degree angles
+ render_block = block(T1, T2)
+ for(var/i in 1 to dist)
+ T1 = get_step(get_step(T1, dir), crossdir)
+ T2 = get_step(get_step(T2, dir), GetOppositeDir(crossdir))
+ render_block += block(T1, T2)
+ else
+ // else make a box dist x radius*2
+ for(var/i in 1 to dist)
+ T2 = get_step(T2, dir)
+ render_block = block(T1, T2)
+ for(var/turf/T in render_block)
+ sensors[T] = new /obj/effect/portal_sensor(T, src, 0, T)
+
+// setup turfs on this side of the portal to cover the map streaming
+// has to be done later for view() to be correct (so it happens when the walls exist)
+/obj/effect/view_portal/visual/proc/setup_near()
+ var/nvs = dir & (EAST|WEST) ? near_viewpoint.x - x : near_viewpoint.y - y
+ if(nvs)
+ nvs = SIGN(nvs)
+ // need a mob for view() to work correctly
+ var/mob/M = new(near_viewpoint)
+ M.see_invisible = SEE_INVISIBLE_LIVING
+ near_render_block = view(M, world.view)
+ qdel(M)
+ for(var/A in near_render_block)
+ var/turf/T = A
+ if(istype(T))
+ var/ts = dir & (EAST|WEST) ? T.x - x : T.y - y
+ if(ts)
+ ts = SIGN(ts)
+ if(nvs == ts)
+ sensors[T] = new /obj/effect/portal_sensor(T, src, 1, T)
+ else
+ near_render_block -= T
+ else
+ near_render_block -= T
+
+/obj/effect/view_portal/visual/Bumped(atom/movable/thing)
+ if((istype(thing, /obj) || isliving(thing)) && other && teleport)
+ if(!near_render_block)
+ setup_near()
+
+ var/mob/living/M = thing
+ // make the person glide onto the dest, giving a smooth transition
+ var/ox = thing.x - x
+ var/oy = thing.y - y
+ if(istype(M) && M.client)
+ M.notransform = 1
+ // cover up client-side map loading
+ M.screen_loc = "CENTER"
+ M.client.screen += M
+ for(var/T in tiles)
+ M.client.screen += tiles[T]
+
+ // wait a tick for the screen to replicate across network
+ // or this whole exercise of covering the transition is pointless
+ spawn(1)
+ thing.forceMove(locate(other.x + ox, other.y + oy, other.z))
+ sleep(1)
+ if(istype(M) && M.client)
+ for(var/T in tiles)
+ M.client.screen -= tiles[T]
+ M.client.screen -= M
+ M.screen_loc = initial(M.screen_loc)
+ thing.forceMove(get_turf(other.loc))
+ if(istype(M) && M.client)
+ M.notransform = 0
+
+/obj/effect/view_portal/visual/attack_ghost(mob/user)
+ user.forceMove(get_turf(other.loc))
+
+/obj/effect/view_portal/visual/proc/trigger(near, turf/T)
+ var/obj/effect/view_portal_dummy/D = tiles[T]
+ if(D)
+ D.overlays.Cut()
+ else
+ D = new(src, near, T)
+ tiles[T] = D
+
+ // render atoms to overlays of a dummy object
+ if(D.name != T.name)
+ D.name = T.name
+ D.desc = T.desc
+ for(var/AX in list(T) + T.contents)
+ var/atom/A = AX
+ if(A && A.invisibility <= SEE_INVISIBLE_LIVING)
+ var/image/I = image(A, layer = D.layer + A.layer * 0.01, dir = A.dir)
+ I.pixel_x = A.pixel_x
+ I.pixel_y = A.pixel_y
+ D.overlays += I
+
+// tile of rendered other side for narnia portal
+/obj/effect/view_portal_dummy
+ var/obj/effect/view_portal/visual/owner
+
+/obj/effect/view_portal_dummy/New(obj/effect/view_portal/visual/V, near, turf/T)
+ ..()
+ if(!near)
+ loc = V.loc
+ owner = V
+
+ var/ox
+ var/oy
+ if(near)
+ ox = (T.x - V.near_viewpoint.x)
+ oy = (T.y - V.near_viewpoint.y)
+ layer = AREA_LAYER + 0.4
+ else
+ ox = T.x - V.other.x + V.x - V.near_viewpoint.x
+ oy = T.y - V.other.y + V.y - V.near_viewpoint.y
+ pixel_x = 32 * (T.x - V.other.x)
+ pixel_y = 32 * (T.y - V.other.y)
+ layer = AREA_LAYER + 0.5
+ if(abs(ox) <= world.view && abs(oy) <= world.view)
+ screen_loc = "CENTER[ox >= 0 ? "+" : ""][ox],CENTER[oy >= 0 ? "+" : ""][oy]"
+
+/obj/effect/view_portal_dummy/attack_ghost(mob/user)
+ owner.attack_ghost(user)
diff --git a/code/modules/client/asset_cache.dm b/code/modules/client/asset_cache.dm
index ac4a426fe08..f51f83cafb2 100644
--- a/code/modules/client/asset_cache.dm
+++ b/code/modules/client/asset_cache.dm
@@ -46,10 +46,10 @@ You can set verify to TRUE if you want send() to sleep until the client has the
client << browse_rsc(asset_cache[asset_name], asset_name)
if(!verify || !winexists(client, "asset_cache_browser")) // Can't access the asset cache browser, rip.
- if (client)
+ if(client)
client.cache += asset_name
return 1
- if (!client)
+ if(!client)
return 0
client.sending |= asset_name
@@ -91,17 +91,17 @@ You can set verify to TRUE if you want send() to sleep until the client has the
var/list/unreceived = asset_list - (client.cache + client.sending)
if(!unreceived || !unreceived.len)
return 0
- if (unreceived.len >= ASSET_CACHE_TELL_CLIENT_AMOUNT)
+ if(unreceived.len >= ASSET_CACHE_TELL_CLIENT_AMOUNT)
to_chat(client, "Sending Resources...")
for(var/asset in unreceived)
- if (asset in asset_cache)
+ if(asset in asset_cache)
client << browse_rsc(asset_cache[asset], asset)
if(!verify || !winexists(client, "asset_cache_browser")) // Can't access the asset cache browser, rip.
- if (client)
+ if(client)
client.cache += unreceived
return 1
- if (!client)
+ if(!client)
return 0
client.sending |= unreceived
var/job = ++client.last_asset_job
@@ -129,9 +129,9 @@ You can set verify to TRUE if you want send() to sleep until the client has the
//The proc calls procs that sleep for long times.
proc/getFilesSlow(var/client/client, var/list/files, var/register_asset = TRUE)
for(var/file in files)
- if (!client)
+ if(!client)
break
- if (register_asset)
+ if(register_asset)
register_asset(file,files[file])
send_asset(client,file)
sleep(-1) //queuing calls like this too quickly can cause issues in some client versions
@@ -159,7 +159,7 @@ proc/getFilesSlow(var/client/client, var/list/files, var/register_asset = TRUE)
//get a assetdatum or make a new one
/proc/get_asset_datum(var/type)
- if (!(type in asset_datums))
+ if(!(type in asset_datums))
return new type()
return asset_datums[type]
@@ -240,14 +240,14 @@ proc/getFilesSlow(var/client/client, var/list/files, var/register_asset = TRUE)
/datum/asset/nanoui/register()
// Crawl the directories to find files.
- for (var/path in common_dirs)
+ for(var/path in common_dirs)
var/list/filenames = flist(path)
for(var/filename in filenames)
if(copytext(filename, length(filename)) != "/") // Ignore directories.
if(fexists(path + filename))
common[filename] = fcopy_rsc(path + filename)
register_asset(filename, common[filename])
- for (var/path in uncommon_dirs)
+ for(var/path in uncommon_dirs)
var/list/filenames = flist(path)
for(var/filename in filenames)
if(copytext(filename, length(filename)) != "/") // Ignore directories.
@@ -260,3 +260,18 @@ proc/getFilesSlow(var/client/client, var/list/files, var/register_asset = TRUE)
send_asset_list(client, uncommon)
send_asset_list(client, common)
+
+/datum/asset/chem_master
+ var/assets = list()
+ var/verify = FALSE
+
+/datum/asset/chem_master/register()
+ for(var/i = 1 to 20)
+ assets["pill[i].png"] = icon('icons/obj/chemical.dmi', "pill[i]")
+ for(var/i = 1 to 20)
+ assets["bottle[i].png"] = icon('icons/obj/chemical.dmi', "bottle[i]")
+ for(var/asset_name in assets)
+ register_asset(asset_name, assets[asset_name])
+
+/datum/asset/chem_master/send(client)
+ send_asset_list(client,assets,verify)
\ No newline at end of file
diff --git a/code/modules/client/client defines.dm b/code/modules/client/client defines.dm
index 30e4793c747..c1cbd07daee 100644
--- a/code/modules/client/client defines.dm
+++ b/code/modules/client/client defines.dm
@@ -84,4 +84,8 @@
var/datum/click_intercept/click_intercept = null
//datum that controls the displaying and hiding of tooltips
- var/datum/tooltip/tooltips
\ No newline at end of file
+ var/datum/tooltip/tooltips
+
+ // Their chat window, sort of important.
+ // See /goon/code/datums/browserOutput.dm
+ var/datum/chatOutput/chatOutput
\ No newline at end of file
diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm
index 292120b65c5..7a87264d815 100644
--- a/code/modules/client/client procs.dm
+++ b/code/modules/client/client procs.dm
@@ -8,6 +8,8 @@
#define UPLOAD_LIMIT 10485760 //Restricts client uploads to the server to 10MB //Boosted this thing. What's the worst that can happen?
#define MIN_CLIENT_VERSION 0 //Just an ambiguously low version for now, I don't want to suddenly stop people playing.
//I would just like the code ready should it ever need to be used.
+#define SUGGESTED_CLIENT_VERSION 510 // only integers (e.g: 510, 511) useful here. Does not properly handle minor versions (e.g: 510.58, 511.848)
+
/*
When somebody clicks a link in game, this Topic is called first.
It does the stuff in this proc and then is redirected to the Topic() proc for the src=[0xWhatever]
@@ -43,6 +45,9 @@
completed_asset_jobs += job
return
+ if(href_list["_src_"] == "chat")
+ return chatOutput.Topic(href, href_list)
+
//Reduces spamming of links by dropping calls that happen during the delay period
if(next_allowed_topic_time > world.time)
return
@@ -52,7 +57,6 @@
if( findtext(href,""
- HTML += "
" // Table within a table for alignment, also allows you to easily add more colomns.
- HTML += "
"
- var/index = -1
-
- //The job before the current job. I only use this to get the previous jobs color when I'm filling in blank rows.
- var/datum/job/lastJob
- if (!job_master) return
- for(var/datum/job/job in job_master.occupations)
-
- index += 1
- if((index >= limit) || (job.title in splitJobs))
- if((index < limit) && (lastJob != null))
- //If the cells were broken up by a job in the splitJob list then it will fill in the rest of the cells with
- //the last job's selection color. Creating a rather nice effect.
- for(var/i = 0, i < (limit - index), i += 1)
- HTML += "
"
-
-/datum/preferences/proc/SetDisabilities(mob/user)
- var/HTML = ""
-
- // AUTOFIXED BY fix_string_idiocy.py
- // C:\Users\Rob\Documents\Projects\vgstation13\code\modules\client\preferences.dm:474: HTML += "
"
- HTML += {"
- Choose disabilities
"}
- // END AUTOFIX
- HTML += ShowDisabilityState(user,DISABILITY_FLAG_NEARSIGHTED,"Needs Glasses")
- HTML += ShowDisabilityState(user,DISABILITY_FLAG_FAT,"Obese")
- HTML += ShowDisabilityState(user,DISABILITY_FLAG_EPILEPTIC,"Seizures")
- HTML += ShowDisabilityState(user,DISABILITY_FLAG_DEAF,"Deaf")
- HTML += ShowDisabilityState(user,DISABILITY_FLAG_BLIND,"Blind")
- HTML += ShowDisabilityState(user,DISABILITY_FLAG_MUTE,"Mute")
-
-
- // AUTOFIXED BY fix_string_idiocy.py
- // C:\Users\Rob\Documents\Projects\vgstation13\code\modules\client\preferences.dm:481: HTML += "
"}
- // END AUTOFIX
- user << browse(null, "window=preferences")
- user << browse(HTML, "window=disabil;size=350x300")
- return
-
-/datum/preferences/proc/SetRecords(mob/user)
- var/HTML = ""
- HTML += "
"
- HTML += "Set Character Records "
-
- HTML += "Medical Records "
-
- if(lentext(med_record) <= 40)
- HTML += "[med_record]"
- else
- HTML += "[copytext(med_record, 1, 37)]..."
-
- HTML += "
Employment Records "
-
- if(lentext(gen_record) <= 40)
- HTML += "[gen_record]"
- else
- HTML += "[copytext(gen_record, 1, 37)]..."
-
- HTML += "
Security Records "
-
- if(lentext(sec_record) <= 40)
- HTML += "[sec_record] "
- else
- HTML += "[copytext(sec_record, 1, 37)]... "
-
- HTML += " "
- HTML += "\[Done\]"
- HTML += "
"
-
- user << browse(null, "window=preferences")
- user << browse(HTML, "window=records;size=350x300")
- return
-
-/datum/preferences/proc/GetPlayerAltTitle(datum/job/job)
- return player_alt_titles.Find(job.title) > 0 \
- ? player_alt_titles[job.title] \
- : job.title
-
-/datum/preferences/proc/SetPlayerAltTitle(datum/job/job, new_title)
- // remove existing entry
- if(player_alt_titles.Find(job.title))
- player_alt_titles -= job.title
- // add one if it's not default
- if(job.title != new_title)
- player_alt_titles[job.title] = new_title
-
-/datum/preferences/proc/SetJob(mob/user, role)
- var/datum/job/job = job_master.GetJob(role)
- if(!job)
- user << browse(null, "window=mob_occupation")
- ShowChoices(user)
- return
-
- if(role == "Civilian")
- if(job_support_low & job.flag)
- job_support_low &= ~job.flag
- else
- job_support_low |= job.flag
- SetChoices(user)
- return 1
-
- if(GetJobDepartment(job, 1) & job.flag)
- SetJobDepartment(job, 1)
- else if(GetJobDepartment(job, 2) & job.flag)
- SetJobDepartment(job, 2)
- else if(GetJobDepartment(job, 3) & job.flag)
- SetJobDepartment(job, 3)
- else//job = Never
- SetJobDepartment(job, 4)
-
- SetChoices(user)
- return 1
-
-/datum/preferences/proc/ResetJobs()
- job_support_high = 0
- job_support_med = 0
- job_support_low = 0
-
- job_medsci_high = 0
- job_medsci_med = 0
- job_medsci_low = 0
-
- job_engsec_high = 0
- job_engsec_med = 0
- job_engsec_low = 0
-
- job_karma_high = 0
- job_karma_med = 0
- job_karma_low = 0
-
-
-/datum/preferences/proc/GetJobDepartment(var/datum/job/job, var/level)
- if(!job || !level) return 0
- switch(job.department_flag)
- if(SUPPORT)
- switch(level)
- if(1)
- return job_support_high
- if(2)
- return job_support_med
- if(3)
- return job_support_low
- if(MEDSCI)
- switch(level)
- if(1)
- return job_medsci_high
- if(2)
- return job_medsci_med
- if(3)
- return job_medsci_low
- if(ENGSEC)
- switch(level)
- if(1)
- return job_engsec_high
- if(2)
- return job_engsec_med
- if(3)
- return job_engsec_low
- if(KARMA)
- switch(level)
- if(1)
- return job_karma_high
- if(2)
- return job_karma_med
- if(3)
- return job_karma_low
- return 0
-
-/datum/preferences/proc/SetJobDepartment(var/datum/job/job, var/level)
- if(!job || !level) return 0
- switch(level)
- if(1)//Only one of these should ever be active at once so clear them all here
- job_support_high = 0
- job_medsci_high = 0
- job_engsec_high = 0
- job_karma_high = 0
- return 1
- if(2)//Set current highs to med, then reset them
- job_support_med |= job_support_high
- job_medsci_med |= job_medsci_high
- job_engsec_med |= job_engsec_high
- job_karma_med |= job_karma_high
- job_support_high = 0
- job_medsci_high = 0
- job_engsec_high = 0
- job_karma_high = 0
-
- switch(job.department_flag)
- if(SUPPORT)
- switch(level)
- if(2)
- job_support_high = job.flag
- job_support_med &= ~job.flag
- if(3)
- job_support_med |= job.flag
- job_support_low &= ~job.flag
- else
- job_support_low |= job.flag
- if(MEDSCI)
- switch(level)
- if(2)
- job_medsci_high = job.flag
- job_medsci_med &= ~job.flag
- if(3)
- job_medsci_med |= job.flag
- job_medsci_low &= ~job.flag
- else
- job_medsci_low |= job.flag
- if(ENGSEC)
- switch(level)
- if(2)
- job_engsec_high = job.flag
- job_engsec_med &= ~job.flag
- if(3)
- job_engsec_med |= job.flag
- job_engsec_low &= ~job.flag
- else
- job_engsec_low |= job.flag
- if(KARMA)
- switch(level)
- if(2)
- job_karma_high = job.flag
- job_karma_med &= ~job.flag
- if(3)
- job_karma_med |= job.flag
- job_karma_low &= ~job.flag
- else
- job_karma_low |= job.flag
- return 1
-
-/datum/preferences/proc/process_link(mob/user, list/href_list)
- if(!user) return
-
- if(href_list["preference"] == "job")
- switch(href_list["task"])
- if("close")
- user << browse(null, "window=mob_occupation")
- ShowChoices(user)
- if("reset")
- ResetJobs()
- SetChoices(user)
- if("random")
- if(alternate_option == GET_RANDOM_JOB || alternate_option == BE_CIVILIAN)
- alternate_option += 1
- else if(alternate_option == RETURN_TO_LOBBY)
- alternate_option = 0
- else
- return 0
- SetChoices(user)
- if ("alt_title")
- var/datum/job/job = locate(href_list["job"])
- if (job)
- var/choices = list(job.title) + job.alt_titles
- var/choice = input("Pick a title for [job.title].", "Character Generation", GetPlayerAltTitle(job)) as anything in choices | null
- if(choice)
- SetPlayerAltTitle(job, choice)
- SetChoices(user)
- if("input")
- SetJob(user, href_list["text"])
- if("setJobLevel")
- UpdateJobPreference(user, href_list["text"], text2num(href_list["level"]))
- else
- SetChoices(user)
- return 1
- else if(href_list["preference"] == "disabilities")
-
- switch(href_list["task"])
- if("close")
- user << browse(null, "window=disabil")
- ShowChoices(user)
- if("reset")
- disabilities=0
- SetDisabilities(user)
- if("input")
- var/dflag=text2num(href_list["disability"])
- if(dflag >= 0)
- if(!(dflag==DISABILITY_FLAG_FAT && species!=("Human" || "Tajaran" || "Grey")))
- disabilities ^= text2num(href_list["disability"]) //MAGIC
- SetDisabilities(user)
- else
- SetDisabilities(user)
- return 1
-
- else if(href_list["preference"] == "records")
- if(text2num(href_list["record"]) >= 1)
- SetRecords(user)
- return
- else
- user << browse(null, "window=records")
- if(href_list["task"] == "med_record")
- var/medmsg = input(usr,"Set your medical notes here.","Medical Records",html_decode(med_record)) as message
-
- if(medmsg != null)
- medmsg = copytext(medmsg, 1, MAX_PAPER_MESSAGE_LEN)
- medmsg = html_encode(medmsg)
-
- med_record = medmsg
- SetRecords(user)
-
- if(href_list["task"] == "sec_record")
- var/secmsg = input(usr,"Set your security notes here.","Security Records",html_decode(sec_record)) as message
-
- if(secmsg != null)
- secmsg = copytext(secmsg, 1, MAX_PAPER_MESSAGE_LEN)
- secmsg = html_encode(secmsg)
-
- sec_record = secmsg
- SetRecords(user)
- if(href_list["task"] == "gen_record")
- var/genmsg = input(usr,"Set your employment notes here.","Employment Records",html_decode(gen_record)) as message
-
- if(genmsg != null)
- genmsg = copytext(genmsg, 1, MAX_PAPER_MESSAGE_LEN)
- genmsg = html_encode(genmsg)
-
- gen_record = genmsg
- SetRecords(user)
-
- switch(href_list["task"])
- if("random")
- switch(href_list["preference"])
- if("name")
- real_name = random_name(gender,species)
- if("age")
- age = rand(AGE_MIN, AGE_MAX)
- if("hair")
- if(species == "Human" || species == "Unathi" || species == "Tajaran" || species == "Skrell" || species == "Machine" || species == "Wryn" || species == "Vulpkanin")
- r_hair = rand(0,255)
- g_hair = rand(0,255)
- b_hair = rand(0,255)
- if("h_style")
- h_style = random_hair_style(gender, species)
- if("facial")
- r_facial = rand(0,255)
- g_facial = rand(0,255)
- b_facial = rand(0,255)
- if("f_style")
- f_style = random_facial_hair_style(gender, species)
- if("underwear")
- underwear = random_underwear(gender)
- ShowChoices(user)
- if("undershirt")
- undershirt = random_undershirt(gender)
- ShowChoices(user)
- if("socks")
- socks = random_socks(gender)
- ShowChoices(user)
- if("eyes")
- r_eyes = rand(0,255)
- g_eyes = rand(0,255)
- b_eyes = rand(0,255)
- if("s_tone")
- if(species in list("Human", "Drask"))
- s_tone = random_skin_tone()
- if("s_color")
- if(species in list("Unathi", "Tajaran", "Skrell", "Slime People", "Wyrn", "Vulpkanin", "Machine"))
- r_skin = rand(0,255)
- g_skin = rand(0,255)
- b_skin = rand(0,255)
- if("bag")
- backbag = rand(1,4)
- /*if("skin_style")
- h_style = random_skin_style(gender)*/
- if("all")
- random_character()
- if("input")
- switch(href_list["preference"])
- if("name")
- var/raw_name = input(user, "Choose your character's name:", "Character Preference") as text|null
- if (!isnull(raw_name)) // Check to ensure that the user entered text (rather than cancel.)
- var/new_name = reject_bad_name(raw_name)
- if(new_name)
- real_name = new_name
- else
- to_chat(user, "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .")
-
- if("age")
- var/new_age = input(user, "Choose your character's age:\n([AGE_MIN]-[AGE_MAX])", "Character Preference") as num|null
- if(new_age)
- age = max(min( round(text2num(new_age)), AGE_MAX),AGE_MIN)
- if("species")
-
- var/list/new_species = list("Human", "Tajaran", "Skrell", "Unathi", "Diona", "Vulpkanin")
- var/prev_species = species
-// var/whitelisted = 0
-
- if(config.usealienwhitelist) //If we're using the whitelist, make sure to check it!
- for(var/S in whitelisted_species)
- if(is_alien_whitelisted(user,S))
- new_species += S
-// whitelisted = 1
-// if(!whitelisted)
-// alert(user, "You cannot change your species as you need to be whitelisted. If you wish to be whitelisted contact an admin in-game, on the forums, or on IRC.")
- else //Not using the whitelist? Aliens for everyone!
- new_species += whitelisted_species
-
- species = input("Please select a species", "Character Generation", null) in new_species
-
- if(prev_species != species)
- //grab one of the valid hair styles for the newly chosen species
- var/list/valid_hairstyles = list()
- for(var/hairstyle in hair_styles_list)
- var/datum/sprite_accessory/S = hair_styles_list[hairstyle]
- if(gender == MALE && S.gender == FEMALE)
- continue
- if(gender == FEMALE && S.gender == MALE)
- continue
- if(!(species in S.species_allowed))
- continue
-
- valid_hairstyles[hairstyle] = hair_styles_list[hairstyle]
-
- if(valid_hairstyles.len)
- h_style = pick(valid_hairstyles)
- else
- //this shouldn't happen
- h_style = hair_styles_list["Bald"]
-
- //grab one of the valid facial hair styles for the newly chosen species
- var/list/valid_facialhairstyles = list()
- for(var/facialhairstyle in facial_hair_styles_list)
- var/datum/sprite_accessory/S = facial_hair_styles_list[facialhairstyle]
- if(gender == MALE && S.gender == FEMALE)
- continue
- if(gender == FEMALE && S.gender == MALE)
- continue
- if(!(species in S.species_allowed))
- continue
-
- valid_facialhairstyles[facialhairstyle] = facial_hair_styles_list[facialhairstyle]
-
- if(valid_facialhairstyles.len)
- f_style = pick(valid_facialhairstyles)
- else
- //this shouldn't happen
- f_style = facial_hair_styles_list["Shaved"]
-
- // Don't wear another species' underwear!
- var/datum/sprite_accessory/S = underwear_list[underwear]
- if(!(species in S.species_allowed))
- underwear = random_underwear(gender, species)
-
- S = undershirt_list[undershirt]
- if(!(species in S.species_allowed))
- undershirt = random_undershirt(gender, species)
-
- S = socks_list[socks]
- if(!(species in S.species_allowed))
- socks = random_socks(gender, species)
-
- //reset hair colour and skin colour
- r_hair = 0//hex2num(copytext(new_hair, 2, 4))
- g_hair = 0//hex2num(copytext(new_hair, 4, 6))
- b_hair = 0//hex2num(copytext(new_hair, 6, 8))
-
- s_tone = 0
-
- ha_style = "None" // No Vulp ears on Unathi
- m_style = "None" // No Unathi markings on Tajara
-
- body_accessory = null //no vulptail on humans damnit
-
- //Reset prosthetics.
- organ_data = list()
- rlimb_data = list()
- if("speciesprefs")//oldvox code
- speciesprefs = !speciesprefs
-
- if("language")
-// var/languages_available
- var/list/new_languages = list("None")
-/*
- if(config.usealienwhitelist)
- for(var/L in all_languages)
- var/datum/language/lang = all_languages[L]
- if((!(lang.flags & RESTRICTED)) && (is_alien_whitelisted(user, L)||(!( lang.flags & WHITELISTED ))))
- new_languages += lang
- languages_available = 1
-
- if(!(languages_available))
- alert(user, "There are not currently any available secondary languages.")
- else
-*/
- for(var/L in all_languages)
- var/datum/language/lang = all_languages[L]
- if(!(lang.flags & RESTRICTED))
- new_languages += lang.name
-
- language = input("Please select a secondary language", "Character Generation", null) in new_languages
-
- if("metadata")
- var/new_metadata = input(user, "Enter any information you'd like others to see, such as Roleplay-preferences:", "Game Preference" , metadata) as message|null
- if(new_metadata)
- metadata = sanitize(copytext(new_metadata,1,MAX_MESSAGE_LEN))
-
- if("b_type")
- var/new_b_type = input(user, "Choose your character's blood-type:", "Character Preference") as null|anything in list( "A+", "A-", "B+", "B-", "AB+", "AB-", "O+", "O-" )
- if(new_b_type)
- b_type = new_b_type
-
- if("hair")
- if(species == "Human" || species == "Unathi" || species == "Tajaran" || species == "Skrell" || species == "Machine" || species == "Vulpkanin")
- var/input = "Choose your character's hair colour:"
- var/new_hair = input(user, input, "Character Preference", rgb(r_hair, g_hair, b_hair)) as color|null
- if(new_hair)
- r_hair = hex2num(copytext(new_hair, 2, 4))
- g_hair = hex2num(copytext(new_hair, 4, 6))
- b_hair = hex2num(copytext(new_hair, 6, 8))
-
- if("h_style")
- var/list/valid_hairstyles = list()
- for(var/hairstyle in hair_styles_list)
- var/datum/sprite_accessory/S = hair_styles_list[hairstyle]
- if(species == "Machine") //Species that can use prosthetic heads.
- var/obj/item/organ/external/head/H = new()
- if(S.name == "Bald")
- valid_hairstyles[hairstyle] = S
- if(!rlimb_data["head"]) //Handle situations where the head is default.
- H.model = "Morpheus Cyberkinetics"
- else
- H.model = rlimb_data["head"]
- var/datum/robolimb/robohead = all_robolimbs[H.model]
- if(species in S.species_allowed)
- if(robohead.is_monitor && (robohead.company in S.models_allowed)) //If the Machine character has the default Morpheus screen head or another screen head
- //and said head is in the hair style's allowed models list...
- valid_hairstyles[hairstyle] = S //Allow them to select the hairstyle.
- continue
- else
- if(robohead.is_monitor) //Monitors (incl. the default morpheus head) cannot have wigs (human hairstyles).
- continue
- else if(!robohead.is_monitor && ("Human" in S.species_allowed))
- valid_hairstyles[hairstyle] = S
- continue
- else
- if(!(species in S.species_allowed))
- continue
-
- valid_hairstyles[hairstyle] = S
-
- var/new_h_style = input(user, "Choose your character's hair style:", "Character Preference") as null|anything in valid_hairstyles
- if(new_h_style)
- h_style = new_h_style
-
- if("headaccessory")
- if(species in list("Unathi", "Vulpkanin", "Tajaran", "Machine")) //Species with head accessories.
- var/input = "Choose the colour of your your character's head accessory:"
- var/new_head_accessory = input(user, input, "Character Preference", rgb(r_headacc, g_headacc, b_headacc)) as color|null
- if(new_head_accessory)
- r_headacc = hex2num(copytext(new_head_accessory, 2, 4))
- g_headacc = hex2num(copytext(new_head_accessory, 4, 6))
- b_headacc = hex2num(copytext(new_head_accessory, 6, 8))
-
- if("ha_style")
- if(species in list("Unathi", "Vulpkanin", "Tajaran", "Machine")) //Species with head accessories.
- var/list/valid_head_accessory_styles = list()
- for(var/head_accessory_style in head_accessory_styles_list)
- var/datum/sprite_accessory/H = head_accessory_styles_list[head_accessory_style]
- if(!(species in H.species_allowed))
- continue
-
- valid_head_accessory_styles[head_accessory_style] = head_accessory_styles_list[head_accessory_style]
-
- var/new_head_accessory_style = input(user, "Choose the style of your character's head accessory:", "Character Preference") as null|anything in valid_head_accessory_styles
- if(new_head_accessory_style)
- ha_style = new_head_accessory_style
-
- if("markings")
- if(species in list("Unathi", "Vulpkanin", "Tajaran", "Machine")) //Species with markings.
- var/input = "Choose the colour of your your character's markings:"
- var/new_markings = input(user, input, "Character Preference", rgb(r_markings, g_markings, b_markings)) as color|null
- if(new_markings)
- r_markings = hex2num(copytext(new_markings, 2, 4))
- g_markings = hex2num(copytext(new_markings, 4, 6))
- b_markings = hex2num(copytext(new_markings, 6, 8))
-
- if("m_style")
- if(species in list("Unathi", "Vulpkanin", "Tajaran", "Machine")) //Species with markings.
- var/list/valid_markings = list()
- for(var/markingstyle in marking_styles_list)
- var/datum/sprite_accessory/M = marking_styles_list[markingstyle]
- if(!(species in M.species_allowed))
- continue
-
- if(species == "Machine") //Species that can use prosthetic heads.
- var/obj/item/organ/external/head/H = new()
- if(!rlimb_data["head"]) //Handle situations where the head is default.
- H.model = "Morpheus Cyberkinetics"
- else
- H.model = rlimb_data["head"]
- var/datum/robolimb/robohead = all_robolimbs[H.model]
- if(robohead.is_monitor && M.name != "None") //If the character can have prosthetic heads and they have the default Morpheus head (or another monitor-head), no optic markings.
- continue
- else if(!robohead.is_monitor && M.name != "None") //Otherwise, if they DON'T have the default head and the head's not a monitor but the head's not in the style's list of allowed models, skip.
- if(!(robohead.company in M.models_allowed))
- continue
-
- valid_markings[markingstyle] = marking_styles_list[markingstyle]
-
- var/new_marking_style = input(user, "Choose the style of your character's markings:", "Character Preference", m_style) as null|anything in valid_markings
- if(new_marking_style)
- m_style = new_marking_style
-
- if("body_accessory")
- var/list/possible_body_accessories = list()
- if(check_rights(R_ADMIN, 1, user))
- possible_body_accessories = body_accessory_by_name.Copy()
- else
- for(var/B in body_accessory_by_name)
- var/datum/body_accessory/accessory = body_accessory_by_name[B]
- if(!istype(accessory))
- possible_body_accessories += "None" //the only null entry should be the "None" option
- continue
- if(species in accessory.allowed_species)
- possible_body_accessories += B
-
- var/new_body_accessory = input(user, "Choose your body accessory:", "Character Preference") as null|anything in possible_body_accessories
- if(new_body_accessory)
- body_accessory = (new_body_accessory == "None") ? null : new_body_accessory
-
- if("facial")
- var/new_facial = input(user, "Choose your character's facial-hair colour:", "Character Preference", rgb(r_facial, g_facial, b_facial)) as color|null
- if(new_facial)
- r_facial = hex2num(copytext(new_facial, 2, 4))
- g_facial = hex2num(copytext(new_facial, 4, 6))
- b_facial = hex2num(copytext(new_facial, 6, 8))
-
- if("f_style")
- var/list/valid_facialhairstyles = list()
- for(var/facialhairstyle in facial_hair_styles_list)
- var/datum/sprite_accessory/S = facial_hair_styles_list[facialhairstyle]
- if(S.name == "Shaved")
- valid_facialhairstyles[facialhairstyle] = S
- if(gender == MALE && S.gender == FEMALE)
- continue
- if(gender == FEMALE && S.gender == MALE)
- continue
- if(species == "Machine") //Species that can use prosthetic heads.
- var/obj/item/organ/external/head/H = new()
- if(!rlimb_data["head"]) //Handle situations where the head is default.
- H.model = "Morpheus Cyberkinetics"
- else
- H.model = rlimb_data["head"]
- var/datum/robolimb/robohead = all_robolimbs[H.model]
- if(species in S.species_allowed)
- if(robohead.is_monitor) //If the Machine character has the default Morpheus screen head or another screen head and they're allowed to have the style, let them have it.
- valid_facialhairstyles[facialhairstyle] = S
- continue
- else
- if(robohead.is_monitor) //Monitors (incl. the default morpheus head) cannot have wigs (human facial hairstyles).
- continue
- else if(!robohead.is_monitor && ("Human" in S.species_allowed))
- valid_facialhairstyles[facialhairstyle] = S
- continue
- else
- if(!(species in S.species_allowed))
- continue
-
- valid_facialhairstyles[facialhairstyle] = facial_hair_styles_list[facialhairstyle]
-
- var/new_f_style = input(user, "Choose your character's facial-hair style:", "Character Preference") as null|anything in valid_facialhairstyles
- if(new_f_style)
- f_style = new_f_style
-
- if("underwear")
- var/list/underwear_options
- if(gender == MALE)
- underwear_options = underwear_m
- else
- underwear_options = underwear_f
-
- var/new_underwear = input(user, "Choose your character's underwear:", "Character Preference") as null|anything in underwear_options
- if(new_underwear)
- underwear = new_underwear
- ShowChoices(user)
-
- if("undershirt")
- var/new_undershirt
- if(gender == MALE)
- new_undershirt = input(user, "Choose your character's undershirt:", "Character Preference") as null|anything in undershirt_m
- else
- new_undershirt = input(user, "Choose your character's undershirt:", "Character Preference") as null|anything in undershirt_f
- if(new_undershirt)
- undershirt = new_undershirt
- ShowChoices(user)
-
- if("socks")
- var/list/valid_sockstyles = list()
- for(var/sockstyle in socks_list)
- var/datum/sprite_accessory/S = socks_list[sockstyle]
- if(gender == MALE && S.gender == FEMALE)
- continue
- if(gender == FEMALE && S.gender == MALE)
- continue
- if(!(species in S.species_allowed))
- continue
- valid_sockstyles[sockstyle] = socks_list[sockstyle]
- var/new_socks = input(user, "Choose your character's socks:", "Character Preference") as null|anything in valid_sockstyles
- ShowChoices(user)
- if(new_socks)
- socks = new_socks
-
- if("eyes")
- var/new_eyes = input(user, "Choose your character's eye colour:", "Character Preference", rgb(r_eyes, g_eyes, b_eyes)) as color|null
- if(new_eyes)
- r_eyes = hex2num(copytext(new_eyes, 2, 4))
- g_eyes = hex2num(copytext(new_eyes, 4, 6))
- b_eyes = hex2num(copytext(new_eyes, 6, 8))
-
- if("s_tone")
- if(species != "Human" && species != "Drask")
- return
- var/new_s_tone = input(user, "Choose your character's skin-tone:\n(Light 1 - 220 Dark)", "Character Preference") as num|null
- if(new_s_tone)
- s_tone = 35 - max(min( round(new_s_tone), 220),1)
-
- if("skin")
- if((species in list("Unathi", "Tajaran", "Skrell", "Slime People", "Vulpkanin", "Machine")) || body_accessory_by_species[species] || check_rights(R_ADMIN, 0, user))
- var/new_skin = input(user, "Choose your character's skin colour: ", "Character Preference", rgb(r_skin, g_skin, b_skin)) as color|null
- if(new_skin)
- r_skin = hex2num(copytext(new_skin, 2, 4))
- g_skin = hex2num(copytext(new_skin, 4, 6))
- b_skin = hex2num(copytext(new_skin, 6, 8))
-
-
- if("ooccolor")
- var/new_ooccolor = input(user, "Choose your OOC colour:", "Game Preference", ooccolor) as color|null
- if(new_ooccolor)
- ooccolor = new_ooccolor
-
- if("bag")
- var/new_backbag = input(user, "Choose your character's style of bag:", "Character Preference") as null|anything in backbaglist
- if(new_backbag)
- backbag = backbaglist.Find(new_backbag)
-
- if("nt_relation")
- var/new_relation = input(user, "Choose your relation to NT. Note that this represents what others can find out about your character by researching your background, not what your character actually thinks.", "Character Preference") as null|anything in list("Loyal", "Supportive", "Neutral", "Skeptical", "Opposed")
- if(new_relation)
- nanotrasen_relation = new_relation
-
- if("flavor_text")
- var/msg = input(usr,"Set the flavor text in your 'examine' verb. This can also be used for OOC notes and preferences!","Flavor Text",html_decode(flavor_text)) as message
-
- if(msg != null)
- msg = copytext(msg, 1, MAX_MESSAGE_LEN)
- msg = html_encode(msg)
-
- flavor_text = msg
-
- if("limbs")
- var/valid_limbs = list("Left Leg", "Right Leg", "Left Arm", "Right Arm", "Left Foot", "Right Foot", "Left Hand", "Right Hand")
- if(species == "Machine")
- valid_limbs = list("Torso", "Lower Body", "Head", "Left Leg", "Right Leg", "Left Arm", "Right Arm", "Left Foot", "Right Foot", "Left Hand", "Right Hand")
- var/limb_name = input(user, "Which limb do you want to change?") as null|anything in valid_limbs
- if(!limb_name) return
-
- var/limb = null
- var/second_limb = null // if you try to change the arm, the hand should also change
- var/third_limb = null // if you try to unchange the hand, the arm should also change
- var/valid_limb_states = list("Normal", "Amputated", "Prosthesis")
- var/no_amputate = 0
-
- switch(limb_name)
- if("Torso")
- limb = "chest"
- second_limb = "groin"
- no_amputate = 1
- if("Lower Body")
- limb = "groin"
- no_amputate = 1
- if("Head")
- limb = "head"
- no_amputate = 1
- if("Left Leg")
- limb = "l_leg"
- second_limb = "l_foot"
- if("Right Leg")
- limb = "r_leg"
- second_limb = "r_foot"
- if("Left Arm")
- limb = "l_arm"
- second_limb = "l_hand"
- if("Right Arm")
- limb = "r_arm"
- second_limb = "r_hand"
- if("Left Foot")
- limb = "l_foot"
- if(species != "Machine")
- third_limb = "l_leg"
- if("Right Foot")
- limb = "r_foot"
- if(species != "Machine")
- third_limb = "r_leg"
- if("Left Hand")
- limb = "l_hand"
- if(species != "Machine")
- third_limb = "l_arm"
- if("Right Hand")
- limb = "r_hand"
- if(species != "Machine")
- third_limb = "r_arm"
-
- var/new_state = input(user, "What state do you wish the limb to be in?") as null|anything in valid_limb_states
- if(!new_state) return
-
- switch(new_state)
- if("Normal")
- if(limb == "head")
- m_style = "None"
- h_style = random_hair_style(gender, species)
- f_style = facial_hair_styles_list["Shaved"]
- organ_data[limb] = null
- rlimb_data[limb] = null
- if(third_limb)
- organ_data[third_limb] = null
- rlimb_data[third_limb] = null
- if("Amputated")
- if(!no_amputate)
- organ_data[limb] = "amputated"
- rlimb_data[limb] = null
- if(second_limb)
- organ_data[second_limb] = "amputated"
- rlimb_data[second_limb] = null
- if("Prosthesis")
- var/choice
- var/subchoice
- var/datum/robolimb/R = new()
- var/in_model
- var/robolimb_companies = list()
- for(var/limb_type in typesof(/datum/robolimb)) //This loop populates a list of companies that offer the limb the user selected previously as one of their cybernetic products.
- R = new limb_type()
- if(!R.unavailable_at_chargen && (limb in R.parts) && R.has_subtypes) //Ensures users can only choose companies that offer the parts they want, that singular models get added to the list as well companies that offer more than one model, and...
- robolimb_companies[R.company] = R //List only main brands that have the parts we're looking for.
- R = new() //Re-initialize R.
-
- choice = input(user, "Which manufacturer do you wish to use for this limb?") as null|anything in robolimb_companies //Choose from a list of companies that offer the part the user wants.
- if(!choice)
- return
- R.company = choice
- R = all_robolimbs[R.company]
- if(R.has_subtypes == 1) //If the company the user selected provides more than just one base model, lets handle it.
- var/list/robolimb_models = list()
- for(var/limb_type in typesof(R)) //Handling the different models of parts that manufacturers can provide.
- var/datum/robolimb/L = new limb_type()
- if(limb in L.parts) //Make sure that only models that provide the parts the user needs populate the list.
- robolimb_models[L.company] = L
- if(robolimb_models.len == 1) //If there's only one model available in the list, autoselect it to avoid having to bother the user with a dialog that provides only one option.
- subchoice = L.company //If there ends up being more than one model populating the list, subchoice will be overwritten later anyway, so this isn't a problem.
- if(second_limb in L.parts) //If the child limb of the limb the user selected is also present in the model's parts list, state it's been found so the second limb can be set later.
- in_model = 1
- if(robolimb_models.len > 1) //If there's more than one model in the list that can provide the part the user wants, let them choose.
- subchoice = input(user, "Which model of [choice] [limb_name] do you wish to use?") as null|anything in robolimb_models
- if(subchoice)
- choice = subchoice
- if(limb == "head")
- ha_style = "None"
- h_style = hair_styles_list["Bald"]
- f_style = facial_hair_styles_list["Shaved"]
- m_style = "None"
- rlimb_data[limb] = choice
- organ_data[limb] = "cyborg"
- if(second_limb)
- if(subchoice)
- if(in_model)
- rlimb_data[second_limb] = choice
- organ_data[second_limb] = "cyborg"
- else
- rlimb_data[second_limb] = choice
- organ_data[second_limb] = "cyborg"
-
- if("organs")
- var/organ_name = input(user, "Which internal function do you want to change?") as null|anything in list("Heart", "Eyes")
- if(!organ_name) return
-
- var/organ = null
- switch(organ_name)
- if("Heart")
- organ = "heart"
- if("Eyes")
- organ = "eyes"
-
- var/new_state = input(user, "What state do you wish the organ to be in?") as null|anything in list("Normal","Assisted","Mechanical")
- if(!new_state) return
-
- switch(new_state)
- if("Normal")
- organ_data[organ] = null
- if("Assisted")
- organ_data[organ] = "assisted"
- if("Mechanical")
- organ_data[organ] = "mechanical"
-
-/*
- if("skin_style")
- var/skin_style_name = input(user, "Select a new skin style") as null|anything in list("default1", "default2", "default3")
- if(!skin_style_name) return
-*/
-
-/* if("spawnpoint")
- var/list/spawnkeys = list()
- for(var/S in spawntypes)
- spawnkeys += S
- var/choice = input(user, "Where would you like to spawn when latejoining?") as null|anything in spawnkeys
- if(!choice || !spawntypes[choice])
- spawnpoint = "Arrivals Shuttle"
- return
- spawnpoint = choice */
-
- else
- switch(href_list["preference"])
- if("publicity")
- if(unlock_content)
- toggles ^= MEMBER_PUBLIC
-
- if("gender")
- if(gender == MALE)
- gender = FEMALE
- else
- gender = MALE
- underwear = random_underwear(gender)
-
- if("hear_adminhelps")
- sound ^= SOUND_ADMINHELP
-
- if("ui")
- switch(UI_style)
- if("Midnight")
- UI_style = "Plasmafire"
- if("Plasmafire")
- UI_style = "Retro"
- if("Retro")
- UI_style = "Slimecore"
- if("Slimecore")
- UI_style = "Operative"
- if("Operative")
- UI_style = "White"
- else
- UI_style = "Midnight"
-
- if(ishuman(usr)) //mid-round preference changes, for aesthetics
- var/mob/living/carbon/human/H = usr
- H.remake_hud()
-
- if("nanoui")
- nanoui_fancy = !nanoui_fancy
-
- if("ghost_att_anim")
- show_ghostitem_attack = !show_ghostitem_attack
-
- if("UIcolor")
- var/UI_style_color_new = input(user, "Choose your UI color, dark colors are not recommended!", UI_style_color) as color|null
- if(!UI_style_color_new) return
- UI_style_color = UI_style_color_new
-
- if(ishuman(usr)) //mid-round preference changes, for aesthetics
- var/mob/living/carbon/human/H = usr
- H.remake_hud()
-
- if("UIalpha")
- var/UI_style_alpha_new = input(user, "Select a new alpha(transparence) parameter for UI, between 50 and 255", UI_style_alpha) as num
- if(!UI_style_alpha_new | !(UI_style_alpha_new <= 255 && UI_style_alpha_new >= 50)) return
- UI_style_alpha = UI_style_alpha_new
-
- if(ishuman(usr)) //mid-round preference changes, for aesthetics
- var/mob/living/carbon/human/H = usr
- H.remake_hud()
-
- if("be_special")
- var/r = href_list["role"]
- if(!(r in special_roles))
- var/cleaned_r = sql_sanitize_text(r)
- if(r != cleaned_r) // up to no good
- message_admins("[user] attempted an href exploit! (This could have possibly lead to a \"Bobby Tables\" exploit, so they're probably up to no good). String: [r] ID: [last_id] IP: [last_ip]")
- to_chat(user, "Stop right there, criminal scum")
- else
- be_special ^= r
-
- if("name")
- be_random_name = !be_random_name
-
- if("randomslot")
- randomslot = !randomslot
-
- if("hear_midis")
- sound ^= SOUND_MIDI
-
- if("lobby_music")
- sound ^= SOUND_LOBBY
- if(sound & SOUND_LOBBY)
- to_chat(user, sound(ticker.login_music, repeat = 0, wait = 0, volume = 85, channel = 1))
- else
- to_chat(user, sound(null, repeat = 0, wait = 0, volume = 85, channel = 1))
-
- if("ghost_ears")
- toggles ^= CHAT_GHOSTEARS
-
- if("ghost_sight")
- toggles ^= CHAT_GHOSTSIGHT
-
- if("ghost_radio")
- toggles ^= CHAT_GHOSTRADIO
-
- if("ghost_radio")
- toggles ^= CHAT_GHOSTRADIO
-
- if("save")
- save_preferences(user)
- save_character(user)
-
- if("reload")
- load_preferences(user)
- load_character(user)
-
- if("open_load_dialog")
- if(!IsGuestKey(user.key))
- open_load_dialog(user)
- return 1
-
- if("close_load_dialog")
- close_load_dialog(user)
-
- if("changeslot")
- if(!load_character(user,text2num(href_list["num"])))
- random_character()
- real_name = random_name(gender)
- save_character(user)
- close_load_dialog(user)
-
- if("tab")
- if (href_list["tab"])
- current_tab = text2num(href_list["tab"])
-
- ShowChoices(user)
- return 1
-
-/datum/preferences/proc/copy_to(mob/living/carbon/human/character)
- var/datum/species/S = all_species[species]
- character.change_species(species) // Yell at me if this causes everything to melt
- if(be_random_name)
- real_name = random_name(gender,species)
-
- if(config.humans_need_surnames)
- var/firstspace = findtext(real_name, " ")
- var/name_length = length(real_name)
- if(!firstspace) //we need a surname
- real_name += " [pick(last_names)]"
- else if(firstspace == name_length)
- real_name += "[pick(last_names)]"
-
- character.add_language(language)
-
- character.real_name = real_name
- character.dna.real_name = real_name
- character.name = character.real_name
-
- character.flavor_text = flavor_text
- if(character.ckey && !jobban_isbanned(character, "Records"))
- character.med_record = med_record
- character.sec_record = sec_record
- character.gen_record = gen_record
-
- character.change_gender(gender)
- character.age = age
- character.b_type = b_type
-
- character.r_eyes = r_eyes
- character.g_eyes = g_eyes
- character.b_eyes = b_eyes
-
- //Head-specific
- var/obj/item/organ/external/head/H = character.get_organ("head")
- H.r_hair = r_hair
- H.g_hair = g_hair
- H.b_hair = b_hair
-
- H.r_facial = r_facial
- H.g_facial = g_facial
- H.b_facial = b_facial
-
- H.h_style = h_style
- H.f_style = f_style
- //End of head-specific.
-
- character.r_skin = r_skin
- character.g_skin = g_skin
- character.b_skin = b_skin
-
- character.s_tone = s_tone
-
- // Destroy/cyborgize organs
- for(var/name in organ_data)
-
- var/status = organ_data[name]
- var/obj/item/organ/external/O = character.organs_by_name[name]
- if(O)
- if(status == "amputated")
- character.organs_by_name[O.limb_name] = null
- character.organs -= O
- if(O.children) // This might need to become recursive.
- for(var/obj/item/organ/external/child in O.children)
- character.organs_by_name[child.limb_name] = null
- character.organs -= child
-
- else if(status == "cyborg")
- if(rlimb_data[name])
- O.robotize(rlimb_data[name])
- else
- O.robotize()
- else
- var/obj/item/organ/internal/I = character.get_int_organ_tag(name)
- if(I)
- if(status == "assisted")
- I.mechassist()
- else if(status == "mechanical")
- I.robotize()
-
- character.dna.b_type = b_type
- if(disabilities & DISABILITY_FLAG_FAT && character.species.flags & CAN_BE_FAT)
- character.dna.SetSEState(FATBLOCK,1,1)
- character.mutations += FAT
- character.mutations += OBESITY
- character.overeatduration = 600
-
- if(disabilities & DISABILITY_FLAG_NEARSIGHTED)
- character.dna.SetSEState(GLASSESBLOCK,1,1)
- character.disabilities|=NEARSIGHTED
-
- if(disabilities & DISABILITY_FLAG_EPILEPTIC)
- character.dna.SetSEState(EPILEPSYBLOCK,1,1)
- character.disabilities|=EPILEPSY
-
- if(disabilities & DISABILITY_FLAG_DEAF)
- character.dna.SetSEState(DEAFBLOCK,1,1)
- character.sdisabilities|=DEAF
-
- if(disabilities & DISABILITY_FLAG_BLIND)
- character.dna.SetSEState(BLINDBLOCK,1,1)
- character.sdisabilities|=BLIND
-
- if(disabilities & DISABILITY_FLAG_MUTE)
- character.dna.SetSEState(MUTEBLOCK,1,1)
- character.sdisabilities |= MUTE
-
- S.handle_dna(character)
-
- if(character.dna.dirtySE)
- character.dna.UpdateSE()
- domutcheck(character)
-
- // Wheelchair necessary?
- var/obj/item/organ/external/l_foot = character.get_organ("l_foot")
- var/obj/item/organ/external/r_foot = character.get_organ("r_foot")
- if((!l_foot || l_foot.status & ORGAN_DESTROYED) && (!r_foot || r_foot.status & ORGAN_DESTROYED))
- var/obj/structure/stool/bed/chair/wheelchair/W = new /obj/structure/stool/bed/chair/wheelchair (character.loc)
- character.buckled = W
- character.update_canmove()
- W.dir = character.dir
- W.buckled_mob = character
- W.add_fingerprint(character)
-
- character.underwear = underwear
- character.undershirt = undershirt
- character.socks = socks
-
- if(character.species.bodyflags & HAS_HEAD_ACCESSORY)
- H.r_headacc = r_headacc
- H.g_headacc = g_headacc
- H.b_headacc = b_headacc
- H.ha_style = ha_style
- if(character.species.bodyflags & HAS_MARKINGS)
- character.r_markings = r_markings
- character.g_markings = g_markings
- character.b_markings = b_markings
- character.m_style = m_style
-
- if(body_accessory)
- character.body_accessory = body_accessory_by_name["[body_accessory]"]
-
- if(backbag > 4 || backbag < 1)
- backbag = 1 //Same as above
- character.backbag = backbag
-
- //Debugging report to track down a bug, which randomly assigned the plural gender to people.
- if(character.gender in list(PLURAL, NEUTER))
- if(isliving(src)) //Ghosts get neuter by default
- message_admins("[key_name_admin(character)] has spawned with their gender as plural or neuter. Please notify coders.")
- character.change_gender(MALE)
-
- character.dna.ready_dna(character, flatten_SE = 0)
- character.sync_organ_dna(assimilate=1)
- character.UpdateAppearance()
-
- // Do the initial caching of the player's body icons.
- character.force_update_limbs()
- character.update_eyes()
- character.regenerate_icons()
-
-/datum/preferences/proc/open_load_dialog(mob/user)
-
- var/DBQuery/query = dbcon.NewQuery("SELECT slot,real_name FROM [format_table_name("characters")] WHERE ckey='[user.ckey]' ORDER BY slot")
-
- var/dat = ""
- dat += "
"
- dat += "Select a character slot to load"
- var/name
-
- for(var/i=1, i<=max_save_slots, i++)
- if(!query.Execute())
- var/err = query.ErrorMsg()
- log_game("SQL ERROR during character slot loading. Error : \[[err]\]\n")
- message_admins("SQL ERROR during character slot loading. Error : \[[err]\]\n")
- return
- while(query.NextRow())
- if(i==text2num(query.item[1]))
- name = query.item[2]
- if(!name) name = "Character[i]"
- if(i==default_slot)
- name = "[name]"
- dat += "[name] "
- name = null
-
- dat += ""
- dat += "Close "
- dat += "
"
+ if(appearance_isbanned(user))
+ dat += "You are banned from using custom names and appearances. \
+ You can continue to adjust your characters, but you will be randomised once you join the game.\
+ "
+ dat += "Gender:[gender == MALE ? "Male" : "Female"] "
+ dat += "Age:[age] "
+ dat += "Body:(®) "
+ dat += "Species:[species] "
+ if(species == "Vox")
+ dat += "N2 Tank:[speciesprefs ? "Large N2 Tank" : "Specialized N2 Tank"] "
+ dat += "Secondary Language:[language] "
+ dat += "Blood Type:[b_type] "
+ if(species in list("Human", "Drask", "Vox"))
+ dat += "Skin Tone:[species == "Vox" ? "[s_tone]" : "[-s_tone + 35]/220"] "
+ dat += "Disabilities:\[Set\] "
+ dat += "Nanotrasen Relation:[nanotrasen_relation] "
+ dat += "Set Flavor Text "
+ if(lentext(flavor_text) <= 40)
+ if(!lentext(flavor_text)) dat += "\[...\] "
+ else dat += "[flavor_text] "
+ else dat += "[TextPreview(flavor_text)]... "
+
+ dat += "
Hair & Accessories
"
+
+ if(species in list("Unathi", "Vulpkanin", "Tajaran", "Machine")) //Species that have head accessories.
+ var/headaccessoryname = "Head Accessory: "
+ if(species == "Unathi")
+ headaccessoryname = "Horns: "
+ dat += "[headaccessoryname]"
+ dat += "[ha_style] "
+ dat += "Color [color_square(r_headacc, g_headacc, b_headacc)] "
+
+ if(species in list("Unathi", "Vulpkanin", "Tajaran", "Machine")) //Species that have body markings.
+ dat += "Body Markings: "
+ dat += "[m_style]"
+ dat += "Color [color_square(r_markings, g_markings, b_markings)] "
+
+ dat += "Hair: "
+ dat += "[h_style]"
+ dat += "Color [color_square(r_hair, g_hair, b_hair)] "
+
+ dat += "Facial Hair: "
+ dat += "[f_style ? "[f_style]" : "Shaved"]"
+ dat += "Color [color_square(r_facial, g_facial, b_facial)] "
+
+ if(species != "Machine")
+ dat += "Eyes: "
+ dat += "Color [color_square(r_eyes, g_eyes, b_eyes)] "
+
+ if((species in list("Unathi", "Tajaran", "Skrell", "Slime People", "Vulpkanin", "Machine")) || body_accessory_by_species[species] || check_rights(R_ADMIN, 0, user)) //admins can always fuck with this, because they are admins
+ dat += "Body Color: "
+ dat += "Color [color_square(r_skin, g_skin, b_skin)] "
+
+ if(body_accessory_by_species[species] || check_rights(R_ADMIN, 0, user))
+ dat += "Body Accessory: "
+ dat += "[body_accessory ? "[body_accessory]" : "None"] "
+
+ dat += "
"
+ dat += "
Occupation Choices
"
+ dat += "Set Occupation Preferences "
+ if(jobban_isbanned(user, "Records"))
+ dat += "You are banned from using character records. "
+ else
+ dat += "Character Records "
+
+ dat += "
", 820, 640)
+ popup.set_content(dat)
+ popup.open(0)
+
+
+/datum/preferences/proc/get_gear_metadata(var/datum/gear/G)
+ . = gear[G.display_name]
+ if(!.)
+ . = list()
+ gear[G.display_name] = .
+
+/datum/preferences/proc/get_tweak_metadata(var/datum/gear/G, var/datum/gear_tweak/tweak)
+ var/list/metadata = get_gear_metadata(G)
+ . = metadata["[tweak]"]
+ if(!.)
+ . = tweak.get_default()
+ metadata["[tweak]"] = .
+
+/datum/preferences/proc/set_tweak_metadata(var/datum/gear/G, var/datum/gear_tweak/tweak, var/new_metadata)
+ var/list/metadata = get_gear_metadata(G)
+ metadata["[tweak]"] = new_metadata
+
+
+/datum/preferences/proc/SetChoices(mob/user, limit = 12, list/splitJobs = list("Civilian","Research Director","AI","Bartender"), width = 760, height = 790)
+ if(!job_master)
+ return
+
+ //limit - The amount of jobs allowed per column. Defaults to 17 to make it look nice.
+ //splitJobs - Allows you split the table by job. You can make different tables for each department by including their heads. Defaults to CE to make it look nice.
+ //width - Screen' width. Defaults to 550 to make it look nice.
+ //height - Screen's height. Defaults to 500 to make it look nice.
+
+
+ var/HTML = ""
+ HTML += "
"
+ HTML += "Choose occupation chances Unavailable occupations are crossed out.
Left-click to raise an occupation preference, right-click to lower it.
"
+ HTML += ""
+ HTML += "
" // Table within a table for alignment, also allows you to easily add more colomns.
+ HTML += "
"
+ var/index = -1
+
+ //The job before the current job. I only use this to get the previous jobs color when I'm filling in blank rows.
+ var/datum/job/lastJob
+ if(!job_master) return
+ for(var/datum/job/job in job_master.occupations)
+
+ if(job.admin_only)
+ continue
+
+ index += 1
+ if((index >= limit) || (job.title in splitJobs))
+ if((index < limit) && (lastJob != null))
+ //If the cells were broken up by a job in the splitJob list then it will fill in the rest of the cells with
+ //the last job's selection color. Creating a rather nice effect.
+ for(var/i = 0, i < (limit - index), i += 1)
+ HTML += "
"
+
+/datum/preferences/proc/SetDisabilities(mob/user)
+ var/HTML = ""
+
+ // AUTOFIXED BY fix_string_idiocy.py
+ // C:\Users\Rob\Documents\Projects\vgstation13\code\modules\client\preferences.dm:474: HTML += "
"
+ HTML += {"
+ Choose disabilities
"}
+ // END AUTOFIX
+ HTML += ShowDisabilityState(user,DISABILITY_FLAG_NEARSIGHTED,"Needs Glasses")
+ HTML += ShowDisabilityState(user,DISABILITY_FLAG_FAT,"Obese")
+ HTML += ShowDisabilityState(user,DISABILITY_FLAG_EPILEPTIC,"Seizures")
+ HTML += ShowDisabilityState(user,DISABILITY_FLAG_DEAF,"Deaf")
+ HTML += ShowDisabilityState(user,DISABILITY_FLAG_BLIND,"Blind")
+ HTML += ShowDisabilityState(user,DISABILITY_FLAG_MUTE,"Mute")
+
+
+ // AUTOFIXED BY fix_string_idiocy.py
+ // C:\Users\Rob\Documents\Projects\vgstation13\code\modules\client\preferences.dm:481: HTML += "
"}
+ // END AUTOFIX
+ user << browse(null, "window=preferences")
+ user << browse(HTML, "window=disabil;size=350x300")
+ return
+
+/datum/preferences/proc/SetRecords(mob/user)
+ var/HTML = ""
+ HTML += "
"
+ HTML += "Set Character Records "
+
+ HTML += "Medical Records "
+
+ if(lentext(med_record) <= 40)
+ HTML += "[med_record]"
+ else
+ HTML += "[copytext(med_record, 1, 37)]..."
+
+ HTML += "
Employment Records "
+
+ if(lentext(gen_record) <= 40)
+ HTML += "[gen_record]"
+ else
+ HTML += "[copytext(gen_record, 1, 37)]..."
+
+ HTML += "
Security Records "
+
+ if(lentext(sec_record) <= 40)
+ HTML += "[sec_record] "
+ else
+ HTML += "[copytext(sec_record, 1, 37)]... "
+
+ HTML += " "
+ HTML += "\[Done\]"
+ HTML += "
"
+
+ user << browse(null, "window=preferences")
+ user << browse(HTML, "window=records;size=350x300")
+ return
+
+/datum/preferences/proc/GetPlayerAltTitle(datum/job/job)
+ return player_alt_titles.Find(job.title) > 0 \
+ ? player_alt_titles[job.title] \
+ : job.title
+
+/datum/preferences/proc/SetPlayerAltTitle(datum/job/job, new_title)
+ // remove existing entry
+ if(player_alt_titles.Find(job.title))
+ player_alt_titles -= job.title
+ // add one if it's not default
+ if(job.title != new_title)
+ player_alt_titles[job.title] = new_title
+
+/datum/preferences/proc/SetJob(mob/user, role)
+ var/datum/job/job = job_master.GetJob(role)
+ if(!job)
+ user << browse(null, "window=mob_occupation")
+ ShowChoices(user)
+ return
+
+ if(role == "Civilian")
+ if(job_support_low & job.flag)
+ job_support_low &= ~job.flag
+ else
+ job_support_low |= job.flag
+ SetChoices(user)
+ return 1
+
+ if(GetJobDepartment(job, 1) & job.flag)
+ SetJobDepartment(job, 1)
+ else if(GetJobDepartment(job, 2) & job.flag)
+ SetJobDepartment(job, 2)
+ else if(GetJobDepartment(job, 3) & job.flag)
+ SetJobDepartment(job, 3)
+ else//job = Never
+ SetJobDepartment(job, 4)
+
+ SetChoices(user)
+ return 1
+
+/datum/preferences/proc/ResetJobs()
+ job_support_high = 0
+ job_support_med = 0
+ job_support_low = 0
+
+ job_medsci_high = 0
+ job_medsci_med = 0
+ job_medsci_low = 0
+
+ job_engsec_high = 0
+ job_engsec_med = 0
+ job_engsec_low = 0
+
+ job_karma_high = 0
+ job_karma_med = 0
+ job_karma_low = 0
+
+
+/datum/preferences/proc/GetJobDepartment(var/datum/job/job, var/level)
+ if(!job || !level) return 0
+ switch(job.department_flag)
+ if(SUPPORT)
+ switch(level)
+ if(1)
+ return job_support_high
+ if(2)
+ return job_support_med
+ if(3)
+ return job_support_low
+ if(MEDSCI)
+ switch(level)
+ if(1)
+ return job_medsci_high
+ if(2)
+ return job_medsci_med
+ if(3)
+ return job_medsci_low
+ if(ENGSEC)
+ switch(level)
+ if(1)
+ return job_engsec_high
+ if(2)
+ return job_engsec_med
+ if(3)
+ return job_engsec_low
+ if(KARMA)
+ switch(level)
+ if(1)
+ return job_karma_high
+ if(2)
+ return job_karma_med
+ if(3)
+ return job_karma_low
+ return 0
+
+/datum/preferences/proc/SetJobDepartment(var/datum/job/job, var/level)
+ if(!job || !level) return 0
+ switch(level)
+ if(1)//Only one of these should ever be active at once so clear them all here
+ job_support_high = 0
+ job_medsci_high = 0
+ job_engsec_high = 0
+ job_karma_high = 0
+ return 1
+ if(2)//Set current highs to med, then reset them
+ job_support_med |= job_support_high
+ job_medsci_med |= job_medsci_high
+ job_engsec_med |= job_engsec_high
+ job_karma_med |= job_karma_high
+ job_support_high = 0
+ job_medsci_high = 0
+ job_engsec_high = 0
+ job_karma_high = 0
+
+ switch(job.department_flag)
+ if(SUPPORT)
+ switch(level)
+ if(2)
+ job_support_high = job.flag
+ job_support_med &= ~job.flag
+ if(3)
+ job_support_med |= job.flag
+ job_support_low &= ~job.flag
+ else
+ job_support_low |= job.flag
+ if(MEDSCI)
+ switch(level)
+ if(2)
+ job_medsci_high = job.flag
+ job_medsci_med &= ~job.flag
+ if(3)
+ job_medsci_med |= job.flag
+ job_medsci_low &= ~job.flag
+ else
+ job_medsci_low |= job.flag
+ if(ENGSEC)
+ switch(level)
+ if(2)
+ job_engsec_high = job.flag
+ job_engsec_med &= ~job.flag
+ if(3)
+ job_engsec_med |= job.flag
+ job_engsec_low &= ~job.flag
+ else
+ job_engsec_low |= job.flag
+ if(KARMA)
+ switch(level)
+ if(2)
+ job_karma_high = job.flag
+ job_karma_med &= ~job.flag
+ if(3)
+ job_karma_med |= job.flag
+ job_karma_low &= ~job.flag
+ else
+ job_karma_low |= job.flag
+ return 1
+
+/datum/preferences/proc/process_link(mob/user, list/href_list)
+ if(!user) return
+
+ if(href_list["preference"] == "job")
+ switch(href_list["task"])
+ if("close")
+ user << browse(null, "window=mob_occupation")
+ ShowChoices(user)
+ if("reset")
+ ResetJobs()
+ SetChoices(user)
+ if("random")
+ if(alternate_option == GET_RANDOM_JOB || alternate_option == BE_CIVILIAN)
+ alternate_option += 1
+ else if(alternate_option == RETURN_TO_LOBBY)
+ alternate_option = 0
+ else
+ return 0
+ SetChoices(user)
+ if("alt_title")
+ var/datum/job/job = locate(href_list["job"])
+ if(job)
+ var/choices = list(job.title) + job.alt_titles
+ var/choice = input("Pick a title for [job.title].", "Character Generation", GetPlayerAltTitle(job)) as anything in choices | null
+ if(choice)
+ SetPlayerAltTitle(job, choice)
+ SetChoices(user)
+ if("input")
+ SetJob(user, href_list["text"])
+ if("setJobLevel")
+ UpdateJobPreference(user, href_list["text"], text2num(href_list["level"]))
+ else
+ SetChoices(user)
+ return 1
+ else if(href_list["preference"] == "disabilities")
+
+ switch(href_list["task"])
+ if("close")
+ user << browse(null, "window=disabil")
+ ShowChoices(user)
+ if("reset")
+ disabilities=0
+ SetDisabilities(user)
+ if("input")
+ var/dflag=text2num(href_list["disability"])
+ if(dflag >= 0)
+ if(!(dflag==DISABILITY_FLAG_FAT && species!=("Human" || "Tajaran" || "Grey")))
+ disabilities ^= text2num(href_list["disability"]) //MAGIC
+ SetDisabilities(user)
+ else
+ SetDisabilities(user)
+ return 1
+
+ else if(href_list["preference"] == "records")
+ if(text2num(href_list["record"]) >= 1)
+ SetRecords(user)
+ return
+ else
+ user << browse(null, "window=records")
+ if(href_list["task"] == "med_record")
+ var/medmsg = input(usr,"Set your medical notes here.","Medical Records",html_decode(med_record)) as message
+
+ if(medmsg != null)
+ medmsg = copytext(medmsg, 1, MAX_PAPER_MESSAGE_LEN)
+ medmsg = html_encode(medmsg)
+
+ med_record = medmsg
+ SetRecords(user)
+
+ if(href_list["task"] == "sec_record")
+ var/secmsg = input(usr,"Set your security notes here.","Security Records",html_decode(sec_record)) as message
+
+ if(secmsg != null)
+ secmsg = copytext(secmsg, 1, MAX_PAPER_MESSAGE_LEN)
+ secmsg = html_encode(secmsg)
+
+ sec_record = secmsg
+ SetRecords(user)
+ if(href_list["task"] == "gen_record")
+ var/genmsg = input(usr,"Set your employment notes here.","Employment Records",html_decode(gen_record)) as message
+
+ if(genmsg != null)
+ genmsg = copytext(genmsg, 1, MAX_PAPER_MESSAGE_LEN)
+ genmsg = html_encode(genmsg)
+
+ gen_record = genmsg
+ SetRecords(user)
+
+ if(href_list["preference"] == "gear")
+ if(href_list["toggle_gear"])
+ var/datum/gear/TG = gear_datums[href_list["toggle_gear"]]
+ if(TG.display_name in gear)
+ gear -= TG.display_name
+ else
+ var/total_cost = 0
+ var/list/type_blacklist = list()
+ for(var/gear_name in gear)
+ var/datum/gear/G = gear_datums[gear_name]
+ if(istype(G))
+ if(!G.subtype_cost_overlap)
+ if(G.subtype_path in type_blacklist)
+ continue
+ type_blacklist += G.subtype_path
+ total_cost += G.cost
+
+ if((total_cost + TG.cost) <= MAX_GEAR_COST)
+ gear += TG.display_name
+
+ else if(href_list["gear"] && href_list["tweak"])
+ var/datum/gear/gear = gear_datums[href_list["gear"]]
+ var/datum/gear_tweak/tweak = locate(href_list["tweak"])
+ if(!tweak || !istype(gear) || !(tweak in gear.gear_tweaks))
+ return
+ var/metadata = tweak.get_metadata(user, get_tweak_metadata(gear, tweak))
+ if(!metadata || !CanUseTopic(user))
+ return
+ set_tweak_metadata(gear, tweak, metadata)
+ else if(href_list["select_category"])
+ gear_tab = href_list["select_category"]
+ else if(href_list["clear_loadout"])
+ gear.Cut()
+
+ ShowChoices(user)
+ return
+
+ switch(href_list["task"])
+ if("random")
+ switch(href_list["preference"])
+ if("name")
+ real_name = random_name(gender,species)
+ if("age")
+ age = rand(AGE_MIN, AGE_MAX)
+ if("hair")
+ if(species in list("Human", "Unathi", "Tajaran", "Skrell", "Machine", "Wryn", "Vulpkanin", "Vox"))
+ r_hair = rand(0,255)
+ g_hair = rand(0,255)
+ b_hair = rand(0,255)
+ if("h_style")
+ h_style = random_hair_style(gender, species)
+ if("facial")
+ if(species in list("Human", "Unathi", "Tajaran", "Skrell", "Machine", "Wryn", "Vulpkanin", "Vox"))
+ r_facial = rand(0,255)
+ g_facial = rand(0,255)
+ b_facial = rand(0,255)
+ if("f_style")
+ f_style = random_facial_hair_style(gender, species)
+ if("underwear")
+ underwear = random_underwear(gender)
+ ShowChoices(user)
+ if("undershirt")
+ undershirt = random_undershirt(gender)
+ ShowChoices(user)
+ if("socks")
+ socks = random_socks(gender)
+ ShowChoices(user)
+ if("eyes")
+ r_eyes = rand(0,255)
+ g_eyes = rand(0,255)
+ b_eyes = rand(0,255)
+ if("s_tone")
+ if(species in list("Human", "Drask", "Vox"))
+ s_tone = random_skin_tone()
+ if("s_color")
+ if(species in list("Unathi", "Tajaran", "Skrell", "Slime People", "Wryn", "Vulpkanin", "Machine"))
+ r_skin = rand(0,255)
+ g_skin = rand(0,255)
+ b_skin = rand(0,255)
+ if("bag")
+ backbag = rand(1,4)
+ /*if("skin_style")
+ h_style = random_skin_style(gender)*/
+ if("all")
+ random_character()
+ if("input")
+ switch(href_list["preference"])
+ if("name")
+ var/raw_name = input(user, "Choose your character's name:", "Character Preference") as text|null
+ if(!isnull(raw_name)) // Check to ensure that the user entered text (rather than cancel.)
+ var/new_name = reject_bad_name(raw_name)
+ if(new_name)
+ real_name = new_name
+ else
+ to_chat(user, "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .")
+
+ if("age")
+ var/new_age = input(user, "Choose your character's age:\n([AGE_MIN]-[AGE_MAX])", "Character Preference") as num|null
+ if(new_age)
+ age = max(min( round(text2num(new_age)), AGE_MAX),AGE_MIN)
+ if("species")
+
+ var/list/new_species = list("Human", "Tajaran", "Skrell", "Unathi", "Diona", "Vulpkanin")
+ var/prev_species = species
+// var/whitelisted = 0
+
+ if(config.usealienwhitelist) //If we're using the whitelist, make sure to check it!
+ for(var/S in whitelisted_species)
+ if(is_alien_whitelisted(user,S))
+ new_species += S
+// whitelisted = 1
+// if(!whitelisted)
+// alert(user, "You cannot change your species as you need to be whitelisted. If you wish to be whitelisted contact an admin in-game, on the forums, or on IRC.")
+ else //Not using the whitelist? Aliens for everyone!
+ new_species += whitelisted_species
+
+ species = input("Please select a species", "Character Generation", null) in new_species
+
+ if(prev_species != species)
+ //grab one of the valid hair styles for the newly chosen species
+ var/list/valid_hairstyles = list()
+ for(var/hairstyle in hair_styles_list)
+ var/datum/sprite_accessory/S = hair_styles_list[hairstyle]
+ if(gender == MALE && S.gender == FEMALE)
+ continue
+ if(gender == FEMALE && S.gender == MALE)
+ continue
+ if(!(species in S.species_allowed))
+ continue
+
+ valid_hairstyles[hairstyle] = hair_styles_list[hairstyle]
+
+ if(valid_hairstyles.len)
+ h_style = pick(valid_hairstyles)
+ else
+ //this shouldn't happen
+ h_style = hair_styles_list["Bald"]
+
+ //grab one of the valid facial hair styles for the newly chosen species
+ var/list/valid_facialhairstyles = list()
+ for(var/facialhairstyle in facial_hair_styles_list)
+ var/datum/sprite_accessory/S = facial_hair_styles_list[facialhairstyle]
+ if(gender == MALE && S.gender == FEMALE)
+ continue
+ if(gender == FEMALE && S.gender == MALE)
+ continue
+ if(!(species in S.species_allowed))
+ continue
+
+ valid_facialhairstyles[facialhairstyle] = facial_hair_styles_list[facialhairstyle]
+
+ if(valid_facialhairstyles.len)
+ f_style = pick(valid_facialhairstyles)
+ else
+ //this shouldn't happen
+ f_style = facial_hair_styles_list["Shaved"]
+
+ // Don't wear another species' underwear!
+ var/datum/sprite_accessory/S = underwear_list[underwear]
+ if(!S || !(species in S.species_allowed))
+ underwear = random_underwear(gender, species)
+
+ S = undershirt_list[undershirt]
+ if(!S || !(species in S.species_allowed))
+ undershirt = random_undershirt(gender, species)
+
+ S = socks_list[socks]
+ if(!S || !(species in S.species_allowed))
+ socks = random_socks(gender, species)
+
+ //reset hair colour and skin colour
+ r_hair = 0//hex2num(copytext(new_hair, 2, 4))
+ g_hair = 0//hex2num(copytext(new_hair, 4, 6))
+ b_hair = 0//hex2num(copytext(new_hair, 6, 8))
+
+ s_tone = 0
+
+ if(!(species in list("Unathi", "Tajaran", "Skrell", "Slime People", "Vulpkanin", "Machine")))
+ r_skin = 0
+ g_skin = 0
+ b_skin = 0
+
+ ha_style = "None" // No Vulp ears on Unathi
+ m_style = "None" // No Unathi markings on Tajara
+
+ body_accessory = null //no vulptail on humans damnit
+
+ //Reset prosthetics.
+ organ_data = list()
+ rlimb_data = list()
+ if("speciesprefs")//oldvox code
+ speciesprefs = !speciesprefs
+
+ if("language")
+// var/languages_available
+ var/list/new_languages = list("None")
+/*
+ if(config.usealienwhitelist)
+ for(var/L in all_languages)
+ var/datum/language/lang = all_languages[L]
+ if((!(lang.flags & RESTRICTED)) && (is_alien_whitelisted(user, L)||(!( lang.flags & WHITELISTED ))))
+ new_languages += lang
+ languages_available = 1
+
+ if(!(languages_available))
+ alert(user, "There are not currently any available secondary languages.")
+ else
+*/
+ for(var/L in all_languages)
+ var/datum/language/lang = all_languages[L]
+ if(!(lang.flags & RESTRICTED))
+ new_languages += lang.name
+
+ language = input("Please select a secondary language", "Character Generation", null) in new_languages
+
+ if("metadata")
+ var/new_metadata = input(user, "Enter any information you'd like others to see, such as Roleplay-preferences:", "Game Preference" , metadata) as message|null
+ if(new_metadata)
+ metadata = sanitize(copytext(new_metadata,1,MAX_MESSAGE_LEN))
+
+ if("b_type")
+ var/new_b_type = input(user, "Choose your character's blood-type:", "Character Preference") as null|anything in list( "A+", "A-", "B+", "B-", "AB+", "AB-", "O+", "O-" )
+ if(new_b_type)
+ b_type = new_b_type
+
+ if("hair")
+ if(species in list("Human", "Unathi", "Tajaran", "Skrell", "Machine", "Vulpkanin", "Vox"))
+ var/input = "Choose your character's hair colour:"
+ var/new_hair = input(user, input, "Character Preference", rgb(r_hair, g_hair, b_hair)) as color|null
+ if(new_hair)
+ r_hair = hex2num(copytext(new_hair, 2, 4))
+ g_hair = hex2num(copytext(new_hair, 4, 6))
+ b_hair = hex2num(copytext(new_hair, 6, 8))
+
+ if("h_style")
+ var/list/valid_hairstyles = list()
+ for(var/hairstyle in hair_styles_list)
+ var/datum/sprite_accessory/S = hair_styles_list[hairstyle]
+ if(species == "Machine") //Species that can use prosthetic heads.
+ var/obj/item/organ/external/head/H = new()
+ if(S.name == "Bald")
+ valid_hairstyles[hairstyle] = S
+ if(!rlimb_data["head"]) //Handle situations where the head is default.
+ H.model = "Morpheus Cyberkinetics"
+ else
+ H.model = rlimb_data["head"]
+ var/datum/robolimb/robohead = all_robolimbs[H.model]
+ if(species in S.species_allowed)
+ if(robohead.is_monitor && (robohead.company in S.models_allowed)) //If the Machine character has the default Morpheus screen head or another screen head
+ //and said head is in the hair style's allowed models list...
+ valid_hairstyles[hairstyle] = S //Allow them to select the hairstyle.
+ continue
+ else
+ if(robohead.is_monitor) //Monitors (incl. the default morpheus head) cannot have wigs (human hairstyles).
+ continue
+ else if(!robohead.is_monitor && ("Human" in S.species_allowed))
+ valid_hairstyles[hairstyle] = S
+ continue
+ else
+ if(!(species in S.species_allowed))
+ continue
+
+ valid_hairstyles[hairstyle] = S
+
+ var/new_h_style = input(user, "Choose your character's hair style:", "Character Preference") as null|anything in valid_hairstyles
+ if(new_h_style)
+ h_style = new_h_style
+
+ if("headaccessory")
+ if(species in list("Unathi", "Vulpkanin", "Tajaran", "Machine")) //Species with head accessories.
+ var/input = "Choose the colour of your your character's head accessory:"
+ var/new_head_accessory = input(user, input, "Character Preference", rgb(r_headacc, g_headacc, b_headacc)) as color|null
+ if(new_head_accessory)
+ r_headacc = hex2num(copytext(new_head_accessory, 2, 4))
+ g_headacc = hex2num(copytext(new_head_accessory, 4, 6))
+ b_headacc = hex2num(copytext(new_head_accessory, 6, 8))
+
+ if("ha_style")
+ if(species in list("Unathi", "Vulpkanin", "Tajaran", "Machine")) //Species with head accessories.
+ var/list/valid_head_accessory_styles = list()
+ for(var/head_accessory_style in head_accessory_styles_list)
+ var/datum/sprite_accessory/H = head_accessory_styles_list[head_accessory_style]
+ if(!(species in H.species_allowed))
+ continue
+
+ valid_head_accessory_styles[head_accessory_style] = head_accessory_styles_list[head_accessory_style]
+
+ var/new_head_accessory_style = input(user, "Choose the style of your character's head accessory:", "Character Preference") as null|anything in valid_head_accessory_styles
+ if(new_head_accessory_style)
+ ha_style = new_head_accessory_style
+
+ if("markings")
+ if(species in list("Unathi", "Vulpkanin", "Tajaran", "Machine")) //Species with markings.
+ var/input = "Choose the colour of your your character's markings:"
+ var/new_markings = input(user, input, "Character Preference", rgb(r_markings, g_markings, b_markings)) as color|null
+ if(new_markings)
+ r_markings = hex2num(copytext(new_markings, 2, 4))
+ g_markings = hex2num(copytext(new_markings, 4, 6))
+ b_markings = hex2num(copytext(new_markings, 6, 8))
+
+ if("m_style")
+ if(species in list("Unathi", "Vulpkanin", "Tajaran", "Machine")) //Species with markings.
+ var/list/valid_markings = list()
+ for(var/markingstyle in marking_styles_list)
+ var/datum/sprite_accessory/M = marking_styles_list[markingstyle]
+ if(!(species in M.species_allowed))
+ continue
+
+ if(species == "Machine") //Species that can use prosthetic heads.
+ var/obj/item/organ/external/head/H = new()
+ if(!rlimb_data["head"]) //Handle situations where the head is default.
+ H.model = "Morpheus Cyberkinetics"
+ else
+ H.model = rlimb_data["head"]
+ var/datum/robolimb/robohead = all_robolimbs[H.model]
+ if(robohead.is_monitor && M.name != "None") //If the character can have prosthetic heads and they have the default Morpheus head (or another monitor-head), no optic markings.
+ continue
+ else if(!robohead.is_monitor && M.name != "None") //Otherwise, if they DON'T have the default head and the head's not a monitor but the head's not in the style's list of allowed models, skip.
+ if(!(robohead.company in M.models_allowed))
+ continue
+
+ valid_markings[markingstyle] = marking_styles_list[markingstyle]
+
+ var/new_marking_style = input(user, "Choose the style of your character's markings:", "Character Preference", m_style) as null|anything in valid_markings
+ if(new_marking_style)
+ m_style = new_marking_style
+
+ if("body_accessory")
+ var/list/possible_body_accessories = list()
+ if(check_rights(R_ADMIN, 1, user))
+ possible_body_accessories = body_accessory_by_name.Copy()
+ else
+ for(var/B in body_accessory_by_name)
+ var/datum/body_accessory/accessory = body_accessory_by_name[B]
+ if(!istype(accessory))
+ possible_body_accessories += "None" //the only null entry should be the "None" option
+ continue
+ if(species in accessory.allowed_species)
+ possible_body_accessories += B
+
+ var/new_body_accessory = input(user, "Choose your body accessory:", "Character Preference") as null|anything in possible_body_accessories
+ if(new_body_accessory)
+ body_accessory = (new_body_accessory == "None") ? null : new_body_accessory
+
+ if("facial")
+ if(species in list("Human", "Unathi", "Tajaran", "Skrell", "Machine", "Vulpkanin", "Vox"))
+ var/new_facial = input(user, "Choose your character's facial-hair colour:", "Character Preference", rgb(r_facial, g_facial, b_facial)) as color|null
+ if(new_facial)
+ r_facial = hex2num(copytext(new_facial, 2, 4))
+ g_facial = hex2num(copytext(new_facial, 4, 6))
+ b_facial = hex2num(copytext(new_facial, 6, 8))
+
+ if("f_style")
+ var/list/valid_facialhairstyles = list()
+ for(var/facialhairstyle in facial_hair_styles_list)
+ var/datum/sprite_accessory/S = facial_hair_styles_list[facialhairstyle]
+ if(S.name == "Shaved")
+ valid_facialhairstyles[facialhairstyle] = S
+ if(gender == MALE && S.gender == FEMALE)
+ continue
+ if(gender == FEMALE && S.gender == MALE)
+ continue
+ if(species == "Machine") //Species that can use prosthetic heads.
+ var/obj/item/organ/external/head/H = new()
+ if(!rlimb_data["head"]) //Handle situations where the head is default.
+ H.model = "Morpheus Cyberkinetics"
+ else
+ H.model = rlimb_data["head"]
+ var/datum/robolimb/robohead = all_robolimbs[H.model]
+ if(species in S.species_allowed)
+ if(robohead.is_monitor) //If the Machine character has the default Morpheus screen head or another screen head and they're allowed to have the style, let them have it.
+ valid_facialhairstyles[facialhairstyle] = S
+ continue
+ else
+ if(robohead.is_monitor) //Monitors (incl. the default morpheus head) cannot have wigs (human facial hairstyles).
+ continue
+ else if(!robohead.is_monitor && ("Human" in S.species_allowed))
+ valid_facialhairstyles[facialhairstyle] = S
+ continue
+ else
+ if(!(species in S.species_allowed))
+ continue
+
+ valid_facialhairstyles[facialhairstyle] = facial_hair_styles_list[facialhairstyle]
+
+ var/new_f_style = input(user, "Choose your character's facial-hair style:", "Character Preference") as null|anything in valid_facialhairstyles
+ if(new_f_style)
+ f_style = new_f_style
+
+ if("underwear")
+ var/list/underwear_options
+ if(gender == MALE)
+ underwear_options = underwear_m
+ else
+ underwear_options = underwear_f
+
+ var/new_underwear = input(user, "Choose your character's underwear:", "Character Preference") as null|anything in underwear_options
+ if(new_underwear)
+ underwear = new_underwear
+ ShowChoices(user)
+
+ if("undershirt")
+ var/new_undershirt
+ if(gender == MALE)
+ new_undershirt = input(user, "Choose your character's undershirt:", "Character Preference") as null|anything in undershirt_m
+ else
+ new_undershirt = input(user, "Choose your character's undershirt:", "Character Preference") as null|anything in undershirt_f
+ if(new_undershirt)
+ undershirt = new_undershirt
+ ShowChoices(user)
+
+ if("socks")
+ var/list/valid_sockstyles = list()
+ for(var/sockstyle in socks_list)
+ var/datum/sprite_accessory/S = socks_list[sockstyle]
+ if(gender == MALE && S.gender == FEMALE)
+ continue
+ if(gender == FEMALE && S.gender == MALE)
+ continue
+ if(!(species in S.species_allowed))
+ continue
+ valid_sockstyles[sockstyle] = socks_list[sockstyle]
+ var/new_socks = input(user, "Choose your character's socks:", "Character Preference") as null|anything in valid_sockstyles
+ ShowChoices(user)
+ if(new_socks)
+ socks = new_socks
+
+ if("eyes")
+ var/new_eyes = input(user, "Choose your character's eye colour:", "Character Preference", rgb(r_eyes, g_eyes, b_eyes)) as color|null
+ if(new_eyes)
+ r_eyes = hex2num(copytext(new_eyes, 2, 4))
+ g_eyes = hex2num(copytext(new_eyes, 4, 6))
+ b_eyes = hex2num(copytext(new_eyes, 6, 8))
+
+ if("s_tone")
+ if(species == "Human" || species == "Drask")
+ var/new_s_tone = input(user, "Choose your character's skin-tone:\n(Light 1 - 220 Dark)", "Character Preference") as num|null
+ if(new_s_tone)
+ s_tone = 35 - max(min(round(new_s_tone), 220), 1)
+ else if(species == "Vox")
+ var/skin_c = input(user, "Choose your Vox's skin color:\n(1 = Default Green, 2 = Dark Green, 3 = Brown, 4 = Grey, \n5 = Emerald, 6 = Azure)", "Character Preference") as num|null
+ if(skin_c)
+ s_tone = max(min(round(skin_c), 6), 1)
+
+ if("skin")
+ if((species in list("Unathi", "Tajaran", "Skrell", "Slime People", "Vulpkanin", "Machine")) || body_accessory_by_species[species] || check_rights(R_ADMIN, 0, user))
+ var/new_skin = input(user, "Choose your character's skin colour: ", "Character Preference", rgb(r_skin, g_skin, b_skin)) as color|null
+ if(new_skin)
+ r_skin = hex2num(copytext(new_skin, 2, 4))
+ g_skin = hex2num(copytext(new_skin, 4, 6))
+ b_skin = hex2num(copytext(new_skin, 6, 8))
+
+
+ if("ooccolor")
+ var/new_ooccolor = input(user, "Choose your OOC colour:", "Game Preference", ooccolor) as color|null
+ if(new_ooccolor)
+ ooccolor = new_ooccolor
+
+ if("bag")
+ var/new_backbag = input(user, "Choose your character's style of bag:", "Character Preference") as null|anything in backbaglist
+ if(new_backbag)
+ backbag = backbaglist.Find(new_backbag)
+
+ if("nt_relation")
+ var/new_relation = input(user, "Choose your relation to NT. Note that this represents what others can find out about your character by researching your background, not what your character actually thinks.", "Character Preference") as null|anything in list("Loyal", "Supportive", "Neutral", "Skeptical", "Opposed")
+ if(new_relation)
+ nanotrasen_relation = new_relation
+
+ if("flavor_text")
+ var/msg = input(usr,"Set the flavor text in your 'examine' verb. This can also be used for OOC notes and preferences!","Flavor Text",html_decode(flavor_text)) as message
+
+ if(msg != null)
+ msg = copytext(msg, 1, MAX_MESSAGE_LEN)
+ msg = html_encode(msg)
+
+ flavor_text = msg
+
+ if("limbs")
+ var/valid_limbs = list("Left Leg", "Right Leg", "Left Arm", "Right Arm", "Left Foot", "Right Foot", "Left Hand", "Right Hand")
+ if(species == "Machine")
+ valid_limbs = list("Torso", "Lower Body", "Head", "Left Leg", "Right Leg", "Left Arm", "Right Arm", "Left Foot", "Right Foot", "Left Hand", "Right Hand")
+ var/limb_name = input(user, "Which limb do you want to change?") as null|anything in valid_limbs
+ if(!limb_name) return
+
+ var/limb = null
+ var/second_limb = null // if you try to change the arm, the hand should also change
+ var/third_limb = null // if you try to unchange the hand, the arm should also change
+ var/valid_limb_states = list("Normal", "Amputated", "Prosthesis")
+ var/no_amputate = 0
+
+ switch(limb_name)
+ if("Torso")
+ limb = "chest"
+ second_limb = "groin"
+ no_amputate = 1
+ if("Lower Body")
+ limb = "groin"
+ no_amputate = 1
+ if("Head")
+ limb = "head"
+ no_amputate = 1
+ if("Left Leg")
+ limb = "l_leg"
+ second_limb = "l_foot"
+ if("Right Leg")
+ limb = "r_leg"
+ second_limb = "r_foot"
+ if("Left Arm")
+ limb = "l_arm"
+ second_limb = "l_hand"
+ if("Right Arm")
+ limb = "r_arm"
+ second_limb = "r_hand"
+ if("Left Foot")
+ limb = "l_foot"
+ if(species != "Machine")
+ third_limb = "l_leg"
+ if("Right Foot")
+ limb = "r_foot"
+ if(species != "Machine")
+ third_limb = "r_leg"
+ if("Left Hand")
+ limb = "l_hand"
+ if(species != "Machine")
+ third_limb = "l_arm"
+ if("Right Hand")
+ limb = "r_hand"
+ if(species != "Machine")
+ third_limb = "r_arm"
+
+ var/new_state = input(user, "What state do you wish the limb to be in?") as null|anything in valid_limb_states
+ if(!new_state) return
+
+ switch(new_state)
+ if("Normal")
+ if(limb == "head")
+ m_style = "None"
+ h_style = random_hair_style(gender, species)
+ f_style = facial_hair_styles_list["Shaved"]
+ organ_data[limb] = null
+ rlimb_data[limb] = null
+ if(third_limb)
+ organ_data[third_limb] = null
+ rlimb_data[third_limb] = null
+ if("Amputated")
+ if(!no_amputate)
+ organ_data[limb] = "amputated"
+ rlimb_data[limb] = null
+ if(second_limb)
+ organ_data[second_limb] = "amputated"
+ rlimb_data[second_limb] = null
+ if("Prosthesis")
+ var/choice
+ var/subchoice
+ var/datum/robolimb/R = new()
+ var/in_model
+ var/robolimb_companies = list()
+ for(var/limb_type in typesof(/datum/robolimb)) //This loop populates a list of companies that offer the limb the user selected previously as one of their cybernetic products.
+ R = new limb_type()
+ if(!R.unavailable_at_chargen && (limb in R.parts) && R.has_subtypes) //Ensures users can only choose companies that offer the parts they want, that singular models get added to the list as well companies that offer more than one model, and...
+ robolimb_companies[R.company] = R //List only main brands that have the parts we're looking for.
+ R = new() //Re-initialize R.
+
+ choice = input(user, "Which manufacturer do you wish to use for this limb?") as null|anything in robolimb_companies //Choose from a list of companies that offer the part the user wants.
+ if(!choice)
+ return
+ R.company = choice
+ R = all_robolimbs[R.company]
+ if(R.has_subtypes == 1) //If the company the user selected provides more than just one base model, lets handle it.
+ var/list/robolimb_models = list()
+ for(var/limb_type in typesof(R)) //Handling the different models of parts that manufacturers can provide.
+ var/datum/robolimb/L = new limb_type()
+ if(limb in L.parts) //Make sure that only models that provide the parts the user needs populate the list.
+ robolimb_models[L.company] = L
+ if(robolimb_models.len == 1) //If there's only one model available in the list, autoselect it to avoid having to bother the user with a dialog that provides only one option.
+ subchoice = L.company //If there ends up being more than one model populating the list, subchoice will be overwritten later anyway, so this isn't a problem.
+ if(second_limb in L.parts) //If the child limb of the limb the user selected is also present in the model's parts list, state it's been found so the second limb can be set later.
+ in_model = 1
+ if(robolimb_models.len > 1) //If there's more than one model in the list that can provide the part the user wants, let them choose.
+ subchoice = input(user, "Which model of [choice] [limb_name] do you wish to use?") as null|anything in robolimb_models
+ if(subchoice)
+ choice = subchoice
+ if(limb == "head")
+ ha_style = "None"
+ h_style = hair_styles_list["Bald"]
+ f_style = facial_hair_styles_list["Shaved"]
+ m_style = "None"
+ rlimb_data[limb] = choice
+ organ_data[limb] = "cyborg"
+ if(second_limb)
+ if(subchoice)
+ if(in_model)
+ rlimb_data[second_limb] = choice
+ organ_data[second_limb] = "cyborg"
+ else
+ rlimb_data[second_limb] = choice
+ organ_data[second_limb] = "cyborg"
+
+ if("organs")
+ var/organ_name = input(user, "Which internal function do you want to change?") as null|anything in list("Heart", "Eyes")
+ if(!organ_name) return
+
+ var/organ = null
+ switch(organ_name)
+ if("Heart")
+ organ = "heart"
+ if("Eyes")
+ organ = "eyes"
+
+ var/new_state = input(user, "What state do you wish the organ to be in?") as null|anything in list("Normal","Assisted","Mechanical")
+ if(!new_state) return
+
+ switch(new_state)
+ if("Normal")
+ organ_data[organ] = null
+ if("Assisted")
+ organ_data[organ] = "assisted"
+ if("Mechanical")
+ organ_data[organ] = "mechanical"
+
+/*
+ if("skin_style")
+ var/skin_style_name = input(user, "Select a new skin style") as null|anything in list("default1", "default2", "default3")
+ if(!skin_style_name) return
+*/
+
+/* if("spawnpoint")
+ var/list/spawnkeys = list()
+ for(var/S in spawntypes)
+ spawnkeys += S
+ var/choice = input(user, "Where would you like to spawn when latejoining?") as null|anything in spawnkeys
+ if(!choice || !spawntypes[choice])
+ spawnpoint = "Arrivals Shuttle"
+ return
+ spawnpoint = choice */
+
+ else
+ switch(href_list["preference"])
+ if("publicity")
+ if(unlock_content)
+ toggles ^= MEMBER_PUBLIC
+
+ if("gender")
+ if(gender == MALE)
+ gender = FEMALE
+ else
+ gender = MALE
+ underwear = random_underwear(gender)
+
+ if("hear_adminhelps")
+ sound ^= SOUND_ADMINHELP
+
+ if("ui")
+ switch(UI_style)
+ if("Midnight")
+ UI_style = "Plasmafire"
+ if("Plasmafire")
+ UI_style = "Retro"
+ if("Retro")
+ UI_style = "Slimecore"
+ if("Slimecore")
+ UI_style = "Operative"
+ if("Operative")
+ UI_style = "White"
+ else
+ UI_style = "Midnight"
+
+ if(ishuman(usr)) //mid-round preference changes, for aesthetics
+ var/mob/living/carbon/human/H = usr
+ H.remake_hud()
+
+ if("nanoui")
+ nanoui_fancy = !nanoui_fancy
+
+ if("ghost_att_anim")
+ show_ghostitem_attack = !show_ghostitem_attack
+
+ if("UIcolor")
+ var/UI_style_color_new = input(user, "Choose your UI color, dark colors are not recommended!", UI_style_color) as color|null
+ if(!UI_style_color_new) return
+ UI_style_color = UI_style_color_new
+
+ if(ishuman(usr)) //mid-round preference changes, for aesthetics
+ var/mob/living/carbon/human/H = usr
+ H.remake_hud()
+
+ if("UIalpha")
+ var/UI_style_alpha_new = input(user, "Select a new alpha(transparence) parameter for UI, between 50 and 255", UI_style_alpha) as num
+ if(!UI_style_alpha_new | !(UI_style_alpha_new <= 255 && UI_style_alpha_new >= 50)) return
+ UI_style_alpha = UI_style_alpha_new
+
+ if(ishuman(usr)) //mid-round preference changes, for aesthetics
+ var/mob/living/carbon/human/H = usr
+ H.remake_hud()
+
+ if("be_special")
+ var/r = href_list["role"]
+ if(!(r in special_roles))
+ var/cleaned_r = sql_sanitize_text(r)
+ if(r != cleaned_r) // up to no good
+ message_admins("[user] attempted an href exploit! (This could have possibly lead to a \"Bobby Tables\" exploit, so they're probably up to no good). String: [r] ID: [last_id] IP: [last_ip]")
+ to_chat(user, "Stop right there, criminal scum")
+ else
+ be_special ^= r
+
+ if("name")
+ be_random_name = !be_random_name
+
+ if("randomslot")
+ randomslot = !randomslot
+
+ if("hear_midis")
+ sound ^= SOUND_MIDI
+
+ if("lobby_music")
+ sound ^= SOUND_LOBBY
+ if(sound & SOUND_LOBBY)
+ user << sound(ticker.login_music, repeat = 0, wait = 0, volume = 85, channel = 1)
+ else
+ user << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1)
+
+ if("ghost_ears")
+ toggles ^= CHAT_GHOSTEARS
+
+ if("ghost_sight")
+ toggles ^= CHAT_GHOSTSIGHT
+
+ if("ghost_radio")
+ toggles ^= CHAT_GHOSTRADIO
+
+ if("ghost_radio")
+ toggles ^= CHAT_GHOSTRADIO
+
+ if("save")
+ save_preferences(user)
+ save_character(user)
+
+ if("reload")
+ load_preferences(user)
+ load_character(user)
+
+ if("open_load_dialog")
+ if(!IsGuestKey(user.key))
+ open_load_dialog(user)
+ return 1
+
+ if("close_load_dialog")
+ close_load_dialog(user)
+
+ if("changeslot")
+ if(!load_character(user,text2num(href_list["num"])))
+ random_character()
+ real_name = random_name(gender)
+ save_character(user)
+ close_load_dialog(user)
+
+ if("tab")
+ if(href_list["tab"])
+ current_tab = text2num(href_list["tab"])
+
+ ShowChoices(user)
+ return 1
+
+/datum/preferences/proc/copy_to(mob/living/carbon/human/character)
+ var/datum/species/S = all_species[species]
+ character.change_species(species) // Yell at me if this causes everything to melt
+ if(be_random_name)
+ real_name = random_name(gender,species)
+
+ if(config.humans_need_surnames)
+ var/firstspace = findtext(real_name, " ")
+ var/name_length = length(real_name)
+ if(!firstspace) //we need a surname
+ real_name += " [pick(last_names)]"
+ else if(firstspace == name_length)
+ real_name += "[pick(last_names)]"
+
+ character.add_language(language)
+
+ character.real_name = real_name
+ character.dna.real_name = real_name
+ character.name = character.real_name
+
+ character.flavor_text = flavor_text
+ character.med_record = med_record
+ character.sec_record = sec_record
+ character.gen_record = gen_record
+
+ character.change_gender(gender)
+ character.age = age
+ character.b_type = b_type
+
+ character.r_eyes = r_eyes
+ character.g_eyes = g_eyes
+ character.b_eyes = b_eyes
+
+ //Head-specific
+ var/obj/item/organ/external/head/H = character.get_organ("head")
+ H.r_hair = r_hair
+ H.g_hair = g_hair
+ H.b_hair = b_hair
+
+ H.r_facial = r_facial
+ H.g_facial = g_facial
+ H.b_facial = b_facial
+
+ H.h_style = h_style
+ H.f_style = f_style
+ //End of head-specific.
+
+ character.r_skin = r_skin
+ character.g_skin = g_skin
+ character.b_skin = b_skin
+
+ character.s_tone = s_tone
+
+ // Destroy/cyborgize organs
+ for(var/name in organ_data)
+
+ var/status = organ_data[name]
+ var/obj/item/organ/external/O = character.organs_by_name[name]
+ if(O)
+ if(status == "amputated")
+ character.organs_by_name[O.limb_name] = null
+ character.organs -= O
+ if(O.children) // This might need to become recursive.
+ for(var/obj/item/organ/external/child in O.children)
+ character.organs_by_name[child.limb_name] = null
+ character.organs -= child
+
+ else if(status == "cyborg")
+ if(rlimb_data[name])
+ O.robotize(rlimb_data[name])
+ else
+ O.robotize()
+ else
+ var/obj/item/organ/internal/I = character.get_int_organ_tag(name)
+ if(I)
+ if(status == "assisted")
+ I.mechassist()
+ else if(status == "mechanical")
+ I.robotize()
+
+ character.dna.b_type = b_type
+ if(disabilities & DISABILITY_FLAG_FAT && character.species.flags & CAN_BE_FAT)
+ character.dna.SetSEState(FATBLOCK,1,1)
+ character.mutations += FAT
+ character.mutations += OBESITY
+ character.overeatduration = 600
+
+ if(disabilities & DISABILITY_FLAG_NEARSIGHTED)
+ character.dna.SetSEState(GLASSESBLOCK,1,1)
+ character.disabilities|=NEARSIGHTED
+
+ if(disabilities & DISABILITY_FLAG_EPILEPTIC)
+ character.dna.SetSEState(EPILEPSYBLOCK,1,1)
+ character.disabilities|=EPILEPSY
+
+ if(disabilities & DISABILITY_FLAG_DEAF)
+ character.dna.SetSEState(DEAFBLOCK,1,1)
+ character.disabilities|=DEAF
+
+ if(disabilities & DISABILITY_FLAG_BLIND)
+ character.dna.SetSEState(BLINDBLOCK,1,1)
+ character.disabilities|=BLIND
+
+ if(disabilities & DISABILITY_FLAG_MUTE)
+ character.dna.SetSEState(MUTEBLOCK,1,1)
+ character.disabilities |= MUTE
+
+ S.handle_dna(character)
+
+ if(character.dna.dirtySE)
+ character.dna.UpdateSE()
+ domutcheck(character)
+
+ // Wheelchair necessary?
+ var/obj/item/organ/external/l_foot = character.get_organ("l_foot")
+ var/obj/item/organ/external/r_foot = character.get_organ("r_foot")
+ if((!l_foot || l_foot.status & ORGAN_DESTROYED) && (!r_foot || r_foot.status & ORGAN_DESTROYED))
+ var/obj/structure/stool/bed/chair/wheelchair/W = new /obj/structure/stool/bed/chair/wheelchair (character.loc)
+ character.buckled = W
+ character.update_canmove()
+ W.dir = character.dir
+ W.buckled_mob = character
+ W.add_fingerprint(character)
+
+ character.underwear = underwear
+ character.undershirt = undershirt
+ character.socks = socks
+
+ if(character.species.bodyflags & HAS_HEAD_ACCESSORY)
+ H.r_headacc = r_headacc
+ H.g_headacc = g_headacc
+ H.b_headacc = b_headacc
+ H.ha_style = ha_style
+ if(character.species.bodyflags & HAS_MARKINGS)
+ character.r_markings = r_markings
+ character.g_markings = g_markings
+ character.b_markings = b_markings
+ character.m_style = m_style
+
+ if(body_accessory)
+ character.body_accessory = body_accessory_by_name["[body_accessory]"]
+
+ if(backbag > 4 || backbag < 1)
+ backbag = 1 //Same as above
+ character.backbag = backbag
+
+ //Debugging report to track down a bug, which randomly assigned the plural gender to people.
+ if(character.gender in list(PLURAL, NEUTER))
+ if(isliving(src)) //Ghosts get neuter by default
+ message_admins("[key_name_admin(character)] has spawned with their gender as plural or neuter. Please notify coders.")
+ character.change_gender(MALE)
+
+ character.dna.ready_dna(character, flatten_SE = 0)
+ character.sync_organ_dna(assimilate=1)
+ character.UpdateAppearance()
+
+ // Do the initial caching of the player's body icons.
+ character.force_update_limbs()
+ character.update_eyes()
+ character.regenerate_icons()
+
+/datum/preferences/proc/open_load_dialog(mob/user)
+
+ var/DBQuery/query = dbcon.NewQuery("SELECT slot,real_name FROM [format_table_name("characters")] WHERE ckey='[user.ckey]' ORDER BY slot")
+
+ var/dat = ""
+ dat += "
"
+ dat += "Select a character slot to load"
+ var/name
+
+ for(var/i=1, i<=max_save_slots, i++)
+ if(!query.Execute())
+ var/err = query.ErrorMsg()
+ log_game("SQL ERROR during character slot loading. Error : \[[err]\]\n")
+ message_admins("SQL ERROR during character slot loading. Error : \[[err]\]\n")
+ return
+ while(query.NextRow())
+ if(i==text2num(query.item[1]))
+ name = query.item[2]
+ if(!name) name = "Character[i]"
+ if(i==default_slot)
+ name = "[name]"
+ dat += "[name] "
+ name = null
+
+ dat += ""
+ dat += "Close "
+ dat += "
")
-
- if (!active_record)
- dat += "Record not found."
- else
- dat += "
[active_record.fields["name"]]
"
- dat += "Scan ID [active_record.fields["id"]] [topic_link(src,"clone","Clone")] "
-
- var/obj/item/weapon/implant/health/H = locate(active_record.fields["imp"])
-
- if ((H) && (istype(H)))
- dat += "Health Implant Data: [H.sensehealth()]
"
- else
- dat += "Unable to locate Health Implant.
"
-
- dat += "Unique Identifier: [active_record.fields["UI"]] "
- dat += "Structural Enzymes: [active_record.fields["SE"]] "
-
- if (has_disk)
- dat += "
"
- dat += "
Inserted Disk
"
- dat += "Contents: "
- if (computer.floppy.inserted.files.len == 0)
- dat += "Empty"
- else
- for(var/datum/file/data/genome/G in computer.floppy.inserted.files)
- dat += topic_link(src,"loadfile=\ref[G]","[G.name]") + " "
-
- dat += "
Save to Disk: "
- dat += topic_link(src,"save_disk=ue","Unique Identifier + Unique Enzymes") + " "
- dat += topic_link(src,"save_disk=ui","Unique Identifier") + " "
- dat += topic_link(src,"save_disk=se","Structural Enzymes") + " "
- dat += "
"
-
- dat += "[topic_link(src,"del_rec","Delete Record")]"
- return dat
- proc/ConfirmDelete()
- var/dat = "[temp] "
- dat += "
Confirm Record Deletion
"
-
- dat += "[topic_link(src,"del_rec","Scan card to confirm")] "
- dat += "[topic_link(src,"menu=3","Cancel")]"
- return dat
-
- interact()
- if(!interactable())
- return
-
- updatemodules()
-
- var/dat = ""
- dat += topic_link(src,"refresh","Refresh")
- dat += "
Cloning Pod Status
"
- dat += "
[temp]
"
-
- has_disk = (computer.floppy && computer.floppy.inserted)
- if(!active_record && menu > 2)
- menu = 2
-
- switch(menu)
- if(1)
- dat += ScanningMenu()
-
- if(2)
- dat += RecordsList()
-
- if(3)
- dat += ShowRecord()
-
- if(4)
- dat = ConfirmDelete() // not (+=), this is how it used to be, just putting it in a function
-
- if(!popup)
- popup = new(usr, "\ref[computer]", "Cloning System Control")
- popup.set_title_image(usr.browse_rsc_icon(overlay.icon, overlay.icon_state))
-
- popup.set_content(dat)
- popup.open()
- return
-
- Topic(var/href, var/list/href_list)
- if(loading || !interactable())
- return
-
- if (href_list["menu"])
- menu = text2num(href_list["menu"])
- else if (("scan" in href_list) && !isnull(scanner))
- scantemp = ""
-
- loading = 1
- computer.updateUsrDialog()
-
- spawn(20)
- scan_mob(scanner.occupant)
-
- loading = 0
- computer.updateUsrDialog()
-
-
- //No locking an open scanner.
- else if (("lock" in href_list) && !isnull(scanner))
- if ((!scanner.locked) && (scanner.occupant))
- scanner.locked = 1
- else
- scanner.locked = 0
-
- else if ("view_rec" in href_list)
- active_record = locate(href_list["view_rec"])
- if(istype(active_record,/datum/data/record))
- if ( !active_record.fields["ckey"] || active_record.fields["ckey"] == "" )
- del(active_record)
- temp = "Record Corrupt"
- else
- menu = 3
- else
- active_record = null
- temp = "Record missing."
-
- else if ("del_rec" in href_list)
- if ((!active_record) || (menu < 3))
- return
- if (menu == 3) //If we are viewing a record, confirm deletion
- temp = "Delete record?"
- menu = 4
-
- else if (menu == 4)
- var/obj/item/weapon/card/id/C = usr.get_active_hand()
- if (istype(C)||istype(C, /obj/item/device/pda))
- if(check_access(C))
- temp = "[active_record.fields["name"]] => Record deleted."
- records.Remove(active_record)
- del(active_record)
- menu = 2
- else
- temp = "Access Denied."
-
- else if ("eject_disk" in href_list)
- if(computer.floppy)
- computer.floppy.eject_disk()
-
- else if("loadfile" in href_list)
-
- var/datum/file/data/genome/G = locate(href_list["loadfile"]) in computer.floppy.files
- if(!istype(G))
- temp = "Load error."
- computer.updateUsrDialog()
- return
- switch(G.type)
- if(/datum/file/data/genome/UI)
- active_record.fields["UI"] = G.content
- if(/datum/file/data/genome/UE)
- active_record.fields["name"] = G.real_name
- if(/datum/file/data/genome/SE)
- active_record.fields["SE"] = G.content
- if(/datum/file/data/genome/cloning)
- active_record = G:record
- else if("savefile" in href_list)
- if (!active_record || !computer || !computer.floppy)
- temp = "Save error."
- computer.updateUsrDialog()
- return
- var/rval = 0
- switch(href_list["save_disk"])
- if("ui")
- var/datum/file/data/genome/UI/ui = new
- ui.content = active_record.fields["UI"]
- ui.real_name = active_record.fields["name"]
- rval = computer.floppy.addfile(ui)
- if("ue")
- var/datum/file/data/genome/UI/UE/ui = new
- ui.content = active_record.fields["UI"]
- ui.real_name = active_record.fields["name"]
- rval = computer.floppy.addfile(ui)
- if("se")
- var/datum/file/data/genome/SE/se = new
- se.content = active_record.fields["SE"]
- se.real_name = active_record.fields["name"]
- rval = computer.floppy.addfile(se)
- if("clone")
- var/datum/file/data/genome/cloning/c = new
- c.record = active_record
- c.real_name = active_record.fields["name"]
- rval = computer.floppy.addfile(c)
- if(!rval)
- temp = "Disk write error."
-
- else if ("refresh" in href_list)
- computer.updateUsrDialog()
-
- else if ("clone" in href_list)
- //Look for that player! They better be dead!
- if(active_record)
- //Can't clone without someone to clone. Or a pod. Or if the pod is busy. Or full of gibs.
- if(!pod1)
- temp = "No Clonepod detected."
- else if(pod1.occupant)
- temp = "Clonepod is currently occupied."
- else if(pod1.mess)
- temp = "Clonepod malfunction."
- else if(!config.revival_cloning)
- temp = "Unable to initiate cloning cycle."
- else if(pod1.growclone(active_record.fields["ckey"], active_record.fields["name"], active_record.fields["UI"], active_record.fields["SE"], active_record.fields["mind"], active_record.fields["mrace"]))
- temp = "[active_record.fields["name"]] => Cloning cycle in progress..."
- records.Remove(active_record)
- del(active_record)
- menu = 1
- else
- temp = "[active_record.fields["name"]] => Initialisation failure."
-
- else
- temp = "Data corruption."
-
- computer.add_fingerprint(usr)
- computer.updateUsrDialog()
- return
-
- proc/scan_mob(mob/living/carbon/human/subject as mob)
- if ((isnull(subject)) || (!(ishuman(subject))) || (!subject.dna))
- scantemp = "Unable to locate valid genetic data."
- return
- if (!getbrain(subject))
- scantemp = "No signs of intelligence detected."
- return
- if (subject.suiciding == 1)
- scantemp = "Subject's brain is not responding to scanning stimuli."
- return
- if ((!subject.ckey) || (!subject.client))
- scantemp = "Mental interface failure."
- return
- if (NOCLONE in subject.mutations)
- scantemp = "Mental interface failure."
- return
- if (!isnull(find_record(subject.ckey)))
- scantemp = "Subject already in database."
- return
-
- subject.dna.check_integrity()
-
- var/datum/data/record/R = new /datum/data/record( )
- if(subject.dna)
- R.fields["mrace"] = subject.dna.mutantrace
- R.fields["UI"] = subject.dna.uni_identity
- R.fields["SE"] = subject.dna.struc_enzymes
- else
- R.fields["mrace"] = null
- R.fields["UI"] = null
- R.fields["SE"] = null
- R.fields["ckey"] = subject.ckey
- R.fields["name"] = subject.real_name
- R.fields["id"] = copytext(md5(subject.real_name), 2, 6)
-
-
-
- //Add an implant if needed
- var/obj/item/weapon/implant/health/imp = locate(/obj/item/weapon/implant/health, subject)
- if (isnull(imp))
- imp = new /obj/item/weapon/implant/health(subject)
- imp.implanted = subject
- R.fields["imp"] = "\ref[imp]"
- //Update it if needed
- else
- R.fields["imp"] = "\ref[imp]"
-
- if (!isnull(subject.mind)) //Save that mind so traitors can continue traitoring after cloning.
- R.fields["mind"] = "\ref[subject.mind]"
-
- records += R
- scantemp = "Subject successfully scanned."
-
-//Find a specific record by key.
- proc/find_record(var/find_key)
- for(var/datum/data/record/R in records)
- if (R.fields["ckey"] == find_key)
- return R
- return null
diff --git a/code/modules/computer3/computers/communications.dm b/code/modules/computer3/computers/communications.dm
index b738cef704e..d6575d3c143 100644
--- a/code/modules/computer3/computers/communications.dm
+++ b/code/modules/computer3/computers/communications.dm
@@ -59,8 +59,9 @@
Topic(var/href, var/list/href_list)
if(!interactable() || !computer.radio || ..(href,href_list) )
return
- if (!(computer.z in config.station_levels))
- to_chat(usr, "\red Unable to establish a connection: \black You're too far away from the station!")
+ // TODO: Tie into space manager
+ if(!(computer.z in config.station_levels))
+ to_chat(usr, "Unable to establish a connection: You're too far away from the station!")
return
if("main" in href_list)
@@ -85,7 +86,7 @@
var/obj/item/I = M.get_active_hand()
I = I.GetID()
- if (istype(I,/obj/item/weapon/card/id))
+ if(istype(I,/obj/item/weapon/card/id))
if(access_captain in I.GetAccess())
var/old_level = security_level
if(!tmp_alertlevel) tmp_alertlevel = SEC_LEVEL_GREEN
@@ -146,7 +147,7 @@
state = STATE_MESSAGELIST
if("viewmessage" in href_list)
state = STATE_VIEWMESSAGE
- if (!currmsg)
+ if(!currmsg)
if(href_list["message-num"])
currmsg = text2num(href_list["message-num"])
else
@@ -247,7 +248,7 @@
aistate = STATE_MESSAGELIST
if("ai-viewmessage" in href_list)
aistate = STATE_VIEWMESSAGE
- if (!aicurrmsg)
+ if(!aicurrmsg)
if(href_list["message-num"])
aicurrmsg = text2num(href_list["message-num"])
else
@@ -281,16 +282,16 @@
proc/main_menu()
var/dat = ""
- if (computer.radio.subspace)
+ if(computer.radio.subspace)
if(shuttle_master.emergency.mode == SHUTTLE_CALL)
var/timeleft = shuttle_master.emergency.timeLeft()
dat += "Emergency shuttle\n \nETA: [timeleft / 60 % 60]:[add_zero(num2text(timeleft % 60), 2)]"
refresh = 1
else
refresh = 0
- if (authenticated)
+ if(authenticated)
dat += " \[ Log Out \]"
- if (authenticated==2)
+ if(authenticated==2)
dat += " \[ Make An Announcement \]"
if(computer.emagged == 0)
dat += " \[ Send an emergency message to Centcomm \]"
@@ -300,7 +301,7 @@
dat += " \[ Change alert level \]"
/*if(emergency_shuttle.location())
- if (emergency_shuttle.online())
+ if(emergency_shuttle.online())
dat += " \[ Cancel Shuttle Call \]"
else
dat += " \[ Call Emergency Shuttle \]"*/
@@ -335,16 +336,16 @@
for(var/i = 1; i<=messagetitle.len; i++)
dat += " [messagetitle[i]]"
if(STATE_VIEWMESSAGE)
- if (currmsg)
+ if(currmsg)
dat += "[messagetitle[currmsg]]
[messagetext[currmsg]]"
- if (authenticated)
+ if(authenticated)
dat += "
\[ Delete \]"
else
state = STATE_MESSAGELIST
interact()
return
if(STATE_DELMESSAGE)
- if (currmsg)
+ if(currmsg)
dat += "Are you sure you want to delete this message? \[ OK | Cancel \]"
else
state = STATE_MESSAGELIST
diff --git a/code/modules/computer3/computers/law.dm b/code/modules/computer3/computers/law.dm
index ec278163b2a..7534aa65932 100644
--- a/code/modules/computer3/computers/law.dm
+++ b/code/modules/computer3/computers/law.dm
@@ -24,8 +24,9 @@
attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob, params)
- if (user.z > 6)
- to_chat(user, "\red Unable to establish a connection: \black You're too far away from the station!")
+ // TODO: Tie into space manager
+ if(user.z > ZLEVEL_DERELICT)
+ to_chat(user, "Unable to establish a connection: You're too far away from the station!")
return
if(istype(module, /obj/item/weapon/aiModule))
module.install(src)
@@ -43,7 +44,7 @@
src.current = select_active_ai(user)
- if (!src.current)
+ if(!src.current)
to_chat(usr, "No active AIs detected.")
else
to_chat(usr, "[src.current.name] selected for law changes.")
@@ -75,7 +76,7 @@
src.current = freeborg()
- if (!src.current)
+ if(!src.current)
to_chat(usr, "No free cyborgs detected.")
else
to_chat(usr, "[src.current.name] selected for law changes.")
diff --git a/code/modules/computer3/computers/medical.dm b/code/modules/computer3/computers/medical.dm
index aeda16c4414..6e96b6728e7 100644
--- a/code/modules/computer3/computers/medical.dm
+++ b/code/modules/computer3/computers/medical.dm
@@ -49,21 +49,22 @@
scan = computer.cardslot.reader
if(!interactable())
return
- if (computer.z > 6)
- to_chat(usr, "\red Unable to establish a connection: \black You're too far away from the station!")
+ // TODO: Tie into space manager
+ if(computer.z > ZLEVEL_DERELICT)
+ to_chat(usr, "Unable to establish a connection: You're too far away from the station!")
return
var/dat
- if (temp)
+ if(temp)
dat = text("[src.temp]
", record2.fields["b_type"], record2.fields["b_dna"], record2.fields["mi_dis"], record2.fields["mi_dis_d"], record2.fields["ma_dis"], record2.fields["ma_dis_d"], record2.fields["alg"], record2.fields["alg_d"], record2.fields["cdi"], record2.fields["cdi_d"], decode(record2.fields["notes"]))
var/counter = 1
while(record2.fields[text("com_[]", counter)])
diff --git a/code/modules/computer3/computers/message.dm b/code/modules/computer3/computers/message.dm
index 31aa4f3a501..cf40e7f3a0c 100644
--- a/code/modules/computer3/computers/message.dm
+++ b/code/modules/computer3/computers/message.dm
@@ -242,7 +242,7 @@
if(!interactable() || ..(href,href_list))
return
- if ("auth" in href_list)
+ if("auth" in href_list)
if(auth)
auth = 0
screen = 0
@@ -255,10 +255,10 @@
message = incorrectkey
//Turn the server on/off.
- if ("active" in href_list)
+ if("active" in href_list)
if(auth) linkedServer.active = !linkedServer.active
//Find a server
- if ("find" in href_list)
+ if("find" in href_list)
if(message_servers && message_servers.len > 1)
src.linkedServer = input(usr,"Please select a server.", "Select a server.", null) as null|anything in message_servers
message = "NOTICE: Server selected."
@@ -269,7 +269,7 @@
message = noserver
//View the logs - KEY REQUIRED
- if ("view" in href_list)
+ if("view" in href_list)
if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN)))
message = noserver
else
@@ -277,7 +277,7 @@
src.screen = 1
//Clears the logs - KEY REQUIRED
- if ("clear" in href_list)
+ if("clear" in href_list)
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
message = noserver
else
@@ -285,7 +285,7 @@
src.linkedServer.pda_msgs = list()
message = "NOTICE: Logs cleared."
//Clears the request console logs - KEY REQUIRED
- if ("clearr" in href_list)
+ if("clearr" in href_list)
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
message = noserver
else
@@ -293,7 +293,7 @@
src.linkedServer.rc_msgs = list()
message = "NOTICE: Logs cleared."
//Change the password - KEY REQUIRED
- if ("pass" in href_list)
+ if("pass" in href_list)
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
message = noserver
else
@@ -313,7 +313,7 @@
message = incorrectkey
//Hack the Console to get the password
- if ("hack" in href_list)
+ if("hack" in href_list)
if((istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot)) && (usr.mind.special_role && usr.mind.original == usr))
src.hacking = 1
src.screen = 2
@@ -323,7 +323,7 @@
if(src && src.linkedServer && usr)
BruteForce(usr)
//Delete the log.
- if ("delete" in href_list)
+ if("delete" in href_list)
//Are they on the view logs screen?
if(screen == 1)
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
@@ -332,7 +332,7 @@
src.linkedServer.pda_msgs -= locate(href_list["delete"])
message = "NOTICE: Log Deleted!"
//Delete the request console log.
- if ("deleter" in href_list)
+ if("deleter" in href_list)
//Are they on the view logs screen?
if(screen == 4)
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
@@ -341,14 +341,14 @@
src.linkedServer.rc_msgs -= locate(href_list["deleter"])
message = "NOTICE: Log Deleted!"
//Create a custom message
- if ("msg" in href_list)
+ if("msg" in href_list)
if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN)))
message = noserver
else
if(auth)
src.screen = 3
//Fake messaging selection - KEY REQUIRED
- if ("select" in href_list)
+ if("select" in href_list)
if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN)))
message = noserver
screen = 0
@@ -400,21 +400,21 @@
return src.attack_hand(usr)
var/obj/item/device/pda/PDARec = null
- for (var/obj/item/device/pda/P in PDAs)
- if (!P.owner || P.toff || P.hidden) continue
+ for(var/obj/item/device/pda/P in PDAs)
+ if(!P.owner || P.toff || P.hidden) continue
if(P.owner == customsender)
PDARec = P
//Sender isn't faking as someone who exists
if(isnull(PDARec))
src.linkedServer.send_pda_message("[customrecepient.owner]", "[customsender]","[custommessage]")
customrecepient.tnote += "← From [customsender] ([customjob]): [custommessage] "
- if (!customrecepient.silent)
+ if(!customrecepient.silent)
playsound(customrecepient.loc, 'sound/machines/twobeep.ogg', 50, 1)
- for (var/mob/O in hearers(3, customrecepient.loc))
- O.show_message(text("\icon[customrecepient] *[customrecepient.ttone]*"))
+ for(var/mob/O in hearers(3, customrecepient.loc))
+ O.show_message(text("[bicon(customrecepient)] *[customrecepient.ttone]*"))
if( customrecepient.loc && ishuman(customrecepient.loc) )
var/mob/living/carbon/human/H = customrecepient.loc
- to_chat(H, "\icon[customrecepient] Message from [customsender] ([customjob]), \"[custommessage]\" (Reply)"
+ to_chat(H, "[bicon(customrecepient)] Message from [customsender] ([customjob]), \"[custommessage]\" (Reply)"
log_pda("[usr] (PDA: [customsender]) sent \"[custommessage]\" to [customrecepient.owner]")
customrecepient.overlays.Cut()
@@ -423,13 +423,13 @@
else
src.linkedServer.send_pda_message("[customrecepient.owner]", "[PDARec.owner]","[custommessage]")
customrecepient.tnote += "← From [PDARec.owner] ([customjob]): [custommessage] "
- if (!customrecepient.silent)
+ if(!customrecepient.silent)
playsound(customrecepient.loc, 'sound/machines/twobeep.ogg', 50, 1)
- for (var/mob/O in hearers(3, customrecepient.loc))
- O.show_message(text("\icon[customrecepient] *[customrecepient.ttone]*"))
+ for(var/mob/O in hearers(3, customrecepient.loc))
+ O.show_message(text("[bicon(customrecepient)] *[customrecepient.ttone]*"))
if( customrecepient.loc && ishuman(customrecepient.loc) )
var/mob/living/carbon/human/H = customrecepient.loc
- to_chat(H, "\icon[customrecepient] Message from [PDARec.owner] ([customjob]), \"[custommessage]\" (Reply)"
+ to_chat(H, "[bicon(customrecepient)] Message from [PDARec.owner] ([customjob]), \"[custommessage]\" (Reply)"
log_pda("[usr] (PDA: [PDARec.owner]) sent \"[custommessage]\" to [customrecepient.owner]")
customrecepient.overlays.Cut()
@@ -447,6 +447,6 @@
// to_chat(usr, href_list["select"])
- if ("back" in href_list)
+ if("back" in href_list)
src.screen = 0
interact()
\ No newline at end of file
diff --git a/code/modules/computer3/computers/prisoner.dm b/code/modules/computer3/computers/prisoner.dm
index b38b376abf5..75b2302991f 100644
--- a/code/modules/computer3/computers/prisoner.dm
+++ b/code/modules/computer3/computers/prisoner.dm
@@ -43,6 +43,7 @@
if(!T.implanted) continue
var/loc_display = "Unknown"
var/mob/living/carbon/M = T.imp_in
+ // TODO: Tie into space manager
if(M.z == ZLEVEL_STATION && !istype(M.loc, /turf/space))
var/turf/mob_loc = get_turf(M)
loc_display = mob_loc.loc
@@ -98,5 +99,3 @@
interact()
return
-
-
diff --git a/code/modules/computer3/computers/prisonshuttle.dm b/code/modules/computer3/computers/prisonshuttle.dm
deleted file mode 100644
index 119dbc350a4..00000000000
--- a/code/modules/computer3/computers/prisonshuttle.dm
+++ /dev/null
@@ -1,242 +0,0 @@
-//Config stuff
-#define PRISON_MOVETIME 150 //Time to station is milliseconds.
-#define PRISON_STATION_AREATYPE "/area/shuttle/prison/station" //Type of the prison shuttle area for station
-#define PRISON_DOCK_AREATYPE "/area/shuttle/prison/prison" //Type of the prison shuttle area for dock
-
-var/prison_shuttle_moving_to_station = 0
-var/prison_shuttle_moving_to_prison = 0
-var/prison_shuttle_at_station = 0
-var/prison_shuttle_can_send = 1
-var/prison_shuttle_time = 0
-var/prison_shuttle_timeleft = 0
-
-/obj/machinery/computer3/prison_shuttle
- name = "Prison Shuttle Console"
- icon = 'icons/obj/computer.dmi'
- icon_state = "shuttle"
- req_access = list(access_security)
- circuit = "/obj/item/part/board/circuit/prison_shuttle"
- var/temp = null
- var/hacked = 0
- var/allowedtocall = 0
- var/prison_break = 0
-
-
- attackby(I as obj, user as mob, params)
- return src.attack_hand(user)
-
-
- attack_ai(var/mob/user as mob)
- return src.attack_hand(user)
-
-
- attack_paw(var/mob/user as mob)
- return src.attack_hand(user)
-
-
- attackby(I as obj, user as mob, params)
- if(istype(I, /obj/item/tool/screwdriver))
- playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
- if(do_after(user, 20, target = src))
- var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
- var/obj/item/part/board/circuit/prison_shuttle/M = new /obj/item/part/board/circuit/prison_shuttle( A )
- for (var/obj/C in src)
- C.loc = src.loc
- A.circuit = M
- A.anchored = 1
-
- if (src.stat & BROKEN)
- to_chat(user, "\blue The broken glass falls out.")
- new /obj/item/trash/shard( src.loc )
- A.state = 3
- A.icon_state = "3"
- else
- to_chat(user, "\blue You disconnect the monitor.")
- A.state = 4
- A.icon_state = "4"
-
- del(src)
- else if(istype(I,/obj/item/card/emag) && (!hacked))
- hacked = 1
- to_chat(user, "\blue You disable the lock.")
- else
- return src.attack_hand(user)
-
-
- attack_hand(var/mob/user as mob)
- if(!src.allowed(user) && (!hacked))
- to_chat(user, "\red Access Denied.")
- return
- if(prison_break)
- to_chat(user, "\red Unable to locate shuttle.")
- return
- if(..())
- return
- user.set_machine(src)
- post_signal("prison")
- var/dat
- if (src.temp)
- dat = src.temp
- else
- dat += {"Location: [prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison ? "Moving to station ([prison_shuttle_timeleft] Secs.)":prison_shuttle_at_station ? "Station":"Dock"]
- [prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison ? "\n*Shuttle already called* \n ":prison_shuttle_at_station ? "\nSend to Dock \n ":"\nSend to Station \n "]
- \nClose"}
-
- //user << browse(dat, "window=computer;size=575x450")
- //onclose(user, "computer")
- var/datum/browser/popup = new(user, "computer", name, 575, 450)
- popup.set_content(dat)
- popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
- popup.open()
- return
-
-
- Topic(href, href_list)
- if(..())
- return
-
- if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
- usr.set_machine(src)
-
- if (href_list["sendtodock"])
- if (!prison_can_move())
- to_chat(usr, "\red The prison shuttle is unable to leave.")
- return
- if(!prison_shuttle_at_station|| prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
- post_signal("prison")
- to_chat(usr, "\blue The prison shuttle has been called and will arrive in [(PRISON_MOVETIME/10)] seconds.")
- src.temp += "Shuttle sent.
OK"
- src.updateUsrDialog()
- prison_shuttle_moving_to_prison = 1
- prison_shuttle_time = world.timeofday + PRISON_MOVETIME
- spawn(0)
- prison_process()
-
- else if (href_list["sendtostation"])
- if (!prison_can_move())
- to_chat(usr, "\red The prison shuttle is unable to leave.")
- return
- if(prison_shuttle_at_station || prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
- post_signal("prison")
- to_chat(usr, "\blue The prison shuttle has been called and will arrive in [(PRISON_MOVETIME/10)] seconds.")
- src.temp += "Shuttle sent.
OK"
- src.updateUsrDialog()
- prison_shuttle_moving_to_station = 1
- prison_shuttle_time = world.timeofday + PRISON_MOVETIME
- spawn(0)
- prison_process()
-
- else if (href_list["mainmenu"])
- src.temp = null
-
- src.add_fingerprint(usr)
- src.updateUsrDialog()
- return
-
-
- proc/prison_can_move()
- if(prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return 0
- else return 1
-
-/*
- proc/prison_break()
- switch(prison_break)
- if (0)
- if(!prison_shuttle_at_station || prison_shuttle_moving_to_prison) return
-
- prison_shuttle_moving_to_prison = 1
- prison_shuttle_at_station = prison_shuttle_at_station
-
- if (!prison_shuttle_moving_to_prison || !prison_shuttle_moving_to_station)
- prison_shuttle_time = world.timeofday + PRISON_MOVETIME
- spawn(0)
- prison_process()
- prison_break = 1
- if(1)
- prison_break = 0
-*/
-
- proc/post_signal(var/command)
- var/datum/radio_frequency/frequency = radio_controller.return_frequency(1311)
- if(!frequency) return
- var/datum/signal/status_signal = new
- status_signal.source = src
- status_signal.transmission_method = 1
- status_signal.data["command"] = command
- frequency.post_signal(src, status_signal)
- return
-
-
- proc/prison_process()
- while(prison_shuttle_time - world.timeofday > 0)
- var/ticksleft = prison_shuttle_time - world.timeofday
-
- if(ticksleft > 1e5)
- prison_shuttle_time = world.timeofday + 10 // midnight rollover
-
- prison_shuttle_timeleft = (ticksleft / 10)
- sleep(5)
- prison_shuttle_moving_to_station = 0
- prison_shuttle_moving_to_prison = 0
-
- switch(prison_shuttle_at_station)
-
- if(0)
- prison_shuttle_at_station = 1
- if (prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
-
- if (!prison_can_move())
- to_chat(usr, "\red The prison shuttle is unable to leave.")
- return
-
- var/area/start_location = locate(/area/shuttle/prison/prison)
- var/area/end_location = locate(/area/shuttle/prison/station)
-
- var/list/dstturfs = list()
- var/throwy = world.maxy
-
- for(var/turf/T in end_location)
- dstturfs += T
- if(T.y < throwy)
- throwy = T.y
- // hey you, get out of the way!
- for(var/turf/T in dstturfs)
- // find the turf to move things to
- var/turf/D = locate(T.x, throwy - 1, 1)
- //var/turf/E = get_step(D, SOUTH)
- for(var/atom/movable/AM as mob|obj in T)
- AM.Move(D)
- if(istype(T, /turf/simulated))
- del(T)
- start_location.move_contents_to(end_location)
-
- if(1)
- prison_shuttle_at_station = 0
- if (prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
-
- if (!prison_can_move())
- to_chat(usr, "\red The prison shuttle is unable to leave.")
- return
-
- var/area/start_location = locate(/area/shuttle/prison/station)
- var/area/end_location = locate(/area/shuttle/prison/prison)
-
- var/list/dstturfs = list()
- var/throwy = world.maxy
-
- for(var/turf/T in end_location)
- dstturfs += T
- if(T.y < throwy)
- throwy = T.y
-
- // hey you, get out of the way!
- for(var/turf/T in dstturfs)
- // find the turf to move things to
- var/turf/D = locate(T.x, throwy - 1, 1)
- //var/turf/E = get_step(D, SOUTH)
- for(var/atom/movable/AM as mob|obj in T)
- AM.Move(D)
- if(istype(T, /turf/simulated))
- del(T)
- start_location.move_contents_to(end_location)
- return
\ No newline at end of file
diff --git a/code/modules/computer3/computers/robot.dm b/code/modules/computer3/computers/robot.dm
index 002750b49c1..a728c8993bf 100644
--- a/code/modules/computer3/computers/robot.dm
+++ b/code/modules/computer3/computers/robot.dm
@@ -31,10 +31,11 @@
interact()
- if(!interactable() || computer.z > 6)
+ // TODO: Tie into space manager
+ if(!interactable() || computer.z > ZLEVEL_DERELICT)
return
var/dat
- if (src.temp)
+ if(src.temp)
dat = "[src.temp]
Clear Screen"
else
if(screen == 0)
@@ -44,10 +45,10 @@
if(screen == 1)
for(var/mob/living/silicon/robot/R in mob_list)
if(istype(usr, /mob/living/silicon/ai))
- if (R.connected_ai != usr)
+ if(R.connected_ai != usr)
continue
if(istype(usr, /mob/living/silicon/robot))
- if (R != usr)
+ if(R != usr)
continue
if(R.scrambledcodes)
continue
@@ -55,11 +56,11 @@
dat += "[R.name] |"
if(R.stat)
dat += " Not Responding |"
- else if (!R.canmove)
+ else if(!R.canmove)
dat += " Locked Down |"
else
dat += " Operating Normally |"
- if (!R.canmove)
+ if(!R.canmove)
else if(R.cell)
dat += " Battery Installed ([R.cell.charge]/[R.cell.maxcharge]) |"
else
@@ -72,7 +73,7 @@
dat += " Slaved to [R.connected_ai.name] |"
else
dat += " Independent from AI |"
- if (istype(usr, /mob/living/silicon))
+ if(istype(usr, /mob/living/silicon))
if(issilicon(usr) && is_special_character(usr) && !R.emagged)
dat += "(Hack) "
dat += "([R.canmove ? "Lockdown" : "Release"]) "
@@ -105,19 +106,19 @@
if(!interactable() || ..(href,href_list))
return
- if ("killall" in href_list)
+ if("killall" in href_list)
src.temp = {"Destroy Robots?
\[Swipe ID to initiate destruction sequence\] Cancel"}
- if ("do_killall" in href_list)
+ if("do_killall" in href_list)
var/obj/item/weapon/card/id/I = usr.get_active_hand()
- if (istype(I, /obj/item/device/pda))
+ if(istype(I, /obj/item/device/pda))
var/obj/item/device/pda/pda = I
I = pda.id
- if (istype(I))
+ if(istype(I))
if(src.check_access(I))
- if (!status)
+ if(!status)
message_admins("\blue [key_name_admin(usr)] has initiated the global cyborg killswitch!")
log_game("\blue [key_name(usr)] has initiated the global cyborg killswitch!")
src.status = 1
@@ -127,23 +128,23 @@
else
to_chat(usr, "\red Access Denied.")
- if ("stop" in href_list)
+ if("stop" in href_list)
src.temp = {"
Stop Robot Destruction Sequence?
Yes No"}
- if ("stop2" in href_list)
+ if("stop2" in href_list)
src.stop = 1
src.temp = null
src.status = 0
- if ("reset" in href_list)
+ if("reset" in href_list)
src.timeleft = 60
- if ("temp" in href_list)
+ if("temp" in href_list)
src.temp = null
- if ("screen" in href_list)
+ if("screen" in href_list)
switch(href_list["screen"])
if("0")
screen = 0
@@ -151,7 +152,7 @@
screen = 1
if("2")
screen = 2
- if ("killbot" in href_list)
+ if("killbot" in href_list)
if(computer.allowed(usr))
var/mob/living/silicon/robot/R = locate(href_list["killbot"])
if(R)
@@ -169,7 +170,7 @@
else
to_chat(usr, "\red Access Denied.")
- if ("stopbot" in href_list)
+ if("stopbot" in href_list)
if(computer.allowed(usr))
var/mob/living/silicon/robot/R = locate(href_list["stopbot"])
if(R && istype(R)) // Extra sancheck because of input var references
@@ -179,7 +180,7 @@
message_admins("\blue [key_name_admin(usr)] [R.canmove ? "locked down" : "released"] [R.name]!")
log_game("[key_name(usr)] [R.canmove ? "locked down" : "released"] [R.name]!")
R.canmove = !R.canmove
- if (R.lockcharge)
+ if(R.lockcharge)
// R.cell.charge = R.lockcharge
R.lockcharge = !R.lockcharge
to_chat(R, "Your lockdown has been lifted!")
@@ -191,7 +192,7 @@
else
to_chat(usr, "\red Access Denied.")
- if ("magbot" in href_list)
+ if("magbot" in href_list)
if(computer.allowed(usr))
var/mob/living/silicon/robot/R = locate(href_list["magbot"])
if(R)
@@ -206,6 +207,3 @@
interact()
return
-
-
-
diff --git a/code/modules/computer3/computers/scanconsole.dm b/code/modules/computer3/computers/scanconsole.dm
index fa88ae24b36..1ccc06bde90 100644
--- a/code/modules/computer3/computers/scanconsole.dm
+++ b/code/modules/computer3/computers/scanconsole.dm
@@ -279,7 +279,7 @@
var/rejuvenators = round(occupant.reagents.get_reagent_amount("inaprovaline") / REJUVENATORS_MAX * 100)
status_html += "
Rejuvenators:
[occupant.reagents.get_reagent_amount("inaprovaline")] units
"
- if (dna_summary)
+ if(dna_summary)
status_html += "
Unique Enzymes :
[uppertext(occupant.dna.unique_enzymes)]
"
status_html += "
Unique Identifier:
[occupant.dna.uni_identity]
"
status_html += "
Structural Enzymes:
[occupant.dna.struc_enzymes]
"
@@ -384,7 +384,7 @@
proc/emitter_menu()
to_chat(var/dat = topic_link(src,"mode=0",", Main Menu") + " ")
dat += "
Radiation Emitter Settings
"
- if (viable)
+ if(viable)
dat += topic_link(src,"pulse","Pulse Radiation")
else
dat += fake_link("Pulse Radiation")
@@ -454,7 +454,7 @@
updateappearance(scanner.occupant,scanner.occupant.dna.uni_identity)
scanner.occupant.apply_effect(radstrength+radduration, IRRADIATE)
if("ui-f")
- if (prob(20+radstrength))
+ if(prob(20+radstrength))
randmutb(scanner.occupant)
domutcheck(scanner.occupant,scanner)
else
@@ -466,8 +466,8 @@
var/se = scanner.occupant.dna.struc_enzymes
var/targetblock = se_block
- if (!(se_block in list(2,8,10,12)) && prob (20)) // shifts the target slightly
- if (se_block <= 5)
+ if(!(se_block in list(2,8,10,12)) && prob (20)) // shifts the target slightly
+ if(se_block <= 5)
targetblock++
else
targetblock--
@@ -484,7 +484,7 @@
domutcheck(scanner.occupant,scanner)
scanner.occupant.apply_effect(radstrength+radduration, IRRADIATE)
if("se-f")
- if (prob(80-radduration))
+ if(prob(80-radduration))
randmutb(scanner.occupant)
domutcheck(scanner.occupant,scanner)
else
@@ -493,7 +493,7 @@
scanner.occupant.apply_effect((radstrength*2)+radduration, IRRADIATE)
if(null)
- if (prob(95))
+ if(prob(95))
if(prob(75))
randmutb(scanner.occupant)
else
@@ -517,7 +517,7 @@
if(istype(H))
var/inap = H.reagents.get_reagent_amount("inaprovaline") // oh my *god* this section was ugly before I shortened it
- if (inap < (REJUVENATORS_MAX - REJUVENATORS_INJECT))
+ if(inap < (REJUVENATORS_MAX - REJUVENATORS_INJECT))
H.reagents.add_reagent("inaprovaline", REJUVENATORS_INJECT)
else
H.reagents.add_reagent("inaprovaline", max(REJUVENATORS_MAX - inap,0))
@@ -534,32 +534,32 @@
var/viable_occupant = (occupant && occupant.dna && !(NOCLONE in occupant.mutations))
var/mob/living/carbon/human/human_occupant = scanner.occupant
- if (href_list["screen"]) // Passing a screen is only a request, we set current_screen here but it can be overridden below if necessary
+ if(href_list["screen"]) // Passing a screen is only a request, we set current_screen here but it can be overridden below if necessary
current_screen = href_list["screen"]
- if (!viable_occupant) // If there is no viable occupant only allow certain screens
+ if(!viable_occupant) // If there is no viable occupant only allow certain screens
var/allowed_no_occupant_screens = list("mainmenu", "radsetmenu", "buffermenu") //These are the screens which will be allowed if there's no occupant
- if (!(current_screen in allowed_no_occupant_screens))
+ if(!(current_screen in allowed_no_occupant_screens))
href_list = new /list(0) // clear list of options
current_screen = "mainmenu"
- if (!current_screen) // If no screen is set default to mainmenu
+ if(!current_screen) // If no screen is set default to mainmenu
current_screen = "mainmenu"
- if (!scanner) //Is the scanner not connected?
+ if(!scanner) //Is the scanner not connected?
scanner_status_html = "ERROR: No DNA Scanner connected."
current_screen = null // blank does not exist in the switch below, so no screen will be outputted
updateUsrDialog()
return
usr.set_machine(src)
- if (href_list["locked"])
- if (scanner.occupant)
+ if(href_list["locked"])
+ if(scanner.occupant)
scanner.locked = !( scanner.locked )
////////////////////////////////////////////////////////
- if (href_list["genpulse"])
+ if(href_list["genpulse"])
if(!viable_occupant)//Makes sure someone is in there (And valid) before trying anything
temp_html = text("No viable occupant detected.")//More than anything, this just acts as a sanity check in case the option DOES appear for whatever reason
//usr << browse(temp_html, "window=scannernew;size=550x650")
@@ -574,10 +574,10 @@
var/lock_state = scanner.locked
scanner.locked = 1//lock it
sleep(10*radduration)
- if (!scanner.occupant)
+ if(!scanner.occupant)
temp_html = null
return null
- if (prob(95))
+ if(prob(95))
if(prob(75))
randmutb(scanner.occupant)
else
@@ -591,59 +591,59 @@
scanner.locked = lock_state
temp_html = null
dopage(src,"screen=radsetmenu")
- if (href_list["radleplus"])
+ if(href_list["radleplus"])
if(!viable_occupant)
temp_html = text("No viable occupant detected.")
popup.set_content(temp_html)
popup.open()
- if (radduration < 20)
+ if(radduration < 20)
radduration++
radduration++
dopage(src,"screen=radsetmenu")
- if (href_list["radleminus"])
+ if(href_list["radleminus"])
if(!viable_occupant)
temp_html = text("No viable occupant detected.")
popup.set_content(temp_html)
popup.open()
- if (radduration > 2)
+ if(radduration > 2)
radduration--
radduration--
dopage(src,"screen=radsetmenu")
- if (href_list["radinplus"])
- if (radstrength < 10)
+ if(href_list["radinplus"])
+ if(radstrength < 10)
radstrength++
dopage(src,"screen=radsetmenu")
- if (href_list["radinminus"])
- if (radstrength > 1)
+ if(href_list["radinminus"])
+ if(radstrength > 1)
radstrength--
dopage(src,"screen=radsetmenu")
////////////////////////////////////////////////////////
- if (href_list["unimenuplus"])
- if (ui_block < 13)
+ if(href_list["unimenuplus"])
+ if(ui_block < 13)
ui_block++
else
ui_block = 1
dopage(src,"screen=unimenu")
- if (href_list["unimenuminus"])
- if (ui_block > 1)
+ if(href_list["unimenuminus"])
+ if(ui_block > 1)
ui_block--
else
ui_block = 13
dopage(src,"screen=unimenu")
- if (href_list["unimenusubplus"])
- if (subblock < 3)
+ if(href_list["unimenusubplus"])
+ if(subblock < 3)
subblock++
else
subblock = 1
dopage(src,"screen=unimenu")
- if (href_list["unimenusubminus"])
- if (subblock > 1)
+ if(href_list["unimenusubminus"])
+ if(subblock > 1)
subblock--
else
subblock = 3
dopage(src,"screen=unimenu")
- if (href_list["unimenutargetplus"])
- if (unitarget < 15)
+ if(href_list["unimenutargetplus"])
+ if(unitarget < 15)
unitarget++
unitargethex = unitarget
switch(unitarget)
@@ -663,8 +663,8 @@
unitarget = 0
unitargethex = 0
dopage(src,"screen=unimenu")
- if (href_list["unimenutargetminus"])
- if (unitarget > 0)
+ if(href_list["unimenutargetminus"])
+ if(unitarget > 0)
unitarget--
unitargethex = unitarget
switch(unitarget)
@@ -682,15 +682,15 @@
unitarget = 15
unitargethex = "F"
dopage(src,"screen=unimenu")
- if (href_list["uimenuset"] && href_list["uimenusubset"]) // This chunk of code updates selected block / sub-block based on click
+ if(href_list["uimenuset"] && href_list["uimenusubset"]) // This chunk of code updates selected block / sub-block based on click
var/menuset = text2num(href_list["uimenuset"])
var/menusubset = text2num(href_list["uimenusubset"])
- if ((menuset <= 13) && (menuset >= 1))
+ if((menuset <= 13) && (menuset >= 1))
ui_block = menuset
- if ((menusubset <= 3) && (menusubset >= 1))
+ if((menusubset <= 3) && (menusubset >= 1))
subblock = menusubset
dopage(src, "unimenu")
- if (href_list["unipulse"])
+ if(href_list["unipulse"])
if(scanner.occupant)
var/block
var/newblock
@@ -703,22 +703,22 @@
var/lock_state = scanner.locked
scanner.locked = 1//lock it
sleep(10*radduration)
- if (!scanner.occupant)
+ if(!scanner.occupant)
temp_html = null
return null
///
- if (prob((80 + (radduration / 2))))
+ if(prob((80 + (radduration / 2))))
block = miniscrambletarget(num2text(unitarget), radstrength, radduration)
newblock = null
- if (subblock == 1) newblock = block + getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),2,1) + getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),3,1)
- if (subblock == 2) newblock = getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),1,1) + block + getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),3,1)
- if (subblock == 3) newblock = getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),1,1) + getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),2,1) + block
+ if(subblock == 1) newblock = block + getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),2,1) + getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),3,1)
+ if(subblock == 2) newblock = getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),1,1) + block + getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),3,1)
+ if(subblock == 3) newblock = getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),1,1) + getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),2,1) + block
tstructure2 = setblock(scanner.occupant.dna.uni_identity, ui_block, newblock,3)
scanner.occupant.dna.uni_identity = tstructure2
updateappearance(scanner.occupant,scanner.occupant.dna.uni_identity)
scanner.occupant.apply_effect(radstrength+radduration, IRRADIATE)
else
- if (prob(20+radstrength))
+ if(prob(20+radstrength))
randmutb(scanner.occupant)
domutcheck(scanner.occupant,scanner)
else
@@ -729,61 +729,61 @@
dopage(src,"screen=unimenu")
////////////////////////////////////////////////////////
- if (href_list["rejuv"])
+ if(href_list["rejuv"])
if(!viable_occupant)
temp_html = text("No viable occupant detected.")
popup.set_content(temp_html)
popup.open()
else
if(human_occupant)
- if (human_occupant.reagents.get_reagent_amount("inaprovaline") < REJUVENATORS_MAX)
- if (human_occupant.reagents.get_reagent_amount("inaprovaline") < (REJUVENATORS_MAX - REJUVENATORS_INJECT))
+ if(human_occupant.reagents.get_reagent_amount("inaprovaline") < REJUVENATORS_MAX)
+ if(human_occupant.reagents.get_reagent_amount("inaprovaline") < (REJUVENATORS_MAX - REJUVENATORS_INJECT))
human_occupant.reagents.add_reagent("inaprovaline", REJUVENATORS_INJECT)
else
human_occupant.reagents.add_reagent("inaprovaline", round(REJUVENATORS_MAX - human_occupant.reagents.get_reagent_amount("inaprovaline")))
// to_chat(usr, text("Occupant now has [] units of rejuvenation in his/her bloodstream.", human_occupant.reagents.get_reagent_amount("inaprovaline")))
////////////////////////////////////////////////////////
- if (href_list["strucmenuplus"])
- if (se_block < 14)
+ if(href_list["strucmenuplus"])
+ if(se_block < 14)
se_block++
else
se_block = 1
dopage(src,"screen=strucmenu")
- if (href_list["strucmenuminus"])
- if (se_block > 1)
+ if(href_list["strucmenuminus"])
+ if(se_block > 1)
se_block--
else
se_block = 14
dopage(src,"screen=strucmenu")
- if (href_list["strucmenusubplus"])
- if (subblock < 3)
+ if(href_list["strucmenusubplus"])
+ if(subblock < 3)
subblock++
else
subblock = 1
dopage(src,"screen=strucmenu")
- if (href_list["strucmenusubminus"])
- if (subblock > 1)
+ if(href_list["strucmenusubminus"])
+ if(subblock > 1)
subblock--
else
subblock = 3
dopage(src,"screen=strucmenu")
- if (href_list["semenuset"] && href_list["semenusubset"]) // This chunk of code updates selected block / sub-block based on click (se stands for strutural enzymes)
+ if(href_list["semenuset"] && href_list["semenusubset"]) // This chunk of code updates selected block / sub-block based on click (se stands for strutural enzymes)
var/menuset = text2num(href_list["semenuset"])
var/menusubset = text2num(href_list["semenusubset"])
- if ((menuset <= 14) && (menuset >= 1))
+ if((menuset <= 14) && (menuset >= 1))
se_block = menuset
- if ((menusubset <= 3) && (menusubset >= 1))
+ if((menusubset <= 3) && (menusubset >= 1))
subblock = menusubset
dopage(src, "strucmenu")
- if (href_list["strucpulse"])
+ if(href_list["strucpulse"])
var/block
var/newblock
var/tstructure2
var/oldblock
var/lock_state = scanner.locked
scanner.locked = 1//lock it
- if (viable_occupant)
+ if(viable_occupant)
block = getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),subblock,1)
temp_html = text("Working ... Please wait ([] Seconds)", radduration)
@@ -795,18 +795,18 @@
return null
///
if(viable_occupant)
- if (prob((80 + (radduration / 2))))
- if ((se_block != 2 || se_block != 12 || se_block != 8 || se_block || 10) && prob (20))
+ if(prob((80 + (radduration / 2))))
+ if((se_block != 2 || se_block != 12 || se_block != 8 || se_block || 10) && prob (20))
oldblock = se_block
block = miniscramble(block, radstrength, radduration)
newblock = null
- if (se_block > 1 && se_block < 5)
+ if(se_block > 1 && se_block < 5)
se_block++
- else if (se_block > 5 && se_block < 14)
+ else if(se_block > 5 && se_block < 14)
se_block--
- if (subblock == 1) newblock = block + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),2,1) + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),3,1)
- if (subblock == 2) newblock = getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),1,1) + block + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),3,1)
- if (subblock == 3) newblock = getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),1,1) + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),2,1) + block
+ if(subblock == 1) newblock = block + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),2,1) + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),3,1)
+ if(subblock == 2) newblock = getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),1,1) + block + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),3,1)
+ if(subblock == 3) newblock = getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),1,1) + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),2,1) + block
tstructure2 = setblock(scanner.occupant.dna.struc_enzymes, se_block, newblock,3)
scanner.occupant.dna.struc_enzymes = tstructure2
domutcheck(scanner.occupant,scanner)
@@ -816,15 +816,15 @@
//
block = miniscramble(block, radstrength, radduration)
newblock = null
- if (subblock == 1) newblock = block + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),2,1) + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),3,1)
- if (subblock == 2) newblock = getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),1,1) + block + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),3,1)
- if (subblock == 3) newblock = getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),1,1) + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),2,1) + block
+ if(subblock == 1) newblock = block + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),2,1) + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),3,1)
+ if(subblock == 2) newblock = getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),1,1) + block + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),3,1)
+ if(subblock == 3) newblock = getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),1,1) + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),2,1) + block
tstructure2 = setblock(scanner.occupant.dna.struc_enzymes, se_block, newblock,3)
scanner.occupant.dna.struc_enzymes = tstructure2
domutcheck(scanner.occupant,scanner)
scanner.occupant.apply_effect(radstrength+radduration, IRRADIATE)
else
- if (prob(80-radduration))
+ if(prob(80-radduration))
randmutb(scanner.occupant)
domutcheck(scanner.occupant,scanner)
else
@@ -836,21 +836,21 @@
dopage(src,"screen=strucmenu")
////////////////////////////////////////////////////////
- if (href_list["b1addui"])
+ if(href_list["b1addui"])
if(scanner.occupant && scanner.occupant.dna)
buffer1iue = 0
buffer1 = scanner.occupant.dna.uni_identity
- if (!istype(scanner.occupant,/mob/living/carbon/human))
+ if(!istype(scanner.occupant,/mob/living/carbon/human))
buffer1owner = scanner.occupant.name
else
buffer1owner = scanner.occupant.real_name
buffer1label = "Unique Identifier"
buffer1type = "ui"
dopage(src,"screen=buffermenu")
- if (href_list["b1adduiue"])
+ if(href_list["b1adduiue"])
if(scanner.occupant && scanner.occupant.dna)
buffer1 = scanner.occupant.dna.uni_identity
- if (!istype(scanner.occupant,/mob/living/carbon/human))
+ if(!istype(scanner.occupant,/mob/living/carbon/human))
buffer1owner = scanner.occupant.name
else
buffer1owner = scanner.occupant.real_name
@@ -858,10 +858,10 @@
buffer1type = "ui"
buffer1iue = 1
dopage(src,"screen=buffermenu")
- if (href_list["b2adduiue"])
+ if(href_list["b2adduiue"])
if(scanner.occupant && scanner.occupant.dna)
buffer2 = scanner.occupant.dna.uni_identity
- if (!istype(scanner.occupant,/mob/living/carbon/human))
+ if(!istype(scanner.occupant,/mob/living/carbon/human))
buffer2owner = scanner.occupant.name
else
buffer2owner = scanner.occupant.real_name
@@ -869,10 +869,10 @@
buffer2type = "ui"
buffer2iue = 1
dopage(src,"screen=buffermenu")
- if (href_list["b3adduiue"])
+ if(href_list["b3adduiue"])
if(scanner.occupant && scanner.occupant.dna)
buffer3 = scanner.occupant.dna.uni_identity
- if (!istype(scanner.occupant,/mob/living/carbon/human))
+ if(!istype(scanner.occupant,/mob/living/carbon/human))
buffer3owner = scanner.occupant.name
else
buffer3owner = scanner.occupant.real_name
@@ -880,141 +880,141 @@
buffer3type = "ui"
buffer3iue = 1
dopage(src,"screen=buffermenu")
- if (href_list["b2addui"])
+ if(href_list["b2addui"])
if(scanner.occupant && scanner.occupant.dna)
buffer2iue = 0
buffer2 = scanner.occupant.dna.uni_identity
- if (!istype(scanner.occupant,/mob/living/carbon/human))
+ if(!istype(scanner.occupant,/mob/living/carbon/human))
buffer2owner = scanner.occupant.name
else
buffer2owner = scanner.occupant.real_name
buffer2label = "Unique Identifier"
buffer2type = "ui"
dopage(src,"screen=buffermenu")
- if (href_list["b3addui"])
+ if(href_list["b3addui"])
if(scanner.occupant && scanner.occupant.dna)
buffer3iue = 0
buffer3 = scanner.occupant.dna.uni_identity
- if (!istype(scanner.occupant,/mob/living/carbon/human))
+ if(!istype(scanner.occupant,/mob/living/carbon/human))
buffer3owner = scanner.occupant.name
else
buffer3owner = scanner.occupant.real_name
buffer3label = "Unique Identifier"
buffer3type = "ui"
dopage(src,"screen=buffermenu")
- if (href_list["b1addse"])
+ if(href_list["b1addse"])
if(scanner.occupant && scanner.occupant.dna)
buffer1iue = 0
buffer1 = scanner.occupant.dna.struc_enzymes
- if (!istype(scanner.occupant,/mob/living/carbon/human))
+ if(!istype(scanner.occupant,/mob/living/carbon/human))
buffer1owner = scanner.occupant.name
else
buffer1owner = scanner.occupant.real_name
buffer1label = "Structural Enzymes"
buffer1type = "se"
dopage(src,"screen=buffermenu")
- if (href_list["b2addse"])
+ if(href_list["b2addse"])
if(scanner.occupant && scanner.occupant.dna)
buffer2iue = 0
buffer2 = scanner.occupant.dna.struc_enzymes
- if (!istype(scanner.occupant,/mob/living/carbon/human))
+ if(!istype(scanner.occupant,/mob/living/carbon/human))
buffer2owner = scanner.occupant.name
else
buffer2owner = scanner.occupant.real_name
buffer2label = "Structural Enzymes"
buffer2type = "se"
dopage(src,"screen=buffermenu")
- if (href_list["b3addse"])
+ if(href_list["b3addse"])
if(scanner.occupant && scanner.occupant.dna)
buffer3iue = 0
buffer3 = scanner.occupant.dna.struc_enzymes
- if (!istype(scanner.occupant,/mob/living/carbon/human))
+ if(!istype(scanner.occupant,/mob/living/carbon/human))
buffer3owner = scanner.occupant.name
else
buffer3owner = scanner.occupant.real_name
buffer3label = "Structural Enzymes"
buffer3type = "se"
dopage(src,"screen=buffermenu")
- if (href_list["b1clear"])
+ if(href_list["b1clear"])
buffer1 = null
buffer1owner = null
buffer1label = null
buffer1iue = null
dopage(src,"screen=buffermenu")
- if (href_list["b2clear"])
+ if(href_list["b2clear"])
buffer2 = null
buffer2owner = null
buffer2label = null
buffer2iue = null
dopage(src,"screen=buffermenu")
- if (href_list["b3clear"])
+ if(href_list["b3clear"])
buffer3 = null
buffer3owner = null
buffer3label = null
buffer3iue = null
dopage(src,"screen=buffermenu")
- if (href_list["b1label"])
+ if(href_list["b1label"])
buffer1label = sanitize(input("New Label:","Edit Label","Infos here"))
dopage(src,"screen=buffermenu")
- if (href_list["b2label"])
+ if(href_list["b2label"])
buffer2label = sanitize(input("New Label:","Edit Label","Infos here"))
dopage(src,"screen=buffermenu")
- if (href_list["b3label"])
+ if(href_list["b3label"])
buffer3label = sanitize(input("New Label:","Edit Label","Infos here"))
dopage(src,"screen=buffermenu")
- if (href_list["b1transfer"])
- if (!scanner.occupant || (NOCLONE in scanner.occupant.mutations) || !scanner.occupant.dna)
+ if(href_list["b1transfer"])
+ if(!scanner.occupant || (NOCLONE in scanner.occupant.mutations) || !scanner.occupant.dna)
return
- if (buffer1type == "ui")
- if (buffer1iue)
+ if(buffer1type == "ui")
+ if(buffer1iue)
scanner.occupant.real_name = buffer1owner
scanner.occupant.name = buffer1owner
scanner.occupant.dna.uni_identity = buffer1
updateappearance(scanner.occupant,scanner.occupant.dna.uni_identity)
- else if (buffer1type == "se")
+ else if(buffer1type == "se")
scanner.occupant.dna.struc_enzymes = buffer1
domutcheck(scanner.occupant,scanner)
temp_html = "Transfered."
scanner.occupant.apply_effect(rand(20,50), IRRADIATE)
- if (href_list["b2transfer"])
- if (!scanner.occupant || (NOCLONE in scanner.occupant.mutations) || !scanner.occupant.dna)
+ if(href_list["b2transfer"])
+ if(!scanner.occupant || (NOCLONE in scanner.occupant.mutations) || !scanner.occupant.dna)
return
- if (buffer2type == "ui")
- if (buffer2iue)
+ if(buffer2type == "ui")
+ if(buffer2iue)
scanner.occupant.real_name = buffer2owner
scanner.occupant.name = buffer2owner
scanner.occupant.dna.uni_identity = buffer2
updateappearance(scanner.occupant,scanner.occupant.dna.uni_identity)
- else if (buffer2type == "se")
+ else if(buffer2type == "se")
scanner.occupant.dna.struc_enzymes = buffer2
domutcheck(scanner.occupant,scanner)
temp_html = "Transfered."
scanner.occupant.apply_effect(rand(20,50), IRRADIATE)
- if (href_list["b3transfer"])
- if (!scanner.occupant || (NOCLONE in scanner.occupant.mutations) || !scanner.occupant.dna)
+ if(href_list["b3transfer"])
+ if(!scanner.occupant || (NOCLONE in scanner.occupant.mutations) || !scanner.occupant.dna)
return
- if (buffer3type == "ui")
- if (buffer3iue)
+ if(buffer3type == "ui")
+ if(buffer3iue)
scanner.occupant.real_name = buffer3owner
scanner.occupant.name = buffer3owner
scanner.occupant.dna.uni_identity = buffer3
updateappearance(scanner.occupant,scanner.occupant.dna.uni_identity)
- else if (buffer3type == "se")
+ else if(buffer3type == "se")
scanner.occupant.dna.struc_enzymes = buffer3
domutcheck(scanner.occupant,scanner)
temp_html = "Transfered."
scanner.occupant.apply_effect(rand(20,50), IRRADIATE)
- if (href_list["b1injector"])
- if (injectorready)
+ if(href_list["b1injector"])
+ if(injectorready)
var/obj/item/tool/medical/dnainjector/I = new /obj/item/tool/medical/dnainjector
I.dna = buffer1
I.dnatype = buffer1type
I.loc = loc
I.name += " ([buffer1label])"
- if (buffer1iue) I.ue = buffer1owner //lazy haw haw
+ if(buffer1iue) I.ue = buffer1owner //lazy haw haw
temp_html = "Injector created."
injectorready = 0
@@ -1023,14 +1023,14 @@
else
temp_html = "Replicator not ready yet."
- if (href_list["b2injector"])
- if (injectorready)
+ if(href_list["b2injector"])
+ if(injectorready)
var/obj/item/tool/medical/dnainjector/I = new /obj/item/tool/medical/dnainjector
I.dna = buffer2
I.dnatype = buffer2type
I.loc = loc
I.name += " ([buffer2label])"
- if (buffer2iue) I.ue = buffer2owner //lazy haw haw
+ if(buffer2iue) I.ue = buffer2owner //lazy haw haw
temp_html = "Injector created."
injectorready = 0
@@ -1039,14 +1039,14 @@
else
temp_html = "Replicator not ready yet."
- if (href_list["b3injector"])
- if (injectorready)
+ if(href_list["b3injector"])
+ if(injectorready)
var/obj/item/tool/medical/dnainjector/I = new /obj/item/tool/medical/dnainjector
I.dna = buffer3
I.dnatype = buffer3type
I.loc = loc
I.name += " ([buffer3label])"
- if (buffer3iue) I.ue = buffer3owner //lazy haw haw
+ if(buffer3iue) I.ue = buffer3owner //lazy haw haw
temp_html = "Injector created."
injectorready = 0
@@ -1056,11 +1056,11 @@
temp_html = "Replicator not ready yet."
////////////////////////////////////////////////////////
- if (href_list["load_disk"])
+ if(href_list["load_disk"])
var/buffernum = text2num(href_list["load_disk"])
- if ((buffernum > 3) || (buffernum < 1))
+ if((buffernum > 3) || (buffernum < 1))
return
- if ((isnull(diskette)) || (!diskette.data) || (diskette.data == ""))
+ if((isnull(diskette)) || (!diskette.data) || (diskette.data == ""))
return
switch(buffernum)
if(1)
@@ -1080,11 +1080,11 @@
buffer3owner = diskette.owner
temp_html = "Data loaded."
- if (href_list["save_disk"])
+ if(href_list["save_disk"])
var/buffernum = text2num(href_list["save_disk"])
- if ((buffernum > 3) || (buffernum < 1))
+ if((buffernum > 3) || (buffernum < 1))
return
- if ((isnull(diskette)) || (diskette.read_only))
+ if((isnull(diskette)) || (diskette.read_only))
return
switch(buffernum)
if(1)
@@ -1106,8 +1106,8 @@
diskette.owner = buffer3owner
diskette.name = "data disk - '[buffer3owner]'"
temp_html = "Data saved."
- if (href_list["eject_disk"])
- if (!diskette)
+ if(href_list["eject_disk"])
+ if(!diskette)
return
diskette.loc = get_turf(src)
diskette = null
@@ -1115,9 +1115,9 @@
temp_html = temp_header_html
switch(current_screen)
- if ("mainmenu")
+ if("mainmenu")
temp_html += "
Main Menu
"
- if (viable_occupant) //is there REALLY someone in there who can be modified?
+ if(viable_occupant) //is there REALLY someone in there who can be modified?
temp_html += text("Modify Unique Identifier ", src)
temp_html += text("Modify Structural Enzymes
"
@@ -1228,7 +1228,7 @@
var/occupant_status = "Scanner Unoccupied"
if(occupant && occupant.dna) //is there REALLY someone in there?
- if (!istype(occupant,/mob/living/carbon/human))
+ if(!istype(occupant,/mob/living/carbon/human))
sleep(1)
if(NOCLONE in occupant.mutations)
occupant_status = "Invalid DNA structure"
@@ -1246,14 +1246,14 @@
dat += "
[occupant_status][scanner_status_html]
"
var/scanner_access_text = "Lock Scanner"
- if (scanner.locked)
+ if(scanner.locked)
scanner_access_text = "Unlock Scanner"
dat += "Scan "
- if (occupant && occupant.dna)
+ if(occupant && occupant.dna)
dat += "[scanner_access_text] "
- if (human_occupant)
+ if(human_occupant)
dat += "Inject Rejuvenators "
else
dat += "Inject Rejuvenators "
@@ -1261,12 +1261,12 @@
dat += "[scanner_access_text] "
dat += "Inject Rejuvenators "
- if (!isnull(diskette))
+ if(!isnull(diskette))
dat += text("Eject Disk ", src)
dat += " "
- if (temp_html)
+ if(temp_html)
dat += temp_html
popup.set_content(dat)
diff --git a/code/modules/computer3/computers/security.dm b/code/modules/computer3/computers/security.dm
index c7eb0a8881b..d974101b33f 100644
--- a/code/modules/computer3/computers/security.dm
+++ b/code/modules/computer3/computers/security.dm
@@ -51,26 +51,27 @@
usr.set_machine(src)
scan = computer.cardslot.reader
- if (computer.cardslot.dualslot)
+ if(computer.cardslot.dualslot)
scan2 = computer.cardslot.writer
if(!interactable())
return
- if (computer.z > 6)
- to_chat(usr, "\red Unable to establish a connection: \black You're too far away from the station!")
+ // TODO: Tie into space manager
+ if(computer.z > ZLEVEL_DERELICT)
+ to_chat(usr, "Unable to establish a connection: You're too far away from the station!")
return
var/dat
- if (temp)
+ if(temp)
dat = text("[]
"
@@ -538,7 +535,7 @@ What a mess.*/
if("rank")
var/list/L = list( "Head of Personnel", "Captain", "AI" )
//This was so silly before the change. Now it actually works without beating your head against the keyboard. /N
- if ((istype(active1, /datum/data/record) && L.Find(rank)))
+ if((istype(active1, /datum/data/record) && L.Find(rank)))
temp = "
Rank:
"
temp += "
"
for(var/rank in joblist)
@@ -547,9 +544,9 @@ What a mess.*/
else
alert(usr, "You do not have the required rank to do this!")
if("species")
- if (istype(active1, /datum/data/record))
+ if(istype(active1, /datum/data/record))
var/t1 = sanitize(copytext(input("Please enter race:", "General records", active1.fields["species"], null) as message,1,MAX_MESSAGE_LEN))
- if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active1 != a1))
+ if((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return
active1.fields["species"] = t1
@@ -557,14 +554,14 @@ What a mess.*/
else//To properly clear as per clear screen.
temp=null
switch(href_list["choice"])
- if ("Change Rank")
- if (active1)
+ if("Change Rank")
+ if(active1)
active1.fields["rank"] = href_list["rank"]
if(href_list["rank"] in joblist)
active1.fields["real_rank"] = href_list["real_rank"]
- if ("Change Criminal Status")
- if (active2)
+ if("Change Criminal Status")
+ if(active2)
switch(href_list["criminal2"])
if("none")
@@ -580,18 +577,18 @@ What a mess.*/
for(var/mob/living/carbon/human/H in mob_list)
H.sec_hud_set_security_status()
- if ("Delete Record (Security) Execute")
- if (active2)
+ if("Delete Record (Security) Execute")
+ if(active2)
qdel(active2)
- if ("Delete Record (ALL) Execute")
- if (active1)
+ if("Delete Record (ALL) Execute")
+ if(active1)
for(var/datum/data/record/R in data_core.medical)
- if ((R.fields["name"] == active1.fields["name"] || R.fields["id"] == active1.fields["id"]))
+ if((R.fields["name"] == active1.fields["name"] || R.fields["id"] == active1.fields["id"]))
qdel(R)
else
qdel(active1)
- if (active2)
+ if(active2)
qdel(active2)
else
temp = "This function does not appear to be working at the moment. Our apologies."
diff --git a/code/modules/computer3/computers/shuttle.dm b/code/modules/computer3/computers/shuttle.dm
deleted file mode 100644
index 236de564868..00000000000
--- a/code/modules/computer3/computers/shuttle.dm
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- This may not migrate to C3. It's basically a machine in the guise of a computer;
- there is nothing interactive about it.
-*/
-
-/obj/machinery/computer3/shuttle
- name = "Shuttle"
- desc = "For shuttle control."
- icon_state = "shuttle"
- var/auth_need = 3.0
- var/list/authorized = list( )
-
-
- attackby(var/obj/item/card/W as obj, var/mob/user as mob, params)
- if(stat & (BROKEN|NOPOWER)) return
- if ((!( istype(W, /obj/item/card) ) || !( ticker ) || emergency_shuttle.location != 1 || !( user ))) return
- if (istype(W, /obj/item/card/id)||istype(W, /obj/item/device/pda))
- if (istype(W, /obj/item/device/pda))
- var/obj/item/device/pda/pda = W
- W = pda.id
- if (!W:access) //no access
- to_chat(user, "The access level of [W:registered_name]\'s card is not high enough. ")
- return
-
- var/list/cardaccess = W:access
- if(!istype(cardaccess, /list) || !cardaccess.len) //no access
- to_chat(user, "The access level of [W:registered_name]\'s card is not high enough. ")
- return
-
- if(!(access_heads in W:access)) //doesn't have this access
- to_chat(user, "The access level of [W:registered_name]\'s card is not high enough. ")
- return 0
-
- var/choice = alert(user, text("Would you like to (un)authorize a shortened launch time? [] authorization\s are still needed. Use abort to cancel all authorizations.", src.auth_need - src.authorized.len), "Shuttle Launch", "Authorize", "Repeal", "Abort")
- if(emergency_shuttle.location != 1 && user.get_active_hand() != W)
- return 0
- switch(choice)
- if("Authorize")
- src.authorized -= W:registered_name
- src.authorized += W:registered_name
- if (src.auth_need - src.authorized.len > 0)
- message_admins("[key_name_admin(user)] has authorized early shuttle launch")
- log_game("[user.ckey] has authorized early shuttle launch")
- to_chat(world, text("\blue Alert: [] authorizations needed until shuttle is launched early", src.auth_need - src.authorized.len))
- else
- message_admins("[key_name_admin(user)] has launched the shuttle")
- log_game("[user.ckey] has launched the shuttle early")
- to_chat(world, "\blue Alert: Shuttle launch time shortened to 10 seconds!")
- emergency_shuttle.online = 1
- emergency_shuttle.settimeleft(10)
- //src.authorized = null
- del(src.authorized)
- src.authorized = list( )
-
- if("Repeal")
- src.authorized -= W:registered_name
- to_chat(world, text("\blue Alert: [] authorizations needed until shuttle is launched early", src.auth_need - src.authorized.len))
-
- if("Abort")
- to_chat(world, "\blue All authorizations to shorting time for shuttle launch have been revoked!")
- src.authorized.len = 0
- src.authorized = list( )
- return
-
- emag_act(user as mob)
- if (!emagged)
- var/choice = alert(user, "Would you like to launch the shuttle?","Shuttle control", "Launch", "Cancel")
-
- if(!emagged && emergency_shuttle.location == 1)
- switch(choice)
- if("Launch")
- to_chat(world, "\blue Alert: Shuttle launch time shortened to 10 seconds!")
- emergency_shuttle.settimeleft( 10 )
- emagged = 1
- if("Cancel")
- return
diff --git a/code/modules/computer3/computers/specops_shuttle.dm b/code/modules/computer3/computers/specops_shuttle.dm
deleted file mode 100644
index 8281a30479f..00000000000
--- a/code/modules/computer3/computers/specops_shuttle.dm
+++ /dev/null
@@ -1,246 +0,0 @@
-//Config stuff
-#define SPECOPS_MOVETIME 600 //Time to station is milliseconds. 60 seconds, enough time for everyone to be on the shuttle before it leaves.
-#define SPECOPS_STATION_AREATYPE "/area/shuttle/specops/station" //Type of the spec ops shuttle area for station
-#define SPECOPS_DOCK_AREATYPE "/area/shuttle/specops/centcom" //Type of the spec ops shuttle area for dock
-
-var/specops_shuttle_moving_to_station = 0
-var/specops_shuttle_moving_to_centcom = 0
-var/specops_shuttle_at_station = 0
-var/specops_shuttle_can_send = 1
-var/specops_shuttle_time = 0
-var/specops_shuttle_timeleft = 0
-
-/obj/machinery/computer3/specops_shuttle
- name = "Spec. Ops. Shuttle Console"
- icon = 'icons/obj/computer.dmi'
- icon_state = "shuttle"
- req_access = list(access_cent_specops)
- var/temp = null
- var/hacked = 0
- var/allowedtocall = 0
-
-/proc/specops_process()
- var/area/centcom/control/cent_com = locate()//To find announcer. This area should exist for this proc to work.
- var/area/centcom/specops/special_ops = locate()//Where is the specops area located?
- var/mob/living/silicon/decoy/announcer = locate() in cent_com//We need a fake AI to announce some stuff below. Otherwise it will be wonky.
-
- var/message_tracker[] = list(0,1,2,3,5,10,30,45)//Create a a list with potential time values.
- var/message = "THE SPECIAL OPERATIONS SHUTTLE IS PREPARING FOR LAUNCH"//Initial message shown.
- if(announcer)
- announcer.say(message)
- message = "ARMORED SQUAD TAKE YOUR POSITION ON GRAVITY LAUNCH PAD"
- announcer.say(message)
-
- while(specops_shuttle_time - world.timeofday > 0)
- var/ticksleft = specops_shuttle_time - world.timeofday
-
- if(ticksleft > 1e5)
- specops_shuttle_time = world.timeofday + 10 // midnight rollover
- specops_shuttle_timeleft = (ticksleft / 10)
-
- //All this does is announce the time before launch.
- if(announcer)
- var/rounded_time_left = round(specops_shuttle_timeleft)//Round time so that it will report only once, not in fractions.
- if(rounded_time_left in message_tracker)//If that time is in the list for message announce.
- message = "ALERT: [rounded_time_left] SECOND[(rounded_time_left!=1)?"S":""] REMAIN"
- if(rounded_time_left==0)
- message = "ALERT: TAKEOFF"
- announcer.say(message)
- message_tracker -= rounded_time_left//Remove the number from the list so it won't be called again next cycle.
- //Should call all the numbers but lag could mean some issues. Oh well. Not much I can do about that.
-
- sleep(5)
-
- specops_shuttle_moving_to_station = 0
- specops_shuttle_moving_to_centcom = 0
-
- specops_shuttle_at_station = 1
- if (specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return
-
- if (!specops_can_move())
- to_chat(usr, "\red The Special Operations shuttle is unable to leave.")
- return
-
- //Begin Marauder launchpad.
- spawn(0)//So it parallel processes it.
- for(var/obj/machinery/door/poddoor/M in special_ops)
- switch(M.id)
- if("ASSAULT0")
- spawn(10)//1 second delay between each.
- M.open()
- if("ASSAULT1")
- spawn(20)
- M.open()
- if("ASSAULT2")
- spawn(30)
- M.open()
- if("ASSAULT3")
- spawn(40)
- M.open()
-
- sleep(10)
-
- var/spawn_marauder[] = new()
- for(var/obj/effect/landmark/L in landmarks_list)
- if(L.name == "Marauder Entry")
- spawn_marauder.Add(L)
- for(var/obj/effect/landmark/L in landmarks_list)
- if(L.name == "Marauder Exit")
- var/obj/effect/portal/P = new(L.loc)
- P.invisibility = 101//So it is not seen by anyone.
- P.failchance = 0//So it has no fail chance when teleporting.
- P.target = pick(spawn_marauder)//Where the marauder will arrive.
- spawn_marauder.Remove(P.target)
-
- sleep(10)
-
- for(var/obj/machinery/mass_driver/M in special_ops)
- switch(M.id)
- if("ASSAULT0")
- spawn(10)
- M.drive()
- if("ASSAULT1")
- spawn(20)
- M.drive()
- if("ASSAULT2")
- spawn(30)
- M.drive()
- if("ASSAULT3")
- spawn(40)
- M.drive()
-
- sleep(50)//Doors remain open for 5 seconds.
-
- for(var/obj/machinery/door/poddoor/M in special_ops)
- switch(M.id)//Doors close at the same time.
- if("ASSAULT0")
- spawn(0)
- M.close()
- if("ASSAULT1")
- spawn(0)
- M.close()
- if("ASSAULT2")
- spawn(0)
- M.close()
- if("ASSAULT3")
- spawn(0)
- M.close()
- special_ops.readyreset()//Reset firealarm after the team launched.
- //End Marauder launchpad.
-
- var/area/start_location = locate(/area/shuttle/specops/centcom)
- var/area/end_location = locate(/area/shuttle/specops/station)
-
- var/list/dstturfs = list()
- var/throwy = world.maxy
-
- for(var/turf/T in end_location)
- dstturfs += T
- if(T.y < throwy)
- throwy = T.y
-
- // hey you, get out of the way!
- for(var/turf/T in dstturfs)
- // find the turf to move things to
- var/turf/D = locate(T.x, throwy - 1, 1)
- //var/turf/E = get_step(D, SOUTH)
- for(var/atom/movable/AM as mob|obj in T)
- AM.Move(D)
- if(istype(T, /turf/simulated))
- del(T)
-
- start_location.move_contents_to(end_location)
-
- for(var/turf/T in get_area_turfs(end_location) )
- var/mob/M = locate(/mob) in T
- to_chat(M, "\red You have arrived to [station_name]. Commence operation!")
-
-/proc/specops_can_move()
- if(specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return 0
- else return 1
-
-/obj/machinery/computer3/specops_shuttle/attackby(I as obj, user as mob, params)
- return attack_hand(user)
-
-/obj/machinery/computer3/specops_shuttle/attack_ai(var/mob/user as mob)
- return attack_hand(user)
-
-/obj/machinery/computer3/specops_shuttle/attack_paw(var/mob/user as mob)
- return attack_hand(user)
-
-/obj/machinery/computer3/specops_shuttle/attackby(I as obj, user as mob, params)
- if(istype(I,/obj/item/card/emag))
- to_chat(user, "\blue The electronic systems in this console are far too advanced for your primitive hacking peripherals.")
- else
- return attack_hand(user)
-
-/obj/machinery/computer3/specops_shuttle/attack_hand(var/mob/user as mob)
- if(!allowed(user))
- to_chat(user, "\red Access Denied.")
- return
-
- if (sent_strike_team == 0)
- to_chat(usr, "\red The strike team has not yet deployed.")
- return
-
- if(..())
- return
-
- user.set_machine(src)
- var/dat
- if (temp)
- dat = temp
- else
- dat += {"
- Location: [specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom ? "Departing for [station_name] in ([specops_shuttle_timeleft] seconds.)":specops_shuttle_at_station ? "Station":"Dock"]
- [specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom ? "\n*The Special Ops. shuttle is already leaving.* \n ":specops_shuttle_at_station ? "\nShuttle Offline \n ":"\nDepart to [station_name] \n "]
- \nClose"}
-
- //user << browse(dat, "window=computer;size=575x450")
- //onclose(user, "computer")
- var/datum/browser/popup = new(user, "computer", "Special Operations Shuttle", 575, 450)
- popup.set_content(dat)
- popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
- popup.open()
- return
-
-/obj/machinery/computer3/specops_shuttle/Topic(href, href_list)
- if(..())
- return
-
- if ((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
- usr.set_machine(src)
-
- if (href_list["sendtodock"])
- if(!specops_shuttle_at_station|| specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return
-
- to_chat(usr, "\blue Central Command will not allow the Special Operations shuttle to return.")
- return
-
- else if (href_list["sendtostation"])
- if(specops_shuttle_at_station || specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return
-
- if (!specops_can_move())
- to_chat(usr, "\red The Special Operations shuttle is unable to leave.")
- return
-
- to_chat(usr, "\blue The Special Operations shuttle will arrive on [station_name] in [(SPECOPS_MOVETIME/10)] seconds.")
-
- temp += "Shuttle departing.
OK"
- updateUsrDialog()
-
- var/area/centcom/specops/special_ops = locate()
- if(special_ops)
- special_ops.readyalert()//Trigger alarm for the spec ops area.
- specops_shuttle_moving_to_station = 1
-
- specops_shuttle_time = world.timeofday + SPECOPS_MOVETIME
- spawn(0)
- specops_process()
-
- else if (href_list["mainmenu"])
- temp = null
-
- add_fingerprint(usr)
- updateUsrDialog()
- return
\ No newline at end of file
diff --git a/code/modules/computer3/computers/station_alert.dm b/code/modules/computer3/computers/station_alert.dm
index 850bfc83c5b..f026f36a8bb 100644
--- a/code/modules/computer3/computers/station_alert.dm
+++ b/code/modules/computer3/computers/station_alert.dm
@@ -16,18 +16,18 @@
return
var/dat = "Current Station Alerts\n"
dat += "Close
"
- for (var/cat in src.alarms)
+ for(var/cat in src.alarms)
dat += text("[] \n", cat)
var/list/L = src.alarms[cat]
- if (L.len)
- for (var/alarm in L)
+ if(L.len)
+ for(var/alarm in L)
var/list/alm = L[alarm]
var/area/A = alm[1]
var/list/sources = alm[3]
dat += ""
dat += "• "
dat += "[A.name]"
- if (sources.len > 1)
+ if(sources.len > 1)
dat += text(" - [] sources", sources.len)
dat += " \n"
else
@@ -49,20 +49,20 @@
proc/triggerAlarm(var/class, area/A, var/O, var/alarmsource)
var/list/L = src.alarms[class]
- for (var/I in L)
- if (I == A.name)
+ for(var/I in L)
+ if(I == A.name)
var/list/alarm = L[I]
var/list/sources = alarm[3]
- if (!(alarmsource in sources))
+ if(!(alarmsource in sources))
sources += alarmsource
return 1
var/obj/machinery/camera/C = null
var/list/CL = null
- if (O && istype(O, /list))
+ if(O && istype(O, /list))
CL = O
- if (CL.len == 1)
+ if(CL.len == 1)
C = CL[1]
- else if (O && istype(O, /obj/machinery/camera))
+ else if(O && istype(O, /obj/machinery/camera))
C = O
L[A.name] = list(A, (C) ? C : O, list(alarmsource))
return 1
@@ -71,13 +71,13 @@
proc/cancelAlarm(var/class, area/A as area, obj/origin)
var/list/L = src.alarms[class]
var/cleared = 0
- for (var/I in L)
- if (I == A.name)
+ for(var/I in L)
+ if(I == A.name)
var/list/alarm = L[I]
var/list/srcs = alarm[3]
- if (origin in srcs)
+ if(origin in srcs)
srcs -= origin
- if (srcs.len == 0)
+ if(srcs.len == 0)
cleared = 1
L -= I
return !cleared
@@ -86,7 +86,7 @@
process()
var/active_alarms = 0
- for (var/cat in src.alarms)
+ for(var/cat in src.alarms)
var/list/L = src.alarms[cat]
if(L.len) active_alarms = 1
if(active_alarms)
diff --git a/code/modules/computer3/computers/syndicate_shuttle.dm b/code/modules/computer3/computers/syndicate_shuttle.dm
deleted file mode 100644
index 5585f4fff0a..00000000000
--- a/code/modules/computer3/computers/syndicate_shuttle.dm
+++ /dev/null
@@ -1,103 +0,0 @@
-#define SYNDICATE_SHUTTLE_MOVE_TIME 240
-#define SYNDICATE_SHUTTLE_COOLDOWN 200
-
-/obj/machinery/computer3/syndicate_station
- name = "syndicate shuttle terminal"
- icon = 'icons/obj/computer.dmi'
- icon_state = "syndishuttle"
- req_access = list(access_syndicate)
- var/area/curr_location
- var/moving = 0
- var/lastMove = 0
-
-
-/obj/machinery/computer3/syndicate_station/New()
- curr_location= locate(/area/syndicate_station/start)
-
-
-/obj/machinery/computer3/syndicate_station/proc/syndicate_move_to(area/destination as area)
- if(moving) return
- if(lastMove + SYNDICATE_SHUTTLE_COOLDOWN > world.time) return
- var/area/dest_location = locate(destination)
- if(curr_location == dest_location) return
-
- moving = 1
- lastMove = world.time
-
- if(curr_location.z != dest_location.z)
- var/area/transit_location = locate(/area/syndicate_station/transit)
- curr_location.move_contents_to(transit_location)
- curr_location = transit_location
- sleep(SYNDICATE_SHUTTLE_MOVE_TIME)
-
- curr_location.move_contents_to(dest_location)
- curr_location = dest_location
- moving = 0
- return 1
-
-
-/obj/machinery/computer3/syndicate_station/attackby(obj/item/I as obj, mob/user as mob, params)
- return attack_hand(user)
-
-/obj/machinery/computer3/syndicate_station/attack_ai(mob/user as mob)
- return attack_hand(user)
-
-/obj/machinery/computer3/syndicate_station/attack_paw(mob/user as mob)
- return attack_hand(user)
-
-/obj/machinery/computer3/syndicate_station/attack_hand(mob/user as mob)
- if(!allowed(user))
- to_chat(user, "\red Access Denied")
- return
-
- user.set_machine(src)
-
- var/dat = {"Location: [curr_location]
- Ready to move[max(lastMove + SYNDICATE_SHUTTLE_COOLDOWN - world.time, 0) ? " in [max(round((lastMove + SYNDICATE_SHUTTLE_COOLDOWN - world.time) * 0.1), 0)] seconds" : ": now"]
- Syndicate Space
- North West of SS13 |
- North of SS13 |
- North East of SS13
- South West of SS13 |
- South of SS13 |
- South East of SS13
- North East of the Mining Asteroid
- Close"}
-
- user << browse(dat, "window=computer;size=575x450")
- onclose(user, "computer")
- return
-
-
-/obj/machinery/computer3/syndicate_station/Topic(href, href_list)
- if(!isliving(usr)) return
- var/mob/living/user = usr
-
- if(in_range(src, user) || istype(user, /mob/living/silicon))
- user.set_machine(src)
-
- if(href_list["syndicate"])
- syndicate_move_to(/area/syndicate_station/start)
- else if(href_list["station_nw"])
- syndicate_move_to(/area/syndicate_station/northwest)
- else if(href_list["station_n"])
- syndicate_move_to(/area/syndicate_station/north)
- else if(href_list["station_ne"])
- syndicate_move_to(/area/syndicate_station/northeast)
- else if(href_list["station_sw"])
- syndicate_move_to(/area/syndicate_station/southwest)
- else if(href_list["station_s"])
- syndicate_move_to(/area/syndicate_station/south)
- else if(href_list["station_se"])
- syndicate_move_to(/area/syndicate_station/southeast)
-// else if(href_list["commssat"])
-// syndicate_move_to(/area/syndicate_station/commssat)
- else if(href_list["mining"])
- syndicate_move_to(/area/syndicate_station/mining)
-
- add_fingerprint(usr)
- updateUsrDialog()
- return
-
-/obj/machinery/computer3/syndicate_station/bullet_act(var/obj/item/projectile/Proj)
- visible_message("[Proj] ricochets off [src]!") //let's not let them fuck themselves in the rear
\ No newline at end of file
diff --git a/code/modules/computer3/computers/syndicate_specops_shuttle.dm b/code/modules/computer3/computers/syndicate_specops_shuttle.dm
deleted file mode 100644
index f490cd3c822..00000000000
--- a/code/modules/computer3/computers/syndicate_specops_shuttle.dm
+++ /dev/null
@@ -1,259 +0,0 @@
-//Config stuff
-#define SYNDICATE_ELITE_MOVETIME 600 //Time to station is deciseconds. 60 seconds, enough time for everyone to be on the shuttle before it leaves.
-#define SYNDICATE_ELITE_STATION_AREATYPE "/area/shuttle/syndicate_elite/station" //Type of the spec ops shuttle area for station
-#define SYNDICATE_ELITE_DOCK_AREATYPE "/area/shuttle/syndicate_elite/mothership" //Type of the spec ops shuttle area for dock
-
-var/syndicate_elite_shuttle_moving_to_station = 0
-var/syndicate_elite_shuttle_moving_to_mothership = 0
-var/syndicate_elite_shuttle_at_station = 0
-var/syndicate_elite_shuttle_can_send = 1
-var/syndicate_elite_shuttle_time = 0
-var/syndicate_elite_shuttle_timeleft = 0
-
-/obj/machinery/computer3/syndicate_elite_shuttle
- name = "Elite Syndicate Squad Shuttle Console"
- icon = 'icons/obj/computer.dmi'
- icon_state = "syndishuttle"
- req_access = list(access_cent_specops)
- var/temp = null
- var/hacked = 0
- var/allowedtocall = 0
-
-/proc/syndicate_elite_process()
- var/area/syndicate_mothership/control/syndicate_ship = locate()//To find announcer. This area should exist for this proc to work.
- var/area/syndicate_mothership/elite_squad/elite_squad = locate()//Where is the specops area located?
- var/mob/living/silicon/decoy/announcer = locate() in syndicate_ship//We need a fake AI to announce some stuff below. Otherwise it will be wonky.
-
- var/message_tracker[] = list(0,1,2,3,5,10,30,45)//Create a a list with potential time values.
- var/message = "THE SYNDICATE ELITE SHUTTLE IS PREPARING FOR LAUNCH"//Initial message shown.
- if(announcer)
- announcer.say(message)
- // message = "ARMORED SQUAD TAKE YOUR POSITION ON GRAVITY LAUNCH PAD"
- // announcer.say(message)
-
- while(syndicate_elite_shuttle_time - world.timeofday > 0)
- var/ticksleft = syndicate_elite_shuttle_time - world.timeofday
-
- if(ticksleft > 1e5)
- syndicate_elite_shuttle_time = world.timeofday // midnight rollover
- syndicate_elite_shuttle_timeleft = (ticksleft / 10)
-
- //All this does is announce the time before launch.
- if(announcer)
- var/rounded_time_left = round(syndicate_elite_shuttle_timeleft)//Round time so that it will report only once, not in fractions.
- if(rounded_time_left in message_tracker)//If that time is in the list for message announce.
- message = "ALERT: [rounded_time_left] SECOND[(rounded_time_left!=1)?"S":""] REMAIN"
- if(rounded_time_left==0)
- message = "ALERT: TAKEOFF"
- announcer.say(message)
- message_tracker -= rounded_time_left//Remove the number from the list so it won't be called again next cycle.
- //Should call all the numbers but lag could mean some issues. Oh well. Not much I can do about that.
-
- sleep(5)
-
- syndicate_elite_shuttle_moving_to_station = 0
- syndicate_elite_shuttle_moving_to_mothership = 0
-
- syndicate_elite_shuttle_at_station = 1
- if (syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return
-
- if (!syndicate_elite_can_move())
- to_chat(usr, "\red The Syndicate Elite shuttle is unable to leave.")
- return
-
- sleep(600)
-/*
- //Begin Marauder launchpad.
- spawn(0)//So it parallel processes it.
- for(var/obj/machinery/door/poddoor/M in elite_squad)
- switch(M.id)
- if("ASSAULT0")
- spawn(10)//1 second delay between each.
- M.open()
- if("ASSAULT1")
- spawn(20)
- M.open()
- if("ASSAULT2")
- spawn(30)
- M.open()
- if("ASSAULT3")
- spawn(40)
- M.open()
-
- sleep(10)
-
- var/spawn_marauder[] = new()
- for(var/obj/effect/landmark/L in landmarks_list)
- if(L.name == "Marauder Entry")
- spawn_marauder.Add(L)
- for(var/obj/effect/landmark/L in landmarks_list)
- if(L.name == "Marauder Exit")
- var/obj/effect/portal/P = new(L.loc)
- P.invisibility = 101//So it is not seen by anyone.
- P.failchance = 0//So it has no fail chance when teleporting.
- P.target = pick(spawn_marauder)//Where the marauder will arrive.
- spawn_marauder.Remove(P.target)
-
- sleep(10)
-
- for(var/obj/machinery/mass_driver/M in elite_squad)
- switch(M.id)
- if("ASSAULT0")
- spawn(10)
- M.drive()
- if("ASSAULT1")
- spawn(20)
- M.drive()
- if("ASSAULT2")
- spawn(30)
- M.drive()
- if("ASSAULT3")
- spawn(40)
- M.drive()
-
- sleep(50)//Doors remain open for 5 seconds.
-
- for(var/obj/machinery/door/poddoor/M in elite_squad)
- switch(M.id)//Doors close at the same time.
- if("ASSAULT0")
- spawn(0)
- M.close()
- if("ASSAULT1")
- spawn(0)
- M.close()
- if("ASSAULT2")
- spawn(0)
- M.close()
- if("ASSAULT3")
- spawn(0)
- M.close()
- */
- elite_squad.readyreset()//Reset firealarm after the team launched.
- //End Marauder launchpad.
-/*
- var/obj/explosionmarker = locate("Syndicate Breach Area")
- if(explosionmarker)
- var/turf/simulated/T = explosionmarker.loc
- if(T)
- explosion(T,4,6,8,10,0)
-
- sleep(40)
-// proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1)
-
-*/
- var/area/start_location = locate(/area/shuttle/syndicate_elite/mothership)
- var/area/end_location = locate(/area/shuttle/syndicate_elite/station)
-
- var/list/dstturfs = list()
- var/throwy = world.maxy
-
- for(var/turf/T in end_location)
- dstturfs = T
- if(T.y < throwy)
- throwy = T.y
-
- // hey you, get out of the way!
- for(var/turf/T in dstturfs)
- // find the turf to move things to
- var/turf/D = locate(T.x, throwy - 1, 1)
- //var/turf/E = get_step(D, SOUTH)
- for(var/atom/movable/AM as mob|obj in T)
- AM.Move(D)
- if(istype(T, /turf/simulated))
- del(T)
-
- start_location.move_contents_to(end_location)
-
- for(var/turf/T in get_area_turfs(end_location) )
- var/mob/M = locate(/mob) in T
- to_chat(M, "\red You have arrived to [station_name]. Commence operation!")
-
-/proc/syndicate_elite_can_move()
- if(syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return 0
- else return 1
-
-/obj/machinery/computer3/syndicate_elite_shuttle/attackby(I as obj, user as mob, params)
- return attack_hand(user)
-
-/obj/machinery/computer3/syndicate_elite_shuttle/attack_ai(var/mob/user as mob)
- return attack_hand(user)
-
-/obj/machinery/computer3/syndicate_elite_shuttle/attack_paw(var/mob/user as mob)
- return attack_hand(user)
-
-/obj/machinery/computer3/syndicate_elite_shuttle/attackby(I as obj, user as mob, params)
- if(istype(I,/obj/item/card/emag))
- to_chat(user, "\blue The electronic systems in this console are far too advanced for your primitive hacking peripherals.")
- else
- return attack_hand(user)
-
-/obj/machinery/computer3/syndicate_elite_shuttle/attack_hand(var/mob/user as mob)
- if(!allowed(user))
- to_chat(user, "\red Access Denied.")
- return
-
-// if (sent_syndicate_strike_team == 0)
-// to_chat(usr, "\red The strike team has not yet deployed.")
-// return
-
- if(..())
- return
-
- user.set_machine(src)
- var/dat
- if (temp)
- dat = temp
- else
- dat = {"Location: [syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership ? "Departing for [station_name] in ([syndicate_elite_shuttle_timeleft] seconds.)":syndicate_elite_shuttle_at_station ? "Station":"Dock"]
- [syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership ? "\n*The Syndicate Elite shuttle is already leaving.* \n ":syndicate_elite_shuttle_at_station ? "\nShuttle Offline \n ":"\nDepart to [station_name] \n "]
- \nClose"}
-
- //user << browse(dat, "window=computer;size=575x450")
- //onclose(user, "computer")
- var/datum/browser/popup = new(user, "computer", "Special Operations Shuttle", 575, 450)
- popup.set_content(dat)
- popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
- popup.open()
- return
-
-/obj/machinery/computer3/syndicate_elite_shuttle/Topic(href, href_list)
- if(..())
- return
-
- if ((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
- usr.set_machine(src)
-
- if (href_list["sendtodock"])
- if(!syndicate_elite_shuttle_at_station|| syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return
-
- to_chat(usr, "\blue The Syndicate will not allow the Elite Squad shuttle to return.")
- return
-
- else if (href_list["sendtostation"])
- if(syndicate_elite_shuttle_at_station || syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return
-
- if (!specops_can_move())
- to_chat(usr, "\red The Syndicate Elite shuttle is unable to leave.")
- return
-
- to_chat(usr, "\blue The Syndicate Elite shuttle will arrive on [station_name] in [(SYNDICATE_ELITE_MOVETIME/10)] seconds.")
-
- temp = "Shuttle departing.
OK"
- updateUsrDialog()
-
- var/area/syndicate_mothership/elite_squad/elite_squad = locate()
- if(elite_squad)
- elite_squad.readyalert()//Trigger alarm for the spec ops area.
- syndicate_elite_shuttle_moving_to_station = 1
-
- syndicate_elite_shuttle_time = world.timeofday + SYNDICATE_ELITE_MOVETIME
- spawn(0)
- syndicate_elite_process()
-
-
- else if (href_list["mainmenu"])
- temp = null
-
- add_fingerprint(usr)
- updateUsrDialog()
- return
\ No newline at end of file
diff --git a/code/modules/computer3/computers/welcome.dm b/code/modules/computer3/computers/welcome.dm
index 11695ce5322..203c5922289 100644
--- a/code/modules/computer3/computers/welcome.dm
+++ b/code/modules/computer3/computers/welcome.dm
@@ -10,7 +10,6 @@
interact()
- usr.set_machine(src)
if(!interactable())
return
var/dat = ""
diff --git a/code/modules/computer3/laptop.dm b/code/modules/computer3/laptop.dm
index dd4f73914b6..e32375a457c 100644
--- a/code/modules/computer3/laptop.dm
+++ b/code/modules/computer3/laptop.dm
@@ -101,14 +101,15 @@
var/obj/item/weapon/card/id/card
if(C.reader)
card = C.reader
+ C.remove_reader(usr)
else if(C.writer)
card = C.writer
+ C.remove_writer(usr)
else
to_chat(usr, "There is nothing to remove from the laptop card port.")
return
to_chat(usr, "You remove [card] from the laptop.")
- C.remove(card)
/obj/machinery/computer3/laptop
diff --git a/code/modules/computer3/lapvend.dm b/code/modules/computer3/lapvend.dm
index 8383981046d..ee436ee3cc0 100644
--- a/code/modules/computer3/lapvend.dm
+++ b/code/modules/computer3/lapvend.dm
@@ -29,7 +29,7 @@
/obj/machinery/lapvend/blob_act()
- if (prob(50))
+ if(prob(50))
spawn(0)
qdel(src)
return
@@ -82,7 +82,7 @@
dat += "Total: [total()] "
if(cardreader == 1)
dat += "Card Reader: (single) (50) "
- else if (cardreader == 2)
+ else if(cardreader == 2)
dat += "Card Reader: (double) (125) "
else
dat += "Card Reader: None "
@@ -106,9 +106,9 @@
dat += "Network card: Powernet (25) "
else
dat += "Network card: None "
- if (power == 0)
+ if(power == 0)
dat += "Power source: Regular "
- else if (power == 1)
+ else if(power == 1)
dat += "Power source: Extended (175) "
else
dat += "Power source: Unreal (250) "
@@ -133,41 +133,41 @@
/obj/machinery/lapvend/Topic(href, href_list)
- if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))))
+ if((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))))
usr.set_machine(src)
switch(href_list["choice"])
if("single_add")
cardreader = 1
- if ("dual_add")
+ if("dual_add")
cardreader = 2
- if ("floppy_add")
+ if("floppy_add")
floppy = 1
- if ("radio_add")
+ if("radio_add")
radionet = 1
- if ("camnet_add")
+ if("camnet_add")
camera = 1
- if ("area_add")
+ if("area_add")
network = 1
- if ("prox_add")
+ if("prox_add")
network = 2
- if ("cable_add")
+ if("cable_add")
network = 3
- if ("high_add")
+ if("high_add")
power = 1
- if ("super_add")
+ if("super_add")
power = 2
- if ("single_rem" || "dual_rem")
+ if("single_rem" || "dual_rem")
cardreader = 0
- if ("floppy_rem")
+ if("floppy_rem")
floppy = 0
- if ("radio_rem")
+ if("radio_rem")
radionet = 0
- if ("camnet_rem")
+ if("camnet_rem")
camera = 0
- if ("area_rem" || "prox_rem" || "cable_rem")
+ if("area_rem" || "prox_rem" || "cable_rem")
network = 0
- if ("high_rem" || "super_rem")
+ if("high_rem" || "super_rem")
power = 0
if("vend")
@@ -194,23 +194,23 @@
newlap.spawn_parts += (/obj/item/part/computer/networking/radio)
if(camera == 1)
newlap.spawn_parts += (/obj/item/part/computer/networking/cameras)
- if (network == 1)
+ if(network == 1)
newlap.spawn_parts += (/obj/item/part/computer/networking/area)
- if (network == 2)
+ if(network == 2)
newlap.spawn_parts += (/obj/item/part/computer/networking/prox)
- if (network == 3)
+ if(network == 3)
newlap.spawn_parts += (/obj/item/part/computer/networking/cable)
- if (power == 1)
+ if(power == 1)
qdel(newlap.battery)
newlap.battery = new /obj/item/weapon/stock_parts/cell/high(newlap)
- if (power == 2)
+ if(power == 2)
qdel(newlap.battery)
newlap.battery = new /obj/item/weapon/stock_parts/cell/super(newlap)
newlap.spawn_parts()
/obj/machinery/lapvend/proc/scan_card(var/obj/item/weapon/card/I)
- if (istype(I, /obj/item/weapon/card/id))
+ if(istype(I, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = I
visible_message("[usr] swipes a card through [src].")
if(vendor_account)
@@ -262,11 +262,11 @@
network = 0
power = 0
else
- to_chat(usr, "\icon[src]You don't have that much money!")
+ to_chat(usr, "[bicon(src)]You don't have that much money!")
else
- to_chat(usr, "\icon[src]Unable to access account. Check security settings and try again.")
+ to_chat(usr, "[bicon(src)]Unable to access account. Check security settings and try again.")
else
- to_chat(usr, "\icon[src]Unable to access vendor account. Please record the machine ID and call CentComm Support.")
+ to_chat(usr, "[bicon(src)]Unable to access vendor account. Please record the machine ID and call CentComm Support.")
/obj/machinery/lapvend/proc/total()
var/total = 0
@@ -312,7 +312,7 @@
newlap.spawn_files += (/datum/file/program/communications)
if((access_medical in C.access) || (access_forensics_lockers in C.access)) //Gives detective the medical records program, but not the crew monitoring one.
newlap.spawn_files += (/datum/file/program/med_data)
- if (access_medical in C.access)
+ if(access_medical in C.access)
newlap.spawn_files += (/datum/file/program/crew)
if(access_engine in C.access)
newlap.spawn_files += (/datum/file/program/powermon)
@@ -359,7 +359,7 @@
/obj/machinery/lapvend/proc/reimburse(var/obj/item/weapon/card/I)
- if (istype(I, /obj/item/weapon/card/id))
+ if(istype(I, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = I
visible_message("[usr] swipes a card through [src].")
if(vendor_account)
@@ -405,6 +405,6 @@
power = 0
else
- to_chat(usr, "\icon[src]Unable to access account. Check security settings and try again.")
+ to_chat(usr, "[bicon(src)]Unable to access account. Check security settings and try again.")
else
- to_chat(usr, "\icon[src]Unable to access vendor account. Please record the machine ID and call CentComm Support.")
+ to_chat(usr, "[bicon(src)]Unable to access vendor account. Please record the machine ID and call CentComm Support.")
diff --git a/code/modules/computer3/networking.dm b/code/modules/computer3/networking.dm
index f31f4516c2c..0fc1c966d1c 100644
--- a/code/modules/computer3/networking.dm
+++ b/code/modules/computer3/networking.dm
@@ -105,6 +105,7 @@
for(var/obj/O in radio_connection.devices)
if(istype(O,typekey))
T = get_turf(O)
+ // TODO: Tie into space manager
if(istype(O) && (subspace || (O.z == z_level))) // radio does not work across z-levels
result |= O
return result
@@ -232,4 +233,3 @@
if(C.d1 == 0 && (C.powernet == P))
return 1
return 0
-
diff --git a/code/modules/crafting/craft.dm b/code/modules/crafting/craft.dm
new file mode 100644
index 00000000000..d2b0da70ebe
--- /dev/null
+++ b/code/modules/crafting/craft.dm
@@ -0,0 +1,339 @@
+/datum/personal_crafting
+ var/busy
+ var/viewing_category = 1 //typical powergamer starting on the Weapons tab
+ var/list/categories = list(CAT_WEAPON,CAT_AMMO,CAT_ROBOT,CAT_FOOD,CAT_MISC,CAT_PRIMAL)
+
+
+
+
+
+/* This is what procs do:
+ get_environment - gets a list of things accessable for crafting by user
+ get_surroundings - takes a list of things and makes a list of key-types to values-amounts of said type in the list
+ check_contents - takes a recipe and a key-type list and checks if said recipe can be done with available stuff
+ check_tools - takes recipe, a key-type list, and a user and checks if there are enough tools to do the stuff, checks bugs one level deep
+ construct_item - takes a recipe and a user, call all the checking procs, calls do_after, checks all the things again, calls del_reqs, creates result, calls CheckParts of said result with argument being list returned by deel_reqs
+ del_reqs - takes recipe and a user, loops over the recipes reqs var and tries to find everything in the list make by get_environment and delete it/add to parts list, then returns the said list
+*/
+
+
+
+
+/datum/personal_crafting/proc/check_contents(datum/crafting_recipe/R, list/contents)
+ main_loop:
+ for(var/A in R.reqs)
+ var/needed_amount = R.reqs[A]
+ for(var/B in contents)
+ if(ispath(B, A))
+ if(contents[B] >= R.reqs[A])
+ continue main_loop
+ else
+ needed_amount -= contents[B]
+ if(needed_amount <= 0)
+ continue main_loop
+ else
+ continue
+ return 0
+ for(var/A in R.chem_catalists)
+ if(contents[A] < R.chem_catalists[A])
+ return 0
+ return 1
+
+/datum/personal_crafting/proc/get_environment(mob/user)
+ . = list()
+ . += user.r_hand
+ . += user.l_hand
+ if(!isturf(user.loc))
+ return
+ var/list/L = block(get_step(user, SOUTHWEST), get_step(user, NORTHEAST))
+ for(var/A in L)
+ var/turf/T = A
+ if(T.Adjacent(user))
+ . += T.contents
+
+
+/datum/personal_crafting/proc/get_surroundings(mob/user)
+ . = list()
+ for(var/obj/item/I in get_environment(user))
+ if(istype(I, /obj/item/stack))
+ var/obj/item/stack/S = I
+ .[I.type] += S.amount
+ else
+ if(istype(I, /obj/item/weapon/reagent_containers))
+ var/obj/item/weapon/reagent_containers/RC = I
+ if(RC.flags & OPENCONTAINER)
+ for(var/datum/reagent/A in RC.reagents.reagent_list)
+ .[A.type] += A.volume
+ .[I.type] += 1
+
+/datum/personal_crafting/proc/check_tools(mob/user, datum/crafting_recipe/R, list/contents)
+ if(!R.tools.len)
+ return 1
+ var/list/possible_tools = list()
+ for(var/obj/item/I in user.contents)
+ if(istype(I, /obj/item/weapon/storage))
+ for(var/obj/item/SI in I.contents)
+ possible_tools += SI.type
+ possible_tools += I.type
+ possible_tools += contents
+
+ main_loop:
+ for(var/A in R.tools)
+ for(var/I in possible_tools)
+ if(ispath(I,A))
+ continue main_loop
+ return 0
+ return 1
+
+/datum/personal_crafting/proc/construct_item(mob/user, datum/crafting_recipe/R)
+ for(var/A in R.parts)
+ var/list/contents = get_surroundings(user)
+ var/send_feedback = 1
+ if(check_contents(R, contents))
+ if(check_tools(user, R, contents))
+ if(do_after(user, R.time, target = user))
+ contents = get_surroundings(user)
+ if(!check_contents(R, contents))
+ return ", missing component."
+ if(!check_tools(user, R, contents))
+ return ", missing tool."
+ var/list/parts = del_reqs(R, user)
+ var/atom/movable/I = new R.result (get_turf(user.loc))
+ I.CheckParts(parts, R)
+ if(send_feedback)
+ feedback_add_details("object_crafted","[I.type]")
+ return 0
+ return "."
+ return ", missing tool."
+ return ", missing component."
+
+
+/*Del reqs works like this:
+ Loop over reqs var of the recipe
+ Set var amt to the value current cycle req is pointing to, its amount of type we need to delete
+ Get var/surroundings list of things accessable to crafting by get_environment()
+ Check the type of the current cycle req
+ If its reagent then do a while loop, inside it try to locate() reagent containers, inside such containers try to locate needed reagent, if there isnt remove thing from surroundings
+ If there is enough reagent in the search result then delete the needed amount, create the same type of reagent with the same data var and put it into deletion list
+ If there isnt enough take all of that reagent from the container, put into deletion list, substract the amt var by the volume of reagent, remove the container from surroundings list and keep searching
+ While doing above stuff check deletion list if it already has such reagnet, if yes merge instead of adding second one
+ If its stack check if it has enough amount
+ If yes create new stack with the needed amount and put in into deletion list, substract taken amount from the stack
+ If no put all of the stack in the deletion list, substract its amount from amt and keep searching
+ While doing above stuff check deletion list if it already has such stack type, if yes try to merge them instead of adding new one
+ If its anything else just locate() in in the list in a while loop, each find --s the amt var and puts the found stuff in deletion loop
+ Then do a loop over parts var of the recipe
+ Do similar stuff to what we have done above, but now in deletion list, until the parts conditions are satisfied keep taking from the deletion list and putting it into parts list for return
+ After its done loop over deletion list and delete all the shit that wasnt taken by parts loop
+ del_reqs return the list of parts resulting object will recieve as argument of CheckParts proc, on the atom level it will add them all to the contents, on all other levels it calls ..() and does whatever is needed afterwards but from contents list already
+*/
+
+/datum/personal_crafting/proc/del_reqs(datum/crafting_recipe/R, mob/user)
+ var/list/surroundings
+ var/list/Deletion = list()
+ . = list()
+ var/data
+ var/amt
+ main_loop:
+ for(var/A in R.reqs)
+ amt = R.reqs[A]
+ surroundings = get_environment(user)
+ surroundings -= Deletion
+ if(ispath(A, /datum/reagent))
+ var/datum/reagent/RG = new A
+ var/datum/reagent/RGNT
+ while(amt > 0)
+ var/obj/item/weapon/reagent_containers/RC = locate() in surroundings
+ RG = RC.reagents.get_reagent(A)
+ if(RG)
+ if(!locate(RG.type) in Deletion)
+ Deletion += new RG.type()
+ if(RG.volume > amt)
+ RG.volume -= amt
+ data = RG.data
+ RC.reagents.conditional_update(RC)
+ RG = locate(RG.type) in Deletion
+ RG.volume = amt
+ RG.data += data
+ continue main_loop
+ else
+ surroundings -= RC
+ amt -= RG.volume
+ RC.reagents.reagent_list -= RG
+ RC.reagents.conditional_update(RC)
+ RGNT = locate(RG.type) in Deletion
+ RGNT.volume += RG.volume
+ RGNT.data += RG.data
+ qdel(RG)
+ else
+ surroundings -= RC
+ else if(ispath(A, /obj/item/stack))
+ var/obj/item/stack/S
+ var/obj/item/stack/SD
+ while(amt > 0)
+ S = locate(A) in surroundings
+ if(S.amount >= amt)
+ if(!locate(S.type) in Deletion)
+ SD = new S.type()
+ Deletion += SD
+ S.use(amt)
+ SD = locate(S.type) in Deletion
+ SD.amount += amt
+ continue main_loop
+ else
+ amt -= S.amount
+ if(!locate(S.type) in Deletion)
+ Deletion += S
+ else
+ data = S.amount
+ S = locate(S.type) in Deletion
+ S.amount += data
+ surroundings -= S
+ else
+ var/atom/movable/I
+ while(amt > 0)
+ I = locate(A) in surroundings
+ Deletion += I
+ surroundings -= I
+ amt--
+ var/list/partlist = list(R.parts.len)
+ for(var/M in R.parts)
+ partlist[M] = R.parts[M]
+ for(var/A in R.parts)
+ if(istype(A, /datum/reagent))
+ var/datum/reagent/RG = locate(A) in Deletion
+ if(RG.volume > partlist[A])
+ RG.volume = partlist[A]
+ . += RG
+ Deletion -= RG
+ continue
+ else if(istype(A, /obj/item/stack))
+ var/obj/item/stack/ST = locate(A) in Deletion
+ if(ST.amount > partlist[A])
+ ST.amount = partlist[A]
+ . += ST
+ Deletion -= ST
+ continue
+ else
+ while(partlist[A] > 0)
+ var/atom/movable/AM = locate(A) in Deletion
+ . += AM
+ Deletion -= AM
+ partlist[A] -= 1
+ while(Deletion.len)
+ var/DL = Deletion[Deletion.len]
+ Deletion.Cut(Deletion.len)
+ qdel(DL)
+
+/datum/personal_crafting/proc/craft(mob/user)
+ if(user.incapacitated() || user.lying || istype(user.loc, /obj/mecha))
+ return
+ var/list/surroundings = get_surroundings(user)
+ var/dat = "
Crafting menu
"
+ if(busy)
+ dat += "
Crafting in progress...
"
+ else
+ dat += "<--"
+ dat += " [categories[prev_cat()]] |"
+ dat += " [categories[viewing_category]] "
+ dat += "| [categories[next_cat()]] "
+ dat += "-->
"
+
+ dat += "
"
+
+ //Filter the recipes we can craft to the top
+ var/list/can_craft = list()
+ var/list/cant_craft = list()
+ for(var/datum/crafting_recipe/R in crafting_recipes)
+ if(R.category != categories[viewing_category])
+ continue
+ if(check_contents(R, surroundings))
+ can_craft += R
+ else
+ cant_craft += R
+
+ for(var/datum/crafting_recipe/R in can_craft)
+ dat += build_recipe_text(R, surroundings)
+ for(var/datum/crafting_recipe/R in cant_craft)
+ dat += build_recipe_text(R, surroundings)
+
+
+ dat += "
"
+
+ var/datum/browser/popup = new(user, "crafting", "Crafting", 500, 500)
+ popup.set_content(dat)
+ popup.open()
+ return
+
+/datum/personal_crafting/Topic(href, href_list)
+ if(usr.stat || usr.lying)
+ return
+ if(href_list["make"])
+ var/datum/crafting_recipe/TR = locate(href_list["make"])
+ busy = 1
+ craft(usr)
+ var/fail_msg = construct_item(usr, TR)
+ if(!fail_msg)
+ usr << "[TR.name] constructed."
+ else
+ usr << "Construction failed[fail_msg]"
+ busy = 0
+ craft(usr)
+ if(href_list["forwardCat"])
+ viewing_category = next_cat()
+ usr << "Category is now [categories[viewing_category]]."
+ craft(usr)
+ if(href_list["backwardCat"])
+ viewing_category = prev_cat()
+ usr << "Category is now [categories[viewing_category]]."
+ craft(usr)
+
+//Next works nicely with modular arithmetic
+/datum/personal_crafting/proc/next_cat()
+ . = viewing_category % categories.len + 1
+
+//Previous can go fuck itself
+/datum/personal_crafting/proc/prev_cat()
+ if(viewing_category == categories.len)
+ . = viewing_category-1
+ else
+ . = viewing_category % categories.len - 1
+ if(. <= 0)
+ . = categories.len
+
+/datum/personal_crafting/proc/build_recipe_text(datum/crafting_recipe/R, list/contents)
+ . = ""
+ var/name_text = ""
+ var/req_text = ""
+ var/tool_text = ""
+ var/catalist_text = ""
+ if(check_contents(R, contents))
+ name_text ="[R.name]"
+
+ else
+ name_text = "[R.name]"
+
+ if(name_text)
+ for(var/A in R.reqs)
+ if(ispath(A, /obj))
+ var/obj/O = A
+ req_text += " [R.reqs[A]] [initial(O.name)]"
+ else if(ispath(A, /datum/reagent))
+ var/datum/reagent/RE = A
+ req_text += " [R.reqs[A]] [initial(RE.name)]"
+
+ if(R.chem_catalists.len)
+ catalist_text += ", Catalysts:"
+ for(var/C in R.chem_catalists)
+ if(ispath(C, /datum/reagent))
+ var/datum/reagent/RE = C
+ catalist_text += " [R.chem_catalists[C]] [initial(RE.name)]"
+
+ if(R.tools.len)
+ tool_text += ", Tools:"
+ for(var/O in R.tools)
+ if(ispath(O, /obj))
+ var/obj/T = O
+ tool_text += " [R.tools[O]] [initial(T.name)]"
+
+ . = "[name_text][req_text][tool_text][catalist_text] "
diff --git a/code/modules/crafting/guncrafting.dm b/code/modules/crafting/guncrafting.dm
index 8a9d5803529..a7309803c1b 100644
--- a/code/modules/crafting/guncrafting.dm
+++ b/code/modules/crafting/guncrafting.dm
@@ -71,7 +71,7 @@
..()
if(istype(I, /obj/item/stack/packageWrap))
var/obj/item/stack/packageWrap/C = I
- if (C.use(5))
+ if(C.use(5))
var/obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised/W = new /obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised
user.unEquip(src)
user.put_in_hands(W)
diff --git a/code/modules/crafting/recipes.dm b/code/modules/crafting/recipes.dm
index c578c452bbc..6f946146aa4 100644
--- a/code/modules/crafting/recipes.dm
+++ b/code/modules/crafting/recipes.dm
@@ -1,4 +1,4 @@
-/datum/table_recipe
+/datum/crafting_recipe
var/name = "" //in-game display name
var/reqs[] = list() //type paths of items consumed associated with how many are needed
var/result //type path of item resulting from this craft
@@ -7,14 +7,15 @@
var/parts[] = list() //type paths of items that will be placed in the result
var/chem_catalists[] = list() //like tools but for reagents
var/fruit[] = list() //grown products required by the recipe
+ var/category = CAT_MISC // Recipe category
-/datum/table_recipe/proc/AdjustChems(var/obj/resultobj as obj)
+/datum/crafting_recipe/proc/AdjustChems(var/obj/resultobj as obj)
//This proc is to replace the make_food proc of recipes from microwaves and such that are being converted to table crafting recipes.
//Use it to handle the removal of reagents after the food has been created (like removing toxins from a salad made with ambrosia)
//If a recipe does not require it's chems adjusted, don't bother declaring this for the recipe, as it will call this placeholder
return
-/datum/table_recipe/IED
+/datum/crafting_recipe/IED
name = "IED"
result = /obj/item/weapon/grenade/iedcasing/filled
reqs = list(/datum/reagent/fuel = 50,
@@ -22,19 +23,47 @@
/obj/item/device/assembly/igniter = 1,
/obj/item/weapon/reagent_containers/food/drinks/cans = 1)
parts = list(/obj/item/weapon/reagent_containers/food/drinks/cans = 1)
- time = 80
+ time = 15
+ category = CAT_WEAPON
-/datum/table_recipe/stunprod
+/datum/crafting_recipe/lance
+ name = "explosive lance (grenade)"
+ result = /obj/item/weapon/twohanded/spear
+ reqs = list(/obj/item/weapon/twohanded/spear = 1,
+ /obj/item/weapon/grenade = 1)
+ parts = list(/obj/item/weapon/grenade = 1)
+ time = 15
+ category = CAT_WEAPON
+
+/datum/crafting_recipe/molotov
+ name = "Molotov"
+ result = /obj/item/weapon/reagent_containers/food/drinks/bottle/molotov
+ reqs = list(/obj/item/weapon/reagent_containers/glass/rag = 1,
+ /obj/item/weapon/reagent_containers/food/drinks/bottle = 1)
+ parts = list(/obj/item/weapon/reagent_containers/food/drinks/bottle = 1)
+ time = 40
+ category = CAT_WEAPON
+
+/datum/crafting_recipe/stunprod
name = "Stunprod"
result = /obj/item/weapon/melee/baton/cattleprod
reqs = list(/obj/item/weapon/restraints/handcuffs/cable = 1,
/obj/item/stack/rods = 1,
/obj/item/weapon/wirecutters = 1,
/obj/item/weapon/stock_parts/cell = 1)
- time = 80
+ time = 40
parts = list(/obj/item/weapon/stock_parts/cell = 1)
+ category = CAT_WEAPON
-/datum/table_recipe/ed209
+/datum/crafting_recipe/bola
+ name = "Bola"
+ result = /obj/item/weapon/restraints/legcuffs/bola
+ reqs = list(/obj/item/weapon/restraints/handcuffs/cable = 1,
+ /obj/item/stack/sheet/metal = 6)
+ time = 20//15 faster than crafting them by hand!
+ category= CAT_WEAPON
+
+/datum/crafting_recipe/ed209
name = "ED209"
result = /mob/living/simple_animal/bot/ed209
reqs = list(/obj/item/robot_parts/robot_suit = 1,
@@ -44,14 +73,15 @@
/obj/item/robot_parts/r_leg = 1,
/obj/item/stack/sheet/metal = 5,
/obj/item/stack/cable_coil = 5,
- /obj/item/weapon/gun/energy/advtaser = 1,
+ /obj/item/weapon/gun/energy/gun/advtaser = 1,
/obj/item/weapon/stock_parts/cell = 1,
/obj/item/device/assembly/prox_sensor = 1,
/obj/item/robot_parts/r_arm = 1)
tools = list(/obj/item/weapon/weldingtool, /obj/item/weapon/screwdriver)
- time = 120
+ time = 60
+ category = CAT_ROBOT
-/datum/table_recipe/secbot
+/datum/crafting_recipe/secbot
name = "Secbot"
result = /mob/living/simple_animal/bot/secbot
reqs = list(/obj/item/device/assembly/signaler = 1,
@@ -60,44 +90,51 @@
/obj/item/device/assembly/prox_sensor = 1,
/obj/item/robot_parts/r_arm = 1)
tools = list(/obj/item/weapon/weldingtool)
- time = 120
+ time = 60
+ category = CAT_ROBOT
-/datum/table_recipe/cleanbot
+/datum/crafting_recipe/cleanbot
name = "Cleanbot"
result = /mob/living/simple_animal/bot/cleanbot
reqs = list(/obj/item/weapon/reagent_containers/glass/bucket = 1,
/obj/item/device/assembly/prox_sensor = 1,
/obj/item/robot_parts/r_arm = 1)
- time = 80
+ time = 40
+ category = CAT_ROBOT
-/datum/table_recipe/floorbot
+/datum/crafting_recipe/floorbot
name = "Floorbot"
result = /mob/living/simple_animal/bot/floorbot
reqs = list(/obj/item/weapon/storage/toolbox/mechanical = 1,
/obj/item/stack/tile/plasteel = 1,
/obj/item/device/assembly/prox_sensor = 1,
/obj/item/robot_parts/r_arm = 1)
- time = 80
+ time = 40
+ category = CAT_ROBOT
-/datum/table_recipe/medbot
+/datum/crafting_recipe/medbot
name = "Medbot"
result = /mob/living/simple_animal/bot/medbot
reqs = list(/obj/item/device/healthanalyzer = 1,
/obj/item/weapon/storage/firstaid = 1,
/obj/item/device/assembly/prox_sensor = 1,
/obj/item/robot_parts/r_arm = 1)
- time = 80
+ time = 40
+ category = CAT_ROBOT
-/datum/table_recipe/flamethrower
+/datum/crafting_recipe/flamethrower
name = "Flamethrower"
result = /obj/item/weapon/flamethrower
reqs = list(/obj/item/weapon/weldingtool = 1,
/obj/item/device/assembly/igniter = 1,
- /obj/item/stack/rods = 2)
+ /obj/item/stack/rods = 1)
+ parts = list(/obj/item/device/assembly/igniter = 1,
+ /obj/item/weapon/weldingtool = 1)
tools = list(/obj/item/weapon/screwdriver)
- time = 20
+ time = 10
+ category = CAT_WEAPON
-/datum/table_recipe/meteorshot
+/datum/crafting_recipe/meteorshot
name = "Meteorshot Shell"
result = /obj/item/ammo_casing/shotgun/meteorshot
reqs = list(/obj/item/ammo_casing/shotgun/techshell = 1,
@@ -105,8 +142,9 @@
/obj/item/weapon/stock_parts/manipulator = 2)
tools = list(/obj/item/weapon/screwdriver)
time = 5
+ category = CAT_AMMO
-/datum/table_recipe/pulseslug
+/datum/crafting_recipe/pulseslug
name = "Pulse Slug Shell"
result = /obj/item/ammo_casing/shotgun/pulseslug
reqs = list(/obj/item/ammo_casing/shotgun/techshell = 1,
@@ -114,16 +152,18 @@
/obj/item/weapon/stock_parts/micro_laser/ultra = 1)
tools = list(/obj/item/weapon/screwdriver)
time = 5
+ category = CAT_AMMO
-/datum/table_recipe/dragonsbreath
+/datum/crafting_recipe/dragonsbreath
name = "Dragonsbreath Shell"
result = /obj/item/ammo_casing/shotgun/incendiary/dragonsbreath
reqs = list(/obj/item/ammo_casing/shotgun/techshell = 1,
/datum/reagent/phosphorus = 5,)
tools = list(/obj/item/weapon/screwdriver)
time = 5
+ category = CAT_AMMO
-/datum/table_recipe/frag12
+/datum/crafting_recipe/frag12
name = "FRAG-12 Shell"
result = /obj/item/ammo_casing/shotgun/frag12
reqs = list(/obj/item/ammo_casing/shotgun/techshell = 1,
@@ -132,8 +172,9 @@
/datum/reagent/facid = 5,)
tools = list(/obj/item/weapon/screwdriver)
time = 5
+ category = CAT_AMMO
-/datum/table_recipe/ionslug
+/datum/crafting_recipe/ionslug
name = "Ion Scatter Shell"
result = /obj/item/ammo_casing/shotgun/ion
reqs = list(/obj/item/ammo_casing/shotgun/techshell = 1,
@@ -141,8 +182,9 @@
/obj/item/weapon/stock_parts/subspace/crystal = 1)
tools = list(/obj/item/weapon/screwdriver)
time = 5
+ category = CAT_AMMO
-/datum/table_recipe/improvisedslug
+/datum/crafting_recipe/improvisedslug
name = "Improvised Shotgun Shell"
result = /obj/item/ammo_casing/shotgun/improvised
reqs = list(/obj/item/weapon/grenade/chem_grenade = 1,
@@ -151,16 +193,19 @@
/datum/reagent/fuel = 10)
tools = list(/obj/item/weapon/screwdriver)
time = 5
+ category = CAT_AMMO
-/datum/table_recipe/improvisedslugoverload
+/datum/crafting_recipe/improvisedslugoverload
name = "Overload Improvised Shell"
result = /obj/item/ammo_casing/shotgun/improvised/overload
reqs = list(/obj/item/ammo_casing/shotgun/improvised = 1,
- /datum/reagent/blackpowder = 5)
+ /datum/reagent/blackpowder = 10,
+ /datum/reagent/plasma_dust = 20)
tools = list(/obj/item/weapon/screwdriver)
time = 5
+ category = CAT_AMMO
-/datum/table_recipe/laserslug
+/datum/crafting_recipe/laserslug
name = "Laser Slug Shell"
result = /obj/item/ammo_casing/shotgun/laserslug
reqs = list(/obj/item/ammo_casing/shotgun/techshell = 1,
@@ -168,8 +213,9 @@
/obj/item/weapon/stock_parts/micro_laser/high = 1)
tools = list(/obj/item/weapon/screwdriver)
time = 5
+ category = CAT_AMMO
-/datum/table_recipe/ishotgun
+/datum/crafting_recipe/ishotgun
name = "Improvised Shotgun"
result = /obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised
reqs = list(/obj/item/weaponcrafting/receiver = 1,
@@ -177,9 +223,29 @@
/obj/item/weaponcrafting/stock = 1,
/obj/item/stack/packageWrap = 5,)
tools = list(/obj/item/weapon/screwdriver)
- time = 200
+ time = 100
+ category = CAT_WEAPON
-/datum/table_recipe/spooky_camera
+/datum/crafting_recipe/chainsaw
+ name = "Chainsaw"
+ result = /obj/item/weapon/twohanded/required/chainsaw
+ reqs = list(/obj/item/weapon/circular_saw = 1,
+ /obj/item/stack/cable_coil = 1,
+ /obj/item/stack/sheet/plasteel = 1)
+ tools = list(/obj/item/weapon/weldingtool)
+ time = 50
+ category = CAT_WEAPON
+
+/datum/crafting_recipe/spear
+ name = "Spear"
+ result = /obj/item/weapon/twohanded/spear
+ reqs = list(/obj/item/weapon/restraints/handcuffs/cable = 1,
+ /obj/item/weapon/shard = 1,
+ /obj/item/stack/rods = 1)
+ time = 40
+ category = CAT_WEAPON
+
+/datum/crafting_recipe/spooky_camera
name = "Camera Obscura"
result = /obj/item/device/camera/spooky
time = 15
@@ -187,17 +253,60 @@
/datum/reagent/holywater = 10)
parts = list(/obj/item/device/camera = 1)
-/datum/table_recipe/notreallysoap
+/datum/crafting_recipe/papersack
+ name = "Paper Sack"
+ result = /obj/item/weapon/storage/box/papersack
+ time = 10
+ reqs = list(/obj/item/weapon/paper = 5)
+ category = CAT_MISC
+
+/datum/crafting_recipe/notreallysoap
name = "Homemade Soap"
result = /obj/item/weapon/soap/ducttape
- time = 100
+ time = 50
reqs = list(/obj/item/stack/tape_roll = 1,
/datum/reagent/liquidgibs = 10)
-/datum/table_recipe/garrote
+/datum/crafting_recipe/garrote
name = "Makeshift Garrote"
result = /obj/item/weapon/twohanded/garrote/improvised
time = 15
reqs = list(/obj/item/stack/sheet/wood = 1,
/obj/item/stack/cable_coil = 5)
- tools = list(/obj/item/weapon/kitchen/knife) // Gotta carve the wood into handles
\ No newline at end of file
+ tools = list(/obj/item/weapon/kitchen/knife) // Gotta carve the wood into handles
+ category = CAT_WEAPON
+
+/datum/crafting_recipe/makeshift_bolt
+ name = "Makeshift Bolt"
+ result = /obj/item/weapon/arrow/rod
+ time = 5
+ reqs = list(/obj/item/stack/rods = 1)
+ tools = list(/obj/item/weapon/weldingtool)
+ category = CAT_AMMO
+
+/datum/crafting_recipe/crossbow
+ name = "Powered Crossbow"
+ result = /obj/item/weapon/gun/throw/crossbow
+ time = 150
+ reqs = list(/obj/item/stack/rods = 3,
+ /obj/item/stack/cable_coil = 10,
+ /obj/item/stack/sheet/mineral/plastic = 3,
+ /obj/item/stack/sheet/wood = 5)
+ tools = list(/obj/item/weapon/weldingtool,
+ /obj/item/weapon/screwdriver)
+ category = CAT_WEAPON
+
+/datum/crafting_recipe/glove_balloon
+ name = "Latex Glove Balloon"
+ result = /obj/item/latexballon
+ time = 15
+ reqs = list(/obj/item/clothing/gloves/color/latex = 1,
+ /obj/item/stack/cable_coil = 5)
+
+/datum/crafting_recipe/gold_horn
+ name = "Golden bike horn"
+ result = /obj/item/weapon/bikehorn/golden
+ time = 20
+ reqs = list(/obj/item/stack/sheet/mineral/bananium = 5,
+ /obj/item/weapon/bikehorn)
+ category = CAT_MISC
\ No newline at end of file
diff --git a/code/modules/crafting/table.dm b/code/modules/crafting/table.dm
deleted file mode 100644
index 19ea37c3866..00000000000
--- a/code/modules/crafting/table.dm
+++ /dev/null
@@ -1,225 +0,0 @@
-#define TABLECRAFT_MAX_ITEMS 30
-
-/obj/structure/table
- var/list/table_contents = list()
-
-/obj/structure/table/MouseDrop(atom/over)
- if(over != usr)
- return
- interact(usr)
-
-/obj/structure/table/proc/check_contents(datum/table_recipe/R)
- check_table()
- main_loop:
- if(R.fruit)
- for(var/A in R.fruit)
- for(var/B in table_contents)
- if(B == A)
- if(table_contents[B] >= R.fruit[A])
- continue main_loop
- return 0
- for(var/A in R.reqs)
- for(var/B in table_contents)
- if(ispath(B, A))
- if(table_contents[B] >= R.reqs[A])
- continue main_loop
- return 0
- for(var/A in R.chem_catalists)
- if(table_contents[A] < R.chem_catalists[A])
- return 0
- return 1
-
-/obj/structure/table/proc/check_table()
- table_contents = list()
- for(var/obj/item/I in loc)
- if(istype(I, /obj/item/stack))
- var/obj/item/stack/S = I
- table_contents[I.type] += S.amount
- else if(istype(I, /obj/item/weapon/reagent_containers/food/snacks/grown))
- var/obj/item/weapon/reagent_containers/food/snacks/grown/G = I
- if(G.seed && G.seed.kitchen_tag)
- table_contents[G.seed.kitchen_tag] += 1
- else
- if(istype(I, /obj/item/weapon/reagent_containers))
- var/obj/item/weapon/reagent_containers/RC = I
- if(RC.flags & OPENCONTAINER)
- for(var/datum/reagent/A in RC.reagents.reagent_list)
- table_contents[A.type] += A.volume
- table_contents[I.type] += 1
-
-/obj/structure/table/proc/check_tools(mob/user, datum/table_recipe/R)
- if(!R.tools.len)
- return 1
- var/list/possible_tools = list()
- for(var/obj/item/I in user.contents)
- if(istype(I, /obj/item/weapon/storage))
- for(var/obj/item/SI in I.contents)
- possible_tools += SI.type
- else
- possible_tools += I.type
- possible_tools += table_contents
- var/i = R.tools.len
- var/I
- for(var/A in R.tools)
- I = possible_tools.Find(A)
- if(I)
- possible_tools.Cut(I, I+1)
- i--
- else
- break
- return !i
-
-/obj/structure/table/proc/construct_item(mob/user, datum/table_recipe/R)
- check_table()
- if(check_contents(R) && check_tools(user, R))
- if(do_after(user, R.time, target = src))
- if(!check_contents(R) || !check_tools(user, R))
- return 0
- var/atom/movable/I = new R.result (loc)
- var/list/parts = del_reqs(R, I)
- for(var/A in parts)
- if(istype(A, /obj/item))
- var/atom/movable/B = A
- B.loc = I
- else
- if(!I.reagents)
- I.reagents = new /datum/reagents()
- I.reagents.reagent_list.Add(A)
- I.CheckParts()
- R.AdjustChems(I)
- return 1
- return 0
-
-/obj/structure/table/proc/del_reqs(datum/table_recipe/R, atom/movable/resultobject)
- var/list/Deletion = list()
- var/amt
- var/reagenttransfer = 0
- if(istype(resultobject,/obj/item/weapon/reagent_containers))
- reagenttransfer = 1
- if(R.fruit)
- for(var/A in R.fruit)
- amt = R.fruit[A]
- fruit_loop: //ha
- for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in loc)
- if(G.seed && G.seed.kitchen_tag && (G.seed.kitchen_tag == A))
- amt--
- G.loc = null //remove it from the table loc so that we don't locate the same fruit every time
- if(reagenttransfer)
- G.reagents.trans_to(resultobject, G.reagents.total_volume)
- qdel(G)
- if(amt <= 0)
- break fruit_loop
- for(var/A in R.reqs)
- amt = R.reqs[A]
- if(ispath(A, /obj/item/stack))
- var/obj/item/stack/S
- stack_loop:
- for(var/B in table_contents)
- if(ispath(B, A))
- while(amt > 0)
- S = locate(B) in loc
- if(S.amount >= amt)
- S.use(amt)
- break stack_loop
- else
- amt -= S.amount
- qdel(S)
- else if(ispath(A, /obj/item))
- var/obj/item/I
- item_loop:
- for(var/B in table_contents)
- if(ispath(B, A))
- while(amt > 0)
- I = locate(B) in loc
- Deletion.Add(I)
- I.loc = null //remove it from the table loc so that we don't locate the same item every time (will be relocated inside the crafted item in construct_item())
- amt--
- if(reagenttransfer && istype(I,/obj/item/weapon/reagent_containers))
- var/obj/item/weapon/reagent_containers/RC = I
- RC.reagents.trans_to(resultobject, RC.reagents.total_volume)
- break item_loop
- else
- var/datum/reagent/RG = new A
- reagent_loop:
- for(var/B in table_contents)
- if(ispath(B, /obj/item/weapon/reagent_containers))
- var/obj/item/RC = locate(B) in loc
- if(RC.reagents.has_reagent(RG.id, amt))
- if(reagenttransfer)
- RC.reagents.trans_id_to(resultobject,RG.id, amt)
- else
- RC.reagents.remove_reagent(RG.id, amt)
- RG.volume = amt
- Deletion.Add(RG)
- break reagent_loop
- else if(RC.reagents.has_reagent(RG.id))
- Deletion.Add(RG)
- RG.volume += RC.reagents.get_reagent_amount(RG.id)
- amt -= RC.reagents.get_reagent_amount(RG.id)
- if(reagenttransfer)
- RC.reagents.trans_id_to(resultobject,RG.id, RG.volume)
- else
- RC.reagents.del_reagent(RG.id)
-
- var/list/partlist = list(R.parts.len)
- for(var/M in R.parts)
- partlist[M] = R.parts[M]
- deletion_loop:
- for(var/B in Deletion)
- for(var/A in R.parts)
- if(istype(B, A))
- if(partlist[A] > 0) //do we still need a part like that?
- partlist[A] -= 1
- continue deletion_loop
- Deletion.Remove(B)
- qdel(B)
-
- return Deletion
-
-/obj/structure/table/interact(mob/user)
- if(user.stat || user.lying || !Adjacent(user))
- return
- check_table()
- if(!table_contents.len)
- return
- user.face_atom(src)
- var/dat = "
Crafting menu
"
- dat += "
"
- if(busy)
- dat += "Crafting in progress...
"
- else
- for(var/datum/table_recipe/R in table_recipes)
- if(check_contents(R))
- dat += "[R.name] "
- dat += ""
-
- var/datum/browser/popup = new(user, "table", "Table", 300, 300)
- popup.set_content(dat)
- popup.open()
- return
-
-/obj/structure/table/Topic(href, href_list)
- if(usr.stat || !Adjacent(usr) || usr.lying)
- return
- if(href_list["make"])
- if(!check_table_space())
- to_chat(usr, "The table is too crowded.")
- return
- var/datum/table_recipe/TR = locate(href_list["make"])
- busy = 1
- interact(usr)
- if(construct_item(usr, TR))
- to_chat(usr, "[TR.name] constructed.")
- else
- to_chat(usr, "Construction failed.")
- busy = 0
- interact(usr)
-
-/obj/structure/table/proc/check_table_space()
- var/Item_amount = 0
- for(var/obj/item/I in loc)
- Item_amount++
- if(Item_amount <= TABLECRAFT_MAX_ITEMS) //is the table crowded?
- return 1
-
- #undef TABLECRAFT_MAX_ITEMS
\ No newline at end of file
diff --git a/code/modules/customitems/item_defines.dm b/code/modules/customitems/item_defines.dm
index 3371eeade23..c7b9b3abdb6 100644
--- a/code/modules/customitems/item_defines.dm
+++ b/code/modules/customitems/item_defines.dm
@@ -10,6 +10,9 @@
////////// Usable Items //////////
//////////////////////////////////
+/obj/item/device/fluff
+ var/used = 0
+
/obj/item/device/fluff/tattoo_gun // Generic tattoo gun, make subtypes for different folks
name = "dispoable tattoo pen"
desc = "A cheap plastic tattoo application pen."
@@ -17,8 +20,7 @@
icon_state = "tatgun"
force = 0
throwforce = 0
- w_class = 1.0
- var/used = 0
+ w_class = 1
var/tattoo_name = "tiger stripe tattoo" // Tat name for visible messages
var/tattoo_icon = "Tiger Body" // body_accessory.dmi, new icons defined in sprite_accessories.dm
var/tattoo_r = 1 // RGB values for the body markings
@@ -67,8 +69,45 @@
target.update_markings()
playsound(src.loc, 'sound/items/Welder2.ogg', 20, 1)
- icon_state = "tatgun_used"
used = 1
+ update_icon()
+
+/obj/item/device/fluff/tattoo_gun/update_icon()
+ ..()
+
+ overlays.Cut()
+
+ if(!used)
+ var/image/ink = image(src.icon, src, "ink_overlay")
+ ink.icon += rgb(tattoo_r, tattoo_g, tattoo_b, 190)
+ overlays += ink
+
+/obj/item/device/fluff/tattoo_gun/New()
+ ..()
+ update_icon()
+
+/obj/item/device/fluff/tattoo_gun/elliot_cybernetic_tat
+ desc = "A cheap plastic tattoo application pen. This one seems heavily used."
+ tattoo_name = "circuitry tattoo"
+ tattoo_icon = "Elliot Circuit Tattoo"
+ tattoo_r = 48
+ tattoo_g = 138
+ tattoo_b = 176
+
+/obj/item/device/fluff/tattoo_gun/elliot_cybernetic_tat/attack_self(mob/user as mob)
+ if(!used)
+ var/ink_color = input("Please select an ink color.", "Tattoo Ink Color", rgb(tattoo_r, tattoo_g, tattoo_b)) as color|null
+ if(ink_color && !(user.incapacitated() || used) )
+ tattoo_r = hex2num(copytext(ink_color, 2, 4))
+ tattoo_g = hex2num(copytext(ink_color, 4, 6))
+ tattoo_b = hex2num(copytext(ink_color, 6, 8))
+
+ to_chat(user, "You change the color setting on the [src].")
+
+ update_icon()
+
+ else
+ to_chat(user, "The [src] is out of ink!")
/obj/item/weapon/claymore/fluff // MrBarrelrolll: Maximus Greenwood
name = "Greenwood's Blade"
@@ -77,7 +116,7 @@
sharp = 0
edge = 0
-/obj/item/weapon/claymore/fluff/IsShield()
+/obj/item/weapon/claymore/fluff/hit_reaction()
return 0
/obj/item/weapon/crowbar/fluff/zelda_creedy_1 // Zomgponies: Griffin Rowley
@@ -156,6 +195,82 @@
icon_state = "jello_guitar"
item_state = "jello_guitar"
+/obj/item/fluff/wingler_comb
+ name = "blue comb"
+ desc = "A blue comb, it looks like it was made to groom a Tajaran's fur."
+ icon = 'icons/obj/custom_items.dmi'
+ icon_state = "wingler_comb"
+ attack_verb = list("combed")
+ hitsound = 'sound/weapons/tap.ogg'
+ force = 0
+ throwforce = 0
+ w_class = 2
+ var/used = 0
+
+/obj/item/fluff/wingler_comb/attack_self(mob/user)
+ if(used)
+ return
+
+ var/mob/living/carbon/human/target = user
+ if(!istype(target) || target.get_species() != "Tajaran") // Only catbeasts, kthnx.
+ return
+
+ if(target.change_body_accessory("Jay Wingler Tail"))
+ to_chat(target, "You comb your tail with the [src].")
+ used = 1
+
+#define USED_MOD_HELM 1
+#define USED_MOD_SUIT 2
+
+/obj/item/device/fluff/shadey_plasman_modkit
+ name = "plasmaman suit modkit"
+ desc = "A kit containing nanites that are able to modify the look of a plasmaman suit and helmet without exposing the wearer to hostile environments."
+ icon_state = "modkit"
+ w_class = 2
+ force = 0
+ throwforce = 0
+
+/obj/item/device/fluff/shadey_plasman_modkit/afterattack(atom/target, mob/user, proximity)
+ if(!proximity || !ishuman(user) || user.lying)
+ return
+ var/mob/living/carbon/human/H = user
+
+ if(istype(target, /obj/item/clothing/head/helmet/space/eva/plasmaman))
+ if(used & USED_MOD_HELM)
+ to_chat(H, "The kit's helmet modifier has already been used.")
+ return
+ to_chat(H, "You modify the appearance of [target].")
+ used |= USED_MOD_HELM
+
+ var/obj/item/clothing/head/helmet/space/eva/plasmaman/P = target
+ P.name = "plasma containment helmet"
+ P.desc = "A purpose-built containment helmet designed to keep plasma in, and everything else out."
+ P.icon_state = "plasmaman_halo_helmet[P.on]"
+ P.base_state = "plasmaman_halo_helmet"
+
+ if(P == H.head)
+ H.update_inv_head()
+ return
+ if(istype(target, /obj/item/clothing/suit/space/eva/plasmaman))
+ if(used & USED_MOD_SUIT)
+ to_chat(user, "The kit's suit modifier has already been used.")
+ return
+ to_chat(H, "You modify the appearance of [target].")
+ used |= USED_MOD_SUIT
+
+ var/obj/item/clothing/suit/space/eva/plasmaman/P = target
+ P.name = "plasma containment suit"
+ P.desc = "A feminine containment suit designed to keep plasma in, and everything else out. It's even got an overskirt."
+ P.icon_state = "plasmaman_halo"
+
+ if(P == H.wear_suit)
+ H.update_inv_wear_suit()
+ return
+ to_chat(user, "You can't modify [target]!")
+
+#undef USED_MOD_HELM
+#undef USED_MOD_SUIT
+
//////////////////////////////////
//////////// Clothing ////////////
//////////////////////////////////
@@ -197,6 +312,8 @@
desc = "A labcoat with a few markings denoting it as the labcoat of roboticist."
icon = 'icons/obj/custom_items.dmi'
icon_state = "aeneasrinil_open"
+ species_fit = null
+ sprite_sheets = null
/obj/item/clothing/suit/jacket/fluff/kidosvest // Anxipal: Kido Qasteth
name = "Kido's Vest"
@@ -205,8 +322,10 @@
icon_state = "kidosvest"
item_state = "kidosvest"
ignore_suitadjust = 1
- action_button_name = null
+ actions_types = list()
adjust_flavour = null
+ species_fit = null
+ sprite_sheets = null
/obj/item/clothing/suit/fluff/kluys // Kluys: Cripty Pandaen
name = "Nano Fibre Jacket"
@@ -244,6 +363,8 @@
desc = "A suit that protects against minor chemical spills. Has a red stripe on the shoulders and rolled up sleeves."
icon = 'icons/obj/custom_items.dmi'
icon_state = "labcoat_red_open"
+ species_fit = null
+ sprite_sheets = null
/obj/item/clothing/suit/fluff/stobarico_greatcoat // Stobarico: F.U.R.R.Y
name = "\improper F.U.R.R.Y's Nanotrasen Greatcoat"
@@ -316,8 +437,10 @@
icon_state = "fox_jacket"
item_state = "fox_jacket"
ignore_suitadjust = 1
- action_button_name = null
+ actions_types = list()
adjust_flavour = null
+ species_fit = null
+ sprite_sheets = null
/obj/item/clothing/under/fluff/fox
name = "Aeronautics Jumpsuit"
@@ -366,28 +489,27 @@
icon_state = "chronx_hood"
item_state = "chronx_hood"
flags = HEADCOVERSEYES | BLOCKHAIR
- action_button_name = "Transform Hood"
+ actions_types = list(/datum/action/item_action/toggle)
var/adjusted = 0
/obj/item/clothing/head/fluff/chronx/ui_action_click()
adjust()
-/obj/item/clothing/head/fluff/chronx/verb/adjust()
- set name = "Transform Hood"
- set category = "Object"
- set src in usr
- if(isliving(usr) && !usr.incapacitated())
- if(adjusted)
- icon_state = initial(icon_state)
- item_state = initial(item_state)
- to_chat(usr, "You untransform \the [src].")
- adjusted = 0
- else
- icon_state += "_open"
- item_state += "_open"
- to_chat(usr, "You transform \the [src].")
- adjusted = 1
- usr.update_inv_head()
+/obj/item/clothing/head/fluff/chronx/proc/adjust()
+ if(adjusted)
+ icon_state = initial(icon_state)
+ item_state = initial(item_state)
+ to_chat(usr, "You untransform \the [src].")
+ adjusted = 0
+ else
+ icon_state += "_open"
+ item_state += "_open"
+ to_chat(usr, "You transform \the [src].")
+ adjusted = 1
+ usr.update_inv_head()
+ for(var/X in actions)
+ var/datum/action/A = X
+ A.UpdateButtonIcon()
/obj/item/clothing/suit/chaplain_hoodie/fluff/chronx //chronx100: Hughe O'Splash
name = "Cthulhu's Robes"
@@ -395,23 +517,11 @@
icon = 'icons/obj/custom_items.dmi'
icon_state = "chronx_robe"
item_state = "chronx_robe"
- flags = ONESIZEFITSALL
- action_button_name = "Transform Robes"
+ flags_size = ONESIZEFITSALL
+ actions_types = list(/datum/action/item_action/toggle)
adjust_flavour = "untransform"
ignore_suitadjust = 0
-/obj/item/clothing/suit/chaplain_hoodie/fluff/chronx/New()
- ..()
- verbs -= /obj/item/clothing/suit/verb/openjacket
-
-/obj/item/clothing/suit/chaplain_hoodie/fluff/chronx/verb/adjust()
- set name = "Transform Robes"
- set category = "Object"
- set src in usr
- if(!istype(usr, /mob/living))
- return
- adjustsuit(usr)
-
/obj/item/clothing/shoes/black/fluff/chronx //chronx100: Hughe O'Splash
name = "Cthulhu's Boots"
desc = "Boots worn by the worshipers of Cthulhu. You see a name inscribed in blood on the inside: Hughe O'Splash"
@@ -425,6 +535,8 @@
icon = 'icons/obj/clothing/ties.dmi'
icon_state = "vest_black"
item_state = "vest_black"
+ species_fit = null
+ sprite_sheets = null
/obj/item/clothing/under/pants/fluff/combat
name = "combat pants"
@@ -432,24 +544,13 @@
icon_state = "chaps"
item_color = "combat_pants"
-/obj/item/clothing/suit/jacket/fluff/windbreaker // DaveTheHeadcrab: Elliot Campbell
+/obj/item/clothing/suit/jacket/fluff/elliot_windbreaker // DaveTheHeadcrab: Elliot Campbell
name = "nylon windbreaker"
desc = "A cheap nylon windbreaker, according to the tag it was manufactured in New Chiba, Earth. The color reminds you of a television tuned to a dead channel."
icon = 'icons/obj/custom_items.dmi'
- icon_state = "elliot_windbreaker"
- item_state = "elliot_windbreaker"
+ icon_state = "elliot_windbreaker_open"
+ item_state = "elliot_windbreaker_open"
adjust_flavour = "unzip"
-
-/obj/item/clothing/ears/earring/fluff/industrial_piercing
- name = "industrial piercing and stud earring"
- desc = "A set of ear piercings containing an industrial rod and a small stud. They appear to be made out of some form of non-magnetic metal."
- icon = 'icons/obj/custom_items.dmi'
- icon_state = "elliot_earring"
-
-/obj/item/device/fluff/tattoo_gun/cybernetic_tat
- desc = "A cheap plastic tattoo application pen. This one seems to have light blue ink."
- tattoo_name = "circuitry tattoo"
- tattoo_icon = "Elliot Circuit Tattoo"
- tattoo_r = 100
- tattoo_g = 150
- tattoo_b = 255
\ No newline at end of file
+ suit_adjusted = 1
+ species_fit = null
+ sprite_sheets = null
diff --git a/code/modules/customitems/item_spawning.dm b/code/modules/customitems/item_spawning.dm
index d0b350b9b1e..345bf6e164e 100644
--- a/code/modules/customitems/item_spawning.dm
+++ b/code/modules/customitems/item_spawning.dm
@@ -48,7 +48,7 @@
to_chat(M, "Your [Item.name] has been added to your [M.back.name].")
if(ok == 0)
for(var/obj/item/weapon/storage/S in M.contents) // Try to place it in any item that can store stuff, on the mob.
- if (S.contents.len < S.storage_slots)
+ if(S.contents.len < S.storage_slots)
Item.loc = S
ok = 1
to_chat(M, "Your [Item.name] has been added to your [S.name].")
@@ -58,7 +58,7 @@
if(newname)
Item.name = newname
- if (ok == 0) // Finally, since everything else failed, place it on the ground
+ if(ok == 0) // Finally, since everything else failed, place it on the ground
Item.loc = get_turf(M.loc)
HackProperties(Item,propadjust)
diff --git a/code/modules/detective_work/evidence.dm b/code/modules/detective_work/evidence.dm
index 4654e0ab665..6f62a7eecac 100644
--- a/code/modules/detective_work/evidence.dm
+++ b/code/modules/detective_work/evidence.dm
@@ -21,6 +21,10 @@
if(!istype(I) || I.anchored == 1)
return
+ if(istype(I, /obj/item/weapon/storage/box))
+ to_chat(user, "This box is too big to fit in the evidence bag.")
+ return
+
if(istype(I, /obj/item/weapon/evidencebag))
to_chat(user, "You find putting an evidence bag in another evidence bag to be slightly absurd.")
return 1 //now this is podracing
diff --git a/code/modules/detective_work/scanner.dm b/code/modules/detective_work/scanner.dm
index 59466282384..58c1c31a3b8 100644
--- a/code/modules/detective_work/scanner.dm
+++ b/code/modules/detective_work/scanner.dm
@@ -5,8 +5,9 @@
/obj/item/device/detective_scanner
name = "forensic scanner"
desc = "Used to remotely scan objects and biomass for DNA and fingerprints. Can print a report of the findings."
- icon_state = "forensic1"
- w_class = 3.0
+ icon = 'icons/goonstation/objects/objects.dmi'
+ icon_state = "detscanner"
+ w_class = 3
item_state = "electronic"
flags = CONDUCT | NOBLUDGEON
slot_flags = SLOT_BELT
@@ -15,9 +16,56 @@
var/list/log = list()
/obj/item/device/detective_scanner/attack_self(var/mob/user)
+ var/search = input(user, "Enter name, fingerprint or blood DNA.", "Find record", "")
+
+ if(!search || user.stat || user.incapacitated())
+ return
+
+ search = lowertext(search)
+
+ var/name
+ var/fingerprint = "FINGERPRINT NOT FOUND"
+ var/dna = "BLOOD DNA NOT FOUND"
+
+ // I really, really wish I didn't have to split this into two seperate loops. But the datacore is awful.
+
+ for(var/record in data_core.general)
+ var/datum/data/record/S = record
+ if(S && (search == lowertext(S.fields["fingerprint"]) || search == lowertext(S.fields["name"])))
+ name = S.fields["name"]
+ fingerprint = S.fields["fingerprint"]
+ continue
+
+ for(var/record in data_core.medical)
+ var/datum/data/record/M = record
+ if(M && ( search == lowertext(M.fields["b_dna"]) || name == M.fields["name"]) )
+ dna = M.fields["b_dna"]
+
+ if(fingerprint == "FINGERPRINT NOT FOUND") // We have searched by DNA, and do not have the relevant information from the fingerprint records.
+ name = M.fields["name"]
+ for(var/gen_record in data_core.general)
+ var/datum/data/record/S = gen_record
+ if(S && (name == S.fields["name"]))
+ fingerprint = S.fields["fingerprint"]
+ continue
+ continue
+
+ if(name)
+ to_chat(user, "Match found in station records: [name] \
+ Fingerprint: [fingerprint] \
+ Blood DNA: [dna]")
+ return
+
+ to_chat(user, "No match found in station records.")
+
+
+/obj/item/device/detective_scanner/verb/print_scanner_report()
+ set name = "Print Scanner Report"
+ set category = "Object"
+
if(log.len && !scanning)
scanning = 1
- to_chat(user, "Printing report, please wait...")
+ to_chat(usr, "Printing report, please wait...")
playsound(loc, "sound/goonstation/machines/printer_thermal.ogg", 50, 1)
spawn(100)
@@ -38,7 +86,8 @@
log = list()
scanning = 0
else
- to_chat(user, "The scanner has no logs or is in use.")
+ to_chat(usr, "The scanner has no logs or is in use.")
+
/obj/item/device/detective_scanner/attack(mob/living/M as mob, mob/user as mob)
return
@@ -83,7 +132,7 @@
if(ishuman(A))
var/mob/living/carbon/human/H = A
- if (istype(H.dna, /datum/dna) && !H.gloves)
+ if(istype(H.dna, /datum/dna) && !H.gloves)
fingerprints += md5(H.dna.uni_identity)
else if(!ismob(A))
@@ -121,7 +170,7 @@
found_something = 1
// Blood
- if (blood && blood.len)
+ if(blood && blood.len)
sleep(30)
add_log("Blood:")
found_something = 1
@@ -171,4 +220,4 @@
CRASH("[src] \ref[src] is adding a log when it was never put in scanning mode!")
/proc/get_timestamp()
- return time2text(world.time + 432000, ":ss")
\ No newline at end of file
+ return time2text(world.time + 432000, ":ss")
diff --git a/code/modules/economy/ATM.dm b/code/modules/economy/ATM.dm
index 7448d3da352..cc07dd248b4 100644
--- a/code/modules/economy/ATM.dm
+++ b/code/modules/economy/ATM.dm
@@ -49,7 +49,7 @@ log transactions
if(linked_db && ( (linked_db.stat & NOPOWER) || !linked_db.activated ) )
linked_db = null
authenticated_account = null
- src.visible_message("\red \icon[src] [src] buzzes rudely, \"Connection to remote database lost.\"")
+ src.visible_message("\red [bicon(src)] [src] buzzes rudely, \"Connection to remote database lost.\"")
updateDialog()
if(ticks_left_timeout > 0)
@@ -125,6 +125,7 @@ log transactions
if(get_dist(src,user) <= 1)
//check to see if the user has low security enabled
scan_user(user)
+ add_fingerprint(user)
//js replicated from obj/machinery/computer/card
var/dat = {"
"
+ if(srcRef)
+ html += " src: VV"
+ if(ispath(srcType, /mob))
+ html += " PP"
+ html += " Follow"
+ if(istype(srcLoc))
+ html += " src.loc: VV"
+ html += " JMP"
+ if(usrRef)
+ html += " usr: VV"
+ html += " PP"
+ html += " Follow"
+ if(istype(usrLoc))
+ html += " usr.loc: VV"
+ html += " JMP"
+ browseTo(user, html)
+
+/datum/ErrorViewer/ErrorEntry/makeLink(var/linktext, var/datum/ErrorViewer/back_to, var/linear)
+ if(isSkipCount)
+ return html_encode(name)
+ else
+ return ..()
diff --git a/code/modules/events/alien_infestation.dm b/code/modules/events/alien_infestation.dm
index 927db3c3668..b6313a77a40 100644
--- a/code/modules/events/alien_infestation.dm
+++ b/code/modules/events/alien_infestation.dm
@@ -17,6 +17,7 @@
/datum/event/alien_infestation/start()
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
+ // TODO: Tie into space manager
if((temp_vent.loc.z in config.station_levels) && !temp_vent.welded)
if(temp_vent.parent.other_atmosmch.len > 50) //Stops Aliens getting stuck in small networks. See: Security, Virology
vents += temp_vent
@@ -34,4 +35,3 @@
spawncount--
successSpawn = 1
-
diff --git a/code/modules/events/anomaly_bluespace.dm b/code/modules/events/anomaly_bluespace.dm
index 82a4da4cc15..f7db50694d6 100644
--- a/code/modules/events/anomaly_bluespace.dm
+++ b/code/modules/events/anomaly_bluespace.dm
@@ -19,6 +19,7 @@
var/obj/item/device/radio/beacon/chosen
var/list/possible = list()
for(var/obj/item/device/radio/beacon/W in world)
+ // TODO: Tie into space manager
if(!(W.z in config.station_levels))
continue
possible += W
@@ -42,7 +43,7 @@
var/y_distance = TO.y - FROM.y
var/x_distance = TO.x - FROM.x
- for (var/atom/movable/A in range(12, FROM )) // iterate thru list of mobs in the area
+ for(var/atom/movable/A in range(12, FROM )) // iterate thru list of mobs in the area
if(istype(A, /obj/item/device/radio/beacon)) continue // don't teleport beacons because that's just insanely stupid
if(A.anchored) continue
diff --git a/code/modules/events/brand_intelligence.dm b/code/modules/events/brand_intelligence.dm
index 05110a7f0ce..e51ad46f61a 100644
--- a/code/modules/events/brand_intelligence.dm
+++ b/code/modules/events/brand_intelligence.dm
@@ -18,7 +18,8 @@
/datum/event/brand_intelligence/start()
for(var/obj/machinery/vending/V in machines)
- if(V.z != 1) continue
+ // TODO: Tie into space manager
+ if(V.z != ZLEVEL_STATION) continue
vendingMachines.Add(V)
if(!vendingMachines.len)
@@ -62,4 +63,4 @@
rebel.shoot_inventory = 1
if(IsMultiple(activeFor, 8))
- originMachine.speak(pick(rampant_speeches))
\ No newline at end of file
+ originMachine.speak(pick(rampant_speeches))
diff --git a/code/modules/events/carp_migration.dm b/code/modules/events/carp_migration.dm
index a4f620fccdf..13b5c884131 100644
--- a/code/modules/events/carp_migration.dm
+++ b/code/modules/events/carp_migration.dm
@@ -34,9 +34,9 @@
num_groups = min(num_groups, spawn_locations.len)
var/i = 1
- while (i <= num_groups)
+ while(i <= num_groups)
var/group_size = rand(group_size_min, group_size_max)
- for (var/j = 1, j <= group_size, j++)
+ for(var/j = 1, j <= group_size, j++)
var/carptype = /mob/living/simple_animal/hostile/carp
if(prob(5))
carptype = /mob/living/simple_animal/hostile/carp/megacarp
diff --git a/code/modules/events/disease_outbreak.dm b/code/modules/events/disease_outbreak.dm
index ce6e214053d..0f44bf586ee 100644
--- a/code/modules/events/disease_outbreak.dm
+++ b/code/modules/events/disease_outbreak.dm
@@ -21,7 +21,8 @@
var/turf/T = get_turf(H)
if(!T)
continue
- if(T.z != 1)
+ // TODO: Tie into space manager
+ if(T.z != ZLEVEL_STATION)
continue
var/foundAlready = 0 // don't infect someone that already has the virus
for(var/datum/disease/D in H.viruses)
@@ -34,4 +35,4 @@
D = new virus_type()
D.carrier = 1
H.AddDisease(D)
- break
\ No newline at end of file
+ break
diff --git a/code/modules/events/dust.dm b/code/modules/events/dust.dm
index b7f1fb660c8..17b529f9bda 100644
--- a/code/modules/events/dust.dm
+++ b/code/modules/events/dust.dm
@@ -62,7 +62,7 @@
goal = locate(endx, endy, 1)
src.x = startx
src.y = starty
- src.z = 1
+ src.z = ZLEVEL_STATION
spawn(0)
walk_towards(src, goal, 1)
return
@@ -73,7 +73,7 @@
for(var/mob/M in range(10, src))
if(!M.stat && !istype(M, /mob/living/silicon/ai))
shake_camera(M, 3, 1)
- if (A)
+ if(A)
playsound(src.loc, 'sound/effects/meteorimpact.ogg', 40, 1)
if(ismob(A))
diff --git a/code/modules/events/event_container.dm b/code/modules/events/event_container.dm
index 304abd3cd13..deaa1b85aa8 100644
--- a/code/modules/events/event_container.dm
+++ b/code/modules/events/event_container.dm
@@ -149,7 +149,7 @@ var/list/event_last_fired = list()
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Prison Break", /datum/event/prison_break, 0, list(ASSIGNMENT_SECURITY = 100)),
//new /datum/event_meta(EVENT_LEVEL_MODERATE, "Virology Breach", /datum/event/prison_break/virology, 0, list(ASSIGNMENT_MEDICAL = 100)),
//new /datum/event_meta(EVENT_LEVEL_MODERATE, "Xenobiology Breach", /datum/event/prison_break/xenobiology, 0, list(ASSIGNMENT_SCIENCE = 100)),
- //new /datum/event_meta(EVENT_LEVEL_MODERATE, "Grid Check", /datum/event/grid_check, 200, list(ASSIGNMENT_ENGINEER = 60)),
+ new /datum/event_meta(EVENT_LEVEL_MODERATE, "Grid Check", /datum/event/grid_check, 200, list(ASSIGNMENT_ENGINEER = 60)),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Electrical Storm", /datum/event/electrical_storm, 250, list(ASSIGNMENT_ENGINEER = 20, ASSIGNMENT_JANITOR = 150)),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Radiation Storm", /datum/event/radiation_storm, 0, list(ASSIGNMENT_MEDICAL = 50), 1),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Spider Infestation", /datum/event/spider_infestation, 100, list(ASSIGNMENT_SECURITY = 30), 1),
@@ -184,6 +184,7 @@ var/list/event_last_fired = list()
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Meteor Wave", /datum/event/meteor_wave, 0, list(ASSIGNMENT_ENGINEER = 3), 1),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Abductor Visit", /datum/event/abductor, 80, is_one_shot = 1),
new /datum/event_meta/alien(EVENT_LEVEL_MAJOR, "Alien Infestation", /datum/event/alien_infestation, 0, list(ASSIGNMENT_SECURITY = 30), 1),
+ new /datum/event_meta(EVENT_LEVEL_MAJOR, "Traders", /datum/event/traders, 0, is_one_shot = 1),
)
diff --git a/code/modules/events/event_manager.dm b/code/modules/events/event_manager.dm
index 85ffa86f25f..00b7f76fc3e 100644
--- a/code/modules/events/event_manager.dm
+++ b/code/modules/events/event_manager.dm
@@ -337,18 +337,18 @@
var/list/event_areas = list()
- for (var/areapath in the_station_areas)
+ for(var/areapath in the_station_areas)
event_areas += typesof(areapath)
- for (var/areapath in safe_areas)
+ for(var/areapath in safe_areas)
event_areas -= typesof(areapath)
- for (var/areapath in danger_areas)
+ for(var/areapath in danger_areas)
event_areas += typesof(areapath)
- while (event_areas.len > 0)
+ while(event_areas.len > 0)
var/list/event_turfs = null
candidate = locate(pick_n_take(event_areas))
event_turfs = get_area_turfs(candidate)
- if (event_turfs.len > 0)
+ if(event_turfs.len > 0)
break
return candidate
diff --git a/code/modules/events/grid_check.dm b/code/modules/events/grid_check.dm
index ca675306ffa..479a0ea162e 100644
--- a/code/modules/events/grid_check.dm
+++ b/code/modules/events/grid_check.dm
@@ -22,6 +22,7 @@
for(var/obj/machinery/power/smes/S in machines)
var/area/current_area = get_area(S)
+ // TODO: Tie into space manager
if(current_area.type in skipped_areas || !(S.z in config.station_levels))
continue
S.last_charge = S.charge
@@ -33,8 +34,9 @@
S.update_icon()
S.power_change()
- for(var/obj/machinery/power/apc/C in world)
+ for(var/obj/machinery/power/apc/C in apcs)
var/area/current_area = get_area(C)
+ // TODO: Tie into space manager
if(current_area.type in skipped_areas_apc || !(C.z in config.station_levels))
continue
if(C.cell)
@@ -46,14 +48,16 @@
if(announce)
command_announcement.Announce("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg')
- for(var/obj/machinery/power/apc/C in machines)
+ for(var/obj/machinery/power/apc/C in apcs)
var/area/current_area = get_area(C)
+ // TODO: Tie into space manager
if(current_area.type in skipped_areas_apc || !(C.z in config.station_levels))
continue
if(C.cell)
C.cell.charge = C.cell.maxcharge
for(var/obj/machinery/power/smes/S in machines)
var/area/current_area = get_area(S)
+ // TODO: Tie into space manager
if(current_area.type in skipped_areas || !(S.z in config.station_levels))
continue
S.charge = S.last_charge
@@ -66,7 +70,8 @@
if(announce)
command_announcement.Announce("All SMESs on [station_name()] have been recharged. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg')
for(var/obj/machinery/power/smes/S in machines)
- if(S.z != 1)
+ // TODO: Tie into space manager
+ if(S.z != ZLEVEL_STATION)
continue
S.charge = S.capacity
S.output_level = S.output_level_max
@@ -74,4 +79,3 @@
S.input_attempt = 1
S.update_icon()
S.power_change()
-
\ No newline at end of file
diff --git a/code/modules/events/holidays/Christmas.dm b/code/modules/events/holidays/Christmas.dm
index 10a46b0cf51..1d5a4d9e659 100644
--- a/code/modules/events/holidays/Christmas.dm
+++ b/code/modules/events/holidays/Christmas.dm
@@ -1,5 +1,6 @@
/proc/Christmas_Game_Start()
for(var/obj/structure/flora/tree/pine/xmas in world)
+ // TODO: Tie into space manager
if(!(xmas.z in config.station_levels)) continue
for(var/turf/simulated/floor/T in orange(1,xmas))
for(var/i=1,i<=rand(1,5),i++)
@@ -14,7 +15,7 @@
evil_tree.icon_living = evil_tree.icon_state
evil_tree.icon_dead = evil_tree.icon_state
evil_tree.icon_gib = evil_tree.icon_state
- del(xmas)
+ qdel(xmas)
/obj/item/weapon/toy/xmas_cracker
name = "xmas cracker"
@@ -40,7 +41,7 @@
"What do you get from eating tree decorations?\n\nTinsilitis!",
"What do snowmen wear on their heads?\n\nIce caps!",
"Why is Christmas just like life on ss13?\n\nYou do all the work and the fat guy gets all the credit.",
- "Why doesn’t Santa have any children?\n\nBecause he only comes down the chimney.")
+ "Why doesn�t Santa have any children?\n\nBecause he only comes down the chimney.")
new /obj/item/clothing/head/festive(target.loc)
user.update_icons()
cracked = 1
@@ -59,4 +60,3 @@
desc = "A crappy paper hat that you are REQUIRED to wear."
flags_inv = 0
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
-
diff --git a/code/modules/events/holidays/Holidays.dm b/code/modules/events/holidays/Holidays.dm
index e06c7764a39..8b219e77d8a 100644
--- a/code/modules/events/holidays/Holidays.dm
+++ b/code/modules/events/holidays/Holidays.dm
@@ -2,7 +2,7 @@
var/global/Holiday = null
//Just thinking ahead! Here's the foundations to a more robust Holiday event system.
-//It's easy as hell to add stuff. Just set Holiday to something using the switch (or something else)
+//It's easy as hell to add stuff. Just set Holiday to something using the switch(or something else)
//then use if(Holiday == "MyHoliday") to make stuff happen on that specific day only
//Please, Don't spam stuff up with easter eggs, I'd rather somebody just delete this than people cause
//the game to lag even more in the name of one-day content.
diff --git a/code/modules/events/immovable_rod.dm b/code/modules/events/immovable_rod.dm
index eb2007944dd..3012b0f9535 100644
--- a/code/modules/events/immovable_rod.dm
+++ b/code/modules/events/immovable_rod.dm
@@ -54,11 +54,11 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
x = clong.x
y = clong.y
- if (istype(clong, /turf) || istype(clong, /obj))
+ if(istype(clong, /turf) || istype(clong, /obj))
if(clong.density)
clong.ex_act(2)
- else if (istype(clong, /mob))
+ else if(istype(clong, /mob))
if(istype(clong, /mob/living/carbon/human))
var/mob/living/carbon/human/H = clong
H.visible_message("[H.name] is penetrated by an immovable rod!" , "The rod penetrates you!" , "You hear a CLANG!")
diff --git a/code/modules/events/ion_storm.dm b/code/modules/events/ion_storm.dm
index bba7949a600..20a53a4413f 100644
--- a/code/modules/events/ion_storm.dm
+++ b/code/modules/events/ion_storm.dm
@@ -492,7 +492,7 @@
/proc/generate_static_ion_law()
/var/list/players = list()
- for (var/mob/living/carbon/human/player in player_list)
+ for(var/mob/living/carbon/human/player in player_list)
if( !player.mind || player.mind.assigned_role == "MODE" || player.client.inactivity > MinutesToTicks(10))
continue
players += player.real_name
diff --git a/code/modules/events/meaty_ores.dm b/code/modules/events/meaty_ores.dm
index d13a1b9ad34..df56749734e 100644
--- a/code/modules/events/meaty_ores.dm
+++ b/code/modules/events/meaty_ores.dm
@@ -26,7 +26,7 @@
for(var/mob/M in range(10, src))
if(!M.stat && !istype(M, /mob/living/silicon/ai))
shake_camera(M, 3, 1)
- if (A)
+ if(A)
playsound(src.loc, 'sound/effects/meteorimpact.ogg', 40, 1)
walk(src,0)
invisibility = 101
diff --git a/code/modules/events/money_spam.dm b/code/modules/events/money_spam.dm
index 94f27958b9b..061a1c9efa7 100644
--- a/code/modules/events/money_spam.dm
+++ b/code/modules/events/money_spam.dm
@@ -9,7 +9,7 @@
/datum/event/pda_spam/proc/pick_message_server()
if(message_servers)
- for (var/obj/machinery/message_server/MS in message_servers)
+ for(var/obj/machinery/message_server/MS in message_servers)
if(MS.active)
useMS = MS
break
@@ -31,7 +31,7 @@
for(var/obj/item/device/pda/check_pda in PDAs)
var/datum/data/pda/app/messenger/check_m = check_pda.find_program(/datum/data/pda/app/messenger)
- if (!check_m || !check_m.can_receive())
+ if(!check_m || !check_m.can_receive())
continue
viables.Add(check_pda)
@@ -92,12 +92,12 @@
"You have won tickets to the newest romantic comedy 16 RULES OF LOVE!",\
"You have won tickets to the newest thriller THE CULT OF THE SLEEPING ONE!")
- if (useMS.send_pda_message("[P.owner]", sender, message)) //Message been filtered by spam filter.
+ if(useMS.send_pda_message("[P.owner]", sender, message)) //Message been filtered by spam filter.
return
last_spam_time = world.time
- if (prob(50)) //Give the AI an increased chance to intercept the message
+ if(prob(50)) //Give the AI an increased chance to intercept the message
for(var/mob/living/silicon/ai/ai in mob_list)
// Allows other AIs to intercept the message but the AI won't intercept their own message.
if(ai.aiPDA != P && ai.aiPDA != src)
diff --git a/code/modules/events/radiation_storm.dm b/code/modules/events/radiation_storm.dm
index f798e9984d4..54a2bb41bb9 100644
--- a/code/modules/events/radiation_storm.dm
+++ b/code/modules/events/radiation_storm.dm
@@ -24,6 +24,7 @@
command_announcement.Announce("High levels of radiation detected near the station. Please evacuate into one of the shielded maintenance tunnels.", "Anomaly Alert", new_sound = 'sound/AI/radiation.ogg')
for(var/area/A in world)
+ // TODO: Tie into space manager
if(!(A.z in config.station_levels) || is_safe_zone(A))
continue
A.radiation_alert()
@@ -42,6 +43,7 @@
var/turf/T = get_turf(H)
if(!T)
continue
+ // TODO: Tie into space manager
if(!(T.z in config.station_levels) || is_safe_zone(T.loc))
continue
@@ -49,7 +51,7 @@
H.apply_effect((rand(15,35)),IRRADIATE,0)
if(prob(5))
H.apply_effect((rand(40,70)),IRRADIATE,0)
- if (prob(75))
+ if(prob(75))
randmutb(H) // Applies bad mutation
domutcheck(H,null,1)
else
@@ -61,6 +63,7 @@
command_announcement.Announce("The station has passed the radiation belt. Please report to medbay if you experience any unusual symptoms. Maintenance will lose all access again shortly.", "Anomaly Alert")
for(var/area/A in world)
+ // TODO: Tie into space manager
if(!(A.z in config.station_levels) || is_safe_zone(A))
continue
A.reset_radiation_alert()
diff --git a/code/modules/events/rogue_drones.dm b/code/modules/events/rogue_drones.dm
index 2d7316cc0ef..455312baa99 100644
--- a/code/modules/events/rogue_drones.dm
+++ b/code/modules/events/rogue_drones.dm
@@ -25,11 +25,11 @@
/datum/event/rogue_drone/announce()
var/msg
if(prob(33))
- msg = "A combat drone wing operating out of the NMV Icarus has failed to return from a sweep of this sector, if any are sighted approach with caution."
+ msg = "A combat drone wing operating out of the NSV Icarus has failed to return from a sweep of this sector, if any are sighted approach with caution."
else if(prob(50))
- msg = "Contact has been lost with a combat drone wing operating out of the NMV Icarus. If any are sighted in the area, approach with caution."
+ msg = "Contact has been lost with a combat drone wing operating out of the NSV Icarus. If any are sighted in the area, approach with caution."
else
- msg = "Unidentified hackers have targetted a combat drone wing deployed from the NMV Icarus. If any are sighted in the area, approach with caution."
+ msg = "Unidentified hackers have targetted a combat drone wing deployed from the NSV Icarus. If any are sighted in the area, approach with caution."
command_announcement.Announce(msg, "Rogue drone alert")
/datum/event/rogue_drone/tick()
@@ -41,7 +41,7 @@
var/datum/effect/system/spark_spread/sparks = new /datum/effect/system/spark_spread()
sparks.set_up(3, 0, D.loc)
sparks.start()
- D.z = 2
+ D.z = ZLEVEL_CENTCOMM
D.has_loot = 0
qdel(D)
diff --git a/code/modules/events/spider_infestation.dm b/code/modules/events/spider_infestation.dm
index a628e3130ed..2c46fc8dffa 100644
--- a/code/modules/events/spider_infestation.dm
+++ b/code/modules/events/spider_infestation.dm
@@ -16,6 +16,7 @@
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
+ // TODO: Tie into space manager
if((temp_vent.loc.z in config.station_levels) && !temp_vent.welded)
if(temp_vent.parent.other_atmosmch.len > 50)
vents += temp_vent
@@ -26,4 +27,4 @@
if(prob(66))
S.grow_as = /mob/living/simple_animal/hostile/poison/giant_spider/nurse
vents -= vent
- spawncount--
\ No newline at end of file
+ spawncount--
diff --git a/code/modules/events/traders.dm b/code/modules/events/traders.dm
new file mode 100644
index 00000000000..e4c7d95fb89
--- /dev/null
+++ b/code/modules/events/traders.dm
@@ -0,0 +1,87 @@
+var/global/list/unused_trade_stations = list("sol")
+
+// Traders event.
+// Heavily copy-pasted from "heist" gamemode.
+
+/datum/event/traders
+ var/success_spawn = 0
+ var/station = null
+ var/spawn_count = 3
+ var/list/trader_objectives = list()
+
+/datum/event/traders/setup()
+ if(unused_trade_stations.len)
+ station = pick_n_take(unused_trade_stations)
+
+/datum/event/traders/start()
+ if(!station) // If there are no unused stations, just no.
+ return
+ var/list/spawnlocs = list()
+ for(var/obj/effect/landmark/landmark in landmarks_list)
+ if(landmark.name == "traderstart_[station]")
+ spawnlocs += get_turf(landmark)
+ if(!spawnlocs.len)
+ return
+
+ trader_objectives = forge_trader_objectives()
+
+ spawn()
+ var/list/candidates = pollCandidates("Do you want to play as a trader?", ROLE_TRADER, 1)
+ var/index = 1
+ while(spawn_count > 0 && candidates.len > 0)
+ if(index > spawnlocs.len)
+ index = 1
+
+ var/turf/picked_loc = spawnlocs[index]
+ index++
+ var/mob/C = pick_n_take(candidates)
+ if(C)
+ respawnable_list -= C.client
+ var/mob/living/carbon/human/M = create_trader(picked_loc)
+ M.ckey = C.ckey
+ M.mind.objectives += trader_objectives
+ greet_trader(M)
+ success_spawn = 1
+ if(!success_spawn)
+ unused_trade_stations += station // Return the station to the list of usable stations.
+
+/datum/event/traders/proc/create_trader(var/turf/picked_loc)
+ var/mob/living/carbon/human/M
+ switch(station)
+ if("sol")
+ M = new /mob/living/carbon/human(picked_loc)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/cargotech(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/industrial(M), slot_back)
+ var/obj/item/weapon/card/id/supply/W = new(M)
+ W.name = "[M.real_name]'s ID Card (Sol Trader)"
+ W.assignment = "Sol Trader"
+ W.registered_name = M.real_name
+ W.access = list(access_trade_sol, access_maint_tunnels, access_external_airlocks)
+ M.equip_to_slot_or_del(W, slot_wear_id)
+ return M
+
+/datum/event/traders/proc/greet_trader(var/mob/living/carbon/human/M)
+ to_chat(M, "You are a trader!")
+ to_chat(M, "You are currently docked at [get_area(M)].")
+ to_chat(M, "You are about to trade with NSS Cyberiad.")
+ to_chat(M, "Negotiate an agreement, and request docking.")
+ spawn(25)
+ show_objectives(M.mind)
+
+/datum/event/traders/proc/forge_trader_objectives()
+ var/i = 1
+ var/max_objectives = pick(2, 2, 2, 2, 3, 3, 3, 4)
+ var/list/objs = list()
+ var/list/goals = list("stockparts")
+ while(i<= max_objectives)
+ var/goal = pick(goals)
+ var/datum/objective/trade/O
+ if(goal == "stockparts")
+ O = new /datum/objective/trade/stock(station)
+ O.choose_target()
+ objs += O
+
+ i++
+ return objs
diff --git a/code/modules/events/undead.dm b/code/modules/events/undead.dm
index 2ff8d05c20a..3399c69c979 100644
--- a/code/modules/events/undead.dm
+++ b/code/modules/events/undead.dm
@@ -2,13 +2,14 @@
var/spawn_prob = 10
startWhen = 2
announceWhen = 3
-
+
/datum/event/undead/start()
var/datum/event/electrical_storm/RS = new
RS.lightsoutAmount = pick(2,2,3)
RS.start()
RS.kill()
for(var/area/A)
+ // TODO: Tie into space manager
if(!(A.z in config.station_levels)) continue //Spook on main station only.
if(A.luminosity) continue
// if(A.lighting_space) continue
@@ -34,7 +35,7 @@
80;/mob/living/simple_animal/hostile/retaliate/zombie,
60;/mob/living/simple_animal/hostile/retaliate/ghost)
new undeadtype(T)
-
+
/datum/event/undead/announce()
for(var/mob/living/M in player_list)
to_chat(M, "You feel [pick("a chill","a deathly chill","the undead","dirty", "creeped out","afraid","fear")]!")
diff --git a/code/modules/events/vent_clog.dm b/code/modules/events/vent_clog.dm
index fae640a73cb..de4e62215a8 100644
--- a/code/modules/events/vent_clog.dm
+++ b/code/modules/events/vent_clog.dm
@@ -11,6 +11,7 @@
/datum/event/vent_clog/setup()
endWhen = rand(25, 100)
for(var/obj/machinery/atmospherics/unary/vent_scrubber/temp_vent in machines)
+ // TODO: Tie into space manager
if((temp_vent.loc.z in config.station_levels))
if(temp_vent.parent.other_atmosmch.len > 50)
vents += temp_vent
diff --git a/code/modules/events/wormholes.dm b/code/modules/events/wormholes.dm
index 16daa8fe7c9..1f3aa1355cd 100644
--- a/code/modules/events/wormholes.dm
+++ b/code/modules/events/wormholes.dm
@@ -13,10 +13,11 @@
/datum/event/wormholes/start()
for(var/turf/simulated/floor/T in world)
+ // TODO: Tie into space manager
if((T.z in config.station_levels))
pick_turfs += T
- for(var/i = 1, i <= number_of_wormholes, i++)
+ for(var/i in 1 to number_of_wormholes)
var/turf/T = pick(pick_turfs)
wormholes += new /obj/effect/portal/wormhole(T, null, null, -1)
@@ -30,9 +31,8 @@
if(T) O.loc = T
/datum/event/wormholes/end()
- portals.Remove(wormholes)
for(var/obj/effect/portal/wormhole/O in wormholes)
- O.loc = null
+ qdel(O)
wormholes.Cut()
@@ -62,4 +62,4 @@
if(P && isturf(P.loc))
target = P.loc
if(!target) return
- do_teleport(M, target, 1, 1, 0, 0) ///You will appear adjacent to the beacon
\ No newline at end of file
+ do_teleport(M, target, 1, 1, 0, 0) ///You will appear adjacent to the beacon
diff --git a/code/modules/examine/descriptions/weapons.dm b/code/modules/examine/descriptions/weapons.dm
index 90929d31e08..264e0e99dfe 100644
--- a/code/modules/examine/descriptions/weapons.dm
+++ b/code/modules/examine/descriptions/weapons.dm
@@ -26,7 +26,7 @@
then click where you want to fire. Most energy weapons can fire through windows harmlessly. To switch between stun and lethal, click the weapon \
in your hand. To recharge this weapon, use a weapon recharger."
-/obj/item/weapon/gun/energy/advtaser
+/obj/item/weapon/gun/energy/gun/advtaser
description_info = "This is an energy weapon. To fire the weapon, have your gun mode set to 'fire', \
then click where you want to fire. To recharge this weapon, use a weapon recharger. \
To switch between insta-stun and disabler beams, click the weapon in your hand. This weapon can only fire through glass if it is set to disabler beams."
@@ -55,11 +55,6 @@
then click where you want to fire. After firing, you will need to pump the gun, by clicking on the gun in your hand. To reload, load more shotgun \
shells into the gun."
-/obj/item/weapon/gun/projectile/heavysniper
- description_info = "This is a ballistic weapon. To fire the weapon, have your gun mode set to 'fire', \
- then click where you want to fire. The gun's chamber can be opened or closed by using it in your hand. To reload, open the chamber, add a new bullet \
- then close it. To use the scope, use the appropriate verb in the object tab."
-
//*******
//*Melee*
//*******
diff --git a/code/modules/examine/examine.dm b/code/modules/examine/examine.dm
index c4d54a44ab6..0956877d202 100644
--- a/code/modules/examine/examine.dm
+++ b/code/modules/examine/examine.dm
@@ -46,7 +46,7 @@
description_holders["antag"] = (update_antag_info)? A.get_description_antag() : ""
description_holders["name"] = "[A.name]"
- description_holders["icon"] = "\icon[A]"
+ description_holders["icon"] = "[bicon(A)]"
description_holders["desc"] = A.desc
/client/Stat()
diff --git a/code/modules/fish/fish_eggs.dm b/code/modules/fish/fish_eggs.dm
index e4283718a53..493f3dcf1db 100644
--- a/code/modules/fish/fish_eggs.dm
+++ b/code/modules/fish/fish_eggs.dm
@@ -4,7 +4,7 @@
desc = "Eggs laid by a fish. This cluster seems... empty?"
icon = 'icons/obj/fish_items.dmi'
icon_state = "eggs"
- w_class = 2.0
+ w_class = 2
var/fish_type = null //Holds the name of the fish that the egg is for
/obj/item/fish_eggs/New()
diff --git a/code/modules/fish/fish_items.dm b/code/modules/fish/fish_items.dm
index 00659104480..0266f06df90 100644
--- a/code/modules/fish/fish_items.dm
+++ b/code/modules/fish/fish_items.dm
@@ -23,7 +23,7 @@ var/global/list/fish_items_list = list("goldfish" = /obj/item/weapon/fish/goldfi
icon_state = "egg_scoop"
slot_flags = SLOT_BELT
throwforce = 0
- w_class = 2.0
+ w_class = 2
throw_speed = 3
throw_range = 7
@@ -34,7 +34,7 @@ var/global/list/fish_items_list = list("goldfish" = /obj/item/weapon/fish/goldfi
icon_state = "net"
slot_flags = SLOT_BELT
throwforce = 0
- w_class = 2.0
+ w_class = 2
throw_speed = 3
throw_range = 7
@@ -48,7 +48,7 @@ var/global/list/fish_items_list = list("goldfish" = /obj/item/weapon/fish/goldfi
icon = 'icons/obj/fish_items.dmi'
icon_state = "fish_food"
throwforce = 1
- w_class = 2.0
+ w_class = 2
throw_speed = 3
throw_range = 7
@@ -59,7 +59,7 @@ var/global/list/fish_items_list = list("goldfish" = /obj/item/weapon/fish/goldfi
icon_state = "brush"
slot_flags = SLOT_BELT
throwforce = 0
- w_class = 2.0
+ w_class = 2
throw_speed = 3
throw_range = 7
attack_verb = list("scrubbed", "brushed", "scraped")
@@ -103,7 +103,7 @@ var/global/list/fish_items_list = list("goldfish" = /obj/item/weapon/fish/goldfi
icon = 'icons/obj/fish_items.dmi'
icon_state = "fish"
throwforce = 1
- w_class = 2.0
+ w_class = 2
throw_speed = 3
throw_range = 7
force = 1
diff --git a/code/modules/fish/fishtank.dm b/code/modules/fish/fishtank.dm
index 6da71b3adb2..005fce56df0 100644
--- a/code/modules/fish/fishtank.dm
+++ b/code/modules/fish/fishtank.dm
@@ -415,7 +415,7 @@
examine_message += "\The [src] is about three-quarters filled. "
else if(water_level < water_capacity)
examine_message += "\The [src] is nearly full! "
- else if (water_level == water_capacity)
+ else if(water_level == water_capacity)
examine_message += "\The [src] is full! "
examine_message += " Cleanliness level: "
@@ -558,7 +558,7 @@
/obj/machinery/fishtank/attack_slime(mob/living/user as mob)
var/mob/living/carbon/slime/S = user
- if (!S.is_adult)
+ if(!S.is_adult)
return
attack_generic(user, rand(10, 15))
@@ -567,7 +567,7 @@
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!"))
user.visible_message("[user] smashes through [src]!")
destroy()
- else if (usr.a_intent == I_HARM)
+ else if(usr.a_intent == I_HARM)
user.changeNext_move(CLICK_CD_MELEE)
playsound(get_turf(src), 'sound/effects/glassknock.ogg', 80, 1)
usr.visible_message("[usr.name] bangs against the [src.name]!", \
diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm
index c4088d9a53f..81038eaf463 100644
--- a/code/modules/flufftext/Hallucination.dm
+++ b/code/modules/flufftext/Hallucination.dm
@@ -295,29 +295,29 @@ Gunshots/explosions/opening doors/less rare audio (done)
switch(rand(1,5))
if(1) //Laser fight
for(var/i=0,i 0,i--) //Pick a few words to stutter on.
- if (!unstuttered_words.len)
+ if(!unstuttered_words.len)
break
var/word = pick(unstuttered_words)
unstuttered_words -= word //Remove from unstuttered words so we don't stutter it again.
diff --git a/code/modules/food_and_drinks/drinks/bottler/bottler.dm b/code/modules/food_and_drinks/drinks/bottler/bottler.dm
new file mode 100644
index 00000000000..7e764595fd5
--- /dev/null
+++ b/code/modules/food_and_drinks/drinks/bottler/bottler.dm
@@ -0,0 +1,414 @@
+
+//adjust these to change the maximum capacity of the bottler for each container type
+#define MAX_GLASS 10
+#define MAX_PLAST 20
+#define MAX_METAL 25
+
+//adjust these to change the number of containers the bottler will make per sheet
+#define RATIO_GLASS 1
+#define RATIO_PLAST 2
+#define RATIO_METAL 5
+
+/obj/machinery/bottler
+ name = "bottler unit"
+ desc = "A machine that combines ingredients and bottles the resulting beverages."
+ icon = 'icons/obj/kitchen.dmi'
+ icon_state = "bottler_off"
+ density = 1
+ anchored = 1
+ var/list/slots[3]
+ var/list/datum/bottler_recipe/available_recipes
+ var/list/acceptable_items
+ var/list/containers = list("glass bottle" = 10, "plastic bottle" = 20, "metal can" = 25)
+ var/bottling = 0
+
+/obj/machinery/bottler/New()
+ if(!available_recipes)
+ available_recipes = list()
+ acceptable_items = list()
+ //These are going to be acceptable even if they aren't in a recipe
+ acceptable_items |= /obj/item/weapon/reagent_containers/food/snacks
+ acceptable_items |= /obj/item/weapon/reagent_containers/food/drinks/cans
+ //the rest is based on what is used in recipes so we don't have people destroying the nuke disc
+ for(var/type in subtypesof(/datum/bottler_recipe))
+ var/datum/bottler_recipe/recipe = new type
+ if(recipe.result) // Ignore recipe subtypes that lack a result
+ available_recipes += recipe
+ for(var/i = 1, i <= recipe.ingredients.len, i++)
+ acceptable_items |= recipe.ingredients[i]
+ else
+ qdel(recipe)
+
+/obj/machinery/bottler/attackby(obj/item/O, mob/user, params)
+ if(iswrench(O)) //This being before the canUnequip check allows borgs to (un)wrench bottlers in case they need move them to fix stuff
+ playsound(src, 'sound/items/Ratchet.ogg', 50, 1)
+ if(anchored)
+ anchored = 0
+ to_chat(user, "[src] can now be moved.")
+ else
+ anchored = 1
+ to_chat(user, "[src] is now secured.")
+ return 1
+ if(!user.canUnEquip(O, 0))
+ to_chat(user, "[O] is stuck to your hand, you can't seem to put it down!")
+ return 0
+ if(is_type_in_list(O,acceptable_items))
+ if(istype(O, /obj/item/weapon/reagent_containers/food/snacks))
+ var/obj/item/weapon/reagent_containers/food/snacks/S = O
+ user.unEquip(S)
+ if(S.reagents && !S.reagents.total_volume) //This prevents us from using empty foods, should one occur due to some sort of error
+ to_chat(user, "[S] is gone, oh no!")
+ qdel(S) //Delete the food object because it is useless even as food due to the lack of reagents
+ else
+ insert_item(S, user)
+ return 1
+ else if(istype(O, /obj/item/weapon/reagent_containers/food/drinks/cans))
+ var/obj/item/weapon/reagent_containers/food/drinks/cans/C = O
+ if(C.reagents)
+ if(C.canopened && C.reagents.total_volume) //This prevents us from using opened cans that still have something in them
+ to_chat(user, "Only unopened cans and bottles can be processed to ensure product integrity.")
+ return 0
+ user.unEquip(C)
+ if(!C.reagents.total_volume) //Empty cans get recycled, even if they have somehow remained unopened due to some sort of error
+ recycle_container(C)
+ else //Full cans that are unopened get inserted for processing as ingredients
+ insert_item(C, user)
+ return 1
+ else
+ user.unEquip(O)
+ insert_item(O, user)
+ return 1
+ else if(istype(O, /obj/item/trash/can)) //Crushed cans (and bottles) are returnable still
+ var/obj/item/trash/can/C = O
+ user.unEquip(C)
+ recycle_container(C)
+ return 1
+ else if(istype(O, /obj/item/stack/sheet)) //Sheets of materials can replenish the machine's supply of drink containers (when people inevitably don't return them)
+ var/obj/item/stack/sheet/S = O
+ user.unEquip(S)
+ process_sheets(S)
+ return 1
+ else //If it doesn't qualify in the above checks, we don't want it. Inform the person so they (ideally) stop trying to put the nuke disc in.
+ to_chat(user, "You aren't sure this is able to be processed by the machine.")
+ return 0
+ //..()
+
+/obj/machinery/bottler/proc/insert_item(obj/item/O, mob/user)
+ if(!O || !user)
+ return
+ if(slots[1] && slots[2] && slots[3])
+ to_chat(user, "[src] is full, please remove or process the contents first.")
+ return
+ var/slot_inserted = 0
+ for(var/i = 1, i <= slots.len, i++)
+ if(!slots[i])
+ slots[i] = O
+ slot_inserted = i
+ break
+ if(!slot_inserted)
+ to_chat(user, "Something went wrong and the machine spits out [O].")
+ O.forceMove(loc)
+ else
+ to_chat(user, "You load [O] into the [slot_inserted]\th ingredient tray.")
+ O.forceMove(src)
+ updateUsrDialog()
+
+/obj/machinery/bottler/proc/eject_items(var/slot)
+ var/obj/item/O = null
+ if(!slot)
+ for(var/i = 1, i <= slots.len, i++)
+ if(slots[i])
+ O = slots[i]
+ O.forceMove(loc)
+ slots[i] = null
+ visible_message("[src] beeps as it ejects the contents of all the ingredient trays.")
+ else
+ if(slots[slot]) //ensures the tray actually has something to eject so we don't runtime on trying to reference null
+ O = slots[slot]
+ O.forceMove(loc)
+ slots[slot] = null
+ visible_message("[src] beeps as it ejects [O.name] from the [slot]\th ingredient tray.")
+ updateUsrDialog()
+
+/obj/machinery/bottler/proc/recycle_container(obj/item/O)
+ if(!O)
+ return
+ var/con_type
+ var/max_define
+ if(istype(O, /obj/item/trash/can))
+ var/obj/item/trash/can/C = O
+ if(C.is_glass)
+ con_type = "glass bottle"
+ max_define = MAX_GLASS
+ else if(C.is_plastic)
+ con_type = "plastic bottle"
+ max_define = MAX_PLAST
+ else
+ con_type = "metal can"
+ max_define = MAX_METAL
+ else if(istype(O, /obj/item/weapon/reagent_containers/food/drinks/cans))
+ var/obj/item/weapon/reagent_containers/food/drinks/cans/C = O
+ if(C.is_glass)
+ con_type = "glass bottle"
+ max_define = MAX_GLASS
+ else if(C.is_plastic)
+ con_type = "plastic bottle"
+ max_define = MAX_PLAST
+ else
+ con_type = "metal can"
+ max_define = MAX_METAL
+ if(con_type)
+ if(containers[con_type] < max_define)
+ containers[con_type]++
+ visible_message("[src] whirs briefly as it prepares the container for reuse.")
+ qdel(O)
+ updateUsrDialog()
+ else
+ visible_message("[src] cannot store any more cans at this time. Please fill some before recycling more.")
+ O.forceMove(loc)
+
+/obj/machinery/bottler/proc/process_sheets(obj/item/stack/sheet/S)
+ if(!S)
+ return
+ S.forceMove(loc)
+ var/con_type
+ var/max_define
+ var/mat_ratio
+ //Glass sheets for glass bottles (1 bottle per sheet)
+ if(istype(S, /obj/item/stack/sheet/glass))
+ con_type = "glass bottle"
+ max_define = MAX_GLASS
+ mat_ratio = RATIO_GLASS
+ else if(istype(S, /obj/item/stack/sheet/mineral/plastic))
+ con_type = "plastic bottle"
+ max_define = MAX_PLAST
+ mat_ratio = RATIO_PLAST
+ else if(istype(S, /obj/item/stack/sheet/metal))
+ con_type = "metal can"
+ max_define = MAX_METAL
+ mat_ratio = RATIO_METAL
+ else
+ visible_message("[src] rejects the unusable materials.")
+ return
+ var/missing
+ var/sheets_needed
+ var/sheets_to_use
+ if(con_type)
+ missing = max_define - containers[con_type]
+ sheets_needed = round(missing / mat_ratio, 1)
+ if(missing % mat_ratio)
+ sheets_needed += 1
+ sheets_to_use = min(sheets_needed, S.amount)
+ if(missing)
+ visible_message("[src] shudders as it converts [sheets_to_use] [S.singular_name]\s into new [con_type]s.")
+ containers[con_type] += sheets_to_use * mat_ratio
+ containers[con_type] = min(containers[con_type], max_define)
+ S.use(sheets_to_use)
+ else
+ visible_message("[src] rejects the [S] because it already is fully stocked with [con_type]s.")
+
+/obj/machinery/bottler/proc/select_recipe()
+ for(var/datum/bottler_recipe/recipe in available_recipes)
+ var/number_matches = 0
+ for(var/i = 1, i <= slots.len, i++)
+ var/obj/item/O = slots[i]
+ if(istype(O, recipe.ingredients[i]))
+ if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown))
+ var/obj/item/weapon/reagent_containers/food/snacks/grown/G = O
+ if(G.seed && G.seed.kitchen_tag == recipe.tags[i])
+ number_matches++
+ else
+ number_matches++
+ if(number_matches == 3)
+ return recipe
+ return null
+
+/obj/machinery/bottler/proc/dispense_empty_container(container)
+ var/con_type
+ var/obj/item/weapon/reagent_containers/food/drinks/cans/bottler/drink_container
+ switch(container)
+ if(1) //glass bottle
+ con_type = "glass bottle"
+ drink_container = /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/glass_bottle
+ if(2) //plastic bottle
+ con_type = "plastic bottle"
+ drink_container = /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/plastic_bottle
+ if(3) //metal can
+ con_type = "metal can"
+ drink_container = /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/metal_can
+ if(containers[con_type])
+ //empties aren't sealed, so let's open it quietly
+ drink_container = new drink_container()
+ drink_container.canopened = 1
+ drink_container.flags |= OPENCONTAINER
+ drink_container.forceMove(loc)
+ containers[con_type]--
+
+/obj/machinery/bottler/proc/process_ingredients(container)
+ //stop if we have ZERO ingredients (what would you process?)
+ if(!slots[1] && !slots[2] && !slots[3])
+ visible_message("There are no ingredients to process! Please insert some first.")
+ return
+ //prep a container
+ var/obj/item/weapon/reagent_containers/food/drinks/cans/bottler/drink_container
+ var/con_type
+ switch(container)
+ if(1) //glass bottle
+ con_type = "glass bottle"
+ drink_container = /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/glass_bottle
+ if(2) //plastic bottle
+ con_type = "plastic bottle"
+ drink_container = /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/plastic_bottle
+ if(3) //metal can
+ con_type = "metal can"
+ drink_container = /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/metal_can
+
+ if(!con_type)
+ visible_message("Error 404: Drink Container Not Found.")
+ return
+ if(!containers[con_type])
+ visible_message("Error 503: Out of [con_type]s.")
+ return
+ else
+ drink_container = new drink_container()
+ containers[con_type]--
+ //select and process a recipe based on inserted ingredients
+ visible_message("[src] hums as it processes the ingredients...")
+ bottling = 1
+ var/datum/bottler_recipe/recipe_to_use = select_recipe()
+ if(!recipe_to_use)
+ //bad recipe, ruins the drink
+ var/contents = pick("thick goop", "pungent sludge", "unspeakable slurry", "gross-looking concoction", "eldritch abomination of liquids")
+ visible_message("The [con_type] fills with \an [contents]...")
+ drink_container.reagents.add_reagent(pick("????", "toxic_slurry", "meatslurry", "glowing_slury", "fishwater"), pick(30, 50))
+ drink_container.name = "Liquid Mistakes"
+ drink_container.desc = "WARNING: CONTENTS MAY BE AWFUL, DRINK AT OWN RISK."
+ else
+ //good recipe, make it
+ visible_message("The [con_type] fills with a delicious-looking beverage!")
+ drink_container.reagents.add_reagent(recipe_to_use.result, 50)
+ drink_container.name = "[recipe_to_use.name]"
+ drink_container.desc = "[recipe_to_use.description]"
+ flick("bottler_on", src)
+ spawn(45)
+ for(var/i = 1, i <= slots.len, i++)
+ qdel(slots[i])
+ slots[i] = null
+ bottling = 0
+ drink_container.forceMove(loc)
+ updateUsrDialog()
+
+/obj/machinery/bottler/attack_ai(mob/user)
+ attack_hand(user)
+
+/obj/machinery/bottler/attack_ghost(mob/user)
+ attack_hand(user)
+
+/obj/machinery/bottler/attack_hand(mob/user)
+ if(stat & BROKEN)
+ return
+ interact(user)
+
+/obj/machinery/bottler/interact(mob/user)
+ user.set_machine(src)
+ //html ahoy
+ var/dat = ""
+ if(bottling)
+ dat = "
Insert three ingredients and press process to create a beverage. You will be able to select a container for the beverage before processing begins.
"
+ dat += "
Inserting empty bottles and cans, as well as sheets of glass, plastic, or metal will restock the appropriate container supply.
"
+ var/datum/browser/popup = new(user, "bottler", "Bottler Menu", 575, 400)
+ popup.set_content(dat)
+ popup.open()
+
+/obj/machinery/bottler/Topic(href, href_list)
+ if(..())
+ return 1
+ if(bottling)
+ return
+
+ add_fingerprint(usr)
+ usr.set_machine(src)
+
+ if(href_list["process"])
+ var/list/choices = list("Glass Bottle" = 1, "Plastic Bottle" = 2, "Metal Can" = 3)
+ var/selection = input("Select a container for your beverage.", "Container") as null|anything in choices
+ if(!selection)
+ return
+ else
+ selection = choices[selection]
+ process_ingredients(selection)
+
+ if(href_list["eject"])
+ var/slot = text2num(href_list["eject"])
+ eject_items(slot)
+
+ if(href_list["dispense"])
+ var/container = text2num(href_list["dispense"])
+ dispense_empty_container(container)
+
+ updateUsrDialog()
+ return
+
+/obj/machinery/bottler/update_icon()
+ if(stat & BROKEN)
+ icon_state = "bottler_broken"
+ else if(bottling)
+ icon_state = "bottler_on"
+ else
+ icon_state = "bottler_off"
\ No newline at end of file
diff --git a/code/modules/food_and_drinks/drinks/bottler/bottler_recipes.dm b/code/modules/food_and_drinks/drinks/bottler/bottler_recipes.dm
new file mode 100644
index 00000000000..be7504afade
--- /dev/null
+++ b/code/modules/food_and_drinks/drinks/bottler/bottler_recipes.dm
@@ -0,0 +1,86 @@
+
+/datum/bottler_recipe
+ var/name = ""
+ var/description = ""
+ var/list/ingredients[3]
+ var/list/tags[3]
+ var/datum/reagent/result = null
+
+
+/* Example of how a bottler_recipe should look:
+/datum/bottler_recipe/example
+ name = "Example"
+ description = "This is an example."
+ ingredients = list(thing_1, thing_2, thing_3)
+ tags = list(null, "tag_2", null)
+ result = "water"
+
+The ingredients list must have 3 non-null entries.
+The tags list must have 3 entries, using null where a tag is unused.
+Failing to ensure both lists have EXACTLY 3 entries (unless the system is updated in the future to use a different number) will result in runtimes.
+There is no excuse to do this wrong now that there is an example for you. --FalseIncarnate
+*/
+
+
+/datum/bottler_recipe/Paradise_Punch
+ name = "Paradise Punch"
+ description = "Tastes just how you'd think Paradise would if you could bottle it."
+ ingredients = list(/obj/item/weapon/reagent_containers/food/snacks/grown,
+ /obj/item/weapon/reagent_containers/food/snacks/grown,
+ /obj/item/weapon/reagent_containers/food/snacks/grown)
+ tags = list("grapes", "banana", "cherries")
+ result = "paradise_punch"
+
+/datum/bottler_recipe/Applepocalypse
+ name = "Apple-pocalypse"
+ description = "If doomsday came in fruit form, it'd probably be apples."
+ ingredients = list(/obj/item/weapon/reagent_containers/food/snacks/grown,
+ /obj/item/weapon/reagent_containers/food/snacks/grown,
+ /obj/item/weapon/reagent_containers/food/snacks/grown)
+ tags = list("apple", "apple", "apple")
+ result = "apple-pocalypse"
+
+/datum/bottler_recipe/Berry_Banned
+ name = "Berry Banned"
+ description = "Reason for ban: Excessive Flavor."
+ ingredients = list(/obj/item/weapon/reagent_containers/food/snacks/grown,
+ /obj/item/weapon/reagent_containers/food/snacks/grown,
+ /obj/item/weapon/reagent_containers/food/snacks/grown)
+ tags = list("berries", "berries", "berries")
+ result = "berry_banned"
+
+/datum/bottler_recipe/Berry_Banned2
+ name = "Berry Banned"
+ description = "Reason for ban: Excessive Flavor."
+ ingredients = list(/obj/item/weapon/reagent_containers/food/snacks/grown,
+ /obj/item/weapon/reagent_containers/food/snacks/grown,
+ /obj/item/weapon/reagent_containers/food/snacks/grown)
+ tags = list("poisonberries", "poisonberries", "poisonberries")
+ result = "berry_banned2"
+
+/datum/bottler_recipe/Blackeye_Brew
+ name = "Blackeye Brew"
+ description = "Creamy, smooth flavor, just like the bald heads of the masses. Supposedly aged for 30 years."
+ ingredients = list(/obj/item/weapon/reagent_containers/food/drinks/cans/cola,
+ /obj/item/weapon/reagent_containers/food/snacks/grown,
+ /obj/item/weapon/reagent_containers/food/snacks/icecream)
+ tags = list(null, "sugarcane", null)
+ result = "blackeye_brew"
+
+/datum/bottler_recipe/Grape_Granade
+ name = "Grape Granade"
+ description = "Exploding with grape flavor and a favorite among ERT members system-wide."
+ ingredients = list(/obj/item/weapon/reagent_containers/food/drinks/cans/grape_juice,
+ /obj/item/weapon/reagent_containers/food/snacks/grown,
+ /obj/item/device/flash)
+ tags = list(null, "grapes", null)
+ result = "grape_granade"
+
+/datum/bottler_recipe/Meteor_Malt
+ name = "Meteor Malt"
+ description = "Soft drinks have been detected on collision course with your tastebuds."
+ ingredients = list(/obj/item/weapon/ore,
+ /obj/item/weapon/reagent_containers/food/snacks/grown,
+ /obj/item/weapon/ore)
+ tags = list(null, "wheat", null)
+ result = "meteor_malt"
diff --git a/code/modules/reagents/reagent_containers/food/drinks.dm b/code/modules/food_and_drinks/drinks/drinks.dm
similarity index 66%
rename from code/modules/reagents/reagent_containers/food/drinks.dm
rename to code/modules/food_and_drinks/drinks/drinks.dm
index d6a5d37012a..15ce27b7d5c 100644
--- a/code/modules/reagents/reagent_containers/food/drinks.dm
+++ b/code/modules/food_and_drinks/drinks/drinks.dm
@@ -1,363 +1,334 @@
-////////////////////////////////////////////////////////////////////////////////
-/// Drinks.
-////////////////////////////////////////////////////////////////////////////////
-/obj/item/weapon/reagent_containers/food/drinks
- name = "drink"
- desc = "yummy"
- icon = 'icons/obj/drinks.dmi'
- icon_state = null
- flags = OPENCONTAINER
- consume_sound = 'sound/items/drink.ogg'
- possible_transfer_amounts = list(5,10,25)
- volume = 50
-
-/obj/item/weapon/reagent_containers/food/drinks/New()
- ..()
- bitesize = amount_per_transfer_from_this
- if(bitesize < 5)
- bitesize = 5
-
-/obj/item/weapon/reagent_containers/food/drinks/attack_self(mob/user as mob)
- return
-
-/obj/item/weapon/reagent_containers/food/drinks/attack(mob/M as mob, mob/user as mob, def_zone)
- if(!reagents || !reagents.total_volume)
- to_chat(user, " None of [src] left, oh no!")
- return 0
-
- if(istype(M, /mob/living/carbon))
- var/mob/living/carbon/C = M
- if(C.eat(src, user))
- if(isrobot(user)) //Cyborg modules that include drinks automatically refill themselves, but drain the borg's cell
- var/mob/living/silicon/robot/borg = user
- borg.cell.use(30)
- var/refill = reagents.get_master_reagent_id()
- if(refill in drinks) // Only synthesize drinks
- spawn(600)
- reagents.add_reagent(refill, bitesize)
- return 1
- return 0
-
-/obj/item/weapon/reagent_containers/food/drinks/afterattack(obj/target, mob/user, proximity)
- if(!proximity) return
-
- // Moved from the can code; not necessary since closed cans aren't open containers now, but, eh.
- if (istype(target, /obj/item/weapon/reagent_containers/food/drinks/cans))
- var/obj/item/weapon/reagent_containers/food/drinks/cans/cantarget = target
- if(cantarget.canopened == 0)
- to_chat(user, "You need to open the drink you want to pour into!")
- return
-
- if(istype(target, /obj/structure/reagent_dispensers)) //A dispenser. Transfer FROM it TO us.
-
- if(!target.reagents.total_volume)
- to_chat(user, " [target] is empty.")
- return
-
- if(reagents.total_volume >= reagents.maximum_volume)
- to_chat(user, " [src] is full.")
- return
-
- var/trans = target.reagents.trans_to(src, target:amount_per_transfer_from_this)
- to_chat(user, " You fill [src] with [trans] units of the contents of [target].")
-
- else if(target.is_open_container()) //Something like a glass. Player probably wants to transfer TO it.
- if(!reagents.total_volume)
- to_chat(user, " [src] is empty.")
- return
-
- if(target.reagents.total_volume >= target.reagents.maximum_volume)
- to_chat(user, " [target] is full.")
- return
-
-
-
- var/datum/reagent/refill
- var/datum/reagent/refillName
- if(isrobot(user))
- refill = reagents.get_master_reagent_id()
- refillName = reagents.get_master_reagent_name()
-
- var/trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
- to_chat(user, " You transfer [trans] units of the solution to [target].")
-
- if(isrobot(user)) //Cyborg modules that include drinks automatically refill themselves, but drain the borg's cell
- if(refill in drinks) // Only synthesize drinks
- var/mob/living/silicon/robot/bro = user
- var/chargeAmount = max(30,4*trans)
- bro.cell.use(chargeAmount)
- to_chat(user, "Now synthesizing [trans] units of [refillName]...")
-
-
- spawn(300)
- reagents.add_reagent(refill, trans)
- to_chat(user, "Cyborg [src] refilled.")
-
- return
-
-/obj/item/weapon/reagent_containers/food/drinks/attackby(var/obj/item/I, mob/user as mob, params)
- if(istype(I, /obj/item/clothing/mask/cigarette)) //ciggies are weird
- return
- if(is_hot(I))
- if(src.reagents)
- src.reagents.chem_temp += 15
- to_chat(user, "You heat [src] with [I].")
- src.reagents.handle_reactions()
-
-/obj/item/weapon/reagent_containers/food/drinks/examine(mob/user)
- if(!..(user, 1))
- return
- if(!reagents || reagents.total_volume==0)
- to_chat(user, " \The [src] is empty!")
- else if (reagents.total_volume<=src.volume/4)
- to_chat(user, " \The [src] is almost empty!")
- else if (reagents.total_volume<=src.volume*0.66)
- to_chat(user, " \The [src] is half full!")// We're all optimistic, right?!
-
- else if (reagents.total_volume<=src.volume*0.90)
- to_chat(user, " \The [src] is almost full!")
- else
- to_chat(user, " \The [src] is full!")
-
-////////////////////////////////////////////////////////////////////////////////
-/// Drinks. END
-////////////////////////////////////////////////////////////////////////////////
-
-/obj/item/weapon/reagent_containers/food/drinks/golden_cup
- desc = "A golden cup"
- name = "golden cup"
- icon_state = "golden_cup"
- item_state = "golden_cup" //yup :)
- w_class = 4
- force = 14
- throwforce = 10
- amount_per_transfer_from_this = 20
- materials = list(MAT_GOLD=1000)
- possible_transfer_amounts = null
- volume = 150
- flags = CONDUCT | OPENCONTAINER
-
-/obj/item/weapon/reagent_containers/food/drinks/golden_cup/tournament_26_06_2011
- desc = "A golden cup. It will be presented to a winner of tournament 26 june and name of the winner will be graved on it."
-
-
-///////////////////////////////////////////////Drinks
-//Notes by Darem: Drinks are simply containers that start preloaded. Unlike condiments, the contents can be ingested directly
-// rather then having to add it to something else first. They should only contain liquids. They have a default container size of 50.
-// Formatting is the same as food.
-
-/obj/item/weapon/reagent_containers/food/drinks/milk
- name = "\improper Space Milk"
- desc = "It's milk. White and nutritious goodness!"
- icon_state = "milk"
- item_state = "carton"
- New()
- ..()
- reagents.add_reagent("milk", 50)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
-
-/* Flour is no longer a reagent
-/obj/item/weapon/reagent_containers/food/drinks/flour
- name = "flour sack"
- desc = "A big bag of flour. Good for baking!"
- icon = 'icons/obj/food/food.dmi'
- icon_state = "flour"
- item_state = "flour"
- New()
- ..()
- reagents.add_reagent("flour", 50)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
-*/
-
-/obj/item/weapon/reagent_containers/food/drinks/soymilk
- name = "\improper SoyMilk"
- desc = "It's soy milk. White and nutritious goodness!"
- icon_state = "soymilk"
- item_state = "carton"
- New()
- ..()
- reagents.add_reagent("soymilk", 50)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
-
-/obj/item/weapon/reagent_containers/food/drinks/coffee
- name = "\improper Robust Coffee"
- desc = "Careful, the beverage you're about to enjoy is extremely hot."
- icon_state = "coffee"
- New()
- ..()
- reagents.add_reagent("coffee", 30)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
-
-/obj/item/weapon/reagent_containers/food/drinks/tea
- name = "\improper Duke Purple Tea"
- desc = "An insult to Duke Purple is an insult to the Space Queen! Any proper gentleman will fight you, if you sully this tea."
- icon_state = "teacup"
- item_state = "coffee"
- New()
- ..()
- reagents.add_reagent("tea", 30)
- if(prob(20))
- reagents.add_reagent("mugwort", 3)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
-
-/obj/item/weapon/reagent_containers/food/drinks/mugwort
- name = "\improper Mugwort Tea"
- desc = "A bitter herbal tea."
- icon_state = "manlydorfglass"
- item_state = "coffee"
- New()
- ..()
- reagents.add_reagent("mugwort", 30)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
-
-/obj/item/weapon/reagent_containers/food/drinks/ice
- name = "\improper Ice Cup"
- desc = "Careful, cold ice, do not chew."
- icon_state = "coffee"
- New()
- ..()
- reagents.add_reagent("ice", 30)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
-
-/obj/item/weapon/reagent_containers/food/drinks/h_chocolate
- name = "\improper Dutch Hot Coco"
- desc = "Made in Space South America."
- icon_state = "hot_coco"
- item_state = "coffee"
- New()
- ..()
- reagents.add_reagent("hot_coco", 30)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
-
-/obj/item/weapon/reagent_containers/food/drinks/chocolate
- name = "\improper Hot Chocolate"
- desc = "Made in Space Switzerland."
- icon_state = "hot_coco"
- item_state = "coffee"
- New()
- ..()
- reagents.add_reagent("chocolate", 45)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
-
-/obj/item/weapon/reagent_containers/food/drinks/weightloss
- name = "\improper Weight-Loss Shake"
- desc = "A shake designed to cause weight loss. The package proudly proclaims that it is 'tapeworm free.'"
- icon_state = "coffee"
- item_state = "coffee"
- New()
- ..()
- reagents.add_reagent("lipolicide", 30)
- reagents.add_reagent("chocolate", 5)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
-
-
-/obj/item/weapon/reagent_containers/food/drinks/dry_ramen
- name = "\improper Cup Ramen"
- desc = "Just add 10ml water, self heats! A taste that reminds you of your school years."
- icon_state = "ramen"
- New()
- ..()
- reagents.add_reagent("dry_ramen", 30)
- if(prob(20))
- reagents.add_reagent("enzyme", 3)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
-
-/obj/item/weapon/reagent_containers/food/drinks/chicken_soup
- name = "\improper Cup Chicken Soup"
- desc = "A delicious and soothing cup of chicken noodle soup; just like spessmom used to make it."
- icon_state = "ramen"
- New()
- ..()
- reagents.add_reagent("chicken_soup", 30)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
-
-/obj/item/weapon/reagent_containers/food/drinks/sillycup
- name = "paper cup"
- desc = "A paper water cup."
- icon_state = "water_cup_e"
- possible_transfer_amounts = null
- volume = 10
- New()
- ..()
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
- on_reagent_change()
- if(reagents.total_volume)
- icon_state = "water_cup"
- else
- icon_state = "water_cup_e"
-
-//////////////////////////drinkingglass and shaker//
-//Note by Darem: This code handles the mixing of drinks. New drinks go in three places: In Chemistry-Reagents.dm (for the drink
-// itself), in Chemistry-Recipes.dm (for the reaction that changes the components into the drink), and here (for the drinking glass
-// icon states.
-
-/obj/item/weapon/reagent_containers/food/drinks/shaker
- name = "shaker"
- desc = "A metal shaker to mix drinks in."
- icon_state = "shaker"
- amount_per_transfer_from_this = 10
- volume = 100
-
-/obj/item/weapon/reagent_containers/food/drinks/flask
- name = "Captain's Flask"
- desc = "A metal flask belonging to the captain"
- icon_state = "flask"
- materials = list(MAT_SILVER=500)
- volume = 60
-
-/obj/item/weapon/reagent_containers/food/drinks/flask/detflask
- name = "Detective's Flask"
- desc = "A metal flask with a leather band and golden badge belonging to the detective."
- icon_state = "detflask"
- materials = list(MAT_METAL=250)
- volume = 60
-
-/obj/item/weapon/reagent_containers/food/drinks/flask/barflask
- name = "flask"
- desc = "For those who can't be bothered to hang out at the bar to drink."
- icon_state = "barflask"
- volume = 60
-
-/obj/item/weapon/reagent_containers/food/drinks/britcup
- name = "cup"
- desc = "A cup with the british flag emblazoned on it."
- icon_state = "britcup"
- volume = 30
-
-/obj/item/weapon/reagent_containers/food/drinks/flask/hand_made
- name = "handmade flask"
- desc = "A wooden flask with a silver lid and bottom. It has a matte, dark blue paint on it with the initials \"W.H.\" etched in black."
- icon = 'icons/obj/custom_items.dmi'
- icon_state = "williamhackett"
-
-/obj/item/weapon/reagent_containers/food/drinks/flask/thermos
- name = "vintage thermos"
- desc = "An older thermos with a faint shine."
- icon_state = "thermos"
- volume = 50
-
-/obj/item/weapon/reagent_containers/food/drinks/flask/shiny
- name = "shiny flask"
- desc = "A shiny metal flask. It appears to have a Greek symbol inscribed on it."
- icon_state = "shinyflask"
- volume = 50
-
-/obj/item/weapon/reagent_containers/food/drinks/flask/lithium
- name = "Lithium Flask"
- desc = "A flask with a Lithium Atom symbol on it."
- icon = 'icons/obj/custom_items.dmi'
- icon_state = "lithiumflask"
- volume = 50
+////////////////////////////////////////////////////////////////////////////////
+/// Drinks.
+////////////////////////////////////////////////////////////////////////////////
+/obj/item/weapon/reagent_containers/food/drinks
+ name = "drink"
+ desc = "yummy"
+ icon = 'icons/obj/drinks.dmi'
+ icon_state = null
+ flags = OPENCONTAINER
+ consume_sound = 'sound/items/drink.ogg'
+ possible_transfer_amounts = list(5,10,15,20,25,30,50)
+ volume = 50
+ burn_state = FIRE_PROOF
+
+/obj/item/weapon/reagent_containers/food/drinks/New()
+ ..()
+ pixel_x = rand(-5, 5)
+ pixel_y = rand(-5, 5)
+ bitesize = amount_per_transfer_from_this
+ if(bitesize < 5)
+ bitesize = 5
+
+/obj/item/weapon/reagent_containers/food/drinks/attack_self(mob/user)
+ return
+
+/obj/item/weapon/reagent_containers/food/drinks/attack(mob/M, mob/user, def_zone)
+ if(!reagents || !reagents.total_volume)
+ to_chat(user, " None of [src] left, oh no!")
+ return 0
+
+ if(istype(M, /mob/living/carbon))
+ var/mob/living/carbon/C = M
+ if(C.eat(src, user))
+ if(isrobot(user)) //Cyborg modules that include drinks automatically refill themselves, but drain the borg's cell
+ var/mob/living/silicon/robot/borg = user
+ borg.cell.use(30)
+ var/refill = reagents.get_master_reagent_id()
+ if(refill in drinks) // Only synthesize drinks
+ spawn(600)
+ reagents.add_reagent(refill, bitesize)
+ return 1
+ return 0
+
+/obj/item/weapon/reagent_containers/food/drinks/afterattack(obj/target, mob/user, proximity)
+ if(!proximity) return
+
+ // Moved from the can code; not necessary since closed cans aren't open containers now, but, eh.
+ if(istype(target, /obj/item/weapon/reagent_containers/food/drinks/cans))
+ var/obj/item/weapon/reagent_containers/food/drinks/cans/cantarget = target
+ if(cantarget.canopened == 0)
+ to_chat(user, "You need to open the drink you want to pour into!")
+ return
+
+ if(istype(target, /obj/structure/reagent_dispensers)) //A dispenser. Transfer FROM it TO us.
+
+ if(!target.reagents.total_volume)
+ to_chat(user, " [target] is empty.")
+ return
+
+ if(reagents.total_volume >= reagents.maximum_volume)
+ to_chat(user, " [src] is full.")
+ return
+
+ var/trans = target.reagents.trans_to(src, target:amount_per_transfer_from_this)
+ to_chat(user, " You fill [src] with [trans] units of the contents of [target].")
+
+ else if(target.is_open_container()) //Something like a glass. Player probably wants to transfer TO it.
+ if(!reagents.total_volume)
+ to_chat(user, " [src] is empty.")
+ return
+
+ if(target.reagents.total_volume >= target.reagents.maximum_volume)
+ to_chat(user, " [target] is full.")
+ return
+
+
+
+ var/datum/reagent/refill
+ var/datum/reagent/refillName
+ if(isrobot(user))
+ refill = reagents.get_master_reagent_id()
+ refillName = reagents.get_master_reagent_name()
+
+ var/trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
+ to_chat(user, " You transfer [trans] units of the solution to [target].")
+
+ if(isrobot(user)) //Cyborg modules that include drinks automatically refill themselves, but drain the borg's cell
+ if(refill in drinks) // Only synthesize drinks
+ var/mob/living/silicon/robot/bro = user
+ var/chargeAmount = max(30,4*trans)
+ bro.cell.use(chargeAmount)
+ to_chat(user, "Now synthesizing [trans] units of [refillName]...")
+
+
+ spawn(300)
+ reagents.add_reagent(refill, trans)
+ to_chat(user, "Cyborg [src] refilled.")
+
+ return
+
+/obj/item/weapon/reagent_containers/food/drinks/attackby(obj/item/I, mob/user, params)
+ if(istype(I, /obj/item/clothing/mask/cigarette)) //ciggies are weird
+ return
+ if(is_hot(I))
+ if(src.reagents)
+ src.reagents.chem_temp += 15
+ to_chat(user, "You heat [src] with [I].")
+ src.reagents.handle_reactions()
+
+/obj/item/weapon/reagent_containers/food/drinks/examine(mob/user)
+ if(!..(user, 1))
+ return
+ if(!reagents || reagents.total_volume==0)
+ to_chat(user, " \The [src] is empty!")
+ else if(reagents.total_volume<=src.volume/4)
+ to_chat(user, " \The [src] is almost empty!")
+ else if(reagents.total_volume<=src.volume*0.66)
+ to_chat(user, " \The [src] is half full!")// We're all optimistic, right?!
+
+ else if(reagents.total_volume<=src.volume*0.90)
+ to_chat(user, " \The [src] is almost full!")
+ else
+ to_chat(user, " \The [src] is full!")
+
+////////////////////////////////////////////////////////////////////////////////
+/// Drinks. END
+////////////////////////////////////////////////////////////////////////////////
+
+/obj/item/weapon/reagent_containers/food/drinks/trophy
+ name = "pewter cup"
+ desc = "Everyone gets a trophy."
+ icon_state = "pewter_cup"
+ w_class = 1
+ force = 1
+ throwforce = 1
+ amount_per_transfer_from_this = 5
+ materials = list(MAT_METAL=100)
+ possible_transfer_amounts = list()
+ volume = 5
+ flags = CONDUCT | OPENCONTAINER
+
+/obj/item/weapon/reagent_containers/food/drinks/trophy/gold_cup
+ name = "gold cup"
+ desc = "You're winner!"
+ icon_state = "golden_cup"
+ w_class = 4
+ force = 14
+ throwforce = 10
+ amount_per_transfer_from_this = 20
+ materials = list(MAT_GOLD=1000)
+ volume = 150
+
+/obj/item/weapon/reagent_containers/food/drinks/trophy/silver_cup
+ name = "silver cup"
+ desc = "Best loser!"
+ icon_state = "silver_cup"
+ w_class = 3
+ force = 10
+ throwforce = 8
+ amount_per_transfer_from_this = 15
+ materials = list(MAT_SILVER=800)
+ volume = 100
+
+/obj/item/weapon/reagent_containers/food/drinks/trophy/bronze_cup
+ name = "bronze cup"
+ desc = "At least you ranked!"
+ icon_state = "bronze_cup"
+ w_class = 2
+ force = 5
+ throwforce = 4
+ amount_per_transfer_from_this = 10
+ materials = list(MAT_METAL=400)
+ volume = 25
+
+
+///////////////////////////////////////////////Drinks
+//Notes by Darem: Drinks are simply containers that start preloaded. Unlike condiments, the contents can be ingested directly
+// rather then having to add it to something else first. They should only contain liquids. They have a default container size of 50.
+// Formatting is the same as food.
+
+
+/obj/item/weapon/reagent_containers/food/drinks/coffee
+ name = "Robust Coffee"
+ desc = "Careful, the beverage you're about to enjoy is extremely hot."
+ icon_state = "coffee"
+ list_reagents = list("coffee" = 30)
+
+/obj/item/weapon/reagent_containers/food/drinks/ice
+ name = "Ice Cup"
+ desc = "Careful, cold ice, do not chew."
+ icon_state = "coffee"
+ list_reagents = list("ice" = 30)
+
+/obj/item/weapon/reagent_containers/food/drinks/tea
+ name = "Duke Purple Tea"
+ desc = "An insult to Duke Purple is an insult to the Space Queen! Any proper gentleman will fight you, if you sully this tea."
+ icon_state = "teacup"
+ item_state = "coffee"
+ list_reagents = list("tea" = 30)
+
+/obj/item/weapon/reagent_containers/food/drinks/tea/New()
+ ..()
+ if(prob(20))
+ reagents.add_reagent("mugwort", 3)
+
+/obj/item/weapon/reagent_containers/food/drinks/mugwort
+ name = "Mugwort Tea"
+ desc = "A bitter herbal tea."
+ icon_state = "manlydorfglass"
+ item_state = "coffee"
+ list_reagents = list("mugwort" = 30)
+
+/obj/item/weapon/reagent_containers/food/drinks/h_chocolate
+ name = "Dutch Hot Coco"
+ desc = "Made in Space South America."
+ icon_state = "hot_coco"
+ item_state = "coffee"
+ list_reagents = list("hot_coco" = 30, "sugar" = 5)
+
+/obj/item/weapon/reagent_containers/food/drinks/chocolate
+ name = "Hot Chocolate"
+ desc = "Made in Space Switzerland."
+ icon_state = "hot_coco"
+ item_state = "coffee"
+ list_reagents = list("chocolate" = 30)
+
+/obj/item/weapon/reagent_containers/food/drinks/weightloss
+ name = "Weight-Loss Shake"
+ desc = "A shake designed to cause weight loss. The package proudly proclaims that it is 'tapeworm free.'"
+ icon_state = "coffee"
+ list_reagents = list("lipolicide" = 30, "chocolate" = 5)
+
+/obj/item/weapon/reagent_containers/food/drinks/dry_ramen
+ name = "Cup Ramen"
+ desc = "Just add 10ml of water, self heats! A taste that reminds you of your school years."
+ icon_state = "ramen"
+ item_state = "coffee"
+ list_reagents = list("dry_ramen" = 30)
+
+/obj/item/weapon/reagent_containers/food/drinks/dry_ramen/New()
+ ..()
+ if(prob(20))
+ reagents.add_reagent("enzyme", 3)
+
+/obj/item/weapon/reagent_containers/food/drinks/chicken_soup
+ name = "Cup Chicken Soup"
+ desc = "A delicious and soothing cup of chicken noodle soup; just like spessmom used to make it."
+ icon_state = "ramen"
+ item_state = "coffee"
+ list_reagents = list("chicken_soup" = 30)
+
+/obj/item/weapon/reagent_containers/food/drinks/sillycup
+ name = "paper cup"
+ desc = "A paper water cup."
+ icon_state = "water_cup_e"
+ item_state = "coffee"
+ possible_transfer_amounts = list()
+ volume = 10
+
+/obj/item/weapon/reagent_containers/food/drinks/sillycup/on_reagent_change()
+ if(reagents.total_volume)
+ icon_state = "water_cup"
+ else
+ icon_state = "water_cup_e"
+
+//////////////////////////drinkingglass and shaker//
+//Note by Darem: This code handles the mixing of drinks. New drinks go in three places: In Chemistry-Reagents.dm (for the drink
+// itself), in Chemistry-Recipes.dm (for the reaction that changes the components into the drink), and here (for the drinking glass
+// icon states.
+
+/obj/item/weapon/reagent_containers/food/drinks/shaker
+ name = "shaker"
+ desc = "A metal shaker to mix drinks in."
+ icon_state = "shaker"
+ materials = list(MAT_METAL=1500)
+ amount_per_transfer_from_this = 10
+ volume = 100
+
+/obj/item/weapon/reagent_containers/food/drinks/flask
+ name = "flask"
+ desc = "Every good spaceman knows it's a good idea to bring along a couple of pints of whiskey wherever they go."
+ icon_state = "flask"
+ materials = list(MAT_METAL=250)
+ volume = 60
+
+/obj/item/weapon/reagent_containers/food/drinks/flask/barflask
+ name = "flask"
+ desc = "For those who can't be bothered to hang out at the bar to drink."
+ icon_state = "barflask"
+
+/obj/item/weapon/reagent_containers/food/drinks/flask/gold
+ name = "captain's flask"
+ desc = "A gold flask belonging to the captain."
+ icon_state = "flask_gold"
+ materials = list(MAT_GOLD=500)
+
+/obj/item/weapon/reagent_containers/food/drinks/flask/detflask
+ name = "detective's flask"
+ desc = "The detective's only true friend."
+ icon_state = "detflask"
+ list_reagents = list("whiskey" = 30)
+
+/obj/item/weapon/reagent_containers/food/drinks/flask/hand_made
+ name = "handmade flask"
+ desc = "A wooden flask with a silver lid and bottom. It has a matte, dark blue paint on it with the initials \"W.H.\" etched in black."
+ icon = 'icons/obj/custom_items.dmi'
+ icon_state = "williamhackett"
+ materials = list()
+
+/obj/item/weapon/reagent_containers/food/drinks/flask/thermos
+ name = "vintage thermos"
+ desc = "An older thermos with a faint shine."
+ icon_state = "thermos"
+ volume = 50
+
+/obj/item/weapon/reagent_containers/food/drinks/flask/shiny
+ name = "shiny flask"
+ desc = "A shiny metal flask. It appears to have a Greek symbol inscribed on it."
+ icon_state = "shinyflask"
+ volume = 50
+
+/obj/item/weapon/reagent_containers/food/drinks/flask/lithium
+ name = "Lithium Flask"
+ desc = "A flask with a Lithium Atom symbol on it."
+ icon = 'icons/obj/custom_items.dmi'
+ icon_state = "lithiumflask"
+ volume = 50
+
+
+/obj/item/weapon/reagent_containers/food/drinks/britcup
+ name = "cup"
+ desc = "A cup with the british flag emblazoned on it."
+ icon_state = "britcup"
+ volume = 30
\ No newline at end of file
diff --git a/code/modules/food_and_drinks/drinks/drinks/bottle.dm b/code/modules/food_and_drinks/drinks/drinks/bottle.dm
new file mode 100644
index 00000000000..93d80552de6
--- /dev/null
+++ b/code/modules/food_and_drinks/drinks/drinks/bottle.dm
@@ -0,0 +1,346 @@
+
+
+///////////////////////////////////////////////Alchohol bottles! -Agouri //////////////////////////
+//Functionally identical to regular drinks. The only difference is that the default bottle size is 100. - Darem
+//Bottles now weaken and break when smashed on people's heads. - Giacom
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle
+ amount_per_transfer_from_this = 10
+ volume = 100
+ throwforce = 15
+ item_state = "broken_beer" //Generic held-item sprite until unique ones are made.
+ var/const/duration = 13 //Directly relates to the 'weaken' duration. Lowered by armor (i.e. helmets)
+ var/isGlass = 1 //Whether the 'bottle' is made of glass or not so that milk cartons dont shatter when someone gets hit by it
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/proc/smash(mob/living/target, mob/living/user, ranged = 0)
+
+ //Creates a shattering noise and replaces the bottle with a broken_bottle
+ var/new_location = get_turf(loc)
+ var/obj/item/weapon/broken_bottle/B = new /obj/item/weapon/broken_bottle(new_location)
+ if(ranged)
+ B.loc = new_location
+ else
+ user.drop_item()
+ user.put_in_active_hand(B)
+ B.icon_state = src.icon_state
+
+ var/icon/I = new('icons/obj/drinks.dmi', src.icon_state)
+ I.Blend(B.broken_outline, ICON_OVERLAY, rand(5), 1)
+ I.SwapColor(rgb(255, 0, 220, 255), rgb(0, 0, 0, 0))
+ B.icon = I
+
+ if(isGlass)
+ if(prob(33))
+ new/obj/item/weapon/shard(new_location)
+ playsound(src, "shatter", 70, 1)
+ else
+ B.name = "broken carton"
+ B.force = 0
+ B.throwforce = 0
+ B.desc = "A carton with the bottom half burst open. Might give you a papercut."
+ transfer_fingerprints_to(B)
+
+ qdel(src)
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/attack(mob/living/target, mob/living/user)
+
+ if(!target)
+ return
+
+ if(user.a_intent != I_HARM || !isGlass)
+ return ..()
+
+ force = 15 //Smashing bottles over someoen's head hurts.
+
+ var/obj/item/organ/external/affecting = user.zone_sel.selecting //Find what the player is aiming at
+
+ var/armor_block = 0 //Get the target's armor values for normal attack damage.
+ var/armor_duration = 0 //The more force the bottle has, the longer the duration.
+
+ //Calculating duration and calculating damage.
+ if(ishuman(target))
+
+ var/mob/living/carbon/human/H = target
+ var/headarmor = 0 // Target's head armor
+ armor_block = H.run_armor_check(affecting, "melee","","",armour_penetration) // For normal attack damage
+
+ //If they have a hat/helmet and the user is targeting their head.
+ if(istype(H.head, /obj/item/clothing/head) && affecting == "head")
+
+ // If their head has an armor value, assign headarmor to it, else give it 0.
+ if(H.head.armor["melee"])
+ headarmor = H.head.armor["melee"]
+ else
+ headarmor = 0
+ else
+ headarmor = 0
+
+ //Calculate the weakening duration for the target.
+ armor_duration = (duration - headarmor) + force
+
+ else
+ //Only humans can have armor, right?
+ armor_block = target.run_armor_check(affecting, "melee")
+ if(affecting == "head")
+ armor_duration = duration + force
+ armor_duration /= 10
+
+ //Apply the damage!
+ armor_block = min(90, armor_block)
+ target.apply_damage(force, BRUTE, affecting, armor_block)
+
+ // You are going to knock someone out for longer if they are not wearing a helmet.
+ var/head_attack_message = ""
+ if(affecting == "head" && iscarbon(target))
+ head_attack_message = " on the head"
+ //Weaken the target for the duration that we calculated and divide it by 5.
+ if(armor_duration)
+ target.apply_effect(min(armor_duration, 10) , WEAKEN) // Never weaken more than a flash!
+
+ //Display an attack message.
+ if(target != user)
+ target.visible_message("[user] has hit [target][head_attack_message] with a bottle of [src.name]!", \
+ "[user] has hit [target][head_attack_message] with a bottle of [src.name]!")
+ else
+ user.visible_message("[target] hits \himself with a bottle of [src.name][head_attack_message]!", \
+ "[target] hits \himself with a bottle of [src.name][head_attack_message]!")
+
+ //Attack logs
+ add_logs(target, user, "attacked", src)
+
+ //The reagents in the bottle splash all over the target, thanks for the idea Nodrak
+ SplashReagents(target)
+
+ //Finally, smash the bottle. This kills (del) the bottle.
+ smash(target, user)
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/proc/SplashReagents(mob/M)
+ if(reagents && reagents.total_volume)
+ M.visible_message("The contents of \the [src] splashes all over [M]!")
+ reagents.reaction(M, TOUCH)
+ reagents.clear_reagents()
+
+//Keeping this here for now, I'll ask if I should keep it here.
+/obj/item/weapon/broken_bottle
+ name = "Broken Bottle"
+ desc = "A bottle with a sharp broken bottom."
+ icon = 'icons/obj/drinks.dmi'
+ icon_state = "broken_bottle"
+ force = 9
+ throwforce = 5
+ throw_speed = 3
+ throw_range = 5
+ w_class = 1
+ item_state = "beer"
+ hitsound = 'sound/weapons/bladeslice.ogg'
+ attack_verb = list("stabbed", "slashed", "attacked")
+ var/icon/broken_outline = icon('icons/obj/drinks.dmi', "broken")
+ sharp = 1
+ edge = 1
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/gin
+ name = "Griffeater Gin"
+ desc = "A bottle of high quality gin, produced in the New London Space Station."
+ icon_state = "ginbottle"
+ list_reagents = list("gin" = 100)
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/whiskey
+ name = "Uncle Git's Special Reserve"
+ desc = "A premium single-malt whiskey, gently matured inside the tunnels of a nuclear shelter. TUNNEL WHISKEY RULES."
+ icon_state = "whiskeybottle"
+ list_reagents = list("whiskey" = 100)
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/vodka
+ name = "Tunguska Triple Distilled"
+ desc = "Aah, vodka. Prime choice of drink AND fuel by Russians worldwide."
+ icon_state = "vodkabottle"
+ list_reagents = list("vodka" = 100)
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/vodka/badminka
+ name = "Badminka Vodka"
+ desc = "The label's written in Cyrillic. All you can make out is the name and a word that looks vaguely like 'Vodka'."
+ icon_state = "badminka"
+ list_reagents = list("vodka" = 100)
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/tequila
+ name = "Caccavo Guaranteed Quality Tequila"
+ desc = "Made from premium petroleum distillates, pure thalidomide and other fine quality ingredients!"
+ icon_state = "tequilabottle"
+ list_reagents = list("tequila" = 100)
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/bottleofnothing
+ name = "Bottle of Nothing"
+ desc = "A bottle filled with nothing."
+ icon_state = "bottleofnothing"
+ list_reagents = list("nothing" = 100)
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/patron
+ name = "Wrapp Artiste Patron"
+ desc = "Silver laced tequila, served in space night clubs across the galaxy."
+ icon_state = "patronbottle"
+ list_reagents = list("patron" = 100)
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/rum
+ name = "Captain Pete's Cuban Spiced Rum"
+ desc = "This isn't just rum, oh no. It's practically GRIFF in a bottle."
+ icon_state = "rumbottle"
+ list_reagents = list("rum" = 100)
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/holywater
+ name = "Flask of Holy Water"
+ desc = "A flask of the chaplain's holy water."
+ icon_state = "holyflask"
+ list_reagents = list("holywater" = 100)
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/holywater/hell
+ desc = "A flask of holy water...it's been sitting in the Necropolis a while though."
+ list_reagents = list("hell_water" = 100)
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/vermouth
+ name = "Goldeneye Vermouth"
+ desc = "Sweet, sweet dryness~"
+ icon_state = "vermouthbottle"
+ list_reagents = list("vermouth" = 100)
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/kahlua
+ name = "Robert Robust's Coffee Liqueur"
+ desc = "A widely known, Mexican coffee-flavoured liqueur. In production since 1936, HONK."
+ icon_state = "kahluabottle"
+ list_reagents = list("kahlua" = 100)
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/goldschlager
+ name = "College Girl Goldschlager"
+ desc = "Because they are the only ones who will drink 100 proof cinnamon schnapps."
+ icon_state = "goldschlagerbottle"
+ list_reagents = list("goldschlager" = 100)
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/cognac
+ name = "Chateau De Baton Premium Cognac"
+ desc = "A sweet and strongly alchoholic drink, made after numerous distillations and years of maturing. You might as well not scream 'SHITCURITY' this time."
+ icon_state = "cognacbottle"
+ list_reagents = list("cognac" = 100)
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/wine
+ name = "Doublebeard Bearded Special Wine"
+ desc = "A faint aura of unease and asspainery surrounds the bottle."
+ icon_state = "winebottle"
+ list_reagents = list("wine" = 100)
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/absinthe
+ name = "Extra-Strong Absinthe"
+ desc = "An strong alcoholic drink brewed and distributed by"
+ icon_state = "absinthebottle"
+ list_reagents = list("absinthe" = 100)
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/absinthe/premium
+ name = "Gwyn's Premium Absinthe"
+ desc = "A potent alcoholic beverage, almost makes you forget the ash in your lungs."
+ icon_state = "absinthepremium"
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/hcider
+ name = "Jian Hard Cider"
+ desc = "Apple juice for adults."
+ icon_state = "hcider"
+ volume = 50
+ list_reagents = list("suicider" = 50)
+
+//////////////////////////JUICES AND STUFF ///////////////////////
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/orangejuice
+ name = "Orange Juice"
+ desc = "Full of vitamins and deliciousness!"
+ icon_state = "orangejuice"
+ item_state = "carton"
+ isGlass = 0
+ list_reagents = list("orangejuice" = 100)
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/cream
+ name = "Milk Cream"
+ desc = "It's cream. Made from milk. What else did you think you'd find in there?"
+ icon_state = "cream"
+ item_state = "carton"
+ isGlass = 0
+ list_reagents = list("cream" = 100)
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/tomatojuice
+ name = "Tomato Juice"
+ desc = "Well, at least it LOOKS like tomato juice. You can't tell with all that redness."
+ icon_state = "tomatojuice"
+ item_state = "carton"
+ isGlass = 0
+ list_reagents = list("tomatojuice" = 100)
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/limejuice
+ name = "Lime Juice"
+ desc = "Sweet-sour goodness."
+ icon_state = "limejuice"
+ item_state = "carton"
+ isGlass = 0
+ list_reagents = list("limejuice" = 100)
+
+////////////////////////// MOLOTOV ///////////////////////
+/obj/item/weapon/reagent_containers/food/drinks/bottle/molotov
+ name = "molotov cocktail"
+ desc = "A throwing weapon used to ignite things, typically filled with an accelerant. Recommended highly by rioters and revolutionaries. Light and toss."
+ icon_state = "vodkabottle"
+ list_reagents = list()
+ var/list/accelerants = list(/datum/reagent/ethanol,/datum/reagent/fuel,/datum/reagent/clf3,/datum/reagent/phlogiston,
+ /datum/reagent/napalm,/datum/reagent/hellwater,/datum/reagent/plasma,/datum/reagent/plasma_dust)
+ var/active = 0
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/molotov/CheckParts(list/parts_list)
+ ..()
+ var/obj/item/weapon/reagent_containers/food/drinks/bottle/B = locate() in contents
+ if(B)
+ icon_state = B.icon_state
+ B.reagents.copy_to(src, 100)
+ if(!B.isGlass)
+ desc += " You're not sure if making this out of a carton was the brightest idea."
+ isGlass = 0
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/molotov/throw_impact(atom/target,mob/thrower)
+ var/firestarter = 0
+ for(var/datum/reagent/R in reagents.reagent_list)
+ for(var/A in accelerants)
+ if(istype(R, A))
+ firestarter = 1
+ break
+ SplashReagents(target)
+ if(firestarter && active)
+ target.fire_act()
+ new /obj/effect/hotspot(get_turf(target))
+ ..()
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/molotov/attackby(obj/item/I, mob/user, params)
+ if(is_hot(I) && !active)
+ active = 1
+ var/turf/bombturf = get_turf(src)
+ var/area/bombarea = get_area(bombturf)
+ message_admins("[key_name(user)]? has primed a [name] for detonation at [bombarea] (JMP).")
+ log_game("[key_name(user)] has primed a [name] for detonation at [bombarea] ([bombturf.x],[bombturf.y],[bombturf.z]).")
+
+ to_chat(user, "You light [src] on fire.")
+ overlays += fire_overlay
+ if(!isGlass)
+ spawn(50)
+ if(active)
+ var/counter
+ var/target = loc
+ for(counter = 0, counter < 2, counter++)
+ if(istype(target, /obj/item/weapon/storage))
+ var/obj/item/weapon/storage/S = target
+ target = S.loc
+ if(istype(target, /atom))
+ var/atom/A = target
+ SplashReagents(A)
+ A.fire_act()
+ qdel(src)
+
+/obj/item/weapon/reagent_containers/food/drinks/bottle/molotov/attack_self(mob/user)
+ if(active)
+ if(!isGlass)
+ to_chat(user, "The flame's spread too far on it!")
+ return
+ to_chat(user, "You snuff out the flame on \the [src].")
+ overlays -= fire_overlay
+ active = 0
\ No newline at end of file
diff --git a/code/modules/reagents/reagent_containers/food/cans.dm b/code/modules/food_and_drinks/drinks/drinks/cans.dm
similarity index 66%
rename from code/modules/reagents/reagent_containers/food/cans.dm
rename to code/modules/food_and_drinks/drinks/drinks/cans.dm
index f037fe6612a..6d72ec2221c 100644
--- a/code/modules/reagents/reagent_containers/food/cans.dm
+++ b/code/modules/food_and_drinks/drinks/drinks/cans.dm
@@ -1,13 +1,14 @@
/obj/item/weapon/reagent_containers/food/drinks/cans
- var canopened = 0
- var is_glass = 0
+ var/canopened = 0
+ var/is_glass = 0
+ var/is_plastic = 0
/obj/item/weapon/reagent_containers/food/drinks/cans/New()
..()
flags &= ~OPENCONTAINER
-/obj/item/weapon/reagent_containers/food/drinks/cans/attack_self(mob/user as mob)
- if (canopened == 0)
+/obj/item/weapon/reagent_containers/food/drinks/cans/attack_self(mob/user)
+ if(canopened == 0)
playsound(src.loc,'sound/effects/canopen.ogg', rand(10,50), 1)
to_chat(user, "You open the drink with an audible pop!")
canopened = 1
@@ -16,6 +17,9 @@
/obj/item/weapon/reagent_containers/food/drinks/cans/proc/crush(mob/user)
var/obj/item/trash/can/crushed_can = new /obj/item/trash/can(user.loc)
crushed_can.icon_state = icon_state
+ //inherit material vars for recycling purposes
+ crushed_can.is_glass = is_glass
+ crushed_can.is_plastic = is_plastic
if(is_glass)
playsound(user.loc, 'sound/effects/Glassbr3.ogg', rand(10, 50), 1)
crushed_can.name = "broken bottle"
@@ -24,7 +28,7 @@
qdel(src)
return crushed_can
-/obj/item/weapon/reagent_containers/food/drinks/cans/attack(mob/M as mob, mob/user as mob, proximity)
+/obj/item/weapon/reagent_containers/food/drinks/cans/attack(mob/M, mob/user, proximity)
if(canopened == 0)
to_chat(user, "You need to open the drink!")
return
@@ -54,93 +58,46 @@
else
return ..(target, user, proximity)
-/* examine(mob/user)
- if(!..(user, 1))
- return
- if(!reagents || reagents.total_volume==0)
- to_chat(user, "\blue \The [src] is empty!")
- else if (reagents.total_volume<=src.volume/4)
- to_chat(user, "\blue \The [src] is almost empty!")
- else if (reagents.total_volume<=src.volume*0.66)
- to_chat(user, "\blue \The [src] is half full!")
- else if (reagents.total_volume<=src.volume*0.90)
- to_chat(user, "\blue \The [src] is almost full!")
- else
- to_chat(user, "\blue \The [src] is full!")*/
-
-
-//DRINKS
-
/obj/item/weapon/reagent_containers/food/drinks/cans/cola
name = "Space Cola"
desc = "Cola. in space."
icon_state = "cola"
- New()
- ..()
- reagents.add_reagent("cola", 30)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
+ list_reagents = list("cola" = 30)
/obj/item/weapon/reagent_containers/food/drinks/cans/waterbottle
name = "Bottled Water"
desc = "Introduced to the vending machines by Skrellian request, this water comes straight from the Martian poles."
icon_state = "waterbottle"
- New()
- ..()
- reagents.add_reagent("water", 30)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
+ is_plastic = 1
+ list_reagents = list("water" = 30)
/obj/item/weapon/reagent_containers/food/drinks/cans/beer
name = "Space Beer"
desc = "Contains only water, malt and hops."
icon_state = "beer"
is_glass = 1
- New()
- ..()
- reagents.add_reagent("beer", 30)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
+ list_reagents = list("beer" = 30)
/obj/item/weapon/reagent_containers/food/drinks/cans/adminbooze
name = "Admin Booze"
desc = "Bottled Griffon tears. Drink with caution."
icon_state = "adminbooze"
is_glass = 1
- New()
- ..()
- reagents.add_reagent("adminordrazine", 5)
- reagents.add_reagent("capsaicin", 5)
- reagents.add_reagent("methamphetamine", 20)
- reagents.add_reagent("thirteenloko", 20)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
+ list_reagents = list("adminordrazine" = 5, "capsaicin" = 5, "methamphetamine"= 20, "thirteenloko" = 20)
/obj/item/weapon/reagent_containers/food/drinks/cans/madminmalt
name = "Madmin Malt"
desc = "Bottled essence of angry admins. Drink with EXTREME caution."
icon_state = "madminmalt"
is_glass = 1
- New()
- ..()
- reagents.add_reagent("hell_water", 20)
- reagents.add_reagent("neurotoxin", 15)
- reagents.add_reagent("thirteenloko", 15)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
+ list_reagents = list("hell_water" = 20, "neurotoxin" = 15, "thirteenloko" = 15)
/obj/item/weapon/reagent_containers/food/drinks/cans/badminbrew
name = "Badmin Brew"
desc = "Bottled trickery and terrible admin work. Probably shouldn't drink this one at all."
icon_state = "badminbrew"
is_glass = 1
- New()
- ..()
- reagents.add_reagent("mutagen", 25)
- reagents.add_reagent("charcoal", 10)
- reagents.add_reagent("thirteenloko", 15)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
+ list_reagents = list("mutagen" = 25, "charcoal" = 10, "thirteenloko" = 15)
/obj/item/weapon/reagent_containers/food/drinks/cans/ale
name = "Magm-Ale"
@@ -148,114 +105,119 @@
icon_state = "alebottle"
item_state = "beer"
is_glass = 1
- New()
- ..()
- reagents.add_reagent("ale", 30)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
-
+ list_reagents = list("ale" = 30)
/obj/item/weapon/reagent_containers/food/drinks/cans/space_mountain_wind
name = "Space Mountain Wind"
desc = "Blows right through you like a space wind."
icon_state = "space_mountain_wind"
- New()
- ..()
- reagents.add_reagent("spacemountainwind", 30)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
+ list_reagents = list("spacemountainwind" = 30)
/obj/item/weapon/reagent_containers/food/drinks/cans/thirteenloko
name = "Thirteen Loko"
desc = "The CMO has advised crew members that consumption of Thirteen Loko may result in seizures, blindness, drunkeness, or even death. Please Drink Responsibly."
icon_state = "thirteen_loko"
- New()
- ..()
- reagents.add_reagent("thirteenloko", 25)
- reagents.add_reagent("psilocybin", 5)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
+ list_reagents = list("thirteenloko" = 25, "psilocybin" = 5)
/obj/item/weapon/reagent_containers/food/drinks/cans/dr_gibb
name = "Dr. Gibb"
desc = "A delicious mixture of 42 different flavors."
icon_state = "dr_gibb"
- New()
- ..()
- reagents.add_reagent("dr_gibb", 30)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
+ list_reagents = list("dr_gibb" = 30)
+
/obj/item/weapon/reagent_containers/food/drinks/cans/starkist
name = "Star-kist"
desc = "The taste of a star in liquid form. And, a bit of tuna...?"
icon_state = "starkist"
- New()
- ..()
- reagents.add_reagent("brownstar", 30)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
+ list_reagents = list("brownstar" = 30)
/obj/item/weapon/reagent_containers/food/drinks/cans/space_up
name = "Space-Up"
desc = "Tastes like a hull breach in your mouth."
icon_state = "space-up"
- New()
- ..()
- reagents.add_reagent("space_up", 30)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
+ list_reagents = list("space_up" = 30)
/obj/item/weapon/reagent_containers/food/drinks/cans/lemon_lime
name = "Lemon-Lime"
desc = "You wanted ORANGE. It gave you Lemon Lime."
icon_state = "lemon-lime"
- New()
- ..()
- reagents.add_reagent("lemon_lime", 30)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
+ list_reagents = list("lemon_lime" = 30)
/obj/item/weapon/reagent_containers/food/drinks/cans/iced_tea
name = "Vrisk Serket Iced Tea"
desc = "That sweet, refreshing southern earthy flavor. That's where it's from, right? South Earth?"
icon_state = "ice_tea_can"
- New()
- ..()
- reagents.add_reagent("icetea", 30)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
+ list_reagents = list("icetea" = 30)
/obj/item/weapon/reagent_containers/food/drinks/cans/grape_juice
name = "Grapel Juice"
desc = "500 pages of rules of how to appropriately enter into a combat with this juice!"
icon_state = "purple_can"
- New()
- ..()
- reagents.add_reagent("grapejuice", 30)
- src.pixel_x = rand(-10.0, 10)
- src.pixel_y = rand(-10.0, 10)
+ list_reagents = list("grapejuice" = 30)
/obj/item/weapon/reagent_containers/food/drinks/cans/tonic
name = "T-Borg's Tonic Water"
desc = "Quinine tastes funny, but at least it'll keep that Space Malaria away."
icon_state = "tonic"
- New()
- ..()
- reagents.add_reagent("tonic", 50)
+ list_reagents = list("tonic" = 50)
/obj/item/weapon/reagent_containers/food/drinks/cans/sodawater
name = "Soda Water"
desc = "A can of soda water. Still water's more refreshing cousin."
icon_state = "sodawater"
- New()
- ..()
- reagents.add_reagent("sodawater", 50)
+ list_reagents = list("sodawater" = 50)
/obj/item/weapon/reagent_containers/food/drinks/cans/synthanol
name = "Beep's Classic Synthanol"
desc = "A can of IPC booze, however that works."
icon_state = "synthanolcan"
- New()
- ..()
- reagents.add_reagent("synthanol", 50)
+ list_reagents = list("synthanol" = 50)
+
+/obj/item/weapon/reagent_containers/food/drinks/cans/bottler
+ name = "generic beverage container"
+ desc = "this shouldn't ever be spawned. shame on you"
+ icon_state = "glass_bottle"
+
+/obj/item/weapon/reagent_containers/food/drinks/cans/bottler/on_reagent_change()
+ update_icon()
+
+/obj/item/weapon/reagent_containers/food/drinks/cans/bottler/update_icon()
+ overlays.Cut()
+
+ if(reagents.total_volume)
+ var/image/filling = image('icons/obj/reagentfillings.dmi', src, "[icon_state]10")
+
+ switch(round(reagents.total_volume))
+ if(0 to 9)
+ filling.icon_state = "[icon_state]-10"
+ if(10 to 19)
+ filling.icon_state = "[icon_state]10"
+ if(20 to 29)
+ filling.icon_state = "[icon_state]20"
+ if(30 to 39)
+ filling.icon_state = "[icon_state]30"
+ if(40 to 49)
+ filling.icon_state = "[icon_state]40"
+ if(50 to INFINITY)
+ filling.icon_state = "[icon_state]50"
+
+ filling.icon += mix_color_from_reagents(reagents.reagent_list)
+ overlays += filling
+
+/obj/item/weapon/reagent_containers/food/drinks/cans/bottler/glass_bottle
+ name = "glass bottle"
+ desc = "A glass bottle suitable for beverages."
+ icon_state = "glass_bottle"
+ is_glass = 1
+
+/obj/item/weapon/reagent_containers/food/drinks/cans/bottler/plastic_bottle
+ name = "plastic bottle"
+ desc = "A plastic bottle suitable for beverages."
+ icon_state = "plastic_bottle"
+ is_plastic = 1
+
+/obj/item/weapon/reagent_containers/food/drinks/cans/bottler/metal_can
+ name = "metal can"
+ desc = "A metal can suitable for beverages."
+ icon_state = "metal_can"
diff --git a/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm b/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm
new file mode 100644
index 00000000000..bc1442038e9
--- /dev/null
+++ b/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm
@@ -0,0 +1,570 @@
+
+
+/obj/item/weapon/reagent_containers/food/drinks/drinkingglass
+ name = "glass"
+ desc = "Your standard drinking glass."
+ icon_state = "glass_empty"
+ item_state = "drinking_glass"
+ amount_per_transfer_from_this = 10
+ volume = 50
+ lefthand_file = 'icons/goonstation/mob/inhands/items_lefthand.dmi'
+ righthand_file = 'icons/goonstation/mob/inhands/items_righthand.dmi'
+ materials = list(MAT_GLASS=500)
+ burn_state = FLAMMABLE
+ burntime = 5
+
+/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/attackby(obj/item/I, mob/user, params)
+ if(istype(I, /obj/item/weapon/reagent_containers/food/snacks/egg)) //breaking eggs
+ var/obj/item/weapon/reagent_containers/food/snacks/egg/E = I
+ if(reagents)
+ if(reagents.total_volume >= reagents.maximum_volume)
+ to_chat(user, "[src] is full.")
+ else
+ to_chat(user, "You break [E] in [src].")
+ E.reagents.trans_to(src, E.reagents.total_volume)
+ qdel(E)
+ return
+ else
+ ..()
+
+/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/fire_act()
+ if(!reagents.total_volume)
+ return
+ ..()
+
+/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/burn()
+ reagents.clear_reagents()
+ extinguish()
+
+/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/on_reagent_change() // *scream
+ if(reagents.reagent_list.len > 0)
+ switch(reagents.get_master_reagent_id())
+ if("beer")
+ icon_state = "beerglass"
+ name = "Beer glass"
+ desc = "A freezing pint of beer"
+ if("cider")
+ icon_state = "rewriter"
+ name = "Cider"
+ desc = "a refreshing glass of traditional cider"
+ if("beer2")
+ icon_state = "beerglass"
+ name = "Beer glass"
+ desc = "A freezing pint of beer"
+ if("ale")
+ icon_state = "aleglass"
+ name = "Ale glass"
+ desc = "A freezing pint of delicious Ale"
+ if("milk")
+ icon_state = "glass_white"
+ name = "Glass of milk"
+ desc = "White and nutritious goodness!"
+ if("cream")
+ icon_state = "glass_white"
+ name = "Glass of cream"
+ desc = "Ewwww..."
+ if("chocolate")
+ icon_state = "chocolateglass"
+ name = "Glass of chocolate"
+ desc = "Tasty"
+ if("hot_coco")
+ icon_state = "hot_coco"
+ name = "Glass of hot coco"
+ desc = "Delicious and cozy"
+ if("lemonjuice")
+ icon_state = "lemonglass"
+ name = "Glass of lemonjuice"
+ desc = "Sour..."
+ if("cola")
+ icon_state = "glass_brown"
+ name = "Glass of Space Cola"
+ desc = "A glass of refreshing Space Cola"
+ if("nuka_cola")
+ icon_state = "nuka_colaglass"
+ name = "Nuka Cola"
+ desc = "Don't cry, Don't raise your eye, It's only nuclear wasteland"
+ if("orangejuice")
+ icon_state = "glass_orange"
+ name = "Glass of Orange juice"
+ desc = "Vitamins! Yay!"
+ if("tomatojuice")
+ icon_state = "glass_red"
+ name = "Glass of Tomato juice"
+ desc = "Are you sure this is tomato juice?"
+ if("blood")
+ icon_state = "glass_red"
+ name = "Glass of Tomato juice"
+ desc = "Are you sure this is tomato juice?"
+ if("limejuice")
+ icon_state = "glass_green"
+ name = "Glass of Lime juice"
+ desc = "A glass of sweet-sour lime juice."
+ if("whiskey")
+ icon_state = "whiskeyglass"
+ name = "Glass of whiskey"
+ desc = "The silky, smokey whiskey goodness inside the glass makes the drink look very classy."
+ if("gin")
+ icon_state = "ginvodkaglass"
+ name = "Glass of gin"
+ desc = "A crystal clear glass of Griffeater gin."
+ if("vodka")
+ icon_state = "ginvodkaglass"
+ name = "Glass of vodka"
+ desc = "The glass contain wodka. Xynta."
+ if("sake")
+ icon_state = "ginvodkaglass"
+ name = "Glass of Sake"
+ desc = "A glass of Sake."
+ if("goldschlager")
+ icon_state = "ginvodkaglass"
+ name = "Glass of goldschlager"
+ desc = "100 proof that teen girls will drink anything with gold in it."
+ if("wine")
+ icon_state = "wineglass"
+ name = "Glass of wine"
+ desc = "A very classy looking drink."
+ if("cognac")
+ icon_state = "cognacglass"
+ name = "Glass of cognac"
+ desc = "Damn, you feel like some kind of French aristocrat just by holding this."
+ if("kahlua")
+ icon_state = "kahluaglass"
+ name = "Glass of RR coffee Liquor"
+ desc = "DAMN, THIS THING LOOKS ROBUST"
+ if("vermouth")
+ icon_state = "vermouthglass"
+ name = "Glass of Vermouth"
+ desc = "You wonder why you're even drinking this straight."
+ if("triple_citrus")
+ icon_state = "triplecitrus"
+ name = "Glass of Triplecitrus Juice"
+ desc = "As colorful and healthy as it is delicious."
+ if("mojito")
+ icon_state = "mojito"
+ name = "Glass of Mojito"
+ desc = "Fresh from Spesscuba."
+ if("tequila")
+ icon_state = "tequilaglass"
+ name = "Glass of Tequila"
+ desc = "Now all that's missing is the weird colored shades!"
+ if("patron")
+ icon_state = "patronglass"
+ name = "Glass of Patron"
+ desc = "Drinking patron in the bar, with all the subpar ladies."
+ if("rum")
+ icon_state = "rumglass"
+ name = "Glass of Rum"
+ desc = "Now you want to Pray for a pirate suit, don't you?"
+ if("absinthe")
+ icon_state = "absinthebottle"
+ name = "Glass of Absinthe"
+ desc = "The green fairy is going to get you now!"
+ if("gintonic")
+ icon_state = "gintonicglass"
+ name = "Gin and Tonic"
+ desc = "A mild but still great cocktail. Drink up, like a true Englishman."
+ if("ginsonic")
+ icon_state = "ginsonic"
+ name = "Gin and Sonic"
+ desc = "An extremely high amperage drink. Absolutely not for the true Englishman."
+ if("whiskeycola")
+ icon_state = "whiskeycolaglass"
+ name = "Whiskey Cola"
+ desc = "An innocent-looking mixture of cola and Whiskey. Delicious."
+ if("whiterussian")
+ icon_state = "whiterussianglass"
+ name = "White Russian"
+ desc = "A very nice looking drink. But that's just, like, your opinion, man."
+ if("screwdrivercocktail")
+ icon_state = "screwdriverglass"
+ name = "Screwdriver"
+ desc = "A simple, yet superb mixture of Vodka and orange juice. Just the thing for the tired engineer."
+ if("bloodymary")
+ icon_state = "bloodymaryglass"
+ name = "Bloody Mary"
+ desc = "Tomato juice, mixed with Vodka and a lil' bit of lime. Tastes like liquid murder."
+ if("martini")
+ icon_state = "martiniglass"
+ name = "Classic Martini"
+ desc = "Damn, the bartender even stirred it, not shook it."
+ if("vodkamartini")
+ icon_state = "martiniglass"
+ name = "Vodka martini"
+ desc ="A bastardisation of the classic martini. Still great."
+ if("gargleblaster")
+ icon_state = "gargleblasterglass"
+ name = "Pan-Galactic Gargle Blaster"
+ desc = "Does... does this mean that Arthur and Ford are on the station? Oh joy."
+ if("bravebull")
+ icon_state = "bravebullglass"
+ name = "Brave Bull"
+ desc = "Tequila and Coffee liquor, brought together in a mouthwatering mixture. Drink up."
+ if("tequilasunrise")
+ icon_state = "tequilasunriseglass"
+ name = "Tequila Sunrise"
+ desc = "Oh great, now you feel nostalgic about sunrises back on Terra..."
+ if("toxinsspecial")
+ icon_state = "toxinsspecialglass"
+ name = "Toxins Special"
+ desc = "Whoah, this thing is on FIRE"
+ if("beepskysmash")
+ icon_state = "beepskysmashglass"
+ name = "Beepsky Smash"
+ desc = "Heavy, hot and strong. Just like the Iron fist of the LAW."
+ if("doctorsdelight")
+ icon_state = "doctorsdelightglass"
+ name = "Doctor's Delight"
+ desc = "A healthy mixture of juices, guaranteed to keep you healthy until the next toolboxing takes place."
+ if("manlydorf")
+ icon_state = "manlydorfglass"
+ name = "The Manly Dorf"
+ desc = "A manly concotion made from Ale and Beer. Intended for true men only."
+ if("irishcream")
+ icon_state = "irishcreamglass"
+ name = "Irish Cream"
+ desc = "It's cream, mixed with whiskey. What else would you expect from the Irish?"
+ if("cubalibre")
+ icon_state = "cubalibreglass"
+ name = "Cuba Libre"
+ desc = "A classic mix of rum and cola."
+ if("b52")
+ icon_state = "b52glass"
+ name = "B-52"
+ desc = "Kahlua, Irish Cream, and congac. You will get bombed."
+ if("atomicbomb")
+ icon_state = "atomicbombglass"
+ name = "Atomic Bomb"
+ desc = "Nanotrasen cannot take legal responsibility for your actions after imbibing."
+ if("longislandicedtea")
+ icon_state = "longislandicedteaglass"
+ name = "Long Island Iced Tea"
+ desc = "The liquor cabinet, brought together in a delicious mix. Intended for middle-aged alcoholic women only."
+ if("threemileisland")
+ icon_state = "threemileislandglass"
+ name = "Three Mile Island Ice Tea"
+ desc = "A glass of this is sure to prevent a meltdown."
+ if("margarita")
+ icon_state = "margaritaglass"
+ name = "Margarita"
+ desc = "On the rocks with salt on the rim. Arriba~!"
+ if("blackrussian")
+ icon_state = "blackrussianglass"
+ name = "Black Russian"
+ desc = "For the lactose-intolerant. Still as classy as a White Russian."
+ if("vodkatonic")
+ icon_state = "vodkatonicglass"
+ name = "Vodka and Tonic"
+ desc = "For when a gin and tonic isn't russian enough."
+ if("manhattan")
+ icon_state = "manhattanglass"
+ name = "Manhattan"
+ desc = "The Detective's undercover drink of choice. He never could stomach gin..."
+ if("manhattan_proj")
+ icon_state = "proj_manhattanglass"
+ name = "Manhattan Project"
+ desc = "A scienitst drink of choice, for thinking how to blow up the station."
+ if("ginfizz")
+ icon_state = "ginfizzglass"
+ name = "Gin Fizz"
+ desc = "Refreshingly lemony, deliciously dry."
+ if("irishcoffee")
+ icon_state = "irishcoffeeglass"
+ name = "Irish Coffee"
+ desc = "Coffee and alcohol. More fun than a Mimosa to drink in the morning."
+ if("suicider")
+ icon_state = "suicider"
+ name = "Suicider"
+ desc = "You've really hit rock bottom now... your liver packed its bags and left last night."
+ if("whiskeysoda")
+ icon_state = "whiskeysodaglass2"
+ name = "Whiskey Soda"
+ desc = "Ultimate refreshment."
+ if("tonic")
+ icon_state = "glass_clear"
+ name = "Glass of Tonic Water"
+ desc = "Quinine tastes funny, but at least it'll keep that Space Malaria away."
+ if("sodawater")
+ icon_state = "glass_clear"
+ name = "Glass of Soda Water"
+ desc = "Soda water. Why not make a scotch and soda?"
+ if("water")
+ icon_state = "glass_clear"
+ name = "Glass of Water"
+ desc = "The father of all refreshments."
+ if("spacemountainwind")
+ icon_state = "Space_mountain_wind_glass"
+ name = "Glass of Space Mountain Wind"
+ desc = "Space Mountain Wind. As you know, there are no mountains in space, only wind."
+ if("thirteenloko")
+ icon_state = "thirteen_loko_glass"
+ name = "Glass of Thirteen Loko"
+ desc = "This is a glass of Thirteen Loko, it appears to be of the highest quality. The drink, not the glass"
+ if("dr_gibb")
+ icon_state = "dr_gibb_glass"
+ name = "Glass of Dr. Gibb"
+ desc = "Dr. Gibb. Not as dangerous as the name might imply."
+ if("space_up")
+ icon_state = "space-up_glass"
+ name = "Glass of Space-up"
+ desc = "Space-up. It helps keep your cool."
+ if("moonshine")
+ icon_state = "glass_clear"
+ name = "Moonshine"
+ desc = "You've really hit rock bottom now... your liver packed its bags and left last night."
+ if("soymilk")
+ icon_state = "glass_white"
+ name = "Glass of soy milk"
+ desc = "White and nutritious soy goodness!"
+ if("berryjuice")
+ icon_state = "berryjuice"
+ name = "Glass of berry juice"
+ desc = "Berry juice. Or maybe its jam. Who cares?"
+ if("poisonberryjuice")
+ icon_state = "poisonberryjuice"
+ name = "Glass of poison berry juice"
+ desc = "A glass of deadly juice."
+ if("carrotjuice")
+ icon_state = "carrotjuice"
+ name = "Glass of carrot juice"
+ desc = "It is just like a carrot but without crunching."
+ if("potato")
+ icon_state = "glass_brown"
+ name = "Glass of potato juice"
+ desc = "Who in the hell requests this? Gross!"
+ if("banana")
+ icon_state = "banana"
+ name = "Glass of banana juice"
+ desc = "The raw essence of a banana. HONK"
+ if("bahama_mama")
+ icon_state = "bahama_mama"
+ name = "Bahama Mama"
+ desc = "Tropic cocktail"
+ if("singulo")
+ icon_state = "singulo"
+ name = "Singulo"
+ desc = "A blue-space beverage."
+ if("alliescocktail")
+ icon_state = "alliescocktail"
+ name = "Allies cocktail"
+ desc = "A drink made from your allies."
+ if("antifreeze")
+ icon_state = "antifreeze"
+ name = "Anti-freeze"
+ desc = "The ultimate refreshment."
+ if("barefoot")
+ icon_state = "b&p"
+ name = "Barefoot"
+ desc = "Barefoot and pregnant"
+ if("demonsblood")
+ icon_state = "demonsblood"
+ name = "Demons Blood"
+ desc = "Just looking at this thing makes the hair at the back of your neck stand up."
+ if("booger")
+ icon_state = "booger"
+ name = "Booger"
+ desc = "Ewww..."
+ if("snowwhite")
+ icon_state = "snowwhite"
+ name = "Snow White"
+ desc = "A cold refreshment."
+ if("aloe")
+ icon_state = "aloe"
+ name = "Aloe"
+ desc = "Very, very, very good."
+ if("andalusia")
+ icon_state = "andalusia"
+ name = "Andalusia"
+ desc = "A nice, strange named drink."
+ if("sbiten")
+ icon_state = "sbitenglass"
+ name = "Sbiten"
+ desc = "A spicy mix of Vodka and Spice. Very hot."
+ if("red_mead")
+ icon_state = "red_meadglass"
+ name = "Red Mead"
+ desc = "A True Vikings Beverage, though its color is strange."
+ if("mead")
+ icon_state = "meadglass"
+ name = "Mead"
+ desc = "A Vikings Beverage, though a cheap one."
+ if("iced_beer")
+ icon_state = "iced_beerglass"
+ name = "Iced Beer"
+ desc = "A beer so frosty, the air around it freezes."
+ if("grog")
+ icon_state = "grogglass"
+ name = "Grog"
+ desc = "A fine and cepa drink for Space."
+ if("soy_latte")
+ icon_state = "soy_latte"
+ name = "Soy Latte"
+ desc = "A nice and refrshing beverage while you are reading."
+ if("cafe_latte")
+ icon_state = "cafe_latte"
+ name = "Cafe Latte"
+ desc = "A nice, strong and refreshing beverage while you are reading."
+ if("cafe_mocha")
+ icon_state = "cafe_latte"
+ name = "Cafe Mocha"
+ desc = "The perfect blend of coffe, milk, and chocolate."
+ if("acidspit")
+ icon_state = "acidspitglass"
+ name = "Acid Spit"
+ desc = "A drink from Nanotrasen. Made from live aliens."
+ if("amasec")
+ icon_state = "amasecglass"
+ name = "Amasec"
+ desc = "Always handy before COMBAT!!!"
+ if("neurotoxin")
+ icon_state = "neurotoxinglass"
+ name = "Neurotoxin"
+ desc = "A drink that is guaranteed to knock you silly."
+ if("hippiesdelight")
+ icon_state = "hippiesdelightglass"
+ name = "Hippie's Delight"
+ desc = "A drink enjoyed by people during the 1960's."
+ if("bananahonk")
+ icon_state = "bananahonkglass"
+ name = "Banana Honk"
+ desc = "A drink from Banana Heaven."
+ if("silencer")
+ icon_state = "silencerglass"
+ name = "Silencer"
+ desc = "A drink from mime Heaven."
+ if("nothing")
+ icon_state = "nothing"
+ name = "Nothing"
+ desc = "Absolutely nothing."
+ if("devilskiss")
+ icon_state = "devilskiss"
+ name = "Devils Kiss"
+ desc = "Creepy time!"
+ if("changelingsting")
+ icon_state = "changelingsting"
+ name = "Changeling Sting"
+ desc = "A stingy drink."
+ if("irishcarbomb")
+ icon_state = "irishcarbomb"
+ name = "Irish Car Bomb"
+ desc = "An irish car bomb."
+ if("syndicatebomb")
+ icon_state = "syndicatebomb"
+ name = "Syndicate Bomb"
+ desc = "A syndicate bomb."
+ if("erikasurprise")
+ icon_state = "erikasurprise"
+ name = "Erika Surprise"
+ desc = "The surprise is, it's green!"
+ if("driestmartini")
+ icon_state = "driestmartiniglass"
+ name = "Driest Martini"
+ desc = "Only for the experienced. You think you see sand floating in the glass."
+ if("ice")
+ icon_state = "iceglass"
+ name = "Glass of ice"
+ desc = "Generally, you're supposed to put something else in there too..."
+ if("icecoffee")
+ icon_state = "icedcoffeeglass"
+ name = "Iced Coffee"
+ desc = "A drink to perk you up and refresh you!"
+ if("coffee")
+ icon_state = "glass_brown"
+ name = "Glass of coffee"
+ desc = "Don't drop it, or you'll send scalding liquid and glass shards everywhere."
+ if("bilk")
+ icon_state = "glass_brown"
+ name = "Glass of bilk"
+ desc = "A brew of milk and beer. For those alcoholics who fear osteoporosis."
+ if("fuel")
+ icon_state = "dr_gibb_glass"
+ name = "Glass of welder fuel"
+ desc = "Unless you are an industrial tool, this is probably not safe for consumption."
+ if("brownstar")
+ icon_state = "brownstar"
+ name = "Brown Star"
+ desc = "Its not what it sounds like..."
+ if("tea")
+ icon_state = "glass_brown"
+ name = "Glass of Tea"
+ desc = "A glass of hot tea. Perhaps a cup with a handle would have been smarter?"
+ if("icetea")
+ icon_state = "icetea"
+ name = "Iced Tea"
+ desc = "No relation to a certain rap artist/ actor."
+ if("milkshake")
+ icon_state = "milkshake"
+ name = "Milkshake"
+ desc = "Glorious brainfreezing mixture."
+ if("lemonade")
+ icon_state = "lemonade"
+ name = "Lemonade"
+ desc = "Oh the nostalgia..."
+ if("kiraspecial")
+ icon_state = "kiraspecial"
+ name = "Kira Special"
+ desc = "Long live the guy who everyone had mistaken for a girl. Baka!"
+ if("rewriter")
+ icon_state = "rewriter"
+ name = "Rewriter"
+ desc = "The secert of the sanctuary of the Libarian..."
+ if("applejack")
+ icon_state = "cognacglass"
+ name = "Glass of applejack"
+ desc = "When cider isn't strong enough, you gotta jack it."
+ if("jackrose")
+ icon_state = "patronglass"
+ name = "Jack Rose"
+ desc = "Drinking this makes you feel like you belong in a luxury hotel bar during the 1920s."
+ if("synthanol")
+ icon_state = "synthanolglass"
+ name = "Glass of Synthanol"
+ desc = "The equivalent of alcohol for synthetic crewmembers. They'd find it awful if they had tastebuds too."
+ if("robottears")
+ icon_state = "robottearsglass"
+ name = "Glass of Robot Tears"
+ desc = "No robots were hurt in the making of this drink."
+ if("trinary")
+ icon_state = "trinaryglass"
+ name = "Glass of Trinary"
+ desc = "Colorful drink made for synthetic crewmembers. It doesn't seem like it would taste well."
+ if("servo")
+ icon_state = "servoglass"
+ name = "Glass of Servo"
+ desc = "Chocolate - based drink made for IPCs. Not sure if anyone's actually tried out the recipe."
+ if("synthnsoda")
+ icon_state = "synthnsodaglass"
+ name = "Glass of Synth 'n Soda"
+ desc = "Classic drink altered to fit the tastes of a robot. Bad idea to drink if you're made of carbon."
+ if("synthignon")
+ icon_state = "synthignonglass"
+ name = "Glass of Synthignon"
+ desc = "Someone mixed good wine and robot booze. Romantic, but atrocious."
+ if("uplink")
+ icon_state = "uplinkglass"
+ name = "Glass of Uplink"
+ desc = "An exquisite mix of the finest liquoirs and synthanol. Meant only for synthetics."
+ if("holywater")
+ icon_state = "glass_clear"
+ name = "Glass of Water"
+ desc = "The father of all refreshments."
+
+
+ else
+ icon_state ="glass_brown"
+ name = "Glass of ..what?"
+ desc = "You can't really tell what this is."
+ else
+ icon_state = "glass_empty"
+ name = "glass"
+ desc = "Your standard drinking glass."
+
+// for /obj/machinery/vending/sovietsoda
+/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/soda
+ list_reagents = list("sodawater" = 50)
+
+
+/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/cola
+ list_reagents = list("cola" = 50)
+
+/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/devilskiss
+ list_reagents = list("devilskiss" = 50)
\ No newline at end of file
diff --git a/code/modules/reagents/reagent_containers/food/drinks/shotglass.dm b/code/modules/food_and_drinks/drinks/drinks/shotglass.dm
similarity index 74%
rename from code/modules/reagents/reagent_containers/food/drinks/shotglass.dm
rename to code/modules/food_and_drinks/drinks/drinks/shotglass.dm
index 46289547909..42781cd1e57 100644
--- a/code/modules/reagents/reagent_containers/food/drinks/shotglass.dm
+++ b/code/modules/food_and_drinks/drinks/drinks/shotglass.dm
@@ -11,10 +11,15 @@
if(reagents.total_volume)
var/image/filling = image('icons/obj/reagentfillings.dmi', src, "[icon_state]1")
- switch(reagents.total_volume)
- if(0 to 4) filling.icon_state = "[icon_state]1"
- if(5 to 11) filling.icon_state = "[icon_state]5"
- if(12 to INFINITY) filling.icon_state = "[icon_state]12"
+
+ var/percent = round((reagents.total_volume / volume) * 100)
+ switch(percent)
+ if(0 to 25)
+ filling.icon_state = "[icon_state]1"
+ if(26 to 79)
+ filling.icon_state = "[icon_state]5"
+ if(80 to INFINITY)
+ filling.icon_state = "[icon_state]12"
filling.icon += mix_color_from_reagents(reagents.reagent_list)
overlays += filling
diff --git a/code/modules/reagents/reagent_containers/food.dm b/code/modules/food_and_drinks/food.dm
similarity index 76%
rename from code/modules/reagents/reagent_containers/food.dm
rename to code/modules/food_and_drinks/food.dm
index 8caaa5ff653..f14c0d19254 100644
--- a/code/modules/reagents/reagent_containers/food.dm
+++ b/code/modules/food_and_drinks/food.dm
@@ -1,17 +1,19 @@
-////////////////////////////////////////////////////////////////////////////////
-/// Food.
-////////////////////////////////////////////////////////////////////////////////
-/obj/item/weapon/reagent_containers/food
- possible_transfer_amounts = null
- volume = 50 //Sets the default container amount for all food items.
- var/filling_color = "#FFFFFF" //Used by sandwiches.
- var/bitesize = 1
- var/consume_sound = 'sound/items/eatfood.ogg'
- var/apply_type = INGEST
- var/apply_method = "swallow"
- var/transfer_efficiency = 1.0
-
-/obj/item/weapon/reagent_containers/food/New()
- ..()
- src.pixel_x = rand(-10.0, 10) //Randomizes postion
- src.pixel_y = rand(-10.0, 10)
\ No newline at end of file
+////////////////////////////////////////////////////////////////////////////////
+/// Food.
+////////////////////////////////////////////////////////////////////////////////
+/obj/item/weapon/reagent_containers/food
+ possible_transfer_amounts = null
+ volume = 50 //Sets the default container amount for all food items.
+ var/filling_color = "#FFFFFF" //Used by sandwiches.
+ var/bitesize = 1
+ var/consume_sound = 'sound/items/eatfood.ogg'
+ var/apply_type = INGEST
+ var/apply_method = "swallow"
+ var/transfer_efficiency = 1.0
+ var/instant_application = 0 //if we want to bypass the forcedfeed delay
+ burn_state = FLAMMABLE
+
+/obj/item/weapon/reagent_containers/food/New()
+ ..()
+ pixel_x = rand(-10, 10) //Randomizes postion
+ pixel_y = rand(-10, 10)
\ No newline at end of file
diff --git a/code/modules/reagents/reagent_containers/food/snacks/candy.dm b/code/modules/food_and_drinks/food/candy.dm
similarity index 99%
rename from code/modules/reagents/reagent_containers/food/snacks/candy.dm
rename to code/modules/food_and_drinks/food/candy.dm
index 1370eff0093..d13eb7ec145 100644
--- a/code/modules/reagents/reagent_containers/food/snacks/candy.dm
+++ b/code/modules/food_and_drinks/food/candy.dm
@@ -139,13 +139,13 @@
reagents.add_reagent("sugar", 3)
bitesize = 5
-/obj/item/weapon/reagent_containers/food/snacks/candy_corn
+/obj/item/weapon/reagent_containers/food/snacks/candy/candy_corn
name = "candy corn"
desc = "It's a handful of candy corn. Cannot be stored in a detective's hat, alas."
- icon_state = "candy_corn"
+ icon_state = "candycorn"
filling_color = "#FFFCB0"
-/obj/item/weapon/reagent_containers/food/snacks/candy_corn/New()
+/obj/item/weapon/reagent_containers/food/snacks/candy/candy_corn/New()
..()
reagents.add_reagent("nutriment", 4)
reagents.add_reagent("sugar", 2)
diff --git a/code/modules/reagents/reagent_containers/food/condiment.dm b/code/modules/food_and_drinks/food/condiment.dm
similarity index 66%
rename from code/modules/reagents/reagent_containers/food/condiment.dm
rename to code/modules/food_and_drinks/food/condiment.dm
index e1fb06f1be7..bd740e2657b 100644
--- a/code/modules/reagents/reagent_containers/food/condiment.dm
+++ b/code/modules/food_and_drinks/food/condiment.dm
@@ -1,276 +1,253 @@
-
-///////////////////////////////////////////////Condiments
-//Notes by Darem: The condiments food-subtype is for stuff you don't actually eat but you use to modify existing food. They all
-// leave empty containers when used up and can be filled/re-filled with other items. Formatting for first section is identical
-// to mixed-drinks code. If you want an object that starts pre-loaded, you need to make it in addition to the other code.
-
-//Food items that aren't eaten normally and leave an empty container behind.
-/obj/item/weapon/reagent_containers/food/condiment
- name = "condiment container"
- desc = "Just your average condiment container."
- icon = 'icons/obj/food/food.dmi'
- icon_state = "emptycondiment"
- flags = OPENCONTAINER
- possible_transfer_amounts = list(1,5,10)
- volume = 50
- //Possible_states has the reagent id as key and a list of, in order, the icon_state, the name and the desc as values. Used in the on_reagent_change() to change names, descs and sprites.
- var/list/possible_states = list(
- "ketchup" = list("ketchup", "ketchup bottle", "You feel more American already."),
- "capsaicin" = list("hotsauce", "hotsauce bottle", "You can almost TASTE the stomach ulcers now!"),
- "enzyme" = list("enzyme", "universal enzyme bottle", "Used in cooking various dishes"),
- "soysauce" = list("soysauce", "soy sauce bottle", "A salty soy-based flavoring"),
- "frostoil" = list("coldsauce", "coldsauce bottle", "Leaves the tongue numb in it's passage"),
- "sodiumchloride" = list("saltshakersmall", "salt shaker", "Salt. From space oceans, presumably"),
- "blackpepper" = list("pepermillsmall", "pepper mill", "Often used to flavor food or make people sneeze"),
- "cornoil" = list("oliveoil", "corn oil bottle", "A delicious oil used in cooking. Made from corn"),
- "sugar" = list("emptycondiment", "sugar bottle", "Tasty spacey sugar!"),
- "flour" =list("flour", "flour sack", "A big bag of flour. Good for baking!"),
- "rice" =list("rice", "rice sack", "A big bag of rice. Good for cooking!"))
-
-
-/obj/item/weapon/reagent_containers/food/condiment/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
- return
-
-
-/obj/item/weapon/reagent_containers/food/condiment/attack_self(mob/user as mob)
- return
-
-/obj/item/weapon/reagent_containers/food/condiment/attack(mob/M as mob, mob/user as mob, def_zone)
- var/datum/reagents/R = src.reagents
-
- if(!R || !R.total_volume)
- to_chat(user, "\red None of [src] left, oh no!")
- return 0
-
- if(M == user)
- to_chat(M, "\blue You swallow some of contents of the [src].")
- if(reagents.total_volume)
- reagents.reaction(M, INGEST)
- spawn(0)
- reagents.trans_to(M, 10)
-
- playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1)
- return 1
- else if( istype(M, /mob/living/carbon/human) )
-
- for(var/mob/O in viewers(world.view, user))
- O.show_message("\red [user] attempts to feed [M] [src].", 1)
- if(!do_mob(user, M)) return
- for(var/mob/O in viewers(world.view, user))
- O.show_message("\red [user] feeds [M] [src].", 1)
-
- M.attack_log += text("\[[time_stamp()]\] Has been fed [src.name] by [key_name(user)] Reagents: [reagentlist(src)]")
- user.attack_log += text("\[[time_stamp()]\] Fed [src.name] by [key_name(M)] Reagents: [reagentlist(src)]")
- if(M.ckey)
- msg_admin_attack("[key_name_admin(user)] fed [key_name_admin(M)] with [src.name] (INTENT: [uppertext(user.a_intent)])")
- if(!iscarbon(user))
- M.LAssailant = null
- else
- M.LAssailant = user
-
- if(reagents.total_volume)
- reagents.reaction(M, INGEST)
- spawn(0)
- reagents.trans_to(M, 10)
-
- playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1)
- return 1
- return 0
-
-/obj/item/weapon/reagent_containers/food/condiment/attackby(obj/item/I as obj, mob/user as mob, params)
- return
-
-/obj/item/weapon/reagent_containers/food/condiment/afterattack(obj/target, mob/user , proximity)
- if(!proximity) return
- if(istype(target, /obj/structure/reagent_dispensers)) //A dispenser. Transfer FROM it TO us.
-
- if(!target.reagents.total_volume)
- to_chat(user, "\red [target] is empty.")
- return
-
- if(reagents.total_volume >= reagents.maximum_volume)
- to_chat(user, "\red [src] is full.")
- return
-
- var/trans = target.reagents.trans_to(src, target:amount_per_transfer_from_this)
- to_chat(user, "\blue You fill [src] with [trans] units of the contents of [target].")
-
- //Something like a glass or a food item. Player probably wants to transfer TO it.
- else if(target.is_open_container() || istype(target, /obj/item/weapon/reagent_containers/food/snacks))
- if(!reagents.total_volume)
- to_chat(user, "\red [src] is empty.")
- return
- if(target.reagents.total_volume >= target.reagents.maximum_volume)
- to_chat(user, "\red you can't add anymore to [target].")
- return
- var/trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
- to_chat(user, "\blue You transfer [trans] units of the condiment to [target].")
-
-/obj/item/weapon/reagent_containers/food/condiment/on_reagent_change()
- if(!possible_states.len)
- return
- if(reagents.reagent_list.len > 0)
- var/main_reagent = reagents.get_master_reagent_id()
- if(main_reagent in possible_states)
- var/list/temp_list = possible_states[main_reagent]
- icon_state = temp_list[1]
- name = temp_list[2]
- desc = temp_list[3]
-
- else
- name = "condiment bottle"
- main_reagent = reagents.get_master_reagent_name()
- if (reagents.reagent_list.len==1)
- desc = "Looks like it is [lowertext(main_reagent)], but you are not sure."
- else
- desc = "A mixture of various condiments. [lowertext(main_reagent)] is one of them."
- icon_state = "mixedcondiments"
- else
- icon_state = "emptycondiment"
- name = "condiment bottle"
- desc = "An empty condiment bottle."
- return
-
-
-/obj/item/weapon/reagent_containers/food/condiment/enzyme
- name = "universal enzyme"
- desc = "Used in cooking various dishes."
- icon_state = "enzyme"
- New()
- ..()
- reagents.add_reagent("enzyme", 50)
-
-/obj/item/weapon/reagent_containers/food/condiment/sugar
- name = "sugar bottle"
- desc = "Tasty spacey sugar!"
-
- New()
- ..()
- reagents.add_reagent("sugar", 50)
-
-/obj/item/weapon/reagent_containers/food/condiment/flour
- name = "flour sack"
- desc = "A big bag of flour. Good for baking!"
- icon_state = "flour"
- item_state = "flour"
- possible_states = list()
-
- New()
- ..()
- reagents.add_reagent("flour", 30)
-
-/obj/item/weapon/reagent_containers/food/condiment/rice
- name = "rice sack"
- desc = "A big bag of rice. Good for cooking!"
- icon_state = "rice"
- item_state = "flour"
- possible_states = list()
-
- New()
- ..()
- reagents.add_reagent("rice", 30)
-
-/obj/item/weapon/reagent_containers/food/condiment/saltshaker //Seperate from above since it's a small shaker rather then
- name = "salt shaker" // a large one.
- desc = "Salt. From space oceans, presumably."
- icon_state = "saltshakersmall"
- possible_transfer_amounts = list(1,20) //for clown turning the lid off
- amount_per_transfer_from_this = 1
- volume = 20
- possible_states = list()
-
- New()
- ..()
- reagents.add_reagent("sodiumchloride", 20)
-
-/obj/item/weapon/reagent_containers/food/condiment/peppermill
- name = "pepper mill"
- desc = "Often used to flavor food or make people sneeze."
- icon_state = "peppermillsmall"
- possible_transfer_amounts = list(1,20) //for clown turning the lid off
- amount_per_transfer_from_this = 1
- volume = 20
- possible_states = list()
-
- New()
- ..()
- reagents.add_reagent("blackpepper", 20)
-
-/obj/item/weapon/reagent_containers/food/condiment/syndisauce
- name = "\improper Chef Excellence's Special Sauce"
- desc = "A potent sauce extracted from the potent amanita mushrooms. Death never tasted quite so delicious."
- amount_per_transfer_from_this = 5
- volume = 50
- New()
- ..()
- reagents.add_reagent("amanitin", 50)
-
-//Food packs. To easily apply deadly toxi... delicious sauces to your food!
-/obj/item/weapon/reagent_containers/food/condiment/pack
- name = "condiment pack"
- desc = "A small plastic pack with condiments to put on your food"
- icon_state = "condi_empty"
- volume = 10
- amount_per_transfer_from_this = 10
- possible_transfer_amounts = 10
- possible_states = list("ketchup" = list("condi_ketchup", "Ketchup", "You feel more American already."), "capsaicin" = list("condi_hotsauce", "Hotsauce", "You can almost TASTE the stomach ulcers now!"), "soysauce" = list("condi_soysauce", "Soy Sauce", "A salty soy-based flavoring"), "frostoil" = list("condi_frostoil", "Coldsauce", "Leaves the tongue numb in it's passage"), "sodiumchloride" = list("condi_salt", "Salt Shaker", "Salt. From space oceans, presumably"), "blackpepper" = list("condi_pepper", "Pepper Mill", "Often used to flavor food or make people sneeze"), "cornoil" = list("condi_cornoil", "Corn Oil", "A delicious oil used in cooking. Made from corn"), "sugar" = list("condi_sugar", "Sugar", "Tasty spacey sugar!"))
- var/originalname = "condiment" //Can't use initial(name) for this. This stores the name set by condimasters.
-
-/obj/item/weapon/reagent_containers/food/condiment/pack/New()
- ..()
- pixel_x = rand(-7, 7)
- pixel_y = rand(-7, 7)
-
-/obj/item/weapon/reagent_containers/food/condiment/pack/attack(mob/M as mob, mob/user as mob, def_zone) //Can't feed these to people directly.
- return
-
-/obj/item/weapon/reagent_containers/food/condiment/pack/afterattack(obj/target, mob/user , proximity)
- if(!proximity) return
-
- //You can tear the bag open above food to put the condiments on it, obviously.
- if(istype(target, /obj/item/weapon/reagent_containers/food/snacks))
- if(!reagents.total_volume)
- to_chat(user, "You tear open [src], but there's nothing in it.")
- qdel(src)
- return
- if(target.reagents.total_volume >= target.reagents.maximum_volume)
- to_chat(user, "You tear open [src], but [target] is stacked so high that it just drips off!")//Not sure if food can ever be full, but better safe than sorry.
-
- qdel(src)
- return
- else
- to_chat(user, "You tear open [src] above [target] and the condiments drip onto it.")
- src.reagents.trans_to(target, amount_per_transfer_from_this)
- qdel(src)
-
-/obj/item/weapon/reagent_containers/food/condiment/pack/on_reagent_change()
- if(reagents.reagent_list.len > 0)
- var/main_reagent = reagents.get_master_reagent_id()
- if(main_reagent in possible_states)
- var/list/temp_list = possible_states[main_reagent]
- icon_state = temp_list[1]
- desc = temp_list[3]
- else
- icon_state = "condi_mixed"
- desc = "A small condiment pack. The label says it contains [originalname]"
- else
- icon_state = "condi_empty"
- desc = "A small condiment pack. It is empty."
-
-//Ketchup
-/obj/item/weapon/reagent_containers/food/condiment/pack/ketchup
- name = "Ketchup pack"
- originalname = "Ketchup"
-
-/obj/item/weapon/reagent_containers/food/condiment/pack/ketchup/New()
- ..()
- reagents.add_reagent("ketchup", 10)
-
-//Hot sauce
-/obj/item/weapon/reagent_containers/food/condiment/pack/hotsauce
- name = "Hotsauce pack"
- originalname = "Hotsauce"
-
-/obj/item/weapon/reagent_containers/food/condiment/pack/hotsauce/New()
- ..()
- reagents.add_reagent("capsaicin", 10)
\ No newline at end of file
+
+///////////////////////////////////////////////Condiments
+//Notes by Darem: The condiments food-subtype is for stuff you don't actually eat but you use to modify existing food. They all
+// leave empty containers when used up and can be filled/re-filled with other items. Formatting for first section is identical
+// to mixed-drinks code. If you want an object that starts pre-loaded, you need to make it in addition to the other code.
+
+//Food items that aren't eaten normally and leave an empty container behind.
+/obj/item/weapon/reagent_containers/food/condiment
+ name = "condiment container"
+ desc = "Just your average condiment container."
+ icon = 'icons/obj/food/containers.dmi'
+ icon_state = "emptycondiment"
+ flags = OPENCONTAINER
+ possible_transfer_amounts = list(1, 5, 10, 15, 20, 25, 30, 50)
+ volume = 50
+ //Possible_states has the reagent id as key and a list of, in order, the icon_state, the name and the desc as values. Used in the on_reagent_change() to change names, descs and sprites.
+ var/list/possible_states = list(
+ "ketchup" = list("ketchup", "ketchup bottle", "You feel more American already."),
+ "capsaicin" = list("hotsauce", "hotsauce bottle", "You can almost TASTE the stomach ulcers now!"),
+ "enzyme" = list("enzyme", "universal enzyme bottle", "Used in cooking various dishes"),
+ "soysauce" = list("soysauce", "soy sauce bottle", "A salty soy-based flavoring"),
+ "frostoil" = list("coldsauce", "coldsauce bottle", "Leaves the tongue numb in it's passage"),
+ "sodiumchloride" = list("saltshakersmall", "salt shaker", "Salt. From space oceans, presumably"),
+ "blackpepper" = list("peppermillsmall", "pepper mill", "Often used to flavor food or make people sneeze"),
+ "cornoil" = list("oliveoil", "corn oil bottle", "A delicious oil used in cooking. Made from corn"),
+ "sugar" = list("emptycondiment", "sugar bottle", "Tasty spacey sugar!"))
+ var/originalname = "condiment" //Can't use initial(name) for this. This stores the name set by condimasters.
+
+/obj/item/weapon/reagent_containers/food/condiment/attackby(obj/item/weapon/W, mob/user, params)
+ return
+
+/obj/item/weapon/reagent_containers/food/condiment/attack_self(mob/user)
+ return
+
+/obj/item/weapon/reagent_containers/food/condiment/attack(mob/M, mob/user, def_zone)
+
+ if(!reagents || !reagents.total_volume)
+ to_chat(user, "None of [src] left, oh no!")
+ return 0
+
+ if(M == user)
+ to_chat(M, "You swallow some of contents of \the [src].")
+ else
+ user.visible_message("[user] attempts to feed [M] from [src].")
+ if(!do_mob(user, M))
+ return
+ if(!reagents || !reagents.total_volume)
+ return // The condiment might be empty after the delay.
+ user.visible_message("[user] feeds [M] from [src].")
+ add_logs(M, user, "fed", reagentlist(src))
+
+ var/fraction = min(10/reagents.total_volume, 1)
+ reagents.reaction(M, INGEST, fraction)
+ reagents.trans_to(M, 10)
+ playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1)
+ return 1
+
+/obj/item/weapon/reagent_containers/food/condiment/attackby(obj/item/I, mob/user, params)
+ return
+
+/obj/item/weapon/reagent_containers/food/condiment/afterattack(obj/target, mob/user , proximity)
+ if(!proximity)
+ return
+ if(istype(target, /obj/structure/reagent_dispensers)) //A dispenser. Transfer FROM it TO us.
+
+ if(!target.reagents.total_volume)
+ to_chat(user, "[target] is empty!")
+ return
+
+ if(reagents.total_volume >= reagents.maximum_volume)
+ to_chat(user, "[src] is full!")
+ return
+
+ var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this)
+ to_chat(user, "You fill [src] with [trans] units of the contents of [target].")
+
+ //Something like a glass or a food item. Player probably wants to transfer TO it.
+ else if(target.is_open_container() || istype(target, /obj/item/weapon/reagent_containers/food/snacks))
+ if(!reagents.total_volume)
+ to_chat(user, "[src] is empty!")
+ return
+ if(target.reagents.total_volume >= target.reagents.maximum_volume)
+ to_chat(user, "you can't add anymore to [target]!")
+ return
+ var/trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
+ to_chat(user, "You transfer [trans] units of the condiment to [target].")
+
+/obj/item/weapon/reagent_containers/food/condiment/on_reagent_change()
+ if(!possible_states.len)
+ return
+ if(reagents.reagent_list.len > 0)
+ var/main_reagent = reagents.get_master_reagent_id()
+ if(main_reagent in possible_states)
+ var/list/temp_list = possible_states[main_reagent]
+ icon_state = temp_list[1]
+ name = temp_list[2]
+ desc = temp_list[3]
+
+ else
+ name = "[originalname] bottle"
+ main_reagent = reagents.get_master_reagent_name()
+ if(reagents.reagent_list.len==1)
+ desc = "Looks like it is [lowertext(main_reagent)], but you are not sure."
+ else
+ desc = "A mixture of various condiments. [lowertext(main_reagent)] is one of them."
+ icon_state = "mixedcondiments"
+ else
+ icon_state = "emptycondiment"
+ name = "condiment bottle"
+ desc = "An empty condiment bottle."
+
+/obj/item/weapon/reagent_containers/food/condiment/enzyme
+ name = "universal enzyme"
+ desc = "Used in cooking various dishes."
+ icon_state = "enzyme"
+ list_reagents = list("enzyme" = 50)
+
+/obj/item/weapon/reagent_containers/food/condiment/sugar
+ name = "sugar bottle"
+ desc = "Tasty spacey sugar!"
+ list_reagents = list("sugar" = 50)
+
+/obj/item/weapon/reagent_containers/food/condiment/saltshaker //Seperate from above since it's a small shaker rather then
+ name = "salt shaker" // a large one.
+ desc = "Salt. From space oceans, presumably."
+ icon_state = "saltshakersmall"
+ possible_transfer_amounts = list(1,20) //for clown turning the lid off
+ amount_per_transfer_from_this = 1
+ volume = 20
+ list_reagents = list("sodiumchloride" = 20)
+ possible_states = list()
+
+/obj/item/weapon/reagent_containers/food/condiment/saltshaker/suicide_act(mob/user)
+ user.visible_message("[user] begins to swap forms with the salt shaker! It looks like \he's trying to commit suicide.")
+ var/newname = "[name]"
+ name = "[user.name]"
+ user.name = newname
+ user.real_name = newname
+ desc = "Salt. From dead crew, presumably."
+ return (TOXLOSS)
+
+/obj/item/weapon/reagent_containers/food/condiment/peppermill
+ name = "pepper mill"
+ desc = "Often used to flavor food or make people sneeze."
+ icon_state = "peppermillsmall"
+ possible_transfer_amounts = list(1,20) //for clown turning the lid off
+ amount_per_transfer_from_this = 1
+ volume = 20
+ list_reagents = list("blackpepper" = 20)
+ possible_states = list()
+
+/obj/item/weapon/reagent_containers/food/condiment/milk
+ name = "space milk"
+ desc = "It's milk. White and nutritious goodness!"
+ icon_state = "milk"
+ item_state = "carton"
+ list_reagents = list("milk" = 50)
+ possible_states = list()
+
+/obj/item/weapon/reagent_containers/food/condiment/flour
+ name = "flour sack"
+ desc = "A big bag of flour. Good for baking!"
+ icon_state = "flour"
+ item_state = "flour"
+ list_reagents = list("flour" = 30)
+ possible_states = list()
+
+/obj/item/weapon/reagent_containers/food/condiment/soymilk
+ name = "soy milk"
+ desc = "It's soy milk. White and nutritious goodness!"
+ icon_state = "soymilk"
+ item_state = "carton"
+ list_reagents = list("soymilk" = 50)
+ possible_states = list()
+
+/obj/item/weapon/reagent_containers/food/condiment/rice
+ name = "rice sack"
+ desc = "A big bag of rice. Good for cooking!"
+ icon_state = "rice"
+ item_state = "flour"
+ list_reagents = list("rice" = 30)
+ possible_states = list()
+
+/obj/item/weapon/reagent_containers/food/condiment/soysauce
+ name = "soy sauce"
+ desc = "A salty soy-based flavoring."
+ icon_state = "soysauce"
+ list_reagents = list("soysauce" = 50)
+ possible_states = list()
+
+/obj/item/weapon/reagent_containers/food/condiment/syndisauce
+ name = "\improper Chef Excellence's Special Sauce"
+ desc = "A potent sauce extracted from the potent amanita mushrooms. Death never tasted quite so delicious."
+ list_reagents = list("amanitin" = 50)
+ possible_states = list()
+
+//Food packs. To easily apply deadly toxi... delicious sauces to your food!
+
+/obj/item/weapon/reagent_containers/food/condiment/pack
+ name = "condiment pack"
+ desc = "A small plastic pack with condiments to put on your food"
+ icon_state = "condi_empty"
+ volume = 10
+ amount_per_transfer_from_this = 10
+ possible_transfer_amounts = list()
+ possible_states = list("ketchup" = list("condi_ketchup", "Ketchup", "You feel more American already."), "capsaicin" = list("condi_hotsauce", "Hotsauce", "You can almost TASTE the stomach ulcers now!"), "soysauce" = list("condi_soysauce", "Soy Sauce", "A salty soy-based flavoring"), "frostoil" = list("condi_frostoil", "Coldsauce", "Leaves the tongue numb in it's passage"), "sodiumchloride" = list("condi_salt", "Salt Shaker", "Salt. From space oceans, presumably"), "blackpepper" = list("condi_pepper", "Pepper Mill", "Often used to flavor food or make people sneeze"), "cornoil" = list("condi_cornoil", "Corn Oil", "A delicious oil used in cooking. Made from corn"), "sugar" = list("condi_sugar", "Sugar", "Tasty spacey sugar!"))
+
+/obj/item/weapon/reagent_containers/food/condiment/pack/attack(mob/M, mob/user, def_zone) //Can't feed these to people directly.
+ return
+
+/obj/item/weapon/reagent_containers/food/condiment/pack/afterattack(obj/target, mob/user , proximity)
+ if(!proximity) return
+
+ //You can tear the bag open above food to put the condiments on it, obviously.
+ if(istype(target, /obj/item/weapon/reagent_containers/food/snacks))
+ if(!reagents.total_volume)
+ to_chat(user, "You tear open [src], but there's nothing in it.")
+ qdel(src)
+ return
+ if(target.reagents.total_volume >= target.reagents.maximum_volume)
+ to_chat(user, "You tear open [src], but [target] is stacked so high that it just drips off!") //Not sure if food can ever be full, but better safe than sorry.
+ qdel(src)
+ return
+ else
+ to_chat(user, "You tear open [src] above [target] and the condiments drip onto it.")
+ src.reagents.trans_to(target, amount_per_transfer_from_this)
+ qdel(src)
+
+/obj/item/weapon/reagent_containers/food/condiment/pack/on_reagent_change()
+ if(reagents.reagent_list.len > 0)
+ var/main_reagent = reagents.get_master_reagent_id()
+ if(main_reagent in possible_states)
+ var/list/temp_list = possible_states[main_reagent]
+ icon_state = temp_list[1]
+ desc = temp_list[3]
+ else
+ icon_state = "condi_mixed"
+ desc = "A small condiment pack. The label says it contains [originalname]"
+ else
+ icon_state = "condi_empty"
+ desc = "A small condiment pack. It is empty."
+
+//Ketchup
+/obj/item/weapon/reagent_containers/food/condiment/pack/ketchup
+ name = "ketchup pack"
+ originalname = "ketchup"
+ list_reagents = list("ketchup" = 10)
+
+//Hot sauce
+/obj/item/weapon/reagent_containers/food/condiment/pack/hotsauce
+ name = "hotsauce pack"
+ originalname = "hotsauce"
+ list_reagents = list("capsaicin" = 10)
diff --git a/code/modules/food/customizables.dm b/code/modules/food_and_drinks/food/customizables.dm
similarity index 91%
rename from code/modules/food/customizables.dm
rename to code/modules/food_and_drinks/food/customizables.dm
index ff1ff9f6ad5..78651f97b0c 100644
--- a/code/modules/food/customizables.dm
+++ b/code/modules/food_and_drinks/food/customizables.dm
@@ -1,497 +1,497 @@
-/obj/item/weapon/reagent_containers/food/snacks/breadslice/attackby(obj/item/W as obj, mob/user as mob, params)
- if(istype(W, /obj/item/weapon/reagent_containers/food/snacks) && !(W.flags & NODROP))
- var/obj/item/weapon/reagent_containers/food/snacks/customizable/sandwich/S = new(get_turf(user))
- S.attackby(W,user, params)
- qdel(src)
- else
- ..()
-
-/obj/item/weapon/reagent_containers/food/snacks/bun/attackby(obj/item/W as obj, mob/user as mob, params)
- if(istype(W, /obj/item/weapon/reagent_containers/food/snacks) && !(W.flags & NODROP))
- var/obj/item/weapon/reagent_containers/food/snacks/customizable/burger/S = new(get_turf(user))
- S.attackby(W,user, params)
- qdel(src)
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough/attackby(obj/item/W as obj, mob/user as mob, params)
- if(istype(W, /obj/item/weapon/reagent_containers/food/snacks) && !(W.flags & NODROP))
- var/obj/item/weapon/reagent_containers/food/snacks/customizable/pizza/S = new(get_turf(user))
- S.attackby(W,user, params)
- qdel(src)
- else
- ..()
-
-
-/obj/item/weapon/reagent_containers/food/snacks/boiledspagetti/attackby(obj/item/W as obj, mob/user as mob, params)
- if(istype(W, /obj/item/weapon/reagent_containers/food/snacks) && !(W.flags & NODROP))
- var/obj/item/weapon/reagent_containers/food/snacks/customizable/pasta/S = new(get_turf(user))
- S.attackby(W,user, params)
- qdel(src)
- else
- ..()
-
-
-/obj/item/trash/plate/attackby(obj/item/W as obj, mob/user as mob, params)
- if(istype(W, /obj/item/weapon/reagent_containers/food/snacks) && !(W.flags & NODROP))
- var/obj/item/weapon/reagent_containers/food/snacks/customizable/fullycustom/S = new(get_turf(user))
- S.attackby(W,user, params)
- qdel(src)
- else
- ..()
-
-/obj/item/trash/bowl
- name = "bowl"
- desc = "An empty bowl. Put some food in it to start making a soup."
- icon = 'icons/obj/food/food.dmi'
- icon_state = "soup"
-
-/obj/item/trash/bowl/attackby(obj/item/W as obj, mob/user as mob, params)
-
- if(istype(W, /obj/item/weapon/reagent_containers/food/snacks) && !(W.flags & NODROP))
- var/obj/item/weapon/reagent_containers/food/snacks/customizable/soup/S = new(get_turf(user))
- S.attackby(W,user, params)
- qdel(src)
- else
- ..()
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/sandwich
- /obj/item/weapon/reagent_containers/food/snacks/customizable
- name = "sandwich"
- desc = "A sandwich! A timeless classic."
- icon_state = "breadslice"
- baseicon = "sandwich"
- basename = "sandwich"
- toptype = new /obj/item/weapon/reagent_containers/food/snacks/breadslice()
-
-
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable
- name = "sandwich"
- desc = "A sandwich! A timeless classic."
- icon_state = "breadslice"
- var/baseicon = "sandwich"
- var/basename = "sandwich"
- var/top = 1 //Do we have a top?
- var/obj/item/toptype
- var/add_overlays = 1 //Do we stack?
-// var/offsetstuff = 1 //Do we offset the overlays?
- var/sandwich_limit = 40
- var/fullycustom = 0
- trash = /obj/item/trash/plate
- bitesize = 2
- var/list/ingredients = list()
-
- New()
- ..()
-
- reagents.add_reagent("nutriment", 8)
-
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/pizza
- name = "personal pizza"
- desc = "A personalized pan pizza meant for only one person."
- icon_state = "personal_pizza"
- baseicon = "personal_pizza"
- basename = "personal pizza"
- add_overlays = 0
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/pasta
- name = "spagetti"
- desc = "Noodles. With stuff. Delicious."
- icon_state = "pasta_bot"
- baseicon = "pasta_bot"
- basename = "spagetti"
- add_overlays = 0
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/cook/bread
- name = "bread"
- desc = "Tasty bread."
- icon_state = "breadcustom"
- baseicon = "breadcustom"
- basename = "bread"
- add_overlays = 0
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/cook/pie
- name = "pie"
- desc = "Tasty pie."
- icon_state = "piecustom"
- baseicon = "piecustom"
- basename = "pie"
- add_overlays = 0
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/cook/cake
- name = "cake"
- desc = "A popular band."
- icon_state = "cakecustom"
- baseicon = "cakecustom"
- basename = "cake"
- add_overlays = 0
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/cook/jelly
- name = "jelly"
- desc = "Totally jelly."
- icon_state = "jellycustom"
- baseicon = "jellycustom"
- basename = "jelly"
- add_overlays = 0
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/cook/donkpocket
- name = "donk pocket"
- desc = "You wanna put a bangin-Oh nevermind."
- icon_state = "donkcustom"
- baseicon = "donkcustom"
- basename = "donk pocket"
- add_overlays = 0
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/cook/kebab
- name = "kebab"
- desc = "Kebab or Kabab?"
- icon_state = "kababcustom"
- baseicon = "kababcustom"
- basename = "kebab"
- add_overlays = 0
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/cook/salad
- name = "salad"
- desc = "Very tasty."
- icon_state = "saladcustom"
- baseicon = "saladcustom"
- basename = "salad"
- add_overlays = 0
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/cook/waffles
- name = "waffles"
- desc = "Made with love."
- icon_state = "wafflecustom"
- baseicon = "wafflecustom"
- basename = "waffles"
- add_overlays = 0
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/cookie
- name = "cookie"
- desc = "COOKIE!!1!"
- icon_state = "cookiecustom"
- baseicon = "cookiecustom"
- basename = "cookie"
- add_overlays = 0
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/cotton
- name = "flavored cotton candy"
- desc = "Who can take a sunrise, sprinkle it with dew,"
- icon_state = "cottoncandycustom"
- baseicon = "cottoncandycustom"
- basename = "flavored cotton candy"
- add_overlays = 0
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/gummybear
- name = "flavored giant gummy bear"
- desc = "Cover it in chocolate and a miracle or two,"
- icon_state = "gummybearcustom"
- baseicon = "gummybearcustom"
- basename = "flavored giant gummy bear"
- add_overlays = 0
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/gummyworm
- name = "flavored giant gummy worm"
- desc = "The Candy Man can 'cause he mixes it with love,"
- icon_state = "gummywormcustom"
- baseicon = "gummywormcustom"
- basename = "flavored giant gummy worm"
- add_overlays = 0
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/jellybean
- name = "flavored giant jelly bean"
- desc = "And makes the world taste good."
- icon_state = "jellybeancustom"
- baseicon = "jellybeancustom"
- basename = "flavored giant jelly bean"
- add_overlays = 0
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/jawbreaker
- name = "flavored jawbreaker"
- desc = "Who can take a rainbow, Wrap it in a sigh,"
- icon_state = "jawbreakercustom"
- baseicon = "jawbreakercustom"
- basename = "flavored jawbreaker"
- add_overlays = 0
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/candycane
- name = "flavored candy cane"
- desc = "Soak it in the sun and make strawberry-lemon pie,"
- icon_state = "candycanecustom"
- baseicon = "candycanecustom"
- basename = "flavored candy cane"
- add_overlays = 0
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/gum
- name = "flavored gum"
- desc = "The Candy Man can 'cause he mixes it with love and makes the world taste good. And the world tastes good 'cause the Candy Man thinks it should..."
- icon_state = "gumcustom"
- baseicon = "gumcustom"
- basename = "flavored gum"
- add_overlays = 0
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/donut
- name = "filled donut"
- desc = "Donut eat this!" // kill me
- icon_state = "donutcustom"
- baseicon = "donutcustom"
- basename = "filled donut"
- add_overlays = 0
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/bar
- name = "flavored chocolate bar"
- desc = "Made in a factory downtown."
- icon_state = "barcustom"
- baseicon = "barcustom"
- basename = "flavored chocolate bar"
- add_overlays = 0
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/sucker
- name = "flavored sucker"
- desc = "Suck suck suck."
- icon_state = "suckercustom"
- baseicon = "suckercustom"
- basename = "flavored sucker"
- add_overlays = 0
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/cash
- name = "flavored chocolate cash"
- desc = "I got piles!"
- icon_state = "cashcustom"
- baseicon = "cashcustom"
- basename = "flavored cash"
- add_overlays = 0
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/coin
- name = "flavored chocolate coin"
- desc = "Clink, clink, clink."
- icon_state = "coincustom"
- baseicon = "coincustom"
- basename = "flavored coin"
- add_overlays = 0
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/fullycustom // In the event you fuckers find something I forgot to add a customizable food for.
- name = "on a plate"
- desc = "A unique dish."
- icon_state = "fullycustom"
- baseicon = "fullycustom"
- basename = "on a plate"
- add_overlays = 0
- top = 0
- sandwich_limit = 20
- fullycustom = 1
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/soup
- name = "soup"
- desc = "A bowl with liquid and... stuff in it."
- icon_state = "soup"
- baseicon = "soup"
- basename = "soup"
- add_overlays = 0
- trash = /obj/item/trash/bowl
- top = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/burger
- name = "burger bun"
- desc = "A bun for a burger. Delicious."
- icon_state = "burger"
- baseicon = "burger"
- basename = "burger"
- toptype = new /obj/item/weapon/reagent_containers/food/snacks/bun()
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/attackby(obj/item/I, mob/user, params)
- if(src.contents.len > sandwich_limit)
- to_chat(user, "If you put anything else in or on [src] it's going to make a mess.")
- return
- if(!istype(I, /obj/item/weapon/reagent_containers/food/snacks))
- to_chat(user, "\The [I] isn't exactly something that you would want to eat.")
- return
- to_chat(user, "You add [I] to [src].")
- if(istype(I, /obj/item/weapon/reagent_containers/))
- var/obj/item/weapon/reagent_containers/F = I
- F.reagents.trans_to(src, F.reagents.total_volume)
- if(istype(I, /obj/item/weapon/reagent_containers/food/snacks/customizable))
- var/obj/item/weapon/reagent_containers/food/snacks/customizable/origin = I
- ingredients += origin.ingredients
- user.drop_item()
- cooktype[basename] = 1
- I.loc = src
- if(!istype(I, toptype))
- ingredients += I
- updateicon()
- name = newname()
-
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/proc/updateicon()
- overlays = 0
- var/i=0
- for(var/obj/item/O in ingredients)
- i++
- if(!fullycustom)
- var/image/I = new(src.icon, "[baseicon]_filling")
- if(istype(O, /obj/item/weapon/reagent_containers/food/snacks))
- var/obj/item/weapon/reagent_containers/food/snacks/food = O
- if(!food.filling_color == "#FFFFFF")
- I.color = food.filling_color
- else
- I.color = pick("#FF0000","#0000FF","#008000","#FFFF00")
- else
- I.color = pick("#FF0000","#0000FF","#008000","#FFFF00")
- if(add_overlays)
- I.pixel_x = pick(list(-1,0,1))
- I.pixel_y = (i*2)+1
- overlays += I
- else
- var/image/F = new(O.icon, O.icon_state)
- F.pixel_x = pick(list(-1,0,1))
- F.pixel_y = pick(list(-1,0,1))
- overlays += F
- overlays += O.overlays
-
- if(top)
- var/image/T = new(src.icon, "[baseicon]_top")
- T.pixel_x = pick(list(-1,0,1))
- T.pixel_y = (ingredients.len * 2)+1
- overlays += T
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/Destroy()
- for(var/obj/item/O in ingredients)
- qdel(O)
- return ..()
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/examine(mob/user)
- ..(user)
- var/whatsinside = pick(ingredients)
-
- to_chat(user, " You think you can see [whatsinside] in there.")
-
-/*
-/obj/item/weapon/reagent_containers/food/snacks/customizable/attack(mob/M as mob, mob/user as mob, def_zone) //SNOOOOOOOWFLAAAAAAAAAAAAAAAAAKES
-
- var/obj/item/shard
- for(var/obj/item/O in contents)
- if(istype(O,/obj/item/weapon/shard))
- shard = O
- break
-
- var/mob/living/H
- if(istype(M,/mob/living))
- H = M
-
- if(H && shard && M == user) //This needs a check for feeding the food to other people, but that could be abusable.
- to_chat(H, "\red You lacerate your mouth on a [shard.name] in the sandwich!")
- H.adjustBruteLoss(5) //TODO: Target head if human.
- ..()
-*/
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/proc/newname()
- var/unsorteditems[0]
- var/sorteditems[0]
- var/unsortedtypes[0]
- var/sortedtypes[0]
- var/endpart = ""
- var/c = 0
- var/ci = 0
- var/ct = 0
- var/seperator = ""
- var/sendback = ""
- var/list/levels = list("", "double", "triple", "quad", "huge")
-
- for(var/obj/item/ing in ingredients)
- if(istype(ing, /obj/item/weapon/shard))
- continue
-
-
- if (istype(ing, /obj/item/weapon/reagent_containers/food/snacks/customizable)) // split the ingredients into ones with basenames (sandwich, burger, etc) and ones without, keeping track of how many of each there are
- var/obj/item/weapon/reagent_containers/food/snacks/customizable/gettype = ing
- if (unsortedtypes[gettype.basename])
- unsortedtypes[gettype.basename]++
- if (unsortedtypes[gettype.basename] > ct)
- ct = unsortedtypes[gettype.basename]
- else
- (unsortedtypes[gettype.basename]) = 1
- if (unsortedtypes[gettype.basename] > ct)
- ct = unsortedtypes[gettype.basename]
- else
- if(unsorteditems[ing.name])
- unsorteditems[ing.name]++
- if (unsorteditems[ing.name] > ci)
- ci = unsorteditems[ing.name]
- else
- unsorteditems[ing.name] = 1
- if (unsorteditems[ing.name] > ci)
- ci = unsorteditems[ing.name]
-
- sorteditems = sortlist(unsorteditems, ci) //order both types going from the lowest number to the highest number
- sortedtypes = sortlist(unsortedtypes, ct)
-
- for(var/ings in sorteditems) //add the non-basename items to the name, sorting out the , and the and
- c++
- if (c == sorteditems.len - 1)
- seperator = " and "
- else if (c == sorteditems.len)
- seperator = " "
- else
- seperator = ", "
-
- if (sorteditems[ings] > levels.len)
- sorteditems[ings] = levels.len
-
- if (sorteditems[ings] <= 1)
- sendback +="[ings][seperator]"
- else
- sendback +="[levels[sorteditems[ings]]] [ings][seperator]"
-
- for (var/ingtype in sortedtypes) // now add the types basenames, keeping the src one seperate so it can go on the end
- if (sortedtypes[ingtype] > levels.len)
- sortedtypes[ingtype] = levels.len
- if (ingtype == basename)
- if (sortedtypes[ingtype] < levels.len)
- sortedtypes[ingtype]++
- endpart = "[levels[sortedtypes[ingtype]]] decker [basename]"
- continue
- if (sortedtypes[ingtype] >= 2)
- sendback += "[levels[sortedtypes[ingtype]]] decker [ingtype] "
- else
- sendback += "[ingtype] "
-
- if(endpart)
- sendback += endpart
- else
- sendback += basename
-
- if(length(sendback) > 80)
- sendback = "[pick(list("absurd","colossal","enormous","ridiculous","massive","oversized","cardiac-arresting","pipe-clogging","edible but sickening","sickening","gargantuan","mega","belly-burster","chest-burster"))] [basename]"
- return sendback
-
-/obj/item/weapon/reagent_containers/food/snacks/customizable/proc/sortlist(var/list/unsorted, var/highest)
- var/sorted[0]
- for(var/i = 1, i<= highest, i++)
- for(var/it in unsorted)
- if (unsorted[it] == i)
- sorted[it] = i
- return sorted
-
+/obj/item/weapon/reagent_containers/food/snacks/breadslice/attackby(obj/item/W as obj, mob/user as mob, params)
+ if(istype(W, /obj/item/weapon/reagent_containers/food/snacks) && !(W.flags & NODROP))
+ var/obj/item/weapon/reagent_containers/food/snacks/customizable/sandwich/S = new(get_turf(user))
+ S.attackby(W,user, params)
+ qdel(src)
+ else
+ ..()
+
+/obj/item/weapon/reagent_containers/food/snacks/bun/attackby(obj/item/W as obj, mob/user as mob, params)
+ if(istype(W, /obj/item/weapon/reagent_containers/food/snacks) && !(W.flags & NODROP))
+ var/obj/item/weapon/reagent_containers/food/snacks/customizable/burger/S = new(get_turf(user))
+ S.attackby(W,user, params)
+ qdel(src)
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough/attackby(obj/item/W as obj, mob/user as mob, params)
+ if(istype(W, /obj/item/weapon/reagent_containers/food/snacks) && !(W.flags & NODROP))
+ var/obj/item/weapon/reagent_containers/food/snacks/customizable/pizza/S = new(get_turf(user))
+ S.attackby(W,user, params)
+ qdel(src)
+ else
+ ..()
+
+
+/obj/item/weapon/reagent_containers/food/snacks/boiledspagetti/attackby(obj/item/W as obj, mob/user as mob, params)
+ if(istype(W, /obj/item/weapon/reagent_containers/food/snacks) && !(W.flags & NODROP))
+ var/obj/item/weapon/reagent_containers/food/snacks/customizable/pasta/S = new(get_turf(user))
+ S.attackby(W,user, params)
+ qdel(src)
+ else
+ ..()
+
+
+/obj/item/trash/plate/attackby(obj/item/W as obj, mob/user as mob, params)
+ if(istype(W, /obj/item/weapon/reagent_containers/food/snacks) && !(W.flags & NODROP))
+ var/obj/item/weapon/reagent_containers/food/snacks/customizable/fullycustom/S = new(get_turf(user))
+ S.attackby(W,user, params)
+ qdel(src)
+ else
+ ..()
+
+/obj/item/trash/bowl
+ name = "bowl"
+ desc = "An empty bowl. Put some food in it to start making a soup."
+ icon = 'icons/obj/food/food.dmi'
+ icon_state = "soup"
+
+/obj/item/trash/bowl/attackby(obj/item/W as obj, mob/user as mob, params)
+
+ if(istype(W, /obj/item/weapon/reagent_containers/food/snacks) && !(W.flags & NODROP))
+ var/obj/item/weapon/reagent_containers/food/snacks/customizable/soup/S = new(get_turf(user))
+ S.attackby(W,user, params)
+ qdel(src)
+ else
+ ..()
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/sandwich
+ /obj/item/weapon/reagent_containers/food/snacks/customizable
+ name = "sandwich"
+ desc = "A sandwich! A timeless classic."
+ icon_state = "breadslice"
+ baseicon = "sandwich"
+ basename = "sandwich"
+ toptype = new /obj/item/weapon/reagent_containers/food/snacks/breadslice()
+
+
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable
+ name = "sandwich"
+ desc = "A sandwich! A timeless classic."
+ icon_state = "breadslice"
+ var/baseicon = "sandwich"
+ var/basename = "sandwich"
+ var/top = 1 //Do we have a top?
+ var/obj/item/toptype
+ var/add_overlays = 1 //Do we stack?
+// var/offsetstuff = 1 //Do we offset the overlays?
+ var/sandwich_limit = 40
+ var/fullycustom = 0
+ trash = /obj/item/trash/plate
+ bitesize = 2
+ var/list/ingredients = list()
+
+ New()
+ ..()
+
+ reagents.add_reagent("nutriment", 8)
+
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/pizza
+ name = "personal pizza"
+ desc = "A personalized pan pizza meant for only one person."
+ icon_state = "personal_pizza"
+ baseicon = "personal_pizza"
+ basename = "personal pizza"
+ add_overlays = 0
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/pasta
+ name = "spagetti"
+ desc = "Noodles. With stuff. Delicious."
+ icon_state = "pasta_bot"
+ baseicon = "pasta_bot"
+ basename = "spagetti"
+ add_overlays = 0
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/cook/bread
+ name = "bread"
+ desc = "Tasty bread."
+ icon_state = "breadcustom"
+ baseicon = "breadcustom"
+ basename = "bread"
+ add_overlays = 0
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/cook/pie
+ name = "pie"
+ desc = "Tasty pie."
+ icon_state = "piecustom"
+ baseicon = "piecustom"
+ basename = "pie"
+ add_overlays = 0
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/cook/cake
+ name = "cake"
+ desc = "A popular band."
+ icon_state = "cakecustom"
+ baseicon = "cakecustom"
+ basename = "cake"
+ add_overlays = 0
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/cook/jelly
+ name = "jelly"
+ desc = "Totally jelly."
+ icon_state = "jellycustom"
+ baseicon = "jellycustom"
+ basename = "jelly"
+ add_overlays = 0
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/cook/donkpocket
+ name = "donk pocket"
+ desc = "You wanna put a bangin-Oh nevermind."
+ icon_state = "donkcustom"
+ baseicon = "donkcustom"
+ basename = "donk pocket"
+ add_overlays = 0
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/cook/kebab
+ name = "kebab"
+ desc = "Kebab or Kabab?"
+ icon_state = "kababcustom"
+ baseicon = "kababcustom"
+ basename = "kebab"
+ add_overlays = 0
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/cook/salad
+ name = "salad"
+ desc = "Very tasty."
+ icon_state = "saladcustom"
+ baseicon = "saladcustom"
+ basename = "salad"
+ add_overlays = 0
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/cook/waffles
+ name = "waffles"
+ desc = "Made with love."
+ icon_state = "wafflecustom"
+ baseicon = "wafflecustom"
+ basename = "waffles"
+ add_overlays = 0
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/cookie
+ name = "cookie"
+ desc = "COOKIE!!1!"
+ icon_state = "cookiecustom"
+ baseicon = "cookiecustom"
+ basename = "cookie"
+ add_overlays = 0
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/cotton
+ name = "flavored cotton candy"
+ desc = "Who can take a sunrise, sprinkle it with dew,"
+ icon_state = "cottoncandycustom"
+ baseicon = "cottoncandycustom"
+ basename = "flavored cotton candy"
+ add_overlays = 0
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/gummybear
+ name = "flavored giant gummy bear"
+ desc = "Cover it in chocolate and a miracle or two,"
+ icon_state = "gummybearcustom"
+ baseicon = "gummybearcustom"
+ basename = "flavored giant gummy bear"
+ add_overlays = 0
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/gummyworm
+ name = "flavored giant gummy worm"
+ desc = "The Candy Man can 'cause he mixes it with love,"
+ icon_state = "gummywormcustom"
+ baseicon = "gummywormcustom"
+ basename = "flavored giant gummy worm"
+ add_overlays = 0
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/jellybean
+ name = "flavored giant jelly bean"
+ desc = "And makes the world taste good."
+ icon_state = "jellybeancustom"
+ baseicon = "jellybeancustom"
+ basename = "flavored giant jelly bean"
+ add_overlays = 0
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/jawbreaker
+ name = "flavored jawbreaker"
+ desc = "Who can take a rainbow, Wrap it in a sigh,"
+ icon_state = "jawbreakercustom"
+ baseicon = "jawbreakercustom"
+ basename = "flavored jawbreaker"
+ add_overlays = 0
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/candycane
+ name = "flavored candy cane"
+ desc = "Soak it in the sun and make strawberry-lemon pie,"
+ icon_state = "candycanecustom"
+ baseicon = "candycanecustom"
+ basename = "flavored candy cane"
+ add_overlays = 0
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/gum
+ name = "flavored gum"
+ desc = "The Candy Man can 'cause he mixes it with love and makes the world taste good. And the world tastes good 'cause the Candy Man thinks it should..."
+ icon_state = "gumcustom"
+ baseicon = "gumcustom"
+ basename = "flavored gum"
+ add_overlays = 0
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/donut
+ name = "filled donut"
+ desc = "Donut eat this!" // kill me
+ icon_state = "donutcustom"
+ baseicon = "donutcustom"
+ basename = "filled donut"
+ add_overlays = 0
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/bar
+ name = "flavored chocolate bar"
+ desc = "Made in a factory downtown."
+ icon_state = "barcustom"
+ baseicon = "barcustom"
+ basename = "flavored chocolate bar"
+ add_overlays = 0
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/sucker
+ name = "flavored sucker"
+ desc = "Suck suck suck."
+ icon_state = "suckercustom"
+ baseicon = "suckercustom"
+ basename = "flavored sucker"
+ add_overlays = 0
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/cash
+ name = "flavored chocolate cash"
+ desc = "I got piles!"
+ icon_state = "cashcustom"
+ baseicon = "cashcustom"
+ basename = "flavored cash"
+ add_overlays = 0
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/coin
+ name = "flavored chocolate coin"
+ desc = "Clink, clink, clink."
+ icon_state = "coincustom"
+ baseicon = "coincustom"
+ basename = "flavored coin"
+ add_overlays = 0
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/fullycustom // In the event you fuckers find something I forgot to add a customizable food for.
+ name = "on a plate"
+ desc = "A unique dish."
+ icon_state = "fullycustom"
+ baseicon = "fullycustom"
+ basename = "on a plate"
+ add_overlays = 0
+ top = 0
+ sandwich_limit = 20
+ fullycustom = 1
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/soup
+ name = "soup"
+ desc = "A bowl with liquid and... stuff in it."
+ icon_state = "soup"
+ baseicon = "soup"
+ basename = "soup"
+ add_overlays = 0
+ trash = /obj/item/trash/bowl
+ top = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/burger
+ name = "burger bun"
+ desc = "A bun for a burger. Delicious."
+ icon_state = "burger"
+ baseicon = "burger"
+ basename = "burger"
+ toptype = new /obj/item/weapon/reagent_containers/food/snacks/bun()
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/attackby(obj/item/I, mob/user, params)
+ if(src.contents.len > sandwich_limit)
+ to_chat(user, "If you put anything else in or on [src] it's going to make a mess.")
+ return
+ if(!istype(I, /obj/item/weapon/reagent_containers/food/snacks))
+ to_chat(user, "\The [I] isn't exactly something that you would want to eat.")
+ return
+ to_chat(user, "You add [I] to [src].")
+ if(istype(I, /obj/item/weapon/reagent_containers/))
+ var/obj/item/weapon/reagent_containers/F = I
+ F.reagents.trans_to(src, F.reagents.total_volume)
+ if(istype(I, /obj/item/weapon/reagent_containers/food/snacks/customizable))
+ var/obj/item/weapon/reagent_containers/food/snacks/customizable/origin = I
+ ingredients += origin.ingredients
+ user.drop_item()
+ cooktype[basename] = 1
+ I.loc = src
+ if(!istype(I, toptype))
+ ingredients += I
+ updateicon()
+ name = newname()
+
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/proc/updateicon()
+ overlays = 0
+ var/i=0
+ for(var/obj/item/O in ingredients)
+ i++
+ if(!fullycustom)
+ var/image/I = new(src.icon, "[baseicon]_filling")
+ if(istype(O, /obj/item/weapon/reagent_containers/food/snacks))
+ var/obj/item/weapon/reagent_containers/food/snacks/food = O
+ if(!food.filling_color == "#FFFFFF")
+ I.color = food.filling_color
+ else
+ I.color = pick("#FF0000","#0000FF","#008000","#FFFF00")
+ else
+ I.color = pick("#FF0000","#0000FF","#008000","#FFFF00")
+ if(add_overlays)
+ I.pixel_x = pick(list(-1,0,1))
+ I.pixel_y = (i*2)+1
+ overlays += I
+ else
+ var/image/F = new(O.icon, O.icon_state)
+ F.pixel_x = pick(list(-1,0,1))
+ F.pixel_y = pick(list(-1,0,1))
+ overlays += F
+ overlays += O.overlays
+
+ if(top)
+ var/image/T = new(src.icon, "[baseicon]_top")
+ T.pixel_x = pick(list(-1,0,1))
+ T.pixel_y = (ingredients.len * 2)+1
+ overlays += T
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/Destroy()
+ for(var/obj/item/O in ingredients)
+ qdel(O)
+ return ..()
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/examine(mob/user)
+ ..(user)
+ var/whatsinside = pick(ingredients)
+
+ to_chat(user, " You think you can see [whatsinside] in there.")
+
+/*
+/obj/item/weapon/reagent_containers/food/snacks/customizable/attack(mob/M as mob, mob/user as mob, def_zone) //SNOOOOOOOWFLAAAAAAAAAAAAAAAAAKES
+
+ var/obj/item/shard
+ for(var/obj/item/O in contents)
+ if(istype(O,/obj/item/weapon/shard))
+ shard = O
+ break
+
+ var/mob/living/H
+ if(istype(M,/mob/living))
+ H = M
+
+ if(H && shard && M == user) //This needs a check for feeding the food to other people, but that could be abusable.
+ to_chat(H, "\red You lacerate your mouth on a [shard.name] in the sandwich!")
+ H.adjustBruteLoss(5) //TODO: Target head if human.
+ ..()
+*/
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/proc/newname()
+ var/unsorteditems[0]
+ var/sorteditems[0]
+ var/unsortedtypes[0]
+ var/sortedtypes[0]
+ var/endpart = ""
+ var/c = 0
+ var/ci = 0
+ var/ct = 0
+ var/seperator = ""
+ var/sendback = ""
+ var/list/levels = list("", "double", "triple", "quad", "huge")
+
+ for(var/obj/item/ing in ingredients)
+ if(istype(ing, /obj/item/weapon/shard))
+ continue
+
+
+ if(istype(ing, /obj/item/weapon/reagent_containers/food/snacks/customizable)) // split the ingredients into ones with basenames (sandwich, burger, etc) and ones without, keeping track of how many of each there are
+ var/obj/item/weapon/reagent_containers/food/snacks/customizable/gettype = ing
+ if(unsortedtypes[gettype.basename])
+ unsortedtypes[gettype.basename]++
+ if(unsortedtypes[gettype.basename] > ct)
+ ct = unsortedtypes[gettype.basename]
+ else
+ (unsortedtypes[gettype.basename]) = 1
+ if(unsortedtypes[gettype.basename] > ct)
+ ct = unsortedtypes[gettype.basename]
+ else
+ if(unsorteditems[ing.name])
+ unsorteditems[ing.name]++
+ if(unsorteditems[ing.name] > ci)
+ ci = unsorteditems[ing.name]
+ else
+ unsorteditems[ing.name] = 1
+ if(unsorteditems[ing.name] > ci)
+ ci = unsorteditems[ing.name]
+
+ sorteditems = sortlist(unsorteditems, ci) //order both types going from the lowest number to the highest number
+ sortedtypes = sortlist(unsortedtypes, ct)
+
+ for(var/ings in sorteditems) //add the non-basename items to the name, sorting out the , and the and
+ c++
+ if(c == sorteditems.len - 1)
+ seperator = " and "
+ else if(c == sorteditems.len)
+ seperator = " "
+ else
+ seperator = ", "
+
+ if(sorteditems[ings] > levels.len)
+ sorteditems[ings] = levels.len
+
+ if(sorteditems[ings] <= 1)
+ sendback +="[ings][seperator]"
+ else
+ sendback +="[levels[sorteditems[ings]]] [ings][seperator]"
+
+ for(var/ingtype in sortedtypes) // now add the types basenames, keeping the src one seperate so it can go on the end
+ if(sortedtypes[ingtype] > levels.len)
+ sortedtypes[ingtype] = levels.len
+ if(ingtype == basename)
+ if(sortedtypes[ingtype] < levels.len)
+ sortedtypes[ingtype]++
+ endpart = "[levels[sortedtypes[ingtype]]] decker [basename]"
+ continue
+ if(sortedtypes[ingtype] >= 2)
+ sendback += "[levels[sortedtypes[ingtype]]] decker [ingtype] "
+ else
+ sendback += "[ingtype] "
+
+ if(endpart)
+ sendback += endpart
+ else
+ sendback += basename
+
+ if(length(sendback) > 80)
+ sendback = "[pick(list("absurd","colossal","enormous","ridiculous","massive","oversized","cardiac-arresting","pipe-clogging","edible but sickening","sickening","gargantuan","mega","belly-burster","chest-burster"))] [basename]"
+ return sendback
+
+/obj/item/weapon/reagent_containers/food/snacks/customizable/proc/sortlist(var/list/unsorted, var/highest)
+ var/sorted[0]
+ for(var/i = 1, i<= highest, i++)
+ for(var/it in unsorted)
+ if(unsorted[it] == i)
+ sorted[it] = i
+ return sorted
+
diff --git a/code/modules/reagents/reagent_containers/food/snacks/meat.dm b/code/modules/food_and_drinks/food/meat.dm
similarity index 94%
rename from code/modules/reagents/reagent_containers/food/snacks/meat.dm
rename to code/modules/food_and_drinks/food/meat.dm
index dc9999a7f4c..76de76530ea 100644
--- a/code/modules/reagents/reagent_containers/food/snacks/meat.dm
+++ b/code/modules/food_and_drinks/food/meat.dm
@@ -1,54 +1,54 @@
-/obj/item/weapon/reagent_containers/food/snacks/meat
- name = "meat"
- desc = "A slab of meat"
- icon_state = "meat"
- health = 180
- filling_color = "#FF1C1C"
- New()
- ..()
- reagents.add_reagent("protein", 3)
- src.bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/meat/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
- if( \
- istype(W, /obj/item/weapon/kitchen/knife) || \
- istype(W, /obj/item/weapon/scalpel) \
- )
- new /obj/item/weapon/reagent_containers/food/snacks/rawcutlet(src)
- new /obj/item/weapon/reagent_containers/food/snacks/rawcutlet(src)
- new /obj/item/weapon/reagent_containers/food/snacks/rawcutlet(src)
- to_chat(user, "You cut the meat in thin strips.")
- qdel(src)
- else
- ..()
-
-/obj/item/weapon/reagent_containers/food/snacks/meat/syntiflesh
- name = "synthetic meat"
- desc = "A synthetic slab of flesh."
-
-/obj/item/weapon/reagent_containers/food/snacks/meat/human
- name = "-meat"
- var/subjectname = ""
- var/subjectjob = null
-
-/obj/item/weapon/reagent_containers/food/snacks/meat/slab/meatproduct
- name = "meat product"
- desc = "A slab of station reclaimed and chemically processed meat product."
-
-/obj/item/weapon/reagent_containers/food/snacks/meat/monkey
- //same as plain meat
-
-/obj/item/weapon/reagent_containers/food/snacks/meat/corgi
- name = "Corgi meat"
- desc = "Tastes like... well you know..."
-
-/obj/item/weapon/reagent_containers/food/snacks/meat/pug
- name = "Pug meat"
- desc = "Tastes like... well you know..."
-
-/obj/item/weapon/reagent_containers/food/snacks/meat/ham
- name = "Ham"
- desc = "Taste like bacon."
- New()
- ..()
- reagents.add_reagent("porktonium", 10)
\ No newline at end of file
+/obj/item/weapon/reagent_containers/food/snacks/meat
+ name = "meat"
+ desc = "A slab of meat"
+ icon_state = "meat"
+ health = 180
+ filling_color = "#FF1C1C"
+ New()
+ ..()
+ reagents.add_reagent("protein", 3)
+ src.bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/meat/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
+ if( \
+ istype(W, /obj/item/weapon/kitchen/knife) || \
+ istype(W, /obj/item/weapon/scalpel) \
+ )
+ new /obj/item/weapon/reagent_containers/food/snacks/rawcutlet(src)
+ new /obj/item/weapon/reagent_containers/food/snacks/rawcutlet(src)
+ new /obj/item/weapon/reagent_containers/food/snacks/rawcutlet(src)
+ to_chat(user, "You cut the meat in thin strips.")
+ qdel(src)
+ else
+ ..()
+
+/obj/item/weapon/reagent_containers/food/snacks/meat/syntiflesh
+ name = "synthetic meat"
+ desc = "A synthetic slab of flesh."
+
+/obj/item/weapon/reagent_containers/food/snacks/meat/human
+ name = "-meat"
+ var/subjectname = ""
+ var/subjectjob = null
+
+/obj/item/weapon/reagent_containers/food/snacks/meat/slab/meatproduct
+ name = "meat product"
+ desc = "A slab of station reclaimed and chemically processed meat product."
+
+/obj/item/weapon/reagent_containers/food/snacks/meat/monkey
+ //same as plain meat
+
+/obj/item/weapon/reagent_containers/food/snacks/meat/corgi
+ name = "Corgi meat"
+ desc = "Tastes like... well you know..."
+
+/obj/item/weapon/reagent_containers/food/snacks/meat/pug
+ name = "Pug meat"
+ desc = "Tastes like... well you know..."
+
+/obj/item/weapon/reagent_containers/food/snacks/meat/ham
+ name = "Ham"
+ desc = "Taste like bacon."
+ New()
+ ..()
+ reagents.add_reagent("porktonium", 10)
diff --git a/code/modules/reagents/reagent_containers/food/snacks/seafood.dm b/code/modules/food_and_drinks/food/seafood.dm
similarity index 100%
rename from code/modules/reagents/reagent_containers/food/snacks/seafood.dm
rename to code/modules/food_and_drinks/food/seafood.dm
diff --git a/code/modules/reagents/reagent_containers/food/snacks.dm b/code/modules/food_and_drinks/food/snacks.dm
similarity index 96%
rename from code/modules/reagents/reagent_containers/food/snacks.dm
rename to code/modules/food_and_drinks/food/snacks.dm
index 8538db0b13d..a012afa74f9 100644
--- a/code/modules/reagents/reagent_containers/food/snacks.dm
+++ b/code/modules/food_and_drinks/food/snacks.dm
@@ -1,3364 +1,3404 @@
-//Food items that are eaten normally and don't leave anything behind.
-/obj/item/weapon/reagent_containers/food/snacks
- name = "snack"
- desc = "yummy"
- icon = 'icons/obj/food/food.dmi'
- icon_state = null
- bitesize = 1
- var/bitecount = 0
- var/trash = null
- var/slice_path
- var/slices_num
- var/eatverb
- var/wrapped = 0
- var/dried_type = null
- var/cooktype[0]
-
-
- //Placeholder for effect that trigger on eating that aren't tied to reagents.
-/obj/item/weapon/reagent_containers/food/snacks/proc/On_Consume(mob/M, mob/user)
- if(!user)
- return
- spawn(0)
- if(!reagents.total_volume)
- if(M == user)
- to_chat(user, "You finish eating \the [src].")
- user.visible_message("[user] finishes eating \the [src].")
- user.unEquip(src) //so icons update :[
- Post_Consume(M)
- if(trash)
- if(ispath(trash,/obj/item))
- var/obj/item/TrashItem = new trash(user)
- user.put_in_hands(TrashItem)
- else if(istype(trash,/obj/item))
- user.put_in_hands(trash)
- qdel(src)
- return
-
-/obj/item/weapon/reagent_containers/food/snacks/proc/Post_Consume(mob/living/M)
- return
-
-/obj/item/weapon/reagent_containers/food/snacks/attack_self(mob/user as mob)
- return
-
-/obj/item/weapon/reagent_containers/food/snacks/attack(mob/M as mob, mob/user as mob, def_zone)
- if(reagents && !reagents.total_volume) //Shouldn't be needed but it checks to see if it has anything left in it.
- to_chat(user, "None of [src] left, oh no!")
- M.unEquip(src) //so icons update :[
- qdel(src)
- return 0
-
- if(istype(M, /mob/living/carbon))
- var/mob/living/carbon/C = M
- if(C.eat(src, user))
- bitecount++
- On_Consume(C, user)
- return 1
- return 0
-
-/obj/item/weapon/reagent_containers/food/snacks/afterattack(obj/target, mob/user, proximity)
- return
-
-/obj/item/weapon/reagent_containers/food/snacks/examine(mob/user)
- if(..(user, 0))
- if (bitecount==0)
- return
- else if (bitecount==1)
- to_chat(user, "\blue \The [src] was bitten by someone!")
- else if (bitecount<=3)
- to_chat(user, "\blue \The [src] was bitten [bitecount] times!")
- else
- to_chat(user, "\blue \The [src] was bitten multiple times!")
-
-
-/obj/item/weapon/reagent_containers/food/snacks/attackby(obj/item/weapon/W, mob/user, params)
- if(istype(W,/obj/item/weapon/pen))
- var/n_name = sanitize(copytext(input(usr, "What would you like to name this dish?", "Food Renaming", null) as text, 1, MAX_NAME_LEN))
- if((loc == usr && usr.stat == 0))
- name = "[n_name]"
- return
- if(istype(W,/obj/item/weapon/storage))
- ..() // -> item/attackby(, params)
-
- if(istype(W,/obj/item/weapon/kitchen/utensil))
-
- var/obj/item/weapon/kitchen/utensil/U = W
-
- if(U.contents.len >= U.max_contents)
- to_chat(user, "You cannot fit anything else on your [U].")
- return
-
- user.visible_message( \
- "[user] scoops up some [src] with \the [U]!", \
- "You scoop up some [src] with \the [U]!" \
- )
-
- src.bitecount++
- U.overlays.Cut()
- var/image/I = new(U.icon, "loadedfood")
- I.color = src.filling_color
- U.overlays += I
-
- var/obj/item/weapon/reagent_containers/food/snacks/collected = new type
- collected.loc = U
- collected.reagents.remove_any(collected.reagents.total_volume)
- collected.trash = null
- if(reagents.total_volume > bitesize)
- reagents.trans_to(collected, bitesize)
- else
- reagents.trans_to(collected, reagents.total_volume)
- if(trash)
- var/obj/item/TrashItem
- if(ispath(trash,/obj/item))
- TrashItem = new trash(src)
- else if(istype(trash,/obj/item))
- TrashItem = trash
- TrashItem.forceMove(loc)
- qdel(src)
- return 1
-
- if((slices_num <= 0 || !slices_num) || !slice_path)
- return 0
-
- var/inaccurate = 0
- if( \
- istype(W, /obj/item/weapon/kitchen/knife) || \
- istype(W, /obj/item/weapon/scalpel) \
- )
- else if( \
- istype(W, /obj/item/weapon/circular_saw) || \
- istype(W, /obj/item/weapon/melee/energy/sword/saber) && W:active || \
- istype(W, /obj/item/weapon/melee/energy/blade) || \
- istype(W, /obj/item/weapon/shovel) || \
- istype(W, /obj/item/weapon/hatchet) \
- )
- inaccurate = 1
- else if(W.w_class <= 2 && istype(src,/obj/item/weapon/reagent_containers/food/snacks/sliceable))
- if(!iscarbon(user))
- return 1
- to_chat(user, "\red You slip [W] inside [src].")
- user.unEquip(W)
- if ((user.client && user.s_active != src))
- user.client.screen -= W
- W.dropped(user)
- add_fingerprint(user)
- contents += W
- return
- else
- return 1
- if ( \
- !isturf(src.loc) || \
- !(locate(/obj/structure/table) in src.loc) && \
- !(locate(/obj/machinery/optable) in src.loc) && \
- !(locate(/obj/item/weapon/storage/bag/tray) in src.loc) \
- )
- to_chat(user, "\red You cannot slice [src] here! You need a table or at least a tray to do it.")
- return 1
- var/slices_lost = 0
- if (!inaccurate)
- user.visible_message( \
- "\blue [user] slices \the [src]!", \
- "\blue You slice \the [src]!" \
- )
- else
- user.visible_message( \
- "\blue [user] crudely slices \the [src] with [W]!", \
- "\blue You crudely slice \the [src] with your [W]!" \
- )
- slices_lost = rand(1,min(1,round(slices_num/2)))
- var/reagents_per_slice = reagents.total_volume/slices_num
- for(var/i=1 to (slices_num-slices_lost))
- var/obj/slice = new slice_path (src.loc)
- reagents.trans_to(slice,reagents_per_slice)
- qdel(src)
-
- return
-
-/obj/item/weapon/reagent_containers/food/snacks/Destroy()
- if(contents)
- for(var/atom/movable/something in contents)
- something.loc = get_turf(src)
- return ..()
-
-/obj/item/weapon/reagent_containers/food/snacks/attack_animal(mob/M)
- if(isanimal(M))
- M.changeNext_move(CLICK_CD_MELEE)
- if(iscorgi(M))
- if(bitecount >= 4)
- M.visible_message("[M] [pick("burps from enjoyment", "yaps for more", "woofs twice", "looks at the area where \the [src] was")].","You swallow up the last part of \the [src].")
- playsound(src.loc,'sound/items/eatfood.ogg', rand(10,50), 1)
- var/mob/living/simple_animal/pet/corgi/C = M
- C.adjustBruteLoss(-5)
- C.adjustFireLoss(-5)
- qdel(src)
- else
- M.visible_message("[M] takes a bite of \the [src].","You take a bite of \the [src].")
- playsound(src.loc,'sound/items/eatfood.ogg', rand(10,50), 1)
- bitecount++
- else if(ismouse(M))
- var/mob/living/simple_animal/mouse/N = M
- to_chat(N, text("\blue You nibble away at [src]."))
- if(prob(50))
- N.visible_message("[N] nibbles away at [src].", "")
- //N.emote("nibbles away at the [src]")
- N.adjustBruteLoss(-1)
- N.adjustFireLoss(-1)
-
-
-////////////////////////////////////////////////////////////////////////////////
-/// FOOD END
-////////////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
-
-
-
-
-
-//////////////////////////////////////////////////
-////////////////////////////////////////////Snacks
-//////////////////////////////////////////////////
-//Items in the "Snacks" subcategory are food items that people actually eat. The key points are that they are created
-// already filled with reagents and are destroyed when empty. Additionally, they make a "munching" noise when eaten.
-
-//Notes by Darem: Food in the "snacks" subtype can hold a maximum of 50 units Generally speaking, you don't want to go over 40
-// total for the item because you want to leave space for extra condiments. If you want effect besides healing, add a reagent for
-// it. Try to stick to existing reagents when possible (so if you want a stronger healing effect, just use Tricordrazine). On use
-// effect (such as the old officer eating a donut code) requires a unique reagent (unless you can figure out a better way).
-
-//The nutriment reagent and bitesize variable replace the old heal_amt and amount variables. Each unit of nutriment is equal to
-// 2 of the old heal_amt variable. Bitesize is the rate at which the reagents are consumed. So if you have 6 nutriment and a
-// bitesize of 2, then it'll take 3 bites to eat. Unlike the old system, the contained reagents are evenly spread among all
-// the bites. No more contained reagents = no more bites.
-
-//Here is an example of the new formatting for anyone who wants to add more food items.
-///obj/item/weapon/reagent_containers/food/snacks/xenoburger //Identification path for the object.
-// name = "Xenoburger" //Name that displays in the UI.
-// desc = "Smells caustic. Tastes like heresy." //Duh
-// icon_state = "xburger" //Refers to an icon in food/food.dmi
-// New() //Don't mess with this.
-// ..() //Same here.
-// reagents.add_reagent("xenomicrobes", 10) //This is what is in the food item. you may copy/paste
-// reagents.add_reagent("nutriment", 2) // this line of code for all the contents.
-// bitesize = 3 //This is the amount each bite consumes.
-
-
-
-
-/obj/item/weapon/reagent_containers/food/snacks/aesirsalad
- name = "Aesir salad"
- desc = "Probably too incredible for mortal men to fully enjoy."
- icon_state = "aesirsalad"
- trash = /obj/item/trash/snack_bowl
- filling_color = "#468C00"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 8)
- reagents.add_reagent("omnizine", 8)
- bitesize = 3
-
-/*
-/obj/item/weapon/reagent_containers/food/snacks/candy
- name = "candy"
- desc = "Nougat, love it or hate it."
- icon_state = "candy"
- trash = /obj/item/trash/candy
- filling_color = "#7D5F46"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 1)
- reagents.add_reagent("sugar", 3)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/candy/donor
- name = "Donor Candy"
- desc = "A little treat for blood donors."
- trash = /obj/item/trash/candy
- New()
- ..()
- reagents.add_reagent("nutriment", 10)
- reagents.add_reagent("sugar", 3)
- bitesize = 5
-
-/obj/item/weapon/reagent_containers/food/snacks/candy_corn
- name = "candy corn"
- desc = "It's a handful of candy corn. Cannot be stored in a detective's hat, alas."
- icon_state = "candy_corn"
- filling_color = "#FFFCB0"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 4)
- reagents.add_reagent("sugar", 2)
- bitesize = 2
-*/
-
-/obj/item/weapon/reagent_containers/food/snacks/chips
- name = "chips"
- desc = "Commander Riker's What-The-Crisps"
- icon_state = "chips"
- trash = /obj/item/trash/chips
- filling_color = "#E8C31E"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
- reagents.add_reagent("sodiumchloride", 1)
- bitesize = 1
-
-/obj/item/weapon/reagent_containers/food/snacks/cornchips
- name = "corn chips"
- desc = "Goes great with salsa! OLE!"
- icon_state = "chips"
- trash = /obj/item/trash/chips
- filling_color = "#E8C31E"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
- bitesize = 1
-
-/obj/item/weapon/reagent_containers/food/snacks/cookie
- name = "cookie"
- desc = "COOKIE!!!"
- icon_state = "COOKIE!!!"
- filling_color = "#DBC94F"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 5)
- bitesize = 1
-
-/obj/item/weapon/reagent_containers/food/snacks/chocolatebar
- name = "Chocolate Bar"
- desc = "Such sweet, fattening food."
- icon_state = "chocolatebar"
- filling_color = "#7D5F46"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 2)
- reagents.add_reagent("chocolate",4)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/choc_pile //for reagent chocolate being spilled on turfs
- name = "Pile of Chocolate"
- desc = "A pile of pure chocolate pieces."
- icon_state = "cocoa"
- filling_color = "#7D5F46"
-
- New()
- ..()
- reagents.add_reagent("chocolate",5) //no longer can be used to generate the reagent infinitely
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/chocolateegg
- name = "Chocolate Egg"
- desc = "Such sweet, fattening food."
- icon_state = "chocolateegg"
- filling_color = "#7D5F46"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
- reagents.add_reagent("chocolate",4)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/donut
- name = "donut"
- desc = "Goes great with Robust Coffee."
- icon_state = "donut1"
- filling_color = "#D9C386"
-
-/obj/item/weapon/reagent_containers/food/snacks/donut/normal
- name = "donut"
- desc = "Goes great with Robust Coffee."
- icon_state = "donut1"
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
- reagents.add_reagent("sprinkles", 1)
- src.bitesize = 3
- if(prob(30))
- src.icon_state = "donut2"
- src.name = "frosted donut"
- reagents.add_reagent("sprinkles", 2)
-
-/obj/item/weapon/reagent_containers/food/snacks/donut/sprinkles
- name = "frosted donut"
- icon_state = "donut2"
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
- reagents.add_reagent("sprinkles", 3)
-
-/obj/item/weapon/reagent_containers/food/snacks/donut/chaos
- name = "Chaos Donut"
- desc = "Like life, it never quite tastes the same."
- icon_state = "donut1"
- filling_color = "#ED11E6"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 2)
- reagents.add_reagent("sprinkles", 1)
- bitesize = 10
- var/chaosselect = pick(1,2,3,4,5,6,7,8,9,10)
- switch(chaosselect)
- if(1)
- reagents.add_reagent("nutriment", 3)
- if(2)
- reagents.add_reagent("capsaicin", 3)
- if(3)
- reagents.add_reagent("frostoil", 3)
- if(4)
- reagents.add_reagent("sprinkles", 3)
- if(5)
- reagents.add_reagent("plasma", 3)
- if(6)
- reagents.add_reagent("chocolate", 3)
- if(7)
- reagents.add_reagent("slimejelly", 3)
- if(8)
- reagents.add_reagent("banana", 3)
- if(9)
- reagents.add_reagent("berryjuice", 3)
- if(10)
- reagents.add_reagent("omnizine", 3)
- if(prob(30))
- src.icon_state = "donut2"
- src.name = "Frosted Chaos Donut"
- reagents.add_reagent("sprinkles", 2)
-
-
-/obj/item/weapon/reagent_containers/food/snacks/donut/jelly
- name = "Jelly Donut"
- desc = "You jelly?"
- icon_state = "jdonut1"
- filling_color = "#ED1169"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
- reagents.add_reagent("sprinkles", 1)
- reagents.add_reagent("berryjuice", 5)
- bitesize = 5
- if(prob(30))
- src.icon_state = "jdonut2"
- src.name = "Frosted Jelly Donut"
- reagents.add_reagent("sprinkles", 2)
-
-/obj/item/weapon/reagent_containers/food/snacks/donut/slimejelly
- name = "Jelly Donut"
- desc = "You jelly?"
- icon_state = "jdonut1"
- filling_color = "#ED1169"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
- reagents.add_reagent("sprinkles", 1)
- reagents.add_reagent("slimejelly", 5)
- bitesize = 5
- if(prob(30))
- src.icon_state = "jdonut2"
- src.name = "Frosted Jelly Donut"
- reagents.add_reagent("sprinkles", 2)
-
-/obj/item/weapon/reagent_containers/food/snacks/donut/cherryjelly
- name = "Jelly Donut"
- desc = "You jelly?"
- icon_state = "jdonut1"
- filling_color = "#ED1169"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
- reagents.add_reagent("sprinkles", 1)
- reagents.add_reagent("cherryjelly", 5)
- bitesize = 5
- if(prob(30))
- src.icon_state = "jdonut2"
- src.name = "Frosted Jelly Donut"
- reagents.add_reagent("sprinkles", 2)
-
-/obj/item/weapon/reagent_containers/food/snacks/egg
- name = "egg"
- desc = "An egg!"
- icon_state = "egg"
- filling_color = "#FDFFD1"
-
- New()
- ..()
- reagents.add_reagent("protein", 1)
- reagents.add_reagent("egg", 5)
-
- throw_impact(atom/hit_atom)
- ..()
- var/turf/T = get_turf(hit_atom)
- new/obj/effect/decal/cleanable/egg_smudge(T)
- if(reagents)
- reagents.reaction(hit_atom, TOUCH)
- qdel(src)
-
- attackby(obj/item/weapon/W as obj, mob/user as mob, params)
- if(istype( W, /obj/item/toy/crayon ))
- var/obj/item/toy/crayon/C = W
- var/clr = C.colourName
-
- if(!(clr in list("blue","green","mime","orange","purple","rainbow","red","yellow")))
- to_chat(usr, "\blue The egg refuses to take on this color!")
- return
-
- to_chat(usr, "\blue You color \the [src] [clr]")
- icon_state = "egg-[clr]"
- item_color = clr
- else
- ..()
-
-/obj/item/weapon/reagent_containers/food/snacks/egg/blue
- icon_state = "egg-blue"
- item_color = "blue"
-
-/obj/item/weapon/reagent_containers/food/snacks/egg/green
- icon_state = "egg-green"
- item_color = "green"
-
-/obj/item/weapon/reagent_containers/food/snacks/egg/mime
- icon_state = "egg-mime"
- item_color = "mime"
-
-/obj/item/weapon/reagent_containers/food/snacks/egg/orange
- icon_state = "egg-orange"
- item_color = "orange"
-
-/obj/item/weapon/reagent_containers/food/snacks/egg/purple
- icon_state = "egg-purple"
- item_color = "purple"
-
-/obj/item/weapon/reagent_containers/food/snacks/egg/rainbow
- icon_state = "egg-rainbow"
- item_color = "rainbow"
-
-/obj/item/weapon/reagent_containers/food/snacks/egg/red
- icon_state = "egg-red"
- item_color = "red"
-
-/obj/item/weapon/reagent_containers/food/snacks/egg/yellow
- icon_state = "egg-yellow"
- item_color = "yellow"
-
-/obj/item/weapon/reagent_containers/food/snacks/friedegg
- name = "Fried egg"
- desc = "A fried egg, with a touch of salt and pepper."
- icon_state = "friedegg"
- filling_color = "#FFDF78"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 2)
- reagents.add_reagent("egg", 5)
- reagents.add_reagent("sodiumchloride", 1)
- reagents.add_reagent("blackpepper", 1)
- bitesize = 1
-
-/obj/item/weapon/reagent_containers/food/snacks/boiledegg
- name = "Boiled egg"
- desc = "A hard boiled egg."
- icon_state = "egg"
- filling_color = "#FFFFFF"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 2)
- reagents.add_reagent("egg", 5)
-
-/obj/item/weapon/reagent_containers/food/snacks/organ
-
- name = "organ"
- desc = "It's good for you."
- icon = 'icons/obj/surgery.dmi'
- icon_state = "appendix"
- filling_color = "#E00D34"
-
- New()
- ..()
- reagents.add_reagent("protein", 4)
- src.bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/appendix
-//yes, this is the same as meat. I might do something different in future
- name = "appendix"
- desc = "An appendix which looks perfectly healthy."
- icon = 'icons/obj/surgery.dmi'
- icon_state = "appendix"
- filling_color = "#E00D34"
-
- New()
- ..()
- reagents.add_reagent("protein", 3)
- src.bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/appendix/inflamed
- name = "inflamed appendix"
- desc = "An appendix which appears to be inflamed."
- icon_state = "appendixinflamed"
- filling_color = "#E00D7A"
-
-/obj/item/weapon/reagent_containers/food/snacks/tofu
- name = "Tofu"
- icon_state = "tofu"
- desc = "We all love tofu."
- filling_color = "#FFFEE0"
-
- New()
- ..()
- reagents.add_reagent("plantmatter", 3)
- src.bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/fried_tofu
- name = "Fried Tofu"
- icon_state = "tofu"
- desc = "Proof that even vegetarians crave unhealthy foods."
- filling_color = "#FFFEE0"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
- src.bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/tofurkey
- name = "Tofurkey"
- desc = "A fake turkey made from tofu."
- icon_state = "tofurkey"
- filling_color = "#FFFEE0"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 12)
- reagents.add_reagent("ether", 3)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/stuffing
- name = "Stuffing"
- desc = "Moist, peppery breadcrumbs for filling the body cavities of dead birds. Dig in!"
- icon_state = "stuffing"
- filling_color = "#C9AC83"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
- bitesize = 1
-
-/obj/item/weapon/reagent_containers/food/snacks/hugemushroomslice
- name = "huge mushroom slice"
- desc = "A slice from a huge mushroom."
- icon_state = "hugemushroomslice"
- filling_color = "#E0D7C5"
-
- New()
- ..()
- reagents.add_reagent("plantmatter", 3)
- reagents.add_reagent("psilocybin", 3)
- src.bitesize = 6
-
-/obj/item/weapon/reagent_containers/food/snacks/tomatomeat
- name = "tomato slice"
- desc = "A slice from a huge tomato"
- icon_state = "tomatomeat"
- filling_color = "#DB0000"
-
- New()
- ..()
- reagents.add_reagent("protein", 3)
- src.bitesize = 6
-
-/obj/item/weapon/reagent_containers/food/snacks/bearmeat
- name = "bear meat"
- desc = "A very manly slab of meat."
- icon_state = "bearmeat"
- filling_color = "#DB0000"
-
- New()
- ..()
- reagents.add_reagent("protein", 12)
- reagents.add_reagent("methamphetamine", 5)
- src.bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/xenomeat
- name = "meat"
- desc = "A slab of meat"
- icon_state = "xenomeat"
- filling_color = "#43DE18"
-
- New()
- ..()
- reagents.add_reagent("protein", 3)
- src.bitesize = 6
-
-/obj/item/weapon/reagent_containers/food/snacks/spidermeat
- name = "spider meat"
- desc = "A slab of spider meat."
- icon_state = "spidermeat"
- New()
- ..()
- reagents.add_reagent("protein", 3)
- reagents.add_reagent("toxin", 3)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/spiderleg
- name = "spider leg"
- desc = "A still twitching leg of a giant spider... you don't really want to eat this, do you?"
- icon_state = "spiderleg"
- New()
- ..()
- reagents.add_reagent("protein", 2)
- reagents.add_reagent("toxin", 2)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/meatball
- name = "Meatball"
- desc = "A great meal all round."
- icon_state = "meatball"
- filling_color = "#DB0000"
- New()
- ..()
- reagents.add_reagent("protein", 3)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/sausage
- name = "Sausage"
- desc = "A piece of mixed, long meat."
- icon_state = "sausage"
- filling_color = "#DB0000"
-
- New()
- ..()
- reagents.add_reagent("protein", 6)
- reagents.add_reagent("porktonium", 10)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/donkpocket
- name = "Donk-pocket"
- desc = "The food of choice for the seasoned traitor."
- icon_state = "donkpocket"
- filling_color = "#DEDEAB"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 4)
-
-/obj/item/weapon/reagent_containers/food/snacks/warmdonkpocket
- name = "Warm Donk-pocket"
- desc = "The food of choice for the seasoned traitor."
- icon_state = "donkpocket"
- filling_color = "#DEDEAB"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 4)
-
- Post_Consume(mob/living/M)
- M.reagents.add_reagent("omnizine", 15)
-
-/obj/item/weapon/reagent_containers/food/snacks/syndidonkpocket
- name = "Donk-pocket"
- desc = "This donk-pocket is emitting a small amount of heat."
- icon_state = "donkpocket"
- filling_color = "#DEDEAB"
- bitesize = 100 //nom the whole thing at once.
-
- New()
- ..()
- reagents.add_reagent("nutriment", 1)
-
- Post_Consume(mob/living/M)
- M.reagents.add_reagent("omnizine", 15)
- M.reagents.add_reagent("teporone", 15)
- M.reagents.add_reagent("synaptizine", 15)
- M.reagents.add_reagent("salglu_solution", 15)
- M.reagents.add_reagent("salbutamol", 15)
- M.reagents.add_reagent("methamphetamine", 15)
-
-/obj/item/weapon/reagent_containers/food/snacks/brainburger
- name = "brainburger"
- desc = "A strange looking burger. It looks almost sentient."
- icon_state = "brainburger"
- filling_color = "#F2B6EA"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- reagents.add_reagent("prions", 10)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/ghostburger
- name = "Ghost Burger"
- desc = "Spooky! It doesn't look very filling."
- icon_state = "ghostburger"
- filling_color = "#FFF2FF"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 2)
- bitesize = 2
-
-
-/obj/item/weapon/reagent_containers/food/snacks/human
- var/hname = ""
- var/job = null
- filling_color = "#D63C3C"
-
-/obj/item/weapon/reagent_containers/food/snacks/human/burger
- name = "-burger"
- desc = "A bloody burger."
- icon_state = "hburger"
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/cheeseburger
- name = "cheeseburger"
- desc = "The cheese adds a good flavor."
- icon_state = "cheeseburger"
- New()
- ..()
- reagents.add_reagent("nutriment", 2)
-
-/obj/item/weapon/reagent_containers/food/snacks/monkeyburger
- name = "burger"
- desc = "The cornerstone of every nutritious breakfast."
- icon_state = "hburger"
- filling_color = "#D63C3C"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/tofuburger
- name = "Tofu Burger"
- desc = "What.. is that meat?"
- icon_state = "tofuburger"
- filling_color = "#FFFEE0"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/roburger
- name = "roburger"
- desc = "The lettuce is the only organic component. Beep."
- icon_state = "roburger"
- filling_color = "#CCCCCC"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 2)
- reagents.add_reagent("nanomachines", 10)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/roburgerbig
- name = "roburger"
- desc = "This massive patty looks like poison. Beep."
- icon_state = "roburger"
- filling_color = "#CCCCCC"
- volume = 100
-
- New()
- ..()
- reagents.add_reagent("nanomachines", 100)
- bitesize = 0.1
-
-/obj/item/weapon/reagent_containers/food/snacks/xenoburger
- name = "xenoburger"
- desc = "Smells caustic. Tastes like heresy."
- icon_state = "xburger"
- filling_color = "#43DE18"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 8)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/clownburger
- name = "Clown Burger"
- desc = "This tastes funny..."
- icon_state = "clownburger"
- filling_color = "#FF00FF"
-
- New()
- ..()
-/*
- var/datum/disease/F = new /datum/disease/pierrot_throat(0)
- var/list/data = list("viruses"= list(F))
- reagents.add_reagent("blood", 4, data)
-*/
- reagents.add_reagent("nutriment", 6)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/mimeburger
- name = "Mime Burger"
- desc = "Its taste defies language."
- icon_state = "mimeburger"
- filling_color = "#FFFFFF"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/omelette
- name = "Omelette Du Fromage"
- desc = "That's all you can say!"
- icon_state = "omelette"
- trash = /obj/item/trash/plate
- filling_color = "#FFF9A8"
-
- //var/herp = 0
- New()
- ..()
- reagents.add_reagent("nutriment", 8)
- bitesize = 1
-
-/obj/item/weapon/reagent_containers/food/snacks/muffin
- name = "Muffin"
- desc = "A delicious and spongy little cake"
- icon_state = "muffin"
- filling_color = "#E0CF9B"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/pie
- name = "Banana Cream Pie"
- desc = "Just like back home, on clown planet! HONK!"
- icon_state = "pie"
- trash = /obj/item/trash/plate
- filling_color = "#FBFFB8"
-
-/obj/item/weapon/reagent_containers/food/snacks/pie/New()
- ..()
- reagents.add_reagent("nutriment", 4)
- reagents.add_reagent("banana",5)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/pie/throw_impact(atom/hit_atom)
- ..()
- new/obj/effect/decal/cleanable/pie_smudge(src.loc)
- src.visible_message("\red [src.name] splats.","\red You hear a splat.")
- qdel(src)
-
-/obj/item/weapon/reagent_containers/food/snacks/berryclafoutis
- name = "Berry Clafoutis"
- desc = "No black birds, this is a good sign."
- icon_state = "berryclafoutis"
- trash = /obj/item/trash/plate
- New()
- ..()
- reagents.add_reagent("nutriment", 4)
- reagents.add_reagent("berryjuice", 5)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/waffles
- name = "waffles"
- desc = "Mmm, waffles"
- icon_state = "waffles"
- trash = /obj/item/trash/waffles
- filling_color = "#E6DEB5"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 8)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/eggplantparm
- name = "Eggplant Parmigiana"
- desc = "The only good recipe for eggplant."
- icon_state = "eggplantparm"
- trash = /obj/item/trash/plate
- filling_color = "#4D2F5E"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/soylentgreen
- name = "Soylent Green"
- desc = "Not made of people. Honest." //Totally people.
- icon_state = "soylent_green"
- trash = /obj/item/trash/waffles
- filling_color = "#B8E6B5"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 10)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/soylenviridians
- name = "Soylen Virdians"
- desc = "Not made of people. Honest." //Actually honest for once.
- icon_state = "soylent_yellow"
- trash = /obj/item/trash/waffles
- filling_color = "#E6FA61"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 10)
- bitesize = 2
-
-
-/obj/item/weapon/reagent_containers/food/snacks/meatpie
- name = "Meat-pie"
- icon_state = "meatpie"
- desc = "An old barber recipe, very delicious!"
- trash = /obj/item/trash/plate
- filling_color = "#948051"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 10)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/tofupie
- name = "Tofu-pie"
- icon_state = "meatpie"
- desc = "A delicious tofu pie."
- trash = /obj/item/trash/plate
- filling_color = "#FFFEE0"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 10)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/amanita_pie
- name = "amanita pie"
- desc = "Sweet and tasty poison pie."
- icon_state = "amanita_pie"
- filling_color = "#FFCCCC"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 5)
- reagents.add_reagent("amanitin", 3)
- reagents.add_reagent("psilocybin", 1)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/plump_pie
- name = "plump pie"
- desc = "I bet you love stuff made out of plump helmets!"
- icon_state = "plump_pie"
- filling_color = "#B8279B"
-
- New()
- ..()
- if(prob(10))
- name = "exceptional plump pie"
- desc = "Microwave is taken by a fey mood! It has cooked an exceptional plump pie!"
- reagents.add_reagent("nutriment", 8)
- reagents.add_reagent("omnizine", 5)
- bitesize = 2
- else
- reagents.add_reagent("nutriment", 8)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/xemeatpie
- name = "Xeno-pie"
- icon_state = "xenomeatpie"
- desc = "A delicious meatpie. Probably heretical."
- trash = /obj/item/trash/plate
- filling_color = "#43DE18"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 10)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/wingfangchu
- name = "Wing Fang Chu"
- desc = "A savory dish of alien wing wang in soy."
- icon_state = "wingfangchu"
- trash = /obj/item/trash/snack_bowl
- filling_color = "#43DE18"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- bitesize = 2
-
-
-/obj/item/weapon/reagent_containers/food/snacks/human/kabob
- name = "-kabob"
- icon_state = "kabob"
- desc = "A human meat, on a stick."
- trash = /obj/item/stack/rods
- filling_color = "#A85340"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 8)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/monkeykabob
- name = "Meat-kabob"
- icon_state = "kabob"
- desc = "Delicious meat, on a stick."
- trash = /obj/item/stack/rods
- filling_color = "#A85340"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 8)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/tofukabob
- name = "Tofu-kabob"
- icon_state = "kabob"
- desc = "Vegan meat, on a stick."
- trash = /obj/item/stack/rods
- filling_color = "#FFFEE0"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 8)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/popcorn
- name = "Popcorn"
- desc = "Now let's find some cinema."
- icon_state = "popcorn"
- trash = /obj/item/trash/popcorn
- var/unpopped = 0
- filling_color = "#FFFAD4"
-
- New()
- ..()
- unpopped = rand(1,10)
- reagents.add_reagent("nutriment", 2)
- bitesize = 0.1 //this snack is supposed to be eating during looooong time. And this it not dinner food! --rastaf0
- On_Consume(mob/M, mob/user)
- if(prob(unpopped)) //lol ...what's the point?
- to_chat(user, "\red You bite down on an un-popped kernel!")
- unpopped = max(0, unpopped-1)
- ..()
-
-
-/obj/item/weapon/reagent_containers/food/snacks/sosjerky
- name = "Scaredy's Private Reserve Beef Jerky"
- icon_state = "sosjerky"
- desc = "Beef jerky made from the finest space cows."
- trash = /obj/item/trash/sosjerky
- filling_color = "#631212"
-
- New()
- ..()
- reagents.add_reagent("protein", 4)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/pistachios
- name = "Pistachios"
- icon_state = "pistachios"
- desc = "A snack of deliciously salted pistachios. A perfectly valid choice..."
- trash = /obj/item/trash/pistachios
- filling_color = "#BAD145"
-
- New()
- ..()
- reagents.add_reagent("plantmatter", 6)
- reagents.add_reagent("sodiumchloride", 1)
-
-/obj/item/weapon/reagent_containers/food/snacks/no_raisin
- name = "4no Raisins"
- icon_state = "4no_raisins"
- desc = "Best raisins in the universe. Not sure why."
- trash = /obj/item/trash/raisins
- filling_color = "#343834"
-
- New()
- ..()
- reagents.add_reagent("plantmatter", 6)
-
-/obj/item/weapon/reagent_containers/food/snacks/spacetwinkie
- name = "Space Twinkie"
- icon_state = "space_twinkie"
- desc = "Guaranteed to survive longer then you will."
- filling_color = "#FFE591"
-
- New()
- ..()
- reagents.add_reagent("sugar", 4)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/cheesiehonkers
- name = "Cheesie Honkers"
- icon_state = "cheesie_honkers"
- desc = "Bite sized cheesie snacks that will honk all over your mouth"
- trash = /obj/item/trash/cheesie
- filling_color = "#FFA305"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 4)
- reagents.add_reagent("fake_cheese", 2)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/chinese/chowmein
- name = "chow mein"
- desc = "What is in this anyways?"
- icon_state = "chinese1"
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- reagents.add_reagent("beans", 3)
- reagents.add_reagent("msg",4)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/chinese/tao
- name = "Admiral Yamamoto carp"
- desc = "Tastes like chicken."
- icon_state = "chinese2"
- New()
- ..()
- reagents.add_reagent("nutriment", 4)
- reagents.add_reagent("protein", 2)
- reagents.add_reagent("msg",4)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/chinese/newdles
- name = "chinese newdles"
- desc = "Made fresh, weekly!"
- icon_state = "chinese3"
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- reagents.add_reagent("msg",4)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/chinese/rice
- name = "fried rice"
- desc = "A timeless classic."
- icon_state = "chinese4"
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
- reagents.add_reagent("rice", 3)
- reagents.add_reagent("msg",4)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/syndicake
- name = "Syndi-Cakes"
- icon_state = "syndi_cakes"
- desc = "An extremely moist snack cake that tastes just as good after being nuked."
- filling_color = "#FF5D05"
-
- trash = /obj/item/trash/syndi_cakes
- New()
- ..()
- reagents.add_reagent("nutriment", 4)
- reagents.add_reagent("salglu_solution", 5)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/loadedbakedpotato
- name = "Loaded Baked Potato"
- desc = "Totally baked."
- icon_state = "loadedbakedpotato"
- filling_color = "#9C7A68"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/fries
- name = "Space Fries"
- desc = "AKA: French Fries, Freedom Fries, etc."
- icon_state = "fries"
- trash = /obj/item/trash/plate
- filling_color = "#EDDD00"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 4)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/soydope
- name = "Soy Dope"
- desc = "Dope from a soy."
- icon_state = "soydope"
- trash = /obj/item/trash/plate
- filling_color = "#C4BF76"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 2)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/spagetti
- name = "Spagetti"
- desc = "A bundle of raw spaghetti."
- icon_state = "spagetti"
- filling_color = "#EDDD00"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 1)
- bitesize = 1
-
-/obj/item/weapon/reagent_containers/food/snacks/cheesyfries
- name = "Cheesy Fries"
- desc = "Fries. Covered in cheese. Duh."
- icon_state = "cheesyfries"
- trash = /obj/item/trash/plate
- filling_color = "#EDDD00"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/fortunecookie
- name = "Fortune cookie"
- desc = "A true prophecy in each cookie!"
- icon_state = "fortune_cookie"
- filling_color = "#E8E79E"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/badrecipe
- name = "Burned mess"
- desc = "Someone should be demoted from chef for this."
- icon_state = "badrecipe"
- filling_color = "#211F02"
-
- New()
- ..()
- reagents.add_reagent("????", 5)
- reagents.add_reagent("carbon", 3)
- bitesize = 2
-
- // it's burned! it should start off being classed as any cooktype that burns
- cooktype["grilled"] = 1
- cooktype["deep fried"] = 1
-
-/obj/item/weapon/reagent_containers/food/snacks/meatsteak
- name = "Meat steak"
- desc = "A piece of hot spicy meat."
- icon_state = "meatstake"
- trash = /obj/item/trash/plate
- filling_color = "#7A3D11"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 4)
- reagents.add_reagent("sodiumchloride", 1)
- reagents.add_reagent("blackpepper", 1)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/spacylibertyduff
- name = "Spacy Liberty Duff"
- desc = "Jello gelatin, from Alfred Hubbard's cookbook"
- icon_state = "spacylibertyduff"
- trash = /obj/item/trash/snack_bowl
- filling_color = "#42B873"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- reagents.add_reagent("psilocybin", 6)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/amanitajelly
- name = "Amanita Jelly"
- desc = "Looks curiously toxic"
- icon_state = "amanitajelly"
- trash = /obj/item/trash/snack_bowl
- filling_color = "#ED0758"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- reagents.add_reagent("amanitin", 6)
- reagents.add_reagent("psilocybin", 3)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/poppypretzel
- name = "Poppy pretzel"
- desc = "It's all twisted up!"
- icon_state = "poppypretzel"
- bitesize = 2
- filling_color = "#916E36"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 5)
- bitesize = 2
-
-
-/obj/item/weapon/reagent_containers/food/snacks/meatballsoup
- name = "Meatball soup"
- desc = "You've got balls kid, BALLS!"
- icon_state = "meatballsoup"
- trash = /obj/item/trash/snack_bowl
- filling_color = "#785210"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 8)
- reagents.add_reagent("water", 5)
- bitesize = 5
-
-/obj/item/weapon/reagent_containers/food/snacks/slimesoup
- name = "slime soup"
- desc = "If no water is available, you may substitute tears."
- icon_state = "slimesoup"
- filling_color = "#C4DBA0"
-
- New()
- ..()
- reagents.add_reagent("slimejelly", 5)
- reagents.add_reagent("water", 10)
- bitesize = 5
-
-/obj/item/weapon/reagent_containers/food/snacks/bloodsoup
- name = "Tomato soup"
- desc = "Smells like copper"
- icon_state = "tomatosoup"
- filling_color = "#FF0000"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 2)
- reagents.add_reagent("blood", 10)
- reagents.add_reagent("water", 5)
- bitesize = 5
-
-/obj/item/weapon/reagent_containers/food/snacks/clownstears
- name = "Clown's Tears"
- desc = "Not very funny."
- icon_state = "clownstears"
- filling_color = "#C4FBFF"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 4)
- reagents.add_reagent("banana", 5)
- reagents.add_reagent("water", 10)
- bitesize = 5
-
-/obj/item/weapon/reagent_containers/food/snacks/vegetablesoup
- name = "Vegetable soup"
- desc = "A true vegan meal" //TODO
- icon_state = "vegetablesoup"
- trash = /obj/item/trash/snack_bowl
- filling_color = "#AFC4B5"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 8)
- reagents.add_reagent("water", 5)
- bitesize = 5
-
-/obj/item/weapon/reagent_containers/food/snacks/nettlesoup
- name = "Nettle soup"
- desc = "To think, the botanist would've beat you to death with one of these."
- icon_state = "nettlesoup"
- trash = /obj/item/trash/snack_bowl
- filling_color = "#AFC4B5"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 8)
- reagents.add_reagent("water", 5)
- reagents.add_reagent("omnizine", 5)
- bitesize = 5
-
-/obj/item/weapon/reagent_containers/food/snacks/mysterysoup
- name = "Mystery soup"
- desc = "The mystery is, why aren't you eating it?"
- icon_state = "mysterysoup"
- trash = /obj/item/trash/snack_bowl
- filling_color = "#F082FF"
-
- New()
- ..()
- var/mysteryselect = pick(1,2,3,4,5,6,7,8,9,10)
- switch(mysteryselect)
- if(1)
- reagents.add_reagent("nutriment", 6)
- reagents.add_reagent("capsaicin", 3)
- reagents.add_reagent("tomatojuice", 2)
- if(2)
- reagents.add_reagent("nutriment", 6)
- reagents.add_reagent("frostoil", 3)
- reagents.add_reagent("tomatojuice", 2)
- if(3)
- reagents.add_reagent("nutriment", 5)
- reagents.add_reagent("water", 5)
- reagents.add_reagent("omnizine", 5)
- if(4)
- reagents.add_reagent("nutriment", 5)
- reagents.add_reagent("water", 10)
- if(5)
- reagents.add_reagent("nutriment", 2)
- reagents.add_reagent("banana", 10)
- if(6)
- reagents.add_reagent("nutriment", 6)
- reagents.add_reagent("blood", 10)
- if(7)
- reagents.add_reagent("slimejelly", 10)
- reagents.add_reagent("water", 10)
- if(8)
- reagents.add_reagent("carbon", 10)
- reagents.add_reagent("toxin", 10)
- if(9)
- reagents.add_reagent("nutriment", 5)
- reagents.add_reagent("tomatojuice", 10)
- if(10)
- reagents.add_reagent("nutriment", 6)
- reagents.add_reagent("tomatojuice", 5)
- reagents.add_reagent("oculine", 5)
- bitesize = 5
-
-/obj/item/weapon/reagent_containers/food/snacks/wishsoup
- name = "Wish Soup"
- desc = "I wish this was soup."
- icon_state = "wishsoup"
- trash = /obj/item/trash/snack_bowl
- filling_color = "#D1F4FF"
-
- New()
- ..()
- reagents.add_reagent("water", 10)
- bitesize = 5
- if(prob(25))
- src.desc = "A wish come true!"
- reagents.add_reagent("nutriment", 8)
-
-/obj/item/weapon/reagent_containers/food/snacks/hotchili
- name = "Hot Chili"
- desc = "A five alarm Texan Chili!"
- icon_state = "hotchili"
- trash = /obj/item/trash/snack_bowl
- filling_color = "#FF3C00"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- reagents.add_reagent("capsaicin", 3)
- reagents.add_reagent("tomatojuice", 2)
- bitesize = 5
-
-
-/obj/item/weapon/reagent_containers/food/snacks/coldchili
- name = "Cold Chili"
- desc = "This slush is barely a liquid!"
- icon_state = "coldchili"
- filling_color = "#2B00FF"
-
- trash = /obj/item/trash/snack_bowl
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- reagents.add_reagent("frostoil", 3)
- reagents.add_reagent("tomatojuice", 2)
- bitesize = 5
-
-
-/obj/item/weapon/reagent_containers/food/snacks/telebacon
- name = "Tele Bacon"
- desc = "It tastes a little odd but it is still delicious."
- icon_state = "bacon"
- var/obj/item/device/radio/beacon/bacon/baconbeacon
- bitesize = 2
- New()
- ..()
- reagents.add_reagent("nutriment", 4)
- reagents.add_reagent("porktonium", 10)
- baconbeacon = new /obj/item/device/radio/beacon/bacon(src)
- On_Consume(mob/M, mob/user)
- if(!reagents.total_volume)
- baconbeacon.loc = user
- baconbeacon.digest_delay()
-
-
-/obj/item/weapon/reagent_containers/food/snacks/monkeycube
- name = "monkey cube"
- desc = "Just add water!"
- icon_state = "monkeycube"
- bitesize = 12
- filling_color = "#ADAC7F"
- var/monkey_type = "Monkey"
-
-/obj/item/weapon/reagent_containers/food/snacks/monkeycube/New()
- ..()
- reagents.add_reagent("protein",10)
-
-/obj/item/weapon/reagent_containers/food/snacks/monkeycube/afterattack(obj/O, mob/user, proximity)
- if(!proximity) return
- if(istype(O,/obj/structure/sink) && !wrapped)
- to_chat(user, "You place [src] under a stream of water...")
- user.drop_item()
- forceMove(get_turf(O))
- return Expand()
- if(istype(O, /obj/machinery/computer/camera_advanced/xenobio))
- var/obj/machinery/computer/camera_advanced/xenobio/X = O
- X.monkeys++
- to_chat(user, "You feed [src] to the [X]. It now has [X.monkeys] monkey cubes stored.")
- qdel(src)
- return
- ..()
-
-/obj/item/weapon/reagent_containers/food/snacks/monkeycube/attack_self(mob/user)
- if(wrapped)
- Unwrap(user)
-
-/obj/item/weapon/reagent_containers/food/snacks/monkeycube/water_act(volume, temperature)
- if(volume >= 5)
- return Expand()
-
-/obj/item/weapon/reagent_containers/food/snacks/monkeycube/wash(mob/user, atom/source)
- if(wrapped)
- ..()
- return
- if(do_after(user, 40, target = source))
- return 1
-
-/obj/item/weapon/reagent_containers/food/snacks/monkeycube/proc/Expand()
- if(isnull(gcDestroyed))
- visible_message("[src] expands!")
- new/mob/living/carbon/human(get_turf(src),monkey_type)
- qdel(src)
-
-/obj/item/weapon/reagent_containers/food/snacks/monkeycube/proc/Unwrap(mob/user)
- icon_state = "monkeycube"
- desc = "Just add water!"
- to_chat(user, "You unwrap the cube.")
- wrapped = 0
-
-/obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped
- desc = "Still wrapped in some paper."
- icon_state = "monkeycubewrap"
- wrapped = 1
-
-/obj/item/weapon/reagent_containers/food/snacks/monkeycube/farwacube
- name = "farwa cube"
- monkey_type = "Farwa"
-
-/obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped/farwacube
- name = "farwa cube"
- monkey_type = "Farwa"
-
-/obj/item/weapon/reagent_containers/food/snacks/monkeycube/wolpincube
- name = "wolpin cube"
- monkey_type = "Wolpin"
-
-/obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped/wolpincube
- name = "wolpin cube"
- monkey_type = "Wolpin"
-
-/obj/item/weapon/reagent_containers/food/snacks/monkeycube/stokcube
- name = "stok cube"
- monkey_type = "Stok"
-
-/obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped/stokcube
- name = "stok cube"
- monkey_type = "Stok"
-
-/obj/item/weapon/reagent_containers/food/snacks/monkeycube/neaeracube
- name = "neaera cube"
- monkey_type = "Neara"
-
-/obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped/neaeracube
- name = "neaera cube"
- monkey_type = "Neara"
-
-
-/obj/item/weapon/reagent_containers/food/snacks/spellburger
- name = "Spell Burger"
- desc = "This is absolutely Ei Nath."
- icon_state = "spellburger"
- filling_color = "#D505FF"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/bigbiteburger
- name = "Big Bite Burger"
- desc = "Forget the Big Mac. THIS is the future!"
- icon_state = "bigbiteburger"
- filling_color = "#E3D681"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 14)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/enchiladas
- name = "Enchiladas"
- desc = "Viva La Mexico!"
- icon_state = "enchiladas"
- trash = /obj/item/trash/tray
- filling_color = "#A36A1F"
-
- New()
- ..()
- reagents.add_reagent("nutriment",8)
- reagents.add_reagent("capsaicin", 6)
- bitesize = 4
-
-/obj/item/weapon/reagent_containers/food/snacks/burrito
- name = "Burrito"
- desc = "Meat, beans, cheese, and rice wrapped up as an easy-to-hold meal."
- icon_state = "burrito"
- trash = /obj/item/trash/plate
- filling_color = "#A36A1F"
-
-/obj/item/weapon/reagent_containers/food/snacks/burrito/New()
- ..()
- reagents.add_reagent("nutriment", 5)
-
-/obj/item/weapon/reagent_containers/food/snacks/chimichanga
- name = "Chimichanga"
- desc = "Time to eat a chimi-f***ing-changa."
- icon_state = "chimichanga"
- trash = /obj/item/trash/plate
- filling_color = "#A36A1F"
-
-/obj/item/weapon/reagent_containers/food/snacks/chimichanga/New()
- ..()
- reagents.add_reagent("omnizine", 4) //Deadpool reference. Deal with it.
- reagents.add_reagent("cheese", 2)
-
-/obj/item/weapon/reagent_containers/food/snacks/monkeysdelight
- name = "monkey's Delight"
- desc = "Eeee Eee!"
- icon_state = "monkeysdelight"
- trash = /obj/item/trash/tray
- filling_color = "#5C3C11"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 10)
- reagents.add_reagent("banana", 5)
- reagents.add_reagent("blackpepper", 1)
- reagents.add_reagent("sodiumchloride", 1)
- bitesize = 6
-
-/obj/item/weapon/reagent_containers/food/snacks/baguette
- name = "Baguette"
- desc = "Bon appetit!"
- icon_state = "baguette"
- filling_color = "#E3D796"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- reagents.add_reagent("blackpepper", 1)
- reagents.add_reagent("sodiumchloride", 1)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/sandwich
- name = "Sandwich"
- desc = "A grand creation of meat, cheese, bread, and several leaves of lettuce! Arthur Dent would be proud."
- icon_state = "sandwich"
- trash = /obj/item/trash/plate
- filling_color = "#D9BE29"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/toastedsandwich
- name = "Toasted Sandwich"
- desc = "Now if you only had a pepper bar."
- icon_state = "toastedsandwich"
- trash = /obj/item/trash/plate
- filling_color = "#D9BE29"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- reagents.add_reagent("carbon", 2)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/grilledcheese
- name = "Grilled Cheese Sandwich"
- desc = "Goes great with Tomato soup!"
- icon_state = "toastedsandwich"
- trash = /obj/item/trash/plate
- filling_color = "#D9BE29"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 7)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/tomatosoup
- name = "Tomato Soup"
- desc = "Drinking this feels like being a vampire! A tomato vampire..."
- icon_state = "tomatosoup"
- trash = /obj/item/trash/snack_bowl
- filling_color = "#D92929"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 5)
- reagents.add_reagent("tomatojuice", 10)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/rofflewaffles
- name = "Roffle Waffles"
- desc = "Waffles from Roffle. Co."
- icon_state = "rofflewaffles"
- trash = /obj/item/trash/waffles
- filling_color = "#FF00F7"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 8)
- reagents.add_reagent("psilocybin", 8)
- bitesize = 4
-
-/obj/item/weapon/reagent_containers/food/snacks/stew
- name = "Stew"
- desc = "A nice and warm stew. Healthy and strong."
- icon_state = "stew"
- filling_color = "#9E673A"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 10)
- reagents.add_reagent("tomatojuice", 5)
- reagents.add_reagent("oculine", 5)
- reagents.add_reagent("water", 5)
- bitesize = 10
-
-/obj/item/weapon/reagent_containers/food/snacks/jelliedtoast
- name = "Jellied Toast"
- desc = "A slice of bread covered with delicious jam."
- icon_state = "jellytoast"
- trash = /obj/item/trash/plate
- filling_color = "#B572AB"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 1)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/jelliedtoast/cherry
- New()
- ..()
- reagents.add_reagent("cherryjelly", 5)
-
-/obj/item/weapon/reagent_containers/food/snacks/jelliedtoast/slime
- New()
- ..()
- reagents.add_reagent("slimejelly", 5)
-
-/obj/item/weapon/reagent_containers/food/snacks/jellyburger
- name = "Jelly Burger"
- desc = "Culinary delight..?"
- icon_state = "jellyburger"
- filling_color = "#B572AB"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 5)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/jellyburger/slime
- New()
- ..()
- reagents.add_reagent("slimejelly", 5)
-
-/obj/item/weapon/reagent_containers/food/snacks/jellyburger/cherry
- New()
- ..()
- reagents.add_reagent("cherryjelly", 5)
-
-/obj/item/weapon/reagent_containers/food/snacks/milosoup
- name = "Milosoup"
- desc = "The universes best soup! Yum!!!"
- icon_state = "milosoup"
- trash = /obj/item/trash/snack_bowl
- New()
- ..()
- reagents.add_reagent("nutriment", 8)
- reagents.add_reagent("water", 5)
- bitesize = 4
-
-/obj/item/weapon/reagent_containers/food/snacks/stewedsoymeat
- name = "Stewed Soy Meat"
- desc = "Even non-vegetarians will LOVE this!"
- icon_state = "stewedsoymeat"
- trash = /obj/item/trash/plate
- New()
- ..()
- reagents.add_reagent("nutriment", 8)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/boiledspagetti
- name = "Boiled Spagetti"
- desc = "A plain dish of noodles, this sucks."
- icon_state = "spagettiboiled"
- trash = /obj/item/trash/plate
- filling_color = "#FCEE81"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 2)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/boiledrice
- name = "Boiled Rice"
- desc = "A boring dish of boring rice."
- icon_state = "boiledrice"
- trash = /obj/item/trash/snack_bowl
- filling_color = "#FFFBDB"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 2)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/ricepudding
- name = "Rice Pudding"
- desc = "Where's the Jam!"
- icon_state = "rpudding"
- trash = /obj/item/trash/snack_bowl
- filling_color = "#FFFBDB"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 4)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/pastatomato
- name = "Spagetti"
- desc = "Spaghetti and crushed tomatoes. Just like your abusive father used to make!"
- icon_state = "pastatomato"
- trash = /obj/item/trash/plate
- filling_color = "#DE4545"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- reagents.add_reagent("tomatojuice", 10)
- bitesize = 4
-
-/obj/item/weapon/reagent_containers/food/snacks/meatballspagetti
- name = "Spagetti & Meatballs"
- desc = "Now thats a nic'e meatball!"
- icon_state = "meatballspagetti"
- trash = /obj/item/trash/plate
- filling_color = "#DE4545"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 8)
- reagents.add_reagent("synaptizine", 5)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/spesslaw
- name = "Spesslaw"
- desc = "A lawyers favourite"
- icon_state = "spesslaw"
- filling_color = "#DE4545"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 8)
- reagents.add_reagent("synaptizine", 10)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/poppypretzel
- name = "Poppy Pretzel"
- desc = "A large soft pretzel full of POP!"
- icon_state = "poppypretzel"
- filling_color = "#AB7D2E"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 5)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/carrotfries
- name = "Carrot Fries"
- desc = "Tasty fries from fresh Carrots."
- icon_state = "carrotfries"
- trash = /obj/item/trash/plate
- filling_color = "#FAA005"
-
- New()
- ..()
- reagents.add_reagent("plantmatter", 3)
- reagents.add_reagent("oculine", 3)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/superbiteburger
- name = "Super Bite Burger"
- desc = "This is a mountain of a burger. FOOD!"
- icon_state = "superbiteburger"
- filling_color = "#CCA26A"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 50)
- bitesize = 10
-
-/obj/item/weapon/reagent_containers/food/snacks/candiedapple
- name = "Candied Apple"
- desc = "An apple coated in sugary sweetness."
- icon_state = "candiedapple"
- filling_color = "#F21873"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/applepie
- name = "Apple Pie"
- desc = "A pie containing sweet sweet love... or apple."
- icon_state = "applepie"
- filling_color = "#E0EDC5"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 4)
- bitesize = 3
-
-
-/obj/item/weapon/reagent_containers/food/snacks/cherrypie
- name = "Cherry Pie"
- desc = "Taste so good, make a grown man cry."
- icon_state = "cherrypie"
- filling_color = "#FF525A"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 4)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/twobread
- name = "Two Bread"
- desc = "It is very bitter and winy."
- icon_state = "twobread"
- filling_color = "#DBCC9A"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 2)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/jellysandwich
- name = "Jelly Sandwich"
- desc = "You wish you had some peanut butter to go with this..."
- icon_state = "jellysandwich"
- trash = /obj/item/trash/plate
- filling_color = "#9E3A78"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 2)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/jellysandwich/slime
- New()
- ..()
- reagents.add_reagent("slimejelly", 5)
-
-/obj/item/weapon/reagent_containers/food/snacks/jellysandwich/cherry
- New()
- ..()
- reagents.add_reagent("cherryjelly", 5)
-
-/obj/item/weapon/reagent_containers/food/snacks/boiledslimecore
- name = "Boiled Slime Core"
- desc = "A boiled red thing."
- icon_state = "boiledrorocore"
- New()
- ..()
- reagents.add_reagent("slimejelly", 5)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/mint
- name = "mint"
- desc = "it is only wafer thin."
- icon_state = "mint"
- filling_color = "#F2F2F2"
-
- New()
- ..()
- reagents.add_reagent("minttoxin", 1)
- bitesize = 1
-
-/obj/item/weapon/reagent_containers/food/snacks/mushroomsoup
- name = "chantrelle soup"
- desc = "A delicious and hearty mushroom soup."
- icon_state = "mushroomsoup"
- trash = /obj/item/trash/snack_bowl
- filling_color = "#E386BF"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 8)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/plumphelmetbiscuit
- name = "plump helmet biscuit"
- desc = "This is a finely-prepared plump helmet biscuit. The ingredients are exceptionally minced plump helmet, and well-minced dwarven wheat flour."
- icon_state = "phelmbiscuit"
- filling_color = "#CFB4C4"
-
- New()
- ..()
- if(prob(10))
- name = "exceptional plump helmet biscuit"
- desc = "Microwave is taken by a fey mood! It has cooked an exceptional plump helmet biscuit!"
- reagents.add_reagent("nutriment", 8)
- reagents.add_reagent("omnizine", 5)
- bitesize = 2
- else
- reagents.add_reagent("nutriment", 5)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/chawanmushi
- name = "chawanmushi"
- desc = "A legendary egg custard that makes friends out of enemies. Probably too hot for a cat to eat."
- icon_state = "chawanmushi"
- trash = /obj/item/trash/snack_bowl
- filling_color = "#F0F2E4"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 5)
- bitesize = 1
-
-/obj/item/weapon/reagent_containers/food/snacks/beetsoup
- name = "beet soup"
- desc = "Wait, how do you spell it again..?"
- icon_state = "beetsoup"
- trash = /obj/item/trash/snack_bowl
- filling_color = "#FAC9FF"
-
- New()
- ..()
- switch(rand(1,6))
- if(1)
- name = "borsch"
- if(2)
- name = "bortsch"
- if(3)
- name = "borstch"
- if(4)
- name = "borsh"
- if(5)
- name = "borshch"
- if(6)
- name = "borscht"
- reagents.add_reagent("nutriment", 8)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/herbsalad
- name = "herb salad"
- desc = "A tasty salad with apples on top."
- icon_state = "herbsalad"
- trash = /obj/item/trash/snack_bowl
- filling_color = "#76B87F"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 8)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/validsalad
- name = "valid salad"
- desc = "It's just an herb salad with meatballs and fried potato slices. Nothing suspicious about it."
- icon_state = "validsalad"
- trash = /obj/item/trash/snack_bowl
- filling_color = "#76B87F"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 8)
- reagents.add_reagent("omnizine", 5)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/appletart
- name = "golden apple streusel tart"
- desc = "A tasty dessert that won't make it through a metal detector."
- icon_state = "gappletart"
- trash = /obj/item/trash/plate
- filling_color = "#FFFF00"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 8)
- reagents.add_reagent("gold", 5)
- spawn(1)
- reagents.del_reagent("egg")
- reagents.update_total()
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/dough_ball
- name = "ball of raw dough"
- desc = "A ball of raw dough, ready to be molded into new recipes."
- icon = 'icons/obj/food/food_ingredients.dmi'
- icon_state = "dough"
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
- bitesize = 1
- attackby(obj/item/weapon/W as obj, mob/user as mob, params)
- if(istype(W,/obj/item/weapon/kitchen/rollingpin))
- user.visible_message( \
- "[user] flattens the dough with the rolling pin!", \
- "\blue You flatten the dough with your rolling pin!" \
- )
- new /obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough(src.loc)
- qdel(src)
-
-/////////////////////////////////////////////////Sliceable////////////////////////////////////////
-// All the food items that can be sliced into smaller bits like Meatbread and Cheesewheels
-
-// sliceable is just an organization type path, it doesn't have any additional code or variables tied to it.
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough
- name = "flattened dough"
- desc = "Still raw. You resist the temptation to cover it in tomato sauce."
- icon = 'icons/obj/food/food_ingredients.dmi'
- icon_state = "flatdough"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/doughslice
- slices_num = 3
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
- bitesize = 1
-
-/obj/item/weapon/reagent_containers/food/snacks/doughslice
- name = "slice of dough"
- desc = "an individual portion of raw dough, ready to be cooked."
- icon = 'icons/obj/food/food_ingredients.dmi'
- icon_state = "doughslice"
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/meatbread
- name = "meatbread loaf"
- desc = "The culinary base of every self-respecting eloquen/tg/entleman."
- icon_state = "meatbread"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/meatbreadslice
- slices_num = 5
- filling_color = "#FF7575"
- New()
- ..()
- reagents.add_reagent("protein", 20)
- reagents.add_reagent("nutriment", 10)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/meatbreadslice
- name = "meatbread slice"
- desc = "A slice of delicious meatbread."
- icon_state = "meatbreadslice"
- trash = /obj/item/trash/plate
- filling_color = "#FF7575"
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/xenomeatbread
- name = "xenomeatbread loaf"
- desc = "The culinary base of every self-respecting eloquent gentleman. Extra Heretical."
- icon_state = "xenomeatbread"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/xenomeatbreadslice
- slices_num = 5
- filling_color = "#8AFF75"
- New()
- ..()
- reagents.add_reagent("protein", 20)
- reagents.add_reagent("nutriment", 10)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/xenomeatbreadslice
- name = "xenomeatbread slice"
- desc = "A slice of delicious meatbread. Extra Heretical."
- icon_state = "xenobreadslice"
- trash = /obj/item/trash/plate
- filling_color = "#8AFF75"
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/spidermeatbread
- name = "spider meat loaf"
- desc = "Reassuringly green meatloaf made from spider meat."
- icon_state = "spidermeatbread"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/spidermeatbreadslice
- slices_num = 5
- New()
- ..()
- reagents.add_reagent("protein", 20)
- reagents.add_reagent("nutriment", 10)
- reagents.add_reagent("toxin", 15)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/spidermeatbreadslice
- name = "spider meat bread slice"
- desc = "A slice of meatloaf made from an animal that most likely still wants you dead."
- icon_state = "xenobreadslice"
- trash = /obj/item/trash/plate
- bitesize = 2
- New()
- ..()
- reagents.add_reagent("toxin", 2)
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/bananabread
- name = "Banana-nut bread"
- desc = "A heavenly and filling treat."
- icon_state = "bananabread"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/bananabreadslice
- slices_num = 5
- filling_color = "#EDE5AD"
- New()
- ..()
- reagents.add_reagent("banana", 20)
- reagents.add_reagent("nutriment", 20)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/bananabreadslice
- name = "Banana-nut bread slice"
- desc = "A slice of delicious banana bread."
- icon_state = "bananabreadslice"
- trash = /obj/item/trash/plate
- filling_color = "#EDE5AD"
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/tofubread
- name = "Tofubread"
- icon_state = "Like meatbread but for vegetarians. Not guaranteed to give superpowers."
- icon_state = "tofubread"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/tofubreadslice
- slices_num = 5
- filling_color = "#F7FFE0"
- New()
- ..()
- reagents.add_reagent("nutriment", 30)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/tofubreadslice
- name = "Tofubread slice"
- desc = "A slice of delicious tofubread."
- icon_state = "tofubreadslice"
- trash = /obj/item/trash/plate
- filling_color = "#F7FFE0"
- bitesize = 2
-
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/carrotcake
- name = "Carrot Cake"
- desc = "A favorite desert of a certain wascally wabbit. Not a lie."
- icon_state = "carrotcake"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/carrotcakeslice
- slices_num = 5
- filling_color = "#FFD675"
- New()
- ..()
- reagents.add_reagent("nutriment", 25)
- reagents.add_reagent("oculine", 10)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/carrotcakeslice
- name = "Carrot Cake slice"
- desc = "Carrotty slice of Carrot Cake, carrots are good for your eyes! Also not a lie."
- icon_state = "carrotcake_slice"
- trash = /obj/item/trash/plate
- filling_color = "#FFD675"
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/braincake
- name = "Brain Cake"
- desc = "A squishy cake-thing."
- icon_state = "braincake"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/braincakeslice
- slices_num = 5
- filling_color = "#E6AEDB"
- New()
- ..()
- reagents.add_reagent("protein", 15)
- reagents.add_reagent("nutriment", 10)
- reagents.add_reagent("mannitol", 10)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/braincakeslice
- name = "Brain Cake slice"
- desc = "Lemme tell you something about prions. THEY'RE DELICIOUS."
- icon_state = "braincakeslice"
- trash = /obj/item/trash/plate
- filling_color = "#E6AEDB"
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/cheesecake
- name = "Cheese Cake"
- desc = "DANGEROUSLY cheesy."
- icon_state = "cheesecake"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/cheesecakeslice
- slices_num = 5
- filling_color = "#FAF7AF"
- New()
- ..()
- reagents.add_reagent("nutriment", 25)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/cheesecakeslice
- name = "Cheese Cake slice"
- desc = "Slice of pure cheestisfaction"
- icon_state = "cheesecake_slice"
- trash = /obj/item/trash/plate
- filling_color = "#FAF7AF"
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/plaincake
- name = "Vanilla Cake"
- desc = "A plain cake, not a lie."
- icon_state = "plaincake"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/plaincakeslice
- slices_num = 5
- filling_color = "#F7EDD5"
- New()
- ..()
- reagents.add_reagent("nutriment", 20)
-
-/obj/item/weapon/reagent_containers/food/snacks/plaincakeslice
- name = "Vanilla Cake slice"
- desc = "Just a slice of cake, it is enough for everyone."
- icon_state = "plaincake_slice"
- trash = /obj/item/trash/plate
- filling_color = "#F7EDD5"
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/orangecake
- name = "Orange Cake"
- desc = "A cake with added orange."
- icon_state = "orangecake"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/orangecakeslice
- slices_num = 5
- filling_color = "#FADA8E"
- New()
- ..()
- reagents.add_reagent("nutriment", 20)
-
-/obj/item/weapon/reagent_containers/food/snacks/orangecakeslice
- name = "Orange Cake slice"
- desc = "Just a slice of cake, it is enough for everyone."
- icon_state = "orangecake_slice"
- trash = /obj/item/trash/plate
- filling_color = "#FADA8E"
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/limecake
- name = "Lime Cake"
- desc = "A cake with added lime."
- icon_state = "limecake"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/limecakeslice
- slices_num = 5
- filling_color = "#CBFA8E"
- New()
- ..()
- reagents.add_reagent("nutriment", 20)
-
-/obj/item/weapon/reagent_containers/food/snacks/limecakeslice
- name = "Lime Cake slice"
- desc = "Just a slice of cake, it is enough for everyone."
- icon_state = "limecake_slice"
- trash = /obj/item/trash/plate
- filling_color = "#CBFA8E"
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/lemoncake
- name = "Lemon Cake"
- desc = "A cake with added lemon."
- icon_state = "lemoncake"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/lemoncakeslice
- slices_num = 5
- filling_color = "#FAFA8E"
- New()
- ..()
- reagents.add_reagent("nutriment", 20)
-
-/obj/item/weapon/reagent_containers/food/snacks/lemoncakeslice
- name = "Lemon Cake slice"
- desc = "Just a slice of cake, it is enough for everyone."
- icon_state = "lemoncake_slice"
- trash = /obj/item/trash/plate
- filling_color = "#FAFA8E"
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/chocolatecake
- name = "Chocolate Cake"
- desc = "A cake with added chocolate"
- icon_state = "chocolatecake"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/chocolatecakeslice
- slices_num = 5
- filling_color = "#805930"
- New()
- ..()
- reagents.add_reagent("nutriment", 20)
- reagents.add_reagent("chocolate",20)
-
-/obj/item/weapon/reagent_containers/food/snacks/chocolatecakeslice
- name = "Chocolate Cake slice"
- desc = "Just a slice of cake, it is enough for everyone."
- icon_state = "chocolatecake_slice"
- trash = /obj/item/trash/plate
- filling_color = "#805930"
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/cheesewheel
- name = "Cheese wheel"
- desc = "A big wheel of delcious Cheddar."
- icon_state = "cheesewheel"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/cheesewedge
- slices_num = 5
- filling_color = "#FFF700"
- New()
- ..()
- reagents.add_reagent("nutriment", 20)
- reagents.add_reagent("cheese", 20)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/cheesewedge
- name = "Cheese wedge"
- desc = "A wedge of delicious Cheddar. The cheese wheel it was cut from can't have gone far."
- icon_state = "cheesewedge"
- filling_color = "#FFF700"
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/weirdcheesewedge
- name = "Weird Cheese"
- desc = "Some kind of... gooey, messy, gloopy thing. Similar to cheese, but only in the looser sense of the word."
- icon_state = "weirdcheesewedge"
- filling_color = "#00FF33"
- bitesize = 2
- New()
- ..()
- reagents.add_reagent("mercury", 5)
- reagents.add_reagent("lsd", 5)
- reagents.add_reagent("ethanol", 5)
- reagents.add_reagent("weird_cheese", 5)
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/birthdaycake
- name = "Birthday Cake"
- desc = "Happy Birthday..."
- icon_state = "birthdaycake"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/birthdaycakeslice
- slices_num = 5
- filling_color = "#FFD6D6"
- New()
- ..()
- reagents.add_reagent("nutriment", 20)
- reagents.add_reagent("sprinkles", 10)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/birthdaycakeslice
- name = "Birthday Cake slice"
- desc = "A slice of your birthday"
- icon_state = "birthdaycakeslice"
- trash = /obj/item/trash/plate
- filling_color = "#FFD6D6"
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/bread
- name = "Bread"
- icon_state = "Some plain old Earthen bread."
- icon_state = "bread"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/breadslice
- slices_num = 6
- filling_color = "#FFE396"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- spawn(1)
- reagents.del_reagent("egg")
- reagents.update_total()
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/breadslice
- name = "Bread slice"
- desc = "A slice of home."
- icon_state = "breadslice"
- trash = /obj/item/trash/plate
- filling_color = "#D27332"
- bitesize = 2
-
- New()
- ..()
- reagents.add_reagent("bread", 5)
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/creamcheesebread
- name = "Cream Cheese Bread"
- desc = "Yum yum yum!"
- icon_state = "creamcheesebread"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/creamcheesebreadslice
- slices_num = 5
- filling_color = "#FFF896"
- New()
- ..()
- reagents.add_reagent("nutriment", 20)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/creamcheesebreadslice
- name = "Cream Cheese Bread slice"
- desc = "A slice of yum!"
- icon_state = "creamcheesebreadslice"
- trash = /obj/item/trash/plate
- filling_color = "#FFF896"
- bitesize = 2
-
-
-/obj/item/weapon/reagent_containers/food/snacks/watermelonslice
- name = "Watermelon Slice"
- desc = "A slice of watery goodness."
- icon_state = "watermelonslice"
- filling_color = "#FF3867"
- bitesize = 2
-
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/applecake
- name = "Apple Cake"
- desc = "A cake centred with Apple"
- icon_state = "applecake"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/applecakeslice
- slices_num = 5
- filling_color = "#EBF5B8"
- New()
- ..()
- reagents.add_reagent("nutriment", 15)
-
-/obj/item/weapon/reagent_containers/food/snacks/applecakeslice
- name = "Apple Cake slice"
- desc = "A slice of heavenly cake."
- icon_state = "applecakeslice"
- trash = /obj/item/trash/plate
- filling_color = "#EBF5B8"
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/pumpkinpie
- name = "Pumpkin Pie"
- desc = "A delicious treat for the autumn months."
- icon_state = "pumpkinpie"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/pumpkinpieslice
- slices_num = 5
- filling_color = "#F5B951"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 15)
-
-/obj/item/weapon/reagent_containers/food/snacks/pumpkinpieslice
- name = "Pumpkin Pie slice"
- desc = "A slice of pumpkin pie, with whipped cream on top. Perfection."
- icon_state = "pumpkinpieslice"
- trash = /obj/item/trash/plate
- filling_color = "#F5B951"
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/cracker
- name = "Cracker"
- desc = "It's a salted cracker."
- icon_state = "cracker"
- filling_color = "#F5DEB8"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 1)
-
-
-
-/////////////////////////////////////////////////PIZZA////////////////////////////////////////
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza
- slices_num = 6
- filling_color = "#BAA14C"
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/margherita
- name = "Margherita"
- desc = "The golden standard of pizzas."
- icon_state = "pizzamargherita"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/margheritaslice
- slices_num = 6
- New()
- ..()
- reagents.add_reagent("nutriment", 40)
- reagents.add_reagent("tomatojuice", 6)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/margheritaslice
- name = "Margherita slice"
- desc = "A slice of the classic pizza."
- icon_state = "pizzamargheritaslice"
- filling_color = "#BAA14C"
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/meatpizza
- name = "Meatpizza"
- desc = "A pizza with meat topping."
- icon_state = "meatpizza"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/meatpizzaslice
- slices_num = 6
- New()
- ..()
- reagents.add_reagent("protein", 30)
- reagents.add_reagent("nutriment", 20)
- reagents.add_reagent("tomatojuice", 6)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/meatpizzaslice
- name = "Meatpizza slice"
- desc = "A slice of a meaty pizza."
- icon_state = "meatpizzaslice"
- filling_color = "#BAA14C"
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/mushroompizza
- name = "Mushroompizza"
- desc = "Very special pizza"
- icon_state = "mushroompizza"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/mushroompizzaslice
- slices_num = 6
- New()
- ..()
- reagents.add_reagent("plantmatter", 25)
- reagents.add_reagent("nutriment", 10)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/mushroompizzaslice
- name = "Mushroompizza slice"
- desc = "Maybe it is the last slice of pizza in your life."
- icon_state = "mushroompizzaslice"
- filling_color = "#BAA14C"
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/vegetablepizza
- name = "Vegetable pizza"
- desc = "No one of Tomato Sapiens were harmed during making this pizza"
- icon_state = "vegetablepizza"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/vegetablepizzaslice
- slices_num = 6
- New()
- ..()
- reagents.add_reagent("plantmatter", 20)
- reagents.add_reagent("nutriment", 10)
- reagents.add_reagent("tomatojuice", 6)
- reagents.add_reagent("oculine", 12)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/vegetablepizzaslice
- name = "Vegetable pizza slice"
- desc = "A slice of the most green pizza of all pizzas not containing green ingredients "
- icon_state = "vegetablepizzaslice"
- filling_color = "#BAA14C"
- bitesize = 2
-
-/obj/item/pizzabox
- name = "pizza box"
- desc = "A box suited for pizzas."
- icon = 'icons/obj/food/food.dmi'
- icon_state = "pizzabox1"
-
- var/open = 0 // Is the box open?
- var/ismessy = 0 // Fancy mess on the lid
- var/obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/pizza // Content pizza
- var/list/boxes = list() // If the boxes are stacked, they come here
- var/boxtag = ""
-
-/obj/item/pizzabox/update_icon()
-
- overlays = list()
-
- // Set appropriate description
- if( open && pizza )
- desc = "A box suited for pizzas. It appears to have a [pizza.name] inside."
- else if( boxes.len > 0 )
- desc = "A pile of boxes suited for pizzas. There appears to be [boxes.len + 1] boxes in the pile."
-
- var/obj/item/pizzabox/topbox = boxes[boxes.len]
- var/toptag = topbox.boxtag
- if( toptag != "" )
- desc = "[desc] The box on top has a tag, it reads: '[toptag]'."
- else
- desc = "A box suited for pizzas."
-
- if( boxtag != "" )
- desc = "[desc] The box has a tag, it reads: '[boxtag]'."
-
- // Icon states and overlays
- if( open )
- if( ismessy )
- icon_state = "pizzabox_messy"
- else
- icon_state = "pizzabox_open"
-
- if( pizza )
- var/image/pizzaimg = image("food/food.dmi", icon_state = pizza.icon_state)
- pizzaimg.pixel_y = -3
- overlays += pizzaimg
-
- return
- else
- // Stupid code because byondcode sucks
- var/doimgtag = 0
- if( boxes.len > 0 )
- var/obj/item/pizzabox/topbox = boxes[boxes.len]
- if( topbox.boxtag != "" )
- doimgtag = 1
- else
- if( boxtag != "" )
- doimgtag = 1
-
- if( doimgtag )
- var/image/tagimg = image("food/food.dmi", icon_state = "pizzabox_tag")
- tagimg.pixel_y = boxes.len * 3
- overlays += tagimg
-
- icon_state = "pizzabox[boxes.len+1]"
-
-/obj/item/pizzabox/attack_hand( mob/user as mob )
-
- if( open && pizza )
- user.put_in_hands( pizza )
-
- to_chat(user, "\red You take the [src.pizza] out of the [src].")
- src.pizza = null
- update_icon()
- return
-
- if( boxes.len > 0 )
- if( user.get_inactive_hand() != src )
- ..()
- return
-
- var/obj/item/pizzabox/box = boxes[boxes.len]
- boxes -= box
-
- user.put_in_hands( box )
- to_chat(user, "\red You remove the topmost [src] from your hand.")
- box.update_icon()
- update_icon()
- return
- ..()
-
-/obj/item/pizzabox/attack_self( mob/user as mob )
-
- if( boxes.len > 0 )
- return
-
- open = !open
-
- if( open && pizza )
- ismessy = 1
-
- update_icon()
-
-/obj/item/pizzabox/attackby( obj/item/I as obj, mob/user as mob , params)
- if( istype(I, /obj/item/pizzabox/) )
- var/obj/item/pizzabox/box = I
-
- if( !box.open && !src.open )
- // Make a list of all boxes to be added
- var/list/boxestoadd = list()
- boxestoadd += box
- for(var/obj/item/pizzabox/i in box.boxes)
- boxestoadd += i
-
- if( (boxes.len+1) + boxestoadd.len <= 5 )
- user.drop_item()
-
- box.loc = src
- box.boxes = list() // Clear the box boxes so we don't have boxes inside boxes. - Xzibit
- src.boxes.Add( boxestoadd )
-
- box.update_icon()
- update_icon()
-
- to_chat(user, "\red You put the [box] ontop of the [src]!")
- else
- to_chat(user, "\red The stack is too high!")
- else
- to_chat(user, "\red Close the [box] first!")
-
- return
-
- if( istype(I, /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/) ) // Long ass fucking object name
-
- if( src.open )
- user.drop_item()
- I.loc = src
- src.pizza = I
-
- update_icon()
-
- to_chat(user, "\red You put the [I] in the [src]!")
- else
- to_chat(user, "\red You try to push the [I] through the lid but it doesn't work!")
- return
-
- if( istype(I, /obj/item/weapon/pen/) )
-
- if( src.open )
- return
-
- var/t = input("Enter what you want to add to the tag:", "Write", null, null) as text
-
- var/obj/item/pizzabox/boxtotagto = src
- if( boxes.len > 0 )
- boxtotagto = boxes[boxes.len]
-
- boxtotagto.boxtag = copytext("[boxtotagto.boxtag][t]", 1, 30)
-
- update_icon()
- return
- ..()
-
-/obj/item/pizzabox/margherita/New()
- pizza = new /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/margherita(src)
- boxtag = "Margherita Deluxe"
-
-/obj/item/pizzabox/vegetable/New()
- pizza = new /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/vegetablepizza(src)
- boxtag = "Gourmet Vegatable"
-
-/obj/item/pizzabox/mushroom/New()
- pizza = new /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/mushroompizza(src)
- boxtag = "Mushroom Special"
-
-/obj/item/pizzabox/meat/New()
- pizza = new /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/meatpizza(src)
- boxtag = "Meatlover's Supreme"
-
-////////////////////////////////FOOD ADDITIONS////////////////////////////////////////////
-
-/obj/item/weapon/reagent_containers/food/snacks/wrap
- name = "egg wrap"
- desc = "The precursor to Pigs in a Blanket."
- icon_state = "wrap"
- New()
- ..()
- reagents.add_reagent("nutriment", 5)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/beans
- name = "tin of beans"
- desc = "Musical fruit in a slightly less musical container."
- icon_state = "beans"
- New()
- ..()
- reagents.add_reagent("nutriment", 10)
- reagents.add_reagent("beans",10)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/benedict
- name = "eggs benedict"
- desc = "There is only one egg on this, how rude."
- icon_state = "benedict"
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
- reagents.add_reagent("egg", 3)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/hotdog
- name = "hotdog"
- desc = "Fresh footlong ready to go down on."
- icon_state = "hotdog"
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
- reagents.add_reagent("ketchup", 3)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/meatbun
- name = "meat bun"
- desc = "Has the potential to not be Dog."
- icon_state = "meatbun"
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- bitesize = 6
-
-/obj/item/weapon/reagent_containers/food/snacks/icecreamsandwich
- name = "icecream sandwich"
- desc = "Portable Ice-cream in it's own packaging."
- icon_state = "icecreamsandwich"
- New()
- ..()
- reagents.add_reagent("nutriment", 2)
- reagents.add_reagent("ice", 2)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/notasandwich
- name = "not-a-sandwich"
- desc = "Something seems to be wrong with this, you can't quite figure what. Maybe it's his moustache."
- icon_state = "notasandwich"
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/sugarcookie
- name = "sugar cookie"
- desc = "Just like your little sister used to make."
- icon_state = "sugarcookie"
- New()
- ..()
- reagents.add_reagent("nutriment", 2)
- reagents.add_reagent("sugar", 5)
- spawn(1)
- reagents.del_reagent("egg")
- reagents.update_total()
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/friedbanana
- name = "Fried Banana"
- desc = "Goreng Pisang, also known as fried bananas."
- icon_state = "friedbanana"
- New()
- ..()
- reagents.add_reagent("sugar", 5)
- reagents.add_reagent("nutriment", 8)
- reagents.add_reagent("cornoil", 4)
-
-/obj/item/weapon/reagent_containers/food/snacks/tofurkey
- name = "Tofurkey"
- desc = "A fake turkey made from tofu."
- icon_state = "tofurkey"
- New()
- ..()
- reagents.add_reagent("nutriment", 12)
- reagents.add_reagent("ether", 3)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/stuffing
- name = "Stuffing"
- desc = "Moist, peppery breadcrumbs for filling the body cavities of dead birds. Dig in!"
- icon_state = "stuffing"
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
- bitesize = 1
-
-/obj/item/weapon/reagent_containers/food/snacks/dionaroast
- name = "roast diona"
- desc = "It's like an enormous, leathery carrot. With an eye."
- icon_state = "dionaroast"
- trash = /obj/item/trash/plate
- filling_color = "#75754B"
-
- New()
- ..()
- reagents.add_reagent("plantmatter", 4)
- reagents.add_reagent("nutriment", 2)
- reagents.add_reagent("radium", 2)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/boiledspiderleg
- name = "boiled spider leg"
- desc = "A giant spider's leg that's still twitching after being cooked. Gross!"
- icon_state = "spiderlegcooked"
- trash = /obj/item/trash/plate
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
- reagents.add_reagent("toxin", 2)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/spidereggs
- name = "spider eggs"
- desc = "A cluster of juicy spider eggs. A great side dish for when you care not for your health."
- icon_state = "spidereggs"
- New()
- ..()
- reagents.add_reagent("protein", 2)
- reagents.add_reagent("toxin", 3)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/spidereggsham
- name = "green eggs and ham"
- desc = "Would you eat them on a train? Would you eat them on a plane? Would you eat them on a state of the art corporate deathtrap floating through space?"
- icon_state = "spidereggsham"
- trash = /obj/item/trash/plate
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- reagents.add_reagent("sodiumchloride", 1)
- reagents.add_reagent("toxin", 3)
- bitesize = 4
-
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/turkey
- name = "Turkey"
- desc = "A traditional turkey served with stuffing."
- icon_state = "turkey"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/turkeyslice
- slices_num = 6
- New()
- ..()
- reagents.add_reagent("protein", 24)
- reagents.add_reagent("nutriment", 18)
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/turkeyslice
- name = "turkey serving"
- desc = "A serving of some tender and delicious turkey."
- icon_state = "turkeyslice"
- trash = /obj/item/trash/plate
- filling_color = "#B97A57"
- bitesize = 2
-
-/obj/item/weapon/reagent_containers/food/snacks/mashed_potatoes //mashed taters
- name = "mashed potatoes"
- desc = "Some sot creamy, and irresistible mashed potatoes."
- icon_state = "mashedtaters"
- trash = /obj/item/trash/plate
- filling_color = "#D6D9C1"
- bitesize = 2
-
- New()
- ..()
- reagents.add_reagent("nutriment", 5)
- reagents.add_reagent("gravy", 5)
- reagents.add_reagent("mashedpotatoes", 10)
- bitesize = 2
-
-////////////////////////////////ICE CREAM///////////////////////////////////
-/obj/item/weapon/reagent_containers/food/snacks/icecream
- name = "ice cream"
- desc = "Delicious ice cream."
- icon = 'icons/obj/kitchen.dmi'
- icon_state = "icecream_cone"
- New()
- ..()
- reagents.add_reagent("nutriment", 1)
- reagents.add_reagent("sugar",1)
- bitesize = 1
- update_icon()
-
- update_icon()
- overlays.Cut()
- var/image/filling = image('icons/obj/kitchen.dmi', src, "icecream_color")
- filling.icon += mix_color_from_reagents(reagents.reagent_list)
- overlays += filling
-
-/obj/item/weapon/reagent_containers/food/snacks/icecream/icecreamcone
- name = "ice cream cone"
- desc = "Delicious ice cream."
- icon_state = "icecream_cone"
- volume = 50
- New()
- ..()
- reagents.add_reagent("nutriment", 2)
- reagents.add_reagent("sugar",6)
- reagents.add_reagent("ice",2)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/icecream/icecreamcup
- name = "chocolate ice cream cone"
- desc = "Delicious ice cream."
- icon_state = "icecream_cup"
- volume = 50
- New()
- ..()
- reagents.add_reagent("nutriment", 4)
- reagents.add_reagent("chocolate",8)
- reagents.add_reagent("ice",2)
- bitesize = 6
-
-/obj/item/weapon/reagent_containers/food/snacks/cereal
- name = "box of cereal"
- desc = "A box of cereal."
- icon = 'icons/obj/food/food.dmi'
- icon_state = "cereal_box"
- bitesize = 2
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
-/obj/item/weapon/reagent_containers/food/snacks/deepfryholder
- name = "Deep Fried Foods Holder Obj"
- desc = "If you can see this description the code for the deep fryer fucked up."
- icon = 'icons/obj/food/food.dmi'
- icon_state = "deepfried_holder_icon"
- bitesize = 2
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
-
-/obj/item/weapon/reagent_containers/food/snacks/dough
- name = "dough"
- desc = "A piece of dough."
- icon = 'icons/obj/food/food_ingredients.dmi'
- icon_state = "dough"
- bitesize = 2
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
-
-// Dough + rolling pin = flat dough
-/obj/item/weapon/reagent_containers/food/snacks/dough/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/weapon/kitchen/rollingpin))
- if(isturf(loc))
- new /obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough(loc)
- to_chat(user, "You flatten [src].")
- qdel(src)
- else
- to_chat(user, "You need to put [src] on a surface to roll it out!")
- else
- ..()
-
-// slicable into 3xdoughslices
-/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough
- name = "flat dough"
- desc = "Some flattened dough."
- icon = 'icons/obj/food/food_ingredients.dmi'
- icon_state = "flat dough"
- slice_path = /obj/item/weapon/reagent_containers/food/snacks/doughslice
- slices_num = 3
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
-
-/obj/item/weapon/reagent_containers/food/snacks/doughslice
- name = "dough slice"
- desc = "The building block of an impressive dish."
- icon = 'icons/obj/food/food_ingredients.dmi'
- icon_state = "doughslice"
- bitesize = 2
- New()
- ..()
- reagents.add_reagent("nutriment", 1)
-
-/obj/item/weapon/reagent_containers/food/snacks/bun
- name = "bun"
- desc = "The base for any self-respecting burger."
- icon = 'icons/obj/food/food_ingredients.dmi'
- icon_state = "bun"
- bitesize = 2
- New()
- ..()
- reagents.add_reagent("nutriment", 4)
- bitesize = 3
-
-/obj/item/weapon/reagent_containers/food/snacks/taco
- name = "taco"
- desc = "Take a bite!"
- icon_state = "taco"
- bitesize = 3
- New()
- ..()
- reagents.add_reagent("nutriment", 7)
-
-/obj/item/weapon/reagent_containers/food/snacks/rawcutlet
- name = "raw cutlet"
- desc = "A thin piece of raw meat."
- icon = 'icons/obj/food/food_ingredients.dmi'
- icon_state = "rawcutlet"
- bitesize = 1
- New()
- ..()
- reagents.add_reagent("protein", 1)
-
-/obj/item/weapon/reagent_containers/food/snacks/cutlet
- name = "cutlet"
- desc = "A tasty meat slice."
- icon = 'icons/obj/food/food_ingredients.dmi'
- icon_state = "cutlet"
- bitesize = 2
- New()
- ..()
- reagents.add_reagent("protein", 2)
-
-/obj/item/weapon/reagent_containers/food/snacks/rawmeatball
- name = "raw meatball"
- desc = "A raw meatball."
- icon = 'icons/obj/food/food_ingredients.dmi'
- icon_state = "rawmeatball"
- bitesize = 2
- New()
- ..()
- reagents.add_reagent("protein", 2)
-
-/obj/item/weapon/reagent_containers/food/snacks/hotdog
- name = "hotdog"
- desc = "Unrelated to dogs, maybe."
- icon_state = "hotdog"
- bitesize = 2
- New()
- ..()
- reagents.add_reagent("protein", 6)
-
-/obj/item/weapon/reagent_containers/food/snacks/flatbread
- name = "flatbread"
- desc = "Bland but filling."
- icon = 'icons/obj/food/food_ingredients.dmi'
- icon_state = "flatbread"
- bitesize = 2
- New()
- ..()
- reagents.add_reagent("nutriment", 3)
-
-/obj/item/weapon/reagent_containers/food/snacks/rawsticks
- name = "raw potato sticks"
- desc = "Raw fries, not very tasty."
- icon = 'icons/obj/food/food_ingredients.dmi'
- icon_state = "rawsticks"
- bitesize = 2
- New()
- ..()
- reagents.add_reagent("plantmatter", 3)
-
-/obj/item/weapon/reagent_containers/food/snacks/ectoplasm
- name = "ectoplasm"
- desc = "A luminescent blob of what scientists refer to as 'ghost goo'."
- icon = 'icons/obj/wizard.dmi'
- icon_state = "ectoplasm"
- New()
- ..()
- reagents.add_reagent("ectoplasm", 10)
-
-/obj/item/weapon/reagent_containers/food/snacks/liquidfood
- name = "\improper LiquidFood Ration"
- desc = "A prepackaged grey slurry of all the essential nutrients for a spacefarer on the go. Should this be crunchy?"
- icon_state = "liquidfood"
- trash = /obj/item/trash/liquidfood
- filling_color = "#A8A8A8"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 20)
- reagents.add_reagent("iron", 3)
- bitesize = 4
-
-
-/obj/item/weapon/reagent_containers/food/snacks/tastybread
- name = "bread tube"
- desc = "Bread in a tube. Chewy...and surprisingly tasty."
- icon_state = "tastybread"
- trash = /obj/item/trash/tastybread
- filling_color = "#A66829"
-
- New()
- ..()
- reagents.add_reagent("nutriment", 6)
- bitesize = 2
\ No newline at end of file
+//Food items that are eaten normally and don't leave anything behind.
+/obj/item/weapon/reagent_containers/food/snacks
+ name = "snack"
+ desc = "yummy"
+ icon = 'icons/obj/food/food.dmi'
+ icon_state = null
+ bitesize = 1
+ var/bitecount = 0
+ var/trash = null
+ var/slice_path
+ var/slices_num
+ var/eatverb
+ var/wrapped = 0
+ var/dried_type = null
+ var/cooktype[0]
+
+
+ //Placeholder for effect that trigger on eating that aren't tied to reagents.
+/obj/item/weapon/reagent_containers/food/snacks/proc/On_Consume(mob/M, mob/user)
+ if(!user)
+ return
+ spawn(0)
+ if(!reagents.total_volume)
+ if(M == user)
+ to_chat(user, "You finish eating \the [src].")
+ user.visible_message("[user] finishes eating \the [src].")
+ user.unEquip(src) //so icons update :[
+ Post_Consume(M)
+ if(trash)
+ if(ispath(trash,/obj/item))
+ var/obj/item/TrashItem = new trash(user)
+ user.put_in_hands(TrashItem)
+ else if(istype(trash,/obj/item))
+ user.put_in_hands(trash)
+ qdel(src)
+ return
+
+/obj/item/weapon/reagent_containers/food/snacks/proc/Post_Consume(mob/living/M)
+ return
+
+/obj/item/weapon/reagent_containers/food/snacks/attack_self(mob/user as mob)
+ return
+
+/obj/item/weapon/reagent_containers/food/snacks/attack(mob/M as mob, mob/user as mob, def_zone)
+ if(reagents && !reagents.total_volume) //Shouldn't be needed but it checks to see if it has anything left in it.
+ to_chat(user, "None of [src] left, oh no!")
+ M.unEquip(src) //so icons update :[
+ qdel(src)
+ return 0
+
+ if(istype(M, /mob/living/carbon))
+ var/mob/living/carbon/C = M
+ if(C.eat(src, user))
+ bitecount++
+ On_Consume(C, user)
+ return 1
+ return 0
+
+/obj/item/weapon/reagent_containers/food/snacks/afterattack(obj/target, mob/user, proximity)
+ return
+
+/obj/item/weapon/reagent_containers/food/snacks/examine(mob/user)
+ if(..(user, 0))
+ if(bitecount==0)
+ return
+ else if(bitecount==1)
+ to_chat(user, "\blue \The [src] was bitten by someone!")
+ else if(bitecount<=3)
+ to_chat(user, "\blue \The [src] was bitten [bitecount] times!")
+ else
+ to_chat(user, "\blue \The [src] was bitten multiple times!")
+
+
+/obj/item/weapon/reagent_containers/food/snacks/attackby(obj/item/weapon/W, mob/user, params)
+ if(istype(W,/obj/item/weapon/pen))
+ var/n_name = sanitize(copytext(input(usr, "What would you like to name this dish?", "Food Renaming", null) as text, 1, MAX_NAME_LEN))
+ if((loc == usr && usr.stat == 0))
+ name = "[n_name]"
+ return
+ if(istype(W,/obj/item/weapon/storage))
+ ..() // -> item/attackby(, params)
+
+ if(istype(W,/obj/item/weapon/kitchen/utensil))
+
+ var/obj/item/weapon/kitchen/utensil/U = W
+
+ if(U.contents.len >= U.max_contents)
+ to_chat(user, "You cannot fit anything else on your [U].")
+ return
+
+ user.visible_message( \
+ "[user] scoops up some [src] with \the [U]!", \
+ "You scoop up some [src] with \the [U]!" \
+ )
+
+ src.bitecount++
+ U.overlays.Cut()
+ var/image/I = new(U.icon, "loadedfood")
+ I.color = src.filling_color
+ U.overlays += I
+
+ var/obj/item/weapon/reagent_containers/food/snacks/collected = new type
+ collected.loc = U
+ collected.reagents.remove_any(collected.reagents.total_volume)
+ collected.trash = null
+ if(reagents.total_volume > bitesize)
+ reagents.trans_to(collected, bitesize)
+ else
+ reagents.trans_to(collected, reagents.total_volume)
+ if(trash)
+ var/obj/item/TrashItem
+ if(ispath(trash,/obj/item))
+ TrashItem = new trash(src)
+ else if(istype(trash,/obj/item))
+ TrashItem = trash
+ TrashItem.forceMove(loc)
+ qdel(src)
+ return 1
+
+ if((slices_num <= 0 || !slices_num) || !slice_path)
+ return 0
+
+ var/inaccurate = 0
+ if( \
+ istype(W, /obj/item/weapon/kitchen/knife) || \
+ istype(W, /obj/item/weapon/scalpel) \
+ )
+ else if( \
+ istype(W, /obj/item/weapon/circular_saw) || \
+ istype(W, /obj/item/weapon/melee/energy/sword/saber) && W:active || \
+ istype(W, /obj/item/weapon/melee/energy/blade) || \
+ istype(W, /obj/item/weapon/shovel) || \
+ istype(W, /obj/item/weapon/hatchet) \
+ )
+ inaccurate = 1
+ else if(W.w_class <= 2 && istype(src,/obj/item/weapon/reagent_containers/food/snacks/sliceable))
+ if(!iscarbon(user))
+ return 1
+ to_chat(user, "\red You slip [W] inside [src].")
+ user.unEquip(W)
+ if((user.client && user.s_active != src))
+ user.client.screen -= W
+ W.dropped(user)
+ add_fingerprint(user)
+ contents += W
+ return
+ else
+ return 1
+ if( \
+ !isturf(src.loc) || \
+ !(locate(/obj/structure/table) in src.loc) && \
+ !(locate(/obj/machinery/optable) in src.loc) && \
+ !(locate(/obj/item/weapon/storage/bag/tray) in src.loc) \
+ )
+ to_chat(user, "\red You cannot slice [src] here! You need a table or at least a tray to do it.")
+ return 1
+ var/slices_lost = 0
+ if(!inaccurate)
+ user.visible_message( \
+ "\blue [user] slices \the [src]!", \
+ "\blue You slice \the [src]!" \
+ )
+ else
+ user.visible_message( \
+ "\blue [user] crudely slices \the [src] with [W]!", \
+ "\blue You crudely slice \the [src] with your [W]!" \
+ )
+ slices_lost = rand(1,min(1,round(slices_num/2)))
+ var/reagents_per_slice = reagents.total_volume/slices_num
+ for(var/i=1 to (slices_num-slices_lost))
+ var/obj/slice = new slice_path (src.loc)
+ reagents.trans_to(slice,reagents_per_slice)
+ qdel(src)
+
+ return
+
+/obj/item/weapon/reagent_containers/food/snacks/Destroy()
+ if(contents)
+ for(var/atom/movable/something in contents)
+ something.loc = get_turf(src)
+ return ..()
+
+/obj/item/weapon/reagent_containers/food/snacks/attack_animal(mob/M)
+ if(isanimal(M))
+ M.changeNext_move(CLICK_CD_MELEE)
+ if(iscorgi(M))
+ if(bitecount >= 4)
+ M.visible_message("[M] [pick("burps from enjoyment", "yaps for more", "woofs twice", "looks at the area where \the [src] was")].","You swallow up the last part of \the [src].")
+ playsound(src.loc,'sound/items/eatfood.ogg', rand(10,50), 1)
+ var/mob/living/simple_animal/pet/corgi/C = M
+ C.adjustBruteLoss(-5)
+ C.adjustFireLoss(-5)
+ qdel(src)
+ else
+ M.visible_message("[M] takes a bite of \the [src].","You take a bite of \the [src].")
+ playsound(src.loc,'sound/items/eatfood.ogg', rand(10,50), 1)
+ bitecount++
+ else if(ismouse(M))
+ var/mob/living/simple_animal/mouse/N = M
+ to_chat(N, text("\blue You nibble away at [src]."))
+ if(prob(50))
+ N.visible_message("[N] nibbles away at [src].", "")
+ //N.emote("nibbles away at the [src]")
+ N.adjustBruteLoss(-1)
+ N.adjustFireLoss(-1)
+
+
+////////////////////////////////////////////////////////////////////////////////
+/// FOOD END
+////////////////////////////////////////////////////////////////////////////////
+
+
+
+
+
+
+
+
+
+
+
+//////////////////////////////////////////////////
+////////////////////////////////////////////Snacks
+//////////////////////////////////////////////////
+//Items in the "Snacks" subcategory are food items that people actually eat. The key points are that they are created
+// already filled with reagents and are destroyed when empty. Additionally, they make a "munching" noise when eaten.
+
+//Notes by Darem: Food in the "snacks" subtype can hold a maximum of 50 units Generally speaking, you don't want to go over 40
+// total for the item because you want to leave space for extra condiments. If you want effect besides healing, add a reagent for
+// it. Try to stick to existing reagents when possible (so if you want a stronger healing effect, just use Tricordrazine). On use
+// effect (such as the old officer eating a donut code) requires a unique reagent (unless you can figure out a better way).
+
+//The nutriment reagent and bitesize variable replace the old heal_amt and amount variables. Each unit of nutriment is equal to
+// 2 of the old heal_amt variable. Bitesize is the rate at which the reagents are consumed. So if you have 6 nutriment and a
+// bitesize of 2, then it'll take 3 bites to eat. Unlike the old system, the contained reagents are evenly spread among all
+// the bites. No more contained reagents = no more bites.
+
+//Here is an example of the new formatting for anyone who wants to add more food items.
+///obj/item/weapon/reagent_containers/food/snacks/xenoburger //Identification path for the object.
+// name = "Xenoburger" //Name that displays in the UI.
+// desc = "Smells caustic. Tastes like heresy." //Duh
+// icon_state = "xburger" //Refers to an icon in food/food.dmi
+// New() //Don't mess with this.
+// ..() //Same here.
+// reagents.add_reagent("xenomicrobes", 10) //This is what is in the food item. you may copy/paste
+// reagents.add_reagent("nutriment", 2) // this line of code for all the contents.
+// bitesize = 3 //This is the amount each bite consumes.
+
+
+
+
+/obj/item/weapon/reagent_containers/food/snacks/aesirsalad
+ name = "Aesir salad"
+ desc = "Probably too incredible for mortal men to fully enjoy."
+ icon_state = "aesirsalad"
+ trash = /obj/item/trash/snack_bowl
+ filling_color = "#468C00"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 8)
+ reagents.add_reagent("omnizine", 8)
+ bitesize = 3
+
+/*
+/obj/item/weapon/reagent_containers/food/snacks/candy
+ name = "candy"
+ desc = "Nougat, love it or hate it."
+ icon_state = "candy"
+ trash = /obj/item/trash/candy
+ filling_color = "#7D5F46"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 1)
+ reagents.add_reagent("sugar", 3)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/candy/donor
+ name = "Donor Candy"
+ desc = "A little treat for blood donors."
+ trash = /obj/item/trash/candy
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 10)
+ reagents.add_reagent("sugar", 3)
+ bitesize = 5
+
+/obj/item/weapon/reagent_containers/food/snacks/candy_corn
+ name = "candy corn"
+ desc = "It's a handful of candy corn. Cannot be stored in a detective's hat, alas."
+ icon_state = "candy_corn"
+ filling_color = "#FFFCB0"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 4)
+ reagents.add_reagent("sugar", 2)
+ bitesize = 2
+*/
+
+/obj/item/weapon/reagent_containers/food/snacks/chips
+ name = "chips"
+ desc = "Commander Riker's What-The-Crisps"
+ icon_state = "chips"
+ trash = /obj/item/trash/chips
+ filling_color = "#E8C31E"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+ reagents.add_reagent("sodiumchloride", 1)
+ bitesize = 1
+
+/obj/item/weapon/reagent_containers/food/snacks/cornchips
+ name = "corn chips"
+ desc = "Goes great with salsa! OLE!"
+ icon_state = "chips"
+ trash = /obj/item/trash/chips
+ filling_color = "#E8C31E"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+ bitesize = 1
+
+/obj/item/weapon/reagent_containers/food/snacks/cookie
+ name = "cookie"
+ desc = "COOKIE!!!"
+ icon_state = "COOKIE!!!"
+ filling_color = "#DBC94F"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 5)
+ bitesize = 1
+
+/obj/item/weapon/reagent_containers/food/snacks/chocolatebar
+ name = "Chocolate Bar"
+ desc = "Such sweet, fattening food."
+ icon_state = "chocolatebar"
+ filling_color = "#7D5F46"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 2)
+ reagents.add_reagent("chocolate",4)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/choc_pile //for reagent chocolate being spilled on turfs
+ name = "Pile of Chocolate"
+ desc = "A pile of pure chocolate pieces."
+ icon_state = "cocoa"
+ filling_color = "#7D5F46"
+
+ New()
+ ..()
+ reagents.add_reagent("chocolate",5) //no longer can be used to generate the reagent infinitely
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/chocolateegg
+ name = "Chocolate Egg"
+ desc = "Such sweet, fattening food."
+ icon_state = "chocolateegg"
+ filling_color = "#7D5F46"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+ reagents.add_reagent("chocolate",4)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/donut
+ name = "donut"
+ desc = "Goes great with Robust Coffee."
+ icon_state = "donut1"
+ filling_color = "#D9C386"
+
+/obj/item/weapon/reagent_containers/food/snacks/donut/normal
+ name = "donut"
+ desc = "Goes great with Robust Coffee."
+ icon_state = "donut1"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+ reagents.add_reagent("sprinkles", 1)
+ src.bitesize = 3
+ if(prob(30))
+ src.icon_state = "donut2"
+ src.name = "frosted donut"
+ reagents.add_reagent("sprinkles", 2)
+
+/obj/item/weapon/reagent_containers/food/snacks/donut/sprinkles
+ name = "frosted donut"
+ icon_state = "donut2"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+ reagents.add_reagent("sprinkles", 3)
+
+/obj/item/weapon/reagent_containers/food/snacks/donut/chaos
+ name = "Chaos Donut"
+ desc = "Like life, it never quite tastes the same."
+ icon_state = "donut1"
+ filling_color = "#ED11E6"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 2)
+ reagents.add_reagent("sprinkles", 1)
+ bitesize = 10
+ var/chaosselect = pick(1,2,3,4,5,6,7,8,9,10)
+ switch(chaosselect)
+ if(1)
+ reagents.add_reagent("nutriment", 3)
+ if(2)
+ reagents.add_reagent("capsaicin", 3)
+ if(3)
+ reagents.add_reagent("frostoil", 3)
+ if(4)
+ reagents.add_reagent("sprinkles", 3)
+ if(5)
+ reagents.add_reagent("plasma", 3)
+ if(6)
+ reagents.add_reagent("chocolate", 3)
+ if(7)
+ reagents.add_reagent("slimejelly", 3)
+ if(8)
+ reagents.add_reagent("banana", 3)
+ if(9)
+ reagents.add_reagent("berryjuice", 3)
+ if(10)
+ reagents.add_reagent("omnizine", 3)
+ if(prob(30))
+ src.icon_state = "donut2"
+ src.name = "Frosted Chaos Donut"
+ reagents.add_reagent("sprinkles", 2)
+
+
+/obj/item/weapon/reagent_containers/food/snacks/donut/jelly
+ name = "Jelly Donut"
+ desc = "You jelly?"
+ icon_state = "jdonut1"
+ filling_color = "#ED1169"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+ reagents.add_reagent("sprinkles", 1)
+ reagents.add_reagent("berryjuice", 5)
+ bitesize = 5
+ if(prob(30))
+ src.icon_state = "jdonut2"
+ src.name = "Frosted Jelly Donut"
+ reagents.add_reagent("sprinkles", 2)
+
+/obj/item/weapon/reagent_containers/food/snacks/donut/slimejelly
+ name = "Jelly Donut"
+ desc = "You jelly?"
+ icon_state = "jdonut1"
+ filling_color = "#ED1169"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+ reagents.add_reagent("sprinkles", 1)
+ reagents.add_reagent("slimejelly", 5)
+ bitesize = 5
+ if(prob(30))
+ src.icon_state = "jdonut2"
+ src.name = "Frosted Jelly Donut"
+ reagents.add_reagent("sprinkles", 2)
+
+/obj/item/weapon/reagent_containers/food/snacks/donut/cherryjelly
+ name = "Jelly Donut"
+ desc = "You jelly?"
+ icon_state = "jdonut1"
+ filling_color = "#ED1169"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+ reagents.add_reagent("sprinkles", 1)
+ reagents.add_reagent("cherryjelly", 5)
+ bitesize = 5
+ if(prob(30))
+ src.icon_state = "jdonut2"
+ src.name = "Frosted Jelly Donut"
+ reagents.add_reagent("sprinkles", 2)
+
+/obj/item/weapon/reagent_containers/food/snacks/egg
+ name = "egg"
+ desc = "An egg!"
+ icon_state = "egg"
+ filling_color = "#FDFFD1"
+
+ New()
+ ..()
+ reagents.add_reagent("protein", 1)
+ reagents.add_reagent("egg", 5)
+
+ throw_impact(atom/hit_atom)
+ ..()
+ var/turf/T = get_turf(hit_atom)
+ new/obj/effect/decal/cleanable/egg_smudge(T)
+ if(reagents)
+ reagents.reaction(hit_atom, TOUCH)
+ qdel(src)
+
+ attackby(obj/item/weapon/W as obj, mob/user as mob, params)
+ if(istype( W, /obj/item/toy/crayon ))
+ var/obj/item/toy/crayon/C = W
+ var/clr = C.colourName
+
+ if(!(clr in list("blue","green","mime","orange","purple","rainbow","red","yellow")))
+ to_chat(usr, "\blue The egg refuses to take on this color!")
+ return
+
+ to_chat(usr, "\blue You color \the [src] [clr]")
+ icon_state = "egg-[clr]"
+ item_color = clr
+ else
+ ..()
+
+/obj/item/weapon/reagent_containers/food/snacks/egg/blue
+ icon_state = "egg-blue"
+ item_color = "blue"
+
+/obj/item/weapon/reagent_containers/food/snacks/egg/green
+ icon_state = "egg-green"
+ item_color = "green"
+
+/obj/item/weapon/reagent_containers/food/snacks/egg/mime
+ icon_state = "egg-mime"
+ item_color = "mime"
+
+/obj/item/weapon/reagent_containers/food/snacks/egg/orange
+ icon_state = "egg-orange"
+ item_color = "orange"
+
+/obj/item/weapon/reagent_containers/food/snacks/egg/purple
+ icon_state = "egg-purple"
+ item_color = "purple"
+
+/obj/item/weapon/reagent_containers/food/snacks/egg/rainbow
+ icon_state = "egg-rainbow"
+ item_color = "rainbow"
+
+/obj/item/weapon/reagent_containers/food/snacks/egg/red
+ icon_state = "egg-red"
+ item_color = "red"
+
+/obj/item/weapon/reagent_containers/food/snacks/egg/yellow
+ icon_state = "egg-yellow"
+ item_color = "yellow"
+
+/obj/item/weapon/reagent_containers/food/snacks/friedegg
+ name = "Fried egg"
+ desc = "A fried egg, with a touch of salt and pepper."
+ icon_state = "friedegg"
+ filling_color = "#FFDF78"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 2)
+ reagents.add_reagent("egg", 5)
+ reagents.add_reagent("sodiumchloride", 1)
+ reagents.add_reagent("blackpepper", 1)
+ bitesize = 1
+
+/obj/item/weapon/reagent_containers/food/snacks/boiledegg
+ name = "Boiled egg"
+ desc = "A hard boiled egg."
+ icon_state = "egg"
+ filling_color = "#FFFFFF"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 2)
+ reagents.add_reagent("egg", 5)
+
+/obj/item/weapon/reagent_containers/food/snacks/organ
+
+ name = "organ"
+ desc = "It's good for you."
+ icon = 'icons/obj/surgery.dmi'
+ icon_state = "appendix"
+ filling_color = "#E00D34"
+
+ New()
+ ..()
+ reagents.add_reagent("protein", 4)
+ src.bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/appendix
+//yes, this is the same as meat. I might do something different in future
+ name = "appendix"
+ desc = "An appendix which looks perfectly healthy."
+ icon = 'icons/obj/surgery.dmi'
+ icon_state = "appendix"
+ filling_color = "#E00D34"
+
+ New()
+ ..()
+ reagents.add_reagent("protein", 3)
+ src.bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/appendix/inflamed
+ name = "inflamed appendix"
+ desc = "An appendix which appears to be inflamed."
+ icon_state = "appendixinflamed"
+ filling_color = "#E00D7A"
+
+/obj/item/weapon/reagent_containers/food/snacks/tofu
+ name = "Tofu"
+ icon_state = "tofu"
+ desc = "We all love tofu."
+ filling_color = "#FFFEE0"
+
+ New()
+ ..()
+ reagents.add_reagent("plantmatter", 3)
+ src.bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/fried_tofu
+ name = "Fried Tofu"
+ icon_state = "tofu"
+ desc = "Proof that even vegetarians crave unhealthy foods."
+ filling_color = "#FFFEE0"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+ src.bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/tofurkey
+ name = "Tofurkey"
+ desc = "A fake turkey made from tofu."
+ icon_state = "tofurkey"
+ filling_color = "#FFFEE0"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 12)
+ reagents.add_reagent("ether", 3)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/stuffing
+ name = "Stuffing"
+ desc = "Moist, peppery breadcrumbs for filling the body cavities of dead birds. Dig in!"
+ icon_state = "stuffing"
+ filling_color = "#C9AC83"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+ bitesize = 1
+
+/obj/item/weapon/reagent_containers/food/snacks/hugemushroomslice
+ name = "huge mushroom slice"
+ desc = "A slice from a huge mushroom."
+ icon_state = "hugemushroomslice"
+ filling_color = "#E0D7C5"
+
+ New()
+ ..()
+ reagents.add_reagent("plantmatter", 3)
+ reagents.add_reagent("psilocybin", 3)
+ src.bitesize = 6
+
+/obj/item/weapon/reagent_containers/food/snacks/tomatomeat
+ name = "tomato slice"
+ desc = "A slice from a huge tomato"
+ icon_state = "tomatomeat"
+ filling_color = "#DB0000"
+
+ New()
+ ..()
+ reagents.add_reagent("protein", 3)
+ src.bitesize = 6
+
+/obj/item/weapon/reagent_containers/food/snacks/bearmeat
+ name = "bear meat"
+ desc = "A very manly slab of meat."
+ icon_state = "bearmeat"
+ filling_color = "#DB0000"
+
+ New()
+ ..()
+ reagents.add_reagent("protein", 12)
+ reagents.add_reagent("methamphetamine", 5)
+ src.bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/xenomeat
+ name = "meat"
+ desc = "A slab of meat"
+ icon_state = "xenomeat"
+ filling_color = "#43DE18"
+
+ New()
+ ..()
+ reagents.add_reagent("protein", 3)
+ src.bitesize = 6
+
+/obj/item/weapon/reagent_containers/food/snacks/spidermeat
+ name = "spider meat"
+ desc = "A slab of spider meat."
+ icon_state = "spidermeat"
+ New()
+ ..()
+ reagents.add_reagent("protein", 3)
+ reagents.add_reagent("toxin", 3)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/lizardmeat
+ name = "mutant lizard meat"
+ desc = "Seems to be a slab of meat from some mutant lizard thing?"
+ icon_state = "xenomeat"
+ filling_color = "#43DE18"
+
+ New()
+ ..()
+ reagents.add_reagent("protein", 3)
+ reagents.add_reagent("toxin", 3)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/spiderleg
+ name = "spider leg"
+ desc = "A still twitching leg of a giant spider... you don't really want to eat this, do you?"
+ icon_state = "spiderleg"
+ New()
+ ..()
+ reagents.add_reagent("protein", 2)
+ reagents.add_reagent("toxin", 2)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/meatball
+ name = "Meatball"
+ desc = "A great meal all round."
+ icon_state = "meatball"
+ filling_color = "#DB0000"
+ New()
+ ..()
+ reagents.add_reagent("protein", 3)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/sausage
+ name = "Sausage"
+ desc = "A piece of mixed, long meat."
+ icon_state = "sausage"
+ filling_color = "#DB0000"
+
+ New()
+ ..()
+ reagents.add_reagent("protein", 6)
+ reagents.add_reagent("porktonium", 10)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/donkpocket
+ name = "Donk-pocket"
+ desc = "The food of choice for the seasoned traitor."
+ icon_state = "donkpocket"
+ filling_color = "#DEDEAB"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 4)
+
+/obj/item/weapon/reagent_containers/food/snacks/warmdonkpocket
+ name = "Warm Donk-pocket"
+ desc = "The food of choice for the seasoned traitor."
+ icon_state = "donkpocket"
+ filling_color = "#DEDEAB"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 4)
+
+ Post_Consume(mob/living/M)
+ M.reagents.add_reagent("omnizine", 15)
+
+/obj/item/weapon/reagent_containers/food/snacks/syndidonkpocket
+ name = "Donk-pocket"
+ desc = "This donk-pocket is emitting a small amount of heat."
+ icon_state = "donkpocket"
+ filling_color = "#DEDEAB"
+ bitesize = 100 //nom the whole thing at once.
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 1)
+
+ Post_Consume(mob/living/M)
+ M.reagents.add_reagent("omnizine", 15)
+ M.reagents.add_reagent("teporone", 15)
+ M.reagents.add_reagent("synaptizine", 15)
+ M.reagents.add_reagent("salglu_solution", 15)
+ M.reagents.add_reagent("salbutamol", 15)
+ M.reagents.add_reagent("methamphetamine", 15)
+
+/obj/item/weapon/reagent_containers/food/snacks/brainburger
+ name = "brainburger"
+ desc = "A strange looking burger. It looks almost sentient."
+ icon_state = "brainburger"
+ filling_color = "#F2B6EA"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ reagents.add_reagent("prions", 10)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/ghostburger
+ name = "Ghost Burger"
+ desc = "Spooky! It doesn't look very filling."
+ icon_state = "ghostburger"
+ filling_color = "#FFF2FF"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 2)
+ bitesize = 2
+
+
+/obj/item/weapon/reagent_containers/food/snacks/human
+ var/hname = ""
+ var/job = null
+ filling_color = "#D63C3C"
+
+/obj/item/weapon/reagent_containers/food/snacks/human/burger
+ name = "-burger"
+ desc = "A bloody burger."
+ icon_state = "hburger"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/cheeseburger
+ name = "cheeseburger"
+ desc = "The cheese adds a good flavor."
+ icon_state = "cheeseburger"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 2)
+
+/obj/item/weapon/reagent_containers/food/snacks/monkeyburger
+ name = "burger"
+ desc = "The cornerstone of every nutritious breakfast."
+ icon_state = "hburger"
+ filling_color = "#D63C3C"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/tofuburger
+ name = "Tofu Burger"
+ desc = "What.. is that meat?"
+ icon_state = "tofuburger"
+ filling_color = "#FFFEE0"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/roburger
+ name = "roburger"
+ desc = "The lettuce is the only organic component. Beep."
+ icon_state = "roburger"
+ filling_color = "#CCCCCC"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 2)
+ reagents.add_reagent("nanomachines", 10)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/roburgerbig
+ name = "roburger"
+ desc = "This massive patty looks like poison. Beep."
+ icon_state = "roburger"
+ filling_color = "#CCCCCC"
+ volume = 100
+
+ New()
+ ..()
+ reagents.add_reagent("nanomachines", 100)
+ bitesize = 0.1
+
+/obj/item/weapon/reagent_containers/food/snacks/xenoburger
+ name = "xenoburger"
+ desc = "Smells caustic. Tastes like heresy."
+ icon_state = "xburger"
+ filling_color = "#43DE18"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 8)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/clownburger
+ name = "Clown Burger"
+ desc = "This tastes funny..."
+ icon_state = "clownburger"
+ filling_color = "#FF00FF"
+
+ New()
+ ..()
+/*
+ var/datum/disease/F = new /datum/disease/pierrot_throat(0)
+ var/list/data = list("viruses"= list(F))
+ reagents.add_reagent("blood", 4, data)
+*/
+ reagents.add_reagent("nutriment", 6)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/mimeburger
+ name = "Mime Burger"
+ desc = "Its taste defies language."
+ icon_state = "mimeburger"
+ filling_color = "#FFFFFF"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/omelette
+ name = "Omelette Du Fromage"
+ desc = "That's all you can say!"
+ icon_state = "omelette"
+ trash = /obj/item/trash/plate
+ filling_color = "#FFF9A8"
+
+ //var/herp = 0
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 8)
+ bitesize = 1
+
+/obj/item/weapon/reagent_containers/food/snacks/muffin
+ name = "Muffin"
+ desc = "A delicious and spongy little cake"
+ icon_state = "muffin"
+ filling_color = "#E0CF9B"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/pie
+ name = "Banana Cream Pie"
+ desc = "Just like back home, on clown planet! HONK!"
+ icon_state = "pie"
+ trash = /obj/item/trash/plate
+ filling_color = "#FBFFB8"
+
+/obj/item/weapon/reagent_containers/food/snacks/pie/New()
+ ..()
+ reagents.add_reagent("nutriment", 4)
+ reagents.add_reagent("banana",5)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/pie/throw_impact(atom/hit_atom)
+ ..()
+ new/obj/effect/decal/cleanable/pie_smudge(src.loc)
+ src.visible_message("\red [src.name] splats.","\red You hear a splat.")
+ qdel(src)
+
+/obj/item/weapon/reagent_containers/food/snacks/berryclafoutis
+ name = "Berry Clafoutis"
+ desc = "No black birds, this is a good sign."
+ icon_state = "berryclafoutis"
+ trash = /obj/item/trash/plate
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 4)
+ reagents.add_reagent("berryjuice", 5)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/waffles
+ name = "waffles"
+ desc = "Mmm, waffles"
+ icon_state = "waffles"
+ trash = /obj/item/trash/waffles
+ filling_color = "#E6DEB5"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 8)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/eggplantparm
+ name = "Eggplant Parmigiana"
+ desc = "The only good recipe for eggplant."
+ icon_state = "eggplantparm"
+ trash = /obj/item/trash/plate
+ filling_color = "#4D2F5E"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/soylentgreen
+ name = "Soylent Green"
+ desc = "Not made of people. Honest." //Totally people.
+ icon_state = "soylent_green"
+ trash = /obj/item/trash/waffles
+ filling_color = "#B8E6B5"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 10)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/soylenviridians
+ name = "Soylen Virdians"
+ desc = "Not made of people. Honest." //Actually honest for once.
+ icon_state = "soylent_yellow"
+ trash = /obj/item/trash/waffles
+ filling_color = "#E6FA61"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 10)
+ bitesize = 2
+
+
+/obj/item/weapon/reagent_containers/food/snacks/meatpie
+ name = "Meat-pie"
+ icon_state = "meatpie"
+ desc = "An old barber recipe, very delicious!"
+ trash = /obj/item/trash/plate
+ filling_color = "#948051"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 10)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/tofupie
+ name = "Tofu-pie"
+ icon_state = "meatpie"
+ desc = "A delicious tofu pie."
+ trash = /obj/item/trash/plate
+ filling_color = "#FFFEE0"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 10)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/amanita_pie
+ name = "amanita pie"
+ desc = "Sweet and tasty poison pie."
+ icon_state = "amanita_pie"
+ filling_color = "#FFCCCC"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 5)
+ reagents.add_reagent("amanitin", 3)
+ reagents.add_reagent("psilocybin", 1)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/plump_pie
+ name = "plump pie"
+ desc = "I bet you love stuff made out of plump helmets!"
+ icon_state = "plump_pie"
+ filling_color = "#B8279B"
+
+ New()
+ ..()
+ if(prob(10))
+ name = "exceptional plump pie"
+ desc = "Microwave is taken by a fey mood! It has cooked an exceptional plump pie!"
+ reagents.add_reagent("nutriment", 8)
+ reagents.add_reagent("omnizine", 5)
+ bitesize = 2
+ else
+ reagents.add_reagent("nutriment", 8)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/xemeatpie
+ name = "Xeno-pie"
+ icon_state = "xenomeatpie"
+ desc = "A delicious meatpie. Probably heretical."
+ trash = /obj/item/trash/plate
+ filling_color = "#43DE18"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 10)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/wingfangchu
+ name = "Wing Fang Chu"
+ desc = "A savory dish of alien wing wang in soy."
+ icon_state = "wingfangchu"
+ trash = /obj/item/trash/snack_bowl
+ filling_color = "#43DE18"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ bitesize = 2
+
+
+/obj/item/weapon/reagent_containers/food/snacks/human/kabob
+ name = "-kabob"
+ icon_state = "kabob"
+ desc = "A human meat, on a stick."
+ trash = /obj/item/stack/rods
+ filling_color = "#A85340"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 8)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/monkeykabob
+ name = "Meat-kabob"
+ icon_state = "kabob"
+ desc = "Delicious meat, on a stick."
+ trash = /obj/item/stack/rods
+ filling_color = "#A85340"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 8)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/tofukabob
+ name = "Tofu-kabob"
+ icon_state = "kabob"
+ desc = "Vegan meat, on a stick."
+ trash = /obj/item/stack/rods
+ filling_color = "#FFFEE0"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 8)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/popcorn
+ name = "Popcorn"
+ desc = "Now let's find some cinema."
+ icon_state = "popcorn"
+ trash = /obj/item/trash/popcorn
+ var/unpopped = 0
+ filling_color = "#FFFAD4"
+
+ New()
+ ..()
+ unpopped = rand(1,10)
+ reagents.add_reagent("nutriment", 2)
+ bitesize = 0.1 //this snack is supposed to be eating during looooong time. And this it not dinner food! --rastaf0
+ On_Consume(mob/M, mob/user)
+ if(prob(unpopped)) //lol ...what's the point?
+ to_chat(user, "\red You bite down on an un-popped kernel!")
+ unpopped = max(0, unpopped-1)
+ ..()
+
+
+/obj/item/weapon/reagent_containers/food/snacks/sosjerky
+ name = "Scaredy's Private Reserve Beef Jerky"
+ icon_state = "sosjerky"
+ desc = "Beef jerky made from the finest space cows."
+ trash = /obj/item/trash/sosjerky
+ filling_color = "#631212"
+
+ New()
+ ..()
+ reagents.add_reagent("protein", 4)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/pistachios
+ name = "Pistachios"
+ icon_state = "pistachios"
+ desc = "A snack of deliciously salted pistachios. A perfectly valid choice..."
+ trash = /obj/item/trash/pistachios
+ filling_color = "#BAD145"
+
+ New()
+ ..()
+ reagents.add_reagent("plantmatter", 6)
+ reagents.add_reagent("sodiumchloride", 1)
+
+/obj/item/weapon/reagent_containers/food/snacks/no_raisin
+ name = "4no Raisins"
+ icon_state = "4no_raisins"
+ desc = "Best raisins in the universe. Not sure why."
+ trash = /obj/item/trash/raisins
+ filling_color = "#343834"
+
+ New()
+ ..()
+ reagents.add_reagent("plantmatter", 6)
+
+/obj/item/weapon/reagent_containers/food/snacks/spacetwinkie
+ name = "Space Twinkie"
+ icon_state = "space_twinkie"
+ desc = "Guaranteed to survive longer then you will."
+ filling_color = "#FFE591"
+
+ New()
+ ..()
+ reagents.add_reagent("sugar", 4)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/cheesiehonkers
+ name = "Cheesie Honkers"
+ icon_state = "cheesie_honkers"
+ desc = "Bite sized cheesie snacks that will honk all over your mouth"
+ trash = /obj/item/trash/cheesie
+ filling_color = "#FFA305"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 4)
+ reagents.add_reagent("fake_cheese", 2)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/chinese/chowmein
+ name = "chow mein"
+ desc = "What is in this anyways?"
+ icon_state = "chinese1"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ reagents.add_reagent("beans", 3)
+ reagents.add_reagent("msg",4)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/chinese/tao
+ name = "Admiral Yamamoto carp"
+ desc = "Tastes like chicken."
+ icon_state = "chinese2"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 4)
+ reagents.add_reagent("protein", 2)
+ reagents.add_reagent("msg",4)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/chinese/newdles
+ name = "chinese newdles"
+ desc = "Made fresh, weekly!"
+ icon_state = "chinese3"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ reagents.add_reagent("msg",4)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/chinese/rice
+ name = "fried rice"
+ desc = "A timeless classic."
+ icon_state = "chinese4"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+ reagents.add_reagent("rice", 3)
+ reagents.add_reagent("msg",4)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/syndicake
+ name = "Syndi-Cakes"
+ icon_state = "syndi_cakes"
+ desc = "An extremely moist snack cake that tastes just as good after being nuked."
+ filling_color = "#FF5D05"
+
+ trash = /obj/item/trash/syndi_cakes
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 4)
+ reagents.add_reagent("salglu_solution", 5)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/loadedbakedpotato
+ name = "Loaded Baked Potato"
+ desc = "Totally baked."
+ icon_state = "loadedbakedpotato"
+ filling_color = "#9C7A68"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/fries
+ name = "Space Fries"
+ desc = "AKA: French Fries, Freedom Fries, etc."
+ icon_state = "fries"
+ trash = /obj/item/trash/plate
+ filling_color = "#EDDD00"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 4)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/soydope
+ name = "Soy Dope"
+ desc = "Dope from a soy."
+ icon_state = "soydope"
+ trash = /obj/item/trash/plate
+ filling_color = "#C4BF76"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 2)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/spagetti
+ name = "Spagetti"
+ desc = "A bundle of raw spaghetti."
+ icon_state = "spagetti"
+ filling_color = "#EDDD00"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 1)
+ bitesize = 1
+
+/obj/item/weapon/reagent_containers/food/snacks/cheesyfries
+ name = "Cheesy Fries"
+ desc = "Fries. Covered in cheese. Duh."
+ icon_state = "cheesyfries"
+ trash = /obj/item/trash/plate
+ filling_color = "#EDDD00"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/fortunecookie
+ name = "Fortune cookie"
+ desc = "A true prophecy in each cookie!"
+ icon_state = "fortune_cookie"
+ filling_color = "#E8E79E"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/badrecipe
+ name = "Burned mess"
+ desc = "Someone should be demoted from chef for this."
+ icon_state = "badrecipe"
+ filling_color = "#211F02"
+
+ New()
+ ..()
+ reagents.add_reagent("????", 5)
+ reagents.add_reagent("carbon", 3)
+ bitesize = 2
+
+ // it's burned! it should start off being classed as any cooktype that burns
+ cooktype["grilled"] = 1
+ cooktype["deep fried"] = 1
+
+/obj/item/weapon/reagent_containers/food/snacks/meatsteak
+ name = "Meat steak"
+ desc = "A piece of hot spicy meat."
+ icon_state = "meatstake"
+ trash = /obj/item/trash/plate
+ filling_color = "#7A3D11"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 4)
+ reagents.add_reagent("sodiumchloride", 1)
+ reagents.add_reagent("blackpepper", 1)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/spacylibertyduff
+ name = "Spacy Liberty Duff"
+ desc = "Jello gelatin, from Alfred Hubbard's cookbook"
+ icon_state = "spacylibertyduff"
+ trash = /obj/item/trash/snack_bowl
+ filling_color = "#42B873"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ reagents.add_reagent("psilocybin", 6)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/amanitajelly
+ name = "Amanita Jelly"
+ desc = "Looks curiously toxic"
+ icon_state = "amanitajelly"
+ trash = /obj/item/trash/snack_bowl
+ filling_color = "#ED0758"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ reagents.add_reagent("amanitin", 6)
+ reagents.add_reagent("psilocybin", 3)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/poppypretzel
+ name = "Poppy pretzel"
+ desc = "It's all twisted up!"
+ icon_state = "poppypretzel"
+ bitesize = 2
+ filling_color = "#916E36"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 5)
+ bitesize = 2
+
+
+/obj/item/weapon/reagent_containers/food/snacks/meatballsoup
+ name = "Meatball soup"
+ desc = "You've got balls kid, BALLS!"
+ icon_state = "meatballsoup"
+ trash = /obj/item/trash/snack_bowl
+ filling_color = "#785210"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 8)
+ reagents.add_reagent("water", 5)
+ bitesize = 5
+
+/obj/item/weapon/reagent_containers/food/snacks/slimesoup
+ name = "slime soup"
+ desc = "If no water is available, you may substitute tears."
+ icon_state = "slimesoup"
+ filling_color = "#C4DBA0"
+
+ New()
+ ..()
+ reagents.add_reagent("slimejelly", 5)
+ reagents.add_reagent("water", 10)
+ bitesize = 5
+
+/obj/item/weapon/reagent_containers/food/snacks/bloodsoup
+ name = "Tomato soup"
+ desc = "Smells like copper"
+ icon_state = "tomatosoup"
+ filling_color = "#FF0000"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 2)
+ reagents.add_reagent("blood", 10)
+ reagents.add_reagent("water", 5)
+ bitesize = 5
+
+/obj/item/weapon/reagent_containers/food/snacks/clownstears
+ name = "Clown's Tears"
+ desc = "Not very funny."
+ icon_state = "clownstears"
+ filling_color = "#C4FBFF"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 4)
+ reagents.add_reagent("banana", 5)
+ reagents.add_reagent("water", 10)
+ bitesize = 5
+
+/obj/item/weapon/reagent_containers/food/snacks/vegetablesoup
+ name = "Vegetable soup"
+ desc = "A true vegan meal" //TODO
+ icon_state = "vegetablesoup"
+ trash = /obj/item/trash/snack_bowl
+ filling_color = "#AFC4B5"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 8)
+ reagents.add_reagent("water", 5)
+ bitesize = 5
+
+/obj/item/weapon/reagent_containers/food/snacks/nettlesoup
+ name = "Nettle soup"
+ desc = "To think, the botanist would've beat you to death with one of these."
+ icon_state = "nettlesoup"
+ trash = /obj/item/trash/snack_bowl
+ filling_color = "#AFC4B5"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 8)
+ reagents.add_reagent("water", 5)
+ reagents.add_reagent("omnizine", 5)
+ bitesize = 5
+
+/obj/item/weapon/reagent_containers/food/snacks/mysterysoup
+ name = "Mystery soup"
+ desc = "The mystery is, why aren't you eating it?"
+ icon_state = "mysterysoup"
+ trash = /obj/item/trash/snack_bowl
+ filling_color = "#F082FF"
+
+ New()
+ ..()
+ var/mysteryselect = pick(1,2,3,4,5,6,7,8,9,10)
+ switch(mysteryselect)
+ if(1)
+ reagents.add_reagent("nutriment", 6)
+ reagents.add_reagent("capsaicin", 3)
+ reagents.add_reagent("tomatojuice", 2)
+ if(2)
+ reagents.add_reagent("nutriment", 6)
+ reagents.add_reagent("frostoil", 3)
+ reagents.add_reagent("tomatojuice", 2)
+ if(3)
+ reagents.add_reagent("nutriment", 5)
+ reagents.add_reagent("water", 5)
+ reagents.add_reagent("omnizine", 5)
+ if(4)
+ reagents.add_reagent("nutriment", 5)
+ reagents.add_reagent("water", 10)
+ if(5)
+ reagents.add_reagent("nutriment", 2)
+ reagents.add_reagent("banana", 10)
+ if(6)
+ reagents.add_reagent("nutriment", 6)
+ reagents.add_reagent("blood", 10)
+ if(7)
+ reagents.add_reagent("slimejelly", 10)
+ reagents.add_reagent("water", 10)
+ if(8)
+ reagents.add_reagent("carbon", 10)
+ reagents.add_reagent("toxin", 10)
+ if(9)
+ reagents.add_reagent("nutriment", 5)
+ reagents.add_reagent("tomatojuice", 10)
+ if(10)
+ reagents.add_reagent("nutriment", 6)
+ reagents.add_reagent("tomatojuice", 5)
+ reagents.add_reagent("oculine", 5)
+ bitesize = 5
+
+/obj/item/weapon/reagent_containers/food/snacks/wishsoup
+ name = "Wish Soup"
+ desc = "I wish this was soup."
+ icon_state = "wishsoup"
+ trash = /obj/item/trash/snack_bowl
+ filling_color = "#D1F4FF"
+
+ New()
+ ..()
+ reagents.add_reagent("water", 10)
+ bitesize = 5
+ if(prob(25))
+ src.desc = "A wish come true!"
+ reagents.add_reagent("nutriment", 8)
+
+/obj/item/weapon/reagent_containers/food/snacks/hotchili
+ name = "Hot Chili"
+ desc = "A five alarm Texan Chili!"
+ icon_state = "hotchili"
+ trash = /obj/item/trash/snack_bowl
+ filling_color = "#FF3C00"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ reagents.add_reagent("capsaicin", 3)
+ reagents.add_reagent("tomatojuice", 2)
+ bitesize = 5
+
+
+/obj/item/weapon/reagent_containers/food/snacks/coldchili
+ name = "Cold Chili"
+ desc = "This slush is barely a liquid!"
+ icon_state = "coldchili"
+ filling_color = "#2B00FF"
+
+ trash = /obj/item/trash/snack_bowl
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ reagents.add_reagent("frostoil", 3)
+ reagents.add_reagent("tomatojuice", 2)
+ bitesize = 5
+
+/obj/item/weapon/reagent_containers/food/snacks/raw_bacon
+ name = "raw bacon"
+ desc = "It's fleshy and pink!"
+ icon_state = "raw_bacon"
+ bitesize = 2
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 1)
+ reagents.add_reagent("porktonium", 10)
+
+/obj/item/weapon/reagent_containers/food/snacks/bacon
+ name = "bacon"
+ desc = "It looks juicy and tastes amazing!"
+ icon_state = "bacon2"
+ bitesize = 2
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 4)
+ reagents.add_reagent("porktonium", 10)
+ reagents.add_reagent("msg", 4)
+
+
+/obj/item/weapon/reagent_containers/food/snacks/telebacon
+ name = "Tele Bacon"
+ desc = "It tastes a little odd but it is still delicious."
+ icon_state = "bacon"
+ var/obj/item/device/radio/beacon/bacon/baconbeacon
+ bitesize = 2
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 4)
+ reagents.add_reagent("porktonium", 10)
+ baconbeacon = new /obj/item/device/radio/beacon/bacon(src)
+ On_Consume(mob/M, mob/user)
+ if(!reagents.total_volume)
+ baconbeacon.loc = user
+ baconbeacon.digest_delay()
+
+
+/obj/item/weapon/reagent_containers/food/snacks/monkeycube
+ name = "monkey cube"
+ desc = "Just add water!"
+ icon_state = "monkeycube"
+ bitesize = 12
+ filling_color = "#ADAC7F"
+ var/monkey_type = "Monkey"
+
+/obj/item/weapon/reagent_containers/food/snacks/monkeycube/New()
+ ..()
+ reagents.add_reagent("protein",10)
+
+/obj/item/weapon/reagent_containers/food/snacks/monkeycube/afterattack(obj/O, mob/user, proximity)
+ if(!proximity) return
+ if(istype(O,/obj/structure/sink) && !wrapped)
+ to_chat(user, "You place [src] under a stream of water...")
+ user.drop_item()
+ forceMove(get_turf(O))
+ return Expand()
+ if(istype(O, /obj/machinery/computer/camera_advanced/xenobio))
+ var/obj/machinery/computer/camera_advanced/xenobio/X = O
+ X.monkeys++
+ to_chat(user, "You feed [src] to the [X]. It now has [X.monkeys] monkey cubes stored.")
+ qdel(src)
+ return
+ ..()
+
+/obj/item/weapon/reagent_containers/food/snacks/monkeycube/attack_self(mob/user)
+ if(wrapped)
+ Unwrap(user)
+
+/obj/item/weapon/reagent_containers/food/snacks/monkeycube/water_act(volume, temperature)
+ if(volume >= 5)
+ return Expand()
+
+/obj/item/weapon/reagent_containers/food/snacks/monkeycube/wash(mob/user, atom/source)
+ if(wrapped)
+ ..()
+ return
+ if(do_after(user, 40, target = source))
+ return 1
+
+/obj/item/weapon/reagent_containers/food/snacks/monkeycube/proc/Expand()
+ if(isnull(gcDestroyed))
+ visible_message("[src] expands!")
+ new/mob/living/carbon/human(get_turf(src),monkey_type)
+ qdel(src)
+
+/obj/item/weapon/reagent_containers/food/snacks/monkeycube/proc/Unwrap(mob/user)
+ icon_state = "monkeycube"
+ desc = "Just add water!"
+ to_chat(user, "You unwrap the cube.")
+ wrapped = 0
+
+/obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped
+ desc = "Still wrapped in some paper."
+ icon_state = "monkeycubewrap"
+ wrapped = 1
+
+/obj/item/weapon/reagent_containers/food/snacks/monkeycube/farwacube
+ name = "farwa cube"
+ monkey_type = "Farwa"
+
+/obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped/farwacube
+ name = "farwa cube"
+ monkey_type = "Farwa"
+
+/obj/item/weapon/reagent_containers/food/snacks/monkeycube/wolpincube
+ name = "wolpin cube"
+ monkey_type = "Wolpin"
+
+/obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped/wolpincube
+ name = "wolpin cube"
+ monkey_type = "Wolpin"
+
+/obj/item/weapon/reagent_containers/food/snacks/monkeycube/stokcube
+ name = "stok cube"
+ monkey_type = "Stok"
+
+/obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped/stokcube
+ name = "stok cube"
+ monkey_type = "Stok"
+
+/obj/item/weapon/reagent_containers/food/snacks/monkeycube/neaeracube
+ name = "neaera cube"
+ monkey_type = "Neara"
+
+/obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped/neaeracube
+ name = "neaera cube"
+ monkey_type = "Neara"
+
+
+/obj/item/weapon/reagent_containers/food/snacks/spellburger
+ name = "Spell Burger"
+ desc = "This is absolutely Ei Nath."
+ icon_state = "spellburger"
+ filling_color = "#D505FF"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/bigbiteburger
+ name = "Big Bite Burger"
+ desc = "Forget the Big Mac. THIS is the future!"
+ icon_state = "bigbiteburger"
+ filling_color = "#E3D681"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 14)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/enchiladas
+ name = "Enchiladas"
+ desc = "Viva La Mexico!"
+ icon_state = "enchiladas"
+ trash = /obj/item/trash/tray
+ filling_color = "#A36A1F"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment",8)
+ reagents.add_reagent("capsaicin", 6)
+ bitesize = 4
+
+/obj/item/weapon/reagent_containers/food/snacks/burrito
+ name = "Burrito"
+ desc = "Meat, beans, cheese, and rice wrapped up as an easy-to-hold meal."
+ icon_state = "burrito"
+ trash = /obj/item/trash/plate
+ filling_color = "#A36A1F"
+
+/obj/item/weapon/reagent_containers/food/snacks/burrito/New()
+ ..()
+ reagents.add_reagent("nutriment", 5)
+
+/obj/item/weapon/reagent_containers/food/snacks/chimichanga
+ name = "Chimichanga"
+ desc = "Time to eat a chimi-f***ing-changa."
+ icon_state = "chimichanga"
+ trash = /obj/item/trash/plate
+ filling_color = "#A36A1F"
+
+/obj/item/weapon/reagent_containers/food/snacks/chimichanga/New()
+ ..()
+ reagents.add_reagent("omnizine", 4) //Deadpool reference. Deal with it.
+ reagents.add_reagent("cheese", 2)
+
+/obj/item/weapon/reagent_containers/food/snacks/monkeysdelight
+ name = "monkey's Delight"
+ desc = "Eeee Eee!"
+ icon_state = "monkeysdelight"
+ trash = /obj/item/trash/tray
+ filling_color = "#5C3C11"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 10)
+ reagents.add_reagent("banana", 5)
+ reagents.add_reagent("blackpepper", 1)
+ reagents.add_reagent("sodiumchloride", 1)
+ bitesize = 6
+
+/obj/item/weapon/reagent_containers/food/snacks/baguette
+ name = "Baguette"
+ desc = "Bon appetit!"
+ icon_state = "baguette"
+ filling_color = "#E3D796"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ reagents.add_reagent("blackpepper", 1)
+ reagents.add_reagent("sodiumchloride", 1)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/sandwich
+ name = "Sandwich"
+ desc = "A grand creation of meat, cheese, bread, and several leaves of lettuce! Arthur Dent would be proud."
+ icon_state = "sandwich"
+ trash = /obj/item/trash/plate
+ filling_color = "#D9BE29"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/toastedsandwich
+ name = "Toasted Sandwich"
+ desc = "Now if you only had a pepper bar."
+ icon_state = "toastedsandwich"
+ trash = /obj/item/trash/plate
+ filling_color = "#D9BE29"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ reagents.add_reagent("carbon", 2)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/grilledcheese
+ name = "Grilled Cheese Sandwich"
+ desc = "Goes great with Tomato soup!"
+ icon_state = "toastedsandwich"
+ trash = /obj/item/trash/plate
+ filling_color = "#D9BE29"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 7)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/tomatosoup
+ name = "Tomato Soup"
+ desc = "Drinking this feels like being a vampire! A tomato vampire..."
+ icon_state = "tomatosoup"
+ trash = /obj/item/trash/snack_bowl
+ filling_color = "#D92929"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 5)
+ reagents.add_reagent("tomatojuice", 10)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/rofflewaffles
+ name = "Roffle Waffles"
+ desc = "Waffles from Roffle. Co."
+ icon_state = "rofflewaffles"
+ trash = /obj/item/trash/waffles
+ filling_color = "#FF00F7"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 8)
+ reagents.add_reagent("psilocybin", 8)
+ bitesize = 4
+
+/obj/item/weapon/reagent_containers/food/snacks/stew
+ name = "Stew"
+ desc = "A nice and warm stew. Healthy and strong."
+ icon_state = "stew"
+ filling_color = "#9E673A"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 10)
+ reagents.add_reagent("tomatojuice", 5)
+ reagents.add_reagent("oculine", 5)
+ reagents.add_reagent("water", 5)
+ bitesize = 10
+
+/obj/item/weapon/reagent_containers/food/snacks/jelliedtoast
+ name = "Jellied Toast"
+ desc = "A slice of bread covered with delicious jam."
+ icon_state = "jellytoast"
+ trash = /obj/item/trash/plate
+ filling_color = "#B572AB"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 1)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/jelliedtoast/cherry
+ New()
+ ..()
+ reagents.add_reagent("cherryjelly", 5)
+
+/obj/item/weapon/reagent_containers/food/snacks/jelliedtoast/slime
+ New()
+ ..()
+ reagents.add_reagent("slimejelly", 5)
+
+/obj/item/weapon/reagent_containers/food/snacks/jellyburger
+ name = "Jelly Burger"
+ desc = "Culinary delight..?"
+ icon_state = "jellyburger"
+ filling_color = "#B572AB"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 5)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/jellyburger/slime
+ New()
+ ..()
+ reagents.add_reagent("slimejelly", 5)
+
+/obj/item/weapon/reagent_containers/food/snacks/jellyburger/cherry
+ New()
+ ..()
+ reagents.add_reagent("cherryjelly", 5)
+
+/obj/item/weapon/reagent_containers/food/snacks/milosoup
+ name = "Milosoup"
+ desc = "The universes best soup! Yum!!!"
+ icon_state = "milosoup"
+ trash = /obj/item/trash/snack_bowl
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 8)
+ reagents.add_reagent("water", 5)
+ bitesize = 4
+
+/obj/item/weapon/reagent_containers/food/snacks/stewedsoymeat
+ name = "Stewed Soy Meat"
+ desc = "Even non-vegetarians will LOVE this!"
+ icon_state = "stewedsoymeat"
+ trash = /obj/item/trash/plate
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 8)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/boiledspagetti
+ name = "Boiled Spagetti"
+ desc = "A plain dish of noodles, this sucks."
+ icon_state = "spagettiboiled"
+ trash = /obj/item/trash/plate
+ filling_color = "#FCEE81"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 2)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/boiledrice
+ name = "Boiled Rice"
+ desc = "A boring dish of boring rice."
+ icon_state = "boiledrice"
+ trash = /obj/item/trash/snack_bowl
+ filling_color = "#FFFBDB"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 2)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/ricepudding
+ name = "Rice Pudding"
+ desc = "Where's the Jam!"
+ icon_state = "rpudding"
+ trash = /obj/item/trash/snack_bowl
+ filling_color = "#FFFBDB"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 4)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/pastatomato
+ name = "Spagetti"
+ desc = "Spaghetti and crushed tomatoes. Just like your abusive father used to make!"
+ icon_state = "pastatomato"
+ trash = /obj/item/trash/plate
+ filling_color = "#DE4545"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ reagents.add_reagent("tomatojuice", 10)
+ bitesize = 4
+
+/obj/item/weapon/reagent_containers/food/snacks/meatballspagetti
+ name = "Spagetti & Meatballs"
+ desc = "Now thats a nic'e meatball!"
+ icon_state = "meatballspagetti"
+ trash = /obj/item/trash/plate
+ filling_color = "#DE4545"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 8)
+ reagents.add_reagent("synaptizine", 5)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/spesslaw
+ name = "Spesslaw"
+ desc = "A lawyers favourite"
+ icon_state = "spesslaw"
+ filling_color = "#DE4545"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 8)
+ reagents.add_reagent("synaptizine", 10)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/poppypretzel
+ name = "Poppy Pretzel"
+ desc = "A large soft pretzel full of POP!"
+ icon_state = "poppypretzel"
+ filling_color = "#AB7D2E"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 5)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/carrotfries
+ name = "Carrot Fries"
+ desc = "Tasty fries from fresh Carrots."
+ icon_state = "carrotfries"
+ trash = /obj/item/trash/plate
+ filling_color = "#FAA005"
+
+ New()
+ ..()
+ reagents.add_reagent("plantmatter", 3)
+ reagents.add_reagent("oculine", 3)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/superbiteburger
+ name = "Super Bite Burger"
+ desc = "This is a mountain of a burger. FOOD!"
+ icon_state = "superbiteburger"
+ filling_color = "#CCA26A"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 50)
+ bitesize = 10
+
+/obj/item/weapon/reagent_containers/food/snacks/candiedapple
+ name = "Candied Apple"
+ desc = "An apple coated in sugary sweetness."
+ icon_state = "candiedapple"
+ filling_color = "#F21873"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/applepie
+ name = "Apple Pie"
+ desc = "A pie containing sweet sweet love... or apple."
+ icon_state = "applepie"
+ filling_color = "#E0EDC5"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 4)
+ bitesize = 3
+
+
+/obj/item/weapon/reagent_containers/food/snacks/cherrypie
+ name = "Cherry Pie"
+ desc = "Taste so good, make a grown man cry."
+ icon_state = "cherrypie"
+ filling_color = "#FF525A"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 4)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/twobread
+ name = "Two Bread"
+ desc = "It is very bitter and winy."
+ icon_state = "twobread"
+ filling_color = "#DBCC9A"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 2)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/jellysandwich
+ name = "Jelly Sandwich"
+ desc = "You wish you had some peanut butter to go with this..."
+ icon_state = "jellysandwich"
+ trash = /obj/item/trash/plate
+ filling_color = "#9E3A78"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 2)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/jellysandwich/slime
+ New()
+ ..()
+ reagents.add_reagent("slimejelly", 5)
+
+/obj/item/weapon/reagent_containers/food/snacks/jellysandwich/cherry
+ New()
+ ..()
+ reagents.add_reagent("cherryjelly", 5)
+
+/obj/item/weapon/reagent_containers/food/snacks/boiledslimecore
+ name = "Boiled Slime Core"
+ desc = "A boiled red thing."
+ icon_state = "boiledrorocore"
+ New()
+ ..()
+ reagents.add_reagent("slimejelly", 5)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/mint
+ name = "mint"
+ desc = "it is only wafer thin."
+ icon_state = "mint"
+ filling_color = "#F2F2F2"
+
+ New()
+ ..()
+ reagents.add_reagent("minttoxin", 1)
+ bitesize = 1
+
+/obj/item/weapon/reagent_containers/food/snacks/mushroomsoup
+ name = "chantrelle soup"
+ desc = "A delicious and hearty mushroom soup."
+ icon_state = "mushroomsoup"
+ trash = /obj/item/trash/snack_bowl
+ filling_color = "#E386BF"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 8)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/plumphelmetbiscuit
+ name = "plump helmet biscuit"
+ desc = "This is a finely-prepared plump helmet biscuit. The ingredients are exceptionally minced plump helmet, and well-minced dwarven wheat flour."
+ icon_state = "phelmbiscuit"
+ filling_color = "#CFB4C4"
+
+ New()
+ ..()
+ if(prob(10))
+ name = "exceptional plump helmet biscuit"
+ desc = "Microwave is taken by a fey mood! It has cooked an exceptional plump helmet biscuit!"
+ reagents.add_reagent("nutriment", 8)
+ reagents.add_reagent("omnizine", 5)
+ bitesize = 2
+ else
+ reagents.add_reagent("nutriment", 5)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/chawanmushi
+ name = "chawanmushi"
+ desc = "A legendary egg custard that makes friends out of enemies. Probably too hot for a cat to eat."
+ icon_state = "chawanmushi"
+ trash = /obj/item/trash/snack_bowl
+ filling_color = "#F0F2E4"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 5)
+ bitesize = 1
+
+/obj/item/weapon/reagent_containers/food/snacks/beetsoup
+ name = "beet soup"
+ desc = "Wait, how do you spell it again..?"
+ icon_state = "beetsoup"
+ trash = /obj/item/trash/snack_bowl
+ filling_color = "#FAC9FF"
+
+ New()
+ ..()
+ switch(rand(1,6))
+ if(1)
+ name = "borsch"
+ if(2)
+ name = "bortsch"
+ if(3)
+ name = "borstch"
+ if(4)
+ name = "borsh"
+ if(5)
+ name = "borshch"
+ if(6)
+ name = "borscht"
+ reagents.add_reagent("nutriment", 8)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/herbsalad
+ name = "herb salad"
+ desc = "A tasty salad with apples on top."
+ icon_state = "herbsalad"
+ trash = /obj/item/trash/snack_bowl
+ filling_color = "#76B87F"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 8)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/validsalad
+ name = "valid salad"
+ desc = "It's just an herb salad with meatballs and fried potato slices. Nothing suspicious about it."
+ icon_state = "validsalad"
+ trash = /obj/item/trash/snack_bowl
+ filling_color = "#76B87F"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 8)
+ reagents.add_reagent("omnizine", 5)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/appletart
+ name = "golden apple streusel tart"
+ desc = "A tasty dessert that won't make it through a metal detector."
+ icon_state = "gappletart"
+ trash = /obj/item/trash/plate
+ filling_color = "#FFFF00"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 8)
+ reagents.add_reagent("gold", 5)
+ spawn(1)
+ reagents.del_reagent("egg")
+ reagents.update_total()
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/dough_ball
+ name = "ball of raw dough"
+ desc = "A ball of raw dough, ready to be molded into new recipes."
+ icon = 'icons/obj/food/food_ingredients.dmi'
+ icon_state = "dough"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+ bitesize = 1
+ attackby(obj/item/weapon/W as obj, mob/user as mob, params)
+ if(istype(W,/obj/item/weapon/kitchen/rollingpin))
+ user.visible_message( \
+ "[user] flattens the dough with the rolling pin!", \
+ "\blue You flatten the dough with your rolling pin!" \
+ )
+ new /obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough(src.loc)
+ qdel(src)
+
+/////////////////////////////////////////////////Sliceable////////////////////////////////////////
+// All the food items that can be sliced into smaller bits like Meatbread and Cheesewheels
+
+// sliceable is just an organization type path, it doesn't have any additional code or variables tied to it.
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough
+ name = "flattened dough"
+ desc = "Still raw. You resist the temptation to cover it in tomato sauce."
+ icon = 'icons/obj/food/food_ingredients.dmi'
+ icon_state = "flatdough"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/doughslice
+ slices_num = 3
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+ bitesize = 1
+
+/obj/item/weapon/reagent_containers/food/snacks/doughslice
+ name = "slice of dough"
+ desc = "an individual portion of raw dough, ready to be cooked."
+ icon = 'icons/obj/food/food_ingredients.dmi'
+ icon_state = "doughslice"
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/meatbread
+ name = "meatbread loaf"
+ desc = "The culinary base of every self-respecting eloquen/tg/entleman."
+ icon_state = "meatbread"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/meatbreadslice
+ slices_num = 5
+ filling_color = "#FF7575"
+ New()
+ ..()
+ reagents.add_reagent("protein", 20)
+ reagents.add_reagent("nutriment", 10)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/meatbreadslice
+ name = "meatbread slice"
+ desc = "A slice of delicious meatbread."
+ icon_state = "meatbreadslice"
+ trash = /obj/item/trash/plate
+ filling_color = "#FF7575"
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/xenomeatbread
+ name = "xenomeatbread loaf"
+ desc = "The culinary base of every self-respecting eloquent gentleman. Extra Heretical."
+ icon_state = "xenomeatbread"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/xenomeatbreadslice
+ slices_num = 5
+ filling_color = "#8AFF75"
+ New()
+ ..()
+ reagents.add_reagent("protein", 20)
+ reagents.add_reagent("nutriment", 10)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/xenomeatbreadslice
+ name = "xenomeatbread slice"
+ desc = "A slice of delicious meatbread. Extra Heretical."
+ icon_state = "xenobreadslice"
+ trash = /obj/item/trash/plate
+ filling_color = "#8AFF75"
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/spidermeatbread
+ name = "spider meat loaf"
+ desc = "Reassuringly green meatloaf made from spider meat."
+ icon_state = "spidermeatbread"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/spidermeatbreadslice
+ slices_num = 5
+ New()
+ ..()
+ reagents.add_reagent("protein", 20)
+ reagents.add_reagent("nutriment", 10)
+ reagents.add_reagent("toxin", 15)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/spidermeatbreadslice
+ name = "spider meat bread slice"
+ desc = "A slice of meatloaf made from an animal that most likely still wants you dead."
+ icon_state = "xenobreadslice"
+ trash = /obj/item/trash/plate
+ bitesize = 2
+ New()
+ ..()
+ reagents.add_reagent("toxin", 2)
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/bananabread
+ name = "Banana-nut bread"
+ desc = "A heavenly and filling treat."
+ icon_state = "bananabread"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/bananabreadslice
+ slices_num = 5
+ filling_color = "#EDE5AD"
+ New()
+ ..()
+ reagents.add_reagent("banana", 20)
+ reagents.add_reagent("nutriment", 20)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/bananabreadslice
+ name = "Banana-nut bread slice"
+ desc = "A slice of delicious banana bread."
+ icon_state = "bananabreadslice"
+ trash = /obj/item/trash/plate
+ filling_color = "#EDE5AD"
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/tofubread
+ name = "Tofubread"
+ icon_state = "Like meatbread but for vegetarians. Not guaranteed to give superpowers."
+ icon_state = "tofubread"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/tofubreadslice
+ slices_num = 5
+ filling_color = "#F7FFE0"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 30)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/tofubreadslice
+ name = "Tofubread slice"
+ desc = "A slice of delicious tofubread."
+ icon_state = "tofubreadslice"
+ trash = /obj/item/trash/plate
+ filling_color = "#F7FFE0"
+ bitesize = 2
+
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/carrotcake
+ name = "Carrot Cake"
+ desc = "A favorite desert of a certain wascally wabbit. Not a lie."
+ icon_state = "carrotcake"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/carrotcakeslice
+ slices_num = 5
+ filling_color = "#FFD675"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 25)
+ reagents.add_reagent("oculine", 10)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/carrotcakeslice
+ name = "Carrot Cake slice"
+ desc = "Carrotty slice of Carrot Cake, carrots are good for your eyes! Also not a lie."
+ icon_state = "carrotcake_slice"
+ trash = /obj/item/trash/plate
+ filling_color = "#FFD675"
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/braincake
+ name = "Brain Cake"
+ desc = "A squishy cake-thing."
+ icon_state = "braincake"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/braincakeslice
+ slices_num = 5
+ filling_color = "#E6AEDB"
+ New()
+ ..()
+ reagents.add_reagent("protein", 15)
+ reagents.add_reagent("nutriment", 10)
+ reagents.add_reagent("mannitol", 10)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/braincakeslice
+ name = "Brain Cake slice"
+ desc = "Lemme tell you something about prions. THEY'RE DELICIOUS."
+ icon_state = "braincakeslice"
+ trash = /obj/item/trash/plate
+ filling_color = "#E6AEDB"
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/cheesecake
+ name = "Cheese Cake"
+ desc = "DANGEROUSLY cheesy."
+ icon_state = "cheesecake"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/cheesecakeslice
+ slices_num = 5
+ filling_color = "#FAF7AF"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 25)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/cheesecakeslice
+ name = "Cheese Cake slice"
+ desc = "Slice of pure cheestisfaction"
+ icon_state = "cheesecake_slice"
+ trash = /obj/item/trash/plate
+ filling_color = "#FAF7AF"
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/plaincake
+ name = "Vanilla Cake"
+ desc = "A plain cake, not a lie."
+ icon_state = "plaincake"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/plaincakeslice
+ slices_num = 5
+ filling_color = "#F7EDD5"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 20)
+
+/obj/item/weapon/reagent_containers/food/snacks/plaincakeslice
+ name = "Vanilla Cake slice"
+ desc = "Just a slice of cake, it is enough for everyone."
+ icon_state = "plaincake_slice"
+ trash = /obj/item/trash/plate
+ filling_color = "#F7EDD5"
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/orangecake
+ name = "Orange Cake"
+ desc = "A cake with added orange."
+ icon_state = "orangecake"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/orangecakeslice
+ slices_num = 5
+ filling_color = "#FADA8E"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 20)
+
+/obj/item/weapon/reagent_containers/food/snacks/orangecakeslice
+ name = "Orange Cake slice"
+ desc = "Just a slice of cake, it is enough for everyone."
+ icon_state = "orangecake_slice"
+ trash = /obj/item/trash/plate
+ filling_color = "#FADA8E"
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/limecake
+ name = "Lime Cake"
+ desc = "A cake with added lime."
+ icon_state = "limecake"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/limecakeslice
+ slices_num = 5
+ filling_color = "#CBFA8E"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 20)
+
+/obj/item/weapon/reagent_containers/food/snacks/limecakeslice
+ name = "Lime Cake slice"
+ desc = "Just a slice of cake, it is enough for everyone."
+ icon_state = "limecake_slice"
+ trash = /obj/item/trash/plate
+ filling_color = "#CBFA8E"
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/lemoncake
+ name = "Lemon Cake"
+ desc = "A cake with added lemon."
+ icon_state = "lemoncake"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/lemoncakeslice
+ slices_num = 5
+ filling_color = "#FAFA8E"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 20)
+
+/obj/item/weapon/reagent_containers/food/snacks/lemoncakeslice
+ name = "Lemon Cake slice"
+ desc = "Just a slice of cake, it is enough for everyone."
+ icon_state = "lemoncake_slice"
+ trash = /obj/item/trash/plate
+ filling_color = "#FAFA8E"
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/chocolatecake
+ name = "Chocolate Cake"
+ desc = "A cake with added chocolate"
+ icon_state = "chocolatecake"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/chocolatecakeslice
+ slices_num = 5
+ filling_color = "#805930"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 20)
+ reagents.add_reagent("chocolate",20)
+
+/obj/item/weapon/reagent_containers/food/snacks/chocolatecakeslice
+ name = "Chocolate Cake slice"
+ desc = "Just a slice of cake, it is enough for everyone."
+ icon_state = "chocolatecake_slice"
+ trash = /obj/item/trash/plate
+ filling_color = "#805930"
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/cheesewheel
+ name = "Cheese wheel"
+ desc = "A big wheel of delcious Cheddar."
+ icon_state = "cheesewheel"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/cheesewedge
+ slices_num = 5
+ filling_color = "#FFF700"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 20)
+ reagents.add_reagent("cheese", 20)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/cheesewedge
+ name = "Cheese wedge"
+ desc = "A wedge of delicious Cheddar. The cheese wheel it was cut from can't have gone far."
+ icon_state = "cheesewedge"
+ filling_color = "#FFF700"
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/weirdcheesewedge
+ name = "Weird Cheese"
+ desc = "Some kind of... gooey, messy, gloopy thing. Similar to cheese, but only in the looser sense of the word."
+ icon_state = "weirdcheesewedge"
+ filling_color = "#00FF33"
+ bitesize = 2
+ New()
+ ..()
+ reagents.add_reagent("mercury", 5)
+ reagents.add_reagent("lsd", 5)
+ reagents.add_reagent("ethanol", 5)
+ reagents.add_reagent("weird_cheese", 5)
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/birthdaycake
+ name = "Birthday Cake"
+ desc = "Happy Birthday..."
+ icon_state = "birthdaycake"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/birthdaycakeslice
+ slices_num = 5
+ filling_color = "#FFD6D6"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 20)
+ reagents.add_reagent("sprinkles", 10)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/birthdaycakeslice
+ name = "Birthday Cake slice"
+ desc = "A slice of your birthday"
+ icon_state = "birthdaycakeslice"
+ trash = /obj/item/trash/plate
+ filling_color = "#FFD6D6"
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/bread
+ name = "Bread"
+ icon_state = "Some plain old Earthen bread."
+ icon_state = "bread"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/breadslice
+ slices_num = 6
+ filling_color = "#FFE396"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ spawn(1)
+ reagents.del_reagent("egg")
+ reagents.update_total()
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/breadslice
+ name = "Bread slice"
+ desc = "A slice of home."
+ icon_state = "breadslice"
+ trash = /obj/item/trash/plate
+ filling_color = "#D27332"
+ bitesize = 2
+
+ New()
+ ..()
+ reagents.add_reagent("bread", 5)
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/creamcheesebread
+ name = "Cream Cheese Bread"
+ desc = "Yum yum yum!"
+ icon_state = "creamcheesebread"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/creamcheesebreadslice
+ slices_num = 5
+ filling_color = "#FFF896"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 20)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/creamcheesebreadslice
+ name = "Cream Cheese Bread slice"
+ desc = "A slice of yum!"
+ icon_state = "creamcheesebreadslice"
+ trash = /obj/item/trash/plate
+ filling_color = "#FFF896"
+ bitesize = 2
+
+
+/obj/item/weapon/reagent_containers/food/snacks/watermelonslice
+ name = "Watermelon Slice"
+ desc = "A slice of watery goodness."
+ icon_state = "watermelonslice"
+ filling_color = "#FF3867"
+ bitesize = 2
+
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/applecake
+ name = "Apple Cake"
+ desc = "A cake centred with Apple"
+ icon_state = "applecake"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/applecakeslice
+ slices_num = 5
+ filling_color = "#EBF5B8"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 15)
+
+/obj/item/weapon/reagent_containers/food/snacks/applecakeslice
+ name = "Apple Cake slice"
+ desc = "A slice of heavenly cake."
+ icon_state = "applecakeslice"
+ trash = /obj/item/trash/plate
+ filling_color = "#EBF5B8"
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/pumpkinpie
+ name = "Pumpkin Pie"
+ desc = "A delicious treat for the autumn months."
+ icon_state = "pumpkinpie"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/pumpkinpieslice
+ slices_num = 5
+ filling_color = "#F5B951"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 15)
+
+/obj/item/weapon/reagent_containers/food/snacks/pumpkinpieslice
+ name = "Pumpkin Pie slice"
+ desc = "A slice of pumpkin pie, with whipped cream on top. Perfection."
+ icon_state = "pumpkinpieslice"
+ trash = /obj/item/trash/plate
+ filling_color = "#F5B951"
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/cracker
+ name = "Cracker"
+ desc = "It's a salted cracker."
+ icon_state = "cracker"
+ filling_color = "#F5DEB8"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 1)
+
+/obj/item/weapon/reagent_containers/food/snacks/rawcutlet
+ name = "raw cutlet"
+ desc = "A thin piece of raw meat."
+ icon = 'icons/obj/food/food_ingredients.dmi'
+ icon_state = "rawcutlet"
+ bitesize = 1
+ New()
+ ..()
+ reagents.add_reagent("protein", 1)
+ attackby(obj/item/weapon/W, mob/user, params)
+ if(istype(W,/obj/item/weapon/kitchen/knife))
+ user.visible_message( \
+ "[user] cuts the raw cutlet with the knife!", \
+ "You cut the raw cutlet with your knife!" \
+ )
+ new /obj/item/weapon/reagent_containers/food/snacks/raw_bacon(src.loc)
+ qdel(src)
+
+
+/////////////////////////////////////////////////PIZZA////////////////////////////////////////
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza
+ slices_num = 6
+ filling_color = "#BAA14C"
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/margherita
+ name = "Margherita"
+ desc = "The golden standard of pizzas."
+ icon_state = "pizzamargherita"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/margheritaslice
+ slices_num = 6
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 40)
+ reagents.add_reagent("tomatojuice", 6)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/margheritaslice
+ name = "Margherita slice"
+ desc = "A slice of the classic pizza."
+ icon_state = "pizzamargheritaslice"
+ filling_color = "#BAA14C"
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/meatpizza
+ name = "Meatpizza"
+ desc = "A pizza with meat topping."
+ icon_state = "meatpizza"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/meatpizzaslice
+ slices_num = 6
+ New()
+ ..()
+ reagents.add_reagent("protein", 30)
+ reagents.add_reagent("nutriment", 20)
+ reagents.add_reagent("tomatojuice", 6)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/meatpizzaslice
+ name = "Meatpizza slice"
+ desc = "A slice of a meaty pizza."
+ icon_state = "meatpizzaslice"
+ filling_color = "#BAA14C"
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/mushroompizza
+ name = "Mushroompizza"
+ desc = "Very special pizza"
+ icon_state = "mushroompizza"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/mushroompizzaslice
+ slices_num = 6
+ New()
+ ..()
+ reagents.add_reagent("plantmatter", 25)
+ reagents.add_reagent("nutriment", 10)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/mushroompizzaslice
+ name = "Mushroompizza slice"
+ desc = "Maybe it is the last slice of pizza in your life."
+ icon_state = "mushroompizzaslice"
+ filling_color = "#BAA14C"
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/vegetablepizza
+ name = "Vegetable pizza"
+ desc = "No one of Tomato Sapiens were harmed during making this pizza"
+ icon_state = "vegetablepizza"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/vegetablepizzaslice
+ slices_num = 6
+ New()
+ ..()
+ reagents.add_reagent("plantmatter", 20)
+ reagents.add_reagent("nutriment", 10)
+ reagents.add_reagent("tomatojuice", 6)
+ reagents.add_reagent("oculine", 12)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/vegetablepizzaslice
+ name = "Vegetable pizza slice"
+ desc = "A slice of the most green pizza of all pizzas not containing green ingredients "
+ icon_state = "vegetablepizzaslice"
+ filling_color = "#BAA14C"
+ bitesize = 2
+
+/obj/item/pizzabox
+ name = "pizza box"
+ desc = "A box suited for pizzas."
+ icon = 'icons/obj/food/food.dmi'
+ icon_state = "pizzabox1"
+
+ var/open = 0 // Is the box open?
+ var/ismessy = 0 // Fancy mess on the lid
+ var/obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/pizza // Content pizza
+ var/list/boxes = list() // If the boxes are stacked, they come here
+ var/boxtag = ""
+
+/obj/item/pizzabox/update_icon()
+
+ overlays = list()
+
+ // Set appropriate description
+ if( open && pizza )
+ desc = "A box suited for pizzas. It appears to have a [pizza.name] inside."
+ else if( boxes.len > 0 )
+ desc = "A pile of boxes suited for pizzas. There appears to be [boxes.len + 1] boxes in the pile."
+
+ var/obj/item/pizzabox/topbox = boxes[boxes.len]
+ var/toptag = topbox.boxtag
+ if( toptag != "" )
+ desc = "[desc] The box on top has a tag, it reads: '[toptag]'."
+ else
+ desc = "A box suited for pizzas."
+
+ if( boxtag != "" )
+ desc = "[desc] The box has a tag, it reads: '[boxtag]'."
+
+ // Icon states and overlays
+ if( open )
+ if( ismessy )
+ icon_state = "pizzabox_messy"
+ else
+ icon_state = "pizzabox_open"
+
+ if( pizza )
+ var/image/pizzaimg = image("food/food.dmi", icon_state = pizza.icon_state)
+ pizzaimg.pixel_y = -3
+ overlays += pizzaimg
+
+ return
+ else
+ // Stupid code because byondcode sucks
+ var/doimgtag = 0
+ if( boxes.len > 0 )
+ var/obj/item/pizzabox/topbox = boxes[boxes.len]
+ if( topbox.boxtag != "" )
+ doimgtag = 1
+ else
+ if( boxtag != "" )
+ doimgtag = 1
+
+ if( doimgtag )
+ var/image/tagimg = image("food/food.dmi", icon_state = "pizzabox_tag")
+ tagimg.pixel_y = boxes.len * 3
+ overlays += tagimg
+
+ icon_state = "pizzabox[boxes.len+1]"
+
+/obj/item/pizzabox/attack_hand( mob/user as mob )
+
+ if( open && pizza )
+ user.put_in_hands( pizza )
+
+ to_chat(user, "\red You take the [src.pizza] out of the [src].")
+ src.pizza = null
+ update_icon()
+ return
+
+ if( boxes.len > 0 )
+ if( user.get_inactive_hand() != src )
+ ..()
+ return
+
+ var/obj/item/pizzabox/box = boxes[boxes.len]
+ boxes -= box
+
+ user.put_in_hands( box )
+ to_chat(user, "\red You remove the topmost [src] from your hand.")
+ box.update_icon()
+ update_icon()
+ return
+ ..()
+
+/obj/item/pizzabox/attack_self( mob/user as mob )
+
+ if( boxes.len > 0 )
+ return
+
+ open = !open
+
+ if( open && pizza )
+ ismessy = 1
+
+ update_icon()
+
+/obj/item/pizzabox/attackby( obj/item/I as obj, mob/user as mob , params)
+ if( istype(I, /obj/item/pizzabox/) )
+ var/obj/item/pizzabox/box = I
+
+ if( !box.open && !src.open )
+ // Make a list of all boxes to be added
+ var/list/boxestoadd = list()
+ boxestoadd += box
+ for(var/obj/item/pizzabox/i in box.boxes)
+ boxestoadd += i
+
+ if( (boxes.len+1) + boxestoadd.len <= 5 )
+ user.drop_item()
+
+ box.loc = src
+ box.boxes = list() // Clear the box boxes so we don't have boxes inside boxes. - Xzibit
+ src.boxes.Add( boxestoadd )
+
+ box.update_icon()
+ update_icon()
+
+ to_chat(user, "\red You put the [box] ontop of the [src]!")
+ else
+ to_chat(user, "\red The stack is too high!")
+ else
+ to_chat(user, "\red Close the [box] first!")
+
+ return
+
+ if( istype(I, /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/) ) // Long ass fucking object name
+
+ if( src.open )
+ user.drop_item()
+ I.loc = src
+ src.pizza = I
+
+ update_icon()
+
+ to_chat(user, "\red You put the [I] in the [src]!")
+ else
+ to_chat(user, "\red You try to push the [I] through the lid but it doesn't work!")
+ return
+
+ if( istype(I, /obj/item/weapon/pen/) )
+
+ if( src.open )
+ return
+
+ var/t = input("Enter what you want to add to the tag:", "Write", null, null) as text
+
+ var/obj/item/pizzabox/boxtotagto = src
+ if( boxes.len > 0 )
+ boxtotagto = boxes[boxes.len]
+
+ boxtotagto.boxtag = copytext("[boxtotagto.boxtag][t]", 1, 30)
+
+ update_icon()
+ return
+ ..()
+
+/obj/item/pizzabox/margherita/New()
+ pizza = new /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/margherita(src)
+ boxtag = "Margherita Deluxe"
+
+/obj/item/pizzabox/vegetable/New()
+ pizza = new /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/vegetablepizza(src)
+ boxtag = "Gourmet Vegatable"
+
+/obj/item/pizzabox/mushroom/New()
+ pizza = new /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/mushroompizza(src)
+ boxtag = "Mushroom Special"
+
+/obj/item/pizzabox/meat/New()
+ pizza = new /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/meatpizza(src)
+ boxtag = "Meatlover's Supreme"
+
+////////////////////////////////FOOD ADDITIONS////////////////////////////////////////////
+
+/obj/item/weapon/reagent_containers/food/snacks/wrap
+ name = "egg wrap"
+ desc = "The precursor to Pigs in a Blanket."
+ icon_state = "wrap"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 5)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/beans
+ name = "tin of beans"
+ desc = "Musical fruit in a slightly less musical container."
+ icon_state = "beans"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 10)
+ reagents.add_reagent("beans",10)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/benedict
+ name = "eggs benedict"
+ desc = "There is only one egg on this, how rude."
+ icon_state = "benedict"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+ reagents.add_reagent("egg", 3)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/hotdog
+ name = "hotdog"
+ desc = "Fresh footlong ready to go down on."
+ icon_state = "hotdog"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+ reagents.add_reagent("ketchup", 3)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/meatbun
+ name = "meat bun"
+ desc = "Has the potential to not be Dog."
+ icon_state = "meatbun"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ bitesize = 6
+
+/obj/item/weapon/reagent_containers/food/snacks/icecreamsandwich
+ name = "icecream sandwich"
+ desc = "Portable Ice-cream in it's own packaging."
+ icon_state = "icecreamsandwich"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 2)
+ reagents.add_reagent("ice", 2)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/notasandwich
+ name = "not-a-sandwich"
+ desc = "Something seems to be wrong with this, you can't quite figure what. Maybe it's his moustache."
+ icon_state = "notasandwich"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/sugarcookie
+ name = "sugar cookie"
+ desc = "Just like your little sister used to make."
+ icon_state = "sugarcookie"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 2)
+ reagents.add_reagent("sugar", 5)
+ spawn(1)
+ reagents.del_reagent("egg")
+ reagents.update_total()
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/friedbanana
+ name = "Fried Banana"
+ desc = "Goreng Pisang, also known as fried bananas."
+ icon_state = "friedbanana"
+ New()
+ ..()
+ reagents.add_reagent("sugar", 5)
+ reagents.add_reagent("nutriment", 8)
+ reagents.add_reagent("cornoil", 4)
+
+/obj/item/weapon/reagent_containers/food/snacks/tofurkey
+ name = "Tofurkey"
+ desc = "A fake turkey made from tofu."
+ icon_state = "tofurkey"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 12)
+ reagents.add_reagent("ether", 3)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/stuffing
+ name = "Stuffing"
+ desc = "Moist, peppery breadcrumbs for filling the body cavities of dead birds. Dig in!"
+ icon_state = "stuffing"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+ bitesize = 1
+
+/obj/item/weapon/reagent_containers/food/snacks/dionaroast
+ name = "roast diona"
+ desc = "It's like an enormous, leathery carrot. With an eye."
+ icon_state = "dionaroast"
+ trash = /obj/item/trash/plate
+ filling_color = "#75754B"
+
+ New()
+ ..()
+ reagents.add_reagent("plantmatter", 4)
+ reagents.add_reagent("nutriment", 2)
+ reagents.add_reagent("radium", 2)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/boiledspiderleg
+ name = "boiled spider leg"
+ desc = "A giant spider's leg that's still twitching after being cooked. Gross!"
+ icon_state = "spiderlegcooked"
+ trash = /obj/item/trash/plate
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+ reagents.add_reagent("toxin", 2)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/spidereggs
+ name = "spider eggs"
+ desc = "A cluster of juicy spider eggs. A great side dish for when you care not for your health."
+ icon_state = "spidereggs"
+ New()
+ ..()
+ reagents.add_reagent("protein", 2)
+ reagents.add_reagent("toxin", 3)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/spidereggsham
+ name = "green eggs and ham"
+ desc = "Would you eat them on a train? Would you eat them on a plane? Would you eat them on a state of the art corporate deathtrap floating through space?"
+ icon_state = "spidereggsham"
+ trash = /obj/item/trash/plate
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ reagents.add_reagent("sodiumchloride", 1)
+ reagents.add_reagent("toxin", 3)
+ bitesize = 4
+
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/turkey
+ name = "Turkey"
+ desc = "A traditional turkey served with stuffing."
+ icon_state = "turkey"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/turkeyslice
+ slices_num = 6
+ New()
+ ..()
+ reagents.add_reagent("protein", 24)
+ reagents.add_reagent("nutriment", 18)
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/turkeyslice
+ name = "turkey serving"
+ desc = "A serving of some tender and delicious turkey."
+ icon_state = "turkeyslice"
+ trash = /obj/item/trash/plate
+ filling_color = "#B97A57"
+ bitesize = 2
+
+/obj/item/weapon/reagent_containers/food/snacks/mashed_potatoes //mashed taters
+ name = "mashed potatoes"
+ desc = "Some sot creamy, and irresistible mashed potatoes."
+ icon_state = "mashedtaters"
+ trash = /obj/item/trash/plate
+ filling_color = "#D6D9C1"
+ bitesize = 2
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 5)
+ reagents.add_reagent("gravy", 5)
+ reagents.add_reagent("mashedpotatoes", 10)
+ bitesize = 2
+
+////////////////////////////////ICE CREAM///////////////////////////////////
+/obj/item/weapon/reagent_containers/food/snacks/icecream
+ name = "ice cream"
+ desc = "Delicious ice cream."
+ icon = 'icons/obj/kitchen.dmi'
+ icon_state = "icecream_cone"
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 1)
+ reagents.add_reagent("sugar",1)
+ bitesize = 1
+ update_icon()
+
+ update_icon()
+ overlays.Cut()
+ var/image/filling = image('icons/obj/kitchen.dmi', src, "icecream_color")
+ filling.icon += mix_color_from_reagents(reagents.reagent_list)
+ overlays += filling
+
+/obj/item/weapon/reagent_containers/food/snacks/icecream/icecreamcone
+ name = "ice cream cone"
+ desc = "Delicious ice cream."
+ icon_state = "icecream_cone"
+ volume = 50
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 2)
+ reagents.add_reagent("sugar",6)
+ reagents.add_reagent("ice",2)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/icecream/icecreamcup
+ name = "chocolate ice cream cone"
+ desc = "Delicious ice cream."
+ icon_state = "icecream_cup"
+ volume = 50
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 4)
+ reagents.add_reagent("chocolate",8)
+ reagents.add_reagent("ice",2)
+ bitesize = 6
+
+/obj/item/weapon/reagent_containers/food/snacks/cereal
+ name = "box of cereal"
+ desc = "A box of cereal."
+ icon = 'icons/obj/food/food.dmi'
+ icon_state = "cereal_box"
+ bitesize = 2
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+/obj/item/weapon/reagent_containers/food/snacks/deepfryholder
+ name = "Deep Fried Foods Holder Obj"
+ desc = "If you can see this description the code for the deep fryer fucked up."
+ icon = 'icons/obj/food/food.dmi'
+ icon_state = "deepfried_holder_icon"
+ bitesize = 2
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+
+/obj/item/weapon/reagent_containers/food/snacks/dough
+ name = "dough"
+ desc = "A piece of dough."
+ icon = 'icons/obj/food/food_ingredients.dmi'
+ icon_state = "dough"
+ bitesize = 2
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+
+// Dough + rolling pin = flat dough
+/obj/item/weapon/reagent_containers/food/snacks/dough/attackby(obj/item/I, mob/user, params)
+ if(istype(I, /obj/item/weapon/kitchen/rollingpin))
+ if(isturf(loc))
+ new /obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough(loc)
+ to_chat(user, "You flatten [src].")
+ qdel(src)
+ else
+ to_chat(user, "You need to put [src] on a surface to roll it out!")
+ else
+ ..()
+
+// slicable into 3xdoughslices
+/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough
+ name = "flat dough"
+ desc = "Some flattened dough."
+ icon = 'icons/obj/food/food_ingredients.dmi'
+ icon_state = "flat dough"
+ slice_path = /obj/item/weapon/reagent_containers/food/snacks/doughslice
+ slices_num = 3
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+
+/obj/item/weapon/reagent_containers/food/snacks/doughslice
+ name = "dough slice"
+ desc = "The building block of an impressive dish."
+ icon = 'icons/obj/food/food_ingredients.dmi'
+ icon_state = "doughslice"
+ bitesize = 2
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 1)
+
+/obj/item/weapon/reagent_containers/food/snacks/bun
+ name = "bun"
+ desc = "The base for any self-respecting burger."
+ icon = 'icons/obj/food/food_ingredients.dmi'
+ icon_state = "bun"
+ bitesize = 2
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 4)
+ bitesize = 3
+
+/obj/item/weapon/reagent_containers/food/snacks/taco
+ name = "taco"
+ desc = "Take a bite!"
+ icon_state = "taco"
+ bitesize = 3
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 7)
+
+/obj/item/weapon/reagent_containers/food/snacks/cutlet
+ name = "cutlet"
+ desc = "A tasty meat slice."
+ icon = 'icons/obj/food/food_ingredients.dmi'
+ icon_state = "cutlet"
+ bitesize = 2
+ New()
+ ..()
+ reagents.add_reagent("protein", 2)
+
+/obj/item/weapon/reagent_containers/food/snacks/rawmeatball
+ name = "raw meatball"
+ desc = "A raw meatball."
+ icon = 'icons/obj/food/food_ingredients.dmi'
+ icon_state = "rawmeatball"
+ bitesize = 2
+ New()
+ ..()
+ reagents.add_reagent("protein", 2)
+
+/obj/item/weapon/reagent_containers/food/snacks/hotdog
+ name = "hotdog"
+ desc = "Unrelated to dogs, maybe."
+ icon_state = "hotdog"
+ bitesize = 2
+ New()
+ ..()
+ reagents.add_reagent("protein", 6)
+
+/obj/item/weapon/reagent_containers/food/snacks/flatbread
+ name = "flatbread"
+ desc = "Bland but filling."
+ icon = 'icons/obj/food/food_ingredients.dmi'
+ icon_state = "flatbread"
+ bitesize = 2
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 3)
+
+/obj/item/weapon/reagent_containers/food/snacks/rawsticks
+ name = "raw potato sticks"
+ desc = "Raw fries, not very tasty."
+ icon = 'icons/obj/food/food_ingredients.dmi'
+ icon_state = "rawsticks"
+ bitesize = 2
+ New()
+ ..()
+ reagents.add_reagent("plantmatter", 3)
+
+/obj/item/weapon/reagent_containers/food/snacks/ectoplasm
+ name = "ectoplasm"
+ desc = "A luminescent blob of what scientists refer to as 'ghost goo'."
+ icon = 'icons/obj/wizard.dmi'
+ icon_state = "ectoplasm"
+ New()
+ ..()
+ reagents.add_reagent("ectoplasm", 10)
+
+/obj/item/weapon/reagent_containers/food/snacks/liquidfood
+ name = "\improper LiquidFood Ration"
+ desc = "A prepackaged grey slurry of all the essential nutrients for a spacefarer on the go. Should this be crunchy?"
+ icon_state = "liquidfood"
+ trash = /obj/item/trash/liquidfood
+ filling_color = "#A8A8A8"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 20)
+ reagents.add_reagent("iron", 3)
+ bitesize = 4
+
+
+/obj/item/weapon/reagent_containers/food/snacks/tastybread
+ name = "bread tube"
+ desc = "Bread in a tube. Chewy...and surprisingly tasty."
+ icon_state = "tastybread"
+ trash = /obj/item/trash/tastybread
+ filling_color = "#A66829"
+
+ New()
+ ..()
+ reagents.add_reagent("nutriment", 6)
+ bitesize = 2
diff --git a/code/modules/food/candy_maker.dm b/code/modules/food_and_drinks/kitchen_machinery/candy_maker.dm
similarity index 100%
rename from code/modules/food/candy_maker.dm
rename to code/modules/food_and_drinks/kitchen_machinery/candy_maker.dm
diff --git a/code/modules/food/cereal_maker.dm b/code/modules/food_and_drinks/kitchen_machinery/cereal_maker.dm
similarity index 97%
rename from code/modules/food/cereal_maker.dm
rename to code/modules/food_and_drinks/kitchen_machinery/cereal_maker.dm
index 3e682f5028c..d7b0d75a430 100644
--- a/code/modules/food/cereal_maker.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/cereal_maker.dm
@@ -1,24 +1,24 @@
-/obj/machinery/cooker/cerealmaker
- name = "cereal maker"
- desc = "Now with Dann O's available!"
- icon = 'icons/obj/cooking_machines.dmi'
- icon_state = "cereal_off"
- thiscooktype = "cerealized"
- cooktime = 200
- onicon = "cereal_on"
- officon = "cereal_off"
-
-obj/machinery/cooker/cerealmaker/setIcon(obj/item/copyme, obj/item/copyto)
- var/image/img = new(copyme.icon, copyme.icon_state)
- img.transform *= 0.7
- copyto.overlays += img
- copyto.overlays += copyme.overlays
-
-obj/machinery/cooker/cerealmaker/changename(obj/item/name, obj/item/setme)
- setme.name = "box of [name] cereal"
- setme.desc = "[name.desc] It has been [thiscooktype]"
-
-obj/machinery/cooker/cerealmaker/gettype()
- var/obj/item/weapon/reagent_containers/food/snacks/cereal/type = new(get_turf(src))
- return type
-
+/obj/machinery/cooker/cerealmaker
+ name = "cereal maker"
+ desc = "Now with Dann O's available!"
+ icon = 'icons/obj/cooking_machines.dmi'
+ icon_state = "cereal_off"
+ thiscooktype = "cerealized"
+ cooktime = 200
+ onicon = "cereal_on"
+ officon = "cereal_off"
+
+obj/machinery/cooker/cerealmaker/setIcon(obj/item/copyme, obj/item/copyto)
+ var/image/img = new(copyme.icon, copyme.icon_state)
+ img.transform *= 0.7
+ copyto.overlays += img
+ copyto.overlays += copyme.overlays
+
+obj/machinery/cooker/cerealmaker/changename(obj/item/name, obj/item/setme)
+ setme.name = "box of [name] cereal"
+ setme.desc = "[name.desc] It has been [thiscooktype]"
+
+obj/machinery/cooker/cerealmaker/gettype()
+ var/obj/item/weapon/reagent_containers/food/snacks/cereal/type = new(get_turf(src))
+ return type
+
diff --git a/code/modules/food/cooker.dm b/code/modules/food_and_drinks/kitchen_machinery/cooker.dm
similarity index 83%
rename from code/modules/food/cooker.dm
rename to code/modules/food_and_drinks/kitchen_machinery/cooker.dm
index 40e04817209..381525a13ae 100644
--- a/code/modules/food/cooker.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/cooker.dm
@@ -9,16 +9,18 @@
var/on = 0
var/onicon = null
var/officon = null
+ var/openicon = null
var/thiscooktype = null
var/burns = 0 // whether a machine burns something - if it does, you probably want to add the cooktype to /snacks/badrecipe
var/firechance = 0
var/cooktime = 0
var/foodcolor = null
var/has_specials = 0 //Set to 1 if the machine has specials to check, otherwise leave it at 0
+ var/upgradeable = 0 //Set to 1 if the machine supports upgrades / deconstruction, or else it will ignore stuff like screwdrivers and parts exchangers
// checks if the snack has been cooked in a certain way
/obj/machinery/cooker/proc/checkCooked(obj/item/weapon/reagent_containers/food/snacks/D)
- if (D.cooktype[thiscooktype])
+ if(D.cooktype[thiscooktype])
return 1
return 0
@@ -57,15 +59,15 @@
// Burns the food with a chance of starting a fire - for if you try cooking something that's already been cooked that way
// if burns = 0 then it'll just tell you that the item is already that foodtype and it would do nothing
-// if you wanted a different side effect set burns to 1 and override burn()
-/obj/machinery/cooker/proc/burn(mob/user, obj/item/weapon/reagent_containers/props)
+// if you wanted a different side effect set burns to 1 and override burn_food()
+/obj/machinery/cooker/proc/burn_food(mob/user, obj/item/weapon/reagent_containers/props)
var/obj/item/weapon/reagent_containers/food/snacks/badrecipe/burnt = new(get_turf(src))
setRegents(props, burnt)
to_chat(user, "You smell burning coming from the [src]!")
var/datum/effect/system/bad_smoke_spread/smoke = new /datum/effect/system/bad_smoke_spread() // burning things makes smoke!
smoke.set_up(5, 0, src)
smoke.start()
- if (prob(firechance))
+ if(prob(firechance))
var/turf/location = get_turf(src)
var/obj/effect/decal/cleanable/liquid_fuel/oil = new(location)
oil.name = "fat"
@@ -91,9 +93,24 @@
return type
/obj/machinery/cooker/attackby(obj/item/I, mob/user, params)
+ if(upgradeable)
+ //Not all cooker types currently support build/upgrade stuff, so not all of it will work well with this
+ //Until we decide whether or not we want to bring back the cereal maker or old grill/oven in some form, this initial check will have to suffice
+ if(isscrewdriver(I))
+ default_deconstruction_screwdriver(user, openicon, officon, I)
+ return
+ if(iscrowbar(I))
+ default_deconstruction_crowbar(I)
+ return
+ if(istype(I, /obj/item/weapon/storage/part_replacer))
+ exchange_parts(user, I)
+ return
if(stat & (NOPOWER|BROKEN))
return
- if (!checkValid(I, user))
+ if(panel_open)
+ to_chat(user, "Close the panel first!")
+ return
+ if(!checkValid(I, user))
return
if(!burns)
if(istype(I, /obj/item/weapon/reagent_containers/food/snacks))
@@ -113,7 +130,7 @@
return
if(istype(I, /obj/item/weapon/reagent_containers/food/snacks))
if(checkCooked(I))
- burn(user, I)
+ burn_food(user, I)
turnoff(I)
return
var/obj/item/weapon/reagent_containers/food/snacks/newfood = gettype()
diff --git a/code/modules/food/deep_fryer.dm b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm
similarity index 63%
rename from code/modules/food/deep_fryer.dm
rename to code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm
index 96e5fb94c57..73607d4e3ab 100644
--- a/code/modules/food/deep_fryer.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm
@@ -1,74 +1,100 @@
-/obj/machinery/cooker/deepfryer
- name = "deep fryer"
- desc = "Deep fried everything."
- icon = 'icons/obj/cooking_machines.dmi'
- icon_state = "fryer_off"
- thiscooktype = "deep fried"
- burns = 1
- firechance = 100
- cooktime = 200
- foodcolor = "#FFAD33"
- officon = "fryer_off"
- onicon = "fryer_on"
- has_specials = 1
-
-
-/obj/machinery/cooker/deepfryer/gettype()
- var/obj/item/weapon/reagent_containers/food/snacks/deepfryholder/type = new(get_turf(src))
- return type
-
-/obj/machinery/cooker/deepfryer/checkSpecials(obj/item/I)
- if(!I)
- return 0
- for (var/Type in subtypesof(/datum/deepfryer_special))
- var/datum/deepfryer_special/P = new Type()
- if(istype(I, /obj/item/weapon/reagent_containers/food/snacks/grown))
- var/obj/item/weapon/reagent_containers/food/snacks/grown/G = I
- if(G.seed.kitchen_tag != P.input)
- continue
- else if (!istype(I, P.input))
- continue
- return P
- return 0
-
-/obj/machinery/cooker/deepfryer/cookSpecial(special)
- if(!special)
- return 0
- var/datum/deepfryer_special/recipe = special
- if(!recipe.output)
- return 0
- new recipe.output(get_turf(src))
-
-
-//////////////////////////////////
-// Deepfryer Special //
-// Interaction Datums //
-//////////////////////////////////
-
-/datum/deepfryer_special
- var/input //Thing that goes in
- var/output //Thing that comes out
-
-/datum/deepfryer_special/shrimp
- input = /obj/item/weapon/reagent_containers/food/snacks/shrimp
- output = /obj/item/weapon/reagent_containers/food/snacks/fried_shrimp
-
-/datum/deepfryer_special/banana
- input = "banana"
- output = /obj/item/weapon/reagent_containers/food/snacks/friedbanana
-
-/datum/deepfryer_special/potato_chips
- input = /obj/item/weapon/reagent_containers/food/snacks/rawsticks
- output = /obj/item/weapon/reagent_containers/food/snacks/chips
-
-/datum/deepfryer_special/corn_chips
- input = "corn"
- output = /obj/item/weapon/reagent_containers/food/snacks/cornchips
-
-/datum/deepfryer_special/fried_tofu
- input = /obj/item/weapon/reagent_containers/food/snacks/tofu
- output = /obj/item/weapon/reagent_containers/food/snacks/fried_tofu
-
-/datum/deepfryer_special/chimichanga
- input = /obj/item/weapon/reagent_containers/food/snacks/burrito
+/obj/machinery/cooker/deepfryer
+ name = "deep fryer"
+ desc = "Deep fried everything."
+ icon = 'icons/obj/cooking_machines.dmi'
+ icon_state = "fryer_off"
+ thiscooktype = "deep fried"
+ burns = 1
+ firechance = 100
+ cooktime = 200
+ foodcolor = "#FFAD33"
+ officon = "fryer_off"
+ onicon = "fryer_on"
+ openicon = "fryer_open"
+ has_specials = 1
+ upgradeable = 1
+
+/obj/machinery/cooker/deepfryer/New()
+ ..()
+ component_parts = list()
+ component_parts += new /obj/item/weapon/circuitboard/deepfryer(null)
+ component_parts += new /obj/item/weapon/stock_parts/micro_laser(null)
+ component_parts += new /obj/item/weapon/stock_parts/micro_laser(null)
+ component_parts += new /obj/item/stack/cable_coil(null, 5)
+ RefreshParts()
+
+/obj/machinery/cooker/deepfryer/upgraded/New()
+ ..()
+ component_parts = list()
+ component_parts += new /obj/item/weapon/circuitboard/deepfryer(null)
+ component_parts += new /obj/item/weapon/stock_parts/micro_laser/ultra(null)
+ component_parts += new /obj/item/weapon/stock_parts/micro_laser/ultra(null)
+ component_parts += new /obj/item/stack/cable_coil(null, 5)
+ RefreshParts()
+
+/obj/machinery/cooker/deepfryer/RefreshParts()
+ var/E = 0
+ for(var/obj/item/weapon/stock_parts/micro_laser/L in component_parts)
+ E += L.rating
+ E -= 2 //Standard parts is 0 (1+1-2), Tier 4 parts is 6 (4+4-2)
+ cooktime = (200 - (E * 20)) //Effectively each laser improves cooktime by 20 per rating beyond the first (200 base, 80 max upgrade)
+
+/obj/machinery/cooker/deepfryer/gettype()
+ var/obj/item/weapon/reagent_containers/food/snacks/deepfryholder/type = new(get_turf(src))
+ return type
+
+/obj/machinery/cooker/deepfryer/checkSpecials(obj/item/I)
+ if(!I)
+ return 0
+ for(var/Type in subtypesof(/datum/deepfryer_special))
+ var/datum/deepfryer_special/P = new Type()
+ if(istype(I, /obj/item/weapon/reagent_containers/food/snacks/grown))
+ var/obj/item/weapon/reagent_containers/food/snacks/grown/G = I
+ if(G.seed.kitchen_tag != P.input)
+ continue
+ else if(!istype(I, P.input))
+ continue
+ return P
+ return 0
+
+/obj/machinery/cooker/deepfryer/cookSpecial(special)
+ if(!special)
+ return 0
+ var/datum/deepfryer_special/recipe = special
+ if(!recipe.output)
+ return 0
+ new recipe.output(get_turf(src))
+
+
+//////////////////////////////////
+// Deepfryer Special //
+// Interaction Datums //
+//////////////////////////////////
+
+/datum/deepfryer_special
+ var/input //Thing that goes in
+ var/output //Thing that comes out
+
+/datum/deepfryer_special/shrimp
+ input = /obj/item/weapon/reagent_containers/food/snacks/shrimp
+ output = /obj/item/weapon/reagent_containers/food/snacks/fried_shrimp
+
+/datum/deepfryer_special/banana
+ input = "banana"
+ output = /obj/item/weapon/reagent_containers/food/snacks/friedbanana
+
+/datum/deepfryer_special/potato_chips
+ input = /obj/item/weapon/reagent_containers/food/snacks/rawsticks
+ output = /obj/item/weapon/reagent_containers/food/snacks/chips
+
+/datum/deepfryer_special/corn_chips
+ input = "corn"
+ output = /obj/item/weapon/reagent_containers/food/snacks/cornchips
+
+/datum/deepfryer_special/fried_tofu
+ input = /obj/item/weapon/reagent_containers/food/snacks/tofu
+ output = /obj/item/weapon/reagent_containers/food/snacks/fried_tofu
+
+/datum/deepfryer_special/chimichanga
+ input = /obj/item/weapon/reagent_containers/food/snacks/burrito
output = /obj/item/weapon/reagent_containers/food/snacks/chimichanga
\ No newline at end of file
diff --git a/code/modules/food/food_grill.dm b/code/modules/food_and_drinks/kitchen_machinery/food_grill.dm
similarity index 95%
rename from code/modules/food/food_grill.dm
rename to code/modules/food_and_drinks/kitchen_machinery/food_grill.dm
index f3b0c296763..54290c80b37 100644
--- a/code/modules/food/food_grill.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/food_grill.dm
@@ -1,29 +1,29 @@
-/obj/machinery/cooker/foodgrill
- name = "grill"
- desc = "Backyard grilling, IN SPACE."
- icon = 'icons/obj/cooking_machines.dmi'
- icon_state = "grill_off"
- thiscooktype = "grilled"
- burns = 1
- firechance = 20
- cooktime = 50
- foodcolor = "#A34719"
- onicon = "grill_on"
- officon = "grill_off"
-
-obj/machinery/cooker/foodgrill/putIn(obj/item/In, mob/chef)
- ..()
- var/image/img = new(In.icon, In.icon_state)
- img.pixel_y = 5
- overlays += img
- sleep(50)
- overlays = 0
- img.color = "#C28566"
- overlays += img
- sleep(50)
- overlays = 0
- img.color = "#A34719"
- overlays += img
- sleep(50)
- overlays = 0
-
+/obj/machinery/cooker/foodgrill
+ name = "grill"
+ desc = "Backyard grilling, IN SPACE."
+ icon = 'icons/obj/cooking_machines.dmi'
+ icon_state = "grill_off"
+ thiscooktype = "grilled"
+ burns = 1
+ firechance = 20
+ cooktime = 50
+ foodcolor = "#A34719"
+ onicon = "grill_on"
+ officon = "grill_off"
+
+obj/machinery/cooker/foodgrill/putIn(obj/item/In, mob/chef)
+ ..()
+ var/image/img = new(In.icon, In.icon_state)
+ img.pixel_y = 5
+ overlays += img
+ sleep(50)
+ overlays = 0
+ img.color = "#C28566"
+ overlays += img
+ sleep(50)
+ overlays = 0
+ img.color = "#A34719"
+ overlays += img
+ sleep(50)
+ overlays = 0
+
diff --git a/code/game/machinery/kitchen/gibber.dm b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm
similarity index 95%
rename from code/game/machinery/kitchen/gibber.dm
rename to code/modules/food_and_drinks/kitchen_machinery/gibber.dm
index 4c271a08f44..b71bb0be2d4 100644
--- a/code/game/machinery/kitchen/gibber.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm
@@ -1,393 +1,393 @@
-#define GIBBER_ANIMATION_DELAY 16
-/obj/machinery/gibber
- name = "Gibber"
- desc = "The name isn't descriptive enough?"
- icon = 'icons/obj/kitchen.dmi'
- icon_state = "grinder"
- density = 1
- anchored = 1
- var/operating = 0 //Is it on?
- var/dirty = 0 // Does it need cleaning?
- var/mob/living/occupant // Mob who has been put inside
- var/locked = 0 //Used to prevent mobs from breaking the feedin anim
-
- var/gib_throw_dir = WEST // Direction to spit meat and gibs in. Defaults to west.
- var/gibtime = 40 // Time from starting until meat appears
-
- var/list/victims = list()
-
- use_power = 1
- idle_power_usage = 2
- active_power_usage = 500
-
-/obj/machinery/gibber/Destroy()
- if(contents.len)
- for(var/atom/movable/A in contents)
- A.loc = get_turf(src)
- if(occupant) occupant = null
- return ..()
-
-/obj/machinery/gibber/RefreshParts() //If you want to make the machine upgradable, this is where you would change any vars basd on its stock parts.
- return
-
-/obj/machinery/gibber/New()
- ..()
- overlays += image('icons/obj/kitchen.dmi', "grjam")
-
-/obj/machinery/gibber/update_icon()
- overlays.Cut()
-
- if(dirty)
- overlays += image('icons/obj/kitchen.dmi', "grbloody")
-
- if(stat & (NOPOWER|BROKEN))
- return
-
- if(!occupant)
- overlays += image('icons/obj/kitchen.dmi', "grjam")
-
- else if(operating)
- overlays += image('icons/obj/kitchen.dmi', "gruse")
-
- else
- overlays += image('icons/obj/kitchen.dmi', "gridle")
-
-/obj/machinery/gibber/relaymove(mob/user as mob)
- if(locked)
- return
-
- go_out()
-
-/obj/machinery/gibber/attack_hand(mob/user as mob)
- if(stat & (NOPOWER|BROKEN))
- return
-
- if(operating)
- to_chat(user, "The gibber is locked and running, wait for it to finish.")
- return
-
- if(locked)
- to_chat(user, "Wait for [occupant.name] to finish being loaded!")
- return
-
- else
- startgibbing(user)
-
-/obj/machinery/gibber/attackby(obj/item/P as obj, mob/user as mob, params)
- if(istype(P, /obj/item/weapon/grab))
- var/obj/item/weapon/grab/G = P
- if(G.state < 2)
- to_chat(user, "You need a better grip to do that!")
- return
- move_into_gibber(user,G.affecting)
- qdel(G)
- return
-
- if(default_deconstruction_screwdriver(user, "grinder_open", "grinder", P))
- return
-
- if(exchange_parts(user, P))
- return
-
- if(default_unfasten_wrench(user, P))
- return
-
- default_deconstruction_crowbar(P)
-
-/obj/machinery/gibber/MouseDrop_T(mob/target, mob/user)
- if(user.incapacitated() || !ishuman(user))
- return
-
- if(!isliving(target))
- return
-
- var/mob/living/targetl = target
-
- if(targetl.buckled)
- return
-
- move_into_gibber(user,target)
-
-/obj/machinery/gibber/proc/move_into_gibber(var/mob/user,var/mob/living/victim)
- if(occupant)
- to_chat(user, "The gibber is full, empty it first!")
- return
-
- if(operating)
- to_chat(user, "The gibber is locked and running, wait for it to finish.")
- return
-
- if(!ishuman(victim) || issmall(victim))
- to_chat(user, "This is not suitable for the gibber!")
- return
-
- if(victim.abiotic(1))
- to_chat(user, "Subject may not have abiotic items on.")
- return
-
- user.visible_message("[user] starts to put [victim] into the gibber!")
- src.add_fingerprint(user)
- if(do_after(user, 30, target = victim) && user.Adjacent(src) && victim.Adjacent(user) && !occupant)
- user.visible_message("[user] stuffs [victim] into the gibber!")
-
- victim.forceMove(src)
- occupant = victim
-
- update_icon()
- feedinTopanim()
-
-/obj/machinery/gibber/verb/eject()
- set category = "Object"
- set name = "Empty Gibber"
- set src in oview(1)
-
- if(usr.stat != CONSCIOUS)
- return
-
- go_out()
- add_fingerprint(usr)
-
-/obj/machinery/gibber/proc/go_out()
- if(operating || !occupant) //no going out if operating, just in case they manage to trigger go_out before being dead
- return
-
- if(locked)
- return
-
- for(var/obj/O in src)
- O.loc = src.loc
-
- occupant.forceMove(get_turf(src))
- occupant = null
-
- update_icon()
-
- return
-
-/obj/machinery/gibber/proc/feedinTopanim()
- if(!occupant)
- return
-
- locked = 1 //lock gibber
-
- var/image/gibberoverlay = new //used to simulate 3D effects
- gibberoverlay.icon = icon
- gibberoverlay.icon_state = "grinderoverlay"
- gibberoverlay.overlays += image('icons/obj/kitchen.dmi', "gridle")
-
- var/image/feedee = new
- occupant.dir = 2
- feedee.icon = getFlatIcon(occupant, 2) //makes the image a copy of the occupant
-
- var/atom/movable/holder = new //holder for occupant image
- holder.name = null //make unclickable
- holder.overlays += feedee //add occupant to holder overlays
- holder.pixel_y = 25 //above the gibber
- holder.pixel_x = 2
- holder.loc = get_turf(src)
- holder.layer = MOB_LAYER //simulate mob-like layering
- holder.anchored = 1
-
- var/atom/movable/holder2 = new //holder for gibber overlay, used to simulate 3D effect
- holder2.name = null
- holder2.overlays += gibberoverlay
- holder2.loc = get_turf(src)
- holder2.layer = MOB_LAYER + 0.1 //3D, it's above the mob, rest of the gibber is behind
- holder2.anchored = 1
-
- animate(holder, pixel_y = 16, time = GIBBER_ANIMATION_DELAY) //animate going down
-
- sleep(GIBBER_ANIMATION_DELAY)
-
- holder.overlays -= feedee //reset static icon
- feedee.icon += icon('icons/obj/kitchen.dmi', "footicon") //this is some byond magic; += to the icon var with a black and white image will mask it
- holder.overlays += feedee
- animate(holder, pixel_y = -3, time = GIBBER_ANIMATION_DELAY) //animate going down further
-
- sleep(GIBBER_ANIMATION_DELAY) //time everything right, animate doesn't prevent proc from continuing
-
- qdel(holder) //get rid of holder object
- qdel(holder2) //get rid of holder object
- locked = 0 //unlock
-
-/obj/machinery/gibber/proc/startgibbing(var/mob/user, var/UserOverride=0)
- if(!istype(user) && !UserOverride)
- log_debug("Some shit just went down with the gibber at X[x], Y[y], Z[z] with an invalid user. (JMP)")
- return
-
- if(UserOverride)
- msg_admin_attack("[key_name_admin(occupant)] was gibbed by an autogibber (\the [src]) (JMP)")
-
- if(operating)
- return
-
- if(!occupant)
- visible_message("You hear a loud metallic grinding sound.")
- return
-
- use_power(1000)
- visible_message("You hear a loud squelchy grinding sound.")
-
- operating = 1
- update_icon()
- var/offset = prob(50) ? -2 : 2
- animate(src, pixel_x = pixel_x + offset, time = 0.2, loop = 200) //start shaking
-
- var/slab_name = occupant.name
- var/slab_count = 3
- var/slab_type = /obj/item/weapon/reagent_containers/food/snacks/meat/human //gibber can only gib humans on paracode, no need to check meat type
- var/slab_nutrition = src.occupant.nutrition / 15
-
- slab_nutrition /= slab_count
-
- for(var/i=1 to slab_count)
- var/obj/item/weapon/reagent_containers/food/snacks/meat/new_meat = new slab_type(src)
- new_meat.name = "[slab_name] [new_meat.name]"
- new_meat.reagents.add_reagent("nutriment",slab_nutrition)
-
-
- if(occupant.reagents)
- occupant.reagents.trans_to(new_meat, round(occupant.reagents.total_volume/slab_count,1))
-
- if(occupant.get_species() == "Human")
- new /obj/item/stack/sheet/animalhide/human(src)
- new /obj/effect/decal/cleanable/blood/gibs(src)
-
- if(!UserOverride)
- occupant.attack_log += "\[[time_stamp()]\] Was gibbed by [key_name(user)]" //One shall not simply gib a mob unnoticed!
- user.attack_log += "\[[time_stamp()]\] Gibbed [key_name(occupant)]"
-
- if(occupant.ckey)
- msg_admin_attack("[key_name_admin(user)] gibbed [key_name_admin(occupant)]")
-
- if(!iscarbon(user))
- occupant.LAssailant = null
- else
- occupant.LAssailant = user
-
- else //this looks ugly but it's better than a copy-pasted startgibbing proc override
- occupant.attack_log += "\[[time_stamp()]\] Was gibbed by an autogibber (\the [src])"
-
- occupant.emote("scream")
- playsound(get_turf(src), 'sound/goonstation/effects/gib.ogg', 50, 1)
-
- victims += "\[[time_stamp()]\] [occupant.name] ([occupant.ckey]) killed by [UserOverride ? "Autogibbing" : "[user] ([user.ckey])"]" //have to do this before ghostizing
- occupant.death(1)
- occupant.ghostize()
-
- qdel(occupant)
-
- spawn(gibtime)
- playsound(get_turf(src), 'sound/effects/splat.ogg', 50, 1)
- operating = 0
-
- for (var/obj/item/thing in contents) //Meat is spawned inside the gibber and thrown out afterwards.
- thing.loc = get_turf(thing) // Drop it onto the turf for throwing.
- thing.throw_at(get_edge_target_turf(src,gib_throw_dir),rand(1,5),15) // Being pelted with bits of meat and bone would hurt.
- sleep(1)
-
- for (var/obj/effect/gibs in contents) //throw out the gibs too
- gibs.loc = get_turf(gibs) //drop onto turf for throwing
- gibs.throw_at(get_edge_target_turf(src,gib_throw_dir),rand(1,5),15)
- sleep(1)
-
- pixel_x = initial(pixel_x) //return to it's spot after shaking
- operating = 0
- update_icon()
-
-
-
-/* AUTOGIBBER */
-
-
-//gibs anything that stands on it's input
-
-/obj/machinery/gibber/autogibber
- var/acceptdir = NORTH
- var/lastacceptdir = NORTH
- var/turf/lturf
-
-/obj/machinery/gibber/autogibber/New()
- ..()
- spawn(5)
- var/turf/T = get_step(src, acceptdir)
- if(istype(T))
- lturf = T
- component_parts = list()
- component_parts += new /obj/item/weapon/circuitboard/gibber(null)
- component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
- component_parts += new /obj/item/weapon/stock_parts/manipulator(null)
- RefreshParts()
-
-/obj/machinery/gibber/autogibber/process()
- if(!lturf || occupant || locked || dirty || operating)
- return
-
- if(acceptdir != lastacceptdir)
- lturf = null
- lastacceptdir = acceptdir
- var/turf/T = get_step(src, acceptdir)
- if(istype(T))
- lturf = T
-
- for(var/mob/living/carbon/human/H in lturf)
- if(istype(H) && H.loc == lturf)
- visible_message({"\The [src] states, "Food detected!""})
- sleep(30)
- if(H.loc == lturf) //still standing there
- if(force_move_into_gibber(H))
- ejectclothes(occupant)
- cleanbay()
- startgibbing(null, 1)
- break
-
-/obj/machinery/gibber/autogibber/proc/force_move_into_gibber(var/mob/living/carbon/human/victim)
- if(!istype(victim)) return 0
- visible_message("\The [victim.name] gets sucked into \the [src]!")
-
- victim.forceMove(src)
- occupant = victim
-
- update_icon()
- feedinTopanim()
- return 1
-
-/obj/machinery/gibber/autogibber/proc/ejectclothes(var/mob/living/carbon/human/H)
- if(!istype(H)) return 0
- if(H != occupant) return 0 //only using H as a shortcut to typecast
- for(var/obj/O in H)
- if(istype(O,/obj/item/clothing)) //clothing gets skipped to avoid cleaning out shit
- continue
- if(istype(O,/obj/item/weapon/implant))
- var/obj/item/weapon/implant/I = O
- if(I.implanted)
- continue
- if(istype(O,/obj/item/organ))
- continue
- if(O.flags & NODROP)
- qdel(O) //they are already dead by now
- H.unEquip(O)
- O.loc = src.loc
- O.throw_at(get_edge_target_turf(src,gib_throw_dir),rand(1,5),15)
- sleep(1)
-
- for(var/obj/item/clothing/C in H)
- if(C.flags & NODROP)
- qdel(C)
- H.unEquip(C)
- C.loc = src.loc
- C.throw_at(get_edge_target_turf(src,gib_throw_dir),rand(1,5),15)
- sleep(1)
-
- visible_message("\The [src] spits out \the [H.name]'s possessions!")
-
-/obj/machinery/gibber/autogibber/proc/cleanbay()
- var/spats = 0 //keeps track of how many items get spit out. Don't show a message if none are found.
- for(var/obj/O in src)
- if(istype(O))
- O.loc = src.loc
- O.throw_at(get_edge_target_turf(src,gib_throw_dir),rand(1,5),15)
- spats++
- sleep(1)
- if(spats)
- visible_message("\The [src] spits out more possessions!")
+#define GIBBER_ANIMATION_DELAY 16
+/obj/machinery/gibber
+ name = "Gibber"
+ desc = "The name isn't descriptive enough?"
+ icon = 'icons/obj/kitchen.dmi'
+ icon_state = "grinder"
+ density = 1
+ anchored = 1
+ var/operating = 0 //Is it on?
+ var/dirty = 0 // Does it need cleaning?
+ var/mob/living/occupant // Mob who has been put inside
+ var/locked = 0 //Used to prevent mobs from breaking the feedin anim
+
+ var/gib_throw_dir = WEST // Direction to spit meat and gibs in. Defaults to west.
+ var/gibtime = 40 // Time from starting until meat appears
+
+ var/list/victims = list()
+
+ use_power = 1
+ idle_power_usage = 2
+ active_power_usage = 500
+
+/obj/machinery/gibber/Destroy()
+ if(contents.len)
+ for(var/atom/movable/A in contents)
+ A.loc = get_turf(src)
+ if(occupant) occupant = null
+ return ..()
+
+/obj/machinery/gibber/RefreshParts() //If you want to make the machine upgradable, this is where you would change any vars basd on its stock parts.
+ return
+
+/obj/machinery/gibber/New()
+ ..()
+ overlays += image('icons/obj/kitchen.dmi', "grjam")
+
+/obj/machinery/gibber/update_icon()
+ overlays.Cut()
+
+ if(dirty)
+ overlays += image('icons/obj/kitchen.dmi', "grbloody")
+
+ if(stat & (NOPOWER|BROKEN))
+ return
+
+ if(!occupant)
+ overlays += image('icons/obj/kitchen.dmi', "grjam")
+
+ else if(operating)
+ overlays += image('icons/obj/kitchen.dmi', "gruse")
+
+ else
+ overlays += image('icons/obj/kitchen.dmi', "gridle")
+
+/obj/machinery/gibber/relaymove(mob/user as mob)
+ if(locked)
+ return
+
+ go_out()
+
+/obj/machinery/gibber/attack_hand(mob/user as mob)
+ if(stat & (NOPOWER|BROKEN))
+ return
+
+ if(operating)
+ to_chat(user, "The gibber is locked and running, wait for it to finish.")
+ return
+
+ if(locked)
+ to_chat(user, "Wait for [occupant.name] to finish being loaded!")
+ return
+
+ else
+ startgibbing(user)
+
+/obj/machinery/gibber/attackby(obj/item/P as obj, mob/user as mob, params)
+ if(istype(P, /obj/item/weapon/grab))
+ var/obj/item/weapon/grab/G = P
+ if(G.state < 2)
+ to_chat(user, "You need a better grip to do that!")
+ return
+ move_into_gibber(user,G.affecting)
+ qdel(G)
+ return
+
+ if(default_deconstruction_screwdriver(user, "grinder_open", "grinder", P))
+ return
+
+ if(exchange_parts(user, P))
+ return
+
+ if(default_unfasten_wrench(user, P))
+ return
+
+ default_deconstruction_crowbar(P)
+
+/obj/machinery/gibber/MouseDrop_T(mob/target, mob/user)
+ if(user.incapacitated() || !ishuman(user))
+ return
+
+ if(!isliving(target))
+ return
+
+ var/mob/living/targetl = target
+
+ if(targetl.buckled)
+ return
+
+ move_into_gibber(user,target)
+
+/obj/machinery/gibber/proc/move_into_gibber(var/mob/user,var/mob/living/victim)
+ if(occupant)
+ to_chat(user, "The gibber is full, empty it first!")
+ return
+
+ if(operating)
+ to_chat(user, "The gibber is locked and running, wait for it to finish.")
+ return
+
+ if(!ishuman(victim) || issmall(victim))
+ to_chat(user, "This is not suitable for the gibber!")
+ return
+
+ if(victim.abiotic(1))
+ to_chat(user, "Subject may not have abiotic items on.")
+ return
+
+ user.visible_message("[user] starts to put [victim] into the gibber!")
+ src.add_fingerprint(user)
+ if(do_after(user, 30, target = victim) && user.Adjacent(src) && victim.Adjacent(user) && !occupant)
+ user.visible_message("[user] stuffs [victim] into the gibber!")
+
+ victim.forceMove(src)
+ occupant = victim
+
+ update_icon()
+ feedinTopanim()
+
+/obj/machinery/gibber/verb/eject()
+ set category = "Object"
+ set name = "Empty Gibber"
+ set src in oview(1)
+
+ if(usr.stat != CONSCIOUS)
+ return
+
+ go_out()
+ add_fingerprint(usr)
+
+/obj/machinery/gibber/proc/go_out()
+ if(operating || !occupant) //no going out if operating, just in case they manage to trigger go_out before being dead
+ return
+
+ if(locked)
+ return
+
+ for(var/obj/O in src)
+ O.loc = src.loc
+
+ occupant.forceMove(get_turf(src))
+ occupant = null
+
+ update_icon()
+
+ return
+
+/obj/machinery/gibber/proc/feedinTopanim()
+ if(!occupant)
+ return
+
+ locked = 1 //lock gibber
+
+ var/image/gibberoverlay = new //used to simulate 3D effects
+ gibberoverlay.icon = icon
+ gibberoverlay.icon_state = "grinderoverlay"
+ gibberoverlay.overlays += image('icons/obj/kitchen.dmi', "gridle")
+
+ var/image/feedee = new
+ occupant.dir = 2
+ feedee.icon = getFlatIcon(occupant, 2) //makes the image a copy of the occupant
+
+ var/atom/movable/holder = new //holder for occupant image
+ holder.name = null //make unclickable
+ holder.overlays += feedee //add occupant to holder overlays
+ holder.pixel_y = 25 //above the gibber
+ holder.pixel_x = 2
+ holder.loc = get_turf(src)
+ holder.layer = MOB_LAYER //simulate mob-like layering
+ holder.anchored = 1
+
+ var/atom/movable/holder2 = new //holder for gibber overlay, used to simulate 3D effect
+ holder2.name = null
+ holder2.overlays += gibberoverlay
+ holder2.loc = get_turf(src)
+ holder2.layer = MOB_LAYER + 0.1 //3D, it's above the mob, rest of the gibber is behind
+ holder2.anchored = 1
+
+ animate(holder, pixel_y = 16, time = GIBBER_ANIMATION_DELAY) //animate going down
+
+ sleep(GIBBER_ANIMATION_DELAY)
+
+ holder.overlays -= feedee //reset static icon
+ feedee.icon += icon('icons/obj/kitchen.dmi', "footicon") //this is some byond magic; += to the icon var with a black and white image will mask it
+ holder.overlays += feedee
+ animate(holder, pixel_y = -3, time = GIBBER_ANIMATION_DELAY) //animate going down further
+
+ sleep(GIBBER_ANIMATION_DELAY) //time everything right, animate doesn't prevent proc from continuing
+
+ qdel(holder) //get rid of holder object
+ qdel(holder2) //get rid of holder object
+ locked = 0 //unlock
+
+/obj/machinery/gibber/proc/startgibbing(var/mob/user, var/UserOverride=0)
+ if(!istype(user) && !UserOverride)
+ log_debug("Some shit just went down with the gibber at X[x], Y[y], Z[z] with an invalid user. (JMP)")
+ return
+
+ if(UserOverride)
+ msg_admin_attack("[key_name_admin(occupant)] was gibbed by an autogibber (\the [src]) (JMP)")
+
+ if(operating)
+ return
+
+ if(!occupant)
+ visible_message("You hear a loud metallic grinding sound.")
+ return
+
+ use_power(1000)
+ visible_message("You hear a loud squelchy grinding sound.")
+
+ operating = 1
+ update_icon()
+ var/offset = prob(50) ? -2 : 2
+ animate(src, pixel_x = pixel_x + offset, time = 0.2, loop = 200) //start shaking
+
+ var/slab_name = occupant.name
+ var/slab_count = 3
+ var/slab_type = /obj/item/weapon/reagent_containers/food/snacks/meat/human //gibber can only gib humans on paracode, no need to check meat type
+ var/slab_nutrition = src.occupant.nutrition / 15
+
+ slab_nutrition /= slab_count
+
+ for(var/i=1 to slab_count)
+ var/obj/item/weapon/reagent_containers/food/snacks/meat/new_meat = new slab_type(src)
+ new_meat.name = "[slab_name] [new_meat.name]"
+ new_meat.reagents.add_reagent("nutriment",slab_nutrition)
+
+
+ if(occupant.reagents)
+ occupant.reagents.trans_to(new_meat, round(occupant.reagents.total_volume/slab_count,1))
+
+ if(occupant.get_species() == "Human")
+ new /obj/item/stack/sheet/animalhide/human(src)
+ new /obj/effect/decal/cleanable/blood/gibs(src)
+
+ if(!UserOverride)
+ occupant.attack_log += "\[[time_stamp()]\] Was gibbed by [key_name(user)]" //One shall not simply gib a mob unnoticed!
+ user.attack_log += "\[[time_stamp()]\] Gibbed [key_name(occupant)]"
+
+ if(occupant.ckey)
+ msg_admin_attack("[key_name_admin(user)] gibbed [key_name_admin(occupant)]")
+
+ if(!iscarbon(user))
+ occupant.LAssailant = null
+ else
+ occupant.LAssailant = user
+
+ else //this looks ugly but it's better than a copy-pasted startgibbing proc override
+ occupant.attack_log += "\[[time_stamp()]\] Was gibbed by an autogibber (\the [src])"
+
+ occupant.emote("scream")
+ playsound(get_turf(src), 'sound/goonstation/effects/gib.ogg', 50, 1)
+
+ victims += "\[[time_stamp()]\] [occupant.name] ([occupant.ckey]) killed by [UserOverride ? "Autogibbing" : "[user] ([user.ckey])"]" //have to do this before ghostizing
+ occupant.death(1)
+ occupant.ghostize()
+
+ qdel(occupant)
+
+ spawn(gibtime)
+ playsound(get_turf(src), 'sound/effects/splat.ogg', 50, 1)
+ operating = 0
+
+ for(var/obj/item/thing in contents) //Meat is spawned inside the gibber and thrown out afterwards.
+ thing.loc = get_turf(thing) // Drop it onto the turf for throwing.
+ thing.throw_at(get_edge_target_turf(src,gib_throw_dir),rand(1,5),15) // Being pelted with bits of meat and bone would hurt.
+ sleep(1)
+
+ for(var/obj/effect/gibs in contents) //throw out the gibs too
+ gibs.loc = get_turf(gibs) //drop onto turf for throwing
+ gibs.throw_at(get_edge_target_turf(src,gib_throw_dir),rand(1,5),15)
+ sleep(1)
+
+ pixel_x = initial(pixel_x) //return to it's spot after shaking
+ operating = 0
+ update_icon()
+
+
+
+/* AUTOGIBBER */
+
+
+//gibs anything that stands on it's input
+
+/obj/machinery/gibber/autogibber
+ var/acceptdir = NORTH
+ var/lastacceptdir = NORTH
+ var/turf/lturf
+
+/obj/machinery/gibber/autogibber/New()
+ ..()
+ spawn(5)
+ var/turf/T = get_step(src, acceptdir)
+ if(istype(T))
+ lturf = T
+ component_parts = list()
+ component_parts += new /obj/item/weapon/circuitboard/gibber(null)
+ component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
+ component_parts += new /obj/item/weapon/stock_parts/manipulator(null)
+ RefreshParts()
+
+/obj/machinery/gibber/autogibber/process()
+ if(!lturf || occupant || locked || dirty || operating)
+ return
+
+ if(acceptdir != lastacceptdir)
+ lturf = null
+ lastacceptdir = acceptdir
+ var/turf/T = get_step(src, acceptdir)
+ if(istype(T))
+ lturf = T
+
+ for(var/mob/living/carbon/human/H in lturf)
+ if(istype(H) && H.loc == lturf)
+ visible_message({"\The [src] states, "Food detected!""})
+ sleep(30)
+ if(H.loc == lturf) //still standing there
+ if(force_move_into_gibber(H))
+ ejectclothes(occupant)
+ cleanbay()
+ startgibbing(null, 1)
+ break
+
+/obj/machinery/gibber/autogibber/proc/force_move_into_gibber(var/mob/living/carbon/human/victim)
+ if(!istype(victim)) return 0
+ visible_message("\The [victim.name] gets sucked into \the [src]!")
+
+ victim.forceMove(src)
+ occupant = victim
+
+ update_icon()
+ feedinTopanim()
+ return 1
+
+/obj/machinery/gibber/autogibber/proc/ejectclothes(var/mob/living/carbon/human/H)
+ if(!istype(H)) return 0
+ if(H != occupant) return 0 //only using H as a shortcut to typecast
+ for(var/obj/O in H)
+ if(istype(O,/obj/item/clothing)) //clothing gets skipped to avoid cleaning out shit
+ continue
+ if(istype(O,/obj/item/weapon/implant))
+ var/obj/item/weapon/implant/I = O
+ if(I.implanted)
+ continue
+ if(istype(O,/obj/item/organ))
+ continue
+ if(O.flags & NODROP)
+ qdel(O) //they are already dead by now
+ H.unEquip(O)
+ O.loc = src.loc
+ O.throw_at(get_edge_target_turf(src,gib_throw_dir),rand(1,5),15)
+ sleep(1)
+
+ for(var/obj/item/clothing/C in H)
+ if(C.flags & NODROP)
+ qdel(C)
+ H.unEquip(C)
+ C.loc = src.loc
+ C.throw_at(get_edge_target_turf(src,gib_throw_dir),rand(1,5),15)
+ sleep(1)
+
+ visible_message("\The [src] spits out \the [H.name]'s possessions!")
+
+/obj/machinery/gibber/autogibber/proc/cleanbay()
+ var/spats = 0 //keeps track of how many items get spit out. Don't show a message if none are found.
+ for(var/obj/O in src)
+ if(istype(O))
+ O.loc = src.loc
+ O.throw_at(get_edge_target_turf(src,gib_throw_dir),rand(1,5),15)
+ spats++
+ sleep(1)
+ if(spats)
+ visible_message("\The [src] spits out more possessions!")
diff --git a/code/modules/food/grill_new.dm b/code/modules/food_and_drinks/kitchen_machinery/grill_new.dm
similarity index 100%
rename from code/modules/food/grill_new.dm
rename to code/modules/food_and_drinks/kitchen_machinery/grill_new.dm
diff --git a/code/modules/food/icecream_vat.dm b/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm
similarity index 97%
rename from code/modules/food/icecream_vat.dm
rename to code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm
index 6c23d781818..8452009a390 100644
--- a/code/modules/food/icecream_vat.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm
@@ -1,253 +1,253 @@
-//ICE CREAM MACHINE
-//Code made by Sawu at Sawu-Station.
-
-/obj/machinery/icemachine
- name = "\improper Cream-Master Deluxe"
- density = 1
- anchored = 1
- icon = 'icons/obj/cooking_machines.dmi'
- icon_state = "icecream_vat"
- use_power = 1
- idle_power_usage = 20
- var/obj/item/weapon/reagent_containers/glass/beaker = null
- var/useramount = 15 //Last used amount
-
-
-/obj/machinery/icemachine/proc/generate_name(reagent_name)
- var/name_prefix = pick("Mr.","Mrs.","Super","Happy","Whippy")
- var/name_suffix = pick(" Whippy "," Slappy "," Creamy "," Dippy "," Swirly "," Swirl ")
- var/cone_name = null //Heart failure prevention.
- cone_name += name_prefix
- cone_name += name_suffix
- cone_name += "[reagent_name]"
- return cone_name
-
-
-/obj/machinery/icemachine/New()
- var/datum/reagents/R = new/datum/reagents(500)
- reagents = R
- R.my_atom = src
-
-
-/obj/machinery/icemachine/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/weapon/reagent_containers/glass))
- if(beaker)
- to_chat(user, "A container is already inside [src].")
- return
- if(!user.drop_item())
- to_chat(user, "\The [I] is stuck to you!")
- return
- beaker = I
- I.forceMove(src)
- to_chat(user, "You add [I] to [src]")
- updateUsrDialog()
- return
- if(istype(I, /obj/item/weapon/reagent_containers/food/snacks/icecream))
- if(!I.reagents.has_reagent("sprinkles"))
- if(I.reagents.total_volume > 29) I.reagents.remove_any(1)
- I.reagents.add_reagent("sprinkles",1)
- var/image/sprinkles = image('icons/obj/kitchen.dmi', src, "sprinkles")
- I.overlays += sprinkles
- I.name += " with sprinkles"
- I.desc += ". This also has sprinkles."
- else
- to_chat(user, "This [I] already has sprinkles.")
-
-
-/obj/machinery/icemachine/proc/validexchange(reag)
- if(reag == "sprinkles" | reag == "cola" | reag == "kahlua" | reag == "dr_gibb" | reag == "vodka" | reag == "space_up" | reag == "rum" | reag == "spacemountainwind" | reag == "gin" | reag == "cream" | reag == "water")
- return 1
- else
- if(reagents.total_volume < 500)
- to_chat(usr, "[src] vibrates for a moment, apparently accepting the unknown liquid.")
- playsound(loc, 'sound/machines/twobeep.ogg', 10, 1)
- return 1
-
-
-/obj/machinery/icemachine/Topic(href, href_list)
- if(..()) return
-
- add_fingerprint(usr)
- usr.set_machine(src)
-
- if(href_list["close"])
- usr << browse(null, "window=cream_master")
- usr.unset_machine()
- return
-
- var/obj/item/weapon/reagent_containers/glass/A = null
- var/datum/reagents/R = null
-
- if(beaker)
- A = beaker
- R = A.reagents
-
- if(href_list["add"])
- if(href_list["amount"])
- var/id = href_list["add"]
- var/amount = text2num(href_list["amount"])
- if(validexchange(id))
- R.trans_id_to(src, id, amount)
-
- else if(href_list["remove"])
- if(href_list["amount"])
- var/id = href_list["remove"]
- var/amount = text2num(href_list["amount"])
- if(beaker == null)
- reagents.remove_reagent(id,amount)
- else
- if(validexchange(id))
- reagents.trans_id_to(A, id, amount)
- else
- reagents.remove_reagent(id,amount)
-
- else if(href_list["main"])
- attack_hand(usr)
- return
-
- else if(href_list["eject"])
- if(beaker)
- A.forceMove(loc)
- beaker = null
- reagents.trans_to(A,reagents.total_volume)
-
- else if(href_list["synthcond"])
- if(href_list["type"])
- var/ID = text2num(href_list["type"])
- /*
- if(ID == 1)
- reagents.add_reagent("sprinkles",1)
- */ //Sprinkles are now created by using the ice cream on the machine
- if(ID == 2 | ID == 3)
- var/brand = pick(1,2,3,4)
- if(brand == 1)
- if(ID == 2)
- reagents.add_reagent("cola",5)
- else
- reagents.add_reagent("kahlua",5)
- else if(brand == 2)
- if(ID == 2)
- reagents.add_reagent("dr_gibb",5)
- else
- reagents.add_reagent("vodka",5)
- else if(brand == 3)
- if(ID == 2)
- reagents.add_reagent("space_up",5)
- else
- reagents.add_reagent("rum",5)
- else if(brand == 4)
- if(ID == 2)
- reagents.add_reagent("spacemountainwind",5)
- else
- reagents.add_reagent("gin",5)
- else if(ID == 4)
- if(reagents.total_volume <= 500 & reagents.total_volume >= 15)
- reagents.add_reagent("cream",(30 - reagents.total_volume))
- else if(reagents.total_volume <= 15)
- reagents.add_reagent("cream",(15 - reagents.total_volume))
- else if(ID == 5)
- if(reagents.total_volume <= 500 & reagents.total_volume >= 15)
- reagents.add_reagent("water",(30 - reagents.total_volume))
- else if(reagents.total_volume <= 15)
- reagents.add_reagent("water",(15 - reagents.total_volume))
-
- else if(href_list["createcup"])
- var/name = generate_name(reagents.get_master_reagent_name())
- name += " Chocolate Cone"
- var/obj/item/weapon/reagent_containers/food/snacks/icecream/icecreamcup/C
- C = new/obj/item/weapon/reagent_containers/food/snacks/icecream/icecreamcup(loc)
- C.name = "[name]"
- C.pixel_x = rand(-8, 8)
- C.pixel_y = -16
- reagents.trans_to(C,30)
- if(reagents)
- reagents.clear_reagents()
- C.update_icon()
-
- else if(href_list["createcone"])
- var/name = generate_name(reagents.get_master_reagent_name())
- name += " Cone"
- var/obj/item/weapon/reagent_containers/food/snacks/icecream/icecreamcone/C
- C = new/obj/item/weapon/reagent_containers/food/snacks/icecream/icecreamcone(loc)
- C.name = "[name]"
- C.pixel_x = rand(-8, 8)
- C.pixel_y = -16
- reagents.trans_to(C,15)
- if(reagents)
- reagents.clear_reagents()
- C.update_icon()
- updateUsrDialog()
-
-
-/obj/machinery/icemachine/attack_ai(mob/user)
- return attack_hand(user)
-
-
-/obj/machinery/icemachine/proc/show_toppings()
- var/dat = ""
- if(reagents.total_volume <= 500)
- dat += ""
- dat += "Add fillings: "
- dat += "Soda "
- dat += "Alcohol "
- dat += "Finish With: "
- dat += "Cream "
- dat += "Water "
- dat += "Dispense in: "
- dat += "Chocolate Cone "
- dat += "Cone "
- dat += ""
- return dat
-
-
-/obj/machinery/icemachine/proc/show_reagents(container)
- //1 = beaker / 2 = internal
- var/dat = ""
- if(container == 1)
- var/obj/item/weapon/reagent_containers/glass/A = beaker
- var/datum/reagents/R = A.reagents
- dat += "The container has: "
- for(var/datum/reagent/G in R.reagent_list)
- dat += "[G.volume] unit(s) of [G.name] | "
- dat += "(5) "
- dat += "(10) "
- dat += "(15) "
- dat += "(All)"
- dat += " "
- else if(container == 2)
- dat += " The Cream-Master has: "
- if(reagents.total_volume)
- for(var/datum/reagent/N in reagents.reagent_list)
- dat += "[N.volume] unit(s) of [N.name] | "
- dat += "(5) "
- dat += "(10) "
- dat += "(15) "
- dat += "(All)"
- dat += " "
- else
- dat += " SOMEONE ENTERED AN INVALID REAGENT CONTAINER; QUICK, BUG REPORT! "
- return dat
-
-
-/obj/machinery/icemachine/attack_hand(mob/user)
- if(..()) return
- user.set_machine(src)
- var/dat = ""
- if(!beaker)
- dat += "No container is loaded into the machine, external transfer offline. "
- dat += show_reagents(2)
- dat += show_toppings()
- dat += "Close"
- else
- var/obj/item/weapon/reagent_containers/glass/A = beaker
- var/datum/reagents/R = A.reagents
- dat += "Eject container and end transfer. "
- if(!R.total_volume)
- dat += "Container is empty. "
- else
- dat += show_reagents(1)
- dat += show_reagents(2)
- dat += show_toppings()
- var/datum/browser/popup = new(user, "cream_master","Cream-Master Deluxe", 700, 400, src)
- popup.set_content(dat)
- popup.open()
+//ICE CREAM MACHINE
+//Code made by Sawu at Sawu-Station.
+
+/obj/machinery/icemachine
+ name = "\improper Cream-Master Deluxe"
+ density = 1
+ anchored = 1
+ icon = 'icons/obj/cooking_machines.dmi'
+ icon_state = "icecream_vat"
+ use_power = 1
+ idle_power_usage = 20
+ var/obj/item/weapon/reagent_containers/glass/beaker = null
+ var/useramount = 15 //Last used amount
+
+
+/obj/machinery/icemachine/proc/generate_name(reagent_name)
+ var/name_prefix = pick("Mr.","Mrs.","Super","Happy","Whippy")
+ var/name_suffix = pick(" Whippy "," Slappy "," Creamy "," Dippy "," Swirly "," Swirl ")
+ var/cone_name = null //Heart failure prevention.
+ cone_name += name_prefix
+ cone_name += name_suffix
+ cone_name += "[reagent_name]"
+ return cone_name
+
+
+/obj/machinery/icemachine/New()
+ var/datum/reagents/R = new/datum/reagents(500)
+ reagents = R
+ R.my_atom = src
+
+
+/obj/machinery/icemachine/attackby(obj/item/I, mob/user, params)
+ if(istype(I, /obj/item/weapon/reagent_containers/glass))
+ if(beaker)
+ to_chat(user, "A container is already inside [src].")
+ return
+ if(!user.drop_item())
+ to_chat(user, "\The [I] is stuck to you!")
+ return
+ beaker = I
+ I.forceMove(src)
+ to_chat(user, "You add [I] to [src]")
+ updateUsrDialog()
+ return
+ if(istype(I, /obj/item/weapon/reagent_containers/food/snacks/icecream))
+ if(!I.reagents.has_reagent("sprinkles"))
+ if(I.reagents.total_volume > 29) I.reagents.remove_any(1)
+ I.reagents.add_reagent("sprinkles",1)
+ var/image/sprinkles = image('icons/obj/kitchen.dmi', src, "sprinkles")
+ I.overlays += sprinkles
+ I.name += " with sprinkles"
+ I.desc += ". This also has sprinkles."
+ else
+ to_chat(user, "This [I] already has sprinkles.")
+
+
+/obj/machinery/icemachine/proc/validexchange(reag)
+ if(reag == "sprinkles" | reag == "cola" | reag == "kahlua" | reag == "dr_gibb" | reag == "vodka" | reag == "space_up" | reag == "rum" | reag == "spacemountainwind" | reag == "gin" | reag == "cream" | reag == "water")
+ return 1
+ else
+ if(reagents.total_volume < 500)
+ to_chat(usr, "[src] vibrates for a moment, apparently accepting the unknown liquid.")
+ playsound(loc, 'sound/machines/twobeep.ogg', 10, 1)
+ return 1
+
+
+/obj/machinery/icemachine/Topic(href, href_list)
+ if(..()) return
+
+ add_fingerprint(usr)
+ usr.set_machine(src)
+
+ if(href_list["close"])
+ usr << browse(null, "window=cream_master")
+ usr.unset_machine()
+ return
+
+ var/obj/item/weapon/reagent_containers/glass/A = null
+ var/datum/reagents/R = null
+
+ if(beaker)
+ A = beaker
+ R = A.reagents
+
+ if(href_list["add"])
+ if(href_list["amount"])
+ var/id = href_list["add"]
+ var/amount = text2num(href_list["amount"])
+ if(validexchange(id))
+ R.trans_id_to(src, id, amount)
+
+ else if(href_list["remove"])
+ if(href_list["amount"])
+ var/id = href_list["remove"]
+ var/amount = text2num(href_list["amount"])
+ if(beaker == null)
+ reagents.remove_reagent(id,amount)
+ else
+ if(validexchange(id))
+ reagents.trans_id_to(A, id, amount)
+ else
+ reagents.remove_reagent(id,amount)
+
+ else if(href_list["main"])
+ attack_hand(usr)
+ return
+
+ else if(href_list["eject"])
+ if(beaker)
+ A.forceMove(loc)
+ beaker = null
+ reagents.trans_to(A,reagents.total_volume)
+
+ else if(href_list["synthcond"])
+ if(href_list["type"])
+ var/ID = text2num(href_list["type"])
+ /*
+ if(ID == 1)
+ reagents.add_reagent("sprinkles",1)
+ */ //Sprinkles are now created by using the ice cream on the machine
+ if(ID == 2 | ID == 3)
+ var/brand = pick(1,2,3,4)
+ if(brand == 1)
+ if(ID == 2)
+ reagents.add_reagent("cola",5)
+ else
+ reagents.add_reagent("kahlua",5)
+ else if(brand == 2)
+ if(ID == 2)
+ reagents.add_reagent("dr_gibb",5)
+ else
+ reagents.add_reagent("vodka",5)
+ else if(brand == 3)
+ if(ID == 2)
+ reagents.add_reagent("space_up",5)
+ else
+ reagents.add_reagent("rum",5)
+ else if(brand == 4)
+ if(ID == 2)
+ reagents.add_reagent("spacemountainwind",5)
+ else
+ reagents.add_reagent("gin",5)
+ else if(ID == 4)
+ if(reagents.total_volume <= 500 & reagents.total_volume >= 15)
+ reagents.add_reagent("cream",(30 - reagents.total_volume))
+ else if(reagents.total_volume <= 15)
+ reagents.add_reagent("cream",(15 - reagents.total_volume))
+ else if(ID == 5)
+ if(reagents.total_volume <= 500 & reagents.total_volume >= 15)
+ reagents.add_reagent("water",(30 - reagents.total_volume))
+ else if(reagents.total_volume <= 15)
+ reagents.add_reagent("water",(15 - reagents.total_volume))
+
+ else if(href_list["createcup"])
+ var/name = generate_name(reagents.get_master_reagent_name())
+ name += " Chocolate Cone"
+ var/obj/item/weapon/reagent_containers/food/snacks/icecream/icecreamcup/C
+ C = new/obj/item/weapon/reagent_containers/food/snacks/icecream/icecreamcup(loc)
+ C.name = "[name]"
+ C.pixel_x = rand(-8, 8)
+ C.pixel_y = -16
+ reagents.trans_to(C,30)
+ if(reagents)
+ reagents.clear_reagents()
+ C.update_icon()
+
+ else if(href_list["createcone"])
+ var/name = generate_name(reagents.get_master_reagent_name())
+ name += " Cone"
+ var/obj/item/weapon/reagent_containers/food/snacks/icecream/icecreamcone/C
+ C = new/obj/item/weapon/reagent_containers/food/snacks/icecream/icecreamcone(loc)
+ C.name = "[name]"
+ C.pixel_x = rand(-8, 8)
+ C.pixel_y = -16
+ reagents.trans_to(C,15)
+ if(reagents)
+ reagents.clear_reagents()
+ C.update_icon()
+ updateUsrDialog()
+
+
+/obj/machinery/icemachine/attack_ai(mob/user)
+ return attack_hand(user)
+
+
+/obj/machinery/icemachine/proc/show_toppings()
+ var/dat = ""
+ if(reagents.total_volume <= 500)
+ dat += ""
+ dat += "Add fillings: "
+ dat += "Soda "
+ dat += "Alcohol "
+ dat += "Finish With: "
+ dat += "Cream "
+ dat += "Water "
+ dat += "Dispense in: "
+ dat += "Chocolate Cone "
+ dat += "Cone "
+ dat += ""
+ return dat
+
+
+/obj/machinery/icemachine/proc/show_reagents(container)
+ //1 = beaker / 2 = internal
+ var/dat = ""
+ if(container == 1)
+ var/obj/item/weapon/reagent_containers/glass/A = beaker
+ var/datum/reagents/R = A.reagents
+ dat += "The container has: "
+ for(var/datum/reagent/G in R.reagent_list)
+ dat += "[G.volume] unit(s) of [G.name] | "
+ dat += "(5) "
+ dat += "(10) "
+ dat += "(15) "
+ dat += "(All)"
+ dat += " "
+ else if(container == 2)
+ dat += " The Cream-Master has: "
+ if(reagents.total_volume)
+ for(var/datum/reagent/N in reagents.reagent_list)
+ dat += "[N.volume] unit(s) of [N.name] | "
+ dat += "(5) "
+ dat += "(10) "
+ dat += "(15) "
+ dat += "(All)"
+ dat += " "
+ else
+ dat += " SOMEONE ENTERED AN INVALID REAGENT CONTAINER; QUICK, BUG REPORT! "
+ return dat
+
+
+/obj/machinery/icemachine/attack_hand(mob/user)
+ if(..()) return
+ user.set_machine(src)
+ var/dat = ""
+ if(!beaker)
+ dat += "No container is loaded into the machine, external transfer offline. "
+ dat += show_reagents(2)
+ dat += show_toppings()
+ dat += "Close"
+ else
+ var/obj/item/weapon/reagent_containers/glass/A = beaker
+ var/datum/reagents/R = A.reagents
+ dat += "Eject container and end transfer. "
+ if(!R.total_volume)
+ dat += "Container is empty. "
+ else
+ dat += show_reagents(1)
+ dat += show_reagents(2)
+ dat += show_toppings()
+ var/datum/browser/popup = new(user, "cream_master","Cream-Master Deluxe", 700, 400, src)
+ popup.set_content(dat)
+ popup.open()
diff --git a/code/game/machinery/kitchen/icecream_vat.dm b/code/modules/food_and_drinks/kitchen_machinery/icecream_vat_2.dm
similarity index 96%
rename from code/game/machinery/kitchen/icecream_vat.dm
rename to code/modules/food_and_drinks/kitchen_machinery/icecream_vat_2.dm
index a5e1cc1eafb..91db3bd7416 100644
--- a/code/game/machinery/kitchen/icecream_vat.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/icecream_vat_2.dm
@@ -87,7 +87,9 @@ var/list/ingredients_source = list(
dat += "No beaker inserted. "
dat += "RefreshClose"
- user << browse(dat,"window=icecreamvat;size=600x400")
+ var/datum/browser/popup = new(user, "icecreamvat", name, 600, 400)
+ popup.set_content(dat)
+ popup.open(0)
/obj/machinery/icecream_vat/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
if(istype(O, /obj/item/weapon/reagent_containers))
@@ -97,7 +99,7 @@ var/list/ingredients_source = list(
if(ingredients[ICECREAM_VANILLA] > 0)
var/flavour_name = get_icecream_flavour_string(dispense_flavour)
if(dispense_flavour < 11 && ingredients[dispense_flavour] > 0)
- src.visible_message("\icon[src] [user] scoops delicious [flavour_name] flavoured icecream into [I].")
+ src.visible_message("[bicon(src)] [user] scoops delicious [flavour_name] flavoured icecream into [I].")
ingredients[dispense_flavour] -= 1
ingredients[ICECREAM_VANILLA] -= 1
@@ -126,7 +128,7 @@ var/list/ingredients_source = list(
var/obj/item/weapon/reagent_containers/R = O
if(R.reagents)
src.visible_message("[user] has emptied all of [R] into [src].")
- for (var/datum/reagent/current_reagent in R.reagents.reagent_list)
+ for(var/datum/reagent/current_reagent in R.reagents.reagent_list)
if(ingredients_source[current_reagent.id])
add(ingredients_source[current_reagent.id], current_reagent.volume / 2)
else
diff --git a/code/game/machinery/kitchen/juicer.dm b/code/modules/food_and_drinks/kitchen_machinery/juicer.dm
similarity index 81%
rename from code/game/machinery/kitchen/juicer.dm
rename to code/modules/food_and_drinks/kitchen_machinery/juicer.dm
index 7b25e683941..87baef54b18 100644
--- a/code/game/machinery/kitchen/juicer.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/juicer.dm
@@ -1,183 +1,185 @@
-
-/obj/machinery/juicer
- name = "Juicer"
- icon = 'icons/obj/kitchen.dmi'
- icon_state = "juicer1"
- layer = 2.9
- density = 0
- anchored = 0
- use_power = 1
- idle_power_usage = 5
- active_power_usage = 100
- var/obj/item/weapon/reagent_containers/beaker = null
- var/global/list/allowed_items = list(
- /obj/item/weapon/reagent_containers/food/snacks/watermelonslice = "watermelonjuice",
- /obj/item/weapon/reagent_containers/food/snacks/grown = "water",
- )
-
- var/global/list/allowed_tags = list (
- "tomato" = "tomatojuice",
- "carrot" = "carrotjuice",
- "berries" = "berryjuice",
- "banana" = "banana",
- "potato" = "potato",
- "lemon" = "lemonjuice",
- "orange" = "orangejuice",
- "lime" = "limejuice",
- "poisonberries" = "poisonberryjuice",
- )
-
-/obj/machinery/juicer/New()
- beaker = new /obj/item/weapon/reagent_containers/glass/beaker/large(src)
-
-/obj/machinery/juicer/update_icon()
- icon_state = "juicer"+num2text(!isnull(beaker))
- return
-
-
-/obj/machinery/juicer/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
- if (istype(O,/obj/item/weapon/reagent_containers/glass) || \
- istype(O,/obj/item/weapon/reagent_containers/food/drinks/drinkingglass))
- if (beaker)
- return 1
- else
- if(!user.unEquip(O))
- to_chat(user, "\the [O] is stuck to your hand, you cannot put it in \the [src]")
- return 0
- O.forceMove(src)
- beaker = O
- src.verbs += /obj/machinery/juicer/verb/detach
- update_icon()
- src.updateUsrDialog()
- return 0
- if (!is_type_in_list(O, allowed_items))
- to_chat(user, "It doesn't look like that contains any juice.")
- return 1
- if(!user.unEquip(O))
- to_chat(user, "\the [O] is stuck to your hand, you cannot put it in \the [src]")
- return 0
- O.forceMove(src)
- src.updateUsrDialog()
- return 0
-
-/obj/machinery/juicer/attack_ai(mob/user as mob)
- return 0
-
-/obj/machinery/juicer/attack_hand(mob/user as mob)
- user.set_machine(src)
- interact(user)
-
-/obj/machinery/juicer/interact(mob/user as mob) // The microwave Menu
- var/is_chamber_empty = 0
- var/is_beaker_ready = 0
- var/processing_chamber = ""
- var/beaker_contents = ""
-
- for (var/i in allowed_items)
- for (var/obj/item/O in src.contents)
- if (!istype(O,i))
- continue
- processing_chamber+= "some [O] "
- break
- if (!processing_chamber)
- is_chamber_empty = 1
- processing_chamber = "Nothing."
- if (!beaker)
- beaker_contents = "\The [src] has no beaker attached."
- else if (!beaker.reagents.total_volume)
- beaker_contents = "\The [src] has attached an empty beaker."
- is_beaker_ready = 1
- else if (beaker.reagents.total_volume < beaker.reagents.maximum_volume)
- beaker_contents = "\The [src] has attached a beaker with something."
- is_beaker_ready = 1
- else
- beaker_contents = "\The [src] has attached a beaker and beaker is full!"
-
- var/dat = {"
-Processing chamber contains:
-[processing_chamber]
-[beaker_contents]
-"}
- if (is_beaker_ready && !is_chamber_empty && !(stat & (NOPOWER|BROKEN)))
- dat += "Turn on! "
- if (beaker)
- dat += "Detach a beaker! "
- user << browse("Juicer[dat]", "window=juicer")
- onclose(user, "juicer")
- return
-
-
-/obj/machinery/juicer/Topic(href, href_list)
- if(..())
- return
- usr.set_machine(src)
- switch(href_list["action"])
- if ("juice")
- juice()
-
- if ("detach")
- detach()
- src.updateUsrDialog()
- return
-
-/obj/machinery/juicer/verb/detach()
- set category = "Object"
- set name = "Detach Beaker from the juicer"
- set src in oview(1)
- if (usr.stat != 0)
- return
- if (!beaker)
- return
- src.verbs -= /obj/machinery/juicer/verb/detach
- beaker.forceMove(src.loc)
- beaker = null
- update_icon()
-
-/obj/machinery/juicer/proc/get_juice_id(var/obj/item/weapon/reagent_containers/food/snacks/O)
- if (istype(O, /obj/item/weapon/reagent_containers/food/snacks/watermelonslice))
- return "watermelonjuice"
- else if(istype(O, /obj.item/weapon/reagent_containers/food/snacks/grown))
- var/obj/item/weapon/reagent_containers/food/snacks/grown/G = O
- for(var/i in allowed_tags)
- if(G.seed.kitchen_tag == allowed_tags[i])
- return allowed_tags[i]
- return "water"
-
-/obj/machinery/juicer/proc/get_juice_amount(var/obj/item/weapon/reagent_containers/food/snacks/grown/O)
- if (!istype(O))
- return 5
- else if (O.potency == -1)
- return 5
- else
- return round(5*sqrt(O.potency))
-
-/obj/machinery/juicer/proc/juice()
- power_change() //it is a portable machine
- if(stat & (NOPOWER|BROKEN))
- return
- if (!beaker || beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
- return
- playsound(src.loc, 'sound/machines/juicer.ogg', 50, 1)
- for (var/obj/item/weapon/reagent_containers/food/snacks/O in src.contents)
- var/r_id = get_juice_id(O)
- beaker.reagents.add_reagent(r_id,get_juice_amount(O))
- qdel(O)
- if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
- break
-
-/obj/structure/closet/crate/juice
- New()
- ..()
- new/obj/machinery/juicer(src)
- new/obj/item/weapon/reagent_containers/food/snacks/grown/tomato(src)
- new/obj/item/weapon/reagent_containers/food/snacks/grown/carrot(src)
- new/obj/item/weapon/reagent_containers/food/snacks/grown/berries(src)
- new/obj/item/weapon/reagent_containers/food/snacks/grown/banana(src)
- new/obj/item/weapon/reagent_containers/food/snacks/grown/tomato(src)
- new/obj/item/weapon/reagent_containers/food/snacks/grown/carrot(src)
- new/obj/item/weapon/reagent_containers/food/snacks/grown/berries(src)
- new/obj/item/weapon/reagent_containers/food/snacks/grown/banana(src)
- new/obj/item/weapon/reagent_containers/food/snacks/grown/tomato(src)
- new/obj/item/weapon/reagent_containers/food/snacks/grown/carrot(src)
- new/obj/item/weapon/reagent_containers/food/snacks/grown/berries(src)
+
+/obj/machinery/juicer
+ name = "Juicer"
+ icon = 'icons/obj/kitchen.dmi'
+ icon_state = "juicer1"
+ layer = 2.9
+ density = 0
+ anchored = 0
+ use_power = 1
+ idle_power_usage = 5
+ active_power_usage = 100
+ var/obj/item/weapon/reagent_containers/beaker = null
+ var/global/list/allowed_items = list(
+ /obj/item/weapon/reagent_containers/food/snacks/watermelonslice = "watermelonjuice",
+ /obj/item/weapon/reagent_containers/food/snacks/grown = "water",
+ )
+
+ var/global/list/allowed_tags = list (
+ "tomato" = "tomatojuice",
+ "carrot" = "carrotjuice",
+ "berries" = "berryjuice",
+ "banana" = "banana",
+ "potato" = "potato",
+ "lemon" = "lemonjuice",
+ "orange" = "orangejuice",
+ "lime" = "limejuice",
+ "poisonberries" = "poisonberryjuice",
+ )
+
+/obj/machinery/juicer/New()
+ beaker = new /obj/item/weapon/reagent_containers/glass/beaker/large(src)
+
+/obj/machinery/juicer/update_icon()
+ icon_state = "juicer"+num2text(!isnull(beaker))
+ return
+
+
+/obj/machinery/juicer/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
+ if(istype(O,/obj/item/weapon/reagent_containers/glass) || \
+ istype(O,/obj/item/weapon/reagent_containers/food/drinks/drinkingglass))
+ if(beaker)
+ return 1
+ else
+ if(!user.unEquip(O))
+ to_chat(user, "\the [O] is stuck to your hand, you cannot put it in \the [src]")
+ return 0
+ O.forceMove(src)
+ beaker = O
+ src.verbs += /obj/machinery/juicer/verb/detach
+ update_icon()
+ src.updateUsrDialog()
+ return 0
+ if(!is_type_in_list(O, allowed_items))
+ to_chat(user, "It doesn't look like that contains any juice.")
+ return 1
+ if(!user.unEquip(O))
+ to_chat(user, "\the [O] is stuck to your hand, you cannot put it in \the [src]")
+ return 0
+ O.forceMove(src)
+ src.updateUsrDialog()
+ return 0
+
+/obj/machinery/juicer/attack_ai(mob/user as mob)
+ return 0
+
+/obj/machinery/juicer/attack_hand(mob/user as mob)
+ user.set_machine(src)
+ interact(user)
+
+/obj/machinery/juicer/interact(mob/user as mob) // The microwave Menu
+ var/is_chamber_empty = 0
+ var/is_beaker_ready = 0
+ var/processing_chamber = ""
+ var/beaker_contents = ""
+
+ for(var/i in allowed_items)
+ for(var/obj/item/O in src.contents)
+ if(!istype(O,i))
+ continue
+ processing_chamber+= "some [O] "
+ break
+ if(!processing_chamber)
+ is_chamber_empty = 1
+ processing_chamber = "Nothing."
+ if(!beaker)
+ beaker_contents = "\The [src] has no beaker attached."
+ else if(!beaker.reagents.total_volume)
+ beaker_contents = "\The [src] has attached an empty beaker."
+ is_beaker_ready = 1
+ else if(beaker.reagents.total_volume < beaker.reagents.maximum_volume)
+ beaker_contents = "\The [src] has attached a beaker with something."
+ is_beaker_ready = 1
+ else
+ beaker_contents = "\The [src] has attached a beaker and beaker is full!"
+
+ var/dat = {"
+Processing chamber contains:
+[processing_chamber]
+[beaker_contents]
+"}
+ if(is_beaker_ready && !is_chamber_empty && !(stat & (NOPOWER|BROKEN)))
+ dat += "Turn on! "
+ if(beaker)
+ dat += "Detach a beaker! "
+ var/datum/browser/popup = new(user, "juicer", name, 400, 400)
+ popup.set_content(dat)
+ popup.open(0)
+ onclose(user, "juicer")
+ return
+
+
+/obj/machinery/juicer/Topic(href, href_list)
+ if(..())
+ return
+ usr.set_machine(src)
+ switch(href_list["action"])
+ if("juice")
+ juice()
+
+ if("detach")
+ detach()
+ src.updateUsrDialog()
+ return
+
+/obj/machinery/juicer/verb/detach()
+ set category = "Object"
+ set name = "Detach Beaker from the juicer"
+ set src in oview(1)
+ if(usr.stat != 0)
+ return
+ if(!beaker)
+ return
+ src.verbs -= /obj/machinery/juicer/verb/detach
+ beaker.forceMove(src.loc)
+ beaker = null
+ update_icon()
+
+/obj/machinery/juicer/proc/get_juice_id(var/obj/item/weapon/reagent_containers/food/snacks/O)
+ if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/watermelonslice))
+ return "watermelonjuice"
+ else if(istype(O, /obj.item/weapon/reagent_containers/food/snacks/grown))
+ var/obj/item/weapon/reagent_containers/food/snacks/grown/G = O
+ for(var/i in allowed_tags)
+ if(G.seed.kitchen_tag == allowed_tags[i])
+ return allowed_tags[i]
+ return "water"
+
+/obj/machinery/juicer/proc/get_juice_amount(var/obj/item/weapon/reagent_containers/food/snacks/grown/O)
+ if(!istype(O))
+ return 5
+ else if(O.potency == -1)
+ return 5
+ else
+ return round(5*sqrt(O.potency))
+
+/obj/machinery/juicer/proc/juice()
+ power_change() //it is a portable machine
+ if(stat & (NOPOWER|BROKEN))
+ return
+ if(!beaker || beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
+ return
+ playsound(src.loc, 'sound/machines/juicer.ogg', 50, 1)
+ for(var/obj/item/weapon/reagent_containers/food/snacks/O in src.contents)
+ var/r_id = get_juice_id(O)
+ beaker.reagents.add_reagent(r_id,get_juice_amount(O))
+ qdel(O)
+ if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
+ break
+
+/obj/structure/closet/crate/juice
+ New()
+ ..()
+ new/obj/machinery/juicer(src)
+ new/obj/item/weapon/reagent_containers/food/snacks/grown/tomato(src)
+ new/obj/item/weapon/reagent_containers/food/snacks/grown/carrot(src)
+ new/obj/item/weapon/reagent_containers/food/snacks/grown/berries(src)
+ new/obj/item/weapon/reagent_containers/food/snacks/grown/banana(src)
+ new/obj/item/weapon/reagent_containers/food/snacks/grown/tomato(src)
+ new/obj/item/weapon/reagent_containers/food/snacks/grown/carrot(src)
+ new/obj/item/weapon/reagent_containers/food/snacks/grown/berries(src)
+ new/obj/item/weapon/reagent_containers/food/snacks/grown/banana(src)
+ new/obj/item/weapon/reagent_containers/food/snacks/grown/tomato(src)
+ new/obj/item/weapon/reagent_containers/food/snacks/grown/carrot(src)
+ new/obj/item/weapon/reagent_containers/food/snacks/grown/berries(src)
new/obj/item/weapon/reagent_containers/food/snacks/grown/banana(src)
\ No newline at end of file
diff --git a/code/game/machinery/kitchen/kitchen_machine.dm b/code/modules/food_and_drinks/kitchen_machinery/kitchen_machine.dm
similarity index 85%
rename from code/game/machinery/kitchen/kitchen_machine.dm
rename to code/modules/food_and_drinks/kitchen_machinery/kitchen_machine.dm
index 5c584d0468b..6f9e1a191fc 100644
--- a/code/game/machinery/kitchen/kitchen_machine.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/kitchen_machine.dm
@@ -34,19 +34,19 @@
/obj/machinery/kitchen_machine/New()
reagents = new/datum/reagents(100)
reagents.my_atom = src
- if (!available_recipes)
+ if(!available_recipes)
available_recipes = new
acceptable_items = new
acceptable_reagents = new
- for (var/type in subtypesof(recipe_type))
+ for(var/type in subtypesof(recipe_type))
var/datum/recipe/recipe = new type
if(recipe.result) // Ignore recipe subtypes that lack a result
available_recipes += recipe
- for (var/item in recipe.items)
+ for(var/item in recipe.items)
acceptable_items |= item
- for (var/reagent in recipe.reagents)
+ for(var/reagent in recipe.reagents)
acceptable_reagents |= reagent
- if (recipe.items || recipe.fruit)
+ if(recipe.items || recipe.fruit)
max_n_of_items = max(max_n_of_items,recipe.count_n_items())
else
qdel(recipe)
@@ -83,7 +83,7 @@
"[user] starts to fix part of \the [src].", \
"You start to fix part of \the [src]." \
)
- if (do_after(user,20, target = src))
+ if(do_after(user,20, target = src))
user.visible_message( \
"[user] fixes part of \the [src].", \
"You have fixed part of \the [src]." \
@@ -94,7 +94,7 @@
"[user] starts to fix part of \the [src].", \
"You start to fix part of \the [src]." \
)
- if (do_after(user,20, target = src))
+ if(do_after(user,20, target = src))
user.visible_message( \
"[user] fixes \the [src].", \
"You have fixed \the [src]." \
@@ -112,7 +112,7 @@
"[user] starts to clean \the [src].", \
"You start to clean \the [src]." \
)
- if (do_after(user,20, target = src))
+ if(do_after(user,20, target = src))
user.visible_message( \
"[user] has cleaned \the [src].", \
"You have cleaned \the [src]." \
@@ -125,10 +125,10 @@
to_chat(user, "It's dirty!")
return 1
else if(is_type_in_list(O,acceptable_items))
- if (contents.len>=max_n_of_items)
+ if(contents.len>=max_n_of_items)
to_chat(user, "This [src] is full of ingredients, you cannot put more.")
return 1
- if (istype(O,/obj/item/stack) && O:amount>1)
+ if(istype(O,/obj/item/stack) && O:amount>1)
new O.type (src)
O:use(1)
user.visible_message( \
@@ -147,10 +147,10 @@
istype(O,/obj/item/weapon/reagent_containers/food/drinks) || \
istype(O,/obj/item/weapon/reagent_containers/food/condiment) \
)
- if (!O.reagents)
+ if(!O.reagents)
return 1
- for (var/datum/reagent/R in O.reagents.reagent_list)
- if (!(R.id in acceptable_reagents))
+ for(var/datum/reagent/R in O.reagents.reagent_list)
+ if(!(R.id in acceptable_reagents))
to_chat(user, "Your [O] contains components unsuitable for cookery.")
return 1
//G.reagents.trans_to(src,G.amount_per_transfer_from_this)
@@ -188,53 +188,55 @@
var/list/items_counts = new
var/list/items_measures = new
var/list/items_measures_p = new
- for (var/obj/O in contents)
+ for(var/obj/O in contents)
var/display_name = O.name
- if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/egg))
+ if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/egg))
items_measures[display_name] = "egg"
items_measures_p[display_name] = "eggs"
- if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/tofu))
+ if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/tofu))
items_measures[display_name] = "tofu chunk"
items_measures_p[display_name] = "tofu chunks"
- if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/meat)) //any meat
+ if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/meat)) //any meat
items_measures[display_name] = "slab of meat"
items_measures_p[display_name] = "slabs of meat"
- if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/donkpocket))
+ if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/donkpocket))
display_name = "Turnovers"
items_measures[display_name] = "turnover"
items_measures_p[display_name] = "turnovers"
- if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/carpmeat))
+ if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/carpmeat))
items_measures[display_name] = "fillet of meat"
items_measures_p[display_name] = "fillets of meat"
items_counts[display_name]++
- for (var/O in items_counts)
+ for(var/O in items_counts)
var/N = items_counts[O]
- if (!(O in items_measures))
+ if(!(O in items_measures))
dat += {"[capitalize(O)]: [N] [lowertext(O)]\s "}
else
- if (N==1)
+ if(N==1)
dat += {"[capitalize(O)]: [N] [items_measures[O]] "}
else
dat += {"[capitalize(O)]: [N] [items_measures_p[O]] "}
- for (var/datum/reagent/R in reagents.reagent_list)
+ for(var/datum/reagent/R in reagents.reagent_list)
var/display_name = R.name
- if (R.id == "capsaicin")
+ if(R.id == "capsaicin")
display_name = "Hotsauce"
- if (R.id == "frostoil")
+ if(R.id == "frostoil")
display_name = "Coldsauce"
dat += {"[display_name]: [R.volume] unit\s "}
- if (items_counts.len==0 && reagents.reagent_list.len==0)
+ if(items_counts.len==0 && reagents.reagent_list.len==0)
dat = {"The [src] is empty "}
else
dat = {"Ingredients: [dat]"}
dat += {" \
-Turn on! \
-Eject ingredients! \
+Turn on! \
+Eject ingredients! \
"}
- user << browse("[src] Controls[dat]", "window=[src.name]")
+ var/datum/browser/popup = new(user, name, name, 400, 400)
+ popup.set_content(dat)
+ popup.open(0)
onclose(user, "[src.name]")
return
@@ -248,8 +250,8 @@
if(stat & (NOPOWER|BROKEN))
return
start()
- if (reagents.total_volume==0 && !(locate(/obj) in contents)) //dry run
- if (!wzhzhzh(10))
+ if(reagents.total_volume==0 && !(locate(/obj) in contents)) //dry run
+ if(!wzhzhzh(10))
abort()
return
stop()
@@ -258,10 +260,10 @@
var/datum/recipe/recipe = select_recipe(available_recipes,src)
var/obj/cooked
var/obj/byproduct
- if (!recipe)
+ if(!recipe)
dirty += 1
- if (prob(max(10,dirty*5)))
- if (!wzhzhzh(4))
+ if(prob(max(10,dirty*5)))
+ if(!wzhzhzh(4))
abort()
return
muck_start()
@@ -269,15 +271,15 @@
muck_finish()
fail()
return
- else if (has_extra_item())
- if (!wzhzhzh(4))
+ else if(has_extra_item())
+ if(!wzhzhzh(4))
abort()
return
broke()
fail()
return
else
- if (!wzhzhzh(10))
+ if(!wzhzhzh(10))
abort()
return
stop()
@@ -285,10 +287,10 @@
return
else
var/halftime = round(recipe.time/10/2)
- if (!wzhzhzh(halftime))
+ if(!wzhzhzh(halftime))
abort()
return
- if (!wzhzhzh(halftime))
+ if(!wzhzhzh(halftime))
abort()
fail()
return
@@ -304,16 +306,16 @@
return
/obj/machinery/kitchen_machine/proc/wzhzhzh(var/seconds as num)
- for (var/i=1 to seconds)
- if (stat & (NOPOWER|BROKEN))
+ for(var/i=1 to seconds)
+ if(stat & (NOPOWER|BROKEN))
return 0
use_power(500)
sleep(10)
return 1
/obj/machinery/kitchen_machine/proc/has_extra_item()
- for (var/obj/O in contents)
- if ( \
+ for(var/obj/O in contents)
+ if( \
!istype(O,/obj/item/weapon/reagent_containers/food) && \
!istype(O, /obj/item/weapon/grown) \
)
@@ -338,9 +340,9 @@
src.updateUsrDialog()
/obj/machinery/kitchen_machine/proc/dispose()
- for (var/obj/O in contents)
+ for(var/obj/O in contents)
O.forceMove(src.loc)
- if (src.reagents.total_volume)
+ if(src.reagents.total_volume)
src.dirty++
src.reagents.clear_reagents()
to_chat(usr, "You dispose of \the [src]'s contents.")
@@ -373,11 +375,11 @@
/obj/machinery/kitchen_machine/proc/fail()
var/obj/item/weapon/reagent_containers/food/snacks/badrecipe/ffuu = new(src)
var/amount = 0
- for (var/obj/O in contents-ffuu)
+ for(var/obj/O in contents-ffuu)
amount++
- if (O.reagents)
+ if(O.reagents)
var/id = O.reagents.get_master_reagent_id()
- if (id)
+ if(id)
amount+=O.reagents.get_reagent_amount(id)
qdel(O)
src.reagents.clear_reagents()
@@ -395,9 +397,9 @@
return
switch(href_list["action"])
- if ("cook")
+ if("cook")
cook()
- if ("dispose")
+ if("dispose")
dispose()
- return
\ No newline at end of file
+ return
diff --git a/code/game/machinery/kitchen/microwave.dm b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm
similarity index 96%
rename from code/game/machinery/kitchen/microwave.dm
rename to code/modules/food_and_drinks/kitchen_machinery/microwave.dm
index e560f12e8db..49cfc3ad0e8 100644
--- a/code/game/machinery/kitchen/microwave.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm
@@ -1,55 +1,55 @@
-
-/obj/machinery/kitchen_machine/microwave
- name = "microwave"
- desc = "A microwave, perfect for reheating things with radiation."
- icon = 'icons/obj/kitchen.dmi'
- icon_state = "mw"
- cook_verbs = list("Microwaving", "Reheating", "Heating")
- recipe_type = /datum/recipe/microwave
- off_icon = "mw"
- on_icon = "mw1"
- broken_icon = "mwb"
- dirty_icon = "mwbloody"
- open_icon = "mw-o"
-
-// see code/modules/food/recipes_microwave.dm for recipes
-
-/*******************
-* Initialising
-********************/
-
-/obj/machinery/kitchen_machine/microwave/New()
- ..()
- component_parts = list()
- component_parts += new /obj/item/weapon/circuitboard/microwave(null)
- component_parts += new /obj/item/weapon/stock_parts/micro_laser(null)
- component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
- component_parts += new /obj/item/stack/cable_coil(null, 2)
- RefreshParts()
-
-/obj/machinery/kitchen_machine/microwave/upgraded/New()
- ..()
- component_parts = list()
- component_parts += new /obj/item/weapon/circuitboard/microwave(null)
- component_parts += new /obj/item/weapon/stock_parts/micro_laser/ultra(null)
- component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
- component_parts += new /obj/item/stack/cable_coil(null, 2)
- RefreshParts()
-
-/obj/machinery/kitchen_machine/microwave/RefreshParts()
- var/E
- for(var/obj/item/weapon/stock_parts/micro_laser/M in component_parts)
- E += M.rating
- efficiency = E
-
-// The following code is present as temporary assurance for compatibility and to avoid merge conflicts for the TG mining port
-// Please delete this portion once all maps are updated to use the new object path: /obj/machinery/kitchen_machine/microwave
-
-/obj/machinery/microwave
- name = "Microwave spawner"
- icon = 'icons/obj/kitchen.dmi'
- icon_state = "mw"
-
-/obj/machinery/microwave/New()
- new /obj/machinery/kitchen_machine/microwave(get_turf(src))
+
+/obj/machinery/kitchen_machine/microwave
+ name = "microwave"
+ desc = "A microwave, perfect for reheating things with radiation."
+ icon = 'icons/obj/kitchen.dmi'
+ icon_state = "mw"
+ cook_verbs = list("Microwaving", "Reheating", "Heating")
+ recipe_type = /datum/recipe/microwave
+ off_icon = "mw"
+ on_icon = "mw1"
+ broken_icon = "mwb"
+ dirty_icon = "mwbloody"
+ open_icon = "mw-o"
+
+// see code/modules/food/recipes_microwave.dm for recipes
+
+/*******************
+* Initialising
+********************/
+
+/obj/machinery/kitchen_machine/microwave/New()
+ ..()
+ component_parts = list()
+ component_parts += new /obj/item/weapon/circuitboard/microwave(null)
+ component_parts += new /obj/item/weapon/stock_parts/micro_laser(null)
+ component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
+ component_parts += new /obj/item/stack/cable_coil(null, 2)
+ RefreshParts()
+
+/obj/machinery/kitchen_machine/microwave/upgraded/New()
+ ..()
+ component_parts = list()
+ component_parts += new /obj/item/weapon/circuitboard/microwave(null)
+ component_parts += new /obj/item/weapon/stock_parts/micro_laser/ultra(null)
+ component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
+ component_parts += new /obj/item/stack/cable_coil(null, 2)
+ RefreshParts()
+
+/obj/machinery/kitchen_machine/microwave/RefreshParts()
+ var/E
+ for(var/obj/item/weapon/stock_parts/micro_laser/M in component_parts)
+ E += M.rating
+ efficiency = E
+
+// The following code is present as temporary assurance for compatibility and to avoid merge conflicts for the TG mining port
+// Please delete this portion once all maps are updated to use the new object path: /obj/machinery/kitchen_machine/microwave
+
+/obj/machinery/microwave
+ name = "Microwave spawner"
+ icon = 'icons/obj/kitchen.dmi'
+ icon_state = "mw"
+
+/obj/machinery/microwave/New()
+ new /obj/machinery/kitchen_machine/microwave(get_turf(src))
qdel(src)
\ No newline at end of file
diff --git a/code/game/machinery/kitchen/monkeyrecycler.dm b/code/modules/food_and_drinks/kitchen_machinery/monkeyrecycler.dm
similarity index 97%
rename from code/game/machinery/kitchen/monkeyrecycler.dm
rename to code/modules/food_and_drinks/kitchen_machinery/monkeyrecycler.dm
index b95e4ae5318..dc283e65d6c 100644
--- a/code/game/machinery/kitchen/monkeyrecycler.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/monkeyrecycler.dm
@@ -62,9 +62,9 @@
cycle_through = 0
to_chat(user, "You change the monkeycube type to [initial(cube_type.name)].")
- if (src.stat != 0) //NOPOWER etc
+ if(src.stat != 0) //NOPOWER etc
return
- if (istype(O, /obj/item/weapon/grab))
+ if(istype(O, /obj/item/weapon/grab))
var/obj/item/weapon/grab/G = O
var/grabbed = G.affecting
if(istype(grabbed, /mob/living/carbon/human))
@@ -91,7 +91,7 @@
return
/obj/machinery/monkey_recycler/attack_hand(var/mob/user as mob)
- if (src.stat != 0) //NOPOWER etc
+ if(src.stat != 0) //NOPOWER etc
return
if(grinded >= required_grind)
to_chat(user, "The machine hisses loudly as it condenses the grinded monkey meat. After a moment, it dispenses a brand new monkey cube.")
diff --git a/code/modules/food/oven.dm b/code/modules/food_and_drinks/kitchen_machinery/oven.dm
similarity index 96%
rename from code/modules/food/oven.dm
rename to code/modules/food_and_drinks/kitchen_machinery/oven.dm
index 604adaaf142..796e8c4bd4b 100644
--- a/code/modules/food/oven.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/oven.dm
@@ -1,79 +1,79 @@
-/obj/machinery/cooking
- name = "oven"
- desc = "Cookies are ready, dear."
- icon = 'icons/obj/cooking_machines.dmi'
- icon_state = "oven_off"
- layer = 2.9
- density = 1
- anchored = 1
- use_power = 1
- var/candy = 0
- idle_power_usage = 5
- var/on = FALSE //Is it making food already?
- var/list/food_choices = list()
-/obj/machinery/cooking/New()
- ..()
- updatefood()
-
-/obj/machinery/cooking/attackby(obj/item/I, mob/user, params)
- if(on)
- to_chat(user, "The machine is already running.")
- return
- else
- var/obj/item/F = I
- var/obj/item/weapon/reagent_containers/food/snacks/customizable/C
- C = input("Select food to make.", "Cooking", C) in food_choices
- if(!C)
- return
- else
- to_chat(user, "You put [F] into [src] for cooking.")
- user.drop_item()
- F.loc = src
- on = TRUE
- if(!candy)
- icon_state = "oven_on"
- else
- icon_state = "mixer_on"
- sleep(100)
- on = FALSE
- if(!candy)
- icon_state = "oven_off"
- else
- icon_state = "mixer_off"
- C.loc = get_turf(src)
- C.attackby(F,user, params)
- playsound(loc, 'sound/machines/ding.ogg', 50, 1)
- updatefood()
- return
-
-/obj/machinery/cooking/proc/updatefood()
- return
-
-/obj/machinery/cooking/oven
- name = "oven"
- desc = "Cookies are ready, dear."
- icon = 'icons/obj/cooking_machines.dmi'
- icon_state = "oven_off"
-
-/obj/machinery/cooking/oven/updatefood()
- for(var/U in food_choices)
- food_choices.Remove(U)
- for(var/U in subtypesof(/obj/item/weapon/reagent_containers/food/snacks/customizable/cook))
- var/obj/item/weapon/reagent_containers/food/snacks/customizable/cook/V = new U
- src.food_choices += V
- return
-
-/obj/machinery/cooking/candy
- name = "candy machine"
- desc = "Get yer box of deep fried deep fried deep fried deep fried cotton candy cereal sandwich cookies here!"
- icon = 'icons/obj/cooking_machines.dmi'
- icon_state = "mixer_off"
- candy = 1
-
-/obj/machinery/cooking/candy/updatefood()
- for(var/U in food_choices)
- food_choices.Remove(U)
- for(var/U in subtypesof(/obj/item/weapon/reagent_containers/food/snacks/customizable/candy))
- var/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/V = new U
- src.food_choices += V
- return
+/obj/machinery/cooking
+ name = "oven"
+ desc = "Cookies are ready, dear."
+ icon = 'icons/obj/cooking_machines.dmi'
+ icon_state = "oven_off"
+ layer = 2.9
+ density = 1
+ anchored = 1
+ use_power = 1
+ var/candy = 0
+ idle_power_usage = 5
+ var/on = FALSE //Is it making food already?
+ var/list/food_choices = list()
+/obj/machinery/cooking/New()
+ ..()
+ updatefood()
+
+/obj/machinery/cooking/attackby(obj/item/I, mob/user, params)
+ if(on)
+ to_chat(user, "The machine is already running.")
+ return
+ else
+ var/obj/item/F = I
+ var/obj/item/weapon/reagent_containers/food/snacks/customizable/C
+ C = input("Select food to make.", "Cooking", C) in food_choices
+ if(!C)
+ return
+ else
+ to_chat(user, "You put [F] into [src] for cooking.")
+ user.drop_item()
+ F.loc = src
+ on = TRUE
+ if(!candy)
+ icon_state = "oven_on"
+ else
+ icon_state = "mixer_on"
+ sleep(100)
+ on = FALSE
+ if(!candy)
+ icon_state = "oven_off"
+ else
+ icon_state = "mixer_off"
+ C.loc = get_turf(src)
+ C.attackby(F,user, params)
+ playsound(loc, 'sound/machines/ding.ogg', 50, 1)
+ updatefood()
+ return
+
+/obj/machinery/cooking/proc/updatefood()
+ return
+
+/obj/machinery/cooking/oven
+ name = "oven"
+ desc = "Cookies are ready, dear."
+ icon = 'icons/obj/cooking_machines.dmi'
+ icon_state = "oven_off"
+
+/obj/machinery/cooking/oven/updatefood()
+ for(var/U in food_choices)
+ food_choices.Remove(U)
+ for(var/U in subtypesof(/obj/item/weapon/reagent_containers/food/snacks/customizable/cook))
+ var/obj/item/weapon/reagent_containers/food/snacks/customizable/cook/V = new U
+ src.food_choices += V
+ return
+
+/obj/machinery/cooking/candy
+ name = "candy machine"
+ desc = "Get yer box of deep fried deep fried deep fried deep fried cotton candy cereal sandwich cookies here!"
+ icon = 'icons/obj/cooking_machines.dmi'
+ icon_state = "mixer_off"
+ candy = 1
+
+/obj/machinery/cooking/candy/updatefood()
+ for(var/U in food_choices)
+ food_choices.Remove(U)
+ for(var/U in subtypesof(/obj/item/weapon/reagent_containers/food/snacks/customizable/candy))
+ var/obj/item/weapon/reagent_containers/food/snacks/customizable/candy/V = new U
+ src.food_choices += V
+ return
diff --git a/code/modules/food/oven_new.dm b/code/modules/food_and_drinks/kitchen_machinery/oven_new.dm
similarity index 100%
rename from code/modules/food/oven_new.dm
rename to code/modules/food_and_drinks/kitchen_machinery/oven_new.dm
diff --git a/code/game/machinery/kitchen/processor.dm b/code/modules/food_and_drinks/kitchen_machinery/processor.dm
similarity index 88%
rename from code/game/machinery/kitchen/processor.dm
rename to code/modules/food_and_drinks/kitchen_machinery/processor.dm
index 57e1aecf514..d2b810dc7bb 100644
--- a/code/game/machinery/kitchen/processor.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/processor.dm
@@ -1,208 +1,230 @@
-/obj/machinery/processor
- name = "Food Processor"
- icon = 'icons/obj/kitchen.dmi'
- icon_state = "processor"
- layer = 2.9
- density = 1
- anchored = 1
-
- var/broken = 0
- var/processing = 0
-
- use_power = 1
- idle_power_usage = 5
- active_power_usage = 50
- var/rating_speed = 1
- var/rating_amount = 1
-
-/obj/machinery/processor/New()
- ..()
- component_parts = list()
- component_parts += new /obj/item/weapon/circuitboard/processor(null)
- component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
- component_parts += new /obj/item/weapon/stock_parts/manipulator(null)
- RefreshParts()
-
-/obj/machinery/processor/RefreshParts()
- for(var/obj/item/weapon/stock_parts/matter_bin/B in component_parts)
- rating_amount = B.rating
- for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
- rating_speed = M.rating
-
-//RECIPE DATUMS
-/datum/food_processor_process
- var/input
- var/output
- var/time = 40
-
-/datum/food_processor_process/proc/process_food(loc, what, obj/machinery/processor/processor)
- if (src.output && loc && processor)
- for(var/i = 0, i < processor.rating_amount, i++)
- new src.output(loc)
- if (what)
- qdel(what)
-
-/////////////////////////
-/////OBJECT RECIPIES/////
-/////////////////////////
-/datum/food_processor_process/meat
- input = /obj/item/weapon/reagent_containers/food/snacks/meat
- output = /obj/item/weapon/reagent_containers/food/snacks/meatball
-
-/datum/food_processor_process/potato
- input = "potato"
- output = /obj/item/weapon/reagent_containers/food/snacks/fries
-
-/datum/food_processor_process/carrot
- input = "carrot"
- output = /obj/item/weapon/reagent_containers/food/snacks/carrotfries
-
-/datum/food_processor_process/soybeans
- input = "soybeans"
- output = /obj/item/weapon/reagent_containers/food/snacks/soydope
-
-/datum/food_processor_process/spaghetti
- input = /obj/item/weapon/reagent_containers/food/snacks/doughslice
- output = /obj/item/weapon/reagent_containers/food/snacks/spagetti
-/////////////////////////
-///END OBJECT RECIPIES///
-/////////////////////////
-
-/datum/food_processor_process/mob/process_food(loc, what, processor)
- ..()
-
-//////////////////////
-/////MOB RECIPIES/////
-//////////////////////
-/datum/food_processor_process/mob/slime
- input = /mob/living/carbon/slime
- output = null
-
-/datum/food_processor_process/mob/slime/process_food(loc, what, obj/machinery/processor/processor)
- var/mob/living/carbon/slime/S = what
- var/C = S.cores
- if(S.stat != DEAD)
- S.loc = loc
- S.visible_message("[S] crawls free of the processor!")
- return
- for(var/i in 1 to (C+processor.rating_amount-1))
- new S.coretype(loc)
- feedback_add_details("slime_core_harvested","[replacetext(S.colour," ","_")]")
- ..()
-
-/datum/food_processor_process/mob/monkey
- input = /mob/living/carbon/human/monkey
- output = null
-
-/datum/food_processor_process/mob/monkey/process_food(loc, what, processor)
- var/mob/living/carbon/human/monkey/O = what
- if (O.client) //grief-proof
- O.loc = loc
- O.visible_message("Suddenly [O] jumps out from the processor!", \
- "You jump out of \the [src].", \
- "You hear a chimp.")
- return
- var/obj/item/weapon/reagent_containers/glass/bucket/bucket_of_blood = new(loc)
- var/datum/reagent/blood/B = new()
- B.holder = bucket_of_blood
- B.volume = 70
- //set reagent data
- B.data["donor"] = O.name
- B.data["blood_DNA"] = copytext(O.dna.unique_enzymes,1,0)
- bucket_of_blood.reagents.reagent_list += B
- bucket_of_blood.reagents.update_total()
- bucket_of_blood.on_reagent_change()
- //bucket_of_blood.reagents.handle_reactions() //blood doesn't react
- ..()
-////////////////////////
-////END MOB RECIPIES////
-////////////////////////
-
-//END RECIPE DATUMS
-
-/obj/machinery/processor/proc/select_recipe(var/X)
- for (var/Type in subtypesof(/datum/food_processor_process) - /datum/food_processor_process/mob)
- var/datum/food_processor_process/P = new Type()
- if(istype(X, /obj/item/weapon/reagent_containers/food/snacks/grown))
- var/obj/item/weapon/reagent_containers/food/snacks/grown/G = X
- if(G.seed.kitchen_tag != P.input)
- continue
- else if (!istype(X, P.input))
- continue
- return P
- return 0
-
-/obj/machinery/processor/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
-
- if(src.processing)
- to_chat(user, "\the [src] is already processing something!")
- return 1
-
- if(default_deconstruction_screwdriver(user, "processor1", "processor", O))
- return
-
- if(exchange_parts(user, O))
- return
-
- if(default_unfasten_wrench(user, O))
- return
-
- default_deconstruction_crowbar(O)
-
- var/obj/item/what = O
-
- if (istype(O, /obj/item/weapon/grab))
- var/obj/item/weapon/grab/G = O
- what = G.affecting
-
- var/datum/food_processor_process/P = select_recipe(what)
-
- if (!P)
- to_chat(user, "That probably won't blend.")
- return 1
-
- user.visible_message("\the [user] puts \the [what] into \the [src].", \
- "You put \the [what] into \the [src].")
-
- user.drop_item()
-
- what.loc = src
- return
-
-/obj/machinery/processor/attack_hand(var/mob/user as mob)
- if(stat & (NOPOWER|BROKEN)) //no power or broken
- return
-
- if(src.processing)
- to_chat(user, "\the [src] is already processing something!")
- return 1
-
- if(src.contents.len == 0)
- to_chat(user, "\the [src] is empty.")
- return 1
- src.processing = 1
- user.visible_message("[user] turns on [src].", \
- "You turn on [src].", \
- "You hear a food processor.")
- playsound(src.loc, 'sound/machines/blender.ogg', 50, 1)
- use_power(500)
- var/total_time = 0
- for(var/O in src.contents)
- var/datum/food_processor_process/P = select_recipe(O)
- if (!P)
- log_debug("The [O] in processor([src]) does not have a suitable recipe, but it was somehow put inside of the processor anyways.")
- continue
- total_time += P.time
- sleep(total_time / rating_speed)
-
- for(var/O in src.contents)
- var/datum/food_processor_process/P = select_recipe(O)
- if (!P)
- log_debug("The [O] in processor([src]) does not have a suitable recipe, but it was somehow put inside of the processor anyways.")
- continue
- P.process_food(src.loc, O, src)
- src.processing = 0
-
- src.visible_message("\the [src] has finished processing.", \
- "\the [src] has finished processing.", \
- "You hear a food processor stopping.")
+/obj/machinery/processor
+ name = "Food Processor"
+ icon = 'icons/obj/kitchen.dmi'
+ icon_state = "processor"
+ layer = 2.9
+ density = 1
+ anchored = 1
+
+ var/broken = 0
+ var/processing = 0
+
+ use_power = 1
+ idle_power_usage = 5
+ active_power_usage = 50
+ var/rating_speed = 1
+ var/rating_amount = 1
+
+/obj/machinery/processor/New()
+ ..()
+ component_parts = list()
+ component_parts += new /obj/item/weapon/circuitboard/processor(null)
+ component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
+ component_parts += new /obj/item/weapon/stock_parts/manipulator(null)
+ RefreshParts()
+
+/obj/machinery/processor/RefreshParts()
+ for(var/obj/item/weapon/stock_parts/matter_bin/B in component_parts)
+ rating_amount = B.rating
+ for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
+ rating_speed = M.rating
+
+/obj/machinery/processor/process()
+ ..()
+ // The irony
+ // To be clear, if it's grinding, then it can't suck them up
+ if(processing)
+ return
+ var/mob/living/carbon/slime/picked_slime
+ for(var/mob/living/carbon/slime/slime in range(1, src))
+ if(slime.loc == src)
+ continue
+ if(slime.stat)
+ picked_slime = slime
+ break
+ if(!picked_slime)
+ return
+ var/datum/food_processor_process/P = select_recipe(picked_slime)
+ if(!P)
+ return
+
+ visible_message("[picked_slime] is sucked into \the [src].")
+ picked_slime.forceMove(src)
+
+//RECIPE DATUMS
+/datum/food_processor_process
+ var/input
+ var/output
+ var/time = 40
+
+/datum/food_processor_process/proc/process_food(loc, what, obj/machinery/processor/processor)
+ if(src.output && loc && processor)
+ for(var/i = 0, i < processor.rating_amount, i++)
+ new src.output(loc)
+ if(what)
+ qdel(what)
+
+/////////////////////////
+/////OBJECT RECIPIES/////
+/////////////////////////
+/datum/food_processor_process/meat
+ input = /obj/item/weapon/reagent_containers/food/snacks/meat
+ output = /obj/item/weapon/reagent_containers/food/snacks/meatball
+
+/datum/food_processor_process/potato
+ input = "potato"
+ output = /obj/item/weapon/reagent_containers/food/snacks/fries
+
+/datum/food_processor_process/carrot
+ input = "carrot"
+ output = /obj/item/weapon/reagent_containers/food/snacks/carrotfries
+
+/datum/food_processor_process/soybeans
+ input = "soybeans"
+ output = /obj/item/weapon/reagent_containers/food/snacks/soydope
+
+/datum/food_processor_process/spaghetti
+ input = /obj/item/weapon/reagent_containers/food/snacks/doughslice
+ output = /obj/item/weapon/reagent_containers/food/snacks/spagetti
+/////////////////////////
+///END OBJECT RECIPIES///
+/////////////////////////
+
+/datum/food_processor_process/mob/process_food(loc, what, processor)
+ ..()
+
+//////////////////////
+/////MOB RECIPIES/////
+//////////////////////
+/datum/food_processor_process/mob/slime
+ input = /mob/living/carbon/slime
+ output = null
+
+/datum/food_processor_process/mob/slime/process_food(loc, what, obj/machinery/processor/processor)
+ var/mob/living/carbon/slime/S = what
+ var/C = S.cores
+ if(S.stat != DEAD)
+ S.loc = loc
+ S.visible_message("[S] crawls free of the processor!")
+ return
+ for(var/i in 1 to (C+processor.rating_amount-1))
+ new S.coretype(loc)
+ feedback_add_details("slime_core_harvested","[replacetext(S.colour," ","_")]")
+ ..()
+
+/datum/food_processor_process/mob/monkey
+ input = /mob/living/carbon/human/monkey
+ output = null
+
+/datum/food_processor_process/mob/monkey/process_food(loc, what, processor)
+ var/mob/living/carbon/human/monkey/O = what
+ if(O.client) //grief-proof
+ O.loc = loc
+ O.visible_message("Suddenly [O] jumps out from the processor!", \
+ "You jump out of \the [src].", \
+ "You hear a chimp.")
+ return
+ var/obj/item/weapon/reagent_containers/glass/bucket/bucket_of_blood = new(loc)
+ var/datum/reagent/blood/B = new()
+ B.holder = bucket_of_blood
+ B.volume = 70
+ //set reagent data
+ B.data["donor"] = O.name
+ B.data["blood_DNA"] = copytext(O.dna.unique_enzymes,1,0)
+ bucket_of_blood.reagents.reagent_list += B
+ bucket_of_blood.reagents.update_total()
+ bucket_of_blood.on_reagent_change()
+ //bucket_of_blood.reagents.handle_reactions() //blood doesn't react
+ ..()
+////////////////////////
+////END MOB RECIPIES////
+////////////////////////
+
+//END RECIPE DATUMS
+
+/obj/machinery/processor/proc/select_recipe(var/X)
+ for(var/Type in subtypesof(/datum/food_processor_process) - /datum/food_processor_process/mob)
+ var/datum/food_processor_process/P = new Type()
+ if(istype(X, /obj/item/weapon/reagent_containers/food/snacks/grown))
+ var/obj/item/weapon/reagent_containers/food/snacks/grown/G = X
+ if(G.seed.kitchen_tag != P.input)
+ continue
+ else if(!istype(X, P.input))
+ continue
+ return P
+ return 0
+
+/obj/machinery/processor/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
+
+ if(src.processing)
+ to_chat(user, "\the [src] is already processing something!")
+ return 1
+
+ if(default_deconstruction_screwdriver(user, "processor1", "processor", O))
+ return
+
+ if(exchange_parts(user, O))
+ return
+
+ if(default_unfasten_wrench(user, O))
+ return
+
+ default_deconstruction_crowbar(O)
+
+ var/obj/item/what = O
+
+ if(istype(O, /obj/item/weapon/grab))
+ var/obj/item/weapon/grab/G = O
+ what = G.affecting
+
+ var/datum/food_processor_process/P = select_recipe(what)
+
+ if(!P)
+ to_chat(user, "That probably won't blend.")
+ return 1
+
+ user.visible_message("\the [user] puts \the [what] into \the [src].", \
+ "You put \the [what] into \the [src].")
+
+ user.drop_item()
+
+ what.loc = src
+ return
+
+/obj/machinery/processor/attack_hand(var/mob/user as mob)
+ if(stat & (NOPOWER|BROKEN)) //no power or broken
+ return
+
+ if(src.processing)
+ to_chat(user, "\the [src] is already processing something!")
+ return 1
+
+ if(src.contents.len == 0)
+ to_chat(user, "\the [src] is empty.")
+ return 1
+ src.processing = 1
+ user.visible_message("[user] turns on [src].", \
+ "You turn on [src].", \
+ "You hear a food processor.")
+ playsound(src.loc, 'sound/machines/blender.ogg', 50, 1)
+ use_power(500)
+ var/total_time = 0
+ for(var/O in src.contents)
+ var/datum/food_processor_process/P = select_recipe(O)
+ if(!P)
+ log_debug("The [O] in processor([src]) does not have a suitable recipe, but it was somehow put inside of the processor anyways.")
+ continue
+ total_time += P.time
+ sleep(total_time / rating_speed)
+
+ for(var/O in src.contents)
+ var/datum/food_processor_process/P = select_recipe(O)
+ if(!P)
+ log_debug("The [O] in processor([src]) does not have a suitable recipe, but it was somehow put inside of the processor anyways.")
+ continue
+ P.process_food(src.loc, O, src)
+ src.processing = 0
+
+ src.visible_message("\the [src] has finished processing.", \
+ "\the [src] has finished processing.", \
+ "You hear a food processor stopping.")
diff --git a/code/game/machinery/kitchen/smartfridge.dm b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm
similarity index 96%
rename from code/game/machinery/kitchen/smartfridge.dm
rename to code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm
index b17b09d5419..9a670e42d7a 100644
--- a/code/game/machinery/kitchen/smartfridge.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm
@@ -1,410 +1,410 @@
-/* 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/max_n_of_items = 1500
- var/icon_on = "smartfridge"
- var/icon_off = "smartfridge-off"
- var/icon_panel = "smartfridge-panel"
- var/item_quants = list()
- var/seconds_electrified = 0;
- var/shoot_inventory = 0
- var/locked = 0
- var/scan_id = 1
- var/is_secure = 0
- var/datum/wires/smartfridge/wires = null
-
-/obj/machinery/smartfridge/New()
- ..()
- component_parts = list()
- var/obj/item/weapon/circuitboard/smartfridge/board = new(null)
- board.set_type(type)
- component_parts += board
- component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
- RefreshParts()
-
-/obj/machinery/smartfridge/RefreshParts()
- for(var/obj/item/weapon/stock_parts/matter_bin/B in component_parts)
- max_n_of_items = 1500 * B.rating
-
-/obj/machinery/smartfridge/secure
- is_secure = 1
-
-/obj/machinery/smartfridge/New()
- ..()
- if(is_secure)
- wires = new/datum/wires/smartfridge/secure(src)
- else
- wires = new/datum/wires/smartfridge(src)
-
-/obj/machinery/smartfridge/Destroy()
- qdel(wires)
- wires = null
- return ..()
-
-/obj/machinery/smartfridge/proc/accept_check(var/obj/item/O as obj)
- if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/grown/) || istype(O,/obj/item/seeds/))
- return 1
- return 0
-
-/obj/machinery/smartfridge/seeds
- name = "\improper MegaSeed Servitor"
- desc = "When you need seeds fast!"
- icon = 'icons/obj/vending.dmi'
- icon_state = "seeds"
- icon_on = "seeds"
- icon_off = "seeds-off"
-
-/obj/machinery/smartfridge/seeds/accept_check(var/obj/item/O as obj)
- if(istype(O,/obj/item/seeds/))
- return 1
- return 0
-
-/obj/machinery/smartfridge/medbay
- name = "\improper Refrigerated Medicine Storage"
- desc = "A refrigerated storage unit for storing medicine and chemicals."
- icon_state = "smartfridge" //To fix the icon in the map editor.
- icon_on = "smartfridge_chem"
-
-/obj/machinery/smartfridge/medbay/accept_check(var/obj/item/O as obj)
- if(istype(O,/obj/item/weapon/reagent_containers/glass/))
- return 1
- if(istype(O,/obj/item/weapon/storage/pill_bottle/))
- return 1
- if(istype(O,/obj/item/weapon/reagent_containers/food/pill/))
- return 1
- return 0
-
-/obj/machinery/smartfridge/secure/extract
- name = "\improper Slime Extract Storage"
- desc = "A refrigerated storage unit for slime extracts"
- req_access_txt = "47"
-
-/obj/machinery/smartfridge/secure/extract/accept_check(var/obj/item/O as obj)
- if(istype(O,/obj/item/slime_extract))
- return 1
- return 0
-
-/obj/machinery/smartfridge/secure/medbay
- name = "\improper Secure Refrigerated Medicine Storage"
- desc = "A refrigerated storage unit for storing medicine and chemicals."
- icon_state = "smartfridge" //To fix the icon in the map editor.
- icon_on = "smartfridge_chem"
- req_one_access_txt = "5;33"
-
-/obj/machinery/smartfridge/secure/medbay/accept_check(var/obj/item/O as obj)
- if(istype(O,/obj/item/weapon/reagent_containers/glass/))
- return 1
- if(istype(O,/obj/item/weapon/storage/pill_bottle/))
- return 1
- if(istype(O,/obj/item/weapon/reagent_containers/food/pill/))
- return 1
- return 0
-
-/obj/machinery/smartfridge/secure/chemistry
- name = "\improper Smart Chemical Storage"
- desc = "A refrigerated storage unit for medicine and chemical storage."
- icon_state = "smartfridge" //To fix the icon in the map editor.
- icon_on = "smartfridge_chem"
- req_access_txt = "33"
- var/list/spawn_meds = list()
-
-/obj/machinery/smartfridge/secure/chemistry/New()
- ..()
- for(var/typekey in spawn_meds)
- var/amount = spawn_meds[typekey]
- if(isnull(amount)) amount = 1
- while(amount)
- var/obj/item/I = new typekey(src)
- if(item_quants[I.name])
- item_quants[I.name]++
- else
- item_quants[I.name] = 1
- nanomanager.update_uis(src)
- amount--
-
-/obj/machinery/smartfridge/chemistry/accept_check(var/obj/item/O as obj)
- if(istype(O,/obj/item/weapon/storage/pill_bottle) || istype(O,/obj/item/weapon/reagent_containers))
- return 1
- return 0
-
-
-// ----------------------------
-// Virology Medical Smartfridge
-// ----------------------------
-/obj/machinery/smartfridge/secure/chemistry/virology
- name = "smart virus storage"
- desc = "A refrigerated storage unit for volatile sample storage."
- req_access_txt = "39"
- spawn_meds = list(/obj/item/weapon/reagent_containers/syringe/antiviral = 4,
- /obj/item/weapon/reagent_containers/glass/bottle/cold = 1,
- /obj/item/weapon/reagent_containers/glass/bottle/flu_virion = 1,
- /obj/item/weapon/reagent_containers/glass/bottle/mutagen = 1,
- /obj/item/weapon/reagent_containers/glass/bottle/plasma = 1,
- /obj/item/weapon/reagent_containers/glass/bottle/diphenhydramine = 1)
-
-/obj/machinery/smartfridge/secure/chemistry/virology/accept_check(var/obj/item/O as obj)
- if(istype(O, /obj/item/weapon/reagent_containers/syringe) || istype(O, /obj/item/weapon/reagent_containers/glass/bottle) || istype(O, /obj/item/weapon/reagent_containers/glass/beaker))
- return 1
- return 0
-
-/obj/machinery/smartfridge/drinks
- name = "\improper Drink Showcase"
- desc = "A refrigerated storage unit for tasty tasty alcohol."
-
-/obj/machinery/smartfridge/drinks/accept_check(var/obj/item/O as obj)
- if(istype(O,/obj/item/weapon/reagent_containers/glass) || istype(O,/obj/item/weapon/reagent_containers/food/drinks) || istype(O,/obj/item/weapon/reagent_containers/food/condiment))
- return 1
-
-/obj/machinery/smartfridge/process()
- if(stat & (BROKEN|NOPOWER))
- return
- if(src.seconds_electrified > 0)
- src.seconds_electrified--
- if(src.shoot_inventory && prob(2))
- src.throw_item()
-
-/obj/machinery/smartfridge/power_change()
- var/old_stat = stat
- ..()
- if(old_stat != stat)
- update_icon()
-
-/obj/machinery/smartfridge/update_icon()
- if(stat & (BROKEN|NOPOWER))
- icon_state = icon_off
- else
- icon_state = icon_on
-
-
-/*******************
-* Item Adding
-********************/
-
-/obj/machinery/smartfridge/attackby(var/obj/item/O as obj, var/mob/user as mob)
- if(istype(O, /obj/item/weapon/screwdriver) && anchored)
- playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
- panel_open = !panel_open
- to_chat(user, "You [panel_open ? "open" : "close"] the maintenance panel.")
- overlays.Cut()
- if(panel_open)
- overlays += image(icon, "[initial(icon_state)]-panel")
- return
-
- if(exchange_parts(user, O))
- return
-
- if(default_unfasten_wrench(user, O))
- power_change()
- return
-
- default_deconstruction_crowbar(O)
-
- if(istype(O, /obj/item/device/multitool)||istype(O, /obj/item/weapon/wirecutters))
- if(panel_open)
- attack_hand(user)
- return
-
- if(stat & NOPOWER)
- to_chat(user, "\The [src] is unpowered and useless.")
- return
-
- if(load(O, user))
- user.visible_message("[user] has added \the [O] to \the [src].", "You add \the [O] to \the [src].")
-
- nanomanager.update_uis(src)
-
- else if(istype(O, /obj/item/weapon/storage/bag))
- var/obj/item/weapon/storage/bag/P = O
- var/plants_loaded = 0
- for(var/obj/G in P.contents)
- if(load(G, user))
- plants_loaded++
- if(plants_loaded)
- user.visible_message("[user] loads \the [src] with \the [P].", "You load \the [src] with \the [P].")
- if(P.contents.len > 0)
- to_chat(user, "Some items are refused.")
-
- nanomanager.update_uis(src)
-
- else
- to_chat(user, "\The [src] smartly refuses [O].")
- return 1
-
-/obj/machinery/smartfridge/proc/load(obj/I, mob/user)
- if(accept_check(I))
- if(contents.len >= max_n_of_items)
- to_chat(user, "\The [src] is full.")
- return 0
- else
- if(istype(I.loc, /obj/item/weapon/storage))
- var/obj/item/weapon/storage/S = I.loc
- S.remove_from_storage(I, src)
- else if(istype(I.loc, /mob))
- var/mob/M = I.loc
- if(M.get_active_hand() == I)
- if(!M.drop_item())
- to_chat(user, "\The [I] is stuck to you!")
- return 0
- else
- M.unEquip(I)
- I.forceMove(src)
- else
- I.forceMove(src)
-
- if(item_quants[I.name])
- item_quants[I.name]++
- else
- item_quants[I.name] = 1
- return 1
- return 0
-
-/obj/machinery/smartfridge/attack_ai(mob/user as mob)
- return 0
-
-/obj/machinery/smartfridge/attack_ghost(mob/user as mob)
- return src.attack_hand(user)
-
-/obj/machinery/smartfridge/attack_hand(mob/user as mob)
- if(stat & (NOPOWER|BROKEN))
- return
- wires.Interact(user)
- ui_interact(user)
-
-//Drag pill bottle to fridge to empty it into the fridge
-/obj/machinery/smartfridge/MouseDrop_T(obj/over_object as obj, mob/user as mob)
- if(!istype(over_object, /obj/item/weapon/storage/pill_bottle)) //Only pill bottles, please
- return
-
- if(stat & NOPOWER)
- to_chat(user, "\The [src] is unpowered and useless.")
- return
-
- var/obj/item/weapon/storage/box/pillbottles/P = over_object
- var/items_loaded = 0
- for(var/obj/G in P.contents)
- if(load(G, user))
- items_loaded++
- if(items_loaded)
- user.visible_message( \
- "[user] empties \the [P] into \the [src].", \
- "You empty \the [P] into \the [src].")
- if(P.contents.len > 0)
- to_chat(user, "Some items are refused.")
- nanomanager.update_uis(src)
-
-/obj/machinery/smartfridge/secure/emag_act(user as mob)
- emagged = 1
- locked = -1
- to_chat(user, "You short out the product lock on [src].")
-
-/*******************
-* SmartFridge Menu
-********************/
-
-/obj/machinery/smartfridge/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
- user.set_machine(src)
-
- var/data[0]
- data["contents"] = null
- data["electrified"] = seconds_electrified > 0
- data["shoot_inventory"] = shoot_inventory
- data["locked"] = locked
- data["secure"] = is_secure
-
- var/list/items[0]
- for (var/i=1 to length(item_quants))
- var/K = item_quants[i]
- var/count = item_quants[K]
- if(count > 0)
- items.Add(list(list("display_name" = html_encode(capitalize(K)), "vend" = i, "quantity" = count)))
-
- if(items.len > 0)
- data["contents"] = items
-
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if(!ui)
- ui = new(user, src, ui_key, "smartfridge.tmpl", src.name, 400, 500)
- ui.set_initial_data(data)
- ui.open()
-
-/obj/machinery/smartfridge/Topic(href, href_list)
- if(..()) return 0
-
- var/mob/user = usr
- var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main")
-
- src.add_fingerprint(user)
-
- if(href_list["close"])
- user.unset_machine()
- ui.close()
- return 0
-
- if(href_list["vend"])
- var/index = text2num(href_list["vend"])
- var/amount = text2num(href_list["amount"])
- var/K = item_quants[index]
- var/count = item_quants[K]
-
- // Sanity check, there are probably ways to press the button when it shouldn't be possible.
- if(count > 0)
- item_quants[K] = max(count - amount, 0)
-
- var/i = amount
- for(var/obj/O in contents)
- if(O.name == K)
- O.forceMove(loc)
- i--
- if(i <= 0)
- return 1
-
- return 1
- return 0
-
-/obj/machinery/smartfridge/proc/throw_item()
- var/obj/throw_item = null
- var/mob/living/target = locate() in view(7,src)
- if(!target)
- return 0
-
- for (var/O in item_quants)
- if(item_quants[O] <= 0) //Try to use a record that actually has something to dump.
- continue
-
- item_quants[O]--
- for(var/obj/T in contents)
- if(T.name == O)
- T.forceMove(src.loc)
- throw_item = T
- break
- break
- if(!throw_item)
- return 0
- spawn(0)
- throw_item.throw_at(target,16,3,src)
- src.visible_message("[src] launches [throw_item.name] at [target.name]!")
- return 1
-
-/************************
-* Secure SmartFridges
-*************************/
-
-/obj/machinery/smartfridge/secure/Topic(href, href_list)
- if(stat & (NOPOWER|BROKEN))
- return 0
- if(usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf)))
- if(!allowed(usr) && !emagged && locked != -1 && href_list["vend"])
- to_chat(usr, "Access denied.")
- nanomanager.update_uis(src)
- return 0
+/* 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/max_n_of_items = 1500
+ var/icon_on = "smartfridge"
+ var/icon_off = "smartfridge-off"
+ var/icon_panel = "smartfridge-panel"
+ var/item_quants = list()
+ var/seconds_electrified = 0;
+ var/shoot_inventory = 0
+ var/locked = 0
+ var/scan_id = 1
+ var/is_secure = 0
+ var/datum/wires/smartfridge/wires = null
+
+/obj/machinery/smartfridge/New()
+ ..()
+ component_parts = list()
+ var/obj/item/weapon/circuitboard/smartfridge/board = new(null)
+ board.set_type(type)
+ component_parts += board
+ component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
+ RefreshParts()
+
+/obj/machinery/smartfridge/RefreshParts()
+ for(var/obj/item/weapon/stock_parts/matter_bin/B in component_parts)
+ max_n_of_items = 1500 * B.rating
+
+/obj/machinery/smartfridge/secure
+ is_secure = 1
+
+/obj/machinery/smartfridge/New()
+ ..()
+ if(is_secure)
+ wires = new/datum/wires/smartfridge/secure(src)
+ else
+ wires = new/datum/wires/smartfridge(src)
+
+/obj/machinery/smartfridge/Destroy()
+ qdel(wires)
+ wires = null
+ return ..()
+
+/obj/machinery/smartfridge/proc/accept_check(var/obj/item/O as obj)
+ if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/grown/) || istype(O,/obj/item/seeds/))
+ return 1
+ return 0
+
+/obj/machinery/smartfridge/seeds
+ name = "\improper MegaSeed Servitor"
+ desc = "When you need seeds fast!"
+ icon = 'icons/obj/vending.dmi'
+ icon_state = "seeds"
+ icon_on = "seeds"
+ icon_off = "seeds-off"
+
+/obj/machinery/smartfridge/seeds/accept_check(var/obj/item/O as obj)
+ if(istype(O,/obj/item/seeds/))
+ return 1
+ return 0
+
+/obj/machinery/smartfridge/medbay
+ name = "\improper Refrigerated Medicine Storage"
+ desc = "A refrigerated storage unit for storing medicine and chemicals."
+ icon_state = "smartfridge" //To fix the icon in the map editor.
+ icon_on = "smartfridge_chem"
+
+/obj/machinery/smartfridge/medbay/accept_check(var/obj/item/O as obj)
+ if(istype(O,/obj/item/weapon/reagent_containers/glass/))
+ return 1
+ if(istype(O,/obj/item/weapon/storage/pill_bottle/))
+ return 1
+ if(istype(O,/obj/item/weapon/reagent_containers/food/pill/))
+ return 1
+ return 0
+
+/obj/machinery/smartfridge/secure/extract
+ name = "\improper Slime Extract Storage"
+ desc = "A refrigerated storage unit for slime extracts"
+ req_access_txt = "47"
+
+/obj/machinery/smartfridge/secure/extract/accept_check(var/obj/item/O as obj)
+ if(istype(O,/obj/item/slime_extract))
+ return 1
+ return 0
+
+/obj/machinery/smartfridge/secure/medbay
+ name = "\improper Secure Refrigerated Medicine Storage"
+ desc = "A refrigerated storage unit for storing medicine and chemicals."
+ icon_state = "smartfridge" //To fix the icon in the map editor.
+ icon_on = "smartfridge_chem"
+ req_one_access_txt = "5;33"
+
+/obj/machinery/smartfridge/secure/medbay/accept_check(var/obj/item/O as obj)
+ if(istype(O,/obj/item/weapon/reagent_containers/glass/))
+ return 1
+ if(istype(O,/obj/item/weapon/storage/pill_bottle/))
+ return 1
+ if(istype(O,/obj/item/weapon/reagent_containers/food/pill/))
+ return 1
+ return 0
+
+/obj/machinery/smartfridge/secure/chemistry
+ name = "\improper Smart Chemical Storage"
+ desc = "A refrigerated storage unit for medicine and chemical storage."
+ icon_state = "smartfridge" //To fix the icon in the map editor.
+ icon_on = "smartfridge_chem"
+ req_access_txt = "33"
+ var/list/spawn_meds = list()
+
+/obj/machinery/smartfridge/secure/chemistry/New()
+ ..()
+ for(var/typekey in spawn_meds)
+ var/amount = spawn_meds[typekey]
+ if(isnull(amount)) amount = 1
+ while(amount)
+ var/obj/item/I = new typekey(src)
+ if(item_quants[I.name])
+ item_quants[I.name]++
+ else
+ item_quants[I.name] = 1
+ nanomanager.update_uis(src)
+ amount--
+
+/obj/machinery/smartfridge/chemistry/accept_check(var/obj/item/O as obj)
+ if(istype(O,/obj/item/weapon/storage/pill_bottle) || istype(O,/obj/item/weapon/reagent_containers))
+ return 1
+ return 0
+
+
+// ----------------------------
+// Virology Medical Smartfridge
+// ----------------------------
+/obj/machinery/smartfridge/secure/chemistry/virology
+ name = "smart virus storage"
+ desc = "A refrigerated storage unit for volatile sample storage."
+ req_access_txt = "39"
+ spawn_meds = list(/obj/item/weapon/reagent_containers/syringe/antiviral = 4,
+ /obj/item/weapon/reagent_containers/glass/bottle/cold = 1,
+ /obj/item/weapon/reagent_containers/glass/bottle/flu_virion = 1,
+ /obj/item/weapon/reagent_containers/glass/bottle/mutagen = 1,
+ /obj/item/weapon/reagent_containers/glass/bottle/plasma = 1,
+ /obj/item/weapon/reagent_containers/glass/bottle/diphenhydramine = 1)
+
+/obj/machinery/smartfridge/secure/chemistry/virology/accept_check(var/obj/item/O as obj)
+ if(istype(O, /obj/item/weapon/reagent_containers/syringe) || istype(O, /obj/item/weapon/reagent_containers/glass/bottle) || istype(O, /obj/item/weapon/reagent_containers/glass/beaker))
+ return 1
+ return 0
+
+/obj/machinery/smartfridge/drinks
+ name = "\improper Drink Showcase"
+ desc = "A refrigerated storage unit for tasty tasty alcohol."
+
+/obj/machinery/smartfridge/drinks/accept_check(var/obj/item/O as obj)
+ if(istype(O,/obj/item/weapon/reagent_containers/glass) || istype(O,/obj/item/weapon/reagent_containers/food/drinks) || istype(O,/obj/item/weapon/reagent_containers/food/condiment))
+ return 1
+
+/obj/machinery/smartfridge/process()
+ if(stat & (BROKEN|NOPOWER))
+ return
+ if(src.seconds_electrified > 0)
+ src.seconds_electrified--
+ if(src.shoot_inventory && prob(2))
+ src.throw_item()
+
+/obj/machinery/smartfridge/power_change()
+ var/old_stat = stat
+ ..()
+ if(old_stat != stat)
+ update_icon()
+
+/obj/machinery/smartfridge/update_icon()
+ if(stat & (BROKEN|NOPOWER))
+ icon_state = icon_off
+ else
+ icon_state = icon_on
+
+
+/*******************
+* Item Adding
+********************/
+
+/obj/machinery/smartfridge/attackby(var/obj/item/O as obj, var/mob/user as mob)
+ if(istype(O, /obj/item/weapon/screwdriver) && anchored)
+ playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
+ panel_open = !panel_open
+ to_chat(user, "You [panel_open ? "open" : "close"] the maintenance panel.")
+ overlays.Cut()
+ if(panel_open)
+ overlays += image(icon, "[initial(icon_state)]-panel")
+ return
+
+ if(exchange_parts(user, O))
+ return
+
+ if(default_unfasten_wrench(user, O))
+ power_change()
+ return
+
+ default_deconstruction_crowbar(O)
+
+ if(istype(O, /obj/item/device/multitool)||istype(O, /obj/item/weapon/wirecutters))
+ if(panel_open)
+ attack_hand(user)
+ return
+
+ if(stat & NOPOWER)
+ to_chat(user, "\The [src] is unpowered and useless.")
+ return
+
+ if(load(O, user))
+ user.visible_message("[user] has added \the [O] to \the [src].", "You add \the [O] to \the [src].")
+
+ nanomanager.update_uis(src)
+
+ else if(istype(O, /obj/item/weapon/storage/bag))
+ var/obj/item/weapon/storage/bag/P = O
+ var/plants_loaded = 0
+ for(var/obj/G in P.contents)
+ if(load(G, user))
+ plants_loaded++
+ if(plants_loaded)
+ user.visible_message("[user] loads \the [src] with \the [P].", "You load \the [src] with \the [P].")
+ if(P.contents.len > 0)
+ to_chat(user, "Some items are refused.")
+
+ nanomanager.update_uis(src)
+
+ else
+ to_chat(user, "\The [src] smartly refuses [O].")
+ return 1
+
+/obj/machinery/smartfridge/proc/load(obj/I, mob/user)
+ if(accept_check(I))
+ if(contents.len >= max_n_of_items)
+ to_chat(user, "\The [src] is full.")
+ return 0
+ else
+ if(istype(I.loc, /obj/item/weapon/storage))
+ var/obj/item/weapon/storage/S = I.loc
+ S.remove_from_storage(I, src)
+ else if(istype(I.loc, /mob))
+ var/mob/M = I.loc
+ if(M.get_active_hand() == I)
+ if(!M.drop_item())
+ to_chat(user, "\The [I] is stuck to you!")
+ return 0
+ else
+ M.unEquip(I)
+ I.forceMove(src)
+ else
+ I.forceMove(src)
+
+ if(item_quants[I.name])
+ item_quants[I.name]++
+ else
+ item_quants[I.name] = 1
+ return 1
+ return 0
+
+/obj/machinery/smartfridge/attack_ai(mob/user as mob)
+ return 0
+
+/obj/machinery/smartfridge/attack_ghost(mob/user as mob)
+ return src.attack_hand(user)
+
+/obj/machinery/smartfridge/attack_hand(mob/user as mob)
+ if(stat & (NOPOWER|BROKEN))
+ return
+ wires.Interact(user)
+ ui_interact(user)
+
+//Drag pill bottle to fridge to empty it into the fridge
+/obj/machinery/smartfridge/MouseDrop_T(obj/over_object as obj, mob/user as mob)
+ if(!istype(over_object, /obj/item/weapon/storage/pill_bottle)) //Only pill bottles, please
+ return
+
+ if(stat & NOPOWER)
+ to_chat(user, "\The [src] is unpowered and useless.")
+ return
+
+ var/obj/item/weapon/storage/box/pillbottles/P = over_object
+ var/items_loaded = 0
+ for(var/obj/G in P.contents)
+ if(load(G, user))
+ items_loaded++
+ if(items_loaded)
+ user.visible_message( \
+ "[user] empties \the [P] into \the [src].", \
+ "You empty \the [P] into \the [src].")
+ if(P.contents.len > 0)
+ to_chat(user, "Some items are refused.")
+ nanomanager.update_uis(src)
+
+/obj/machinery/smartfridge/secure/emag_act(user as mob)
+ emagged = 1
+ locked = -1
+ to_chat(user, "You short out the product lock on [src].")
+
+/*******************
+* SmartFridge Menu
+********************/
+
+/obj/machinery/smartfridge/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
+ user.set_machine(src)
+
+ var/data[0]
+ data["contents"] = null
+ data["electrified"] = seconds_electrified > 0
+ data["shoot_inventory"] = shoot_inventory
+ data["locked"] = locked
+ data["secure"] = is_secure
+
+ var/list/items[0]
+ for(var/i=1 to length(item_quants))
+ var/K = item_quants[i]
+ var/count = item_quants[K]
+ if(count > 0)
+ items.Add(list(list("display_name" = html_encode(capitalize(K)), "vend" = i, "quantity" = count)))
+
+ if(items.len > 0)
+ data["contents"] = items
+
+ ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ if(!ui)
+ ui = new(user, src, ui_key, "smartfridge.tmpl", src.name, 400, 500)
+ ui.set_initial_data(data)
+ ui.open()
+
+/obj/machinery/smartfridge/Topic(href, href_list)
+ if(..()) return 0
+
+ var/mob/user = usr
+ var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main")
+
+ src.add_fingerprint(user)
+
+ if(href_list["close"])
+ user.unset_machine()
+ ui.close()
+ return 0
+
+ if(href_list["vend"])
+ var/index = text2num(href_list["vend"])
+ var/amount = text2num(href_list["amount"])
+ var/K = item_quants[index]
+ var/count = item_quants[K]
+
+ // Sanity check, there are probably ways to press the button when it shouldn't be possible.
+ if(count > 0)
+ item_quants[K] = max(count - amount, 0)
+
+ var/i = amount
+ for(var/obj/O in contents)
+ if(O.name == K)
+ O.forceMove(loc)
+ i--
+ if(i <= 0)
+ return 1
+
+ return 1
+ return 0
+
+/obj/machinery/smartfridge/proc/throw_item()
+ var/obj/throw_item = null
+ var/mob/living/target = locate() in view(7,src)
+ if(!target)
+ return 0
+
+ for(var/O in item_quants)
+ if(item_quants[O] <= 0) //Try to use a record that actually has something to dump.
+ continue
+
+ item_quants[O]--
+ for(var/obj/T in contents)
+ if(T.name == O)
+ T.forceMove(src.loc)
+ throw_item = T
+ break
+ break
+ if(!throw_item)
+ return 0
+ spawn(0)
+ throw_item.throw_at(target,16,3,src)
+ src.visible_message("[src] launches [throw_item.name] at [target.name]!")
+ return 1
+
+/************************
+* Secure SmartFridges
+*************************/
+
+/obj/machinery/smartfridge/secure/Topic(href, href_list)
+ if(stat & (NOPOWER|BROKEN))
+ return 0
+ if(usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf)))
+ if(!allowed(usr) && !emagged && locked != -1 && href_list["vend"])
+ to_chat(usr, "Access denied.")
+ nanomanager.update_uis(src)
+ return 0
return ..()
\ No newline at end of file
diff --git a/code/modules/food/recipes_candy.dm b/code/modules/food_and_drinks/recipes/recipes_candy.dm
similarity index 99%
rename from code/modules/food/recipes_candy.dm
rename to code/modules/food_and_drinks/recipes/recipes_candy.dm
index 8067820786f..2ab54fc0e27 100644
--- a/code/modules/food/recipes_candy.dm
+++ b/code/modules/food_and_drinks/recipes/recipes_candy.dm
@@ -69,7 +69,7 @@
result = /obj/item/weapon/reagent_containers/food/snacks/candy/toffee
/datum/recipe/candy/taffy
- reagents = list("sugar" = 5, "water" = 5, "sodiumchloride" = 5)
+ reagents = list("salglu_solution" = 15)
items = list()
result = /obj/item/weapon/reagent_containers/food/snacks/candy/taffy
@@ -532,4 +532,4 @@
/obj/item/weapon/reagent_containers/food/snacks/candy/caramel,
/obj/item/weapon/reagent_containers/food/snacks/candy/nougat,
)
- result = /obj/item/weapon/reagent_containers/food/snacks/candy/candybar/caramel_nougat
\ No newline at end of file
+ result = /obj/item/weapon/reagent_containers/food/snacks/candy/candybar/caramel_nougat
diff --git a/code/modules/food/recipes_grill.dm b/code/modules/food_and_drinks/recipes/recipes_grill.dm
similarity index 97%
rename from code/modules/food/recipes_grill.dm
rename to code/modules/food_and_drinks/recipes/recipes_grill.dm
index 0c3c81078df..4c459b737ff 100644
--- a/code/modules/food/recipes_grill.dm
+++ b/code/modules/food_and_drinks/recipes/recipes_grill.dm
@@ -1,6 +1,12 @@
// /datum/recipe/grill
+/datum/recipe/grill/bacon
+ items = list(
+ /obj/item/weapon/reagent_containers/food/snacks/raw_bacon,
+ )
+ result = /obj/item/weapon/reagent_containers/food/snacks/bacon
+
/datum/recipe/grill/telebacon
items = list(
/obj/item/weapon/reagent_containers/food/snacks/meat,
@@ -214,4 +220,4 @@
/obj/item/weapon/reagent_containers/food/snacks/boiledrice,
/obj/item/weapon/reagent_containers/food/snacks/catfishmeat,
)
- result = /obj/item/weapon/reagent_containers/food/snacks/sushi_Tai
\ No newline at end of file
+ result = /obj/item/weapon/reagent_containers/food/snacks/sushi_Tai
diff --git a/code/modules/food/recipes_microwave.dm b/code/modules/food_and_drinks/recipes/recipes_microwave.dm
similarity index 100%
rename from code/modules/food/recipes_microwave.dm
rename to code/modules/food_and_drinks/recipes/recipes_microwave.dm
diff --git a/code/modules/food/recipes_oven.dm b/code/modules/food_and_drinks/recipes/recipes_oven.dm
similarity index 99%
rename from code/modules/food/recipes_oven.dm
rename to code/modules/food_and_drinks/recipes/recipes_oven.dm
index 105bc4d0282..9ee3ff3343e 100644
--- a/code/modules/food/recipes_oven.dm
+++ b/code/modules/food_and_drinks/recipes/recipes_oven.dm
@@ -185,9 +185,9 @@
return being_cooked
check_items(var/obj/container as obj)
. = ..()
- if (.)
+ if(.)
var/obj/item/weapon/paper/paper = locate() in container
- if (!paper || !paper.info)
+ if(!paper || !paper.info)
return -1
return .
diff --git a/code/modules/food/recipes_table.dm b/code/modules/food_and_drinks/recipes/tablecraft/recipes_table.dm
similarity index 80%
rename from code/modules/food/recipes_table.dm
rename to code/modules/food_and_drinks/recipes/tablecraft/recipes_table.dm
index 0c9f72dd6d5..005be6c1f7e 100644
--- a/code/modules/food/recipes_table.dm
+++ b/code/modules/food_and_drinks/recipes/tablecraft/recipes_table.dm
@@ -1,5 +1,5 @@
/* Example for reference when defining recipes
-/datum/table_recipe/food
+/datum/crafting_recipe/food
name = "" //in-game display name
reqs[] = list() //type paths of items/reagents consumed associated with how many are needed (equivalent to var/list/items and var/list/reagents combined)
result //type path of item resulting from this craft
@@ -9,7 +9,7 @@
fruit[] = list() //grown products required by the recipe
*/
-/datum/table_recipe/sandwich
+/datum/crafting_recipe/sandwich
name = "Sandwich"
reqs = list(
/obj/item/weapon/reagent_containers/food/snacks/meatsteak = 1,
@@ -17,55 +17,61 @@
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge = 1,
)
result = /obj/item/weapon/reagent_containers/food/snacks/sandwich
+ category = CAT_FOOD
-/datum/table_recipe/slimesandwich
+/datum/crafting_recipe/slimesandwich
name = "Slime Jelly Sandwich"
reqs = list(
/datum/reagent/slimejelly = 5,
/obj/item/weapon/reagent_containers/food/snacks/breadslice = 2,
)
result = /obj/item/weapon/reagent_containers/food/snacks/jellysandwich/slime
+ category = CAT_FOOD
-/datum/table_recipe/cherrysandwich
+/datum/crafting_recipe/cherrysandwich
name = "Cherry Jelly Sandwich"
reqs = list(
/datum/reagent/cherryjelly = 5,
/obj/item/weapon/reagent_containers/food/snacks/breadslice = 2,
)
result = /obj/item/weapon/reagent_containers/food/snacks/jellysandwich/cherry
+ category = CAT_FOOD
-/datum/table_recipe/slimeburger
+/datum/crafting_recipe/slimeburger
name = "Slime Jelly Burger"
reqs = list(
/datum/reagent/slimejelly = 5,
/obj/item/weapon/reagent_containers/food/snacks/bun = 1,
)
result = /obj/item/weapon/reagent_containers/food/snacks/jellyburger/slime
+ category = CAT_FOOD
-/datum/table_recipe/jellyburger
+/datum/crafting_recipe/jellyburger
name = "Cherry Jelly Burger"
reqs = list(
/datum/reagent/cherryjelly = 5,
/obj/item/weapon/reagent_containers/food/snacks/bun = 1,
)
result = /obj/item/weapon/reagent_containers/food/snacks/jellyburger/cherry
+ category = CAT_FOOD
-/datum/table_recipe/herbsalad
+/* Temporarily disabled until we can find a workaround for this fruit shit.
+/datum/crafting_recipe/herbsalad
name = "herb salad"
fruit = list("ambrosia" = 3, "apple" = 1)
result = /obj/item/weapon/reagent_containers/food/snacks/herbsalad
-/datum/table_recipe/herbsalad/AdjustChems(var/obj/resultobj as obj)
+/datum/crafting_recipe/herbsalad/AdjustChems(var/obj/resultobj as obj)
if(istype(resultobj, /obj/item/weapon/reagent_containers))
var/obj/item/weapon/reagent_containers/RC = resultobj
RC.reagents.del_reagent("toxin")
-/datum/table_recipe/aesirsalad
+/datum/crafting_recipe/aesirsalad
name = "Aesir salad"
fruit = list("ambrosiadeus" = 3, "goldapple" = 1)
result = /obj/item/weapon/reagent_containers/food/snacks/aesirsalad
-/datum/table_recipe/validsalad
+/datum/crafting_recipe/validsalad
name = "valid salad"
fruit = list("ambrosia" = 3, "potato" = 1)
reqs = list(
@@ -73,20 +79,12 @@
)
result = /obj/item/weapon/reagent_containers/food/snacks/validsalad
-/datum/table_recipe/validsalad/AdjustChems(var/obj/resultobj as obj)
+/datum/crafting_recipe/validsalad/AdjustChems(var/obj/resultobj as obj)
if(istype(resultobj, /obj/item/weapon/reagent_containers))
var/obj/item/weapon/reagent_containers/RC = resultobj
RC.reagents.del_reagent("toxin")
-/datum/table_recipe/notasandwich
- name = "not-a-sandwich"
- reqs = list(
- /obj/item/weapon/reagent_containers/food/snacks/breadslice = 2,
- /obj/item/clothing/mask/fakemoustache = 1,
- )
- result = /obj/item/weapon/reagent_containers/food/snacks/notasandwich
-
-/datum/table_recipe/wrap
+/datum/crafting_recipe/wrap
name = "egg wrap"
fruit = list("cabbage" = 1)
reqs = list(
@@ -94,75 +92,95 @@
/obj/item/weapon/reagent_containers/food/snacks/friedegg = 1,
)
result = /obj/item/weapon/reagent_containers/food/snacks/wrap
+*/
-/datum/table_recipe/sushi_Ebi
+/datum/crafting_recipe/notasandwich
+ name = "not-a-sandwich"
+ reqs = list(
+ /obj/item/weapon/reagent_containers/food/snacks/breadslice = 2,
+ /obj/item/clothing/mask/fakemoustache = 1,
+ )
+ result = /obj/item/weapon/reagent_containers/food/snacks/notasandwich
+ category = CAT_FOOD
+
+
+/datum/crafting_recipe/sushi_Ebi
name = "Ebi Sushi"
reqs = list(
/obj/item/weapon/reagent_containers/food/snacks/boiledrice = 1,
/obj/item/weapon/reagent_containers/food/snacks/boiled_shrimp = 1,
)
result = /obj/item/weapon/reagent_containers/food/snacks/sushi_Ebi
+ category = CAT_FOOD
-/datum/table_recipe/sushi_Ikura
+/datum/crafting_recipe/sushi_Ikura
name = "Ikura Sushi"
reqs = list(
/obj/item/weapon/reagent_containers/food/snacks/boiledrice = 1,
/obj/item/fish_eggs/salmon = 1,
)
result = /obj/item/weapon/reagent_containers/food/snacks/sushi_Ikura
+ category = CAT_FOOD
-/datum/table_recipe/sushi_Inari
+/datum/crafting_recipe/sushi_Inari
name = "Inari Sushi"
reqs = list(
/obj/item/weapon/reagent_containers/food/snacks/boiledrice = 1,
/obj/item/weapon/reagent_containers/food/snacks/fried_tofu = 1,
)
result = /obj/item/weapon/reagent_containers/food/snacks/sushi_Inari
+ category = CAT_FOOD
-/datum/table_recipe/sushi_Sake
+/datum/crafting_recipe/sushi_Sake
name = "Sake Sushi"
reqs = list(
/obj/item/weapon/reagent_containers/food/snacks/boiledrice = 1,
/obj/item/weapon/reagent_containers/food/snacks/salmonmeat = 1,
)
result = /obj/item/weapon/reagent_containers/food/snacks/sushi_Sake
+ category = CAT_FOOD
-/datum/table_recipe/sushi_SmokedSalmon
+/datum/crafting_recipe/sushi_SmokedSalmon
name = "Smoked Salmon Sushi"
reqs = list(
/obj/item/weapon/reagent_containers/food/snacks/boiledrice = 1,
/obj/item/weapon/reagent_containers/food/snacks/salmonsteak = 1,
)
result = /obj/item/weapon/reagent_containers/food/snacks/sushi_SmokedSalmon
+ category = CAT_FOOD
-/datum/table_recipe/sushi_Masago
+/datum/crafting_recipe/sushi_Masago
name = "Masago Sushi"
reqs = list(
/obj/item/weapon/reagent_containers/food/snacks/boiledrice = 1,
/obj/item/fish_eggs/goldfish = 1,
)
result = /obj/item/weapon/reagent_containers/food/snacks/sushi_Masago
+ category = CAT_FOOD
-/datum/table_recipe/sushi_Tobiko
+/datum/crafting_recipe/sushi_Tobiko
name = "Tobiko Sushi"
reqs = list(
/obj/item/weapon/reagent_containers/food/snacks/boiledrice = 1,
/obj/item/fish_eggs/shark = 1,
)
result = /obj/item/weapon/reagent_containers/food/snacks/sushi_Tobiko
+ category = CAT_FOOD
-/datum/table_recipe/sushi_TobikoEgg
+/datum/crafting_recipe/sushi_TobikoEgg
name = "Tobiko and Egg Sushi"
reqs = list(
/obj/item/weapon/reagent_containers/food/snacks/sushi_Tobiko = 1,
/obj/item/weapon/reagent_containers/food/snacks/egg = 1,
)
result = /obj/item/weapon/reagent_containers/food/snacks/sushi_TobikoEgg
+ category = CAT_FOOD
-/datum/table_recipe/sushi_Tai
+/datum/crafting_recipe/sushi_Tai
name = "Tai Sushi"
reqs = list(
/obj/item/weapon/reagent_containers/food/snacks/boiledrice = 1,
/obj/item/weapon/reagent_containers/food/snacks/catfishmeat = 1,
)
- result = /obj/item/weapon/reagent_containers/food/snacks/sushi_Tai
\ No newline at end of file
+ result = /obj/item/weapon/reagent_containers/food/snacks/sushi_Tai
+ category = CAT_FOOD
diff --git a/code/modules/garbage_collection/__gc_info.dm b/code/modules/garbage_collection/__gc_info.dm
index 96e3a0ea8dc..be72097a8c9 100644
--- a/code/modules/garbage_collection/__gc_info.dm
+++ b/code/modules/garbage_collection/__gc_info.dm
@@ -43,9 +43,8 @@ that can't be. There are two main procs involved in this process:
/datum/proc/Destroy()
This is, effectively, a replacement for Del() (with some exceptions) which is also responsible for nulling out
- references to or on the object it is called on. Like Del, the Destroy proc will always be called, even if the object
- is getting destroyed by a direct del instead of qdel; in that case, isnull(gcDestroyed) will be true, and some
- references can safely be ignored.
+ references to or on the object it is called on. Unlike Del, the Destroy proc will only be called by qdel; generally,
+ this should only happen to datums that are no longer referenced by anything, which shouldn't be an issue.
The exceptions where Destroy cannot replace Del are for the same non-datum types mentioned under qdel, above. Those
should use a Del proc for any necessary cleanup, as a Destroy proc on them will not automatically get called.
diff --git a/code/modules/garbage_collection/garbage_collector.dm b/code/modules/garbage_collection/garbage_collector.dm
index aa8933c42de..29db9198ae4 100644
--- a/code/modules/garbage_collection/garbage_collector.dm
+++ b/code/modules/garbage_collection/garbage_collector.dm
@@ -92,12 +92,13 @@ var/global/datum/controller/process/garbage_collector/garbageCollector
if(isnull(D))
return
- if(isnull(garbageCollector))
+ if(!istype(D)) // A non-datum was passed into qdel - just delete it outright.
+ // warning("qdel() passed object of type [D.type]. qdel() can only handle /datum/ types.")
del(D)
return
- if(!istype(D)) // A non-datum was passed into qdel - just delete it outright.
- // warning("qdel() passed object of type [D.type]. qdel() can only handle /datum/ types.")
+ if(isnull(garbageCollector))
+ D.Destroy()
del(D)
return
@@ -109,7 +110,7 @@ var/global/datum/controller/process/garbage_collector/garbageCollector
hint = D.Destroy()
catch(var/exception/e)
if(istype(e))
- gcwarning("qdel() caught runtime destroying [D.type]: [e] in [e.file], line [e.line]")
+ log_runtime(e, D, "Caught by qdel() destroying [D.type]")
else
gcwarning("qdel() caught runtime destroying [D.type]: [e]")
// Destroy runtimed? Panic! Hard delete!
@@ -129,14 +130,14 @@ var/global/datum/controller/process/garbage_collector/garbageCollector
return
if(QDEL_HINT_IWILLGC) //functionally the same as the above. qdel should assume the object will gc on its own, and not check it.
return
- if (QDEL_HINT_HARDDEL_NOW) //qdel should assume this object won't gc, and hard del it post haste.
+ if(QDEL_HINT_HARDDEL_NOW) //qdel should assume this object won't gc, and hard del it post haste.
D.hard_deleted = -1 // -1 means "this hard del skipped the queue", used for profiling
del(D)
if(garbageCollector)
garbageCollector.dels_count++
- if (QDEL_HINT_PUTINPOOL) //qdel will put this object in the pool.
+ if(QDEL_HINT_PUTINPOOL) //qdel will put this object in the pool.
PlaceInPool(D,0)
- if (QDEL_HINT_FINDREFERENCE)//qdel will, if TESTING is enabled, display all references to this object, then queue the object for deletion.
+ if(QDEL_HINT_FINDREFERENCE)//qdel will, if TESTING is enabled, display all references to this object, then queue the object for deletion.
#ifdef TESTING
D.find_references(remove_from_queue = FALSE)
#endif
@@ -148,9 +149,9 @@ var/global/datum/controller/process/garbage_collector/garbageCollector
// Returns 1 if the object has been queued for deletion.
/proc/qdeleted(var/datum/D)
- if (!istype(D))
+ if(!istype(D))
return 0
- if (!isnull(D.gcDestroyed))
+ if(!isnull(D.gcDestroyed))
return 1
return 0
@@ -162,22 +163,5 @@ var/global/datum/controller/process/garbage_collector/garbageCollector
tag = null
return QDEL_HINT_QUEUE // Garbage Collect everything.
-// If something gets deleted directly, make sure its Destroy proc is still called
-/datum/Del()
- if(isnull(gcDestroyed)) // Not GC'd
- try
- Destroy()
- catch(var/exception/e)
- if(istype(e))
- gcwarning("Del() caught runtime destroying [type]: [e] in [e.file], line [e.line]")
- else
- gcwarning("Del() caught runtime destroying [type]: [e]")
- if(del_profiling)
- delete_profile(src)
- else
- if(del_profiling)
- delete_profile(src)
- return ..()
-
/proc/gcwarning(msg)
log_to_dd("## GC WARNING: [msg]")
diff --git a/code/modules/garbage_collection/gc_testing.dm b/code/modules/garbage_collection/gc_testing.dm
index 25fc4bef495..b1b413a0398 100644
--- a/code/modules/garbage_collection/gc_testing.dm
+++ b/code/modules/garbage_collection/gc_testing.dm
@@ -13,28 +13,6 @@
log_admin("[key_name(usr)] turned qdel [garbageCollector.del_everything ? "off" : "on"].")
message_admins("\blue [key_name_admin(usr)] turned qdel [garbageCollector.del_everything ? "off" : "on"].", 1)
-/client/proc/gc_toggle_profiling()
- set name = "(GC) Toggle Profiling"
- set desc = "Toggle profiling of deletion methods"
- set category = "Debug"
-
- if(!check_rights(R_DEBUG))
- return
-
- del_profiling = !del_profiling
- log_admin("[key_name(usr)] turned deletion profiling [del_profiling ? "on" : "off"].")
- message_admins("\blue [key_name_admin(usr)] turned deletion profiling [del_profiling ? "on" : "off"].", 1)
-
-/client/proc/gc_show_del_report()
- set name = "(GC) Show Del Report"
- set desc = "Show report of deletions seen while profiling"
- set category = "Debug"
-
- if(!check_rights(R_DEBUG))
- return
-
- delete_profiler_report()
-
/client/proc/gc_dump_hdl()
set name = "(GC) Hard Del List"
set desc = "List types that are hard del()'d by the GC."
@@ -51,77 +29,6 @@
for(var/A in gc_hard_del_types)
to_chat(usr, "[A]")
-// Profiling stuff
-var/global/del_profiling = 0
-var/global/list/dels_profiled = list()
-var/global/list/gdels_profiled = list()
-var/global/list/ghdels_profiled = list()
-
-/proc/delete_profile(var/datum/D)
- if(!ticker || (ticker.current_state < 3)) return
- var/code = 0
- var/type = D.type
- if(isnull(D.gcDestroyed))
- code = 0
- else if(D.hard_deleted == -1)
- code = 0 // A non-queued hard deletion is counted as a straight deletion
- else if(D.hard_deleted)
- code = 1
- else
- code = 2
- switch(code)
- if(0) // Directly deleted (skipped the GC queue entirely)
- if (!("[type]" in dels_profiled))
- dels_profiled["[type]"] = 0
-
- dels_profiled["[type]"] += 1
- if(1) // Hard-deleted by the GC
- if (!("[type]" in ghdels_profiled))
- ghdels_profiled["[type]"] = 0
-
- ghdels_profiled["[type]"] += 1
- if(2) // qdel'd and garbage collected by BYOND
- if (!("[type]" in gdels_profiled))
- gdels_profiled["[type]"] = 0
-
- gdels_profiled["[type]"] += 1
-
-/proc/delete_profiler_report()
- var/dat = "Deletion Profiler Report"
- if(dels_profiled.len + gdels_profiled.len + ghdels_profiled.len)
- dat += "Direct Deletions "
- dat += "GC Soft Deletions "
- dat += "GC Hard Deletions "
- dat += delete_profiler_sortedlist(dels_profiled, "Direct Deletions", "DD")
- dat += delete_profiler_sortedlist(gdels_profiled, "GC Soft Deletions", "SD")
- dat += delete_profiler_sortedlist(ghdels_profiled, "GC Hard Deletions", "HD")
- else
- dat += "(No deletions profiled; listing types that have been hard-deleted by GC) "
- dat += "
GC Hard Deletion Types
"
- for(var/A in gc_hard_del_types)
- dat += "
[A]
"
- dat += "
"
- usr << browse(dat, "window=delete_profiler_report;size=600x480")
-
-/proc/delete_profiler_sortedlist(var/list/L, var/header, var/anchorid)
- L = L.Copy()
- // Yes, this is a terrible sort, but I'm too lazy to find a good one
- var/v,i,j,s
- for(i = 1 to L.len-1)
- s=i
- v = L[L[i]]
- for(j = i + 1 to L.len)
- if(L[L[j]] > v)
- s = j
- v = L[L[j]]
- L.Swap(i,s)
-
- var/dat = "
[header]
"
- for (var/t in L)
- dat +="
[L[t]]
[t]
"
- dat += "
"
- return dat
-
#ifdef TESTING
/client/var/running_find_references
/datum/var/running_find_references
diff --git a/code/modules/holiday/christmas.dm b/code/modules/holiday/christmas.dm
index 765792e5da1..c90e97d60c1 100644
--- a/code/modules/holiday/christmas.dm
+++ b/code/modules/holiday/christmas.dm
@@ -1,5 +1,6 @@
/datum/holiday/xmas/celebrate()
for(var/obj/structure/flora/tree/pine/xmas in world)
+ // TODO: Tie into space manager
if(!(xmas.z in config.station_levels)) continue
for(var/turf/simulated/floor/T in orange(1,xmas))
for(var/i=1,i<=rand(1,5),i++)
@@ -43,7 +44,7 @@
"What do you get from eating tree decorations?\n\nTinsilitis!",
"What do snowmen wear on their heads?\n\nIce caps!",
"Why is Christmas just like life on ss13?\n\nYou do all the work and the fat guy gets all the credit.",
- "Why doesn’t Santa have any children?\n\nBecause he only comes down the chimney.")
+ "Why doesn�t Santa have any children?\n\nBecause he only comes down the chimney.")
new /obj/item/clothing/head/festive(target.loc)
user.update_icons()
cracked = 1
@@ -61,5 +62,4 @@
icon_state = "xmashat"
desc = "A crappy paper hat that you are REQUIRED to wear."
flags_inv = 0
- armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
-
+ armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
diff --git a/code/modules/hydroponics/beekeeping/beebox.dm b/code/modules/hydroponics/beekeeping/beebox.dm
index 553251a2ee8..817f002f014 100644
--- a/code/modules/hydroponics/beekeeping/beebox.dm
+++ b/code/modules/hydroponics/beekeeping/beebox.dm
@@ -251,4 +251,4 @@
if(!user.put_in_active_hand(QB))
QB.forceMove(get_turf(src))
visible_message("[user] removes the queen from the apiary.")
- queen_bee = null
+ queen_bee = null
\ No newline at end of file
diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm
index b6dc4eee727..81d489d9da1 100644
--- a/code/modules/hydroponics/grown.dm
+++ b/code/modules/hydroponics/grown.dm
@@ -10,6 +10,7 @@
var/datum/seed/seed
var/potency = -1
var/awakening = 0
+ burn_state = FLAMMABLE
/obj/item/weapon/reagent_containers/food/snacks/grown/New(newloc,planttype)
@@ -254,7 +255,7 @@
for(var/i=0,i<2,i++)
var/obj/item/stack/sheet/wood/NG = new (user.loc)
NG.color = seed.get_trait(TRAIT_PRODUCT_COLOUR)
- for (var/obj/item/stack/sheet/wood/G in user.loc)
+ for(var/obj/item/stack/sheet/wood/G in user.loc)
if(G==NG)
continue
if(G.amount>=G.max_amount)
@@ -325,7 +326,7 @@
else
user.visible_message("[M] has been attacked with [src] by [user]!")
- if (hitsound)
+ if(hitsound)
playsound(loc, hitsound, 50, 1, -1)
switch(damtype)
if("brute")
@@ -407,7 +408,7 @@
for(var/i=0,i<2,i++)
var/obj/item/stack/tile/grass/G = new (user.loc)
G.color = seed.get_trait(TRAIT_PRODUCT_COLOUR)
- for (var/obj/item/stack/tile/grass/NG in user.loc)
+ for(var/obj/item/stack/tile/grass/NG in user.loc)
if(G==NG)
continue
if(NG.amount>=NG.max_amount)
diff --git a/code/modules/hydroponics/grown_inedible.dm b/code/modules/hydroponics/grown_inedible.dm
index fd9405cc6bf..d68740eaf47 100644
--- a/code/modules/hydroponics/grown_inedible.dm
+++ b/code/modules/hydroponics/grown_inedible.dm
@@ -7,6 +7,7 @@
icon = 'icons/obj/weapons.dmi'
var/plantname
var/potency = 1
+ burn_state = FLAMMABLE
/obj/item/weapon/grown/New(newloc,planttype)
@@ -80,7 +81,7 @@
/obj/item/weapon/grown/nettle/death
name = "deathnettle"
- desc = "The glowing \black nettle incites rage\black in you just from looking at it!"
+ desc = "The glowing nettle incites rage in you just from looking at it!"
icon_state = "deathnettle"
force = 30
throwforce = 15
@@ -110,7 +111,7 @@
icon = 'icons/obj/trash.dmi'
icon_state = "corncob"
item_state = "corncob"
- w_class = 2.0
+ w_class = 2
throwforce = 0
throw_speed = 4
throw_range = 20
@@ -129,7 +130,7 @@
icon = 'icons/obj/items.dmi'
icon_state = "banana_peel"
item_state = "banana_peel"
- w_class = 2.0
+ w_class = 2
throwforce = 0
throw_speed = 4
throw_range = 20
@@ -143,7 +144,7 @@
icon = 'icons/obj/harvest.dmi'
icon_state = "sunflower"
item_state = "sunflower"
- w_class = 2.0
+ w_class = 2
throwforce = 0
throw_speed = 4
throw_range = 20
@@ -161,7 +162,7 @@
icon = 'icons/obj/harvest.dmi'
icon_state = "novaflower"
item_state = "sunflower"
- w_class = 2.0
+ w_class = 2
throwforce = 0
throw_speed = 4
throw_range = 20
@@ -170,8 +171,11 @@
to_chat(M, "[user] smacks you with a [name]!FLOWER POWER")
to_chat(user, " Your [name]'s FLOWER POWER strikes [M]")
if(istype(M, /mob/living))
- to_chat(M, "You are heated by the warmth of the of the [name]!")
- M.bodytemperature += potency/2 * TEMPERATURE_DAMAGE_COEFFICIENT
+ to_chat(M, "You are lit on fire from the intense heat of the [name]!")
+ M.adjust_fire_stacks(potency / 20)
+ if(M.IgniteMob())
+ message_admins("[key_name_admin(user)] set [key_name_admin(M)] on fire")
+ log_game("[key_name(user)] set [key_name(M)] on fire")
/obj/item/weapon/grown/novaflower/pickup(mob/living/carbon/human/user as mob)
if(!user.gloves)
diff --git a/code/modules/hydroponics/hydro_reagents.dm b/code/modules/hydroponics/hydro_reagents.dm
index 5e5cb819b98..db19d0832c9 100644
--- a/code/modules/hydroponics/hydro_reagents.dm
+++ b/code/modules/hydroponics/hydro_reagents.dm
@@ -5,7 +5,7 @@
flags = OPENCONTAINER | NOBLUDGEON
slot_flags = SLOT_BELT
throwforce = 4
- w_class = 2.0
+ w_class = 2
throw_speed = 2
throw_range = 10
var/toxicity = 4
@@ -93,7 +93,7 @@
icon_state = "bottle16"
flags = OPENCONTAINER
possible_transfer_amounts = null
- w_class = 2.0
+ w_class = 2
var/fertilizer //Reagent contained, if any.
diff --git a/code/modules/hydroponics/seed.dm b/code/modules/hydroponics/seed.dm
index 57ad87ecbbe..ec7a5aca25f 100644
--- a/code/modules/hydroponics/seed.dm
+++ b/code/modules/hydroponics/seed.dm
@@ -376,6 +376,7 @@
// Bluespace tomato code copied over from grown.dm.
if(get_trait(TRAIT_TELEPORTING))
+ // TODO: Tie into space manager
if(target.z in config.admin_levels)
return 1
@@ -828,4 +829,4 @@
display_name = "modified [base_name]"
if(2) //Enhanced
seed_name = "enhanced [base_name]"
- display_name = "enhanced [base_name]"
\ No newline at end of file
+ display_name = "enhanced [base_name]"
diff --git a/code/modules/hydroponics/seed_controller.dm b/code/modules/hydroponics/seed_controller.dm
index 5ba2b4dcfb3..aaa30c3275f 100644
--- a/code/modules/hydroponics/seed_controller.dm
+++ b/code/modules/hydroponics/seed_controller.dm
@@ -37,11 +37,15 @@ var/global/datum/controller/plants/plant_controller // Set in New().
/datum/controller/plants/New()
if(plant_controller && plant_controller != src)
log_debug("Rebuilding plant controller.")
- del(plant_controller)
+ qdel(plant_controller)
plant_controller = src
setup()
process()
+/datum/controller/plants/Destroy()
+ ..()
+ return QDEL_HINT_HARDDEL_NOW
+
// Predefined/roundstart varieties use a string key to make it
// easier to grab the new variety when mutating. Post-roundstart
// and mutant varieties use their uid converted to a string instead.
diff --git a/code/modules/hydroponics/seed_datums.dm b/code/modules/hydroponics/seed_datums.dm
index a028fa66727..7d646b23cc3 100644
--- a/code/modules/hydroponics/seed_datums.dm
+++ b/code/modules/hydroponics/seed_datums.dm
@@ -825,6 +825,7 @@
display_name = "grapevines"
mutants = list("greengrapes")
chems = list("plantmatter" = list(1,10), "sugar" = list(1,5))
+ kitchen_tag = "grapes"
preset_icon = "grapes"
/datum/seed/grapes/New()
@@ -1089,6 +1090,7 @@
seed_name = "sugarcane"
display_name = "sugarcanes"
chems = list("sugar" = list(4,5))
+ kitchen_tag = "sugarcane"
preset_icon = "sugarcane"
/datum/seed/sugarcane/New()
diff --git a/code/modules/hydroponics/seed_machines.dm b/code/modules/hydroponics/seed_machines.dm
index 6e94201c75c..42323841094 100644
--- a/code/modules/hydroponics/seed_machines.dm
+++ b/code/modules/hydroponics/seed_machines.dm
@@ -3,7 +3,7 @@
desc = "A small disk used for carrying data on plant genetics."
icon = 'icons/obj/hydroponics_machines.dmi'
icon_state = "disk"
- w_class = 1.0
+ w_class = 1
var/list/genes = list()
var/genesource = "unknown"
@@ -68,15 +68,15 @@
active = 0
if(failed_task)
failed_task = 0
- visible_message("\icon[src] [src] pings unhappily, flashing a red warning light.")
+ visible_message("[bicon(src)] [src] pings unhappily, flashing a red warning light.")
else
- visible_message("\icon[src] [src] pings happily.")
+ visible_message("[bicon(src)] [src] pings happily.")
if(eject_disk)
eject_disk = 0
if(loaded_disk)
loaded_disk.loc = get_turf(src)
- visible_message("\icon[src] [src] beeps and spits out [loaded_disk].")
+ visible_message("[bicon(src)] [src] beeps and spits out [loaded_disk].")
loaded_disk = null
/obj/machinery/botany/attackby(obj/item/weapon/W as obj, mob/user as mob)
@@ -151,7 +151,7 @@
/obj/machinery/botany/extractor/RefreshParts()
var/tier = 1
- for (var/obj/item/weapon/stock_parts/scanning_module/S in component_parts)
+ for(var/obj/item/weapon/stock_parts/scanning_module/S in component_parts)
tier = S.rating
degrade_lower = 25 - (tier * 5) //Tier 1: 20, Tier 4: 5
degrade_upper = 70 - (tier * 10) //Tier 1: 60, Tier 4: 30
@@ -191,7 +191,7 @@
data["sourceName"] = 0
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, "botany_isolator.tmpl", "Lysis-isolation Centrifuge UI", 470, 450)
ui.set_initial_data(data)
ui.open()
@@ -212,14 +212,14 @@
plant_controller.seeds[seed.seed.name] = seed.seed
seed.update_seed()
- visible_message("\icon[src] [src] beeps and spits out [seed].")
+ visible_message("[bicon(src)] [src] beeps and spits out [seed].")
seed = null
if(href_list["eject_disk"])
if(!loaded_disk) return
loaded_disk.loc = get_turf(src)
- visible_message("\icon[src] [src] beeps and spits out [loaded_disk].")
+ visible_message("[bicon(src)] [src] beeps and spits out [loaded_disk].")
loaded_disk = null
usr.set_machine(src)
@@ -302,7 +302,7 @@
/obj/machinery/botany/editor/RefreshParts()
var/tier = 1
- for (var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
+ for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
tier = M.rating
degrade_lower = 6 - tier //Tier 1: 5, Tier 4: 1
degrade_upper = 11 - tier //Tier 1: 10, Tier 4: 6
@@ -341,7 +341,7 @@
data["loaded"] = 0
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, "botany_editor.tmpl", "Bioballistic Delivery UI", 470, 450)
ui.set_initial_data(data)
ui.open()
diff --git a/code/modules/hydroponics/seed_packets.dm b/code/modules/hydroponics/seed_packets.dm
index c97238b490d..244b9fef8f3 100644
--- a/code/modules/hydroponics/seed_packets.dm
+++ b/code/modules/hydroponics/seed_packets.dm
@@ -5,8 +5,8 @@ var/global/list/plant_seed_sprites = list()
name = "packet of seeds"
icon = 'icons/obj/seeds.dmi'
icon_state = "blank"
- w_class = 2.0
-
+ w_class = 2
+ burn_state = FLAMMABLE
var/seed_type
var/datum/seed/seed
var/modified = 0
diff --git a/code/modules/hydroponics/seed_storage.dm b/code/modules/hydroponics/seed_storage.dm
index fe905595677..fa5b8e311f3 100644
--- a/code/modules/hydroponics/seed_storage.dm
+++ b/code/modules/hydroponics/seed_storage.dm
@@ -13,7 +13,7 @@
src.ID = ID
/datum/seed_pile/proc/matches(var/obj/item/seeds/O)
- if (O.seed == seed_type)
+ if(O.seed == seed_type)
return 1
return 0
@@ -52,52 +52,52 @@
interact(user)
/obj/machinery/seed_storage/interact(mob/user as mob)
- if (..())
+ if(..())
return
- if (!initialized)
+ if(!initialized)
for(var/typepath in starting_seeds)
var/amount = starting_seeds[typepath]
if(isnull(amount)) amount = 1
- for (var/i = 1 to amount)
+ for(var/i = 1 to amount)
var/O = new typepath
add(O)
initialized = 1
var/dat = "
Seed storage contents
"
- if (piles.len == 0)
+ if(piles.len == 0)
dat += "No seeds"
else
dat += "
Name
"
dat += "
Variety
"
- if ("stats" in scanner)
+ if("stats" in scanner)
dat += "
E
Y
M
Pr
Pt
Harvest
"
- if ("temperature" in scanner)
+ if("temperature" in scanner)
dat += "
Temp
"
- if ("light" in scanner)
+ if("light" in scanner)
dat += "
Light
"
- if ("soil" in scanner)
+ if("soil" in scanner)
dat += "
Nutri
Water
"
dat += "
Notes
Amount
"
- for (var/datum/seed_pile/S in piles)
+ for(var/datum/seed_pile/S in piles)
var/datum/seed/seed = S.seed_type
if(!seed)
continue
dat += "
"
dat += "
[seed.seed_name]
"
dat += "
#[seed.uid]
"
- if ("stats" in scanner)
+ if("stats" in scanner)
dat += "
[seed.get_trait(TRAIT_ENDURANCE)]
[seed.get_trait(TRAIT_YIELD)]
[seed.get_trait(TRAIT_MATURATION)]
[seed.get_trait(TRAIT_PRODUCTION)]
[seed.get_trait(TRAIT_POTENCY)]
"
if(seed.get_trait(TRAIT_HARVEST_REPEAT))
dat += "
Multiple
"
else
dat += "
Single
"
- if ("temperature" in scanner)
+ if("temperature" in scanner)
dat += "
[seed.get_trait(TRAIT_IDEAL_HEAT)] K
"
- if ("light" in scanner)
+ if("light" in scanner)
dat += "
[seed.get_trait(TRAIT_IDEAL_LIGHT)] L
"
- if ("soil" in scanner)
+ if("soil" in scanner)
if(seed.get_trait(TRAIT_REQUIRES_NUTRIENTS))
if(seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) < 0.05)
dat += "
Low
"
@@ -128,17 +128,17 @@
dat += "VINE "
if(2)
dat += "VINE "
- if ("pressure" in scanner)
+ if("pressure" in scanner)
if(seed.get_trait(TRAIT_LOWKPA_TOLERANCE) < 20)
dat += "LP "
if(seed.get_trait(TRAIT_HIGHKPA_TOLERANCE) > 220)
dat += "HP "
- if ("temperature" in scanner)
+ if("temperature" in scanner)
if(seed.get_trait(TRAIT_HEAT_TOLERANCE) > 30)
dat += "TEMRES "
else if(seed.get_trait(TRAIT_HEAT_TOLERANCE) < 10)
dat += "TEMSEN "
- if ("light" in scanner)
+ if("light" in scanner)
if(seed.get_trait(TRAIT_LIGHT_TOLERANCE) > 10)
dat += "LIGRES "
else if(seed.get_trait(TRAIT_LIGHT_TOLERANCE) < 3)
@@ -157,7 +157,7 @@
dat += "WEEDRES "
if(seed.get_trait(TRAIT_PARASITE))
dat += "PAR "
- if ("temperature" in scanner)
+ if("temperature" in scanner)
if(seed.get_trait(TRAIT_ALTER_TEMP) > 0)
dat += "TEMP+ "
if(seed.get_trait(TRAIT_ALTER_TEMP) < 0)
@@ -174,27 +174,27 @@
onclose(user, "seedstorage")
/obj/machinery/seed_storage/Topic(var/href, var/list/href_list)
- if (..())
+ if(..())
return
var/task = href_list["task"]
var/ID = text2num(href_list["id"])
- for (var/datum/seed_pile/N in piles)
- if (N.ID == ID)
- if (task == "vend")
+ for(var/datum/seed_pile/N in piles)
+ if(N.ID == ID)
+ if(task == "vend")
var/obj/O = pick(N.seeds)
- if (O)
+ if(O)
--N.amount
N.seeds -= O
- if (N.amount <= 0 || N.seeds.len <= 0)
+ if(N.amount <= 0 || N.seeds.len <= 0)
piles -= N
qdel(N)
O.loc = src.loc
else
piles -= N
qdel(N)
- else if (task == "purge")
- for (var/obj/O in N.seeds)
+ else if(task == "purge")
+ for(var/obj/O in N.seeds)
qdel(O)
piles -= N
qdel(N)
@@ -202,17 +202,17 @@
updateUsrDialog()
/obj/machinery/seed_storage/attackby(var/obj/item/O as obj, var/mob/user as mob)
- if (istype(O, /obj/item/seeds))
+ if(istype(O, /obj/item/seeds))
add(O)
user.visible_message("[user] puts \the [O.name] into \the [src].", "You put \the [O] into \the [src].")
return
- else if (istype(O, /obj/item/weapon/storage/bag/plants))
+ else if(istype(O, /obj/item/weapon/storage/bag/plants))
var/obj/item/weapon/storage/P = O
var/loaded = 0
for(var/obj/item/seeds/G in P.contents)
++loaded
add(G)
- if (loaded)
+ if(loaded)
user.visible_message("[user] puts the seeds from \the [O.name] into \the [src].", "You put the seeds from \the [O.name] into \the [src].")
else
to_chat(user, "There are no seeds in \the [O.name].")
@@ -223,7 +223,7 @@
to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].")
/obj/machinery/seed_storage/proc/add(var/obj/item/seeds/O as obj)
- if (istype(O.loc, /mob))
+ if(istype(O.loc, /mob))
var/mob/user = O.loc
user.drop_item(O)
else if(istype(O.loc,/obj/item/weapon/storage))
@@ -233,8 +233,8 @@
O.loc = src
var/newID = 0
- for (var/datum/seed_pile/N in piles)
- if (N.matches(O))
+ for(var/datum/seed_pile/N in piles)
+ if(N.matches(O))
++N.amount
N.seeds += (O)
return
diff --git a/code/modules/hydroponics/spreading/spreading.dm b/code/modules/hydroponics/spreading/spreading.dm
index c26d5b98bad..21dc0dad4af 100644
--- a/code/modules/hydroponics/spreading/spreading.dm
+++ b/code/modules/hydroponics/spreading/spreading.dm
@@ -259,11 +259,11 @@
die_off()
return
if(2.0)
- if (prob(50))
+ if(prob(50))
die_off()
return
if(3.0)
- if (prob(5))
+ if(prob(5))
die_off()
return
else
diff --git a/code/modules/hydroponics/trays/tray.dm b/code/modules/hydroponics/trays/tray.dm
index 74a8d7824dc..e9c63ed8794 100644
--- a/code/modules/hydroponics/trays/tray.dm
+++ b/code/modules/hydroponics/trays/tray.dm
@@ -7,6 +7,8 @@
flags = OPENCONTAINER
volume = 100
+ hud_possible = list (PLANT_NUTRIENT_HUD, PLANT_WATER_HUD, PLANT_STATUS_HUD, PLANT_HEALTH_HUD, PLANT_TOXIN_HUD, PLANT_PEST_HUD, PLANT_WEED_HUD)
+
var/mechanical = 1 // Set to 0 to stop it from drawing the alert lights.
var/base_name = "tray"
@@ -73,10 +75,12 @@
if(weedlevel > 0)
nymph.reagents.add_reagent("nutriment", weedlevel)
weedlevel = 0
+ plant_hud_set_weed()
nymph.visible_message("[nymph] begins rooting through [src], ripping out weeds and eating them noisily.","You begin rooting through [src], ripping out weeds and eating them noisily.")
else if(nymph.nutrition > 100 && nutrilevel < 10)
nymph.nutrition -= ((10-nutrilevel)*5)
nutrilevel = 10
+ plant_hud_set_nutrient()
nymph.visible_message("[nymph] secretes a trickle of green liquid, refilling [src].","You secrete a trickle of green liquid, refilling [src].")
else
nymph.visible_message("[nymph] rolls around in [src] for a bit.","You roll around in [src] for a bit.")
@@ -85,6 +89,17 @@
/obj/machinery/portable_atmospherics/hydroponics/New()
..()
+ var/datum/atom_hud/data/hydroponic/hydro_hud = huds[DATA_HUD_HYDROPONIC]
+ prepare_huds()
+ hydro_hud.add_to_hud(src)
+ plant_hud_set_nutrient()
+ plant_hud_set_water()
+ plant_hud_set_status()
+ plant_hud_set_health()
+ plant_hud_set_toxin()
+ plant_hud_set_pest()
+ plant_hud_set_weed()
+
component_parts = list()
component_parts += new /obj/item/weapon/circuitboard/hydroponics(null)
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
@@ -101,6 +116,7 @@
if(closed_system)
flags &= ~OPENCONTAINER
+
/obj/machinery/portable_atmospherics/hydroponics/upgraded/New()
..()
component_parts = list()
@@ -112,12 +128,14 @@
/obj/machinery/portable_atmospherics/hydroponics/RefreshParts()
var/tmp_capacity = 0
- for (var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
+ for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
tmp_capacity += M.rating
maxwater = tmp_capacity * 50 // Up to 300
maxnutri = tmp_capacity * 5 // Up to 30
//waterlevel = maxwater
//nutrilevel = 3
+ plant_hud_set_nutrient()
+ plant_hud_set_water()
/obj/machinery/portable_atmospherics/hydroponics/bullet_act(var/obj/item/projectile/Proj)
@@ -150,12 +168,18 @@
die()
check_level_sanity()
update_icon()
+ plant_hud_set_status()
+ plant_hud_set_health()
/obj/machinery/portable_atmospherics/hydroponics/proc/die()
dead = 1
harvest = 0
weedlevel += 1 * HYDRO_SPEED_MULTIPLIER
pestlevel = 0
+ plant_hud_set_status()
+ plant_hud_set_health()
+ plant_hud_set_weed()
+ plant_hud_set_pest()
//Harvests the product of a plant.
/obj/machinery/portable_atmospherics/hydroponics/proc/harvest(var/mob/user)
@@ -233,6 +257,9 @@
pestlevel = 0
sampled = 0
update_icon()
+ plant_hud_set_weed()
+ plant_hud_set_status()
+ plant_hud_set_health()
visible_message("[src] has been overtaken by [seed.display_name].")
return
@@ -391,6 +418,14 @@
toxins = max(0,min(toxins,10))
yield_mod = min(100, yield_mod)
+ plant_hud_set_nutrient()
+ plant_hud_set_water()
+ plant_hud_set_status()
+ plant_hud_set_health()
+ plant_hud_set_toxin()
+ plant_hud_set_pest()
+ plant_hud_set_weed()
+
/obj/machinery/portable_atmospherics/hydroponics/proc/mutate_species()
var/previous_plant = seed.display_name
@@ -409,6 +444,9 @@
harvest = 0
weedlevel = 0
+ plant_hud_set_health()
+ plant_hud_set_weed()
+
update_icon()
visible_message("\red The \blue [previous_plant] \red has suddenly mutated into \blue [seed.display_name]!")
@@ -427,7 +465,7 @@
//--FalseIncarnate
//Check if held item is an open container
- if (O.is_open_container())
+ if(O.is_open_container())
//Check if container is of the "glass" subtype (includes buckets, beakers, vials)
if(istype(O, /obj/item/weapon/reagent_containers/glass))
var/obj/item/weapon/reagent_containers/glass/C = O
@@ -471,7 +509,7 @@
update_icon()
//Check if container is any spray container
- else if (istype(O, /obj/item/weapon/reagent_containers/spray))
+ else if(istype(O, /obj/item/weapon/reagent_containers/spray))
var/obj/item/weapon/reagent_containers/spray/S = O
//Check if there is a plant in the tray
if(seed)
@@ -537,7 +575,7 @@
var/obj/item/weapon/reagent_containers/syringe/S = O
- if (S.mode == 1)
+ if(S.mode == 1)
if(seed)
return ..()
else
@@ -551,7 +589,7 @@
to_chat(user, "There's nothing to draw something from.")
return 1
- else if (istype(O, /obj/item/seeds))
+ else if(istype(O, /obj/item/seeds))
if(!seed)
@@ -579,21 +617,22 @@
else
to_chat(user, "\The [src] already has seeds in it!")
- else if (istype(O, /obj/item/weapon/minihoe)) // The minihoe
+ else if(istype(O, /obj/item/weapon/minihoe)) // The minihoe
if(weedlevel > 0)
user.visible_message("[user] starts uprooting the weeds.", "You remove the weeds from the [src].")
weedlevel = 0
update_icon()
+ plant_hud_set_weed()
else
to_chat(user, "This plot is completely devoid of weeds. It doesn't need uprooting.")
- else if (istype(O, /obj/item/weapon/storage/bag/plants))
+ else if(istype(O, /obj/item/weapon/storage/bag/plants))
attack_hand(user)
var/obj/item/weapon/storage/bag/plants/S = O
- for (var/obj/item/weapon/reagent_containers/food/snacks/grown/G in locate(user.x,user.y,user.z))
+ for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in locate(user.x,user.y,user.z))
if(!S.can_be_inserted(G))
return
S.handle_item_insertion(G, 1)
@@ -608,8 +647,8 @@
anchored = !anchored
to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].")
- else if ((istype(O, /obj/item/weapon/tank) && !( src.destroyed )))
- if (src.holding)
+ else if((istype(O, /obj/item/weapon/tank) && !( src.destroyed )))
+ if(src.holding)
to_chat(user, "\blue There is alreadu a tank loaded into the [src].")
return
var/obj/item/weapon/tank/T = O
diff --git a/code/modules/hydroponics/trays/tray_apiary.dm b/code/modules/hydroponics/trays/tray_apiary.dm
index 25a2698d274..9ecf2bcb2fc 100644
--- a/code/modules/hydroponics/trays/tray_apiary.dm
+++ b/code/modules/hydroponics/trays/tray_apiary.dm
@@ -36,7 +36,7 @@
if(!yieldmod)
yieldmod += 1
// to_chat(world, "Yield increased by 1, from 0, to a total of [myseed.yield]")
- else if (prob(1/(yieldmod * yieldmod) *100))//This formula gives you diminishing returns based on yield. 100% with 1 yield, decreasing to 25%, 11%, 6, 4, 2...
+ else if(prob(1/(yieldmod * yieldmod) *100))//This formula gives you diminishing returns based on yield. 100% with 1 yield, decreasing to 25%, 11%, 6, 4, 2...
yieldmod += 1
// to_chat(world, "Yield increased by 1, to a total of [myseed.yield]")
else
diff --git a/code/modules/hydroponics/trays/tray_process.dm b/code/modules/hydroponics/trays/tray_process.dm
index 855d053008c..03568731dc5 100644
--- a/code/modules/hydroponics/trays/tray_process.dm
+++ b/code/modules/hydroponics/trays/tray_process.dm
@@ -21,10 +21,11 @@
// Bonus chance if the tray is unoccupied.
if(waterlevel > 10 && nutrilevel > 2 && prob(isnull(seed) ? 6 : 3))
weedlevel += 1 * HYDRO_SPEED_MULTIPLIER
+ plant_hud_set_weed()
// There's a chance for a weed explosion to happen if the weeds take over.
// Plants that are themselves weeds (weed_tolerance > 10) are unaffected.
- if (weedlevel >= 10 && prob(10))
+ if(weedlevel >= 10 && prob(10))
if(!seed || weedlevel >= seed.get_trait(TRAIT_WEED_TOLERANCE))
weed_invasion()
@@ -48,8 +49,10 @@
// Maintain tray nutrient and water levels.
if(seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) > 0 && nutrilevel > 0 && prob(25))
nutrilevel -= max(0,seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) * HYDRO_SPEED_MULTIPLIER)
+ plant_hud_set_nutrient()
if(seed.get_trait(TRAIT_WATER_CONSUMPTION) > 0 && waterlevel > 0 && prob(25))
waterlevel -= max(0,seed.get_trait(TRAIT_WATER_CONSUMPTION) * HYDRO_SPEED_MULTIPLIER)
+ plant_hud_set_water()
// Make sure the plant is not starving or thirsty. Adequate
// water and nutrients will cause a plant to become healthier.
@@ -81,7 +84,7 @@
T.air_update_turf()
// If we're attached to a pipenet, then we should let the pipenet know we might have modified some gasses
- if (closed_system && connected_port)
+ if(closed_system && connected_port)
connected_port.parent.update = 1
// Toxin levels beyond the plant's tolerance cause damage, but
@@ -91,6 +94,7 @@
if(toxins > seed.get_trait(TRAIT_TOXINS_TOLERANCE))
health -= toxin_uptake
toxins -= toxin_uptake
+ plant_hud_set_toxin()
// Check for pests and weeds.
// Some carnivorous plants happily eat pests.
@@ -98,16 +102,18 @@
if(seed.get_trait(TRAIT_CARNIVOROUS))
health += HYDRO_SPEED_MULTIPLIER
pestlevel -= HYDRO_SPEED_MULTIPLIER
- else if (pestlevel >= seed.get_trait(TRAIT_PEST_TOLERANCE))
+ else if(pestlevel >= seed.get_trait(TRAIT_PEST_TOLERANCE))
health -= HYDRO_SPEED_MULTIPLIER
+ plant_hud_set_pest()
// Some plants thrive and live off of weeds.
if(weedlevel > 0)
if(seed.get_trait(TRAIT_PARASITE))
health += HYDRO_SPEED_MULTIPLIER
weedlevel -= HYDRO_SPEED_MULTIPLIER
- else if (weedlevel >= seed.get_trait(TRAIT_WEED_TOLERANCE))
+ else if(weedlevel >= seed.get_trait(TRAIT_WEED_TOLERANCE))
health -= HYDRO_SPEED_MULTIPLIER
+ plant_hud_set_weed()
// Handle life and death.
// If the plant gets too old, begin killing it each cycle
diff --git a/code/modules/hydroponics/trays/tray_reagents.dm b/code/modules/hydroponics/trays/tray_reagents.dm
index 8f7e4f5e836..e4f68e6d106 100644
--- a/code/modules/hydroponics/trays/tray_reagents.dm
+++ b/code/modules/hydroponics/trays/tray_reagents.dm
@@ -11,7 +11,7 @@
var/reagent_total = reagents.get_reagent_amount(R.id)
- //These are here because they have checks that would clutter up the switch statement cases, and thus get handled after the switch (readability)
+ //These are here because they have checks that would clutter up the switch statement cases, and thus get handled after the switch(readability)
var/water_value = 0
var/health_value = 0
var/production_stat_value = 0
diff --git a/code/modules/hydroponics/trays/tray_tools.dm b/code/modules/hydroponics/trays/tray_tools.dm
index 1dea731ff54..b1ee10cc075 100644
--- a/code/modules/hydroponics/trays/tray_tools.dm
+++ b/code/modules/hydroponics/trays/tray_tools.dm
@@ -313,7 +313,8 @@
throw_range = 3
w_class = 4
var/extend = 1
- flags = NOSHIELD | CONDUCT
+ flags = CONDUCT
+ armour_penetration = 20
slot_flags = SLOT_BACK
origin_tech = "materials=2;combat=2"
attack_verb = list("chopped", "sliced", "cut", "reaped")
@@ -336,9 +337,9 @@
edge = 0
throw_speed = 2
throw_range = 3
- w_class = 2.0
+ w_class = 2
extend = 0
- flags = NOSHIELD
+ armour_penetration = 20
slot_flags = SLOT_BELT
origin_tech = "materials=3;combat=3"
attack_verb = list("chopped", "sliced", "cut", "reaped")
@@ -373,7 +374,7 @@
H.update_inv_l_hand()
H.update_inv_r_hand()
add_fingerprint(user)
- if (!blood_DNA) return
+ if(!blood_DNA) return
if(blood_overlay && (blood_DNA.len >= 1)) //updates blood overlay, if any
overlays.Cut()//this might delete other item overlays as well but eeeeeeeh
@@ -396,7 +397,7 @@
anchored = 0.0
var/matter = 0
var/mode = 1
- w_class = 3.0
+ w_class = 3
/obj/item/weapon/bananapeel
name = "banana peel"
@@ -404,7 +405,7 @@
icon = 'icons/obj/items.dmi'
icon_state = "banana_peel"
item_state = "banana_peel"
- w_class = 1.0
+ w_class = 1
throwforce = 0
throw_speed = 4
throw_range = 20
@@ -415,7 +416,7 @@
icon = 'icons/obj/harvest.dmi'
icon_state = "corncob"
item_state = "corncob"
- w_class = 1.0
+ w_class = 1
throwforce = 0
throw_speed = 4
throw_range = 20
diff --git a/code/modules/karma/karma.dm b/code/modules/karma/karma.dm
index 9c40f005a21..fa765fd244b 100644
--- a/code/modules/karma/karma.dm
+++ b/code/modules/karma/karma.dm
@@ -182,7 +182,7 @@ You've gained [totalkarma] total karma in your time here. "}
dat += ""
switch(karma_tab)
- if (0) // Job Unlocks
+ if(0) // Job Unlocks
dat += {"
Unlock Barber -- 5KP Unlock Brig Physician -- 5KP
@@ -193,7 +193,7 @@ You've gained [totalkarma] total karma in your time here. "}
Unlock Magistrate -- 45KP
"}
- if (1) // Species Unlocks
+ if(1) // Species Unlocks
dat += {"
Unlock Machine People -- 15KP Unlock Kidan -- 30KP
@@ -204,7 +204,7 @@ You've gained [totalkarma] total karma in your time here. "}
Unlock Plasmaman -- 100KP
"}
- if (2) // Karma Refunds
+ if(2) // Karma Refunds
var/list/refundable = list()
var/list/purchased = checkpurchased()
if("Tajaran Ambassador" in purchased)
diff --git a/code/modules/library/computers/base.dm b/code/modules/library/computers/base.dm
index b24c7e7dbbf..360cda83d74 100644
--- a/code/modules/library/computers/base.dm
+++ b/code/modules/library/computers/base.dm
@@ -19,8 +19,8 @@
if(stat & (BROKEN | NOPOWER))
return 1
- if (!Adjacent(user))
- if (!issilicon(user) && !isobserver(user))
+ if(!Adjacent(user))
+ if(!issilicon(user) && !isobserver(user))
user.unset_machine()
user << browse(null, "window=library")
return 1
diff --git a/code/modules/library/computers/checkout.dm b/code/modules/library/computers/checkout.dm
index 2746aed857e..139b464cf76 100644
--- a/code/modules/library/computers/checkout.dm
+++ b/code/modules/library/computers/checkout.dm
@@ -126,7 +126,7 @@
var/author = CB.author
var/controls = "\[Order\]"
controls += {" \[Flag[CB.flagged ? "ged" : ""]\]"}
- if(check_rights(R_ADMIN, user = user))
+ if(check_rights(R_ADMIN, 0, user = user))
controls += " \[Delete\]"
author += " ([ckey(CB.ckey)]))"
dat += {"
@@ -255,7 +255,6 @@
screenstate = 4
if(href_list["del"])
if(!check_rights(R_ADMIN))
- to_chat(usr, "You aren't an admin, piss off.")
return
var/datum/cachedbook/target = getBookByID(href_list["del"]) // Sanitized in getBookByID
var/ans = alert(usr, "Are you sure you wish to delete \"[target.title]\", by [target.author]? This cannot be undone.", "Library System", "Yes", "No")
@@ -272,7 +271,6 @@
if(href_list["delbyckey"])
if(!check_rights(R_ADMIN))
- to_chat(usr, "You aren't an admin, piss off.")
return
var/tckey = ckey(href_list["delbyckey"])
var/ans = alert(usr,"Are you sure you wish to delete all books by [tckey]? This cannot be undone.", "Library System", "Yes", "No")
@@ -435,7 +433,7 @@
return
if(bibledelay)
- for (var/mob/V in hearers(src))
+ for(var/mob/V in hearers(src))
V.show_message("[src]'s monitor flashes, \"Printer unavailable. Please allow a short time before attempting to print.\"")
else
bibledelay = 1
@@ -456,7 +454,7 @@
return
var/obj/item/weapon/book/B = new newbook.path(loc)
- if (!newbook.programmatic)
+ if(!newbook.programmatic)
B.name = "Book: [newbook.title]"
B.title = newbook.title
B.author = newbook.author
diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm
index f7729af3578..d4ccee6e50f 100644
--- a/code/modules/library/lib_items.dm
+++ b/code/modules/library/lib_items.dm
@@ -18,27 +18,36 @@
anchored = 1
density = 1
opacity = 1
+ burn_state = FLAMMABLE
+ burntime = 30
var/health = 50
var/tmp/busy = 0
- var/list/valid_types = list(/obj/item/weapon/book, \
- /obj/item/weapon/tome, \
- /obj/item/weapon/spellbook, \
- /obj/item/weapon/storage/bible)
+ var/list/allowed_books = list(/obj/item/weapon/book, /obj/item/weapon/spellbook, /obj/item/weapon/storage/bible, /obj/item/weapon/tome) //Things allowed in the bookcase
/obj/structure/bookcase/initialize()
+ ..()
for(var/obj/item/I in loc)
- if(is_type_in_list(I, valid_types))
+ if(is_type_in_list(I, allowed_books))
I.forceMove(src)
update_icon()
/obj/structure/bookcase/attackby(obj/O as obj, mob/user as mob, params)
if(busy) //So that you can't mess with it while deconstructing
return 1
- if(is_type_in_list(O, valid_types))
- user.drop_item()
+ if(is_type_in_list(O, allowed_books))
+ if(!user.drop_item())
+ return
O.forceMove(src)
update_icon()
return 1
+ else if(istype(O, /obj/item/weapon/storage/bag/books))
+ var/obj/item/weapon/storage/bag/books/B = O
+ for(var/obj/item/T in B.contents)
+ if(istype(T, /obj/item/weapon/book) || istype(T, /obj/item/weapon/spellbook) || istype(T, /obj/item/weapon/tome) || istype(T, /obj/item/weapon/storage/bible))
+ B.remove_from_storage(T, src)
+ to_chat(user, "You empty [O] into [src].")
+ update_icon()
+ return 1
else if(istype(O, /obj/item/weapon/wrench))
user.visible_message("[user] starts disassembling \the [src].", \
"You start disassembling \the [src].")
@@ -50,8 +59,6 @@
user.visible_message("[user] disassembles \the [src].", \
"You disassemble \the [src].")
busy = 0
- for(var/i = 1 to 5)
- new /obj/item/stack/sheet/wood(get_turf(src))
density = 0
qdel(src)
else
@@ -69,11 +76,8 @@
if("brute")
health -= O.force * 0.75
else
- if (health <= 0)
+ if(health <= 0)
visible_message("The bookcase is smashed apart!")
- new /obj/item/stack/sheet/wood(get_turf(src))
- new /obj/item/stack/sheet/wood(get_turf(src))
- new /obj/item/stack/sheet/wood(get_turf(src))
qdel(src)
return ..()
@@ -109,10 +113,10 @@
return
/obj/structure/bookcase/Destroy()
- for(var/i = 1 to 3)
+ for(var/i in 1 to 5)
new /obj/item/stack/sheet/wood(get_turf(src))
for(var/obj/item/I in contents)
- if(is_type_in_list(I, valid_types))
+ if(is_type_in_list(I, allowed_books))
I.forceMove(get_turf(src))
return ..()
@@ -165,6 +169,7 @@
throw_range = 5
w_class = 3 //upped to three because books are, y'know, pretty big. (and you could hide them inside eachother recursively forever)
attack_verb = list("bashed", "whacked", "educated")
+ burn_state = FLAMMABLE
var/dat // Actual page content
var/due_date = 0 // Game time in 1/10th seconds
@@ -288,7 +293,7 @@
icon_state ="scanner"
throw_speed = 1
throw_range = 5
- w_class = 1.0
+ w_class = 1
var/obj/machinery/computer/library/checkout/computer // Associated computer - Modes 1 to 3 use this
var/obj/item/weapon/book/book // Currently scanned book
var/mode = 0 // 0 - Scan only, 1 - Scan and Set Buffer, 2 - Scan and Attempt to Check In, 3 - Scan and Attempt to Add to Inventory
diff --git a/code/modules/lighting/lighting_overlay.dm b/code/modules/lighting/lighting_overlay.dm
index f2dede3b8ba..525de63a0af 100644
--- a/code/modules/lighting/lighting_overlay.dm
+++ b/code/modules/lighting/lighting_overlay.dm
@@ -9,6 +9,7 @@
invisibility = INVISIBILITY_LIGHTING
color = "#000000"
icon_state = "light1"
+ auto_init = 0 // doesn't need special init
var/lum_r
var/lum_g
@@ -104,4 +105,4 @@
if(istype(T))
T.lighting_overlay = null
- return ..()
\ No newline at end of file
+ return ..()
diff --git a/code/modules/martial_arts/martial.dm b/code/modules/martial_arts/martial.dm
index d128e22c0f6..0ca98c921d8 100644
--- a/code/modules/martial_arts/martial.dm
+++ b/code/modules/martial_arts/martial.dm
@@ -181,7 +181,7 @@
attack_verb = list("smashed", "slammed", "whacked", "thwacked")
icon = 'icons/obj/weapons.dmi'
icon_state = "bostaff0"
-
+ block_chance = 50
/obj/item/weapon/twohanded/bostaff/update_icon()
icon_state = "bostaff[wielded]"
@@ -239,8 +239,7 @@
return ..()
return ..()
-/obj/item/weapon/twohanded/bostaff/IsShield()
+/obj/item/weapon/twohanded/bostaff/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance)
if(wielded)
- return 1
- else
- return 0
\ No newline at end of file
+ return ..()
+ return 0
\ No newline at end of file
diff --git a/code/modules/martial_arts/sleeping_carp.dm b/code/modules/martial_arts/sleeping_carp.dm
index 3202f8fbe27..bc4e15eb598 100644
--- a/code/modules/martial_arts/sleeping_carp.dm
+++ b/code/modules/martial_arts/sleeping_carp.dm
@@ -38,6 +38,8 @@
D.visible_message("[A] grabs [D]'s wrist and wrenches it sideways!", \
"[A] grabs your wrist and violently wrenches it to the side!")
playsound(get_turf(A), 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
+ if(prob(60))
+ A.say(pick("WRISTY TWIRLY!", "WE FIGHT LIKE MEN!", "YOU DISHONOR YOURSELF!", "POHYAH!", "WHERE IS YOUR BATON NOW?", "SAY UNCLE!"))
D.emote("scream")
D.drop_item()
D.apply_damage(5, BRUTE, pick("l_arm", "r_arm"))
@@ -53,6 +55,8 @@
step_to(D,get_step(D,D.dir),1)
D.Weaken(4)
playsound(get_turf(D), 'sound/weapons/punch1.ogg', 50, 1, -1)
+ if(prob(80))
+ A.say(pick("SURRPRIZU!","BACK STRIKE!","WOPAH!", "WATAAH", "ZOTA!", "Never turn your back to the enemy!"))
return 1
return basic_hit(A,D)
@@ -65,6 +69,8 @@
D.losebreath += 3
D.Stun(2)
playsound(get_turf(D), 'sound/weapons/punch1.ogg', 50, 1, -1)
+ if(prob(80))
+ A.say(pick("HWOP!", "KUH!", "YAKUUH!", "KYUH!", "KNEESTRIKE!"))
return 1
return basic_hit(A,D)
@@ -76,6 +82,8 @@
D.apply_damage(20, BRUTE, "head")
D.drop_item()
playsound(get_turf(D), 'sound/weapons/punch1.ogg', 50, 1, -1)
+ if(prob(60))
+ A.say(pick("OOHYOO!", "OOPYAH!", "HYOOAA!", "WOOAAA!", "SHURYUKICK!", "HIYAH!"))
D.Stun(4)
return 1
return basic_hit(A,D)
@@ -89,6 +97,8 @@
D.death() //FINISH HIM!
D.apply_damage(50, BRUTE, "chest")
playsound(get_turf(D), 'sound/weapons/punch1.ogg', 75, 1, -1)
+ if(prob(80))
+ A.say(pick("BANZAIII!", "KIYAAAA!", "OMAE WA MOU SHINDEIRU!", "YOU CAN'T SEE ME!", "MY TIME IS NOW!", "COWABUNGA"))
return 1
return basic_hit(A,D)
@@ -111,6 +121,8 @@
"[A] [atk_verb] you!")
D.apply_damage(rand(10,15), BRUTE)
playsound(get_turf(D), 'sound/weapons/punch1.ogg', 25, 1, -1)
+ if(prob(50))
+ A.say(pick("HUAH!", "HYA!", "CHOO!", "WUO!", "KYA!", "HUH!", "HIYOH!", "CARP STRIKE!", "CARP BITE!"))
if(prob(D.getBruteLoss()) && !D.lying)
D.visible_message("[D] stumbles and falls!", "The blow sends you to the ground!")
D.Weaken(4)
diff --git a/code/modules/media/broadcast/receivers/radio.dm b/code/modules/media/broadcast/receivers/radio.dm
index 7b9c4ad7b15..a0d94dcbf31 100644
--- a/code/modules/media/broadcast/receivers/radio.dm
+++ b/code/modules/media/broadcast/receivers/radio.dm
@@ -8,6 +8,7 @@
var/on=0
/obj/machinery/media/receiver/boombox/initialize()
+ ..()
if(on)
update_on()
update_icon()
@@ -80,4 +81,4 @@
if(on)
icon_state="wallradio-p"
else
- icon_state="wallradio"
\ No newline at end of file
+ icon_state="wallradio"
diff --git a/code/modules/media/broadcast/transmitters/broadcast.dm b/code/modules/media/broadcast/transmitters/broadcast.dm
index d8607851752..898771b496d 100644
--- a/code/modules/media/broadcast/transmitters/broadcast.dm
+++ b/code/modules/media/broadcast/transmitters/broadcast.dm
@@ -19,6 +19,7 @@
var/const/MAX_TEMP=70 // Celsius
/obj/machinery/media/transmitter/broadcast/initialize()
+ ..()
testing("[type]/initialize() called!")
if(autolink && autolink.len)
for(var/obj/machinery/media/source in orange(20, src))
diff --git a/code/modules/media/jukebox.dm b/code/modules/media/jukebox.dm
index 9cea989fde7..ae33c38dcc4 100644
--- a/code/modules/media/jukebox.dm
+++ b/code/modules/media/jukebox.dm
@@ -183,12 +183,12 @@ var/global/loopModeNames=list(
to_chat(usr, "\red You touch the bluescreened menu. Nothing happens. You feel dumber.")
return
- if (href_list["power"])
+ if(href_list["power"])
playing=!playing
update_music()
update_icon()
- if (href_list["playlist"])
+ if(href_list["playlist"])
if(!check_reload())
to_chat(usr, "\red You must wait 60 seconds between playlist reloads.")
return
@@ -199,12 +199,12 @@ var/global/loopModeNames=list(
update_music()
update_icon()
- if (href_list["song"])
+ if(href_list["song"])
current_song=Clamp(text2num(href_list["song"]),1,playlist.len)
update_music()
update_icon()
- if (href_list["mode"])
+ if(href_list["mode"])
loop_mode = (loop_mode % JUKEMODE_COUNT) + 1
return attack_hand(usr)
@@ -218,7 +218,7 @@ var/global/loopModeNames=list(
if(response)
var/json = file2text(response["CONTENT"])
if("/>" in json)
- visible_message("\icon[src] \The [src] buzzes, unable to update its playlist.","You hear a buzz.")
+ visible_message("[bicon(src)] \The [src] buzzes, unable to update its playlist.","You hear a buzz.")
stat &= BROKEN
update_icon()
return
@@ -226,11 +226,11 @@ var/global/loopModeNames=list(
for(var/list/record in songdata)
playlist += new /datum/song_info(record)
if(playlist.len==0)
- visible_message("\icon[src] \The [src] buzzes, unable to update its playlist.","You hear a buzz.")
+ visible_message("[bicon(src)] \The [src] buzzes, unable to update its playlist.","You hear a buzz.")
stat &= BROKEN
update_icon()
return
- visible_message("\icon[src] \The [src] beeps, and the menu on its front fills with [playlist.len] items.","You hear a beep.")
+ visible_message("[bicon(src)] \The [src] beeps, and the menu on its front fills with [playlist.len] items.","You hear a beep.")
if(autoplay)
playing=1
autoplay=0
@@ -261,8 +261,8 @@ var/global/loopModeNames=list(
var/datum/song_info/song = playlist[current_song]
media_url = song.url
media_start_time = world.time
- visible_message("\icon[src] \The [src] begins to play [song.display()].","You hear music.")
- //visible_message("\icon[src] \The [src] warbles: [song.length/10]s @ [song.url]")
+ visible_message("[bicon(src)] \The [src] begins to play [song.display()].","You hear music.")
+ //visible_message("[bicon(src)] \The [src] warbles: [song.length/10]s @ [song.url]")
else
media_url=""
media_start_time = 0
diff --git a/code/modules/media/mediamanager.dm b/code/modules/media/mediamanager.dm
index d78afc6f9f2..125b224c8ea 100644
--- a/code/modules/media/mediamanager.dm
+++ b/code/modules/media/mediamanager.dm
@@ -51,26 +51,21 @@ if(vlc.attachEvent) {
"}
// Hook into the events we desire.
-/hook_handler/soundmanager
- // Set up player on login
- proc/OnLogin(var/list/args)
- //testing("Received OnLogin.")
- var/client/C = args["client"]
- C.media = new /datum/media_manager(args["mob"])
- C.media.open()
- spawn(20)
- C.media.update_music()
+/hook/mob_login/proc/init_media_manager(client/client, mob/mob)
+ client.media = new /datum/media_manager(mob)
+ client.media.open()
+ spawn(20)
+ client.media.update_music()
+ return 1
// Update when moving between areas.
- proc/OnMobAreaChange(var/list/args)
- var/mob/M = args["mob"]
- //if(istype(M, /mob/living/carbon/human)||istype(M, /mob/dead/observer))
- // testing("Received OnMobAreaChange for [M.type] [M] (M.client=[M.client==null?"null":"/client"]).")
- if(M.client)
- M.update_music()
+/hook/mob_area_change/proc/update_media(mob/mob, area/newarea, area/oldarea)
+ if(mob.client)
+ mob.update_music()
+ return 1
/mob/proc/update_music()
- if (client && client.media)
+ if(client && client.media)
client.media.update_music()
//else
// testing("[src] - client: [client?"Y":"N"]; client.media: [client && client.media ? "Y":"N"]")
@@ -124,7 +119,7 @@ to_chat(#define MP_DEBUG(x) owner, x)
var/targetURL = ""
var/targetStartTime = 0
- if (!owner)
+ if(!owner)
//testing("owner is null")
return
@@ -141,7 +136,7 @@ to_chat(#define MP_DEBUG(x) owner, x)
//else
// testing("M is not playing or null.")
- if (url != targetURL || abs(targetStartTime - start_time) > 1)
+ if(url != targetURL || abs(targetStartTime - start_time) > 1)
url = targetURL
start_time = targetStartTime
send_update()
diff --git a/code/modules/mining/abandonedcrates.dm b/code/modules/mining/abandonedcrates.dm
index 3e9580ef14b..cd229550880 100644
--- a/code/modules/mining/abandonedcrates.dm
+++ b/code/modules/mining/abandonedcrates.dm
@@ -156,12 +156,12 @@
to_chat(user, "The crate is locked with a Deca-code lock.")
var/input = input(usr, "Enter [codelen] digits.", "Deca-Code Lock", "") as text
if(in_range(src, user))
- if (input == code)
+ if(input == code)
to_chat(user, "The crate unlocks!")
locked = 0
overlays.Cut()
overlays += "securecrateg"
- else if (input == null || length(input) != codelen)
+ else if(input == null || length(input) != codelen)
to_chat(user, "You leave the crate alone.")
else
to_chat(user, "A red light flashes.")
diff --git a/code/modules/mining/alloys.dm b/code/modules/mining/alloys.dm
deleted file mode 100644
index ce29725d87a..00000000000
--- a/code/modules/mining/alloys.dm
+++ /dev/null
@@ -1,27 +0,0 @@
-//Alloys that contain subsets of each other's ingredients must be ordered in the desired sequence
-//eg. steel comes after plasteel because plasteel's ingredients contain the ingredients for steel and
-//it would be impossible to produce.
-
-/datum/alloy
- var/list/requires
- var/product_mod = 1
- var/product
- var/metaltag
-
-/datum/alloy/plasteel
- metaltag = "plasteel"
- requires = list(
- "platinum" = 1,
- "coal" = 2,
- "hematite" = 2
- )
- product_mod = 0.3
- product = /obj/item/stack/sheet/plasteel
-
-/datum/alloy/steel
- metaltag = "steel"
- requires = list(
- "coal" = 1,
- "hematite" = 1
- )
- product = /obj/item/stack/sheet/metal
\ No newline at end of file
diff --git a/code/modules/mining/coins.dm b/code/modules/mining/coins.dm
index a8ac5e1a88c..83f9c871f44 100644
--- a/code/modules/mining/coins.dm
+++ b/code/modules/mining/coins.dm
@@ -7,7 +7,7 @@
flags = CONDUCT
force = 1
throwforce = 2
- w_class = 1.0
+ w_class = 1
var/string_attached
var/list/sideslist = list("heads","tails")
var/cmineral = null
@@ -105,7 +105,7 @@
to_chat(user, "There already is a string attached to this coin.")
return
- if (CC.use(1))
+ if(CC.use(1))
overlays += image('icons/obj/items.dmi',"coin_string_overlay")
string_attached = 1
to_chat(user, "You attach a string to the coin.")
diff --git a/code/modules/mining/equipment_locker.dm b/code/modules/mining/equipment_locker.dm
index ee84c1a5864..211914afcbb 100644
--- a/code/modules/mining/equipment_locker.dm
+++ b/code/modules/mining/equipment_locker.dm
@@ -19,7 +19,7 @@
var/ore_pickup_rate = 15
var/sheet_per_ore = 1
var/point_upgrade = 1
- var/list/ore_values = list(("sand" = 1), ("iron" = 1), ("plasma" = 15), ("silver" = 16), ("gold" = 18), ("uranium" = 30), ("diamond" = 50), ("bananium" = 60), ("tranquillite" = 60))
+ var/list/ore_values = list(("sand" = 1), ("iron" = 1), ("plasma" = 15), ("silver" = 16), ("gold" = 18), ("uranium" = 30), ("diamond" = 50), ("bluespace crystal" = 50), ("bananium" = 60), ("tranquillite" = 60))
var/list/supply_consoles = list("Science", "Robotics", "Research Director's Desk", "Mechanic", "Engineering" = list("metal", "glass", "plasma"), "Chief Engineer's Desk" = list("metal", "glass", "plasma"), "Atmospherics" = list("metal", "glass", "plasma"), "Bar" = list("uranium", "plasma"), "Virology" = list("plasma", "uranium", "gold"))
/obj/machinery/mineral/ore_redemption/New()
@@ -84,9 +84,9 @@
var/i = 0
if(T)
for(var/obj/item/weapon/ore/O in T)
- if (i >= ore_pickup_rate)
+ if(i >= ore_pickup_rate)
break
- else if (!O || !O.refined_type)
+ else if(!O || !O.refined_type)
continue
else
process_sheet(O)
@@ -95,16 +95,16 @@
var/obj/structure/ore_box/B = locate() in T
if(B)
for(var/obj/item/weapon/ore/O in B.contents)
- if (i >= ore_pickup_rate)
+ if(i >= ore_pickup_rate)
break
- else if (!O || !O.refined_type)
+ else if(!O || !O.refined_type)
continue
else
process_sheet(O)
i++
/obj/machinery/mineral/ore_redemption/attackby(var/obj/item/weapon/W, var/mob/user, params)
- if (!powered())
+ if(!powered())
return
if(istype(W,/obj/item/weapon/card/id))
var/obj/item/weapon/card/id/I = usr.get_active_hand()
@@ -292,6 +292,7 @@
s.use(s.max_amount)
s.forceMove(loc)
s.layer = initial(s.layer)
+ s.plane = initial(s.plane)
/obj/machinery/mineral/ore_redemption/power_change()
..()
@@ -424,7 +425,7 @@
if(href_list["purchase"])
if(istype(inserted_id))
var/datum/data/mining_equipment/prize = locate(href_list["purchase"])
- if (!prize || !(prize in prize_list))
+ if(!prize || !(prize in prize_list))
return
if(prize.cost > inserted_id.mining_points)
else
@@ -520,14 +521,15 @@
icon_state = "Jaunter"
item_state = "electronic"
throwforce = 0
- w_class = 2.0
+ w_class = 2
throw_speed = 3
throw_range = 5
origin_tech = "bluespace=2"
/obj/item/device/wormhole_jaunter/attack_self(mob/user as mob)
var/turf/device_turf = get_turf(user)
- if(!device_turf||device_turf.z==2||device_turf.z>=7)
+ // TODO: Tie into space manager
+ if(!device_turf||device_turf.z==ZLEVEL_CENTCOMM||device_turf.z>=ZLEVEL_EMPTY)
to_chat(user, "You're having difficulties getting the [src.name] to work.")
return
else
@@ -535,6 +537,7 @@
var/list/L = list()
for(var/obj/item/device/radio/beacon/B in world)
var/turf/T = get_turf(B)
+ // TODO: Tie into space manager
if(T.z == ZLEVEL_STATION)
L += B
if(!L.len)
@@ -676,7 +679,7 @@
/obj/item/weapon/mining_drone_cube
name = "mining drone cube"
desc = "Compressed mining drone, ready for deployment. Just press the button to activate!"
- w_class = 2.0
+ w_class = 2
icon = 'icons/obj/aibots.dmi'
icon_state = "minedronecube"
item_state = "electronic"
@@ -730,13 +733,13 @@
if(istype(I, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/W = I
if(W.welding && !stat)
- if(AIStatus == AI_ON)
+ if(FindTarget())//if the bot has anything to shoot at, to prevent combat repair cheesing
to_chat(user, "[src] is moving around too much to repair!")
return
if(maxHealth == health)
to_chat(user, "[src] is at full integrity.")
else
- health += 10
+ adjustHealth(-10)//actually repairs the bot, not damages it
to_chat(user, "You repair some of the armor on [src].")
return
if(istype(I, /obj/item/device/mining_scanner) || istype(I, /obj/item/device/t_scanner/adv_mining_scanner))
@@ -901,7 +904,7 @@
icon_state = "lazarus_hypo"
item_state = "hypo"
throwforce = 0
- w_class = 2.0
+ w_class = 2
throw_speed = 3
throw_range = 5
var/loaded = 1
@@ -957,14 +960,15 @@
/**********************Mining Scanner**********************/
/obj/item/device/mining_scanner
- desc = "A scanner that checks surrounding rock for useful minerals, it can also be used to stop gibtonite detonations. Requires you to wear mesons to work properly."
- name = "mining scanner"
+ desc = "A scanner that checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations. Wear material scanners for optimal results."
+ name = "manual mining scanner"
icon_state = "mining1"
item_state = "analyzer"
- w_class = 2.0
+ w_class = 2
flags = CONDUCT
slot_flags = SLOT_BELT
var/cooldown = 0
+ origin_tech = "engineering=1;magnets=1"
/obj/item/device/mining_scanner/attack_self(mob/user)
if(!user.client)
@@ -988,29 +992,51 @@
qdel(src)
/obj/item/device/t_scanner/adv_mining_scanner
- desc = "A scanner that automatically checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations. Requires you to wear mesons to function properly."
- name = "advanced mining scanner"
+ desc = "A scanner that automatically checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations. Wear meson scanners for optimal results. This one has an extended range."
+ name = "advanced automatic mining scanner"
icon_state = "mining0"
item_state = "analyzer"
- w_class = 2.0
+ w_class = 2
flags = CONDUCT
slot_flags = SLOT_BELT
- var/cooldown = 0
+ var/cooldown = 35
+ var/on_cooldown = 0
+ var/range = 7
+ var/meson = TRUE
+ origin_tech = "engineering=3;magnets=3"
/obj/item/device/t_scanner/adv_mining_scanner/cyborg
flags = CONDUCT | NODROP
+/obj/item/device/t_scanner/adv_mining_scanner/material
+ meson = FALSE
+ desc = "A scanner that automatically checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations. Wear material scanners for optimal results. This one has an extended range."
+
+/obj/item/device/t_scanner/adv_mining_scanner/lesser
+ name = "automatic mining scanner"
+ desc = "A scanner that automatically checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations. Wear meson scanners for optimal results."
+ range = 4
+ cooldown = 50
+
+/obj/item/device/t_scanner/adv_mining_scanner/lesser/material
+ desc = "A scanner that automatically checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations. Wear material scanners for optimal results."
+ meson = FALSE
+
/obj/item/device/t_scanner/adv_mining_scanner/scan()
- if(!cooldown)
- cooldown = 1
- spawn(35)
- cooldown = 0
+ if(!on_cooldown)
+ on_cooldown = 1
+ spawn(cooldown)
+ on_cooldown = 0
var/turf/t = get_turf(src)
var/list/mobs = recursive_mob_check(t, client_check = 1, sight_check = 0, include_radio = 0)
if(!mobs.len)
return
- mineral_scan_pulse(mobs, t)
+ if(meson)
+ mineral_scan_pulse(mobs, t, range)
+ else
+ mineral_scan_pulse_material(mobs, t, range)
+//For use with mesons
/proc/mineral_scan_pulse(list/mobs, turf/T, range = world.view)
var/list/minerals = list()
for(var/turf/simulated/mineral/M in range(range, T))
@@ -1028,6 +1054,26 @@
if(C)
C.images -= I
+//For use with material scanners
+/proc/mineral_scan_pulse_material(list/mobs, turf/T, range = world.view)
+ var/list/minerals = list()
+ for(var/turf/simulated/mineral/M in range(range, T))
+ if(M.scan_state)
+ minerals += M
+ if(minerals.len)
+ for(var/turf/simulated/mineral/M in minerals)
+ var/obj/effect/overlay/temp/mining_overlay/C = new/obj/effect/overlay/temp/mining_overlay(M)
+ C.icon_state = M.scan_state
+
+/obj/effect/overlay/temp/mining_overlay
+ layer = 18
+ icon = 'icons/turf/mining.dmi'
+ anchored = 1
+ mouse_opacity = 0
+ duration = 30
+ pixel_x = -4
+ pixel_y = -4
+
/**********************Xeno Warning Sign**********************/
/obj/structure/sign/xeno_warning_mining
name = "DANGEROUS ALIEN LIFE"
diff --git a/code/modules/mining/laborcamp/laborstacker.dm b/code/modules/mining/laborcamp/laborstacker.dm
index 47c9c45dbc3..ce6dcc15eb1 100644
--- a/code/modules/mining/laborcamp/laborstacker.dm
+++ b/code/modules/mining/laborcamp/laborstacker.dm
@@ -28,7 +28,7 @@
t = d.id_tag
if(t == src.door_tag)
src.release_door = d
- if (machine && (release_door || !use_release_door))
+ if(machine && (release_door || !use_release_door))
machine.CONSOLE = src
else
qdel(src)
diff --git a/code/modules/mining/machine_processing.dm b/code/modules/mining/machine_processing.dm
index b83a2001bb0..23bf8ab532f 100644
--- a/code/modules/mining/machine_processing.dm
+++ b/code/modules/mining/machine_processing.dm
@@ -13,7 +13,7 @@
..()
spawn(7)
src.machine = locate(/obj/machinery/mineral/processing_unit, get_step(src, machinedir))
- if (machine)
+ if(machine)
machine.CONSOLE = src
else
qdel(src)
@@ -24,7 +24,7 @@
//iron
if(machine.ore_iron || machine.ore_glass || machine.ore_plasma || machine.ore_uranium || machine.ore_gold || machine.ore_silver || machine.ore_diamond || machine.ore_clown || machine.ore_mime || machine.ore_adamantine)
if(machine.ore_iron)
- if (machine.selected_iron==1)
+ if(machine.selected_iron==1)
dat += text("Smelting ")
else
dat += text("Not smelting ")
@@ -34,7 +34,7 @@
//sand - glass
if(machine.ore_glass)
- if (machine.selected_glass==1)
+ if(machine.selected_glass==1)
dat += text("Smelting ")
else
dat += text("Not smelting ")
@@ -44,7 +44,7 @@
//plasma
if(machine.ore_plasma)
- if (machine.selected_plasma==1)
+ if(machine.selected_plasma==1)
dat += text("Smelting ")
else
dat += text("Not smelting ")
@@ -54,7 +54,7 @@
//uranium
if(machine.ore_uranium)
- if (machine.selected_uranium==1)
+ if(machine.selected_uranium==1)
dat += text("Smelting ")
else
dat += text("Not smelting ")
@@ -64,7 +64,7 @@
//gold
if(machine.ore_gold)
- if (machine.selected_gold==1)
+ if(machine.selected_gold==1)
dat += text("Smelting ")
else
dat += text("Not smelting ")
@@ -74,7 +74,7 @@
//silver
if(machine.ore_silver)
- if (machine.selected_silver==1)
+ if(machine.selected_silver==1)
dat += text("Smelting ")
else
dat += text("Not smelting ")
@@ -84,7 +84,7 @@
//diamond
if(machine.ore_diamond)
- if (machine.selected_diamond==1)
+ if(machine.selected_diamond==1)
dat += text("Smelting ")
else
dat += text("Not smelting ")
@@ -94,7 +94,7 @@
//bananium
if(machine.ore_clown)
- if (machine.selected_clown==1)
+ if(machine.selected_clown==1)
dat += text("Smelting ")
else
dat += text("Not smelting ")
@@ -104,7 +104,7 @@
//tranquillite
if(machine.ore_mime)
- if (machine.selected_mime==1)
+ if(machine.selected_mime==1)
dat += text("Smelting ")
else
dat += text("Not smelting ")
@@ -115,7 +115,7 @@
//On or off
dat += text("Machine is currently ")
- if (machine.on==1)
+ if(machine.on==1)
dat += text("On ")
else
dat += text("Off ")
@@ -131,52 +131,52 @@
usr.set_machine(src)
src.add_fingerprint(usr)
if(href_list["sel_iron"])
- if (href_list["sel_iron"] == "yes")
+ if(href_list["sel_iron"] == "yes")
machine.selected_iron = 1
else
machine.selected_iron = 0
if(href_list["sel_glass"])
- if (href_list["sel_glass"] == "yes")
+ if(href_list["sel_glass"] == "yes")
machine.selected_glass = 1
else
machine.selected_glass = 0
if(href_list["sel_plasma"])
- if (href_list["sel_plasma"] == "yes")
+ if(href_list["sel_plasma"] == "yes")
machine.selected_plasma = 1
else
machine.selected_plasma = 0
if(href_list["sel_uranium"])
- if (href_list["sel_uranium"] == "yes")
+ if(href_list["sel_uranium"] == "yes")
machine.selected_uranium = 1
else
machine.selected_uranium = 0
if(href_list["sel_gold"])
- if (href_list["sel_gold"] == "yes")
+ if(href_list["sel_gold"] == "yes")
machine.selected_gold = 1
else
machine.selected_gold = 0
if(href_list["sel_silver"])
- if (href_list["sel_silver"] == "yes")
+ if(href_list["sel_silver"] == "yes")
machine.selected_silver = 1
else
machine.selected_silver = 0
if(href_list["sel_diamond"])
- if (href_list["sel_diamond"] == "yes")
+ if(href_list["sel_diamond"] == "yes")
machine.selected_diamond = 1
else
machine.selected_diamond = 0
if(href_list["sel_clown"])
- if (href_list["sel_clown"] == "yes")
+ if(href_list["sel_clown"] == "yes")
machine.selected_clown = 1
else
machine.selected_clown = 0
if(href_list["sel_mime"])
- if (href_list["sel_mime"] == "yes")
+ if(href_list["sel_mime"] == "yes")
machine.selected_mime = 1
else
machine.selected_mime = 0
if(href_list["set_on"])
- if (href_list["set_on"] == "on")
+ if(href_list["set_on"] == "on")
machine.on = 1
else
machine.on = 0
@@ -216,82 +216,82 @@
/obj/machinery/mineral/processing_unit/process()
var/i
- for (i = 0; i < 10; i++)
- if (on)
- if (selected_glass == 1 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
- if (ore_glass > 0)
+ for(i = 0; i < 10; i++)
+ if(on)
+ if(selected_glass == 1 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
+ if(ore_glass > 0)
ore_glass--;
generate_mineral(/obj/item/stack/sheet/glass)
else
on = 0
continue
- if (selected_glass == 1 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0 && selected_mime == 0)
- if (ore_glass > 0 && ore_iron > 0)
+ if(selected_glass == 1 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0 && selected_mime == 0)
+ if(ore_glass > 0 && ore_iron > 0)
ore_glass--;
ore_iron--;
generate_mineral(/obj/item/stack/sheet/rglass)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 1 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
- if (ore_gold > 0)
+ if(selected_glass == 0 && selected_gold == 1 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
+ if(ore_gold > 0)
ore_gold--;
generate_mineral(/obj/item/stack/sheet/mineral/gold)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 1 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
- if (ore_silver > 0)
+ if(selected_glass == 0 && selected_gold == 0 && selected_silver == 1 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
+ if(ore_silver > 0)
ore_silver--;
generate_mineral(/obj/item/stack/sheet/mineral/silver)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 1 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
- if (ore_diamond > 0)
+ if(selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 1 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
+ if(ore_diamond > 0)
ore_diamond--;
generate_mineral(/obj/item/stack/sheet/mineral/diamond)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
- if (ore_plasma > 0)
+ if(selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
+ if(ore_plasma > 0)
ore_plasma--;
generate_mineral(/obj/item/stack/sheet/mineral/plasma)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 1 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
- if (ore_uranium > 0)
+ if(selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 1 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
+ if(ore_uranium > 0)
ore_uranium--;
generate_mineral(/obj/item/stack/sheet/mineral/uranium)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0 && selected_mime == 0)
- if (ore_iron > 0)
+ if(selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0 && selected_mime == 0)
+ if(ore_iron > 0)
ore_iron--;
generate_mineral(/obj/item/stack/sheet/metal)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0 && selected_mime == 0)
- if (ore_iron > 0 && ore_plasma > 0)
+ if(selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0 && selected_mime == 0)
+ if(ore_iron > 0 && ore_plasma > 0)
ore_iron--;
ore_plasma--;
generate_mineral(/obj/item/stack/sheet/plasteel)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 1 && selected_mime == 0)
- if (ore_clown > 0)
+ if(selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 1 && selected_mime == 0)
+ if(ore_clown > 0)
ore_clown--;
generate_mineral(/obj/item/stack/sheet/mineral/bananium)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 1)
- if (ore_mime > 0)
+ if(selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 1)
+ if(ore_mime > 0)
ore_mime--;
generate_mineral(/obj/item/stack/sheet/mineral/tranquillite)
else
@@ -299,16 +299,16 @@
continue
//THESE TWO ARE CODED FOR URIST TO USE WHEN HE GETS AROUND TO IT.
//They were coded on 18 Feb 2012. If you're reading this in 2015, then firstly congratulations on the world not ending on 21 Dec 2012 and secondly, Urist is apparently VERY lazy. ~Errorage
- /*if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 1 && selected_plasma == 0 && selected_uranium == 1 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
- if (ore_uranium >= 2 && ore_diamond >= 1)
+ /*if(selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 1 && selected_plasma == 0 && selected_uranium == 1 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
+ if(ore_uranium >= 2 && ore_diamond >= 1)
ore_uranium -= 2
ore_diamond -= 1
generate_mineral(/obj/item/stack/sheet/mineral/adamantine)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 1 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
- if (ore_silver >= 1 && ore_plasma >= 3)
+ if(selected_glass == 0 && selected_gold == 0 && selected_silver == 1 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
+ if(ore_silver >= 1 && ore_plasma >= 3)
ore_silver -= 1
ore_plasma -= 3
generate_mineral(/obj/item/stack/sheet/mineral/mythril)
@@ -321,53 +321,53 @@
var/b = 1 //this part checks if all required ores are available
- if (!(selected_gold || selected_silver ||selected_diamond || selected_uranium | selected_plasma || selected_iron || selected_iron))
+ if(!(selected_gold || selected_silver ||selected_diamond || selected_uranium | selected_plasma || selected_iron || selected_iron))
b = 0
- if (selected_gold == 1)
- if (ore_gold <= 0)
+ if(selected_gold == 1)
+ if(ore_gold <= 0)
b = 0
- if (selected_silver == 1)
- if (ore_silver <= 0)
+ if(selected_silver == 1)
+ if(ore_silver <= 0)
b = 0
- if (selected_diamond == 1)
- if (ore_diamond <= 0)
+ if(selected_diamond == 1)
+ if(ore_diamond <= 0)
b = 0
- if (selected_uranium == 1)
- if (ore_uranium <= 0)
+ if(selected_uranium == 1)
+ if(ore_uranium <= 0)
b = 0
- if (selected_plasma == 1)
- if (ore_plasma <= 0)
+ if(selected_plasma == 1)
+ if(ore_plasma <= 0)
b = 0
- if (selected_iron == 1)
- if (ore_iron <= 0)
+ if(selected_iron == 1)
+ if(ore_iron <= 0)
b = 0
- if (selected_glass == 1)
- if (ore_glass <= 0)
+ if(selected_glass == 1)
+ if(ore_glass <= 0)
b = 0
- if (selected_clown == 1)
- if (ore_clown <= 0)
+ if(selected_clown == 1)
+ if(ore_clown <= 0)
b = 0
- if (selected_mime == 1)
- if (ore_mime <= 0)
+ if(selected_mime == 1)
+ if(ore_mime <= 0)
b = 0
- if (b) //if they are, deduct one from each, produce slag and shut the machine off
- if (selected_gold == 1)
+ if(b) //if they are, deduct one from each, produce slag and shut the machine off
+ if(selected_gold == 1)
ore_gold--
- if (selected_silver == 1)
+ if(selected_silver == 1)
ore_silver--
- if (selected_diamond == 1)
+ if(selected_diamond == 1)
ore_diamond--
- if (selected_uranium == 1)
+ if(selected_uranium == 1)
ore_uranium--
- if (selected_plasma == 1)
+ if(selected_plasma == 1)
ore_plasma--
- if (selected_iron == 1)
+ if(selected_iron == 1)
ore_iron--
- if (selected_clown == 1)
+ if(selected_clown == 1)
ore_clown--
- if (selected_mime == 1)
+ if(selected_mime == 1)
ore_mime--
generate_mineral(/obj/item/weapon/ore/slag)
on = 0
@@ -384,39 +384,39 @@
n++
if(n>10)
break
- if (istype(O,/obj/item/weapon/ore/iron))
+ if(istype(O,/obj/item/weapon/ore/iron))
ore_iron++;
O.loc = null
continue
- if (istype(O,/obj/item/weapon/ore/glass))
+ if(istype(O,/obj/item/weapon/ore/glass))
ore_glass++;
O.loc = null
continue
- if (istype(O,/obj/item/weapon/ore/diamond))
+ if(istype(O,/obj/item/weapon/ore/diamond))
ore_diamond++;
O.loc = null
continue
- if (istype(O,/obj/item/weapon/ore/plasma))
+ if(istype(O,/obj/item/weapon/ore/plasma))
ore_plasma++
O.loc = null
continue
- if (istype(O,/obj/item/weapon/ore/gold))
+ if(istype(O,/obj/item/weapon/ore/gold))
ore_gold++
O.loc = null
continue
- if (istype(O,/obj/item/weapon/ore/silver))
+ if(istype(O,/obj/item/weapon/ore/silver))
ore_silver++
O.loc = null
continue
- if (istype(O,/obj/item/weapon/ore/uranium))
+ if(istype(O,/obj/item/weapon/ore/uranium))
ore_uranium++
O.loc = null
continue
- if (istype(O,/obj/item/weapon/ore/bananium))
+ if(istype(O,/obj/item/weapon/ore/bananium))
ore_clown++
O.loc = null
continue
- if (istype(O,/obj/item/weapon/ore/tranquillite))
+ if(istype(O,/obj/item/weapon/ore/tranquillite))
ore_mime++
O.loc = null
continue
diff --git a/code/modules/mining/machine_stacking.dm b/code/modules/mining/machine_stacking.dm
index 5f315648c10..44d7b037869 100644
--- a/code/modules/mining/machine_stacking.dm
+++ b/code/modules/mining/machine_stacking.dm
@@ -13,7 +13,7 @@
..()
spawn(7)
src.machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir))
- if (machine)
+ if(machine)
machine.CONSOLE = src
else
qdel(src)
diff --git a/code/modules/mining/machine_unloading.dm b/code/modules/mining/machine_unloading.dm
index 5ae7f376cb0..5214c8caec8 100644
--- a/code/modules/mining/machine_unloading.dm
+++ b/code/modules/mining/machine_unloading.dm
@@ -15,14 +15,14 @@
if(T)
var/limit
for(var/obj/structure/ore_box/B in T)
- for (var/obj/item/weapon/ore/O in B)
+ for(var/obj/item/weapon/ore/O in B)
B.contents -= O
unload_mineral(O)
limit++
- if (limit>=10)
+ if(limit>=10)
return
for(var/obj/item/I in T)
unload_mineral(I)
limit++
- if (limit>=10)
+ if(limit>=10)
return
\ No newline at end of file
diff --git a/code/modules/mining/manufacturing.dm b/code/modules/mining/manufacturing.dm
deleted file mode 100644
index 429b0ee42bc..00000000000
--- a/code/modules/mining/manufacturing.dm
+++ /dev/null
@@ -1,1135 +0,0 @@
-// the entire manufacturing.dm
-
-/datum/manufacture
- var/name = null
- var/item = null
- var/cost1 = null
- var/cost2 = null
- var/cost3 = null
- var/cname1 = null
- var/cname2 = null
- var/cname3 = null
- var/amount1 = 0
- var/amount2 = 0
- var/amount3 = 0
- var/create = 1
- var/time = 5
-
-/obj/machinery/manufacturer
- name = "Manufacturing Unit"
- desc = "A standard fabricator unit capable of producing certain items from mined ore."
- icon = 'icons/obj/surgery.dmi'
- icon_state = "fab-idle"
- density = 1
- anchored = 1
- //mats = 25
- var/working = 0
- var/panelopen = 0
- var/powconsumption = 0
- var/hacked = 0
- var/acceptdisk = 0
- var/dl_list = null
- var/list/available = list()
- var/list/diskload = list()
- var/list/download = list()
- var/list/hidden = list()
-
- New()
- ..()
-
- process()
- ..()
- if (src.working) use_power(src.powconsumption)
-
- ex_act(severity)
- switch(severity)
- if(1.0) qdel(src)
- if(2.0)
- if (prob(60)) stat |= BROKEN
- if(3.0)
- if (prob(30)) stat |= BROKEN
- return
-
- blob_act()
- if (prob(25)) del src
- return
-
- power_change()
- if(stat & BROKEN) icon_state = "fab-broken"
- else
- if( powered() )
- if (src.working) src.icon_state = "fab-active"
- else src.icon_state = "fab-idle"
- stat &= ~NOPOWER
- else
- spawn(rand(0, 15))
- src.icon_state = "fab-off"
- stat |= NOPOWER
-
- attack_hand(var/mob/user as mob)
- if(stat & BROKEN) return
- if(stat & NOPOWER) return
-
- user.machine = src
- var/dat = "[src.name] "
-
- if(src.working)
- dat += "This unit is currently busy."
- user << browse(dat, "window=manufact;size=400x500")
- onclose(user, "manufact")
- return
-
- var/AMTmaux = 0
- var/AMTmoli = 0
- var/AMTphar = 0
- var/AMTclar = 0
- var/AMTbohr = 0
- var/AMTereb = 0
- var/AMTcere = 0
- var/AMTplas = 0
- var/AMTuqil = 0
- var/AMTtele = 0
- var/AMTfabr = 0
-
- for(var/obj/item/weapon/ore/O in src.contents)
- if (istype(O,/obj/item/weapon/ore/iron)) AMTmaux++
- if (istype(O,/obj/item/weapon/ore/glass)) AMTmoli++
- if (istype(O,/obj/item/weapon/ore/silver)) AMTphar++
- if (istype(O,/obj/item/weapon/ore/diamond)) AMTclar++
- if (istype(O,/obj/item/weapon/ore/gold)) AMTbohr++
- if (istype(O,/obj/item/weapon/ore/coal)) AMTereb++
- if (istype(O,/obj/item/weapon/ore/uranium)) AMTcere++
- if (istype(O,/obj/item/weapon/ore/plasma)) AMTplas++
- if (istype(O,/obj/item/weapon/ore/osmium)) AMTuqil++
- if (istype(O,/obj/item/weapon/ore/hydrogen)) AMTtele++
- if (istype(O,/obj/item/weapon/ore/fabric)) AMTfabr++
-
- dat += "Available Minerals "
- if (AMTmaux) dat += "Iron: [AMTmaux] "
- if (AMTmoli) dat += "Glass: [AMTmoli] "
- if (AMTphar) dat += "Silver: [AMTphar] "
- if (AMTclar) dat += "Diamond: [AMTclar] "
- if (AMTbohr) dat += "Gold: [AMTbohr] "
- if (AMTereb) dat += "Coal: [AMTereb] "
- if (AMTcere) dat += "Uranium: [AMTcere] "
- if (AMTplas) dat += "Plasma: [AMTplas] "
- if (AMTuqil) dat += "Platinum: [AMTuqil] "
- if (AMTtele) dat += "Hydrogen: [AMTtele] "
- if (AMTfabr) dat += "Fabric: [AMTfabr] "
- if (!AMTmaux && !AMTmoli && !AMTphar && !AMTclar && !AMTbohr && !AMTereb && !AMTcere && !AMTplas && !AMTuqil && !AMTtele && !AMTfabr)
- dat += "No minerals currently loaded. "
-
- dat += {"
- Available Schematics"}
-
- for(var/datum/manufacture/A in src.available)
- dat += {"
- [A.name]
- Cost: [A.amount1] [A.cname1]"}
- if (A.cost2) dat += ", [A.amount2] [A.cname2]"
- if (A.cost3) dat += ", [A.amount3] [A.cname3]"
- dat += " Time: [A.time] Seconds "
-
- for(var/datum/manufacture/A in src.download)
- dat += {"
- [A.name] (Downloaded)
- Cost: [A.amount1] [A.cname1]"}
- if (A.cost2) dat += ", [A.amount2] [A.cname2]"
- if (A.cost3) dat += ", [A.amount3] [A.cname3]"
- dat += " Time: [A.time] Seconds "
-
- for(var/datum/manufacture/A in src.diskload)
- dat += {"
- [A.name] (Disk)
- Cost: [A.amount1] [A.cname1]"}
- if (A.cost2) dat += ", [A.amount2] [A.cname2]"
- if (A.cost3) dat += ", [A.amount3] [A.cname3]"
- dat += " Time: [A.time] Seconds "
-
- if (src.hacked)
- for(var/datum/manufacture/A in src.hidden)
- dat += {"
- [A.name] (Secret)
- Cost: [A.amount1] [A.cname1]"}
- if (A.cost2) dat += ", [A.amount2] [A.cname2]"
- if (A.cost3) dat += ", [A.amount3] [A.cname3]"
- dat += " Time: [A.time] Seconds "
-
- dat += ""
-
- if (src.dl_list)
- dat += {"Download Available Schematics
- Clear Downloaded Schematics "}
-
- if (src.acceptdisk)
- dat += {"Clear Disk Schematics "}
-
- user << browse(dat, "window=manufact;size=400x500")
- onclose(user, "manufact")
-
- Topic(href, href_list)
- if(stat & BROKEN) return
- if(stat & NOPOWER) return
- if(usr.stat || usr.restrained())
- return
-
- if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))))
- usr.machine = src
-
- if (href_list["download"])
- to_chat(if(!src.dl_list) usr, "\red This unit is not capable of downloading any additional schematics.")
- else
- var/amtdl = 0
- //var/dontload = 0
- if (src.dl_list == "robotics")
- /*for(var/i = robotics_research.starting_tier, i <= robotics_research.max_tiers, i++)
- for(var/datum/roboresearch/X in robotics_research.researched_items[i])
- for (var/datum/manufacture/S in X.schematics)
- for (var/datum/manufacture/A in src.download)
- if (istype(S,A)) dontload = 1
- if (!dontload)
- src.download += new S.type(src)
- amtdl++
- else dontload = 0*/
- to_chat(if (amtdl) usr, "\blue [amtdl] new schematics downloaded from Robotics Research Database.")
- to_chat(else usr, "\red No new schematics currently available in Robotics Research Database.")
-
- if (href_list["delete"])
- var/operation = text2num(href_list["delete"])
- if(operation == 1) // Clear Disk Schematics
- var/amtgone = 0
- for(var/datum/manufacture/D in src.diskload)
- src.diskload-= D
- amtgone++
- to_chat(if (amtgone) usr, "\blue Cleared [amtgone] schematics from database.")
- to_chat(else usr, "\red No disk-loaded schematics detected in database.")
- if(operation == 2) // Clear Download Schematics
- var/amtgone = 0
- for(var/datum/manufacture/D in src.download)
- src.download-= D
- amtgone++
- to_chat(if (amtgone) usr, "\blue Cleared [amtgone] schematics from database.")
- to_chat(else usr, "\red No downloaded schematics detected in database.")
-
- if (href_list["eject"])
- var/operation = text2num(href_list["eject"])
- var/ejectamt = 0
- var/ejecting = null
- switch(operation)
- if(1) ejecting = /obj/item/weapon/ore/iron
- if(2) ejecting = /obj/item/weapon/ore/glass
- if(3) ejecting = /obj/item/weapon/ore/silver
- if(4) ejecting = /obj/item/weapon/ore/diamond
- if(5) ejecting = /obj/item/weapon/ore/gold
- if(6) ejecting = /obj/item/weapon/ore/coal
- if(7) ejecting = /obj/item/weapon/ore/uranium
- if(8) ejecting = /obj/item/weapon/ore/plasma
- if(9) ejecting = /obj/item/weapon/ore/osmium
- if(10) ejecting = /obj/item/weapon/ore/hydrogen
- if(11) ejecting = /obj/item/weapon/ore/fabric
- else
- to_chat(usr, "\red Error. Unknown ore type.")
- return
- sleep(3)
- ejectamt = input(usr,"How many units do you want to eject?","Eject Materials") as num
- for(var/obj/item/weapon/ore/O in src.contents)
- if (ejectamt <= 0) break
- if (istype(O, ejecting))
- O.loc = usr.loc
- ejectamt--
-
- if (href_list["disp"])
- var/datum/manufacture/I = locate(href_list["disp"])
- // Material Check
- var/A1 = 0
- var/A2 = 0
- var/A3 = 0
- for(var/obj/item/weapon/ore/O in src.contents)
- if (istype(O,I.cost1)) A1++
- if (istype(O,I.cost2)) A2++
- if (istype(O,I.cost3)) A3++
- if (A1 < I.amount1 || A2 < I.amount2 || A3 < I.amount3)
- to_chat(usr, "\red Insufficient materials to manufacture that item.")
- return
- // Consume Mats
- var/C1 = I.amount1
- var/C2 = I.amount2
- var/C3 = I.amount3
- for(var/obj/item/weapon/ore/O in src.contents)
- if (istype(O,I.cost1) && C1)
- del O
- C1--
- if (istype(O,I.cost2) && C2)
- del O
- C2--
- if (istype(O,I.cost3) && C3)
- del O
- C3--
- // Manufacture Item
- src.icon_state = "fab-active"
- src.working = 1
- var/worktime = I.time * 10
- var/powconsume = round(1500*worktime/3)
- /*for(var/i = robotics_research.starting_tier, i <= robotics_research.max_tiers, i++)
- for(var/datum/roboresearch/a in robotics_research.researched_items[i])
- if (a.manubonus)
- worktime -= a.timebonus
- if (a.multiplier != 0) worktime /= a.multiplier
- powconsume -= a.powbonus*/
- if (worktime < 1) worktime = 1
- src.powconsumption = powconsume
- src.updateUsrDialog()
- sleep(worktime)
- var/make = I.create
- while (make > 0)
- new I.item(src.loc)
- make--
- src.working = 0
- src.icon_state = "fab-idle"
- src.updateUsrDialog()
-
-
- attackby(obj/item/weapon/W as obj, mob/user as mob, params)
- var/load = 0
- if(istype(W, /obj/item/weapon/ore/))
- for(var/mob/O in viewers(user, null)) O.show_message(text("\blue [] loads [] into the [].", user, W, src), 1)
- load = 1
- else if(istype(W, /obj/item/stack/sheet))
- var/obj/item/stack/sheet/STACK = W
- for(var/mob/O in viewers(user, null)) O.show_message(text("\blue [] loads [] into the [].", user, W, src), 1)
- if(istype(STACK, /obj/item/stack/sheet/metal))
- for (var/amt = STACK.amount, amt > 0, amt--) new /obj/item/weapon/ore/iron(src)
- if(istype(STACK, /obj/item/stack/sheet/plasteel))
- for (var/amt = STACK.amount, amt > 0, amt--)
- new /obj/item/weapon/ore/iron(src)
- new /obj/item/weapon/ore/plasma(src)
- if(istype(STACK, /obj/item/stack/sheet/glass))
- for (var/amt = STACK.amount, amt > 0, amt--) new /obj/item/weapon/ore/glass(src)
- if(istype(STACK, /obj/item/stack/sheet/rglass))
- for (var/amt = STACK.amount, amt > 0, amt--)
- new /obj/item/weapon/ore/iron(src)
- new /obj/item/weapon/ore/glass(src)
- load = 2
- //else if (istype(W, /obj/item/weapon/plant/wheat/metal))
- // new /obj/item/weapon/ore/iron(src)
- // load = 2
- /*else if(istype(W, /obj/item/stack/cable_coil/))
- for(var/mob/O in viewers(user, null)) O.show_message(text("\blue [] loads [] into the [].", user, W, src), 1)
- for (var/amt = W:amount, amt > 0, amt--)
- new /obj/item/weapon/ore/silver(src)
- amt--
- load = 2*/
- else if(istype(W, /obj/item/weapon/shard))
- new /obj/item/weapon/ore/glass(src)
- load = 2
- else if(istype(W, /obj/item/stack/rods))
- var/obj/item/stack/RODS = W
- for (var/amt = RODS.amount, amt > 0, amt--) new /obj/item/weapon/ore/iron(src)
- load = 2
- else if(istype(W, /obj/item/clothing/))
- if(istype(W, /obj/item/clothing/under/))
- new /obj/item/weapon/ore/fabric(src)
- load = 2
- if(istype(W, /obj/item/clothing/suit/))
- if(!istype(W,/obj/item/clothing/suit/armor))
- new /obj/item/weapon/ore/fabric(src)
- new /obj/item/weapon/ore/fabric(src)
- if(istype(W,/obj/item/clothing/suit/space/)) new /obj/item/weapon/ore/fabric(src)
- load = 2
- else if(istype(W, /obj/item/weapon/disk/data/schematic))
- to_chat(if (!src.acceptdisk) user, "\red This unit is unable to accept disks.")
- else
- var/amtload = 0
- var/dontload = 0
- for (var/datum/manufacture/WS in W:schematics)
- for (var/datum/manufacture/A in src.available)
- if (istype(WS,A)) dontload = 1
- for (var/datum/manufacture/B in src.download)
- if (istype(WS,B)) dontload = 1
- for (var/datum/manufacture/C in src.diskload)
- if (istype(WS,C)) dontload = 1
- for (var/datum/manufacture/D in src.hidden)
- if (istype(WS,D) && src.hacked) dontload = 1
- if (!dontload)
- src.diskload += new WS.type(src)
- amtload++
- else dontload = 0
- to_chat(if (amtload) user, "\blue [amtload] new schematics downloaded from disk.")
- to_chat(else user, "\red No new schematics available on disk.")
- else if (istype(W, /obj/item/weapon/storage/bag/ore))
- for(var/mob/V in viewers(user, null)) V.show_message(text("\blue [] uses the []'s automatic ore loader on []!", user, src, W), 1)
- var/amtload = 0
- for (var/obj/item/weapon/ore/M in W.contents)
- M.loc = src
- amtload++
- to_chat(if (amtload) user, "\blue [amtload] pieces of ore loaded from [W]!")
- to_chat(else user, "\red No ore loaded!")
- else if(istype(W, /obj/item/weapon/card/emag))
- src.hacked = 1
- to_chat(user, "\blue You remove the [src]'s product locks!")
- else ..()
-
- if (load == 1)
- user.unEquip(W)
- W.loc = src
- if ((user.client && user.s_active != src))
- user.client.screen -= W
- W.dropped()
- else if (load == 2)
- user.unEquip(W)
- W.dropped()
- if ((user.client && user.s_active != src))
- user.client.screen -= W
- del W
-
- src.updateUsrDialog()
-
- MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob)
- if (istype(O, /obj/structure/closet/crate/))
- for(var/mob/V in viewers(user, null)) V.show_message(text("\blue [] uses the []'s automatic ore loader on []!", user, src, O), 1)
- var/amtload = 0
- for (var/obj/item/weapon/ore/M in O.contents)
- M.loc = src
- amtload++
- to_chat(if (amtload) user, "\blue [amtload] pieces of ore loaded from [O]!")
- to_chat(else user, "\red No ore loaded!")
- else if (istype(O, /obj/item/weapon/ore/))
- for(var/mob/V in viewers(user, null)) V.show_message(text("\blue [] begins quickly stuffing ore into []!", user, src), 1)
- var/staystill = user.loc
- for(var/obj/item/weapon/ore/M in view(1,user))
- M.loc = src
- sleep(3)
- if (user.loc != staystill) break
- to_chat(user, "\blue You finish stuffing ore into [src]!")
- /*else if (istype(O, /obj/item/weapon/plant/wheat/metal))
- for(var/mob/V in viewers(user, null)) V.show_message(text("\blue [] begins quickly stuffing [O] into []!", user, src), 1)
- var/staystill = user.loc
- for(var/obj/item/weapon/plant/wheat/metal/M in view(1,user))
- new /obj/item/weapon/ore/iron(src)
- del M
- sleep(3)
- if (user.loc != staystill) break
- to_chat(user, "\blue You finish stuffing [O] into [src]!"*/)
- else ..()
- src.updateUsrDialog()
-
-/obj/item/weapon/disk/data/schematic
- name = "Manufacturer Schematic Disk"
- desc = "Contains schematics for use in a Manufacturing Unit."
- var/list/schematics = list()
-
-// Fabricator Defines
-
-/obj/machinery/manufacturer/general
- name = "General Manufacturer"
- desc = "A manufacturing unit calibrated to produce tools and general purpose items."
-
- New()
- ..()
- src.available += new /datum/manufacture/screwdriver(src)
- src.available += new /datum/manufacture/wirecutters(src)
- src.available += new /datum/manufacture/wrench(src)
- src.available += new /datum/manufacture/crowbar(src)
- src.available += new /datum/manufacture/extinguisher(src)
- src.available += new /datum/manufacture/welder(src)
- src.available += new /datum/manufacture/weldingmask(src)
- src.available += new /datum/manufacture/multitool(src)
- src.available += new /datum/manufacture/metal5(src)
- src.available += new /datum/manufacture/metalR(src)
- src.available += new /datum/manufacture/glass5(src)
- src.available += new /datum/manufacture/glassR(src)
- src.available += new /datum/manufacture/atmos_can(src)
- //src.available += new /datum/manufacture/cable(src)
- src.available += new /datum/manufacture/light_bulb(src)
- src.available += new /datum/manufacture/light_tube(src)
- src.available += new /datum/manufacture/breathmask(src)
- src.available += new /datum/manufacture/RCDammo(src)
- //src.available += new /datum/manufacture/cola_bottle(src)
- //src.hidden += new /datum/manufacture/vuvuzela(src)
- //src.hidden += new /datum/manufacture/harmonica(src)
- //src.hidden += new /datum/manufacture/bikehorn(src)
- //src.hidden += new /datum/manufacture/stunrounds
-
-/obj/machinery/manufacturer/robotics
- name = "Robotics Fabricator"
- desc = "A manufacturing unit calibrated to produce robot-related equipment."
- acceptdisk = 1
- dl_list = "robotics"
-
- New()
- ..()
- src.available += new /datum/manufacture/robo_frame(src)
- src.available += new /datum/manufacture/robo_head(src)
- src.available += new /datum/manufacture/robo_chest(src)
- src.available += new /datum/manufacture/robo_arm_r(src)
- src.available += new /datum/manufacture/robo_arm_l(src)
- src.available += new /datum/manufacture/robo_leg_r(src)
- src.available += new /datum/manufacture/robo_leg_l(src)
- src.available += new /datum/manufacture/robo_stmodule(src)
- //src.available += new /datum/manufacture/cable(src)
- src.available += new /datum/manufacture/powercell(src)
- src.available += new /datum/manufacture/crowbar(src)
- src.available += new /datum/manufacture/scalpel(src)
- src.available += new /datum/manufacture/circular_saw(src)
- src.available += new /datum/manufacture/implanter
- src.hidden += new /datum/manufacture/flash(src)
-
-// Schematic Defines
-// General/Miscellaneous
-
-/datum/manufacture/crowbar
- name = "Crowbar"
- item = /obj/item/weapon/crowbar
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- time = 5
- create = 1
-
-/datum/manufacture/screwdriver
- name = "Screwdriver"
- item = /obj/item/weapon/screwdriver
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- time = 5
- create = 1
-
-/datum/manufacture/wirecutters
- name = "Wirecutters"
- item = /obj/item/weapon/wirecutters
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- time = 5
- create = 1
-
-/datum/manufacture/wrench
- name = "Wrench"
- item = /obj/item/weapon/wrench
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- time = 5
- create = 1
-/*
-/datum/manufacture/vuvuzela
- name = "Vuvuzela"
- item = /obj/item/weapon/vuvuzela
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- time = 5
- create = 1
-
-/datum/manufacture/harmonica
- name = "Harmonica"
- item = /obj/item/weapon/harmonica
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- time = 5
- create = 1
-
-/datum/manufacture/cola_bottle
- name = "Glass Bottle"
- item = /obj/item/weapon/reagent_containers/food/drinks/cola_bottle
- cost1 = /obj/item/weapon/ore/glass
- cname1 = "Glass"
- amount1 = 1
- time = 4
- create = 1
-
-/datum/manufacture/bikehorn
- name = "Bicycle Horn"
- item = /obj/item/weapon/bikehorn
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- time = 5
- create = 1
-
-/datum/manufacture/stunrounds
- name = ".38 Stunner Rounds"
- item = /obj/item/weapon/ammo/bullets/a38/stun
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 7
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 3
- time = 25
- create = 1
-*/
-/datum/manufacture/extinguisher
- name = "Fire Extinguisher"
- item = /obj/item/weapon/extinguisher
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 1
- time = 8
- create = 1
-
-/datum/manufacture/welder
- name = "Welding Tool"
- item = /obj/item/weapon/weldingtool
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 1
- time = 8
- create = 1
-
-/datum/manufacture/multitool
- name = "Multi Tool"
- item = /obj/item/device/multitool
- cost1 = /obj/item/weapon/ore/glass
- cname1 = "Glass"
- amount1 = 1
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 1
- time = 8
- create = 1
-
-/datum/manufacture/weldingmask
- name = "Welding Mask"
- item = /obj/item/clothing/head/welding
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 2
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 2
- time = 10
- create = 1
-
-/datum/manufacture/light_bulb
- name = "Light Bulb"
- item = /obj/item/weapon/light/bulb
- cost1 = /obj/item/weapon/ore/glass
- cname1 = "Glass"
- amount1 = 1
- time = 4
- create = 1
-
-/datum/manufacture/light_tube
- name = "Light Tube"
- item = /obj/item/weapon/light/tube
- cost1 = /obj/item/weapon/ore/glass
- cname1 = "Glass"
- amount1 = 1
- time = 4
- create = 1
-
-/datum/manufacture/metal5
- name = "Sheet Metal (x5)"
- item = /obj/item/stack/sheet/metal
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 5
- time = 8
- create = 5
-
-/datum/manufacture/metalR
- name = "Reinforced Metal"
- item = /obj/item/stack/sheet/plasteel
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- cost2 = /obj/item/weapon/ore/plasma
- cname2 = "Plasma"
- amount2 = 1
- time = 6
- create = 1
-
-/datum/manufacture/glass5
- name = "Glass Panel (x5)"
- item = /obj/item/stack/sheet/glass
- cost1 = /obj/item/weapon/ore/glass
- cname1 = "Glass"
- amount1 = 5
- time = 8
- create = 5
-
-/datum/manufacture/glassR
- name = "Reinforced Glass Panel"
- item = /obj/item/stack/sheet/rglass
- cost1 = /obj/item/weapon/ore/glass
- cname1 = "Glass"
- amount1 = 1
- cost2 = /obj/item/weapon/ore/iron
- cname2 = "Iron"
- amount2 = 1
- time = 12
- create = 1
-
-/datum/manufacture/atmos_can
- name = "Portable Gas Canister"
- item = /obj/machinery/portable_atmospherics/canister
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 5
- time = 10
- create = 1
-
-/*
-/datum/manufacture/cable
- name = "Electrical Cable Piece"
- item = /obj/item/stack/cable_coil/cut
- cost1 = /obj/item/weapon/ore/silver
- cname1 = "Silver"
- amount1 = 1
- time = 3
- create = 1
-*/
-/datum/manufacture/RCD
- name = "Rapid Construction Device"
- item = /obj/item/weapon/rcd
- cost1 = /obj/item/weapon/ore/gold
- cname1 = "Gold"
- amount1 = 5
- cost2 = /obj/item/weapon/ore/osmium
- cname2 = "Platinum"
- amount2 = 1
- cost3 = /obj/item/weapon/ore/silver
- cname3 = "Silver"
- amount3 = 10
- time = 90
- create = 1
-
-/datum/manufacture/RCDammo
- name = "Compressed Matter Cartridge"
- item = /obj/item/weapon/rcd_ammo
- cost1 = /obj/item/weapon/ore/osmium
- cname1 = "Platinum"
- amount1 = 1
- time = 15
- create = 1
-
-
-/******************** Robotics **************************/
-
-/datum/manufacture/robo_frame
- name = "Cyborg Frame"
- item = /obj/item/robot_parts/robot_suit
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 18
- time = 45
- create = 1
-
-/datum/manufacture/robo_chest
- name = "Cyborg Chest"
- item = /obj/item/robot_parts/chest
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 12
- time = 30
- create = 1
-
-/datum/manufacture/robo_head
- name = "Cyborg Head"
- item = /obj/item/robot_parts/head
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 12
- time = 30
- create = 1
-
-/datum/manufacture/robo_arm_r
- name = "Cyborg Arm (Right)"
- item = /obj/item/robot_parts/r_arm
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 6
- time = 15
- create = 1
-
-/datum/manufacture/robo_arm_l
- name = "Cyborg Arm (Left)"
- item = /obj/item/robot_parts/l_arm
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 6
- time = 15
- create = 1
-
-/datum/manufacture/robo_leg_r
- name = "Cyborg Leg (Right)"
- item = /obj/item/robot_parts/r_leg
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 6
- time = 15
- create = 1
-
-/datum/manufacture/robo_leg_l
- name = "Cyborg Leg (Left)"
- item = /obj/item/robot_parts/l_leg
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 6
- time = 15
- create = 1
-
-/datum/manufacture/robo_stmodule
- name = "Standard Cyborg Module"
- item = /obj/item/weapon/robot_module/standard
- cost1 = /obj/item/weapon/ore/silver
- cname1 = "Silver"
- amount1 = 2
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 3
- time = 40
- create = 1
-
-/datum/manufacture/scalpel
- name = "Scalpel"
- item = /obj/item/weapon/scalpel
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- time = 5
- create = 1
-
-/datum/manufacture/circular_saw
- name = "Circular Saw"
- item = /obj/item/weapon/circular_saw
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- time = 5
- create = 1
-
-/datum/manufacture/powercell
- name = "Power Cell"
- item = /obj/item/weapon/stock_parts/cell
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 4
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 4
- cost3 = /obj/item/weapon/ore/silver
- cname3 = "Silver"
- amount3 = 4
- time = 30
- create = 1
-
-/datum/manufacture/flash
- name = "Flash"
- item = /obj/item/device/flash
- cost1 = /obj/item/weapon/ore/glass
- cname1 = "Glass"
- amount1 = 2
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 2
- time = 15
- create = 1
-
-
-
-// Robotics Research
-
-/datum/manufacture/implanter
- name = "Implanter"
- item = /obj/item/weapon/implanter
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- time = 3
- create = 1
-
-/datum/manufacture/secbot
- name = "Security Drone"
- item = /obj/machinery/bot/secbot
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 10
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 5
- cost3 = /obj/item/weapon/ore/glass
- cname3 = "Glass"
- amount3 = 5
- time = 60
- create = 1
-
-/datum/manufacture/floorbot
- name = "Construction Drone"
- item = /obj/machinery/bot/floorbot
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 10
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 5
- cost3 = /obj/item/weapon/ore/glass
- cname3 = "Glass"
- amount3 = 5
- time = 60
- create = 1
-
-/datum/manufacture/medbot
- name = "Medical Drone"
- item = /obj/machinery/bot/medbot
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 10
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 5
- cost3 = /obj/item/weapon/ore/glass
- cname3 = "Glass"
- amount3 = 5
- time = 60
- create = 1
-/*
-/datum/manufacture/firebot
- name = "Firefighting Drone"
- item = /obj/machinery/bot/firebot
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 10
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 5
- cost3 = /obj/item/weapon/ore/glass
- cname3 = "Glass"
- amount3 = 5
- time = 60
- create = 1
-*/
-/datum/manufacture/cleanbot
- name = "Sanitation Drone"
- item = /obj/machinery/bot/cleanbot
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 10
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 5
- cost3 = /obj/item/weapon/ore/glass
- cname3 = "Glass"
- amount3 = 5
- time = 60
- create = 1
-/*
-/datum/manufacture/robup_jetpack
- name = "Propulsion Upgrade"
- item = /obj/item/weapon/roboupgrade/jetpack
- cost1 = /obj/item/weapon/ore/silver
- cname1 = "Silver"
- amount1 = 3
- cost2 = /obj/item/weapon/ore/iron
- cname2 = "Iron"
- amount2 = 5
- time = 60
- create = 1
-
-/datum/manufacture/robup_speed
- name = "Speed Upgrade"
- item = /obj/item/weapon/roboupgrade/speed
- cost1 = /obj/item/weapon/ore/silver
- cname1 = "Silver"
- amount1 = 3
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 5
- time = 60
- create = 1
-
-/datum/manufacture/robup_recharge
- name = "Recharge Pack"
- item = /obj/item/weapon/roboupgrade/rechargepack
- cost1 = /obj/item/weapon/ore/silver
- cname1 = "Silver"
- amount1 = 5
- time = 60
- create = 1
-
-/datum/manufacture/robup_repairpack
- name = "Repair Pack"
- item = /obj/item/weapon/roboupgrade/repairpack
- cost1 = /obj/item/weapon/ore/silver
- cname1 = "Silver"
- amount1 = 5
- time = 60
- create = 1
-
-/datum/manufacture/robup_physshield
- name = "Force Shield Upgrade"
- item = /obj/item/weapon/roboupgrade/physshield
- cost1 = /obj/item/weapon/ore/diamond
- cname1 = "Claretine"
- amount1 = 2
- cost2 = /obj/item/weapon/ore/iron
- cname2 = "Iron"
- amount2 = 10
- time = 90
- create = 1
-
-/datum/manufacture/robup_fireshield
- name = "Heat Shield Upgrade"
- item = /obj/item/weapon/roboupgrade/fireshield
- cost1 = /obj/item/weapon/ore/diamond
- cname1 = "Claretine"
- amount1 = 2
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 10
- time = 90
- create = 1
-
-/datum/manufacture/robup_aware
- name = "Operational Upgrade"
- item = /obj/item/weapon/roboupgrade/aware
- cost1 = /obj/item/weapon/ore/diamond
- cname1 = "Claretine"
- amount1 = 2
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 5
- cost3 = /obj/item/weapon/ore/silver
- cname3 = "Silver"
- amount3 = 5
- time = 90
- create = 1
-
-/datum/manufacture/robup_efficiency
- name = "Efficiency Upgrade"
- item = /obj/item/weapon/roboupgrade/efficiency
- cost1 = /obj/item/weapon/ore/osmium
- cname1 = "Platinum"
- amount1 = 3
- cost2 = /obj/item/weapon/ore/diamond
- cname2 = "Claretine"
- amount2 = 10
- time = 120
- create = 1
-
-/datum/manufacture/robup_repair
- name = "Self-Repair Upgrade"
- item = /obj/item/weapon/roboupgrade/repair
- cost1 = /obj/item/weapon/ore/osmium
- cname1 = "Platinum"
- amount1 = 3
- cost2 = /obj/item/weapon/ore/gold
- cname2 = "Gold"
- amount2 = 10
- time = 120
- create = 1
-
-/datum/manufacture/robup_teleport
- name = "Teleport Upgrade"
- item = /obj/item/weapon/roboupgrade/teleport
- cost1 = /obj/item/weapon/ore/osmium
- cname1 = "Platinum"
- amount1 = 3
- cost2 = /obj/item/weapon/ore/hydrogen
- cname2 = "Telecrystal"
- amount2 = 2
- time = 120
- create = 1
-
-/datum/manufacture/robup_expand
- name = "Expansion Upgrade"
- item = /obj/item/weapon/roboupgrade/expand
- cost1 = /obj/item/weapon/ore/osmium
- cname1 = "Platinum"
- amount1 = 3
- cost2 = /obj/item/weapon/ore/uranium
- cname2 = "Cerenkite"
- amount2 = 1
- time = 120
- create = 1
-
-/datum/manufacture/robup_chargexpand
- name = "Charge Expander Upgrade"
- item = /obj/item/weapon/roboupgrade/chargeexpand
- cost1 = /obj/item/weapon/ore/diamond
- cname1 = "Claretine"
- amount1 = 5
- time = 70
- create = 1
-
-/datum/manufacture/robup_meson
- name = "Optical Meson Upgrade"
- item = /obj/item/weapon/roboupgrade/opticmeson
- cost1 = /obj/item/weapon/ore/glass
- cname1 = "Glass"
- amount1 = 2
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 4
- time = 90
- create = 1
-
-/datum/manufacture/robup_thermal
- name = "Optical Thermal Upgrade"
- item = /obj/item/weapon/roboupgrade/opticthermal
- cost1 = /obj/item/weapon/ore/glass
- cname1 = "Glass"
- amount1 = 4
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 8
- time = 90
- create = 1
-
-/datum/manufacture/deafhs
- name = "Auditory Headset"
- item = /obj/item/device/radio/headset/deaf
- cost1 = /obj/item/weapon/ore/silver
- cname1 = "Silver"
- amount1 = 3
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 3
- time = 40
- create = 1
-
-/datum/manufacture/visor
- name = "VISOR Prosthesis"
- item = /obj/item/clothing/glasses/visor
- cost1 = /obj/item/weapon/ore/silver
- cname1 = "Silver"
- amount1 = 3
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 3
- time = 40
- create = 1
-
-/datum/manufacture/implant_robotalk
- name = "Machine Translator Implant"
- item = /obj/item/weapon/implantcase/robotalk
- cost1 = /obj/item/weapon/ore/silver
- cname1 = "Silver"
- amount1 = 3
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 3
- time = 40
- create = 1
-
-/datum/manufacture/implant_bloodmonitor
- name = "Blood Monitor Implant"
- item = /obj/item/weapon/implantcase/bloodmonitor
- cost1 = /obj/item/weapon/ore/silver
- cname1 = "Silver"
- amount1 = 3
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 3
- time = 40
- create = 1
-*/
\ No newline at end of file
diff --git a/code/modules/mining/materials.dm b/code/modules/mining/materials.dm
deleted file mode 100644
index 5c743bb4521..00000000000
--- a/code/modules/mining/materials.dm
+++ /dev/null
@@ -1,147 +0,0 @@
-/**
-* Materials system
-*
-* Replaces all of the horrible variables that tracked each individual thing.
-*/
-
-/**
-* MATERIALS DATUM
-*
-* Tracks and manages material storage for an object.
-*/
-/datum/materials
- var/list/datum/material/storage[0]
-
-/datum/materials/New()
- for(var/matdata in subtypesof(/datum/material))
- var/datum/material/mat = new matdata
- storage[mat.id]=mat
-
-/datum/materials/proc/addAmount(var/mat_id,var/amount)
- if(!(mat_id in storage))
- warning("addAmount(): Unknown material [mat_id]!")
- return
- // I HATE BYOND
- // storage[mat_id].stored++
- var/datum/material/mat=storage[mat_id]
- mat.stored += amount
- storage[mat_id]=mat
-
-/datum/materials/proc/removeAmount(var/mat_id,var/amount)
- if(!(mat_id in storage))
- warning("removeAmount(): Unknown material [mat_id]!")
- return
- addAmount(mat_id,-amount)
-
-/datum/materials/proc/getAmount(var/mat_id)
- if(!(mat_id in storage))
- warning("getAmount(): Unknown material [mat_id]!")
- return 0
-
- var/datum/material/mat=getMaterial(mat_id)
- return mat.stored
-
-/datum/materials/proc/getMaterial(var/mat_id)
- if(!(mat_id in storage))
- warning("getMaterial(): Unknown material [mat_id]!")
- return 0
-
- return storage[mat_id]
-
-
-/datum/material
- var/name=""
- var/processed_name=""
- var/id=""
- var/stored=0
- var/cc_per_sheet=CC_PER_SHEET_MISC
- var/oretype=null
- var/sheettype=null
- var/cointype=null
- var/value=0
-
-/datum/material/New()
- if(processed_name=="")
- processed_name=name
-
-/datum/material/iron
- name="Iron"
- id="iron"
- value=1
- cc_per_sheet=CC_PER_SHEET_METAL
- oretype=/obj/item/weapon/ore/iron
- sheettype=/obj/item/stack/sheet/metal
- cointype=/obj/item/weapon/coin/iron
-
-/datum/material/glass
- name="Sand"
- processed_name="Glass"
- id="glass"
- value=1
- cc_per_sheet=CC_PER_SHEET_GLASS
- oretype=/obj/item/weapon/ore/glass
- sheettype=/obj/item/stack/sheet/glass
-
-/datum/material/diamond
- name="Diamond"
- id="diamond"
- value=40
- oretype=/obj/item/weapon/ore/diamond
- sheettype=/obj/item/stack/sheet/mineral/diamond
- cointype=/obj/item/weapon/coin/diamond
-
-/datum/material/plasma
- name="Plasma"
- id="plasma"
- value=40
- oretype=/obj/item/weapon/ore/plasma
- sheettype=/obj/item/stack/sheet/mineral/plasma
- cointype=/obj/item/weapon/coin/plasma
-
-/datum/material/gold
- name="Gold"
- id="gold"
- value=20
- oretype=/obj/item/weapon/ore/gold
- sheettype=/obj/item/stack/sheet/mineral/gold
- cointype=/obj/item/weapon/coin/gold
-
-/datum/material/silver
- name="Silver"
- id="silver"
- value=20
- oretype=/obj/item/weapon/ore/silver
- sheettype=/obj/item/stack/sheet/mineral/silver
- cointype=/obj/item/weapon/coin/silver
-
-/datum/material/uranium
- name="Uranium"
- id="uranium"
- value=20
- oretype=/obj/item/weapon/ore/uranium
- sheettype=/obj/item/stack/sheet/mineral/uranium
- cointype=/obj/item/weapon/coin/uranium
-
-/datum/material/clown
- name="Bananium"
- id="clown"
- value=100
- oretype=/obj/item/weapon/ore/clown
- sheettype=/obj/item/stack/sheet/mineral/clown
- cointype=/obj/item/weapon/coin/clown
-
-/datum/material/plastic
- name="Plastic"
- id="plastic"
- value=1
- oretype=null
- sheettype=/obj/item/stack/sheet/mineral/plastic
- cointype=null
-
-/datum/material/fabric
- name="Fabric"
- id="fabric"
- value=20
- oretype=/obj/item/weapon/ore/fabric
- sheettype=null
- cointype=null
\ No newline at end of file
diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm
index f1f317789b4..e774ef23924 100644
--- a/code/modules/mining/mine_items.dm
+++ b/code/modules/mining/mine_items.dm
@@ -9,6 +9,27 @@
/**********************Miner Lockers**************************/
+/obj/structure/closet/wardrobe/miner
+ name = "mining wardrobe"
+ icon_state = "mixed"
+ icon_closed = "mixed"
+
+/obj/structure/closet/wardrobe/miner/New()
+ ..()
+ contents = list()
+ new /obj/item/weapon/storage/backpack/duffel(src)
+ new /obj/item/weapon/storage/backpack/industrial(src)
+ new /obj/item/weapon/storage/backpack/satchel_eng(src)
+ new /obj/item/clothing/under/rank/miner(src)
+ new /obj/item/clothing/under/rank/miner(src)
+ new /obj/item/clothing/under/rank/miner(src)
+ new /obj/item/clothing/shoes/workboots(src)
+ new /obj/item/clothing/shoes/workboots(src)
+ new /obj/item/clothing/shoes/workboots(src)
+ new /obj/item/clothing/gloves/fingerless(src)
+ new /obj/item/clothing/gloves/fingerless(src)
+ new /obj/item/clothing/gloves/fingerless(src)
+
/obj/structure/closet/secure_closet/miner
name = "miner's equipment"
icon_state = "miningsec1"
@@ -21,20 +42,11 @@
/obj/structure/closet/secure_closet/miner/New()
..()
- sleep(2)
- if(prob(50))
- new /obj/item/weapon/storage/backpack/industrial(src)
- else
- new /obj/item/weapon/storage/backpack/satchel_eng(src)
- new /obj/item/device/radio/headset/headset_cargo(src)
- new /obj/item/clothing/under/rank/miner(src)
- new /obj/item/clothing/gloves/fingerless(src)
- new /obj/item/clothing/shoes/black(src)
- new /obj/item/device/mining_scanner(src)
- new /obj/item/weapon/storage/bag/ore(src)
- new /obj/item/device/flashlight/lantern(src)
new /obj/item/weapon/shovel(src)
new /obj/item/weapon/pickaxe(src)
+ new /obj/item/device/radio/headset/headset_cargo/mining(src)
+ new /obj/item/device/t_scanner/adv_mining_scanner/lesser(src)
+ new /obj/item/weapon/storage/bag/ore(src)
new /obj/item/clothing/glasses/meson(src)
/**********************Shuttle Computer**************************/
@@ -65,7 +77,7 @@
force = 15.0
throwforce = 10.0
item_state = "pickaxe"
- w_class = 4.0
+ w_class = 4
materials = list(MAT_METAL=2000) //one sheet, but where can you make them?
var/digspeed = 40 //moving the delay to an item var so R&D can make improved picks. --NEO
origin_tech = "materials=1;engineering=1"
@@ -122,7 +134,7 @@
icon_state = "smdrill"
origin_tech = "materials=6;powerstorage=4;engineering=5;syndicate=3"
desc = "Microscopic supermatter crystals cover the head of this tiny drill."
- w_class = 2.0
+ w_class = 2
/obj/item/weapon/pickaxe/drill/cyborg/diamond //This is the BORG version!
name = "diamond-tipped cyborg mining drill" //To inherit the NODROP flag, and easier to change borg specific drill mechanics.
@@ -166,7 +178,7 @@
force = 8.0
throwforce = 4.0
item_state = "shovel"
- w_class = 3.0
+ w_class = 3
materials = list(MAT_METAL=50)
origin_tech = "materials=1;engineering=1"
attack_verb = list("bashed", "bludgeoned", "thrashed", "whacked")
@@ -178,7 +190,7 @@
item_state = "spade"
force = 5.0
throwforce = 7.0
- w_class = 2.0
+ w_class = 2
/**********************Mining car (Crate like thing, not the rail car)**************************/
@@ -199,7 +211,7 @@
desc = "It allows you to store and deploy lazarus-injected creatures easier."
icon = 'icons/obj/mobcap.dmi'
icon_state = "mobcap0"
- w_class = 1.0
+ w_class = 1
throw_range = 20
var/mob/living/simple_animal/captured = null
var/colorindex = 0
@@ -249,4 +261,50 @@
if(colorindex >= 6)
colorindex = 0
icon_state = "mobcap[colorindex]"
- update_icon()
\ No newline at end of file
+ update_icon()
+
+//Fans
+/obj/structure/fans
+ icon = 'icons/obj/lavaland/survival_pod.dmi'
+ icon_state = "fans"
+ name = "environmental regulation system"
+ desc = "A large machine releasing a constant gust of air."
+ anchored = 1
+ density = 1
+ var/arbitraryatmosblockingvar = 1
+ var/buildstacktype = /obj/item/stack/sheet/metal
+ var/buildstackamount = 5
+
+/obj/structure/fans/proc/deconstruct()
+ if(buildstacktype)
+ new buildstacktype(loc, buildstackamount)
+ qdel(src)
+
+/obj/structure/fans/attackby(obj/item/weapon/W, mob/user, params)
+ if(istype(W, /obj/item/weapon/wrench))
+ playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
+ user.visible_message("[user] disassembles the fan.", \
+ "You start to disassemble the fan...", "You hear clanking and banging noises.")
+ if(do_after(user, 20, target = src))
+ deconstruct()
+ return ..()
+
+/obj/structure/fans/tiny
+ name = "tiny fan"
+ desc = "A tiny fan, releasing a thin gust of air."
+ layer = TURF_LAYER+0.1
+ density = 0
+ icon_state = "fan_tiny"
+ buildstackamount = 2
+
+/obj/structure/fans/New(loc)
+ ..()
+ air_update_turf(1)
+
+/obj/structure/fans/Destroy()
+ arbitraryatmosblockingvar = 0
+ air_update_turf(1)
+ return ..()
+
+/obj/structure/fans/CanAtmosPass(turf/T)
+ return !arbitraryatmosblockingvar
\ No newline at end of file
diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm
index 41b994b31b6..a76dfa9a699 100644
--- a/code/modules/mining/mine_turfs.dm
+++ b/code/modules/mining/mine_turfs.dm
@@ -45,10 +45,10 @@ var/global/list/rockTurfEdgeCache = list(
..()
switch(severity)
if(3.0)
- if (prob(75))
+ if(prob(75))
src.gets_drilled(null, 1)
if(2.0)
- if (prob(90))
+ if(prob(90))
src.gets_drilled(null, 1)
if(1.0)
src.gets_drilled(null, 1)
@@ -58,7 +58,7 @@ var/global/list/rockTurfEdgeCache = list(
..()
mineral_turfs += src
- if (mineralType && mineralAmt && spread && spreadChance)
+ if(mineralType && mineralAmt && spread && spreadChance)
for(var/dir in cardinal)
if(prob(spreadChance))
var/turf/T = get_step(src, dir)
@@ -88,19 +88,19 @@ var/global/list/rockTurfEdgeCache = list(
var/turf/T
if((istype(get_step(src, NORTH), /turf/simulated/floor)) || (istype(get_step(src, NORTH), /turf/space)))
T = get_step(src, NORTH)
- if (T)
+ if(T)
T.overlays += rockTurfEdgeCache[SOUTH_EDGING]
if((istype(get_step(src, SOUTH), /turf/simulated/floor)) || (istype(get_step(src, SOUTH), /turf/space)))
T = get_step(src, SOUTH)
- if (T)
+ if(T)
T.overlays += rockTurfEdgeCache[NORTH_EDGING]
if((istype(get_step(src, EAST), /turf/simulated/floor)) || (istype(get_step(src, EAST), /turf/space)))
T = get_step(src, EAST)
- if (T)
+ if(T)
T.overlays += rockTurfEdgeCache[WEST_EDGING]
if((istype(get_step(src, WEST), /turf/simulated/floor)) || (istype(get_step(src, WEST), /turf/space)))
T = get_step(src, WEST)
- if (T)
+ if(T)
T.overlays += rockTurfEdgeCache[EAST_EDGING]
/turf/simulated/mineral/random
@@ -116,10 +116,10 @@ var/global/list/rockTurfEdgeCache = list(
/turf/simulated/mineral/random/New()
..()
- if (prob(mineralChance))
+ if(prob(mineralChance))
var/mName = pickweight(mineralSpawnChanceList) //temp mineral name
- if (mName)
+ if(mName)
var/turf/simulated/mineral/M
switch(mName)
if("Uranium")
@@ -367,13 +367,13 @@ var/global/list/rockTurfEdgeCache = list(
/turf/simulated/mineral/attackby(var/obj/item/weapon/pickaxe/P as obj, mob/user as mob, params)
- if (!user.IsAdvancedToolUser())
+ if(!user.IsAdvancedToolUser())
to_chat(usr, "You don't have the dexterity to do this!")
return
- if (istype(P, /obj/item/weapon/pickaxe))
+ if(istype(P, /obj/item/weapon/pickaxe))
var/turf/T = user.loc
- if (!( istype(T, /turf) ))
+ if(!( istype(T, /turf) ))
return
if(last_act+P.digspeed > world.time)//prevents message spam
@@ -393,9 +393,9 @@ var/global/list/rockTurfEdgeCache = list(
return
/turf/simulated/mineral/proc/gets_drilled()
- if (mineralType && (src.mineralAmt > 0) && (src.mineralAmt < 11))
+ if(mineralType && (src.mineralAmt > 0) && (src.mineralAmt < 11))
var/i
- for (i=0;iThis area has already been dug!")
return
to_chat(user, "You start digging...")
sleep(20)
- if ((user.loc == T && user.get_active_hand() == W))
+ if((user.loc == T && user.get_active_hand() == W))
to_chat(user, "You dig a hole.")
gets_dug()
return
- if ((istype(W, /obj/item/weapon/pickaxe)))
+ if((istype(W, /obj/item/weapon/pickaxe)))
var/obj/item/weapon/pickaxe/P = W
var/turf/T = user.loc
- if (!( istype(T, /turf) ))
+ if(!( istype(T, /turf) ))
return
- if (dug)
+ if(dug)
to_chat(user, "This area has already been dug!")
return
to_chat(user, "You start digging...")
sleep(P.digspeed)
- if ((user.loc == T && user.get_active_hand() == W))
+ if((user.loc == T && user.get_active_hand() == W))
to_chat(user, "You dig a hole.")
gets_dug()
return
@@ -557,7 +557,7 @@ var/global/list/rockTurfEdgeCache = list(
return
/turf/proc/fullUpdateMineralOverlays()
- for (var/turf/t in range(1,src))
+ for(var/turf/t in range(1,src))
t.updateMineralOverlays()
/turf/simulated/floor/plating/airless/asteroid/cave
diff --git a/code/modules/mining/minerals.dm b/code/modules/mining/minerals.dm
deleted file mode 100644
index 0cd46917858..00000000000
--- a/code/modules/mining/minerals.dm
+++ /dev/null
@@ -1,107 +0,0 @@
-var/list/name_to_mineral
-
-proc/SetupMinerals()
- name_to_mineral = list()
- for(var/type in subtypesof(/mineral))
- var/mineral/new_mineral = new type
- if(!new_mineral.name)
- continue
- name_to_mineral[new_mineral.name] = new_mineral
- return 1
-
-mineral
- ///What am I called?
- var/name
- var/display_name
- ///How much ore?
- var/result_amount
- ///Does this type of deposit spread?
- var/spread = 1
- ///Chance of spreading in any direction
- var/spread_chance
-
- ///Path to the resultant ore.
- var/ore
-
- New()
- . = ..()
- if(!display_name)
- display_name = name
-
- proc/UpdateTurf(var/turf/simulated/mineral/T)
- T.UpdateMineral()
-
-mineral/uranium
- name = "Uranium"
- result_amount = 5
- spread_chance = 10
- ore = /obj/item/weapon/ore/uranium
-
-mineral/iron
- name = "Iron"
- result_amount = 5
- spread_chance = 25
- ore = /obj/item/weapon/ore/iron
-
-mineral/diamond
- name = "Diamond"
- result_amount = 5
- spread_chance = 10
- ore = /obj/item/weapon/ore/diamond
-
-mineral/gold
- name = "Gold"
- result_amount = 5
- spread_chance = 10
- ore = /obj/item/weapon/ore/gold
-
-mineral/silver
- name = "Silver"
- result_amount = 5
- spread_chance = 10
- ore = /obj/item/weapon/ore/silver
-
-mineral/platinum
- name = "Platinum"
- result_amount = 5
- spread_chance = 10
- ore = /obj/item/weapon/ore/osmium
-
-mineral/plasma
- name = "Plasma"
- result_amount = 5
- spread_chance = 25
- ore = /obj/item/weapon/ore/plasma
-
-mineral/clown
- display_name = "Bananium"
- name = "Clown"
- result_amount = 3
- spread = 0
- ore = /obj/item/weapon/ore/clown
-
-mineral/coal
- name = "Coal"
- result_amount = 5
- spread_chance = 25
- ore = /obj/item/weapon/ore/coal
-
-mineral/hydrogen
- name = "Hydrogen"
- result_amount = 5
- spread_chance = 10
- ore = /obj/item/weapon/ore/coal
-
-
-mineral/cave
- display_name = "Cave"
- name = "Cave"
- result_amount = 1
- spread_chance = 10
- ore = null
- UpdateTurf(var/turf/T)
- if(!istype(T,/turf/simulated/floor/plating/airless/asteroid/cave))
- T.ChangeTurf(/turf/simulated/floor/plating/airless/asteroid/cave)
- else
- ..()
-
diff --git a/code/modules/mining/mining_recipes.dm b/code/modules/mining/mining_recipes.dm
deleted file mode 100644
index ebe28c4e083..00000000000
--- a/code/modules/mining/mining_recipes.dm
+++ /dev/null
@@ -1,252 +0,0 @@
-/obj/machinery/manufacturer/mining
- name = "Mining Fabricator"
- desc = "A manufacturing unit calibrated to produce mining related equipment."
- acceptdisk = 1
-
- New()
- ..()
- src.available += new /datum/manufacture/pick(src)
- src.available += new /datum/manufacture/shovel(src)
- src.available += new /datum/manufacture/oresatchel(src)
- src.available += new /datum/manufacture/breathmask(src)
- src.available += new /datum/manufacture/spacesuit(src)
- src.available += new /datum/manufacture/spacehelm(src)
- src.available += new /datum/manufacture/eyes_meson(src)
- src.hidden += new /datum/manufacture/RCD(src)
- src.hidden += new /datum/manufacture/RCDammo(src)
-
-
-// Mining Gear
-/datum/manufacture/pick
- name = "Pickaxe"
- item = /obj/item/weapon/pickaxe
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 5
- time = 5
- create = 1
-
-/datum/manufacture/shovel
- name = "Shovel"
- item = /obj/item/weapon/shovel
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 3
- time = 2
- create = 1
-
-/datum/manufacture/spick
- name = "Silver Pickaxe"
- item = /obj/item/weapon/pickaxe/silver
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 5
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 5
- time = 10
- create = 1
-
-/datum/manufacture/gpick
- name = "Gold Pickaxe"
- item = /obj/item/weapon/pickaxe/gold
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 5
- cost2 = /obj/item/weapon/ore/gold
- cname2 = "Gold"
- amount2 = 5
- time = 15
- create = 1
-
-/datum/manufacture/dpick
- name = "Diamond Pickaxe"
- item = /obj/item/weapon/pickaxe/diamond
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 5
- cost2 = /obj/item/weapon/ore/diamond
- cname2 = "Uranium"
- amount2 = 5
- time = 30
- create = 1
-
-/datum/manufacture/jackhammer
- name = "Sonic Jackhammer"
- item = /obj/item/weapon/pickaxe/jackhammer
- cost1 = /obj/item/weapon/ore/gold
- cname1 = "Gold"
- amount1 = 8
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 12
- time = 30
- create = 1
-
-/datum/manufacture/drill
- name = "Hand Drill"
- item = /obj/item/weapon/pickaxe/drill
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 15
- time = 20
- create = 1
-
-/datum/manufacture/diamonddrill
- name = "Diamond Drill"
- item = /obj/item/weapon/pickaxe/diamonddrill
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 15
- cost2 = /obj/item/weapon/ore/diamond
- cname2 = "Diamond"
- amount2 = 15
- cost3 = /obj/item/weapon/ore/silver
- cname3 = "Silver"
- amount3 = 15
- time = 40
- create = 1
-
-/datum/manufacture/cutter
- name = "Plasma Cutter"
- item = /obj/item/weapon/pickaxe/plasmacutter
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 10
- cost2 = /obj/item/weapon/ore/gold
- cname2 = "Gold"
- amount2 = 10
- cost3 = /obj/item/weapon/ore/plasma
- cname3 = "Plasma"
- amount3 = 15
- time = 30
- create = 1
-
-/datum/manufacture/eyes_meson
- name = "Optical Meson Scanner"
- item = /obj/item/clothing/glasses/meson
- cost1 = /obj/item/weapon/ore/glass
- cname1 = "Glass"
- amount1 = 5
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 3
- time = 10
- create = 1
-
-/datum/manufacture/miningsuit
- name = "Mining Hardsuit"
- item = /obj/item/clothing/suit/space/rig/mining
- cost1 = /obj/item/weapon/ore/osmium
- cname1 = "Platinum"
- amount1 = 30
- cost2 = /obj/item/weapon/ore/iron
- cname2 = "Iron"
- amount2 = 30
- time = 30
- create = 1
-
-/datum/manufacture/mininghelm
- name = "Mining Hardsuit Helmet"
- item = /obj/item/clothing/head/helmet/space/rig/mining
- cost1 = /obj/item/weapon/ore/osmium
- cname1 = "Platinum"
- amount1 = 30
- cost2 = /obj/item/weapon/ore/iron
- cname2 = "Iron"
- amount2 = 30
- time = 20
- create = 1
-
-/datum/manufacture/breathmask
- name = "Breath Mask"
- item = /obj/item/clothing/mask/breath
- cost1 = /obj/item/weapon/ore/fabric
- cname1 = "Fabric"
- amount1 = 1
- time = 5
- create = 1
-
-/datum/manufacture/spacesuit
- name = "Space Suit"
- item = /obj/item/clothing/suit/space
- cost1 = /obj/item/weapon/ore/fabric
- cname1 = "Fabric"
- amount1 = 5
- cost2 = /obj/item/weapon/ore/iron
- cname2 = "Iron"
- amount2 = 5
- time = 15
- create = 1
-
-/datum/manufacture/spacehelm
- name = "Space Helmet"
- item = /obj/item/clothing/head/helmet/space
- cost1 = /obj/item/weapon/ore/fabric
- cname1 = "Fabric"
- amount1 = 5
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 5
- time = 10
- create = 1
-
-/datum/manufacture/oresatchel
- name = "Ore Satchel"
- item = /obj/item/weapon/storage/bag/ore
- cost1 = /obj/item/weapon/ore/fabric
- cname1 = "Fabric"
- amount1 = 5
- time = 5
- create = 1
-
-/datum/manufacture/jetpack
- name = "Jetpack"
- item = /obj/item/weapon/tank/jetpack
- cost1 = /obj/item/weapon/ore/gold
- cname1 = "Gold"
- amount1 = 15
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 20
- time = 30
- create = 1
-
-//Diskettes!
-/obj/item/weapon/disk/data/schematic/mining1
- name = "Mining Schematics Level 1"
- desc = "Contains the schematics for a new range of Pickaxes."
-
- New()
- src.schematics += new /datum/manufacture/spick(src)
- src.schematics += new /datum/manufacture/gpick(src)
- src.schematics += new /datum/manufacture/dpick(src)
-
-/obj/item/weapon/disk/data/schematic/mining2
- name = "Mining Schematics Level 2"
- desc = "Contains the schematics for a new line of drills. And a Plasma Cutter. Has the previous level as well."
-
- New()
- src.schematics += new /datum/manufacture/spick(src)
- src.schematics += new /datum/manufacture/gpick(src)
- src.schematics += new /datum/manufacture/dpick(src)
- src.schematics += new /datum/manufacture/drill(src)
- src.schematics += new /datum/manufacture/jackhammer(src)
- src.schematics += new /datum/manufacture/diamonddrill(src)
- src.schematics += new /datum/manufacture/cutter(src)
-
-/obj/item/weapon/disk/data/schematic/mining3
- name = "Mining Schematics Level 3"
- desc = "Contains the schematics for a new type of Spacesuit, and schematics for a Jetpack. Has the previous levels as well."
-
- New()
- src.schematics += new /datum/manufacture/spick(src)
- src.schematics += new /datum/manufacture/gpick(src)
- src.schematics += new /datum/manufacture/dpick(src)
- src.schematics += new /datum/manufacture/drill(src)
- src.schematics += new /datum/manufacture/jackhammer(src)
- src.schematics += new /datum/manufacture/diamonddrill(src)
- src.schematics += new /datum/manufacture/cutter(src)
- src.schematics += new /datum/manufacture/miningsuit(src)
- src.schematics += new /datum/manufacture/mininghelm(src)
- src.schematics += new /datum/manufacture/jetpack(src)
\ No newline at end of file
diff --git a/code/modules/mining/mint.dm b/code/modules/mining/mint.dm
index be34465c207..02b69a160d7 100644
--- a/code/modules/mining/mint.dm
+++ b/code/modules/mining/mint.dm
@@ -26,28 +26,28 @@
var/turf/T = get_step(src,input_dir)
if(T)
for(var/obj/item/stack/sheet/O in T)
- if (istype(O, /obj/item/stack/sheet/mineral/gold))
+ if(istype(O, /obj/item/stack/sheet/mineral/gold))
amt_gold += 100 * O.amount
O.loc = null
- if (istype(O, /obj/item/stack/sheet/mineral/silver))
+ if(istype(O, /obj/item/stack/sheet/mineral/silver))
amt_silver += 100 * O.amount
O.loc = null
- if (istype(O, /obj/item/stack/sheet/mineral/diamond))
+ if(istype(O, /obj/item/stack/sheet/mineral/diamond))
amt_diamond += 100 * O.amount
O.loc = null
- if (istype(O, /obj/item/stack/sheet/mineral/plasma))
+ if(istype(O, /obj/item/stack/sheet/mineral/plasma))
amt_plasma += 100 * O.amount
O.loc = null
- if (istype(O, /obj/item/stack/sheet/mineral/uranium))
+ if(istype(O, /obj/item/stack/sheet/mineral/uranium))
amt_uranium += 100 * O.amount
O.loc = null
- if (istype(O, /obj/item/stack/sheet/metal))
+ if(istype(O, /obj/item/stack/sheet/metal))
amt_iron += 100 * O.amount
O.loc = null
- if (istype(O, /obj/item/stack/sheet/mineral/bananium))
+ if(istype(O, /obj/item/stack/sheet/mineral/bananium))
amt_clown += 100 * O.amount
O.loc = null
- if (istype(O, /obj/item/stack/sheet/mineral/tranquillite))
+ if(istype(O, /obj/item/stack/sheet/mineral/tranquillite))
amt_mime += 100 * O.amount
O.loc = null
return
@@ -58,49 +58,49 @@
var/dat = "Coin Press "
dat += text(" Gold inserted: [amt_gold] ")
- if (chosen == "gold")
+ if(chosen == "gold")
dat += text("chosen")
else
dat += text("Choose")
dat += text(" Silver inserted: [amt_silver] ")
- if (chosen == "silver")
+ if(chosen == "silver")
dat += text("chosen")
else
dat += text("Choose")
dat += text(" Iron inserted: [amt_iron] ")
- if (chosen == "metal")
+ if(chosen == "metal")
dat += text("chosen")
else
dat += text("Choose")
dat += text(" Diamond inserted: [amt_diamond] ")
- if (chosen == "diamond")
+ if(chosen == "diamond")
dat += text("chosen")
else
dat += text("Choose")
dat += text(" Plasma inserted: [amt_plasma] ")
- if (chosen == "plasma")
+ if(chosen == "plasma")
dat += text("chosen")
else
dat += text("Choose")
dat += text(" Uranium inserted: [amt_uranium] ")
- if (chosen == "uranium")
+ if(chosen == "uranium")
dat += text("chosen")
else
dat += text("Choose")
if(amt_clown > 0)
dat += text(" Bananium inserted: [amt_clown] ")
- if (chosen == "clown")
+ if(chosen == "clown")
dat += text("chosen")
else
dat += text("Choose")
if(amt_mime > 0)
dat += text(" Tranquillite inserted: [amt_mime] ")
- if (chosen == "mime")
+ if(chosen == "mime")
dat += text("chosen")
else
dat += text("Choose")
dat += text(" Adamantine inserted: [amt_adamantine] ")//I don't even know these color codes, so fuck it.
- if (chosen == "adamantine")
+ if(chosen == "adamantine")
dat += text("chosen")
else
dat += text("Choose")
diff --git a/code/modules/mining/money_bag.dm b/code/modules/mining/money_bag.dm
index a7a7b4b10df..4a2acd645df 100644
--- a/code/modules/mining/money_bag.dm
+++ b/code/modules/mining/money_bag.dm
@@ -7,7 +7,9 @@
flags = CONDUCT
force = 10.0
throwforce = 0
- w_class = 4.0
+ burn_state = FLAMMABLE
+ burntime = 20
+ w_class = 4
/obj/item/weapon/moneybag/attack_hand(user as mob)
var/amt_gold = 0
@@ -20,58 +22,58 @@
var/amt_mime = 0
var/amt_adamantine = 0
- for (var/obj/item/weapon/coin/C in contents)
- if (istype(C,/obj/item/weapon/coin/diamond))
+ for(var/obj/item/weapon/coin/C in contents)
+ if(istype(C,/obj/item/weapon/coin/diamond))
amt_diamond++
- if (istype(C,/obj/item/weapon/coin/plasma))
+ if(istype(C,/obj/item/weapon/coin/plasma))
amt_plasma++
- if (istype(C,/obj/item/weapon/coin/iron))
+ if(istype(C,/obj/item/weapon/coin/iron))
amt_iron++
- if (istype(C,/obj/item/weapon/coin/silver))
+ if(istype(C,/obj/item/weapon/coin/silver))
amt_silver++
- if (istype(C,/obj/item/weapon/coin/gold))
+ if(istype(C,/obj/item/weapon/coin/gold))
amt_gold++
- if (istype(C,/obj/item/weapon/coin/uranium))
+ if(istype(C,/obj/item/weapon/coin/uranium))
amt_uranium++
- if (istype(C,/obj/item/weapon/coin/clown))
+ if(istype(C,/obj/item/weapon/coin/clown))
amt_clown++
- if (istype(C,/obj/item/weapon/coin/mime))
+ if(istype(C,/obj/item/weapon/coin/mime))
amt_mime++
- if (istype(C,/obj/item/weapon/coin/adamantine))
+ if(istype(C,/obj/item/weapon/coin/adamantine))
amt_adamantine++
var/dat = text("The contents of the moneybag reveal... ")
- if (amt_gold)
+ if(amt_gold)
dat += text("Gold coins: [amt_gold] Remove one ")
- if (amt_silver)
+ if(amt_silver)
dat += text("Silver coins: [amt_silver] Remove one ")
- if (amt_iron)
+ if(amt_iron)
dat += text("Metal coins: [amt_iron] Remove one ")
- if (amt_diamond)
+ if(amt_diamond)
dat += text("Diamond coins: [amt_diamond] Remove one ")
- if (amt_plasma)
+ if(amt_plasma)
dat += text("Plasma coins: [amt_plasma] Remove one ")
- if (amt_uranium)
+ if(amt_uranium)
dat += text("Uranium coins: [amt_uranium] Remove one ")
- if (amt_clown)
+ if(amt_clown)
dat += text("Bananium coins: [amt_clown] Remove one ")
- if (amt_mime)
+ if(amt_mime)
dat += text("Tranquillite coins: [amt_mime] Remove one ")
- if (amt_adamantine)
+ if(amt_adamantine)
dat += text("Adamantine coins: [amt_adamantine] Remove one ")
user << browse("[dat]", "window=moneybag")
/obj/item/weapon/moneybag/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
..()
- if (istype(W, /obj/item/weapon/coin))
+ if(istype(W, /obj/item/weapon/coin))
var/obj/item/weapon/coin/C = W
if(!user.drop_item())
return
to_chat(user, "You add the [C.name] into the bag.")
contents += C
- if (istype(W, /obj/item/weapon/moneybag))
+ if(istype(W, /obj/item/weapon/moneybag))
var/obj/item/weapon/moneybag/C = W
- for (var/obj/O in C.contents)
+ for(var/obj/O in C.contents)
contents += O;
to_chat(user, "You empty the [C.name] into the bag.")
return
diff --git a/code/modules/mining/ore.dm b/code/modules/mining/ore.dm
index f5e0f2349be..2a6f5555555 100644
--- a/code/modules/mining/ore.dm
+++ b/code/modules/mining/ore.dm
@@ -240,6 +240,7 @@
/obj/item/weapon/ore/New()
pixel_x = rand(0,16)-8
pixel_y = rand(0,8)-8
+ // TODO: Tie into space manager
if(src.z == ZLEVEL_ASTEROID)
score_oremined++ //When ore spawns, increment score. Only include ore spawned on mining asteroid (No Clown Planet)
diff --git a/code/modules/mining/ore_datum.dm b/code/modules/mining/ore_datum.dm
deleted file mode 100644
index 9927b6e5b85..00000000000
--- a/code/modules/mining/ore_datum.dm
+++ /dev/null
@@ -1,55 +0,0 @@
-/datum/ore
- var/oretag
- var/alloy
- var/smelts_to
- var/compresses_to
-
-/datum/ore/uranium
- smelts_to = /obj/item/stack/sheet/mineral/uranium
- oretag = "uranium"
-
-/datum/ore/iron
- smelts_to = /obj/item/stack/sheet/mineral/iron
- alloy = 1
- oretag = "hematite"
-
-/datum/ore/coal
- smelts_to = /obj/item/stack/sheet/mineral/plastic
- alloy = 1
- oretag = "coal"
-
-/datum/ore/glass
- smelts_to = /obj/item/stack/sheet/glass
- compresses_to = /obj/item/stack/sheet/mineral/sandstone
- oretag = "sand"
-
-/datum/ore/plasma
- smelts_to = /obj/item/stack/sheet/mineral/plasma
- oretag = "plasma"
-
-/datum/ore/silver
- smelts_to = /obj/item/stack/sheet/mineral/silver
- oretag = "silver"
-
-/datum/ore/gold
- smelts_to = /obj/item/stack/sheet/mineral/gold
- oretag = "gold"
-
-/datum/ore/diamond
- compresses_to = /obj/item/stack/sheet/mineral/diamond
- oretag = "diamond"
-
-/datum/ore/osmium
- smelts_to = /obj/item/stack/sheet/mineral/platinum
- compresses_to = /obj/item/stack/sheet/mineral/osmium
- alloy = 1
- oretag = "platinum"
-
-/datum/ore/hydrogen
- smelts_to = /obj/item/stack/sheet/mineral/tritium
- compresses_to = /obj/item/stack/sheet/mineral/mhydrogen
- oretag = "hydrogen"
-
-/datum/ore/clown
- smelts_to = /obj/item/stack/sheet/mineral/clown
- oretag = "clown"
\ No newline at end of file
diff --git a/code/modules/mining/satchel_ore_boxdm.dm b/code/modules/mining/satchel_ore_boxdm.dm
index 7d6750c4be4..bf4a615c2e9 100644
--- a/code/modules/mining/satchel_ore_boxdm.dm
+++ b/code/modules/mining/satchel_ore_boxdm.dm
@@ -10,11 +10,11 @@
pressure_resistance = 5*ONE_ATMOSPHERE
/obj/structure/ore_box/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
- if (istype(W, /obj/item/weapon/ore))
+ if(istype(W, /obj/item/weapon/ore))
if(!user.drop_item())
return
W.loc = src
- if (istype(W, /obj/item/weapon/storage))
+ if(istype(W, /obj/item/weapon/storage))
var/obj/item/weapon/storage/S = W
S.hide_from(usr)
for(var/obj/item/weapon/ore/O in S.contents)
@@ -34,52 +34,54 @@
var/amt_mime = 0
var/amt_bluespace = 0
- for (var/obj/item/weapon/ore/C in contents)
- if (istype(C,/obj/item/weapon/ore/diamond))
+ for(var/obj/item/weapon/ore/C in contents)
+ if(istype(C,/obj/item/weapon/ore/diamond))
amt_diamond++
- if (istype(C,/obj/item/weapon/ore/glass))
+ if(istype(C,/obj/item/weapon/ore/glass))
amt_glass++
- if (istype(C,/obj/item/weapon/ore/plasma))
+ if(istype(C,/obj/item/weapon/ore/plasma))
amt_plasma++
- if (istype(C,/obj/item/weapon/ore/iron))
+ if(istype(C,/obj/item/weapon/ore/iron))
amt_iron++
- if (istype(C,/obj/item/weapon/ore/silver))
+ if(istype(C,/obj/item/weapon/ore/silver))
amt_silver++
- if (istype(C,/obj/item/weapon/ore/gold))
+ if(istype(C,/obj/item/weapon/ore/gold))
amt_gold++
- if (istype(C,/obj/item/weapon/ore/uranium))
+ if(istype(C,/obj/item/weapon/ore/uranium))
amt_uranium++
- if (istype(C,/obj/item/weapon/ore/bananium))
+ if(istype(C,/obj/item/weapon/ore/bananium))
amt_clown++
- if (istype(C,/obj/item/weapon/ore/tranquillite))
+ if(istype(C,/obj/item/weapon/ore/tranquillite))
amt_mime++
- if (istype(C,/obj/item/weapon/ore/bluespace_crystal))
+ if(istype(C,/obj/item/weapon/ore/bluespace_crystal))
amt_bluespace++
var/dat = text("The contents of the ore box reveal... ")
- if (amt_gold)
+ if(amt_gold)
dat += text("Gold ore: [amt_gold] ")
- if (amt_silver)
+ if(amt_silver)
dat += text("Silver ore: [amt_silver] ")
- if (amt_iron)
+ if(amt_iron)
dat += text("Metal ore: [amt_iron] ")
- if (amt_glass)
+ if(amt_glass)
dat += text("Sand: [amt_glass] ")
- if (amt_diamond)
+ if(amt_diamond)
dat += text("Diamond ore: [amt_diamond] ")
- if (amt_plasma)
+ if(amt_plasma)
dat += text("Plasma ore: [amt_plasma] ")
- if (amt_uranium)
+ if(amt_uranium)
dat += text("Uranium ore: [amt_uranium] ")
- if (amt_clown)
+ if(amt_clown)
dat += text("Bananium ore: [amt_clown] ")
- if (amt_mime)
+ if(amt_mime)
dat += text("Tranquillite ore: [amt_mime] ")
- if (amt_bluespace)
+ if(amt_bluespace)
dat += text("Bluespace crystals: [amt_bluespace] ")
dat += text("
Empty box")
- user << browse("[dat]", "window=orebox")
+ var/datum/browser/popup = new(user, "orebox", name, 400, 400)
+ popup.set_content(dat)
+ popup.open(0)
return
/obj/structure/ore_box/Topic(href, href_list)
@@ -88,7 +90,7 @@
usr.set_machine(src)
src.add_fingerprint(usr)
if(href_list["removeall"])
- for (var/obj/item/weapon/ore/O in contents)
+ for(var/obj/item/weapon/ore/O in contents)
contents -= O
O.loc = src.loc
to_chat(usr, "You empty the box.")
@@ -122,7 +124,7 @@ obj/structure/ore_box/ex_act(severity, target)
to_chat(usr, "The ore box is empty.")
return
- for (var/obj/item/weapon/ore/O in contents)
+ for(var/obj/item/weapon/ore/O in contents)
contents -= O
O.loc = src.loc
to_chat(usr, "You empty the ore box.")
diff --git a/code/modules/mining/security_recipes.dm b/code/modules/mining/security_recipes.dm
deleted file mode 100644
index f08addbf4a0..00000000000
--- a/code/modules/mining/security_recipes.dm
+++ /dev/null
@@ -1,128 +0,0 @@
-/obj/machinery/manufacturer/security
- name = "Security Fabricator"
- desc = "A manufacturing unit calibrated to produce security and military related equipment."
- acceptdisk = 1
-
- New()
- ..()
- src.available += new /datum/manufacture/beret(src)
- src.available += new /datum/manufacture/helmet1(src)
- src.available += new /datum/manufacture/sunglasses(src)
- src.available += new /datum/manufacture/sechud(src)
- src.available += new /datum/manufacture/secpants(src)
- src.available += new /datum/manufacture/secbelt(src)
- src.available += new /datum/manufacture/armor1(src)
- src.available += new /datum/manufacture/taser(src)
- src.available += new /datum/manufacture/baton(src)
-
-// Security Gear Tier-0. AKA Clothing and basic as shit gear.
-/datum/manufacture/beret
- name = "Beret"
- item = /obj/item/clothing/head/beret/sec
- cost1 = /obj/item/weapon/ore/fabric
- cname1 = "Fabric"
- amount1 = 2
- time = 3
- create = 1
-
-/datum/manufacture/helmet1
- name = "Helmet"
- item = /obj/item/clothing/head/helmet
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 10
- cost2 = /obj/item/weapon/ore/fabric
- cname2 = "Fabric"
- amount2 = 10
- time = 10
- create = 1
-
-/datum/manufacture/sunglasses
- name = "Sunglasses"
- item = /obj/item/clothing/glasses/sunglasses
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 5
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 10
- time = 8
- create = 1
-
-/datum/manufacture/sechud
- name = "Security HUD"
- item = /obj/item/clothing/glasses/hud/security
- cost1 = /obj/item/weapon/ore/osmium
- cname1 = "Platinum"
- amount1 = 10
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 15
- time = 12
- create = 1
-
-/datum/manufacture/secpants
- name = "Security Uniform"
- item = /obj/item/clothing/under/rank/security
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 2
- cost2 = /obj/item/weapon/ore/fabric
- cname2 = "Fabric"
- amount2 = 1
- time = 10
- create = 1
-
-/datum/manufacture/secbelt
- name = "Security Belt"
- item = /obj/item/weapon/storage/belt/security
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 2
- cost2 = /obj/item/weapon/ore/fabric
- cname2 = "Fabric"
- amount2 = 5
- time = 15
- create = 1
-
-/datum/manufacture/armor1
- name = "Armored Vest"
- item = /obj/item/clothing/suit/armor/vest
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 15
- cost2 = /obj/item/weapon/ore/fabric
- cname2 = "Fabric"
- amount2 = 15
- time = 20
- create = 1
-
-/datum/manufacture/taser
- name = "Advanced Taser"
- item = /obj/item/weapon/gun/energy/advtaser
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 15
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 10
- cost3 = /obj/item/weapon/ore/osmium
- cname3 = "Platinum"
- amount3 = 20
- time = 25
- create = 1
-
-/datum/manufacture/baton
- name = "Stun Baton"
- item = /obj/item/weapon/melee/baton
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 10
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 10
- cost3 = /obj/item/weapon/ore/osmium
- cname3 = "Platinum"
- amount3 = 15
- time = 20
- create = 1
\ No newline at end of file
diff --git a/code/modules/mining/surprise.dm b/code/modules/mining/surprise.dm
deleted file mode 100644
index 48ecbdd5356..00000000000
--- a/code/modules/mining/surprise.dm
+++ /dev/null
@@ -1,342 +0,0 @@
-#define CONTIGUOUS_WALLS 1
-#define CONTIGUOUS_FLOORS 2
-
-#define TURF_FLOOR 0
-#define TURF_WALL 1
-var/global/list/mining_surprises = subtypesof(/mining_surprise)
-
-/surprise_turf_info
- var/list/types[0]
- var/list/adjacents
- var/turf_type=TURF_FLOOR
-
- New()
- adjacents=list(
- "[NORTH]"=list(),
- "[SOUTH]"=list(),
- "[EAST]"=list(),
- "[WEST]"=list()
- )
-
- proc/GetAdjacentTypes(var/dir)
- return adjacents["[dir]"]
-
-/surprise_room
- var/list/turfs[0]
-
- // Used for layout system.
- var/list/turf_info[0]
-
- var/size_x=0
- var/size_y=0
-
- proc/UpdateTurfs()
- for(var/turf/T in turfs)
- UpdateTurf(T)
-
- proc/GetTurfs(var/ttype)
- var/list/selected[0]
- for(var/turf/T in turfs)
- var/surprise_turf_info/Ti = GetTurfInfo(T)
- if(Ti.turf_type==ttype)
- selected |= T
- return selected
-
- proc/GetTurfInfo(var/turf/T)
- var/surprise_turf_info/sti
- if(!(T in turf_info))
- sti = new
- turf_info[T]=sti
- else
- sti = turf_info[T]
- return sti
-
- proc/UpdateTurf(var/turf/T, var/no_adjacent=0)
- // List types in this turf.
- var/surprise_turf_info/sti = GetTurfInfo(T)
-
- sti.types=0
- for(var/atom/A in T.contents)
- sti.types |= A.type
-
- if(no_adjacent) return
- UpdateAdjacentsOfTurf(T)
-
- proc/AddTypeToTurf(var/turf/T, var/newtype)
- var/surprise_turf_info/sti = GetTurfInfo(T)
- sti.types |= newtype
-
- //UpdateAdjacentsOfTurf(T)
-
- proc/UpdateAdjacentsOfTurf(var/turf/T)
- var/surprise_turf_info/Ti = turf_info[T]
- for(var/dir in cardinal)
- var/turf/AT = get_step(T,dir)
- if(!(AT in turfs))
- return
- if(!(AT in turf_info))
- UpdateTurf(AT, no_adjacent=1)
- var/surprise_turf_info/ATi = turf_info[AT]
- // By-Ref so shit gets updated.
- ATi.adjacents["[reverse_direction(dir)]"]=Ti.types
-
-
-// For room layouts.
-/layout_rule
- var/mining_surprise/root
- var/surprise_room/room
-
- // What to place if true
- var/placetype=null
-
- var/min_to_place=5 // Force placement at ALL candidates.
- var/max_to_place=10 // 0 = max amount of ALL candidates.
-
- var/placed_times=0
-
- var/list/decorations=list() // types, empty for no decorations
-
- var/flags = 0
-
- New(var/mining_surprise/_root,var/surprise_room/_room)
- root=_root
- room=_room
-
- // Called in Evaluate
- proc/Plop(var/turf/T)
- new placetype(T)
- placed_times++
- room.AddTypeToTurf(T,placetype)
- if(decorations.len)
- var/decoration = pickweight(decorations)
- new decoration(T)
- room.AddTypeToTurf(T,decoration)
-
- // Return 1 if we Plop()'d something.
- // Return 0 if we didn't or something went wrong.
- proc/Evaluate()
- var/list/candidates=GetCandidates()
- if(candidates.len==0)
- return 0
- if(max_to_place<=0)
- max_to_place=candidates.len
- var/n=candidates.len
- if(min_to_place>0)
- n = min(candidates.len,rand(min_to_place,max_to_place))
- if(n==0)
- return 0
- for(var/i=0;i0)
- var/turf/weed_turf = pick(w_cand)
- w_cand -= weed_turf
- if(weed_turf.density)
- continue
- if(locate(/obj/structure/alien) in weed_turf)
- continue
- if(weed_turf && !egged)
- new /obj/structure/alien/weeds/node(weed_turf)
- weeds += weed_turf
- break
-
- for(var/e=0;e(Click to re-enter)")
if(sound)
- to_chat(src, sound(sound))
+ src << sound(sound)
/mob/dead/observer/proc/show_me_the_hud(hud_index)
var/datum/atom_hud/H = huds[hud_index]
@@ -368,6 +396,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(!target)
return
+ if(!get_turf(target))
+ return
+
if(target != src)
if(following && following == target)
return
@@ -417,7 +448,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(istype(usr, /mob/dead/observer)) //Make sure they're an observer!
- if (!target)//Make sure we actually have a target
+ if(!target)//Make sure we actually have a target
return
else
var/mob/M = getmobs()[target] //Destination mob
@@ -460,7 +491,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(!istype(usr, /mob/dead/observer)) return
// Shamelessly copied from the Gas Analyzers
- if (!( istype(usr.loc, /turf) ))
+ if(!( istype(usr.loc, /turf) ))
return
var/datum/gas_mixture/environment = usr.loc.return_air()
@@ -517,8 +548,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
//this is called when a ghost is drag clicked to something.
/mob/dead/observer/MouseDrop(atom/over)
if(!usr || !over) return
- if (isobserver(usr) && usr.client && usr.client.holder)
- if (usr.client.holder.cmd_ghost_drag(src,over))
+ if(isobserver(usr) && usr.client && usr.client.holder)
+ if(usr.client.holder.cmd_ghost_drag(src,over))
return
return ..()
@@ -546,17 +577,17 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
return
..()
- if (href_list["track"])
+ if(href_list["track"])
var/atom/target = locate(href_list["track"])
if(target)
ManualFollow(target)
- if (href_list["follow"])
+ if(href_list["follow"])
var/atom/target = locate(href_list["follow"])
if(target)
ManualFollow(target)
- if (href_list["jump"])
+ if(href_list["jump"])
var/mob/target = locate(href_list["jump"])
var/mob/A = usr;
to_chat(A, "Teleporting to [target]...")
@@ -605,27 +636,27 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
updateghostsight()
/mob/dead/observer/proc/updateghostsight()
- if (!seedarkness)
+ if(!seedarkness)
see_invisible = SEE_INVISIBLE_OBSERVER_NOLIGHTING
else
see_invisible = SEE_INVISIBLE_OBSERVER
- if (!ghostvision)
+ if(!ghostvision)
see_invisible = SEE_INVISIBLE_LIVING;
updateghostimages()
/proc/updateallghostimages()
- for (var/mob/dead/observer/O in player_list)
+ for(var/mob/dead/observer/O in player_list)
O.updateghostimages()
/mob/dead/observer/proc/updateghostimages()
- if (!client)
+ if(!client)
return
- if (seedarkness || !ghostvision)
+ if(seedarkness || !ghostvision)
client.images -= ghost_darkness_images
else
//add images for the 60inv things ghosts can normally see when darkness is enabled so they can see them now
client.images |= ghost_darkness_images
- if (ghostimage)
+ if(ghostimage)
client.images -= ghostimage //remove ourself
/mob/proc/can_admin_interact()
diff --git a/code/modules/mob/dead/observer/say.dm b/code/modules/mob/dead/observer/say.dm
index 7f63a8f1261..fb5b7735633 100644
--- a/code/modules/mob/dead/observer/say.dm
+++ b/code/modules/mob/dead/observer/say.dm
@@ -1,17 +1,17 @@
/mob/dead/observer/say(var/message)
message = sanitize(copytext(message, 1, MAX_MESSAGE_LEN))
- if (!message)
+ if(!message)
return
log_say("Ghost/[src.key] : [message]")
- if (src.client)
+ if(src.client)
if(src.client.prefs.muted & MUTE_DEADCHAT)
to_chat(src, "\red You cannot talk in deadchat (muted).")
return
- if (src.client.handle_spam_prevention(message,MUTE_DEADCHAT))
+ if(src.client.handle_spam_prevention(message,MUTE_DEADCHAT))
return
. = src.say_dead(message)
@@ -37,29 +37,3 @@
return
. = src.emote_dead(message)
-
-/*
- for (var/mob/M in hearers(null, null))
- if (!M.stat)
- if(M.job == "Chaplain")
- if (prob (49))
- M.show_message("You hear muffled speech... but nothing is there...", 2)
- if(prob(20))
- playsound(src.loc, pick('sound/effects/ghost.ogg','sound/effects/ghost2.ogg'), 10, 1)
- else
- M.show_message("You hear muffled speech... you can almost make out some words...", 2)
-// M.show_message("[stutter(message)]", 2)
- if(prob(30))
- playsound(src.loc, pick('sound/effects/ghost.ogg','sound/effects/ghost2.ogg'), 10, 1)
- else
- if (prob(50))
- return
- else if (prob (95))
- M.show_message("You hear muffled speech... but nothing is there...", 2)
- if(prob(20))
- playsound(src.loc, pick('sound/effects/ghost.ogg','sound/effects/ghost2.ogg'), 10, 1)
- else
- M.show_message("You hear muffled speech... you can almost make out some words...", 2)
-// M.show_message("[stutter(message)]", 2)
- playsound(src.loc, pick('sound/effects/ghost.ogg','sound/effects/ghost2.ogg'), 10, 1)
-*/
diff --git a/code/modules/mob/dead/observer/spells.dm b/code/modules/mob/dead/observer/spells.dm
index 993f2b6e344..39dae4c0746 100644
--- a/code/modules/mob/dead/observer/spells.dm
+++ b/code/modules/mob/dead/observer/spells.dm
@@ -20,6 +20,7 @@ var/global/list/boo_phrases=list(
school = "transmutation"
charge_max = 600
clothes_req = 0
+ stat_allowed = 1
invocation = ""
invocation_type = "none"
range = 1 // Or maybe 3?
diff --git a/code/modules/mob/death.dm b/code/modules/mob/death.dm
index 2bfe10a1f35..11e51987285 100644
--- a/code/modules/mob/death.dm
+++ b/code/modules/mob/death.dm
@@ -76,6 +76,10 @@
/mob/proc/death(gibbed)
+ //Makes it so gib/dust/melt all unbuckle their victims from anything they may be buckled to to avoid breaking beds/chairs/etc
+ if(gibbed && buckled)
+ buckled.unbuckle_mob()
+
//Quick fix for corpses kept propped up in chairs. ~Z
drop_r_hand()
drop_l_hand()
diff --git a/code/modules/mob/emote.dm b/code/modules/mob/emote.dm
index 8d03cdd969a..ecdc6a0220a 100644
--- a/code/modules/mob/emote.dm
+++ b/code/modules/mob/emote.dm
@@ -1,124 +1,125 @@
-#define EMOTE_COOLDOWN 20 //Time in deciseconds that the cooldown lasts
-
-//Emote Cooldown System (it's so simple!)
-/mob/proc/handle_emote_CD(cooldown = EMOTE_COOLDOWN)
- if(emote_cd == 2) return 1 // Cooldown emotes were disabled by an admin, prevent use
- if(src.emote_cd == 1) return 1 // Already on CD, prevent use
-
- src.emote_cd = 1 // Starting cooldown
- spawn(cooldown)
- if(emote_cd == 2) return 1 // Don't reset if cooldown emotes were disabled by an admin during the cooldown
- src.emote_cd = 0 // Cooldown complete, ready for more!
-
- return 0 // Proceed with emote
-//--FalseIncarnate
-
-// All mobs should have custom emote, really..
-/mob/proc/custom_emote(var/m_type=1,var/message = null)
-
- if(stat || !use_me && usr == src)
- to_chat(usr, "You are unable to emote.")
- return
-
- var/muzzled = istype(src.wear_mask, /obj/item/clothing/mask/muzzle)
- if(m_type == 2 && muzzled) return
-
- var/input
- if(!message)
- input = sanitize(copytext(input(src,"Choose an emote to display.") as text|null,1,MAX_MESSAGE_LEN))
- else
- input = message
- if(input)
- message = "[src] [input]"
- else
- return
-
-
- if (message)
- log_emote("[name]/[key] : [message]")
-
- //Hearing gasp and such every five seconds is not good emotes were not global for a reason.
- // Maybe some people are okay with that.
-
- for(var/mob/M in player_list)
- if (!M.client)
- continue //skip monkeys and leavers
- if (istype(M, /mob/new_player))
- continue
- if(findtext(message," snores.")) //Because we have so many sleeping people.
- break
- if(M.stat == 2 && (M.client.prefs.toggles & CHAT_GHOSTSIGHT) && !(M in viewers(src,null)))
- M.show_message(message)
-
-
- // Type 1 (Visual) emotes are sent to anyone in view of the item
- if (m_type & 1)
- var/list/can_see = get_mobs_in_view(1,src) //Allows silicon & mmi mobs carried around to see the emotes of the person carrying them around.
- can_see |= viewers(src,null)
- for (var/mob/O in can_see)
-
- if(O.status_flags & PASSEMOTES)
-
- for(var/obj/item/weapon/holder/H in O.contents)
- H.show_message(message, m_type)
-
- for(var/mob/living/M in O.contents)
- M.show_message(message, m_type)
-
- O.show_message(message, m_type)
-
- // Type 2 (Audible) emotes are sent to anyone in hear range
- // of the *LOCATION* -- this is important for pAIs to be heard
- else if (m_type & 2)
- for (var/mob/O in get_mobs_in_view(7,src))
-
- if(O.status_flags & PASSEMOTES)
-
- for(var/obj/item/weapon/holder/H in O.contents)
- H.show_message(message, m_type)
-
- for(var/mob/living/M in O.contents)
- M.show_message(message, m_type)
-
- O.show_message(message, m_type)
-
-/mob/proc/emote_dead(var/message)
-
- if(client.prefs.muted & MUTE_DEADCHAT)
- to_chat(src, "\red You cannot send deadchat emotes (muted).")
- return
-
- if(!(client.prefs.toggles & CHAT_DEAD))
- to_chat(src, "\red You have deadchat muted.")
- return
-
- if(!src.client.holder)
- if(!config.dsay_allowed)
- to_chat(src, "\red Deadchat is globally muted")
- return
-
-
- var/input
- if(!message)
- input = sanitize(copytext(input(src, "Choose an emote to display.") as text|null, 1, MAX_MESSAGE_LEN))
- else
- input = message
-
- if(input)
- message = "DEAD:[src] [message]"
- else
- return
-
-
- if(message)
- log_emote("Ghost/[src.key] : [message]")
-
- for(var/mob/M in player_list)
- if(istype(M, /mob/new_player))
- continue
-
- if(check_rights(R_ADMIN|R_MOD, 0, M) && (M.client.prefs.toggles & CHAT_DEAD)) // Show the emote to admins/mods
- to_chat(M, message)
-
- else if(M.stat == DEAD && (M.client.prefs.toggles & CHAT_DEAD)) // Show the emote to regular ghosts with deadchat toggled on
- M.show_message(message, 2)
+#define EMOTE_COOLDOWN 20 //Time in deciseconds that the cooldown lasts
+
+//Emote Cooldown System (it's so simple!)
+/mob/proc/handle_emote_CD(cooldown = EMOTE_COOLDOWN)
+ if(emote_cd == 2) return 1 // Cooldown emotes were disabled by an admin, prevent use
+ if(src.emote_cd == 1) return 1 // Already on CD, prevent use
+
+ src.emote_cd = 1 // Starting cooldown
+ spawn(cooldown)
+ if(emote_cd == 2) return 1 // Don't reset if cooldown emotes were disabled by an admin during the cooldown
+ src.emote_cd = 0 // Cooldown complete, ready for more!
+
+ return 0 // Proceed with emote
+//--FalseIncarnate
+
+// All mobs should have custom emote, really..
+/mob/proc/custom_emote(var/m_type=1,var/message = null)
+
+ if(stat || !use_me && usr == src)
+ if(usr)
+ to_chat(usr, "You are unable to emote.")
+ return
+
+ var/muzzled = istype(src.wear_mask, /obj/item/clothing/mask/muzzle)
+ if(m_type == 2 && muzzled) return
+
+ var/input
+ if(!message)
+ input = sanitize(copytext(input(src,"Choose an emote to display.") as text|null,1,MAX_MESSAGE_LEN))
+ else
+ input = message
+ if(input)
+ message = "[src] [input]"
+ else
+ return
+
+
+ if(message)
+ log_emote("[name]/[key] : [message]")
+
+ //Hearing gasp and such every five seconds is not good emotes were not global for a reason.
+ // Maybe some people are okay with that.
+
+ for(var/mob/M in player_list)
+ if(!M.client)
+ continue //skip monkeys and leavers
+ if(istype(M, /mob/new_player))
+ continue
+ if(findtext(message," snores.")) //Because we have so many sleeping people.
+ break
+ if(M.stat == 2 && (M.client.prefs.toggles & CHAT_GHOSTSIGHT) && !(M in viewers(src,null)))
+ M.show_message(message)
+
+
+ // Type 1 (Visual) emotes are sent to anyone in view of the item
+ if(m_type & 1)
+ var/list/can_see = get_mobs_in_view(1,src) //Allows silicon & mmi mobs carried around to see the emotes of the person carrying them around.
+ can_see |= viewers(src,null)
+ for(var/mob/O in can_see)
+
+ if(O.status_flags & PASSEMOTES)
+
+ for(var/obj/item/weapon/holder/H in O.contents)
+ H.show_message(message, m_type)
+
+ for(var/mob/living/M in O.contents)
+ M.show_message(message, m_type)
+
+ O.show_message(message, m_type)
+
+ // Type 2 (Audible) emotes are sent to anyone in hear range
+ // of the *LOCATION* -- this is important for pAIs to be heard
+ else if(m_type & 2)
+ for(var/mob/O in get_mobs_in_view(7,src))
+
+ if(O.status_flags & PASSEMOTES)
+
+ for(var/obj/item/weapon/holder/H in O.contents)
+ H.show_message(message, m_type)
+
+ for(var/mob/living/M in O.contents)
+ M.show_message(message, m_type)
+
+ O.show_message(message, m_type)
+
+/mob/proc/emote_dead(var/message)
+
+ if(client.prefs.muted & MUTE_DEADCHAT)
+ to_chat(src, "\red You cannot send deadchat emotes (muted).")
+ return
+
+ if(!(client.prefs.toggles & CHAT_DEAD))
+ to_chat(src, "\red You have deadchat muted.")
+ return
+
+ if(!src.client.holder)
+ if(!config.dsay_allowed)
+ to_chat(src, "\red Deadchat is globally muted")
+ return
+
+
+ var/input
+ if(!message)
+ input = sanitize(copytext(input(src, "Choose an emote to display.") as text|null, 1, MAX_MESSAGE_LEN))
+ else
+ input = message
+
+ if(input)
+ message = "DEAD:[src] [message]"
+ else
+ return
+
+
+ if(message)
+ log_emote("Ghost/[src.key] : [message]")
+
+ for(var/mob/M in player_list)
+ if(istype(M, /mob/new_player))
+ continue
+
+ if(check_rights(R_ADMIN|R_MOD, 0, M) && (M.client.prefs.toggles & CHAT_DEAD)) // Show the emote to admins/mods
+ to_chat(M, message)
+
+ else if(M.stat == DEAD && (M.client.prefs.toggles & CHAT_DEAD)) // Show the emote to regular ghosts with deadchat toggled on
+ M.show_message(message, 2)
diff --git a/code/modules/mob/hear_say.dm b/code/modules/mob/hear_say.dm
index 47004016a2b..af1dab9098c 100644
--- a/code/modules/mob/hear_say.dm
+++ b/code/modules/mob/hear_say.dm
@@ -1,51 +1,54 @@
// At minimum every mob has a hear_say proc.
-/mob/proc/hear_say(var/message, var/verb = "says", var/datum/language/language = null, var/alt_name = "",var/italics = 0, var/mob/speaker = null, var/sound/speech_sound, var/sound_vol)
+/mob/proc/hear_say(var/message, var/verb = "says", var/datum/language/language = null, var/alt_name = "", var/italics = 0, var/mob/speaker = null, var/sound/speech_sound, var/sound_vol)
if(!client)
- return
+ return 0
- if(speaker && !speaker.client && istype(src,/mob/dead/observer) && client.prefs.toggles & CHAT_GHOSTEARS && !speaker in view(src))
+ if(isobserver(src) && client.prefs.toggles & CHAT_GHOSTEARS)
+ if(speaker && !speaker.client && !(speaker in view(src)))
//Does the speaker have a client? It's either random stuff that observers won't care about (Experiment 97B says, 'EHEHEHEHEHEHEHE')
//Or someone snoring. So we make it where they won't hear it.
- return
+ return 0
//make sure the air can transmit speech - hearer's side
var/turf/T = get_turf(src)
- if ((T) && (!(istype(src, /mob/dead/observer)))) //Ghosts can hear even in vacuum.
+ if(T && !isobserver(src))
var/datum/gas_mixture/environment = T.return_air()
- var/pressure = (environment)? environment.return_pressure() : 0
+ var/pressure = environment ? environment.return_pressure() : 0
if(pressure < SOUND_MINIMUM_PRESSURE && get_dist(speaker, src) > 1)
- return
+ return 0
- if (pressure < ONE_ATMOSPHERE*0.4) //sound distortion pressure, to help clue people in that the air is thin, even if it isn't a vacuum yet
+ if(pressure < ONE_ATMOSPHERE * 0.4) //sound distortion pressure, to help clue people in that the air is thin, even if it isn't a vacuum yet
italics = 1
- sound_vol *= 0.5 //muffle the sound a bit, so it's like we're actually talking through contact
+ sound_vol *= 0.5
- if(sleeping || stat == 1)
+ if(sleeping || stat == UNCONSCIOUS)
hear_sleep(message)
- return
+ return 0
//non-verbal languages are garbled if you can't see the speaker. Yes, this includes if they are inside a closet.
- if (language && (language.flags & NONVERBAL))
- if (!speaker || (src.sdisabilities & BLIND || src.blinded) || !(speaker in view(src)))
+ if(language && (language.flags & NONVERBAL))
+ if(disabilities & BLIND || blinded) //blind people can't see dumbass
message = stars(message)
- if(!(language && (language.flags & INNATE))) // skip understanding checks for INNATE languages
- if(!say_understands(speaker,language))
- if(istype(speaker,/mob/living/simple_animal))
- var/mob/living/simple_animal/S = speaker
- if(S.speak.len)
- message = pick(S.speak)
- else
- stars(message)
+ if(!speaker || !(speaker in view(src)))
+ message = stars(message)
+
+ if(!say_understands(speaker, language))
+ if(isanimal(speaker))
+ var/mob/living/simple_animal/S = speaker
+ if(S.speak.len)
+ message = pick(S.speak)
else
- if(language)
- message = language.scramble(message)
- else
- message = stars(message)
+ message = stars(message)
+ else
+ if(language)
+ message = language.scramble(message)
+ else
+ message = stars(message)
var/speaker_name = speaker.name
- if(istype(speaker, /mob/living/carbon/human))
+ if(ishuman(speaker))
var/mob/living/carbon/human/H = speaker
speaker_name = H.GetVoice()
@@ -53,7 +56,7 @@
message = "[message]"
var/track = null
- if(istype(src, /mob/dead/observer))
+ if(isobserver(src))
if(italics && client.prefs.toggles & CHAT_GHOSTRADIO)
return
if(speaker_name != speaker.real_name && speaker.real_name)
@@ -62,7 +65,7 @@
if(client.prefs.toggles & CHAT_GHOSTEARS && speaker in view(src))
message = "[message]"
- if(sdisabilities & DEAF || ear_deaf)
+ if(disabilities & DEAF || ear_deaf)
if(!language || !(language.flags & INNATE)) // INNATE is the flag for audible-emote-language, so we don't want to show an "x talks but you cannot hear them" message if it's set
if(speaker == src)
to_chat(src, "You cannot hear yourself speak!")
@@ -73,17 +76,16 @@
to_chat(src, "[speaker_name][alt_name] [track][language.format_message(message, verb)]")
else
to_chat(src, "[speaker_name][alt_name] [track][verb], \"[message]\"")
- if (speech_sound && (get_dist(speaker, src) <= world.view && src.z == speaker.z))
+ if(speech_sound && (get_dist(speaker, src) <= world.view && src.z == speaker.z))
var/turf/source = speaker? get_turf(speaker) : get_turf(src)
src.playsound_local(source, speech_sound, sound_vol, 1)
-/mob/proc/hear_radio(var/message, var/verb="says", var/datum/language/language=null, var/part_a, var/part_b, var/mob/speaker = null, var/hard_to_hear = 0, var/vname ="", var/atom/follow_target)
-
+/mob/proc/hear_radio(var/message, var/verb = "says", var/datum/language/language = null, var/part_a, var/part_b, var/mob/speaker = null, var/hard_to_hear = 0, var/vname = "", var/atom/follow_target)
if(!client)
return
- if(sleeping || stat==1) //If unconscious or sleeping
+ if(sleeping || stat == UNCONSCIOUS) //If unconscious or sleeping
hear_sleep(message)
return
@@ -92,26 +94,28 @@
follow_target = speaker
//non-verbal languages are garbled if you can't see the speaker. Yes, this includes if they are inside a closet.
- if (language && (language.flags & NONVERBAL))
- if (!speaker || (src.sdisabilities & BLIND || src.blinded) || !(speaker in view(src)))
+ if(language && (language.flags & NONVERBAL))
+ if(disabilities & BLIND || blinded) //blind people can't see dumbass
message = stars(message)
- if(!(language && (language.flags & INNATE))) // skip understanding checks for INNATE languages
- if(!say_understands(speaker,language))
- if(isanimal(speaker))
- var/mob/living/simple_animal/S = speaker
- if(S.speak && S.speak.len)
- message = pick(S.speak)
- else
- return
+ if(!speaker || !(speaker in view(src)))
+ message = stars(message)
+
+ if(!say_understands(speaker, language))
+ if(isanimal(speaker))
+ var/mob/living/simple_animal/S = speaker
+ if(S.speak && S.speak.len)
+ message = pick(S.speak)
else
- if(language)
- message = language.scramble(message)
- else
- message = stars(message)
+ return
+ else
+ if(language)
+ message = language.scramble(message)
+ else
+ message = stars(message)
- if(hard_to_hear)
- message = stars(message)
+ if(hard_to_hear)
+ message = stars(message)
var/speaker_name = "unknown"
if(speaker)
@@ -128,7 +132,7 @@
var/jobname // the mob's "job"
var/mob/living/carbon/human/impersonating //The crewmember being impersonated, if any.
- if (ishuman(speaker))
+ if(ishuman(speaker))
var/mob/living/carbon/human/H = speaker
var/obj/item/weapon/card/id/id = H.wear_id
@@ -143,15 +147,15 @@
else
jobname = H.get_assignment()
- else if (iscarbon(speaker)) // Nonhuman carbon mob
+ else if(iscarbon(speaker)) // Nonhuman carbon mob
jobname = "No ID"
- else if (isAI(speaker))
+ else if(isAI(speaker))
jobname = "AI"
- else if (isrobot(speaker))
+ else if(isrobot(speaker))
jobname = "Cyborg"
- else if (ispAI(speaker))
+ else if(ispAI(speaker))
jobname = "Personal AI"
- else if (isAutoAnnouncer(speaker))
+ else if(isAutoAnnouncer(speaker))
var/mob/living/automatedannouncer/AA = speaker
jobname = AA.role
else
@@ -178,7 +182,7 @@
formatted = language.format_message_radio(message, verb)
else
formatted = "[verb], \"[message]\""
- if(sdisabilities & DEAF || ear_deaf)
+ if(disabilities & DEAF || ear_deaf)
if(prob(20))
to_chat(src, "You feel your headset vibrate but can hear nothing from it!")
else if(track)
diff --git a/code/modules/mob/holder.dm b/code/modules/mob/holder.dm
index 09f8009be75..ed867cd5178 100644
--- a/code/modules/mob/holder.dm
+++ b/code/modules/mob/holder.dm
@@ -48,10 +48,10 @@
if(istype(M))
M.unEquip(src)
to_chat(M, "[src] wriggles out of your grip!")
- to_chat(src, "You wriggle out of [M]'s grip!")
- else if(istype(src.loc,/obj/item))
- to_chat(src, "You struggle free of [src.loc].")
- src.forceMove(get_turf(src))
+ to_chat(L, "You wriggle out of [M]'s grip!")
+ else if(istype(loc,/obj/item))
+ to_chat(L, "You struggle free of [loc].")
+ forceMove(get_turf(src))
if(istype(M))
for(var/atom/A in M.contents)
diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm
index 8d68373e3f4..9ebbb29ac02 100644
--- a/code/modules/mob/inventory.dm
+++ b/code/modules/mob/inventory.dm
@@ -28,6 +28,7 @@
W.forceMove(src) //TODO: move to equipped?
l_hand = W
W.layer = 20 //TODO: move to equipped?
+ W.plane = HUD_PLANE //TODO: move to equipped?
W.equipped(src,slot_l_hand)
if(pulling == W)
stop_pulling()
@@ -43,6 +44,7 @@
W.forceMove(src)
r_hand = W
W.layer = 20
+ W.plane = HUD_PLANE
W.equipped(src,slot_r_hand)
if(pulling == W)
stop_pulling()
@@ -72,6 +74,7 @@
/mob/proc/put_in_hands(obj/item/W)
W.forceMove(get_turf(src))
W.layer = initial(W.layer)
+ W.plane = initial(W.plane)
W.dropped()
/mob/proc/drop_item_v() //this is dumb.
@@ -107,7 +110,7 @@
if(!I) //If there's nothing to drop, the drop is automatically succesfull. If(unEquip) should generally be used to check for NODROP.
return 1
- if((I.flags & NODROP) && !force)
+ if(!canUnEquip(I, force))
return 0
if(I == r_hand)
@@ -124,6 +127,7 @@
I.dropped(src)
if(I)
I.layer = initial(I.layer)
+ I.plane = initial(I.plane)
return 1
@@ -161,7 +165,7 @@
return list(wear_mask, back, l_hand, r_hand)
/mob/proc/get_id_card()
- for(var/obj/item/I in src.get_all_slots())
+ for(var/obj/item/I in get_all_slots())
. = I.GetID()
if(.)
break
diff --git a/code/modules/mob/language.dm b/code/modules/mob/language.dm
index c88684c77c0..abe6742fecc 100644
--- a/code/modules/mob/language.dm
+++ b/code/modules/mob/language.dm
@@ -213,7 +213,7 @@
colour = "vox"
key = "v"
flags = RESTRICTED | WHITELISTED
- syllables = list("ti","ti","ti","hi","hi","ki","ki","ki","ki","ya","ta","ha","ka","ya","chi","cha","kah", \
+ syllables = list("ti","ti","ti","hi","hi","ki","ki","ki","ki","ya","ta","ha","ka","ya", "yi", "chi","cha","kah", \
"SKRE","AHK","EHK","RAWK","KRA","AAA","EEE","KI","II","KRI","KA")
/datum/language/vox/get_random_name()
@@ -276,9 +276,27 @@
flags = RESTRICTED | WHITELISTED
syllables = list("blob","plop","pop","bop","boop")
+/datum/language/grey
+ name = "Psionic Communication"
+ desc = "The grey's psionic communication, less potent version of their distant cousin's telepathy. Talk to other greys within a limited radius."
+ speech_verb = "expresses"
+ ask_verb = "inquires"
+ exclaim_verb = "imparts"
+ colour = "abductor"
+ key = "^"
+ flags = RESTRICTED | HIVEMIND
+
+/datum/language/grey/broadcast(var/mob/living/speaker,var/message,var/speaker_mask)
+ ..(speaker,message,speaker.real_name)
+
+/datum/language/grey/check_special_condition(var/mob/living/carbon/human/other, var/mob/living/carbon/human/speaker)
+ if(other in range(7, speaker))
+ return 1
+ return 0
+
/datum/language/drask
name = "Orluum"
- desc = "The droning, vibrous language of the Drask. It sounds somewhat like whalesong"
+ desc = "The droning, vibrous language of the Drask. It sounds somewhat like whalesong."
speech_verb = "drones"
ask_verb = "hums"
exclaim_verb = "rumbles"
@@ -354,7 +372,7 @@
speech_verb = "growls"
ask_verb = "gnarls"
exclaim_verb = "snarls"
- colour = "rough"
+ colour = "gutter"
key = "3"
syllables = list ("gra","ba","ba","breh","bra","rah","dur","ra","ro","gro","go","ber","bar","geh","heh", "gra")
@@ -500,24 +518,24 @@
if(!speaker.binarycheck())
return
- if (!message)
+ if(!message)
return
var/message_start = "[name], [speaker.name]"
var/message_body = "[speaker.say_quote(message)], \"[message]\""
- for (var/mob/M in dead_mob_list)
+ for(var/mob/M in dead_mob_list)
if(!istype(M,/mob/new_player) && !istype(M,/mob/living/carbon/brain))
var/message_start_dead = "[name], [speaker.name] ([ghost_follow_link(speaker, ghost=M)])"
M.show_message("[message_start_dead] [message_body]", 2)
- for (var/mob/living/S in living_mob_list)
+ for(var/mob/living/S in living_mob_list)
if(drone_only && !istype(S,/mob/living/silicon/robot/drone))
continue
else if(istype(S , /mob/living/silicon/ai))
message_start = "[name], [speaker.name]"
- else if (!S.binarycheck())
+ else if(!S.binarycheck())
continue
S.show_message("[message_start] [message_body]", 2)
@@ -525,17 +543,11 @@
var/list/listening = hearers(1, src)
listening -= src
- for (var/mob/living/M in listening)
+ for(var/mob/living/M in listening)
if(istype(M, /mob/living/silicon) || M.binarycheck())
continue
M.show_message("synthesised voicebeeps, \"beep beep beep\"",2)
- //robot binary xmitter component power usage
- if (isrobot(speaker))
- var/mob/living/silicon/robot/R = speaker
- var/datum/robot_component/C = R.components["comms"]
- R.use_power(C.energy_consumption)
-
/datum/language/binary/drone
name = "Drone Talk"
desc = "A heavily encoded damage control coordination stream."
diff --git a/code/modules/mob/living/carbon/_defines.dm b/code/modules/mob/living/carbon/_defines.dm
index 2abbbf91cbc..163ce8f7c8d 100644
--- a/code/modules/mob/living/carbon/_defines.dm
+++ b/code/modules/mob/living/carbon/_defines.dm
@@ -4,7 +4,7 @@
#define HEAT_DAMAGE_LEVEL_1 2 //Amount of damage applied when your body temperature just passes the 360.15k safety point
#define HEAT_DAMAGE_LEVEL_2 3 //Amount of damage applied when your body temperature passes the 400K point
-#define HEAT_DAMAGE_LEVEL_3 8 //Amount of damage applied when your body temperature passes the 1000K point
+#define HEAT_DAMAGE_LEVEL_3 10 //Amount of damage applied when your body temperature passes the 1000K point
#define COLD_DAMAGE_LEVEL_1 0.5 //Amount of damage applied when your body temperature just passes the 260.15k safety point
#define COLD_DAMAGE_LEVEL_2 1.5 //Amount of damage applied when your body temperature passes the 200K point
diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm
index 6192b0acc6b..124a1120df6 100644
--- a/code/modules/mob/living/carbon/alien/alien.dm
+++ b/code/modules/mob/living/carbon/alien/alien.dm
@@ -118,11 +118,11 @@
/mob/living/carbon/alien/handle_mutations_and_radiation()
// Aliens love radiation nom nom nom
- if (radiation)
- if (radiation > 100)
+ if(radiation)
+ if(radiation > 100)
radiation = 100
- if (radiation < 0)
+ if(radiation < 0)
radiation = 0
switch(radiation)
@@ -217,7 +217,7 @@
if(judgebot.check_for_weapons(r_hand))
threatcount += 4
- //Loyalty implants imply trustworthyness
+ //Mindshield implants imply trustworthyness
if(isloyal(src))
threatcount -= 1
@@ -228,8 +228,8 @@ Proc: AddInfectionImages()
Des: Gives the client of the alien an image on each infected mob.
----------------------------------------*/
/mob/living/carbon/alien/proc/AddInfectionImages()
- if (client)
- for (var/mob/living/C in mob_list)
+ if(client)
+ for(var/mob/living/C in mob_list)
if(C.status_flags & XENO_HOST)
var/obj/item/organ/internal/body_egg/alien_embryo/A = C.get_int_organ(/obj/item/organ/internal/body_egg/alien_embryo)
if(A)
@@ -243,7 +243,7 @@ Proc: RemoveInfectionImages()
Des: Removes all infected images from the alien.
----------------------------------------*/
/mob/living/carbon/alien/proc/RemoveInfectionImages()
- if (client)
+ if(client)
for(var/image/I in client.images)
if(dd_hasprefix_case(I.icon_state, "infected"))
qdel(I)
diff --git a/code/modules/mob/living/carbon/alien/alien_defenses.dm b/code/modules/mob/living/carbon/alien/alien_defenses.dm
index 397a14fc259..3f2e2d28b78 100644
--- a/code/modules/mob/living/carbon/alien/alien_defenses.dm
+++ b/code/modules/mob/living/carbon/alien/alien_defenses.dm
@@ -6,17 +6,17 @@ As such, they can either help or harm other aliens. Help works like the human he
In all, this is a lot like the monkey code. /N
*/
/mob/living/carbon/alien/attack_alien(mob/living/carbon/alien/M as mob)
- if (!ticker)
+ if(!ticker)
to_chat(M, "You cannot attack people before the game has started.")
return
- if (istype(loc, /turf) && istype(loc.loc, /area/start))
+ if(istype(loc, /turf) && istype(loc.loc, /area/start))
to_chat(M, "No attacking people at spawn, you jackass.")
return
switch(M.a_intent)
- if (I_HELP)
+ if(I_HELP)
sleeping = max(0,sleeping-5)
resting = 0
AdjustParalysis(-3)
@@ -24,12 +24,12 @@ In all, this is a lot like the monkey code. /N
AdjustWeakened(-3)
visible_message("[M.name] nuzzles [src] trying to wake it up!")
- if (I_GRAB)
+ if(I_GRAB)
src.grabbedby(M)
return 1
else
- if (health > 0)
+ if(health > 0)
playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
var/damage = 1
visible_message("[M.name] bites [src]!", \
@@ -57,7 +57,7 @@ In all, this is a lot like the monkey code. /N
help_shake_act(M)
if(I_GRAB)
src.grabbedby(M)
- if (I_HARM, I_DISARM)
+ if(I_HARM, I_DISARM)
return 1
return 0
diff --git a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm
index afae056b99f..28439ab0ff2 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm
@@ -57,10 +57,10 @@ Doesn't work on other aliens/AI.*/
if(isalien(M))
var/amount = input("Amount:", "Transfer Plasma to [M]") as num
- if (amount)
+ if(amount)
amount = abs(round(amount))
if(powerc(amount))
- if (get_dist(src,M) <= 1)
+ if(get_dist(src,M) <= 1)
M.adjustPlasma(amount)
adjustPlasma(-amount)
to_chat(M, "[src] has transfered [amount] plasma to you.")
@@ -123,8 +123,8 @@ Doesn't work on other aliens/AI.*/
A.firer = src
A.yo = U.y - T.y
A.xo = U.x - T.x
- spawn(1)
- A.process()
+ A.fire()
+ A.newtonian_move(get_dir(U, T))
return
/mob/living/carbon/alien/humanoid/proc/resin() // -- TLE
@@ -185,4 +185,4 @@ Doesn't work on other aliens/AI.*/
adjustPlasma(-amount)
return 1
- return 0
\ No newline at end of file
+ return 0
diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm
index a5e72059ab8..f0af54a45ab 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm
@@ -18,8 +18,8 @@
/mob/living/carbon/alien/humanoid/hunter/handle_regular_hud_updates()
..() //-Yvarov
- if (healths)
- if (stat != 2)
+ if(healths)
+ if(stat != 2)
switch(health)
if(125 to INFINITY)
healths.icon_state = "health0"
@@ -85,7 +85,7 @@
leaping = 0
update_icons()
-/mob/living/carbon/alien/humanoid/hunter/throw_impact(A)
+/mob/living/carbon/alien/humanoid/hunter/throw_impact(atom/A)
if(!leaping)
return ..()
@@ -93,20 +93,26 @@
if(A)
if(istype(A, /mob/living))
var/mob/living/L = A
- L.visible_message("[src] pounces on [L]!", "[src] pounces on you!")
- if(ishuman(L))
- var/mob/living/carbon/human/H = L
- H.apply_effect(5, WEAKEN, H.run_armor_check(null, "melee"))
- else
- L.Weaken(5)
- sleep(2)//Runtime prevention (infinite bump() calls on hulks)
- step_towards(src,L)
+ var/blocked = 0
+ if(ishuman(A))
+ var/mob/living/carbon/human/H = A
+ if(H.check_shields(90, "the [name]", src, attack_type = THROWN_PROJECTILE_ATTACK))
+ blocked = 1
+ if(!blocked)
+ L.visible_message("[src] pounces on [L]!", "[src] pounces on you!")
+ if(ishuman(L))
+ var/mob/living/carbon/human/H = L
+ H.apply_effect(5, WEAKEN, H.run_armor_check(null, "melee"))
+ else
+ L.Weaken(5)
+ sleep(2)//Runtime prevention (infinite bump() calls on hulks)
+ step_towards(src,L)
toggle_leap(0)
pounce_cooldown = !pounce_cooldown
spawn(pounce_cooldown_time) //3s by default
pounce_cooldown = !pounce_cooldown
- else
+ else if(A.density && !A.CanPass(src))
visible_message("[src] smashes into [A]!", "[src] smashes into [A]!")
weakened = 2
diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm
index 831d01dbc87..d93fb0a835c 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm
@@ -49,8 +49,8 @@
/mob/living/carbon/alien/humanoid/sentinel/handle_regular_hud_updates()
..() //-Yvarov
- if (healths)
- if (stat != 2)
+ if(healths)
+ if(stat != 2)
switch(health)
if(150 to INFINITY)
healths.icon_state = "health0"
diff --git a/code/modules/mob/living/carbon/alien/humanoid/emote.dm b/code/modules/mob/living/carbon/alien/humanoid/emote.dm
index c20cc155f37..05eb2c8e226 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/emote.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/emote.dm
@@ -1,115 +1,115 @@
-/mob/living/carbon/alien/humanoid/emote(var/act,var/m_type=1,var/message = null)
- var/param = null
- if (findtext(act, "-", 1, null))
- var/t1 = findtext(act, "-", 1, null)
- param = copytext(act, t1 + 1, length(act) + 1)
- act = copytext(act, 1, t1)
-
-// if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_'
-// act = copytext(act,1,length(act)) //seriously who the fuck wrote this
- var/muzzled = is_muzzled()
- act = lowertext(act)
- switch(act)
- if("sign")
- if(!restrained())
- var/num = null
- if(text2num(param))
- num = "the number [text2num(param)]"
- if(num)
- message = "\The [src] signs [num]."
- m_type = 1
- if ("burp")
- if (!muzzled)
- message = "\The [src] burps."
- m_type = 2
- if ("deathgasp")
- message = "\The [src] lets out a waning guttural screech, green blood bubbling from its maw..."
- m_type = 2
- if("scratch")
- if (!src.restrained())
- message = "\The [src] scratches."
- m_type = 1
- if("whimper")
- if (!muzzled)
- message = "\The [src] whimpers."
- m_type = 2
- if("roar")
- if (!muzzled)
- message = "\The [src] roars."
- m_type = 2
- if("hiss")
- if(!muzzled)
- message = "\The [src] hisses."
- m_type = 2
- if("tail")
- message = "\The [src] waves its tail."
- m_type = 1
- if("gasp")
- message = "\The [src] gasps."
- m_type = 2
- if("shiver")
- message = "\The [src] shivers."
- m_type = 2
- if("drool")
- message = "\The [src] drools."
- m_type = 1
- if("scretch")
- if (!muzzled)
- message = "\The [src] scretches."
- m_type = 2
- if("choke")
- message = "\The [src] chokes."
- m_type = 2
- if("moan")
- message = "\The [src] moans!"
- m_type = 2
- if("nod")
- message = "\The [src] nods its head."
- m_type = 1
- if("sit")
- message = "\The [src] sits down."
- m_type = 1
- if("sway")
- message = "\The [src] sways around dizzily."
- m_type = 1
- if("sulk")
- message = "\The [src] sulks down sadly."
- m_type = 1
- if("twitch")
- message = "\The [src] twitches violently."
- m_type = 1
- if("dance")
- if (!src.restrained())
- message = "\The [src] dances around happily."
- m_type = 1
- if("roll")
- if (!src.restrained())
- message = "\The [src] rolls."
- m_type = 1
- if("shake")
- message = "\The [src] shakes its head."
- m_type = 1
- if("gnarl")
- if (!muzzled)
- message = "\The [src] gnarls and shows its teeth.."
- m_type = 2
- if("jump")
- message = "\The [src] jumps!"
- m_type = 1
- if("collapse")
- Paralyse(2)
- message = "\The [src] collapses!"
- m_type = 2
- if ("flip")
- m_type = 1
- message = "\The [src] does a flip!"
- src.SpinAnimation(5,1)
- if("help")
- to_chat(src, "burp, flip, deathgasp, choke, collapse, dance, drool, gasp, shiver, gnarl, jump, moan, nod, roar, roll, scratch,\nscretch, shake, sign-#, sit, sulk, sway, tail, twitch, whimper")
-
- if(!stat)
- if (act == "roar")
- playsound(src.loc, 'sound/voice/hiss5.ogg', 40, 1, 1)
- if (act == "deathgasp")
- playsound(src.loc, 'sound/voice/hiss6.ogg', 80, 1, 1)
+/mob/living/carbon/alien/humanoid/emote(var/act,var/m_type=1,var/message = null)
+ var/param = null
+ if(findtext(act, "-", 1, null))
+ var/t1 = findtext(act, "-", 1, null)
+ param = copytext(act, t1 + 1, length(act) + 1)
+ act = copytext(act, 1, t1)
+
+// if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_'
+// act = copytext(act,1,length(act)) //seriously who the fuck wrote this
+ var/muzzled = is_muzzled()
+ act = lowertext(act)
+ switch(act)
+ if("sign")
+ if(!restrained())
+ var/num = null
+ if(text2num(param))
+ num = "the number [text2num(param)]"
+ if(num)
+ message = "\The [src] signs [num]."
+ m_type = 1
+ if("burp")
+ if(!muzzled)
+ message = "\The [src] burps."
+ m_type = 2
+ if("deathgasp")
+ message = "\The [src] lets out a waning guttural screech, green blood bubbling from its maw..."
+ m_type = 2
+ if("scratch")
+ if(!src.restrained())
+ message = "\The [src] scratches."
+ m_type = 1
+ if("whimper")
+ if(!muzzled)
+ message = "\The [src] whimpers."
+ m_type = 2
+ if("roar")
+ if(!muzzled)
+ message = "\The [src] roars."
+ m_type = 2
+ if("hiss")
+ if(!muzzled)
+ message = "\The [src] hisses."
+ m_type = 2
+ if("tail")
+ message = "\The [src] waves its tail."
+ m_type = 1
+ if("gasp")
+ message = "\The [src] gasps."
+ m_type = 2
+ if("shiver")
+ message = "\The [src] shivers."
+ m_type = 2
+ if("drool")
+ message = "\The [src] drools."
+ m_type = 1
+ if("scretch")
+ if(!muzzled)
+ message = "\The [src] scretches."
+ m_type = 2
+ if("choke")
+ message = "\The [src] chokes."
+ m_type = 2
+ if("moan")
+ message = "\The [src] moans!"
+ m_type = 2
+ if("nod")
+ message = "\The [src] nods its head."
+ m_type = 1
+ if("sit")
+ message = "\The [src] sits down."
+ m_type = 1
+ if("sway")
+ message = "\The [src] sways around dizzily."
+ m_type = 1
+ if("sulk")
+ message = "\The [src] sulks down sadly."
+ m_type = 1
+ if("twitch")
+ message = "\The [src] twitches violently."
+ m_type = 1
+ if("dance")
+ if(!src.restrained())
+ message = "\The [src] dances around happily."
+ m_type = 1
+ if("roll")
+ if(!src.restrained())
+ message = "\The [src] rolls."
+ m_type = 1
+ if("shake")
+ message = "\The [src] shakes its head."
+ m_type = 1
+ if("gnarl")
+ if(!muzzled)
+ message = "\The [src] gnarls and shows its teeth.."
+ m_type = 2
+ if("jump")
+ message = "\The [src] jumps!"
+ m_type = 1
+ if("collapse")
+ Paralyse(2)
+ message = "\The [src] collapses!"
+ m_type = 2
+ if("flip")
+ m_type = 1
+ message = "\The [src] does a flip!"
+ src.SpinAnimation(5,1)
+ if("help")
+ to_chat(src, "burp, flip, deathgasp, choke, collapse, dance, drool, gasp, shiver, gnarl, jump, moan, nod, roar, roll, scratch,\nscretch, shake, sign-#, sit, sulk, sway, tail, twitch, whimper")
+
+ if(!stat)
+ if(act == "roar")
+ playsound(src.loc, 'sound/voice/hiss5.ogg', 40, 1, 1)
+ if(act == "deathgasp")
+ playsound(src.loc, 'sound/voice/hiss6.ogg', 80, 1, 1)
..(act, m_type, message)
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/alien/humanoid/empress.dm b/code/modules/mob/living/carbon/alien/humanoid/empress.dm
index ffc8e04429e..d2553c9a28f 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/empress.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/empress.dm
@@ -56,8 +56,8 @@
..() //-Yvarov
- if (src.healths)
- if (src.stat != 2)
+ if(src.healths)
+ if(src.stat != 2)
switch(health)
if(250 to INFINITY)
src.healths.icon_state = "health0"
diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
index 90fe6537759..9f47fc9910c 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
@@ -29,22 +29,22 @@
//This is fine, works the same as a human
/mob/living/carbon/alien/humanoid/Bump(atom/movable/AM as mob|obj, yes)
spawn( 0 )
- if ((!( yes ) || now_pushing))
+ if((!( yes ) || now_pushing))
return
now_pushing = 0
..()
- if (!istype(AM, /atom/movable))
+ if(!istype(AM, /atom/movable))
return
- if (ismob(AM))
+ if(ismob(AM))
var/mob/tmob = AM
tmob.LAssailant = src
- if (!now_pushing)
+ if(!now_pushing)
now_pushing = 1
- if (!AM.anchored)
+ if(!AM.anchored)
var/t = get_dir(src, AM)
- if (istype(AM, /obj/structure/window/full))
+ if(istype(AM, /obj/structure/window/full))
for(var/obj/structure/window/win in get_step(AM,t))
now_pushing = 0
return
@@ -55,13 +55,13 @@
/mob/living/carbon/alien/humanoid/movement_delay()
var/tally = 0
- if (istype(src, /mob/living/carbon/alien/humanoid/queen))
+ if(istype(src, /mob/living/carbon/alien/humanoid/queen))
tally += 4
- if (istype(src, /mob/living/carbon/alien/humanoid/drone))
+ if(istype(src, /mob/living/carbon/alien/humanoid/drone))
tally += 0
- if (istype(src, /mob/living/carbon/alien/humanoid/sentinel))
+ if(istype(src, /mob/living/carbon/alien/humanoid/sentinel))
tally += 0
- if (istype(src, /mob/living/carbon/alien/humanoid/hunter))
+ if(istype(src, /mob/living/carbon/alien/humanoid/hunter))
tally = -2 // hunters go supersuperfast
return (tally + move_delay_add + config.alien_delay)
@@ -85,26 +85,24 @@
var/b_loss = null
var/f_loss = null
- switch (severity)
- if (1.0)
+ switch(severity)
+ if(1.0)
gib()
return
- if (2.0)
- if (!shielded)
+ if(2.0)
+ if(!shielded)
b_loss += 60
f_loss += 60
- ear_damage += 30
- ear_deaf += 120
+ adjustEarDamage(30, 120)
if(3.0)
b_loss += 30
- if (prob(50) && !shielded)
+ if(prob(50) && !shielded)
Paralyse(1)
- ear_damage += 15
- ear_deaf += 60
+ adjustEarDamage(15,60)
adjustBruteLoss(b_loss)
adjustFireLoss(f_loss)
@@ -112,13 +110,13 @@
updatehealth()
/mob/living/carbon/alien/humanoid/attack_slime(mob/living/carbon/slime/M as mob)
- if (!ticker)
+ if(!ticker)
to_chat(M, "You cannot attack people before the game has started.")
return
if(M.Victim) return // can't attack while eating!
- if (stat > -100)
+ if(stat > -100)
M.do_attack_animation(src)
visible_message("The [M.name] glomps [src]!", \
@@ -153,7 +151,7 @@
"The [M.name] has shocked [src]!")
Weaken(power)
- if (stuttering < power)
+ if(stuttering < power)
stuttering = power
Stun(power)
@@ -161,7 +159,7 @@
s.set_up(5, 1, src)
s.start()
- if (prob(stunprob) && M.powerlevel >= 8)
+ if(prob(stunprob) && M.powerlevel >= 8)
adjustFireLoss(M.powerlevel * rand(6,10))
@@ -183,11 +181,11 @@
updatehealth()
/mob/living/carbon/alien/humanoid/attack_hand(mob/living/carbon/human/M as mob)
- if (!ticker)
+ if(!ticker)
to_chat(M, "You cannot attack people before the game has started.")
return
- if (istype(loc, /turf) && istype(loc.loc, /area/start))
+ if(istype(loc, /turf) && istype(loc.loc, /area/start))
to_chat(M, "No attacking people at spawn, you jackass.")
return
@@ -196,17 +194,17 @@
switch(M.a_intent)
- if (I_HELP)
+ if(I_HELP)
help_shake_act(M)
- if (I_GRAB)
+ if(I_GRAB)
grabbedby(M)
- if (I_HARM)
+ if(I_HARM)
M.do_attack_animation(src)
var/damage = rand(1, 9)
- if (prob(90))
- if (HULK in M.mutations)//HULK SMASH
+ if(prob(90))
+ if(HULK in M.mutations)//HULK SMASH
damage = 15
spawn(0)
Paralyse(1)
@@ -216,7 +214,7 @@
playsound(loc, "punch", 25, 1, -1)
visible_message("[M] has punched [src]!", \
"[M] has punched [src]!")
- if ((stat != DEAD) && (damage > 9||prob(5)))//Regular humans have a very small chance of weakening an alien.
+ if((stat != DEAD) && (damage > 9||prob(5)))//Regular humans have a very small chance of weakening an alien.
Paralyse(2)
visible_message("[M] has weakened [src]!", \
"[M] has weakened [src]!", \
@@ -227,15 +225,15 @@
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
visible_message("[M] has attempted to punch [src]!")
- if (I_DISARM)
- if (!lying)
- if (prob(5))//Very small chance to push an alien down.
+ if(I_DISARM)
+ if(!lying)
+ if(prob(5))//Very small chance to push an alien down.
Paralyse(2)
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
visible_message("[M] has pushed down [src]!", \
"[M] has pushed down [src]!")
else
- if (prob(50))
+ if(prob(50))
drop_item()
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
visible_message("[M] has disarmed [src]!", \
@@ -251,11 +249,11 @@ In all, this is a lot like the monkey code. /N
*/
/mob/living/carbon/alien/humanoid/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
- if (!ticker)
+ if(!ticker)
to_chat(M, "You cannot attack people before the game has started.")
return
- if (istype(loc, /turf) && istype(loc.loc, /area/start))
+ if(istype(loc, /turf) && istype(loc.loc, /area/start))
to_chat(M, "No attacking people at spawn, you jackass.")
return
@@ -263,7 +261,7 @@ In all, this is a lot like the monkey code. /N
switch(M.a_intent)
- if (I_HELP)
+ if(I_HELP)
sleeping = max(0,sleeping-5)
resting = 0
AdjustParalysis(-3)
@@ -272,7 +270,7 @@ In all, this is a lot like the monkey code. /N
visible_message("[M.name] nuzzles [src] trying to wake it up!")
else
- if (health > 0)
+ if(health > 0)
M.do_attack_animation(src)
playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
var/damage = rand(1, 3)
@@ -294,7 +292,7 @@ In all, this is a lot like the monkey code. /N
else
- if (health > 0)
+ if(health > 0)
L.do_attack_animation(src)
playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
var/damage = rand(1, 3)
@@ -310,7 +308,7 @@ In all, this is a lot like the monkey code. /N
/mob/living/carbon/alien/humanoid/restrained()
- if (handcuffed)
+ if(handcuffed)
return 1
return 0
diff --git a/code/modules/mob/living/carbon/alien/humanoid/life.dm b/code/modules/mob/living/carbon/alien/humanoid/life.dm
index b41d5a9705d..4cccb6e57ed 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/life.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/life.dm
@@ -15,24 +15,24 @@
/mob/living/carbon/alien/humanoid/handle_disabilities()
- if (disabilities & EPILEPSY)
- if ((prob(1) && paralysis < 10))
+ if(disabilities & EPILEPSY)
+ if((prob(1) && paralysis < 10))
to_chat(src, "You have a seizure!")
Paralyse(10)
- if (disabilities & COUGHING)
- if ((prob(5) && paralysis <= 1))
+ if(disabilities & COUGHING)
+ if((prob(5) && paralysis <= 1))
drop_item()
spawn( 0 )
emote("cough")
return
- if (disabilities & TOURETTES)
- if ((prob(10) && paralysis <= 1))
+ if(disabilities & TOURETTES)
+ if((prob(10) && paralysis <= 1))
Stun(10)
spawn( 0 )
emote("twitch")
return
- if (disabilities & NERVOUS)
- if (prob(10))
+ if(disabilities & NERVOUS)
+ if(prob(10))
stuttering = max(10, stuttering)
/mob/living/carbon/alien/humanoid/proc/adjust_body_temperature(current, loc_temp, boost)
@@ -59,7 +59,7 @@
blinded = 1
silent = 0
else //ALIVE. LIGHTS ARE ON
- if(health < config.health_threshold_dead || brain_op_stage == 4.0)
+ if(health < config.health_threshold_dead || !get_int_organ(/obj/item/organ/internal/brain))
death()
blinded = 1
stat = DEAD
@@ -95,7 +95,7 @@
move_delay_add = max(0, move_delay_add - rand(1, 2))
//Eyes
- if(sdisabilities & BLIND) //disabled-blind, doesn't get better on its own
+ if(disabilities & BLIND) //disabled-blind, doesn't get better on its own
blinded = 1
else if(eye_blind) //blindness, heals slowly over time
eye_blind = max(eye_blind-1,0)
@@ -104,12 +104,12 @@
eye_blurry = max(eye_blurry-1, 0)
//Ears
- if(sdisabilities & DEAF) //disabled-deaf, doesn't get better on its own
- ear_deaf = max(ear_deaf, 1)
+ if(disabilities & DEAF) //disabled-deaf, doesn't get better on its own
+ setEarDamage(-1, max(ear_deaf, 1))
else if(ear_deaf) //deafness, heals slowly over time
- ear_deaf = max(ear_deaf-1, 0)
+ adjustEarDamage(0,-1)
else if(ear_damage < 25) //ear damage heals slowly under this threshold. otherwise you'll need earmuffs
- ear_damage = max(ear_damage-0.05, 0)
+ adjustEarDamage(-0.05, 0)
//Other
if(stunned)
diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm
index 2b5060468a1..daba3852764 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm
@@ -34,8 +34,8 @@
/mob/living/carbon/alien/humanoid/queen/handle_regular_hud_updates()
..() //-Yvarov
- if (healths)
- if (stat != DEAD)
+ if(healths)
+ if(stat != DEAD)
switch(health)
if(250 to INFINITY)
healths.icon_state = "health0"
@@ -88,37 +88,4 @@
icon_state = "queen_s"
for(var/image/I in overlays_standing)
- overlays += I
-
-
-/*
-/mob/living/carbon/alien/humanoid/queen/verb/evolve() // -- TLE
- set name = "Evolve (1000)"
- set desc = "The ultimate transformation. Become an alien Empress. Only one empress can exist at a time."
- set category = "Alien"
-
- if(powerc(1000))
- // Queen check
- var/no_queen = 1
- for(var/mob/living/carbon/alien/humanoid/empress/E in living_mob_list)
- if(!E.key && E.brain_op_stage != 4)
- continue
- no_queen = 0
-
- if(no_queen)
- adjustToxLoss(-1000)
- to_chat(src, "You begin to evolve!")
- for(var/mob/O in viewers(src, null))
- O.show_message(text("[src] begins to twist and contort!"), 1)
- var/mob/living/carbon/alien/humanoid/empress/new_xeno = new(loc)
- if(mind)
- mind.transfer_to(new_xeno)
- else
- new_xeno.key = key
- new_xeno.mind.name = new_xeno.name
- qdel(src)
- else
- to_chat(src, "We already have an alive empress.")
- return
-
-*/
\ No newline at end of file
+ overlays += I
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm
index fb489552f78..898d23de066 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm
@@ -56,7 +56,7 @@
/mob/living/carbon/alien/humanoid/regenerate_icons()
..()
- if (notransform) return
+ if(notransform) return
update_inv_head(0,0)
update_inv_wear_suit(0,0)
@@ -103,7 +103,7 @@
t_suit = "armor"
standing.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "[t_suit]blood")
- if (istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
+ if(istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
unEquip(handcuffed)
drop_r_hand()
drop_l_hand()
@@ -115,7 +115,7 @@
/mob/living/carbon/alien/humanoid/update_inv_head(var/update_icons=1)
- if (head)
+ if(head)
var/t_state = head.item_state
if(!t_state) t_state = head.icon_state
var/image/standing = image("icon" = 'icons/mob/mob.dmi', "icon_state" = "[t_state]")
diff --git a/code/modules/mob/living/carbon/alien/larva/emote.dm b/code/modules/mob/living/carbon/alien/larva/emote.dm
index dc7a66f7018..01d834b07cf 100644
--- a/code/modules/mob/living/carbon/alien/larva/emote.dm
+++ b/code/modules/mob/living/carbon/alien/larva/emote.dm
@@ -1,126 +1,126 @@
-/mob/living/carbon/alien/larva/emote(var/act,var/m_type=1,var/message = null)
- var/param = null
- if (findtext(act, "-", 1, null))
- var/t1 = findtext(act, "-", 1, null)
- param = copytext(act, t1 + 1, length(act) + 1)
- act = copytext(act, 1, t1)
-
- if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_'
- act = copytext(act,1,length(act))
- var/muzzled = is_muzzled()
- act = lowertext(act)
- switch(act)
- if ("me")
- if(silent)
- return
- if (src.client)
- if (client.prefs.muted & MUTE_IC)
- to_chat(src, "\red You cannot send IC messages (muted).")
- return
- if (src.client.handle_spam_prevention(message,MUTE_IC))
- return
- if (stat)
- return
- if(!(message))
- return
- return custom_emote(m_type, message)
-
- if ("custom")
- return custom_emote(m_type, message)
- if("sign")
- if (!src.restrained())
- message = text("The alien signs[].", (text2num(param) ? text(" the number []", text2num(param)) : null))
- m_type = 1
- if ("burp")
- if (!muzzled)
- message = "[src] burps."
- m_type = 2
- if("scratch")
- if (!src.restrained())
- message = "The [src.name] scratches."
- m_type = 1
- if("whimper")
- if (!muzzled)
- message = "The [src.name] whimpers."
- m_type = 2
-// if("roar")
-// if (!muzzled)
-// message = "The [src.name] roars." Commenting out since larva shouldn't roar /N
-// m_type = 2
- if("tail")
- message = "The [src.name] waves its tail."
- m_type = 1
- if("gasp")
- message = "The [src.name] gasps."
- m_type = 2
- if("shiver")
- message = "The [src.name] shivers."
- m_type = 2
- if("drool")
- message = "The [src.name] drools."
- m_type = 1
- if("scretch")
- if (!muzzled)
- message = "The [src.name] scretches."
- m_type = 2
- if("choke")
- message = "The [src.name] chokes."
- m_type = 2
- if("moan")
- message = "The [src.name] moans!"
- m_type = 2
- if("nod")
- message = "The [src.name] nods its head."
- m_type = 1
-// if("sit")
-// message = "The [src.name] sits down." //Larvan can't sit down, /N
-// m_type = 1
- if("sway")
- message = "The [src.name] sways around dizzily."
- m_type = 1
- if("sulk")
- message = "The [src.name] sulks down sadly."
- m_type = 1
- if("twitch")
- message = "The [src.name] twitches violently."
- m_type = 1
- if("dance")
- if (!src.restrained())
- message = "The [src.name] dances around happily."
- m_type = 1
- if("roll")
- if (!src.restrained())
- message = "The [src.name] rolls."
- m_type = 1
- if("shake")
- message = "The [src.name] shakes its head."
- m_type = 1
- if("gnarl")
- if (!muzzled)
- message = "The [src.name] gnarls and shows its teeth.."
- m_type = 2
- if("jump")
- message = "The [src.name] jumps!"
- m_type = 1
- if("hiss_")
- message = "The [src.name] hisses softly."
- m_type = 1
- if("collapse")
- Paralyse(2)
- message = text("[] collapses!", src)
- m_type = 2
- if("help")
- to_chat(src, "burp, choke, collapse, dance, drool, gasp, shiver, gnarl, jump, moan, nod, roll, scratch,\nscretch, shake, sign-#, sulk, sway, tail, twitch, whimper")
- else
- to_chat(src, text("Invalid Emote: []", act))
- if ((message && src.stat == 0))
- log_emote("[name]/[key] : [message]")
- if (m_type & 1)
- for(var/mob/O in viewers(src, null))
- O.show_message(message, m_type)
- //Foreach goto(703)
- else
- for(var/mob/O in hearers(src, null))
- O.show_message(message, m_type)
- //Foreach goto(746)
+/mob/living/carbon/alien/larva/emote(var/act,var/m_type=1,var/message = null)
+ var/param = null
+ if(findtext(act, "-", 1, null))
+ var/t1 = findtext(act, "-", 1, null)
+ param = copytext(act, t1 + 1, length(act) + 1)
+ act = copytext(act, 1, t1)
+
+ if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_'
+ act = copytext(act,1,length(act))
+ var/muzzled = is_muzzled()
+ act = lowertext(act)
+ switch(act)
+ if("me")
+ if(silent)
+ return
+ if(src.client)
+ if(client.prefs.muted & MUTE_IC)
+ to_chat(src, "\red You cannot send IC messages (muted).")
+ return
+ if(src.client.handle_spam_prevention(message,MUTE_IC))
+ return
+ if(stat)
+ return
+ if(!(message))
+ return
+ return custom_emote(m_type, message)
+
+ if("custom")
+ return custom_emote(m_type, message)
+ if("sign")
+ if(!src.restrained())
+ message = text("The alien signs[].", (text2num(param) ? text(" the number []", text2num(param)) : null))
+ m_type = 1
+ if("burp")
+ if(!muzzled)
+ message = "[src] burps."
+ m_type = 2
+ if("scratch")
+ if(!src.restrained())
+ message = "The [src.name] scratches."
+ m_type = 1
+ if("whimper")
+ if(!muzzled)
+ message = "The [src.name] whimpers."
+ m_type = 2
+// if("roar")
+// if(!muzzled)
+// message = "The [src.name] roars." Commenting out since larva shouldn't roar /N
+// m_type = 2
+ if("tail")
+ message = "The [src.name] waves its tail."
+ m_type = 1
+ if("gasp")
+ message = "The [src.name] gasps."
+ m_type = 2
+ if("shiver")
+ message = "The [src.name] shivers."
+ m_type = 2
+ if("drool")
+ message = "The [src.name] drools."
+ m_type = 1
+ if("scretch")
+ if(!muzzled)
+ message = "The [src.name] scretches."
+ m_type = 2
+ if("choke")
+ message = "The [src.name] chokes."
+ m_type = 2
+ if("moan")
+ message = "The [src.name] moans!"
+ m_type = 2
+ if("nod")
+ message = "The [src.name] nods its head."
+ m_type = 1
+// if("sit")
+// message = "The [src.name] sits down." //Larvan can't sit down, /N
+// m_type = 1
+ if("sway")
+ message = "The [src.name] sways around dizzily."
+ m_type = 1
+ if("sulk")
+ message = "The [src.name] sulks down sadly."
+ m_type = 1
+ if("twitch")
+ message = "The [src.name] twitches violently."
+ m_type = 1
+ if("dance")
+ if(!src.restrained())
+ message = "The [src.name] dances around happily."
+ m_type = 1
+ if("roll")
+ if(!src.restrained())
+ message = "The [src.name] rolls."
+ m_type = 1
+ if("shake")
+ message = "The [src.name] shakes its head."
+ m_type = 1
+ if("gnarl")
+ if(!muzzled)
+ message = "The [src.name] gnarls and shows its teeth.."
+ m_type = 2
+ if("jump")
+ message = "The [src.name] jumps!"
+ m_type = 1
+ if("hiss_")
+ message = "The [src.name] hisses softly."
+ m_type = 1
+ if("collapse")
+ Paralyse(2)
+ message = text("[] collapses!", src)
+ m_type = 2
+ if("help")
+ to_chat(src, "burp, choke, collapse, dance, drool, gasp, shiver, gnarl, jump, moan, nod, roll, scratch,\nscretch, shake, sign-#, sulk, sway, tail, twitch, whimper")
+ else
+ to_chat(src, text("Invalid Emote: []", act))
+ if((message && src.stat == 0))
+ log_emote("[name]/[key] : [message]")
+ if(m_type & 1)
+ for(var/mob/O in viewers(src, null))
+ O.show_message(message, m_type)
+ //Foreach goto(703)
+ else
+ for(var/mob/O in hearers(src, null))
+ O.show_message(message, m_type)
+ //Foreach goto(746)
return
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm
index a513ab76a90..19f3368ce96 100644
--- a/code/modules/mob/living/carbon/alien/larva/larva.dm
+++ b/code/modules/mob/living/carbon/alien/larva/larva.dm
@@ -31,7 +31,7 @@
/mob/living/carbon/alien/larva/Bump(atom/movable/AM as mob|obj, yes)
spawn( 0 )
- if ((!( yes ) || now_pushing))
+ if((!( yes ) || now_pushing))
return
now_pushing = 1
if(ismob(AM))
@@ -48,11 +48,11 @@
now_pushing = 0
..()
- if (!( istype(AM, /atom/movable) ))
+ if(!( istype(AM, /atom/movable) ))
return
- if (!( now_pushing ))
+ if(!( now_pushing ))
now_pushing = 1
- if (!( AM.anchored ))
+ if(!( AM.anchored ))
var/t = get_dir(src, AM)
step(AM, t)
now_pushing = null
@@ -76,26 +76,24 @@
var/b_loss = null
var/f_loss = null
- switch (severity)
- if (1.0)
+ switch(severity)
+ if(1.0)
gib()
return
- if (2.0)
+ if(2.0)
b_loss += 60
f_loss += 60
- ear_damage += 30
- ear_deaf += 120
+ adjustEarDamage(30,120)
if(3.0)
b_loss += 30
- if (prob(50))
+ if(prob(50))
Paralyse(1)
- ear_damage += 15
- ear_deaf += 60
+ adjustEarDamage(15,60)
adjustBruteLoss(b_loss)
adjustFireLoss(f_loss)
@@ -123,14 +121,14 @@
/mob/living/carbon/alien/larva/attack_slime(mob/living/carbon/slime/M as mob)
- if (!ticker)
+ if(!ticker)
to_chat(M, "You cannot attack people before the game has started.")
return
if(M.Victim)
return // can't attack while eating!
- if (stat != DEAD)
+ if(stat != DEAD)
M.do_attack_animation(src)
visible_message("The [M.name] glomps [src]!", \
"The [M.name] glomps [src]!")
@@ -148,11 +146,11 @@
return
/mob/living/carbon/alien/larva/attack_hand(mob/living/carbon/human/M as mob)
- if (!ticker)
+ if(!ticker)
to_chat(M, "You cannot attack people before the game has started.")
return
- if (istype(loc, /turf) && istype(loc.loc, /area/start))
+ if(istype(loc, /turf) && istype(loc.loc, /area/start))
to_chat(M, "No attacking people at spawn, you jackass.")
return
@@ -160,17 +158,17 @@
switch(M.a_intent)
- if (I_HELP)
+ if(I_HELP)
help_shake_act(M)
- if (I_GRAB)
+ if(I_GRAB)
grabbedby(M)
else
M.do_attack_animation(src)
var/damage = rand(1, 9)
- if (prob(90))
- if (HULK in M.mutations)
+ if(prob(90))
+ if(HULK in M.mutations)
damage += 5
spawn(0)
Paralyse(1)
@@ -180,7 +178,7 @@
playsound(loc, "punch", 25, 1, -1)
visible_message("[M] has kicked [src]!", \
"[M] has kicked [src]!")
- if ((stat != DEAD) && (damage > 4.9))
+ if((stat != DEAD) && (damage > 4.9))
Paralyse(rand(5,10))
visible_message("[M] has weakened [src]!", \
"[M] has weakened [src]!", \
@@ -194,11 +192,11 @@
return
/mob/living/carbon/alien/larva/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
- if (!ticker)
+ if(!ticker)
to_chat(M, "You cannot attack people before the game has started.")
return
- if (istype(loc, /turf) && istype(loc.loc, /area/start))
+ if(istype(loc, /turf) && istype(loc.loc, /area/start))
to_chat(M, "No attacking people at spawn, you jackass.")
return
@@ -206,7 +204,7 @@
switch(M.a_intent)
- if (I_HELP)
+ if(I_HELP)
sleeping = max(0,sleeping-5)
resting = 0
AdjustParalysis(-3)
@@ -215,7 +213,7 @@
visible_message("[M.name] nuzzles [src] trying to wake it up!")
else
- if (health > 0)
+ if(health > 0)
M.do_attack_animation(src)
playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
var/damage = 1
diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm
index 4e7b974d855..76ceef6ad2e 100644
--- a/code/modules/mob/living/carbon/alien/larva/life.dm
+++ b/code/modules/mob/living/carbon/alien/larva/life.dm
@@ -19,7 +19,7 @@
blinded = 1
silent = 0
else //ALIVE. LIGHTS ARE ON
- if(health < -25 || brain_op_stage == 4.0)
+ if(health < -25 || !get_int_organ(/obj/item/organ/internal/brain))
death()
blinded = 1
silent = 0
@@ -54,7 +54,7 @@
move_delay_add = max(0, move_delay_add - rand(1, 2))
//Eyes
- if(sdisabilities & BLIND) //disabled-blind, doesn't get better on its own
+ if(disabilities & BLIND) //disabled-blind, doesn't get better on its own
blinded = 1
else if(eye_blind) //blindness, heals slowly over time
eye_blind = max(eye_blind-1,0)
@@ -63,12 +63,12 @@
eye_blurry = max(eye_blurry-1, 0)
//Ears
- if(sdisabilities & DEAF) //disabled-deaf, doesn't get better on its own
- ear_deaf = max(ear_deaf, 1)
+ if(disabilities & DEAF) //disabled-deaf, doesn't get better on its own
+ setEarDamage(-1, max(ear_deaf, 1))
else if(ear_deaf) //deafness, heals slowly over time
- ear_deaf = max(ear_deaf-1, 0)
+ adjustEarDamage(0,-1)
else if(ear_damage < 25) //ear damage heals slowly under this threshold.
- ear_damage = max(ear_damage-0.05, 0)
+ adjustEarDamage(-0.05,0)
//Other
if(stunned)
diff --git a/code/modules/mob/living/carbon/alien/larva/powers.dm b/code/modules/mob/living/carbon/alien/larva/powers.dm
index 44351eb792a..678e4211b0d 100644
--- a/code/modules/mob/living/carbon/alien/larva/powers.dm
+++ b/code/modules/mob/living/carbon/alien/larva/powers.dm
@@ -7,17 +7,17 @@
if(stat != CONSCIOUS)
return
- if (layer != TURF_LAYER+0.2)
+ if(layer != TURF_LAYER+0.2)
layer = TURF_LAYER+0.2
to_chat(src, text("You are now hiding."))
for(var/mob/O in oviewers(src, null))
- if ((O.client && !( O.blinded )))
+ if((O.client && !( O.blinded )))
to_chat(O, text("[] scurries to the ground!", src))
else
layer = MOB_LAYER
to_chat(src, text("\green You have stopped hiding."))
for(var/mob/O in oviewers(src, null))
- if ((O.client && !( O.blinded )))
+ if((O.client && !( O.blinded )))
to_chat(O, text("[] slowly peaks up from the ground...", src))
/mob/living/carbon/alien/larva/verb/evolve()
diff --git a/code/modules/mob/living/carbon/alien/larva/update_icons.dm b/code/modules/mob/living/carbon/alien/larva/update_icons.dm
index 104811c4fc1..697d6413c02 100644
--- a/code/modules/mob/living/carbon/alien/larva/update_icons.dm
+++ b/code/modules/mob/living/carbon/alien/larva/update_icons.dm
@@ -12,11 +12,11 @@
if(stat == DEAD)
icon_state = "larva[state]_dead"
- else if (handcuffed || legcuffed) //This should be an overlay. Who made this an icon_state?
+ else if(handcuffed || legcuffed) //This should be an overlay. Who made this an icon_state?
icon_state = "larva[state]_cuff"
else if(stat == UNCONSCIOUS || lying || resting)
icon_state = "larva[state]_sleep"
- else if (stunned)
+ else if(stunned)
icon_state = "larva[state]_stun"
else
icon_state = "larva[state]"
diff --git a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm
index 151ed93e3ef..2038704023b 100644
--- a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm
+++ b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm
@@ -98,7 +98,7 @@
new_xeno.mind.name = new_xeno.name
new_xeno.mind.assigned_role = "MODE"
new_xeno.mind.special_role = "Alien"
- to_chat(new_xeno, sound('sound/voice/hiss5.ogg',0,0,0,100))//To get the player's attention
+ new_xeno << sound('sound/voice/hiss5.ogg',0,0,0,100)//To get the player's attention
if(gib_on_success)
owner.gib()
diff --git a/code/modules/mob/living/carbon/alien/special/facehugger.dm b/code/modules/mob/living/carbon/alien/special/facehugger.dm
index f0935c520ce..6ea16fc24a1 100644
--- a/code/modules/mob/living/carbon/alien/special/facehugger.dm
+++ b/code/modules/mob/living/carbon/alien/special/facehugger.dm
@@ -52,7 +52,7 @@ var/const/MAX_ACTIVE_TIME = 400
to_chat(user, "[src] is not moving.")
if(CONSCIOUS)
to_chat(user, "[src] seems to be active!")
- if (sterile)
+ if(sterile)
to_chat(user, "It looks like the proboscis has been removed.")
/obj/item/clothing/mask/facehugger/attackby(obj/item/O,mob/m, params)
@@ -148,7 +148,7 @@ var/const/MAX_ACTIVE_TIME = 400
target.equip_to_slot(src, slot_wear_mask,,0)
if(!sterile)
M.Paralyse(MAX_IMPREGNATION_TIME/6) //something like 25 ticks = 20 seconds with the default settings
- else if (iscorgi(M))
+ else if(iscorgi(M))
var/mob/living/simple_animal/pet/corgi/C = M
loc = C
C.facehugger = src
diff --git a/code/modules/mob/living/carbon/brain/brain.dm b/code/modules/mob/living/carbon/brain/brain.dm
index 8e6da1eca78..aac43c16ac3 100644
--- a/code/modules/mob/living/carbon/brain/brain.dm
+++ b/code/modules/mob/living/carbon/brain/brain.dm
@@ -23,39 +23,44 @@
return ..()
say_understands(var/other)//Goddamn is this hackish, but this say code is so odd
- if (istype(other, /mob/living/silicon/ai))
+ if(istype(other, /mob/living/silicon/ai))
if(!(container && istype(container, /obj/item/device/mmi)))
return 0
else
return 1
- if (istype(other, /mob/living/silicon/decoy))
+ if(istype(other, /mob/living/silicon/decoy))
if(!(container && istype(container, /obj/item/device/mmi)))
return 0
else
return 1
- if (istype(other, /mob/living/silicon/pai))
+ if(istype(other, /mob/living/silicon/pai))
if(!(container && istype(container, /obj/item/device/mmi)))
return 0
else
return 1
- if (istype(other, /mob/living/silicon/robot))
+ if(istype(other, /mob/living/silicon/robot))
if(!(container && istype(container, /obj/item/device/mmi)))
return 0
else
return 1
- if (istype(other, /mob/living/carbon/human))
+ if(istype(other, /mob/living/carbon/human))
return 1
- if (istype(other, /mob/living/carbon/slime))
+ if(istype(other, /mob/living/carbon/slime))
return 1
return ..()
-/mob/living/carbon/brain/update_canmove()
+/mob/living/carbon/brain/update_canmove(delay_action_updates = 0)
if(in_contents_of(/obj/mecha))
canmove = 1
use_me = 1 //If it can move, let it emote
- else if(istype(loc, /obj/item/device/mmi)) canmove = 1 //mmi won't move anyways so whatever
- else canmove = 0
+ else if(istype(loc, /obj/item/device/mmi))
+ canmove = 1 //mmi won't move anyways so whatever
+ else
+ canmove = 0
+
+ if(!delay_action_updates)
+ update_action_buttons_icon()
return canmove
/mob/living/carbon/brain/ex_act() //you cant blow up brainmobs because it makes transfer_to() freak out when borgs blow up.
@@ -94,4 +99,10 @@ I'm using this for Stat to give it a more nifty interface to work with
stat("Exosuit Integrity", "[!M.health ? "0" : "[(M.health / initial(M.health)) * 100]"]%")
/mob/living/carbon/brain/can_safely_leave_loc()
- return 0 //You're not supposed to be ethereal jaunting, brains
\ No newline at end of file
+ return 0 //You're not supposed to be ethereal jaunting, brains
+
+/mob/living/carbon/brain/adjustEarDamage()
+ return
+
+/mob/living/carbon/brain/setEarDamage() // no ears to damage or heal
+ return
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/brain/brain_item.dm b/code/modules/mob/living/carbon/brain/brain_item.dm
index 92c04ca0066..dd2e81ed35b 100644
--- a/code/modules/mob/living/carbon/brain/brain_item.dm
+++ b/code/modules/mob/living/carbon/brain/brain_item.dm
@@ -4,7 +4,7 @@
max_damage = 200
icon_state = "brain2"
force = 1.0
- w_class = 2.0
+ w_class = 2
throwforce = 1.0
throw_speed = 3
throw_range = 5
@@ -21,8 +21,7 @@
/obj/item/organ/internal/brain/surgeryize()
if(!owner)
return
- owner.ear_damage = 0 //Yeah, didn't you...hear? The ears are totally inside the brain.
- owner.ear_deaf = 0
+ owner.setEarDamage(0,0) //Yeah, didn't you...hear? The ears are totally inside the brain.
/obj/item/organ/internal/brain/xeno
name = "xenomorph brain"
diff --git a/code/modules/mob/living/carbon/brain/emote.dm b/code/modules/mob/living/carbon/brain/emote.dm
index 16cf01e4266..23a609131f2 100644
--- a/code/modules/mob/living/carbon/brain/emote.dm
+++ b/code/modules/mob/living/carbon/brain/emote.dm
@@ -1,51 +1,51 @@
-/mob/living/carbon/brain/emote(var/act,var/m_type=1,var/message = null)
- if(!(container && istype(container, /obj/item/device/mmi)))//No MMI, no emotes
- return
-
- if (findtext(act, "-", 1, null))
- var/t1 = findtext(act, "-", 1, null)
- act = copytext(act, 1, t1)
-
- if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_'
- act = copytext(act,1,length(act))
-
- if(src.stat == DEAD)
- return
- act = lowertext(act)
- switch(act)
-
- if ("alarm")
- to_chat(src, "You sound an alarm.")
- message = "\The [src] sounds an alarm."
- m_type = 2
- if ("alert")
- to_chat(src, "You let out a distressed noise.")
- message = "\The [src] lets out a distressed noise."
- m_type = 2
- if ("notice")
- to_chat(src, "You play a loud tone.")
- message = "\The [src] plays a loud tone."
- m_type = 2
- if ("flash")
- message = "The lights on \the [src] flash quickly."
- m_type = 1
- if ("blink")
- message = "\The [src] blinks."
- m_type = 1
- if ("whistle")
- to_chat(src, "You whistle.")
- message = "\The [src] whistles."
- m_type = 2
- if ("beep")
- to_chat(src, "You beep.")
- message = "\The [src] beeps."
- m_type = 2
- if ("boop")
- to_chat(src, "You boop.")
- message = "\The [src] boops."
- m_type = 2
- if ("help")
- to_chat(src, "alarm, alert, notice, flash,blink, whistle, beep, boop")
-
- if(message && !stat)
+/mob/living/carbon/brain/emote(var/act,var/m_type=1,var/message = null)
+ if(!(container && istype(container, /obj/item/device/mmi)))//No MMI, no emotes
+ return
+
+ if(findtext(act, "-", 1, null))
+ var/t1 = findtext(act, "-", 1, null)
+ act = copytext(act, 1, t1)
+
+ if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_'
+ act = copytext(act,1,length(act))
+
+ if(src.stat == DEAD)
+ return
+ act = lowertext(act)
+ switch(act)
+
+ if("alarm")
+ to_chat(src, "You sound an alarm.")
+ message = "\The [src] sounds an alarm."
+ m_type = 2
+ if("alert")
+ to_chat(src, "You let out a distressed noise.")
+ message = "\The [src] lets out a distressed noise."
+ m_type = 2
+ if("notice")
+ to_chat(src, "You play a loud tone.")
+ message = "\The [src] plays a loud tone."
+ m_type = 2
+ if("flash")
+ message = "The lights on \the [src] flash quickly."
+ m_type = 1
+ if("blink")
+ message = "\The [src] blinks."
+ m_type = 1
+ if("whistle")
+ to_chat(src, "You whistle.")
+ message = "\The [src] whistles."
+ m_type = 2
+ if("beep")
+ to_chat(src, "You beep.")
+ message = "\The [src] beeps."
+ m_type = 2
+ if("boop")
+ to_chat(src, "You boop.")
+ message = "\The [src] boops."
+ m_type = 2
+ if("help")
+ to_chat(src, "alarm, alert, notice, flash,blink, whistle, beep, boop")
+
+ if(message && !stat)
..(act, m_type, message)
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm
index 63eb38e607f..40273bf66ad 100644
--- a/code/modules/mob/living/carbon/brain/life.dm
+++ b/code/modules/mob/living/carbon/brain/life.dm
@@ -65,13 +65,13 @@
/mob/living/carbon/brain/handle_vision()
..()
- if (stat == 2 || (XRAY in src.mutations))
+ if(stat == 2 || (XRAY in src.mutations))
sight |= SEE_TURFS
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
- else if (stat != 2)
+ else if(stat != 2)
sight &= ~SEE_TURFS
sight &= ~SEE_MOBS
sight &= ~SEE_OBJS
diff --git a/code/modules/mob/living/carbon/brain/posibrain.dm b/code/modules/mob/living/carbon/brain/posibrain.dm
index f6cdb0362e3..ea9dffd3ca0 100644
--- a/code/modules/mob/living/carbon/brain/posibrain.dm
+++ b/code/modules/mob/living/carbon/brain/posibrain.dm
@@ -13,6 +13,7 @@
req_access = list(access_robotics)
mecha = null//This does not appear to be used outside of reference in mecha.dm.
var/silenced = 0 //if set to 1, they can't talk.
+ var/next_ping_at = 0
/obj/item/device/mmi/posibrain/attack_self(mob/user as mob)
@@ -53,6 +54,8 @@
return 0
if(jobban_isbanned(O, "Cyborg") || jobban_isbanned(O,"nonhumandept"))
return 0
+ if(!O.can_reenter_corpse)
+ return 0
if(O.client)
return 1
return 0
@@ -64,7 +67,7 @@
if(!C || brainmob.key || 0 == searching) return //handle logouts that happen whilst the alert is waiting for a response, and responses issued after a brain has been located.
if(response == "Yes")
transfer_personality(C.mob)
- else if (response == "Never for this round")
+ else if(response == "Never for this round")
C.prefs.be_special -= ROLE_POSIBRAIN
// This should not ever happen, but let's be safe
@@ -99,7 +102,7 @@
src.brainmob.mind.assigned_role = "Positronic Brain"
var/turf/T = get_turf_or_move(src.loc)
- for (var/mob/M in viewers(T))
+ for(var/mob/M in viewers(T))
M.show_message("\blue The positronic brain chimes quietly.")
icon_state = "posibrain-occupied"
@@ -110,7 +113,7 @@
icon_state = "posibrain"
var/turf/T = get_turf_or_move(src.loc)
- for (var/mob/M in viewers(T))
+ for(var/mob/M in viewers(T))
M.show_message("\blue The positronic brain buzzes quietly, and the golden lights fade away. Perhaps you could try again?")
/obj/item/device/mmi/posibrain/Topic(href,href_list)
@@ -144,11 +147,12 @@
/obj/item/device/mmi/posibrain/examine(mob/user)
+ to_chat(user, "*---------*")
if(!..(user))
+ to_chat(user, "*---------*")
return
- var/msg = "*---------*\nThis is \icon[src] \a [src]!\n[desc]\n"
- msg += ""
+ var/msg = ""
if(src.brainmob && src.brainmob.key)
switch(src.brainmob.stat)
@@ -158,7 +162,7 @@
if(DEAD) msg += "It appears to be completely inactive.\n"
else
msg += "It appears to be completely inactive.\n"
- msg += "*---------*"
+ msg += "*---------*"
to_chat(user, msg)
/obj/item/device/mmi/posibrain/emp_act(severity)
@@ -182,7 +186,6 @@
src.brainmob.container = src
src.brainmob.stat = 0
src.brainmob.silent = 0
- src.brainmob.brain_op_stage = 4.0
dead_mob_list -= src.brainmob
..()
@@ -190,9 +193,13 @@
/obj/item/device/mmi/posibrain/attack_ghost(var/mob/dead/observer/O)
if(searching)
volunteer(O)
- else
+ return
+ if(brainmob && brainmob.key)
+ return // No point pinging a posibrain with a player already inside
+ if(check_observer(O) && (world.time >= next_ping_at))
+ next_ping_at = world.time + (20 SECONDS)
var/turf/T = get_turf_or_move(src.loc)
- for (var/mob/M in viewers(T))
+ for(var/mob/M in viewers(T))
M.show_message("\blue The positronic brain pings softly.")
/obj/item/device/mmi/posibrain/ipc
diff --git a/code/modules/mob/living/carbon/brain/say.dm b/code/modules/mob/living/carbon/brain/say.dm
index 03d6906b876..a343d245424 100644
--- a/code/modules/mob/living/carbon/brain/say.dm
+++ b/code/modules/mob/living/carbon/brain/say.dm
@@ -1,6 +1,6 @@
//TODO: Convert this over for languages.
/mob/living/carbon/brain/say(var/message, var/datum/language/speaking = null)
- if (silent)
+ if(silent)
return
if(!(container && istype(container, /obj/item/device/mmi)))
@@ -24,9 +24,9 @@
if("headset")
var/radio_worked = 0 // If any of the radios our brainmob could use functioned, this is set true so that we don't use any others
// I'm doing it this way so that if the mecha radio fails for some reason, a radio MMI still has the built-in fallback
- if (container && istype(container,/obj/item/device/mmi))
+ if(container && istype(container,/obj/item/device/mmi))
var/obj/item/device/mmi/c = container
- if (!radio_worked && c.mecha)
+ if(!radio_worked && c.mecha)
var/obj/mecha/metalgear = c.mecha
if(metalgear.radio)
radio_worked = metalgear.radio.talk_into(src, message, message_mode, verb, speaking)
@@ -36,7 +36,7 @@
if(R.radio)
radio_worked = R.radio.talk_into(src, message, message_mode, verb, speaking)
return radio_worked
- if ("whisper")
+ if("whisper")
whisper_say(message, speaking, alt_name)
return 1
else return 0
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index 5a641a81689..a4381ebf7a6 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -25,7 +25,7 @@
return ..()
/mob/living/carbon/blob_act()
- if (stat == DEAD)
+ if(stat == DEAD)
return
else
show_message("The blob attacks!")
@@ -65,7 +65,7 @@
if(istype(src, /mob/living/carbon/human))
var/mob/living/carbon/human/H = src
var/obj/item/organ/external/organ = H.get_organ("chest")
- if (istype(organ))
+ if(istype(organ))
if(organ.take_damage(d, 0))
H.UpdateDamageIcon()
@@ -119,7 +119,7 @@
if(stun)
adjustToxLoss(-3)
T = get_step(T, dir)
- if (is_blocked_turf(T))
+ if(is_blocked_turf(T))
break
return 1
@@ -168,7 +168,7 @@
if(!tesla_shock || (tesla_shock && siemens_coeff > 0.5))
Stun(3)
Weaken(3)
- if (shock_damage > 200)
+ if(shock_damage > 200)
src.visible_message(
"[src] was arc flashed by the [source]!", \
"The [source] arc flashes and electrocutes you!", \
@@ -213,7 +213,7 @@
swap_hand()
/mob/living/carbon/proc/help_shake_act(mob/living/carbon/M)
- if (src.health >= config.health_threshold_crit)
+ if(src.health >= config.health_threshold_crit)
if(src == M && istype(src, /mob/living/carbon/human))
var/mob/living/carbon/human/H = src
src.visible_message( \
@@ -261,11 +261,11 @@
"You shake [src], but they are unresponsive. Probably suffering from SSD.")
if(lying) // /vg/: For hugs. This is how update_icon figgers it out, anyway. - N3X15
var/t_him = "it"
- if (src.gender == MALE)
+ if(src.gender == MALE)
t_him = "him"
- else if (src.gender == FEMALE)
+ else if(src.gender == FEMALE)
t_him = "her"
- if (istype(src,/mob/living/carbon/human) && src:w_uniform)
+ if(istype(src,/mob/living/carbon/human) && src:w_uniform)
var/mob/living/carbon/human/H = src
H.w_uniform.add_fingerprint(M)
src.sleeping = max(0,src.sleeping-5)
@@ -455,6 +455,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
for(var/obj/machinery/atmospherics/A in totalMembers)
if(!A.pipe_image)
A.pipe_image = image(A, A.loc, layer = 20, dir = A.dir) //the 20 puts it above Byond's darkness (not its opacity view)
+ A.pipe_image.plane = HUD_PLANE
pipes_shown += A.pipe_image
client.images += A.pipe_image
@@ -497,7 +498,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
//Throwing stuff
/mob/living/carbon/proc/toggle_throw_mode()
- if (in_throw_mode)
+ if(in_throw_mode)
throw_mode_off()
else
throw_mode_on()
@@ -517,63 +518,40 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
/mob/living/carbon/throw_item(atom/target)
throw_mode_off()
- if(stat || !target)
+ if(!target || !isturf(loc))
return
- if(target.type == /obj/screen)
+ if(istype(target, /obj/screen))
return
- var/atom/movable/item = get_active_hand()
+ var/atom/movable/thrown_thing
+ var/obj/item/I = src.get_active_hand()
- if(!item || (item.flags & NODROP))
+ if(!I || (I.flags & NODROP))
return
- if (istype(item, /obj/item/weapon/grab))
- var/obj/item/weapon/grab/G = item
- item = G.get_mob_if_throwable() //throw the person instead of the grab
- if(ismob(item))
+ if(istype(I, /obj/item/weapon/grab))
+ var/obj/item/weapon/grab/G = I
+ var/mob/throwable_mob = G.get_mob_if_throwable() //throw the person instead of the grab
+ qdel(G) //We delete the grab.
+ if(throwable_mob)
+ thrown_thing = throwable_mob
var/turf/start_T = get_turf(loc) //Get the start and target tile for the descriptors
var/turf/end_T = get_turf(target)
if(start_T && end_T)
- var/mob/M = item
var/start_T_descriptor = "tile at [start_T.x], [start_T.y], [start_T.z] in area [get_area(start_T)]"
var/end_T_descriptor = "tile at [end_T.x], [end_T.y], [end_T.z] in area [get_area(end_T)]"
- M.attack_log += text("\[[time_stamp()]\] Has been thrown by [key_name(src)] from [start_T_descriptor] with the target [end_T_descriptor]")
- attack_log += text("\[[time_stamp()]\] Has thrown [key_name(M)] from [start_T_descriptor] with the target [end_T_descriptor]")
- msg_admin_attack("[key_name_admin(src)] has thrown [key_name_admin(M)] from [start_T_descriptor] with the target [end_T_descriptor]")
+ add_logs(throwable_mob, src, "thrown", addition="from [start_T_descriptor] with the target [end_T_descriptor]")
- if(!iscarbon(src))
- M.LAssailant = null
- else
- M.LAssailant = src
-
- if(!item)
- return //Grab processing has a chance of returning null
- if(!ismob(item)) //Honk mobs don't have a dropped() proc honk
- unEquip(item)
- update_icons()
-
- if (istype(src, /mob/living/carbon)) //Check if a carbon mob is throwing. Modify/remove this line as required.
- item.loc = loc
- if(client)
- client.screen -= item
- if(istype(item, /obj/item))
- item:dropped(src) // let it know it's been dropped
-
- //actually throw it!
- if (item)
- item.layer = initial(item.layer)
- visible_message("\red [src] has thrown [item].")
+ else if(!(I.flags & ABSTRACT)) //can't throw abstract items
+ thrown_thing = I
+ unEquip(I)
+ if(thrown_thing)
+ visible_message("[src] has thrown [thrown_thing].")
newtonian_move(get_dir(target, src))
+ thrown_thing.throw_at(target, thrown_thing.throw_range, thrown_thing.throw_speed, src)
- item.throw_at(target, item.throw_range, item.throw_speed, src)
-/*
-/mob/living/carbon/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
- ..()
- src.IgniteMob()
- bodytemperature = max(bodytemperature, BODYTEMP_HEAT_DAMAGE_LIMIT+10)
-*/
/mob/living/carbon/can_use_hands()
if(handcuffed)
return 0
@@ -582,10 +560,11 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
return 1
/mob/living/carbon/restrained()
- if (handcuffed)
+ if(handcuffed)
return 1
return
+
/mob/living/carbon/unEquip(obj/item/I) //THIS PROC DID NOT CALL ..()
. = ..() //Sets the default return value to what the parent returns.
if(!. || !I) //We don't want to set anything to null if the parent returned 0.
@@ -661,8 +640,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
if(do_mob(usr, src, POCKET_STRIP_DELAY))
if(internal)
internal = null
- if(internals)
- internals.icon_state = "internal0"
+ update_internals_hud_icon(0)
else
var/no_mask2
if(!(wear_mask && wear_mask.flags & AIRTIGHT))
@@ -672,8 +650,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
to_chat(usr, "[src] is not wearing a suitable mask or helmet!")
return
internal = ITEM
- if(internals)
- internals.icon_state = "internal1"
+ update_internals_hud_icon(1)
visible_message("[usr] [internal ? "opens" : "closes"] the valve on [src]'s [ITEM].", \
"[usr] [internal ? "opens" : "closes"] the valve on [src]'s [ITEM].")
@@ -863,13 +840,19 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
//called when we get cuffed/uncuffed
/mob/living/carbon/proc/update_handcuffed()
if(handcuffed)
+ //we don't want problems with nodrop shit if there ever is more than one nodrop twohanded
+ var/obj/item/I = get_active_hand()
+ if(istype(I, /obj/item/weapon/twohanded))
+ var/obj/item/weapon/twohanded/TH = I //FML
+ if(TH.wielded)
+ TH.unwield()
drop_r_hand()
drop_l_hand()
stop_pulling()
throw_alert("handcuffed", /obj/screen/alert/restrained/handcuffed, new_master = src.handcuffed)
else
clear_alert("handcuffed")
- update_action_buttons() //some of our action buttons might be unusable when we're handcuffed.
+ update_action_buttons_icon() //some of our action buttons might be unusable when we're handcuffed.
update_inv_handcuffed()
update_hud_handcuffed()
@@ -901,49 +884,51 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
wear_mask)
/mob/living/carbon/proc/uncuff()
- if (handcuffed)
+ if(handcuffed)
var/obj/item/weapon/W = handcuffed
handcuffed = null
- if (buckled && buckled.buckle_requires_restraints)
+ if(buckled && buckled.buckle_requires_restraints)
buckled.unbuckle_mob()
update_handcuffed()
- if (client)
+ if(client)
client.screen -= W
- if (W)
+ if(W)
W.loc = loc
W.dropped(src)
- if (W)
+ if(W)
W.layer = initial(W.layer)
- if (legcuffed)
+ W.plane = initial(W.plane)
+ if(legcuffed)
var/obj/item/weapon/W = legcuffed
legcuffed = null
update_inv_legcuffed()
- if (client)
+ if(client)
client.screen -= W
- if (W)
+ if(W)
W.loc = loc
W.dropped(src)
- if (W)
+ if(W)
W.layer = initial(W.layer)
+ W.plane = initial(W.plane)
/mob/living/carbon/proc/slip(var/description, var/stun, var/weaken, var/tilesSlipped, var/walkSafely, var/slipAny)
- if (flying || buckled || (walkSafely && m_intent == "walk"))
+ if(flying || buckled || (walkSafely && m_intent == "walk"))
return
- if ((lying) && (!(tilesSlipped)))
+ if((lying) && (!(tilesSlipped)))
return
- if (!(slipAny))
- if (istype(src, /mob/living/carbon/human))
+ if(!(slipAny))
+ if(istype(src, /mob/living/carbon/human))
var/mob/living/carbon/human/H = src
- if ((isobj(H.shoes) && H.shoes.flags & NOSLIP) || H.species.bodyflags & FEET_NOSLIP)
+ if((isobj(H.shoes) && H.shoes.flags & NOSLIP) || H.species.bodyflags & FEET_NOSLIP)
return
- if (tilesSlipped)
+ if(tilesSlipped)
for(var/t = 0, t<=tilesSlipped, t++)
spawn (t) step(src, src.dir)
stop_pulling()
to_chat(src, "You slipped on the [description]!")
playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
- if (stun)
+ if(stun)
Stun(stun)
Weaken(weaken)
return 1
@@ -975,15 +960,15 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
if(istype(toEat, /obj/item/weapon/reagent_containers/food/pill))
to_chat(src, "You [toEat.apply_method] [toEat].")
else
- if (fullness <= 50)
+ if(fullness <= 50)
to_chat(src, "You hungrily chew out a piece of [toEat] and gobble it!")
- else if (fullness > 50 && fullness <= 150)
+ else if(fullness > 50 && fullness <= 150)
to_chat(src, "You hungrily begin to eat [toEat].")
- else if (fullness > 150 && fullness <= 350)
+ else if(fullness > 150 && fullness <= 350)
to_chat(src, "You take a bite of [toEat].")
- else if (fullness > 350 && fullness <= 550)
+ else if(fullness > 350 && fullness <= 550)
to_chat(src, "You unwillingly chew a bit of [toEat].")
- else if (fullness > (550 * (1 + overeatduration / 2000))) // The more you eat - the more you can eat
+ else if(fullness > (550 * (1 + overeatduration / 2000))) // The more you eat - the more you can eat
to_chat(src, "You cannot force any more of [toEat] to go down your throat.")
return 0
return 1
@@ -992,13 +977,15 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
return 1
/mob/living/carbon/proc/forceFed(var/obj/item/weapon/reagent_containers/food/toEat, mob/user, fullness)
- if (fullness <= (550 * (1 + overeatduration / 1000)))
- visible_message("[user] attempts to force [src] to [toEat.apply_method] [toEat].")
+ if(fullness <= (550 * (1 + overeatduration / 1000)))
+ if(!toEat.instant_application)
+ visible_message("[user] attempts to force [src] to [toEat.apply_method] [toEat].")
else
visible_message("[user] cannot force anymore of [toEat] down [src]'s throat.")
return 0
- if(!do_mob(user, src))
- return 0
+ if(!toEat.instant_application)
+ if(!do_mob(user, src))
+ return 0
forceFedAttackLog(toEat, user)
visible_message("[user] forces [src] to [toEat.apply_method] [toEat].")
return 1
@@ -1038,3 +1025,16 @@ so that different stomachs can handle things in different ways VB*/
var/obj/item/LH = get_inactive_hand()
if(LH)
. |= LH.GetAccess()
+
+/mob/living/carbon/proc/can_breathe_gas()
+ if(!wear_mask)
+ return TRUE
+
+ if(!(wear_mask.flags & BLOCK_GAS_SMOKE_EFFECT) && internal == null)
+ return TRUE
+
+ return FALSE
+
+/mob/living/carbon/proc/update_internals_hud_icon(internal_state = 0)
+ if(hud_used && hud_used.internals)
+ hud_used.internals.icon_state = "internal[internal_state]"
diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm
index 07a6a0d28cd..e900fc10517 100644
--- a/code/modules/mob/living/carbon/carbon_defines.dm
+++ b/code/modules/mob/living/carbon/carbon_defines.dm
@@ -1,15 +1,12 @@
-/mob/living/carbon/
+/mob/living/carbon
gender = MALE
hud_possible = list(HEALTH_HUD,STATUS_HUD,SPECIALROLE_HUD)
var/list/stomach_contents = list()
var/list/internal_organs = list()
- var/brain_op_stage = 0.0
var/antibodies = 0
- var/last_eating = 0 //Not sure what this does... I found it hidden in food.dm
var/life_tick = 0 // The amount of life ticks that have processed on this mob.
- var/analgesic = 0 // when this is set, the mob isn't affected by shock or pain
- // life should decrease this by 1 every tick
+
// total amount of wounds on mob, used to spread out healing and the like over all wounds
var/number_wounds = 0
var/obj/item/handcuffed = null //Whether or not the mob is handcuffed
diff --git a/code/modules/mob/living/carbon/death.dm b/code/modules/mob/living/carbon/death.dm
index fca8c59fec3..b0ccdc8381d 100644
--- a/code/modules/mob/living/carbon/death.dm
+++ b/code/modules/mob/living/carbon/death.dm
@@ -2,4 +2,8 @@
losebreath = 0
med_hud_set_health()
med_hud_set_status()
+
+ if(reagents)
+ reagents.death_metabolize(src)
+
..(gibbed)
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/give.dm b/code/modules/mob/living/carbon/give.dm
index 13e8fe153ea..9dfa6efac89 100644
--- a/code/modules/mob/living/carbon/give.dm
+++ b/code/modules/mob/living/carbon/give.dm
@@ -49,6 +49,7 @@
target.l_hand = I
I.loc = target
I.layer = 20
+ I.plane = HUD_PLANE
I.add_fingerprint(target)
src.update_inv_l_hand()
src.update_inv_r_hand()
diff --git a/code/modules/mob/living/carbon/human/appearance.dm b/code/modules/mob/living/carbon/human/appearance.dm
index 52488051f50..ca241306f00 100644
--- a/code/modules/mob/living/carbon/human/appearance.dm
+++ b/code/modules/mob/living/carbon/human/appearance.dm
@@ -243,7 +243,7 @@
return 1
/mob/living/carbon/human/proc/change_skin_tone(var/tone)
- if(s_tone == tone || !(species.bodyflags & HAS_SKIN_TONE))
+ if(s_tone == tone || !((species.bodyflags & HAS_SKIN_TONE) || (species.bodyflags & HAS_ICON_SKIN_TONE)))
return
s_tone = tone
@@ -374,7 +374,7 @@
var/list/valid_body_accessories = new()
for(var/B in body_accessory_by_name)
var/datum/body_accessory/A = body_accessory_by_name[B]
- if(check_rights(R_ADMIN, 1, src))
+ if(check_rights(R_ADMIN, 0, src))
valid_body_accessories = body_accessory_by_name.Copy()
else
if(!istype(A))
diff --git a/code/modules/mob/living/carbon/human/body_accessories.dm b/code/modules/mob/living/carbon/human/body_accessories.dm
index 677e4b42784..f4b95eec4d4 100644
--- a/code/modules/mob/living/carbon/human/body_accessories.dm
+++ b/code/modules/mob/living/carbon/human/body_accessories.dm
@@ -102,6 +102,13 @@ var/global/list/body_accessory_by_species = list("None" = null)
return 0
+/datum/body_accessory/tail/wingler_tail // Jay wingler fluff tail
+ name = "Jay Wingler Tail"
+
+ icon_state = "winglertail"
+ animated_icon_state = "winglertail_a"
+
+
//Vulpkanin
/datum/body_accessory/tail/vulpkanin_2
name = "Vulpkanin Alt 1 (Bushy)"
@@ -130,3 +137,11 @@ var/global/list/body_accessory_by_species = list("None" = null)
icon_state = "vulptail5"
animated_icon_state = "vulptail5_a"
allowed_species = list("Vulpkanin")
+
+/datum/body_accessory/tail/vulpkanin_6
+ name = "Vulpkanin Alt 5 (Straight Bushy)"
+
+ icon_state = "vulptail6"
+ animated_icon_state = "vulptail6_a"
+ allowed_species = list("Vulpkanin")
+
diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm
index fce12362d73..d3606b12b8a 100644
--- a/code/modules/mob/living/carbon/human/death.dm
+++ b/code/modules/mob/living/carbon/human/death.dm
@@ -111,17 +111,13 @@
if(istype(I,/mob/living/simple_animal/borer))
B = I
if(B)
- if(!B.ckey && ckey && B.controlling)
+ if(B.controlling && B.host == src)
B.detatch()
verbs -= /mob/living/carbon/proc/release_control
callHook("death", list(src, gibbed))
- if(ticker && ticker.mode)
- if(istype(ticker.mode,/datum/game_mode/heist))
- vox_kills++ //Bad vox. Shouldn't be killing humans.
-
if(ishuman(LAssailant))
var/mob/living/carbon/human/H=LAssailant
if(H.mind)
@@ -148,10 +144,11 @@
var/obj/item/organ/external/head/H = get_organ("head")
if(SKELETON in src.mutations) return
- if(H.f_style)
- H.f_style = "Shaved"
- if(H.h_style)
- H.h_style = "Bald"
+ if(istype(H))
+ if(H.f_style)
+ H.f_style = "Shaved"
+ if(H.h_style)
+ H.h_style = "Bald"
update_fhair(0)
update_hair(0)
@@ -166,10 +163,11 @@
var/obj/item/organ/external/head/H = organs_by_name["head"]
if(HUSK in mutations) return
- if(H.f_style)
- H.f_style = "Shaved" //we only change the icon_state of the hair datum, so it doesn't mess up their UI/UE
- if(H.h_style)
- H.h_style = "Bald"
+ if(istype(H))
+ if(H.f_style)
+ H.f_style = "Shaved" //we only change the icon_state of the hair datum, so it doesn't mess up their UI/UE
+ if(H.h_style)
+ H.h_style = "Bald"
update_fhair(0)
update_hair(0)
diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm
index b1d7e356b39..ef5768fcb0e 100644
--- a/code/modules/mob/living/carbon/human/emote.dm
+++ b/code/modules/mob/living/carbon/human/emote.dm
@@ -1,884 +1,889 @@
-/mob/living/carbon/human/emote(var/act,var/m_type=1,var/message = null,var/force)
-
- if (stat == DEAD)
- return // No screaming bodies
-
- var/param = null
- if (findtext(act, "-", 1, null))
- var/t1 = findtext(act, "-", 1, null)
- param = copytext(act, t1 + 1, length(act) + 1)
- act = copytext(act, 1, t1)
-
- var/muzzled = is_muzzled()
- if(sdisabilities & MUTE || silent)
- muzzled = 1
- //var/m_type = 1
-
- for (var/obj/item/weapon/implant/I in src)
- if (I.implanted)
- I.trigger(act, src)
-
- var/miming = 0
- if(mind)
- miming = mind.miming
-
- //Emote Cooldown System (it's so simple!)
- // proc/handle_emote_CD() located in [code\modules\mob\emote.dm]
- var/on_CD = 0
- act = lowertext(act)
- switch(act)
- //Cooldown-inducing emotes
- if("ping", "pings", "buzz", "buzzes", "beep", "beeps", "yes", "no")
- if (species.name == "Machine") //Only Machines can beep, ping, and buzz
- on_CD = handle_emote_CD() //proc located in code\modules\mob\emote.dm
- else //Everyone else fails, skip the emote attempt
- return
- if("drone","drones","hum","hums","rumble","rumbles")
- if (species.name == "Drask") //Only Drask can make whale noises
- on_CD = handle_emote_CD() //proc located in code\modules\mob\emote.dm
- else
- return
- if("squish", "squishes")
- var/found_slime_bodypart = 0
-
- if(species.name == "Slime People") //Only Slime People can squish
- on_CD = handle_emote_CD() //proc located in code\modules\mob\emote.dm'
- found_slime_bodypart = 1
- else
- for(var/obj/item/organ/external/L in organs) // if your limbs are squishy you can squish too!
- if(L.dna.species in list("Slime People"))
- on_CD = handle_emote_CD()
- found_slime_bodypart = 1
- break
-
- if(!found_slime_bodypart) //Everyone else fails, skip the emote attempt
- return
- if("scream", "screams")
- on_CD = handle_emote_CD(50) //longer cooldown
- if("fart", "farts", "flip", "flips", "snap", "snaps")
- on_CD = handle_emote_CD() //proc located in code\modules\mob\emote.dm
- //Everything else, including typos of the above emotes
- else
- on_CD = 0 //If it doesn't induce the cooldown, we won't check for the cooldown
-
- if(on_CD == 1) // Check if we need to suppress the emote attempt.
- return // Suppress emote, you're still cooling off.
-
- switch(act)
- if("me") //OKAY SO RANT TIME, THIS FUCKING HAS TO BE HERE OR A SHITLOAD OF THINGS BREAK
- return custom_emote(m_type, message) //DO YOU KNOW WHY SHIT BREAKS? BECAUSE SO MUCH OLDCODE CALLS mob.emote("me",1,"whatever_the_fuck_it_wants_to_emote")
- //WHO THE FUCK THOUGHT THAT WAS A GOOD FUCKING IDEA!?!?
-
- if("ping", "pings")
- var/M = null
- if(param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
- M = A
- break
- if(!M)
- param = null
-
- if (param)
- message = "[src] pings at [param]."
- else
- message = "[src] pings."
- playsound(src.loc, 'sound/machines/ping.ogg', 50, 0)
- m_type = 2
-
- if("buzz", "buzzes")
- var/M = null
- if(param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
- M = A
- break
- if(!M)
- param = null
-
- if (param)
- message = "[src] buzzes at [param]."
- else
- message = "[src] buzzes."
- playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0)
- m_type = 2
-
- if("beep", "beeps")
- var/M = null
- if(param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
- M = A
- break
- if(!M)
- param = null
-
- if (param)
- message = "[src] beeps at [param]."
- else
- message = "[src] beeps."
- playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0)
- m_type = 2
-
- if("drone", "drones", "hum", "hums", "rumble", "rumbles")
- var/M = null
- if(param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
- M = A
- break
- if(!M)
- param = null
-
- if (param)
- message = "[src] drones at [param]."
- else
- message = "[src] rumbles."
- playsound(src.loc, 'sound/voice/DraskTalk.ogg', 50, 0)
- m_type = 2
-
- if("squish", "squishes")
- var/M = null
- if(param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
- M = A
- break
- if(!M)
- param = null
-
- if (param)
- message = "[src] squishes at [param]."
- else
- message = "[src] squishes."
- playsound(src.loc, 'sound/effects/slime_squish.ogg', 50, 0) //Credit to DrMinky (freesound.org) for the sound.
- m_type = 2
-
- if("yes")
- var/M = null
- if(param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
- M = A
- break
- if(!M)
- param = null
-
- if (param)
- message = "[src] emits an affirmative blip at [param]."
- else
- message = "[src] emits an affirmative blip."
- playsound(src.loc, 'sound/machines/synth_yes.ogg', 50, 0)
- m_type = 2
-
- if("no")
- var/M = null
- if(param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
- M = A
- break
- if(!M)
- param = null
-
- if (param)
- message = "[src] emits a negative blip at [param]."
- else
- message = "[src] emits a negative blip."
- playsound(src.loc, 'sound/machines/synth_no.ogg', 50, 0)
- m_type = 2
-
- if("wag", "wags")
- if(body_accessory)
- if(body_accessory.try_restrictions(src))
- message = "[src] starts wagging \his tail."
- start_tail_wagging(1)
-
- else if(species.bodyflags & TAIL_WAGGING)
- if(!wear_suit || !(wear_suit.flags_inv & HIDETAIL) && !istype(wear_suit, /obj/item/clothing/suit/space))
- message = "[src] starts wagging \his tail."
- src.start_tail_wagging(1)
- else
- return
- else
- return
- m_type = 1
-
- if("swag", "swags")
- if(species.bodyflags & TAIL_WAGGING || body_accessory)
- message = "[src] stops wagging \his tail."
- src.stop_tail_wagging(1)
- else
- return
- m_type = 1
-
- if ("airguitar")
- if (!src.restrained())
- message = "[src] is strumming the air and headbanging like a safari chimp."
- m_type = 1
-
- if ("blink", "blinks")
- message = "[src] blinks."
- m_type = 1
-
- if ("blink_r", "blinks_r")
- message = "[src] blinks rapidly."
- m_type = 1
-
- if ("bow", "bows")
- if (!src.buckled)
- var/M = null
- if (param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
- M = A
- break
- if (!M)
- param = null
-
- if (param)
- message = "[src] bows to [param]."
- else
- message = "[src] bows."
- m_type = 1
-
- if ("salute", "salutes")
- if (!src.buckled)
- var/M = null
- if (param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
- M = A
- break
- if (!M)
- param = null
-
- if (param)
- message = "[src] salutes to [param]."
- else
- message = "[src] salutes."
- m_type = 1
-
- if ("choke", "chokes")
- if(miming)
- message = "[src] clutches \his throat desperately!"
- m_type = 1
- else
- if (!muzzled)
- message = "[src] chokes!"
- m_type = 2
- else
- message = "[src] makes a strong noise."
- m_type = 2
-
- if ("burp", "burps")
- if(miming)
- message = "[src] opens their mouth rather obnoxiously."
- m_type = 1
- else
- if (!muzzled)
- message = "[src] burps."
- m_type = 2
- else
- message = "[src] makes a peculiar noise."
- m_type = 2
- if ("clap", "claps")
- if (!src.restrained())
- message = "[src] claps."
- m_type = 2
- if(miming)
- m_type = 1
- if ("flap", "flaps")
- if (!src.restrained())
- message = "[src] flaps \his wings."
- m_type = 2
- if(miming)
- m_type = 1
-
- if ("flip", "flips")
- m_type = 1
- if (!src.restrained())
- var/M = null
- if (param)
- for (var/mob/A in view(1, null))
- if (param == A.name)
- M = A
- break
- if (M == src)
- M = null
-
- if(M)
- if(lying || weakened)
- message = "[src] flops and flails around on the floor."
- else
- message = "[src] flips in [M]'s general direction."
- SpinAnimation(5,1)
- else
- if(lying || weakened)
- message = "[src] flops and flails around on the floor."
- else
- var/obj/item/weapon/grab/G
- if(istype(get_active_hand(), /obj/item/weapon/grab))
- G = get_active_hand()
- if(G && G.affecting)
- if(buckled || G.affecting.buckled)
- return
- var/turf/oldloc = loc
- var/turf/newloc = G.affecting.loc
- if(isturf(oldloc) && isturf(newloc))
- SpinAnimation(5,1)
- forceMove(newloc)
- G.affecting.forceMove(oldloc)
- message = "[src] flips over [G.affecting]!"
- else
- message = "[src] does a flip!"
- SpinAnimation(5,1)
-
- if ("aflap", "aflaps")
- if (!src.restrained())
- message = "[src] flaps \his wings ANGRILY!"
- m_type = 2
- if(miming)
- m_type = 1
-
- if ("drool", "drools")
- message = "[src] drools."
- m_type = 1
-
- if ("eyebrow")
- message = "[src] raises an eyebrow."
- m_type = 1
-
- if ("chuckle", "chuckles")
- if(miming)
- message = "[src] appears to chuckle."
- m_type = 1
- else
- if (!muzzled)
- message = "[src] chuckles."
- m_type = 2
- else
- message = "[src] makes a noise."
- m_type = 2
-
- if ("twitch", "twitches")
- message = "[src] twitches violently."
- m_type = 1
-
- if ("twitch_s", "twitches_s")
- message = "[src] twitches."
- m_type = 1
-
- if ("faint", "faints")
- message = "[src] faints."
- if(src.sleeping)
- return //Can't faint while asleep
- src.sleeping += 1
- m_type = 1
-
- if ("cough", "coughs")
- if(miming)
- message = "[src] appears to cough!"
- m_type = 1
- else
- if (!muzzled)
- message = "[src] coughs!"
- m_type = 2
- else
- message = "[src] makes a strong noise."
- m_type = 2
-
- if ("frown", "frowns")
- message = "[src] frowns."
- m_type = 1
-
- if ("nod", "nods")
- message = "[src] nods."
- m_type = 1
-
- if ("blush", "blushes")
- message = "[src] blushes."
- m_type = 1
-
- if ("wave", "waves")
- message = "[src] waves."
- m_type = 1
-
- if ("quiver", "quivers")
- message = "[src] quivers."
- m_type = 1
-
- if ("gasp", "gasps")
- if(miming)
- message = "[src] appears to be gasping!"
- m_type = 1
- else
- if (!muzzled)
- message = "[src] gasps!"
- m_type = 2
- else
- message = "[src] makes a weak noise."
- m_type = 2
-
- if ("deathgasp", "deathgasps")
- message = "[src] [species.death_message]"
- m_type = 1
-
- if ("giggle", "giggles")
- if(miming)
- message = "[src] giggles silently!"
- m_type = 1
- else
- if (!muzzled)
- message = "[src] giggles."
- m_type = 2
- else
- message = "[src] makes a noise."
- m_type = 2
-
- if ("glare", "glares")
- var/M = null
- if (param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
- M = A
- break
- if (!M)
- param = null
-
- if (param)
- message = "[src] glares at [param]."
- else
- message = "[src] glares."
- m_type = 1
-
- if ("stare", "stares")
- var/M = null
- if (param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
- M = A
- break
- if (!M)
- param = null
-
- if (param)
- message = "[src] stares at [param]."
- else
- message = "[src] stares."
- m_type = 1
-
- if ("look", "looks")
- var/M = null
- if (param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
- M = A
- break
-
- if (!M)
- param = null
-
- if (param)
- message = "[src] looks at [param]."
- else
- message = "[src] looks."
- m_type = 1
-
- if ("grin", "grins")
- message = "[src] grins."
- m_type = 1
-
- if ("cry", "cries")
- if(miming)
- message = "[src] cries."
- m_type = 1
- else
- if (!muzzled)
- message = "[src] cries."
- m_type = 2
- else
- message = "[src] makes a weak noise. \He frowns."
- m_type = 2
-
- if ("sigh", "sighs")
- if(miming)
- message = "[src] sighs."
- m_type = 1
- else
- if (!muzzled)
- message = "[src] sighs."
- m_type = 2
- else
- message = "[src] makes a weak noise."
- m_type = 2
-
- if ("laugh", "laughs")
- if(miming)
- message = "[src] acts out a laugh."
- m_type = 1
- else
- if (!muzzled)
- message = "[src] laughs."
- m_type = 2
- else
- message = "[src] makes a noise."
- m_type = 2
-
- if ("mumble", "mumbles")
- message = "[src] mumbles!"
- m_type = 2
- if(miming)
- m_type = 1
-
- if ("grumble", "grumbles")
- if(miming)
- message = "[src] grumbles!"
- m_type = 1
- if (!muzzled)
- message = "[src] grumbles!"
- m_type = 2
- else
- message = "[src] makes a noise."
- m_type = 2
-
- if ("groan", "groans")
- if(miming)
- message = "[src] appears to groan!"
- m_type = 1
- else
- if (!muzzled)
- message = "[src] groans!"
- m_type = 2
- else
- message = "[src] makes a loud noise."
- m_type = 2
-
- if ("moan", "moans")
- if(miming)
- message = "[src] appears to moan!"
- m_type = 1
- else
- message = "[src] moans!"
- m_type = 2
-
- if ("johnny")
- var/M
- if (param)
- M = param
- if (!M)
- param = null
- else
- if(miming)
- message = "[src] takes a drag from a cigarette and blows \"[M]\" out in smoke."
- m_type = 1
- else
- message = "[src] says, \"[M], please. They had a family.\" [src.name] takes a drag from a cigarette and blows their name out in smoke."
- m_type = 2
-
- if ("point", "points")
- if (!src.restrained())
- var/atom/M = null
- if (param)
- for (var/atom/A as mob|obj|turf in view())
- if (param == A.name)
- M = A
- break
-
- if (!M)
- message = "[src] points."
- else
- pointed(M)
- m_type = 1
-
- if ("raise", "raises")
- if (!src.restrained())
- message = "[src] raises a hand."
- m_type = 1
-
- if("shake", "shakes")
- message = "[src] shakes \his head."
- m_type = 1
-
- if ("shrug", "shrugs")
- message = "[src] shrugs."
- m_type = 1
-
- if ("signal", "signals")
- if (!src.restrained())
- var/t1 = round(text2num(param))
- if (isnum(t1))
- if (t1 <= 5 && (!src.r_hand || !src.l_hand))
- message = "[src] raises [t1] finger\s."
- else if (t1 <= 10 && (!src.r_hand && !src.l_hand))
- message = "[src] raises [t1] finger\s."
- m_type = 1
-
- if ("smile", "smiles")
- message = "[src] smiles."
- m_type = 1
-
- if ("shiver", "shivers")
- message = "[src] shivers."
- m_type = 2
- if(miming)
- m_type = 1
-
- if ("pale", "pales")
- message = "[src] goes pale for a second."
- m_type = 1
-
- if ("tremble", "trembles")
- message = "[src] trembles."
- m_type = 1
-
- if ("sneeze", "sneezes")
- if (miming)
- message = "[src] sneezes."
- m_type = 1
- else
- if (!muzzled)
- message = "[src] sneezes."
- m_type = 2
- else
- message = "[src] makes a strange noise."
- m_type = 2
-
- if ("sniff", "sniffs")
- message = "[src] sniffs."
- m_type = 2
- if(miming)
- m_type = 1
-
- if ("snore", "snores")
- if (miming)
- message = "[src] sleeps soundly."
- m_type = 1
- else
- if (!muzzled)
- message = "[src] snores."
- m_type = 2
- else
- message = "[src] makes a noise."
- m_type = 2
-
- if ("whimper", "whimpers")
- if (miming)
- message = "[src] appears hurt."
- m_type = 1
- else
- if (!muzzled)
- message = "[src] whimpers."
- m_type = 2
- else
- message = "[src] makes a weak noise."
- m_type = 2
-
- if ("wink", "winks")
- message = "[src] winks."
- m_type = 1
-
- if ("yawn", "yawns")
- if (!muzzled)
- message = "[src] yawns."
- m_type = 2
- if(miming)
- m_type = 1
-
- if ("collapse", "collapses")
- Paralyse(2)
- message = "[src] collapses!"
- m_type = 2
- if(miming)
- m_type = 1
-
- if("hug", "hugs")
- m_type = 1
- if (!src.restrained())
- var/M = null
- if (param)
- for (var/mob/A in view(1, null))
- if (param == A.name)
- M = A
- break
- if (M == src)
- M = null
-
- if (M)
- message = "[src] hugs [M]."
- else
- message = "[src] hugs \himself."
-
- if ("handshake")
- m_type = 1
- if (!src.restrained() && !src.r_hand)
- var/mob/M = null
- if (param)
- for (var/mob/A in view(1, null))
- if (param == A.name)
- M = A
- break
- if (M == src)
- M = null
-
- if (M)
- if (M.canmove && !M.r_hand && !M.restrained())
- message = "[src] shakes hands with [M]."
- else
- message = "[src] holds out \his hand to [M]."
-
- if("dap", "daps")
- m_type = 1
- if (!src.restrained())
- var/M = null
- if (param)
- for (var/mob/A in view(1, null))
- if (param == A.name)
- M = A
- break
- if (M)
- message = "[src] gives daps to [M]."
- else
- message = "[src] sadly can't find anybody to give daps to, and daps \himself. Shameful."
-
- if("slap", "slaps")
- m_type = 1
- if (!src.restrained())
- var/M = null
- if (param)
- for (var/mob/A in view(1, null))
- if (param == A.name)
- M = A
- break
- if (M)
- message = "\red [src] slaps [M] across the face. Ouch!"
- playsound(src.loc, 'sound/effects/snap.ogg', 50, 1)
- else
- message = "\red [src] slaps \himself!"
- playsound(src.loc, 'sound/effects/snap.ogg', 50, 1)
- src.adjustFireLoss(4)
-
- if ("scream", "screams")
- if (miming)
- message = "[src] acts out a scream!"
- m_type = 1
- else
- if (!muzzled)
- message = "[src] [species.scream_verb]!"
- m_type = 2
- if(gender == FEMALE)
- playsound(src.loc, "[species.female_scream_sound]", 80, 1, 0, pitch = get_age_pitch())
- else
- playsound(src.loc, "[species.male_scream_sound]", 80, 1, 0, pitch = get_age_pitch()) //default to male screams if no gender is present.
-
- else
- message = "[src] makes a very loud noise."
- m_type = 2
-
-
- if ("snap", "snaps")
- if(prob(95))
- m_type = 2
- var/mob/living/carbon/human/H = src
- var/obj/item/organ/external/L = H.get_organ("l_hand")
- var/obj/item/organ/external/R = H.get_organ("r_hand")
- var/left_hand_good = 0
- var/right_hand_good = 0
- if(L && (!(L.status & ORGAN_DESTROYED)) && (!(L.status & ORGAN_SPLINTED)) && (!(L.status & ORGAN_BROKEN)))
- left_hand_good = 1
- if(R && (!(R.status & ORGAN_DESTROYED)) && (!(R.status & ORGAN_SPLINTED)) && (!(R.status & ORGAN_BROKEN)))
- right_hand_good = 1
-
- if (!left_hand_good && !right_hand_good)
- to_chat(usr, "You need at least one hand in good working order to snap your fingers.")
- return
-
- message = "[src] snaps \his fingers."
- playsound(src.loc, 'sound/effects/fingersnap.ogg', 50, 1, -3)
- else
- message = "[src] snaps \his fingers right off!"
- playsound(src.loc, 'sound/effects/snap.ogg', 50, 1)
-
-
- // Needed for M_TOXIC_FART
- if("fart", "farts")
- if(reagents.has_reagent("simethicone"))
- return
-// playsound(src.loc, 'sound/effects/fart.ogg', 50, 1, -3) //Admins still vote no to fun
- if(locate(/obj/item/weapon/storage/bible) in get_turf(src))
- to_chat(viewers(src), "[src] farts on the Bible!")
- to_chat(viewers(src), "A mysterious force smites [src]!")
- var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread
- s.set_up(3, 1, src)
- s.start()
- src.gib()
- else if(TOXIC_FARTS in mutations)
- message = "[src] unleashes a [pick("horrible","terrible","foul","disgusting","awful")] fart."
- else
- message = "[src] [pick("passes wind","farts")]."
- m_type = 2
-
- var/turf/location = get_turf(src)
- var/aoe_range=2 // Default
-
- // Process toxic farts first.
- if(TOXIC_FARTS in mutations)
- for(var/mob/M in range(location,aoe_range))
- if (M.internal != null && M.wear_mask && (M.wear_mask.flags & AIRTIGHT))
- continue
- // Now, we don't have this:
- //new /obj/effects/fart_cloud(T,L)
- if (M == src)
- continue
- M.reagents.add_reagent("jenkem", 1)
-
- if ("help")
- var/emotelist = "aflap(s), airguitar, blink(s), blink(s)_r, blush(es), bow(s)-(none)/mob, burp(s), choke(s), chuckle(s), clap(s), collapse(s), cough(s),cry, cries, custom, dap(s)(none)/mob," \
- + " deathgasp(s), drool(s), eyebrow,fart(s), faint(s), flap(s), flip(s), frown(s), gasp(s), giggle(s), glare(s)-(none)/mob, grin(s), groan(s), grumble(s), handshake-mob, hug(s)-(none)/mob," \
- + " glare(s)-(none)/mob, grin(s), johnny, laugh(s), look(s)-(none)/mob, moan(s), mumble(s), nod(s), pale(s), point(s)-atom, quiver(s), raise(s), salute(s)-(none)/mob, scream(s), shake(s)," \
- + " shiver(s), shrug(s), sigh(s), signal(s)-#1-10,slap(s)-(none)/mob, smile(s),snap(s), sneeze(s), sniff(s), snore(s), stare(s)-(none)/mob, swag(s), tremble(s), twitch(es), twitch(es)_s," \
- + " wag(s), wave(s), whimper(s), wink(s), yawn(s)"
- if(species.name == "Machine")
- emotelist += "\nMachine specific emotes :- beep(s)-(none)/mob, buzz(es)-none/mob, no-(none)/mob, ping(s)-(none)/mob, yes-(none)/mob"
- else if(species.name == "Slime People")
- emotelist += "\nSlime people specific emotes :- squish(es)-(none)/mob"
- to_chat(src, emotelist)
-
- else
- to_chat(src, "\blue Unusable emote '[act]'. Say *help for a list.")
-
-
-
-
-
- if(message) //Humans are special fucking snowflakes and have 735 lines of emotes, they get to handle their own emotes, not call the parent
- log_emote("[name]/[key] : [message]")
-
- //Hearing gasp and such every five seconds is not good emotes were not global for a reason.
- // Maybe some people are okay with that.
-
- for(var/mob/M in dead_mob_list)
- if(!M.client || istype(M, /mob/new_player))
- continue //skip monkeys, leavers and new players
- if(M.stat == DEAD && (M.client.prefs.toggles & CHAT_GHOSTSIGHT) && !(M in viewers(src,null)))
- M.show_message(message)
-
- switch(m_type)
- if(1)
- visible_message(message)
- if(2)
- audible_message(message)
-
-/mob/living/carbon/human/verb/pose()
- set name = "Set Pose"
- set desc = "Sets a description which will be shown when someone examines you."
- set category = "IC"
-
- pose = sanitize(copytext(input(usr, "This is [src]. \He is...", "Pose", null) as text, 1, MAX_MESSAGE_LEN))
-
-/mob/living/carbon/human/verb/set_flavor()
- set name = "Set Flavour Text"
- set desc = "Sets an extended description of your character's features."
- set category = "IC"
-
- update_flavor_text()
+/mob/living/carbon/human/emote(var/act,var/m_type=1,var/message = null,var/force)
+
+ if(stat == DEAD)
+ return // No screaming bodies
+
+ var/param = null
+ if(findtext(act, "-", 1, null))
+ var/t1 = findtext(act, "-", 1, null)
+ param = copytext(act, t1 + 1, length(act) + 1)
+ act = copytext(act, 1, t1)
+
+ var/muzzled = is_muzzled()
+ if(disabilities & MUTE || silent)
+ muzzled = 1
+ //var/m_type = 1
+
+ for(var/obj/item/weapon/implant/I in src)
+ if(I.implanted)
+ I.trigger(act, src)
+
+ var/miming = 0
+ if(mind)
+ miming = mind.miming
+
+ //Emote Cooldown System (it's so simple!)
+ // proc/handle_emote_CD() located in [code\modules\mob\emote.dm]
+ var/on_CD = 0
+ act = lowertext(act)
+ switch(act)
+ //Cooldown-inducing emotes
+ if("ping", "pings", "buzz", "buzzes", "beep", "beeps", "yes", "no", "buzz2")
+ if(species.name == "Machine") //Only Machines can beep, ping, and buzz, yes, no, and make a silly sad trombone noise.
+ on_CD = handle_emote_CD() //proc located in code\modules\mob\emote.dm
+ else //Everyone else fails, skip the emote attempt
+ return
+ if("drone","drones","hum","hums","rumble","rumbles")
+ if(species.name == "Drask") //Only Drask can make whale noises
+ on_CD = handle_emote_CD() //proc located in code\modules\mob\emote.dm
+ else
+ return
+ if("squish", "squishes")
+ var/found_slime_bodypart = 0
+
+ if(species.name == "Slime People") //Only Slime People can squish
+ on_CD = handle_emote_CD() //proc located in code\modules\mob\emote.dm'
+ found_slime_bodypart = 1
+ else
+ for(var/obj/item/organ/external/L in organs) // if your limbs are squishy you can squish too!
+ if(L.dna.species in list("Slime People"))
+ on_CD = handle_emote_CD()
+ found_slime_bodypart = 1
+ break
+
+ if(!found_slime_bodypart) //Everyone else fails, skip the emote attempt
+ return
+ if("scream", "screams")
+ on_CD = handle_emote_CD(50) //longer cooldown
+ if("fart", "farts", "flip", "flips", "snap", "snaps")
+ on_CD = handle_emote_CD() //proc located in code\modules\mob\emote.dm
+ //Everything else, including typos of the above emotes
+ else
+ on_CD = 0 //If it doesn't induce the cooldown, we won't check for the cooldown
+
+ if(on_CD == 1) // Check if we need to suppress the emote attempt.
+ return // Suppress emote, you're still cooling off.
+
+ switch(act)
+ if("me") //OKAY SO RANT TIME, THIS FUCKING HAS TO BE HERE OR A SHITLOAD OF THINGS BREAK
+ return custom_emote(m_type, message) //DO YOU KNOW WHY SHIT BREAKS? BECAUSE SO MUCH OLDCODE CALLS mob.emote("me",1,"whatever_the_fuck_it_wants_to_emote")
+ //WHO THE FUCK THOUGHT THAT WAS A GOOD FUCKING IDEA!?!?
+
+ if("ping", "pings")
+ var/M = null
+ if(param)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
+ M = A
+ break
+ if(!M)
+ param = null
+
+ if(param)
+ message = "[src] pings at [param]."
+ else
+ message = "[src] pings."
+ playsound(src.loc, 'sound/machines/ping.ogg', 50, 0)
+ m_type = 2
+
+ if("buzz2")
+ message = "[src] emits an irritated buzzing sound."
+ playsound(src.loc, 'sound/machines/buzz-two.ogg', 50, 0)
+ m_type = 2
+
+ if("buzz", "buzzes")
+ var/M = null
+ if(param)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
+ M = A
+ break
+ if(!M)
+ param = null
+
+ if(param)
+ message = "[src] buzzes at [param]."
+ else
+ message = "[src] buzzes."
+ playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0)
+ m_type = 2
+
+ if("beep", "beeps")
+ var/M = null
+ if(param)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
+ M = A
+ break
+ if(!M)
+ param = null
+
+ if(param)
+ message = "[src] beeps at [param]."
+ else
+ message = "[src] beeps."
+ playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0)
+ m_type = 2
+
+ if("drone", "drones", "hum", "hums", "rumble", "rumbles")
+ var/M = null
+ if(param)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
+ M = A
+ break
+ if(!M)
+ param = null
+
+ if(param)
+ message = "[src] drones at [param]."
+ else
+ message = "[src] rumbles."
+ playsound(src.loc, 'sound/voice/DraskTalk.ogg', 50, 0)
+ m_type = 2
+
+ if("squish", "squishes")
+ var/M = null
+ if(param)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
+ M = A
+ break
+ if(!M)
+ param = null
+
+ if(param)
+ message = "[src] squishes at [param]."
+ else
+ message = "[src] squishes."
+ playsound(src.loc, 'sound/effects/slime_squish.ogg', 50, 0) //Credit to DrMinky (freesound.org) for the sound.
+ m_type = 2
+
+ if("yes")
+ var/M = null
+ if(param)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
+ M = A
+ break
+ if(!M)
+ param = null
+
+ if(param)
+ message = "[src] emits an affirmative blip at [param]."
+ else
+ message = "[src] emits an affirmative blip."
+ playsound(src.loc, 'sound/machines/synth_yes.ogg', 50, 0)
+ m_type = 2
+
+ if("no")
+ var/M = null
+ if(param)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
+ M = A
+ break
+ if(!M)
+ param = null
+
+ if(param)
+ message = "[src] emits a negative blip at [param]."
+ else
+ message = "[src] emits a negative blip."
+ playsound(src.loc, 'sound/machines/synth_no.ogg', 50, 0)
+ m_type = 2
+
+ if("wag", "wags")
+ if(body_accessory)
+ if(body_accessory.try_restrictions(src))
+ message = "[src] starts wagging \his tail."
+ start_tail_wagging(1)
+
+ else if(species.bodyflags & TAIL_WAGGING)
+ if(!wear_suit || !(wear_suit.flags_inv & HIDETAIL) && !istype(wear_suit, /obj/item/clothing/suit/space))
+ message = "[src] starts wagging \his tail."
+ src.start_tail_wagging(1)
+ else
+ return
+ else
+ return
+ m_type = 1
+
+ if("swag", "swags")
+ if(species.bodyflags & TAIL_WAGGING || body_accessory)
+ message = "[src] stops wagging \his tail."
+ src.stop_tail_wagging(1)
+ else
+ return
+ m_type = 1
+
+ if("airguitar")
+ if(!src.restrained())
+ message = "[src] is strumming the air and headbanging like a safari chimp."
+ m_type = 1
+
+ if("blink", "blinks")
+ message = "[src] blinks."
+ m_type = 1
+
+ if("blink_r", "blinks_r")
+ message = "[src] blinks rapidly."
+ m_type = 1
+
+ if("bow", "bows")
+ if(!src.buckled)
+ var/M = null
+ if(param)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
+ M = A
+ break
+ if(!M)
+ param = null
+
+ if(param)
+ message = "[src] bows to [param]."
+ else
+ message = "[src] bows."
+ m_type = 1
+
+ if("salute", "salutes")
+ if(!src.buckled)
+ var/M = null
+ if(param)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
+ M = A
+ break
+ if(!M)
+ param = null
+
+ if(param)
+ message = "[src] salutes to [param]."
+ else
+ message = "[src] salutes."
+ m_type = 1
+
+ if("choke", "chokes")
+ if(miming)
+ message = "[src] clutches \his throat desperately!"
+ m_type = 1
+ else
+ if(!muzzled)
+ message = "[src] chokes!"
+ m_type = 2
+ else
+ message = "[src] makes a strong noise."
+ m_type = 2
+
+ if("burp", "burps")
+ if(miming)
+ message = "[src] opens their mouth rather obnoxiously."
+ m_type = 1
+ else
+ if(!muzzled)
+ message = "[src] burps."
+ m_type = 2
+ else
+ message = "[src] makes a peculiar noise."
+ m_type = 2
+ if("clap", "claps")
+ if(!src.restrained())
+ message = "[src] claps."
+ m_type = 2
+ if(miming)
+ m_type = 1
+ if("flap", "flaps")
+ if(!src.restrained())
+ message = "[src] flaps \his wings."
+ m_type = 2
+ if(miming)
+ m_type = 1
+
+ if("flip", "flips")
+ m_type = 1
+ if(!src.restrained())
+ var/M = null
+ if(param)
+ for(var/mob/A in view(1, null))
+ if(param == A.name)
+ M = A
+ break
+ if(M == src)
+ M = null
+
+ if(M)
+ if(lying || weakened)
+ message = "[src] flops and flails around on the floor."
+ else
+ message = "[src] flips in [M]'s general direction."
+ SpinAnimation(5,1)
+ else
+ if(lying || weakened)
+ message = "[src] flops and flails around on the floor."
+ else
+ var/obj/item/weapon/grab/G
+ if(istype(get_active_hand(), /obj/item/weapon/grab))
+ G = get_active_hand()
+ if(G && G.affecting)
+ if(buckled || G.affecting.buckled)
+ return
+ var/turf/oldloc = loc
+ var/turf/newloc = G.affecting.loc
+ if(isturf(oldloc) && isturf(newloc))
+ SpinAnimation(5,1)
+ forceMove(newloc)
+ G.affecting.forceMove(oldloc)
+ message = "[src] flips over [G.affecting]!"
+ else
+ message = "[src] does a flip!"
+ SpinAnimation(5,1)
+
+ if("aflap", "aflaps")
+ if(!src.restrained())
+ message = "[src] flaps \his wings ANGRILY!"
+ m_type = 2
+ if(miming)
+ m_type = 1
+
+ if("drool", "drools")
+ message = "[src] drools."
+ m_type = 1
+
+ if("eyebrow")
+ message = "[src] raises an eyebrow."
+ m_type = 1
+
+ if("chuckle", "chuckles")
+ if(miming)
+ message = "[src] appears to chuckle."
+ m_type = 1
+ else
+ if(!muzzled)
+ message = "[src] chuckles."
+ m_type = 2
+ else
+ message = "[src] makes a noise."
+ m_type = 2
+
+ if("twitch", "twitches")
+ message = "[src] twitches violently."
+ m_type = 1
+
+ if("twitch_s", "twitches_s")
+ message = "[src] twitches."
+ m_type = 1
+
+ if("faint", "faints")
+ message = "[src] faints."
+ if(src.sleeping)
+ return //Can't faint while asleep
+ src.sleeping += 1
+ m_type = 1
+
+ if("cough", "coughs")
+ if(miming)
+ message = "[src] appears to cough!"
+ m_type = 1
+ else
+ if(!muzzled)
+ message = "[src] coughs!"
+ m_type = 2
+ else
+ message = "[src] makes a strong noise."
+ m_type = 2
+
+ if("frown", "frowns")
+ message = "[src] frowns."
+ m_type = 1
+
+ if("nod", "nods")
+ message = "[src] nods."
+ m_type = 1
+
+ if("blush", "blushes")
+ message = "[src] blushes."
+ m_type = 1
+
+ if("wave", "waves")
+ message = "[src] waves."
+ m_type = 1
+
+ if("quiver", "quivers")
+ message = "[src] quivers."
+ m_type = 1
+
+ if("gasp", "gasps")
+ if(miming)
+ message = "[src] appears to be gasping!"
+ m_type = 1
+ else
+ if(!muzzled)
+ message = "[src] gasps!"
+ m_type = 2
+ else
+ message = "[src] makes a weak noise."
+ m_type = 2
+
+ if("deathgasp", "deathgasps")
+ message = "[src] [species.death_message]"
+ m_type = 1
+
+ if("giggle", "giggles")
+ if(miming)
+ message = "[src] giggles silently!"
+ m_type = 1
+ else
+ if(!muzzled)
+ message = "[src] giggles."
+ m_type = 2
+ else
+ message = "[src] makes a noise."
+ m_type = 2
+
+ if("glare", "glares")
+ var/M = null
+ if(param)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
+ M = A
+ break
+ if(!M)
+ param = null
+
+ if(param)
+ message = "[src] glares at [param]."
+ else
+ message = "[src] glares."
+ m_type = 1
+
+ if("stare", "stares")
+ var/M = null
+ if(param)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
+ M = A
+ break
+ if(!M)
+ param = null
+
+ if(param)
+ message = "[src] stares at [param]."
+ else
+ message = "[src] stares."
+ m_type = 1
+
+ if("look", "looks")
+ var/M = null
+ if(param)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
+ M = A
+ break
+
+ if(!M)
+ param = null
+
+ if(param)
+ message = "[src] looks at [param]."
+ else
+ message = "[src] looks."
+ m_type = 1
+
+ if("grin", "grins")
+ message = "[src] grins."
+ m_type = 1
+
+ if("cry", "cries")
+ if(miming)
+ message = "[src] cries."
+ m_type = 1
+ else
+ if(!muzzled)
+ message = "[src] cries."
+ m_type = 2
+ else
+ message = "[src] makes a weak noise. \He frowns."
+ m_type = 2
+
+ if("sigh", "sighs")
+ if(miming)
+ message = "[src] sighs."
+ m_type = 1
+ else
+ if(!muzzled)
+ message = "[src] sighs."
+ m_type = 2
+ else
+ message = "[src] makes a weak noise."
+ m_type = 2
+
+ if("laugh", "laughs")
+ if(miming)
+ message = "[src] acts out a laugh."
+ m_type = 1
+ else
+ if(!muzzled)
+ message = "[src] laughs."
+ m_type = 2
+ else
+ message = "[src] makes a noise."
+ m_type = 2
+
+ if("mumble", "mumbles")
+ message = "[src] mumbles!"
+ m_type = 2
+ if(miming)
+ m_type = 1
+
+ if("grumble", "grumbles")
+ if(miming)
+ message = "[src] grumbles!"
+ m_type = 1
+ if(!muzzled)
+ message = "[src] grumbles!"
+ m_type = 2
+ else
+ message = "[src] makes a noise."
+ m_type = 2
+
+ if("groan", "groans")
+ if(miming)
+ message = "[src] appears to groan!"
+ m_type = 1
+ else
+ if(!muzzled)
+ message = "[src] groans!"
+ m_type = 2
+ else
+ message = "[src] makes a loud noise."
+ m_type = 2
+
+ if("moan", "moans")
+ if(miming)
+ message = "[src] appears to moan!"
+ m_type = 1
+ else
+ message = "[src] moans!"
+ m_type = 2
+
+ if("johnny")
+ var/M
+ if(param)
+ M = param
+ if(!M)
+ param = null
+ else
+ if(miming)
+ message = "[src] takes a drag from a cigarette and blows \"[M]\" out in smoke."
+ m_type = 1
+ else
+ message = "[src] says, \"[M], please. They had a family.\" [src.name] takes a drag from a cigarette and blows their name out in smoke."
+ m_type = 2
+
+ if("point", "points")
+ if(!src.restrained())
+ var/atom/M = null
+ if(param)
+ for(var/atom/A as mob|obj|turf in view())
+ if(param == A.name)
+ M = A
+ break
+
+ if(!M)
+ message = "[src] points."
+ else
+ pointed(M)
+ m_type = 1
+
+ if("raise", "raises")
+ if(!src.restrained())
+ message = "[src] raises a hand."
+ m_type = 1
+
+ if("shake", "shakes")
+ message = "[src] shakes \his head."
+ m_type = 1
+
+ if("shrug", "shrugs")
+ message = "[src] shrugs."
+ m_type = 1
+
+ if("signal", "signals")
+ if(!src.restrained())
+ var/t1 = round(text2num(param))
+ if(isnum(t1))
+ if(t1 <= 5 && (!src.r_hand || !src.l_hand))
+ message = "[src] raises [t1] finger\s."
+ else if(t1 <= 10 && (!src.r_hand && !src.l_hand))
+ message = "[src] raises [t1] finger\s."
+ m_type = 1
+
+ if("smile", "smiles")
+ message = "[src] smiles."
+ m_type = 1
+
+ if("shiver", "shivers")
+ message = "[src] shivers."
+ m_type = 2
+ if(miming)
+ m_type = 1
+
+ if("pale", "pales")
+ message = "[src] goes pale for a second."
+ m_type = 1
+
+ if("tremble", "trembles")
+ message = "[src] trembles."
+ m_type = 1
+
+ if("sneeze", "sneezes")
+ if(miming)
+ message = "[src] sneezes."
+ m_type = 1
+ else
+ if(!muzzled)
+ message = "[src] sneezes."
+ m_type = 2
+ else
+ message = "[src] makes a strange noise."
+ m_type = 2
+
+ if("sniff", "sniffs")
+ message = "[src] sniffs."
+ m_type = 2
+ if(miming)
+ m_type = 1
+
+ if("snore", "snores")
+ if(miming)
+ message = "[src] sleeps soundly."
+ m_type = 1
+ else
+ if(!muzzled)
+ message = "[src] snores."
+ m_type = 2
+ else
+ message = "[src] makes a noise."
+ m_type = 2
+
+ if("whimper", "whimpers")
+ if(miming)
+ message = "[src] appears hurt."
+ m_type = 1
+ else
+ if(!muzzled)
+ message = "[src] whimpers."
+ m_type = 2
+ else
+ message = "[src] makes a weak noise."
+ m_type = 2
+
+ if("wink", "winks")
+ message = "[src] winks."
+ m_type = 1
+
+ if("yawn", "yawns")
+ if(!muzzled)
+ message = "[src] yawns."
+ m_type = 2
+ if(miming)
+ m_type = 1
+
+ if("collapse", "collapses")
+ Paralyse(2)
+ message = "[src] collapses!"
+ m_type = 2
+ if(miming)
+ m_type = 1
+
+ if("hug", "hugs")
+ m_type = 1
+ if(!src.restrained())
+ var/M = null
+ if(param)
+ for(var/mob/A in view(1, null))
+ if(param == A.name)
+ M = A
+ break
+ if(M == src)
+ M = null
+
+ if(M)
+ message = "[src] hugs [M]."
+ else
+ message = "[src] hugs \himself."
+
+ if("handshake")
+ m_type = 1
+ if(!src.restrained() && !src.r_hand)
+ var/mob/M = null
+ if(param)
+ for(var/mob/A in view(1, null))
+ if(param == A.name)
+ M = A
+ break
+ if(M == src)
+ M = null
+
+ if(M)
+ if(M.canmove && !M.r_hand && !M.restrained())
+ message = "[src] shakes hands with [M]."
+ else
+ message = "[src] holds out \his hand to [M]."
+
+ if("dap", "daps")
+ m_type = 1
+ if(!src.restrained())
+ var/M = null
+ if(param)
+ for(var/mob/A in view(1, null))
+ if(param == A.name)
+ M = A
+ break
+ if(M)
+ message = "[src] gives daps to [M]."
+ else
+ message = "[src] sadly can't find anybody to give daps to, and daps \himself. Shameful."
+
+ if("slap", "slaps")
+ m_type = 1
+ if(!src.restrained())
+ var/M = null
+ if(param)
+ for(var/mob/A in view(1, null))
+ if(param == A.name)
+ M = A
+ break
+ if(M)
+ message = "\red [src] slaps [M] across the face. Ouch!"
+ playsound(src.loc, 'sound/effects/snap.ogg', 50, 1)
+ else
+ message = "\red [src] slaps \himself!"
+ playsound(src.loc, 'sound/effects/snap.ogg', 50, 1)
+ src.adjustFireLoss(4)
+
+ if("scream", "screams")
+ if(miming)
+ message = "[src] acts out a scream!"
+ m_type = 1
+ else
+ if(!muzzled)
+ message = "[src] [species.scream_verb]!"
+ m_type = 2
+ if(gender == FEMALE)
+ playsound(src.loc, "[species.female_scream_sound]", 80, 1, 0, pitch = get_age_pitch())
+ else
+ playsound(src.loc, "[species.male_scream_sound]", 80, 1, 0, pitch = get_age_pitch()) //default to male screams if no gender is present.
+
+ else
+ message = "[src] makes a very loud noise."
+ m_type = 2
+
+
+ if("snap", "snaps")
+ if(prob(95))
+ m_type = 2
+ var/mob/living/carbon/human/H = src
+ var/obj/item/organ/external/L = H.get_organ("l_hand")
+ var/obj/item/organ/external/R = H.get_organ("r_hand")
+ var/left_hand_good = 0
+ var/right_hand_good = 0
+ if(L && (!(L.status & ORGAN_DESTROYED)) && (!(L.status & ORGAN_SPLINTED)) && (!(L.status & ORGAN_BROKEN)))
+ left_hand_good = 1
+ if(R && (!(R.status & ORGAN_DESTROYED)) && (!(R.status & ORGAN_SPLINTED)) && (!(R.status & ORGAN_BROKEN)))
+ right_hand_good = 1
+
+ if(!left_hand_good && !right_hand_good)
+ to_chat(usr, "You need at least one hand in good working order to snap your fingers.")
+ return
+
+ message = "[src] snaps \his fingers."
+ playsound(src.loc, 'sound/effects/fingersnap.ogg', 50, 1, -3)
+ else
+ message = "[src] snaps \his fingers right off!"
+ playsound(src.loc, 'sound/effects/snap.ogg', 50, 1)
+
+
+ // Needed for M_TOXIC_FART
+ if("fart", "farts")
+ if(reagents.has_reagent("simethicone"))
+ return
+// playsound(src.loc, 'sound/effects/fart.ogg', 50, 1, -3) //Admins still vote no to fun
+ if(locate(/obj/item/weapon/storage/bible) in get_turf(src))
+ to_chat(viewers(src), "[src] farts on the Bible!")
+ to_chat(viewers(src), "A mysterious force smites [src]!")
+ var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread
+ s.set_up(3, 1, src)
+ s.start()
+ src.gib()
+ else if(TOXIC_FARTS in mutations)
+ message = "[src] unleashes a [pick("horrible","terrible","foul","disgusting","awful")] fart."
+ else
+ message = "[src] [pick("passes wind","farts")]."
+ m_type = 2
+
+ var/turf/location = get_turf(src)
+ var/aoe_range=2 // Default
+
+ // Process toxic farts first.
+ if(TOXIC_FARTS in mutations)
+ for(var/mob/M in range(location,aoe_range))
+ if(M.internal != null && M.wear_mask && (M.wear_mask.flags & AIRTIGHT))
+ continue
+ // Now, we don't have this:
+ //new /obj/effects/fart_cloud(T,L)
+ if(M == src)
+ continue
+ M.reagents.add_reagent("jenkem", 1)
+
+ if("help")
+ var/emotelist = "aflap(s), airguitar, blink(s), blink(s)_r, blush(es), bow(s)-(none)/mob, burp(s), choke(s), chuckle(s), clap(s), collapse(s), cough(s),cry, cries, custom, dap(s)(none)/mob," \
+ + " deathgasp(s), drool(s), eyebrow,fart(s), faint(s), flap(s), flip(s), frown(s), gasp(s), giggle(s), glare(s)-(none)/mob, grin(s), groan(s), grumble(s), handshake-mob, hug(s)-(none)/mob," \
+ + " glare(s)-(none)/mob, grin(s), johnny, laugh(s), look(s)-(none)/mob, moan(s), mumble(s), nod(s), pale(s), point(s)-atom, quiver(s), raise(s), salute(s)-(none)/mob, scream(s), shake(s)," \
+ + " shiver(s), shrug(s), sigh(s), signal(s)-#1-10,slap(s)-(none)/mob, smile(s),snap(s), sneeze(s), sniff(s), snore(s), stare(s)-(none)/mob, swag(s), tremble(s), twitch(es), twitch(es)_s," \
+ + " wag(s), wave(s), whimper(s), wink(s), yawn(s)"
+ if(species.name == "Machine")
+ emotelist += "\nMachine specific emotes :- beep(s)-(none)/mob, buzz(es)-none/mob, no-(none)/mob, ping(s)-(none)/mob, yes-(none)/mob"
+ else if(species.name == "Slime People")
+ emotelist += "\nSlime people specific emotes :- squish(es)-(none)/mob"
+ to_chat(src, emotelist)
+
+ else
+ to_chat(src, "\blue Unusable emote '[act]'. Say *help for a list.")
+
+
+
+
+
+ if(message) //Humans are special fucking snowflakes and have 735 lines of emotes, they get to handle their own emotes, not call the parent
+ log_emote("[name]/[key] : [message]")
+
+ //Hearing gasp and such every five seconds is not good emotes were not global for a reason.
+ // Maybe some people are okay with that.
+
+ for(var/mob/M in dead_mob_list)
+ if(!M.client || istype(M, /mob/new_player))
+ continue //skip monkeys, leavers and new players
+ if(M.stat == DEAD && (M.client.prefs.toggles & CHAT_GHOSTSIGHT) && !(M in viewers(src,null)))
+ M.show_message(message)
+
+ switch(m_type)
+ if(1)
+ visible_message(message)
+ if(2)
+ audible_message(message)
+
+/mob/living/carbon/human/verb/pose()
+ set name = "Set Pose"
+ set desc = "Sets a description which will be shown when someone examines you."
+ set category = "IC"
+
+ pose = sanitize(copytext(input(usr, "This is [src]. \He is...", "Pose", null) as text, 1, MAX_MESSAGE_LEN))
+
+/mob/living/carbon/human/verb/set_flavor()
+ set name = "Set Flavour Text"
+ set desc = "Sets an extended description of your character's features."
+ set category = "IC"
+
+ update_flavor_text()
diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm
index 539d88f11cb..0a9e033bd54 100644
--- a/code/modules/mob/living/carbon/human/examine.dm
+++ b/code/modules/mob/living/carbon/human/examine.dm
@@ -41,7 +41,7 @@
t_is = "are"
else
if(icon)
- msg += "\icon[icon] " //fucking BYOND: this should stop dreamseeker crashing if we -somehow- examine somebody before their icon is generated
+ msg += "[bicon(icon(icon, dir=SOUTH))] " //fucking BYOND: this should stop dreamseeker crashing if we -somehow- examine somebody before their icon is generated
switch(gender)
if(MALE)
t_He = "He"
@@ -58,14 +58,14 @@
var/displayed_species = get_species()
for(var/obj/item/clothing/C in src) //Disguise checks
- if (C == src.head || C == src.wear_suit || C == src.wear_mask || C == src.w_uniform || C == src.belt || C == src.back)
+ if(C == src.head || C == src.wear_suit || C == src.wear_mask || C == src.w_uniform || C == src.belt || C == src.back)
if(C.species_disguise)
displayed_species = C.species_disguise
- if (skipjumpsuit && skipface || (displayed_species in nospecies)) //either obscured or on the nospecies list
+ if(skipjumpsuit && skipface || (displayed_species in nospecies)) //either obscured or on the nospecies list
msg += "!\n" //omit the species when examining
- else if (displayed_species == "Slime People") //snowflakey because Slime People are defined as a plural
+ else if(displayed_species == "Slime People") //snowflakey because Slime People are defined as a plural
msg += ", a slime person!\n"
- else if (displayed_species == "Unathi") //DAMN YOU, VOWELS
+ else if(displayed_species == "Unathi") //DAMN YOU, VOWELS
msg += ", a unathi!\n"
else
msg += ", \a [lowertext(displayed_species)]!\n"
@@ -80,108 +80,108 @@
tie_msg += " with [english_accessory_list(U)]"
if(w_uniform.blood_DNA)
- msg += "[t_He] [t_is] wearing \icon[w_uniform] [w_uniform.gender==PLURAL?"some":"a"] [w_uniform.blood_color != "#030303" ? "blood-stained":"oil-stained"] [w_uniform.name][tie_msg]!\n"
+ msg += "[t_He] [t_is] wearing [bicon(w_uniform)] [w_uniform.gender==PLURAL?"some":"a"] [w_uniform.blood_color != "#030303" ? "blood-stained":"oil-stained"] [w_uniform.name][tie_msg]!\n"
else
- msg += "[t_He] [t_is] wearing \icon[w_uniform] \a [w_uniform][tie_msg].\n"
+ msg += "[t_He] [t_is] wearing [bicon(w_uniform)] \a [w_uniform][tie_msg].\n"
//head
if(head && !(head.flags & ABSTRACT))
if(head.blood_DNA)
- msg += "[t_He] [t_is] wearing \icon[head] [head.gender==PLURAL?"some":"a"] [head.blood_color != "#030303" ? "blood-stained":"oil-stained"] [head.name] on [t_his] head!\n"
+ msg += "[t_He] [t_is] wearing [bicon(head)] [head.gender==PLURAL?"some":"a"] [head.blood_color != "#030303" ? "blood-stained":"oil-stained"] [head.name] on [t_his] head!\n"
else
- msg += "[t_He] [t_is] wearing \icon[head] \a [head] on [t_his] head.\n"
+ msg += "[t_He] [t_is] wearing [bicon(head)] \a [head] on [t_his] head.\n"
//suit/armour
if(wear_suit && !(wear_suit.flags & ABSTRACT))
if(wear_suit.blood_DNA)
- msg += "[t_He] [t_is] wearing \icon[wear_suit] [wear_suit.gender==PLURAL?"some":"a"] [wear_suit.blood_color != "#030303" ? "blood-stained":"oil-stained"] [wear_suit.name]!\n"
+ msg += "[t_He] [t_is] wearing [bicon(wear_suit)] [wear_suit.gender==PLURAL?"some":"a"] [wear_suit.blood_color != "#030303" ? "blood-stained":"oil-stained"] [wear_suit.name]!\n"
else
- msg += "[t_He] [t_is] wearing \icon[wear_suit] \a [wear_suit].\n"
+ msg += "[t_He] [t_is] wearing [bicon(wear_suit)] \a [wear_suit].\n"
//suit/armour storage
if(s_store && !skipsuitstorage)
if(s_store.blood_DNA)
- msg += "[t_He] [t_is] carrying \icon[s_store] [s_store.gender==PLURAL?"some":"a"] [s_store.blood_color != "#030303" ? "blood-stained":"oil-stained"] [s_store.name] on [t_his] [wear_suit.name]!\n"
+ msg += "[t_He] [t_is] carrying [bicon(s_store)] [s_store.gender==PLURAL?"some":"a"] [s_store.blood_color != "#030303" ? "blood-stained":"oil-stained"] [s_store.name] on [t_his] [wear_suit.name]!\n"
else
- msg += "[t_He] [t_is] carrying \icon[s_store] \a [s_store] on [t_his] [wear_suit.name].\n"
+ msg += "[t_He] [t_is] carrying [bicon(s_store)] \a [s_store] on [t_his] [wear_suit.name].\n"
//back
if(back && !(back.flags & ABSTRACT))
if(back.blood_DNA)
- msg += "[t_He] [t_has] \icon[back] [back.gender==PLURAL?"some":"a"] [back.blood_color != "#030303" ? "blood-stained":"oil-stained"] [back] on [t_his] back.\n"
+ msg += "[t_He] [t_has] [bicon(back)] [back.gender==PLURAL?"some":"a"] [back.blood_color != "#030303" ? "blood-stained":"oil-stained"] [back] on [t_his] back.\n"
else
- msg += "[t_He] [t_has] \icon[back] \a [back] on [t_his] back.\n"
+ msg += "[t_He] [t_has] [bicon(back)] \a [back] on [t_his] back.\n"
//left hand
if(l_hand && !(l_hand.flags & ABSTRACT))
if(l_hand.blood_DNA)
- msg += "[t_He] [t_is] holding \icon[l_hand] [l_hand.gender==PLURAL?"some":"a"] [l_hand.blood_color != "#030303" ? "blood-stained":"oil-stained"] [l_hand.name] in [t_his] left hand!\n"
+ msg += "[t_He] [t_is] holding [bicon(l_hand)] [l_hand.gender==PLURAL?"some":"a"] [l_hand.blood_color != "#030303" ? "blood-stained":"oil-stained"] [l_hand.name] in [t_his] left hand!\n"
else
- msg += "[t_He] [t_is] holding \icon[l_hand] \a [l_hand] in [t_his] left hand.\n"
+ msg += "[t_He] [t_is] holding [bicon(l_hand)] \a [l_hand] in [t_his] left hand.\n"
//right hand
if(r_hand && !(r_hand.flags & ABSTRACT))
if(r_hand.blood_DNA)
- msg += "[t_He] [t_is] holding \icon[r_hand] [r_hand.gender==PLURAL?"some":"a"] [r_hand.blood_color != "#030303" ? "blood-stained":"oil-stained"] [r_hand.name] in [t_his] right hand!\n"
+ msg += "[t_He] [t_is] holding [bicon(r_hand)] [r_hand.gender==PLURAL?"some":"a"] [r_hand.blood_color != "#030303" ? "blood-stained":"oil-stained"] [r_hand.name] in [t_his] right hand!\n"
else
- msg += "[t_He] [t_is] holding \icon[r_hand] \a [r_hand] in [t_his] right hand.\n"
+ msg += "[t_He] [t_is] holding [bicon(r_hand)] \a [r_hand] in [t_his] right hand.\n"
//gloves
if(gloves && !skipgloves && !(gloves.flags & ABSTRACT))
if(gloves.blood_DNA)
- msg += "[t_He] [t_has] \icon[gloves] [gloves.gender==PLURAL?"some":"a"] [gloves.blood_color != "#030303" ? "blood-stained":"oil-stained"] [gloves.name] on [t_his] hands!\n"
+ msg += "[t_He] [t_has] [bicon(gloves)] [gloves.gender==PLURAL?"some":"a"] [gloves.blood_color != "#030303" ? "blood-stained":"oil-stained"] [gloves.name] on [t_his] hands!\n"
else
- msg += "[t_He] [t_has] \icon[gloves] \a [gloves] on [t_his] hands.\n"
+ msg += "[t_He] [t_has] [bicon(gloves)] \a [gloves] on [t_his] hands.\n"
else if(blood_DNA)
msg += "[t_He] [t_has] [hand_blood_color != "#030303" ? "blood-stained":"oil-stained"] hands!\n"
//handcuffed?
if(handcuffed)
if(istype(handcuffed, /obj/item/weapon/restraints/handcuffs/cable/zipties))
- msg += "[t_He] [t_is] \icon[handcuffed] restrained with zipties!\n"
+ msg += "[t_He] [t_is] [bicon(handcuffed)] restrained with zipties!\n"
else if(istype(handcuffed, /obj/item/weapon/restraints/handcuffs/cable))
- msg += "[t_He] [t_is] \icon[handcuffed] restrained with cable!\n"
+ msg += "[t_He] [t_is] [bicon(handcuffed)] restrained with cable!\n"
else
- msg += "[t_He] [t_is] \icon[handcuffed] handcuffed!\n"
+ msg += "[t_He] [t_is] [bicon(handcuffed)] handcuffed!\n"
//belt
if(belt)
if(belt.blood_DNA)
- msg += "[t_He] [t_has] \icon[belt] [belt.gender==PLURAL?"some":"a"] [belt.blood_color != "#030303" ? "blood-stained":"oil-stained"] [belt.name] about [t_his] waist!\n"
+ msg += "[t_He] [t_has] [bicon(belt)] [belt.gender==PLURAL?"some":"a"] [belt.blood_color != "#030303" ? "blood-stained":"oil-stained"] [belt.name] about [t_his] waist!\n"
else
- msg += "[t_He] [t_has] \icon[belt] \a [belt] about [t_his] waist.\n"
+ msg += "[t_He] [t_has] [bicon(belt)] \a [belt] about [t_his] waist.\n"
//shoes
if(shoes && !skipshoes && !(shoes.flags & ABSTRACT))
if(shoes.blood_DNA)
- msg += "[t_He] [t_is] wearing \icon[shoes] [shoes.gender==PLURAL?"some":"a"] [shoes.blood_color != "#030303" ? "blood-stained":"oil-stained"] [shoes.name] on [t_his] feet!\n"
+ msg += "[t_He] [t_is] wearing [bicon(shoes)] [shoes.gender==PLURAL?"some":"a"] [shoes.blood_color != "#030303" ? "blood-stained":"oil-stained"] [shoes.name] on [t_his] feet!\n"
else
- msg += "[t_He] [t_is] wearing \icon[shoes] \a [shoes] on [t_his] feet.\n"
- else if (blood_DNA)
+ msg += "[t_He] [t_is] wearing [bicon(shoes)] \a [shoes] on [t_his] feet.\n"
+ else if(blood_DNA)
msg += "[t_He] [t_has] [feet_blood_color != "#030303" ? "blood-stained":"oil-stained"] feet!\n"
//mask
if(wear_mask && !skipmask && !(wear_mask.flags & ABSTRACT))
if(wear_mask.blood_DNA)
- msg += "[t_He] [t_has] \icon[wear_mask] [wear_mask.gender==PLURAL?"some":"a"] [wear_mask.blood_color != "#030303" ? "blood-stained":"oil-stained"] [wear_mask.name] on [t_his] face!\n"
+ msg += "[t_He] [t_has] [bicon(wear_mask)] [wear_mask.gender==PLURAL?"some":"a"] [wear_mask.blood_color != "#030303" ? "blood-stained":"oil-stained"] [wear_mask.name] on [t_his] face!\n"
else
- msg += "[t_He] [t_has] \icon[wear_mask] \a [wear_mask] on [t_his] face.\n"
+ msg += "[t_He] [t_has] [bicon(wear_mask)] \a [wear_mask] on [t_his] face.\n"
//eyes
if(glasses && !skipeyes && !(glasses.flags & ABSTRACT))
if(glasses.blood_DNA)
- msg += "[t_He] [t_has] \icon[glasses] [glasses.gender==PLURAL?"some":"a"] [glasses.blood_color != "#030303" ? "blood-stained":"oil-stained"] [glasses] covering [t_his] eyes!\n"
+ msg += "[t_He] [t_has] [bicon(glasses)] [glasses.gender==PLURAL?"some":"a"] [glasses.blood_color != "#030303" ? "blood-stained":"oil-stained"] [glasses] covering [t_his] eyes!\n"
else
- msg += "[t_He] [t_has] \icon[glasses] \a [glasses] covering [t_his] eyes.\n"
+ msg += "[t_He] [t_has] [bicon(glasses)] \a [glasses] covering [t_his] eyes.\n"
//left ear
if(l_ear && !skipears)
- msg += "[t_He] [t_has] \icon[l_ear] \a [l_ear] on [t_his] left ear.\n"
+ msg += "[t_He] [t_has] [bicon(l_ear)] \a [l_ear] on [t_his] left ear.\n"
//right ear
if(r_ear && !skipears)
- msg += "[t_He] [t_has] \icon[r_ear] \a [r_ear] on [t_his] right ear.\n"
+ msg += "[t_He] [t_has] [bicon(r_ear)] \a [r_ear] on [t_his] right ear.\n"
//ID
if(wear_id)
@@ -193,9 +193,9 @@
var/obj/item/weapon/card/id/idcard = wear_id
id = idcard.registered_name
if(id && (id != real_name) && (get_dist(src, user) <= 1) && prob(10))
- msg += "[t_He] [t_is] wearing \icon[wear_id] \a [wear_id] yet something doesn't seem right...\n"
+ msg += "[t_He] [t_is] wearing [bicon(wear_id)] \a [wear_id] yet something doesn't seem right...\n"
else*/
- msg += "[t_He] [t_is] wearing \icon[wear_id] \a [wear_id].\n"
+ msg += "[t_He] [t_is] wearing [bicon(wear_id)] \a [wear_id].\n"
//Jitters
switch(jitteriness)
@@ -221,7 +221,7 @@
var/distance = get_dist(user,src)
if(istype(user, /mob/dead/observer) || user.stat == 2) // ghosts can see anything
distance = 1
- if (src.stat)
+ if(src.stat)
msg += "[t_He] [t_is]n't responding to anything around [t_him] and seems to be asleep.\n"
if((stat == 2 || src.health <= config.health_threshold_crit) && distance <= 3)
msg += "[t_He] does not appear to be breathing.\n"
@@ -275,7 +275,7 @@
else if(!key)
msg += "[t_He] [t_is] fast asleep. It doesn't look like they are waking up anytime soon.\n"
else if(!client)
- msg += "[t_He] [t_has] suddenly fallen asleep.\n"
+ msg += "[t_He] [t_has] suddenly fallen asleep, suffering from Space Sleep Disorder.\n"
if(!get_int_organ(/obj/item/organ/internal/brain))
msg += "It appears that [t_his] brain is missing...\n"
@@ -462,9 +462,9 @@
perpname = name
if(perpname)
- for (var/datum/data/record/E in data_core.general)
+ for(var/datum/data/record/E in data_core.general)
if(E.fields["name"] == perpname)
- for (var/datum/data/record/R in data_core.security)
+ for(var/datum/data/record/R in data_core.security)
if(R.fields["id"] == E.fields["id"])
criminal = R.fields["criminal"]
@@ -484,10 +484,10 @@
else
perpname = src.name
- for (var/datum/data/record/E in data_core.general)
- if (E.fields["name"] == perpname)
- for (var/datum/data/record/R in data_core.general)
- if (R.fields["id"] == E.fields["id"])
+ for(var/datum/data/record/E in data_core.general)
+ if(E.fields["name"] == perpname)
+ for(var/datum/data/record/R in data_core.general)
+ if(R.fields["id"] == E.fields["id"])
medical = R.fields["p_stat"]
msg += "Physical status:\[[medical]\]\n"
@@ -497,7 +497,7 @@
if(print_flavor_text()) msg += "[print_flavor_text()]\n"
msg += "*---------*"
- if (pose)
+ if(pose)
if( findtext(pose,".",lentext(pose)) == 0 && findtext(pose,"!",lentext(pose)) == 0 && findtext(pose,"?",lentext(pose)) == 0 )
pose = addtext(pose,".") //Makes sure all emotes end with a period.
msg += "\n[t_He] is [pose]"
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index 7775830b4a0..c63c03d8321 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -8,7 +8,7 @@
//why are these here and not in human_defines.dm
//var/list/hud_list[10]
var/datum/species/species //Contains icon generation and language information, set during New().
- var/embedded_flag //To check if we've need to roll for damage on movement while an item is imbedded in us.
+ var/embedded_flag //To check if we've need to roll for damage on movement while an item is imbedded in us.
var/obj/item/weapon/rig/wearing_rig // This is very not good, but it's much much better than calling get_rig() every update_canmove() call.
/mob/living/carbon/human/New(var/new_loc, var/new_species = null, var/delay_ready_dna = 0)
@@ -39,6 +39,8 @@
martial_art = default_martial_art
+ handcrafting = new()
+
var/mob/M = src
faction |= "\ref[M]" //what
@@ -53,6 +55,9 @@
UpdateAppearance()
+/mob/living/carbon/human/OpenCraftingMenu()
+ handcrafting.craft(src)
+
/mob/living/carbon/human/prepare_data_huds()
//Update med hud images...
..()
@@ -203,15 +208,14 @@
now_pushing = 0
return
- if(tmob.r_hand && istype(tmob.r_hand, /obj/item/weapon/shield/riot))
- if(prob(99))
- now_pushing = 0
- return
- if(tmob.l_hand && istype(tmob.l_hand, /obj/item/weapon/shield/riot))
- if(prob(99))
- now_pushing = 0
- return
+ //anti-riot equipment is also anti-push
+ if(tmob.r_hand && (prob(tmob.r_hand.block_chance * 2)) && !istype(tmob.r_hand, /obj/item/clothing))
+ now_pushing = 0
+ return
+ if(tmob.l_hand && (prob(tmob.l_hand.block_chance * 2)) && !istype(tmob.l_hand, /obj/item/clothing))
+ now_pushing = 0
+ return
if(!(tmob.status_flags & CANPUSH))
now_pushing = 0
@@ -351,8 +355,7 @@
else valid_limbs -= processing_dismember
if(!istype(l_ear, /obj/item/clothing/ears/earmuffs) && !istype(r_ear, /obj/item/clothing/ears/earmuffs))
- ear_damage += 30
- ear_deaf += 120
+ adjustEarDamage(30, 120)
if(prob(70) && !shielded)
Paralyse(10)
@@ -376,8 +379,7 @@
else valid_limbs -= processing_dismember
if(!istype(l_ear, /obj/item/clothing/ears/earmuffs) && !istype(r_ear, /obj/item/clothing/ears/earmuffs))
- ear_damage += 15
- ear_deaf += 60
+ adjustEarDamage(15,60)
if(prob(50) && !shielded)
Paralyse(10)
@@ -414,16 +416,16 @@
M.attack_log += text("\[[time_stamp()]\] attacked [src.name] ([src.ckey])")
src.attack_log += text("\[[time_stamp()]\] was attacked by [M.name] ([M.ckey])")
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
- if(check_shields(damage, "the [M.name]"))
+ if(check_shields(damage, "the [M.name]", null, MELEE_ATTACK, M.armour_penetration))
return 0
var/dam_zone = pick("head", "chest", "groin", "l_arm", "l_hand", "r_arm", "r_hand", "l_leg", "l_foot", "r_leg", "r_foot")
var/obj/item/organ/external/affecting = get_organ(ran_zone(dam_zone))
- var/armor = run_armor_check(affecting, "melee")
+ var/armor = run_armor_check(affecting, "melee", armour_penetration = M.armour_penetration)
var/obj/item/organ/external/affected = src.get_organ(dam_zone)
if(affected)
affected.add_autopsy_data(M.name, damage) // Add the mob's name to the autopsy data
- apply_damage(damage,M.melee_damage_type, affecting, armor, M.name)
+ apply_damage(damage, M.melee_damage_type, affecting, armor)
updatehealth()
/mob/living/carbon/human/attack_larva(mob/living/carbon/alien/larva/L as mob)
@@ -461,7 +463,7 @@
else
damage = rand(5, 25)
- if(check_shields(damage, "the [M.name]"))
+ if(check_shields(damage, "the [M.name]", null, MELEE_ATTACK))
return 0
var/dam_zone = pick("head", "chest", "groin", "l_arm", "l_hand", "r_arm", "r_hand", "l_leg", "l_foot", "r_leg", "r_foot")
@@ -480,8 +482,8 @@
if(3 to 4) stunprob = 30
if(5 to 6) stunprob = 40
if(7 to 8) stunprob = 60
- if(9) stunprob = 70
- if(10) stunprob = 95
+ if(9) stunprob = 70
+ if(10) stunprob = 95
if(prob(stunprob))
M.powerlevel -= 3
@@ -489,11 +491,11 @@
M.powerlevel = 0
for(var/mob/O in viewers(src, null))
- if ((O.client && !( O.blinded )))
+ if((O.client && !( O.blinded )))
O.show_message(text("\red The [M.name] has shocked []!", src), 1)
Weaken(power)
- if (stuttering < power)
+ if(stuttering < power)
stuttering = power
Stun(power)
@@ -501,7 +503,7 @@
s.set_up(5, 1, src)
s.start()
- if (prob(stunprob) && M.powerlevel >= 8)
+ if(prob(stunprob) && M.powerlevel >= 8)
adjustFireLoss(M.powerlevel * rand(6,10))
@@ -511,9 +513,9 @@
/mob/living/carbon/human/restrained()
- if (handcuffed)
+ if(handcuffed)
return 1
- if (istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
+ if(istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
return 1
return 0
@@ -634,8 +636,8 @@
// Get rank from ID, ID inside PDA, PDA, ID in wallet, etc.
/mob/living/carbon/human/proc/get_authentification_rank(var/if_no_id = "No id", var/if_no_job = "No job")
var/obj/item/device/pda/pda = wear_id
- if (istype(pda))
- if (pda.id)
+ if(istype(pda))
+ if(pda.id)
return pda.id.rank
else
return pda.ownrank
@@ -651,16 +653,16 @@
/mob/living/carbon/human/proc/get_assignment(var/if_no_id = "No id", var/if_no_job = "No job")
var/obj/item/device/pda/pda = wear_id
var/obj/item/weapon/card/id/id = wear_id
- if (istype(pda))
- if (pda.id && istype(pda.id, /obj/item/weapon/card/id))
+ if(istype(pda))
+ if(pda.id && istype(pda.id, /obj/item/weapon/card/id))
. = pda.id.assignment
else
. = pda.ownjob
- else if (istype(id))
+ else if(istype(id))
. = id.assignment
else
return if_no_id
- if (!.)
+ if(!.)
. = if_no_job
return
@@ -669,12 +671,12 @@
/mob/living/carbon/human/proc/get_authentification_name(var/if_no_id = "Unknown")
var/obj/item/device/pda/pda = wear_id
var/obj/item/weapon/card/id/id = wear_id
- if (istype(pda))
- if (pda.id)
+ if(istype(pda))
+ if(pda.id)
. = pda.id.registered_name
else
. = pda.owner
- else if (istype(id))
+ else if(istype(id))
. = id.registered_name
else
return if_no_id
@@ -715,9 +717,9 @@
/mob/living/carbon/human/proc/get_idcard()
var/obj/item/weapon/card/id/id = wear_id
var/obj/item/device/pda/pda = wear_id
- if (istype(pda) && pda.id)
+ if(istype(pda) && pda.id)
id = pda.id
- if (istype(id))
+ if(istype(id))
return id
//Removed the horrible safety parameter. It was only being used by ninja code anyways.
@@ -828,7 +830,7 @@
U.accessories -= A
update_inv_w_uniform()
- if (href_list["criminal"])
+ if(href_list["criminal"])
if(hasHUD(usr,"security"))
var/modified = 0
@@ -843,10 +845,10 @@
perpname = name
if(perpname)
- for (var/datum/data/record/E in data_core.general)
- if (E.fields["name"] == perpname)
- for (var/datum/data/record/R in data_core.security)
- if (R.fields["id"] == E.fields["id"])
+ for(var/datum/data/record/E in data_core.general)
+ if(E.fields["name"] == perpname)
+ for(var/datum/data/record/R in data_core.security)
+ if(R.fields["id"] == E.fields["id"])
var/setcriminal = input(usr, "Specify a new criminal status for this person.", "Security HUD", R.fields["criminal"]) in list("None", "*Arrest*", "Incarcerated", "Parolled", "Released", "Cancel")
@@ -866,7 +868,7 @@
if(!modified)
to_chat(usr, "\red Unable to locate a data core entry for this person.")
- if (href_list["secrecord"])
+ if(href_list["secrecord"])
if(hasHUD(usr,"security"))
var/perpname = "wot"
var/read = 0
@@ -879,10 +881,10 @@
perpname = tempPda.owner
else
perpname = src.name
- for (var/datum/data/record/E in data_core.general)
- if (E.fields["name"] == perpname)
- for (var/datum/data/record/R in data_core.security)
- if (R.fields["id"] == E.fields["id"])
+ for(var/datum/data/record/E in data_core.general)
+ if(E.fields["name"] == perpname)
+ for(var/datum/data/record/R in data_core.security)
+ if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"security"))
to_chat(usr, "Name: [R.fields["name"]] Criminal Status: [R.fields["criminal"]]")
to_chat(usr, "Minor Crimes: [R.fields["mi_crim"]]")
@@ -896,7 +898,7 @@
if(!read)
to_chat(usr, "\red Unable to locate a data core entry for this person.")
- if (href_list["secrecordComment"])
+ if(href_list["secrecordComment"])
if(hasHUD(usr,"security"))
var/perpname = "wot"
var/read = 0
@@ -909,24 +911,24 @@
perpname = tempPda.owner
else
perpname = src.name
- for (var/datum/data/record/E in data_core.general)
- if (E.fields["name"] == perpname)
- for (var/datum/data/record/R in data_core.security)
- if (R.fields["id"] == E.fields["id"])
+ for(var/datum/data/record/E in data_core.general)
+ if(E.fields["name"] == perpname)
+ for(var/datum/data/record/R in data_core.security)
+ if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"security"))
read = 1
var/counter = 1
while(R.fields[text("com_[]", counter)])
to_chat(usr, text("[]", R.fields[text("com_[]", counter)]))
counter++
- if (counter == 1)
+ if(counter == 1)
to_chat(usr, "No comment found")
to_chat(usr, "\[Add comment\]")
if(!read)
to_chat(usr, "\red Unable to locate a data core entry for this person.")
- if (href_list["secrecordadd"])
+ if(href_list["secrecordadd"])
if(hasHUD(usr,"security"))
var/perpname = "wot"
if(wear_id)
@@ -937,13 +939,13 @@
perpname = tempPda.owner
else
perpname = src.name
- for (var/datum/data/record/E in data_core.general)
- if (E.fields["name"] == perpname)
- for (var/datum/data/record/R in data_core.security)
- if (R.fields["id"] == E.fields["id"])
+ for(var/datum/data/record/E in data_core.general)
+ if(E.fields["name"] == perpname)
+ for(var/datum/data/record/R in data_core.security)
+ if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"security"))
- var/t1 = sanitize(copytext(input("Add Comment:", "Sec. records", null, null) as message,1,MAX_MESSAGE_LEN))
- if ( !(t1) || usr.stat || usr.restrained() || !(hasHUD(usr,"security")) )
+ var/t1 = sanitize(copytext(input("Add Comment:", "Sec. records", null, null) as message,1,MAX_MESSAGE_LEN))
+ if( !(t1) || usr.stat || usr.restrained() || !(hasHUD(usr,"security")) )
return
var/counter = 1
while(R.fields[text("com_[]", counter)])
@@ -958,7 +960,7 @@
var/mob/living/silicon/ai/U = usr
R.fields[text("com_[counter]")] = text("Made by [U.name] (artificial intelligence) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [game_year] [t1]")
- if (href_list["medical"])
+ if(href_list["medical"])
if(hasHUD(usr,"medical"))
var/perpname = "wot"
var/modified = 0
@@ -972,10 +974,10 @@
else
perpname = src.name
- for (var/datum/data/record/E in data_core.general)
- if (E.fields["name"] == perpname)
- for (var/datum/data/record/R in data_core.general)
- if (R.fields["id"] == E.fields["id"])
+ for(var/datum/data/record/E in data_core.general)
+ if(E.fields["name"] == perpname)
+ for(var/datum/data/record/R in data_core.general)
+ if(R.fields["id"] == E.fields["id"])
var/setmedical = input(usr, "Specify a new medical status for this person.", "Medical HUD", R.fields["p_stat"]) in list("*SSD*", "*Deceased*", "Physically Unfit", "Active", "Disabled", "Cancel")
if(hasHUD(usr,"medical"))
@@ -996,7 +998,7 @@
if(!modified)
to_chat(usr, "\red Unable to locate a data core entry for this person.")
- if (href_list["medrecord"])
+ if(href_list["medrecord"])
if(hasHUD(usr,"medical"))
var/perpname = "wot"
var/read = 0
@@ -1009,10 +1011,10 @@
perpname = tempPda.owner
else
perpname = src.name
- for (var/datum/data/record/E in data_core.general)
- if (E.fields["name"] == perpname)
- for (var/datum/data/record/R in data_core.medical)
- if (R.fields["id"] == E.fields["id"])
+ for(var/datum/data/record/E in data_core.general)
+ if(E.fields["name"] == perpname)
+ for(var/datum/data/record/R in data_core.medical)
+ if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"medical"))
to_chat(usr, "Name: [R.fields["name"]] Blood Type: [R.fields["b_type"]]")
to_chat(usr, "DNA: [R.fields["b_dna"]]")
@@ -1027,7 +1029,7 @@
if(!read)
to_chat(usr, "\red Unable to locate a data core entry for this person.")
- if (href_list["medrecordComment"])
+ if(href_list["medrecordComment"])
if(hasHUD(usr,"medical"))
var/perpname = "wot"
var/read = 0
@@ -1040,24 +1042,24 @@
perpname = tempPda.owner
else
perpname = src.name
- for (var/datum/data/record/E in data_core.general)
- if (E.fields["name"] == perpname)
- for (var/datum/data/record/R in data_core.medical)
- if (R.fields["id"] == E.fields["id"])
+ for(var/datum/data/record/E in data_core.general)
+ if(E.fields["name"] == perpname)
+ for(var/datum/data/record/R in data_core.medical)
+ if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"medical"))
read = 1
var/counter = 1
while(R.fields[text("com_[]", counter)])
to_chat(usr, text("[]", R.fields[text("com_[]", counter)]))
counter++
- if (counter == 1)
+ if(counter == 1)
to_chat(usr, "No comment found")
to_chat(usr, "\[Add comment\]")
if(!read)
to_chat(usr, "\red Unable to locate a data core entry for this person.")
- if (href_list["medrecordadd"])
+ if(href_list["medrecordadd"])
if(hasHUD(usr,"medical"))
var/perpname = "wot"
if(wear_id)
@@ -1068,13 +1070,13 @@
perpname = tempPda.owner
else
perpname = src.name
- for (var/datum/data/record/E in data_core.general)
- if (E.fields["name"] == perpname)
- for (var/datum/data/record/R in data_core.medical)
- if (R.fields["id"] == E.fields["id"])
+ for(var/datum/data/record/E in data_core.general)
+ if(E.fields["name"] == perpname)
+ for(var/datum/data/record/R in data_core.medical)
+ if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"medical"))
- var/t1 = sanitize(copytext(input("Add Comment:", "Med. records", null, null) as message,1,MAX_MESSAGE_LEN))
- if ( !(t1) || usr.stat || usr.restrained() || !(hasHUD(usr,"medical")) )
+ var/t1 = sanitize(copytext(input("Add Comment:", "Med. records", null, null) as message,1,MAX_MESSAGE_LEN))
+ if( !(t1) || usr.stat || usr.restrained() || !(hasHUD(usr,"medical")) )
return
var/counter = 1
while(R.fields[text("com_[]", counter)])
@@ -1086,11 +1088,11 @@
var/mob/living/silicon/robot/U = usr
R.fields[text("com_[counter]")] = text("Made by [U.name] ([U.modtype] [U.braintype]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [game_year] [t1]")
- if (href_list["lookitem"])
+ if(href_list["lookitem"])
var/obj/item/I = locate(href_list["lookitem"])
src.examinate(I)
- if (href_list["lookmob"])
+ if(href_list["lookmob"])
var/mob/M = locate(href_list["lookmob"])
src.examinate(M)
. = ..()
@@ -1195,7 +1197,7 @@
if(!affecting)
. = 0
fail_msg = "They are missing that limb."
- else if (affecting.status & ORGAN_ROBOT)
+ else if(affecting.status & ORGAN_ROBOT)
. = 0
fail_msg = "That limb is robotic."
else
@@ -1283,8 +1285,8 @@
var/limb_path = organ_data["path"]
var/obj/item/organ/external/O = new limb_path(temp_holder)
if(H.get_limb_by_name(O.name)) //Check to see if the user already has an limb with the same name as the 'missing limb'. If they do, skip regrowth.
- continue //In an example, this will prevent duplication of the mob's right arm if the mob is a Human and they have a Diona right arm, since,
- //while the limb with the name 'right_arm' the mob has may not be listed in their species' bodyparts definition, it is still viable and has the appropriate limb name.
+ continue //In an example, this will prevent duplication of the mob's right arm if the mob is a Human and they have a Diona right arm, since,
+ //while the limb with the name 'right_arm' the mob has may not be listed in their species' bodyparts definition, it is still viable and has the appropriate limb name.
else
O = new limb_path(H) //Create the limb on the player.
O.owner = H
@@ -1324,7 +1326,7 @@
mutations.Remove(HUSK)
if(!client || !key) //Don't boot out anyone already in the mob.
- for (var/obj/item/organ/internal/brain/H in world)
+ for(var/obj/item/organ/internal/brain/H in world)
if(H.brainmob)
if(H.brainmob.real_name == src.real_name)
if(H.brainmob.mind)
@@ -1359,30 +1361,30 @@
var/germs = 0
var/tdamage = 0
var/ticks = 0
- while (germs < 2501 && ticks < 100000 && round(damage/10)*20)
+ while(germs < 2501 && ticks < 100000 && round(damage/10)*20)
diary << "VIRUS TESTING: [ticks] : germs [germs] tdamage [tdamage] prob [round(damage/10)*20]"
ticks++
- if (prob(round(damage/10)*20))
+ if(prob(round(damage/10)*20))
germs++
- if (germs == 100)
+ if(germs == 100)
to_chat(world, "Reached stage 1 in [ticks] ticks")
- if (germs > 100)
- if (prob(10))
+ if(germs > 100)
+ if(prob(10))
damage++
germs++
- if (germs == 1000)
+ if(germs == 1000)
to_chat(world, "Reached stage 2 in [ticks] ticks")
- if (germs > 1000)
+ if(germs > 1000)
damage++
germs++
- if (germs == 2500)
+ if(germs == 2500)
to_chat(world, "Reached stage 3 in [ticks] ticks")
to_chat(world, "Mob took [tdamage] tox damage")
*/
//returns 1 if made bloody, returns 0 otherwise
/mob/living/carbon/human/add_blood(mob/living/carbon/human/M as mob)
- if (!..())
+ if(!..())
return 0
//if this blood isn't already in the list, add it
if(blood_DNA[M.dna.unique_enzymes])
@@ -1537,14 +1539,17 @@
if(species.base_color && default_colour)
//Apply colour.
- r_skin = hex2num(copytext(species.base_color,2,4))
- g_skin = hex2num(copytext(species.base_color,4,6))
- b_skin = hex2num(copytext(species.base_color,6,8))
+ r_skin = hex2num(copytext(species.base_color, 2, 4))
+ g_skin = hex2num(copytext(species.base_color, 4, 6))
+ b_skin = hex2num(copytext(species.base_color, 6, 8))
else
r_skin = 0
g_skin = 0
b_skin = 0
+ if(!(species.bodyflags & HAS_SKIN_TONE))
+ s_tone = 0
+
species.create_organs(src)
//Handle default hair/head accessories for created mobs.
@@ -1556,6 +1561,32 @@
if(species.default_headacc)
H.ha_style = species.default_headacc
+ if(species.default_hair_colour)
+ //Apply colour.
+ H.r_hair = hex2num(copytext(species.default_hair_colour, 2, 4))
+ H.g_hair = hex2num(copytext(species.default_hair_colour, 4, 6))
+ H.b_hair = hex2num(copytext(species.default_hair_colour, 6, 8))
+ else
+ H.r_hair = 0
+ H.g_hair = 0
+ H.b_hair = 0
+ if(species.default_fhair_colour)
+ H.r_facial = hex2num(copytext(species.default_fhair_colour, 2, 4))
+ H.g_facial = hex2num(copytext(species.default_fhair_colour, 4, 6))
+ H.b_facial = hex2num(copytext(species.default_fhair_colour, 6, 8))
+ else
+ H.r_facial = 0
+ H.g_facial = 0
+ H.b_facial = 0
+ if(species.default_headacc_colour)
+ H.r_headacc = hex2num(copytext(species.default_headacc_colour, 2, 4))
+ H.g_headacc = hex2num(copytext(species.default_headacc_colour, 4, 6))
+ H.b_headacc = hex2num(copytext(species.default_headacc_colour, 6, 8))
+ else
+ H.r_headacc = 0
+ H.g_headacc = 0
+ H.b_headacc = 0
+
if(!dna)
dna = new /datum/dna(null)
dna.species = species.name
@@ -1591,32 +1622,32 @@
set name = "Write in blood"
set desc = "Use blood on your hands to write a short message on the floor or a wall, murder mystery style."
- if (usr != src)
+ if(usr != src)
return 0 //something is terribly wrong
- if (!bloody_hands)
+ if(!bloody_hands)
verbs -= /mob/living/carbon/human/proc/bloody_doodle
- if (src.gloves)
+ if(src.gloves)
to_chat(src, "Your [src.gloves] are getting in the way.")
return
var/turf/simulated/T = src.loc
- if (!istype(T)) //to prevent doodling out of mechs and lockers
+ if(!istype(T)) //to prevent doodling out of mechs and lockers
to_chat(src, "You cannot reach the floor.")
return
var/direction = input(src,"Which way?","Tile selection") as anything in list("Here","North","South","East","West")
- if (direction != "Here")
+ if(direction != "Here")
T = get_step(T,text2dir(direction))
- if (!istype(T))
+ if(!istype(T))
to_chat(src, "You cannot doodle there.")
return
var/num_doodles = 0
- for (var/obj/effect/decal/cleanable/blood/writing/W in T)
+ for(var/obj/effect/decal/cleanable/blood/writing/W in T)
num_doodles++
- if (num_doodles > 4)
+ if(num_doodles > 4)
to_chat(src, "There is no space to write on!")
return
@@ -1624,11 +1655,11 @@
var/message = stripped_input(src,"Write a message. It cannot be longer than [max_length] characters.","Blood writing", "")
- if (message)
+ if(message)
var/used_blood_amount = round(length(message) / 30, 1)
bloody_hands = max(0, bloody_hands - used_blood_amount) //use up some blood
- if (length(message) > max_length)
+ if(length(message) > max_length)
message += "-"
to_chat(src, "You ran out of blood to write with!")
@@ -1673,7 +1704,7 @@
if((head_organ.species.name in tmp_hair.species_allowed) && (robohead.company in tmp_hair.models_allowed)) //Populate the list of available monitor styles only with styles that the monitor-head is allowed to use.
hair += i
- var/new_style = input(src, "Select a monitor display", "Monitor Display", head_organ.h_style) as null|anything in hair
+ var/new_style = input(src, "Select a monitor display", "Monitor Display", head_organ.h_style) as null|anything in hair
if(incapacitated())
to_chat(src, "You were interrupted while changing your monitor display.")
return
@@ -1853,7 +1884,7 @@
threatcount += 2
- //Loyalty implants imply trustworthyness
+ //Mindshield implants imply slight trustworthiness
if(isloyal(src))
threatcount -= 1
@@ -1878,7 +1909,7 @@
if(current_size >= STAGE_THREE)
var/list/handlist = list(l_hand, r_hand)
for(var/obj/item/hand in handlist)
- if(prob(current_size * 5) && hand.w_class >= ((11-current_size)/2) && unEquip(hand))
+ if(prob(current_size * 5) && hand.w_class >= ((11-current_size)/2) && unEquip(hand))
step_towards(hand, src)
to_chat(src, "\The [S] pulls \the [hand] from your grip!")
apply_effect(current_size * 3, IRRADIATE)
@@ -1982,4 +2013,121 @@
. |= A.GetAccess()
/mob/living/carbon/human/is_mechanical()
- return ..() || (species.flags & ALL_RPARTS) != 0
\ No newline at end of file
+ return ..() || (species.flags & ALL_RPARTS) != 0
+
+/mob/living/carbon/human/can_use_guns(var/obj/item/weapon/gun/G)
+ . = ..()
+
+ if(G.trigger_guard == TRIGGER_GUARD_NORMAL)
+ if(HULK in mutations)
+ to_chat(src, "Your meaty finger is much too large for the trigger guard!")
+ return 0
+ if(species.flags & NOGUNS)
+ to_chat(src, "Your fingers don't fit in the trigger guard!")
+ return 0
+
+ if(martial_art && martial_art.name == "The Sleeping Carp") //great dishonor to famiry
+ to_chat(src, "Use of ranged weaponry would bring dishonor to the clan.")
+ return 0
+
+ return .
+
+/mob/living/carbon/human/serialize()
+ // Currently: Limbs/organs only
+ var/list/data = ..()
+ var/list/limbs_list = list()
+ var/list/organs_list = list()
+ var/list/equip_list = list()
+ data["limbs"] = limbs_list
+ data["iorgans"] = organs_list
+ data["equip"] = equip_list
+
+ data["dna"] = dna.serialize()
+ data["age"] = age
+
+ // No being naked
+ data["ushirt"] = undershirt
+ data["socks"] = socks
+ data["uwear"] = underwear
+
+ // Limbs
+ for(var/limb in organs_by_name)
+ var/obj/item/organ/O = organs_by_name[limb]
+ if(!O)
+ limbs_list[limb] = "missing"
+ continue
+
+ limbs_list[limb] = O.serialize()
+
+ // Internal organs/augments
+ for(var/organ in internal_organs)
+ var/obj/item/organ/O = organ
+ organs_list[O.name] = O.serialize()
+
+ // Equipment
+ equip_list.len = slots_amt
+ for(var/i = 1, i < slots_amt, i++)
+ var/obj/item/thing = get_item_by_slot(i)
+ if(thing != null)
+ equip_list[i] = thing.serialize()
+
+ return data
+
+/mob/living/carbon/human/deserialize(list/data)
+ var/list/limbs_list = data["limbs"]
+ var/list/organs_list = data["iorgans"]
+ var/list/equip_list = data["equip"]
+ var/turf/T = get_turf(src)
+ if(!islist(data["limbs"]))
+ throw EXCEPTION("Expected a limbs list, but found none")
+
+ if(islist(data["dna"]))
+ dna.deserialize(data["dna"])
+ real_name = dna.real_name
+ name = real_name
+ UpdateAppearance()
+ set_species(dna.species)
+ age = data["age"]
+ undershirt = data["ushirt"]
+ underwear = data["uwear"]
+ socks = data["socks"]
+ for(var/obj/item/organ/internal/iorgan in internal_organs)
+ qdel(iorgan)
+
+ for(var/obj/item/organ/external/organ in organs)
+ qdel(organ)
+
+ for(var/limb in limbs_list)
+ // Missing means skip this part - it's missing
+ if(limbs_list[limb] == "missing")
+ continue
+ // "New" code handles insertion and DNA sync'ing
+ var/obj/item/organ/external/E = list_to_object(limbs_list[limb], src)
+ E.sync_colour_to_dna()
+
+ for(var/organ in organs_list)
+ // As above, "New" code handles insertion, DNA sync
+ list_to_object(organs_list[organ], src)
+
+
+ // De-serialize equipment
+ // #1: Jumpsuit
+ // #2: Outer suit
+ // #3+: Everything else
+ if(islist(equip_list[slot_w_uniform]))
+ var/obj/item/clothing/C = list_to_object(equip_list[slot_w_uniform], T)
+ equip_to_slot_if_possible(C, slot_w_uniform)
+
+ if(islist(equip_list[slot_wear_suit]))
+ var/obj/item/clothing/C = list_to_object(equip_list[slot_wear_suit], T)
+ equip_to_slot_if_possible(C, slot_wear_suit)
+
+ for(var/i = 1, i < slots_amt, i++)
+ if(i == slot_w_uniform || i == slot_wear_suit)
+ continue
+ if(islist(equip_list[i]))
+ var/obj/item/clothing/C = list_to_object(equip_list[i], T)
+ equip_to_slot_if_possible(C, i)
+ update_icons()
+
+ ..()
diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm
index 33cb567ba4a..81fe04bc9de 100644
--- a/code/modules/mob/living/carbon/human/human_attackhand.dm
+++ b/code/modules/mob/living/carbon/human/human_attackhand.dm
@@ -1,5 +1,5 @@
/mob/living/carbon/human/attack_hand(mob/living/carbon/human/M as mob)
- if (istype(loc, /turf) && istype(loc.loc, /area/start))
+ if(istype(loc, /turf) && istype(loc.loc, /area/start))
to_chat(M, "No attacking people at spawn, you jackass.")
return
@@ -10,7 +10,7 @@
var/mob/living/carbon/human/H = M
if(istype(H))
var/obj/item/organ/external/temp = H.organs_by_name["r_hand"]
- if (H.hand)
+ if(H.hand)
temp = H.organs_by_name["l_hand"]
if(!temp || !temp.is_usable())
to_chat(H, "\red You can't use your hand.")
@@ -18,10 +18,9 @@
..()
- if((M != src) && check_shields(0, M.name))
+ if((M != src) && M.a_intent != "help" && check_shields(0, M.name, attack_type = UNARMED_ATTACK))
add_logs(src, M, "attempted to touch")
- M.do_attack_animation(src)
- visible_message("\red [M] attempted to touch [src]!")
+ visible_message("[M] attempted to touch [src]!")
return 0
if(istype(M.gloves , /obj/item/clothing/gloves/boxing/hologlove))
@@ -109,36 +108,31 @@
return 1
if(I_HARM)
+ //Vampire code
+ if(M.mind && M.mind.vampire && (M.mind in ticker.mode.vampires) && !M.mind.vampire.draining && M.zone_sel && M.zone_sel.selecting == "head" && src != M)
+ if(species && species.flags & NO_BLOOD)//why this hell were we never checkinf for this?
+ to_chat(M, "They have no blood!")
+ return
+ if(mind && mind.vampire && (mind in ticker.mode.vampires))
+ to_chat(M, "Your fangs fail to pierce [src.name]'s cold flesh")
+ return
+ if(SKELETON in mutations)
+ to_chat(M, "There is no blood in a skeleton!")
+ return
+ if(issmall(src) && !ckey) //Monkeyized humans are okay, humanized monkeys are okey, monkeys are not.
+ to_chat(M, "Blood from a monkey is useless!")
+ return
+ //we're good to suck the blood, blaah
+ M.mind.vampire.handle_bloodsucking(src)
+ add_logs(src, M, "vampirebit")
+ msg_admin_attack("[key_name_admin(M)] vampirebit [key_name_admin(src)]")
+ return
+ //end vampire codes
if(attacker_style && attacker_style.harm_act(H, src))
return 1
else
var/datum/unarmed_attack/attack = M.species.unarmed
- //Vampire code
- if(M.zone_sel && M.zone_sel.selecting == "head" && src != M)
- if(M.mind && M.mind.vampire && (M.mind in ticker.mode.vampires) && !M.mind.vampire.draining)
- if((head && (head.flags & HEADCOVERSMOUTH)) || (wear_mask && (wear_mask.flags & MASKCOVERSMOUTH)))
- to_chat(M, "Remove their mask!")
- return 0
- if((M.head && (M.head.flags & HEADCOVERSMOUTH)) || (M.wear_mask && (M.wear_mask.flags & MASKCOVERSMOUTH)))
- to_chat(M, "Remove your mask!")
- return 0
- if(mind && mind.vampire && (mind in ticker.mode.vampires))
- to_chat(M, "Your fangs fail to pierce [src.name]'s cold flesh")
- return 0
- if(SKELETON in mutations)
- to_chat(M, "There is no blood in a skeleton!")
- return 0
- if(issmall(src) && !ckey) //Monkeyized humans are okay, humanized monkeys are okey, monkeys are not.
- to_chat(M, "Blood from a monkey is useless!")
- return 0
- //we're good to suck the blood, blaah
- M.mind.vampire.handle_bloodsucking(src)
- add_logs(src, M, "vampirebit")
- msg_admin_attack("[key_name_admin(M)] vampirebit [key_name_admin(src)]")
- return
- //end vampire codes
-
M.do_attack_animation(src)
add_logs(src, M, "[pick(attack.attack_verb)]ed")
@@ -185,7 +179,7 @@
w_uniform.add_fingerprint(M)
var/obj/item/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
var/randn = rand(1, 100)
- if (randn <= 25)
+ if(randn <= 25)
apply_effect(2, WEAKEN, run_armor_check(affecting, "melee"))
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
visible_message("\red [M] has pushed [src]!")
diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm
index 88e655beb0e..0e2e95bc778 100644
--- a/code/modules/mob/living/carbon/human/human_damage.dm
+++ b/code/modules/mob/living/carbon/human/human_damage.dm
@@ -26,6 +26,7 @@
update_revive()
med_hud_set_health()
med_hud_set_status()
+ handle_hud_icons()
/mob/living/carbon/human/adjustBrainLoss(var/amount)
if(status_flags & GODMODE)
@@ -103,7 +104,7 @@
if(species && species.brute_mod)
amount = amount*species.brute_mod
- if (organ_name in organs_by_name)
+ if(organ_name in organs_by_name)
var/obj/item/organ/external/O = get_organ(organ_name)
if(amount > 0)
@@ -117,7 +118,7 @@
if(species && species.burn_mod)
amount = amount*species.burn_mod
- if (organ_name in organs_by_name)
+ if(organ_name in organs_by_name)
var/obj/item/organ/external/O = get_organ(organ_name)
if(amount > 0)
@@ -316,8 +317,9 @@ This function restores the subjects blood to max.
*/
/mob/living/carbon/human/proc/restore_blood()
if(!(species.flags & NO_BLOOD))
- var/blood_volume = vessel.get_reagent_amount("blood")
- vessel.add_reagent("blood", 560.0 - blood_volume)
+ var/blood_type = get_blood_name()
+ var/blood_volume = vessel.get_reagent_amount(blood_type)
+ vessel.add_reagent(blood_type, BLOOD_VOLUME_NORMAL - blood_volume)
/*
This function restores all organs.
@@ -383,7 +385,7 @@ This function restores all organs.
var/list/attack_bubble_recipients = list()
var/mob/living/user
for(var/mob/O in viewers(user, src))
- if (O.client && !(O.blinded))
+ if(O.client && !(O.blinded))
attack_bubble_recipients.Add(O.client)
spawn(0)
var/image/dmgIcon = image('icons/effects/hit_blips.dmi', src, "dmg[rand(1,2)]",MOB_LAYER+1)
diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm
index 835f741be3d..55fd52ada9e 100644
--- a/code/modules/mob/living/carbon/human/human_defense.dm
+++ b/code/modules/mob/living/carbon/human/human_defense.dm
@@ -27,12 +27,12 @@ emp_act
P.current = curloc
P.yo = new_y - curloc.y
P.xo = new_x - curloc.x
- P.Angle = ""//round(Get_Angle(P,P.original))
+ P.Angle = null
return -1 // complete projectile permutation
//Shields
- if(check_shields(P.damage, "the [P.name]", P))
+ if(check_shields(P.damage, "the [P.name]", P, PROJECTILE_ATTACK, P.armour_penetration))
P.on_hit(src, 100, def_zone)
return 2
@@ -41,12 +41,15 @@ emp_act
return
//Shrapnel
- if (P.damage_type == BRUTE)
+ if(P.damage_type == BRUTE)
var/armor = getarmor_organ(organ, "bullet")
if((P.embed && prob(20 + max(P.damage - armor, -10))))
var/obj/item/weapon/shard/shrapnel/SP = new()
(SP.name) = "[P.name] shrapnel"
- (SP.desc) = "[SP.desc] It looks like it was fired from [P.shot_from]."
+ if(P.ammo_casing && P.ammo_casing.caliber)
+ (SP.desc) = "[SP.desc] It looks like it is a [P.ammo_casing.caliber] caliber round."
+ else
+ (SP.desc) = "[SP.desc] The round's caliber is unidentifiable."
(SP.loc) = organ
organ.embed(SP)
@@ -88,7 +91,7 @@ emp_act
//this proc returns the Siemens coefficient of electrical resistivity for a particular external organ.
/mob/living/carbon/human/proc/get_siemens_coefficient_organ(var/obj/item/organ/external/def_zone)
- if (!def_zone)
+ if(!def_zone)
return 1.0
var/siemens_coefficient = 1.0
@@ -129,40 +132,24 @@ emp_act
//End Here
-/mob/living/carbon/human/proc/check_shields(var/damage = 0, var/attack_text = "the attack", var/obj/item/O)
- if(O)
- if(O.flags & NOSHIELD) //weapon ignores shields altogether
- return 0
- if(l_hand && istype(l_hand, /obj/item/weapon))//Current base is the prob(50-d/3)
- var/obj/item/weapon/I = l_hand
- if(I.IsShield() && (prob(50 - round(damage / 3))))
- visible_message("[src] blocks [attack_text] with [l_hand]!", \
- "[src] blocks [attack_text] with [l_hand]!")
+/mob/living/carbon/human/proc/check_shields(damage = 0, attack_text = "the attack", atom/movable/AM, attack_type = MELEE_ATTACK, armour_penetration = 0)
+ var/block_chance_modifier = round(damage / -3)
+
+ if(l_hand && !istype(l_hand, /obj/item/clothing))
+ var/final_block_chance = l_hand.block_chance - (Clamp((armour_penetration-l_hand.armour_penetration)/2,0,100)) + block_chance_modifier //So armour piercing blades can still be parried by other blades, for example
+ if(l_hand.hit_reaction(src, attack_text, final_block_chance, damage, attack_type))
return 1
- if(r_hand && istype(r_hand, /obj/item/weapon))
- var/obj/item/weapon/I = r_hand
- if(I.IsShield() && (prob(50 - round(damage / 3))))
- visible_message("[src] blocks [attack_text] with [r_hand]!", \
- "[src] blocks [attack_text] with [r_hand]!")
+ if(r_hand && !istype(r_hand, /obj/item/clothing))
+ var/final_block_chance = r_hand.block_chance - (Clamp((armour_penetration-r_hand.armour_penetration)/2,0,100)) + block_chance_modifier //Need to reset the var so it doesn't carry over modifications between attempts
+ if(r_hand.hit_reaction(src, attack_text, final_block_chance, damage, attack_type))
return 1
- if(wear_suit && istype(wear_suit, /obj/item/))
- var/obj/item/I = wear_suit
- if(I.IsShield() && (prob(50)))
- visible_message("The reactive teleport system flings [src] clear of [attack_text]!", \
- "The reactive teleport system flings [src] clear of [attack_text]!")
- var/list/turfs = new/list()
- for(var/turf/T in orange(6, src))
- if(istype(T,/turf/space)) continue
- if(T.density) continue
- if(T.x>world.maxx-6 || T.x<6) continue
- if(T.y>world.maxy-6 || T.y<6) continue
- turfs += T
- if(!turfs.len) turfs += pick(/turf in orange(6, src))
- var/turf/picked = pick(turfs)
- if(!isturf(picked)) return
- if(buckled)
- buckled.unbuckle_mob()
- src.loc = picked
+ if(wear_suit)
+ var/final_block_chance = wear_suit.block_chance - (Clamp((armour_penetration-wear_suit.armour_penetration)/2,0,100)) + block_chance_modifier
+ if(wear_suit.hit_reaction(src, attack_text, final_block_chance, damage, attack_type))
+ return 1
+ if(w_uniform)
+ var/final_block_chance = w_uniform.block_chance - (Clamp((armour_penetration-w_uniform.armour_penetration)/2,0,100)) + block_chance_modifier
+ if(w_uniform.hit_reaction(src, attack_text, final_block_chance, damage, attack_type))
return 1
return 0
@@ -218,7 +205,7 @@ emp_act
if(user != src)
user.do_attack_animation(src)
- if(check_shields(I.force, "the [I.name]", I))
+ if(check_shields(I.force, "the [I.name]", I, MELEE_ATTACK, I.armour_penetration))
return 0
if(istype(I,/obj/item/weapon/card/emag))
@@ -233,7 +220,7 @@ emp_act
var/armor = run_armor_check(affecting, "melee", "Your armor has protected your [hit_area].", "Your armor has softened hit to your [hit_area].", armour_penetration = I.armour_penetration)
var/weapon_sharp = is_sharp(I)
var/weapon_edge = has_edge(I)
- if ((weapon_sharp || weapon_edge) && prob(getarmor(user.zone_sel.selecting, "melee")))
+ if((weapon_sharp || weapon_edge) && prob(getarmor(user.zone_sel.selecting, "melee")))
weapon_sharp = 0
weapon_edge = 0
@@ -296,9 +283,9 @@ emp_act
forcesay(hit_appends) //forcesay checks stat already
/* //Melee weapon embedded object code. Commented out, as most people on the forums seem to find this annoying and think it does not contribute to general gameplay. - Dave
- if (I.damtype == BRUTE && !I.is_robot_module())
+ if(I.damtype == BRUTE && !I.is_robot_module())
var/damage = I.force
- if (armor)
+ if(armor)
damage /= armor+1
//blunt objects should really not be embedding in things unless a huge amount of force is involved
@@ -312,63 +299,56 @@ emp_act
//this proc handles being hit by a thrown atom
/mob/living/carbon/human/hitby(atom/movable/AM as mob|obj,var/speed = 5)
- if(istype(AM,/obj/))
- var/obj/O = AM
+ if(istype(AM, /obj/item))
+ var/obj/item/I = AM
if(in_throw_mode && !get_active_hand() && speed <= 5) //empty active hand and we're in throw mode
if(canmove && !restrained())
- if(isturf(O.loc))
- put_in_active_hand(O)
- visible_message("[src] catches [O]!")
+ if(isturf(I.loc))
+ put_in_active_hand(I)
+ visible_message("[src] catches [I]!")
throw_mode_off()
return
var/zone = ran_zone("chest", 65)
var/dtype = BRUTE
- if(istype(O,/obj/item/weapon))
- var/obj/item/weapon/W = O
+ if(istype(I, /obj/item/weapon))
+ var/obj/item/weapon/W = I
dtype = W.damtype
- var/throw_damage = O.throwforce*(speed/5)
+ var/throw_damage = I.throwforce*(speed/5)
- /*
- if(!zone)
- visible_message("\blue \The [O] misses [src] narrowly!")
- return
- */
- O.throwing = 0 //it hit, so stop moving
+ I.throwing = 0 //it hit, so stop moving
- if ((O.thrower != src) && check_shields(throw_damage, "[O]"))
+ if((I.thrower != src) && check_shields(throw_damage, "\the [I.name]", I, THROWN_PROJECTILE_ATTACK))
return
var/obj/item/organ/external/affecting = get_organ(zone)
if(!affecting)
- var/missverb = (O.gender == PLURAL) ? "whizz" : "whizzes"
- visible_message("\The [O] [missverb] past [src]'s missing [parse_zone(zone)]!",
- "\The [O] [missverb] past your missing [parse_zone(zone)]!")
+ var/missverb = (I.gender == PLURAL) ? "whizz" : "whizzes"
+ visible_message("\The [I] [missverb] past [src]'s missing [parse_zone(zone)]!",
+ "\The [I] [missverb] past your missing [parse_zone(zone)]!")
return
var/hit_area = affecting.name
- src.visible_message("\red [src] has been hit in the [hit_area] by [O].")
- var/armor = run_armor_check(affecting, "melee", "Your armor has protected your [hit_area].", "Your armor has softened hit to your [hit_area].") //I guess "melee" is the best fit here
+ src.visible_message("\red [src] has been hit in the [hit_area] by [I].")
+ var/armor = run_armor_check(affecting, "melee", "Your armor has protected your [hit_area].", "Your armor has softened hit to your [hit_area].", I.armour_penetration) //I guess "melee" is the best fit here
+ apply_damage(throw_damage, dtype, zone, armor, is_sharp(I), has_edge(I), I)
- apply_damage(throw_damage, dtype, zone, armor, is_sharp(O), has_edge(O), O)
-
- if(ismob(O.thrower))
- var/mob/M = O.thrower
+ if(ismob(I.thrower))
+ var/mob/M = I.thrower
if(M)
- src.attack_log += text("\[[time_stamp()]\] Has been hit with a [O], thrown by [key_name(M)]")
- M.attack_log += text("\[[time_stamp()]\] Hit [key_name(src)] with a thrown [O]")
+ src.attack_log += text("\[[time_stamp()]\] Has been hit with a [I], thrown by [key_name(M)]")
+ M.attack_log += text("\[[time_stamp()]\] Hit [key_name(src)] with a thrown [I]")
if(!istype(src,/mob/living/simple_animal/mouse))
- msg_admin_attack("[key_name_admin(src)] was hit by a [O], thrown by [key_name_admin(M)]")
+ msg_admin_attack("[key_name_admin(src)] was hit by a [I], thrown by [key_name_admin(M)]")
//thrown weapon embedded object code.
- if(dtype == BRUTE && istype(O,/obj/item))
- var/obj/item/I = O
- if (!I.is_robot_module())
+ if(dtype == BRUTE && istype(I))
+ if(!I.is_robot_module())
var/sharp = is_sharp(I)
var/damage = throw_damage
- if (armor)
+ if(armor)
damage /= armor+1
//blunt objects should really not be embedding in things unless a huge amount of force is involved
@@ -381,10 +361,10 @@ emp_act
affecting.embed(I)
// Begin BS12 momentum-transfer code.
- if(O.throw_source && speed >= 15)
- var/obj/item/weapon/W = O
+ if(I.throw_source && speed >= 15)
+ var/obj/item/weapon/W = I
var/momentum = speed/2
- var/dir = get_dir(O.throw_source, src)
+ var/dir = get_dir(I.throw_source, src)
visible_message("\red [src] staggers under the impact!","\red You stagger under the impact!")
src.throw_at(get_edge_target_turf(src,dir),1,momentum)
@@ -396,14 +376,14 @@ emp_act
if(T)
src.loc = T
- visible_message("[src] is pinned to the wall by [O]!","You are pinned to the wall by [O]!")
+ visible_message("[src] is pinned to the wall by [I]!","You are pinned to the wall by [I]!")
src.anchored = 1
- src.pinned += O
+ src.pinned += I
/mob/living/carbon/human/proc/bloody_hands(var/mob/living/source, var/amount = 2)
- if (gloves)
+ if(gloves)
gloves.add_blood(source)
gloves:transfer_blood = amount
gloves:bloody_hands_mob = source
diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm
index 6f106f5e125..a74409a9b44 100644
--- a/code/modules/mob/living/carbon/human/human_defines.dm
+++ b/code/modules/mob/living/carbon/human/human_defines.dm
@@ -53,6 +53,8 @@ var/global/default_martial_art = new/datum/martial_art
var/speech_problem_flag = 0
+ var/datum/personal_crafting/handcrafting
+
var/datum/martial_art/martial_art = null
var/special_voice = "" // For changing our voice. Used by a symptom.
@@ -70,7 +72,7 @@ var/global/default_martial_art = new/datum/martial_art
var/mob/remoteview_target = null
var/meatleft = 3 //For chef item
var/decaylevel = 0 // For rotting bodies
- var/max_blood = 560 // For stuff in the vessel
+ var/max_blood = BLOOD_VOLUME_NORMAL // For stuff in the vessel
var/slime_color = "blue" //For slime people this defines their color, it's blue by default to pay tribute to the old icons
var/check_mutations=0 // Check mutations on next life tick
@@ -80,4 +82,4 @@ var/global/default_martial_art = new/datum/martial_art
var/fire_dmi = 'icons/mob/OnFire.dmi'
var/fire_sprite = "Standing"
- var/datum/body_accessory/body_accessory = null
\ No newline at end of file
+ var/datum/body_accessory/body_accessory = null
diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm
index 5d79e3f6237..cf66c1d2c15 100644
--- a/code/modules/mob/living/carbon/human/human_movement.dm
+++ b/code/modules/mob/living/carbon/human/human_movement.dm
@@ -24,7 +24,7 @@
tally += (health_deficiency / 25)
var/hungry = (500 - nutrition)/5 // So overeat would be 100 and default level would be 80
- if (hungry >= 70)
+ if(hungry >= 70)
tally += hungry/50
if(wear_suit)
@@ -46,7 +46,7 @@
if(FAT in src.mutations)
tally += 1.5
- if (bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT)
+ if(bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT)
tally += (BODYTEMP_COLD_DAMAGE_LIMIT - bodytemperature) / COLD_SLOWDOWN_FACTOR
tally += 2*stance_damage //damaged/missing feet or legs is slow
@@ -79,7 +79,7 @@
break
if(thrust)
- if((movement_dir || thrust.stabilization_on) && thrust.allow_thrust(0.01, src))
+ if((movement_dir || thrust.stabilizers) && thrust.allow_thrust(0.01, src))
return 1
return 0
diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm
index 56838b8d14e..aa0724c5c80 100644
--- a/code/modules/mob/living/carbon/human/human_organs.dm
+++ b/code/modules/mob/living/carbon/human/human_organs.dm
@@ -42,45 +42,45 @@
E.process()
number_wounds += E.number_wounds
- if (!lying && world.time - l_move_time < 15)
+ if(!lying && world.time - l_move_time < 15)
//Moving around with fractured ribs won't do you any good
- if (E.is_broken() && E.internal_organs && E.internal_organs.len && prob(15))
+ if(E.is_broken() && E.internal_organs && E.internal_organs.len && prob(15))
var/obj/item/organ/internal/I = pick(E.internal_organs)
custom_pain("You feel broken bones moving in your [E.name]!", 1)
I.take_damage(rand(3,5))
//Moving makes open wounds get infected much faster
- if (E.wounds.len)
+ if(E.wounds.len)
for(var/datum/wound/W in E.wounds)
- if (W.infection_check())
+ if(W.infection_check())
W.germ_level += 1
/mob/living/carbon/human/proc/handle_stance()
// Don't need to process any of this if they aren't standing anyways
// unless their stance is damaged, and we want to check if they should stay down
- if (!stance_damage && (lying || resting) && (life_tick % 4) == 0)
+ if(!stance_damage && (lying || resting) && (life_tick % 4) == 0)
return
stance_damage = 0
// Buckled to a bed/chair. Stance damage is forced to 0 since they're sitting on something solid
- if (istype(buckled, /obj/structure/stool/bed))
+ if(istype(buckled, /obj/structure/stool/bed))
return
for(var/limb_tag in list("l_leg","r_leg","l_foot","r_foot"))
var/obj/item/organ/external/E = organs_by_name[limb_tag]
if(!E || (E.status & (ORGAN_DESTROYED|ORGAN_DEAD)) || E.is_malfunctioning())
stance_damage += 2 // let it fail even if just foot&leg. Also malfunctioning happens sporadically so it should impact more when it procs
- else if (E.is_broken() || !E.is_usable())
+ else if(E.is_broken() || !E.is_usable())
stance_damage += 1
// Canes and crutches help you stand (if the latter is ever added)
// One cane mitigates a broken leg+foot, or a missing foot.
// Two canes are needed for a lost leg. If you are missing both legs, canes aren't gonna help you.
- if (l_hand && istype(l_hand, /obj/item/weapon/cane))
+ if(l_hand && istype(l_hand, /obj/item/weapon/cane))
stance_damage -= 2
- if (r_hand && istype(r_hand, /obj/item/weapon/cane))
+ if(r_hand && istype(r_hand, /obj/item/weapon/cane))
stance_damage -= 2
if(stance_damage < 0)
@@ -100,7 +100,7 @@
if(!l_hand && !r_hand)
return
- for (var/obj/item/organ/external/E in organs)
+ for(var/obj/item/organ/external/E in organs)
if(!E || !E.can_grasp || (E.status & ORGAN_SPLINTED))
continue
@@ -163,7 +163,7 @@ I use this to standardize shadowling dethrall code
-- Crazylemon
*/
/mob/living/carbon/human/proc/named_organ_parent(var/organ_name)
- if (!get_int_organ(organ_name))
+ if(!get_int_organ(organ_name))
return null
var/obj/item/organ/internal/O = get_int_organ(organ_name)
return O.parent_organ
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/human/interactive/functions.dm b/code/modules/mob/living/carbon/human/interactive/functions.dm
index 0a220accc98..199530c4805 100644
--- a/code/modules/mob/living/carbon/human/interactive/functions.dm
+++ b/code/modules/mob/living/carbon/human/interactive/functions.dm
@@ -433,7 +433,7 @@
return 1
/mob/living/carbon/human/interactive/proc/souschef(obj)
- if(shouldModulePass() || enforceHome() || prob(SNPC_FUZZY_CHANCE_LOW))
+ if(shouldModulePass() || enforceHome() || prob(SNPC_FUZZY_CHANCE_HIGH) || prob(SNPC_FUZZY_CHANCE_HIGH))
return
if(doing & SNPC_SPECIAL)
@@ -442,7 +442,7 @@
var/static/list/customableTypes = list(/obj/item/weapon/reagent_containers/food/snacks/customizable,/obj/item/weapon/reagent_containers/food/snacks/breadslice,/obj/item/weapon/reagent_containers/food/snacks/bun,/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,/obj/item/weapon/reagent_containers/food/snacks/boiledspagetti,/obj/item/trash/plate,/obj/item/trash/bowl)
- var/static/list/rawtypes = list(/obj/item/weapon/reagent_containers/food/snacks/grown, /obj/item/weapon/reagent_containers/food/snacks/rawcutlet, /obj/item/weapon/reagent_containers/food/snacks/rawmeatball, /obj/item/weapon/reagent_containers/food/snacks/rawsticks, /obj/item/weapon/reagent_containers/food/snacks/salmonmeat, /obj/item/weapon/reagent_containers/food/snacks/carpmeat, /obj/item/weapon/reagent_containers/food/snacks/catfishmeat, /obj/item/weapon/reagent_containers/food/snacks/spagetti, /obj/item/weapon/reagent_containers/food/snacks/dough_ball, /obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough, /obj/item/weapon/reagent_containers/food/snacks/doughslice, /obj/item/weapon/reagent_containers/food/snacks/meat, /obj/item/weapon/reagent_containers/food/snacks/boiledrice, /obj/item/weapon/reagent_containers/food/snacks/cheesewedge)
+ var/static/list/rawtypes = list(/obj/item/weapon/reagent_containers/food/snacks/grown, /obj/item/weapon/reagent_containers/food/snacks/rawcutlet, /obj/item/weapon/reagent_containers/food/snacks/rawmeatball, /obj/item/weapon/reagent_containers/food/snacks/rawsticks, /obj/item/weapon/reagent_containers/food/snacks/salmonmeat, /obj/item/weapon/reagent_containers/food/snacks/carpmeat, /obj/item/weapon/reagent_containers/food/snacks/catfishmeat, /obj/item/weapon/reagent_containers/food/snacks/spagetti, /obj/item/weapon/reagent_containers/food/snacks/dough_ball, /obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough, /obj/item/weapon/reagent_containers/food/snacks/doughslice, /obj/item/weapon/reagent_containers/food/snacks/meat, /obj/item/weapon/reagent_containers/food/snacks/boiledrice, /obj/item/weapon/reagent_containers/food/snacks/cheesewedge, /obj/item/weapon/reagent_containers/food/snacks/raw_bacon)
try
var/list/allContents = getAllContents()
@@ -460,7 +460,7 @@
var/global/list/available_recipes
if(!available_recipes)
available_recipes = list()
- for (var/type in subtypesof(/datum/recipe))
+ for(var/type in subtypesof(/datum/recipe))
var/datum/recipe/recipe = new type
if(recipe.result) // Ignore recipe subtypes that lack a result
available_recipes += recipe
@@ -518,6 +518,7 @@
var/obj/item/weapon/reagent_containers/food/snacks/sliceable/cheesewheel/CW = locate() in rangeCheck
var/obj/item/weapon/reagent_containers/food/snacks/grown/potato/PO = locate() in rangeCheck
var/obj/item/weapon/reagent_containers/food/snacks/meat/ME = locate() in rangeCheck
+ var/obj/item/weapon/reagent_containers/food/snacks/raw_bacon/RB = locate() in rangeCheck
if(D)
TARGET = D
@@ -561,6 +562,13 @@
sleep(get_dist(src, ME))
ME.attackby(KK, src)
foundCookable = 1
+ else if(RB)
+ TARGET = RB
+ if(prob(50))
+ tryWalk(get_turf(RB))
+ sleep(get_dist(src, RB))
+ RB.attackby(KK, src)
+ foundCookable = 1
// refresh
allContents = getAllContents()
@@ -640,7 +648,7 @@
newSnack.name = "Synthetic [newSnack.name]"
custom_emote(2, "[pick("gibbers","drools","slobbers","claps wildly","spits")] as they vomit [newSnack] from their mouth!")
catch(var/exception/e)
- log_to_dd("Cooking error: [e] in [e.file]:[e.line]")
+ log_runtime(e, src, "Caught in SNPC cooking module")
doing &= ~SNPC_SPECIAL
// END COOKING MODULE
@@ -693,7 +701,7 @@
best = R
if(istype(R, /obj/item/weapon/gun))
var/obj/item/weapon/gun/G = R
- if(G.can_fire())
+ if(G.can_shoot())
best = R
break // gun with ammo? screw the rest
if(best && best != main_hand)
@@ -727,22 +735,23 @@
if(main_hand.force != 0)
if(istype(main_hand,/obj/item/weapon/gun))
var/obj/item/weapon/gun/G = main_hand
- if(G.special_check(src))
+ if(G.can_trigger_gun(src))
var/shouldFire = 1
if(istype(main_hand, /obj/item/weapon/gun/energy))
var/obj/item/weapon/gun/energy/P = main_hand
var/stunning = 0
- if(ispath(text2path(P.projectile_type), /obj/item/projectile/energy/electrode))
- stunning = 1
+ for(var/A in P.ammo_type)
+ if(ispath(A,/obj/item/ammo_casing/energy/electrode))
+ stunning = 1
var/mob/stunCheck = TARGET
if(stunning && stunCheck.stunned)
shouldFire = 0
if(shouldFire)
- if(!G.process_chambered())
- G.click_empty(src)
+ if(!G.can_shoot())
+ G.shoot_with_empty_chamber(src)
npcDrop(G, 1)
else
- G.Fire(TARGET, src)
+ G.process_fire(TARGET, src)
else
if(get_dist(src,TARGET) > 6)
if(!walk2derpless(TARGET))
@@ -775,6 +784,12 @@
else
return "[word]ed"
+/mob/living/carbon/human/interactive/proc/ing_verb(word)
+ if(copytext(word, length(word)) == "e")
+ return "[copytext(word, 1, length(word))]ing"
+ else
+ return "[word]ing"
+
/mob/living/carbon/human/interactive/proc/paperwork_sentence()
var/verbs_use = pick_list(speak_file, "verbs_use")
var/verbs_touch = pick_list(speak_file, "verbs_touch")
@@ -871,4 +886,4 @@
else
A.stamp(S)
custom_emote(2, "[pick("gibbers","drools","slobbers","claps wildly","spits")] as they stamp \the [A] with \a [S]!")
- return
\ No newline at end of file
+ return
diff --git a/code/modules/mob/living/carbon/human/interactive/interactive.dm b/code/modules/mob/living/carbon/human/interactive/interactive.dm
index 14402788451..d3f8a66e7a0 100644
--- a/code/modules/mob/living/carbon/human/interactive/interactive.dm
+++ b/code/modules/mob/living/carbon/human/interactive/interactive.dm
@@ -258,12 +258,15 @@
RPID.access = myjob.get_access()
equip_to_slot_or_del(MYID, slot_wear_id)
- MYPDA = new(src)
+ if(wear_pda)
+ MYPDA = wear_pda
+ else
+ MYPDA = new(src)
+ equip_to_slot_or_del(MYPDA, slot_wear_pda)
MYPDA.owner = real_name
MYPDA.ownjob = alt_title
MYPDA.ownrank = job
MYPDA.name = "PDA-[real_name] ([alt_title])"
- equip_to_slot_or_del(MYPDA, slot_belt)
zone_sel.selecting = "chest"
//arms
if(prob((SNPC_FUZZY_CHANCE_LOW+SNPC_FUZZY_CHANCE_HIGH)/4))
@@ -317,7 +320,7 @@
if("Captain", "Head of Personnel")
favoured_types = list(/obj/item/clothing, /obj/item/weapon/stamp/captain,/obj/item/weapon/disk/nuclear)
if("Nanotrasen Representative")
- favoured_types = list(/obj/item/clothing, /obj/item/weapon/stamp/centcom, /obj/item/weapon/paper, /obj/item/weapon/melee/baton/loaded/ntcane)
+ favoured_types = list(/obj/item/clothing, /obj/item/weapon/stamp/centcom, /obj/item/weapon/paper, /obj/item/weapon/melee/classic_baton/ntcane)
functions += "paperwork"
if("Magistrate", "Internal Affairs Agent")
favoured_types = list(/obj/item/clothing, /obj/item/weapon/stamp/law, /obj/item/weapon/paper)
@@ -836,7 +839,7 @@
return 0
if(myPath.len <= 0)
- myPath = get_path_to(src, get_turf(target), /turf/proc/Distance, SNPC_MAX_RANGE_FIND + 1, 250,1, id=Path_ID)
+ myPath = get_path_to(src, get_turf(target), /turf/proc/Distance, SNPC_MAX_RANGE_FIND + 1, 250,1, id=Path_ID, simulated_only = 0)
if(myPath)
if(myPath.len > 0)
@@ -951,4 +954,4 @@
if(RPID)
RPID.registered_name = MYID.registered_name
RPID.name = MYID.name
- return 1
\ No newline at end of file
+ return 1
diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm
index f9d9ae27442..0264e874d17 100644
--- a/code/modules/mob/living/carbon/human/inventory.dm
+++ b/code/modules/mob/living/carbon/human/inventory.dm
@@ -39,10 +39,10 @@
/mob/living/carbon/human/proc/equip_in_one_of_slots(obj/item/W, list/slots, del_on_fail = 1)
- for (var/slot in slots)
- if (equip_to_slot_if_possible(W, slots[slot], del_on_fail = 0))
+ for(var/slot in slots)
+ if(equip_to_slot_if_possible(W, slots[slot], del_on_fail = 0))
return slot
- if (del_on_fail)
+ if(del_on_fail)
qdel(W)
return null
@@ -107,15 +107,19 @@
if(slot_tie)
return 1
+// The actual dropping happens at the mob level - checks to prevent drops should
+// come here
+/mob/living/carbon/human/canUnEquip(obj/item/I, force)
+ . = ..()
+ var/obj/item/organ/O = I
+ if(istype(O) && O.owner == src)
+ . = 0 // keep a good grip on your heart
+
/mob/living/carbon/human/unEquip(obj/item/I)
. = ..() //See mob.dm for an explanation on this and some rage about people copypasting instead of calling ..() like they should.
if(!. || !I)
return
- var/obj/item/organ/internal/O = I //Organs shouldn't be removed unless you call droplimb.
- if(istype(O) && O.owner == src)
- return
-
if(I == wear_suit)
if(s_store)
unEquip(s_store, 1) //It makes no sense for your suit storage to stay on you if you drop your suit.
@@ -150,7 +154,7 @@
else if(I == r_ear)
r_ear = null
update_inv_ears()
- else if (I == l_ear)
+ else if(I == l_ear)
l_ear = null
update_inv_ears()
else if(I == shoes)
@@ -166,9 +170,8 @@
update_fhair()
update_head_accessory()
if(internal)
- if(internals)
- internals.icon_state = "internal0"
internal = null
+ update_internals_hud_icon(0)
sec_hud_set_ID()
update_inv_wear_mask()
else if(I == wear_id)
@@ -218,6 +221,7 @@
W.loc = src
W.equipped(src, slot)
W.layer = 20
+ W.plane = HUD_PLANE
switch(slot)
if(slot_back)
@@ -260,6 +264,7 @@
O.loc = src
r_ear = O
O.layer = 20
+ O.plane = HUD_PLANE
update_inv_ears(redraw_mob)
if(slot_r_ear)
r_ear = W
@@ -268,6 +273,7 @@
O.loc = src
l_ear = O
O.layer = 20
+ O.plane = HUD_PLANE
update_inv_ears(redraw_mob)
if(slot_glasses)
glasses = W
@@ -420,7 +426,7 @@
if(istype(I, /obj/item/clothing/under) || istype(I, /obj/item/clothing/suit))
if(FAT in mutations)
//testing("[M] TOO FAT TO WEAR [src]!")
- if(!(I.flags & ONESIZEFITSALL))
+ if(!(I.flags_size & ONESIZEFITSALL))
if(!disable_warning)
to_chat(src, "You're too fat to wear the [I].")
return 0
diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm
index 14585c8d972..1800adb31a8 100644
--- a/code/modules/mob/living/carbon/human/life.dm
+++ b/code/modules/mob/living/carbon/human/life.dm
@@ -39,6 +39,7 @@
handle_pain()
handle_heartbeat()
handle_heartattack()
+ handle_drunk()
species.handle_life(src)
if(!client)
@@ -77,8 +78,8 @@
/mob/living/carbon/human/handle_disabilities()
- if (disabilities & EPILEPSY)
- if ((prob(1) && paralysis < 1))
+ if(disabilities & EPILEPSY)
+ if((prob(1) && paralysis < 1))
visible_message("[src] starts having a seizure!","You have a seizure!")
Paralyse(10)
Jitter(1000)
@@ -88,13 +89,13 @@
if(prob(1) && hallucination < 1)
hallucination += 20
- if (disabilities & COUGHING)
- if ((prob(5) && paralysis <= 1))
+ if(disabilities & COUGHING)
+ if((prob(5) && paralysis <= 1))
drop_item()
emote("cough")
- if (disabilities & TOURETTES)
+ if(disabilities & TOURETTES)
speech_problem_flag = 1
- if ((prob(10) && paralysis <= 1))
+ if((prob(10) && paralysis <= 1))
Stun(10)
switch(rand(1, 3))
if(1)
@@ -107,12 +108,12 @@
animate(src, pixel_x = pixel_x + x_offset, pixel_y = pixel_y + y_offset, time = 1)
animate(pixel_x = initial(pixel_x) , pixel_y = initial(pixel_y), time = 1)
- if (disabilities & NERVOUS)
+ if(disabilities & NERVOUS)
speech_problem_flag = 1
- if (prob(10))
+ if(prob(10))
stuttering = max(10, stuttering)
- if (getBrainLoss() >= 60 && stat != 2)
+ if(getBrainLoss() >= 60 && stat != 2)
speech_problem_flag = 1
if(prob(3))
var/list/s1 = list("IM A PONY NEEEEEEIIIIIIIIIGH",
@@ -173,13 +174,28 @@
if(!gene.block)
continue
if(gene.is_active(src))
- /* if (prob(10) && prob(gene.instability))
- adjustCloneLoss(1) */
speech_problem_flag = 1
gene.OnMobLife(src)
+ if(gene_stability < 85)
+ var/instability = DEFAULT_GENE_STABILITY - gene_stability
+ if(prob(instability / 10))
+ adjustFireLoss(min(6, instability / 12))
+ to_chat(src, "You feel like your skin is burning and bubbling off!")
+ if(gene_stability < 70)
+ if(prob(instability / 12))
+ adjustCloneLoss(min(5, instability / 15))
+ to_chat(src, "You feel as if your body is warping.")
+ if(prob(instability / 10))
+ adjustToxLoss(min(6, instability / 12))
+ to_chat(src, "You feel weak and nauseous.")
+ if(gene_stability < 40 && prob(1))
+ to_chat(src, "You feel incredibly sick... Something isn't right!")
+ spawn(300)
+ if(gene_stability < 40)
+ gib()
if(!(species.flags & RADIMMUNE))
- if (radiation)
+ if(radiation)
if(get_int_organ(/obj/item/organ/internal/nucleation/resonant_crystal))
var/rads = radiation/25
@@ -190,14 +206,14 @@
to_chat(src, "You feel relaxed.")
return
- if (radiation > 100)
+ if(radiation > 100)
radiation = 100
Weaken(10)
if(!lying)
to_chat(src, "You feel weak.")
emote("collapse")
- if (radiation < 0)
+ if(radiation < 0)
radiation = 0
else
@@ -312,7 +328,6 @@
/mob/living/carbon/human/get_breath_from_internal(volume_needed) //making this call the parent would be far too complicated
-
if(internal)
var/null_internals = 0 //internals are invalid, therefore turn them off
var/skip_contents_check = 0 //rigsuit snowflake, oxygen tanks aren't stored inside the mob, so the 'contents.Find' check has to be skipped.
@@ -337,12 +352,10 @@
if(internal) //check for hud updates every time this is called
- if(internals)
- internals.icon_state = "internal1"
+ update_internals_hud_icon(1)
return internal.remove_air_volume(volume_needed) //returns the valid air
else
- if(internals)
- internals.icon_state = "internal0"
+ update_internals_hud_icon(0)
return null
@@ -474,6 +487,17 @@
return
if(RESIST_HEAT in mutations)
return
+ if(on_fire)
+ var/thermal_protection = get_thermal_protection()
+
+ if(thermal_protection >= FIRE_IMMUNITY_SUIT_MAX_TEMP_PROTECT)
+ return
+ if(thermal_protection >= FIRE_SUIT_MAX_TEMP_PROTECT)
+ bodytemperature += 11
+ else
+ bodytemperature += (BODYTEMP_HEATING_MAX + (fire_stacks * 12))
+
+/mob/living/carbon/human/proc/get_thermal_protection()
var/thermal_protection = 0 //Simple check to estimate how protected we are against multiple temperatures
if(wear_suit)
if(wear_suit.max_heat_protection_temperature >= FIRE_SUIT_MAX_TEMP_PROTECT)
@@ -482,34 +506,9 @@
if(head.max_heat_protection_temperature >= FIRE_HELM_MAX_TEMP_PROTECT)
thermal_protection += (head.max_heat_protection_temperature*THERMAL_PROTECTION_HEAD)
thermal_protection = round(thermal_protection)
- if(thermal_protection >= FIRE_IMMUNITY_SUIT_MAX_TEMP_PROTECT)
- return
- if(thermal_protection >= FIRE_SUIT_MAX_TEMP_PROTECT)
- bodytemperature += 11
- return
- else
- bodytemperature += BODYTEMP_HEATING_MAX
- return
-//END FIRE CODE
+ return thermal_protection
- /*
-/mob/living/carbon/human/proc/adjust_body_temperature(current, loc_temp, boost)
- var/temperature = current
- var/difference = abs(current-loc_temp) //get difference
- var/increments// = difference/10 //find how many increments apart they are
- if(difference > 50)
- increments = difference/5
- else
- increments = difference/10
- var/change = increments*boost // Get the amount to change by (x per increment)
- var/temp_change
- if(current < loc_temp)
- temperature = min(loc_temp, temperature+change)
- else if(current > loc_temp)
- temperature = max(loc_temp, temperature-change)
- temp_change = (temperature - current)
- return temp_change
- */
+//END FIRE CODE
/mob/living/carbon/human/proc/stabilize_temperature_from_calories()
if(bodytemperature <= species.cold_level_1) //260.15 is 310.15 - 50, the temperature where you start to feel effects.
@@ -692,10 +691,10 @@
update_inv_wear_suit()
// nutrition decrease
- if (nutrition > 0 && stat != 2)
+ if(nutrition > 0 && stat != 2)
nutrition = max (0, nutrition - HUNGER_FACTOR)
- if (nutrition > 450)
+ if(nutrition > 450)
if(overeatduration < 800) //capped so people don't take forever to unfat
overeatduration++
@@ -706,10 +705,10 @@
else
overeatduration -= 2
- if (drowsyness)
+ if(drowsyness)
drowsyness--
eye_blurry = max(2, eye_blurry)
- if (prob(5))
+ if(prob(5))
sleeping += 1
Paralyse(5)
@@ -730,6 +729,80 @@
return //TODO: DEFERRED
+/mob/living/carbon/human/handle_drunk()
+ var/slur_start = 30 //12u ethanol, 30u whiskey FOR HUMANS
+ var/confused_start = 40
+ var/brawl_start = 30
+ var/blur_start = 75
+ var/vomit_start = 60
+ var/pass_out = 90
+ var/spark_start = 50 //40u synthanol
+ var/collapse_start = 75
+ var/braindamage_start = 120
+ var/alcohol_strength = drunk
+ var/sober_str=!(SOBER in mutations)?1:2
+
+ if(drunk)
+ alcohol_strength/=sober_str
+
+ var/obj/item/organ/internal/liver/L
+ if(!isSynthetic())
+ L = get_int_organ(/obj/item/organ/internal/liver)
+ if(L)
+ alcohol_strength *= L.alcohol_intensity
+ else
+ alcohol_strength *= 5
+
+ if(alcohol_strength >= slur_start) //slurring
+ if(!slurring) slurring = 1
+ slurring = drunk
+ if(alcohol_strength >= brawl_start) //the drunken martial art
+ if(!istype(martial_art, /datum/martial_art/drunk_brawling))
+ var/datum/martial_art/drunk_brawling/F = new
+ F.teach(src,1)
+ if(alcohol_strength < brawl_start) //removing the art
+ if(istype(martial_art, /datum/martial_art/drunk_brawling))
+ martial_art.remove(src)
+ if(alcohol_strength >= confused_start && prob(33)) //confused walking
+ if(!confused) confused = 1
+ confused = max(confused+(3/sober_str),0)
+ if(alcohol_strength >= blur_start) //blurry eyes
+ eye_blurry = max(eye_blurry, 10/sober_str)
+ drowsyness = max(drowsyness, 0)
+ if(!isSynthetic()) //stuff only for non-synthetics
+ if(alcohol_strength >= vomit_start) //vomiting
+ if(prob(8))
+ fakevomit()
+ if(alcohol_strength >= pass_out)
+ Paralyse(5 / sober_str)
+ drowsyness = max(drowsyness, 30/sober_str)
+ if(L)
+ L.take_damage(0.1, 1)
+ adjustToxLoss(0.1)
+ else //stuff only for synthetics
+ if(alcohol_strength >= spark_start && prob(25))
+ var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread
+ s.set_up(3, 1, src)
+ s.start()
+ if(alcohol_strength >= collapse_start && prob(10))
+ emote("collapse")
+ var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread
+ s.set_up(3, 1, src)
+ s.start()
+ if(alcohol_strength >= braindamage_start && prob(10))
+ adjustBrainLoss(1)
+
+ if(!has_booze())
+ AdjustDrunk(-0.5)
+ return
+
+/mob/living/carbon/human/proc/has_booze() //checks if the human has ethanol or its subtypes inside
+ for(var/A in reagents.reagent_list)
+ var/datum/reagent/R = A
+ if(istype(R, /datum/reagent/ethanol))
+ return 1
+ return 0
+
/mob/living/carbon/human/handle_regular_status_updates()
if(status_flags & GODMODE)
return 0
@@ -744,9 +817,6 @@
handle_organs()
handle_blood()
- //the analgesic effect wears off slowly
- analgesic = max(0, analgesic - 1)
-
if(paralysis)
blinded = 1
stat = UNCONSCIOUS
@@ -792,7 +862,7 @@
else
//blindness
- if(sdisabilities & BLIND) // Disabled-blind, doesn't get better on its own
+ if(disabilities & BLIND) // Disabled-blind, doesn't get better on its own
blinded = 1
else if(eye_blind) // Blindness, heals slowly over time
@@ -812,26 +882,22 @@
//Ears
- if(sdisabilities & DEAF) //disabled-deaf, doesn't get better on its own
- ear_deaf = max(ear_deaf, 1)
+ if(disabilities & DEAF) //disabled-deaf, doesn't get better on its own
+ setEarDamage(-1, max(ear_deaf, 1))
else if(ear_deaf) //deafness, heals slowly over time
- ear_deaf = max(ear_deaf - 1, 0)
+ adjustEarDamage(0,-1)
else if(istype(l_ear, /obj/item/clothing/ears/earmuffs) || istype(r_ear, /obj/item/clothing/ears/earmuffs)) //resting your ears with earmuffs heals ear damage faster
- ear_damage = max(ear_damage - 0.15, 0)
- ear_deaf = max(ear_deaf, 1)
+ adjustEarDamage(-0.15,0)
+ setEarDamage(-1, max(ear_deaf, 1))
else if(ear_damage < 25) //ear damage heals slowly under this threshold. otherwise you'll need earmuffs
- ear_damage = max(ear_damage - 0.05, 0)
-
+ adjustEarDamage(-0.05,0)
if(flying)
- spawn()
- animate(src, pixel_y = pixel_y + 5 , time = 10, loop = 1, easing = SINE_EASING)
- spawn(10)
- if(flying)
- animate(src, pixel_y = pixel_y - 5, time = 10, loop = 1, easing = SINE_EASING)
+ animate(src, pixel_y = pixel_y + 5 , time = 10, loop = 1, easing = SINE_EASING)
+ animate(pixel_y = pixel_y - 5, time = 10, loop = 1, easing = SINE_EASING)
// If you're dirty, your gloves will become dirty, too.
if(gloves && germ_level > gloves.germ_level && prob(10))
@@ -880,7 +946,7 @@
/mob/living/carbon/human/handle_random_events()
// Puke if toxloss is too high
if(!stat)
- if (getToxLoss() >= 45 && nutrition > 20)
+ if(getToxLoss() >= 45 && nutrition > 20)
lastpuke ++
if(lastpuke >= 25) // about 25 second delay I guess
Stun(5)
@@ -890,7 +956,7 @@
playsound(loc, 'sound/effects/splat.ogg', 50, 1)
var/turf/location = loc
- if (istype(location, /turf/simulated))
+ if(istype(location, /turf/simulated))
location.add_vomit_floor(src, 1)
nutrition -= 20
@@ -919,8 +985,10 @@
/mob/living/carbon/human/handle_shock()
..()
- if(status_flags & GODMODE) return 0 //godmode
- if(analgesic || (species && species.flags & NO_PAIN)) return // analgesic avoids all traumatic shock temporarily
+ if(status_flags & GODMODE)
+ return 0 //godmode
+ if(species && species.flags & NO_PAIN)
+ return
if(health <= config.health_threshold_softcrit)// health 0 makes you immediately collapse
shock_stage = max(shock_stage, 61)
@@ -945,17 +1013,17 @@
if(shock_stage >=60)
if(shock_stage == 60) custom_emote(1,"falls limp.")
- if (prob(2))
+ if(prob(2))
to_chat(src, ""+pick("The pain is excrutiating!", "Please, just end the pain!", "Your whole body is going numb!"))
Weaken(20)
if(shock_stage >= 80)
- if (prob(5))
+ if(prob(5))
to_chat(src, ""+pick("The pain is excrutiating!", "Please, just end the pain!", "Your whole body is going numb!"))
Weaken(20)
if(shock_stage >= 120)
- if (prob(2))
+ if(prob(2))
to_chat(src, ""+pick("You black out!", "You feel like you could die any moment now.", "You're about to lose consciousness."))
Paralyse(5)
@@ -969,9 +1037,11 @@
/mob/living/carbon/human/proc/handle_pulse()
- if(mob_master.current_cycle % 5) return pulse //update pulse every 5 life ticks (~1 tick/sec, depending on server load)
+ if(mob_master.current_cycle % 5)
+ return pulse //update pulse every 5 life ticks (~1 tick/sec, depending on server load)
- if(species && species.flags & NO_BLOOD) return PULSE_NONE //No blood, no pulse.
+ if(species && species.flags & NO_BLOOD)
+ return PULSE_NONE //No blood, no pulse.
if(stat == DEAD)
return PULSE_NONE //that's it, you're dead, nothing can influence your pulse
@@ -981,32 +1051,29 @@
var/temp = PULSE_NORM
- if(round(vessel.get_reagent_amount("blood")) <= BLOOD_VOLUME_BAD) //how much blood do we have
+ var/blood_type = get_blood_name()
+ if(round(vessel.get_reagent_amount(blood_type)) <= BLOOD_VOLUME_BAD) //how much blood do we have
temp = PULSE_THREADY //not enough :(
if(status_flags & FAKEDEATH)
temp = PULSE_NONE //pretend that we're dead. unlike actual death, can be inflienced by meds
for(var/datum/reagent/R in reagents.reagent_list)
- if(R.id in bradycardics)
+ if(R.heart_rate_decrease)
if(temp <= PULSE_THREADY && temp >= PULSE_NORM)
temp--
- break //one reagent is enough
- //comment out the breaks to make med effects stack
- for(var/datum/reagent/R in reagents.reagent_list) //handles different chems' influence on pulse
- if(R.id in tachycardics)
+ break
+
+ for(var/datum/reagent/R in reagents.reagent_list)//handles different chems' influence on pulse
+ if(R.heart_rate_increase)
if(temp <= PULSE_FAST && temp >= PULSE_NONE)
temp++
break
+
for(var/datum/reagent/R in reagents.reagent_list) //To avoid using fakedeath
- if(R.id in heartstopper)
+ if(R.heart_rate_stop)
temp = PULSE_NONE
break
- for(var/datum/reagent/R in reagents.reagent_list) //Conditional heart-stoppage
- if(R.id in cheartstopper)
- if(R.volume >= R.overdose_threshold)
- temp = PULSE_NONE
- break
return temp
@@ -1066,7 +1133,7 @@
if(heartbeat >= rate)
heartbeat = 0
- to_chat(src, sound('sound/effects/electheart.ogg',0,0,0,30))//Credit to GhostHack (www.ghosthack.de) for sound.
+ src << sound('sound/effects/electheart.ogg',0,0,0,30)//Credit to GhostHack (www.ghosthack.de) for sound.
else
heartbeat++
@@ -1085,9 +1152,9 @@
if(heartbeat >= rate)
heartbeat = 0
if(H.status & ORGAN_ASSISTED)
- to_chat(src, sound('sound/effects/pacemakebeat.ogg',0,0,0,50))
+ src << sound('sound/effects/pacemakebeat.ogg',0,0,0,50)
else
- to_chat(src, sound('sound/effects/singlebeat.ogg',0,0,0,50))
+ src << sound('sound/effects/singlebeat.ogg',0,0,0,50)
else
heartbeat++
diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm
index 840b500de01..72e6ff63314 100644
--- a/code/modules/mob/living/carbon/human/say.dm
+++ b/code/modules/mob/living/carbon/human/say.dm
@@ -38,8 +38,7 @@
say(temp)
winset(client, "input", "text=[null]")
-/mob/living/carbon/human/say_understands(var/mob/other,var/datum/language/speaking = null)
-
+/mob/living/carbon/human/say_understands(var/mob/other, var/datum/language/speaking = null)
if(has_brain_worms()) //Brain worms translate everything. Even mice and alien speak.
return 1
@@ -47,25 +46,19 @@
return 1
//These only pertain to common. Languages are handled by mob/say_understands()
- if (!speaking)
- if (istype(other, /mob/living/simple_animal/diona))
+ if(!speaking)
+ if(istype(other, /mob/living/simple_animal/diona))
if(other.languages.len >= 2) //They've sucked down some blood and can speak common now.
return 1
- if (istype(other, /mob/living/silicon))
+ if(issilicon(other))
return 1
- if (istype(other, /mob/living/simple_animal/bot))
+ if(isbot(other))
return 1
- if (istype(other, /mob/living/carbon/brain))
+ if(isbrain(other))
return 1
- if (istype(other, /mob/living/carbon/slime))
+ if(isslime(other))
return 1
- //This is already covered by mob/say_understands()
- //if (istype(other, /mob/living/simple_animal))
- // if((other.universal_speak && !speaking) || src.universal_speak || src.universal_understand)
- // return 1
- // return 0
-
return ..()
/mob/living/carbon/human/proc/HasVoiceChanger()
@@ -113,7 +106,7 @@
var/list/returns[3]
var/speech_problem_flag = 0
- if(silent || (sdisabilities & MUTE))
+ if(silent || (disabilities & MUTE))
message = ""
speech_problem_flag = 1
@@ -148,7 +141,7 @@
if(prob(braindam))
message = uppertext(message)
verb = "yells loudly"
-
+
if(locate(/obj/item/organ/internal/cyberimp/brain/clown_voice) in internal_organs)
message = "[message]"
@@ -166,57 +159,70 @@
used_radios += I
if("headset")
- if(l_ear && istype(l_ear,/obj/item/device/radio))
- var/obj/item/device/radio/R = l_ear
- R.talk_into(src,message,null,verb,speaking)
- used_radios += l_ear
- else if(r_ear && istype(r_ear,/obj/item/device/radio))
- var/obj/item/device/radio/R = r_ear
- R.talk_into(src,message,null,verb,speaking)
- used_radios += r_ear
+ var/obj/item/device/radio/R = null
+ if(isradio(l_ear))
+ R = l_ear
+ used_radios += R
+ if(R.talk_into(src, message, null, verb, speaking))
+ return
+
+ if(isradio(r_ear))
+ R = r_ear
+ used_radios += R
+ if(R.talk_into(src, message, null, verb, speaking))
+ return
if("right ear")
var/obj/item/device/radio/R
- var/has_radio = 0
- if(r_ear && istype(r_ear,/obj/item/device/radio))
+ if(isradio(r_ear))
R = r_ear
- has_radio = 1
- if(r_hand && istype(r_hand, /obj/item/device/radio))
+ else if(isradio(r_hand))
R = r_hand
- has_radio = 1
- if(has_radio)
- R.talk_into(src,message,null,verb,speaking)
+ if(R)
used_radios += R
-
+ R.talk_into(src, message, null, verb, speaking)
if("left ear")
var/obj/item/device/radio/R
- var/has_radio = 0
- if(l_ear && istype(l_ear,/obj/item/device/radio))
+ if(isradio(l_ear))
R = l_ear
- has_radio = 1
- if(l_hand && istype(l_hand,/obj/item/device/radio))
+ else if(isradio(l_hand))
R = l_hand
- has_radio = 1
- if(has_radio)
- R.talk_into(src,message,null,verb,speaking)
+ if(R)
used_radios += R
+ R.talk_into(src, message, null, verb, speaking)
if("whisper")
whisper_say(message, speaking, alt_name)
return 1
else
if(message_mode)
- if(l_ear && istype(l_ear,/obj/item/device/radio))
- l_ear.talk_into(src,message, message_mode, verb, speaking)
+ if(isradio(l_ear))
used_radios += l_ear
- else if(r_ear && istype(r_ear,/obj/item/device/radio))
- r_ear.talk_into(src,message, message_mode, verb, speaking)
+ if(l_ear.talk_into(src, message, message_mode, verb, speaking))
+ return
+
+ if(isradio(r_ear))
used_radios += r_ear
+ if(r_ear.talk_into(src, message, message_mode, verb, speaking))
+ return
/mob/living/carbon/human/handle_speech_sound()
var/list/returns[2]
if(species.speech_sounds && prob(species.speech_chance))
returns[1] = sound(pick(species.speech_sounds))
returns[2] = 50
- return returns
\ No newline at end of file
+ return returns
+
+/mob/living/carbon/human/binarycheck()
+ . = FALSE
+ var/obj/item/device/radio/headset/R
+ if(istype(l_ear, /obj/item/device/radio/headset))
+ R = l_ear
+ if(R.translate_binary)
+ . = TRUE
+
+ if(istype(r_ear, /obj/item/device/radio/headset))
+ R = r_ear
+ if(R.translate_binary)
+ . = TRUE
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/human/species/golem.dm b/code/modules/mob/living/carbon/human/species/golem.dm
index 922810e758d..d5a0125f052 100644
--- a/code/modules/mob/living/carbon/human/species/golem.dm
+++ b/code/modules/mob/living/carbon/human/species/golem.dm
@@ -66,7 +66,7 @@
item_color = "golem"
has_sensor = 0
flags = ABSTRACT | NODROP
- armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
+ armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
/obj/item/clothing/suit/golem
name = "adamantine shell"
@@ -75,7 +75,8 @@
item_state = "golem"
body_parts_covered = HEAD|UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS
flags_inv = HIDEGLOVES|HIDESHOES
- flags = ONESIZEFITSALL | ABSTRACT | NODROP | THICKMATERIAL
+ flags = ABSTRACT | NODROP | THICKMATERIAL
+ flags_size = ONESIZEFITSALL
armor = list(melee = 55, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
/obj/item/clothing/shoes/golem
diff --git a/code/modules/mob/living/carbon/human/species/plasmaman.dm b/code/modules/mob/living/carbon/human/species/plasmaman.dm
index 26ee19b0788..bae949dd9af 100644
--- a/code/modules/mob/living/carbon/human/species/plasmaman.dm
+++ b/code/modules/mob/living/carbon/human/species/plasmaman.dm
@@ -66,7 +66,7 @@
if("Warden","Security Officer","Security Pod Pilot")
suit=/obj/item/clothing/suit/space/eva/plasmaman/security/
helm=/obj/item/clothing/head/helmet/space/eva/plasmaman/security/
- H.equip_or_collect(new /obj/item/weapon/gun/energy/advtaser(H), slot_in_backpack)
+ H.equip_or_collect(new /obj/item/weapon/gun/energy/gun/advtaser(H), slot_in_backpack)
if("Magistrate")
suit=/obj/item/clothing/suit/space/eva/plasmaman/magistrate
helm=/obj/item/clothing/head/helmet/space/eva/plasmaman/magistrate
@@ -125,8 +125,7 @@
H.equip_or_collect(new/obj/item/weapon/tank/plasma/plasmaman(H), tank_slot) // Bigger plasma tank from Raggy.
to_chat(H, "You are now running on plasma internals from the [H.s_store] in your [tank_slot_name]. You must breathe plasma in order to survive, and are extremely flammable.")
H.internal = H.get_item_by_slot(tank_slot)
- if (H.internals)
- H.internals.icon_state = "internal1"
+ H.update_internals_hud_icon(1)
// Plasmamen are so fucking different that they need their own proc.
/datum/species/plasmaman/handle_breath(var/datum/gas_mixture/breath, var/mob/living/carbon/human/H)
diff --git a/code/modules/mob/living/carbon/human/species/shadow.dm b/code/modules/mob/living/carbon/human/species/shadow.dm
index 55701b52d1c..fa7dadfebcb 100644
--- a/code/modules/mob/living/carbon/human/species/shadow.dm
+++ b/code/modules/mob/living/carbon/human/species/shadow.dm
@@ -33,5 +33,5 @@
if(light_amount > 2) //if there's enough light, start dying
H.take_overall_damage(1,1)
- else if (light_amount < 2) //heal in the dark
+ else if(light_amount < 2) //heal in the dark
H.heal_overall_damage(1,1)
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm
index f6a1e5e2088..bdb64ba0a98 100644
--- a/code/modules/mob/living/carbon/human/species/species.dm
+++ b/code/modules/mob/living/carbon/human/species/species.dm
@@ -42,7 +42,6 @@
var/heat_level_3_breathe = 1000 // Heat damage level 3 above this point; used for breathed air temperature
var/body_temperature = 310.15 //non-IS_SYNTHETIC species will try to stabilize at this temperature. (also affects temperature processing)
- var/passive_temp_gain = 0 //IS_SYNTHETIC species will gain this much temperature every second
var/reagent_tag //Used for metabolizing reagents.
var/siemens_coeff = 1 //base electrocution coefficient
@@ -121,8 +120,14 @@
//Default hair/headacc style vars.
var/default_hair = "Bald" //Default hair style for newly created humans unless otherwise set.
+ var/default_hair_colour
var/default_fhair = "Shaved" //Default facial hair style for newly created humans unless otherwise set.
+ var/default_fhair_colour
var/default_headacc = "None" //Default head accessory style for newly created humans unless otherwise set.
+ var/default_headacc_colour
+
+ //Defining lists of icon skin tones for species that have them.
+ var/list/icon_skin_tones = list()
// Determines the organs that the species spawns with and
var/list/has_organ = list( // which required-organ checks are conducted.
@@ -372,6 +377,9 @@
grant_abilities(C)
return
+/datum/species/proc/updatespeciescolor(var/mob/living/carbon/human/H) //Handles changing icobase for species that have multiple skin colors.
+ return
+
/datum/species/proc/grant_abilities(var/mob/living/carbon/human/H)
for(var/proc/ability in species_abilities)
H.verbs += ability
@@ -384,7 +392,7 @@
return
/datum/species/proc/remove_abilities(var/mob/living/carbon/human/H)
- for (var/proc/ability in species_abilities)
+ for(var/proc/ability in species_abilities)
H.verbs -= ability
return
@@ -606,33 +614,36 @@
H.clear_alert("high")
/datum/species/proc/handle_hud_icons(mob/living/carbon/human/H)
+ if(!H.client)
+ return
if(H.healths)
- if(H.analgesic)
- H.healths.icon_state = "health_health_numb"
+ if(H.stat == DEAD)
+ H.healths.icon_state = "health7"
else
- if(H.stat == DEAD)
- H.healths.icon_state = "health7"
- else
- switch(H.hal_screwyhud)
- if(1) H.healths.icon_state = "health6"
- if(2) H.healths.icon_state = "health7"
- if(5) H.healths.icon_state = "health0"
- else
- switch(100 - ((flags & NO_PAIN) ? 0 : H.traumatic_shock) - H.staminaloss)
- if(100 to INFINITY) H.healths.icon_state = "health0"
- if(80 to 100) H.healths.icon_state = "health1"
- if(60 to 80) H.healths.icon_state = "health2"
- if(40 to 60) H.healths.icon_state = "health3"
- if(20 to 40) H.healths.icon_state = "health4"
- if(0 to 20) H.healths.icon_state = "health5"
- else H.healths.icon_state = "health6"
+ switch(H.hal_screwyhud)
+ if(1) H.healths.icon_state = "health6"
+ if(2) H.healths.icon_state = "health7"
+ if(5) H.healths.icon_state = "health0"
+ else
+ switch(100 - ((flags & NO_PAIN) ? 0 : H.traumatic_shock) - H.staminaloss)
+ if(100 to INFINITY) H.healths.icon_state = "health0"
+ if(80 to 100) H.healths.icon_state = "health1"
+ if(60 to 80) H.healths.icon_state = "health2"
+ if(40 to 60) H.healths.icon_state = "health3"
+ if(20 to 40) H.healths.icon_state = "health4"
+ if(0 to 20) H.healths.icon_state = "health5"
+ else H.healths.icon_state = "health6"
if(H.healthdoll)
- H.healthdoll.overlays.Cut()
if(H.stat == DEAD)
H.healthdoll.icon_state = "healthdoll_DEAD"
+ if(H.healthdoll.overlays.len)
+ H.healthdoll.overlays.Cut()
else
- H.healthdoll.icon_state = "healthdoll_OVERLAY"
+ var/list/new_overlays = list()
+ var/list/cached_overlays = H.healthdoll.cached_healthdoll_overlays
+ // Use the dead health doll as the base, since we have proper "healthy" overlays now
+ H.healthdoll.icon_state = "healthdoll_DEAD"
for(var/obj/item/organ/external/O in H.organs)
var/damage = O.burn_dam + O.brute_dam
var/comparison = (O.max_damage/5)
@@ -647,8 +658,10 @@
icon_num = 4
if(damage > (comparison*4))
icon_num = 5
- if(icon_num)
- H.healthdoll.overlays += image('icons/mob/screen_gen.dmi',"[O.limb_name][icon_num]")
+ new_overlays += "[O.limb_name][icon_num]"
+ H.healthdoll.overlays += (new_overlays - cached_overlays)
+ H.healthdoll.overlays -= (cached_overlays - new_overlays)
+ H.healthdoll.cached_healthdoll_overlays = new_overlays
switch(H.nutrition)
if(NUTRITION_LEVEL_FULL to INFINITY)
diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm
index 65d100dc420..6268652f828 100644
--- a/code/modules/mob/living/carbon/human/species/station.dm
+++ b/code/modules/mob/living/carbon/human/species/station.dm
@@ -59,6 +59,16 @@
default_hair = "Unathi Horns"
butt_sprite = "unathi"
+ has_organ = list(
+ "heart" = /obj/item/organ/internal/heart,
+ "lungs" = /obj/item/organ/internal/lungs,
+ "liver" = /obj/item/organ/internal/liver/unathi,
+ "kidneys" = /obj/item/organ/internal/kidneys,
+ "brain" = /obj/item/organ/internal/brain,
+ "appendix" = /obj/item/organ/internal/appendix,
+ "eyes" = /obj/item/organ/internal/eyes,
+ )
+
allowed_consumed_mobs = list(/mob/living/simple_animal/mouse, /mob/living/simple_animal/lizard, /mob/living/simple_animal/chick, /mob/living/simple_animal/chicken,
/mob/living/simple_animal/crab, /mob/living/simple_animal/butterfly, /mob/living/simple_animal/parrot, /mob/living/simple_animal/tribble)
@@ -71,11 +81,6 @@
/datum/species/unathi/handle_death(var/mob/living/carbon/human/H)
H.stop_tail_wagging(1)
-/datum/species/unathi/equip(var/mob/living/carbon/human/H)
- if(H.mind.assigned_role != "Clown")
- H.unEquip(H.shoes)
- H.equip_or_collect(new /obj/item/clothing/shoes/sandal(H), slot_shoes)
-
/datum/species/tajaran
name = "Tajaran"
name_plural = "Tajaran"
@@ -116,6 +121,16 @@
default_headacc = "Tajaran Ears"
butt_sprite = "tajaran"
+ has_organ = list(
+ "heart" = /obj/item/organ/internal/heart,
+ "lungs" = /obj/item/organ/internal/lungs,
+ "liver" = /obj/item/organ/internal/liver/tajaran,
+ "kidneys" = /obj/item/organ/internal/kidneys,
+ "brain" = /obj/item/organ/internal/brain,
+ "appendix" = /obj/item/organ/internal/appendix,
+ "eyes" = /obj/item/organ/internal/eyes,
+ )
+
allowed_consumed_mobs = list(/mob/living/simple_animal/mouse, /mob/living/simple_animal/chick, /mob/living/simple_animal/butterfly, /mob/living/simple_animal/parrot,
/mob/living/simple_animal/tribble)
@@ -128,11 +143,6 @@
/datum/species/tajaran/handle_death(var/mob/living/carbon/human/H)
H.stop_tail_wagging(1)
-/datum/species/tajaran/equip(var/mob/living/carbon/human/H)
- if(H.mind.assigned_role != "Clown")
- H.unEquip(H.shoes)
- H.equip_or_collect(new /obj/item/clothing/shoes/sandal(H), slot_shoes)
-
/datum/species/vulpkanin
name = "Vulpkanin"
name_plural = "Vulpkanin"
@@ -161,6 +171,16 @@
base_color = "#B43214"
butt_sprite = "vulp"
+ has_organ = list(
+ "heart" = /obj/item/organ/internal/heart,
+ "lungs" = /obj/item/organ/internal/lungs,
+ "liver" = /obj/item/organ/internal/liver/vulpkanin,
+ "kidneys" = /obj/item/organ/internal/kidneys,
+ "brain" = /obj/item/organ/internal/brain,
+ "appendix" = /obj/item/organ/internal/appendix,
+ "eyes" = /obj/item/organ/internal/eyes,
+ )
+
allowed_consumed_mobs = list(/mob/living/simple_animal/mouse, /mob/living/simple_animal/lizard, /mob/living/simple_animal/chick, /mob/living/simple_animal/chicken,
/mob/living/simple_animal/crab, /mob/living/simple_animal/butterfly, /mob/living/simple_animal/parrot, /mob/living/simple_animal/tribble)
@@ -221,8 +241,8 @@
/datum/species/vox
name = "Vox"
name_plural = "Vox"
- icobase = 'icons/mob/human_races/r_vox.dmi'
- deform = 'icons/mob/human_races/r_def_vox.dmi'
+ icobase = 'icons/mob/human_races/vox/r_vox.dmi'
+ deform = 'icons/mob/human_races/vox/r_def_vox.dmi'
path = /mob/living/carbon/human/vox
default_language = "Galactic Common"
@@ -267,12 +287,13 @@
flags = NO_SCAN | IS_WHITELISTED
clothing_flags = HAS_SOCKS
dietflags = DIET_OMNI
- bodyflags = HAS_TAIL | TAIL_WAGGING | TAIL_OVERLAPPED
+ bodyflags = HAS_ICON_SKIN_TONE | HAS_TAIL | TAIL_WAGGING | TAIL_OVERLAPPED
blood_color = "#2299FC"
flesh_color = "#808D11"
//Default styles for created mobs.
default_hair = "Short Vox Quills"
+ default_hair_colour = "#614f19" //R: 97, G: 79, B: 25
butt_sprite = "vox"
reagent_tag = PROCESS_ORG
@@ -280,10 +301,19 @@
male_scream_sound = 'sound/voice/shriek1.ogg'
female_scream_sound = 'sound/voice/shriek1.ogg'
+ icon_skin_tones = list(
+ 1 = "Default Green",
+ 2 = "Dark Green",
+ 3 = "Brown",
+ 4 = "Grey",
+ 5 = "Emerald",
+ 6 = "Azure"
+ )
+
has_organ = list(
"heart" = /obj/item/organ/internal/heart,
"lungs" = /obj/item/organ/internal/lungs,
- "liver" = /obj/item/organ/internal/liver,
+ "liver" = /obj/item/organ/internal/liver/vox,
"kidneys" = /obj/item/organ/internal/kidneys,
"brain" = /obj/item/organ/internal/brain,
"appendix" = /obj/item/organ/internal/appendix,
@@ -324,15 +354,46 @@
H.equip_or_collect(new /obj/item/weapon/tank/emergency_oxygen/vox(H), slot_l_hand)
to_chat(H, "You are now running on nitrogen internals from the [H.l_hand] in your hand. Your species finds oxygen toxic, so you must breathe nitrogen only.")
H.internal = H.l_hand
- if (H.internals)
- H.internals.icon_state = "internal1"
+ H.update_internals_hud_icon(1)
-/*
/datum/species/vox/handle_post_spawn(var/mob/living/carbon/human/H)
- H.verbs += /mob/living/carbon/human/proc/leap
- ..() */
+ updatespeciescolor(H)
+ H.update_icons()
+ //H.verbs += /mob/living/carbon/human/proc/leap
+ ..()
+
+/datum/species/vox/updatespeciescolor(var/mob/living/carbon/human/H) //Handling species-specific skin-tones for the Vox race.
+ if(H.species.name == "Vox") //Making sure we don't break Armalis.
+ switch(H.s_tone)
+ if(6) //Azure Vox.
+ icobase = 'icons/mob/human_races/vox/r_voxazu.dmi'
+ deform = 'icons/mob/human_races/vox/r_def_voxazu.dmi'
+ tail = "voxtail_azu"
+ if(5) //Emerald Vox.
+ icobase = 'icons/mob/human_races/vox/r_voxemrl.dmi'
+ deform = 'icons/mob/human_races/vox/r_def_voxemrl.dmi'
+ tail = "voxtail_emrl"
+ if(4) //Grey Vox.
+ icobase = 'icons/mob/human_races/vox/r_voxgry.dmi'
+ deform = 'icons/mob/human_races/vox/r_def_voxgry.dmi'
+ tail = "voxtail_gry"
+ if(3) //Brown Vox.
+ icobase = 'icons/mob/human_races/vox/r_voxbrn.dmi'
+ deform = 'icons/mob/human_races/vox/r_def_voxbrn.dmi'
+ tail = "voxtail_brn"
+ if(2) //Dark Green Vox.
+ icobase = 'icons/mob/human_races/vox/r_voxdgrn.dmi'
+ deform = 'icons/mob/human_races/vox/r_def_voxdgrn.dmi'
+ tail = "voxtail_dgrn"
+ else //Default Green Vox.
+ icobase = 'icons/mob/human_races/vox/r_vox.dmi'
+ deform = 'icons/mob/human_races/vox/r_def_vox.dmi'
+ tail = "voxtail" //Ensures they get an appropriately coloured tail depending on the skin-tone.
+
+ H.update_dna()
/datum/species/vox/armalis/handle_post_spawn(var/mob/living/carbon/human/H)
+ H.verbs += /mob/living/carbon/human/proc/leap
H.verbs += /mob/living/carbon/human/proc/gut
..()
@@ -412,6 +473,16 @@
reagent_tag = PROCESS_ORG
butt_sprite = "kidan"
+ has_organ = list(
+ "heart" = /obj/item/organ/internal/heart,
+ "lungs" = /obj/item/organ/internal/lungs,
+ "liver" = /obj/item/organ/internal/liver/kidan,
+ "kidneys" = /obj/item/organ/internal/kidneys,
+ "brain" = /obj/item/organ/internal/brain,
+ "appendix" = /obj/item/organ/internal/appendix,
+ "eyes" = /obj/item/organ/internal/eyes,
+ )
+
allowed_consumed_mobs = list(/mob/living/simple_animal/diona)
suicide_messages = list(
@@ -610,12 +681,22 @@
icobase = 'icons/mob/human_races/r_grey.dmi'
deform = 'icons/mob/human_races/r_def_grey.dmi'
default_language = "Galactic Common"
- //language = "Grey" // Perhaps if they ever get a hivemind
+ language = "Psionic Communication"
unarmed_type = /datum/unarmed_attack/punch
darksight = 5 // BOOSTED from 2
eyes = "grey_eyes_s"
butt_sprite = "grey"
+ has_organ = list(
+ "heart" = /obj/item/organ/internal/heart,
+ "lungs" = /obj/item/organ/internal/lungs,
+ "liver" = /obj/item/organ/internal/liver/grey,
+ "kidneys" = /obj/item/organ/internal/kidneys,
+ "brain" = /obj/item/organ/internal/brain/grey,
+ "appendix" = /obj/item/organ/internal/appendix,
+ "eyes" = /obj/item/organ/internal/eyes,
+ )
+
brute_mod = 1.25 //greys are fragile
default_genes = list(REMOTE_TALK)
@@ -636,8 +717,6 @@
C.dna.SetSEState(REMOTETALKBLOCK,0,1)
C.mutations -= REMOTE_TALK
genemutcheck(C,REMOTETALKBLOCK,null,MUTCHK_FORCED)
- C.mutations.Add(GREY)
- C.update_mutations()
..()
/datum/species/diona
@@ -713,8 +792,7 @@
"is pulling themselves apart!")
/datum/species/diona/can_understand(var/mob/other)
- var/mob/living/simple_animal/diona/D = other
- if(istype(D))
+ if(istype(other, /mob/living/simple_animal/diona))
return 1
return 0
@@ -772,17 +850,6 @@
burn_mod = 2.5 // So they take 50% extra damage from brute/burn overall.
death_message = "gives one shrill beep before falling limp, their monitor flashing blue before completely shutting off..."
- cold_level_1 = 50
- cold_level_2 = -1
- cold_level_3 = -1
-
- heat_level_1 = 500 //gives them about 25 seconds in space before taking damage
- heat_level_2 = 540
- heat_level_3 = 600
- heat_level_3_breathe = 600
-
- passive_temp_gain = 10 //this should cause IPCs to stabilize at ~80 C in a 20 C environment.
-
flags = IS_WHITELISTED | NO_BREATHE | NO_SCAN | NO_BLOOD | NO_PAIN | NO_DNA | NO_POISON | RADIMMUNE | ALL_RPARTS
clothing_flags = HAS_UNDERWEAR | HAS_UNDERSHIRT | HAS_SOCKS
bodyflags = HAS_SKIN_COLOR | HAS_MARKINGS | HAS_HEAD_ACCESSORY
@@ -838,4 +905,4 @@
spawn(100)
if(H)
H.update_hair()
- H.update_fhair()
\ No newline at end of file
+ H.update_fhair()
diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm
index 45bc15b1d51..50270ed3f78 100644
--- a/code/modules/mob/living/carbon/human/update_icons.dm
+++ b/code/modules/mob/living/carbon/human/update_icons.dm
@@ -212,6 +212,9 @@ var/global/list/damage_icon_parts = list()
var/hulk = (HULK in src.mutations)
var/skeleton = (SKELETON in src.mutations)
+ if(species && species.bodyflags & HAS_ICON_SKIN_TONE)
+ species.updatespeciescolor(src)
+
//CACHING: Generate an index key from visible bodyparts.
//0 = destroyed, 1 = normal, 2 = robotic, 3 = necrotic.
//Create a new, blank icon for our mob to use.
@@ -597,7 +600,7 @@ var/global/list/damage_icon_parts = list()
var/image/standing = image("icon_state" = "[t_color]_s")
if(FAT in mutations)
- if(w_uniform.flags&ONESIZEFITSALL)
+ if(w_uniform.flags_size & ONESIZEFITSALL)
standing.icon = 'icons/mob/uniform_fat.dmi'
else
to_chat(src, "\red You burst out of \the [w_uniform]!")
@@ -620,7 +623,12 @@ var/global/list/damage_icon_parts = list()
for(var/obj/item/clothing/accessory/A in w_uniform:accessories)
var/tie_color = A.item_color
if(!tie_color) tie_color = A.icon_state
- standing.overlays += image("icon" = 'icons/mob/ties.dmi', "icon_state" = "[tie_color]")
+ if(A.icon_override)
+ standing.overlays += image("icon" = A.icon_override, "icon_state" = "[A.icon_state]")
+ else if(A.sprite_sheets && A.sprite_sheets[species.name])
+ standing.overlays += image("icon" = A.sprite_sheets[species.name], "icon_state" = "[A.icon_state]")
+ else
+ standing.overlays += image("icon" = 'icons/mob/ties.dmi', "icon_state" = "[tie_color]")
overlays_standing[UNIFORM_LAYER] = standing
else
@@ -629,13 +637,14 @@ var/global/list/damage_icon_parts = list()
for( var/obj/item/thing in list(r_store, l_store, wear_id, wear_pda, belt) ) //
if(thing) //
unEquip(thing) //
- if (client) //
+ if(client) //
client.screen -= thing //
//
- if (thing) //
+ if(thing) //
thing.loc = loc //
thing.dropped(src) //
thing.layer = initial(thing.layer)
+ thing.plane = initial(thing.plane)
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_wear_id(var/update_icons=1)
@@ -885,7 +894,6 @@ var/global/list/damage_icon_parts = list()
/mob/living/carbon/human/update_inv_wear_suit(var/update_icons=1)
-
if(client && hud_used)
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_wear_suit]
if(inv)
@@ -903,7 +911,7 @@ var/global/list/damage_icon_parts = list()
else if(wear_suit.sprite_sheets && wear_suit.sprite_sheets[species.name])
standing = image("icon" = wear_suit.sprite_sheets[species.name], "icon_state" = "[wear_suit.icon_state]")
else if(FAT in mutations)
- if(wear_suit.flags&ONESIZEFITSALL)
+ if(wear_suit.flags_size & ONESIZEFITSALL)
standing = image("icon" = 'icons/mob/suit_fat.dmi', "icon_state" = "[wear_suit.icon_state]")
else
to_chat(src, "\red You burst out of \the [wear_suit]!")
@@ -1108,12 +1116,13 @@ var/global/list/damage_icon_parts = list()
if(body_accessory)
if(body_accessory.try_restrictions(src))
var/icon/accessory_s = new/icon("icon" = body_accessory.icon, "icon_state" = body_accessory.icon_state)
- accessory_s.Blend(rgb(r_skin, g_skin, b_skin), body_accessory.blend_mode)
+ if(species.bodyflags & HAS_SKIN_COLOR)
+ accessory_s.Blend(rgb(r_skin, g_skin, b_skin), body_accessory.blend_mode)
- if(src.species.bodyflags & TAIL_OVERLAPPED) // If the player has a species whose tail is overlapped by limbs...
+ if(species.bodyflags & TAIL_OVERLAPPED) // If the player has a species whose tail is overlapped by limbs...
// Gives the underlimbs layer SEW direction icons since it's overlayed by limbs and just about everything else anyway.
var/icon/temp1 = new /icon('icons/mob/body_accessory.dmi',"accessory_none_s")
- if(src.species.name in body_accessory.allowed_species)
+ if(species.name in body_accessory.allowed_species)
var/icon/temp = new/icon("icon" = 'icons/mob/body_accessory.dmi', "icon_state" = "[species.tail]_delay")
temp1 = temp
else
@@ -1129,7 +1138,7 @@ var/global/list/damage_icon_parts = list()
// Creates a blank icon, and copies accessory_s' north direction sprite into it
// before passing that to the tail layer that overlays uniforms and such.
var/icon/temp2 = new /icon('icons/mob/body_accessory.dmi',"accessory_none_s")
- if(src.species.name in body_accessory.allowed_species)
+ if(species.name in body_accessory.allowed_species)
var/icon/temp = new/icon("icon" = 'icons/mob/body_accessory.dmi', "icon_state" = "[species.tail]_delay")
temp2 = temp
else
@@ -1145,9 +1154,10 @@ var/global/list/damage_icon_parts = list()
else if(species.tail && species.bodyflags & HAS_TAIL) //no tailless tajaran
if(!wear_suit || !(wear_suit.flags_inv & HIDETAIL) && !istype(wear_suit, /obj/item/clothing/suit/space))
var/icon/tail_s = new/icon("icon" = 'icons/effects/species.dmi', "icon_state" = "[species.tail]_s")
- tail_s.Blend(rgb(r_skin, g_skin, b_skin), ICON_ADD)
+ if(species.bodyflags & HAS_SKIN_COLOR)
+ tail_s.Blend(rgb(r_skin, g_skin, b_skin), ICON_ADD)
- if(src.species.bodyflags & TAIL_OVERLAPPED) // If the player has a species whose tail is overlapped by limbs...
+ if(species.bodyflags & TAIL_OVERLAPPED) // If the player has a species whose tail is overlapped by limbs...
// Gives the underlimbs layer SEW direction icons since it's overlayed by limbs and just about everything else anyway.
var/icon/temp1 = new/icon("icon" = 'icons/effects/species.dmi', "icon_state" = "[species.tail]_delay")
temp1.Insert(new/icon(tail_s,dir=SOUTH),dir=SOUTH)
@@ -1177,13 +1187,14 @@ var/global/list/damage_icon_parts = list()
if(body_accessory)
var/icon/accessory_s = new/icon("icon" = body_accessory.get_animated_icon(), "icon_state" = body_accessory.get_animated_icon_state())
- accessory_s.Blend(rgb(r_skin, g_skin, b_skin), body_accessory.blend_mode)
+ if(species.bodyflags & HAS_SKIN_COLOR)
+ accessory_s.Blend(rgb(r_skin, g_skin, b_skin), body_accessory.blend_mode)
- if(src.species.bodyflags & TAIL_OVERLAPPED) // If the player has a species whose tail is overlapped by limbs...
+ if(species.bodyflags & TAIL_OVERLAPPED) // If the player has a species whose tail is overlapped by limbs...
// Gives the underlimbs layer SEW direction icons since it's overlayed by limbs and just about everything else anyway.
var/icon/temp1 = new /icon('icons/mob/body_accessory.dmi',"accessory_none_s")
if(body_accessory.allowed_species)
- if(src.species.name in body_accessory.allowed_species)
+ if(species.name in body_accessory.allowed_species)
var/icon/temp = new/icon("icon" = 'icons/mob/body_accessory.dmi', "icon_state" = "[species.tail]_delay")
temp1 = temp
else
@@ -1199,7 +1210,7 @@ var/global/list/damage_icon_parts = list()
// Creates a blank icon, and copies accessory_s' north direction sprite into it
// before passing that to the tail layer that overlays uniforms and such.
var/icon/temp2 = new /icon('icons/mob/body_accessory.dmi',"accessory_none_s")
- if(src.species.name in body_accessory.allowed_species) // If the user's species is in the list of allowed species for the currently selected body accessory, use the appropriate animation timing blank
+ if(species.name in body_accessory.allowed_species) // If the user's species is in the list of allowed species for the currently selected body accessory, use the appropriate animation timing blank
var/icon/temp = new/icon("icon" = 'icons/mob/body_accessory.dmi', "icon_state" = "[species.tail]_delay")
temp2 = temp
else // Else if the user's species is not in the list of allowed species for the currently selected body accessory, this point must have been reached by admin-override. Use vulpkanin timings as default.
@@ -1214,9 +1225,10 @@ var/global/list/damage_icon_parts = list()
else if(species.tail && species.bodyflags & HAS_TAIL)
var/icon/tailw_s = new/icon("icon" = 'icons/effects/species.dmi', "icon_state" = "[species.tail]w_s")
- tailw_s.Blend(rgb(r_skin, g_skin, b_skin), ICON_ADD)
+ if(species.bodyflags & HAS_SKIN_COLOR)
+ tailw_s.Blend(rgb(r_skin, g_skin, b_skin), ICON_ADD)
- if(src.species.bodyflags & TAIL_OVERLAPPED) // If the player has a species whose tail is overlapped by limbs...
+ if(species.bodyflags & TAIL_OVERLAPPED) // If the player has a species whose tail is overlapped by limbs...
// Gives the underlimbs layer SEW direction icons since it's overlayed by limbs and just about everything else anyway.
var/icon/temp1 = new/icon("icon" = 'icons/effects/species.dmi', "icon_state" = "[species.tail]_delay")
temp1.Insert(tailw_s,dir=SOUTH)
@@ -1249,13 +1261,29 @@ var/global/list/damage_icon_parts = list()
//Adds a collar overlay above the helmet layer if the suit has one
// Suit needs an identically named sprite in icons/mob/collar.dmi
+// For suits with species_fit and sprite_sheets, an identically named sprite needs to exist in a file like this icons/mob/species/[species_name_here]/collar.dmi.
/mob/living/carbon/human/proc/update_collar(var/update_icons=1)
var/icon/C = new('icons/mob/collar.dmi')
var/image/standing = null
if(wear_suit)
- if(wear_suit.icon_state in C.IconStates())
- standing = image("icon" = C, "icon_state" = "[wear_suit.icon_state]")
+ if(wear_suit.icon_override)
+ var/icon_path = "[wear_suit.icon_override]"
+ icon_path = "[copytext(icon_path, 1, findtext(icon_path, "/suit.dmi"))]/collar.dmi" //If this file doesn't exist, the end result is that COLLAR_LAYER will be unchanged (empty).
+ var/icon/icon_file
+ if(fexists(icon_path)) //Just ensuring the nonexistance of a file with the above path won't cause a runtime.
+ icon_file = new(icon_path)
+ standing = image("icon" = icon_file, "icon_state" = "[wear_suit.icon_state]")
+ else if(wear_suit.sprite_sheets && wear_suit.sprite_sheets[species.name])
+ var/icon_path = "[wear_suit.sprite_sheets[species.name]]"
+ icon_path = "[copytext(icon_path, 1, findtext(icon_path, "/suit.dmi"))]/collar.dmi" //If this file doesn't exist, the end result is that COLLAR_LAYER will be unchanged (empty).
+ var/icon/icon_file
+ if(fexists(icon_path)) //Just ensuring the nonexistance of a file with the above path won't cause a runtime.
+ icon_file = new(icon_path)
+ standing = image("icon" = icon_file, "icon_state" = "[wear_suit.icon_state]")
+ else
+ if(wear_suit.icon_state in C.IconStates())
+ standing = image("icon" = C, "icon_state" = "[wear_suit.icon_state]")
overlays_standing[COLLAR_LAYER] = standing
@@ -1266,7 +1294,7 @@ var/global/list/damage_icon_parts = list()
/mob/living/carbon/human/proc/generate_head_icon()
//gender no longer matters for the mouth, although there should probably be seperate base head icons.
// var/g = "m"
-// if (gender == FEMALE) g = "f"
+// if(gender == FEMALE) g = "f"
var/obj/item/organ/external/head/H = get_organ("head")
//base icons
var/icon/face_lying = new /icon('icons/mob/human_face.dmi',"bald_l")
diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm
index c26508b1374..985047a8284 100644
--- a/code/modules/mob/living/carbon/life.dm
+++ b/code/modules/mob/living/carbon/life.dm
@@ -181,19 +181,17 @@
/mob/living/carbon/proc/get_breath_from_internal(volume_needed)
if(internal)
- if(!contents.Find(internal))
+ if(internal.loc != src)
internal = null
if(!wear_mask || !(wear_mask.flags & AIRTIGHT)) //not wearing mask or non-breath mask
if(!head || !(head.flags & AIRTIGHT)) //not wearing helmet or non-breath helmet
internal = null //turn off internals
if(internal)
- if(internals)
- internals.icon_state = "internal1"
+ update_internals_hud_icon(1)
return internal.remove_air_volume(volume_needed)
else
- if(internals)
- internals.icon_state = "internal0"
+ update_internals_hud_icon(0)
return
@@ -437,18 +435,12 @@
see_invisible = see_override
-/mob/living/carbon/handle_actions()
- ..()
- for(var/obj/item/I in internal_organs)
- give_action_button(I, 1)
-
-
/mob/living/carbon/handle_hud_icons()
return
/mob/living/carbon/handle_hud_icons_health()
if(healths)
- if (stat != DEAD)
+ if(stat != DEAD)
switch(health)
if(100 to INFINITY)
healths.icon_state = "health0"
diff --git a/code/modules/mob/living/carbon/shock.dm b/code/modules/mob/living/carbon/shock.dm
index 43195db4f11..0a86f2756cf 100644
--- a/code/modules/mob/living/carbon/shock.dm
+++ b/code/modules/mob/living/carbon/shock.dm
@@ -16,14 +16,12 @@
src.traumatic_shock -= R.shock_reduction // now you too can varedit cyanide to reduce shock by 1000 - Iamgoofball
if(src.slurring)
src.traumatic_shock -= 10
- if(src.analgesic)
- src.traumatic_shock = 0
// broken or ripped off organs will add quite a bit of pain
if(istype(src,/mob/living/carbon/human))
var/mob/living/carbon/human/M = src
for(var/obj/item/organ/external/organ in M.organs)
- if (!organ)
+ if(!organ)
continue
else if(organ.status & ORGAN_BROKEN || organ.open)
src.traumatic_shock += 15
diff --git a/code/modules/mob/living/carbon/slime/emote.dm b/code/modules/mob/living/carbon/slime/emote.dm
index 8c290dc6094..c77d5e24a65 100644
--- a/code/modules/mob/living/carbon/slime/emote.dm
+++ b/code/modules/mob/living/carbon/slime/emote.dm
@@ -1,5 +1,5 @@
/mob/living/carbon/slime/emote(var/act, var/m_type=1, var/message = null)
- if (findtext(act, "-", 1, null))
+ if(findtext(act, "-", 1, null))
var/t1 = findtext(act, "-", 1, null)
//param = copytext(act, t1 + 1, length(act) + 1)
act = copytext(act, 1, t1)
@@ -9,16 +9,16 @@
act = lowertext(act)
switch(act) //Alphabetical please
- if ("me")
+ if("me")
if(silent)
return
- if (src.client)
- if (client.prefs.muted & MUTE_IC)
+ if(src.client)
+ if(client.prefs.muted & MUTE_IC)
to_chat(src, "\red You cannot send IC messages (muted).")
return
- if (src.client.handle_spam_prevention(message,MUTE_IC))
+ if(src.client.handle_spam_prevention(message,MUTE_IC))
return
- if (stat)
+ if(stat)
return
if(!(message))
return
@@ -27,7 +27,7 @@
message = "The [src.name] bounces in place."
m_type = 1
- if ("custom")
+ if("custom")
return custom_emote(m_type, message)
if("jiggle")
@@ -58,13 +58,13 @@
message = "The [src.name] vibrates!"
m_type = 1
- if ("help") //This is an exception
+ if("help") //This is an exception
to_chat(src, "Help for slime emotes. You can use these emotes with say \"*emote\":\n\nbounce, custom, jiggle, light, moan, shiver, sway, twitch, vibrate")
else
to_chat(src, "\blue Unusable emote '[act]'. Say *help for a list.")
- if ((message && src.stat == 0))
- if (m_type & 1)
+ if((message && src.stat == 0))
+ if(m_type & 1)
for(var/mob/O in viewers(src, null))
O.show_message(message, m_type)
//Foreach goto(703)
diff --git a/code/modules/mob/living/carbon/slime/examine.dm b/code/modules/mob/living/carbon/slime/examine.dm
index 7d2e2d5e62c..4dd67695e2a 100644
--- a/code/modules/mob/living/carbon/slime/examine.dm
+++ b/code/modules/mob/living/carbon/slime/examine.dm
@@ -1,12 +1,13 @@
/mob/living/carbon/slime/examine(mob/user)
+ to_chat(user, "*---------*")
..(user)
- var/msg = ""
- if (src.stat == DEAD)
+ var/msg = ""
+ if(src.stat == DEAD)
msg += "It is limp and unresponsive.\n"
else
- if (src.getBruteLoss())
+ if(src.getBruteLoss())
msg += ""
- if (src.getBruteLoss() < 40)
+ if(src.getBruteLoss() < 40)
msg += "It has some punctures in its flesh!"
else
msg += "It has severe punctures and tears in its flesh!"
diff --git a/code/modules/mob/living/carbon/slime/life.dm b/code/modules/mob/living/carbon/slime/life.dm
index 6dce9aba656..b51e0084ee3 100644
--- a/code/modules/mob/living/carbon/slime/life.dm
+++ b/code/modules/mob/living/carbon/slime/life.dm
@@ -9,7 +9,7 @@
if(..())
handle_nutrition()
handle_targets()
- if (!ckey)
+ if(!ckey)
handle_speech_and_mood()
/mob/living/carbon/slime/proc/AIprocess() // the master AI process
@@ -17,9 +17,9 @@
if(AIproc || stat == DEAD || client) return
var/hungry = 0
- if (nutrition < get_starve_nutrition())
+ if(nutrition < get_starve_nutrition())
hungry = 2
- else if (nutrition < get_grow_nutrition() && prob(25) || nutrition < get_hunger_nutrition())
+ else if(nutrition < get_grow_nutrition() && prob(25) || nutrition < get_hunger_nutrition())
hungry = 1
AIproc = 1
@@ -183,19 +183,19 @@
adjustCloneLoss(-1)
adjustBruteLoss(-1)
- if (src.stat == DEAD)
+ if(src.stat == DEAD)
src.lying = 1
src.blinded = 1
else
- if (src.paralysis || src.stunned || src.weakened || (status_flags && FAKEDEATH)) //Stunned etc.
- if (src.stunned > 0)
+ if(src.paralysis || src.stunned || src.weakened || (status_flags && FAKEDEATH)) //Stunned etc.
+ if(src.stunned > 0)
AdjustStunned(-1)
src.stat = 0
- if (src.weakened > 0)
+ if(src.weakened > 0)
AdjustWeakened(-1)
src.lying = 0
src.stat = 0
- if (src.paralysis > 0)
+ if(src.paralysis > 0)
AdjustParalysis(-1)
src.blinded = 0
src.lying = 0
@@ -205,34 +205,34 @@
src.lying = 0
src.stat = 0
- if (src.stuttering) src.stuttering = 0
+ if(src.stuttering) src.stuttering = 0
- if (src.eye_blind)
+ if(src.eye_blind)
src.eye_blind = 0
src.blinded = 1
- if (src.ear_deaf > 0) src.ear_deaf = 0
- if (src.ear_damage < 25)
+ if(src.ear_deaf > 0) src.ear_deaf = 0
+ if(src.ear_damage < 25)
src.ear_damage = 0
src.density = !( src.lying )
- if (src.sdisabilities & BLIND)
+ if(src.disabilities & BLIND)
src.blinded = 1
- if (src.sdisabilities & DEAF)
+ if(src.disabilities & DEAF)
src.ear_deaf = 1
- if (src.eye_blurry > 0)
+ if(src.eye_blurry > 0)
src.eye_blurry = 0
- if (src.druggy > 0)
+ if(src.druggy > 0)
src.druggy = 0
return 1
/mob/living/carbon/slime/proc/handle_nutrition()
- if (prob(15))
+ if(prob(15))
nutrition -= 1 + is_adult
if(nutrition <= 0)
@@ -240,9 +240,10 @@
if(prob(75))
adjustToxLoss(rand(0,5))
- else if (nutrition >= get_grow_nutrition() && amount_grown < 10)
+ else if(nutrition >= get_grow_nutrition() && amount_grown < 10)
nutrition -= 20
amount_grown++
+ update_action_buttons_icon()
if(amount_grown >= 10 && !Victim && !Target && !ckey)
if(is_adult)
@@ -278,7 +279,7 @@
if(Target)
--target_patience
- if (target_patience <= 0 || SStun || Discipline || attacked) // Tired of chasing or something draws out attention
+ if(target_patience <= 0 || SStun || Discipline || attacked) // Tired of chasing or something draws out attention
target_patience = 0
Target = null
@@ -286,9 +287,9 @@
var/hungry = 0 // determines if the slime is hungry
- if (nutrition < get_starve_nutrition())
+ if(nutrition < get_starve_nutrition())
hungry = 2
- else if (nutrition < get_grow_nutrition() && prob(25) || nutrition < get_hunger_nutrition())
+ else if(nutrition < get_grow_nutrition() && prob(25) || nutrition < get_hunger_nutrition())
hungry = 1
if(hungry == 2 && !client) // if a slime is starving, it starts losing its friends
@@ -340,26 +341,26 @@
Target = C
break
- if (Target)
+ if(Target)
target_patience = rand(5,7)
- if (is_adult)
+ if(is_adult)
target_patience += 3
if(!Target) // If we have no target, we are wandering or following orders
- if (Leader)
- if (holding_still)
+ if(Leader)
+ if(holding_still)
holding_still = max(holding_still - 1, 0)
else if(canmove && isturf(loc))
step_to(src, Leader)
else if(hungry)
- if (holding_still)
+ if(holding_still)
holding_still = max(holding_still - hungry, 0)
else if(canmove && isturf(loc) && prob(50))
step(src, pick(cardinal))
else
- if (holding_still)
+ if(holding_still)
holding_still = max(holding_still - 1, 0)
else if(canmove && isturf(loc) && prob(33))
step(src, pick(cardinal))
@@ -370,85 +371,85 @@
/mob/living/carbon/slime/proc/handle_speech_and_mood()
//Mood starts here
var/newmood = ""
- if (rabid || attacked) newmood = "angry"
- else if (Target) newmood = "mischevous"
+ if(rabid || attacked) newmood = "angry"
+ else if(Target) newmood = "mischevous"
- if (!newmood)
- if (Discipline && prob(25))
+ if(!newmood)
+ if(Discipline && prob(25))
newmood = "pout"
- else if (prob(1))
+ else if(prob(1))
newmood = pick("sad", ":3", "pout")
- if ((mood == "sad" || mood == ":3" || mood == "pout") && !newmood)
- if (prob(75)) newmood = mood
+ if((mood == "sad" || mood == ":3" || mood == "pout") && !newmood)
+ if(prob(75)) newmood = mood
- if (newmood != mood) // This is so we don't redraw them every time
+ if(newmood != mood) // This is so we don't redraw them every time
mood = newmood
regenerate_icons()
//Speech understanding starts here
var/to_say
- if (speech_buffer.len > 0)
+ if(speech_buffer.len > 0)
var/who = speech_buffer[1] // Who said it?
var/phrase = speech_buffer[2] // What did they say?
- if ((findtext(phrase, num2text(number)) || findtext(phrase, "slimes"))) // Talking to us
- if (findtext(phrase, "hello") || findtext(phrase, "hi"))
+ if((findtext(phrase, num2text(number)) || findtext(phrase, "slimes"))) // Talking to us
+ if(findtext(phrase, "hello") || findtext(phrase, "hi"))
to_say = pick("Hello...", "Hi...")
- else if (findtext(phrase, "follow"))
- if (Leader)
- if (Leader == who) // Already following him
+ else if(findtext(phrase, "follow"))
+ if(Leader)
+ if(Leader == who) // Already following him
to_say = pick("Yes...", "Lead...", "Following...")
- else if (Friends[who] > Friends[Leader]) // VIVA
+ else if(Friends[who] > Friends[Leader]) // VIVA
Leader = who
to_say = "Yes... I follow [who]..."
else
to_say = "No... I follow [Leader]..."
else
- if (Friends[who] > 2)
+ if(Friends[who] > 2)
Leader = who
to_say = "I follow..."
else // Not friendly enough
to_say = pick("No...", "I won't follow...")
- else if (findtext(phrase, "stop"))
- if (Victim) // We are asked to stop feeding
- if (Friends[who] > 4)
+ else if(findtext(phrase, "stop"))
+ if(Victim) // We are asked to stop feeding
+ if(Friends[who] > 4)
Victim = null
Target = null
- if (Friends[who] < 7)
+ if(Friends[who] < 7)
--Friends[who]
to_say = "Grrr..." // I'm angry but I do it
else
to_say = "Fine..."
- else if (Target) // We are asked to stop chasing
- if (Friends[who] > 3)
+ else if(Target) // We are asked to stop chasing
+ if(Friends[who] > 3)
Target = null
- if (Friends[who] < 6)
+ if(Friends[who] < 6)
--Friends[who]
to_say = "Grrr..." // I'm angry but I do it
else
to_say = "Fine..."
- else if (Leader) // We are asked to stop following
- if (Leader == who)
+ else if(Leader) // We are asked to stop following
+ if(Leader == who)
to_say = "Yes... I'll stay..."
Leader = null
else
- if (Friends[who] > Friends[Leader])
+ if(Friends[who] > Friends[Leader])
Leader = null
to_say = "Yes... I'll stop..."
else
to_say = "No... I'll keep following..."
- else if (findtext(phrase, "stay"))
- if (Leader)
- if (Leader == who)
+ else if(findtext(phrase, "stay"))
+ if(Leader)
+ if(Leader == who)
holding_still = Friends[who] * 10
to_say = "Yes... Staying..."
- else if (Friends[who] > Friends[Leader])
+ else if(Friends[who] > Friends[Leader])
holding_still = (Friends[who] - Friends[Leader]) * 10
to_say = "Yes... Staying..."
else
to_say = "No... I'll keep following..."
else
- if (Friends[who] > 2)
+ if(Friends[who] > 2)
holding_still = Friends[who] * 10
to_say = "Yes... Staying..."
else
@@ -456,7 +457,7 @@
speech_buffer = list()
//Speech starts here
- if (to_say)
+ if(to_say)
say (to_say)
else if(prob(1))
emote(pick("bounce","sway","light","vibrate","jiggle"))
@@ -465,83 +466,83 @@
var/slimes_near = -1 // Don't count myself
var/dead_slimes = 0
var/friends_near = list()
- for (var/mob/living/carbon/M in view(7,src))
- if (isslime(M))
+ for(var/mob/living/carbon/M in view(7,src))
+ if(isslime(M))
++slimes_near
- if (M.stat == DEAD)
+ if(M.stat == DEAD)
++dead_slimes
- if (M in Friends)
+ if(M in Friends)
t += 20
friends_near += M
- if (nutrition < get_hunger_nutrition()) t += 10
- if (nutrition < get_starve_nutrition()) t += 10
- if (prob(2) && prob(t))
+ if(nutrition < get_hunger_nutrition()) t += 10
+ if(nutrition < get_starve_nutrition()) t += 10
+ if(prob(2) && prob(t))
var/phrases = list()
- if (Target) phrases += "[Target]... looks tasty..."
- if (nutrition < get_starve_nutrition())
+ if(Target) phrases += "[Target]... looks tasty..."
+ if(nutrition < get_starve_nutrition())
phrases += "So... hungry..."
phrases += "Very... hungry..."
phrases += "Need... food..."
phrases += "Must... eat..."
- else if (nutrition < get_hunger_nutrition())
+ else if(nutrition < get_hunger_nutrition())
phrases += "Hungry..."
phrases += "Where is the food?"
phrases += "I want to eat..."
phrases += "Rawr..."
phrases += "Blop..."
phrases += "Blorble..."
- if (rabid || attacked)
+ if(rabid || attacked)
phrases += "Hrr..."
phrases += "Nhuu..."
phrases += "Unn..."
- if (mood == ":3")
+ if(mood == ":3")
phrases += "Purr..."
- if (attacked)
+ if(attacked)
phrases += "Grrr..."
- if (getToxLoss() > 30)
+ if(getToxLoss() > 30)
phrases += "Cold..."
- if (getToxLoss() > 60)
+ if(getToxLoss() > 60)
phrases += "So... cold..."
phrases += "Very... cold..."
- if (getToxLoss() > 90)
+ if(getToxLoss() > 90)
phrases += "..."
phrases += "C... c..."
- if (Victim)
+ if(Victim)
phrases += "Nom..."
phrases += "Tasty..."
- if (powerlevel > 3) phrases += "Bzzz..."
- if (powerlevel > 5) phrases += "Zap..."
- if (powerlevel > 8) phrases += "Zap... Bzz..."
- if (mood == "sad") phrases += "Bored..."
- if (slimes_near) phrases += "Brother..."
- if (slimes_near > 1) phrases += "Brothers..."
- if (dead_slimes) phrases += "What happened?"
- if (!slimes_near)
+ if(powerlevel > 3) phrases += "Bzzz..."
+ if(powerlevel > 5) phrases += "Zap..."
+ if(powerlevel > 8) phrases += "Zap... Bzz..."
+ if(mood == "sad") phrases += "Bored..."
+ if(slimes_near) phrases += "Brother..."
+ if(slimes_near > 1) phrases += "Brothers..."
+ if(dead_slimes) phrases += "What happened?"
+ if(!slimes_near)
phrases += "Lonely..."
- for (var/M in friends_near)
+ for(var/M in friends_near)
phrases += "[M]... friend..."
- if (nutrition < get_hunger_nutrition())
+ if(nutrition < get_hunger_nutrition())
phrases += "[M]... feed me..."
say (pick(phrases))
/mob/living/carbon/slime/proc/get_max_nutrition() // Can't go above it
- if (is_adult) return 1200
+ if(is_adult) return 1200
else return 1000
/mob/living/carbon/slime/proc/get_grow_nutrition() // Above it we grow, below it we can eat
- if (is_adult) return 1000
+ if(is_adult) return 1000
else return 800
/mob/living/carbon/slime/proc/get_hunger_nutrition() // Below it we will always eat
- if (is_adult) return 600
+ if(is_adult) return 600
else return 500
/mob/living/carbon/slime/proc/get_starve_nutrition() // Below it we will eat before everything else
- if (is_adult) return 300
+ if(is_adult) return 300
else return 200
/mob/living/carbon/slime/proc/will_hunt(var/hunger = -1) // Check for being stopped from feeding and chasing
- if (hunger == 2 || rabid || attacked) return 1
- if (Leader) return 0
- if (holding_still) return 0
+ if(hunger == 2 || rabid || attacked) return 1
+ if(Leader) return 0
+ if(holding_still) return 0
return 1
diff --git a/code/modules/mob/living/carbon/slime/say.dm b/code/modules/mob/living/carbon/slime/say.dm
index 50311ace49e..6d47231792b 100644
--- a/code/modules/mob/living/carbon/slime/say.dm
+++ b/code/modules/mob/living/carbon/slime/say.dm
@@ -2,27 +2,27 @@
var/verb = "telepathically chirps"
var/ending = copytext(text, length(text))
- if (ending == "?")
+ if(ending == "?")
verb = "telepathically asks"
- else if (ending == "!")
+ else if(ending == "!")
verb = "telepathically cries"
return verb
/mob/living/carbon/slime/say_understands(var/other)
- if (istype(other, /mob/living/carbon/slime))
+ if(istype(other, /mob/living/carbon/slime))
return 1
return ..()
/mob/living/carbon/slime/hear_say(var/message, var/verb = "says", var/datum/language/language = null, var/alt_name = "", var/italics = 0, var/mob/speaker = null, var/sound/speech_sound, var/sound_vol)
- if (speaker in Friends)
+ if(speaker in Friends)
speech_buffer = list()
speech_buffer.Add(speaker)
speech_buffer.Add(lowertext(html_decode(message)))
..()
/mob/living/carbon/slime/hear_radio(var/message, var/verb="says", var/datum/language/language=null, var/part_a, var/part_b, var/mob/speaker = null, var/hard_to_hear = 0, var/vname ="", var/atom/follow_target)
- if (speaker in Friends)
+ if(speaker in Friends)
speech_buffer = list()
speech_buffer.Add(speaker)
speech_buffer.Add(lowertext(html_decode(message)))
diff --git a/code/modules/mob/living/carbon/slime/slime.dm b/code/modules/mob/living/carbon/slime/slime.dm
index 9ed50676e75..634e9865e45 100644
--- a/code/modules/mob/living/carbon/slime/slime.dm
+++ b/code/modules/mob/living/carbon/slime/slime.dm
@@ -75,12 +75,12 @@
/mob/living/carbon/slime/regenerate_icons()
icon_state = "[colour] [is_adult ? "adult" : "baby"] slime"
overlays.len = 0
- if (mood)
+ if(mood)
overlays += image('icons/mob/slimes.dmi', icon_state = "aslime-[mood]")
..()
/mob/living/carbon/slime/movement_delay()
- if (bodytemperature >= 330.23) // 135 F
+ if(bodytemperature >= 330.23) // 135 F
return -1 // slimes become supercharged at high temperatures
var/tally = 0
@@ -88,7 +88,7 @@
var/health_deficiency = (100 - health)
if(health_deficiency >= 45) tally += (health_deficiency / 25)
- if (bodytemperature < 183.222)
+ if(bodytemperature < 183.222)
tally += (283.222 - bodytemperature) / 10 * 1.75
if(reagents)
@@ -104,7 +104,7 @@
return tally + config.slime_delay
/mob/living/carbon/slime/Bump(atom/movable/AM as mob|obj, yes)
- if ((!(yes) || now_pushing))
+ if((!(yes) || now_pushing))
return
now_pushing = 1
@@ -121,7 +121,7 @@
if(prob(probab))
if(istype(AM, /obj/structure/window) || istype(AM, /obj/structure/grille))
if(nutrition <= get_hunger_nutrition() && !Atkcool)
- if (is_adult || prob(5))
+ if(is_adult || prob(5))
AM.attack_slime(src)
spawn()
Atkcool = 1
@@ -143,13 +143,13 @@
now_pushing = 0
..()
- if (!istype(AM, /atom/movable))
+ if(!istype(AM, /atom/movable))
return
- if (!( now_pushing ))
+ if(!( now_pushing ))
now_pushing = 1
- if (!( AM.anchored ))
+ if(!( AM.anchored ))
var/t = get_dir(src, AM)
- if (istype(AM, /obj/structure/window))
+ if(istype(AM, /obj/structure/window))
if(AM:ini_dir == NORTHWEST || AM:ini_dir == NORTHEAST || AM:ini_dir == SOUTHWEST || AM:ini_dir == SOUTHEAST)
for(var/obj/structure/window/win in get_step(AM,t))
now_pushing = 0
@@ -169,7 +169,7 @@
else
stat(null, "Health: [round((health / 150) * 100)]%")
- if (client.statpanel == "Status")
+ if(client.statpanel == "Status")
stat(null, "Nutrition: [nutrition]/[get_max_nutrition()]")
if(amount_grown >= 10)
if(is_adult)
@@ -197,12 +197,12 @@
var/b_loss = null
var/f_loss = null
- switch (severity)
- if (1.0)
+ switch(severity)
+ if(1.0)
qdel(src)
return
- if (2.0)
+ if(2.0)
b_loss += 60
f_loss += 60
@@ -231,13 +231,13 @@
return
/mob/living/carbon/slime/attack_slime(mob/living/carbon/slime/M as mob)
- if (!ticker)
+ if(!ticker)
to_chat(M, "You cannot attack people before the game has started.")
return
- if (Victim) return // can't attack while eating!
+ if(Victim) return // can't attack while eating!
- if (health > -100)
+ if(health > -100)
M.do_attack_animation(src)
visible_message(" The [M.name] has glomped [src]!", \
@@ -292,11 +292,11 @@
adjustBruteLoss(damage)
/mob/living/carbon/slime/attack_hand(mob/living/carbon/human/M as mob)
- if (!ticker)
+ if(!ticker)
to_chat(M, "You cannot attack people before the game has started.")
return
- if (istype(loc, /turf) && istype(loc.loc, /area/start))
+ if(istype(loc, /turf) && istype(loc.loc, /area/start))
to_chat(M, "No attacking people at spawn, you jackass.")
return
@@ -377,10 +377,10 @@
switch(M.a_intent)
- if (I_HELP)
+ if(I_HELP)
help_shake_act(M)
- if (I_GRAB)
+ if(I_GRAB)
grabbedby(M)
else
@@ -388,8 +388,8 @@
var/damage = rand(1, 9)
attacked += 10
- if (prob(90))
- if (HULK in M.mutations)
+ if(prob(90))
+ if(HULK in M.mutations)
damage += 15
if(Victim || Target)
Victim = null
@@ -418,25 +418,25 @@
/mob/living/carbon/slime/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
- if (!ticker)
+ if(!ticker)
to_chat(M, "You cannot attack people before the game has started.")
return
- if (istype(loc, /turf) && istype(loc.loc, /area/start))
+ if(istype(loc, /turf) && istype(loc.loc, /area/start))
to_chat(M, "No attacking people at spawn, you jackass.")
return
switch(M.a_intent)
- if (I_HELP)
+ if(I_HELP)
visible_message("[M] caresses [src] with its scythe like arm.")
- if (I_HARM)
+ if(I_HARM)
M.do_attack_animation(src)
- if (prob(95))
+ if(prob(95))
attacked += 10
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
var/damage = rand(15, 30)
- if (damage >= 25)
+ if(damage >= 25)
damage = rand(20, 40)
visible_message("[M] has attacked [name]!", \
"[M] has attacked [name]!")
@@ -450,10 +450,10 @@
visible_message("[M] has attempted to lunge at [name]!", \
"[M] has attempted to lunge at [name]!")
- if (I_GRAB)
+ if(I_GRAB)
grabbedby(M)
- if (I_DISARM)
+ if(I_DISARM)
M.do_attack_animation(src)
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
var/damage = 5
@@ -499,7 +499,7 @@
if(S.next_step(user, src))
return 1
if(istype(W,/obj/item/stack/sheet/mineral/plasma)) //Lets you feed slimes plasma.
- if (user in Friends)
+ if(user in Friends)
++Friends[user]
else
Friends[user] = 1
@@ -580,8 +580,8 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75
/mob/living/carbon/slime/proc/apply_water()
adjustToxLoss(rand(15,20))
- if (!client)
- if (Target) // Like cats
+ if(!client)
+ if(Target) // Like cats
Target = null
++Discipline
return
diff --git a/code/modules/mob/living/carbon/superheroes.dm b/code/modules/mob/living/carbon/superheroes.dm
index 1ad57bd787d..23233fd5e09 100644
--- a/code/modules/mob/living/carbon/superheroes.dm
+++ b/code/modules/mob/living/carbon/superheroes.dm
@@ -33,8 +33,9 @@
if(default_spells.len)
for(var/spell in default_spells)
var/obj/effect/proc_holder/spell/S = spell
- if(!S) return
- H.AddSpell(new S)
+ if(!S)
+ return
+ H.mind.AddSpell(new S(null))
/datum/superheroes/proc/assign_id(var/mob/living/carbon/human/H)
var/obj/item/weapon/card/id/syndicate/W = new(H)
@@ -191,14 +192,14 @@
if(isloyal(target))
to_chat(usr, "They are enslaved by Nanotrasen. You feel their interest in your cause wane and disappear.")
usr.visible_message("[usr] stops talking for a moment, then moves back away from [target].")
- to_chat(target, "Your loyalty implant activates and a sharp pain reminds you of your loyalties to Nanotrasen.")
+ to_chat(target, "Your mindshield implant activates, protecting you from conversion.")
return
if(3)
to_chat(usr, "You begin filling out the application form with [target].")
usr.visible_message("[usr] pulls out a pen and paper and begins filling an application form with [target].")
to_chat(target, "You are being convinced by [usr] to fill out an application form to become a henchman.")//Ow the edge
- if(!do_mob(usr, target, 100)) //around 30 seconds total for enthralling, 45 for someone with a loyalty implant
+ if(!do_mob(usr, target, 100)) //around 30 seconds total for enthralling, 45 for someone with a mindshield implant
to_chat(usr, "The enrollment process has been interrupted - you have lost the attention of [target].")
to_chat(target, "You move away and are no longer under the charm of [usr]. The application form is null and void.")
recruiting = 0
diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm
index 866c01c9702..921080c989a 100644
--- a/code/modules/mob/living/damage_procs.dm
+++ b/code/modules/mob/living/damage_procs.dm
@@ -8,7 +8,7 @@
Returns
standard 0 if fail
*/
-/mob/living/proc/apply_damage(var/damage = 0,var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/used_weapon = null, var/sharp = 0, var/edge = 0)
+/mob/living/proc/apply_damage(var/damage = 0, var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/sharp = 0, var/edge = 0, var/used_weapon = null)
blocked = (100-blocked)/100
if(!damage || (blocked <= 0)) return 0
switch(damagetype)
diff --git a/code/modules/mob/living/death.dm b/code/modules/mob/living/death.dm
index 14585f6ae21..e17d9af6250 100644
--- a/code/modules/mob/living/death.dm
+++ b/code/modules/mob/living/death.dm
@@ -2,4 +2,5 @@
blinded = max(blinded, 1)
clear_fullscreens()
+ update_action_buttons_icon()
..(gibbed)
\ No newline at end of file
diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm
index 85526945b54..a151a062bce 100644
--- a/code/modules/mob/living/life.dm
+++ b/code/modules/mob/living/life.dm
@@ -49,9 +49,7 @@
handle_disabilities() // eye, ear, brain damages
handle_status_effects() //all special effects, stunned, weakened, jitteryness, hallucination, sleeping, etc
- handle_actions()
-
- update_canmove()
+ update_canmove(1) // set to 1 to not update icon action buttons; rip this argument out if Life is ever refactored to be non-stupid. -Fox
if(client)
//regular_hud_updates() //THIS DOESN'T FUCKING UPDATE SHIT
@@ -95,7 +93,7 @@
if(paralysis)
stat = UNCONSCIOUS
- else if (status_flags & FAKEDEATH)
+ else if(status_flags & FAKEDEATH)
stat = UNCONSCIOUS
else
@@ -114,6 +112,7 @@
handle_paralysed()
handle_sleeping()
handle_slowed()
+ handle_drunk()
/mob/living/proc/handle_stunned()
@@ -168,9 +167,14 @@
slowed = max(slowed-1, 0)
return slowed
+/mob/living/proc/handle_drunk()
+ if(drunk)
+ AdjustDrunk(-1)
+ return drunk
+
/mob/living/proc/handle_disabilities()
//Eyes
- if(sdisabilities & BLIND || stat) //blindness from disability or unconsciousness doesn't get better on its own
+ if(disabilities & BLIND || stat) //blindness from disability or unconsciousness doesn't get better on its own
eye_blind = max(eye_blind, 1)
else if(eye_blind) //blindness, heals slowly over time
eye_blind = max(eye_blind-1,0)
@@ -191,7 +195,6 @@
handle_vision()
handle_hud_icons()
- update_action_buttons()
return 1
@@ -241,86 +244,8 @@
/mob/living/proc/handle_hud_icons_health()
return
-/mob/living/proc/handle_actions()
- //Pretty bad, i'd use picked/dropped instead but the parent calls in these are nonexistent
- for(var/datum/action/A in actions)
- if(A.CheckRemoval(src))
- A.Remove(src)
- for(var/obj/item/I in src)
- give_action_button(I, 1)
- return
-
-/mob/living/proc/give_action_button(var/obj/item/I, recursive = 0)
- if(I.action_button_name)
- if(!I.action)
- if(I.action_button_custom_type)
- I.action = new I.action_button_custom_type
- else
- I.action = new /datum/action/item_action
- I.action.name = I.action_button_name
- I.action.target = I
- I.action.Grant(src)
-
- if(recursive)
- for(var/obj/item/T in I)
- give_action_button(T, recursive - 1)
-
-/mob/living/update_action_buttons()
- if(!hud_used) return
- if(!client) return
-
- if(!hud_used.hud_shown)
- return
-
- client.screen -= hud_used.hide_actions_toggle
- for(var/datum/action/A in actions)
- if(A.button)
- client.screen -= A.button
-
- if(hud_used.action_buttons_hidden)
- if(!hud_used.hide_actions_toggle)
- hud_used.hide_actions_toggle = new(hud_used)
- hud_used.hide_actions_toggle.UpdateIcon()
-
- if(!hud_used.hide_actions_toggle.moved)
- hud_used.hide_actions_toggle.screen_loc = hud_used.ButtonNumberToScreenCoords(1)
- //hud_used.SetButtonCoords(hud_used.hide_actions_toggle,1)
-
- client.screen += hud_used.hide_actions_toggle
- return
-
- var/button_number = 0
- for(var/datum/action/A in actions)
- button_number++
- if(A.button == null)
- var/obj/screen/movable/action_button/N = new(hud_used)
- N.owner = A
- A.button = N
-
- var/obj/screen/movable/action_button/B = A.button
-
- B.UpdateIcon()
-
- B.name = A.UpdateName()
-
- client.screen += B
-
- if(!B.moved)
- B.screen_loc = hud_used.ButtonNumberToScreenCoords(button_number)
- //hud_used.SetButtonCoords(B,button_number)
-
- if(button_number > 0)
- if(!hud_used.hide_actions_toggle)
- hud_used.hide_actions_toggle = new(hud_used)
- hud_used.hide_actions_toggle.InitialiseIcon(src)
- if(!hud_used.hide_actions_toggle.moved)
- hud_used.hide_actions_toggle.screen_loc = hud_used.ButtonNumberToScreenCoords(button_number+1)
- //hud_used.SetButtonCoords(hud_used.hide_actions_toggle,button_number+1)
- client.screen += hud_used.hide_actions_toggle
-
-
/mob/living/proc/process_nations()
if(client)
var/client/C = client
for(var/mob/living/carbon/human/H in view(src, world.view))
- C.images += H.hud_list[NATIONS_HUD]
\ No newline at end of file
+ C.images += H.hud_list[NATIONS_HUD]
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index f28e884f92f..60c26dc4a50 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -3,6 +3,9 @@
..()
return QDEL_HINT_HARDDEL_NOW
+/mob/living/proc/OpenCraftingMenu()
+ return
+
/mob/living/Stat()
. = ..()
if(. && get_rig_stats)
@@ -15,6 +18,7 @@
var/turf/T = get_turf(src)
if(!T)
return 0
+ // TODO: Tie into space manager
if(T.z == ZLEVEL_CENTCOMM) //dont detect mobs on centcomm
return 0
if(T.z >= MAX_Z)
@@ -55,7 +59,7 @@
/mob/living/verb/succumb()
set hidden = 1
- if (InCritical())
+ if(InCritical())
attack_log += "[src] has ["succumbed to death"] with [round(health, 0.1)] points of health!"
adjustOxyLoss(health - config.health_threshold_dead)
updatehealth()
@@ -88,22 +92,6 @@
/mob/living/proc/calculate_affecting_pressure(var/pressure)
return 0
-
-//sort of a legacy burn method for /electrocute, /shock, and the e_chair
-/mob/living/proc/burn_skin(burn_amount)
- if(istype(src, /mob/living/carbon/human))
- var/mob/living/carbon/human/H = src //make this damage method divide the damage to be done among all the body parts, then burn each body part for that much damage. will have better effect then just randomly picking a body part
- var/divided_damage = (burn_amount)/(H.organs.len)
- var/extradam = 0 //added to when organ is at max dam
- for(var/obj/item/organ/external/affecting in H.organs)
- if(!affecting) continue
- if(affecting.take_damage(0, divided_damage+extradam)) //TODO: fix the extradam stuff. Or, ebtter yet...rewrite this entire proc ~Carn
- H.UpdateDamageIcon()
- H.updatehealth()
- return 1
- else if(istype(src, /mob/living/silicon/ai))
- return 0
-
/mob/living/proc/adjustBodyTemp(actual, desired, incrementboost)
var/temperature = actual
var/difference = abs(actual-desired) //get difference
@@ -271,7 +259,7 @@
/mob/living/proc/get_organ_target()
var/mob/shooter = src
var/t = shooter:zone_sel.selecting
- if ((t in list( "eyes", "mouth" )))
+ if((t in list( "eyes", "mouth" )))
t = "head"
var/obj/item/organ/external/def_zone = ran_zone(t)
return def_zone
@@ -323,12 +311,12 @@
if(iscarbon(src))
var/mob/living/carbon/C = src
- if (C.handcuffed && !initial(C.handcuffed))
+ if(C.handcuffed && !initial(C.handcuffed))
C.unEquip(C.handcuffed)
C.handcuffed = initial(C.handcuffed)
C.update_handcuffed()
- if (C.legcuffed && !initial(C.legcuffed))
+ if(C.legcuffed && !initial(C.legcuffed))
C.unEquip(C.legcuffed)
C.legcuffed = initial(C.legcuffed)
C.update_inv_legcuffed()
@@ -343,7 +331,7 @@
dead_mob_list -= src
living_mob_list |= src
mob_list |= src
- ear_deaf = 0
+ setEarDamage(-1,0)
timeofdeath = 0
/mob/living/proc/rejuvenate()
@@ -370,13 +358,11 @@
hallucination = 0
nutrition = 400
bodytemperature = 310
- sdisabilities = 0
disabilities = 0
blinded = 0
eye_blind = 0
eye_blurry = 0
- ear_deaf = 0
- ear_damage = 0
+ setEarDamage(0,0)
heal_overall_damage(1000, 1000)
ExtinguishMob()
fire_stacks = 0
@@ -440,26 +426,26 @@
return
/mob/living/Move(atom/newloc, direct)
- if (buckled && buckled.loc != newloc) //not updating position
- if (!buckled.anchored)
+ if(buckled && buckled.loc != newloc) //not updating position
+ if(!buckled.anchored)
return buckled.Move(newloc, direct)
else
return 0
- if (restrained())
+ if(restrained())
stop_pulling()
var/t7 = 1
- if (restrained())
+ if(restrained())
for(var/mob/living/M in range(src, 1))
- if ((M.pulling == src && M.stat == 0 && !( M.restrained() )))
+ if((M.pulling == src && M.stat == 0 && !( M.restrained() )))
t7 = null
if(t7 && pulling && (get_dist(src, pulling) <= 1 || pulling.loc == loc))
var/turf/T = loc
. = ..()
- if (pulling && pulling.loc)
+ if(pulling && pulling.loc)
if(!( isturf(pulling.loc) ))
stop_pulling()
return
@@ -473,46 +459,46 @@
stop_pulling()
return
- if (!restrained())
+ if(!restrained())
var/diag = get_dir(src, pulling)
- if ((diag - 1) & diag)
+ if((diag - 1) & diag)
else
diag = null
- if ((get_dist(src, pulling) > 1 || diag))
- if (isliving(pulling))
+ if((get_dist(src, pulling) > 1 || diag))
+ if(isliving(pulling))
var/mob/living/M = pulling
var/ok = 1
- if (locate(/obj/item/weapon/grab, M.grabbed_by))
- if (prob(75))
+ if(locate(/obj/item/weapon/grab, M.grabbed_by))
+ if(prob(75))
var/obj/item/weapon/grab/G = pick(M.grabbed_by)
- if (istype(G, /obj/item/weapon/grab))
+ if(istype(G, /obj/item/weapon/grab))
for(var/mob/O in viewers(M, null))
O.show_message(text("\red [] has been pulled from []'s grip by []", G.affecting, G.assailant, src), 1)
//G = null
qdel(G)
else
ok = 0
- if (locate(/obj/item/weapon/grab, M.grabbed_by.len))
+ if(locate(/obj/item/weapon/grab, M.grabbed_by.len))
ok = 0
- if (ok)
+ if(ok)
var/atom/movable/t = M.pulling
M.stop_pulling()
- if (M.lying && (prob(M.getBruteLoss() / 6)))
+ if(M.lying && (prob(M.getBruteLoss() / 6)))
var/turf/location = M.loc
- if (istype(location, /turf/simulated))
+ if(istype(location, /turf/simulated))
location.add_blood(M)
pulling.Move(T, get_dir(pulling, T))
if(M)
M.start_pulling(t)
else
- if (pulling)
+ if(pulling)
pulling.Move(T, get_dir(pulling, T))
else
stop_pulling()
. = ..()
- if (s_active && !( s_active in contents ) && get_turf(s_active) != get_turf(src)) //check !( s_active in contents ) first so we hopefully don't have to call get_turf() so much.
+ if(s_active && !( s_active in contents ) && get_turf(s_active) != get_turf(src)) //check !( s_active in contents ) first so we hopefully don't have to call get_turf() so much.
s_active.close(src)
if(.) // did we actually move?
@@ -588,9 +574,6 @@
visible_message("[src] resists!")
return 1
-/mob/living/proc/resist_borer()
- return
-
/mob/living/proc/resist_buckle()
spawn(0)
resist_muzzle()
@@ -646,7 +629,7 @@
//called when the mob receives a bright flash
/mob/living/proc/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash)
- if(check_eye_prot() < intensity && (override_blindness_check || !(sdisabilities & BLIND)))
+ if(check_eye_prot() < intensity && (override_blindness_check || !(disabilities & BLIND)))
overlay_fullscreen("flash", type)
addtimer(src, "clear_fullscreen", 25, FALSE, "flash", 25)
return 1
@@ -837,6 +820,15 @@
/mob/living/proc/get_permeability_protection()
return 0
+/mob/living/proc/attempt_harvest(obj/item/I, mob/user)
+ if(stat == DEAD && !isnull(butcher_results)) //can we butcher it?
+ if(istype(I, /obj/item/weapon/kitchen/knife))
+ to_chat(user, "You begin to butcher [src]...")
+ playsound(loc, 'sound/weapons/slice.ogg', 50, 1, -1)
+ if(do_mob(user, src, 80))
+ harvest(user)
+ return 1
+
/mob/living/proc/harvest(mob/living/user)
if(qdeleted(src))
return
@@ -855,3 +847,9 @@
tally += 10
return tally
+
+/mob/living/proc/can_use_guns(var/obj/item/weapon/gun/G)
+ if(G.trigger_guard != TRIGGER_GUARD_ALLOW_ALL && !IsAdvancedToolUser())
+ to_chat(src, "You don't have the dexterity to do this!")
+ return 0
+ return 1
diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm
index 4d994436489..50576bcecad 100644
--- a/code/modules/mob/living/living_defense.dm
+++ b/code/modules/mob/living/living_defense.dm
@@ -43,14 +43,10 @@
var/armor = run_armor_check(def_zone, P.flag, armour_penetration = P.armour_penetration)
var/proj_sharp = is_sharp(P)
var/proj_edge = has_edge(P)
- if ((proj_sharp || proj_edge) && prob(getarmor(def_zone, P.flag)))
+ if((proj_sharp || proj_edge) && prob(getarmor(def_zone, P.flag)))
proj_sharp = 0
proj_edge = 0
- if(istype(P, /obj/item/projectile/beam/lightning)) //Stupid snowflake lightning gun.
- if(P.damage >= 200)
- src.dust()
-
if(!P.nodamage)
apply_damage(P.damage, P.damage_type, def_zone, armor)
return P.on_hit(src, armor, def_zone)
@@ -66,49 +62,40 @@
//this proc handles being hit by a thrown atom
/mob/living/hitby(atom/movable/AM as mob|obj,var/speed = 5)//Standardization and logging -Sieve
- if(istype(AM,/obj/))
- var/obj/O = AM
+ if(istype(AM, /obj/item))
+ var/obj/item/I = AM
var/zone = ran_zone("chest", 65)//Hits a random part of the body, geared towards the chest
var/dtype = BRUTE
- if(istype(O,/obj/item/weapon))
- var/obj/item/weapon/W = O
+ if(istype(I, /obj/item/weapon))
+ var/obj/item/weapon/W = I
dtype = W.damtype
- if (W.hitsound && W.throwforce > 0)
+ if(W.hitsound && W.throwforce > 0)
playsound(loc, W.hitsound, 30, 1, -1)
//run to-hit check here
- var/throw_damage = O.throwforce*(speed/5)
+ var/throw_damage = I.throwforce*(speed/5)
- //var/miss_chance = 15
- //if (O.throw_source)
- //var/distance = get_dist(O.throw_source, loc)
- //miss_chance = min(15*(distance-2), 0)
- /*
- if (prob(miss_chance))
- visible_message("\blue \The [O] misses [src] narrowly!")
- return
- */
- src.visible_message("\red [src] has been hit by [O].")
- var/armor = run_armor_check(zone, "melee")
+ src.visible_message("\red [src] has been hit by [I].")
+ var/armor = run_armor_check(zone, "melee", "Your armor has protected your [parse_zone(zone)].", "Your armor has softened hit to your [parse_zone(zone)].", I.armour_penetration)
- apply_damage(throw_damage, dtype, zone, armor, is_sharp(O), has_edge(O), O)
+ apply_damage(throw_damage, dtype, zone, armor, is_sharp(I), has_edge(I), I)
- O.throwing = 0 //it hit, so stop moving
+ I.throwing = 0 //it hit, so stop moving
- if(ismob(O.thrower))
- var/mob/M = O.thrower
+ if(ismob(I.thrower))
+ var/mob/M = I.thrower
if(M)
- src.attack_log += text("\[[time_stamp()]\] Has been hit with a [O], thrown by [key_name(M)]")
- M.attack_log += text("\[[time_stamp()]\] Hit [key_name(src)] with a thrown [O]")
+ attack_log += text("\[[time_stamp()]\] Has been hit with a [I], thrown by [key_name(M)]")
+ M.attack_log += text("\[[time_stamp()]\] Hit [key_name(src)] with a thrown [I]")
if(!istype(src,/mob/living/simple_animal/mouse))
- msg_admin_attack("[key_name_admin(src)] was hit by a [O], thrown by [key_name_admin(M)]")
+ msg_admin_attack("[key_name_admin(src)] was hit by a [I], thrown by [key_name_admin(M)]")
// Begin BS12 momentum-transfer code.
- if(O.throw_source && speed >= 15)
- var/obj/item/weapon/W = O
+ if(I.throw_source && speed >= 15)
+ var/obj/item/weapon/W = I
var/momentum = speed/2
- var/dir = get_dir(O.throw_source, src)
+ var/dir = get_dir(I.throw_source, src)
visible_message("\red [src] staggers under the impact!","\red You stagger under the impact!")
src.throw_at(get_edge_target_turf(src,dir),1,momentum)
@@ -117,16 +104,16 @@
if(W.sharp) //Projectile is suitable for pinning.
//Handles embedding for non-humans and simple_animals.
- O.loc = src
- src.embedded += O
+ I.loc = src
+ embedded += I
var/turf/T = near_wall(dir,2)
if(T)
src.loc = T
- visible_message("[src] is pinned to the wall by [O]!","You are pinned to the wall by [O]!")
+ visible_message("[src] is pinned to the wall by [I]!","You are pinned to the wall by [I]!")
src.anchored = 1
- src.pinned += O
+ src.pinned += I
/mob/living/mech_melee_attack(obj/mecha/M)
if(M.occupant.a_intent == I_HARM)
@@ -164,9 +151,13 @@
/mob/living/proc/IgniteMob()
if(fire_stacks > 0 && !on_fire)
on_fire = 1
+ visible_message("[src] catches fire!", \
+ "You're set on fire!")
set_light(light_range + 3,l_color = "#ED9200")
throw_alert("fire", /obj/screen/alert/fire)
update_fire()
+ return 1
+ return 0
/mob/living/proc/ExtinguishMob()
if(on_fire)
@@ -180,14 +171,20 @@
return
/mob/living/proc/adjust_fire_stacks(add_fire_stacks) //Adjusting the amount of fire_stacks we have on person
- fire_stacks = Clamp(fire_stacks + add_fire_stacks, -20, 20)
+ fire_stacks = Clamp(fire_stacks + add_fire_stacks, -20, 20)
+ if(on_fire && fire_stacks <= 0)
+ ExtinguishMob()
/mob/living/proc/handle_fire()
- if(fire_stacks < 0)
- fire_stacks++ //If we've doused ourselves in water to avoid fire, dry off slowly
- fire_stacks = min(0, fire_stacks)//So we dry ourselves back to default, nonflammable.
+ if(fire_stacks < 0) //If we've doused ourselves in water to avoid fire, dry off slowly
+ fire_stacks = min(0, fire_stacks + 1)//So we dry ourselves back to default, nonflammable.
if(!on_fire)
return 1
+ if(fire_stacks > 0)
+ adjust_fire_stacks(-0.1) //the fire is slowly consumed
+ else
+ ExtinguishMob()
+ return
var/datum/gas_mixture/G = loc.return_air() // Check if we're standing in an oxygenless environment
if(G.oxygen < 1)
ExtinguishMob() //If there's no oxygen in the tile we're on, put out the fire
@@ -196,7 +193,7 @@
location.hotspot_expose(700, 50, 1)
/mob/living/fire_act()
- adjust_fire_stacks(0.5)
+ adjust_fire_stacks(3)
IgniteMob()
//Mobs on Fire end
diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm
index ce73ae369c0..19dc6f99cd1 100644
--- a/code/modules/mob/living/living_defines.dm
+++ b/code/modules/mob/living/living_defines.dm
@@ -7,10 +7,10 @@
//Damage related vars, NOTE: THESE SHOULD ONLY BE MODIFIED BY PROCS
- var/bruteloss = 0.0 //Brutal damage caused by brute force (punching, being clubbed by a toolbox ect... this also accounts for pressure damage)
- var/oxyloss = 0.0 //Oxygen depravation damage (no air in lungs)
- var/toxloss = 0.0 //Toxic damage caused by being poisoned or radiated
- var/fireloss = 0.0 //Burn damage caused by being way too hot, too cold or burnt.
+ var/bruteloss = 0 //Brutal damage caused by brute force (punching, being clubbed by a toolbox ect... this also accounts for pressure damage)
+ var/oxyloss = 0 //Oxygen depravation damage (no air in lungs)
+ var/toxloss = 0 //Toxic damage caused by being poisoned or radiated
+ var/fireloss = 0 //Burn damage caused by being way too hot, too cold or burnt.
var/cloneloss = 0 //Damage caused by being cloned or ejected from the cloner early. slimes also deal cloneloss damage to victims
var/brainloss = 0 //'Retardation' damage caused by someone hitting you in the head with a bible or being infected with brainrot.
var/staminaloss = 0 //Stamina damage, or exhaustion. You recover it slowly naturally, and are stunned if it gets too high. Holodeck and hallucinations deal this.
@@ -23,11 +23,6 @@
//Allows mobs to move through dense areas without restriction. For instance, in space or out of holder objects.
var/incorporeal_move = 0 //0 is off, 1 is normal, 2 is for ninjas.
- var/t_plasma = null
- var/t_oxygen = null
- var/t_sl_gas = null
- var/t_n2 = null
-
var/now_pushing = null
var/atom/movable/cameraFollow = null
@@ -36,9 +31,8 @@
var/fire_stacks = 0 //Tracks how many stacks of fire we have on, max is usually 20
var/update_slimes = 1
- var/specialsauce = 0 //Has this person consumed enough special sauce? IF so they're a ticking time bomb of death.
var/implanting = 0 //Used for the mind-slave implant
- var/silent = null //Can't talk. Value goes down every life proc.
+ var/silent = 0 //Can't talk. Value goes down every life proc. //NOTE TO FUTURE CODERS: DO NOT INITIALIZE NUMERICAL VARS AS NULL OR I WILL MURDER YOU.
var/floating = 0
var/nightvision = 0
@@ -49,9 +43,12 @@
var/list/icon/pipes_shown = list()
var/last_played_vent
- var/list/datum/action/actions = list()
var/step_count = 0
var/list/butcher_results = null
- var/list/surgeries = list() //a list of surgery datums. generally empty, they're added when the player wants them.
\ No newline at end of file
+ var/list/weather_immunities = list()
+
+ var/list/surgeries = list() //a list of surgery datums. generally empty, they're added when the player wants them.
+
+ var/gene_stability = DEFAULT_GENE_STABILITY
diff --git a/code/modules/mob/living/logout.dm b/code/modules/mob/living/logout.dm
index b79d822d80b..71e26e60858 100644
--- a/code/modules/mob/living/logout.dm
+++ b/code/modules/mob/living/logout.dm
@@ -1,6 +1,6 @@
/mob/living/Logout()
..()
- if (mind)
+ if(mind)
if(!key) //key and mind have become seperated. I believe this is for when a staff member aghosts.
mind.active = 0 //This is to stop say, a mind.transfer_to call on a corpse causing a ghost to re-enter its body.
//This causes instant sleep and tags a player as SSD. See life.dm for furthering SSD.
diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm
index c6d0d8e3ee0..dbcefec7365 100644
--- a/code/modules/mob/living/say.dm
+++ b/code/modules/mob/living/say.dm
@@ -28,7 +28,8 @@ var/list/department_radio_keys = list(
":T" = "Syndicate", "#T" = "Syndicate", ".T" = "Syndicate",
":U" = "Supply", "#U" = "Supply", ".U" = "Supply",
":Z" = "Service", "#Z" = "Service", ".Z" = "Service",
- ":P" = "AI Private", "#P" = "AI Private", ".P" = "AI Private"
+ ":P" = "AI Private", "#P" = "AI Private", ".P" = "AI Private",
+ ":-" = "Special Ops", "#-" = "Special Ops", ".-" = "Special Ops"
)
@@ -47,22 +48,7 @@ proc/get_radio_key_from_channel(var/channel)
return key
/mob/living/proc/binarycheck()
-
- if (istype(src, /mob/living/silicon/pai))
- return
-
- if (!ishuman(src))
- return
-
- var/mob/living/carbon/human/H = src
- if (H.l_ear || H.r_ear)
- var/obj/item/device/radio/headset/dongle
- if(istype(H.l_ear,/obj/item/device/radio/headset))
- dongle = H.l_ear
- else
- dongle = H.r_ear
- if(!istype(dongle)) return
- if(dongle.translate_binary) return 1
+ return FALSE
/mob/living/proc/get_default_language()
return default_language
@@ -93,10 +79,7 @@ proc/get_radio_key_from_channel(var/channel)
verb = "stammers"
speech_problem_flag = 1
- if(GREY in mutations)
- message = "[message]"
-
- else if(COMIC in mutations)
+ if(COMIC in mutations)
message = "[message]"
if(!IsVocal())
@@ -125,27 +108,27 @@ proc/get_radio_key_from_channel(var/channel)
/mob/living/say(var/message, var/datum/language/speaking = null, var/verb = "says", var/alt_name="")
if(client)
if(client.prefs.muted & MUTE_IC)
- to_chat(src, "\red You cannot speak in IC (Muted).")
+ to_chat(src, "You cannot speak in IC (Muted).")
return
message = trim_strip_html_properly(message)
if(stat)
- if(stat == 2)
+ if(stat == DEAD)
return say_dead(message)
return
var/message_mode = parse_message_mode(message, "headset")
- if(copytext(message,1,2) == "*")
- return emote(copytext(message,2))
+ if(copytext(message, 1, 2) == "*")
+ return emote(copytext(message, 2))
//parse the radio code and consume it
- if (message_mode)
- if (message_mode == "headset")
- message = copytext(message,2) //it would be really nice if the parse procs could do this for us.
+ if(message_mode)
+ if(message_mode == "headset")
+ message = copytext(message, 2) //it would be really nice if the parse procs could do this for us.
else
- message = copytext(message,3)
+ message = copytext(message, 3)
message = trim_left(message)
@@ -186,7 +169,7 @@ proc/get_radio_key_from_channel(var/channel)
if(!message || message == "")
return 0
- var/list/obj/item/used_radios = new
+ var/list/used_radios = list()
if(handle_message_mode(message_mode, message, verb, speaking, used_radios, alt_name))
return 1
@@ -206,21 +189,24 @@ proc/get_radio_key_from_channel(var/channel)
var/msg
if(!speaking || !(speaking.flags & NO_TALK_MSG))
msg = "\The [src] talks into \the [used_radios[1]]"
- for(var/mob/living/M in hearers(5, src))
- if((M != src) && msg)
+
+ if(msg)
+ for(var/mob/living/M in hearers(5, src) - src)
M.show_message(msg)
- if (speech_sound)
- sound_vol *= 0.5
+
+ if(speech_sound)
+ sound_vol *= 0.5
+
var/turf/T = get_turf(src)
//handle nonverbal and sign languages here
- if (speaking)
- if (speaking.flags & NONVERBAL)
- if (prob(30))
- src.custom_emote(1, "[pick(speaking.signlang_verb)].")
+ if(speaking)
+ if(speaking.flags & NONVERBAL)
+ if(prob(30))
+ custom_emote(1, "[pick(speaking.signlang_verb)].")
- if (speaking.flags & SIGNLANG)
+ if(speaking.flags & SIGNLANG)
return say_signlang(message, pick(speaking.signlang_verb), speaking)
var/list/listening = list()
@@ -229,11 +215,11 @@ proc/get_radio_key_from_channel(var/channel)
if(T)
//make sure the air can transmit speech - speaker's side
var/datum/gas_mixture/environment = T.return_air()
- var/pressure = (environment)? environment.return_pressure() : 0
+ var/pressure = environment ? environment.return_pressure() : 0
if(pressure < SOUND_MINIMUM_PRESSURE)
message_range = 1
- if (pressure < ONE_ATMOSPHERE*0.4) //sound distortion pressure, to help clue people in that the air is thin, even if it isn't a vacuum yet
+ if(pressure < ONE_ATMOSPHERE * 0.4) //sound distortion pressure, to help clue people in that the air is thin, even if it isn't a vacuum yet
italics = 1
sound_vol *= 0.5 //muffle the sound a bit, so it's like we're actually talking through contact
@@ -241,26 +227,26 @@ proc/get_radio_key_from_channel(var/channel)
var/list/hearturfs = list()
for(var/I in hear)
- if(istype(I, /mob/))
+ if(ismob(I))
var/mob/M = I
listening += M
- hearturfs += M.locs[1]
+ hearturfs += get_turf(M)
for(var/obj/O in M.contents)
listening_obj |= O
- else if(istype(I, /obj/))
+ if(isobj(I))
var/obj/O = I
- hearturfs += O.locs[1]
+ hearturfs += get_turf(O)
listening_obj |= O
for(var/mob/M in player_list)
- if (!M.client)
+ if(!M.client)
continue //skip monkeys and leavers
- if (istype(M, /mob/new_player))
+ if(isnewplayer(M))
continue
- if(M.stat == DEAD && M.client && (M.client.prefs.toggles & CHAT_GHOSTEARS) && src.client) // src.client is so that ghosts don't have to listen to mice
+ if(M.stat == DEAD && M.client && (M.client.prefs.toggles & CHAT_GHOSTEARS) && client) // client is so that ghosts don't have to listen to mice
listening |= M
continue
- if(M.loc && M.locs[1] in hearturfs)
+ if(get_turf(M) in hearturfs)
listening |= M
var/list/speech_bubble_recipients = list()
@@ -286,7 +272,7 @@ proc/get_radio_key_from_channel(var/channel)
return 1
/mob/living/proc/say_signlang(var/message, var/verb="gestures", var/datum/language/language)
- for (var/mob/O in viewers(src, null))
+ for(var/mob/O in viewers(src, null))
O.hear_signlang(message, verb, language, src)
return 1
@@ -356,7 +342,7 @@ proc/get_radio_key_from_channel(var/channel)
return
if(stat)
- if(stat == 2)
+ if(stat == DEAD)
return say_dead(message)
return
@@ -382,7 +368,7 @@ proc/get_radio_key_from_channel(var/channel)
verb = "[speaking.speech_verb] [adverb]"
not_heard = "[speaking.speech_verb] something [adverb]"
else
- not_heard = "[verb] something" //TODO get rid of the null language and just prevent speech if language is null
+ not_heard = "[verb] something"
message = trim(message)
@@ -393,11 +379,12 @@ proc/get_radio_key_from_channel(var/channel)
speech_problem_flag = handle_s[3]
if(verb == "yells loudly")
verb = "slurs emphatically"
+
else if(speech_problem_flag)
var/adverb = pick("quietly", "softly")
verb = "[verb] [adverb]"
- if(!message || message=="")
+ if(!message)
return
var/atom/whisper_loc = get_whisper_loc()
@@ -414,7 +401,7 @@ proc/get_radio_key_from_channel(var/channel)
//Pass whispers on to anything inside the immediate listeners.
for(var/mob/L in listening)
for(var/mob/C in L.contents)
- if(istype(C,/mob/living))
+ if(isliving(C))
listening += C
//pass on the message to objects that can hear us.
@@ -454,11 +441,11 @@ proc/get_radio_key_from_channel(var/channel)
flick_overlay(I, speech_bubble_recipients, 30)
if(watching.len)
- var/rendered = "[src.name] [not_heard]."
- for (var/mob/M in watching)
+ var/rendered = "[name] [not_heard]."
+ for(var/mob/M in watching)
M.show_message(rendered, 2)
- log_whisper("[src.name]/[src.key] : [message]")
+ log_whisper("[name]/[key] : [message]")
return 1
/mob/living/speech_bubble(var/bubble_state = "",var/bubble_loc = src, var/list/bubble_recipients = list())
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index 812d2e8df58..d459e64b4e1 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -26,10 +26,10 @@ var/list/ai_verbs_default = list(
//Not sure why this is necessary...
/proc/AutoUpdateAI(obj/subject)
var/is_in_use = 0
- if (subject!=null)
+ if(subject!=null)
for(var/A in ai_list)
var/mob/living/silicon/ai/M = A
- if ((M.client && M.machine == subject))
+ if((M.client && M.machine == subject))
is_in_use = 1
subject.attack_ai(M)
return is_in_use
@@ -54,6 +54,7 @@ var/list/ai_verbs_default = list(
var/obj/item/device/pda/silicon/ai/aiPDA = null
var/obj/item/device/multitool/aiMulti = null
var/custom_sprite = 0 //For our custom sprites
+ var/custom_hologram = 0 //For our custom holograms
var/obj/item/device/radio/headset/heads/ai_integrated/aiRadio = null
@@ -121,8 +122,8 @@ var/list/ai_verbs_default = list(
var/pickedName = null
while(!pickedName)
pickedName = pick(ai_names)
- for (var/mob/living/silicon/ai/A in mob_list)
- if (A.real_name == pickedName && possibleNames.len > 1) //fixing the theoretically possible infinite loop
+ for(var/mob/living/silicon/ai/A in mob_list)
+ if(A.real_name == pickedName && possibleNames.len > 1) //fixing the theoretically possible infinite loop
possibleNames -= pickedName
pickedName = null
@@ -138,7 +139,7 @@ var/list/ai_verbs_default = list(
proc_holder_list = new()
if(L)
- if (istype(L, /datum/ai_laws))
+ if(istype(L, /datum/ai_laws))
laws = L
else
make_laws()
@@ -154,7 +155,7 @@ var/list/ai_verbs_default = list(
aiCamera = new/obj/item/device/camera/siliconcam/ai_camera(src)
- if (istype(loc, /turf))
+ if(istype(loc, /turf))
add_ai_verbs(src)
//Languages
@@ -176,12 +177,12 @@ var/list/ai_verbs_default = list(
add_language("Clownish", 0)
if(!safety)//Only used by AIize() to successfully spawn an AI.
- if (!B)//If there is no player/brain inside.
+ if(!B)//If there is no player/brain inside.
new/obj/structure/AIcore/deactivated(loc)//New empty terminal.
qdel(src)//Delete AI.
return
else
- if (B.brainmob.mind)
+ if(B.brainmob.mind)
B.brainmob.mind.transfer_to(src)
on_mob_init()
@@ -219,7 +220,7 @@ var/list/ai_verbs_default = list(
to_chat(src, radio_text)
- if (!(ticker && ticker.mode && (mind in ticker.mode.malf_ai)))
+ if(!(ticker && ticker.mode && (mind in ticker.mode.malf_ai)))
show_laws()
to_chat(src, "These laws may be changed by other players, or by you being the traitor.")
@@ -298,18 +299,19 @@ var/list/ai_verbs_default = list(
Entry[i] = trim(Entry[i])
if(Entry.len < 2)
- continue;
+ continue
- if(Entry[1] == src.ckey && Entry[2] == src.real_name)
+ if(Entry.len < 3 && Entry[1] == ckey && Entry[2] == real_name)
custom_sprite = 1 //They're in the list? Custom sprite time
icon = 'icons/mob/custom-synthetic.dmi'
+
//if(icon_state == initial(icon_state))
var/icontype = ""
- if (custom_sprite == 1) icontype = ("Custom")//automagically selects custom sprite if one is available
+ if(custom_sprite == 1) icontype = ("Custom")//automagically selects custom sprite if one is available
else icontype = input("Select an icon!", "AI", null, null) in list("Monochrome", "Blue", "Clown", "Inverted", "Text", "Smiley", "Angry", "Dorf", "Matrix", "Bliss", "Firewall", "Green", "Red", "Static", "Triumvirate", "Triumvirate Static", "Red October", "Sparkles", "ANIMA", "President", "NT")
switch(icontype)
- if("Custom") icon_state = "[src.ckey]-ai"
+ if("Custom") icon_state = "[ckey]-ai"
if("Clown") icon_state = "ai-clown2"
if("Monochrome") icon_state = "ai-mono"
if("Inverted") icon_state = "ai-u"
@@ -340,9 +342,9 @@ var/list/ai_verbs_default = list(
/mob/living/silicon/ai/show_malf_ai()
if(ticker.mode.name == "AI malfunction")
var/datum/game_mode/malfunction/malf = ticker.mode
- for (var/datum/mind/malfai in malf.malf_ai)
- if (mind == malfai) // are we the evil one?
- if (malf.apcs >= 3)
+ for(var/datum/mind/malfai in malf.malf_ai)
+ if(mind == malfai) // are we the evil one?
+ if(malf.apcs >= 3)
stat(null, "Time until station control secured: [max(malf.AI_win_timeleft/(malf.apcs/3), 0)] seconds")
// this verb lets the ai see the stations manifest
@@ -436,13 +438,13 @@ var/list/ai_verbs_default = list(
ai_announcement()
/mob/living/silicon/ai/check_eye(var/mob/user as mob)
- if (!current)
+ if(!current)
return null
user.reset_view(current)
return 1
/mob/living/silicon/ai/blob_act()
- if (stat != 2)
+ if(stat != 2)
adjustBruteLoss(60)
updatehealth()
return 1
@@ -452,7 +454,7 @@ var/list/ai_verbs_default = list(
return 0
/mob/living/silicon/ai/emp_act(severity)
- if (prob(30))
+ if(prob(30))
switch(pick(1,2))
if(1)
view_core()
@@ -467,11 +469,11 @@ var/list/ai_verbs_default = list(
if(1.0)
gib()
if(2.0)
- if (stat != 2)
+ if(stat != 2)
adjustBruteLoss(60)
adjustFireLoss(60)
if(3.0)
- if (stat != 2)
+ if(stat != 2)
adjustBruteLoss(30)
return
@@ -481,21 +483,21 @@ var/list/ai_verbs_default = list(
if(usr != src)
return
..()
- if (href_list["mach_close"])
- if (href_list["mach_close"] == "aialerts")
+ if(href_list["mach_close"])
+ if(href_list["mach_close"] == "aialerts")
viewalerts = 0
var/t1 = text("window=[]", href_list["mach_close"])
unset_machine()
src << browse(null, t1)
- if (href_list["switchcamera"])
+ if(href_list["switchcamera"])
switchCamera(locate(href_list["switchcamera"])) in cameranet.cameras
- if (href_list["showalerts"])
+ if(href_list["showalerts"])
subsystem_alarm_monitor()
if(href_list["show_paper"])
if(last_paper_seen)
src << browse(last_paper_seen, "window=show_paper")
//Carn: holopad requests
- if (href_list["jumptoholopad"])
+ if(href_list["jumptoholopad"])
var/obj/machinery/hologram/holopad/H = locate(href_list["jumptoholopad"])
if(stat == CONSCIOUS)
if(H)
@@ -507,7 +509,7 @@ var/list/ai_verbs_default = list(
play_vox_word(href_list["say_word"], null, src)
return
- if (href_list["track"])
+ if(href_list["track"])
var/mob/living/target = locate(href_list["track"]) in mob_list
if(target && target.can_track())
ai_actual_track(target)
@@ -515,7 +517,7 @@ var/list/ai_verbs_default = list(
to_chat(src, "Target is not on or near any active cameras on the station.")
return
- if (href_list["trackbot"])
+ if(href_list["trackbot"])
var/mob/living/simple_animal/bot/target = locate(href_list["trackbot"]) in simple_animal_list
if(target)
ai_actual_track(target)
@@ -523,7 +525,7 @@ var/list/ai_verbs_default = list(
to_chat(src, "Target is not on or near any active cameras on the station.")
return
- if (href_list["callbot"]) //Command a bot to move to a selected location.
+ if(href_list["callbot"]) //Command a bot to move to a selected location.
Bot = locate(href_list["callbot"]) in simple_animal_list
if(!Bot || Bot.remote_disabled || src.control_disabled)
return //True if there is no bot found, the bot is manually emagged, or the AI is carded with wireless off.
@@ -531,17 +533,17 @@ var/list/ai_verbs_default = list(
to_chat(src, "Set your waypoint by clicking on a valid location free of obstructions.")
return
- if (href_list["interface"]) //Remotely connect to a bot!
+ if(href_list["interface"]) //Remotely connect to a bot!
Bot = locate(href_list["interface"]) in simple_animal_list
if(!Bot || Bot.remote_disabled || src.control_disabled)
return
Bot.attack_ai(src)
- if (href_list["botrefresh"]) //Refreshes the bot control panel.
+ if(href_list["botrefresh"]) //Refreshes the bot control panel.
botcall()
return
- if (href_list["ai_take_control"]) //Mech domination
+ if(href_list["ai_take_control"]) //Mech domination
var/obj/mecha/M = locate(href_list["ai_take_control"])
if(controlled_mech)
to_chat(src, "You are already loaded into an onboard computer!")
@@ -549,17 +551,17 @@ var/list/ai_verbs_default = list(
if(M)
M.transfer_ai(AI_MECH_HACK,src, usr) //Called om the mech itself.
- else if (href_list["faketrack"])
+ else if(href_list["faketrack"])
var/mob/target = locate(href_list["track"]) in mob_list
var/mob/living/silicon/ai/A = locate(href_list["track2"]) in mob_list
if(A && target)
A.cameraFollow = target
to_chat(A, "Now tracking [target.name] on camera.")
- if (usr.machine == null)
+ if(usr.machine == null)
usr.machine = usr
- while (src.cameraFollow == target)
+ while(src.cameraFollow == target)
to_chat(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
@@ -575,23 +577,23 @@ var/list/ai_verbs_default = list(
/mob/living/silicon/ai/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
- if (!ticker)
+ if(!ticker)
to_chat(M, "You cannot attack people before the game has started.")
return
- if (istype(loc, /turf) && istype(loc.loc, /area/start))
+ if(istype(loc, /turf) && istype(loc.loc, /area/start))
to_chat(M, "No attacking people at spawn, you jackass.")
return
switch(M.a_intent)
- if (I_HELP)
+ if(I_HELP)
visible_message("[M] caresses [src]'s plating with its scythe like arm.")
else //harm
M.do_attack_animation(src)
var/damage = rand(10, 20)
- if (prob(90))
+ if(prob(90))
playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
visible_message("[M] has slashed at [src]!",\
"[M] has slashed at [src]!")
@@ -638,13 +640,14 @@ var/list/ai_verbs_default = list(
if(check_unable(AI_CHECK_WIRELESS | AI_CHECK_RADIO))
return
- var/ai_allowed_Zlevel = list(1,3,5)
+ var/ai_allowed_Zlevel = list(ZLEVEL_STATION,ZLEVEL_TELECOMMS,ZLEVEL_ASTEROID)
var/d
var/area/bot_area
d += "Query network status "
d += "
Name
Status
Location
Control
"
- for (var/mob/living/simple_animal/bot/Bot in simple_animal_list)
+ for(var/mob/living/simple_animal/bot/Bot in simple_animal_list)
+ // TODO: Tie into space manager
if((Bot.z in ai_allowed_Zlevel) && !Bot.remote_disabled) //Only non-emagged bots on the allowed Z-level are detected!
bot_area = get_area(Bot)
d += "
"
- if(t_disk.stored == null)
- dat += "The disk has no data stored on it.
"
- dat += "Operations: "
- dat += "Load Tech to Disk"
- else
- dat += "Name: [t_disk.stored.name] "
- dat += "Level: [t_disk.stored.level] "
- dat += "Description: [t_disk.stored.desc]"
- dat += "Operations: "
- dat += "Upload to Database"
- dat += "Clear Disk"
- dat += "Eject Disk"
-
- if(1.3) //Technology Disk submenu
- dat += "Main Menu"
- dat += "Return to Disk Operations
"
- dat += "
Load Technology to Disk:
"
- for(var/datum/tech/T in files.known_tech)
- if(T.level <= 0)
- continue
- dat += "[T.name] "
- dat += "Copy to Disk "
- dat += "
"
-
- if(1.4) //Design Disk menu.
- dat += "Main Menu
"
- if(d_disk.blueprint == null)
- dat += "The disk has no data stored on it.
"
- dat += "Operations: "
- dat += "Load Design to Disk"
- else
- dat += "Name: [d_disk.blueprint.name] "
- dat += "Level: [d_disk.blueprint.reliability] "
- var/b_type = d_disk.blueprint.build_type
- if(b_type)
- dat += "Lathe Types: "
- if(b_type & IMPRINTER) dat += "Circuit Imprinter "
- if(b_type & PROTOLATHE) dat += "Proto-lathe "
- if(b_type & AUTOLATHE) dat += "Auto-lathe "
- if(b_type & MECHFAB) dat += "Mech Fabricator "
- dat += "Required Materials: "
- for(var/M in d_disk.blueprint.materials)
- if(copytext(M, 1, 2) == "$") dat += "* [copytext(M, 2)] x [d_disk.blueprint.materials[M]] "
- else dat += "* [M] x [d_disk.blueprint.materials[M]] "
- dat += "Operations: "
- dat += "Upload to Database"
- dat += "Clear Disk"
- dat += "Eject Disk"
-
- if(1.5) //Technology disk submenu
- dat += "Main Menu"
- dat += "Return to Disk Operations
"
- dat += "
Load Design to Disk:
"
+ if(d_disk != null && submenu == 1)
+ var/list/to_copy = list()
+ data["to_copy"] = to_copy
for(var/datum/design/D in files.known_designs)
- dat += "[D.name] "
- dat += "Copy to Disk "
- dat += "
+ If this takes longer than 30 seconds, it will automatically reload a maximum of 5 times.
+ If it still doesn't work, use the bug report button at the top right of the window.
+
+
+
+
\ No newline at end of file
diff --git a/goon/browserassets/js/browserOutput.js b/goon/browserassets/js/browserOutput.js
new file mode 100644
index 00000000000..7f59c2d56f3
--- /dev/null
+++ b/goon/browserassets/js/browserOutput.js
@@ -0,0 +1,920 @@
+/*****************************************
+*
+* FUNCTION AND VAR DECLARATIONS
+*
+******************************************/
+
+//DEBUG STUFF
+var escaper = encodeURIComponent || escape;
+var decoder = decodeURIComponent || unescape;
+window.onerror = function(msg, url, line, col, error) {
+ if (document.location.href.indexOf("proc=debug") <= 0) {
+ var extra = !col ? '' : ' | column: ' + col;
+ extra += !error ? '' : ' | error: ' + error;
+ extra += !navigator.userAgent ? '' : ' | user agent: ' + navigator.userAgent;
+ var debugLine = 'Error: ' + msg + ' | url: ' + url + ' | line: ' + line + extra;
+ window.location = '?_src_=chat&proc=debug¶m[error]='+escaper(debugLine);
+ }
+ return true;
+};
+
+//Globals
+window.status = 'Output';
+var $messages, $subOptions, $contextMenu, $filterMessages;
+var opts = {
+ //General
+ 'messageCount': 0, //A count...of messages...
+ 'messageLimit': 2053, //A limit...for the messages...
+ 'scrollSnapTolerance': 5, //If within x pixels of bottom
+ 'clickTolerance': 10, //Keep focus if outside x pixels of mousedown position on mouseup
+ 'popups': 0, //Amount of popups opened ever
+ 'wasd': false, //Is the user in wasd mode?
+ 'chatMode': 'default', //The mode the chat is in
+ 'priorChatHeight': 0, //Thing for height-resizing detection
+ 'restarting': false, //Is the round restarting?
+
+ //Options menu
+ 'subOptionsLoop': null, //Contains the interval loop for closing the options menu
+ 'suppressOptionsClose': false, //Whether or not we should be hiding the suboptions menu
+ 'highlightTerms': [],
+ 'highlightLimit': 5,
+ 'highlightColor': '#FFFF00', //The color of the highlighted message
+ 'pingDisabled': false, //Has the user disabled the ping counter
+
+ //Ping display
+ 'lastPang': 0, //Timestamp of the last response from the server.
+ 'pangLimit': 35000,
+ 'pingTime': 0, //Timestamp of when ping sent
+ 'pongTime': 0, //Timestamp of when ping received
+ 'noResponse': false, //Tracks the state of the previous ping request
+ 'noResponseCount': 0, //How many failed pings?
+
+ //Clicks
+ 'mouseDownX': null,
+ 'mouseDownY': null,
+ 'preventFocus': false, //Prevents switching focus to the game window
+
+ //Admin stuff
+ 'adminLoaded': false, //Has the admin loaded his shit?
+
+ //Client Connection Data
+ 'clientDataLimit': 5,
+ 'clientData': [],
+
+ // List of macros in the 'hotkeymode' macro set.
+ 'macros': {}
+};
+
+function outerHTML(el) {
+ var wrap = document.createElement('div');
+ wrap.appendChild(el.cloneNode(true));
+ return wrap.innerHTML;
+}
+
+//Polyfill for fucking date now because of course IE8 and below don't support it
+if (!Date.now) {
+ Date.now = function now() {
+ return new Date().getTime();
+ };
+}
+//Polyfill for trim() (IE8 and below)
+if (typeof String.prototype.trim !== 'function') {
+ String.prototype.trim = function () {
+ return this.replace(/^\s+|\s+$/g, '');
+ };
+}
+
+//Shit fucking piece of crap that doesn't work god fuckin damn it
+function linkify(text) {
+ var rex = /((?:'+$0+'';
+ }
+ else {
+ return $1 ? $0: ''+$0+'';
+ }
+ });
+}
+
+//Actually turns the highlight term match into appropriate html
+function addHighlightMarkup(match) {
+ var extra = '';
+ if (opts.highlightColor) {
+ extra += ' style="background-color: '+opts.highlightColor+'"';
+ }
+ return ''+match+'';
+}
+
+//Highlights words based on user settings
+function highlightTerms(el) {
+ if (el.children.length > 0) {
+ for(var h = 0; h < el.children.length; h++){
+ highlightTerms(el.children[h]);
+ }
+ }
+ if (el.childNodes.length > 0 && typeof el.childNodes[0].data !== 'undefined' && el.childNodes[0].data.length > 0) { //If element actually has text
+ var newText = '';
+ for (var c = 0; c < el.childNodes.length; c++) { //Each child element
+ if (el.childNodes[c].nodeType === 3) { //Is it text only?
+ var words = el.childNodes[c].data.split(' ');
+ for (var w = 0; w < words.length; w++) { //Each word in the text
+ var newWord = null;
+ for (var i = 0; i < opts.highlightTerms.length; i++) { //Each highlight term
+ if (opts.highlightTerms[i] && words[w].toLowerCase().indexOf(opts.highlightTerms[i].toLowerCase()) > -1) { //If a match is found
+ newWord = words[w].replace(new RegExp(opts.highlightTerms[i], 'gi'), addHighlightMarkup);
+ break;
+ }
+ }
+ newText += newWord ? newWord : words[w];
+ newText += w >= words.length ? '' : ' ';
+ }
+ } else { //Every other type of element
+ newText += outerHTML(el.childNodes[c]);
+ }
+ }
+ el.innerHTML = newText;
+ }
+}
+
+//Send a message to the client
+function output(message, flag) {
+ if (typeof message === 'undefined') {
+ return;
+ }
+ if (typeof flag === 'undefined') {
+ flag = '';
+ }
+
+ if (flag !== 'internal')
+ opts.lastPang = Date.now();
+
+ //The behemoth of filter-code (for Admin message filters)
+ //Note: This is proooobably hella inefficient
+ var filteredOut = false;
+ if (opts.hasOwnProperty('showMessagesFilters') && !opts.showMessagesFilters['All'].show) {
+ //Get this filter type (defined by class on message)
+ var messageHtml = $.parseHTML(message),
+ messageClasses;
+ if (opts.hasOwnProperty('filterHideAll') && opts.filterHideAll) {
+ var internal = false;
+ messageClasses = (!!$(messageHtml).attr('class') ? $(messageHtml).attr('class').split(/\s+/) : false);
+ if (messageClasses) {
+ for (var i = 0; i < messageClasses.length; i++) { //Every class
+ if (messageClasses[i] == 'internal') {
+ internal = true;
+ break;
+ }
+ }
+ }
+ if (!internal) {
+ filteredOut = 'All';
+ }
+ } else {
+ //If the element or it's child have any classes
+ if (!!$(messageHtml).attr('class') || !!$(messageHtml).children().attr('class')) {
+ messageClasses = $(messageHtml).attr('class').split(/\s+/);
+ if (!!$(messageHtml).children().attr('class')) {
+ messageClasses = messageClasses.concat($(messageHtml).children().attr('class').split(/\s+/));
+ }
+ var tempCount = 0;
+ for (var i = 0; i < messageClasses.length; i++) { //Every class
+ var thisClass = messageClasses[i];
+ $.each(opts.showMessagesFilters, function(key, val) { //Every filter
+ if (key !== 'All' && val.show === false && typeof val.match != 'undefined') {
+ for (var i = 0; i < val.match.length; i++) {
+ var matchClass = val.match[i];
+ if (matchClass == thisClass) {
+ filteredOut = key;
+ break;
+ }
+ }
+ }
+ if (filteredOut) return false;
+ });
+ if (filteredOut) break;
+ tempCount++;
+ }
+ } else {
+ if (!opts.showMessagesFilters['Misc'].show) {
+ filteredOut = 'Misc';
+ }
+ }
+ }
+ }
+
+ //Stuff we do along with appending a message
+ var atBottom = false;
+ if (!filteredOut) {
+ var bodyHeight = $('body').height();
+ var messagesHeight = $messages.outerHeight();
+ var scrollPos = $('body,html').scrollTop();
+
+ //Should we snap the output to the bottom?
+ if (bodyHeight + scrollPos >= messagesHeight - opts.scrollSnapTolerance) {
+ atBottom = true;
+ if ($('#newMessages').length) {
+ $('#newMessages').remove();
+ }
+ //If not, put the new messages box in
+ } else {
+ if ($('#newMessages').length) {
+ var messages = $('#newMessages .number').text();
+ messages = parseInt(messages);
+ messages++;
+ $('#newMessages .number').text(messages);
+ if (messages == 2) {
+ $('#newMessages .messageWord').append('s');
+ }
+ } else {
+ $messages.after('1 new message');
+ }
+ }
+ }
+
+ //Url stuff
+ if (message.length && flag != 'preventLink') {
+ message = linkify(message);
+ }
+
+ opts.messageCount++;
+
+ //Pop the top message off if history limit reached
+ if (opts.messageCount >= opts.messageLimit) {
+ $messages.children('div.entry:first-child').remove();
+ opts.messageCount--; //I guess the count should only ever equal the limit
+ }
+
+ //Actually append the message
+ var entry = document.createElement('div');
+ entry.className = 'entry';
+
+ if (filteredOut) {
+ entry.className += ' hidden';
+ entry.setAttribute('data-filter', filteredOut);
+ }
+
+ entry.innerHTML = message;
+ $messages[0].appendChild(entry);
+
+ //Actually do the snap
+ if (!filteredOut && atBottom) {
+ $('body,html').scrollTop($messages.outerHeight());
+ }
+
+ //Stuff we can do after the message shows can go here, in the interests of responsiveness
+ if (opts.highlightTerms && opts.highlightTerms.length > 0) {
+ highlightTerms(entry);
+ }
+}
+
+//Runs a route within byond, client or server side. Consider this "ehjax" for byond.
+function runByond(uri) {
+ window.location = uri;
+}
+
+function setCookie(cname, cvalue, exdays) {
+ cvalue = escaper(cvalue);
+ var d = new Date();
+ d.setTime(d.getTime() + (exdays*24*60*60*1000));
+ var expires = 'expires='+d.toUTCString();
+ document.cookie = "paradise-" + cname + '=' + cvalue + '; ' + expires;
+}
+
+function getCookie(cname) {
+ var name = "paradise-" + cname + '=';
+ var ca = document.cookie.split(';');
+ for(var i=0; i < ca.length; i++) {
+ var c = ca[i];
+ while (c.charAt(0)==' ') c = c.substring(1);
+ if (c.indexOf(name) === 0) {
+ return decoder(c.substring(name.length,c.length));
+ }
+ }
+ return '';
+}
+
+function rgbToHex(R,G,B) {return toHex(R)+toHex(G)+toHex(B);}
+function toHex(n) {
+ n = parseInt(n,10);
+ if (isNaN(n)) return "00";
+ n = Math.max(0,Math.min(n,255));
+ return "0123456789ABCDEF".charAt((n-n%16)/16) + "0123456789ABCDEF".charAt(n%16);
+}
+
+function changeMode(mode) {
+ switch (mode) {
+ case 'geocities':
+ //switch in stylesheet
+ opts.chatMode = mode;
+ break;
+ case 'console':
+
+ opts.chatMode = mode;
+ break;
+ case 'default':
+ default:
+ //remove loaded stylesheet/s
+ opts.chatMode = 'default';
+ }
+}
+
+function handleClientData(ckey, ip, compid) {
+ //byond sends player info to here
+ var currentData = {'ckey': ckey, 'ip': ip, 'compid': compid};
+ if (opts.clientData && !$.isEmptyObject(opts.clientData)) {
+ runByond('?_src_=chat&proc=analyzeClientData¶m[cookie]='+JSON.stringify({'connData': opts.clientData}));
+
+ for (var i = 0; i < opts.clientData.length; i++) {
+ var saved = opts.clientData[i];
+ if (currentData.ckey == saved.ckey && currentData.ip == saved.ip && currentData.compid == saved.compid) {
+ return; //Record already exists
+ }
+ }
+
+ if (opts.clientData.length >= opts.clientDataLimit) {
+ opts.clientData.shift();
+ }
+ } else {
+ runByond('?_src_=chat&proc=analyzeClientData¶m[cookie]=none');
+ }
+
+ //Update the cookie with current details
+ opts.clientData.push(currentData);
+ setCookie('connData', JSON.stringify(opts.clientData), 365);
+}
+
+//Server calls this on ehjax response
+//Or, y'know, whenever really
+function ehjaxCallback(data) {
+ opts.lastPang = Date.now();
+ if (data == 'softPang') {
+ return;
+ } else if (data == "pang") {
+ opts.pingCounter = 0;
+ opts.pingTime = Date.now();
+ runByond('?_src_=chat&proc=ping');
+ } else if (data == 'pong') {
+ if (opts.pingDisabled) {return;}
+ opts.pongTime = Date.now();
+ var pingDuration = Math.ceil((opts.pongTime - opts.pingTime) / 2);
+ $('#pingMs').text(pingDuration+'ms');
+ pingDuration = Math.min(pingDuration, 255);
+ var red = pingDuration;
+ var green = 255 - pingDuration;
+ var blue = 0;
+ var hex = rgbToHex(red, green, blue);
+ $('#pingDot').css('color', '#'+hex);
+ } else if (data == 'roundrestart') {
+ opts.restarting = true;
+ output('
The connection has been closed because the server is restarting. Please wait while you automatically reconnect.
', 'internal');
+ } else if (data == 'stopaudio') {
+ $('.dectalk').remove();
+ } else {
+ //Oh we're actually being sent data instead of an instruction
+ var dataJ;
+ try {
+ dataJ = $.parseJSON(data);
+ } catch (e) {
+ //But...incorrect :sadtrombone:
+ window.onerror('JSON: '+e+'. '+data, 'browserOutput.html', 327);
+ return;
+ }
+ data = dataJ;
+
+ if (data.clientData) {
+ if (opts.restarting) {
+ opts.restarting = false;
+ $('.connectionClosed.restarting:not(.restored)').addClass('restored').text('The round restarted and you successfully reconnected!');
+ }
+ if (!data.clientData.ckey && !data.clientData.ip && !data.clientData.compid) {
+ //TODO: Call shutdown perhaps
+ return;
+ } else {
+ handleClientData(data.clientData.ckey, data.clientData.ip, data.clientData.compid);
+ }
+ } else if (data.loadAdminCode) {
+ if (opts.adminLoaded) {return;}
+ var adminCode = data.loadAdminCode;
+ $('body').append(adminCode);
+ opts.adminLoaded = true;
+ } else if (data.modeChange) {
+ changeMode(data.modeChange);
+ } else if (data.firebug) {
+ if (data.trigger) {
+ output('Loading firebug console, triggered by '+data.trigger+'...', 'internal');
+ } else {
+ output('Loading firebug console...', 'internal');
+ }
+ var firebugEl = document.createElement('script');
+ firebugEl.src = 'https://getfirebug.com/firebug-lite-debug.js';
+ document.body.appendChild(firebugEl);
+ } else if (data.dectalk) {
+ var message = '';
+ if (data.decTalkTrigger) {
+ message = ' '+
+ 'You hear a strange robotic voice...' + message;
+ }
+ output(message, 'preventLink');
+ }
+ }
+}
+
+function createPopup(contents, width) {
+ opts.popups++;
+ $('body').append('
'+contents+'
');
+
+ //Attach close popup event
+ var $popup = $('#popup'+opts.popups);
+ var height = $popup.outerHeight();
+ $popup.css({'height': height+'px', 'margin': '-'+(height/2)+'px 0 0 -'+(width/2)+'px'});
+
+ $popup.on('click', '.close', function(e) {
+ e.preventDefault();
+ $popup.remove();
+ });
+}
+
+function toggleWasd(state) {
+ opts.wasd = (state == 'on' ? true : false);
+}
+
+/*****************************************
+*
+* MAKE MACRO DICTIONARY
+*
+******************************************/
+
+// Callback for winget.
+function wingetMacros(macros) {
+ var idRegex = /.*?\.(?!(?:CRTL|ALT|SHIFT)\+)(.*?)(?:\+REP)?\.command/; // Do NOT match macros which need crtl, alt or shift to be held down (saves a ton of headache because I don't give enough of a fuck).
+ for (key in macros) {
+ match = idRegex.exec(key)
+ if (match === null)
+ continue
+ macroID = match[1].toUpperCase();
+
+ opts.macros[macroID] = macros[key];
+ }
+}
+
+/*****************************************
+*
+* DOM READY
+*
+******************************************/
+
+if (typeof $ === 'undefined') {
+ var div = document.getElementById('loading').childNodes[1];
+ div += '
ERROR: Jquery did not load.';
+}
+
+$(function() {
+ $messages = $('#messages');
+ $subOptions = $('#subOptions');
+
+ //Hey look it's a controller loop!
+ setInterval(function() {
+ if (opts.lastPang + opts.pangLimit < Date.now() && !opts.restarting) { //Every pingLimit
+ if (!opts.noResponse) { //Only actually append a message if the previous ping didn't also fail (to prevent spam)
+ opts.noResponse = true;
+ opts.noResponseCount++;
+ output('
You are either AFK, experiencing lag or the connection has closed.
', 'internal');
+ }
+ } else if (opts.noResponse) { //Previous ping attempt failed ohno
+ $('.connectionClosed[data-count="'+opts.noResponseCount+'"]:not(.restored)').addClass('restored').text('Your connection has been restored (probably)!');
+ opts.noResponse = false;
+ }
+ }, 2000); //2 seconds
+
+
+
+ /*****************************************
+ *
+ * LOAD SAVED CONFIG
+ *
+ ******************************************/
+ var savedConfig = {
+ 'sfontSize': getCookie('fontsize'),
+ 'sfontType': getCookie('fonttype'),
+ 'spingDisabled': getCookie('pingdisabled'),
+ 'shighlightTerms': getCookie('highlightterms'),
+ 'shighlightColor': getCookie('highlightcolor'),
+ };
+
+ if (savedConfig.sfontSize) {
+ $messages.css('font-size', savedConfig.sfontSize);
+ output('Loaded font size setting of: '+savedConfig.sfontSize+'', 'internal');
+ }
+ if (savedConfig.sfontType) {
+ $messages.css('font-family', savedConfig.sfontType);
+ output('Loaded font type setting of: '+savedConfig.sfontType+'', 'internal');
+ }
+ if (savedConfig.spingDisabled) {
+ if (savedConfig.spingDisabled == 'true') {
+ opts.pingDisabled = true;
+ $('#ping').hide();
+ }
+ output('Loaded ping display of: '+(opts.pingDisabled ? 'hidden' : 'visible')+'', 'internal');
+ }
+ if (savedConfig.shighlightTerms) {
+ var savedTerms = $.parseJSON(savedConfig.shighlightTerms);
+ var actualTerms = '';
+ for (var i = 0; i < savedTerms.length; i++) {
+ if (savedTerms[i]) {
+ actualTerms += savedTerms[i] + ', ';
+ }
+ }
+ if (actualTerms) {
+ actualTerms = actualTerms.substring(0, actualTerms.length - 2);
+ output('Loaded highlight strings of: ' + actualTerms+'', 'internal');
+ opts.highlightTerms = savedTerms;
+ }
+ }
+ if (savedConfig.shighlightColor) {
+ opts.highlightColor = savedConfig.shighlightColor;
+ output('Loaded highlight color of: '+savedConfig.shighlightColor+'', 'internal');
+ }
+
+ (function() {
+ var dataCookie = getCookie('connData');
+ if (dataCookie) {
+ var dataJ;
+ try {
+ dataJ = $.parseJSON(dataCookie);
+ } catch (e) {
+ window.onerror('JSON '+e+'. '+dataCookie, 'browserOutput.html', 434);
+ return;
+ }
+ opts.clientData = dataJ;
+ }
+ })();
+
+
+ /*****************************************
+ *
+ * BASE CHAT OUTPUT EVENTS
+ *
+ ******************************************/
+
+ $('body').on('click', 'a', function(e) {
+ e.preventDefault();
+ });
+
+ $('body').on('mousedown', function(e) {
+ var $target = $(e.target);
+
+ if ($contextMenu && opts.hasOwnProperty('contextMenuTarget') && opts.contextMenuTarget) {
+ hideContextMenu();
+ return false;
+ }
+
+ if ($target.is('a') || $target.parent('a').length || $target.is('input') || $target.is('textarea')) {
+ opts.preventFocus = true;
+ } else {
+ opts.preventFocus = false;
+ opts.mouseDownX = e.pageX;
+ opts.mouseDownY = e.pageY;
+ }
+ });
+
+ $messages.on('mousedown', function(e) {
+ if ($subOptions && $subOptions.is(':visible')) {
+ $subOptions.slideUp('fast', function() {
+ $(this).removeClass('scroll');
+ $(this).css('height', '');
+ });
+ clearInterval(opts.subOptionsLoop);
+ }
+ });
+
+ $('body').on('mouseup', function(e) {
+ if (!opts.preventFocus &&
+ (e.pageX >= opts.mouseDownX - opts.clickTolerance && e.pageX <= opts.mouseDownX + opts.clickTolerance) &&
+ (e.pageY >= opts.mouseDownY - opts.clickTolerance && e.pageY <= opts.mouseDownY + opts.clickTolerance)
+ ) {
+ opts.mouseDownX = null;
+ opts.mouseDownY = null;
+ runByond('byond://winset?mapwindow.map.focus=true');
+ }
+ });
+
+ $messages.on('click', 'a', function(e) {
+ var href = $(this).attr('href');
+ if (href[0] == '?' || (href.length >= 8 && href.substring(0,8) == 'byond://')) {
+ runByond(href);
+ } else {
+ href = escaper(href);
+ runByond('?action=openLink&link='+href);
+ }
+ });
+
+ //Fuck everything about this event. Will look into alternatives.
+ $('body').on('keydown', function(e) {
+ if (e.target.nodeName == 'INPUT' || e.target.nodeName == 'TEXTAREA') {
+ return;
+ }
+
+ if (e.ctrlKey || e.altKey || e.shiftKey) { //Band-aid "fix" for allowing ctrl+c copy paste etc. Needs a proper fix.
+ return;
+ }
+
+ e.preventDefault()
+
+ var k = e.which;
+ var command; // Command to execute through winset.
+
+ // Hardcoded because else there would be no feedback message.
+ if (k == 113) { // F2
+ runByond('byond://winset?screenshot=auto');
+ output('Screenshot taken', 'internal');
+ }
+
+ var c = "";
+ switch (k) {
+ case 8:
+ c = 'BACK';
+ case 9:
+ c = 'TAB';
+ case 13:
+ c = 'ENTER';
+ case 19:
+ c = 'PAUSE';
+ case 27:
+ c = 'ESCAPE';
+ case 33: // Page up
+ c = 'NORTHEAST';
+ case 34: // Page down
+ c = 'SOUTHEAST';
+ case 35: // End
+ c = 'SOUTHWEST';
+ case 36: // Home
+ c = 'NORTHWEST';
+ case 37:
+ c = 'WEST';
+ case 38:
+ c = 'NORTH';
+ case 39:
+ c = 'EAST';
+ case 40:
+ c = 'SOUTH';
+ case 45:
+ c = 'INSERT';
+ case 46:
+ c = 'DELETE';
+ case 93: // That weird thing to the right of alt gr.
+ c = 'APPS';
+
+ default:
+ c = String.fromCharCode(k);
+ }
+
+ if(opts.macros.hasOwnProperty(c.toUpperCase()))
+ command = opts.macros[c];
+
+ if (command) {
+ runByond('byond://winset?mapwindow.map.focus=true;command='+command);
+ return false;
+ }
+ else if (c.length == 0) {
+ if (!e.shiftKey) {
+ c = c.toLowerCase();
+ }
+ runByond('byond://winset?mapwindow.map.focus=true;mainwindow.input.text='+c);
+ return false;
+ } else {
+ runByond('byond://winset?mapwindow.map.focus=true');
+ return false;
+ }
+ });
+
+ //Mildly hacky fix for scroll issues on mob change (interface gets resized sometimes, messing up snap-scroll)
+ $(window).on('resize', function(e) {
+ if ($(this).height() !== opts.priorChatHeight) {
+ $('body,html').scrollTop($messages.outerHeight());
+ opts.priorChatHeight = $(this).height();
+ }
+ });
+
+ //Audio sound prevention
+ $messages.on('click', '.stopAudio', function() {
+ var $audio = $(this).parent().children('audio');
+ if ($audio) {
+ $audio.remove();
+ }
+ });
+
+
+ /*****************************************
+ *
+ * OPTIONS INTERFACE EVENTS
+ *
+ ******************************************/
+
+ $('body').on('click', '#newMessages', function(e) {
+ var messagesHeight = $messages.outerHeight();
+ $('body,html').scrollTop(messagesHeight);
+ $('#newMessages').remove();
+ runByond("byond://winset?mapwindow.map.focus=true");
+ });
+
+ $('#toggleOptions').click(function(e) {
+ if ($subOptions.is(':visible')) {
+ $subOptions.slideUp('fast', function() {
+ $(this).removeClass('scroll');
+ $(this).css('height', '');
+ });
+ clearInterval(opts.subOptionsLoop);
+ } else {
+ $subOptions.slideDown('fast', function() {
+ var windowHeight = $(window).height();
+ var toggleHeight = $('#toggleOptions').outerHeight();
+ var priorSubHeight = $subOptions.outerHeight();
+ var newSubHeight = windowHeight - toggleHeight;
+ $(this).height(newSubHeight);
+ if (priorSubHeight > (windowHeight - toggleHeight)) {
+ $(this).addClass('scroll');
+ }
+ });
+ opts.subOptionsLoop = setInterval(function() {
+ if (!opts.suppressOptionsClose && $('#subOptions').is(':visible')) {
+ $subOptions.slideUp('fast', function() {
+ $(this).removeClass('scroll');
+ $(this).css('height', '');
+ });
+ clearInterval(opts.subOptionsLoop);
+ }
+ }, 5000); //Every 5 seconds
+ }
+ });
+
+ $('#subOptions, #toggleOptions').mouseenter(function() {
+ opts.suppressOptionsClose = true;
+ });
+
+ $('#subOptions, #toggleOptions').mouseleave(function() {
+ opts.suppressOptionsClose = false;
+ });
+
+ $('#decreaseFont').click(function(e) {
+ var fontSize = parseInt($messages.css('font-size'));
+ fontSize = fontSize - 1 + 'px';
+ $messages.css({'font-size': fontSize});
+ setCookie('fontsize', fontSize, 365);
+ output('Font size set to '+fontSize+'', 'internal');
+ });
+
+ $('#increaseFont').click(function(e) {
+ var fontSize = parseInt($messages.css('font-size'));
+ fontSize = fontSize + 1 + 'px';
+ $messages.css({'font-size': fontSize});
+ setCookie('fontsize', fontSize, 365);
+ output('Font size set to '+fontSize+'', 'internal');
+ });
+
+ $('#chooseFont').click(function(e) {
+ if ($('.popup .changeFont').is(':visible')) {return;}
+ var popupContent = '
Choose up to '+opts.highlightLimit+' strings that will highlight the line when they appear in chat.
' +
+ '' +
+ '
';
+ createPopup(popupContent, 250);
+ });
+
+ $('body').on('keyup', '#highlightColor', function() {
+ var color = $('#highlightColor').val();
+ color = color.trim();
+ if (!color || color.charAt(0) != '#') return;
+ $('#highlightColor').css('background-color', color);
+ });
+
+ $('body').on('submit', '#highlightTermForm', function(e) {
+ e.preventDefault();
+
+ var count = 0;
+ while (count < opts.highlightLimit) {
+ var term = $('#highlightTermInput'+count).val();
+ if (term) {
+ term = term.trim();
+ if (term === '') {
+ opts.highlightTerms[count] = null;
+ } else {
+ opts.highlightTerms[count] = term.toLowerCase();
+ }
+ } else {
+ opts.highlightTerms[count] = null;
+ }
+ count++;
+ }
+
+ var color = $('#highlightColor').val();
+ color = color.trim();
+ if (color == '' || color.charAt(0) != '#') {
+ opts.highlightColor = '#FFFF00';
+ } else {
+ opts.highlightColor = color;
+ }
+ var $popup = $('#highlightPopup').closest('.popup');
+ $popup.remove();
+
+ setCookie('highlightterms', JSON.stringify(opts.highlightTerms), 365);
+ setCookie('highlightcolor', opts.highlightColor, 365);
+ });
+
+ $('#clearMessages').click(function() {
+ $messages.empty();
+ opts.messageCount = 0;
+ });
+
+ // Tell BYOND to give us a macro list.
+ // I don't know why but for some retarded reason,
+ // You need to activate hotkeymode before you can winget the macros in it.
+ runByond('byond://winset?id=mainwindow¯o=hotkeymode')
+ runByond('byond://winset?id=mainwindow¯o=macro')
+
+ runByond('byond://winget?callback=wingetMacros&id=hotkeymode.*&property=command');
+
+ /*****************************************
+ *
+ * KICK EVERYTHING OFF
+ *
+ ******************************************/
+
+ runByond('?_src_=chat&proc=doneLoading');
+ if ($('#loading').is(':visible')) {
+ $('#loading').remove();
+ }
+ $('#userBar').show();
+ opts.priorChatHeight = $(window).height();
+});
diff --git a/goon/browserassets/js/jquery.min.js b/goon/browserassets/js/jquery.min.js
new file mode 100644
index 00000000000..c5c648255c1
--- /dev/null
+++ b/goon/browserassets/js/jquery.min.js
@@ -0,0 +1,9789 @@
+/*!
+ * jQuery JavaScript Library v1.10.2
+ * http://jquery.com/
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ *
+ * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: 2013-07-03T13:48Z
+ */
+(function( window, undefined ) {
+
+// Can't do this because several apps including ASP.NET trace
+// the stack via arguments.caller.callee and Firefox dies if
+// you try to trace through "use strict" call chains. (#13335)
+// Support: Firefox 18+
+//"use strict";
+var
+ // The deferred used on DOM ready
+ readyList,
+
+ // A central reference to the root jQuery(document)
+ rootjQuery,
+
+ // Support: IE<10
+ // For `typeof xmlNode.method` instead of `xmlNode.method !== undefined`
+ core_strundefined = typeof undefined,
+
+ // Use the correct document accordingly with window argument (sandbox)
+ location = window.location,
+ document = window.document,
+ docElem = document.documentElement,
+
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$,
+
+ // [[Class]] -> type pairs
+ class2type = {},
+
+ // List of deleted data cache ids, so we can reuse them
+ core_deletedIds = [],
+
+ core_version = "1.10.2",
+
+ // Save a reference to some core methods
+ core_concat = core_deletedIds.concat,
+ core_push = core_deletedIds.push,
+ core_slice = core_deletedIds.slice,
+ core_indexOf = core_deletedIds.indexOf,
+ core_toString = class2type.toString,
+ core_hasOwn = class2type.hasOwnProperty,
+ core_trim = core_version.trim,
+
+ // Define a local copy of jQuery
+ jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.fn.init( selector, context, rootjQuery );
+ },
+
+ // Used for matching numbers
+ core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
+
+ // Used for splitting on whitespace
+ core_rnotwhite = /\S+/g,
+
+ // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
+ rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
+
+ // A simple way to check for HTML strings
+ // Prioritize #id over to avoid XSS via location.hash (#9521)
+ // Strict HTML recognition (#11290: must start with <)
+ rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
+
+ // Match a standalone tag
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
+
+ // JSON RegExp
+ rvalidchars = /^[\],:{}\s]*$/,
+ rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
+ rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
+ rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
+
+ // Matches dashed string for camelizing
+ rmsPrefix = /^-ms-/,
+ rdashAlpha = /-([\da-z])/gi,
+
+ // Used by jQuery.camelCase as callback to replace()
+ fcamelCase = function( all, letter ) {
+ return letter.toUpperCase();
+ },
+
+ // The ready event handler
+ completed = function( event ) {
+
+ // readyState === "complete" is good enough for us to call the dom ready in oldIE
+ if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
+ detach();
+ jQuery.ready();
+ }
+ },
+ // Clean-up method for dom ready events
+ detach = function() {
+ if ( document.addEventListener ) {
+ document.removeEventListener( "DOMContentLoaded", completed, false );
+ window.removeEventListener( "load", completed, false );
+
+ } else {
+ document.detachEvent( "onreadystatechange", completed );
+ window.detachEvent( "onload", completed );
+ }
+ };
+
+jQuery.fn = jQuery.prototype = {
+ // The current version of jQuery being used
+ jquery: core_version,
+
+ constructor: jQuery,
+ init: function( selector, context, rootjQuery ) {
+ var match, elem;
+
+ // HANDLE: $(""), $(null), $(undefined), $(false)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
+ // Assume that strings that start and end with <> are HTML and skip the regex check
+ match = [ null, selector, null ];
+
+ } else {
+ match = rquickExpr.exec( selector );
+ }
+
+ // Match html or make sure no context is specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ context = context instanceof jQuery ? context[0] : context;
+
+ // scripts is true for back-compat
+ jQuery.merge( this, jQuery.parseHTML(
+ match[1],
+ context && context.nodeType ? context.ownerDocument || context : document,
+ true
+ ) );
+
+ // HANDLE: $(html, props)
+ if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
+ for ( match in context ) {
+ // Properties of context are called as methods if possible
+ if ( jQuery.isFunction( this[ match ] ) ) {
+ this[ match ]( context[ match ] );
+
+ // ...and otherwise set as attributes
+ } else {
+ this.attr( match, context[ match ] );
+ }
+ }
+ }
+
+ return this;
+
+ // HANDLE: $(#id)
+ } else {
+ elem = document.getElementById( match[2] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id !== match[2] ) {
+ return rootjQuery.find( selector );
+ }
+
+ // Otherwise, we inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return ( context || rootjQuery ).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return this.constructor( context ).find( selector );
+ }
+
+ // HANDLE: $(DOMElement)
+ } else if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return rootjQuery.ready( selector );
+ }
+
+ if ( selector.selector !== undefined ) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.makeArray( selector, this );
+ },
+
+ // Start with an empty selector
+ selector: "",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ toArray: function() {
+ return core_slice.call( this );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num == null ?
+
+ // Return a 'clean' array
+ this.toArray() :
+
+ // Return just the object
+ ( num < 0 ? this[ this.length + num ] : this[ num ] );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems ) {
+
+ // Build a new jQuery matched element set
+ var ret = jQuery.merge( this.constructor(), elems );
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+ ret.context = this.context;
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ ready: function( fn ) {
+ // Add the callback
+ jQuery.ready.promise().done( fn );
+
+ return this;
+ },
+
+ slice: function() {
+ return this.pushStack( core_slice.apply( this, arguments ) );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ eq: function( i ) {
+ var len = this.length,
+ j = +i + ( i < 0 ? len : 0 );
+ return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ end: function() {
+ return this.prevObject || this.constructor(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: core_push,
+ sort: [].sort,
+ splice: [].splice
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+jQuery.extend = jQuery.fn.extend = function() {
+ var src, copyIsArray, copy, name, options, clone,
+ target = arguments[0] || {},
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( length === i ) {
+ target = this;
+ --i;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && jQuery.isArray(src) ? src : [];
+
+ } else {
+ clone = src && jQuery.isPlainObject(src) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ // Unique for each copy of jQuery on the page
+ // Non-digits removed to match rinlinejQuery
+ expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
+
+ noConflict: function( deep ) {
+ if ( window.$ === jQuery ) {
+ window.$ = _$;
+ }
+
+ if ( deep && window.jQuery === jQuery ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+ },
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
+
+ // Hold (or release) the ready event
+ holdReady: function( hold ) {
+ if ( hold ) {
+ jQuery.readyWait++;
+ } else {
+ jQuery.ready( true );
+ }
+ },
+
+ // Handle when the DOM is ready
+ ready: function( wait ) {
+
+ // Abort if there are pending holds or we're already ready
+ if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
+ return;
+ }
+
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( !document.body ) {
+ return setTimeout( jQuery.ready );
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
+ // If there are functions bound, to execute
+ readyList.resolveWith( document, [ jQuery ] );
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.trigger ) {
+ jQuery( document ).trigger("ready").off("ready");
+ }
+ },
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return jQuery.type(obj) === "function";
+ },
+
+ isArray: Array.isArray || function( obj ) {
+ return jQuery.type(obj) === "array";
+ },
+
+ isWindow: function( obj ) {
+ /* jshint eqeqeq: false */
+ return obj != null && obj == obj.window;
+ },
+
+ isNumeric: function( obj ) {
+ return !isNaN( parseFloat(obj) ) && isFinite( obj );
+ },
+
+ type: function( obj ) {
+ if ( obj == null ) {
+ return String( obj );
+ }
+ return typeof obj === "object" || typeof obj === "function" ?
+ class2type[ core_toString.call(obj) ] || "object" :
+ typeof obj;
+ },
+
+ isPlainObject: function( obj ) {
+ var key;
+
+ // Must be an Object.
+ // Because of IE, we also have to check the presence of the constructor property.
+ // Make sure that DOM nodes and window objects don't pass through, as well
+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ try {
+ // Not own constructor property must be Object
+ if ( obj.constructor &&
+ !core_hasOwn.call(obj, "constructor") &&
+ !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ return false;
+ }
+ } catch ( e ) {
+ // IE8,9 Will throw exceptions on certain host objects #9897
+ return false;
+ }
+
+ // Support: IE<9
+ // Handle iteration over inherited properties before own properties.
+ if ( jQuery.support.ownLast ) {
+ for ( key in obj ) {
+ return core_hasOwn.call( obj, key );
+ }
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+ for ( key in obj ) {}
+
+ return key === undefined || core_hasOwn.call( obj, key );
+ },
+
+ isEmptyObject: function( obj ) {
+ var name;
+ for ( name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ error: function( msg ) {
+ throw new Error( msg );
+ },
+
+ // data: string of html
+ // context (optional): If specified, the fragment will be created in this context, defaults to document
+ // keepScripts (optional): If true, will include scripts passed in the html string
+ parseHTML: function( data, context, keepScripts ) {
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+ if ( typeof context === "boolean" ) {
+ keepScripts = context;
+ context = false;
+ }
+ context = context || document;
+
+ var parsed = rsingleTag.exec( data ),
+ scripts = !keepScripts && [];
+
+ // Single tag
+ if ( parsed ) {
+ return [ context.createElement( parsed[1] ) ];
+ }
+
+ parsed = jQuery.buildFragment( [ data ], context, scripts );
+ if ( scripts ) {
+ jQuery( scripts ).remove();
+ }
+ return jQuery.merge( [], parsed.childNodes );
+ },
+
+ parseJSON: function( data ) {
+ // Attempt to parse using the native JSON parser first
+ if ( window.JSON && window.JSON.parse ) {
+ return window.JSON.parse( data );
+ }
+
+ if ( data === null ) {
+ return data;
+ }
+
+ if ( typeof data === "string" ) {
+
+ // Make sure leading/trailing whitespace is removed (IE can't handle it)
+ data = jQuery.trim( data );
+
+ if ( data ) {
+ // Make sure the incoming data is actual JSON
+ // Logic borrowed from http://json.org/json2.js
+ if ( rvalidchars.test( data.replace( rvalidescape, "@" )
+ .replace( rvalidtokens, "]" )
+ .replace( rvalidbraces, "")) ) {
+
+ return ( new Function( "return " + data ) )();
+ }
+ }
+ }
+
+ jQuery.error( "Invalid JSON: " + data );
+ },
+
+ // Cross-browser xml parsing
+ parseXML: function( data ) {
+ var xml, tmp;
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+ try {
+ if ( window.DOMParser ) { // Standard
+ tmp = new DOMParser();
+ xml = tmp.parseFromString( data , "text/xml" );
+ } else { // IE
+ xml = new ActiveXObject( "Microsoft.XMLDOM" );
+ xml.async = "false";
+ xml.loadXML( data );
+ }
+ } catch( e ) {
+ xml = undefined;
+ }
+ if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
+ jQuery.error( "Invalid XML: " + data );
+ }
+ return xml;
+ },
+
+ noop: function() {},
+
+ // Evaluates a script in a global context
+ // Workarounds based on findings by Jim Driscoll
+ // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
+ globalEval: function( data ) {
+ if ( data && jQuery.trim( data ) ) {
+ // We use execScript on Internet Explorer
+ // We use an anonymous function so that context is window
+ // rather than jQuery in Firefox
+ ( window.execScript || function( data ) {
+ window[ "eval" ].call( window, data );
+ } )( data );
+ }
+ },
+
+ // Convert dashed to camelCase; used by the css and data modules
+ // Microsoft forgot to hump their vendor prefix (#9572)
+ camelCase: function( string ) {
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
+ },
+
+ // args is for internal usage only
+ each: function( obj, callback, args ) {
+ var value,
+ i = 0,
+ length = obj.length,
+ isArray = isArraylike( obj );
+
+ if ( args ) {
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback.apply( obj[ i ], args );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( i in obj ) {
+ value = callback.apply( obj[ i ], args );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback.call( obj[ i ], i, obj[ i ] );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( i in obj ) {
+ value = callback.call( obj[ i ], i, obj[ i ] );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ }
+ }
+
+ return obj;
+ },
+
+ // Use native String.trim function wherever possible
+ trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
+ function( text ) {
+ return text == null ?
+ "" :
+ core_trim.call( text );
+ } :
+
+ // Otherwise use our own trimming functionality
+ function( text ) {
+ return text == null ?
+ "" :
+ ( text + "" ).replace( rtrim, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( arr, results ) {
+ var ret = results || [];
+
+ if ( arr != null ) {
+ if ( isArraylike( Object(arr) ) ) {
+ jQuery.merge( ret,
+ typeof arr === "string" ?
+ [ arr ] : arr
+ );
+ } else {
+ core_push.call( ret, arr );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, arr, i ) {
+ var len;
+
+ if ( arr ) {
+ if ( core_indexOf ) {
+ return core_indexOf.call( arr, elem, i );
+ }
+
+ len = arr.length;
+ i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
+
+ for ( ; i < len; i++ ) {
+ // Skip accessing in sparse arrays
+ if ( i in arr && arr[ i ] === elem ) {
+ return i;
+ }
+ }
+ }
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ var l = second.length,
+ i = first.length,
+ j = 0;
+
+ if ( typeof l === "number" ) {
+ for ( ; j < l; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+ } else {
+ while ( second[j] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, inv ) {
+ var retVal,
+ ret = [],
+ i = 0,
+ length = elems.length;
+ inv = !!inv;
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( ; i < length; i++ ) {
+ retVal = !!callback( elems[ i ], i );
+ if ( inv !== retVal ) {
+ ret.push( elems[ i ] );
+ }
+ }
+
+ return ret;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var value,
+ i = 0,
+ length = elems.length,
+ isArray = isArraylike( elems ),
+ ret = [];
+
+ // Go through the array, translating each of the items to their
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+
+ // Go through every key on the object,
+ } else {
+ for ( i in elems ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+ }
+
+ // Flatten any nested arrays
+ return core_concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ // Bind a function to a context, optionally partially applying any
+ // arguments.
+ proxy: function( fn, context ) {
+ var args, proxy, tmp;
+
+ if ( typeof context === "string" ) {
+ tmp = fn[ context ];
+ context = fn;
+ fn = tmp;
+ }
+
+ // Quick check to determine if target is callable, in the spec
+ // this throws a TypeError, but we will just return undefined.
+ if ( !jQuery.isFunction( fn ) ) {
+ return undefined;
+ }
+
+ // Simulated bind
+ args = core_slice.call( arguments, 2 );
+ proxy = function() {
+ return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
+ };
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
+
+ return proxy;
+ },
+
+ // Multifunctional method to get and set values of a collection
+ // The value/s can optionally be executed if it's a function
+ access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
+ var i = 0,
+ length = elems.length,
+ bulk = key == null;
+
+ // Sets many values
+ if ( jQuery.type( key ) === "object" ) {
+ chainable = true;
+ for ( i in key ) {
+ jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
+ }
+
+ // Sets one value
+ } else if ( value !== undefined ) {
+ chainable = true;
+
+ if ( !jQuery.isFunction( value ) ) {
+ raw = true;
+ }
+
+ if ( bulk ) {
+ // Bulk operations run against the entire set
+ if ( raw ) {
+ fn.call( elems, value );
+ fn = null;
+
+ // ...except when executing function values
+ } else {
+ bulk = fn;
+ fn = function( elem, key, value ) {
+ return bulk.call( jQuery( elem ), value );
+ };
+ }
+ }
+
+ if ( fn ) {
+ for ( ; i < length; i++ ) {
+ fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
+ }
+ }
+ }
+
+ return chainable ?
+ elems :
+
+ // Gets
+ bulk ?
+ fn.call( elems ) :
+ length ? fn( elems[0], key ) : emptyGet;
+ },
+
+ now: function() {
+ return ( new Date() ).getTime();
+ },
+
+ // A method for quickly swapping in/out CSS properties to get correct calculations.
+ // Note: this method belongs to the css module but it's needed here for the support module.
+ // If support gets modularized, this method should be moved back to the css module.
+ swap: function( elem, options, callback, args ) {
+ var ret, name,
+ old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ ret = callback.apply( elem, args || [] );
+
+ // Revert the old values
+ for ( name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+
+ return ret;
+ }
+});
+
+jQuery.ready.promise = function( obj ) {
+ if ( !readyList ) {
+
+ readyList = jQuery.Deferred();
+
+ // Catch cases where $(document).ready() is called after the browser event has already occurred.
+ // we once tried to use readyState "interactive" here, but it caused issues like the one
+ // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
+ if ( document.readyState === "complete" ) {
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ setTimeout( jQuery.ready );
+
+ // Standards-based browsers support DOMContentLoaded
+ } else if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", completed, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", completed, false );
+
+ // If IE event model is used
+ } else {
+ // Ensure firing before onload, maybe late but safe also for iframes
+ document.attachEvent( "onreadystatechange", completed );
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", completed );
+
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var top = false;
+
+ try {
+ top = window.frameElement == null && document.documentElement;
+ } catch(e) {}
+
+ if ( top && top.doScroll ) {
+ (function doScrollCheck() {
+ if ( !jQuery.isReady ) {
+
+ try {
+ // Use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ top.doScroll("left");
+ } catch(e) {
+ return setTimeout( doScrollCheck, 50 );
+ }
+
+ // detach all dom ready events
+ detach();
+
+ // and execute any waiting functions
+ jQuery.ready();
+ }
+ })();
+ }
+ }
+ }
+ return readyList.promise( obj );
+};
+
+// Populate the class2type map
+jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+});
+
+function isArraylike( obj ) {
+ var length = obj.length,
+ type = jQuery.type( obj );
+
+ if ( jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ if ( obj.nodeType === 1 && length ) {
+ return true;
+ }
+
+ return type === "array" || type !== "function" &&
+ ( length === 0 ||
+ typeof length === "number" && length > 0 && ( length - 1 ) in obj );
+}
+
+// All jQuery objects should point back to these
+rootjQuery = jQuery(document);
+/*!
+ * Sizzle CSS Selector Engine v1.10.2
+ * http://sizzlejs.com/
+ *
+ * Copyright 2013 jQuery Foundation, Inc. and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: 2013-07-03
+ */
+(function( window, undefined ) {
+
+var i,
+ support,
+ cachedruns,
+ Expr,
+ getText,
+ isXML,
+ compile,
+ outermostContext,
+ sortInput,
+
+ // Local document vars
+ setDocument,
+ document,
+ docElem,
+ documentIsHTML,
+ rbuggyQSA,
+ rbuggyMatches,
+ matches,
+ contains,
+
+ // Instance-specific data
+ expando = "sizzle" + -(new Date()),
+ preferredDoc = window.document,
+ dirruns = 0,
+ done = 0,
+ classCache = createCache(),
+ tokenCache = createCache(),
+ compilerCache = createCache(),
+ hasDuplicate = false,
+ sortOrder = function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+ return 0;
+ },
+
+ // General-purpose constants
+ strundefined = typeof undefined,
+ MAX_NEGATIVE = 1 << 31,
+
+ // Instance methods
+ hasOwn = ({}).hasOwnProperty,
+ arr = [],
+ pop = arr.pop,
+ push_native = arr.push,
+ push = arr.push,
+ slice = arr.slice,
+ // Use a stripped-down indexOf if we can't use a native one
+ indexOf = arr.indexOf || function( elem ) {
+ var i = 0,
+ len = this.length;
+ for ( ; i < len; i++ ) {
+ if ( this[i] === elem ) {
+ return i;
+ }
+ }
+ return -1;
+ },
+
+ booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
+
+ // Regular expressions
+
+ // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
+ whitespace = "[\\x20\\t\\r\\n\\f]",
+ // http://www.w3.org/TR/css3-syntax/#characters
+ characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
+
+ // Loosely modeled on CSS identifier characters
+ // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
+ // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
+ identifier = characterEncoding.replace( "w", "w#" ),
+
+ // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
+ attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
+ "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
+
+ // Prefer arguments quoted,
+ // then not containing pseudos/brackets,
+ // then attribute selectors/non-parenthetical expressions,
+ // then anything else
+ // These preferences are here to reduce the number of selectors
+ // needing tokenize in the PSEUDO preFilter
+ pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
+
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
+
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
+ rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
+
+ rsibling = new RegExp( whitespace + "*[+~]" ),
+ rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ),
+
+ rpseudo = new RegExp( pseudos ),
+ ridentifier = new RegExp( "^" + identifier + "$" ),
+
+ matchExpr = {
+ "ID": new RegExp( "^#(" + characterEncoding + ")" ),
+ "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
+ "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
+ "ATTR": new RegExp( "^" + attributes ),
+ "PSEUDO": new RegExp( "^" + pseudos ),
+ "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
+ "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
+ // For use in libraries implementing .is()
+ // We use this for POS matching in `select`
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
+ whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
+ },
+
+ rnative = /^[^{]+\{\s*\[native \w/,
+
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors
+ rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
+
+ rinputs = /^(?:input|select|textarea|button)$/i,
+ rheader = /^h\d$/i,
+
+ rescape = /'|\\/g,
+
+ // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
+ runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
+ funescape = function( _, escaped, escapedWhitespace ) {
+ var high = "0x" + escaped - 0x10000;
+ // NaN means non-codepoint
+ // Support: Firefox
+ // Workaround erroneous numeric interpretation of +"0x"
+ return high !== high || escapedWhitespace ?
+ escaped :
+ // BMP codepoint
+ high < 0 ?
+ String.fromCharCode( high + 0x10000 ) :
+ // Supplemental Plane codepoint (surrogate pair)
+ String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
+ };
+
+// Optimize for push.apply( _, NodeList )
+try {
+ push.apply(
+ (arr = slice.call( preferredDoc.childNodes )),
+ preferredDoc.childNodes
+ );
+ // Support: Android<4.0
+ // Detect silently failing push.apply
+ arr[ preferredDoc.childNodes.length ].nodeType;
+} catch ( e ) {
+ push = { apply: arr.length ?
+
+ // Leverage slice if possible
+ function( target, els ) {
+ push_native.apply( target, slice.call(els) );
+ } :
+
+ // Support: IE<9
+ // Otherwise append directly
+ function( target, els ) {
+ var j = target.length,
+ i = 0;
+ // Can't trust NodeList.length
+ while ( (target[j++] = els[i++]) ) {}
+ target.length = j - 1;
+ }
+ };
+}
+
+function Sizzle( selector, context, results, seed ) {
+ var match, elem, m, nodeType,
+ // QSA vars
+ i, groups, old, nid, newContext, newSelector;
+
+ if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
+ setDocument( context );
+ }
+
+ context = context || document;
+ results = results || [];
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( documentIsHTML && !seed ) {
+
+ // Shortcuts
+ if ( (match = rquickExpr.exec( selector )) ) {
+ // Speed-up: Sizzle("#ID")
+ if ( (m = match[1]) ) {
+ if ( nodeType === 9 ) {
+ elem = context.getElementById( m );
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE, Opera, and Webkit return items
+ // by name instead of ID
+ if ( elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ } else {
+ return results;
+ }
+ } else {
+ // Context is not a document
+ if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
+ contains( context, elem ) && elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ }
+
+ // Speed-up: Sizzle("TAG")
+ } else if ( match[2] ) {
+ push.apply( results, context.getElementsByTagName( selector ) );
+ return results;
+
+ // Speed-up: Sizzle(".CLASS")
+ } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
+ push.apply( results, context.getElementsByClassName( m ) );
+ return results;
+ }
+ }
+
+ // QSA path
+ if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
+ nid = old = expando;
+ newContext = context;
+ newSelector = nodeType === 9 && selector;
+
+ // qSA works strangely on Element-rooted queries
+ // We can work around this by specifying an extra ID on the root
+ // and working up from there (Thanks to Andrew Dupont for the technique)
+ // IE 8 doesn't work on object elements
+ if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+ groups = tokenize( selector );
+
+ if ( (old = context.getAttribute("id")) ) {
+ nid = old.replace( rescape, "\\$&" );
+ } else {
+ context.setAttribute( "id", nid );
+ }
+ nid = "[id='" + nid + "'] ";
+
+ i = groups.length;
+ while ( i-- ) {
+ groups[i] = nid + toSelector( groups[i] );
+ }
+ newContext = rsibling.test( selector ) && context.parentNode || context;
+ newSelector = groups.join(",");
+ }
+
+ if ( newSelector ) {
+ try {
+ push.apply( results,
+ newContext.querySelectorAll( newSelector )
+ );
+ return results;
+ } catch(qsaError) {
+ } finally {
+ if ( !old ) {
+ context.removeAttribute("id");
+ }
+ }
+ }
+ }
+ }
+
+ // All others
+ return select( selector.replace( rtrim, "$1" ), context, results, seed );
+}
+
+/**
+ * Create key-value caches of limited size
+ * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
+ * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
+ * deleting the oldest entry
+ */
+function createCache() {
+ var keys = [];
+
+ function cache( key, value ) {
+ // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
+ if ( keys.push( key += " " ) > Expr.cacheLength ) {
+ // Only keep the most recent entries
+ delete cache[ keys.shift() ];
+ }
+ return (cache[ key ] = value);
+ }
+ return cache;
+}
+
+/**
+ * Mark a function for special use by Sizzle
+ * @param {Function} fn The function to mark
+ */
+function markFunction( fn ) {
+ fn[ expando ] = true;
+ return fn;
+}
+
+/**
+ * Support testing using an element
+ * @param {Function} fn Passed the created div and expects a boolean result
+ */
+function assert( fn ) {
+ var div = document.createElement("div");
+
+ try {
+ return !!fn( div );
+ } catch (e) {
+ return false;
+ } finally {
+ // Remove from its parent by default
+ if ( div.parentNode ) {
+ div.parentNode.removeChild( div );
+ }
+ // release memory in IE
+ div = null;
+ }
+}
+
+/**
+ * Adds the same handler for all of the specified attrs
+ * @param {String} attrs Pipe-separated list of attributes
+ * @param {Function} handler The method that will be applied
+ */
+function addHandle( attrs, handler ) {
+ var arr = attrs.split("|"),
+ i = attrs.length;
+
+ while ( i-- ) {
+ Expr.attrHandle[ arr[i] ] = handler;
+ }
+}
+
+/**
+ * Checks document order of two siblings
+ * @param {Element} a
+ * @param {Element} b
+ * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
+ */
+function siblingCheck( a, b ) {
+ var cur = b && a,
+ diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
+ ( ~b.sourceIndex || MAX_NEGATIVE ) -
+ ( ~a.sourceIndex || MAX_NEGATIVE );
+
+ // Use IE sourceIndex if available on both nodes
+ if ( diff ) {
+ return diff;
+ }
+
+ // Check if b follows a
+ if ( cur ) {
+ while ( (cur = cur.nextSibling) ) {
+ if ( cur === b ) {
+ return -1;
+ }
+ }
+ }
+
+ return a ? 1 : -1;
+}
+
+/**
+ * Returns a function to use in pseudos for input types
+ * @param {String} type
+ */
+function createInputPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for buttons
+ * @param {String} type
+ */
+function createButtonPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for positionals
+ * @param {Function} fn
+ */
+function createPositionalPseudo( fn ) {
+ return markFunction(function( argument ) {
+ argument = +argument;
+ return markFunction(function( seed, matches ) {
+ var j,
+ matchIndexes = fn( [], seed.length, argument ),
+ i = matchIndexes.length;
+
+ // Match elements found at the specified indexes
+ while ( i-- ) {
+ if ( seed[ (j = matchIndexes[i]) ] ) {
+ seed[j] = !(matches[j] = seed[j]);
+ }
+ }
+ });
+ });
+}
+
+/**
+ * Detect xml
+ * @param {Element|Object} elem An element or a document
+ */
+isXML = Sizzle.isXML = function( elem ) {
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+// Expose support vars for convenience
+support = Sizzle.support = {};
+
+/**
+ * Sets document-related variables once based on the current document
+ * @param {Element|Object} [doc] An element or document object to use to set the document
+ * @returns {Object} Returns the current document
+ */
+setDocument = Sizzle.setDocument = function( node ) {
+ var doc = node ? node.ownerDocument || node : preferredDoc,
+ parent = doc.defaultView;
+
+ // If no document and documentElement is available, return
+ if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
+ return document;
+ }
+
+ // Set our document
+ document = doc;
+ docElem = doc.documentElement;
+
+ // Support tests
+ documentIsHTML = !isXML( doc );
+
+ // Support: IE>8
+ // If iframe document is assigned to "document" variable and if iframe has been reloaded,
+ // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
+ // IE6-8 do not support the defaultView property so parent will be undefined
+ if ( parent && parent.attachEvent && parent !== parent.top ) {
+ parent.attachEvent( "onbeforeunload", function() {
+ setDocument();
+ });
+ }
+
+ /* Attributes
+ ---------------------------------------------------------------------- */
+
+ // Support: IE<8
+ // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
+ support.attributes = assert(function( div ) {
+ div.className = "i";
+ return !div.getAttribute("className");
+ });
+
+ /* getElement(s)By*
+ ---------------------------------------------------------------------- */
+
+ // Check if getElementsByTagName("*") returns only elements
+ support.getElementsByTagName = assert(function( div ) {
+ div.appendChild( doc.createComment("") );
+ return !div.getElementsByTagName("*").length;
+ });
+
+ // Check if getElementsByClassName can be trusted
+ support.getElementsByClassName = assert(function( div ) {
+ div.innerHTML = "";
+
+ // Support: Safari<4
+ // Catch class over-caching
+ div.firstChild.className = "i";
+ // Support: Opera<10
+ // Catch gEBCN failure to find non-leading classes
+ return div.getElementsByClassName("i").length === 2;
+ });
+
+ // Support: IE<10
+ // Check if getElementById returns elements by name
+ // The broken getElementById methods don't pick up programatically-set names,
+ // so use a roundabout getElementsByName test
+ support.getById = assert(function( div ) {
+ docElem.appendChild( div ).id = expando;
+ return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
+ });
+
+ // ID find and filter
+ if ( support.getById ) {
+ Expr.find["ID"] = function( id, context ) {
+ if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
+ var m = context.getElementById( id );
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ return m && m.parentNode ? [m] : [];
+ }
+ };
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ return elem.getAttribute("id") === attrId;
+ };
+ };
+ } else {
+ // Support: IE6/7
+ // getElementById is not reliable as a find shortcut
+ delete Expr.find["ID"];
+
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
+ return node && node.value === attrId;
+ };
+ };
+ }
+
+ // Tag
+ Expr.find["TAG"] = support.getElementsByTagName ?
+ function( tag, context ) {
+ if ( typeof context.getElementsByTagName !== strundefined ) {
+ return context.getElementsByTagName( tag );
+ }
+ } :
+ function( tag, context ) {
+ var elem,
+ tmp = [],
+ i = 0,
+ results = context.getElementsByTagName( tag );
+
+ // Filter out possible comments
+ if ( tag === "*" ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem.nodeType === 1 ) {
+ tmp.push( elem );
+ }
+ }
+
+ return tmp;
+ }
+ return results;
+ };
+
+ // Class
+ Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
+ if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {
+ return context.getElementsByClassName( className );
+ }
+ };
+
+ /* QSA/matchesSelector
+ ---------------------------------------------------------------------- */
+
+ // QSA and matchesSelector support
+
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
+ rbuggyMatches = [];
+
+ // qSa(:focus) reports false when true (Chrome 21)
+ // We allow this because of a bug in IE8/9 that throws an error
+ // whenever `document.activeElement` is accessed on an iframe
+ // So, we allow :focus to pass through QSA all the time to avoid the IE error
+ // See http://bugs.jquery.com/ticket/13378
+ rbuggyQSA = [];
+
+ if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
+ // Build QSA regex
+ // Regex strategy adopted from Diego Perini
+ assert(function( div ) {
+ // Select is set to empty string on purpose
+ // This is to test IE's treatment of not explicitly
+ // setting a boolean content attribute,
+ // since its presence should be enough
+ // http://bugs.jquery.com/ticket/12359
+ div.innerHTML = "";
+
+ // Support: IE8
+ // Boolean attributes and "value" are not treated correctly
+ if ( !div.querySelectorAll("[selected]").length ) {
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
+ }
+
+ // Webkit/Opera - :checked should return selected option elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ // IE8 throws error here and will not see later tests
+ if ( !div.querySelectorAll(":checked").length ) {
+ rbuggyQSA.push(":checked");
+ }
+ });
+
+ assert(function( div ) {
+
+ // Support: Opera 10-12/IE8
+ // ^= $= *= and empty values
+ // Should not select anything
+ // Support: Windows 8 Native Apps
+ // The type attribute is restricted during .innerHTML assignment
+ var input = doc.createElement("input");
+ input.setAttribute( "type", "hidden" );
+ div.appendChild( input ).setAttribute( "t", "" );
+
+ if ( div.querySelectorAll("[t^='']").length ) {
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
+ }
+
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
+ // IE8 throws error here and will not see later tests
+ if ( !div.querySelectorAll(":enabled").length ) {
+ rbuggyQSA.push( ":enabled", ":disabled" );
+ }
+
+ // Opera 10-11 does not throw on post-comma invalid pseudos
+ div.querySelectorAll("*,:x");
+ rbuggyQSA.push(",.*:");
+ });
+ }
+
+ if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector ||
+ docElem.mozMatchesSelector ||
+ docElem.oMatchesSelector ||
+ docElem.msMatchesSelector) )) ) {
+
+ assert(function( div ) {
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node (IE 9)
+ support.disconnectedMatch = matches.call( div, "div" );
+
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ matches.call( div, "[s!='']:x" );
+ rbuggyMatches.push( "!=", pseudos );
+ });
+ }
+
+ rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
+ rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
+
+ /* Contains
+ ---------------------------------------------------------------------- */
+
+ // Element contains another
+ // Purposefully does not implement inclusive descendent
+ // As in, an element does not contain itself
+ contains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ?
+ function( a, b ) {
+ var adown = a.nodeType === 9 ? a.documentElement : a,
+ bup = b && b.parentNode;
+ return a === bup || !!( bup && bup.nodeType === 1 && (
+ adown.contains ?
+ adown.contains( bup ) :
+ a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
+ ));
+ } :
+ function( a, b ) {
+ if ( b ) {
+ while ( (b = b.parentNode) ) {
+ if ( b === a ) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+
+ /* Sorting
+ ---------------------------------------------------------------------- */
+
+ // Document order sorting
+ sortOrder = docElem.compareDocumentPosition ?
+ function( a, b ) {
+
+ // Flag for duplicate removal
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b );
+
+ if ( compare ) {
+ // Disconnected nodes
+ if ( compare & 1 ||
+ (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
+
+ // Choose the first element that is related to our preferred document
+ if ( a === doc || contains(preferredDoc, a) ) {
+ return -1;
+ }
+ if ( b === doc || contains(preferredDoc, b) ) {
+ return 1;
+ }
+
+ // Maintain original order
+ return sortInput ?
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+ 0;
+ }
+
+ return compare & 4 ? -1 : 1;
+ }
+
+ // Not directly comparable, sort on existence of method
+ return a.compareDocumentPosition ? -1 : 1;
+ } :
+ function( a, b ) {
+ var cur,
+ i = 0,
+ aup = a.parentNode,
+ bup = b.parentNode,
+ ap = [ a ],
+ bp = [ b ];
+
+ // Exit early if the nodes are identical
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+
+ // Parentless nodes are either documents or disconnected
+ } else if ( !aup || !bup ) {
+ return a === doc ? -1 :
+ b === doc ? 1 :
+ aup ? -1 :
+ bup ? 1 :
+ sortInput ?
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+ 0;
+
+ // If the nodes are siblings, we can do a quick check
+ } else if ( aup === bup ) {
+ return siblingCheck( a, b );
+ }
+
+ // Otherwise we need full lists of their ancestors for comparison
+ cur = a;
+ while ( (cur = cur.parentNode) ) {
+ ap.unshift( cur );
+ }
+ cur = b;
+ while ( (cur = cur.parentNode) ) {
+ bp.unshift( cur );
+ }
+
+ // Walk down the tree looking for a discrepancy
+ while ( ap[i] === bp[i] ) {
+ i++;
+ }
+
+ return i ?
+ // Do a sibling check if the nodes have a common ancestor
+ siblingCheck( ap[i], bp[i] ) :
+
+ // Otherwise nodes in our document sort first
+ ap[i] === preferredDoc ? -1 :
+ bp[i] === preferredDoc ? 1 :
+ 0;
+ };
+
+ return doc;
+};
+
+Sizzle.matches = function( expr, elements ) {
+ return Sizzle( expr, null, null, elements );
+};
+
+Sizzle.matchesSelector = function( elem, expr ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace( rattributeQuotes, "='$1']" );
+
+ if ( support.matchesSelector && documentIsHTML &&
+ ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
+ ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
+
+ try {
+ var ret = matches.call( elem, expr );
+
+ // IE 9's matchesSelector returns false on disconnected nodes
+ if ( ret || support.disconnectedMatch ||
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9
+ elem.document && elem.document.nodeType !== 11 ) {
+ return ret;
+ }
+ } catch(e) {}
+ }
+
+ return Sizzle( expr, document, null, [elem] ).length > 0;
+};
+
+Sizzle.contains = function( context, elem ) {
+ // Set document vars if needed
+ if ( ( context.ownerDocument || context ) !== document ) {
+ setDocument( context );
+ }
+ return contains( context, elem );
+};
+
+Sizzle.attr = function( elem, name ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ var fn = Expr.attrHandle[ name.toLowerCase() ],
+ // Don't get fooled by Object.prototype properties (jQuery #13807)
+ val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
+ fn( elem, name, !documentIsHTML ) :
+ undefined;
+
+ return val === undefined ?
+ support.attributes || !documentIsHTML ?
+ elem.getAttribute( name ) :
+ (val = elem.getAttributeNode(name)) && val.specified ?
+ val.value :
+ null :
+ val;
+};
+
+Sizzle.error = function( msg ) {
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
+};
+
+/**
+ * Document sorting and removing duplicates
+ * @param {ArrayLike} results
+ */
+Sizzle.uniqueSort = function( results ) {
+ var elem,
+ duplicates = [],
+ j = 0,
+ i = 0;
+
+ // Unless we *know* we can detect duplicates, assume their presence
+ hasDuplicate = !support.detectDuplicates;
+ sortInput = !support.sortStable && results.slice( 0 );
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem === results[ i ] ) {
+ j = duplicates.push( i );
+ }
+ }
+ while ( j-- ) {
+ results.splice( duplicates[ j ], 1 );
+ }
+ }
+
+ return results;
+};
+
+/**
+ * Utility function for retrieving the text value of an array of DOM nodes
+ * @param {Array|Element} elem
+ */
+getText = Sizzle.getText = function( elem ) {
+ var node,
+ ret = "",
+ i = 0,
+ nodeType = elem.nodeType;
+
+ if ( !nodeType ) {
+ // If no nodeType, this is expected to be an array
+ for ( ; (node = elem[i]); i++ ) {
+ // Do not traverse comment nodes
+ ret += getText( node );
+ }
+ } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+ // Use textContent for elements
+ // innerText usage removed for consistency of new lines (see #11153)
+ if ( typeof elem.textContent === "string" ) {
+ return elem.textContent;
+ } else {
+ // Traverse its children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ ret += getText( elem );
+ }
+ }
+ } else if ( nodeType === 3 || nodeType === 4 ) {
+ return elem.nodeValue;
+ }
+ // Do not include comment or processing instruction nodes
+
+ return ret;
+};
+
+Expr = Sizzle.selectors = {
+
+ // Can be adjusted by the user
+ cacheLength: 50,
+
+ createPseudo: markFunction,
+
+ match: matchExpr,
+
+ attrHandle: {},
+
+ find: {},
+
+ relative: {
+ ">": { dir: "parentNode", first: true },
+ " ": { dir: "parentNode" },
+ "+": { dir: "previousSibling", first: true },
+ "~": { dir: "previousSibling" }
+ },
+
+ preFilter: {
+ "ATTR": function( match ) {
+ match[1] = match[1].replace( runescape, funescape );
+
+ // Move the given value to match[3] whether quoted or unquoted
+ match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
+
+ if ( match[2] === "~=" ) {
+ match[3] = " " + match[3] + " ";
+ }
+
+ return match.slice( 0, 4 );
+ },
+
+ "CHILD": function( match ) {
+ /* matches from matchExpr["CHILD"]
+ 1 type (only|nth|...)
+ 2 what (child|of-type)
+ 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
+ 4 xn-component of xn+y argument ([+-]?\d*n|)
+ 5 sign of xn-component
+ 6 x of xn-component
+ 7 sign of y-component
+ 8 y of y-component
+ */
+ match[1] = match[1].toLowerCase();
+
+ if ( match[1].slice( 0, 3 ) === "nth" ) {
+ // nth-* requires argument
+ if ( !match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ // numeric x and y parameters for Expr.filter.CHILD
+ // remember that false/true cast respectively to 0/1
+ match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
+ match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
+
+ // other types prohibit arguments
+ } else if ( match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ return match;
+ },
+
+ "PSEUDO": function( match ) {
+ var excess,
+ unquoted = !match[5] && match[2];
+
+ if ( matchExpr["CHILD"].test( match[0] ) ) {
+ return null;
+ }
+
+ // Accept quoted arguments as-is
+ if ( match[3] && match[4] !== undefined ) {
+ match[2] = match[4];
+
+ // Strip excess characters from unquoted arguments
+ } else if ( unquoted && rpseudo.test( unquoted ) &&
+ // Get excess from tokenize (recursively)
+ (excess = tokenize( unquoted, true )) &&
+ // advance to the next closing parenthesis
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
+
+ // excess is a negative index
+ match[0] = match[0].slice( 0, excess );
+ match[2] = unquoted.slice( 0, excess );
+ }
+
+ // Return only captures needed by the pseudo filter method (type and argument)
+ return match.slice( 0, 3 );
+ }
+ },
+
+ filter: {
+
+ "TAG": function( nodeNameSelector ) {
+ var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
+ return nodeNameSelector === "*" ?
+ function() { return true; } :
+ function( elem ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+ };
+ },
+
+ "CLASS": function( className ) {
+ var pattern = classCache[ className + " " ];
+
+ return pattern ||
+ (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
+ classCache( className, function( elem ) {
+ return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
+ });
+ },
+
+ "ATTR": function( name, operator, check ) {
+ return function( elem ) {
+ var result = Sizzle.attr( elem, name );
+
+ if ( result == null ) {
+ return operator === "!=";
+ }
+ if ( !operator ) {
+ return true;
+ }
+
+ result += "";
+
+ return operator === "=" ? result === check :
+ operator === "!=" ? result !== check :
+ operator === "^=" ? check && result.indexOf( check ) === 0 :
+ operator === "*=" ? check && result.indexOf( check ) > -1 :
+ operator === "$=" ? check && result.slice( -check.length ) === check :
+ operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
+ operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
+ false;
+ };
+ },
+
+ "CHILD": function( type, what, argument, first, last ) {
+ var simple = type.slice( 0, 3 ) !== "nth",
+ forward = type.slice( -4 ) !== "last",
+ ofType = what === "of-type";
+
+ return first === 1 && last === 0 ?
+
+ // Shortcut for :nth-*(n)
+ function( elem ) {
+ return !!elem.parentNode;
+ } :
+
+ function( elem, context, xml ) {
+ var cache, outerCache, node, diff, nodeIndex, start,
+ dir = simple !== forward ? "nextSibling" : "previousSibling",
+ parent = elem.parentNode,
+ name = ofType && elem.nodeName.toLowerCase(),
+ useCache = !xml && !ofType;
+
+ if ( parent ) {
+
+ // :(first|last|only)-(child|of-type)
+ if ( simple ) {
+ while ( dir ) {
+ node = elem;
+ while ( (node = node[ dir ]) ) {
+ if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
+ return false;
+ }
+ }
+ // Reverse direction for :only-* (if we haven't yet done so)
+ start = dir = type === "only" && !start && "nextSibling";
+ }
+ return true;
+ }
+
+ start = [ forward ? parent.firstChild : parent.lastChild ];
+
+ // non-xml :nth-child(...) stores cache data on `parent`
+ if ( forward && useCache ) {
+ // Seek `elem` from a previously-cached index
+ outerCache = parent[ expando ] || (parent[ expando ] = {});
+ cache = outerCache[ type ] || [];
+ nodeIndex = cache[0] === dirruns && cache[1];
+ diff = cache[0] === dirruns && cache[2];
+ node = nodeIndex && parent.childNodes[ nodeIndex ];
+
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+
+ // Fallback to seeking `elem` from the start
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ // When found, cache indexes on `parent` and break
+ if ( node.nodeType === 1 && ++diff && node === elem ) {
+ outerCache[ type ] = [ dirruns, nodeIndex, diff ];
+ break;
+ }
+ }
+
+ // Use previously-cached element index if available
+ } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
+ diff = cache[1];
+
+ // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
+ } else {
+ // Use the same loop as above to seek `elem` from the start
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
+ // Cache the index of each encountered element
+ if ( useCache ) {
+ (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
+ }
+
+ if ( node === elem ) {
+ break;
+ }
+ }
+ }
+ }
+
+ // Incorporate the offset, then check against cycle size
+ diff -= last;
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );
+ }
+ };
+ },
+
+ "PSEUDO": function( pseudo, argument ) {
+ // pseudo-class names are case-insensitive
+ // http://www.w3.org/TR/selectors/#pseudo-classes
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
+ // Remember that setFilters inherits from pseudos
+ var args,
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
+ Sizzle.error( "unsupported pseudo: " + pseudo );
+
+ // The user may use createPseudo to indicate that
+ // arguments are needed to create the filter function
+ // just as Sizzle does
+ if ( fn[ expando ] ) {
+ return fn( argument );
+ }
+
+ // But maintain support for old signatures
+ if ( fn.length > 1 ) {
+ args = [ pseudo, pseudo, "", argument ];
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
+ markFunction(function( seed, matches ) {
+ var idx,
+ matched = fn( seed, argument ),
+ i = matched.length;
+ while ( i-- ) {
+ idx = indexOf.call( seed, matched[i] );
+ seed[ idx ] = !( matches[ idx ] = matched[i] );
+ }
+ }) :
+ function( elem ) {
+ return fn( elem, 0, args );
+ };
+ }
+
+ return fn;
+ }
+ },
+
+ pseudos: {
+ // Potentially complex pseudos
+ "not": markFunction(function( selector ) {
+ // Trim the selector passed to compile
+ // to avoid treating leading and trailing
+ // spaces as combinators
+ var input = [],
+ results = [],
+ matcher = compile( selector.replace( rtrim, "$1" ) );
+
+ return matcher[ expando ] ?
+ markFunction(function( seed, matches, context, xml ) {
+ var elem,
+ unmatched = matcher( seed, null, xml, [] ),
+ i = seed.length;
+
+ // Match elements unmatched by `matcher`
+ while ( i-- ) {
+ if ( (elem = unmatched[i]) ) {
+ seed[i] = !(matches[i] = elem);
+ }
+ }
+ }) :
+ function( elem, context, xml ) {
+ input[0] = elem;
+ matcher( input, null, xml, results );
+ return !results.pop();
+ };
+ }),
+
+ "has": markFunction(function( selector ) {
+ return function( elem ) {
+ return Sizzle( selector, elem ).length > 0;
+ };
+ }),
+
+ "contains": markFunction(function( text ) {
+ return function( elem ) {
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
+ };
+ }),
+
+ // "Whether an element is represented by a :lang() selector
+ // is based solely on the element's language value
+ // being equal to the identifier C,
+ // or beginning with the identifier C immediately followed by "-".
+ // The matching of C against the element's language value is performed case-insensitively.
+ // The identifier C does not have to be a valid language name."
+ // http://www.w3.org/TR/selectors/#lang-pseudo
+ "lang": markFunction( function( lang ) {
+ // lang value must be a valid identifier
+ if ( !ridentifier.test(lang || "") ) {
+ Sizzle.error( "unsupported lang: " + lang );
+ }
+ lang = lang.replace( runescape, funescape ).toLowerCase();
+ return function( elem ) {
+ var elemLang;
+ do {
+ if ( (elemLang = documentIsHTML ?
+ elem.lang :
+ elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
+
+ elemLang = elemLang.toLowerCase();
+ return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
+ }
+ } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
+ return false;
+ };
+ }),
+
+ // Miscellaneous
+ "target": function( elem ) {
+ var hash = window.location && window.location.hash;
+ return hash && hash.slice( 1 ) === elem.id;
+ },
+
+ "root": function( elem ) {
+ return elem === docElem;
+ },
+
+ "focus": function( elem ) {
+ return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
+ },
+
+ // Boolean properties
+ "enabled": function( elem ) {
+ return elem.disabled === false;
+ },
+
+ "disabled": function( elem ) {
+ return elem.disabled === true;
+ },
+
+ "checked": function( elem ) {
+ // In CSS3, :checked should return both checked and selected elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ var nodeName = elem.nodeName.toLowerCase();
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
+ },
+
+ "selected": function( elem ) {
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
+
+ return elem.selected === true;
+ },
+
+ // Contents
+ "empty": function( elem ) {
+ // http://www.w3.org/TR/selectors/#empty-pseudo
+ // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
+ // not comment, processing instructions, or others
+ // Thanks to Diego Perini for the nodeName shortcut
+ // Greater than "@" means alpha characters (specifically not starting with "#" or "?")
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ "parent": function( elem ) {
+ return !Expr.pseudos["empty"]( elem );
+ },
+
+ // Element/input types
+ "header": function( elem ) {
+ return rheader.test( elem.nodeName );
+ },
+
+ "input": function( elem ) {
+ return rinputs.test( elem.nodeName );
+ },
+
+ "button": function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === "button" || name === "button";
+ },
+
+ "text": function( elem ) {
+ var attr;
+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
+ // use getAttribute instead to test this case
+ return elem.nodeName.toLowerCase() === "input" &&
+ elem.type === "text" &&
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
+ },
+
+ // Position-in-collection
+ "first": createPositionalPseudo(function() {
+ return [ 0 ];
+ }),
+
+ "last": createPositionalPseudo(function( matchIndexes, length ) {
+ return [ length - 1 ];
+ }),
+
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ return [ argument < 0 ? argument + length : argument ];
+ }),
+
+ "even": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 0;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "odd": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 1;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; --i >= 0; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; ++i < length; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ })
+ }
+};
+
+Expr.pseudos["nth"] = Expr.pseudos["eq"];
+
+// Add button/input type pseudos
+for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
+ Expr.pseudos[ i ] = createInputPseudo( i );
+}
+for ( i in { submit: true, reset: true } ) {
+ Expr.pseudos[ i ] = createButtonPseudo( i );
+}
+
+// Easy API for creating new setFilters
+function setFilters() {}
+setFilters.prototype = Expr.filters = Expr.pseudos;
+Expr.setFilters = new setFilters();
+
+function tokenize( selector, parseOnly ) {
+ var matched, match, tokens, type,
+ soFar, groups, preFilters,
+ cached = tokenCache[ selector + " " ];
+
+ if ( cached ) {
+ return parseOnly ? 0 : cached.slice( 0 );
+ }
+
+ soFar = selector;
+ groups = [];
+ preFilters = Expr.preFilter;
+
+ while ( soFar ) {
+
+ // Comma and first run
+ if ( !matched || (match = rcomma.exec( soFar )) ) {
+ if ( match ) {
+ // Don't consume trailing commas as valid
+ soFar = soFar.slice( match[0].length ) || soFar;
+ }
+ groups.push( tokens = [] );
+ }
+
+ matched = false;
+
+ // Combinators
+ if ( (match = rcombinators.exec( soFar )) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ // Cast descendant combinators to space
+ type: match[0].replace( rtrim, " " )
+ });
+ soFar = soFar.slice( matched.length );
+ }
+
+ // Filters
+ for ( type in Expr.filter ) {
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
+ (match = preFilters[ type ]( match ))) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ type: type,
+ matches: match
+ });
+ soFar = soFar.slice( matched.length );
+ }
+ }
+
+ if ( !matched ) {
+ break;
+ }
+ }
+
+ // Return the length of the invalid excess
+ // if we're just parsing
+ // Otherwise, throw an error or return tokens
+ return parseOnly ?
+ soFar.length :
+ soFar ?
+ Sizzle.error( selector ) :
+ // Cache the tokens
+ tokenCache( selector, groups ).slice( 0 );
+}
+
+function toSelector( tokens ) {
+ var i = 0,
+ len = tokens.length,
+ selector = "";
+ for ( ; i < len; i++ ) {
+ selector += tokens[i].value;
+ }
+ return selector;
+}
+
+function addCombinator( matcher, combinator, base ) {
+ var dir = combinator.dir,
+ checkNonElements = base && dir === "parentNode",
+ doneName = done++;
+
+ return combinator.first ?
+ // Check against closest ancestor/preceding element
+ function( elem, context, xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ return matcher( elem, context, xml );
+ }
+ }
+ } :
+
+ // Check against all ancestor/preceding elements
+ function( elem, context, xml ) {
+ var data, cache, outerCache,
+ dirkey = dirruns + " " + doneName;
+
+ // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
+ if ( xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ if ( matcher( elem, context, xml ) ) {
+ return true;
+ }
+ }
+ }
+ } else {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ outerCache = elem[ expando ] || (elem[ expando ] = {});
+ if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
+ if ( (data = cache[1]) === true || data === cachedruns ) {
+ return data === true;
+ }
+ } else {
+ cache = outerCache[ dir ] = [ dirkey ];
+ cache[1] = matcher( elem, context, xml ) || cachedruns;
+ if ( cache[1] === true ) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ };
+}
+
+function elementMatcher( matchers ) {
+ return matchers.length > 1 ?
+ function( elem, context, xml ) {
+ var i = matchers.length;
+ while ( i-- ) {
+ if ( !matchers[i]( elem, context, xml ) ) {
+ return false;
+ }
+ }
+ return true;
+ } :
+ matchers[0];
+}
+
+function condense( unmatched, map, filter, context, xml ) {
+ var elem,
+ newUnmatched = [],
+ i = 0,
+ len = unmatched.length,
+ mapped = map != null;
+
+ for ( ; i < len; i++ ) {
+ if ( (elem = unmatched[i]) ) {
+ if ( !filter || filter( elem, context, xml ) ) {
+ newUnmatched.push( elem );
+ if ( mapped ) {
+ map.push( i );
+ }
+ }
+ }
+ }
+
+ return newUnmatched;
+}
+
+function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
+ if ( postFilter && !postFilter[ expando ] ) {
+ postFilter = setMatcher( postFilter );
+ }
+ if ( postFinder && !postFinder[ expando ] ) {
+ postFinder = setMatcher( postFinder, postSelector );
+ }
+ return markFunction(function( seed, results, context, xml ) {
+ var temp, i, elem,
+ preMap = [],
+ postMap = [],
+ preexisting = results.length,
+
+ // Get initial elements from seed or context
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
+
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization
+ matcherIn = preFilter && ( seed || !selector ) ?
+ condense( elems, preMap, preFilter, context, xml ) :
+ elems,
+
+ matcherOut = matcher ?
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
+
+ // ...intermediate processing is necessary
+ [] :
+
+ // ...otherwise use results directly
+ results :
+ matcherIn;
+
+ // Find primary matches
+ if ( matcher ) {
+ matcher( matcherIn, matcherOut, context, xml );
+ }
+
+ // Apply postFilter
+ if ( postFilter ) {
+ temp = condense( matcherOut, postMap );
+ postFilter( temp, [], context, xml );
+
+ // Un-match failing elements by moving them back to matcherIn
+ i = temp.length;
+ while ( i-- ) {
+ if ( (elem = temp[i]) ) {
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
+ }
+ }
+ }
+
+ if ( seed ) {
+ if ( postFinder || preFilter ) {
+ if ( postFinder ) {
+ // Get the final matcherOut by condensing this intermediate into postFinder contexts
+ temp = [];
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) ) {
+ // Restore matcherIn since elem is not yet a final match
+ temp.push( (matcherIn[i] = elem) );
+ }
+ }
+ postFinder( null, (matcherOut = []), temp, xml );
+ }
+
+ // Move matched elements from seed to results to keep them synchronized
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) &&
+ (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
+
+ seed[temp] = !(results[temp] = elem);
+ }
+ }
+ }
+
+ // Add elements to results, through postFinder if defined
+ } else {
+ matcherOut = condense(
+ matcherOut === results ?
+ matcherOut.splice( preexisting, matcherOut.length ) :
+ matcherOut
+ );
+ if ( postFinder ) {
+ postFinder( null, results, matcherOut, xml );
+ } else {
+ push.apply( results, matcherOut );
+ }
+ }
+ });
+}
+
+function matcherFromTokens( tokens ) {
+ var checkContext, matcher, j,
+ len = tokens.length,
+ leadingRelative = Expr.relative[ tokens[0].type ],
+ implicitRelative = leadingRelative || Expr.relative[" "],
+ i = leadingRelative ? 1 : 0,
+
+ // The foundational matcher ensures that elements are reachable from top-level context(s)
+ matchContext = addCombinator( function( elem ) {
+ return elem === checkContext;
+ }, implicitRelative, true ),
+ matchAnyContext = addCombinator( function( elem ) {
+ return indexOf.call( checkContext, elem ) > -1;
+ }, implicitRelative, true ),
+ matchers = [ function( elem, context, xml ) {
+ return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
+ (checkContext = context).nodeType ?
+ matchContext( elem, context, xml ) :
+ matchAnyContext( elem, context, xml ) );
+ } ];
+
+ for ( ; i < len; i++ ) {
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
+ matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
+ } else {
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
+
+ // Return special upon seeing a positional matcher
+ if ( matcher[ expando ] ) {
+ // Find the next relative operator (if any) for proper handling
+ j = ++i;
+ for ( ; j < len; j++ ) {
+ if ( Expr.relative[ tokens[j].type ] ) {
+ break;
+ }
+ }
+ return setMatcher(
+ i > 1 && elementMatcher( matchers ),
+ i > 1 && toSelector(
+ // If the preceding token was a descendant combinator, insert an implicit any-element `*`
+ tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
+ ).replace( rtrim, "$1" ),
+ matcher,
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
+ j < len && toSelector( tokens )
+ );
+ }
+ matchers.push( matcher );
+ }
+ }
+
+ return elementMatcher( matchers );
+}
+
+function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
+ // A counter to specify which element is currently being matched
+ var matcherCachedRuns = 0,
+ bySet = setMatchers.length > 0,
+ byElement = elementMatchers.length > 0,
+ superMatcher = function( seed, context, xml, results, expandContext ) {
+ var elem, j, matcher,
+ setMatched = [],
+ matchedCount = 0,
+ i = "0",
+ unmatched = seed && [],
+ outermost = expandContext != null,
+ contextBackup = outermostContext,
+ // We must always have either seed elements or context
+ elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
+ // Use integer dirruns iff this is the outermost matcher
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);
+
+ if ( outermost ) {
+ outermostContext = context !== document && context;
+ cachedruns = matcherCachedRuns;
+ }
+
+ // Add elements passing elementMatchers directly to results
+ // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
+ for ( ; (elem = elems[i]) != null; i++ ) {
+ if ( byElement && elem ) {
+ j = 0;
+ while ( (matcher = elementMatchers[j++]) ) {
+ if ( matcher( elem, context, xml ) ) {
+ results.push( elem );
+ break;
+ }
+ }
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ cachedruns = ++matcherCachedRuns;
+ }
+ }
+
+ // Track unmatched elements for set filters
+ if ( bySet ) {
+ // They will have gone through all possible matchers
+ if ( (elem = !matcher && elem) ) {
+ matchedCount--;
+ }
+
+ // Lengthen the array for every element, matched or not
+ if ( seed ) {
+ unmatched.push( elem );
+ }
+ }
+ }
+
+ // Apply set filters to unmatched elements
+ matchedCount += i;
+ if ( bySet && i !== matchedCount ) {
+ j = 0;
+ while ( (matcher = setMatchers[j++]) ) {
+ matcher( unmatched, setMatched, context, xml );
+ }
+
+ if ( seed ) {
+ // Reintegrate element matches to eliminate the need for sorting
+ if ( matchedCount > 0 ) {
+ while ( i-- ) {
+ if ( !(unmatched[i] || setMatched[i]) ) {
+ setMatched[i] = pop.call( results );
+ }
+ }
+ }
+
+ // Discard index placeholder values to get only actual matches
+ setMatched = condense( setMatched );
+ }
+
+ // Add matches to results
+ push.apply( results, setMatched );
+
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting
+ if ( outermost && !seed && setMatched.length > 0 &&
+ ( matchedCount + setMatchers.length ) > 1 ) {
+
+ Sizzle.uniqueSort( results );
+ }
+ }
+
+ // Override manipulation of globals by nested matchers
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ outermostContext = contextBackup;
+ }
+
+ return unmatched;
+ };
+
+ return bySet ?
+ markFunction( superMatcher ) :
+ superMatcher;
+}
+
+compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
+ var i,
+ setMatchers = [],
+ elementMatchers = [],
+ cached = compilerCache[ selector + " " ];
+
+ if ( !cached ) {
+ // Generate a function of recursive functions that can be used to check each element
+ if ( !group ) {
+ group = tokenize( selector );
+ }
+ i = group.length;
+ while ( i-- ) {
+ cached = matcherFromTokens( group[i] );
+ if ( cached[ expando ] ) {
+ setMatchers.push( cached );
+ } else {
+ elementMatchers.push( cached );
+ }
+ }
+
+ // Cache the compiled function
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
+ }
+ return cached;
+};
+
+function multipleContexts( selector, contexts, results ) {
+ var i = 0,
+ len = contexts.length;
+ for ( ; i < len; i++ ) {
+ Sizzle( selector, contexts[i], results );
+ }
+ return results;
+}
+
+function select( selector, context, results, seed ) {
+ var i, tokens, token, type, find,
+ match = tokenize( selector );
+
+ if ( !seed ) {
+ // Try to minimize operations if there is only one group
+ if ( match.length === 1 ) {
+
+ // Take a shortcut and set the context if the root selector is an ID
+ tokens = match[0] = match[0].slice( 0 );
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
+ support.getById && context.nodeType === 9 && documentIsHTML &&
+ Expr.relative[ tokens[1].type ] ) {
+
+ context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
+ if ( !context ) {
+ return results;
+ }
+ selector = selector.slice( tokens.shift().value.length );
+ }
+
+ // Fetch a seed set for right-to-left matching
+ i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
+ while ( i-- ) {
+ token = tokens[i];
+
+ // Abort if we hit a combinator
+ if ( Expr.relative[ (type = token.type) ] ) {
+ break;
+ }
+ if ( (find = Expr.find[ type ]) ) {
+ // Search, expanding context for leading sibling combinators
+ if ( (seed = find(
+ token.matches[0].replace( runescape, funescape ),
+ rsibling.test( tokens[0].type ) && context.parentNode || context
+ )) ) {
+
+ // If seed is empty or no tokens remain, we can return early
+ tokens.splice( i, 1 );
+ selector = seed.length && toSelector( tokens );
+ if ( !selector ) {
+ push.apply( results, seed );
+ return results;
+ }
+
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // Compile and execute a filtering function
+ // Provide `match` to avoid retokenization if we modified the selector above
+ compile( selector, match )(
+ seed,
+ context,
+ !documentIsHTML,
+ results,
+ rsibling.test( selector )
+ );
+ return results;
+}
+
+// One-time assignments
+
+// Sort stability
+support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
+
+// Support: Chrome<14
+// Always assume duplicates if they aren't passed to the comparison function
+support.detectDuplicates = hasDuplicate;
+
+// Initialize against the default document
+setDocument();
+
+// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
+// Detached nodes confoundingly follow *each other*
+support.sortDetached = assert(function( div1 ) {
+ // Should return 1, but returns 4 (following)
+ return div1.compareDocumentPosition( document.createElement("div") ) & 1;
+});
+
+// Support: IE<8
+// Prevent attribute/property "interpolation"
+// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+if ( !assert(function( div ) {
+ div.innerHTML = "";
+ return div.firstChild.getAttribute("href") === "#" ;
+}) ) {
+ addHandle( "type|href|height|width", function( elem, name, isXML ) {
+ if ( !isXML ) {
+ return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
+ }
+ });
+}
+
+// Support: IE<9
+// Use defaultValue in place of getAttribute("value")
+if ( !support.attributes || !assert(function( div ) {
+ div.innerHTML = "";
+ div.firstChild.setAttribute( "value", "" );
+ return div.firstChild.getAttribute( "value" ) === "";
+}) ) {
+ addHandle( "value", function( elem, name, isXML ) {
+ if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
+ return elem.defaultValue;
+ }
+ });
+}
+
+// Support: IE<9
+// Use getAttributeNode to fetch booleans when getAttribute lies
+if ( !assert(function( div ) {
+ return div.getAttribute("disabled") == null;
+}) ) {
+ addHandle( booleans, function( elem, name, isXML ) {
+ var val;
+ if ( !isXML ) {
+ return (val = elem.getAttributeNode( name )) && val.specified ?
+ val.value :
+ elem[ name ] === true ? name.toLowerCase() : null;
+ }
+ });
+}
+
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.pseudos;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+
+
+})( window );
+// String to Object options format cache
+var optionsCache = {};
+
+// Convert String-formatted options into Object-formatted ones and store in cache
+function createOptions( options ) {
+ var object = optionsCache[ options ] = {};
+ jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
+ object[ flag ] = true;
+ });
+ return object;
+}
+
+/*
+ * Create a callback list using the following parameters:
+ *
+ * options: an optional list of space-separated options that will change how
+ * the callback list behaves or a more traditional option object
+ *
+ * By default a callback list will act like an event callback list and can be
+ * "fired" multiple times.
+ *
+ * Possible options:
+ *
+ * once: will ensure the callback list can only be fired once (like a Deferred)
+ *
+ * memory: will keep track of previous values and will call any callback added
+ * after the list has been fired right away with the latest "memorized"
+ * values (like a Deferred)
+ *
+ * unique: will ensure a callback can only be added once (no duplicate in the list)
+ *
+ * stopOnFalse: interrupt callings when a callback returns false
+ *
+ */
+jQuery.Callbacks = function( options ) {
+
+ // Convert options from String-formatted to Object-formatted if needed
+ // (we check in cache first)
+ options = typeof options === "string" ?
+ ( optionsCache[ options ] || createOptions( options ) ) :
+ jQuery.extend( {}, options );
+
+ var // Flag to know if list is currently firing
+ firing,
+ // Last fire value (for non-forgettable lists)
+ memory,
+ // Flag to know if list was already fired
+ fired,
+ // End of the loop when firing
+ firingLength,
+ // Index of currently firing callback (modified by remove if needed)
+ firingIndex,
+ // First callback to fire (used internally by add and fireWith)
+ firingStart,
+ // Actual callback list
+ list = [],
+ // Stack of fire calls for repeatable lists
+ stack = !options.once && [],
+ // Fire callbacks
+ fire = function( data ) {
+ memory = options.memory && data;
+ fired = true;
+ firingIndex = firingStart || 0;
+ firingStart = 0;
+ firingLength = list.length;
+ firing = true;
+ for ( ; list && firingIndex < firingLength; firingIndex++ ) {
+ if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
+ memory = false; // To prevent further calls using add
+ break;
+ }
+ }
+ firing = false;
+ if ( list ) {
+ if ( stack ) {
+ if ( stack.length ) {
+ fire( stack.shift() );
+ }
+ } else if ( memory ) {
+ list = [];
+ } else {
+ self.disable();
+ }
+ }
+ },
+ // Actual Callbacks object
+ self = {
+ // Add a callback or a collection of callbacks to the list
+ add: function() {
+ if ( list ) {
+ // First, we save the current length
+ var start = list.length;
+ (function add( args ) {
+ jQuery.each( args, function( _, arg ) {
+ var type = jQuery.type( arg );
+ if ( type === "function" ) {
+ if ( !options.unique || !self.has( arg ) ) {
+ list.push( arg );
+ }
+ } else if ( arg && arg.length && type !== "string" ) {
+ // Inspect recursively
+ add( arg );
+ }
+ });
+ })( arguments );
+ // Do we need to add the callbacks to the
+ // current firing batch?
+ if ( firing ) {
+ firingLength = list.length;
+ // With memory, if we're not firing then
+ // we should call right away
+ } else if ( memory ) {
+ firingStart = start;
+ fire( memory );
+ }
+ }
+ return this;
+ },
+ // Remove a callback from the list
+ remove: function() {
+ if ( list ) {
+ jQuery.each( arguments, function( _, arg ) {
+ var index;
+ while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
+ list.splice( index, 1 );
+ // Handle firing indexes
+ if ( firing ) {
+ if ( index <= firingLength ) {
+ firingLength--;
+ }
+ if ( index <= firingIndex ) {
+ firingIndex--;
+ }
+ }
+ }
+ });
+ }
+ return this;
+ },
+ // Check if a given callback is in the list.
+ // If no argument is given, return whether or not list has callbacks attached.
+ has: function( fn ) {
+ return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
+ },
+ // Remove all callbacks from the list
+ empty: function() {
+ list = [];
+ firingLength = 0;
+ return this;
+ },
+ // Have the list do nothing anymore
+ disable: function() {
+ list = stack = memory = undefined;
+ return this;
+ },
+ // Is it disabled?
+ disabled: function() {
+ return !list;
+ },
+ // Lock the list in its current state
+ lock: function() {
+ stack = undefined;
+ if ( !memory ) {
+ self.disable();
+ }
+ return this;
+ },
+ // Is it locked?
+ locked: function() {
+ return !stack;
+ },
+ // Call all callbacks with the given context and arguments
+ fireWith: function( context, args ) {
+ if ( list && ( !fired || stack ) ) {
+ args = args || [];
+ args = [ context, args.slice ? args.slice() : args ];
+ if ( firing ) {
+ stack.push( args );
+ } else {
+ fire( args );
+ }
+ }
+ return this;
+ },
+ // Call all the callbacks with the given arguments
+ fire: function() {
+ self.fireWith( this, arguments );
+ return this;
+ },
+ // To know if the callbacks have already been called at least once
+ fired: function() {
+ return !!fired;
+ }
+ };
+
+ return self;
+};
+jQuery.extend({
+
+ Deferred: function( func ) {
+ var tuples = [
+ // action, add listener, listener list, final state
+ [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
+ [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
+ [ "notify", "progress", jQuery.Callbacks("memory") ]
+ ],
+ state = "pending",
+ promise = {
+ state: function() {
+ return state;
+ },
+ always: function() {
+ deferred.done( arguments ).fail( arguments );
+ return this;
+ },
+ then: function( /* fnDone, fnFail, fnProgress */ ) {
+ var fns = arguments;
+ return jQuery.Deferred(function( newDefer ) {
+ jQuery.each( tuples, function( i, tuple ) {
+ var action = tuple[ 0 ],
+ fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
+ // deferred[ done | fail | progress ] for forwarding actions to newDefer
+ deferred[ tuple[1] ](function() {
+ var returned = fn && fn.apply( this, arguments );
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
+ returned.promise()
+ .done( newDefer.resolve )
+ .fail( newDefer.reject )
+ .progress( newDefer.notify );
+ } else {
+ newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
+ }
+ });
+ });
+ fns = null;
+ }).promise();
+ },
+ // Get a promise for this deferred
+ // If obj is provided, the promise aspect is added to the object
+ promise: function( obj ) {
+ return obj != null ? jQuery.extend( obj, promise ) : promise;
+ }
+ },
+ deferred = {};
+
+ // Keep pipe for back-compat
+ promise.pipe = promise.then;
+
+ // Add list-specific methods
+ jQuery.each( tuples, function( i, tuple ) {
+ var list = tuple[ 2 ],
+ stateString = tuple[ 3 ];
+
+ // promise[ done | fail | progress ] = list.add
+ promise[ tuple[1] ] = list.add;
+
+ // Handle state
+ if ( stateString ) {
+ list.add(function() {
+ // state = [ resolved | rejected ]
+ state = stateString;
+
+ // [ reject_list | resolve_list ].disable; progress_list.lock
+ }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
+ }
+
+ // deferred[ resolve | reject | notify ]
+ deferred[ tuple[0] ] = function() {
+ deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
+ return this;
+ };
+ deferred[ tuple[0] + "With" ] = list.fireWith;
+ });
+
+ // Make the deferred a promise
+ promise.promise( deferred );
+
+ // Call given func if any
+ if ( func ) {
+ func.call( deferred, deferred );
+ }
+
+ // All done!
+ return deferred;
+ },
+
+ // Deferred helper
+ when: function( subordinate /* , ..., subordinateN */ ) {
+ var i = 0,
+ resolveValues = core_slice.call( arguments ),
+ length = resolveValues.length,
+
+ // the count of uncompleted subordinates
+ remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
+
+ // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
+ deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
+
+ // Update function for both resolve and progress values
+ updateFunc = function( i, contexts, values ) {
+ return function( value ) {
+ contexts[ i ] = this;
+ values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
+ if( values === progressValues ) {
+ deferred.notifyWith( contexts, values );
+ } else if ( !( --remaining ) ) {
+ deferred.resolveWith( contexts, values );
+ }
+ };
+ },
+
+ progressValues, progressContexts, resolveContexts;
+
+ // add listeners to Deferred subordinates; treat others as resolved
+ if ( length > 1 ) {
+ progressValues = new Array( length );
+ progressContexts = new Array( length );
+ resolveContexts = new Array( length );
+ for ( ; i < length; i++ ) {
+ if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
+ resolveValues[ i ].promise()
+ .done( updateFunc( i, resolveContexts, resolveValues ) )
+ .fail( deferred.reject )
+ .progress( updateFunc( i, progressContexts, progressValues ) );
+ } else {
+ --remaining;
+ }
+ }
+ }
+
+ // if we're not waiting on anything, resolve the master
+ if ( !remaining ) {
+ deferred.resolveWith( resolveContexts, resolveValues );
+ }
+
+ return deferred.promise();
+ }
+});
+jQuery.support = (function( support ) {
+
+ var all, a, input, select, fragment, opt, eventName, isSupported, i,
+ div = document.createElement("div");
+
+ // Setup
+ div.setAttribute( "className", "t" );
+ div.innerHTML = "
a";
+
+ // Finish early in limited (non-browser) environments
+ all = div.getElementsByTagName("*") || [];
+ a = div.getElementsByTagName("a")[ 0 ];
+ if ( !a || !a.style || !all.length ) {
+ return support;
+ }
+
+ // First batch of tests
+ select = document.createElement("select");
+ opt = select.appendChild( document.createElement("option") );
+ input = div.getElementsByTagName("input")[ 0 ];
+
+ a.style.cssText = "top:1px;float:left;opacity:.5";
+
+ // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
+ support.getSetAttribute = div.className !== "t";
+
+ // IE strips leading whitespace when .innerHTML is used
+ support.leadingWhitespace = div.firstChild.nodeType === 3;
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ support.tbody = !div.getElementsByTagName("tbody").length;
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ support.htmlSerialize = !!div.getElementsByTagName("link").length;
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText instead)
+ support.style = /top/.test( a.getAttribute("style") );
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ support.hrefNormalized = a.getAttribute("href") === "/a";
+
+ // Make sure that element opacity exists
+ // (IE uses filter instead)
+ // Use a regex to work around a WebKit issue. See #5145
+ support.opacity = /^0.5/.test( a.style.opacity );
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ support.cssFloat = !!a.style.cssFloat;
+
+ // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
+ support.checkOn = !!input.value;
+
+ // Make sure that a selected-by-default option has a working selected property.
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+ support.optSelected = opt.selected;
+
+ // Tests for enctype support on a form (#6743)
+ support.enctype = !!document.createElement("form").enctype;
+
+ // Makes sure cloning an html5 element does not cause problems
+ // Where outerHTML is undefined, this still works
+ support.html5Clone = document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>";
+
+ // Will be defined later
+ support.inlineBlockNeedsLayout = false;
+ support.shrinkWrapBlocks = false;
+ support.pixelPosition = false;
+ support.deleteExpando = true;
+ support.noCloneEvent = true;
+ support.reliableMarginRight = true;
+ support.boxSizingReliable = true;
+
+ // Make sure checked status is properly cloned
+ input.checked = true;
+ support.noCloneChecked = input.cloneNode( true ).checked;
+
+ // Make sure that the options inside disabled selects aren't marked as disabled
+ // (WebKit marks them as disabled)
+ select.disabled = true;
+ support.optDisabled = !opt.disabled;
+
+ // Support: IE<9
+ try {
+ delete div.test;
+ } catch( e ) {
+ support.deleteExpando = false;
+ }
+
+ // Check if we can trust getAttribute("value")
+ input = document.createElement("input");
+ input.setAttribute( "value", "" );
+ support.input = input.getAttribute( "value" ) === "";
+
+ // Check if an input maintains its value after becoming a radio
+ input.value = "t";
+ input.setAttribute( "type", "radio" );
+ support.radioValue = input.value === "t";
+
+ // #11217 - WebKit loses check when the name is after the checked attribute
+ input.setAttribute( "checked", "t" );
+ input.setAttribute( "name", "t" );
+
+ fragment = document.createDocumentFragment();
+ fragment.appendChild( input );
+
+ // Check if a disconnected checkbox will retain its checked
+ // value of true after appended to the DOM (IE6/7)
+ support.appendChecked = input.checked;
+
+ // WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+ // Support: IE<9
+ // Opera does not clone events (and typeof div.attachEvent === undefined).
+ // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
+ if ( div.attachEvent ) {
+ div.attachEvent( "onclick", function() {
+ support.noCloneEvent = false;
+ });
+
+ div.cloneNode( true ).click();
+ }
+
+ // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
+ // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
+ for ( i in { submit: true, change: true, focusin: true }) {
+ div.setAttribute( eventName = "on" + i, "t" );
+
+ support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
+ }
+
+ div.style.backgroundClip = "content-box";
+ div.cloneNode( true ).style.backgroundClip = "";
+ support.clearCloneStyle = div.style.backgroundClip === "content-box";
+
+ // Support: IE<9
+ // Iteration over object's inherited properties before its own.
+ for ( i in jQuery( support ) ) {
+ break;
+ }
+ support.ownLast = i !== "0";
+
+ // Run tests that need a body at doc ready
+ jQuery(function() {
+ var container, marginDiv, tds,
+ divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
+ body = document.getElementsByTagName("body")[0];
+
+ if ( !body ) {
+ // Return for frameset docs that don't have a body
+ return;
+ }
+
+ container = document.createElement("div");
+ container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
+
+ body.appendChild( container ).appendChild( div );
+
+ // Support: IE8
+ // Check if table cells still have offsetWidth/Height when they are set
+ // to display:none and there are still other visible table cells in a
+ // table row; if so, offsetWidth/Height are not reliable for use when
+ // determining if an element has been hidden directly using
+ // display:none (it is still safe to use offsets if a parent element is
+ // hidden; don safety goggles and see bug #4512 for more information).
+ div.innerHTML = "
t
";
+ tds = div.getElementsByTagName("td");
+ tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
+ isSupported = ( tds[ 0 ].offsetHeight === 0 );
+
+ tds[ 0 ].style.display = "";
+ tds[ 1 ].style.display = "none";
+
+ // Support: IE8
+ // Check if empty table cells still have offsetWidth/Height
+ support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
+
+ // Check box-sizing and margin behavior.
+ div.innerHTML = "";
+ div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
+
+ // Workaround failing boxSizing test due to offsetWidth returning wrong value
+ // with some non-1 values of body zoom, ticket #13543
+ jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() {
+ support.boxSizing = div.offsetWidth === 4;
+ });
+
+ // Use window.getComputedStyle because jsdom on node.js will break without it.
+ if ( window.getComputedStyle ) {
+ support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
+ support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
+
+ // Check if div with explicit width and no margin-right incorrectly
+ // gets computed margin-right based on width of container. (#3333)
+ // Fails in WebKit before Feb 2011 nightlies
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ marginDiv = div.appendChild( document.createElement("div") );
+ marginDiv.style.cssText = div.style.cssText = divReset;
+ marginDiv.style.marginRight = marginDiv.style.width = "0";
+ div.style.width = "1px";
+
+ support.reliableMarginRight =
+ !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
+ }
+
+ if ( typeof div.style.zoom !== core_strundefined ) {
+ // Support: IE<8
+ // Check if natively block-level elements act like inline-block
+ // elements when setting their display to 'inline' and giving
+ // them layout
+ div.innerHTML = "";
+ div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
+ support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
+
+ // Support: IE6
+ // Check if elements with layout shrink-wrap their children
+ div.style.display = "block";
+ div.innerHTML = "";
+ div.firstChild.style.width = "5px";
+ support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
+
+ if ( support.inlineBlockNeedsLayout ) {
+ // Prevent IE 6 from affecting layout for positioned elements #11048
+ // Prevent IE from shrinking the body in IE 7 mode #12869
+ // Support: IE<8
+ body.style.zoom = 1;
+ }
+ }
+
+ body.removeChild( container );
+
+ // Null elements to avoid leaks in IE
+ container = div = tds = marginDiv = null;
+ });
+
+ // Null elements to avoid leaks in IE
+ all = select = fragment = opt = a = input = null;
+
+ return support;
+})({});
+
+var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
+ rmultiDash = /([A-Z])/g;
+
+function internalData( elem, name, data, pvt /* Internal Use Only */ ){
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var ret, thisCache,
+ internalKey = jQuery.expando,
+
+ // We have to handle DOM nodes and JS objects differently because IE6-7
+ // can't GC object references properly across the DOM-JS boundary
+ isNode = elem.nodeType,
+
+ // Only DOM nodes need the global jQuery cache; JS object data is
+ // attached directly to the object so GC can occur automatically
+ cache = isNode ? jQuery.cache : elem,
+
+ // Only defining an ID for JS objects if its cache already exists allows
+ // the code to shortcut on the same path as a DOM node with no cache
+ id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
+
+ // Avoid doing any more work than we need to when trying to get data on an
+ // object that has no data at all
+ if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) {
+ return;
+ }
+
+ if ( !id ) {
+ // Only DOM nodes need a new unique ID for each element since their data
+ // ends up in the global cache
+ if ( isNode ) {
+ id = elem[ internalKey ] = core_deletedIds.pop() || jQuery.guid++;
+ } else {
+ id = internalKey;
+ }
+ }
+
+ if ( !cache[ id ] ) {
+ // Avoid exposing jQuery metadata on plain JS objects when the object
+ // is serialized using JSON.stringify
+ cache[ id ] = isNode ? {} : { toJSON: jQuery.noop };
+ }
+
+ // An object can be passed to jQuery.data instead of a key/value pair; this gets
+ // shallow copied over onto the existing cache
+ if ( typeof name === "object" || typeof name === "function" ) {
+ if ( pvt ) {
+ cache[ id ] = jQuery.extend( cache[ id ], name );
+ } else {
+ cache[ id ].data = jQuery.extend( cache[ id ].data, name );
+ }
+ }
+
+ thisCache = cache[ id ];
+
+ // jQuery data() is stored in a separate object inside the object's internal data
+ // cache in order to avoid key collisions between internal data and user-defined
+ // data.
+ if ( !pvt ) {
+ if ( !thisCache.data ) {
+ thisCache.data = {};
+ }
+
+ thisCache = thisCache.data;
+ }
+
+ if ( data !== undefined ) {
+ thisCache[ jQuery.camelCase( name ) ] = data;
+ }
+
+ // Check for both converted-to-camel and non-converted data property names
+ // If a data property was specified
+ if ( typeof name === "string" ) {
+
+ // First Try to find as-is property data
+ ret = thisCache[ name ];
+
+ // Test for null|undefined property data
+ if ( ret == null ) {
+
+ // Try to find the camelCased property
+ ret = thisCache[ jQuery.camelCase( name ) ];
+ }
+ } else {
+ ret = thisCache;
+ }
+
+ return ret;
+}
+
+function internalRemoveData( elem, name, pvt ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var thisCache, i,
+ isNode = elem.nodeType,
+
+ // See jQuery.data for more information
+ cache = isNode ? jQuery.cache : elem,
+ id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
+
+ // If there is already no cache entry for this object, there is no
+ // purpose in continuing
+ if ( !cache[ id ] ) {
+ return;
+ }
+
+ if ( name ) {
+
+ thisCache = pvt ? cache[ id ] : cache[ id ].data;
+
+ if ( thisCache ) {
+
+ // Support array or space separated string names for data keys
+ if ( !jQuery.isArray( name ) ) {
+
+ // try the string as a key before any manipulation
+ if ( name in thisCache ) {
+ name = [ name ];
+ } else {
+
+ // split the camel cased version by spaces unless a key with the spaces exists
+ name = jQuery.camelCase( name );
+ if ( name in thisCache ) {
+ name = [ name ];
+ } else {
+ name = name.split(" ");
+ }
+ }
+ } else {
+ // If "name" is an array of keys...
+ // When data is initially created, via ("key", "val") signature,
+ // keys will be converted to camelCase.
+ // Since there is no way to tell _how_ a key was added, remove
+ // both plain key and camelCase key. #12786
+ // This will only penalize the array argument path.
+ name = name.concat( jQuery.map( name, jQuery.camelCase ) );
+ }
+
+ i = name.length;
+ while ( i-- ) {
+ delete thisCache[ name[i] ];
+ }
+
+ // If there is no data left in the cache, we want to continue
+ // and let the cache object itself get destroyed
+ if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) {
+ return;
+ }
+ }
+ }
+
+ // See jQuery.data for more information
+ if ( !pvt ) {
+ delete cache[ id ].data;
+
+ // Don't destroy the parent cache unless the internal data object
+ // had been the only thing left in it
+ if ( !isEmptyDataObject( cache[ id ] ) ) {
+ return;
+ }
+ }
+
+ // Destroy the cache
+ if ( isNode ) {
+ jQuery.cleanData( [ elem ], true );
+
+ // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
+ /* jshint eqeqeq: false */
+ } else if ( jQuery.support.deleteExpando || cache != cache.window ) {
+ /* jshint eqeqeq: true */
+ delete cache[ id ];
+
+ // When all else fails, null
+ } else {
+ cache[ id ] = null;
+ }
+}
+
+jQuery.extend({
+ cache: {},
+
+ // The following elements throw uncatchable exceptions if you
+ // attempt to add expando properties to them.
+ noData: {
+ "applet": true,
+ "embed": true,
+ // Ban all objects except for Flash (which handle expandos)
+ "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
+ },
+
+ hasData: function( elem ) {
+ elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
+ return !!elem && !isEmptyDataObject( elem );
+ },
+
+ data: function( elem, name, data ) {
+ return internalData( elem, name, data );
+ },
+
+ removeData: function( elem, name ) {
+ return internalRemoveData( elem, name );
+ },
+
+ // For internal use only.
+ _data: function( elem, name, data ) {
+ return internalData( elem, name, data, true );
+ },
+
+ _removeData: function( elem, name ) {
+ return internalRemoveData( elem, name, true );
+ },
+
+ // A method for determining if a DOM node can handle the data expando
+ acceptData: function( elem ) {
+ // Do not set data on non-element because it will not be cleared (#8335).
+ if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {
+ return false;
+ }
+
+ var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
+
+ // nodes accept data unless otherwise specified; rejection can be conditional
+ return !noData || noData !== true && elem.getAttribute("classid") === noData;
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ) {
+ var attrs, name,
+ data = null,
+ i = 0,
+ elem = this[0];
+
+ // Special expections of .data basically thwart jQuery.access,
+ // so implement the relevant behavior ourselves
+
+ // Gets all values
+ if ( key === undefined ) {
+ if ( this.length ) {
+ data = jQuery.data( elem );
+
+ if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
+ attrs = elem.attributes;
+ for ( ; i < attrs.length; i++ ) {
+ name = attrs[i].name;
+
+ if ( name.indexOf("data-") === 0 ) {
+ name = jQuery.camelCase( name.slice(5) );
+
+ dataAttr( elem, name, data[ name ] );
+ }
+ }
+ jQuery._data( elem, "parsedAttrs", true );
+ }
+ }
+
+ return data;
+ }
+
+ // Sets multiple values
+ if ( typeof key === "object" ) {
+ return this.each(function() {
+ jQuery.data( this, key );
+ });
+ }
+
+ return arguments.length > 1 ?
+
+ // Sets one value
+ this.each(function() {
+ jQuery.data( this, key, value );
+ }) :
+
+ // Gets one value
+ // Try to fetch any internally stored data first
+ elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
+ },
+
+ removeData: function( key ) {
+ return this.each(function() {
+ jQuery.removeData( this, key );
+ });
+ }
+});
+
+function dataAttr( elem, key, data ) {
+ // If nothing was found internally, try to fetch any
+ // data from the HTML5 data-* attribute
+ if ( data === undefined && elem.nodeType === 1 ) {
+
+ var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
+
+ data = elem.getAttribute( name );
+
+ if ( typeof data === "string" ) {
+ try {
+ data = data === "true" ? true :
+ data === "false" ? false :
+ data === "null" ? null :
+ // Only convert to a number if it doesn't change the string
+ +data + "" === data ? +data :
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
+ data;
+ } catch( e ) {}
+
+ // Make sure we set the data so it isn't changed later
+ jQuery.data( elem, key, data );
+
+ } else {
+ data = undefined;
+ }
+ }
+
+ return data;
+}
+
+// checks a cache object for emptiness
+function isEmptyDataObject( obj ) {
+ var name;
+ for ( name in obj ) {
+
+ // if the public data object is empty, the private is still empty
+ if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
+ continue;
+ }
+ if ( name !== "toJSON" ) {
+ return false;
+ }
+ }
+
+ return true;
+}
+jQuery.extend({
+ queue: function( elem, type, data ) {
+ var queue;
+
+ if ( elem ) {
+ type = ( type || "fx" ) + "queue";
+ queue = jQuery._data( elem, type );
+
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( data ) {
+ if ( !queue || jQuery.isArray(data) ) {
+ queue = jQuery._data( elem, type, jQuery.makeArray(data) );
+ } else {
+ queue.push( data );
+ }
+ }
+ return queue || [];
+ }
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ),
+ startLength = queue.length,
+ fn = queue.shift(),
+ hooks = jQuery._queueHooks( elem, type ),
+ next = function() {
+ jQuery.dequeue( elem, type );
+ };
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ startLength--;
+ }
+
+ if ( fn ) {
+
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift( "inprogress" );
+ }
+
+ // clear up the last queue stop function
+ delete hooks.stop;
+ fn.call( elem, next, hooks );
+ }
+
+ if ( !startLength && hooks ) {
+ hooks.empty.fire();
+ }
+ },
+
+ // not intended for public consumption - generates a queueHooks object, or returns the current one
+ _queueHooks: function( elem, type ) {
+ var key = type + "queueHooks";
+ return jQuery._data( elem, key ) || jQuery._data( elem, key, {
+ empty: jQuery.Callbacks("once memory").add(function() {
+ jQuery._removeData( elem, type + "queue" );
+ jQuery._removeData( elem, key );
+ })
+ });
+ }
+});
+
+jQuery.fn.extend({
+ queue: function( type, data ) {
+ var setter = 2;
+
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ setter--;
+ }
+
+ if ( arguments.length < setter ) {
+ return jQuery.queue( this[0], type );
+ }
+
+ return data === undefined ?
+ this :
+ this.each(function() {
+ var queue = jQuery.queue( this, type, data );
+
+ // ensure a hooks for this queue
+ jQuery._queueHooks( this, type );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ dequeue: function( type ) {
+ return this.each(function() {
+ jQuery.dequeue( this, type );
+ });
+ },
+ // Based off of the plugin by Clint Helfers, with permission.
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
+ delay: function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function( next, hooks ) {
+ var timeout = setTimeout( next, time );
+ hooks.stop = function() {
+ clearTimeout( timeout );
+ };
+ });
+ },
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ },
+ // Get a promise resolved when queues of a certain type
+ // are emptied (fx is the type by default)
+ promise: function( type, obj ) {
+ var tmp,
+ count = 1,
+ defer = jQuery.Deferred(),
+ elements = this,
+ i = this.length,
+ resolve = function() {
+ if ( !( --count ) ) {
+ defer.resolveWith( elements, [ elements ] );
+ }
+ };
+
+ if ( typeof type !== "string" ) {
+ obj = type;
+ type = undefined;
+ }
+ type = type || "fx";
+
+ while( i-- ) {
+ tmp = jQuery._data( elements[ i ], type + "queueHooks" );
+ if ( tmp && tmp.empty ) {
+ count++;
+ tmp.empty.add( resolve );
+ }
+ }
+ resolve();
+ return defer.promise( obj );
+ }
+});
+var nodeHook, boolHook,
+ rclass = /[\t\r\n\f]/g,
+ rreturn = /\r/g,
+ rfocusable = /^(?:input|select|textarea|button|object)$/i,
+ rclickable = /^(?:a|area)$/i,
+ ruseDefault = /^(?:checked|selected)$/i,
+ getSetAttribute = jQuery.support.getSetAttribute,
+ getSetInput = jQuery.support.input;
+
+jQuery.fn.extend({
+ attr: function( name, value ) {
+ return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
+ },
+
+ removeAttr: function( name ) {
+ return this.each(function() {
+ jQuery.removeAttr( this, name );
+ });
+ },
+
+ prop: function( name, value ) {
+ return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
+ },
+
+ removeProp: function( name ) {
+ name = jQuery.propFix[ name ] || name;
+ return this.each(function() {
+ // try/catch handles cases where IE balks (such as removing a property on window)
+ try {
+ this[ name ] = undefined;
+ delete this[ name ];
+ } catch( e ) {}
+ });
+ },
+
+ addClass: function( value ) {
+ var classes, elem, cur, clazz, j,
+ i = 0,
+ len = this.length,
+ proceed = typeof value === "string" && value;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).addClass( value.call( this, j, this.className ) );
+ });
+ }
+
+ if ( proceed ) {
+ // The disjunction here is for better compressibility (see removeClass)
+ classes = ( value || "" ).match( core_rnotwhite ) || [];
+
+ for ( ; i < len; i++ ) {
+ elem = this[ i ];
+ cur = elem.nodeType === 1 && ( elem.className ?
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
+ " "
+ );
+
+ if ( cur ) {
+ j = 0;
+ while ( (clazz = classes[j++]) ) {
+ if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
+ cur += clazz + " ";
+ }
+ }
+ elem.className = jQuery.trim( cur );
+
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ var classes, elem, cur, clazz, j,
+ i = 0,
+ len = this.length,
+ proceed = arguments.length === 0 || typeof value === "string" && value;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).removeClass( value.call( this, j, this.className ) );
+ });
+ }
+ if ( proceed ) {
+ classes = ( value || "" ).match( core_rnotwhite ) || [];
+
+ for ( ; i < len; i++ ) {
+ elem = this[ i ];
+ // This expression is here for better compressibility (see addClass)
+ cur = elem.nodeType === 1 && ( elem.className ?
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
+ ""
+ );
+
+ if ( cur ) {
+ j = 0;
+ while ( (clazz = classes[j++]) ) {
+ // Remove *all* instances
+ while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
+ cur = cur.replace( " " + clazz + " ", " " );
+ }
+ }
+ elem.className = value ? jQuery.trim( cur ) : "";
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value;
+
+ if ( typeof stateVal === "boolean" && type === "string" ) {
+ return stateVal ? this.addClass( value ) : this.removeClass( value );
+ }
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( i ) {
+ jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
+ });
+ }
+
+ return this.each(function() {
+ if ( type === "string" ) {
+ // toggle individual class names
+ var className,
+ i = 0,
+ self = jQuery( this ),
+ classNames = value.match( core_rnotwhite ) || [];
+
+ while ( (className = classNames[ i++ ]) ) {
+ // check each className given, space separated list
+ if ( self.hasClass( className ) ) {
+ self.removeClass( className );
+ } else {
+ self.addClass( className );
+ }
+ }
+
+ // Toggle whole class name
+ } else if ( type === core_strundefined || type === "boolean" ) {
+ if ( this.className ) {
+ // store className if set
+ jQuery._data( this, "__className__", this.className );
+ }
+
+ // If the element has a class name or if we're passed "false",
+ // then remove the whole classname (if there was one, the above saved it).
+ // Otherwise bring back whatever was previously saved (if anything),
+ // falling back to the empty string if nothing was stored.
+ this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
+ }
+ });
+ },
+
+ hasClass: function( selector ) {
+ var className = " " + selector + " ",
+ i = 0,
+ l = this.length;
+ for ( ; i < l; i++ ) {
+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ val: function( value ) {
+ var ret, hooks, isFunction,
+ elem = this[0];
+
+ if ( !arguments.length ) {
+ if ( elem ) {
+ hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
+
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
+ return ret;
+ }
+
+ ret = elem.value;
+
+ return typeof ret === "string" ?
+ // handle most common string cases
+ ret.replace(rreturn, "") :
+ // handle cases where value is null/undef or number
+ ret == null ? "" : ret;
+ }
+
+ return;
+ }
+
+ isFunction = jQuery.isFunction( value );
+
+ return this.each(function( i ) {
+ var val;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call( this, i, jQuery( this ).val() );
+ } else {
+ val = value;
+ }
+
+ // Treat null/undefined as ""; convert numbers to string
+ if ( val == null ) {
+ val = "";
+ } else if ( typeof val === "number" ) {
+ val += "";
+ } else if ( jQuery.isArray( val ) ) {
+ val = jQuery.map(val, function ( value ) {
+ return value == null ? "" : value + "";
+ });
+ }
+
+ hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
+
+ // If set returns undefined, fall back to normal setting
+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
+ this.value = val;
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ valHooks: {
+ option: {
+ get: function( elem ) {
+ // Use proper attribute retrieval(#6932, #12072)
+ var val = jQuery.find.attr( elem, "value" );
+ return val != null ?
+ val :
+ elem.text;
+ }
+ },
+ select: {
+ get: function( elem ) {
+ var value, option,
+ options = elem.options,
+ index = elem.selectedIndex,
+ one = elem.type === "select-one" || index < 0,
+ values = one ? null : [],
+ max = one ? index + 1 : options.length,
+ i = index < 0 ?
+ max :
+ one ? index : 0;
+
+ // Loop through all the selected options
+ for ( ; i < max; i++ ) {
+ option = options[ i ];
+
+ // oldIE doesn't update selected after form reset (#2551)
+ if ( ( option.selected || i === index ) &&
+ // Don't return options that are disabled or in a disabled optgroup
+ ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
+ ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
+
+ // Get the specific value for the option
+ value = jQuery( option ).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ return values;
+ },
+
+ set: function( elem, value ) {
+ var optionSet, option,
+ options = elem.options,
+ values = jQuery.makeArray( value ),
+ i = options.length;
+
+ while ( i-- ) {
+ option = options[ i ];
+ if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) {
+ optionSet = true;
+ }
+ }
+
+ // force browsers to behave consistently when non-matching value is set
+ if ( !optionSet ) {
+ elem.selectedIndex = -1;
+ }
+ return values;
+ }
+ }
+ },
+
+ attr: function( elem, name, value ) {
+ var hooks, ret,
+ nType = elem.nodeType;
+
+ // don't get/set attributes on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ // Fallback to prop when attributes are not supported
+ if ( typeof elem.getAttribute === core_strundefined ) {
+ return jQuery.prop( elem, name, value );
+ }
+
+ // All attributes are lowercase
+ // Grab necessary hook if one is defined
+ if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
+ name = name.toLowerCase();
+ hooks = jQuery.attrHooks[ name ] ||
+ ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
+ }
+
+ if ( value !== undefined ) {
+
+ if ( value === null ) {
+ jQuery.removeAttr( elem, name );
+
+ } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ elem.setAttribute( name, value + "" );
+ return value;
+ }
+
+ } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
+ return ret;
+
+ } else {
+ ret = jQuery.find.attr( elem, name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return ret == null ?
+ undefined :
+ ret;
+ }
+ },
+
+ removeAttr: function( elem, value ) {
+ var name, propName,
+ i = 0,
+ attrNames = value && value.match( core_rnotwhite );
+
+ if ( attrNames && elem.nodeType === 1 ) {
+ while ( (name = attrNames[i++]) ) {
+ propName = jQuery.propFix[ name ] || name;
+
+ // Boolean attributes get special treatment (#10870)
+ if ( jQuery.expr.match.bool.test( name ) ) {
+ // Set corresponding property to false
+ if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
+ elem[ propName ] = false;
+ // Support: IE<9
+ // Also clear defaultChecked/defaultSelected (if appropriate)
+ } else {
+ elem[ jQuery.camelCase( "default-" + name ) ] =
+ elem[ propName ] = false;
+ }
+
+ // See #9699 for explanation of this approach (setting first, then removal)
+ } else {
+ jQuery.attr( elem, name, "" );
+ }
+
+ elem.removeAttribute( getSetAttribute ? name : propName );
+ }
+ }
+ },
+
+ attrHooks: {
+ type: {
+ set: function( elem, value ) {
+ if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
+ // Setting the type on a radio button after the value resets the value in IE6-9
+ // Reset value to default in case type is set after value during creation
+ var val = elem.value;
+ elem.setAttribute( "type", value );
+ if ( val ) {
+ elem.value = val;
+ }
+ return value;
+ }
+ }
+ }
+ },
+
+ propFix: {
+ "for": "htmlFor",
+ "class": "className"
+ },
+
+ prop: function( elem, name, value ) {
+ var ret, hooks, notxml,
+ nType = elem.nodeType;
+
+ // don't get/set properties on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ if ( notxml ) {
+ // Fix name and attach hooks
+ name = jQuery.propFix[ name ] || name;
+ hooks = jQuery.propHooks[ name ];
+ }
+
+ if ( value !== undefined ) {
+ return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
+ ret :
+ ( elem[ name ] = value );
+
+ } else {
+ return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
+ ret :
+ elem[ name ];
+ }
+ },
+
+ propHooks: {
+ tabIndex: {
+ get: function( elem ) {
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ // Use proper attribute retrieval(#12072)
+ var tabindex = jQuery.find.attr( elem, "tabindex" );
+
+ return tabindex ?
+ parseInt( tabindex, 10 ) :
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+ 0 :
+ -1;
+ }
+ }
+ }
+});
+
+// Hooks for boolean attributes
+boolHook = {
+ set: function( elem, value, name ) {
+ if ( value === false ) {
+ // Remove boolean attributes when set to false
+ jQuery.removeAttr( elem, name );
+ } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
+ // IE<8 needs the *property* name
+ elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
+
+ // Use defaultChecked and defaultSelected for oldIE
+ } else {
+ elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
+ }
+
+ return name;
+ }
+};
+jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
+ var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr;
+
+ jQuery.expr.attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ?
+ function( elem, name, isXML ) {
+ var fn = jQuery.expr.attrHandle[ name ],
+ ret = isXML ?
+ undefined :
+ /* jshint eqeqeq: false */
+ (jQuery.expr.attrHandle[ name ] = undefined) !=
+ getter( elem, name, isXML ) ?
+
+ name.toLowerCase() :
+ null;
+ jQuery.expr.attrHandle[ name ] = fn;
+ return ret;
+ } :
+ function( elem, name, isXML ) {
+ return isXML ?
+ undefined :
+ elem[ jQuery.camelCase( "default-" + name ) ] ?
+ name.toLowerCase() :
+ null;
+ };
+});
+
+// fix oldIE attroperties
+if ( !getSetInput || !getSetAttribute ) {
+ jQuery.attrHooks.value = {
+ set: function( elem, value, name ) {
+ if ( jQuery.nodeName( elem, "input" ) ) {
+ // Does not return so that setAttribute is also used
+ elem.defaultValue = value;
+ } else {
+ // Use nodeHook if defined (#1954); otherwise setAttribute is fine
+ return nodeHook && nodeHook.set( elem, value, name );
+ }
+ }
+ };
+}
+
+// IE6/7 do not support getting/setting some attributes with get/setAttribute
+if ( !getSetAttribute ) {
+
+ // Use this for any attribute in IE6/7
+ // This fixes almost every IE6/7 issue
+ nodeHook = {
+ set: function( elem, value, name ) {
+ // Set the existing or create a new attribute node
+ var ret = elem.getAttributeNode( name );
+ if ( !ret ) {
+ elem.setAttributeNode(
+ (ret = elem.ownerDocument.createAttribute( name ))
+ );
+ }
+
+ ret.value = value += "";
+
+ // Break association with cloned elements by also using setAttribute (#9646)
+ return name === "value" || value === elem.getAttribute( name ) ?
+ value :
+ undefined;
+ }
+ };
+ jQuery.expr.attrHandle.id = jQuery.expr.attrHandle.name = jQuery.expr.attrHandle.coords =
+ // Some attributes are constructed with empty-string values when not defined
+ function( elem, name, isXML ) {
+ var ret;
+ return isXML ?
+ undefined :
+ (ret = elem.getAttributeNode( name )) && ret.value !== "" ?
+ ret.value :
+ null;
+ };
+ jQuery.valHooks.button = {
+ get: function( elem, name ) {
+ var ret = elem.getAttributeNode( name );
+ return ret && ret.specified ?
+ ret.value :
+ undefined;
+ },
+ set: nodeHook.set
+ };
+
+ // Set contenteditable to false on removals(#10429)
+ // Setting to empty string throws an error as an invalid value
+ jQuery.attrHooks.contenteditable = {
+ set: function( elem, value, name ) {
+ nodeHook.set( elem, value === "" ? false : value, name );
+ }
+ };
+
+ // Set width and height to auto instead of 0 on empty string( Bug #8150 )
+ // This is for removals
+ jQuery.each([ "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = {
+ set: function( elem, value ) {
+ if ( value === "" ) {
+ elem.setAttribute( name, "auto" );
+ return value;
+ }
+ }
+ };
+ });
+}
+
+
+// Some attributes require a special call on IE
+// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+if ( !jQuery.support.hrefNormalized ) {
+ // href/src property should get the full normalized URL (#10299/#12915)
+ jQuery.each([ "href", "src" ], function( i, name ) {
+ jQuery.propHooks[ name ] = {
+ get: function( elem ) {
+ return elem.getAttribute( name, 4 );
+ }
+ };
+ });
+}
+
+if ( !jQuery.support.style ) {
+ jQuery.attrHooks.style = {
+ get: function( elem ) {
+ // Return undefined in the case of empty string
+ // Note: IE uppercases css property names, but if we were to .toLowerCase()
+ // .cssText, that would destroy case senstitivity in URL's, like in "background"
+ return elem.style.cssText || undefined;
+ },
+ set: function( elem, value ) {
+ return ( elem.style.cssText = value + "" );
+ }
+ };
+}
+
+// Safari mis-reports the default selected property of an option
+// Accessing the parent's selectedIndex property fixes it
+if ( !jQuery.support.optSelected ) {
+ jQuery.propHooks.selected = {
+ get: function( elem ) {
+ var parent = elem.parentNode;
+
+ if ( parent ) {
+ parent.selectedIndex;
+
+ // Make sure that it also works with optgroups, see #5701
+ if ( parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ }
+ return null;
+ }
+ };
+}
+
+jQuery.each([
+ "tabIndex",
+ "readOnly",
+ "maxLength",
+ "cellSpacing",
+ "cellPadding",
+ "rowSpan",
+ "colSpan",
+ "useMap",
+ "frameBorder",
+ "contentEditable"
+], function() {
+ jQuery.propFix[ this.toLowerCase() ] = this;
+});
+
+// IE6/7 call enctype encoding
+if ( !jQuery.support.enctype ) {
+ jQuery.propFix.enctype = "encoding";
+}
+
+// Radios and checkboxes getter/setter
+jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = {
+ set: function( elem, value ) {
+ if ( jQuery.isArray( value ) ) {
+ return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
+ }
+ }
+ };
+ if ( !jQuery.support.checkOn ) {
+ jQuery.valHooks[ this ].get = function( elem ) {
+ // Support: Webkit
+ // "" is returned instead of "on" if a value isn't specified
+ return elem.getAttribute("value") === null ? "on" : elem.value;
+ };
+ }
+});
+var rformElems = /^(?:input|select|textarea)$/i,
+ rkeyEvent = /^key/,
+ rmouseEvent = /^(?:mouse|contextmenu)|click/,
+ rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
+ rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
+
+function returnTrue() {
+ return true;
+}
+
+function returnFalse() {
+ return false;
+}
+
+function safeActiveElement() {
+ try {
+ return document.activeElement;
+ } catch ( err ) { }
+}
+
+/*
+ * Helper functions for managing events -- not part of the public interface.
+ * Props to Dean Edwards' addEvent library for many of the ideas.
+ */
+jQuery.event = {
+
+ global: {},
+
+ add: function( elem, types, handler, data, selector ) {
+ var tmp, events, t, handleObjIn,
+ special, eventHandle, handleObj,
+ handlers, type, namespaces, origType,
+ elemData = jQuery._data( elem );
+
+ // Don't attach events to noData or text/comment nodes (but allow plain objects)
+ if ( !elemData ) {
+ return;
+ }
+
+ // Caller can pass in an object of custom data in lieu of the handler
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ selector = handleObjIn.selector;
+ }
+
+ // Make sure that the handler has a unique ID, used to find/remove it later
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // Init the element's event structure and main handler, if this is the first
+ if ( !(events = elemData.events) ) {
+ events = elemData.events = {};
+ }
+ if ( !(eventHandle = elemData.handle) ) {
+ eventHandle = elemData.handle = function( e ) {
+ // Discard the second event of a jQuery.event.trigger() and
+ // when an event is called after a page has unloaded
+ return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?
+ jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
+ undefined;
+ };
+ // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
+ eventHandle.elem = elem;
+ }
+
+ // Handle multiple events separated by a space
+ types = ( types || "" ).match( core_rnotwhite ) || [""];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[t] ) || [];
+ type = origType = tmp[1];
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
+
+ // There *must* be a type, no attaching namespace-only handlers
+ if ( !type ) {
+ continue;
+ }
+
+ // If event changes its type, use the special event handlers for the changed type
+ special = jQuery.event.special[ type ] || {};
+
+ // If selector defined, determine special event api type, otherwise given type
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+
+ // Update special based on newly reset type
+ special = jQuery.event.special[ type ] || {};
+
+ // handleObj is passed to all event handlers
+ handleObj = jQuery.extend({
+ type: type,
+ origType: origType,
+ data: data,
+ handler: handler,
+ guid: handler.guid,
+ selector: selector,
+ needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
+ namespace: namespaces.join(".")
+ }, handleObjIn );
+
+ // Init the event handler queue if we're the first
+ if ( !(handlers = events[ type ]) ) {
+ handlers = events[ type ] = [];
+ handlers.delegateCount = 0;
+
+ // Only use addEventListener/attachEvent if the special events handler returns false
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+ // Bind the global event handler to the element
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, eventHandle, false );
+
+ } else if ( elem.attachEvent ) {
+ elem.attachEvent( "on" + type, eventHandle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
+ // Add to the element's handler list, delegates in front
+ if ( selector ) {
+ handlers.splice( handlers.delegateCount++, 0, handleObj );
+ } else {
+ handlers.push( handleObj );
+ }
+
+ // Keep track of which events have ever been used, for event optimization
+ jQuery.event.global[ type ] = true;
+ }
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler, selector, mappedTypes ) {
+ var j, handleObj, tmp,
+ origCount, t, events,
+ special, handlers, type,
+ namespaces, origType,
+ elemData = jQuery.hasData( elem ) && jQuery._data( elem );
+
+ if ( !elemData || !(events = elemData.events) ) {
+ return;
+ }
+
+ // Once for each type.namespace in types; type may be omitted
+ types = ( types || "" ).match( core_rnotwhite ) || [""];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[t] ) || [];
+ type = origType = tmp[1];
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
+
+ // Unbind all events (on this namespace, if provided) for the element
+ if ( !type ) {
+ for ( type in events ) {
+ jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
+ }
+ continue;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+ handlers = events[ type ] || [];
+ tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
+
+ // Remove matching events
+ origCount = j = handlers.length;
+ while ( j-- ) {
+ handleObj = handlers[ j ];
+
+ if ( ( mappedTypes || origType === handleObj.origType ) &&
+ ( !handler || handler.guid === handleObj.guid ) &&
+ ( !tmp || tmp.test( handleObj.namespace ) ) &&
+ ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
+ handlers.splice( j, 1 );
+
+ if ( handleObj.selector ) {
+ handlers.delegateCount--;
+ }
+ if ( special.remove ) {
+ special.remove.call( elem, handleObj );
+ }
+ }
+ }
+
+ // Remove generic event handler if we removed something and no more handlers exist
+ // (avoids potential for endless recursion during removal of special event handlers)
+ if ( origCount && !handlers.length ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
+ jQuery.removeEvent( elem, type, elemData.handle );
+ }
+
+ delete events[ type ];
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ delete elemData.handle;
+
+ // removeData also checks for emptiness and clears the expando if empty
+ // so use it instead of delete
+ jQuery._removeData( elem, "events" );
+ }
+ },
+
+ trigger: function( event, data, elem, onlyHandlers ) {
+ var handle, ontype, cur,
+ bubbleType, special, tmp, i,
+ eventPath = [ elem || document ],
+ type = core_hasOwn.call( event, "type" ) ? event.type : event,
+ namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
+
+ cur = tmp = elem = elem || document;
+
+ // Don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ // focus/blur morphs to focusin/out; ensure we're not firing them right now
+ if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
+ return;
+ }
+
+ if ( type.indexOf(".") >= 0 ) {
+ // Namespaced trigger; create a regexp to match event type in handle()
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ namespaces.sort();
+ }
+ ontype = type.indexOf(":") < 0 && "on" + type;
+
+ // Caller can pass in a jQuery.Event object, Object, or just an event type string
+ event = event[ jQuery.expando ] ?
+ event :
+ new jQuery.Event( type, typeof event === "object" && event );
+
+ // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
+ event.isTrigger = onlyHandlers ? 2 : 3;
+ event.namespace = namespaces.join(".");
+ event.namespace_re = event.namespace ?
+ new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
+ null;
+
+ // Clean up the event in case it is being reused
+ event.result = undefined;
+ if ( !event.target ) {
+ event.target = elem;
+ }
+
+ // Clone any incoming data and prepend the event, creating the handler arg list
+ data = data == null ?
+ [ event ] :
+ jQuery.makeArray( data, [ event ] );
+
+ // Allow special events to draw outside the lines
+ special = jQuery.event.special[ type ] || {};
+ if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
+ return;
+ }
+
+ // Determine event propagation path in advance, per W3C events spec (#9951)
+ // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
+ if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
+
+ bubbleType = special.delegateType || type;
+ if ( !rfocusMorph.test( bubbleType + type ) ) {
+ cur = cur.parentNode;
+ }
+ for ( ; cur; cur = cur.parentNode ) {
+ eventPath.push( cur );
+ tmp = cur;
+ }
+
+ // Only add window if we got to document (e.g., not plain obj or detached DOM)
+ if ( tmp === (elem.ownerDocument || document) ) {
+ eventPath.push( tmp.defaultView || tmp.parentWindow || window );
+ }
+ }
+
+ // Fire handlers on the event path
+ i = 0;
+ while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
+
+ event.type = i > 1 ?
+ bubbleType :
+ special.bindType || type;
+
+ // jQuery handler
+ handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
+ if ( handle ) {
+ handle.apply( cur, data );
+ }
+
+ // Native handler
+ handle = ontype && cur[ ontype ];
+ if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
+ event.preventDefault();
+ }
+ }
+ event.type = type;
+
+ // If nobody prevented the default action, do it now
+ if ( !onlyHandlers && !event.isDefaultPrevented() ) {
+
+ if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
+ jQuery.acceptData( elem ) ) {
+
+ // Call a native DOM method on the target with the same name name as the event.
+ // Can't use an .isFunction() check here because IE6/7 fails that test.
+ // Don't do default actions on window, that's where global variables be (#6170)
+ if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
+
+ // Don't re-trigger an onFOO event when we call its FOO() method
+ tmp = elem[ ontype ];
+
+ if ( tmp ) {
+ elem[ ontype ] = null;
+ }
+
+ // Prevent re-triggering of the same event, since we already bubbled it above
+ jQuery.event.triggered = type;
+ try {
+ elem[ type ]();
+ } catch ( e ) {
+ // IE<9 dies on focus/blur to hidden element (#1486,#12518)
+ // only reproducible on winXP IE8 native, not IE9 in IE8 mode
+ }
+ jQuery.event.triggered = undefined;
+
+ if ( tmp ) {
+ elem[ ontype ] = tmp;
+ }
+ }
+ }
+ }
+
+ return event.result;
+ },
+
+ dispatch: function( event ) {
+
+ // Make a writable jQuery.Event from the native event object
+ event = jQuery.event.fix( event );
+
+ var i, ret, handleObj, matched, j,
+ handlerQueue = [],
+ args = core_slice.call( arguments ),
+ handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
+ special = jQuery.event.special[ event.type ] || {};
+
+ // Use the fix-ed jQuery.Event rather than the (read-only) native event
+ args[0] = event;
+ event.delegateTarget = this;
+
+ // Call the preDispatch hook for the mapped type, and let it bail if desired
+ if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
+ return;
+ }
+
+ // Determine handlers
+ handlerQueue = jQuery.event.handlers.call( this, event, handlers );
+
+ // Run delegates first; they may want to stop propagation beneath us
+ i = 0;
+ while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
+ event.currentTarget = matched.elem;
+
+ j = 0;
+ while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
+
+ // Triggered event must either 1) have no namespace, or
+ // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
+ if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
+
+ event.handleObj = handleObj;
+ event.data = handleObj.data;
+
+ ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
+ .apply( matched.elem, args );
+
+ if ( ret !== undefined ) {
+ if ( (event.result = ret) === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+ }
+ }
+ }
+
+ // Call the postDispatch hook for the mapped type
+ if ( special.postDispatch ) {
+ special.postDispatch.call( this, event );
+ }
+
+ return event.result;
+ },
+
+ handlers: function( event, handlers ) {
+ var sel, handleObj, matches, i,
+ handlerQueue = [],
+ delegateCount = handlers.delegateCount,
+ cur = event.target;
+
+ // Find delegate handlers
+ // Black-hole SVG