Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions code/__DEFINES/mecha.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#define MECHA_INT_SHORT_CIRCUIT (1<<2)
#define MECHA_CABIN_AIR_BREACH (1<<3)
#define MECHA_INT_CONTROL_LOST (1<<4)
#define MECHA_INT_FUEL_LINE (1<<5)

#define PANEL_OPEN (1<<0)
#define ID_LOCK_ON (1<<1)
Expand Down Expand Up @@ -59,3 +60,8 @@
#define MECHA_AMMO_PUNCHING_GLOVE "Punching glove"
#define MECHA_AMMO_BANANA_PEEL "Banana peel"
#define MECHA_AMMO_MOUSETRAP "Mousetrap"

// Flags for use_energy
#define OIL_MODIFIED_DRAIN (1<<0)
#define SERVO_MODIFIED_DRAIN (1<<1)
#define CAPACITOR_MODIFIED_DRAIN (1<<2)
1 change: 1 addition & 0 deletions code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ DEFINE_BITFIELD(internal_damage, list(
"MECHA_CABIN_AIR_BREACH" = MECHA_CABIN_AIR_BREACH,
"MECHA_INT_CONTROL_LOST" = MECHA_INT_CONTROL_LOST,
"MECHA_INT_SHORT_CIRCUIT" = MECHA_INT_SHORT_CIRCUIT,
"MECHA_INT_FUEL_LINE" = MECHA_INT_FUEL_LINE,
))

