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

#include <libultraship.h>
#include <vector>
#include "engine/objects/Object.h"
#include "CoreMath.h"
#include "World.h"

extern "C" {
#include "macros.h"
#include "main.h"
#include "vehicles.h"
#include "waypoints.h"
#include "common_structs.h"
#include "objects.h"
#include "course_offsets.h"
#include "some_data.h"
}

/**
 * @arg start x and z spawn location
 * @arg end x and z patrol location
 * 
 * Crab patrols between start and end.
 * The game automatically places the actor on the course surface.
 * Therefore, providing a Y height is unnecessary.
 * 
 * Crab appears to have a maximum patrolling distance and will patrol between
 * end --> max distance rather than start --> end or start --> max distance.
 */
class OCrab : public OObject {
public:
    explicit OCrab(const FVector2D& start, const FVector2D& end);

    virtual void Tick() override;
    virtual void Draw(s32 cameraId) override;
    void DrawModel(s32 cameraId);

    void init_ktb_crab(s32 objectIndex);
    void func_80082B34(s32 objectIndex);
    void func_80082C30(s32 objectIndex);
    void func_80082E18(s32 objectIndex);

private:
    FVector2D _start;
    FVector2D _end;
    static size_t _count;
    s32 _idx;
};