@@ -247,6 +247,8 @@ class cGcPlayerState(Structure):
247247 muUnits : Annotated [int , Field (c_uint32 , 0x1BC )]
248248 muNanites : Annotated [int , Field (c_uint32 , 0x1C0 )]
249249 muSpecials : Annotated [int , Field (c_uint32 , 0x1C4 )]
250+ # Found in cGcPlayerShipOwnership::SpawnNewShip
251+ miPrimaryShip : Annotated [int , Field (c_uint32 , 0xC4F0 )]
250252
251253 @function_hook (
252254 "48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC ? 44 8B 81 ? ? ? ? 48 8D 2D"
@@ -274,9 +276,59 @@ def StoreCurrentSystemSpaceStationEndpoint(
274276 ): ...
275277
276278
279+ @partial_struct
280+ class cGcPlayerShipOwnership (Structure ):
281+ @partial_struct
282+ class sGcShipData (Structure ):
283+ _total_size_ = 0x48
284+
285+ mPlayerShipSeed : Annotated [basic .cTkSeed , 0x0 ]
286+
287+ @function_hook (
288+ "48 89 5C 24 ? 55 56 57 41 54 41 56 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 45"
289+ )
290+ def UpdateMeshRefresh (self , this : "_Pointer[cGcPlayerShipOwnership]" ): ...
291+
292+ @function_hook (
293+ "48 8B C4 55 53 56 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 80 B9 ? ? ? ? ? 48 8B F1"
294+ )
295+ def Update (
296+ self ,
297+ this : "_Pointer[cGcPlayerShipOwnership]" ,
298+ lfTimestep : Annotated [float , c_float ],
299+ ): ...
300+
301+ @function_hook ("44 89 44 24 ? 48 89 54 24 ? 55 56 41 54 41 56 41 57 48 8D 6C 24" )
302+ def SpawnNewShip (
303+ self ,
304+ this : "_Pointer[cGcPlayerShipOwnership]" ,
305+ lMatrix : _Pointer [basic .cTkMatrix34 ],
306+ leLandingGearState : c_uint32 , # cGcPlayerShipOwnership::ShipSpawnLandingGearState
307+ liShipIndex : c_int32 ,
308+ lbSpawnShipOverride : c_bool ,
309+ ) -> c_bool : ...
310+
311+ @function_hook (
312+ "48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 41 56 48 83 EC ? 48 8B 35 ? ? ? ? 8B DA"
313+ )
314+ def DestroyShip (
315+ self ,
316+ this : "_Pointer[cGcPlayerShipOwnership]" ,
317+ liShipIndex : c_int32 ,
318+ ) -> c_bool : ...
319+
320+ # Not sure about this...
321+ mShips : Annotated [list [sGcShipData ], Field (sGcShipData * 12 , 0x58 )]
322+ # Both these found at the top of cGcPlayerShipOwnership::UpdateMeshRefresh
323+ mbShouldRefreshMesh : Annotated [bool , Field (c_bool , 0xA690 )]
324+ mMeshRefreshState : Annotated [int , Field (c_uint32 , 0xA694 )]
325+
326+
277327@partial_struct
278328class cGcGameState (Structure ):
279329 mPlayerState : Annotated [cGcPlayerState , 0xA950 ]
330+ # Found in cGcGameState::Update
331+ mPlayerShipOwnership : Annotated [cGcPlayerShipOwnership , 0xA2BD0 ]
280332
281333 @function_hook ("48 89 5C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 88 54 24" )
282334 def OnSaveProgressCompleted (
@@ -292,11 +344,18 @@ def OnSaveProgressCompleted(
292344 def LoadFromPersistentStorage (
293345 self ,
294346 this : "_Pointer[cGcGameState]" ,
295- leSlot : c_uint32 ,
347+ leSlot : Annotated [ int , c_uint32 ] ,
296348 a3 : c_int32 ,
297349 lbNetworkClientLoad : Annotated [bool , c_bool ],
298350 ) -> c_uint64 : ...
299351
352+ @function_hook (
353+ "48 8B C4 48 89 58 ? 48 89 70 ? 48 89 78 ? 55 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? F3 0F 10 91"
354+ )
355+ def Update (
356+ self , this : "_Pointer[cGcGameState]" , lfTimeStep : Annotated [float , c_float ]
357+ ): ...
358+
300359
301360class cTkFSM (Structure ):
302361 @function_hook (
@@ -553,8 +612,59 @@ def Update(
553612 ): ...
554613
555614
615+ @partial_struct
616+ class cGcPlayerEnvironment (Structure ):
617+ mPlayerTM : Annotated [basic .cTkMatrix34 , Field (basic .cTkMatrix34 , 0x0 )]
618+ mUp : Annotated [basic .Vector3f , Field (basic .Vector3f , 0x40 )]
619+
620+ # Found below the call to cTkDynamicGravityControl::GetGravity in cGcPlayerEnvironment::Update
621+ miNearestPlanetIndex : Annotated [int , Field (c_uint32 , 0x2BC )]
622+ mfDistanceFromPlanet : Annotated [float , Field (c_float , 0x2C0 )]
623+ mfNearestPlanetSealevel : Annotated [float , Field (c_float , 0x2C4 )]
624+ mNearestPlanetPos : Annotated [basic .Vector3f , Field (basic .Vector3f , 0x2D0 )]
625+ mbInsidePlanetAtmosphere : Annotated [bool , Field (c_bool , 0x2EC )]
626+ meLocation : Annotated [
627+ enums .EnvironmentLocation .Enum ,
628+ Field (c_enum32 [enums .EnvironmentLocation .Enum ], 0x458 ),
629+ ]
630+ meLocationStable : Annotated [
631+ enums .EnvironmentLocation .Enum ,
632+ Field (c_enum32 [enums .EnvironmentLocation .Enum ], 0x464 ),
633+ ]
634+
635+ @function_hook ("48 83 EC ? 80 B9 ? ? ? ? ? C6 04 24" )
636+ def IsOnboardOwnFreighter (
637+ self , this : "_Pointer[cGcPlayerEnvironment]"
638+ ) -> c_bool : ...
639+
640+ @function_hook ("8B 81 ? ? ? ? 83 E8 ? 83 F8 ? 0F 96 C0 C3 48 83 EC" )
641+ def IsOnPlanet (self , this : "_Pointer[cGcPlayerEnvironment]" ) -> c_bool : ...
642+
643+ @function_hook ("48 8B C4 F3 0F 11 48 ? 55 53 41 54" )
644+ def Update (
645+ self ,
646+ this : "_Pointer[cGcPlayerEnvironment]" ,
647+ lfTimeStep : Annotated [float , c_float ],
648+ ): ...
649+
650+
651+ @partial_struct
652+ class cGcEnvironment (Structure ):
653+ # Passed into multiple cGcPlayerEnvironment methods.
654+ mPlayerEnvironment : Annotated [cGcPlayerEnvironment , 0x8A0 ]
655+
656+ @function_hook (
657+ "48 8B C4 48 89 48 ? 55 53 56 57 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 0F 29 70 ? 4C 8B E9"
658+ )
659+ def UpdateRender (self , this : "_Pointer[cGcEnvironment]" ):
660+ # TODO: There could be a few good functions to get which are called in here...
661+ ...
662+
663+
556664@partial_struct
557665class cGcSimulation (Structure ):
666+ # Found in cGcSimulation::Update. Passed into cGcEnvironment::Update.
667+ mEnvironment : Annotated [cGcEnvironment , 0xAF790 ]
558668 mPlayer : Annotated [cGcPlayer , 0x24DE40 ]
559669 # Found in cGcSimulation::Update. Passed into cGcSolarSystem::Update.
560670 mpSolarSystem : Annotated [_Pointer [cGcSolarSystem ], 0x24C670 ]
@@ -825,34 +935,6 @@ def UpdateGravityPoint(
825935]
826936
827937
828- @partial_struct
829- class cGcPlayerEnvironment (Structure ):
830- mPlayerTM : Annotated [basic .cTkMatrix34 , Field (basic .cTkMatrix34 , 0x0 )]
831- mUp : Annotated [basic .Vector3f , Field (basic .Vector3f , 0x40 )]
832-
833- # Found below the call to cTkDynamicGravityControl::GetGravity in cGcPlayerEnvironment::Update
834- miNearestPlanetIndex : Annotated [int , Field (c_uint32 , 0x2BC )]
835- mfDistanceFromPlanet : Annotated [float , Field (c_float , 0x2C0 )]
836- mfNearestPlanetSealevel : Annotated [float , Field (c_float , 0x2C4 )]
837- mNearestPlanetPos : Annotated [basic .Vector3f , Field (basic .Vector3f , 0x2D0 )]
838- mbInsidePlanetAtmosphere : Annotated [bool , Field (c_bool , 0x2EC )]
839-
840- @function_hook ("48 83 EC ? 80 B9 ? ? ? ? ? C6 04 24" )
841- def IsOnboardOwnFreighter (
842- self , this : "_Pointer[cGcPlayerEnvironment]"
843- ) -> c_bool : ...
844-
845- @function_hook ("8B 81 ? ? ? ? 83 E8 ? 83 F8 ? 0F 96 C0 C3 48 83 EC" )
846- def IsOnPlanet (self , this : "_Pointer[cGcPlayerEnvironment]" ) -> c_bool : ...
847-
848- @function_hook ("48 8B C4 F3 0F 11 48 ? 55 53 41 54" )
849- def Update (
850- self ,
851- this : "_Pointer[cGcPlayerEnvironment]" ,
852- lfTimeStep : Annotated [float , c_float ],
853- ): ...
854-
855-
856938class Engine :
857939 @static_function_hook ("40 53 48 83 EC ? 44 8B D1 44 8B C1" )
858940 @staticmethod
@@ -1096,15 +1178,6 @@ def StateChange(
10961178 ): ...
10971179
10981180
1099- class cGcEnvironment (Structure ):
1100- @function_hook (
1101- "48 8B C4 48 89 48 ? 55 53 56 57 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 0F 29 70 ? 4C 8B E9"
1102- )
1103- def UpdateRender (self , this : "_Pointer[cGcEnvironment]" ):
1104- # TODO: There could be a few good functions to get which are called in here...
1105- ...
1106-
1107-
11081181class cGcPlayerNotifications (Structure ):
11091182 @function_hook ("48 89 5C 24 ? 48 89 74 24 ? 57 48 81 EC ? ? ? ? 44 8B 81" )
11101183 def AddTimedMessage (
@@ -1236,7 +1309,15 @@ def GetPulseDriveFuelFactor(
12361309 ) -> c_float : ...
12371310
12381311
1312+ @partial_struct
12391313class cGcSpaceshipWeapons (Structure ):
1314+ # These can be found in cGcSpaceshipWeapons::GetHeatFactor and cGcSpaceshipWeapons::GetOverheatProgress
1315+ # This enum corresponds to the element in the following 3 arrays by index.
1316+ meWeaponMode : Annotated [c_enum32 [enums .cGcShipWeapons ], 0xA4 ]
1317+ mafWeaponHeat : Annotated [list [float ], Field (c_float * 7 , 0x5FA4 )]
1318+ mafWeaponOverheatTimer : Annotated [list [float ], Field (c_float * 7 , 0x5FC0 )]
1319+ mabWeaponOverheated : Annotated [list [bool ], Field (c_bool * 7 , 0x5FDC )]
1320+
12401321 @function_hook ("48 63 81 ?? ?? 00 00 80 BC 08 ?? ?? 00 00 00 74 12" )
12411322 def GetOverheatProgress (self , this : "_Pointer[cGcSpaceshipWeapons]" ) -> c_float : ...
12421323
@@ -1257,6 +1338,9 @@ def GetCurrentShootPoints(
12571338 ) -> c_uint64 : # cGcShootPoint *
12581339 ...
12591340
1341+ @function_hook ("48 63 81 ? ? ? ? F3 0F 10 84 81" )
1342+ def GetHeatFactor (self , this : "_Pointer[cGcSpaceshipWeapons]" ) -> c_float : ...
1343+
12601344
12611345class cGcPlayerCharacterComponent (Structure ):
12621346 @function_hook ("48 8B C4 55 53 56 57 41 56 48 8D 68 A1 48 81 EC 90 00 00" )
0 commit comments