Files
Paradise/code/_onclick/hud/blob_overmind.dm
Luc 1fe7819c1b Ports action button refactor from /tg/ (#24482)
* add the new stuff

* guh

* add the brunt of it

* action button stuff

* adds a lot of other stuff

* careful find and replace

* it loads

* so many huds

* ehh yeah this kinda works

* fixes this runtime

* hacks in some DMI stuff, we'll fix it later

* Adds better mouse pointer for dragging buttons

* gets dragging into place working again, updates DMI

* moves define

* remove extra hud defines, now it compiles

* CHECK GREP

* owww

* rename action defines

* ticks

* are we good

* let's try that again

* renames mob vars

* renames

* fixes some hud issues with huds getting the wrong variable

* fixes some alignment issues

* Adds mouse-wheel scroll support

* left -> right

* I am the entire circus

* first self-review pass

* Another review pass -- just realized I need to fix keybinds

* more testing

* update icons

* oops

* Fix spell icons not appearing properly

* fixes some outstanding issues
- Action button backgrounds now work properly
- Fixes some runtimes on dropping
- Fixes some misplaced icons

* hmm

* weh

* again?

* nah?

* maybe this?

* asdf

* should finally fix CI

* add client check

* move the ?

* add missing override causing runtimes

* shift-clicking now doesn't trigger the button

* better docs
2024-03-24 17:38:53 +00:00

202 lines
6.0 KiB
Plaintext

/atom/movable/screen/blob
icon = 'icons/mob/blob.dmi'
/atom/movable/screen/blob/MouseEntered(location, control, params)
. = ..()
openToolTip(usr,src,params,title = name,content = desc, theme = "blob")
/atom/movable/screen/blob/MouseExited()
closeToolTip(usr)
return ..()
/atom/movable/screen/blob/BlobHelp
icon_state = "ui_help"
name = "Blob Help"
desc = "Help on playing blob!"
/atom/movable/screen/blob/BlobHelp/Click()
if(isovermind(usr))
var/mob/camera/blob/B = usr
B.blob_help()
/atom/movable/screen/blob/JumpToNode
icon_state = "ui_tonode"
name = "Jump to Node"
desc = "Moves your camera to a selected blob node."
/atom/movable/screen/blob/JumpToNode/Click()
if(isovermind(usr))
var/mob/camera/blob/B = usr
B.jump_to_node()
/atom/movable/screen/blob/JumpToCore
icon_state = "ui_tocore"
name = "Jump to Core"
desc = "Moves your camera to your blob core."
/atom/movable/screen/blob/JumpToCore/MouseEntered(location, control, params)
if(hud && hud.mymob && isovermind(hud.mymob))
name = initial(name)
desc = initial(desc)
return ..()
/atom/movable/screen/blob/JumpToCore/Click()
if(isovermind(usr))
var/mob/camera/blob/B = usr
B.transport_core()
/atom/movable/screen/blob/Blobbernaut
icon_state = "ui_blobbernaut"
name = "Produce Blobbernaut (60)"
desc = "Produces a strong, intelligent blobbernaut from a factory blob for 60 resources.<br>The factory blob will be destroyed in the process."
/atom/movable/screen/blob/Blobbernaut/Click()
if(isovermind(usr))
var/mob/camera/blob/B = usr
B.create_blobbernaut()
/atom/movable/screen/blob/StorageBlob
icon_state = "ui_storage"
name = "Produce Storage Blob (40)"
desc = "Produces a storage blob for 40 resources.<br>Storage blobs will raise your max resource cap by 50."
/atom/movable/screen/blob/StorageBlob/Click()
if(isovermind(usr))
var/mob/camera/blob/B = usr
B.create_storage()
/atom/movable/screen/blob/ResourceBlob
icon_state = "ui_resource"
name = "Produce Resource Blob (40)"
desc = "Produces a resource blob for 40 resources.<br>Resource blobs will give you resources every few seconds."
/atom/movable/screen/blob/ResourceBlob/Click()
if(isovermind(usr))
var/mob/camera/blob/B = usr
B.create_resource()
/atom/movable/screen/blob/NodeBlob
icon_state = "ui_node"
name = "Produce Node Blob (60)"
desc = "Produces a node blob for 60 resources.<br>Node blobs will expand and activate nearby resource and factory blobs."
/atom/movable/screen/blob/NodeBlob/Click()
if(isovermind(usr))
var/mob/camera/blob/B = usr
B.create_node()
/atom/movable/screen/blob/FactoryBlob
icon_state = "ui_factory"
name = "Produce Factory Blob (60)"
desc = "Produces a factory blob for 60 resources.<br>Factory blobs will produce spores every few seconds."
/atom/movable/screen/blob/FactoryBlob/Click()
if(isovermind(usr))
var/mob/camera/blob/B = usr
B.create_factory()
/atom/movable/screen/blob/ReadaptChemical
icon_state = "ui_chemswap"
name = "Readapt Chemical (50)"
desc = "Randomly rerolls your chemical for 50 resources."
/atom/movable/screen/blob/ReadaptChemical/MouseEntered(location, control, params)
if(hud && hud.mymob && isovermind(hud.mymob))
name = initial(name)
desc = initial(desc)
return ..()
/atom/movable/screen/blob/ReadaptChemical/Click()
if(isovermind(usr))
var/mob/camera/blob/B = usr
B.chemical_reroll()
/atom/movable/screen/blob/RelocateCore
icon_state = "ui_swap"
name = "Relocate Core (80)"
desc = "Swaps a node and your core for 80 resources."
/atom/movable/screen/blob/RelocateCore/Click()
if(isovermind(usr))
var/mob/camera/blob/B = usr
B.relocate_core()
/atom/movable/screen/blob/Split
icon_state = "ui_split"
name = "Split consciousness (100)"
desc = "Creates another Blob Overmind at the targeted node. One use only.<br>Offspring are unable to use this ability."
/atom/movable/screen/blob/Split/Click()
if(isovermind(usr))
var/mob/camera/blob/B = usr
B.split_consciousness()
if(B.split_used) // Destroys split proc if the split is succesfully used
qdel(src)
/datum/hud/blob_overmind/New(mob/user)
..()
var/atom/movable/screen/using
blobpwrdisplay = new /atom/movable/screen()
blobpwrdisplay.name = "blob power"
blobpwrdisplay.icon_state = "block"
blobpwrdisplay.screen_loc = ui_health
blobpwrdisplay.mouse_opacity = MOUSE_OPACITY_TRANSPARENT
blobpwrdisplay.layer = ABOVE_HUD_LAYER
blobpwrdisplay.plane = ABOVE_HUD_PLANE
static_inventory += blobpwrdisplay
blobhealthdisplay = new /atom/movable/screen()
blobhealthdisplay.name = "blob health"
blobhealthdisplay.icon_state = "block"
blobhealthdisplay.screen_loc = ui_internal
static_inventory += blobhealthdisplay
using = new /atom/movable/screen/blob/BlobHelp()
using.screen_loc = "WEST:6,NORTH:-3"
static_inventory += using
using = new /atom/movable/screen/blob/JumpToNode()
using.screen_loc = ui_inventory
static_inventory += using
using = new /atom/movable/screen/blob/JumpToCore()
using.screen_loc = ui_zonesel
using.hud = src
static_inventory += using
using = new /atom/movable/screen/blob/Blobbernaut()
using.screen_loc = ui_id
static_inventory += using
using = new /atom/movable/screen/blob/StorageBlob()
using.screen_loc = ui_belt
static_inventory += using
using = new /atom/movable/screen/blob/ResourceBlob()
using.screen_loc = ui_back
static_inventory += using
using = new /atom/movable/screen/blob/NodeBlob()
using.screen_loc = using.screen_loc = ui_rhand
static_inventory += using
using = new /atom/movable/screen/blob/FactoryBlob()
using.screen_loc = using.screen_loc = ui_lhand
static_inventory += using
using = new /atom/movable/screen/blob/ReadaptChemical()
using.screen_loc = ui_storage1
using.hud = src
static_inventory += using
using = new /atom/movable/screen/blob/RelocateCore()
using.screen_loc = ui_storage2
static_inventory += using
var/mob/camera/blob/B = user
if(!B.is_offspring) // Checks if the blob is an offspring, to not create split button if it is
using = new /atom/movable/screen/blob/Split()
using.screen_loc = ui_acti
static_inventory += using