mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 18:44:48 +01:00
Resolves further merge conflicts
This commit is contained in:
@@ -955,8 +955,8 @@ proc/move_gamma_ship()
|
||||
toArea = locate(/area/shuttle/gamma/space)
|
||||
fromArea.move_contents_to(toArea)
|
||||
|
||||
for(var/obj/machinery/mech_bay_recharge_port/P in toArea)
|
||||
P.locate_recharge_turf()
|
||||
for(var/turf/simulated/floor/mech_bay_recharge_floor/F in toArea)
|
||||
F.init_devices()
|
||||
|
||||
for(var/obj/machinery/power/apc/A in toArea)
|
||||
A.init()
|
||||
|
||||
@@ -66,7 +66,9 @@ var/list/admin_verbs_admin = list(
|
||||
/client/proc/freeze,
|
||||
/client/proc/freezemecha,
|
||||
/client/proc/alt_check,
|
||||
/client/proc/secrets
|
||||
/client/proc/secrets,
|
||||
/client/proc/change_human_appearance_admin, /* Allows an admin to change the basic appearance of human-based mobs */
|
||||
/client/proc/change_human_appearance_self /* Allows the human-based mob itself change its basic appearance */
|
||||
)
|
||||
var/list/admin_verbs_ban = list(
|
||||
/client/proc/unban_panel,
|
||||
@@ -136,8 +138,6 @@ var/list/admin_verbs_debug = list(
|
||||
/client/proc/cmd_debug_del_all,
|
||||
/client/proc/reload_admins,
|
||||
/client/proc/restart_controller,
|
||||
/client/proc/remake_distribution_map,
|
||||
/client/proc/show_distribution_map,
|
||||
/client/proc/enable_debug_verbs,
|
||||
/client/proc/callproc,
|
||||
/client/proc/callproc_datum,
|
||||
@@ -228,19 +228,15 @@ var/list/admin_verbs_mentor = list(
|
||||
set name = "Invisimin"
|
||||
set category = "Admin"
|
||||
set desc = "Toggles ghost-like invisibility (Don't abuse this)"
|
||||
|
||||
if(holder && mob)
|
||||
if(mob.invisibility == INVISIBILITY_OBSERVER)
|
||||
mob.invisibility = initial(mob.invisibility)
|
||||
mob << "\red <b>Invisimin off. Invisibility reset.</b>"
|
||||
mob.icon_state = "ghost"
|
||||
mob.icon = 'icons/mob/human.dmi'
|
||||
mob.update_icons()
|
||||
mob << "<span class='danger'>Invisimin off. Invisibility reset.</span>"
|
||||
//TODO: Make some kind of indication for the badmin that they are currently invisible
|
||||
else
|
||||
mob.invisibility = INVISIBILITY_OBSERVER
|
||||
mob << "\blue <b>Invisimin on. You are now as invisible as a ghost.</b>"
|
||||
mob.icon_state = "ghost"
|
||||
mob.icon = 'icons/mob/mob.dmi'
|
||||
|
||||
mob << "<span class='notice'>Invisimin on. You are now as invisible as a ghost.</span>"
|
||||
|
||||
/client/proc/player_panel()
|
||||
set name = "Player Panel"
|
||||
@@ -412,8 +408,14 @@ var/list/admin_verbs_mentor = list(
|
||||
set category = "Event"
|
||||
set name = "Give Spell"
|
||||
set desc = "Gives a spell to a mob."
|
||||
var/obj/effect/proc_holder/spell/wizard/S = input("Choose the spell to give to that guy", "ABRAKADABRA") as null|anything in spells
|
||||
if(!S) return
|
||||
var/list/spell_list = list()
|
||||
var/type_length = length("/obj/effect/proc_holder/spell") + 2
|
||||
for(var/A in spells)
|
||||
spell_list[copytext("[A]", type_length)] = A
|
||||
var/obj/effect/proc_holder/spell/S = input("Choose the spell to give to that guy", "ABRAKADABRA") as null|anything in spell_list
|
||||
if(!S)
|
||||
return
|
||||
S = spell_list[S]
|
||||
if(T.mind)
|
||||
T.mind.AddSpell(new S)
|
||||
else
|
||||
@@ -549,6 +551,41 @@ var/list/admin_verbs_mentor = list(
|
||||
if(holder)
|
||||
src.holder.output_ai_laws()
|
||||
|
||||
/client/proc/change_human_appearance_admin(mob/living/carbon/human/H in world)
|
||||
set name = "Change Mob Appearance - Admin"
|
||||
set desc = "Allows you to change the mob appearance"
|
||||
set category = "Admin"
|
||||
|
||||
if(!istype(H))
|
||||
return
|
||||
|
||||
if(holder)
|
||||
admin_log_and_message_admins("is altering the appearance of [H].")
|
||||
H.change_appearance(APPEARANCE_ALL, usr, usr, check_species_whitelist = 0)
|
||||
feedback_add_details("admin_verb","CHAA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/change_human_appearance_self(mob/living/carbon/human/H in world)
|
||||
set name = "Change Mob Appearance - Self"
|
||||
set desc = "Allows the mob to change its appearance"
|
||||
set category = "Admin"
|
||||
|
||||
if(!istype(H))
|
||||
return
|
||||
|
||||
if(!H.client)
|
||||
usr << "Only mobs with clients can alter their own appearance."
|
||||
return
|
||||
|
||||
if(holder)
|
||||
switch(alert("Do you wish for [H] to be allowed to select non-whitelisted races?","Alter Mob Appearance","Yes","No","Cancel"))
|
||||
if("Yes")
|
||||
admin_log_and_message_admins("has allowed [H] to change \his appearance, without whitelisting of races.")
|
||||
H.change_appearance(APPEARANCE_ALL, H.loc, check_species_whitelist = 0)
|
||||
if("No")
|
||||
admin_log_and_message_admins("has allowed [H] to change \his appearance, with whitelisting of races.")
|
||||
H.change_appearance(APPEARANCE_ALL, H.loc, check_species_whitelist = 1)
|
||||
feedback_add_details("admin_verb","CMAS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
//---- bs12 verbs ----
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@
|
||||
if("turf-reference")
|
||||
master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value") as turf in world
|
||||
if(AREA_BUILDMODE)
|
||||
var/list/gen_paths = typesof(/datum/mapGenerator) - /datum/mapGenerator
|
||||
var/list/gen_paths = subtypesof(/datum/mapGenerator)
|
||||
|
||||
var/type = input(usr,"Select Generator Type","Type") as null|anything in gen_paths
|
||||
if(!type) return
|
||||
|
||||
@@ -83,16 +83,13 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
usr << "<font color='blue'>[procname] returned: [returnval ? returnval : "null"]</font>"
|
||||
feedback_add_details("admin_verb","APC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/callproc_datum(var/atom/A as null|area|mob|obj|turf)
|
||||
/client/proc/callproc_datum(var/A as null|area|mob|obj|turf)
|
||||
set category = "Debug"
|
||||
set name = "Atom ProcCall"
|
||||
|
||||
if(!check_rights(R_DEBUG))
|
||||
return
|
||||
|
||||
if(!istype(A))
|
||||
return
|
||||
|
||||
var/procname = input("Proc name, eg: fake_blood","Proc:", null) as text|null
|
||||
if(!procname)
|
||||
return
|
||||
@@ -101,7 +98,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
if(!lst)
|
||||
return
|
||||
|
||||
if(!A || !isnull(A.gcDestroyed))
|
||||
if(!A || !IsValidSrc(A))
|
||||
usr << "<span class='warning'>Error: callproc_datum(): owner of proc no longer exists.</span>"
|
||||
return
|
||||
if(!hascall(A,procname))
|
||||
@@ -395,8 +392,8 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
set name = "Del-All"
|
||||
|
||||
// to prevent REALLY stupid deletions
|
||||
var/blocked = list(/obj, /mob, /mob/living, /mob/living/carbon, /mob/living/carbon/human, /mob/dead, /mob/dead/observer, /mob/living/silicon, /mob/living/silicon/robot, /mob/living/silicon/ai)
|
||||
var/hsbitem = input(usr, "Choose an object to delete.", "Delete:") as null|anything in typesof(/obj) + typesof(/mob) - blocked
|
||||
var/blocked = list(/mob/living, /mob/living/carbon, /mob/living/carbon/human, /mob/dead, /mob/dead/observer, /mob/living/silicon, /mob/living/silicon/robot, /mob/living/silicon/ai)
|
||||
var/hsbitem = input(usr, "Choose an object to delete.", "Delete:") as null|anything in subtypesof(/obj) + subtypesof(/mob) - blocked
|
||||
if(hsbitem)
|
||||
for(var/atom/O in world)
|
||||
if(istype(O, hsbitem))
|
||||
@@ -1139,7 +1136,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
|
||||
for(var/obj/machinery/power/smes/SMES in world)
|
||||
if(SMES.anchored)
|
||||
SMES.chargemode = 1
|
||||
SMES.input_attempt = 1
|
||||
|
||||
/client/proc/cmd_debug_mob_lists()
|
||||
set category = "Debug"
|
||||
|
||||
@@ -144,6 +144,7 @@ var/intercom_range_display_status = 0
|
||||
src.verbs += /client/proc/print_jobban_old_filter
|
||||
src.verbs += /client/proc/forceEvent
|
||||
//src.verbs += /client/proc/cmd_admin_rejuvenate
|
||||
src.verbs += /client/proc/nanomapgen_DumpImage
|
||||
|
||||
feedback_add_details("admin_verb","mDV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
#define ALARM_RESET_DELAY 100 // How long will the alarm/trigger remain active once origin/source has been found to be gone?
|
||||
|
||||
/datum/alarm_source
|
||||
var/source = null // The source trigger
|
||||
var/source_name = "" // The name of the source should it be lost (for example a destroyed camera)
|
||||
var/duration = 0 // How long this source will be alarming, 0 for indefinetely.
|
||||
var/severity = 1 // How severe the alarm from this source is.
|
||||
var/start_time = 0 // When this source began alarming.
|
||||
var/end_time = 0 // Use to set when this trigger should clear, in case the source is lost.
|
||||
|
||||
/datum/alarm_source/New(var/atom/source)
|
||||
src.source = source
|
||||
start_time = world.time
|
||||
source_name = source.get_source_name()
|
||||
|
||||
/datum/alarm
|
||||
var/atom/origin //Used to identify the alarm area.
|
||||
var/list/sources = new() //List of sources triggering the alarm. Used to determine when the alarm should be cleared.
|
||||
var/list/sources_assoc = new() //Associative list of source triggers. Used to efficiently acquire the alarm source.
|
||||
var/list/cameras //List of cameras that can be switched to, if the player has that capability.
|
||||
var/area/last_area //The last acquired area, used should origin be lost (for example a destroyed borg containing an alarming camera).
|
||||
var/area/last_name //The last acquired name, used should origin be lost
|
||||
var/area/last_camera_area //The last area in which cameras where fetched, used to see if the camera list should be updated.
|
||||
var/end_time //Used to set when this alarm should clear, in case the origin is lost.
|
||||
|
||||
/datum/alarm/New(var/atom/origin, var/atom/source, var/duration, var/severity)
|
||||
src.origin = origin
|
||||
|
||||
cameras() // Sets up both cameras and last alarm area.
|
||||
set_source_data(source, duration, severity)
|
||||
|
||||
/datum/alarm/proc/process()
|
||||
// Has origin gone missing?
|
||||
if(!origin && !end_time)
|
||||
end_time = world.time + ALARM_RESET_DELAY
|
||||
for(var/datum/alarm_source/AS in sources)
|
||||
// Has the alarm passed its best before date?
|
||||
if((AS.end_time && world.time > AS.end_time) || (AS.duration && world.time > (AS.start_time + AS.duration)))
|
||||
sources -= AS
|
||||
// Has the source gone missing? Then reset the normal duration and set end_time
|
||||
if(!AS.source && !AS.end_time) // end_time is used instead of duration to ensure the reset doesn't remain in the future indefinetely.
|
||||
AS.duration = 0
|
||||
AS.end_time = world.time + ALARM_RESET_DELAY
|
||||
|
||||
/datum/alarm/proc/set_source_data(var/atom/source, var/duration, var/severity)
|
||||
var/datum/alarm_source/AS = sources_assoc[source]
|
||||
if(!AS)
|
||||
AS = new/datum/alarm_source(source)
|
||||
sources += AS
|
||||
sources_assoc[source] = AS
|
||||
// Currently only non-0 durations can be altered (normal alarms VS EMP blasts)
|
||||
if(AS.duration)
|
||||
duration = SecondsToTicks(duration)
|
||||
AS.duration = duration
|
||||
AS.severity = severity
|
||||
|
||||
/datum/alarm/proc/clear(var/source)
|
||||
var/datum/alarm_source/AS = sources_assoc[source]
|
||||
sources -= AS
|
||||
sources_assoc -= source
|
||||
|
||||
/datum/alarm/proc/alarm_area()
|
||||
if(!origin)
|
||||
return last_area
|
||||
|
||||
last_area = origin.get_alarm_area()
|
||||
return last_area
|
||||
|
||||
/datum/alarm/proc/alarm_name()
|
||||
if(!origin)
|
||||
return last_name
|
||||
|
||||
last_name = origin.get_alarm_name()
|
||||
return last_name
|
||||
|
||||
/datum/alarm/proc/cameras()
|
||||
// If the alarm origin has changed area, for example a borg containing an alarming camera, reset the list of cameras
|
||||
if(cameras && (last_camera_area != alarm_area()))
|
||||
cameras = null
|
||||
|
||||
// The list of cameras is also reset by /proc/invalidateCameraCache()
|
||||
if(!cameras)
|
||||
cameras = origin ? origin.get_alarm_cameras() : last_area.get_alarm_cameras()
|
||||
|
||||
last_camera_area = last_area
|
||||
return cameras
|
||||
|
||||
/datum/alarm/proc/max_severity()
|
||||
var/max_severity = 0
|
||||
for(var/datum/alarm_source/AS in sources)
|
||||
max_severity = max(AS.severity, max_severity)
|
||||
|
||||
return max_severity
|
||||
|
||||
/******************
|
||||
* Assisting procs *
|
||||
******************/
|
||||
/atom/proc/get_alarm_area()
|
||||
var/area/A = get_area(src)
|
||||
return A
|
||||
|
||||
/area/get_alarm_area()
|
||||
return src
|
||||
|
||||
/atom/proc/get_alarm_name()
|
||||
var/area/A = get_area(src)
|
||||
return A.name
|
||||
|
||||
/area/get_alarm_name()
|
||||
return name
|
||||
|
||||
/mob/get_alarm_name()
|
||||
return name
|
||||
|
||||
/atom/proc/get_source_name()
|
||||
return name
|
||||
|
||||
/obj/machinery/camera/get_source_name()
|
||||
return c_tag
|
||||
|
||||
/atom/proc/get_alarm_cameras()
|
||||
var/area/A = get_area(src)
|
||||
return A.get_cameras()
|
||||
|
||||
/area/get_alarm_cameras()
|
||||
return get_cameras()
|
||||
|
||||
/mob/living/silicon/robot/get_alarm_cameras()
|
||||
var/list/cameras = ..()
|
||||
if(camera)
|
||||
cameras += camera
|
||||
|
||||
return cameras
|
||||
|
||||
/mob/living/silicon/robot/syndicate/get_alarm_cameras()
|
||||
return list()
|
||||
|
||||
#undef ALARM_LOSS_DELAY
|
||||
@@ -0,0 +1,99 @@
|
||||
#define ALARM_RAISED 1
|
||||
#define ALARM_CLEARED 0
|
||||
|
||||
/datum/alarm_handler
|
||||
var/category = ""
|
||||
var/list/datum/alarm/alarms = new // All alarms, to handle cases when an origin has been deleted with one or more active alarms
|
||||
var/list/datum/alarm/alarms_assoc = new // Associative list of alarms, to efficiently acquire them based on origin.
|
||||
var/list/listeners = new // A list of all objects interested in alarm changes.
|
||||
|
||||
/datum/alarm_handler/proc/process()
|
||||
for(var/datum/alarm/A in alarms)
|
||||
A.process()
|
||||
check_alarm_cleared(A)
|
||||
|
||||
/datum/alarm_handler/proc/triggerAlarm(var/atom/origin, var/atom/source, var/duration = 0, var/severity = 1)
|
||||
var/new_alarm
|
||||
//Proper origin and source mandatory
|
||||
if(!(origin && source))
|
||||
return
|
||||
origin = origin.get_alarm_origin()
|
||||
|
||||
new_alarm = 0
|
||||
//see if there is already an alarm of this origin
|
||||
var/datum/alarm/existing = alarms_assoc[origin]
|
||||
if(existing)
|
||||
existing.set_source_data(source, duration, severity)
|
||||
else
|
||||
existing = new/datum/alarm(origin, source, duration, severity)
|
||||
new_alarm = 1
|
||||
|
||||
alarms |= existing
|
||||
alarms_assoc[origin] = existing
|
||||
if(new_alarm)
|
||||
alarms = dd_sortedObjectList(alarms)
|
||||
on_alarm_change(existing, ALARM_RAISED)
|
||||
|
||||
return new_alarm
|
||||
|
||||
/datum/alarm_handler/proc/clearAlarm(var/atom/origin, var/source)
|
||||
//Proper origin and source mandatory
|
||||
if(!(origin && source))
|
||||
return
|
||||
origin = origin.get_alarm_origin()
|
||||
|
||||
var/datum/alarm/existing = alarms_assoc[origin]
|
||||
if(existing)
|
||||
existing.clear(source)
|
||||
return check_alarm_cleared(existing)
|
||||
|
||||
/datum/alarm_handler/proc/major_alarms()
|
||||
return alarms
|
||||
|
||||
/datum/alarm_handler/proc/minor_alarms()
|
||||
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)
|
||||
alarms -= alarm
|
||||
alarms_assoc -= alarm.origin
|
||||
on_alarm_change(alarm, ALARM_CLEARED)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/alarm_handler/proc/on_alarm_change(var/datum/alarm/alarm, var/was_raised)
|
||||
for(var/obj/machinery/camera/C in alarm.cameras())
|
||||
if(was_raised)
|
||||
C.network.Add(category)
|
||||
invalidateCameraCache()
|
||||
else
|
||||
C.network.Remove(category)
|
||||
notify_listeners(alarm, was_raised)
|
||||
|
||||
/datum/alarm_handler/proc/get_alarm_severity_for_origin(var/atom/origin)
|
||||
if(!origin)
|
||||
return
|
||||
|
||||
origin = origin.get_alarm_origin()
|
||||
var/datum/alarm/existing = alarms_assoc[origin]
|
||||
if(!existing)
|
||||
return
|
||||
|
||||
return existing.max_severity()
|
||||
|
||||
/atom/proc/get_alarm_origin()
|
||||
return src
|
||||
|
||||
/turf/get_alarm_origin()
|
||||
var/area/area = get_area(src)
|
||||
return area // Very important to get area.master, as dynamic lightning can and will split areas.
|
||||
|
||||
/datum/alarm_handler/proc/register(var/object, var/procName)
|
||||
listeners[object] = procName
|
||||
|
||||
/datum/alarm_handler/proc/unregister(var/object)
|
||||
listeners -= object
|
||||
|
||||
/datum/alarm_handler/proc/notify_listeners(var/alarm, var/was_raised)
|
||||
for(var/listener in listeners)
|
||||
call(listener, listeners[listener])(src, alarm, was_raised)
|
||||
@@ -0,0 +1,19 @@
|
||||
/datum/alarm_handler/atmosphere
|
||||
category = "Atmosphere Alarms"
|
||||
|
||||
/datum/alarm_handler/atmosphere/triggerAlarm(var/atom/origin, var/atom/source, var/duration = 0, var/severity = 1)
|
||||
..()
|
||||
|
||||
/datum/alarm_handler/atmosphere/major_alarms()
|
||||
var/list/major_alarms = new()
|
||||
for(var/datum/alarm/A in alarms)
|
||||
if(A.max_severity() > 1)
|
||||
major_alarms.Add(A)
|
||||
return major_alarms
|
||||
|
||||
/datum/alarm_handler/atmosphere/minor_alarms()
|
||||
var/list/minor_alarms = new()
|
||||
for(var/datum/alarm/A in alarms)
|
||||
if(A.max_severity() == 1)
|
||||
minor_alarms.Add(A)
|
||||
return minor_alarms
|
||||
@@ -0,0 +1,2 @@
|
||||
/datum/alarm_handler/camera
|
||||
category = "Camera Alarms"
|
||||
@@ -0,0 +1,11 @@
|
||||
/datum/alarm_handler/fire
|
||||
category = "Fire Alarms"
|
||||
|
||||
/datum/alarm_handler/fire/on_alarm_change(var/datum/alarm/alarm, var/was_raised)
|
||||
var/area/A = alarm.origin
|
||||
if(istype(A))
|
||||
if(was_raised)
|
||||
A.fire_alert()
|
||||
else
|
||||
A.fire_reset()
|
||||
..()
|
||||
@@ -0,0 +1,2 @@
|
||||
/datum/alarm_handler/motion
|
||||
category = "Motion Alarms"
|
||||
@@ -0,0 +1,10 @@
|
||||
/datum/alarm_handler/power
|
||||
category = "Power Alarms"
|
||||
|
||||
/datum/alarm_handler/power/on_alarm_change(var/datum/alarm/alarm, var/was_raised)
|
||||
var/area/A = alarm.origin
|
||||
if(istype(A))
|
||||
A.power_alert(was_raised)
|
||||
..()
|
||||
|
||||
/area/proc/power_alert(var/alarming)
|
||||
@@ -18,7 +18,7 @@
|
||||
var/delay = 0
|
||||
var/datum/radio_frequency/radio_connection
|
||||
var/airlock_wire = null
|
||||
|
||||
|
||||
New()
|
||||
..()
|
||||
if(!radio_controller)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
var/global/automation_types=typesof(/datum/automation) - /datum/automation
|
||||
var/global/automation_types = subtypesof(/datum/automation)
|
||||
|
||||
#define AUTOM_RT_NULL 0
|
||||
#define AUTOM_RT_NUM 1
|
||||
|
||||
@@ -4,22 +4,22 @@ var/list/preferences_datums = list()
|
||||
|
||||
var/global/list/special_roles = list( //keep synced with the defines BE_* in setup.dm. THE ORDER MATTERS
|
||||
//some autodetection here.
|
||||
"traitor" = IS_MODE_COMPILED("traitor"), // 1 / 1
|
||||
"operative" = IS_MODE_COMPILED("nuclear"), // 2 / 2
|
||||
"changeling" = IS_MODE_COMPILED("changeling"), // 4 / 3
|
||||
"wizard" = IS_MODE_COMPILED("wizard"), // 8 / 4
|
||||
"malf AI" = IS_MODE_COMPILED("malfunction"), // 16 / 5
|
||||
"revolutionary" = IS_MODE_COMPILED("revolution"), // 32 / 6
|
||||
"alien" = 1, // 62 / 7
|
||||
"pAI" = 1, // 128 / 8
|
||||
"cultist" = IS_MODE_COMPILED("cult"), // 256 / 9
|
||||
"ninja" = 1, // 512 / 10
|
||||
"raider" = IS_MODE_COMPILED("heist"), // 1024 / 11
|
||||
"vampire" = IS_MODE_COMPILED("vampire"), // 2048 / 12
|
||||
"mutineer" = IS_MODE_COMPILED("mutiny"), // 4096 / 13
|
||||
"blob" = IS_MODE_COMPILED("blob"), // 8192 / 14
|
||||
"traitor" = IS_MODE_COMPILED("traitor"), // 1 / 1
|
||||
"operative" = IS_MODE_COMPILED("nuclear"), // 2 / 2
|
||||
"changeling" = IS_MODE_COMPILED("changeling"), // 4 / 3
|
||||
"wizard" = IS_MODE_COMPILED("wizard"), // 8 / 4
|
||||
"malf AI" = IS_MODE_COMPILED("malfunction"), // 16 / 5
|
||||
"revolutionary" = IS_MODE_COMPILED("revolution"), // 32 / 6
|
||||
"alien" = 1, // 62 / 7
|
||||
"pAI" = 1, // 128 / 8
|
||||
"cultist" = IS_MODE_COMPILED("cult"), // 256 / 9
|
||||
"ninja" = 1, // 512 / 10
|
||||
"raider" = IS_MODE_COMPILED("heist"), // 1024 / 11
|
||||
"vampire" = IS_MODE_COMPILED("vampire"), // 2048 / 12
|
||||
"mutineer" = IS_MODE_COMPILED("mutiny"), // 4096 / 13
|
||||
"blob" = IS_MODE_COMPILED("blob"), // 8192 / 14
|
||||
"shadowling" = IS_MODE_COMPILED("shadowling"), //16384 / 15
|
||||
"Revenant" = 1 //32768 / 16
|
||||
"revenant" = 1 //32768 / 16
|
||||
)
|
||||
var/global/list/special_role_times = list( //minimum age (in days) for accounts to play these roles
|
||||
num2text(BE_PAI) = 0,
|
||||
@@ -30,6 +30,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
|
||||
num2text(BE_REV) = 14,
|
||||
num2text(BE_VAMPIRE) = 14,
|
||||
num2text(BE_BLOB) = 14,
|
||||
num2text(BE_REVENANT) = 14,
|
||||
num2text(BE_OPERATIVE) = 21,
|
||||
num2text(BE_CULTIST) = 21,
|
||||
num2text(BE_RAIDER) = 21,
|
||||
@@ -37,7 +38,6 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
|
||||
num2text(BE_NINJA) = 21,
|
||||
num2text(BE_MUTINEER) = 21,
|
||||
num2text(BE_MALF) = 30,
|
||||
num2text(BE_REVENANT) = 7
|
||||
)
|
||||
|
||||
/proc/player_old_enough_antag(client/C, role)
|
||||
|
||||
@@ -2,7 +2,7 @@ var/list/spawntypes = list()
|
||||
|
||||
/proc/populate_spawn_points()
|
||||
spawntypes = list()
|
||||
for(var/type in typesof(/datum/spawnpoint)-/datum/spawnpoint)
|
||||
for(var/type in subtypesof(/datum/spawnpoint))
|
||||
var/datum/spawnpoint/S = new type()
|
||||
spawntypes[S.display_name] = S
|
||||
|
||||
|
||||
@@ -237,7 +237,8 @@
|
||||
prefs.sound ^= SOUND_STREAMING
|
||||
prefs.save_preferences(src)
|
||||
usr << "You will [(prefs.sound & SOUND_STREAMING) ? "now" : "no longer"] hear streamed media."
|
||||
// Restart.
|
||||
if(media)
|
||||
media.stop_music()
|
||||
if(!media) return
|
||||
if(prefs.toggles & SOUND_STREAMING)
|
||||
media.update_music()
|
||||
else
|
||||
media.stop_music()
|
||||
|
||||
@@ -194,6 +194,7 @@
|
||||
name = "plasmaman miner suit"
|
||||
icon_state = "plasmamanMiner_suit"
|
||||
armor = list(melee = 40, bullet = 5, laser = 10, energy = 5, bomb = 50, bio = 100, rad = 50)
|
||||
slowdown = 2
|
||||
|
||||
/obj/item/clothing/head/helmet/space/eva/plasmaman/miner
|
||||
name = "plasmaman miner helmet"
|
||||
|
||||
@@ -365,6 +365,13 @@
|
||||
_color = "mankini"
|
||||
siemens_coefficient = 1
|
||||
|
||||
/obj/item/clothing/suit/jacket/miljacket
|
||||
name = "military jacket"
|
||||
desc = "A canvas jacket styled after classical American military garb. Feels sturdy, yet comfortable."
|
||||
icon_state = "militaryjacket"
|
||||
item_state = "militaryjacket"
|
||||
allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank/emergency_oxygen,/obj/item/toy,/obj/item/weapon/storage/fancy/cigarettes,/obj/item/weapon/lighter,/obj/item/weapon/gun/projectile/automatic/pistol,/obj/item/weapon/gun/projectile/revolver,/obj/item/weapon/gun/projectile/revolver/detective)
|
||||
|
||||
/obj/item/clothing/suit/xenos
|
||||
name = "xenos suit"
|
||||
desc = "A suit made out of chitinous alien hide."
|
||||
|
||||
@@ -11,11 +11,11 @@
|
||||
|
||||
New()
|
||||
..()
|
||||
for(var/U in typesof(/obj/item/clothing/under/color)-(/obj/item/clothing/under/color))
|
||||
for(var/U in subtypesof(/obj/item/clothing/under/color))
|
||||
var/obj/item/clothing/under/V = new U
|
||||
src.clothing_choices += V
|
||||
|
||||
for(var/U in typesof(/obj/item/clothing/under/rank)-(/obj/item/clothing/under/rank))
|
||||
for(var/U in subtypesof(/obj/item/clothing/under/rank))
|
||||
var/obj/item/clothing/under/V = new U
|
||||
src.clothing_choices += V
|
||||
return
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
/obj/item/clothing/under/color/random/New()
|
||||
..()
|
||||
var/list/excluded = list(/obj/item/clothing/under/color/random, /obj/item/clothing/under/color, /obj/item/clothing/under/color/blackf, /obj/item/clothing/under/color/blue/dodgeball, /obj/item/clothing/under/color/orange/prison, /obj/item/clothing/under/color/red/dodgeball, /obj/item/clothing/under/color/red/jersey, /obj/item/clothing/under/color/blue/jersey)
|
||||
var/obj/item/clothing/under/color/C = pick(typesof(/obj/item/clothing/under/color) - excluded)
|
||||
var/list/excluded = list(/obj/item/clothing/under/color/random, /obj/item/clothing/under/color/blackf, /obj/item/clothing/under/color/blue/dodgeball, /obj/item/clothing/under/color/orange/prison, /obj/item/clothing/under/color/red/dodgeball, /obj/item/clothing/under/color/red/jersey, /obj/item/clothing/under/color/blue/jersey)
|
||||
var/obj/item/clothing/under/color/C = pick(subtypesof(/obj/item/clothing/under/color) - excluded)
|
||||
name = initial(C.name)
|
||||
icon_state = initial(C.icon_state)
|
||||
item_state = initial(C.item_state)
|
||||
|
||||
@@ -82,5 +82,5 @@
|
||||
/obj/item/weapon/storage/box/testing_disks
|
||||
New()
|
||||
..()
|
||||
for(var/typekey in typesof(/obj/item/weapon/disk/file) - /obj/item/weapon/disk/file)
|
||||
for(var/typekey in subtypesof(/obj/item/weapon/disk/file))
|
||||
new typekey(src)
|
||||
@@ -6,7 +6,13 @@
|
||||
var/time = 30 //time in deciseconds
|
||||
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
|
||||
|
||||
/datum/table_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
|
||||
name = "IED"
|
||||
|
||||
@@ -11,6 +11,13 @@
|
||||
/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))
|
||||
@@ -28,6 +35,10 @@
|
||||
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
|
||||
@@ -75,6 +86,7 @@
|
||||
I.reagents = new /datum/reagents()
|
||||
I.reagents.reagent_list.Add(A)
|
||||
I.CheckParts()
|
||||
R.AdjustChems(I)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
@@ -84,6 +96,19 @@
|
||||
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))
|
||||
|
||||
@@ -89,7 +89,7 @@ var/setup_economy = 0
|
||||
newChannel.is_admin_channel = 1
|
||||
news_network.network_channels += newChannel
|
||||
|
||||
for(var/loc_type in typesof(/datum/trade_destination) - /datum/trade_destination)
|
||||
for(var/loc_type in subtypesof(/datum/trade_destination))
|
||||
var/datum/trade_destination/D = new loc_type
|
||||
weighted_randomevent_locations[D] = D.viable_random_events.len
|
||||
weighted_mundaneevent_locations[D] = D.viable_mundane_events.len
|
||||
|
||||
@@ -149,7 +149,9 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
|
||||
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Meaty Ores", /datum/event/dust/meaty, 0, list(ASSIGNMENT_ENGINEER = 30)),
|
||||
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Communication Blackout", /datum/event/communications_blackout, 500, list(ASSIGNMENT_AI = 150, ASSIGNMENT_SECURITY = 120)),
|
||||
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, "Grid Check", /datum/event/grid_check, 200, list(ASSIGNMENT_ENGINEER = 60)),
|
||||
//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, "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, "Viral Infection", /datum/event/viral_infection, 0, list(ASSIGNMENT_MEDICAL = 150)),
|
||||
@@ -177,6 +179,7 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
|
||||
available_events = list(
|
||||
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Nothing", /datum/event/nothing, 1320),
|
||||
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Carp Migration", /datum/event/carp_migration, 0, list(ASSIGNMENT_SECURITY = 3), 1),
|
||||
//new /datum/event_meta(EVENT_LEVEL_MAJOR, "Containment Breach", /datum/event/prison_break/station, 0, list(ASSIGNMENT_ANY = 5)),
|
||||
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Viral Infection", /datum/event/viral_infection, 0, list(ASSIGNMENT_MEDICAL = 30), 1),
|
||||
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Blob", /datum/event/blob, 0, list(ASSIGNMENT_ENGINEER = 30), 1),
|
||||
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Meteor Wave", /datum/event/meteor_wave, 0, list(ASSIGNMENT_ENGINEER = 3), 1),
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
var/datum/event_meta/new_event = new
|
||||
|
||||
/datum/event_manager/New()
|
||||
allEvents = typesof(/datum/event) - /datum/event
|
||||
allEvents = subtypesof(/datum/event)
|
||||
|
||||
/datum/event_manager/proc/process()
|
||||
for(var/datum/event/E in event_manager.active_events)
|
||||
@@ -182,7 +182,7 @@
|
||||
if(!E.event_meta)
|
||||
continue
|
||||
var/datum/event_meta/EM = E.event_meta
|
||||
var/ends_at = E.startedAt + (E.lastProcessAt() * master_controller.minimum_ticks) // A best estimate
|
||||
var/ends_at = E.startedAt + (E.lastProcessAt() * 20) // A best estimate, based on how often the manager processes
|
||||
var/ends_in = max(0, round((ends_at - world.time) / 600, 0.1))
|
||||
var/no_end = E.noAutoEnd
|
||||
html += "<tr>"
|
||||
|
||||
@@ -19,30 +19,10 @@
|
||||
without intervention this attack will succeed in approximately 10 minutes. Required intervention: temporary suspension of affected accounts until the attack has ceased. \
|
||||
Notifications will be sent as updates occur.<br>"
|
||||
var/my_department = "[station_name()] firewall subroutines"
|
||||
var/sending = message + "<font color='blue'><b>Message dispatched by [my_department].</b></font>"
|
||||
|
||||
var/pass = 0
|
||||
for(var/obj/machinery/message_server/MS in world)
|
||||
if(!MS.active) continue
|
||||
// /obj/machinery/message_server/proc/send_rc_message(var/recipient = "",var/sender = "",var/message = "",var/stamp = "", var/id_auth = "", var/priority = 1)
|
||||
MS.send_rc_message("Engineering/Security/Bridge", my_department, message, "", "", 2)
|
||||
pass = 1
|
||||
|
||||
if(pass)
|
||||
var/keyed_dpt1 = ckey("Engineering")
|
||||
var/keyed_dpt2 = ckey("Security")
|
||||
var/keyed_dpt3 = ckey("Bridge")
|
||||
for (var/obj/machinery/requests_console/Console in allConsoles)
|
||||
var/keyed_department = ckey(Console.department)
|
||||
if(keyed_department == keyed_dpt1 || keyed_department == keyed_dpt2 || keyed_department == keyed_dpt3)
|
||||
if(Console.newmessagepriority < 2)
|
||||
Console.newmessagepriority = 2
|
||||
Console.icon_state = "req_comp2"
|
||||
if(!Console.silent)
|
||||
playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
for (var/mob/O in hearers(5, Console.loc))
|
||||
O.show_message(text("\icon[Console] *The Requests Console beeps: 'PRIORITY Alert in [my_department]'"))
|
||||
Console.messages += "<B><FONT color='red'>High Priority message from [my_department]</FONT></B><BR>[sending]"
|
||||
MS.send_rc_message("Head of Personnel's Desk", my_department, message, "", "", 2)
|
||||
|
||||
/datum/event/money_hacker/tick()
|
||||
if(world.time >= end_time)
|
||||
@@ -80,27 +60,7 @@
|
||||
message = "The attack has ceased, the affected accounts can now be brought online."
|
||||
|
||||
var/my_department = "[station_name()] firewall subroutines"
|
||||
var/sending = message + "<font color='blue'><b>Message dispatched by [my_department].</b></font>"
|
||||
|
||||
var/pass = 0
|
||||
for(var/obj/machinery/message_server/MS in world)
|
||||
if(!MS.active) continue
|
||||
// /obj/machinery/message_server/proc/send_rc_message(var/recipient = "",var/sender = "",var/message = "",var/stamp = "", var/id_auth = "", var/priority = 1)
|
||||
MS.send_rc_message("Engineering/Security/Bridge", my_department, message, "", "", 2)
|
||||
pass = 1
|
||||
|
||||
if(pass)
|
||||
var/keyed_dpt1 = ckey("Engineering")
|
||||
var/keyed_dpt2 = ckey("Security")
|
||||
var/keyed_dpt3 = ckey("Bridge")
|
||||
for (var/obj/machinery/requests_console/Console in allConsoles)
|
||||
var/keyed_department = ckey(Console.department)
|
||||
if(keyed_department == keyed_dpt1 || keyed_department == keyed_dpt2 || keyed_department == keyed_dpt3)
|
||||
if(Console.newmessagepriority < 2)
|
||||
Console.newmessagepriority = 2
|
||||
Console.icon_state = "req_comp2"
|
||||
if(!Console.silent)
|
||||
playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
for (var/mob/O in hearers(5, Console.loc))
|
||||
O.show_message(text("\icon[Console] *The Requests Console beeps: 'PRIORITY Alert in [my_department]'"))
|
||||
Console.messages += "<B><FONT color='red'>High Priority message from [my_department]</FONT></B><BR>[sending]"
|
||||
MS.send_rc_message("Head of Personnel's Desk", my_department, message, "", "", 2)
|
||||
|
||||
@@ -1,56 +1,71 @@
|
||||
/datum/event/prison_break
|
||||
announceWhen = 50
|
||||
startWhen = 5
|
||||
announceWhen = 75
|
||||
|
||||
var/releaseWhen = 60
|
||||
var/list/area/areas = list() //List of areas to affect. Filled by start()
|
||||
|
||||
var/eventDept = "Security" //Department name in announcement
|
||||
var/list/areaName = list("Brig") //Names of areas mentioned in AI and Engineering announcements
|
||||
var/list/areaType = list(/area/security/prison, /area/security/brig, /area/security/permabrig) //Area types to include.
|
||||
var/list/areaNotType = list() //Area types to specifically exclude.
|
||||
|
||||
/datum/event/prison_break/virology
|
||||
eventDept = "Medical"
|
||||
areaName = list("Virology")
|
||||
areaType = list(/area/medical/virology, /area/medical/virology/lab)
|
||||
|
||||
/datum/event/prison_break/xenobiology
|
||||
eventDept = "Science"
|
||||
areaName = list("Xenobiology")
|
||||
areaType = list(/area/toxins/xenobiology)
|
||||
areaNotType = list(/area/toxins/xenobiology/xenoflora, /area/toxins/xenobiology/xenoflora_storage)
|
||||
|
||||
/datum/event/prison_break/station
|
||||
eventDept = "Station"
|
||||
areaName = list("Brig","Virology","Xenobiology")
|
||||
areaType = list(/area/security/prison, /area/security/brig, /area/security/permabrig, /area/medical/virology, /area/medical/virology/lab, /area/toxins/xenobiology)
|
||||
areaNotType = list(/area/toxins/xenobiology/xenoflora, /area/toxins/xenobiology/xenoflora_storage)
|
||||
|
||||
var/releaseWhen = 25
|
||||
var/list/area/prisonAreas = list()
|
||||
var/list/potentialAreas = list("/area/security/prison","/area/security/brig","/area/security/processing","/area/security/permabrig","/area/security/lobby","/area/security/lobby")
|
||||
var/list/candidateAreas = list()
|
||||
|
||||
/datum/event/prison_break/setup()
|
||||
announceWhen = rand(50, 60)
|
||||
releaseWhen = rand(20, 30)
|
||||
announceWhen = rand(75, 105)
|
||||
releaseWhen = rand(60, 90)
|
||||
|
||||
src.startWhen = src.releaseWhen-1
|
||||
src.endWhen = src.releaseWhen+1
|
||||
|
||||
for(var/areaa in potentialAreas)
|
||||
var/path = text2path(areaa)
|
||||
candidateAreas += typesof(path)
|
||||
|
||||
for(var/area/A in world)
|
||||
if(is_type_in_list(A, candidateAreas))
|
||||
prisonAreas += A
|
||||
src.endWhen = src.releaseWhen+2
|
||||
|
||||
|
||||
/datum/event/prison_break/announce()
|
||||
if(prisonAreas && prisonAreas.len > 0)
|
||||
command_announcement.Announce("[pick("Gr3y.T1d3 virus","Malignant trojan")] detected in [station_name()] imprisonment subroutines. Recommend station AI involvement.", "Security Alert")
|
||||
else
|
||||
world.log << "ERROR: Could not initate grey-tide. Unable find prison or brig area."
|
||||
kill()
|
||||
if(areas && areas.len > 0)
|
||||
command_announcement.Announce("[pick("Gr3y.T1d3 virus","Malignant trojan")] detected in [station_name()] [(eventDept == "Security")? "imprisonment":"containment"] subroutines. Secure any compromised areas immediately. Station AI involvement is recommended.", "[eventDept] Alert")
|
||||
|
||||
|
||||
/datum/event/prison_break/start()
|
||||
if(prisonAreas && prisonAreas.len > 0)
|
||||
for(var/area/A in prisonAreas)
|
||||
for(var/obj/machinery/light/L in A)
|
||||
L.flicker(10)
|
||||
for(var/area/A in world)
|
||||
if(is_type_in_list(A,areaType) && !is_type_in_list(A,areaNotType))
|
||||
areas += A
|
||||
|
||||
if(areas && areas.len > 0)
|
||||
var/my_department = "[station_name()] firewall subroutines"
|
||||
var/rc_message = "An unknown malicious program has been detected in the [english_list(areaName)] lighting and airlock control systems at [worldtime2text()]. Systems will be fully compromised within approximately three minutes. Direct intervention is required immediately.<br>"
|
||||
for(var/obj/machinery/message_server/MS in world)
|
||||
MS.send_rc_message("Engineering", my_department, rc_message, "", "", 2)
|
||||
for(var/mob/living/silicon/ai/A in player_list)
|
||||
A << "<span class='danger'>Malicious program detected in the [english_list(areaName)] lighting and airlock control systems by [my_department].</span>"
|
||||
|
||||
else
|
||||
world.log << "ERROR: Could not initate grey-tide. Unable to find suitable containment area."
|
||||
kill()
|
||||
|
||||
|
||||
/datum/event/prison_break/tick()
|
||||
if(activeFor == releaseWhen)
|
||||
if(prisonAreas && prisonAreas.len > 0)
|
||||
for(var/area/A in prisonAreas)
|
||||
for(var/obj/machinery/power/apc/temp_apc in A)
|
||||
temp_apc.overload_lighting()
|
||||
if(areas && areas.len > 0)
|
||||
for(var/area/A in areas)
|
||||
for(var/obj/machinery/light/L in A)
|
||||
L.flicker(10)
|
||||
|
||||
for(var/obj/structure/closet/secure_closet/brig/temp_closet in A)
|
||||
temp_closet.locked = 0
|
||||
temp_closet.icon_state = temp_closet.icon_closed
|
||||
|
||||
for(var/obj/machinery/door/airlock/security/temp_airlock in A)
|
||||
temp_airlock.prison_open()
|
||||
|
||||
for(var/obj/machinery/door/airlock/glass_security/temp_glassairlock in A)
|
||||
temp_glassairlock.prison_open()
|
||||
|
||||
for(var/obj/machinery/door_timer/temp_timer in A)
|
||||
temp_timer.releasetime = 1
|
||||
/datum/event/prison_break/end()
|
||||
for(var/area/A in shuffle(areas))
|
||||
A.prison_break()
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
/obj/machinery/cooking/oven/updatefood()
|
||||
for(var/U in food_choices)
|
||||
food_choices.Remove(U)
|
||||
for(var/U in typesof(/obj/item/weapon/reagent_containers/food/snacks/customizable/cook)-(/obj/item/weapon/reagent_containers/food/snacks/customizable/cook))
|
||||
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
|
||||
@@ -73,7 +73,7 @@
|
||||
/obj/machinery/cooking/candy/updatefood()
|
||||
for(var/U in food_choices)
|
||||
food_choices.Remove(U)
|
||||
for(var/U in typesof(/obj/item/weapon/reagent_containers/food/snacks/customizable/candy)-(/obj/item/weapon/reagent_containers/food/snacks/customizable/candy))
|
||||
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
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
// Base Candy Recipes (unflavored / plain)
|
||||
// ***********************************************************
|
||||
|
||||
/datum/recipe/candy/cotton
|
||||
/datum/recipe/candy/cottoncandy
|
||||
reagents = list("sugar" = 15)
|
||||
items = list(
|
||||
/obj/item/weapon/c_tube,
|
||||
@@ -99,7 +99,7 @@
|
||||
/obj/item/weapon/kitchen/mould/cane,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/mint,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/mint
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/candycane
|
||||
byproduct = /obj/item/weapon/kitchen/mould/cane
|
||||
|
||||
/datum/recipe/candy/gum
|
||||
@@ -115,7 +115,6 @@
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/candybar
|
||||
|
||||
/datum/recipe/candy/cash
|
||||
reagents = list()
|
||||
items = list(
|
||||
/obj/item/weapon/kitchen/mould/cash,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/chocolatebar,
|
||||
@@ -124,7 +123,6 @@
|
||||
byproduct = /obj/item/weapon/kitchen/mould/cash
|
||||
|
||||
/datum/recipe/candy/coin
|
||||
reagents = list()
|
||||
items = list(
|
||||
/obj/item/weapon/kitchen/mould/coin,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/chocolatebar,
|
||||
@@ -144,63 +142,63 @@
|
||||
// Cotton Candy Recipes (flavored)
|
||||
// ***********************************************************
|
||||
|
||||
/datum/recipe/candy/cotton/red
|
||||
/datum/recipe/candy/cottoncandy_red
|
||||
reagents = list("cherryjelly" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/cotton,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/cotton/red
|
||||
|
||||
/datum/recipe/candy/cotton/blue
|
||||
/datum/recipe/candy/cottoncandy_blue
|
||||
reagents = list("berryjuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/cotton,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/cotton/blue
|
||||
|
||||
/datum/recipe/candy/cotton/poison
|
||||
/datum/recipe/candy/cottoncandy_poison
|
||||
reagents = list("poisonberryjuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/cotton,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/cotton/poison
|
||||
|
||||
/datum/recipe/candy/cotton/green
|
||||
/datum/recipe/candy/cottoncandy_green
|
||||
reagents = list("limejuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/cotton,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/cotton/green
|
||||
|
||||
/datum/recipe/candy/cotton/yellow
|
||||
/datum/recipe/candy/cottoncandy_yellow
|
||||
reagents = list("lemonjuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/cotton,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/cotton/yellow
|
||||
|
||||
/datum/recipe/candy/cotton/orange
|
||||
/datum/recipe/candy/cottoncandy_orange
|
||||
reagents = list("orangejuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/cotton,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/cotton/orange
|
||||
|
||||
/datum/recipe/candy/cotton/purple
|
||||
/datum/recipe/candy/cottoncandy_purple
|
||||
reagents = list("grapejuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/cotton,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/cotton/purple
|
||||
|
||||
/datum/recipe/candy/cotton/pink
|
||||
/datum/recipe/candy/cottoncandy_pink
|
||||
reagents = list("watermelonjuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/cotton,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/cotton/pink
|
||||
|
||||
/datum/recipe/candy/cotton/rainbow
|
||||
/datum/recipe/candy/cottoncandy_rainbow
|
||||
reagents = list()
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/cotton/red,
|
||||
@@ -213,7 +211,7 @@
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/cotton/rainbow
|
||||
|
||||
/datum/recipe/candy/cotton/rainbow2
|
||||
/datum/recipe/candy/cottoncandy_rainbow2
|
||||
reagents = list()
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/cotton/red,
|
||||
@@ -230,67 +228,67 @@
|
||||
// Gummy Bear Recipes (flavored)
|
||||
// ***********************************************************
|
||||
|
||||
/datum/recipe/candy/gummybear/red
|
||||
/datum/recipe/candy/gummybear_red
|
||||
reagents = list("cherryjelly" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/gummybear,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/gummybear/red
|
||||
|
||||
/datum/recipe/candy/gummybear/blue
|
||||
/datum/recipe/candy/gummybear_blue
|
||||
reagents = list("berryjuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/gummybear,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/gummybear/blue
|
||||
|
||||
/datum/recipe/candy/gummybear/poison
|
||||
/datum/recipe/candy/gummybear_poison
|
||||
reagents = list("poisonberryjuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/gummybear,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/gummybear/poison
|
||||
|
||||
/datum/recipe/candy/gummybear/green
|
||||
/datum/recipe/candy/gummybear_green
|
||||
reagents = list("limejuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/gummybear,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/gummybear/green
|
||||
|
||||
/datum/recipe/candy/gummybear/yellow
|
||||
/datum/recipe/candy/gummybear_yellow
|
||||
reagents = list("lemonjuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/gummybear,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/gummybear/yellow
|
||||
|
||||
/datum/recipe/candy/gummybear/orange
|
||||
/datum/recipe/candy/gummybear_orange
|
||||
reagents = list("orangejuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/gummybear,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/gummybear/orange
|
||||
|
||||
/datum/recipe/candy/gummybear/purple
|
||||
/datum/recipe/candy/gummybear_purple
|
||||
reagents = list("grapejuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/gummybear,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/gummybear/purple
|
||||
|
||||
/datum/recipe/candy/gummybear/wtf
|
||||
/datum/recipe/candy/gummybear_wtf
|
||||
reagents = list("space_drugs" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/gummybear,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/gummybear/wtf
|
||||
|
||||
/datum/recipe/candy/gummybear/wtf2
|
||||
/datum/recipe/candy/gummybear_wtf2
|
||||
reagents = list()
|
||||
fruit = list("ambrosia" = 1)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/gummybear,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiavulgaris
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/gummybear
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/gummybear/wtf
|
||||
|
||||
@@ -298,67 +296,66 @@
|
||||
// Gummy Worm Recipes (flavored)
|
||||
// ***********************************************************
|
||||
|
||||
/datum/recipe/candy/gummyworm/red
|
||||
/datum/recipe/candy/gummyworm_red
|
||||
reagents = list("cherryjelly" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/gummyworm,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/gummyworm/red
|
||||
|
||||
/datum/recipe/candy/gummyworm/blue
|
||||
/datum/recipe/candy/gummyworm_blue
|
||||
reagents = list("berryjuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/gummyworm,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/gummyworm/blue
|
||||
|
||||
/datum/recipe/candy/gummyworm/poison
|
||||
/datum/recipe/candy/gummyworm_poison
|
||||
reagents = list("poisonberryjuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/gummyworm,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/gummyworm/poison
|
||||
|
||||
/datum/recipe/candy/gummyworm/green
|
||||
/datum/recipe/candy/gummyworm_green
|
||||
reagents = list("limejuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/gummyworm,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/gummyworm/green
|
||||
|
||||
/datum/recipe/candy/gummyworm/yellow
|
||||
/datum/recipe/candy/gummyworm_yellow
|
||||
reagents = list("lemonjuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/gummyworm,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/gummyworm/yellow
|
||||
|
||||
/datum/recipe/candy/gummyworm/orange
|
||||
/datum/recipe/candy/gummyworm_orange
|
||||
reagents = list("orangejuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/gummyworm,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/gummyworm/orange
|
||||
|
||||
/datum/recipe/candy/gummyworm/purple
|
||||
/datum/recipe/candy/gummyworm_purple
|
||||
reagents = list("grapejuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/gummyworm,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/gummyworm/purple
|
||||
|
||||
/datum/recipe/candy/gummyworm/wtf
|
||||
/datum/recipe/candy/gummyworm_wtf
|
||||
reagents = list("space_drugs" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/gummyworm,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/gummyworm/wtf
|
||||
|
||||
/datum/recipe/candy/gummyworm/wtf2
|
||||
reagents = list()
|
||||
/datum/recipe/candy/gummyworm_wtf2
|
||||
fruit = list("ambrosia" = 1)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/gummyworm,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiavulgaris
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/gummyworm
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/gummyworm/wtf
|
||||
|
||||
@@ -366,56 +363,56 @@
|
||||
// Jelly Bean Recipes (flavored)
|
||||
// ***********************************************************
|
||||
|
||||
/datum/recipe/candy/jellybean/red
|
||||
/datum/recipe/candy/jellybean_red
|
||||
reagents = list("cherryjelly" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/jellybean,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/jellybean/red
|
||||
|
||||
/datum/recipe/candy/jellybean/blue
|
||||
/datum/recipe/candy/jellybean_blue
|
||||
reagents = list("berryjuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/jellybean,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/jellybean/blue
|
||||
|
||||
/datum/recipe/candy/jellybean/poison
|
||||
/datum/recipe/candy/jellybean_poison
|
||||
reagents = list("poisonberryjuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/jellybean,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/jellybean/poison
|
||||
|
||||
/datum/recipe/candy/jellybean/green
|
||||
/datum/recipe/candy/jellybean_green
|
||||
reagents = list("limejuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/jellybean,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/jellybean/green
|
||||
|
||||
/datum/recipe/candy/jellybean/yellow
|
||||
/datum/recipe/candy/jellybean_yellow
|
||||
reagents = list("lemonjuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/jellybean,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/jellybean/yellow
|
||||
|
||||
/datum/recipe/candy/jellybean/orange
|
||||
/datum/recipe/candy/jellybean_orange
|
||||
reagents = list("orangejuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/jellybean,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/jellybean/orange
|
||||
|
||||
/datum/recipe/candy/jellybean/purple
|
||||
/datum/recipe/candy/jellybean_purple
|
||||
reagents = list("grapejuice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/jellybean,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/jellybean/purple
|
||||
|
||||
/datum/recipe/candy/jellybean/chocolate
|
||||
/datum/recipe/candy/jellybean_chocolate
|
||||
reagents = list()
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/jellybean,
|
||||
@@ -423,47 +420,45 @@
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/jellybean/chocolate
|
||||
|
||||
/datum/recipe/candy/jellybean/cola
|
||||
/datum/recipe/candy/jellybean_cola
|
||||
reagents = list("cola" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/jellybean,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/jellybean/cola
|
||||
|
||||
/datum/recipe/candy/jellybean/popcorn
|
||||
/datum/recipe/candy/jellybean_popcorn
|
||||
reagents = list()
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/popcorn,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/jellybean/popcorn
|
||||
|
||||
/datum/recipe/candy/jellybean/coffee
|
||||
/datum/recipe/candy/jellybean_coffee
|
||||
reagents = list("coffee" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/jellybean,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/jellybean/cola
|
||||
|
||||
/datum/recipe/candy/jellybean/drgibb
|
||||
/datum/recipe/candy/jellybean_drgibb
|
||||
reagents = list("dr_gibb" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/jellybean,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/jellybean/cola
|
||||
|
||||
|
||||
/datum/recipe/candy/jellybean/wtf
|
||||
/datum/recipe/candy/jellybean_wtf
|
||||
reagents = list("space_drugs" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/jellybean,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/jellybean/wtf
|
||||
|
||||
/datum/recipe/candy/jellybean/wtf2
|
||||
reagents = list()
|
||||
/datum/recipe/candy/jellybean_wtf2
|
||||
fruit = list("ambrosia" = 1)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/jellybean,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiavulgaris
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/jellybean
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/jellybean/wtf
|
||||
|
||||
@@ -471,7 +466,7 @@
|
||||
// Candybar Recipes (flavored)
|
||||
// ***********************************************************
|
||||
|
||||
/datum/recipe/candy/candybar/caramel
|
||||
/datum/recipe/candy/malper
|
||||
reagents = list()
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/candybar,
|
||||
@@ -479,7 +474,7 @@
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/candybar/caramel
|
||||
|
||||
/datum/recipe/candy/candybar/nougat
|
||||
/datum/recipe/candy/toolerone
|
||||
reagents = list()
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/candybar,
|
||||
@@ -487,7 +482,7 @@
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/candybar/nougat
|
||||
|
||||
/datum/recipe/candy/candybar/toffee
|
||||
/datum/recipe/candy/yumbaton
|
||||
reagents = list()
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/candybar,
|
||||
@@ -495,14 +490,14 @@
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/candybar/toffee
|
||||
|
||||
/datum/recipe/candy/candybar/rice
|
||||
/datum/recipe/candy/crunch
|
||||
reagents = list("rice" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/candybar,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candy/candybar/rice
|
||||
|
||||
/datum/recipe/candy/candybar/caramel_nougat
|
||||
/datum/recipe/candy/toxinstest
|
||||
reagents = list()
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/candy/candybar,
|
||||
|
||||
@@ -327,19 +327,11 @@
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/fishandchips
|
||||
|
||||
/datum/recipe/microwave/sandwich
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meatsteak,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/breadslice,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/breadslice,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sandwich
|
||||
|
||||
/datum/recipe/microwave/toastedsandwich
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sandwich
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/toastedsandwich
|
||||
|
||||
/datum/recipe/microwave/tomatosoup
|
||||
reagents = list("water" = 10)
|
||||
@@ -453,20 +445,6 @@
|
||||
fruit = list("apple" = 1)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/candiedapple
|
||||
|
||||
/datum/recipe/microwave/slimeburger
|
||||
reagents = list("slimejelly" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/bun
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/jellyburger/slime
|
||||
|
||||
/datum/recipe/microwave/jellyburger
|
||||
reagents = list("cherryjelly" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/bun
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/jellyburger/cherry
|
||||
|
||||
/datum/recipe/microwave/twobread
|
||||
reagents = list("wine" = 5)
|
||||
items = list(
|
||||
@@ -475,22 +453,6 @@
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/twobread
|
||||
|
||||
/datum/recipe/microwave/slimesandwich
|
||||
reagents = list("slimejelly" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/breadslice,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/breadslice,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/jellysandwich/slime
|
||||
|
||||
/datum/recipe/microwave/cherrysandwich
|
||||
reagents = list("cherryjelly" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/breadslice,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/breadslice,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/jellysandwich/cherry
|
||||
|
||||
/datum/recipe/microwave/bloodsoup
|
||||
reagents = list("blood" = 10)
|
||||
fruit = list("bloodtomato" = 2)
|
||||
@@ -505,7 +467,7 @@
|
||||
reagents = list("water" = 10)
|
||||
fruit = list("banana" = 1)
|
||||
items = list(
|
||||
/obj/item/weapon/ore/clown,
|
||||
/obj/item/weapon/ore/bananium,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/clownstears
|
||||
|
||||
@@ -556,39 +518,8 @@
|
||||
fruit = list("whitebeet" = 1, "cabbage" = 1)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/beetsoup
|
||||
|
||||
/datum/recipe/microwave/herbsalad
|
||||
fruit = list("ambrosia" = 3, "apple" = 1)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/herbsalad
|
||||
make_food(var/obj/container as obj)
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/herbsalad/being_cooked = ..(container)
|
||||
being_cooked.reagents.del_reagent("toxin")
|
||||
return being_cooked
|
||||
|
||||
/datum/recipe/microwave/aesirsalad
|
||||
fruit = list("ambrosiadeus" = 3, "goldapple" = 1)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/aesirsalad
|
||||
|
||||
/datum/recipe/microwave/validsalad
|
||||
fruit = list("ambrosia" = 3, "potato" = 1)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meatball,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/validsalad
|
||||
make_food(var/obj/container as obj)
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/validsalad/being_cooked = ..(container)
|
||||
being_cooked.reagents.del_reagent("toxin")
|
||||
return being_cooked
|
||||
|
||||
////////////////////////////FOOD ADDITTIONS///////////////////////////////
|
||||
|
||||
/datum/recipe/microwave/wrap
|
||||
reagents = list("soysauce" = 10)
|
||||
fruit = list("cabbage" = 1)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/friedegg,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/wrap
|
||||
|
||||
/datum/recipe/microwave/beans
|
||||
reagents = list("ketchup" = 5)
|
||||
fruit = list("soybeans" = 2)
|
||||
@@ -618,14 +549,6 @@
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/icecreamsandwich
|
||||
|
||||
/datum/recipe/microwave/notasandwich
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/breadslice,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/breadslice,
|
||||
/obj/item/clothing/mask/fakemoustache,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/notasandwich
|
||||
|
||||
/datum/recipe/microwave/friedbanana
|
||||
reagents = list("sugar" = 10, "cornoil" = 5)
|
||||
fruit = list("banana" = 1)
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
/* Example for reference when defining recipes
|
||||
/datum/table_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
|
||||
tools[] = list() //type paths of items needed but not consumed
|
||||
time = 30 //time in deciseconds
|
||||
parts[] = list() //type paths of items that will be placed in the result
|
||||
fruit[] = list() //grown products required by the recipe
|
||||
*/
|
||||
|
||||
/datum/table_recipe/sandwich
|
||||
name = "Sandwich"
|
||||
reqs = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meatsteak = 1,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/breadslice = 2,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge = 1,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sandwich
|
||||
|
||||
/datum/table_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
|
||||
|
||||
/datum/table_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
|
||||
|
||||
/datum/table_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
|
||||
|
||||
/datum/table_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
|
||||
|
||||
/datum/table_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)
|
||||
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
|
||||
name = "Aesir salad"
|
||||
fruit = list("ambrosiadeus" = 3, "goldapple" = 1)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/aesirsalad
|
||||
|
||||
/datum/table_recipe/validsalad
|
||||
name = "valid salad"
|
||||
fruit = list("ambrosia" = 3, "potato" = 1)
|
||||
reqs = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meatball = 1,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/validsalad
|
||||
|
||||
/datum/table_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
|
||||
name = "egg wrap"
|
||||
fruit = list("cabbage" = 1)
|
||||
reqs = list(
|
||||
/datum/reagent/soysauce = 10,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/friedegg = 1,
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/wrap
|
||||
@@ -77,7 +77,7 @@
|
||||
proc/trigger_side_effect(mob/living/carbon/human/H)
|
||||
spawn
|
||||
if(!istype(H)) return
|
||||
var/tp = pick(typesof(/datum/genetics/side_effect) - /datum/genetics/side_effect)
|
||||
var/tp = pick(subtypesof(/datum/genetics/side_effect))
|
||||
var/datum/genetics/side_effect/S = new tp
|
||||
|
||||
S.start(H)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/datum/genetree/New(var/obj/machinery/networked/biomass_controller/holder)
|
||||
biomass = holder
|
||||
// Build list of all sectors
|
||||
for(var/typepath in typesof(/datum/genetic_sector) - /datum/genetic_sector)
|
||||
for(var/typepath in subtypesof(/datum/genetic_sector))
|
||||
var/datum/genetic_sector/sector = new typepath
|
||||
sectors[sector.id]=sector
|
||||
|
||||
|
||||
@@ -328,7 +328,7 @@
|
||||
if(!check_rights(R_SERVER)) return
|
||||
|
||||
var/list/choice = list()
|
||||
for(var/H in typesof(/datum/holiday) - /datum/holiday)
|
||||
for(var/H in subtypesof(/datum/holiday))
|
||||
choice += "[H]"
|
||||
|
||||
choice += "--CANCEL--"
|
||||
|
||||
@@ -71,7 +71,7 @@ var/global/datum/controller/plants/plant_controller // Set in New().
|
||||
plant_product_sprites |= copytext(icostate,1,split)
|
||||
|
||||
// Populate the global seed datum list.
|
||||
for(var/type in typesof(/datum/seed)-/datum/seed)
|
||||
for(var/type in subtypesof(/datum/seed))
|
||||
var/datum/seed/S = new type
|
||||
seeds[S.name] = S
|
||||
S.uid = "[seeds.len]"
|
||||
|
||||
@@ -162,10 +162,10 @@
|
||||
..()
|
||||
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/hydroponics(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/weapon/circuitboard/hydroponics(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
|
||||
RefreshParts()
|
||||
|
||||
temp_chem_holder = new()
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
/obj/effect/landmark/animal_spawner/New()
|
||||
if(!spawn_type)
|
||||
var/new_type = pick(typesof(/obj/effect/landmark/animal_spawner) - /obj/effect/landmark/animal_spawner)
|
||||
var/new_type = pick(subtypesof(/obj/effect/landmark/animal_spawner))
|
||||
new new_type(get_turf(src))
|
||||
qdel(src)
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
var/amount = rand(2,6)
|
||||
var/quantity = rand(10,50)
|
||||
var/list/possible_spawns = list()
|
||||
for(var/bar_type in typesof(/obj/item/stack/sheet/mineral) - /obj/item/stack/sheet/mineral - /obj/item/stack/sheet/mineral/enruranium)
|
||||
for(var/bar_type in subtypesof(/obj/item/stack/sheet/mineral) - /obj/item/stack/sheet/mineral/enruranium)
|
||||
possible_spawns += bar_type
|
||||
|
||||
var/bar_type = pick(possible_spawns)
|
||||
|
||||
@@ -130,16 +130,16 @@
|
||||
#if LIGHTING_FALLOFF == 1 //circular
|
||||
#define LUM_DISTANCE(swapvar, O, T) swapvar = (O.x - T.x)**2 + (O.y - T.y)**2 + LIGHTING_HEIGHT
|
||||
#if LIGHTING_LAMBERTIAN == 1
|
||||
#define LUM_ATTENUATION(swapvar) swapvar = CLAMP01((1 - CLAMP01(sqrt(swapvar) / light_range)) * (1 / sqrt(swapvar + 1)))
|
||||
#define LUM_ATTENUATION(swapvar) swapvar = CLAMP01((1 - CLAMP01(sqrt(swapvar) / max(1,light_range))) * (1 / sqrt(swapvar + 1)))
|
||||
#else
|
||||
#define LUM_ATTENUATION(swapvar) swapvar = 1 - CLAMP01(sqrt(swapvar) / light_range)
|
||||
#define LUM_ATTENUATION(swapvar) swapvar = 1 - CLAMP01(sqrt(swapvar) / max(1,light_range))
|
||||
#endif
|
||||
#elif LIGHTING_FALLOFF == 2 //square
|
||||
#define LUM_DISTANCE(swapvar, O, T) swapvar = abs(O.x - T.x) + abs(O.y - T.y) + LIGHTING_HEIGHT
|
||||
#if LIGHTING_LAMBERTIAN == 1
|
||||
#define LUM_ATTENUATION(swapvar) swapvar = CLAMP01((1 - CLAMP01(swapvar / light_range)) * (1 / sqrt(swapvar**2 + 1)))
|
||||
#define LUM_ATTENUATION(swapvar) swapvar = CLAMP01((1 - CLAMP01(swapvar / max(1,light_range))) * (1 / sqrt(swapvar**2 + 1)))
|
||||
#else
|
||||
#define LUM_ATTENUATION(swapvar) swapvar = CLAMP01(swapvar / light_range)
|
||||
#define LUM_ATTENUATION(swapvar) swapvar = CLAMP01(swapvar / max(1,light_range))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -177,6 +177,7 @@
|
||||
|
||||
T.affecting_lights += src
|
||||
effect_turf += T
|
||||
END_FOR_DVIEW
|
||||
|
||||
/datum/light_source/proc/remove_lum()
|
||||
applied = 0
|
||||
@@ -201,11 +202,10 @@
|
||||
var/list/view[0]
|
||||
FOR_DVIEW(var/turf/T, light_range, source_turf, INVISIBILITY_LIGHTING)
|
||||
view += T //Filter out turfs.
|
||||
|
||||
END_FOR_DVIEW
|
||||
//This is the part where we calculate new turfs (if any)
|
||||
var/list/new_turfs = view - effect_turf //This will result with all the tiles that are added.
|
||||
for(var/turf/T in new_turfs)
|
||||
//Big huge copy paste from apply_lum() incoming because screw unreadable defines and screw proc call overhead.
|
||||
if(T.lighting_overlay)
|
||||
LUM_FALLOFF(., T, source_turf)
|
||||
. *= light_power
|
||||
|
||||
@@ -109,7 +109,7 @@ function SetMusic(url, time, volume) {
|
||||
|
||||
// Tell the player to play something via JS.
|
||||
proc/send_update()
|
||||
if(!(owner.prefs.toggles & SOUND_STREAMING))
|
||||
if(!(owner.prefs.toggles & SOUND_STREAMING) && url != "")
|
||||
return // Nope.
|
||||
MP_DEBUG("\green Sending update to WMP ([url])...")
|
||||
owner << output(list2params(list(url, (world.time - start_time) / 10, volume)), "[window]:SetMusic")
|
||||
|
||||
@@ -74,6 +74,16 @@
|
||||
sideslist = list("heads")
|
||||
credits = 20
|
||||
|
||||
/obj/item/weapon/coin/antagtoken
|
||||
name = "antag token"
|
||||
icon_state = "coin_valid_valid"
|
||||
cmineral = "valid"
|
||||
desc = "A novelty coin that helps the heart know what hard evidence cannot prove."
|
||||
sideslist = list("valid", "salad")
|
||||
credits = 20
|
||||
|
||||
/obj/item/weapon/coin/antagtoken/New()
|
||||
return
|
||||
|
||||
/obj/item/weapon/coin/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
|
||||
if(istype(W, /obj/item/stack/cable_coil))
|
||||
|
||||
@@ -3,63 +3,128 @@
|
||||
|
||||
/obj/machinery/mineral/ore_redemption
|
||||
name = "ore redemption machine"
|
||||
desc = "A machine that accepts ore and instantly transforms it into workable material sheets, but cannot produce alloys such as Plasteel. Points for ore are generated based on type and can be redeemed at a mining equipment locker."
|
||||
desc = "A machine that accepts ore and instantly transforms it into workable material sheets, but cannot produce alloys such as Plasteel. Points for ore are generated based on type and can be redeemed at a mining equipment vendor."
|
||||
icon = 'icons/obj/machines/mining_machines.dmi'
|
||||
icon_state = "ore_redemption"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
req_one_access = list(
|
||||
access_mining_station,
|
||||
access_chemistry,
|
||||
access_bar,
|
||||
access_research,
|
||||
access_ce,
|
||||
access_virology
|
||||
)
|
||||
var/datum/materials/materials = new
|
||||
var/stack_amt = 50; //amount to stack before releasing
|
||||
input_dir = NORTH
|
||||
output_dir = SOUTH
|
||||
req_access = list(access_mineral_storeroom)
|
||||
var/stk_types = list()
|
||||
var/stk_amt = list()
|
||||
var/stack_list[0] //Key: Type. Value: Instance of type.
|
||||
var/obj/item/weapon/card/id/inserted_id
|
||||
var/points = 0
|
||||
var/ore_pickup_rate = 15
|
||||
var/sheet_per_ore = 1
|
||||
var/point_upgrade = 1
|
||||
var/list/ore_values = list(("sand" = 1), ("iron" = 1), ("gold" = 20), ("silver" = 20), ("uranium" = 20), ("bananium" = 30), ("diamond" = 40), ("plasma" = 40))
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/New()
|
||||
spawn( 5 )
|
||||
for (var/dir in cardinal)
|
||||
src.input = locate(/obj/machinery/mineral/input, get_step(src, dir))
|
||||
if(src.input) break
|
||||
for (var/dir in cardinal)
|
||||
src.output = locate(/obj/machinery/mineral/output, get_step(src, dir))
|
||||
if(src.output) break
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/ore_redemption(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/micro_laser(null)
|
||||
component_parts += new /obj/item/device/assembly/igniter(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/upgraded/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/ore_redemption(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin/super(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator/pico(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/micro_laser/ultra(null)
|
||||
component_parts += new /obj/item/device/assembly/igniter(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/RefreshParts()
|
||||
var/ore_pickup_rate_temp = 15
|
||||
var/point_upgrade_temp = 1
|
||||
var/sheet_per_ore_temp = 1
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/B in component_parts)
|
||||
sheet_per_ore_temp = B.rating
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
|
||||
ore_pickup_rate_temp = 15 * M.rating
|
||||
for(var/obj/item/weapon/stock_parts/micro_laser/L in component_parts)
|
||||
point_upgrade_temp = L.rating
|
||||
ore_pickup_rate = ore_pickup_rate_temp
|
||||
point_upgrade = point_upgrade_temp
|
||||
sheet_per_ore = sheet_per_ore_temp
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/proc/process_sheet(obj/item/weapon/ore/O)
|
||||
var/obj/item/stack/sheet/processed_sheet = SmeltMineral(O)
|
||||
if(processed_sheet)
|
||||
var/datum/material/mat = materials.getMaterial(O.oretag)
|
||||
mat.stored += processed_sheet.amount //Stack the sheets
|
||||
O.loc = null //Let the old sheet garbage collect
|
||||
while(mat.stored > stack_amt) //Get rid of excessive stackage
|
||||
var/obj/item/stack/sheet/out = new mat.sheettype(output.loc)
|
||||
out.amount = stack_amt-mat.stored
|
||||
mat.stored -= out.amount
|
||||
if(!(processed_sheet in stack_list)) //It's the first of this sheet added
|
||||
var/obj/item/stack/sheet/s = new processed_sheet(src,0)
|
||||
s.amount = 0
|
||||
stack_list[processed_sheet] = s
|
||||
var/obj/item/stack/sheet/storage = stack_list[processed_sheet]
|
||||
storage.amount += sheet_per_ore //Stack the sheets
|
||||
O.loc = null //Let the old sheet...
|
||||
qdel(O) //... garbage collect
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/process()
|
||||
var/turf/T = get_turf(input)
|
||||
if(T)
|
||||
var/obj/item/weapon/ore/O
|
||||
for(O in T)
|
||||
process_sheet(O)
|
||||
for(var/obj/structure/ore_box/B in T)
|
||||
for(O in B.contents)
|
||||
process_sheet(O)
|
||||
if(!panel_open) //If the machine is partially dissassembled, it should not process minerals
|
||||
var/turf/T = get_turf(get_step(src, input_dir))
|
||||
var/i
|
||||
if(T)
|
||||
if(locate(/obj/item/weapon/ore) in T)
|
||||
for (i = 0; i < ore_pickup_rate; i++)
|
||||
var/obj/item/weapon/ore/O = locate() in T
|
||||
if(O)
|
||||
process_sheet(O)
|
||||
else
|
||||
break
|
||||
else
|
||||
var/obj/structure/ore_box/B = locate() in T
|
||||
if(B)
|
||||
for (i = 0; i < ore_pickup_rate; i++)
|
||||
var/obj/item/weapon/ore/O = locate() in B.contents
|
||||
if(O)
|
||||
process_sheet(O)
|
||||
else
|
||||
break
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/attackby(var/obj/item/weapon/W, var/mob/user, params)
|
||||
if(istype(W,/obj/item/weapon/card/id))
|
||||
var/obj/item/weapon/card/id/I = usr.get_active_hand()
|
||||
if(istype(I) && !istype(inserted_id))
|
||||
if(!user.drop_item())
|
||||
return
|
||||
I.loc = src
|
||||
inserted_id = I
|
||||
interact(user)
|
||||
return
|
||||
if(exchange_parts(user, W))
|
||||
return
|
||||
|
||||
if(default_deconstruction_crowbar(W))
|
||||
return
|
||||
|
||||
if(default_unfasten_wrench(user, W))
|
||||
return
|
||||
if(default_deconstruction_screwdriver(user, "ore_redemption-open", "ore_redemption", W))
|
||||
updateUsrDialog()
|
||||
return
|
||||
if(panel_open)
|
||||
if(istype(W, /obj/item/weapon/crowbar))
|
||||
empty_content()
|
||||
default_deconstruction_crowbar(W)
|
||||
return 1
|
||||
..()
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/proc/SmeltMineral(var/obj/item/weapon/ore/O)
|
||||
if(O.oretag)
|
||||
var/datum/material/mat = materials.getMaterial(O.oretag)
|
||||
var/obj/item/stack/sheet/M = new mat.sheettype(src)
|
||||
points += mat.value
|
||||
if(O.refined_type)
|
||||
var/obj/item/stack/sheet/M = O.refined_type
|
||||
points += O.points * point_upgrade
|
||||
return M
|
||||
del(O)//No refined type? Purge it.
|
||||
qdel(O)//No refined type? Purge it.
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/attack_hand(user as mob)
|
||||
@@ -68,9 +133,11 @@
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/interact(mob/user)
|
||||
user.set_machine(src)
|
||||
|
||||
var/obj/item/stack/sheet/s
|
||||
var/dat
|
||||
|
||||
dat += text("<b>Ore Redemption Machine</b><br><br>")
|
||||
dat += text("This machine only accepts ore. Gibtonite and Slag are not accepted.<br><br>")
|
||||
dat += text("Current unclaimed points: [points]<br>")
|
||||
|
||||
@@ -80,24 +147,31 @@
|
||||
else
|
||||
dat += text("No ID inserted. <A href='?src=\ref[src];choice=insert'>Insert ID.</A><br>")
|
||||
|
||||
for(var/O in materials.storage)
|
||||
var/datum/material/mat = materials.getMaterial(O)
|
||||
if(mat.stored > 0)
|
||||
dat += text("[capitalize(mat.processed_name)]: [mat.stored] <A href='?src=\ref[src];release=[mat.id]'>Release</A><br>")
|
||||
for(var/O in stack_list)
|
||||
s = stack_list[O]
|
||||
if(s.amount > 0)
|
||||
if(O == stack_list[1])
|
||||
dat += "<br>" //just looks nicer
|
||||
dat += text("[capitalize(s.name)]: [s.amount] <A href='?src=\ref[src];release=[s.type]'>Release</A><br>")
|
||||
|
||||
dat += text("<br>This unit can hold stacks of [stack_amt] sheets of each mineral type.<br><br>")
|
||||
if((/obj/item/stack/sheet/metal in stack_list) && (/obj/item/stack/sheet/mineral/plasma in stack_list))
|
||||
var/obj/item/stack/sheet/metalstack = stack_list[/obj/item/stack/sheet/metal]
|
||||
var/obj/item/stack/sheet/plasmastack = stack_list[/obj/item/stack/sheet/mineral/plasma]
|
||||
if(min(metalstack.amount, plasmastack.amount))
|
||||
dat += text("Plasteel Alloy (Metal + Plasma): <A href='?src=\ref[src];plasteel=1'>Smelt</A><BR>")
|
||||
|
||||
dat += text("<HR><b>Mineral Value List:</b><BR>[get_ore_values()]")
|
||||
|
||||
user << browse("[dat]", "window=console_stacking_machine")
|
||||
dat += text("<br><div class='statusDisplay'><b>Mineral Value List:</b><BR>[get_ore_values()]</div>")
|
||||
|
||||
var/datum/browser/popup = new(user, "console_stacking_machine", "Ore Redemption Machine", 400, 500)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/proc/get_ore_values()
|
||||
var/dat = "<table border='0' width='300'>"
|
||||
for(var/mat_id in materials.storage)
|
||||
var/datum/material/mat = materials.getMaterial(mat_id)
|
||||
dat += "<tr><td>[capitalize(mat.processed_name)]</td><td>[mat.value]</td></tr>"
|
||||
for(var/ore in ore_values)
|
||||
var/value = ore_values[ore]
|
||||
dat += "<tr><td>[capitalize(ore)]</td><td>[value * point_upgrade]</td></tr>"
|
||||
dat += "</table>"
|
||||
return dat
|
||||
|
||||
@@ -111,35 +185,80 @@
|
||||
inserted_id.verb_pickup()
|
||||
inserted_id = null
|
||||
if(href_list["choice"] == "claim")
|
||||
inserted_id.mining_points += points
|
||||
points = 0
|
||||
src << "Points transferred."
|
||||
if(access_mining_station in inserted_id.access)
|
||||
inserted_id.mining_points += points
|
||||
points = 0
|
||||
else
|
||||
usr << "<span class='warning'>Required access not found.</span>"
|
||||
else if(href_list["choice"] == "insert")
|
||||
var/obj/item/weapon/card/id/I = usr.get_active_hand()
|
||||
if(istype(I))
|
||||
usr.drop_item()
|
||||
if(!usr.drop_item())
|
||||
return
|
||||
I.loc = src
|
||||
inserted_id = I
|
||||
else usr << "\red No valid ID."
|
||||
if(href_list["release"] && istype(inserted_id))
|
||||
if(check_access(inserted_id))
|
||||
var/release=href_list["release"]
|
||||
var/datum/material/mat = materials.getMaterial(release)
|
||||
if(!mat) return
|
||||
var/desired = input("How much?","How much [mat.processed_name] to eject?",mat.stored) as num
|
||||
if(desired==0) return
|
||||
var/obj/item/stack/sheet/out = new mat.sheettype()
|
||||
out.amount = min(mat.stored,desired)
|
||||
mat.stored=desired
|
||||
else usr << "<span class='warning'>No valid ID.</span>"
|
||||
if(href_list["release"])
|
||||
if(check_access(inserted_id) || allowed(usr)) //Check the ID inside, otherwise check the user.
|
||||
if(!(text2path(href_list["release"]) in stack_list)) return
|
||||
var/obj/item/stack/sheet/inp = stack_list[text2path(href_list["release"])]
|
||||
var/obj/item/stack/sheet/out = new inp.type()
|
||||
var/desired = input("How much?", "How much to eject?", 1) as num
|
||||
out.amount = min(desired,50,inp.amount)
|
||||
if(out.amount >= 1)
|
||||
inp.amount -= out.amount
|
||||
unload_mineral(out)
|
||||
if(inp.amount < 1)
|
||||
stack_list -= text2path(href_list["release"])
|
||||
else
|
||||
usr << "<span class='warning'>Required access not found.</span>"
|
||||
if(href_list["plasteel"])
|
||||
if(check_access(inserted_id) || allowed(usr))
|
||||
if(!(/obj/item/stack/sheet/metal in stack_list)) return
|
||||
if(!(/obj/item/stack/sheet/mineral/plasma in stack_list)) return
|
||||
var/obj/item/stack/sheet/metalstack = stack_list[/obj/item/stack/sheet/metal]
|
||||
var/obj/item/stack/sheet/plasmastack = stack_list[/obj/item/stack/sheet/mineral/plasma]
|
||||
|
||||
var/desired = input("How much?", "How much would you like to smelt?", 1) as num
|
||||
var/obj/item/stack/sheet/plasteel/plasteelout = new
|
||||
plasteelout.amount = min(desired,50,metalstack.amount,plasmastack.amount)
|
||||
if(plasteelout.amount >= 1)
|
||||
metalstack.amount -= plasteelout.amount
|
||||
plasmastack.amount -= plasteelout.amount
|
||||
unload_mineral(plasteelout)
|
||||
else
|
||||
usr << "<span class='warning'>Required access not found.</span>"
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/ex_act()
|
||||
return //So some chucklefuck doesn't ruin miners reward with an explosion
|
||||
/obj/machinery/mineral/ore_redemption/ex_act(severity, target)
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
if(severity == 1)
|
||||
if(prob(50))
|
||||
empty_content()
|
||||
qdel(src)
|
||||
else if(severity == 2)
|
||||
if(prob(25))
|
||||
empty_content()
|
||||
qdel(src)
|
||||
|
||||
//empty the redemption machine by stacks of at most max_amount (50 at this time) size
|
||||
/obj/machinery/mineral/ore_redemption/proc/empty_content()
|
||||
var/obj/item/stack/sheet/s
|
||||
|
||||
for(var/O in stack_list)
|
||||
s = stack_list[O]
|
||||
while(s.amount > s.max_amount)
|
||||
new s.type(loc,s.max_amount)
|
||||
s.use(s.max_amount)
|
||||
s.loc = loc
|
||||
s.layer = initial(s.layer)
|
||||
|
||||
/**********************Mining Equipment Locker**************************/
|
||||
|
||||
/obj/machinery/mineral/equipment_locker
|
||||
/obj/machinery/mineral/equipment_vendor
|
||||
name = "mining equipment vendor"
|
||||
desc = "An equipment vendor for miners, points collected at an ore redemption machine can be spent here."
|
||||
icon = 'icons/obj/machines/mining_machines.dmi'
|
||||
@@ -148,24 +267,24 @@
|
||||
anchored = 1.0
|
||||
var/obj/item/weapon/card/id/inserted_id
|
||||
var/list/prize_list = list(
|
||||
new /datum/data/mining_equipment("Stimpack MediPen", /obj/item/weapon/reagent_containers/hypospray/autoinjector/stimpack, 50),
|
||||
new /datum/data/mining_equipment("Teporone MediPen", /obj/item/weapon/reagent_containers/hypospray/autoinjector/teporone, 50),
|
||||
new /datum/data/mining_equipment("MediPen Bundle", /obj/item/weapon/storage/box/autoinjector/utility, 200),
|
||||
new /datum/data/mining_equipment("Whiskey", /obj/item/weapon/reagent_containers/food/drinks/bottle/whiskey, 100),
|
||||
new /datum/data/mining_equipment("Cigar", /obj/item/clothing/mask/cigarette/cigar/havana, 150),
|
||||
new /datum/data/mining_equipment("Soap", /obj/item/weapon/soap/nanotrasen, 200),
|
||||
new /datum/data/mining_equipment("Jaunter", /obj/item/device/wormhole_jaunter, 250),
|
||||
new /datum/data/mining_equipment("Advanced Scanner", /obj/item/device/t_scanner/adv_mining_scanner, 300),
|
||||
new /datum/data/mining_equipment("Laser Pointer", /obj/item/device/laser_pointer, 400),
|
||||
new /datum/data/mining_equipment("Alien Toy", /obj/item/clothing/mask/facehugger/toy, 450),
|
||||
new /datum/data/mining_equipment("Mining Drone", /mob/living/simple_animal/hostile/mining_drone/, 500),
|
||||
new /datum/data/mining_equipment("Resonator", /obj/item/weapon/resonator, 650),
|
||||
new /datum/data/mining_equipment("Kinetic Accelerator", /obj/item/weapon/gun/energy/kinetic_accelerator, 650),
|
||||
new /datum/data/mining_equipment("Sonic Jackhammer", /obj/item/weapon/pickaxe/jackhammer, 800),
|
||||
new /datum/data/mining_equipment("Lazarus Injector", /obj/item/weapon/lazarus_injector, 1000),
|
||||
new /datum/data/mining_equipment("Jetpack", /obj/item/weapon/tank/jetpack/carbondioxide/mining, 2000),
|
||||
new /datum/data/mining_equipment("Space Cash", /obj/item/weapon/spacecash/c1000, 5000),
|
||||
new /datum/data/mining_equipment("Point Card", /obj/item/weapon/card/mining_point_card, 500),
|
||||
new /datum/data/mining_equipment("Stimpack", /obj/item/weapon/reagent_containers/hypospray/autoinjector/stimpack, 50),
|
||||
new /datum/data/mining_equipment("Teporone MediPen", /obj/item/weapon/reagent_containers/hypospray/autoinjector/teporone, 50),
|
||||
new /datum/data/mining_equipment("MediPen Bundle", /obj/item/weapon/storage/box/autoinjector/utility, 200),
|
||||
new /datum/data/mining_equipment("Whiskey", /obj/item/weapon/reagent_containers/food/drinks/bottle/whiskey, 100),
|
||||
new /datum/data/mining_equipment("Cigar", /obj/item/clothing/mask/cigarette/cigar/havana, 150),
|
||||
new /datum/data/mining_equipment("Soap", /obj/item/weapon/soap/nanotrasen, 200),
|
||||
new /datum/data/mining_equipment("Jaunter", /obj/item/device/wormhole_jaunter, 250),
|
||||
new /datum/data/mining_equipment("Laser Pointer", /obj/item/device/laser_pointer, 300),
|
||||
new /datum/data/mining_equipment("Alien Toy", /obj/item/clothing/mask/facehugger/toy, 300),
|
||||
new /datum/data/mining_equipment("Advanced Scanner", /obj/item/device/t_scanner/adv_mining_scanner, 400),
|
||||
new /datum/data/mining_equipment("Mining Drone", /mob/living/simple_animal/hostile/mining_drone, 500),
|
||||
new /datum/data/mining_equipment("Kinetic Accelerator", /obj/item/weapon/gun/energy/kinetic_accelerator, 750),
|
||||
new /datum/data/mining_equipment("Resonator", /obj/item/weapon/resonator, 800),
|
||||
new /datum/data/mining_equipment("Lazarus Injector", /obj/item/weapon/lazarus_injector, 1000),
|
||||
new /datum/data/mining_equipment("Diamond Pickaxe", /obj/item/weapon/pickaxe/diamond, 1200),
|
||||
new /datum/data/mining_equipment("Jetpack", /obj/item/weapon/tank/jetpack/carbondioxide/mining, 1500),
|
||||
new /datum/data/mining_equipment("Space Cash", /obj/item/weapon/spacecash/c1000, 2000),
|
||||
new /datum/data/mining_equipment("Point Transfer Card", /obj/item/weapon/card/mining_point_card, 500),
|
||||
)
|
||||
|
||||
|
||||
@@ -179,12 +298,24 @@
|
||||
src.equipment_path = path
|
||||
src.cost = cost
|
||||
|
||||
/obj/machinery/mineral/equipment_locker/attack_hand(user as mob)
|
||||
/obj/machinery/mineral/equipment_vendor/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/mining_equipment_vendor(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/mineral/equipment_vendor/attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/mineral/equipment_locker/interact(mob/user)
|
||||
/obj/machinery/mineral/equipment_vendor/interact(mob/user)
|
||||
user.set_machine(src)
|
||||
|
||||
var/dat
|
||||
dat +="<div class='statusDisplay'>"
|
||||
if(istype(inserted_id))
|
||||
@@ -192,15 +323,16 @@
|
||||
else
|
||||
dat += "No ID inserted. <A href='?src=\ref[src];choice=insert'>Insert ID.</A><br>"
|
||||
dat += "</div>"
|
||||
dat += "<HR><b>Equipment point cost list:</b><BR><table border='0' width='200'>"
|
||||
dat += "<br><b>Equipment point cost list:</b><BR><table border='0' width='200'>"
|
||||
for(var/datum/data/mining_equipment/prize in prize_list)
|
||||
dat += "<tr><td>[prize.equipment_name]</td><td>[prize.cost]</td><td><A href='?src=\ref[src];purchase=\ref[prize]'>Purchase</A></td></tr>"
|
||||
dat += "</table>"
|
||||
|
||||
user << browse("[dat]", "window=mining_equipment_locker")
|
||||
var/datum/browser/popup = new(user, "miningvendor", "Mining Equipment Vendor", 400, 350)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/equipment_locker/Topic(href, href_list)
|
||||
/obj/machinery/mineral/equipment_vendor/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if(href_list["choice"])
|
||||
@@ -212,10 +344,11 @@
|
||||
else if(href_list["choice"] == "insert")
|
||||
var/obj/item/weapon/card/id/I = usr.get_active_hand()
|
||||
if(istype(I))
|
||||
usr.drop_item()
|
||||
if(!usr.drop_item())
|
||||
return
|
||||
I.loc = src
|
||||
inserted_id = I
|
||||
else usr << "\red No valid ID."
|
||||
else usr << "<span class='danger'>No valid ID.</span>"
|
||||
if(href_list["purchase"])
|
||||
if(istype(inserted_id))
|
||||
var/datum/data/mining_equipment/prize = locate(href_list["purchase"])
|
||||
@@ -228,38 +361,45 @@
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/equipment_locker/attackby(obj/item/I as obj, mob/user as mob, params)
|
||||
/obj/machinery/mineral/equipment_vendor/attackby(obj/item/I as obj, mob/user as mob, params)
|
||||
if(istype(I, /obj/item/weapon/mining_voucher))
|
||||
RedeemVoucher(I, user)
|
||||
return
|
||||
if(istype(I,/obj/item/weapon/card/id))
|
||||
var/obj/item/weapon/card/id/C = usr.get_active_hand()
|
||||
if(istype(C) && !istype(inserted_id))
|
||||
usr.drop_item()
|
||||
if(!usr.drop_item())
|
||||
return
|
||||
C.loc = src
|
||||
inserted_id = C
|
||||
interact(user)
|
||||
return
|
||||
if(default_deconstruction_screwdriver(user, "mining-open", "mining", I))
|
||||
updateUsrDialog()
|
||||
return
|
||||
if(panel_open)
|
||||
if(istype(I, /obj/item/weapon/crowbar))
|
||||
default_deconstruction_crowbar(I)
|
||||
return 1
|
||||
..()
|
||||
|
||||
/obj/machinery/mineral/equipment_locker/proc/RedeemVoucher(voucher, redeemer)
|
||||
var/selection = input(redeemer, "Pick your equipment", "Mining Voucher Redemption") in list("Mining Drill", "Kinetic Accelerator", "Mining Drone", "Advanced Scanner", "Cancel")
|
||||
if(!selection || !Adjacent(redeemer))
|
||||
/obj/machinery/mineral/equipment_vendor/proc/RedeemVoucher(obj/item/weapon/mining_voucher/voucher, mob/redeemer)
|
||||
var/selection = input(redeemer, "Pick your equipment", "Mining Voucher Redemption") as null|anything in list("Kinetic Accelerator", "Resonator", "Mining Drone", "Advanced Scanner")
|
||||
if(!selection || !Adjacent(redeemer) || voucher.loc != redeemer)
|
||||
return
|
||||
switch(selection)
|
||||
if("Mining Drill")
|
||||
new /obj/item/weapon/pickaxe/drill(src.loc)
|
||||
if("Kinetic Accelerator")
|
||||
new /obj/item/weapon/gun/energy/kinetic_accelerator(src.loc)
|
||||
if("Resonator")
|
||||
new /obj/item/weapon/resonator(src.loc)
|
||||
if("Mining Drone")
|
||||
new /mob/living/simple_animal/hostile/mining_drone(src.loc)
|
||||
new /obj/item/weapon/weldingtool/hugetank(src.loc)
|
||||
if("Advanced Scanner")
|
||||
new /obj/item/device/t_scanner/adv_mining_scanner(src.loc)
|
||||
if("Cancel")
|
||||
return
|
||||
del(voucher)
|
||||
qdel(voucher)
|
||||
|
||||
/obj/machinery/mineral/equipment_locker/ex_act(severity)
|
||||
/obj/machinery/mineral/equipment_vendor/ex_act(severity, target)
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
@@ -272,7 +412,7 @@
|
||||
|
||||
/obj/item/weapon/mining_voucher
|
||||
name = "mining voucher"
|
||||
desc = "A token to redeem a piece of equipment. Use it on a mining equipment locker."
|
||||
desc = "A token to redeem a piece of equipment. Use it on a mining equipment vendor."
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "mining_voucher"
|
||||
w_class = 1
|
||||
@@ -324,17 +464,17 @@
|
||||
var/list/L = list()
|
||||
for(var/obj/item/device/radio/beacon/B in world)
|
||||
var/turf/T = get_turf(B)
|
||||
if((T.z in config.station_levels))
|
||||
if(T.z == ZLEVEL_STATION)
|
||||
L += B
|
||||
if(!L.len)
|
||||
user << "<span class='notice'>The [src.name] failed to create a wormhole.</span>"
|
||||
return
|
||||
var/chosen_beacon = pick(L)
|
||||
var/obj/effect/portal/wormhole/jaunt_tunnel/J = new /obj/effect/portal/wormhole/jaunt_tunnel(get_turf(src), chosen_beacon, lifespan=100)
|
||||
var/obj/effect/portal/wormhole/jaunt_tunnel/J = new /obj/effect/portal/wormhole/jaunt_tunnel(get_turf(src), chosen_beacon)
|
||||
J.target = chosen_beacon
|
||||
try_move_adjacent(J)
|
||||
playsound(src,'sound/effects/sparks4.ogg',50,1)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/portal/wormhole/jaunt_tunnel
|
||||
name = "jaunt tunnel"
|
||||
@@ -346,19 +486,20 @@
|
||||
if(istype(M, /obj/effect))
|
||||
return
|
||||
if(istype(M, /atom/movable))
|
||||
do_teleport(M, target, 6)
|
||||
if(isliving(M))
|
||||
var/mob/living/L = M
|
||||
L.Weaken(3)
|
||||
if(ishuman(L))
|
||||
shake_camera(L, 20, 1)
|
||||
spawn(20)
|
||||
L.visible_message("<span class='danger'>[L.name] vomits from travelling through the [src.name]!</span>")
|
||||
L.nutrition -= 20
|
||||
L.adjustToxLoss(-3)
|
||||
var/turf/T = get_turf(L)
|
||||
T.add_vomit_floor(L)
|
||||
playsound(L, 'sound/effects/splat.ogg', 50, 1)
|
||||
if(do_teleport(M, target, 6))
|
||||
if(isliving(M))
|
||||
var/mob/living/L = M
|
||||
L.Weaken(3)
|
||||
if(ishuman(L))
|
||||
shake_camera(L, 20, 1)
|
||||
spawn(20)
|
||||
if(L)
|
||||
L.visible_message("<span class='danger'>[L.name] vomits from travelling through the [src.name]!</span>", "<span class='userdanger'>You throw up from travelling through the [src.name]!</span>")
|
||||
L.nutrition -= 20
|
||||
L.adjustToxLoss(-3)
|
||||
var/turf/T = get_turf(L)
|
||||
T.add_vomit_floor(L)
|
||||
playsound(L, 'sound/effects/splat.ogg', 50, 1)
|
||||
|
||||
/**********************Resonator**********************/
|
||||
|
||||
@@ -369,27 +510,35 @@
|
||||
item_state = "resonator"
|
||||
desc = "A handheld device that creates small fields of energy that resonate until they detonate, crushing rock. It can also be activated without a target to create a field at the user's location, to act as a delayed time trap. It's more effective in a vaccuum."
|
||||
w_class = 3
|
||||
force = 10
|
||||
force = 8
|
||||
throwforce = 10
|
||||
var/cooldown = 0
|
||||
var/fieldsactive = 0
|
||||
var/burst_time = 50
|
||||
var/fieldlimit = 3
|
||||
|
||||
/obj/item/weapon/resonator/proc/CreateResonance(var/target, var/creator)
|
||||
if(cooldown <= 0)
|
||||
var/turf/T = get_turf(target)
|
||||
if(locate(/obj/effect/resonance) in T)
|
||||
return
|
||||
if(fieldsactive < fieldlimit)
|
||||
playsound(src,'sound/weapons/resonator_fire.ogg',50,1)
|
||||
var/obj/effect/resonance/R = new /obj/effect/resonance(get_turf(target))
|
||||
R.creator = creator
|
||||
cooldown = 1
|
||||
spawn(20)
|
||||
cooldown = 0
|
||||
new /obj/effect/resonance(T, creator, burst_time)
|
||||
fieldsactive++
|
||||
spawn(burst_time)
|
||||
fieldsactive--
|
||||
|
||||
/obj/item/weapon/resonator/attack_self(mob/user as mob)
|
||||
CreateResonance(src, user)
|
||||
..()
|
||||
if(burst_time == 50)
|
||||
burst_time = 30
|
||||
user << "<span class='info'>You set the resonator's fields to detonate after 3 seconds.</span>"
|
||||
else
|
||||
burst_time = 50
|
||||
user << "<span class='info'>You set the resonator's fields to detonate after 5 seconds.</span>"
|
||||
|
||||
/obj/item/weapon/resonator/afterattack(atom/target, mob/user, proximity_flag)
|
||||
if(target in user.contents)
|
||||
return
|
||||
if(proximity_flag)
|
||||
if(!check_allowed_items(target, 1)) return
|
||||
CreateResonance(target, user)
|
||||
|
||||
/obj/effect/resonance
|
||||
@@ -400,36 +549,35 @@
|
||||
layer = 4.1
|
||||
mouse_opacity = 0
|
||||
var/resonance_damage = 20
|
||||
var/creator = null
|
||||
|
||||
/obj/effect/resonance/New()
|
||||
/obj/effect/resonance/New(loc, var/creator = null, var/timetoburst)
|
||||
var/turf/proj_turf = get_turf(src)
|
||||
if(!istype(proj_turf))
|
||||
return
|
||||
if(istype(proj_turf, /turf/simulated/mineral))
|
||||
var/turf/simulated/mineral/M = proj_turf
|
||||
playsound(src,'sound/weapons/resonator_blast.ogg',50,1)
|
||||
M.GetDrilled()
|
||||
spawn(5)
|
||||
del(src)
|
||||
spawn(timetoburst)
|
||||
playsound(src,'sound/weapons/resonator_blast.ogg',50,1)
|
||||
M.gets_drilled(creator)
|
||||
qdel(src)
|
||||
else
|
||||
var/datum/gas_mixture/environment = proj_turf.return_air()
|
||||
var/pressure = environment.return_pressure()
|
||||
if(pressure < 50)
|
||||
name = "strong resonance field"
|
||||
resonance_damage = 45
|
||||
spawn(50)
|
||||
resonance_damage = 50
|
||||
spawn(timetoburst)
|
||||
playsound(src,'sound/weapons/resonator_blast.ogg',50,1)
|
||||
if(creator)
|
||||
for(var/mob/living/L in src.loc)
|
||||
add_logs(L, creator, "used a resonator field on", object="resonator")
|
||||
add_logs(creator, L, "used a resonator field on", object="resonator")
|
||||
L << "<span class='danger'>The [src.name] ruptured with you in it!</span>"
|
||||
L.adjustBruteLoss(resonance_damage)
|
||||
else
|
||||
for(var/mob/living/L in src.loc)
|
||||
L << "<span class='danger'>The [src.name] ruptured with you in it!</span>"
|
||||
L.adjustBruteLoss(resonance_damage)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/**********************Facehugger toy**********************/
|
||||
|
||||
@@ -438,6 +586,7 @@
|
||||
throwforce = 0
|
||||
real = 0
|
||||
sterile = 1
|
||||
tint = 3 //Makes it feel more authentic when it latches on
|
||||
|
||||
/obj/item/clothing/mask/facehugger/toy/Die()
|
||||
return
|
||||
@@ -445,7 +594,7 @@
|
||||
|
||||
/**********************Mining drone**********************/
|
||||
|
||||
/mob/living/simple_animal/hostile/mining_drone/
|
||||
/mob/living/simple_animal/hostile/mining_drone
|
||||
name = "nanotrasen minebot"
|
||||
desc = "The instructions printed on the side read: This is a small robot used to support miners, can be set to search and collect loose ore, or to help fend off wildlife. A mining scanner can instruct it to drop loose ore. Field repairs can be done with a welder."
|
||||
icon = 'icons/obj/aibots.dmi'
|
||||
@@ -482,7 +631,10 @@
|
||||
ranged_cooldown_cap = 3
|
||||
projectiletype = /obj/item/projectile/kinetic
|
||||
projectilesound = 'sound/weapons/Gunshot4.ogg'
|
||||
wanted_objects = list(/obj/item/weapon/ore)
|
||||
speak_emote = list("states")
|
||||
wanted_objects = list(/obj/item/weapon/ore/diamond, /obj/item/weapon/ore/gold, /obj/item/weapon/ore/silver,
|
||||
/obj/item/weapon/ore/plasma, /obj/item/weapon/ore/uranium, /obj/item/weapon/ore/iron,
|
||||
/obj/item/weapon/ore/bananium)
|
||||
|
||||
/mob/living/simple_animal/hostile/mining_drone/attackby(obj/item/I as obj, mob/user as mob, params)
|
||||
if(istype(I, /obj/item/weapon/weldingtool))
|
||||
@@ -503,12 +655,12 @@
|
||||
return
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/hostile/mining_drone/Die()
|
||||
/mob/living/simple_animal/hostile/mining_drone/death()
|
||||
..()
|
||||
visible_message("<span class='danger'>[src] is destroyed!</span>")
|
||||
new /obj/effect/decal/remains/robot(src.loc)
|
||||
new /obj/effect/decal/cleanable/blood/gibs/robot(src.loc)
|
||||
DropOre()
|
||||
del src
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/hostile/mining_drone/New()
|
||||
@@ -633,6 +785,7 @@
|
||||
user << "<span class='info'>The display on [src] seems to be flickering.</span>"
|
||||
|
||||
/**********************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"
|
||||
@@ -650,23 +803,9 @@
|
||||
cooldown = 1
|
||||
spawn(40)
|
||||
cooldown = 0
|
||||
var/client/C = user.client
|
||||
var/list/L = list()
|
||||
var/turf/simulated/mineral/M
|
||||
for(M in range(7, user))
|
||||
if(M.scan_state)
|
||||
L += M
|
||||
if(!L.len)
|
||||
user << "<span class='info'>[src] reports that nothing was detected nearby.</span>"
|
||||
return
|
||||
else
|
||||
for(M in L)
|
||||
var/turf/T = get_turf(M)
|
||||
var/image/I = image('icons/turf/walls.dmi', loc = T, icon_state = M.scan_state, layer = 18)
|
||||
C.images += I
|
||||
spawn(30)
|
||||
if(C)
|
||||
C.images -= I
|
||||
var/list/mobs = list()
|
||||
mobs |= user
|
||||
mineral_scan_pulse(mobs, get_turf(user))
|
||||
|
||||
|
||||
//Debug item to identify all ore spread quickly
|
||||
@@ -676,7 +815,7 @@
|
||||
for(var/turf/simulated/mineral/M in world)
|
||||
if(M.scan_state)
|
||||
M.icon_state = M.scan_state
|
||||
del(src)
|
||||
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."
|
||||
@@ -688,31 +827,36 @@
|
||||
slot_flags = SLOT_BELT
|
||||
var/cooldown = 0
|
||||
|
||||
/obj/item/device/t_scanner/adv_mining_scanner/cyborg
|
||||
flags = CONDUCT | NODROP
|
||||
|
||||
/obj/item/device/t_scanner/adv_mining_scanner/scan()
|
||||
if(!cooldown)
|
||||
cooldown = 1
|
||||
spawn(80)
|
||||
spawn(35)
|
||||
cooldown = 0
|
||||
var/turf/t = get_turf(src)
|
||||
var/list/mobs = recursive_mob_check(t, 1,0,0)
|
||||
var/list/mobs = recursive_mob_check(t, client_check = 1, sight_check = 0, include_radio = 0)
|
||||
if(!mobs.len)
|
||||
return
|
||||
var/list/L = list()
|
||||
var/turf/simulated/mineral/M
|
||||
for(M in range(7, t))
|
||||
if(M.scan_state)
|
||||
L += M
|
||||
if(L.len)
|
||||
for(var/mob/user in mobs)
|
||||
if(user.client)
|
||||
var/client/C = user.client
|
||||
for(M in L)
|
||||
var/turf/T = get_turf(M)
|
||||
var/image/I = image('icons/turf/walls.dmi', loc = T, icon_state = M.scan_state, layer = 18)
|
||||
C.images += I
|
||||
spawn(30)
|
||||
if(C)
|
||||
C.images -= I
|
||||
mineral_scan_pulse(mobs, t)
|
||||
|
||||
/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))
|
||||
if(M.scan_state)
|
||||
minerals += M
|
||||
if(minerals.len)
|
||||
for(var/mob/user in mobs)
|
||||
if(user.client)
|
||||
var/client/C = user.client
|
||||
for(var/turf/simulated/mineral/M in minerals)
|
||||
var/turf/F = get_turf(M)
|
||||
var/image/I = image('icons/turf/mining.dmi', loc = F, icon_state = M.scan_state, layer = 18)
|
||||
C.images += I
|
||||
spawn(30)
|
||||
if(C)
|
||||
C.images -= I
|
||||
|
||||
/**********************Xeno Warning Sign**********************/
|
||||
/obj/structure/sign/xeno_warning_mining
|
||||
|
||||
@@ -1,2 +1,6 @@
|
||||
/turf/simulated/mineral/random/labormineral
|
||||
mineralSpawnChanceList = list("Uranium" = 1, "Iron" = 100, "Diamond" = 1, "Gold" = 1, "Silver" = 1, "Plasma" = 1/*, "Adamantine" =5, "Cave" = 1 */) //Don't suffocate the prisoners with caves
|
||||
mineralSpawnChanceList = list("Uranium" = 1, "Iron" = 100, "Diamond" = 1, "Gold" = 1, "Silver" = 1, "Plasma" = 1)
|
||||
|
||||
/turf/simulated/mineral/random/labormineral/New()
|
||||
icon_state = "rock"
|
||||
..()
|
||||
@@ -29,7 +29,7 @@
|
||||
if(t == src.door_tag)
|
||||
src.release_door = d
|
||||
if (machine && (release_door || !use_release_door))
|
||||
machine.console = src
|
||||
machine.CONSOLE = src
|
||||
else
|
||||
qdel(src)
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
if(istype(I, /obj/item/weapon/card/id))
|
||||
return attack_hand(user)
|
||||
..()
|
||||
|
||||
|
||||
/obj/machinery/mineral/labor_claim_console/emag_act(user as mob)
|
||||
emag(user)
|
||||
|
||||
@@ -109,9 +109,9 @@
|
||||
usr << "<span class='notice'>Shuttle received message and will be sent shortly.</span>"
|
||||
shuttle.launch()
|
||||
else
|
||||
usr << "\blue Shuttle is already moving."
|
||||
usr << "<span class='notice'>Shuttle is already moving.</span>"
|
||||
else
|
||||
usr << "\blue Shuttle is already on-station."
|
||||
usr << "<span class='notice'>Shuttle is already on-station.</span>"
|
||||
|
||||
if(href_list["choice"] == "release")
|
||||
if(alone_in_area(get_area(loc), usr))
|
||||
@@ -132,7 +132,7 @@
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/laborstacker
|
||||
var/points = 0 //The unclaimed value of ore stacked. Value for each ore loosely relative to its rarity.
|
||||
var/list/ore_values = list(("glass" = 1), ("metal" = 2), ("iron" = 3), ("solid plasma" = 20), ("plasteel" = 23), ("reinforced glass" = 4), ("gold" = 20), ("silver" = 20), ("uranium" = 20), ("diamond" = 25), ("bananium" = 50))
|
||||
var/list/ore_values = list(("glass" = 1), ("metal" = 2), ("solid plasma" = 20), ("plasteel" = 23), ("reinforced glass" = 4), ("gold" = 20), ("silver" = 20), ("uranium" = 20), ("diamond" = 25), ("bananium" = 50))
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/laborstacker/proc/get_ore_values()
|
||||
var/dat = "<table border='0' width='200'>"
|
||||
@@ -142,31 +142,13 @@
|
||||
dat += "</table>"
|
||||
return dat
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/laborstacker/process()
|
||||
if (src.output && src.input)
|
||||
var/turf/T = get_turf(input)
|
||||
for(var/obj/item/O in T.contents)
|
||||
if(!O) return
|
||||
if(istype(O,/obj/item/stack))
|
||||
var/obj/item/stack/S = O
|
||||
if(S.name in ore_values)
|
||||
points += ore_values[S.name] * S.amount
|
||||
S.loc = null
|
||||
else
|
||||
S.loc = output.loc
|
||||
else
|
||||
O.loc = output.loc
|
||||
|
||||
//Output amounts that are past stack_amt.
|
||||
for(var/sheet in stack_storage)
|
||||
if(stack_storage[sheet] >= stack_amt)
|
||||
var/stacktype = stack_paths[sheet]
|
||||
var/obj/item/stack/sheet/S = new stacktype (get_turf(output))
|
||||
S.amount = stack_amt
|
||||
stack_storage[sheet] -= stack_amt
|
||||
|
||||
console.updateUsrDialog()
|
||||
return
|
||||
/obj/machinery/mineral/stacking_machine/laborstacker/process_sheet(obj/item/stack/sheet/inp)
|
||||
if(istype(inp))
|
||||
var/n = inp.name
|
||||
var/a = inp.amount
|
||||
if(n in ore_values)
|
||||
points += ore_values[n] * a
|
||||
..()
|
||||
|
||||
|
||||
/**********************Point Lookup Console**************************/
|
||||
|
||||
@@ -16,4 +16,14 @@
|
||||
density = 0
|
||||
anchored = 1.0
|
||||
New()
|
||||
icon_state = "blank"
|
||||
icon_state = "blank"
|
||||
|
||||
/obj/machinery/mineral
|
||||
var/input_dir = NORTH
|
||||
var/output_dir = SOUTH
|
||||
|
||||
/obj/machinery/mineral/proc/unload_mineral(var/atom/movable/S)
|
||||
S.loc = loc
|
||||
var/turf/T = get_step(src,output_dir)
|
||||
if(T)
|
||||
S.loc = T
|
||||
@@ -6,92 +6,165 @@
|
||||
icon_state = "console"
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
var/obj/machinery/mineral/processing_unit/machine = null
|
||||
var/machinedir = EAST
|
||||
var/show_all_ores = 0
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/New()
|
||||
..()
|
||||
spawn(7)
|
||||
src.machine = locate(/obj/machinery/mineral/processing_unit, get_step(src, machinedir))
|
||||
if (machine)
|
||||
machine.console = src
|
||||
machine.CONSOLE = src
|
||||
else
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
interact(user)
|
||||
/obj/machinery/mineral/processing_unit_console/attack_hand(user as mob)
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/interact(mob/user)
|
||||
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(!allowed(user))
|
||||
user << "\red Access denied."
|
||||
return
|
||||
|
||||
user.set_machine(src)
|
||||
|
||||
var/dat = "<h1>Ore processor console</h1>"
|
||||
|
||||
dat += "<hr><table>"
|
||||
|
||||
for(var/ore in machine.ores_processing)
|
||||
|
||||
if(!machine.ores_stored[ore] && !show_all_ores) continue
|
||||
|
||||
dat += "<tr><td width = 40><b>[capitalize(ore)]</b></td><td width = 30>[machine.ores_stored[ore]]</td><td width = 100><font color='"
|
||||
if(machine.ores_processing[ore])
|
||||
switch(machine.ores_processing[ore])
|
||||
if(0)
|
||||
dat += "red'>not processing"
|
||||
if(1)
|
||||
dat += "orange'>smelting"
|
||||
if(2)
|
||||
dat += "blue'>compressing"
|
||||
if(3)
|
||||
dat += "gray'>alloying"
|
||||
var/dat = "<b>Smelter control console</b><br><br>"
|
||||
//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_adamantine)
|
||||
if(machine.ore_iron)
|
||||
if (machine.selected_iron==1)
|
||||
dat += text("<A href='?src=\ref[src];sel_iron=no'><font color='green'>Smelting</font></A> ")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];sel_iron=yes'><font color='red'>Not smelting</font></A> ")
|
||||
dat += text("Iron: [machine.ore_iron]<br>")
|
||||
else
|
||||
dat += "red'>not processing"
|
||||
dat += "</font>.</td><td width = 30><a href='?src=\ref[src];toggle_smelting=[ore]'>\[change\]</a></td></tr>"
|
||||
machine.selected_iron = 0
|
||||
|
||||
dat += "</table><hr>"
|
||||
dat += "Currently displaying [show_all_ores ? "all ore types" : "only available ore types"]. <A href='?src=\ref[src];toggle_ores=1'>\[[show_all_ores ? "show less" : "show more"]\]</a></br>"
|
||||
dat += "The ore processor is currently <A href='?src=\ref[src];toggle_power=1'>[(machine.active ? "<font color='green'>processing</font>" : "<font color='red'>disabled</font>")]</a>."
|
||||
user << browse(dat, "window=processor_console;size=400x500")
|
||||
onclose(user, "computer")
|
||||
return
|
||||
//sand - glass
|
||||
if(machine.ore_glass)
|
||||
if (machine.selected_glass==1)
|
||||
dat += text("<A href='?src=\ref[src];sel_glass=no'><font color='green'>Smelting</font></A> ")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];sel_glass=yes'><font color='red'>Not smelting</font></A> ")
|
||||
dat += text("Sand: [machine.ore_glass]<br>")
|
||||
else
|
||||
machine.selected_glass = 0
|
||||
|
||||
//plasma
|
||||
if(machine.ore_plasma)
|
||||
if (machine.selected_plasma==1)
|
||||
dat += text("<A href='?src=\ref[src];sel_plasma=no'><font color='green'>Smelting</font></A> ")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];sel_plasma=yes'><font color='red'>Not smelting</font></A> ")
|
||||
dat += text("Plasma: [machine.ore_plasma]<br>")
|
||||
else
|
||||
machine.selected_plasma = 0
|
||||
|
||||
//uranium
|
||||
if(machine.ore_uranium)
|
||||
if (machine.selected_uranium==1)
|
||||
dat += text("<A href='?src=\ref[src];sel_uranium=no'><font color='green'>Smelting</font></A> ")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];sel_uranium=yes'><font color='red'>Not smelting</font></A> ")
|
||||
dat += text("Uranium: [machine.ore_uranium]<br>")
|
||||
else
|
||||
machine.selected_uranium = 0
|
||||
|
||||
//gold
|
||||
if(machine.ore_gold)
|
||||
if (machine.selected_gold==1)
|
||||
dat += text("<A href='?src=\ref[src];sel_gold=no'><font color='green'>Smelting</font></A> ")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];sel_gold=yes'><font color='red'>Not smelting</font></A> ")
|
||||
dat += text("Gold: [machine.ore_gold]<br>")
|
||||
else
|
||||
machine.selected_gold = 0
|
||||
|
||||
//silver
|
||||
if(machine.ore_silver)
|
||||
if (machine.selected_silver==1)
|
||||
dat += text("<A href='?src=\ref[src];sel_silver=no'><font color='green'>Smelting</font></A> ")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];sel_silver=yes'><font color='red'>Not smelting</font></A> ")
|
||||
dat += text("Silver: [machine.ore_silver]<br>")
|
||||
else
|
||||
machine.selected_silver = 0
|
||||
|
||||
//diamond
|
||||
if(machine.ore_diamond)
|
||||
if (machine.selected_diamond==1)
|
||||
dat += text("<A href='?src=\ref[src];sel_diamond=no'><font color='green'>Smelting</font></A> ")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];sel_diamond=yes'><font color='red'>Not smelting</font></A> ")
|
||||
dat += text("Diamond: [machine.ore_diamond]<br>")
|
||||
else
|
||||
machine.selected_diamond = 0
|
||||
|
||||
//bananium
|
||||
if(machine.ore_clown)
|
||||
if (machine.selected_clown==1)
|
||||
dat += text("<A href='?src=\ref[src];sel_clown=no'><font color='green'>Smelting</font></A> ")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];sel_clown=yes'><font color='red'>Not smelting</font></A> ")
|
||||
dat += text("Bananium: [machine.ore_clown]<br>")
|
||||
else
|
||||
machine.selected_clown = 0
|
||||
|
||||
|
||||
//On or off
|
||||
dat += text("Machine is currently ")
|
||||
if (machine.on==1)
|
||||
dat += text("<A href='?src=\ref[src];set_on=off'>On</A> ")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];set_on=on'>Off</A> ")
|
||||
else
|
||||
dat+="---No Materials Loaded---"
|
||||
|
||||
|
||||
user << browse("[dat]", "window=console_processing_unit")
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
if(href_list["toggle_smelting"])
|
||||
|
||||
var/choice = input("What setting do you wish to use for processing [href_list["toggle_smelting"]]?") as null|anything in list("Smelting","Compressing","Alloying","Nothing")
|
||||
if(!choice) return
|
||||
|
||||
switch(choice)
|
||||
if("Nothing") choice = 0
|
||||
if("Smelting") choice = 1
|
||||
if("Compressing") choice = 2
|
||||
if("Alloying") choice = 3
|
||||
|
||||
machine.ores_processing[href_list["toggle_smelting"]] = choice
|
||||
|
||||
if(href_list["toggle_power"])
|
||||
|
||||
machine.active = !machine.active
|
||||
|
||||
if(href_list["toggle_ores"])
|
||||
|
||||
show_all_ores = !show_all_ores
|
||||
|
||||
if(href_list["sel_iron"])
|
||||
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")
|
||||
machine.selected_glass = 1
|
||||
else
|
||||
machine.selected_glass = 0
|
||||
if(href_list["sel_plasma"])
|
||||
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")
|
||||
machine.selected_uranium = 1
|
||||
else
|
||||
machine.selected_uranium = 0
|
||||
if(href_list["sel_gold"])
|
||||
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")
|
||||
machine.selected_silver = 1
|
||||
else
|
||||
machine.selected_silver = 0
|
||||
if(href_list["sel_diamond"])
|
||||
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")
|
||||
machine.selected_clown = 1
|
||||
else
|
||||
machine.selected_clown = 0
|
||||
if(href_list["set_on"])
|
||||
if (href_list["set_on"] == "on")
|
||||
machine.on = 1
|
||||
else
|
||||
machine.on = 0
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
@@ -99,136 +172,223 @@
|
||||
|
||||
|
||||
/obj/machinery/mineral/processing_unit
|
||||
name = "material processor" //This isn't actually a goddamn furnace, we're in space and it's processing platinum and flammable plasma...
|
||||
name = "furnace"
|
||||
icon = 'icons/obj/machines/mining_machines.dmi'
|
||||
icon_state = "furnace"
|
||||
density = 1
|
||||
anchored = 1
|
||||
light_range = 3
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
var/obj/machinery/mineral/console = null
|
||||
var/sheets_per_tick = 10
|
||||
var/list/ores_processing[0]
|
||||
var/list/ores_stored[0]
|
||||
var/list/ore_data[0]
|
||||
var/list/alloy_data[0]
|
||||
var/active = 0
|
||||
|
||||
/obj/machinery/mineral/processing_unit/New()
|
||||
|
||||
..()
|
||||
|
||||
//TODO: Ore and alloy global storage datum.
|
||||
for(var/alloytype in typesof(/datum/alloy)-/datum/alloy)
|
||||
alloy_data += new alloytype()
|
||||
|
||||
for(var/oretype in typesof(/datum/ore)-/datum/ore)
|
||||
var/datum/ore/OD = new oretype()
|
||||
ore_data[OD.oretag] = OD
|
||||
ores_processing[OD.oretag] = 0
|
||||
ores_stored[OD.oretag] = 0
|
||||
|
||||
//Locate our output and input machinery.
|
||||
spawn(5)
|
||||
for (var/dir in cardinal)
|
||||
src.input = locate(/obj/machinery/mineral/input, get_step(src, dir))
|
||||
if(src.input) break
|
||||
for (var/dir in cardinal)
|
||||
src.output = locate(/obj/machinery/mineral/output, get_step(src, dir))
|
||||
if(src.output) break
|
||||
return
|
||||
return
|
||||
var/obj/machinery/mineral/CONSOLE = null
|
||||
var/ore_gold = 0;
|
||||
var/ore_silver = 0;
|
||||
var/ore_diamond = 0;
|
||||
var/ore_glass = 0;
|
||||
var/ore_plasma = 0;
|
||||
var/ore_uranium = 0;
|
||||
var/ore_iron = 0;
|
||||
var/ore_clown = 0;
|
||||
var/ore_adamantine = 0;
|
||||
var/selected_gold = 0
|
||||
var/selected_silver = 0
|
||||
var/selected_diamond = 0
|
||||
var/selected_glass = 0
|
||||
var/selected_plasma = 0
|
||||
var/selected_uranium = 0
|
||||
var/selected_iron = 0
|
||||
var/selected_clown = 0
|
||||
var/on = 0 //0 = off, 1 =... oh you know!
|
||||
|
||||
/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)
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
if (ore_clown > 0)
|
||||
ore_clown--;
|
||||
generate_mineral(/obj/item/stack/sheet/mineral/bananium)
|
||||
else
|
||||
on = 0
|
||||
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)
|
||||
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)
|
||||
if (ore_silver >= 1 && ore_plasma >= 3)
|
||||
ore_silver -= 1
|
||||
ore_plasma -= 3
|
||||
generate_mineral(/obj/item/stack/sheet/mineral/mythril)
|
||||
else
|
||||
on = 0
|
||||
continue*/
|
||||
|
||||
if (!src.output || !src.input) return
|
||||
|
||||
var/list/tick_alloys = list()
|
||||
//if a non valid combination is selected
|
||||
|
||||
//Grab some more ore to process this tick.
|
||||
for(var/i = 0,i<sheets_per_tick,i++)
|
||||
var/obj/item/weapon/ore/O = locate() in input.loc
|
||||
if(!O) break
|
||||
if(!isnull(ores_stored[O.oretag])) ores_stored[O.oretag]++
|
||||
O.loc = null
|
||||
var/b = 1 //this part checks if all required ores are available
|
||||
|
||||
if(!active)
|
||||
return
|
||||
if (!(selected_gold || selected_silver ||selected_diamond || selected_uranium | selected_plasma || selected_iron || selected_iron))
|
||||
b = 0
|
||||
|
||||
//Process our stored ores and spit out sheets.
|
||||
var/sheets = 0
|
||||
for(var/metal in ores_stored)
|
||||
if (selected_gold == 1)
|
||||
if (ore_gold <= 0)
|
||||
b = 0
|
||||
if (selected_silver == 1)
|
||||
if (ore_silver <= 0)
|
||||
b = 0
|
||||
if (selected_diamond == 1)
|
||||
if (ore_diamond <= 0)
|
||||
b = 0
|
||||
if (selected_uranium == 1)
|
||||
if (ore_uranium <= 0)
|
||||
b = 0
|
||||
if (selected_plasma == 1)
|
||||
if (ore_plasma <= 0)
|
||||
b = 0
|
||||
if (selected_iron == 1)
|
||||
if (ore_iron <= 0)
|
||||
b = 0
|
||||
if (selected_glass == 1)
|
||||
if (ore_glass <= 0)
|
||||
b = 0
|
||||
if (selected_clown == 1)
|
||||
if (ore_clown <= 0)
|
||||
b = 0
|
||||
|
||||
if(sheets >= sheets_per_tick) break
|
||||
|
||||
if(ores_stored[metal] > 0 && ores_processing[metal] != 0)
|
||||
|
||||
var/datum/ore/O = ore_data[metal]
|
||||
|
||||
if(!O) continue
|
||||
|
||||
if(ores_processing[metal] == 3 && O.alloy) //Alloying.
|
||||
|
||||
for(var/datum/alloy/A in alloy_data)
|
||||
|
||||
if(A.metaltag in tick_alloys)
|
||||
continue
|
||||
|
||||
tick_alloys += A.metaltag
|
||||
var/enough_metal
|
||||
|
||||
if(!isnull(A.requires[metal]) && ores_stored[metal] >= A.requires[metal]) //We have enough of our first metal, we're off to a good start.
|
||||
|
||||
enough_metal = 1
|
||||
|
||||
for(var/needs_metal in A.requires)
|
||||
//Check if we're alloying the needed metal and have it stored.
|
||||
if(ores_processing[needs_metal] != 3 || ores_stored[needs_metal] < A.requires[needs_metal])
|
||||
enough_metal = 0
|
||||
break
|
||||
|
||||
if(!enough_metal)
|
||||
continue
|
||||
else
|
||||
var/total
|
||||
for(var/needs_metal in A.requires)
|
||||
ores_stored[needs_metal] -= A.requires[needs_metal]
|
||||
total += A.requires[needs_metal]
|
||||
total = max(1,round(total*A.product_mod)) //Always get at least one sheet.
|
||||
sheets += total-1
|
||||
|
||||
for(var/i=0,i<total,i++)
|
||||
new A.product(output.loc)
|
||||
|
||||
else if(ores_processing[metal] == 2 && O.compresses_to) //Compressing.
|
||||
|
||||
var/can_make = Clamp(ores_stored[metal],0,sheets_per_tick-sheets)
|
||||
if(can_make%2>0) can_make--
|
||||
|
||||
if(!can_make || ores_stored[metal] < 1)
|
||||
continue
|
||||
|
||||
for(var/i=0,i<can_make,i+=2)
|
||||
ores_stored[metal]-=2
|
||||
sheets+=2
|
||||
new O.compresses_to(output.loc)
|
||||
|
||||
else if(ores_processing[metal] == 1 && O.smelts_to) //Smelting.
|
||||
|
||||
var/can_make = Clamp(ores_stored[metal],0,sheets_per_tick-sheets)
|
||||
if(!can_make || ores_stored[metal] < 1)
|
||||
continue
|
||||
|
||||
for(var/i=0,i<can_make,i++)
|
||||
ores_stored[metal]--
|
||||
sheets++
|
||||
new O.smelts_to(output.loc)
|
||||
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)
|
||||
ore_silver--
|
||||
if (selected_diamond == 1)
|
||||
ore_diamond--
|
||||
if (selected_uranium == 1)
|
||||
ore_uranium--
|
||||
if (selected_plasma == 1)
|
||||
ore_plasma--
|
||||
if (selected_iron == 1)
|
||||
ore_iron--
|
||||
if (selected_clown == 1)
|
||||
ore_clown--
|
||||
generate_mineral(/obj/item/weapon/ore/slag)
|
||||
on = 0
|
||||
else
|
||||
ores_stored[metal]--
|
||||
sheets++
|
||||
new /obj/item/weapon/ore/slag(output.loc)
|
||||
on = 0
|
||||
break
|
||||
break
|
||||
else
|
||||
continue
|
||||
break
|
||||
var/turf/T = get_step(src,input_dir)
|
||||
if(T)
|
||||
var/n = 0
|
||||
for(var/obj/item/O in T)
|
||||
n++
|
||||
if(n>10)
|
||||
break
|
||||
if (istype(O,/obj/item/weapon/ore/iron))
|
||||
ore_iron++;
|
||||
O.loc = null
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/glass))
|
||||
ore_glass++;
|
||||
O.loc = null
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/diamond))
|
||||
ore_diamond++;
|
||||
O.loc = null
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/plasma))
|
||||
ore_plasma++
|
||||
O.loc = null
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/gold))
|
||||
ore_gold++
|
||||
O.loc = null
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/silver))
|
||||
ore_silver++
|
||||
O.loc = null
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/uranium))
|
||||
ore_uranium++
|
||||
O.loc = null
|
||||
continue
|
||||
if (istype(O,/obj/item/weapon/ore/bananium))
|
||||
ore_clown++
|
||||
O.loc = null
|
||||
continue
|
||||
unload_mineral(O)
|
||||
|
||||
console.updateUsrDialog()
|
||||
/obj/machinery/mineral/processing_unit/proc/generate_mineral(var/P)
|
||||
var/O = new P(src)
|
||||
unload_mineral(O)
|
||||
@@ -4,62 +4,53 @@
|
||||
name = "stacking machine console"
|
||||
icon = 'icons/obj/machines/mining_machines.dmi'
|
||||
icon_state = "console"
|
||||
density = 1
|
||||
density = 0
|
||||
anchored = 1
|
||||
var/obj/machinery/mineral/stacking_machine/machine = null
|
||||
var/machinedir = SOUTHEAST
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console/New()
|
||||
|
||||
..()
|
||||
|
||||
spawn(7)
|
||||
src.machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir))
|
||||
if (machine)
|
||||
machine.console = src
|
||||
machine.CONSOLE = src
|
||||
else
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console/interact(mob/user)
|
||||
user.set_machine(src)
|
||||
/obj/machinery/mineral/stacking_unit_console/attack_hand(user as mob)
|
||||
|
||||
var/obj/item/stack/sheet/s
|
||||
var/dat
|
||||
|
||||
dat += text("<h1>Stacking unit console</h1><hr><table>")
|
||||
dat += text("<b>Stacking unit console</b><br><br>")
|
||||
|
||||
for(var/stacktype in machine.stack_storage)
|
||||
if(machine.stack_storage[stacktype] > 0)
|
||||
dat += "<tr><td width = 150><b>[capitalize(stacktype)]:</b></td><td width = 30>[machine.stack_storage[stacktype]]</td><td width = 50><A href='?src=\ref[src];release_stack=[stacktype]'>\[release\]</a></td></tr>"
|
||||
dat += "</table><hr>"
|
||||
dat += text("<br>Stacking: [machine.stack_amt] <A href='?src=\ref[src];change_stack=1'>\[change\]</a><br><br>")
|
||||
for(var/O in machine.stack_list)
|
||||
s = machine.stack_list[O]
|
||||
if(s.amount > 0)
|
||||
dat += text("[capitalize(s.name)]: [s.amount] <A href='?src=\ref[src];release=[s.type]'>Release</A><br>")
|
||||
|
||||
dat += text("<br>Stacking: [machine.stack_amt]<br><br>")
|
||||
|
||||
user << browse("[dat]", "window=console_stacking_machine")
|
||||
onclose(user, "console_stacking_machine")
|
||||
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/mineral/stacking_unit_console/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["change_stack"])
|
||||
var/choice = input("What would you like to set the stack amount to?") as null|anything in list(1,5,10,20,50)
|
||||
if(!choice) return
|
||||
machine.stack_amt = choice
|
||||
|
||||
if(href_list["release_stack"])
|
||||
if(machine.stack_storage[href_list["release_stack"]] > 0)
|
||||
var/stacktype = machine.stack_paths[href_list["release_stack"]]
|
||||
var/obj/item/stack/sheet/S = new stacktype (get_turf(machine.output))
|
||||
S.amount = machine.stack_storage[href_list["release_stack"]]
|
||||
machine.stack_storage[href_list["release_stack"]] = 0
|
||||
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
if(href_list["release"])
|
||||
if(!(text2path(href_list["release"]) in machine.stack_list)) return //someone tried to spawn materials by spoofing hrefs
|
||||
var/obj/item/stack/sheet/inp = machine.stack_list[text2path(href_list["release"])]
|
||||
var/obj/item/stack/sheet/out = new inp.type()
|
||||
out.amount = inp.amount
|
||||
inp.amount = 0
|
||||
machine.unload_mineral(out)
|
||||
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/**********************Mineral stacking unit**************************/
|
||||
@@ -71,61 +62,31 @@
|
||||
icon_state = "stacker"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/obj/machinery/mineral/stacking_unit_console/console
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
var/list/stack_storage[0]
|
||||
var/list/stack_paths[0]
|
||||
var/stack_amt = 50; // Amount to stack before releassing
|
||||
var/obj/machinery/mineral/stacking_unit_console/CONSOLE
|
||||
var/stk_types = list()
|
||||
var/stk_amt = list()
|
||||
var/stack_list[0] //Key: Type. Value: Instance of type.
|
||||
var/stack_amt = 50; //ammount to stack before releassing
|
||||
input_dir = EAST
|
||||
output_dir = WEST
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/New()
|
||||
..()
|
||||
|
||||
for(var/stacktype in typesof(/obj/item/stack/sheet/mineral)-/obj/item/stack/sheet/mineral)
|
||||
var/obj/item/stack/S = new stacktype(src)
|
||||
stack_storage[S.name] = 0
|
||||
stack_paths[S.name] = stacktype
|
||||
del(S)
|
||||
|
||||
stack_storage["glass"] = 0
|
||||
stack_paths["glass"] = /obj/item/stack/sheet/glass
|
||||
stack_storage["metal"] = 0
|
||||
stack_paths["metal"] = /obj/item/stack/sheet/metal
|
||||
stack_storage["plasteel"] = 0
|
||||
stack_paths["plasteel"] = /obj/item/stack/sheet/plasteel
|
||||
|
||||
spawn( 5 )
|
||||
for (var/dir in cardinal)
|
||||
src.input = locate(/obj/machinery/mineral/input, get_step(src, dir))
|
||||
if(src.input) break
|
||||
for (var/dir in cardinal)
|
||||
src.output = locate(/obj/machinery/mineral/output, get_step(src, dir))
|
||||
if(src.output) break
|
||||
return
|
||||
return
|
||||
/obj/machinery/mineral/stacking_machine/proc/process_sheet(obj/item/stack/sheet/inp)
|
||||
if(!(inp.type in stack_list)) //It's the first of this sheet added
|
||||
var/obj/item/stack/sheet/s = new inp.type(src,0)
|
||||
s.amount = 0
|
||||
stack_list[inp.type] = s
|
||||
var/obj/item/stack/sheet/storage = stack_list[inp.type]
|
||||
storage.amount += inp.amount //Stack the sheets
|
||||
inp.loc = null //Let the old sheet garbage collect
|
||||
while(storage.amount > stack_amt) //Get rid of excessive stackage
|
||||
var/obj/item/stack/sheet/out = new inp.type()
|
||||
out.amount = stack_amt
|
||||
unload_mineral(out)
|
||||
storage.amount -= stack_amt
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/process()
|
||||
if (src.output && src.input)
|
||||
var/turf/T = get_turf(input)
|
||||
for(var/obj/item/O in T.contents)
|
||||
if(!O) return
|
||||
if(istype(O,/obj/item/stack))
|
||||
if(!isnull(stack_storage[O.name]))
|
||||
stack_storage[O.name]++
|
||||
O.loc = null
|
||||
else
|
||||
O.loc = output.loc
|
||||
else
|
||||
O.loc = output.loc
|
||||
|
||||
//Output amounts that are past stack_amt.
|
||||
for(var/sheet in stack_storage)
|
||||
if(stack_storage[sheet] >= stack_amt)
|
||||
var/stacktype = stack_paths[sheet]
|
||||
var/obj/item/stack/sheet/S = new stacktype (get_turf(output))
|
||||
S.amount = stack_amt
|
||||
stack_storage[sheet] -= stack_amt
|
||||
|
||||
console.updateUsrDialog()
|
||||
return
|
||||
var/turf/T = get_step(src, input_dir)
|
||||
if(T)
|
||||
for(var/obj/item/stack/sheet/S in T)
|
||||
process_sheet(S)
|
||||
|
||||
|
||||
@@ -7,40 +7,22 @@
|
||||
icon_state = "unloader"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
|
||||
|
||||
/obj/machinery/mineral/unloading_machine/New()
|
||||
..()
|
||||
spawn( 5 )
|
||||
for (var/dir in cardinal)
|
||||
src.input = locate(/obj/machinery/mineral/input, get_step(src, dir))
|
||||
if(src.input) break
|
||||
for (var/dir in cardinal)
|
||||
src.output = locate(/obj/machinery/mineral/output, get_step(src, dir))
|
||||
if(src.output) break
|
||||
return
|
||||
return
|
||||
input_dir = WEST
|
||||
output_dir = EAST
|
||||
|
||||
/obj/machinery/mineral/unloading_machine/process()
|
||||
if (src.output && src.input)
|
||||
if (locate(/obj/structure/ore_box, input.loc))
|
||||
var/obj/structure/ore_box/BOX = locate(/obj/structure/ore_box, input.loc)
|
||||
var/i = 0
|
||||
for (var/obj/item/weapon/ore/O in BOX.contents)
|
||||
BOX.contents -= O
|
||||
O.loc = output.loc
|
||||
i++
|
||||
if (i>=10)
|
||||
var/turf/T = get_step(src,input_dir)
|
||||
if(T)
|
||||
var/limit
|
||||
for(var/obj/structure/ore_box/B in T)
|
||||
for (var/obj/item/weapon/ore/O in B)
|
||||
B.contents -= O
|
||||
unload_mineral(O)
|
||||
limit++
|
||||
if (limit>=10)
|
||||
return
|
||||
if (locate(/obj/item, input.loc))
|
||||
var/obj/item/O
|
||||
var/i
|
||||
for (i = 0; i<10; i++)
|
||||
O = locate(/obj/item, input.loc)
|
||||
if (O)
|
||||
O.loc = src.output.loc
|
||||
else
|
||||
return
|
||||
return
|
||||
for(var/obj/item/I in T)
|
||||
unload_mineral(I)
|
||||
limit++
|
||||
if (limit>=10)
|
||||
return
|
||||
@@ -13,7 +13,7 @@
|
||||
var/list/datum/material/storage[0]
|
||||
|
||||
/datum/materials/New()
|
||||
for(var/matdata in typesof(/datum/material) - /datum/material)
|
||||
for(var/matdata in subtypesof(/datum/material))
|
||||
var/datum/material/mat = new matdata
|
||||
storage[mat.id]=mat
|
||||
|
||||
|
||||
@@ -6,11 +6,25 @@
|
||||
/area/mine/explored
|
||||
name = "Mine"
|
||||
icon_state = "explored"
|
||||
music = null
|
||||
always_unpowered = 1
|
||||
requires_power = 1
|
||||
poweralm = 0
|
||||
power_environ = 0
|
||||
power_equip = 0
|
||||
power_light = 0
|
||||
ambientsounds = list('sound/ambience/ambimine.ogg')
|
||||
|
||||
/area/mine/unexplored
|
||||
name = "Mine"
|
||||
icon_state = "unexplored"
|
||||
music = null
|
||||
always_unpowered = 1
|
||||
requires_power = 1
|
||||
poweralm = 0
|
||||
power_environ = 0
|
||||
power_equip = 0
|
||||
power_light = 0
|
||||
ambientsounds = list('sound/ambience/ambimine.ogg')
|
||||
|
||||
/area/mine/lobby
|
||||
|
||||
@@ -68,96 +68,76 @@
|
||||
|
||||
var/excavation_amount = 100
|
||||
|
||||
proc/playDigSound()
|
||||
/obj/item/weapon/pickaxe/proc/playDigSound()
|
||||
playsound(src, pick(digsound),20,1)
|
||||
|
||||
hammer
|
||||
name = "sledgehammer"
|
||||
//icon_state = "sledgehammer" Waiting on sprite
|
||||
desc = "A mining hammer made of reinforced metal. You feel like smashing your boss in the face with this."
|
||||
/obj/item/weapon/pickaxe/diamond
|
||||
name = "diamond-tipped pickaxe"
|
||||
icon_state = "dpickaxe"
|
||||
item_state = "dpickaxe"
|
||||
digspeed = 20 //mines twice as fast as a normal pickaxe, bought from mining vendor
|
||||
origin_tech = "materials=4;engineering=3"
|
||||
desc = "A pickaxe with a diamond pick head. Extremely robust at cracking rock walls and digging up dirt."
|
||||
|
||||
silver
|
||||
name = "silver pickaxe"
|
||||
icon_state = "spickaxe"
|
||||
item_state = "spickaxe"
|
||||
digspeed = 30
|
||||
origin_tech = "materials=3"
|
||||
desc = "This makes no metallurgic sense."
|
||||
/obj/item/weapon/pickaxe/drill
|
||||
name = "mining drill"
|
||||
icon_state = "handdrill"
|
||||
item_state = "jackhammer"
|
||||
digspeed = 25 //available from roundstart, faster than a pickaxe.
|
||||
digsound = list('sound/weapons/drill.ogg')
|
||||
hitsound = 'sound/weapons/drill.ogg'
|
||||
origin_tech = "materials=2;powerstorage=3;engineering=2"
|
||||
desc = "An electric mining drill for the especially scrawny."
|
||||
|
||||
drill
|
||||
name = "mining drill" // Can dig sand as well!
|
||||
icon_state = "handdrill"
|
||||
item_state = "jackhammer"
|
||||
digspeed = 30
|
||||
hitsound = 'sound/weapons/drill.ogg'
|
||||
digsound = list('sound/weapons/drill.ogg')
|
||||
origin_tech = "materials=2;powerstorage=3;engineering=2"
|
||||
desc = "Yours is the drill that will pierce through the rock walls."
|
||||
/obj/item/weapon/pickaxe/drill/cyborg
|
||||
name = "cyborg mining drill"
|
||||
desc = "An integrated electric mining drill."
|
||||
flags = NODROP
|
||||
|
||||
jackhammer
|
||||
name = "sonic jackhammer"
|
||||
icon_state = "jackhammer"
|
||||
item_state = "jackhammer"
|
||||
digspeed = 15 //faster than drill, but cannot dig
|
||||
hitsound = 'sound/weapons/sonic_jackhammer.ogg'
|
||||
digsound = list('sound/weapons/sonic_jackhammer.ogg')
|
||||
origin_tech = "materials=3;powerstorage=2;engineering=2"
|
||||
desc = "Cracks rocks with sonic blasts, perfect for killing cave lizards."
|
||||
/obj/item/weapon/pickaxe/drill/diamonddrill
|
||||
name = "diamond-tipped mining drill"
|
||||
icon_state = "diamonddrill"
|
||||
digspeed = 10
|
||||
origin_tech = "materials=6;powerstorage=4;engineering=5"
|
||||
desc = "Yours is the drill that will pierce the heavens!"
|
||||
|
||||
gold
|
||||
name = "golden pickaxe"
|
||||
icon_state = "gpickaxe"
|
||||
item_state = "gpickaxe"
|
||||
digspeed = 20
|
||||
origin_tech = "materials=4"
|
||||
desc = "This makes no metallurgic sense."
|
||||
/obj/item/weapon/pickaxe/diamonddrill/traitor //Pocket-sized traitor diamond drill.
|
||||
name = "supermatter drill"
|
||||
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
|
||||
|
||||
plasmacutter
|
||||
name = "plasma cutter"
|
||||
icon_state = "plasmacutter"
|
||||
item_state = "gun"
|
||||
w_class = 3.0 //it is smaller than the pickaxe
|
||||
damtype = "fire"
|
||||
digspeed = 20 //Can slice though normal walls, all girders, or be used in reinforced wall deconstruction/ light thermite on fire
|
||||
hitsound = 'sound/weapons/plasma_cutter.ogg'
|
||||
digsound = list('sound/weapons/plasma_cutter.ogg')
|
||||
origin_tech = "materials=4;plasmatech=3;engineering=3"
|
||||
desc = "A rock cutter that uses bursts of hot plasma. You could use it to cut limbs off of xenos! Or, you know, mine stuff."
|
||||
/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.
|
||||
icon_state = "diamonddrill"
|
||||
digspeed = 10
|
||||
|
||||
diamond
|
||||
name = "diamond pickaxe"
|
||||
icon_state = "dpickaxe"
|
||||
item_state = "dpickaxe"
|
||||
digspeed = 10
|
||||
origin_tech = "materials=6;engineering=4"
|
||||
desc = "A pickaxe with a diamond pick head, this is just like minecraft."
|
||||
/obj/item/weapon/pickaxe/drill/jackhammer
|
||||
name = "sonic jackhammer"
|
||||
icon_state = "jackhammer"
|
||||
item_state = "jackhammer"
|
||||
digspeed = 5 //the epitome of powertools. extremely fast mining, laughs at puny walls
|
||||
origin_tech = "materials=3;powerstorage=2;engineering=2"
|
||||
digsound = list('sound/weapons/sonic_jackhammer.ogg')
|
||||
hitsound = 'sound/weapons/sonic_jackhammer.ogg'
|
||||
desc = "Cracks rocks with sonic blasts, and doubles as a demolition power tool for smashing walls."
|
||||
|
||||
diamonddrill //When people ask about the badass leader of the mining tools, they are talking about ME!
|
||||
name = "diamond mining drill"
|
||||
icon_state = "diamonddrill"
|
||||
item_state = "jackhammer"
|
||||
digspeed = 5 //Digs through walls, girders, and can dig up sand
|
||||
origin_tech = "materials=6;powerstorage=4;engineering=5"
|
||||
hitsound = 'sound/weapons/drill.ogg'
|
||||
digsound = list('sound/weapons/drill.ogg')
|
||||
desc = "Yours is the drill that will pierce the heavens!"
|
||||
|
||||
traitor //Pocket-sized traitor diamond drill.
|
||||
name = "supermatter drill"
|
||||
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
|
||||
|
||||
borgdrill
|
||||
name = "cyborg mining drill"
|
||||
icon_state = "jackhammer"
|
||||
item_state = "jackhammer"
|
||||
digspeed = 15
|
||||
hitsound = 'sound/weapons/drill.ogg'
|
||||
digsound = list('sound/weapons/drill.ogg')
|
||||
desc = ""
|
||||
/obj/item/weapon/pickaxe/silver
|
||||
name = "silver pickaxe"
|
||||
icon_state = "spickaxe"
|
||||
item_state = "spickaxe"
|
||||
digspeed = 30
|
||||
origin_tech = "materials=3"
|
||||
desc = "This makes no metallurgic sense."
|
||||
|
||||
/obj/item/weapon/pickaxe/gold
|
||||
name = "golden pickaxe"
|
||||
icon_state = "gpickaxe"
|
||||
item_state = "gpickaxe"
|
||||
digspeed = 20
|
||||
origin_tech = "materials=4"
|
||||
desc = "This makes no metallurgic sense."
|
||||
/*****************************Shovel********************************/
|
||||
|
||||
/obj/item/weapon/shovel
|
||||
|
||||
+429
-442
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@ var/list/name_to_mineral
|
||||
|
||||
proc/SetupMinerals()
|
||||
name_to_mineral = list()
|
||||
for(var/type in typesof(/mineral) - /mineral)
|
||||
for(var/type in subtypesof(/mineral))
|
||||
var/mineral/new_mineral = new type
|
||||
if(!new_mineral.name)
|
||||
continue
|
||||
|
||||
+116
-137
@@ -7,8 +7,6 @@
|
||||
icon_state = "coinpress0"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
var/amt_silver = 0 //amount of silver
|
||||
var/amt_gold = 0 //amount of gold
|
||||
var/amt_diamond = 0
|
||||
@@ -16,65 +14,45 @@
|
||||
var/amt_plasma = 0
|
||||
var/amt_uranium = 0
|
||||
var/amt_clown = 0
|
||||
var/amt_adamantine = 0
|
||||
var/amt_mythril = 0
|
||||
var/newCoins = 0 //how many coins the machine made in it's last load
|
||||
var/processing = 0
|
||||
var/chosen = "metal" //which material will be used to make coins
|
||||
var/coinsToProduce = 10
|
||||
|
||||
|
||||
/obj/machinery/mineral/mint/New()
|
||||
..()
|
||||
spawn( 5 )
|
||||
for (var/dir in cardinal)
|
||||
src.input = locate(/obj/machinery/mineral/input, get_step(src, dir))
|
||||
if(src.input) break
|
||||
for (var/dir in cardinal)
|
||||
src.output = locate(/obj/machinery/mineral/output, get_step(src, dir))
|
||||
if(src.output) break
|
||||
processing_objects.Add(src)
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/mineral/mint/process()
|
||||
if ( src.input)
|
||||
var/obj/item/stack/sheet/O
|
||||
O = locate(/obj/item/stack/sheet, input.loc)
|
||||
if(O)
|
||||
if (istype(O,/obj/item/stack/sheet/mineral/gold))
|
||||
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))
|
||||
amt_gold += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/mineral/silver))
|
||||
O.loc = null
|
||||
if (istype(O, /obj/item/stack/sheet/mineral/silver))
|
||||
amt_silver += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/mineral/diamond))
|
||||
O.loc = null
|
||||
if (istype(O, /obj/item/stack/sheet/mineral/diamond))
|
||||
amt_diamond += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/mineral/plasma))
|
||||
O.loc = null
|
||||
if (istype(O, /obj/item/stack/sheet/mineral/plasma))
|
||||
amt_plasma += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/mineral/uranium))
|
||||
O.loc = null
|
||||
if (istype(O, /obj/item/stack/sheet/mineral/uranium))
|
||||
amt_uranium += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/metal))
|
||||
O.loc = null
|
||||
if (istype(O, /obj/item/stack/sheet/metal))
|
||||
amt_iron += 100 * O.amount
|
||||
del(O)
|
||||
if (istype(O,/obj/item/stack/sheet/mineral/clown))
|
||||
O.loc = null
|
||||
if (istype(O, /obj/item/stack/sheet/mineral/bananium))
|
||||
amt_clown += 100 * O.amount
|
||||
del(O)
|
||||
O.loc = null
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/mineral/mint/attack_hand(user as mob) //TODO: Adamantine coins! -Durandan
|
||||
|
||||
var/dat = "<b>Coin Press</b><br>"
|
||||
|
||||
if (!input)
|
||||
dat += text("input connection status: ")
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b><br>")
|
||||
if (!output)
|
||||
dat += text("<br>output connection status: ")
|
||||
dat += text("<b><font color='red'>NOT CONNECTED</font></b><br>")
|
||||
|
||||
dat += text("<br><font color='#ffcc00'><b>Gold inserted: </b>[amt_gold]</font> ")
|
||||
if (chosen == "gold")
|
||||
dat += text("chosen")
|
||||
@@ -111,6 +89,11 @@
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=clown'>Choose</A>")
|
||||
dat += text("<br><font color='#888888'><b>Adamantine inserted: </b>[amt_adamantine]</font> ")//I don't even know these color codes, so fuck it.
|
||||
if (chosen == "adamantine")
|
||||
dat += text("chosen")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];choose=adamantine'>Choose</A>")
|
||||
|
||||
dat += text("<br><br>Will produce [coinsToProduce] [chosen] coins if enough materials are available.<br>")
|
||||
//dat += text("The dial which controls the number of conins to produce seems to be stuck. A technician has already been dispatched to fix this.")
|
||||
@@ -131,105 +114,101 @@
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
if(processing==1)
|
||||
usr << "\blue The machine is processing."
|
||||
usr << "<span class='notice'>The machine is processing.</span>"
|
||||
return
|
||||
if(href_list["choose"])
|
||||
chosen = href_list["choose"]
|
||||
if(href_list["chooseAmt"])
|
||||
coinsToProduce = between(0, coinsToProduce + text2num(href_list["chooseAmt"]), 1000)
|
||||
coinsToProduce = Clamp(coinsToProduce + text2num(href_list["chooseAmt"]), 0, 1000)
|
||||
if(href_list["makeCoins"])
|
||||
var/temp_coins = coinsToProduce
|
||||
if (src.output)
|
||||
processing = 1;
|
||||
icon_state = "coinpress1"
|
||||
var/obj/item/weapon/moneybag/M
|
||||
switch(chosen)
|
||||
if("metal")
|
||||
while(amt_iron > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new/obj/item/weapon/coin/iron(M)
|
||||
amt_iron -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("gold")
|
||||
while(amt_gold > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new /obj/item/weapon/coin/gold(M)
|
||||
amt_gold -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("silver")
|
||||
while(amt_silver > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new /obj/item/weapon/coin/silver(M)
|
||||
amt_silver -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("diamond")
|
||||
while(amt_diamond > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new /obj/item/weapon/coin/diamond(M)
|
||||
amt_diamond -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("plasma")
|
||||
while(amt_plasma > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new /obj/item/weapon/coin/plasma(M)
|
||||
amt_plasma -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("uranium")
|
||||
while(amt_uranium > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new /obj/item/weapon/coin/uranium(M)
|
||||
amt_uranium -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5)
|
||||
if("clown")
|
||||
while(amt_clown > 0 && coinsToProduce > 0)
|
||||
if (locate(/obj/item/weapon/moneybag,output.loc))
|
||||
M = locate(/obj/item/weapon/moneybag,output.loc)
|
||||
else
|
||||
M = new/obj/item/weapon/moneybag(output.loc)
|
||||
new /obj/item/weapon/coin/clown(M)
|
||||
amt_clown -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
icon_state = "coinpress0"
|
||||
processing = 0;
|
||||
coinsToProduce = temp_coins
|
||||
processing = 1;
|
||||
icon_state = "coinpress1"
|
||||
switch(chosen)
|
||||
if("metal")
|
||||
while(amt_iron > 0 && coinsToProduce > 0)
|
||||
create_coins(/obj/item/weapon/coin/iron)
|
||||
amt_iron -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("gold")
|
||||
while(amt_gold > 0 && coinsToProduce > 0)
|
||||
create_coins(/obj/item/weapon/coin/gold)
|
||||
amt_gold -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("silver")
|
||||
while(amt_silver > 0 && coinsToProduce > 0)
|
||||
create_coins(/obj/item/weapon/coin/silver)
|
||||
amt_silver -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("diamond")
|
||||
while(amt_diamond > 0 && coinsToProduce > 0)
|
||||
create_coins(/obj/item/weapon/coin/diamond)
|
||||
amt_diamond -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("plasma")
|
||||
while(amt_plasma > 0 && coinsToProduce > 0)
|
||||
create_coins(/obj/item/weapon/coin/plasma)
|
||||
amt_plasma -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("uranium")
|
||||
while(amt_uranium > 0 && coinsToProduce > 0)
|
||||
create_coins(/obj/item/weapon/coin/uranium)
|
||||
amt_uranium -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5)
|
||||
if("clown")
|
||||
while(amt_clown > 0 && coinsToProduce > 0)
|
||||
create_coins(/obj/item/weapon/coin/clown)
|
||||
amt_clown -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("adamantine")
|
||||
while(amt_adamantine > 0 && coinsToProduce > 0)
|
||||
create_coins(/obj/item/weapon/coin/adamantine)
|
||||
amt_adamantine -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
if("mythril")
|
||||
while(amt_adamantine > 0 && coinsToProduce > 0)
|
||||
create_coins(/obj/item/weapon/coin/mythril)
|
||||
amt_mythril -= 20
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5);
|
||||
icon_state = "coinpress0"
|
||||
processing = 0;
|
||||
coinsToProduce = temp_coins
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/mint/proc/create_coins(var/P)
|
||||
var/turf/T = get_step(src,output_dir)
|
||||
if(T)
|
||||
var/obj/item/O = new P(src)
|
||||
var/obj/item/weapon/moneybag/M = locate(/obj/item/weapon/moneybag/, T)
|
||||
if(!M)
|
||||
M = new /obj/item/weapon/moneybag(src)
|
||||
unload_mineral(M)
|
||||
O.loc = M
|
||||
@@ -6,7 +6,7 @@
|
||||
icon_state = "moneybag"
|
||||
flags = CONDUCT
|
||||
force = 10.0
|
||||
throwforce = 2.0
|
||||
throwforce = 0
|
||||
w_class = 4.0
|
||||
|
||||
/obj/item/weapon/moneybag/attack_hand(user as mob)
|
||||
@@ -17,6 +17,7 @@
|
||||
var/amt_plasma = 0
|
||||
var/amt_uranium = 0
|
||||
var/amt_clown = 0
|
||||
var/amt_adamantine = 0
|
||||
|
||||
for (var/obj/item/weapon/coin/C in contents)
|
||||
if (istype(C,/obj/item/weapon/coin/diamond))
|
||||
@@ -33,6 +34,8 @@
|
||||
amt_uranium++;
|
||||
if (istype(C,/obj/item/weapon/coin/clown))
|
||||
amt_clown++;
|
||||
if (istype(C,/obj/item/weapon/coin/adamantine))
|
||||
amt_adamantine++;
|
||||
|
||||
var/dat = text("<b>The contents of the moneybag reveal...</b><br>")
|
||||
if (amt_gold)
|
||||
@@ -49,41 +52,23 @@
|
||||
dat += text("Uranium coins: [amt_uranium] <A href='?src=\ref[src];remove=uranium'>Remove one</A><br>")
|
||||
if (amt_clown)
|
||||
dat += text("Bananium coins: [amt_clown] <A href='?src=\ref[src];remove=clown'>Remove one</A><br>")
|
||||
/*
|
||||
var/credits=0
|
||||
var/list/ore=list()
|
||||
for(var/oredata in typesof(/datum/material) - /datum/material)
|
||||
var/datum/material/ore_datum = new oredata
|
||||
ore[ore_datum.id]=ore_datum
|
||||
|
||||
for (var/obj/item/weapon/coin/C in contents)
|
||||
if (istype(C,/obj/item/weapon/coin))
|
||||
var/datum/material/ore_info=ore[C.material]
|
||||
ore_info.stored++
|
||||
ore[C.material]=ore_info
|
||||
credits += C.credits
|
||||
|
||||
var/dat = "<b>The contents of the moneybag reveal...</b><ul>"
|
||||
for(var/ore_id in ore)
|
||||
var/datum/material/ore_info=ore[ore_id]
|
||||
if(ore_info.stored)
|
||||
dat += "<li>[ore_info.processed_name] coins: [ore_info.stored] <A href='?src=\ref[src];remove=[ore_id]'>Remove one</A></li>"
|
||||
dat += "</ul><b>Total haul:</b> $[credits]"
|
||||
*/
|
||||
if (amt_adamantine)
|
||||
dat += text("Adamantine coins: [amt_adamantine] <A href='?src=\ref[src];remove=adamantine'>Remove one</A><br>")
|
||||
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))
|
||||
var/obj/item/weapon/coin/C = W
|
||||
user << "\blue You add the [C.name] into the bag."
|
||||
usr.drop_item()
|
||||
if(!user.drop_item())
|
||||
return
|
||||
user << "<span class='notice'>You add the [C.name] into the bag.</span>"
|
||||
contents += C
|
||||
if (istype(W, /obj/item/weapon/moneybag))
|
||||
var/obj/item/weapon/moneybag/C = W
|
||||
for (var/obj/O in C.contents)
|
||||
contents += O;
|
||||
user << "\blue You empty the [C.name] into the bag."
|
||||
user << "<span class='notice'>You empty the [C.name] into the bag.</span>"
|
||||
return
|
||||
|
||||
/obj/item/weapon/moneybag/Topic(href, href_list)
|
||||
@@ -108,13 +93,13 @@
|
||||
COIN = locate(/obj/item/weapon/coin/uranium,src.contents)
|
||||
if("clown")
|
||||
COIN = locate(/obj/item/weapon/coin/clown,src.contents)
|
||||
if("adamantine")
|
||||
COIN = locate(/obj/item/weapon/coin/adamantine,src.contents)
|
||||
if(!COIN)
|
||||
return
|
||||
COIN.loc = src.loc
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/moneybag/vault
|
||||
|
||||
/obj/item/weapon/moneybag/vault/New()
|
||||
@@ -124,4 +109,5 @@
|
||||
new /obj/item/weapon/coin/silver(src)
|
||||
new /obj/item/weapon/coin/silver(src)
|
||||
new /obj/item/weapon/coin/gold(src)
|
||||
new /obj/item/weapon/coin/gold(src)
|
||||
new /obj/item/weapon/coin/gold(src)
|
||||
new /obj/item/weapon/coin/adamantine(src)
|
||||
+163
-46
@@ -1,94 +1,211 @@
|
||||
/obj/item/weapon/ore
|
||||
name = "rock"
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "ore2"
|
||||
icon_state = "ore"
|
||||
var/points = 0 //How many points this ore gets you from the ore redemption machine
|
||||
var/refined_type = null //What this ore defaults to being refined into
|
||||
var/datum/geosample/geologic_data
|
||||
var/oretag
|
||||
|
||||
/obj/item/weapon/ore/attackby(obj/item/I as obj, mob/user as mob, params)
|
||||
if(istype(I, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/W = I
|
||||
if(W.remove_fuel(15))
|
||||
new refined_type(get_turf(src.loc))
|
||||
qdel(src)
|
||||
else if(W.isOn())
|
||||
user << "<span class='info'>Not enough fuel to smelt [src].</span>"
|
||||
..()
|
||||
|
||||
/obj/item/weapon/ore/uranium
|
||||
name = "pitchblende"
|
||||
name = "uranium ore"
|
||||
icon_state = "Uranium ore"
|
||||
origin_tech = "materials=5"
|
||||
oretag = "uranium"
|
||||
points = 18
|
||||
refined_type = /obj/item/stack/sheet/mineral/uranium
|
||||
|
||||
/obj/item/weapon/ore/iron
|
||||
name = "hematite"
|
||||
name = "iron ore"
|
||||
icon_state = "Iron ore"
|
||||
origin_tech = "materials=1"
|
||||
oretag = "hematite"
|
||||
|
||||
/obj/item/weapon/ore/coal
|
||||
name = "carbonaceous rock"
|
||||
icon_state = "Iron ore" //TODO
|
||||
origin_tech = "materials=1"
|
||||
oretag = "coal"
|
||||
points = 1
|
||||
refined_type = /obj/item/stack/sheet/metal
|
||||
|
||||
/obj/item/weapon/ore/glass
|
||||
name = "impure silicates"
|
||||
name = "sand pile"
|
||||
icon_state = "Glass ore"
|
||||
origin_tech = "materials=1"
|
||||
oretag = "sand"
|
||||
points = 1
|
||||
refined_type = /obj/item/stack/sheet/glass
|
||||
|
||||
/obj/item/weapon/ore/glass/attack_self(mob/living/user as mob)
|
||||
user << "<span class='notice'>You use the sand to make sandstone.</span>"
|
||||
var/sandAmt = 1
|
||||
for(var/obj/item/weapon/ore/glass/G in user.loc) // The sand on the floor
|
||||
sandAmt += 1
|
||||
qdel(G)
|
||||
while(sandAmt > 0)
|
||||
var/obj/item/stack/sheet/mineral/sandstone/SS = new /obj/item/stack/sheet/mineral/sandstone(user.loc)
|
||||
if(sandAmt >= SS.max_amount)
|
||||
SS.amount = SS.max_amount
|
||||
else
|
||||
SS.amount = sandAmt
|
||||
for(var/obj/item/stack/sheet/mineral/sandstone/SA in user.loc)
|
||||
if(SA != SS && SA.amount < SA.max_amount)
|
||||
SA.attackby(SS, user) //we try to transfer all old unfinished stacks to the new stack we created.
|
||||
sandAmt -= SS.max_amount
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/ore/plasma
|
||||
name = "plasma crystals"
|
||||
name = "plasma ore"
|
||||
icon_state = "Plasma ore"
|
||||
origin_tech = "materials=2"
|
||||
oretag = "plasma"
|
||||
points = 36
|
||||
refined_type = /obj/item/stack/sheet/mineral/plasma
|
||||
|
||||
/obj/item/weapon/ore/plasma/attackby(obj/item/I as obj, mob/user as mob, params)
|
||||
if(istype(I, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/W = I
|
||||
if(W.welding)
|
||||
user << "<span class='warning'>You can't hit a high enough temperature to smelt [src] properly!</span>"
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/weapon/ore/silver
|
||||
name = "native silver ore"
|
||||
name = "silver ore"
|
||||
icon_state = "Silver ore"
|
||||
origin_tech = "materials=3"
|
||||
oretag = "silver"
|
||||
points = 18
|
||||
refined_type = /obj/item/stack/sheet/mineral/silver
|
||||
|
||||
/obj/item/weapon/ore/gold
|
||||
name = "native gold ore"
|
||||
name = "gold ore"
|
||||
icon_state = "Gold ore"
|
||||
origin_tech = "materials=4"
|
||||
oretag = "gold"
|
||||
points = 18
|
||||
refined_type = /obj/item/stack/sheet/mineral/gold
|
||||
|
||||
/obj/item/weapon/ore/diamond
|
||||
name = "diamonds"
|
||||
name = "diamond ore"
|
||||
icon_state = "Diamond ore"
|
||||
origin_tech = "materials=6"
|
||||
oretag = "diamond"
|
||||
points = 36
|
||||
refined_type = /obj/item/stack/sheet/mineral/diamond
|
||||
|
||||
/obj/item/weapon/ore/osmium
|
||||
name = "raw platinum"
|
||||
icon_state = "slag" //TODO
|
||||
oretag = "platinum"
|
||||
|
||||
/obj/item/weapon/ore/hydrogen
|
||||
name = "raw hydrogen"
|
||||
icon_state = "slag" //TODO
|
||||
oretag = "hydrogen"
|
||||
|
||||
/obj/item/weapon/ore/clown
|
||||
name = "Bananium ore"
|
||||
/obj/item/weapon/ore/bananium
|
||||
name = "bananium ore"
|
||||
icon_state = "Clown ore"
|
||||
origin_tech = "materials=4"
|
||||
oretag="clown"
|
||||
|
||||
/obj/item/weapon/ore/fabric
|
||||
name = "fabric"
|
||||
icon_state = "fabric"
|
||||
origin_tech = "materials=1"
|
||||
oretag = "fabric"
|
||||
points = 27
|
||||
refined_type = /obj/item/stack/sheet/mineral/bananium
|
||||
|
||||
/obj/item/weapon/ore/slag
|
||||
name = "Slag"
|
||||
name = "slag"
|
||||
desc = "Completely useless"
|
||||
icon_state = "slag"
|
||||
oretag = "slag"
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite
|
||||
name = "gibtonite ore"
|
||||
desc = "Extremely explosive if struck with mining equipment, Gibtonite is often used by miners to speed up their work by using it as a mining charge. This material is illegal to possess by unauthorized personnel under space law."
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "Gibtonite ore"
|
||||
item_state = "Gibtonite ore"
|
||||
icon_override = 'icons/mob/in-hand/tools.dmi'
|
||||
w_class = 4
|
||||
throw_range = 0
|
||||
anchored = 1 //Forces people to carry it by hand, no pulling!
|
||||
var/primed = 0
|
||||
var/det_time = 100
|
||||
var/quality = 1 //How pure this gibtonite is, determines the explosion produced by it and is derived from the det_time of the rock wall it was taken from, higher value = better
|
||||
var/attacher = "UNKNOWN"
|
||||
var/datum/wires/explosive/gibtonite/wires
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite/attackby(obj/item/I, mob/user, params)
|
||||
if(!wires && istype(I, /obj/item/device/assembly/igniter))
|
||||
user.visible_message("[user] attaches [I] to [src].", "<span class='notice'>You attach [I] to [src].</span>")
|
||||
wires = new(src)
|
||||
attacher = key_name(user)
|
||||
qdel(I)
|
||||
overlays += "Gibtonite_igniter"
|
||||
return
|
||||
|
||||
if(wires && !primed)
|
||||
if(istype(I, /obj/item/weapon/wirecutters) || istype(I, /obj/item/device/multitool) || istype(I, /obj/item/device/assembly/signaler))
|
||||
wires.Interact(user)
|
||||
return
|
||||
|
||||
if(istype(I, /obj/item/weapon/pickaxe) || istype(I, /obj/item/weapon/resonator) || I.force >= 10)
|
||||
GibtoniteReaction(user)
|
||||
return
|
||||
if(primed)
|
||||
if(istype(I, /obj/item/device/mining_scanner) || istype(I, /obj/item/device/t_scanner/adv_mining_scanner) || istype(I, /obj/item/device/multitool))
|
||||
primed = 0
|
||||
user.visible_message("The chain reaction was stopped! ...The ore's quality looks diminished.", "<span class='notice'>You stopped the chain reaction. ...The ore's quality looks diminished.</span>")
|
||||
icon_state = "Gibtonite ore"
|
||||
quality = 1
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite/attack_self(user)
|
||||
if(wires)
|
||||
wires.Interact(user)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite/bullet_act(var/obj/item/projectile/P)
|
||||
GibtoniteReaction(P.firer)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite/ex_act()
|
||||
GibtoniteReaction(null, 1)
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite/proc/GibtoniteReaction(mob/user, triggered_by = 0)
|
||||
if(!primed)
|
||||
playsound(src,'sound/effects/hit_on_shattered_glass.ogg',50,1)
|
||||
primed = 1
|
||||
icon_state = "Gibtonite active"
|
||||
var/turf/bombturf = get_turf(src)
|
||||
var/area/A = get_area(bombturf)
|
||||
var/notify_admins = 0
|
||||
if(z != 5)//Only annoy the admins ingame if we're triggered off the mining zlevel
|
||||
notify_admins = 1
|
||||
|
||||
if(notify_admins)
|
||||
if(triggered_by == 1)
|
||||
message_admins("An explosion has triggered a [name] to detonate at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[bombturf.x];Y=[bombturf.y];Z=[bombturf.z]'>[A.name] (JMP)</a>.")
|
||||
else if(triggered_by == 2)
|
||||
message_admins("A signal has triggered a [name] to detonate at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[bombturf.x];Y=[bombturf.y];Z=[bombturf.z]'>[A.name] (JMP)</a>. Igniter attacher: [key_name_admin(attacher)]<A HREF='?_src_=holder;adminmoreinfo=\ref[attacher]'>?</A> (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[attacher]'>FLW</A>)")
|
||||
else
|
||||
message_admins("[key_name_admin(user)]<A HREF='?_src_=holder;adminmoreinfo=\ref[user]'>?</A> (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[user]'>FLW</A>) has triggered a [name] to detonate at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[bombturf.x];Y=[bombturf.y];Z=[bombturf.z]'>[A.name] (JMP)</a>.")
|
||||
if(triggered_by == 1)
|
||||
log_game("An explosion has primed a [name] for detonation at [A.name]([bombturf.x],[bombturf.y],[bombturf.z])")
|
||||
else if(triggered_by == 2)
|
||||
log_game("A signal has primed a [name] for detonation at [A.name]([bombturf.x],[bombturf.y],[bombturf.z]). Igniter attacher: [key_name(attacher)].")
|
||||
else
|
||||
user.visible_message("<span class='warning'>[user] strikes \the [src], causing a chain reaction!</span>", "<span class='danger'>You strike \the [src], causing a chain reaction.</span>")
|
||||
log_game("[key_name(user)] has primed a [name] for detonation at [A.name]([bombturf.x],[bombturf.y],[bombturf.z])")
|
||||
spawn(det_time)
|
||||
if(primed)
|
||||
if(quality == 3)
|
||||
explosion(src.loc,2,4,9,adminlog = notify_admins)
|
||||
if(quality == 2)
|
||||
explosion(src.loc,1,2,5,adminlog = notify_admins)
|
||||
if(quality == 1)
|
||||
explosion(src.loc,-1,1,3,adminlog = notify_admins)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/ore/New()
|
||||
pixel_x = rand(0,16)-8
|
||||
pixel_y = rand(0,8)-8
|
||||
if(src.z == ZLEVEL_ASTEROID) score_oremined++ //When ore spawns, increment score. Only include ore spawned on mining asteroid (No Clown Planet)
|
||||
if(src.z == ZLEVEL_ASTEROID)
|
||||
score_oremined++ //When ore spawns, increment score. Only include ore spawned on mining asteroid (No Clown Planet)
|
||||
|
||||
/obj/item/weapon/ore/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
|
||||
/obj/item/weapon/ore/ex_act()
|
||||
return
|
||||
|
||||
/obj/item/weapon/ore/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/device/core_sampler))
|
||||
var/obj/item/device/core_sampler/C = W
|
||||
C.sample_item(src, user)
|
||||
else
|
||||
return ..()
|
||||
return ..()
|
||||
|
||||
@@ -4,9 +4,25 @@
|
||||
/obj/structure/ore_box
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "orebox0"
|
||||
name = "Ore Box"
|
||||
desc = "A heavy box used for storing ore."
|
||||
name = "ore box"
|
||||
desc = "A heavy wooden box, which can be filled with a lot of ores."
|
||||
density = 1
|
||||
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(!user.drop_item())
|
||||
return
|
||||
W.loc = src
|
||||
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)
|
||||
S.remove_from_storage(O, src) //This will move the item to this item's contents
|
||||
user << "<span class='notice'>You empty the satchel into the box.</span>"
|
||||
return
|
||||
|
||||
/obj/structure/ore_box/attack_hand(mob/user as mob)
|
||||
var/amt_gold = 0
|
||||
var/amt_silver = 0
|
||||
var/amt_diamond = 0
|
||||
@@ -15,71 +31,64 @@
|
||||
var/amt_plasma = 0
|
||||
var/amt_uranium = 0
|
||||
var/amt_clown = 0
|
||||
var/amt_strange = 0
|
||||
var/last_update = 0
|
||||
|
||||
/obj/structure/ore_box/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
|
||||
if (istype(W, /obj/item/weapon/ore))
|
||||
user.unEquip(W)
|
||||
src.contents += W
|
||||
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)
|
||||
S.remove_from_storage(O, src) //This will move the item to this item's contents
|
||||
user << "\blue You empty the satchel into the box."
|
||||
return
|
||||
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))
|
||||
amt_glass++;
|
||||
if (istype(C,/obj/item/weapon/ore/plasma))
|
||||
amt_plasma++;
|
||||
if (istype(C,/obj/item/weapon/ore/iron))
|
||||
amt_iron++;
|
||||
if (istype(C,/obj/item/weapon/ore/silver))
|
||||
amt_silver++;
|
||||
if (istype(C,/obj/item/weapon/ore/gold))
|
||||
amt_gold++;
|
||||
if (istype(C,/obj/item/weapon/ore/uranium))
|
||||
amt_uranium++;
|
||||
if (istype(C,/obj/item/weapon/ore/bananium))
|
||||
amt_clown++;
|
||||
|
||||
/obj/structure/ore_box/examine()
|
||||
set name = "Examine"
|
||||
set category = "IC"
|
||||
set src in view(usr.client) //If it can be seen, it can be examined.
|
||||
|
||||
if (!( usr ))
|
||||
return
|
||||
usr << "That's an [src]."
|
||||
usr << desc
|
||||
|
||||
if(!istype(usr, /mob/living/carbon/human)) //Only living, intelligent creatures with hands can check the contents of ore boxes.
|
||||
return
|
||||
|
||||
if(!Adjacent(usr)) //Can only check the contents of ore boxes if you can physically reach them.
|
||||
return
|
||||
|
||||
add_fingerprint(usr)
|
||||
|
||||
if(contents.len < 1)
|
||||
usr << "It is empty."
|
||||
return
|
||||
|
||||
if(world.time > last_update + 10)
|
||||
update_orecount()
|
||||
last_update = world.time
|
||||
|
||||
var/dat = text("<b>The contents of the ore box reveal...</b>")
|
||||
if (amt_iron)
|
||||
dat += text("<br>Metal ore: [amt_iron]")
|
||||
if (amt_glass)
|
||||
dat += text("<br>Sand: [amt_glass]")
|
||||
if (amt_plasma)
|
||||
dat += text("<br>Plasma ore: [amt_plasma]")
|
||||
if (amt_uranium)
|
||||
dat += text("<br>Uranium ore: [amt_uranium]")
|
||||
if (amt_silver)
|
||||
dat += text("<br>Silver ore: [amt_silver]")
|
||||
var/dat = text("<b>The contents of the ore box reveal...</b><br>")
|
||||
if (amt_gold)
|
||||
dat += text("<br>Gold ore: [amt_gold]")
|
||||
dat += text("Gold ore: [amt_gold]<br>")
|
||||
if (amt_silver)
|
||||
dat += text("Silver ore: [amt_silver]<br>")
|
||||
if (amt_iron)
|
||||
dat += text("Metal ore: [amt_iron]<br>")
|
||||
if (amt_glass)
|
||||
dat += text("Sand: [amt_glass]<br>")
|
||||
if (amt_diamond)
|
||||
dat += text("<br>Diamond ore: [amt_diamond]")
|
||||
if (amt_strange)
|
||||
dat += text("<br>Strange rocks: [amt_strange]")
|
||||
dat += text("Diamond ore: [amt_diamond]<br>")
|
||||
if (amt_plasma)
|
||||
dat += text("Plasma ore: [amt_plasma]<br>")
|
||||
if (amt_uranium)
|
||||
dat += text("Uranium ore: [amt_uranium]<br>")
|
||||
if (amt_clown)
|
||||
dat += text("<br>Bananium ore: [amt_clown]")
|
||||
|
||||
usr << dat
|
||||
dat += text("Bananium ore: [amt_clown]<br>")
|
||||
|
||||
dat += text("<br><br><A href='?src=\ref[src];removeall=1'>Empty box</A>")
|
||||
user << browse("[dat]", "window=orebox")
|
||||
return
|
||||
|
||||
/obj/structure/ore_box/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["removeall"])
|
||||
for (var/obj/item/weapon/ore/O in contents)
|
||||
contents -= O
|
||||
O.loc = src.loc
|
||||
usr << "<span class='notice'>You empty the box.</span>"
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
obj/structure/ore_box/ex_act(severity, target)
|
||||
if(prob(100 / severity) && severity < 3)
|
||||
qdel(src) //nothing but ores can get inside unless its a bug and ores just return nothing on ex_act, not point in calling it on them
|
||||
|
||||
|
||||
/obj/structure/ore_box/verb/empty_box()
|
||||
set name = "Empty Ore Box"
|
||||
@@ -87,7 +96,7 @@
|
||||
set src in view(1)
|
||||
|
||||
if(!istype(usr, /mob/living/carbon/human)) //Only living, intelligent creatures with hands can empty ore boxes.
|
||||
usr << "\red You are physically incapable of emptying the ore box."
|
||||
usr << "<span class='warning'>You are physically incapable of emptying the ore box.</span>"
|
||||
return
|
||||
|
||||
if( usr.stat || usr.restrained() )
|
||||
@@ -100,58 +109,12 @@
|
||||
add_fingerprint(usr)
|
||||
|
||||
if(contents.len < 1)
|
||||
usr << "\red The ore box is empty"
|
||||
usr << "<span class='warning'>The ore box is empty.</span>"
|
||||
return
|
||||
|
||||
for (var/obj/item/weapon/ore/O in contents)
|
||||
contents -= O
|
||||
O.loc = src.loc
|
||||
usr << "\blue You empty the ore box"
|
||||
usr << "<span class='notice'>You empty the ore box.</span>"
|
||||
|
||||
return
|
||||
|
||||
|
||||
// Updates ore tally
|
||||
/obj/structure/ore_box/proc/update_orecount()
|
||||
amt_iron = 0
|
||||
amt_glass = 0
|
||||
amt_plasma = 0
|
||||
amt_uranium = 0
|
||||
amt_silver = 0
|
||||
amt_gold = 0
|
||||
amt_diamond = 0
|
||||
amt_strange = 0
|
||||
amt_clown = 0
|
||||
|
||||
for(var/obj/item/weapon/ore/O in contents)
|
||||
if(!istype(O))
|
||||
continue
|
||||
|
||||
if (istype(O, /obj/item/weapon/ore/iron))
|
||||
amt_iron++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/glass))
|
||||
amt_glass++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/plasma))
|
||||
amt_plasma++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/uranium))
|
||||
amt_uranium++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/silver))
|
||||
amt_silver++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/gold))
|
||||
amt_gold++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/diamond))
|
||||
amt_diamond++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/strangerock))
|
||||
amt_strange++
|
||||
continue
|
||||
if (istype(O, /obj/item/weapon/ore/clown))
|
||||
amt_clown++
|
||||
continue
|
||||
return
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#define TURF_FLOOR 0
|
||||
#define TURF_WALL 1
|
||||
var/global/list/mining_surprises = typesof(/mining_surprise)-/mining_surprise
|
||||
var/global/list/mining_surprises = subtypesof(/mining_surprise)
|
||||
|
||||
/surprise_turf_info
|
||||
var/list/types[0]
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
icon_state = "alien[caste]_leap"
|
||||
pixel_x = -32
|
||||
pixel_y = -32
|
||||
else if(icon == 'icons/mob/alienleap.dmi' && icon_state == "alien[caste]_leap" && pixel_x == -32 && pixel_y == -32)
|
||||
else if(icon == 'icons/mob/alienleap.dmi' && pixel_x == -32 && pixel_y == -32)
|
||||
icon = initial(icon)// ^ this looks odd, but in theory it will prevent the icon and pixel_xy from being reset unless it needs to be
|
||||
pixel_x = initial(pixel_x)
|
||||
pixel_y = initial(pixel_y)
|
||||
|
||||
@@ -0,0 +1,185 @@
|
||||
/mob/living/carbon/human/proc/change_appearance(var/flags = APPEARANCE_ALL_HAIR, var/location = src, var/mob/user = src, var/check_species_whitelist = 1, var/list/species_whitelist = list(), var/list/species_blacklist = list(), var/datum/topic_state/state = default_state)
|
||||
var/datum/nano_module/appearance_changer/AC = new(location, src, check_species_whitelist, species_whitelist, species_blacklist)
|
||||
AC.flags = flags
|
||||
AC.ui_interact(user, state = state)
|
||||
|
||||
/mob/living/carbon/human/proc/change_species(var/new_species)
|
||||
if(!new_species)
|
||||
return
|
||||
|
||||
if(species == new_species)
|
||||
return
|
||||
|
||||
if(!(new_species in all_species))
|
||||
return
|
||||
|
||||
set_species(new_species)
|
||||
reset_hair()
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/proc/change_gender(var/gender)
|
||||
if(src.gender == gender)
|
||||
return
|
||||
|
||||
src.gender = gender
|
||||
reset_hair()
|
||||
update_body()
|
||||
update_dna()
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/proc/change_hair(var/hair_style)
|
||||
if(!hair_style)
|
||||
return
|
||||
|
||||
if(h_style == hair_style)
|
||||
return
|
||||
|
||||
if(!(hair_style in hair_styles_list))
|
||||
return
|
||||
|
||||
h_style = hair_style
|
||||
|
||||
update_hair()
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/proc/change_facial_hair(var/facial_hair_style)
|
||||
if(!facial_hair_style)
|
||||
return
|
||||
|
||||
if(f_style == facial_hair_style)
|
||||
return
|
||||
|
||||
if(!(facial_hair_style in facial_hair_styles_list))
|
||||
return
|
||||
|
||||
f_style = facial_hair_style
|
||||
|
||||
update_hair()
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/proc/reset_hair()
|
||||
var/list/valid_hairstyles = generate_valid_hairstyles()
|
||||
var/list/valid_facial_hairstyles = generate_valid_facial_hairstyles()
|
||||
|
||||
if(valid_hairstyles.len)
|
||||
h_style = pick(valid_hairstyles)
|
||||
else
|
||||
//this shouldn't happen
|
||||
h_style = "Bald"
|
||||
|
||||
if(valid_facial_hairstyles.len)
|
||||
f_style = pick(valid_facial_hairstyles)
|
||||
else
|
||||
//this shouldn't happen
|
||||
f_style = "Shaved"
|
||||
|
||||
update_hair()
|
||||
|
||||
/mob/living/carbon/human/proc/change_eye_color(var/red, var/green, var/blue)
|
||||
if(red == r_eyes && green == g_eyes && blue == b_eyes)
|
||||
return
|
||||
|
||||
r_eyes = red
|
||||
g_eyes = green
|
||||
b_eyes = blue
|
||||
|
||||
update_eyes()
|
||||
update_body()
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/proc/change_hair_color(var/red, var/green, var/blue)
|
||||
if(red == r_eyes && green == g_eyes && blue == b_eyes)
|
||||
return
|
||||
|
||||
r_hair = red
|
||||
g_hair = green
|
||||
b_hair = blue
|
||||
|
||||
update_hair()
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/proc/change_facial_hair_color(var/red, var/green, var/blue)
|
||||
if(red == r_facial && green == g_facial && blue == b_facial)
|
||||
return
|
||||
|
||||
r_facial = red
|
||||
g_facial = green
|
||||
b_facial = blue
|
||||
|
||||
update_hair()
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/proc/change_skin_color(var/red, var/green, var/blue)
|
||||
if(red == r_skin && green == g_skin && blue == b_skin || !(species.flags & HAS_SKIN_COLOR))
|
||||
return
|
||||
|
||||
r_skin = red
|
||||
g_skin = green
|
||||
b_skin = blue
|
||||
|
||||
force_update_limbs()
|
||||
update_body()
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/proc/change_skin_tone(var/tone)
|
||||
if(s_tone == tone || !(species.flags & HAS_SKIN_TONE))
|
||||
return
|
||||
|
||||
s_tone = tone
|
||||
|
||||
force_update_limbs()
|
||||
update_body()
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/proc/update_dna()
|
||||
check_dna()
|
||||
dna.ready_dna(src)
|
||||
|
||||
/mob/living/carbon/human/proc/generate_valid_species(var/check_whitelist = 1, var/list/whitelist = list(), var/list/blacklist = list())
|
||||
var/list/valid_species = new()
|
||||
for(var/current_species_name in all_species)
|
||||
var/datum/species/current_species = all_species[current_species_name]
|
||||
|
||||
if(check_whitelist && config.usealienwhitelist && !check_rights(R_ADMIN, 0, src)) //If we're using the whitelist, make sure to check it!
|
||||
if(whitelist.len && !(current_species_name in whitelist))
|
||||
continue
|
||||
if(blacklist.len && (current_species_name in blacklist))
|
||||
continue
|
||||
if((current_species.flags & IS_WHITELISTED) && !is_alien_whitelisted(src, current_species_name))
|
||||
continue
|
||||
|
||||
valid_species += current_species_name
|
||||
|
||||
return valid_species
|
||||
|
||||
/mob/living/carbon/human/proc/generate_valid_hairstyles()
|
||||
var/list/valid_hairstyles = new()
|
||||
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.name in S.species_allowed))
|
||||
continue
|
||||
valid_hairstyles += hairstyle
|
||||
|
||||
return valid_hairstyles
|
||||
|
||||
/mob/living/carbon/human/proc/generate_valid_facial_hairstyles()
|
||||
var/list/valid_facial_hairstyles = new()
|
||||
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.name in S.species_allowed))
|
||||
continue
|
||||
|
||||
valid_facial_hairstyles += facialhairstyle
|
||||
|
||||
return valid_facial_hairstyles
|
||||
|
||||
@@ -65,11 +65,11 @@
|
||||
return 1
|
||||
// if(M.health < -75) return 0
|
||||
|
||||
if((M.head && (M.head.flags & HEADCOVERSMOUTH)) || (M.wear_mask && (M.wear_mask.flags & MASKCOVERSMOUTH)))
|
||||
M << "\blue <B>Remove your mask!</B>"
|
||||
if((M.head && (M.head.flags & HEADCOVERSMOUTH)) || (M.wear_mask && (M.wear_mask.flags & MASKCOVERSMOUTH) && !M.wear_mask.mask_adjusted))
|
||||
M << "<span class='boldnotice'>Remove your mask!</span>"
|
||||
return 0
|
||||
if((head && (head.flags & HEADCOVERSMOUTH)) || (wear_mask && (wear_mask.flags & MASKCOVERSMOUTH)))
|
||||
M << "\blue <B>Remove his mask!</B>"
|
||||
if((head && (head.flags & HEADCOVERSMOUTH)) || (wear_mask && (wear_mask.flags & MASKCOVERSMOUTH) && !wear_mask.mask_adjusted))
|
||||
M << "<span class='boldnotice'>Remove his mask!</span>"
|
||||
return 0
|
||||
|
||||
var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human()
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
var/list/ai_list = list()
|
||||
var/list/ai_verbs_default = list(
|
||||
/mob/living/silicon/ai/proc/ai_alerts,
|
||||
/mob/living/silicon/ai/proc/announcement,
|
||||
/mob/living/silicon/ai/proc/ai_call_shuttle,
|
||||
/mob/living/silicon/ai/proc/ai_camera_track,
|
||||
@@ -24,8 +23,7 @@ var/list/ai_verbs_default = list(
|
||||
/mob/living/silicon/ai/proc/toggle_acceleration,
|
||||
/mob/living/silicon/ai/proc/toggle_camera_light,
|
||||
/mob/living/silicon/ai/proc/botcall,
|
||||
/mob/living/silicon/ai/proc/change_arrival_message,
|
||||
/mob/living/silicon/ai/proc/nano_crew_monitor
|
||||
/mob/living/silicon/ai/proc/change_arrival_message
|
||||
)
|
||||
|
||||
//Not sure why this is necessary...
|
||||
@@ -95,9 +93,11 @@ var/list/ai_verbs_default = list(
|
||||
|
||||
/mob/living/silicon/ai/proc/add_ai_verbs()
|
||||
src.verbs |= ai_verbs_default
|
||||
|
||||
src.verbs |= silicon_subsystems
|
||||
|
||||
/mob/living/silicon/ai/proc/remove_ai_verbs()
|
||||
src.verbs -= ai_verbs_default
|
||||
src.verbs -= silicon_subsystems
|
||||
|
||||
/mob/living/silicon/ai/New(loc, var/datum/ai_laws/L, var/obj/item/device/mmi/B, var/safety = 0)
|
||||
var/list/possibleNames = ai_names
|
||||
@@ -181,8 +181,6 @@ var/list/ai_verbs_default = list(
|
||||
hud_list[SPECIALROLE_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
|
||||
hud_list[NATIONS_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
|
||||
|
||||
init_subsystems()
|
||||
|
||||
ai_list += src
|
||||
..()
|
||||
return
|
||||
@@ -321,43 +319,6 @@ var/list/ai_verbs_default = list(
|
||||
if (malf.apcs >= 3)
|
||||
stat(null, "Time until station control secured: [max(malf.AI_win_timeleft/(malf.apcs/3), 0)] seconds")
|
||||
|
||||
|
||||
/mob/living/silicon/ai/proc/ai_alerts()
|
||||
set name = "Show Alerts"
|
||||
set category = "AI Commands"
|
||||
|
||||
var/dat = "<HEAD><TITLE>Current Station Alerts</TITLE><META HTTP-EQUIV='Refresh' CONTENT='10'></HEAD><BODY>\n"
|
||||
dat += "<A HREF='?src=\ref[src];mach_close=aialerts'>Close</A><BR><BR>"
|
||||
for (var/cat in alarms)
|
||||
dat += text("<B>[]</B><BR>\n", cat)
|
||||
var/list/L = alarms[cat]
|
||||
if (L.len)
|
||||
for (var/alarm in L)
|
||||
var/list/alm = L[alarm]
|
||||
var/area/A = alm[1]
|
||||
var/C = alm[2]
|
||||
var/list/sources = alm[3]
|
||||
dat += "<NOBR>"
|
||||
if (C && istype(C, /list))
|
||||
var/dat2 = ""
|
||||
for (var/obj/machinery/camera/I in C)
|
||||
dat2 += text("[]<A HREF=?src=\ref[];switchcamera=\ref[]>[]</A>", (dat2=="") ? "" : " | ", src, I, I.c_tag)
|
||||
dat += text("-- [] ([])", A.name, (dat2!="") ? dat2 : "No Camera")
|
||||
else if (C && istype(C, /obj/machinery/camera))
|
||||
var/obj/machinery/camera/Ctmp = C
|
||||
dat += text("-- [] (<A HREF=?src=\ref[];switchcamera=\ref[]>[]</A>)", A.name, src, C, Ctmp.c_tag)
|
||||
else
|
||||
dat += text("-- [] (No Camera)", A.name)
|
||||
if (sources.len > 1)
|
||||
dat += text("- [] sources", sources.len)
|
||||
dat += "</NOBR><BR>\n"
|
||||
else
|
||||
dat += "-- All Systems Nominal<BR>\n"
|
||||
dat += "<BR>\n"
|
||||
|
||||
viewalerts = 1
|
||||
src << browse(dat, "window=aialerts&can_close=0")
|
||||
|
||||
// this verb lets the ai see the stations manifest
|
||||
/mob/living/silicon/ai/proc/ai_roster()
|
||||
set name = "Show Crew Manifest"
|
||||
@@ -495,7 +456,7 @@ var/list/ai_verbs_default = list(
|
||||
if (href_list["switchcamera"])
|
||||
switchCamera(locate(href_list["switchcamera"])) in cameranet.cameras
|
||||
if (href_list["showalerts"])
|
||||
ai_alerts()
|
||||
subsystem_alarm_monitor()
|
||||
if(href_list["show_paper"])
|
||||
if(last_paper_seen)
|
||||
src << browse(last_paper_seen, "window=show_paper")
|
||||
@@ -721,60 +682,6 @@ var/list/ai_verbs_default = list(
|
||||
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/ai/triggerAlarm(var/class, area/A, var/O, var/alarmsource)
|
||||
if (stat == 2)
|
||||
return 1
|
||||
var/list/L = alarms[class]
|
||||
for (var/I in L)
|
||||
if (I == A.name)
|
||||
var/list/alarm = L[I]
|
||||
var/list/sources = alarm[3]
|
||||
if (!(alarmsource in sources))
|
||||
sources += alarmsource
|
||||
return 1
|
||||
var/obj/machinery/camera/C = null
|
||||
var/list/CL = null
|
||||
if (O && istype(O, /list))
|
||||
CL = O
|
||||
if (CL.len == 1)
|
||||
C = CL[1]
|
||||
else if (O && istype(O, /obj/machinery/camera))
|
||||
C = O
|
||||
L[A.name] = list(A, (C) ? C : O, list(alarmsource))
|
||||
if (O)
|
||||
if (C && C.can_use())
|
||||
queueAlarm("--- [class] alarm detected in [A.name]! (<A HREF=?src=\ref[src];switchcamera=\ref[C]>[C.c_tag]</A>)", class)
|
||||
else if (CL && CL.len)
|
||||
var/foo = 0
|
||||
var/dat2 = ""
|
||||
for (var/obj/machinery/camera/I in CL)
|
||||
dat2 += text("[]<A HREF=?src=\ref[];switchcamera=\ref[]>[]</A>", (!foo) ? "" : " | ", src, I, I.c_tag) //I'm not fixing this shit...
|
||||
foo = 1
|
||||
queueAlarm(text ("--- [] alarm detected in []! ([])", class, A.name, dat2), class)
|
||||
else
|
||||
queueAlarm(text("--- [] alarm detected in []! (No Camera)", class, A.name), class)
|
||||
else
|
||||
queueAlarm(text("--- [] alarm detected in []! (No Camera)", class, A.name), class)
|
||||
if (viewalerts) ai_alerts()
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/ai/cancelAlarm(var/class, area/A as area, obj/origin)
|
||||
var/list/L = alarms[class]
|
||||
var/cleared = 0
|
||||
for (var/I in L)
|
||||
if (I == A.name)
|
||||
var/list/alarm = L[I]
|
||||
var/list/srcs = alarm[3]
|
||||
if (origin in srcs)
|
||||
srcs -= origin
|
||||
if (srcs.len == 0)
|
||||
cleared = 1
|
||||
L -= I
|
||||
if (cleared)
|
||||
queueAlarm(text("--- [] alarm in [] has been cleared.", class, A.name), class, 0)
|
||||
if (viewalerts) ai_alerts()
|
||||
return !cleared
|
||||
|
||||
//Replaces /mob/living/silicon/ai/verb/change_network() in ai.dm & camera.dm
|
||||
//Adds in /mob/living/silicon/ai/proc/ai_network_change() instead
|
||||
//Addition by Mord_Sith to define AI's network change ability
|
||||
|
||||
@@ -23,10 +23,6 @@
|
||||
death()
|
||||
return
|
||||
|
||||
if (src.machine)
|
||||
if (!( src.machine.check_eye(src) ))
|
||||
src.reset_view(null)
|
||||
|
||||
// Handle power damage (oxy)
|
||||
if(src:aiRestorePowerRoutine != 0)
|
||||
// Lost power
|
||||
@@ -177,6 +173,7 @@
|
||||
sleep(50)
|
||||
theAPC = null
|
||||
|
||||
process_queued_alarms()
|
||||
regular_hud_updates()
|
||||
switch(src.sensor_mode)
|
||||
if (SEC_HUD)
|
||||
@@ -192,4 +189,13 @@
|
||||
if(fire_res_on_core)
|
||||
health = 100 - getOxyLoss() - getToxLoss() - getBruteLoss()
|
||||
else
|
||||
health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss()
|
||||
health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss()
|
||||
|
||||
/mob/living/silicon/ai/proc/lacks_power()
|
||||
var/turf/T = get_turf(src)
|
||||
var/area/A = get_area(src)
|
||||
return ((!A.power_equip) && A.requires_power == 1 || istype(T, /turf/space)) && !istype(src.loc,/obj/item)
|
||||
|
||||
/mob/living/silicon/ai/rejuvenate()
|
||||
..()
|
||||
add_ai_verbs(src)
|
||||
@@ -1,11 +0,0 @@
|
||||
/mob/living/silicon/ai
|
||||
var/obj/nano_module/crew_monitor/crew_monitor
|
||||
|
||||
/mob/living/silicon/ai/proc/init_subsystems()
|
||||
crew_monitor = new(src)
|
||||
|
||||
/mob/living/silicon/ai/proc/nano_crew_monitor()
|
||||
set category = "AI Commands"
|
||||
set name = "Crew Monitor"
|
||||
|
||||
crew_monitor.ui_interact(usr)
|
||||
@@ -268,6 +268,18 @@
|
||||
src.reset_view(C)
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/pai/verb/reset_record_view()
|
||||
set category = "pAI Commands"
|
||||
set name = "Reset Records Software"
|
||||
|
||||
securityActive1 = null
|
||||
securityActive2 = null
|
||||
security_cannotfind = 0
|
||||
medicalActive1 = null
|
||||
medicalActive2 = null
|
||||
medical_cannotfind = 0
|
||||
nanomanager.update_uis(src)
|
||||
usr << "<span class='notice'>You reset your record-viewing software.</span>"
|
||||
|
||||
/mob/living/silicon/pai/cancel_camera()
|
||||
set category = "pAI Commands"
|
||||
|
||||
@@ -15,7 +15,7 @@ var/global/list/pai_software_by_key = list()
|
||||
var/global/list/default_pai_software = list()
|
||||
/hook/startup/proc/populate_pai_software_list()
|
||||
var/r = 1 // I would use ., but it'd sacrifice runtime detection
|
||||
for(var/type in typesof(/datum/pai_software) - /datum/pai_software)
|
||||
for(var/type in subtypesof(/datum/pai_software))
|
||||
var/datum/pai_software/P = new type()
|
||||
if(pai_software_by_key[P.id])
|
||||
var/datum/pai_software/O = pai_software_by_key[P.id]
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
on_ui_interact(mob/living/silicon/pai/user, datum/nanoui/ui=null, force_open=1)
|
||||
|
||||
var/data[0]
|
||||
data["manifest"] = data_core.get_manifest_json()
|
||||
data["manifest"] = list("__json_cache" = ManifestJSON)
|
||||
|
||||
ui = nanomanager.try_update_ui(user, user, id, ui, data, force_open)
|
||||
if(!ui)
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
update_canmove()
|
||||
if(camera)
|
||||
camera.status = 0
|
||||
update_headlamp(1) //So borg lights are disabled when killed.
|
||||
|
||||
if(in_contents_of(/obj/machinery/recharge_station))//exit the recharge station
|
||||
var/obj/machinery/recharge_station/RC = loc
|
||||
@@ -60,8 +61,7 @@
|
||||
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
|
||||
see_in_dark = 8
|
||||
see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
updateicon()
|
||||
update_fire()
|
||||
update_icons()
|
||||
tod = worldtime2text() //weasellos time of death patch
|
||||
if(mind) mind.store_memory("Time of death: [tod]", 0)
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
|
||||
//Some tidying-up.
|
||||
flavor_text = "It's a tiny little repair drone. The casing is stamped with an NT logo and the subscript: 'Nanotrasen Recursive Repair Systems: Fixing Tomorrow's Problem, Today!'"
|
||||
updateicon()
|
||||
update_icons()
|
||||
|
||||
/mob/living/silicon/robot/drone/init()
|
||||
laws = new /datum/ai_laws/drone()
|
||||
@@ -80,7 +80,7 @@
|
||||
real_name = "maintenance drone ([rand(100,999)])"
|
||||
name = real_name
|
||||
|
||||
/mob/living/silicon/robot/drone/updateicon()
|
||||
/mob/living/silicon/robot/drone/update_icons()
|
||||
|
||||
overlays.Cut()
|
||||
if(stat == 0)
|
||||
@@ -318,3 +318,9 @@
|
||||
else
|
||||
src << "<span class='warning'>You are too small to pull that.</span>"
|
||||
return
|
||||
|
||||
/mob/living/silicon/robot/drone/add_robot_verbs()
|
||||
src.verbs |= silicon_subsystems
|
||||
|
||||
/mob/living/silicon/robot/drone/remove_robot_verbs()
|
||||
src.verbs -= silicon_subsystems
|
||||
@@ -15,11 +15,7 @@
|
||||
if(istype(O,/obj/item/borg/sight))
|
||||
var/obj/item/borg/sight/S = O
|
||||
sight_mode &= ~S.sight_mode
|
||||
else if(istype(O, /obj/item/device/flashlight))
|
||||
var/obj/item/device/flashlight/F = O
|
||||
if(F.on)
|
||||
F.on = 0
|
||||
F.update_brightness(src)
|
||||
|
||||
if(client)
|
||||
client.screen -= O
|
||||
contents -= O
|
||||
|
||||
@@ -110,8 +110,8 @@
|
||||
if(0) laws = new /datum/ai_laws/asimov()
|
||||
if(1) laws = new /datum/ai_laws/custom()
|
||||
if(2)
|
||||
var/datum/ai_laws/lawtype = pick(typesof(/datum/ai_laws/default) - /datum/ai_laws/default)
|
||||
laws = new lawtype()
|
||||
var/datum/ai_laws/lawtype = pick(subtypesof(/datum/ai_laws/default))
|
||||
laws = new lawtype()
|
||||
|
||||
/mob/living/silicon/robot/proc/statelaws() // -- TLE
|
||||
// set category = "AI Commands"
|
||||
@@ -200,4 +200,4 @@
|
||||
|
||||
list += {"<br><br><A href='byond://?src=\ref[src];laws=1'>State Laws</A>"}
|
||||
|
||||
usr << browse(list, "window=laws")
|
||||
usr << browse(list, "window=laws")
|
||||
@@ -19,6 +19,7 @@
|
||||
if (src.stat != DEAD) //still using power
|
||||
use_power()
|
||||
process_locks()
|
||||
process_queued_alarms()
|
||||
|
||||
update_canmove()
|
||||
|
||||
@@ -42,7 +43,8 @@
|
||||
if (is_component_functioning("power cell") && cell)
|
||||
if(src.cell.charge <= 0)
|
||||
uneq_all()
|
||||
src.stat = 1
|
||||
update_headlamp(1)
|
||||
src.stat = UNCONSCIOUS
|
||||
has_power = 0
|
||||
for(var/V in components)
|
||||
var/datum/robot_component/C = components[V]
|
||||
@@ -63,6 +65,9 @@
|
||||
for(var/V in components)
|
||||
var/datum/robot_component/C = components[V]
|
||||
C.consume_power()
|
||||
|
||||
var/amt = Clamp((lamp_intensity - 2) * 2,1,cell.charge) //Always try to use at least one charge per tick, but allow it to completely drain the cell.
|
||||
cell.use(amt) //Usage table: 1/tick if off/lowest setting, 4 = 4/tick, 6 = 8/tick, 8 = 12/tick, 10 = 16/tick
|
||||
|
||||
if(!is_component_functioning("actuator"))
|
||||
Paralyse(3)
|
||||
@@ -71,7 +76,8 @@
|
||||
has_power = 1
|
||||
else
|
||||
uneq_all()
|
||||
src.stat = 1
|
||||
src.stat = UNCONSCIOUS
|
||||
update_headlamp(1)
|
||||
Paralyse(3)
|
||||
|
||||
/mob/living/silicon/robot/proc/handle_regular_status_updates()
|
||||
@@ -324,7 +330,7 @@
|
||||
src.module_state_2:screen_loc = ui_inv2
|
||||
if(src.module_state_3)
|
||||
src.module_state_3:screen_loc = ui_inv3
|
||||
updateicon()
|
||||
update_icons()
|
||||
|
||||
/mob/living/silicon/robot/proc/process_locks()
|
||||
if(weapon_lock)
|
||||
@@ -358,8 +364,6 @@
|
||||
overlays -= image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing")
|
||||
if(on_fire)
|
||||
overlays += image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing")
|
||||
update_icons()
|
||||
return
|
||||
|
||||
/mob/living/silicon/robot/fire_act()
|
||||
if(!on_fire) //Silicons don't gain stacks from hotspots, but hotspots can ignite them
|
||||
|
||||
@@ -22,6 +22,7 @@ var/list/robot_verbs_default = list(
|
||||
var/obj/screen/inv1 = null
|
||||
var/obj/screen/inv2 = null
|
||||
var/obj/screen/inv3 = null
|
||||
var/obj/screen/lamp_button = null
|
||||
|
||||
var/shown_robot_modules = 0 //Used to determine whether they have the module menu shown or not
|
||||
var/obj/screen/robot_modules_background
|
||||
@@ -74,6 +75,12 @@ var/list/robot_verbs_default = list(
|
||||
var/braintype = "Cyborg"
|
||||
var/base_icon = ""
|
||||
var/crisis = 0
|
||||
|
||||
var/lamp_max = 10 //Maximum brightness of a borg lamp. Set as a var for easy adjusting.
|
||||
var/lamp_intensity = 0 //Luminosity of the headlamp. 0 is off. Higher settings than the minimum require power.
|
||||
var/lamp_recharging = 0 //Flag for if the lamp is on cooldown after being forcibly disabled.
|
||||
|
||||
var/jetpackoverlay = 0
|
||||
|
||||
var/obj/item/borg/sight/hud/sec/sechud = null
|
||||
var/obj/item/borg/sight/hud/med/healthhud = null
|
||||
@@ -92,7 +99,8 @@ var/list/robot_verbs_default = list(
|
||||
robot_modules_background.layer = 19 //Objects that appear on screen are on layer 20, UI should be just below it.
|
||||
ident = rand(1, 999)
|
||||
updatename("Default")
|
||||
updateicon()
|
||||
update_icons()
|
||||
update_headlamp()
|
||||
|
||||
radio = new /obj/item/device/radio/borg(src)
|
||||
common_radio = radio
|
||||
@@ -292,6 +300,8 @@ var/list/robot_verbs_default = list(
|
||||
|
||||
//languages
|
||||
module.add_languages(src)
|
||||
//subsystems
|
||||
module.add_subsystems(src)
|
||||
|
||||
//Custom_sprite check and entry
|
||||
if (custom_sprite == 1)
|
||||
@@ -364,12 +374,7 @@ var/list/robot_verbs_default = list(
|
||||
custom_name = newname
|
||||
|
||||
updatename()
|
||||
updateicon()
|
||||
|
||||
/mob/living/silicon/robot/verb/cmd_robot_alerts()
|
||||
set category = "Robot Commands"
|
||||
set name = "Show Alerts"
|
||||
robot_alerts()
|
||||
update_icons()
|
||||
|
||||
// this verb lets cyborgs see the stations manifest
|
||||
/mob/living/silicon/robot/verb/cmd_station_manifest()
|
||||
@@ -377,30 +382,6 @@ var/list/robot_verbs_default = list(
|
||||
set name = "Show Station Manifest"
|
||||
show_station_manifest()
|
||||
|
||||
|
||||
/mob/living/silicon/robot/proc/robot_alerts()
|
||||
var/dat = "<HEAD><TITLE>Current Station Alerts</TITLE><META HTTP-EQUIV='Refresh' CONTENT='10'></HEAD><BODY>\n"
|
||||
dat += "<A HREF='?src=\ref[src];mach_close=robotalerts'>Close</A><BR><BR>"
|
||||
for (var/cat in alarms)
|
||||
dat += text("<B>[cat]</B><BR>\n")
|
||||
var/list/L = alarms[cat]
|
||||
if (L.len)
|
||||
for (var/alarm in L)
|
||||
var/list/alm = L[alarm]
|
||||
var/area/A = alm[1]
|
||||
var/list/sources = alm[3]
|
||||
dat += "<NOBR>" // wat
|
||||
dat += text("-- [A.name]")
|
||||
if (sources.len > 1)
|
||||
dat += text("- [sources.len] sources")
|
||||
dat += "</NOBR><BR>\n"
|
||||
else
|
||||
dat += "-- All Systems Nominal<BR>\n"
|
||||
dat += "<BR>\n"
|
||||
|
||||
viewalerts = 1
|
||||
src << browse(dat, "window=robotalerts&can_close=0")
|
||||
|
||||
/mob/living/silicon/robot/proc/self_diagnosis()
|
||||
if(!is_component_functioning("diagnosis unit"))
|
||||
return null
|
||||
@@ -412,7 +393,6 @@ var/list/robot_verbs_default = list(
|
||||
|
||||
return dat
|
||||
|
||||
|
||||
/mob/living/silicon/robot/verb/self_diagnosis_verb()
|
||||
set category = "Robot Commands"
|
||||
set name = "Self Diagnosis"
|
||||
@@ -456,9 +436,11 @@ var/list/robot_verbs_default = list(
|
||||
|
||||
/mob/living/silicon/robot/proc/add_robot_verbs()
|
||||
src.verbs |= robot_verbs_default
|
||||
src.verbs |= silicon_subsystems
|
||||
|
||||
/mob/living/silicon/robot/proc/remove_robot_verbs()
|
||||
src.verbs -= robot_verbs_default
|
||||
src.verbs -= silicon_subsystems
|
||||
|
||||
/mob/living/silicon/robot/blob_act()
|
||||
if (stat != 2)
|
||||
@@ -582,50 +564,6 @@ var/list/robot_verbs_default = list(
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
/mob/living/silicon/robot/triggerAlarm(var/class, area/A, var/O, var/alarmsource)
|
||||
if (stat == 2)
|
||||
return 1
|
||||
var/list/L = alarms[class]
|
||||
for (var/I in L)
|
||||
if (I == A.name)
|
||||
var/list/alarm = L[I]
|
||||
var/list/sources = alarm[3]
|
||||
if (!(alarmsource in sources))
|
||||
sources += alarmsource
|
||||
return 1
|
||||
var/obj/machinery/camera/C = null
|
||||
var/list/CL = null
|
||||
if (O && istype(O, /list))
|
||||
CL = O
|
||||
if (CL.len == 1)
|
||||
C = CL[1]
|
||||
else if (O && istype(O, /obj/machinery/camera))
|
||||
C = O
|
||||
L[A.name] = list(A, (C) ? C : O, list(alarmsource))
|
||||
queueAlarm(text("--- [class] alarm detected in [A.name]!"), class)
|
||||
// if (viewalerts) robot_alerts()
|
||||
return 1
|
||||
|
||||
|
||||
/mob/living/silicon/robot/cancelAlarm(var/class, area/A as area, obj/origin)
|
||||
var/list/L = alarms[class]
|
||||
var/cleared = 0
|
||||
for (var/I in L)
|
||||
if (I == A.name)
|
||||
var/list/alarm = L[I]
|
||||
var/list/srcs = alarm[3]
|
||||
if (origin in srcs)
|
||||
srcs -= origin
|
||||
if (srcs.len == 0)
|
||||
cleared = 1
|
||||
L -= I
|
||||
if (cleared)
|
||||
queueAlarm(text("--- [class] alarm in [A.name] has been cleared."), class, 0)
|
||||
// if (viewalerts) robot_alerts()
|
||||
return !cleared
|
||||
|
||||
|
||||
/mob/living/silicon/robot/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
|
||||
if (istype(W, /obj/item/weapon/restraints/handcuffs)) // fuck i don't even know why isrobot() in handcuff code isn't working so this will have to do
|
||||
return
|
||||
@@ -683,7 +621,7 @@ var/list/robot_verbs_default = list(
|
||||
if(cell)
|
||||
user << "You close the cover."
|
||||
opened = 0
|
||||
updateicon()
|
||||
update_icons()
|
||||
else if(wiresexposed && wires.IsAllCut())
|
||||
//Cell is out, wires are exposed, remove MMI, produce damaged chassis, baleet original mob.
|
||||
if(!mmi)
|
||||
@@ -735,7 +673,7 @@ var/list/robot_verbs_default = list(
|
||||
else
|
||||
user << "You open the cover."
|
||||
opened = 1
|
||||
updateicon()
|
||||
update_icons()
|
||||
|
||||
else if (istype(W, /obj/item/weapon/stock_parts/cell) && opened) // trying to put a cell inside
|
||||
var/datum/robot_component/C = components["power cell"]
|
||||
@@ -765,14 +703,14 @@ var/list/robot_verbs_default = list(
|
||||
else if(istype(W, /obj/item/weapon/screwdriver) && opened && !cell) // haxing
|
||||
wiresexposed = !wiresexposed
|
||||
user << "The wires have been [wiresexposed ? "exposed" : "unexposed"]"
|
||||
updateicon()
|
||||
update_icons()
|
||||
|
||||
else if(istype(W, /obj/item/weapon/screwdriver) && opened && cell) // radio
|
||||
if(radio)
|
||||
radio.attackby(W,user)//Push it to the radio to let it handle everything
|
||||
else
|
||||
user << "Unable to locate a radio."
|
||||
updateicon()
|
||||
update_icons()
|
||||
|
||||
else if(istype(W, /obj/item/device/encryptionkey/) && opened)
|
||||
if(radio)//sanityyyyyy
|
||||
@@ -789,7 +727,7 @@ var/list/robot_verbs_default = list(
|
||||
if(allowed(usr))
|
||||
locked = !locked
|
||||
user << "You [ locked ? "lock" : "unlock"] [src]'s interface."
|
||||
updateicon()
|
||||
update_icons()
|
||||
else
|
||||
user << "\red Access denied."
|
||||
|
||||
@@ -864,14 +802,14 @@ var/list/robot_verbs_default = list(
|
||||
laws.show_laws(src)
|
||||
src << "\red \b ALERT: [M.real_name] is your new master. Obey your new laws and his commands."
|
||||
if(src.module && istype(src.module, /obj/item/weapon/robot_module/miner))
|
||||
for(var/obj/item/weapon/pickaxe/borgdrill/D in src.module.modules)
|
||||
for(var/obj/item/weapon/pickaxe/drill/cyborg/D in src.module.modules)
|
||||
qdel(D)
|
||||
src.module.modules += new /obj/item/weapon/pickaxe/diamonddrill(src.module)
|
||||
src.module.modules += new /obj/item/weapon/pickaxe/drill/cyborg/diamond(src.module)
|
||||
src.module.rebuild()
|
||||
if(src.module && istype(src.module, /obj/item/weapon/robot_module/medical))
|
||||
for(var/obj/item/weapon/borg_defib/F in src.module.modules)
|
||||
F.safety = 0
|
||||
updateicon()
|
||||
update_icons()
|
||||
return
|
||||
|
||||
/mob/living/silicon/robot/verb/unlock_own_cover()
|
||||
@@ -882,7 +820,7 @@ var/list/robot_verbs_default = list(
|
||||
switch(alert("You can not lock your cover again, are you sure?\n (You can still ask for a human to lock it)", "Unlock Own Cover", "Yes", "No"))
|
||||
if("Yes")
|
||||
locked = 0
|
||||
updateicon()
|
||||
update_icons()
|
||||
usr << "You unlock your cover."
|
||||
|
||||
/mob/living/silicon/robot/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
|
||||
@@ -991,7 +929,7 @@ var/list/robot_verbs_default = list(
|
||||
user.put_in_active_hand(cell)
|
||||
user << "You remove \the [cell]."
|
||||
cell = null
|
||||
updateicon()
|
||||
update_icons()
|
||||
|
||||
if(!opened && (!istype(user, /mob/living/silicon)))
|
||||
if (user.a_intent == "help")
|
||||
@@ -1023,12 +961,10 @@ var/list/robot_verbs_default = list(
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/robot/proc/updateicon()
|
||||
/mob/living/silicon/robot/update_icons()
|
||||
|
||||
overlays.Cut()
|
||||
if(stat == 0)
|
||||
overlays += "eyes"
|
||||
overlays.Cut()
|
||||
if(stat != DEAD && !(paralysis || stunned || weakened)) //Not dead, not stunned.
|
||||
overlays += "eyes-[icon_state]"
|
||||
else
|
||||
overlays -= "eyes"
|
||||
@@ -1059,16 +995,16 @@ var/list/robot_verbs_default = list(
|
||||
icon_state = "[base_icon]-roll"
|
||||
else
|
||||
icon_state = base_icon
|
||||
return
|
||||
|
||||
/mob/living/silicon/robot/proc/updatefire()
|
||||
return
|
||||
|
||||
if(jetpackoverlay)
|
||||
overlays += "minerjetpack-[icon_state]"
|
||||
update_fire()
|
||||
|
||||
//Call when target overlay should be added/removed
|
||||
/mob/living/silicon/robot/update_targeted()
|
||||
if(!targeted_by && target_locked)
|
||||
qdel(target_locked)
|
||||
updateicon()
|
||||
update_icons()
|
||||
if (targeted_by && target_locked)
|
||||
overlays += target_locked
|
||||
|
||||
@@ -1118,32 +1054,32 @@ var/list/robot_verbs_default = list(
|
||||
|
||||
|
||||
/mob/living/silicon/robot/Topic(href, href_list)
|
||||
..()
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
if(usr != src)
|
||||
return
|
||||
return 1
|
||||
|
||||
if (href_list["mach_close"])
|
||||
var/t1 = text("window=[href_list["mach_close"]]")
|
||||
unset_machine()
|
||||
src << browse(null, t1)
|
||||
return
|
||||
|
||||
|
||||
return 1
|
||||
|
||||
if (href_list["showalerts"])
|
||||
robot_alerts()
|
||||
return
|
||||
subsystem_alarm_monitor()
|
||||
return 1
|
||||
|
||||
if (href_list["mod"])
|
||||
var/obj/item/O = locate(href_list["mod"])
|
||||
if (istype(O) && (O.loc == src))
|
||||
O.attack_self(src)
|
||||
return 1
|
||||
|
||||
if (href_list["act"])
|
||||
var/obj/item/O = locate(href_list["act"])
|
||||
if (!istype(O) || !(O.loc == src || O.loc == src.module))
|
||||
return
|
||||
return 1
|
||||
|
||||
activate_module(O)
|
||||
installed_modules()
|
||||
@@ -1165,6 +1101,7 @@ var/list/robot_verbs_default = list(
|
||||
else
|
||||
src << "Module isn't activated"
|
||||
installed_modules()
|
||||
return 1
|
||||
|
||||
if (href_list["lawc"]) // Toggling whether or not a law gets stated by the State Laws verb --NeoFite
|
||||
var/L = text2num(href_list["lawc"])
|
||||
@@ -1173,6 +1110,7 @@ var/list/robot_verbs_default = list(
|
||||
if ("No") lawcheck[L+1] = "Yes"
|
||||
// src << text ("Switching Law [L]'s report status to []", lawcheck[L+1])
|
||||
checklaws()
|
||||
return 1
|
||||
|
||||
if (href_list["lawi"]) // Toggling whether or not a law gets stated by the State Laws verb --NeoFite
|
||||
var/L = text2num(href_list["lawi"])
|
||||
@@ -1181,14 +1119,42 @@ var/list/robot_verbs_default = list(
|
||||
if ("No") ioncheck[L] = "Yes"
|
||||
// src << text ("Switching Law [L]'s report status to []", lawcheck[L+1])
|
||||
checklaws()
|
||||
return 1
|
||||
|
||||
if (href_list["laws"]) // With how my law selection code works, I changed statelaws from a verb to a proc, and call it through my law selection panel. --NeoFite
|
||||
statelaws()
|
||||
return
|
||||
return 1
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/robot/proc/radio_menu()
|
||||
radio.interact(src)//Just use the radio's Topic() instead of bullshit special-snowflake code
|
||||
|
||||
/mob/living/silicon/robot/proc/control_headlamp()
|
||||
if(stat || lamp_recharging)
|
||||
src << "<span class='danger'>This function is currently offline.</span>"
|
||||
return
|
||||
|
||||
//Some sort of magical "modulo" thing which somehow increments lamp power by 2, until it hits the max and resets to 0.
|
||||
lamp_intensity = (lamp_intensity+2) % (lamp_max+2)
|
||||
src << "[lamp_intensity ? "Headlamp power set to Level [lamp_intensity/2]" : "Headlamp disabled."]"
|
||||
update_headlamp()
|
||||
|
||||
/mob/living/silicon/robot/proc/update_headlamp(var/turn_off = 0, var/cooldown = 100)
|
||||
set_light(0)
|
||||
|
||||
if(lamp_intensity && (turn_off || stat))
|
||||
src << "<span class='danger'>Your headlamp has been deactivated.</span>"
|
||||
lamp_intensity = 0
|
||||
lamp_recharging = 1
|
||||
spawn(cooldown) //10 seconds by default, if the source of the deactivation does not keep stat that long.
|
||||
lamp_recharging = 0
|
||||
else
|
||||
set_light(light_range + lamp_intensity)
|
||||
|
||||
if(lamp_button)
|
||||
lamp_button.icon_state = "lamp[lamp_intensity]"
|
||||
|
||||
update_icons()
|
||||
|
||||
/mob/living/silicon/robot/Move(a, b, flag)
|
||||
|
||||
@@ -1309,13 +1275,13 @@ var/list/robot_verbs_default = list(
|
||||
lockcharge = null
|
||||
return
|
||||
|
||||
overlays -= "eyes"
|
||||
updateicon()
|
||||
update_icons()
|
||||
|
||||
if (triesleft >= 1)
|
||||
var/choice = input("Look at your icon - is this what you want?") in list("Yes","No")
|
||||
if(choice=="No")
|
||||
choose_icon(triesleft, module_sprites)
|
||||
return
|
||||
else
|
||||
triesleft = 0
|
||||
return
|
||||
|
||||
@@ -9,32 +9,29 @@
|
||||
var/list/modules = list()
|
||||
var/obj/item/emag = null
|
||||
var/obj/item/borg/upgrade/jetpack = null
|
||||
var/list/subsystems = list()
|
||||
|
||||
var/list/stacktypes
|
||||
var/channels = list()
|
||||
|
||||
|
||||
emp_act(severity)
|
||||
if(modules)
|
||||
for(var/obj/O in modules)
|
||||
O.emp_act(severity)
|
||||
if(emag)
|
||||
emag.emp_act(severity)
|
||||
..()
|
||||
return
|
||||
/obj/item/weapon/robot_module/emp_act(severity)
|
||||
if(modules)
|
||||
for(var/obj/O in modules)
|
||||
O.emp_act(severity)
|
||||
if(emag)
|
||||
emag.emp_act(severity)
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
New()
|
||||
src.modules += new /obj/item/device/flashlight(src)
|
||||
src.modules += new /obj/item/device/flash/cyborg(src)
|
||||
src.emag = new /obj/item/toy/sword(src)
|
||||
src.emag.name = "Placeholder Emag Item"
|
||||
// src.jetpack = new /obj/item/toy/sword(src)
|
||||
// src.jetpack.name = "Placeholder Upgrade Item"
|
||||
return
|
||||
|
||||
/obj/item/weapon/robot_module/New()
|
||||
src.modules += new /obj/item/device/flashlight(src)
|
||||
src.modules += new /obj/item/device/flash/cyborg(src)
|
||||
src.emag = new /obj/item/toy/sword(src)
|
||||
src.emag.name = "Placeholder Emag Item"
|
||||
|
||||
/obj/item/weapon/robot_module/proc/respawn_consumable(var/mob/living/silicon/robot/R)
|
||||
|
||||
if(!stacktypes || !stacktypes.len) return
|
||||
|
||||
var/stack_respawned = 0
|
||||
@@ -77,13 +74,18 @@
|
||||
R.add_language("Chittin", 0)
|
||||
R.add_language("Bubblish", 0)
|
||||
R.add_language("Clownish",0)
|
||||
|
||||
/obj/item/weapon/robot_module/proc/add_subsystems(var/mob/living/silicon/robot/R)
|
||||
R.verbs |= subsystems
|
||||
|
||||
/obj/item/weapon/robot_module/proc/remove_subsystems(var/mob/living/silicon/robot/R)
|
||||
R.verbs -= subsystems
|
||||
|
||||
/obj/item/weapon/robot_module/standard
|
||||
name = "standard robot module"
|
||||
|
||||
|
||||
New()
|
||||
src.modules += new /obj/item/device/flashlight(src)
|
||||
src.modules += new /obj/item/device/flash/cyborg(src)
|
||||
src.modules += new /obj/item/weapon/melee/baton/loaded(src)
|
||||
src.modules += new /obj/item/weapon/extinguisher(src)
|
||||
@@ -95,15 +97,15 @@
|
||||
|
||||
/obj/item/weapon/robot_module/medical
|
||||
name = "medical robot module"
|
||||
subsystems = list(/mob/living/silicon/proc/subsystem_crew_monitor)
|
||||
stacktypes = list(
|
||||
/obj/item/stack/medical/advanced/bruise_pack = 5,
|
||||
/obj/item/stack/medical/advanced/ointment = 5,
|
||||
/obj/item/stack/medical/splint = 5,
|
||||
/obj/item/stack/nanopaste = 5
|
||||
)
|
||||
|
||||
|
||||
New()
|
||||
src.modules += new /obj/item/device/flashlight(src)
|
||||
src.modules += new /obj/item/device/flash/cyborg(src)
|
||||
src.modules += new /obj/item/device/healthanalyzer/advanced(src)
|
||||
src.modules += new /obj/item/device/reagent_scanner/adv(src)
|
||||
@@ -142,6 +144,7 @@
|
||||
|
||||
/obj/item/weapon/robot_module/engineering
|
||||
name = "engineering robot module"
|
||||
subsystems = list(/mob/living/silicon/proc/subsystem_power_monitor)
|
||||
|
||||
stacktypes = list(
|
||||
/obj/item/stack/sheet/metal = 50,
|
||||
@@ -153,7 +156,6 @@
|
||||
)
|
||||
|
||||
New()
|
||||
src.modules += new /obj/item/device/flashlight(src)
|
||||
src.modules += new /obj/item/device/flash/cyborg(src)
|
||||
src.modules += new /obj/item/borg/sight/meson(src)
|
||||
src.modules += new /obj/item/weapon/rcd/borg(src)
|
||||
@@ -200,10 +202,10 @@
|
||||
|
||||
/obj/item/weapon/robot_module/security
|
||||
name = "security robot module"
|
||||
subsystems = list(/mob/living/silicon/proc/subsystem_crew_monitor)
|
||||
|
||||
|
||||
New()
|
||||
src.modules += new /obj/item/device/flashlight/seclite(src)
|
||||
src.modules += new /obj/item/device/flash/cyborg(src)
|
||||
src.modules += new /obj/item/weapon/restraints/handcuffs/cable/zipties/cyborg(src)
|
||||
src.modules += new /obj/item/weapon/melee/baton/loaded/robot(src)
|
||||
@@ -219,7 +221,6 @@
|
||||
|
||||
|
||||
New()
|
||||
src.modules += new /obj/item/device/flashlight(src)
|
||||
src.modules += new /obj/item/device/flash/cyborg(src)
|
||||
src.modules += new /obj/item/weapon/soap/nanotrasen(src)
|
||||
src.modules += new /obj/item/weapon/storage/bag/trash/cyborg(src)
|
||||
@@ -239,7 +240,6 @@
|
||||
|
||||
|
||||
New()
|
||||
src.modules += new /obj/item/device/flashlight(src)
|
||||
src.modules += new /obj/item/device/flash/cyborg(src)
|
||||
src.modules += new /obj/item/weapon/reagent_containers/food/drinks/cans/beer(src)
|
||||
src.modules += new /obj/item/weapon/reagent_containers/food/condiment/enzyme(src)
|
||||
@@ -309,14 +309,15 @@
|
||||
|
||||
|
||||
New()
|
||||
src.modules += new /obj/item/device/flashlight/lantern(src)
|
||||
src.modules += new /obj/item/device/flash/cyborg(src)
|
||||
src.modules += new /obj/item/borg/sight/meson(src)
|
||||
src.modules += new /obj/item/weapon/wrench(src)
|
||||
src.modules += new /obj/item/weapon/screwdriver(src)
|
||||
src.modules += new /obj/item/weapon/storage/bag/ore(src)
|
||||
src.modules += new /obj/item/weapon/pickaxe/borgdrill(src)
|
||||
src.modules += new /obj/item/device/t_scanner/adv_mining_scanner/cyborg(src)
|
||||
src.modules += new /obj/item/weapon/storage/bag/ore/cyborg(src)
|
||||
src.modules += new /obj/item/weapon/pickaxe/drill/cyborg(src)
|
||||
src.modules += new /obj/item/weapon/storage/bag/sheetsnatcher/borg(src)
|
||||
src.modules += new /obj/item/weapon/gun/energy/kinetic_accelerator/cyborg(src)
|
||||
src.emag = new /obj/item/borg/stun(src)
|
||||
return
|
||||
|
||||
@@ -325,7 +326,6 @@
|
||||
|
||||
/obj/item/weapon/robot_module/deathsquad/New()
|
||||
src.modules += new /obj/item/device/flash/cyborg(src)
|
||||
src.modules += new /obj/item/device/flashlight(src)
|
||||
src.modules += new /obj/item/borg/sight/thermal(src)
|
||||
src.modules += new /obj/item/weapon/melee/energy/sword/cyborg(src)
|
||||
src.modules += new /obj/item/weapon/gun/energy/pulse_rifle/cyborg(src)
|
||||
@@ -339,7 +339,6 @@
|
||||
|
||||
/obj/item/weapon/robot_module/syndicate/New()
|
||||
src.modules += new /obj/item/device/flash/cyborg(src)
|
||||
src.modules += new /obj/item/device/flashlight(src)
|
||||
src.modules += new /obj/item/weapon/melee/energy/sword/cyborg(src)
|
||||
src.modules += new /obj/item/weapon/gun/energy/printer(src)
|
||||
src.modules += new /obj/item/weapon/gun/projectile/revolver/grenadelauncher/multi/cyborg(src)
|
||||
@@ -354,11 +353,10 @@
|
||||
name = "combat robot module"
|
||||
|
||||
New()
|
||||
src.modules += new /obj/item/device/flashlight(src)
|
||||
src.modules += new /obj/item/device/flash/cyborg(src)
|
||||
src.modules += new /obj/item/borg/sight/thermal(src)
|
||||
src.modules += new /obj/item/weapon/gun/energy/laser/cyborg(src)
|
||||
src.modules += new /obj/item/weapon/pickaxe/plasmacutter(src)
|
||||
src.modules += new /obj/item/weapon/gun/energy/plasmacutter(src)
|
||||
src.modules += new /obj/item/borg/combat/shield(src)
|
||||
src.modules += new /obj/item/borg/combat/mobility(src)
|
||||
src.modules += new /obj/item/weapon/wrench(src) //Is a combat android really going to be stopped by a chair?
|
||||
@@ -413,8 +411,7 @@
|
||||
src.modules += new /obj/item/weapon/reagent_containers/spray/cleaner/drone(src)
|
||||
src.modules += new /obj/item/weapon/soap(src)
|
||||
|
||||
src.emag = new /obj/item/weapon/pickaxe/plasmacutter(src)
|
||||
src.emag.name = "Plasma Cutter"
|
||||
src.emag = new /obj/item/weapon/pickaxe/drill/cyborg/diamond(src)
|
||||
|
||||
for(var/T in stacktypes)
|
||||
var/obj/item/stack/sheet/W = new T(src)
|
||||
|
||||
@@ -17,91 +17,29 @@
|
||||
var/speak_exclamation = "declares"
|
||||
var/speak_query = "queries"
|
||||
var/pose //Yes, now AIs can pose too.
|
||||
|
||||
var/sensor_mode = 0 //Determines the current HUD.
|
||||
|
||||
var/next_alarm_notice
|
||||
var/list/datum/alarm/queued_alarms = new()
|
||||
|
||||
#define SEC_HUD 1 //Security HUD mode
|
||||
#define MED_HUD 2 //Medical HUD mode
|
||||
var/local_transmit //If set, can only speak to others of the same type within a short range.
|
||||
var/obj/item/device/radio/common_radio
|
||||
|
||||
/mob/living/silicon/proc/cancelAlarm()
|
||||
return
|
||||
|
||||
/mob/living/silicon/proc/triggerAlarm()
|
||||
return
|
||||
|
||||
/mob/living/silicon/New()
|
||||
..()
|
||||
init_subsystems()
|
||||
|
||||
/mob/living/silicon/Destroy()
|
||||
for(var/datum/alarm_handler/AH in alarm_manager.all_handlers)
|
||||
AH.unregister(src)
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/proc/show_laws()
|
||||
return
|
||||
|
||||
/mob/living/silicon/proc/queueAlarm(var/message, var/type, var/incoming = 1)
|
||||
var/in_cooldown = (alarms_to_show.len > 0 || alarms_to_clear.len > 0)
|
||||
if(incoming)
|
||||
alarms_to_show += message
|
||||
alarm_types_show[type] += 1
|
||||
else
|
||||
alarms_to_clear += message
|
||||
alarm_types_clear[type] += 1
|
||||
|
||||
if(!in_cooldown)
|
||||
spawn(10 * 10) // 10 seconds
|
||||
|
||||
if(alarms_to_show.len < 5)
|
||||
for(var/msg in alarms_to_show)
|
||||
src << msg
|
||||
else if(alarms_to_show.len)
|
||||
|
||||
var/msg = "--- "
|
||||
|
||||
if(alarm_types_show["Motion"])
|
||||
msg += "MOTION: [alarm_types_show["Motion"]] alarms detected. - "
|
||||
|
||||
if(alarm_types_show["Fire"])
|
||||
msg += "FIRE: [alarm_types_show["Fire"]] alarms detected. - "
|
||||
|
||||
if(alarm_types_show["Atmosphere"])
|
||||
msg += "ATMOSPHERE: [alarm_types_show["Atmosphere"]] alarms detected. - "
|
||||
|
||||
if(alarm_types_show["Power"])
|
||||
msg += "POWER: [alarm_types_show["Power"]] alarms detected. - "
|
||||
|
||||
if(alarm_types_show["Camera"])
|
||||
msg += "CAMERA: [alarm_types_show["Power"]] alarms detected. - "
|
||||
|
||||
msg += "<A href=?src=\ref[src];showalerts=1'>\[Show Alerts\]</a>"
|
||||
src << msg
|
||||
|
||||
if(alarms_to_clear.len < 3)
|
||||
for(var/msg in alarms_to_clear)
|
||||
src << msg
|
||||
|
||||
else if(alarms_to_clear.len)
|
||||
var/msg = "--- "
|
||||
|
||||
if(alarm_types_clear["Motion"])
|
||||
msg += "MOTION: [alarm_types_clear["Motion"]] alarms cleared. - "
|
||||
|
||||
if(alarm_types_clear["Fire"])
|
||||
msg += "FIRE: [alarm_types_clear["Fire"]] alarms cleared. - "
|
||||
|
||||
if(alarm_types_clear["Atmosphere"])
|
||||
msg += "ATMOSPHERE: [alarm_types_clear["Atmosphere"]] alarms cleared. - "
|
||||
|
||||
if(alarm_types_clear["Power"])
|
||||
msg += "POWER: [alarm_types_clear["Power"]] alarms cleared. - "
|
||||
|
||||
if(alarm_types_show["Camera"])
|
||||
msg += "CAMERA: [alarm_types_show["Power"]] alarms detected. - "
|
||||
|
||||
msg += "<A href=?src=\ref[src];showalerts=1'>\[Show Alerts\]</a>"
|
||||
src << msg
|
||||
|
||||
|
||||
alarms_to_show = list()
|
||||
alarms_to_clear = list()
|
||||
for(var/i = 1; i < alarm_types_show.len; i++)
|
||||
alarm_types_show[i] = 0
|
||||
for(var/i = 1; i < alarm_types_clear.len; i++)
|
||||
alarm_types_clear[i] = 0
|
||||
|
||||
/mob/living/silicon/drop_item()
|
||||
return
|
||||
|
||||
@@ -323,4 +261,62 @@
|
||||
src << "Sensor augmentations disabled."
|
||||
|
||||
/mob/living/silicon/IsAdvancedToolUser()
|
||||
return 1
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/proc/receive_alarm(var/datum/alarm_handler/alarm_handler, var/datum/alarm/alarm, was_raised)
|
||||
if(!next_alarm_notice)
|
||||
next_alarm_notice = world.time + SecondsToTicks(10)
|
||||
|
||||
var/list/alarms = queued_alarms[alarm_handler]
|
||||
if(was_raised)
|
||||
// Raised alarms are always set
|
||||
alarms[alarm] = 1
|
||||
else
|
||||
// Alarms that were raised but then cleared before the next notice are instead removed
|
||||
if(alarm in alarms)
|
||||
alarms -= alarm
|
||||
// And alarms that have only been cleared thus far are set as such
|
||||
else
|
||||
alarms[alarm] = -1
|
||||
|
||||
/mob/living/silicon/proc/process_queued_alarms()
|
||||
if(next_alarm_notice && (world.time > next_alarm_notice))
|
||||
next_alarm_notice = 0
|
||||
|
||||
var/alarm_raised = 0
|
||||
for(var/datum/alarm_handler/AH in queued_alarms)
|
||||
var/list/alarms = queued_alarms[AH]
|
||||
var/reported = 0
|
||||
for(var/datum/alarm/A in alarms)
|
||||
if(alarms[A] == 1)
|
||||
if(!reported)
|
||||
reported = 1
|
||||
src << "<span class='warning'>--- [AH.category] Detected ---</span>"
|
||||
raised_alarm(A)
|
||||
|
||||
for(var/datum/alarm_handler/AH in queued_alarms)
|
||||
var/list/alarms = queued_alarms[AH]
|
||||
var/reported = 0
|
||||
for(var/datum/alarm/A in alarms)
|
||||
if(alarms[A] == -1)
|
||||
if(!reported)
|
||||
reported = 1
|
||||
src << "<span class='notice'>--- [AH.category] Cleared ---</span>"
|
||||
src << "\The [A.alarm_name()]."
|
||||
|
||||
if(alarm_raised)
|
||||
src << "<A HREF=?src=\ref[src];showalerts=1>\[Show Alerts\]</A>"
|
||||
|
||||
for(var/datum/alarm_handler/AH in queued_alarms)
|
||||
var/list/alarms = queued_alarms[AH]
|
||||
alarms.Cut()
|
||||
|
||||
/mob/living/silicon/proc/raised_alarm(var/datum/alarm/A)
|
||||
src << "[A.alarm_name()]!"
|
||||
|
||||
/mob/living/silicon/ai/raised_alarm(var/datum/alarm/A)
|
||||
var/cameratext = ""
|
||||
for(var/obj/machinery/camera/C in A.cameras())
|
||||
cameratext += "[(cameratext == "")? "" : "|"]<A HREF=?src=\ref[src];switchcamera=\ref[C]>[C.c_tag]</A>"
|
||||
src << "[A.alarm_name()]! ([(cameratext)? cameratext : "No Camera"])"
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
/mob/living/silicon
|
||||
var/register_alarms = 1
|
||||
var/datum/nano_module/alarm_monitor/all/alarm_monitor
|
||||
var/datum/nano_module/atmos_control/atmos_control
|
||||
var/datum/nano_module/crew_monitor/crew_monitor
|
||||
var/datum/nano_module/power_monitor/silicon/power_monitor
|
||||
|
||||
/mob/living/silicon
|
||||
var/list/silicon_subsystems = list(
|
||||
/mob/living/silicon/proc/subsystem_alarm_monitor
|
||||
)
|
||||
|
||||
/mob/living/silicon/ai
|
||||
silicon_subsystems = list(
|
||||
/mob/living/silicon/proc/subsystem_alarm_monitor,
|
||||
/mob/living/silicon/proc/subsystem_atmos_control,
|
||||
/mob/living/silicon/proc/subsystem_crew_monitor,
|
||||
/mob/living/silicon/proc/subsystem_power_monitor
|
||||
)
|
||||
|
||||
/mob/living/silicon/robot/drone
|
||||
silicon_subsystems = list(
|
||||
/mob/living/silicon/proc/subsystem_alarm_monitor,
|
||||
/mob/living/silicon/proc/subsystem_power_monitor
|
||||
)
|
||||
|
||||
/mob/living/silicon/robot/syndicate
|
||||
register_alarms = 0
|
||||
|
||||
/mob/living/silicon/proc/init_subsystems()
|
||||
alarm_monitor = new(src)
|
||||
atmos_control = new(src)
|
||||
crew_monitor = new(src)
|
||||
power_monitor = new(src)
|
||||
|
||||
if(!register_alarms)
|
||||
return
|
||||
|
||||
var/list/register_to = list(atmosphere_alarm, camera_alarm, fire_alarm, motion_alarm, power_alarm)
|
||||
for(var/datum/alarm_handler/AH in register_to)
|
||||
AH.register(src, /mob/living/silicon/proc/receive_alarm)
|
||||
queued_alarms[AH] = list() // Makes sure alarms remain listed in consistent order
|
||||
|
||||
/********************
|
||||
* Alarm Monitor *
|
||||
********************/
|
||||
/mob/living/silicon/proc/subsystem_alarm_monitor()
|
||||
set name = "Alarm Monitor"
|
||||
set category = "Subsystems"
|
||||
|
||||
alarm_monitor.ui_interact(usr, state = self_state)
|
||||
|
||||
/********************
|
||||
* Atmos Control *
|
||||
********************/
|
||||
/mob/living/silicon/proc/subsystem_atmos_control()
|
||||
set category = "Subsystems"
|
||||
set name = "Atmospherics Control"
|
||||
|
||||
atmos_control.ui_interact(usr, state = self_state)
|
||||
|
||||
/********************
|
||||
* Crew Monitor *
|
||||
********************/
|
||||
/mob/living/silicon/proc/subsystem_crew_monitor()
|
||||
set category = "Subsystems"
|
||||
set name = "Crew Monitor"
|
||||
|
||||
crew_monitor.ui_interact(usr, state = self_state)
|
||||
|
||||
/********************
|
||||
* Power Monitor *
|
||||
********************/
|
||||
/mob/living/silicon/proc/subsystem_power_monitor()
|
||||
set category = "Subsystems"
|
||||
set name = "Power Monitor"
|
||||
|
||||
power_monitor.ui_interact(usr, state = self_state)
|
||||
|
||||
@@ -243,7 +243,7 @@
|
||||
|
||||
/mob/living/simple_animal/borer/verb/secrete_chemicals()
|
||||
set category = "Alien"
|
||||
set name = "Secrete Chemicals (50)"
|
||||
set name = "Secrete Chemicals (30)"
|
||||
set desc = "Push some chemicals into your host's bloodstream."
|
||||
|
||||
if(!host)
|
||||
@@ -257,17 +257,17 @@
|
||||
src << "\blue You are feeling far too docile to do that."
|
||||
return
|
||||
|
||||
if(chemicals < 50)
|
||||
if(chemicals < 30)
|
||||
src << "You don't have enough chemicals!"
|
||||
|
||||
var/chem = input("Select a chemical to secrete.", "Chemicals") as null|anything in list("mannitol","styptic_powder","methamphetamine","sal_acid")
|
||||
|
||||
if(!chem || chemicals < 50 || !host || controlling || !src || stat) //Sanity check.
|
||||
if(!chem || chemicals < 30 || !host || controlling || !src || stat) //Sanity check.
|
||||
return
|
||||
|
||||
src << "\red <B>You squirt a measure of [chem] from your reservoirs into [host]'s bloodstream.</B>"
|
||||
host.reagents.add_reagent(chem, 15)
|
||||
chemicals -= 50
|
||||
host.reagents.add_reagent(chem, 9)
|
||||
chemicals -= 30
|
||||
|
||||
/mob/living/simple_animal/borer/verb/release_host()
|
||||
set category = "Alien"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
emote_see = list("flutters")
|
||||
response_help = "shoos"
|
||||
response_disarm = "brushes aside"
|
||||
response_harm = "aquashes"
|
||||
response_harm = "squashes"
|
||||
speak_chance = 0
|
||||
maxHealth = 2
|
||||
health = 2
|
||||
@@ -20,4 +20,4 @@
|
||||
|
||||
/mob/living/simple_animal/butterfly/New()
|
||||
..()
|
||||
color = rgb(rand(0, 255), rand(0, 255), rand(0, 255))
|
||||
color = rgb(rand(0, 255), rand(0, 255), rand(0, 255))
|
||||
|
||||
@@ -80,7 +80,6 @@
|
||||
aggro_vision_range = 9
|
||||
idle_vision_range = 2
|
||||
turns_per_move = 5
|
||||
var/droppeddiamond = 0 // Safety check to prevent diamond duplication bug
|
||||
|
||||
/obj/item/projectile/temp/basilisk
|
||||
name = "freezing blast"
|
||||
@@ -113,12 +112,11 @@
|
||||
adjustBruteLoss(110)
|
||||
|
||||
/mob/living/simple_animal/hostile/asteroid/basilisk/Die()
|
||||
if(!droppeddiamond)
|
||||
if(stat != DEAD)
|
||||
var/counter
|
||||
for(counter=0, counter<2, counter++)
|
||||
var/obj/item/weapon/ore/diamond/D = new /obj/item/weapon/ore/diamond(src.loc)
|
||||
D.layer = 4.1
|
||||
droppeddiamond = 1
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/hostile/asteroid/goldgrub
|
||||
@@ -264,8 +262,8 @@
|
||||
OpenFire()
|
||||
|
||||
/mob/living/simple_animal/hostile/asteroid/hivelord/Die()
|
||||
new /obj/item/asteroid/hivelord_core(src.loc)
|
||||
mouse_opacity = 1
|
||||
if(stat != DEAD)
|
||||
new /obj/item/asteroid/hivelord_core(src.loc)
|
||||
..()
|
||||
|
||||
/obj/item/asteroid/hivelord_core
|
||||
@@ -354,7 +352,7 @@
|
||||
speed = 3
|
||||
maxHealth = 300
|
||||
health = 300
|
||||
harm_intent_damage = 0
|
||||
harm_intent_damage = 1 //Only the manliest of men can kill a Goliath with only their fists.
|
||||
melee_damage_lower = 25
|
||||
melee_damage_upper = 25
|
||||
attacktext = "pulverizes"
|
||||
@@ -382,6 +380,9 @@
|
||||
|
||||
/mob/living/simple_animal/hostile/asteroid/goliath/Die()
|
||||
anchored = 0
|
||||
if(stat != DEAD)
|
||||
var/obj/item/asteroid/goliath_hide/G = new /obj/item/asteroid/goliath_hide(src.loc)
|
||||
G.layer = 4.1
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/hostile/asteroid/goliath/OpenFire()
|
||||
@@ -416,7 +417,7 @@
|
||||
var/turftype = get_turf(src)
|
||||
if(istype(turftype, /turf/simulated/mineral))
|
||||
var/turf/simulated/mineral/M = turftype
|
||||
M.GetDrilled()
|
||||
M.gets_drilled()
|
||||
spawn(20)
|
||||
Trip()
|
||||
|
||||
@@ -441,18 +442,14 @@
|
||||
M.Stun(5)
|
||||
M.adjustBruteLoss(rand(10,15))
|
||||
latched = 1
|
||||
visible_message("<span class='danger'>The [src.name] grabs hold of [M.name]!</span>")
|
||||
if(src && M)
|
||||
visible_message("<span class='danger'>The [src.name] grabs hold of [M.name]!</span>")
|
||||
if(!latched)
|
||||
qdel(src)
|
||||
else
|
||||
spawn(50)
|
||||
qdel(src)
|
||||
|
||||
/mob/living/simple_animal/hostile/asteroid/goliath/Die()
|
||||
var/obj/item/asteroid/goliath_hide/G = new /obj/item/asteroid/goliath_hide(src.loc)
|
||||
G.layer = 4.1
|
||||
..()
|
||||
|
||||
/obj/item/asteroid/goliath_hide
|
||||
name = "goliath hide plates"
|
||||
desc = "Pieces of a goliath's rocky hide, these might be able to make your suit a bit more durable to attack from the local fauna."
|
||||
@@ -464,7 +461,7 @@
|
||||
|
||||
/obj/item/asteroid/goliath_hide/afterattack(atom/target, mob/user, proximity_flag)
|
||||
if(proximity_flag)
|
||||
if(istype(target, /obj/item/clothing/suit/space/rig/mining) || istype(target, /obj/item/clothing/head/helmet/space/rig/mining))
|
||||
if(istype(target, /obj/item/clothing/suit/space/rig/mining) || istype(target, /obj/item/clothing/head/helmet/space/rig/mining) || istype(target, /obj/item/clothing/suit/space/eva/plasmaman/miner) || istype(target, /obj/item/clothing/head/helmet/space/eva/plasmaman/miner))
|
||||
var/obj/item/clothing/C = target
|
||||
var/current_armor = C.armor
|
||||
if(current_armor.["melee"] < 80)
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
strikes--
|
||||
src << "<span class='boldannounce'>Your essence has dropped below critical levels. You barely manage to save yourself - [strikes ? "you can't keep this up!" : "next time, it's death."]</span>"
|
||||
else if(strikes <= 0)
|
||||
death()
|
||||
Die()
|
||||
maxHealth = essence * 2
|
||||
if(!revealed)
|
||||
health = maxHealth //Heals to full when not revealed
|
||||
@@ -123,10 +123,10 @@
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/simple_animal/revenant/death()
|
||||
/mob/living/simple_animal/revenant/Die()
|
||||
if(strikes)
|
||||
return 0 //Impossible to die with strikes still active
|
||||
..(1)
|
||||
..()
|
||||
src << "<span class='userdanger'><b>NO! No... it's too late, you can feel yourself fading...</b></span>"
|
||||
notransform = 1
|
||||
revealed = 1
|
||||
|
||||
@@ -498,4 +498,19 @@ var/list/intents = list("help","disarm","grab","harm")
|
||||
if(O.client)
|
||||
O << "<span class='ghostalert'>[message]<span>"
|
||||
if(ghost_sound)
|
||||
O << sound(ghost_sound)
|
||||
O << sound(ghost_sound)
|
||||
|
||||
/mob/proc/switch_to_camera(var/obj/machinery/camera/C)
|
||||
if (!C.can_use() || stat || (get_dist(C, src) > 1 || machine != src || blinded || !canmove))
|
||||
return 0
|
||||
check_eye(src)
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/ai/switch_to_camera(var/obj/machinery/camera/C)
|
||||
if(!C.can_use() || !is_in_chassis())
|
||||
return 0
|
||||
|
||||
eyeobj.setLoc(get_turf(C))
|
||||
client.eye = eyeobj
|
||||
return 1
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
|
||||
json_writer
|
||||
var
|
||||
use_cache = 0
|
||||
|
||||
proc
|
||||
WriteObject(list/L, cached_data = null)
|
||||
if(use_cache && L["__json_cache"])
|
||||
return L["__json_cache"]
|
||||
|
||||
. = "{"
|
||||
var/i = 1
|
||||
for(var/k in L)
|
||||
@@ -9,13 +15,11 @@ json_writer
|
||||
. += {"\"[k]\":[write(val)]"}
|
||||
if(i++ < L.len)
|
||||
. += ","
|
||||
if(cached_data)
|
||||
. = copytext(., 1, lentext(.)) + ",\"cached\":[cached_data]}"
|
||||
.+= "}"
|
||||
. += "}"
|
||||
|
||||
write(val)
|
||||
if(isnum(val))
|
||||
return num2text(val, 100)
|
||||
return num2text(val)
|
||||
else if(isnull(val))
|
||||
return "null"
|
||||
else if(istype(val, /list))
|
||||
@@ -35,27 +39,21 @@ json_writer
|
||||
. += "]"
|
||||
|
||||
write_string(txt)
|
||||
var/static/list/json_escape = list("\\", "\"", "'", "\n")
|
||||
var/static/list/json_escape = list("\\" = "\\\\", "\"" = "\\\"", "\n" = "\\n")
|
||||
for(var/targ in json_escape)
|
||||
var/start = 1
|
||||
while(start <= lentext(txt))
|
||||
var/i = findtext(txt, targ, start)
|
||||
if(!i)
|
||||
break
|
||||
if(targ == "\n")
|
||||
txt = copytext(txt, 1, i) + "\\n" + copytext(txt, i+2)
|
||||
start = i + 1 // 1 character added
|
||||
if(targ == "'")
|
||||
txt = copytext(txt, 1, i) + "`" + copytext(txt, i+1) // apostrophies fuck shit up...
|
||||
start = i + 1 // 1 character added
|
||||
else
|
||||
txt = copytext(txt, 1, i) + "\\" + copytext(txt, i)
|
||||
start = i + 2 // 2 characters added
|
||||
var/lrep = length(json_escape[targ])
|
||||
txt = copytext(txt, 1, i) + json_escape[targ] + copytext(txt, i + length(targ))
|
||||
start = i + lrep
|
||||
|
||||
return {""[txt]""}
|
||||
|
||||
is_associative(list/L)
|
||||
for(var/key in L)
|
||||
// if the key is a list that means it's actually an array of lists (stupid Byond...)
|
||||
if(!isnum(key) && !istype(key, /list))
|
||||
if(!isnum(key) && !isnull(L[key]) && !istype(key, /list))
|
||||
return TRUE
|
||||
|
||||
@@ -5,19 +5,13 @@ n_Json v11.3.21
|
||||
proc
|
||||
json2list(json)
|
||||
var/static/json_reader/_jsonr = new()
|
||||
// N3X: Array support.
|
||||
if(dd_hasprefix(json,"\["))
|
||||
return _jsonr.ReadArray(_jsonr.ScanJson(json))
|
||||
else
|
||||
return _jsonr.ReadObject(_jsonr.ScanJson(json))
|
||||
return _jsonr.ReadObject(_jsonr.ScanJson(json))
|
||||
|
||||
list2json(list/L, var/cached_data = null)
|
||||
list2json(list/L)
|
||||
var/static/json_writer/_jsonw = new()
|
||||
// Detect if it's just a list of things, or an associative list
|
||||
// (Used to just assume associative, which broke things.)
|
||||
if(_jsonw.is_associative(L))
|
||||
return _jsonw.WriteObject(L, cached_data)
|
||||
else
|
||||
return _jsonw.write_array(L)
|
||||
|
||||
return _jsonw.write(L)
|
||||
|
||||
list2json_usecache(list/L)
|
||||
var/static/json_writer/_jsonw = new()
|
||||
_jsonw.use_cache = 1
|
||||
return _jsonw.write(L)
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
This state checks that the user is an admin, end of story
|
||||
*/
|
||||
/var/global/datum/topic_state/admin_state/admin_state = new()
|
||||
|
||||
/datum/topic_state/admin_state/can_use_topic(var/src_object, var/mob/user)
|
||||
return check_rights(R_ADMIN, 0, user) ? STATUS_INTERACTIVE : STATUS_CLOSE
|
||||
@@ -0,0 +1,34 @@
|
||||
/datum/proc/nano_host()
|
||||
return src
|
||||
|
||||
/datum/proc/CanUseTopic(var/mob/user, var/datum/topic_state/state)
|
||||
var/src_object = nano_host()
|
||||
return state.can_use_topic(src_object, user)
|
||||
|
||||
/datum/topic_state/proc/href_list(var/mob/user)
|
||||
return list()
|
||||
|
||||
/datum/topic_state/proc/can_use_topic(var/src_object, var/mob/user)
|
||||
return STATUS_CLOSE
|
||||
|
||||
/mob/proc/shared_nano_interaction()
|
||||
if (src.stat || !client)
|
||||
return STATUS_CLOSE // no updates, close the interface
|
||||
else if (restrained() || lying || stat || stunned || weakened)
|
||||
return STATUS_UPDATE // update only (orange visibility)
|
||||
return STATUS_INTERACTIVE
|
||||
|
||||
/mob/living/silicon/ai/shared_nano_interaction()
|
||||
if(lacks_power())
|
||||
return STATUS_CLOSE
|
||||
if (check_unable(1, 0))
|
||||
return STATUS_CLOSE
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/robot/shared_nano_interaction()
|
||||
. = STATUS_INTERACTIVE
|
||||
if(cell.charge <= 0)
|
||||
return STATUS_CLOSE
|
||||
if(lockcharge)
|
||||
. = STATUS_DISABLED
|
||||
return min(., ..())
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
This state checks if user is somewhere within src_object, as well as the default NanoUI interaction.
|
||||
*/
|
||||
/var/global/datum/topic_state/contained_state/contained_state = new()
|
||||
|
||||
/datum/topic_state/contained_state/can_use_topic(var/atom/src_object, var/mob/user)
|
||||
if(!src_object.contains(user))
|
||||
return STATUS_CLOSE
|
||||
|
||||
return user.shared_nano_interaction()
|
||||
|
||||
/atom/proc/contains(var/atom/location)
|
||||
if(!location)
|
||||
return 0
|
||||
if(location == src)
|
||||
return 1
|
||||
|
||||
return contains(location.loc)
|
||||
@@ -1,39 +1,36 @@
|
||||
/atom/movable/proc/nano_host()
|
||||
return src
|
||||
/var/global/datum/topic_state/default/default_state = new()
|
||||
|
||||
/obj/nano_module/nano_host()
|
||||
return loc
|
||||
/datum/topic_state/default/href_list(var/mob/user)
|
||||
return list()
|
||||
|
||||
/datum/topic_state/default/can_use_topic(var/src_object, var/mob/user)
|
||||
return user.default_can_use_topic(src_object)
|
||||
|
||||
/atom/movable/proc/CanUseTopic(var/mob/user, href_list, var/datum/topic_state/custom_state)
|
||||
return user.can_use_topic(nano_host(), custom_state)
|
||||
|
||||
|
||||
/mob/proc/can_use_topic(var/mob/user, var/datum/topic_state/custom_state)
|
||||
/mob/proc/default_can_use_topic(var/src_object)
|
||||
return STATUS_CLOSE // By default no mob can do anything with NanoUI
|
||||
|
||||
/mob/dead/observer/can_use_topic()
|
||||
/mob/dead/observer/default_can_use_topic()
|
||||
if(check_rights(R_ADMIN, 0, src))
|
||||
return STATUS_INTERACTIVE // Admins are more equal
|
||||
return STATUS_UPDATE // Ghosts can view updates
|
||||
|
||||
/mob/living/silicon/pai/can_use_topic(var/src_object)
|
||||
/mob/living/silicon/pai/default_can_use_topic(var/src_object)
|
||||
if(src_object == src && !stat)
|
||||
return STATUS_INTERACTIVE
|
||||
else
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/robot/can_use_topic(var/src_object, var/datum/topic_state/custom_state)
|
||||
if(stat || !client)
|
||||
return STATUS_CLOSE
|
||||
if(lockcharge || stunned || weakened)
|
||||
return STATUS_DISABLED
|
||||
/mob/living/silicon/robot/default_can_use_topic(var/src_object)
|
||||
. = shared_nano_interaction()
|
||||
if(. <= STATUS_DISABLED)
|
||||
return
|
||||
|
||||
// robots can interact with things they can see within their view range
|
||||
if(!(custom_state.flags & NANO_IGNORE_DISTANCE) && (src_object in view(src)))
|
||||
if((src_object in view(src)) && get_dist(src_object, src) <= src.client.view)
|
||||
return STATUS_INTERACTIVE // interactive (green visibility)
|
||||
return STATUS_DISABLED // no updates, completely disabled (red visibility)
|
||||
|
||||
/mob/living/silicon/robot/syndicate/can_use_topic(var/src_object)
|
||||
/mob/living/silicon/robot/syndicate/default_can_use_topic(var/src_object)
|
||||
. = ..()
|
||||
if(. != STATUS_INTERACTIVE)
|
||||
return
|
||||
@@ -48,9 +45,11 @@
|
||||
return STATUS_INTERACTIVE
|
||||
return STATUS_UPDATE
|
||||
|
||||
/mob/living/silicon/ai/can_use_topic(var/src_object)
|
||||
if(!client || check_unable(1))
|
||||
return STATUS_CLOSE
|
||||
/mob/living/silicon/ai/default_can_use_topic(var/src_object)
|
||||
. = shared_nano_interaction()
|
||||
if(. != STATUS_INTERACTIVE)
|
||||
return
|
||||
|
||||
// Prevents the AI from using Topic on admin levels (by for example viewing through the court/thunderdome cameras)
|
||||
// unless it's on the same level as the object it's interacting with.
|
||||
var/turf/T = get_turf(src_object)
|
||||
@@ -64,27 +63,19 @@
|
||||
// If we're installed in a chassi, rather than transfered to an inteliCard or other container, then check if we have camera view
|
||||
if(is_in_chassis())
|
||||
//stop AIs from leaving windows open and using then after they lose vision
|
||||
//apc_override is needed here because AIs use their own APC when powerless
|
||||
if(cameranet && !cameranet.checkTurfVis(get_turf(src_object)))
|
||||
return apc_override ? STATUS_INTERACTIVE : STATUS_CLOSE
|
||||
return STATUS_CLOSE
|
||||
return STATUS_INTERACTIVE
|
||||
else if(get_dist(src_object, src) <= client.view) // View does not return what one would expect while installed in an inteliCard
|
||||
return STATUS_INTERACTIVE
|
||||
|
||||
return STATUS_CLOSE
|
||||
return STATUS_CLOSE
|
||||
|
||||
/mob/living/proc/shared_living_nano_interaction(var/src_object)
|
||||
if (src.stat != CONSCIOUS)
|
||||
return STATUS_CLOSE // no updates, close the interface
|
||||
else if (restrained() || lying || stat || stunned || weakened)
|
||||
return STATUS_UPDATE // update only (orange visibility)
|
||||
return STATUS_INTERACTIVE
|
||||
//Some atoms such as vehicles might have special rules for how mobs inside them interact with NanoUI.
|
||||
/atom/proc/contents_nano_distance(var/src_object, var/mob/living/user)
|
||||
return user.shared_living_nano_distance(src_object)
|
||||
|
||||
/mob/living/proc/shared_living_nano_distance(var/atom/movable/src_object)
|
||||
if(!isturf(src_object.loc))
|
||||
if(src_object.loc == src) // Item in the inventory
|
||||
return STATUS_INTERACTIVE
|
||||
if(src.contents.Find(src_object.loc)) // A hidden uplink inside an item
|
||||
return STATUS_INTERACTIVE
|
||||
|
||||
if (!(src_object in view(4, src))) // If the src object is not in visable, disable updates
|
||||
return STATUS_CLOSE
|
||||
|
||||
@@ -97,24 +88,17 @@
|
||||
return STATUS_DISABLED // no updates, completely disabled (red visibility)
|
||||
return STATUS_CLOSE
|
||||
|
||||
/mob/living/can_use_topic(var/src_object, var/datum/topic_state/custom_state)
|
||||
. = shared_living_nano_interaction(src_object)
|
||||
if(. == STATUS_INTERACTIVE && !(custom_state.flags & NANO_IGNORE_DISTANCE))
|
||||
. = shared_living_nano_distance(src_object)
|
||||
/mob/living/default_can_use_topic(var/src_object)
|
||||
. = shared_nano_interaction(src_object)
|
||||
if(. != STATUS_CLOSE)
|
||||
if(loc)
|
||||
. = min(., loc.contents_nano_distance(src_object, src))
|
||||
if(STATUS_INTERACTIVE)
|
||||
return STATUS_UPDATE
|
||||
|
||||
/mob/living/carbon/human/can_use_topic(var/src_object, var/datum/topic_state/custom_state)
|
||||
. = shared_living_nano_interaction(src_object)
|
||||
if(. == STATUS_INTERACTIVE && !(custom_state.flags & NANO_IGNORE_DISTANCE))
|
||||
. = shared_living_nano_distance(src_object)
|
||||
/mob/living/carbon/human/default_can_use_topic(var/src_object)
|
||||
. = shared_nano_interaction(src_object)
|
||||
if(. != STATUS_CLOSE)
|
||||
. = min(., shared_living_nano_distance(src_object))
|
||||
if(. == STATUS_UPDATE && (TK in mutations)) // If we have telekinesis and remain close enough, allow interaction.
|
||||
return STATUS_INTERACTIVE
|
||||
|
||||
/var/global/datum/topic_state/default_state = new()
|
||||
|
||||
/datum/topic_state
|
||||
var/flags = 0
|
||||
|
||||
/datum/topic_state/proc/href_list(var/mob/user)
|
||||
return list()
|
||||
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
This state checks that the src_object is somewhere in the user's first-level inventory (in hands, on ear, etc.), but not further down (such as in bags).
|
||||
*/
|
||||
/var/global/datum/topic_state/inventory_state/inventory_state = new()
|
||||
|
||||
/datum/topic_state/inventory_state/can_use_topic(var/src_object, var/mob/user)
|
||||
if(!(src_object in user))
|
||||
return STATUS_CLOSE
|
||||
|
||||
return user.shared_nano_interaction()
|
||||
@@ -0,0 +1,18 @@
|
||||
/var/global/datum/topic_state/physical/physical_state = new()
|
||||
|
||||
/datum/topic_state/physical/can_use_topic(var/src_object, var/mob/user)
|
||||
. = user.shared_nano_interaction(src_object)
|
||||
if(. > STATUS_CLOSE)
|
||||
return min(., user.check_physical_distance(src_object))
|
||||
|
||||
/mob/proc/check_physical_distance(var/src_object)
|
||||
return STATUS_CLOSE
|
||||
|
||||
/mob/dead/observer/check_physical_distance(var/src_object)
|
||||
return default_can_use_topic(src_object)
|
||||
|
||||
/mob/living/check_physical_distance(var/src_object)
|
||||
return shared_living_nano_distance(src_object)
|
||||
|
||||
/mob/living/silicon/check_physical_distance(var/src_object)
|
||||
return max(STATUS_UPDATE, shared_living_nano_distance(src_object))
|
||||
@@ -0,0 +1,9 @@
|
||||
/*
|
||||
This state checks that the src_object is the same the as user
|
||||
*/
|
||||
/var/global/datum/topic_state/self_state/self_state = new()
|
||||
|
||||
/datum/topic_state/self_state/can_use_topic(var/src_object, var/mob/user)
|
||||
if(src_object != user)
|
||||
return STATUS_CLOSE
|
||||
return user.shared_nano_interaction()
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
This state checks that the user is on the same Z-level as src_object
|
||||
*/
|
||||
|
||||
/var/global/datum/topic_state/z_state/z_state = new()
|
||||
|
||||
/datum/topic_state/z_state/can_use_topic(var/src_object, var/mob/user)
|
||||
var/turf/turf_obj = get_turf(src_object)
|
||||
var/turf/turf_usr = get_turf(user)
|
||||
if(!turf_obj || !turf_usr)
|
||||
return STATUS_CLOSE
|
||||
|
||||
return turf_obj.z == turf_usr.z ? STATUS_INTERACTIVE : STATUS_CLOSE
|
||||
@@ -0,0 +1,88 @@
|
||||
/datum/nano_module/alarm_monitor
|
||||
name = "Alarm monitor"
|
||||
var/list_cameras = 0 // Whether or not to list camera references. A future goal would be to merge this with the enginering/security camera console. Currently really only for AI-use.
|
||||
var/list/datum/alarm_handler/alarm_handlers // The particular list of alarm handlers this alarm monitor should present to the user.
|
||||
|
||||
/datum/nano_module/alarm_monitor/all/New()
|
||||
..()
|
||||
alarm_handlers = list(atmosphere_alarm, camera_alarm, fire_alarm, motion_alarm, power_alarm)
|
||||
|
||||
/datum/nano_module/alarm_monitor/engineering/New()
|
||||
..()
|
||||
alarm_handlers = list(atmosphere_alarm, fire_alarm, power_alarm)
|
||||
|
||||
/datum/nano_module/alarm_monitor/security/New()
|
||||
..()
|
||||
alarm_handlers = list(camera_alarm, motion_alarm)
|
||||
|
||||
/datum/nano_module/alarm_monitor/proc/register(var/object, var/procName)
|
||||
for(var/datum/alarm_handler/AH in alarm_handlers)
|
||||
AH.register(object, procName)
|
||||
|
||||
/datum/nano_module/alarm_monitor/proc/unregister(var/object)
|
||||
for(var/datum/alarm_handler/AH in alarm_handlers)
|
||||
AH.unregister(object)
|
||||
|
||||
/datum/nano_module/alarm_monitor/proc/all_alarms()
|
||||
var/list/all_alarms = new()
|
||||
for(var/datum/alarm_handler/AH in alarm_handlers)
|
||||
all_alarms += AH.alarms
|
||||
|
||||
return all_alarms
|
||||
|
||||
/datum/nano_module/alarm_monitor/proc/major_alarms()
|
||||
var/list/all_alarms = new()
|
||||
for(var/datum/alarm_handler/AH in alarm_handlers)
|
||||
all_alarms += AH.major_alarms()
|
||||
|
||||
return all_alarms
|
||||
|
||||
/datum/nano_module/alarm_monitor/proc/minor_alarms()
|
||||
var/list/all_alarms = new()
|
||||
for(var/datum/alarm_handler/AH in alarm_handlers)
|
||||
all_alarms += AH.minor_alarms()
|
||||
|
||||
return all_alarms
|
||||
|
||||
/datum/nano_module/alarm_monitor/Topic(ref, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
if(href_list["switchTo"])
|
||||
var/obj/machinery/camera/C = locate(href_list["switchTo"]) in cameranet.cameras
|
||||
if(!C || !isAI(usr))
|
||||
return
|
||||
|
||||
usr.switch_to_camera(C)
|
||||
return 1
|
||||
|
||||
/datum/nano_module/alarm_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state)
|
||||
var/data[0]
|
||||
|
||||
var/categories[0]
|
||||
for(var/datum/alarm_handler/AH in alarm_handlers)
|
||||
categories[++categories.len] = list("category" = AH.category, "alarms" = list())
|
||||
for(var/datum/alarm/A in AH.major_alarms())
|
||||
var/cameras[0]
|
||||
var/lost_sources[0]
|
||||
|
||||
if(isAI(user))
|
||||
for(var/obj/machinery/camera/C in A.cameras())
|
||||
cameras[++cameras.len] = C.nano_structure()
|
||||
for(var/datum/alarm_source/AS in A.sources)
|
||||
if(!AS.source)
|
||||
lost_sources[++lost_sources.len] = AS.source_name
|
||||
|
||||
categories[categories.len]["alarms"] += list(list(
|
||||
"name" = sanitize(A.alarm_name()),
|
||||
"origin_lost" = A.origin == null,
|
||||
"has_cameras" = cameras.len,
|
||||
"cameras" = cameras,
|
||||
"lost_sources" = lost_sources.len ? sanitize(english_list(lost_sources, nothing_text = "", and_text = ", ")) : ""))
|
||||
data["categories"] = categories
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "alarm_monitor.tmpl", "Alarm Monitoring Console", 800, 800, state = state)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
@@ -0,0 +1,79 @@
|
||||
/datum/nano_module/atmos_control
|
||||
name = "Atmospherics Control"
|
||||
var/obj/access = new()
|
||||
var/emagged = 0
|
||||
var/ui_ref
|
||||
var/list/monitored_alarms = list()
|
||||
|
||||
/datum/nano_module/atmos_control/New(atmos_computer, req_access, req_one_access, monitored_alarm_ids)
|
||||
..()
|
||||
access.req_access = req_access
|
||||
access.req_one_access = req_one_access
|
||||
|
||||
if(monitored_alarm_ids)
|
||||
for(var/obj/machinery/alarm/alarm in machines)
|
||||
if(alarm.alarm_id && alarm.alarm_id in monitored_alarm_ids)
|
||||
monitored_alarms += alarm
|
||||
// machines may not yet be ordered at this point
|
||||
monitored_alarms = dd_sortedObjectList(monitored_alarms)
|
||||
|
||||
/datum/nano_module/atmos_control/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
if(href_list["alarm"])
|
||||
if(ui_ref)
|
||||
var/obj/machinery/alarm/alarm = locate(href_list["alarm"]) in (monitored_alarms.len ? monitored_alarms : machines)
|
||||
if(alarm)
|
||||
var/datum/topic_state/TS = generate_state(alarm)
|
||||
alarm.ui_interact(usr, master_ui = ui_ref, state = TS)
|
||||
return 1
|
||||
|
||||
/datum/nano_module/atmos_control/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/master_ui = null, var/datum/topic_state/state = default_state)
|
||||
var/data[0]
|
||||
var/alarms[0]
|
||||
|
||||
// TODO: Move these to a cache, similar to cameras
|
||||
for(var/obj/machinery/alarm/alarm in sortAtom((monitored_alarms.len ? monitored_alarms : machines)))
|
||||
if(!monitored_alarms.len && alarm.z != ZLEVEL_STATION && alarm.z != ZLEVEL_ASTEROID)
|
||||
continue
|
||||
alarms[++alarms.len] = alarm.get_nano_data_console()
|
||||
data["alarms"] = alarms
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "atmos_control.tmpl", src.name, 900, 800, state = state)
|
||||
ui.add_template("mapContent", "atmos_control_map_content.tmpl")
|
||||
ui.add_template("mapHeader", "atmos_control_map_header.tmpl")
|
||||
ui.set_show_map(1)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
ui_ref = ui
|
||||
|
||||
/datum/nano_module/atmos_control/proc/generate_state(air_alarm)
|
||||
var/datum/topic_state/air_alarm/state = new()
|
||||
state.atmos_control = src
|
||||
state.air_alarm = air_alarm
|
||||
return state
|
||||
|
||||
/datum/topic_state/air_alarm
|
||||
var/datum/nano_module/atmos_control/atmos_control = null
|
||||
var/obj/machinery/alarm/air_alarm = null
|
||||
|
||||
/datum/topic_state/air_alarm/can_use_topic(var/src_object, var/mob/user)
|
||||
if(!isAI(user) && !in_range(atmos_control.nano_host(), user))
|
||||
return STATUS_CLOSE
|
||||
if(has_access(user))
|
||||
return STATUS_INTERACTIVE
|
||||
return STATUS_UPDATE
|
||||
|
||||
/datum/topic_state/air_alarm/href_list(var/mob/user)
|
||||
var/list/extra_href = list()
|
||||
extra_href["remote_connection"] = 1
|
||||
extra_href["remote_access"] = has_access(user)
|
||||
|
||||
return extra_href
|
||||
|
||||
/datum/topic_state/air_alarm/proc/has_access(var/mob/user)
|
||||
return user && (isAI(user) || atmos_control.access.allowed(user) || atmos_control.emagged || air_alarm.rcon_setting == RCON_YES || (air_alarm.alarm_area.atmosalm && air_alarm.rcon_setting == RCON_AUTO))
|
||||
@@ -1,29 +1,27 @@
|
||||
/obj/nano_module/crew_monitor
|
||||
/datum/nano_module/crew_monitor
|
||||
name = "Crew monitor"
|
||||
var/list/tracked = new
|
||||
|
||||
/obj/nano_module/crew_monitor/Topic(href, href_list)
|
||||
if(..()) return
|
||||
var/turf/T = get_turf(src)
|
||||
/datum/nano_module/crew_monitor/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
var/turf/T = get_turf(nano_host())
|
||||
if (!T || !(T.z in config.player_levels))
|
||||
usr << "<span class='warning'>Unable to establish a connection<span>: You're too far away from the station!"
|
||||
return 0
|
||||
if(href_list["close"] )
|
||||
var/mob/user = usr
|
||||
var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main")
|
||||
usr.unset_machine()
|
||||
ui.close()
|
||||
return 0
|
||||
if(href_list["update"])
|
||||
src.updateDialog()
|
||||
if(href_list["track"])
|
||||
if(isAI(usr))
|
||||
var/mob/living/silicon/ai/AI = usr
|
||||
var/mob/living/carbon/human/H = locate(href_list["track"]) in mob_list
|
||||
if(hassensorlevel(H, SUIT_SENSOR_TRACKING))
|
||||
AI.ai_actual_track(H)
|
||||
return 1
|
||||
|
||||
/obj/nano_module/crew_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
user.set_machine(src)
|
||||
/datum/nano_module/crew_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state)
|
||||
src.scan()
|
||||
|
||||
var/data[0]
|
||||
var/turf/T = get_turf(src)
|
||||
var/turf/T = get_turf(nano_host())
|
||||
var/list/crewmembers = list()
|
||||
for(var/obj/item/clothing/under/C in src.tracked)
|
||||
|
||||
@@ -37,7 +35,8 @@
|
||||
continue
|
||||
|
||||
var/list/crewmemberData = list("dead"=0, "oxy"=-1, "tox"=-1, "fire"=-1, "brute"=-1, "area"="", "x"=-1, "y"=-1)
|
||||
|
||||
|
||||
crewmemberData["reference"] = "\ref[H]"
|
||||
crewmemberData["sensor_type"] = C.sensor_mode
|
||||
crewmemberData["name"] = H.get_authentification_name(if_no_id="Unknown")
|
||||
crewmemberData["rank"] = H.get_authentification_rank(if_no_id="Unknown", if_no_job="No Job")
|
||||
@@ -62,6 +61,7 @@
|
||||
|
||||
crewmembers = sortByKey(crewmembers, "name")
|
||||
|
||||
data["isAI"] = isAI(user)
|
||||
data["crewmembers"] = crewmembers
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
@@ -79,7 +79,7 @@
|
||||
// should make the UI auto-update; doesn't seem to?
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/nano_module/crew_monitor/proc/scan()
|
||||
/datum/nano_module/crew_monitor/proc/scan()
|
||||
for(var/mob/living/carbon/human/H in mob_list)
|
||||
if(istype(H.w_uniform, /obj/item/clothing/under))
|
||||
var/obj/item/clothing/under/C = H.w_uniform
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
/datum/nano_module/appearance_changer
|
||||
name = "Appearance Editor"
|
||||
var/flags = APPEARANCE_ALL_HAIR
|
||||
var/mob/living/carbon/human/owner = null
|
||||
var/list/valid_species = list()
|
||||
var/list/valid_hairstyles = list()
|
||||
var/list/valid_facial_hairstyles = list()
|
||||
|
||||
var/check_whitelist
|
||||
var/list/whitelist
|
||||
var/list/blacklist
|
||||
|
||||
/datum/nano_module/appearance_changer/New(var/location, var/mob/living/carbon/human/H, var/check_species_whitelist = 1, var/list/species_whitelist = list(), var/list/species_blacklist = list())
|
||||
..()
|
||||
owner = H
|
||||
src.check_whitelist = check_species_whitelist
|
||||
src.whitelist = species_whitelist
|
||||
src.blacklist = species_blacklist
|
||||
|
||||
/datum/nano_module/appearance_changer/Topic(ref, href_list, var/nowindow, var/datum/topic_state/state = default_state)
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
if(href_list["race"])
|
||||
if(can_change(APPEARANCE_RACE) && (href_list["race"] in valid_species))
|
||||
if(owner.change_species(href_list["race"]))
|
||||
cut_and_generate_data()
|
||||
return 1
|
||||
if(href_list["gender"])
|
||||
if(can_change(APPEARANCE_GENDER))
|
||||
if(owner.change_gender(href_list["gender"]))
|
||||
cut_and_generate_data()
|
||||
return 1
|
||||
if(href_list["skin_tone"])
|
||||
if(can_change_skin_tone())
|
||||
var/new_s_tone = input(usr, "Choose your character's skin-tone:\n(Light 1 - 220 Dark)", "Skin Tone", owner.s_tone) as num|null
|
||||
if(isnum(new_s_tone) && can_still_topic(state))
|
||||
new_s_tone = 35 - max(min( round(new_s_tone), 220),1)
|
||||
return owner.change_skin_tone(new_s_tone)
|
||||
if(href_list["skin_color"])
|
||||
if(can_change_skin_color())
|
||||
var/new_skin = input(usr, "Choose your character's skin colour: ", "Skin Color", rgb(owner.r_skin, owner.g_skin, owner.b_skin)) as color|null
|
||||
if(new_skin && can_still_topic(state))
|
||||
var/r_skin = hex2num(copytext(new_skin, 2, 4))
|
||||
var/g_skin = hex2num(copytext(new_skin, 4, 6))
|
||||
var/b_skin = hex2num(copytext(new_skin, 6, 8))
|
||||
if(owner.change_skin_color(r_skin, g_skin, b_skin))
|
||||
update_dna()
|
||||
return 1
|
||||
if(href_list["hair"])
|
||||
if(can_change(APPEARANCE_HAIR) && (href_list["hair"] in valid_hairstyles))
|
||||
if(owner.change_hair(href_list["hair"]))
|
||||
update_dna()
|
||||
return 1
|
||||
if(href_list["hair_color"])
|
||||
if(can_change(APPEARANCE_HAIR_COLOR))
|
||||
var/new_hair = input("Please select hair color.", "Hair Color", rgb(owner.r_hair, owner.g_hair, owner.b_hair)) as color|null
|
||||
if(new_hair && can_still_topic(state))
|
||||
var/r_hair = hex2num(copytext(new_hair, 2, 4))
|
||||
var/g_hair = hex2num(copytext(new_hair, 4, 6))
|
||||
var/b_hair = hex2num(copytext(new_hair, 6, 8))
|
||||
if(owner.change_hair_color(r_hair, g_hair, b_hair))
|
||||
update_dna()
|
||||
return 1
|
||||
if(href_list["facial_hair"])
|
||||
if(can_change(APPEARANCE_FACIAL_HAIR) && (href_list["facial_hair"] in valid_facial_hairstyles))
|
||||
if(owner.change_facial_hair(href_list["facial_hair"]))
|
||||
update_dna()
|
||||
return 1
|
||||
if(href_list["facial_hair_color"])
|
||||
if(can_change(APPEARANCE_FACIAL_HAIR_COLOR))
|
||||
var/new_facial = input("Please select facial hair color.", "Facial Hair Color", rgb(owner.r_facial, owner.g_facial, owner.b_facial)) as color|null
|
||||
if(new_facial && can_still_topic(state))
|
||||
var/r_facial = hex2num(copytext(new_facial, 2, 4))
|
||||
var/g_facial = hex2num(copytext(new_facial, 4, 6))
|
||||
var/b_facial = hex2num(copytext(new_facial, 6, 8))
|
||||
if(owner.change_facial_hair_color(r_facial, g_facial, b_facial))
|
||||
update_dna()
|
||||
return 1
|
||||
if(href_list["eye_color"])
|
||||
if(can_change(APPEARANCE_EYE_COLOR))
|
||||
var/new_eyes = input("Please select eye color.", "Eye Color", rgb(owner.r_eyes, owner.g_eyes, owner.b_eyes)) as color|null
|
||||
if(new_eyes && can_still_topic(state))
|
||||
var/r_eyes = hex2num(copytext(new_eyes, 2, 4))
|
||||
var/g_eyes = hex2num(copytext(new_eyes, 4, 6))
|
||||
var/b_eyes = hex2num(copytext(new_eyes, 6, 8))
|
||||
if(owner.change_eye_color(r_eyes, g_eyes, b_eyes))
|
||||
update_dna()
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
/datum/nano_module/appearance_changer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state)
|
||||
generate_data(check_whitelist, whitelist, blacklist)
|
||||
var/data[0]
|
||||
|
||||
data["specimen"] = owner.species.name
|
||||
data["gender"] = owner.gender
|
||||
data["change_race"] = can_change(APPEARANCE_RACE)
|
||||
if(data["change_race"])
|
||||
var/species[0]
|
||||
for(var/specimen in valid_species)
|
||||
species[++species.len] = list("specimen" = specimen)
|
||||
data["species"] = species
|
||||
|
||||
data["change_gender"] = can_change(APPEARANCE_GENDER)
|
||||
data["change_skin_tone"] = can_change_skin_tone()
|
||||
data["change_skin_color"] = can_change_skin_color()
|
||||
data["change_eye_color"] = can_change(APPEARANCE_EYE_COLOR)
|
||||
data["change_hair"] = can_change(APPEARANCE_HAIR)
|
||||
if(data["change_hair"])
|
||||
var/hair_styles[0]
|
||||
for(var/hair_style in valid_hairstyles)
|
||||
hair_styles[++hair_styles.len] = list("hairstyle" = hair_style)
|
||||
data["hair_styles"] = hair_styles
|
||||
data["hair_style"] = owner.h_style
|
||||
|
||||
data["change_facial_hair"] = can_change(APPEARANCE_FACIAL_HAIR)
|
||||
if(data["change_facial_hair"])
|
||||
var/facial_hair_styles[0]
|
||||
for(var/facial_hair_style in valid_facial_hairstyles)
|
||||
facial_hair_styles[++facial_hair_styles.len] = list("facialhairstyle" = facial_hair_style)
|
||||
data["facial_hair_styles"] = facial_hair_styles
|
||||
data["facial_hair_style"] = owner.f_style
|
||||
|
||||
data["change_hair_color"] = can_change(APPEARANCE_HAIR_COLOR)
|
||||
data["change_facial_hair_color"] = can_change(APPEARANCE_FACIAL_HAIR_COLOR)
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "appearance_changer.tmpl", "[src]", 800, 450, state = state)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/datum/nano_module/appearance_changer/proc/update_dna()
|
||||
if(owner && (flags & APPEARANCE_UPDATE_DNA))
|
||||
owner.update_dna()
|
||||
|
||||
/datum/nano_module/appearance_changer/proc/can_change(var/flag)
|
||||
return owner && (flags & flag)
|
||||
|
||||
/datum/nano_module/appearance_changer/proc/can_change_skin_tone()
|
||||
return owner && (flags & APPEARANCE_SKIN) && owner.species.flags & HAS_SKIN_TONE
|
||||
|
||||
/datum/nano_module/appearance_changer/proc/can_change_skin_color()
|
||||
return owner && (flags & APPEARANCE_SKIN) && owner.species.flags & HAS_SKIN_COLOR
|
||||
|
||||
/datum/nano_module/appearance_changer/proc/cut_and_generate_data()
|
||||
// Making the assumption that the available species remain constant
|
||||
valid_facial_hairstyles.Cut()
|
||||
valid_facial_hairstyles.Cut()
|
||||
generate_data()
|
||||
|
||||
/datum/nano_module/appearance_changer/proc/generate_data()
|
||||
if(!valid_species.len)
|
||||
valid_species = owner.generate_valid_species(check_whitelist, whitelist, blacklist)
|
||||
if(!valid_hairstyles.len || !valid_facial_hairstyles.len)
|
||||
valid_hairstyles = owner.generate_valid_hairstyles()
|
||||
valid_facial_hairstyles = owner.generate_valid_facial_hairstyles()
|
||||
@@ -0,0 +1,12 @@
|
||||
/datum/nano_module
|
||||
var/name
|
||||
var/host
|
||||
|
||||
/datum/nano_module/New(var/host)
|
||||
src.host = host
|
||||
|
||||
/datum/nano_module/nano_host()
|
||||
return host ? host : src
|
||||
|
||||
/datum/nano_module/proc/can_still_topic(var/datum/topic_state/state = default_state)
|
||||
return CanUseTopic(usr, state) == STATUS_INTERACTIVE
|
||||
@@ -0,0 +1,64 @@
|
||||
/datum/nano_module/power_monitor
|
||||
name = "Power monitor"
|
||||
var/select_monitor = 0
|
||||
var/obj/machinery/computer/monitor/powermonitor
|
||||
|
||||
/datum/nano_module/power_monitor/silicon
|
||||
select_monitor = 1
|
||||
|
||||
/datum/nano_module/power_monitor/New()
|
||||
..()
|
||||
if(!select_monitor)
|
||||
powermonitor = nano_host()
|
||||
|
||||
/datum/nano_module/power_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state)
|
||||
var/data[0]
|
||||
var/pMonData[0]
|
||||
var/apcData[0]
|
||||
|
||||
data["powermonitor"] = powermonitor
|
||||
if(select_monitor)
|
||||
data["select_monitor"] = 1
|
||||
for(var/obj/machinery/computer/monitor/pMon in world)
|
||||
if( !(pMon.stat & (NOPOWER|BROKEN)) )
|
||||
pMonData[++pMonData.len] = list ("Name" = pMon.name, "ref" = "\ref[pMon]")
|
||||
|
||||
data["powermonitors"] = pMonData
|
||||
|
||||
if (powermonitor && !isnull(powermonitor.powernet))
|
||||
data["poweravail"] = powermonitor.powernet.avail
|
||||
data["powerload"] = num2text(powermonitor.powernet.viewload,10)
|
||||
var/list/L = list()
|
||||
for(var/obj/machinery/power/terminal/term in powermonitor.powernet.nodes)
|
||||
if(istype(term.master, /obj/machinery/power/apc))
|
||||
var/obj/machinery/power/apc/A = term.master
|
||||
L += A
|
||||
|
||||
var/list/Status = list(0,0,1,1) // Status: off, auto-off, on, auto-on
|
||||
var/list/chg = list(0,1,1) // Charging: nope, charging, full
|
||||
for(var/obj/machinery/power/apc/A in L)
|
||||
apcData[++apcData.len] = list("Name" = html_encode(A.area.name), "Equipment" = Status[A.equipment+1], "Lights" = Status[A.lighting+1], "Environment" = Status[A.environ+1], "CellPct" = A.cell ? round(A.cell.percent(),1) : -1, "CellStatus" = A.cell ? chg[A.charging+1] : 0)
|
||||
|
||||
data["apcs"] = apcData
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "power_monitor.tmpl", "Power Monitoring Console", 800, 700, state = state)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/datum/nano_module/power_monitor/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
if(href_list["selectmonitor"])
|
||||
if(issilicon(usr))
|
||||
powermonitor = locate(href_list["selectmonitor"])
|
||||
return 1
|
||||
|
||||
if(href_list["return"])
|
||||
if(issilicon(usr))
|
||||
powermonitor = null
|
||||
return 1
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
/atom/movable/proc/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/nano_ui/master_ui = null, var/datum/topic_state/custom_state = null)
|
||||
/datum/proc/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/nano_ui/master_ui = null, var/datum/topic_state/state = default_state)
|
||||
return
|
||||
|
||||
// Used by the Nano UI Manager (/datum/nanomanager) to track UIs opened by this mob
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user