1# -*-python-*-
2# GemRB - Infinity Engine Emulator
3# Copyright (C) 2014 The GemRB Project
4#
5# This program is free software; you can redistribute it and/or
6# modify it under the terms of the GNU General Public License
7# as published by the Free Software Foundation; either version 2
8# of the License, or (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18#
19#
20# GameCheck.py - functions to check GameType
21
22import GemRB
23from ie_restype import RES_WMP, RES_ARE, RES_2DA
24
25MAX_PARTY_SIZE = GemRB.GetVar ("MaxPartySize")
26
27def IsPST ():
28	return GemRB.GameType == "pst"
29
30def IsIWD ():
31	return GemRB.GameType == "iwd"
32
33def IsHOW ():
34	return GemRB.GameType == "how"
35
36def IsIWD1 ():
37	return GemRB.GameType == "iwd" or GemRB.GameType == "how"
38
39def IsIWD2 ():
40	return GemRB.GameType == "iwd2"
41
42def IsBG1 ():
43	return GemRB.GameType == "bg1"
44
45def IsBG2 ():
46	return GemRB.GameType == "bg2"
47
48def IsBG2Demo ():
49	return ('BG2Demo' in GemRB.__dict__) and (GemRB.BG2Demo == True)
50
51def IsGemRBDemo ():
52	return GemRB.GameType == "demo"
53
54def IsTOB ():
55	return GemRB.HasResource ("worldm25", RES_WMP) and GemRB.GetVar("oldgame") == 0
56
57def HasTOB ():
58	return GemRB.HasResource ("worldm25", RES_WMP)
59
60def HasHOW ():
61	return GemRB.HasResource ("expmap", RES_WMP)
62
63def HasTOTL ():
64	return GemRB.HasResource ("ar9700", RES_ARE)
65
66def HasBGT ():
67	return GemRB.HasResource ("ar7200", RES_ARE)
68
69def HasTutu ():
70	return GemRB.HasResource ("fw0125", RES_ARE)
71
72def HasTOTSC ():
73	return GemRB.HasResource ("toscst", RES_2DA)
74