Files
Bubberstation/code/datums/elements/amputating_limbs.dm
Jacquerel ddfdc70d73 Basic Lobstrosity (#77253)
## About The Pull Request

I'm slowly chipping away at mining mobs. These ones also got some new
sprites because the old ones were a bit weird except when facing South.

![image](https://github.com/tgstation/tgstation/assets/7483112/015b8819-bab8-471a-86ae-70b1597ae327)
Arctic Lobstrosities are now hairy to give them a little more visual
distinction from Lavaland ones.

In terms of behaviour, they're now a little faster and can charge you
from further away.
They will _only_ attack players who are incapacitated in some way
(primarily from being hit by their charge, but could be from a Goliath
or something too) and will otherwise keep their distance until they can
charge again. They move slower for a short duration after charging
though, so you have time to slap them a bit.

If a Lobstrosity downs you then it will try to snip off one of your
arms, then retreat in order to eat it.
Obviously nobody likes losing an arm, but this does give you an
opportunity to get away while it is distracted? Funnily enough the way
our health system works means that sometimes losing that arm actually
takes you out of soft crit so you can stumble back to the station for a
replacement (or try to wrestle yours back?)

All of these things are achievable also by a player if you make one
sapient, they will pull arms off mobs they attack which are in crit and
can eat arms if they see them lying around if they want.
I added an element to let you dismember people with your bare hands,
maybe someone evil can use it to add a beheading attack some day.

Here's a video of their new behaviours:
https://www.youtube.com/watch?v=9eKxsH7hD7Q

## Why It's Good For The Game

Gives mobs more character.
Reduces our list of frozen simple mobs.
Replaces some ugly side sprites.
Medbay enrichment?

## Changelog

🆑
refactor: Lobstrosities are now basic mobs and have different AI
behaviour. Please report anything which seems like it shouldn't be
happening.
add: Lobstrosities will now only opportunistically attack things they
have knocked over with their charge, and are otherwise timid.
add: Lobstrosities are hungry for fingers and will steal one of your
arms if they defeat you in combat, although this gives you time to crawl
away.
sprite: New sprites for Lobstrosities.
/🆑
2023-08-01 17:26:32 -06:00

67 lines
2.5 KiB
Plaintext

/// This component will intercept bare-handed attacks by the owner on critically injured carbons and amputate random limbs instead
/datum/element/amputating_limbs
element_flags = ELEMENT_BESPOKE
argument_hash_start_idx = 2
/// How long does it take?
var/surgery_time
/// What is the means by which we describe the act of amputation?
var/surgery_verb
/// The types of limb we can remove
var/list/target_zones
/datum/element/amputating_limbs/Attach(
datum/target,
surgery_time = 5 SECONDS,
surgery_verb = "prying",
list/target_zones = list(BODY_ZONE_L_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_ARM, BODY_ZONE_R_LEG),
)
. = ..()
if (!isliving(target))
return ELEMENT_INCOMPATIBLE
if (!length(target_zones))
CRASH("[src] for [target] was not provided a valid list of body zones to target.")
src.surgery_time = surgery_time
src.surgery_verb = surgery_verb
src.target_zones = target_zones
RegisterSignals(target, list(COMSIG_LIVING_UNARMED_ATTACK, COMSIG_HUMAN_MELEE_UNARMED_ATTACK, COMSIG_HOSTILE_PRE_ATTACKINGTARGET), PROC_REF(try_amputate))
/datum/element/amputating_limbs/Detach(datum/source)
UnregisterSignal(source, list(COMSIG_LIVING_UNARMED_ATTACK, COMSIG_HUMAN_MELEE_UNARMED_ATTACK, COMSIG_HOSTILE_PRE_ATTACKINGTARGET))
return ..()
/// Called when you click on literally anything with your hands, see if it is an injured carbon and then try to cut it up
/datum/element/amputating_limbs/proc/try_amputate(mob/living/surgeon, atom/victim)
SIGNAL_HANDLER
if (!iscarbon(victim) || HAS_TRAIT(victim, TRAIT_NODISMEMBER))
return
var/mob/living/carbon/limbed_victim = victim
if (limbed_victim.stat == CONSCIOUS)
return
if (DOING_INTERACTION_WITH_TARGET(surgeon, victim))
surgeon.balloon_alert(surgeon, "already busy!")
return COMPONENT_CANCEL_ATTACK_CHAIN
var/list/valid_targets = list()
for (var/obj/item/bodypart/possible_target as anything in limbed_victim.bodyparts)
if (possible_target.bodypart_flags & BODYPART_UNREMOVABLE)
continue
if (!(possible_target.body_zone in target_zones))
continue
valid_targets += possible_target
if (!length(valid_targets))
return
INVOKE_ASYNC(src, PROC_REF(amputate), surgeon, victim, pick(valid_targets))
return COMPONENT_CANCEL_ATTACK_CHAIN
/// Chop one off
/datum/element/amputating_limbs/proc/amputate(mob/living/surgeon, mob/living/carbon/victim, obj/item/bodypart/to_remove)
surgeon.visible_message(span_warning("[surgeon] begins [surgery_verb] [to_remove] off of [victim]!"))
if (!do_after(surgeon, delay = surgery_time, target = victim))
return
to_remove.dismember()