mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
code cleanup (#6936)
* code cleanup part 1 * Update cult_items.dm * Update maths.dm
This commit is contained in:
5
.github/CONTRIBUTING.md
vendored
5
.github/CONTRIBUTING.md
vendored
@@ -50,9 +50,6 @@ datum
|
||||
var
|
||||
varname1 = 1
|
||||
varname2
|
||||
static
|
||||
varname3
|
||||
varname4
|
||||
proc
|
||||
proc1()
|
||||
code
|
||||
@@ -77,8 +74,6 @@ The previous code made compliant:
|
||||
/datum/datum1
|
||||
var/varname1
|
||||
var/varname2
|
||||
var/static/varname3
|
||||
var/static/varname4
|
||||
|
||||
/datum/datum1/proc/proc1()
|
||||
code
|
||||
|
||||
@@ -141,7 +141,9 @@
|
||||
#define ACCURACY 10000
|
||||
/proc/gaussian(mean, stddev)
|
||||
var/static/gaussian_next
|
||||
var/R1;var/R2;var/working
|
||||
var/R1
|
||||
var/R2
|
||||
var/working
|
||||
if(gaussian_next != null)
|
||||
R1 = gaussian_next
|
||||
gaussian_next = null
|
||||
|
||||
@@ -19,23 +19,6 @@
|
||||
/proc/moth_name()
|
||||
return "[pick(GLOB.moth_first)] [pick(GLOB.moth_last)]"
|
||||
|
||||
/proc/church_name()
|
||||
var/static/church_name
|
||||
if (church_name)
|
||||
return church_name
|
||||
|
||||
var/name = ""
|
||||
|
||||
name += pick("Holy", "United", "First", "Second", "Last")
|
||||
|
||||
if (prob(20))
|
||||
name += " Space"
|
||||
|
||||
name += " " + pick("Church", "Cathedral", "Body", "Worshippers", "Movement", "Witnesses")
|
||||
name += " of [religion_name()]"
|
||||
|
||||
return name
|
||||
|
||||
GLOBAL_VAR(command_name)
|
||||
/proc/command_name()
|
||||
if (GLOB.command_name)
|
||||
@@ -52,18 +35,6 @@ GLOBAL_VAR(command_name)
|
||||
|
||||
return name
|
||||
|
||||
/proc/religion_name()
|
||||
var/static/religion_name
|
||||
if (religion_name)
|
||||
return religion_name
|
||||
|
||||
var/name = ""
|
||||
|
||||
name += pick("bee", "science", "edu", "captain", "assistant", "monkey", "alien", "space", "unit", "sprocket", "gadget", "bomb", "revolution", "beyond", "station", "goon", "robot", "ivor", "hobnob")
|
||||
name += pick("ism", "ia", "ology", "istism", "ites", "ick", "ian", "ity")
|
||||
|
||||
return capitalize(name)
|
||||
|
||||
/proc/station_name()
|
||||
if(!GLOB.station_name)
|
||||
var/newname
|
||||
|
||||
@@ -489,12 +489,13 @@
|
||||
color = "#333333"
|
||||
list_reagents = list(/datum/reagent/fuel/unholywater = 50)
|
||||
|
||||
GLOBAL_VAR_INIT(curselimit, 0)
|
||||
|
||||
/obj/item/shuttle_curse
|
||||
name = "cursed orb"
|
||||
desc = "You peer within this smokey orb and glimpse terrible fates befalling the escape shuttle."
|
||||
icon = 'icons/obj/cult.dmi'
|
||||
icon_state ="shuttlecurse"
|
||||
var/global/curselimit = 0
|
||||
|
||||
/obj/item/shuttle_curse/attack_self(mob/living/user)
|
||||
if(!iscultist(user))
|
||||
@@ -502,7 +503,7 @@
|
||||
user.Paralyze(100)
|
||||
to_chat(user, "<span class='warning'>A powerful force shoves you away from [src]!</span>")
|
||||
return
|
||||
if(curselimit > 1)
|
||||
if(GLOB.curselimit >= 2)
|
||||
to_chat(user, "<span class='notice'>We have exhausted our ability to curse the shuttle.</span>")
|
||||
return
|
||||
if(locate(/obj/singularity/narsie) in GLOB.poi_list)
|
||||
@@ -529,9 +530,7 @@
|
||||
playsound(user.loc, 'sound/effects/glassbr1.ogg', 50, 1)
|
||||
qdel(src)
|
||||
sleep(20)
|
||||
var/global/list/curses
|
||||
if(!curses)
|
||||
curses = list("A fuel technician just slit his own throat and begged for death.",
|
||||
var/curses = list("A fuel technician just slit his own throat and begged for death.",
|
||||
"The shuttle's navigation programming was replaced by a file containing just two words: IT COMES.",
|
||||
"The shuttle's custodian was found washing the windows with their own blood.",
|
||||
"A shuttle engineer began screaming 'DEATH IS NOT THE END' and ripped out wires until an arc flash seared off her flesh.",
|
||||
@@ -541,7 +540,7 @@
|
||||
var/message = pick_n_take(curses)
|
||||
message += " The shuttle will be delayed by three minutes."
|
||||
priority_announce("[message]", "System Failure", 'sound/misc/notice1.ogg')
|
||||
curselimit++
|
||||
GLOB.curselimit++
|
||||
|
||||
/obj/item/cult_shift
|
||||
name = "veil shifter"
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
var/piping_layer = PIPING_LAYER_DEFAULT
|
||||
var/pipe_flags = NONE
|
||||
|
||||
var/global/list/iconsetids = list()
|
||||
var/global/list/pipeimages = list()
|
||||
GLOBAL_LIST_EMPTY(iconsetids)
|
||||
GLOBAL_LIST_EMPTY(pipeimages)
|
||||
|
||||
var/image/pipe_vision_img = null
|
||||
|
||||
@@ -247,15 +247,15 @@
|
||||
/obj/machinery/atmospherics/proc/getpipeimage(iconset, iconstate, direction, col=rgb(255,255,255), piping_layer=2)
|
||||
|
||||
//Add identifiers for the iconset
|
||||
if(iconsetids[iconset] == null)
|
||||
iconsetids[iconset] = num2text(iconsetids.len + 1)
|
||||
if(GLOB.iconsetids[iconset] == null)
|
||||
GLOB.iconsetids[iconset] = num2text(GLOB.iconsetids.len + 1)
|
||||
|
||||
//Generate a unique identifier for this image combination
|
||||
var/identifier = iconsetids[iconset] + "_[iconstate]_[direction]_[col]_[piping_layer]"
|
||||
var/identifier = GLOB.iconsetids[iconset] + "_[iconstate]_[direction]_[col]_[piping_layer]"
|
||||
|
||||
if((!(. = pipeimages[identifier])))
|
||||
if((!(. = GLOB.pipeimages[identifier])))
|
||||
var/image/pipe_overlay
|
||||
pipe_overlay = . = pipeimages[identifier] = image(iconset, iconstate, dir = direction)
|
||||
pipe_overlay = . = GLOB.pipeimages[identifier] = image(iconset, iconstate, dir = direction)
|
||||
pipe_overlay.color = col
|
||||
PIPING_LAYER_SHIFT(pipe_overlay, piping_layer)
|
||||
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
unit_name = "new plant species sample"
|
||||
export_types = list(/obj/item/seeds)
|
||||
var/needs_discovery = FALSE // Only for undiscovered species
|
||||
var/global/list/discoveredPlants = list()
|
||||
GLOBAL_LIST_EMPTY(discoveredPlants)
|
||||
|
||||
/datum/export/seed/get_cost(obj/O)
|
||||
var/obj/item/seeds/S = O
|
||||
if(!needs_discovery && (S.type in discoveredPlants))
|
||||
if(!needs_discovery && (S.type in GLOB.discoveredPlants))
|
||||
return 0
|
||||
if(needs_discovery && !(S.type in discoveredPlants))
|
||||
if(needs_discovery && !(S.type in GLOB.discoveredPlants))
|
||||
return 0
|
||||
return ..() * S.rarity // That's right, no bonus for potency. Send a crappy sample first to "show improvement" later.
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
. = ..()
|
||||
if(.)
|
||||
var/obj/item/seeds/S = O
|
||||
discoveredPlants[S.type] = S.potency
|
||||
GLOB.discoveredPlants[S.type] = S.potency
|
||||
|
||||
|
||||
/datum/export/seed/potency
|
||||
@@ -33,6 +33,6 @@
|
||||
if(!cost)
|
||||
return 0
|
||||
|
||||
var/potDiff = (S.potency - discoveredPlants[S.type])
|
||||
var/potDiff = (S.potency - GLOB.discoveredPlants[S.type])
|
||||
|
||||
return round(..() * potDiff)
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
spawn_positions = 1
|
||||
supervisors = "the head of personnel"
|
||||
selection_color = "#bbe291"
|
||||
var/global/janitors = 0
|
||||
|
||||
outfit = /datum/outfit/job/janitor
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
new /obj/item/assault_pod/mining(src)
|
||||
|
||||
|
||||
GLOBAL_LIST_EMPTY(dumb_rev_heads)
|
||||
/**********************Shuttle Computer**************************/
|
||||
|
||||
/obj/machinery/computer/shuttle/mining
|
||||
@@ -72,13 +73,12 @@
|
||||
shuttleId = "mining"
|
||||
possible_destinations = "mining_home;mining_away;landing_zone_dock;mining_public"
|
||||
no_destination_swap = 1
|
||||
var/global/list/dumb_rev_heads = list()
|
||||
|
||||
//ATTACK HAND IGNORING PARENT RETURN VALUE
|
||||
/obj/machinery/computer/shuttle/mining/attack_hand(mob/user)
|
||||
if(is_station_level(user.z) && user.mind && is_head_revolutionary(user) && !(user.mind in dumb_rev_heads))
|
||||
if(is_station_level(user.z) && user.mind && is_head_revolutionary(user) && !(user.mind in GLOB.dumb_rev_heads))
|
||||
to_chat(user, "<span class='warning'>You get a feeling that leaving the station might be a REALLY dumb idea...</span>")
|
||||
dumb_rev_heads += user.mind
|
||||
GLOB.dumb_rev_heads += user.mind
|
||||
return
|
||||
. = ..()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user