diff --git a/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp b/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp index 821a8e8d..46e174c0 100644 --- a/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp +++ b/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -440,6 +441,12 @@ namespace Simulator DefineAddress(GetRingEffect, SelectAddress(0xC6FB50, 0xC70990)); } + namespace Addresses(cPlayer) + { + DefineAddress(EmpireIsAwareOfPlayer, SelectAddress(0xc79900, 0xc7a910)); + DefineAddress(PlayerContactedEmpire, SelectAddress(0xc798a0, 0xc7a8b0)); + } + namespace Addresses(cPlayerInventory) { DefineAddress(GetUnlockableTool, SelectAddress(0xFF4640, 0xFF3BF0)); diff --git a/Spore ModAPI/SourceCode/Simulator/SimulatorMisc.cpp b/Spore ModAPI/SourceCode/Simulator/SimulatorMisc.cpp index a21bb8af..75af7f67 100644 --- a/Spore ModAPI/SourceCode/Simulator/SimulatorMisc.cpp +++ b/Spore ModAPI/SourceCode/Simulator/SimulatorMisc.cpp @@ -22,6 +22,7 @@ #include #include #include +#include namespace Simulator { @@ -243,6 +244,12 @@ namespace Simulator /// 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 \ No newline at end of file diff --git a/Spore ModAPI/Spore/Simulator/cPlayer.h b/Spore ModAPI/Spore/Simulator/cPlayer.h index ba308f64..83ead489 100644 --- a/Spore ModAPI/Spore/Simulator/cPlayer.h +++ b/Spore ModAPI/Spore/Simulator/cPlayer.h @@ -87,6 +87,18 @@ namespace Simulator public: static const uint32_t TYPE = 0x3C609F8; + /// Checks whether the specified empire is aware of the player. + /// An empire is considered "aware" if the player has contacted it at least once, + /// or if the empire has ever sent a transmission to the player. + /// @param empireID The ID of the empire to check. + /// @returns True if the empire is aware of the player, false otherwise. + bool EmpireIsAwareOfPlayer(uint32_t empireID); + + /// Checks whether the player has ever contacted the specified empire. + /// @param empireID The ID of the empire to check. + /// @returns True if the player has contacted the empire at least once, false otherwise. + bool PlayerContactedEmpire(uint32_t empireID); + public: /* 38h */ eastl::sp_fixed_hash_set mOneTimeEventFlags; /* 68Ch */ int field_68C; @@ -135,4 +147,10 @@ namespace Simulator /* 129Ch */ eastl::fixed_vector mAdventuresCompleted; }; ASSERT_SIZE(cPlayer, 0x12D8); + + namespace Addresses(cPlayer) + { + DeclareAddress(EmpireIsAwareOfPlayer); // 0xc79900 0xc7a910 + DeclareAddress(PlayerContactedEmpire); // 0xc798a0 0xc7a8b0 + } } \ No newline at end of file