Merge remote-tracking branch 'citadel/master' into combat_patches_1

This commit is contained in:
silicons
2021-07-18 15:12:52 -07:00
159 changed files with 132112 additions and 130447 deletions
+2 -1
View File
@@ -9,6 +9,7 @@
resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF
layer = ABOVE_NORMAL_TURF_LAYER
var/turf/target
var/acid_level = 0 // Removed from obj, so it goes here now
/obj/effect/acid/Initialize(mapload, acid_pwr, acid_amt)
@@ -42,7 +43,7 @@
for(var/obj/O in target)
if(prob(20) && !(resistance_flags & UNACIDABLE))
if(O.acid_level < acid_level*0.3)
if(O.acid_level() < acid_level*0.3)
var/acid_used = min(acid_level*0.05, 20)
O.acid_act(10, acid_used)
acid_level = max(0, acid_level - acid_used*10)
+53 -22
View File
@@ -24,55 +24,86 @@
var/range = 3
var/hits_left = 3
var/range_left = 3
var/firstmove = TRUE
var/list/hit
/obj/effect/decal/chempuff/blob_act(obj/structure/blob/B)
return
/obj/effect/decal/chempuff/Initialize(mapload, stream_mode, speed, range, hits_left)
/obj/effect/decal/chempuff/Initialize(mapload, stream_mode, speed, range, hits_left, size)
. = ..()
create_reagents(size, NONE, NO_REAGENTS_VALUE)
stream = stream_mode
src.speed = speed
src.range = src.range_left = range
src.hits_left = hits_left
hit = list()
/obj/effect/decal/chempuff/proc/hit_thing(atom/A)
/obj/effect/decal/chempuff/Destroy()
hit = null
return ..()
/// proc called to handle us hitting something
/obj/effect/decal/chempuff/proc/hit_thing(atom/A, bump_hit)
// if the thing is invisible it usually is abstract/underfloor. also, don't hit ourselves.
if(A == src || A.invisibility)
return
if(!hits_left)
// don't hit anything on the first move unless overridden (see: we're colliding a wall blocking our move out of the first tile)
if(firstmove && !bump_hit)
return
if(stream)
if(ismob(A))
var/mob/M = A
if(!M.lying || !range_left)
reagents.reaction(M, VAPOR)
hits_left--
else
if(!range_left)
reagents.reaction(A, VAPOR)
else
reagents.reaction(A)
if(ismob(A))
hits_left--
// we're out of hits or we already hit it
if(!hits_left || hit[A])
return
var/living = isliving(A)
// if it's not dense and we're a stream instead of a mist, and we're not out of range
if(!A.density && stream && range_left && !bump_hit)
return
// non living mobs are effectively abstract
if(ismob(A) && !living)
return
hit[A] = TRUE
reagents.reaction(A, VAPOR)
// mobs absorb enough to decrement hits_left, as well as stuff blocking us.
if(ismob(A) || bump_hit)
hits_left--
/obj/effect/decal/chempuff/Crossed(atom/movable/AM, oldloc)
. = ..()
// bump things moving into us as long as we're not on our first move/moving out of origin tile
hit_thing(AM)
/obj/effect/decal/chempuff/Bump(atom/A)
. = ..()
// if we hit something blocking our movement, collide it regardless even if we're still on our origin tile
hit_thing(A, TRUE)
/obj/effect/decal/chempuff/proc/run_puff(atom/target)
set waitfor = FALSE
for(var/i in 1 to range)
var/safety = 255
while(range_left)
if(!safety--)
CRASH("Spray ran out of safety.")
// move towards new turf
step_towards(src, target)
if(firstmove)
// mark first movement so future Cross()es result in collisions
firstmove = FALSE
// decrement range
range_left--
// if we got nullspaced, exit
if(!isturf(loc))
break
// hit everything in it
for(var/atom/T in loc)
hit_thing(T)
// if we got deleted or ran out of hits, stop
if(!hits_left || !isturf(loc))
break
if(hits_left && isturf(loc) && (!stream || !range_left))
reagents.reaction(loc, VAPOR)
hits_left--
if(!hits_left)
if(!hits_left || !isturf(loc))
// yeah yeah sue me it's copypasted code but I don't want to declare a var.
break
// hit the turf
hit_thing(loc)
sleep(speed)
qdel(src)
/obj/effect/decal/fakelattice
@@ -17,7 +17,7 @@
line = null
if(qdel_in)
QDEL_IN(PB, qdel_in)
d
/obj/effect/projectile/tracer
name = "beam"
icon = 'icons/obj/projectiles_tracer.dmi'