class
#include <Spore/Simulator/cMission.h>
cMission Base class for all missions, this class cannot be instantiated.
Contents
Base classes
- class cGameData
- Base class for most Simulator objects.
- class App::IMessageListener
- An interface that can receive messages sent through the app.
Public static variables
- static const uint32_t TYPE
Public functions
- void SetState(MissionState state)
- Changes the state of the mission.
- auto GetOwnerEmpire() -> cEmpire*
- Returns the empire that created this mission.
- auto GetTargetEmpire() -> cEmpire*
- Returns the target empire of this mission.
- void SetTargetEmpire(cEmpire* pEmpire)
- Sets the target empire of this mission.
- auto GetState() -> int virtual
- auto func64h() -> bool virtual
- auto func68h() -> bool virtual
- void func6Ch() virtual
- void func70h() virtual
- auto GetCardWindowControlID() -> uint32_t virtual
- void Initialize() virtual
- auto Update(int deltaTime) -> MissionState virtual
- Only called when state is Active, called every frame.
- void Load() virtual
- Loads prop file.
- void ShutdownSystems() virtual
- Calling when destroying the mission, if
mSystemsShutdown
is false. - void OnMissionAccept() virtual
- Called when the player accepts the mission.
- void OnMissionReject() virtual
- Called when the mission is rejected.
- void OnMissionAbort() virtual
- Called when the mission is aborted.
- void OnMissionCompleted() virtual
- Called when the mission is completed.
- void OnMissionFailed() virtual
- Called when the mission is failed.
- void FailMission() virtual
- Causes this mission to fail.
- auto GetDescription(eastl::string16* dst) -> eastl::string16* virtual
- Returns a description for this mission, usually the
description
property in the prop list. - auto GetConversationID() -> uint32_t virtual
- Returns the ID of a
.cnv
conversation file used for the mission. - auto GetDuration() -> int virtual
- Returns how much time the mission can last, in milliseconds. 0 if there is no time limit.
- auto GetRemainingTime() -> int virtual
- For missions with a time limit, returns how much time is left (duration - elapsedTime). Otherwise, returns 0.
- auto GetTargetAnimalSpecies() -> cSpeciesProfile* virtual
- void GetTargetAnimalSpeciesNameText(eastl::string16& dst) virtual
- void GetTitleText(eastl::string16& dst) virtual
- void GetUIMediumDescText(eastl::string16& dst) virtual
- void GetUILongDescText(eastl::string16& dst) virtual
- void funcC4h(eastl::string16& dst) virtual
- void GetAlertTitleText(eastl::string16& dst) virtual
- "Mission" or "Alert"
- void GetStarClueText(int index, eastl::string16& dst) virtual
- void GetStarClueDistanceText(eastl::string16& dst) virtual
- void GetStarClueRangeMinText(eastl::string16& dst) virtual
- void GetStarClueRangeMaxText(eastl::string16& dst) virtual
- void GetPlanetClueOrbitOrderText(eastl::string16& dst) virtual
- void GetPlanetClueText(eastl::string16& dst) virtual
- auto GetStarMapEffectGroup() -> uint32_t virtual
- auto GetStarMapEffect() -> uint32_t virtual
- auto GetTravelCost() -> int virtual
- Returns how much money it costs to travel from the source planet to the target planet and back.
- auto GetTravelDistance() -> float virtual
- Returns how much distance to travel from the source planet to the target planet and back.
- auto IsTargetPlanet(cPlanetRecord* pPlanetRecord) -> bool virtual
- Returns true if the given planet is the target planet of the mission, or false otherwise.
- auto HasBeenFulfilled() -> bool virtual
- auto HasFailed() -> bool virtual
- auto func100h() -> bool virtual
- auto func104h() -> bool virtual
- auto func108h() -> int virtual
- auto func10Ch() -> uint32_t virtual
- auto func110h(int, int) -> uint32_t virtual
- void func114h() virtual
- auto TranslateToken(uint32_t tokenID, eastl::string16& dst) -> bool virtual
- Called by the space token translator, used to replace special tokens in localized texts.
- auto GetCompletedEventLogID() -> uint32_t virtual
- By default,
event_log_return_for_rewards
- auto func120h() -> bool virtual
- void func120h(int) virtual
- auto CreateClues() -> bool virtual
- Creates the star and planet clues for finding landmarks, only if they are not disabled with the
kMissionFlagHideStarName
andkMissionFlagHidePlanetName
flags. - auto CreateStarClue() -> bool virtual
- Chooses one nearby star where a landmark must be found, and enables the
mStarClue
accordingly. - auto CreatePlanetClue() -> bool virtual
- auto IsSourcePlanetAndEmpire(uint32_t empireId, PlanetID planetId) -> bool virtual
- Returns true if the mission is Active or Complete, and the given empire and planet are the empire and planet where the mission originated.
- auto HasEnoughAvailableCargoSlots() -> bool virtual
- Checks if the player has enough available cargo slots in the inventory to give the animals and plants of the mission (
mGiveOnAcceptAnimalIDs
andmGiveOnAcceptPlantIDs
). - auto func13Ch() -> bool virtual
- auto func140h(int, int) -> bool virtual
- void AddMessageListeners() virtual
- Adds this mission as listener to some game messages.
- void RemoveMessageListeners() virtual
- void AddMessageListener(uint32_t messageId) virtual
- void RemoveMessageListener(uint32_t messageId) virtual
- auto ListensToMessage(uint32_t messageId) -> bool virtual
- Returns true if the mission is a listener to the given game internal message.
- auto func158h() -> bool virtual
- auto func15Ch() -> bool virtual
- auto func160h() -> int virtual
- auto func164h() -> int virtual
- auto func168h() -> bool virtual
- void func16Ch() virtual
- void ExportTargetPlanetAndSpecies() virtual
- Reads properties
missionExportTargetPlanetTo
andmissionExportTargetSpeciesTo
. - void func174h(int) virtual
- auto func178h() -> uint32_t virtual
- auto GetCreatureGoalCardLayoutId() -> uint32_t virtual
- auto func180h() -> bool virtual
- auto func184h(int, int) -> float virtual
- auto CalculateMissionDuration() -> int virtual
- auto PickTargetAnimalSpecies() -> bool virtual
- Sets
mTargetAnimalSpecies
andmTargetAnimalSpeciesKey
. - void func190h(const ResourceKey& speciesId) virtual
- void func194h() virtual
- auto func198h(bool) -> bool virtual
- void func19Ch() virtual
- void func1A0h(bool) virtual
- auto AddRef() -> int pure virtual
- auto Release() -> int pure virtual
- auto Cast() const -> void* pure virtual
Public variables
- cGonzagoTimer field_38
- cGonzagoTimer field_58
- uint32_t mMissionID
- unsigned int mElapsedTimeMS
- int mDuration
- MissionState mState
- bool mSystemsShutdown
- uint32_t mOwnerEmpireID
- cEmpirePtr mpOwnerEmpire
- Owner empire. Use GetOwnerEmpire()
- uint32_t mTargetEmpireID
- cEmpirePtr mpTargetEmpire
- Owner empire. Use GetTargetEmpire() and SetTargetEmpire()
- cPlanetPtr mpSourcePlanet
- float mRewardMoney
- ResourceKey mRewardToolID
- LocalizedString field_B0
- cStarClue mStarClue
- cPlanetClue mPlanetClue
- uint32_t mStarMapIconEffectID
- int field_104
- eastl::vector<int> field_108
- eastl::vector<ResourceKey> mUnlockToolIDList
- int mFlags
- eastl::vector<int> field_134
- uint32_t mProgressEventID
- eastl::string16 mTitle
- eastl::string16 field_15C
- cSpeciesProfile* mTargetAnimalSpecies
- ResourceKey mTargetAnimalSpeciesKey
- cMissionPtr mpParentMission
- PropertyListPtr mpPropList
- int mAcceptCost
- int mToolCost
- bool field_18C
- int mGiveOnAcceptMoney
- eastl::vector<ResourceKey> mGiveOnAcceptToolIDs
- eastl::vector<ResourceKey> mGiveOnAcceptAnimalIDs
- eastl::vector<ResourceKey> mGiveOnAcceptPlantIDs
- eastl::vector<uint32_t> field_1D0
- cCommEventPtr mpGalaxyCommEvent
- cPlanetPtr mpTargetPlanet
Function documentation
void Simulator:: cMission:: SetState(MissionState state)
Changes the state of the mission.
Parameters | |
---|---|
state |
Sets mTitle
and field_15C
to an empty eastl::string. If the new state is MissionState::
cEmpire* Simulator:: cMission:: GetOwnerEmpire()
Returns the empire that created this mission.
This will return mpOwnerEmpire
, or set it to the empire of mpOwnerEmpireID
if not set.
cEmpire* Simulator:: cMission:: GetTargetEmpire()
Returns the target empire of this mission.
This will return mpTargetEmpire
, or set it to the empire of mpTargetEmpireID
if not set.
void Simulator:: cMission:: SetTargetEmpire(cEmpire* pEmpire)
Sets the target empire of this mission.
Parameters | |
---|---|
pEmpire |
MissionState Simulator:: cMission:: Update(int deltaTime) virtual
Only called when state is Active, called every frame.
Parameters | |
---|---|
deltaTime | |
Returns | New state of the mission. |
Default behaviour:
- Updates
mElapsedTimeMS
, and if it is greater than the mission max duration, fails the mission. - Calls func168h()
- Updates clocks
field_38
andfield_58
, and sends message0x38CF2FD
sometimes - If
field_18C
and player is in galaxy context, calls func1A0h()
void Simulator:: cMission:: OnMissionCompleted() virtual
Called when the mission is completed.
Default behaviour:
- If mission is a tutorial, it changes MissionManager.mTutorialMissionStates
- If mission is an adventure, advances some variable on player empire
- Unlocks (or gives?) the tools in
mUnlockToolIDList
- Unlocks (or gives?) the tool in
mRewardToolID
- Adds
mRewardMoney
to player empire money - Applies empire relationships ... more things ...
eastl::string16* Simulator:: cMission:: GetDescription(eastl::string16* dst) virtual
Returns a description for this mission, usually the description
property in the prop list.
Parameters | |
---|---|
dst | The eastl::string where the description will be stored |
uint32_t Simulator:: cMission:: GetConversationID() virtual
Returns the ID of a .cnv
conversation file used for the mission.
If the mission has a parent, it will return the conversation of the parent.
bool Simulator:: cMission:: IsTargetPlanet(cPlanetRecord* pPlanetRecord) virtual
Returns true if the given planet is the target planet of the mission, or false otherwise.
Parameters | |
---|---|
pPlanetRecord |
bool Simulator:: cMission:: TranslateToken(uint32_t tokenID,
eastl::string16& dst) virtual
Called by the space token translator, used to replace special tokens in localized texts.
Parameters | |
---|---|
tokenID | id of the token (the token is a text, this is the FNV hash) |
dst | Where the token text must be written. |
Returns | True if the token was processed, false otherwise. |
For example, it is used to provide the target planet name, target species, etc
bool Simulator:: cMission:: CreateStarClue() virtual
Chooses one nearby star where a landmark must be found, and enables the mStarClue
accordingly.
The maximum star distance is determined by the property missionLandmarkSearchRadius
bool Simulator:: cMission:: IsSourcePlanetAndEmpire(uint32_t empireId,
PlanetID planetId) virtual
Returns true if the mission is Active or Complete, and the given empire and planet are the empire and planet where the mission originated.
Parameters | |
---|---|
empireId | |
planetId |
bool Simulator:: cMission:: HasEnoughAvailableCargoSlots() virtual
Checks if the player has enough available cargo slots in the inventory to give the animals and plants of the mission (mGiveOnAcceptAnimalIDs
and mGiveOnAcceptPlantIDs
).
Returns | True if it has enough cargo slots, false otherwise. |
---|
void Simulator:: cMission:: AddMessageListeners() virtual
Adds this mission as listener to some game messages.
By default, it listens to 0x35EC3DE
, 0x248975F
, 0x2489760
, 0x4249453
bool Simulator:: cMission:: ListensToMessage(uint32_t messageId) virtual
Returns true if the mission is a listener to the given game internal message.
Parameters | |
---|---|
messageId |
void Simulator:: cMission:: ExportTargetPlanetAndSpecies() virtual
Reads properties missionExportTargetPlanetTo
and missionExportTargetSpeciesTo
.
If set, it sets the mission target planet and species id as the tutorial ones in MissionManager.
bool Simulator:: cMission:: PickTargetAnimalSpecies() virtual
Sets mTargetAnimalSpecies
and mTargetAnimalSpeciesKey
.
Returns |
---|
By default, it just picks a random creature from the planet.