From 7fd59706007e283d89e0c8baf9cfe96fc46efc0e Mon Sep 17 00:00:00 2001
From: SabreML <57483089+SabreML@users.noreply.github.com>
Date: Sat, 30 Jan 2021 22:11:18 +0000
Subject: [PATCH] Immovable Rod Z-level fix (#15391)
* Rod fix
* Meteors and helpers
---
code/game/gamemodes/meteor/meteors.dm | 4 ++--
code/modules/events/immovable_rod.dm | 24 +++++++++++++-----------
2 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm
index f0f0fbda5fa..7c5d350436b 100644
--- a/code/game/gamemodes/meteor/meteors.dm
+++ b/code/game/gamemodes/meteor/meteors.dm
@@ -28,8 +28,8 @@ GLOBAL_LIST_INIT(meteors_ops, list(/obj/effect/meteor/goreops)) //Meaty Ops
var/max_i = 10//number of tries to spawn meteor.
while(!istype(pickedstart, /turf/space))
var/startSide = pick(GLOB.cardinal)
- pickedstart = spaceDebrisStartLoc(startSide, 1)
- pickedgoal = spaceDebrisFinishLoc(startSide, 1)
+ pickedstart = spaceDebrisStartLoc(startSide, level_name_to_num(MAIN_STATION))
+ pickedgoal = spaceDebrisFinishLoc(startSide, level_name_to_num(MAIN_STATION))
max_i--
if(max_i<=0)
return
diff --git a/code/modules/events/immovable_rod.dm b/code/modules/events/immovable_rod.dm
index 43252bd2000..bb4d3c940de 100644
--- a/code/modules/events/immovable_rod.dm
+++ b/code/modules/events/immovable_rod.dm
@@ -15,8 +15,8 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
/datum/event/immovable_rod/start()
var/startside = pick(GLOB.cardinal)
- var/turf/startT = spaceDebrisStartLoc(startside, 1)
- var/turf/endT = spaceDebrisFinishLoc(startside, 1)
+ var/turf/startT = spaceDebrisStartLoc(startside, level_name_to_num(MAIN_STATION))
+ var/turf/endT = spaceDebrisFinishLoc(startside, level_name_to_num(MAIN_STATION))
new /obj/effect/immovablerod/event(startT, endT)
/obj/effect/immovablerod
@@ -25,8 +25,8 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
icon = 'icons/obj/objects.dmi'
icon_state = "immrod"
throwforce = 100
- density = 1
- anchored = 1
+ density = TRUE
+ anchored = TRUE
var/z_original = 0
var/destination
var/notify = TRUE
@@ -41,9 +41,9 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
if(notify)
notify_ghosts("\A [src] is inbound!",
enter_link="(Click to follow)",
- source=src, action=NOTIFY_FOLLOW)
+ source = src, action = NOTIFY_FOLLOW)
GLOB.poi_list |= src
- if(end && end.z==z_original)
+ if(end?.z == z_original)
walk_towards(src, destination, move_delay)
/obj/effect/immovablerod/Topic(href, href_list)
@@ -67,21 +67,23 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
/obj/effect/immovablerod/Bump(atom/clong)
if(prob(10))
- playsound(src, 'sound/effects/bang.ogg', 50, 1)
+ playsound(src, 'sound/effects/bang.ogg', 50, TRUE)
audible_message("CLANG")
if(clong && prob(25))
x = clong.x
y = clong.y
- if(istype(clong, /turf) || istype(clong, /obj))
+ if(isturf(clong) || isobj(clong))
if(clong.density)
clong.ex_act(2)
- else if(istype(clong, /mob))
- if(istype(clong, /mob/living/carbon/human))
+ else if(ismob(clong))
+ if(ishuman(clong))
var/mob/living/carbon/human/H = clong
- H.visible_message("[H.name] is penetrated by an immovable rod!" , "The rod penetrates you!" , "You hear a CLANG!")
+ H.visible_message("[H.name] is penetrated by an immovable rod!" ,
+ "The rod penetrates you!" ,
+ "You hear a CLANG!")
H.adjustBruteLoss(160)
if(clong.density || prob(10))
clong.ex_act(2)