-
Notifications
You must be signed in to change notification settings - Fork 1
/
ItemTool.h
69 lines (66 loc) · 3.93 KB
/
ItemTool.h
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
#pragma once
#include "4dm.h"
namespace fdm
{
class ItemTool : public Item
{
public:
stl::string name; // 0x10
inline static const float scaleFactor = 0.15f;
inline static glm::vec4* pickaxeVerts = reinterpret_cast<glm::vec4*>((base + 0x29B600));
inline static glm::vec4* pickaxeNormals = reinterpret_cast<glm::vec4*>((base + 0x29BC40));
inline static glm::vec3* ironPickTUV = reinterpret_cast<glm::vec3*>((base + 0x29BA60));
inline static glm::vec3* deadlyPickTUV = reinterpret_cast<glm::vec3*>((base + 0x29B880));
inline static glm::u8vec4* ultrahammerTUV = reinterpret_cast<glm::u8vec4*>((base + 0x2AF3F0));
inline static glm::u8vec4* solenoidCollectorTUV = reinterpret_cast<glm::u8vec4*>((base + 0x2AF2F0));
inline static MeshRenderer *ironPickaxeRenderer = reinterpret_cast<MeshRenderer*>((base + 0x279D68));
inline static MeshRenderer *deadlyPickaxeRenderer = reinterpret_cast<MeshRenderer*>((base + 0x279D88));
inline static MeshRenderer *rockRenderer = reinterpret_cast<MeshRenderer*>((base + 0x279E48));
inline static MeshRenderer *ultrahammerRenderer = reinterpret_cast<MeshRenderer*>((base + 0x279E68));
inline static MeshRenderer *solenoidCollectorRenderer = reinterpret_cast<MeshRenderer*>((base + 0x279DC8));
inline static Coil* coilMesh = reinterpret_cast<Coil*>((base + 0x2C1E48));
inline static MeshRenderer* coilRenderer = reinterpret_cast<MeshRenderer*>((base + 0x279DA8));
inline static Dodecaplex* collectorBall = reinterpret_cast<Dodecaplex*>((base + 0x279DF0));
inline static MeshRenderer* collectorBallRenderer = reinterpret_cast<MeshRenderer*>((base + 0x279E88));
inline static bool* collectorAnimation = reinterpret_cast<bool*>((base + 0x29B3E1));
inline static TexRenderer* tr = reinterpret_cast<TexRenderer*>((base + 0x2C1E20));
void render(const glm::ivec2& pos) override
{
return reinterpret_cast<void (__thiscall*)(ItemTool* self, const glm::ivec2& pos)>(getFuncAddr((int)Func::ItemTool::render))(this, pos);
}
void renderEntity(const m4::Mat5& mat, bool inHand, const glm::vec4& lightDir) override
{
return reinterpret_cast<void (__thiscall*)(ItemTool* self, const m4::Mat5& mat, bool inHand, const glm::vec4& lightDir)>(getFuncAddr((int)Func::ItemTool::renderEntity))(this, mat, inHand, lightDir);
}
bool isDeadly() override
{
return reinterpret_cast<bool (__thiscall*)(ItemTool* self)>(getFuncAddr((int)Func::ItemTool::isDeadly))(this);
}
bool isCompatible(const std::unique_ptr<Item>& other) override
{
return reinterpret_cast<bool (__thiscall*)(ItemTool* self, const std::unique_ptr<Item>& other)>(getFuncAddr((int)Func::ItemTool::isCompatible))(this, other);
}
uint32_t getStackLimit() override
{
return reinterpret_cast<uint32_t (__thiscall*)(ItemTool* self)>(getFuncAddr((int)Func::ItemTool::getStackLimit))(this);
}
bool action(World* world, Player* player, int action) override
{
return reinterpret_cast<bool (__thiscall*)(ItemTool* self, World* world, Player* player, int action)>(getFuncAddr((int)Func::ItemTool::action))(this, world, player, action);
}
bool breakBlock(World* world, Player* player, unsigned char block, const glm::ivec4& blockPos) override
{
return reinterpret_cast<bool (__thiscall*)(ItemTool* self, World* world, Player* player, unsigned char block, const glm::ivec4& blockPos)>(getFuncAddr((int)Func::ItemTool::breakBlock))(this, world, player, block, blockPos);
}
bool entityAction(World* world, Player* player, Entity* entity, int action) override
{
return reinterpret_cast<bool (__thiscall*)(ItemTool* self, World* world, Player* player, Entity* entity, int action)>(getFuncAddr((int)Func::ItemTool::entityAction))(this, world, player, entity, action);
}
std::unique_ptr<Item> clone() override
{
std::unique_ptr<Item> result;
reinterpret_cast<std::unique_ptr<Item>* (__thiscall*)(ItemTool* self, std::unique_ptr<Item>* result)>(getFuncAddr((int)Func::ItemTool::clone))(this, &result);
return result;
}
};
}