Skip to content

Commit 56de4b1

Browse files
committed
- Add BundleManager with method CreateBundles()
- Add cTribe::UpdateFoodVisuals(), and addresses to SpawnMember(), CreateTool(), RemoveTool() - Rename cCombatant::func2Ch() to Heal()
1 parent 5c09b0a commit 56de4b1

12 files changed

Lines changed: 86 additions & 2 deletions

File tree

Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
#include <Spore\Simulator\SubSystem\PlantSpeciesManager.h>
107107
#include <Spore\Simulator\SubSystem\GamePersistenceManager.h>
108108
#include <Spore\Simulator\SubSystem\CinematicManager.h>
109+
#include <Spore\Simulator\SubSystem\BundleManager.h>
109110
#include <Spore\Simulator\NounClassFactories.h>
110111

111112
namespace Addresses(Simulator)
@@ -1129,12 +1130,21 @@ namespace Simulator
11291130

11301131
namespace Addresses(cTribe) {
11311132
DefineAddress(GetToolByType, SelectAddress(0xC8ED20, 0xC8F870));
1133+
DefineAddress(SpawnMember, SelectAddress(0xC97BA0, 0xC983C0));
1134+
DefineAddress(CreateTool, SelectAddress(0xC95950, 0xC96170));
1135+
DefineAddress(RemoveTool, SelectAddress(0xC96800, 0xC97020));
1136+
DefineAddress(UpdateFoodVisuals, SelectAddress(0xC94520, 0xC94CE0));
11321137
}
11331138

11341139
namespace Addresses(cTribeTool) {
11351140
DefineAddress(GetToolClass, SelectAddress(0xC9CAB0, 0xC9D2A0));
11361141
DefineAddress(GetRefundMoney, SelectAddress(0xC9C970, 0xC9D160));
11371142
}
1143+
1144+
namespace Addresses(cBundleManager) {
1145+
DefineAddress(Get, SelectAddress(0xB3D210, 0xB3D3B0));
1146+
DefineAddress(CreateBundles, SelectAddress(0xAC7810, 0xAC79F0));
1147+
}
11381148
}
11391149

11401150
#ifdef SDK_TO_GHIDRA

Spore ModAPI/SourceCode/Simulator/SimulatorMisc.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <Spore\Simulator\cSpeciesProfile.h>
88
#include <Spore\Simulator\cIdentityColorable.h>
99
#include <Spore\Simulator\SubSystem\GamePersistenceManager.h>
10+
#include <Spore\Simulator\SubSystem\BundleManager.h>
1011
#include <Spore\Simulator\SubSystem\CinematicManager.h>
1112
#include <Spore\Simulator\cDefaultToolProjectile.h>
1213
#include <Spore\Simulator\cArtilleryProjectile.h>
@@ -204,5 +205,14 @@ namespace Simulator
204205
int CinematicAction::Release() {
205206
return RefCountTemplate::Release();
206207
}
208+
209+
/// BundleManager ///
210+
211+
auto_STATIC_METHOD_(cBundleManager, cBundleManager*, Get);
212+
213+
auto_METHOD(cBundleManager, cGameBundle*, CreateBundles,
214+
Args(float amount, cGameBundleContainer* container, int bundleType),
215+
Args(amount, container, bundleType));
207216
}
217+
208218
#endif

Spore ModAPI/SourceCode/Simulator/cTribe.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ namespace Simulator
1414
Args(const Math::Vector3& position, int tribeArchetype, int numMembers, int arg0, bool arg1, cSpeciesProfile* species),
1515
Args(position, tribeArchetype, numMembers, arg0, arg1, species));
1616

17+
auto_METHOD_VOID(cTribe, UpdateFoodVisuals, Args(float a), Args(a));
18+
1719
auto_METHOD(cTribe, cTribeTool*, GetToolByType, Args(int toolType), Args(toolType));
1820

