34 HwColor4f = record |
34 HwColor4f = record |
35 r, g, b, a: byte; |
35 r, g, b, a: byte; |
36 end; |
36 end; |
37 |
37 |
38 // Possible states of the game |
38 // Possible states of the game |
39 TGameState = (gsLandGen, gsStart, gsGame, gsChat, gsConfirm, gsExit, gsSuspend); |
39 TGameState = (gsLandGen, gsStart, gsGame, gsConfirm, gsExit, gsSuspend); |
40 |
40 |
41 // Game types that help determining what the engine is actually supposed to do |
41 // Game types that help determining what the engine is actually supposed to do |
42 TGameType = (gmtLocal, gmtDemo, gmtNet, gmtSave, gmtLandPreview, gmtSyntax, gmtRecord); |
42 TGameType = (gmtLocal, gmtDemo, gmtNet, gmtSave, gmtLandPreview, gmtBadSyntax, gmtRecord, gmtSyntaxHelp); |
43 |
43 |
44 // Different files are stored in different folders, this enumeration is used to tell which folder to use |
44 // Different files are stored in different folders, this enumeration is used to tell which folder to use |
45 TPathType = (ptNone, ptData, ptGraphics, ptThemes, ptCurrTheme, ptTeams, ptMaps, |
45 TPathType = (ptNone, ptData, ptGraphics, ptThemes, ptCurrTheme, ptConfig, ptTeams, ptMaps, |
46 ptMapCurrent, ptDemos, ptSounds, ptGraves, ptFonts, ptForts, |
46 ptMapCurrent, ptDemos, ptSounds, ptGraves, ptFonts, ptForts, ptLocale, |
47 ptLocale, ptAmmoMenu, ptHedgehog, ptVoices, ptHats, ptFlags, ptMissionMaps, ptSuddenDeath, ptButtons); |
47 ptAmmoMenu, ptHedgehog, ptVoices, ptHats, ptFlags, ptMissionMaps, |
|
48 ptSuddenDeath, ptButtons, ptShaders, ptDefaultVoice, ptMisc); |
48 |
49 |
49 // Available sprites for displaying stuff |
50 // Available sprites for displaying stuff |
50 TSprite = (sprWater, sprCloud, sprBomb, sprBigDigit, sprFrame, |
51 TSprite = (sprWater, sprCloud, sprBomb, sprBigDigit, sprBigDigitGray, sprBigDigitGreen, |
51 sprLag, sprArrow, sprBazookaShell, sprTargetP, sprBee, |
52 sprBigDigitRed, sprFrame, sprLag, sprArrow, sprBazookaShell, sprTargetP, sprBee, |
52 sprSmokeTrace, sprRopeHook, sprExplosion50, sprMineOff, |
53 sprSmokeTrace, sprRopeHook, sprExplosion50, sprMineOff, |
53 sprMineOn, sprMineDead, sprCase, sprFAid, sprDynamite, sprPower, |
54 sprMineOn, sprMineDead, sprCase, sprFAid, sprDynamite, sprPower, |
54 sprClusterBomb, sprClusterParticle, sprFlame, |
55 sprClusterBomb, sprClusterParticle, sprFlame, |
55 sprHorizont, sprHorizontL, sprHorizontR, sprSky, sprSkyL, sprSkyR, |
56 sprHorizont, sprHorizontL, sprHorizontR, sprSky, sprSkyL, sprSkyR, |
56 sprAMSlot, sprAMAmmos, sprAMAmmosBW, sprAMSlotKeys, sprAMCorners, |
57 sprAMSlot, sprAMAmmos, sprAMAmmosBW, sprAMSlotKeys, sprAMCorners, |
84 sprCheese, sprHandCheese, sprHandFlamethrower, sprChunk, sprNote, |
86 sprCheese, sprHandCheese, sprHandFlamethrower, sprChunk, sprNote, |
85 sprSMineOff, sprSMineOn, sprHandSMine, sprHammer, |
87 sprSMineOff, sprSMineOn, sprHandSMine, sprHammer, |
86 sprHandResurrector, sprCross, sprAirDrill, sprNapalmBomb, |
88 sprHandResurrector, sprCross, sprAirDrill, sprNapalmBomb, |
87 sprBulletHit, sprSnowball, sprHandSnowball, sprSnow, |
89 sprBulletHit, sprSnowball, sprHandSnowball, sprSnow, |
88 sprSDFlake, sprSDWater, sprSDCloud, sprSDSplash, sprSDDroplet, sprTardis, |
90 sprSDFlake, sprSDWater, sprSDCloud, sprSDSplash, sprSDDroplet, sprTardis, |
89 sprSlider, sprBotlevels, sprHandKnife, sprKnife, sprStar |
91 sprSlider, sprBotlevels, sprHandKnife, sprKnife, sprStar, sprIceTexture, sprIceGun, |
|
92 sprFrozenHog, sprAmRubber, sprBoing, sprCustom1, sprCustom2, sprCustom3, sprCustom4, |
|
93 sprCustom5, sprCustom6, sprCustom7, sprCustom8, sprFrozenAirMine, sprAirMine, sprHandAirMine, |
|
94 sprFlakeL, sprSDFlakeL, sprCloudL, sprSDCloudL, sprCreeper, sprHandCreeper, sprMinigun, |
|
95 sprSliderInverted, sprFingerBack, sprFingerBackInv, sprTargetPBack, sprTargetPBackInv, |
|
96 sprHealthHud, sprHealthPoisonHud, sprVampHud, sprKarmaHud, sprMedicHud, sprMedicPoisonHud, |
|
97 sprHaloHud, sprInvulnHUD, sprAmPiano, sprHandLandGun, sprFirePunch, sprThroughWrap |
90 ); |
98 ); |
91 |
99 |
92 // Gears that interact with other Gears and/or Land |
100 // Gears that interact with other Gears and/or Land |
93 TGearType = ({-->}gtFlame, gtHedgehog, gtMine, gtCase, gtExplosives, // <-- these are gears which should be avoided when searching a spawn place |
101 // first row of gears (<gtExplosives) should be avoided when searching a spawn place |
94 gtGrenade, gtShell, gtGrave, gtBee, // 8 |
102 TGearType = (gtFlame, gtHedgehog, gtMine, gtCase, gtAirMine, gtExplosives, |
95 gtShotgunShot, gtPickHammer, gtRope, // 11 |
103 gtGrenade, gtShell, gtGrave, gtBee, // 9 |
96 gtDEagleShot, gtDynamite, gtClusterBomb, gtCluster, gtShover, // 16 |
104 gtShotgunShot, gtPickHammer, gtRope, // 12 |
97 gtFirePunch, gtATStartGame, // 18 |
105 gtDEagleShot, gtDynamite, gtClusterBomb, gtCluster, gtShover, // 17 |
98 gtATFinishGame, gtParachute, gtAirAttack, gtAirBomb, gtBlowTorch, // 23 |
106 gtFirePunch, gtATStartGame, // 19 |
99 gtGirder, gtTeleport, gtSwitcher, gtTarget, gtMortar, // 28 |
107 gtATFinishGame, gtParachute, gtAirAttack, gtAirBomb, gtBlowTorch, // 24 |
100 gtWhip, gtKamikaze, gtCake, gtSeduction, gtWatermelon, gtMelonPiece, // 34 |
108 gtGirder, gtTeleport, gtSwitcher, gtTarget, gtMortar, // 29 |
101 gtHellishBomb, gtWaterUp, gtDrill, gtBallGun, gtBall, gtRCPlane, // 40 |
109 gtWhip, gtKamikaze, gtCake, gtSeduction, gtWatermelon, gtMelonPiece, // 35 |
102 gtSniperRifleShot, gtJetpack, gtMolotov, gtBirdy, // 44 |
110 gtHellishBomb, gtWaterUp, gtDrill, gtBallGun, gtBall, gtRCPlane, // 41 |
103 gtEgg, gtPortal, gtPiano, gtGasBomb, gtSineGunShot, gtFlamethrower, // 50 |
111 gtSniperRifleShot, gtJetpack, gtMolotov, gtBirdy, // 45 |
104 gtSMine, gtPoisonCloud, gtHammer, gtHammerHit, gtResurrector, // 55 |
112 gtEgg, gtPortal, gtPiano, gtGasBomb, gtSineGunShot, gtFlamethrower, // 51 |
105 gtNapalmBomb, gtSnowball, gtFlake, gtStructure, gtLandGun, gtTardis, // 61 |
113 gtSMine, gtPoisonCloud, gtHammer, gtHammerHit, gtResurrector, // 56 |
106 gtIceGun, gtAddAmmo, gtGenericFaller, gtKnife); // 65 |
114 gtNapalmBomb, gtSnowball, gtFlake, gtLandGun, gtTardis, // 61 |
|
115 gtIceGun, gtAddAmmo, gtGenericFaller, gtKnife, gtCreeper, gtMinigun, gtMinigunBullet); // 68 |
107 |
116 |
108 // Gears that are _only_ of visual nature (e.g. background stuff, visual effects, speechbubbles, etc.) |
117 // Gears that are _only_ of visual nature (e.g. background stuff, visual effects, speechbubbles, etc.) |
109 TVisualGearType = (vgtFlake, vgtCloud, vgtExplPart, vgtExplPart2, vgtFire, |
118 TVisualGearType = (vgtFlake, vgtCloud, vgtExplPart, vgtExplPart2, vgtFire, |
110 vgtSmallDamageTag, vgtTeamHealthSorter, vgtSpeechBubble, vgtBubble, |
119 vgtSmallDamageTag, vgtTeamHealthSorter, vgtSpeechBubble, vgtBubble, |
111 vgtSteam, vgtAmmo, vgtSmoke, vgtSmokeWhite, vgtShell, |
120 vgtSteam, vgtAmmo, vgtSmoke, vgtSmokeWhite, vgtShell, |
112 vgtDust, vgtSplash, vgtDroplet, vgtSmokeRing, vgtBeeTrace, vgtEgg, |
121 vgtDust, vgtSplash, vgtDroplet, vgtSmokeRing, vgtBeeTrace, vgtEgg, |
113 vgtFeather, vgtHealthTag, vgtSmokeTrace, vgtEvilTrace, vgtExplosion, |
122 vgtFeather, vgtHealthTag, vgtSmokeTrace, vgtEvilTrace, vgtExplosion, |
114 vgtBigExplosion, vgtChunk, vgtNote, vgtLineTrail, vgtBulletHit, vgtCircle, |
123 vgtBigExplosion, vgtChunk, vgtNote, vgtLineTrail, vgtBulletHit, vgtCircle, |
115 vgtSmoothWindBar, vgtStraightShot); |
124 vgtSmoothWindBar, vgtStraightShot, vgtNoPlaceWarn); |
116 |
125 |
117 // Damage can be caused by different sources |
126 // Damage can be caused by different sources |
118 TDamageSource = (dsUnknown, dsFall, dsBullet, dsExplosion, dsShove, dsPoison); |
127 TDamageSource = (dsUnknown, dsFall, dsBullet, dsExplosion, dsShove, dsPoison, dsHammer); |
119 |
128 |
120 // Available sounds |
129 // Available sounds |
121 TSound = (sndNone, |
130 TSound = (sndNone, |
122 sndGrenadeImpact, sndExplosion, sndThrowPowerUp, sndThrowRelease, |
131 sndGrenadeImpact, sndExplosion, sndThrowPowerUp, sndThrowRelease, |
123 sndSplash, sndShotgunReload, sndShotgunFire, sndGraveImpact, |
132 sndSplash, sndShotgunReload, sndShotgunFire, sndGraveImpact, |
124 sndMineImpact, sndMineTick, sndMudballImpact, |
133 sndMineImpact, sndMineTick, sndMudballImpact, |
125 sndPickhammer, sndGun, sndBee, sndJump1, sndJump2, |
134 sndPickhammer, sndGun, sndBee, sndJump1, sndJump2, |
126 sndJump3, sndYesSir, sndLaugh, sndIllGetYou, sndIncoming, |
135 sndJump3, sndYesSir, sndLaugh, sndIllGetYou, sndJustYouWait, sndIncoming, |
127 sndMissed, sndStupid, sndFirstBlood, sndBoring, sndByeBye, |
136 sndMissed, sndStupid, sndFirstBlood, sndBoring, sndByeBye, |
128 sndSameTeam, sndNutter, sndReinforce, sndTraitor, sndRegret, |
137 sndSameTeam, sndNutter, sndReinforce, sndTraitor, sndRegret, |
129 sndEnemyDown, sndCoward, sndHurry, sndWatchIt, sndKamikaze, |
138 sndEnemyDown, sndCoward, sndHurry, sndWatchIt, sndKamikaze, |
130 sndCake, sndOw1, sndOw2, sndOw3, sndOw4, sndFirePunch1, sndFirePunch2, |
139 sndCake, sndOw1, sndOw2, sndOw3, sndOw4, sndFirePunch1, sndFirePunch2, |
131 sndFirePunch3, sndFirePunch4, sndFirePunch5, sndFirePunch6, |
140 sndFirePunch3, sndFirePunch4, sndFirePunch5, sndFirePunch6, |
136 sndNooo, sndHello, sndRopeShot, sndRopeAttach, sndRopeRelease, |
145 sndNooo, sndHello, sndRopeShot, sndRopeAttach, sndRopeRelease, |
137 sndSwitchHog, sndVictory, sndFlawless, sndSniperReload, sndSteps, sndLowGravity, |
146 sndSwitchHog, sndVictory, sndFlawless, sndSniperReload, sndSteps, sndLowGravity, |
138 sndHellishImpact1, sndHellishImpact2, sndHellishImpact3, sndHellishImpact4, |
147 sndHellishImpact1, sndHellishImpact2, sndHellishImpact3, sndHellishImpact4, |
139 sndMelonImpact, sndDroplet1, sndDroplet2, sndDroplet3, sndEggBreak, sndDrillRocket, |
148 sndMelonImpact, sndDroplet1, sndDroplet2, sndDroplet3, sndEggBreak, sndDrillRocket, |
140 sndPoisonCough, sndPoisonMoan, sndBirdyLay, sndWhistle, sndBeeWater, |
149 sndPoisonCough, sndPoisonMoan, sndBirdyLay, sndWhistle, sndBeeWater, |
141 sndPiano0, sndPiano1, sndPiano2, sndPiano3, sndPiano4, sndPiano5, sndPiano6, sndPiano7, sndPiano8, |
150 sndPiano0, sndPiano1, sndPiano2, sndPiano3, sndPiano4, sndPiano5, sndPiano6, sndPiano7, |
142 sndSkip, sndSineGun, sndOoff1, sndOoff2, sndOoff3, sndWhack, |
151 sndPiano8, sndSkip, sndSineGun, sndOoff1, sndOoff2, sndOoff3, sndWhack, |
143 sndComeonthen, sndParachute, sndBump, sndResurrector, sndPlane, sndTardis); |
152 sndComeonthen, sndParachute, sndBump, sndResurrector, sndPlane, sndTardis, sndFrozenHogImpact, |
|
153 sndIceBeam, sndHogFreeze, sndAirMineImpact, sndKnifeImpact, sndExtraTime, sndLaserSight, |
|
154 sndInvulnerable, sndJetpackLaunch, sndJetpackBoost, sndPortalShot, sndPortalSwitch, |
|
155 sndPortalOpen, sndBlowTorch, sndCountdown1, sndCountdown2, sndCountdown3, sndCountdown4, |
|
156 sndCreeperDrop, sndCreeperWater, sndCreeperDie, sndCustom1, sndCustom2, sndCustom3, sndCustom4, |
|
157 sndCustom5, sndCustom6, sndCustom7, sndCustom8, sndMinigun, sndFlamethrower, sndIceBeamIdle, |
|
158 sndLandGun, sndCaseImpact, sndExtraDamage, sndFirePunchHit, sndGrenade, sndThisOneIsMine, |
|
159 sndWhatThe, sndSoLong, sndOhDear, sndGonnaGetYou, sndDrat, sndBugger, sndAmazing, |
|
160 sndBrilliant, sndExcellent, sndFire, sndWatchThis, sndRunAway, sndRevenge, sndCutItOut, |
|
161 sndLeaveMeAlone, sndOuch, sndHmm, sndKiss, sndFlyAway, sndPlaneWater); |
144 |
162 |
145 // Available ammo types to be used by hedgehogs |
163 // Available ammo types to be used by hedgehogs |
146 TAmmoType = (amNothing, amGrenade, amClusterBomb, amBazooka, amBee, amShotgun, amPickHammer, // 6 |
164 TAmmoType = (amNothing, amGrenade, amClusterBomb, amBazooka, amBee, amShotgun, amPickHammer, // 6 |
147 amSkip, amRope, amMine, amDEagle, amDynamite, amFirePunch, amWhip, // 13 |
165 amSkip, amRope, amMine, amDEagle, amDynamite, amFirePunch, amWhip, // 13 |
148 amBaseballBat, amParachute, amAirAttack, amMineStrike, amBlowTorch, // 18 |
166 amBaseballBat, amParachute, amAirAttack, amMineStrike, amBlowTorch, // 18 |
149 amGirder, amTeleport, amSwitch, amMortar, amKamikaze, amCake, // 24 |
167 amGirder, amTeleport, amSwitch, amMortar, amKamikaze, amCake, // 24 |
150 amSeduction, amWatermelon, amHellishBomb, amNapalm, amDrill, amBallgun, // 30 |
168 amSeduction, amWatermelon, amHellishBomb, amNapalm, amDrill, amBallgun, // 30 |
151 amRCPlane, amLowGravity, amExtraDamage, amInvulnerable, amExtraTime, // 35 |
169 amRCPlane, amLowGravity, amExtraDamage, amInvulnerable, amExtraTime, // 35 |
152 amLaserSight, amVampiric, amSniperRifle, amJetpack, amMolotov, amBirdy, amPortalGun, // 42 |
170 amLaserSight, amVampiric, amSniperRifle, amJetpack, amMolotov, amBirdy, amPortalGun, // 42 |
153 amPiano, amGasBomb, amSineGun, amFlamethrower, amSMine, amHammer, // 48 |
171 amPiano, amGasBomb, amSineGun, amFlamethrower, amSMine, amHammer, // 48 |
154 amResurrector, amDrillStrike, amSnowball, amTardis, amStructure, amLandGun, amIceGun, amKnife); // 54 |
172 amResurrector, amDrillStrike, amSnowball, amTardis, amLandGun, // 53 |
|
173 amIceGun, amKnife, amRubber, amAirMine, amCreeper, amMinigun); // 59 |
|
174 // NOTE: If we ever reach 126 ammo types, make sure to skip ammo type number 126 because it's |
|
175 // reserved as synonym for amNothing. See also chSetWeapon. |
155 |
176 |
156 // Different kind of crates that e.g. hedgehogs can pick up |
177 // Different kind of crates that e.g. hedgehogs can pick up |
157 TCrateType = (HealthCrate, AmmoCrate, UtilityCrate); |
178 TCrateType = (HealthCrate, AmmoCrate, UtilityCrate); |
158 |
179 |
159 THWFont = (fnt16, fntBig, fntSmall {$IFNDEF MOBILE}, CJKfnt16, CJKfntBig, CJKfntSmall{$ENDIF}); |
180 THWFont = (fnt16, fntBig, fntSmall {$IFNDEF MOBILE}, CJKfnt16, CJKfntBig, CJKfntSmall{$ENDIF}); |
161 TCapGroup = (capgrpGameState, capgrpAmmoinfo, capgrpVolume, |
182 TCapGroup = (capgrpGameState, capgrpAmmoinfo, capgrpVolume, |
162 capgrpMessage, capgrpMessage2, capgrpAmmostate); |
183 capgrpMessage, capgrpMessage2, capgrpAmmostate); |
163 |
184 |
164 TStatInfoType = (siGameResult, siMaxStepDamage, siMaxStepKills, siKilledHHs, |
185 TStatInfoType = (siGameResult, siMaxStepDamage, siMaxStepKills, siKilledHHs, |
165 siClanHealth, siTeamStats, siPlayerKills, siMaxTeamDamage, |
186 siClanHealth, siTeamStats, siPlayerKills, siMaxTeamDamage, |
166 siMaxTeamKills, siMaxTurnSkips ); |
187 siMaxTeamKills, siMaxTurnSkips, siCustomAchievement, siGraphTitle, |
167 |
188 siPointType, siTeamRank, siEverAfter); |
168 // Various "emote" animations a hedgehog can do |
189 |
|
190 // Various 'emote' animations a hedgehog can do |
169 TWave = (waveRollup, waveSad, waveWave, waveHurrah, waveLemonade, waveShrug, waveJuggle); |
191 TWave = (waveRollup, waveSad, waveWave, waveHurrah, waveLemonade, waveShrug, waveJuggle); |
170 |
192 |
171 TRenderMode = (rmDefault, rmLeftEye, rmRightEye); |
193 TRenderMode = (rmDefault, rmLeftEye, rmRightEye); |
172 TStereoMode = (smNone, smRedCyan, smCyanRed, smRedBlue, smBlueRed, smRedGreen, smGreenRed, smHorizontal, smVertical, smAFR); |
194 TStereoMode = (smNone, smRedCyan, smCyanRed, smRedBlue, smBlueRed, smRedGreen, smGreenRed, smHorizontal, smVertical); |
|
195 TWorldEdge = (weNone, weWrap, weBounce, weSea, weSky); |
|
196 TUIDisplay = (uiAll, uiNoTeams, uiNone); |
|
197 TMapGen = (mgRandom, mgMaze, mgPerlin, mgDrawn, mgForts); |
|
198 |
173 |
199 |
174 THHFont = record |
200 THHFont = record |
175 Handle: PTTF_Font; |
201 Handle: PTTF_Font; |
176 Height: LongInt; |
202 Height: LongInt; |
177 style: LongInt; |
203 style: LongInt; |
208 priority: GLfloat; |
236 priority: GLfloat; |
209 vb, tb: array [0..3] of TVertex2f; |
237 vb, tb: array [0..3] of TVertex2f; |
210 PrevTexture, NextTexture: PTexture; |
238 PrevTexture, NextTexture: PTexture; |
211 end; |
239 end; |
212 |
240 |
213 THogEffect = (heInvulnerable, heResurrectable, hePoisoned, heResurrected, heFrozen); |
241 THogEffect = (heInvulnerable, heResurrectable, hePoisoned, heResurrected, heFrozen, heArtillery); |
214 |
242 |
215 TScreenFade = (sfNone, sfInit, sfToBlack, sfFromBlack, sfToWhite, sfFromWhite); |
243 TScreenFade = (sfNone, sfInit, sfToBlack, sfFromBlack, sfToWhite, sfFromWhite); |
216 |
244 |
217 PGear = ^TGear; |
245 PGear = ^TGear; |
218 PHedgehog = ^THedgehog; |
246 PHedgehog = ^THedgehog; |
219 PTeam = ^TTeam; |
247 PTeam = ^TTeam; |
220 PClan = ^TClan; |
248 PClan = ^TClan; |
221 |
249 |
222 TGearStepProcedure = procedure (Gear: PGear); |
250 TGearStepProcedure = procedure (Gear: PGear); |
|
251 // So, you are here looking for variables you can (ab)use to store some gear state? |
|
252 // Not all members of this structure are created equal. Comments below are my take on what can be used for what in the gear structure. |
223 TGear = record |
253 TGear = record |
224 NextGear, PrevGear: PGear; |
254 // Do *not* ever override these. |
225 Active: Boolean; |
255 NextGear, PrevGear: PGear; // Linked list |
226 AdvBounce: Longword; |
256 Z: Longword; // Z index. For rendering. Sets order in list |
227 Invulnerable: Boolean; |
257 Active: Boolean; // Is gear Active (running step code) |
228 RenderTimer: Boolean; |
258 Kind: TGearType; |
229 AmmoType : TAmmoType; |
259 doStep: TGearStepProcedure; // Code the gear is running |
230 State : Longword; |
260 AmmoType : TAmmoType; // Ammo type associated with this kind of gear |
231 X : hwFloat; |
261 RenderTimer: Boolean; // Will visually display Timer if true |
|
262 RenderHealth: Boolean; // Will visually display Health if true |
|
263 Target : TPoint; // Gear target. Will render in uGearsRender unless a special case is added |
|
264 AIHints: LongWord; // hints for ai. |
|
265 LastDamage: PHedgehog; // Used to track damage source for stats |
|
266 CollisionIndex: LongInt; // Position in collision array |
|
267 Message: LongWord; // Game messages are stored here. See gm bitmasks in uConsts |
|
268 uid: Longword; // Lua use this to reference gears |
|
269 Hedgehog: PHedgehog; // set to CurrentHedgehog on gear creation. uStats damage code appears to assume it will never be nil and never be changed. If you override it, make sure it is set to a non-nil PHedgehog before dealing damage. |
|
270 // Strongly recommended not to override these. Will mess up generic operations like portaling |
|
271 X : hwFloat; // X/Y/dX/dY are position/velocity. People count on these having semi-normal values |
232 Y : hwFloat; |
272 Y : hwFloat; |
233 dX: hwFloat; |
273 dX: hwFloat; |
234 dY: hwFloat; |
274 dY: hwFloat; |
235 Target : TPoint; |
275 State : Longword; // See gst bitmask values in uConsts |
236 Kind: TGearType; |
276 PortalCounter: LongWord; // Necessary to interrupt portal loops. Not possible to avoid infinite loops without it. |
237 Pos: Longword; |
277 // Don't use these if you're using generic movement like doStepFallingGear and explosion shoves. Generally recommended not to use. |
238 doStep: TGearStepProcedure; |
278 Radius: LongInt; // Radius. If not using uCollisions, is usually used to indicate area of effect |
239 Radius: LongInt; |
279 CollisionMask: Word; // Masking off Land impact FF7F for example ignores current hog and crates |
240 Angle, Power : Longword; |
280 AdvBounce: Longword; // Triggers 45 bounces. Is a counter to avoid edge cases |
241 DirAngle: real; |
281 Sticky: Boolean; // True if gear is *normally* able to stick to landscape on impact |
242 Timer : LongWord; |
|
243 Elasticity: hwFloat; |
282 Elasticity: hwFloat; |
244 Friction : hwFloat; |
283 Friction : hwFloat; |
245 Density : hwFloat; |
284 Density : hwFloat; // Density is kind of a mix of size and density. Impacts distance thrown, wind. |
246 Message, MsgParam : Longword; |
285 ImpactSound: TSound; // first sound, others have to be after it in the sounds def. |
247 Hedgehog: PHedgehog; |
286 nImpactSounds: Word; // count of ImpactSounds. |
|
287 // Don't use these if you want to take damage normally, otherwise health/damage are commonly used for other purposes |
248 Health, Damage, Karma: LongInt; |
288 Health, Damage, Karma: LongInt; |
249 CollisionIndex: LongInt; |
289 // DirAngle is a 'real' - if you do not need it for rotation of sprite in uGearsRender, you can use it for any visual-only value |
250 Tag: LongInt; |
290 DirAngle: real; |
251 Tex: PTexture; |
291 // These are frequently overridden to serve some other purpose |
252 Z: Longword; |
292 Boom: Longword; // amount of damage caused by the gear |
253 CollisionMask: Word; |
293 Pos: Longword; // Commonly overridden. Example use is posCase values in uConsts. |
254 LinkedGear: PGear; |
294 Angle, Power : Longword; // Used for hog aiming/firing. Angle is rarely used as an Angle otherwise. |
255 FlightTime: Longword; |
295 Timer, WDTimer : LongWord; // Typically used for some sort of gear timer. Time to explosion, remaining fuel... |
256 uid: Longword; |
296 Tag: LongInt; // Quite generic. Variety of uses. |
257 ImpactSound: TSound; // first sound, others have to be after it in the sounds def. |
297 FlightTime: Longword; // Initially added for batting of hogs to determine homerun. Used for some firing delays |
258 nImpactSounds: Word; // count of ImpactSounds |
298 MsgParam: LongWord; // Initially stored a set of messages. So usually gm values like Message. Frequently overriden |
259 SoundChannel: LongInt; |
299 // These are not used generically, but should probably be used for purpose intended. Definitely shouldn't override pointer type |
260 PortalCounter: LongWord; // Hopefully temporary, but avoids infinite portal loops in a guaranteed fashion. |
300 Tex: PTexture; // A texture created by the gear. Shouldn't use for anything but textures |
261 LastDamage: PHedgehog; |
301 Tint: LongWord; // Used to colour a texture |
|
302 LinkedGear: PGear; // Used to track a related gear. Portal pairs for example. |
|
303 SoundChannel: LongInt; // Used to track a sound the gear started |
|
304 Data: Pointer; // pointer to gear type specific data structure (if any) |
262 end; |
305 end; |
263 TPGearArray = array of PGear; |
306 TPGearArray = array of PGear; |
264 PGearArrayS = record |
307 PGearArrayS = record |
265 size: LongWord; |
308 size: LongWord; |
266 ar: ^TPGearArray; |
309 ar: ^TPGearArray; |
352 stats: TStatistics; |
418 stats: TStatistics; |
353 Hat: shortstring; |
419 Hat: shortstring; |
354 InitialHealth: LongInt; // used for gfResetHealth |
420 InitialHealth: LongInt; // used for gfResetHealth |
355 King: boolean; // Flag for a bunch of hedgehog attributes |
421 King: boolean; // Flag for a bunch of hedgehog attributes |
356 Unplaced: boolean; // Flag for hog placing mode |
422 Unplaced: boolean; // Flag for hog placing mode |
|
423 UnplacedKing: boolean; // Flag for king placing phase in King Mode |
357 Timer: Longword; |
424 Timer: Longword; |
|
425 HealthBarHealth: LongInt; |
358 Effects: array[THogEffect] of LongInt; |
426 Effects: array[THogEffect] of LongInt; |
|
427 RevengeHog: PHedgehog; // For which hog this hog wants revenge most. For sndRevenge taunt |
|
428 FlownOffMap: boolean; // When hedgehog has flown far away off the map left or right |
359 end; |
429 end; |
360 |
430 |
361 TTeam = record |
431 TTeam = record |
362 Clan: PClan; |
432 Clan: PClan; |
363 TeamName: shortstring; |
433 TeamName: shortstring; |
364 ExtDriven: boolean; |
434 ExtDriven: boolean; |
365 Binds: TBinds; |
435 Binds: TBinds; |
366 Hedgehogs: array[0..cMaxHHIndex] of THedgehog; |
436 Hedgehogs: array[0..cMaxHHIndex] of THedgehog; |
367 CurrHedgehog: LongWord; |
437 CurrHedgehog: LongWord; |
368 NameTagTex: PTexture; |
438 NameTagTex, |
369 CrosshairTex, |
439 OwnerTex, |
370 GraveTex, |
440 GraveTex, |
371 HealthTex, |
|
372 AIKillsTex, |
441 AIKillsTex, |
|
442 LuaTeamValueTex, |
373 FlagTex: PTexture; |
443 FlagTex: PTexture; |
374 Flag: shortstring; |
444 Flag: shortstring; |
375 GraveName: shortstring; |
445 GraveName: shortstring; |
376 FortName: shortstring; |
446 FortName: shortstring; |
|
447 Owner: shortstring; |
377 TeamHealth: LongInt; |
448 TeamHealth: LongInt; |
378 TeamHealthBarWidth, |
449 TeamHealthBarHealth: LongInt; |
379 NewTeamHealthBarWidth: LongInt; |
|
380 DrawHealthY: LongInt; |
450 DrawHealthY: LongInt; |
381 AttackBar: LongWord; |
451 AttackBar: LongWord; |
382 HedgehogsNumber: Longword; |
452 HedgehogsNumber: Longword; |
383 hasGone: boolean; |
|
384 voicepack: PVoicepack; |
453 voicepack: PVoicepack; |
385 PlayerHash: shortstring; // md5 hash of player name. For temporary enabling of hats as thank you. Hashed for privacy of players |
454 PlayerHash: shortstring; // md5 hash of player name. For temporary enabling of hats as thank you. Hashed for privacy of players |
386 stats: TTeamStats; |
455 stats: TTeamStats; |
|
456 Passive: boolean; // if true, team will not participate in game. It is treated as if all its hedgehogs are frozen. |
|
457 // updating this value requires updating Passive in TClan as well! |
|
458 hasKing: boolean; // true if team has a living king |
|
459 hasGone: boolean; |
|
460 skippedTurns: Longword; |
|
461 isGoneFlagPendingToBeSet, isGoneFlagPendingToBeUnset: boolean; |
|
462 luaTeamValue: ansistring; |
|
463 hasLuaTeamValue: boolean; |
387 end; |
464 end; |
388 |
465 |
389 TClan = record |
466 TClan = record |
390 Color: Longword; |
467 Color: Longword; |
391 Teams: array[0..Pred(cMaxTeams)] of PTeam; |
468 Teams: array[0..Pred(cMaxTeams)] of PTeam; |
|
469 HealthTex: PTexture; |
392 TeamsNumber: Longword; |
470 TeamsNumber: Longword; |
393 TagTeamIndex: Longword; |
471 TagTeamIndex: Longword; |
394 CurrTeam: LongWord; |
472 CurrTeam: LongWord; |
395 ClanHealth: LongInt; |
473 ClanHealth: LongInt; |
396 ClanIndex: LongInt; |
474 ClanIndex: LongInt; |
397 TurnNumber: LongWord; |
475 TurnNumber: LongWord; |
|
476 DeathLogged: boolean; // true if clan is dead and its latest death has been logged in the clan death log |
|
477 StatsHandled : boolean; // true if clan's rank has been handled for stats screen |
398 Flawless: boolean; |
478 Flawless: boolean; |
399 end; |
479 Passive: boolean; // informational. Must be set to true if all of the teams are passive |
|
480 LocalOrAlly: boolean; // true if at least 1 team in the clan is a local team. A local team is a non-extdriven team controlled by a human |
|
481 end; |
|
482 |
|
483 cdeclPtr = procedure; cdecl; |
|
484 cdeclIntPtr = procedure(num: LongInt); cdecl; |
|
485 funcDoublePtr = function: Double; |
|
486 |
|
487 TMobileRecord = record |
|
488 PerformRumble: cdeclIntPtr; |
|
489 GameLoading: cdeclPtr; |
|
490 GameLoaded: cdeclPtr; |
|
491 SaveLoadingEnded: cdeclPtr; |
|
492 end; |
400 |
493 |
401 TAmmoStrId = (sidGrenade, sidClusterBomb, sidBazooka, sidBee, sidShotgun, |
494 TAmmoStrId = (sidGrenade, sidClusterBomb, sidBazooka, sidBee, sidShotgun, |
402 sidPickHammer, sidSkip, sidRope, sidMine, sidDEagle, |
495 sidPickHammer, sidSkip, sidRope, sidMine, sidDEagle, |
403 sidDynamite, sidBaseballBat, sidFirePunch, sidSeconds, |
496 sidDynamite, sidBaseballBat, sidFirePunch, sidSeconds, |
404 sidParachute, sidAirAttack, sidMineStrike, sidBlowTorch, |
497 sidParachute, sidAirAttack, sidMineStrike, sidBlowTorch, |
408 sidLowGravity, sidExtraDamage, sidInvulnerable, sidExtraTime, |
501 sidLowGravity, sidExtraDamage, sidInvulnerable, sidExtraTime, |
409 sidLaserSight, sidVampiric, sidSniperRifle, sidJetpack, |
502 sidLaserSight, sidVampiric, sidSniperRifle, sidJetpack, |
410 sidMolotov, sidBirdy, sidPortalGun, sidPiano, sidGasBomb, |
503 sidMolotov, sidBirdy, sidPortalGun, sidPiano, sidGasBomb, |
411 sidSineGun, sidFlamethrower,sidSMine, sidHammer, sidResurrector, |
504 sidSineGun, sidFlamethrower,sidSMine, sidHammer, sidResurrector, |
412 sidDrillStrike, sidSnowball, sidNothing, sidTardis, |
505 sidDrillStrike, sidSnowball, sidNothing, sidTardis, |
413 sidStructure, sidLandGun, sidIceGun, sidKnife); |
506 sidLandGun, sidIceGun, sidKnife, sidRubber, sidAirMine, |
414 |
507 sidCreeper, sidMinigun); |
415 TMsgStrId = (sidStartFight, sidDraw, sidWinner, sidVolume, sidPaused, |
508 |
|
509 TMsgStrId = (sidLoading, sidDraw, sidWinner, sidVolume, sidPaused, |
416 sidConfirm, sidSuddenDeath, sidRemaining, sidFuel, sidSync, |
510 sidConfirm, sidSuddenDeath, sidRemaining, sidFuel, sidSync, |
417 sidNoEndTurn, sidNotYetAvailable, sidRoundSD, sidRoundsSD, sidReady, |
511 sidNoEndTurn, sidNotYetAvailable, sidRoundSD, sidRoundsSD, sidReady, |
418 sidBounce1, sidBounce2, sidBounce3, sidBounce4, sidBounce5, sidBounce, |
512 sidBounce1, sidBounce2, sidBounce3, sidBounce4, sidBounce5, sidBounce, |
419 sidMute); |
513 sidMute, sidAFK, sidAutoCameraOff, sidAutoCameraOn, sidPressTarget, |
|
514 sidNotAvailableInSD, sidHealthGain, sidEmptyCrate, sidUnknownKey, |
|
515 sidWinner2, sidWinner3, sidWinner4, sidWinner5, sidWinner6, |
|
516 sidWinner7, sidWinnerAll, sidTeamGone, sidTeamBack, sidAutoSkip, |
|
517 sidFPS, sidLuaParsingOff, sidLuaParsingOn, sidLuaParsingDenied, |
|
518 sidAmmoCount, sidChat, sidChatTeam, sidChatHog, sidUnknownGearValue); |
|
519 |
|
520 TCmdHelpStrId = ( |
|
521 sidCmdHeaderBasic, sidCmdTogglechat, sidCmdTeam, sidCmdMe, |
|
522 sidCmdPause, sidCmdPauseNet, sidCmdFullscreen, sidCmdQuit, |
|
523 sidCmdHelp, sidCmdHelpTaunts, sidCmdHistory, sidLua, |
|
524 |
|
525 sidCmdHeaderTaunts, sidCmdSpeech, sidCmdThink, sidCmdYell, |
|
526 sidCmdSpeechNumberHint, sidCmdHsa, sidCmdHta, sidCmdHya, |
|
527 sidCmdHurrah, sidCmdIlovelotsoflemonade, sidCmdJuggle, |
|
528 sidCmdRollup, sidCmdShrug, sidCmdWave, sidCmdUnknown, |
|
529 sidCmdHelpRoom, sidCmdHelpRoomFail); |
420 |
530 |
421 // Events that are important for the course of the game or at least interesting for other reasons |
531 // Events that are important for the course of the game or at least interesting for other reasons |
422 TEventId = (eidDied, eidDrowned, eidRoundStart, eidRoundWin, eidRoundDraw, |
532 TEventId = (eidDied, eidDrowned, eidRoundStart, eidRoundWin, eidRoundDraw, |
423 eidNewHealthPack, eidNewAmmoPack, eidNewUtilityPack, eidTurnSkipped, |
533 eidNewHealthPack, eidNewAmmoPack, eidNewUtilityPack, eidTurnSkipped, |
424 eidHurtSelf, eidHomerun, eidGone); |
534 eidHurtSelf, eidHomerun, eidGone, eidPoisoned, eidResurrected, |
425 |
535 eidKamikaze, eidTimeTravelEnd, eidTimeout, eidKingDied); |
426 TGoalStrId = (gidCaption, gidSubCaption, gidForts, gidLowGravity, gidInvulnerable, |
536 |
|
537 TGoalStrId = (gidCaption, gidSubCaption, gidPlaceKing, gidLowGravity, gidInvulnerable, |
427 gidVampiric, gidKarma, gidKing, gidPlaceHog, gidArtillery, |
538 gidVampiric, gidKarma, gidKing, gidPlaceHog, gidArtillery, |
428 gidSolidLand, gidSharedAmmo, gidMineTimer, gidNoMineTimer, |
539 gidSolidLand, gidSharedAmmo, gidMineTimer, gidNoMineTimer, |
429 gidRandomMineTimer, gidDamageModifier, gidResetHealth, gidAISurvival, |
540 gidRandomMineTimer, gidDamageModifier, gidResetHealth, gidAISurvival, |
430 gidInfAttack, gidResetWeps, gidPerHogAmmo, gidTagTeam); |
541 gidInfAttack, gidResetWeps, gidPerHogAmmo, gidTagTeam, gidMoreWind); |
|
542 |
431 |
543 |
432 TLandArray = packed array of array of LongWord; |
544 TLandArray = packed array of array of LongWord; |
433 TCollisionArray = packed array of array of Word; |
545 TCollisionArray = packed array of array of Word; |
|
546 TDirtyTag = packed array of array of byte; |
|
547 |
434 TPreview = packed array[0..127, 0..31] of byte; |
548 TPreview = packed array[0..127, 0..31] of byte; |
435 TDirtyTag = packed array of array of byte; |
549 TPreviewAlpha = packed array[0..127, 0..255] of byte; |
436 |
550 |
437 PWidgetMovement = ^TWidgetMovement; |
551 PWidgetMovement = ^TWidgetMovement; |
438 TWidgetMovement = record |
552 TWidgetMovement = record |
439 animate : Boolean; |
553 animate : Boolean; |
440 source : TPoint; |
554 source : TPoint; |