Random Events, some meteor stuff; meteorhit()

How, what and why to code in BYOND.
Post Reply
User avatar
Cheridan
Joined: Tue Apr 15, 2014 6:04 am
Byond Username: Cheridan

Random Events, some meteor stuff; meteorhit()

Post by Cheridan » #1086

So I'm planning on taking another crack at improving Random Events in general, this time mainly focusing on meteors.
First off, based on feedback, Anomaly type events will be made a bit more common, and take a bit more time before disappearing, allowing people to respond to them better. Some of them were also stated to be too weak (pyroclastic in particular), so I'll tweak them around.

Secondly, fuck space dust. It's just meteors but shittier. Dumped. It's design purpose at the moment is literally to be a filler event so the better events don't pop up so often. what.
If events happen too often after the removal of space dust, then the rate can be lowered in general; no sense in having the rate be artificially high and having the 'drop table' be filled with crap.

Next, meteors are ugly. They have unorganized, awful code like:

Code: Select all

/mob/living/carbon/human/meteorhit(O as obj)
	for(var/mob/M in viewers(src, null))
		if ((M.client && !( M.blinded )))
			M.show_message("\red [src] has been hit by [O]", 1)
	if (health > 0)
		var/obj/item/organ/limb/affecting = get_organ(pick("chest", "chest", "chest", "head"))
		if(!affecting)	return
		if (istype(O, /obj/effect/immovablerod))
			if(affecting.take_damage(101, 0))
				update_damage_overlays(0)
		else
			if(affecting.take_damage((istype(O, /obj/effect/meteor/small) ? 10 : 25), 30))
				update_damage_overlays(0)
		updatehealth()
	return
oh god look at it and then there's this fucking while loop that doesn't have anything under it.

