Meteors Now

This commit is contained in:
Cyantime
2017-07-29 20:37:06 -04:00
parent dcbf5d9cb7
commit 39917bf01a
5 changed files with 129 additions and 2 deletions
+6 -1
View File
@@ -81,7 +81,12 @@ The "dust" will damage the hull of the station causin minor hull breaches.
startx = (TRANSITIONEDGE+1)
endy = rand(TRANSITIONEDGE,world.maxy-TRANSITIONEDGE)
endx = world.maxx-TRANSITIONEDGE
var/z_level = pick(using_map.station_levels)
//VOREStation Edit - No space dust outside of space
var/list/z_levels = using_map.station_levels.Copy()
for(var/datum/planet/P in planet_controller.planets)
z_levels.Remove(P.expected_z_levels)
var/z_level = pick(z_levels)
//VOREStation Edit End
var/goal = locate(endx, endy, z_level)
src.x = startx
src.y = starty
@@ -102,9 +102,18 @@ var/list/outdoor_turfs = list()
/turf/simulated/floor/outdoors/ex_act(severity)
switch(severity)
//VOREStation Edit - Outdoor turfs less explosion resistant
if(1)
if(prob(66))
ChangeTurf(get_base_turf_by_area(src))
return
demote()
if(2)
if(prob(33))
return
else if(prob(33))
demote()
//VOREStation Edit End
if(3)
if(prob(66))
return
+1 -1
View File
@@ -214,7 +214,7 @@
if(check_destroy_override())
src.ChangeTurf(destroy_floor_override_path)
else
src.ChangeTurf(/turf/space)
src.ChangeTurf(get_base_turf_by_area(src)) //VOREStation Edit - Use area base turf
if(2.0)
if(prob(75))
take_damage(rand(150, 250))
@@ -92,6 +92,7 @@
available_events = list(
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Nothing", /datum/event/nothing, 900),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Atmos Leak", /datum/event/atmos_leak, 30, list(ASSIGNMENT_ENGINEER = 25), 1),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Meteor Strike", /datum/event/meteor_strike, 5, null ,1)
)
add_disabled_events(list(
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Blob", /datum/event/blob, 10, list(ASSIGNMENT_ENGINEER = 60), 1),
+112
View File
@@ -0,0 +1,112 @@
/datum/event/meteor_strike
announceWhen = 1
var/turf/strike_target
/datum/event/meteor_strike/setup()
startWhen = rand(8,15)
strike_target = pick(get_area_turfs(/area/tether/surfacebase/outside/outside3))
if(!strike_target)
kill()
/datum/event/meteor_strike/announce()
command_announcement.Announce("A meteoroid has been detected entering the atmosphere on a trajectory that will terminate near the surface facilty. Brace for impact.", "Debris Warning")
/datum/event/meteor_strike/start()
new /obj/effect/meteor_falling(strike_target)
/obj/effect/meteor_falling
name = "meteor"
desc = "The sky is falling!"
icon = 'icons/obj/meteor.dmi'
icon_state = "large"
anchored = 1
/obj/effect/meteor_falling/New()
..()
SpinAnimation()
meteor_fall()
/obj/effect/meteor_falling/proc/meteor_fall()
var/turf/current = get_turf(src)
if(istype(current, /turf/simulated/open) || istype(current, /turf/space))
var/turf/below = GetBelow(src)
if(below.density)
meteor_impact()
return
for(var/atom/movable/A in current)
A.ex_act(1)
forceMove(below)
meteor_fall()
return
meteor_impact()
/obj/effect/meteor_falling/proc/meteor_impact()
var/turf/current = get_turf(src)
spawn()
explosion(current, 2, 4, 6, 10, 0)
anim(get_step(current,SOUTHWEST),, 'icons/effects/96x96.dmi',, "explosion")
new /obj/structure/meteorite(current)
var/datum/planet/impacted
for(var/datum/planet/P in planet_controller.planets)
if(current.z in P.expected_z_levels)
impacted = P
break
if(impacted)
for(var/mob/living/L in mob_list)
if(!istype(L))
continue
var/turf/mob_turf = get_turf(L)
if(!(mob_turf.z in impacted.expected_z_levels))
continue
if(!L.buckled)
L.throw_at(get_step_rand(L),1,5)
L.Weaken(5)
if(L.client)
to_chat(L, "<span class='danger'>The ground lurches beneath you!</span>")
shake_camera(L, 6, 1)
if(!L.ear_deaf)
L << 'sound/effects/explosionfar.ogg'
qdel(src)
/obj/structure/meteorite
name = "meteorite"
desc = "A big hunk of star-stuff."
icon = 'icons/obj/meteor.dmi'
icon_state = "large"
density = 1
climbable = 1
/obj/structure/meteorite/New()
..()
icon = turn(icon, 90)
switch(rand(1,100))
if(1 to 60)
for(var/i=1 to rand(12,36))
new /obj/item/weapon/ore/iron(src)
if(61 to 90)
for(var/i=1 to rand(8,24))
new /obj/item/weapon/ore/silver(src)
new /obj/item/weapon/ore/gold(src)
new /obj/item/weapon/ore/osmium(src)
new /obj/item/weapon/ore/diamond(src)
if(91 to 100)
new /obj/machinery/artifact(src)
/obj/structure/meteorite/ex_act()
return
/obj/structure/meteorite/attackby(var/obj/item/I, var/mob/M)
if(istype(I, /obj/item/weapon/pickaxe))
var/obj/item/weapon/pickaxe/P = I
M.visible_message("<span class='warning'>[M] starts [P.drill_verb] \the [src].</span>", "<span class='warning'>You start [P.drill_verb] \the [src].</span>")
if(!do_after(M, P.digspeed*3))
return
M.visible_message("<span cleass='warning'>[M] breaks apart \the [src].</span>", "<span cleass='warning'>You break apart \the [src].</span>")
for(var/obj/O in src)
O.forceMove(get_turf(src))
qdel(src)
return