From cc2673ec7dbb3f0a15ef27a6168791dd32238f19 Mon Sep 17 00:00:00 2001 From: KorPhaeron Date: Tue, 26 Jul 2016 05:32:21 -0400 Subject: [PATCH] Can use staff of storms on station (#19486) * Staff of Storms on station * Staff of (any) storms * Fixes for summoning weather * Removes extra line --- code/controllers/subsystem/weather.dm | 6 +-- .../simple_animal/hostile/megafauna/legion.dm | 44 ++++++++++--------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/code/controllers/subsystem/weather.dm b/code/controllers/subsystem/weather.dm index ea91afbbe29..56341b7b55f 100644 --- a/code/controllers/subsystem/weather.dm +++ b/code/controllers/subsystem/weather.dm @@ -27,7 +27,7 @@ var/datum/subsystem/weather/SSweather if(WE.target_z == Z && WE.probability) //Another check so that it doesn't run extra weather possible_weather_for_this_z[WE] = WE.probability var/datum/weather/W = pickweight(possible_weather_for_this_z) - run_weather(W.name) + run_weather(W.name, Z) eligible_zlevels -= Z addtimer(src, "make_z_eligible", rand(3000, 6000) + W.weather_duration_upper, TRUE, Z) //Around 5-10 minutes between weathers @@ -37,12 +37,12 @@ var/datum/subsystem/weather/SSweather var/datum/weather/W = V existing_weather |= new W -/datum/subsystem/weather/proc/run_weather(weather_name) +/datum/subsystem/weather/proc/run_weather(weather_name, Z) if(!weather_name) return for(var/V in existing_weather) var/datum/weather/W = V - if(W.name == weather_name) + if(W.name == weather_name && W.target_z == Z) W.telegraph() /datum/subsystem/weather/proc/make_z_eligible(zlevel) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm index deb249dafcb..03a47675615 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm @@ -141,40 +141,44 @@ Difficulty: Medium force = 25 damtype = BURN hitsound = 'sound/weapons/sear.ogg' + var/storm_type = /datum/weather/ash_storm var/storm_cooldown = 0 /obj/item/weapon/staff/storm/attack_self(mob/user) if(storm_cooldown > world.time) user << "The staff is still recharging!" return - if(user.z != ZLEVEL_LAVALAND) - user << "You can't seem to control the weather here!" - return - var/datum/weather/ash_storm/A + var/area/user_area = get_area(user) + var/datum/weather/A for(var/V in SSweather.existing_weather) var/datum/weather/W = V - if(W.name == "ash storm") + if(W.target_z == user.z && W.area_type == user_area.type) A = W break - if(!A) - user << "How odd! The planet seems to have lost its atmosphere!" - return + if(A) - if(A.stage != END_STAGE) - if(A.stage == WIND_DOWN_STAGE) - user << "The storm is already ending! It would be a waste to use the staff now." + if(A.stage != END_STAGE) + if(A.stage == WIND_DOWN_STAGE) + user << "The storm is already ending! It would be a waste to use the staff now." + return + user.visible_message("[user] holds [src] skywards as an orange beam travels into the sky!", \ + "You hold [src] skyward, dispelling the storm!") + playsound(user, 'sound/magic/Staff_Change.ogg', 200, 0) + A.wind_down() return - user.visible_message("[user] holds [src] skywards as an orange beam travels into the sky!", \ - "You hold [src] skyward, dispelling the ash storm!") - playsound(user, 'sound/magic/Staff_Change.ogg', 200, 0) - A.wind_down() else - user.visible_message("[user] holds [src] skywards as red lightning crackles into the sky!", \ - "You hold [src] skyward, calling down a terrible storm!") - playsound(user, 'sound/magic/Staff_Chaos.ogg', 200, 0) - A.telegraph() + A = new storm_type + A.name = "staff storm" + A.area_type = user_area.type + A.target_z = user.z + A.telegraph_duration = 100 + A.end_duration = 100 - storm_cooldown = world.time + 600 + user.visible_message("[user] holds [src] skywards as red lightning crackles into the sky!", \ + "You hold [src] skyward, calling down a terrible storm!") + playsound(user, 'sound/magic/Staff_Change.ogg', 200, 0) + A.telegraph() + storm_cooldown = world.time + 200 #undef MEDAL_PREFIX \ No newline at end of file