78 uses uCollisions, uVariables, Math, uConsts, uVisualGearsList, uFloat, uSound, uRenderUtils, uWorld; |
78 uses uCollisions, uVariables, Math, uConsts, uVisualGearsList, uFloat, uSound, uRenderUtils, uWorld; |
79 |
79 |
80 procedure doStepFlake(Gear: PVisualGear; Steps: Longword); |
80 procedure doStepFlake(Gear: PVisualGear; Steps: Longword); |
81 var sign: real; |
81 var sign: real; |
82 moved: boolean; |
82 moved: boolean; |
|
83 vfc, vft: LongWord; |
83 begin |
84 begin |
84 if vobCount = 0 then exit; |
85 if vobCount = 0 then exit; |
85 |
86 |
86 sign:= 1; |
87 sign:= 1; |
87 with Gear^ do |
88 with Gear^ do |
88 begin |
89 begin |
89 if vobFrameTicks < 1000000 then |
90 |
|
91 X:= X + (cWindSpeedf * 400 + dX + tdX) * Steps * Gear^.Scale; |
|
92 |
|
93 if SuddenDeathDmg then |
|
94 begin |
|
95 Y:= Y + (dY + tdY + cGravityf * vobSDFallSpeed) * Steps * Gear^.Scale; |
|
96 vfc:= vobSDFramesCount; |
|
97 vft:= vobSDFrameTicks; |
|
98 end |
|
99 else |
|
100 begin |
|
101 Y:= Y + (dY + tdY + cGravityf * vobFallSpeed) * Steps * Gear^.Scale; |
|
102 vfc:= vobFramesCount; |
|
103 vft:= vobFrameTicks; |
|
104 end; |
|
105 |
|
106 if vft > 0 then |
90 begin |
107 begin |
91 inc(FrameTicks, Steps); |
108 inc(FrameTicks, Steps); |
92 if not SuddenDeathDmg and (FrameTicks > vobFrameTicks) then |
109 if FrameTicks > vft then |
93 begin |
110 begin |
94 dec(FrameTicks, vobFrameTicks); |
111 dec(FrameTicks, vft); |
95 inc(Frame); |
112 inc(Frame); |
96 if Frame = vobFramesCount then |
113 if Frame = vfc then |
97 Frame:= 0 |
|
98 end |
|
99 else if SuddenDeathDmg and (FrameTicks > vobSDFrameTicks) then |
|
100 begin |
|
101 dec(FrameTicks, vobSDFrameTicks); |
|
102 inc(Frame); |
|
103 if Frame = vobSDFramesCount then |
|
104 Frame:= 0 |
114 Frame:= 0 |
105 end; |
115 end; |
106 end; |
116 end; |
107 X:= X + (cWindSpeedf * 400 + dX + tdX) * Steps * Gear^.Scale; |
117 |
108 if SuddenDeathDmg then |
|
109 Y:= Y + (dY + tdY + cGravityf * vobSDFallSpeed) * Steps * Gear^.Scale |
|
110 else |
|
111 Y:= Y + (dY + tdY + cGravityf * vobFallSpeed) * Steps * Gear^.Scale; |
|
112 Angle:= Angle + dAngle * Steps; |
118 Angle:= Angle + dAngle * Steps; |
113 if Angle > 360 then |
119 if Angle > 360 then |
114 Angle:= Angle - 360 |
120 Angle:= Angle - 360 |
115 else |
121 else |
116 if Angle < - 360 then |
122 if Angle < - 360 then |