26 dY:= Gear^.dY; |
26 dY:= Gear^.dY; |
27 steps:= max(abs(hwRound(Gear^.X+dX)-hwRound(Gear^.X)), abs(hwRound(Gear^.Y+dY)-hwRound(Gear^.Y))); |
27 steps:= max(abs(hwRound(Gear^.X+dX)-hwRound(Gear^.X)), abs(hwRound(Gear^.Y+dY)-hwRound(Gear^.Y))); |
28 |
28 |
29 // Gear is still on the same Pixel it was before |
29 // Gear is still on the same Pixel it was before |
30 if steps < 1 then |
30 if steps < 1 then |
31 begin |
31 begin |
32 if onlyCheckIfChanged then |
32 if onlyCheckIfChanged then |
33 begin |
33 begin |
34 Gear^.X := Gear^.X + dX; |
34 Gear^.X := Gear^.X + dX; |
35 Gear^.Y := Gear^.Y + dY; |
35 Gear^.Y := Gear^.Y + dY; |
36 EXIT; |
36 EXIT; |
37 end |
37 end |
38 else |
38 else |
39 steps := 1; |
39 steps := 1; |
40 end; |
40 end; |
41 |
41 |
42 if steps > 1 then |
42 if steps > 1 then |
43 begin |
43 begin |
44 sX:= dX / steps; |
44 sX:= dX / steps; |
45 sY:= dY / steps; |
45 sY:= dY / steps; |
46 end |
46 end |
47 else |
47 else |
48 begin |
48 begin |
49 sX:= dX; |
49 sX:= dX; |
50 sY:= dY; |
50 sY:= dY; |
51 end; |
51 end; |
52 |
52 |
53 caller:= Gear^.doStep; |
53 caller:= Gear^.doStep; |
54 |
54 |
55 for i:= 1 to steps do |
55 for i:= 1 to steps do |
56 begin |
56 begin |
57 Gear^.X := Gear^.X + sX; |
57 Gear^.X := Gear^.X + sX; |
58 Gear^.Y := Gear^.Y + sY; |
58 Gear^.Y := Gear^.Y + sY; |
59 step(Gear); |
59 step(Gear); |
60 if (Gear^.doStep <> caller) |
60 if (Gear^.doStep <> caller) |
61 or ((Gear^.State and gstCollision) <> 0) |
61 or ((Gear^.State and gstCollision) <> 0) |
62 or ((Gear^.State and gstMoving) = 0) then |
62 or ((Gear^.State and gstMoving) = 0) then |
63 break; |
63 break; |
64 end; |
64 end; |
65 end; |
65 end; |
66 |
66 |
67 procedure makeHogsWorry(x, y: hwFloat; r: LongInt); |
67 procedure makeHogsWorry(x, y: hwFloat; r: LongInt); |
68 var |
68 var |
69 gi: PGear; |
69 gi: PGear; |
70 d: LongInt; |
70 d: LongInt; |
71 begin |
71 begin |
72 gi := GearsList; |
72 gi := GearsList; |
73 while gi <> nil do |
73 while gi <> nil do |
74 begin |
74 begin |
75 if (gi^.Kind = gtHedgehog) then |
75 if (gi^.Kind = gtHedgehog) then |
76 begin |
76 begin |
77 d := r - hwRound(Distance(gi^.X - x, gi^.Y - y)); |
77 d := r - hwRound(Distance(gi^.X - x, gi^.Y - y)); |
78 if (d > 1) and not gi^.Invulnerable and (GetRandom(2) = 0) then |
78 if (d > 1) and not gi^.Invulnerable and (GetRandom(2) = 0) then |
79 begin |
79 begin |
80 if (CurrentHedgehog^.Gear = gi) then |
80 if (CurrentHedgehog^.Gear = gi) then |
81 PlaySound(sndOops, gi^.Hedgehog^.Team^.voicepack) |
81 PlaySound(sndOops, gi^.Hedgehog^.Team^.voicepack) |
82 else |
82 else |
83 begin |
83 begin |
84 if (gi^.State and gstMoving) = 0 then |
84 if (gi^.State and gstMoving) = 0 then |
85 gi^.State := gi^.State or gstLoser; |
85 gi^.State := gi^.State or gstLoser; |
86 if d > r div 2 then |
86 if d > r div 2 then |
87 PlaySound(sndNooo, gi^.Hedgehog^.Team^.voicepack) |
87 PlaySound(sndNooo, gi^.Hedgehog^.Team^.voicepack) |
88 else |
88 else |
89 PlaySound(sndUhOh, gi^.Hedgehog^.Team^.voicepack); |
89 PlaySound(sndUhOh, gi^.Hedgehog^.Team^.voicepack); |
|
90 end; |
90 end; |
91 end; |
91 end; |
92 end; |
92 end; |
|
93 gi := gi^.NextGear |
93 gi := gi^.NextGear |
94 end; |
94 end; |
95 end; |
95 end; |
96 //////////////////////////////////////////////////////////////////////////////// |
96 //////////////////////////////////////////////////////////////////////////////// |
97 procedure doStepDrowningGear(Gear: PGear); |
97 procedure doStepDrowningGear(Gear: PGear); |
98 forward; |
98 forward; |
99 |
99 |
105 isSubmersible: boolean; |
105 isSubmersible: boolean; |
106 begin |
106 begin |
107 isSubmersible:= (Gear = CurrentHedgehog^.Gear) and (CurAmmoGear <> nil) and (CurAmmoGear^.AmmoType = amJetpack); |
107 isSubmersible:= (Gear = CurrentHedgehog^.Gear) and (CurAmmoGear <> nil) and (CurAmmoGear^.AmmoType = amJetpack); |
108 // probably needs tweaking. might need to be in a case statement based upon gear type |
108 // probably needs tweaking. might need to be in a case statement based upon gear type |
109 if cWaterLine < hwRound(Gear^.Y) + Gear^.Radius then |
109 if cWaterLine < hwRound(Gear^.Y) + Gear^.Radius then |
110 begin |
110 begin |
111 skipSpeed := _0_25; |
111 skipSpeed := _0_25; |
112 skipAngle := _1_9; |
112 skipAngle := _1_9; |
113 skipDecay := _0_87; |
113 skipDecay := _0_87; |
114 // this could perhaps be a tiny bit higher. |
114 // this could perhaps be a tiny bit higher. |
115 if (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > skipSpeed) and |
115 if (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > skipSpeed) and |
116 (hwAbs(Gear^.dX) > skipAngle * hwAbs(Gear^.dY)) then |
116 (hwAbs(Gear^.dX) > skipAngle * hwAbs(Gear^.dY)) then |
117 begin |
117 begin |
118 Gear^.dY.isNegative := true; |
118 Gear^.dY.isNegative := true; |
119 Gear^.dY := Gear^.dY * skipDecay; |
119 Gear^.dY := Gear^.dY * skipDecay; |
120 Gear^.dX := Gear^.dX * skipDecay; |
120 Gear^.dX := Gear^.dX * skipDecay; |
121 CheckGearDrowning := false; |
121 CheckGearDrowning := false; |
122 PlaySound(sndSkip) |
122 PlaySound(sndSkip) |
123 end |
123 end |
124 else |
124 else |
125 begin |
125 begin |
126 if not isSubmersible then |
126 if not isSubmersible then |
127 begin |
127 begin |
128 CheckGearDrowning := true; |
128 CheckGearDrowning := true; |
129 Gear^.State := gstDrowning; |
129 Gear^.State := gstDrowning; |
130 Gear^.RenderTimer := false; |
130 Gear^.RenderTimer := false; |
131 if (Gear^.Kind <> gtSniperRifleShot) and (Gear^.Kind <> gtShotgunShot) and (Gear^.Kind <> gtDEagleShot) and (Gear^.Kind <> gtSineGunShot) then |
131 if (Gear^.Kind <> gtSniperRifleShot) and (Gear^.Kind <> gtShotgunShot) and |
|
132 (Gear^.Kind <> gtDEagleShot) and (Gear^.Kind <> gtSineGunShot) then |
132 if Gear^.Kind = gtHedgehog then |
133 if Gear^.Kind = gtHedgehog then |
133 begin |
134 begin |
134 if Gear^.Hedgehog^.Effects[heResurrectable] then |
135 if Gear^.Hedgehog^.Effects[heResurrectable] then |
135 ResurrectHedgehog(Gear) |
136 ResurrectHedgehog(Gear) |
136 else |
137 else |
150 end; |
151 end; |
151 |
152 |
152 if ((cReducedQuality and rqPlainSplash) = 0) and |
153 if ((cReducedQuality and rqPlainSplash) = 0) and |
153 (((not isSubmersible) and (hwRound(Gear^.Y) < cWaterLine + 64 + Gear^.Radius)) or |
154 (((not isSubmersible) and (hwRound(Gear^.Y) < cWaterLine + 64 + Gear^.Radius)) or |
154 (isSubmersible and (hwRound(Gear^.Y) < cWaterLine + 2 + Gear^.Radius) and ((CurAmmoGear^.Pos = 0) and (CurAmmoGear^.dY < _0_01)))) then |
155 (isSubmersible and (hwRound(Gear^.Y) < cWaterLine + 2 + Gear^.Radius) and ((CurAmmoGear^.Pos = 0) and (CurAmmoGear^.dY < _0_01)))) then |
155 begin |
156 begin |
156 AddVisualGear(hwRound(Gear^.X), cWaterLine, vgtSplash); |
157 AddVisualGear(hwRound(Gear^.X), cWaterLine, vgtSplash); |
157 |
158 |
158 maxDrops := (Gear^.Radius div 2) + hwRound(Gear^.dX * Gear^.Radius * 2) + hwRound(Gear^. |
159 maxDrops := (Gear^.Radius div 2) + hwRound(Gear^.dX * Gear^.Radius * 2) + hwRound(Gear^. |
159 dY * Gear^.Radius * 2); |
160 dY * Gear^.Radius * 2); |
160 for i:= max(maxDrops div 3, min(32, Random(maxDrops))) downto 0 do |
161 for i:= max(maxDrops div 3, min(32, Random(maxDrops))) downto 0 do |
161 begin |
162 begin |
162 particle := AddVisualGear(hwRound(Gear^.X) - 3 + Random(6), cWaterLine, vgtDroplet); |
163 particle := AddVisualGear(hwRound(Gear^.X) - 3 + Random(6), cWaterLine, vgtDroplet); |
163 if particle <> nil then |
164 if particle <> nil then |
164 begin |
165 begin |
165 particle^.dX := particle^.dX - (Gear^.dX.QWordValue / 42949672960); |
166 particle^.dX := particle^.dX - (Gear^.dX.QWordValue / 42949672960); |
166 particle^.dY := particle^.dY - (Gear^.dY.QWordValue / 21474836480) |
167 particle^.dY := particle^.dY - (Gear^.dY.QWordValue / 21474836480) |
|
168 end |
167 end |
169 end |
168 end |
170 end; |
169 end; |
|
170 if isSubmersible and (CurAmmoGear^.Pos = 0) then CurAmmoGear^.Pos := 1000 |
171 if isSubmersible and (CurAmmoGear^.Pos = 0) then CurAmmoGear^.Pos := 1000 |
171 end |
172 end |
172 else |
173 else |
173 CheckGearDrowning := false; |
174 CheckGearDrowning := false; |
174 end; |
175 end; |
186 dmg: Longword; |
187 dmg: Longword; |
187 i: LongInt; |
188 i: LongInt; |
188 particle: PVisualGear; |
189 particle: PVisualGear; |
189 begin |
190 begin |
190 if _0_4 < Gear^.dY then |
191 if _0_4 < Gear^.dY then |
191 begin |
192 begin |
192 dmg := ModifyDamage(1 + hwRound((hwAbs(Gear^.dY) - _0_4) * 70), Gear); |
193 dmg := ModifyDamage(1 + hwRound((hwAbs(Gear^.dY) - _0_4) * 70), Gear); |
193 PlaySound(sndBump); |
194 PlaySound(sndBump); |
194 if dmg < 1 then exit; |
195 if dmg < 1 then exit; |
195 |
196 |
196 for i:= min(12, (3 + dmg div 10)) downto 0 do |
197 for i:= min(12, (3 + dmg div 10)) downto 0 do |
197 begin |
198 begin |
198 particle := AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, |
199 particle := AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, vgtDust); |
199 vgtDust); |
|
200 if particle <> nil then particle^.dX := particle^.dX + (Gear^.dX.QWordValue / 21474836480); |
200 if particle <> nil then particle^.dX := particle^.dX + (Gear^.dX.QWordValue / 21474836480); |
201 end; |
201 end; |
202 |
202 |
203 if (Gear^.Invulnerable) then exit; |
203 if (Gear^.Invulnerable) then exit; |
204 |
204 |
205 //if _0_6 < Gear^.dY then |
205 //if _0_6 < Gear^.dY then |
206 // PlaySound(sndOw4, Gear^.Hedgehog^.Team^.voicepack) |
206 // PlaySound(sndOw4, Gear^.Hedgehog^.Team^.voicepack) |
265 |
265 |
266 // might need some testing/adjustments - just to avoid projectiles to fly forever (accelerated by wind/skips) |
266 // might need some testing/adjustments - just to avoid projectiles to fly forever (accelerated by wind/skips) |
267 if (hwRound(Gear^.X) < LAND_WIDTH div -2) or (hwRound(Gear^.X) > LAND_WIDTH * 3 div 2) then Gear^.State := Gear^.State or gstCollision; |
267 if (hwRound(Gear^.X) < LAND_WIDTH div -2) or (hwRound(Gear^.X) > LAND_WIDTH * 3 div 2) then Gear^.State := Gear^.State or gstCollision; |
268 |
268 |
269 if Gear^.dY.isNegative then |
269 if Gear^.dY.isNegative then |
270 begin |
270 begin |
271 isFalling := true; |
271 isFalling := true; |
272 if TestCollisionYwithGear(Gear, -1) then |
272 if TestCollisionYwithGear(Gear, -1) then |
273 begin |
273 begin |
274 collV := -1; |
274 collV := -1; |
275 Gear^.dX := Gear^.dX * Gear^.Friction; |
275 Gear^.dX := Gear^.dX * Gear^.Friction; |
276 Gear^.dY := - Gear^.dY * Gear^.Elasticity; |
276 Gear^.dY := - Gear^.dY * Gear^.Elasticity; |
277 Gear^.State := Gear^.State or gstCollision |
277 Gear^.State := Gear^.State or gstCollision |
|
278 end |
|
279 else if (Gear^.AdvBounce=1) and TestCollisionYwithGear(Gear, 1) then collV := 1; |
278 end |
280 end |
279 else if (Gear^.AdvBounce=1) and TestCollisionYwithGear(Gear, 1) then collV := 1; |
|
280 end |
|
281 else if TestCollisionYwithGear(Gear, 1) then |
281 else if TestCollisionYwithGear(Gear, 1) then |
282 begin |
282 begin |
283 collV := 1; |
283 collV := 1; |
284 isFalling := false; |
284 isFalling := false; |
285 Gear^.dX := Gear^.dX * Gear^.Friction; |
285 Gear^.dX := Gear^.dX * Gear^.Friction; |
286 Gear^.dY := - Gear^.dY * Gear^.Elasticity; |
286 Gear^.dY := - Gear^.dY * Gear^.Elasticity; |
287 Gear^.State := Gear^.State or gstCollision |
287 Gear^.State := Gear^.State or gstCollision |
288 end |
288 end |
289 else |
289 else |
290 begin |
290 begin |
291 isFalling := true; |
291 isFalling := true; |
292 if (Gear^.AdvBounce=1) and not Gear^.dY.isNegative and TestCollisionYwithGear(Gear, -1) then |
292 if (Gear^.AdvBounce=1) and not Gear^.dY.isNegative and TestCollisionYwithGear(Gear, -1) then |
293 collV := -1; |
293 collV := -1; |
294 end; |
294 end; |
295 |
295 |
296 |
296 |
297 if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then |
297 if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then |
298 begin |
298 begin |
299 collH := hwSign(Gear^.dX); |
299 collH := hwSign(Gear^.dX); |
300 Gear^.dX := - Gear^.dX * Gear^.Elasticity; |
300 Gear^.dX := - Gear^.dX * Gear^.Elasticity; |
301 Gear^.dY := Gear^.dY * Gear^.Elasticity; |
301 Gear^.dY := Gear^.dY * Gear^.Elasticity; |
302 Gear^.State := Gear^.State or gstCollision |
302 Gear^.State := Gear^.State or gstCollision |
303 end |
303 end |
304 else if (Gear^.AdvBounce=1) and TestCollisionXwithGear(Gear, -hwSign(Gear^.dX)) then |
304 else if (Gear^.AdvBounce=1) and TestCollisionXwithGear(Gear, -hwSign(Gear^.dX)) then |
305 collH := -hwSign(Gear^.dX); |
305 collH := -hwSign(Gear^.dX); |
306 //if Gear^.AdvBounce and (collV <>0) and (collH <> 0) and (hwSqr(tdX) + hwSqr(tdY) > _0_08) then |
306 //if Gear^.AdvBounce and (collV <>0) and (collH <> 0) and (hwSqr(tdX) + hwSqr(tdY) > _0_08) then |
307 if (Gear^.AdvBounce=1) and (collV <>0) and (collH <> 0) and ((collV=-1) or ((tdX.QWordValue + |
307 if (Gear^.AdvBounce=1) and (collV <>0) and (collH <> 0) and ((collV=-1) or ((tdX.QWordValue + |
308 tdY.QWordValue) > _0_2.QWordValue)) then |
308 tdY.QWordValue) > _0_2.QWordValue)) then |
309 begin |
309 begin |
310 Gear^.dX := tdY*Gear^.Elasticity*Gear^.Friction; |
310 Gear^.dX := tdY*Gear^.Elasticity*Gear^.Friction; |
311 Gear^.dY := tdX*Gear^.Elasticity; |
311 Gear^.dY := tdX*Gear^.Elasticity; |
312 //*Gear^.Friction; |
312 //*Gear^.Friction; |
313 Gear^.dY.isNegative := not tdY.isNegative; |
313 Gear^.dY.isNegative := not tdY.isNegative; |
314 isFalling := false; |
314 isFalling := false; |
315 Gear^.AdvBounce := 10; |
315 Gear^.AdvBounce := 10; |
316 end; |
316 end; |
317 |
317 |
318 if Gear^.AdvBounce > 1 then dec(Gear^.AdvBounce); |
318 if Gear^.AdvBounce > 1 then dec(Gear^.AdvBounce); |
319 |
319 |
320 if isFalling then |
320 if isFalling then |
321 begin |
321 begin |
517 begin |
517 begin |
518 AllInactive := false; |
518 AllInactive := false; |
519 if (GameFlags and gfMoreWind) = 0 then Gear^.dX := Gear^.dX + cWindSpeed; |
519 if (GameFlags and gfMoreWind) = 0 then Gear^.dX := Gear^.dX + cWindSpeed; |
520 doStepFallingGear(Gear); |
520 doStepFallingGear(Gear); |
521 if (Gear^.State and gstCollision) <> 0 then |
521 if (Gear^.State and gstCollision) <> 0 then |
522 begin |
522 begin |
523 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
523 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
524 DeleteGear(Gear); |
524 DeleteGear(Gear); |
525 exit |
525 exit |
526 end; |
526 end; |
527 if (GameTicks and $3F) = 0 then |
527 if (GameTicks and $3F) = 0 then |
528 AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace); |
528 AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace); |
|
529 end; |
|
530 |
|
531 //////////////////////////////////////////////////////////////////////////////// |
|
532 procedure doStepSnowball(Gear: PGear); |
|
533 var kick, i: LongInt; |
|
534 particle: PVisualGear; |
|
535 begin |
|
536 AllInactive := false; |
|
537 if (GameFlags and gfMoreWind) = 0 then Gear^.dX := Gear^.dX + cWindSpeed; |
|
538 doStepFallingGear(Gear); |
|
539 CalcRotationDirAngle(Gear); |
|
540 if (Gear^.State and gstCollision) <> 0 then |
|
541 begin |
|
542 kick:= hwRound((hwAbs(Gear^.dX)+hwAbs(Gear^.dY)) * _20); |
|
543 Gear^.dY.isNegative:= not Gear^.dY.isNegative; |
|
544 Gear^.dX.isNegative:= not Gear^.dX.isNegative; |
|
545 AmmoShove(Gear, 1, kick); |
|
546 for i:= 15 + kick div 10 downto 0 do |
|
547 begin |
|
548 particle := AddVisualGear(hwRound(Gear^.X) + Random(25), hwRound(Gear^.Y) + Random(25), vgtDust); |
|
549 if particle <> nil then particle^.dX := particle^.dX + (Gear^.dX.QWordValue / 21474836480) |
|
550 end; |
|
551 DeleteGear(Gear); |
|
552 exit |
|
553 end; |
|
554 if ((GameTicks and $1F) = 0) and (Random(3) = 0) then |
|
555 begin |
|
556 AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtDust); |
|
557 if particle <> nil then particle^.dX := particle^.dX + (Gear^.dX.QWordValue / 21474836480) |
|
558 end |
529 end; |
559 end; |
530 |
560 |
531 //////////////////////////////////////////////////////////////////////////////// |
561 //////////////////////////////////////////////////////////////////////////////// |
532 procedure doStepGrave(Gear: PGear); |
562 procedure doStepGrave(Gear: PGear); |
533 begin |
563 begin |
893 end; |
923 end; |
894 |
924 |
895 //////////////////////////////////////////////////////////////////////////////// |
925 //////////////////////////////////////////////////////////////////////////////// |
896 procedure doStepPickHammerWork(Gear: PGear); |
926 procedure doStepPickHammerWork(Gear: PGear); |
897 var |
927 var |
898 i, ei: LongInt; |
928 i, ei, x, y: LongInt; |
899 HHGear: PGear; |
929 HHGear: PGear; |
900 begin |
930 begin |
901 AllInactive := false; |
931 AllInactive := false; |
902 HHGear := Gear^.Hedgehog^.Gear; |
932 HHGear := Gear^.Hedgehog^.Gear; |
903 dec(Gear^.Timer); |
933 dec(Gear^.Timer); |
904 if (Gear^.Timer = 0)or((Gear^.Message and gmDestroy) <> 0)or((HHGear^.State and gstHHDriven) = |
934 if (Gear^.Timer = 0)or((Gear^.Message and gmDestroy) <> 0)or((HHGear^.State and gstHHDriven) = |
905 0) then |
935 0) then |
906 begin |
936 begin |
907 StopSound(Gear^.SoundChannel); |
937 StopSound(Gear^.SoundChannel); |
908 DeleteGear(Gear); |
938 DeleteGear(Gear); |
909 AfterAttack; |
939 AfterAttack; |
910 doStepHedgehogMoving(HHGear); // for gfInfAttack |
940 doStepHedgehogMoving(HHGear); // for gfInfAttack |
911 exit |
941 exit |
912 end; |
942 end; |
913 |
943 |
|
944 x:= hwRound(Gear^.X); |
|
945 y:= hwRound(Gear^.Y); |
914 if (Gear^.Timer mod 33) = 0 then |
946 if (Gear^.Timer mod 33) = 0 then |
915 begin |
947 begin |
916 HHGear^.State := HHGear^.State or gstNoDamage; |
948 HHGear^.State := HHGear^.State or gstNoDamage; |
917 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y) + 7, 6, EXPLDontDraw); |
949 doMakeExplosion(x, y + 7, 6, EXPLDontDraw); |
918 HHGear^.State := HHGear^.State and not gstNoDamage |
950 HHGear^.State := HHGear^.State and not gstNoDamage |
919 end; |
951 end; |
920 |
952 |
921 if (Gear^.Timer mod 47) = 0 then |
953 if (Gear^.Timer mod 47) = 0 then |
922 begin |
954 begin |
923 for i:= 0 to 1 do |
955 // ok. this was an attempt to turn off dust if not actually drilling land. I have no idea why it isn't working as expected |
924 AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, vgtDust); |
956 //if ((y + 12 and LAND_HEIGHT_MASK) = 0) and ((x and LAND_WIDTH_MASK) = 0) and (Land[y + 12, x] > 255) then |
925 i := hwRound(Gear^.X) - Gear^.Radius - LongInt(GetRandom(2)); |
957 for i:= 0 to 1 do |
926 ei := hwRound(Gear^.X) + Gear^.Radius + LongInt(GetRandom(2)); |
958 AddVisualGear(x - 5 + Random(10), y + 12, vgtDust); |
|
959 |
|
960 i := x - Gear^.Radius - LongInt(GetRandom(2)); |
|
961 ei := x + Gear^.Radius + LongInt(GetRandom(2)); |
927 while i <= ei do |
962 while i <= ei do |
928 begin |
963 begin |
929 DrawExplosion(i, hwRound(Gear^.Y) + 3, 3); |
964 DrawExplosion(i, y + 3, 3); |
930 inc(i, 1) |
965 inc(i, 1) |
931 end; |
966 end; |
932 |
967 |
933 if CheckLandValue(hwRound(Gear^.X + Gear^.dX + SignAs(_6,Gear^.dX)), hwRound(Gear^.Y + _1_9) |
968 if CheckLandValue(hwRound(Gear^.X + Gear^.dX + SignAs(_6,Gear^.dX)), hwRound(Gear^.Y + _1_9) |
934 , lfIndestructible) then |
969 , lfIndestructible) then |
935 begin |
970 begin |
936 Gear^.X := Gear^.X + Gear^.dX; |
971 Gear^.X := Gear^.X + Gear^.dX; |
937 Gear^.Y := Gear^.Y + _1_9; |
972 Gear^.Y := Gear^.Y + _1_9; |
938 end; |
973 end; |
939 SetAllHHToActive; |
974 SetAllHHToActive; |
940 end; |
975 end; |
941 if TestCollisionYwithGear(Gear, 1) then |
976 if TestCollisionYwithGear(Gear, 1) then |
942 begin |
977 begin |
943 Gear^.dY := _0; |
978 Gear^.dY := _0; |
944 SetLittle(HHGear^.dX); |
979 SetLittle(HHGear^.dX); |
945 HHGear^.dY := _0; |
980 HHGear^.dY := _0; |
946 end |
981 end |
947 else |
982 else |
948 begin |
983 begin |
949 Gear^.dY := Gear^.dY + cGravity; |
984 Gear^.dY := Gear^.dY + cGravity; |
950 Gear^.Y := Gear^.Y + Gear^.dY; |
985 Gear^.Y := Gear^.Y + Gear^.dY; |
951 if hwRound(Gear^.Y) > cWaterLine then Gear^.Timer := 1 |
986 if hwRound(Gear^.Y) > cWaterLine then Gear^.Timer := 1 |
952 end; |
987 end; |
953 |
988 |
954 Gear^.X := Gear^.X + HHGear^.dX; |
989 Gear^.X := Gear^.X + HHGear^.dX; |
955 HHGear^.X := Gear^.X; |
990 HHGear^.X := Gear^.X; |
956 HHGear^.Y := Gear^.Y - int2hwFloat(cHHRadius); |
991 HHGear^.Y := Gear^.Y - int2hwFloat(cHHRadius); |
957 |
992 |
2686 x := hwRound(Gear^.X); |
2721 x := hwRound(Gear^.X); |
2687 y := hwRound(Gear^.Y); |
2722 y := hwRound(Gear^.Y); |
2688 |
2723 |
2689 if ((y and LAND_HEIGHT_MASK) = 0) and ((x and LAND_WIDTH_MASK) = 0) then |
2724 if ((y and LAND_HEIGHT_MASK) = 0) and ((x and LAND_WIDTH_MASK) = 0) then |
2690 if (Land[y, x] <> 0) then |
2725 if (Land[y, x] <> 0) then |
2691 begin |
2726 begin |
2692 Gear^.dX.isNegative := not Gear^.dX.isNegative; |
2727 Gear^.dX.isNegative := not Gear^.dX.isNegative; |
2693 Gear^.dY.isNegative := not Gear^.dY.isNegative; |
2728 Gear^.dY.isNegative := not Gear^.dY.isNegative; |
2694 Gear^.dX := Gear^.dX * _1_5; |
2729 Gear^.dX := Gear^.dX * _1_5; |
2695 Gear^.dY := Gear^.dY * _1_5 - _0_3; |
2730 Gear^.dY := Gear^.dY * _1_5 - _0_3; |
2696 AmmoShove(Gear, 0, 40); |
2731 AmmoShove(Gear, 0, 40); |
2697 AfterAttack; |
2732 AfterAttack; |
2698 DeleteGear(Gear) |
2733 DeleteGear(Gear) |
2699 end |
2734 end |
|
2735 else |
2700 else |
2736 else |
2701 else |
2737 begin |
2702 begin |
|
2703 AfterAttack; |
2738 AfterAttack; |
2704 DeleteGear(Gear) |
2739 DeleteGear(Gear) |
2705 end |
2740 end |
2706 end; |
2741 end; |
2707 |
2742 |
2708 procedure doStepSeductionWear(Gear: PGear); |
2743 procedure doStepSeductionWear(Gear: PGear); |
2709 begin |
2744 begin |
2710 AllInactive := false; |
2745 AllInactive := false; |