giants-maps-gui/lib/constants.py

126 lines
3.1 KiB
Python
Raw Normal View History

2021-12-23 00:25:10 +01:00
class AppGUID:
Release = b"\x10\x5e\x62\xa7\x96\x1a\xd2\x11\x9a\xfc\x00\x60\x08\x45\xe5\x71"
Beta = b'j\xfbF/Le\xedJ\x8c\x0b\x06@\x14f\x9b\xfd'
class MapID:
ID = {
"MvM_L1": 19,
"MvM_L2": 20,
"MvM_L3": 21,
"RvR_L1": 22,
"RvR_L2": 23,
"RvR_L3": 24,
"3W_L1": 25,
"3W_L2": 26,
"3W_L3": 27,
"MvM_LW1": 28,
"RvR_LW1": 29,
"3W_LW1": 30,
"MvM_L6": 31,
}
@staticmethod
def get_id(name):
if name in MapID.ID:
return MapID.ID[name]
else:
return 0xFF
@staticmethod
def get_name(map_id):
for _map_name in MapID.ID:
_map_id = MapID.ID[_map_name]
if _map_id == map_id:
return _map_name
return None
class Teams:
@staticmethod
def get_name_by_id(team_id):
for prop in Teams.__dict__:
if Teams.__dict__[prop] == team_id:
return prop
return "Unknown"
@staticmethod
def get_groupid_by_team_id(_id, teams):
print("get_groupid_by_team_id: %s %s" % (_id, teams))
if teams == Teams.MvK:
if _id == 1:
return 2
if _id == 2:
return 1
if teams == Teams.MvMvM or teams == Teams.MvM:
return 2
if teams == Teams.RvR:
return 3
if teams == Teams.MvR:
if _id == 1:
return 2
if _id == 2:
return 3
if teams == Teams.MvRvK:
if _id == 1:
return 2
if _id == 2:
return 3
if _id == 3:
return 1
if teams == Teams.RvK:
if _id == 1:
return 3
if _id == 2:
return 1
return 0
MvM = 0x00
MvMvM = 0x01
RvR = 0x02
MvR = 0x03
MvRvK = 0x04
MvK = 0x05
RvK = 0x06
TeamB = 0x07
TeamB = 0x08
TeamB = 0x0c
TeamB = 0x10
class GameTypes:
@staticmethod
def get_name_by_id(gametype_id):
for prop in GameTypes.__dict__:
if GameTypes.__dict__[prop] == gametype_id:
return prop
return "Unknown"
# 00: Team Deathmatch
# 01: Team Deathmatch with full base
# 02: Capture Smartie
# 03: Capture Smartie with full base
# 04: Base Build Deathmatch
# 05: Base Build and Capture the Smartie
# 06: Defend Base
# 07: Defend Base and Capture the Smartie
# 08: GTypeStone
# 09: GTypeWood
# 0a: crash to desktop
# 0b: crash to desktop
# 0c: GType(null)
# 0d: crash to desktop
# 0e: crash to desktop
# 0f: crash to desktop
# 10: crash to desktop
# aa: crash to desktop
# ff: crash to desktop
TeamDeathmatch = 0x00
TeamDeathmatchWithFullBase = 0x01
CaptureSmartie = 0x02
CaptureSmartieWithFullBase = 0x03
BaseBuildDeathmatch = 0x04
BaseBuildCaptureSmartie = 0x05
DefendBase = 0x06
DefendBaseCaptureSmartie = 0x07
GTypeStone = 0x08
GTypeWood = 0x09
Crash = 0x0a
GTypeNull = 0x0c