diff --git a/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp b/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp index ecaee90c..818b1cd8 100644 --- a/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp +++ b/Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp @@ -72,6 +72,11 @@ #include #include #include +#include +#include +#include +#include +#include #include #include #include @@ -976,6 +981,27 @@ namespace Simulator DefineAddress(SetObject, SelectAddress(0xAF9890, 0xAF9FB0)); DefineAddress(RemoveObject, SelectAddress(0xAF9900, 0xAFA020)); } + + namespace Addresses(cArtilleryProjectile) + { + DefineAddress(LaunchProjectile, SelectAddress(0xCB68C0, 0xCB71C0)); + } + namespace Addresses(cCulturalProjectile) + { + DefineAddress(LaunchProjectile, SelectAddress(0xCBD0A0, 0xCBDB90)); + } + namespace Addresses(cFlakProjectile) + { + DefineAddress(LaunchProjectile, SelectAddress(0xCB7400, 0xCB7CF0)); + } + namespace Addresses(cResourceProjectile) + { + DefineAddress(LaunchProjectile, SelectAddress(0xCBDCD0, 0xCBE7C0)); + } + namespace Addresses(cSpaceDefenseMissile) + { + DefineAddress(LaunchProjectile, SelectAddress(0xCB7FD0, 0xCB88B0)); + } } #ifdef SDK_TO_GHIDRA diff --git a/Spore ModAPI/SourceCode/Simulator/SimulatorMisc.cpp b/Spore ModAPI/SourceCode/Simulator/SimulatorMisc.cpp index 92098e9d..cdc94ed6 100644 --- a/Spore ModAPI/SourceCode/Simulator/SimulatorMisc.cpp +++ b/Spore ModAPI/SourceCode/Simulator/SimulatorMisc.cpp @@ -5,6 +5,11 @@ #include #include #include +#include +#include +#include +#include +#include namespace Simulator { @@ -72,5 +77,33 @@ namespace Simulator auto_STATIC_METHOD_VOID(Simulator, LaunchDefaultToolProjectile, Args(cSpaceToolData* tool, cDefaultToolProjectile* projectile, const Math::Vector3& origin, const Math::Vector3& target), Args(tool, projectile, origin, target)); + + + //// cArtilleryProjectile //// + + auto_METHOD_VOID(cArtilleryProjectile, LaunchProjectile, Args(const Math::Vector3& target), Args(target)); + + + //// cCulturalProjectile //// + + auto_METHOD_VOID(cCulturalProjectile, LaunchProjectile, + Args(cGameData* owner, cVehicle* vehicle, cSpaceToolData* tool, cCombatant* target, const Math::Vector3& unk0, float unk1, bool unk2, bool spin), + Args(owner, vehicle, tool, target, unk0, unk1, unk2, spin)); + + + //// cFlakProjectile //// + + auto_METHOD_VOID(cFlakProjectile, LaunchProjectile, Args(const Math::Vector3& target, float arg), Args(target, arg)); + + + //// cResourceProjectile //// + + auto_METHOD_VOID(cResourceProjectile, LaunchProjectile, + Args(cCivilization* civilization, cCommodityNode* commodityNode, const Math::Vector3& arg0, float speed, bool arg1), + Args(civilization, commodityNode, arg0, speed, arg1)); + + //// cSpaceDefenseMissile //// + + auto_METHOD_VOID(cSpaceDefenseMissile, LaunchProjectile, Args(const Math::Vector3& target, cCombatant* arg), Args(target, arg)); } #endif \ No newline at end of file diff --git a/Spore ModAPI/Spore/Simulator/cArtilleryProjectile.h b/Spore ModAPI/Spore/Simulator/cArtilleryProjectile.h index 6ec779cb..790fcd8e 100644 --- a/Spore ModAPI/Spore/Simulator/cArtilleryProjectile.h +++ b/Spore ModAPI/Spore/Simulator/cArtilleryProjectile.h @@ -23,6 +23,10 @@ namespace Simulator using Object::Release; using Object::Cast; + /// Creates a `cBallisticLocomotion` locomotion strategy to start launching this projectile. + /// @param target + void LaunchProjectile(const Math::Vector3& target); + public: /* 518h */ Math::Vector3 mLastPosition; /* 524h */ cCombatantPtr mpOwner; @@ -32,4 +36,9 @@ namespace Simulator /* 534h */ cSpaceToolDataPtr mTool; }; ASSERT_SIZE(cArtilleryProjectile, 0x538); + + namespace Addresses(cArtilleryProjectile) + { + DeclareAddress(LaunchProjectile); // 0xCB68C0 0xCB71C0 + } } \ No newline at end of file diff --git a/Spore ModAPI/Spore/Simulator/cCulturalProjectile.h b/Spore ModAPI/Spore/Simulator/cCulturalProjectile.h index 5e2d754c..c5ebb73e 100644 --- a/Spore ModAPI/Spore/Simulator/cCulturalProjectile.h +++ b/Spore ModAPI/Spore/Simulator/cCulturalProjectile.h @@ -23,6 +23,8 @@ namespace Simulator using Object::Release; using Object::Cast; + void LaunchProjectile(cGameData* owner, cVehicle* vehicle, cSpaceToolData* tool, cCombatant* target, const Math::Vector3&, float, bool, bool spin); + public: /* 518h */ int field_518; /* 51Ch */ cVehiclePtr mpVehicle; @@ -37,4 +39,9 @@ namespace Simulator /* 568h */ cGonzagoTimer field_568; }; ASSERT_SIZE(cCulturalProjectile, 0x588); + + namespace Addresses(cCulturalProjectile) + { + DeclareAddress(LaunchProjectile); // 0xCBD0A0 0xCBDB90 + } } \ No newline at end of file diff --git a/Spore ModAPI/Spore/Simulator/cDefaultToolProjectile.h b/Spore ModAPI/Spore/Simulator/cDefaultToolProjectile.h index e7d2b195..ded2447f 100644 --- a/Spore ModAPI/Spore/Simulator/cDefaultToolProjectile.h +++ b/Spore ModAPI/Spore/Simulator/cDefaultToolProjectile.h @@ -69,7 +69,7 @@ namespace Simulator ASSERT_SIZE(cDefaultToolProjectile, 0x5F0); /// Launches a projectile using the configuration of the specified tool. - /// Example code to shoot 200 meters in front of your UFO: + /// Example code to shoot 50 meters in front of your UFO: /// ```cpp /// auto playerPosition = SimulatorPlayerUFO.GetUFO()->GetPosition(); /// auto target = playerPosition + 50 * SimulatorPlayerUFO.GetUFO()->GetDirection(); diff --git a/Spore ModAPI/Spore/Simulator/cFlakProjectile.h b/Spore ModAPI/Spore/Simulator/cFlakProjectile.h index 15f3044a..8cdc3b08 100644 --- a/Spore ModAPI/Spore/Simulator/cFlakProjectile.h +++ b/Spore ModAPI/Spore/Simulator/cFlakProjectile.h @@ -21,9 +21,16 @@ namespace Simulator using Object::Release; using Object::Cast; + void LaunchProjectile(const Math::Vector3&, float); + public: /* 518h */ int field_518; /* 51Ch */ float field_51C; }; ASSERT_SIZE(cFlakProjectile, 0x520); + + namespace Addresses(cFlakProjectile) + { + DeclareAddress(LaunchProjectile); // 0xCB7400 0xCB7CF0 + } } \ No newline at end of file diff --git a/Spore ModAPI/Spore/Simulator/cResourceProjectile.h b/Spore ModAPI/Spore/Simulator/cResourceProjectile.h index 06cd4d7f..8766cbe4 100644 --- a/Spore ModAPI/Spore/Simulator/cResourceProjectile.h +++ b/Spore ModAPI/Spore/Simulator/cResourceProjectile.h @@ -5,6 +5,7 @@ #include #include #include +#include #define cResourceProjectilePtr eastl::intrusive_ptr @@ -24,6 +25,8 @@ namespace Simulator using Object::Release; using Object::Cast; + void LaunchProjectile(cCivilization* civilization, cCommodityNode* commodityNode, const Math::Vector3&, float speed, bool); + public: /* 514h */ bool field_514; /* 518h */ int field_518; @@ -36,4 +39,9 @@ namespace Simulator /* 554h */ bool field_554; }; ASSERT_SIZE(cResourceProjectile, 0x558); + + namespace Addresses(cResourceProjectile) + { + DeclareAddress(LaunchProjectile); // 0xCBDCD0 0xCBE7C0 + } } \ No newline at end of file diff --git a/Spore ModAPI/Spore/Simulator/cSpaceDefenseMissile.h b/Spore ModAPI/Spore/Simulator/cSpaceDefenseMissile.h index 76152007..324ecb33 100644 --- a/Spore ModAPI/Spore/Simulator/cSpaceDefenseMissile.h +++ b/Spore ModAPI/Spore/Simulator/cSpaceDefenseMissile.h @@ -23,11 +23,21 @@ namespace Simulator using Object::Release; using Object::Cast; + /// Creates a `cSpaceDefenseMissileLocomotion` to launch this projectile. + /// @param target + /// @param source + void LaunchProjectile(const Math::Vector3& target, cCombatant* source); + public: /* 5E0h */ int field_5E0; - /* 5E4h */ int field_5E4; + /* 5E4h */ cCombatantPtr mpSource; /* 5E8h */ cGonzagoTimer field_5E8; /* 608h */ int field_608; }; ASSERT_SIZE(cSpaceDefenseMissile, 0x610); + + namespace Addresses(cSpaceDefenseMissile) + { + DeclareAddress(LaunchProjectile); // 0xCB7FD0 0xCB88B0 + } } \ No newline at end of file