Skip to content

Commit 22ed6ac

Browse files
authored
Add two methods to cPlayer, EmpireIsAwareOfPlayer and PlayerContactedEmpire. (#91)
* Add EmpireIsAwareOfPlayer method to cPlayer * Add PlayerContactedEmpire method to cPlayer * Delete player.cpp and move meths to SimulatorMisc.cpp * Delete unwanted changes to .vcxproj
1 parent 3f82e44 commit 22ed6ac

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include <Spore\Simulator\cPlaceObjectToolStrategy.h>
4141
#include <Spore\Simulator\cPlanet.h>
4242
#include <Spore\Simulator\cPlanetRecord.h>
43+
#include <Spore\Simulator\cPlayer.h>
4344
#include <Spore\Simulator\cPlayerInventory.h>
4445
#include <Spore\Simulator\cTimeOfDay.h>
4546
#include <Spore\Simulator\cRallyCallToolStrategy.h>
@@ -440,6 +441,12 @@ namespace Simulator
440441
DefineAddress(GetRingEffect, SelectAddress(0xC6FB50, 0xC70990));
441442
}
442443

444+
namespace Addresses(cPlayer)
445+
{
446+
DefineAddress(EmpireIsAwareOfPlayer, SelectAddress(0xc79900, 0xc7a910));
447+
DefineAddress(PlayerContactedEmpire, SelectAddress(0xc798a0, 0xc7a8b0));
448+
}
449+
443450
namespace Addresses(cPlayerInventory)
444451
{
445452
DefineAddress(GetUnlockableTool, SelectAddress(0xFF4640, 0xFF3BF0));

Spore ModAPI/SourceCode/Simulator/SimulatorMisc.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <Spore\Simulator\cPlanetaryArtifact.h>
2323
#include <Spore\Simulator\cNpcTribeController.h>
2424
#include <Spore\Simulator\cScenarioEditModeDisplayStrategy.h>
25+
#include <Spore\Simulator\cPlayer.h>
2526

2627
namespace Simulator
2728
{
@@ -261,6 +262,12 @@ namespace Simulator
261262
/// cNpcTribeController ///
262263

263264
auto_STATIC_METHOD_(cNpcTribeController, cNpcTribeController*, Get);
265+
266+
/// cPlayer ///
267+
268+
auto_METHOD(cPlayer, bool, EmpireIsAwareOfPlayer, Args(uint32_t empireID), Args(empireID));
269+
auto_METHOD(cPlayer, bool, PlayerContactedEmpire, Args(uint32_t empireID), Args(empireID));
270+
264271
}
265272

266273
#endif

Spore ModAPI/Spore/Simulator/cPlayer.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,18 @@ namespace Simulator
8787
public:
8888
static const uint32_t TYPE = 0x3C609F8;
8989

90+
/// Checks whether the specified empire is aware of the player.
91+
/// An empire is considered "aware" if the player has contacted it at least once,
92+
/// or if the empire has ever sent a transmission to the player.
93+
/// @param empireID The ID of the empire to check.
94+
/// @returns True if the empire is aware of the player, false otherwise.
95+
bool EmpireIsAwareOfPlayer(uint32_t empireID);
96+
97+
/// Checks whether the player has ever contacted the specified empire.
98+
/// @param empireID The ID of the empire to check.
99+
/// @returns True if the player has contacted the empire at least once, false otherwise.
100+
bool PlayerContactedEmpire(uint32_t empireID);
101+
90102
public:
91103
/* 38h */ eastl::sp_fixed_hash_set<ResourceKey, 64> mOneTimeEventFlags;
92104
/* 68Ch */ int field_68C;
@@ -135,4 +147,10 @@ namespace Simulator
135147
/* 129Ch */ eastl::fixed_vector<uint32_t, 9> mAdventuresCompleted;
136148
};
137149
ASSERT_SIZE(cPlayer, 0x12D8);
150+
151+
namespace Addresses(cPlayer)
152+
{
153+
DeclareAddress(EmpireIsAwareOfPlayer); // 0xc79900 0xc7a910
154+
DeclareAddress(PlayerContactedEmpire); // 0xc798a0 0xc7a8b0
155+
}
138156
}

0 commit comments

Comments
 (0)