2
* Hedgewars, a free turn based strategy game
3
* Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com>
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; version 2 of the License
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
1
19
{$INCLUDE "options.inc"}
23
* This unit defines various types and enumerations for usage in different
24
* places in the engine code.
6
28
uses SDLh, uFloat, GLunit, uConsts, Math;
30
// NOTE: typed const is a variable despite const qualifier
31
// in freepascal you may actually use var for the same purpose
13
TGameState = (gsLandGen, gsStart, gsGame, gsChat, gsConfirm, gsExit, gsSuspend);
38
// Possible states of the game
39
TGameState = (gsLandGen, gsStart, gsGame, gsChat, gsConfirm, gsExit);
41
// Game types that help determining what the engine is actually supposed to do
15
42
TGameType = (gmtLocal, gmtDemo, gmtNet, gmtSave, gmtLandPreview, gmtSyntax);
44
// Different files are stored in different folders, this enumeration is used to tell which folder to use
17
45
TPathType = (ptNone, ptData, ptGraphics, ptThemes, ptCurrTheme, ptTeams, ptMaps,
18
46
ptMapCurrent, ptDemos, ptSounds, ptGraves, ptFonts, ptForts,
19
ptLocale, ptAmmoMenu, ptHedgehog, ptVoices, ptHats, ptFlags, ptMissionMaps);
47
ptLocale, ptAmmoMenu, ptHedgehog, ptVoices, ptHats, ptFlags, ptMissionMaps, ptSuddenDeath);
49
// Available sprites for displaying stuff
21
50
TSprite = (sprWater, sprCloud, sprBomb, sprBigDigit, sprFrame,
22
51
sprLag, sprArrow, sprBazookaShell, sprTargetP, sprBee,
23
52
sprSmokeTrace, sprRopeHook, sprExplosion50, sprMineOff,
52
81
sprCheese, sprHandCheese, sprHandFlamethrower, sprChunk, sprNote,
53
82
sprSMineOff, sprSMineOn, sprHandSMine, sprHammer,
54
83
sprHandResurrector, sprCross, sprAirDrill, sprNapalmBomb,
55
sprBulletHit, sprSnowball, sprHandSnowball, sprSnow
84
sprBulletHit, sprSnowball, sprHandSnowball, sprSnow,
85
sprSDFlake, sprSDWater, sprSDCloud, sprSDSplash, sprSDDroplet, sprTardis
58
88
// Gears that interact with other Gears and/or Land
59
TGearType = (gtBomb, gtHedgehog, gtShell, gtGrave, gtBee, // 4
89
TGearType = (gtGrenade, gtHedgehog, gtShell, gtGrave, gtBee, // 4
60
90
gtShotgunShot, gtPickHammer, gtRope, gtMine, gtCase, // 9
61
91
gtDEagleShot, gtDynamite, gtClusterBomb, gtCluster, gtShover, // 14
62
gtFlame, gtFirePunch, gtATStartGame, gtATSmoothWindCh, // 18
63
gtATFinishGame, gtParachute, gtAirAttack, gtAirBomb, gtBlowTorch, // 23
64
gtGirder, gtTeleport, gtSwitcher, gtTarget, gtMortar, // 28
65
gtWhip, gtKamikaze, gtCake, gtSeduction, gtWatermelon, gtMelonPiece, // 34
66
gtHellishBomb, gtWaterUp, gtDrill, gtBallGun, gtBall, gtRCPlane, // 40
67
gtSniperRifleShot, gtJetpack, gtMolotov, gtExplosives, gtBirdy, // 45
68
gtEgg, gtPortal, gtPiano, gtGasBomb, gtSineGunShot, gtFlamethrower, // 51
69
gtSMine, gtPoisonCloud, gtHammer, gtHammerHit, gtResurrector, // 56
70
gtNapalmBomb, gtSnowball, gtFlake); // 58
92
gtFlame, gtFirePunch, gtATStartGame, // 17
93
gtATFinishGame, gtParachute, gtAirAttack, gtAirBomb, gtBlowTorch, // 22
94
gtGirder, gtTeleport, gtSwitcher, gtTarget, gtMortar, // 27
95
gtWhip, gtKamikaze, gtCake, gtSeduction, gtWatermelon, gtMelonPiece, // 33
96
gtHellishBomb, gtWaterUp, gtDrill, gtBallGun, gtBall, gtRCPlane, // 39
97
gtSniperRifleShot, gtJetpack, gtMolotov, gtExplosives, gtBirdy, // 44
98
gtEgg, gtPortal, gtPiano, gtGasBomb, gtSineGunShot, gtFlamethrower, // 50
99
gtSMine, gtPoisonCloud, gtHammer, gtHammerHit, gtResurrector, // 55
100
gtNapalmBomb, gtSnowball, gtFlake, gtStructure, gtLandGun, gtTardis); // 61
72
102
// Gears that are _only_ of visual nature (e.g. background stuff, visual effects, speechbubbles, etc.)
73
103
TVisualGearType = (vgtFlake, vgtCloud, vgtExplPart, vgtExplPart2, vgtFire,
74
104
vgtSmallDamageTag, vgtTeamHealthSorter, vgtSpeechBubble, vgtBubble,
75
vgtSteam, vgtAmmo, vgtSmoke, vgtSmokeWhite, vgtHealth, vgtShell,
105
vgtSteam, vgtAmmo, vgtSmoke, vgtSmokeWhite, vgtShell,
76
106
vgtDust, vgtSplash, vgtDroplet, vgtSmokeRing, vgtBeeTrace, vgtEgg,
77
107
vgtFeather, vgtHealthTag, vgtSmokeTrace, vgtEvilTrace, vgtExplosion,
78
vgtBigExplosion, vgtChunk, vgtNote, vgtLineTrail, vgtBulletHit, vgtCircle);
108
vgtBigExplosion, vgtChunk, vgtNote, vgtLineTrail, vgtBulletHit, vgtCircle,
109
vgtSmoothWindBar, vgtStraightShot);
80
111
TGearsType = set of TGearType;
113
// Damage can be caused by different sources
82
114
TDamageSource = (dsUnknown, dsFall, dsBullet, dsExplosion, dsShove, dsPoison);
84
117
TSound = (sndNone,
85
118
sndGrenadeImpact, sndExplosion, sndThrowPowerUp, sndThrowRelease,
86
119
sndSplash, sndShotgunReload, sndShotgunFire, sndGraveImpact,
87
sndMineTick, sndPickhammer, sndGun, sndBee, sndJump1, sndJump2,
120
sndMineImpact, sndMineTick, sndMudballImpact,
121
sndPickhammer, sndGun, sndBee, sndJump1, sndJump2,
88
122
sndJump3, sndYesSir, sndLaugh, sndIllGetYou, sndIncoming,
89
123
sndMissed, sndStupid, sndFirstBlood, sndBoring, sndByeBye,
90
124
sndSameTeam, sndNutter, sndReinforce, sndTraitor, sndRegret,
96
130
sndVaporize, sndWarp, sndSuddenDeath, sndMortar, sndShutter,
97
131
sndHomerun, sndMolotov, sndCover, sndUhOh, sndOops,
98
132
sndNooo, sndHello, sndRopeShot, sndRopeAttach, sndRopeRelease,
99
sndSwitchHog, sndVictory, sndSniperReload, sndSteps, sndLowGravity,
133
sndSwitchHog, sndVictory, sndFlawless, sndSniperReload, sndSteps, sndLowGravity,
100
134
sndHellishImpact1, sndHellishImpact2, sndHellishImpact3, sndHellishImpact4,
101
135
sndMelonImpact, sndDroplet1, sndDroplet2, sndDroplet3, sndEggBreak, sndDrillRocket,
102
136
sndPoisonCough, sndPoisonMoan, sndBirdyLay, sndWhistle, sndBeeWater,
103
137
sndPiano0, sndPiano1, sndPiano2, sndPiano3, sndPiano4, sndPiano5, sndPiano6, sndPiano7, sndPiano8,
104
138
sndSkip, sndSineGun, sndOoff1, sndOoff2, sndOoff3, sndWhack,
105
sndComeonthen, sndParachute, sndBump, sndResurrector);
139
sndComeonthen, sndParachute, sndBump, sndResurrector, sndPlane, sndTardis);
141
// Available ammo types to be used by hedgehogs
107
142
TAmmoType = (amNothing, amGrenade, amClusterBomb, amBazooka, amBee, amShotgun, amPickHammer, // 6
108
143
amSkip, amRope, amMine, amDEagle, amDynamite, amFirePunch, amWhip, // 13
109
144
amBaseballBat, amParachute, amAirAttack, amMineStrike, amBlowTorch, // 18
112
147
amRCPlane, amLowGravity, amExtraDamage, amInvulnerable, amExtraTime, // 35
113
148
amLaserSight, amVampiric, amSniperRifle, amJetpack, amMolotov, amBirdy, amPortalGun, // 42
114
149
amPiano, amGasBomb, amSineGun, amFlamethrower, amSMine, amHammer, // 48
115
amResurrector, amDrillStrike, amSnowball);
150
amResurrector, amDrillStrike, amSnowball, amTardis, amStructure, amLandGun); // 54
152
// Different kind of crates that e.g. hedgehogs can pick up
117
153
TCrateType = (HealthCrate, AmmoCrate, UtilityCrate);
119
155
THWFont = (fnt16, fntBig, fntSmall {$IFNDEF IPHONEOS}, CJKfnt16, CJKfntBig, CJKfntSmall{$ENDIF});
121
157
TCapGroup = (capgrpGameState, capgrpAmmoinfo, capgrpVolume,
122
capgrpMessage, capgrpAmmostate);
158
capgrpMessage, capgrpMessage2, capgrpAmmostate);
124
160
TStatInfoType = (siGameResult, siMaxStepDamage, siMaxStepKills, siKilledHHs,
125
161
siClanHealth, siTeamStats, siPlayerKills, siMaxTeamDamage,
126
162
siMaxTeamKills, siMaxTurnSkips );
164
// Various "emote" animations a hedgehog can do
128
165
TWave = (waveRollup, waveSad, waveWave, waveHurrah, waveLemonade, waveShrug, waveJuggle);
167
TRenderMode = (rmDefault, rmLeftEye, rmRightEye);
168
TStereoMode = (smNone, smRedCyan, smCyanRed, smRedBlue, smBlueRed, smRedGreen, smGreenRed, smHorizontal, smVertical, smAFR);
131
171
Handle: PTTF_Font;
343
397
sidLowGravity, sidExtraDamage, sidInvulnerable, sidExtraTime,
344
398
sidLaserSight, sidVampiric, sidSniperRifle, sidJetpack,
345
399
sidMolotov, sidBirdy, sidPortalGun, sidPiano, sidGasBomb, sidSineGun, sidFlamethrower,
346
sidSMine, sidHammer, sidResurrector, sidDrillStrike, sidSnowball);
400
sidSMine, sidHammer, sidResurrector, sidDrillStrike, sidSnowball, sidNothing, sidTardis, sidStructure, sidLandGun);
348
402
TMsgStrId = (sidStartFight, sidDraw, sidWinner, sidVolume, sidPaused,
349
403
sidConfirm, sidSuddenDeath, sidRemaining, sidFuel, sidSync,
350
sidNoEndTurn, sidNotYetAvailable, sidRoundSD, sidRoundsSD, sidReady);
404
sidNoEndTurn, sidNotYetAvailable, sidRoundSD, sidRoundsSD, sidReady,
405
sidBounce1, sidBounce2, sidBounce3, sidBounce4, sidBounce5, sidBounce);
407
// Events that are important for the course of the game or at least interesting for other reasons
352
408
TEventId = (eidDied, eidDrowned, eidRoundStart, eidRoundWin, eidRoundDraw,
353
409
eidNewHealthPack, eidNewAmmoPack, eidNewUtilityPack, eidTurnSkipped, eidHurtSelf,
354
410
eidHomerun, eidGone);