Files
Bubberstation/code/datums/components/squashable.dm
MrMelbert 7f3d763285 Adds Roach Infusion to the DNA infuser (#76393)
## About The Pull Request

- Adds Roach Infusion to the DNA infuser. 
   - Bonuses include:
- All infused organs are 2x as healthy, notably your heart: Meaning
getting revived after being dead a while is easier
- When being attacked from behind or while lying down, take 50% less
damage from brute attacks
      - Lose disgust 32x faster, making it a non-issue
      - Higher toxin purge threshold (5 units, up from 3)
      - Virus resistance (same as spaceacillin)
      - 100 innate bomb armor, preventing explosions from gibbing you
      - 90 innate bio armor
- Immunity to appendicitis, radiation, and to being gibbed by nuclear
bombs
   - Downsides include:
      - Knockdowns are 3x as long
      - get 3x as hungry
      - Ingest reagents to your stomach 1.5x slower
      - Take 2x as much damage from toxins
- Toxins over the purge threshold deal 4x more liver damage (effectively
2x, as the liver has 2x health)
      - Becoming a bug
      - Roaches are gross

- Adds a way to kill roaches without having them splat. If they are
sprayed with bug spray, they will simply fall over, and can be scooped
up.


https://github.com/tgstation/tgstation/assets/51863163/5078c493-9e28-42cb-ae51-45fa25b67a34

## Why It's Good For The Game

More content for the DNA infuser, which benefits greatly from variety. 

While initially it may seem like a lot of bonuses, a lot of them are
very niche, with the exception being the brute resilience which is the
big "actually useful" bonus you gain.

The infusion is intended to be given to Engineers, offering innate
Radiation immunity to allow them to work on the Supermatter without
needing a rad suit. Likewise, if the work goes south and the Supermatter
goes boom, their body will more than likely survive the blast.

## Changelog

🆑 Melbert
add: Adds the Roach infusion to the DNA infuser. Do you want to survive
a nuclear apocalypse? Visit genetics today.
add: Adds a way to kill Roaches without splatting them. Visit botany for
a spray bottle of pestkiller.
qol: Infuser book is more book-like
fix: DNA infuser correctly gives on-success feedback messages
/🆑

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
2023-07-02 03:44:03 +01:00

78 lines
3.0 KiB
Plaintext

///This component allows something to be when crossed, for example for cockroaches.
/datum/component/squashable
///Chance on crossed to be squashed
var/squash_chance = 50
///How much brute is applied when mob is squashed
var/squash_damage = 1
///Squash flags, for extra checks etcetera.
var/squash_flags = NONE
///Special callback to call on squash instead, for things like hauberoach
var/datum/callback/on_squash_callback
///signal list given to connect_loc
var/static/list/loc_connections = list(
COMSIG_ATOM_ENTERED = PROC_REF(on_entered),
)
/datum/component/squashable/Initialize(squash_chance, squash_damage, squash_flags, squash_callback)
. = ..()
if(!isliving(parent))
return COMPONENT_INCOMPATIBLE
if(squash_chance)
src.squash_chance = squash_chance
if(squash_damage)
src.squash_damage = squash_damage
if(squash_flags)
src.squash_flags = squash_flags
if(!src.on_squash_callback && squash_callback)
on_squash_callback = CALLBACK(parent, squash_callback)
AddComponent(/datum/component/connect_loc_behalf, parent, loc_connections)
///Handles the squashing of the mob
/datum/component/squashable/proc/on_entered(turf/source_turf, atom/movable/crossing_movable)
SIGNAL_HANDLER
if(parent == crossing_movable)
return
var/mob/living/parent_as_living = parent
if((squash_flags & SQUASHED_DONT_SQUASH_IN_CONTENTS) && !isturf(parent_as_living.loc))
return
if((squash_flags & SQUASHED_SHOULD_BE_DOWN) && parent_as_living.body_position != LYING_DOWN)
return
var/should_squash = ((squash_flags & SQUASHED_ALWAYS_IF_DEAD) && parent_as_living.stat == DEAD) || prob(squash_chance)
if(should_squash && on_squash_callback)
if(on_squash_callback.Invoke(parent_as_living, crossing_movable))
return //Everything worked, we're done!
if(isliving(crossing_movable))
var/mob/living/crossing_mob = crossing_movable
if(crossing_mob.mob_size > MOB_SIZE_SMALL && !(crossing_mob.movement_type & FLYING))
if(HAS_TRAIT(crossing_mob, TRAIT_PACIFISM))
crossing_mob.visible_message(span_notice("[crossing_mob] carefully steps over [parent_as_living]."), span_notice("You carefully step over [parent_as_living] to avoid hurting it."))
return
if(should_squash)
crossing_mob.visible_message(span_notice("[crossing_mob] squashed [parent_as_living]."), span_notice("You squashed [parent_as_living]."))
Squish(parent_as_living)
else
parent_as_living.visible_message(span_notice("[parent_as_living] avoids getting crushed."))
else if(isstructure(crossing_movable))
if(should_squash)
crossing_movable.visible_message(span_notice("[parent_as_living] is crushed under [crossing_movable]."))
Squish(parent_as_living)
else
parent_as_living.visible_message(span_notice("[parent_as_living] avoids getting crushed."))
/datum/component/squashable/proc/Squish(mob/living/target)
if(squash_flags & SQUASHED_SHOULD_BE_GIBBED)
target.gib()
else
target.adjustBruteLoss(squash_damage)
/datum/component/squashable/UnregisterFromParent()
. = ..()
qdel(GetComponent(/datum/component/connect_loc_behalf))