• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

Completed Brawl-Style Bury Mechanics - Get Knocked out of Bury if Hit by a Strong Knockback Move

abysspartyy

Smash Cadet
Joined
May 11, 2015
Messages
55
According to https://www.ssbwiki.com/Buried, moves that deal more than 100 units of knockback cause the player to be freed from being buried and be launched as usual. This mechanic only applies to Brawl and onwards. So I created a code to replicate this behaviour for Melee!
  • Strong moves (deal over 100 units of knockback) that bury the player (Grounded effect) will just cause damage
    • This prevents reburying loop
  • All other strong moves will unbury the player as usual

Please use the latest code version if you are looking for the same bury mechanics that are in Brawl. Note that these codes only works for 1.02 NTSC of Melee.

View the Update Changelog for information on what changed between each code version.

$Brawl Bury Mechanics v1.0.5 [sushie]
*Strong hits unburies players like in Brawl
040c1444 60000000
C208ECBC 0000000D
40820008 48000058
807D0010 2C030127
40820034 807D1860
2C030009 41820028
2C03000A 41820020
C01D1850 48000029
7C6802A6 C0230000
FC000840 40810008
4800001C 3D808008
618CECD4 7D8903A6
4E800420 4E800021
42C80000 887D2220
60000000 00000000


$Brawl Bury Mechanics v1.0.4 [sushie]
*Moves that deal over 100 units of knockback unburies them
C208ECBC 0000000D
40820008 48000058
807D0010 2C030127
40820034 807D1860
2C030009 41820028
2C03000A 41820020
C01D1850 48000029
7C6802A6 C0230000
FC000840 40810008
4800001C 3D808008
618CECD4 7D8903A6
4E800420 4E800021
42C80000 887D2220
60000000 00000000

$Brawl Bury Mechanics V1.0.3 [Odante]
*Moves that deal over 100 units of knockback unburies them
C208ECBC 0000000B
40820008 48000050
807D1860 2C030009
4182002C 2C03000A
41820024 C01D1850
4800002D 7C6802A6
C0230000 FC000840
4081000C 887D2220
4800001C 3D808008
618CECD4 7D8903A6
4E800420 4E800021
42C80000 00000000


$Brawl Bury Mechanics V1.0.1 [Odante]
*Moves that deal over 100 units of knockback unburies them
C208ECBC 0000000B
40820008 48000050
C01D1850 48000041
7C6802A6 C0230000
FC000840 40810020
807D1860 2C030009
4082000C 38600000
907D1860 887D2220
4800001C 3D808008
618CECD4 7D8903A6
4E800420 4E800021
42C80000 00000000

Python:
import geckon
const
    MaxUnburyKnockbackUnits = 100
const
    RegisterFighterData = r29
    OriginalBuryCheckAddress = "0x8008ecd4"
const
    Cape = 0xA
    Grounded = 0x9
const
    BuryWaitActionStateId = 295
defineCodes:
    createCode "Brawl Bury Mechanics v1.0.4":
        authors "Ronnie"
        description "Strong hits unburies players like in Brawl"
        patchInsertAsm "8008ecbc":
            # Check if we are in a flinchless state
            %`bne-`(CheckInBuryWaitState) # we are in flinchless state, so check if we are in a bury action state
            b NotInBury # exit as if we are not in a flinchless state
            CheckInBuryWaitState:
                lwz r3, 0x10({RegisterFighterData}) # load current action state ID
                cmpwi r3, {BuryWaitActionStateId}
                %`bne-`(OriginalBuryCheck) # if not in bury wait A/S, go back to the original check function
 
            # If in bury, check if knockback is strong enough to unbury the player
            # Free to use r3 here but must restore if branch to NotInBury
            InBury:
                HitEffectChecks:
                    # If hit is another Grounded/Bury hit OR Cape,
                    # Do not unbury and go to the original bury check
                    lwz r3, 0x1860({RegisterFighterData}) # load effect type
                    # Check if grounded move
                    cmpwi r3, {Grounded}
                    beq OriginalBuryCheck
                    # If not grounded move, check if it's a cape move
                    cmpwi r3, {Cape}
                    beq OriginalBuryCheck
                # Now we check the knockback and see if we should unbury
                block knockbackChecks:
                    const
                        RegisterForceApplied = f0
                        RegisterMaxUnitsToCheck = f1
                    # f0 = current hit's knockback/force_applied
                    # f1 = maximum knockback units to unbury
                    ppc:
                        lfs {RegisterForceApplied}, 0x1850({RegisterFighterData}) # load force_applied
                        # Load our maximum knockback units constant
                        bl Constants
                        mflr r3
                        lfs {RegisterMaxUnitsToCheck}, 0x0(r3)
                        # If the current hit's applied knockback is greater than and
                        # not equals to the MaxUnburyKnockbackUnits,
                        # unbury the player
                        fcmpo cr0, f0, f1
                        ble OriginalBuryCheck # not enough knockback, so don't unbury
                Unbury:
                    b NotInBury # treat the hit as if the player isn't flinchless
            OriginalBuryCheck:
                %branch(OriginalBuryCheckAddress)
 
            Constants:
                blrl
                %`.float`(MaxUnburyKnockbackUnits) # units of knockback
                %`.align`(2)
 
            NotInBury:
                lbz r3, 0x2220({RegisterFighterData}) # restore r3
                %emptyBlock
