Headtail Storage (#10640)

This commit is contained in:
Geeves
2020-12-28 13:56:04 +01:00
committed by GitHub
parent c03a09dc62
commit fb44e651bd
8 changed files with 95 additions and 0 deletions
+3
View File
@@ -22,6 +22,7 @@
var/obj/screen/movable/action_button/button = null
var/button_icon = 'icons/obj/action_buttons/actions.dmi'
var/button_icon_state = "default"
var/button_icon_color
var/background_icon_state = "bg_default"
var/mob/living/owner
@@ -146,6 +147,8 @@
img = image(owner.button_icon,src,owner.button_icon_state)
img.pixel_x = 0
img.pixel_y = 0
if(owner.button_icon_color)
img.color = owner.button_icon_color
add_overlay(img)
if(!owner.IsAvailable())
@@ -84,3 +84,16 @@
/obj/item/storage/internal/Adjacent(var/atom/neighbor)
return master_item.Adjacent(neighbor)
/obj/item/storage/internal/skrell
name = "headtail storage"
icon = 'icons/obj/action_buttons/organs.dmi'
icon_state = "skrell_headpocket"
storage_slots = 1
max_storage_space = 2
max_w_class = ITEMSIZE_SMALL
use_sound = null
/obj/item/storage/internal/skrell/Initialize()
. = ..()
name = initial(name)
@@ -405,6 +405,7 @@
dat += "<BR><A href='?src=\ref[src];item=tie'>Remove accessory</A>"
dat += "<BR><A href='?src=\ref[src];item=splints'>Remove splints</A>"
dat += "<BR><A href='?src=\ref[src];item=pockets'>Empty pockets</A>"
dat += species.get_strip_info("\ref[src]")
dat += "<BR><A href='?src=\ref[user];refresh=1'>Refresh</A>"
dat += "<BR><A href='?src=\ref[user];mach_close=mob[name]'>Close</A>"
@@ -591,6 +592,9 @@
if(href_list["item"])
handle_strip(href_list["item"],usr)
if(href_list["species"])
species.handle_strip(usr, src, href_list["species"])
if(href_list["criminal"])
if(hasHUD(usr,"security"))
@@ -633,6 +633,12 @@
/datum/species/proc/handle_despawn()
return
/datum/species/proc/handle_strip(var/mob/user, var/mob/living/carbon/human/H, var/action)
return
/datum/species/proc/get_strip_info(var/reference)
return ""
/datum/species/proc/get_pain_emote(var/mob/living/carbon/human/H, var/pain_power)
if(flags & NO_PAIN)
return
@@ -34,6 +34,20 @@
appearance_flags = HAS_HAIR_COLOR | HAS_LIPS | HAS_UNDERWEAR | HAS_SKIN_COLOR | HAS_SOCKS
flags = NO_SLIP
has_limbs = list(
BP_CHEST = list("path" = /obj/item/organ/external/chest),
BP_GROIN = list("path" = /obj/item/organ/external/groin),
BP_HEAD = list("path" = /obj/item/organ/external/head/skrell),
BP_L_ARM = list("path" = /obj/item/organ/external/arm),
BP_R_ARM = list("path" = /obj/item/organ/external/arm/right),
BP_L_LEG = list("path" = /obj/item/organ/external/leg),
BP_R_LEG = list("path" = /obj/item/organ/external/leg/right),
BP_L_HAND = list("path" = /obj/item/organ/external/hand),
BP_R_HAND = list("path" = /obj/item/organ/external/hand/right),
BP_L_FOOT = list("path" = /obj/item/organ/external/foot),
BP_R_FOOT = list("path" = /obj/item/organ/external/foot/right)
)
has_organ = list(
BP_HEART = /obj/item/organ/internal/heart/skrell,
BP_LUNGS = /obj/item/organ/internal/lungs/skrell,
@@ -71,6 +85,25 @@
/datum/species/skrell/handle_post_spawn(mob/living/carbon/human/H)
H.set_psi_rank(PSI_COERCION, PSI_RANK_OPERANT)
/datum/species/skrell/handle_strip(var/mob/user, var/mob/living/carbon/human/H, var/action)
switch(action)
if("headtail")
if(!H.head)
to_chat(user, SPAN_WARNING("\The [H] doesn't have a head!"))
return
user.visible_message(SPAN_WARNING("\The [user] is trying to remove something from \the [H]'s headtails!"))
if(do_after(usr, HUMAN_STRIP_DELAY, act_target = H))
var/obj/item/storage/internal/skrell/S = locate() in H.head
var/obj/item/I = locate() in S
if(!I)
to_chat(usr, SPAN_WARNING("\The [H] had nothing in their headtail storage."))
return
S.remove_from_storage(I, get_turf(H))
return
/datum/species/skrell/get_strip_info(var/reference)
return "<BR><A href='?src=[reference];species=headtail'>Empty Headtail Storage</A>"
/datum/species/skrell/can_breathe_water()
return TRUE
+30
View File
@@ -16,3 +16,33 @@
/obj/item/organ/internal/brain/skrell
icon_state = "brain_skrell"
/obj/item/organ/external/head/skrell
var/obj/item/storage/internal/skrell/storage
action_button_name = "Headtail Pocket"
/obj/item/organ/external/head/skrell/Initialize(mapload)
. = ..()
addtimer(CALLBACK(src, .proc/setup_storage), 3 SECONDS)
/obj/item/organ/external/head/skrell/proc/setup_storage()
storage = new /obj/item/storage/internal/skrell(src)
if(owner)
storage.color = rgb(owner.r_hair, owner.g_hair, owner.b_hair)
refresh_action_button()
/obj/item/organ/external/head/skrell/refresh_action_button()
. = ..()
if(. && storage)
action.button_icon_state = storage.icon_state
action.button_icon_color = storage.color
if(action.button)
action.button.update_icon()
/obj/item/organ/external/head/skrell/removed()
. = ..()
for(var/thing in storage)
storage.remove_from_storage(thing, get_turf(src))
/obj/item/organ/external/head/skrell/attack_self(mob/user)
storage.open(user)
@@ -0,0 +1,6 @@
author: Geeves
delete-after: True
changes:
- rscadd: "Skrell can now store a single small item in their headtails via an ability in the top left corner of their screen. It can be emptied via the strip menu, same as pockets."
Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB