Assorted tweaks & fixes (#3305)

changes:

Fixed #3203.
Tajara or Unathi CEs now get gloves that actually fit them.
OOs now respect direction changes from their mimicked object.
Replaced all references to trange() with RANGE_TURFS().
Replaced all references to is_type_in_oview() with locate() in oview().
Fixed a runtime caused by recursive explosions falling off the edges of the map.
Carp despawn now works properly with the new asteroid turfs.
Carp despawn now uses WEAKREF instead of SOFTREF.
Added tick-checks to the carp migration event.
Vaurca now have the IS_VAURCA reagent_tag.
Cleaned up butanol alien handling a bit.
This commit is contained in:
Lohikar
2017-08-20 14:10:15 +03:00
committed by Erki
parent 9dd650b7a9
commit f3ad54e8aa
20 changed files with 80 additions and 76 deletions
+18 -9
View File
@@ -174,7 +174,12 @@ var/datum/controller/subsystem/explosives/SSexplosives
var/y0 = epicenter.y
var/z0 = epicenter.z
for(var/turf/T in trange(max_range, epicenter))
for(var/thing in RANGE_TURFS(max_range, epicenter))
var/turf/T = thing
if (!T)
CHECK_TICK
continue
var/dist = sqrt((T.x - x0)**2 + (T.y - y0)**2)
if (dist < devastation_range)
@@ -184,6 +189,7 @@ var/datum/controller/subsystem/explosives/SSexplosives
else if (dist < light_impact_range)
dist = 3
else
CHECK_TICK
continue
T.ex_act(dist)
@@ -226,14 +232,14 @@ var/datum/controller/subsystem/explosives/SSexplosives
//This steap handles the gathering of turfs which will be ex_act() -ed in the next step. It also ensures each turf gets the maximum possible amount of power dealt to it.
for(var/direction in cardinal)
var/turf/T = get_step(epicenter, direction)
explosion_spread(T, power - epicenter.explosion_resistance, direction)
CHECK_TICK
if (T)
explosion_spread(T, power - epicenter.explosion_resistance, direction)
CHECK_TICK
//This step applies the ex_act effects for the explosion, as planned in the previous step.
for(var/turf/T in explosion_turfs)
if(explosion_turfs[T] <= 0)
continue
if(!T)
if(!T || explosion_turfs[T] <= 0)
CHECK_TICK
continue
//Wow severity looks confusing to calculate... Fret not, I didn't leave you with any additional instructions or help. (just kidding, see the line under the calculation)
@@ -270,11 +276,14 @@ var/datum/controller/subsystem/explosives/SSexplosives
spread_power -= O.explosion_resistance
var/turf/T = get_step(s, direction)
explosion_spread(T, spread_power, direction)
if (T)
explosion_spread(T, spread_power, direction)
T = get_step(s, turn(direction,90))
explosion_spread(T, spread_power, turn(direction,90))
if (T)
explosion_spread(T, spread_power, turn(direction,90))
T = get_step(s, turn(direction,-90))
explosion_spread(T, spread_power, turn(direction,90))
if (T)
explosion_spread(T, spread_power, turn(direction,90))
// Add an explosion to the queue for processing.
/datum/controller/subsystem/explosives/proc/queue(var/datum/explosiondata/data)