Skip to content

Commit 6108aaf

Browse files
committed
Merge branch 'master' of github.com:emd4600/Spore-ModAPI
2 parents 0acade8 + 596c6aa commit 6108aaf

File tree

5 files changed

+50
-2
lines changed

5 files changed

+50
-2
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
$count = git log --oneline | wc -l
2727
echo "Building version $count"
2828
msbuild "Spore ModAPI" -t:BuildDlls -p:BuildVer=$count -p:Config=Release
29+
msbuild "Spore ModAPI" -t:BuildCombinedDll -p:BuildVer=$count -p:Config=Release
2930
3031
- name: Upload compiled files
3132
uses: actions/upload-artifact@v3.1.3
@@ -34,6 +35,7 @@ jobs:
3435
path: |
3536
dll\Release\SporeModAPI.march2017.dll
3637
dll\Release\SporeModAPI.disk.dll
38+
dll\Release\SporeModAPI.combined.dll
3739
dll\Release\SporeModAPI.lib
3840
3941
deploy:
@@ -47,7 +49,7 @@ jobs:
4749
name: compiled-modapi-dlls
4850

4951
- name: Create update bundle
50-
run: zip SporeModAPIdlls.zip SporeModAPI.march2017.dll SporeModAPI.disk.dll SporeModAPI.lib
52+
run: zip SporeModAPIdlls.zip SporeModAPI.march2017.dll SporeModAPI.disk.dll SporeModAPI.combined.dll SporeModAPI.lib
5153

5254
# - name: Upload dlls bundle
5355
# uses: actions/upload-artifact@v3.1.3

Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,13 @@ namespace Simulator
796796
DefineAddress(Initialize, SelectAddress(0xF1F450, 0xF1F060));
797797
DefineAddress(SetCurrentAct, SelectAddress(0xF1F260, 0xF1EE70));
798798
DefineAddress(JumpToAct, SelectAddress(0xF1F7B0, 0xF1F3C0));
799+
DefineAddress(SetState, SelectAddress(0xF1ADB0, 0xF1A9C0));
800+
DefineAddress(UpdateGoals, SelectAddress(0xF1C780, 0xF1C390));
801+
DefineAddress(Update, SelectAddress(0xF1FD50, 0xF1F960));
802+
DefineAddress(CompleteAct, SelectAddress(0xF1F680, 0xF1F290));
803+
DefineAddress(CheckGoalProgress, SelectAddress(0xF1F8D0, 0xF1F4E0));
804+
DefineAddress(RemoveInvisibleClasses, SelectAddress(0xF1AFD0, 0xF1ABE0));
805+
DefineAddress(ReadScenarioTuning, SelectAddress(0xF1E2F0, 0xF1DF00));
799806
}
800807

801808
namespace Addresses(cPlanetRecord)

Spore ModAPI/SourceCode/Simulator/Scenario.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,12 @@ namespace Simulator
7474
auto_METHOD_VOID(cScenarioPlayMode, SetCurrentAct, Args(int index, bool arg), Args(index, arg));
7575
auto_METHOD_VOID(cScenarioPlayMode, JumpToAct, Args(int actIndex), Args(actIndex));
7676
auto_METHOD_VOID_(cScenarioPlayMode, Initialize);
77+
auto_METHOD_VOID(cScenarioPlayMode, SetState, Args(ScenarioPlayModeState state), Args(state));
78+
auto_METHOD_(cScenarioPlayMode, bool, UpdateGoals);
79+
auto_METHOD_VOID(cScenarioPlayMode, Update, Args(int deltaTime), Args(deltaTime));
80+
auto_METHOD_VOID_(cScenarioPlayMode, CompleteAct);
81+
auto_METHOD_VOID_(cScenarioPlayMode, CheckGoalProgress);
82+
auto_STATIC_METHOD_VOID_(cScenarioPlayMode, RemoveInvisibleClasses);
83+
auto_STATIC_METHOD_VOID_(cScenarioPlayMode, ReadScenarioTuning);
7784
}
7885
#endif

