Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stray Meteor event, five new special meteors, and another reason to build meteor shields #69550

Merged
merged 35 commits into from Sep 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8261e3c
new meatiores
Rhials Aug 19, 2022
7d6ca09
bluespace meteor (fucjk you do_teleport)
Rhials Aug 21, 2022
78f78f4
funny clown meteors
Rhials Aug 21, 2022
c71b124
ok well I guess this is an event now
Rhials Aug 21, 2022
7960cc5
material
Rhials Aug 21, 2022
b44f3e7
commit
Rhials Aug 21, 2022
b470071
future reference
Rhials Aug 21, 2022
05dd21e
this did absolutely nothing in retrospect. Please figure out in the m…
Rhials Aug 21, 2022
dcddfae
bluespace meteors now work, progress on un-dangering the bananium met…
Rhials Aug 21, 2022
1dd3fa9
huzzah, the banana meteor works
Rhials Aug 21, 2022
5227ee5
cleaner code, coder sprites
Rhials Aug 21, 2022
b46973b
whoops forgot that one
Rhials Aug 21, 2022
e798003
audio fix
Rhials Aug 21, 2022
5c03cdb
EMP meteors, some small tweaks
Rhials Aug 21, 2022
dacbdb5
why the fuck is there a line there
Rhials Aug 21, 2022
af5bf21
number tweak after some testing
Rhials Aug 21, 2022
2e3debe
wowee, shields now work, bananium has a good implementation now
Rhials Aug 21, 2022
ce67cca
brungle
Rhials Aug 21, 2022
ee1adfa
some fixes to the carp meteor
Rhials Aug 21, 2022
f6d3ba8
flava
Rhials Aug 21, 2022
626cd11
main focus is the special meteors here.
Rhials Aug 22, 2022
8708d68
hey wait a minute thgat doesnt need to be a var on the round event
Rhials Aug 23, 2022
207b084
(unfinished) admin setup framework
Rhials Aug 23, 2022
2166058
WIP fix please test
Rhials Aug 25, 2022
a88597c
I dont remember changing that?
Rhials Aug 26, 2022
d02d479
ice carp is now slightly more powerful than space dust
Rhials Aug 26, 2022
16bf908
WIP STILL
Rhials Aug 27, 2022
8030b7f
progress(?)
Rhials Aug 28, 2022
398e5f5
okay I give up
Rhials Aug 28, 2022
782118a
okay fuck it this is going up as a draft I give up
Rhials Aug 29, 2022
b741945
STRAY PIXEL ON BANANIUM METEOR SPRITE
Rhials Aug 29, 2022
3a23554
oh my fucking god THAT was it?
Rhials Aug 30, 2022
66e839c
fixes throwing default meteors
Rhials Aug 30, 2022
09132d8
cluster meteor poo poo code fixed
Rhials Sep 1, 2022
2b89c26
my own intelligence astounds me sometimes
Rhials Sep 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions code/datums/helper_datums/teleport.dm
Expand Up @@ -15,6 +15,7 @@
/obj/effect/wisp = FALSE,
/obj/effect/mob_spawn = FALSE,
/obj/effect/immovablerod = FALSE,
/obj/effect/meteor = FALSE,
))
if(delete_atoms[teleatom.type])
qdel(teleatom)
Expand Down
40 changes: 40 additions & 0 deletions code/modules/events/stray_meteor.dm
@@ -0,0 +1,40 @@
/datum/round_event_control/stray_meteor
name = "Stray Meteor"
typepath = /datum/round_event/stray_meteor
weight = 15 //Number subject to change based on how often meteors actually collide with the station
min_players = 15
max_occurrences = 3
earliest_start = 20 MINUTES
category = EVENT_CATEGORY_SPACE
description = "Throw a random meteor somewhere near the station."
///The selected meteor type if chosen through admin setup.
var/chosen_meteor

/datum/round_event_control/stray_meteor/admin_setup()
if(!check_rights(R_FUN))
return

var/list/meteor_list = list()
meteor_list += subtypesof(/obj/effect/meteor)
chosen_meteor = tgui_input_list(usr, "Too lazy for buildmode?","Throw meteor", meteor_list)


