Makes all global variables handled by the GLOB controller (#13152)

* Handlers converted, now to fix 3532 compile errors

* 3532 compile fixes later, got runtimes on startup

* Well the server loads now atleast

* Take 2

* Oops
This commit is contained in:
AffectedArc07
2020-03-21 03:56:37 +00:00
committed by GitHub
parent c8dbd0190e
commit 210f8badf4
667 changed files with 4243 additions and 4240 deletions
-5
View File
@@ -1,5 +0,0 @@
/*
Creature-level abilities.
*/
/var/global/list/ability_verbs = list( )
+1 -1
View File
@@ -1,6 +1,6 @@
/mob/dead/observer/Logout()
if(client)
client.images -= ghost_images
client.images -= GLOB.ghost_images
..()
spawn(0)
if(src && !key) //we've transferred to another mob. This ghost should be deleted.
+14 -14
View File
@@ -1,7 +1,7 @@
#define GHOST_CAN_REENTER 1
#define GHOST_IS_OBSERVER 2
var/list/image/ghost_images = list()
GLOBAL_LIST_EMPTY(ghost_images)
GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
@@ -75,10 +75,10 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
ghostimage.appearance_flags |= KEEP_TOGETHER
ghostimage.alpha = alpha
appearance_flags |= KEEP_TOGETHER
ghost_images |= ghostimage
GLOB.ghost_images |= ghostimage
updateallghostimages()
if(!T)
T = pick(latejoin) //Safety in case we cannot find the body's position
if(!T)
T = pick(GLOB.latejoin) //Safety in case we cannot find the body's position
forceMove(T)
if(!name) //To prevent nameless ghosts
@@ -95,7 +95,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
M.following_mobs -= src
following = null
if(ghostimage)
ghost_images -= ghostimage
GLOB.ghost_images -= ghostimage
QDEL_NULL(ghostimage)
updateallghostimages()
return ..()
@@ -319,11 +319,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
src << sound(sound)
/mob/dead/observer/proc/show_me_the_hud(hud_index)
var/datum/atom_hud/H = huds[hud_index]
var/datum/atom_hud/H = GLOB.huds[hud_index]
H.add_hud_to(src)
/mob/dead/observer/proc/remove_the_hud(hud_index) //remove old huds
var/datum/atom_hud/H = huds[hud_index]
var/datum/atom_hud/H = GLOB.huds[hud_index]
H.remove_hud_from(src)
/mob/dead/observer/verb/toggle_medHUD()
@@ -340,7 +340,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
show_me_the_hud(DATA_HUD_SECURITY_ADVANCED)
show_me_the_hud(DATA_HUD_MEDICAL_ADVANCED)
to_chat(src, "<span class='notice'>All HUDs enabled.</span>")
if(DATA_HUD_DIAGNOSTIC + DATA_HUD_SECURITY_ADVANCED + DATA_HUD_MEDICAL_ADVANCED)
if(DATA_HUD_DIAGNOSTIC + DATA_HUD_SECURITY_ADVANCED + DATA_HUD_MEDICAL_ADVANCED)
data_hud_seen = DATA_HUD_SECURITY_ADVANCED
remove_the_hud(DATA_HUD_DIAGNOSTIC)
remove_the_hud(DATA_HUD_MEDICAL_ADVANCED)
@@ -386,7 +386,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
//var/datum/atom_hud/A = huds[DATA_HUD_SECURITY_ADVANCED]
//var/adding_hud = (usr in A.hudusers) ? 0 : 1
for(var/datum/atom_hud/antag/H in (huds))
for(var/datum/atom_hud/antag/H in (GLOB.huds))
if(!M.antagHUD)
H.add_hud_to(usr)
else
@@ -407,7 +407,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
to_chat(usr, "Not when you're not dead!")
return
var/datum/async_input/A = input_autocomplete_async(usr, "Area to jump to: ", ghostteleportlocs)
var/datum/async_input/A = input_autocomplete_async(usr, "Area to jump to: ", GLOB.ghostteleportlocs)
A.on_close(CALLBACK(src, .proc/teleport))
/mob/dead/observer/proc/teleport(area/thearea)
@@ -505,7 +505,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set name = "Jump to Mob"
set desc = "Teleport to a mob"
if(isobserver(usr)) //Make sure they're an observer!
if(isobserver(usr)) //Make sure they're an observer!
var/list/dest = getpois(mobs_only=1) //Fill list, prompt user with list
var/datum/async_input/A = input_autocomplete_async(usr, "Enter a mob name: ", dest)
A.on_close(CALLBACK(src, .proc/jump_to_mob))
@@ -616,7 +616,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
var/dat
dat += "<h4>Crew Manifest</h4>"
dat += data_core.get_manifest()
dat += GLOB.data_core.get_manifest()
src << browse(dat, "window=manifest;size=370x420;can_close=1")
@@ -743,10 +743,10 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(!client)
return
if(seedarkness || !ghostvision)
client.images -= ghost_images
client.images -= GLOB.ghost_images
else
//add images for the 60inv things ghosts can normally see when darkness is enabled so they can see them now
client.images |= ghost_images
client.images |= GLOB.ghost_images
if(ghostimage)
client.images -= ghostimage //remove ourself
+5 -5
View File
@@ -126,7 +126,7 @@
if(isturf(loc))
I.remove(src)
I.forceMove(get_turf(src))
I.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),5)
I.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5)
for(var/mob/M in src)
if(M in src.stomach_contents)
@@ -388,7 +388,7 @@
dna = newDNA
var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump, /obj/machinery/atmospherics/unary/vent_scrubber)
GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/vent_pump, /obj/machinery/atmospherics/unary/vent_scrubber))
/mob/living/handle_ventcrawl(var/atom/clicked_on) // -- TLE -- Merged by Carn
if(!Adjacent(clicked_on))
@@ -432,7 +432,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
if(!vent_found)
for(var/obj/machinery/atmospherics/machine in range(1,src))
if(is_type_in_list(machine, ventcrawl_machinery))
if(is_type_in_list(machine, GLOB.ventcrawl_machinery))
vent_found = machine
if(!vent_found.can_crawl_through())
@@ -1016,7 +1016,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
if(!forceFed(toEat, user, fullness))
return 0
consume(toEat, bitesize_override, can_taste_container = toEat.can_taste)
score_foodeaten++
GLOB.score_foodeaten++
return 1
/mob/living/carbon/proc/selfFeed(var/obj/item/reagent_containers/food/toEat, fullness)
@@ -1103,7 +1103,7 @@ so that different stomachs can handle things in different ways VB*/
//to recalculate and update the mob's total tint from tinted equipment it's wearing.
/mob/living/carbon/proc/update_tint()
if(!tinted_weldhelh)
if(!GLOB.tinted_weldhelh)
return
var/tinttotal = get_total_tint()
if(tinttotal >= TINT_BLIND)
@@ -1,4 +1,4 @@
/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)
/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 = GLOB.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)
@@ -104,9 +104,9 @@
if(!body_accessory_style || (body_accessory && body_accessory.name == body_accessory_style))
return
for(var/B in body_accessory_by_name)
for(var/B in GLOB.body_accessory_by_name)
if(B == body_accessory_style)
body_accessory = body_accessory_by_name[body_accessory_style]
body_accessory = GLOB.body_accessory_by_name[body_accessory_style]
found = 1
if(!found)
@@ -340,7 +340,7 @@
if((H.gender == MALE && S.gender == FEMALE) || (H.gender == FEMALE && S.gender == MALE))
continue
if(H.dna.species.bodyflags & ALL_RPARTS) //If the user is a species who can have a robotic head...
var/datum/robolimb/robohead = all_robolimbs[H.model]
var/datum/robolimb/robohead = GLOB.all_robolimbs[H.model]
if((H.dna.species.name in S.species_allowed) && robohead.is_monitor && ((S.models_allowed && (robohead.company in S.models_allowed)) || !S.models_allowed)) //If this is a hair style native to the user's species, check to see if they have a head with an ipc-style screen and that the head's company is in the screen style's allowed models list.
valid_hairstyles += hairstyle //Give them their hairstyles if they do.
else
@@ -368,7 +368,7 @@
if((H.gender == MALE && S.gender == FEMALE) || (H.gender == FEMALE && S.gender == MALE))
continue
if(H.dna.species.bodyflags & ALL_RPARTS) //If the user is a species who can have a robotic head...
var/datum/robolimb/robohead = all_robolimbs[H.model]
var/datum/robolimb/robohead = GLOB.all_robolimbs[H.model]
if(H.dna.species.name in S.species_allowed) //If this is a facial hair style native to the user's species...
if((H.dna.species.name in S.species_allowed) && robohead.is_monitor && ((S.models_allowed && (robohead.company in S.models_allowed)) || !S.models_allowed)) //If this is a facial hair style native to the user's species, check to see if they have a head with an ipc-style screen and that the head's company is in the screen style's allowed models list.
valid_facial_hairstyles += facialhairstyle //Give them their facial hairstyles if they do.
@@ -422,7 +422,7 @@
if(location == "head")
var/datum/sprite_accessory/body_markings/head/M = GLOB.marking_styles_list[S.name]
if(H.dna.species.bodyflags & ALL_RPARTS) //If the user is a species that can have a robotic head...
var/datum/robolimb/robohead = all_robolimbs[H.model]
var/datum/robolimb/robohead = GLOB.all_robolimbs[H.model]
if(!(S.models_allowed && (robohead.company in S.models_allowed))) //Make sure they don't get markings incompatible with their head.
continue
else if(H.alt_head && H.alt_head != "None") //If the user's got an alt head, validate markings for that head.
@@ -437,10 +437,10 @@
/mob/living/carbon/human/proc/generate_valid_body_accessories()
var/list/valid_body_accessories = new()
for(var/B in body_accessory_by_name)
var/datum/body_accessory/A = body_accessory_by_name[B]
for(var/B in GLOB.body_accessory_by_name)
var/datum/body_accessory/A = GLOB.body_accessory_by_name[B]
if(check_rights(R_ADMIN, 0, src))
valid_body_accessories = body_accessory_by_name.Copy()
valid_body_accessories = GLOB.body_accessory_by_name.Copy()
else
if(!istype(A))
valid_body_accessories["None"] = "None" //The only null entry should be the "None" option.
@@ -1,29 +1,29 @@
var/global/list/body_accessory_by_name = list("None" = null)
GLOBAL_LIST_INIT(body_accessory_by_name, list("None" = null))
/hook/startup/proc/initalize_body_accessories()
__init_body_accessory(/datum/body_accessory/body)
__init_body_accessory(/datum/body_accessory/tail)
if(body_accessory_by_name.len)
if(GLOB.body_accessory_by_name.len)
if(initialize_body_accessory_by_species())
return TRUE
return FALSE //fail if no bodies are found
var/global/list/body_accessory_by_species = list("None" = null)
GLOBAL_LIST_INIT(body_accessory_by_species, list("None" = null))
/proc/initialize_body_accessory_by_species()
for(var/B in body_accessory_by_name)
var/datum/body_accessory/accessory = body_accessory_by_name[B]
for(var/B in GLOB.body_accessory_by_name)
var/datum/body_accessory/accessory = GLOB.body_accessory_by_name[B]
if(!istype(accessory)) continue
for(var/species in accessory.allowed_species)
if(!body_accessory_by_species["[species]"]) body_accessory_by_species["[species]"] = list()
body_accessory_by_species["[species]"] += accessory
if(!GLOB.body_accessory_by_species["[species]"]) GLOB.body_accessory_by_species["[species]"] = list()
GLOB.body_accessory_by_species["[species]"] += accessory
if(body_accessory_by_species.len)
if(GLOB.body_accessory_by_species.len)
return TRUE
return FALSE
@@ -34,7 +34,7 @@ var/global/list/body_accessory_by_species = list("None" = null)
for(var/A in subtypesof(ba_path))
var/datum/body_accessory/B = new A
if(istype(B))
body_accessory_by_name[B.name] += B
GLOB.body_accessory_by_name[B.name] += B
++_added_counter
if(_added_counter)
@@ -21,7 +21,7 @@
var/atom/movable/thing = I.remove(src)
if(thing)
thing.forceMove(get_turf(src))
thing.throw_at(get_edge_target_turf(src, pick(alldirs)), rand(1,3), 5)
thing.throw_at(get_edge_target_turf(src, pick(GLOB.alldirs)), rand(1,3), 5)
for(var/obj/item/organ/external/E in bodyparts)
if(istype(E, /obj/item/organ/external/chest))
@@ -345,9 +345,9 @@
var/criminal = "None"
if(perpname)
for(var/datum/data/record/E in data_core.general)
for(var/datum/data/record/E in GLOB.data_core.general)
if(E.fields["name"] == perpname)
for(var/datum/data/record/R in data_core.security)
for(var/datum/data/record/R in GLOB.data_core.security)
if(R.fields["id"] == E.fields["id"])
criminal = R.fields["criminal"]
var/criminal_status = hasHUD(user, "read_only_security") ? "\[[criminal]\]" : "<a href='?src=[UID()];criminal=1'>\[[criminal]\]</a>"
@@ -358,9 +358,9 @@
var/perpname = get_visible_name(TRUE)
var/medical = "None"
for(var/datum/data/record/E in data_core.general)
for(var/datum/data/record/E in GLOB.data_core.general)
if(E.fields["name"] == perpname)
for(var/datum/data/record/R in data_core.general)
for(var/datum/data/record/R in GLOB.data_core.general)
if(R.fields["id"] == E.fields["id"])
medical = R.fields["p_stat"]
+26 -26
View File
@@ -30,7 +30,7 @@
create_reagents(330)
martial_art = default_martial_art
martial_art = GLOB.default_martial_art
handcrafting = new()
@@ -710,9 +710,9 @@
var/perpname = get_visible_name(TRUE)
if(perpname != "Unknown")
for(var/datum/data/record/E in data_core.general)
for(var/datum/data/record/E in GLOB.data_core.general)
if(E.fields["name"] == perpname)
for(var/datum/data/record/R in data_core.security)
for(var/datum/data/record/R in GLOB.data_core.security)
if(R.fields["id"] == E.fields["id"])
var/setcriminal = input(usr, "Specify a new criminal status for this person.", "Security HUD", R.fields["criminal"]) in list("None", "*Arrest*", "Incarcerated", "Parolled", "Released", "Cancel")
@@ -749,9 +749,9 @@
var/perpname = get_visible_name(TRUE)
var/read = 0
for(var/datum/data/record/E in data_core.general)
for(var/datum/data/record/E in GLOB.data_core.general)
if(E.fields["name"] == perpname)
for(var/datum/data/record/R in data_core.security)
for(var/datum/data/record/R in GLOB.data_core.security)
if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"security"))
to_chat(usr, "<b>Name:</b> [R.fields["name"]] <b>Criminal Status:</b> [R.fields["criminal"]]")
@@ -773,9 +773,9 @@
var/perpname = get_visible_name(TRUE)
var/read = 0
for(var/datum/data/record/E in data_core.general)
for(var/datum/data/record/E in GLOB.data_core.general)
if(E.fields["name"] == perpname)
for(var/datum/data/record/R in data_core.security)
for(var/datum/data/record/R in GLOB.data_core.security)
if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"security"))
read = 1
@@ -795,9 +795,9 @@
return
var/perpname = get_visible_name(TRUE)
for(var/datum/data/record/E in data_core.general)
for(var/datum/data/record/E in GLOB.data_core.general)
if(E.fields["name"] == perpname)
for(var/datum/data/record/R in data_core.security)
for(var/datum/data/record/R in GLOB.data_core.security)
if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"security"))
var/t1 = copytext(trim(sanitize(input("Add Comment:", "Sec. records", null, null) as message)), 1, MAX_MESSAGE_LEN)
@@ -805,13 +805,13 @@
return
if(ishuman(usr))
var/mob/living/carbon/human/U = usr
R.fields["comments"] += "Made by [U.get_authentification_name()] ([U.get_assignment()]) on [current_date_string] [station_time_timestamp()]<BR>[t1]"
R.fields["comments"] += "Made by [U.get_authentification_name()] ([U.get_assignment()]) on [GLOB.current_date_string] [station_time_timestamp()]<BR>[t1]"
if(isrobot(usr))
var/mob/living/silicon/robot/U = usr
R.fields["comments"] += "Made by [U.name] ([U.modtype] [U.braintype]) on [current_date_string] [station_time_timestamp()]<BR>[t1]"
R.fields["comments"] += "Made by [U.name] ([U.modtype] [U.braintype]) on [GLOB.current_date_string] [station_time_timestamp()]<BR>[t1]"
if(isAI(usr))
var/mob/living/silicon/ai/U = usr
R.fields["comments"] += "Made by [U.name] (artificial intelligence) on [current_date_string] [station_time_timestamp()]<BR>[t1]"
R.fields["comments"] += "Made by [U.name] (artificial intelligence) on [GLOB.current_date_string] [station_time_timestamp()]<BR>[t1]"
if(href_list["medical"])
if(hasHUD(usr,"medical"))
@@ -820,9 +820,9 @@
var/modified = 0
var/perpname = get_visible_name(TRUE)
for(var/datum/data/record/E in data_core.general)
for(var/datum/data/record/E in GLOB.data_core.general)
if(E.fields["name"] == perpname)
for(var/datum/data/record/R in data_core.general)
for(var/datum/data/record/R in GLOB.data_core.general)
if(R.fields["id"] == E.fields["id"])
var/setmedical = input(usr, "Specify a new medical status for this person.", "Medical HUD", R.fields["p_stat"]) in list("*SSD*", "*Deceased*", "Physically Unfit", "Active", "Disabled", "Cancel")
@@ -830,8 +830,8 @@
if(setmedical != "Cancel")
R.fields["p_stat"] = setmedical
modified = 1
if(PDA_Manifest.len)
PDA_Manifest.Cut()
if(GLOB.PDA_Manifest.len)
GLOB.PDA_Manifest.Cut()
spawn()
sec_hud_set_security_status()
@@ -846,9 +846,9 @@
var/read = 0
var/perpname = get_visible_name(TRUE)
for(var/datum/data/record/E in data_core.general)
for(var/datum/data/record/E in GLOB.data_core.general)
if(E.fields["name"] == perpname)
for(var/datum/data/record/R in data_core.medical)
for(var/datum/data/record/R in GLOB.data_core.medical)
if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"medical"))
to_chat(usr, "<b>Name:</b> [R.fields["name"]] <b>Blood Type:</b> [R.fields["b_type"]]")
@@ -871,9 +871,9 @@
var/perpname = get_visible_name(TRUE)
var/read = 0
for(var/datum/data/record/E in data_core.general)
for(var/datum/data/record/E in GLOB.data_core.general)
if(E.fields["name"] == perpname)
for(var/datum/data/record/R in data_core.medical)
for(var/datum/data/record/R in GLOB.data_core.medical)
if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"medical"))
read = 1
@@ -892,9 +892,9 @@
if(usr.incapacitated())
return
var/perpname = get_visible_name(TRUE)
for(var/datum/data/record/E in data_core.general)
for(var/datum/data/record/E in GLOB.data_core.general)
if(E.fields["name"] == perpname)
for(var/datum/data/record/R in data_core.medical)
for(var/datum/data/record/R in GLOB.data_core.medical)
if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"medical"))
var/t1 = copytext(trim(sanitize(input("Add Comment:", "Med. records", null, null) as message)), 1, MAX_MESSAGE_LEN)
@@ -902,13 +902,13 @@
return
if(ishuman(usr))
var/mob/living/carbon/human/U = usr
R.fields["comments"] += "Made by [U.get_authentification_name()] ([U.get_assignment()]) on [current_date_string] [station_time_timestamp()]<BR>[t1]"
R.fields["comments"] += "Made by [U.get_authentification_name()] ([U.get_assignment()]) on [GLOB.current_date_string] [station_time_timestamp()]<BR>[t1]"
if(isrobot(usr))
var/mob/living/silicon/robot/U = usr
R.fields["comments"] += "Made by [U.name] ([U.modtype] [U.braintype]) on [current_date_string] [station_time_timestamp()]<BR>[t1]"
R.fields["comments"] += "Made by [U.name] ([U.modtype] [U.braintype]) on [GLOB.current_date_string] [station_time_timestamp()]<BR>[t1]"
if(isAI(usr))
var/mob/living/silicon/ai/U = usr
R.fields["comments"] += "Made by [U.name] (artificial intelligence) on [current_date_string] [station_time_timestamp()]<BR>[t1]"
R.fields["comments"] += "Made by [U.name] (artificial intelligence) on [GLOB.current_date_string] [station_time_timestamp()]<BR>[t1]"
if(href_list["lookitem"])
var/obj/item/I = locate(href_list["lookitem"])
@@ -1551,7 +1551,7 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
//Check for arrest warrant
if(judgebot.check_records)
var/perpname = get_visible_name(TRUE)
var/datum/data/record/R = find_record("name", perpname, data_core.security)
var/datum/data/record/R = find_record("name", perpname, GLOB.data_core.security)
if(R && R.fields["criminal"])
switch(R.fields["criminal"])
if("*Execute*")
@@ -1,4 +1,4 @@
var/global/default_martial_art = new/datum/martial_art
GLOBAL_DATUM_INIT(default_martial_art, /datum/martial_art, new())
/mob/living/carbon/human
hud_possible = list(HEALTH_HUD,STATUS_HUD,ID_HUD,WANTED_HUD,IMPMINDSHIELD_HUD,IMPCHEM_HUD,IMPTRACK_HUD,SPECIALROLE_HUD,GLAND_HUD)
+2 -2
View File
@@ -87,7 +87,7 @@
Jitter(1000)
// If we have the gene for being crazy, have random events.
if(dna.GetSEState(HALLUCINATIONBLOCK))
if(dna.GetSEState(GLOB.hallucinationblock))
if(prob(1))
Hallucinate(20)
@@ -167,7 +167,7 @@
emote("drool")
/mob/living/carbon/human/handle_mutations_and_radiation()
for(var/datum/dna/gene/gene in dna_genes)
for(var/datum/dna/gene/gene in GLOB.dna_genes)
if(!gene.block)
continue
if(gene.is_active(src))
+1 -1
View File
@@ -161,7 +161,7 @@
verb = pick("whinnies", "neighs", "says")
if(dna)
for(var/datum/dna/gene/gene in dna_genes)
for(var/datum/dna/gene/gene in GLOB.dna_genes)
if(!gene.block)
continue
if(gene.is_active(src))
@@ -37,10 +37,10 @@
H.gender = NEUTER
H.languages.Cut() //Under no condition should you be able to speak any language
H.add_language("Abductor Mindlink") //other than over the abductor's own mindlink
var/datum/atom_hud/abductor_hud = huds[DATA_HUD_ABDUCTOR]
var/datum/atom_hud/abductor_hud = GLOB.huds[DATA_HUD_ABDUCTOR]
abductor_hud.add_hud_to(H)
/datum/species/abductor/on_species_loss(mob/living/carbon/human/H)
..()
var/datum/atom_hud/abductor_hud = huds[DATA_HUD_ABDUCTOR]
var/datum/atom_hud/abductor_hud = GLOB.huds[DATA_HUD_ABDUCTOR]
abductor_hud.remove_hud_from(H)
@@ -32,9 +32,9 @@
/datum/species/grey/handle_dna(mob/living/carbon/human/H, remove)
..()
H.dna.SetSEState(REMOTETALKBLOCK, !remove, 1)
genemutcheck(H, REMOTETALKBLOCK, null, MUTCHK_FORCED)
H.dna.default_blocks.Add(REMOTETALKBLOCK)
H.dna.SetSEState(GLOB.remotetalkblock, !remove, 1)
genemutcheck(H, GLOB.remotetalkblock, null, MUTCHK_FORCED)
H.dna.default_blocks.Add(GLOB.remotetalkblock)
/datum/species/grey/water_act(mob/living/carbon/human/H, volume, temperature, source, method = REAGENT_TOUCH)
. = ..()
@@ -116,7 +116,7 @@
to_chat(H, "<span class='warning'>Where's your head at? Can't change your monitor/display without one.</span>")
return
var/datum/robolimb/robohead = all_robolimbs[head_organ.model]
var/datum/robolimb/robohead = GLOB.all_robolimbs[head_organ.model]
if(!head_organ)
return
if(!robohead.is_monitor) //If they've got a prosthetic head and it isn't a monitor, they've no screen to adjust. Instead, let them change the colour of their optics!
@@ -41,7 +41,7 @@
if(H.stat != CONSCIOUS)
return
if(prob(33) && H.canmove && isturf(H.loc) && !H.pulledby) //won't move if being pulled
step(H, pick(cardinal))
step(H, pick(GLOB.cardinal))
if(prob(1))
H.emote(pick("scratch","jump","roll","tail"))
@@ -57,8 +57,8 @@
/datum/species/monkey/handle_dna(mob/living/carbon/human/H, remove)
..()
if(!remove)
H.dna.SetSEState(MONKEYBLOCK, TRUE)
genemutcheck(H, MONKEYBLOCK, null, MUTCHK_FORCED)
H.dna.SetSEState(GLOB.monkeyblock, TRUE)
genemutcheck(H, GLOB.monkeyblock, null, MUTCHK_FORCED)
/datum/species/monkey/tajaran
name = "Farwa"
@@ -4,7 +4,7 @@
TODO: Proper documentation
icon_key is [species.race_key][g][husk][fat][hulk][skeleton][s_tone]
*/
var/global/list/human_icon_cache = list()
GLOBAL_LIST_EMPTY(human_icon_cache)
///////////////////////
//UPDATE_ICONS SYSTEM//
@@ -120,7 +120,7 @@ Please contact me on #coderbus IRC. ~Carn x
overlays_standing[cache_index] = null
var/global/list/damage_icon_parts = list()
GLOBAL_LIST_EMPTY(damage_icon_parts)
//DAMAGE OVERLAYS
//constructs damage icon for each organ from mask * damage field and saves it in our overlays_ lists
@@ -151,13 +151,13 @@ var/global/list/damage_icon_parts = list()
var/icon/DI
var/cache_index = "[E.damage_state]/[E.icon_name]/[dna.species.blood_color]/[dna.species.name]"
if(damage_icon_parts[cache_index] == null)
if(GLOB.damage_icon_parts[cache_index] == null)
DI = new /icon(dna.species.damage_overlays, E.damage_state) // the damage icon for whole human
DI.Blend(new /icon(dna.species.damage_mask, E.icon_name), ICON_MULTIPLY) // mask with this organ's pixels
DI.Blend(dna.species.blood_color, ICON_MULTIPLY)
damage_icon_parts[cache_index] = DI
GLOB.damage_icon_parts[cache_index] = DI
else
DI = damage_icon_parts[cache_index]
DI = GLOB.damage_icon_parts[cache_index]
damage_overlay.overlays += DI
apply_overlay(H_DAMAGE_LAYER)
@@ -191,8 +191,8 @@ var/global/list/damage_icon_parts = list()
var/icon_key = generate_icon_render_key()
var/mutable_appearance/base
if(human_icon_cache[icon_key] && !rebuild_base)
base = human_icon_cache[icon_key]
if(GLOB.human_icon_cache[icon_key] && !rebuild_base)
base = GLOB.human_icon_cache[icon_key]
standing += base
else
var/icon/base_icon
@@ -241,7 +241,7 @@ var/global/list/damage_icon_parts = list()
base_icon.Blend(husk_over, ICON_OVERLAY)
var/mutable_appearance/new_base = mutable_appearance(base_icon, layer = -LIMBS_LAYER)
human_icon_cache[icon_key] = new_base
GLOB.human_icon_cache[icon_key] = new_base
standing += new_base
//END CACHED ICON GENERATION.
@@ -459,7 +459,7 @@ var/global/list/damage_icon_parts = list()
if(gender == FEMALE)
g = "f"
// DNA2 - Drawing underlays.
for(var/datum/dna/gene/gene in dna_genes)
for(var/datum/dna/gene/gene in GLOB.dna_genes)
if(!gene.block)
continue
if(gene.is_active(src))
+2 -2
View File
@@ -1,6 +1,6 @@
/mob/living/Initialize()
. = ..()
var/datum/atom_hud/data/human/medical/advanced/medhud = huds[DATA_HUD_MEDICAL_ADVANCED]
var/datum/atom_hud/data/human/medical/advanced/medhud = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
medhud.add_to_hud(src)
faction += "\ref[src]"
@@ -580,7 +580,7 @@
newdir = NORTH
else if(newdir == 12) //E + W
newdir = EAST
if((newdir in cardinal) && (prob(50)))
if((newdir in GLOB.cardinal) && (prob(50)))
newdir = turn(get_dir(T, loc), 180)
if(!blood_exists)
new /obj/effect/decal/cleanable/trail_holder(loc)
+7 -7
View File
@@ -1,4 +1,4 @@
var/list/department_radio_keys = list(
GLOBAL_LIST_INIT(department_radio_keys, list(
":r" = "right ear", "#r" = "right ear", ".r" = "right ear",
":l" = "left ear", "#l" = "left ear", ".l" = "left ear",
":i" = "intercom", "#i" = "intercom", ".i" = "intercom",
@@ -34,20 +34,20 @@ var/list/department_radio_keys = list(
":-" = "Special Ops", "#-" = "Special Ops", ".-" = "Special Ops",
":_" = "SyndTeam", "#_" = "SyndTeam", "._" = "SyndTeam",
":X" = "cords", "#X" = "cords", ".X" = "cords"
)
))
GLOBAL_LIST_EMPTY(channel_to_radio_key)
var/list/channel_to_radio_key = new
proc/get_radio_key_from_channel(var/channel)
var/key = channel_to_radio_key[channel]
var/key = GLOB.channel_to_radio_key[channel]
if(!key)
for(var/radio_key in department_radio_keys)
if(department_radio_keys[radio_key] == channel)
for(var/radio_key in GLOB.department_radio_keys)
if(GLOB.department_radio_keys[radio_key] == channel)
key = radio_key
break
if(!key)
key = ""
channel_to_radio_key[channel] = key
GLOB.channel_to_radio_key[channel] = key
return key
+16 -16
View File
@@ -1,5 +1,5 @@
var/list/ai_list = list()
var/list/ai_verbs_default = list(
GLOBAL_LIST_EMPTY(ai_list)
GLOBAL_LIST_INIT(ai_verbs_default, list(
/mob/living/silicon/ai/proc/announcement,
/mob/living/silicon/ai/proc/ai_announcement_text,
/mob/living/silicon/ai/proc/ai_call_shuttle,
@@ -21,13 +21,13 @@ var/list/ai_verbs_default = list(
/mob/living/silicon/ai/proc/toggle_camera_light,
/mob/living/silicon/ai/proc/botcall,
/mob/living/silicon/ai/proc/change_arrival_message
)
))
//Not sure why this is necessary...
/proc/AutoUpdateAI(obj/subject)
var/is_in_use = 0
if(subject!=null)
for(var/A in ai_list)
for(var/A in GLOB.ai_list)
var/mob/living/silicon/ai/M = A
if((M.client && M.machine == subject))
is_in_use = 1
@@ -112,11 +112,11 @@ var/list/ai_verbs_default = list(
var/max_multicams = 6
/mob/living/silicon/ai/proc/add_ai_verbs()
verbs |= ai_verbs_default
verbs |= GLOB.ai_verbs_default
verbs |= silicon_subsystems
/mob/living/silicon/ai/proc/remove_ai_verbs()
verbs -= ai_verbs_default
verbs -= GLOB.ai_verbs_default
verbs -= silicon_subsystems
/mob/living/silicon/ai/New(loc, var/datum/ai_laws/L, var/obj/item/mmi/B, var/safety = 0)
@@ -206,7 +206,7 @@ var/list/ai_verbs_default = list(
builtInCamera.c_tag = name
builtInCamera.network = list("SS13")
ai_list += src
GLOB.ai_list += src
GLOB.shuttle_caller_list += src
..()
@@ -271,7 +271,7 @@ var/list/ai_verbs_default = list(
return TRUE
/mob/living/silicon/ai/Destroy()
ai_list -= src
GLOB.ai_list -= src
GLOB.shuttle_caller_list -= src
SSshuttle.autoEvac()
QDEL_NULL(eyeobj) // No AI, no Eye
@@ -607,7 +607,7 @@ var/list/ai_verbs_default = list(
unset_machine()
src << browse(null, t1)
if(href_list["switchcamera"])
switchCamera(locate(href_list["switchcamera"])) in cameranet.cameras
switchCamera(locate(href_list["switchcamera"])) in GLOB.cameranet.cameras
if(href_list["showalerts"])
subsystem_alarm_monitor()
if(href_list["show_paper"])
@@ -679,7 +679,7 @@ var/list/ai_verbs_default = list(
if(controlled_mech)
to_chat(src, "<span class='warning'>You are already loaded into an onboard computer!</span>")
return
if(!cameranet.checkCameraVis(M))
if(!GLOB.cameranet.checkCameraVis(M))
to_chat(src, "<span class='warning'>Exosuit is no longer near active cameras.</span>")
return
if(lacks_power())
@@ -768,7 +768,7 @@ var/list/ai_verbs_default = list(
//The target must be in view of a camera or near the core.
if(turf_check in range(get_turf(src)))
call_bot(turf_check)
else if(cameranet && cameranet.checkTurfVis(turf_check))
else if(GLOB.cameranet && GLOB.cameranet.checkTurfVis(turf_check))
call_bot(turf_check)
else
to_chat(src, "<span class='danger'>Selected location is not visible.</span>")
@@ -819,7 +819,7 @@ var/list/ai_verbs_default = list(
var/mob/living/silicon/ai/U = usr
for(var/obj/machinery/camera/C in cameranet.cameras)
for(var/obj/machinery/camera/C in GLOB.cameranet.cameras)
if(!C.can_use())
continue
@@ -840,7 +840,7 @@ var/list/ai_verbs_default = list(
if(isnull(network))
network = old_network // If nothing is selected
else
for(var/obj/machinery/camera/C in cameranet.cameras)
for(var/obj/machinery/camera/C in GLOB.cameranet.cameras)
if(!C.can_use())
continue
if(network in C.network)
@@ -916,7 +916,7 @@ var/list/ai_verbs_default = list(
if("Crew Member")
var/personnel_list[] = list()
for(var/datum/data/record/t in data_core.locked)//Look in data core locked.
for(var/datum/data/record/t in GLOB.data_core.locked)//Look in data core locked.
personnel_list["[t.fields["name"]]: [t.fields["rank"]]"] = t.fields["image"]//Pull names, rank, and image.
if(personnel_list.len)
@@ -1203,7 +1203,7 @@ var/list/ai_verbs_default = list(
//get_turf_pixel() is because APCs in maint aren't actually in view of the inner camera
//apc_override is needed here because AIs use their own APC when depowered
var/turf/T = isturf(A) ? A : get_turf_pixel(A)
return (cameranet && cameranet.checkTurfVis(T)) || apc_override
return (GLOB.cameranet && GLOB.cameranet.checkTurfVis(T)) || apc_override
//AI is carded/shunted
//view(src) returns nothing for carded/shunted AIs and they have x-ray vision so just use get_dist
var/list/viewscale = getviewsize(client.view)
@@ -1280,7 +1280,7 @@ var/list/ai_verbs_default = list(
to_chat(src, "<span class='warning'>Target is not on or near any active cameras on the station.</span>")
/mob/living/silicon/ai/proc/camera_visibility(mob/camera/aiEye/moved_eye)
cameranet.visibility(moved_eye, client, all_eyes)
GLOB.cameranet.visibility(moved_eye, client, all_eyes)
/mob/living/silicon/ai/forceMove(atom/destination)
. = ..()
+1 -1
View File
@@ -27,7 +27,7 @@
if(SSshuttle.emergency.mode == SHUTTLE_STRANDED)
SSshuttle.emergency.mode = SHUTTLE_DOCKED
SSshuttle.emergency.timer = world.time
priority_announcement.Announce("Hostile environment resolved. You have 3 minutes to board the Emergency Shuttle.", "Priority Announcement", 'sound/AI/shuttledock.ogg')
GLOB.priority_announcement.Announce("Hostile environment resolved. You have 3 minutes to board the Emergency Shuttle.", "Priority Announcement", 'sound/AI/shuttledock.ogg')
qdel(doomsday_device)
if(explosive)
@@ -4,7 +4,7 @@
#define CHUNK_SIZE 16 // Only chunk sizes that are to the power of 2. E.g: 2, 4, 8, 16, etc..
var/datum/cameranet/cameranet = new()
GLOBAL_DATUM_INIT(cameranet, /datum/cameranet, new())
/datum/cameranet
var/name = "Camera Net" // Name to show for VV and stat()
@@ -1,4 +1,4 @@
var/global/list/empty_playable_ai_cores = list()
GLOBAL_LIST_EMPTY(empty_playable_ai_cores)
/hook/roundstart/proc/spawn_empty_ai()
for(var/obj/effect/landmark/start/S in GLOB.landmarks_list)
@@ -6,7 +6,7 @@ var/global/list/empty_playable_ai_cores = list()
continue
if(locate(/mob/living) in S.loc)
continue
empty_playable_ai_cores += new /obj/structure/AIcore/deactivated(get_turf(S))
GLOB.empty_playable_ai_cores += new /obj/structure/AIcore/deactivated(get_turf(S))
return 1
@@ -21,8 +21,8 @@ var/global/list/empty_playable_ai_cores = list()
return
// We warned you.
empty_playable_ai_cores += new /obj/structure/AIcore/deactivated(loc)
global_announcer.autosay("[src] has been moved to intelligence storage.", "Artificial Intelligence Oversight")
GLOB.empty_playable_ai_cores += new /obj/structure/AIcore/deactivated(loc)
GLOB.global_announcer.autosay("[src] has been moved to intelligence storage.", "Artificial Intelligence Oversight")
//Handle job slot/tater cleanup.
var/job = mind.assigned_role
@@ -68,13 +68,13 @@ var/global/list/empty_playable_ai_cores = list()
// Before calling this, make sure an empty core exists, or this will no-op
/mob/living/silicon/ai/proc/moveToEmptyCore()
if(!empty_playable_ai_cores.len)
if(!GLOB.empty_playable_ai_cores.len)
log_runtime(EXCEPTION("moveToEmptyCore called without any available cores"), src)
return
// IsJobAvailable for AI checks that there is an empty core available in this list
var/obj/structure/AIcore/deactivated/C = empty_playable_ai_cores[1]
empty_playable_ai_cores -= C
var/obj/structure/AIcore/deactivated/C = GLOB.empty_playable_ai_cores[1]
GLOB.empty_playable_ai_cores -= C
forceMove(C.loc)
view_core()
@@ -135,7 +135,7 @@ GLOBAL_DATUM(ai_camera_room_landmark, /obj/effect/landmark/ai_multicam_room)
if(screen && screen.ai)
screen.ai.camera_visibility(src)
else
cameranet.visibility(src)
GLOB.cameranet.visibility(src)
update_camera_telegraphing()
/mob/camera/aiEye/pic_in_pic/proc/update_camera_telegraphing()
+10 -10
View File
@@ -65,7 +65,7 @@
* AI VOX Announcements
*/
var/announcing_vox = 0 // Stores the time of the last announcement
GLOBAL_VAR_INIT(announcing_vox, 0) // Stores the time of the last announcement
#define VOX_DELAY 100
#define VOX_PATH "sound/vox_fem/"
@@ -81,10 +81,10 @@ var/announcing_vox = 0 // Stores the time of the last announcement
<font class='bad'>WARNING:</font><BR>Misuse of the announcement system will get you job banned.<HR>"
var/index = 0
for(var/word in vox_sounds)
for(var/word in GLOB.vox_sounds)
index++
dat += "<A href='?src=[UID()];say_word=[word]'>[capitalize(word)]</A>"
if(index != vox_sounds.len)
if(index != GLOB.vox_sounds.len)
dat += " / "
var/datum/browser/popup = new(src, "announce_help", "Announcement Help", 500, 400)
@@ -95,8 +95,8 @@ var/announcing_vox = 0 // Stores the time of the last announcement
if(check_unable(AI_CHECK_WIRELESS | AI_CHECK_RADIO))
return
if(announcing_vox > world.time)
to_chat(src, "<span class='warning'>Please wait [round((announcing_vox - world.time) / 10)] seconds.</span>")
if(GLOB.announcing_vox > world.time)
to_chat(src, "<span class='warning'>Please wait [round((GLOB.announcing_vox - world.time) / 10)] seconds.</span>")
return
var/message = clean_input("WARNING: Misuse of this verb can result in you being job banned. More help is available in 'Announcement Help'", "Announcement", last_announcement, src)
@@ -106,7 +106,7 @@ var/announcing_vox = 0 // Stores the time of the last announcement
if(check_unable(AI_CHECK_WIRELESS | AI_CHECK_RADIO))
return
if(!message || announcing_vox > world.time)
if(!message || GLOB.announcing_vox > world.time)
return
var/list/words = splittext(trim(message), " ")
@@ -120,14 +120,14 @@ var/announcing_vox = 0 // Stores the time of the last announcement
if(!word)
words -= word
continue
if(!vox_sounds[word])
if(!GLOB.vox_sounds[word])
incorrect_words += word
if(incorrect_words.len)
to_chat(src, "<span class='warning'>These words are not available on the announcement system: [english_list(incorrect_words)].</span>")
return
announcing_vox = world.time + VOX_DELAY
GLOB.announcing_vox = world.time + VOX_DELAY
log_game("[key_name(src)] made a vocal announcement: [message].")
message_admins("[key_name_admin(src)] made a vocal announcement: [message].")
@@ -156,9 +156,9 @@ var/announcing_vox = 0 // Stores the time of the last announcement
word = lowertext(word)
if(vox_sounds[word])
if(GLOB.vox_sounds[word])
var/sound_file = vox_sounds[word]
var/sound_file = GLOB.vox_sounds[word]
var/sound/voice = sound(sound_file, wait = 1, channel = CHANNEL_VOX)
voice.status = SOUND_STREAM
@@ -1,6 +1,6 @@
// Recruiting observers to play as pAIs
var/datum/paiController/paiController // Global handler for pAI candidates
GLOBAL_DATUM(paiController, /datum/paiController) // Global handler for pAI candidates
/datum/paiCandidate
var/name
@@ -12,7 +12,7 @@ var/datum/paiController/paiController // Global handler for pAI candidates
/hook/startup/proc/paiControllerSetup()
paiController = new /datum/paiController()
GLOB.paiController = new /datum/paiController()
return 1
@@ -252,7 +252,7 @@ var/datum/paiController/paiController // Global handler for pAI candidates
/datum/paiController/proc/findPAI(var/obj/item/paicard/p, var/mob/user)
requestRecruits(p, user)
var/list/available = list()
for(var/datum/paiCandidate/c in paiController.pai_candidates)
for(var/datum/paiCandidate/c in GLOB.paiController.pai_candidates)
if(c.ready)
var/found = 0
for(var/mob/o in GLOB.respawnable_list)
+16 -16
View File
@@ -1,4 +1,4 @@
var/list/pai_emotions = list(
GLOBAL_LIST_INIT(pai_emotions, list(
"Happy" = 1,
"Cat" = 2,
"Extremely Happy" = 3,
@@ -8,28 +8,28 @@ var/list/pai_emotions = list(
"Sad" = 7,
"Angry" = 8,
"What" = 9
)
))
var/global/list/pai_software_by_key = list()
var/global/list/default_pai_software = list()
GLOBAL_LIST_EMPTY(pai_software_by_key)
GLOBAL_LIST_EMPTY(default_pai_software)
/hook/startup/proc/populate_pai_software_list()
var/r = 1 // I would use ., but it'd sacrifice runtime detection
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]
if(GLOB.pai_software_by_key[P.id])
var/datum/pai_software/O = GLOB.pai_software_by_key[P.id]
to_chat(world, "<span class='warning'>pAI software module [P.name] has the same key as [O.name]!</span>")
r = 0
continue
pai_software_by_key[P.id] = P
GLOB.pai_software_by_key[P.id] = P
if(P.default)
default_pai_software[P.id] = P
GLOB.default_pai_software[P.id] = P
return r
/mob/living/silicon/pai/New()
..()
software = default_pai_software.Copy()
software = GLOB.default_pai_software.Copy()
/mob/living/silicon/pai/verb/paiInterface()
set category = "pAI Commands"
@@ -37,7 +37,7 @@ var/global/list/default_pai_software = list()
ui_interact(src)
/mob/living/silicon/pai/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, datum/topic_state/state = self_state)
/mob/living/silicon/pai/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, datum/topic_state/state = GLOB.self_state)
if(ui_key != "main")
var/datum/pai_software/S = software[ui_key]
if(S && !S.toggle)
@@ -58,7 +58,7 @@ var/global/list/default_pai_software = list()
ui.open()
ui.set_auto_update(1)
/mob/living/silicon/pai/ui_data(mob/user, ui_key = "main", datum/topic_state/state = self_state)
/mob/living/silicon/pai/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.self_state)
var/data[0]
if(ui_key != "main")
@@ -72,8 +72,8 @@ var/global/list/default_pai_software = list()
// Software we have not bought
var/not_bought_software[0]
for(var/key in pai_software_by_key)
var/datum/pai_software/S = pai_software_by_key[key]
for(var/key in GLOB.pai_software_by_key)
var/datum/pai_software/S = GLOB.pai_software_by_key[key]
var/software_data[0]
software_data["name"] = S.name
software_data["id"] = S.id
@@ -90,10 +90,10 @@ var/global/list/default_pai_software = list()
// Emotions
var/emotions[0]
for(var/name in pai_emotions)
for(var/name in GLOB.pai_emotions)
var/emote[0]
emote["name"] = name
emote["id"] = pai_emotions[name]
emote["id"] = GLOB.pai_emotions[name]
emotions[++emotions.len] = emote
data["emotions"] = emotions
@@ -122,7 +122,7 @@ var/global/list/default_pai_software = list()
else if(href_list["purchase"])
var/soft = href_list["purchase"]
var/datum/pai_software/S = pai_software_by_key[soft]
var/datum/pai_software/S = GLOB.pai_software_by_key[soft]
if(S && (ram >= S.ram_cost))
ram -= S.ram_cost
software[S.id] = S
@@ -19,7 +19,7 @@
var/ui_width = 450
var/ui_height = 600
/datum/pai_software/proc/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = self_state)
/datum/pai_software/proc/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = GLOB.self_state)
return list()
/datum/pai_software/proc/toggle(mob/living/silicon/pai/user)
@@ -39,7 +39,7 @@
ui_title = "pAI Directives"
autoupdate = 1
/datum/pai_software/directives/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = self_state)
/datum/pai_software/directives/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = GLOB.self_state)
var/data[0]
data["master"] = user.master
@@ -94,7 +94,7 @@
ui_width = 300
ui_height = 150
/datum/pai_software/radio_config/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = self_state)
/datum/pai_software/radio_config/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = GLOB.self_state)
var/data[0]
data["listening"] = user.radio.broadcasting
@@ -129,11 +129,11 @@
template_file = "pai_manifest.tmpl"
ui_title = "Crew Manifest"
/datum/pai_software/crew_manifest/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = self_state)
/datum/pai_software/crew_manifest/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = GLOB.self_state)
var/data[0]
data_core.get_manifest_json()
data["manifest"] = PDA_Manifest
GLOB.data_core.get_manifest_json()
data["manifest"] = GLOB.PDA_Manifest
return data
@@ -147,7 +147,7 @@
template_file = "pai_messenger.tmpl"
ui_title = "Digital Messenger"
/datum/pai_software/messenger/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = self_state)
/datum/pai_software/messenger/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = GLOB.self_state)
var/data[0]
if(!user.pda)
@@ -165,7 +165,7 @@
var/pdas[0]
if(!M.toff)
for(var/obj/item/pda/P in PDAs)
for(var/obj/item/pda/P in GLOB.PDAs)
var/datum/data/pda/app/messenger/PM = P.find_program(/datum/data/pda/app/messenger)
if(P == user.pda || !PM || !PM.can_receive())
@@ -237,11 +237,11 @@
ui_title = "Medical Records"
/datum/pai_software/med_records/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = self_state)
/datum/pai_software/med_records/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = GLOB.self_state)
var/data[0]
var/records[0]
for(var/datum/data/record/general in sortRecord(data_core.general))
for(var/datum/data/record/general in sortRecord(GLOB.data_core.general))
var/record[0]
record["name"] = general.fields["name"]
record["ref"] = "\ref[general]"
@@ -266,11 +266,11 @@
if(record)
var/datum/data/record/R = record
var/datum/data/record/M = null
if(!( data_core.general.Find(R) ))
if(!( GLOB.data_core.general.Find(R) ))
P.medical_cannotfind = 1
else
P.medical_cannotfind = 0
for(var/datum/data/record/E in data_core.medical)
for(var/datum/data/record/E in GLOB.data_core.medical)
if((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"]))
M = E
P.medicalActive1 = R
@@ -290,11 +290,11 @@
ui_title = "Security Records"
/datum/pai_software/sec_records/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = self_state)
/datum/pai_software/sec_records/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = GLOB.self_state)
var/data[0]
var/records[0]
for(var/datum/data/record/general in sortRecord(data_core.general))
for(var/datum/data/record/general in sortRecord(GLOB.data_core.general))
var/record[0]
record["name"] = general.fields["name"]
record["ref"] = "\ref[general]"
@@ -319,13 +319,13 @@
if(record)
var/datum/data/record/R = record
var/datum/data/record/S = null
if(!( data_core.general.Find(R) ))
if(!( GLOB.data_core.general.Find(R) ))
P.securityActive1 = null
P.securityActive2 = null
P.security_cannotfind = 1
else
P.security_cannotfind = 0
for(var/datum/data/record/E in data_core.security)
for(var/datum/data/record/E in GLOB.data_core.security)
if((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"]))
S = E
P.securityActive1 = R
@@ -348,7 +348,7 @@
ui_width = 300
ui_height = 150
/datum/pai_software/door_jack/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = self_state)
/datum/pai_software/door_jack/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = GLOB.self_state)
var/data[0]
data["cable"] = user.cable != null
@@ -424,7 +424,7 @@
ui_height = 300
/datum/pai_software/atmosphere_sensor/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = self_state)
/datum/pai_software/atmosphere_sensor/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = GLOB.self_state)
var/data[0]
var/turf/T = get_turf_or_move(user.loc)
@@ -543,7 +543,7 @@
ui_width = 320
ui_height = 150
/datum/pai_software/signaller/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = self_state)
/datum/pai_software/signaller/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = GLOB.self_state)
var/data[0]
data["frequency"] = format_frequency(user.sradio.frequency)
@@ -586,7 +586,7 @@
ui_width = 400
ui_height = 350
/datum/pai_software/host_scan/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = self_state)
/datum/pai_software/host_scan/on_ui_data(mob/living/silicon/pai/user, datum/topic_state/state = GLOB.self_state)
var/data[0]
var/mob/living/held = user.loc
var/count = 0
@@ -188,7 +188,7 @@
message_admins("[key_name_admin(user)] emagged drone [key_name_admin(src)]. Laws overridden.")
log_game("[key_name(user)] emagged drone [key_name(src)]. Laws overridden.")
var/time = time2text(world.realtime,"hh:mm:ss")
lawchanges.Add("[time] <B>:</B> [H.name]([H.key]) emagged [name]([key])")
GLOB.lawchanges.Add("[time] <B>:</B> [H.name]([H.key]) emagged [name]([key])")
emagged_time = world.time
emagged = 1
@@ -1,6 +1,6 @@
var/list/robot_verbs_default = list(
GLOBAL_LIST_INIT(robot_verbs_default, list(
/mob/living/silicon/robot/proc/sensor_mode,
)
))
/mob/living/silicon/robot
name = "Cyborg"
@@ -144,7 +144,7 @@ var/list/robot_verbs_default = list(
if(!cell) // Make sure a new cell gets created *before* executing initialize_components(). The cell component needs an existing cell for it to get set up properly
cell = new /obj/item/stock_parts/cell/high(src)
initialize_components()
//if(!unfinished)
// Create all the robot parts.
@@ -290,7 +290,7 @@ var/list/robot_verbs_default = list(
var/list/modules = list("Standard", "Engineering", "Medical", "Miner", "Janitor", "Service", "Security")
if(islist(force_modules) && force_modules.len)
modules = force_modules.Copy()
if(security_level == (SEC_LEVEL_GAMMA || SEC_LEVEL_EPSILON) || crisis)
if(GLOB.security_level == (SEC_LEVEL_GAMMA || SEC_LEVEL_EPSILON) || crisis)
to_chat(src, "<span class='warning'>Crisis mode active. The combat module is now available.</span>")
modules += "Combat"
if(mmi != null && mmi.alien)
@@ -512,11 +512,11 @@ var/list/robot_verbs_default = list(
toggle_sensor_mode()
/mob/living/silicon/robot/proc/add_robot_verbs()
src.verbs |= robot_verbs_default
src.verbs |= GLOB.robot_verbs_default
src.verbs |= silicon_subsystems
/mob/living/silicon/robot/proc/remove_robot_verbs()
src.verbs -= robot_verbs_default
src.verbs -= GLOB.robot_verbs_default
src.verbs -= silicon_subsystems
/mob/living/silicon/robot/proc/ionpulse()
@@ -852,7 +852,7 @@ var/list/robot_verbs_default = list(
clear_inherent_laws()
laws = new /datum/ai_laws/syndicate_override
var/time = time2text(world.realtime,"hh:mm:ss")
lawchanges.Add("[time] <B>:</B> [M.name]([M.key]) emagged [name]([key])")
GLOB.lawchanges.Add("[time] <B>:</B> [M.name]([M.key]) emagged [name]([key])")
set_zeroth_law("Only [M.real_name] and people [M.p_they()] designate[M.p_s()] as being such are Syndicate Agents.")
to_chat(src, "<span class='warning'>ALERT: Foreign software detected.</span>")
sleep(5)
@@ -1134,7 +1134,7 @@ var/list/robot_verbs_default = list(
updating = 1
spawn(BORG_CAMERA_BUFFER)
if(oldLoc != src.loc)
cameranet.updatePortableCamera(src.camera)
GLOB.cameranet.updatePortableCamera(src.camera)
updating = 0
if(module)
if(module.type == /obj/item/robot_module/janitor)
+9 -9
View File
@@ -38,7 +38,7 @@
/mob/living/silicon/New()
GLOB.silicon_mob_list |= src
..()
var/datum/atom_hud/data/diagnostic/diag_hud = huds[DATA_HUD_DIAGNOSTIC]
var/datum/atom_hud/data/diagnostic/diag_hud = GLOB.huds[DATA_HUD_DIAGNOSTIC]
diag_hud.add_to_hud(src)
diag_hud_set_status()
diag_hud_set_health()
@@ -217,8 +217,8 @@
/mob/living/silicon/proc/show_station_manifest()
var/dat
dat += "<h4>Crew Manifest</h4>"
if(data_core)
dat += data_core.get_manifest(1) // make it monochrome
if(GLOB.data_core)
dat += GLOB.data_core.get_manifest(1) // make it monochrome
dat += "<br>"
src << browse(dat, "window=airoster")
onclose(src, "airoster")
@@ -244,24 +244,24 @@
return 1
/mob/living/silicon/proc/remove_med_sec_hud()
var/datum/atom_hud/secsensor = huds[sec_hud]
var/datum/atom_hud/medsensor = huds[med_hud]
for(var/datum/atom_hud/data/diagnostic/diagsensor in huds)
var/datum/atom_hud/secsensor = GLOB.huds[sec_hud]
var/datum/atom_hud/medsensor = GLOB.huds[med_hud]
for(var/datum/atom_hud/data/diagnostic/diagsensor in GLOB.huds)
diagsensor.remove_hud_from(src)
secsensor.remove_hud_from(src)
medsensor.remove_hud_from(src)
/mob/living/silicon/proc/add_sec_hud()
var/datum/atom_hud/secsensor = huds[sec_hud]
var/datum/atom_hud/secsensor = GLOB.huds[sec_hud]
secsensor.add_hud_to(src)
/mob/living/silicon/proc/add_med_hud()
var/datum/atom_hud/medsensor = huds[med_hud]
var/datum/atom_hud/medsensor = GLOB.huds[med_hud]
medsensor.add_hud_to(src)
/mob/living/silicon/proc/add_diag_hud()
for(var/datum/atom_hud/data/diagnostic/diagsensor in huds)
for(var/datum/atom_hud/data/diagnostic/diagsensor in GLOB.huds)
diagsensor.add_hud_to(src)
@@ -20,7 +20,7 @@
/mob/living/silicon/proc/subsystem_law_manager,
/mob/living/silicon/proc/subsystem_power_monitor
)
/mob/living/silicon/robot/drone
silicon_subsystems = list(
/mob/living/silicon/proc/subsystem_alarm_monitor,
@@ -54,8 +54,8 @@
set name = "Alarm Monitor"
set category = "Subsystems"
alarm_monitor.ui_interact(usr, state = self_state)
alarm_monitor.ui_interact(usr, state = GLOB.self_state)
/********************
* Atmos Control *
********************/
@@ -63,7 +63,7 @@
set category = "Subsystems"
set name = "Atmospherics Control"
atmos_control.ui_interact(usr, state = self_state)
atmos_control.ui_interact(usr, state = GLOB.self_state)
/********************
* Crew Monitor *
@@ -72,8 +72,8 @@
set category = "Subsystems"
set name = "Crew Monitor"
crew_monitor.ui_interact(usr, state = self_state)
crew_monitor.ui_interact(usr, state = GLOB.self_state)
/****************
* Law Manager *
****************/
@@ -81,8 +81,8 @@
set name = "Law Manager"
set category = "Subsystems"
law_manager.ui_interact(usr, state = conscious_state)
law_manager.ui_interact(usr, state = GLOB.conscious_state)
/********************
* Power Monitor *
********************/
@@ -90,5 +90,5 @@
set category = "Subsystems"
set name = "Power Monitor"
power_monitor.ui_interact(usr, state = self_state)
power_monitor.ui_interact(usr, state = GLOB.self_state)
@@ -160,7 +160,7 @@
SSradio.add_object(bot_core, control_freq, bot_filter)
prepare_huds()
for(var/datum/atom_hud/data/diagnostic/diag_hud in huds)
for(var/datum/atom_hud/data/diagnostic/diag_hud in GLOB.huds)
diag_hud.add_to_hud(src)
diag_hud.add_hud_to(src)
permanent_huds |= diag_hud
@@ -391,7 +391,7 @@
pulse2.icon_state = "empdisable"
pulse2.name = "emp sparks"
pulse2.anchored = 1
pulse2.dir = pick(cardinal)
pulse2.dir = pick(GLOB.cardinal)
QDEL_IN(pulse2, 10)
if(paicard)
@@ -1051,7 +1051,7 @@ Pass a positive integer as an argument to override a bot's default speed.
path = newpath ? newpath : list()
if(!path_hud)
return
var/list/path_huds_watching_me = list(huds[DATA_HUD_DIAGNOSTIC_ADVANCED])
var/list/path_huds_watching_me = list(GLOB.huds[DATA_HUD_DIAGNOSTIC_ADVANCED])
if(path_hud)
path_huds_watching_me += path_hud
for(var/V in path_huds_watching_me)
@@ -1072,7 +1072,7 @@ Pass a positive integer as an argument to override a bot's default speed.
var/turf/prevprevT = path[i - 2]
var/prevDir = get_dir(prevprevT, prevT)
var/mixDir = direction|prevDir
if(mixDir in diagonals)
if(mixDir in GLOB.diagonals)
prevI.dir = mixDir
if(prevDir & (NORTH|SOUTH))
var/matrix/ntransform = matrix()
@@ -1,5 +1,4 @@
//Bot Construction
var/robot_arm = /obj/item/robot_parts/l_arm
//Cleanbot assembly
/obj/item/bucket_sensor
@@ -13,6 +12,7 @@ var/robot_arm = /obj/item/robot_parts/l_arm
throw_range = 5
w_class = WEIGHT_CLASS_NORMAL
var/created_name = "Cleanbot"
var/robot_arm = /obj/item/robot_parts/l_arm
/obj/item/bucket_sensor/attackby(obj/item/W, mob/user as mob, params)
..()
@@ -350,6 +350,7 @@ var/robot_arm = /obj/item/robot_parts/l_arm
var/treatment_fire = "salglu_solution"
var/treatment_tox = "charcoal"
var/treatment_virus = "spaceacillin"
var/robot_arm = /obj/item/robot_parts/l_arm
/obj/item/firstaid_arm_assembly/New(loc, new_skin)
..()
@@ -419,6 +420,7 @@ var/robot_arm = /obj/item/robot_parts/l_arm
item_state = "helmet"
var/created_name = "Securitron" //To preserve the name if it's a unique securitron I guess
var/build_step = 0
var/robot_arm = /obj/item/robot_parts/l_arm
/obj/item/clothing/head/helmet/attackby(obj/item/assembly/signaler/S, mob/user, params)
..()
@@ -596,6 +598,7 @@ var/robot_arm = /obj/item/robot_parts/l_arm
req_one_access = list(ACCESS_CLOWN, ACCESS_ROBOTICS, ACCESS_MIME)
var/build_step = 0
var/created_name = "Honkbot" //To preserve the name if it's a unique medbot I guess
var/robot_arm = /obj/item/robot_parts/l_arm
/obj/item/honkbot_arm_assembly/attackby(obj/item/W, mob/user, params)
..()
@@ -68,7 +68,7 @@
name = pick("RED RAMPAGE","RED ROVER","RED KILLDEATH MURDERBOT")
//SECHUD
var/datum/atom_hud/secsensor = huds[DATA_HUD_SECURITY_ADVANCED]
var/datum/atom_hud/secsensor = GLOB.huds[DATA_HUD_SECURITY_ADVANCED]
secsensor.add_hud_to(src)
permanent_huds |= secsensor
@@ -473,7 +473,7 @@
pulse2.icon_state = "empdisable"
pulse2.name = "emp sparks"
pulse2.anchored = 1
pulse2.dir = pick(cardinal)
pulse2.dir = pick(GLOB.cardinal)
spawn(10)
qdel(pulse2)
var/list/mob/living/carbon/targets = new
@@ -123,7 +123,7 @@
prev_access = access_card.access
qdel(J)
var/datum/atom_hud/medsensor = huds[DATA_HUD_MEDICAL_ADVANCED]
var/datum/atom_hud/medsensor = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
medsensor.add_hud_to(src)
permanent_huds |= medsensor
@@ -90,7 +90,7 @@
prev_access = access_card.access
//SECHUD
var/datum/atom_hud/secsensor = huds[DATA_HUD_SECURITY_ADVANCED]
var/datum/atom_hud/secsensor = GLOB.huds[DATA_HUD_SECURITY_ADVANCED]
secsensor.add_hud_to(src)
permanent_huds |= secsensor
@@ -145,7 +145,7 @@
if((stat != CONSCIOUS) || !isdiona(loc))
return FALSE
var/mob/living/carbon/human/D = loc
T = get_turf(src)
var/turf/T = get_turf(src)
if(!T)
return FALSE
to_chat(loc, "You feel a pang of loss as [src] splits away from your biomass.")
@@ -210,7 +210,7 @@
qdel(src)
#define MAX_CHICKENS 50
var/global/chicken_count = 0
GLOBAL_VAR_INIT(chicken_count, 0)
/mob/living/simple_animal/chicken
name = "\improper chicken"
@@ -258,14 +258,14 @@ var/global/chicken_count = 0
icon_dead = "[icon_prefix]_[body_color]_dead"
pixel_x = rand(-6, 6)
pixel_y = rand(0, 10)
chicken_count += 1
GLOB.chicken_count += 1
/mob/living/simple_animal/chicken/death(gibbed)
// Only execute the below if we successfully died
. = ..(gibbed)
if(!.)
return
chicken_count -= 1
GLOB.chicken_count -= 1
/mob/living/simple_animal/chicken/attackby(obj/item/O, mob/user, params)
if(istype(O, food_type)) //feedin' dem chickens
@@ -290,7 +290,7 @@ var/global/chicken_count = 0
E.pixel_x = rand(-6,6)
E.pixel_y = rand(-6,6)
if(eggsFertile)
if(chicken_count < MAX_CHICKENS && prob(25))
if(GLOB.chicken_count < MAX_CHICKENS && prob(25))
START_PROCESSING(SSobj, E)
/obj/item/reagent_containers/food/snacks/egg/var/amount_grown = 0
@@ -78,8 +78,8 @@
pixel_y = 8
if(is_type_in_typecache(get_area(loc), invalid_area_typecache))
var/area = pick(teleportlocs)
var/area/tp = teleportlocs[area]
var/area = pick(GLOB.teleportlocs)
var/area/tp = GLOB.teleportlocs[area]
forceMove(pick(get_area_turfs(tp.type)))
if((!current_victim && !admincluwne) || QDELETED(current_victim))
@@ -455,8 +455,8 @@
EscapeConfinement()
var/dir_to_target = get_dir(targets_from, target)
var/dir_list = list()
if(dir_to_target in diagonals) //it's diagonal, so we need two directions to hit
for(var/direction in cardinal)
if(dir_to_target in GLOB.diagonals) //it's diagonal, so we need two directions to hit
for(var/direction in GLOB.cardinal)
if(direction & dir_to_target)
dir_list += direction
else
@@ -467,7 +467,7 @@
/mob/living/simple_animal/hostile/proc/DestroySurroundings() // for use with megafauna destroying everything around them
if(environment_smash)
EscapeConfinement()
for(var/dir in cardinal)
for(var/dir in GLOB.cardinal)
DestroyObjectsInDirection(dir)
/mob/living/simple_animal/hostile/proc/EscapeConfinement()
@@ -396,9 +396,9 @@ Difficulty: Hard
if(. > 0 && prob(25))
var/obj/effect/decal/cleanable/blood/gibs/bubblegum/B = new /obj/effect/decal/cleanable/blood/gibs/bubblegum(loc)
if(prob(40))
step(B, pick(cardinal))
step(B, pick(GLOB.cardinal))
else
B.setDir(pick(cardinal))
B.setDir(pick(GLOB.cardinal))
/obj/effect/decal/cleanable/blood/gibs/bubblegum
name = "thick blood"
@@ -103,7 +103,7 @@ Difficulty: Very Hard
visible_message("<span class='colossus'>\"<b>You can't dodge.</b>\"</span>")
ranged_cooldown = world.time + 30
telegraph()
dir_shots(alldirs)
dir_shots(GLOB.alldirs)
move_to_delay = 3
return
else
@@ -127,13 +127,13 @@ Difficulty: Very Hard
/mob/living/simple_animal/hostile/megafauna/colossus/proc/alternating_dir_shots()
ranged_cooldown = world.time + 40
dir_shots(diagonals)
dir_shots(GLOB.diagonals)
SLEEP_CHECK_DEATH(10)
dir_shots(cardinal)
dir_shots(GLOB.cardinal)
SLEEP_CHECK_DEATH(10)
dir_shots(diagonals)
dir_shots(GLOB.diagonals)
SLEEP_CHECK_DEATH(10)
dir_shots(cardinal)
dir_shots(GLOB.cardinal)
/mob/living/simple_animal/hostile/megafauna/colossus/proc/select_spiral_attack()
telegraph()
@@ -150,7 +150,7 @@ Difficulty: Very Hard
INVOKE_ASYNC(src, .proc/spiral_shoot, TRUE)
/mob/living/simple_animal/hostile/megafauna/colossus/proc/spiral_shoot(negative = pick(TRUE, FALSE), counter_start = 8)
var/turf/start_turf = get_step(src, pick(alldirs))
var/turf/start_turf = get_step(src, pick(GLOB.alldirs))
var/counter = counter_start
for(var/i in 1 to 80)
if(negative)
@@ -198,7 +198,7 @@ Difficulty: Very Hard
/mob/living/simple_animal/hostile/megafauna/colossus/proc/dir_shots(list/dirs)
if(!islist(dirs))
dirs = alldirs.Copy()
dirs = GLOB.alldirs.Copy()
playsound(src, 'sound/magic/clockwork/invoke_general.ogg', 200, TRUE, 2)
for(var/d in dirs)
var/turf/E = get_step(src, d)
@@ -366,7 +366,7 @@ Difficulty: Medium
if(L && !QDELETED(L)) // Some mobs are deleted on death
var/throw_dir = get_dir(src, L)
if(L.loc == loc)
throw_dir = pick(alldirs)
throw_dir = pick(GLOB.alldirs)
var/throwtarget = get_edge_target_turf(src, throw_dir)
L.throw_at(throwtarget, 3)
visible_message("<span class='warning'>[L] is thrown clear of [src]!</span>")
@@ -179,18 +179,18 @@ Difficulty: Hard
if((prob(anger_modifier) || target.Adjacent(src)) && target != src)
var/obj/effect/temp_visual/hierophant/chaser/OC = new(loc, src, target, chaser_speed * 1.5, FALSE)
OC.moving = 4
OC.moving_dir = pick(cardinal - C.moving_dir)
OC.moving_dir = pick(GLOB.cardinal - C.moving_dir)
else if(prob(10 + (anger_modifier * 0.5)) && get_dist(src, target) > 2)
blink(target)
else if(prob(70 - anger_modifier)) //a cross blast of some type
if(prob(anger_modifier * (2 / target_slowness)) && health < maxHealth * 0.5) //we're super angry do it at all dirs
INVOKE_ASYNC(src, .proc/blasts, target, alldirs)
INVOKE_ASYNC(src, .proc/blasts, target, GLOB.alldirs)
else if(prob(60))
INVOKE_ASYNC(src, .proc/blasts, target, cardinal)
INVOKE_ASYNC(src, .proc/blasts, target, GLOB.cardinal)
else
INVOKE_ASYNC(src, .proc/blasts, target, diagonals)
INVOKE_ASYNC(src, .proc/blasts, target, GLOB.diagonals)
else //just release a burst of power
INVOKE_ASYNC(src, .proc/burst, get_turf(src))
@@ -226,9 +226,9 @@ Difficulty: Hard
while(!QDELETED(target) && cross_counter)
cross_counter--
if(prob(60))
INVOKE_ASYNC(src, .proc/blasts, target, cardinal)
INVOKE_ASYNC(src, .proc/blasts, target, GLOB.cardinal)
else
INVOKE_ASYNC(src, .proc/blasts, target, diagonals)
INVOKE_ASYNC(src, .proc/blasts, target, GLOB.diagonals)
SLEEP_CHECK_DEATH(6 + target_slowness)
animate(src, color = oldcolor, time = 8)
addtimer(CALLBACK(src, /atom/proc/update_atom_colour), 8)
@@ -244,7 +244,7 @@ Difficulty: Hard
animate(src, color = "#660099", time = 6)
SLEEP_CHECK_DEATH(6)
var/list/targets = ListTargets()
var/list/cardinal_copy = cardinal.Copy()
var/list/cardinal_copy = GLOB.cardinal.Copy()
while(targets.len && cardinal_copy.len)
var/mob/living/pickedtarget = pick(targets)
if(targets.len >= cardinal_copy.len)
@@ -263,13 +263,13 @@ Difficulty: Hard
SLEEP_CHECK_DEATH(8)
blinking = FALSE
/mob/living/simple_animal/hostile/megafauna/hierophant/proc/blasts(mob/victim, var/list/directions = cardinal) //fires cross blasts with a delay
/mob/living/simple_animal/hostile/megafauna/hierophant/proc/blasts(mob/victim, var/list/directions = GLOB.cardinal) //fires cross blasts with a delay
var/turf/T = get_turf(victim)
if(!T)
return
if(directions == cardinal)
if(directions == GLOB.cardinal)
new /obj/effect/temp_visual/hierophant/telegraph/cardinal(T, src)
else if(directions == diagonals)
else if(directions == GLOB.diagonals)
new /obj/effect/temp_visual/hierophant/telegraph/diagonal(T, src)
else
new /obj/effect/temp_visual/hierophant/telegraph(T, src)
@@ -295,7 +295,7 @@ Difficulty: Hard
if((istype(get_area(T), /area/ruin/unpowered/hierophant) || istype(get_area(src), /area/ruin/unpowered/hierophant)) && victim != src)
return
arena_cooldown = world.time + initial(arena_cooldown)
for(var/d in cardinal)
for(var/d in GLOB.cardinal)
INVOKE_ASYNC(src, .proc/arena_squares, T, d)
for(var/t in RANGE_TURFS(11, T))
if(t && get_dist(t, T) == 11)
@@ -565,7 +565,7 @@ Difficulty: Hard
/obj/effect/temp_visual/hierophant/chaser/proc/get_target_dir()
. = get_cardinal_dir(src, targetturf)
if((. != previous_moving_dir && . == more_previouser_moving_dir) || . == 0) //we're alternating, recalculate
var/list/cardinal_copy = cardinal.Copy()
var/list/cardinal_copy = GLOB.cardinal.Copy()
cardinal_copy -= more_previouser_moving_dir
. = pick(cardinal_copy)
@@ -66,7 +66,7 @@ GLOBAL_LIST_INIT(AISwarmerCapsByType, list(/mob/living/simple_animal/hostile/swa
/mob/living/simple_animal/hostile/megafauna/swarmer_swarm_beacon/Initialize(mapload)
. = ..()
swarmer_caps = GLOB.AISwarmerCapsByType //for admin-edits
for(var/ddir in cardinal)
for(var/ddir in GLOB.cardinal)
new /obj/structure/swarmer/blockade (get_step(src, ddir))
var/mob/living/simple_animal/hostile/swarmer/ai/resource/R = new(loc)
step(R, ddir) //Step the swarmers, instead of spawning them there, incase the turf is solid
@@ -101,7 +101,7 @@
// due to `del_on_death`
return ..()
var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/cable, /obj/structure/window)
GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/cable, /obj/structure/window))
/mob/living/simple_animal/hostile/mimic/copy
health = 100
@@ -141,7 +141,7 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca
faction |= "\ref[owner]"
/mob/living/simple_animal/hostile/mimic/copy/proc/CheckObject(var/obj/O)
if((istype(O, /obj/item) || istype(O, /obj/structure)) && !is_type_in_list(O, protected_objects))
if((istype(O, /obj/item) || istype(O, /obj/structure)) && !is_type_in_list(O, GLOB.protected_objects))
return 1
return 0
@@ -164,7 +164,7 @@
/obj/effect/temp_visual/goliath_tentacle/original/Initialize(mapload, new_spawner)
. = ..()
var/list/directions = cardinal.Copy()
var/list/directions = GLOB.cardinal.Copy()
for(var/i in 1 to 3)
var/spawndir = pick_n_take(directions)
var/turf/T = get_step(src, spawndir)
@@ -327,9 +327,9 @@
/obj/effect/mob_spawn/human/corpse/damaged/legioninfested/dwarf/equip(mob/living/carbon/human/H)
. = ..()
H.dna.SetSEState(SMALLSIZEBLOCK, 1, 1)
H.dna.SetSEState(GLOB.smallsizeblock, 1, 1)
H.mutations.Add(DWARF)
genemutcheck(H, SMALLSIZEBLOCK, null, MUTCHK_FORCED)
genemutcheck(H, GLOB.smallsizeblock, null, MUTCHK_FORCED)
H.update_mutations()
/obj/effect/mob_spawn/human/corpse/damaged/legioninfested/Initialize(mapload)
@@ -58,7 +58,7 @@
if(feedings_left > 0)
to_chat(user, "<span class='warning'>You must wrap [feedings_left] more humanoid prey before you can do this!</span>")
return
for(var/mob/living/simple_animal/hostile/poison/terror_spider/queen/Q in ts_spiderlist)
for(var/mob/living/simple_animal/hostile/poison/terror_spider/queen/Q in GLOB.ts_spiderlist)
if(Q.spider_awaymission == user.spider_awaymission)
to_chat(user, "<span class='warning'>The presence of another Queen in the area is preventing you from maturing.")
return
@@ -96,13 +96,13 @@
S.amount_grown = 250
/mob/living/simple_animal/hostile/poison/terror_spider/queen/empress/proc/EraseBrood()
for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in ts_spiderlist)
for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in GLOB.ts_spiderlist)
if(T.spider_tier < spider_tier)
T.degenerate = 1
to_chat(T, "<span class='userdanger'>Through the hivemind, the raw power of [src] floods into your body, burning it from the inside out!</span>")
for(var/obj/structure/spider/eggcluster/terror_eggcluster/T in ts_egg_list)
for(var/obj/structure/spider/eggcluster/terror_eggcluster/T in GLOB.ts_egg_list)
qdel(T)
for(var/obj/structure/spider/spiderling/terror_spiderling/T in ts_spiderling_list)
for(var/obj/structure/spider/spiderling/terror_spiderling/T in GLOB.ts_spiderling_list)
qdel(T)
to_chat(src, "<span class='userdanger'>All Terror Spiders, except yourself, will die off shortly.</span>")
@@ -14,7 +14,7 @@
var/error_on_humanize = ""
var/humanize_prompt = "Take direct control of [src]?"
humanize_prompt += " Role: [spider_role_summary]"
if(user.ckey in ts_ckey_blacklist)
if(user.ckey in GLOB.ts_ckey_blacklist)
error_on_humanize = "You are not able to control any terror spider this round."
else if(cannotPossess(user))
error_on_humanize = "You have enabled antag HUD and are unable to re-enter the round."
@@ -4,7 +4,7 @@
/mob/living/simple_animal/hostile/poison/terror_spider/proc/DoHiveSense()
var/hsline = ""
to_chat(src, "Your Brood: ")
for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in ts_spiderlist)
for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in GLOB.ts_spiderlist)
if(T.spider_awaymission != spider_awaymission)
continue
hsline = "* [T] in [get_area(T)], "
@@ -20,21 +20,21 @@
/mob/living/simple_animal/hostile/poison/terror_spider/proc/CountSpiders()
var/numspiders = 0
for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in ts_spiderlist)
for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in GLOB.ts_spiderlist)
if(T.stat != DEAD && !T.spider_placed && spider_awaymission == T.spider_awaymission)
numspiders += 1
return numspiders
/mob/living/simple_animal/hostile/poison/terror_spider/proc/CountSpidersType(specific_type)
var/numspiders = 0
for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in ts_spiderlist)
for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in GLOB.ts_spiderlist)
if(T.stat != DEAD && !T.spider_placed && spider_awaymission == T.spider_awaymission)
if(T.type == specific_type)
numspiders += 1
for(var/obj/structure/spider/eggcluster/terror_eggcluster/E in ts_egg_list)
for(var/obj/structure/spider/eggcluster/terror_eggcluster/E in GLOB.ts_egg_list)
if(E.spiderling_type == specific_type && E.z == z)
numspiders += E.spiderling_number
for(var/obj/structure/spider/spiderling/terror_spiderling/L in ts_spiderling_list)
for(var/obj/structure/spider/spiderling/terror_spiderling/L in GLOB.ts_spiderling_list)
if(!L.stillborn && L.grow_as == specific_type && L.z == z)
numspiders += 1
return numspiders
@@ -88,7 +88,7 @@
if(spider_uo71)
UnlockBlastDoors("UO71_Caves")
// When a queen dies, so do her player-controlled purple-type guardians. Intended as a motivator for purples to ensure they guard her.
for(var/mob/living/simple_animal/hostile/poison/terror_spider/purple/P in ts_spiderlist)
for(var/mob/living/simple_animal/hostile/poison/terror_spider/purple/P in GLOB.ts_spiderlist)
if(ckey)
P.visible_message("<span class='danger'>\The [src] writhes in pain!</span>")
to_chat(P,"<span class='userdanger'>\The [src] has died. Without her hivemind link, purple terrors like yourself cannot survive more than a few minutes!</span>")
@@ -97,7 +97,7 @@
/mob/living/simple_animal/hostile/poison/terror_spider/queen/Retaliate()
..()
for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in ts_spiderlist)
for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in GLOB.ts_spiderlist)
T.enemies |= enemies
/mob/living/simple_animal/hostile/poison/terror_spider/queen/proc/ai_nest_is_full()
@@ -23,12 +23,12 @@
/obj/structure/spider/spiderling/terror_spiderling/New()
..()
ts_spiderling_list += src
GLOB.ts_spiderling_list += src
if(is_away_level(z))
spider_awaymission = TRUE
/obj/structure/spider/spiderling/terror_spiderling/Destroy()
ts_spiderling_list -= src
GLOB.ts_spiderling_list -= src
return ..()
/obj/structure/spider/spiderling/terror_spiderling/Bump(obj/O)
@@ -205,7 +205,7 @@
/obj/structure/spider/eggcluster/terror_eggcluster/New()
..()
ts_egg_list += src
GLOB.ts_egg_list += src
spawn(50)
if(spiderling_type == /mob/living/simple_animal/hostile/poison/terror_spider/red)
name = "red terror eggs"
@@ -227,7 +227,7 @@
name = "queen of terror eggs"
/obj/structure/spider/eggcluster/terror_eggcluster/Destroy()
ts_egg_list -= src
GLOB.ts_egg_list -= src
return ..()
/obj/structure/spider/eggcluster/terror_eggcluster/process()
@@ -103,8 +103,8 @@
return
if(!target)
var/my_ventcrawl_freq = freq_ventcrawl_idle
if(ts_count_dead > 0)
if(world.time < (ts_death_last + ts_death_window))
if(GLOB.ts_count_dead > 0)
if(world.time < (GLOB.ts_death_last + GLOB.ts_death_window))
my_ventcrawl_freq = freq_ventcrawl_combat
// First, check for general actions that any spider could take.
if(path_to_vent)
@@ -267,7 +267,7 @@
/mob/living/simple_animal/hostile/poison/terror_spider/proc/ClearObstacle(turf/target_turf)
var/list/valid_obstacles = list(/obj/structure/window, /obj/structure/closet, /obj/structure/table, /obj/structure/grille, /obj/structure/rack, /obj/machinery/door/window)
for(var/dir in cardinal) // North, South, East, West
for(var/dir in GLOB.cardinal) // North, South, East, West
var/obj/structure/obstacle = locate(/obj/structure, get_step(src, dir))
if(is_type_in_list(obstacle, valid_obstacles))
obstacle.attack_animal(src)
@@ -1,12 +1,12 @@
var/global/list/ts_ckey_blacklist = list()
var/global/ts_count_dead = 0
var/global/ts_count_alive_awaymission = 0
var/global/ts_count_alive_station = 0
var/global/ts_death_last = 0
var/global/ts_death_window = 9000 // 15 minutes
var/global/list/ts_spiderlist = list()
var/global/list/ts_egg_list = list()
var/global/list/ts_spiderling_list = list()
GLOBAL_LIST_EMPTY(ts_ckey_blacklist)
GLOBAL_VAR_INIT(ts_count_dead, 0)
GLOBAL_VAR_INIT(ts_count_alive_awaymission, 0)
GLOBAL_VAR_INIT(ts_count_alive_station, 0)
GLOBAL_VAR_INIT(ts_death_last, 0)
GLOBAL_VAR_INIT(ts_death_window, 9000) // 15 minutes
GLOBAL_LIST_EMPTY(ts_spiderlist)
GLOBAL_LIST_EMPTY(ts_egg_list)
GLOBAL_LIST_EMPTY(ts_spiderling_list)
// --------------------------------------------------------------------------------
// --------------------- TERROR SPIDERS: DEFAULTS ---------------------------------
@@ -245,7 +245,7 @@ var/global/list/ts_spiderling_list = list()
/mob/living/simple_animal/hostile/poison/terror_spider/New()
..()
ts_spiderlist += src
GLOB.ts_spiderlist += src
add_language("Spider Hivemind")
if(spider_tier >= TS_TIER_2)
add_language("Galactic Common")
@@ -262,7 +262,7 @@ var/global/list/ts_spiderling_list = list()
msg_terrorspiders("[src] has grown in [get_area(src)].")
if(is_away_level(z))
spider_awaymission = 1
ts_count_alive_awaymission++
GLOB.ts_count_alive_awaymission++
if(spider_tier >= 3)
ai_ventcrawls = FALSE // means that pre-spawned bosses on away maps won't ventcrawl. Necessary to keep prince/mother in one place.
if(istype(get_area(src), /area/awaymission/UO71)) // if we are playing the away mission with our special spiders...
@@ -272,11 +272,11 @@ var/global/list/ts_spiderling_list = list()
ai_ventcrawls = FALSE
spider_placed = 1
else
ts_count_alive_station++
GLOB.ts_count_alive_station++
// after 3 seconds, assuming nobody took control of it yet, offer it to ghosts.
addtimer(CALLBACK(src, .proc/CheckFaction), 20)
addtimer(CALLBACK(src, .proc/announcetoghosts), 30)
var/datum/atom_hud/U = huds[DATA_HUD_MEDICAL_ADVANCED]
var/datum/atom_hud/U = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
U.add_hud_to(src)
/mob/living/simple_animal/hostile/poison/terror_spider/proc/announcetoghosts()
@@ -292,7 +292,7 @@ var/global/list/ts_spiderling_list = list()
notify_ghosts("[src] has appeared in [get_area(src)].", enter_link = "<a href=?src=[UID()];activate=1>(Click to control)</a>", source = src, alert_overlay = alert_overlay, action = NOTIFY_ATTACK)
/mob/living/simple_animal/hostile/poison/terror_spider/Destroy()
ts_spiderlist -= src
GLOB.ts_spiderlist -= src
handle_dying()
return ..()
@@ -322,12 +322,12 @@ var/global/list/ts_spiderling_list = list()
/mob/living/simple_animal/hostile/poison/terror_spider/proc/handle_dying()
if(!hasdied)
hasdied = 1
ts_count_dead++
ts_death_last = world.time
GLOB.ts_count_dead++
GLOB.ts_death_last = world.time
if(spider_awaymission)
ts_count_alive_awaymission--
GLOB.ts_count_alive_awaymission--
else
ts_count_alive_station--
GLOB.ts_count_alive_station--
/mob/living/simple_animal/hostile/poison/terror_spider/death(gibbed)
if(can_die())
@@ -352,7 +352,7 @@ var/global/list/ts_spiderling_list = list()
. = ..()
/mob/living/simple_animal/hostile/poison/terror_spider/proc/msg_terrorspiders(msgtext)
for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in ts_spiderlist)
for(var/mob/living/simple_animal/hostile/poison/terror_spider/T in GLOB.ts_spiderlist)
if(T.stat != DEAD)
to_chat(T, "<span class='terrorspider'>TerrorSense: [msgtext]</span>")
@@ -357,7 +357,7 @@
//Wander around aimlessly. This will help keep the loops from searches down
//and possibly move the mob into a new are in view of something they can use
if(prob(90))
step(src, pick(cardinal))
step(src, pick(GLOB.cardinal))
return
if(!held_item && !parrot_perch) //If we've got nothing to do.. look for something to do.
@@ -184,7 +184,7 @@
turns_since_move++
if(turns_since_move >= turns_per_move)
if(!(stop_automated_movement_when_pulled && pulledby)) //Soma animals don't move when pulled
var/anydir = pick(cardinal)
var/anydir = pick(GLOB.cardinal)
if(Process_Spacemove(anydir))
Move(get_step(src,anydir), anydir)
turns_since_move = 0
@@ -368,7 +368,7 @@
if (holding_still)
holding_still = max(holding_still - hungry, 0)
else if(canmove && isturf(loc) && prob(50))
step(src, pick(cardinal))
step(src, pick(GLOB.cardinal))
else
if(holding_still)
@@ -376,7 +376,7 @@
else if (docile && pulledby)
holding_still = 10
else if(canmove && isturf(loc) && prob(33))
step(src, pick(cardinal))
step(src, pick(GLOB.cardinal))
else if(!AIproc)
INVOKE_ASYNC(src, .proc/AIprocess)
@@ -1,4 +1,4 @@
var/global/totaltribbles = 0 //global variable so it updates for all tribbles, not just the new one being made.
GLOBAL_VAR_INIT(totaltribbles, 0) //global variable so it updates for all tribbles, not just the new one being made.
/mob/living/simple_animal/tribble
@@ -35,7 +35,7 @@ var/global/totaltribbles = 0 //global variable so it updates for all tribbles,
//random pixel offsets so they cover the floor
src.pixel_x = rand(-5.0, 5)
src.pixel_y = rand(-5.0, 5)
totaltribbles += 1
GLOB.totaltribbles += 1
/mob/living/simple_animal/tribble/attack_hand(mob/user as mob)
@@ -61,7 +61,7 @@ var/global/totaltribbles = 0 //global variable so it updates for all tribbles,
/mob/living/simple_animal/tribble/proc/procreate()
..()
if(totaltribbles <= maxtribbles)
if(GLOB.totaltribbles <= maxtribbles)
for(var/mob/living/simple_animal/tribble/F in src.loc)
if(!F || F == src)
new /mob/living/simple_animal/tribble(src.loc)
@@ -84,7 +84,7 @@ var/global/totaltribbles = 0 //global variable so it updates for all tribbles,
. = ..(gibbed)
if(!.)
return FALSE
totaltribbles -= 1
GLOB.totaltribbles -= 1
//||Item version of the trible ||
+8 -8
View File
@@ -478,7 +478,7 @@
. = val_change ? STATUS_UPDATE_BLIND : STATUS_UPDATE_NONE
disabilities &= ~BLIND
if(val_change && updating)
CureIfHasDisability(BLINDBLOCK)
CureIfHasDisability(GLOB.blindblock)
update_blind_effects()
// Coughing
@@ -488,7 +488,7 @@
/mob/living/proc/CureCoughing()
disabilities &= ~COUGHING
CureIfHasDisability(COUGHBLOCK)
CureIfHasDisability(GLOB.coughblock)
// Deaf
@@ -497,7 +497,7 @@
/mob/living/proc/CureDeaf()
disabilities &= ~DEAF
CureIfHasDisability(DEAFBLOCK)
CureIfHasDisability(GLOB.deafblock)
// Epilepsy
@@ -506,7 +506,7 @@
/mob/living/proc/CureEpilepsy()
disabilities &= ~EPILEPSY
CureIfHasDisability(EPILEPSYBLOCK)
CureIfHasDisability(GLOB.epilepsyblock)
// Mute
@@ -515,7 +515,7 @@
/mob/living/proc/CureMute()
disabilities &= ~MUTE
CureIfHasDisability(MUTEBLOCK)
CureIfHasDisability(GLOB.muteblock)
// Nearsighted
@@ -531,7 +531,7 @@
. = val_change ? STATUS_UPDATE_NEARSIGHTED : STATUS_UPDATE_NONE
disabilities &= ~NEARSIGHTED
if(val_change && updating)
CureIfHasDisability(GLASSESBLOCK)
CureIfHasDisability(GLOB.glassesblock)
update_nearsighted_effects()
// Nervous
@@ -541,7 +541,7 @@
/mob/living/proc/CureNervous()
disabilities &= ~NERVOUS
CureIfHasDisability(NERVOUSBLOCK)
CureIfHasDisability(GLOB.nervousblock)
// Tourettes
@@ -550,7 +550,7 @@
/mob/living/proc/CureTourettes()
disabilities &= ~TOURETTES
CureIfHasDisability(TWITCHBLOCK)
CureIfHasDisability(GLOB.twitchblock)
/mob/living/proc/CureIfHasDisability(block)
if(dna && dna.GetSEState(block))
+1 -1
View File
@@ -51,7 +51,7 @@
verbs += /client/proc/readmin
//Clear ability list and update from mob.
client.verbs -= ability_verbs
client.verbs -= GLOB.ability_verbs
if(abilities)
client.verbs |= abilities
+2 -2
View File
@@ -6,8 +6,8 @@
create_attack_log("<font color='red'>Logged out at [atom_loc_line(get_turf(src))]</font>")
// `holder` is nil'd out by now, so we check the `admin_datums` array directly
//Only report this stuff if we are currently playing.
if(admin_datums[ckey] && SSticker && SSticker.current_state == GAME_STATE_PLAYING)
var/datum/admins/temp_admin = admin_datums[ckey]
if(GLOB.admin_datums[ckey] && SSticker && SSticker.current_state == GAME_STATE_PLAYING)
var/datum/admins/temp_admin = GLOB.admin_datums[ckey]
// Triggers on people with banhammer power only - no mentors tripping the alarm
if(temp_admin.rights & R_BAN)
message_admins("Admin logout: [key_name_admin(src)]")
+8 -8
View File
@@ -261,7 +261,7 @@
//The list of slots by priority. equip_to_appropriate_slot() uses this list. Doesn't matter if a mob type doesn't have a slot.
var/list/slot_equipment_priority = list( \
GLOBAL_LIST_INIT(slot_equipment_priority, list( \
slot_back,\
slot_wear_pda,\
slot_wear_id,\
@@ -279,14 +279,14 @@ var/list/slot_equipment_priority = list( \
slot_tie,\
slot_l_store,\
slot_r_store\
)
))
//puts the item "W" into an appropriate slot in a human's inventory
//returns 0 if it cannot, 1 if successful
/mob/proc/equip_to_appropriate_slot(obj/item/W)
if(!istype(W)) return 0
for(var/slot in slot_equipment_priority)
for(var/slot in GLOB.slot_equipment_priority)
if(istype(W,/obj/item/storage/) && slot == slot_head) // Storage items should be put on the belt before the head
continue
if(equip_to_slot_if_possible(W, slot, 0, 1, 1)) //del_on_fail = 0; disable_warning = 0; redraw_mob = 1
@@ -297,7 +297,7 @@ var/list/slot_equipment_priority = list( \
/mob/proc/check_for_open_slot(obj/item/W)
if(!istype(W)) return 0
var/openslot = 0
for(var/slot in slot_equipment_priority)
for(var/slot in GLOB.slot_equipment_priority)
if(W.mob_check_equip(src, slot, 1) == 1)
openslot = 1
break
@@ -741,7 +741,7 @@ var/list/slot_equipment_priority = list( \
set name = "Respawn"
set category = "OOC"
if(!abandon_allowed)
if(!GLOB.abandon_allowed)
to_chat(usr, "<span class='warning'>Respawning is disabled.</span>")
return
@@ -1118,10 +1118,10 @@ var/list/slot_equipment_priority = list( \
/mob/proc/become_mouse()
var/timedifference = world.time - client.time_died_as_mouse
if(client.time_died_as_mouse && timedifference <= mouse_respawn_time * 600)
if(client.time_died_as_mouse && timedifference <= GLOB.mouse_respawn_time * 600)
var/timedifference_text
timedifference_text = time2text(mouse_respawn_time * 600 - timedifference,"mm:ss")
to_chat(src, "<span class='warning'>You may only spawn again as a mouse more than [mouse_respawn_time] minutes after your death. You have [timedifference_text] left.</span>")
timedifference_text = time2text(GLOB.mouse_respawn_time * 600 - timedifference,"mm:ss")
to_chat(src, "<span class='warning'>You may only spawn again as a mouse more than [GLOB.mouse_respawn_time] minutes after your death. You have [timedifference_text] left.</span>")
return
//find a viable mouse candidate
+2 -2
View File
@@ -358,7 +358,7 @@ proc/muffledspeech(phrase)
return 0
//converts intent-strings into numbers and back
var/list/intents = list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM)
GLOBAL_LIST_INIT(intents, list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM))
/proc/intent_numeric(argument)
if(istext(argument))
switch(argument)
@@ -539,7 +539,7 @@ var/list/intents = list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM)
if(oldname)
//update the datacore records! This is goig to be a bit costly.
for(var/list/L in list(data_core.general,data_core.medical,data_core.security,data_core.locked))
for(var/list/L in list(GLOB.data_core.general, GLOB.data_core.medical, GLOB.data_core.security, GLOB.data_core.locked))
for(var/datum/data/record/R in L)
if(R.fields["name"] == oldname)
R.fields["name"] = newname
+1 -1
View File
@@ -178,7 +178,7 @@
else if(mob.confused)
var/newdir = 0
if(mob.confused > 40)
newdir = pick(alldirs)
newdir = pick(GLOB.alldirs)
else if(prob(mob.confused * 1.5))
newdir = angle2dir(dir2angle(direct) + pick(90, -90))
else if(prob(mob.confused * 3))
+6 -6
View File
@@ -1,15 +1,15 @@
/mob/new_player/Login()
update_Login_details() //handles setting lastKnownIP and computer_id for use by the ban systems as well as checking for multikeying
if(join_motd)
to_chat(src, "<div class=\"motd\">[join_motd]</div>")
if(GLOB.join_motd)
to_chat(src, "<div class=\"motd\">[GLOB.join_motd]</div>")
if(!mind)
mind = new /datum/mind(key)
mind.active = 1
mind.current = src
if(length(newplayer_start))
loc = pick(newplayer_start)
if(length(GLOB.newplayer_start))
loc = pick(GLOB.newplayer_start)
else
loc = locate(1,1,1)
lastarea = loc
@@ -29,11 +29,11 @@
spawn(30)
// Annoy the player with polls.
establish_db_connection()
if(dbcon.IsConnected() && client && client.can_vote())
if(GLOB.dbcon.IsConnected() && client && client.can_vote())
var/isadmin = 0
if(client && client.holder)
isadmin = 1
var/DBQuery/query = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_question")] WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM [format_table_name("poll_vote")] WHERE ckey = \"[ckey]\") AND id NOT IN (SELECT pollid FROM [format_table_name("poll_textreply")] WHERE ckey = \"[ckey]\")")
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("poll_question")] WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM [format_table_name("poll_vote")] WHERE ckey = \"[ckey]\") AND id NOT IN (SELECT pollid FROM [format_table_name("poll_textreply")] WHERE ckey = \"[ckey]\")")
query.Execute()
var/newpoll = 0
while(query.NextRow())
+31 -31
View File
@@ -27,11 +27,11 @@
return TRUE
establish_db_connection()
if(!dbcon.IsConnected())
if(!GLOB.dbcon.IsConnected())
tos_consent = TRUE
return TRUE
var/DBQuery/query = dbcon.NewQuery("SELECT * FROM [format_table_name("privacy")] WHERE ckey='[src.ckey]' AND consent=1")
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT * FROM [format_table_name("privacy")] WHERE ckey='[src.ckey]' AND consent=1")
query.Execute()
while(query.NextRow())
tos_consent = TRUE
@@ -80,11 +80,11 @@
if(!IsGuestKey(src.key))
establish_db_connection()
if(dbcon.IsConnected() && client.can_vote())
if(GLOB.dbcon.IsConnected() && client.can_vote())
var/isadmin = 0
if(src.client && src.client.holder)
isadmin = 1
var/DBQuery/query = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_question")] WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM [format_table_name("poll_vote")] WHERE ckey = \"[ckey]\") AND id NOT IN (SELECT pollid FROM [format_table_name("poll_textreply")] WHERE ckey = \"[ckey]\")")
var/DBQuery/query = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("poll_question")] WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM [format_table_name("poll_vote")] WHERE ckey = \"[ckey]\") AND id NOT IN (SELECT pollid FROM [format_table_name("poll_textreply")] WHERE ckey = \"[ckey]\")")
query.Execute()
var/newpoll = 0
while(query.NextRow())
@@ -111,13 +111,13 @@
stat("Game Mode:", "Secret")
else
if(SSticker.hide_mode == 0)
stat("Game Mode:", "[master_mode]") // Old setting for showing the game mode
stat("Game Mode:", "[GLOB.master_mode]") // Old setting for showing the game mode
else
stat("Game Mode: ", "Secret")
if((SSticker.current_state == GAME_STATE_PREGAME) && going)
if((SSticker.current_state == GAME_STATE_PREGAME) && SSticker.ticker_going)
stat("Time To Start:", round(SSticker.pregame_timeleft/10))
if((SSticker.current_state == GAME_STATE_PREGAME) && !going)
if((SSticker.current_state == GAME_STATE_PREGAME) && !SSticker.ticker_going)
stat("Time To Start:", "DELAYED")
if(SSticker.current_state == GAME_STATE_PREGAME)
@@ -143,7 +143,7 @@
if(href_list["consent_signed"])
var/sqltime = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss")
var/DBQuery/query = dbcon.NewQuery("REPLACE INTO [format_table_name("privacy")] (ckey, datetime, consent) VALUES ('[ckey]', '[sqltime]', 1)")
var/DBQuery/query = GLOB.dbcon.NewQuery("REPLACE INTO [format_table_name("privacy")] (ckey, datetime, consent) VALUES ('[ckey]', '[sqltime]', 1)")
query.Execute()
src << browse(null, "window=privacy_consent")
tos_consent = 1
@@ -152,7 +152,7 @@
tos_consent = 0
to_chat(usr, "<span class='warning'>You must consent to the terms of service before you can join!</span>")
var/sqltime = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss")
var/DBQuery/query = dbcon.NewQuery("REPLACE INTO [format_table_name("privacy")] (ckey, datetime, consent) VALUES ('[ckey]', '[sqltime]', 0)")
var/DBQuery/query = GLOB.dbcon.NewQuery("REPLACE INTO [format_table_name("privacy")] (ckey, datetime, consent) VALUES ('[ckey]', '[sqltime]', 0)")
query.Execute()
if(href_list["show_preferences"])
@@ -232,7 +232,7 @@
if(href_list["SelectedJob"])
if(!enter_allowed)
if(!GLOB.enter_allowed)
to_chat(usr, "<span class='notice'>There is an administrative lock on entering the game!</span>")
return
@@ -304,7 +304,7 @@
if(!SSticker || SSticker.current_state != GAME_STATE_PLAYING)
to_chat(usr, "<span class='warning'>The round is either not ready, or has already finished...</span>")
return 0
if(!enter_allowed)
if(!GLOB.enter_allowed)
to_chat(usr, "<span class='notice'>There is an administrative lock on entering the game!</span>")
return 0
if(!IsJobAvailable(rank))
@@ -338,25 +338,25 @@
if(IsAdminJob(rank))
if(IsERTSpawnJob(rank))
character.loc = pick(ertdirector)
character.loc = pick(GLOB.ertdirector)
else if(IsSyndicateCommand(rank))
character.loc = pick(syndicateofficer)
character.loc = pick(GLOB.syndicateofficer)
else
character.forceMove(pick(aroomwarp))
character.forceMove(pick(GLOB.aroomwarp))
join_message = "has arrived"
else
if(spawning_at)
S = spawntypes[spawning_at]
S = GLOB.spawntypes[spawning_at]
if(S && istype(S))
if(S.check_job_spawning(rank))
character.forceMove(pick(S.turfs))
join_message = S.msg
else
to_chat(character, "Your chosen spawnpoint ([S.display_name]) is unavailable for your chosen job. Spawning you at the Arrivals shuttle instead.")
character.forceMove(pick(latejoin))
character.forceMove(pick(GLOB.latejoin))
join_message = "has arrived on the station"
else
character.forceMove(pick(latejoin))
character.forceMove(pick(GLOB.latejoin))
join_message = "has arrived on the station"
character.lastarea = get_area(loc)
@@ -375,7 +375,7 @@
else
SSticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn
if(!IsAdminJob(rank))
data_core.manifest_inject(character)
GLOB.data_core.manifest_inject(character)
AnnounceArrival(character, rank, join_message)
AddEmploymentContract(character)
@@ -412,11 +412,11 @@
if((character.mind.assigned_role != "Cyborg") && (character.mind.assigned_role != character.mind.special_role))
if(character.mind.role_alt_title)
rank = character.mind.role_alt_title
global_announcer.autosay("[character.real_name],[rank ? " [rank]," : " visitor," ] [join_message ? join_message : "has arrived on the station"].", "Arrivals Announcement Computer")
GLOB.global_announcer.autosay("[character.real_name],[rank ? " [rank]," : " visitor," ] [join_message ? join_message : "has arrived on the station"].", "Arrivals Announcement Computer")
/mob/new_player/proc/AddEmploymentContract(mob/living/carbon/human/employee)
spawn(30)
for(var/C in employmentCabinets)
for(var/C in GLOB.employmentCabinets)
var/obj/structure/filingcabinet/employment/employmentCabinet = C
if(!employmentCabinet.virgin)
employmentCabinet.addFile(employee)
@@ -436,7 +436,7 @@
if(character.mind)
if(character.mind.assigned_role != character.mind.special_role)
// can't use their name here, since cyborg namepicking is done post-spawn, so we'll just say "A new Cyborg has arrived"/"A new Android has arrived"/etc.
global_announcer.autosay("A new[rank ? " [rank]" : " visitor" ] [join_message ? join_message : "has arrived on the station"].", "Arrivals Announcement Computer")
GLOB.global_announcer.autosay("A new[rank ? " [rank]" : " visitor" ] [join_message ? join_message : "has arrived on the station"].", "Arrivals Announcement Computer")
/mob/new_player/proc/LateChoices()
var/mills = ROUND_TIME // 1/10 of a second, not real milliseconds but whatever
@@ -467,15 +467,15 @@
var/num_jobs_available = 0
var/list/activePlayers = list()
var/list/categorizedJobs = list(
"Command" = list(jobs = list(), titles = command_positions, color = "#aac1ee"),
"Engineering" = list(jobs = list(), titles = engineering_positions, color = "#ffd699"),
"Security" = list(jobs = list(), titles = security_positions, color = "#ff9999"),
"Command" = list(jobs = list(), titles = GLOB.command_positions, color = "#aac1ee"),
"Engineering" = list(jobs = list(), titles = GLOB.engineering_positions, color = "#ffd699"),
"Security" = list(jobs = list(), titles = GLOB.security_positions, color = "#ff9999"),
"Miscellaneous" = list(jobs = list(), titles = list(), color = "#ffffff", colBreak = 1),
"Synthetic" = list(jobs = list(), titles = nonhuman_positions, color = "#ccffcc"),
"Support / Service" = list(jobs = list(), titles = service_positions, color = "#cccccc"),
"Medical" = list(jobs = list(), titles = medical_positions, color = "#99ffe6", colBreak = 1),
"Science" = list(jobs = list(), titles = science_positions, color = "#e6b3e6"),
"Supply" = list(jobs = list(), titles = supply_positions, color = "#ead4ae"),
"Synthetic" = list(jobs = list(), titles = GLOB.nonhuman_positions, color = "#ccffcc"),
"Support / Service" = list(jobs = list(), titles = GLOB.service_positions, color = "#cccccc"),
"Medical" = list(jobs = list(), titles = GLOB.medical_positions, color = "#99ffe6", colBreak = 1),
"Science" = list(jobs = list(), titles = GLOB.science_positions, color = "#e6b3e6"),
"Supply" = list(jobs = list(), titles = GLOB.supply_positions, color = "#ead4ae"),
)
for(var/datum/job/job in SSjobs.occupations)
if(job && IsJobAvailable(job.title) && !job.barred_by_disability(client))
@@ -495,7 +495,7 @@
else
jobs += job
else // Put heads at top of non-command jobs
if(job.title in command_positions)
if(job.title in GLOB.command_positions)
jobs.Insert(1, job)
else
jobs += job
@@ -584,7 +584,7 @@
/mob/new_player/proc/ViewManifest()
var/dat = "<html><body>"
dat += "<h4>Crew Manifest</h4>"
dat += data_core.get_manifest(OOC = 1)
dat += GLOB.data_core.get_manifest(OOC = 1)
src << browse(dat, "window=manifest;size=370x420;can_close=1")
+45 -45
View File
@@ -12,12 +12,12 @@
/client/proc/handle_player_polling()
establish_db_connection()
if(dbcon.IsConnected())
if(GLOB.dbcon.IsConnected())
var/isadmin = 0
if(holder)
isadmin = 1
var/DBQuery/select_query = dbcon.NewQuery("SELECT id, question, (id IN (SELECT pollid FROM [format_table_name("poll_vote")] WHERE ckey = '[ckey]') OR id IN (SELECT pollid FROM [format_table_name("poll_textreply")] WHERE ckey = '[ckey]')) AS voted FROM [format_table_name("poll_question")] WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime")
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT id, question, (id IN (SELECT pollid FROM [format_table_name("poll_vote")] WHERE ckey = '[ckey]') OR id IN (SELECT pollid FROM [format_table_name("poll_textreply")] WHERE ckey = '[ckey]')) AS voted FROM [format_table_name("poll_question")] WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime")
select_query.Execute()
var/output = "<div align='center'><B>Player polls</B>"
@@ -29,7 +29,7 @@
var/color1 = "#ececec"
var/color2 = "#e2e2e2"
var/i = 0
output += "<tr><th>Active Polls</th></tr>"
while(select_query.NextRow())
var/pollid = select_query.item[1]
@@ -39,14 +39,14 @@
if(can_vote() && !voted)
output += "<tr><td>[poll_player(pollid, 1)]</tr></td>"
i++
// Show expired polls. Non admins can view admin polls at this stage
// Show expired polls. Non admins can view admin polls at this stage
// (just like tgstation's web interface so don't complain)
// (Also why was there no ingame interface tg not having an ingame
// interface is retarded because it cucks downstreams)
select_query = dbcon.NewQuery("SELECT id, question FROM [format_table_name("poll_question")] WHERE Now() > endtime ORDER BY id DESC")
select_query = GLOB.dbcon.NewQuery("SELECT id, question FROM [format_table_name("poll_question")] WHERE Now() > endtime ORDER BY id DESC")
select_query.Execute()
output += "<tr><th>Expired Polls</th></tr>"
while(select_query.NextRow())
var/pollid = select_query.item[1]
@@ -61,9 +61,9 @@
if(pollid == -1)
return
establish_db_connection()
if(!dbcon.IsConnected())
if(!GLOB.dbcon.IsConnected())
return
var/DBQuery/select_query = dbcon.NewQuery("SELECT polltype, question, adminonly, multiplechoiceoptions, starttime, endtime FROM [format_table_name("poll_question")] WHERE id = [pollid] AND endtime < Now()")
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT polltype, question, adminonly, multiplechoiceoptions, starttime, endtime FROM [format_table_name("poll_question")] WHERE id = [pollid] AND endtime < Now()")
select_query.Execute()
var/question = ""
var/polltype = ""
@@ -84,15 +84,15 @@
if(!found)
to_chat(src, "<span class='warning'>Poll question details not found. (Maybe the poll isn't expired yet?)</span>")
return
if(polltype == POLLTYPE_MULTI)
question += " (Choose up to [multiplechoiceoptions] options)"
if(adminonly)
question = "(<font color='#997700'>Admin only poll</font>) " + question
var output = "<!DOCTYPE html><html><body>"
if(polltype == POLLTYPE_MULTI || polltype == POLLTYPE_OPTION)
select_query = dbcon.NewQuery("SELECT text, percentagecalc, (SELECT COUNT(optionid) FROM [format_table_name("poll_vote")] WHERE optionid = poll_option.id GROUP BY optionid) AS votecount FROM [format_table_name("poll_option")] WHERE pollid = [pollid]");
select_query = GLOB.dbcon.NewQuery("SELECT text, percentagecalc, (SELECT COUNT(optionid) FROM [format_table_name("poll_vote")] WHERE optionid = poll_option.id GROUP BY optionid) AS votecount FROM [format_table_name("poll_option")] WHERE pollid = [pollid]");
select_query.Execute()
var/list/options = list()
var/total_votes = 1
@@ -140,7 +140,7 @@
<tr bgcolor='#ddffdd'>
<th colspan='4' align='center'>[question]<br><font size='1'><b>[starttime] - [endtime]</b></font></th>
</tr>"}
select_query = dbcon.NewQuery("SELECT id, text, (SELECT AVG(rating) FROM [format_table_name("poll_vote")] WHERE optionid = poll_option.id AND rating != 'abstain') AS avgrating, (SELECT COUNT(rating) FROM [format_table_name("poll_vote")] WHERE optionid = poll_option.id AND rating != 'abstain') AS countvotes, minval, maxval FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
select_query = GLOB.dbcon.NewQuery("SELECT id, text, (SELECT AVG(rating) FROM [format_table_name("poll_vote")] WHERE optionid = poll_option.id AND rating != 'abstain') AS avgrating, (SELECT COUNT(rating) FROM [format_table_name("poll_vote")] WHERE optionid = poll_option.id AND rating != 'abstain') AS countvotes, minval, maxval FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
select_query.Execute()
while(select_query.NextRow())
output += {"
@@ -156,7 +156,7 @@
var/maxvote = 1
var/list/votecounts = list()
for(var/I in minval to maxval)
var/DBQuery/rating_query = dbcon.NewQuery("SELECT COUNT(rating) AS countrating FROM [format_table_name("poll_vote")] WHERE optionid = [optionid] AND rating = [I] GROUP BY rating")
var/DBQuery/rating_query = GLOB.dbcon.NewQuery("SELECT COUNT(rating) AS countrating FROM [format_table_name("poll_vote")] WHERE optionid = [optionid] AND rating = [I] GROUP BY rating")
rating_query.Execute()
var/votecount = 0
while(rating_query.NextRow())
@@ -177,7 +177,7 @@
output += "</table></td></tr>"
output += "</table>"
if(polltype == POLLTYPE_TEXT)
select_query = dbcon.NewQuery("SELECT replytext, COUNT(replytext) AS countresponse, GROUP_CONCAT(DISTINCT ckey SEPARATOR ', ') as ckeys FROM [format_table_name("poll_textreply")] WHERE pollid = [pollid] GROUP BY replytext ORDER BY countresponse DESC");
select_query = GLOB.dbcon.NewQuery("SELECT replytext, COUNT(replytext) AS countresponse, GROUP_CONCAT(DISTINCT ckey SEPARATOR ', ') as ckeys FROM [format_table_name("poll_textreply")] WHERE pollid = [pollid] GROUP BY replytext ORDER BY countresponse DESC");
select_query.Execute()
output += {"
<table width='900' align='center' bgcolor='#eeffee' cellspacing='0' cellpadding='4'>
@@ -195,15 +195,15 @@
</tr>"}
output += "</table>"
output += "</body></html>"
src << browse(output,"window=pollresults;size=950x500")
/client/proc/poll_player(var/pollid = -1, var/inline = 0)
if(pollid == -1) return
establish_db_connection()
if(dbcon.IsConnected())
if(GLOB.dbcon.IsConnected())
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype, multiplechoiceoptions FROM [format_table_name("poll_question")] WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime [holder ? "AND adminonly = 0" : ""]")
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT starttime, endtime, question, polltype, multiplechoiceoptions FROM [format_table_name("poll_question")] WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime [holder ? "AND adminonly = 0" : ""]")
select_query.Execute()
var/pollstarttime = ""
@@ -229,7 +229,7 @@
switch(polltype)
//Polls that have enumerated options
if(POLLTYPE_OPTION)
var/DBQuery/voted_query = dbcon.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
var/DBQuery/voted_query = GLOB.dbcon.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
voted_query.Execute()
var/voted = 0 // If the can't vote then consider them voted
@@ -241,21 +241,21 @@
var/list/datum/polloption/options = list()
var/DBQuery/options_query = dbcon.NewQuery("SELECT id, text FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
var/DBQuery/options_query = GLOB.dbcon.NewQuery("SELECT id, text FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
options_query.Execute()
while(options_query.NextRow())
var/datum/polloption/PO = new()
PO.optionid = text2num(options_query.item[1])
PO.optiontext = options_query.item[2]
options += PO
var/output
if(!inline)
output += "<div align='center'><B>Player poll</B>"
output +="<hr>"
output += "<b>Question: [pollquestion]</b><br>"
output += "<font size='2'>Poll runs from <b>[pollstarttime]</b> until <b>[pollendtime]</b></font><p>"
if(canvote && !voted) //Only make this a form if we have not voted yet
output += "<form name='cardcomp' action='byond://' method='get'>"
output += "<input type='hidden' name='votepollid' value='[pollid]'>"
@@ -278,7 +278,7 @@
output += "</form>"
output += "</div>"
if(inline)
return output
else
@@ -286,7 +286,7 @@
//Polls with a text input
if(POLLTYPE_TEXT)
var/DBQuery/voted_query = dbcon.NewQuery("SELECT replytext FROM [format_table_name("poll_textreply")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
var/DBQuery/voted_query = GLOB.dbcon.NewQuery("SELECT replytext FROM [format_table_name("poll_textreply")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
voted_query.Execute()
var/voted = 0
@@ -296,7 +296,7 @@
voted = 1
break
var/output
if(!inline)
output += "<div align='center'><B>Player poll</B>"
@@ -323,7 +323,7 @@
output += "</form>"
else
output += "[vote_text]"
if(inline)
return output
else
@@ -331,9 +331,9 @@
//Polls with a text input
if(POLLTYPE_RATING)
var/DBQuery/voted_query = dbcon.NewQuery("SELECT o.text, v.rating FROM [format_table_name("poll_option")] o, erro_poll_vote v WHERE o.pollid = [pollid] AND v.ckey = '[ckey]' AND o.id = v.optionid")
var/DBQuery/voted_query = GLOB.dbcon.NewQuery("SELECT o.text, v.rating FROM [format_table_name("poll_option")] o, erro_poll_vote v WHERE o.pollid = [pollid] AND v.ckey = '[ckey]' AND o.id = v.optionid")
voted_query.Execute()
var/output
if(!inline)
output += "<div align='center'><B>Player poll</B>"
@@ -358,7 +358,7 @@
var/minid = 999999
var/maxid = 0
var/DBQuery/option_query = dbcon.NewQuery("SELECT id, text, minval, maxval, descmin, descmid, descmax FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
var/DBQuery/option_query = GLOB.dbcon.NewQuery("SELECT id, text, minval, maxval, descmin, descmid, descmax FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
option_query.Execute()
while(option_query.NextRow())
var/optionid = text2num(option_query.item[1])
@@ -404,7 +404,7 @@
else
src << browse(output,"window=playerpoll;size=500x500")
if(POLLTYPE_MULTI)
var/DBQuery/voted_query = dbcon.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
var/DBQuery/voted_query = GLOB.dbcon.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
voted_query.Execute()
var/list/votedfor = list()
@@ -417,7 +417,7 @@
var/maxoptionid = 0
var/minoptionid = 0
var/DBQuery/options_query = dbcon.NewQuery("SELECT id, text FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
var/DBQuery/options_query = GLOB.dbcon.NewQuery("SELECT id, text FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
options_query.Execute()
while(options_query.NextRow())
var/datum/polloption/PO = new()
@@ -478,9 +478,9 @@
if(!isnum(pollid) || !isnum(optionid))
return
establish_db_connection()
if(dbcon.IsConnected())
if(GLOB.dbcon.IsConnected())
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype, multiplechoiceoptions FROM [format_table_name("poll_question")] WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime [holder ? "AND adminonly = 0" : ""]")
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT starttime, endtime, question, polltype, multiplechoiceoptions FROM [format_table_name("poll_question")] WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime [holder ? "AND adminonly = 0" : ""]")
select_query.Execute()
var/validpoll = 0
@@ -498,7 +498,7 @@
to_chat(usr, "<span class='warning'>Poll is not valid.</span>")
return
var/DBQuery/select_query2 = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_option")] WHERE id = [optionid] AND pollid = [pollid]")
var/DBQuery/select_query2 = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("poll_option")] WHERE id = [optionid] AND pollid = [pollid]")
select_query2.Execute()
var/validoption = 0
@@ -513,7 +513,7 @@
var/alreadyvoted = 0
var/DBQuery/voted_query = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
var/DBQuery/voted_query = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
voted_query.Execute()
while(voted_query.NextRow())
@@ -534,7 +534,7 @@
adminrank = usr.client.holder.rank
var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO [format_table_name("poll_vote")] (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank) VALUES (null, Now(), [pollid], [optionid], '[ckey]', '[usr.client.address]', '[adminrank]')")
var/DBQuery/insert_query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("poll_vote")] (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank) VALUES (null, Now(), [pollid], [optionid], '[ckey]', '[usr.client.address]', '[adminrank]')")
insert_query.Execute()
to_chat(usr, "<span class='notice'>Vote successful.</span>")
@@ -548,9 +548,9 @@
if(!isnum(pollid) || !istext(replytext))
return
establish_db_connection()
if(dbcon.IsConnected())
if(GLOB.dbcon.IsConnected())
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM [format_table_name("poll_question")] WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime [holder ? "AND adminonly = 0" : ""]")
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM [format_table_name("poll_question")] WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime [holder ? "AND adminonly = 0" : ""]")
select_query.Execute()
var/validpoll = 0
@@ -567,7 +567,7 @@
var/alreadyvoted = 0
var/DBQuery/voted_query = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_textreply")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
var/DBQuery/voted_query = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("poll_textreply")] WHERE pollid = [pollid] AND ckey = '[ckey]'")
voted_query.Execute()
while(voted_query.NextRow())
@@ -592,7 +592,7 @@
to_chat(usr, "The text you entered was blank, contained illegal characters or was too long. Please correct the text and submit again.")
return
var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO [format_table_name("poll_textreply")] (id ,datetime ,pollid ,ckey ,ip ,replytext ,adminrank) VALUES (null, Now(), [pollid], '[ckey]', '[usr.client.address]', '[replytext]', '[adminrank]')")
var/DBQuery/insert_query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("poll_textreply")] (id ,datetime ,pollid ,ckey ,ip ,replytext ,adminrank) VALUES (null, Now(), [pollid], '[ckey]', '[usr.client.address]', '[replytext]', '[adminrank]')")
insert_query.Execute()
to_chat(usr, "<span class='notice'>Feedback logging successful.</span>")
@@ -606,9 +606,9 @@
if(!isnum(pollid) || !isnum(optionid))
return
establish_db_connection()
if(dbcon.IsConnected())
if(GLOB.dbcon.IsConnected())
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM [format_table_name("poll_question")] WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime [holder ? "AND adminonly = 0" : ""]")
var/DBQuery/select_query = GLOB.dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM [format_table_name("poll_question")] WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime [holder ? "AND adminonly = 0" : ""]")
select_query.Execute()
var/validpoll = 0
@@ -623,7 +623,7 @@
to_chat(usr, "<span class='warning'>Poll is not valid.</span>")
return
var/DBQuery/select_query2 = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_option")] WHERE id = [optionid] AND pollid = [pollid]")
var/DBQuery/select_query2 = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("poll_option")] WHERE id = [optionid] AND pollid = [pollid]")
select_query2.Execute()
var/validoption = 0
@@ -638,7 +638,7 @@
var/alreadyvoted = 0
var/DBQuery/voted_query = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_vote")] WHERE optionid = [optionid] AND ckey = '[ckey]'")
var/DBQuery/voted_query = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("poll_vote")] WHERE optionid = [optionid] AND ckey = '[ckey]'")
voted_query.Execute()
while(voted_query.NextRow())
@@ -654,7 +654,7 @@
adminrank = usr.client.holder.rank
var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO [format_table_name("poll_vote")] (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank, rating) VALUES (null, Now(), [pollid], [optionid], '[ckey]', '[usr.client.address]', '[adminrank]', [(isnull(rating)) ? "null" : rating])")
var/DBQuery/insert_query = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("poll_vote")] (id ,datetime ,pollid ,optionid ,ckey ,ip ,adminrank, rating) VALUES (null, Now(), [pollid], [optionid], '[ckey]', '[usr.client.address]', '[adminrank]', [(isnull(rating)) ? "null" : rating])")
insert_query.Execute()
to_chat(usr, "<span class='notice'>Vote successful.</span>")
@@ -9,7 +9,7 @@
if(S.bodyflags & ALL_RPARTS)
var/head_model = "[!rlimb_data["head"] ? "Morpheus Cyberkinetics" : rlimb_data["head"]]"
robohead = all_robolimbs[head_model]
robohead = GLOB.all_robolimbs[head_model]
if(gender_override)
gender = gender_override
else
@@ -17,7 +17,7 @@
underwear = random_underwear(gender, species)
undershirt = random_undershirt(gender, species)
socks = random_socks(gender, species)
if(body_accessory_by_species[species])
if(GLOB.body_accessory_by_species[species])
body_accessory = random_body_accessory(species)
if(body_accessory == "None") //Required to prevent a bug where the information/icons in the character preferences screen wouldn't update despite the data being changed.
body_accessory = null
@@ -253,8 +253,8 @@
if(organ_data[name] == "amputated") continue
if(organ_data[name] == "cyborg")
var/datum/robolimb/R
if(rlimb_data[name]) R = all_robolimbs[rlimb_data[name]]
if(!R) R = basic_robolimb
if(rlimb_data[name]) R = GLOB.all_robolimbs[rlimb_data[name]]
if(!R) R = GLOB.basic_robolimb
if(name == "chest")
name = "torso"
preview_icon.Blend(icon(R.icon, "[name]"), ICON_OVERLAY) // This doesn't check gendered_icon. Not an issue while only limbs can be robotic.
@@ -281,7 +281,7 @@
var/blend_mode = ICON_ADD
if(body_accessory)
var/datum/body_accessory/accessory = body_accessory_by_name[body_accessory]
var/datum/body_accessory/accessory = GLOB.body_accessory_by_name[body_accessory]
tail_icon = accessory.icon
tail_icon_state = accessory.icon_state
if(accessory.blend_mode)
+1 -1
View File
@@ -131,7 +131,7 @@
if(length(message) >= 2)
var/channel_prefix = copytext(message, 1 ,3)
return department_radio_keys[channel_prefix]
return GLOB.department_radio_keys[channel_prefix]
return null
+2 -2
View File
@@ -1,7 +1,7 @@
/mob/living/carbon/human/proc/monkeyize()
var/mob/H = src
H.dna.SetSEState(MONKEYBLOCK,1)
genemutcheck(H,MONKEYBLOCK,null,MUTCHK_FORCED)
H.dna.SetSEState(GLOB.monkeyblock,1)
genemutcheck(H,GLOB.monkeyblock,null,MUTCHK_FORCED)
/mob/new_player/AIize()
spawning = 1
+9 -9
View File
@@ -5,31 +5,31 @@ mob/var/typing
mob/var/last_typed
mob/var/last_typed_time
var/global/image/typing_indicator
GLOBAL_DATUM(typing_indicator, /image)
/mob/proc/set_typing_indicator(var/state)
if(!typing_indicator)
typing_indicator = image('icons/mob/talk.dmi', null, "typing", MOB_LAYER + 1)
typing_indicator.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
if(!GLOB.typing_indicator)
GLOB.typing_indicator = image('icons/mob/talk.dmi', null, "typing", MOB_LAYER + 1)
GLOB.typing_indicator.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
if(ishuman(src))
var/mob/living/carbon/human/H = src
if(H.disabilities & MUTE || H.silent)
overlays -= typing_indicator
overlays -= GLOB.typing_indicator
return
if(client)
if((client.prefs.toggles & SHOW_TYPING) || stat != CONSCIOUS || is_muzzled())
overlays -= typing_indicator
overlays -= GLOB.typing_indicator
else
if(state)
if(!typing)
overlays += typing_indicator
overlays += GLOB.typing_indicator
typing = 1
else
if(typing)
overlays -= typing_indicator
overlays -= GLOB.typing_indicator
typing = 0
return state
@@ -49,7 +49,7 @@ var/global/image/typing_indicator
set name = ".Me"
set hidden = 1
set_typing_indicator(1)
hud_typing = 1
var/message = typing_input(src, "", "me (text)")