Files
Aurora.3/code/game/objects/items/umbrella.dm
Fluffy a3a4d46fa7 Hitby refactor (#19624)
Refactored hitby to be in line with TG's version.
Refactored item weight defines to a more clear naming scheme, also in
line with TG's version.
Refactored how the movement bumps are handled, ported signals to handle
them, in preparation for the movement update.
Fixed disposal hit bouncing the hitting atom on the wall.
Items do not push other items anymore if they are tiny.
2024-07-28 20:52:08 +00:00

66 lines
1.8 KiB
Plaintext

/obj/item/umbrella
name = "umbrella"
desc = "A perfect tool to protect you from the elements."
icon = 'icons/obj/item/umbrellas.dmi'
icon_state = "umbrella_yellow_closed"
contained_sprite = TRUE
w_class = WEIGHT_CLASS_SMALL
matter = list(MATERIAL_PLASTIC = 1000)
force = 5
sharp = TRUE
hitsound = 'sound/weapons/bladeslice.ogg'
attack_verb = list("pokes", "stabs")
/// If the umbrella is open or not.
var/is_open = FALSE
/// Colour of the umbrella. Must be one present in the dmi.
var/umbrella_color
/obj/item/umbrella/Initialize(mapload, ...)
. = ..()
if(!umbrella_color)
umbrella_color = pick("black", "red", "yellow", "green")
icon_state = "umbrella_[umbrella_color]"
item_state = icon_state + "_closed"
update_icon()
/obj/item/umbrella/attack_self(mob/user)
. = ..()
if(!user.incapacitated())
if(!is_open)
to_chat(user, SPAN_NOTICE("You unfurl \the [src]."))
item_state = "umbrella_[umbrella_color]_open"
w_class = WEIGHT_CLASS_BULKY
is_open = TRUE
force = 1
sharp = FALSE
attack_verb = list("taps")
hitsound = /singleton/sound_category/punchmiss_sound
else
to_chat(user, SPAN_NOTICE("You close up \the [src]."))
item_state = "umbrella_[umbrella_color]_closed"
w_class = initial(w_class)
is_open = FALSE
force = initial(force)
sharp = initial(sharp)
attack_verb = initial(attack_verb)
hitsound = initial(hitsound)
/obj/item/umbrella/gives_weather_protection()
return is_open ? TRUE : FALSE
/obj/item/umbrella/red
umbrella_color = "red"
icon_state = "umbrella_red_closed"
/obj/item/umbrella/black
umbrella_color = "black"
icon_state = "umbrella_black_closed"
/obj/item/umbrella/yellow
umbrella_color = "yellow"
icon_state = "umbrella_yellow_closed"
/obj/item/umbrella/green
umbrella_color = "green"
icon_state = "umbrella_green_closed"