-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MODULAR] Icemoon additions: mob naming potions and other minor impro…
…vements (#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 <[email protected]> * Update modular_skyrat/modules/icemoon_additions/code/icecat_recipes.dm * Wrap anointing proc to avoid item state breaking on runtime --------- Co-authored-by: Bloop <[email protected]>
- Loading branch information
1 parent
dcdcd66
commit dfba91f
Showing
6 changed files
with
100 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
modular_skyrat/modules/icemoon_additions/code/icecat_recipes.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
29 changes: 29 additions & 0 deletions
29
modular_skyrat/modules/icemoon_additions/code/pet_commands.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters