From 58195b8e856f3d03fe721569ed2e29fd476675e6 Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Sun, 29 Nov 2015 07:04:21 -0500 Subject: [PATCH] Screen object cleanup --- code/_onclick/hud/ai.dm | 176 +++++++- code/_onclick/hud/alien.dm | 34 +- code/_onclick/hud/alien_larva.dm | 6 +- code/_onclick/hud/human.dm | 43 +- code/_onclick/hud/monkey.dm | 10 +- code/_onclick/hud/robot.dm | 98 ++++- code/_onclick/hud/screen_objects.dm | 645 ++++++++++------------------ 7 files changed, 539 insertions(+), 473 deletions(-) diff --git a/code/_onclick/hud/ai.dm b/code/_onclick/hud/ai.dm index 76bb71e296a..aaf80865f4c 100644 --- a/code/_onclick/hud/ai.dm +++ b/code/_onclick/hud/ai.dm @@ -1,3 +1,143 @@ +/obj/screen/ai + icon = 'icons/mob/screen_ai.dmi' + +/obj/screen/ai/aicore + name = "AI core" + icon_state = "ai_core" + +/obj/screen/ai/aicore/Click() + if(isAI(usr)) + var/mob/living/silicon/ai/AI = usr + AI.view_core() + +/obj/screen/ai/camera_list + name = "Show Camera List" + icon_state = "camera" + +/obj/screen/ai/camera_list/Click() + if(isAI(usr)) + var/mob/living/silicon/ai/AI = usr + var/camera = input(AI) in AI.get_camera_list() + AI.ai_camera_list(camera) + +/obj/screen/ai/camera_track + name = "Track With Camera" + icon_state = "track" + +/obj/screen/ai/camera_track/Click() + if(isAI(usr)) + var/mob/living/silicon/ai/AI = usr + var/target_name = input(AI) in AI.trackable_mobs() + AI.ai_camera_track(target_name) + +/obj/screen/ai/camera_light + name = "Toggle Camera Light" + icon_state = "camera_light" + +/obj/screen/ai/camera_light/Click() + if(isAI(usr)) + var/mob/living/silicon/ai/AI = usr + AI.toggle_camera_light() + +/obj/screen/ai/crew_monitor + name = "Crew Monitoring Console" + icon_state = "crew_monitor" + +/obj/screen/ai/crew_monitor/Click() + if(isAI(usr)) + var/mob/living/silicon/ai/AI = usr + AI.subsystem_crew_monitor() + +/obj/screen/ai/crew_manifest + name = "Crew Manifest" + icon_state = "manifest" + +/obj/screen/ai/crew_manifest/Click() + if(isAI(usr)) + var/mob/living/silicon/ai/AI = usr + AI.ai_roster() + +/obj/screen/ai/alerts + name = "Show Alerts" + icon_state = "alerts" + +/obj/screen/ai/alerts/Click() + if(isAI(usr)) + var/mob/living/silicon/ai/AI = usr + AI.subsystem_alarm_monitor() + +/obj/screen/ai/announcement + name = "Make Announcement" + icon_state = "announcement" + +/obj/screen/ai/announcement/Click() + var/mob/living/silicon/ai/AI = usr + AI.announcement() + +/obj/screen/ai/call_shuttle + name = "Call Emergency Shuttle" + icon_state = "call_shuttle" + +/obj/screen/ai/call_shuttle/Click() + if(isAI(usr)) + var/mob/living/silicon/ai/AI = usr + AI.ai_call_shuttle() + +/obj/screen/ai/state_laws + name = "State Laws" + icon_state = "state_laws" + +/obj/screen/ai/state_laws/Click() + if(isAI(usr)) + var/mob/living/silicon/ai/AI = usr + AI.subsystem_law_manager() + +/obj/screen/ai/pda_msg_send + name = "PDA - Send Message" + icon_state = "pda_send" + +/obj/screen/ai/pda_msg_send/Click() + if(isAI(usr)) + var/mob/living/silicon/ai/AI = usr + AI.cmd_send_pdamesg(usr) + +/obj/screen/ai/pda_msg_show + name = "PDA - Show Message Log" + icon_state = "pda_receive" + +/obj/screen/ai/pda_msg_show/Click() + if(isAI(usr)) + var/mob/living/silicon/ai/AI = usr + AI.cmd_show_message_log(usr) + +/obj/screen/ai/image_take + name = "Take Image" + icon_state = "take_picture" + +/obj/screen/ai/image_take/Click() + if(isAI(usr)) + var/mob/living/silicon/ai/AI = usr + AI.aiCamera.toggle_camera_mode() + +/obj/screen/ai/image_view + name = "View Images" + icon_state = "view_images" + +/obj/screen/ai/image_view/Click() + if(isAI(usr)) + var/mob/living/silicon/ai/AI = usr + AI.aiCamera.viewpictures() + +/obj/screen/ai/sensors + name = "Sensor Augmentation" + icon_state = "ai_sensor" + +/obj/screen/ai/sensors/Click() + if(isAI(usr)) + var/mob/living/silicon/ai/AI = usr + AI.sensor_mode() + + /datum/hud/proc/ai_hud() adding = list() other = list() @@ -5,7 +145,7 @@ var/obj/screen/using //AI core - using = new /obj/screen() + using = new /obj/screen/ai/aicore() using.name = "AI Core" using.icon = 'icons/mob/screen_ai.dmi' using.icon_state = "ai_core" @@ -14,7 +154,7 @@ adding += using //Camera list - using = new /obj/screen() + using = new /obj/screen/ai/camera_list() using.name = "Show Camera List" using.icon = 'icons/mob/screen_ai.dmi' using.icon_state = "camera" @@ -23,7 +163,7 @@ adding += using //Track - using = new /obj/screen() + using = new /obj/screen/ai/camera_track() using.name = "Track With Camera" using.icon = 'icons/mob/screen_ai.dmi' using.icon_state = "track" @@ -32,7 +172,7 @@ adding += using //Camera light - using = new /obj/screen() + using = new /obj/screen/ai/camera_light() using.name = "Toggle Camera Light" using.icon = 'icons/mob/screen_ai.dmi' using.icon_state = "camera_light" @@ -41,7 +181,7 @@ adding += using //Crew Monitorting - using = new /obj/screen() + using = new /obj/screen/ai/crew_monitor() using.name = "Crew Monitoring" using.icon = 'icons/mob/screen_ai.dmi' using.icon_state = "crew_monitor" @@ -50,7 +190,7 @@ adding += using //Crew Manifest - using = new /obj/screen() + using = new /obj/screen/ai/crew_manifest() using.name = "Show Crew Manifest" using.icon = 'icons/mob/screen_ai.dmi' using.icon_state = "manifest" @@ -59,7 +199,7 @@ adding += using //Alerts - using = new /obj/screen() + using = new /obj/screen/ai/alerts() using.name = "Show Alerts" using.icon = 'icons/mob/screen_ai.dmi' using.icon_state = "alerts" @@ -68,7 +208,7 @@ adding += using //Announcement - using = new /obj/screen() + using = new /obj/screen/ai/announcement() using.name = "Announcement" using.icon = 'icons/mob/screen_ai.dmi' using.icon_state = "announcement" @@ -77,7 +217,7 @@ adding += using //Shuttle - using = new /obj/screen() + using = new /obj/screen/ai/announcement() using.name = "Call Emergency Shuttle" using.icon = 'icons/mob/screen_ai.dmi' using.icon_state = "call_shuttle" @@ -86,7 +226,7 @@ adding += using //Laws - using = new /obj/screen() + using = new /obj/screen/ai/state_laws() using.name = "Law Manager" using.icon = 'icons/mob/screen_ai.dmi' using.icon_state = "state_laws" @@ -95,7 +235,7 @@ adding += using //PDA message - using = new /obj/screen() + using = new /obj/screen/ai/pda_msg_send() using.name = "PDA - Send Message" using.icon = 'icons/mob/screen_ai.dmi' using.icon_state = "pda_send" @@ -104,7 +244,7 @@ adding += using //PDA log - using = new /obj/screen() + using = new /obj/screen/ai/pda_msg_show() using.name = "PDA - Show Message Log" using.icon = 'icons/mob/screen_ai.dmi' using.icon_state = "pda_receive" @@ -113,7 +253,7 @@ adding += using //Take image - using = new /obj/screen() + using = new /obj/screen/ai/image_take() using.name = "Take Image" using.icon = 'icons/mob/screen_ai.dmi' using.icon_state = "take_picture" @@ -122,21 +262,21 @@ adding += using //View images - using = new /obj/screen() + using = new /obj/screen/ai/image_view() using.name = "View Images" using.icon = 'icons/mob/screen_ai.dmi' using.icon_state = "view_images" using.screen_loc = ui_ai_view_images using.layer = 20 adding += using - + //Medical/Security sensors - using = new /obj/screen() + using = new /obj/screen/ai/sensors() using.name = "Set Sensor Augmentation" using.icon = 'icons/mob/screen_ai.dmi' - using.icon_state = "ai_sensor" + using.icon_state = "ai_sensor" using.screen_loc = ui_ai_sensor - using.layer = 20 + using.layer = 20 adding += using mymob.client.screen += adding + other diff --git a/code/_onclick/hud/alien.dm b/code/_onclick/hud/alien.dm index 763269c2af7..568ffa084f2 100644 --- a/code/_onclick/hud/alien.dm +++ b/code/_onclick/hud/alien.dm @@ -1,3 +1,23 @@ +/obj/screen/alien + icon = 'icons/mob/screen_alien.dmi' + +/obj/screen/alien/leap + name = "toggle leap" + icon_state = "leap_off" + +/obj/screen/alien/leap/Click() + if(istype(usr, /mob/living/carbon/alien/humanoid)) + var/mob/living/carbon/alien/humanoid/hunter/AH = usr + AH.toggle_leap() + +/obj/screen/alien/nightvision + name = "toggle night-vision" + icon_state = "nightvision1" + +/obj/screen/alien/nightvision/Click() + var/mob/living/carbon/alien/humanoid/A = usr + A.nightvisiontoggle() + /datum/hud/proc/embryo_hud() return @@ -8,7 +28,7 @@ var/obj/screen/using var/obj/screen/inventory/inv_box - using = new /obj/screen() + using = new /obj/screen/act_intent() using.name = "act_intent" using.dir = SOUTHWEST using.icon = 'icons/mob/screen1_alien.dmi' @@ -18,7 +38,7 @@ src.adding += using action_intent = using - using = new /obj/screen() + using = new /obj/screen/mov_intent() using.name = "mov_intent" using.dir = SOUTHWEST using.icon = 'icons/mob/screen1_alien.dmi' @@ -29,7 +49,7 @@ move_intent = using if(istype(mymob, /mob/living/carbon/alien/humanoid/hunter)) - mymob.leap_icon = new /obj/screen() + mymob.leap_icon = new /obj/screen/alien/leap() mymob.leap_icon.icon = 'icons/mob/screen1_alien.dmi' mymob.leap_icon.name = "toggle leap" mymob.leap_icon.icon_state = "leap_off" @@ -83,7 +103,7 @@ //end of equippable shit - using = new /obj/screen() + using = new /obj/screen/resist() using.name = "resist" using.icon = 'icons/mob/screen1_alien.dmi' using.icon_state = "act_resist" @@ -91,7 +111,7 @@ using.layer = 19 src.adding += using - using = new /obj/screen() + using = new /obj/screen/drop() using.name = "drop" using.icon = 'icons/mob/screen1_alien.dmi' using.icon_state = "act_drop" @@ -99,7 +119,7 @@ using.layer = 19 src.adding += using - mymob.throw_icon = new /obj/screen() + mymob.throw_icon = new /obj/screen/throw_catch() mymob.throw_icon.icon = 'icons/mob/screen1_alien.dmi' mymob.throw_icon.icon_state = "act_throw_off" mymob.throw_icon.name = "throw" @@ -129,7 +149,7 @@ mymob.healths.name = "health" mymob.healths.screen_loc = ui_alien_health - nightvisionicon = new /obj/screen() + nightvisionicon = new /obj/screen/alien/nightvision() nightvisionicon.icon = 'icons/mob/screen1_alien.dmi' nightvisionicon.icon_state = "nightvision1" nightvisionicon.name = "night vision" diff --git a/code/_onclick/hud/alien_larva.dm b/code/_onclick/hud/alien_larva.dm index 4c9b7b651c1..18c2d344f53 100644 --- a/code/_onclick/hud/alien_larva.dm +++ b/code/_onclick/hud/alien_larva.dm @@ -4,7 +4,7 @@ var/obj/screen/using - using = new /obj/screen() + using = new /obj/screen/act_intent() using.name = "act_intent" using.dir = SOUTHWEST using.icon = 'icons/mob/screen1_alien.dmi' @@ -14,7 +14,7 @@ src.adding += using action_intent = using - using = new /obj/screen() + using = new /obj/screen/mov_intent() using.name = "mov_intent" using.dir = SOUTHWEST using.icon = 'icons/mob/screen1_alien.dmi' @@ -50,7 +50,7 @@ mymob.healths.name = "health" mymob.healths.screen_loc = ui_alien_health - nightvisionicon = new /obj/screen() + nightvisionicon = new /obj/screen/alien/nightvision() nightvisionicon.icon = 'icons/mob/screen1_alien.dmi' nightvisionicon.icon_state = "nightvision1" nightvisionicon.name = "night vision" diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index f55951b5f37..6e6f1d0e651 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -1,3 +1,30 @@ +/obj/screen/human + icon = 'icons/mob/screen1_midnight.dmi' + +/obj/screen/human/toggle + name = "toggle" + icon_state = "toggle" + +/obj/screen/human/toggle/Click() + if(usr.hud_used.inventory_shown) + usr.hud_used.inventory_shown = 0 + usr.client.screen -= usr.hud_used.other + else + usr.hud_used.inventory_shown = 1 + usr.client.screen += usr.hud_used.other + + usr.hud_used.hidden_inventory_update() + +/obj/screen/human/equip + name = "equip" + icon_state = "act_equip" + +/obj/screen/human/equip/Click() + if(istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech + return 1 + var/mob/living/carbon/human/H = usr + H.quick_equip() + /datum/hud/proc/human_hud(var/ui_style='icons/mob/screen1_White.dmi', var/ui_color = "#ffffff", var/ui_alpha = 255) src.adding = list() @@ -7,7 +34,7 @@ var/obj/screen/using var/obj/screen/inventory/inv_box - using = new /obj/screen() + using = new /obj/screen/act_intent() using.name = "act_intent" using.dir = SOUTHWEST using.icon = ui_style @@ -72,7 +99,7 @@ //end intent small hud objects - using = new /obj/screen() + using = new /obj/screen/mov_intent() using.name = "mov_intent" using.dir = SOUTHWEST using.icon = ui_style @@ -84,7 +111,7 @@ src.adding += using move_intent = using - using = new /obj/screen() + using = new /obj/screen/drop() using.name = "drop" using.icon = ui_style using.icon_state = "act_drop" @@ -252,7 +279,7 @@ inv_box.alpha = ui_alpha src.adding += inv_box - using = new /obj/screen() + using = new /obj/screen/resist() using.name = "resist" using.icon = ui_style using.icon_state = "act_resist" @@ -262,7 +289,7 @@ using.alpha = ui_alpha src.hotkeybuttons += using - using = new /obj/screen() + using = new /obj/screen/human/toggle() using.name = "toggle" using.icon = ui_style using.icon_state = "other" @@ -272,7 +299,7 @@ using.alpha = ui_alpha src.adding += using - using = new /obj/screen() + using = new /obj/screen/human/equip() using.name = "equip" using.icon = ui_style using.icon_state = "act_equip" @@ -359,7 +386,7 @@ inv_box.alpha = ui_alpha src.adding += inv_box - mymob.throw_icon = new /obj/screen() + mymob.throw_icon = new /obj/screen/throw_catch() mymob.throw_icon.icon = ui_style mymob.throw_icon.icon_state = "act_throw_off" mymob.throw_icon.name = "throw" @@ -386,7 +413,7 @@ mymob.toxin.name = "toxin" mymob.toxin.screen_loc = ui_toxin - mymob.internals = new /obj/screen() + mymob.internals = new /obj/screen/internals() mymob.internals.icon = ui_style mymob.internals.icon_state = "internal0" mymob.internals.name = "internal" diff --git a/code/_onclick/hud/monkey.dm b/code/_onclick/hud/monkey.dm index fce38a8b465..09a2dce5b4f 100644 --- a/code/_onclick/hud/monkey.dm +++ b/code/_onclick/hud/monkey.dm @@ -7,7 +7,7 @@ var/obj/screen/using var/obj/screen/inventory/inv_box - using = new /obj/screen() + using = new /obj/screen/act_intent() using.name = "act_intent" using.dir = SOUTHWEST using.icon = ui_style @@ -72,7 +72,7 @@ //end intent small hud objects - using = new /obj/screen() + using = new /obj/screen/mov_intent() using.name = "mov_intent" using.dir = SOUTHWEST using.icon = ui_style @@ -84,7 +84,7 @@ src.adding += using move_intent = using - using = new /obj/screen() + using = new /obj/screen/drop() using.name = "drop" using.icon = ui_style using.icon_state = "act_drop" @@ -170,7 +170,7 @@ inv_box.alpha = ui_alpha src.adding += inv_box - mymob.throw_icon = new /obj/screen() + mymob.throw_icon = new /obj/screen/throw_catch() mymob.throw_icon.icon = ui_style mymob.throw_icon.icon_state = "act_throw_off" mymob.throw_icon.name = "throw" @@ -197,7 +197,7 @@ mymob.toxin.name = "toxin" mymob.toxin.screen_loc = ui_toxin - mymob.internals = new /obj/screen() + mymob.internals = new /obj/screen/internals() mymob.internals.icon = ui_style mymob.internals.icon_state = "internal0" mymob.internals.name = "internal" diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index bd782657ce9..bfde0049cbd 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -1,3 +1,83 @@ +/obj/screen/robot + icon = 'icons/mob/screen1_robot.dmi' + +/obj/screen/robot/module + name = "cyborg module" + icon_state = "nomod" + +/obj/screen/robot/module/Click() + if(isrobot(usr)) + var/mob/living/silicon/robot/R = usr + if(R.module) + R.hud_used.toggle_show_robot_modules() + return 1 + R.pick_module() + +/obj/screen/robot/module1 + name = "module1" + icon_state = "inv1" + +/obj/screen/robot/module1/Click() + if(isrobot(usr)) + var/mob/living/silicon/robot/R = usr + R.toggle_module(1) + +/obj/screen/robot/module2 + name = "module2" + icon_state = "inv2" + +/obj/screen/robot/module2/Click() + if(isrobot(usr)) + var/mob/living/silicon/robot/R = usr + R.toggle_module(2) + +/obj/screen/robot/module3 + name = "module3" + icon_state = "inv3" + +/obj/screen/robot/module3/Click() + if(isrobot(usr)) + var/mob/living/silicon/robot/R = usr + R.toggle_module(3) + + +/obj/screen/robot/radio + name = "radio" + icon_state = "radio" + +/obj/screen/robot/radio/Click() + if(issilicon(usr)) + var/mob/living/silicon/robot/R = usr + R.radio_menu() + +/obj/screen/robot/store + name = "store" + icon_state = "store" + +/obj/screen/robot/store/Click() + if(isrobot(usr)) + var/mob/living/silicon/robot/R = usr + R.uneq_active() + R.hud_used.update_robot_modules_display() + +/obj/screen/robot/lamp + name = "headlamp" + icon_state = "lamp0" + +/obj/screen/robot/lamp/Click() + if(isrobot(usr)) + var/mob/living/silicon/robot/R = usr + R.control_headlamp() + +/obj/screen/robot/panel + name = "installed modules" + icon_state = "panel" + +/obj/screen/robot/panel/Click() + if(issilicon(usr)) + var/mob/living/silicon/robot/R = usr + R.installed_modules() + /datum/hud/proc/robot_hud() src.adding = list() @@ -7,7 +87,7 @@ //Radio - using = new /obj/screen() + using = new /obj/screen/robot/radio() using.name = "radio" using.dir = SOUTHWEST using.icon = 'icons/mob/screen1_robot.dmi' @@ -18,7 +98,7 @@ //Module select - using = new /obj/screen() + using = new /obj/screen/robot/module1() using.name = "module1" using.dir = SOUTHWEST using.icon = 'icons/mob/screen1_robot.dmi' @@ -28,7 +108,7 @@ src.adding += using mymob:inv1 = using - using = new /obj/screen() + using = new /obj/screen/robot/module2() using.name = "module2" using.dir = SOUTHWEST using.icon = 'icons/mob/screen1_robot.dmi' @@ -38,7 +118,7 @@ src.adding += using mymob:inv2 = using - using = new /obj/screen() + using = new /obj/screen/robot/module3() using.name = "module3" using.dir = SOUTHWEST using.icon = 'icons/mob/screen1_robot.dmi' @@ -51,7 +131,7 @@ //End of module select //Sec/Med HUDs - using = new /obj/screen() + using = new /obj/screen/ai/sensors() using.name = "Toggle Sensor Augmentation" using.icon = 'icons/mob/screen_ai.dmi' using.icon_state = "ai_sensor" @@ -60,7 +140,7 @@ adding += using //Intent - using = new /obj/screen() + using = new /obj/screen/act_intent() using.name = "act_intent" using.dir = SOUTHWEST using.icon = 'icons/mob/screen1_robot.dmi' @@ -85,7 +165,7 @@ mymob.healths.screen_loc = ui_borg_health //Installed Module - mymob.hands = new /obj/screen() + mymob.hands = new /obj/screen/robot/module() mymob.hands.icon = 'icons/mob/screen1_robot.dmi' mymob.hands.icon_state = "nomod" mymob.hands.name = "module" @@ -93,14 +173,14 @@ //Store - mymob.throw_icon = new /obj/screen() + mymob.throw_icon = new /obj/screen/robot/store() mymob.throw_icon.icon = 'icons/mob/screen1_robot.dmi' mymob.throw_icon.icon_state = "store" mymob.throw_icon.name = "store" mymob.throw_icon.screen_loc = ui_borg_store //Headlamp - mymob:lamp_button = new /obj/screen() + mymob:lamp_button = new /obj/screen/robot/lamp() mymob:lamp_button.icon = 'icons/mob/screen1_robot.dmi' mymob:lamp_button.icon_state = "lamp0" mymob:lamp_button.name = "Toggle Headlamp" diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index cf0f56cdad9..0041e1d4bbc 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -41,6 +41,15 @@ S.close(usr) return 1 +/obj/screen/drop + name = "drop" + icon = 'icons/mob/screen1_midnight.dmi' + icon_state = "act_drop" + layer = 19 + +/obj/screen/drop/Click() + usr.drop_item_v() + /obj/screen/grab name = "grab" @@ -54,7 +63,198 @@ /obj/screen/grab/attackby() return +/obj/screen/act_intent + name = "intent" + icon_state = "help" +/obj/screen/act_intent/Click(location, control, params) + usr.a_intent_change("right") + if("help") + usr.a_intent = I_HELP + usr.hud_used.action_intent.icon_state = "intent_help" + if("harm") + usr.a_intent = I_HARM + usr.hud_used.action_intent.icon_state = "intent_harm" + if("grab") + usr.a_intent = I_GRAB + usr.hud_used.action_intent.icon_state = "intent_grab" + if("disarm") + usr.a_intent = I_DISARM + usr.hud_used.action_intent.icon_state = "intent_disarm" + +/obj/screen/internals + name = "toggle internals" + icon_state = "internal0" + +/obj/screen/internals/Click() + if(iscarbon(usr)) + var/mob/living/carbon/C = usr + if(!C.stat && !C.stunned && !C.paralysis && !C.restrained()) + if(C.internal) + C.internal = null + C << "No longer running on internals." + if(C.internals) + C.internals.icon_state = "internal0" + else + + var/no_mask + if(!(C.wear_mask && C.wear_mask.flags & AIRTIGHT)) + if(ishuman(C)) + var/mob/living/carbon/human/H = C + if(!(H.head && H.head.flags & AIRTIGHT)) + no_mask = 1 + + if(no_mask) + C << "You are not wearing a suitable mask or helmet." + return 1 + else + var/list/nicename = null + var/list/tankcheck = null + var/breathes = "oxygen" //default, we'll check later + var/list/contents = list() + var/from = "on" + + if(ishuman(C)) + var/mob/living/carbon/human/H = C + breathes = H.species.breath_type + nicename = list ("suit", "back", "belt", "right hand", "left hand", "left pocket", "right pocket") + tankcheck = list (H.s_store, C.back, H.belt, C.r_hand, C.l_hand, H.l_store, H.r_store) + else + nicename = list("right hand", "left hand", "back") + tankcheck = list(C.r_hand, C.l_hand, C.back) + + // Rigs are a fucking pain since they keep an air tank in nullspace. + if(istype(C.back,/obj/item/weapon/rig)) + var/obj/item/weapon/rig/rig = C.back + if(rig.air_supply) + from = "in" + nicename |= "hardsuit" + tankcheck |= rig.air_supply + + for(var/i=1, i bestcontents) + best = i + bestcontents = contents[i] + + + //We've determined the best container now we set it as our internals + + if(best) + C << "You are now running on internals from [tankcheck[best]] [from] your [nicename[best]]." + C.internal = tankcheck[best] + + + if(C.internal) + if(C.internals) + C.internals.icon_state = "internal1" + else + C << "You don't have a[breathes=="oxygen" ? "n oxygen" : addtext(" ",breathes)] tank." + + +/obj/screen/mov_intent + name = "run/walk toggle" + icon = 'icons/mob/screen1_midnight.dmi' + icon_state = "running" + +/obj/screen/mov_intent/Click() + if(iscarbon(usr)) + var/mob/living/carbon/C = usr + if(C.legcuffed) + C << "You are legcuffed! You cannot run until you get [C.legcuffed] removed!" + C.m_intent = "walk" //Just incase + C.hud_used.move_intent.icon_state = "walking" + return 1 + switch(usr.m_intent) + if("run") + usr.m_intent = "walk" + usr.hud_used.move_intent.icon_state = "walking" + if("walk") + usr.m_intent = "run" + usr.hud_used.move_intent.icon_state = "running" + if(istype(usr,/mob/living/carbon/alien/humanoid)) + usr.update_icons() + +/obj/screen/pull + name = "stop pulling" + icon = 'icons/mob/screen1_Midnight.dmi' + icon_state = "pull" + +/obj/screen/pull/Click() + usr.stop_pulling() + +/obj/screen/pull/update_icon(mob/mymob) + if(!mymob) return + if(mymob.pulling) + icon_state = "pull" + else + icon_state = "pull0" + +/obj/screen/resist + name = "resist" + icon = 'icons/mob/screen1_midnight.dmi' + icon_state = "act_resist" + layer = 19 + +/obj/screen/resist/Click() + if(isliving(usr)) + var/mob/living/L = usr + L.resist() + +/obj/screen/throw_catch + name = "throw/catch" + icon = 'icons/mob/screen1_midnight.dmi' + icon_state = "act_throw_off" + +/obj/screen/throw_catch/Click() + if(iscarbon(usr)) + var/mob/living/carbon/C = usr + C.toggle_throw_mode() /obj/screen/storage name = "storage" @@ -72,33 +272,6 @@ master.attackby(I, usr, params) return 1 -/obj/screen/gun - name = "gun" - icon = 'icons/mob/screen1.dmi' - master = null - dir = 2 - - /*move - name = "Allow Walking" - icon_state = "no_walk0" - screen_loc = ui_gun2 - - run - name = "Allow Running" - icon_state = "no_run0" - screen_loc = ui_gun3*/ - - item - name = "Allow Item Use" - icon_state = "no_item0" - screen_loc = ui_gun1 - - mode - name = "Toggle Gun Mode" - icon_state = "gun0" - screen_loc = ui_gun_select - //dir = 1 - /obj/screen/zone_sel name = "damage zone" icon_state = "zone_sel" @@ -170,407 +343,33 @@ overlays.Cut() overlays += image('icons/mob/zone_sel.dmi', "[selecting]") -/obj/screen/pull - name = "stop pulling" - icon = 'icons/mob/screen1_Midnight.dmi' - icon_state = "pull" +/obj/screen/gun + name = "gun" + icon = 'icons/mob/screen1.dmi' + master = null + dir = 2 -/obj/screen/pull/Click() - usr.stop_pulling() + /*move + name = "Allow Walking" + icon_state = "no_walk0" + screen_loc = ui_gun2 -/obj/screen/pull/update_icon(mob/mymob) - if(!mymob) return - if(mymob.pulling) - icon_state = "pull" - else - icon_state = "pull0" + run + name = "Allow Running" + icon_state = "no_run0" + screen_loc = ui_gun3*/ + item + name = "Allow Item Use" + icon_state = "no_item0" + screen_loc = ui_gun1 -/obj/screen/Click(location, control, params) - if(!usr) return 1 + mode + name = "Toggle Gun Mode" + icon_state = "gun0" + screen_loc = ui_gun_select + //dir = 1 - switch(name) - if("toggle") - if(usr.hud_used.inventory_shown) - usr.hud_used.inventory_shown = 0 - usr.client.screen -= usr.hud_used.other - else - usr.hud_used.inventory_shown = 1 - usr.client.screen += usr.hud_used.other - - usr.hud_used.hidden_inventory_update() - - if("equip") - if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech - return 1 - if(ishuman(usr)) - var/mob/living/carbon/human/H = usr - H.quick_equip() - - if("resist") - if(isliving(usr)) - var/mob/living/L = usr - L.resist() - - if("mov_intent") - if(iscarbon(usr)) - var/mob/living/carbon/C = usr - if(C.legcuffed) - C << "You are legcuffed! You cannot run until you get [C.legcuffed] removed!" - C.m_intent = "walk" //Just incase - C.hud_used.move_intent.icon_state = "walking" - return 1 - switch(usr.m_intent) - if("run") - usr.m_intent = "walk" - usr.hud_used.move_intent.icon_state = "walking" - if("walk") - usr.m_intent = "run" - usr.hud_used.move_intent.icon_state = "running" - if(istype(usr,/mob/living/carbon/alien/humanoid)) - usr.update_icons() - if("m_intent") - if(!usr.m_int) - switch(usr.m_intent) - if("run") - usr.m_int = "13,14" - if("walk") - usr.m_int = "14,14" - if("face") - usr.m_int = "15,14" - else - usr.m_int = null - if("walk") - usr.m_intent = "walk" - usr.m_int = "14,14" - if("face") - usr.m_intent = "face" - usr.m_int = "15,14" - if("run") - usr.m_intent = "run" - usr.m_int = "13,14" - if("Reset Machine") - usr.unset_machine() - if("internal") - if(iscarbon(usr)) - var/mob/living/carbon/C = usr - if(!C.stat && !C.stunned && !C.paralysis && !C.restrained()) - if(C.internal) - C.internal = null - C << "No longer running on internals." - if(C.internals) - C.internals.icon_state = "internal0" - else - - var/no_mask - if(!(C.wear_mask && C.wear_mask.flags & AIRTIGHT)) - if(ishuman(C)) - var/mob/living/carbon/human/H = C - if(!(H.head && H.head.flags & AIRTIGHT)) - no_mask = 1 - - if(no_mask) - C << "You are not wearing a suitable mask or helmet." - return 1 - else - var/list/nicename = null - var/list/tankcheck = null - var/breathes = "oxygen" //default, we'll check later - var/list/contents = list() - var/from = "on" - - if(ishuman(C)) - var/mob/living/carbon/human/H = C - breathes = H.species.breath_type - nicename = list ("suit", "back", "belt", "right hand", "left hand", "left pocket", "right pocket") - tankcheck = list (H.s_store, C.back, H.belt, C.r_hand, C.l_hand, H.l_store, H.r_store) - else - nicename = list("right hand", "left hand", "back") - tankcheck = list(C.r_hand, C.l_hand, C.back) - - // Rigs are a fucking pain since they keep an air tank in nullspace. - if(istype(C.back,/obj/item/weapon/rig)) - var/obj/item/weapon/rig/rig = C.back - if(rig.air_supply) - from = "in" - nicename |= "hardsuit" - tankcheck |= rig.air_supply - - for(var/i=1, i bestcontents) - best = i - bestcontents = contents[i] - - - //We've determined the best container now we set it as our internals - - if(best) - C << "You are now running on internals from [tankcheck[best]] [from] your [nicename[best]]." - C.internal = tankcheck[best] - - - if(C.internal) - if(C.internals) - C.internals.icon_state = "internal1" - else - C << "You don't have a[breathes=="oxygen" ? "n oxygen" : addtext(" ",breathes)] tank." - if("act_intent") - usr.a_intent_change("right") - if("help") - usr.a_intent = I_HELP - usr.hud_used.action_intent.icon_state = "intent_help" - if("harm") - usr.a_intent = I_HARM - usr.hud_used.action_intent.icon_state = "intent_harm" - if("grab") - usr.a_intent = I_GRAB - usr.hud_used.action_intent.icon_state = "intent_grab" - if("disarm") - usr.a_intent = I_DISARM - usr.hud_used.action_intent.icon_state = "intent_disarm" - if("throw") - if(!usr.stat && isturf(usr.loc) && !usr.restrained()) - usr:toggle_throw_mode() - if("drop") - usr.drop_item_v() - - if("module") - if(isrobot(usr)) - var/mob/living/silicon/robot/R = usr - if(R.module) - R.hud_used.toggle_show_robot_modules() - return 1 - R.pick_module() - - if("radio") - if(issilicon(usr)) - usr:radio_menu() - if("panel") - if(issilicon(usr)) - usr:installed_modules() - - if("store") - if(isrobot(usr)) - var/mob/living/silicon/robot/R = usr - R.uneq_active() - R.hud_used.update_robot_modules_display() - - if("Toggle Sensor Augmentation") - if(isrobot(usr)) - var/mob/living/silicon/robot/R = usr - R.sensor_mode() - - if("Toggle Headlamp") - if(isrobot(usr)) - var/mob/living/silicon/robot/R = usr - R.control_headlamp() - - if("module1") - if(istype(usr, /mob/living/silicon/robot)) - usr:toggle_module(1) - - if("module2") - if(istype(usr, /mob/living/silicon/robot)) - usr:toggle_module(2) - - if("module3") - if(istype(usr, /mob/living/silicon/robot)) - usr:toggle_module(3) - - /*if("Allow Walking") - if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes. - return - if(!istype(usr.equipped(),/obj/item/weapon/gun)) - usr << "You need your gun in your active hand to do that!" - return - usr.client.AllowTargetMove() - gun_click_time = world.time - - if("Disallow Walking") - if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes. - return - if(!istype(usr.equipped(),/obj/item/weapon/gun)) - usr << "You need your gun in your active hand to do that!" - return - usr.client.AllowTargetMove() - gun_click_time = world.time - - if("Allow Running") - if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes. - return - if(!istype(usr.equipped(),/obj/item/weapon/gun)) - usr << "You need your gun in your active hand to do that!" - return - usr.client.AllowTargetRun() - gun_click_time = world.time - - if("Disallow Running") - if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes. - return - if(!istype(usr.equipped(),/obj/item/weapon/gun)) - usr << "You need your gun in your active hand to do that!" - return - usr.client.AllowTargetRun() - gun_click_time = world.time*/ - - if("Allow Item Use") - if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes. - return - if(!istype(usr.get_active_hand(), /obj/item/weapon/gun)) - usr << "You need your gun in your active hand to do that!" - return - usr.client.AllowTargetClick() - gun_click_time = world.time - - - if("Disallow Item Use") - if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes. - return - if(!istype(usr.get_active_hand(), /obj/item/weapon/gun)) - usr << "You need your gun in your active hand to do that!" - return - usr.client.AllowTargetClick() - gun_click_time = world.time - - if("Toggle Gun Mode") - usr.client.ToggleGunMode() - - if("AI Core") - if(isAI(usr)) - var/mob/living/silicon/ai/AI = usr - AI.view_core() - - if("Show Camera List") - if(isAI(usr)) - var/mob/living/silicon/ai/AI = usr - var/camera = input(AI) in AI.get_camera_list() - AI.ai_camera_list(camera) - - if("Track With Camera") - if(isAI(usr)) - var/mob/living/silicon/ai/AI = usr - var/target_name = input(AI) in AI.trackable_mobs() - AI.ai_camera_track(target_name) - - if("Toggle Camera Light") - if(isAI(usr)) - var/mob/living/silicon/ai/AI = usr - AI.toggle_camera_light() - - if("Crew Monitoring") - if(isAI(usr)) - var/mob/living/silicon/ai/AI = usr - AI.subsystem_crew_monitor() - - if("Show Crew Manifest") - if(isAI(usr)) - var/mob/living/silicon/ai/AI = usr - AI.ai_roster() - - if("Show Alerts") - if(isAI(usr)) - var/mob/living/silicon/ai/AI = usr - AI.subsystem_alarm_monitor() - - if("Announcement") - if(isAI(usr)) - var/mob/living/silicon/ai/AI = usr - AI.announcement() - - if("Call Emergency Shuttle") - if(isAI(usr)) - var/mob/living/silicon/ai/AI = usr - AI.ai_call_shuttle() - - if("Law Manager") - if(isAI(usr)) - var/mob/living/silicon/ai/AI = usr - AI.subsystem_law_manager() - - if("PDA - Send Message") - if(isAI(usr)) - var/mob/living/silicon/ai/AI = usr - AI.cmd_send_pdamesg(usr) - - if("PDA - Show Message Log") - if(isAI(usr)) - var/mob/living/silicon/ai/AI = usr - AI.cmd_show_message_log(usr) - - if("Take Image") - if(isAI(usr)) - var/mob/living/silicon/ai/AI = usr - AI.aiCamera.toggle_camera_mode() - - if("View Images") - if(isAI(usr)) - var/mob/living/silicon/ai/AI = usr - AI.aiCamera.viewpictures() - - if("Set Sensor Augmentation") - if(isAI(usr)) - var/mob/living/silicon/ai/AI = usr - AI.sensor_mode() - - // Alien - if("night vision") - var/mob/living/carbon/alien/humanoid/A = usr - A.nightvisiontoggle() - - if("toggle leap") - if(istype(usr, /mob/living/carbon/alien/humanoid)) - var/mob/living/carbon/alien/humanoid/hunter/AH = usr - AH.toggle_leap() - - else - return 0 - return 1 /obj/screen/inventory/Click() // At this point in client Click() code we have passed the 1/10 sec check and little else