Ports overmap events from Baystation12

- Move overmap defines to _defines folder.  Rename old file to turfs.dm since that is what it contains.
- Definition of overmap event objects and the overmap event handler.
- Upgrades to SSevents and SSskybox to tie in the overmap events.
- Enhancement to /datum/event itself to support affecting_z and victim ship.
- Upgrade to the five event types used on the overmap to support new vars.
- Upgrade to dust and meteor spawning code to support targeting z-levels.
This commit is contained in:
Leshana
2020-03-18 13:28:37 -04:00
committed by Aronai Sieyes
parent 15273a356c
commit f2a582569b
22 changed files with 795 additions and 347 deletions

View File

@@ -7,27 +7,57 @@ No command report on the common version of this event.
The "dust" will damage the hull of the station causin minor hull breaches.
*/
/proc/dust_swarm(var/strength = "weak")
/proc/dust_swarm(var/strength = "weak", var/list/affecting_z)
var/numbers = 1
var/dust_type = /obj/effect/space_dust
switch(strength)
if("weak")
numbers = rand(2,4)
for(var/i = 0 to numbers)
new/obj/effect/space_dust/weak()
numbers = rand(2,4)
dust_type = /obj/effect/space_dust/weak
if("norm")
numbers = rand(5,10)
for(var/i = 0 to numbers)
new/obj/effect/space_dust()
numbers = rand(5,10)
dust_type = /obj/effect/space_dust
if("strong")
numbers = rand(10,15)
for(var/i = 0 to numbers)
new/obj/effect/space_dust/strong()
numbers = rand(10,15)
dust_type = /obj/effect/space_dust/strong
if("super")
numbers = rand(15,25)
for(var/i = 0 to numbers)
new/obj/effect/space_dust/super()
return
numbers = rand(15,25)
dust_type = /obj/effect/space_dust/super
var/startside = pick(cardinal)
for(var/i = 0 to numbers)
var/startx = 0
var/starty = 0
var/endy = 0
var/endx = 0
switch(startside)
if(NORTH)
starty = world.maxy-TRANSITIONEDGE-1
startx = rand(TRANSITIONEDGE+1, world.maxx-TRANSITIONEDGE-1)
endy = TRANSITIONEDGE
endx = rand(TRANSITIONEDGE+1, world.maxx-TRANSITIONEDGE-1)
if(EAST)
starty = rand(TRANSITIONEDGE+1, world.maxy-TRANSITIONEDGE-1)
startx = world.maxx-TRANSITIONEDGE-1
endy = rand(TRANSITIONEDGE, world.maxy-TRANSITIONEDGE)
endx = TRANSITIONEDGE
if(SOUTH)
starty = TRANSITIONEDGE+1
startx = rand(TRANSITIONEDGE+1, world.maxx-TRANSITIONEDGE-1)
endy = world.maxy-TRANSITIONEDGE
endx = rand(TRANSITIONEDGE, world.maxx-TRANSITIONEDGE)
if(WEST)
starty = rand(TRANSITIONEDGE+1, world.maxy-TRANSITIONEDGE-1)
startx = TRANSITIONEDGE+1
endy = rand(TRANSITIONEDGE, world.maxy-TRANSITIONEDGE)
endx = world.maxx-TRANSITIONEDGE
var/randomz = pick(affecting_z)
var/turf/startloc = locate(startx, starty, randomz)
var/turf/endloc = locate(endx, endy, randomz)
var/obj/effect/space_dust/D = new dust_type(startloc)
D.set_dir(GLOB.reverse_dir[startside])
walk_towards(D, endloc, 1)
/obj/effect/space_dust
name = "Space Dust"
@@ -39,96 +69,51 @@ The "dust" will damage the hull of the station causin minor hull breaches.
var/strength = 2 //ex_act severity number
var/life = 2 //how many things we hit before qdel(src)
weak
strength = 3
life = 1
/obj/effect/space_dust/weak
strength = 3
life = 1
strong
strength = 1
life = 6
/obj/effect/space_dust/strong
strength = 1
life = 6
super
strength = 1
life = 40
/obj/effect/space_dust/super
strength = 1
life = 40
/obj/effect/space_dust/Destroy()
walk(src, 0) // Because we might have called walk_towards, we must stop the walk loop or BYOND keeps an internal reference to us forever.
return ..()
/obj/effect/space_dust/touch_map_edge()
qdel(src)
/obj/effect/space_dust/Bump(atom/A)
spawn(0)
if(prob(50))
for(var/mob/M in range(10, src))
if(!M.stat && !istype(M, /mob/living/silicon/ai))
shake_camera(M, 3, 1)
if (A)
playsound(src.loc, 'sound/effects/meteorimpact.ogg', 40, 1)
if(ismob(A))
A.ex_act(strength)//This should work for now I guess
else if(!istype(A,/obj/machinery/power/emitter) && !istype(A,/obj/machinery/field_generator)) //Protect the singularity from getting released every round!
A.ex_act(strength) //Changing emitter/field gen ex_act would make it immune to bombs and C4
life--
if(life <= 0)
walk(src,0)
qdel(src)
return 0
return
New()
..()
var/startx = 0
var/starty = 0
var/endy = 0
var/endx = 0
var/startside = pick(cardinal)
/obj/effect/space_dust/Bumped(atom/A)
Bump(A)
return
switch(startside)
if(NORTH)
starty = world.maxy-(TRANSITIONEDGE+1)
startx = rand((TRANSITIONEDGE+1), world.maxx-(TRANSITIONEDGE+1))
endy = TRANSITIONEDGE
endx = rand(TRANSITIONEDGE, world.maxx-TRANSITIONEDGE)
if(EAST)
starty = rand((TRANSITIONEDGE+1),world.maxy-(TRANSITIONEDGE+1))
startx = world.maxx-(TRANSITIONEDGE+1)
endy = rand(TRANSITIONEDGE, world.maxy-TRANSITIONEDGE)
endx = TRANSITIONEDGE
if(SOUTH)
starty = (TRANSITIONEDGE+1)
startx = rand((TRANSITIONEDGE+1), world.maxx-(TRANSITIONEDGE+1))
endy = world.maxy-TRANSITIONEDGE
endx = rand(TRANSITIONEDGE, world.maxx-TRANSITIONEDGE)
if(WEST)
starty = rand((TRANSITIONEDGE+1), world.maxy-(TRANSITIONEDGE+1))
startx = (TRANSITIONEDGE+1)
endy = rand(TRANSITIONEDGE,world.maxy-TRANSITIONEDGE)
endx = world.maxx-TRANSITIONEDGE
//VOREStation Edit - No space dust outside of space
var/list/z_levels = using_map.station_levels.Copy()
for(var/datum/planet/P in SSplanets.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
src.z = z_level
spawn(0)
walk_towards(src, goal, 1)
return
Destroy()
walk(src, 0) // Because we might have called walk_towards, we must stop the walk loop or BYOND keeps an internal reference to us forever.
return ..()
touch_map_edge()
qdel(src)
Bump(atom/A)
spawn(0)
if(prob(50))
for(var/mob/M in range(10, src))
if(!M.stat && !istype(M, /mob/living/silicon/ai))
shake_camera(M, 3, 1)
if (A)
playsound(src.loc, 'sound/effects/meteorimpact.ogg', 40, 1)
if(ismob(A))
A.ex_act(strength)//This should work for now I guess
else if(!istype(A,/obj/machinery/power/emitter) && !istype(A,/obj/machinery/field_generator)) //Protect the singularity from getting released every round!
A.ex_act(strength) //Changing emitter/field gen ex_act would make it immune to bombs and C4
life--
if(life <= 0)
walk(src,0)
qdel(src)
return 0
return
Bumped(atom/A)
Bump(A)
return
ex_act(severity)
qdel(src)
return
/obj/effect/space_dust/ex_act(severity)
qdel(src)
return