mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 09:54:52 +00:00
Merge pull request #31809 from ShizCalev/helper-cleanup
Cleans up some istypes not using helpers
This commit is contained in:
@@ -31,6 +31,8 @@
|
||||
|
||||
#define islava(A) (istype(A, /turf/open/lava))
|
||||
|
||||
#define ischasm(A) (istype(A, /turf/open/chasm))
|
||||
|
||||
#define isplatingturf(A) (istype(A, /turf/open/floor/plating))
|
||||
|
||||
//Mobs
|
||||
|
||||
@@ -59,14 +59,14 @@ SUBSYSTEM_DEF(persistence)
|
||||
path = text2path(old_secret_satchels[pos]["saved_obj"])
|
||||
|
||||
if(F)
|
||||
if(isfloorturf(F.loc) && !istype(F.loc, /turf/open/floor/plating/))
|
||||
if(isfloorturf(F.loc) && !isplatingturf(F.loc))
|
||||
F.hide(1)
|
||||
if(ispath(path))
|
||||
new path(F)
|
||||
placed_satchel++
|
||||
var/free_satchels = 0
|
||||
for(var/turf/T in shuffle(block(locate(TRANSITIONEDGE,TRANSITIONEDGE,ZLEVEL_STATION_PRIMARY), locate(world.maxx-TRANSITIONEDGE,world.maxy-TRANSITIONEDGE,ZLEVEL_STATION_PRIMARY)))) //Nontrivially expensive but it's roundstart only
|
||||
if(isfloorturf(T) && !istype(T, /turf/open/floor/plating/))
|
||||
if(isfloorturf(T) && !isplatingturf(T))
|
||||
new /obj/item/storage/backpack/satchel/flat/secret(T)
|
||||
free_satchels++
|
||||
if((free_satchels + placed_satchel) == 10) //ten tiles, more than enough to kill anything that moves
|
||||
|
||||
@@ -206,7 +206,7 @@
|
||||
continue
|
||||
|
||||
if(extended_safety_checks)
|
||||
if(istype(F, /turf/open/lava)) //chasms aren't /floor, and so are pre-filtered
|
||||
if(islava(F)) //chasms aren't /floor, and so are pre-filtered
|
||||
var/turf/open/lava/L = F
|
||||
if(!L.is_safe())
|
||||
continue
|
||||
|
||||
@@ -261,7 +261,7 @@
|
||||
var/turf/next = get_step(ridden, direction)
|
||||
var/turf/current = get_turf(ridden)
|
||||
|
||||
if(istype(next, /turf/open/lava) || istype(current, /turf/open/lava)) //We can move from land to lava, or lava to land, but not from land to land
|
||||
if(islava(next) || islava(current)) //We can move from land to lava, or lava to land, but not from land to land
|
||||
..()
|
||||
else
|
||||
to_chat(user, "Boats don't go on land!")
|
||||
|
||||
@@ -241,7 +241,7 @@
|
||||
if(T.flags_1 & NOJAUNT_1)
|
||||
T.flags_1 &= ~NOJAUNT_1
|
||||
new /obj/effect/temp_visual/revenant(T)
|
||||
if(!istype(T, /turf/open/floor/plating) && !istype(T, /turf/open/floor/engine/cult) && isfloorturf(T) && prob(15))
|
||||
if(!isplatingturf(T) && !istype(T, /turf/open/floor/engine/cult) && isfloorturf(T) && prob(15))
|
||||
var/turf/open/floor/floor = T
|
||||
if(floor.intact && floor.floor_tile)
|
||||
new floor.floor_tile(floor)
|
||||
|
||||
@@ -391,7 +391,7 @@
|
||||
/obj/item/mecha_parts/mecha_equipment/cable_layer/proc/dismantleFloor(var/turf/new_turf)
|
||||
if(isfloorturf(new_turf))
|
||||
var/turf/open/floor/T = new_turf
|
||||
if(!istype(T, /turf/open/floor/plating))
|
||||
if(!isplatingturf(T))
|
||||
if(!T.broken && !T.burnt)
|
||||
new T.floor_tile(T)
|
||||
T.make_plating()
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
/obj/effect/decal/HandleTurfChange(turf/T)
|
||||
..()
|
||||
if(T == loc && (isspaceturf(T) || isclosedturf(T) || islava(T) || istype(T, /turf/open/water) || istype(T, /turf/open/chasm)))
|
||||
if(T == loc && (isspaceturf(T) || isclosedturf(T) || islava(T) || istype(T, /turf/open/water) || ischasm(T)))
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/turf_decal
|
||||
|
||||
@@ -309,7 +309,7 @@
|
||||
/obj/item/storage/backpack/satchel/flat/secret/Initialize()
|
||||
. = ..()
|
||||
|
||||
if(isfloorturf(loc) && !istype(loc, /turf/open/floor/plating/))
|
||||
if(isfloorturf(loc) && !isplatingturf(loc))
|
||||
hide(1)
|
||||
|
||||
/obj/item/storage/backpack/satchel/flat/secret/hide(intact)
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
var/turf/T = loc
|
||||
if(istype(T))
|
||||
if(istype(T, /turf/open/lava))
|
||||
if(islava(T))
|
||||
environment_temperature = 5000
|
||||
else if(T.blocks_air)
|
||||
environment_temperature = T.temperature
|
||||
|
||||
@@ -287,11 +287,11 @@
|
||||
anchored = TRUE
|
||||
if(PLACE_TILE)
|
||||
F = scan_target
|
||||
if(istype(F, /turf/open/floor/plating)) //The floor must not already have a tile.
|
||||
if(isplatingturf(F)) //The floor must not already have a tile.
|
||||
result = F
|
||||
if(REPLACE_TILE)
|
||||
F = scan_target
|
||||
if(isfloorturf(F) && !istype(F, /turf/open/floor/plating)) //The floor must already have a tile.
|
||||
if(isfloorturf(F) && !isplatingturf(F)) //The floor must already have a tile.
|
||||
result = F
|
||||
if(FIX_TILE) //Selects only damaged floors.
|
||||
F = scan_target
|
||||
@@ -299,7 +299,7 @@
|
||||
result = F
|
||||
if(TILE_EMAG) //Emag mode! Rip up the floor and cause breaches to space!
|
||||
F = scan_target
|
||||
if(!istype(F, /turf/open/floor/plating))
|
||||
if(!isplatingturf(F))
|
||||
result = F
|
||||
else //If no special processing is needed, simply return the result.
|
||||
result = scan_target
|
||||
@@ -329,7 +329,7 @@
|
||||
else
|
||||
var/turf/open/floor/F = target_turf
|
||||
|
||||
if(F.type != initial(tiletype.turf_type) && (F.broken || F.burnt || istype(F, /turf/open/floor/plating)) || F.type == (initial(tiletype.turf_type) && (F.broken || F.burnt)))
|
||||
if(F.type != initial(tiletype.turf_type) && (F.broken || F.burnt || isplatingturf(F)) || F.type == (initial(tiletype.turf_type) && (F.broken || F.burnt)))
|
||||
anchored = TRUE
|
||||
icon_state = "floorbot-c"
|
||||
mode = BOT_REPAIRING
|
||||
@@ -340,7 +340,7 @@
|
||||
F.burnt = 0
|
||||
F.ChangeTurf(/turf/open/floor/plasteel)
|
||||
|
||||
if(replacetiles && F.type != initial(tiletype.turf_type) && specialtiles && !istype(F, /turf/open/floor/plating))
|
||||
if(replacetiles && F.type != initial(tiletype.turf_type) && specialtiles && !isplatingturf(F))
|
||||
anchored = TRUE
|
||||
icon_state = "floorbot-c"
|
||||
mode = BOT_REPAIRING
|
||||
|
||||
@@ -93,7 +93,7 @@ Difficulty: Medium
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner/Move(atom/newloc)
|
||||
if(dashing || (newloc && newloc.z == z && (istype(newloc, /turf/open/lava) || istype(newloc, /turf/open/chasm)))) //we're not stupid!
|
||||
if(dashing || (newloc && newloc.z == z && (islava(newloc) || ischasm(newloc)))) //we're not stupid!
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
@@ -186,7 +186,7 @@ Difficulty: Medium
|
||||
var/turf_dist_to_target = 0
|
||||
if(!QDELETED(dash_target))
|
||||
turf_dist_to_target += get_dist(dash_target, O)
|
||||
if(get_dist(src, O) >= MINER_DASH_RANGE && turf_dist_to_target <= self_dist_to_target && !istype(O, /turf/open/lava) && !istype(O, /turf/open/chasm))
|
||||
if(get_dist(src, O) >= MINER_DASH_RANGE && turf_dist_to_target <= self_dist_to_target && !islava(O) && !ischasm(O))
|
||||
var/valid = TRUE
|
||||
for(var/turf/T in getline(own_turf, O))
|
||||
if(is_blocked_turf(T, TRUE))
|
||||
|
||||
@@ -137,14 +137,14 @@ GLOBAL_LIST_INIT(AISwarmerCapsByType, list(/mob/living/simple_animal/hostile/swa
|
||||
/mob/living/simple_animal/hostile/swarmer/ai/Move(atom/newloc)
|
||||
if(newloc)
|
||||
if(newloc.z == z) //so these actions are Z-specific
|
||||
if(istype(newloc, /turf/open/lava))
|
||||
if(islava(newloc))
|
||||
var/turf/open/lava/L = newloc
|
||||
if(!L.is_safe())
|
||||
StartAction(20)
|
||||
new /obj/structure/lattice/catwalk/swarmer_catwalk(newloc)
|
||||
return FALSE
|
||||
|
||||
if(istype(newloc, /turf/open/chasm) && !throwing)
|
||||
if(ischasm(newloc) && !throwing)
|
||||
throw_at(get_edge_target_turf(src, get_dir(src, newloc)), 7 , 3, spin = FALSE) //my planet needs me
|
||||
return FALSE
|
||||
|
||||
|
||||
@@ -509,7 +509,7 @@
|
||||
if(wall_pierce++ < wall_pierce_amount)
|
||||
loc = target
|
||||
if(prob(wall_devastate))
|
||||
if(istype(target, /turf/closed/wall))
|
||||
if(iswallturf(target))
|
||||
var/turf/closed/wall/W = target
|
||||
W.dismantle_wall(TRUE, TRUE)
|
||||
else
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
|
||||
/obj/item/projectile/proc/on_hit(atom/target, blocked = FALSE)
|
||||
var/turf/target_loca = get_turf(target)
|
||||
if(!nodamage && (damage_type == BRUTE || damage_type == BURN) && istype(target_loca, /turf/closed/wall) && prob(75))
|
||||
if(!nodamage && (damage_type == BRUTE || damage_type == BURN) && iswallturf(target_loca) && prob(75))
|
||||
var/turf/closed/wall/W = target_loca
|
||||
var/mutable_appearance/decal = mutable_appearance('icons/effects/effects.dmi', "bullet_hole", TURF_DECAL_LAYER)
|
||||
if(target == original)
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
OpenDoor(target)
|
||||
else
|
||||
var/turf/T = get_turf(target)
|
||||
if(isclosedturf(T) && !istype(T, /turf/closed/indestructible))
|
||||
if(isclosedturf(T) && !isindestructiblewall(T))
|
||||
CreateDoor(T)
|
||||
|
||||
/obj/item/projectile/magic/door/proc/CreateDoor(turf/T)
|
||||
|
||||
@@ -1330,7 +1330,7 @@
|
||||
taste_description = "carpet" // Your tounge feels furry.
|
||||
|
||||
/datum/reagent/carpet/reaction_turf(turf/T, reac_volume)
|
||||
if(istype(T, /turf/open/floor/plating) || istype(T, /turf/open/floor/plasteel))
|
||||
if(isplatingturf(T) || istype(T, /turf/open/floor/plasteel))
|
||||
var/turf/open/floor/F = T
|
||||
F.ChangeTurf(/turf/open/floor/carpet)
|
||||
..()
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
. = 1
|
||||
|
||||
/datum/reagent/clf3/reaction_turf(turf/T, reac_volume)
|
||||
if(istype(T, /turf/open/floor/plating))
|
||||
if(isplatingturf(T))
|
||||
var/turf/open/floor/plating/F = T
|
||||
if(prob(10 + F.burnt + 5*F.broken)) //broken or burnt plating is more susceptible to being destroyed
|
||||
F.ChangeTurf(F.baseturf)
|
||||
|
||||
@@ -263,7 +263,7 @@ GLOBAL_DATUM(necropolis_gate, /obj/structure/necropolis_gate/legion_gate)
|
||||
if(falling || fallen)
|
||||
return
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(T, /turf/open/lava) && !istype(T, /turf/open/chasm)) //nothing to sink or fall into
|
||||
if(!islava(T) && !ischasm(T)) //nothing to sink or fall into
|
||||
return
|
||||
var/obj/item/I
|
||||
if(istype(AM, /obj/item))
|
||||
|
||||
Reference in New Issue
Block a user