The Misspelled Hero!
A general overview can be found here: https://github.com/smogon/pokemon-showdown/blob/master/sim/battle.ts#L490-L593 There unfortunately is no master list of event names, you can however look at the list of type definitions for some currently used one: https://github.com/smogon/pokemon-showdown/blob/master/sim/global-types.tsI've been reading documentation for adding a custom mode and i think I'm close to understanding how to do that, I just need to know where are all the events' name that I can add onEvent triggers on,
onSwitchIn, onSwitchOut are a few here, there isn't an event for type changes iirc, but there probably is a method on Pokemon objects. If not its probably done by changing pokemon.types and sending a protocal message back to the client.especially those where you can modify a move's type and switching in or out.
This would be a client side change. How it works for mega's, z-move's, and dynamax is it attaches an appropriate tag to the end of the choose command. For example, when dynamaxing and using Hydro Pump as Max Geyser, the command sent to the server isTo do so, I need to add a tick to the interface, similar to the box you can check to Dynamax your Pokémon the value of which is preserved and readable before and after you switch in or out, because the volatile status has to be added to the Pokémon that switches in. It could also totally replace the dynamax tick, the most important thing is that the value is preserved and readable after swtich out/in.
- How can I add this box?
/choose move hydropump max. (To be clear thats for the initial turn ONLY, max isn't attached if your already dynamaxed as it tells the server you want to dynamax that turn). This would be quite a tricky change, as you would need to add support in sim/side.ts for receiving and understanding a new flag like this, as well as support in the rest of the simulator process for handling it including putting it in the battle queue, and handling parsing the new event.
EDIT: You'll also need to inform the client that it can do this action (so it shows the checkbox, keeps it updated with the right state, ect). Remember that the server does all the work and has all the information, clients are sent limited amounts of data and display it in a fancy format thats much easier to understand for people (and it looks nice compared to raw text).
Depends on how you implement it, see above.- How can I read its value inside an "onEvent" trigger?
I dont understand this question sorry, can you try rephrasing it/explaining it further?- How can I know if the player has selected the first or second Pokémon to switch in after swtich in?
And before the other posts ask me to answer their questions: If I don't answer your questions I don't know the answer.