mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
[MIRROR] Footprint Sprites are BASED (on shoes and legs) (#26607)
* Footprint Sprites are BASED (on shoes and legs) * Update code/modules/mob/living/carbon/human/human.dm --------- Co-authored-by: 13spacemen <46101244+13spacemen@users.noreply.github.com> Co-authored-by: Pinta <68373373+softcerv@users.noreply.github.com>
This commit is contained in:
co-authored by
13spacemen
Pinta
parent
4faebd4d08
commit
c2754d77ba
@@ -21,6 +21,8 @@
|
||||
/// The world.time when we last picked up blood
|
||||
var/last_pickup
|
||||
|
||||
var/footprint_sprite = FOOTPRINT_SPRITE_SHOES
|
||||
|
||||
/datum/component/bloodysoles/Initialize()
|
||||
if(!isclothing(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
@@ -113,9 +115,9 @@
|
||||
/**
|
||||
* Find a blood decal on a turf that matches our last_blood_state
|
||||
*/
|
||||
/datum/component/bloodysoles/proc/find_pool_by_blood_state(turf/turfLoc, typeFilter = null)
|
||||
/datum/component/bloodysoles/proc/find_pool_by_blood_state(turf/turfLoc, typeFilter = null, footprint_sprite)
|
||||
for(var/obj/effect/decal/cleanable/blood/pool in turfLoc)
|
||||
if(pool.blood_state == last_blood_state && (!typeFilter || istype(pool, typeFilter)))
|
||||
if(pool.blood_state == last_blood_state && pool.footprint_sprite == footprint_sprite && (!typeFilter || istype(pool, typeFilter)))
|
||||
return pool
|
||||
|
||||
/**
|
||||
@@ -171,23 +173,23 @@
|
||||
return
|
||||
|
||||
var/half_our_blood = bloody_shoes[last_blood_state] / 2
|
||||
|
||||
var/footprint_sprite = wielder.get_footprint_sprite()
|
||||
// Add footprints in old loc if we have enough cream
|
||||
if(half_our_blood >= BLOOD_FOOTPRINTS_MIN)
|
||||
var/turf/oldLocTurf = get_turf(OldLoc)
|
||||
var/obj/effect/decal/cleanable/blood/footprints/oldLocFP = find_pool_by_blood_state(oldLocTurf, /obj/effect/decal/cleanable/blood/footprints)
|
||||
var/obj/effect/decal/cleanable/blood/footprints/oldLocFP = find_pool_by_blood_state(oldLocTurf, /obj/effect/decal/cleanable/blood/footprints, footprint_sprite)
|
||||
if(oldLocFP)
|
||||
// Footprints found in the tile we left, add us to it
|
||||
add_parent_to_footprint(oldLocFP)
|
||||
if (!(oldLocFP.exited_dirs & wielder.dir))
|
||||
oldLocFP.exited_dirs |= wielder.dir
|
||||
oldLocFP.update_appearance()
|
||||
else if(find_pool_by_blood_state(oldLocTurf))
|
||||
else if(find_pool_by_blood_state(oldLocTurf, footprint_sprite = footprint_sprite))
|
||||
// No footprints in the tile we left, but there was some other blood pool there. Add exit footprints on it
|
||||
adjust_bloody_shoes(last_blood_state, half_our_blood)
|
||||
update_icon()
|
||||
|
||||
oldLocFP = new(oldLocTurf)
|
||||
oldLocFP = new(oldLocTurf, footprint_sprite)
|
||||
if(!QDELETED(oldLocFP)) ///prints merged
|
||||
oldLocFP.blood_state = last_blood_state
|
||||
oldLocFP.exited_dirs |= wielder.dir
|
||||
@@ -207,7 +209,7 @@
|
||||
adjust_bloody_shoes(last_blood_state, half_our_blood)
|
||||
update_icon()
|
||||
|
||||
var/obj/effect/decal/cleanable/blood/footprints/FP = new(get_turf(parent_atom))
|
||||
var/obj/effect/decal/cleanable/blood/footprints/FP = new(get_turf(parent_atom), footprint_sprite)
|
||||
if(!QDELETED(FP)) ///prints merged
|
||||
FP.blood_state = last_blood_state
|
||||
FP.entered_dirs |= wielder.dir
|
||||
@@ -266,7 +268,8 @@
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
parent_atom = parent
|
||||
wielder = parent
|
||||
|
||||
if(footprint_sprite)
|
||||
src.footprint_sprite = footprint_sprite
|
||||
if(!bloody_feet)
|
||||
bloody_feet = mutable_appearance('icons/effects/blood.dmi', "shoeblood", SHOES_LAYER)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user