145 |
145 |
146 implementation |
146 implementation |
147 uses uConsts, uVariables, uVisualGearsList, uRandom, uCollisions, uGearsList, uUtils, uSound |
147 uses uConsts, uVariables, uVisualGearsList, uRandom, uCollisions, uGearsList, uUtils, uSound |
148 , SDLh, uScript, uGearsHedgehog, uGearsUtils, uIO, uCaptions, uLandGraphics |
148 , SDLh, uScript, uGearsHedgehog, uGearsUtils, uIO, uCaptions, uLandGraphics |
149 , uGearsHandlers, uTextures, uRenderUtils, uAmmos, uTeams, uLandTexture, uCommands |
149 , uGearsHandlers, uTextures, uRenderUtils, uAmmos, uTeams, uLandTexture, uCommands |
150 , uStore, uAI, uStats; |
150 , uStore, uAI, uStats, uLocale; |
151 |
151 |
152 procedure doStepPerPixel(Gear: PGear; step: TGearStepProcedure; onlyCheckIfChanged: boolean); |
152 procedure doStepPerPixel(Gear: PGear; step: TGearStepProcedure; onlyCheckIfChanged: boolean); |
153 var |
153 var |
154 dX, dY, sX, sY: hwFloat; |
154 dX, dY, sX, sY: hwFloat; |
155 i, steps: LongWord; |
155 i, steps: LongWord; |
1750 Gear^.State := Gear^.State or gstAttacking |
1750 Gear^.State := Gear^.State or gstAttacking |
1751 end |
1751 end |
1752 else // gstAttacking <> 0 |
1752 else // gstAttacking <> 0 |
1753 begin |
1753 begin |
1754 AllInactive := false; |
1754 AllInactive := false; |
1755 // tag of 1 means this mine has a random timer |
|
1756 if (Gear^.Tag = 1) and (Gear^.Timer = 0) then |
|
1757 begin |
|
1758 if (GameTicks mod 2 = 0) then GetRandom(2); |
|
1759 if (GameTicks mod 3 = 0) then GetRandom(2); |
|
1760 Gear^.Timer:= GetRandom(51) * 100; |
|
1761 Gear^.Tag:= 0; |
|
1762 end; |
|
1763 if (Gear^.Timer and $FF) = 0 then |
1755 if (Gear^.Timer and $FF) = 0 then |
1764 PlaySound(sndMineTick); |
1756 PlaySound(sndMineTick); |
1765 if Gear^.Timer = 0 then |
1757 if Gear^.Timer = 0 then |
1766 begin |
1758 begin |
1767 if ((Gear^.State and gstWait) <> 0) |
1759 if ((Gear^.State and gstWait) <> 0) |
5509 graves.ar^[i]^.Message:= graves.ar^[i]^.Message or gmDestroy; |
5505 graves.ar^[i]^.Message:= graves.ar^[i]^.Message or gmDestroy; |
5510 graves.ar^[i]^.Active:= true; |
5506 graves.ar^[i]^.Active:= true; |
5511 RenderHealth(resgear^.Hedgehog^); |
5507 RenderHealth(resgear^.Hedgehog^); |
5512 RecountTeamHealth(resgear^.Hedgehog^.Team); |
5508 RecountTeamHealth(resgear^.Hedgehog^.Team); |
5513 resgear^.Hedgehog^.Effects[heResurrected]:= 1; |
5509 resgear^.Hedgehog^.Effects[heResurrected]:= 1; |
|
5510 s:= ansistring(resgear^.Hedgehog^.Name); |
|
5511 AddCaption(FormatA(GetEventString(eidResurrected), s), cWhiteColor, capgrpMessage); |
5514 // only make hat-less hedgehogs look like zombies, preserve existing hats |
5512 // only make hat-less hedgehogs look like zombies, preserve existing hats |
5515 |
5513 |
5516 if resgear^.Hedgehog^.Hat = 'NoHat' then |
5514 if resgear^.Hedgehog^.Hat = 'NoHat' then |
5517 LoadHedgehogHat(resgear^.Hedgehog^, 'Reserved/Zombie'); |
5515 LoadHedgehogHat(resgear^.Hedgehog^, 'Reserved/Zombie'); |
5518 end; |
5516 end; |
5729 ((Gear^.State and (gstMoving or gstHHDeath or gstHHGone)) = 0) then |
5728 ((Gear^.State and (gstMoving or gstHHDeath or gstHHGone)) = 0) then |
5730 HideHog(HH) |
5729 HideHog(HH) |
5731 end |
5730 end |
5732 //else if (HH^.Gear <> nil) and (HH^.Gear^.State and gstInvisible <> 0) then |
5731 //else if (HH^.Gear <> nil) and (HH^.Gear^.State and gstInvisible <> 0) then |
5733 else if (HH^.GearHidden <> nil) then// and (HH^.Gear^.State and gstInvisible <> 0) then |
5732 else if (HH^.GearHidden <> nil) then// and (HH^.Gear^.State and gstInvisible <> 0) then |
5734 RestoreHog(HH) |
5733 begin |
|
5734 RestoreHog(HH); |
|
5735 s:= ansistring(HH^.Name); |
|
5736 AddCaption(FormatA(GetEventString(eidTimeTravelEnd), s), cWhiteColor, capgrpMessage) |
|
5737 end |
5735 end; |
5738 end; |
5736 |
5739 |
5737 inc(Gear^.Timer); |
5740 inc(Gear^.Timer); |
5738 if (Gear^.Timer > 2000) and ((GameTicks mod 2000) = 1000) then |
5741 if (Gear^.Timer > 2000) and ((GameTicks mod 2000) = 1000) then |
5739 begin |
5742 begin |