author | unc0rr |
Sat, 31 Dec 2005 13:45:09 +0000 | |
changeset 35 | 9367f246fb5f |
parent 22 | 517be8dc5b76 |
child 37 | 2b7f2a43b999 |
permissions | -rw-r--r-- |
4 | 1 |
(* |
2 |
* Hedgewars, a worms-like game |
|
3 |
* Copyright (c) 2004, 2005 Andrey Korotaev <unC0Rr@gmail.com> |
|
4 |
* |
|
5 |
* Distributed under the terms of the BSD-modified licence: |
|
6 |
* |
|
7 |
* Permission is hereby granted, free of charge, to any person obtaining a copy |
|
8 |
* of this software and associated documentation files (the "Software"), to deal |
|
9 |
* with the Software without restriction, including without limitation the |
|
10 |
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
|
11 |
* sell copies of the Software, and to permit persons to whom the Software is |
|
12 |
* furnished to do so, subject to the following conditions: |
|
13 |
* |
|
14 |
* 1. Redistributions of source code must retain the above copyright notice, |
|
15 |
* this list of conditions and the following disclaimer. |
|
16 |
* 2. Redistributions in binary form must reproduce the above copyright notice, |
|
17 |
* this list of conditions and the following disclaimer in the documentation |
|
18 |
* and/or other materials provided with the distribution. |
|
19 |
* 3. The name of the author may not be used to endorse or promote products |
|
20 |
* derived from this software without specific prior written permission. |
|
21 |
* |
|
22 |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
|
23 |
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
|
24 |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
|
25 |
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
26 |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
|
27 |
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
|
28 |
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
|
29 |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
|
30 |
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
|
31 |
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
32 |
*) |
|
33 |
||
34 |
unit uConsts; |
|
35 |
interface |
|
36 |
uses SDLh; |
|
37 |
{$INCLUDE options.inc} |
|
5 | 38 |
type TStuff = (sHorizont, sSky, sConsoleBG, sPowerBar, sQuestion, sWindBar, |
35 | 39 |
sWindL, sWindR, sRopeNode); |
4 | 40 |
TGameState = (gsLandGen, gsStart, gsGame, gsConsole, gsExit); |
41 |
TGameType = (gmtLocal, gmtDemo, gmtNet); |
|
42 |
TPathType = (ptData, ptGraphics, ptThemes, ptThemeCurrent, ptTeams, ptMaps, |
|
43 |
ptMapCurrent, ptDemos, ptSounds, ptGraves, ptFonts, ptForts); |
|
44 |
TSprite = (sprWater, sprCloud, sprBomb, sprBigDigit, sprFrame, |
|
45 |
sprLag, sprArrow, sprGrenade, sprTargetP, sprUFO, |
|
10 | 46 |
sprSmokeTrace, sprRopeHook, sprExplosion50, sprMineOff, |
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
47 |
sprMineOn, sprCase); |
4 | 48 |
TGearType = (gtCloud, gtAmmo_Bomb, gtHedgehog, gtAmmo_Grenade, gtHealthTag, |
49 |
gtGrave, gtUFO, gtShotgunShot, gtActionTimer, gtPickHammer, gtRope, |
|
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
50 |
gtSmokeTrace, gtExplosion, gtMine, gtCase); |
16 | 51 |
TGearsType = set of TGearType; |
4 | 52 |
TSound = (sndGrenadeImpact, sndExplosion, sndThrowPowerUp, sndThrowRelease, sndSplash, |
13 | 53 |
sndShotgunReload, sndShotgunFire, sndGraveImpact, sndMineTick); |
10 | 54 |
TAmmoType = (amGrenade, amBazooka, amUFO, amShotgun, amPickHammer, amSkip, amRope, |
55 |
amMine); |
|
4 | 56 |
THWFont = (fnt16, fntBig); |
57 |
THHFont = record |
|
58 |
Handle: PTTF_Font; |
|
59 |
Height: integer; |
|
60 |
Name: string[15]; |
|
61 |
end; |
|
62 |
TAmmo = record |
|
63 |
Propz: LongWord; |
|
64 |
Count: LongWord; |
|
65 |
NumPerTurn: LongWord; |
|
66 |
Timer: LongWord; |
|
67 |
AmmoType: TAmmoType; |
|
68 |
end; |
|
69 |
||
70 |
||
71 |
resourcestring |
|
72 |
errmsgCreateSurface = 'Error creating DirectDraw7 surface'; |
|
73 |
errmsgNoDesc = 'Unknown error'; |
|
74 |
errmsgTransparentSet = 'Error setting transparent color'; |
|
75 |
errmsgUnknownCommand = 'Unknown command'; |
|
76 |
errmsgUnknownVariable = 'Unknown variable'; |
|
77 |
errmsgIncorrectUse = 'Incorrect use'; |
|
78 |
errmsgShouldntRun = 'This program shouldn''t be run manually'; |
|
79 |
||
80 |
msgLoading = 'Loading '; |
|
81 |
msgOK = 'ok'; |
|
82 |
msgFailed = 'failed'; |
|
83 |
msgGettingConfig = 'Getting game config...'; |
|
84 |
||
85 |
const |
|
86 |
cAppName = 'hw'; |
|
87 |
cAppTitle = 'hw'; |
|
88 |
cNetProtoVersion = 1; |
|
89 |
||
90 |
rndfillstr = 'hw'; |
|
91 |
||
92 |
cTransparentColor: Cardinal = $000000; |
|
93 |
||
22 | 94 |
cMaxHHIndex = 9; |
95 |
cMaxHHs = 20; |
|
96 |
cMaxSpawnPoints = 64; |
|
4 | 97 |
cHHSurfaceWidth = 512; |
98 |
cHHSurfaceHeigth = 256; |
|
99 |
||
22 | 100 |
cMaxEdgePoints = 16384; |
101 |
||
4 | 102 |
cHHHalfHeight = 11; |
103 |
||
104 |
cKeyMaxIndex = 322; |
|
105 |
||
106 |
cMaxCaptions = 4; |
|
107 |
||
108 |
cInactDelay = 1500; |
|
109 |
||
110 |
gfForts = $00000001; |
|
111 |
||
112 |
gstDrowning = $00000001; |
|
113 |
gstHHDriven = $00000002; |
|
114 |
gstMoving = $00000004; |
|
115 |
gstAttacked = $00000008; |
|
116 |
gstAttacking = $00000010; |
|
117 |
gstCollision = $00000020; |
|
118 |
gstHHChooseTarget = $00000040; |
|
119 |
gstFalling = $00000080; |
|
120 |
gstHHJumping = $00000100; |
|
121 |
gsttmpFlag = $00000200; |
|
122 |
gstOutOfHH = $00000400; |
|
123 |
gstHHThinking = $00000800; |
|
124 |
||
125 |
gtsStartGame = 1; |
|
6 | 126 |
gtsSmoothWindCh = 2; |
4 | 127 |
|
128 |
gm_Left = $00000001; |
|
129 |
gm_Right = $00000002; |
|
130 |
gm_Up = $00000004; |
|
131 |
gm_Down = $00000008; |
|
132 |
gm_Switch = $00000010; |
|
133 |
gm_Attack = $00000020; |
|
134 |
gm_LJump = $00000040; |
|
135 |
gm_HJump = $00000080; |
|
136 |
gm_Destroy= $00000100; |
|
137 |
||
10 | 138 |
cMaxSlotIndex = 6; |
139 |
cMaxSlotAmmoIndex = 1; |
|
4 | 140 |
|
141 |
ammoprop_Timerable = $00000001; |
|
142 |
ammoprop_Power = $00000002; |
|
143 |
ammoprop_NeedTarget = $00000004; |
|
144 |
ammoprop_ForwMsgs = $00000008; |
|
145 |
ammoprop_AttackInFall = $00000010; |
|
146 |
ammoprop_AttackInJump = $00000020; |
|
13 | 147 |
ammoprop_NoCrosshair = $00000040; |
4 | 148 |
AMMO_INFINITE = High(LongWord); |
149 |
||
150 |
capgrpStartGame = 0; |
|
151 |
capgrpAmmoinfo = 1; |
|
152 |
capgrpNetSay = 2; |
|
153 |
||
154 |
EXPLAllDamageInRadius = 1; |
|
155 |
EXPLAutoSound = 2; |
|
156 |
EXPLNoDamage = 4; |
|
157 |
||
158 |
cToggleConsoleKey = 39; |
|
159 |
||
160 |
NoPointX = Low(Integer); // êîíñòàíòà äëÿ TargetPoint, ïîêàçûâàåò, ÷òî öåëü íå óêàçàíà |
|
161 |
||
162 |
cLandFileName = 'Land.bmp'; |
|
163 |
cHHFileName = 'Hedgehog.png'; |
|
164 |
cCHFileName = 'Crosshair.png'; |
|
165 |
cThemeCFGFilename = 'theme.cfg'; |
|
166 |
||
167 |
Fontz: array[THWFont] of THHFont = ( |
|
168 |
(Height: 12; |
|
169 |
Name: 'UN1251N.TTF'), |
|
170 |
(Height: 24; |
|
171 |
Name: 'UN1251N.TTF') |
|
172 |
); |
|
173 |
||
174 |
Pathz: array[TPathType] of string[ 64] = ( |
|
175 |
'Data/', // ptData |
|
176 |
'Data/Graphics/', // ptGraphics |
|
177 |
'Data/Themes/', // ptThemes |
|
178 |
'Data/Themes/Default/', // ptThemeCurrent |
|
179 |
'Data/Teams/', // ptTeams |
|
180 |
'Data/Maps/', // ptMaps |
|
181 |
'Data/Maps/Current/', // ptMapCurrent |
|
182 |
'Data/Demos/', // ptDemos |
|
183 |
'Data/Sounds/', // ptSounds |
|
184 |
'Data/Graphics/Graves/', // ptGraves |
|
185 |
'Data/Fonts/', // ptFonts |
|
186 |
'Data/Forts/' // ptForts |
|
187 |
); |
|
188 |
||
189 |
StuffLoadData: array[TStuff] of record |
|
190 |
FileName: String[31]; |
|
191 |
Path : TPathType; |
|
192 |
end = ( |
|
193 |
(FileName: 'horizont.png'; Path: ptThemeCurrent ), // sHorizont |
|
194 |
(FileName: 'Sky.png'; Path: ptThemeCurrent ), // sSky |
|
195 |
(FileName: 'Console.png'; Path: ptGraphics ), // sConsoleBG |
|
196 |
(FileName: 'PowerBar.png'; Path: ptGraphics ), // sPowerBar |
|
5 | 197 |
(FileName: 'thinking.png'; Path: ptGraphics ), // sQuestion |
198 |
(FileName: 'WindBar.png'; Path: ptGraphics ), // sWindBar |
|
199 |
(FileName: 'WindL.png'; Path: ptGraphics ), // sWindL |
|
35 | 200 |
(FileName: 'WindR.png'; Path: ptGraphics ), // sWindR |
201 |
(FileName: 'RopeNode.png'; Path: ptGraphics ) // sRopeNode |
|
4 | 202 |
); |
203 |
StuffPoz: array[TStuff] of TSDL_Rect = ( |
|
204 |
(x: 0; y: 0; w: 512; h: 256), // sHorizont |
|
205 |
(x: 512; y: 0; w: 64; h:1024), // sSky |
|
206 |
(x: 256; y: 256; w: 256; h: 256), // sConsoleBG |
|
207 |
(x: 256; y: 768; w: 256; h: 32), // sPowerBar |
|
5 | 208 |
(x: 256; y: 512; w: 32; h: 32), // sQuestion |
209 |
(x: 256; y: 800; w: 151; h: 17), // sWindBar |
|
210 |
(x: 256; y: 817; w: 80; h: 13), // sWindL |
|
35 | 211 |
(x: 336; y: 817; w: 80; h: 13), // sWindR |
212 |
(x: 256; y: 544; w: 6; h: 6) // sRopeNode |
|
4 | 213 |
); |
214 |
SpritesData: array[TSprite] of record |
|
35 | 215 |
FileName: String[31]; |
216 |
Path : TPathType; |
|
217 |
Surface : PSDL_Surface; |
|
218 |
Width, Height: integer; |
|
219 |
hasAlpha: boolean; |
|
220 |
end = ( |
|
221 |
(FileName: 'BlueWater.png'; Path: ptGraphics; Width: 256; Height: 48; hasAlpha: false),// sprWater |
|
222 |
(FileName: 'Clouds.png'; Path: ptGraphics; Width: 256; Height:128; hasAlpha: false),// sprCloud |
|
223 |
(FileName: 'Bomb.png'; Path: ptGraphics; Width: 16; Height: 16; hasAlpha: false),// sprBomb |
|
224 |
(FileName: 'BigDigits.png'; Path: ptGraphics; Width: 32; Height: 32; hasAlpha: true),// sprBigDigit |
|
225 |
(FileName: 'Frame.png'; Path: ptGraphics; Width: 4; Height: 32; hasAlpha: true),// sprFrame |
|
226 |
(FileName: 'Lag.png'; Path: ptGraphics; Width: 64; Height: 64; hasAlpha: false),// sprLag |
|
227 |
(FileName: 'Arrow.png'; Path: ptGraphics; Width: 16; Height: 16; hasAlpha: false),// sprCursor |
|
228 |
(FileName: 'Grenade.png'; Path: ptGraphics; Width: 32; Height: 32; hasAlpha: false),// sprGrenade |
|
229 |
(FileName: 'Targetp.png'; Path: ptGraphics; Width: 32; Height: 32; hasAlpha: false),// sprTargetP |
|
230 |
(FileName: 'UFO.png'; Path: ptGraphics; Width: 32; Height: 32; hasAlpha: false),// sprUFO |
|
231 |
(FileName:'SmokeTrace.png'; Path: ptGraphics; Width: 32; Height: 32; hasAlpha: true),// sprSmokeTrace |
|
232 |
(FileName: 'RopeHook.png'; Path: ptGraphics; Width: 32; Height: 32; hasAlpha: false),// sprRopeHook |
|
233 |
(FileName: 'Expl50.png'; Path: ptGraphics; Width: 64; Height: 64; hasAlpha: false),// sprExplosion50 |
|
234 |
(FileName: 'MineOff.png'; Path: ptGraphics; Width: 16; Height: 16; hasAlpha: false),// sprMineOff |
|
235 |
(FileName: 'MineOn.png'; Path: ptGraphics; Width: 16; Height: 16; hasAlpha: false),// sprMineOn |
|
236 |
(FileName: 'Case.png'; Path: ptGraphics; Width: 32; Height: 32; hasAlpha: false) // sprCase |
|
237 |
); |
|
4 | 238 |
Soundz: array[TSound] of record |
239 |
FileName: String[31]; |
|
240 |
Path : TPathType; |
|
241 |
id : PMixChunk; |
|
242 |
end = ( |
|
243 |
(FileName: 'grenadeimpact.ogg'; Path: ptSounds ),// sndGrenadeImpact |
|
244 |
(FileName: 'explosion.ogg'; Path: ptSounds ),// sndExplosion |
|
245 |
(FileName: 'throwpowerup.ogg'; Path: ptSounds ),// sndThrowPowerUp |
|
246 |
(FileName: 'throwrelease.ogg'; Path: ptSounds ),// sndThrowRelease |
|
247 |
(FileName: 'splash.ogg'; Path: ptSounds ),// sndSplash |
|
248 |
(FileName: 'shotgunreload.ogg'; Path: ptSounds ),// sndShotgunReload |
|
249 |
(FileName: 'shotgunfire.ogg'; Path: ptSounds ),// sndShotgunFire |
|
13 | 250 |
(FileName: 'graveimpact.ogg'; Path: ptSounds ),// sndGraveImpact |
251 |
(FileName: 'minetick.ogg'; Path: ptSounds ) // sndMineTicks |
|
4 | 252 |
); |
253 |
||
254 |
Ammoz: array [TAmmoType] of record |
|
255 |
Name: string[32]; |
|
256 |
Ammo: TAmmo; |
|
257 |
Slot: Longword; |
|
258 |
TimeAfterTurn: Longword; |
|
259 |
end = ( |
|
260 |
(Name: 'Grenade'; |
|
261 |
Ammo: (Propz: ammoprop_Timerable or ammoprop_Power; |
|
262 |
Count: AMMO_INFINITE; |
|
263 |
NumPerTurn: 0; |
|
264 |
Timer: 3000; |
|
265 |
AmmoType: amGrenade); |
|
10 | 266 |
Slot: 1; |
4 | 267 |
TimeAfterTurn: 3000), |
268 |
(Name: 'Bazooka'; |
|
269 |
Ammo: (Propz: ammoprop_Power; |
|
270 |
Count: AMMO_INFINITE; |
|
271 |
NumPerTurn: 0; |
|
272 |
Timer: 0; |
|
273 |
AmmoType: amBazooka); |
|
10 | 274 |
Slot: 0; |
4 | 275 |
TimeAfterTurn: 3000), |
276 |
(Name: 'UFO'; |
|
277 |
Ammo: (Propz: ammoprop_Power or ammoprop_NeedTarget; |
|
278 |
Count: 4; |
|
279 |
NumPerTurn: 0; |
|
280 |
Timer: 0; |
|
281 |
AmmoType: amUFO); |
|
282 |
Slot: 0; |
|
283 |
TimeAfterTurn: 3000), |
|
284 |
(Name: 'Shotgun'; |
|
285 |
Ammo: (Propz: 0; |
|
286 |
Count: AMMO_INFINITE; |
|
287 |
NumPerTurn: 1; |
|
288 |
Timer: 0; |
|
289 |
AmmoType: amShotgun); |
|
290 |
Slot: 2; |
|
291 |
TimeAfterTurn: 3000), |
|
292 |
(Name: 'Pneumatic pick'; |
|
293 |
Ammo: (Propz: ammoprop_ForwMsgs or ammoprop_AttackInFall or ammoprop_AttackInJump; |
|
294 |
Count: 2; |
|
295 |
NumPerTurn: 0; |
|
296 |
Timer: 0; |
|
297 |
AmmoType: amPickHammer); |
|
10 | 298 |
Slot: 4; |
4 | 299 |
TimeAfterTurn: 0), |
300 |
(Name: 'Skip turn'; |
|
301 |
Ammo: (Propz: 0; |
|
302 |
Count: AMMO_INFINITE; |
|
303 |
NumPerTurn: 0; |
|
304 |
Timer: 0; |
|
305 |
AmmoType: amSkip); |
|
10 | 306 |
Slot: 6; |
4 | 307 |
TimeAfterTurn: 0), |
308 |
(Name: 'Rope'; |
|
309 |
Ammo: (Propz: ammoprop_ForwMsgs or ammoprop_AttackInFall or ammoprop_AttackInJump; |
|
310 |
Count: 5; |
|
311 |
NumPerTurn: 0; |
|
312 |
Timer: 0; |
|
313 |
AmmoType: amRope); |
|
10 | 314 |
Slot: 5; |
315 |
TimeAfterTurn: 0), |
|
316 |
(Name: 'Mine'; |
|
13 | 317 |
Ammo: (Propz: ammoprop_NoCrosshair; |
10 | 318 |
Count: 5; |
319 |
NumPerTurn: 0; |
|
320 |
Timer: 0; |
|
321 |
AmmoType: amMine); |
|
4 | 322 |
Slot: 3; |
10 | 323 |
TimeAfterTurn: 3000) |
4 | 324 |
); |
325 |
||
326 |
Resolutions: array[0..3] of String = ( |
|
327 |
'640 480', |
|
328 |
'800 600', |
|
329 |
'1024 768', |
|
330 |
'1280 1024' |
|
331 |
); |
|
332 |
||
333 |
implementation |
|
334 |
||
335 |
end. |