Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <Spore\Simulator\cPlaceObjectToolStrategy.h>
#include <Spore\Simulator\cPlanet.h>
#include <Spore\Simulator\cPlanetRecord.h>
#include <Spore\Simulator\cPlayer.h>
#include <Spore\Simulator\cPlayerInventory.h>
#include <Spore\Simulator\cTimeOfDay.h>
#include <Spore\Simulator\cRallyCallToolStrategy.h>
Expand Down Expand Up @@ -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));
Expand Down
7 changes: 7 additions & 0 deletions Spore ModAPI/SourceCode/Simulator/SimulatorMisc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <Spore\Simulator\cPlanetaryArtifact.h>
#include <Spore\Simulator\cNpcTribeController.h>
#include <Spore\Simulator\cScenarioEditModeDisplayStrategy.h>
#include <Spore\Simulator\cPlayer.h>

namespace Simulator
{
Expand Down Expand Up @@ -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
18 changes: 18 additions & 0 deletions Spore ModAPI/Spore/Simulator/cPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<ResourceKey, 64> mOneTimeEventFlags;
/* 68Ch */ int field_68C;
Expand Down Expand Up @@ -135,4 +147,10 @@ namespace Simulator
/* 129Ch */ eastl::fixed_vector<uint32_t, 9> mAdventuresCompleted;
};
ASSERT_SIZE(cPlayer, 0x12D8);

namespace Addresses(cPlayer)
{
DeclareAddress(EmpireIsAwareOfPlayer); // 0xc79900 0xc7a910
DeclareAddress(PlayerContactedEmpire); // 0xc798a0 0xc7a8b0
}
}