Skip to content

Commit

Permalink
Revert "Removes some unnecessary global variables (ParadiseSS13#16353)…
Browse files Browse the repository at this point in the history
  • Loading branch information
dearmochi authored Nov 28, 2021
1 parent 5397d28 commit ca87534
Show file tree
Hide file tree
Showing 31 changed files with 219 additions and 51 deletions.
3 changes: 3 additions & 0 deletions code/_globalvars/configuration.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@ GLOBAL_VAR_INIT(dooc_enabled, TRUE)
/// Is deadchat currently enabled?
GLOBAL_VAR_INIT(dsay_enabled, TRUE)

/// Amount of time (in minutes) that must pass between a player dying as a mouse and repawning as a mouse
GLOBAL_VAR_INIT(mouse_respawn_time, 5)

/// Enable debugging of things such as job starts and other things
GLOBAL_VAR_INIT(debug2, TRUE)
1 change: 1 addition & 0 deletions code/_globalvars/game_modes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
GLOBAL_VAR_INIT(master_mode, "extended") //"extended"
GLOBAL_VAR_INIT(secret_force_mode, "secret") // if this is anything but "secret", the secret rotation will forceably choose this mode

GLOBAL_VAR_INIT(wavesecret, 0) // meteor mode, delays wave progression, terrible name
GLOBAL_DATUM(start_state, /datum/station_state) // Used in round-end report. Dont ask why it inits as null

GLOBAL_VAR(custom_event_msg)
Expand Down
3 changes: 3 additions & 0 deletions code/_globalvars/genetics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ GLOBAL_VAR_INIT(nervousblock, 0)
GLOBAL_VAR_INIT(wingdingsblock, 0)
GLOBAL_VAR_INIT(monkeyblock, DNA_SE_LENGTH) // Monkey block will always be the DNA_SE_LENGTH

GLOBAL_VAR_INIT(blockadd, 0)
GLOBAL_VAR_INIT(diffmut, 0)

GLOBAL_VAR_INIT(breathlessblock, 0)
GLOBAL_VAR_INIT(remoteviewblock, 0)
GLOBAL_VAR_INIT(regenerateblock, 0)
Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/lists/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ GLOBAL_LIST_EMPTY(silicon_mob_list) //List of all silicon mobs, including clie
GLOBAL_LIST_EMPTY(mob_living_list) //all instances of /mob/living and subtypes
GLOBAL_LIST_EMPTY(carbon_list) //all instances of /mob/living/carbon and subtypes, notably does not contain simple animals
GLOBAL_LIST_EMPTY(human_list) //all instances of /mob/living/carbon/human and subtypes
GLOBAL_LIST_EMPTY(spirits) //List of all the spirits, including Masks
GLOBAL_LIST_EMPTY(alive_mob_list) //List of all alive mobs, including clientless. Excludes /mob/new_player
GLOBAL_LIST_EMPTY(dead_mob_list) //List of all dead mobs, including clientless. Excludes /mob/new_player
GLOBAL_LIST_EMPTY(respawnable_list) //List of all mobs, dead or in mindless creatures that still be respawned.
Expand Down
4 changes: 2 additions & 2 deletions code/_globalvars/lists/names.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ GLOBAL_LIST_INIT(last_names, file2list("config/names/last.txt"))
GLOBAL_LIST_INIT(clown_names, file2list("config/names/clown.txt"))
GLOBAL_LIST_INIT(mime_names, file2list("config/names/mime.txt"))
GLOBAL_LIST_INIT(golem_names, file2list("config/names/golem.txt"))
GLOBAL_LIST_INIT(megacarp_first_names, file2list("config/names/megacarp1.txt"))
GLOBAL_LIST_INIT(megacarp_last_names, file2list("config/names/megacarp2.txt"))
GLOBAL_LIST_INIT(megacarp_first_names, file2list("strings/names/megacarp1.txt"))
GLOBAL_LIST_INIT(megacarp_last_names, file2list("strings/names/megacarp2.txt"))

