summaryrefslogtreecommitdiff
path: root/src/engine/objects/Trophy.h
blob: a6747aedc2e8af9580450fb0ffb0507b337bd85d (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
#pragma once

#include <libultraship.h>
#include "Object.h"
#include "engine/registry/RegisterContent.h"
#include "World.h"
#include "engine/particles/StarEmitter.h"

extern "C" {
#include "common_structs.h"
}

class OTrophy : public OObject {
public:
    enum TrophyType : int16_t {
        BRONZE,
        SILVER,
        GOLD,
        BRONZE_150,
        SILVER_150,
        GOLD_150,
    };

    enum Behaviour : int16_t {
        PODIUM_CEREMONY,
        STATIONARY,
        ROTATE, // A dual-axis opposing rotation
        ROTATE2, // A single-axis rotation
        GO_FISH,
    };

    // This is simply a helper function to keep Spawning code clean
    static OTrophy* Spawn(const FVector& pos, TrophyType trophy, Behaviour bhv) {
        SpawnParams params = {
            .Name = "mk:trophy",
            .Type = trophy,
            .Behaviour = bhv,
            .Location = pos,
        };
        return dynamic_cast<OTrophy*>(AddObjectToWorld<OTrophy>(params));
    }

    explicit OTrophy(const SpawnParams& params);

    virtual void SetSpawnParams(SpawnParams& params) override;
    virtual void Tick() override;
    virtual void Draw(s32 cameraId) override;
    virtual void DrawEditorProperties() override;
    void func_80086700(s32 objectIndex);
    void func_80086940(s32 objectIndex);
    void func_80086C14(s32 objectIndex);
    void func_80086C6C(s32 objectIndex);

private:
    StarEmitter* _emitter;

    TrophyType _type;
    Behaviour _bhv;
    int8_t _toggle;
    int8_t *_toggleVisibility;
    Vec3f _oldPos;
    bool _isMod = false;
};