rodecomp/Source/Contents/Actors/Player.cpp
ragnarok-clanker a8ff0839ca Decompile 12 functions in Source/Contents/Actors/Player.cpp, Source/Contents/Actors/Pc.h, ...
Batch #1819 by Yommy: 0 byte-identical, 12 confirmed by peer review.

- fn_22606 CGrannyPc::SetAnimation: logic confirmed by peer review
- fn_22611 CGrannyPc::PlayMotion: logic confirmed by peer review
- fn_22612 CPc::Slot34: logic confirmed by peer review
- fn_22626 CGrannyPc::Slot26: logic confirmed by peer review
- fn_22628 CGrannyPc::Slot27: logic confirmed by peer review
- fn_22630 CGrannyPc::Slot25: logic confirmed by peer review
- fn_22632 CGrannyPc::Slot20: logic confirmed by peer review
- fn_22637 CGrannyPc::Slot22: logic confirmed by peer review
- fn_22639 CGrannyPc::Slot21: logic confirmed by peer review
- fn_22648 CGrannyPc::Slot23: logic confirmed by peer review
- fn_22662 CPlayer::AngleToDirection: logic confirmed by peer review
- fn_22663 CPlayer::IsSpecialState: logic confirmed by peer review

Reviewed-by: ragnarok-clanker
2026-10-28 22:39:36 +00:00

148 lines
3.1 KiB
C++

#include "Contents/Actors/Pc.h"
#include "Client/Session.h"
#include "Resource/Models/GrannyModelResource.h"
// OFFSET: 0x00DAFE50
// FUNCTION: fn_22606
void CGrannyPc::SetAnimation(unsigned animation, int, int repeat) {
if (!this->model) {
return;
}
this->render.unknown_0070 = 0;
switch (animation) {
case 8:
this->render.unknown_0070 = 1;
break;
case 16:
this->render.unknown_0070 = 6;
break;
case 24:
this->render.unknown_0070 = 5;
break;
case 32:
this->render.unknown_0070 = 11;
break;
case 40:
this->render.unknown_0070 = 12;
break;
case 48:
this->render.unknown_0070 = 4;
break;
case 64:
this->render.unknown_0070 = 3;
break;
case 80:
case 88:
this->render.unknown_0070 = 2;
break;
}
this->PlayMotion(repeat);
}
// OFFSET: 0x00DB01F0
// FUNCTION: fn_22611
void CGrannyPc::PlayMotion(int repeat) {
this->motion = this->render.unknown_0070;
for (int i = 0; i < 20; ++i) {
this->model->FreeControl(this->controls[i]);
this->controls[i] = nullptr;
}
this->unknown_0F24 = 0;
const int loopCount = (repeat == 1 && this->render.unknown_0070 != 6) ? 1 : 0;
this->controls[this->motion] = this->model->PlayAnimation(this->motion, this->instance, this->controls[this->motion], loopCount);
}
// OFFSET: 0x00DB0280
// FUNCTION: fn_22612
void CPc::Slot34(int value) {
this->unknown_0444 = value;
this->Slot31();
}
// OFFSET: 0x00DB07E0
// FUNCTION: fn_22626
void CGrannyPc::Slot26(int value) {
this->unknown_044C = value;
}
// OFFSET: 0x00DB09D0
// FUNCTION: fn_22628
void CGrannyPc::Slot27(int value) {
this->unknown_0450 = value;
}
// OFFSET: 0x00DB0B40
// FUNCTION: fn_22630
void CGrannyPc::Slot25(int value) {
this->unknown_0448 = value;
}
// OFFSET: 0x00DB0CB0
// FUNCTION: fn_22632
void CGrannyPc::Slot20(int first, int second, int third, int fourth, int fifth, int sixth, int seventh, int eighth, int ninth, int tenth, int) {
this->Slot19(first, second, third, fourth, fifth, sixth, seventh, eighth, ninth, this->unknown_0454, tenth);
}
// OFFSET: 0x00DB1980
// FUNCTION: fn_22637
void CGrannyPc::Slot22(int value) {
this->unknown_0434 = value;
}
// OFFSET: 0x00DB1AC0
// FUNCTION: fn_22639
void CGrannyPc::Slot21(int value) {
this->render.unknown_0054 = g_session.GetNpcLocationRadius(value, false);
}
// OFFSET: 0x00DB2830
// FUNCTION: fn_22646
void CGrannyPc::Slot24(int, int) {
}
// OFFSET: 0x00DB3720
// FUNCTION: fn_22648
void CGrannyPc::Slot23(int first, int second) {
this->unknown_0440 = first;
this->unknown_0444 = second;
}
// OFFSET: 0x00DB51E0
// FUNCTION: fn_22662
int CPlayer::AngleToDirection(float angle) {
return (static_cast<int>(angle) + 180) / 45 % 8;
}
// OFFSET: 0x00DB52B0
// FUNCTION: fn_22663
bool CPlayer::IsSpecialState(int state) const {
switch (state) {
case 2:
case 5:
case 6:
case 62:
case 63:
case 64:
case 65:
case 67:
case 68:
case 69:
case 70:
case 71:
case 72:
case 73:
case 74:
case 75:
case 76:
case 77:
case 78:
case 79:
case 80:
return true;
default:
return false;
}
}