So.
I was in the neighborhood and nobody seems to have provided an answer to poor mister idiotbaka, so let's see if I can help.
(and I'm going to give you a step-by-step so maybe one of you guys might eventually learn reverse-engineering rather than just how to write new code)
***
I haven't done this in a while, and don't have the offsets memorized anymore. Bummer! Let's start by going to the compendium....
Okay, so nothing's there which is
particularly useful. I was looking for a reference to player physics, because everything having to do with the main character is going to be in approximately the same place. Kinda surprised it wasn't there, honestly.
Another obvious way to find the proper place would be by going to every callsite of the rendering function, and looking for a reference to playerX or something. I could also search for all occurrences of the invincibility timer. Both of those are a little bit intensive, so let's think to see if there's a better way.
OK. I'm remembering the infinite mimiga mask hack, which is amazing in that it is one of the better documented hacks on these forums. It also deals directly with the player rendering function, so that saves us pretty much all effort outside of a forum search.
Here.
The second bit looks like it's defining a TSC function, which means the offset we want is 0x4154b8. Let's go there.
We're looking for something to do with [0x49e6c8], the invincibility timer. As it's gonna skip the drawing phase for certain values, the reference will be before the drawing function starts (0x4154d1 or earlier).
There it is at 0x415474.
What follows basically just looks like some arithmetic to determine which frames to skip and which frames to draw. 0x41548e is the code which actually skips the player drawing function. If I'm understanding you right, we want to always show the player, and instead flicker the water bubble around her. To do that, we're gonna need some more space.
I'm noticing that there are two really large, identical pieces of code here. One draws the water bubble if we're underwater and have the airtank equipped, and one draws it if we're in the ironhead fight. (the second case exists because it's not techinically underwater, per se). What I'm going to do is take the ironhead bubbledraw code, and make it into its own function. Then, we can call that in the cases of
a) underwater, item equipped
b) ironhead battle
c) damaged and flickering
and here's what the code looks like.
0x415474:
Code:
mov eax,dword ptr ds:[49E650]
and eax,00000010 ; airtank equipped?
je short 004155A3 ; nope. go to ironhead case.
mov ecx,dword ptr ds:[49E63C] ; yes!
and ecx,00000100 ; underwater?
je short 004155A3 ; nope. go to ironhead case.
call 00415631 ; yes! draw bubble
jmp short 004155B1 ; escape
cmp dword ptr ds:[49E64C],1 ; ironhead?
jne short 004155B3 ; nope. go to damage case.
call 00415631 ; yes! draw bubble
jmp short 004155C5 ; escape
mov eax,dword ptr ds:[49E6C8] ; damage counter
shr eax,2 ; divide by four
and eax,00000001 ; even?
je short 004155C5 ; yes. dont draw
call 00415631 ; nope. do draw.
mov esp,ebp ; wrap it up.
pop ebp
ret
0x4156b0