mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-27 06:54:18 +01:00
Ghost Roles (#6706)
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
datum/preferences
|
||||
//The mob should have a gender you want before running this proc. Will run fine without H
|
||||
proc/randomize_appearance_for(var/mob/living/carbon/human/H)
|
||||
gender = pick(MALE, FEMALE)
|
||||
proc/randomize_appearance_for(var/mob/living/carbon/human/H,var/random_gender=TRUE)
|
||||
if(random_gender)
|
||||
gender = pick(MALE, FEMALE)
|
||||
else
|
||||
gender = H.gender
|
||||
var/datum/species/current_species = all_species[species]
|
||||
|
||||
if(current_species)
|
||||
|
||||
@@ -487,46 +487,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
to_chat(src, "<span class='notice'>Temperature: [round(environment.temperature-T0C,0.1)]°C ([round(environment.temperature,0.1)]K)</span>")
|
||||
to_chat(src, "<span class='notice'>Heat Capacity: [round(environment.heat_capacity(),0.1)]</span>")
|
||||
|
||||
/mob/abstract/observer/verb/become_mouse()
|
||||
set name = "Become Rat"
|
||||
set category = "Ghost"
|
||||
|
||||
if(config.disable_player_rats)
|
||||
to_chat(src, "<span class='warning'>Spawning as a rat is currently disabled.</span>")
|
||||
return
|
||||
|
||||
if(!ROUND_IS_STARTED)
|
||||
to_chat(src, "<span class='warning'>You can not spawn as a rat before round start!</span>")
|
||||
return
|
||||
|
||||
if(!MayRespawn(1, ANIMAL))
|
||||
return
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T || (T.z in current_map.admin_levels))
|
||||
to_chat(src, "<span class='warning'>You may not spawn as a rat on this Z-level.</span>")
|
||||
return
|
||||
|
||||
var/response = alert(src, "Are you -sure- you want to become a rat?","Are you sure you want to squeek?","Squeek!","Nope!")
|
||||
if(response != "Squeek!") return //Hit the wrong key...again.
|
||||
|
||||
|
||||
//find a viable mouse candidate
|
||||
var/mob/living/simple_animal/rat/host
|
||||
var/obj/machinery/atmospherics/unary/vent_pump/spawnpoint = find_mouse_spawnpoint(T.z)
|
||||
|
||||
if (spawnpoint)
|
||||
host = new /mob/living/simple_animal/rat(spawnpoint.loc)
|
||||
else
|
||||
to_chat(src, "<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(host)
|
||||
if(config.uneducated_rats)
|
||||
host.universal_understand = 0
|
||||
announce_ghost_joinleave(src, 0, "They are now a rat.")
|
||||
host.ckey = src.ckey
|
||||
to_chat(host, "<span class='info'>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!</span>")
|
||||
|
||||
/proc/find_mouse_spawnpoint(var/ZLevel)
|
||||
//This function will attempt to find a good spawnpoint for rats, and prevent them from spawning in closed vent systems with no escape
|
||||
//It does this by bruteforce: Picks a random vent, tests if it has enough connections, if not, repeat
|
||||
@@ -643,7 +603,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if(usr == src && try_possession(M))
|
||||
return
|
||||
if(istype(over, /obj/machinery/drone_fabricator))
|
||||
if(try_drone_spawn(src, over))
|
||||
var/obj/machinery/drone_fabricator/fab = over
|
||||
if(fab.create_drone(src))
|
||||
return
|
||||
|
||||
return ..()
|
||||
@@ -658,7 +619,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
//Used for drawing on walls with blood puddles as a spooky ghost.
|
||||
/mob/abstract/observer/verb/bloody_doodle()
|
||||
|
||||
set category = "Ghost"
|
||||
set name = "Write in blood"
|
||||
set desc = "If the round is sufficiently spooky, write a short message in blood on the floor or a wall. Remember, no IC in OOC or OOC in IC."
|
||||
@@ -959,3 +919,15 @@ mob/abstract/observer/MayRespawn(var/feedback = 0, var/respawn_type = null)
|
||||
if((!target) || (!ghost)) return
|
||||
. = "<a href='byond://?src=\ref[ghost];track=\ref[target]'>\[F\]</a>"
|
||||
. += target.extra_ghost_link(ghost)
|
||||
|
||||
|
||||
//Opens the Ghost Spawner Menu
|
||||
/mob/abstract/observer/verb/ghost_spawner()
|
||||
set category = "Ghost"
|
||||
set name = "Ghost Spawner"
|
||||
|
||||
if(!ROUND_IS_STARTED)
|
||||
to_chat(usr, "<span class='danger'>The round hasn't started yet!</span>")
|
||||
return
|
||||
|
||||
SSghostroles.vui_interact(src)
|
||||
@@ -80,6 +80,8 @@ This saves us from having to call add_fingerprint() any time something is put in
|
||||
return 1
|
||||
if(slot_tie)
|
||||
return 1
|
||||
if(slot_in_belt)
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/human/u_equip(obj/W as obj)
|
||||
if(!W) return 0
|
||||
@@ -291,6 +293,10 @@ This saves us from having to call add_fingerprint() any time something is put in
|
||||
if(src.get_active_hand() == W)
|
||||
src.remove_from_mob(W)
|
||||
W.forceMove(src.back)
|
||||
if(slot_in_belt)
|
||||
if(src.get_active_hand() == W)
|
||||
src.remove_from_mob(W)
|
||||
W.forceMove(src.belt)
|
||||
if(slot_tie)
|
||||
var/obj/item/clothing/under/uniform = src.w_uniform
|
||||
uniform.attackby(W,src)
|
||||
|
||||
@@ -52,6 +52,10 @@
|
||||
if(slot_w_uniform in equip_slots)
|
||||
equip_slots |= slot_tie
|
||||
|
||||
|
||||
if(slot_belt in equip_slots)
|
||||
equip_slots |= slot_in_belt
|
||||
|
||||
equip_slots |= slot_legcuffed
|
||||
|
||||
/datum/hud_data/diona
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
/obj/machinery/drone_fabricator/examine(mob/user)
|
||||
..(user)
|
||||
if(produce_drones && drone_progress >= 100 && istype(user,/mob/abstract) && config.allow_drone_spawn && count_drones() < config.max_maint_drones)
|
||||
to_chat(user, "<BR><B>A drone is prepared. Select 'Join As Drone' from the Ghost tab to spawn as a maintenance drone.</B>")
|
||||
to_chat(user, "<BR><B>A drone is prepared. use 'Ghost Roles' from the Ghost tab to spawn as a maintenance drone.</B>")
|
||||
|
||||
/obj/machinery/drone_fabricator/proc/create_drone(var/client/player)
|
||||
|
||||
@@ -84,47 +84,4 @@
|
||||
|
||||
drone_progress = 0
|
||||
|
||||
/mob/abstract/observer/verb/join_as_drone()
|
||||
set category = "Ghost"
|
||||
set name = "Join As Drone"
|
||||
set desc = "If there is a powered, enabled fabricator in the game world with a prepared chassis, join as a maintenance drone."
|
||||
try_drone_spawn(src)
|
||||
|
||||
/proc/try_drone_spawn(var/mob/user, var/obj/machinery/drone_fabricator/fabricator)
|
||||
|
||||
if(!ROUND_IS_STARTED)
|
||||
to_chat(user, "<span class='danger'>The game hasn't started yet!</span>")
|
||||
return
|
||||
|
||||
if(!(config.allow_drone_spawn))
|
||||
to_chat(user, "<span class='danger'>That verb is not currently permitted.</span>")
|
||||
return
|
||||
|
||||
if(jobban_isbanned(user,"Cyborg"))
|
||||
to_chat(user, "<span class='danger'>You are banned from playing synthetics and cannot spawn as a drone.</span>")
|
||||
return
|
||||
|
||||
if(!user.MayRespawn(1, MINISYNTH))
|
||||
return
|
||||
|
||||
if(!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
|
||||
|
||||
var/choice = input(user,"Which fabricator do you wish to use?") as null|anything in all_fabricators
|
||||
if(!choice || !all_fabricators[choice])
|
||||
return
|
||||
fabricator = all_fabricators[choice]
|
||||
|
||||
if(user && fabricator && !((fabricator.stat & NOPOWER) || !fabricator.produce_drones || fabricator.drone_progress < 100))
|
||||
fabricator.create_drone(user.client)
|
||||
return 1
|
||||
return
|
||||
return new_drone
|
||||
@@ -54,4 +54,3 @@
|
||||
MOB_STOP_THINKING(src)
|
||||
|
||||
update_client_color()
|
||||
testing("mob_login - end")
|
||||
|
||||
Reference in New Issue
Block a user