Skip to content

Commit

Permalink
Add cNpcTribeController class
Browse files Browse the repository at this point in the history
  • Loading branch information
emd4600 committed Oct 25, 2024
1 parent ee721ff commit a715461
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
#include <Spore\Simulator\cTribeTool.h>
#include <Spore\Simulator\cTribeToolData.h>
#include <Spore\Simulator\cTribeInputStrategy.h>
#include <Spore\Simulator\cNpcTribeController.h>
#include <Spore\Simulator\SubSystem\cRelationshipManager.h>
#include <Spore\Simulator\SubSystem\GameBehaviorManager.h>
#include <Spore\Simulator\SubSystem\GameInputManager.h>
Expand Down Expand Up @@ -1181,6 +1182,10 @@ namespace Simulator
namespace Addresses(cObstacleManager) {
DefineAddress(Get, SelectAddress(0xB3D320, 0xB3D4C0));
}

namespace Addresses(cNpcTribeController) {
DefineAddress(Get, SelectAddress(0xCC8330, 0xCC8C90));
}
}

#ifdef SDK_TO_GHIDRA
Expand Down
5 changes: 5 additions & 0 deletions Spore ModAPI/SourceCode/Simulator/SimulatorMisc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <Spore\Simulator\cSpaceDefenseMissile.h>
#include <Spore\Simulator\cCollectableItems.h>
#include <Spore\Simulator\cPlanetaryArtifact.h>
#include <Spore\Simulator\cNpcTribeController.h>

namespace Simulator
{
Expand Down Expand Up @@ -234,6 +235,10 @@ namespace Simulator
/// ObstacleManager ///

auto_STATIC_METHOD_(cObstacleManager, cObstacleManager*, Get);

/// cNpcTribeController ///

auto_STATIC_METHOD_(cNpcTribeController, cNpcTribeController*, Get);
}

#endif
1 change: 1 addition & 0 deletions Spore ModAPI/Spore ModAPI.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
<ClInclude Include="Spore\Simulator\cBaseSimulatorInputStrategy.h" />
<ClInclude Include="Spore\Simulator\cObstacle.h" />
<ClInclude Include="Spore\Simulator\cTribeInputStrategy.h" />
<ClInclude Include="Spore\Simulator\cNpcTribeController.h" />
<ClInclude Include="Spore\Simulator\cTribeToolData.h" />
<ClInclude Include="Spore\Simulator\SubSystem\BundleManager.h" />
<ClInclude Include="Spore\Simulator\SubSystem\CinematicManager.h" />
Expand Down
3 changes: 3 additions & 0 deletions Spore ModAPI/Spore ModAPI.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -2235,6 +2235,9 @@
<ClInclude Include="Spore\Simulator\SubSystem\ObstacleManager.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Spore\Simulator\cNpcTribeController.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="SourceCode\Allocator.cpp">
Expand Down
1 change: 1 addition & 0 deletions Spore ModAPI/Spore/Simulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
#include <Spore\Simulator\cRaidPlunderEvent.h>
#include <Spore\Simulator\cInteractableObject.h>
#include <Spore\Simulator\cInteractiveOrnament.h>
#include <Spore\Simulator\cNpcTribeController.h>

#include <Spore\Simulator\SimulatorMessages.h>

Expand Down
38 changes: 38 additions & 0 deletions Spore ModAPI/Spore/Simulator/cNpcTribeController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#pragma once

#include <Spore\Simulator\cGonzagoSimulator.h>
#include <Spore\Simulator\cGonzagoTimer.h>
#include <Spore\Simulator\cCreatureBase.h>
#include <EASTL\fixed_vector.h>
#include <EASTL\string.h>
#include <EASTL\map.h>

#define NpcTribeController (*Simulator::cNpcTribeController::Get())

namespace Simulator
{
class cNpcTribeController
: public cGonzagoSimulator
{
public:
static const uint32_t TYPE = 0x11418FF;

/// Returns the only cNpcTribeController instance; this function also creates
/// that instance the first time it is called.
static cNpcTribeController* Get();

public:
/* 10h */ cGonzagoTimer mPostTutorialDelayTimer_Mating;
/* 30h */ cGonzagoTimer mPostTutorialDelayTimer_Food;
/* 50h */ eastl::string16 field_50;
/* 60h */ eastl::map<cCreatureBasePtr, cGonzagoTimer> mBabyGrowthTimers;
/* 7Ch */ eastl::fixed_vector<ResourceKey, 5> mNPCTribeSpeciesKeys;
/* D0h */ eastl::fixed_vector<cSpeciesProfile*, 5> mNPCTribeSpecies;
/* FCh */ int mTribeAppearanceProperty;
};
ASSERT_SIZE(cNpcTribeController, 0x100);

namespace Addresses(cNpcTribeController) {
DeclareAddress(Get); // 0xCC8330 0xCC8C90
}
}

0 comments on commit a715461

Please sign in to comment.