diff --git a/code/_onclick/hud/_defines.dm b/code/_onclick/hud/_defines.dm index bc11bad8bc6..96126033bca 100644 --- a/code/_onclick/hud/_defines.dm +++ b/code/_onclick/hud/_defines.dm @@ -150,3 +150,10 @@ #define ui_spell_master "EAST-2:16,NORTH-1:26" #define ui_genetic_master "EAST-1:16,NORTH-3:16" + +// Ghost ones +#define ui_ghost_jumptomob "SOUTH:6,CENTER-2:24" +#define ui_ghost_orbit "SOUTH:6,CENTER-1:24" +#define ui_ghost_reenter_corpse "SOUTH:6,CENTER:24" +#define ui_ghost_teleport "SOUTH:6,CENTER+1:24" +#define ui_ghost_pai "SOUTH: 6, CENTER+2:24" diff --git a/code/_onclick/hud/ai.dm b/code/_onclick/hud/ai.dm index afe8df0c622..25cc398e42a 100644 --- a/code/_onclick/hud/ai.dm +++ b/code/_onclick/hud/ai.dm @@ -1,169 +1,170 @@ -/obj/screen/ai/multicam - name = "Multicamera Mode" - icon = 'icons/mob/screen_ai.dmi' - icon_state = "multicam" - /obj/screen/ai/multicam/Click() if(..()) return var/mob/living/silicon/ai/AI = usr AI.toggle_multicam() -/obj/screen/ai/add_multicam - name = "New Camera" - icon = 'icons/mob/screen_ai.dmi' - icon_state = "new_cam" - /obj/screen/ai/add_multicam/Click() if(..()) return var/mob/living/silicon/ai/AI = usr AI.drop_new_multicam() -/datum/hud/proc/ai_hud() - adding = list() - other = list() +/mob/living/silicon/ai/create_mob_hud(datum/hud/HUD, apply_to_client = TRUE) + ..() + + HUD.ui_style = 'icons/mob/screen_ai.dmi' + + HUD.adding = list() + HUD.other = list() var/obj/screen/using //AI core using = new /obj/screen() using.name = "AI Core" - using.icon = 'icons/mob/screen_ai.dmi' + using.icon = HUD.ui_style using.icon_state = "ai_core" using.screen_loc = ui_ai_core using.layer = SCREEN_LAYER - adding += using + HUD.adding += using //Camera list using = new /obj/screen() using.name = "Show Camera List" - using.icon = 'icons/mob/screen_ai.dmi' + using.icon = HUD.ui_style using.icon_state = "camera" using.screen_loc = ui_ai_camera_list using.layer = SCREEN_LAYER - adding += using + HUD.adding += using //Track using = new /obj/screen() using.name = "Track With Camera" - using.icon = 'icons/mob/screen_ai.dmi' + using.icon = HUD.ui_style using.icon_state = "track" using.screen_loc = ui_ai_track_with_camera using.layer = SCREEN_LAYER - adding += using + HUD.adding += using //Camera light using = new /obj/screen() using.name = "Toggle Camera Light" - using.icon = 'icons/mob/screen_ai.dmi' + using.icon = HUD.ui_style using.icon_state = "camera_light" using.screen_loc = ui_ai_camera_light using.layer = SCREEN_LAYER - adding += using + HUD.adding += using //Crew Monitoring using = new /obj/screen() using.name = "Crew Monitoring" - using.icon = 'icons/mob/screen_ai.dmi' + using.icon = HUD.ui_style using.icon_state = "crew_monitor" using.screen_loc = ui_ai_crew_monitor using.layer = SCREEN_LAYER - adding += using + HUD.adding += using //Crew Manifest using = new /obj/screen() using.name = "Show Crew Manifest" - using.icon = 'icons/mob/screen_ai.dmi' + using.icon = HUD.ui_style using.icon_state = "manifest" using.screen_loc = ui_ai_crew_manifest using.layer = SCREEN_LAYER - adding += using + HUD.adding += using //Alerts using = new /obj/screen() using.name = "Show Alerts" - using.icon = 'icons/mob/screen_ai.dmi' + using.icon = HUD.ui_style using.icon_state = "alerts" using.screen_loc = ui_ai_alerts using.layer = SCREEN_LAYER - adding += using + HUD.adding += using //Announcement using = new /obj/screen() using.name = "Announcement" - using.icon = 'icons/mob/screen_ai.dmi' + using.icon = HUD.ui_style using.icon_state = "announcement" using.screen_loc = ui_ai_announcement using.layer = SCREEN_LAYER - adding += using + HUD.adding += using //Shuttle using = new /obj/screen() using.name = "Call Emergency Shuttle" - using.icon = 'icons/mob/screen_ai.dmi' + using.icon = HUD.ui_style using.icon_state = "call_shuttle" using.screen_loc = ui_ai_shuttle using.layer = SCREEN_LAYER - adding += using + HUD.adding += using //Laws using = new /obj/screen() using.name = "State Laws" - using.icon = 'icons/mob/screen_ai.dmi' + using.icon = HUD.ui_style using.icon_state = "state_laws" using.screen_loc = ui_ai_state_laws using.layer = SCREEN_LAYER - adding += using + HUD.adding += using //PDA message using = new /obj/screen() using.name = "PDA - Send Message" - using.icon = 'icons/mob/screen_ai.dmi' + using.icon = HUD.ui_style using.icon_state = "pda_send" using.screen_loc = ui_ai_pda_send using.layer = SCREEN_LAYER - adding += using + HUD.adding += using //PDA log using = new /obj/screen() using.name = "PDA - Show Message Log" - using.icon = 'icons/mob/screen_ai.dmi' + using.icon = HUD.ui_style using.icon_state = "pda_receive" using.screen_loc = ui_ai_pda_log using.layer = SCREEN_LAYER - adding += using + HUD.adding += using //Take image using = new /obj/screen() using.name = "Take Image" - using.icon = 'icons/mob/screen_ai.dmi' + using.icon = HUD.ui_style using.icon_state = "take_picture" using.screen_loc = ui_ai_take_picture using.layer = SCREEN_LAYER - adding += using + HUD.adding += using //View images using = new /obj/screen() using.name = "View Images" - using.icon = 'icons/mob/screen_ai.dmi' + using.icon = HUD.ui_style using.icon_state = "view_images" using.screen_loc = ui_ai_view_images using.layer = SCREEN_LAYER - adding += using + HUD.adding += using //Multicamera mode - using = new /obj/screen/ai/multicam() - using.screen_loc = ui_ai_multicam - adding += using + using = new /obj/screen/ai/multicam() // special + using.name = "Multicamera Mode" + using.icon = HUD.ui_style + using.icon_state = "multicam" + using.screen_loc = ui_ai_multicam + using.layer = SCREEN_LAYER + HUD.adding += using //Add multicamera camera - using = new /obj/screen/ai/add_multicam() - using.screen_loc = ui_ai_add_multicam - adding += using + using = new /obj/screen/ai/add_multicam() // special + using.name = "New Camera" + using.icon = HUD.ui_style + using.icon_state = "new_cam" + using.screen_loc = ui_ai_add_multicam + using.layer = SCREEN_LAYER + HUD.adding += using - mymob.client.screen = list() - mymob.client.screen += adding + other - mymob.client.screen += mymob.client.void - - return \ No newline at end of file + if(client && apply_to_client) + client.screen = list() + client.screen += HUD.adding + HUD.other + client.screen += client.void diff --git a/code/_onclick/hud/alien_larva.dm b/code/_onclick/hud/alien_larva.dm index 960582b4b1f..123a13819be 100644 --- a/code/_onclick/hud/alien_larva.dm +++ b/code/_onclick/hud/alien_larva.dm @@ -1,27 +1,31 @@ -/datum/hud/proc/larva_hud() +/mob/living/carbon/alien/create_mob_hud(datum/hud/HUD, apply_to_client = TRUE) + ..() - src.adding = list() - src.other = list() + HUD.ui_style = 'icons/mob/screen1_alien.dmi' + + HUD.adding = list() + HUD.other = list() var/obj/screen/using using = new /obj/screen() using.name = "mov_intent" using.set_dir(SOUTHWEST) - using.icon = 'icons/mob/screen1_alien.dmi' - using.icon_state = (mymob.m_intent == "run" ? "running" : "walking") + using.icon = HUD.ui_style + using.icon_state = (m_intent == "run" ? "running" : "walking") using.screen_loc = ui_acti using.layer = HUD_LAYER - src.adding += using - move_intent = using + HUD.adding += using + HUD.move_intent = using - mymob.healths = new /obj/screen() - mymob.healths.icon = 'icons/mob/screen1_alien.dmi' - mymob.healths.icon_state = "health0" - mymob.healths.name = "health" - mymob.healths.screen_loc = ui_alien_health + healths = new /obj/screen() + healths.icon = HUD.ui_style + healths.icon_state = "health0" + healths.name = "health" + healths.screen_loc = ui_alien_health - mymob.client.screen = list() - mymob.client.screen += list( mymob.healths) //, mymob.rest, mymob.sleep, mymob.mach ) - mymob.client.screen += src.adding + src.other - mymob.client.screen += mymob.client.void \ No newline at end of file + if(client && apply_to_client) + client.screen = list() + client.screen += list(healths) + client.screen += HUD.adding + HUD.other + client.screen += client.void diff --git a/code/_onclick/hud/ghost.dm b/code/_onclick/hud/ghost.dm new file mode 100644 index 00000000000..f9dd59c0ef7 --- /dev/null +++ b/code/_onclick/hud/ghost.dm @@ -0,0 +1,115 @@ +/obj/screen/ghost + icon = 'icons/mob/screen_ghost.dmi' + +/obj/screen/ghost/MouseEntered() + flick(icon_state + "_anim", src) + +/obj/screen/ghost/jumptomob + name = "Jump to mob" + icon_state = "jumptomob" + +/obj/screen/ghost/jumptomob/Click() + var/mob/observer/dead/G = usr + G.jumptomob() + +/obj/screen/ghost/orbit + name = "Orbit" + icon_state = "orbit" + +/obj/screen/ghost/orbit/Click() + var/mob/observer/dead/G = usr + G.follow() + +/obj/screen/ghost/reenter_corpse + name = "Reenter corpse" + icon_state = "reenter_corpse" + +/obj/screen/ghost/reenter_corpse/Click() + var/mob/observer/dead/G = usr + G.reenter_corpse() + +/obj/screen/ghost/teleport + name = "Teleport" + icon_state = "teleport" + +/obj/screen/ghost/teleport/Click() + var/mob/observer/dead/G = usr + G.dead_tele() + +/obj/screen/ghost/pai + name = "pAI Candidate" + icon_state = "pai" + +/obj/screen/ghost/pai/Click() + var/mob/observer/dead/G = usr + G.paialert() + + +/mob/observer/dead/create_mob_hud(datum/hud/HUD, apply_to_client = TRUE) + ..() + + var/list/adding = list() + HUD.adding = adding + + var/obj/screen/using + using = new /obj/screen/ghost/jumptomob() + using.screen_loc = ui_ghost_jumptomob + using.hud = src + adding += using + + using = new /obj/screen/ghost/orbit() + using.screen_loc = ui_ghost_orbit + using.hud = src + adding += using + + using = new /obj/screen/ghost/reenter_corpse() + using.screen_loc = ui_ghost_reenter_corpse + using.hud = src + adding += using + + using = new /obj/screen/ghost/teleport() + using.screen_loc = ui_ghost_teleport + using.hud = src + adding += using + + using = new /obj/screen/ghost/pai() + using.screen_loc = ui_ghost_pai + using.hud = src + adding += using + + /* + using = new /obj/screen/language_menu + using.icon = ui_style + using.hud = src + adding += using + */ + + if(client && apply_to_client) + client.screen = list() + client.screen += HUD.adding + client.screen += client.void + +/* I wish we had this. Not yet, though. +/datum/hud/ghost/show_hud(version = 0, mob/viewmob) + // don't show this HUD if observing; show the HUD of the observee + var/mob/dead/observer/O = mymob + if (istype(O) && O.observetarget) + plane_masters_update() + return FALSE + + . = ..() + if(!.) + return + var/mob/screenmob = viewmob || mymob + if(!screenmob.client.prefs.ghost_hud) + screenmob.client.screen -= static_inventory + else + screenmob.client.screen += static_inventory + +//We should only see observed mob alerts. +/datum/hud/ghost/reorganize_alerts(mob/viewmob) + var/mob/dead/observer/O = mymob + if (istype(O) && O.observetarget) + return + . = ..() +*/ \ No newline at end of file diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 9d0f477b13c..c4dabaf3cad 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -191,6 +191,8 @@ var/list/global_huds = list( var/list/slot_info var/icon/ui_style + var/ui_color + var/ui_alpha datum/hud/New(mob/owner) mymob = owner @@ -305,35 +307,23 @@ datum/hud/New(mob/owner) /datum/hud/proc/instantiate() - if(!ismob(mymob)) return 0 - if(!mymob.client) return 0 + if(!ismob(mymob)) + return 0 - ui_style = ui_style2icon(mymob.client.prefs.UI_style) - var/ui_color = mymob.client.prefs.UI_style_color - var/ui_alpha = mymob.client.prefs.UI_style_alpha - - if(ishuman(mymob)) - human_hud(ui_style, ui_color, ui_alpha, mymob) // Pass the player the UI style chosen in preferences - else if(isrobot(mymob)) - robot_hud(ui_style, ui_color, ui_alpha, mymob) - else if(isbrain(mymob)) - mymob.instantiate_hud(src) - else if(isalien(mymob)) - larva_hud() - else if(isAI(mymob)) - ai_hud() - else if(isobserver(mymob)) - ghost_hud() - else - mymob.instantiate_hud(src) + mymob.create_mob_hud(src) persistant_inventory_update() mymob.reload_fullscreen() // Reload any fullscreen overlays this mob has. mymob.update_action_buttons() reorganize_alerts() -/mob/proc/instantiate_hud(var/datum/hud/HUD) - return +/mob/proc/create_mob_hud(datum/hud/HUD, apply_to_client = TRUE) + if(!client) + return 0 + + HUD.ui_style = ui_style2icon(client?.prefs?.UI_style) + HUD.ui_color = client?.prefs?.UI_style_color + HUD.ui_alpha = client?.prefs?.UI_style_alpha //Triggered when F12 is pressed (Unless someone changed something in the DMF) /mob/verb/button_pressed_F12(var/full = 0 as null) diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index 173398fda6a..6387f40d9ec 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -1,20 +1,24 @@ -/mob/living/carbon/human/instantiate_hud(var/datum/hud/HUD, var/ui_style, var/ui_color, var/ui_alpha) - HUD.human_hud(ui_style, ui_color, ui_alpha, src) +/mob/living/carbon/human/create_mob_hud(datum/hud/HUD) + ..() -/datum/hud/proc/human_hud(var/ui_style='icons/mob/screen1_White.dmi', var/ui_color = "#ffffff", var/ui_alpha = 255, var/mob/living/carbon/human/target) var/datum/hud_data/hud_data - if(!istype(target)) - hud_data = new() + if(species?.hud) + hud_data = species.hud else - hud_data = target.species.hud + hud_data = new () - if(hud_data.icon) - ui_style = hud_data.icon + if(hud_data.icon) // Species wants a specific dmi for the HUD + HUD.ui_style = hud_data.icon - src.adding = list() - src.other = list() - src.hotkeybuttons = list() //These can be disabled for hotkey users - src.slot_info = list() + var/adding = list() + var/other = list() + var/hotkeybuttons = list() + var/slot_info = list() + + HUD.adding = adding + HUD.other = other + HUD.hotkeybuttons = hotkeybuttons //These can be disabled for hotkey users + HUD.slot_info = slot_info var/list/hud_elements = list() var/obj/screen/using @@ -25,10 +29,10 @@ for(var/gear_slot in hud_data.gear) inv_box = new /obj/screen/inventory() - inv_box.icon = ui_style - inv_box.color = ui_color - inv_box.alpha = ui_alpha - inv_box.hud = src + inv_box.icon = HUD.ui_style + inv_box.color = HUD.ui_color + inv_box.alpha = HUD.ui_alpha + inv_box.hud = HUD var/list/slot_data = hud_data.gear[gear_slot] inv_box.name = gear_slot @@ -41,294 +45,291 @@ inv_box.set_dir(slot_data["dir"]) if(slot_data["toggle"]) - src.other += inv_box + other += inv_box has_hidden_gear = 1 else - src.adding += inv_box + adding += inv_box if(has_hidden_gear) using = new /obj/screen() using.name = "toggle" - using.icon = ui_style + using.icon = HUD.ui_style using.icon_state = "other" using.screen_loc = ui_inventory using.hud_layerise() - using.color = ui_color - using.alpha = ui_alpha - src.adding += using + using.color = HUD.ui_color + using.alpha = HUD.ui_alpha + adding += using // Draw the attack intent dialogue. if(hud_data.has_a_intent) using = new /obj/screen() using.name = "act_intent" - using.icon = ui_style - using.icon_state = "intent_"+mymob.a_intent + using.icon = HUD.ui_style + using.icon_state = "intent_"+a_intent using.screen_loc = ui_acti - using.color = ui_color - using.alpha = ui_alpha - src.adding += using - action_intent = using + using.color = HUD.ui_color + using.alpha = HUD.ui_alpha + adding += using + HUD.action_intent = using hud_elements |= using //intent small hud objects var/icon/ico - ico = new(ui_style, "black") + ico = new(HUD.ui_style, "black") ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height()) using = new /obj/screen() using.name = I_HELP using.icon = ico using.screen_loc = ui_acti - using.alpha = ui_alpha + using.alpha = HUD.ui_alpha using.layer = LAYER_HUD_ITEM //These sit on the intent box - src.adding += using - help_intent = using + adding += using + HUD.help_intent = using - ico = new(ui_style, "black") + ico = new(HUD.ui_style, "black") ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height()) using = new /obj/screen() using.name = I_DISARM using.icon = ico using.screen_loc = ui_acti - using.alpha = ui_alpha + using.alpha = HUD.ui_alpha using.layer = LAYER_HUD_ITEM - src.adding += using - disarm_intent = using + adding += using + HUD.disarm_intent = using - ico = new(ui_style, "black") + ico = new(HUD.ui_style, "black") ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2) using = new /obj/screen() using.name = I_GRAB using.icon = ico using.screen_loc = ui_acti - using.alpha = ui_alpha + using.alpha = HUD.ui_alpha using.layer = LAYER_HUD_ITEM - src.adding += using - grab_intent = using + adding += using + HUD.grab_intent = using - ico = new(ui_style, "black") + ico = new(HUD.ui_style, "black") ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2) using = new /obj/screen() using.name = I_HURT using.icon = ico using.screen_loc = ui_acti - using.alpha = ui_alpha + using.alpha = HUD.ui_alpha using.layer = LAYER_HUD_ITEM - src.adding += using - hurt_intent = using + adding += using + HUD.hurt_intent = using //end intent small hud objects if(hud_data.has_m_intent) using = new /obj/screen() using.name = "mov_intent" - using.icon = ui_style - using.icon_state = (mymob.m_intent == "run" ? "running" : "walking") + using.icon = HUD.ui_style + using.icon_state = (m_intent == "run" ? "running" : "walking") using.screen_loc = ui_movi - using.color = ui_color - using.alpha = ui_alpha - src.adding += using - move_intent = using + using.color = HUD.ui_color + using.alpha = HUD.ui_alpha + adding += using + HUD.move_intent = using if(hud_data.has_drop) using = new /obj/screen() using.name = "drop" - using.icon = ui_style + using.icon = HUD.ui_style using.icon_state = "act_drop" using.screen_loc = ui_drop_throw - using.color = ui_color - using.alpha = ui_alpha - src.hotkeybuttons += using + using.color = HUD.ui_color + using.alpha = HUD.ui_alpha + hotkeybuttons += using if(hud_data.has_hands) using = new /obj/screen() using.name = "equip" - using.icon = ui_style + using.icon = HUD.ui_style using.icon_state = "act_equip" using.screen_loc = ui_equip - using.color = ui_color - using.alpha = ui_alpha - src.adding += using + using.color = HUD.ui_color + using.alpha = HUD.ui_alpha + adding += using inv_box = new /obj/screen/inventory/hand() - inv_box.hud = src + inv_box.hud = HUD inv_box.name = "r_hand" - inv_box.icon = ui_style + inv_box.icon = HUD.ui_style inv_box.icon_state = "r_hand_inactive" - if(!target.hand) //This being 0 or null means the right hand is in use + if(!hand) //This being 0 or null means the right hand is in use inv_box.icon_state = "r_hand_active" inv_box.screen_loc = ui_rhand inv_box.slot_id = slot_r_hand - inv_box.color = ui_color - inv_box.alpha = ui_alpha - src.r_hand_hud_object = inv_box - src.adding += inv_box + inv_box.color = HUD.ui_color + inv_box.alpha = HUD.ui_alpha + HUD.r_hand_hud_object = inv_box + adding += inv_box slot_info["[slot_r_hand]"] = inv_box.screen_loc inv_box = new /obj/screen/inventory/hand() - inv_box.hud = src + inv_box.hud = HUD inv_box.name = "l_hand" - inv_box.icon = ui_style + inv_box.icon = HUD.ui_style inv_box.icon_state = "l_hand_inactive" - if(target.hand) //This being 1 means the left hand is in use + if(hand) //This being 1 means the left hand is in use inv_box.icon_state = "l_hand_active" inv_box.screen_loc = ui_lhand inv_box.slot_id = slot_l_hand - inv_box.color = ui_color - inv_box.alpha = ui_alpha - src.l_hand_hud_object = inv_box - src.adding += inv_box + inv_box.color = HUD.ui_color + inv_box.alpha = HUD.ui_alpha + HUD.l_hand_hud_object = inv_box + adding += inv_box slot_info["[slot_l_hand]"] = inv_box.screen_loc using = new /obj/screen/inventory() using.name = "hand" - using.icon = ui_style + using.icon = HUD.ui_style using.icon_state = "hand1" using.screen_loc = ui_swaphand1 - using.color = ui_color - using.alpha = ui_alpha - using.hud = src - src.adding += using + using.color = HUD.ui_color + using.alpha = HUD.ui_alpha + using.hud = HUD + adding += using using = new /obj/screen/inventory() using.name = "hand" - using.icon = ui_style + using.icon = HUD.ui_style using.icon_state = "hand2" using.screen_loc = ui_swaphand2 - using.color = ui_color - using.alpha = ui_alpha - using.hud = src - src.adding += using + using.color = HUD.ui_color + using.alpha = HUD.ui_alpha + using.hud = HUD + adding += using if(hud_data.has_resist) using = new /obj/screen() using.name = "resist" - using.icon = ui_style + using.icon = HUD.ui_style using.icon_state = "act_resist" using.screen_loc = ui_pull_resist - using.color = ui_color - using.alpha = ui_alpha - src.hotkeybuttons += using + using.color = HUD.ui_color + using.alpha = HUD.ui_alpha + 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.name = "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 + throw_icon = new /obj/screen() + throw_icon.icon = HUD.ui_style + throw_icon.icon_state = "act_throw_off" + throw_icon.name = "throw" + throw_icon.screen_loc = ui_drop_throw + throw_icon.color = HUD.ui_color + throw_icon.alpha = HUD.ui_alpha + hotkeybuttons += throw_icon + hud_elements |= throw_icon - mymob.pullin = new /obj/screen() - mymob.pullin.icon = ui_style - mymob.pullin.icon_state = "pull0" - mymob.pullin.name = "pull" - mymob.pullin.screen_loc = ui_pull_resist - src.hotkeybuttons += mymob.pullin - hud_elements |= mymob.pullin + pullin = new /obj/screen() + pullin.icon = HUD.ui_style + pullin.icon_state = "pull0" + pullin.name = "pull" + pullin.screen_loc = ui_pull_resist + hotkeybuttons += pullin + hud_elements |= pullin if(hud_data.has_internals) - mymob.internals = new /obj/screen() - mymob.internals.icon = ui_style - mymob.internals.icon_state = "internal0" - if(istype(target.internal, /obj/item/weapon/tank)) //Internals on already? Iight, prove it - mymob.internals.icon_state = "internal1" - mymob.internals.name = "internal" - mymob.internals.screen_loc = ui_internal - hud_elements |= mymob.internals + internals = new /obj/screen() + internals.icon = HUD.ui_style + internals.icon_state = "internal0" + if(istype(internal, /obj/item/weapon/tank)) //Internals on already? Iight, prove it + internals.icon_state = "internal1" + internals.name = "internal" + internals.screen_loc = ui_internal + hud_elements |= internals if(hud_data.has_warnings) - mymob.healths = new /obj/screen() - mymob.healths.icon = ui_style - mymob.healths.icon_state = "health0" - mymob.healths.name = "health" - mymob.healths.screen_loc = ui_health - hud_elements |= mymob.healths + healths = new /obj/screen() + healths.icon = HUD.ui_style + healths.icon_state = "health0" + healths.name = "health" + healths.screen_loc = ui_health + hud_elements |= healths //VOREStation Addition begin - mymob.shadekin_dark_display = new /obj/screen/shadekin/darkness() - mymob.shadekin_dark_display.screen_loc = ui_shadekin_dark_display - mymob.shadekin_dark_display.icon_state = "dark" - hud_elements |= mymob.shadekin_dark_display + shadekin_dark_display = new /obj/screen/shadekin/darkness() + shadekin_dark_display.screen_loc = ui_shadekin_dark_display + shadekin_dark_display.icon_state = "dark" + hud_elements |= shadekin_dark_display - mymob.shadekin_energy_display = new /obj/screen/shadekin/energy() - mymob.shadekin_energy_display.screen_loc = ui_shadekin_energy_display - mymob.shadekin_energy_display.icon_state = "energy0" - hud_elements |= mymob.shadekin_energy_display + shadekin_energy_display = new /obj/screen/shadekin/energy() + shadekin_energy_display.screen_loc = ui_shadekin_energy_display + shadekin_energy_display.icon_state = "energy0" + hud_elements |= shadekin_energy_display - mymob.xenochimera_danger_display = new /obj/screen/xenochimera/danger_level() - mymob.xenochimera_danger_display.screen_loc = ui_xenochimera_danger_display - mymob.xenochimera_danger_display.icon_state = "danger00" - hud_elements |= mymob.xenochimera_danger_display + xenochimera_danger_display = new /obj/screen/xenochimera/danger_level() + xenochimera_danger_display.screen_loc = ui_xenochimera_danger_display + xenochimera_danger_display.icon_state = "danger00" + hud_elements |= xenochimera_danger_display //VOREStation Addition end - mymob.ling_chem_display = new /obj/screen/ling/chems() - mymob.ling_chem_display.screen_loc = ui_ling_chemical_display - mymob.ling_chem_display.icon_state = "ling_chems" - hud_elements |= mymob.ling_chem_display + ling_chem_display = new /obj/screen/ling/chems() + ling_chem_display.screen_loc = ui_ling_chemical_display + ling_chem_display.icon_state = "ling_chems" + hud_elements |= ling_chem_display - mymob.wiz_instability_display = new /obj/screen/wizard/instability() - mymob.wiz_instability_display.screen_loc = ui_wiz_instability_display - mymob.wiz_instability_display.icon_state = "wiz_instability_none" - hud_elements |= mymob.wiz_instability_display + wiz_instability_display = new /obj/screen/wizard/instability() + wiz_instability_display.screen_loc = ui_wiz_instability_display + wiz_instability_display.icon_state = "wiz_instability_none" + hud_elements |= wiz_instability_display - mymob.wiz_energy_display = new/obj/screen/wizard/energy() - mymob.wiz_energy_display.screen_loc = ui_wiz_energy_display - mymob.wiz_energy_display.icon_state = "wiz_energy" - hud_elements |= mymob.wiz_energy_display + wiz_energy_display = new/obj/screen/wizard/energy() + wiz_energy_display.screen_loc = ui_wiz_energy_display + wiz_energy_display.icon_state = "wiz_energy" + hud_elements |= wiz_energy_display - mymob.pain = new /obj/screen( null ) + pain = new /obj/screen( null ) - mymob.zone_sel = new /obj/screen/zone_sel( null ) - mymob.zone_sel.icon = ui_style - mymob.zone_sel.color = ui_color - mymob.zone_sel.alpha = ui_alpha - mymob.zone_sel.overlays.Cut() - mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]") - hud_elements |= mymob.zone_sel + zone_sel = new /obj/screen/zone_sel( null ) + zone_sel.icon = HUD.ui_style + zone_sel.color = HUD.ui_color + zone_sel.alpha = HUD.ui_alpha + zone_sel.overlays.Cut() + zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[zone_sel.selecting]") + hud_elements |= zone_sel //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 + gun_setting_icon = new /obj/screen/gun/mode(null) + gun_setting_icon.icon = HUD.ui_style + gun_setting_icon.color = HUD.ui_color + gun_setting_icon.alpha = HUD.ui_alpha + hud_elements |= 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 + item_use_icon = new /obj/screen/gun/item(null) + item_use_icon.icon = HUD.ui_style + item_use_icon.color = HUD.ui_color + item_use_icon.alpha = HUD.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 + gun_move_icon = new /obj/screen/gun/move(null) + gun_move_icon.icon = HUD.ui_style + gun_move_icon.color = HUD.ui_color + gun_move_icon.alpha = HUD.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 + radio_use_icon = new /obj/screen/gun/radio(null) + radio_use_icon.icon = HUD.ui_style + radio_use_icon.color = HUD.ui_color + radio_use_icon.alpha = HUD.ui_alpha - if(mymob.client) - mymob.client.screen = list() + if(client) + client.screen = list() - mymob.client.screen += hud_elements - mymob.client.screen += src.adding + src.hotkeybuttons - mymob.client.screen += mymob.client.void - - inventory_shown = 0 - - return + client.screen += hud_elements + client.screen += adding + hotkeybuttons + client.screen += client.void + HUD.inventory_shown = 0 /mob/living/carbon/human/verb/toggle_hotkey_verbs() set category = "OOC" diff --git a/code/_onclick/hud/other_mobs.dm b/code/_onclick/hud/other_mobs.dm index 6a2a2a0f452..e69de29bb2d 100644 --- a/code/_onclick/hud/other_mobs.dm +++ b/code/_onclick/hud/other_mobs.dm @@ -1,143 +0,0 @@ - -/datum/hud/proc/unplayer_hud() - return - -/datum/hud/proc/ghost_hud() - return - -/datum/hud/proc/blob_hud(ui_style = 'icons/mob/screen1_Midnight.dmi') - - blobpwrdisplay = new /obj/screen() - blobpwrdisplay.name = "blob power" - blobpwrdisplay.icon_state = "block" - blobpwrdisplay.screen_loc = ui_health - blobpwrdisplay.layer = HUD_LAYER - - blobhealthdisplay = new /obj/screen() - blobhealthdisplay.name = "blob health" - blobhealthdisplay.icon_state = "block" - blobhealthdisplay.screen_loc = ui_internal - blobhealthdisplay.layer = HUD_LAYER - - mymob.client.screen = list() - - mymob.client.screen += list(blobpwrdisplay, blobhealthdisplay) - mymob.client.screen += mymob.client.void -/* -/datum/hud/proc/slime_hud(ui_style = 'icons/mob/screen1_Midnight.dmi') - - src.adding = list() - - var/obj/screen/using - - using = new /obj/screen() - using.name = "act_intent" - using.set_dir(SOUTHWEST) - using.icon = ui_style - using.icon_state = "intent_"+mymob.a_intent - using.screen_loc = ui_zonesel - using.layer = HUD_LAYER - src.adding += using - action_intent = using - - //intent small hud objects - var/icon/ico - - ico = new(ui_style, "black") - ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) - ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height()) - using = new /obj/screen( src ) - using.name = "help" - using.icon = ico - using.screen_loc = ui_zonesel - using.layer = HUD_LAYER+0.01 - src.adding += using - help_intent = using - - ico = new(ui_style, "black") - ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) - ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height()) - using = new /obj/screen( src ) - using.name = "disarm" - using.icon = ico - using.screen_loc = ui_zonesel - using.layer = HUD_LAYER+0.01 - src.adding += using - disarm_intent = using - - ico = new(ui_style, "black") - ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) - ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2) - using = new /obj/screen( src ) - using.name = "grab" - using.icon = ico - using.screen_loc = ui_zonesel - using.layer = HUD_LAYER+0.01 - src.adding += using - grab_intent = using - - ico = new(ui_style, "black") - ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) - ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2) - using = new /obj/screen( src ) - using.name = I_HURT - using.icon = ico - using.screen_loc = ui_zonesel - using.layer = HUD_LAYER+0.01 - src.adding += using - hurt_intent = using - - mymob.client.screen = list() - mymob.client.screen += src.adding - mymob.client.screen += mymob.client.void - - return -*/ - -// HUD.construct_hud() //Archaic. -/* -/datum/hud/proc/construct_hud() - var/constructtype - - if(istype(mymob,/mob/living/simple_mob/construct/armoured) || istype(mymob,/mob/living/simple_mob/construct/behemoth)) - constructtype = "juggernaut" - else if(istype(mymob,/mob/living/simple_mob/construct/builder)) - constructtype = "artificer" - else if(istype(mymob,/mob/living/simple_mob/construct/wraith)) - constructtype = "wraith" - else if(istype(mymob,/mob/living/simple_mob/construct/harvester)) - constructtype = "harvester" - - if(constructtype) - - mymob.fire.icon = 'icons/mob/screen1_construct.dmi' - mymob.fire.icon_state = "fire0" - mymob.fire.name = "fire" - mymob.fire.screen_loc = ui_construct_fire - - mymob.healths.icon = 'icons/mob/screen1_construct.dmi' - mymob.healths.icon_state = "[constructtype]_health0" - mymob.healths.name = "health" - mymob.healths.screen_loc = ui_construct_health - - mymob.pullin.icon = 'icons/mob/screen1_construct.dmi' - mymob.pullin.icon_state = "pull0" - mymob.pullin.name = "pull" - mymob.pullin.screen_loc = ui_construct_pull - - - mymob.zone_sel.icon = 'icons/mob/screen1_construct.dmi' - mymob.zone_sel.overlays.len = 0 - mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]") - - - mymob.purged.icon = 'icons/mob/screen1_construct.dmi' - mymob.purged.icon_state = "purge0" - mymob.purged.name = "purged" - mymob.purged.screen_loc = ui_construct_purge - - mymob.client.screen = list() - - mymob.client.screen += list(mymob.fire, mymob.healths, mymob.pullin, mymob.zone_sel, mymob.purged) - mymob.client.screen += mymob.client.void -*/ diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index c71e0004c85..95ff6e1104f 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -1,23 +1,19 @@ var/obj/screen/robot_inventory -/* -/mob/living/silicon/robot/instantiate_hud(var/datum/hud/HUD, var/ui_style, var/ui_color, var/ui_alpha) - HUD.robot_hud(ui_style, ui_color, ui_alpha, src)*/ -/datum/hud/proc/robot_hud(ui_style='icons/mob/screen1_robot.dmi', var/ui_color = "#ffffff", var/ui_alpha = 255, var/mob/living/silicon/robot/target) -/* var/datum/hud_data/hud_data - if(!istype(target)) - hud_data = new() +/mob/living/silicon/robot/create_mob_hud(datum/hud/HUD, apply_to_client = TRUE) + ..() - if(hud_data.icon) - ui_style = hud_data.icon*/ - - if(ui_style == 'icons/mob/screen/minimalist.dmi') - ui_style = 'icons/mob/screen1_robot_minimalist.dmi' + // Don't care about your prefs! Our icon is more important + if(HUD.ui_style == 'icons/mob/screen/minimalist.dmi') + HUD.ui_style = 'icons/mob/screen1_robot_minimalist.dmi' else - ui_style = 'icons/mob/screen1_robot.dmi' + HUD.ui_style = 'icons/mob/screen1_robot.dmi' - src.adding = list() - src.other = list() + var/list/adding = list() + var/list/other = list() + + HUD.adding = adding + HUD.other = other var/obj/screen/using @@ -25,51 +21,51 @@ var/obj/screen/robot_inventory using = new /obj/screen() using.name = "radio" using.set_dir(SOUTHWEST) - using.icon = ui_style - using.color = ui_color - using.alpha = ui_alpha + using.icon = HUD.ui_style + using.color = HUD.ui_color + using.alpha = HUD.ui_alpha using.icon_state = "radio" using.screen_loc = ui_movi using.layer = HUD_LAYER - src.adding += using + adding += using //Module select using = new /obj/screen() using.name = "module1" using.set_dir(SOUTHWEST) - using.icon = ui_style - using.color = ui_color - using.alpha = ui_alpha + using.icon = HUD.ui_style + using.color = HUD.ui_color + using.alpha = HUD.ui_alpha using.icon_state = "inv1" using.screen_loc = ui_inv1 using.layer = HUD_LAYER - src.adding += using - mymob:inv1 = using + adding += using + inv1 = using using = new /obj/screen() using.name = "module2" using.set_dir(SOUTHWEST) - using.icon = ui_style - using.color = ui_color - using.alpha = ui_alpha + using.icon = HUD.ui_style + using.color = HUD.ui_color + using.alpha = HUD.ui_alpha using.icon_state = "inv2" using.screen_loc = ui_inv2 using.layer = HUD_LAYER - src.adding += using - mymob:inv2 = using + adding += using + inv2 = using using = new /obj/screen() using.name = "module3" using.set_dir(SOUTHWEST) - using.icon = ui_style - using.color = ui_color - using.alpha = ui_alpha + using.icon = HUD.ui_style + using.color = HUD.ui_color + using.alpha = HUD.ui_alpha using.icon_state = "inv3" using.screen_loc = ui_inv3 using.layer = HUD_LAYER - src.adding += using - mymob:inv3 = using + adding += using + inv3 = using //End of module select @@ -77,98 +73,96 @@ var/obj/screen/robot_inventory using = new /obj/screen() using.name = "act_intent" using.set_dir(SOUTHWEST) - using.icon = ui_style - using.alpha = ui_alpha - using.icon_state = mymob.a_intent + using.icon = HUD.ui_style + using.alpha = HUD.ui_alpha + using.icon_state = a_intent using.screen_loc = ui_acti using.layer = HUD_LAYER - src.adding += using - action_intent = using + adding += using + HUD.action_intent = using //Health - mymob.healths = new /obj/screen() - mymob.healths.icon = ui_style - mymob.healths.icon_state = "health0" - mymob.healths.alpha = ui_alpha - mymob.healths.name = "health" - mymob.healths.screen_loc = ui_borg_health - src.other += mymob.healths + healths = new /obj/screen() + healths.icon = HUD.ui_style + healths.icon_state = "health0" + healths.alpha = HUD.ui_alpha + healths.name = "health" + healths.screen_loc = ui_borg_health + other += healths //Installed Module - mymob.hands = new /obj/screen() - mymob.hands.icon = ui_style - mymob.hands.icon_state = "nomod" - mymob.hands.alpha = ui_alpha - mymob.hands.name = "module" - mymob.hands.screen_loc = ui_borg_module - src.other += mymob.hands + hands = new /obj/screen() + hands.icon = HUD.ui_style + hands.icon_state = "nomod" + hands.alpha = HUD.ui_alpha + hands.name = "module" + hands.screen_loc = ui_borg_module + other += hands //Module Panel using = new /obj/screen() using.name = "panel" - using.icon = ui_style + using.icon = HUD.ui_style using.icon_state = "panel" - using.alpha = ui_alpha + using.alpha = HUD.ui_alpha using.screen_loc = ui_borg_panel using.layer = HUD_LAYER-0.01 - src.adding += using + adding += using //Store - mymob.throw_icon = new /obj/screen() - mymob.throw_icon.icon = ui_style - mymob.throw_icon.icon_state = "store" - mymob.throw_icon.alpha = ui_alpha - mymob.throw_icon.color = ui_color - mymob.throw_icon.name = "store" - mymob.throw_icon.screen_loc = ui_borg_store - src.other += mymob.throw_icon + throw_icon = new /obj/screen() + throw_icon.icon = HUD.ui_style + throw_icon.icon_state = "store" + throw_icon.alpha = HUD.ui_alpha + throw_icon.color = HUD.ui_color + throw_icon.name = "store" + throw_icon.screen_loc = ui_borg_store + other += throw_icon //Inventory robot_inventory = new /obj/screen() robot_inventory.name = "inventory" - robot_inventory.icon = ui_style + robot_inventory.icon = HUD.ui_style robot_inventory.icon_state = "inventory" - robot_inventory.alpha = ui_alpha - robot_inventory.color = ui_color + robot_inventory.alpha = HUD.ui_alpha + robot_inventory.color = HUD.ui_color robot_inventory.screen_loc = ui_borg_inventory - src.other += robot_inventory + other += robot_inventory - mymob.pullin = new /obj/screen() - mymob.pullin.icon = ui_style - mymob.pullin.icon_state = "pull0" - mymob.pullin.alpha = ui_alpha - mymob.pullin.color = ui_color - mymob.pullin.name = "pull" - mymob.pullin.screen_loc = ui_borg_pull - src.other += mymob.pullin + pullin = new /obj/screen() + pullin.icon = HUD.ui_style + pullin.icon_state = "pull0" + pullin.alpha = HUD.ui_alpha + pullin.color = HUD.ui_color + pullin.name = "pull" + pullin.screen_loc = ui_borg_pull + other += pullin - mymob.zone_sel = new /obj/screen/zone_sel() - mymob.zone_sel.icon = ui_style - mymob.zone_sel.alpha = ui_alpha - mymob.zone_sel.overlays.Cut() - mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]") + zone_sel = new /obj/screen/zone_sel() + zone_sel.icon = HUD.ui_style + zone_sel.alpha = HUD.ui_alpha + zone_sel.overlays.Cut() + zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[zone_sel.selecting]") //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.alpha = ui_alpha - mymob.item_use_icon = new /obj/screen/gun/item(null) - mymob.item_use_icon.icon = ui_style - 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.alpha = ui_alpha - mymob.radio_use_icon = new /obj/screen/gun/radio(null) - mymob.radio_use_icon.icon = ui_style - mymob.radio_use_icon.alpha = ui_alpha + gun_setting_icon = new /obj/screen/gun/mode(null) + gun_setting_icon.icon = HUD.ui_style + gun_setting_icon.alpha = HUD.ui_alpha + item_use_icon = new /obj/screen/gun/item(null) + item_use_icon.icon = HUD.ui_style + item_use_icon.alpha = HUD.ui_alpha + gun_move_icon = new /obj/screen/gun/move(null) + gun_move_icon.icon = HUD.ui_style + gun_move_icon.alpha = HUD.ui_alpha + radio_use_icon = new /obj/screen/gun/radio(null) + radio_use_icon.icon = HUD.ui_style + radio_use_icon.alpha = HUD.ui_alpha - mymob.client.screen = list() - - mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.hands, mymob.healths, mymob.pullin, robot_inventory, mymob.gun_setting_icon) - mymob.client.screen += src.adding + src.other - mymob.client.screen += mymob.client.void - - return + if(client && apply_to_client) + client.screen = list() + client.screen += list( throw_icon, zone_sel, hands, healths, pullin, robot_inventory, gun_setting_icon) + client.screen += HUD.adding + HUD.other + client.screen += client.void /datum/hud/proc/toggle_show_robot_modules() diff --git a/code/modules/ai/ai_holder.dm b/code/modules/ai/ai_holder.dm index 3cabb3ffdee..4dc43c20f31 100644 --- a/code/modules/ai/ai_holder.dm +++ b/code/modules/ai/ai_holder.dm @@ -20,7 +20,7 @@ if(istype(src, /mob/living/carbon/human)) var/mob/living/carbon/human/H = src H.hud_used = new /datum/hud(H) - H.instantiate_hud(H.hud_used) + H.create_mob_hud(H.hud_used) return ..() /mob/living/Destroy() diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index acf79a63687..ae97b6faa8a 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -129,6 +129,7 @@ if(!name) //To prevent nameless ghosts name = capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names)) real_name = name + animate(src, pixel_y = 2, time = 10, loop = -1) ..() /mob/observer/dead/Topic(href, href_list) @@ -318,6 +319,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp to_chat(usr, "Not when you're not dead!") return + if(!A) + A = input(usr, "Select an area:", "Ghost Teleport") as null|anything in return_sorted_areas() + if(!A) + return + usr.forceMove(pick(get_area_turfs(A))) usr.on_mob_jump() @@ -326,6 +332,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set name = "Follow" // "Haunt" set desc = "Follow and haunt a mob." + if(!input) + input = input(usr, "Select a mob:", "Ghost Follow") as null|anything in getmobs() + if(!input) + return + var/target = getmobs()[input] if(!target) return ManualFollow(target) @@ -359,6 +370,45 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp forceMove(T) sleep(15) + var/icon/I = icon(target.icon,target.icon_state,target.dir) + + var/orbitsize = (I.Width()+I.Height())*0.5 + orbitsize -= (orbitsize/world.icon_size)*(world.icon_size*0.25) + + var/rot_seg + + /* We don't have this pref yet + switch(ghost_orbit) + if(GHOST_ORBIT_TRIANGLE) + rot_seg = 3 + if(GHOST_ORBIT_SQUARE) + rot_seg = 4 + if(GHOST_ORBIT_PENTAGON) + rot_seg = 5 + if(GHOST_ORBIT_HEXAGON) + rot_seg = 6 + else //Circular + rot_seg = 36 //360/10 bby, smooth enough aproximation of a circle + */ + + orbit(target, orbitsize, FALSE, 20, rot_seg) + +/mob/observer/dead/orbit() + set_dir(2) //reset dir so the right directional sprites show up + return ..() + +/mob/observer/dead/stop_orbit(datum/component/orbiter/orbits) + . = ..() + //restart our floating animation after orbit is done. + pixel_y = 0 + pixel_x = 0 + transform = null + animate(src, pixel_y = 2, time = 10, loop = -1) + +/mob/observer/dead/proc/stop_following() + following = null + stop_orbit() + /mob/proc/update_following() . = get_turf(src) for(var/mob/observer/dead/M in following_mobs) @@ -373,7 +423,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp /mob/Destroy() for(var/mob/observer/dead/M in following_mobs) - M.following = null + M.stop_following() following_mobs = null return ..() @@ -381,7 +431,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(ismob(following)) var/mob/M = following M.following_mobs -= src - following = null + stop_following() return ..() /mob/Moved(atom/old_loc, direction, forced = FALSE) @@ -406,35 +456,28 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set category = "Ghost" set name = "Jump to Mob" set desc = "Teleport to a mob" - set popup_menu = FALSE //VOREStation Edit - Declutter. - if(istype(usr, /mob/observer/dead)) //Make sure they're an observer! - var/target = getmobs()[input] - if (!target)//Make sure we actually have a target - return - else - var/mob/M = target //Destination mob - var/turf/T = get_turf(M) //Turf of the destination mob + set popup_menu = FALSE - if(T && isturf(T)) //Make sure the turf exists, then move the source to that destination. - forceMove(T) - following = null - else - to_chat(src, "This mob is not located in the game world.") -/* -/mob/observer/dead/verb/boo() - set category = "Ghost" - set name = "Boo!" - set desc= "Scare your crew members because of boredom!" - - if(bootime > world.time) return - var/obj/machinery/light/L = locate(/obj/machinery/light) in view(1, src) - if(L) - L.flicker() - bootime = world.time + 600 + if(!istype(usr, /mob/observer/dead)) //Make sure they're an observer! return - //Maybe in the future we can add more spooky code here! - return -*/ + + if(!input) + input = input(usr, "Select a mob:", "Ghost Jump") as null|anything in getmobs() + if(!input) + return + + var/target = getmobs()[input] + if (!target)//Make sure we actually have a target + return + else + var/mob/M = target //Destination mob + var/turf/T = get_turf(M) //Turf of the destination mob + + if(T && isturf(T)) //Make sure the turf exists, then move the source to that destination. + forceMove(T) + stop_following() + else + to_chat(src, "This mob is not located in the game world.") /mob/observer/dead/memory() set hidden = 1 @@ -445,7 +488,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp to_chat(src, "You are dead! You have no mind to store memory!") /mob/observer/dead/Post_Incorpmove() - following = null + stop_following() /mob/observer/dead/verb/analyze_air() set name = "Analyze Air" @@ -813,14 +856,20 @@ mob/observer/dead/MayRespawn(var/feedback = 0) set category = "Ghost" set name = "Blank pAI alert" set desc = "Flash an indicator light on available blank pAI devices for a smidgen of hope." - if(usr.client.prefs.be_special & BE_PAI) + + if(usr.client.prefs?.be_special & BE_PAI) + var/count = 0 for(var/obj/item/device/paicard/p in all_pai_cards) var/obj/item/device/paicard/PP = p if(PP.pai == null) + count++ PP.icon = 'icons/obj/pda_vr.dmi' // VOREStation Edit PP.overlays += "pai-ghostalert" spawn(54) PP.overlays.Cut() + to_chat(usr,"Flashing the displays of [count] unoccupied PAIs.") + else + to_chat(usr,"You have 'Be pAI' disabled in your character prefs, so we can't help you.") /mob/observer/dead/speech_bubble_appearance() return "ghost" diff --git a/code/modules/mob/living/simple_mob/simple_hud.dm b/code/modules/mob/living/simple_mob/simple_hud.dm index c16af17ae97..d9641b4068c 100644 --- a/code/modules/mob/living/simple_mob/simple_hud.dm +++ b/code/modules/mob/living/simple_mob/simple_hud.dm @@ -1,6 +1,5 @@ -/mob/living/simple_mob/instantiate_hud(var/datum/hud/hud) - if(!client) - return //Why bother. +/mob/living/simple_mob/create_mob_hud(datum/hud/HUD) + ..() var/ui_style = 'icons/mob/screen1_animal.dmi' if(ui_icons) @@ -14,9 +13,9 @@ var/list/hotkeybuttons = list() var/list/slot_info = list() - hud.adding = adding - hud.other = other - hud.hotkeybuttons = hotkeybuttons + HUD.adding = adding + HUD.other = other + HUD.hotkeybuttons = hotkeybuttons var/list/hud_elements = list() var/obj/screen/using @@ -65,8 +64,8 @@ using.screen_loc = ui_acti using.color = ui_color using.alpha = ui_alpha - hud.adding += using - hud.action_intent = using + HUD.adding += using + HUD.action_intent = using hud_elements |= using @@ -82,8 +81,8 @@ using.screen_loc = ui_acti using.alpha = ui_alpha using.layer = LAYER_HUD_ITEM //These sit on the intent box - hud.adding += using - hud.help_intent = using + HUD.adding += using + HUD.help_intent = using ico = new(ui_style, "black") ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) @@ -94,8 +93,8 @@ using.screen_loc = ui_acti using.alpha = ui_alpha using.layer = LAYER_HUD_ITEM - hud.adding += using - hud.disarm_intent = using + HUD.adding += using + HUD.disarm_intent = using ico = new(ui_style, "black") ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) @@ -106,8 +105,8 @@ using.screen_loc = ui_acti using.alpha = ui_alpha using.layer = LAYER_HUD_ITEM - hud.adding += using - hud.grab_intent = using + HUD.adding += using + HUD.grab_intent = using ico = new(ui_style, "black") ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) @@ -118,8 +117,8 @@ using.screen_loc = ui_acti using.alpha = ui_alpha using.layer = LAYER_HUD_ITEM - hud.adding += using - hud.hurt_intent = using + HUD.adding += using + HUD.hurt_intent = using //Move intent (walk/run) using = new /obj/screen() @@ -129,8 +128,8 @@ using.screen_loc = ui_movi using.color = ui_color using.alpha = ui_alpha - hud.adding += using - hud.move_intent = using + HUD.adding += using + HUD.move_intent = using //Resist button using = new /obj/screen() @@ -140,7 +139,7 @@ using.screen_loc = ui_pull_resist using.color = ui_color using.alpha = ui_alpha - hud.hotkeybuttons += using + HUD.hotkeybuttons += using //Pull button pullin = new /obj/screen() @@ -148,7 +147,7 @@ pullin.icon_state = "pull0" pullin.name = "pull" pullin.screen_loc = ui_pull_resist - hud.hotkeybuttons += pullin + HUD.hotkeybuttons += pullin hud_elements |= pullin //Health status @@ -159,8 +158,6 @@ healths.screen_loc = ui_health hud_elements |= healths - - pain = new /obj/screen( null ) zone_sel = new /obj/screen/zone_sel( null ) @@ -181,7 +178,7 @@ using.screen_loc = ui_drop_throw using.color = ui_color using.alpha = ui_alpha - hud.hotkeybuttons += using + HUD.hotkeybuttons += using //Equip detail using = new /obj/screen() @@ -191,7 +188,7 @@ using.screen_loc = ui_equip using.color = ui_color using.alpha = ui_alpha - hud.adding += using + HUD.adding += using //Hand slots themselves inv_box = new /obj/screen/inventory/hand() @@ -205,8 +202,8 @@ inv_box.slot_id = slot_r_hand inv_box.color = ui_color inv_box.alpha = ui_alpha - hud.r_hand_hud_object = inv_box - hud.adding += inv_box + HUD.r_hand_hud_object = inv_box + HUD.adding += inv_box slot_info["[slot_r_hand]"] = inv_box.screen_loc inv_box = new /obj/screen/inventory/hand() @@ -220,8 +217,8 @@ inv_box.slot_id = slot_l_hand inv_box.color = ui_color inv_box.alpha = ui_alpha - hud.l_hand_hud_object = inv_box - hud.adding += inv_box + HUD.l_hand_hud_object = inv_box + HUD.adding += inv_box slot_info["[slot_l_hand]"] = inv_box.screen_loc //Swaphand titlebar @@ -232,7 +229,7 @@ using.screen_loc = ui_swaphand1 using.color = ui_color using.alpha = ui_alpha - hud.adding += using + HUD.adding += using using = new /obj/screen/inventory() using.name = "hand" @@ -241,7 +238,7 @@ using.screen_loc = ui_swaphand2 using.color = ui_color using.alpha = ui_alpha - hud.adding += using + HUD.adding += using //Throw button throw_icon = new /obj/screen() @@ -251,15 +248,13 @@ throw_icon.screen_loc = ui_drop_throw throw_icon.color = ui_color throw_icon.alpha = ui_alpha - hud.hotkeybuttons += throw_icon + HUD.hotkeybuttons += throw_icon hud_elements |= throw_icon - extra_huds(hud,ui_style,hud_elements) + extra_huds(HUD, HUD.ui_style, hud_elements) - client.screen = list() - - client.screen += hud_elements - client.screen += adding + hotkeybuttons - client.screen += client.void - - return + if(client) + client.screen = list() + client.screen += hud_elements + client.screen += adding + hotkeybuttons + client.screen += client.void diff --git a/icons/mob/screen1_robot.dmi b/icons/mob/screen1_robot.dmi index b991f26d437..993c5b3eb46 100644 Binary files a/icons/mob/screen1_robot.dmi and b/icons/mob/screen1_robot.dmi differ diff --git a/icons/mob/screen_ghost.dmi b/icons/mob/screen_ghost.dmi new file mode 100644 index 00000000000..fe19953b180 Binary files /dev/null and b/icons/mob/screen_ghost.dmi differ diff --git a/vorestation.dme b/vorestation.dme index e943234da0d..e0b3619c974 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -152,6 +152,7 @@ #include "code\_onclick\hud\alert.dm" #include "code\_onclick\hud\alien_larva.dm" #include "code\_onclick\hud\fullscreen.dm" +#include "code\_onclick\hud\ghost.dm" #include "code\_onclick\hud\gun_mode.dm" #include "code\_onclick\hud\hud.dm" #include "code\_onclick\hud\human.dm"