diff --git a/code/datums/greyscale/json_configs/_umbrella.json b/code/datums/greyscale/json_configs/_umbrella.json new file mode 100644 index 000000000000..3e44cacc47fd --- /dev/null +++ b/code/datums/greyscale/json_configs/_umbrella.json @@ -0,0 +1,28 @@ +{ + "umbrella_on": [ + { + "type": "icon_state", + "icon_state": "umbrella_on_handle", + "blend_mode": "overlay" + }, + { + "type": "icon_state", + "icon_state": "umbrella_on", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "umbrella": [ + { + "type": "icon_state", + "icon_state": "umbrella_handle", + "blend_mode": "overlay" + }, + { + "type": "icon_state", + "icon_state": "umbrella", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ] +} diff --git a/code/datums/greyscale/json_configs/_umbrella_inhand.json b/code/datums/greyscale/json_configs/_umbrella_inhand.json new file mode 100644 index 000000000000..e98d2d5156a1 --- /dev/null +++ b/code/datums/greyscale/json_configs/_umbrella_inhand.json @@ -0,0 +1,31 @@ +{ + "umbrella_closed": [ + { + "type": "icon_state", + "icon_state": "umbrella_closed", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "umbrella_on": [ + { + "type": "icon_state", + "icon_state": "umbrella_handle", + "blend_mode": "overlay" + }, + { + "type": "icon_state", + "icon_state": "umbrella_on", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "umbrella_on_BACK": [ + { + "type": "icon_state", + "icon_state": "umbrella_on_BACK", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ] +} diff --git a/maplestation.dme b/maplestation.dme index 4c91ed5fcd3c..c2afffa8f650 100644 --- a/maplestation.dme +++ b/maplestation.dme @@ -6158,6 +6158,7 @@ #include "maplestation_modules\code\game\objects\items\plushes.dm" #include "maplestation_modules\code\game\objects\items\toys.dm" #include "maplestation_modules\code\game\objects\items\triage_card.dm" +#include "maplestation_modules\code\game\objects\items\umbrellas.dm" #include "maplestation_modules\code\game\objects\items\weaponry.dm" #include "maplestation_modules\code\game\objects\items\devices\triage_projector.dm" #include "maplestation_modules\code\game\objects\items\devices\PDA\PDA_types.dm" diff --git a/maplestation_modules/code/datums/greyscale/_greyscale_config.dm b/maplestation_modules/code/datums/greyscale/_greyscale_config.dm index d1de9c485b48..faa95c40b335 100644 --- a/maplestation_modules/code/datums/greyscale/_greyscale_config.dm +++ b/maplestation_modules/code/datums/greyscale/_greyscale_config.dm @@ -49,3 +49,18 @@ name = "Spacer's Turtleneck Worn" icon_file = 'maplestation_modules/icons/mob/clothing/under/spacer_turtleneck.dmi' json_config = 'code/datums/greyscale/json_configs/spacer_turtleneck_worn.json' + +/datum/greyscale_config/umbrella + name = "Umbrella" + icon_file = 'maplestation_modules/icons/obj/weapons/umbrellas.dmi' + json_config = 'code/datums/greyscale/json_configs/_umbrella.json' + +/datum/greyscale_config/umbrella_inhand_left + name = "Held Umbrella, Left, Closed" + icon_file = 'maplestation_modules/icons/mob/inhands/weapons/umbrellas_inhand_lh.dmi' + json_config = 'code/datums/greyscale/json_configs/_umbrella_inhand.json' + +/datum/greyscale_config/umbrella_inhand_right + name = "Held Umbrella, Right, Closed" + icon_file = 'maplestation_modules/icons/mob/inhands/weapons/umbrellas_inhand_rh.dmi' + json_config = 'code/datums/greyscale/json_configs/_umbrella_inhand.json' diff --git a/maplestation_modules/code/game/objects/items/umbrellas.dm b/maplestation_modules/code/game/objects/items/umbrellas.dm new file mode 100644 index 000000000000..485b2fb689e3 --- /dev/null +++ b/maplestation_modules/code/game/objects/items/umbrellas.dm @@ -0,0 +1,134 @@ +/* + * # Umbrellas! + * This file has code for umbrellas! + * Umbrellas you can hold, and open and close. + * Currently not coding for protecting against rain as ???I dont think??? rain exists. + * The rest don't and it just for looks. + */ +/obj/item/umbrella + name = "umbrella" + desc = "A plain umbrella." + icon = 'maplestation_modules/icons/obj/weapons/umbrellas.dmi' + icon_state = "umbrella" + inhand_icon_state = "umbrella_closed" + lefthand_file = 'maplestation_modules/icons/mob/inhands/weapons/umbrellas_inhand_lh.dmi' + righthand_file = 'maplestation_modules/icons/mob/inhands/weapons/umbrellas_inhand_rh.dmi' + force = 5 + throwforce = 5 + w_class = WEIGHT_CLASS_SMALL + custom_materials = list(/datum/material/iron= SMALL_MATERIAL_AMOUNT * 0.5) + attack_verb_continuous = list("bludgeons", "whacks", "disciplines", "pummels") + attack_verb_simple = list("bludgeon", "whack", "discipline", "pummel") + drop_sound = 'maplestation_modules/sound/items/drop/wooden.ogg' + pickup_sound = 'maplestation_modules/sound/items/pickup/wooden.ogg' + hitsound = 'sound/weapons/genhit1.ogg' + + //open umbrella offsets for the inhands + var/open_x_offset = 2 + var/open_y_offset = 2 + + //Whether it's open or not + var/open = FALSE + + /// The sound effect played when our umbrella is opened + var/on_sound = 'sound/weapons/batonextend.ogg' + /// The inhand icon state used when our umbrella is opened. + var/on_inhand_icon_state = "umbrella_on" + + //greyscale stuff + greyscale_config = /datum/greyscale_config/umbrella + greyscale_config_inhand_left = /datum/greyscale_config/umbrella_inhand_left + greyscale_config_inhand_right = /datum/greyscale_config/umbrella_inhand_right + greyscale_colors = "#dddddd" + /// If the item should be assigned a random color + var/random_color = TRUE + /// List of possible random colors + var/static/list/umbrella_colors = list( + COLOR_BLUE, + COLOR_RED, + COLOR_PINK, + COLOR_BROWN, + COLOR_GREEN, + COLOR_CYAN, + COLOR_YELLOW, + COLOR_WHITE + ) + flags_1 = IS_PLAYER_COLORABLE_1 + +/obj/item/umbrella/Initialize(mapload) + . = ..() + if(random_color) + set_greyscale(colors = list(pick(umbrella_colors))) + AddComponent( \ + /datum/component/transforming, \ + force_on = 7, \ + hitsound_on = "sound/weapons/genhit1.ogg", \ + w_class_on = WEIGHT_CLASS_BULKY, \ + clumsy_check = FALSE, \ + attack_verb_continuous_on = list("swooshes", "whacks", "fwumps"), \ + attack_verb_simple_on = list("swoosh", "whack", "fwump"), \ + ) + RegisterSignal(src, COMSIG_TRANSFORMING_ON_TRANSFORM, PROC_REF(on_transform)) + +/obj/item/umbrella/worn_overlays(mutable_appearance/standing, isinhands) + . = ..() + if(!isinhands) + return + var/mob/holder = loc + if(open) + if(ISODD(holder.get_held_index_of_item(src))) //left hand or right hand? + . += mutable_appearance(lefthand_file, inhand_icon_state + "_BACK", BELOW_MOB_LAYER) + else + . += mutable_appearance(righthand_file, inhand_icon_state + "_BACK", BELOW_MOB_LAYER) + + +/obj/item/umbrella/proc/on_transform(obj/item/source, mob/user, active) + SIGNAL_HANDLER + inhand_icon_state = active ? on_inhand_icon_state : inhand_icon_state + open = active + if(user) + balloon_alert(user, active ? "opened" : "closed") + playsound(src, on_sound, 50, TRUE) + return COMPONENT_NO_DEFAULT_MESSAGE + +/obj/item/umbrella/pickup(mob/user) + . = ..() + RegisterSignal(user, COMSIG_ATOM_DIR_CHANGE, PROC_REF(on_dir_change)) + +/obj/item/umbrella/dropped(mob/user, silent) + . = ..() + UnregisterSignal(user, COMSIG_ATOM_DIR_CHANGE) + +/obj/item/umbrella/proc/on_dir_change(mob/living/carbon/owner, olddir, newdir) + SIGNAL_HANDLER + owner.update_held_items() + +/obj/item/umbrella/get_worn_offsets(isinhands) + . = ..() + var/mob/holder = loc + if(open) + .[2] += open_y_offset + switch(loc.dir) + if(NORTH) + .[1] += ISODD(holder.get_held_index_of_item(src)) ? -open_x_offset : open_x_offset + if(SOUTH) + .[1] += ISODD(holder.get_held_index_of_item(src)) ? open_x_offset : -open_x_offset + if(EAST) + .[1] -= open_x_offset + if(WEST) + .[1] += open_x_offset + + + +//other umbrellas + +/obj/item/umbrella/parasol + name = "parasol" + desc = "A black laced parsol, how intricate." + icon_state = "parasol" + inhand_icon_state = "parasol_closed" + on_inhand_icon_state = "parasol_on" + random_color = FALSE + greyscale_config = null + greyscale_config_inhand_left = null + greyscale_config_inhand_right = null diff --git a/maplestation_modules/code/modules/loadouts/loadout_items/loadout_datum_pocket.dm b/maplestation_modules/code/modules/loadouts/loadout_items/loadout_datum_pocket.dm index 71e62bfa548f..6542c88842eb 100644 --- a/maplestation_modules/code/modules/loadouts/loadout_items/loadout_datum_pocket.dm +++ b/maplestation_modules/code/modules/loadouts/loadout_items/loadout_datum_pocket.dm @@ -311,3 +311,16 @@ /datum/loadout_item/pocket_items/cybernetics_paintkit name = "Cybernetics Paint Kit" item_path = /obj/item/cybernetics_paintkit + +/datum/loadout_item/pocket_items/umbrella + name = "Umbrella" + item_path = /obj/item/umbrella + +/datum/loadout_item/pocket_items/black_parasol + name = "Umbrella (Black Parasol)" + item_path = /obj/item/umbrella/parasol + +/datum/loadout_item/pocket_items/rad_umbrella + name = "Umbrella (Radiation Shielded)" + item_path = /obj/item/umbrella/volkan + additional_displayed_text = list("Character Item") diff --git a/maplestation_modules/icons/mob/inhands/weapons/umbrellas_inhand_lh.dmi b/maplestation_modules/icons/mob/inhands/weapons/umbrellas_inhand_lh.dmi new file mode 100644 index 000000000000..bc7f1d611aa8 Binary files /dev/null and b/maplestation_modules/icons/mob/inhands/weapons/umbrellas_inhand_lh.dmi differ diff --git a/maplestation_modules/icons/mob/inhands/weapons/umbrellas_inhand_rh.dmi b/maplestation_modules/icons/mob/inhands/weapons/umbrellas_inhand_rh.dmi new file mode 100644 index 000000000000..68b961148110 Binary files /dev/null and b/maplestation_modules/icons/mob/inhands/weapons/umbrellas_inhand_rh.dmi differ diff --git a/maplestation_modules/icons/obj/weapons/umbrellas.dmi b/maplestation_modules/icons/obj/weapons/umbrellas.dmi new file mode 100644 index 000000000000..7f0b71fdf54b Binary files /dev/null and b/maplestation_modules/icons/obj/weapons/umbrellas.dmi differ diff --git a/maplestation_modules/story_content/volkan_equipment/code/volkanitems.dm b/maplestation_modules/story_content/volkan_equipment/code/volkanitems.dm index 5620e70e0337..685f0bbccdcd 100644 --- a/maplestation_modules/story_content/volkan_equipment/code/volkanitems.dm +++ b/maplestation_modules/story_content/volkan_equipment/code/volkanitems.dm @@ -112,6 +112,40 @@ w_class = WEIGHT_CLASS_TINY +///Volkan's umbrella. Stops radiation. +/obj/item/umbrella/volkan + name = "Volkan's umbrella" + desc = "A very thick, almost metallic umbrella. It has a dark black plasticky rim on the edge." + icon = 'maplestation_modules/story_content/volkan_equipment/icons/umbrellas.dmi' + icon_state = "umbrella_volkan" + inhand_icon_state = "umbrella_volkan_closed" + lefthand_file = 'maplestation_modules/story_content/volkan_equipment/icons/umbrellas_inhand_lh.dmi' + righthand_file = 'maplestation_modules/story_content/volkan_equipment/icons/umbrellas_inhand_rh.dmi' + + on_inhand_icon_state = "umbrella_volkan_open" + + random_color = FALSE + greyscale_config = null + greyscale_config_inhand_left = null + greyscale_config_inhand_right = null + +/obj/item/umbrella/volkan/on_transform(obj/item/source, mob/user, active) + . = ..() + if(user) + if(active) + ADD_TRAIT(user, TRAIT_RADIMMUNE, TRAIT_GENERIC) + else + REMOVE_TRAIT(user, TRAIT_RADIMMUNE, TRAIT_GENERIC) + +/obj/item/umbrella/volkan/pickup(mob/user) + . = ..() + if (open) + ADD_TRAIT(user, TRAIT_RADIMMUNE, TRAIT_GENERIC) + +/obj/item/umbrella/volkan/dropped(mob/user, silent) + . = ..() + REMOVE_TRAIT(user, TRAIT_RADIMMUNE, TRAIT_GENERIC) + //---------------------cool boxes!----------------------- diff --git a/maplestation_modules/story_content/volkan_equipment/icons/umbrellas.dmi b/maplestation_modules/story_content/volkan_equipment/icons/umbrellas.dmi new file mode 100644 index 000000000000..d3a1ef091719 Binary files /dev/null and b/maplestation_modules/story_content/volkan_equipment/icons/umbrellas.dmi differ diff --git a/maplestation_modules/story_content/volkan_equipment/icons/umbrellas_inhand_lh.dmi b/maplestation_modules/story_content/volkan_equipment/icons/umbrellas_inhand_lh.dmi new file mode 100644 index 000000000000..9afeb2b63bfc Binary files /dev/null and b/maplestation_modules/story_content/volkan_equipment/icons/umbrellas_inhand_lh.dmi differ diff --git a/maplestation_modules/story_content/volkan_equipment/icons/umbrellas_inhand_rh.dmi b/maplestation_modules/story_content/volkan_equipment/icons/umbrellas_inhand_rh.dmi new file mode 100644 index 000000000000..928de5a5d78f Binary files /dev/null and b/maplestation_modules/story_content/volkan_equipment/icons/umbrellas_inhand_rh.dmi differ