Skip to content

Commit

Permalink
match Frog's collisionCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
EpochFlame committed Sep 26, 2023
1 parent 5ef1017 commit 27fa895
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 73 deletions.
4 changes: 2 additions & 2 deletions docs/recommended_todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/ElecBugState.cpp">ElecBugState.cpp</a> | 15715 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/RandMapMgr.cpp">RandMapMgr.cpp</a> | 17083 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/TadpoleState.cpp">TadpoleState.cpp</a> | 17490 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/SnakeWholeShadow.cpp">SnakeWholeShadow.cpp</a> | 19376 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/SnakeCrowShadow.cpp">SnakeCrowShadow.cpp</a> | 19385 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/ImomushiState.cpp">ImomushiState.cpp</a> | 19876 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/UjiaState.cpp">UjiaState.cpp</a> | 20924 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/Rock.cpp">Rock.cpp</a> | 21671 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/ElecHiba.cpp">ElecHiba.cpp</a> | 21834 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/Frog.cpp">Frog.cpp</a> | 22143 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/UjiaState.cpp">UjiaState.cpp</a> | 20924 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/Frog.cpp">Frog.cpp</a> | 21026 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/Rock.cpp">Rock.cpp</a> | 21671 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/ElecHiba.cpp">ElecHiba.cpp</a> | 21834 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/QueenState.cpp">QueenState.cpp</a> | 22713 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/Ujia.cpp">Ujia.cpp</a> | 22960 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/Ujib.cpp">Ujib.cpp</a> | 23596 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/Queen.cpp">Queen.cpp</a> | 23624 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/ElecBug.cpp">ElecBug.cpp</a> | 24345 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/ArmorState.cpp">ArmorState.cpp</a> | 24714 |
Expand Down
86 changes: 15 additions & 71 deletions src/plugProjectNishimuraU/Frog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,79 +380,23 @@ void Obj::getShadowParam(ShadowParam&)
* Address: 80258B84
* Size: 000104
*/
void Obj::collisionCallback(CollEvent&)
void Obj::collisionCallback(CollEvent& event)
{
/*
stwu r1, -0x30(r1)
mflr r0
stw r0, 0x34(r1)
stw r31, 0x2c(r1)
stw r30, 0x28(r1)
mr r30, r4
stw r29, 0x24(r1)
mr r29, r3
lwz r31, 0(r4)
cmplwi r31, 0
beq lbl_80258C54
lwz r0, 0x1e0(r29)
rlwinm. r0, r0, 0, 0x16, 0x16
bne lbl_80258C54
lbz r0, 0x2d9(r29)
cmplwi r0, 0
beq lbl_80258C54
lwz r0, 0xc8(r31)
cmplwi r0, 0
beq lbl_80258C54
mr r3, r31
lwz r12, 0(r31)
lwz r12, 0x1c(r12)
mtctr r12
bctrl
clrlwi. r0, r3, 0x18
bne lbl_80258C0C
mr r3, r31
lwz r12, 0(r31)
lwz r12, 0x18(r12)
mtctr r12
bctrl
clrlwi. r0, r3, 0x18
beq lbl_80258C54
lbl_80258C0C:
lwz r5, 0xc0(r29)
lis r4, __vt__Q24Game11Interaction@ha
lis r3, __vt__Q24Game13InteractPress@ha
li r0, 0
lfs f0, 0x604(r5)
addi r5, r4, __vt__Q24Game11Interaction@l
addi r3, r3, __vt__Q24Game13InteractPress@l
addi r4, r1, 8
stw r5, 8(r1)
stw r29, 0xc(r1)
stw r3, 8(r1)
stfs f0, 0x10(r1)
stw r0, 0x14(r1)
lwz r3, 0(r30)
lwz r12, 0(r3)
lwz r12, 0x1a4(r12)
mtctr r12
bctrl
if (Creature* creature = event.mCollidingCreature) {
if (!isEvent(0, EB_Bittered)) {

if (mIsFalling) {
if (creature->mBounceTriangle) {
if (creature->isNavi() || creature->isPiki()) {
InteractPress press(this, C_PARMS->mGeneral.mAttackDamage.mValue, nullptr);
event.mCollidingCreature->stimulate(press);
}
}
}
}
}

lbl_80258C54:
mr r3, r29
mr r4, r30
lwz r12, 0(r29)
lwz r12, 0x240(r12)
mtctr r12
bctrl
lwz r0, 0x34(r1)
lwz r31, 0x2c(r1)
lwz r30, 0x28(r1)
lwz r29, 0x24(r1)
mtlr r0
addi r1, r1, 0x30
blr
*/
setCollEvent(event);
}

/*
Expand Down

0 comments on commit 27fa895

Please sign in to comment.