GLOBAL_LIST_INIT(verbs, file2list("config/names/verbs.txt"))
GLOBAL_LIST_INIT(nouns, file2list("config/names/nouns.txt"))
Expand Down
3 changes: 3 additions & 0 deletions code/_globalvars/lists/objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ GLOBAL_LIST(chemical_reactions_list) //list of all /datum/chemical_reaction da
GLOBAL_LIST(chemical_reagents_list) //list of all /datum/reagent datums indexed by reagent id. Used by chemistry stuff
GLOBAL_LIST_INIT(landmarks_list, list()) //list of all landmarks created
GLOBAL_LIST_INIT(surgery_steps, list()) //list of all surgery steps |BS12
GLOBAL_LIST_INIT(side_effects, list()) //list of all medical sideeffects types by thier names |BS12
GLOBAL_LIST_INIT(mechas_list, list()) //list of all mechs. Used by hostile mobs target tracking.
GLOBAL_LIST_INIT(joblist, list()) //list of all jobstypes, minus borg and AI
GLOBAL_LIST_INIT(airlocks, list()) //list of all airlocks
Expand Down Expand Up @@ -46,6 +47,8 @@ GLOBAL_LIST_EMPTY(ladders)
GLOBAL_LIST_INIT(active_diseases, list()) //List of Active disease in all mobs; purely for quick referencing.

GLOBAL_LIST_EMPTY(mob_spawners) // All mob_spawn objects
GLOBAL_LIST_EMPTY(alert_consoles) // Station alert consoles, /obj/machinery/computer/station_alert
GLOBAL_LIST_EMPTY(explosive_walls)

GLOBAL_LIST_EMPTY(engine_beacon_list)

Expand Down
2 changes: 2 additions & 0 deletions code/_globalvars/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,6 @@ GLOBAL_VAR_INIT(gametime_offset, 432000) // 12:00 in seconds

GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) // Station datacore, manifest, etc

GLOBAL_LIST_EMPTY(ability_verbs) // Create-level abilities
GLOBAL_LIST_INIT(pipe_colors, list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_RED, "blue" = PIPE_COLOR_BLUE, "cyan" = PIPE_COLOR_CYAN, "green" = PIPE_COLOR_GREEN, "yellow" = PIPE_COLOR_YELLOW, "purple" = PIPE_COLOR_PURPLE))

10 changes: 2 additions & 8 deletions code/controllers/subsystem/acid.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,8 @@ SUBSYSTEM_DEF(acid)
var/list/currentrun = list()
var/list/processing = list()

var/acid_overlay

/datum/controller/subsystem/acid/stat_entry()
..("P:[length(processing)]")

/datum/controller/subsystem/acid/Initialize(start_timeofday)
acid_overlay = mutable_appearance('icons/effects/effects.dmi', "acid")
return ..()
..("P:[processing.len]")

/datum/controller/subsystem/acid/get_metrics()
. = ..()
Expand All @@ -41,7 +35,7 @@ SUBSYSTEM_DEF(acid)

if(O.acid_level && O.acid_processing())
else
O.cut_overlay(acid_overlay, TRUE)
O.cut_overlay(GLOB.acid_overlay, TRUE)
processing -= O

if(MC_TICK_CHECK)
Expand Down
26 changes: 15 additions & 11 deletions code/datums/diseases/advance/advance.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,22 @@
*/
GLOBAL_LIST_EMPTY(archive_diseases)

// The order goes from easy to cure to hard to cure.
GLOBAL_LIST_INIT(advance_cures, list(
"sodiumchloride", "sugar", "orangejuice",
"spaceacillin", "salglu_solution", "ethanol",
"teporone", "diphenhydramine", "lipolicide",
"silver", "gold"
))

/*
PROPERTIES
*/

/datum/disease/advance

