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; |
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 |