1921
eastl::vector<cFishHotSpotUnk>& GetTribeFishHotSpots() {

Spore ModAPI/Spore ModAPI.vcxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@
328328
<ClInclude Include="Spore\App\JobManager.h" />
329329
<ClInclude Include="Spore\App\Thumbnail_cImportExport.h" />
330330
<ClInclude Include="Spore\Simulator\cTribeToolData.h" />
331+
<ClInclude Include="Spore\Simulator\SubSystem\BundleManager.h" />
331332
<ClInclude Include="Spore\Simulator\SubSystem\CinematicManager.h" />
332333
<ClInclude Include="Spore\Simulator\SubSystem\UIAssetDiscoveryManager.h" />
333334
<ClInclude Include="Spore\Simulator\UIStateMachine.h" />
@@ -843,6 +844,7 @@
843844
<ClInclude Include="Spore\UI\ITokenTranslator.h" />
844845
<ClInclude Include="Spore\UI\LayerManager.h" />
845846
<ClInclude Include="Spore\UI\Minimap.h" />
847+
<ClInclude Include="Spore\UI\SimulatorRollovers.h" />
846848
<ClInclude Include="Spore\UI\ScrollFrameVertical.h" />
847849
<ClInclude Include="Spore\UI\SpaceGameUI.h" />
848850
<ClInclude Include="Spore\UI\cSPUITextZoom.h" />

Spore ModAPI/Spore ModAPI.vcxproj.filters

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2208,6 +2208,12 @@
22082208
<ClInclude Include="Spore\Simulator\cTribeToolData.h">
22092209
<Filter>Header Files</Filter>
22102210
</ClInclude>
2211+
<ClInclude Include="Spore\UI\SimulatorRollovers.h">
2212+
<Filter>Header Files</Filter>
2213+
</ClInclude>
2214+
<ClInclude Include="Spore\Simulator\SubSystem\BundleManager.h">
2215+
<Filter>Header Files</Filter>
2216+
</ClInclude>
22112217
</ItemGroup>
22122218
<ItemGroup>
22132219
<ClCompile Include="SourceCode\Allocator.cpp">

Spore ModAPI/Spore/Simulator.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include <Spore\Simulator\SubSystem\TerraformingManager.h>
4040
#include <Spore\Simulator\SubSystem\CinematicManager.h>
4141
#include <Spore\Simulator\SubSystem\UIAssetDiscoveryManager.h>
42+
#include <Spore\Simulator\SubSystem\BundleManager.h>
4243

4344
#include <Spore\Simulator\cGameData.h>
4445
#include <Spore\Simulator\cGonzagoSimulator.h>

Spore ModAPI/Spore/Simulator/SimulatorEnums.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,4 +715,11 @@ namespace Simulator
715715
kTribeToolClassSocial = 2,
716716
kTribeToolClassOther = 3,
717717
};
718+
719+
enum TribeBundleType
720+
{
721+
kTribeBundleTypeFruit = 1,
722+
kTribeBundleTypeMeat = 2,
723+
kTribeBundleTypeFish = 3,
724+
};
718725
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#pragma once
2+
3+
#include <Spore\Simulator\SubSystem\cStrategy.h>
4+
#include <Spore\Simulator\cGameBundleContainer.h>
5+
6+
#define BundleManager (*Simulator::cBundleManager::Get())
7+
8+
namespace Simulator
9+
{
10+
class cBundleManager
11+
: public cStrategy
12+
{
13+
public:
14+
static cBundleManager* Get();
15+
16+
/// Creates one or more bundles of the given type and adds them to the container.
17+
/// The number of bundles created depends on the 'amount' and how much value each bundle
18+
/// can contain, which depends on the container.
19+
/// @param amount
20+
/// @param container
21+
/// @param bundleType
22+
/// @returns The last bundle created
23+
cGameBundle* CreateBundles(float amount, cGameBundleContainer* container, int bundleType);
24+
25+
public:
26+
/* 1Ch */ void* mpGroundContainer; //TODO cGameBundleGroundContainerPtr
27+
};
28+
ASSERT_SIZE(cBundleManager, 0x20);
29+
30+
namespace Addresses(cBundleManager) {
31+
DeclareAddress(Get); // 0xB3D210 0xB3D3B0
32+
DeclareAddress(CreateBundles); // 0xAC7810 0xAC79F0
33+
}
34+
}

Spore ModAPI/Spore/Simulator/cCombatant.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ namespace Simulator
8787
/// Generates a random index that allows to select from the existing aim points.
8888
/* 24h */ virtual int GetRandomAimIndex();
8989
/* 28h */ virtual Math::Vector3 func28h(int);
90-
/* 2Ch */ virtual void func2Ch(bool); // heals buildings?
90+
/* 2Ch */ virtual void Heal(bool); // heals buildings?
9191
/* 30h */ virtual Math::Vector3 func30h();
9292
/* 34h */ virtual uint32_t func34h(); // returns field_70, an effect ID
9393
/* 38h */ virtual void func38h(); // sets lastAttacker to -1 and field_28 to nullptr

Spore ModAPI/Spore/Simulator/cGameBundleContainer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <Spore\Simulator\cGameData.h>
2222
#include <Spore\Simulator\cSpatialObject.h>
2323
#include <Spore\Simulator\cBehaviorList.h>
24+
#include <Spore\Simulator\ISimulatorSerializable.h>
2425
#include <EASTL\vector.h>
2526

2627
#define cGameBundleContainerPtr eastl::intrusive_ptr<Simulator::cGameBundleContainer>

0 commit comments

Comments
 (0)