• 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 Hitbox Color Darkens Based On Damage

UnclePunch

Smash Ace
Joined
Nov 9, 2014
Messages
673

Code:
$Hitbox Color Darkens Based On Damage [UnclePunch]
C2009FA4 00000010
C0A3000C 48000069
7CA802A6 C0C50000
C0E50004 C1050008
FC054040 4180000C
38C00000 48000038
FC053840 4181000C
C1050000 4800001C
ED083828 ECA53828
ECE73828 ED064024
ED050232 ED064028
FCA0401E D8A1FFF4
80C1FFF8 38AD8000
98C50001 98C50002
48000014 4E800021
43580000 40A00000
41900000 00000000
Code:
#minimum GB value - (damage * (minimum GB value /max damage)

#Get Values
lfs    f5,0xC(r3)        #Get Hitbox Damage
bl    Floats
mflr    r5
lfs    f6,0x0(r5)        #Min GB Value
lfs    f7,0x4(r5)        #Damage Value for Lightest Color
lfs    f8,0x8(r5)        #Damage Value for Darkest Color


#Check If Does Over Max Damage Accounted For
fcmpo    cr0,f5,f8
blt    CheckMin
li    r6,0x0
b    StoreGandB

CheckMin:
#Check If Does Under Min Damage Accounted For
fcmpo    cr0,f5,f7
bgt    Formula
lfs    f8,0x0(r5)        #Value for Lightest Color
b    ConvertToint

#Formula
Formula:
fsubs   f8,f8,f7
fsubs    f5,f5,f7
fsubs   f7,f7,f7
fdivs    f8,f6,f8        #(minimum GB value /max damage)
fmuls    f8,f5,f8        #(damage * (minimum GB value /damage range)
fsubs    f8,f6,f8        #minimum GB value - (damage * (minimum GB value /damage range)

#Convert To Int
ConvertToInt:
fctiwz    f5,f8
stfd    f5,-0xC(sp)
lwz    r6,-0x8(sp)        #Get Hitbox Damage as Int

#Store As G and B Value
StoreGandB:
subi    r5, r13, 32768        #Get Hitbox Color in DOL
stb    r6,0x1(r5)        #G
stb    r6,0x2(r5)        #B


b    exit

Floats:
blrl
.long 0x43580000    #Min GB Value 187
.long 0x40A00000    #Damage Value for Lightest Color 5
.long 0x41900000 #Damage Value for Darkest Color 18


exit:
 
Last edited:
Top Bottom