code cleanup (#6936)

* code cleanup part 1

* Update cult_items.dm

* Update maths.dm
This commit is contained in:
Nichlas Pihl
2019-11-09 22:18:25 +00:00
committed by alexkar598
parent 031e311c15
commit 81f917db29
8 changed files with 24 additions and 58 deletions

View File

@@ -50,9 +50,6 @@ datum
var var
varname1 = 1 varname1 = 1
varname2 varname2
static
varname3
varname4
proc proc
proc1() proc1()
code code
@@ -77,8 +74,6 @@ The previous code made compliant:
/datum/datum1 /datum/datum1
var/varname1 var/varname1
var/varname2 var/varname2
var/static/varname3
var/static/varname4
/datum/datum1/proc/proc1() /datum/datum1/proc/proc1()
code code

View File

@@ -141,7 +141,9 @@
#define ACCURACY 10000 #define ACCURACY 10000
/proc/gaussian(mean, stddev) /proc/gaussian(mean, stddev)
var/static/gaussian_next var/static/gaussian_next
var/R1;var/R2;var/working var/R1
var/R2
var/working
if(gaussian_next != null) if(gaussian_next != null)
R1 = gaussian_next R1 = gaussian_next
gaussian_next = null gaussian_next = null

View File

@@ -19,23 +19,6 @@
/proc/moth_name() /proc/moth_name()
return "[pick(GLOB.moth_first)] [pick(GLOB.moth_last)]" 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) GLOBAL_VAR(command_name)
/proc/command_name() /proc/command_name()
if (GLOB.command_name) if (GLOB.command_name)
@@ -52,18 +35,6 @@ GLOBAL_VAR(command_name)
return 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() /proc/station_name()
if(!GLOB.station_name) if(!GLOB.station_name)
var/newname var/newname

View File

@@ -489,12 +489,13 @@
color = "#333333" color = "#333333"
list_reagents = list(/datum/reagent/fuel/unholywater = 50) list_reagents = list(/datum/reagent/fuel/unholywater = 50)
GLOBAL_VAR_INIT(curselimit, 0)
/obj/item/shuttle_curse /obj/item/shuttle_curse
name = "cursed orb" name = "cursed orb"
desc = "You peer within this smokey orb and glimpse terrible fates befalling the escape shuttle." desc = "You peer within this smokey orb and glimpse terrible fates befalling the escape shuttle."
icon = 'icons/obj/cult.dmi' icon = 'icons/obj/cult.dmi'
icon_state ="shuttlecurse" icon_state ="shuttlecurse"
var/global/curselimit = 0
/obj/item/shuttle_curse/attack_self(mob/living/user) /obj/item/shuttle_curse/attack_self(mob/living/user)
if(!iscultist(user)) if(!iscultist(user))
@@ -502,7 +503,7 @@
user.Paralyze(100) user.Paralyze(100)
to_chat(user, "<span class='warning'>A powerful force shoves you away from [src]!</span>") to_chat(user, "<span class='warning'>A powerful force shoves you away from [src]!</span>")
return return
if(curselimit > 1) if(GLOB.curselimit >= 2)
to_chat(user, "<span class='notice'>We have exhausted our ability to curse the shuttle.</span>") to_chat(user, "<span class='notice'>We have exhausted our ability to curse the shuttle.</span>")
return return
if(locate(/obj/singularity/narsie) in GLOB.poi_list) if(locate(/obj/singularity/narsie) in GLOB.poi_list)
@@ -529,9 +530,7 @@
playsound(user.loc, 'sound/effects/glassbr1.ogg', 50, 1) playsound(user.loc, 'sound/effects/glassbr1.ogg', 50, 1)
qdel(src) qdel(src)
sleep(20) sleep(20)
var/global/list/curses var/curses = list("A fuel technician just slit his own throat and begged for death.",
if(!curses)
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 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.", "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.", "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) var/message = pick_n_take(curses)
message += " The shuttle will be delayed by three minutes." message += " The shuttle will be delayed by three minutes."
priority_announce("[message]", "System Failure", 'sound/misc/notice1.ogg') priority_announce("[message]", "System Failure", 'sound/misc/notice1.ogg')
curselimit++ GLOB.curselimit++
/obj/item/cult_shift /obj/item/cult_shift
name = "veil shifter" name = "veil shifter"

