Makes the code pass dreamchecker (#13161)

* Initial Commit - Trying to add DC to Travis

* Forgot to chmod

* This took too long

* Farie Fixes

* Fixes new code

* Job factions are fucking smelly

* Loadouts work again

* Runtime fixes
This commit is contained in:
AffectedArc07
2020-04-11 15:59:16 -06:00
committed by GitHub
parent ded391b325
commit 928a8f0e04
121 changed files with 315 additions and 285 deletions
+2 -2
View File
@@ -36,7 +36,7 @@ SUBSYSTEM_DEF(events)
E.process()
for(var/i = EVENT_LEVEL_MUNDANE to EVENT_LEVEL_MAJOR)
var/list/datum/event_container/EC = event_containers[i]
var/datum/event_container/EC = event_containers[i]
EC.process()
/datum/controller/subsystem/events/proc/event_complete(var/datum/event/E)
@@ -65,7 +65,7 @@ SUBSYSTEM_DEF(events)
log_debug("Event '[EM.name]' has completed at [station_time_timestamp()].")
/datum/controller/subsystem/events/proc/delay_events(var/severity, var/delay)
var/list/datum/event_container/EC = event_containers[severity]
var/datum/event_container/EC = event_containers[severity]
EC.next_event_time += delay
/datum/controller/subsystem/events/proc/Interact(var/mob/living/user)
+4 -6
View File
@@ -10,7 +10,7 @@ SUBSYSTEM_DEF(jobs)
var/list/type_occupations = list() //Dict of all jobs, keys are types
var/list/prioritized_jobs = list() // List of jobs set to priority by HoP/Captain
var/list/id_change_records = list() // List of all job transfer records
var/list/id_change_counter = 1
var/id_change_counter = 1
//Players who need jobs
var/list/unassigned = list()
//Debug info
@@ -39,8 +39,6 @@ SUBSYSTEM_DEF(jobs)
var/datum/job/job = new J()
if(!job)
continue
if(!job.faction in faction)
continue
occupations += job
name_occupations[job.title] = job
type_occupations[J] = job
@@ -138,7 +136,7 @@ SUBSYSTEM_DEF(jobs)
if(flag && !(flag in player.client.prefs.be_special))
Debug("FOC flag failed, Player: [player], Flag: [flag], ")
continue
if(player.mind && job.title in player.mind.restricted_roles)
if(player.mind && (job.title in player.mind.restricted_roles))
Debug("FOC incompatbile with antagonist role, Player: [player]")
continue
if(player.client.prefs.GetJobDepartment(job, level) & job.flag)
@@ -180,7 +178,7 @@ SUBSYSTEM_DEF(jobs)
Debug("GRJ player has disability rendering them ineligible for job, Player: [player]")
continue
if(player.mind && job.title in player.mind.restricted_roles)
if(player.mind && (job.title in player.mind.restricted_roles))
Debug("GRJ incompatible with antagonist role, Player: [player], Job: [job.title]")
continue
@@ -357,7 +355,7 @@ SUBSYSTEM_DEF(jobs)
Debug("DO player has disability rendering them ineligible for job, Player: [player], Job:[job.title]")
continue
if(player.mind && job.title in player.mind.restricted_roles)
if(player.mind && (job.title in player.mind.restricted_roles))
Debug("DO incompatible with antagonist role, Player: [player], Job:[job.title]")
continue
+85
View File
@@ -32,5 +32,90 @@ SUBSYSTEM_DEF(mapping)
return ..()
/datum/controller/subsystem/mapping/proc/seedRuins(list/z_levels = null, budget = 0, whitelist = /area/space, list/potentialRuins)
if(!z_levels || !z_levels.len)
WARNING("No Z levels provided - Not generating ruins")
return
for(var/zl in z_levels)
var/turf/T = locate(1, 1, zl)
if(!T)
WARNING("Z level [zl] does not exist - Not generating ruins")
return
var/list/ruins = potentialRuins.Copy()
var/list/forced_ruins = list() //These go first on the z level associated (same random one by default)
var/list/ruins_availible = list() //we can try these in the current pass
var/forced_z //If set we won't pick z level and use this one instead.
//Set up the starting ruin list
for(var/key in ruins)
var/datum/map_template/ruin/R = ruins[key]
if(R.cost > budget) //Why would you do that
continue
if(R.always_place)
forced_ruins[R] = -1
if(R.unpickable)
continue
ruins_availible[R] = R.placement_weight
while(budget > 0 && (ruins_availible.len || forced_ruins.len))
var/datum/map_template/ruin/current_pick
var/forced = FALSE
if(forced_ruins.len) //We have something we need to load right now, so just pick it
for(var/ruin in forced_ruins)
current_pick = ruin
if(forced_ruins[ruin] > 0) //Load into designated z
forced_z = forced_ruins[ruin]
forced = TRUE
break
else //Otherwise just pick random one
current_pick = pickweight(ruins_availible)
var/placement_tries = PLACEMENT_TRIES
var/failed_to_place = TRUE
var/z_placed = 0
while(placement_tries > 0)
placement_tries--
z_placed = pick(z_levels)
if(!current_pick.try_to_place(forced_z ? forced_z : z_placed,whitelist))
continue
else
failed_to_place = FALSE
break
//That's done remove from priority even if it failed
if(forced)
//TODO : handle forced ruins with multiple variants
forced_ruins -= current_pick
forced = FALSE
if(failed_to_place)
for(var/datum/map_template/ruin/R in ruins_availible)
if(R.id == current_pick.id)
ruins_availible -= R
log_world("Failed to place [current_pick.name] ruin.")
else
budget -= current_pick.cost
if(!current_pick.allow_duplicates)
for(var/datum/map_template/ruin/R in ruins_availible)
if(R.id == current_pick.id)
ruins_availible -= R
if(current_pick.never_spawn_with)
for(var/blacklisted_type in current_pick.never_spawn_with)
for(var/possible_exclusion in ruins_availible)
if(istype(possible_exclusion,blacklisted_type))
ruins_availible -= possible_exclusion
forced_z = 0
//Update the availible list
for(var/datum/map_template/ruin/R in ruins_availible)
if(R.cost > budget)
ruins_availible -= R
log_world("Ruin loader finished with [budget] left to spend.")
/datum/controller/subsystem/mapping/Recover()
flags |= SS_NO_INIT