Skip to content

Commit 32de907

Browse files
committed
Add LaunchProjectile() method to cArtilleryProjectile, cCulturalProjectile, cDefaultToolProjectile, cFlakProjectile, cResourceProjectile, cSpaceDefenseMissile.
1 parent 677eeec commit 32de907

File tree

8 files changed

+102
-2
lines changed

8 files changed

+102
-2
lines changed

Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@
7272
#include <Spore\Simulator\cSimulatorUniverse.h>
7373
#include <Spore\Simulator\Serialization.h>
7474
#include <Spore\Simulator\SpaceConstants.h>
75+
#include <Spore\Simulator\cArtilleryProjectile.h>
76+
#include <Spore\Simulator\cCulturalProjectile.h>
77+
#include <Spore\Simulator\cFlakProjectile.h>
78+
#include <Spore\Simulator\cResourceProjectile.h>
79+
#include <Spore\Simulator\cSpaceDefenseMissile.h>
7580
#include <Spore\Simulator\SubSystem\cRelationshipManager.h>
7681
#include <Spore\Simulator\SubSystem\GameBehaviorManager.h>
7782
#include <Spore\Simulator\SubSystem\GameInputManager.h>
@@ -976,6 +981,27 @@ namespace Simulator
976981
DefineAddress(SetObject, SelectAddress(0xAF9890, 0xAF9FB0));
977982
DefineAddress(RemoveObject, SelectAddress(0xAF9900, 0xAFA020));
978983
}
984+
985+
namespace Addresses(cArtilleryProjectile)
986+
{
987+
DefineAddress(LaunchProjectile, SelectAddress(0xCB68C0, 0xCB71C0));
988+
}
989+
namespace Addresses(cCulturalProjectile)
990+
{
991+
DefineAddress(LaunchProjectile, SelectAddress(0xCBD0A0, 0xCBDB90));
992+
}
993+
namespace Addresses(cFlakProjectile)
994+
{
995+
DefineAddress(LaunchProjectile, SelectAddress(0xCB7400, 0xCB7CF0));
996+
}
997+
namespace Addresses(cResourceProjectile)
998+
{
999+
DefineAddress(LaunchProjectile, SelectAddress(0xCBDCD0, 0xCBE7C0));
1000+
}
1001+
namespace Addresses(cSpaceDefenseMissile)
1002+
{
1003+
DefineAddress(LaunchProjectile, SelectAddress(0xCB7FD0, 0xCB88B0));
1004+
}
9791005
}
9801006

9811007
#ifdef SDK_TO_GHIDRA

Spore ModAPI/SourceCode/Simulator/SimulatorMisc.cpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
#include <Spore\Simulator\cObjectPool.h>
66
#include <Spore\Simulator\cSimulatorUniverse.h>
77
#include <Spore\Simulator\cDefaultToolProjectile.h>
8+
#include <Spore\Simulator\cArtilleryProjectile.h>
9+
#include <Spore\Simulator\cCulturalProjectile.h>
10+
#include <Spore\Simulator\cFlakProjectile.h>
11+
#include <Spore\Simulator\cResourceProjectile.h>
12+
#include <Spore\Simulator\cSpaceDefenseMissile.h>
813

914
namespace Simulator
1015
{
@@ -72,5 +77,33 @@ namespace Simulator
7277
auto_STATIC_METHOD_VOID(Simulator, LaunchDefaultToolProjectile,
7378
Args(cSpaceToolData* tool, cDefaultToolProjectile* projectile, const Math::Vector3& origin, const Math::Vector3& target),
7479
Args(tool, projectile, origin, target));
80+
81+
82+
//// cArtilleryProjectile ////
83+
84+
auto_METHOD_VOID(cArtilleryProjectile, LaunchProjectile, Args(const Math::Vector3& target), Args(target));
85+
86+
87+
//// cCulturalProjectile ////
88+
89+
auto_METHOD_VOID(cCulturalProjectile, LaunchProjectile,
90+
Args(cGameData* owner, cVehicle* vehicle, cSpaceToolData* tool, cCombatant* target, const Math::Vector3& unk0, float unk1, bool unk2, bool spin),
91+
Args(owner, vehicle, tool, target, unk0, unk1, unk2, spin));
92+
93+
94+
//// cFlakProjectile ////
95+
96+
auto_METHOD_VOID(cFlakProjectile, LaunchProjectile, Args(const Math::Vector3& target, float arg), Args(target, arg));
97+
98+
99+
//// cResourceProjectile ////
100+
101+
auto_METHOD_VOID(cResourceProjectile, LaunchProjectile,
102+
Args(cCivilization* civilization, cCommodityNode* commodityNode, const Math::Vector3& arg0, float speed, bool arg1),
103+
Args(civilization, commodityNode, arg0, speed, arg1));
104+
105+
//// cSpaceDefenseMissile ////
106+
107+
auto_METHOD_VOID(cSpaceDefenseMissile, LaunchProjectile, Args(const Math::Vector3& target, cCombatant* arg), Args(target, arg));
75108
}
76109
#endif

Spore ModAPI/Spore/Simulator/cArtilleryProjectile.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ namespace Simulator
2323
using Object::Release;
2424
using Object::Cast;
2525

