a029a49392
Misc: +Fixes unreported issue with initializing lighting on a specific zlevel +Fixes two similar issues with moveElement and moveRange. Where fromIndex or toIndex could be adjusted incorrectly in certain conditions. Potentially causing bad-sorts, or out of bound errors. +Rewrites listclearnulls(list/L) to no longer iterate through L.len elements for every null in the list (plus 1). i.e. went from L.len*(number_of_nulls+1) list-element reads (best-case), to L.len list-element reads (worst-case) +New proc/getElementByVar(list/L, varname, value) which finds the first datum in a list, with a variable named varname, which equals value. You can also feed it atoms instead of lists due to the way the in operator functions. +Fixes an unreported issue with Yota's list2text rewrite. Under certain conditions, the first element would not be converted into a string. Causing type-mismatch runtimes. +New global map_ready variable. This is not fully implemented yet, but will be used to avoid duplicate calls to initialize() for map objects. +All turfs now maintain references to all lights currently illuminating them. This will mean higher memory use unfortunately, due to the huge number of turfs. However, it will speed up updateAffectingLights significantly. I've used list husbandry to reduce baseline memory usage, so it shouldn't be any worse than some past atmos modifications memory-wise. -Removed 'quadratic lighting', can add this back at some point. Sorry. +modified the way lum() works slightly, to allow turfs to have overridden delta-lumen. i.e. space cannot be illuminated more than its default ambiance. This allowed removal of some iffy special-snowflake lighting areas implemented by somebody else. +Lighting images in the dmi can now use arbitrary naming schemes. It is reliant on order now. This allows the dmi to be replaced by simply dropping in a new dmi. -Removed all subtypes of /area/shuttle. Shuttles now create duplicate 'rooms' of /area/shuttle. (More on this later). This will conflict with most maps. Guide on how to fix to follow. +All verbs/tools relating to world.tick_lag were refactored to use world.fps. However old config text for setting tick_lag will still work (it converts the value to fps for you) +MC stats improved using smoothing. They now have their own tab so they dont get in the way when you're playing as an admin. -removed the push_mob_back stuff due to conflicting changes. Sorry Giacom. _OK, NOW THE ACTUAL INTERESTING STUFF_ Following systems moved over to subsystem datums: air_master garbage_manager lighting_controller process_mobs (aka Life()) nanomanager power sun pipenets AFK kick loops shuttle_controller (aka emergency shuttle/pods), supply_shuttle and other shuttles voting bots radio diseases events jobs objects ticker Subsystems hooks and variables should be commented fairly in-depth. If anything isn't particularly clear, please make an issue. Many system-specific global variables have been refactored into All tickers which previously used world.timeofday now use world.time some subsystems can iterate before round start. this resolves the issue with votes not working pregame
173 lines
6.9 KiB
Plaintext
173 lines
6.9 KiB
Plaintext
/**********************Prisoners' Console**************************/
|
|
|
|
/obj/machinery/mineral/labor_claim_console
|
|
name = "point claim console"
|
|
desc = "A stacking console with an electromagnetic writer, used to track ore mined by prisoners."
|
|
icon = 'icons/obj/machines/mining_machines.dmi'
|
|
icon_state = "console"
|
|
density = 0
|
|
anchored = 1
|
|
var/obj/machinery/mineral/stacking_machine/laborstacker/machine = null
|
|
var/machinedir = SOUTH
|
|
var/obj/item/weapon/card/id/prisoner/inserted_id
|
|
var/obj/machinery/door/airlock/release_door
|
|
var/door_tag = "prisonshuttle"
|
|
var/obj/item/device/radio/Radio //needed to send messages to sec radio
|
|
|
|
|
|
/obj/machinery/mineral/labor_claim_console/New()
|
|
..()
|
|
Radio = new/obj/item/device/radio(src)
|
|
Radio.listening = 0
|
|
spawn(7)
|
|
src.machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir))
|
|
var/t
|
|
for(var/obj/machinery/door/airlock/d in range(5,src))
|
|
t = d.id_tag
|
|
if(t == src.door_tag)
|
|
src.release_door = d
|
|
if (machine && release_door)
|
|
machine.CONSOLE = src
|
|
else
|
|
qdel(src)
|
|
|
|
/obj/machinery/mineral/labor_claim_console/proc/check_auth()
|
|
if(emagged) return 1 //Shuttle is emagged, let any ol' person through
|
|
return (istype(inserted_id) && inserted_id.points >= inserted_id.goal) //Otherwise, only let them out if the prisoner's reached his quota.
|
|
|
|
|
|
/obj/machinery/mineral/labor_claim_console/attack_hand(user as mob)
|
|
var/dat
|
|
dat += text("<b>Point Claim Console</b><br><br>")
|
|
if(emagged) //Shit's broken
|
|
dat += text("<b>QU&#t0A In%aL*D</b><br>")
|
|
else if(istype(inserted_id)) //There's an ID in there.
|
|
dat += text("ID: [inserted_id.registered_name] <A href='?src=\ref[src];choice=eject'>Eject ID.</A><br>")
|
|
dat += text("Points Collected:[inserted_id.points]<br>")
|
|
dat += text("Point Quota: [inserted_id.goal] - Reach your quota to earn your release<br>")
|
|
dat += text("Unclaimed Collection Points: [machine.points]. <A href='?src=\ref[src];choice=claim'>Claim points.</A><br>")
|
|
else //No ID in sight. Complain about it.
|
|
dat += text("No ID inserted. <A href='?src=\ref[src];choice=insert'>Insert ID.</A><br>")
|
|
if(check_auth())
|
|
dat += text("<A href='?src=\ref[src];choice=station'>Proceed to Station.</A><br>")
|
|
dat += text("<A href='?src=\ref[src];choice=release'>Open release door.</A><br>")
|
|
if(machine)
|
|
dat += text("<HR><b>Mineral Value List:</b><BR>[machine.get_ore_values()]")
|
|
|
|
|
|
user << browse("[dat]", "window=console_stacking_machine")
|
|
|
|
|
|
/obj/machinery/mineral/labor_claim_console/attackby(obj/item/I as obj, mob/user as mob)
|
|
if(istype(I, /obj/item/weapon/card/id))
|
|
return attack_hand(user)
|
|
..()
|
|
|
|
/obj/machinery/mineral/labor_claim_console/emag_act(mob/user as mob)
|
|
if(!emagged)
|
|
emagged = 1
|
|
user << "<span class='warning'>PZZTTPFFFT</span>"
|
|
|
|
|
|
|
|
/obj/machinery/mineral/labor_claim_console/Topic(href, href_list)
|
|
usr.set_machine(src)
|
|
src.add_fingerprint(usr)
|
|
if(href_list["choice"])
|
|
if(istype(inserted_id)) //Sanity check against href spoofs
|
|
if(href_list["choice"] == "eject")
|
|
inserted_id.loc = loc
|
|
inserted_id.verb_pickup()
|
|
inserted_id = null
|
|
if(href_list["choice"] == "claim")
|
|
inserted_id.points += machine.points
|
|
machine.points = 0
|
|
src << "Points transferred."
|
|
else if(href_list["choice"] == "insert")
|
|
var/obj/item/weapon/card/id/prisoner/I = usr.get_active_hand()
|
|
if(istype(I))
|
|
usr.drop_item()
|
|
I.loc = src
|
|
inserted_id = I
|
|
else usr << "<span class='warning'>Invalid ID.</span>"
|
|
if(check_auth()) //Sanity check against hef spoofs
|
|
if(href_list["choice"] == "station")
|
|
if(!alone_in_area(get_area(src), usr))
|
|
usr << "<span class='warning'>Prisoners are only allowed to be released while alone.</span>"
|
|
else
|
|
switch(SSshuttle.moveShuttle("laborcamp","laborcamp_home"))
|
|
if(1)
|
|
usr << "<span class='notice'>Shuttle not found</span>"
|
|
if(2)
|
|
usr << "<span class='notice'>Shuttle already at station</span>"
|
|
if(3)
|
|
usr << "<span class='notice'>No permission to dock could be granted.</span>"
|
|
else
|
|
Radio.set_frequency(SEC_FREQ)
|
|
Radio.talk_into(src, "[inserted_id.registered_name] has returned to the station. Minerals and Prisoner ID card ready for retrieval.", SEC_FREQ)
|
|
usr << "<span class='notice'>Shuttle recieved message and will be sent shortly.</span>"
|
|
|
|
if(href_list["choice"] == "release")
|
|
if(alone_in_area(get_area(loc), usr))
|
|
var/obj/docking_port/stationary/S = SSshuttle.getDock("laborcamp_home")
|
|
if(S && S.get_docked())
|
|
if(release_door && release_door.density)
|
|
release_door.open()
|
|
else
|
|
usr << "<span class='warning'>Prisoners can only be released while docked with the station.</span>"
|
|
else
|
|
usr << "<span class='warning'>Prisoners are only allowed to be released while alone.</span>"
|
|
|
|
src.updateUsrDialog()
|
|
return
|
|
|
|
|
|
/**********************Prisoner Collection Unit**************************/
|
|
|
|
|
|
/obj/machinery/mineral/stacking_machine/laborstacker
|
|
var/points = 0 //The unclaimed value of ore stacked. Value for each ore loosely relative to its rarity.
|
|
var/list/ore_values = list(("glass" = 1), ("metal" = 2), ("solid plasma" = 20), ("plasteel" = 23), ("reinforced glass" = 4), ("gold" = 20), ("silver" = 20), ("uranium" = 20), ("diamond" = 25), ("bananium" = 50))
|
|
|
|
/obj/machinery/mineral/stacking_machine/laborstacker/proc/get_ore_values()
|
|
var/dat = "<table border='0' width='200'>"
|
|
for(var/ore in ore_values)
|
|
var/value = ore_values[ore]
|
|
dat += "<tr><td>[capitalize(ore)]</td><td>[value]</td></tr>"
|
|
dat += "</table>"
|
|
return dat
|
|
|
|
/obj/machinery/mineral/stacking_machine/laborstacker/process_sheet(obj/item/stack/sheet/inp)
|
|
if(istype(inp))
|
|
var/n = inp.name
|
|
var/a = inp.amount
|
|
if(n in ore_values)
|
|
points += ore_values[n] * a
|
|
..()
|
|
|
|
|
|
/**********************Point Lookup Console**************************/
|
|
/obj/machinery/mineral/labor_points_checker
|
|
name = "points checking console"
|
|
desc = "A console used by prisoners to check the progress on their quotas. Simply swipe a prisoner ID."
|
|
icon = 'icons/obj/machines/mining_machines.dmi'
|
|
icon_state = "console"
|
|
density = 0
|
|
anchored = 1
|
|
|
|
/obj/machinery/mineral/labor_points_checker/attack_hand(mob/user)
|
|
user.examinate(src)
|
|
|
|
/obj/machinery/mineral/labor_points_checker/attackby(obj/item/I as obj, mob/user as mob)
|
|
if(istype(I, /obj/item/weapon/card/id))
|
|
if(istype(I, /obj/item/weapon/card/id/prisoner))
|
|
var/obj/item/weapon/card/id/prisoner/prisoner_id = I
|
|
user << "<span class='notice'><B>ID: [prisoner_id.registered_name]</B></span>"
|
|
user << "<span class='notice'>Points Collected:[prisoner_id.points]</span>"
|
|
user << "<span class='notice'>Point Quota: [prisoner_id.goal]</span>"
|
|
user << "<span class='notice'>Collect points by bringing smelted minerals to the Labor Shuttle stacking machine. Reach your quota to earn your release.</span>"
|
|
else
|
|
user << "<span class='warning'>Error: Invalid ID</span>"
|
|
return
|
|
..()
|