DEFINE_BITFIELD(mecha_flags, list(
Expand Down
4 changes: 1 addition & 3 deletions code/datums/stock_market_events.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"MODular Solutions",
"SolGov",
"Australicus Industrial Mining",
"Vey-Medical",
"Nanotrasen-DeForest Corporation",
"Aussec Armory",
"Dreamland Robotics"
)
Expand Down Expand Up @@ -147,5 +147,3 @@
SSstock_market.materials_quantity[mat] = initial(mat.tradable_base_quantity) //Force the material to be available again.
SSstock_market.materials_prices[mat] = initial(mat.value_per_unit) * SHEET_MATERIAL_AMOUNT //Force the price to be reset once the lockdown is over.
create_news()


2 changes: 1 addition & 1 deletion code/datums/wounds/internal_bleeding.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
if(!victim || victim.stat == DEAD || HAS_TRAIT(victim, TRAIT_STASIS) || !victim.needs_heart())
return
var/severity_mod = (severity + 1)
victim.bleed(bleed_amount * severity_mod * seconds_per_tick, drip = FALSE)
victim.bleed(bleed_amount * severity_mod * seconds_per_tick, leave_pool = FALSE)
if(severity == WOUND_SEVERITY_TRIVIAL)
if(highest_severity == WOUND_SEVERITY_TRIVIAL)
var/percent = 0.01
Expand Down
10 changes: 3 additions & 7 deletions code/game/objects/effects/decals/cleanable/humans.dm
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,6 @@

/// The turf we just came from, so we can back up when we hit a wall
var/turf/prev_loc
/// The cached info about the blood
var/list/blood_dna_info
/// Skip making the final blood splatter when we're done, like if we're not in a turf
var/skip = FALSE
/// How many tiles/items/people we can paint red
Expand All @@ -594,7 +592,7 @@
/obj/effect/decal/cleanable/blood/hitsplatter/proc/expire()
if(isturf(loc) && !skip)
playsound(src, 'sound/effects/wounds/splatter.ogg', 60, TRUE, -1)
loc.add_blood_DNA(blood_dna_info)
loc.add_blood_DNA(GET_ATOM_BLOOD_DNA(src))
qdel(src)

/// Set the splatter up to fly through the air until it rounds out of steam or hits something
Expand All @@ -621,7 +619,7 @@
continue
if(splatter_strength <= 0)
break
iter_atom.add_blood_DNA(blood_dna_info)
iter_atom.add_blood_DNA(GET_ATOM_BLOOD_DNA(src))
if(isliving(iter_atom))
var/mob/living/splatted = iter_atom
splatted.add_mood_event("splattered_with_blood", /datum/mood_event/splattered_with_blood)
Expand All @@ -638,7 +636,7 @@
fly_trail.transform = fly_trail.transform.Turn((flight_dir == NORTHEAST || flight_dir == SOUTHWEST) ? 135 : 45)
fly_trail.icon_state = pick("trails_1", "trails2")
fly_trail.adjust_bloodiness(fly_trail.bloodiness * -0.66)
fly_trail.add_blood_DNA(blood_dna_info)
fly_trail.add_blood_DNA(GET_ATOM_BLOOD_DNA(src))

/obj/effect/decal/cleanable/blood/hitsplatter/proc/loop_done(datum/source)
SIGNAL_HANDLER
Expand Down Expand Up @@ -669,7 +667,6 @@
final_splatter.pixel_x = (dir == EAST ? 32 : (dir == WEST ? -32 : 0))
final_splatter.pixel_y = (dir == NORTH ? 32 : (dir == SOUTH ? -32 : 0))
final_splatter.add_blood_DNA(GET_ATOM_BLOOD_DNA(src))
final_splatter.add_blood_DNA(blood_dna_info)
else // This will only happen if prev_loc is not even a turf, which is highly unlikely.
abstract_move(bumped_atom)
expire()
Expand All @@ -680,7 +677,6 @@
return
var/obj/effect/decal/cleanable/blood/splatter/over_window/final_splatter = new
final_splatter.add_blood_DNA(GET_ATOM_BLOOD_DNA(src))
final_splatter.add_blood_DNA(blood_dna_info)
final_splatter.forceMove(the_window)
the_window.vis_contents += final_splatter
the_window.bloodied = TRUE
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/effects/decals/cleanable/robots.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/obj/effect/decal/cleanable/robot_debris/Initialize(mapload)
. = ..()
RegisterSignal(src, COMSIG_MOVABLE_PIPE_EJECTING, PROC_REF(on_pipe_eject))
add_blood_DNA(list("UNKNOWN DNA" = /datum/blood_type/oil)) // NON-MODULE CHANGE : For bloody shoes // Yeah don't think about it too much
add_blood_DNA(list("CRUDE OIL" = /datum/blood_type/oil)) // NON-MODULE CHANGE : For bloody shoes // Yeah don't think about it too much

/obj/effect/decal/cleanable/robot_debris/proc/streak(list/directions, mapload=FALSE)
var/direction = pick(directions)
Expand Down Expand Up @@ -87,7 +87,7 @@
/obj/effect/decal/cleanable/oil/Initialize(mapload, list/datum/disease/diseases)
. = ..()
AddElement(/datum/element/easy_ignite) // NON-MODULE CHANGE
add_blood_DNA(list("UNKNOWN DNA" = /datum/blood_type/oil)) // NON-MODULE CHANGE : For bloody shoes // Yeah don't think about it too much
add_blood_DNA(list("CRUDE OIL" = /datum/blood_type/oil)) // NON-MODULE CHANGE : For bloody shoes // Yeah don't think about it too much

// /obj/effect/decal/cleanable/oil/attackby(obj/item/I, mob/living/user)
// var/attacked_by_hot_thing = I.get_temperature()
Expand Down
9 changes: 6 additions & 3 deletions code/modules/forensics/forensics_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,13 @@
return FALSE
if(dried)
return TRUE
// Imperfect, ends up with some blood types being double-set-up, but harmless (for now)
for(var/new_blood in blood_DNA_to_add)
var/datum/blood_type/blood = find_blood_type(blood_DNA_to_add[new_blood])
var/list/unique_blood = list()
for(var/some_dna, blood_type in blood_DNA_to_add)
if(unique_blood[blood_type])
continue
var/datum/blood_type/blood = find_blood_type(blood_type)
blood.set_up_blood(src, first_dna == 0)
unique_blood[blood_type] = TRUE
update_appearance()
add_atom_colour(get_blood_dna_color(), FIXED_COLOUR_PRIORITY)
return TRUE
Expand Down
10 changes: 5 additions & 5 deletions code/modules/mob/living/blood.dm
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,18 @@
iter_part.update_part_wound_overlay()

/// Makes a blood drop, leaking amt units of blood from the mob
/mob/living/proc/bleed(amt, drip = TRUE)
/mob/living/proc/bleed(amt, leave_pool = TRUE)
return

/mob/living/carbon/bleed(amt, drip = TRUE)
/mob/living/carbon/bleed(amt, leave_pool = TRUE)
if((status_flags & GODMODE) || HAS_TRAIT(src, TRAIT_NOBLOOD))
return
blood_volume = max(blood_volume - amt, 0)

if(drip && isturf(loc) && prob(sqrt(amt) * BLOOD_DRIP_RATE_MOD))
if(leave_pool && isturf(loc) && prob(sqrt(amt) * BLOOD_DRIP_RATE_MOD))
add_splatter_floor(loc, (amt <= 10))

/mob/living/carbon/human/bleed(amt, drip = TRUE)
/mob/living/carbon/human/bleed(amt, leave_pool = TRUE)
amt *= physiology.bleed_mod
return ..()

Expand Down Expand Up @@ -278,7 +278,7 @@

//to add a splatter of blood or other mob liquid.
/mob/living/proc/add_splatter_floor(turf/blood_turf = get_turf(src), small_drip)
return get_blood_type()?.make_blood_splatter(src, blood_turf, small_drip)
return get_blood_type()?.make_blood_splatter(blood_turf, small_drip, get_blood_dna_list(), get_static_viruses())

/mob/living/proc/do_splatter_effect(splat_dir = pick(GLOB.cardinals))
var/obj/effect/temp_visual/dir_setting/bloodsplatter/splatter = new(get_turf(src), splat_dir)
Expand Down
27 changes: 19 additions & 8 deletions code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1510,22 +1510,33 @@
return FALSE

/**
* This proc is a helper for spraying blood for things like slashing/piercing wounds and dismemberment.
* Sprays out blood in a direction to a certain distance
*
* The strength of the splatter in the second argument determines how much it can dirty and how far it can go
* This is on atom so that arbitrary objects can also spray blood (like meat),
* you just need to pass a blood_dna.
*
* Arguments:
* * splatter_direction: Which direction the blood is flying
* * splatter_strength: How many tiles it can go, and how many items it can pass over and dirty
* * blood_dna: A list of DNA info to add to the blood decal. Autoset for mobs.
* * static_viruses: A list of viruses to add to the blood decal
*/
/mob/living/carbon/proc/spray_blood(splatter_direction, splatter_strength = 3)
/atom/proc/spray_blood(splatter_direction, splatter_strength = 3, blood_dna, list/static_viruses)
if(!isturf(loc))
return
var/obj/effect/decal/cleanable/blood/hitsplatter/our_splatter = new(loc, get_static_viruses(), splatter_strength)
our_splatter.add_blood_DNA(GET_ATOM_BLOOD_DNA(src))
our_splatter.blood_dna_info = get_blood_dna_list()
var/turf/targ = get_ranged_target_turf(src, splatter_direction, splatter_strength)
our_splatter.fly_towards(targ, splatter_strength)
if(!islist(blood_dna))
CRASH("spray_blood called without a valid blood_dna list!")

var/obj/effect/decal/cleanable/blood/hitsplatter/our_splatter = new(loc, static_viruses, splatter_strength)
our_splatter.add_blood_DNA(blood_dna)
our_splatter.fly_towards(get_ranged_target_turf(src, splatter_direction, splatter_strength), splatter_strength)

/mob/living/carbon/spray_blood(splatter_direction, splatter_strength = 3, blood_dna, list/static_viruses)
if(isnull(blood_dna))
blood_dna = get_blood_dna_list()
if(isnull(static_viruses))
static_viruses = get_static_viruses()
return ..()

/mob/living/carbon/dropItemToGround(obj/item/to_drop, force = FALSE, silent = FALSE, invdrop = TRUE, turf/newloc = null)
if((to_drop in organs) || (to_drop in bodyparts)) //let's not do this, aight?
Expand Down
81 changes: 54 additions & 27 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1089,29 +1089,26 @@
/mob/living/carbon/alien/adult/lying_angle_on_movement(direct)
return

/mob/living/proc/make_blood_trail(turf/target_turf, turf/start, was_facing, movement_direction)
if(!has_gravity() || !isturf(start) || HAS_TRAIT(src, TRAIT_NOBLOOD)) // NON-MODULE CHANGE
return

var/base_bleed_rate = get_bleed_rate()
var/base_brute = getBruteLoss()

var/brute_ratio = round(base_brute / (maxHealth * 4), 0.1)
var/bleeding_rate = round(base_bleed_rate / 4, 0.1)
// we only leave a trail if we're below a certain blood threshold
// the more brute damage we have, or the more we're bleeding, the less blood we need to leave a trail
if(blood_volume < max(BLOOD_VOLUME_NORMAL * (1 - max(bleeding_rate, brute_ratio)), 0))
/**
* Leaves a trail of blood.
*
* This is on the atom level so you can have arbitrary objects leave "blood trails" if desired,
* you just need to pass a blood_dna.
*
* Arguments:
* * target_turf - The turf where the blood trail will be made
* * start - The turf where the mob started moving from
* * was_facing - The direction the mob was facing before moving
* * movement_direction - The direction the mob is moving towards
* * blood_to_add - The amount of blood to add to the trail
* * blood_dna - The DNA to add to the trail. Autoset for mobs.
* * static_viruses - The viruses to add to the trail
*/
/atom/proc/make_blood_trail(turf/target_turf, turf/start, was_facing, movement_direction, blood_to_add = BLOOD_AMOUNT_PER_DECAL * 0.1, blood_dna, list/static_viruses)
if(!has_gravity() || !isturf(start))
return

var/blood_to_add = BLOOD_AMOUNT_PER_DECAL * 0.1
if(body_position == LYING_DOWN)
blood_to_add += bleedDragAmount()
bleed(blood_to_add, drip = FALSE)
else
blood_to_add += base_bleed_rate
// if we're very damaged or bleeding a lot, add even more blood to the trail
if(base_brute >= 300 || base_bleed_rate >= 7)
blood_to_add *= 2
if(!islist(blood_dna))
CRASH("make_blood_trail called without a valid blood_dna list!")

var/trail_dir = REVERSE_DIR(movement_direction)
// the mob is performing a diagonal movement so we need to make a diagonal trail
Expand Down Expand Up @@ -1150,24 +1147,54 @@
break

if(isnull(trail))
trail = new(start, get_static_viruses())
trail = new(start, static_viruses)
if(QDELETED(trail))
return
trail.bloodiness = blood_to_add
else
trail.add_viruses(get_static_viruses())
trail.add_viruses(static_viruses)

// update the holder with our new dna and bloodiness
trail.add_mob_blood(src)
trail.add_blood_DNA(blood_dna)
trail.adjust_bloodiness(blood_to_add)
// also update the trail component, this is what matters for its appearance
var/obj/effect/decal/cleanable/blood/trail/trail_component = trail.add_dir_to_trail(trail_dir, blood_to_add)
if(isnull(trail_component))
return
trail_component.add_mob_blood(src)
trail_component.add_blood_DNA(blood_dna)
trail_component.adjust_bloodiness(blood_to_add)

/mob/living/carbon/human/make_blood_trail(turf/target_turf, turf/start, direction)
/mob/living/make_blood_trail(turf/target_turf, turf/start, was_facing, movement_direction, blood_to_add, blood_dna, list/static_viruses)
if(HAS_TRAIT(src, TRAIT_NOBLOOD))
return
var/base_bleed_rate = get_bleed_rate()
var/base_brute = getBruteLoss()

var/brute_ratio = round(base_brute / (maxHealth * 4), 0.1)
var/bleeding_rate = round(base_bleed_rate / 4, 0.1)
// we only leave a trail if we're below a certain blood threshold
// the more brute damage we have, or the more we're bleeding, the less blood we need to leave a trail
if(blood_volume < max(BLOOD_VOLUME_NORMAL * (1 - max(bleeding_rate, brute_ratio)), 0))
return

if(isnull(static_viruses))
static_viruses = get_static_viruses()
if(isnull(blood_dna))
blood_dna = get_blood_dna_list()
if(isnull(blood_to_add))
blood_to_add = BLOOD_AMOUNT_PER_DECAL * 0.1
blood_to_add += (body_position == LYING_DOWN) ? bleedDragAmount() : base_bleed_rate
// if we're very damaged or bleeding a lot, add even more blood to the trail
if(base_brute >= 300 || base_bleed_rate >= 7)
blood_to_add *= 2

// this is where people losing extra blood from being dragged is handled
if(body_position == LYING_DOWN)
bleed(blood_to_add, leave_pool = FALSE)

return ..()

/mob/living/carbon/human/make_blood_trail(turf/target_turf, turf/start, direction, blood_to_add, blood_dna, list/static_viruses)
if(!is_bleeding())
return
return ..()
Expand Down
Loading