From 32fe9d4fd6ed4996b244b814cb9257f5d7cea0af Mon Sep 17 00:00:00 2001 From: vuonojenmustaturska Date: Wed, 18 Apr 2018 17:32:35 +0300 Subject: [PATCH] Couple of fixes for situations involving mechas and the clock cult gamemode (#37218) * couple of mech fixes * safety * gateway, gravity gen * Restores oingo-boingo punch-nuke --- code/game/atoms_movable.dm | 5 ++++- code/game/mecha/equipment/weapons/weapons.dm | 5 ++--- .../clockcult/clock_effects/city_of_cogs_rift.dm | 8 +++++++- .../clockcult/clock_effects/servant_blocker.dm | 3 +++ code/modules/awaymissions/gateway.dm | 5 ++++- code/modules/power/gravitygenerator.dm | 2 +- code/modules/projectiles/projectile/bullets/shotgun.dm | 4 ++-- 7 files changed, 23 insertions(+), 9 deletions(-) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index c439f7e3e5..95412c6a7b 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -383,7 +383,7 @@ if(throwing) return 1 - + if(!isturf(loc)) return 1 @@ -415,6 +415,9 @@ step(src, AM.dir) ..() +/atom/movable/proc/safe_throw_at(atom/target, range, speed, mob/thrower, spin=TRUE, diagonals_first = FALSE, var/datum/callback/callback) + return throw_at(target, range, speed, thrower, spin, diagonals_first, callback) + /atom/movable/proc/throw_at(atom/target, range, speed, mob/thrower, spin=TRUE, diagonals_first = FALSE, var/datum/callback/callback) //If this returns FALSE then callback will not be called. . = FALSE if (!target || (flags_1 & NODROP_1) || speed <= 0) diff --git a/code/game/mecha/equipment/weapons/weapons.dm b/code/game/mecha/equipment/weapons/weapons.dm index 6c7d69b570..2b7855ea33 100644 --- a/code/game/mecha/equipment/weapons/weapons.dm +++ b/code/game/mecha/equipment/weapons/weapons.dm @@ -50,7 +50,7 @@ playsound(chassis, fire_sound, 50, 1) sleep(max(0, projectile_delay)) - + if(kickback) chassis.newtonian_move(turn(chassis.dir,180)) chassis.log_message("Fired from [src.name], targeting [target].") @@ -428,6 +428,5 @@ if(!..()) if(ismovableatom(hit_atom)) var/atom/movable/AM = hit_atom - AM.throw_at(get_edge_target_turf(AM,get_dir(src, AM)), 7, 2) + AM.safe_throw_at(get_edge_target_turf(AM,get_dir(src, AM)), 7, 2) qdel(src) - diff --git a/code/modules/antagonists/clockcult/clock_effects/city_of_cogs_rift.dm b/code/modules/antagonists/clockcult/clock_effects/city_of_cogs_rift.dm index 1a12e7eecb..44c86c7b78 100644 --- a/code/modules/antagonists/clockcult/clock_effects/city_of_cogs_rift.dm +++ b/code/modules/antagonists/clockcult/clock_effects/city_of_cogs_rift.dm @@ -54,8 +54,14 @@ /obj/effect/clockwork/city_of_cogs_rift/proc/beckon(atom/movable/AM) var/turf/T = get_turf(pick(GLOB.city_of_cogs_spawns)) - if(is_servant_of_ratvar(AM)) + if(ismob(AM) && is_servant_of_ratvar(AM)) T = GLOB.ark_of_the_clockwork_justiciar ? get_step(GLOB.ark_of_the_clockwork_justiciar, SOUTH) : get_turf(pick(GLOB.servant_spawns)) + else // Handle mechas and such + var/list/target_contents = AM.GetAllContents() + AM + for(var/mob/living/L in target_contents) + if(is_servant_of_ratvar(L) && L.stat != DEAD) // Having a living cultist in your inventory sends you to the cultist spawn + T = GLOB.ark_of_the_clockwork_justiciar ? get_step(GLOB.ark_of_the_clockwork_justiciar, SOUTH) : get_turf(pick(GLOB.servant_spawns)) + break AM.visible_message("[AM] passes through [src]!", null, null, null, AM) AM.forceMove(T) AM.visible_message("[AM] materializes from the air!", \ diff --git a/code/modules/antagonists/clockcult/clock_effects/servant_blocker.dm b/code/modules/antagonists/clockcult/clock_effects/servant_blocker.dm index e7b1ef7b94..0e6e1c3821 100644 --- a/code/modules/antagonists/clockcult/clock_effects/servant_blocker.dm +++ b/code/modules/antagonists/clockcult/clock_effects/servant_blocker.dm @@ -42,3 +42,6 @@ /obj/effect/clockwork/servant_blocker/ex_act(severity, target) return + +/obj/effect/clockwork/servant_blocker/safe_throw_at() + return diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm index 80a543a021..bba2b0558c 100644 --- a/code/modules/awaymissions/gateway.dm +++ b/code/modules/awaymissions/gateway.dm @@ -74,6 +74,9 @@ GLOBAL_DATUM(the_gateway, /obj/machinery/gateway/centerstation) /obj/machinery/gateway/proc/toggleon(mob/user) return FALSE +/obj/machinery/gateway/safe_throw_at() + return + /obj/machinery/gateway/centerstation/Initialize() . = ..() if(!GLOB.the_gateway) @@ -250,4 +253,4 @@ GLOBAL_DATUM(the_gateway, /obj/machinery/gateway/centerstation) /obj/item/paper/fluff/gateway info = "Congratulations,

Your station has been selected to carry out the Gateway Project.

The equipment will be shipped to you at the start of the next quarter.
You are to prepare a secure location to house the equipment as outlined in the attached documents.

--Nanotrasen Blue Space Research" - name = "Confidential Correspondence, Pg 1" \ No newline at end of file + name = "Confidential Correspondence, Pg 1" diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm index 29e4a38727..ad1e5054c5 100644 --- a/code/modules/power/gravitygenerator.dm +++ b/code/modules/power/gravitygenerator.dm @@ -28,7 +28,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF var/sprite_number = 0 -/obj/machinery/gravity_generator/throw_at() +/obj/machinery/gravity_generator/safe_throw_at() return FALSE /obj/machinery/gravity_generator/ex_act(severity, target) diff --git a/code/modules/projectiles/projectile/bullets/shotgun.dm b/code/modules/projectiles/projectile/bullets/shotgun.dm index 3d616bdd22..41a819dd16 100644 --- a/code/modules/projectiles/projectile/bullets/shotgun.dm +++ b/code/modules/projectiles/projectile/bullets/shotgun.dm @@ -1,7 +1,7 @@ /obj/item/projectile/bullet/shotgun_slug name = "12g shotgun slug" damage = 60 - + /obj/item/projectile/bullet/shotgun_slug/tengauge name = "10g shotgun slug" damage = 72.5 @@ -42,7 +42,7 @@ if(ismovableatom(target)) var/atom/movable/M = target var/atom/throw_target = get_edge_target_turf(M, get_dir(src, get_step_away(M, src))) - M.throw_at(throw_target, 3, 2) + M.safe_throw_at(throw_target, 3, 2) /obj/item/projectile/bullet/shotgun_meteorslug/Initialize() . = ..()