From b3a809d21a9d3eeae20d3c17548217f5d445883d Mon Sep 17 00:00:00 2001 From: Joan Lung Date: Tue, 29 Nov 2016 11:48:16 -0500 Subject: [PATCH] Fixes the auto follow debris button --- code/_onclick/hud/ghost.dm | 4 ++-- code/controllers/subsystem/augury.dm | 28 ++++++++++++++++-------- code/game/gamemodes/meteor/meteors.dm | 19 ++++++++-------- code/game/objects/explosion.dm | 31 ++++++++++++++------------- 4 files changed, 46 insertions(+), 36 deletions(-) diff --git a/code/_onclick/hud/ghost.dm b/code/_onclick/hud/ghost.dm index ca7886e29d9..4c488060761 100644 --- a/code/_onclick/hud/ghost.dm +++ b/code/_onclick/hud/ghost.dm @@ -36,7 +36,7 @@ var/mob/dead/observer/G = usr G.dead_tele() -/datum/hud/ghost/New(mob/owner) +/datum/hud/ghost/New(mob/owner, ui_style = 'icons/mob/screen_midnight.dmi') ..() var/mob/dead/observer/G = mymob if(!G.client.prefs.ghost_hud) @@ -71,4 +71,4 @@ /mob/dead/observer/create_mob_hud() if(client && !hud_used) - hud_used = new /datum/hud/ghost(src) + hud_used = new /datum/hud/ghost(src, ui_style2icon(client.prefs.UI_style)) diff --git a/code/controllers/subsystem/augury.dm b/code/controllers/subsystem/augury.dm index eba214fdf78..0b5c7b00853 100644 --- a/code/controllers/subsystem/augury.dm +++ b/code/controllers/subsystem/augury.dm @@ -37,38 +37,48 @@ var/datum/subsystem/augury/SSaugury var/datum/action/innate/augury/A = new A.Grant(i) observers_given_action[i] = TRUE + else + for(var/i in observers_given_action) + if(observers_given_action[i] && isobserver(i)) + var/mob/dead/observer/O = i + for(var/datum/action/innate/augury/A in O.actions) + qdel(A) + observers_given_action -= i for(var/w in watchers) if(!w) watchers -= w continue var/mob/dead/observer/O = w - if(O.orbiting) - continue - else if(biggest_doom) - addtimer(O, "orbit", 0, TIMER_NORMAL, biggest_doom) + if(biggest_doom && (!O.orbiting || O.orbiting.orbiting != biggest_doom)) + O.ManualFollow(biggest_doom) /datum/action/innate/augury name = "Auto Follow Debris" icon_icon = 'icons/obj/meteor.dmi' button_icon_state = "flaming" + background_icon_state = ACTION_BUTTON_DEFAULT_BACKGROUND + +/datum/action/innate/augury/Destroy() + if(owner) + SSaugury.watchers -= owner + return ..() /datum/action/innate/augury/Activate() - SSaugury.watchers[owner] = TRUE + SSaugury.watchers += owner owner << "You are now auto-following debris." active = TRUE UpdateButtonIcon() /datum/action/innate/augury/Deactivate() SSaugury.watchers -= owner - owner << "You are no longer auto-following \ - debris." + owner << "You are no longer auto-following debris." active = FALSE UpdateButtonIcon() /datum/action/innate/augury/UpdateButtonIcon() ..() if(active) - button.icon_state = "bg_default_on" + button.icon_state = "template_active" else - button.icon_state = background_icon_state + button.icon_state = "template" diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm index 7aa568483bf..681ce9c9033 100644 --- a/code/game/gamemodes/meteor/meteors.dm +++ b/code/game/gamemodes/meteor/meteors.dm @@ -66,17 +66,17 @@ var/endx switch(startSide) if(NORTH) - endy = TRANSITIONEDGE - endx = rand(TRANSITIONEDGE, world.maxx-TRANSITIONEDGE) + endy = (TRANSITIONEDGE+1) + endx = rand((TRANSITIONEDGE+1), world.maxx-(TRANSITIONEDGE+1)) if(EAST) - endy = rand(TRANSITIONEDGE, world.maxy-TRANSITIONEDGE) - endx = TRANSITIONEDGE + endy = rand((TRANSITIONEDGE+1), world.maxy-(TRANSITIONEDGE+1)) + endx = (TRANSITIONEDGE+1) if(SOUTH) - endy = world.maxy-TRANSITIONEDGE - endx = rand(TRANSITIONEDGE, world.maxx-TRANSITIONEDGE) + endy = world.maxy-(TRANSITIONEDGE+1) + endx = rand((TRANSITIONEDGE+1), world.maxx-(TRANSITIONEDGE+1)) if(WEST) - endy = rand(TRANSITIONEDGE,world.maxy-TRANSITIONEDGE) - endx = world.maxx-TRANSITIONEDGE + endy = rand((TRANSITIONEDGE+1),world.maxy-(TRANSITIONEDGE+1)) + endx = world.maxx-(TRANSITIONEDGE+1) . = locate(endx, endy, Z) /////////////////////// @@ -317,8 +317,7 @@ /obj/effect/meteor/tunguska name = "tunguska meteor" icon_state = "flaming" - desc = "Your life briefly passes before your eyes the moment you lay \ - them on this monstrosity." + desc = "Your life briefly passes before your eyes the moment you lay them on this monstrosity." hits = 30 hitpwr = 1 heavy = 1 diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm index 766d6826555..f055b93256f 100644 --- a/code/game/objects/explosion.dm +++ b/code/game/objects/explosion.dm @@ -2,8 +2,23 @@ /proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1, ignorecap = 0, flame_range = 0 ,silent = 0, smoke = 1) set waitfor = 0 - src = null //so we don't abort once src is deleted + src = null //so we don't abort once src is deleted epicenter = get_turf(epicenter) + if(!epicenter) + return + + // Archive the uncapped explosion for the doppler array + var/orig_dev_range = devastation_range + var/orig_heavy_range = heavy_impact_range + var/orig_light_range = light_impact_range + + if(!ignorecap && epicenter.z != ZLEVEL_MINING) + //Clamp all values to MAX_EXPLOSION_RANGE + devastation_range = min(MAX_EX_DEVESTATION_RANGE, devastation_range) + heavy_impact_range = min(MAX_EX_HEAVY_RANGE, heavy_impact_range) + light_impact_range = min(MAX_EX_LIGHT_RANGE, light_impact_range) + flash_range = min(MAX_EX_FLASH_RANGE, flash_range) + flame_range = min(MAX_EX_FLAME_RANGE, flame_range) //DO NOT REMOVE THIS SLEEP, IT BREAKS THINGS //not sleeping causes us to ex_act() the thing that triggered the explosion @@ -14,21 +29,7 @@ //and somethings expect us to ex_act them so they can qdel() sleep(1) //tldr, let the calling proc call qdel(src) before we explode - // Archive the uncapped explosion for the doppler array - var/orig_dev_range = devastation_range - var/orig_heavy_range = heavy_impact_range - var/orig_light_range = light_impact_range - - if(!ignorecap && epicenter.z != ZLEVEL_MINING) - // Clamp all values to MAX_EXPLOSION_RANGE - devastation_range = min (MAX_EX_DEVESTATION_RANGE, devastation_range) - heavy_impact_range = min (MAX_EX_HEAVY_RANGE, heavy_impact_range) - light_impact_range = min (MAX_EX_LIGHT_RANGE, light_impact_range) - flash_range = min (MAX_EX_FLASH_RANGE, flash_range) - flame_range = min (MAX_EX_FLAME_RANGE, flame_range) - var/start = world.timeofday - if(!epicenter) return var/max_range = max(devastation_range, heavy_impact_range, light_impact_range, flame_range) var/list/cached_exp_block = list()