From 1666095407a0d89692f7fbc10a45692dfc3b0b2c Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Thu, 21 Nov 2024 11:46:53 +0100 Subject: [PATCH 1/7] While minutes are capped, planets can have much more hours in their individual days --- code/modules/admin/verbs/debug.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 18ff612d9a..594ca286a2 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -678,7 +678,7 @@ var/datum/planet/planet = tgui_input_list(usr, "Which planet do you want to modify time on?", "Change Time", SSplanets.planets) if(istype(planet)) var/datum/time/current_time_datum = planet.current_time - var/new_hour = tgui_input_number(usr, "What hour do you want to change to?", "Change Time", text2num(current_time_datum.show_time("hh")), 23) + var/new_hour = tgui_input_number(usr, "What hour do you want to change to?", "Change Time", text2num(current_time_datum.show_time("hh"))) if(!isnull(new_hour)) var/new_minute = tgui_input_number(usr, "What minute do you want to change to?", "Change Time", text2num(current_time_datum.show_time("mm")), 59) if(!isnull(new_minute)) From bcee92492ef076be5b5c841e22f840ed6822b95d Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Thu, 21 Nov 2024 18:48:34 +0100 Subject: [PATCH 2/7] do it smart --- code/modules/admin/verbs/debug.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 594ca286a2..03de0eb101 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -678,7 +678,8 @@ var/datum/planet/planet = tgui_input_list(usr, "Which planet do you want to modify time on?", "Change Time", SSplanets.planets) if(istype(planet)) var/datum/time/current_time_datum = planet.current_time - var/new_hour = tgui_input_number(usr, "What hour do you want to change to?", "Change Time", text2num(current_time_datum.show_time("hh"))) + var/planet_hours = max(round(current_time_datum.seconds_in_day / 36000) - 1, 0) + var/new_hour = tgui_input_number(usr, "What hour do you want to change to?", "Change Time", text2num(current_time_datum.show_time("hh")), planet_hours) if(!isnull(new_hour)) var/new_minute = tgui_input_number(usr, "What minute do you want to change to?", "Change Time", text2num(current_time_datum.show_time("mm")), 59) if(!isnull(new_minute)) From 4c5cba6cc8353ca304dd5511ed1fe74d3b889a47 Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Thu, 21 Nov 2024 18:58:05 +0100 Subject: [PATCH 3/7] minutes too --- code/modules/admin/verbs/debug.dm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 03de0eb101..7de8a8cebb 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -678,10 +678,11 @@ var/datum/planet/planet = tgui_input_list(usr, "Which planet do you want to modify time on?", "Change Time", SSplanets.planets) if(istype(planet)) var/datum/time/current_time_datum = planet.current_time - var/planet_hours = max(round(current_time_datum.seconds_in_day / 36000) - 1, 0) - var/new_hour = tgui_input_number(usr, "What hour do you want to change to?", "Change Time", text2num(current_time_datum.show_time("hh")), planet_hours) + var/planet_hours = max(round(current_time_datum.seconds_in_day / 36000), 0) + var/new_hour = tgui_input_number(usr, "What hour do you want to change to?", "Change Time", text2num(current_time_datum.show_time("hh")), planet_hours - 1) if(!isnull(new_hour)) - var/new_minute = tgui_input_number(usr, "What minute do you want to change to?", "Change Time", text2num(current_time_datum.show_time("mm")), 59) + var/planet_minutes = max(round(current_time_datum.seconds_in_hour / 600), 0) + var/new_minute = tgui_input_number(usr, "What minute do you want to change to?", "Change Time", text2num(current_time_datum.show_time("mm")), planet_minutes - 1) if(!isnull(new_minute)) var/type_needed = current_time_datum.type var/datum/time/new_time = new type_needed() From 1726dc847a663a193c2d421d7959d348981c413b Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Thu, 21 Nov 2024 18:59:01 +0100 Subject: [PATCH 4/7] . --- code/modules/admin/verbs/debug.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 7de8a8cebb..ba2e7afcb2 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -678,11 +678,11 @@ var/datum/planet/planet = tgui_input_list(usr, "Which planet do you want to modify time on?", "Change Time", SSplanets.planets) if(istype(planet)) var/datum/time/current_time_datum = planet.current_time - var/planet_hours = max(round(current_time_datum.seconds_in_day / 36000), 0) - var/new_hour = tgui_input_number(usr, "What hour do you want to change to?", "Change Time", text2num(current_time_datum.show_time("hh")), planet_hours - 1) + var/planet_hours = max(round(current_time_datum.seconds_in_day / 36000) - 1, 0) + var/new_hour = tgui_input_number(usr, "What hour do you want to change to?", "Change Time", text2num(current_time_datum.show_time("hh")), planet_hours) if(!isnull(new_hour)) - var/planet_minutes = max(round(current_time_datum.seconds_in_hour / 600), 0) - var/new_minute = tgui_input_number(usr, "What minute do you want to change to?", "Change Time", text2num(current_time_datum.show_time("mm")), planet_minutes - 1) + var/planet_minutes = max(round(current_time_datum.seconds_in_hour / 600) - 1, 0) + var/new_minute = tgui_input_number(usr, "What minute do you want to change to?", "Change Time", text2num(current_time_datum.show_time("mm")), planet_minutes) if(!isnull(new_minute)) var/type_needed = current_time_datum.type var/datum/time/new_time = new type_needed() From 58a694b69de5d40c439b540a25b785af2c67849b Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Fri, 22 Nov 2024 21:13:37 +0100 Subject: [PATCH 5/7] fix that here too --- code/modules/projectiles/broken.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/projectiles/broken.dm b/code/modules/projectiles/broken.dm index 6d90e68fef..a0487764f6 100644 --- a/code/modules/projectiles/broken.dm +++ b/code/modules/projectiles/broken.dm @@ -105,7 +105,7 @@ if(S.can_use(material_needs[path])) return TRUE else - to_chat(user, span_notice("You do not have enough [path] to continue repairs.")) + to_chat(user, span_notice("You do not have enough [I] to continue repairs.")) else return TRUE From 9d738334db93422a3a5c2f72b1efb76f3b814389 Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Fri, 22 Nov 2024 21:22:32 +0100 Subject: [PATCH 6/7] really... --- code/modules/projectiles/broken.dm | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/code/modules/projectiles/broken.dm b/code/modules/projectiles/broken.dm index a0487764f6..4269d7ec85 100644 --- a/code/modules/projectiles/broken.dm +++ b/code/modules/projectiles/broken.dm @@ -98,17 +98,18 @@ /obj/item/broken_gun/proc/can_repair_with(obj/item/I, mob/user) for(var/path in material_needs) - if(ispath(path) && istype(I, path)) - if(material_needs[path] > 0) - if(istype(I, /obj/item/stack)) - var/obj/item/stack/S = I - if(S.can_use(material_needs[path])) - return TRUE - else - to_chat(user, span_notice("You do not have enough [I] to continue repairs.")) - else - return TRUE - + if(!ispath(path) || !istype(I, path)) + continue + if(material_needs[path] <= 0) + continue + if(istype(I, /obj/item/stack)) + var/obj/item/stack/S = I + if(S.can_use(material_needs[path])) + return TRUE + else + to_chat(user, span_notice("You do not have enough [I] to continue repairs.")) + else + return TRUE return FALSE /obj/item/broken_gun/proc/repair_with(obj/item/I, mob/user) From 7454a10ce0e238f0b9992f15896bedd762f0bd5c Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Fri, 22 Nov 2024 21:24:32 +0100 Subject: [PATCH 7/7] . --- code/modules/projectiles/broken.dm | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/code/modules/projectiles/broken.dm b/code/modules/projectiles/broken.dm index 4269d7ec85..3eda477814 100644 --- a/code/modules/projectiles/broken.dm +++ b/code/modules/projectiles/broken.dm @@ -114,19 +114,21 @@ /obj/item/broken_gun/proc/repair_with(obj/item/I, mob/user) for(var/path in material_needs) - if(ispath(path) && istype(I, path)) - if(material_needs[path] > 0) - if(istype(I, /obj/item/stack)) - var/obj/item/stack/S = I - if(S.can_use(material_needs[path])) - S.use(material_needs[path]) - material_needs[path] = 0 - to_chat(user, span_notice("You repair some damage on \the [src] with \the [S].")) - else - material_needs[path] = max(0, material_needs[path] - 1) - user.drop_from_inventory(I) - to_chat(user, span_notice("You repair some damage on \the [src] with \the [I].")) - qdel(I) + if(!ispath(path) || !istype(I, path)) + continue + if(material_needs[path] <= 0) + continue + if(istype(I, /obj/item/stack)) + var/obj/item/stack/S = I + if(S.can_use(material_needs[path])) + S.use(material_needs[path]) + material_needs[path] = 0 + to_chat(user, span_notice("You repair some damage on \the [src] with \the [S].")) + else + material_needs[path] = max(0, material_needs[path] - 1) + user.drop_from_inventory(I) + to_chat(user, span_notice("You repair some damage on \the [src] with \the [I].")) + qdel(I) check_complete_repair(user)