Files
Aurora.3/code/modules/ghostroles/spawnpoint/spawnpoint.dm
Matt Atlas 31956c7eb0 Rock the UI Away - Removes VueUI and adds TGUI (#16509)
* tgui the beginning

* binaries and the like

* Bring in the last of it

* Example radio UI

* delete example

* NTOS Main Menu, start on manifest, tgui states

* tasks.json

* gunnery ui pt 1

* okay

* fix everything

* scss update

* oops

* manifest gigablast

* downloader part 1

* download prt 2

* NTOSDownloader final

* mfw committing to_worlds

* gunnery console pt2

* i cooked

* targeting (finished)

* one vueui down

* voting ui almost done

* MY MIND FEELS LIKE AN ARCH ENEMYYYY

* voting ui down

* photocopier

* ntos config + download fixes

* photocopier 2

* refactor define

* NTOS client manager + fixes

* fax machine final (it also uses toner now)

* marching forwards... left behind...

* ntnrc part 1

* canister

* add quotes

* portable pumps pt1 + more backgrounds

* oops

* finish the portable pump

* freezers

so I'll keep on pushing forward... you haven't seen the last of me... oooooooh...

* doors ui pt1

* finish doors UI (forgive me wildkins it's a bit of shitcode)

* vitals monitor, make things use labeled lists, new backgrounds

* mais j'envoyé aucun mayday...

* maglock pt1

* pour ça je me suis perdu...

* infrared

* fix that

* prox sensor pt1

* prox sensor

* signaler (this was actually pretty hard)

* atmos control pt1

* atmos control pt1.1

* atmos pt 2

* fuel injector

* multitool UI

* jammer

* list viewer

* APC

* portgen

* targeting console updates + SMES ui

* new themes, shield generator

* supermatter

* Add ore detector and (shitty) NTNet Relay

* orderterminal pt1

* orderterminal pt2

* smartfridge

* Add (air-)tank GUI update ore detector size

* Adds Transfer Valves

* Add AtmoScrubber

* analyzer pt1

* weapons analyzer pt2

* bodyscanner pt1

* bodyscanner pt2

* fix this shitcode

* seed storage

* appearance changer

* appearance changer final

* sleeper pt1

* sleeper

* gps

* vehicles

* chem dispenser

* lily request

* holopad

* tgui modules pt1

* ppanel

* damage menu

* fixes

* im here too now

* follow menu, search bars

* quikpay

* quikpay fixes

* circuit printer

* ppanel

* ppanel updates

* pai

* turret controls (i want to kill myself)

* tweak

* remove the boardgame

* guntracker

* implant tracker

* penal mechs

come close to me, come close to me

* chem codex

* pai radio

* doorjack

* pai directives

* signaler removal, sensors

* ghost spawner

* spawnpoint

* fixes

* teleporter

* one more to the chopping block

* account database

* remove divider

* scanner, atmos

* latejoin ui pt1

* latejoin

* records pt1

* RECORDS UI DONE

* delete interpreter & records

* CHAT FUCKING CLIENT

* data updates

* fix some things

* final UI, log

* basic nanoui fix

* antag panel

* remove vueui

* atm update

* vending update

* warrants, cameras

* ntmonitor

* time comes for all

* preserve this legacy

* bring that back (oops)

* rcon, ui auto update for computer UIs, remove rcon computers

* alarm monitoring (a bit broke and also todo: add custom alarm monitoring programs to a few consoles)

* A LIKE SUPREME

* a

* power monitor

* lights on

* fuck this code, fuck nanoui modules, and fuck nanoui

* LEAVE IT OH SO FAR BEHIND

* fix alarm monitoring for synths

* I SAW IN YOU WHAT LIFE WAS MISSING

* comms console

* idcard and record updates

* turn the light on

* arcade

* pt2

* news browser

* static

* crusher

* f

* COULD I JUST SLEIGH THE GOLD FROM THE BALLS? I'M SO FRUSTRATED OH COULD YOU TELL? IF I HEAR ONE MORE VUEUI OR ONE NANOUI I'M GONNA LOSE IT SO LET ME GOOOOOOOOOOOOOOOOO

* codeowners & suit sensors

* html ui style removal

* make lint happy

* resist and disorder

* i slowly get up and turn off the noise, already fed up...

* pleaseeeeeeeeeeeeeee

* THE CREDIT LARP IS NECESSARY

* i hold the keys

* RISE UP

* fix that?

* harry's suggestions xoxo

* runtime fix pt2

* You are the only thing that I still care about

* adds build workflow

* Update update_tgui.yml

* adds some needed steps

* ATM

* misc fixes and tweaks

* fixes 2

* make newscasters usable and fix use power on freezers

* turret control is clearer

---------

Co-authored-by: John Wildkins <john.wildkins@gmail.com>
Co-authored-by: Matt Atlas <liermattia@gmail.com>
Co-authored-by: harryob <55142896+harryob@users.noreply.github.com>
Co-authored-by: Werner <Arrow768@users.noreply.github.com>
Co-authored-by: Geeves <ggrobler447@gmail.com>
Co-authored-by: harryob <me@harryob.live>
2023-06-25 19:03:33 +02:00

195 lines
5.4 KiB
Plaintext

#define STATE_UNAVAILABLE 1
#define STATE_AVAILABLE 2
#define STATE_RECHARGING 3
#define STATE_USED 4
/obj/effect/ghostspawpoint
name = "invisible ghost spawner - single"
desc = "A Invisible ghost spawner"
icon = 'icons/mob/screen/generic.dmi'
icon_state = "x2"
anchored = 1
unacidable = 1
simulated = 0
invisibility = 101
movable_flags = MOVABLE_FLAG_EFFECTMOVE
var/identifier = null //identifier of this spawnpoint
var/single_use = FALSE //Ghost spawners with this set to TRUE will not be disabled.
var/recharge_time = 0 //Time it takes until the ghostspawner can be used again
var/unavailable_time = null //Time when the ghost spawner became unavailable
var/icon_unavailable = "x2"
var/icon_available = "x2" //Icon to use when available
var/icon_recharging = "x2" //Icon to use when recharging
var/icon_used = "x2" //Icon to use when spwanpoint has been used
var/state = STATE_AVAILABLE
/obj/effect/ghostspawpoint/Initialize(mapload)
. = ..()
SSghostroles.add_spawnpoints(src)
/obj/effect/ghostspawpoint/update_icon()
if(state == STATE_UNAVAILABLE)
icon_state = icon_unavailable
else if(state == STATE_AVAILABLE)
icon_state = icon_available
else if (state == STATE_RECHARGING)
icon_state = icon_recharging
else if (state == STATE_USED)
icon_state = icon_used
else
icon_state = initial(icon_state)
/obj/effect/ghostspawpoint/process()
if(recharge_time && (recharge_time * 10) > (world.time - unavailable_time))
STOP_PROCESSING(SSprocessing, src)
state = STATE_AVAILABLE
update_icon()
/obj/effect/ghostspawpoint/attack_ghost(mob/user)
if(!ROUND_IS_STARTED)
to_chat(usr, "<span class='danger'>The round hasn't started yet!</span>")
return
ui_interact(user)
/obj/effect/ghostspawpoint/attack_hand(mob/user)
if(!ROUND_IS_STARTED)
to_chat(usr, "<span class='danger'>The round hasn't started yet!</span>")
return
ui_interact(user)
/obj/effect/ghostspawpoint/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "GhostSpawner", "Ghost Spawner", 480, 500)
ui.open()
/obj/effect/ghostspawpoint/ui_data(mob/user)
var/list/data = list()
var/datum/ghostspawner/G = SSghostroles.spawners[identifier]
if(!G)
return
data["spawners"] = list(list(
"short_name" = G.short_name,
"name" = G.name,
"desc" = G.desc,
"type" = G.type,
"cant_spawn" = G.cant_spawn(user),
"can_edit" = G.can_edit(user),
"can_jump_to" = G.can_jump_to(user),
"enabled" = G.enabled,
"count" = G.count,
"spawn_atoms" = length(G.spawn_atoms),
"max_count" = G.max_count,
"tags" = G.tags,
"spawnpoints" = G.spawnpoints
))
data["categories"] = G.tags
return data
/obj/effect/ghostspawpoint/ui_state(mob/user)
return observer_state
/obj/effect/ghostspawpoint/ui_status(mob/user, datum/ui_state/state)
return UI_INTERACTIVE
/obj/effect/ghostspawpoint/proc/is_available()
return TRUE
/obj/effect/ghostspawpoint/proc/set_spawned()
if(recharge_time) //If we are available again after a certain time -> being processing
state = STATE_RECHARGING
unavailable_time = world.time
START_PROCESSING(SSprocessing, src)
else
if(single_use)
state = STATE_USED
update_icon()
/obj/effect/ghostspawpoint/proc/set_available()
if(state == STATE_USED)
return //if its a one-use spawner and it got used already, dont reset it
state = STATE_AVAILABLE
update_icon()
/obj/effect/ghostspawpoint/proc/set_unavailable()
if(state == STATE_USED)
return //if its a one-use spawner and it got used already, dont reset it
else if(state == STATE_RECHARGING)
STOP_PROCESSING(SSprocessing, src)
state = STATE_UNAVAILABLE
update_icon()
#undef STATE_UNAVAILABLE
#undef STATE_AVAILABLE
#undef STATE_RECHARGING
#undef STATE_USED
/obj/effect/ghostspawpoint/repeat
name = "invisible ghost spawner - repeat"
desc = "A Invisible ghost spawner"
icon = 'icons/mob/screen/generic.dmi'
icon_state = "x3"
icon_unavailable = "x3" //Icon to use when unavailable
icon_available = "x3" //Icon to use when available
icon_recharging = "x3" //Icon to use when recharging
icon_used = "x3" //Icon to use when spwanpoint has been used
recharge_time = 1
single_use = TRUE
/obj/effect/ghostspawpoint/one_use
name = "single use ghost spawner"
single_use = TRUE
/obj/effect/ghostspawpoint/cryo
name = "cryogenic storage pod"
desc = "A pod used to store individual in suspended animation"
icon = 'icons/obj/sleeper.dmi'
icon_state = "sleeper-closed"
identifier = null //identifier of this spawnpoint
icon_unavailable = "sleeper-closed" //Icon to use when unavailable
icon_available = "sleeper-closed" //Icon to use when available
icon_recharging = "sleeper" //Icon to use when recharging
icon_used = "sleeper" //Icon to use when spwanpoint has been used
anchored = 1
unacidable = 1
simulated = 1
invisibility = 0
/obj/effect/ghostspawpoint/button
name = "button"
desc = "A button used for some kind of purpose."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "doorctrl0"
identifier = null
icon_unavailable = "doorctrl0"
icon_available = "doorctrl-p"
icon_recharging = "doorctrl-p"
icon_used = "doorctrl-p"
anchored = 1
unacidable = 1
simulated = 1
invisibility = 0
var/use_message = "An assistant has been requested. One will be with you shortly if available."
var/message_used = FALSE
/obj/effect/ghostspawpoint/button/set_available()
..()
if(use_message && !message_used)
message_used = TRUE
visible_message(SPAN_NOTICE(use_message))
playsound(src.loc, 'sound/machines/chime.ogg', 25, 1)