Files
Paradise/code/modules/countdown/countdown.dm
JimKil3 0c25bf4a21 Cloning Rework (#21683)
* guts the cloning pod

* guts cloning console (except the tgui)

* clonescanner, more gutting, linkage

* reagent stuff

* `cloning_data` datum

* scanner inserting/removing

* scanning logic

* auto-linkage

* `get_cloning_cost()` in its entirety

* logic for which limbs to grow

* RefreshParts() and insert_organ()

* removes misinformation

* robot parts

* more organ insertion logic

* more organ code :D

* create_clone

* beginnings of clone logic

* cloning addl. stuff

* cloning finalization

* fixes CI?

* whitespace fixes (regex edition)

* ejection logic

* Update code/game/machinery/clonepod.dm

Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>

* stuff

* stuff 2

* update_icon_state stuff

* clonepod TGUI

* organ fix yipee

* cloning console UI beginnings

* cloning console main menu

* reagents stuff

* beginning of damage tab

* damages menu skeleton

* aiuhgugh

* splits up code

* ejecting patient updates ui

* contra reviews

* temp fix for CI

* tgui finished? (clueless)

* Cloning :D
it's done

* manual & tweaks

* more feedback!

* cooldown
because you can spam the fuck out if it otherwise and it's really loud for the ghost

* oops

* tweaks

* edits EVERY MAP OH GOD

* no link stuff

* oops

* Apply suggestions from code review

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Apply suggestions from code review (pt. 2)

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/game/machinery/computer/cloning.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* dgamer review

* Update code/game/machinery/clonepod.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

* henri stuff

* makes it compile

* builds tgui (oops)

* rebuilt bundle i guess?

* not stale i swear

* fixes

* whoops

* countdown stuff

* sirryan review pt. 1

* sirryan review pt 2

* every day i'm shuffling (or something idk)

* wasdfhdfg

* sean clonepod.dm changes

* update_icon(UPDATE_ICON_STATE)

* Update code/game/machinery/clonescanner.dm

Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com>

* icon stuff

* map weirdness

* henri disks

* unfucks maps?

* cc maps

* eject button

* Apply suggestions from code review

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Update code/game/machinery/clonepod.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* dgamer review 2

* ourgh

* dgamer review 3

* waaaah

* fixes access locks

* fixes
Fixes the numbers issues (and no feet hopefully?)

* re-adds feet

* more fixes yipee

* un-biomass

* fixes ghost stuff

* exploit fix

---------

Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>
Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com>
2024-03-16 16:51:13 +00:00

119 lines
2.9 KiB
Plaintext

/obj/effect/countdown
name = "countdown"
desc = "We're leaving together\n\
But still it's farewell\n\
And maybe we'll come back\n\
To earth, who can tell?"
invisibility = INVISIBILITY_OBSERVER
anchored = TRUE
layer = MASSIVE_OBJ_LAYER
color = "#ff0000" // text color
var/text_size = 3 // larger values clip when the displayed text is larger than 2 digits.
var/started = FALSE
var/displayed_text
var/atom/attached_to
/obj/effect/countdown/Initialize(mapload)
. = ..()
attach(loc)
RegisterSignal(attached_to, COMSIG_MOVABLE_MOVED, PROC_REF(countdown_on_move))
/obj/effect/countdown/examine(mob/user)
. = ..()
. += "This countdown is displaying: [displayed_text]."
/obj/effect/countdown/proc/attach(atom/A)
attached_to = A
loc = get_turf(A)
/obj/effect/countdown/proc/start()
if(!started)
START_PROCESSING(SSfastprocess, src)
started = TRUE
/obj/effect/countdown/proc/stop()
if(started)
maptext = null
STOP_PROCESSING(SSfastprocess, src)
started = FALSE
/// Get the value from our atom
/obj/effect/countdown/proc/get_value()
return
/obj/effect/countdown/proc/countdown_on_move()
SIGNAL_HANDLER
forceMove(get_turf(attached_to))
/obj/effect/countdown/process()
if(!attached_to || QDELETED(attached_to))
qdel(src)
if(!isturf(attached_to.loc)) // When in crates, lockers, etc. countdown_on_move wont be called. This is our backup
forceMove(get_turf(attached_to))
var/new_val = get_value()
if(new_val == displayed_text)
return
displayed_text = new_val
if(displayed_text)
maptext = "<font face='Small Fonts' size=[text_size]>[displayed_text]</font>"
else
maptext = null
/obj/effect/countdown/Destroy()
attached_to = null
STOP_PROCESSING(SSfastprocess, src)
return ..()
/obj/effect/countdown/ex_act(severity) //immune to explosions
return
/obj/effect/countdown/singularity_pull()
return
/obj/effect/countdown/singularity_act()
return
/obj/effect/countdown/syndicatebomb
name = "syndicate bomb countdown"
/obj/effect/countdown/syndicatebomb/get_value()
var/obj/machinery/syndicatebomb/S = attached_to
if(!istype(S))
return
else if(S.active)
return S.seconds_remaining()
/obj/effect/countdown/clonepod
name = "cloning pod countdown"
text_size = 1
/obj/effect/countdown/clonepod/get_value()
var/obj/machinery/clonepod/C = attached_to
if(!istype(C))
return
return C.clone_progress
/obj/effect/countdown/supermatter
name = "supermatter damage"
text_size = 1
color = "#00ff80"
/obj/effect/countdown/supermatter/get_value()
var/obj/machinery/atmospherics/supermatter_crystal/S = attached_to
if(!istype(S))
return
return "<div align='center' valign='middle' style='position:relative; top:0px; left:0px'>[round(S.get_integrity(), 1)]%</div>"
/obj/effect/countdown/anomaly
name = "anomaly countdown"
/obj/effect/countdown/anomaly/get_value()
var/obj/effect/anomaly/A = attached_to
if(!istype(A))
return
var/time_left = max(0, (A.death_time - world.time) / 10)
return round(time_left)