mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-22 05:25:15 +01:00
Does the rest of the if()'s/ else's
This commit is contained in:
@@ -62,12 +62,17 @@ var/datum/subsystem/events/SSevent
|
||||
|
||||
var/sum_of_weights = 0
|
||||
for(var/datum/round_event_control/E in control)
|
||||
if(E.occurrences >= E.max_occurrences) continue
|
||||
if(E.earliest_start >= world.time) continue
|
||||
if(E.gamemode_blacklist.len && (ticker.mode.config_tag in E.gamemode_blacklist)) continue
|
||||
if(E.gamemode_whitelist.len && !(ticker.mode.config_tag in E.gamemode_whitelist)) continue
|
||||
if(E.occurrences >= E.max_occurrences)
|
||||
continue
|
||||
if(E.earliest_start >= world.time)
|
||||
continue
|
||||
if(E.gamemode_blacklist.len && (ticker.mode.config_tag in E.gamemode_blacklist))
|
||||
continue
|
||||
if(E.gamemode_whitelist.len && !(ticker.mode.config_tag in E.gamemode_whitelist))
|
||||
continue
|
||||
if(E.holidayID)
|
||||
if(!holidays || !holidays[E.holidayID]) continue
|
||||
if(!holidays || !holidays[E.holidayID])
|
||||
continue
|
||||
if(E.weight < 0) //for round-start events etc.
|
||||
if(E.runEvent() == PROCESS_KILL)
|
||||
E.max_occurrences = 0
|
||||
@@ -81,12 +86,17 @@ var/datum/subsystem/events/SSevent
|
||||
sum_of_weights = rand(0,sum_of_weights) //reusing this variable. It now represents the 'weight' we want to select
|
||||
|
||||
for(var/datum/round_event_control/E in control)
|
||||
if(E.occurrences >= E.max_occurrences) continue
|
||||
if(E.earliest_start >= world.time) continue
|
||||
if(E.gamemode_blacklist.len && (ticker.mode.config_tag in E.gamemode_blacklist)) continue
|
||||
if(E.gamemode_whitelist.len && !(ticker.mode.config_tag in E.gamemode_whitelist)) continue
|
||||
if(E.occurrences >= E.max_occurrences)
|
||||
continue
|
||||
if(E.earliest_start >= world.time)
|
||||
continue
|
||||
if(E.gamemode_blacklist.len && (ticker.mode.config_tag in E.gamemode_blacklist))
|
||||
continue
|
||||
if(E.gamemode_whitelist.len && !(ticker.mode.config_tag in E.gamemode_whitelist))
|
||||
continue
|
||||
if(E.holidayID)
|
||||
if(!holidays || !holidays[E.holidayID]) continue
|
||||
if(!holidays || !holidays[E.holidayID])
|
||||
continue
|
||||
sum_of_weights -= E.weight
|
||||
|
||||
if(sum_of_weights <= 0) //we've hit our goal
|
||||
@@ -172,7 +182,8 @@ var/datum/subsystem/events/SSevent
|
||||
|
||||
//sets up the holidays and holidays list
|
||||
/datum/subsystem/events/proc/getHoliday()
|
||||
if(!config.allow_holidays) return // Holiday stuff was not enabled in the config!
|
||||
if(!config.allow_holidays)
|
||||
return // Holiday stuff was not enabled in the config!
|
||||
|
||||
var/YY = text2num(time2text(world.timeofday, "YY")) // get the current year
|
||||
var/MM = text2num(time2text(world.timeofday, "MM")) // get the current month
|
||||
|
||||
@@ -31,34 +31,44 @@ var/datum/subsystem/job/SSjob
|
||||
|
||||
for(var/J in all_jobs)
|
||||
var/datum/job/job = new J()
|
||||
if(!job) continue
|
||||
if(job.faction != faction) continue
|
||||
if(!job.config_check()) continue
|
||||
if(!job)
|
||||
continue
|
||||
if(job.faction != faction)
|
||||
continue
|
||||
if(!job.config_check())
|
||||
continue
|
||||
occupations += job
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
/datum/subsystem/job/proc/Debug(text)
|
||||
if(!Debug2) return 0
|
||||
if(!Debug2)
|
||||
return 0
|
||||
job_debug.Add(text)
|
||||
return 1
|
||||
|
||||
|
||||
/datum/subsystem/job/proc/GetJob(rank)
|
||||
if(!rank) return null
|
||||
if(!rank)
|
||||
return null
|
||||
for(var/datum/job/J in occupations)
|
||||
if(!J) continue
|
||||
if(J.title == rank) return J
|
||||
if(!J)
|
||||
continue
|
||||
if(J.title == rank)
|
||||
return J
|
||||
return null
|
||||
|
||||
/datum/subsystem/job/proc/AssignRole(mob/new_player/player, rank, latejoin=0)
|
||||
Debug("Running AR, Player: [player], Rank: [rank], LJ: [latejoin]")
|
||||
if(player && player.mind && rank)
|
||||
var/datum/job/job = GetJob(rank)
|
||||
if(!job) return 0
|
||||
if(jobban_isbanned(player, rank)) return 0
|
||||
if(!job.player_old_enough(player.client)) return 0
|
||||
if(!job)
|
||||
return 0
|
||||
if(jobban_isbanned(player, rank))
|
||||
return 0
|
||||
if(!job.player_old_enough(player.client))
|
||||
return 0
|
||||
var/position_limit = job.total_positions
|
||||
if(!latejoin)
|
||||
position_limit = job.spawn_positions
|
||||
@@ -147,10 +157,13 @@ var/datum/subsystem/job/SSjob
|
||||
for(var/level = 1 to 3)
|
||||
for(var/command_position in command_positions)
|
||||
var/datum/job/job = GetJob(command_position)
|
||||
if(!job) continue
|
||||
if((job.current_positions >= job.total_positions) && job.total_positions != -1) continue
|
||||
if(!job)
|
||||
continue
|
||||
if((job.current_positions >= job.total_positions) && job.total_positions != -1)
|
||||
continue
|
||||
var/list/candidates = FindOccupationCandidates(job, level)
|
||||
if(!candidates.len) continue
|
||||
if(!candidates.len)
|
||||
continue
|
||||
var/mob/new_player/candidate = pick(candidates)
|
||||
if(AssignRole(candidate, command_position))
|
||||
return 1
|
||||
@@ -162,10 +175,13 @@ var/datum/subsystem/job/SSjob
|
||||
/datum/subsystem/job/proc/CheckHeadPositions(level)
|
||||
for(var/command_position in command_positions)
|
||||
var/datum/job/job = GetJob(command_position)
|
||||
if(!job) continue
|
||||
if((job.current_positions >= job.total_positions) && job.total_positions != -1) continue
|
||||
if(!job)
|
||||
continue
|
||||
if((job.current_positions >= job.total_positions) && job.total_positions != -1)
|
||||
continue
|
||||
var/list/candidates = FindOccupationCandidates(job, level)
|
||||
if(!candidates.len) continue
|
||||
if(!candidates.len)
|
||||
continue
|
||||
var/mob/new_player/candidate = pick(candidates)
|
||||
AssignRole(candidate, command_position)
|
||||
return
|
||||
@@ -212,7 +228,8 @@ var/datum/subsystem/job/SSjob
|
||||
initial_players_to_assign = unassigned.len
|
||||
|
||||
Debug("DO, Len: [unassigned.len]")
|
||||
if(unassigned.len == 0) return 0
|
||||
if(unassigned.len == 0)
|
||||
return 0
|
||||
|
||||
//Scale number of open security officer slots to population
|
||||
setup_officer_positions()
|
||||
|
||||
@@ -109,7 +109,8 @@ var/datum/subsystem/lighting/SSlighting
|
||||
var/msg = "## DEBUG: [time2text(world.timeofday)] [name] subsystem restarted. Reports:\n"
|
||||
for(var/varname in SSlighting.vars)
|
||||
switch(varname)
|
||||
if("tag","bestF","type","parent_type","vars") continue
|
||||
if("tag","bestF","type","parent_type","vars")
|
||||
continue
|
||||
else
|
||||
var/varval1 = SSlighting.vars[varname]
|
||||
var/varval2 = vars[varname]
|
||||
|
||||
@@ -198,11 +198,13 @@ var/datum/subsystem/pai/SSpai
|
||||
|
||||
/datum/subsystem/pai/proc/question(client/C)
|
||||
spawn(0)
|
||||
if(!C) return
|
||||
if(!C)
|
||||
return
|
||||
asked.Add(C.key)
|
||||
asked[C.key] = world.time
|
||||
var/response = tgalert(C, "Someone is requesting a pAI personality. Would you like to play as a personal AI?", "pAI Request", "Yes", "No", "Never for this round", StealFocus=0, Timeout=askDelay)
|
||||
if(!C) return //handle logouts that happen whilst the alert is waiting for a response.
|
||||
if(!C)
|
||||
return //handle logouts that happen whilst the alert is waiting for a response.
|
||||
if(response == "Yes")
|
||||
recruitWindow(C.mob)
|
||||
else if (response == "Never for this round")
|
||||
|
||||
@@ -277,7 +277,8 @@ var/datum/subsystem/shuttle/SSshuttle
|
||||
contains = object.contains
|
||||
|
||||
for(var/typepath in contains)
|
||||
if(!typepath) continue
|
||||
if(!typepath)
|
||||
continue
|
||||
var/atom/A = new typepath(Crate)
|
||||
if(object.amount && A.vars.Find("amount") && A:amount)
|
||||
A:amount = object.amount
|
||||
|
||||
@@ -72,7 +72,8 @@
|
||||
/*
|
||||
/obj/docking_port/mobile/emergency/findTransitDock()
|
||||
. = SSshuttle.getDock("emergency_transit")
|
||||
if(.) return .
|
||||
if(.)
|
||||
return .
|
||||
return ..()
|
||||
*/
|
||||
|
||||
|
||||
@@ -32,7 +32,8 @@
|
||||
|
||||
/obj/docking_port/mobile/supply/dock()
|
||||
. = ..()
|
||||
if(.) return .
|
||||
if(.)
|
||||
return .
|
||||
|
||||
buy()
|
||||
sell()
|
||||
@@ -46,11 +47,13 @@
|
||||
|
||||
var/list/emptyTurfs = list()
|
||||
for(var/turf/simulated/floor/T in areaInstance)
|
||||
if(T.density || T.contents.len) continue
|
||||
if(T.density || T.contents.len)
|
||||
continue
|
||||
emptyTurfs += T
|
||||
|
||||
for(var/datum/supply_order/SO in SSshuttle.shoppinglist)
|
||||
if(!SO.object) continue
|
||||
if(!SO.object)
|
||||
continue
|
||||
|
||||
var/turf/T = pick_n_take(emptyTurfs) //turf we will place it in
|
||||
if(!T)
|
||||
@@ -81,7 +84,8 @@
|
||||
var/pointsEarned
|
||||
|
||||
for(var/atom/movable/MA in areaInstance)
|
||||
if(MA.anchored) continue
|
||||
if(MA.anchored)
|
||||
continue
|
||||
SSshuttle.sold_atoms += " [MA.name]"
|
||||
|
||||
// Must be in a crate (or a critter crate)!
|
||||
@@ -147,7 +151,8 @@
|
||||
// Sell tech levels
|
||||
if(istype(thing, /obj/item/weapon/disk/tech_disk))
|
||||
var/obj/item/weapon/disk/tech_disk/disk = thing
|
||||
if(!disk.stored) continue
|
||||
if(!disk.stored)
|
||||
continue
|
||||
var/datum/tech/tech = disk.stored
|
||||
|
||||
var/cost = tech.getCost(SSshuttle.techLevels[tech.id])
|
||||
@@ -159,9 +164,11 @@
|
||||
// Sell max reliablity designs
|
||||
if(istype(thing, /obj/item/weapon/disk/design_disk))
|
||||
var/obj/item/weapon/disk/design_disk/disk = thing
|
||||
if(!disk.blueprint) continue
|
||||
if(!disk.blueprint)
|
||||
continue
|
||||
var/datum/design/design = disk.blueprint
|
||||
if(design.id in SSshuttle.researchDesigns) continue
|
||||
if(design.id in SSshuttle.researchDesigns)
|
||||
continue
|
||||
|
||||
if(initial(design.reliability) < 100 && design.reliability >= 100)
|
||||
// Maxed out reliability designs only.
|
||||
@@ -284,7 +291,8 @@
|
||||
temp += "<b>Request from: [get_supply_group_name(cat)]</b><BR><BR>"
|
||||
for(var/supply_type in SSshuttle.supply_packs )
|
||||
var/datum/supply_packs/N = SSshuttle.supply_packs[supply_type]
|
||||
if(N.hidden || N.contraband || N.group != cat) continue //Have to send the type instead of a reference to
|
||||
if(N.hidden || N.contraband || N.group != cat)
|
||||
continue //Have to send the type instead of a reference to
|
||||
temp += "<A href='?src=\ref[src];doorder=[supply_type]'>[N.name]</A> Cost: [N.cost]<BR>" //the obj because it would get caught by the garbage
|
||||
else if (href_list["doorder"])
|
||||
if(world.time < reqtime)
|
||||
@@ -292,12 +300,15 @@
|
||||
return
|
||||
|
||||
//Find the correct supply_pack datum
|
||||
if(!SSshuttle.supply_packs["[href_list["doorder"]]"]) return
|
||||
if(!SSshuttle.supply_packs["[href_list["doorder"]]"])
|
||||
return
|
||||
|
||||
var/timeout = world.time + 600
|
||||
var/reason = stripped_input(usr,"Reason:","Why do you require this item?","")
|
||||
if(world.time > timeout) return
|
||||
if(!reason) return
|
||||
if(world.time > timeout)
|
||||
return
|
||||
if(!reason)
|
||||
return
|
||||
|
||||
var/idname = "*None Provided*"
|
||||
var/idrank = "*None Provided*"
|
||||
@@ -309,7 +320,8 @@
|
||||
idname = usr.real_name
|
||||
|
||||
var/datum/supply_order/O = SSshuttle.generateSupplyOrder(href_list["doorder"], idname, idrank, reason)
|
||||
if(!O) return
|
||||
if(!O)
|
||||
return
|
||||
O.generateRequisition(loc)
|
||||
|
||||
reqtime = (world.time + 5) % 1e5
|
||||
@@ -413,7 +425,8 @@
|
||||
post_signal("supply")
|
||||
|
||||
else if (href_list["order"])
|
||||
if(SSshuttle.supply.mode != SHUTTLE_IDLE) return
|
||||
if(SSshuttle.supply.mode != SHUTTLE_IDLE)
|
||||
return
|
||||
if(href_list["order"] == "categories")
|
||||
//all_supply_groups
|
||||
//Request what?
|
||||
@@ -455,8 +468,10 @@
|
||||
|
||||
var/timeout = world.time + 600
|
||||
var/reason = stripped_input(usr,"Reason:","Why do you require this item?","")
|
||||
if(world.time > timeout) return
|
||||
// if(!reason) return
|
||||
if(world.time > timeout)
|
||||
return
|
||||
// if(!reason)
|
||||
// return
|
||||
|
||||
var/idname = "*None Provided*"
|
||||
var/idrank = "*None Provided*"
|
||||
@@ -468,7 +483,8 @@
|
||||
idname = usr.real_name
|
||||
|
||||
var/datum/supply_order/O = SSshuttle.generateSupplyOrder(href_list["doorder"], idname, idrank, reason)
|
||||
if(!O) return
|
||||
if(!O)
|
||||
return
|
||||
O.generateRequisition(loc)
|
||||
|
||||
reqtime = (world.time + 5) % 1e5
|
||||
@@ -549,7 +565,8 @@
|
||||
|
||||
var/datum/radio_frequency/frequency = SSradio.return_frequency(1435)
|
||||
|
||||
if(!frequency) return
|
||||
if(!frequency)
|
||||
return
|
||||
|
||||
var/datum/signal/status_signal = new
|
||||
status_signal.source = src
|
||||
|
||||
@@ -59,8 +59,10 @@ var/datum/subsystem/ticker/ticker
|
||||
/datum/subsystem/ticker/Initialize(timeofday, zlevel)
|
||||
if (zlevel)
|
||||
return ..()
|
||||
if(!syndicate_code_phrase) syndicate_code_phrase = generate_code_phrase()
|
||||
if(!syndicate_code_response) syndicate_code_response = generate_code_phrase()
|
||||
if(!syndicate_code_phrase)
|
||||
syndicate_code_phrase = generate_code_phrase()
|
||||
if(!syndicate_code_response)
|
||||
syndicate_code_response = generate_code_phrase()
|
||||
setupFactions()
|
||||
..()
|
||||
|
||||
@@ -207,7 +209,8 @@ var/datum/subsystem/ticker/ticker
|
||||
|
||||
//Plus it provides an easy way to make cinematics for other events. Just use this as a template
|
||||
/datum/subsystem/ticker/proc/station_explosion_cinematic(station_missed=0, override = null)
|
||||
if( cinematic ) return //already a cinematic in progress!
|
||||
if( cinematic )
|
||||
return //already a cinematic in progress!
|
||||
|
||||
for (var/datum/html_interface/hi in html_interfaces)
|
||||
hi.closeAll()
|
||||
@@ -304,8 +307,10 @@ var/datum/subsystem/ticker/ticker
|
||||
//If its actually the end of the round, wait for it to end.
|
||||
//Otherwise if its a verb it will continue on afterwards.
|
||||
spawn(300)
|
||||
if(cinematic) qdel(cinematic) //end the cinematic
|
||||
if(temp_buckle) qdel(temp_buckle) //release everybody
|
||||
if(cinematic)
|
||||
qdel(cinematic) //end the cinematic
|
||||
if(temp_buckle)
|
||||
qdel(temp_buckle) //release everybody
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -79,11 +79,14 @@ var/datum/subsystem/vote/SSvote
|
||||
var/list/winners = get_result()
|
||||
var/text
|
||||
if(winners.len > 0)
|
||||
if(question) text += "<b>[question]</b>"
|
||||
else text += "<b>[capitalize(mode)] Vote</b>"
|
||||
if(question)
|
||||
text += "<b>[question]</b>"
|
||||
else
|
||||
text += "<b>[capitalize(mode)] Vote</b>"
|
||||
for(var/i=1,i<=choices.len,i++)
|
||||
var/votes = choices[choices[i]]
|
||||
if(!votes) votes = 0
|
||||
if(!votes)
|
||||
votes = 0
|
||||
text += "\n<b>[choices[i]]:</b> [votes]"
|
||||
if(mode != "custom")
|
||||
if(winners.len > 1)
|
||||
@@ -149,16 +152,21 @@ var/datum/subsystem/vote/SSvote
|
||||
|
||||
reset()
|
||||
switch(vote_type)
|
||||
if("restart") choices.Add("Restart Round","Continue Playing")
|
||||
if("gamemode") choices.Add(config.votable_modes)
|
||||
if("restart")
|
||||
choices.Add("Restart Round","Continue Playing")
|
||||
if("gamemode")
|
||||
choices.Add(config.votable_modes)
|
||||
if("custom")
|
||||
question = stripped_input(usr,"What is the vote for?")
|
||||
if(!question) return 0
|
||||
if(!question)
|
||||
return 0
|
||||
for(var/i=1,i<=10,i++)
|
||||
var/option = capitalize(stripped_input(usr,"Please enter an option or hit cancel to finish"))
|
||||
if(!option || mode || !usr.client) break
|
||||
if(!option || mode || !usr.client)
|
||||
break
|
||||
choices.Add(option)
|
||||
else return 0
|
||||
else
|
||||
return 0
|
||||
mode = vote_type
|
||||
initiator = initiator_key
|
||||
started_time = world.time
|
||||
@@ -172,7 +180,8 @@ var/datum/subsystem/vote/SSvote
|
||||
return 0
|
||||
|
||||
/datum/subsystem/vote/proc/interface(client/C)
|
||||
if(!C) return
|
||||
if(!C)
|
||||
return
|
||||
var/admin = 0
|
||||
var/trialmin = 0
|
||||
if(C.holder)
|
||||
@@ -182,12 +191,15 @@ var/datum/subsystem/vote/SSvote
|
||||
voting |= C
|
||||
|
||||
if(mode)
|
||||
if(question) . += "<h2>Vote: '[question]'</h2>"
|
||||
else . += "<h2>Vote: [capitalize(mode)]</h2>"
|
||||
if(question)
|
||||
. += "<h2>Vote: '[question]'</h2>"
|
||||
else
|
||||
. += "<h2>Vote: [capitalize(mode)]</h2>"
|
||||
. += "Time Left: [time_remaining] s<hr><ul>"
|
||||
for(var/i=1,i<=choices.len,i++)
|
||||
var/votes = choices[choices[i]]
|
||||
if(!votes) votes = 0
|
||||
if(!votes)
|
||||
votes = 0
|
||||
. += "<li><a href='?src=\ref[src];vote=[i]'>[choices[i]]</a> ([votes] votes)</li>"
|
||||
. += "</ul><hr>"
|
||||
if(admin)
|
||||
@@ -220,7 +232,8 @@ var/datum/subsystem/vote/SSvote
|
||||
|
||||
|
||||
/datum/subsystem/vote/Topic(href,href_list[],hsrc)
|
||||
if(!usr || !usr.client) return //not necessary but meh...just in-case somebody does something stupid
|
||||
if(!usr || !usr.client)
|
||||
return //not necessary but meh...just in-case somebody does something stupid
|
||||
switch(href_list["vote"])
|
||||
if("close")
|
||||
voting -= usr.client
|
||||
|
||||
Reference in New Issue
Block a user