Ghost Roles (#6706)

This commit is contained in:
Werner
2019-08-10 23:57:49 +02:00
committed by GitHub
parent 15fcefb923
commit a8e4e7f88c
36 changed files with 1865 additions and 683 deletions
@@ -0,0 +1,41 @@
/datum/ghostspawner/simplemob/maintdrone
short_name = "maintdrone"
name = "Maintenence Drone"
desc = "Maintain and Improve the Systems on the Aurora"
tags = list("Simple Mobs")
respawn_flag = MINISYNTH //Flag to check for when trying to spawn someone of that type (CREW, ANIMAL, MINISYNTH)
jobban_job = "Cyborg"
//Vars regarding the mob to use
spawn_mob = /mob/living/simple_animal/rat //The mob that should be spawned
/datum/ghostspawner/simplemob/maintdrone/cant_see()
if(!config.allow_drone_spawn)
return "Spawning as drone is disabled"
return ..()
/datum/ghostspawner/simplemob/maintdrone/select_spawnpoint(var/use)
return TRUE //We just fake it here, since the spawnpoint is selected if someone is spawned in.
//The proc to actually spawn in the user
/datum/ghostspawner/simplemob/maintdrone/spawn_mob(mob/user)
var/obj/machinery/drone_fabricator/fabricator
var/list/all_fabricators = list()
for(var/obj/machinery/drone_fabricator/DF in SSmachinery.all_machines)
if((DF.stat & NOPOWER) || !DF.produce_drones || DF.drone_progress < 100)
continue
all_fabricators[DF.fabricator_tag] = DF
if(!all_fabricators.len)
to_chat(user, "<span class='danger'>There are no available drone spawn points, sorry.</span>")
return FALSE
var/choice = input(user, "Which fabricator do you wish to use?") as null|anything in all_fabricators
if(!choice || !all_fabricators[choice])
return FALSE
fabricator = all_fabricators[choice]
if(user && fabricator && !((fabricator.stat & NOPOWER) || !fabricator.produce_drones || fabricator.drone_progress < 100))
return fabricator.create_drone(user.client)
return FALSE
@@ -0,0 +1,41 @@
/datum/ghostspawner/simplemob/rat
short_name = "rat"
name = "Rat"
desc = "Join as a Rat on the aurora, a common nuciance to the crew."
welcome_message = "You are now a rat. Though you may interact with players, do not give any hints away that you are more than a simple rodent. Find food, avoid cats, and try to survive!"
tags = list("Simple Mobs")
respawn_flag = ANIMAL //Flag to check for when trying to spawn someone of that type (CREW, ANIMAL, MINISYNTH)
//Vars regarding the mob to use
spawn_mob = /mob/living/simple_animal/rat //The mob that should be spawned
//This proc selects the spawnpoint to use.
/datum/ghostspawner/simplemob/rat/select_spawnpoint()
//find a viable mouse candidate
var/obj/machinery/atmospherics/unary/vent_pump/spawnpoint = find_mouse_spawnpoint(pick(current_map.station_levels))
return get_turf(spawnpoint)
/datum/ghostspawner/simplemob/rat/cant_see()
if(config.disable_player_rats)
return "Spawning as Rat is disabled"
return ..()
//The proc to actually spawn in the user
/datum/ghostspawner/simplemob/rat/spawn_mob(mob/user)
//Select a spawnpoint (if available)
var/turf/T = select_spawnpoint()
var/mob/living/simple_animal/S
if (T)
S = new spawn_mob(T)
else
to_chat(user, "<span class='warning'>Unable to find any safe, unwelded vents to spawn rats at. The station must be quite a mess! Trying again might work, if you think there's still a safe place. </span>")
if(S)
if(config.uneducated_rats)
S.universal_understand = 0
announce_ghost_joinleave(user, 0, "They are now a [name].")
S.ckey = user.ckey
return S