-
Notifications
You must be signed in to change notification settings - Fork 1
Tutorial Field Effects
Battle-wide state as plain records on the hook machinery -- nothing hardcoded.
{
"id": "field_effect:rain", "name": "RAIN",
"scope": "global", "channel": "weather",
"hooks": {"on_modify_damage": "script:rain_boost"}
}- Global effects hold a named channel (setting a new weather replaces the old -- replacement is the channel's semantics).
-
Side effects belong to one side and can stack (
max_layers, Spikes-style) or time out (durationin turns -- the engine counts down and clears).
Handlers set and clear them with two intents: field_set("self", "field_effect:rain") and field_clear("self", "weather") -- from any ability, item, or other field effect. The effect's own hooks then run ownerless after both monsters' abilities, reading the same state() view (field.weather, self.effect.spikes, self.max_hp, self.type1, and -- on damage hooks -- move_type/move_category).
A rain that boosts water moves:
if is_attacker and move_type == "WATER" { return damage * 3 / 2 }
if is_attacker and move_type == "FIRE" { return damage / 2 }
return damage
Project Vermilion ships the full modern set (rain/sun/sand/hail, Stealth Rock, Spikes, Reflect, Light Screen) as readable examples in its overlay -- copy and adapt freely; they're original scripts.
Monworks: MIT code · CC0 samples · everything pictured is original content. The faithful Pokémon Red build derives from your own local pokered clone and is never distributed. Pokémon is © Nintendo/Creatures/GAME FREAK; this is an unaffiliated fan engineering project.
Play
Create
Tutorials
- Writing Text
- Battle Backdrops
- Colors and Palettes
- Display Filters and Shaders
- Widescreen and Scaling
- Quality-of-Life Knobs
- Overlays (Recipes)
- Abilities & Battle Hooks
- Modern Individuals
- Per-Individual Fields
- Field Effects
- The Modern Ruleset
- Per-Save Rulesets
- Six Stats
- The Clock
- Conditioned Bindings
- Day and Night
- Sprite Variants
- Overworld Spawns
- Language Packs
- Set-Piece Battles & Narration
- Run a Server
- Join a Server
Elsewhere