51 procedure ChangeToSDFlakes; |
51 procedure ChangeToSDFlakes; |
52 |
52 |
53 procedure KickFlakes(Radius, X, Y: LongInt); |
53 procedure KickFlakes(Radius, X, Y: LongInt); |
54 |
54 |
55 implementation |
55 implementation |
56 uses uSound, uMobile, uVariables, uTextures, uRender, Math, uRenderUtils, uStore, uUtils; |
56 uses uSound, uVariables, uTextures, uRender, Math, uRenderUtils, uStore, uUtils; |
57 |
57 |
58 const cExplFrameTicks = 110; |
58 const |
|
59 cExplFrameTicks = 110; |
|
60 cSmokeZ = 499; |
59 var VGCounter: LongWord; |
61 var VGCounter: LongWord; |
|
62 VisualGearLayers: array[0..6] of PVisualGear; |
60 |
63 |
61 // For better maintainability the step handlers of visual gears are stored |
64 // For better maintainability the step handlers of visual gears are stored |
62 // in a separate file. |
65 // in a separate file. |
63 {$INCLUDE "VGSHandlers.inc"} |
66 {$INCLUDE "VGSHandlers.inc"} |
64 |
67 |
363 dx:= hwFloat2Float(AngleSin(t)) * sp; |
366 dx:= hwFloat2Float(AngleSin(t)) * sp; |
364 dy:= hwFloat2Float(AngleCos(t)) * sp * -2; |
367 dy:= hwFloat2Float(AngleCos(t)) * sp * -2; |
365 if random(2) = 0 then |
368 if random(2) = 0 then |
366 dx := -dx; |
369 dx := -dx; |
367 end; |
370 end; |
368 vgtNote: |
371 vgtNote: |
369 begin |
372 begin |
370 dx:= 0.005 * (random(15) + 10); |
373 dx:= 0.005 * (random(15) + 10); |
371 dy:= -0.001 * (random(40) + 20); |
374 dy:= -0.001 * (random(40) + 20); |
372 if random(2) = 0 then |
375 if random(2) = 0 then |
373 dx := -dx; |
376 dx := -dx; |
697 end |
700 end |
698 else if (Gear^.Tex <> nil) and (((Gear^.State = 0) and (Gear^.Hedgehog^.Team = CurrentTeam)) or (Gear^.State = 2)) then |
701 else if (Gear^.Tex <> nil) and (((Gear^.State = 0) and (Gear^.Hedgehog^.Team = CurrentTeam)) or (Gear^.State = 2)) then |
699 DrawTextureCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex); |
702 DrawTextureCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex); |
700 end; |
703 end; |
701 vgtSmallDamageTag: DrawTextureCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex); |
704 vgtSmallDamageTag: DrawTextureCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex); |
702 vgtHealthTag: if Gear^.Tex <> nil then |
705 vgtHealthTag: if Gear^.Tex <> nil then |
703 begin |
706 begin |
704 if Gear^.Frame = 0 then |
707 if Gear^.Frame = 0 then |
705 DrawTextureCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex) |
708 DrawTextureCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex) |
706 else |
709 else |
707 begin |
710 begin |
708 SetScale(cDefaultZoomLevel); |
711 SetScale(cDefaultZoomLevel); |
709 if Gear^.Angle = 0 then |
712 if Gear^.Angle = 0 then |
710 DrawTexture(round(Gear^.X), round(Gear^.Y), Gear^.Tex) |
713 DrawTexture(round(Gear^.X), round(Gear^.Y), Gear^.Tex) |
711 else |
714 else |
712 DrawTexture(round(Gear^.X), round(Gear^.Y), Gear^.Tex, Gear^.Angle); |
715 DrawTexture(round(Gear^.X), round(Gear^.Y), Gear^.Tex, Gear^.Angle); |
713 SetScale(zoom) |
716 SetScale(zoom) |
714 end |
717 end |
715 end; |
718 end; |
716 vgtStraightShot: begin |
719 vgtStraightShot: begin |
717 if Gear^.dX < 0 then |
720 if Gear^.dX < 0 then |
718 i:= -1 |
721 i:= -1 |
719 else |
722 else |
720 i:= 1; |
723 i:= 1; |
721 DrawTextureRotatedF(SpritesData[TSprite(Gear^.State)].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, i, SpritesData[TSprite(Gear^.State)].Width, SpritesData[TSprite(Gear^.State)].Height, Gear^.Angle); |
724 DrawTextureRotatedF(SpritesData[TSprite(Gear^.State)].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, i, SpritesData[TSprite(Gear^.State)].Width, SpritesData[TSprite(Gear^.State)].Height, Gear^.Angle); |