[MIRROR] Replace some turf in range() with RANGETURFS and fix(?) bspace trauma (#4070)

* Replace some turf in range() with RANGETURFS and fix(?) bspace trauma (#57566)

* Replace some turf in range() with RANGETURFS and fix(?) bspace trauma

Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-03-11 13:44:28 +01:00
committed by GitHub
co-authored by TiviPlus
parent adf3a9ba9a
commit e85f8a4486
19 changed files with 35 additions and 36 deletions
+1 -1
View File
@@ -142,7 +142,7 @@
var/list/turfs = new/list()
var/rsq = radius * (radius+0.5)
for(var/turf/T in range(radius, centerturf))
for(var/turf/T as anything in RANGE_TURFS(radius, centerturf))
var/dx = T.x - centerturf.x
var/dy = T.y - centerturf.y
if(dx*dx + dy*dy <= rsq)
+1 -1
View File
@@ -62,7 +62,7 @@
COOLDOWN_START(src, portal_cooldown, 10 SECONDS)
var/list/turf/possible_turfs = list()
for(var/turf/T in range(owner, 8))
for(var/turf/T as anything in RANGE_TURFS(8, owner))
if(T.density)
continue
+1 -1
View File
@@ -167,7 +167,7 @@
if(!precision)
return list(center)
var/list/posturfs = list()
for(var/turf/T in range(precision,center))
for(var/turf/T as anything in RANGE_TURFS(precision,center))
if(T.is_transition_turf())
continue // Avoid picking these.
var/area/A = T.loc
+1 -4
View File
@@ -38,10 +38,7 @@
A.say("TORNADO SWEEP!", forced="plasma fist")
dance_rotate(A, CALLBACK(GLOBAL_PROC, .proc/playsound, A.loc, 'sound/weapons/punch1.ogg', 15, TRUE, -1))
var/obj/effect/proc_holder/spell/aoe_turf/repulse/R = new(null)
var/list/turfs = list()
for(var/turf/T in range(1,A))
turfs.Add(T)
R.cast(turfs)
R.cast(RANGE_TURFS(1,A))
log_combat(A, D, "tornado sweeped(Plasma Fist)")
return
+1 -1
View File
@@ -137,7 +137,7 @@
update_appearance()
move_resist = INFINITY
for(var/turf/target_tile in range(shield_range, src))
for(var/turf/target_tile as anything in RANGE_TURFS(shield_range, src))
if(isspaceturf(target_tile) && !(locate(/obj/structure/emergency_shield) in target_tile))
if(!(machine_stat & BROKEN) || prob(33))
deployed_shields += new /obj/structure/emergency_shield(target_tile)
+1 -1
View File
@@ -117,7 +117,7 @@
/obj/item/areaeditor/blueprints/proc/get_images(turf/T, viewsize)
. = list()
for(var/turf/TT in range(viewsize, T))
for(var/turf/TT in RANGE_TURFS(viewsize, T))
if(TT.blueprint_data)
. += TT.blueprint_data
@@ -94,7 +94,7 @@ GLOBAL_LIST_INIT(tendrils, list())
shake_camera(M, 15, 1)
playsound(get_turf(src),'sound/effects/explosionfar.ogg', 200, TRUE)
visible_message("<span class='boldannounce'>The tendril falls inward, the ground around it widening into a yawning chasm!</span>")
for(var/turf/T in range(2,src))
for(var/turf/T in RANGE_TURFS(2,src))
if(!T.density)
T.TerraformTurf(/turf/open/chasm/lavaland, /turf/open/chasm/lavaland, flags = CHANGETURF_INHERIT_AIR)
qdel(src)
@@ -48,7 +48,7 @@
///Draws a rune on a selected turf
/obj/item/forbidden_book/proc/draw_rune(atom/target,mob/user)
for(var/turf/T in range(1,target))
for(var/turf/T as anything in RANGE_TURFS(1,target))
if(is_type_in_typecache(T, blacklisted_turfs))
to_chat(user, "<span class='warning'>The terrain doesn't support runes!</span>")
return
@@ -457,7 +457,7 @@
. = ..()
if(!has_fire_ring)
return
for(var/turf/T in range(1,current_user))
for(var/turf/T in RANGE_TURFS(1,current_user))
new /obj/effect/hotspot(T)
T.hotspot_expose(700, 250 * delta_time, 1)
for(var/mob/living/livies in T.contents - current_user)
@@ -143,7 +143,8 @@
if(!target)
return
target.visible_message("<span class='boldwarning'>Fire rains from the sky!</span>")
for(var/turf/turf in range(9,get_turf(target)))
var/turf/targetturf = get_turf(target)
for(var/turf/turf as anything in RANGE_TURFS(9,targetturf))
if(prob(11))
new /obj/effect/temp_visual/target(turf)
@@ -441,7 +441,7 @@
for(var/mob/living/L in range(aoe_mob_range, epicenter)) //handle aoe mob damage
L.adjustFireLoss(aoe_mob_damage)
to_chat(L, "<span class='userdanger'>\The [src] sears you!</span>")
for(var/turf/T in range(aoe_fire_range, epicenter)) //handle aoe fire
for(var/turf/T in RANGE_TURFS(aoe_fire_range, epicenter)) //handle aoe fire
if(prob(aoe_fire_chance))
new /obj/effect/hotspot(T)
for(var/obj/O in range(aoe_structure_range, epicenter))
@@ -30,7 +30,7 @@
var/throwtarget = get_edge_target_turf(src, get_dir(src, get_step_away(A, src)))
A.safe_throw_at(throwtarget,power+1,1, force = MOVE_FORCE_EXTREMELY_STRONG)
thrown_items[A] = A
for(var/turf/F in range(T,power))
for(var/turf/F in RANGE_TURFS(power, T))
new /obj/effect/temp_visual/gravpush(F)
/obj/projectile/gravityattract
@@ -64,7 +64,7 @@
continue
A.safe_throw_at(T, power+1, 1, force = MOVE_FORCE_EXTREMELY_STRONG)
thrown_items[A] = A
for(var/turf/F in range(T,power))
for(var/turf/F in RANGE_TURFS(power, T))
new /obj/effect/temp_visual/gravpush(F)
/obj/projectile/gravitychaos
@@ -98,5 +98,5 @@
continue
A.safe_throw_at(get_edge_target_turf(A, pick(GLOB.cardinals)), power+1, 1, force = MOVE_FORCE_EXTREMELY_STRONG)
thrown_items[A] = A
for(var/turf/Z in range(T,power))
for(var/turf/Z as anything in RANGE_TURFS(power,T))
new /obj/effect/temp_visual/gravpush(Z)
@@ -67,7 +67,7 @@
else if(prob(reac_volume))
target_floor.burn_tile()
if(isfloorturf(target_floor))
for(var/turf/nearby_turf in range(1, target_floor))
for(var/turf/nearby_turf in RANGE_TURFS(1, target_floor))
if(!locate(/obj/effect/hotspot) in nearby_turf)
new /obj/effect/hotspot(nearby_turf)
+1 -1
View File
@@ -430,7 +430,7 @@
if(fire_range == 0)
new /obj/effect/hotspot(location)
return
for(var/turf/turf as anything in range(fire_range, location))
for(var/turf/turf as anything in RANGE_TURFS(fire_range, location))
new /obj/effect/hotspot(turf)
///////////END FIRE BASED EXPLOSIONS
@@ -73,8 +73,8 @@
/datum/chemical_reaction/reagent_explosion/rdx_explosion2/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume)
var/fire_range = round(created_volume/30)
var/turf/T = get_turf(holder.my_atom)
for(var/turf/turf in range(fire_range,T))
new /obj/effect/hotspot(turf)
for(var/turf/target as anything in RANGE_TURFS(fire_range,T))
new /obj/effect/hotspot(target)
holder.chem_temp = 500
..()
@@ -87,7 +87,7 @@
/datum/chemical_reaction/reagent_explosion/rdx_explosion3/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume)
var/fire_range = round(created_volume/20)
var/turf/T = get_turf(holder.my_atom)
for(var/turf/turf in range(fire_range,T))
for(var/turf/turf as anything in RANGE_TURFS(fire_range,T))
new /obj/effect/hotspot(turf)
holder.chem_temp = 750
..()
@@ -232,8 +232,8 @@
/datum/chemical_reaction/clf3/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume)
var/turf/T = get_turf(holder.my_atom)
for(var/turf/turf in range(1,T))
new /obj/effect/hotspot(turf)
for(var/turf/target as anything in RANGE_TURFS(1,T))
new /obj/effect/hotspot(target)
holder.chem_temp = 1000 // hot as shit
/datum/chemical_reaction/reagent_explosion/methsplosion
@@ -246,8 +246,8 @@
/datum/chemical_reaction/reagent_explosion/methsplosion/on_reaction(datum/equilibrium/reaction, datum/reagents/holder, created_volume)
var/turf/T = get_turf(holder.my_atom)
for(var/turf/turf in range(1,T))
new /obj/effect/hotspot(turf)
for(var/turf/target in RANGE_TURFS(1,T))
new /obj/effect/hotspot(target)
holder.chem_temp = 1000 // hot as shit
..()
@@ -42,7 +42,8 @@ Charged extracts:
effect_desc = "Instantly makes a large burst of flame for a moment."
/obj/item/slimecross/charged/orange/do_effect(mob/user)
for(var/turf/turf in range(5,get_turf(user)))
var/turf/targetturf = get_turf(user)
for(var/turf/turf as anything in RANGE_TURFS(5,targetturf))
if(!locate(/obj/effect/hotspot) in turf)
new /obj/effect/hotspot(turf)
..()
@@ -43,9 +43,9 @@ Regenerative extracts:
/obj/item/slimecross/regenerative/orange/core_effect_before(mob/living/target, mob/user)
target.visible_message("<span class='warning'>The [src] boils over!</span>")
for(var/turf/turf in range(1,target))
if(!locate(/obj/effect/hotspot) in turf)
new /obj/effect/hotspot(turf)
for(var/turf/targetturf in RANGE_TURFS(1,target))
if(!locate(/obj/effect/hotspot) in targetturf)
new /obj/effect/hotspot(targetturf)
/obj/item/slimecross/regenerative/purple
colour = "purple"
@@ -15,8 +15,8 @@
playsound(get_turf(user), sound1, 50,TRUE)
for(var/mob/living/target in targets)
var/list/turfs = new/list()
for(var/turf/T in range(target,outer_tele_radius))
if(T in range(target,inner_tele_radius))
for(var/turf/T as anything in RANGE_TURFS(outer_tele_radius, target))
if(T in RANGE_TURFS(inner_tele_radius, target))
continue
if(isspaceturf(T) && !include_space)
continue
@@ -30,8 +30,8 @@
if(!turfs.len)
var/list/turfs_to_pick_from = list()
for(var/turf/T in orange(target,outer_tele_radius))
if(!(T in orange(target,inner_tele_radius)))
for(var/turf/T as anything in RANGE_TURFS(outer_tele_radius, target))
if(!(T in RANGE_TURFS(inner_tele_radius, target)))
turfs_to_pick_from += T
turfs += pick(/turf in turfs_to_pick_from)
+2 -2
View File
@@ -109,7 +109,7 @@
/obj/machinery/door/swarmer_act(mob/living/simple_animal/hostile/swarmer/actor)
var/isonshuttle = istype(get_area(src), /area/shuttle)
for(var/turf/turf_in_range in range(1, src))
for(var/turf/turf_in_range as anything in RANGE_TURFS(1, src))
var/area/turf_area = get_area(turf_in_range)
//Check for dangerous pressure differences
if (turf_in_range.return_turf_delta_p() > DANGEROUS_DELTA_P)
@@ -193,7 +193,7 @@
/turf/closed/wall/swarmer_act(mob/living/simple_animal/hostile/swarmer/actor)
var/isonshuttle = istype(loc, /area/shuttle)
for(var/turf/turf_in_range in range(1, src))
for(var/turf/turf_in_range as anything in RANGE_TURFS(1, src))
var/area/turf_area = get_area(turf_in_range)
if (turf_in_range.return_turf_delta_p() > DANGEROUS_DELTA_P)
to_chat(actor, "<span class='warning'>Destroying this object has the potential to cause an explosive pressure release. Aborting.</span>")