Holoperson Tweaks (#16314)

* Number of active holopeople limted to 4.
Holopeople now dissipate when the Holodeck control console loses power.
Holopeople can no longer spawn when the Holodeck control console is unpowered or broken.
Holopeople now receive more specific rules regarding their behavior.
Holopeople now receive names rather than numbers.
Spawning as a holoperson is now done through the Holodeck control console interface.

* Topic() support for ghosts.

* Holopeople who ghost will now be despawned.

* Suggested changes.

* Adds some hologram names.
This commit is contained in:
Shadowmech88
2017-10-29 12:03:49 -05:00
committed by Pieter-Jan Briers
parent 467df3d033
commit 30af596b00
4 changed files with 69 additions and 22 deletions

View File

@@ -12,6 +12,8 @@
var/list/holographic_items = list()
var/damaged = 0
var/last_change = 0
var/list/connected_holopeople = list()
var/maximum_holopeople = 4
light_color = LIGHT_COLOR_CYAN
@@ -22,22 +24,32 @@
/obj/machinery/computer/HolodeckControl/attack_paw(var/mob/user as mob)
return
///obj/machinery/computer/HolodeckControl/attack_ghost(mob/dead/observer/user)
// if(!ticker || ticker.current_state != GAME_STATE_PLAYING)
// to_chat(user, "<span class='notice'>You can't do this until the game has started.</span>")
// return
// if(!linkedholodeck)
// return
// var/turf/spawnturf
// var/list/L = get_area_turfs(linkedholodeck.type)
// L = shuffle(L)
// for(var/turf/T in L)
// if(!is_blocked_turf(T))
// spawnturf = T
// break
// if(spawnturf)
// user.forceMove(spawnturf)
// user.transmogrify(/mob/living/simple_animal/hologram/advanced, TRUE)
/obj/machinery/computer/HolodeckControl/proc/spawn_holoperson(mob/dead/observer/user)
if(stat & (NOPOWER|BROKEN|MAINT))
return
if(!ticker || ticker.current_state != GAME_STATE_PLAYING)
to_chat(user, "<span class='notice'>You can't do this until the game has started.</span>")
return
if(!linkedholodeck)
return
if(connected_holopeople.len >= maximum_holopeople)
to_chat(user, "<span class='notice'>\The [src] cannot sustain any additional advanced holograms. Please try again when there are fewer advanced holograms on the holodeck.</span>")
return
var/turf/spawnturf
var/list/L = get_area_turfs(linkedholodeck.type)
var/turf/T = pick(L)
while(is_blocked_turf(T))
T = pick(L)
if(spawnturf)
user.forceMove(spawnturf)
var/mob/living/simple_animal/hologram/advanced/H = user.transmogrify(/mob/living/simple_animal/hologram/advanced, TRUE)
connected_holopeople.Add(H)
H.connected_holoconsole = src
var/list/N = hologram_names.Copy()
for(var/mob/M in connected_holopeople)
N.Remove(M.name)
H.name = capitalize(pick(N))
H.real_name = H.name
/obj/machinery/computer/HolodeckControl/attack_hand(var/mob/user as mob)
@@ -46,8 +58,10 @@
user.set_machine(src)
var/dat
dat += {"<B>Holodeck Control System</B><BR>
<HR>Current Loaded Programs:<BR>
dat += {"<B>Holodeck Control System</B><BR>"}
// if(isobserver(user))
// dat += {"<HR><A href='?src=\ref[src];spawn_holoperson=1'>\[Become Advanced Hologram\]</font></A><BR>"}
dat += {"<HR>Current Loaded Programs:<BR>
<A href='?src=\ref[src];basketball=1'>((Basketball Court)</font>)</A><BR>
<A href='?src=\ref[src];beach=1'>((Beach)</font>)</A><BR>
<A href='?src=\ref[src];boxingcourt=1'>((Boxing Court)</font>)</A><BR>
@@ -101,11 +115,14 @@
return
/obj/machinery/computer/HolodeckControl/Topic(href, href_list)
usr.set_machine(src)
if(href_list["spawn_holoperson"])
spawn_holoperson(usr)
if(..())
return 1
else
usr.set_machine(src)
if(href_list["emptycourt"])
target = locate(/area/holodeck/source_emptycourt)
if(target)
@@ -415,6 +432,8 @@
//Get rid of any items
for(var/item in holographic_items)
derez(item)
for(var/mob/living/simple_animal/hologram/advanced/H in connected_holopeople)
H.dissipate()
//Turn it back to the regular non-holographic room
target = locate(/area/holodeck/source_plating)
if(target)

View File

@@ -74,6 +74,7 @@
var/obj/item/w_uniform
var/obj/item/wear_suit
var/list/obj/abstract/Overlays/obj_overlays[TOTAL_LAYERS]
var/obj/machinery/computer/HolodeckControl/connected_holoconsole
/mob/living/simple_animal/hologram/advanced/New()
..()
@@ -85,7 +86,9 @@
/mob/living/simple_animal/hologram/advanced/Login()
..()
to_chat(src, "You are a hologram. You can perform a few basic functions, and are unable to leave the holodeck. <span class='danger'>You know nothing of this station or its crew except what you learn from this point on.</span>")
to_chat(src, "You are a hologram. You can perform a few basic functions, and are unable to leave the holodeck.\
\n<span class='danger'>You know nothing of this station or its crew except what you learn from this point on.</span>\
\n<span class='danger'>Do not damage the holodeck. Do not harm crew members without their consent.</span>")
if(transmogged_from)
to_chat(src, "Use the spell in the top-right corner of the screen to go back to being a ghost.")
@@ -93,6 +96,9 @@
head = null
w_uniform = null
wear_suit = null
if(connected_holoconsole)
connected_holoconsole.connected_holopeople.Remove(src)
connected_holoconsole = null
transmogrify()
..()
@@ -107,7 +113,7 @@
/mob/living/simple_animal/hologram/advanced/Life()
..()
regular_hud_updates()
if(!istype(get_area(src), /area/holodeck))
if(!istype(get_area(src), /area/holodeck) || (mind && !client))
dissipate()
/mob/living/simple_animal/hologram/proc/dissipate()

View File

@@ -18,5 +18,6 @@ var/list/adjectives = file2list("config/names/adjectives.txt")
var/list/vox_name_syllables = list("cha","chi","ha","hi","ka","kah","ki","ta","ti","ya","ya","yi")
var/list/golem_names = file2list("config/names/golem.txt")
var/list/borer_names = file2list("config/names/borer.txt")
var/list/hologram_names = file2list("config/names/hologram.txt")
var/list/autoborg_silly_names = file2listExceptComments("config/names/autoborg_silly.txt")

21
config/names/hologram.txt Normal file
View File

@@ -0,0 +1,21 @@
Rimmer
Benton
Leith
Fontaine
Barclay
Lister
Lewis
Gatebox
Switch
Hal-O'Gram
Neo
Morpheus
Trinity
Cypher
Apoc
Dozer
Tank
Mouse
Architect
Oracle
Smith