-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Catastrophe events, Leviathan (#458)
* Catastrophe events, Leviathan * Some fixes * Fix everything * Update example config * Even more updates! * Fix * Don't play sounds to new players * More adjustments * Bubble effect doesn't convert open or space turfs * Fix bubble * Fixes * Infestation mobs are weak to fire * Aggregate infestation caste! * Resolve conflicts
- Loading branch information
1 parent
8f93215
commit a000269
Showing
33 changed files
with
564 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Nothing more than a far more lazy copy of carp migration | ||
// Used exclusively by infestation hive overmap obstacle | ||
/datum/event/infestation_hive_space | ||
var/mobs_per_tick = 1 | ||
/// Types of mobs that we can spawn in and throw at the ship, mostly flying types | ||
var/list/available_mob_types = list(/mob/living/simple_animal/hostile/infestation/floatfly) | ||
|
||
/datum/event/infestation_hive_space/announce() | ||
var/announcement = "" | ||
if(severity > EVENT_LEVEL_MODERATE) | ||
announcement = "A massive migration of unknown biological entities has been detected in the vicinity of the [location_name()]. Exercise external operations with caution." | ||
else | ||
announcement = "A large migration of unknown biological entities has been detected in the vicinity of the [location_name()]. Caution is advised." | ||
|
||
command_announcement.Announce(announcement, "[location_name()] Sensor Array", zlevels = affecting_z) | ||
|
||
/datum/event/infestation_hive_space/tick() | ||
SpawnMobs() | ||
|
||
/datum/event/infestation_hive_space/proc/SpawnMobs(dir, speed) | ||
if(!living_observers_present(affecting_z)) | ||
return | ||
|
||
var/Z = pick(affecting_z) | ||
if(!dir) | ||
dir = pick(GLOB.cardinal) | ||
|
||
if(!speed) | ||
speed = rand(1, 6) | ||
|
||
for(var/i = 1 to mobs_per_tick) | ||
var/turf/T = get_random_edge_turf(dir,TRANSITIONEDGE + 2, Z) | ||
if(istype(T, /turf/space)) | ||
var/mob/living/simple_animal/hostile/M = pick(available_mob_types) | ||
M = new M(T) | ||
M.throw_at(get_random_edge_turf(GLOB.reverse_dir[dir], TRANSITIONEDGE + 2, Z), 250, speed, callback = CALLBACK(src, /datum/event/infestation_hive_space/proc/check_gib,M)) | ||
|
||
/datum/event/infestation_hive_space/proc/check_gib(mob/living/L) | ||
if(L.health <= 15) | ||
L.gib() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
// Sends you to fucking hell for daring to enter this sector, or for being too slow | ||
// Bombards the ship with beams that may damage the ship and cause breaches | ||
// Additionally, spawns hearts of the hive directly on the ship | ||
/datum/event/leviathan_attack | ||
has_skybox_image = TRUE | ||
var/beams_per_tick = 1 | ||
// Checks against world.time, not event ticks | ||
var/infestation_spawn_cooldown | ||
var/infestation_spawn_cooldown_time = 60 SECONDS | ||
/// How many random mobs are spawned around heart of the hive on activation | ||
var/infestation_spawn_count = 5 | ||
/// Types of mobs = chance the infestation spawn will create; It utilizes pickweight | ||
var/list/infestation_spawn_types = list( | ||
/mob/living/simple_animal/hostile/infestation/larva = 30, | ||
/mob/living/simple_animal/hostile/infestation/broodling = 15, | ||
/mob/living/simple_animal/hostile/infestation/floatfly = 10, | ||
/mob/living/simple_animal/hostile/infestation/eviscerator = 6, | ||
/mob/living/simple_animal/hostile/infestation/spitter = 5, | ||
/mob/living/simple_animal/hostile/infestation/assembler = 3, | ||
/mob/living/simple_animal/hostile/infestation/rhino = 1, | ||
/mob/living/simple_animal/hostile/infestation/larva/implant/implanter = 1, | ||
) | ||
|
||
/datum/event/leviathan_attack/get_skybox_image() | ||
var/image/res = overlay_image('icons/skybox/ionbox.dmi', "ions", COLOR_MAROON, RESET_COLOR) | ||
res.blend_mode = BLEND_ADD | ||
return res | ||
|
||
/datum/event/leviathan_attack/announce() | ||
command_announcement.Announce( | ||
"DANGER! [location_name()] is currently in close vicinity to Leviathan-class abomination!\n\ | ||
It is advised to immediately leave the area before damage to the ship reaches critical level!", | ||
"[GLOB.using_map.company_name] Infestation Alert", | ||
zlevels = affecting_z, | ||
) | ||
|
||
/datum/event/leviathan_attack/tick() | ||
BeamAttack() | ||
if(world.time >= infestation_spawn_cooldown) | ||
InfestationSpawn() | ||
|
||
/datum/event/leviathan_attack/proc/BeamAttack() | ||
if(!living_observers_present(affecting_z)) | ||
return | ||
|
||
var/Z = pick(affecting_z) | ||
var/dir = pick(GLOB.cardinal) | ||
|
||
for(var/i = 1 to beams_per_tick) | ||
var/turf/T = get_random_edge_turf(dir, TRANSITIONEDGE + 2, Z) | ||
if(istype(T, /turf/space)) | ||
var/obj/item/projectile/beam/gigabeam/leviathan/P = new(T) | ||
P.dispersion += pick(0, 0.1, 0.2) | ||
P.launch(get_random_edge_turf(GLOB.reverse_dir[dir], TRANSITIONEDGE + 2, Z), pick(BP_ALL_LIMBS), T) | ||
|
||
/datum/event/leviathan_attack/proc/InfestationSpawn(turf/T) | ||
infestation_spawn_cooldown = world.time + infestation_spawn_cooldown_time | ||
if(!living_observers_present(affecting_z)) | ||
return | ||
|
||
if(!istype(T)) | ||
T = pick_area_turf_in_single_z_level(list(/proc/is_not_space_area), list(/proc/not_turf_contains_dense_objects, /proc/is_not_open_space, /proc/is_not_space_turf), pick(affecting_z)) | ||
|
||
new /obj/effect/hive_heart(T) | ||
new /datum/bubble_effect/infestation(T.x, T.y, T.z, 1, 1) | ||
var/list/valid_spawns = list() | ||
for(var/turf/TT in oview(T, 3)) | ||
if(is_space_turf(TT)) | ||
continue | ||
if(is_open_space(TT)) | ||
continue | ||
valid_spawns += TT | ||
for(var/i = 1 to infestation_spawn_count) | ||
var/mob/living/L = pickweight(infestation_spawn_types) | ||
var/turf/TT = pick(valid_spawns) | ||
new L(TT) | ||
|
||
/datum/bubble_effect/infestation/New() | ||
..() | ||
START_PROCESSING(SSfastprocess, src) | ||
|
||
/datum/bubble_effect/infestation/Destroy() | ||
STOP_PROCESSING(SSfastprocess, src) | ||
return ..() | ||
|
||
/datum/bubble_effect/infestation/Process() | ||
if(radius > 7) | ||
qdel(src) | ||
return PROCESS_KILL | ||
Tick() | ||
|
||
/datum/bubble_effect/infestation/TurfEffect(turf/T) | ||
if(TICK_CHECK) | ||
return TRUE | ||
if(T.density || is_open_space(T) || is_space_turf(T)) | ||
return | ||
if(prob(33)) | ||
return // Continue | ||
T.ChangeTurf(/turf/simulated/floor/exoplanet/flesh) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// This event spawns a "Leaviathan" - giant abomination overmap "obstacle"; | ||
// As long as it is alive - the sector will be constantly flooded with infestation hive overmap obstacles, | ||
// which operate similar to carp schools. | ||
// When ship approaches Leviathan itself - it will be bombarded with abominations and flesh meteors. | ||
// It takes 8 OFD charges to kill it. | ||
/datum/event/leviathan_spawn | ||
announceWhen = 5 | ||
endWhen = 6 | ||
var/spawned_loc = "UNKNOWN" | ||
|
||
/datum/event/leviathan_spawn/announce() | ||
command_announcement.Announce( | ||
"Leviathan class abomination has been spotted within the sector. All civilian personnel is advised to evacuate \ | ||
to the closest safe area immediatelly. \nMilitary responders must contain the threat until it is too late.\n\n\ | ||
Last known coordinates of the creature: [spawned_loc]", | ||
"[GLOB.using_map.company_name] Infestation Alert", | ||
'sound/effects/alarm_catastrophe.ogg', | ||
zlevels = affecting_z, | ||
) | ||
|
||
/datum/event/leviathan_spawn/start() | ||
var/list/candidate_turfs = block(locate(OVERMAP_EDGE, OVERMAP_EDGE, GLOB.using_map.overmap_z), locate(GLOB.using_map.overmap_size - OVERMAP_EDGE, GLOB.using_map.overmap_size - OVERMAP_EDGE, GLOB.using_map.overmap_z)) | ||
candidate_turfs = where(candidate_turfs, /proc/can_not_locate, /obj/effect/overmap/visitable) | ||
var/turf/T = pick(candidate_turfs) | ||
new /obj/effect/temp_visual/ftl(T) | ||
new /obj/effect/overmap/event/leviathan(T) | ||
spawned_loc = "[T.x]:[T.y]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.