hedgewars/uTypes.pas
changeset 4361 64ea345ab655
parent 4357 a1fcfc341a52
child 4365 4f2b1a152979
equal deleted inserted replaced
4359:83ef50815535 4361:64ea345ab655
     1 {$INCLUDE "options.inc"}
     1 {$INCLUDE "options.inc"}
     2 
     2 
     3 unit uTypes;
     3 unit uTypes;
     4 interface
     4 interface
     5 
     5 
     6 uses SDLh, uFloat, GLunit;
     6 uses SDLh, uFloat, GLunit, uConsts, Math;
     7 
     7 
     8 type
     8 type
     9     HwColor4f = record
     9     HwColor4f = record
    10         r, g, b, a: byte
    10         r, g, b, a: byte
    11         end;
    11         end;
   169     THogEffect = (heInvulnerable, heResurrectable, hePoisoned, heResurrected);
   169     THogEffect = (heInvulnerable, heResurrectable, hePoisoned, heResurrected);
   170 
   170 
   171     TScreenFade = (sfNone, sfInit, sfToBlack, sfFromBlack, sfToWhite, sfFromWhite);
   171     TScreenFade = (sfNone, sfInit, sfToBlack, sfFromBlack, sfToWhite, sfFromWhite);
   172 
   172 
   173     PGear = ^TGear;
   173     PGear = ^TGear;
       
   174     PHedgehog = ^THedgehog;
       
   175     PTeam     = ^TTeam;
       
   176     PClan     = ^TClan;
       
   177 
   174     TGearStepProcedure = procedure (Gear: PGear);
   178     TGearStepProcedure = procedure (Gear: PGear);
   175     TGear = record
   179     TGear = record
   176             NextGear, PrevGear: PGear;
   180             NextGear, PrevGear: PGear;
   177             Active: Boolean;
   181             Active: Boolean;
   178             AdvBounce: Longword;
   182             AdvBounce: Longword;
   192             DirAngle: real;
   196             DirAngle: real;
   193             Timer : LongWord;
   197             Timer : LongWord;
   194             Elasticity: hwFloat;
   198             Elasticity: hwFloat;
   195             Friction  : hwFloat;
   199             Friction  : hwFloat;
   196             Message, MsgParam : Longword;
   200             Message, MsgParam : Longword;
   197             Hedgehog: pointer;
   201             Hedgehog: PHedgehog;
   198             Health, Damage, Karma: LongInt;
   202             Health, Damage, Karma: LongInt;
   199             CollisionIndex: LongInt;
   203             CollisionIndex: LongInt;
   200             Tag: LongInt;
   204             Tag: LongInt;
   201             Tex: PTexture;
   205             Tex: PTexture;
   202             Z: Longword;
   206             Z: Longword;
   208             SoundChannel: LongInt;
   212             SoundChannel: LongInt;
   209             PortalCounter: LongWord  // Hopefully temporary, but avoids infinite portal loops in a guaranteed fashion.
   213             PortalCounter: LongWord  // Hopefully temporary, but avoids infinite portal loops in a guaranteed fashion.
   210         end;
   214         end;
   211     TPGearArray = Array of PGear;
   215     TPGearArray = Array of PGear;
   212 
   216 
       
   217     PVisualGear = ^TVisualGear;
       
   218     TVGearStepProcedure = procedure (Gear: PVisualGear; Steps: Longword);
       
   219     TVisualGear = record
       
   220         NextGear, PrevGear: PVisualGear;
       
   221         Frame,
       
   222         FrameTicks: Longword;
       
   223         X : float;
       
   224         Y : float;
       
   225         dX: float;
       
   226         dY: float;
       
   227         tdX: float;
       
   228         tdY: float;
       
   229         State : Longword;
       
   230         Timer: Longword;
       
   231         Angle, dAngle: real;
       
   232         Kind: TVisualGearType;
       
   233         doStep: TVGearStepProcedure;
       
   234         Tex: PTexture;
       
   235         alpha, scale: GLfloat;
       
   236         Hedgehog: pointer;
       
   237         Text: shortstring;
       
   238         Tint: Longword;
       
   239         end;
       
   240 
       
   241     TStatistics = record
       
   242         DamageRecv,
       
   243         DamageGiven: Longword;
       
   244         StepDamageRecv,
       
   245         StepDamageGiven,
       
   246         StepKills: Longword;
       
   247         MaxStepDamageRecv,
       
   248         MaxStepDamageGiven,
       
   249         MaxStepKills: Longword;
       
   250         FinishedTurns: Longword;
       
   251         end;
       
   252 
       
   253     TTeamStats = record
       
   254         Kills : Longword;
       
   255         AIKills : Longword;
       
   256         TeamKills : Longword;
       
   257         TurnSkips : Longword;
       
   258         TeamDamage : Longword;
       
   259         end;
       
   260 
       
   261     TBinds = array[0..cKeyMaxIndex] of shortstring;
       
   262     TKeyboardState = array[0..cKeyMaxIndex] of Byte;
       
   263 
       
   264     PVoicepack = ^TVoicepack;
       
   265     TVoicepack = record
       
   266         name: shortstring;
       
   267         chunks: array [TSound] of PMixChunk;
       
   268         end;
       
   269 
       
   270     PHHAmmo = ^THHAmmo;
       
   271     THHAmmo = array[0..cMaxSlotIndex, 0..cMaxSlotAmmoIndex] of TAmmo;
       
   272 
       
   273     THedgehog = record
       
   274             Name: string[MAXNAMELEN];
       
   275             Gear: PGear;
       
   276             SpeechGear: PVisualGear;
       
   277             NameTagTex,
       
   278             HealthTagTex,
       
   279             HatTex: PTexture;
       
   280             Ammo: PHHAmmo;
       
   281             CurAmmoType: TAmmoType;
       
   282             AmmoStore: Longword;
       
   283             Team: PTeam;
       
   284             MultiShootAttacks: Longword;
       
   285             visStepPos: LongWord;
       
   286             BotLevel  : Byte; // 0 - Human player
       
   287             HatVisibility: GLfloat;
       
   288             stats: TStatistics;
       
   289             Hat: shortstring;
       
   290             InitialHealth: LongInt; // used for gfResetHealth
       
   291             King: boolean;  // Flag for a bunch of hedgehog attributes
       
   292             Unplaced: boolean;  // Flag for hog placing mode
       
   293             Timer: Longword;
       
   294             Effects: Array[THogEffect] of boolean;
       
   295             end;
       
   296 
       
   297     TTeam = record
       
   298             Clan: PClan;
       
   299             TeamName: string[MAXNAMELEN];
       
   300             ExtDriven: boolean;
       
   301             Binds: TBinds;
       
   302             Hedgehogs: array[0..cMaxHHIndex] of THedgehog;
       
   303             CurrHedgehog: LongWord;
       
   304             NameTagTex: PTexture;
       
   305             CrosshairTex,
       
   306             GraveTex,
       
   307             HealthTex,
       
   308             AIKillsTex,
       
   309             FlagTex: PTexture;
       
   310             Flag: shortstring;
       
   311             GraveName: shortstring;
       
   312             FortName: shortstring;
       
   313             TeamHealth: LongInt;
       
   314             TeamHealthBarWidth,
       
   315             NewTeamHealthBarWidth: LongInt;
       
   316             DrawHealthY: LongInt;
       
   317             AttackBar: LongWord;
       
   318             HedgehogsNumber: Longword;
       
   319             hasGone: boolean;
       
   320             voicepack: PVoicepack;
       
   321             PlayerHash: shortstring;   // md5 hash of player name. For temporary enabling of hats as thank you. Hashed for privacy of players
       
   322             stats: TTeamStats;
       
   323             end;
       
   324 
       
   325     TClan = record
       
   326             Color: Longword;
       
   327             Teams: array[0..Pred(cMaxTeams)] of PTeam;
       
   328             TeamsNumber: Longword;
       
   329             CurrTeam: LongWord;
       
   330             ClanHealth: LongInt;
       
   331             ClanIndex: LongInt;
       
   332             TurnNumber: LongWord;
       
   333             end;
       
   334 
       
   335      TAmmoStrId = (sidNothing, sidGrenade, sidClusterBomb, sidBazooka, sidBee, sidShotgun,
       
   336             sidPickHammer, sidSkip, sidRope, sidMine, sidDEagle,
       
   337             sidDynamite, sidBaseballBat, sidFirePunch, sidSeconds,
       
   338             sidParachute, sidAirAttack, sidMineStrike, sidBlowTorch,
       
   339             sidGirder, sidTeleport, sidSwitch, sidMortar, sidWhip,
       
   340             sidKamikaze, sidCake, sidSeduction, sidWatermelon,
       
   341             sidHellishBomb, sidDrill, sidBallgun, sidNapalm, sidRCPlane,
       
   342             sidLowGravity, sidExtraDamage, sidInvulnerable, sidExtraTime,
       
   343             sidLaserSight, sidVampiric, sidSniperRifle, sidJetpack,
       
   344             sidMolotov, sidBirdy, sidPortalGun, sidPiano, sidGasBomb, sidSineGun, sidFlamethrower,
       
   345             sidSMine, sidHammer, sidResurrector, sidDrillStrike);
       
   346 
       
   347     TMsgStrId = (sidStartFight, sidDraw, sidWinner, sidVolume, sidPaused,
       
   348             sidConfirm, sidSuddenDeath, sidRemaining, sidFuel, sidSync,
       
   349             sidNoEndTurn, sidNotYetAvailable, sidRoundSD, sidRoundsSD, sidReady);
       
   350 
       
   351     TEventId = (eidDied, eidDrowned, eidRoundStart, eidRoundWin, eidRoundDraw,
       
   352             eidNewHealthPack, eidNewAmmoPack, eidNewUtilityPack, eidTurnSkipped, eidHurtSelf,
       
   353             eidHomerun, eidGone);
       
   354 
       
   355     TGoalStrId = (gidCaption, gidSubCaption, gidForts, gidLowGravity, gidInvulnerable,
       
   356             gidVampiric, gidKarma, gidKing, gidPlaceHog, gidArtillery,
       
   357             gidSolidLand, gidSharedAmmo, gidMineTimer, gidNoMineTimer, gidRandomMineTimer,
       
   358             gidDamageModifier, gidResetHealth, gidAISurvival, gidInfAttack, gidResetWeps, gidPerHogAmmo);
       
   359 
   213 implementation
   360 implementation
   214 
   361 
   215 end.
   362 end.