/datum/round_event/stray_meteor
announceWhen = 1
fakeable = FALSE //Already faked by meteors that miss

/datum/round_event/stray_meteor/start()
var/datum/round_event_control/stray_meteor/meteor_event = control
if(meteor_event.chosen_meteor)
var/chosen_meteor = meteor_event.chosen_meteor
var/list/passed_meteor = list()
passed_meteor[chosen_meteor] = 1
spawn_meteor(passed_meteor)
else
spawn_meteor(GLOB.meteorsD)

/datum/round_event/stray_meteor/announce(fake)
if(GLOB.meteor_list)
var/obj/effect/meteor/detected_meteor = pick(GLOB.meteor_list) //If we accidentally pick a meteor not spawned by the event, we're still technically not wrong
var/sensor_name = detected_meteor.signature
priority_announce("Our [sensor_name] sensors have detected an incoming signature approaching [GLOB.station_name]. Please brace for impact.", "Meteor Alert")
136 changes: 131 additions & 5 deletions code/modules/meteors/meteors.dm
Expand Up @@ -7,18 +7,24 @@ GLOBAL_VAR_INIT(meteor_wave_delay, 625) //minimum wait between waves in tenths o

//Meteors probability of spawning during a given wave
GLOBAL_LIST_INIT(meteors_normal, list(/obj/effect/meteor/dust=3, /obj/effect/meteor/medium=8, /obj/effect/meteor/big=3, \
/obj/effect/meteor/flaming=1, /obj/effect/meteor/irradiated=3)) //for normal meteor event
/obj/effect/meteor/flaming=1, /obj/effect/meteor/irradiated=3, /obj/effect/meteor/carp=1, /obj/effect/meteor/bluespace=1, \
/obj/effect/meteor/banana=1, /obj/effect/meteor/emp = 1)) //for normal meteor event

GLOBAL_LIST_INIT(meteors_threatening, list(/obj/effect/meteor/medium=4, /obj/effect/meteor/big=8, \
/obj/effect/meteor/flaming=3, /obj/effect/meteor/irradiated=3)) //for threatening meteor event
GLOBAL_LIST_INIT(meteors_threatening, list(/obj/effect/meteor/medium=4, /obj/effect/meteor/big=8, /obj/effect/meteor/flaming=3, \
/obj/effect/meteor/irradiated=3, /obj/effect/meteor/cluster=1, /obj/effect/meteor/carp=1, /obj/effect/meteor/bluespace=2, /obj/effect/meteor/emp = 2)) //for threatening meteor event

GLOBAL_LIST_INIT(meteors_catastrophic, list(/obj/effect/meteor/medium=5, /obj/effect/meteor/big=75, \
/obj/effect/meteor/flaming=10, /obj/effect/meteor/irradiated=10, /obj/effect/meteor/tunguska = 1)) //for catastrophic meteor event
/obj/effect/meteor/flaming=10, /obj/effect/meteor/irradiated=10, /obj/effect/meteor/cluster=8, /obj/effect/meteor/tunguska=1, \
/obj/effect/meteor/carp=2, /obj/effect/meteor/bluespace=10, /obj/effect/meteor/emp = 8)) //for catastrophic meteor event

GLOBAL_LIST_INIT(meteorsB, list(/obj/effect/meteor/meaty=5, /obj/effect/meteor/meaty/xeno=1)) //for meaty ore event

GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust=1)) //for space dust event

GLOBAL_LIST_INIT(meteorsD, list(/obj/effect/meteor/medium=15, /obj/effect/meteor/big=10, \
/obj/effect/meteor/flaming=25, /obj/effect/meteor/irradiated=30, /obj/effect/meteor/carp=25, /obj/effect/meteor/bluespace=30, \
/obj/effect/meteor/banana=25, /obj/effect/meteor/meaty=10, /obj/effect/meteor/meaty/xeno=8, /obj/effect/meteor/emp = 30, \
/obj/effect/meteor/cluster=20, /obj/effect/meteor/tunguska=1)) //for stray meteor event (bigger numbers for a bit finer weighting)

///////////////////////////////
//Meteor spawning global procs
Expand Down Expand Up @@ -115,6 +121,9 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust=1)) //for space dust eve
///Lifetime in seconds
var/lifetime = DEFAULT_METEOR_LIFETIME

