mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-27 14:08:44 +01:00
Allows more than one holodeck
The current code does not account for there ever being more than one holodeck. This alters it so that you can make various subtypes of the holodeck computer for other areas, each with different loadable programs.
This commit is contained in:
@@ -18,23 +18,57 @@
|
||||
var/mob/last_to_emag = null
|
||||
var/last_change = 0
|
||||
var/last_gravity_change = 0
|
||||
var/list/supported_programs = list( \
|
||||
"Empty Court" = "emptycourt", \
|
||||
"Basketball Court" = "basketball", \
|
||||
"Thunderdome Court" = "thunderdomecourt", \
|
||||
"Boxing Ring"="boxingcourt", \
|
||||
"Beach" = "beach", \
|
||||
"Desert" = "desert", \
|
||||
"Space" = "space", \
|
||||
"Picnic Area" = "picnicarea", \
|
||||
"Snow Field" = "snowfield", \
|
||||
"Theatre" = "theatre", \
|
||||
"Meeting Hall" = "meetinghall", \
|
||||
"Courtroom" = "courtroom", \
|
||||
"Turn Off" = "turnoff" \
|
||||
|
||||
var/area/projection_area = /area/holodeck/alphadeck
|
||||
var/current_program
|
||||
var/powerdown_program = "Turn Off"
|
||||
var/default_program = "Empty Court"
|
||||
|
||||
var/list/supported_programs = list(
|
||||
"Empty Court" = new/datum/holodeck_program(/area/holodeck/source_emptycourt, list('sound/music/THUNDERDOME.ogg')),
|
||||
"Boxing Ring" = new/datum/holodeck_program(/area/holodeck/source_boxingcourt, list('sound/music/THUNDERDOME.ogg')),
|
||||
"Basketball" = new/datum/holodeck_program(/area/holodeck/source_basketball, list('sound/music/THUNDERDOME.ogg')),
|
||||
"Thunderdome" = new/datum/holodeck_program(/area/holodeck/source_thunderdomecourt, list('sound/music/THUNDERDOME.ogg')),
|
||||
"Beach" = new/datum/holodeck_program(/area/holodeck/source_beach),
|
||||
"Desert" = new/datum/holodeck_program(/area/holodeck/source_desert,
|
||||
list(
|
||||
'sound/effects/wind/wind_2_1.ogg',
|
||||
'sound/effects/wind/wind_2_2.ogg',
|
||||
'sound/effects/wind/wind_3_1.ogg',
|
||||
'sound/effects/wind/wind_4_1.ogg',
|
||||
'sound/effects/wind/wind_4_2.ogg',
|
||||
'sound/effects/wind/wind_5_1.ogg'
|
||||
)
|
||||
),
|
||||
"Snowfield" = new/datum/holodeck_program(/area/holodeck/source_snowfield,
|
||||
list(
|
||||
'sound/effects/wind/wind_2_1.ogg',
|
||||
'sound/effects/wind/wind_2_2.ogg',
|
||||
'sound/effects/wind/wind_3_1.ogg',
|
||||
'sound/effects/wind/wind_4_1.ogg',
|
||||
'sound/effects/wind/wind_4_2.ogg',
|
||||
'sound/effects/wind/wind_5_1.ogg'
|
||||
)
|
||||
),
|
||||
"Space" = new/datum/holodeck_program(/area/holodeck/source_space,
|
||||
list(
|
||||
'sound/ambience/ambispace.ogg',
|
||||
'sound/music/main.ogg',
|
||||
'sound/music/space.ogg',
|
||||
'sound/music/traitor.ogg',
|
||||
)
|
||||
),
|
||||
"Picnic Area" = new/datum/holodeck_program(/area/holodeck/source_picnicarea, list('sound/music/title2.ogg')),
|
||||
"Theatre" = new/datum/holodeck_program(/area/holodeck/source_theatre),
|
||||
"Meetinghall" = new/datum/holodeck_program(/area/holodeck/source_meetinghall),
|
||||
"Courtroom" = new/datum/holodeck_program(/area/holodeck/source_courtroom, list('sound/music/traitor.ogg')),
|
||||
"Turn Off" = new/datum/holodeck_program(/area/holodeck/source_plating, list())
|
||||
)
|
||||
|
||||
var/list/restricted_programs = list(
|
||||
"Burnoff Test Simulation" = new/datum/holodeck_program(/area/holodeck/source_burntest, list()),
|
||||
"Wildlife Simulation" = new/datum/holodeck_program(/area/holodeck/source_wildlife, list())
|
||||
)
|
||||
var/list/restricted_programs = list("Atmospheric Burn Simulation" = "burntest", "Wildlife Simulation" = "wildlifecarp")
|
||||
var/current_program = "turnoff"
|
||||
|
||||
/obj/machinery/computer/HolodeckControl/attack_ai(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
@@ -59,10 +93,10 @@
|
||||
var/restricted_program_list[0]
|
||||
|
||||
for(var/P in supported_programs)
|
||||
program_list[++program_list.len] = list("name" = P, "program" = supported_programs[P])
|
||||
program_list[++program_list.len] = P
|
||||
|
||||
for(var/P in restricted_programs)
|
||||
restricted_program_list[++restricted_program_list.len] = list("name" = P, "program" = restricted_programs[P])
|
||||
restricted_program_list[++restricted_program_list.len] = P
|
||||
|
||||
data["supportedPrograms"] = program_list
|
||||
data["restrictedPrograms"] = restricted_program_list
|
||||
@@ -93,9 +127,9 @@
|
||||
|
||||
if(href_list["program"])
|
||||
var/prog = href_list["program"]
|
||||
if(prog in holodeck_programs)
|
||||
loadProgram(holodeck_programs[prog])
|
||||
current_program = href_list["program"]
|
||||
if(prog in (supported_programs + restricted_programs))
|
||||
loadProgram(prog)
|
||||
current_program = prog
|
||||
|
||||
else if(href_list["AIoverride"])
|
||||
if(!issilicon(usr))
|
||||
@@ -150,7 +184,10 @@
|
||||
|
||||
/obj/machinery/computer/HolodeckControl/New()
|
||||
..()
|
||||
linkedholodeck = locate(/area/holodeck/alphadeck)
|
||||
current_program = powerdown_program
|
||||
linkedholodeck = locate(projection_area)
|
||||
if(!linkedholodeck)
|
||||
world << "<span class='danger'>Holodeck computer at [x],[y],[z] failed to locate projection area.</span>"
|
||||
|
||||
//This could all be done better, but it works for now.
|
||||
/obj/machinery/computer/HolodeckControl/Destroy()
|
||||
@@ -185,7 +222,7 @@
|
||||
|
||||
if(!checkInteg(linkedholodeck))
|
||||
damaged = 1
|
||||
loadProgram(holodeck_programs["turnoff"], 0)
|
||||
loadProgram(powerdown_program, 0)
|
||||
active = 0
|
||||
use_power = 1
|
||||
for(var/mob/M in range(10,src))
|
||||
@@ -227,9 +264,9 @@
|
||||
//Why is it called toggle if it doesn't toggle?
|
||||
/obj/machinery/computer/HolodeckControl/proc/togglePower(var/toggleOn = 0)
|
||||
if(toggleOn)
|
||||
loadProgram(holodeck_programs["emptycourt"], 0)
|
||||
loadProgram(default_program, 0)
|
||||
else
|
||||
loadProgram(holodeck_programs["turnoff"], 0)
|
||||
loadProgram(powerdown_program, 0)
|
||||
|
||||
if(!linkedholodeck.has_gravity)
|
||||
linkedholodeck.gravitychange(1,linkedholodeck)
|
||||
@@ -238,9 +275,18 @@
|
||||
use_power = 1
|
||||
|
||||
|
||||
/obj/machinery/computer/HolodeckControl/proc/loadProgram(var/datum/holodeck_program/HP, var/check_delay = 1)
|
||||
/obj/machinery/computer/HolodeckControl/proc/loadProgram(var/prog, var/check_delay = 1)
|
||||
if(!prog)
|
||||
return
|
||||
|
||||
var/datum/holodeck_program/HP
|
||||
if(prog in supported_programs)
|
||||
HP = supported_programs[prog]
|
||||
else if(prog in restricted_programs)
|
||||
HP = restricted_programs[prog]
|
||||
if(!HP)
|
||||
return
|
||||
|
||||
var/area/A = locate(HP.target)
|
||||
if(!A)
|
||||
return
|
||||
@@ -324,7 +370,7 @@
|
||||
|
||||
/obj/machinery/computer/HolodeckControl/proc/emergencyShutdown()
|
||||
//Turn it back to the regular non-holographic room
|
||||
loadProgram(holodeck_programs["turnoff"], 0)
|
||||
loadProgram(powerdown_program, 0)
|
||||
|
||||
if(!linkedholodeck.has_gravity)
|
||||
linkedholodeck.gravitychange(1,linkedholodeck)
|
||||
|
||||
Reference in New Issue
Block a user