From 5e9e45f1b6c60a2d00a3823ad619f8292720f671 Mon Sep 17 00:00:00 2001 From: Sealed101 Date: Sun, 10 Sep 2023 22:09:01 +0300 Subject: [PATCH] Polymorph belt blacklists several biotypes instead of allowing only organics (#78229) ## About The Pull Request Title; this makes the belt able to morph into _more_ mobs, but _less problematic/abusable_ mobs hopefully. It still only functions on basic/simple_animals, however. ~~Headslugs get a `MOB_UNDEAD` bioflag to prevent morphing into them completely. Though catching a sentient ling slug and morphing everyone into it is funny, it's only funny the first 5 times someone does it. (disclaimer: this is an approximation, i did not actually see a polymorph belt in-game because i currently play miner and like 10 games a week tops) Arguably, this isn't ideal, but it's the closest we get unless we rename `MOB_EPIC` or something into `MOB_SPECIAL` and let that one be the go-to bioflag for mobs we don't want **fun** things happen to.~~ `MOB_EPIC` is now `MOB_SPECIAL`. Headslugs get that. I think the alternative methow could use whatever the gold cores use to determine what to spawn but that would shift the mobs available for the belt even more and I can't be assed to figure out how _much_ of a shift that would be. Dragons or slimes or lavaland mobs would be out, for example. Don't really vibe with that. Fixes headslug's description bit that discerns a sentient slug from an AI one showing up on a dead slug. It can't move while it's dead, no matter its mind/AI. Also adds simple dmdoc comments to the defines to help discern a few of them more easily. Non-quip text suggestions welcome. ## Why It's Good For The Game - Resolves #77756 - Resolves #78227 More mobs available for the funny belt but less _fun_ mobs should allow for more stable use of the damn thing. Arguably, some of the mobs that have been found to be incompatible with the belt are simply lacking a `MOB_ORGANIC` flag, some of them with no apparent reason. However, blacklisting potentially problematic biotypes should be easier to design the unwanted mobs around. Also consistency, less all-ling stations, code clarity. Whatever. ## Changelog :cl: balance: polymorph belt now blacklists mobs that are undead, humanoid, robotic or spiritual (in nature, not religiously), as well as megafauna balance: however, this means that it works with more mobs that it should logically work with, like slimes/bugs/lightgeists etc fix: fixed headslug shenanigans with the polymorph belt hopefully for good this time fix: fixed headslug description mentioning its movement despite the slug being dead /:cl: --- code/__DEFINES/mobs.dm | 15 +++++++++++++-- code/__HELPERS/hallucinations.dm | 2 +- code/_globalvars/bitfields.dm | 6 +++--- code/datums/status_effects/debuffs/screen_blur.dm | 2 +- code/modules/clothing/belts/polymorph_belt.dm | 4 ++-- .../mob/living/basic/heretic/star_gazer.dm | 2 +- .../mob/living/basic/space_fauna/headslug.dm | 10 ++++++---- .../simple_animal/hostile/heretic_monsters.dm | 2 +- .../simple_animal/hostile/megafauna/_megafauna.dm | 2 +- 9 files changed, 29 insertions(+), 16 deletions(-) diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 54b1fa760fa..bd9f43c488d 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -42,18 +42,29 @@ #define VENTCRAWLER_ALWAYS 2 //Mob bio-types flags -///The mob is organic, can can heal from medical sutures. +///The mob is organic, can heal from medical sutures. #define MOB_ORGANIC (1 << 0) +///The mob is of a rocky make, most likely a golem. Iron within, iron without! #define MOB_MINERAL (1 << 1) +///The mob is a synthetic lifeform, like station borgs. #define MOB_ROBOTIC (1 << 2) +///The mob is an shambling undead corpse. Or a halloween species. Pick your poison. #define MOB_UNDEAD (1 << 3) +///The mob is a human-sized human-like human-creature. #define MOB_HUMANOID (1 << 4) +///The mob is a bug/insect/arachnid/some other kind of scuttly thing. #define MOB_BUG (1 << 5) +///The mob is a wild animal. Domestication may apply. #define MOB_BEAST (1 << 6) -#define MOB_EPIC (1 << 7) //megafauna +///The mob is some kind of a creature that should be exempt from certain **fun** interactions for balance reasons, i.e. megafauna or a headslug. +#define MOB_SPECIAL (1 << 7) +///The mob is some kind of a scaly reptile creature #define MOB_REPTILE (1 << 8) +///The mob is a spooky phantasm or an evil ghast of such nature. #define MOB_SPIRIT (1 << 9) +///The mob is a plant-based species, benefitting from light but suffering from darkness and plantkillers. #define MOB_PLANT (1 << 10) +///The mob is a goopy creature, probably coming from xenobiology. #define MOB_SLIME (1 << 11) //Lung respiration type flags diff --git a/code/__HELPERS/hallucinations.dm b/code/__HELPERS/hallucinations.dm index 9deb27b9040..525114cea28 100644 --- a/code/__HELPERS/hallucinations.dm +++ b/code/__HELPERS/hallucinations.dm @@ -10,7 +10,7 @@ GLOBAL_LIST_EMPTY(all_ongoing_hallucinations) #define HALLUCINATION_ARGLIST 3 /// Biotypes which cannot hallucinate for balance and logic reasons (not code) -#define NO_HALLUCINATION_BIOTYPES (MOB_ROBOTIC|MOB_SPIRIT|MOB_EPIC) +#define NO_HALLUCINATION_BIOTYPES (MOB_ROBOTIC|MOB_SPIRIT|MOB_SPECIAL) // Macro wrapper for _cause_hallucination so we can cheat in named arguments, like AddComponent. /** diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index 5bbad7fe0a2..23ba8213610 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -245,16 +245,16 @@ DEFINE_BITFIELD(mecha_flags, list( DEFINE_BITFIELD(mob_biotypes, list( "MOB_BEAST" = MOB_BEAST, "MOB_BUG" = MOB_BUG, - "MOB_EPIC" = MOB_EPIC, "MOB_HUMANOID" = MOB_HUMANOID, "MOB_MINERAL" = MOB_MINERAL, "MOB_ORGANIC" = MOB_ORGANIC, + "MOB_PLANT" = MOB_PLANT, "MOB_REPTILE" = MOB_REPTILE, "MOB_ROBOTIC" = MOB_ROBOTIC, + "MOB_SLIME" = MOB_SLIME, + "MOB_SPECIAL" = MOB_SPECIAL, "MOB_SPIRIT" = MOB_SPIRIT, "MOB_UNDEAD" = MOB_UNDEAD, - "MOB_PLANT" = MOB_PLANT, - "MOB_SLIME" = MOB_SLIME, )) DEFINE_BITFIELD(mob_respiration_type, list( diff --git a/code/datums/status_effects/debuffs/screen_blur.dm b/code/datums/status_effects/debuffs/screen_blur.dm index f893a1d379f..abdd07d3cd5 100644 --- a/code/datums/status_effects/debuffs/screen_blur.dm +++ b/code/datums/status_effects/debuffs/screen_blur.dm @@ -14,7 +14,7 @@ return ..() /datum/status_effect/eye_blur/on_apply() - if(owner.mob_biotypes & (MOB_ROBOTIC|MOB_SPIRIT|MOB_EPIC)) + if(owner.mob_biotypes & (MOB_ROBOTIC|MOB_SPIRIT|MOB_SPECIAL)) return FALSE // Refresh the blur when a client jumps into the mob, in case we get put on a clientless mob with no hud diff --git a/code/modules/clothing/belts/polymorph_belt.dm b/code/modules/clothing/belts/polymorph_belt.dm index f6ccccae971..e63e2c3bee3 100644 --- a/code/modules/clothing/belts/polymorph_belt.dm +++ b/code/modules/clothing/belts/polymorph_belt.dm @@ -60,8 +60,8 @@ if (!isanimal_or_basicmob(target_mob)) balloon_alert(user, "target too complex!") return TRUE - if (!(target_mob.mob_biotypes & MOB_ORGANIC)) - balloon_alert(user, "organic life only!") + if (target_mob.mob_biotypes & (MOB_HUMANOID|MOB_ROBOTIC|MOB_SPECIAL|MOB_SPIRIT|MOB_UNDEAD)) + balloon_alert(user, "incompatible!") return TRUE if (isanimal_or_basicmob(target_mob)) if (!target_mob.compare_sentience_type(SENTIENCE_ORGANIC)) diff --git a/code/modules/mob/living/basic/heretic/star_gazer.dm b/code/modules/mob/living/basic/heretic/star_gazer.dm index 099efd80172..29b5f16db8f 100644 --- a/code/modules/mob/living/basic/heretic/star_gazer.dm +++ b/code/modules/mob/living/basic/heretic/star_gazer.dm @@ -6,7 +6,7 @@ icon_living = "star_gazer" pixel_x = -32 base_pixel_x = -32 - mob_biotypes = MOB_HUMANOID | MOB_EPIC + mob_biotypes = MOB_HUMANOID | MOB_SPECIAL response_help_continuous = "passes through" response_help_simple = "pass through" speed = -0.2 diff --git a/code/modules/mob/living/basic/space_fauna/headslug.dm b/code/modules/mob/living/basic/space_fauna/headslug.dm index b0fba4fadc1..a417b6c1394 100644 --- a/code/modules/mob/living/basic/space_fauna/headslug.dm +++ b/code/modules/mob/living/basic/space_fauna/headslug.dm @@ -18,6 +18,7 @@ attack_verb_simple = "chomp" attack_sound = 'sound/weapons/bite.ogg' attack_vis_effect = ATTACK_EFFECT_BITE + mob_biotypes = MOB_ORGANIC|MOB_SPECIAL faction = list(FACTION_CREATURE) obj_damage = 0 environment_smash = ENVIRONMENT_SMASH_NONE @@ -39,10 +40,11 @@ /mob/living/basic/headslug/examine(mob/user) . = ..() - if(isnull(client)) - . += span_notice("It appears to be moving around listlessly.") - else - . += span_warning("It's moving around intelligently!") + if(stat != DEAD) + if(isnull(client)) + . += span_notice("It appears to be moving around listlessly.") + else + . += span_warning("It's moving around intelligently!") if (egg_lain) . += span_notice("Its reproductive equipment appears to have withered.") diff --git a/code/modules/mob/living/simple_animal/hostile/heretic_monsters.dm b/code/modules/mob/living/simple_animal/hostile/heretic_monsters.dm index 4269f847d92..2c0b9ba983a 100644 --- a/code/modules/mob/living/simple_animal/hostile/heretic_monsters.dm +++ b/code/modules/mob/living/simple_animal/hostile/heretic_monsters.dm @@ -145,7 +145,7 @@ mob_size = MOB_SIZE_HUGE sentience_type = SENTIENCE_BOSS environment_smash = ENVIRONMENT_SMASH_RWALLS - mob_biotypes = MOB_ORGANIC|MOB_EPIC + mob_biotypes = MOB_ORGANIC|MOB_SPECIAL obj_damage = 200 ranged_cooldown_time = 5 ranged = TRUE diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/_megafauna.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/_megafauna.dm index 7493eccb04b..7367721a351 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/_megafauna.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/_megafauna.dm @@ -6,7 +6,7 @@ combat_mode = TRUE sentience_type = SENTIENCE_BOSS environment_smash = ENVIRONMENT_SMASH_RWALLS - mob_biotypes = MOB_ORGANIC|MOB_EPIC + mob_biotypes = MOB_ORGANIC|MOB_SPECIAL obj_damage = 400 light_range = 3 faction = list(FACTION_MINING, FACTION_BOSS)