author | unc0rr |
Wed, 28 Dec 2005 22:18:11 +0000 | |
changeset 32 | 78bff13b11c0 |
parent 22 | 517be8dc5b76 |
child 35 | 9367f246fb5f |
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, |
39 |
sWindL, sWindR); |
|
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 |
|
200 |
(FileName: 'WindR.png'; Path: ptGraphics ) // sWindR |
|
4 | 201 |
); |
202 |
StuffPoz: array[TStuff] of TSDL_Rect = ( |
|
203 |
(x: 0; y: 0; w: 512; h: 256), // sHorizont |
|
204 |
(x: 512; y: 0; w: 64; h:1024), // sSky |
|
205 |
(x: 256; y: 256; w: 256; h: 256), // sConsoleBG |
|
206 |
(x: 256; y: 768; w: 256; h: 32), // sPowerBar |
|
5 | 207 |
(x: 256; y: 512; w: 32; h: 32), // sQuestion |
208 |
(x: 256; y: 800; w: 151; h: 17), // sWindBar |
|
209 |
(x: 256; y: 817; w: 80; h: 13), // sWindL |
|
210 |
(x: 336; y: 817; w: 80; h: 13) // sWindR |
|
4 | 211 |
); |
212 |
SpritesData: array[TSprite] of record |
|
213 |
FileName: String[31]; |
|
214 |
Path : TPathType; |
|
215 |
Surface : PSDL_Surface; |
|
216 |
Width, Height: integer; |
|
217 |
end = ( |
|
218 |
(FileName: 'BlueWater.png'; Path: ptGraphics; Width: 256; Height: 48),// sprWater |
|
219 |
(FileName: 'Clouds.png'; Path: ptGraphics; Width: 256; Height:128),// sprCloud |
|
220 |
(FileName: 'Bomb.png'; Path: ptGraphics; Width: 16; Height: 16),// sprBomb |
|
221 |
(FileName: 'BigDigits.png'; Path: ptGraphics; Width: 32; Height: 32),// sprBigDigit |
|
222 |
(FileName: 'Frame.png'; Path: ptGraphics; Width: 4; Height: 32),// sprFrame |
|
223 |
(FileName: 'Lag.png'; Path: ptGraphics; Width: 64; Height: 64),// sprLag |
|
224 |
(FileName: 'Arrow.png'; Path: ptGraphics; Width: 16; Height: 16),// sprCursor |
|
225 |
(FileName: 'Grenade.png'; Path: ptGraphics; Width: 32; Height: 32),// sprGrenade |
|
226 |
(FileName: 'Targetp.png'; Path: ptGraphics; Width: 32; Height: 32),// sprTargetP |
|
227 |
(FileName: 'UFO.png'; Path: ptGraphics; Width: 32; Height: 32),// sprUFO |
|
228 |
(FileName:'SmokeTrace.png'; Path: ptGraphics; Width: 32; Height: 32),// sprSmokeTrace |
|
9 | 229 |
(FileName: 'RopeHook.png'; Path: ptGraphics; Width: 32; Height: 32),// sprRopeHook |
10 | 230 |
(FileName: 'Expl50.png'; Path: ptGraphics; Width: 64; Height: 64),// sprExplosion50 |
231 |
(FileName: 'MineOff.png'; Path: ptGraphics; Width: 16; Height: 16),// sprMineOff |
|
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
232 |
(FileName: 'MineOn.png'; Path: ptGraphics; Width: 16; Height: 16),// sprMineOn |
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
233 |
(FileName: 'Case.png'; Path: ptGraphics; Width: 32; Height: 32) // sprCase |
4 | 234 |
); |
235 |
Soundz: array[TSound] of record |
|
236 |
FileName: String[31]; |
|
237 |
Path : TPathType; |
|
238 |
id : PMixChunk; |
|
239 |
end = ( |
|
240 |
(FileName: 'grenadeimpact.ogg'; Path: ptSounds ),// sndGrenadeImpact |
|
241 |
(FileName: 'explosion.ogg'; Path: ptSounds ),// sndExplosion |
|
242 |
(FileName: 'throwpowerup.ogg'; Path: ptSounds ),// sndThrowPowerUp |
|
243 |
(FileName: 'throwrelease.ogg'; Path: ptSounds ),// sndThrowRelease |
|
244 |
(FileName: 'splash.ogg'; Path: ptSounds ),// sndSplash |
|
245 |
(FileName: 'shotgunreload.ogg'; Path: ptSounds ),// sndShotgunReload |
|
246 |
(FileName: 'shotgunfire.ogg'; Path: ptSounds ),// sndShotgunFire |
|
13 | 247 |
(FileName: 'graveimpact.ogg'; Path: ptSounds ),// sndGraveImpact |
248 |
(FileName: 'minetick.ogg'; Path: ptSounds ) // sndMineTicks |
|
4 | 249 |
); |
250 |
||
251 |
Ammoz: array [TAmmoType] of record |
|
252 |
Name: string[32]; |
|
253 |
Ammo: TAmmo; |
|
254 |
Slot: Longword; |
|
255 |
TimeAfterTurn: Longword; |
|
256 |
end = ( |
|
257 |
(Name: 'Grenade'; |
|
258 |
Ammo: (Propz: ammoprop_Timerable or ammoprop_Power; |
|
259 |
Count: AMMO_INFINITE; |
|
260 |
NumPerTurn: 0; |
|
261 |
Timer: 3000; |
|
262 |
AmmoType: amGrenade); |
|
10 | 263 |
Slot: 1; |
4 | 264 |
TimeAfterTurn: 3000), |
265 |
(Name: 'Bazooka'; |
|
266 |
Ammo: (Propz: ammoprop_Power; |
|
267 |
Count: AMMO_INFINITE; |
|
268 |
NumPerTurn: 0; |
|
269 |
Timer: 0; |
|
270 |
AmmoType: amBazooka); |
|
10 | 271 |
Slot: 0; |
4 | 272 |
TimeAfterTurn: 3000), |
273 |
(Name: 'UFO'; |
|
274 |
Ammo: (Propz: ammoprop_Power or ammoprop_NeedTarget; |
|
275 |
Count: 4; |
|
276 |
NumPerTurn: 0; |
|
277 |
Timer: 0; |
|
278 |
AmmoType: amUFO); |
|
279 |
Slot: 0; |
|
280 |
TimeAfterTurn: 3000), |
|
281 |
(Name: 'Shotgun'; |
|
282 |
Ammo: (Propz: 0; |
|
283 |
Count: AMMO_INFINITE; |
|
284 |
NumPerTurn: 1; |
|
285 |
Timer: 0; |
|
286 |
AmmoType: amShotgun); |
|
287 |
Slot: 2; |
|
288 |
TimeAfterTurn: 3000), |
|
289 |
(Name: 'Pneumatic pick'; |
|
290 |
Ammo: (Propz: ammoprop_ForwMsgs or ammoprop_AttackInFall or ammoprop_AttackInJump; |
|
291 |
Count: 2; |
|
292 |
NumPerTurn: 0; |
|
293 |
Timer: 0; |
|
294 |
AmmoType: amPickHammer); |
|
10 | 295 |
Slot: 4; |
4 | 296 |
TimeAfterTurn: 0), |
297 |
(Name: 'Skip turn'; |
|
298 |
Ammo: (Propz: 0; |
|
299 |
Count: AMMO_INFINITE; |
|
300 |
NumPerTurn: 0; |
|
301 |
Timer: 0; |
|
302 |
AmmoType: amSkip); |
|
10 | 303 |
Slot: 6; |
4 | 304 |
TimeAfterTurn: 0), |
305 |
(Name: 'Rope'; |
|
306 |
Ammo: (Propz: ammoprop_ForwMsgs or ammoprop_AttackInFall or ammoprop_AttackInJump; |
|
307 |
Count: 5; |
|
308 |
NumPerTurn: 0; |
|
309 |
Timer: 0; |
|
310 |
AmmoType: amRope); |
|
10 | 311 |
Slot: 5; |
312 |
TimeAfterTurn: 0), |
|
313 |
(Name: 'Mine'; |
|
13 | 314 |
Ammo: (Propz: ammoprop_NoCrosshair; |
10 | 315 |
Count: 5; |
316 |
NumPerTurn: 0; |
|
317 |
Timer: 0; |
|
318 |
AmmoType: amMine); |
|
4 | 319 |
Slot: 3; |
10 | 320 |
TimeAfterTurn: 3000) |
4 | 321 |
); |
322 |
||
323 |
Resolutions: array[0..3] of String = ( |
|
324 |
'640 480', |
|
325 |
'800 600', |
|
326 |
'1024 768', |
|
327 |
'1280 1024' |
|
328 |
); |
|
329 |
||
330 |
implementation |
|
331 |
||
332 |
end. |