If you are still using the old URL (datacrystal.romhacking.net), please update your bookmarks! The old URL may stop working at any time.
The current URL is datacrystal.tcrf.net.
The current URL is datacrystal.tcrf.net.
EarthBound Beginnings/Battle actions
< EarthBound Beginnings(Redirected from EarthBound Zero:Battle actions)
Jump to navigation
Jump to search
This is a sub-page of EarthBound Beginnings.
Battle Actions define the behavior of each action that can be taken during combat. Each battle action has an ID and script that defines how the action works.
Known IDs
- 01 - Attack
- 02 - Combo Attack
- 03 - Bite (Attack)
- 04 - Scratch (Attack)
- 05 - Bore down (Attack)
- 06 - Run over (15 typeless damage)
- 07 - Final desparation attack (200 typeless damage, user dies)
- 08 - Giegue's Attack (typeless PK Freeze Ω)
- 09 - PK Fire α
- 0A - PK Fire β
- 0B - PK Fire γ
- 0C - PK Freeze α
- 0D - PK Freeze β
- 0E - PK Freeze Ω
- 0F - PK Freeze γ
- 10 - Bomb
- 11 - Super Bomb
- 12 - PK Beam α
- 13 - PK Beam β
- 14 - PK Beam Ω
- 15 - PK Beam γ
- 16 - Insecticide (bug spray)
- 17 - PK Thunder α
- 18 - PK Thunder β
- 19 - Explode: 60 fire damage, user dies
- 1A - Burst into flames: 30 fire damage, user dies
- 1B - Offense Up: +100% to single ally
- 1C - Sing
- 1D - Defense Up α: +100% to single ally
- 1E - Defense Up β : +100% to all allies
- 1F - Quick Up: +20 Speed flat, fails if base speed is >=128 (bug in NES, not in GBA)
- 20 - Unknown (targets one ally)
- 21 - Unknown
- 22 - Bag Lady says something scary: fight down by 40
- 23 - Enemy says something nasty: fight down by 20
- 24 - Unknown
- 25 - Defense Down α: defense down by 40
- 26 - Unknown
- 27 - Unknown
- 28 - Rage: offense up by 20
- 29 - Lifeup α
- 2A - Lifeup β
- 2B - Lifeup γ
- 2C - Lifeup π
- 2D - Lifeup Ω
- 2E - Restore energy (Energy Robot Lifeup γ)
- 2F - PSI Stone: Restore 20 PP, chance to break 1/8
- 30 - PSI Magnet : Steal 10 PP, can miss
- 31 - Darkness
- 32 - Emit exhaust fumes : ~20 typeless damage to all, fight -20
- 33 - Unknown
- 34 - Enemy dehydration attack: Offense and defense decreases by 50%
- 35 - Unknown
- 36 - PSI Block
- 37 - Powershield
- 38 - PSI Shield α
- 39 - PSI Shield β
- 3A - Unknown
- 3B - Unknown
- 3C - Megaphone
- 3D - Stinger (Poison)
- 3E - Stone Spray
- 3F - Gabilan spews a sticky substance - (acts like Darkness)
- 40 - Satania did something disturbing - (acts like Brainshock)
- 41 - Used a Demon Seed (it isn't actually an item)
- 42 - Brainshock
- 43 - Brain Cyclone
- 44 - Hypnosis
- 45 - Paralysis
- 46 - Trips (turn waster)
- 47 - Rope
- 48 - Run away (50% chance)
- 49 - Enemy tries to call for help
- 4A - Woodoh sprout seeds (call for help)
- 4B - Steal food item (only move to never be called in certain scenarios)
- 4C - Laughs (turn waster)
- 4D - Unknown
- 4E - Unknown
- 4F - Plays dead (turn waster)
- 50 - Hippie prays (turn waster)
- 51 - Bonus Swoosh says hello and gives bonus EXP
- 52 - Unknown
- 53 - Guard (enemies)
- 54 - Mr. Batty confuses itself
- 55 - Unknown
- 56 - Unknown
- 57 - Unknown (targets one enemy)
- 58 - Unknown
- 59 - Guard (players)
- 5A - Unknown
- 5B - Healing α: cures poison
- 5C - Dimension Slip
- 5D - Enemy edges closer / approaches slowly: offense +20, hidden from the player for who knows what reason
- 5E - Unknown
- 5F - Angel Seed: cures confusion
- 60 - Flea Bag
- 61 - Unknown
- 62 - Titanian Advanced Confusion (Puzzled Status)
- 63 - Healing β: cures paralysis
- 64 - Healing π: cures sleep
- 65 - Super healing : cures unconscious
- 66 - Shield off
- 67 - Flamethrower
- 68 - Unknown
- 69 - Laser beam (alpha beam)
- 6A - Death beam (beta beam)
- 6B - Robo Girls smile boldly: Defense up to self
- 6C - Dragon's strange howl: Defense down by 40, targets one
- 6D - Flashdark
- 6E - Sticky Machine
- 6F - Checking
- 70 - Unknown
- 71 - Orange Juice
- 72 - French Fries
- 73 - Magic Herb
- 74 - Sports Drink
- 75 - Big Bag : 30 uses
- 76 - Inhaler
- 77 - Super Spray
- 78 - Love Words
- 79 - Swear Words
- 7A - Hamburger
- 7B - Medicine
- 7C - Antidote : (Healing α)
- 7D - Pencil Rocket
- 7E - Unknown
- 7F - Unknown
- 80 - Uses paralysis gas: used by no enemies, uses Sticky Machine code for some reason (it can break)
- 81 - Unknown
- 82 - Defense Down β: -40 Defense
- 83 - PK Thunder γ
- 84 - Bread (eating it in battle)
- 85 - PK Fire Ω
- 86 - Healing γ
Script
The battle action ID selects a pointer from the pointer table at PRG22$97FB, which points to the start of a script.
Code | Action |
---|---|
00 | End script |
11 | Exit combat (successful run away) |
12 | Play attack hit sound and shake screen |
13 | Play attack hit sound and shake screen horizontally |
14 | Call for help |
15 | Scatter seeds |
17 | Play attack hit sound and flash screen red (fire) |
18 | Play attack hit sound and flash screen blue (freeze) |
19 | Play attack hit sound and flash screen light blue (thunder) |
1A | Play attack hit sound and flash screen orange (beam) |
1B | Play attack hit sound and flash screen green (smash) |
20 nn | Check if PSI index nn can be performed (attacker has enough PP and defender is not PSI-protected).
Play PSI attack sound and continue script if can hit, display failure text and end script if not. nn is the PSI index, offset from the PSI data table starting at PRG0$9E00 (see psi data) |
40 00 | Apply final healing using battle engine. |
40 05 | Restore target to full HP. |
40 06 | Apply final damage using battle engine. |
40 09 | Reduce HP of target to 0, except for some bosses, need to investigate which ones. |
40 0A | Reduce target to 1-4 HP. |
51 | Check for confusion damage to self on physical attack |
52 | Check for confusion damage to self on PSI attack |
55 | Set target to first attacker |
56 | Set target to next defender (used for multi-target attacks) |
60 nn | Calculate Fight normal base damage using battle engine. nn appears to be unused. |
61 nn | Calculate Fight SMAAASH!! base damage using battle engine. nn appears to be unused. |
62 nn | Set base damage or healing to nn. |
64 nn | Unknown, PSI-related? Or byte with 57 and store |
66 nn | Unknown, Fight-related? |
67 nn | Select attack sound effect nn |
68 nn | Display text. nn is a one-byte pointer offset from PRG0 $9081. Multiply the PRG0 pointer
value by 3 and add $8000 to get the address of the text pointer in PRG24. |
69 nn | Play sound effect nn |
72 pp pp | Jump to script at pp pp if attack SMASH happens (calculate with battle engine). |
73 pp pp | Jump to script at pp pp if attack misses (calculate with battle engine). |
74 pp pp | Jump to script at pp pp if driving the tank. |
78 pp pp | Jump to script at pp pp with random 50-50 odds. |
7B pp pp | Jump to script at pp pp if fighting an enemy that can't be run away from. |
80 pp pp | Jump to script at pp pp if attack cannot be completed (either attacker or defender fainted or gone). |
81 pp pp | Jump to script at pp pp if defender dodges (calculate with battle engine). |
86 pp pp | Jump to script at pp pp if defender is fainted or gone. |
A0 pp pp | Jump unconditional to script code at pp pp |
Bx | Repeat everything from Bx to next 00 x number of times (used for multi-target or multi-hit attacks). |
Examples
Bite
51 # Check for confusion damage 66 00 # Currently unknown 68 08 # Display text "[attacker] bit [defender]!" 60 00 # Calculate base damage 80 B7 9E # Jump to script at $9EB7 if attack can't be completed 81 BA 9E # Jump to script at $9EBA if defender dodges 73 BF 9E # Jump to script at $9EBF if attack misses 12 # Play hit sound and shake screen 40 06 # Apply final damage 00 # Finish script
PK Fire Alpha
67 05 # Set attack SFX to 05 (fire) 20 2C # Check if PSI index 0x2C (Fire A) can be performed 62 14 # Set base damage to 0x14 52 # Check for damage to self B4 # Do everything from here to the next 00 4 times 80 DD 99 # Jump to script at $99DD if attack can't be completed <- 64 40 # Currently unknown | 17 # Play hit sound and flash screen red | 40 06 # Apply final damage | 56 # Set target to next defender | 00 # End of Bx loop, loop 4 times ------------------------- 00 # Finish script