///Used by Stray Meteor event to indicate meteor type (the type of sensor that "detected" it) in announcement
var/signature = "motion"

/obj/effect/meteor/Initialize(mapload, turf/target)
. = ..()
z_original = z
Expand Down Expand Up @@ -264,12 +273,14 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust=1)) //for space dust eve
//Flaming meteor
/obj/effect/meteor/flaming
name = "flaming meteor"
desc = "An veritable shooting star, both beautiful and frightening. You should probably keep your distance from this."
icon_state = "flaming"
hits = 5
heavy = TRUE
meteorsound = 'sound/effects/bamf.ogg'
meteordrop = list(/obj/item/stack/ore/plasma)
threat = 20
signature = "thermal"

/obj/effect/meteor/flaming/meteor_effect()
..()
Expand All @@ -278,18 +289,130 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust=1)) //for space dust eve
//Radiation meteor
/obj/effect/meteor/irradiated
name = "glowing meteor"
desc = "An irradiated chunk of space rock. You could probably stop and appreciate its incandescent green glow, if it weren't moving so fast."
icon_state = "glowing"
heavy = TRUE
meteordrop = list(/obj/item/stack/ore/uranium)
threat = 15

signature = "radiation"

/obj/effect/meteor/irradiated/meteor_effect()
..()
explosion(src, light_impact_range = 4, flash_range = 3, adminlog = FALSE)
new /obj/effect/decal/cleanable/greenglow(get_turf(src))
radiation_pulse(src, max_range = 3, threshold = RAD_MEDIUM_INSULATION, chance = 80)

//Cluster meteor
/obj/effect/meteor/cluster
name = "cluster meteor"
desc = "A cluster of densely packed rocks, with a volatile core. You should probably get out of the way."
icon_state = "sharp"
hits = 9
heavy = TRUE
meteorsound = 'sound/effects/break_stone.ogg'
threat = 25
signature = "ordnance"
///Number of fragmentation meteors to be spawned
var/cluster_count = 8

/obj/effect/meteor/cluster/meteor_effect()
..()

var/start_turf = get_turf(src)

while(cluster_count > 0)
var/startSide = pick(GLOB.cardinals)
var/turf/destination = spaceDebrisStartLoc(startSide, z)
new /obj/effect/meteor/cluster_fragment(start_turf, destination)
cluster_count--

explosion(src, heavy_impact_range = 2, light_impact_range = 3, flash_range = 4, adminlog = FALSE)

/obj/effect/meteor/cluster_fragment
name = "cluster meteor fragment"
desc = "A fast-moving fragment of exploded cluster-rock."
icon_state = "dust"

//frozen carp "meteor"
/obj/effect/meteor/carp
name = "frozen carp"
icon_state = "carp"
desc = "Am I glad he's frozen in there, and that we're out here."
hits = 4
meteorsound = 'sound/effects/ethereal_revive_fail.ogg'
meteordrop = list(/mob/living/simple_animal/hostile/carp)
dropamt = 1
threat = 5
signature = "fishing and trawling"

/obj/effect/meteor/carp/Initialize(mapload)
if(prob(2))
meteordrop = list(/mob/living/simple_animal/hostile/carp/megacarp) //hehe
return ..()

//bluespace meteor
/obj/effect/meteor/bluespace
name = "bluespace meteor"
desc = "A large geode containing bluespace dust at its core, hurtling through space. That's the stuff the crew are here to research. How convenient for them."
icon_state = "bluespace"
dropamt = 3
hits = 12
meteordrop = list(/obj/item/stack/ore/bluespace_crystal)
threat = 15
signature = "bluespace flux"

/obj/effect/meteor/bluespace/Bump()
..()
if(prob(35))
do_teleport(src, get_turf(src), 6, asoundin = 'sound/effects/phasein.ogg', channel = TELEPORT_CHANNEL_BLUESPACE)

/obj/effect/meteor/banana
name = "bananium meteor"
desc = "Maybe it's a chunk blasted off of the legendary Clown Planet... How annoying."
icon_state = "bananium"
dropamt = 4
hits = 175 //Honks everything, including space tiles. Depending on the angle/how much stuff it hits, there's a fair chance that it will spare the station from the actual explosion
meteordrop = list(/obj/item/stack/ore/bananium)
meteorsound = 'sound/items/bikehorn.ogg'
threat = 15
movement_type = PHASING
signature = "comedy"