Meteors will be replaced with a small / medium / large setup (they kind of already do but the small and mediums mostly act exactly the same, but certain items check the icon state to see if the meteor is medium and then it might take some more damage ahhh it's so bad).

Smalls will probably call ex_act(2) directly on whatever it hits.
Mediums will make a smallish explosion.
Big ones will make a bigger one.
the meteorhit() proc which currently decides damage will be removed entirely. The damage will be handled by the explosions or ex_act() instead, which has much better implementation than meteoract() does. This will solve some bugs like how simple_animals like corgis are immune to Immovable Rods
(if i feel like it maybe i'll make some more too like a flaming meteor that lights people on fire, or an irradiated meteor.)

Stretch goal is making the meteors get lodged into crap, and then you can mine them to get resources.
Image
/tg/station spriter, admin, and headcoder. Feel free to contact me via PM with questions, concerns, or requests.
User avatar
Jeb
Joined: Thu Apr 17, 2014 4:01 pm
Byond Username: Stapler2025

Re: Random Events, some meteor stuff; meteorhit()

Post by Jeb » #1089

Add a meteor that spawns xenos.
Image
Guy that made a thing that got put on the homepage of /tg/station13
Defeated in the Great Purge of 2014
[Security] Fiz Bump says, "Beats me, I'm not a scientist. But this is a problem that can be solved with harmbatons."
Johnson Fitzwell asks, "HOW THE FUCK ARE YOU STILL ALIVE?"
Image
User avatar
MisterPerson
Board Moderator
Joined: Tue Apr 15, 2014 4:26 pm
Byond Username: MisterPerson

Re: Random Events, some meteor stuff; meteorhit()

Post by MisterPerson » #1097

While you're at it, please make the meteors garbage collect.

Improving meteors is great in my book.
I code for the code project and moderate the code sections of the forums.

Feedback is dumb and it doesn't matter
User avatar
Kelenius
Joined: Sun Apr 20, 2014 10:53 am
Byond Username: Kelenius

Re: Random Events, some meteor stuff; meteorhit()

Post by Kelenius » #1101

Meteors really should be less fuck-you-deadly.
User avatar
Rockdtben
Site Admin
Joined: Mon Apr 14, 2014 11:54 pm
Byond Username: Rockdtben
Github Username: Rockdtben
Contact:

Re: Random Events, some meteor stuff; meteorhit()

Post by Rockdtben » #1164

Holy shit great find Cheridan. That loop is awful!
Custom Software Solutions, Mentorship, and game development ----> Main Site
Game Master: 03/24/2022 - Now || Domain Holder: 04/15/2014 - 03/24/2022 || Code Project Lead: 02/01/2014 - 10/07/2014 || G-Admin: 12/29/2013 - 04/04/2015 || T-Admin: 3/29/2013 - 12/29/2013 || Codermin: ? - 3/29/2013 || Started Playing: 6/13/2006 || "Took no shit from shitters" - MrStonedOne
User avatar
Cheridan
Joined: Tue Apr 15, 2014 6:04 am
Byond Username: Cheridan

Re: Random Events, some meteor stuff; meteorhit()

Post by Cheridan » #1172

Actually, as it turns out it's the end of a do...while loop (which I didn't even know BYOND had until now).

So what do you guys want done with emitters/singu containment? Currently they're coded so meteors that hit those objects don't explode (of course the meteor could hit RIGHT NEXT to the emitter and blow it up with the explosion anyway).
Could make those objects immune to explosions (c4 should still delete them however, since it's a little special).
Or we could have a grille shield protecting it, or something.
Or, I dunno. Leave it? Meteors break things.

Also, currently the small meteors have PASSGRILLE, which means grilles aren't effective at stopping them. Should this stay? I mean, they're small, but how small is a matter of whatever we feel like. Considering that grilles are how we protect things from meteors, having meteors that just go through them feels weak.
Image
/tg/station spriter, admin, and headcoder. Feel free to contact me via PM with questions, concerns, or requests.
User avatar
Psyentific
Joined: Mon Apr 21, 2014 7:44 am
Byond Username: Psyentific
Location: Vancouver, Canada
Contact:

Re: Random Events, some meteor stuff; meteorhit()

Post by Psyentific » #1174

Give the singularity and containment the same sort of protection Atmo has - One, maybe two layers of grilleshields. Otherwise, yes, don't make it meteor-proof - That just adds to the !!FUN!!
I haven't logged into SS13 in at least a year.
AseaHeru
Rarely plays
Joined: Mon Apr 21, 2014 12:26 pm

Re: Random Events, some meteor stuff; meteorhit()

Post by AseaHeru » #1188

I have seen three layer thick shields on maps... I think it was meta?
Urist shure does in spots.
I am located here, lurking in your posts, leaving piles of transparent wordings and being confused. Oh, I also try to map...

This, this is an example of what I leave for you.
Also, these days I mostly play Ursit McStation, mostly because I like roleplay.
User avatar
Cheridan
Joined: Tue Apr 15, 2014 6:04 am
Byond Username: Cheridan

Re: Random Events, some meteor stuff; meteorhit()

Post by Cheridan » #1508

https://github.com/tgstation/-tg-station/pull/3509

welp there it is.
meteors in general will be a little more "i should probably get inside" than before, since they're better at breaking through walls instead of just hitting them and exploding. Walls/girders and window/grille setups are pretty good at stopping them still (since each hit on a window counts against its amount of hits) but in testing I saw some pretty great instances of them sliding all the way through a maintenance tunnel, busting out the airlock at the end and landing in the middle of a room.
Each kind of meteor scatters a different type of debris around. Space dust drops sand, normal ones drop iron ore, etc. After a shower you can collect them up and use them for repairs or whatever.

It's easy to add new unique types of meteors, too. I've considered bluespace meteors that warp people around instead of exploding, and drop bluespace crystals as debris. Spooky meteors that drop soul shards or something.
Image
/tg/station spriter, admin, and headcoder. Feel free to contact me via PM with questions, concerns, or requests.
User avatar
Psyentific
Joined: Mon Apr 21, 2014 7:44 am
Byond Username: Psyentific
Location: Vancouver, Canada
Contact:

Re: Random Events, some meteor stuff; meteorhit()

Post by Psyentific » #1565

Bluespace Meteors teleporting people? Spooky meteors that turn people into Skellingtons and/or visible ghosts (If the hit would crit them)? Fund it.
I haven't logged into SS13 in at least a year.
Post Reply

Who is online

Users browsing this forum: No registered users