From a5f26ce473c1917a7bce6f2e3ad0f11ce171b876 Mon Sep 17 00:00:00 2001 From: san7890 Date: Thu, 19 Oct 2023 20:16:10 -0700 Subject: [PATCH] Turns Holodeck Monkeys into actual Monkeys (#79068) ## About The Pull Request Old holodeck monkeys weren't even a subtype of simple animal monkeys, so this really just got swept under the floor in the sweeping monkey species refactors. Anyways, let's just spin up a quick species datum+mob subtype that will have all the traits we wanted from old holodeck monkeys (no meat, no organs, etc.) but reaping all of the benefits of modern monkeys (better AI, etc.) ## Why It's Good For The Game One more refactor done, very simple too. l'm not the greatest at carbon code so let me know if something is wack, but I'm fond of the way everything turned out (especially since I don't have to spam seven billion subtypes of every organ and bodypart). If you're concerned about the cost keep in mind people can spam monkeys through cubes, having a max of three more (that are virtually useless) via the holodeck will not kill us. Also the fact that slimes could eat holodeck monkeys irked me so I also touched that up. I swore there was something for it in the code but I was mistaken, it's codified now. ## Changelog :cl: refactor: Holodeck monkeys have been moved to the same system as old monkeys, and should retain the similar "ephermeal" behavior, while being a whole lot smarter by leveraging new AI. Please report anything that is completely wack about this. balance: Slimes can't eat holodeck monkeys anymore, because apparently they could and that is wack. /:cl: again let me know if my carbon/bodyparts code sucks. it does the job fwiw --- code/__DEFINES/mobs.dm | 1 + code/modules/holodeck/holo_effect.dm | 2 +- code/modules/holodeck/mobs.dm | 23 --------------- .../space_fauna/revenant/revenant_harvest.dm | 4 +++ .../mob/living/carbon/carbon_defines.dm | 2 +- .../modules/mob/living/carbon/human/monkey.dm | 18 ++++++++++-- .../carbon/human/species_types/monkeys.dm | 27 ++++++++++++++++++ code/modules/mob/living/carbon/life.dm | 2 +- .../mob/living/simple_animal/slime/powers.dm | 4 +++ .../surgery/bodyparts/dismemberment.dm | 2 ++ ...manoids__datum_species_monkey_holodeck.png | Bin 0 -> 778 bytes .../unit_tests/simple_animal_freeze.dm | 1 - tgstation.dme | 1 - 13 files changed, 57 insertions(+), 30 deletions(-) delete mode 100644 code/modules/holodeck/mobs.dm create mode 100644 code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_monkey_holodeck.png diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 1063a5c2a18..53475ad8109 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -120,6 +120,7 @@ #define SPECIES_NIGHTMARE "nightmare" #define SPECIES_MONKEY "monkey" #define SPECIES_MONKEY_FREAK "monkey_freak" +#define SPECIES_MONKEY_HOLODECK "monkey_holodeck" #define SPECIES_MONKEY_HUMAN_LEGGED "monkey_human_legged" #define SPECIES_MOTH "moth" #define SPECIES_MUSHROOM "mush" diff --git a/code/modules/holodeck/holo_effect.dm b/code/modules/holodeck/holo_effect.dm index a8d51c87728..76b3d320774 100644 --- a/code/modules/holodeck/holo_effect.dm +++ b/code/modules/holodeck/holo_effect.dm @@ -102,7 +102,7 @@ mobtype = /mob/living/basic/bee/toxin /obj/effect/holodeck_effect/mobspawner/monkey - mobtype = /mob/living/simple_animal/holodeck_monkey + mobtype = /mob/living/carbon/human/species/monkey/holodeck /obj/effect/holodeck_effect/mobspawner/penguin mobtype = /mob/living/basic/pet/penguin/emperor/neuter diff --git a/code/modules/holodeck/mobs.dm b/code/modules/holodeck/mobs.dm deleted file mode 100644 index 7a7e7c22d9e..00000000000 --- a/code/modules/holodeck/mobs.dm +++ /dev/null @@ -1,23 +0,0 @@ -/* - Mobs -*/ - -/mob/living/simple_animal/holodeck_monkey - name = "monkey" - desc = "A holographic creature fond of bananas." - icon = 'icons/mob/human/human.dmi' - icon_state = "monkey" - icon_living = "monkey" - icon_dead = "monkey_dead" - speak_emote = list("chimpers") - emote_hear = list("chimpers.") - emote_see = list("scratches.", "looks around.") - speak_chance = 1 - turns_per_move = 2 - butcher_results = list() - response_help_continuous = "pets" - response_help_simple = "pet" - response_disarm_continuous = "pushes aside" - response_disarm_simple = "push aside" - response_harm_continuous = "kicks" - response_harm_simple = "kick" diff --git a/code/modules/mob/living/basic/space_fauna/revenant/revenant_harvest.dm b/code/modules/mob/living/basic/space_fauna/revenant/revenant_harvest.dm index b8bb05db484..c162ecf2c21 100644 --- a/code/modules/mob/living/basic/space_fauna/revenant/revenant_harvest.dm +++ b/code/modules/mob/living/basic/space_fauna/revenant/revenant_harvest.dm @@ -14,6 +14,10 @@ to_chat(src, span_revenwarning("You are already siphoning the essence of a soul!")) return FALSE + if(target.flags_1 & HOLOGRAM_1) + target.balloon_alert(src, "doesn't possess a soul!") // it's a machine generated visual + return + draining = TRUE var/value_to_return = harvest_soul(target) if(!value_to_return) diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index fc6933ea611..f68c39771e2 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -47,7 +47,7 @@ ///only used by humans. var/obj/item/clothing/ears = null - /// Carbon + /// Carbon, you should really only be accessing this through has_dna() but it's your life var/datum/dna/dna = null ///last mind to control this mob, for blood-based cloning var/datum/mind/last_mind = null diff --git a/code/modules/mob/living/carbon/human/monkey.dm b/code/modules/mob/living/carbon/human/monkey.dm index db8f2f4f1e3..76bf7cc5288 100644 --- a/code/modules/mob/living/carbon/human/monkey.dm +++ b/code/modules/mob/living/carbon/human/monkey.dm @@ -4,7 +4,7 @@ ai_controller = /datum/ai_controller/monkey faction = list(FACTION_NEUTRAL, FACTION_MONKEY) -/mob/living/carbon/human/species/monkey/Initialize(mapload, cubespawned=FALSE, mob/spawner) +/mob/living/carbon/human/species/monkey/Initialize(mapload, cubespawned = FALSE, mob/spawner) if (cubespawned) var/cap = CONFIG_GET(number/monkeycap) if (LAZYLEN(SSmobs.cubemonkeys) > cap) @@ -21,7 +21,7 @@ /mob/living/carbon/human/species/monkey/angry ai_controller = /datum/ai_controller/monkey/angry -/mob/living/carbon/human/species/monkey/angry/Initialize(mapload) +/mob/living/carbon/human/species/monkey/angry/Initialize(mapload, cubespawned = FALSE, mob/spawner) . = ..() if(prob(10)) INVOKE_ASYNC(src, PROC_REF(give_ape_escape_helmet)) @@ -32,6 +32,20 @@ equip_to_slot_or_del(helmet, ITEM_SLOT_HEAD) helmet.attack_self(src) // todo encapsulate toggle +/mob/living/carbon/human/species/monkey/holodeck + race = /datum/species/monkey/holodeck + +/mob/living/carbon/human/species/monkey/holodeck/spawn_gibs() // no blood and no gibs + return + +/mob/living/carbon/human/species/monkey/holodeck/has_dna() + return null + +/mob/living/carbon/human/species/monkey/holodeck/create_bodyparts(list/overrides) // done like this in case people add more limbs to monkeys or something + . = ..() + for(var/obj/item/bodypart/limb as anything in bodyparts) + limb.bodypart_flags |= BODYPART_UNREMOVABLE // no farming organs or limbs from these fellers. get a monkey cube + GLOBAL_DATUM(the_one_and_only_punpun, /mob/living/carbon/human/species/monkey/punpun) /mob/living/carbon/human/species/monkey/punpun diff --git a/code/modules/mob/living/carbon/human/species_types/monkeys.dm b/code/modules/mob/living/carbon/human/species_types/monkeys.dm index 81861d381a0..d4cd075407f 100644 --- a/code/modules/mob/living/carbon/human/species_types/monkeys.dm +++ b/code/modules/mob/living/carbon/human/species_types/monkeys.dm @@ -192,4 +192,31 @@ /obj/item/organ/internal/brain/primate/get_attacking_limb(mob/living/carbon/human/target) return owner.get_bodypart(BODY_ZONE_HEAD) +/// Virtual monkeys that crave virtual bananas. Everything about them is ephemeral (except that bite). +/datum/species/monkey/holodeck + id = SPECIES_MONKEY_HOLODECK + knife_butcher_results = list() + meat = null + skinned_type = null + inherent_traits = list( + TRAIT_GENELESS, + TRAIT_GUN_NATURAL, + TRAIT_NO_AUGMENTS, + TRAIT_NO_BLOOD_OVERLAY, + TRAIT_NO_DNA_COPY, + TRAIT_NO_UNDERWEAR, + TRAIT_NO_ZOMBIFY, + TRAIT_NOBLOOD, + TRAIT_NOHUNGER, + TRAIT_VENTCRAWLER_NUDE, + ) + bodypart_overrides = list( + BODY_ZONE_L_ARM = /obj/item/bodypart/arm/left/monkey, + BODY_ZONE_R_ARM = /obj/item/bodypart/arm/right/monkey, + BODY_ZONE_HEAD = /obj/item/bodypart/head/monkey, + BODY_ZONE_L_LEG = /obj/item/bodypart/leg/left/monkey, + BODY_ZONE_R_LEG = /obj/item/bodypart/leg/right/monkey, + BODY_ZONE_CHEST = /obj/item/bodypart/chest/monkey, + ) + #undef MONKEY_SPEC_ATTACK_BITE_MISS_CHANCE diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index f3b03cdab35..66948253d9e 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -711,7 +711,7 @@ ///Check to see if we have the liver, if not automatically gives you last-stage effects of lacking a liver. /mob/living/carbon/proc/handle_liver(seconds_per_tick, times_fired) - if(!dna) + if(isnull(has_dna())) return var/obj/item/organ/internal/liver/liver = get_organ_slot(ORGAN_SLOT_LIVER) diff --git a/code/modules/mob/living/simple_animal/slime/powers.dm b/code/modules/mob/living/simple_animal/slime/powers.dm index 01197efc8ed..9e858d4f02d 100644 --- a/code/modules/mob/living/simple_animal/slime/powers.dm +++ b/code/modules/mob/living/simple_animal/slime/powers.dm @@ -64,6 +64,10 @@ if(issilicon(meal) || meal.mob_biotypes & MOB_ROBOTIC) return FALSE + if(meal.flags_1 & HOLOGRAM_1) + meal.balloon_alert(src, "no life energy!") + return FALSE + if(isanimal(meal)) var/mob/living/simple_animal/simple_meal = meal if(simple_meal.damage_coeff[TOX] <= 0 && simple_meal.damage_coeff[BRUTE] <= 0) //The creature wouldn't take any damage, it must be too weird even for us. diff --git a/code/modules/surgery/bodyparts/dismemberment.dm b/code/modules/surgery/bodyparts/dismemberment.dm index 5a7343f8a0b..e863341eb43 100644 --- a/code/modules/surgery/bodyparts/dismemberment.dm +++ b/code/modules/surgery/bodyparts/dismemberment.dm @@ -86,6 +86,8 @@ . += cavity_item cavity_item = null + return . + ///limb removal. The "special" argument is used for swapping a limb with a new one without the effects of losing a limb kicking in. /obj/item/bodypart/proc/drop_limb(special, dismembered) if(!owner) diff --git a/code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_monkey_holodeck.png b/code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_monkey_holodeck.png new file mode 100644 index 0000000000000000000000000000000000000000..e0d02f4302f431fa782e8250d9b8dcf5bad2fa1d GIT binary patch literal 778 zcmV+l1NHogP)KAp>Z$oXysABgMiHfJ)Mp(PaB}|{tSt3w;QEkZV5_+||Ce{Pf14u|qZeL1-2r+7@f1TfwZw9)C%H1Gq&L5Wc*AAOHXW07*qo IM6N<$g0f{}GXMYp literal 0 HcmV?d00001 diff --git a/code/modules/unit_tests/simple_animal_freeze.dm b/code/modules/unit_tests/simple_animal_freeze.dm index 6b233b30799..a3da7e205b8 100644 --- a/code/modules/unit_tests/simple_animal_freeze.dm +++ b/code/modules/unit_tests/simple_animal_freeze.dm @@ -41,7 +41,6 @@ /mob/living/simple_animal/drone/snowflake/bardrone, /mob/living/simple_animal/drone/syndrone, /mob/living/simple_animal/drone/syndrone/badass, - /mob/living/simple_animal/holodeck_monkey, /mob/living/simple_animal/hostile, /mob/living/simple_animal/hostile/alien, /mob/living/simple_animal/hostile/alien/drone, diff --git a/tgstation.dme b/tgstation.dme index 191164ad6eb..2a4ce643b3e 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3924,7 +3924,6 @@ #include "code\modules\holodeck\holo_effect.dm" #include "code\modules\holodeck\holodeck_map_templates.dm" #include "code\modules\holodeck\items.dm" -#include "code\modules\holodeck\mobs.dm" #include "code\modules\holodeck\turfs.dm" #include "code\modules\hydroponics\biogenerator.dm" #include "code\modules\hydroponics\bouquets.dm"