• 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 Randomized Knockback Angles On Hit

abysspartyy

Smash Cadet
Joined
May 11, 2015
Messages
55

Saw a request by Melee maniac Melee maniac and wrote a code for it.

Every normal and projectile hit you take sends you in a random direction.

  • Takes into account meteor angles and the 362 degrees angle
  • Affects throws too

$Random Knockback Angles [sushie]
*Every hit has a random angle
C22792E4 0000000B
7C0802A6 90010004
9421FF50 BE810008
7C1F0378 7C9E2378
7CBD2B78 3860016B
3D808038 618C0580
7D8903A6 4E800421
7FE0FB78 7FC4F378
7FA5EB78 BA810008
800100B4 382100B0
7C0803A6 907D0020
60000000 00000000
C207ACA0 0000000B
7C0802A6 90010004
9421FF50 BE810008
7C1F0378 7C7E1B78
7CBD2B78 3860016B
3D808038 618C0580
7D8903A6 4E800421
7C641B78 7FE0FB78
7FC3F378 7FA5EB78
BA810008 800100B4
382100B0 7C0803A6
28040169 00000000


Python:
import geckon, ../melee
const
    MaxAngle = 362
defineCodes:
    createCode "Random Knockback Angles":
        authors "Odante/Ron"
        description "Every hit has a random angle"

        # Random angle for Projectiles
        patchInsertAsm "802792e4":
            # Backup r0, r4 and r5 manually
            {backup}
            mr r31, r0
            mr r30, r4
            mr r29, r5
            # Get our random angle (from 0 to MaxAngle) into r3
            {hsdRandi(max = MaxAngle, inclusive = true)}
            # Restore r0, r4 and r5
            mr r0, r31
            mr r4, r30
            mr r5, r29
            {restore}
            stw r3, 0x0020(r29) # original code line
         
        # Random angle for Normal Hitboxes
        patchInsertAsm "8007aca0":
            # Backup r0, r3 and r5 manually
            {backup}
            mr r31, r0
            mr r30, r3
            mr r29, r5
            # Get our random angle (from 0 to MaxAngle) into r3
            {hsdRandi(max = MaxAngle, inclusive = true)}
            # Set r4 = r3
            mr r4, r3
            # restore r0, r3 and r5 manually
            mr r0, r31
            mr r3, r30
            mr r5, r29
            {restore}
            cmplwi r4, 361 # original code line
 
Last edited:
Top Bottom