26+
/// Creates a `cBallisticLocomotion` locomotion strategy to start launching this projectile.
27+
/// @param target
28+
void LaunchProjectile(const Math::Vector3& target);
29+
2630
public:
2731
/* 518h */ Math::Vector3 mLastPosition;
2832
/* 524h */ cCombatantPtr mpOwner;
@@ -32,4 +36,9 @@ namespace Simulator
3236
/* 534h */ cSpaceToolDataPtr mTool;
3337
};
3438
ASSERT_SIZE(cArtilleryProjectile, 0x538);
39+
40+
namespace Addresses(cArtilleryProjectile)
41+
{
42+
DeclareAddress(LaunchProjectile); // 0xCB68C0 0xCB71C0
43+
}
3544
}

Spore ModAPI/Spore/Simulator/cCulturalProjectile.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ namespace Simulator
2323
using Object::Release;
2424
using Object::Cast;
2525

26+
void LaunchProjectile(cGameData* owner, cVehicle* vehicle, cSpaceToolData* tool, cCombatant* target, const Math::Vector3&, float, bool, bool spin);
27+
2628
public:
2729
/* 518h */ int field_518;
2830
/* 51Ch */ cVehiclePtr mpVehicle;
@@ -37,4 +39,9 @@ namespace Simulator
3739
/* 568h */ cGonzagoTimer field_568;
3840
};
3941
ASSERT_SIZE(cCulturalProjectile, 0x588);
42+
43+
namespace Addresses(cCulturalProjectile)
44+
{
45+
DeclareAddress(LaunchProjectile); // 0xCBD0A0 0xCBDB90
46+
}
4047
}

Spore ModAPI/Spore/Simulator/cDefaultToolProjectile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ namespace Simulator
6969
ASSERT_SIZE(cDefaultToolProjectile, 0x5F0);
7070

7171
/// Launches a projectile using the configuration of the specified tool.
72-
/// Example code to shoot 200 meters in front of your UFO:
72+
/// Example code to shoot 50 meters in front of your UFO:
7373
/// ```cpp
7474
/// auto playerPosition = SimulatorPlayerUFO.GetUFO()->GetPosition();
7575
/// auto target = playerPosition + 50 * SimulatorPlayerUFO.GetUFO()->GetDirection();

Spore ModAPI/Spore/Simulator/cFlakProjectile.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,16 @@ namespace Simulator
2121
using Object::Release;
2222
using Object::Cast;
2323

24+
void LaunchProjectile(const Math::Vector3&, float);
25+
2426
public:
2527
/* 518h */ int field_518;
2628
/* 51Ch */ float field_51C;
2729
};
2830
ASSERT_SIZE(cFlakProjectile, 0x520);
31+
32+
namespace Addresses(cFlakProjectile)
33+
{
34+
DeclareAddress(LaunchProjectile); // 0xCB7400 0xCB7CF0
35+
}
2936
}

Spore ModAPI/Spore/Simulator/cResourceProjectile.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <Spore\Simulator\cCommodityNode.h>
66
#include <Spore\Simulator\cProjectile.h>
77
#include <Spore\Simulator\cGonzagoTimer.h>
8+
#include <Spore\Simulator\cCivilization.h>
89

910
#define cResourceProjectilePtr eastl::intrusive_ptr<Simulator::cResourceProjectile>
1011

@@ -24,6 +25,8 @@ namespace Simulator
2425
using Object::Release;
2526
using Object::Cast;
2627

28+
void LaunchProjectile(cCivilization* civilization, cCommodityNode* commodityNode, const Math::Vector3&, float speed, bool);
29+
2730
public:
2831
/* 514h */ bool field_514;
2932
/* 518h */ int field_518;
@@ -36,4 +39,9 @@ namespace Simulator
3639
/* 554h */ bool field_554;
3740
};
3841
ASSERT_SIZE(cResourceProjectile, 0x558);
42+
43+
namespace Addresses(cResourceProjectile)
44+
{
45+
DeclareAddress(LaunchProjectile); // 0xCBDCD0 0xCBE7C0
46+
}
3947
}

Spore ModAPI/Spore/Simulator/cSpaceDefenseMissile.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,21 @@ namespace Simulator
2323
using Object::Release;
2424
using Object::Cast;
2525

26+
/// Creates a `cSpaceDefenseMissileLocomotion` to launch this projectile.
27+
/// @param target
28+
/// @param source
29+
void LaunchProjectile(const Math::Vector3& target, cCombatant* source);
30+
2631
public:
2732
/* 5E0h */ int field_5E0;
28-
/* 5E4h */ int field_5E4;
33+
/* 5E4h */ cCombatantPtr mpSource;
2934
/* 5E8h */ cGonzagoTimer field_5E8;
3035
/* 608h */ int field_608;
3136
};
3237
ASSERT_SIZE(cSpaceDefenseMissile, 0x610);
38+
39+
namespace Addresses(cSpaceDefenseMissile)
40+
{
41+
DeclareAddress(LaunchProjectile); // 0xCB7FD0 0xCB88B0
42+
}
3343
}

0 commit comments

Comments
 (0)