From 821830697ee0aa83bda85572badbc5ebea079c17 Mon Sep 17 00:00:00 2001 From: Constellado <64122807+Constellado@users.noreply.github.com> Date: Mon, 2 Sep 2024 11:01:57 +1200 Subject: [PATCH] Adds sunscreen (#570) --- maplestation.dme | 1 + .../volkan_equipment/code/sunitems.dm | 119 ++++++++++++++++++ .../volkan_equipment/code/volkanitems.dm | 2 +- .../volkan_equipment/icons/sun_items.dmi | Bin 0 -> 563 bytes 4 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 maplestation_modules/story_content/volkan_equipment/code/sunitems.dm create mode 100644 maplestation_modules/story_content/volkan_equipment/icons/sun_items.dmi diff --git a/maplestation.dme b/maplestation.dme index 36244f389222..6da5c38f1730 100644 --- a/maplestation.dme +++ b/maplestation.dme @@ -6530,6 +6530,7 @@ #include "maplestation_modules\story_content\shiro_equipment\code\shiroclothing.dm" #include "maplestation_modules\story_content\story_posters\code\contraband.dm" #include "maplestation_modules\story_content\stranger_equipment\code\strangerclothing.dm" +#include "maplestation_modules\story_content\volkan_equipment\code\sunitems.dm" #include "maplestation_modules\story_content\volkan_equipment\code\volkanitems.dm" #include "maplestation_modules\story_content\volkan_equipment\code\volkanpets.dm" #include "maplestation_modules\story_content\volkan_equipment\code\volkanpets_ai.dm" diff --git a/maplestation_modules/story_content/volkan_equipment/code/sunitems.dm b/maplestation_modules/story_content/volkan_equipment/code/sunitems.dm new file mode 100644 index 000000000000..cf03417c4e1c --- /dev/null +++ b/maplestation_modules/story_content/volkan_equipment/code/sunitems.dm @@ -0,0 +1,119 @@ +/* + * # Stuff for the beach! + * Volkan has 0 pigment, so the sun damages him a lot IC. + * His synth avatar also has this flaw, mainly due to the type of synthflesh used. He made it too damn realistic. + * As a result, have items that help with dealing with the sun! + */ + +///Sunscreen! +/obj/item/sunscreen + name = "generic sunscreen" + desc = "A generic sunscreen product. Cream based application." + w_class = WEIGHT_CLASS_TINY + icon = 'maplestation_modules/story_content/volkan_equipment/icons/sun_items.dmi' + icon_state = "sunscreen_generic" + + ///how long it takes to apply in seconds + var/application_time = 10 SECONDS + ///How long it takes before sunscreen runs out in seconds + var/reaplication_time = 1800 SECONDS + ///The sunscreen's burn modifier. + var/burn_modifier = 0.03 + +/obj/item/sunscreen/shitty + name = "cheap generic sunscreen" + desc = "A budget generic sunscreen product. Cream based application." + + reaplication_time = 60 SECONDS + burn_modifier = 0.02 + +/obj/item/sunscreen/nanotrasen + name = "Nanotrasen sunscreen" + desc = "A Nanotrasen sunscreen product. Cream based application." + icon_state = "sunscreen_nanotrasen" + + application_time = 5 SECONDS + burn_modifier = 0.05 + +///HaSE has developed a pretty good sunscreen. It doesn't smell too great though. +/obj/item/sunscreen/volkan + name = "strange sunscreen" + desc = "A sunscreen product in a metal container. It seems to be a spray based application. Smells like industrial chemicals when sprayed." + icon_state = "sunscreen_volkan" + + application_time = 1 SECONDS + reaplication_time = 900 SECONDS//spray based doesn't last as long, plus it's funny to have volkan be applying sunscreen all the time. + burn_modifier = 0.1 + +/obj/item/sunscreen/attack_self(mob/user) + if(ishuman(user) && user.is_holding(src)) + apply(user, user) + +/obj/item/sunscreen/examine() + . = ..() + . += span_info("It's labeled SPF [burn_modifier * 1000]. Reapply in [reaplication_time / 600] minutes.") + +/obj/item/sunscreen/interact_with_atom(atom/target, mob/living/user) + if(!ishuman(target)) + return NONE + apply(target, user) + return ITEM_INTERACT_SUCCESS + +/** + * Applies sunscreen to a mob. + * + * Arguments: + * * target - The mob who we will apply the sunscreen to. + * * user - the mob that is applying the sunscreen. + */ +/obj/item/sunscreen/proc/apply(mob/living/carbon/target, mob/user) + if(!ishuman(target)) + return + + if(target == user) + user.visible_message( + span_notice("[user] starts to apply [src] on [user.p_them()]self..."), + span_notice("You begin applying [src] on yourself...") + ) + else + user.visible_message( + span_notice("[user] starts to apply [src] on [target]."), + span_notice("You begin applying [src] on [target]...") + ) + + if(do_after(user, application_time, target)) + target.apply_status_effect(/datum/status_effect/sunscreen, reaplication_time, burn_modifier) + + target.visible_message(span_warning("[target] has applied sunscreen!"), + span_notice("You are covered in sunscreen!")) + +//sunscreen status effect +/atom/movable/screen/alert/status_effect/sunscreen + name = "Sunscreen" + desc = "You are covered in sunscreen!" + icon = 'maplestation_modules/story_content/volkan_equipment/icons/sun_items.dmi' + icon_state = "sunscreen_generic" + +/datum/status_effect/sunscreen + id = "sunscreen" + duration = 1800 SECONDS + alert_type = /atom/movable/screen/alert/status_effect/sunscreen + var/burn_modifier = 0.03 + +/datum/status_effect/sunscreen/on_creation(mob/living/new_owner, duration, burn_modifier) + src.duration = duration + src.burn_modifier = burn_modifier + return ..() + +/datum/status_effect/sunscreen/on_apply() + if(ishuman(owner)) + var/mob/living/carbon/human/applying_to = owner + applying_to.physiology.burn_mod -= burn_modifier + return ..() + +///Stuff that happens when the sunscreen runs out. +/datum/status_effect/sunscreen/on_remove() + if(ishuman(owner)) + var/mob/living/carbon/human/H = owner + H.physiology.burn_mod += burn_modifier + to_chat(owner, span_notice("You no longer feel protected by your sunscreen.")) diff --git a/maplestation_modules/story_content/volkan_equipment/code/volkanitems.dm b/maplestation_modules/story_content/volkan_equipment/code/volkanitems.dm index e50046a899ca..5620e70e0337 100644 --- a/maplestation_modules/story_content/volkan_equipment/code/volkanitems.dm +++ b/maplestation_modules/story_content/volkan_equipment/code/volkanitems.dm @@ -72,7 +72,7 @@ /// the typepath of mob mob that it will turn into var/mobtype /// the sound the mob will make when it turns on (is created). - var/startup = 'maplestation_modules/story_content/volkan_equipment/audio/bot_startup.ogg' + var/startup = 'maplestation_modules/story_content/volkan_equipment/audio/bot_startup.ogg' w_class = WEIGHT_CLASS_NORMAL //activate bot action diff --git a/maplestation_modules/story_content/volkan_equipment/icons/sun_items.dmi b/maplestation_modules/story_content/volkan_equipment/icons/sun_items.dmi new file mode 100644 index 0000000000000000000000000000000000000000..fad9ba0ee4e90433da6dd4b04dc5e657b72f3689 GIT binary patch literal 563 zcmV-30?hr1P)E5Sad{Xb7OL8aCB*JZU6vyoKseCa&`CgQ*iP1k(Zd4Us9A_nUzloee4T)-Xy0E`enhdI=TZvX%Q z?MXyIR9J=W*2@lpFc5`dYK4vnautzF-~Tb4!upJfqcNKPEGK*!S{EisEcWiqA%y4l z7!rjvHC!qPmdmifKyctZ%WQDO4Wte24#1o<#yLDEvX%(XPx+b4PiS707p^QY;BwAk zfJ%-eAZ&nvioym|L7?70p+@tj?YLF~wgjN>yIusY;ekNa^80<;NE-w}1UdhWbmPNP0 zq+1|a8CX?-Z@daH-h15{tbYCOA*uoOPdWCZJpe|b4)Z{CDM$bS002ovPDHLkV1kbP B`v(93 literal 0 HcmV?d00001