Skip to content

Instantly share code, notes, and snippets.

@PhoenixBound
Created September 19, 2025 21:45
Show Gist options
  • Select an option

  • Save PhoenixBound/475aee86c44bc4a4f673325a0f1d26f2 to your computer and use it in GitHub Desktop.

Select an option

Save PhoenixBound/475aee86c44bc4a4f673325a0f1d26f2 to your computer and use it in GitHub Desktop.
Change to the "make unable to concentrate" battle action that checks for the presence of a Brain Stone
// Brain Stone concentration fix by PhoenixBound
// Last updated: 2025-09-18
// ---
// The Brain Stone's description says it prevents the one holding the item
// from losing concentration, the status that makes you unable to use PSI.
// But BTLACT_DISTRACT doesn't actually check for the presence of the Brain
// Stone. This script adds a check there.
// If you'd like to add a special message when the Brain Stone allows a
// character to keep their concentration, you can do that by replacing the
// BEQ(4) JML(0xC28DAB) with a BNE_a to more code that displays a different
// message. Then jump back to $C28DB9 to return from the function.
ROM[0xC28D92] = JML (distract_check_for_brain_stone)
distract_check_for_brain_stone: {
LDX_a (0xA972)
LDA_x (0x000E) // target's "side." 0 for allies, 1 for enemies
AND_i (0x00FF)
BNE_a (_success)
LDA_x (0x0010) // character index, for non-NPC party members
AND_i (0x00FF)
INC // Add 1 to turn it into a 1-based ID
LDX_i (0x00C9) // Brain stone
JSL (0xC45683) // Does that character have a brain stone?
CMP_i (0x0000)
BEQ (4)
JML (0xC28DAB) // if they do, fail to inflict the status
_success:
// Restore the previous state of the registers
LDA_a (0xA972)
CLC
ADC_i (0x0021)
TAX
// Clobbered code
SEP (0x20)
LDA_8 (0x04)
JML (0xC28D96)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment