Files
Bubberstation/code/datums/components/wormborn.dm
Jacquerel 4664b630c5 Living Flesh limbs won't try to grab underfloor objects (#87736)
## About The Pull Request

There were checks in living limbs that were checking the wrong thing, at
least one of which was introduced by a feature change in a PR I merged
but didn't notice.
Notably:
- We were checking if the person with the limb was invisible, not the
thing they were trying to touch.
- We were checking if the person with the limb was anchored, not the
thing they were trying to grab.

Now your arm will no longer reach out and grab wires that are under the
floor.

Additionally to this:
- I made all of the output say "Your left arm" or "Your left leg"
instead of "Your flesh left leg" because it sounded stupid.
- I removed an unused argument from `can_be_pulled` because it was
confusing me when I looked at the proc.
- I reworded some of the user feedback messages because "the thing
pretending to be your left arm feels funny" just isn't very evocative.

The diff is long because I reversed the order of arm/leg operations
because the leg block is much smaller :clueless:

## Why It's Good For The Game

Fixes bug.
I like it more.

## Changelog

🆑
fix: Living Limbs no longer try to grab things that are under the floor.
spellcheck: Living Limb feedback messages now don't redundantly specify
that they are flesh arms.
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2024-11-08 16:12:48 +01:00

75 lines
2.2 KiB
Plaintext

/datum/component/wormborn
/datum/component/wormborn/Initialize(...)
. = ..()
if(!isliving(parent))
return COMPONENT_INCOMPATIBLE
/datum/component/wormborn/RegisterWithParent()
. = ..()
RegisterSignal(parent, COMSIG_LIVING_DEATH, PROC_REF(second_breath))
/datum/component/wormborn/UnregisterFromParent()
. = ..()
UnregisterSignal(parent, COMSIG_LIVING_DEATH)
/datum/component/wormborn/proc/second_breath(mob/living/source)
SIGNAL_HANDLER
if(get_area(source) == GLOB.areas_by_type[/area/centcom/wizard_station])
return
source.buckled?.unbuckle_mob(source, force = TRUE)
if(source.movement_type & VENTCRAWLING)
source.forceMove(get_turf(source))
var/mob/living/worm = new /mob/living/basic/wizard_worm(get_turf(source))
source.mind?.transfer_to(worm)
source.forceMove(worm)
/mob/living/basic/wizard_worm
name = "Magic Worm"
desc = "Large blue worm. What happens if you put your hand in his mouth?."
icon = 'icons/mob/simple/mob.dmi'
icon_state = "wizard_start"
icon_living = "wizard_start"
base_icon_state = "wizard"
maxHealth = 800
health = 800
melee_damage_lower = 20
melee_damage_upper = 30
obj_damage = 200
speed = 0
move_force = MOVE_FORCE_OVERPOWERING
move_resist = MOVE_FORCE_OVERPOWERING
pull_force = MOVE_FORCE_OVERPOWERING
mob_size = MOB_SIZE_HUGE
sentience_type = SENTIENCE_BOSS
mob_biotypes = MOB_ORGANIC|MOB_SPECIAL
/mob/living/basic/wizard_worm/has_gravity(turf/gravity_turf)
return TRUE
/mob/living/basic/wizard_worm/can_be_pulled(user, force)
return FALSE
/mob/living/basic/wizard_worm/Initialize(mapload, spawn_bodyparts = TRUE)
. = ..()
AddElement(/datum/element/wall_tearer)
if(spawn_bodyparts)
build_tail()
/mob/living/basic/wizard_worm/proc/build_tail(mob/living/tail)
AddComponent(/datum/component/mob_chain, vary_icon_state = TRUE)
var/mob/living/basic/wizard_worm/prev = src
for(var/i in 1 to 5)
prev = new_segment(behind = prev)
update_appearance(UPDATE_ICON_STATE)
/mob/living/basic/wizard_worm/proc/new_segment(mob/living/basic/wizard_worm/behind)
var/mob/living/segment = new type(drop_location(), FALSE)
ADD_TRAIT(segment, TRAIT_PERMANENTLY_MORTAL, INNATE_TRAIT)
segment.AddComponent(/datum/component/mob_chain, front = behind, vary_icon_state = TRUE)
return segment