Files
RikuTheKiller c7cb0674cc Preliminary blood refactor (#93854)
## About The Pull Request

Moves all blood handling into procs and adds ways to easily hook into
basically every basic blood behavior.

This PR is not meant to fix every single case of janky blood logic in
the game. The main point and motivation of this PR is to add hooks for
blood behaviors. This allows for way more flexibility with blood code.

I am not going to fix our 3000 instances of single-letter vars, wacky
blood transfers, etc. This is just the groundwork for future PRs to
build off of, and by itself, should do very little to change blood
behavior.

I also added a rigorous set of unit tests for verifying that all of the
basic blood volume procs work correctly.

## Why It's Good For The Game

Previously, blood was handled via directly reading/writing
[var/blood_volume]. This was INCREDIBLY inconsistent and there was no
way to hook into it. This PR makes blood handling way more consistent,
which is great for all sorts of features.
2025-11-13 11:45:36 -06:00

95 lines
2.8 KiB
Plaintext

/mob/living/basic/alien
name = "alien hunter"
desc = "Hiss!"
icon = 'icons/mob/nonhuman-player/alien.dmi'
icon_state = "alienh"
icon_living = "alienh"
icon_dead = "alienh_dead"
icon_gib = "syndicate_gib"
gender = FEMALE
status_flags = CANPUSH
butcher_results = list(
/obj/item/food/meat/slab/xeno = 4,
/obj/item/stack/sheet/animalhide/xeno = 1,
)
maxHealth = 125
health = 125
bubble_icon = "alien"
combat_mode = TRUE
faction = list(ROLE_ALIEN)
damage_coeff = list(BRUTE = 1, BURN = 1, TOX = 1, STAMINA = 0, OXY = 1)
// Going for a dark purple here
lighting_cutoff_red = 30
lighting_cutoff_green = 15
lighting_cutoff_blue = 50
unique_name = TRUE
basic_mob_flags = FLAMMABLE_MOB
speed = 0
obj_damage = 60
speak_emote = list("hisses")
melee_damage_lower = 25
melee_damage_upper = 25
attack_verb_continuous = "slashes"
attack_verb_simple = "slash"
attack_sound = 'sound/items/weapons/bladeslice.ogg'
attack_vis_effect = ATTACK_EFFECT_CLAW
gold_core_spawnable = NO_SPAWN
death_sound = 'sound/mobs/non-humanoids/hiss/hiss6.ogg'
death_message = "lets out a waning guttural screech, green blood bubbling from its maw..."
habitable_atmos = null
unsuitable_atmos_damage = FALSE
unsuitable_heat_damage = 20
ai_controller = /datum/ai_controller/basic_controller/alien
default_blood_volume = BLOOD_VOLUME_NORMAL
///List of loot items to drop when deleted, if this is set then we apply DEL_ON_DEATH
var/list/loot
///Boolean on whether the xeno can plant weeds.
var/can_plant_weeds = TRUE
///Boolean on whether the xeno can lay eggs.
var/can_lay_eggs = FALSE
/mob/living/basic/alien/Initialize(mapload)
. = ..()
if(length(loot))
basic_mob_flags |= DEL_ON_DEATH
loot = string_list(loot)
AddElement(/datum/element/death_drops, loot)
AddElement(/datum/element/footstep, footstep_type = FOOTSTEP_MOB_CLAW)
/mob/living/basic/alien/get_butt_sprite()
return icon('icons/mob/butts.dmi', BUTT_SPRITE_XENOMORPH)
///Places alien weeds on the turf the mob is currently standing on.
/mob/living/basic/alien/proc/place_weeds()
if(!isturf(loc) || isspaceturf(loc))
return
if(locate(/obj/structure/alien/weeds/node) in get_turf(src))
return
visible_message(span_alertalien("[src] plants some alien weeds!"))
new /obj/structure/alien/weeds/node(loc)
///Lays an egg on the turf the mob is currently standing on.
/mob/living/basic/alien/proc/lay_alien_egg()
if(!isturf(loc) || isspaceturf(loc))
return
if(locate(/obj/structure/alien/egg) in get_turf(src))
return
visible_message(span_alertalien("[src] lays an egg!"))
new /obj/structure/alien/egg(loc)
/mob/living/basic/alien/get_bloodtype()
return get_blood_type(BLOOD_TYPE_XENO)
/mob/living/basic/alien/get_gibs_type(drop_bitflags = NONE)
if(drop_bitflags & DROP_BODYPARTS)
return /obj/effect/gibspawner/xeno
return /obj/effect/gibspawner/xeno/bodypartless