name = "Unknown" // We will always let our Virologist name our disease.
desc = "An engineered disease which can contain a multitude of symptoms."
form = "Advance Disease" // Will let med-scanners know that this disease was engineered.
Expand All @@ -29,14 +38,6 @@ GLOBAL_LIST_EMPTY(archive_diseases)
var/id = ""
var/processing = 0

// The order goes from easy to cure to hard to cure.
var/static/list/advance_cures = list(
"sodiumchloride", "sugar", "orangejuice",
"spaceacillin", "salglu_solution", "ethanol",
"teporone", "diphenhydramine", "lipolicide",
"silver", "gold"
)

/*
OLD PROCS
Expand Down Expand Up @@ -244,15 +245,18 @@ GLOBAL_LIST_EMPTY(archive_diseases)

// Will generate a random cure, the less resistance the symptoms have, the harder the cure.
/datum/disease/advance/proc/GenerateCure(list/properties = list())
if(length(properties))
var/res = clamp(properties["resistance"] - (length(symptoms) / 2), 1, length(advance_cures))
if(properties && properties.len)
var/res = clamp(properties["resistance"] - (symptoms.len / 2), 1, GLOB.advance_cures.len)
// to_chat(world, "Res = [res]")
cures = list(advance_cures[res])
cures = list(GLOB.advance_cures[res])

// Get the cure name from the cure_id
var/datum/reagent/D = GLOB.chemical_reagents_list[cures[1]]
cure_text = D.name


return

// Randomly generate a symptom, has a chance to lose or gain a symptom.
/datum/disease/advance/proc/Evolve(min_level, max_level)
var/s = safepick(GenerateSymptoms(min_level, max_level, 1))
Expand Down
2 changes: 2 additions & 0 deletions code/game/gamemodes/cult/cult.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
GLOBAL_LIST_EMPTY(all_cults)

/datum/game_mode
/// A list of all minds currently in the cult
var/list/datum/mind/cult = list()
Expand Down
24 changes: 11 additions & 13 deletions code/game/gamemodes/cult/cult_structures.dm
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,16 @@
return TRUE
return ..()

GLOBAL_LIST_INIT(blacklisted_pylon_turfs, typecacheof(list(
/turf/simulated/floor/engine/cult,
/turf/space,
/turf/simulated/wall/indestructible,
/turf/simulated/floor/plating/lava,
/turf/simulated/floor/chasm,
/turf/simulated/wall/cult,
/turf/simulated/wall/cult/artificer
)))

/obj/structure/cult/functional/pylon
name = "pylon"
desc = "A floating crystal that slowly heals those faithful to a cult."
Expand All @@ -226,22 +236,10 @@
var/corrupt_delay = 50
var/last_corrupt = 0

var/static/list/blacklisted_turfs

/obj/structure/cult/functional/pylon/Initialize(mapload)
. = ..()
START_PROCESSING(SSobj, src)
icon_state = SSticker.cultdat?.pylon_icon_state
if(!blacklisted_turfs)
blacklisted_turfs = typecacheof(list(
/turf/simulated/floor/engine/cult,
/turf/space,
/turf/simulated/wall/indestructible,
/turf/simulated/floor/plating/lava,
/turf/simulated/floor/chasm,
/turf/simulated/wall/cult,
/turf/simulated/wall/cult/artificer
))

/obj/structure/cult/functional/pylon/attack_hand(mob/living/user)//override as it should not create anything
return
Expand Down Expand Up @@ -287,7 +285,7 @@
if(istype(T, /turf/simulated/floor/engine/cult))
cultturfs |= T
continue
if(is_type_in_typecache(T, blacklisted_turfs))
if(is_type_in_typecache(T, GLOB.blacklisted_pylon_turfs))
continue
else
validturfs |= T
Expand Down
14 changes: 14 additions & 0 deletions code/game/gamemodes/cult/runes.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
GLOBAL_LIST_EMPTY(sacrificed) // A mixed list of minds and mobs
GLOBAL_LIST_EMPTY(wall_runes) // A list of all cult shield walls
GLOBAL_LIST_EMPTY(teleport_runes) // I'll give you two guesses

/*
Expand Down Expand Up @@ -221,6 +222,14 @@ structure_check() searches for nearby cultist structures required for the invoca
animate(src, color = rune_blood_color, time = 5)


/obj/effect/rune/proc/check_icon()
if(!SSticker.mode)//work around for maps with runes and cultdat is not loaded all the way
var/bits = make_bit_triplet()
icon = get_rune(bits)
else
icon = get_rune_cult(invocation)


//Malformed Rune: This forms if a rune is not drawn correctly. Invoking it does nothing but hurt the user.
/obj/effect/rune/malformed
cultist_name = "Malformed"
Expand Down Expand Up @@ -651,10 +660,12 @@ structure_check() searches for nearby cultist structures required for the invoca

/obj/effect/rune/wall/Initialize(mapload)
. = ..()
GLOB.wall_runes += src
B = new /obj/machinery/shield/cult/barrier(loc)
B.parent_rune = src

/obj/effect/rune/wall/Destroy()
GLOB.wall_runes -= src
if(B && !QDELETED(B))
QDEL_NULL(B)
return ..()
Expand Down Expand Up @@ -982,6 +993,9 @@ structure_check() searches for nearby cultist structures required for the invoca
cultist_name = "Summon [SSticker.cultdat ? SSticker.cultdat.entity_name : "your god"]"
cultist_desc = "tears apart dimensional barriers, calling forth [SSticker.cultdat ? SSticker.cultdat.entity_title3 : "your god"]."

/obj/effect/rune/narsie/check_icon()
return

/obj/effect/rune/narsie/cult_conceal() //can't hide this, and you wouldn't want to
return

Expand Down
7 changes: 7 additions & 0 deletions code/game/gamemodes/setupgame.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
return assigned

/proc/setupgenetics()

if(prob(50))
GLOB.blockadd = rand(-300,300)
if(prob(75))
GLOB.diffmut = rand(0,20)


//Thanks to nexis for the fancy code
// BITCH I AIN'T DONE YET

Expand Down
1 change: 1 addition & 0 deletions code/game/jobs/jobs.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

GLOBAL_LIST_INIT(command_positions, list(
"Captain",
"Head of Personnel",
Expand Down
5 changes: 5 additions & 0 deletions code/game/machinery/computer/station_alert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@

/obj/machinery/computer/station_alert/Initialize(mapload)
. = ..()
GLOB.alert_consoles += src
RegisterSignal(SSalarm, COMSIG_TRIGGERED_ALARM, .proc/alarm_triggered)
RegisterSignal(SSalarm, COMSIG_CANCELLED_ALARM, .proc/alarm_cancelled)

/obj/machinery/computer/station_alert/Destroy()
GLOB.alert_consoles -= src
return ..()

/obj/machinery/computer/station_alert/attack_ai(mob/user)
add_fingerprint(user)
if(stat & (BROKEN|NOPOWER))
Expand Down
7 changes: 6 additions & 1 deletion code/game/machinery/portable_turret.dm
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,14 @@
eprojectile = /obj/item/projectile/beam/pulse
eshot_sound = 'sound/weapons/pulse.ogg'

GLOBAL_LIST_EMPTY(turret_icons)
/obj/machinery/porta_turret/update_icon()
if(!GLOB.turret_icons)
GLOB.turret_icons = list()
GLOB.turret_icons["open"] = image(icon, "openTurretCover")

underlays.Cut()
underlays += image(icon, "openTurretCover")
underlays += GLOB.turret_icons["open"]

if(stat & BROKEN)
icon_state = "destroyed_target_prism"
Expand Down
95 changes: 95 additions & 0 deletions code/game/magic/Uristrunes.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/proc/get_rune_cult(word)
var/animated

if(word && !(SSticker.cultdat.theme == "fire" || SSticker.cultdat.theme == "death"))
animated = 1
else
animated = 0

var/bits = make_bit_triplet()

return get_rune(bits, animated)


GLOBAL_LIST_EMPTY(cult_rune_cache)
GLOBAL_VAR_INIT(cult_rune_style, "rune") // Style of run the cult is using (fire, death, regular, etc)

/proc/get_rune(symbol_bits, animated = 0)
var/lookup = "[symbol_bits]-[animated]"


if(!SSticker.mode)//work around for maps with runes and cultdat is not loaded all the way
GLOB.cult_rune_style = "rune"
else if(SSticker.cultdat.theme == "fire")
GLOB.cult_rune_style = "fire-rune"
else if(SSticker.cultdat.theme == "death")
GLOB.cult_rune_style = "death-rune"


if(lookup in GLOB.cult_rune_cache)
return GLOB.cult_rune_cache[lookup]

var/icon/I = icon('icons/effects/uristrunes.dmi', "[GLOB.cult_rune_style]-179")

for(var/i = 0, i < 10, i++)
if(symbol_bits & (1 << i))
I.Blend(icon('icons/effects/uristrunes.dmi', "[GLOB.cult_rune_style]-[1 << i]"), ICON_OVERLAY)


I.SwapColor(rgb(0, 0, 0, 100), rgb(100, 0, 0, 200))//TO DO COMMENT:NEED TO ADJUST FOR DIFFRNET CULTS
I.SwapColor(rgb(0, 0, 0, 50), rgb(150, 0, 0, 200))

for(var/x = 1, x <= 32, x++)
for(var/y = 1, y <= 32, y++)
var/p = I.GetPixel(x, y)

if(p == null)
var/n = I.GetPixel(x, y + 1)
var/s = I.GetPixel(x, y - 1)
var/e = I.GetPixel(x + 1, y)
var/w = I.GetPixel(x - 1, y)

if(n == "#000000" || s == "#000000" || e == "#000000" || w == "#000000")
I.DrawBox(rgb(200, 0, 0, 200), x, y)

else
var/ne = I.GetPixel(x + 1, y + 1)
var/se = I.GetPixel(x + 1, y - 1)
var/nw = I.GetPixel(x - 1, y + 1)
var/sw = I.GetPixel(x - 1, y - 1)

if(ne == "#000000" || se == "#000000" || nw == "#000000" || sw == "#000000")
I.DrawBox(rgb(200, 0, 0, 100), x, y)

var/icon/result = icon(I, "")

result.Insert(I, "", frame = 1, delay = 10)

if(animated == 1)
var/icon/I2 = icon(I, "")
I2.MapColors(rgb(0xff,0x0c,0,0), rgb(0,0,0,0), rgb(0,0,0,0), rgb(0,0,0,0xff))
I2.SetIntensity(1.04)

var/icon/I3 = icon(I, "")
I3.MapColors(rgb(0xff,0x18,0,0), rgb(0,0,0,0), rgb(0,0,0,0), rgb(0,0,0,0xff))
I3.SetIntensity(1.08)

var/icon/I4 = icon(I, "")
I4.MapColors(rgb(0xff,0x24,0,0), rgb(0,0,0,0), rgb(0,0,0,0), rgb(0,0,0,0xff))
I4.SetIntensity(1.12)

var/icon/I5 = icon(I, "")
I5.MapColors(rgb(0xff,0x30,0,0), rgb(0,0,0,0), rgb(0,0,0,0), rgb(0,0,0,0xff))
I5.SetIntensity(1.16)

result.Insert(I2, "", frame = 2, delay = 4)
result.Insert(I3, "", frame = 3, delay = 3)
result.Insert(I4, "", frame = 4, delay = 2)
result.Insert(I5, "", frame = 5, delay = 6)
result.Insert(I4, "", frame = 6, delay = 2)
result.Insert(I3, "", frame = 7, delay = 2)
result.Insert(I2, "", frame = 8, delay = 2)

GLOB.cult_rune_cache[lookup] = result

return result
Loading

0 comments on commit ca87534

Please sign in to comment.