Fixes pickup animation layering and colored chairs (#14453)

This commit is contained in:
Wowzewow (Wezzy)
2022-07-20 22:44:04 +02:00
committed by GitHub
parent 43666a54c8
commit ba3edef820
8 changed files with 62 additions and 16 deletions
+7
View File
@@ -65,6 +65,7 @@
//var/item_state = null // Used to specify the item state for the on-mob overlays.
var/item_state_slots //overrides the default item_state for particular slots.
var/base_icon // used in furniture for previews. used in material weapons too.
var/build_from_parts = FALSE // when it uses coloration and a part of it wants to remain uncolored. e.g., handle of the screwdriver is colored while the head is not.
var/worn_overlay = null // used similarly as above, except for inhands.
var/worn_overlay_color = null // When you want your worn overlay to have colors. So you can have more than one modular coloring.
@@ -1039,3 +1040,9 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
/obj/item/proc/can_swap_hands(var/mob/user)
return TRUE
/obj/item/do_pickup_animation(atom/target, var/image/pickup_animation = image(icon, loc, icon_state, ABOVE_ALL_MOB_LAYER, dir, pixel_x, pixel_y))
if(!isturf(loc))
return
pickup_animation.overlays = overlays
. = ..()
+1 -1
View File
@@ -7,7 +7,7 @@
attack_verb = list("diced")
max_amount = 6
var/base_icon = "d6"
base_icon = "d6"
var/side_mult = 1 // Used for d100s.
var/sides = 6
var/weight_roll = 0 // chance of the dice falling on its favored number
@@ -23,7 +23,6 @@
var/force_unwielded
var/wield_sound = /decl/sound_category/generic_wield_sound
var/unwield_sound = null
var/base_icon
var/base_name
var/unwielded_force_divisor = 0.25
var/parry_chance = 15
@@ -346,7 +346,7 @@
item_state = "rollerbed"
anchored = FALSE
makes_rolling_sound = TRUE
var/base_state = "standard"
base_icon = "standard"
held_item = /obj/item/roller
var/obj/item/reagent_containers/beaker
var/obj/item/vitals_monitor/vitals
@@ -368,9 +368,9 @@
cut_overlays()
vis_contents = list()
if(density)
icon_state = "[base_state]_up"
icon_state = "[base_icon]_up"
else
icon_state = "[base_state]_down"
icon_state = "[base_icon]_down"
if(beaker)
var/image/iv = image(icon, "iv[iv_attached]")
var/percentage = round((beaker.reagents.total_volume / beaker.volume) * 100, 25)
@@ -518,7 +518,7 @@
/obj/structure/bed/roller/hover
name = "medical hoverbed"
icon_state = "hover_down"
base_state = "hover"
base_icon = "hover"
makes_rolling_sound = FALSE
held_item = /obj/item/roller/hover
patient_shift = 6
@@ -20,7 +20,7 @@
if(!held_item || use_check_and_message(usr) || buckled || (anchored && padding_material)) // Make sure held_item = null if you don't want it to get picked up.
return
usr.visible_message(SPAN_NOTICE("[usr] [withdraw_verb]s \the [src.name]."), SPAN_NOTICE("You [withdraw_verb] \the [src.name]."))
var/obj/item/material/stool/S = new held_item(src.loc, material.name, padding_material ? padding_material.name : null) // Handles all the material code so you don't have to.
var/obj/item/material/stool/S = new held_item(src.loc, material.name, padding_material ? padding_material.name : null, painted_colour) // Handles all the material code so you don't have to.
TransferComponents(S)
if(material_alteration & MATERIAL_ALTERATION_COLOR) // For snowflakes like wood chairs.
S.color = material.icon_colour
@@ -28,8 +28,6 @@
S.name = name // Get the name and desc of the stool, rather. We already went through all the trouble in New in bed.dm
if(material_alteration & MATERIAL_ALTERATION_DESC)
S.desc = desc
if(painted_colour)
S.painted_colour = painted_colour
if(blood_DNA)
S.blood_DNA |= blood_DNA // Transfer blood, if any.
S.add_blood()
@@ -163,7 +161,7 @@
)
icon_state = "stool_item_preview"
item_state = "stool"
var/base_icon = "stool"
base_icon = "stool"
desc_info = "Use in-hand or alt-click to right this."
randpixel = 0
center_of_mass = null
@@ -178,10 +176,12 @@
var/deploy_verb = "right"
var/painted_colour
/obj/item/material/stool/New(var/newloc, var/new_material, var/new_padding_material)
/obj/item/material/stool/New(var/newloc, var/new_material, var/new_padding_material, var/new_painted_colour)
..(newloc, new_material) // new_material handled in material_weapons.dm
if(new_padding_material)
padding_material = SSmaterials.get_material_by_name(new_padding_material)
if(new_painted_colour)
painted_colour = new_painted_colour
update_icon()
/obj/item/material/stool/attack_self(mob/user)
@@ -240,12 +240,12 @@
user.visible_message(SPAN_NOTICE("[user] [deploy_verb]s \the [src.name]."), SPAN_NOTICE("You [deploy_verb] \the [name]."))
// playsound(src, deploy_sound ? deploy_sound : drop_sound, DROP_SOUND_VOLUME)
user.drop_from_inventory(src)
var/obj/structure/bed/stool/S = new origin_type(get_turf(loc), material.name, padding_material ? padding_material.name : null) // Fuck me.
S.update_icon()
var/obj/structure/bed/stool/S = new origin_type(get_turf(loc), material.name, padding_material ? padding_material.name : null, painted_colour) // Fuck me.
TransferComponents(S)
S.dir = user.dir // Plant it where the user's facing
if(blood_DNA)
S.blood_DNA |= blood_DNA // Transfer blood.
S.update_icon()
qdel(src)
/obj/item/material/stool/update_icon()