19 {$INCLUDE "options.inc"} |
19 {$INCLUDE "options.inc"} |
20 |
20 |
21 unit uConsts; |
21 unit uConsts; |
22 interface |
22 interface |
23 |
23 |
24 uses SDLh, uFloat, uLocale, GLunit; |
24 uses SDLh, uFloat, uLocale, GLunit, uTypes; |
25 |
25 |
26 |
26 |
27 {$INCLUDE "config.inc"} |
27 {$INCLUDE "config.inc"} |
28 |
28 |
29 // typed const is a variable despite const qualifier |
29 // typed const is a variable despite const qualifier |
30 // in freepascal you may actually use var for the same purpose |
30 // in freepascal you may actually use var for the same purpose |
31 |
31 |
32 type |
|
33 HwColor4f = record |
|
34 r, g, b, a: byte |
|
35 end; |
|
36 |
|
37 TGameState = (gsLandGen, gsStart, gsGame, gsChat, gsConfirm, gsExit); |
|
38 |
|
39 TGameType = (gmtLocal, gmtDemo, gmtNet, gmtSave, gmtLandPreview, gmtSyntax); |
|
40 |
|
41 TPathType = (ptNone, ptData, ptGraphics, ptThemes, ptCurrTheme, ptTeams, ptMaps, |
|
42 ptMapCurrent, ptDemos, ptSounds, ptGraves, ptFonts, ptForts, |
|
43 ptLocale, ptAmmoMenu, ptHedgehog, ptVoices, ptHats, ptFlags, ptMissionMaps); |
|
44 |
|
45 TSprite = (sprWater, sprCloud, sprBomb, sprBigDigit, sprFrame, |
|
46 sprLag, sprArrow, sprBazookaShell, sprTargetP, sprBee, |
|
47 sprSmokeTrace, sprRopeHook, sprExplosion50, sprMineOff, |
|
48 sprMineOn, sprMineDead, sprCase, sprFAid, sprDynamite, sprPower, |
|
49 sprClusterBomb, sprClusterParticle, sprFlame, sprHorizont, |
|
50 sprHorizontL, sprHorizontR, sprSky, sprSkyL, |
|
51 sprSkyR, sprAMBorderHorizontal, sprAMBorderVertical, sprAMSlot, sprAMAmmos, |
|
52 sprAMSlotKeys, sprAMCorners, sprFinger, sprAirBomb, |
|
53 sprAirplane, sprAmAirplane, sprAmGirder, sprHHTelepMask, |
|
54 sprSwitch, sprParachute, sprTarget, sprRopeNode, |
|
55 sprQuestion, sprPowerBar, sprWindBar, sprWindL, sprWindR, |
|
56 sprFlake, sprHandRope, sprHandBazooka, sprHandShotgun, |
|
57 sprHandDEagle, sprHandAirAttack, sprHandBaseball, sprPHammer, |
|
58 sprHandBlowTorch, sprBlowTorch, sprTeleport, sprHHDeath, |
|
59 sprShotgun, sprDEagle, sprHHIdle, sprMortar, sprTurnsLeft, |
|
60 sprKamikaze, sprWhip, sprKowtow, sprSad, sprWave, |
|
61 sprHurrah, sprLemonade, sprShrug, sprJuggle, sprExplPart, sprExplPart2, |
|
62 sprCakeWalk, sprCakeDown, sprAMAmmosBW, sprWatermelon, |
|
63 sprEvilTrace, sprHellishBomb, sprSeduction, sprDress, |
|
64 sprCensored, sprDrill, sprHandDrill, sprHandBallgun, sprBalls, |
|
65 sprPlane, sprHandPlane, sprUtility, sprInvulnerable, sprVampiric, sprGirder, |
|
66 sprSpeechCorner, sprSpeechEdge, sprSpeechTail, |
|
67 sprThoughtCorner, sprThoughtEdge, sprThoughtTail, |
|
68 sprShoutCorner, sprShoutEdge, sprShoutTail, |
|
69 sprSniperRifle, sprBubbles, sprJetpack, sprHealth, sprHandMolotov, sprMolotov, |
|
70 sprSmoke, sprSmokeWhite, sprShell, sprDust, sprExplosives, sprExplosivesRoll, |
|
71 sprAmTeleport, sprSplash, sprDroplet, sprBirdy, sprHandCake, sprHandConstruction, |
|
72 sprHandGrenade, sprHandMelon, sprHandMortar, sprHandSkip, sprHandCluster, |
|
73 sprHandDynamite, sprHandHellish, sprHandMine, sprHandSeduction, sprHandVamp, |
|
74 sprBigExplosion, sprSmokeRing, sprBeeTrace, sprEgg, sprTargetBee, sprHandBee, |
|
75 sprFeather, sprPiano, sprHandSineGun, sprPortalGun, sprPortal, |
|
76 sprCheese, sprHandCheese, sprHandFlamethrower, sprChunk, sprNote, |
|
77 sprSMineOff, sprSMineOn, sprHandSMine, sprHammer, |
|
78 sprHandResurrector, sprCross, sprAirDrill, sprNapalmBomb, |
|
79 sprBulletHit |
|
80 ); |
|
81 |
|
82 // Gears that interact with other Gears and/or Land |
|
83 TGearType = (gtBomb, gtHedgehog, gtShell, gtGrave, gtBee, // 4 |
|
84 gtShotgunShot, gtPickHammer, gtRope, gtMine, gtCase, // 9 |
|
85 gtDEagleShot, gtDynamite, gtClusterBomb, gtCluster, gtShover, // 14 |
|
86 gtFlame, gtFirePunch, gtATStartGame, gtATSmoothWindCh, // 18 |
|
87 gtATFinishGame, gtParachute, gtAirAttack, gtAirBomb, gtBlowTorch, // 23 |
|
88 gtGirder, gtTeleport, gtSwitcher, gtTarget, gtMortar, // 28 |
|
89 gtWhip, gtKamikaze, gtCake, gtSeduction, gtWatermelon, gtMelonPiece, // 34 |
|
90 gtHellishBomb, gtWaterUp, gtDrill, gtBallGun, gtBall, gtRCPlane, // 40 |
|
91 gtSniperRifleShot, gtJetpack, gtMolotov, gtExplosives, gtBirdy, // 45 |
|
92 gtEgg, gtPortal, gtPiano, gtGasBomb, gtSineGunShot, gtFlamethrower, // 51 |
|
93 gtSMine, gtPoisonCloud, gtHammer, gtHammerHit, gtResurrector, // 56 |
|
94 gtNapalmBomb); // 57 |
|
95 |
|
96 // Gears that are _only_ of visual nature (e.g. background stuff, visual effects, speechbubbles, etc.) |
|
97 TVisualGearType = (vgtFlake, vgtCloud, vgtExplPart, vgtExplPart2, vgtFire, |
|
98 vgtSmallDamageTag, vgtTeamHealthSorter, vgtSpeechBubble, vgtBubble, |
|
99 vgtSteam, vgtAmmo, vgtSmoke, vgtSmokeWhite, vgtHealth, vgtShell, |
|
100 vgtDust, vgtSplash, vgtDroplet, vgtSmokeRing, vgtBeeTrace, vgtEgg, |
|
101 vgtFeather, vgtHealthTag, vgtSmokeTrace, vgtEvilTrace, vgtExplosion, |
|
102 vgtBigExplosion, vgtChunk, vgtNote, vgtLineTrail, |
|
103 vgtBulletHit); |
|
104 |
|
105 TGearsType = set of TGearType; |
|
106 |
|
107 TDamageSource = (dsUnknown, dsFall, dsBullet, dsExplosion, dsShove, dsPoison); |
|
108 |
|
109 TSound = (sndNone, |
|
110 sndGrenadeImpact, sndExplosion, sndThrowPowerUp, sndThrowRelease, |
|
111 sndSplash, sndShotgunReload, sndShotgunFire, sndGraveImpact, |
|
112 sndMineTick, sndPickhammer, sndGun, sndBee, sndJump1, sndJump2, |
|
113 sndJump3, sndYesSir, sndLaugh, sndIllGetYou, sndIncoming, |
|
114 sndMissed, sndStupid, sndFirstBlood, sndBoring, sndByeBye, |
|
115 sndSameTeam, sndNutter, sndReinforce, sndTraitor, sndRegret, |
|
116 sndEnemyDown, sndCoward, sndHurry, sndWatchIt, sndKamikaze, |
|
117 sndCake, sndOw1, sndOw2, sndOw3, sndOw4, sndFirePunch1, sndFirePunch2, |
|
118 sndFirePunch3, sndFirePunch4, sndFirePunch5, sndFirePunch6, |
|
119 sndMelon, sndHellish, sndYoohoo, sndRCPlane, sndWhipCrack, |
|
120 sndRideOfTheValkyries, sndDenied, sndPlaced, sndBaseballBat, |
|
121 sndVaporize, sndWarp, sndSuddenDeath, sndMortar, sndShutter, |
|
122 sndHomerun, sndMolotov, sndCover, sndUhOh, sndOops, |
|
123 sndNooo, sndHello, sndRopeShot, sndRopeAttach, sndRopeRelease, |
|
124 sndSwitchHog, sndVictory, sndSniperReload, sndSteps, sndLowGravity, |
|
125 sndHellishImpact1, sndHellishImpact2, sndHellishImpact3, sndHellishImpact4, |
|
126 sndMelonImpact, sndDroplet1, sndDroplet2, sndDroplet3, sndEggBreak, sndDrillRocket, |
|
127 sndPoisonCough, sndPoisonMoan, sndBirdyLay, sndWhistle, sndBeeWater, |
|
128 sndPiano0, sndPiano1, sndPiano2, sndPiano3, sndPiano4, sndPiano5, sndPiano6, sndPiano7, sndPiano8, |
|
129 sndSkip, sndSineGun, sndOoff1, sndOoff2, sndOoff3, sndWhack, |
|
130 sndComeonthen, sndParachute, sndBump, sndResurrector); |
|
131 |
|
132 TAmmoType = (amNothing, amGrenade, amClusterBomb, amBazooka, amBee, amShotgun, amPickHammer, // 6 |
|
133 amSkip, amRope, amMine, amDEagle, amDynamite, amFirePunch, amWhip, // 13 |
|
134 amBaseballBat, amParachute, amAirAttack, amMineStrike, amBlowTorch, // 18 |
|
135 amGirder, amTeleport, amSwitch, amMortar, amKamikaze, amCake, // 24 |
|
136 amSeduction, amWatermelon, amHellishBomb, amNapalm, amDrill, amBallgun, // 30 |
|
137 amRCPlane, amLowGravity, amExtraDamage, amInvulnerable, amExtraTime, // 35 |
|
138 amLaserSight, amVampiric, amSniperRifle, amJetpack, amMolotov, amBirdy, amPortalGun, // 42 |
|
139 amPiano, amGasBomb, amSineGun, amFlamethrower, amSMine, amHammer, // 48 |
|
140 amResurrector, amDrillStrike); |
|
141 |
|
142 TCrateType = (HealthCrate, AmmoCrate, UtilityCrate); |
|
143 |
|
144 THWFont = (fnt16, fntBig, fntSmall {$IFNDEF IPHONEOS}, CJKfnt16, CJKfntBig, CJKfntSmall{$ENDIF}); |
|
145 |
|
146 TCapGroup = (capgrpGameState, capgrpAmmoinfo, capgrpVolume, |
|
147 capgrpMessage, capgrpAmmostate); |
|
148 |
|
149 TStatInfoType = (siGameResult, siMaxStepDamage, siMaxStepKills, siKilledHHs, |
|
150 siClanHealth, siTeamStats, siPlayerKills, siMaxTeamDamage, |
|
151 siMaxTeamKills, siMaxTurnSkips ); |
|
152 |
|
153 TWave = (waveRollup, waveSad, waveWave, waveHurrah, waveLemonade, waveShrug, waveJuggle); |
|
154 |
|
155 THHFont = record |
|
156 Handle: PTTF_Font; |
|
157 Height: LongInt; |
|
158 style: LongInt; |
|
159 Name: string[21]; |
|
160 end; |
|
161 |
|
162 PAmmo = ^TAmmo; |
|
163 TAmmo = record |
|
164 Propz: LongWord; |
|
165 Count: LongWord; |
|
166 (* Using for place hedgehogs mode, but for any other situation where the initial count would be needed I guess. |
|
167 For example, say, a mode where the weaponset is reset each turn, or on sudden death *) |
|
168 NumPerTurn: LongWord; |
|
169 Timer: LongWord; |
|
170 Pos: LongWord; |
|
171 AmmoType: TAmmoType; |
|
172 AttackVoice: TSound; |
|
173 end; |
|
174 |
|
175 TVertex2f = record |
|
176 X, Y: GLfloat; |
|
177 end; |
|
178 |
|
179 TVertex2i = record |
|
180 X, Y: GLint; |
|
181 end; |
|
182 |
|
183 PTexture = ^TTexture; |
|
184 TTexture = record |
|
185 id: GLuint; |
|
186 w, h, scale: LongInt; |
|
187 rx, ry: GLfloat; |
|
188 priority: GLfloat; |
|
189 vb, tb: array [0..3] of TVertex2f; |
|
190 PrevTexture, NextTexture: PTexture; |
|
191 end; |
|
192 |
|
193 THogEffect = (heInvulnerable, heResurrectable, hePoisoned, heResurrected); |
|
194 |
|
195 TScreenFade = (sfNone, sfInit, sfToBlack, sfFromBlack, sfToWhite, sfFromWhite); |
|
196 const |
32 const |
197 sfMax = 1000; |
33 sfMax = 1000; |
198 cDefaultParamNum = 16; |
34 cDefaultParamNum = 16; |
199 |
35 |
200 // message constants |
36 // message constants |