Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nuclear_bomb): bomb timer will now use seconds instead of deciseconds #11229

Merged
merged 2 commits into from
Dec 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions code/game/machinery/nuclear_bomb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var/bomb_set
var/deployable = 0
var/extended = 0
var/lighthack = 0
var/timeleft = 120
var/timeleft = 120 SECONDS
var/timing = 0
var/r_code = "ADMIN"
var/code = ""
Expand All @@ -31,17 +31,15 @@ var/bomb_set
wires = new /datum/wires/nuclearbomb(src)

/obj/machinery/nuclearbomb/Destroy()
qdel(wires)
wires = null
qdel(auth)
auth = null
QDEL_NULL(wires)
QDEL_NULL(auth)
return ..()

/obj/machinery/nuclearbomb/Process(wait)
if(timing)
timeleft = max(timeleft - wait, 0)
if(timeleft <= 0)
addtimer(CALLBACK(src, nameof(.proc/explode)), 0)
INVOKE_ASYNC(src, nameof(.proc/explode))
SSnano.update_uis(src)

/obj/machinery/nuclearbomb/attackby(obj/item/O as obj, mob/user as mob, params)
Expand Down Expand Up @@ -193,7 +191,7 @@ var/bomb_set
else
data["authstatus"] = "Auth. S1"
data["safe"] = safety ? "Safe" : "Engaged"
data["time"] = timeleft
data["time"] = timeleft / 10
data["timer"] = timing
data["safety"] = safety
data["anchored"] = anchored
Expand Down Expand Up @@ -275,8 +273,8 @@ var/bomb_set
return

var/time = text2num(href_list["time"])
timeleft += time
timeleft = Clamp(timeleft, 120, 600)
timeleft += time SECONDS
timeleft = Clamp(timeleft, 120 SECONDS, 600 SECONDS)
if(href_list["timer"])
if(timing == -1)
return 1
Expand Down Expand Up @@ -338,7 +336,7 @@ var/bomb_set
bomb_set--
safety = TRUE
timing = 0
timeleft = Clamp(timeleft, 120, 600)
timeleft = Clamp(timeleft, 120 SECONDS, 600 SECONDS)
update_icon()

/obj/machinery/nuclearbomb/ex_act(severity)
Expand Down Expand Up @@ -512,8 +510,8 @@ var/bomb_set
to_chat(usr, "<span class='warning'>Cannot alter the timing during countdown.</span>")
return
var/time = text2num(href_list["time"])
timeleft += time
timeleft = Clamp(timeleft, 300, 900)
timeleft += time SECONDS
timeleft = Clamp(timeleft, 300 SECONDS, 900 SECONDS)
return 1

/obj/machinery/nuclearbomb/station/start_bomb()
Expand Down
Loading