hedgewars/uConsts.pas
changeset 80 3c3dc6a148ca
parent 79 29b477319854
child 82 2f4f3236cccc
equal deleted inserted replaced
79:29b477319854 80:3c3dc6a148ca
    31  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    31  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    32  *)
    32  *)
    33 
    33 
    34 unit uConsts;
    34 unit uConsts;
    35 interface
    35 interface
    36 uses SDLh;
    36 uses SDLh, uLocale;
    37 {$INCLUDE options.inc}
    37 {$INCLUDE options.inc}
    38 type TStuff     = (sHorizont, sSky, sConsoleBG, sPowerBar, sQuestion, sWindBar,
    38 type TStuff     = (sConsoleBG, sPowerBar, sQuestion, sWindBar,
    39                    sWindL, sWindR, sRopeNode);
    39                    sWindL, sWindR, sRopeNode);
    40      TGameState = (gsLandGen, gsStart, gsGame, gsConsole, gsExit);
    40      TGameState = (gsLandGen, gsStart, gsGame, gsConsole, gsExit);
    41      TGameType  = (gmtLocal, gmtDemo, gmtNet, gmtSave);
    41      TGameType  = (gmtLocal, gmtDemo, gmtNet, gmtSave);
    42      TPathType  = (ptData, ptGraphics, ptThemes, ptThemeCurrent, ptTeams, ptMaps,
    42      TPathType  = (ptNone, ptData, ptGraphics, ptThemes, ptCurrTheme, ptTeams, ptMaps,
    43                    ptMapCurrent, ptDemos, ptSounds, ptGraves, ptFonts, ptForts);
    43                    ptMapCurrent, ptDemos, ptSounds, ptGraves, ptFonts, ptForts,
       
    44                    ptLocale);
    44      TSprite    = (sprWater, sprCloud, sprBomb, sprBigDigit, sprFrame,
    45      TSprite    = (sprWater, sprCloud, sprBomb, sprBigDigit, sprFrame,
    45                    sprLag, sprArrow, sprGrenade, sprTargetP, sprUFO,
    46                    sprLag, sprArrow, sprGrenade, sprTargetP, sprUFO,
    46                    sprSmokeTrace, sprRopeHook, sprExplosion50, sprMineOff,
    47                    sprSmokeTrace, sprRopeHook, sprExplosion50, sprMineOff,
    47                    sprMineOn, sprCase, sprFAid, sprDynamite, sprPower,
    48                    sprMineOn, sprCase, sprFAid, sprDynamite, sprPower,
    48                    sprClusterBomb, sprClusterParticle, sprFlame);
    49                    sprClusterBomb, sprClusterParticle, sprFlame, sprHorizont,
       
    50                    sprSky);
    49      TGearType  = (gtCloud, gtAmmo_Bomb, gtHedgehog, gtAmmo_Grenade, gtHealthTag,
    51      TGearType  = (gtCloud, gtAmmo_Bomb, gtHedgehog, gtAmmo_Grenade, gtHealthTag,
    50                    gtGrave, gtUFO, gtShotgunShot, gtActionTimer, gtPickHammer, gtRope,
    52                    gtGrave, gtUFO, gtShotgunShot, gtActionTimer, gtPickHammer, gtRope,
    51                    gtSmokeTrace, gtExplosion, gtMine, gtCase, gtDEagleShot, gtDynamite,
    53                    gtSmokeTrace, gtExplosion, gtMine, gtCase, gtDEagleShot, gtDynamite,
    52                    gtTeamHealthSorter, gtClusterBomb, gtCluster, gtShover, gtFlame);
    54                    gtTeamHealthSorter, gtClusterBomb, gtCluster, gtShover, gtFlame);
    53      TGearsType = set of TGearType;
    55      TGearsType = set of TGearType;
   182                                          (Height: 24;
   184                                          (Height: 24;
   183                                           Name: 'DejaVuSans.ttf')
   185                                           Name: 'DejaVuSans.ttf')
   184                                          );
   186                                          );
   185 
   187 
   186       Pathz: array[TPathType] of string[ 64] = (
   188       Pathz: array[TPathType] of string[ 64] = (
       
   189                                                '',                              // ptNone      
   187                                                'Data',                          // ptData
   190                                                'Data',                          // ptData
   188                                                'Data/Graphics',                 // ptGraphics
   191                                                'Data/Graphics',                 // ptGraphics
   189                                                'Data/Themes',                   // ptThemes
   192                                                'Data/Themes',                   // ptThemes
   190                                                'Data/Themes/avematan',          // ptThemeCurrent
   193                                                'Data/Themes/avematan',          // ptCurrTheme
   191                                                'Data/Teams',                    // ptTeams
   194                                                'Data/Teams',                    // ptTeams
   192                                                'Data/Maps',                     // ptMaps
   195                                                'Data/Maps',                     // ptMaps
   193                                                '',                              // ptMapCurrent
   196                                                '',                              // ptMapCurrent
   194                                                'Data/Demos',                    // ptDemos
   197                                                'Data/Demos',                    // ptDemos
   195                                                'Data/Sounds',                   // ptSounds
   198                                                'Data/Sounds',                   // ptSounds
   196                                                'Data/Graphics/Graves',          // ptGraves
   199                                                'Data/Graphics/Graves',          // ptGraves
   197                                                'Data/Fonts',                    // ptFonts
   200                                                'Data/Fonts',                    // ptFonts
   198                                                'Data/Forts'                     // ptForts
   201                                                'Data/Forts',                    // ptForts
       
   202                                                'Data/Locale'                    // ptLocale
   199                                                );
   203                                                );
   200 
   204 
   201       StuffLoadData: array[TStuff] of record
   205       StuffLoadData: array[TStuff] of record
   202                                      FileName: String[31];
   206                                      FileName: String[31];
   203                                      Path    : TPathType;
   207                                      Path    : TPathType;
   204                                      end = (
   208                                      end = (
   205                                      (FileName: 'horizont'; Path: ptThemeCurrent ),    // sHorizont
       
   206                                      (FileName:      'Sky'; Path: ptThemeCurrent ),    // sSky
       
   207                                      (FileName:  'Console'; Path: ptGraphics     ),    // sConsoleBG
   209                                      (FileName:  'Console'; Path: ptGraphics     ),    // sConsoleBG
   208                                      (FileName: 'PowerBar'; Path: ptGraphics     ),    // sPowerBar
   210                                      (FileName: 'PowerBar'; Path: ptGraphics     ),    // sPowerBar
   209                                      (FileName: 'thinking'; Path: ptGraphics     ),    // sQuestion
   211                                      (FileName: 'thinking'; Path: ptGraphics     ),    // sQuestion
   210                                      (FileName:  'WindBar'; Path: ptGraphics     ),    // sWindBar
   212                                      (FileName:  'WindBar'; Path: ptGraphics     ),    // sWindBar
   211                                      (FileName:    'WindL'; Path: ptGraphics     ),    // sWindL
   213                                      (FileName:    'WindL'; Path: ptGraphics     ),    // sWindL
   212                                      (FileName:    'WindR'; Path: ptGraphics     ),    // sWindR
   214                                      (FileName:    'WindR'; Path: ptGraphics     ),    // sWindR
   213                                      (FileName: 'RopeNode'; Path: ptGraphics     )     // sRopeNode
   215                                      (FileName: 'RopeNode'; Path: ptGraphics     )     // sRopeNode
   214                                      );
   216                                      );
   215       StuffPoz: array[TStuff] of TSDL_Rect = (
   217       StuffPoz: array[TStuff] of TSDL_Rect = (
   216                                       (x:   0; y:   0; w: 512; h: 256), // sHorizont
       
   217                                       (x: 512; y:   0; w:  64; h:1024), // sSky
       
   218                                       (x: 256; y: 256; w: 256; h: 256), // sConsoleBG
   218                                       (x: 256; y: 256; w: 256; h: 256), // sConsoleBG
   219                                       (x: 256; y: 768; w: 256; h:  32), // sPowerBar
   219                                       (x: 256; y: 768; w: 256; h:  32), // sPowerBar
   220                                       (x: 256; y: 512; w:  32; h:  32), // sQuestion
   220                                       (x: 256; y: 512; w:  32; h:  32), // sQuestion
   221                                       (x: 256; y: 800; w: 151; h:  17), // sWindBar
   221                                       (x: 256; y: 800; w: 151; h:  17), // sWindBar
   222                                       (x: 256; y: 817; w:  80; h:  13), // sWindL
   222                                       (x: 256; y: 817; w:  80; h:  13), // sWindL
   223                                       (x: 336; y: 817; w:  80; h:  13), // sWindR
   223                                       (x: 336; y: 817; w:  80; h:  13), // sWindR
   224                                       (x: 256; y: 544; w:   6; h:   6)  // sRopeNode
   224                                       (x: 256; y: 544; w:   6; h:   6)  // sRopeNode
   225                                       );
   225                                       );
   226       SpritesData: array[TSprite] of record
   226       SpritesData: array[TSprite] of record
   227                      FileName: String[31];
   227                      FileName: String[31];
   228                      Path    : TPathType;
   228                      Path, AltPath: TPathType;
   229                      Surface : PSDL_Surface;
   229                      Surface : PSDL_Surface;
   230                      Width, Height: integer;
   230                      Width, Height: integer;
   231                      hasAlpha: boolean;
   231                      hasAlpha: boolean;
   232                      end = (
   232                      end = (
   233                      (FileName: 'BlueWater'; Path: ptGraphics; Width: 256; Height: 48; hasAlpha: false),// sprWater
   233                      (FileName: 'BlueWater'; Path: ptGraphics; Width: 256; Height: 48; hasAlpha: false),// sprWater
   234                      (FileName:    'Clouds'; Path: ptGraphics; Width: 256; Height:128; hasAlpha: false),// sprCloud
   234                      (FileName:    'Clouds'; Path: ptCurrTheme;
       
   235                                           AltPath: ptGraphics; Width: 256; Height:128; hasAlpha: false),// sprCloud
   235                      (FileName:      'Bomb'; Path: ptGraphics; Width:  16; Height: 16; hasAlpha: false),// sprBomb
   236                      (FileName:      'Bomb'; Path: ptGraphics; Width:  16; Height: 16; hasAlpha: false),// sprBomb
   236                      (FileName: 'BigDigits'; Path: ptGraphics; Width:  32; Height: 32; hasAlpha:  true),// sprBigDigit
   237                      (FileName: 'BigDigits'; Path: ptGraphics; Width:  32; Height: 32; hasAlpha:  true),// sprBigDigit
   237                      (FileName:     'Frame'; Path: ptGraphics; Width:   4; Height: 32; hasAlpha:  true),// sprFrame
   238                      (FileName:     'Frame'; Path: ptGraphics; Width:   4; Height: 32; hasAlpha:  true),// sprFrame
   238                      (FileName:       'Lag'; Path: ptGraphics; Width:  64; Height: 64; hasAlpha: false),// sprLag
   239                      (FileName:       'Lag'; Path: ptGraphics; Width:  64; Height: 64; hasAlpha: false),// sprLag
   239                      (FileName:     'Arrow'; Path: ptGraphics; Width:  16; Height: 16; hasAlpha: false),// sprCursor
   240                      (FileName:     'Arrow'; Path: ptGraphics; Width:  16; Height: 16; hasAlpha: false),// sprCursor
   249                      (FileName:  'FirstAid'; Path: ptGraphics; Width:  48; Height: 48; hasAlpha: false),// sprFAid
   250                      (FileName:  'FirstAid'; Path: ptGraphics; Width:  48; Height: 48; hasAlpha: false),// sprFAid
   250                      (FileName:  'dynamite'; Path: ptGraphics; Width:  32; Height: 32; hasAlpha: false),// sprDynamite
   251                      (FileName:  'dynamite'; Path: ptGraphics; Width:  32; Height: 32; hasAlpha: false),// sprDynamite
   251                      (FileName:     'Power'; Path: ptGraphics; Width:  32; Height: 32; hasAlpha:  true),// sprPower
   252                      (FileName:     'Power'; Path: ptGraphics; Width:  32; Height: 32; hasAlpha:  true),// sprPower
   252                      (FileName:    'ClBomb'; Path: ptGraphics; Width:  16; Height: 16; hasAlpha: false),// sprClusterBomb
   253                      (FileName:    'ClBomb'; Path: ptGraphics; Width:  16; Height: 16; hasAlpha: false),// sprClusterBomb
   253                      (FileName:'ClParticle'; Path: ptGraphics; Width:  16; Height: 16; hasAlpha: false),// sprClusterParticle
   254                      (FileName:'ClParticle'; Path: ptGraphics; Width:  16; Height: 16; hasAlpha: false),// sprClusterParticle
   254                      (FileName:     'Flame'; Path: ptGraphics; Width:  16; Height: 16; hasAlpha: false) // sprFlame
   255                      (FileName:     'Flame'; Path: ptGraphics; Width:  16; Height: 16; hasAlpha: false),// sprFlame
       
   256                      (FileName:  'horizont'; Path: ptCurrTheme;Width:   0; Height:  0; hasAlpha: false),// sprHorizont
       
   257                      (FileName:       'Sky'; Path: ptCurrTheme;Width:   0; Height:  0; hasAlpha: false) // sprSky
   255                      );
   258                      );
   256       Soundz: array[TSound] of record
   259       Soundz: array[TSound] of record
   257                                        FileName: String[31];
   260                                        FileName: String[31];
   258                                        Path    : TPathType;
   261                                        Path    : TPathType;
   259                                        id      : PMixChunk;
   262                                        id      : PMixChunk;
   268                                        (FileName:   'graveimpact.ogg'; Path: ptSounds  ),// sndGraveImpact
   271                                        (FileName:   'graveimpact.ogg'; Path: ptSounds  ),// sndGraveImpact
   269                                        (FileName:      'minetick.ogg'; Path: ptSounds  ) // sndMineTicks
   272                                        (FileName:      'minetick.ogg'; Path: ptSounds  ) // sndMineTicks
   270                                        );
   273                                        );
   271 
   274 
   272       Ammoz: array [TAmmoType] of record
   275       Ammoz: array [TAmmoType] of record
   273                                   Name: string[32];
   276                                   NameId: TAmmoStrId;
   274                                   Ammo: TAmmo;
   277                                   Ammo: TAmmo;
   275                                   Slot: Longword;
   278                                   Slot: Longword;
   276                                   TimeAfterTurn: Longword;
   279                                   TimeAfterTurn: Longword;
   277                                   end = (
   280                                   end = (
   278                                   (Name: 'Grenade';
   281                                   (NameId: sidGrenade;
   279                                    Ammo: (Propz: ammoprop_Timerable or ammoprop_Power;
   282                                    Ammo: (Propz: ammoprop_Timerable or ammoprop_Power;
   280                                           Count: AMMO_INFINITE;
   283                                           Count: AMMO_INFINITE;
   281                                           NumPerTurn: 0;
   284                                           NumPerTurn: 0;
   282                                           Timer: 3000;
   285                                           Timer: 3000;
   283                                           AmmoType: amGrenade);
   286                                           AmmoType: amGrenade);
   284                                    Slot: 1;
   287                                    Slot: 1;
   285                                    TimeAfterTurn: 3000),
   288                                    TimeAfterTurn: 3000),
   286                                   (Name: 'Cluster Bomb';
   289                                   (NameId: sidClusterBomb;
   287                                    Ammo: (Propz: ammoprop_Timerable or ammoprop_Power;
   290                                    Ammo: (Propz: ammoprop_Timerable or ammoprop_Power;
   288                                           Count: 5;
   291                                           Count: 5;
   289                                           NumPerTurn: 0;
   292                                           NumPerTurn: 0;
   290                                           Timer: 3000;
   293                                           Timer: 3000;
   291                                           AmmoType: amClusterBomb);
   294                                           AmmoType: amClusterBomb);
   292                                    Slot: 1;
   295                                    Slot: 1;
   293                                    TimeAfterTurn: 3000),
   296                                    TimeAfterTurn: 3000),
   294                                   (Name: 'Bazooka';
   297                                   (NameId: sidBazooka;
   295                                    Ammo: (Propz: ammoprop_Power;
   298                                    Ammo: (Propz: ammoprop_Power;
   296                                           Count: AMMO_INFINITE;
   299                                           Count: AMMO_INFINITE;
   297                                           NumPerTurn: 0;
   300                                           NumPerTurn: 0;
   298                                           Timer: 0;
   301                                           Timer: 0;
   299                                           AmmoType: amBazooka);
   302                                           AmmoType: amBazooka);
   300                                    Slot: 0;
   303                                    Slot: 0;
   301                                    TimeAfterTurn: 3000),
   304                                    TimeAfterTurn: 3000),
   302                                   (Name: 'UFO';
   305                                   (NameId: sidUFO;
   303                                    Ammo: (Propz: ammoprop_Power or ammoprop_NeedTarget;
   306                                    Ammo: (Propz: ammoprop_Power or ammoprop_NeedTarget;
   304                                           Count: 2;
   307                                           Count: 2;
   305                                           NumPerTurn: 0;
   308                                           NumPerTurn: 0;
   306                                           Timer: 0;
   309                                           Timer: 0;
   307                                           AmmoType: amUFO);
   310                                           AmmoType: amUFO);
   308                                    Slot: 0;
   311                                    Slot: 0;
   309                                    TimeAfterTurn: 3000),
   312                                    TimeAfterTurn: 3000),
   310                                   (Name: 'Shotgun';
   313                                   (NameId: sidShotgun;
   311                                    Ammo: (Propz: 0;
   314                                    Ammo: (Propz: 0;
   312                                           Count: AMMO_INFINITE;
   315                                           Count: AMMO_INFINITE;
   313                                           NumPerTurn: 1;
   316                                           NumPerTurn: 1;
   314                                           Timer: 0;
   317                                           Timer: 0;
   315                                           AmmoType: amShotgun);
   318                                           AmmoType: amShotgun);
   316                                    Slot: 2;
   319                                    Slot: 2;
   317                                    TimeAfterTurn: 3000),
   320                                    TimeAfterTurn: 3000),
   318                                   (Name: 'Pneumatic pick';
   321                                   (NameId: sidPickHammer;
   319                                    Ammo: (Propz: ammoprop_ForwMsgs or ammoprop_AttackInFall or ammoprop_AttackInJump;
   322                                    Ammo: (Propz: ammoprop_ForwMsgs or ammoprop_AttackInFall or ammoprop_AttackInJump;
   320                                           Count: 2;
   323                                           Count: 2;
   321                                           NumPerTurn: 0;
   324                                           NumPerTurn: 0;
   322                                           Timer: 0;
   325                                           Timer: 0;
   323                                           AmmoType: amPickHammer);
   326                                           AmmoType: amPickHammer);
   324                                    Slot: 5;
   327                                    Slot: 5;
   325                                    TimeAfterTurn: 0),
   328                                    TimeAfterTurn: 0),
   326                                   (Name: 'Skip turn';
   329                                   (NameId: sidSkip;
   327                                    Ammo: (Propz: 0;
   330                                    Ammo: (Propz: 0;
   328                                           Count: AMMO_INFINITE;
   331                                           Count: AMMO_INFINITE;
   329                                           NumPerTurn: 0;
   332                                           NumPerTurn: 0;
   330                                           Timer: 0;
   333                                           Timer: 0;
   331                                           AmmoType: amSkip);
   334                                           AmmoType: amSkip);
   332                                    Slot: 7;
   335                                    Slot: 7;
   333                                    TimeAfterTurn: 0),
   336                                    TimeAfterTurn: 0),
   334                                   (Name: 'Rope';
   337                                   (NameId: sidRope;
   335                                    Ammo: (Propz: ammoprop_ForwMsgs or ammoprop_AttackInFall or ammoprop_AttackInJump;
   338                                    Ammo: (Propz: ammoprop_ForwMsgs or ammoprop_AttackInFall or ammoprop_AttackInJump;
   336                                           Count: 5;
   339                                           Count: 5;
   337                                           NumPerTurn: 0;
   340                                           NumPerTurn: 0;
   338                                           Timer: 0;
   341                                           Timer: 0;
   339                                           AmmoType: amRope);
   342                                           AmmoType: amRope);
   340                                    Slot: 6;
   343                                    Slot: 6;
   341                                    TimeAfterTurn: 0),
   344                                    TimeAfterTurn: 0),
   342                                   (Name: 'Mine';
   345                                   (NameId: sidMine;
   343                                    Ammo: (Propz: ammoprop_NoCrosshair;
   346                                    Ammo: (Propz: ammoprop_NoCrosshair;
   344                                           Count: 2;
   347                                           Count: 2;
   345                                           NumPerTurn: 0;
   348                                           NumPerTurn: 0;
   346                                           Timer: 0;
   349                                           Timer: 0;
   347                                           AmmoType: amMine);
   350                                           AmmoType: amMine);
   348                                    Slot: 4;
   351                                    Slot: 4;
   349                                    TimeAfterTurn: 5000),
   352                                    TimeAfterTurn: 5000),
   350                                   (Name: 'Desert Eagle';
   353                                   (NameId: sidDEagle;
   351                                    Ammo: (Propz: 0;
   354                                    Ammo: (Propz: 0;
   352                                           Count: 3;
   355                                           Count: 3;
   353                                           NumPerTurn: 3;
   356                                           NumPerTurn: 3;
   354                                           Timer: 0;
   357                                           Timer: 0;
   355                                           AmmoType: amDEagle);
   358                                           AmmoType: amDEagle);
   356                                    Slot: 2;
   359                                    Slot: 2;
   357                                    TimeAfterTurn: 3000),
   360                                    TimeAfterTurn: 3000),
   358                                    (Name: 'Dynamite';
   361                                    (NameId: sidDynamite;
   359                                     Ammo: (Propz: ammoprop_NoCrosshair or ammoprop_AttackInJump or ammoprop_AttackInFall;
   362                                     Ammo: (Propz: ammoprop_NoCrosshair or ammoprop_AttackInJump or ammoprop_AttackInFall;
   360                                            Count: 1;
   363                                            Count: 1;
   361                                            NumPerTurn: 0;
   364                                            NumPerTurn: 0;
   362                                            Timer: 0;
   365                                            Timer: 0;
   363                                            AmmoType: amDynamite);
   366                                            AmmoType: amDynamite);
   364                                     Slot: 4;
   367                                     Slot: 4;
   365                                     TimeAfterTurn: 5000),
   368                                     TimeAfterTurn: 5000),
   366                                    (Name: 'Baseball Bat';
   369                                    (NameId: sidBaseballBat;
   367                                     Ammo: (Propz: 0;
   370                                     Ammo: (Propz: 0;
   368                                            Count: 1;
   371                                            Count: 1;
   369                                            NumPerTurn: 0;
   372                                            NumPerTurn: 0;
   370                                            Timer: 0;
   373                                            Timer: 0;
   371                                            AmmoType: amBaseballBat);
   374                                            AmmoType: amBaseballBat);