summaryrefslogtreecommitdiff
path: root/include/d/actor/d_a_obj_toripost.h
blob: 07dee22c7579bd4268f4fe0b1771db95273731f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#ifndef D_A_OBJ_TORIPOST_H
#define D_A_OBJ_TORIPOST_H

#include "d/d_npc.h"
#include "SSystem/SComponent/c_phase.h"

struct daObjTpost_c__letter_data {
    /* 0x00 */ bool field_0x00;
    /* 0x04 */ u32 mMsgNo;
    /* 0x08 */ u8 mItemNo;
    /* 0x0A */ u16 mEventReg;
};

class daObjTpost_c : public fopNpc_npc_c {
public:
    enum Proc_e {
        PROC_INIT_e = 0,
        PROC_EXEC_e = 1
    };

    enum Mode {
        MODE_WAIT         = 0x0,
        MODE_TALK         = 0x1,
        MODE_TALK_XY      = 0x2,
        MODE_RECEIVE      = 0x3,
        MODE_RECEIVE_DEMO = 0x4,
        MODE_NULL,
    };

    enum BckIdx {
        BckIdx_POST_GET    = 0x0,
        BckIdx_POST_PUTOUT = 0x1,
        BckIdx_POST_WAIT   = 0x2,
    };

    enum AnmPrm {
        AnmPrm_POST_GET0   = 0x1,
        AnmPrm_POST_GET1   = 0x2,
        AnmPrm_POST_PUTOUT = 0x3,
        AnmPrm_POST_WAIT   = 0x4,
        AnmPrm_NULL,
    };

    void eventSet(s8 eventIdx) { mEventIdx = eventIdx; }
    int getSendPrice() { return m_send_price[mPayType]; }
    bool isAnm(s8 idx) { return mAnmPrmIdx == idx; }
    void modeProcInit(int newMode) { modeProc(PROC_INIT_e, newMode); }

    BOOL _createHeap();
    void cutProc();
    void cutPresentStart(int staffIdx);
    void cutPresentProc(int staffIdx);
    void cutSetAnmStart(int staffIdx);
    void cutSetAnmProc(int staffIdx);
    void cutDispLetterStart(int staffIdx);
    void cutDispLetterProc(int staffIdx);
    void deliverLetter();
    s16 getReceiveLetterNum();
    s32 getReadableLetterNum();
    u8 checkSendPrice();
    int getMsgXY();
    int getMsgNormal();
    u32 getMsg();
    u16 next_msgStatus(u32* pMsgNo);
    bool checkTalk();
    void eventOrder();
    void checkOrder();
    void setAttention();
    void setAnm(s8 param_1, bool param_2);
    void setMtx();
    void modeWaitInit();
    void modeWait();
    void modeTalkInit();
    void modeTalk();
    void modeTalkXYInit();
    void modeTalkXY();
    void modeReceiveInit();
    void modeReceive();
    void modeReceiveDemoInit();
    void modeReceiveDemo();
    void modeProc(Proc_e proc, int newMode);
    bool _execute();
    void debugDraw();
    bool _draw();
    void createInit();
    void getArg();
    cPhs_State _create();
    bool _delete();

    static const char m_arc_name[];
    static const daObjTpost_c__letter_data m_letter[];
    static const dCcD_SrcCyl m_cyl_src;

private:
    static const s32 m_send_price[];

    /* 0x6C4 */ u32 mCurMode;
    /* 0x6C8 */ s8 mBckIdx;
    /* 0x6C9 */ s8 mAnmPrmIdx;
    /* 0x6CA */ s8 mOldAnmPrmIdx;
    /* 0x6CC */ request_of_phase_process_class mPhs;
    /* 0x6D4 */ mDoExt_McaMorf* mMorf;
    /* 0x6D8 */ dBgS_ObjAcch mAcch;
    /* 0x89C */ dBgS_AcchCir mAcchCir;
    /* 0x8DC */ int field_0x8DC;
    /* 0x8E0 */ int field_0x8E0;
    /* 0x8E4 */ int field_0x8E4;
    /* 0x8E8 */ u8 mPayType;
    /* 0x8E9 */ u8 field_0x8E9;
    /* 0x8EA */ u8 field_0x8EA;
    /* 0x8EB */ u8 field_0x8EB;
    /* 0x8EC */ int mNumReadable;
    /* 0x8F0 */ u32 field_0x8F0;
    /* 0x8F4 */ u8 field_0x8F4;
    /* 0x8F5 */ u8 field_0x8F5;
    /* 0x8F6 */ u8 mPreItemNo;
    /* 0x8F7 */ s8 mEventIdx;
};

#endif /* D_A_OBJ_TORIPOST_H */