/obj/effect/meteor/banana/meteor_effect()
..()
playsound(src, 'sound/items/AirHorn.ogg', 100, TRUE, -1)
for(var/atom/movable/object in view(4, get_turf(src)))
var/turf/throwtarget = get_edge_target_turf(get_turf(src), get_dir(get_turf(src), get_step_away(object, get_turf(src))))
object.safe_throw_at(throwtarget, 5, 1, force = MOVE_FORCE_STRONG)

/obj/effect/meteor/banana/ram_turf(turf/bumped)
for(var/mob/living/slipped in get_turf(bumped))
slipped.slip(100, slipped.loc,- GALOSHES_DONT_HELP|SLIDE, 0, FALSE)
slipped.visible_message(span_warning("[src] honks [slipped] to the floor!"), span_userdanger("[src] harmlessly passes through you, knocking you over."))
get_hit()

/obj/effect/meteor/banana/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
..()
return

/obj/effect/meteor/emp
name = "electromagnetically charged meteor"
desc = "It radiates with captive energy, ready to be let loose upon the world."
icon_state = "bluespace"
hits = 6
threat = 10
signature = "electromagnetic interference"

/obj/effect/meteor/emp/Move()
. = ..()
if(.)
new /obj/effect/temp_visual/impact_effect/ion(get_turf(src))

/obj/effect/meteor/emp/meteor_effect()
..()
playsound(src, 'sound/weapons/zapbang.ogg', 100, TRUE, -1)
empulse(src, 3, 8)

//Meaty Ore
/obj/effect/meteor/meaty
name = "meaty ore"
Expand All @@ -301,6 +424,7 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust=1)) //for space dust eve
meteordrop = list(/obj/item/food/meat/slab/human, /obj/item/food/meat/slab/human/mutant, /obj/item/organ/internal/heart, /obj/item/organ/internal/lungs, /obj/item/organ/internal/tongue, /obj/item/organ/internal/appendix/)
var/meteorgibs = /obj/effect/gibspawner/generic
threat = 2
signature = "culinary material"

/obj/effect/meteor/meaty/Initialize(mapload)
for(var/path in meteordrop)
Expand Down Expand Up @@ -332,6 +456,7 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust=1)) //for space dust eve
color = "#5EFF00"
meteordrop = list(/obj/item/food/meat/slab/xeno, /obj/item/organ/internal/tongue/alien)
meteorgibs = /obj/effect/gibspawner/xeno
signature = "exotic culinary material"

/obj/effect/meteor/meaty/xeno/Initialize(mapload)
meteordrop += subtypesof(/obj/item/organ/internal/alien)
Expand All @@ -352,6 +477,7 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust=1)) //for space dust eve
meteorsound = 'sound/effects/bamf.ogg'
meteordrop = list(/obj/item/stack/ore/plasma)
threat = 50
signature = "armageddon"

/obj/effect/meteor/tunguska/Move()
. = ..()
Expand Down
2 changes: 2 additions & 0 deletions code/modules/station_goals/shield.dm
Expand Up @@ -179,6 +179,8 @@
// Update the weight of all meteor events
for(var/datum/round_event_control/meteor_wave/meteors in SSevents.control)
meteors.weight *= mod
for(var/datum/round_event_control/stray_meteor/stray_meteor in SSevents.control)
stray_meteor.weight *= mod

/obj/machinery/satellite/meteor_shield/Destroy()
. = ..()
Expand Down
Binary file modified icons/obj/meteor.dmi
Binary file not shown.
1 change: 1 addition & 0 deletions tgstation.dme
Expand Up @@ -2889,6 +2889,7 @@
#include "code\modules\events\spacevine.dm"
#include "code\modules\events\spider_infestation.dm"
#include "code\modules\events\stray_cargo.dm"
#include "code\modules\events\stray_meteor.dm"
#include "code\modules\events\wisdomcow.dm"
#include "code\modules\events\wormholes.dm"
#include "code\modules\events\holiday\halloween.dm"
Expand Down