hedgewars/uTypes.pas
changeset 5125 715cf3f2b342
parent 5118 9cfdb9bc6140
child 5137 b6140f35735f
equal deleted inserted replaced
5124:84267f79879b 5125:715cf3f2b342
    17  *)
    17  *)
    18 
    18 
    19 {$INCLUDE "options.inc"}
    19 {$INCLUDE "options.inc"}
    20 
    20 
    21 unit uTypes;
    21 unit uTypes;
       
    22 (*
       
    23  * This unit defines various types and enumerations for usage in different
       
    24  * places in the engine code.
       
    25  *)
    22 interface
    26 interface
    23 
    27 
    24 uses SDLh, uFloat, GLunit, uConsts, Math;
    28 uses SDLh, uFloat, GLunit, uConsts, Math;
    25 
    29 
    26 // NOTE: typed const is a variable despite const qualifier
    30 // NOTE: typed const is a variable despite const qualifier
    29 type
    33 type
    30     HwColor4f = record
    34     HwColor4f = record
    31         r, g, b, a: byte
    35         r, g, b, a: byte
    32         end;
    36         end;
    33 
    37 
       
    38     // Possible states of the game
    34     TGameState = (gsLandGen, gsStart, gsGame, gsChat, gsConfirm, gsExit, gsSuspend);
    39     TGameState = (gsLandGen, gsStart, gsGame, gsChat, gsConfirm, gsExit, gsSuspend);
    35 
    40 
       
    41     // Game types that help determining what the engine is actually supposed to do
    36     TGameType = (gmtLocal, gmtDemo, gmtNet, gmtSave, gmtLandPreview, gmtSyntax);
    42     TGameType = (gmtLocal, gmtDemo, gmtNet, gmtSave, gmtLandPreview, gmtSyntax);
    37 
    43 
       
    44     // Different files are stored in different folders, this enumeration is used to tell which folder to use
    38     TPathType = (ptNone, ptData, ptGraphics, ptThemes, ptCurrTheme, ptTeams, ptMaps,
    45     TPathType = (ptNone, ptData, ptGraphics, ptThemes, ptCurrTheme, ptTeams, ptMaps,
    39             ptMapCurrent, ptDemos, ptSounds, ptGraves, ptFonts, ptForts,
    46             ptMapCurrent, ptDemos, ptSounds, ptGraves, ptFonts, ptForts,
    40             ptLocale, ptAmmoMenu, ptHedgehog, ptVoices, ptHats, ptFlags, ptMissionMaps, ptSuddenDeath);
    47             ptLocale, ptAmmoMenu, ptHedgehog, ptVoices, ptHats, ptFlags, ptMissionMaps, ptSuddenDeath);
    41 
    48 
       
    49     // Available sprites for displaying stuff
    42     TSprite = (sprWater, sprCloud, sprBomb, sprBigDigit, sprFrame,
    50     TSprite = (sprWater, sprCloud, sprBomb, sprBigDigit, sprFrame,
    43             sprLag, sprArrow, sprBazookaShell, sprTargetP, sprBee,
    51             sprLag, sprArrow, sprBazookaShell, sprTargetP, sprBee,
    44             sprSmokeTrace, sprRopeHook, sprExplosion50, sprMineOff,
    52             sprSmokeTrace, sprRopeHook, sprExplosion50, sprMineOff,
    45             sprMineOn, sprMineDead, sprCase, sprFAid, sprDynamite, sprPower,
    53             sprMineOn, sprMineDead, sprCase, sprFAid, sprDynamite, sprPower,
    46             sprClusterBomb, sprClusterParticle, sprFlame, sprHorizont,
    54             sprClusterBomb, sprClusterParticle, sprFlame, sprHorizont,
    99             vgtFeather, vgtHealthTag, vgtSmokeTrace, vgtEvilTrace, vgtExplosion,
   107             vgtFeather, vgtHealthTag, vgtSmokeTrace, vgtEvilTrace, vgtExplosion,
   100             vgtBigExplosion, vgtChunk, vgtNote, vgtLineTrail, vgtBulletHit, vgtCircle);
   108             vgtBigExplosion, vgtChunk, vgtNote, vgtLineTrail, vgtBulletHit, vgtCircle);
   101 
   109 
   102     TGearsType = set of TGearType;
   110     TGearsType = set of TGearType;
   103 
   111 
       
   112     // Damage can be caused by different sources
   104     TDamageSource = (dsUnknown, dsFall, dsBullet, dsExplosion, dsShove, dsPoison);
   113     TDamageSource = (dsUnknown, dsFall, dsBullet, dsExplosion, dsShove, dsPoison);
   105 
   114 
       
   115     // Available sounds
   106     TSound = (sndNone,
   116     TSound = (sndNone,
   107             sndGrenadeImpact, sndExplosion, sndThrowPowerUp, sndThrowRelease,
   117             sndGrenadeImpact, sndExplosion, sndThrowPowerUp, sndThrowRelease,
   108             sndSplash, sndShotgunReload, sndShotgunFire, sndGraveImpact,
   118             sndSplash, sndShotgunReload, sndShotgunFire, sndGraveImpact,
   109             sndMineTick, sndPickhammer, sndGun, sndBee, sndJump1, sndJump2,
   119             sndMineTick, sndPickhammer, sndGun, sndBee, sndJump1, sndJump2,
   110             sndJump3, sndYesSir, sndLaugh, sndIllGetYou, sndIncoming,
   120             sndJump3, sndYesSir, sndLaugh, sndIllGetYou, sndIncoming,
   124             sndPoisonCough, sndPoisonMoan, sndBirdyLay, sndWhistle, sndBeeWater,
   134             sndPoisonCough, sndPoisonMoan, sndBirdyLay, sndWhistle, sndBeeWater,
   125             sndPiano0, sndPiano1, sndPiano2, sndPiano3, sndPiano4, sndPiano5, sndPiano6, sndPiano7, sndPiano8,
   135             sndPiano0, sndPiano1, sndPiano2, sndPiano3, sndPiano4, sndPiano5, sndPiano6, sndPiano7, sndPiano8,
   126             sndSkip, sndSineGun, sndOoff1, sndOoff2, sndOoff3, sndWhack,
   136             sndSkip, sndSineGun, sndOoff1, sndOoff2, sndOoff3, sndWhack,
   127             sndComeonthen, sndParachute, sndBump, sndResurrector, sndPlane);
   137             sndComeonthen, sndParachute, sndBump, sndResurrector, sndPlane);
   128 
   138 
       
   139     // Available ammo types to be used by hedgehogs
   129     TAmmoType  = (amNothing, amGrenade, amClusterBomb, amBazooka, amBee, amShotgun, amPickHammer, // 6
   140     TAmmoType  = (amNothing, amGrenade, amClusterBomb, amBazooka, amBee, amShotgun, amPickHammer, // 6
   130             amSkip, amRope, amMine, amDEagle, amDynamite, amFirePunch, amWhip, // 13
   141             amSkip, amRope, amMine, amDEagle, amDynamite, amFirePunch, amWhip, // 13
   131             amBaseballBat, amParachute, amAirAttack, amMineStrike, amBlowTorch, // 18
   142             amBaseballBat, amParachute, amAirAttack, amMineStrike, amBlowTorch, // 18
   132             amGirder, amTeleport, amSwitch, amMortar, amKamikaze, amCake, // 24
   143             amGirder, amTeleport, amSwitch, amMortar, amKamikaze, amCake, // 24
   133             amSeduction, amWatermelon, amHellishBomb, amNapalm, amDrill, amBallgun, // 30
   144             amSeduction, amWatermelon, amHellishBomb, amNapalm, amDrill, amBallgun, // 30
   134             amRCPlane, amLowGravity, amExtraDamage, amInvulnerable, amExtraTime, // 35
   145             amRCPlane, amLowGravity, amExtraDamage, amInvulnerable, amExtraTime, // 35
   135             amLaserSight, amVampiric, amSniperRifle, amJetpack, amMolotov, amBirdy, amPortalGun, // 42
   146             amLaserSight, amVampiric, amSniperRifle, amJetpack, amMolotov, amBirdy, amPortalGun, // 42
   136             amPiano, amGasBomb, amSineGun, amFlamethrower, amSMine, amHammer, // 48
   147             amPiano, amGasBomb, amSineGun, amFlamethrower, amSMine, amHammer, // 48
   137             amResurrector, amDrillStrike, amSnowball, amTardis, amStructure, amLandGun); // 54
   148             amResurrector, amDrillStrike, amSnowball, amTardis, amStructure, amLandGun); // 54
   138 
   149 
       
   150     // Different kind of crates that e.g. hedgehogs can pick up
   139     TCrateType = (HealthCrate, AmmoCrate, UtilityCrate);
   151     TCrateType = (HealthCrate, AmmoCrate, UtilityCrate);
   140 
   152 
   141     THWFont = (fnt16, fntBig, fntSmall {$IFNDEF IPHONEOS}, CJKfnt16, CJKfntBig, CJKfntSmall{$ENDIF});
   153     THWFont = (fnt16, fntBig, fntSmall {$IFNDEF IPHONEOS}, CJKfnt16, CJKfntBig, CJKfntSmall{$ENDIF});
   142 
   154 
   143     TCapGroup = (capgrpGameState, capgrpAmmoinfo, capgrpVolume,
   155     TCapGroup = (capgrpGameState, capgrpAmmoinfo, capgrpVolume,
   145 
   157 
   146     TStatInfoType = (siGameResult, siMaxStepDamage, siMaxStepKills, siKilledHHs,
   158     TStatInfoType = (siGameResult, siMaxStepDamage, siMaxStepKills, siKilledHHs,
   147             siClanHealth, siTeamStats, siPlayerKills, siMaxTeamDamage,
   159             siClanHealth, siTeamStats, siPlayerKills, siMaxTeamDamage,
   148             siMaxTeamKills, siMaxTurnSkips );
   160             siMaxTeamKills, siMaxTurnSkips );
   149 
   161 
       
   162     // Various "emote" animations a hedgehog can do
   150     TWave = (waveRollup, waveSad, waveWave, waveHurrah, waveLemonade, waveShrug, waveJuggle);
   163     TWave = (waveRollup, waveSad, waveWave, waveHurrah, waveLemonade, waveShrug, waveJuggle);
   151 
   164 
   152     TRenderMode = (rmDefault, rmLeftEye, rmRightEye);
   165     TRenderMode = (rmDefault, rmLeftEye, rmRightEye);
   153     TStereoMode = (smNone, smRedCyan, smCyanRed, smRedBlue, smBlueRed, smRedGreen, smGreenRed, smHorizontal, smVertical, smAFR);
   166     TStereoMode = (smNone, smRedCyan, smCyanRed, smRedBlue, smBlueRed, smRedGreen, smGreenRed, smHorizontal, smVertical, smAFR);
   154 
   167 
   376 
   389 
   377     TMsgStrId = (sidStartFight, sidDraw, sidWinner, sidVolume, sidPaused,
   390     TMsgStrId = (sidStartFight, sidDraw, sidWinner, sidVolume, sidPaused,
   378             sidConfirm, sidSuddenDeath, sidRemaining, sidFuel, sidSync,
   391             sidConfirm, sidSuddenDeath, sidRemaining, sidFuel, sidSync,
   379             sidNoEndTurn, sidNotYetAvailable, sidRoundSD, sidRoundsSD, sidReady);
   392             sidNoEndTurn, sidNotYetAvailable, sidRoundSD, sidRoundsSD, sidReady);
   380 
   393 
       
   394     // Events that are important for the course of the game or at least interesting for other reasons
   381     TEventId = (eidDied, eidDrowned, eidRoundStart, eidRoundWin, eidRoundDraw,
   395     TEventId = (eidDied, eidDrowned, eidRoundStart, eidRoundWin, eidRoundDraw,
   382             eidNewHealthPack, eidNewAmmoPack, eidNewUtilityPack, eidTurnSkipped, eidHurtSelf,
   396             eidNewHealthPack, eidNewAmmoPack, eidNewUtilityPack, eidTurnSkipped, eidHurtSelf,
   383             eidHomerun, eidGone);
   397             eidHomerun, eidGone);
   384 
   398 
   385     TGoalStrId = (gidCaption, gidSubCaption, gidForts, gidLowGravity, gidInvulnerable,
   399     TGoalStrId = (gidCaption, gidSubCaption, gidForts, gidLowGravity, gidInvulnerable,