diff --git a/code/__defines/hud.dm b/code/__defines/hud.dm
new file mode 100644
index 000000000000..9c08cf7d0257
--- /dev/null
+++ b/code/__defines/hud.dm
@@ -0,0 +1,4 @@
+#define CLEAR_HUD_ALERTS(M) if(istype(M?.hud_used, /datum/hud) && M.hud_used.alerts) { M.hud_used.alerts = null; }
+#define SET_HUD_ALERT(M, A, V) if(istype(M?.hud_used, /datum/hud)) { LAZYSET(M.hud_used.alerts, A, V); }
+#define SET_HUD_ALERT_MIN(M, A, V) if(istype(M?.hud_used, /datum/hud) && V < LAZYACCESS(M.hud_used.alerts, A)) { LAZYSET(M.hud_used.alerts, A, V); }
+#define SET_HUD_ALERT_MAX(M, A, V) if(istype(M?.hud_used, /datum/hud) && V > LAZYACCESS(M.hud_used.alerts, A)) { LAZYSET(M.hud_used.alerts, A, V); }
diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm
index d094fb0c9074..7af7c97a34e1 100644
--- a/code/_onclick/click.dm
+++ b/code/_onclick/click.dm
@@ -351,8 +351,8 @@ var/global/list/click_catchers
return global.click_catchers
/obj/screen/click_catcher
- icon = 'icons/mob/screen_gen.dmi'
- icon_state = "click_catcher"
+ icon = 'icons/mob/screen/fill.dmi'
+ icon_state = "blank"
plane = CLICKCATCHER_PLANE
mouse_opacity = MOUSE_OPACITY_PRIORITY
screen_loc = "CENTER-7,CENTER-7"
diff --git a/code/_onclick/hud/_defines.dm b/code/_onclick/hud/_defines.dm
index 705994a14009..e308bd0ccdf9 100644
--- a/code/_onclick/hud/_defines.dm
+++ b/code/_onclick/hud/_defines.dm
@@ -74,7 +74,6 @@
#define ui_up_hint "RIGHT-1:28,TOP-1:29"
#define ui_toxin "RIGHT-1:28,TOP-2:27"
#define ui_fire "RIGHT-1:28,TOP-3:25"
-#define ui_oxygen "RIGHT-1:28,TOP-4:23"
#define ui_pressure "RIGHT-1:28,TOP-5:21"
#define ui_alien_toxin "RIGHT-1:28,TOP-2:25"
diff --git a/code/_onclick/hud/_hud.dm b/code/_onclick/hud/_hud.dm
new file mode 100644
index 000000000000..4de22e1df016
--- /dev/null
+++ b/code/_onclick/hud/_hud.dm
@@ -0,0 +1,539 @@
+/*
+ The hud datum
+ Used to show and hide huds for all the different mob types,
+ including inventories and item quick actions.
+*/
+/mob
+ var/datum/hud/hud_used
+
+/mob/proc/InitializeHud()
+ if(ispath(hud_used))
+ hud_used = new hud_used(src)
+ else if(istype(hud_used))
+ hud_used.mymob = src // Probably unnecessary.
+ hud_used.refresh_client_hud()
+ refresh_lighting_master()
+
+/datum/hud
+ var/mob/mymob
+
+ var/hud_shown = 1 //Used for the HUD toggle (F12)
+ var/inventory_shown = TRUE //the inventory
+
+ /// A assoc lazylist of hud elements by category type
+ var/list/hud_elements_by_category
+ /// A assoc lazylist of hud element types to elements that need updating in Life()
+ var/list/updating_hud_elements
+ /// A linear list of types to populate the HUD with
+ var/list/hud_elements = list(
+ /decl/hud_element/health,
+ /decl/hud_element/condition/bodytemp,
+ /decl/hud_element/zone_selector,
+ /decl/hud_element/move_intent,
+ /decl/hud_element/action_intent,
+ /decl/hud_element/condition/pressure,
+ /decl/hud_element/condition/fire,
+ /decl/hud_element/condition/toxins,
+ /decl/hud_element/condition/oxygen,
+ /decl/hud_element/condition/nutrition,
+ /decl/hud_element/condition/hydration,
+ /decl/hud_element/stamina_bar,
+ /decl/hud_element/drop,
+ /decl/hud_element/resist,
+ /decl/hud_element/throwing,
+ /decl/hud_element/up_hint,
+ /decl/hud_element/pain,
+ /decl/hud_element/internals,
+ /decl/hud_element/gun_mode,
+ /decl/hud_element/gun_flag_item,
+ /decl/hud_element/gun_flag_move,
+ /decl/hud_element/gun_flag_radio
+ )
+ var/health_hud_type = /decl/hud_element/health
+ var/list/alerts
+
+ /// Whether or not the hotkey UI has been hidden.
+ var/hotkey_ui_hidden = FALSE
+ /// Linear list of hotkey UI elements.
+ var/list/obj/screen/hotkey_hud_elements = list()
+ var/list/obj/screen/misc_hud_elements = list()
+ var/list/obj/screen/hidable_hud_elements = list()
+
+ var/list/hand_hud_objects
+ var/list/swaphand_hud_objects
+
+ var/obj/screen/action_button/hide_toggle/hide_actions_toggle
+ var/action_buttons_hidden = FALSE
+
+/datum/hud/New(mob/owner)
+ mymob = owner
+ instantiate()
+ ..()
+
+/datum/hud/proc/clear_client_hud()
+ if(!mymob?.client)
+ return
+ mymob.client.screen -= hand_hud_objects
+ mymob.client.screen -= swaphand_hud_objects
+ mymob.client.screen -= misc_hud_elements
+ mymob.client.screen -= hidable_hud_elements
+ mymob.client.screen -= hotkey_hud_elements
+
+/datum/hud/proc/populate_client_hud()
+ if(!mymob?.client)
+ return
+ if(length(hand_hud_objects))
+ mymob.client.screen |= hand_hud_objects
+ if(length(swaphand_hud_objects))
+ mymob.client.screen |= swaphand_hud_objects
+ if(length(misc_hud_elements))
+ mymob.client.screen |= misc_hud_elements
+ if(length(hidable_hud_elements))
+ mymob.client.screen |= hidable_hud_elements
+ if(length(hotkey_hud_elements))
+ mymob.client.screen |= hotkey_hud_elements
+
+/datum/hud/Destroy()
+ . = ..()
+
+ clear_client_hud()
+
+ mymob = null
+ hud_elements = null
+ hud_elements_by_category = null
+ updating_hud_elements = null
+
+ QDEL_NULL_LIST(misc_hud_elements)
+ QDEL_NULL_LIST(hidable_hud_elements)
+ QDEL_NULL_LIST(hotkey_hud_elements)
+ QDEL_NULL_LIST(hand_hud_objects)
+ QDEL_NULL_LIST(swaphand_hud_objects)
+
+/mob/proc/get_hud_element(var/hud_elem_type)
+ if(istype(hud_used))
+ return hud_used.get_element(hud_elem_type)
+
+/datum/hud/proc/get_element(var/hud_elem_type)
+ return LAZYACCESS(hud_elements_by_category, hud_elem_type)
+
+/datum/hud/proc/update_stamina()
+ var/obj/screen/stamina/stamina_bar = get_element(/decl/hud_element/stamina_bar)
+ if(istype(stamina_bar))
+ stamina_bar.invisibility = INVISIBILITY_MAXIMUM
+ var/stamina = mymob.get_stamina()
+ if(stamina < 100)
+ stamina_bar.invisibility = 0
+ stamina_bar.icon_state = "prog_bar_[FLOOR(stamina/5)*5][(stamina >= 5) && (stamina <= 25) ? "_fail" : null]"
+
+/datum/hud/proc/hide_inventory()
+ inventory_shown = FALSE
+ hidden_inventory_update()
+ persistant_inventory_update()
+
+/datum/hud/proc/show_inventory()
+ inventory_shown = TRUE
+ hidden_inventory_update()
+ persistant_inventory_update()
+
+/datum/hud/proc/hidden_inventory_update()
+ var/decl/species/species = mymob?.get_species()
+ if(species?.hud)
+ refresh_inventory_slots(species.hud.hidden_slots, (inventory_shown && hud_shown))
+
+/datum/hud/proc/persistant_inventory_update()
+ var/decl/species/species = mymob?.get_species()
+ if(species?.hud)
+ refresh_inventory_slots(species.hud.persistent_slots, hud_shown)
+
+/datum/hud/proc/refresh_inventory_slots(var/list/checking_slots, var/show_hud)
+
+ for(var/slot in checking_slots)
+
+ var/datum/inventory_slot/inv_slot = mymob.get_inventory_slot_datum(slot)
+ if(!istype(inv_slot))
+ continue
+
+ // Check if we're even wearing anything in that slot.
+ var/obj/item/gear = inv_slot.get_equipped_item()
+ if(!istype(gear))
+ continue
+
+ // We're not showing anything, hide it.
+ if(!show_hud)
+ inv_slot.hide_slot()
+ else
+ inv_slot.show_slot()
+
+/datum/hud/proc/instantiate()
+ if(ismob(mymob) && mymob.client)
+ FinalizeInstantiation()
+ return TRUE
+ return FALSE
+
+/datum/hud/proc/FinalizeInstantiation()
+ SHOULD_CALL_PARENT(TRUE)
+
+ for(var/elem_type in hud_elements)
+ var/decl/hud_element/elem_data = GET_DECL(elem_type)
+ var/obj/screen/elem = elem_data.create_screen_object(src)
+ if(QDELETED(elem))
+ hud_elements -= elem_type
+ continue
+ hud_elements[elem_type] = elem
+ if(elem_data.update_in_life)
+ LAZYSET(updating_hud_elements, elem_type, elem)
+ if(elem_data.hud_element_category)
+ LAZYSET(hud_elements_by_category, elem_data.hud_element_category, elem)
+
+ build_inventory_ui()
+ build_hands_ui()
+ refresh_client_hud()
+
+/datum/hud/proc/update_health_hud()
+ if(!health_hud_type)
+ return
+ var/obj/screen/elem = LAZYACCESS(hud_elements, health_hud_type)
+ if(!elem)
+ return
+ var/decl/hud_element/elem_data = GET_DECL(health_hud_type)
+ elem_data.refresh_screen_object(src, elem)
+
+/datum/hud/proc/refresh_client_hud()
+ if(mymob?.client)
+ mymob.client.screen.Cut()
+
+ populate_client_hud()
+ hide_inventory()
+ refresh_ability_hud()
+
+/datum/hud/proc/get_ui_style()
+ return ui_style2icon(mymob?.client?.prefs?.UI_style) || 'icons/mob/screen/white.dmi'
+
+/datum/hud/proc/get_ui_color()
+ return mymob?.client?.prefs?.UI_style_color || COLOR_WHITE
+
+/datum/hud/proc/get_ui_alpha()
+ return mymob?.client?.prefs?.UI_style_alpha || 255
+
+/datum/hud/proc/rebuild_hands()
+
+ var/ui_style = get_ui_style()
+ var/ui_color = get_ui_color()
+ var/ui_alpha = get_ui_alpha()
+
+ // Build held item boxes for missing slots.
+ var/list/held_slots = mymob.get_held_item_slots()
+ for(var/hand_tag in held_slots)
+ var/obj/screen/inventory/inv_box
+ for(var/obj/screen/inventory/existing_box in hand_hud_objects)
+ if(existing_box.slot_id == hand_tag)
+ inv_box = existing_box
+ break
+ if(!inv_box)
+ inv_box = new /obj/screen/inventory()
+ var/datum/inventory_slot/inv_slot = mymob.get_inventory_slot_datum(hand_tag)
+ inv_box.SetName(hand_tag)
+ inv_box.icon = ui_style
+ inv_box.icon_state = "hand_base"
+
+ inv_box.cut_overlays()
+ inv_box.add_overlay("hand_[hand_tag]")
+ if(inv_slot.ui_label)
+ inv_box.add_overlay("hand_[inv_slot.ui_label]")
+ if(mymob.get_active_held_item_slot() == hand_tag)
+ inv_box.add_overlay("hand_selected")
+ inv_box.compile_overlays()
+
+ inv_box.slot_id = hand_tag
+ inv_box.color = ui_color
+ inv_box.alpha = ui_alpha
+ inv_box.appearance_flags |= KEEP_TOGETHER
+
+ LAZYDISTINCTADD(hand_hud_objects, inv_box)
+
+ // Clear held item boxes with no held slot.
+ for(var/obj/screen/inventory/inv_box in hand_hud_objects)
+ if(!(inv_box.slot_id in held_slots))
+ if(mymob.client)
+ mymob.client.screen -= inv_box
+ LAZYREMOVE(hand_hud_objects, inv_box)
+ qdel(inv_box)
+
+ // Rebuild offsets for the hand elements.
+ var/hand_y_offset = 5
+ var/list/elements = hand_hud_objects?.Copy()
+ while(length(elements))
+ var/copy_index = min(length(elements), 2)+1
+ var/list/sublist = elements.Copy(1, copy_index)
+ elements.Cut(1, copy_index)
+ var/obj/screen/inventory/inv_box
+ if(length(sublist) == 1)
+ inv_box = sublist[1]
+ inv_box.screen_loc = "CENTER,BOTTOM:[hand_y_offset]"
+ else
+ inv_box = sublist[1]
+ inv_box.screen_loc = "CENTER:-[world.icon_size/2],BOTTOM:[hand_y_offset]"
+ inv_box = sublist[2]
+ inv_box.screen_loc = "CENTER:[world.icon_size/2],BOTTOM:[hand_y_offset]"
+ hand_y_offset += world.icon_size
+ if(mymob.client)
+ mymob.client.screen |= inv_box
+
+ // Make sure all held items are on the screen and set to the correct screen loc.
+ var/datum/inventory_slot/inv_slot
+ for(var/obj/inv_elem in hand_hud_objects)
+ inv_slot = mymob.get_inventory_slot_datum(inv_elem.name)
+ if(inv_slot)
+ inv_slot.ui_loc = inv_elem.screen_loc
+ var/obj/item/held = inv_slot.get_equipped_item()
+ if(held)
+ held.screen_loc = inv_slot.ui_loc
+ if(mymob.client)
+ mymob.client.screen |= held // just to make sure it's visible post-login
+
+ var/hand_x_offset = -(world.icon_size/2)
+ for(var/i = 1 to length(swaphand_hud_objects))
+ var/obj/swap_elem = swaphand_hud_objects[i]
+ swap_elem.screen_loc = "CENTER:[hand_x_offset],BOTTOM:[hand_y_offset]"
+ if(i > 1) // first two elems share a slot
+ hand_x_offset += world.icon_size
+ if(mymob.client)
+ mymob.client.screen |= swap_elem
+
+/datum/hud/proc/build_inventory_ui()
+
+ var/ui_style = get_ui_style()
+ var/ui_color = get_ui_color()
+ var/ui_alpha = get_ui_alpha()
+
+ var/has_hidden_gear = FALSE
+
+ // Draw the various inventory equipment slots.
+ var/obj/screen/inventory/inv_box
+ var/list/held_slots = mymob.get_held_item_slots()
+ var/list/inventory_slots = mymob.get_inventory_slots()
+ for(var/gear_slot in inventory_slots)
+
+ if(gear_slot in held_slots)
+ continue
+
+ inv_box = new /obj/screen/inventory()
+ inv_box.icon = ui_style
+ inv_box.color = ui_color
+ inv_box.alpha = ui_alpha
+
+ var/datum/inventory_slot/inv_slot = inventory_slots[gear_slot]
+ inv_box.SetName(inv_slot.slot_name)
+ inv_box.slot_id = inv_slot.slot_id
+ inv_box.icon_state = inv_slot.slot_state
+ inv_box.screen_loc = inv_slot.ui_loc
+
+ if(inv_slot.slot_dir)
+ inv_box.set_dir(inv_slot.slot_dir)
+
+ if(inv_slot.can_be_hidden)
+ hidable_hud_elements += inv_box
+ has_hidden_gear = TRUE
+ else
+ misc_hud_elements += inv_box
+
+ if(has_hidden_gear)
+ var/obj/screen/using = new /obj/screen
+ using.SetName("toggle")
+ using.icon = ui_style
+ using.icon_state = "other"
+ using.screen_loc = ui_inventory
+ using.color = ui_color
+ using.alpha = ui_alpha
+ misc_hud_elements += using
+
+/datum/hud/proc/build_hands_ui()
+
+ var/ui_style = get_ui_style()
+ var/ui_color = get_ui_color()
+ var/ui_alpha = get_ui_alpha()
+
+ var/obj/screen/using
+
+ // Swap hand and quick equip screen elems.
+ using = new /obj/screen
+ using.SetName("equip")
+ using.icon = ui_style
+ using.icon_state = "act_equip"
+ using.color = ui_color
+ using.alpha = ui_alpha
+ misc_hud_elements += using
+ LAZYADD(swaphand_hud_objects, using)
+
+ var/list/held_slots = mymob.get_held_item_slots()
+ if(length(held_slots) > 1)
+
+ using = new /obj/screen/inventory()
+ using.SetName("hand")
+ using.icon = ui_style
+ using.icon_state = "hand1"
+ using.color = ui_color
+ using.alpha = ui_alpha
+ misc_hud_elements += using
+ LAZYADD(swaphand_hud_objects, using)
+
+ using = new /obj/screen/inventory()
+ using.SetName("hand")
+ using.icon = ui_style
+ using.icon_state = "hand2"
+ using.color = ui_color
+ using.alpha = ui_alpha
+ misc_hud_elements += using
+ LAZYADD(swaphand_hud_objects, using)
+
+ // Actual hand elems.
+ rebuild_hands()
+
+/mob/verb/minimize_hud_verb()
+ set name = "Minimize Hud"
+ set hidden = TRUE
+ set category = "OOC"
+ minimize_hud()
+
+/mob/proc/minimize_hud(var/zoom = FALSE)
+
+ if(!istype(hud_used))
+ return
+
+ if(!client || client.view != world.view || !hud_used)
+ return
+
+ var/obj/screen/action_intent = get_hud_element(/decl/hud_element/action_intent)
+ if(hud_used.hud_shown)
+ client.screen -= hud_used.misc_hud_elements
+ client.screen -= hud_used.hidable_hud_elements
+ client.screen -= hud_used.hotkey_hud_elements
+ if(action_intent)
+ action_intent.screen_loc = ui_acti_alt // move this to the alternative position, where zone_select usually is.
+ else
+ if(length(hud_used.misc_hud_elements))
+ client.screen |= hud_used.misc_hud_elements
+ if(hud_used.inventory_shown && length(hud_used.hidable_hud_elements))
+ client.screen |= hud_used.hidable_hud_elements
+ if(!hud_used.hotkey_ui_hidden && length(hud_used.hotkey_hud_elements))
+ client.screen |= hud_used.hotkey_hud_elements
+ if(action_intent)
+ action_intent.screen_loc = ui_acti //Restore intent selection to the original position
+
+ // We always want to show our hands.
+ if(LAZYLEN(hud_used.hand_hud_objects))
+ client.screen |= hud_used.hand_hud_objects
+ if(LAZYLEN(hud_used.swaphand_hud_objects))
+ client.screen |= hud_used.swaphand_hud_objects
+
+ hud_used.hud_shown = !hud_used.hud_shown
+ hud_used.hidden_inventory_update()
+ hud_used.persistant_inventory_update()
+ update_action_buttons()
+
+/client/proc/reset_click_catchers()
+
+ var/xmin = -(round(last_view_x_dim*0.5))
+ var/xmax = last_view_x_dim - abs(xmin)
+ var/ymin = -(round(last_view_y_dim*0.5))
+ var/ymax = last_view_y_dim - abs(ymin)
+
+ var/list/click_catchers = get_click_catchers()
+ for(var/obj/screen/click_catcher/catcher in click_catchers)
+ if(catcher.x_offset <= xmin || catcher.x_offset >= xmax || catcher.y_offset <= ymin || catcher.y_offset >= ymax)
+ screen -= catcher
+ else
+ screen |= catcher
+
+/mob/proc/reset_click_catchers()
+ client.reset_click_catchers()
+
+/mob/new_player/reset_click_catchers()
+ return
+
+/datum/hud/proc/update_icons()
+ if(!length(updating_hud_elements) || QDELETED(mymob))
+ return
+
+ var/obj/screen/ability_master/ability_master = get_element(/decl/hud_element/ability_master)
+ if(ability_master)
+ ability_master.update_spells(0)
+
+ var/datum/gas_mixture/environment = mymob.loc?.return_air()
+ for(var/elem_type in updating_hud_elements)
+ var/decl/hud_element/hud_elem_data = GET_DECL(elem_type)
+ hud_elem_data.refresh_screen_object(src, hud_elements[elem_type], environment)
+
+/datum/hud/proc/hide_ability_hud()
+ var/ui_alpha = get_ui_alpha()
+ for(var/elem_type in hud_elements)
+ var/decl/hud_element/hud_elem = GET_DECL(elem_type)
+ if(hud_elem.hidable)
+ var/obj/thing = hud_elements[elem_type]
+ if(istype(thing))
+ thing.alpha = hud_elem.apply_hud_alpha ? ui_alpha : initial(thing.alpha)
+ thing.invisibility = initial(thing.invisibility)
+
+/datum/hud/proc/show_ability_hud()
+ for(var/elem_type in hud_elements)
+ var/decl/hud_element/hud_elem = GET_DECL(elem_type)
+ if(hud_elem.hidable)
+ var/obj/thing = hud_elements[elem_type]
+ if(istype(thing))
+ thing.alpha = 0
+ thing.invisibility = INVISIBILITY_MAXIMUM
+
+/datum/hud/proc/should_show_ability_hud()
+ return TRUE
+
+/datum/hud/proc/refresh_ability_hud()
+
+ var/obj/screen/ability_master/ability_master = get_element(/decl/hud_element/ability_master)
+ if(ability_master)
+ ability_master.update_abilities(TRUE, mymob)
+ ability_master.toggle_open(1)
+ ability_master.synch_spells_to_mind(mymob?.mind)
+
+ if(should_show_ability_hud())
+ show_ability_hud()
+ else
+ hide_ability_hud()
+
+/datum/hud/proc/reset_hud_callback()
+ if(mymob.is_on_special_ability_cooldown())
+ return
+ var/ui_color = get_ui_color()
+ for(var/elem_type in hud_elements)
+ var/decl/hud_element/hud_elem = GET_DECL(elem_type)
+ if(hud_elem.apply_color_on_cooldown)
+ var/obj/thing = hud_elements[elem_type]
+ if(istype(thing))
+ thing.color = hud_elem.apply_hud_color ? ui_color : initial(thing.color)
+
+/datum/hud/proc/set_hud_cooldown(var/time, var/cooldown_color)
+ var/colored_a_thing = FALSE
+ for(var/elem_type in hud_elements)
+ var/decl/hud_element/hud_elem = GET_DECL(elem_type)
+ if(hud_elem.apply_color_on_cooldown)
+ var/obj/thing = hud_elements[elem_type]
+ if(istype(thing))
+ colored_a_thing = TRUE
+ thing.color = cooldown_color
+ if(colored_a_thing)
+ addtimer(CALLBACK(src, /datum/hud/proc/reset_hud_callback), time+1)
+
+/datum/hud/proc/refresh_stat_panel()
+ var/obj/screen/ability_master/ability_master = mymob.get_hud_element(/decl/hud_element/ability_master)
+ if(!ability_master?.spell_objects)
+ return
+ for(var/obj/screen/ability/spell/screen in ability_master.spell_objects)
+ var/spell/S = screen.spell
+ if((!S.connected_button) || !statpanel(S.panel))
+ continue //Not showing the noclothes spell
+ switch(S.charge_type)
+ if(Sp_RECHARGE)
+ statpanel(S.panel,"[S.charge_counter/10.0]/[S.charge_max/10]",S.connected_button)
+ if(Sp_CHARGES)
+ statpanel(S.panel,"[S.charge_counter]/[S.charge_max]",S.connected_button)
+ if(Sp_HOLDVAR)
+ statpanel(S.panel,"[S.holder_var_type] [S.holder_var_amount]",S.connected_button)
diff --git a/code/_onclick/hud/ability_screen_objects.dm b/code/_onclick/hud/ability_screen_objects.dm
index 8dcbdfa1ffba..420cc2f9098c 100644
--- a/code/_onclick/hud/ability_screen_objects.dm
+++ b/code/_onclick/hud/ability_screen_objects.dm
@@ -1,6 +1,6 @@
/obj/screen/ability_master
name = "Abilities"
- icon = 'icons/mob/screen_spells.dmi'
+ icon = 'icons/mob/screen/spells.dmi'
icon_state = "grey_spell_ready"
var/list/obj/screen/ability/ability_objects = list()
var/list/obj/screen/ability/spell_objects = list()
@@ -27,11 +27,6 @@
. = ..()
remove_all_abilities() //Get rid of the ability objects.
ability_objects.Cut()
- if(my_mob) // After that, remove ourselves from the mob seeing us, so we can qdel cleanly.
- my_mob.ability_master = null
- if(my_mob.client && my_mob.client.screen)
- my_mob.client.screen -= src
- my_mob = null
/obj/screen/ability_master/handle_mouse_drop(var/atom/over, var/mob/user)
if(showing)
@@ -41,7 +36,6 @@
/obj/screen/ability_master/Click()
if(!ability_objects.len) // If we're empty for some reason.
return
-
toggle_open()
/obj/screen/ability_master/proc/toggle_open(var/forced_state = 0)
@@ -149,15 +143,11 @@
var/spell/S = screen.spell
M.learned_spells |= S
-/mob/Initialize()
- . = ..()
- ability_master = new /obj/screen/ability_master(null,src)
-
///////////ACTUAL ABILITIES////////////
//This is what you click to do things//
///////////////////////////////////////
/obj/screen/ability
- icon = 'icons/mob/screen_spells.dmi'
+ icon = 'icons/mob/screen/spells.dmi'
icon_state = "grey_spell_base"
maptext_x = 3
var/background_base_state = "grey"
@@ -204,11 +194,13 @@
if(isnull(slot) || !isnum(slot))
to_chat(src,".activate_ability requires a number as input, corrisponding to the slot you wish to use.")
return // Bad input.
- if(!mob.ability_master)
+
+ var/obj/screen/ability_master/ability_master = mob.get_hud_element(/decl/hud_element/ability_master)
+ if(!ability_master)
return // No abilities.
- if(slot > mob.ability_master.ability_objects.len || slot <= 0)
+ if(slot > ability_master.ability_objects.len || slot <= 0)
return // Out of bounds.
- var/obj/screen/ability/A = mob.ability_master.ability_objects[slot]
+ var/obj/screen/ability/A = ability_master.ability_objects[slot]
A.activate()
//////////Verb Abilities//////////
diff --git a/code/_onclick/hud/ai.dm b/code/_onclick/hud/ai.dm
index 6084471660bf..eefa3565072f 100644
--- a/code/_onclick/hud/ai.dm
+++ b/code/_onclick/hud/ai.dm
@@ -1,12 +1,11 @@
/mob/living/silicon/ai
- hud_type = /datum/hud/ai
+ hud_used = /datum/hud/ai
/datum/hud/ai/FinalizeInstantiation()
- adding = list()
var/list/ai_hud_data = decls_repository.get_decls_of_subtype(/decl/ai_hud)
for(var/elem_type in ai_hud_data)
var/decl/ai_hud/ai_hud = ai_hud_data[elem_type]
- adding += new /obj/screen/ai_button(null,
+ misc_hud_elements += new /obj/screen/ai_button(null,
ai_hud.screen_loc,
ai_hud.name,
ai_hud.icon_state,
@@ -14,5 +13,4 @@
ai_hud.input_procs,
ai_hud.input_args
)
- if(mymob?.client)
- mymob.client.screen = list(adding)
+ return ..()
diff --git a/code/_onclick/hud/ai_screen_objects.dm b/code/_onclick/hud/ai_screen_objects.dm
index cbbff7d5d962..77945ee7e4ac 100644
--- a/code/_onclick/hud/ai_screen_objects.dm
+++ b/code/_onclick/hud/ai_screen_objects.dm
@@ -2,7 +2,7 @@
var/mob/living/silicon/ai/ai_verb
var/list/input_procs
var/list/input_args
- icon = 'icons/mob/screen_ai.dmi'
+ icon = 'icons/mob/screen/ai.dmi'
var/list/template_icon = list(null, "template")
var/image/template_undelay
diff --git a/code/_onclick/hud/animal.dm b/code/_onclick/hud/animal.dm
deleted file mode 100644
index 129d39f259a6..000000000000
--- a/code/_onclick/hud/animal.dm
+++ /dev/null
@@ -1,8 +0,0 @@
-
-/mob/living/simple_animal
- hud_type = /datum/hud/animal
-
-/datum/hud/animal/FinalizeInstantiation()
- mymob.client.screen = list()
- action_intent = new /obj/screen/intent()
- mymob.client.screen |= action_intent
\ No newline at end of file
diff --git a/code/_onclick/hud/constructs.dm b/code/_onclick/hud/constructs.dm
new file mode 100644
index 000000000000..30a8ac6f9759
--- /dev/null
+++ b/code/_onclick/hud/constructs.dm
@@ -0,0 +1,72 @@
+/mob/living/simple_animal/construct
+ hud_used = /datum/hud/construct/wraith
+
+/mob/living/simple_animal/construct/armoured
+ hud_used = /datum/hud/construct/juggernaut
+
+/mob/living/simple_animal/construct/behemoth
+ hud_used = /datum/hud/construct/juggernaut
+
+/mob/living/simple_animal/construct/builder
+ hud_used = /datum/hud/construct/artificer
+
+/mob/living/simple_animal/construct/harvester
+ hud_used = /datum/hud/construct/harvester
+
+/decl/hud_element/condition/fire/construct
+ screen_loc = ui_construct_fire
+
+/decl/hud_element/health/construct
+ screen_loc = ui_construct_health
+ abstract_type = /decl/hud_element/health/construct
+
+/decl/hud_element/health/construct/artificer
+ screen_icon = 'icons/mob/screen/health_construct_artificer.dmi'
+
+/decl/hud_element/health/construct/wraith
+ screen_icon = 'icons/mob/screen/health_construct_wraith.dmi'
+
+/decl/hud_element/health/construct/juggernaut
+ screen_icon = 'icons/mob/screen/health_construct_juggernaut.dmi'
+
+/decl/hud_element/health/construct/harvester
+ screen_icon = 'icons/mob/screen/health_construct_harvester.dmi'
+
+/datum/hud/construct/get_ui_style()
+ return 'icons/mob/screen/construct.dmi'
+
+/datum/hud/construct/artificer
+ health_hud_type = /decl/hud_element/health/construct/artificer
+ hud_elements = list(
+ /decl/hud_element/health/construct/artificer,
+ /decl/hud_element/zone_selector,
+ /decl/hud_element/action_intent,
+ /decl/hud_element/condition/fire/construct
+ )
+
+/datum/hud/construct/wraith
+ health_hud_type = /decl/hud_element/health/construct/wraith
+ hud_elements = list(
+ /decl/hud_element/health/construct/wraith,
+ /decl/hud_element/zone_selector,
+ /decl/hud_element/action_intent,
+ /decl/hud_element/condition/fire/construct
+ )
+
+/datum/hud/construct/juggernaut
+ health_hud_type = /decl/hud_element/health/construct/juggernaut
+ hud_elements = list(
+ /decl/hud_element/health/construct/juggernaut,
+ /decl/hud_element/zone_selector,
+ /decl/hud_element/action_intent,
+ /decl/hud_element/condition/fire/construct
+ )
+
+/datum/hud/construct/harvester
+ health_hud_type = /decl/hud_element/health/construct/harvester
+ hud_elements = list(
+ /decl/hud_element/health/construct/harvester,
+ /decl/hud_element/zone_selector,
+ /decl/hud_element/action_intent,
+ /decl/hud_element/condition/fire/construct
+ )
diff --git a/code/_onclick/hud/deity.dm b/code/_onclick/hud/deity.dm
index 46b1eb8b1b5c..4ca7e3883367 100644
--- a/code/_onclick/hud/deity.dm
+++ b/code/_onclick/hud/deity.dm
@@ -1,19 +1,19 @@
/mob/living/deity
- hud_type = /datum/hud/deity
+ hud_used = /datum/hud/deity
-/datum/hud/deity/FinalizeInstantiation()
- src.adding = list()
- src.other = list()
+/datum/hud/deity
+ hud_elements = list(
+ /decl/hud_element/action_intent/deity
+ )
- var/obj/screen/intent/deity/D = new()
-
- src.adding += D
- action_intent = D
-
- mymob.client.screen = list()
- mymob.client.screen += src.adding
- D.sync_to_mob(mymob)
+/decl/hud_element/action_intent/deity
+ screen_object_type = /obj/screen/intent/deity
+/decl/hud_element/action_intent/deity/register_screen_object(obj/screen/elem, datum/hud/hud)
+ var/obj/screen/intent/deity/deity_elem = elem
+ if(istype(deity_elem))
+ deity_elem.sync_to_mob(hud.mymob)
+ return ..()
/obj/screen/intent/deity
var/list/desc_screens = list()
@@ -21,7 +21,7 @@
/obj/screen/intent/deity/Initialize()
. = ..()
- overlays += image('icons/mob/screen_phenomena.dmi', icon_state = "hud", pixel_x = -138, pixel_y = -1)
+ overlays += image('icons/mob/screen/phenomena.dmi', icon_state = "hud", pixel_x = -138, pixel_y = -1)
/obj/screen/intent/deity/proc/sync_to_mob(var/mob)
var/mob/living/deity/D = mob
diff --git a/code/_onclick/hud/fullscreen.dm b/code/_onclick/hud/fullscreen.dm
index 3d8a4134b92d..20c1d9ce64e6 100644
--- a/code/_onclick/hud/fullscreen.dm
+++ b/code/_onclick/hud/fullscreen.dm
@@ -1,12 +1,12 @@
/mob
- var/list/screens = list()
+ var/list/_screens
/mob/proc/set_fullscreen(condition, screen_name, screen_type, arg)
condition ? overlay_fullscreen(screen_name, screen_type, arg) : clear_fullscreen(screen_name)
/mob/proc/overlay_fullscreen(category, type, severity)
- var/obj/screen/fullscreen/screen = screens[category]
+ var/obj/screen/fullscreen/screen = LAZYACCESS(_screens, category)
if(screen)
if(screen.type != type)
@@ -21,7 +21,7 @@
screen.icon_state = "[initial(screen.icon_state)][severity]"
screen.severity = severity
- screens[category] = screen
+ LAZYSET(_screens, category, screen)
screen.transform = null
if(screen && client && (stat != DEAD || screen.allstate))
client.screen += screen
@@ -36,11 +36,11 @@
qdel(screen)
/mob/proc/clear_fullscreen(category, animated = 10)
- var/obj/screen/fullscreen/screen = screens[category]
+ var/obj/screen/fullscreen/screen = LAZYACCESS(_screens, category)
if(!screen)
return
- screens -= category
+ LAZYREMOVE(_screens, category)
if(animated)
show_screen(screen, animated)
@@ -50,19 +50,19 @@
qdel(screen)
/mob/proc/clear_fullscreens()
- for(var/category in screens)
+ for(var/category in _screens)
clear_fullscreen(category)
/mob/proc/hide_fullscreens()
if(client)
- for(var/category in screens)
- client.screen -= screens[category]
+ for(var/category in _screens)
+ client.screen -= _screens[category]
/mob/proc/reload_fullscreen()
if(client)
var/largest_bound = max(client.last_view_x_dim, client.last_view_y_dim)
- for(var/category in screens)
- var/obj/screen/fullscreen/screen = screens[category]
+ for(var/category in _screens)
+ var/obj/screen/fullscreen/screen = _screens[category]
screen.transform = null
if(screen.screen_loc != ui_entire_screen && largest_bound > 7)
var/matrix/M = matrix()
@@ -71,7 +71,7 @@
client.screen |= screen
/obj/screen/fullscreen
- icon = 'icons/mob/screen_full.dmi'
+ icon = 'icons/mob/screen/full.dmi'
icon_state = "default"
screen_loc = ui_center_fullscreen
plane = FULLSCREEN_PLANE
@@ -101,7 +101,7 @@
layer = BLIND_LAYER
/obj/screen/fullscreen/blackout
- icon = 'icons/mob/screen1.dmi'
+ icon = 'icons/mob/screen/fill.dmi'
icon_state = "black"
screen_loc = ui_entire_screen
layer = BLIND_LAYER
@@ -111,13 +111,13 @@
layer = IMPAIRED_LAYER
/obj/screen/fullscreen/blurry
- icon = 'icons/mob/screen1.dmi'
+ icon = 'icons/mob/screen/fill.dmi'
screen_loc = ui_entire_screen
icon_state = "blurry"
alpha = 100
/obj/screen/fullscreen/flash
- icon = 'icons/mob/screen1.dmi'
+ icon = 'icons/mob/screen/fill.dmi'
screen_loc = ui_entire_screen
icon_state = "flash"
@@ -125,7 +125,7 @@
icon_state = "noise"
/obj/screen/fullscreen/high
- icon = 'icons/mob/screen1.dmi'
+ icon = 'icons/mob/screen/fill.dmi'
screen_loc = ui_entire_screen
icon_state = "druggy"
alpha = 127
@@ -138,7 +138,7 @@
alpha = 127
/obj/screen/fullscreen/fadeout
- icon = 'icons/mob/screen1.dmi'
+ icon = 'icons/mob/screen/fill.dmi'
icon_state = "black"
screen_loc = ui_entire_screen
alpha = 0
diff --git a/code/_onclick/hud/gun_mode.dm b/code/_onclick/hud/gun_mode.dm
deleted file mode 100644
index ab5cecbff9c2..000000000000
--- a/code/_onclick/hud/gun_mode.dm
+++ /dev/null
@@ -1,66 +0,0 @@
-/obj/screen/gun
- name = "gun"
- icon = 'icons/mob/screen1.dmi'
- master = null
- dir = SOUTH
-
-/obj/screen/gun/Click(location, control, params)
- if(!usr)
- return
- return 1
-
-/obj/screen/gun/move
- name = "Allow Movement"
- icon_state = "no_walk1"
- screen_loc = ui_gun2
-
-/obj/screen/gun/move/Click(location, control, params)
- if(..())
- var/mob/living/user = usr
- if(istype(user))
- if(!user.aiming) user.aiming = new(user)
- user.aiming.toggle_permission(TARGET_CAN_MOVE)
- return 1
- return 0
-
-/obj/screen/gun/item
- name = "Allow Item Use"
- icon_state = "no_item1"
- screen_loc = ui_gun1
-
-/obj/screen/gun/item/Click(location, control, params)
- if(..())
- var/mob/living/user = usr
- if(istype(user))
- if(!user.aiming) user.aiming = new(user)
- user.aiming.toggle_permission(TARGET_CAN_CLICK)
- return 1
- return 0
-
-/obj/screen/gun/mode
- name = "Toggle Gun Mode"
- icon_state = "gun0"
- screen_loc = ui_gun_select
-
-/obj/screen/gun/mode/Click(location, control, params)
- if(..())
- var/mob/living/user = usr
- if(istype(user))
- if(!user.aiming) user.aiming = new(user)
- user.aiming.toggle_active()
- return 1
- return 0
-
-/obj/screen/gun/radio
- name = "Disallow Radio Use"
- icon_state = "no_radio1"
- screen_loc = ui_gun4
-
-/obj/screen/gun/radio/Click(location, control, params)
- if(..())
- var/mob/living/user = usr
- if(istype(user))
- if(!user.aiming) user.aiming = new(user)
- user.aiming.toggle_permission(TARGET_CAN_RADIO)
- return 1
- return 0
diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm
deleted file mode 100644
index d9e9493c513a..000000000000
--- a/code/_onclick/hud/hud.dm
+++ /dev/null
@@ -1,436 +0,0 @@
-/*
- The hud datum
- Used to show and hide huds for all the different mob types,
- including inventories and item quick actions.
-*/
-
-/mob
- var/hud_type = null
- var/datum/hud/hud_used = null
-
-/mob/proc/InitializeHud()
- if(hud_used)
- qdel(hud_used)
- if(hud_type)
- hud_used = new hud_type(src)
- else
- hud_used = new /datum/hud(src)
- refresh_lighting_master()
-
-/datum/hud
- var/mob/mymob
-
- var/hud_shown = 1 //Used for the HUD toggle (F12)
- var/inventory_shown = TRUE //the inventory
- var/show_intent_icons = FALSE
- var/hotkey_ui_hidden = FALSE //This is to hide the buttons that can be used via hotkeys. (hotkeybuttons list of buttons)
-
- var/obj/screen/lingchemdisplay
- var/list/hand_hud_objects
- var/list/swaphand_hud_objects
- var/obj/screen/action_intent
- var/obj/screen/move_intent
- var/obj/screen/stamina/stamina_bar
-
- var/list/adding
- var/list/other
- var/list/obj/screen/hotkeybuttons
-
- var/obj/screen/action_button/hide_toggle/hide_actions_toggle
- var/action_buttons_hidden = FALSE
-
-/datum/hud/New(mob/owner)
- mymob = owner
- instantiate()
- ..()
-
-/datum/hud/Destroy()
- . = ..()
- stamina_bar = null
- lingchemdisplay = null
- action_intent = null
- move_intent = null
- adding = null
- other = null
- hotkeybuttons = null
- mymob = null
- QDEL_NULL_LIST(hand_hud_objects)
- QDEL_NULL_LIST(swaphand_hud_objects)
-
-/datum/hud/proc/update_stamina()
- if(mymob && stamina_bar)
- stamina_bar.invisibility = INVISIBILITY_MAXIMUM
- var/stamina = mymob.get_stamina()
- if(stamina < 100)
- stamina_bar.invisibility = 0
- stamina_bar.icon_state = "prog_bar_[FLOOR(stamina/5)*5][(stamina >= 5) && (stamina <= 25) ? "_fail" : null]"
-
-/datum/hud/proc/hide_inventory()
- inventory_shown = FALSE
- hidden_inventory_update()
- persistant_inventory_update()
-
-/datum/hud/proc/show_inventory()
- inventory_shown = TRUE
- hidden_inventory_update()
- persistant_inventory_update()
-
-/datum/hud/proc/hidden_inventory_update()
- var/decl/species/species = mymob?.get_species()
- if(species?.hud)
- refresh_inventory_slots(species.hud.hidden_slots, (inventory_shown && hud_shown))
-
-/datum/hud/proc/persistant_inventory_update()
- var/decl/species/species = mymob?.get_species()
- if(species?.hud)
- refresh_inventory_slots(species.hud.persistent_slots, hud_shown)
-
-/datum/hud/proc/refresh_inventory_slots(var/list/checking_slots, var/show_hud)
-
- for(var/slot in checking_slots)
-
- var/datum/inventory_slot/inv_slot = mymob.get_inventory_slot_datum(slot)
- if(!istype(inv_slot))
- continue
-
- // Check if we're even wearing anything in that slot.
- var/obj/item/gear = inv_slot.get_equipped_item()
- if(!istype(gear))
- continue
-
- // We're not showing anything, hide it.
- if(!show_hud)
- inv_slot.hide_slot()
- else
- inv_slot.show_slot()
-
-/datum/hud/proc/instantiate()
- if(ismob(mymob) && mymob.client)
- FinalizeInstantiation()
- return TRUE
- return FALSE
-
-/datum/hud/proc/FinalizeInstantiation()
- return
-
-/datum/hud/proc/get_ui_style()
- return ui_style2icon(mymob?.client?.prefs?.UI_style) || 'icons/mob/screen/white.dmi'
-
-/datum/hud/proc/get_ui_color()
- return mymob?.client?.prefs?.UI_style_color || COLOR_WHITE
-
-/datum/hud/proc/get_ui_alpha()
- return mymob?.client?.prefs?.UI_style_alpha || 255
-
-/datum/hud/proc/rebuild_hands()
-
- var/ui_style = get_ui_style()
- var/ui_color = get_ui_color()
- var/ui_alpha = get_ui_alpha()
-
- // Build held item boxes for missing slots.
- var/list/held_slots = mymob.get_held_item_slots()
-
- // Sort our slots for display.
- var/list/gripper_datums = list()
- for(var/hand_tag in held_slots)
- gripper_datums += mymob.get_inventory_slot_datum(hand_tag)
- gripper_datums = sortTim(gripper_datums, /proc/cmp_gripper_asc)
-
- for(var/datum/inventory_slot/inv_slot in gripper_datums)
-
- // Re-order the held slot list so it aligns with the display order.
- var/hand_tag = inv_slot.slot_id
- held_slots -= hand_tag
- held_slots += hand_tag
-
- var/obj/screen/inventory/inv_box
- for(var/obj/screen/inventory/existing_box in hand_hud_objects)
- if(existing_box.slot_id == hand_tag)
- inv_box = existing_box
- break
- if(!inv_box)
- inv_box = new /obj/screen/inventory()
- inv_box.SetName(hand_tag)
- inv_box.icon = ui_style
- inv_box.icon_state = "hand_base"
-
- inv_box.cut_overlays()
- inv_box.add_overlay("hand_[hand_tag]")
- if(inv_slot.ui_label)
- inv_box.add_overlay("hand_[inv_slot.ui_label]")
- if(mymob.get_active_held_item_slot() == hand_tag)
- inv_box.add_overlay("hand_selected")
- inv_box.compile_overlays()
-
- inv_box.slot_id = hand_tag
- inv_box.color = ui_color
- inv_box.alpha = ui_alpha
- inv_box.appearance_flags |= KEEP_TOGETHER
-
- LAZYDISTINCTADD(hand_hud_objects, inv_box)
-
- // Clear held item boxes with no held slot.
- for(var/obj/screen/inventory/inv_box in hand_hud_objects)
- if(!(inv_box.slot_id in held_slots))
- if(mymob.client)
- mymob.client.screen -= inv_box
- LAZYREMOVE(hand_hud_objects, inv_box)
- qdel(inv_box)
-
- // Rebuild offsets for the hand elements.
- var/hand_y_offset = 5
- var/list/elements = hand_hud_objects?.Copy()
- while(length(elements))
- var/copy_index = min(length(elements), 2)+1
- var/list/sublist = elements.Copy(1, copy_index)
- elements.Cut(1, copy_index)
- var/obj/screen/inventory/inv_box
- if(length(sublist) == 1)
- inv_box = sublist[1]
- inv_box.screen_loc = "CENTER,BOTTOM:[hand_y_offset]"
- else
- inv_box = sublist[1]
- inv_box.screen_loc = "CENTER:-[world.icon_size/2],BOTTOM:[hand_y_offset]"
- inv_box = sublist[2]
- inv_box.screen_loc = "CENTER:[world.icon_size/2],BOTTOM:[hand_y_offset]"
- hand_y_offset += world.icon_size
- if(mymob.client)
- mymob.client.screen |= inv_box
-
- // Make sure all held items are on the screen and set to the correct screen loc.
- var/datum/inventory_slot/inv_slot
- for(var/obj/inv_elem in hand_hud_objects)
- inv_slot = mymob.get_inventory_slot_datum(inv_elem.name)
- if(inv_slot)
- inv_slot.ui_loc = inv_elem.screen_loc
- var/obj/item/held = inv_slot.get_equipped_item()
- if(held)
- held.screen_loc = inv_slot.ui_loc
- if(mymob.client)
- mymob.client.screen |= held // just to make sure it's visible post-login
-
- var/hand_x_offset = -(world.icon_size/2)
- for(var/i = 1 to length(swaphand_hud_objects))
- var/obj/swap_elem = swaphand_hud_objects[i]
- swap_elem.screen_loc = "CENTER:[hand_x_offset],BOTTOM:[hand_y_offset]"
- if(i > 1) // first two elems share a slot
- hand_x_offset += world.icon_size
- if(mymob.client)
- mymob.client.screen |= swap_elem
-
-/datum/hud/proc/BuildInventoryUI()
-
- var/ui_style = get_ui_style()
- var/ui_color = get_ui_color()
- var/ui_alpha = get_ui_alpha()
-
- var/has_hidden_gear = FALSE
-
- // Draw the various inventory equipment slots.
- var/obj/screen/inventory/inv_box
- var/list/held_slots = mymob.get_held_item_slots()
- var/list/inventory_slots = mymob.get_inventory_slots()
- for(var/gear_slot in inventory_slots)
-
- if(gear_slot in held_slots)
- continue
-
- inv_box = new /obj/screen/inventory()
- inv_box.icon = ui_style
- inv_box.color = ui_color
- inv_box.alpha = ui_alpha
-
- var/datum/inventory_slot/inv_slot = inventory_slots[gear_slot]
- inv_box.SetName(inv_slot.slot_name)
- inv_box.slot_id = inv_slot.slot_id
- inv_box.icon_state = inv_slot.slot_state
- inv_box.screen_loc = inv_slot.ui_loc
-
- if(inv_slot.slot_dir)
- inv_box.set_dir(inv_slot.slot_dir)
-
- if(inv_slot.can_be_hidden)
- other += inv_box
- has_hidden_gear = TRUE
- else
- adding += inv_box
-
- if(has_hidden_gear)
- var/obj/screen/using = new /obj/screen()
- using.SetName("toggle")
- using.icon = ui_style
- using.icon_state = "other"
- using.screen_loc = ui_inventory
- using.color = ui_color
- using.alpha = ui_alpha
- adding += using
-
-/datum/hud/proc/BuildHandsUI()
-
- var/ui_style = get_ui_style()
- var/ui_color = get_ui_color()
- var/ui_alpha = get_ui_alpha()
-
- var/obj/screen/using
-
- // Swap hand and quick equip screen elems.
- using = new /obj/screen()
- using.SetName("equip")
- using.icon = ui_style
- using.icon_state = "act_equip"
- using.color = ui_color
- using.alpha = ui_alpha
- src.adding += using
- LAZYADD(swaphand_hud_objects, using)
-
- var/list/held_slots = mymob.get_held_item_slots()
- if(length(held_slots) > 1)
-
- using = new /obj/screen/inventory()
- using.SetName("hand")
- using.icon = ui_style
- using.icon_state = "hand1"
- using.color = ui_color
- using.alpha = ui_alpha
- src.adding += using
- LAZYADD(swaphand_hud_objects, using)
-
- using = new /obj/screen/inventory()
- using.SetName("hand")
- using.icon = ui_style
- using.icon_state = "hand2"
- using.color = ui_color
- using.alpha = ui_alpha
- src.adding += using
- LAZYADD(swaphand_hud_objects, using)
-
- // Actual hand elems.
- rebuild_hands()
-
-/mob/verb/minimize_hud(full = FALSE as null)
- set name = "Minimize Hud"
- set hidden = TRUE
-
- if(!hud_used)
- to_chat(usr, "This mob type does not use a HUD.")
- return
-
- if(!ishuman(src))
- to_chat(usr, "Inventory hiding is currently only supported for human mobs, sorry.")
- return
-
- if(!client) return
- if(client.view != world.view)
- return
- if(hud_used.hud_shown)
- hud_used.hud_shown = 0
- if(src.hud_used.adding)
- src.client.screen -= src.hud_used.adding
- if(src.hud_used.other)
- src.client.screen -= src.hud_used.other
- if(src.hud_used.hotkeybuttons)
- src.client.screen -= src.hud_used.hotkeybuttons
-
- //Due to some poor coding some things need special treatment:
- //These ones are a part of 'adding', 'other' or 'hotkeybuttons' but we want them to stay
- if(!full)
- if(LAZYLEN(hud_used.hand_hud_objects))
- client.screen += hud_used.hand_hud_objects // we want the hands to be visible
- if(LAZYLEN(hud_used.swaphand_hud_objects))
- client.screen += hud_used.swaphand_hud_objects // we want the hands swap thingy to be visible
- src.client.screen += src.hud_used.action_intent // we want the intent swticher visible
- src.hud_used.action_intent.screen_loc = ui_acti_alt // move this to the alternative position, where zone_select usually is.
- else
- src.client.screen -= src.healths
- src.client.screen -= src.internals
- src.client.screen -= src.gun_setting_icon
-
- //These ones are not a part of 'adding', 'other' or 'hotkeybuttons' but we want them gone.
- src.client.screen -= src.zone_sel //zone_sel is a mob variable for some reason.
-
- else
- hud_used.hud_shown = 1
- if(src.hud_used.adding)
- src.client.screen += src.hud_used.adding
- if(src.hud_used.other && src.hud_used.inventory_shown)
- src.client.screen += src.hud_used.other
- if(src.hud_used.hotkeybuttons && !src.hud_used.hotkey_ui_hidden)
- src.client.screen += src.hud_used.hotkeybuttons
- if(src.healths)
- src.client.screen |= src.healths
- if(src.internals)
- src.client.screen |= src.internals
- if(src.gun_setting_icon)
- src.client.screen |= src.gun_setting_icon
-
- src.hud_used.action_intent.screen_loc = ui_acti //Restore intent selection to the original position
- src.client.screen += src.zone_sel //This one is a special snowflake
-
- hud_used.hidden_inventory_update()
- hud_used.persistant_inventory_update()
- update_action_buttons()
-
-//Similar to minimize_hud() but keeps zone_sel, gun_setting_icon, and healths.
-/mob/proc/toggle_zoom_hud()
- if(!hud_used)
- return
- if(!ishuman(src))
- return
- if(!client)
- return
- if(client.view != world.view)
- return
-
- if(hud_used.hud_shown)
- hud_used.hud_shown = 0
- if(src.hud_used.adding)
- src.client.screen -= src.hud_used.adding
- if(src.hud_used.other)
- src.client.screen -= src.hud_used.other
- if(src.hud_used.hotkeybuttons)
- src.client.screen -= src.hud_used.hotkeybuttons
- src.client.screen -= src.internals
- src.client.screen += src.hud_used.action_intent //we want the intent swticher visible
- else
- hud_used.hud_shown = 1
- if(src.hud_used.adding)
- src.client.screen += src.hud_used.adding
- if(src.hud_used.other && src.hud_used.inventory_shown)
- src.client.screen += src.hud_used.other
- if(src.hud_used.hotkeybuttons && !src.hud_used.hotkey_ui_hidden)
- src.client.screen += src.hud_used.hotkeybuttons
- if(src.internals)
- src.client.screen |= src.internals
- src.hud_used.action_intent.screen_loc = ui_acti //Restore intent selection to the original position
-
- hud_used.hidden_inventory_update()
- hud_used.persistant_inventory_update()
- update_action_buttons()
-
-/client/proc/reset_click_catchers()
-
- var/xmin = -(round(last_view_x_dim*0.5))
- var/xmax = last_view_x_dim - abs(xmin)
- var/ymin = -(round(last_view_y_dim*0.5))
- var/ymax = last_view_y_dim - abs(ymin)
-
- var/list/click_catchers = get_click_catchers()
- for(var/obj/screen/click_catcher/catcher in click_catchers)
- if(catcher.x_offset <= xmin || catcher.x_offset >= xmax || catcher.y_offset <= ymin || catcher.y_offset >= ymax)
- screen -= catcher
- else
- screen |= catcher
-
-/mob/proc/add_click_catcher()
- client.reset_click_catchers()
-
-/mob/new_player/add_click_catcher()
- return
-
-/obj/screen/stamina
- name = "stamina"
- icon = 'icons/effects/progressbar.dmi'
- icon_state = "prog_bar_100"
- invisibility = INVISIBILITY_MAXIMUM
- screen_loc = ui_stamina
diff --git a/code/_onclick/hud/hud_elements/_hud_element.dm b/code/_onclick/hud/hud_elements/_hud_element.dm
new file mode 100644
index 000000000000..4d091c589514
--- /dev/null
+++ b/code/_onclick/hud/hud_elements/_hud_element.dm
@@ -0,0 +1,49 @@
+/decl/hud_element
+ abstract_type = /decl/hud_element
+ var/screen_name
+ var/screen_icon
+ var/screen_icon_state
+ var/screen_loc
+ var/screen_object_type = /obj/screen
+
+ var/hidable = FALSE
+ var/apply_hud_color = TRUE
+ var/apply_hud_alpha = TRUE
+ var/apply_hud_icon = TRUE
+ var/apply_color_on_cooldown = FALSE
+
+ var/update_in_life = FALSE
+
+ var/hud_element_category
+
+/decl/hud_element/proc/refresh_screen_object(var/datum/hud/hud, var/obj/screen/elem, var/datum/gas_mixture/environment)
+ return
+
+/decl/hud_element/proc/create_screen_object(var/datum/hud/hud)
+ var/obj/screen/elem = new screen_object_type
+ if(screen_name)
+ elem.SetName(screen_name)
+ if(apply_hud_color)
+ elem.color = hud.get_ui_color()
+ if(apply_hud_alpha)
+ elem.alpha = hud.get_ui_alpha()
+ if(apply_hud_icon)
+ elem.icon = hud.get_ui_style()
+ else if(screen_icon)
+ elem.icon = screen_icon
+ if(screen_icon_state)
+ elem.icon_state = screen_icon_state
+ if(screen_loc)
+ elem.screen_loc = screen_loc
+ register_screen_object(elem, hud)
+ return elem
+
+/decl/hud_element/proc/register_screen_object(var/obj/screen/elem, var/datum/hud/hud)
+ hud.misc_hud_elements |= elem
+
+/decl/hud_element/condition
+ screen_icon = 'icons/mob/screen/condition.dmi'
+ apply_hud_icon = FALSE
+ apply_hud_alpha = FALSE
+ apply_hud_color = FALSE
+ update_in_life = TRUE
diff --git a/code/_onclick/hud/hud_elements/ability_master.dm b/code/_onclick/hud/hud_elements/ability_master.dm
new file mode 100644
index 000000000000..3f09c1f9f78a
--- /dev/null
+++ b/code/_onclick/hud/hud_elements/ability_master.dm
@@ -0,0 +1,8 @@
+/decl/hud_element/ability_master
+ apply_hud_icon = FALSE
+ apply_hud_alpha = FALSE
+ apply_hud_color = FALSE
+ hud_element_category = /decl/hud_element/ability_master
+
+/decl/hud_element/ability_master/create_screen_object(datum/hud/hud)
+ return new /obj/screen/ability_master(null, hud?.mymob)
diff --git a/code/_onclick/hud/hud_elements/action_intent.dm b/code/_onclick/hud/hud_elements/action_intent.dm
new file mode 100644
index 000000000000..595ee131b575
--- /dev/null
+++ b/code/_onclick/hud/hud_elements/action_intent.dm
@@ -0,0 +1,29 @@
+/decl/hud_element/action_intent
+ screen_object_type = /obj/screen/intent
+ screen_icon = 'icons/mob/screen/intent.dmi'
+ hud_element_category = /decl/hud_element/action_intent
+
+/obj/screen/intent
+ name = "intent"
+ icon = 'icons/mob/screen/white.dmi'
+ icon_state = "intent_help"
+ screen_loc = ui_acti
+ var/intent = I_HELP
+
+/obj/screen/intent/Click(var/location, var/control, var/params)
+ var/list/P = params2list(params)
+ var/icon_x = text2num(P["icon-x"])
+ var/icon_y = text2num(P["icon-y"])
+ intent = I_DISARM
+ if(icon_x <= world.icon_size/2)
+ if(icon_y <= world.icon_size/2)
+ intent = I_HURT
+ else
+ intent = I_HELP
+ else if(icon_y <= world.icon_size/2)
+ intent = I_GRAB
+ update_icon()
+ usr.a_intent = intent
+
+/obj/screen/intent/on_update_icon()
+ icon_state = "intent_[intent]"
diff --git a/code/_onclick/hud/hud_elements/bodytemp.dm b/code/_onclick/hud/hud_elements/bodytemp.dm
new file mode 100644
index 000000000000..1854f103a569
--- /dev/null
+++ b/code/_onclick/hud/hud_elements/bodytemp.dm
@@ -0,0 +1,37 @@
+/decl/hud_element/condition/bodytemp
+ screen_name = "body temperature"
+ screen_object_type = /obj/screen/bodytemp
+ hud_element_category = /decl/hud_element/condition/bodytemp
+ screen_icon_state = "temp1"
+ screen_loc = ui_temp
+
+/decl/hud_element/condition/bodytemp/refresh_screen_object(var/datum/hud/hud, var/obj/screen/elem, var/datum/gas_mixture/environment)
+ //TODO: precalculate all of this stuff when the species datum is created
+ var/bodytemp = hud.mymob.bodytemperature
+ var/base_temperature = hud.mymob.get_ideal_bodytemp()
+ if (bodytemp >= base_temperature)
+ var/heat_level_1 = hud.mymob.get_temperature_threshold(HEAT_LEVEL_1)
+ var/temp_step = (heat_level_1 - base_temperature)/4
+ if (bodytemp >= heat_level_1)
+ elem.icon_state = "temp4"
+ else if (bodytemp >= base_temperature + temp_step*3)
+ elem.icon_state = "temp3"
+ else if (bodytemp >= base_temperature + temp_step*2)
+ elem.icon_state = "temp2"
+ else if (bodytemp >= base_temperature + temp_step*1)
+ elem.icon_state = "temp1"
+ else
+ elem.icon_state = "temp0"
+ else if (bodytemp < base_temperature)
+ var/cold_level_1 = hud.mymob.get_temperature_threshold(COLD_LEVEL_1)
+ var/temp_step = (base_temperature - cold_level_1)/4
+ if (bodytemp <= cold_level_1)
+ elem.icon_state = "temp-4"
+ else if (bodytemp <= base_temperature - temp_step*3)
+ elem.icon_state = "temp-3"
+ else if (bodytemp <= base_temperature - temp_step*2)
+ elem.icon_state = "temp-2"
+ else if (bodytemp <= base_temperature - temp_step*1)
+ elem.icon_state = "temp-1"
+ else
+ elem.icon_state = "temp0"
diff --git a/code/_onclick/hud/hud_elements/cells.dm b/code/_onclick/hud/hud_elements/cells.dm
new file mode 100644
index 000000000000..34aacb6d77e1
--- /dev/null
+++ b/code/_onclick/hud/hud_elements/cells.dm
@@ -0,0 +1,21 @@
+/decl/hud_element/cells
+ screen_name = "cell"
+ screen_icon_state = "charge-empty"
+ screen_icon = 'icons/mob/screen/robot_charge.dmi'
+ screen_loc = ui_nutrition
+ update_in_life = TRUE
+
+/decl/hud_element/cells/refresh_screen_object(datum/hud/hud, obj/screen/elem, datum/gas_mixture/environment)
+ if(!isliving(hud?.mymob))
+ return
+ var/mob/living/user = hud.mymob
+ if(!user.isSynthetic())
+ elem.invisibility = INVISIBILITY_MAXIMUM
+ else
+ elem.invisibility = 0
+ var/obj/item/cell/cell = user.get_cell()
+ if(cell)
+ // 0-100 maps to 0-4, but give it a paranoid clamp just in case.
+ elem.icon_state = "charge[clamp(CEILING(cell.percent()/25), 0, 4)]"
+ else
+ elem.icon_state = "charge-empty"
diff --git a/code/_onclick/hud/hud_elements/drop.dm b/code/_onclick/hud/hud_elements/drop.dm
new file mode 100644
index 000000000000..d957a227b965
--- /dev/null
+++ b/code/_onclick/hud/hud_elements/drop.dm
@@ -0,0 +1,7 @@
+/decl/hud_element/drop
+ screen_name = "drop"
+ screen_icon_state = "act_drop"
+ screen_loc = ui_drop_throw
+
+/decl/hud_element/drop/register_screen_object(obj/screen/elem, datum/hud/hud)
+ hud.hotkey_hud_elements |= elem
diff --git a/code/_onclick/hud/hud_elements/fire.dm b/code/_onclick/hud/hud_elements/fire.dm
new file mode 100644
index 000000000000..706ee23b4654
--- /dev/null
+++ b/code/_onclick/hud/hud_elements/fire.dm
@@ -0,0 +1,8 @@
+/decl/hud_element/condition/fire
+ screen_name = "fire"
+ screen_icon_state = "fire0"
+ screen_loc = ui_fire
+ hud_element_category = /decl/hud_element/condition/fire
+
+/decl/hud_element/condition/fire/refresh_screen_object(var/datum/hud/hud, var/obj/screen/elem, var/datum/gas_mixture/environment)
+ screen_icon_state = "fire[hud?.alerts ? (hud.alerts[hud_element_category] || 0) : 0]"
diff --git a/code/_onclick/hud/hud_elements/gun_mode.dm b/code/_onclick/hud/hud_elements/gun_mode.dm
new file mode 100644
index 000000000000..76f2d224d692
--- /dev/null
+++ b/code/_onclick/hud/hud_elements/gun_mode.dm
@@ -0,0 +1,95 @@
+// Omit the base gun_mode because it doesn't care about specific gun use flags
+var/global/list/gun_hud_flag_decl_types = list(
+ /decl/hud_element/gun_flag_move,
+ /decl/hud_element/gun_flag_item,
+ /decl/hud_element/gun_flag_radio
+)
+
+/// Root type for flag toggling in gun mode.
+/obj/screen/gun_flag
+ name = "gun"
+ master = null
+ dir = SOUTH
+
+ var/option_name
+ var/option_state
+ var/option_flag
+
+/obj/screen/gun_flag/proc/update_from_aiming_overlay(var/obj/aiming_overlay/aiming_overlay)
+ if(!aiming_overlay || !option_flag || !option_name || !option_state)
+ return
+ if(aiming_overlay.target_permissions & option_flag)
+ icon_state = "[option_state]1"
+ SetName("Disallow [option_name]]")
+ else
+ icon_state = "[option_state]0"
+ SetName("Allow [option_name]")
+
+/obj/screen/gun_flag/Click(location, control, params)
+ if(isliving(usr) && option_flag && option_name && option_state)
+ var/mob/living/user = usr
+ if(!user.aiming)
+ user.aiming = new(user)
+ user.aiming.toggle_permission(option_flag)
+ return TRUE
+ return FALSE
+
+/// Root gun mode type - toggles aiming mode off or on when ticked.
+/obj/screen/gun_mode
+ name = "Toggle Gun Mode"
+ icon_state = "gun0"
+ screen_loc = ui_gun_select
+ master = null
+ dir = SOUTH
+
+/decl/hud_element/gun_mode
+ screen_object_type = /obj/screen/gun_mode
+ hud_element_category = /decl/hud_element/gun_mode
+
+/// Element for dis/allowing gun mode target clicking.
+/obj/screen/gun_flag/item
+ name = "Allow Item Use"
+ icon_state = "no_item1"
+ screen_loc = ui_gun1
+ option_name = "Item Use"
+ option_state = "no_item"
+ option_flag = TARGET_CAN_CLICK
+
+/decl/hud_element/gun_flag_item
+ screen_object_type = /obj/screen/gun_flag/item
+ hud_element_category = /decl/hud_element/gun_flag_item
+
+/decl/hud_element/gun_flag_item/register_screen_object(obj/screen/elem, datum/hud/hud)
+ return
+
+/// Element for dis/allowing gun mode target movement.
+/obj/screen/gun_flag/move
+ name = "Allow Movement"
+ icon_state = "no_walk1"
+ screen_loc = ui_gun2
+ option_name = "Movement"
+ option_state = "no_walk"
+ option_flag = TARGET_CAN_MOVE
+
+/decl/hud_element/gun_flag_move
+ screen_object_type = /obj/screen/gun_flag/move
+ hud_element_category = /decl/hud_element/gun_flag_move
+
+/decl/hud_element/gun_flag_move/register_screen_object(obj/screen/elem, datum/hud/hud)
+ return
+
+/// Element for dis/allowing gun mode target radio use.
+/decl/hud_element/gun_flag_radio
+ screen_object_type = /obj/screen/gun_flag/radio
+ hud_element_category = /decl/hud_element/gun_flag_radio
+
+/decl/hud_element/gun_flag_radio/register_screen_object(obj/screen/elem, datum/hud/hud)
+ return
+
+/obj/screen/gun_flag/radio
+ name = "Disallow Radio Use"
+ icon_state = "no_radio1"
+ screen_loc = ui_gun4
+ option_name = "Radio Use"
+ option_state = "no_radio"
+ option_flag = TARGET_CAN_RADIO
diff --git a/code/_onclick/hud/hud_elements/health.dm b/code/_onclick/hud/hud_elements/health.dm
new file mode 100644
index 000000000000..2d84c53ccd12
--- /dev/null
+++ b/code/_onclick/hud/hud_elements/health.dm
@@ -0,0 +1,81 @@
+/decl/hud_element/health
+ screen_name = "health"
+ screen_icon = 'icons/mob/screen/health_human.dmi'
+ screen_icon_state = "health0"
+ apply_hud_icon = FALSE
+ apply_hud_alpha = FALSE
+ apply_hud_color = FALSE
+ var/health_states = 6
+ var/death_state = 7
+ var/numb_state = "_numb"
+
+/decl/hud_element/health/refresh_screen_object(datum/hud/hud, obj/screen/elem, datum/gas_mixture/environment)
+ if(!isliving(hud?.mymob))
+ return
+ var/mob/living/user = hud.mymob
+ reset_health_overlays(user, elem)
+ if(user.stat == DEAD)
+ elem.icon_state = "health[death_state]"
+ else if(user.has_chemical_effect(CE_PAINKILLER, 100))
+ elem.icon_state = "health[numb_state]"
+ else
+ update_health_overlays(user, elem)
+
+/decl/hud_element/health/proc/reset_health_overlays(mob/living/user, obj/screen/elem)
+ return
+
+/decl/hud_element/health/proc/update_health_overlays(mob/living/user, obj/screen/elem)
+ elem.icon_state = "health[health_states - round(user.get_health_ratio() * health_states)]"
+
+/decl/hud_element/health/human
+ screen_icon_state = "blank"
+ var/health_icon = 'icons/mob/screen/health_human.dmi'
+ var/burning_image
+ var/softcrit_image
+ var/hardcrit_image
+ var/fullhealth_image
+
+/decl/hud_element/health/human/Initialize()
+ . = ..()
+ burning_image = image(health_icon, "burning")
+ softcrit_image = image(health_icon, "softcrit")
+ hardcrit_image = image(health_icon, "hardcrit")
+ fullhealth_image = image(health_icon, "fullhealth")
+
+/decl/hud_element/health/human/reset_health_overlays(mob/living/user, obj/screen/elem)
+ elem.cut_overlays()
+ elem.icon_state = "blank"
+
+/decl/hud_element/health/human/update_health_overlays(mob/living/user, obj/screen/elem)
+
+ // Generate a by-limb health display.
+ // Pain modifies the effective pain level used to colour the limb.
+ var/no_damage = 1
+ var/trauma_val = 0 // Used in calculating softcrit/hardcrit indicators.
+ if(user.can_feel_pain() && ishuman(user))
+ var/mob/living/carbon/human/human = user
+ trauma_val = max(human.shock_stage, human.get_shock()) / (user.get_max_health()-100) // TODO: where is this 100 coming from?
+
+ for(var/obj/item/organ/external/E in user.get_external_organs())
+ if(no_damage && (E.brute_dam || E.burn_dam))
+ no_damage = 0
+ var/organ_image = E.get_damage_hud_image()
+ if(organ_image)
+ elem.add_overlay(organ_image)
+
+ // Apply a fire overlay if we're burning.
+ if(user.on_fire)
+ elem.add_overlay(burning_image)
+
+ // Show a general pain/crit indicator if needed.
+ if(user.is_asystole())
+ elem.add_overlay(hardcrit_image)
+ else if(trauma_val)
+ if(user.can_feel_pain())
+ if(trauma_val > 0.7)
+ elem.add_overlay(softcrit_image)
+ if(trauma_val >= 1)
+ elem.add_overlay(hardcrit_image)
+ else if(no_damage)
+ elem.add_overlay(fullhealth_image)
+ elem.compile_overlays()
diff --git a/code/_onclick/hud/hud_elements/hydration.dm b/code/_onclick/hud/hud_elements/hydration.dm
new file mode 100644
index 000000000000..cd6569f94cdc
--- /dev/null
+++ b/code/_onclick/hud/hud_elements/hydration.dm
@@ -0,0 +1,21 @@
+/decl/hud_element/condition/hydration
+ screen_name = "hydration"
+ screen_object_type = /obj/screen/drink
+ screen_icon_state = "hydration1"
+ screen_loc = ui_nutrition_small
+ hud_element_category = /decl/hud_element/condition/hydration
+ var/hud_states = 4
+
+/decl/hud_element/condition/hydration/refresh_screen_object(datum/hud/hud, obj/screen/elem, datum/gas_mixture/environment)
+ if(!isliving(hud?.mymob))
+ return
+ var/mob/living/user = hud.mymob
+ var/max_hyd = user.get_max_hydration()
+ var/hyd = user.get_hydration()
+ var/hyd_offset = max_hyd * 0.2
+ if(hyd >= max_hyd - hyd_offset)
+ elem.icon_state = "hydration[hud_states]"
+ else if(hyd <= hyd_offset * 2)
+ elem.icon_state = "hydration"
+ else
+ elem.icon_state = "hydration[round(((hyd-(hyd_offset*2))/(max_hyd-hyd_offset))*(hud_states-2))+1]"
diff --git a/code/_onclick/hud/hud_elements/internals.dm b/code/_onclick/hud/hud_elements/internals.dm
new file mode 100644
index 000000000000..16eb2360536e
--- /dev/null
+++ b/code/_onclick/hud/hud_elements/internals.dm
@@ -0,0 +1,8 @@
+/decl/hud_element/internals
+ screen_name = "internal"
+ screen_icon = 'icons/mob/screen/internals.dmi'
+ screen_icon_state = "internal0"
+ screen_loc = ui_internal
+ apply_hud_icon = FALSE
+ apply_hud_alpha = FALSE
+ apply_hud_color = FALSE
diff --git a/code/_onclick/hud/hud_elements/move_intent.dm b/code/_onclick/hud/hud_elements/move_intent.dm
new file mode 100644
index 000000000000..df79aeb7a99f
--- /dev/null
+++ b/code/_onclick/hud/hud_elements/move_intent.dm
@@ -0,0 +1,9 @@
+/decl/hud_element/move_intent
+ screen_name = "movement method"
+ screen_object_type = /obj/screen/movement
+ screen_loc = ui_movi
+ hud_element_category = /decl/hud_element/move_intent
+
+/decl/hud_element/move_intent/create_screen_object(var/datum/hud/hud)
+ var/obj/screen/elem = ..()
+ elem.icon_state = hud.mymob.move_intent.hud_icon_state
diff --git a/code/_onclick/hud/hud_elements/nutrition.dm b/code/_onclick/hud/hud_elements/nutrition.dm
new file mode 100644
index 000000000000..46cfc164820e
--- /dev/null
+++ b/code/_onclick/hud/hud_elements/nutrition.dm
@@ -0,0 +1,26 @@
+/decl/hud_element/condition/nutrition
+ screen_name = "nutrition"
+ screen_object_type = /obj/screen/food
+ screen_icon_state = "nutrition1"
+ screen_loc = ui_nutrition_small
+ hud_element_category = /decl/hud_element/condition/nutrition
+ var/hud_states = 4
+
+/decl/hud_element/condition/nutrition/create_screen_object(datum/hud/hud)
+ var/obj/screen/elem = ..()
+ elem.pixel_w = 8
+ return elem
+
+/decl/hud_element/condition/nutrition/refresh_screen_object(datum/hud/hud, obj/screen/elem, datum/gas_mixture/environment)
+ if(!isliving(hud?.mymob))
+ return
+ var/mob/living/user = hud.mymob
+ var/max_nut = user.get_max_nutrition()
+ var/nut = user.get_nutrition()
+ var/nut_offset = max_nut * 0.2
+ if(nut >= max_nut - nut_offset)
+ elem.icon_state = "nutrition[hud_states]"
+ else if(nut <= nut_offset * 2)
+ elem.icon_state = "nutrition0"
+ else
+ elem.icon_state = "nutrition[round(((nut-(nut_offset*2))/(max_nut-nut_offset))*(hud_states-2))+1]"
diff --git a/code/_onclick/hud/hud_elements/oxygen.dm b/code/_onclick/hud/hud_elements/oxygen.dm
new file mode 100644
index 000000000000..26603a2aabf4
--- /dev/null
+++ b/code/_onclick/hud/hud_elements/oxygen.dm
@@ -0,0 +1,9 @@
+/decl/hud_element/condition/oxygen
+ screen_name = "oxygen"
+ screen_object_type = /obj/screen/oxygen
+ screen_loc = ui_temp
+ screen_icon_state = "oxy0"
+ hud_element_category = /decl/hud_element/condition/oxygen
+
+/decl/hud_element/condition/oxygen/refresh_screen_object(datum/hud/hud, obj/screen/elem, datum/gas_mixture/environment)
+ elem.icon_state = "oxy[hud?.alerts ? (LAZYACCESS(hud.alerts, hud_element_category) || 0) : 0]"
diff --git a/code/_onclick/hud/hud_elements/pain.dm b/code/_onclick/hud/hud_elements/pain.dm
new file mode 100644
index 000000000000..917fe3c8665b
--- /dev/null
+++ b/code/_onclick/hud/hud_elements/pain.dm
@@ -0,0 +1,2 @@
+/decl/hud_element/pain
+ screen_object_type = /obj/screen/fullscreen/pain
diff --git a/code/_onclick/hud/hud_elements/pressure.dm b/code/_onclick/hud/hud_elements/pressure.dm
new file mode 100644
index 000000000000..0c6250cd567d
--- /dev/null
+++ b/code/_onclick/hud/hud_elements/pressure.dm
@@ -0,0 +1,9 @@
+/decl/hud_element/condition/pressure
+ screen_name = "pressure"
+ screen_object_type = /obj/screen/pressure
+ screen_icon_state = "pressure0"
+ screen_loc = ui_temp
+ hud_element_category = /decl/hud_element/condition/pressure
+
+/decl/hud_element/condition/pressure/refresh_screen_object(datum/hud/hud, obj/screen/elem, datum/gas_mixture/environment)
+ elem.icon_state = "pressure[hud?.alerts ? (LAZYACCESS(hud.alerts, hud_element_category) || 0) : 0]"
diff --git a/code/_onclick/hud/hud_elements/resist.dm b/code/_onclick/hud/hud_elements/resist.dm
new file mode 100644
index 000000000000..35c2e12cc1ac
--- /dev/null
+++ b/code/_onclick/hud/hud_elements/resist.dm
@@ -0,0 +1,7 @@
+/decl/hud_element/resist
+ screen_name = "resist"
+ screen_icon_state = "act_resist"
+ screen_loc = ui_pull_resist
+
+/decl/hud_element/resist/register_screen_object(obj/screen/elem, datum/hud/hud)
+ hud.hotkey_hud_elements |= elem
diff --git a/code/_onclick/hud/hud_elements/stamina.dm b/code/_onclick/hud/hud_elements/stamina.dm
new file mode 100644
index 000000000000..e2fd7b442aca
--- /dev/null
+++ b/code/_onclick/hud/hud_elements/stamina.dm
@@ -0,0 +1,12 @@
+/decl/hud_element/stamina_bar
+ screen_object_type = /obj/screen/stamina
+ apply_hud_alpha = FALSE
+ apply_hud_color = FALSE
+ apply_hud_icon = FALSE
+
+/obj/screen/stamina
+ name = "stamina"
+ icon = 'icons/effects/progressbar.dmi'
+ icon_state = "prog_bar_100"
+ invisibility = INVISIBILITY_MAXIMUM
+ screen_loc = ui_stamina
\ No newline at end of file
diff --git a/code/_onclick/hud/hud_elements/throwing.dm b/code/_onclick/hud/hud_elements/throwing.dm
new file mode 100644
index 000000000000..158dda5b0fed
--- /dev/null
+++ b/code/_onclick/hud/hud_elements/throwing.dm
@@ -0,0 +1,7 @@
+/decl/hud_element/throwing
+ screen_name = "throw"
+ screen_icon_state = "act_throw_off"
+ screen_loc = ui_drop_throw
+
+/decl/hud_element/throwing/register_screen_object(obj/screen/elem, datum/hud/hud)
+ hud.hotkey_hud_elements |= elem
diff --git a/code/_onclick/hud/hud_elements/toxins.dm b/code/_onclick/hud/hud_elements/toxins.dm
new file mode 100644
index 000000000000..5f42892c4b34
--- /dev/null
+++ b/code/_onclick/hud/hud_elements/toxins.dm
@@ -0,0 +1,9 @@
+/decl/hud_element/condition/toxins
+ screen_name = "toxin"
+ screen_object_type = /obj/screen/toxins
+ screen_icon_state = "tox0"
+ screen_loc = ui_temp
+ hud_element_category = /decl/hud_element/condition/toxins
+
+/decl/hud_element/condition/toxins/refresh_screen_object(datum/hud/hud, obj/screen/elem, datum/gas_mixture/environment)
+ elem.icon_state = "tox[hud?.alerts ? (LAZYACCESS(hud.alerts, hud_element_category) || 0) : 0]"
diff --git a/code/_onclick/hud/hud_elements/up_hint.dm b/code/_onclick/hud/hud_elements/up_hint.dm
new file mode 100644
index 000000000000..e845411cb1ac
--- /dev/null
+++ b/code/_onclick/hud/hud_elements/up_hint.dm
@@ -0,0 +1,5 @@
+/decl/hud_element/up_hint
+ screen_name = "up hint"
+ screen_icon_state = "uphint0"
+ screen_loc = ui_up_hint
+
diff --git a/code/_onclick/hud/hud_elements/zone_selector.dm b/code/_onclick/hud/hud_elements/zone_selector.dm
new file mode 100644
index 000000000000..4776e0b8355e
--- /dev/null
+++ b/code/_onclick/hud/hud_elements/zone_selector.dm
@@ -0,0 +1,3 @@
+/decl/hud_element/zone_selector
+ screen_object_type = /obj/screen/zone_selector
+ hud_element_category = /decl/hud_element/zone_selector
diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm
index a40889dc4d61..54f91ae1012d 100644
--- a/code/_onclick/hud/human.dm
+++ b/code/_onclick/hud/human.dm
@@ -1,219 +1,51 @@
/mob/living/carbon/human
- hud_type = /datum/hud/human
-
-/datum/hud/human/FinalizeInstantiation()
-
- var/ui_style = get_ui_style()
- var/ui_color = get_ui_color()
- var/ui_alpha = get_ui_alpha()
-
- var/mob/living/carbon/human/target = mymob
- var/datum/hud_data/hud_data = istype(target) ? target.species.hud : new()
- if(hud_data.icon)
- ui_style = hud_data.icon
-
- adding = list()
- other = list()
- src.hotkeybuttons = list() //These can be disabled for hotkey usersx
-
- var/list/hud_elements = list()
- var/obj/screen/using
-
- stamina_bar = new
- adding += stamina_bar
-
- BuildInventoryUI()
-
- // Draw the attack intent dialogue.
- if(hud_data.has_a_intent)
- using = new /obj/screen/intent()
- src.adding += using
- action_intent = using
- hud_elements |= using
-
- if(hud_data.has_m_intent)
- using = new /obj/screen/movement()
- using.SetName("movement method")
- using.icon = ui_style
- using.icon_state = mymob.move_intent.hud_icon_state
- using.screen_loc = ui_movi
- using.color = ui_color
- using.alpha = ui_alpha
- src.adding += using
- move_intent = using
-
- if(hud_data.has_drop)
- using = new /obj/screen()
- using.SetName("drop")
- using.icon = ui_style
- using.icon_state = "act_drop"
- using.screen_loc = ui_drop_throw
- using.color = ui_color
- using.alpha = ui_alpha
- src.hotkeybuttons += using
-
- if(hud_data.has_hands)
- BuildHandsUI()
-
- if(hud_data.has_resist)
- using = new /obj/screen()
- using.SetName("resist")
- using.icon = ui_style
- using.icon_state = "act_resist"
- using.screen_loc = ui_pull_resist
- using.color = ui_color
- using.alpha = ui_alpha
- src.hotkeybuttons += using
-
- if(hud_data.has_throw)
- mymob.throw_icon = new /obj/screen()
- mymob.throw_icon.icon = ui_style
- mymob.throw_icon.icon_state = "act_throw_off"
- mymob.throw_icon.SetName("throw")
- mymob.throw_icon.screen_loc = ui_drop_throw
- mymob.throw_icon.color = ui_color
- mymob.throw_icon.alpha = ui_alpha
- src.hotkeybuttons += mymob.throw_icon
- hud_elements |= mymob.throw_icon
-
- if(hud_data.has_internals)
- mymob.internals = new /obj/screen()
- mymob.internals.icon = ui_style
- mymob.internals.icon_state = "internal0"
- mymob.internals.SetName("internal")
- mymob.internals.screen_loc = ui_internal
- hud_elements |= mymob.internals
-
- if(hud_data.has_warnings)
- mymob.healths = new /obj/screen()
- mymob.healths.icon = ui_style
- mymob.healths.icon_state = "health0"
- mymob.healths.SetName("health")
- mymob.healths.screen_loc = ui_health
- hud_elements |= mymob.healths
-
- mymob.oxygen = new /obj/screen/oxygen()
- mymob.oxygen.icon = 'icons/mob/status_indicators.dmi'
- mymob.oxygen.icon_state = "oxy0"
- mymob.oxygen.SetName("oxygen")
- mymob.oxygen.screen_loc = ui_temp
- hud_elements |= mymob.oxygen
-
- mymob.toxin = new /obj/screen/toxins()
- mymob.toxin.icon = 'icons/mob/status_indicators.dmi'
- mymob.toxin.icon_state = "tox0"
- mymob.toxin.SetName("toxin")
- mymob.toxin.screen_loc = ui_temp
- hud_elements |= mymob.toxin
-
- mymob.fire = new /obj/screen()
- mymob.fire.icon = ui_style
- mymob.fire.icon_state = "fire0"
- mymob.fire.SetName("fire")
- mymob.fire.screen_loc = ui_fire
- hud_elements |= mymob.fire
-
- if(hud_data.has_pressure)
- mymob.pressure = new /obj/screen/pressure()
- mymob.pressure.icon = 'icons/mob/status_indicators.dmi'
- mymob.pressure.icon_state = "pressure0"
- mymob.pressure.SetName("pressure")
- mymob.pressure.screen_loc = ui_temp
- hud_elements |= mymob.pressure
-
- if(hud_data.has_bodytemp)
- mymob.bodytemp = new /obj/screen/bodytemp()
- mymob.bodytemp.icon = 'icons/mob/status_indicators.dmi'
- mymob.bodytemp.icon_state = "temp1"
- mymob.bodytemp.SetName("body temperature")
- mymob.bodytemp.screen_loc = ui_temp
- hud_elements |= mymob.bodytemp
-
- if(target.isSynthetic())
- target.cells = new /obj/screen()
- target.cells.icon = 'icons/mob/screen1_robot.dmi'
- target.cells.icon_state = "charge-empty"
- target.cells.SetName("cell")
- target.cells.screen_loc = ui_nutrition
- hud_elements |= target.cells
-
- else if(hud_data.has_nutrition)
- mymob.nutrition_icon = new /obj/screen/food()
- mymob.nutrition_icon.icon = 'icons/mob/status_hunger.dmi'
- mymob.nutrition_icon.pixel_w = 8
- mymob.nutrition_icon.icon_state = "nutrition1"
- mymob.nutrition_icon.SetName("nutrition")
- mymob.nutrition_icon.screen_loc = ui_nutrition_small
- hud_elements |= mymob.nutrition_icon
-
- mymob.hydration_icon = new /obj/screen/drink()
- mymob.hydration_icon.icon = 'icons/mob/status_hunger.dmi'
- mymob.hydration_icon.icon_state = "hydration1"
- mymob.hydration_icon.SetName("hydration")
- mymob.hydration_icon.screen_loc = ui_nutrition_small
- hud_elements |= mymob.hydration_icon
-
- if(hud_data.has_up_hint)
- mymob.up_hint = new /obj/screen()
- mymob.up_hint.icon = ui_style
- mymob.up_hint.icon_state = "uphint0"
- mymob.up_hint.SetName("up hint")
- mymob.up_hint.screen_loc = ui_up_hint
- hud_elements |= mymob.up_hint
-
- mymob.pain = new /obj/screen/fullscreen/pain( null )
- hud_elements |= mymob.pain
-
- mymob.zone_sel = new
- mymob.zone_sel.icon = ui_style
- mymob.zone_sel.color = ui_color
- mymob.zone_sel.alpha = ui_alpha
- mymob.zone_sel.update_icon()
- hud_elements |= mymob.zone_sel
-
- target.attack_selector = new
- target.attack_selector.set_owner(target)
- target.attack_selector.icon = ui_style
- target.attack_selector.color = ui_color
- target.attack_selector.alpha = ui_alpha
- target.attack_selector.update_icon()
- hud_elements |= target.attack_selector
-
- //Handle the gun settings buttons
- mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
- mymob.gun_setting_icon.icon = ui_style
- mymob.gun_setting_icon.color = ui_color
- mymob.gun_setting_icon.alpha = ui_alpha
- hud_elements |= mymob.gun_setting_icon
-
- mymob.item_use_icon = new /obj/screen/gun/item(null)
- mymob.item_use_icon.icon = ui_style
- mymob.item_use_icon.color = ui_color
- mymob.item_use_icon.alpha = ui_alpha
-
- mymob.gun_move_icon = new /obj/screen/gun/move(null)
- mymob.gun_move_icon.icon = ui_style
- mymob.gun_move_icon.color = ui_color
- mymob.gun_move_icon.alpha = ui_alpha
-
- mymob.radio_use_icon = new /obj/screen/gun/radio(null)
- mymob.radio_use_icon.icon = ui_style
- mymob.radio_use_icon.color = ui_color
- mymob.radio_use_icon.alpha = ui_alpha
-
- mymob.client.screen = list()
- if(length(hand_hud_objects))
- mymob.client.screen += hand_hud_objects
- if(length(swaphand_hud_objects))
- mymob.client.screen += swaphand_hud_objects
- if(length(hud_elements))
- mymob.client.screen += hud_elements
- mymob.client.screen += src.adding + src.hotkeybuttons
-
- hide_inventory()
-
- hidden_inventory_update()
- persistant_inventory_update()
+ hud_used = /datum/hud/human
+
+/decl/hud_element/attack_selector
+ screen_object_type = /obj/screen/default_attack_selector
+ hud_element_category = /decl/hud_element/attack_selector
+
+/decl/hud_element/attack_selector/register_screen_object(var/obj/screen/elem, var/datum/hud/hud)
+ var/obj/screen/default_attack_selector/attack_selector = elem
+ if(istype(attack_selector) && ishuman(hud.mymob))
+ attack_selector.set_owner(hud.mymob)
+ attack_selector.update_icon()
+ return ..()
+
+/datum/hud/human
+ health_hud_type = /decl/hud_element/health/human
+ hud_elements = list(
+ /decl/hud_element/health/human,
+ /decl/hud_element/condition/bodytemp,
+ /decl/hud_element/attack_selector,
+ /decl/hud_element/zone_selector,
+ /decl/hud_element/move_intent,
+ /decl/hud_element/action_intent,
+ /decl/hud_element/condition/pressure,
+ /decl/hud_element/condition/fire,
+ /decl/hud_element/condition/toxins,
+ /decl/hud_element/condition/oxygen,
+ /decl/hud_element/condition/nutrition,
+ /decl/hud_element/condition/hydration,
+ /decl/hud_element/stamina_bar,
+ /decl/hud_element/drop,
+ /decl/hud_element/resist,
+ /decl/hud_element/throwing,
+ /decl/hud_element/up_hint,
+ /decl/hud_element/pain,
+ /decl/hud_element/internals,
+ /decl/hud_element/gun_mode,
+ /decl/hud_element/gun_flag_item,
+ /decl/hud_element/gun_flag_move,
+ /decl/hud_element/gun_flag_radio
+ )
+
+/datum/hud/human/get_ui_style()
+ var/decl/species/my_species = mymob?.get_species()
+ var/datum/hud_data/hud_data = my_species?.hud || new
+ if(hud_data?.icon)
+ return hud_data.icon
+ return ..()
/mob/living/carbon/human/verb/toggle_hotkey_verbs()
set category = "OOC"
@@ -221,17 +53,16 @@
set desc = "This disables or enables the user interface buttons which can be used with hotkeys."
if(hud_used.hotkey_ui_hidden)
- client.screen += hud_used.hotkeybuttons
+ client.screen |= hud_used.hotkey_hud_elements
hud_used.hotkey_ui_hidden = 0
else
- client.screen -= hud_used.hotkeybuttons
+ client.screen -= hud_used.hotkey_hud_elements
hud_used.hotkey_ui_hidden = 1
// Yes, these use icon state. Yes, these are terrible. The alternative is duplicating
// a bunch of fairly blobby logic for every click override on these objects.
-
/obj/screen/food/Click(var/location, var/control, var/params)
- if(istype(usr) && usr.nutrition_icon == src)
+ if(usr.get_hud_element(/decl/hud_element/condition/nutrition) == src)
switch(icon_state)
if("nutrition0")
to_chat(usr, SPAN_WARNING("You are completely stuffed."))
@@ -245,7 +76,7 @@
to_chat(usr, SPAN_DANGER("You are starving!"))
/obj/screen/drink/Click(var/location, var/control, var/params)
- if(istype(usr) && usr.hydration_icon == src)
+ if(usr.get_hud_element(/decl/hud_element/condition/hydration) == src)
switch(icon_state)
if("hydration0")
to_chat(usr, SPAN_WARNING("You are overhydrated."))
@@ -259,7 +90,7 @@
to_chat(usr, SPAN_DANGER("You are dying of thirst!"))
/obj/screen/bodytemp/Click(var/location, var/control, var/params)
- if(istype(usr) && usr.bodytemp == src)
+ if(usr.get_hud_element(/decl/hud_element/condition/bodytemp) == src)
switch(icon_state)
if("temp4")
to_chat(usr, SPAN_DANGER("You are being cooked alive!"))
@@ -281,7 +112,7 @@
to_chat(usr, SPAN_NOTICE("Your body is at a comfortable temperature."))
/obj/screen/pressure/Click(var/location, var/control, var/params)
- if(istype(usr) && usr.pressure == src)
+ if(usr.get_hud_element(/decl/hud_element/condition/pressure) == src)
switch(icon_state)
if("pressure2")
to_chat(usr, SPAN_DANGER("The air pressure here is crushing!"))
@@ -295,14 +126,14 @@
to_chat(usr, SPAN_NOTICE("The local air pressure is comfortable."))
/obj/screen/toxins/Click(var/location, var/control, var/params)
- if(istype(usr) && usr.toxin == src)
+ if(usr.get_hud_element(/decl/hud_element/condition/toxins) == src)
if(icon_state == "tox0")
to_chat(usr, SPAN_NOTICE("The air is clear of toxins."))
else
to_chat(usr, SPAN_DANGER("The air is eating away at your skin!"))
/obj/screen/oxygen/Click(var/location, var/control, var/params)
- if(istype(usr) && usr.oxygen == src)
+ if(usr.get_hud_element(/decl/hud_element/condition/oxygen) == src)
if(icon_state == "oxy0")
to_chat(usr, SPAN_NOTICE("You are breathing easy."))
else
diff --git a/code/_onclick/hud/other_mobs.dm b/code/_onclick/hud/other_mobs.dm
deleted file mode 100644
index 5b6b03616b45..000000000000
--- a/code/_onclick/hud/other_mobs.dm
+++ /dev/null
@@ -1,34 +0,0 @@
-/mob/living/simple_animal/construct
- hud_type = /datum/hud/construct
-
-/datum/hud/construct/FinalizeInstantiation()
- var/constructtype
-
- if(istype(mymob,/mob/living/simple_animal/construct/armoured) || istype(mymob,/mob/living/simple_animal/construct/behemoth))
- constructtype = "juggernaut"
- else if(istype(mymob,/mob/living/simple_animal/construct/builder))
- constructtype = "artificer"
- else if(istype(mymob,/mob/living/simple_animal/construct/wraith))
- constructtype = "wraith"
- else if(istype(mymob,/mob/living/simple_animal/construct/harvester))
- constructtype = "harvester"
-
- if(constructtype)
- mymob.fire = new /obj/screen()
- mymob.fire.icon = 'icons/mob/screen1_construct.dmi'
- mymob.fire.icon_state = "fire0"
- mymob.fire.SetName("fire")
- mymob.fire.screen_loc = ui_construct_fire
-
- mymob.healths = new /obj/screen()
- mymob.healths.icon = 'icons/mob/screen1_construct.dmi'
- mymob.healths.icon_state = "[constructtype]_health0"
- mymob.healths.SetName("health")
- mymob.healths.screen_loc = ui_construct_health
-
- mymob.zone_sel = new
- mymob.zone_sel.icon = 'icons/mob/screen1_construct.dmi'
- mymob.zone_sel.update_icon()
-
- mymob.client.screen = list()
- mymob.client.screen += list(mymob.fire, mymob.healths, mymob.zone_sel)
diff --git a/code/_onclick/hud/pai.dm b/code/_onclick/hud/pai.dm
index 8f305d4153c6..67058ed29c3d 100644
--- a/code/_onclick/hud/pai.dm
+++ b/code/_onclick/hud/pai.dm
@@ -1,30 +1,21 @@
/datum/hud/pai/FinalizeInstantiation()
- adding = list()
var/obj/screen/using
-
using = new /obj/screen/pai/software()
using.SetName("Software Interface")
- adding += using
-
+ misc_hud_elements += using
using = new /obj/screen/pai/subsystems()
using.SetName("Subsystems")
- adding += using
-
+ misc_hud_elements += using
using = new /obj/screen/pai/shell()
using.SetName("Toggle Chassis")
- adding += using
-
+ misc_hud_elements += using
using = new /obj/screen/pai/rest()
using.SetName("Rest")
- adding += using
-
+ misc_hud_elements += using
using = new /obj/screen/pai/light()
using.SetName("Toggle Light")
- adding += using
-
- mymob.client.screen = list()
- mymob.client.screen += adding
- hide_inventory()
+ misc_hud_elements += using
+ return ..()
/obj/screen/pai
icon = 'icons/mob/screen/pai.dmi'
diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm
index fe5be57d9564..addcf86cca6d 100644
--- a/code/_onclick/hud/robot.dm
+++ b/code/_onclick/hud/robot.dm
@@ -1,183 +1,153 @@
-var/global/obj/screen/robot_inventory
-
-/obj/screen/robot_drop_grab
- name = "drop grab"
- icon = 'icons/mob/screen1_robot.dmi'
- icon_state = "drop_grab"
+/mob/living/silicon/robot
+ var/obj/screen/hands
+ hud_used = /datum/hud/robot
+
+/decl/hud_element/condition/fire/robot
+ screen_icon = 'icons/mob/screen/robot_conditions.dmi'
+
+/decl/hud_element/condition/oxygen/robot
+ screen_icon = 'icons/mob/screen/robot_conditions.dmi'
+
+/decl/hud_element/condition/bodytemp/robot
+ screen_icon = 'icons/mob/screen/robot_conditions.dmi'
+
+/decl/hud_element/module
+ screen_name = "module"
+ screen_icon = 'icons/mob/screen/robot_modules.dmi'
+ screen_icon_state = "nomod"
+ screen_loc = ui_borg_module
+
+/decl/hud_element/radio
+ screen_name = "radio"
+ screen_icon_state = "radio"
+ screen_loc = ui_movi
+
+/decl/hud_element/radio/create_screen_object(datum/hud/hud)
+ var/obj/screen/elem = ..()
+ elem.set_dir(SOUTHWEST)
+ return elem
+
+/decl/hud_element/drop_grab
+ screen_name = "drop grab"
+ screen_object_type = /obj/screen/robot_drop_grab
+ screen_icon = 'icons/mob/screen/robot_drop_grab.dmi'
+ screen_icon_state = "drop_grab"
screen_loc = ui_borg_drop_grab
- invisibility = INVISIBILITY_MAXIMUM
- alpha = 0
+ update_in_life = TRUE
+
+/decl/hud_element/drop_grab/create_screen_object(datum/hud/hud)
+ var/obj/screen/elem = ..()
+ if(length(hud?.mymob?.get_active_grabs()))
+ elem.invisibility = 0
+ elem.alpha = 255
+ else
+ elem.invisibility = INVISIBILITY_MAXIMUM
+ elem.alpha = 0
+ return elem
+
+/decl/hud_element/drop_grab/refresh_screen_object(datum/hud/hud, obj/screen/elem, datum/gas_mixture/environment)
+ . = ..()
+ if(length(hud?.mymob?.get_active_grabs()))
+ elem.invisibility = 0
+ elem.alpha = 255
+ else
+ elem.invisibility = INVISIBILITY_MAXIMUM
+ elem.alpha = 0
/obj/screen/robot_drop_grab/Click(location, control, params)
. = ..()
- if(isrobot(usr) && !usr.incapacitated())
- var/mob/living/silicon/robot/R = usr
- R.drop_item()
- invisibility = INVISIBILITY_MAXIMUM
- alpha = 0
+ if(!isrobot(usr) || usr.incapacitated())
+ return
-/mob/living/silicon/robot
- hud_type = /datum/hud/robot
+ var/mob/living/silicon/robot/R = usr
+ R.drop_item()
+ invisibility = INVISIBILITY_MAXIMUM
+ alpha = 0
+
+/decl/hud_element/health/robot
+ screen_icon = 'icons/mob/screen/health_robot.dmi'
+ screen_loc = ui_borg_health
+
+/decl/hud_element/module_panel
+ screen_name = "panel"
+ screen_icon_state = "panel"
+ screen_loc = ui_borg_panel
+
+/decl/hud_element/robot_inventory
+ screen_name = "inventory"
+ screen_icon_state = "inventory"
+ screen_loc = ui_borg_inventory
+
+/datum/hud/robot
+ health_hud_type = /decl/hud_element/health/robot
+ hud_elements = list(
+ /decl/hud_element/health/robot,
+ /decl/hud_element/drop_grab,
+ /decl/hud_element/radio,
+ /decl/hud_element/module,
+ /decl/hud_element/module_panel,
+ /decl/hud_element/robot_inventory,
+ /decl/hud_element/condition/fire/robot,
+ /decl/hud_element/condition/oxygen/robot,
+ /decl/hud_element/condition/bodytemp/robot
+ )
+
+/datum/hud/robot/get_ui_color()
+ return COLOR_WHITE
+
+/datum/hud/robot/get_ui_alpha()
+ return 255
+
+/datum/hud/robot/get_ui_style()
+ return 'icons/mob/screen/robot.dmi'
/datum/hud/robot/FinalizeInstantiation()
if(!isrobot(mymob))
- return
+ return ..()
var/mob/living/silicon/robot/R = mymob
-
- adding = list()
- other = list()
-
var/obj/screen/using
-
- //Radio
- using = new /obj/screen()
- using.SetName("radio")
- using.set_dir(SOUTHWEST)
- using.icon = 'icons/mob/screen1_robot.dmi'
- using.icon_state = "radio"
- using.screen_loc = ui_movi
- adding += using
+ var/ui_style = get_ui_style()
//Module select
-
using = new /obj/screen()
using.SetName("module1")
using.set_dir(SOUTHWEST)
- using.icon = 'icons/mob/screen1_robot.dmi'
+ using.icon = ui_style
using.icon_state = "inv1"
using.screen_loc = ui_inv1
- adding += using
+ misc_hud_elements += using
R.inv1 = using
using = new /obj/screen()
using.SetName("module2")
using.set_dir(SOUTHWEST)
- using.icon = 'icons/mob/screen1_robot.dmi'
+ using.icon = ui_style
using.icon_state = "inv2"
using.screen_loc = ui_inv2
- adding += using
+ misc_hud_elements += using
R.inv2 = using
using = new /obj/screen()
using.SetName("module3")
using.set_dir(SOUTHWEST)
- using.icon = 'icons/mob/screen1_robot.dmi'
+ using.icon = ui_style
using.icon_state = "inv3"
using.screen_loc = ui_inv3
- adding += using
+ misc_hud_elements += using
R.inv3 = using
-
//End of module select
- // Drop UI
- R.ui_drop_grab = new
- adding += R.ui_drop_grab
-
- //Intent
- using = new /obj/screen()
- using.SetName("act_intent")
- using.set_dir(SOUTHWEST)
- using.icon = 'icons/mob/screen1_robot.dmi'
- using.icon_state = R.a_intent
- using.screen_loc = ui_acti
- adding += using
- action_intent = using
-
- //Cell
- R.cells = new /obj/screen()
- R.cells.icon = 'icons/mob/screen1_robot.dmi'
- R.cells.icon_state = "charge-empty"
- R.cells.SetName("cell")
- R.cells.screen_loc = ui_toxin
-
- //Health
- R.healths = new /obj/screen()
- R.healths.icon = 'icons/mob/screen1_robot.dmi'
- R.healths.icon_state = "health0"
- R.healths.SetName("health")
- R.healths.screen_loc = ui_borg_health
-
- //Installed Module
- R.hands = new /obj/screen()
- R.hands.icon = 'icons/mob/screen1_robot.dmi'
- R.hands.icon_state = "nomod"
- R.hands.SetName("module")
- R.hands.screen_loc = ui_borg_module
-
- //Module Panel
- using = new /obj/screen()
- using.SetName("panel")
- using.icon = 'icons/mob/screen1_robot.dmi'
- using.icon_state = "panel"
- using.screen_loc = ui_borg_panel
- adding += using
-
- //Store
- R.throw_icon = new /obj/screen()
- R.throw_icon.icon = 'icons/mob/screen1_robot.dmi'
- R.throw_icon.icon_state = "store"
- R.throw_icon.SetName("store")
- R.throw_icon.screen_loc = ui_borg_store
-
- //Inventory
- robot_inventory = new /obj/screen()
- robot_inventory.SetName("inventory")
- robot_inventory.icon = 'icons/mob/screen1_robot.dmi'
- robot_inventory.icon_state = "inventory"
- robot_inventory.screen_loc = ui_borg_inventory
-
- //Temp
- R.bodytemp = new /obj/screen()
- R.bodytemp.icon = 'icons/mob/status_indicators.dmi'
- R.bodytemp.icon_state = "temp0"
- R.bodytemp.SetName("body temperature")
- R.bodytemp.screen_loc = ui_temp
-
-
- R.oxygen = new /obj/screen()
- R.oxygen.icon = 'icons/mob/screen1_robot.dmi'
- R.oxygen.icon_state = "oxy0"
- R.oxygen.SetName("oxygen")
- R.oxygen.screen_loc = ui_oxygen
-
- R.fire = new /obj/screen()
- R.fire.icon = 'icons/mob/screen1_robot.dmi'
- R.fire.icon_state = "fire0"
- R.fire.SetName("fire")
- R.fire.screen_loc = ui_fire
-
- R.up_hint = new /obj/screen()
- R.up_hint.icon = 'icons/mob/screen1_robot.dmi'
- R.up_hint.icon_state = "uphint0"
- R.up_hint.SetName("up hint")
- R.up_hint.screen_loc = ui_up_hint
-
- R.zone_sel = new
- R.zone_sel.icon = 'icons/mob/screen1_robot.dmi'
- R.zone_sel.update_icon()
-
- //Handle the gun settings buttons
- R.gun_setting_icon = new /obj/screen/gun/mode(null)
- R.item_use_icon = new /obj/screen/gun/item(null)
- R.gun_move_icon = new /obj/screen/gun/move(null)
- R.radio_use_icon = new /obj/screen/gun/radio(null)
-
- R.client.screen = list()
- R.client.screen += list(R.throw_icon, R.zone_sel, R.oxygen, R.fire, R.up_hint, R.hands, R.healths, R.cells, robot_inventory, R.gun_setting_icon)
- R.client.screen += adding + other
+ return ..()
/datum/hud/proc/toggle_show_robot_modules()
if(!isrobot(mymob))
return
-
var/mob/living/silicon/robot/r = mymob
-
r.shown_robot_modules = !r.shown_robot_modules
update_robot_modules_display()
-
/datum/hud/proc/update_robot_modules_display()
if(!isrobot(mymob) || !mymob.client)
return
@@ -187,8 +157,6 @@ var/global/obj/screen/robot_inventory
if(R.shown_robot_modules)
if(R.active_storage)
R.active_storage.close(R) //Closes the inventory ui.
- //Modules display is shown
- //R.client.screen += robot_inventory //"store" icon
if(!R.module)
to_chat(usr, "No module selected")
@@ -235,7 +203,6 @@ var/global/obj/screen/robot_inventory
else
//Modules display is hidden
- //R.client.screen -= robot_inventory //"store" icon
for(var/atom/A in R.module.equipment)
if( (A != R.module_state_1) && (A != R.module_state_2) && (A != R.module_state_3) )
//Module is not currently active
diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm
index f7d564949e37..d9df9bac31f5 100644
--- a/code/_onclick/hud/screen_objects.dm
+++ b/code/_onclick/hud/screen_objects.dm
@@ -8,7 +8,7 @@
*/
/obj/screen
name = ""
- icon = 'icons/mob/screen1.dmi'
+ icon = 'icons/mob/screen/midnight.dmi'
plane = HUD_PLANE
layer = HUD_BASE_LAYER
appearance_flags = NO_CLIENT_COLOR
@@ -72,10 +72,7 @@
return TRUE
/obj/screen/default_attack_selector/Destroy()
- if(owner)
- if(owner.attack_selector == src)
- owner.attack_selector = null
- owner = null
+ owner = null
. = ..()
/obj/screen/default_attack_selector/proc/set_owner(var/mob/living/carbon/human/_owner)
@@ -131,6 +128,10 @@
screen_loc = ui_zonesel
var/selecting = BP_CHEST
+/obj/screen/zone_selector/Initialize(mapload)
+ . = ..()
+ update_icon()
+
/obj/screen/zone_selector/Click(location, control,params)
var/list/PL = params2list(params)
var/icon_x = text2num(PL["icon-x"])
@@ -206,42 +207,20 @@
/obj/screen/zone_selector/on_update_icon()
set_overlays(image('icons/mob/zone_sel.dmi', "[selecting]"))
-
-/obj/screen/intent
- name = "intent"
- icon = 'icons/mob/screen/white.dmi'
- icon_state = "intent_help"
- screen_loc = ui_acti
- var/intent = I_HELP
-
-/obj/screen/intent/Click(var/location, var/control, var/params)
- var/list/P = params2list(params)
- var/icon_x = text2num(P["icon-x"])
- var/icon_y = text2num(P["icon-y"])
- intent = I_DISARM
- if(icon_x <= world.icon_size/2)
- if(icon_y <= world.icon_size/2)
- intent = I_HURT
- else
- intent = I_HELP
- else if(icon_y <= world.icon_size/2)
- intent = I_GRAB
- update_icon()
- usr.a_intent = intent
-
-/obj/screen/intent/on_update_icon()
- icon_state = "intent_[intent]"
+ compile_overlays()
/obj/screen/Click(location, control, params)
- if(!usr) return 1
+ if(!usr?.client)
+ return 1
switch(name)
if("toggle")
if(usr.hud_used.inventory_shown)
- usr.client.screen -= usr.hud_used.other
+ usr.client.screen -= usr.hud_used.hidable_hud_elements
usr.hud_used.hide_inventory()
else
- usr.client.screen += usr.hud_used.other
+ if(length(usr.hud_used.hidable_hud_elements))
+ usr.client.screen |= usr.hud_used.hidable_hud_elements
usr.hud_used.show_inventory()
if("equip")
@@ -267,9 +246,6 @@
var/mob/living/M = usr
M.ui_toggle_internals()
- if("act_intent")
- usr.a_intent_change("right")
-
if("throw")
if(!usr.stat && isturf(usr.loc) && !usr.restrained())
usr.toggle_throw_mode()
diff --git a/code/game/machinery/oxygen_pump.dm b/code/game/machinery/oxygen_pump.dm
index ccd515bcfe8c..45f66bcab2b2 100644
--- a/code/game/machinery/oxygen_pump.dm
+++ b/code/game/machinery/oxygen_pump.dm
@@ -89,8 +89,9 @@
visible_message(SPAN_NOTICE("\The [user] detaches \the [contained] and it rapidly retracts back into \the [src]!"))
else
visible_message(SPAN_NOTICE("\The [contained] rapidly retracts back into \the [src]!"))
- if(breather.internals)
- breather.internals.icon_state = "internal0"
+ var/obj/screen/internals = breather?.get_hud_element(/decl/hud_element/internals)
+ if(internals)
+ internals.icon_state = "internal0"
breather = null
update_use_power(POWER_USE_IDLE)
diff --git a/code/game/objects/effects/bump_teleporter.dm b/code/game/objects/effects/bump_teleporter.dm
index 0e0ad490e074..f1d915af67f3 100644
--- a/code/game/objects/effects/bump_teleporter.dm
+++ b/code/game/objects/effects/bump_teleporter.dm
@@ -2,7 +2,7 @@ var/global/list/BUMP_TELEPORTERS = list()
/obj/effect/bump_teleporter
name = "bump-teleporter"
- icon = 'icons/mob/screen1.dmi'
+ icon = 'icons/mob/screen/crosses.dmi'
icon_state = "x2"
var/id = null //id of this bump_teleporter.
var/id_target = null //id of bump_teleporter which this moves you to.
diff --git a/code/game/objects/effects/decals/misc.dm b/code/game/objects/effects/decals/misc.dm
index 0af5221fd2d9..e56b075206b8 100644
--- a/code/game/objects/effects/decals/misc.dm
+++ b/code/game/objects/effects/decals/misc.dm
@@ -1,7 +1,7 @@
/obj/effect/decal/point
name = "arrow"
desc = "It's an arrow hanging in mid-air. There may be a wizard about."
- icon = 'icons/mob/screen1.dmi'
+ icon = 'icons/mob/screen/arrow.dmi'
icon_state = "arrow"
layer = POINTER_LAYER
anchored = TRUE
diff --git a/code/game/objects/effects/landmarks.dm b/code/game/objects/effects/landmarks.dm
index 927e1d7f4783..29d954e58cf3 100644
--- a/code/game/objects/effects/landmarks.dm
+++ b/code/game/objects/effects/landmarks.dm
@@ -18,7 +18,7 @@
/obj/abstract/landmark/start
name = "start"
- icon = 'icons/mob/screen1.dmi'
+ icon = 'icons/mob/screen/crosses.dmi'
icon_state = "x"
anchored = TRUE
invisibility = 101
diff --git a/code/game/objects/effects/manifest.dm b/code/game/objects/effects/manifest.dm
index 023b92f552d6..55c0a4ede7a6 100644
--- a/code/game/objects/effects/manifest.dm
+++ b/code/game/objects/effects/manifest.dm
@@ -1,6 +1,6 @@
/obj/effect/manifest
name = "manifest"
- icon = 'icons/mob/screen1.dmi'
+ icon = 'icons/mob/screen/crosses.dmi'
icon_state = "x"
unacidable = 1//Just to be sure.
diff --git a/code/game/objects/effects/spawners/bombspawner.dm b/code/game/objects/effects/spawners/bombspawner.dm
index e3e71c4accf1..84f31a338621 100644
--- a/code/game/objects/effects/spawners/bombspawner.dm
+++ b/code/game/objects/effects/spawners/bombspawner.dm
@@ -20,7 +20,7 @@
/obj/effect/spawner/newbomb
name = "TTV bomb"
- icon = 'icons/mob/screen1.dmi'
+ icon = 'icons/mob/screen/crosses.dmi'
icon_state = "x"
var/filler_type = /decl/material/gas/carbon_dioxide
@@ -102,7 +102,7 @@
/obj/effect/spawner/onetankbomb
name = "Single-tank bomb"
- icon = 'icons/mob/screen1.dmi'
+ icon = 'icons/mob/screen/crosses.dmi'
icon_state = "x"
/obj/effect/spawner/onetankbomb/Initialize()
diff --git a/code/game/objects/item.dm b/code/game/objects/item.dm
index 7478d6fc66b6..ddb875f041ed 100644
--- a/code/game/objects/item.dm
+++ b/code/game/objects/item.dm
@@ -640,7 +640,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
return
if(user.hud_used.hud_shown)
- user.toggle_zoom_hud() // If the user has already limited their HUD this avoids them having a HUD when they zoom in
+ user.minimize_hud(zoom = TRUE) // If the user has already limited their HUD this avoids them having a HUD when they zoom in
user.client.view = viewsize
zoom = 1
@@ -688,7 +688,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
user.client.view = world.view
if(!user.hud_used.hud_shown)
- user.toggle_zoom_hud()
+ user.minimize_hud(zoom = TRUE)
user.client.pixel_x = 0
user.client.pixel_y = 0
user.client.OnResize()
diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm
index ee950f3b5c7f..14483d7ac6c1 100644
--- a/code/game/objects/items/robot/robot_items.dm
+++ b/code/game/objects/items/robot/robot_items.dm
@@ -17,7 +17,7 @@
icon = 'icons/obj/decals.dmi'
icon_state = "securearea"
var/sight_mode = null
- var/hud_type
+ var/borg_hud_type
/obj/item/borg/sight/xray
@@ -51,7 +51,7 @@
name = "medical hud"
icon_state = ICON_STATE_WORLD
icon = 'icons/clothing/eyes/hud_medical.dmi'
- hud_type = HUD_MEDICAL
+ borg_hud_type = HUD_MEDICAL
/obj/item/borg/sight/hud/med/Initialize()
. = ..()
@@ -61,7 +61,7 @@
name = "security hud"
icon_state = ICON_STATE_WORLD
icon = 'icons/clothing/eyes/hud_security.dmi'
- hud_type = HUD_SECURITY
+ borg_hud_type = HUD_SECURITY
/obj/item/borg/sight/hud/Initialize()
. = ..()
@@ -72,7 +72,7 @@
name = "janitor hud"
icon_state = ICON_STATE_WORLD
icon = 'icons/clothing/eyes/hud_janitor.dmi'
- hud_type = HUD_JANITOR
+ borg_hud_type = HUD_JANITOR
/obj/item/borg/sight/hud/jani/Initialize()
. = ..()
diff --git a/code/game/objects/items/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm
index ab1c8cef79ac..29ef62f8c49e 100644
--- a/code/game/objects/items/robot/robot_upgrades.dm
+++ b/code/game/objects/items/robot/robot_upgrades.dm
@@ -194,18 +194,18 @@
origin_tech = "{'materials':2,'engineering':3,'programming':3,'magnets':3}"
/obj/item/borg/upgrade/jetpack/action(var/mob/living/silicon/robot/R)
- if(..()) return 0
+ if(..())
+ return FALSE
if(!R.module || !(type in R.module.supported_upgrades))
to_chat(R, "Upgrade mounting error! No suitable hardpoint detected!")
to_chat(usr, "There's no mounting point for the module!")
- return 0
- else
- R.module.equipment += new/obj/item/tank/jetpack/carbondioxide
- for(var/obj/item/tank/jetpack/carbondioxide in R.module.equipment)
- R.internals = src
- //R.icon_state="Miner+j"
- return 1
+ return FALSE
+
+ var/jetpack = new /obj/item/tank/jetpack/carbondioxide(R.module)
+ R.module.equipment += jetpack
+ R.set_internals(jetpack)
+ return TRUE
/obj/item/borg/upgrade/rcd
name = "engineering robot RCD"
diff --git a/code/modules/admin/admin_attack_log.dm b/code/modules/admin/admin_attack_log.dm
index 6367b996d3c8..a55de2390de3 100644
--- a/code/modules/admin/admin_attack_log.dm
+++ b/code/modules/admin/admin_attack_log.dm
@@ -51,8 +51,7 @@
var/target_zone = "(ZONE_SEL: N/A)"
if(attacker)
intent = "(INTENT: [uppertext(attacker.a_intent)])"
- if (attacker.get_target_zone())
- target_zone = "(ZONE_SEL: [uppertext(attacker.get_target_zone())])"
+ target_zone = "(ZONE_SEL: [uppertext(attacker.get_target_zone())])"
if(victim)
attacker.attack_logs_ += text("\[[time_stamp()]\] [key_name(victim)] - [attacker_message] [intent] [target_zone]")
else
diff --git a/code/modules/awaymissions/loot.dm b/code/modules/awaymissions/loot.dm
index d2ebad954c97..bc91c3c46ac1 100644
--- a/code/modules/awaymissions/loot.dm
+++ b/code/modules/awaymissions/loot.dm
@@ -1,5 +1,5 @@
/obj/effect/spawner/lootdrop
- icon = 'icons/mob/screen1.dmi'
+ icon = 'icons/mob/screen/crosses.dmi'
icon_state = "x2"
var/lootcount = 1 //how many items will be spawned
var/lootdoubles = 0 //if the same item can be spawned twice
diff --git a/code/modules/blob/blob.dm b/code/modules/blob/blob.dm
index 891ff0db5d74..8a74ca6fca31 100644
--- a/code/modules/blob/blob.dm
+++ b/code/modules/blob/blob.dm
@@ -36,6 +36,9 @@
STOP_PROCESSING(SSblob, src)
. = ..()
+/obj/effect/blob/proc/get_max_health()
+ return blob_max_health
+
/obj/effect/blob/CanPass(var/atom/movable/mover, var/turf/target, var/height = 0, var/air_group = 0)
if(air_group || height == 0)
return 1
@@ -210,7 +213,7 @@
var/times_to_pulse = 0
/obj/effect/blob/core/proc/get_health_percent()
- return ((health / blob_max_health) * 100)
+ return ((health / get_max_health()) * 100)
/*
the master core becomes more vulnereable to damage as it weakens,
@@ -294,7 +297,7 @@ regen() will cover update_icon() for this proc
return
/obj/effect/blob/core/secondary/on_update_icon()
- icon_state = (health / blob_max_health >= 0.5) ? "blob_node" : "blob_factory"
+ icon_state = (health / get_max_health() >= 0.5) ? "blob_node" : "blob_factory"
/obj/effect/blob/shield
name = "shielding mass"
@@ -318,9 +321,10 @@ regen() will cover update_icon() for this proc
return ..()
/obj/effect/blob/shield/on_update_icon()
- if(health > blob_max_health * 2 / 3)
+ var/max_health = get_max_health()
+ if(health > max_health * 2 / 3)
icon_state = "blob_idle"
- else if(health > blob_max_health / 3)
+ else if(health > max_health / 3)
icon_state = "blob"
else
icon_state = "blob_damaged"
diff --git a/code/modules/client/ui_style.dm b/code/modules/client/ui_style.dm
index f20646370b6a..6b0c4c5f47e7 100644
--- a/code/modules/client/ui_style.dm
+++ b/code/modules/client/ui_style.dm
@@ -29,6 +29,9 @@ var/global/all_tooltip_styles = list(
set desc = "Configure your user interface"
set category = "OOC"
+ if(!mob.hud_used)
+ return
+
if(!ishuman(mob))
to_chat(src, SPAN_WARNING("You must be human to use this verb."))
return
@@ -47,18 +50,15 @@ var/global/all_tooltip_styles = list(
UI_style_alpha_new = clamp(UI_style_alpha_new, 50, 255)
- var/list/icons = mob.hud_used.adding + mob.hud_used.other + mob.hud_used.hotkeybuttons
-
- icons.Add(
- mob.zone_sel,
- mob.gun_setting_icon,
- mob.item_use_icon,
- mob.gun_move_icon,
- mob.radio_use_icon
- )
+ var/list/icons = list()
+ if(length(mob.hud_used.misc_hud_elements))
+ icons |= mob.hud_used.misc_hud_elements
+ if(length(mob.hud_used.hidable_hud_elements))
+ icons |= mob.hud_used.hidable_hud_elements
+ if(length(mob.hud_used.hotkey_hud_elements))
+ icons |= mob.hud_used.hotkey_hud_elements
var/icon/UI_style_icon_new = all_ui_styles[UI_style_new]
-
apply_ui_style(icons, UI_style_icon_new, UI_style_color_new, UI_style_alpha_new)
if(alert("Like it? Save changes?",,"Yes", "No") == "Yes")
diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm
index 967570ce45d6..339297c0eec5 100644
--- a/code/modules/clothing/glasses/_glasses.dm
+++ b/code/modules/clothing/glasses/_glasses.dm
@@ -17,7 +17,7 @@
var/active = TRUE
var/electric = FALSE //if the glasses should be disrupted by EMP
- var/hud_type
+ var/glasses_hud_type
var/obj/screen/overlay
var/obj/item/clothing/glasses/hud/hud // Hud glasses, if any
var/activation_sound = 'sound/items/goggles_charge.ogg'
diff --git a/code/modules/clothing/glasses/eyepatch.dm b/code/modules/clothing/glasses/eyepatch.dm
index e660806e6033..52c63948adaa 100644
--- a/code/modules/clothing/glasses/eyepatch.dm
+++ b/code/modules/clothing/glasses/eyepatch.dm
@@ -90,7 +90,7 @@
/obj/item/clothing/glasses/eyepatch/hud/science
name = "SCIpatch"
desc = "A Science-type heads-up display that connects directly to the ocular nerve of the user, replacing the need for that useless eyeball."
- hud_type = HUD_SCIENCE
+ glasses_hud_type = HUD_SCIENCE
eye_color = COLOR_PINK
/obj/item/clothing/glasses/eyepatch/hud/meson/Initialize()
diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm
index 2766c94ee05b..35b023ef2b16 100644
--- a/code/modules/clothing/glasses/glasses.dm
+++ b/code/modules/clothing/glasses/glasses.dm
@@ -24,7 +24,7 @@
name = "science goggles"
desc = "Goggles fitted with a portable analyzer capable of determining the fabricator training potential of an item or components of a machine. Sensitive to EMP."
icon = 'icons/clothing/eyes/goggles_science.dmi'
- hud_type = HUD_SCIENCE
+ glasses_hud_type = HUD_SCIENCE
toggleable = TRUE
electric = TRUE
anomaly_shielding = 0.1
diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm
index 4a4b6dc75a49..cc5acc5c08ef 100644
--- a/code/modules/clothing/glasses/hud.dm
+++ b/code/modules/clothing/glasses/hud.dm
@@ -33,7 +33,7 @@
name = "health scanner HUD"
desc = "A heads-up display that scans the humans in view and provides accurate data about their health status."
icon = 'icons/clothing/eyes/hud_medical.dmi'
- hud_type = HUD_MEDICAL
+ glasses_hud_type = HUD_MEDICAL
body_parts_covered = 0
/obj/item/clothing/glasses/hud/health/process_hud(var/mob/M)
@@ -55,7 +55,7 @@
name = "security HUD"
desc = "A heads-up display that scans the humans in view and provides accurate data about their ID status and security records."
icon = 'icons/clothing/eyes/hud_security.dmi'
- hud_type = HUD_SECURITY
+ glasses_hud_type = HUD_SECURITY
body_parts_covered = 0
/obj/item/clothing/glasses/hud/security/prescription
@@ -82,7 +82,7 @@
desc = "A heads-up display that scans for messes and alerts the user. Good for finding puddles hiding under catwalks."
icon = 'icons/clothing/eyes/hud_janitor.dmi'
body_parts_covered = 0
- hud_type = HUD_JANITOR
+ glasses_hud_type = HUD_JANITOR
/obj/item/clothing/glasses/hud/janitor/prescription
name = "prescription janiHUD"
diff --git a/code/modules/materials/definitions/gasses/material_gas_mundane.dm b/code/modules/materials/definitions/gasses/material_gas_mundane.dm
index a4bc989ec7cf..4d55d71770c6 100644
--- a/code/modules/materials/definitions/gasses/material_gas_mundane.dm
+++ b/code/modules/materials/definitions/gasses/material_gas_mundane.dm
@@ -68,20 +68,12 @@
warning_message = pick("extremely dizzy","short of breath","faint","confused")
warning_prob = 15
M.adjustOxyLoss(10,20)
- if(istype(H))
- H.co2_alert = 1
else if(dosage >= 1.5)
warning_message = pick("dizzy","short of breath","faint","momentarily confused")
M.adjustOxyLoss(3,5)
- if(istype(H))
- H.co2_alert = 1
else if(dosage >= 0.25)
warning_message = pick("a little dizzy","short of breath")
warning_prob = 10
- if(istype(H))
- H.co2_alert = 0
- else if(istype(H))
- H.co2_alert = 0
if(istype(H) && dosage > 1 && H.ticks_since_last_successful_breath < 15)
H.ticks_since_last_successful_breath++
if(warning_message && prob(warning_prob))
diff --git a/code/modules/mechs/interface/_interface.dm b/code/modules/mechs/interface/_interface.dm
index d2ac63b44397..45945a7b49a7 100644
--- a/code/modules/mechs/interface/_interface.dm
+++ b/code/modules/mechs/interface/_interface.dm
@@ -23,7 +23,7 @@
client.screen |= hud_elements
/mob/living/exosuit/InitializeHud()
- zone_sel = new
+
if(!LAZYLEN(hud_elements))
var/i = 1
for(var/hardpoint in hardpoints)
diff --git a/code/modules/mechs/mech.dm b/code/modules/mechs/mech.dm
index 4dd14a1f36e5..d98a6d93763f 100644
--- a/code/modules/mechs/mech.dm
+++ b/code/modules/mechs/mech.dm
@@ -21,6 +21,7 @@
bone_material = null
bone_amount = 0
+ var/zone_tracker
var/emp_damage = 0
var/obj/item/radio/exosuit/radio
@@ -67,6 +68,7 @@
// Interface stuff.
var/list/hud_elements = list()
var/list/hardpoint_hud_elements = list()
+ // TODO: /datum/hud/exosuit
var/obj/screen/exosuit/health/hud_health
var/obj/screen/exosuit/toggle/hatch_open/hud_open
var/obj/screen/exosuit/power/hud_power
diff --git a/code/modules/mechs/mech_interaction.dm b/code/modules/mechs/mech_interaction.dm
index 85e19c45302a..9361de6fcaa7 100644
--- a/code/modules/mechs/mech_interaction.dm
+++ b/code/modules/mechs/mech_interaction.dm
@@ -89,6 +89,15 @@
/mob/living/exosuit/get_dexterity(var/silent = FALSE)
return DEXTERITY_FULL
+// Override as mechs will usually not have clients and therefore not have HUDs.
+/mob/living/exosuit/get_target_zone()
+ if(!istype(hud_used))
+ return
+ var/obj/screen/zone_selector/zone_selector = get_hud_element(/decl/hud_element/zone_selector)
+ if(istype(zone_selector))
+ return zone_selector.selecting
+ return zone_tracker
+
/mob/living/exosuit/ClickOn(var/atom/A, var/params, var/mob/user)
if(!user || incapacitated() || user.incapacitated())
@@ -134,10 +143,13 @@
// User is not necessarily the exosuit, or the same person, so update intent.
if(user != src)
a_intent = user.a_intent
- if(user.zone_sel)
- zone_sel.set_selected_zone(user.get_target_zone())
+ var/obj/screen/zone_selector/zone_selector = get_hud_element(/decl/hud_element/zone_selector)
+ var/set_zone = user.get_target_zone() || BP_CHEST
+ if(istype(zone_selector))
+ zone_selector.set_selected_zone(set_zone)
else
- zone_sel.set_selected_zone(BP_CHEST)
+ zone_tracker = set_zone
+
// You may attack the target with your exosuit FIST if you're malfunctioning.
var/atom/movable/AM = A
var/fail_prob = (user != src && istype(AM) && AM.loc != src) ? (user.skill_check(SKILL_MECH, HAS_PERK) ? 0: 15 ) : 0
diff --git a/code/modules/mechs/mech_movement.dm b/code/modules/mechs/mech_movement.dm
index a711b680ae9b..50a98bec63fa 100644
--- a/code/modules/mechs/mech_movement.dm
+++ b/code/modules/mechs/mech_movement.dm
@@ -14,10 +14,10 @@
var/turf/B = GetAbove(src)
- for(var/thing in pilots)
- var/mob/pilot = thing
- if(pilot.up_hint)
- pilot.up_hint.icon_state = "uphint[!!(B && TURF_IS_MIMICKING(B))]"
+ for(var/mob/pilot in pilots)
+ var/obj/screen/up_hint = pilot.get_hud_element(/decl/hud_element/up_hint)
+ if(up_hint)
+ up_hint.icon_state = "uphint[!!(B && TURF_IS_MIMICKING(B))]"
/mob/living/exosuit/can_ztravel()
if(Process_Spacemove(1)) //Handle here
diff --git a/code/modules/mob/death.dm b/code/modules/mob/death.dm
index a4e35d992c36..c0e59394a276 100644
--- a/code/modules/mob/death.dm
+++ b/code/modules/mob/death.dm
@@ -79,14 +79,8 @@
SSstatistics.report_death(src)
- //TODO: Change death state to health_dead for all these icon files. This is a stop gap.
- if(healths)
- healths.overlays.Cut() // This is specific to humans but the relevant code is here; shouldn't mess with other mobs.
- if("health7" in icon_states(healths.icon))
- healths.icon_state = "health7"
- else
- healths.icon_state = "health6"
- log_debug("[src] ([src.type]) died but does not have a valid health7 icon_state (using health6 instead). report this error to Ccomp5950 or your nearest Developer")
+ if(hud_used)
+ hud_used.update_icons()
timeofdeath = world.time
if(mind)
diff --git a/code/modules/mob/examine.dm b/code/modules/mob/examine.dm
index 2e87af745fba..b7748a949179 100644
--- a/code/modules/mob/examine.dm
+++ b/code/modules/mob/examine.dm
@@ -60,9 +60,10 @@
to_chat(user, "")
// Update our target dolly.
- if(user.zone_sel)
+ var/obj/screen/zone_selector = user.get_hud_element(/decl/hud_element/zone_selector)
+ if(zone_selector)
var/decl/bodytype/target_bodytype = get_bodytype()
if(target_bodytype && (BP_TAIL in target_bodytype.has_limbs))
- user.zone_sel.icon_state = "zone_sel_tail"
+ zone_selector.icon_state = "zone_sel_tail"
else
- user.zone_sel.icon_state = "zone_sel"
+ zone_selector.icon_state = "zone_sel"
diff --git a/code/modules/mob/grab/grab_object.dm b/code/modules/mob/grab/grab_object.dm
index ee3eb7de7fe6..7bdffbc5bc9f 100644
--- a/code/modules/mob/grab/grab_object.dm
+++ b/code/modules/mob/grab/grab_object.dm
@@ -54,8 +54,9 @@
update_icon()
events_repository.register(/decl/observ/moved, affecting, src, .proc/on_affecting_move)
- if(assailant.zone_sel)
- events_repository.register(/decl/observ/zone_selected, assailant.zone_sel, src, .proc/on_target_change)
+ var/obj/screen/zone_selector = assailant.get_hud_element(/decl/hud_element/zone_selector)
+ if(zone_selector)
+ events_repository.register(/decl/observ/zone_selected, zone_selector, src, .proc/on_target_change)
var/obj/item/organ/O = get_targeted_organ()
var/decl/pronouns/G = assailant.get_pronouns()
@@ -129,8 +130,9 @@
affecting.reset_plane_and_layer()
affecting = null
if(assailant)
- if(assailant.zone_sel)
- events_repository.unregister(/decl/observ/zone_selected, assailant.zone_sel, src)
+ var/obj/screen/zone_selector = assailant.get_hud_element(/decl/hud_element/zone_selector)
+ if(zone_selector)
+ events_repository.unregister(/decl/observ/zone_selected, zone_selector, src)
assailant = null
. = ..()
if(old_affecting)
diff --git a/code/modules/mob/grab/normal/grab_normal.dm b/code/modules/mob/grab/normal/grab_normal.dm
index 0bcdc241be97..03ac58d1bbec 100644
--- a/code/modules/mob/grab/normal/grab_normal.dm
+++ b/code/modules/mob/grab/normal/grab_normal.dm
@@ -1,6 +1,6 @@
/decl/grab/normal
name = "grab"
- icon = 'icons/mob/screen1.dmi'
+ icon = 'icons/mob/screen/grabs.dmi'
help_action = "inspect"
disarm_action = "pin"
grab_action = "jointlock"
diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm
index a7ebea83eca5..c2a3e97999c8 100644
--- a/code/modules/mob/living/bot/bot.dm
+++ b/code/modules/mob/living/bot/bot.dm
@@ -54,6 +54,7 @@
access_scanner = new /obj(src)
access_scanner.req_access = req_access?.Copy()
+
if(on)
turn_on() // Update lights and other stuff
else
diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm
index 04a3e3223680..8224dafcaed3 100644
--- a/code/modules/mob/living/carbon/alien/life.dm
+++ b/code/modules/mob/living/carbon/alien/life.dm
@@ -46,54 +46,14 @@
update_icon()
return TRUE
-/mob/living/carbon/alien/handle_regular_hud_updates()
- . = ..()
- if(!.)
- return
- update_sight()
- if (healths)
- if(stat != DEAD)
- switch(current_health)
- if(100 to INFINITY)
- healths.icon_state = "health0"
- if(80 to 100)
- healths.icon_state = "health1"
- if(60 to 80)
- healths.icon_state = "health2"
- if(40 to 60)
- healths.icon_state = "health3"
- if(20 to 40)
- healths.icon_state = "health4"
- if(0 to 20)
- healths.icon_state = "health5"
- else
- healths.icon_state = "health6"
- else
- healths.icon_state = "health7"
-
- if(stat != DEAD)
- if(is_blind())
- overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
- else
- clear_fullscreen("blind")
- set_fullscreen(disabilities & NEARSIGHTED, "impaired", /obj/screen/fullscreen/impaired, 1)
- set_fullscreen(GET_STATUS(src, STAT_BLURRY), "blurry", /obj/screen/fullscreen/blurry)
- set_fullscreen(GET_STATUS(src, STAT_DRUGGY), "high", /obj/screen/fullscreen/high)
- if(machine)
- if(machine.check_eye(src) < 0)
- reset_view(null)
-
/mob/living/carbon/alien/handle_environment(var/datum/gas_mixture/environment)
..()
// Both alien subtypes survive in vaccum and suffer in high temperatures,
// so I'll just define this once, for both (see radiation comment above)
if(environment && environment.temperature > (T0C+66))
adjustFireLoss((environment.temperature - (T0C+66))/5) // Might be too high, check in testing.
- if (fire) fire.icon_state = "fire2"
if(prob(20))
to_chat(src, "You feel a searing heat!")
- else
- if (fire) fire.icon_state = "fire0"
/mob/living/carbon/alien/handle_fire()
if(..())
diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm
index c38a51ff930d..e69d66c6b225 100644
--- a/code/modules/mob/living/carbon/brain/life.dm
+++ b/code/modules/mob/living/carbon/brain/life.dm
@@ -75,91 +75,5 @@
if(!. || stat == DEAD || !emp_damage || !container)
return
- //Handling EMP effect in the Life(), it's made VERY simply, and has some additional effects handled elsewhere
- //This is pretty much a damage type only used by MMIs, dished out by the emp_act
- emp_damage = round(emp_damage,1)//Let's have some nice numbers to work with
- switch(emp_damage)
- if(31 to INFINITY)
- emp_damage = 30//Let's not overdo it
- if(21 to 30)//High level of EMP damage, unable to see, hear, or speak
- SET_STATUS_MAX(src, STAT_BLIND, 2)
- SET_STATUS_MAX(src, STAT_DEAF, 1)
- set_status(STAT_SILENCE, 1)
- if(!alert)//Sounds an alarm, but only once per 'level'
- emote("alarm")
- to_chat(src, SPAN_WARNING("Major electrical distruption detected: System rebooting."))
- alert = 1
- if(prob(75))
- emp_damage -= 1
- if(20)
- alert = 0
- set_status(STAT_BLIND, 0)
- set_status(STAT_DEAF, 0)
- set_status(STAT_SILENCE, 0)
- emp_damage -= 1
- if(11 to 19)//Moderate level of EMP damage, resulting in nearsightedness and ear damage
- set_status(STAT_BLURRY, 1)
- set_status(STAT_TINNITUS, 1)
- if(!alert)
- emote("alert")
- to_chat(src, SPAN_WARNING("Primary systems are now online."))
- alert = 1
- if(prob(50))
- emp_damage -= 1
- if(10)
- alert = 0
- set_status(STAT_BLURRY, 0)
- set_status(STAT_TINNITUS, 0)
- emp_damage -= 1
- if(2 to 9)//Low level of EMP damage, has few effects(handled elsewhere)
- if(!alert)
- emote("notice")
- to_chat(src, SPAN_WARNING("System reboot nearly complete."))
- alert = 1
- if(prob(25))
- emp_damage -= 1
- if(1)
- alert = 0
- to_chat(src, SPAN_WARNING("All systems restored."))
- emp_damage -= 1
-
-/mob/living/carbon/brain/handle_regular_hud_updates()
- . = ..()
- if(!.)
- return
- update_sight()
- if (healths)
- if (stat != DEAD)
- switch(current_health)
- if(100 to INFINITY)
- healths.icon_state = "health0"
- if(80 to 100)
- healths.icon_state = "health1"
- if(60 to 80)
- healths.icon_state = "health2"
- if(40 to 60)
- healths.icon_state = "health3"
- if(20 to 40)
- healths.icon_state = "health4"
- if(0 to 20)
- healths.icon_state = "health5"
- else
- healths.icon_state = "health6"
- else
- healths.icon_state = "health7"
-
- if(stat != DEAD)
- if(is_blind())
- overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
- else
- clear_fullscreen("blind")
- set_fullscreen(disabilities & NEARSIGHTED, "impaired", /obj/screen/fullscreen/impaired, 1)
- set_fullscreen(GET_STATUS(src, STAT_BLURRY), "blurry", /obj/screen/fullscreen/blurry)
- set_fullscreen(GET_STATUS(src, STAT_DRUGGY), "high", /obj/screen/fullscreen/high)
- if (machine)
- if (!( machine.check_eye(src) ))
- reset_view(null)
- return 1
-
/mob/living/carbon/brain/can_change_intent()
return TRUE
diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm
index b68d1e52ac02..bdb626d77792 100644
--- a/code/modules/mob/living/carbon/human/examine.dm
+++ b/code/modules/mob/living/carbon/human/examine.dm
@@ -243,14 +243,14 @@
var/obj/item/clothing/glasses/G = get_equipped_item(slot_glasses_str)
if(!istype(G))
return
- if(G.hud_type & hudtype)
+ if(G.glasses_hud_type & hudtype)
return G
- if(G.hud && (G.hud.hud_type & hudtype))
+ if(G.hud && (G.hud.glasses_hud_type & hudtype))
return G.hud
/mob/living/silicon/robot/getHUDsource(hudtype)
for(var/obj/item/borg/sight/sight in list(module_state_1, module_state_2, module_state_3))
- if(istype(sight) && (sight.hud_type & hudtype))
+ if(istype(sight) && (sight.borg_hud_type & hudtype))
return sight
//Gets the computer network M's source of hudtype is using
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index 5bf711c5f228..6b3473f5ae85 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -38,7 +38,6 @@
global.human_mob_list -= src
regenerate_body_icon = FALSE // don't bother regenerating if we happen to be queued to update icon
worn_underwear = null
- QDEL_NULL(attack_selector)
QDEL_NULL(vessel)
LAZYCLEARLIST(smell_cooldown)
. = ..()
@@ -646,6 +645,7 @@
else if(has_extension(src, /datum/extension/scannable))
remove_extension(src, /datum/extension/scannable)
+ update_health()
return TRUE
//Syncs cultural tokens to the currently set species, and may trigger a language update
diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm
index 50172253223d..ce39adf3b830 100644
--- a/code/modules/mob/living/carbon/human/human_attackhand.dm
+++ b/code/modules/mob/living/carbon/human/human_attackhand.dm
@@ -354,4 +354,7 @@
var/summary = default_attack.summarize()
if(summary)
to_chat(src, SPAN_NOTICE(summary))
- attack_selector?.update_icon()
\ No newline at end of file
+
+ var/obj/screen/default_attack_selector/attack_selector = get_hud_element(/decl/hud_element/attack_selector)
+ if(istype(attack_selector))
+ attack_selector.update_icon()
diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm
index 7f9ce538e1c4..91d11aa891c9 100644
--- a/code/modules/mob/living/carbon/human/human_defines.dm
+++ b/code/modules/mob/living/carbon/human/human_defines.dm
@@ -22,8 +22,6 @@
var/list/cultural_info = list()
- var/obj/screen/default_attack_selector/attack_selector
-
var/icon/stand_icon = null
var/voice = "" //Instead of new say code calling GetVoice() over and over and over, we're just going to ask this variable, which gets updated in Life()
diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm
index 3bc16d53ac8c..8a62e9bc0a80 100644
--- a/code/modules/mob/living/carbon/human/human_movement.dm
+++ b/code/modules/mob/living/carbon/human/human_movement.dm
@@ -137,9 +137,6 @@
handle_leg_damage()
species.handle_post_move(src)
- if(client)
- var/turf/B = GetAbove(src)
- up_hint.icon_state = "uphint[!!(B && TURF_IS_MIMICKING(B))]"
/mob/living/carbon/human/proc/handle_leg_damage()
if(!can_feel_pain())
diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm
index 4371599630ce..c1f044061a81 100644
--- a/code/modules/mob/living/carbon/human/life.dm
+++ b/code/modules/mob/living/carbon/human/life.dm
@@ -29,11 +29,6 @@
#define COLD_GAS_DAMAGE_LEVEL_3 3 //Amount of damage applied when the current breath's temperature passes the 120K point
/mob/living/carbon/human
- var/oxygen_alert = 0
- var/toxins_alert = 0
- var/co2_alert = 0
- var/fire_alert = 0
- var/pressure_alert = 0
var/stamina = 100
/mob/living/carbon/human/handle_living_non_stasis_processes()
@@ -200,7 +195,7 @@
var/loc_temp = environment.temperature
if(adjusted_pressure < species.warning_high_pressure && adjusted_pressure > species.warning_low_pressure && abs(loc_temp - bodytemperature) < 20 && bodytemperature < get_temperature_threshold(HEAT_LEVEL_1) && bodytemperature > get_temperature_threshold(COLD_LEVEL_1) && species.body_temperature)
- pressure_alert = 0
+ SET_HUD_ALERT(src, /decl/hud_element/condition/pressure, 0)
return // Temperatures are within normal ranges, fuck all this processing. ~Ccomp
//Body temperature adjusts depending on surrounding atmosphere based on your thermal protection (convection)
@@ -220,8 +215,8 @@
// +/- 50 degrees from 310.15K is the 'safe' zone, where no damage is dealt.
if(bodytemperature >= get_temperature_threshold(HEAT_LEVEL_1))
//Body temperature is too hot.
- fire_alert = max(fire_alert, 1)
- if(status_flags & GODMODE) return 1 //godmode
+ if(status_flags & GODMODE)
+ return 1 //godmode
var/burn_dam = 0
if(bodytemperature < get_temperature_threshold(HEAT_LEVEL_2))
burn_dam = HEAT_DAMAGE_LEVEL_1
@@ -230,12 +225,11 @@
else
burn_dam = HEAT_DAMAGE_LEVEL_3
take_overall_damage(burn=burn_dam, used_weapon = "High Body Temperature")
- fire_alert = max(fire_alert, 2)
+ SET_HUD_ALERT_MAX(src, /decl/hud_element/condition/fire, 2)
else if(bodytemperature <= get_temperature_threshold(COLD_LEVEL_1))
- fire_alert = max(fire_alert, 1)
- if(status_flags & GODMODE) return 1 //godmode
-
+ if(status_flags & GODMODE)
+ return 1 //godmode
var/burn_dam = 0
if(bodytemperature > get_temperature_threshold(COLD_LEVEL_2))
@@ -247,7 +241,7 @@
set_stasis(get_cryogenic_factor(bodytemperature), STASIS_COLD)
if(!has_chemical_effect(CE_CRYO, 1))
take_overall_damage(burn=burn_dam, used_weapon = "Low Body Temperature")
- fire_alert = max(fire_alert, 1)
+ SET_HUD_ALERT_MAX(src, /decl/hud_element/condition/fire, 1)
// Account for massive pressure differences. Done by Polymorph
// Made it possible to actually have something that can protect against high pressure... Done by Errorage. Polymorph now has an axe sticking from his head for his previous hardcoded nonsense!
@@ -256,13 +250,13 @@
if(adjusted_pressure >= species.hazard_high_pressure)
var/pressure_damage = min( ( (adjusted_pressure / species.hazard_high_pressure) -1 )*PRESSURE_DAMAGE_COEFFICIENT , MAX_HIGH_PRESSURE_DAMAGE)
take_overall_damage(brute=pressure_damage, used_weapon = "High Pressure")
- pressure_alert = 2
+ SET_HUD_ALERT(src, /decl/hud_element/condition/pressure, 2)
else if(adjusted_pressure >= species.warning_high_pressure)
- pressure_alert = 1
+ SET_HUD_ALERT(src, /decl/hud_element/condition/pressure, 1)
else if(adjusted_pressure >= species.warning_low_pressure)
- pressure_alert = 0
+ SET_HUD_ALERT(src, /decl/hud_element/condition/pressure, 0)
else if(adjusted_pressure >= species.hazard_low_pressure)
- pressure_alert = -1
+ SET_HUD_ALERT(src, /decl/hud_element/condition/pressure, -1)
else
var/list/obj/item/organ/external/parts = get_damageable_organs()
for(var/obj/item/organ/external/O in parts)
@@ -272,7 +266,7 @@
O.take_external_damage(brute = LOW_PRESSURE_DAMAGE, used_weapon = "Low Pressure")
if(getOxyLossPercent() < 55) // 11 OxyLoss per 4 ticks when wearing internals; unconsciousness in 16 ticks, roughly half a minute
adjustOxyLoss(4) // 16 OxyLoss per 4 ticks when no internals present; unconsciousness in 13 ticks, roughly twenty seconds
- pressure_alert = -2
+ SET_HUD_ALERT(src, /decl/hud_element/condition/pressure, -2)
return
@@ -430,7 +424,6 @@
/mob/living/carbon/human/handle_regular_hud_updates()
- fire_alert = 0 //Reset this here, because both breathe() and handle_environment() have a chance to set it.
if(life_tick%30==15)
hud_updateflag = 1022
if(hud_updateflag) // update our mob's hud overlays, AKA what others see flaoting above our head
@@ -471,7 +464,6 @@
overlay_fullscreen("oxy", /obj/screen/fullscreen/oxy, severity)
else
clear_fullscreen("oxy")
-
//Fire and Brute damage overlay (BSSR)
var/hurtdamage = src.getBruteLoss() + src.getFireLoss() + damageoverlaytemp
damageoverlaytemp = 0 // We do this so we can detect if someone hits us or not.
@@ -487,128 +479,7 @@
overlay_fullscreen("brute", /obj/screen/fullscreen/brute, severity)
else
clear_fullscreen("brute")
-
- if(healths)
-
- var/mutable_appearance/healths_ma = new(healths)
- healths_ma.icon_state = "blank"
- healths_ma.overlays = null
-
- if(has_chemical_effect(CE_PAINKILLER, 100))
- healths_ma.icon_state = "health_numb"
- else
- // Generate a by-limb health display.
- var/no_damage = 1
- var/trauma_val = 0 // Used in calculating softcrit/hardcrit indicators.
- if(can_feel_pain())
- trauma_val = max(shock_stage,get_shock())/(species.total_health-100)
- // Collect and apply the images all at once to avoid appearance churn.
- var/list/health_images = list()
- for(var/obj/item/organ/external/E in get_external_organs())
- if(no_damage && (E.brute_dam || E.burn_dam))
- no_damage = 0
- health_images += E.get_damage_hud_image()
-
- // Apply a fire overlay if we're burning.
- if(on_fire)
- health_images += image('icons/mob/screen1_health.dmi',"burning")
-
- // Show a general pain/crit indicator if needed.
- if(is_asystole())
- health_images += image('icons/mob/screen1_health.dmi',"hardcrit")
- else if(trauma_val)
- if(can_feel_pain())
- if(trauma_val > 0.7)
- health_images += image('icons/mob/screen1_health.dmi',"softcrit")
- if(trauma_val >= 1)
- health_images += image('icons/mob/screen1_health.dmi',"hardcrit")
- else if(no_damage)
- health_images += image('icons/mob/screen1_health.dmi',"fullhealth")
- healths_ma.overlays += health_images
- healths.appearance = healths_ma
-
- if(nutrition_icon)
- switch(nutrition)
- if(450 to INFINITY) nutrition_icon.icon_state = "nutrition0"
- if(350 to 450) nutrition_icon.icon_state = "nutrition1"
- if(250 to 350) nutrition_icon.icon_state = "nutrition2"
- if(150 to 250) nutrition_icon.icon_state = "nutrition3"
- else nutrition_icon.icon_state = "nutrition4"
-
- if(hydration_icon)
- switch(hydration)
- if(450 to INFINITY) hydration_icon.icon_state = "hydration0"
- if(350 to 450) hydration_icon.icon_state = "hydration1"
- if(250 to 350) hydration_icon.icon_state = "hydration2"
- if(150 to 250) hydration_icon.icon_state = "hydration3"
- else hydration_icon.icon_state = "hydration4"
-
- if(isSynthetic())
- var/obj/item/organ/internal/cell/C = get_organ(BP_CELL, /obj/item/organ/internal/cell)
- if(C)
- var/chargeNum = clamp(CEILING(C.percent()/25), 0, 4) //0-100 maps to 0-4, but give it a paranoid clamp just in case.
- cells.icon_state = "charge[chargeNum]"
- else
- cells.icon_state = "charge-empty"
-
- if(pressure)
- pressure.icon_state = "pressure[pressure_alert]"
- if(toxin)
- toxin.icon_state = "tox[toxins_alert ? "1" : "0"]"
- if(oxygen)
- oxygen.icon_state = "oxy[oxygen_alert ? "1" : "0"]"
- if(fire)
- fire.icon_state = "fire[fire_alert ? fire_alert : 0]"
-
- if(bodytemp)
- if (!species)
- switch(bodytemperature) //310.055 optimal body temp
- if(370 to INFINITY) bodytemp.icon_state = "temp4"
- if(350 to 370) bodytemp.icon_state = "temp3"
- if(335 to 350) bodytemp.icon_state = "temp2"
- if(320 to 335) bodytemp.icon_state = "temp1"
- if(300 to 320) bodytemp.icon_state = "temp0"
- if(295 to 300) bodytemp.icon_state = "temp-1"
- if(280 to 295) bodytemp.icon_state = "temp-2"
- if(260 to 280) bodytemp.icon_state = "temp-3"
- else bodytemp.icon_state = "temp-4"
- else
- var/heat_1 = get_temperature_threshold(HEAT_LEVEL_1)
- var/cold_1 = get_temperature_threshold(COLD_LEVEL_1)
- //TODO: precalculate all of this stuff when the species datum is created
- var/base_temperature = species.body_temperature
- if(base_temperature == null) //some species don't have a set metabolic temperature
- base_temperature = (heat_1 + cold_1)/2
-
- var/temp_step
- if (bodytemperature >= base_temperature)
- temp_step = (heat_1 - base_temperature)/4
-
- if (bodytemperature >= heat_1)
- bodytemp.icon_state = "temp4"
- else if (bodytemperature >= base_temperature + temp_step*3)
- bodytemp.icon_state = "temp3"
- else if (bodytemperature >= base_temperature + temp_step*2)
- bodytemp.icon_state = "temp2"
- else if (bodytemperature >= base_temperature + temp_step*1)
- bodytemp.icon_state = "temp1"
- else
- bodytemp.icon_state = "temp0"
-
- else if (bodytemperature < base_temperature)
- temp_step = (base_temperature - cold_1)/4
-
- if (bodytemperature <= cold_1)
- bodytemp.icon_state = "temp-4"
- else if (bodytemperature <= base_temperature - temp_step*3)
- bodytemp.icon_state = "temp-3"
- else if (bodytemperature <= base_temperature - temp_step*2)
- bodytemp.icon_state = "temp-2"
- else if (bodytemperature <= base_temperature - temp_step*1)
- bodytemp.icon_state = "temp-1"
- else
- bodytemp.icon_state = "temp0"
- return 1
+ return TRUE
/mob/living/carbon/human/handle_random_events()
// Puke if toxloss is too high
diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm
index 9e8caf51f096..193c2c3885d5 100644
--- a/code/modules/mob/living/carbon/human/update_icons.dm
+++ b/code/modules/mob/living/carbon/human/update_icons.dm
@@ -902,8 +902,10 @@ var/global/list/damage_icon_parts = list()
hud_used.hidden_inventory_update()
hud_used.persistant_inventory_update()
update_action_buttons()
- if(internals && internal)
- internals.icon_state = "internal1"
+ if(internal)
+ var/obj/screen/internals = get_hud_element(/decl/hud_element/internals)
+ if(internals)
+ internals.icon_state = "internal1"
queue_hand_rebuild()
//Human Overlays Indexes/////////
diff --git a/code/modules/mob/living/carbon/internals.dm b/code/modules/mob/living/carbon/internals.dm
index c21f82f68b00..53912f7fbfec 100644
--- a/code/modules/mob/living/carbon/internals.dm
+++ b/code/modules/mob/living/carbon/internals.dm
@@ -4,5 +4,6 @@
/mob/living/carbon/set_internals(obj/item/tank/source, source_string)
..()
internal = source
+ var/obj/screen/internals = get_hud_element(/decl/hud_element/internals)
if(internals)
internals.icon_state = "internal[!!internal]"
diff --git a/code/modules/mob/living/carbon/resist.dm b/code/modules/mob/living/carbon/resist.dm
index da8b0da1a835..26796ad652f5 100644
--- a/code/modules/mob/living/carbon/resist.dm
+++ b/code/modules/mob/living/carbon/resist.dm
@@ -33,6 +33,7 @@
return 1
/mob/living/carbon/proc/escape_handcuffs()
+
//This line represent a significant buff to grabs...
// We don't have to check the click cooldown because /mob/living/verb/resist() has done it for us, we can simply set the delay
setClickCooldown(100)
diff --git a/code/modules/mob/living/deity/deity_phenomena.dm b/code/modules/mob/living/deity/deity_phenomena.dm
index b4c93bea647c..b339a27cbc8f 100644
--- a/code/modules/mob/living/deity/deity_phenomena.dm
+++ b/code/modules/mob/living/deity/deity_phenomena.dm
@@ -18,7 +18,7 @@
/mob/living/deity/proc/silence(var/amount)
if(!silenced)
to_chat(src, "You've been silenced! Your phenomenas are disabled!")
- var/obj/screen/intent/deity/SD = hud_used?.action_intent
+ var/obj/screen/intent/deity/SD = get_hud_element(/decl/hud_element/action_intent)
if(istype(SD))
SD.color = "#ff0000"
silenced += amount
@@ -34,11 +34,11 @@
silenced--
if(!silenced)
to_chat(src, "You are no longer silenced.")
- var/obj/screen/intent/deity/SD = hud_used?.action_intent
+ var/obj/screen/intent/deity/SD = get_hud_element(/decl/hud_element/action_intent)
if(istype(SD))
SD.color = null
- if(power_per_regen < 0 || power < power_min)
- adjust_power(power_per_regen)
+ if(power_per_regen < 0 || power < power_min)
+ adjust_power(power_per_regen)
/mob/living/deity/Destroy()
for(var/phenom in phenomenas)
@@ -69,7 +69,7 @@
for(var/mod in intent_list)
if(intent_list[mod] == P)
intent_list[mod] = null
- var/obj/screen/intent/deity/SD = hud_used?.action_intent
+ var/obj/screen/intent/deity/SD = get_hud_element(/decl/hud_element/action_intent)
if(istype(SD))
SD.update_text()
update_phenomenas()
diff --git a/code/modules/mob/living/deity/menu/deity_nano.dm b/code/modules/mob/living/deity/menu/deity_nano.dm
index 046276fcffe1..c4d617d7e016 100644
--- a/code/modules/mob/living/deity/menu/deity_nano.dm
+++ b/code/modules/mob/living/deity/menu/deity_nano.dm
@@ -76,6 +76,6 @@
phenomena_bindings[++phenomena_bindings.len] = list("intent" = intent, "intent_data" = intent_data)
nano_data["bindings"] = phenomena_bindings
//Update the hud as well.
- var/obj/screen/intent/deity/SD = hud_used?.action_intent
+ var/obj/screen/intent/deity/SD = get_hud_element(/decl/hud_element/action_intent)
if(istype(SD))
SD.update_text()
\ No newline at end of file
diff --git a/code/modules/mob/living/deity/phenomena/communication.dm b/code/modules/mob/living/deity/phenomena/communication.dm
index 72876f3f9e96..e06bea85bc02 100644
--- a/code/modules/mob/living/deity/phenomena/communication.dm
+++ b/code/modules/mob/living/deity/phenomena/communication.dm
@@ -26,7 +26,7 @@
/datum/phenomena/point/activate(var/atom/a)
..()
if(!arrow)
- arrow = image('icons/mob/screen1.dmi', icon_state = "arrow", layer = POINTER_LAYER)
+ arrow = image('icons/mob/screen/arrow.dmi', icon_state = "arrow", layer = POINTER_LAYER)
var/turf/T = get_turf(a)
arrow.loc = T
var/list/view = view(7,T)
diff --git a/code/modules/mob/living/inventory.dm b/code/modules/mob/living/inventory.dm
index b68977b1b72b..66c5256cca17 100644
--- a/code/modules/mob/living/inventory.dm
+++ b/code/modules/mob/living/inventory.dm
@@ -48,14 +48,15 @@
var/last_slot = get_active_held_item_slot()
if(slot != last_slot && (slot in get_held_item_slots()))
_held_item_slot_selected = slot
- for(var/obj/screen/inventory/hand in hud_used?.hand_hud_objects)
- hand.cut_overlay("hand_selected")
- if(hand.slot_id == slot)
- hand.add_overlay("hand_selected")
- hand.compile_overlays()
- var/obj/item/I = get_active_hand()
- if(istype(I))
- I.on_active_hand()
+ if(istype(hud_used))
+ for(var/obj/screen/inventory/hand in hud_used.hand_hud_objects)
+ hand.cut_overlay("hand_selected")
+ if(hand.slot_id == slot)
+ hand.add_overlay("hand_selected")
+ hand.compile_overlays()
+ var/obj/item/I = get_active_hand()
+ if(istype(I))
+ I.on_active_hand()
// Defer proc for the sake of delimbing root limbs with multiple graspers (serpentid)
/mob/living/proc/queue_hand_rebuild()
diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm
index 0261c22a363d..239beacc9f9c 100644
--- a/code/modules/mob/living/life.dm
+++ b/code/modules/mob/living/life.dm
@@ -2,7 +2,9 @@
set invisibility = 0
set background = BACKGROUND_ENABLED
- ..()
+ . = ..()
+ if(. == PROCESS_KILL)
+ return
if (HasMovementHandler(/datum/movement_handler/mob/transformation))
return
@@ -324,11 +326,23 @@
//this handles hud updates. Calls update_vision() and handle_hud_icons()
/mob/living/proc/handle_regular_hud_updates()
SHOULD_CALL_PARENT(TRUE)
+ if(machine && machine.check_eye(src) < 0)
+ reset_view(null)
if(!should_do_hud_updates())
return FALSE
handle_hud_icons()
handle_vision()
handle_low_light_vision()
+ if(hud_used)
+ hud_used.update_icons()
+ if(stat != DEAD)
+ if(is_blind())
+ overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
+ else
+ clear_fullscreen("blind")
+ set_fullscreen(disabilities & NEARSIGHTED, "impaired", /obj/screen/fullscreen/impaired, 1)
+ set_fullscreen(GET_STATUS(src, STAT_BLURRY), "blurry", /obj/screen/fullscreen/blurry)
+ set_fullscreen(GET_STATUS(src, STAT_DRUGGY), "high", /obj/screen/fullscreen/high)
return TRUE
/mob/living/proc/handle_low_light_vision()
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index fd7ffdbfc719..1a29e5ee39cc 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -195,6 +195,11 @@ default behaviour is:
if(update_icons)
queue_icon_update()
+/mob/living/proc/update_health_hud()
+ if(!client || !hud_used)
+ return
+ hud_used.update_health_hud()
+
/mob/living/proc/should_be_dead()
return current_health <= 0
@@ -391,7 +396,8 @@ default behaviour is:
// damage MANY external organs, in random order
/mob/living/proc/take_overall_damage(var/brute, var/burn, var/used_weapon = null)
- if(status_flags & GODMODE) return 0 //godmode
+ if(status_flags & GODMODE)
+ return 0
adjustBruteLoss(brute)
adjustFireLoss(burn, do_update_health = TRUE)
@@ -1152,11 +1158,16 @@ default behaviour is:
/mob/living/get_speech_bubble_state_modifier()
return isSynthetic() ? "synth" : ..()
-/mob/living/proc/is_on_special_ability_cooldown()
+/mob/proc/is_on_special_ability_cooldown()
+ return FALSE
+
+/mob/living/is_on_special_ability_cooldown()
return world.time < next_special_ability
/mob/living/proc/set_special_ability_cooldown(var/amt)
next_special_ability = max(next_special_ability, world.time+amt)
+ if(hud_used)
+ hud_used.set_hud_cooldown((world.time - next_special_ability)-1) // -1 so it visually resets one tick after cooldown.
/mob/living/proc/get_seconds_until_next_special_ability_string()
return ticks2readable(next_special_ability - world.time)
diff --git a/code/modules/mob/living/living_bodytemp.dm b/code/modules/mob/living/living_bodytemp.dm
index 58a184891ab6..6c0528103034 100644
--- a/code/modules/mob/living/living_bodytemp.dm
+++ b/code/modules/mob/living/living_bodytemp.dm
@@ -7,9 +7,9 @@
return TRUE
/mob/living/proc/get_bodytemperature_difference()
- var/decl/species/my_species = get_species()
- if(my_species)
- return (my_species.body_temperature - bodytemperature)
+ var/ideal_bodytemp = get_ideal_bodytemp()
+ if(!isnull(ideal_bodytemp))
+ return (ideal_bodytemp - bodytemperature)
return 0
/mob/living/proc/stabilize_body_temperature()
diff --git a/code/modules/mob/living/living_breath.dm b/code/modules/mob/living/living_breath.dm
index 189d0244fafd..e386306b7caa 100644
--- a/code/modules/mob/living/living_breath.dm
+++ b/code/modules/mob/living/living_breath.dm
@@ -113,6 +113,7 @@
if(!found_mask)
set_internals(null)
var/obj/item/tank/new_internals = get_internals()
+ var/obj/screen/internals = get_hud_element(/decl/hud_element/internals)
if(internals && old_internals != new_internals)
internals.icon_state = "internal[!!new_internals]"
if(istype(new_internals))
diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm
index 7054837bd440..402b21281cff 100644
--- a/code/modules/mob/living/living_defense.dm
+++ b/code/modules/mob/living/living_defense.dm
@@ -218,7 +218,6 @@
// End BS12 momentum-transfer code.
/mob/living/attack_generic(var/mob/user, var/damage, var/attack_message)
-
if(!damage || !istype(user))
return
diff --git a/code/modules/mob/living/living_grabs.dm b/code/modules/mob/living/living_grabs.dm
index e8eda8cec1dc..fc85822943cd 100644
--- a/code/modules/mob/living/living_grabs.dm
+++ b/code/modules/mob/living/living_grabs.dm
@@ -41,7 +41,8 @@
face_atom(target)
var/obj/item/grab/grab
- if(ispath(grab_tag, /decl/grab) && can_grab(target, get_target_zone(), defer_hand = defer_hand) && target.can_be_grabbed(src, get_target_zone(), defer_hand))
+ var/target_zone = get_target_zone()
+ if(ispath(grab_tag, /decl/grab) && can_grab(target, target_zone, defer_hand = defer_hand) && target.can_be_grabbed(src, target_zone, defer_hand))
grab = new /obj/item/grab(src, target, grab_tag, defer_hand)
if(QDELETED(grab))
diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm
index 936921660e1e..0b2c54f4749e 100644
--- a/code/modules/mob/living/silicon/pai/pai.dm
+++ b/code/modules/mob/living/silicon/pai/pai.dm
@@ -24,10 +24,11 @@ var/global/list/possible_say_verbs = list(
icon = 'icons/mob/robots/pai/pai_drone.dmi'
icon_state = ICON_STATE_WORLD
mob_sort_value = 3
- hud_type = /datum/hud/pai
+ hud_used = /datum/hud/pai
emote_type = 2 // pAIs emotes are heard, not seen, so they can be seen through a container (eg. person)
pass_flags = PASS_FLAG_TABLE
mob_size = MOB_SIZE_SMALL
+ mob_default_max_health = 100
can_pull_size = ITEM_SIZE_SMALL
can_pull_mobs = MOB_PULL_SMALLER
diff --git a/code/modules/mob/living/silicon/robot/flying/flying.dm b/code/modules/mob/living/silicon/robot/flying/flying.dm
index dbd40ea19a03..6e7d56769355 100644
--- a/code/modules/mob/living/silicon/robot/flying/flying.dm
+++ b/code/modules/mob/living/silicon/robot/flying/flying.dm
@@ -22,7 +22,11 @@
components["armour"] = new/datum/robot_component/armour/light(src)
/mob/living/silicon/robot/flying/handle_regular_status_updates()
+
. = ..()
+ if(. == PROCESS_KILL)
+ return
+
if(incapacitated() || !is_component_functioning("actuator"))
stop_flying()
else
diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm
index ca51a59002df..f4512af3a7e6 100644
--- a/code/modules/mob/living/silicon/robot/life.dm
+++ b/code/modules/mob/living/silicon/robot/life.dm
@@ -103,51 +103,6 @@
if (MED_HUD)
process_med_hud(src,0,network = get_computer_network())
- if(length(get_active_grabs()))
- ui_drop_grab.invisibility = 0
- ui_drop_grab.alpha = 255
- else
- ui_drop_grab.invisibility = INVISIBILITY_MAXIMUM
- ui_drop_grab.alpha = 0
-
- if (src.healths)
- if (src.stat != DEAD)
- if(istype(src,/mob/living/silicon/robot/drone))
- switch(current_health)
- if(35 to INFINITY)
- src.healths.icon_state = "health0"
- if(25 to 34)
- src.healths.icon_state = "health1"
- if(15 to 24)
- src.healths.icon_state = "health2"
- if(5 to 14)
- src.healths.icon_state = "health3"
- if(0 to 4)
- src.healths.icon_state = "health4"
- if(-35 to 0)
- src.healths.icon_state = "health5"
- else
- src.healths.icon_state = "health6"
- else
- switch(current_health)
- if(200 to INFINITY)
- src.healths.icon_state = "health0"
- if(150 to 200)
- src.healths.icon_state = "health1"
- if(100 to 150)
- src.healths.icon_state = "health2"
- if(50 to 100)
- src.healths.icon_state = "health3"
- if(0 to 50)
- src.healths.icon_state = "health4"
- else
- if(current_health > config.health_threshold_dead)
- src.healths.icon_state = "health5"
- else
- src.healths.icon_state = "health6"
- else
- src.healths.icon_state = "health7"
-
if (src.syndicate && src.client)
var/decl/special_role/traitors = GET_DECL(/decl/special_role/traitor)
for(var/datum/mind/tra in traitors.current_antagonists)
@@ -158,56 +113,7 @@
src.disconnect_from_ai()
if(src.mind)
traitors.add_antagonist_mind(mind)
-
- if (src.cells)
- if (src.cell)
- var/chargeNum = clamp(CEILING(cell.percent()/25), 0, 4) //0-100 maps to 0-4, but give it a paranoid clamp just in case.
- src.cells.icon_state = "charge[chargeNum]"
- else
- src.cells.icon_state = "charge-empty"
-
- if(bodytemp)
- switch(src.bodytemperature) //310.055 optimal body temp
- if(335 to INFINITY)
- src.bodytemp.icon_state = "temp2"
- if(320 to 335)
- src.bodytemp.icon_state = "temp1"
- if(300 to 320)
- src.bodytemp.icon_state = "temp0"
- if(260 to 300)
- src.bodytemp.icon_state = "temp-1"
- else
- src.bodytemp.icon_state = "temp-2"
-
- var/datum/gas_mixture/environment = loc?.return_air()
- if(fire && environment)
- switch(environment.temperature)
- if(-INFINITY to T100C)
- src.fire.icon_state = "fire0"
- else
- src.fire.icon_state = "fire1"
- if(oxygen && environment)
- var/decl/species/species = all_species[global.using_map.default_species]
- if(!species.breath_type || environment.gas[species.breath_type] >= species.breath_pressure)
- src.oxygen.icon_state = "oxy0"
- for(var/gas in species.poison_types)
- if(environment.gas[gas])
- src.oxygen.icon_state = "oxy1"
- break
- else
- src.oxygen.icon_state = "oxy1"
-
- if(stat != DEAD)
- if(is_blind())
- overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
- else
- clear_fullscreen("blind")
- set_fullscreen(disabilities & NEARSIGHTED, "impaired", /obj/screen/fullscreen/impaired, 1)
- set_fullscreen(GET_STATUS(src, STAT_BLURRY), "blurry", /obj/screen/fullscreen/blurry)
- set_fullscreen(GET_STATUS(src, STAT_DRUGGY), "high", /obj/screen/fullscreen/high)
-
- update_items()
- return 1
+ return TRUE
/mob/living/silicon/robot/handle_vision()
..()
diff --git a/code/modules/mob/living/silicon/robot/modules/module_illegal.dm b/code/modules/mob/living/silicon/robot/modules/module_illegal.dm
index c456f676bf29..8ff7ce3a7b5d 100644
--- a/code/modules/mob/living/silicon/robot/modules/module_illegal.dm
+++ b/code/modules/mob/living/silicon/robot/modules/module_illegal.dm
@@ -27,9 +27,8 @@
equipment += id
/obj/item/robot_module/syndicate/finalize_equipment(var/mob/living/silicon/robot/R)
- var/obj/item/tank/jetpack/carbondioxide/jetpack = locate() in equipment
- R.internals = jetpack
. = ..()
+ R.set_internals(locate(/obj/item/tank/jetpack/carbondioxide) in equipment)
/obj/item/robot_module/syndicate/Destroy()
equipment -= id
diff --git a/code/modules/mob/living/silicon/robot/modules/module_maintenance_drone.dm b/code/modules/mob/living/silicon/robot/modules/module_maintenance_drone.dm
index 012206fe5ee7..7e5407c89f32 100644
--- a/code/modules/mob/living/silicon/robot/modules/module_maintenance_drone.dm
+++ b/code/modules/mob/living/silicon/robot/modules/module_maintenance_drone.dm
@@ -60,8 +60,7 @@
/obj/item/robot_module/drone/finalize_equipment(var/mob/living/silicon/robot/R)
. = ..()
- if(istype(R))
- R.internals = locate(/obj/item/tank/jetpack/carbondioxide) in equipment
+ R.set_internals(locate(/obj/item/tank/jetpack/carbondioxide) in equipment)
/obj/item/robot_module/drone/finalize_emag()
. = ..()
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index 71a0e535fba8..1b70c3aa6143 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -37,7 +37,6 @@
var/obj/screen/inv1 = null
var/obj/screen/inv2 = null
var/obj/screen/inv3 = null
- var/obj/screen/robot_drop_grab/ui_drop_grab
var/shown_robot_modules = 0 //Used to determine whether they have the module menu shown or not
var/obj/screen/robot_modules_background
@@ -199,6 +198,7 @@
//If there's an MMI in the robot, have it ejected when the mob goes away. --NEO
//Improved /N
/mob/living/silicon/robot/Destroy()
+ QDEL_NULL(hands)
if(mmi)//Safety for when a cyborg gets dust()ed. Or there is no MMI inside.
if(mind)
mmi.dropInto(loc)
diff --git a/code/modules/mob/living/silicon/robot/robot_damage.dm b/code/modules/mob/living/silicon/robot/robot_damage.dm
index d437c93a9811..9d17227a4a5a 100644
--- a/code/modules/mob/living/silicon/robot/robot_damage.dm
+++ b/code/modules/mob/living/silicon/robot/robot_damage.dm
@@ -54,6 +54,7 @@
if(!parts.len) return
var/datum/robot_component/picked = pick(parts)
picked.heal_damage(brute,burn)
+ update_health()
/mob/living/silicon/robot/take_organ_damage(var/brute = 0, var/burn = 0, var/bypass_armour = FALSE, var/override_droplimb)
var/list/components = get_damageable_components()
@@ -81,31 +82,29 @@
var/datum/robot_component/armour/A = get_armour()
if(A)
A.take_damage(brute, burn)
+ update_health()
return
var/datum/robot_component/C = pick(components)
C.take_damage(brute, burn)
+ update_health()
/mob/living/silicon/robot/heal_overall_damage(var/brute, var/burn)
var/list/datum/robot_component/parts = get_damaged_components(brute,burn)
-
while(parts.len && (brute>0 || burn>0) )
var/datum/robot_component/picked = pick(parts)
-
var/brute_was = picked.brute_damage
var/burn_was = picked.electronics_damage
-
picked.heal_damage(brute,burn)
-
brute -= (brute_was-picked.brute_damage)
burn -= (burn_was-picked.electronics_damage)
-
parts -= picked
+ update_health()
/mob/living/silicon/robot/take_overall_damage(var/brute = 0, var/burn = 0, var/sharp = 0, var/used_weapon = null)
- if(status_flags & GODMODE) return //godmode
+ if(status_flags & GODMODE)
+ return
var/list/datum/robot_component/parts = get_damageable_components()
-
//Combat shielding absorbs a percentage of damage directly into the cell.
if(module_active && istype(module_active,/obj/item/borg/combat/shield))
var/obj/item/borg/combat/shield/shield = module_active
diff --git a/code/modules/mob/living/silicon/robot/robot_movement.dm b/code/modules/mob/living/silicon/robot/robot_movement.dm
index 6b5f1c2cd756..d617a98afd25 100644
--- a/code/modules/mob/living/silicon/robot/robot_movement.dm
+++ b/code/modules/mob/living/silicon/robot/robot_movement.dm
@@ -15,15 +15,7 @@
return 1
. = ..()
-
-/mob/living/silicon/robot/Move()
- . = ..()
- if(. && client)
-
- var/turf/B = GetAbove(src)
- up_hint.icon_state = "uphint[!!(B && TURF_IS_MIMICKING(B))]"
-
- //No longer needed, but I'll leave it here incase we plan to re-use it.
+//No longer needed, but I'll leave it here incase we plan to re-use it.
/mob/living/silicon/robot/get_movement_delay(var/travel_dir)
var/tally = ..() //Incase I need to add stuff other than "speed" later
diff --git a/code/modules/mob/living/simple_animal/aquatic/_aquatic_retaliate.dm b/code/modules/mob/living/simple_animal/aquatic/_aquatic_retaliate.dm
index 0dc9992caf6c..7937095f6a3c 100644
--- a/code/modules/mob/living/simple_animal/aquatic/_aquatic_retaliate.dm
+++ b/code/modules/mob/living/simple_animal/aquatic/_aquatic_retaliate.dm
@@ -14,4 +14,4 @@
bone_amount = 5
skin_amount = 5
bone_material = /decl/material/solid/bone/fish
- skin_material = /decl/material/solid/skin/fish
\ No newline at end of file
+ skin_material = /decl/material/solid/skin/fish
diff --git a/code/modules/mob/living/simple_animal/constructs/constructs.dm b/code/modules/mob/living/simple_animal/constructs/constructs.dm
index 74e15dd01432..b8326a0f1f4d 100644
--- a/code/modules/mob/living/simple_animal/constructs/constructs.dm
+++ b/code/modules/mob/living/simple_animal/constructs/constructs.dm
@@ -120,9 +120,10 @@
force = 30
/mob/living/simple_animal/construct/armoured/handle_regular_status_updates()
- set_status(STAT_WEAK, 0)
- if ((. = ..()))
+ . = ..()
+ if(. == PROCESS_KILL)
return
+ set_status(STAT_WEAK, 0)
/mob/living/simple_animal/construct/armoured/bullet_act(var/obj/item/projectile/P)
if(istype(P, /obj/item/projectile/energy) || istype(P, /obj/item/projectile/beam))
@@ -246,85 +247,3 @@
hitsound = 'sound/weapons/pierce.ogg'
sharp = TRUE
force = 25
-
-////////////////HUD//////////////////////
-/mob/living/simple_animal/construct/handle_regular_status_updates()
- . = ..()
- if(.)
- silence_spells(purge)
-
-/mob/living/simple_animal/construct/handle_regular_hud_updates()
- . = ..()
- if(.)
- if(fire)
- fire.icon_state = "fire[!!fire_alert]"
- silence_spells(purge)
-
-/mob/living/simple_animal/construct/armoured/handle_regular_hud_updates()
- . = ..()
- if(. && healths)
- switch(current_health)
- if(250 to INFINITY) healths.icon_state = "juggernaut_health0"
- if(208 to 249) healths.icon_state = "juggernaut_health1"
- if(167 to 207) healths.icon_state = "juggernaut_health2"
- if(125 to 166) healths.icon_state = "juggernaut_health3"
- if(84 to 124) healths.icon_state = "juggernaut_health4"
- if(42 to 83) healths.icon_state = "juggernaut_health5"
- if(1 to 41) healths.icon_state = "juggernaut_health6"
- else healths.icon_state = "juggernaut_health7"
-
-
-/mob/living/simple_animal/construct/behemoth/handle_regular_hud_updates()
- . = ..()
- if(. && healths)
- switch(current_health)
- if(750 to INFINITY) healths.icon_state = "juggernaut_health0"
- if(625 to 749) healths.icon_state = "juggernaut_health1"
- if(500 to 624) healths.icon_state = "juggernaut_health2"
- if(375 to 499) healths.icon_state = "juggernaut_health3"
- if(250 to 374) healths.icon_state = "juggernaut_health4"
- if(125 to 249) healths.icon_state = "juggernaut_health5"
- if(1 to 124) healths.icon_state = "juggernaut_health6"
- else healths.icon_state = "juggernaut_health7"
-
-/mob/living/simple_animal/construct/builder/handle_regular_hud_updates()
- . = ..()
- if(. && healths)
- switch(current_health)
- if(50 to INFINITY) healths.icon_state = "artificer_health0"
- if(42 to 49) healths.icon_state = "artificer_health1"
- if(34 to 41) healths.icon_state = "artificer_health2"
- if(26 to 33) healths.icon_state = "artificer_health3"
- if(18 to 25) healths.icon_state = "artificer_health4"
- if(10 to 17) healths.icon_state = "artificer_health5"
- if(1 to 9) healths.icon_state = "artificer_health6"
- else healths.icon_state = "artificer_health7"
-
-
-
-/mob/living/simple_animal/construct/wraith/handle_regular_hud_updates()
- . = ..()
- if(. && healths)
- switch(current_health)
- if(75 to INFINITY) healths.icon_state = "wraith_health0"
- if(62 to 74) healths.icon_state = "wraith_health1"
- if(50 to 61) healths.icon_state = "wraith_health2"
- if(37 to 49) healths.icon_state = "wraith_health3"
- if(25 to 36) healths.icon_state = "wraith_health4"
- if(12 to 24) healths.icon_state = "wraith_health5"
- if(1 to 11) healths.icon_state = "wraith_health6"
- else healths.icon_state = "wraith_health7"
-
-
-/mob/living/simple_animal/construct/harvester/handle_regular_hud_updates()
- . = ..()
- if(. && healths)
- switch(current_health)
- if(150 to INFINITY) healths.icon_state = "harvester_health0"
- if(125 to 149) healths.icon_state = "harvester_health1"
- if(100 to 124) healths.icon_state = "harvester_health2"
- if(75 to 99) healths.icon_state = "harvester_health3"
- if(50 to 74) healths.icon_state = "harvester_health4"
- if(25 to 49) healths.icon_state = "harvester_health5"
- if(1 to 24) healths.icon_state = "harvester_health6"
- else healths.icon_state = "harvester_health7"
diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm
index e3209fd903ce..9fbf848076df 100644
--- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm
+++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm
@@ -70,6 +70,13 @@
if(. && stat == CONSCIOUS && udder && prob(5))
udder.add_reagent(/decl/material/liquid/drink/milk, rand(5, 10))
+ if(!LAZYLEN(grabbed_by))
+ var/obj/effect/vine/food
+ food = locate(/obj/effect/vine) in oview(5,loc)
+ if(food)
+ var/step = get_step_to(src, food, 0)
+ Move(step)
+
/mob/living/simple_animal/hostile/retaliate/goat/Retaliate()
..()
if(stat == CONSCIOUS && prob(50))
diff --git a/code/modules/mob/living/simple_animal/friendly/possum.dm b/code/modules/mob/living/simple_animal/friendly/possum.dm
index 8ecba81bd37f..063aef0889e3 100644
--- a/code/modules/mob/living/simple_animal/friendly/possum.dm
+++ b/code/modules/mob/living/simple_animal/friendly/possum.dm
@@ -30,6 +30,7 @@
/datum/ai/opossum
expected_type = /mob/living/simple_animal/opossum
/datum/ai/opossum/do_process(time_elapsed)
+
. = ..()
if(!prob(1))
return
diff --git a/code/modules/mob/living/simple_animal/hostile/antlion.dm b/code/modules/mob/living/simple_animal/hostile/antlion.dm
index 5f93121af355..583c25e187b0 100644
--- a/code/modules/mob/living/simple_animal/hostile/antlion.dm
+++ b/code/modules/mob/living/simple_animal/hostile/antlion.dm
@@ -27,6 +27,7 @@
var/heal_amount = 6
/mob/living/simple_animal/hostile/antlion/handle_regular_status_updates()
+
. = ..()
process_healing() //this needs to occur before if(!.) because of stop_automation
if(. && !is_on_special_ability_cooldown() && can_act() && target_mob)
diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm
index e3b94bf51102..6402876a31bb 100644
--- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm
+++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm
@@ -206,6 +206,7 @@ Guard caste procs
expected_type = /mob/living/simple_animal/hostile/giant_spider/guard
/datum/ai/giant_spider/guard/do_process(time_elapsed)
+
. = ..()
var/mob/living/simple_animal/hostile/giant_spider/guard/spooder = body
if(spooder.berserking)
@@ -309,6 +310,7 @@ Nurse caste procs
expected_type = /mob/living/simple_animal/hostile/giant_spider/nurse
/datum/ai/giant_spider/nurse/do_process(time_elapsed)
+
. = ..()
var/mob/living/simple_animal/hostile/giant_spider/nurse/spooder = body
if(spooder.stance != HOSTILE_STANCE_IDLE)
@@ -447,9 +449,11 @@ Hunter caste procs
Spitter caste procs
******************/
/mob/living/simple_animal/hostile/giant_spider/spitter/handle_regular_status_updates()
+
. = ..()
- if(!.)
- return FALSE
+ if(. == PROCESS_KILL)
+ return
+
if(venom_charge <= 0)
ranged = FALSE
if(prob(25))
diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm
index 94537f5aef78..a90296d05b93 100644
--- a/code/modules/mob/living/simple_animal/hostile/hostile.dm
+++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm
@@ -183,8 +183,9 @@
/mob/living/simple_animal/hostile/handle_regular_status_updates()
. = ..()
- if(!.)
- walk(src, 0)
+ if(. == PROCESS_KILL)
+ return
+ walk(src, 0)
/mob/living/simple_animal/hostile/do_delayed_life_action()
..()
diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm
index b4cc98df2dd8..4cfc3fa053d9 100644
--- a/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm
+++ b/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm
@@ -87,7 +87,9 @@
. = ..()
if(!.)
return
-
+ . = ..()
+ if(. == PROCESS_KILL)
+ return
//emps and lots of damage can temporarily shut us down
if(disabled > 0)
set_stat(UNCONSCIOUS)
diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/king_of_goats.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/king_of_goats.dm
index 017b5fe527f8..202f15072730 100644
--- a/code/modules/mob/living/simple_animal/hostile/retaliate/king_of_goats.dm
+++ b/code/modules/mob/living/simple_animal/hostile/retaliate/king_of_goats.dm
@@ -192,8 +192,8 @@
/mob/living/simple_animal/hostile/retaliate/goat/king/phase2/handle_living_non_stasis_processes()
. = ..()
- if(!.)
- return FALSE
+ if(. == PROCESS_KILL)
+ return
if(special_attacks >= 6 && current_damtype != BRUTE)
visible_message(SPAN_MFAUNA("The energy surrounding \the [src]'s horns dissipates."))
current_damtype = BRUTE
diff --git a/code/modules/mob/living/simple_animal/hostile/slug.dm b/code/modules/mob/living/simple_animal/hostile/slug.dm
index a00b3927cd65..7247f0116112 100644
--- a/code/modules/mob/living/simple_animal/hostile/slug.dm
+++ b/code/modules/mob/living/simple_animal/hostile/slug.dm
@@ -55,7 +55,9 @@ Small, little HP, poisonous.
/mob/living/simple_animal/hostile/slug/handle_regular_status_updates()
. = ..()
- if(. && istype(src.loc, /obj/item/holder) && isliving(src.loc.loc)) //We in somebody
+ if(. == PROCESS_KILL)
+ return
+ if(istype(src.loc, /obj/item/holder) && isliving(src.loc.loc)) //We in somebody
var/mob/living/L = src.loc.loc
if(src.loc in L.get_visible_implants(0))
if(prob(1))
diff --git a/code/modules/mob/living/simple_animal/hostile/vagrant.dm b/code/modules/mob/living/simple_animal/hostile/vagrant.dm
index 36ad1d84c935..3b7a685d0d0b 100644
--- a/code/modules/mob/living/simple_animal/hostile/vagrant.dm
+++ b/code/modules/mob/living/simple_animal/hostile/vagrant.dm
@@ -44,8 +44,8 @@
/mob/living/simple_animal/hostile/vagrant/handle_living_non_stasis_processes()
. = ..()
- if(!.)
- return FALSE
+ if(. == PROCESS_KILL)
+ return
if(gripping)
if(!(get_turf(src) == get_turf(gripping)))
gripping = null
diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm
index 56fd59a4ef55..d75be6723072 100644
--- a/code/modules/mob/living/simple_animal/simple_animal.dm
+++ b/code/modules/mob/living/simple_animal/simple_animal.dm
@@ -44,7 +44,6 @@
var/maxbodytemp = 350
var/heat_damage_per_tick = 3 //amount of damage applied if animal's body temperature is higher than maxbodytemp
var/cold_damage_per_tick = 2 //same as heat_damage_per_tick, only if the bodytemperature it's lower than minbodytemp
- var/fire_alert = 0
var/list/hat_offsets
@@ -70,7 +69,7 @@
//Null rod stuff
var/supernatural = 0
- var/purge = 0
+ var/purged_time = 0 // TODO: make this a status condition
var/bleed_ticks = 0
var/bleed_colour = COLOR_BLOOD_HUMAN
@@ -178,8 +177,6 @@ var/global/list/simplemob_icon_bitflag_cache = list()
. = ..()
/mob/living/simple_animal/handle_regular_status_updates()
- if(purge)
- purge -= 1
. = ..()
if(.)
if(can_bleed && bleed_ticks > 0)
@@ -271,14 +268,9 @@ var/global/list/simplemob_icon_bitflag_cache = list()
bodytemperature += ((environment.temperature - bodytemperature) / 5)
if(bodytemperature < minbodytemp)
- fire_alert = 2
adjustBruteLoss(cold_damage_per_tick)
else if(bodytemperature > maxbodytemp)
- fire_alert = 1
adjustBruteLoss(heat_damage_per_tick)
- else
- fire_alert = 0
-
if(!atmos_suitable)
adjustBruteLoss(unsuitable_atmos_damage)
@@ -411,7 +403,7 @@ var/global/list/simplemob_icon_bitflag_cache = list()
damage = (O.force / 8)
if(supernatural && istype(O,/obj/item/nullrod))
damage *= 2
- purge = 3
+ purged_time = 3
adjustBruteLoss(damage)
if(O.edge || O.sharp)
adjustBleedTicks(damage)
@@ -420,12 +412,11 @@ var/global/list/simplemob_icon_bitflag_cache = list()
/mob/living/simple_animal/get_movement_delay(var/travel_dir)
var/tally = ..() //Incase I need to add stuff other than "speed" later
-
tally += speed
- if(purge)//Purged creatures will move more slowly. The more time before their purge stops, the slower they'll move.
+ if(purged_time)//Purged creatures will move more slowly. The more time before their purge stops, the slower they'll move.
if(tally <= 0)
tally = 1
- tally *= purge
+ tally *= purged_time
return tally+config.animal_delay
diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm
index 790b2ee8eb7f..fba611a84f2e 100644
--- a/code/modules/mob/login.dm
+++ b/code/modules/mob/login.dm
@@ -107,15 +107,10 @@
refresh_client_images()
reload_fullscreen() // Reload any fullscreen overlays this mob has.
- add_click_catcher()
+ reset_click_catchers()
update_action_buttons()
update_mouse_pointer()
- if(ability_master)
- ability_master.update_abilities(TRUE, src)
- ability_master.toggle_open(1)
- ability_master.synch_spells_to_mind(mind)
-
if(get_preference_value(/datum/client_preference/show_status_markers) == PREF_SHOW)
if(status_markers?.mob_image_personal)
client.images |= status_markers.mob_image_personal
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index 524074c8f116..3be179a30cc4 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -13,8 +13,6 @@
QDEL_NULL(hud_used)
if(active_storage)
active_storage.close(src)
- if(istype(ability_master))
- QDEL_NULL(ability_master)
if(istype(skillset))
QDEL_NULL(skillset)
QDEL_NULL_LIST(grabbed_by)
@@ -22,7 +20,6 @@
if(istype(ai))
QDEL_NULL(ai)
QDEL_NULL(lighting_master)
- remove_screen_obj_references()
if(client)
for(var/atom/movable/AM in client.screen)
var/obj/screen/screenobj = AM
@@ -35,27 +32,6 @@
ghostize()
return ..()
-/mob/proc/remove_screen_obj_references()
- QDEL_NULL_SCREEN(hands)
- QDEL_NULL_SCREEN(internals)
- QDEL_NULL_SCREEN(oxygen)
- QDEL_NULL_SCREEN(toxin)
- QDEL_NULL_SCREEN(fire)
- QDEL_NULL_SCREEN(bodytemp)
- QDEL_NULL_SCREEN(healths)
- QDEL_NULL_SCREEN(throw_icon)
- QDEL_NULL_SCREEN(nutrition_icon)
- QDEL_NULL_SCREEN(hydration_icon)
- QDEL_NULL_SCREEN(pressure)
- QDEL_NULL_SCREEN(pain)
- QDEL_NULL_SCREEN(up_hint)
- QDEL_NULL_SCREEN(item_use_icon)
- QDEL_NULL_SCREEN(radio_use_icon)
- QDEL_NULL_SCREEN(gun_move_icon)
- QDEL_NULL_SCREEN(gun_setting_icon)
- QDEL_NULL_SCREEN(ability_master)
- QDEL_NULL_SCREEN(zone_sel)
-
/mob/Initialize()
if(ispath(skillset))
skillset = new skillset(src)
@@ -235,10 +211,11 @@
/mob/proc/Life()
SHOULD_NOT_SLEEP(TRUE)
+ SHOULD_CALL_PARENT(TRUE)
if(QDELETED(src))
return PROCESS_KILL
- if(ability_master)
- ability_master.update_spells(0)
+ // Alerts will be set by logic higher in the call chain.
+ CLEAR_HUD_ALERTS(src)
#define UNBUCKLED 0
#define PARTIALLY_BUCKLED 1
@@ -962,13 +939,15 @@
/mob/proc/throw_mode_off()
src.in_throw_mode = 0
- if(src.throw_icon) //in case we don't have the HUD and we use the hotkey
- src.throw_icon.icon_state = "act_throw_off"
+ var/obj/screen/throw_icon = get_hud_element(/decl/hud_element/throwing)
+ if(throw_icon) //in case we don't have the HUD and we use the hotkey
+ throw_icon.icon_state = "act_throw_off"
/mob/proc/throw_mode_on()
src.in_throw_mode = 1
- if(src.throw_icon)
- src.throw_icon.icon_state = "act_throw_on"
+ var/obj/screen/throw_icon = get_hud_element(/decl/hud_element/throwing)
+ if(throw_icon)
+ throw_icon.icon_state = "act_throw_on"
/mob/proc/toggle_antag_pool()
set name = "Toggle Add-Antag Candidacy"
@@ -990,7 +969,7 @@
return (!alpha || !mouse_opacity || viewer.see_invisible < invisibility)
/client/proc/check_has_body_select()
- return mob && mob.hud_used && istype(mob.zone_sel, /obj/screen/zone_selector)
+ return istype(mob?.get_hud_element(/decl/hud_element/zone_selector), /obj/screen/zone_selector)
/client/verb/body_toggle_head()
set name = "body-toggle-head"
@@ -1030,8 +1009,9 @@
/client/proc/toggle_zone_sel(list/zones)
if(!check_has_body_select())
return
- var/obj/screen/zone_selector/selector = mob.zone_sel
- selector.set_selected_zone(next_in_list(mob.get_target_zone(),zones))
+ var/obj/screen/zone_selector/selector = mob?.get_hud_element(/decl/hud_element/zone_selector)
+ if(selector)
+ selector.set_selected_zone(next_in_list(selector.selecting, zones))
/mob/proc/has_admin_rights()
return check_rights(R_ADMIN, 0, src)
@@ -1331,8 +1311,18 @@
/mob/proc/toggle_internals(var/mob/living/user)
return
+/mob/Move()
+ . = ..()
+ if(. && client)
+ var/obj/screen/up_hint = get_hud_element(/decl/hud_element/up_hint)
+ if(up_hint)
+ var/turf/above = GetAbove(src)
+ up_hint.icon_state = "uphint[!!(above && TURF_IS_MIMICKING(above))]"
+
/mob/proc/get_target_zone()
- return zone_sel?.selecting
+ var/obj/screen/zone_selector/zone_sel = get_hud_element(/decl/hud_element/zone_selector)
+ if(istype(zone_sel))
+ return zone_sel?.selecting
/mob/proc/get_temperature_threshold(var/threshold)
switch(threshold)
@@ -1360,3 +1350,9 @@
// Gets the ID card of a mob, but will not check types in the exceptions list
/mob/GetIdCard(exceptions = null)
return LAZYACCESS(GetIdCards(exceptions), 1)
+
+/mob/proc/get_ideal_bodytemp()
+ var/decl/species/my_species = get_species()
+ if(my_species)
+ return (my_species.body_temperature - bodytemperature)
+ return null
diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm
index 2a4d148347d5..2f2ba17fdcc3 100644
--- a/code/modules/mob/mob_defines.dm
+++ b/code/modules/mob/mob_defines.dm
@@ -39,36 +39,6 @@
var/stat = CONSCIOUS //Whether a mob is alive or dead. TODO: Move this to living - Nodrak
- var/obj/screen/cells = null
-
- var/obj/screen/hands = null
- var/obj/screen/internals = null
- var/obj/screen/oxygen = null
- var/obj/screen/toxin = null
- var/obj/screen/fire = null
- var/obj/screen/bodytemp = null
- var/obj/screen/healths = null
- var/obj/screen/throw_icon = null
- var/obj/screen/nutrition_icon = null
- var/obj/screen/hydration_icon = null
- var/obj/screen/pressure = null
- var/obj/screen/pain = null
- var/obj/screen/up_hint = null
- var/obj/screen/gun/item/item_use_icon = null
- var/obj/screen/gun/radio/radio_use_icon = null
- var/obj/screen/gun/move/gun_move_icon = null
- var/obj/screen/gun/mode/gun_setting_icon = null
-
- var/obj/screen/ability_master/ability_master = null
-
- /*A bunch of this stuff really needs to go under their own defines instead of being globally attached to mob.
- A variable should only be globally attached to turfs/objects/whatever, when it is in fact needed as such.
- The current method unnecessarily clusters up the variable list, especially for humans (although rearranging won't really clean it up a lot but the difference will be noticable for other mobs).
- I'll make some notes on where certain variable defines should probably go.
- Changing this around would probably require a good look-over the pre-existing code.
- */
- var/obj/screen/zone_selector/zone_sel = null
-
/// Cursor icon used when holding shift over things.
var/examine_cursor_icon = 'icons/effects/mouse_pointers/examine_pointer.dmi'
diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm
index 4987b21e8d2b..1acebb33cbd0 100644
--- a/code/modules/mob/mob_helpers.dm
+++ b/code/modules/mob/mob_helpers.dm
@@ -13,7 +13,7 @@
return FALSE //M is too small to wield this
return TRUE
-/mob/living/proc/isSynthetic()
+/mob/proc/isSynthetic()
return 0
/mob/living/carbon/human/isSynthetic()
@@ -375,6 +375,8 @@ var/global/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HURT)
set name = "a-intent"
set hidden = 1
+ var/obj/screen/action_intent = get_hud_element(/decl/hud_element/action_intent)
+
if(can_change_intent())
switch(input)
if(I_HELP,I_DISARM,I_GRAB,I_HURT)
@@ -383,8 +385,8 @@ var/global/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HURT)
a_intent = intent_numeric((intent_numeric(a_intent)+1) % 4)
if("left")
a_intent = intent_numeric((intent_numeric(a_intent)+3) % 4)
- if(hud_used && hud_used.action_intent)
- hud_used.action_intent.icon_state = "intent_[a_intent]"
+ if(action_intent)
+ action_intent.icon_state = "intent_[a_intent]"
else if(isrobot(src))
switch(input)
@@ -394,11 +396,11 @@ var/global/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HURT)
a_intent = I_HURT
if("right","left")
a_intent = intent_numeric(intent_numeric(a_intent) - 3)
- if(hud_used && hud_used.action_intent)
+ if(action_intent)
if(a_intent == I_HURT)
- hud_used.action_intent.icon_state = I_HURT
+ action_intent.icon_state = I_HURT
else
- hud_used.action_intent.icon_state = I_HELP
+ action_intent.icon_state = I_HELP
/mob/proc/welding_eyecheck()
return
diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm
index 6868751a02fc..fa05fd8700ec 100644
--- a/code/modules/mob/mob_movement.dm
+++ b/code/modules/mob/mob_movement.dm
@@ -273,8 +273,9 @@
/mob/proc/set_move_intent(var/decl/move_intent/next_intent)
if(next_intent && move_intent != next_intent && next_intent.can_be_used_by(src))
move_intent = next_intent
- if(hud_used)
- hud_used.move_intent.icon_state = move_intent.hud_icon_state
+ var/obj/screen/hud_move_intent = get_hud_element(/decl/hud_element/move_intent)
+ if(hud_move_intent)
+ hud_move_intent.icon_state = move_intent.hud_icon_state
return TRUE
return FALSE
diff --git a/code/modules/organs/external/_external.dm b/code/modules/organs/external/_external.dm
index 767a0c3affcb..58e38e1f5a9f 100644
--- a/code/modules/organs/external/_external.dm
+++ b/code/modules/organs/external/_external.dm
@@ -417,7 +417,6 @@
/obj/item/organ/external/update_organ_health()
damage = min(max_damage, (brute_dam + burn_dam))
- return
//If "in_place" is TRUE will make organs skip their install/uninstall effects and the sub-limbs and internal organs
/obj/item/organ/external/do_install(mob/living/carbon/human/target, obj/item/organ/external/affected, in_place, update_icon, detached)
diff --git a/code/modules/organs/internal/lungs.dm b/code/modules/organs/internal/lungs.dm
index a5e4ca1812e5..b40d49ca4a11 100644
--- a/code/modules/organs/internal/lungs.dm
+++ b/code/modules/organs/internal/lungs.dm
@@ -199,12 +199,12 @@
to_chat(owner, SPAN_NOTICE("It gets easier to breathe."))
breath_fail_ratio = clamp(0,breath_fail_ratio-0.05,1)
- owner.oxygen_alert = failed_inhale * 2
-
+ var/alert_val = (failed_inhale * 2)
+ SET_HUD_ALERT(owner, /decl/hud_element/condition/oxygen, alert_val)
var/inhaled_gas_used = inhaling / 4
breath.adjust_gas(breath_type, -inhaled_gas_used, update = 0) //update afterwards
- owner.toxins_alert = 0 // Reset our toxins alert for now.
+ SET_HUD_ALERT(owner, /decl/hud_element/condition/toxins, 0)
if(!failed_inhale) // Enough gas to tell we're being poisoned via chemical burns or whatever.
var/poison_total = 0
if(poison_types)
@@ -212,7 +212,7 @@
if(poison_types[gname])
poison_total += breath.gas[gname]
if(((poison_total/breath.total_moles)*breath_pressure) > safe_toxins_max)
- owner.toxins_alert = 1
+ SET_HUD_ALERT(owner, /decl/hud_element/condition/toxins, 1)
// Pass reagents from the gas into our body.
// Presumably if you breathe it you have a specialized metabolism for it, so we drop/ignore breath_type. Also avoids
@@ -252,7 +252,7 @@
if(failed_breath)
handle_failed_breath()
else
- owner.oxygen_alert = 0
+ SET_HUD_ALERT(owner, /decl/hud_element/condition/oxygen, 0)
return failed_breath
/obj/item/organ/internal/lungs/proc/handle_failed_breath()
@@ -266,7 +266,7 @@
if(damage || GET_CHEMICAL_EFFECT(owner, CE_BREATHLOSS) || world.time > last_successful_breath + 2 MINUTES)
owner.adjustOxyLoss(HUMAN_MAX_OXYLOSS*breath_fail_ratio)
- owner.oxygen_alert = max(owner.oxygen_alert, 2)
+ SET_HUD_ALERT_MAX(owner, /decl/hud_element/condition/oxygen, 2)
last_int_pressure = 0
/obj/item/organ/internal/lungs/proc/handle_temperature_effects(datum/gas_mixture/breath)
@@ -289,7 +289,9 @@
owner.apply_damage(damage, BURN, BP_HEAD, used_weapon = "Excessive Cold")
else
src.damage += damage
- owner.fire_alert = 1
+ if(owner.hud_used)
+ SET_HUD_ALERT_MAX(owner, /decl/hud_element/condition/fire, 1)
+
else if(breath.temperature >= heat_1)
if(prob(20))
to_chat(owner, "You feel your face burning and a searing heat in your lungs!")
@@ -305,7 +307,7 @@
owner.apply_damage(damage, BURN, BP_HEAD, used_weapon = "Excessive Heat")
else
src.damage += damage
- owner.fire_alert = 2
+ SET_HUD_ALERT(owner, /decl/hud_element/condition/fire, 2)
//breathing in hot/cold air also heats/cools you a bit
var/temp_adj = breath.temperature - owner.bodytemperature
diff --git a/code/modules/organs/pain.dm b/code/modules/organs/pain.dm
index d9bff64a519c..ffedb2e12933 100644
--- a/code/modules/organs/pain.dm
+++ b/code/modules/organs/pain.dm
@@ -1,12 +1,13 @@
/mob/proc/flash_pain(var/target)
- if(pain)
+ var/obj/screen/pain_overlay = get_hud_element(/decl/hud_element/pain)
+ if(pain_overlay)
var/matrix/M
if(client && max(client.last_view_x_dim, client.last_view_y_dim) > 7)
M = matrix()
M.Scale(CEILING(client.last_view_x_dim/7), CEILING(client.last_view_y_dim/7))
- pain.transform = M
- animate(pain, alpha = target, time = 15, easing = ELASTIC_EASING)
- animate(pain, alpha = 0, time = 20)
+ pain_overlay.transform = M
+ animate(pain_overlay, alpha = target, time = 15, easing = ELASTIC_EASING)
+ animate(pain_overlay, alpha = 0, time = 20)
/mob/living/proc/can_feel_pain(var/check_organ)
if(check_organ)
diff --git a/code/modules/organs/prosthetics/_prosthetics.dm b/code/modules/organs/prosthetics/_prosthetics.dm
index 1b742282f6f4..ff12fc275c27 100644
--- a/code/modules/organs/prosthetics/_prosthetics.dm
+++ b/code/modules/organs/prosthetics/_prosthetics.dm
@@ -139,12 +139,12 @@
var/obj/item/organ/external/E = get_active_hand()
if(!check_can_attach_modular_limb(E))
return FALSE
+ set_special_ability_cooldown(2 SECONDS)
if(!do_after(src, 2 SECONDS, src))
return FALSE
if(!check_can_attach_modular_limb(E))
return FALSE
- set_special_ability_cooldown(2 SECONDS)
drop_from_inventory(E)
src.add_organ(E)
@@ -173,12 +173,12 @@
var/obj/item/organ/external/E = input(usr, "Which limb do you wish to detach?", "Limb Removal") as null|anything in detachable_limbs
if(!check_can_detach_modular_limb(E))
return FALSE
+ set_special_ability_cooldown(2 SECONDS)
if(!do_after(src, 2 SECONDS, src))
return FALSE
if(!check_can_detach_modular_limb(E))
return FALSE
- set_special_ability_cooldown(2 SECONDS)
remove_organ(E, update_icon = TRUE)
E.dropInto(loc)
put_in_hands(E)
diff --git a/code/modules/projectiles/targeting/targeting_client.dm b/code/modules/projectiles/targeting/targeting_client.dm
index eeaf61909deb..0facc51e6012 100644
--- a/code/modules/projectiles/targeting/targeting_client.dm
+++ b/code/modules/projectiles/targeting/targeting_client.dm
@@ -1,12 +1,16 @@
//These are called by the on-screen buttons, adjusting what the victim can and cannot do.
/client/proc/add_gun_icons()
- if(!usr || !usr.item_use_icon) return 1 // This can runtime if someone manages to throw a gun out of their hand before the proc is called.
- screen |= usr.item_use_icon
- screen |= usr.gun_move_icon
- screen |= usr.radio_use_icon
+ if(!usr?.hud_used)
+ return
+ for(var/elem_type in global.gun_hud_flag_decl_types)
+ var/obj/screen/elem = usr.get_hud_element(elem_type)
+ if(elem)
+ screen |= elem
/client/proc/remove_gun_icons()
- if(!usr) return 1 // Runtime prevention on N00k agents spawning with SMG
- screen -= usr.item_use_icon
- screen -= usr.gun_move_icon
- screen -= usr.radio_use_icon
+ if(!usr?.hud_used)
+ return
+ for(var/elem_type in global.gun_hud_flag_decl_types)
+ var/obj/screen/elem = usr.get_hud_element(elem_type)
+ if(elem)
+ screen -= elem
diff --git a/code/modules/projectiles/targeting/targeting_overlay.dm b/code/modules/projectiles/targeting/targeting_overlay.dm
index 7fba09b612a8..21a6bc1534c6 100644
--- a/code/modules/projectiles/targeting/targeting_overlay.dm
+++ b/code/modules/projectiles/targeting/targeting_overlay.dm
@@ -32,29 +32,13 @@
target_permissions |= perm
// Update HUD icons.
- if(owner.gun_move_icon)
- if(!(target_permissions & TARGET_CAN_MOVE))
- owner.gun_move_icon.icon_state = "no_walk0"
- owner.gun_move_icon.SetName("Allow Movement")
- else
- owner.gun_move_icon.icon_state = "no_walk1"
- owner.gun_move_icon.SetName("Disallow Movement")
-
- if(owner.item_use_icon)
- if(!(target_permissions & TARGET_CAN_CLICK))
- owner.item_use_icon.icon_state = "no_item0"
- owner.item_use_icon.SetName("Allow Item Use")
- else
- owner.item_use_icon.icon_state = "no_item1"
- owner.item_use_icon.SetName("Disallow Item Use")
+ if(!owner?.hud_used)
+ return
- if(owner.radio_use_icon)
- if(!(target_permissions & TARGET_CAN_RADIO))
- owner.radio_use_icon.icon_state = "no_radio0"
- owner.radio_use_icon.SetName("Allow Radio Use")
- else
- owner.radio_use_icon.icon_state = "no_radio1"
- owner.radio_use_icon.SetName("Disallow Radio Use")
+ for(var/gun_flag_elem in global.gun_hud_flag_decl_types)
+ var/obj/screen/gun_flag/gun_elem = owner.get_hud_element(gun_flag_elem)
+ if(istype(gun_elem))
+ gun_elem.update_from_aiming_overlay(src)
var/message = "no longer permitted to "
var/use_span = "warning"
@@ -206,7 +190,11 @@
if(!no_message)
to_chat(owner, "You will no longer aim rather than fire.")
owner.client.remove_gun_icons()
- owner.gun_setting_icon.icon_state = "gun[active]"
+
+ if(istype(owner.hud_used))
+ var/obj/screen/gun_mode/gun_mode = owner.get_hud_element(/decl/hud_element/gun_mode)
+ if(gun_mode)
+ gun_mode.icon_state = "gun[!!active]"
/obj/aiming_overlay/proc/cancel_aiming(var/no_message = 0)
if(!aiming_with || !aiming_at)
diff --git a/code/modules/species/species.dm b/code/modules/species/species.dm
index ae8f3b987282..99f0a3acdd8c 100644
--- a/code/modules/species/species.dm
+++ b/code/modules/species/species.dm
@@ -141,7 +141,7 @@ var/global/const/DEFAULT_SPECIES_HEALTH = 200
// HUD data vars.
var/datum/hud_data/hud
- var/hud_type
+ var/species_hud_type
var/grab_type = /decl/grab/normal/passive // The species' default grab type.
@@ -342,8 +342,8 @@ var/global/const/DEFAULT_SPECIES_HEALTH = 200
if(!default_cultural_info[token])
default_cultural_info[token] = global.using_map.default_cultural_info[token]
- if(hud_type)
- hud = new hud_type()
+ if(species_hud_type)
+ hud = new species_hud_type()
else
hud = new()
diff --git a/code/modules/species/species_hud.dm b/code/modules/species/species_hud.dm
index d18384bffa02..25f6d608d9d4 100644
--- a/code/modules/species/species_hud.dm
+++ b/code/modules/species/species_hud.dm
@@ -1,17 +1,5 @@
/datum/hud_data
var/icon // If set, overrides ui_style.
- var/has_a_intent = 1 // Set to draw intent box.
- var/has_m_intent = 1 // Set to draw move intent box.
- var/has_warnings = 1 // Set to draw environment warnings.
- var/has_pressure = 1 // Draw the pressure indicator.
- var/has_nutrition = 1 // Draw the nutrition indicator.
- var/has_bodytemp = 1 // Draw the bodytemp indicator.
- var/has_hands = 1 // Set to draw hands.
- var/has_drop = 1 // Set to draw drop button.
- var/has_throw = 1 // Set to draw throw button.
- var/has_resist = 1 // Set to draw resist button.
- var/has_internals = 1 // Set to draw the internals toggle button.
- var/has_up_hint = 1 // Set to draw the "look-up" hint icon
var/list/equip_slots = list() // Checked by mob_can_equip().
var/list/persistent_slots = list() // Built in New(), used for unhidable inv updates
var/list/hidden_slots = list() // Built in New(), used for hidable inv updates
@@ -50,8 +38,7 @@
else if(slot_id in global.hidden_inventory_slots)
hidden_slots |= slot_id
- if(has_hands)
- equip_slots |= slot_handcuffed_str
+ equip_slots |= slot_handcuffed_str
if(slot_back_str in equip_slots)
equip_slots |= slot_in_backpack_str
diff --git a/code/modules/species/species_shapeshifter.dm b/code/modules/species/species_shapeshifter.dm
index 8f961808c309..d639c047edc0 100644
--- a/code/modules/species/species_shapeshifter.dm
+++ b/code/modules/species/species_shapeshifter.dm
@@ -86,7 +86,7 @@ var/global/list/wrapped_species_by_ref = list()
set name = "Select Body Shape"
set category = "Abilities"
- if(stat ||is_on_special_ability_cooldown())
+ if(stat || is_on_special_ability_cooldown())
return
set_special_ability_cooldown(5 SECONDS)
diff --git a/code/modules/species/station/monkey.dm b/code/modules/species/station/monkey.dm
index 9d72c6ef81f2..9b97a2ad3b07 100644
--- a/code/modules/species/station/monkey.dm
+++ b/code/modules/species/station/monkey.dm
@@ -17,7 +17,7 @@
unarmed_attacks = list(/decl/natural_attack/bite, /decl/natural_attack/claws, /decl/natural_attack/punch)
inherent_verbs = list(/mob/living/proc/ventcrawl)
- hud_type = /datum/hud_data/monkey
+ species_hud_type = /datum/hud_data/monkey
meat_type = /obj/item/chems/food/meat/monkey
rarity_value = 0.1
diff --git a/code/modules/spells/contracts.dm b/code/modules/spells/contracts.dm
index 1037d04b65d9..c05b875685ab 100644
--- a/code/modules/spells/contracts.dm
+++ b/code/modules/spells/contracts.dm
@@ -1,7 +1,7 @@
/obj/item/contract
name = "contract"
desc = "written in the blood of some unfortunate fellow."
- icon = 'icons/mob/screen_spells.dmi'
+ icon = 'icons/mob/screen/spells.dmi'
icon_state = "master_open"
material = /decl/material/solid/cardboard //#TODO: replace with paper
var/contract_master = null
diff --git a/code/modules/spells/hand/hand_item.dm b/code/modules/spells/hand/hand_item.dm
index 855cfdcfa921..dd5f6ee6d906 100644
--- a/code/modules/spells/hand/hand_item.dm
+++ b/code/modules/spells/hand/hand_item.dm
@@ -4,12 +4,12 @@ Basically: I can use it to target things where I click. I can then pass these ta
/obj/item/magic_hand
name = "Magic Hand"
- icon = 'icons/mob/screen1.dmi'
+ icon = 'icons/mob/screen/spells.dmi'
+ icon_state = "spell"
atom_flags = 0
item_flags = 0
obj_flags = 0
simulated = 0
- icon_state = "spell"
max_health = ITEM_HEALTH_NO_DAMAGE
is_spawnable_type = FALSE
var/next_spell_time = 0
diff --git a/code/modules/spells/spell_code.dm b/code/modules/spells/spell_code.dm
index 24e24974449a..c9331cb396aa 100644
--- a/code/modules/spells/spell_code.dm
+++ b/code/modules/spells/spell_code.dm
@@ -240,7 +240,7 @@ var/global/list/spells = typesof(/spell) //needed for the badmin verb for now
if(holder == user)
if(istype(user, /mob/living/simple_animal))
var/mob/living/simple_animal/SA = user
- if(SA.purge)
+ if(SA.purged_time)
to_chat(SA, "The null sceptre's power interferes with your own!")
return 0
diff --git a/code/modules/spells/spells.dm b/code/modules/spells/spells.dm
index 19ad57ce0e96..61b39e603bef 100644
--- a/code/modules/spells/spells.dm
+++ b/code/modules/spells/spells.dm
@@ -3,18 +3,8 @@
/mob/Stat()
. = ..()
- if(. && ability_master && ability_master.spell_objects)
- for(var/obj/screen/ability/spell/screen in ability_master.spell_objects)
- var/spell/S = screen.spell
- if((!S.connected_button) || !statpanel(S.panel))
- continue //Not showing the noclothes spell
- switch(S.charge_type)
- if(Sp_RECHARGE)
- statpanel(S.panel,"[S.charge_counter/10.0]/[S.charge_max/10]",S.connected_button)
- if(Sp_CHARGES)
- statpanel(S.panel,"[S.charge_counter]/[S.charge_max]",S.connected_button)
- if(Sp_HOLDVAR)
- statpanel(S.panel,"[S.holder_var_type] [S.holder_var_amount]",S.connected_button)
+ if(. && istype(hud_used))
+ hud_used.refresh_stat_panel()
/proc/restore_spells(var/mob/H)
if(H.mind && H.mind.learned_spells)
@@ -27,11 +17,14 @@
for(var/spell/spell_to_add in spells)
H.add_spell(spell_to_add)
- H.ability_master.update_abilities(0,H)
+ var/obj/screen/ability_master/ability_master = H.get_hud_element(/decl/hud_element/ability_master)
+ if(ability_master)
+ ability_master.update_abilities(0,H)
/mob/proc/add_spell(var/spell/spell_to_add, var/spell_base = "wiz_spell_ready")
+ var/obj/screen/ability_master/ability_master = get_hud_element(/decl/hud_element/ability_master)
if(!ability_master)
- ability_master = new()
+ return
spell_to_add.holder = src
if(mind)
if(!mind.learned_spells)
@@ -46,6 +39,7 @@
if(mind)
mind.learned_spells -= spell_to_remove
+ var/obj/screen/ability_master/ability_master = get_hud_element(/decl/hud_element/ability_master)
if (ability_master)
ability_master.remove_ability(ability_master.get_ability_by_spell(spell_to_remove))
return 1
@@ -53,8 +47,6 @@
/mob/proc/silence_spells(var/amount = 0)
if(amount < 0)
return
-
- if(!ability_master)
- return
-
- ability_master.silence_spells(amount)
\ No newline at end of file
+ var/obj/screen/ability_master/ability_master = get_hud_element(/decl/hud_element/ability_master)
+ if(ability_master)
+ ability_master.silence_spells(amount)
diff --git a/code/modules/spells/targeted/equip/burning_touch.dm b/code/modules/spells/targeted/equip/burning_touch.dm
index b9b8ee356297..aa1cb0c9705b 100644
--- a/code/modules/spells/targeted/equip/burning_touch.dm
+++ b/code/modules/spells/targeted/equip/burning_touch.dm
@@ -16,7 +16,7 @@
/obj/item/flame/hands
name = "Burning Hand"
- icon = 'icons/mob/screen1.dmi'
+ icon = 'icons/mob/screen/grabs.dmi'
icon_state = "grabbed+1"
force = 10
damtype = BURN
diff --git a/code/modules/supermatter/setup_supermatter.dm b/code/modules/supermatter/setup_supermatter.dm
index f0f845d580b3..f9a6ee14d290 100644
--- a/code/modules/supermatter/setup_supermatter.dm
+++ b/code/modules/supermatter/setup_supermatter.dm
@@ -105,7 +105,7 @@ var/global/list/engine_setup_markers = list()
invisibility = 101
anchored = TRUE
density = FALSE
- icon = 'icons/mob/screen1.dmi'
+ icon = 'icons/mob/screen/crosses.dmi'
icon_state = "x3"
/obj/effect/engine_setup/Initialize()
diff --git a/code/unit_tests/mob_tests.dm b/code/unit_tests/mob_tests.dm
index 62ad269b5341..d069049a6444 100644
--- a/code/unit_tests/mob_tests.dm
+++ b/code/unit_tests/mob_tests.dm
@@ -252,7 +252,7 @@ var/global/default_mobloc = null
/datum/unit_test/robot_module_icons
name = "MOB: Robot Modules Shall Have UI Icons"
- var/icon_file = 'icons/mob/screen1_robot.dmi'
+ var/icon_file = 'icons/mob/screen/robot_modules.dmi'
/datum/unit_test/robot_module_icons/start_test()
var/failed = 0
diff --git a/icons/mob/screen_ai.dmi b/icons/mob/screen/ai.dmi
similarity index 100%
rename from icons/mob/screen_ai.dmi
rename to icons/mob/screen/ai.dmi
diff --git a/icons/mob/screen/arrow.dmi b/icons/mob/screen/arrow.dmi
new file mode 100644
index 000000000000..af9ab119939a
Binary files /dev/null and b/icons/mob/screen/arrow.dmi differ
diff --git a/icons/mob/screen/condition.dmi b/icons/mob/screen/condition.dmi
new file mode 100644
index 000000000000..b602ea27580c
Binary files /dev/null and b/icons/mob/screen/condition.dmi differ
diff --git a/icons/mob/screen/construct.dmi b/icons/mob/screen/construct.dmi
new file mode 100644
index 000000000000..5c7193ccd1b5
Binary files /dev/null and b/icons/mob/screen/construct.dmi differ
diff --git a/icons/mob/screen/crosses.dmi b/icons/mob/screen/crosses.dmi
new file mode 100644
index 000000000000..cc711a7a0c01
Binary files /dev/null and b/icons/mob/screen/crosses.dmi differ
diff --git a/icons/mob/screen/fill.dmi b/icons/mob/screen/fill.dmi
new file mode 100644
index 000000000000..712f127bac97
Binary files /dev/null and b/icons/mob/screen/fill.dmi differ
diff --git a/icons/mob/screen_full.dmi b/icons/mob/screen/full.dmi
similarity index 100%
rename from icons/mob/screen_full.dmi
rename to icons/mob/screen/full.dmi
diff --git a/icons/mob/screen/grabs.dmi b/icons/mob/screen/grabs.dmi
new file mode 100644
index 000000000000..4058c78bef38
Binary files /dev/null and b/icons/mob/screen/grabs.dmi differ
diff --git a/icons/mob/screen/health_construct_artificer.dmi b/icons/mob/screen/health_construct_artificer.dmi
new file mode 100644
index 000000000000..ea86c13574d0
Binary files /dev/null and b/icons/mob/screen/health_construct_artificer.dmi differ
diff --git a/icons/mob/screen/health_construct_harvester.dmi b/icons/mob/screen/health_construct_harvester.dmi
new file mode 100644
index 000000000000..0e6796a431c8
Binary files /dev/null and b/icons/mob/screen/health_construct_harvester.dmi differ
diff --git a/icons/mob/screen/health_construct_juggernaut.dmi b/icons/mob/screen/health_construct_juggernaut.dmi
new file mode 100644
index 000000000000..212ebbc3e4ee
Binary files /dev/null and b/icons/mob/screen/health_construct_juggernaut.dmi differ
diff --git a/icons/mob/screen/health_construct_wraith.dmi b/icons/mob/screen/health_construct_wraith.dmi
new file mode 100644
index 000000000000..73f5a9102e78
Binary files /dev/null and b/icons/mob/screen/health_construct_wraith.dmi differ
diff --git a/icons/mob/screen/health_human.dmi b/icons/mob/screen/health_human.dmi
new file mode 100644
index 000000000000..695d606562b5
Binary files /dev/null and b/icons/mob/screen/health_human.dmi differ
diff --git a/icons/mob/screen/health_robot.dmi b/icons/mob/screen/health_robot.dmi
new file mode 100644
index 000000000000..95e64ec6b2de
Binary files /dev/null and b/icons/mob/screen/health_robot.dmi differ
diff --git a/icons/mob/screen/intent.dmi b/icons/mob/screen/intent.dmi
new file mode 100644
index 000000000000..7f38d756a141
Binary files /dev/null and b/icons/mob/screen/intent.dmi differ
diff --git a/icons/mob/screen/internals.dmi b/icons/mob/screen/internals.dmi
new file mode 100644
index 000000000000..0ddffa7023c3
Binary files /dev/null and b/icons/mob/screen/internals.dmi differ
diff --git a/icons/mob/screen/midnight.dmi b/icons/mob/screen/midnight.dmi
index 01dbd6c64791..5f0926e55285 100644
Binary files a/icons/mob/screen/midnight.dmi and b/icons/mob/screen/midnight.dmi differ
diff --git a/icons/mob/screen/minimalist.dmi b/icons/mob/screen/minimalist.dmi
index e87aebf13123..e2663fe24e1f 100644
Binary files a/icons/mob/screen/minimalist.dmi and b/icons/mob/screen/minimalist.dmi differ
diff --git a/icons/mob/screen/old-noborder.dmi b/icons/mob/screen/old-noborder.dmi
index 18e49fc9c881..e4fc7dd55c5c 100644
Binary files a/icons/mob/screen/old-noborder.dmi and b/icons/mob/screen/old-noborder.dmi differ
diff --git a/icons/mob/screen/old.dmi b/icons/mob/screen/old.dmi
index cc52abc3909b..ce5b2f074dcb 100644
Binary files a/icons/mob/screen/old.dmi and b/icons/mob/screen/old.dmi differ
diff --git a/icons/mob/screen/orange.dmi b/icons/mob/screen/orange.dmi
index cb94ada06c88..285aba3ec95b 100644
Binary files a/icons/mob/screen/orange.dmi and b/icons/mob/screen/orange.dmi differ
diff --git a/icons/mob/screen_phenomena.dmi b/icons/mob/screen/phenomena.dmi
similarity index 100%
rename from icons/mob/screen_phenomena.dmi
rename to icons/mob/screen/phenomena.dmi
diff --git a/icons/mob/screen/robot.dmi b/icons/mob/screen/robot.dmi
new file mode 100644
index 000000000000..ed581ba9975f
Binary files /dev/null and b/icons/mob/screen/robot.dmi differ
diff --git a/icons/mob/screen/robot_charge.dmi b/icons/mob/screen/robot_charge.dmi
new file mode 100644
index 000000000000..265c213516d8
Binary files /dev/null and b/icons/mob/screen/robot_charge.dmi differ
diff --git a/icons/mob/screen/robot_conditions.dmi b/icons/mob/screen/robot_conditions.dmi
new file mode 100644
index 000000000000..717853f481a3
Binary files /dev/null and b/icons/mob/screen/robot_conditions.dmi differ
diff --git a/icons/mob/screen/robot_drop_grab.dmi b/icons/mob/screen/robot_drop_grab.dmi
new file mode 100644
index 000000000000..7a1ecce37dfc
Binary files /dev/null and b/icons/mob/screen/robot_drop_grab.dmi differ
diff --git a/icons/mob/screen/robot_intent.dmi b/icons/mob/screen/robot_intent.dmi
new file mode 100644
index 000000000000..165427cc6339
Binary files /dev/null and b/icons/mob/screen/robot_intent.dmi differ
diff --git a/icons/mob/screen/robot_modules.dmi b/icons/mob/screen/robot_modules.dmi
new file mode 100644
index 000000000000..b9061e1b6c67
Binary files /dev/null and b/icons/mob/screen/robot_modules.dmi differ
diff --git a/icons/mob/screen/spells.dmi b/icons/mob/screen/spells.dmi
new file mode 100644
index 000000000000..4916ce33ab5c
Binary files /dev/null and b/icons/mob/screen/spells.dmi differ
diff --git a/icons/mob/screen/white.dmi b/icons/mob/screen/white.dmi
index 10d35d02cff4..b1b94a21056b 100644
Binary files a/icons/mob/screen/white.dmi and b/icons/mob/screen/white.dmi differ
diff --git a/icons/mob/screen1.dmi b/icons/mob/screen1.dmi
deleted file mode 100644
index 7f8db4256da5..000000000000
Binary files a/icons/mob/screen1.dmi and /dev/null differ
diff --git a/icons/mob/screen1_construct.dmi b/icons/mob/screen1_construct.dmi
deleted file mode 100644
index 67a37ccd7388..000000000000
Binary files a/icons/mob/screen1_construct.dmi and /dev/null differ
diff --git a/icons/mob/screen1_health.dmi b/icons/mob/screen1_health.dmi
deleted file mode 100644
index 9cd7a4134202..000000000000
Binary files a/icons/mob/screen1_health.dmi and /dev/null differ
diff --git a/icons/mob/screen1_robot.dmi b/icons/mob/screen1_robot.dmi
deleted file mode 100644
index c6aa98f2b1fa..000000000000
Binary files a/icons/mob/screen1_robot.dmi and /dev/null differ
diff --git a/icons/mob/screen_gen.dmi b/icons/mob/screen_gen.dmi
deleted file mode 100644
index 436fb1169a2d..000000000000
Binary files a/icons/mob/screen_gen.dmi and /dev/null differ
diff --git a/icons/mob/screen_spells.dmi b/icons/mob/screen_spells.dmi
deleted file mode 100644
index 50be07d787b8..000000000000
Binary files a/icons/mob/screen_spells.dmi and /dev/null differ
diff --git a/icons/mob/status_hunger.dmi b/icons/mob/status_hunger.dmi
deleted file mode 100644
index db92eb35581e..000000000000
Binary files a/icons/mob/status_hunger.dmi and /dev/null differ
diff --git a/icons/mob/status_indicators.dmi b/icons/mob/status_indicators.dmi
deleted file mode 100644
index 80baa88177f7..000000000000
Binary files a/icons/mob/status_indicators.dmi and /dev/null differ
diff --git a/mods/content/xenobiology/slime/_slime.dm b/mods/content/xenobiology/slime/_slime.dm
index 16bc345c5c44..110f38f1f3a5 100644
--- a/mods/content/xenobiology/slime/_slime.dm
+++ b/mods/content/xenobiology/slime/_slime.dm
@@ -20,7 +20,7 @@
bone_material = null
bone_amount = 0
ai = /datum/ai/slime
- hud_type = /datum/hud/slime
+ hud_used = /datum/hud/slime
nutrition = 800
var/is_adult = FALSE
diff --git a/mods/content/xenobiology/slime/slime_hud.dm b/mods/content/xenobiology/slime/slime_hud.dm
index f81edf4e3fd7..7e8edc17290f 100644
--- a/mods/content/xenobiology/slime/slime_hud.dm
+++ b/mods/content/xenobiology/slime/slime_hud.dm
@@ -1,11 +1 @@
-/datum/hud/slime/FinalizeInstantiation()
- src.adding = list()
-
- var/obj/screen/using
-
- using = new /obj/screen/intent()
- src.adding += using
- action_intent = using
-
- mymob.client.screen = list()
- mymob.client.screen += src.adding
+/datum/hud/slime
diff --git a/mods/mobs/borers/mob/borer/borer.dm b/mods/mobs/borers/mob/borer/borer.dm
index a7b0cb069d51..6713f224d074 100644
--- a/mods/mobs/borers/mob/borer/borer.dm
+++ b/mods/mobs/borers/mob/borer/borer.dm
@@ -25,6 +25,8 @@
bleed_colour = "#816e12"
+ hud_used = /datum/hud/borer
+
var/static/list/chemical_types = list(
"anti-trauma" = /decl/material/liquid/brute_meds,
"amphetamines" = /decl/material/liquid/amphetamines,
@@ -60,12 +62,14 @@
/mob/living/simple_animal/borer/Login()
. = ..()
+ if(hud_used)
+ hud_used.refresh_ability_hud()
if(mind && !neutered)
var/decl/special_role/borer/borers = GET_DECL(/decl/special_role/borer)
borers.add_antagonist(mind)
/mob/living/simple_animal/borer/Initialize(var/mapload, var/gen=1)
-
+ hud_used = neutered ? /datum/hud/borer : /datum/hud/borer/sterile
. = ..()
add_language(/decl/language/corticalborer)
@@ -85,6 +89,9 @@
. = ..()
set_status(STAT_BLIND, host ? GET_STATUS(host, STAT_BLIND) : 0)
set_status(STAT_BLURRY, host ? GET_STATUS(host, STAT_BLURRY) : 0)
+ . = ..()
+ if(. == PROCESS_KILL)
+ return
/mob/living/simple_animal/borer/handle_disabilities()
. = ..()
@@ -193,23 +200,10 @@
qdel(host_brain)
-#define COLOR_BORER_RED "#ff5555"
-/mob/living/simple_animal/borer/proc/set_ability_cooldown(var/amt)
- set_special_ability_cooldown(amt)
- var/datum/hud/borer/borer_hud = hud_used
- if(istype(borer_hud))
- for(var/obj/thing in borer_hud.borer_hud_elements)
- thing.color = COLOR_BORER_RED
- addtimer(CALLBACK(src, /mob/living/simple_animal/borer/proc/reset_ui_callback), amt)
-#undef COLOR_BORER_RED
-
/mob/living/simple_animal/borer/proc/leave_host()
- var/datum/hud/borer/borer_hud = hud_used
- if(istype(borer_hud))
- for(var/obj/thing in borer_hud.borer_hud_elements)
- thing.alpha = 0
- thing.invisibility = INVISIBILITY_MAXIMUM
+ if(hud_used)
+ hud_used.hide_ability_hud()
if(!host) return
diff --git a/mods/mobs/borers/mob/borer/borer_attacks.dm b/mods/mobs/borers/mob/borer/borer_attacks.dm
index b51723a88f55..97741af3fb16 100644
--- a/mods/mobs/borers/mob/borer/borer_attacks.dm
+++ b/mods/mobs/borers/mob/borer/borer_attacks.dm
@@ -31,7 +31,7 @@
to_chat(M, SPAN_WARNING("Something slimy begins probing at the opening of your ear canal..."))
to_chat(src, SPAN_NOTICE("You slither up [M] and begin probing at their ear canal..."))
- set_ability_cooldown(5 SECONDS)
+ set_special_ability_cooldown(5 SECONDS)
if(!do_after(src, 3 SECONDS, M))
return
@@ -44,11 +44,8 @@
host.status_flags |= PASSEMOTES
forceMove(host)
- var/datum/hud/borer/borer_hud = hud_used
- if(istype(borer_hud))
- for(var/obj/thing in borer_hud.borer_hud_elements)
- thing.alpha = 255
- thing.invisibility = 0
+ if(hud_used)
+ hud_used.show_ability_hud()
//Update their traitor status.
if(host.mind && !neutered)
diff --git a/mods/mobs/borers/mob/borer/borer_hud.dm b/mods/mobs/borers/mob/borer/borer_hud.dm
index 2ac50fedb9a1..982033272411 100644
--- a/mods/mobs/borers/mob/borer/borer_hud.dm
+++ b/mods/mobs/borers/mob/borer/borer_hud.dm
@@ -1,56 +1,39 @@
+#define COLOR_BORER_RED "#ff5555"
+
/datum/hud/borer
- var/list/borer_hud_elements = list()
- var/obj/screen/intent/hud_intent_selector
- var/obj/screen/borer/toggle_host_control/hud_toggle_control
- var/obj/screen/borer/inject_chemicals/hud_inject_chemicals
- var/obj/screen/borer/leave_host/hud_leave_host
-
-/datum/hud/borer/Destroy()
- QDEL_NULL_LIST(borer_hud_elements)
- hud_toggle_control = null
- hud_inject_chemicals = null
- hud_leave_host = null
- QDEL_NULL(hud_intent_selector)
- . = ..()
+ hud_elements = list(
+ /decl/hud_element/borer/inject_chems,
+ /decl/hud_element/borer/leave_host,
+ /decl/hud_element/borer/toggle_control
+ )
-/datum/hud/borer/FinalizeInstantiation()
- hud_intent_selector = new
- adding = list(hud_intent_selector)
- hud_inject_chemicals = new
- hud_leave_host = new
- borer_hud_elements = list(
- hud_inject_chemicals,
- hud_leave_host
+/datum/hud/borer/sterile
+ hud_elements = list(
+ /decl/hud_element/borer/inject_chems,
+ /decl/hud_element/borer/leave_host
)
- if(istype(mymob, /mob/living/simple_animal/borer))
- var/mob/living/simple_animal/borer/borer = mymob
- if(!borer.neutered)
- hud_toggle_control = new
- borer_hud_elements += hud_toggle_control
- adding += borer_hud_elements
- if(mymob)
- var/mob/living/simple_animal/borer/borer = mymob
- if(istype(borer) && borer.host)
- for(var/obj/thing in borer_hud_elements)
- thing.alpha = 255
- thing.invisibility = 0
- if(mymob.client)
- mymob.client.screen |= adding
-
-/mob/living/simple_animal/borer
- hud_type = /datum/hud/borer
-
-/mob/living/simple_animal/borer/proc/reset_ui_callback()
- if(!is_on_special_ability_cooldown())
- var/datum/hud/borer/borer_hud = hud_used
- if(istype(borer_hud))
- for(var/obj/thing in borer_hud.borer_hud_elements)
- thing.color = null
+
+/datum/hud/borer/should_show_ability_hud()
+ var/mob/living/simple_animal/borer/borer = mymob
+ return istype(borer) && borer.host
+
+/decl/hud_element/borer
+ abstract_type = /decl/hud_element/borer
+ apply_color_on_cooldown = TRUE
+ hidable = TRUE
+
+/decl/hud_element/borer/inject_chems
+ screen_object_type = /obj/screen/borer/inject_chemicals
+
+/decl/hud_element/borer/leave_host
+ screen_object_type = /obj/screen/borer/leave_host
+
+/decl/hud_element/borer/toggle_control
+ screen_object_type = /obj/screen/borer/toggle_host_control
/obj/screen/borer
icon = 'mods/mobs/borers/icons/borer_ui.dmi'
alpha = 0
- invisibility = INVISIBILITY_MAXIMUM
/obj/screen/borer/Click(location, control, params)
if(!istype(usr, /mob/living/simple_animal/borer))
diff --git a/mods/mobs/dionaea/mob/_nymph.dm b/mods/mobs/dionaea/mob/_nymph.dm
index 6bc927aba7ae..5e91e0a42ffa 100644
--- a/mods/mobs/dionaea/mob/_nymph.dm
+++ b/mods/mobs/dionaea/mob/_nymph.dm
@@ -1,7 +1,6 @@
#define DIONA_SCREEN_LOC_HELD "RIGHT-8:16,BOTTOM:5"
#define DIONA_SCREEN_LOC_HAT "RIGHT-7:16,BOTTOM:5"
#define DIONA_SCREEN_LOC_INTENT "RIGHT-2,BOTTOM:5"
-#define DIONA_SCREEN_LOC_HEALTH ui_alien_health
/datum/extension/hattable/diona_nymph/wear_hat(mob/wearer, obj/item/clothing/head/new_hat)
var/mob/living/carbon/alien/diona/doona = wearer
@@ -34,7 +33,7 @@
holder_type = /obj/item/holder/diona
possession_candidate = 1
atom_flags = ATOM_FLAG_NO_TEMP_CHANGE | ATOM_FLAG_NO_REACT
- hud_type = /datum/hud/diona_nymph
+ hud_used = /datum/hud/diona_nymph
ai = /datum/ai/nymph
diff --git a/mods/mobs/dionaea/mob/nymph_ui.dm b/mods/mobs/dionaea/mob/nymph_ui.dm
index 248a637f2195..df1d76cbffe1 100644
--- a/mods/mobs/dionaea/mob/nymph_ui.dm
+++ b/mods/mobs/dionaea/mob/nymph_ui.dm
@@ -1,3 +1,6 @@
+/decl/hud_element/action_intent/diona_nymph
+ screen_object_type = /obj/screen/intent/diona_nymph
+
/obj/screen/intent/diona_nymph
icon_state = "intent_devour"
screen_loc = DIONA_SCREEN_LOC_INTENT
@@ -42,39 +45,17 @@
return 255
/datum/hud/diona_nymph/FinalizeInstantiation()
-
var/ui_style = get_ui_style()
var/ui_color = get_ui_color()
var/ui_alpha = get_ui_alpha()
-
- src.adding = list()
- src.other = list()
-
hat = new
hat.icon = ui_style
hat.color = ui_color
hat.alpha = ui_alpha
- adding += hat
-
+ misc_hud_elements += hat
held = new
held.icon = ui_style
held.color = ui_color
held.alpha = ui_alpha
- adding += held
-
- action_intent = new /obj/screen/intent/diona_nymph()
- action_intent.icon = ui_style
- action_intent.color = ui_color
- action_intent.alpha = ui_alpha
- adding += action_intent
-
- mymob.healths = new /obj/screen()
- mymob.healths.icon = ui_style
- mymob.healths.color = ui_color
- mymob.healths.alpha = ui_alpha
- mymob.healths.icon_state = "health0"
- mymob.healths.SetName("health")
- mymob.healths.screen_loc = DIONA_SCREEN_LOC_HEALTH
-
- mymob.client.screen = list(mymob.healths)
- mymob.client.screen += src.adding + src.other
+ misc_hud_elements += held
+ return ..()
diff --git a/mods/mobs/dionaea/mob/~diona.dm b/mods/mobs/dionaea/mob/~diona.dm
index 0df03ea0e903..f30cb151165e 100644
--- a/mods/mobs/dionaea/mob/~diona.dm
+++ b/mods/mobs/dionaea/mob/~diona.dm
@@ -1,4 +1,3 @@
#undef DIONA_SCREEN_LOC_HELD
#undef DIONA_SCREEN_LOC_HAT
#undef DIONA_SCREEN_LOC_INTENT
-#undef DIONA_SCREEN_LOC_HEALTH
\ No newline at end of file
diff --git a/mods/species/ascent/mobs/nymph/_nymph.dm b/mods/species/ascent/mobs/nymph/_nymph.dm
index 85e4e45461ac..c78d3e6320eb 100644
--- a/mods/species/ascent/mobs/nymph/_nymph.dm
+++ b/mods/species/ascent/mobs/nymph/_nymph.dm
@@ -2,7 +2,6 @@
#define ANYMPH_SCREEN_LOC_HAT "RIGHT-7:16,BOTTOM:5"
#define ANYMPH_SCREEN_LOC_MOLT "RIGHT-6:16,BOTTOM:5"
#define ANYMPH_SCREEN_LOC_INTENT "RIGHT-2,BOTTOM:5"
-#define ANYMPH_SCREEN_LOC_HEALTH ui_alien_health
#define ANYMPH_MAX_CRYSTALS 20000
#define ANYMPH_CRYSTAL_MOLT 2000 // How much it takes to molt.
@@ -30,7 +29,7 @@
holder_type = /obj/item/holder/ascent_nymph
possession_candidate = 1
atom_flags = ATOM_FLAG_NO_TEMP_CHANGE | ATOM_FLAG_NO_REACT
- hud_type = /datum/hud/ascent_nymph
+ hud_used = /datum/hud/ascent_nymph
var/obj/item/holding_item
var/crystal_reserve = 1000
diff --git a/mods/species/ascent/mobs/nymph/nymph_life.dm b/mods/species/ascent/mobs/nymph/nymph_life.dm
index c907118b9c9e..541290031de7 100644
--- a/mods/species/ascent/mobs/nymph/nymph_life.dm
+++ b/mods/species/ascent/mobs/nymph/nymph_life.dm
@@ -1,25 +1,8 @@
/mob/living/carbon/alien/ascent_nymph/handle_regular_hud_updates()
. = ..()
- if(!.)
+ if(. == PROCESS_KILL || stat == DEAD)
return
- var/datum/hud/ascent_nymph/nymph_hud = hud_used
- if(!istype(nymph_hud))
- return
- if(nymph_hud.food)
- switch(nutrition)
- if(450 to INFINITY) nymph_hud.food.icon_state = "nutrition0"
- if(350 to 450) nymph_hud.food.icon_state = "nutrition1"
- if(250 to 350) nymph_hud.food.icon_state = "nutrition2"
- if(150 to 250) nymph_hud.food.icon_state = "nutrition3"
- else nymph_hud.food.icon_state = "nutrition4"
- if(nymph_hud.drink)
- switch(hydration)
- if(450 to INFINITY) nymph_hud.drink.icon_state = "hydration0"
- if(350 to 450) nymph_hud.drink.icon_state = "hydration1"
- if(250 to 350) nymph_hud.drink.icon_state = "hydration2"
- if(150 to 250) nymph_hud.drink.icon_state = "hydration3"
- else nymph_hud.drink.icon_state = "hydration4"
/mob/living/carbon/alien/ascent_nymph/handle_nutrition_and_hydration()
. = ..()
diff --git a/mods/species/ascent/mobs/nymph/nymph_ui.dm b/mods/species/ascent/mobs/nymph/nymph_ui.dm
index 968405cc6bdd..17ff9a9476e1 100644
--- a/mods/species/ascent/mobs/nymph/nymph_ui.dm
+++ b/mods/species/ascent/mobs/nymph/nymph_ui.dm
@@ -1,3 +1,6 @@
+/decl/hud_element/action_intent/ascent_nymph
+ screen_object_type = /obj/screen/intent/ascent_nymph
+
/obj/screen/intent/ascent_nymph
icon_state = "intent_devour"
screen_loc = ANYMPH_SCREEN_LOC_INTENT
@@ -30,10 +33,15 @@
if(istype(nymph)) nymph.molt()
/datum/hud/ascent_nymph
+ health_hud_type = /decl/hud_element/health/ascent_nymph
+ hud_elements = list(
+ /decl/hud_element/health/ascent_nymph
+ )
var/obj/screen/ascent_nymph_held/held
var/obj/screen/ascent_nymph_molt/molt
- var/obj/screen/food/food
- var/obj/screen/drink/drink
+
+/decl/hud_element/health/ascent_nymph
+ screen_loc = ui_alien_health
/datum/hud/ascent_nymph/get_ui_style()
return 'mods/species/ascent/icons/ui.dmi'
@@ -45,53 +53,17 @@
return 255
/datum/hud/ascent_nymph/FinalizeInstantiation()
-
var/ui_style = get_ui_style()
var/ui_color = get_ui_color()
var/ui_alpha = get_ui_alpha()
-
- src.adding = list()
- src.other = list()
-
held = new
held.icon = ui_style
held.color = ui_color
held.alpha = ui_alpha
- adding += held
-
+ misc_hud_elements += held
molt = new
molt.icon = ui_style
molt.color = ui_color
molt.alpha = ui_alpha
- adding += molt
-
- food = new
- food.icon = 'icons/mob/status_hunger.dmi'
- food.SetName("nutrition")
- food.icon_state = "nutrition1"
- food.pixel_w = 8
- food.screen_loc = ui_nutrition_small
- adding += food
-
- drink = new
- drink.icon = 'icons/mob/status_hunger.dmi'
- drink.icon_state = "hydration1"
- drink.SetName("hydration")
- drink.screen_loc = ui_nutrition_small
- adding += drink
-
- action_intent = new /obj/screen/intent/ascent_nymph()
- action_intent.icon = ui_style
- action_intent.color = ui_color
- action_intent.alpha = ui_alpha
- adding += action_intent
-
- mymob.healths = new /obj/screen()
- mymob.healths.icon = ui_style
- mymob.healths.color = ui_color
- mymob.healths.alpha = ui_alpha
- mymob.healths.SetName("health")
- mymob.healths.screen_loc = ANYMPH_SCREEN_LOC_HEALTH
-
- mymob.client.screen = list(mymob.healths)
- mymob.client.screen += src.adding + src.other
\ No newline at end of file
+ misc_hud_elements += molt
+ return ..()
diff --git a/mods/species/bayliens/adherent/datum/species.dm b/mods/species/bayliens/adherent/datum/species.dm
index d378482d7cd2..c6629c7abcbd 100644
--- a/mods/species/bayliens/adherent/datum/species.dm
+++ b/mods/species/bayliens/adherent/datum/species.dm
@@ -63,7 +63,7 @@
spawn_flags = SPECIES_CAN_JOIN
flesh_color = "#90edeb"
- hud_type = /datum/hud_data/adherent
+ species_hud_type = /datum/hud_data/adherent
available_cultural_info = list(
TAG_CULTURE = list(
@@ -122,7 +122,6 @@
if(can_overcome_gravity(H)) return "\nThey are floating on a cloud of shimmering distortion."
/datum/hud_data/adherent
- has_internals = FALSE
inventory_slots = list(
/datum/inventory_slot/handcuffs,
/datum/inventory_slot/ear/adherent,
diff --git a/mods/species/serpentid/datum/species.dm b/mods/species/serpentid/datum/species.dm
index d92dd8d2e47d..3ee9f45c2ee1 100644
--- a/mods/species/serpentid/datum/species.dm
+++ b/mods/species/serpentid/datum/species.dm
@@ -39,7 +39,7 @@
)
rarity_value = 4
- hud_type = /datum/hud_data/serpentid
+ species_hud_type = /datum/hud_data/serpentid
total_health = 200
brute_mod = 0.9
burn_mod = 1.35
diff --git a/mods/species/serpentid/mobs/bodyparts_serpentid.dm b/mods/species/serpentid/mobs/bodyparts_serpentid.dm
index f75c02d86316..e8ab003c569d 100644
--- a/mods/species/serpentid/mobs/bodyparts_serpentid.dm
+++ b/mods/species/serpentid/mobs/bodyparts_serpentid.dm
@@ -83,13 +83,13 @@
H.adjustOxyLoss(-(HUMAN_MAX_OXYLOSS * oxygenated))
if(breath_fail_ratio < 0.25 && oxygenated)
- H.oxygen_alert = 0
+ SET_HUD_ALERT(H, /decl/hud_element/condition/oxygen, 0)
if(breath_fail_ratio >= 0.25 && (damage || world.time > last_successful_breath + 2 MINUTES))
H.adjustOxyLoss(HUMAN_MAX_OXYLOSS * breath_fail_ratio)
if(oxygenated)
- H.oxygen_alert = 1
+ SET_HUD_ALERT(H, /decl/hud_element/condition/oxygen, 1)
else
- H.oxygen_alert = 2
+ SET_HUD_ALERT(H, /decl/hud_element/condition/oxygen, 2)
/obj/item/organ/internal/brain/insectoid/serpentid
var/lowblood_tally = 0
diff --git a/nebula.dme b/nebula.dme
index 94e2753fec0b..bc4f1dc844f3 100644
--- a/nebula.dme
+++ b/nebula.dme
@@ -48,6 +48,7 @@
#include "code\__defines\gamemode.dm"
#include "code\__defines\guns.dm"
#include "code\__defines\holomap.dm"
+#include "code\__defines\hud.dm"
#include "code\__defines\hydroponics.dm"
#include "code\__defines\integrated_circuits.dm"
#include "code\__defines\interactions.dm"
@@ -163,25 +164,45 @@
#include "code\_onclick\other_mobs.dm"
#include "code\_onclick\rig.dm"
#include "code\_onclick\hud\_defines.dm"
+#include "code\_onclick\hud\_hud.dm"
#include "code\_onclick\hud\ability_screen_objects.dm"
#include "code\_onclick\hud\action.dm"
#include "code\_onclick\hud\ai.dm"
#include "code\_onclick\hud\ai_hud.dm"
#include "code\_onclick\hud\ai_screen_objects.dm"
-#include "code\_onclick\hud\animal.dm"
+#include "code\_onclick\hud\constructs.dm"
#include "code\_onclick\hud\deity.dm"
#include "code\_onclick\hud\fullscreen.dm"
#include "code\_onclick\hud\global_hud.dm"
-#include "code\_onclick\hud\gun_mode.dm"
-#include "code\_onclick\hud\hud.dm"
#include "code\_onclick\hud\human.dm"
-#include "code\_onclick\hud\other_mobs.dm"
#include "code\_onclick\hud\pai.dm"
#include "code\_onclick\hud\radial.dm"
#include "code\_onclick\hud\radial_persistent.dm"
#include "code\_onclick\hud\robot.dm"
#include "code\_onclick\hud\screen_objects.dm"
#include "code\_onclick\hud\skybox.dm"
+#include "code\_onclick\hud\hud_elements\_hud_element.dm"
+#include "code\_onclick\hud\hud_elements\ability_master.dm"
+#include "code\_onclick\hud\hud_elements\action_intent.dm"
+#include "code\_onclick\hud\hud_elements\bodytemp.dm"
+#include "code\_onclick\hud\hud_elements\cells.dm"
+#include "code\_onclick\hud\hud_elements\drop.dm"
+#include "code\_onclick\hud\hud_elements\fire.dm"
+#include "code\_onclick\hud\hud_elements\gun_mode.dm"
+#include "code\_onclick\hud\hud_elements\health.dm"
+#include "code\_onclick\hud\hud_elements\hydration.dm"
+#include "code\_onclick\hud\hud_elements\internals.dm"
+#include "code\_onclick\hud\hud_elements\move_intent.dm"
+#include "code\_onclick\hud\hud_elements\nutrition.dm"
+#include "code\_onclick\hud\hud_elements\oxygen.dm"
+#include "code\_onclick\hud\hud_elements\pain.dm"
+#include "code\_onclick\hud\hud_elements\pressure.dm"
+#include "code\_onclick\hud\hud_elements\resist.dm"
+#include "code\_onclick\hud\hud_elements\stamina.dm"
+#include "code\_onclick\hud\hud_elements\throwing.dm"
+#include "code\_onclick\hud\hud_elements\toxins.dm"
+#include "code\_onclick\hud\hud_elements\up_hint.dm"
+#include "code\_onclick\hud\hud_elements\zone_selector.dm"
#include "code\controllers\admin.dm"
#include "code\controllers\autotransfer.dm"
#include "code\controllers\communications.dm"