From dfba91fbd80b3a757eb8e8cd67925822a984f3f3 Mon Sep 17 00:00:00 2001 From: Ephemeralis Date: Tue, 21 Nov 2023 02:53:22 +1100 Subject: [PATCH] [MODULAR] Icemoon additions: mob naming potions and other minor improvements (#25003) * Add icewalker mob renaming potion, pet health indicators on examine_more (with improved messaging) and glowshroom mycelium to hearth seed barrels * Modularise * Further modularisation changes * Fix overloaded proc * Avoid single-letter variables Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> * Update modular_skyrat/modules/icemoon_additions/code/icecat_recipes.dm * Wrap anointing proc to avoid item state breaking on runtime --------- Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> --- .../icemoon_underground_icewalker_lower.dmm | 1 + .../ashwalkers/code/effects/ash_rituals.dm | 2 +- .../icemoon_additions/code/icecat_recipes.dm | 66 +++++++++++++++++++ .../icemoon_additions/code/pet_commands.dm | 29 ++++++++ .../primitive_catgirls/code/spawner.dm | 1 + tgstation.dme | 2 + 6 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 modular_skyrat/modules/icemoon_additions/code/icecat_recipes.dm create mode 100644 modular_skyrat/modules/icemoon_additions/code/pet_commands.dm diff --git a/_maps/RandomRuins/IceRuins/skyrat/icemoon_underground_icewalker_lower.dmm b/_maps/RandomRuins/IceRuins/skyrat/icemoon_underground_icewalker_lower.dmm index 8ea8983ce52..4e5a3e21f19 100644 --- a/_maps/RandomRuins/IceRuins/skyrat/icemoon_underground_icewalker_lower.dmm +++ b/_maps/RandomRuins/IceRuins/skyrat/icemoon_underground_icewalker_lower.dmm @@ -1873,6 +1873,7 @@ /obj/item/seeds/tower{ pixel_y = -3 }, +/obj/item/seeds/glowshroom, /obj/item/seeds/poppy, /obj/item/seeds/reishi, /obj/item/seeds/reishi, diff --git a/modular_skyrat/modules/ashwalkers/code/effects/ash_rituals.dm b/modular_skyrat/modules/ashwalkers/code/effects/ash_rituals.dm index 7b38a565698..a4ca86c4f18 100644 --- a/modular_skyrat/modules/ashwalkers/code/effects/ash_rituals.dm +++ b/modular_skyrat/modules/ashwalkers/code/effects/ash_rituals.dm @@ -202,7 +202,7 @@ /mob/living/basic/mining/ice_whelp, /mob/living/basic/mining/lobstrosity, /mob/living/simple_animal/hostile/asteroid/polarbear, - /mob/living/simple_animal/hostile/asteroid/wolf, + /mob/living/basic/mining/wolf, ) new mob_type(success_rune.loc) diff --git a/modular_skyrat/modules/icemoon_additions/code/icecat_recipes.dm b/modular_skyrat/modules/icemoon_additions/code/icecat_recipes.dm new file mode 100644 index 00000000000..8467bb2f929 --- /dev/null +++ b/modular_skyrat/modules/icemoon_additions/code/icecat_recipes.dm @@ -0,0 +1,66 @@ +/obj/item/anointing_oil + name = "anointing bloodresin" + desc = "And so Helgar Knife-Arm spoke to the Hearth, and decreed that all of the Kin who gave name to beasts would do so with conquest and blood." + icon = 'icons/obj/medical/chemical.dmi' + icon_state = "potred" + throwforce = 0 + w_class = WEIGHT_CLASS_TINY + + var/being_used = FALSE + +/obj/item/anointing_oil/attack(mob/living/target_mob, mob/living/user, params) + if (!is_species(user, /datum/species/human/felinid/primitive)) + to_chat(user, span_warning("You have no idea what this disgusting concoction is used for.")) + return + if(being_used || !ismob(target_mob)) //originally this was going to check if the mob was friendly, but if an icecat wants to name some terror mob while it's tearing chunks out of them, why not? + return + if(target_mob.ckey) + to_chat(user, span_warning("You would never shame a creature so intelligent by not allowing it to choose its own name.")) + return + + if(try_anoint(target_mob, user)) + qdel(src) + else + being_used = FALSE + +/obj/item/anointing_oil/proc/try_anoint(mob/living/target_mob, mob/living/user) + being_used = TRUE + + var/new_name = sanitize_name(tgui_input_text(user, "Speak forth this beast's new name for all the Kin to hear.", "Input a name", target_mob.name, MAX_NAME_LEN)) + + if(!new_name || QDELETED(src) || QDELETED(target_mob) || new_name == target_mob.name || !target_mob.Adjacent(user)) + being_used = FALSE + return FALSE + + target_mob.visible_message(span_notice("[user] leans down and smears twinned streaks of glistening bloodresin upon [target_mob], then straightens up with ritual purpose...")) + user.say("Let the ice know you forevermore as +[new_name]+.") + + user.log_message("used [src] on [target_mob], renaming it to [new_name].", LOG_GAME) + + target_mob.name = new_name + + //give the stupid dog zoomies from getting named + if(istype(target_mob, /mob/living/basic/mining/wolf)) + target_mob.emote("awoo") + target_mob.emote("spin") + + return TRUE + +/obj/item/anointing_oil/examine(mob/user) + . = ..() + if(is_species(user, /datum/species/human/felinid/primitive)) + . += span_info("Using this on the local wildlife will allow you to give them a name.") + +/datum/crafting_recipe/anointing_oil + name = "Anointing Bloodresin" + category = CAT_MISC + + //recipe given to icecats as part of their spawner/team setting + always_available = FALSE + + reqs = list( + /datum/reagent/consumable/liquidgibs = 80, + /datum/reagent/blood = 20, + ) + + result = /obj/item/anointing_oil diff --git a/modular_skyrat/modules/icemoon_additions/code/pet_commands.dm b/modular_skyrat/modules/icemoon_additions/code/pet_commands.dm new file mode 100644 index 00000000000..42d202d572a --- /dev/null +++ b/modular_skyrat/modules/icemoon_additions/code/pet_commands.dm @@ -0,0 +1,29 @@ +/datum/component/obeys_commands/RegisterWithParent() + . = ..() + RegisterSignal(parent, COMSIG_ATOM_EXAMINE_MORE, PROC_REF(on_examine_more)) + +/datum/component/obeys_commands/UnregisterFromParent() + . = ..() + UnregisterSignal(parent, COMSIG_ATOM_EXAMINE_MORE) + +/datum/component/obeys_commands/on_examine(mob/living/source, mob/user, list/examine_list) + . = ..() + . += span_italics("You can alt+click [source.p_them()] when adjacent to see available commands.") + . += span_italics("You can also examine [source.p_them()] closely to check on [source.p_their()] wounds. Many companions can be healed with sutures or creams!") + +/datum/component/obeys_commands/proc/on_examine_more(mob/living/source, mob/user, list/examine_list) + SIGNAL_HANDLER + + if (IS_DEAD_OR_INCAP(source)) + return + if (!(user in source.ai_controller?.blackboard[BB_FRIENDS_LIST])) + return + + if (source.health < source.maxHealth*0.2) + examine_list += span_bolddanger("[source.p_They()] look[source.p_s()] severely injured.") + else if (source.health < source.maxHealth*0.5) + examine_list += span_danger("[source.p_They()] look[source.p_s()] moderately injured.") + else if (source.health < source.maxHealth*0.8) + examine_list += span_warning("[source.p_They()] look[source.p_s()] slightly injured.") + else + examine_list += span_notice("[source.p_They()] look[source.p_s()] to be in good condition.") diff --git a/modular_skyrat/modules/primitive_catgirls/code/spawner.dm b/modular_skyrat/modules/primitive_catgirls/code/spawner.dm index 2e2d9ec0d17..3bed64d3935 100644 --- a/modular_skyrat/modules/primitive_catgirls/code/spawner.dm +++ b/modular_skyrat/modules/primitive_catgirls/code/spawner.dm @@ -101,6 +101,7 @@ /datum/crafting_recipe/boneaxe, /datum/crafting_recipe/bonespear, /datum/crafting_recipe/bonedagger, + /datum/crafting_recipe/anointing_oil, ) /datum/antagonist/primitive_catgirl/Destroy() diff --git a/tgstation.dme b/tgstation.dme index a76b984c3cc..ff17285cf34 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -7169,6 +7169,8 @@ #include "modular_skyrat\modules\hyposprays\code\hyposprays_II.dm" #include "modular_skyrat\modules\hyposprays\code\hypovials.dm" #include "modular_skyrat\modules\hyposprays\code\vending_hypospray.dm" +#include "modular_skyrat\modules\icemoon_additions\code\icecat_recipes.dm" +#include "modular_skyrat\modules\icemoon_additions\code\pet_commands.dm" #include "modular_skyrat\modules\ices_events\code\_ICES_globalvars.dm" #include "modular_skyrat\modules\ices_events\code\ICES_event_config.dm" #include "modular_skyrat\modules\ices_events\code\ICES_intensity_credits.dm"