View File

@@ -26,8 +26,8 @@
var/piping_layer = PIPING_LAYER_DEFAULT var/piping_layer = PIPING_LAYER_DEFAULT
var/pipe_flags = NONE var/pipe_flags = NONE
var/global/list/iconsetids = list() GLOBAL_LIST_EMPTY(iconsetids)
var/global/list/pipeimages = list() GLOBAL_LIST_EMPTY(pipeimages)
var/image/pipe_vision_img = null 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) /obj/machinery/atmospherics/proc/getpipeimage(iconset, iconstate, direction, col=rgb(255,255,255), piping_layer=2)
//Add identifiers for the iconset //Add identifiers for the iconset
if(iconsetids[iconset] == null) if(GLOB.iconsetids[iconset] == null)
iconsetids[iconset] = num2text(iconsetids.len + 1) GLOB.iconsetids[iconset] = num2text(GLOB.iconsetids.len + 1)
//Generate a unique identifier for this image combination //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 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 pipe_overlay.color = col
PIPING_LAYER_SHIFT(pipe_overlay, piping_layer) PIPING_LAYER_SHIFT(pipe_overlay, piping_layer)

View File

@@ -4,13 +4,13 @@
unit_name = "new plant species sample" unit_name = "new plant species sample"
export_types = list(/obj/item/seeds) export_types = list(/obj/item/seeds)
var/needs_discovery = FALSE // Only for undiscovered species var/needs_discovery = FALSE // Only for undiscovered species
var/global/list/discoveredPlants = list() GLOBAL_LIST_EMPTY(discoveredPlants)
/datum/export/seed/get_cost(obj/O) /datum/export/seed/get_cost(obj/O)
var/obj/item/seeds/S = O var/obj/item/seeds/S = O
if(!needs_discovery && (S.type in discoveredPlants)) if(!needs_discovery && (S.type in GLOB.discoveredPlants))
return 0 return 0
if(needs_discovery && !(S.type in discoveredPlants)) if(needs_discovery && !(S.type in GLOB.discoveredPlants))
return 0 return 0
return ..() * S.rarity // That's right, no bonus for potency. Send a crappy sample first to "show improvement" later. return ..() * S.rarity // That's right, no bonus for potency. Send a crappy sample first to "show improvement" later.
@@ -18,7 +18,7 @@
. = ..() . = ..()
if(.) if(.)
var/obj/item/seeds/S = O var/obj/item/seeds/S = O
discoveredPlants[S.type] = S.potency GLOB.discoveredPlants[S.type] = S.potency
/datum/export/seed/potency /datum/export/seed/potency
@@ -33,6 +33,6 @@
if(!cost) if(!cost)
return 0 return 0
var/potDiff = (S.potency - discoveredPlants[S.type]) var/potDiff = (S.potency - GLOB.discoveredPlants[S.type])
return round(..() * potDiff) return round(..() * potDiff)

View File

@@ -8,7 +8,6 @@
spawn_positions = 1 spawn_positions = 1
supervisors = "the head of personnel" supervisors = "the head of personnel"
selection_color = "#bbe291" selection_color = "#bbe291"
var/global/janitors = 0
outfit = /datum/outfit/job/janitor outfit = /datum/outfit/job/janitor

View File

@@ -63,6 +63,7 @@
new /obj/item/assault_pod/mining(src) new /obj/item/assault_pod/mining(src)
GLOBAL_LIST_EMPTY(dumb_rev_heads)
/**********************Shuttle Computer**************************/ /**********************Shuttle Computer**************************/
/obj/machinery/computer/shuttle/mining /obj/machinery/computer/shuttle/mining
@@ -72,13 +73,12 @@
shuttleId = "mining" shuttleId = "mining"
possible_destinations = "mining_home;mining_away;landing_zone_dock;mining_public" possible_destinations = "mining_home;mining_away;landing_zone_dock;mining_public"
no_destination_swap = 1 no_destination_swap = 1
var/global/list/dumb_rev_heads = list()
//ATTACK HAND IGNORING PARENT RETURN VALUE //ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/machinery/computer/shuttle/mining/attack_hand(mob/user) /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>") 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 return
. = ..() . = ..()