Skip to content

Commit 4cc26c2

Browse files
committed
Version fix and add another function relating to spaceship heat factor
1 parent 863720b commit 4cc26c2

File tree

5 files changed

+28
-13
lines changed

5 files changed

+28
-13
lines changed

nmspy/data/enums/internal_enums.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class eLanguageRegion(IntEnum):
7979
Korean = 0x10
8080

8181

82-
class EnvironmentLocation():
82+
class EnvironmentLocation:
8383
class Enum(IntEnum):
8484
None_ = 0x0
8585
Default = 0x1

nmspy/data/types.py

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ def StoreCurrentSystemSpaceStationEndpoint(
278278

279279
@partial_struct
280280
class cGcPlayerShipOwnership(Structure):
281-
282281
@partial_struct
283282
class sGcShipData(Structure):
284283
_total_size_ = 0x48
@@ -307,16 +306,16 @@ def SpawnNewShip(
307306
leLandingGearState: c_uint32, # cGcPlayerShipOwnership::ShipSpawnLandingGearState
308307
liShipIndex: c_int32,
309308
lbSpawnShipOverride: c_bool,
310-
) -> c_bool:
311-
...
312-
313-
@function_hook("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")
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+
)
314314
def DestroyShip(
315315
self,
316316
this: "_Pointer[cGcPlayerShipOwnership]",
317317
liShipIndex: c_int32,
318-
) -> c_bool:
319-
...
318+
) -> c_bool: ...
320319

321320
# Not sure about this...
322321
mShips: Annotated[list[sGcShipData], Field(sGcShipData * 12, 0x58)]
@@ -328,7 +327,7 @@ def DestroyShip(
328327
@partial_struct
329328
class cGcGameState(Structure):
330329
mPlayerState: Annotated[cGcPlayerState, 0xA950]
331-
# Found in cGcGameState:: Update
330+
# Found in cGcGameState::Update
332331
mPlayerShipOwnership: Annotated[cGcPlayerShipOwnership, 0xA2BD0]
333332

334333
@function_hook("48 89 5C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 88 54 24")
@@ -626,11 +625,11 @@ class cGcPlayerEnvironment(Structure):
626625
mbInsidePlanetAtmosphere: Annotated[bool, Field(c_bool, 0x2EC)]
627626
meLocation: Annotated[
628627
enums.EnvironmentLocation.Enum,
629-
Field(c_enum32[enums.EnvironmentLocation.Enum], 0x458)
628+
Field(c_enum32[enums.EnvironmentLocation.Enum], 0x458),
630629
]
631630
meLocationStable: Annotated[
632631
enums.EnvironmentLocation.Enum,
633-
Field(c_enum32[enums.EnvironmentLocation.Enum], 0x464)
632+
Field(c_enum32[enums.EnvironmentLocation.Enum], 0x464),
634633
]
635634

636635
@function_hook("48 83 EC ? 80 B9 ? ? ? ? ? C6 04 24")
@@ -1310,7 +1309,15 @@ def GetPulseDriveFuelFactor(
13101309
) -> c_float: ...
13111310

13121311

1312+
@partial_struct
13131313
class 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+
13141321
@function_hook("48 63 81 ?? ?? 00 00 80 BC 08 ?? ?? 00 00 00 74 12")
13151322
def GetOverheatProgress(self, this: "_Pointer[cGcSpaceshipWeapons]") -> c_float: ...
13161323

@@ -1331,6 +1338,9 @@ def GetCurrentShootPoints(
13311338
) -> c_uint64: # cGcShootPoint *
13321339
...
13331340

1341+
@function_hook("48 63 81 ? ? ? ? F3 0F 10 84 81")
1342+
def GetHeatFactor(self, this: "_Pointer[cGcSpaceshipWeapons]") -> c_float: ...
1343+
13341344

13351345
class cGcPlayerCharacterComponent(Structure):
13361346
@function_hook("48 8B C4 55 53 56 57 41 56 48 8D 68 A1 48 81 EC 90 00 00")

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ classifiers = [
2626
dependencies = [
2727
"pymhf[gui]>=0.2.1"
2828
]
29-
version = "155759.0"
29+
version = "155983.0"
3030

3131
[dependency-groups]
3232
dev = [

tools/data.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,5 +768,10 @@
768768
"name": "cGcPlayerShipOwnership::DestroyShip",
769769
"signature": "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",
770770
"mangled_name": "?DestroyShip@cGcPlayerShipOwnership@@QEAA_NH@Z"
771+
},
772+
{
773+
"name": "cGcSpaceshipWeapons::GetHeatFactor",
774+
"signature": "48 63 81 ? ? ? ? F3 0F 10 84 81",
775+
"mangled_name": "?GetHeatFactor@cGcSpaceshipWeapons@@UEBAMXZ"
771776
}
772777
]

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)