forked from Spore-Community/Spore-ModAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimulatorMisc.cpp
More file actions
290 lines (195 loc) · 9.32 KB
/
SimulatorMisc.cpp
File metadata and controls
290 lines (195 loc) · 9.32 KB
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
#ifndef MODAPI_DLL_EXPORT
#include <Spore\Simulator\cHerd.h>
#include <Spore\Simulator\cSpaceNames.h>
#include <Spore\Simulator\cBadgeManager.h>
#include <Spore\Simulator\cObjectPool.h>
#include <Spore\Simulator\cSimulatorUniverse.h>
#include <Spore\Simulator\cSpeciesProfile.h>
#include <Spore\Simulator\cIdentityColorable.h>
#include <Spore\Simulator\SubSystem\GamePersistenceManager.h>
#include <Spore\Simulator\SubSystem\BundleManager.h>
#include <Spore\Simulator\SubSystem\UIAssetDiscoveryManager.h>
#include <Spore\Simulator\SubSystem\CinematicManager.h>
#include <Spore\Simulator\SubSystem\GamePlantManager.h>
#include <Spore\Simulator\SubSystem\ObstacleManager.h>
#include <Spore\Simulator\cDefaultToolProjectile.h>
#include <Spore\Simulator\cArtilleryProjectile.h>
#include <Spore\Simulator\cCulturalProjectile.h>
#include <Spore\Simulator\cFlakProjectile.h>
#include <Spore\Simulator\cResourceProjectile.h>
#include <Spore\Simulator\cSpaceDefenseMissile.h>
#include <Spore\Simulator\cCollectableItems.h>
#include <Spore\Simulator\cPlanetaryArtifact.h>
#include <Spore\Simulator\cNpcTribeController.h>
#include <Spore\Simulator\cScenarioEditModeDisplayStrategy.h>
#include <Spore\Simulator\cPlayer.h>
namespace Simulator
{
auto_METHOD_(cScenarioEditModeDisplayStrategy, bool, Load);
void cHerd::SetEnabled(bool enabled)
{
mbEnabled = enabled;
if (mpNest) mpNest->mbEnabled = enabled;
for (auto egg : mEggs) {
egg->mEnabled = enabled;
}
}
auto_STATIC_METHOD_(cSpaceNames, cSpaceNames*, Get);
eastl::string16 cSpaceNames::GenerateRandomName(SpaceNamesType arg)
{
eastl::string16 dst;
CALL(GetAddress(cSpaceNames, GenerateRandomName), void,
Args(cSpaceNames*, eastl::string16&, SpaceNamesType), Args(this, dst, arg));
return dst;
}
auto_METHOD_VOID(cBadgeManager, AddToBadgeProgress,
Args(BadgeManagerEvent badge, int addedValue), Args(badge, addedValue));
//// cObjectPool ////
cObjectPool_::cObjectPool_()
: mpData(nullptr)
{}
cObjectPool_::~cObjectPool_()
{
CALL(GetAddress(cObjectPool_, _dtor), void, Args(cObjectPool_*), Args(this));
}
auto_METHOD_VOID(cObjectPool_, Initialize, Args(int objectSize, int numObjects), Args(objectSize, numObjects));
auto_METHOD_VOID_(cObjectPool_, Clear);
auto_METHOD(cObjectPool_, cObjectPoolClass*, Get, Args(cObjectPoolIndex arg), Args(arg));
auto_METHOD(cObjectPool_, cObjectPoolClass*, GetIfNotDeleted, Args(cObjectPoolIndex arg), Args(arg));
auto_METHOD_(cObjectPool_, cObjectPoolIndex, CreateObject);
auto_METHOD_VOID(cObjectPool_, DeleteObject, Args(cObjectPoolIndex arg), Args(arg));
auto_METHOD_const(cObjectPool_, cObjectPoolClass*, Iterate, Args(Iterator& arg), Args(arg));
//// cSimulatorUniverse ////
cSimulatorUniverse* cSimulatorUniverse::Get()
{
return *(cSimulatorUniverse**)GetAddress(cSimulatorUniverse, _ptr);
}
//// GamePersistenceManager ////
auto_STATIC_METHOD_(cGamePersistenceManager, cGamePersistenceManager*, Get);
//// cSpeciesProfile ////
auto_METHOD_VOID(cSpeciesProfile, GetSpeciesName, Args(eastl::string16& dst), Args(dst));
//// cIdentityColorable ////
auto_METHOD_VOID(cIdentityColorable, AssignNames, Args(const eastl::string16& speciesName), Args(speciesName));
auto_STATIC_METHOD(Simulator, const Math::ColorRGB&, GetCachedColorFromId, Args(uint32_t colorId), Args(colorId));
eastl::map<uint32_t, Math::ColorRGB>& GetCachedColorIdMap() {
return *(eastl::map<uint32_t, Math::ColorRGB>*)GetAddress(Simulator, sCachedColorIdMap__ptr);
}
//// cDefaultToolProjectile ////
auto_STATIC_METHOD_VOID(Simulator, LaunchDefaultToolProjectile,
Args(cSpaceToolData* tool, cDefaultToolProjectile* projectile, const Math::Vector3& origin, const Math::Vector3& target),
Args(tool, projectile, origin, target));
//// cArtilleryProjectile ////
auto_METHOD_VOID(cArtilleryProjectile, LaunchProjectile, Args(const Math::Vector3& target), Args(target));
//// cCulturalProjectile ////
auto_METHOD_VOID(cCulturalProjectile, LaunchProjectile,
Args(cGameData* owner, cVehicle* vehicle, cSpaceToolData* tool, cCombatant* target, const Math::Vector3& unk0, float unk1, bool unk2, bool spin),
Args(owner, vehicle, tool, target, unk0, unk1, unk2, spin));
//// cFlakProjectile ////
auto_METHOD_VOID(cFlakProjectile, LaunchProjectile, Args(const Math::Vector3& target, float arg), Args(target, arg));
//// cResourceProjectile ////
auto_METHOD_VOID(cResourceProjectile, LaunchProjectile,
Args(cCivilization* civilization, cCommodityNode* commodityNode, const Math::Vector3& arg0, float speed, bool arg1),
Args(civilization, commodityNode, arg0, speed, arg1));
//// cSpaceDefenseMissile ////
auto_METHOD_VOID(cSpaceDefenseMissile, LaunchProjectile, Args(const Math::Vector3& target, cCombatant* arg), Args(target, arg));
//// cCollectableItems ////
auto_METHOD_VOID(cCollectableItems, LoadConfig,
Args(uint32_t configGroupID, uint32_t configInstanceID, uint32_t itemsGroupID),
Args(configGroupID, configInstanceID, itemsGroupID));
auto_METHOD_VOID(cCollectableItems, AddUnlockableItem,
Args(uint32_t instanceID, uint32_t groupID, int itemUnlockLevel, uint32_t categoryID, int row, int column, int pageIndex, float itemUnlockFindPercentage, uint32_t itemUnlockEffect),
Args(instanceID, groupID, itemUnlockLevel, categoryID, row, column, pageIndex, itemUnlockFindPercentage, itemUnlockEffect));
auto_METHOD(cCollectableItems, bool, AddUnlockableItemFromProp,
Args(struct ResourceKey key, uint32_t categoryID, int row, int column, int pageIndex),
Args(key, categoryID, row, column, pageIndex));
auto_METHOD_VOID_(cCollectableItems, sub_5976E0);
auto_METHOD_VOID(cCollectableItems, UnlockPart,
Args(uint32_t instanceID, uint32_t groupID, int unk),
Args(instanceID, groupID, unk));
auto_METHOD_VOID(cCollectableItems, LockPart,
Args(uint32_t instanceID, uint32_t groupID),
Args(instanceID, groupID));
auto_METHOD_VOID_(cCollectableItems, sub_594010);
auto_METHOD_VOID(cCollectableItems, sub_597BC0,
Args(UnkCategoryHashMap& dst, int unk, const ResourceKey& speciesKey),
Args(dst, unk, speciesKey));
auto_METHOD_VOID(cCollectableItems, sub_597390,
Args(eastl::vector<int>& dst, struct cCollectableItemID itemID, int unk),
Args(dst, itemID, unk));
eastl::fixed_vector<eastl::pair<uint32_t, int>, 16>& GetCreatureGameUnlockCategoriesCount() {
return *(eastl::fixed_vector<eastl::pair<uint32_t, int>, 16>*)(GetAddress(Simulator, sCreatureGameUnlockCategoriesCount));
}
//// cPlanetaryArtifact ////
auto_METHOD_VOID_(cPlanetaryArtifact, SetLocomotion);
auto_METHOD_VOID(cPlanetaryArtifact, LoadFromItem,
Args(SpaceInventoryItemType itemType, const ResourceKey& itemKey, int count, bool arg),
Args(itemType, itemKey, count, arg));
//// CinematicManager ////
auto_STATIC_METHOD_(cCinematicManager, cCinematicManager*, Get);
auto_METHOD_VOID(cCinematicManager, PlayCinematic,
Args(const char* cinematicName, int arg0, int arg1, int arg2, int arg3, int arg4),
Args(cinematicName, arg0, arg1, arg2, arg3, arg4));
CinematicActionFunction_t CinematicAction::GetStartVignetteFunction() {
return (CinematicActionFunction_t)(GetAddress(CinematicAction, StartVignetteFunction_ptr));
}
int CinematicVignetteActionData::AddRef() {
return DefaultRefCounted::AddRef();
}
int CinematicVignetteActionData::Release() {
return DefaultRefCounted::Release();
}
void* CinematicVignetteActionData::Cast(uint32_t type) const {
CLASS_CAST(CinematicVignetteActionData);
CLASS_CAST(Object);
return nullptr;
}
CinematicVignetteActionData::CinematicVignetteActionData()
: mActorId()
, mVignetteId()
, mVignetteKey()
, mPosition()
, mFacingOffset()
, mRelativePosType(PositionType::Unk1)
, mRelativePosId()
, mFacingType(PositionType::None)
, mFacingId()
, mNoWait()
, mOffsetMultiplier(OffsetMultiplier::None)
, field_50(-1)
{
}
int CinematicAction::AddRef() {
return RefCountTemplate::AddRef();
}
int CinematicAction::Release() {
return RefCountTemplate::Release();
}
/// BundleManager ///
auto_STATIC_METHOD_(cBundleManager, cBundleManager*, Get);
auto_METHOD(cBundleManager, cGameBundle*, CreateBundles,
Args(float amount, cGameBundleContainer* container, int bundleType),
Args(amount, container, bundleType));
auto_METHOD(cBundleManager, float, RemoveBundles,
Args(float amount, cGameBundleContainer* container, cGameBundle* bundle),
Args(amount, container, bundle));
cGameBundle* cBundleManager::CreateGroundBundles(float amount, int bundleType, const Vector3& position, const Quaternion& orientation) {
cGameBundle* bundles = CreateBundles(amount, mpGroundContainer.get(), bundleType);
if (bundles) bundles->Teleport(position, orientation);
return bundles;
}
float cBundleManager::RemoveGroundBundles(float amount, cGameBundle* bundle) {
return RemoveBundles(amount, mpGroundContainer.get(), bundle);
}
/// GamePlantManager ///
auto_STATIC_METHOD_(cGamePlantManager, cGamePlantManager*, Get);
/// UIAssetDiscoveryManager ///
auto_STATIC_METHOD_(cUIAssetDiscoveryManager, cUIAssetDiscoveryManager*, Get);
/// ObstacleManager ///
auto_STATIC_METHOD_(cObstacleManager, cObstacleManager*, Get);
/// cNpcTribeController ///
auto_STATIC_METHOD_(cNpcTribeController, cNpcTribeController*, Get);
/// cPlayer ///
auto_METHOD(cPlayer, bool, EmpireIsAwareOfPlayer, Args(uint32_t empireID), Args(empireID));
auto_METHOD(cPlayer, bool, PlayerContactedEmpire, Args(uint32_t empireID), Args(empireID));
}
#endif