Skip to content

Commit

Permalink
shorten delay
Browse files Browse the repository at this point in the history
  • Loading branch information
BeebBeebBoob committed Dec 27, 2024
1 parent db2da31 commit 9eddea1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion code/game/machinery/computer/law.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#define NORMAL_UPLOAD_DELAY 20 SECONDS
#define SHORTEN_UPLOAD_DELAY 5 SECONDS

/obj/machinery/computer/aiupload
name = "\improper AI upload console"
desc = "Используется для манипуляций с законами ИИ."
Expand All @@ -10,7 +13,10 @@
var/obj/item/card/id/id = null
var/hacked = FALSE

var/delay = 20 SECONDS
var/static/list/shorten_delay = list(
/obj/item/ai_module/purge,
/obj/item/ai_module/reset
)
var/timer_id = null
var/reg_name = null

Expand Down Expand Up @@ -120,6 +126,7 @@
if(!installed_module.check_install(user))
return

var/delay = (installed_module in shorten_delay) ? SHORTEN_UPLOAD_DELAY : NORMAL_UPLOAD_DELAY
to_chat(user, span_notice("Upload process has started. ETA: [delay/10] seconds."))
timer_id = addtimer(CALLBACK(src, TYPE_PROC_REF(/obj/machinery/computer/aiupload, finish_upload), user), delay, TIMER_STOPPABLE)

Expand Down Expand Up @@ -233,6 +240,7 @@
if(!installed_module.check_install(user))
return

var/delay = (installed_module in shorten_delay) ? SHORTEN_UPLOAD_DELAY : NORMAL_UPLOAD_DELAY
to_chat(user, span_notice("Upload process has started. ETA: [delay/10] seconds."))
reg_name = hacked ? "UNKNOWN" : id.registered_name
timer_id = addtimer(CALLBACK(src, TYPE_PROC_REF(/obj/machinery/computer/aiupload, finish_upload), user), delay, TIMER_STOPPABLE)
Expand All @@ -243,3 +251,6 @@
to_chat(current, "These are your laws now:")
current.show_laws()
atom_say("Upload complete. The laws have been modified.")

#undef NORMAL_UPLOAD_DELAY
#undef SHORTEN_UPLOAD_DELAY

0 comments on commit 9eddea1

Please sign in to comment.