hedgewars/uConsts.pas
changeset 3711 de3b3df215c3
parent 3710 411f5c2b5292
child 3712 de2026031833
equal deleted inserted replaced
3707:787f363798d8 3711:de3b3df215c3
    71             sprAmTeleport, sprSplash, sprDroplet, sprBirdy, sprHandCake, sprHandConstruction,
    71             sprAmTeleport, sprSplash, sprDroplet, sprBirdy, sprHandCake, sprHandConstruction,
    72             sprHandGrenade, sprHandMelon, sprHandMortar, sprHandSkip, sprHandCluster,
    72             sprHandGrenade, sprHandMelon, sprHandMortar, sprHandSkip, sprHandCluster,
    73             sprHandDynamite, sprHandHellish, sprHandMine, sprHandSeduction, sprHandVamp,
    73             sprHandDynamite, sprHandHellish, sprHandMine, sprHandSeduction, sprHandVamp,
    74             sprBigExplosion, sprSmokeRing, sprBeeTrace, sprEgg, sprTargetBee, sprHandBee,
    74             sprBigExplosion, sprSmokeRing, sprBeeTrace, sprEgg, sprTargetBee, sprHandBee,
    75             sprFeather, sprPiano, sprHandSineGun, sprPortalGun, sprPortal,
    75             sprFeather, sprPiano, sprHandSineGun, sprPortalGun, sprPortal,
    76             sprCheese, sprHandCheese, sprHandFlamethrower, sprChunk
    76             sprCheese, sprHandCheese, sprHandFlamethrower, sprChunk, sprNote,
       
    77             sprSMineOff, sprSMineOn, sprHandSMine
    77             );
    78             );
    78 
    79 
    79     // Gears that interact with other Gears and/or Land
    80     // Gears that interact with other Gears and/or Land
    80     TGearType = (gtAmmo_Bomb, gtHedgehog, gtAmmo_Grenade, gtGrave, gtBee, // 4
    81     TGearType = (gtAmmo_Bomb, gtHedgehog, gtAmmo_Grenade, gtGrave, gtBee, // 4
    81             gtShotgunShot, gtPickHammer, gtRope, gtMine, gtCase, // 9
    82             gtShotgunShot, gtPickHammer, gtRope, gtMine, gtCase, // 9
    84             gtATFinishGame, gtParachute, gtAirAttack, gtAirBomb, gtBlowTorch, // 23
    85             gtATFinishGame, gtParachute, gtAirAttack, gtAirBomb, gtBlowTorch, // 23
    85             gtGirder, gtTeleport, gtSwitcher, gtTarget, gtMortar, // 28
    86             gtGirder, gtTeleport, gtSwitcher, gtTarget, gtMortar, // 28
    86             gtWhip, gtKamikaze, gtCake, gtSeduction, gtWatermelon, gtMelonPiece, // 34
    87             gtWhip, gtKamikaze, gtCake, gtSeduction, gtWatermelon, gtMelonPiece, // 34
    87             gtHellishBomb, gtWaterUp, gtDrill, gtBallGun, gtBall, gtRCPlane, // 40
    88             gtHellishBomb, gtWaterUp, gtDrill, gtBallGun, gtBall, gtRCPlane, // 40
    88             gtSniperRifleShot, gtJetpack, gtMolotov, gtExplosives, gtBirdy, // 45
    89             gtSniperRifleShot, gtJetpack, gtMolotov, gtExplosives, gtBirdy, // 45
    89             gtEgg, gtPortal, gtPiano, gtGasBomb, gtSineGunShot, gtFlamethrower); // 51
    90             gtEgg, gtPortal, gtPiano, gtGasBomb, gtSineGunShot, gtFlamethrower, // 51
       
    91             gtSMine);
    90 
    92 
    91     // Gears that are _only_ of visual nature (e.g. background stuff, visual effects, speechbubbles, etc.)
    93     // Gears that are _only_ of visual nature (e.g. background stuff, visual effects, speechbubbles, etc.)
    92     TVisualGearType = (vgtFlake, vgtCloud, vgtExplPart, vgtExplPart2, vgtFire,
    94     TVisualGearType = (vgtFlake, vgtCloud, vgtExplPart, vgtExplPart2, vgtFire,
    93             vgtSmallDamageTag, vgtTeamHealthSorter, vgtSpeechBubble, vgtBubble,
    95             vgtSmallDamageTag, vgtTeamHealthSorter, vgtSpeechBubble, vgtBubble,
    94             vgtSteam, vgtAmmo, vgtSmoke, vgtSmokeWhite, vgtHealth, vgtShell,
    96             vgtSteam, vgtAmmo, vgtSmoke, vgtSmokeWhite, vgtHealth, vgtShell,
    95             vgtDust, vgtSplash, vgtDroplet, vgtSmokeRing, vgtBeeTrace, vgtEgg,
    97             vgtDust, vgtSplash, vgtDroplet, vgtSmokeRing, vgtBeeTrace, vgtEgg,
    96             vgtFeather, vgtHealthTag, vgtSmokeTrace, vgtEvilTrace, vgtExplosion,
    98             vgtFeather, vgtHealthTag, vgtSmokeTrace, vgtEvilTrace, vgtExplosion,
    97             vgtBigExplosion, vgtChunk);
    99             vgtBigExplosion, vgtChunk, vgtNote);
    98 
   100 
    99     TGearsType = set of TGearType;
   101     TGearsType = set of TGearType;
   100 
   102 
   101     TDamageSource = (dsUnknown, dsFall, dsBullet, dsExplosion, dsShove, dsPoison);
   103     TDamageSource = (dsUnknown, dsFall, dsBullet, dsExplosion, dsShove, dsPoison);
   102 
   104 
   127             amBaseballBat, amParachute, amAirAttack, amMineStrike, amBlowTorch,
   129             amBaseballBat, amParachute, amAirAttack, amMineStrike, amBlowTorch,
   128             amGirder, amTeleport, amSwitch, amMortar, amKamikaze, amCake,
   130             amGirder, amTeleport, amSwitch, amMortar, amKamikaze, amCake,
   129             amSeduction, amWatermelon, amHellishBomb, amNapalm, amDrill, amBallgun,
   131             amSeduction, amWatermelon, amHellishBomb, amNapalm, amDrill, amBallgun,
   130             amRCPlane, amLowGravity, amExtraDamage, amInvulnerable, amExtraTime,
   132             amRCPlane, amLowGravity, amExtraDamage, amInvulnerable, amExtraTime,
   131             amLaserSight, amVampiric, amSniperRifle, amJetpack, amMolotov, amBirdy, amPortalGun,
   133             amLaserSight, amVampiric, amSniperRifle, amJetpack, amMolotov, amBirdy, amPortalGun,
   132             amPiano, amGasBomb, amSineGun, amFlamethrower);
   134             amPiano, amGasBomb, amSineGun, amFlamethrower, amSMine);
   133 
   135 
   134     THWFont = (fnt16, fntBig, fntSmall, CJKfnt16, CJKfntBig, CJKfntSmall);
   136     THWFont = (fnt16, fntBig, fntSmall, CJKfnt16, CJKfntBig, CJKfntSmall);
   135 
   137 
   136     TCapGroup = (capgrpGameState, capgrpAmmoinfo, capgrpVolume,
   138     TCapGroup = (capgrpGameState, capgrpAmmoinfo, capgrpVolume,
   137             capgrpMessage, capgrpAmmostate);
   139             capgrpMessage, capgrpAmmostate);
   181             end;
   183             end;
   182 
   184 
   183     THogEffect = (heInvulnerable, hePoisoned);
   185     THogEffect = (heInvulnerable, hePoisoned);
   184 
   186 
   185     TScreenFade = (sfNone, sfInit, sfToBlack, sfFromBlack, sfToWhite, sfFromWhite);
   187     TScreenFade = (sfNone, sfInit, sfToBlack, sfFromBlack, sfToWhite, sfFromWhite);
   186 const sfMax = 1000;
   188 const
       
   189     sfMax = 1000;
       
   190     cDefaultParamNum = 16;
   187 
   191 
   188     // message constants
   192     // message constants
   189     errmsgCreateSurface   = 'Error creating SDL surface';
   193     errmsgCreateSurface   = 'Error creating SDL surface';
   190     errmsgTransparentSet  = 'Error setting transparent color';
   194     errmsgTransparentSet  = 'Error setting transparent color';
   191     errmsgUnknownCommand  = 'Unknown command';
   195     errmsgUnknownCommand  = 'Unknown command';
   450         'Sounds/voices',                 // ptVoices
   454         'Sounds/voices',                 // ptVoices
   451         'Graphics/Hats',                 // ptHats
   455         'Graphics/Hats',                 // ptHats
   452         'Graphics/Flags'                 // ptFlags
   456         'Graphics/Flags'                 // ptFlags
   453     );
   457     );
   454 
   458 
   455 var PathPrefix: shortstring = './';
       
   456     Pathz: array[TPathType] of shortstring;
       
   457     CountTexz: array[1..Pred(AMMO_INFINITE)] of PTexture;
       
   458     LAND_WIDTH  :longint;
       
   459     LAND_HEIGHT :longint;
       
   460     LAND_WIDTH_MASK  :longWord;
       
   461     LAND_HEIGHT_MASK :longWord;
       
   462     cMaxCaptions : LongInt;
       
   463 
       
   464 const
       
   465     cTagsMasks : array[0..15] of byte = (7, 0, 0, 0, 15, 6, 4, 5, 0, 0, 0, 0, 0, 14, 12, 13);
   459     cTagsMasks : array[0..15] of byte = (7, 0, 0, 0, 15, 6, 4, 5, 0, 0, 0, 0, 0, 14, 12, 13);
   466     cTagsMasksNoHealth: array[0..15] of byte = (3, 2, 11, 1, 0, 0, 0, 0, 0, 10, 0, 9, 0, 0, 0, 0);
   460     cTagsMasksNoHealth: array[0..15] of byte = (3, 2, 11, 1, 0, 0, 0, 0, 0, 10, 0, 9, 0, 0, 0, 0);
   467 
   461 
   468     Fontz: array[THWFont] of THHFont = (
   462     Fontz: array[THWFont] of THHFont = (
   469             (Handle: nil;
   463             (Handle: nil;
   797             (FileName:  'amCheese'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
   791             (FileName:  'amCheese'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
   798             Width:  64; Height: 64; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprHandCheese
   792             Width:  64; Height: 64; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprHandCheese
   799             (FileName:  'amFlamethrower'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
   793             (FileName:  'amFlamethrower'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
   800             Width:  128; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprHandFlamethrower
   794             Width:  128; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprHandFlamethrower
   801             (FileName:  'Chunk'; Path: ptCurrTheme; AltPath: ptGraphics; Texture: nil; Surface: nil;
   795             (FileName:  'Chunk'; Path: ptCurrTheme; AltPath: ptGraphics; Texture: nil; Surface: nil;
   802             Width:  32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true) // sprChunk
   796             Width:  32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprChunk
       
   797             (FileName:  'Note'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
       
   798             Width:  32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprNote
       
   799             (FileName:   'SMineOff'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
       
   800             Width:   8; Height:  8; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprSMineOff
       
   801             (FileName:    'SMineOn'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
       
   802             Width:   8; Height:  8; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprSMineOn
       
   803             (FileName:  'amSMine'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
       
   804             Width:  64; Height: 64; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true) // sprHandSMine
   803             );
   805             );
   804 
   806 
   805     Wavez: array [TWave] of record
   807     Wavez: array [TWave] of record
   806             Sprite: TSprite;
   808             Sprite: TSprite;
   807             FramesCount: Longword;
   809             FramesCount: Longword;
  2148             isDamaging: true;
  2150             isDamaging: true;
  2149             SkipTurns: 0;
  2151             SkipTurns: 0;
  2150             PosCount: 1;
  2152             PosCount: 1;
  2151             PosSprite: sprWater;
  2153             PosSprite: sprWater;
  2152             ejectX: 0; //20;
  2154             ejectX: 0; //20;
  2153             ejectY: -3)
  2155             ejectY: -3),
       
  2156 
       
  2157 // Mine
       
  2158             (NameId: sidSMine;
       
  2159             NameTex: nil;
       
  2160             Probability: 100;
       
  2161             NumberInCase: 1;
       
  2162             Ammo: (Propz: ammoprop_Power or ammoprop_AltUse;
       
  2163                 Count: 2;
       
  2164                 InitialCount: 0;
       
  2165                 NumPerTurn: 0;
       
  2166                 Timer: 0;
       
  2167                 Pos: 0;
       
  2168                 AmmoType: amSMine;
       
  2169                 AttackVoice: sndLaugh);
       
  2170             Slot: 4;
       
  2171             TimeAfterTurn: 5000;
       
  2172             minAngle: 0;
       
  2173             maxAngle: 0;
       
  2174             isDamaging: true;
       
  2175             SkipTurns: 0;
       
  2176             PosCount: 1;
       
  2177             PosSprite: sprWater;
       
  2178             ejectX: 0;
       
  2179             ejectY: 0)
  2154             );
  2180             );
  2155 
  2181 
  2156 
  2182 
  2157     conversionFormat: TSDL_PixelFormat = (
  2183     conversionFormat: TSDL_PixelFormat = (
  2158         palette: nil;
  2184         palette: nil;
  2179         AMask : AMask;
  2205         AMask : AMask;
  2180         colorkey: 0;
  2206         colorkey: 0;
  2181         alpha : 255
  2207         alpha : 255
  2182     );
  2208     );
  2183 
  2209 
  2184 procedure initModule;
       
  2185 procedure freeModule;
       
  2186 
       
  2187 implementation
  2210 implementation
  2188 uses uMisc;
       
  2189 
       
  2190 procedure initModule;
       
  2191 begin
       
  2192     Pathz:= cPathz;
       
  2193         {*  REFERENCE
       
  2194       4096 -> $FFFFF000
       
  2195       2048 -> $FFFFF800
       
  2196       1024 -> $FFFFFC00
       
  2197        512 -> $FFFFFE00  *}
       
  2198     if (cReducedQuality and rqLowRes) <> 0 then
       
  2199     begin
       
  2200         LAND_WIDTH:= 2048;
       
  2201         LAND_HEIGHT:= 1024;
       
  2202         LAND_WIDTH_MASK:= $FFFFF800;
       
  2203         LAND_HEIGHT_MASK:= $FFFFFC00;
       
  2204     end
       
  2205     else
       
  2206     begin
       
  2207         LAND_WIDTH:= 4096;
       
  2208         LAND_HEIGHT:= 2048;
       
  2209         LAND_WIDTH_MASK:= $FFFFF000;
       
  2210         LAND_HEIGHT_MASK:= $FFFFF800
       
  2211     end;
       
  2212 
       
  2213 {$IFDEF IPHONEOS}
       
  2214     if isPhone() then
       
  2215         cMaxCaptions:= 3
       
  2216     else
       
  2217 {$ENDIF}
       
  2218         cMaxCaptions:= 4;
       
  2219 
       
  2220 end;
       
  2221 
       
  2222 procedure freeModule;
       
  2223 begin
       
  2224     PathPrefix := './';
       
  2225 end;
       
  2226 
  2211 
  2227 end.
  2212 end.