Merge pull request #3524 from Neerti/6/11/2017_examine_panel_update

Makes Examine Panel slightly more useful.
This commit is contained in:
Anewbe
2017-06-14 16:04:18 -05:00
committed by GitHub
6 changed files with 123 additions and 8 deletions
+4 -1
View File
@@ -753,6 +753,9 @@ About the new airlock wires panel:
update_icon()
return 1
/obj/machinery/door/airlock/proc/can_remove_electronics()
return src.p_open && (operating < 0 || (!operating && welded && !src.arePowerSystemsOn() && density && (!src.locked || (stat & BROKEN))))
/obj/machinery/door/airlock/attackby(C as obj, mob/user as mob)
//world << text("airlock attackby src [] obj [] mob []", src, C, user)
if(!istype(usr, /mob/living/silicon))
@@ -797,7 +800,7 @@ About the new airlock wires panel:
var/obj/item/weapon/pai_cable/cable = C
cable.plugin(src, user)
else if(!repairing && istype(C, /obj/item/weapon/crowbar))
if(src.p_open && (operating < 0 || (!operating && welded && !src.arePowerSystemsOn() && density && (!src.locked || (stat & BROKEN)))) )
if(can_remove_electronics())
playsound(src.loc, 'sound/items/Crowbar.ogg', 75, 1)
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to remove electronics from the airlock assembly.")
if(do_after(user,40))
@@ -190,6 +190,7 @@
else
user << "<span class='notice'>You need more welding fuel to complete this task.</span>"
return
user.update_examine_panel(src)
return
// Basic dismantling.
@@ -243,6 +244,7 @@
if (istype(W, /obj/item/weapon/wirecutters))
playsound(src, 'sound/items/Wirecutter.ogg', 100, 1)
construction_stage = 5
user.update_examine_panel(src)
user << "<span class='notice'>You cut through the outer grille.</span>"
update_icon()
return
@@ -253,11 +255,13 @@
if(!do_after(user,40) || !istype(src, /turf/simulated/wall) || construction_stage != 5)
return
construction_stage = 4
user.update_examine_panel(src)
update_icon()
user << "<span class='notice'>You unscrew the support lines.</span>"
return
else if (istype(W, /obj/item/weapon/wirecutters))
construction_stage = 6
user.update_examine_panel(src)
user << "<span class='notice'>You mend the outer grille.</span>"
update_icon()
return
@@ -280,6 +284,7 @@
if(!do_after(user, 60) || !istype(src, /turf/simulated/wall) || construction_stage != 4)
return
construction_stage = 3
user.update_examine_panel(src)
update_icon()
user << "<span class='notice'>You press firmly on the cover, dislodging it.</span>"
return
@@ -289,6 +294,7 @@
if(!do_after(user,40) || !istype(src, /turf/simulated/wall) || construction_stage != 4)
return
construction_stage = 5
user.update_examine_panel(src)
update_icon()
user << "<span class='notice'>You screw down the support lines.</span>"
return
@@ -299,6 +305,7 @@
if(!do_after(user,100) || !istype(src, /turf/simulated/wall) || construction_stage != 3)
return
construction_stage = 2
user.update_examine_panel(src)
update_icon()
user << "<span class='notice'>You pry off the cover.</span>"
return
@@ -309,6 +316,7 @@
if(!do_after(user,40) || !istype(src, /turf/simulated/wall) || construction_stage != 2)
return
construction_stage = 1
user.update_examine_panel(src)
update_icon()
user << "<span class='notice'>You remove the bolts anchoring the support rods.</span>"
return
@@ -329,6 +337,7 @@
if(!do_after(user,70) || !istype(src, /turf/simulated/wall) || construction_stage != 1)
return
construction_stage = 0
user.update_examine_panel(src)
update_icon()
user << "<span class='notice'>The slice through the support rods.</span>"
return
@@ -25,11 +25,54 @@
Wires can be pulsed remotely with a signaler attached to it. A powersink will also drain any APCs connected to the same wire the powersink is on."
/obj/item/inflatable
description_info = "Inflate by using it in your hand. The inflatable barrier will inflate on your tile. To deflate it, use the 'deflate' verb."
description_info = "Inflate by using it in your hand. The inflatable barrier will inflate on your tile. To deflate it, use the 'deflate' verb. \
You can also inflate this on an adjacent tile by clicking the tile."
/obj/structure/inflatable
description_info = "To remove these safely, use the 'deflate' verb. Hitting these with any objects will probably puncture and break it forever."
description_info = "To remove these safely, use the 'deflate' verb, or alt-click on it. Hitting these with any objects will probably puncture and break it forever."
/obj/structure/inflatable/door
description_info = "Click the door to open or close it. It only stops air while closed.<br>\
To remove these safely, use the 'deflate' verb. Hitting these with any objects will probably puncture and break it forever."
/obj/machinery/door/get_description_interaction()
var/list/results = list()
if(!repairing && (health < maxhealth) && !(stat & BROKEN))
results += "[desc_panel_image("metal sheet")]to start repairing damage (May require different material type)."
if(repairing && density)
results += "[desc_panel_image("welder")]to finish repairs."
results += "[desc_panel_image("crowbar")]to undo adding sheets for repairs."
return results
/obj/machinery/door/airlock/get_description_interaction()
var/list/results = list()
if(can_remove_electronics())
results += "[desc_panel_image("crowbar")]to remove the airlock electronics."
else
results += "[desc_panel_image("crowbar")]to open or close if unpowered/broken, and unbolted."
if(welded)
results += "[desc_panel_image("welder")]to unweld, allowing it to open again."
else
results += "[desc_panel_image("welder")]to weld, preventing it from opening."
if(p_open)
results += "[desc_panel_image("screwdriver")]to close the wire panel."
results += "[desc_panel_image("wirecutters")]to cut an internal wire while hacking."
results += "[desc_panel_image("multitool")]to pulse an internal wire while hacking."
else
results += "[desc_panel_image("screwdriver")]to open the wire panel, enabling the ability to hack."
results += ..()
return results
/obj/machinery/portable_atmospherics/canister/get_description_interaction()
var/list/results = list()
results += "[desc_panel_image("wrench")]to connect or disconnect from a connector port below."
results += "[desc_panel_image("air tank")]to fill the air tank from this canister."
return results
+32 -2
View File
@@ -1,3 +1,33 @@
/turf/simulated/wall
description_info = "You can deconstruct this by welding it, and then wrenching the girder.<br>\
You can build a wall by using metal sheets and making a girder, then adding more metal or plasteel."
description_info = "You can build a wall by using metal sheets and making a girder, then adding more metal or plasteel."
/turf/simulated/wall/get_description_interaction()
var/list/results = list()
if(damage)
results += "[desc_panel_image("welder")]to repair."
if(isnull(construction_stage) || !reinf_material)
results += "[desc_panel_image("welder")]to deconstruct if undamaged."
else
switch(construction_stage)
if(6)
results += "[desc_panel_image("wirecutters")]to begin deconstruction."
if(5)
results += list(
"[desc_panel_image("screwdriver")]to continue deconstruction.",
"[desc_panel_image("wirecutters")]to reverse deconstruction."
)
if(4)
results += list(
"[desc_panel_image("welder")]to continue deconstruction.",
"[desc_panel_image("screwdriver")]to reverse deconstruction."
)
if(3)
results += "[desc_panel_image("crowbar")]to continue deconstruction."
if(2)
results += "[desc_panel_image("wrench")]to continue deconstruction."
if(1)
results += "[desc_panel_image("welder")]to continue deconstruction."
if(0)
results += "[desc_panel_image("crowbar")]to finish deconstruction."
return results
+17 -1
View File
@@ -5,6 +5,7 @@
This means that this file can be unchecked, along with the other examine files, and can be removed entirely with no effort.
*/
#define EXAMINE_PANEL_PADDING " "
/atom/
var/description_info = null //Helpful blue text.
@@ -27,6 +28,14 @@
return description_antag
return
// This one is slightly different, in that it must return a list.
/atom/proc/get_description_interaction()
return list()
// Quickly adds the boilerplate code to add an image and padding for the image.
/proc/desc_panel_image(var/icon_state)
return "\icon[description_icons[icon_state]][EXAMINE_PANEL_PADDING]"
/mob/living/get_description_fluff()
if(flavor_text) //Get flavor text for the green text.
return flavor_text
@@ -44,6 +53,7 @@
description_holders["info"] = A.get_description_info()
description_holders["fluff"] = A.get_description_fluff()
description_holders["antag"] = (update_antag_info)? A.get_description_antag() : ""
description_holders["interactions"] = A.get_description_interaction()
description_holders["name"] = "[A.name]"
description_holders["icon"] = "\icon[A]"
@@ -57,6 +67,9 @@
stat(null,"[description_holders["desc"]]") //the default examine text.
if(description_holders["info"])
stat(null,"<font color='#084B8A'><b>[description_holders["info"]]</b></font>") //Blue, informative text.
if(description_holders["interactions"])
for(var/line in description_holders["interactions"])
stat(null, "<font color='#084B8A'><b>[line]</b></font>")
if(description_holders["fluff"])
stat(null,"<font color='#298A08'><b>[description_holders["fluff"]]</b></font>") //Yellow, fluff-related text.
if(description_holders["antag"])
@@ -67,6 +80,9 @@
if(..())
return 1
var/is_antag = ((mind && mind.special_role) || isobserver(src)) //ghosts don't have minds
update_examine_panel(A)
/mob/proc/update_examine_panel(var/atom/A)
if(client)
var/is_antag = ((mind && mind.special_role) || isobserver(src)) //ghosts don't have minds
client.update_description_holders(A, is_antag)
+16 -2
View File
@@ -6,5 +6,19 @@ var/global/list/description_icons = list(
"energy_armor" = image(icon='icons/mob/screen1_stats.dmi',icon_state="energy_protection"),
"bomb_armor" = image(icon='icons/mob/screen1_stats.dmi',icon_state="bomb_protection"),
"radiation_armor" = image(icon='icons/mob/screen1_stats.dmi',icon_state="radiation_protection"),
"biohazard_armor" = image(icon='icons/mob/screen1_stats.dmi',icon_state="biohazard_protection")
)
"biohazard_armor" = image(icon='icons/mob/screen1_stats.dmi',icon_state="biohazard_protection"),
"welder" = image(icon='icons/obj/items.dmi',icon_state="welder"),
"wirecutters" = image(icon='icons/obj/items.dmi',icon_state="cutters"),
"screwdriver" = image(icon='icons/obj/items.dmi',icon_state="screwdriver"),
"wrench" = image(icon='icons/obj/items.dmi',icon_state="wrench"),
"crowbar" = image(icon='icons/obj/items.dmi',icon_state="crowbar"),
"multitool" = image(icon='icons/obj/device.dmi',icon_state="multitool"),
"metal sheet" = image(icon='icons/obj/items.dmi',icon_state="sheet-metal"),
"plasteel sheet" = image(icon='icons/obj/items.dmi',icon_state="sheet-plasteel"),
"air tank" = image(icon='icons/obj/tank.dmi',icon_state="oxygen"),
"connector" = image(icon='icons/obj/pipes.dmi',icon_state="connector")
)