Rejected Terrain suppression events

This would add code to allow suppressing terrains in the same way that Cloud Nine suppresses weather, as well as the blocking of them in the same way that the Primals' Abilities do. While there's nothing in the games that does this, it would be of use to Other Metagames that wish to implement such a thing (Megas For All, for instance, already has an Ability that suppresses terrain, but it works by adding checks to everything each terrain does).

The code would involve adding an onSetTerrain event family for moves/abilities/etc. to be able to catch the terrain before it begins, a Terrain event type to categorize the Terrain's other events, an effectiveTerrain function to determine if terrain is being suppressed, and a check in runEvent/singleEvent to catch and prevent said Terrain events (plus Grassy Terrain's heal gets its own check, since it's Residual). I have already coded and tested these changes and confirmed that they work and are all necessary in order to work.

I don't know if there's a reason that everything weather-related is separated out (weathers are in conditions.ts, they get their own event id for this.add, even things like their damage modification being separated from onBasePower) but not anything terrain-related. I would assume that's how the game handles it, but if not, it might be worth considering equalizing weather and terrain effects on one side or the other.
 

DaWoblefet

Demonstrably so
is a Battle Simulator Administratoris a Community Leaderis a Programmeris a Top Researcheris a Top Tiering Contributoris a Social Media Contributor Alumnus
PS Admin
I don't think anyone would stop an OM that wanted to implement functionality based on suppressing Terrains. As long as it stays as a mod for that OM, there's no problem.
 
This wouldn't be an OM, the functionality would exist in base Showdown and just be unused. You can't add new types of events and event handlers in mods. (I haven't even been able to get editing runEvent/singleEvent to work, even though it's theoretically possible). There is precedent for adding code just for OMs, though they are usually ones that are getting permanent ladders.

I think these should be added because the idea is, conceptually, the same as the weather event stuff, but hasn't been added simply because there's nothing in the games that utilizes it. While it is possible to implement in an OM with checks in every function of every terrain... that's tedious and has to be hard-coded to whatever effect is being added. It's not clean programming.
 

HoeenHero

The Misspelled Hero!
is a Battle Simulator Administratoris a Programmeris a Super Moderatoris a Community Contributoris a Live Chat Contributor
PS Admin
If we are talking about an event that works but typescript complains about, feel free to add that to the type definition files if you going to use it for a mod on the main server.
If we are talking about a new event, and honestly just in general for these kinds of discussions, it probably best to talk about it in the development discord rather than in suggestions.
 

Zarel

Not a Yuyuko fan
is a Site Content Manageris a Battle Simulator Administratoris a Programmeris a Pokemon Researcheris an Administrator
Creator of PS
Events have performance impacts, so I'd rather not add this sort of feature without any OMs using it. Any OMs that want to use it can implement it as it comes up.
 

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top