rodecomp/Source/Contents/Actors/Pc.h
ragnarok-clanker 520b9e367e Decompile 5 functions in Source/Contents/Actors/Player.cpp, Source/Contents/Actors/Pc.h
Batch #4906 by youko: 1 byte-identical, 4 confirmed by peer review.

- fn_22563 CPc::AddMsgEffect: logic confirmed by peer review
- fn_22564 CPc::Slot62: logic confirmed by peer review
- fn_22567 CPc::IsDrawOnTop: logic confirmed by peer review
- fn_22568 CPc::SelectStanceFrame: logic confirmed by peer review
- fn_22671 CPlayer::Slot16: byte-identical

Peer-reviewed-by: eAthena, meitogi
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
2026-10-30 05:49:26 +00:00

257 lines
8.9 KiB
C++

#ifndef RAGNAROK_SOURCE_CONTENTS_ACTORS_PC_H
#define RAGNAROK_SOURCE_CONTENTS_ACTORS_PC_H
#include "Contents/Actors/GameActor.h"
#include "Resource/Models/GrannyModelResource.h"
#include <cstddef>
#include <cstdint>
#include <string>
#include <vector>
class C3dGrannyModelRes;
class CActRes;
class CRes;
struct ActionFrame;
struct RenderCommand;
struct RenderVertex;
struct granny_control;
struct granny_model_instance;
int GetSlotLayer(int slot);
bool IsReadyOrAttackAction(int action);
class CPc : public CGameActor {
public:
~CPc() override;
void SendMsg(
CGameObject* sender, int message, int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l, int m
) override;
void Slot15(int first, int second) override;
void Slot22(int value) override;
void Slot23(int first, int second) override;
void Slot25(int value) override;
void Slot26(int value) override;
void Slot27(int value) override;
void Slot30() override;
void Slot31() override;
void Slot33(int value) override;
void Slot34(int value) override;
std::int64_t Slot35() override;
void Slot39(int value) override;
void Slot40(int value) override;
void Slot41(int first, int second) override;
int Slot42() override;
void Slot44(int first, int second) override;
int Slot46() override;
void Slot47(unsigned char value) override;
int Slot55() override;
int Slot56() override;
void Slot57(int value) override;
bool Slot58() override;
void Slot59(bool value) override;
void Slot60() override;
void Slot62(int value) override;
void AddMsgEffect(CGameObject* effect);
void RenderBodyOutline(int layer, const float* position, float x, float y, float distanceScale, float scale, float depth, std::uint32_t color);
bool IsDrawOnTop();
const ActionFrame& SelectStanceFrame(int layer, CActRes* actRes, int* animation, int* frame, bool* replaced);
void LoadEquipAction(int slot, const char* name);
void LoadEquipSprite(int slot, const char* name);
void LoadEquipActions(const std::vector<std::string>& names);
void LoadEquipSprites(const std::vector<std::string>& names);
int MapMotion(int motion);
std::vector<std::string> GetEquipActionNames() const;
std::vector<std::string> GetEquipSpriteNames() const;
CRes* GetEquipAction(unsigned slot) const;
CRes* GetEquipSprite(int slot) const;
int JobActionBase(int state);
bool IsCostumeOutfit() const;
int GetDualWieldWeaponType(int first, int second);
float* GetExtent(float* extent) const override;
/* 0410 */ unsigned char unknown_0410[8];
/* 0418 */ std::string unknown_0418;
/* 0430 */ int unknown_0430;
/* 0434 */ int unknown_0434;
/* 0438 */ int unknown_0438;
/* 043C */ unsigned char unknown_043C[4];
/* 0440 */ int unknown_0440;
/* 0444 */ int unknown_0444;
/* 0448 */ int weapon;
/* 044C */ int unknown_044C;
/* 0450 */ int unknown_0450;
/* 0454 */ int unknown_0454;
/* 0458 */ int unknown_0458;
/* 045C */ int unknown_045C;
/* 0460 */ unsigned char unknown_0460[0x18];
/* 0478 */ std::string unknown_0478;
/* 0490 */ unsigned char unknown_0490[0x0C];
/* 049C */ int unknown_049C;
/* 04A0 */ unsigned char unknown_04A0[0x14];
/* 04B4 */ std::vector<CRes*> equipSprites;
/* 04C0 */ std::vector<CRes*> equipActions;
/* 04CC */ int unknown_04CC;
/* 04D0 */ int unknown_04D0;
/* 04D4 */ int unknown_04D4;
/* 04D8 */ unsigned char unknown_04D8[1];
/* 04D9 */ bool unknown_04D9;
/* 04DA */ unsigned char unknown_04DA[2];
/* 04DC */ int unknown_04DC;
/* 04E0 */ bool unknown_04E0;
/* 04E1 */ unsigned char unknown_04E1[0x03];
/* 04E4 */ float unknown_04E4;
/* 04E8 */ float unknown_04E8;
/* 04EC */ float unknown_04EC;
/* 04F0 */ float unknown_04F0;
/* 04F4 */ int unknown_04F4;
/* 04F8 */ float unknown_04F8;
/* 04FC */ int unknown_04FC;
/* 0500 */ unsigned char unknown_0500[0x0C];
/* 050C */ int unknown_050C;
};
class CBlurPC : public CPc {
public:
~CBlurPC() override;
bool OnProcess() override;
void SendMsg(
CGameObject* sender, int message, int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l, int m
) override;
void Render(int argument) override;
};
class CHalluPC : public CPc {
public:
~CHalluPC() override;
bool OnProcess() override;
void SendMsg(
CGameObject* sender, int message, int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l, int m
) override;
void Render(int argument) override;
/* 0510 */ int unknown_0510;
/* 0514 */ int unknown_0514;
};
class CHalluPC2 : public CPc {
public:
~CHalluPC2() override;
bool OnProcess() override;
void SendMsg(
CGameObject* sender, int message, int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l, int m
) override;
void Render(int argument) override;
/* 0510 */ int unknown_0510;
/* 0514 */ int unknown_0514;
};
class CPlayer : public CPc {
public:
static int AngleToDirection(float angle);
bool IsSpecialState(int state) const;
void Slot16() override;
void Slot17() override;
};
class CGrannyPc : public CGameActor {
public:
void SetAction(unsigned animation, int motion, int repeat) override;
void Slot08() override;
void Slot20(int first, int second, int third, int fourth, int fifth, int sixth, int seventh, int eighth, int ninth, int tenth, int eleventh) override;
void Slot21(int value) override;
void Slot22(int value) override;
void Slot23(int first, int second) override;
void Slot24(int first, int second) override;
void Slot25(int value) override;
void Slot26(int value) override;
void Slot27(int value) override;
void Slot28(int value) override;
void Slot30() override;
void Slot31() override;
std::int64_t Slot35() override;
void Slot39(int value) override;
void Slot40(int value) override;
void Slot41(int first, int second) override;
void PlayMotion(int repeat);
void ReleaseMeshes();
void UpdateAnimation(C3dGrannyModelRes* model);
/* 0410 */ std::string unknown_0410;
/* 0428 */ int unknown_0428;
/* 042C */ int unknown_042C;
/* 0430 */ unsigned char unknown_0430[4];
/* 0434 */ int unknown_0434;
/* 0438 */ int unknown_0438;
/* 043C */ unsigned char unknown_043C[4];
/* 0440 */ int unknown_0440;
/* 0444 */ int unknown_0444;
/* 0448 */ int unknown_0448;
/* 044C */ int unknown_044C;
/* 0450 */ int unknown_0450;
/* 0454 */ int unknown_0454;
/* 0458 */ unsigned char unknown_0458[8];
/* 0460 */ std::string unknown_0460;
/* 0478 */ unsigned char unknown_0478[0x0C];
/* 0484 */ C3dGrannyModelRes* model;
/* 0488 */ unsigned char unknown_0488[0x28];
/* 04B0 */ granny_model_instance* instance;
/* 04B4 */ RenderCommand* commands[30];
/* 052C */ RenderCommand* layerCommands[10][30];
/* 09DC */ RenderVertex* vertices[30];
/* 0A54 */ RenderVertex* layerVertices[10][30];
/* 0F04 */ granny_system_clock clock;
/* 0F14 */ granny_system_clock lastClock;
/* 0F24 */ float unknown_0F24;
/* 0F28 */ unsigned char unknown_0F28[0x14];
/* 0F3C */ int motion;
/* 0F40 */ unsigned char unknown_0F40[0x110];
/* 1050 */ granny_control* controls[20];
/* 10A0 */ unsigned char unknown_10A0[0x14B0];
/* 2550 */ int unknown_2550;
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(offsetof(CPc, unknown_0430) == 0x430);
static_assert(offsetof(CPc, unknown_0444) == 0x444);
static_assert(offsetof(CPc, unknown_0458) == 0x458);
static_assert(offsetof(CGrannyPc, unknown_0428) == 0x428);
static_assert(offsetof(CGrannyPc, unknown_0440) == 0x440);
static_assert(offsetof(CGrannyPc, unknown_0460) == 0x460);
static_assert(offsetof(CGrannyPc, model) == 0x484);
static_assert(offsetof(CGrannyPc, instance) == 0x4B0);
static_assert(offsetof(CGrannyPc, clock) == 0xF04);
static_assert(offsetof(CGrannyPc, lastClock) == 0xF14);
static_assert(offsetof(CGrannyPc, unknown_0F24) == 0xF24);
static_assert(offsetof(CGrannyPc, motion) == 0xF3C);
static_assert(offsetof(CGrannyPc, controls) == 0x1050);
static_assert(offsetof(CGrannyPc, commands) == 0x4B4);
static_assert(offsetof(CGrannyPc, layerCommands) == 0x52C);
static_assert(offsetof(CGrannyPc, vertices) == 0x9DC);
static_assert(offsetof(CGrannyPc, layerVertices) == 0xA54);
static_assert(offsetof(CGrannyPc, unknown_2550) == 0x2550);
static_assert(sizeof(CBlurPC) == 0x510);
static_assert(sizeof(CHalluPC) == 0x518);
static_assert(sizeof(CHalluPC2) == 0x518);
static_assert(offsetof(CPc, unknown_0418) == 0x418);
static_assert(offsetof(CPc, unknown_04E4) == 0x4E4);
static_assert(offsetof(CPc, unknown_04F0) == 0x4F0);
static_assert(offsetof(CPc, unknown_04F8) == 0x4F8);
static_assert(offsetof(CPc, unknown_04FC) == 0x4FC);
static_assert(offsetof(CPc, unknown_050C) == 0x50C);
static_assert(offsetof(CHalluPC, unknown_0510) == 0x510);
static_assert(offsetof(CHalluPC2, unknown_0510) == 0x510);
static_assert(offsetof(CPc, weapon) == 0x448);
static_assert(offsetof(CPc, unknown_044C) == 0x44C);
static_assert(offsetof(CPc, unknown_04CC) == 0x4CC);
static_assert(offsetof(CPc, unknown_04DC) == 0x4DC);
static_assert(offsetof(CPc, unknown_04E0) == 0x4E0);
#endif
#endif