Files
Bubberstation/code/modules/mob/living/basic/vermin/mothroach.dm
Jacquerel d650a1a7cb Basic mobs don't become dense upon death (#72554)
## About The Pull Request

In #72260 what was previously a var became a flag, which was a sensible
change, however this inverted the default behaviour.
In virtually all cases we want dead mobs to _stop_ being dense, this
added a requirement for the flag to be present for that to happen and
then didn't add the flag to any mobs.

Rather than add this to every mob I inverted the function of the flag.
My reasoning here is that _simple_ mobs seemingly never required this
behaviour, basic mobs are probably going to need it rarely if ever, and
including it in `basic_mob_flags` by default seems messy and easy to
leave off when setting other flags (plus #72524 implies to me we want to
avoid adding more default values).

Setting this manually on each mob seems kind of silly as a requirement
going forward and I can't think of a way we'd unit test for people
forgetting.

For the same reason I did the same thing with the
`STOP_ACTING_WHILE_DEAD` flag I added to the AI controller in a recent
PR, the flag should denote unusual behaviour not the default.

## Why It's Good For The Game

It looks really odd when you're constantly shuffling places with dead
mobs, they're not supposed to do that.
It's tedious to add `STOP_ACTING_WHILE_DEAD` to every AI controller when
that should be an obvious default assumption.

## Changelog

🆑
fix: Dead basic mobs are no longer "dense" objects and can be stepped
on.
/🆑
2023-01-12 19:58:12 -08:00

76 lines
2.3 KiB
Plaintext

/mob/living/basic/mothroach
name = "mothroach"
desc = "This is the adorable by-product of multiple attempts at genetically mixing mothpeople with cockroaches."
icon_state = "mothroach"
icon_living = "mothroach"
icon_dead = "mothroach_dead"
held_state = "mothroach"
held_lh = 'icons/mob/inhands/animal_item_lefthand.dmi'
held_rh = 'icons/mob/inhands/animal_item_righthand.dmi'
head_icon = 'icons/mob/clothing/head/pets_head.dmi'
butcher_results = list(/obj/item/food/meat/slab/mothroach = 3, /obj/item/stack/sheet/animalhide/mothroach = 1)
mob_biotypes = MOB_ORGANIC|MOB_BUG
mob_size = MOB_SIZE_SMALL
mobility_flags = MOBILITY_FLAGS_REST_CAPABLE_DEFAULT
health = 25
maxHealth = 25
speed = 1.25
gold_core_spawnable = FRIENDLY_SPAWN
can_be_held = TRUE
worn_slot_flags = ITEM_SLOT_HEAD
verb_say = "flutters"
verb_ask = "flutters inquisitively"
verb_exclaim = "flutters loudly"
verb_yell = "flutters loudly"
response_disarm_continuous = "shoos"
response_disarm_simple = "shoo"
response_harm_continuous = "hits"
response_harm_simple = "hit"
response_help_continuous = "pats"
response_help_simple = "pat"
faction = list(FACTION_NEUTRAL)
ai_controller = /datum/ai_controller/basic_controller/mothroach
/mob/living/basic/mothroach/Initialize(mapload)
. = ..()
AddElement(/datum/element/pet_bonus, "squeaks happily!")
add_verb(src, /mob/living/proc/toggle_resting)
ADD_TRAIT(src, TRAIT_VENTCRAWLER_ALWAYS, INNATE_TRAIT)
/mob/living/basic/mothroach/toggle_resting()
. = ..()
if(stat == DEAD)
return
if (resting)
icon_state = "[icon_living]_rest"
else
icon_state = "[icon_living]"
regenerate_icons()
/mob/living/basic/mothroach/attack_hand(mob/living/carbon/human/user, list/modifiers)
. = ..()
if(src.stat == DEAD)
return
else
playsound(loc, 'sound/voice/moth/scream_moth.ogg', 50, TRUE)
/mob/living/basic/mothroach/attackby(obj/item/attacking_item, mob/living/user, params)
. = ..()
if(src.stat == DEAD)
return
else
playsound(loc, 'sound/voice/moth/scream_moth.ogg', 50, TRUE)
/datum/ai_controller/basic_controller/mothroach
blackboard = list()
ai_traits = STOP_MOVING_WHEN_PULLED
ai_movement = /datum/ai_movement/basic_avoidance
idle_behavior = /datum/idle_behavior/idle_random_walk
planning_subtrees = list(
/datum/ai_planning_subtree/random_speech/mothroach,
)