Spore ModAPI/Spore ModAPI.vcxproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,4 +1088,9 @@
10881088
<Exec Command="msbuild.exe /p:Configuration=&quot;$(Config) DLL&quot; /p:Platform=Win32 /p:SDK_BUILD_VER=$(BuildVer) /p:EXECUTABLE_TYPE=0" />
10891089
<Copy SourceFiles="../dll/$(Config)/SporeModAPI.dll" DestinationFiles="../dll/$(Config)/SporeModAPI.disk.dll" />
10901090
</Target>
1091+
<Target Name="BuildCombinedDll">
1092+
<Message Text="Compiling $(Config) DLL, build $(BuildVer)..." />
1093+
<Exec Command="msbuild.exe /p:Configuration=&quot;$(Config) DLL&quot; /p:Platform=Win32 /p:SDK_BUILD_VER=$(BuildVer) /p:EXECUTABLE_TYPE=10" />
1094+
<Copy SourceFiles="../dll/$(Config)/SporeModAPI.dll" DestinationFiles="../dll/$(Config)/SporeModAPI.combined.dll" />
1095+
</Target>
10911096
</Project>

Spore ModAPI/Spore/Simulator/cScenarioPlayMode.h

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,28 @@ namespace Simulator
5656
public:
5757
//TODO check sub_F1EFC0
5858

59+
/// Called when starting the adventure in Play Mode.
5960
void Initialize();
61+
/// Sets the current act index of the active adventure.
6062
void SetCurrentAct(int actIndex, bool = false);
63+
/// Skips the adventure up to the given act index. Also works in reverse, i. e. going back to previous acts in the adventure.
64+
/// Using the same index as the current act will reset the adventure to the beginning of said act.
6165
void JumpToAct(int actIndex);
66+
/// Sets the active state of the adventure.
67+
void SetState(ScenarioPlayModeState state);
68+
/// Updates the current, active goals of the adventure.
69+
bool UpdateGoals();
70+
/// Update function of the adventure.
71+
void Update(int deltaTime);
72+
/// Completes the act, then moves the adventure into the next act. If in the last act, the adventure completes.
73+
void CompleteAct();
74+
/// Called by Update(). Checks if the current goals are clearable or not.
75+
void CheckGoalProgress();
76+
77+
/// Removes objects that are supposed to be invisible during the current act.
78+
static void RemoveInvisibleClasses();
79+
static void ReadScenarioTuning();
80+
6281

6382
public:
6483
/* 0Ch */ cScenarioPlaySummary mSummary;
@@ -111,7 +130,15 @@ namespace Simulator
111130
namespace Addresses(cScenarioPlayMode)
112131
{
113132
DeclareAddress(Initialize); // 0xF1F450, 0xF1F060
114-
DeclareAddress(SetCurrentAct); // 0xF1F260, 0xF1EE70
133+
DeclareAddress(SetCurrentAct); // 0xF1F260, 0xF1EE70
115134
DeclareAddress(JumpToAct); // 0xF1F7B0, 0xF1F3C0
135+
DeclareAddress(SetState); // 0xF1ADB0, 0xF1A9C0
136+
DeclareAddress(UpdateGoals); // 0xF1C780, 0xF1C390
137+
DeclareAddress(Update); // 0xF1FD50, 0xF1F960
138+
DeclareAddress(CompleteAct); // 0xF1F680, 0xF1F290
139+
DeclareAddress(CheckGoalProgress); // 0xF1F8D0, 0xF1F4E0
140+
141+
DeclareAddress(RemoveInvisibleClasses); // 0xF1AFD0, 0xF1ABE0
142+
DeclareAddress(ReadScenarioTuning); // 0xF1E2F0, 0xF1DF00
116143
}
117144
}

0 commit comments

Comments
 (0)