mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 19:17:50 +01:00
Adds CI for checking if a variable exists (#31855)
* i leave for one month smh * feature compatibility * fixed
This commit is contained in:
@@ -718,6 +718,9 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons
|
||||
else
|
||||
return
|
||||
|
||||
/obj/item/proc/should_play_hitsound(damage)
|
||||
return damage > 0
|
||||
|
||||
/obj/item/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
|
||||
if(hit_atom && !QDELETED(hit_atom))
|
||||
SEND_SIGNAL(src, COMSIG_MOVABLE_IMPACT, hit_atom, throwingdatum)
|
||||
@@ -729,7 +732,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons
|
||||
var/mob/living/L = hit_atom
|
||||
L.IgniteMob()
|
||||
var/volume = get_volume_by_throwforce_and_or_w_class()
|
||||
if(throwforce > 0 || ("zero_damage_hitsound" in vars))
|
||||
if(should_play_hitsound(throwforce))
|
||||
if(mob_throw_hit_sound)
|
||||
SSthrowing.playsound_capped(hit_atom, mob_throw_hit_sound, volume, TRUE, -1)
|
||||
else if(hitsound)
|
||||
|
||||
@@ -48,32 +48,18 @@
|
||||
|
||||
/// Because of jumpsuit palettes, we have to do some extra icon shenanigans.
|
||||
/obj/item/clothing/under/dye_item(dye_color, dye_key_override)
|
||||
if(!dyeable || !dye_color)
|
||||
return
|
||||
var/dye_key_selector = dye_key_override ? dye_key_override : dyeing_key
|
||||
var/obj/item/clothing/under/target_type = GLOB.dye_registry[dye_key_selector][dye_color]
|
||||
. = ..()
|
||||
|
||||
// If we're dying it to a colored jumpsuit...
|
||||
if(target_type in typesof(/obj/item/clothing/under/color))
|
||||
var/obj/item/clothing/under/color/target_obj = new target_type(null)
|
||||
set_icon_from_cache(palette_key = target_obj.icon_palette_key, dye_key = target_obj.dyeing_key)
|
||||
// update the name/description
|
||||
name = initial(target_obj.name)
|
||||
desc = target_obj.desc + "\nThe colors look a little dodgy."
|
||||
qdel(target_obj)
|
||||
if(ispath(., /obj/item/clothing/under/color))
|
||||
var/obj/item/clothing/under/color/target_type = .
|
||||
set_icon_from_cache(palette_key = target_type.icon_palette_key, dye_key = target_type.dyeing_key)
|
||||
|
||||
// If it also started as a colored jumpsuit, change the palette key
|
||||
if("icon_palette_key" in vars)
|
||||
var/obj/item/clothing/under/color/dyed_item = src
|
||||
dyed_item.icon_palette_key = dye_color
|
||||
return
|
||||
|
||||
// If we're not, but it started as a colored jumpsuit, unset the palette key so icon updates don't mess it up
|
||||
else if("icon_palette_key" in vars)
|
||||
var/obj/item/clothing/under/color/dyed_item = src
|
||||
dyed_item.icon_palette_key = null
|
||||
|
||||
return ..()
|
||||
/obj/item/clothing/under/color/dye_item(dye_color, dye_key_override)
|
||||
icon_palette_key = null
|
||||
. = ..()
|
||||
if(ispath(., /obj/item/clothing/under/color))
|
||||
icon_palette_key = dye_color
|
||||
|
||||
/// Beanies use the color var for their appearance, we don't normally copy this over but we have to for beanies
|
||||
/obj/item/clothing/head/beanie/dye_item(dye_color, dye_key_override)
|
||||
|
||||
@@ -2123,8 +2123,6 @@
|
||||
icon_state = "pool_noodle"
|
||||
attack_verb = list("bopped", "splatted", "smacked", "thwapped", "slapped")
|
||||
hitsound = 'sound/items/pool_noodle_hit.ogg'
|
||||
// Having this var at all should play hitsound even if damage is zero
|
||||
var/zero_damage_hitsound = TRUE
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
|
||||
/obj/item/toy/pool_noodle/Initialize(mapload)
|
||||
@@ -2134,6 +2132,9 @@
|
||||
desc = "A damp, flexible tube for unrestrained summer fun."
|
||||
return ..()
|
||||
|
||||
/obj/item/toy/pool_noodle/should_play_hitsound(damage)
|
||||
return TRUE
|
||||
|
||||
/obj/item/toy/pool_noodle/pink
|
||||
color = COLOR_PINK
|
||||
|
||||
|
||||
Reference in New Issue
Block a user