on second thought, let's not try to half ass fancy ideas.
This commit is contained in:
@@ -492,14 +492,6 @@ Turf and target are separate in case you want to teleport some distance from a t
|
||||
assembled += A
|
||||
return assembled
|
||||
|
||||
//Return a list of atoms in a location of a given type. Can be refined to look for pixel-shift.
|
||||
/proc/get_atoms_of_type(var/atom/here, var/type, var/check_shift, var/shift_x = 0, var/shift_y = 0)
|
||||
. = list()
|
||||
if(here)
|
||||
for(var/atom/thing in here)
|
||||
if(istype(thing, type) && (check_shift && thing.pixel_x == shift_x && thing.pixel_y == shift_y))
|
||||
. += thing
|
||||
|
||||
//Step-towards method of determining whether one atom can see another. Similar to viewers()
|
||||
/proc/can_see(atom/source, atom/target, length=5) // I couldnt be arsed to do actual raycasting :I This is horribly inaccurate.
|
||||
var/turf/current = get_turf(source)
|
||||
@@ -764,30 +756,6 @@ Turf and target are separate in case you want to teleport some distance from a t
|
||||
loc = loc.loc
|
||||
return null
|
||||
|
||||
/proc/pixel_shift_dir(var/dir, var/amount_x = 32, var/amount_y = 32) //Returns a list with pixel_shift values that will shift an object's icon one tile in the direction passed.
|
||||
amount_x = min(max(0, amount_x), 32) //No less than 0, no greater than 32.
|
||||
amount_y = min(max(0, amount_x), 32)
|
||||
var/list/shift = list("x" = 0, "y" = 0)
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
shift["y"] = amount_y
|
||||
if(SOUTH)
|
||||
shift["y"] = -amount_y
|
||||
if(EAST)
|
||||
shift["x"] = amount_x
|
||||
if(WEST)
|
||||
shift["x"] = -amount_x
|
||||
if(NORTHEAST)
|
||||
shift = list("x" = amount_x, "y" = amount_y)
|
||||
if(NORTHWEST)
|
||||
shift = list("x" = -amount_x, "y" = amount_y)
|
||||
if(SOUTHEAST)
|
||||
shift = list("x" = amount_x, "y" = -amount_y)
|
||||
if(SOUTHWEST)
|
||||
shift = list("x" = -amount_x, "y" = -amount_y)
|
||||
|
||||
return shift
|
||||
|
||||
//For objects that should embed, but make no sense being is_sharp or is_pointed()
|
||||
//e.g: rods
|
||||
GLOBAL_LIST_INIT(can_embed_types, typecacheof(list(
|
||||
|
||||
@@ -34,7 +34,7 @@ GLOBAL_LIST_EMPTY(rubber_toolbox_icons)
|
||||
/obj/item/storage/toolbox/update_icon()
|
||||
..()
|
||||
cut_overlays()
|
||||
if(blood_DNA.len)
|
||||
if(blood_DNA && blood_DNA.len)
|
||||
add_blood_overlay()
|
||||
if(has_latches)
|
||||
var/icon/I = icon('icons/obj/storage.dmi', latches)
|
||||
|
||||
@@ -267,7 +267,7 @@
|
||||
. = safe
|
||||
|
||||
//to add a splatter of blood or other mob liquid.
|
||||
/mob/living/proc/add_splatter_floor(turf/T, small_drip, shift_x, shift_y)
|
||||
/mob/living/proc/add_splatter_floor(turf/T, small_drip)
|
||||
if(get_blood_id() == null)
|
||||
return
|
||||
if(!T)
|
||||
@@ -298,10 +298,6 @@
|
||||
|
||||
// Find a blood decal or create a new one.
|
||||
var/obj/effect/decal/cleanable/blood/splats/B = locate() in T
|
||||
var/list/bloods = get_atoms_of_type(T, B, TRUE, 0, 0) //Get all the non-projectile-splattered blood on this turf (not pixel-shifted).
|
||||
if(shift_x || shift_y)
|
||||
bloods = get_atoms_of_type(T, B, TRUE, shift_x, shift_y) //Get all the projectile-splattered blood at these pixels on this turf (pixel-shifted).
|
||||
B = locate() in bloods
|
||||
if(!B)
|
||||
B = new /obj/effect/decal/cleanable/blood/splats(T, get_static_viruses())
|
||||
if(B.bloodiness < MAX_SHOE_BLOODINESS) //add more blood, up to a limit
|
||||
@@ -310,12 +306,6 @@
|
||||
src.transfer_blood_to(B, 10) //very heavy bleeding, should logically leave larger pools
|
||||
if(temp_blood_DNA)
|
||||
B.blood_DNA |= temp_blood_DNA
|
||||
B.pixel_x = (shift_x)
|
||||
B.pixel_y = (shift_y)
|
||||
B.update_icon()
|
||||
if(shift_x || shift_y)
|
||||
B.layer = BELOW_MOB_LAYER //So the blood lands ontop of things like posters, windows, etc.
|
||||
|
||||
|
||||
/mob/living/carbon/human/add_splatter_floor(turf/T, small_drip)
|
||||
if(!(NOBLOOD in dna.species.species_traits))
|
||||
@@ -351,6 +341,7 @@
|
||||
if(B.bloodiness < MAX_SHOE_BLOODINESS) //add more blood, up to a limit
|
||||
B.bloodiness += BLOOD_AMOUNT_PER_DECAL
|
||||
B.transfer_mob_blood_dna(src) //give blood info to the blood decal.
|
||||
src.transfer_blood_to(B, 10) //very heavy bleeding, should logically leave larger pools
|
||||
if(temp_blood_DNA)
|
||||
B.blood_DNA |= temp_blood_DNA
|
||||
|
||||
|
||||
@@ -194,17 +194,8 @@
|
||||
C.bleed(damage)
|
||||
|
||||
if(prob(33))
|
||||
var/list/shift = list("x" = 0, "y" = 0)
|
||||
var/turf/step_over = get_step(target_loca, splatter_dir)
|
||||
L.add_splatter_floor(target_loca)
|
||||
|
||||
if(get_splatter_blockage(step_over, target, splatter_dir, target_loca)) //If you can't cross the tile or any of its relevant obstacles...
|
||||
shift = pixel_shift_dir(splatter_dir) //Pixel shift the blood there instead (so you can't see wallsplatter through walls).
|
||||
else
|
||||
target_loca = step_over
|
||||
L.add_splatter_floor(target_loca, shift_x = shift["x"], shift_y = shift["y"])
|
||||
if(ishuman(L))
|
||||
for(var/mob/living/carbon/human/M in step_over) //Bloody the mobs who're infront of the spray.
|
||||
M.bloody_hands = rand(2, 4)
|
||||
|
||||
else if(impact_effect_type && !hitscan)
|
||||
new impact_effect_type(target_loca, hitx, hity)
|
||||
@@ -240,10 +231,6 @@
|
||||
|
||||
return L.apply_effects(stun, knockdown, unconscious, irradiate, slur, stutter, eyeblur, drowsy, blocked, stamina, jitter)
|
||||
|
||||
/obj/item/projectile/proc/get_splatter_blockage(var/turf/step_over, var/atom/target, var/splatter_dir, var/target_loca) //Check whether the place we want to splatter blood is blocked (i.e. by windows).
|
||||
if(step_over.density && !step_over.CanPass(target, step_over, 1)) //Preliminary simple check.
|
||||
return TRUE
|
||||
|
||||
/obj/item/projectile/proc/vol_by_damage()
|
||||
if(src.damage)
|
||||
return CLAMP((src.damage) * 0.67, 30, 100)// Multiply projectile damage by 0.67, then CLAMP the value between 30 and 100
|
||||
|
||||
Reference in New Issue
Block a user