mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-03 14:03:25 +00:00
Merge pull request #7585 from Mechoid/OfSnakesAndColumns
Adds two effect types for PoIs and theoretical future bossmobs.
This commit is contained in:
54
code/game/objects/effects/prop/columnblast.dm
Normal file
54
code/game/objects/effects/prop/columnblast.dm
Normal file
@@ -0,0 +1,54 @@
|
||||
|
||||
/obj/effect/temporary_effect/eruption
|
||||
name = "eruption"
|
||||
desc = "Oh shit!"
|
||||
icon_state = "pool"
|
||||
icon = 'icons/effects/64x64.dmi'
|
||||
|
||||
pixel_x = -16
|
||||
|
||||
/obj/effect/temporary_effect/eruption/New(var/turf/T, var/ttd = 10 SECONDS, var/newcolor)
|
||||
if(ttd)
|
||||
time_to_die = ttd
|
||||
|
||||
if(newcolor)
|
||||
color = newcolor
|
||||
|
||||
..()
|
||||
|
||||
/obj/effect/temporary_effect/eruption/Initialize()
|
||||
..()
|
||||
flick("[icon_state]_create",src)
|
||||
|
||||
/obj/effect/temporary_effect/eruption/Destroy()
|
||||
var/turf/T = get_turf(src)
|
||||
flick("[icon_state]_erupt",src)
|
||||
spawn(5)
|
||||
if(on_eruption(T))
|
||||
spawn(2)
|
||||
..()
|
||||
|
||||
/obj/effect/temporary_effect/eruption/proc/on_eruption(var/turf/Target) // Override for specific functions, as below.
|
||||
return TRUE
|
||||
|
||||
/obj/effect/temporary_effect/eruption/testing/on_eruption(var/turf/Target)
|
||||
if(Target)
|
||||
new /obj/effect/explosion(Target)
|
||||
return TRUE
|
||||
|
||||
/*
|
||||
* Subtypes
|
||||
*/
|
||||
|
||||
/obj/effect/temporary_effect/eruption/flamestrike
|
||||
desc = "A bubbling pool of fire!"
|
||||
|
||||
/obj/effect/temporary_effect/eruption/flamestrike/on_eruption(var/turf/Target)
|
||||
if(Target)
|
||||
Target.hotspot_expose(1000, 50, 1)
|
||||
|
||||
for(var/mob/living/L in Target)
|
||||
L.fire_stacks += 2
|
||||
L.add_modifier(/datum/modifier/fire/stack_managed/intense, 30 SECONDS)
|
||||
|
||||
return TRUE
|
||||
125
code/game/objects/effects/prop/snake.dm
Normal file
125
code/game/objects/effects/prop/snake.dm
Normal file
@@ -0,0 +1,125 @@
|
||||
|
||||
/obj/effect/temporary_effect/pulse/snake
|
||||
name = "snake head"
|
||||
pulses_remaining = 20
|
||||
pulse_delay = 0.5 SECONDS
|
||||
|
||||
icon_state = "arrow_omni"
|
||||
|
||||
invisibility = 100
|
||||
|
||||
// The atom which created this.
|
||||
var/atom/movable/creator
|
||||
// Will the snake ever intentionally move onto its creator's turf?
|
||||
var/safe = FALSE
|
||||
|
||||
var/ignore_density = FALSE
|
||||
|
||||
// The turfs this snake has already crossed.
|
||||
var/list/iterated_turfs = list()
|
||||
// How many turfs this snake should remember.
|
||||
var/total_turf_memory = 5
|
||||
// Is the snake hunting a specific atom? (Will always try to meander toward this target.)
|
||||
var/atom/hunting
|
||||
|
||||
/obj/effect/temporary_effect/pulse/snake/New(var/turf/T, var/atom/hunt_target, var/atom/Creator)
|
||||
if(hunt_target)
|
||||
hunting = hunt_target
|
||||
|
||||
if(Creator)
|
||||
creator = Creator
|
||||
|
||||
..()
|
||||
|
||||
/obj/effect/temporary_effect/pulse/snake/pulse_loop() // Override needed unfortunately to handle the possibility of not finding a target turf.
|
||||
set waitfor = FALSE
|
||||
|
||||
while(pulses_remaining)
|
||||
sleep(pulse_delay)
|
||||
if(on_pulse())
|
||||
pulses_remaining--
|
||||
else
|
||||
break
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/temporary_effect/pulse/snake/on_pulse()
|
||||
var/list/possible_turfs = list()
|
||||
|
||||
if(LAZYLEN(iterated_turfs) && iterated_turfs.len > total_turf_memory)
|
||||
iterated_turfs.Cut(total_turf_memory + 1)
|
||||
|
||||
for(var/direction in list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST) - turn(src.dir,180))
|
||||
var/turf/T = get_step(src, direction)
|
||||
if(T in iterated_turfs)
|
||||
continue
|
||||
|
||||
if(!ignore_density && T.density)
|
||||
continue
|
||||
|
||||
if(safe && creator && get_dir(src, T) == get_dir(src,creator))
|
||||
continue
|
||||
|
||||
if(hunting && get_dist(T, hunting) > get_dist(src, hunting))
|
||||
continue
|
||||
|
||||
possible_turfs |= T
|
||||
|
||||
if(T == get_step(src, dir))
|
||||
possible_turfs[T] = 4
|
||||
else
|
||||
possible_turfs[T] = 1
|
||||
|
||||
var/turf/Target
|
||||
|
||||
if(LAZYLEN(possible_turfs)) // Pick from our remaining possible turfs.
|
||||
Target = pickweight(possible_turfs)
|
||||
else // IF we have none left, just pick a random one.
|
||||
for(var/turf/T in oview(1, src))
|
||||
possible_turfs |= T
|
||||
Target = pick(possible_turfs)
|
||||
|
||||
if(Target)
|
||||
iterated_turfs.Insert(1, Target)
|
||||
on_leave_turf(get_turf(src))
|
||||
dir = get_dir(src, Target)
|
||||
forceMove(Target)
|
||||
on_enter_turf(Target)
|
||||
return TRUE
|
||||
|
||||
else
|
||||
on_leave_turf(get_turf(src))
|
||||
return FALSE
|
||||
|
||||
/obj/effect/temporary_effect/pulse/snake/proc/on_leave_turf(var/turf/T)
|
||||
|
||||
/obj/effect/temporary_effect/pulse/snake/proc/on_enter_turf(var/turf/T)
|
||||
|
||||
/obj/effect/temporary_effect/pulse/snake/testing/on_leave_turf(var/turf/T)
|
||||
if(T)
|
||||
new /obj/effect/temporary_effect/eruption/testing(T, 3 SECONDS, "#ff0000")
|
||||
|
||||
/obj/effect/temporary_effect/pulse/snake/testing/on_enter_turf(var/turf/T)
|
||||
if(T)
|
||||
T.color = "#00ff00"
|
||||
|
||||
spawn(3 SECONDS)
|
||||
T.color = initial(T.color)
|
||||
|
||||
/obj/effect/temporary_effect/pulse/snake/testing/hunter/pulse_loop()
|
||||
hunting = locate(/mob/living) in range(7, src)
|
||||
..()
|
||||
|
||||
/*
|
||||
* Subtypes
|
||||
*/
|
||||
|
||||
/obj/effect/temporary_effect/pulse/snake/flamestrike
|
||||
name = "fiery shockwave"
|
||||
|
||||
total_turf_memory = 8
|
||||
pulses_remaining = 8
|
||||
pulse_delay = 0.2 SECONDS
|
||||
|
||||
/obj/effect/temporary_effect/pulse/snake/flamestrike/on_leave_turf(var/turf/T)
|
||||
if(T)
|
||||
new /obj/effect/temporary_effect/eruption/flamestrike(T, 1.2 SECONDS, "#f75000")
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 9.9 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 423 KiB After Width: | Height: | Size: 425 KiB |
@@ -939,6 +939,8 @@
|
||||
#include "code\game\objects\effects\map_effects\radiation_emitter.dm"
|
||||
#include "code\game\objects\effects\map_effects\screen_shaker.dm"
|
||||
#include "code\game\objects\effects\map_effects\sound_emitter.dm"
|
||||
#include "code\game\objects\effects\prop\columnblast.dm"
|
||||
#include "code\game\objects\effects\prop\snake.dm"
|
||||
#include "code\game\objects\effects\spawners\bombspawner.dm"
|
||||
#include "code\game\objects\effects\spawners\gibspawner.dm"
|
||||
#include "code\game\objects\effects\temporary_visuals\miscellaneous.dm"
|
||||
|
||||
Reference in New Issue
Block a user