diff --git a/code/game/objects/items/weapons/melee/misc.dm b/code/game/objects/items/weapons/melee/misc.dm index a7f6565a2d..8985f85bac 100644 --- a/code/game/objects/items/weapons/melee/misc.dm +++ b/code/game/objects/items/weapons/melee/misc.dm @@ -14,3 +14,34 @@ var/datum/gender/T = gender_datums[user.get_visible_gender()] user.visible_message(span("danger", "\The [user] [T.is] strangling [T.himself] with \the [src]! It looks like [T.he] [T.is] trying to commit suicide."), span("danger", "You start to strangle yourself with \the [src]!"), span("danger", "You hear the sound of someone choking!")) return (OXYLOSS) + +/obj/item/weapon/melee/umbrella + name = "umbrella" + desc = "To keep the rain off you. Use with caution on windy days." + icon = 'icons/obj/items.dmi' + icon_state = "umbrella_closed" + flags = CONDUCT + slot_flags = SLOT_BELT + force = 5 + throwforce = 5 + w_class = ITEMSIZE_NORMAL + var/open = FALSE + +/obj/item/weapon/melee/umbrella/New() + ..() + color = "#"+get_random_colour() + update_icon() + +/obj/item/weapon/melee/umbrella/attack_self() + src.toggle_umbrella() + +/obj/item/weapon/melee/umbrella/proc/toggle_umbrella() + open = !open + icon_state = "umbrella_[open ? "open" : "closed"]" + item_state = icon_state + update_icon() + if(ishuman(src.loc)) + var/mob/living/carbon/human/H = src.loc + H.update_inv_l_hand(0) + H.update_inv_r_hand() + ..() \ No newline at end of file diff --git a/code/modules/planet/sif.dm b/code/modules/planet/sif.dm index e50c584a13..3fb5ff2be2 100644 --- a/code/modules/planet/sif.dm +++ b/code/modules/planet/sif.dm @@ -234,6 +234,18 @@ datum/weather/sif if(!T.outdoors) continue // They're indoors, so no need to rain on them. + // If they have an open umbrella, it'll guard from rain + if(istype(L.get_active_hand(), /obj/item/weapon/melee/umbrella)) + var/obj/item/weapon/melee/umbrella/U = L.get_active_hand() + if(U.open) + to_chat(L, "Rain patters softly onto your umbrella") + continue + else if(istype(L.get_inactive_hand(), /obj/item/weapon/melee/umbrella)) + var/obj/item/weapon/melee/umbrella/U = L.get_inactive_hand() + if(U.open) + to_chat(L, "Rain patters softly onto your umbrella") + continue + L.water_act(1) to_chat(L, "Rain falls on you.") @@ -258,6 +270,20 @@ datum/weather/sif if(!T.outdoors) continue // They're indoors, so no need to rain on them. + // If they have an open umbrella, it'll get stolen by the wind + if(istype(L.get_active_hand(), /obj/item/weapon/melee/umbrella)) + var/obj/item/weapon/melee/umbrella/U = L.get_active_hand() + if(U.open) + to_chat(L, "A gust of wind yanks the umbrella from your hand!") + L.drop_from_inventory(U) + U.throw_at(get_edge_target_turf(U, pick(alldirs)), 8, 1, L) + else if(istype(L.get_inactive_hand(), /obj/item/weapon/melee/umbrella)) + var/obj/item/weapon/melee/umbrella/U = L.get_inactive_hand() + if(U.open) + to_chat(L, "A gust of wind yanks the umbrella from your hand!") + L.drop_from_inventory(U) + U.throw_at(get_edge_target_turf(U, pick(alldirs)), 8, 1, L) + L.water_act(2) to_chat(L, "Rain falls on you, drenching you in water.") @@ -282,6 +308,18 @@ datum/weather/sif if(!T.outdoors) continue // They're indoors, so no need to pelt them with ice. + // If they have an open umbrella, it'll guard from rain + if(istype(L.get_active_hand(), /obj/item/weapon/melee/umbrella)) + var/obj/item/weapon/melee/umbrella/U = L.get_active_hand() + if(U.open) + to_chat(L, "Hail patters gently onto your umbrella.") + continue + else if(istype(L.get_inactive_hand(), /obj/item/weapon/melee/umbrella)) + var/obj/item/weapon/melee/umbrella/U = L.get_inactive_hand() + if(U.open) + to_chat(L, "Hail patters gently onto your umbrella.") + continue + var/target_zone = pick(BP_ALL) var/amount_blocked = L.run_armor_check(target_zone, "melee") var/amount_soaked = L.get_armor_soak(target_zone, "melee") diff --git a/html/changelogs/Atermonera - Umbrellas.yml b/html/changelogs/Atermonera - Umbrellas.yml new file mode 100644 index 0000000000..82b22eb005 --- /dev/null +++ b/html/changelogs/Atermonera - Umbrellas.yml @@ -0,0 +1,36 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +################################# + +# Your name. +author: Atermonera + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Added umbrellas." diff --git a/icons/mob/items/lefthand_melee.dmi b/icons/mob/items/lefthand_melee.dmi index 0f08605207..9c5b5d72ee 100644 Binary files a/icons/mob/items/lefthand_melee.dmi and b/icons/mob/items/lefthand_melee.dmi differ diff --git a/icons/mob/items/righthand_melee.dmi b/icons/mob/items/righthand_melee.dmi index c1313715a6..85e99773f7 100644 Binary files a/icons/mob/items/righthand_melee.dmi and b/icons/mob/items/righthand_melee.dmi differ diff --git a/icons/obj/items.dmi b/icons/obj/items.dmi index b8dc87695a..add3c315a6 100644 Binary files a/icons/obj/items.dmi and b/icons/obj/items.dmi differ