hedgewars/uGearsList.pas
changeset 8795 b5b79a8f9354
parent 8774 39754516eee6
child 8833 c13ebed437cb
child 8987 47cf32305d99
equal deleted inserted replaced
8793:43e106417a05 8795:b5b79a8f9354
    34 uses uRandom, uUtils, uConsts, uVariables, uAmmos, uTeams, uStats,
    34 uses uRandom, uUtils, uConsts, uVariables, uAmmos, uTeams, uStats,
    35     uTextures, uScript, uRenderUtils, uAI, uCollisions,
    35     uTextures, uScript, uRenderUtils, uAI, uCollisions,
    36     uGearsRender, uGearsUtils, uDebug;
    36     uGearsRender, uGearsUtils, uDebug;
    37 
    37 
    38 const
    38 const
    39     GearKindAmmoTypeMap : array [TGearType] of TAmmoType = (    
    39     GearKindAmmoTypeMap : array [TGearType] of TAmmoType = (
    40 (*          gtFlame *)   amNothing
    40 (*          gtFlame *)   amNothing
    41 (*       gtHedgehog *) , amNothing
    41 (*       gtHedgehog *) , amNothing
    42 (*           gtMine *) , amMine
    42 (*           gtMine *) , amMine
    43 (*           gtCase *) , amNothing
    43 (*           gtCase *) , amNothing
    44 (*     gtExplosives *) , amNothing
    44 (*     gtExplosives *) , amNothing
   179 gear^.Density:= _1;
   179 gear^.Density:= _1;
   180 // Define ammo association, if any.
   180 // Define ammo association, if any.
   181 gear^.AmmoType:= GearKindAmmoTypeMap[Kind];
   181 gear^.AmmoType:= GearKindAmmoTypeMap[Kind];
   182 gear^.CollisionMask:= $FFFF;
   182 gear^.CollisionMask:= $FFFF;
   183 
   183 
   184 if CurrentHedgehog <> nil then 
   184 if CurrentHedgehog <> nil then
   185     begin
   185     begin
   186     gear^.Hedgehog:= CurrentHedgehog;
   186     gear^.Hedgehog:= CurrentHedgehog;
   187     if (CurrentHedgehog^.Gear <> nil) and (hwRound(CurrentHedgehog^.Gear^.X) = X) and (hwRound(CurrentHedgehog^.Gear^.Y) = Y) then
   187     if (CurrentHedgehog^.Gear <> nil) and (hwRound(CurrentHedgehog^.Gear^.X) = X) and (hwRound(CurrentHedgehog^.Gear^.Y) = Y) then
   188         gear^.CollisionMask:= lfNotCurrentMask
   188         gear^.CollisionMask:= lfNotCurrentMask
   189     end;
   189     end;
   190 
   190 
   191 if (Ammoz[Gear^.AmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0) then
   191 if (Ammoz[Gear^.AmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0) then
   192     gear^.Z:= cHHZ+1
   192     gear^.Z:= cHHZ+1
   193 else gear^.Z:= cUsualZ;
   193 else gear^.Z:= cUsualZ;
   194 
   194 
   195     
   195 
   196 case Kind of
   196 case Kind of
   197      gtGrenade,
   197      gtGrenade,
   198      gtClusterBomb,
   198      gtClusterBomb,
   199      gtGasBomb: begin
   199      gtGasBomb: begin
   200                 gear^.ImpactSound:= sndGrenadeImpact;
   200                 gear^.ImpactSound:= sndGrenadeImpact;
   546                 gear^.Timer:= 0;
   546                 gear^.Timer:= 0;
   547                 gear^.Tag:= TotalRounds + 3;
   547                 gear^.Tag:= TotalRounds + 3;
   548                 gear^.Pos:= 1;
   548                 gear^.Pos:= 1;
   549                 end;
   549                 end;
   550 }
   550 }
   551       gtIceGun: gear^.Health:= 1000;
   551       gtIceGun: begin
       
   552                 gear^.Health:= 1000;
       
   553                 gear^.Radius:= 8;
       
   554                 end;
   552 gtGenericFaller:begin
   555 gtGenericFaller:begin
   553                 gear^.AdvBounce:= 1;
   556                 gear^.AdvBounce:= 1;
   554                 gear^.Radius:= 1;
   557                 gear^.Radius:= 1;
   555                 gear^.Elasticity:= _0_9;
   558                 gear^.Elasticity:= _0_9;
   556                 gear^.Friction:= _0_995;
   559                 gear^.Friction:= _0_995;
   643         inc(KilledHHs);
   646         inc(KilledHHs);
   644         RecountTeamHealth(team);
   647         RecountTeamHealth(team);
   645         if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Effects[heResurrectable] <> 0)  and
   648         if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Effects[heResurrectable] <> 0)  and
   646         //(Gear^.Hedgehog^.Effects[heResurrectable] = 0) then
   649         //(Gear^.Hedgehog^.Effects[heResurrectable] = 0) then
   647         (Gear^.Hedgehog^.Team^.Clan <> CurrentHedgehog^.Team^.Clan) then
   650         (Gear^.Hedgehog^.Team^.Clan <> CurrentHedgehog^.Team^.Clan) then
   648             with CurrentHedgehog^ do 
   651             with CurrentHedgehog^ do
   649                 begin
   652                 begin
   650                 inc(Team^.stats.AIKills);
   653                 inc(Team^.stats.AIKills);
   651                 FreeTexture(Team^.AIKillsTex);
   654                 FreeTexture(Team^.AIKillsTex);
   652                 Team^.AIKillsTex := RenderStringTex(inttostr(Team^.stats.AIKills), Team^.Clan^.Color, fnt16);
   655                 Team^.AIKillsTex := RenderStringTex(inttostr(Team^.stats.AIKills), Team^.Clan^.Color, fnt16);
   653                 end
   656                 end