abysspartyy
Smash Cadet
- Joined
- May 11, 2015
- Messages
- 55
Introduction
I have created a Gecko code that restores the functionality of elements Sleep, Bury, Disable, Screw Attack and Poison Flower for throws since these elements do nothing in vanilla Melee.
Note: not all throws will successfully bury. This will depend on the animation of the throw and where it moves the opponent when thrown. If making custom throw animations that will bury, see Kirby's throws for a good example.
Usage
With the code below enabled/installed, simply change a Throw hitbox's element using your subaction editor like so:
Note: for bury/grounded effect, use Grounded (97 Frames)
Gecko Code
Current version: v1.0.0
Code:
$Enable Other Elements for Throws v1.0.0 [sushie]
*allows throws to sleep, bury, disable, screw attack or poison flower victims
C20DE7EC 0000002D
48000105 00000000
00000000 00000000
00000000 00000000
00000000 00000040
00000040 00000000
000000A0 00000000
00000000 00000060
00000000 000000C0
000000D4 C01F1844
D01F002C 7FE3FB78
3D808007 618CD7FC
7D8803A6 4E800021
480000D8 881F2228
5400DFFF 408200F0
C01F1844 D01F002C
7FE3FB78 3D808007
618CD7FC 7D8803A6
4E800021 807F0000
3D80800C 618C4550
7D8803A6 4E800021
48000098 881F2227
5400FFFF 408200B0
3D80800C 618C0D0C
7D8803A6 4E800021
4800008C 3D80800D
618C3004 7D8803A6
4E800021 48000078
9421FFF0 90A10010
807F0000 C03F1838
3D808007 618CFC7C
7D8803A6 4E800021
80A10010 38210010
4800005C 7C8802A6
801F1860 28000006
41A0004C 2800000F
41810044 5400103A
7C04002E 28000000
41820034 7C040214
7C0903A6 4E800420
807F0000 3D808007
618CE2FC 7D8803A6
4E800021 3D80800D
618CE840 7D8903A6
4E800420 807F0000
2C050000 00000000
Python:
authors: ["sushie"]
code:
errata.new e
e.ref sleep, bury, disable, screw, flower
# Patch Fighter_ThrownApplyKnockback
# This is where knockback gets applied when thrown
gecko 0x800de7ec
bl ApplyThrowElements
elements:
# elements table
# each element contains the offset of the ApplyElement_ function
".space 6 * 4" # 0-5
".4byte" sleep # 6
".4byte" sleep # 7
".4byte" 0
".4byte" bury # 9
".space 2 * 4" # 10-11
".4byte" disable # 12
".4byte" 0
".4byte" screw # 14
".4byte" flower # 15
ApplyElement_Sleep:
# Set proper facing direction based on damage log
lfs f0, 0x1844(r31)
stfs f0, 0x2C(r31)
# Set as Grounded
mr r3, r31
bla r12, 0x8007d7fc
b ApplyThrowElements_KillVelocity
ApplyElement_Disable:
lbz r0, 0x2228(r31)
"rlwinm." r0, r0, 27, 31, 31
bne ApplyThrowElements_EnterDamageState
# Set proper facing direction based on damage log
lfs f0, 0x1844(r31)
stfs f0, 0x2C(r31)
# Set as Grounded
mr r3, r31
bla r12, 0x8007d7fc
# Call AS_300_Disable
lwz r3, 0(r31)
bla r12, 0x800c4550
b ApplyThrowElements_KillVelocity
ApplyElement_Bury:
lbz r0, 0x2227(r31)
"rlwinm." r0, r0, 31, 31, 31
bne ApplyThrowElements_EnterDamageState
# call AS_294_Bury function
# r3 = fighter gobj
bla r12, 0x800C0D0C
b ApplyThrowElements_SkipEnterDamageState
ApplyElement_Screw:
# AS_156/157_DamageScrew/DamageScrewAir
bla r12, 0x800d3004
b ApplyThrowElements_SkipEnterDamageState
ApplyElement_Flower:
sp.push
sp.temp rTemp
stw r5, sp.rTemp(sp) # backup r5
lwz r3, 0(r31)
lfs f1, 0x1838(r31) # damage taken
bla r12, 0x8007FC7C # applyFlowerHead(GObj* fighterObj, float damageTaken)
lwz r5, sp.rTemp(sp) # restore r5
sp.pop
b ApplyThrowElements_EnterDamageState
ApplyThrowElements:
e.solve ApplyElement_Sleep-elements, ApplyElement_Bury-elements, ApplyElement_Disable-elements, ApplyElement_Screw-elements, ApplyElement_Flower-elements
mflr r4
lwz r0, 0x1860(r31) # damage element/attribute
# element < 6 || element > 15, exit
cmplwi r0, 6
blt+ ApplyThrowElements_EnterDamageState
cmplwi r0, 15
bgt ApplyThrowElements_EnterDamageState
# get proper branch offset based on element id
slwi r0, r0, 2
lwzx r0, r4, r0
cmplwi r0, 0 # invalid offset, exit
beq ApplyThrowElements_EnterDamageState
add r0, r4, r0
mtctr r0
bctr
ApplyThrowElements_KillVelocity:
lwz r3, 0(r31)
bla r12, 0x8007e2fc
ApplyThrowElements_SkipEnterDamageState:
ba r12, 0x800de840
ApplyThrowElements_EnterDamageState:
# exit branch
lwz r3, 0(r31) # restore r3 just in case
cmpwi r5, 0 # orig code line
gecko.end
Last edited: