Merge branch 'master' of https://github.com/ParadiseSS13/Paradise into turfs

# Conflicts:
#	code/game/objects/items.dm
#	code/modules/power/cable.dm
#	icons/mob/inhands/items_lefthand.dmi
#	icons/mob/inhands/items_righthand.dmi
#	icons/obj/lighting.dmi
#	paradise.dme
This commit is contained in:
Mark van Alphen
2019-04-30 19:26:17 +02:00
153 changed files with 1935 additions and 1105 deletions
+83
View File
@@ -8,6 +8,8 @@ SUBSYSTEM_DEF(jobs)
var/list/name_occupations = list() //Dict of all jobs, keys are titles
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
//Players who need jobs
var/list/unassigned = list()
//Debug info
@@ -601,3 +603,84 @@ SUBSYSTEM_DEF(jobs)
spawn(0)
to_chat(H, "<span class='boldnotice'>Your account number is: [M.account_number], your account pin is: [M.remote_access_pin]</span>")
/datum/controller/subsystem/jobs/proc/format_jobs_for_id_computer(obj/item/card/id/tgtcard)
var/list/jobs_to_formats = list()
if(tgtcard)
var/mob/M = tgtcard.getPlayer()
for(var/datum/job/job in occupations)
if(tgtcard.assignment && tgtcard.assignment == job.title)
jobs_to_formats[job.title] = "disabled" // the job they already have is pre-selected
else if(!job.would_accept_job_transfer_from_player(M))
jobs_to_formats[job.title] = "linkDiscourage" // karma jobs they don't have available are discouraged
else if(job.total_positions && !job.current_positions && job.title != "Civilian")
jobs_to_formats[job.title] = "linkEncourage" // jobs with nobody doing them at all are encouraged
else if(job.total_positions >= 0 && job.current_positions >= job.total_positions)
jobs_to_formats[job.title] = "linkDiscourage" // jobs that are full (no free positions) are discouraged
return jobs_to_formats
/datum/controller/subsystem/jobs/proc/log_job_transfer(transferee, oldvalue, newvalue, whodidit)
id_change_records["[id_change_counter]"] = list("transferee" = transferee, "oldvalue" = oldvalue, "newvalue" = newvalue, "whodidit" = whodidit, "timestamp" = station_time_timestamp())
id_change_counter++
/datum/controller/subsystem/jobs/proc/slot_job_transfer(oldtitle, newtitle)
var/datum/job/oldjobdatum = SSjobs.GetJob(oldtitle)
var/datum/job/newjobdatum = SSjobs.GetJob(newtitle)
if(istype(oldjobdatum) && oldjobdatum.current_positions > 0 && istype(newjobdatum))
if(!(oldjobdatum.title in command_positions) && !(newjobdatum.title in command_positions))
oldjobdatum.current_positions--
newjobdatum.current_positions++
/datum/controller/subsystem/jobs/proc/fetch_transfer_record_html(var/centcom)
var/record_html = "<TABLE border=\"1\">"
var/table_headers = list("Crewman", "Old Rank", "New Rank", "Authorized By", "Time")
var/hidden_fields = list("deletedby")
if(centcom)
table_headers += "<span class='bad'>Deleted By</span>"
record_html += "<TR>"
for(var/thisheader in table_headers)
record_html += "<TD><B>[thisheader]</B></TD>"
record_html += "</TR>"
var/visible_record_count = 0
for(var/thisid in id_change_records)
var/thisrecord = id_change_records[thisid]
if(thisrecord["deletedby"] && !centcom)
continue
record_html += "<TR>"
for(var/lkey in thisrecord)
if(lkey in hidden_fields)
if(centcom)
record_html += "<TD><span class='bad'>[thisrecord[lkey]]<span></TD>"
else
continue
else
record_html += "<TD>[thisrecord[lkey]]</TD>"
record_html += "</TR>"
visible_record_count++
record_html += "</TABLE>"
if(!visible_record_count)
return "No records on file yet."
return record_html
/datum/controller/subsystem/jobs/proc/delete_log_records(sourceuser, delete_all)
. = 0
if(!sourceuser)
return
var/list/new_id_change_records = list()
for(var/thisid in id_change_records)
var/thisrecord = id_change_records[thisid]
if(!thisrecord["deletedby"])
if(delete_all || thisrecord["whodidit"] == sourceuser)
thisrecord["deletedby"] = sourceuser
.++
new_id_change_records["[id_change_counter]"] = thisrecord
id_change_counter++
id_change_records = new_id_change_records
-24
View File
@@ -64,23 +64,6 @@ SUBSYSTEM_DEF(machines)
if(MC_TICK_CHECK)
return
/datum/controller/subsystem/machines/proc/process_premachines(resumed = 0)
/* Literally exists as snowflake for fucking powersinks goddamnit */
if(!resumed)
src.currentrun = GLOB.processing_power_items.Copy()
//cache for sanid speed (lists are references anyways)
var/list/currentrun = src.currentrun
while(currentrun.len)
var/obj/item/I = currentrun[currentrun.len]
currentrun.len--
if(!QDELETED(I))
if(!I.pwr_drain())
GLOB.processing_power_items.Remove(I)
else
GLOB.processing_power_items.Remove(I)
if(MC_TICK_CHECK)
return
/datum/controller/subsystem/machines/proc/process_machines(resumed = 0)
var/seconds = wait * 0.1
if(!resumed)
@@ -113,13 +96,6 @@ SUBSYSTEM_DEF(machines)
if(state != SS_RUNNING)
return
resumed = 0
currentpart = SSMACHINES_PREMACHINERY
if(currentpart == SSMACHINES_PREMACHINERY || !resumed)
process_premachines(resumed)
if(state != SS_RUNNING)
return
resumed = 0
currentpart = SSMACHINES_MACHINERY
if(currentpart == SSMACHINES_MACHINERY || !resumed)