mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 17:52:36 +00:00
* - I rearranged X_defense.dm mob files, more damage_procs.dm.Here's what's inside: * X_defense.dm: is for the procs of attacks onto the mob, all the XXX_act() proc (things happening to the mob), as well as protection check and get procs (armor, ear prot, projectile dismemberment) * damage_procs.dm: actual damage procs like adjustBruteLoss() getfireloss, any proc that handles damaging. - some bugfixes with gibspawner effects. - monkey's bodyparts can be dismembered and are used to create its icon. - brains are no longer carbons. - all carbon have bodyparts that can be dropped when the mob is gibbed. - adminspawned bodyparts now have a default icon. - robotic parts are now a child of bodyparts. - health analyzer on alien/monkey shows damage on each limb - added admin option to add/remove bodyparts for all carbon (instead of just remove on humans) - Fixes keycheck message spam for janicart and all when trying to move. - Fixes bug with buckling to a scooter while limbless. - removed arg "hit_zone" in proj's on_hit() because we can already use the def_zone var (where hit_zone got its value) - Fixes mob not getting any damage when hit by a projectile on their missing limb, despite a hit message shown). carbon/apply_damage() now when we specify a def_zone and the corresponding BP is missing we default to the chest instead of stopping the proc. Consistently with how human/attacked_by() default to its attack to chest if missing limb. - Fixes mini uzi icon when empty and no mag (typo). - I renamed and changed a bit check_eye_prot and ear prot - renamed flash_eyes to flash_act() - I made a soundbang_act() similar to flash_act but for loud bangs. - added a gib and dust animation to larva. - husked monkeys - no damage overlay for husk or skeleton. - damage overlay for robotic limb now. - no damage overlay when organic bodypart husked. - one handed human with a bloody hand still get a bloody single hand overlay. - fix admin heal being unable to heal robotic bodyparts. - slightly touched robotic bodypart sprites (head one pixel too high) - Fixes 18532 "beheaded husk has hair". - Fixes 18584 "Ling stasis appearance bug" - no more eyes or lipstick on husks. - can remove flashes/wires/cells from robot chest and head with crowbar. - Fixes not being able to surgically amputate robotic arm/leg. * More merge conflict fixes and adding the new files I forgot to add. * of course I forgot birdstation * More typos and stuff I forgot to undo. * Fixing a typo in examine.dm Removing an unnecessary check. Making admin heal regenerate limbs on all carbons. Monkey-human transformation now transfer missing limbs info and presence of a cavity implant. NODISMEMBER species can still lack a limb if the mob lacked a limb and changed into that new species. Changeling Regenerate ability now also regenerate limbs when in monkey form. (and remove some cryptic useless code) * Fixing more conflicts with remie's multihands PR. * Fixes runtime with hud when calling build_hand_slots(). Fixes lightgeist healing not working. Fixes null.handle_fall() runtimes with pirate mobs. Fixes typo in has_left_hadn() and has_right_hand(). * Derp, forgot to remove debug message.
245 lines
7.6 KiB
Plaintext
245 lines
7.6 KiB
Plaintext
/*
|
|
The hud datum
|
|
Used to show and hide huds for all the different mob types,
|
|
including inventories and item quick actions.
|
|
*/
|
|
|
|
/datum/hud
|
|
var/mob/mymob
|
|
|
|
var/hud_shown = 1 //Used for the HUD toggle (F12)
|
|
var/hud_version = 1 //Current displayed version of the HUD
|
|
var/inventory_shown = 0 //Equipped item inventory
|
|
var/show_intent_icons = 0
|
|
var/hotkey_ui_hidden = 0 //This is to hide the buttons that can be used via hotkeys. (hotkeybuttons list of buttons)
|
|
|
|
var/obj/screen/ling/chems/lingchemdisplay
|
|
var/obj/screen/ling/sting/lingstingdisplay
|
|
|
|
var/obj/screen/blobpwrdisplay
|
|
|
|
var/obj/screen/alien_plasma_display
|
|
var/obj/screen/alien_queen_finder
|
|
|
|
var/obj/screen/devil/soul_counter/devilsouldisplay
|
|
|
|
var/obj/screen/deity_power_display
|
|
var/obj/screen/deity_follower_display
|
|
|
|
var/obj/screen/nightvisionicon
|
|
var/obj/screen/action_intent
|
|
var/obj/screen/zone_select
|
|
var/obj/screen/pull_icon
|
|
var/obj/screen/throw_icon
|
|
var/obj/screen/module_store_icon
|
|
|
|
var/list/static_inventory = list() //the screen objects which are static
|
|
var/list/toggleable_inventory = list() //the screen objects which can be hidden
|
|
var/list/obj/screen/hotkeybuttons = list() //the buttons that can be used via hotkeys
|
|
var/list/infodisplay = list() //the screen objects that display mob info (health, alien plasma, etc...)
|
|
var/list/screenoverlays = list() //the screen objects used as whole screen overlays (flash, damageoverlay, etc...)
|
|
var/list/inv_slots[slots_amt] // /obj/screen/inventory objects, ordered by their slot ID.
|
|
var/list/hand_slots // /obj/screen/inventory/hand objects, assoc list of "[held_index]" = object
|
|
|
|
var/obj/screen/movable/action_button/hide_toggle/hide_actions_toggle
|
|
var/action_buttons_hidden = 0
|
|
|
|
var/obj/screen/healths
|
|
var/obj/screen/healthdoll
|
|
var/obj/screen/internals
|
|
|
|
/datum/hud/New(mob/owner)
|
|
mymob = owner
|
|
hide_actions_toggle = new
|
|
hide_actions_toggle.InitialiseIcon(mymob)
|
|
hand_slots = list()
|
|
|
|
/datum/hud/Destroy()
|
|
if(mymob.hud_used == src)
|
|
mymob.hud_used = null
|
|
|
|
qdel(hide_actions_toggle)
|
|
hide_actions_toggle = null
|
|
|
|
qdel(module_store_icon)
|
|
module_store_icon = null
|
|
|
|
if(static_inventory.len)
|
|
for(var/thing in static_inventory)
|
|
qdel(thing)
|
|
static_inventory.Cut()
|
|
|
|
inv_slots.Cut()
|
|
action_intent = null
|
|
zone_select = null
|
|
pull_icon = null
|
|
|
|
if(toggleable_inventory.len)
|
|
for(var/thing in toggleable_inventory)
|
|
qdel(thing)
|
|
toggleable_inventory.Cut()
|
|
|
|
if(hotkeybuttons.len)
|
|
for(var/thing in hotkeybuttons)
|
|
qdel(thing)
|
|
hotkeybuttons.Cut()
|
|
|
|
throw_icon = null
|
|
|
|
if(infodisplay.len)
|
|
for(var/thing in infodisplay)
|
|
qdel(thing)
|
|
infodisplay.Cut()
|
|
|
|
healths = null
|
|
healthdoll = null
|
|
internals = null
|
|
lingchemdisplay = null
|
|
devilsouldisplay = null
|
|
lingstingdisplay = null
|
|
blobpwrdisplay = null
|
|
alien_plasma_display = null
|
|
alien_queen_finder = null
|
|
deity_power_display = null
|
|
deity_follower_display = null
|
|
nightvisionicon = null
|
|
|
|
if(screenoverlays.len)
|
|
for(var/thing in screenoverlays)
|
|
qdel(thing)
|
|
screenoverlays.Cut()
|
|
mymob = null
|
|
return ..()
|
|
|
|
/mob/proc/create_mob_hud()
|
|
if(client && !hud_used)
|
|
hud_used = new /datum/hud(src)
|
|
|
|
//Version denotes which style should be displayed. blank or 0 means "next version"
|
|
/datum/hud/proc/show_hud(version = 0,mob/viewmob)
|
|
if(!ismob(mymob))
|
|
return 0
|
|
if(!mymob.client)
|
|
return 0
|
|
|
|
var/mob/screenmob = viewmob || mymob
|
|
|
|
screenmob.client.screen = list()
|
|
|
|
var/display_hud_version = version
|
|
if(!display_hud_version) //If 0 or blank, display the next hud version
|
|
display_hud_version = hud_version + 1
|
|
if(display_hud_version > HUD_VERSIONS) //If the requested version number is greater than the available versions, reset back to the first version
|
|
display_hud_version = 1
|
|
|
|
switch(display_hud_version)
|
|
if(HUD_STYLE_STANDARD) //Default HUD
|
|
hud_shown = 1 //Governs behavior of other procs
|
|
if(static_inventory.len)
|
|
screenmob.client.screen += static_inventory
|
|
if(toggleable_inventory.len && screenmob.hud_used && screenmob.hud_used.inventory_shown)
|
|
screenmob.client.screen += toggleable_inventory
|
|
if(hotkeybuttons.len && !hotkey_ui_hidden)
|
|
screenmob.client.screen += hotkeybuttons
|
|
if(infodisplay.len)
|
|
screenmob.client.screen += infodisplay
|
|
|
|
mymob.client.screen += hide_actions_toggle
|
|
|
|
if(action_intent)
|
|
action_intent.screen_loc = initial(action_intent.screen_loc) //Restore intent selection to the original position
|
|
|
|
if(HUD_STYLE_REDUCED) //Reduced HUD
|
|
hud_shown = 0 //Governs behavior of other procs
|
|
if(static_inventory.len)
|
|
screenmob.client.screen -= static_inventory
|
|
if(toggleable_inventory.len)
|
|
screenmob.client.screen -= toggleable_inventory
|
|
if(hotkeybuttons.len)
|
|
screenmob.client.screen -= hotkeybuttons
|
|
if(infodisplay.len)
|
|
screenmob.client.screen += infodisplay
|
|
|
|
//These ones are a part of 'static_inventory', 'toggleable_inventory' or 'hotkeybuttons' but we want them to stay
|
|
for(var/h in hand_slots)
|
|
var/obj/screen/hand = hand_slots[h]
|
|
if(hand)
|
|
screenmob.client.screen += hand
|
|
if(action_intent)
|
|
screenmob.client.screen += action_intent //we want the intent switcher visible
|
|
action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is.
|
|
|
|
if(HUD_STYLE_NOHUD) //No HUD
|
|
hud_shown = 0 //Governs behavior of other procs
|
|
if(static_inventory.len)
|
|
screenmob.client.screen -= static_inventory
|
|
if(toggleable_inventory.len)
|
|
screenmob.client.screen -= toggleable_inventory
|
|
if(hotkeybuttons.len)
|
|
screenmob.client.screen -= hotkeybuttons
|
|
if(infodisplay.len)
|
|
screenmob.client.screen -= infodisplay
|
|
|
|
hud_version = display_hud_version
|
|
persistant_inventory_update(screenmob)
|
|
mymob.update_action_buttons(1)
|
|
reorganize_alerts()
|
|
mymob.reload_fullscreen()
|
|
|
|
|
|
/datum/hud/human/show_hud(version = 0,mob/viewmob)
|
|
..()
|
|
hidden_inventory_update(viewmob)
|
|
|
|
/datum/hud/robot/show_hud(version = 0)
|
|
..()
|
|
update_robot_modules_display()
|
|
|
|
/datum/hud/proc/hidden_inventory_update()
|
|
return
|
|
|
|
/datum/hud/proc/persistant_inventory_update(mob/viewer)
|
|
return
|
|
|
|
//Triggered when F12 is pressed (Unless someone changed something in the DMF)
|
|
/mob/verb/button_pressed_F12()
|
|
set name = "F12"
|
|
set hidden = 1
|
|
|
|
if(hud_used && client)
|
|
hud_used.show_hud() //Shows the next hud preset
|
|
usr << "<span class ='info'>Switched HUD mode. Press F12 to toggle.</span>"
|
|
else
|
|
usr << "<span class ='warning'>This mob type does not use a HUD.</span>"
|
|
|
|
|
|
//(re)builds the hand ui slots, throwing away old ones
|
|
//not really worth jugglying existing ones so we just scrap+rebuild
|
|
//9/10 this is only called once per mob and only for 2 hands
|
|
/datum/hud/proc/build_hand_slots(ui_style = 'icons/mob/screen_midnight.dmi')
|
|
for(var/h in hand_slots)
|
|
var/obj/screen/inventory/hand/H = hand_slots[h]
|
|
if(H)
|
|
static_inventory -= H
|
|
hand_slots = list()
|
|
var/obj/screen/inventory/hand/hand_box
|
|
for(var/i in 1 to mymob.held_items.len)
|
|
hand_box = new /obj/screen/inventory/hand()
|
|
hand_box.name = mymob.get_held_index_name(i)
|
|
hand_box.icon = ui_style
|
|
hand_box.icon_state = "hand_[mymob.held_index_to_dir(i)]"
|
|
hand_box.screen_loc = ui_hand_position(i)
|
|
hand_box.held_index = i
|
|
hand_slots["[i]"] = hand_box
|
|
hand_box.hud = src
|
|
static_inventory += hand_box
|
|
hand_box.update_icon()
|
|
|
|
var/i = 1
|
|
for(var/obj/screen/swap_hand/SH in static_inventory)
|
|
SH.screen_loc = ui_swaphand_position(mymob,!(i % 2) ? 2: 1)
|
|
i++
|
|
for(var/obj/screen/human/equip/E in static_inventory)
|
|
E.screen_loc = ui_equip_position(mymob)
|
|
if(mymob.hud_used)
|
|
show_hud(HUD_STYLE_STANDARD,mymob) |