• 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 Leech Mode - All Direct Hits You Deal will Heal You

abysspartyy

Smash Cadet
Joined
May 11, 2015
Messages
55

Every direct hit you deal will heal you. For example, if you deal 25% damage to your opponent, you will also heal 25%.
  • You cannot heal by attacking your teammate
  • Projectiles do not heal you
Rich (BB code):
$Leech Mode - Heal on Every Hit [sushie]
*You heal every direct hit you deal
C206D43C 0000000D
83BE1868 2C1D0000
41820054 A07D0000
2C030004 41820008
48000044 83BD002C
7FA3EB78 7FC4F378
3D80800A 618C3844
7D8903A6 4E800421
2C030001 41820020
807E183C 889D2224
5484DFFF 40820010
809D18F0 7C841A14
909D18F0 83BE183C
60000000 00000000

Python:
import geckon, ../melee

const
    RegisterVictimData = r30
    RegisterSourceData = r29

defineCodes:
    createCode "Leech Mode - Heal on Every Hit":
        authors "sushie"
        description "You heal every direct hit you deal"
        patchInsertAsm "8006d43c":
            lwz {RegisterSourceData}, 0x1868({RegisterVictimData}) # load source of damage gobj
            # Check if source of damage exists
            cmpwi {RegisterSourceData}, 0x0
            beq Exit # if source doesn't exit, Exit
            lhz r3, 0x0({RegisterSourceData}) # check if gobj is player kind
            cmpwi r3, 0x4
            beq Fighter
            b Exit

            Fighter:
                lwz {RegisterSourceData}, 0x2C({RegisterSourceData}) # load fighter data for source
                # Check if attacker and source fighters are on the same team
                # We do not want to heal if they are on the same
                SameTeamCheck:
                    %branchToSameTeamCheck(
                        playerOneData =
                    (ppc do:
                        mr r3, {RegisterSourceData}
                    ), playerTwoData =
                    (ppc do:
                        mr r4, {RegisterVictimData}
                        ), result =
                    (ppc do:
                        cmpwi r3, 1 # if on same team, do not heal and Exit
                        beq Exit
                        ))
                Heal:
                    # Now heal the source player
                    lwz r3, 0x183C({RegisterVictimData}) # load applied damage from victim
                    # Check if source is dead (stamina_dead 0 HP)
                    lbz r4, 0x2224({RegisterSourceData})
                    %`rlwinm.`(r4, r4, 27, 31, 31)
                    bne Exit # if stamina_dead, Exit
                    # Heal source player with no GFX
                    lwz r4, 0x18F0({RegisterSourceData}) # variable containing remaining damage to heal
                    add r4, r4, r3 # add the applied damage to heal
                    stw r4, 0x18F0({RegisterSourceData}) # store it back to the remaining damage to heal variable

            Exit:
                lwz r29, 0x183C(r30) # original code line
Rich (BB code):
lwz r29, 0x00001868(r30)
cmpwi r29, 0x00000000
beq Exit
lhz r3, 0x00000000(r29)
cmpwi r3, 0x00000004
beq Fighter
b Exit
Fighter:
lwz r29, 0x0000002C(r29)
SameTeamCheck:
mr r3, r29
mr r4, r30
lis r12, 0x800a3844 @h
ori r12, r12, 0x800a3844 @l
mtctr r12
bctrl
cmpwi r3, 1
beq Exit
Heal:
lwz r3, 0x0000183C(r30)
lbz r4, 0x00002224(r29)
rlwinm. r4, r4, 27, 31, 31
bne Exit
lwz r4, 0x000018F0(r29)
add r4, r4, r3
stw r4, 0x000018F0(r29)
Exit:
lwz r29, 0x0000183C(r30)
 
Last edited:

UltimaNylocke

Smash Apprentice
Joined
Nov 8, 2014
Messages
84
Slippi.gg
ULTI#211
NNID
UltimaNylocke
Yo this looks sick! Can't wait to try it out with my friends!
 
Top Bottom