mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-26 06:22:26 +01:00
Shredder Movement & Law Controller (#1700)
Paper shredders can now be detached from the floor with a wrench and moved about. Refactored the law process to not be a process - it didn't tick anyways.
This commit is contained in:
+1
-1
@@ -123,6 +123,7 @@
|
||||
#include "code\controllers\emergency_shuttle_controller.dm"
|
||||
#include "code\controllers\hooks-defs.dm"
|
||||
#include "code\controllers\hooks.dm"
|
||||
#include "code\controllers\law.dm"
|
||||
#include "code\controllers\master_controller.dm"
|
||||
#include "code\controllers\shuttle_controller.dm"
|
||||
#include "code\controllers\subsystems.dm"
|
||||
@@ -137,7 +138,6 @@
|
||||
#include "code\controllers\Processes\explosives.dm"
|
||||
#include "code\controllers\Processes\garbage.dm"
|
||||
#include "code\controllers\Processes\inactivity.dm"
|
||||
#include "code\controllers\Processes\law.dm"
|
||||
#include "code\controllers\Processes\lighting.dm"
|
||||
#include "code\controllers\Processes\machinery.dm"
|
||||
#include "code\controllers\Processes\mob.dm"
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
/var/global/datum/controller/process/law/corp_regs
|
||||
|
||||
/datum/controller/process/law
|
||||
var/list/laws = list() // All laws
|
||||
|
||||
var/list/low_severity = list()
|
||||
var/list/med_severity = list()
|
||||
var/list/high_severity = list()
|
||||
|
||||
disabled = 1
|
||||
|
||||
/datum/controller/process/law/New()
|
||||
corp_regs = src
|
||||
|
||||
..()
|
||||
|
||||
/datum/controller/process/law/setup()
|
||||
name = "Law"
|
||||
schedule_interval = 100
|
||||
|
||||
for( var/L in subtypesof( /datum/law/low_severity ))
|
||||
low_severity += new L
|
||||
|
||||
for( var/L in subtypesof( /datum/law/med_severity ))
|
||||
med_severity += new L
|
||||
|
||||
for( var/L in subtypesof( /datum/law/high_severity ))
|
||||
high_severity += new L
|
||||
|
||||
laws = low_severity + med_severity + high_severity
|
||||
@@ -0,0 +1,24 @@
|
||||
/var/global/datum/controller/law/corp_regs
|
||||
|
||||
/datum/controller/law
|
||||
var/list/laws = list() // All laws
|
||||
|
||||
var/list/low_severity = list()
|
||||
var/list/med_severity = list()
|
||||
var/list/high_severity = list()
|
||||
|
||||
/datum/controller/law/New()
|
||||
corp_regs = src
|
||||
|
||||
for (var/L in subtypesof(/datum/law/low_severity))
|
||||
low_severity += new L
|
||||
|
||||
for (var/L in subtypesof(/datum/law/med_severity))
|
||||
med_severity += new L
|
||||
|
||||
for (var/L in subtypesof(/datum/law/high_severity))
|
||||
high_severity += new L
|
||||
|
||||
laws = low_severity + med_severity + high_severity
|
||||
|
||||
..()
|
||||
@@ -94,5 +94,8 @@ datum/controller/game_controller/proc/setup_objects()
|
||||
//Set up spawn points.
|
||||
populate_spawn_points()
|
||||
|
||||
// Setup laws.
|
||||
global.corp_regs = new
|
||||
|
||||
admin_notice("<span class='danger'>Initializations complete.</span>", R_DEBUG)
|
||||
sleep(-1)
|
||||
|
||||
@@ -17,16 +17,29 @@
|
||||
)
|
||||
|
||||
/obj/machinery/papershredder/attackby(var/obj/item/W, var/mob/user)
|
||||
|
||||
if(istype(W, /obj/item/weapon/storage))
|
||||
if (istype(W, /obj/item/weapon/storage))
|
||||
empty_bin(user, W)
|
||||
return
|
||||
|
||||
else if (iswrench(W))
|
||||
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
anchored = !anchored
|
||||
user.visible_message(
|
||||
span("notice", anchored ? "\The [user] fastens \the [src] to \the [loc]." : "\The unfastens \the [src] from \the [loc]."),
|
||||
span("notice", anchored ? "You fasten \the [src] to \the [loc]." : "You unfasten \the [src] from \the [loc]."),
|
||||
"You hear a ratchet."
|
||||
)
|
||||
return
|
||||
|
||||
else
|
||||
var/paper_result
|
||||
for(var/shred_type in shred_amounts)
|
||||
if(istype(W, shred_type))
|
||||
paper_result = shred_amounts[shred_type]
|
||||
if(paper_result)
|
||||
if (!anchored)
|
||||
user << span("warning", "\The [src] must be anchored to the ground to operate!")
|
||||
return
|
||||
if(paperamount == max_paper)
|
||||
user << "<span class='warning'>\The [src] is full; please empty it before you continue.</span>"
|
||||
return
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
author: Lohikar
|
||||
delete-after: True
|
||||
changes:
|
||||
- rscadd: "You can now detach paper shredders from the floor with a wrench."
|
||||
Reference in New Issue
Block a user