Rich (BB code):
# Address: 8008ecbc

.macro branch reg, address
lis \reg, \address @h
ori \reg,\reg,\address @l
mtctr \reg
bctr
.endm

.set REG_FighterData, 29
.set EffectType_Grounded, 0x9
.set EffectType_Normal, 0

# f0 - contains the knockback caused by the current damage

# Check if in bury
bne- InBury
b NotInBury_Exit # if not in bury, exit

# If in bury, check if knockback is strong enough to unbury the player
# Free to use r3 here but must restore after
InBury:

# Load the hit's knockback/force_applied
lfs f0, 0x1850(REG_FighterData)

# Load our maximum knockback unit constant
# Free to use r3 here
bl Constants
mflr r3
lfs f1,MaxKnockbackUnits(r3)

# If knockback unit is greater than and not equals to MaxKnockbackUnits,
# skip the damage bury check
fcmpo cr0,f0,f1
ble OriginalBuryCheck_Exit # not enough knockback to unbury, so exit to original bury check

# Otherwise, unbury the player/skip the bury check
# Check if the hit is another Grounded effect
lwz    r3, 0x1860(REG_FighterData) # the effect type of the hit
cmpwi r3, EffectType_Grounded # if effect type is grounded
bne Unbury # if not grounded, just unbury the player

# Set the effect type of the hit to Normal
ResetEffectType:
li r3, EffectType_Normal
stw r3, 0x1860(REG_FighterData)

Unbury:
lbz    r3, 0x2220(REG_FighterData) # restore r3
b NotInBury_Exit

OriginalBuryCheck_Exit:
branch r12, 0x8008ecd4

Constants:
blrl
.set MaxKnockbackUnits,0x0
.float 100 # units of knockback
.align 2

NotInBury_Exit:
 
Last edited:

abysspartyy

Smash Cadet
Joined
May 11, 2015
Messages
55
Changelog:

v1.0.5
  • Upon jumping out of the bury action state, you no longer gain invincibility
    • This is similar to how Brawl works
v1.0.4
  • Now checks if the player is in the BuryWait action state
    • Fixes a bug that causes players who are in a flinchless state but NOT in a bury state to get knocked out
v1.0.3
  • Fixed a bug where hits with the Cape effect moves the affected player while grounded

v1.0.2
  • Revert the change from v1.0.1. Moves with the 'Grounded' effect will just deal damage to buried players and will NOT unbury them if they are strong enough
    • This is the same as in Brawl
    • Buried players cannot be reburied with moves that have the Grounded effect
v1.0.1
  • Moves that do over 100 units of knockback with the 'Grounded' effect will knock players out of bury instead of reburying them
    • Fixes the reburying loop bug
 
Last edited:

abysspartyy

Smash Cadet
Joined
May 11, 2015
Messages
55
Important bug fix update:

v1.0.4
  • Now checks if the player is in the BuryWait action state
    • Used to only check if the player is in a flinchless state (take no knockback but can still take damage)
    • Fixes a bug that causes players who are in a flinchless state but NOT in a bury state to get knocked out

Before v1.0.4, if you hit someone with a strong hit while they are in a flinchless state, they will actually take knockback which is incorrect behaviour! This has now been fixed.
 
Last edited:
Top Bottom