Chaos Chao Check
This page lists an extract of code from SADX, which has been annotated with descriptions. This particular piece of code is executed when a chao reincarnates, and it checks if the chao meets the requirements for a Chaos chao transformation.
0073C45C - mov bl,05 - Set Chao type to Neutral Normal.
This code executes after deciding
that the chao is a Normal type.
0073C45E - fstp st(0)
0073C460 - xor edi,edi
0073C462 - push edi - #1: This begins a loop that tests
all the animal behaviours.
0073C463 - push ebp
0073C464 - call 00734ee0
0073C469 - add esp,08
0073C46C - test eax,eax
0073C46E - je 0073c4b9 - If the current animal behaviour is
missing, exit (it's not a Chaos Chao).
0073C470 - inc edi
0073C471 - cmp edi,0f - Check if we've tested all 15 animals yet.
0073C474 - jnge 0073c462 - If we haven't, jump to #1 and test the next animal.
0073C476 - cmp word ptr [esi+00000082],50 - Compare happiness to 50.
0073C47E - jle 0073c4b9 - If happiness is less than or equal
to 50, exit (it's not a Chaos Chao).
0073C480 - cmp word ptr [esi+0000008e],02 - Compare reincarnations to 2.
0073C488 - jb 0073c4b9 - If reincarnations is less than 2,
exit (it's not a Chaos Chao).
0073C48A - mov bl,14 - Set the Chao type to Neutral Chaos.
The following code adjusts the Chao
type for its alignment.