1 //**************************************************************************
3 //** ## ## ## ## ## #### #### ### ###
4 //** ## ## ## ## ## ## ## ## ## ## #### ####
5 //** ## ## ## ## ## ## ## ## ## ## ## ## ## ##
6 //** ## ## ######## ## ## ## ## ## ## ## ### ##
7 //** ### ## ## ### ## ## ## ## ## ##
8 //** # ## ## # #### #### ## ##
10 //** Copyright (C) 1999-2006 Jānis Legzdiņš
11 //** Copyright (C) 2018-2023 Ketmar Dark
13 //** This program is free software: you can redistribute it and/or modify
14 //** it under the terms of the GNU General Public License as published by
15 //** the Free Software Foundation, version 3 of the License ONLY.
17 //** This program is distributed in the hope that it will be useful,
18 //** but WITHOUT ANY WARRANTY; without even the implied warranty of
19 //** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 //** GNU General Public License for more details.
22 //** You should have received a copy of the GNU General Public License
23 //** along with this program. If not, see <http://www.gnu.org/licenses/>.
25 //**************************************************************************
26 #ifndef VAVOOM_MAPINFO_HEADER
27 #define VAVOOM_MAPINFO_HEADER
30 struct VMapSpecialAction
{
31 VName TypeName
; // class name
32 vint32 Special
; // negative means "need to translate it"
38 VStr Name
; // name of map
39 vint32 LevelNum
; // level number for action specials
40 vint32 Cluster
; // defines what cluster level belongs to
41 vint32 WarpTrans
; // actual map number in case maps are not sequential
42 VName NextMap
; // map to teleport to upon exit of timed deathmatch
43 VName SecretMap
; // map to teleport upon secret exit
44 VName SongLump
; // background music (MUS or MIDI)
45 vint32 Sky1Texture
; // default sky texture
46 vint32 Sky2Texture
; // alternate sky displayed in Sky2 sectors
47 float Sky1ScrollDelta
; // default sky texture speed
48 float Sky2ScrollDelta
; // alternate sky texture speed
49 VName SkyBox
; // sky box
50 VName FadeTable
; // fade table {fogmap}
53 float Gravity
; // map gravity
54 float AirControl
; // air control in this map.
55 vuint32 Flags
; // for values, see `VLevelInfo::LIF_XXX`
56 vuint32 Flags2
; // for values, see `VLevelInfo::LIF2_XXX`
57 VName EnterTitlePatch
;
58 VName ExitTitlePatch
; // if empty, `EnterTitlePatch` will be used
64 TArray
<VMapSpecialAction
> SpecialActions
;
70 vint32 MapinfoSourceLump
;
71 vint32 FakeContrast
; // 0: default; 1: smooth; 2: disabled (even)
72 // exit texts will override cluster exit texts
75 VName InterBackdrop
; // used when we have exit test, set in umapinfo parser
77 VStr
GetName () const;
78 void dump (const char *msg
=nullptr) const;
83 CLUSTERF_EnterTextIsLump
= 0x02,
84 CLUSTERF_ExitTextIsLump
= 0x04,
85 CLUSTERF_FinalePic
= 0x80,
86 CLUSTERF_LookupEnterText
= 0x10,
87 CLUSTERF_LookupExitText
= 0x20,
98 inline VClusterDef () noexcept
107 inline void reset () noexcept
{
118 EPISODEF_LookupText
= 0x0001,
119 EPISODEF_NoSkillMenu
= 0x0002,
120 EPISODEF_Optional
= 0x0004,
130 vint32 MapinfoSourceLump
;
134 SKILLF_FastMonsters
= 0x00000001,
135 SKILLF_DisableCheats
= 0x00000002,
136 SKILLF_EasyBossBrain
= 0x00000004,
137 SKILLF_AutoUseHealth
= 0x00000008,
138 SKILLF_MenuNameIsPic
= 0x00000010,
139 SKILLF_MustConfirm
= 0x00000020,
140 SKILLF_SlowMonsters
= 0x00000040,
141 SKILLF_SpawnMulti
= 0x00000080,
144 struct VSkillPlayerClassName
{
149 // both must be at least `EntityEx`, and compatible
150 struct VSkillMonsterReplacement
{
158 float DoubleAmmoFactor
;
162 float Aggressiveness
;
168 TArray
<VSkillPlayerClassName
> PlayerClassNames
;
169 VStr ConfirmationText
;
173 // monster replacements for each skill
174 // WARNING! currently it works only for predefined map spawns!
175 TArray
<VSkillMonsterReplacement
> Replacements
;
180 void ShutdownMapInfo ();
181 const VMapInfo
&P_GetMapInfo (VName
);
182 VStr
P_GetMapName (int);
183 VName
P_GetMapLumpName (int);
184 int P_GetMapIndexByLevelNum (int);
185 VName
P_TranslateMap (int);
186 VName
P_TranslateMapEx (int); // returns `NAME_None` if not found
187 VName
P_GetMapLumpNameByLevelNum (int);
188 void P_PutMapSongLump (int, VName
);
189 const VClusterDef
*P_GetClusterDef (int);
190 int P_GetNumEpisodes ();
192 VMapInfo
*P_GetMapInfoPtr (int mapidx
);
193 VEpisodeDef
*P_GetEpisodeDef (int);
194 int P_GetNumSkills ();
195 const VSkillDef
*P_GetSkillDef (int);
196 void P_GetMusicLumpNames (TArray
<FReplacedString
> &);
197 void P_ReplaceMusicLumpNames (TArray
<FReplacedString
> &);
198 void P_SetParTime (VName
, int);
199 bool IsMapPresent (VName
);
201 void P_SetupMapinfoPlayerClasses ();