14 * You should have received a copy of the GNU General Public License |
14 * You should have received a copy of the GNU General Public License |
15 * along with this program; if not, write to the Free Software |
15 * along with this program; if not, write to the Free Software |
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
17 *) |
17 *) |
18 |
18 |
|
19 procedure makeHogsWorry(x, y: hwFloat; r: LongInt); |
|
20 var gi: PGear; |
|
21 d: LongInt; |
|
22 begin |
|
23 gi:= GearsList; |
|
24 while gi <> nil do |
|
25 begin |
|
26 d:= r - hwRound(Distance(gi^.X - x, gi^.Y - y)); |
|
27 if (d > 1) and (gi^.Kind = gtHedgehog) and not gi^.Invulnerable and (GetRandom(2) = 0) then |
|
28 begin |
|
29 if (CurrentHedgehog^.Gear = gi) then |
|
30 PlaySound(sndOops, false, PHedgehog(gi^.Hedgehog)^.Team^.voicepack) |
|
31 else |
|
32 begin |
|
33 if (gi^.State and gstMoving) = 0 then |
|
34 gi^.State:= gi^.State or gstLoser; |
|
35 if d > r div 2 then |
|
36 PlaySound(sndNooo, false, PHedgehog(gi^.Hedgehog)^.Team^.voicepack) |
|
37 else |
|
38 PlaySound(sndUhOh, false, PHedgehog(gi^.Hedgehog)^.Team^.voicepack); |
|
39 end; |
|
40 end; |
|
41 gi:= gi^.NextGear |
|
42 end; |
|
43 end; |
|
44 //////////////////////////////////////////////////////////////////////////////// |
19 procedure doStepDrowningGear(Gear: PGear); forward; |
45 procedure doStepDrowningGear(Gear: PGear); forward; |
20 |
46 |
21 function CheckGearDrowning(Gear: PGear): boolean; |
47 function CheckGearDrowning(Gear: PGear): boolean; |
22 var skipSpeed, skipAngle, skipDecay: hwFloat; |
48 var skipSpeed, skipAngle, skipDecay: hwFloat; |
23 begin |
49 begin |
159 AllInactive:= false; |
185 AllInactive:= false; |
160 |
186 |
161 doStepFallingGear(Gear); |
187 doStepFallingGear(Gear); |
162 |
188 |
163 dec(Gear^.Timer); |
189 dec(Gear^.Timer); |
|
190 if Gear^.Timer = 1000 then // might need adjustments |
|
191 case Gear^.Kind of |
|
192 gtAmmo_Bomb: makeHogsWorry(Gear^.X, Gear^.Y, 50); |
|
193 gtClusterBomb: makeHogsWorry(Gear^.X, Gear^.Y, 20); |
|
194 gtWatermelon: makeHogsWorry(Gear^.X, Gear^.Y, 75); |
|
195 gtHellishBomb: makeHogsWorry(Gear^.X, Gear^.Y, 90); |
|
196 end; |
164 if Gear^.Timer = 0 then |
197 if Gear^.Timer = 0 then |
165 begin |
198 begin |
166 case Gear^.Kind of |
199 case Gear^.Kind of |
167 gtAmmo_Bomb: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
200 gtAmmo_Bomb: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
168 gtBall: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 40, EXPLAutoSound); |
201 gtBall: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 40, EXPLAutoSound); |
1155 procedure doStepDynamite(Gear: PGear); |
1187 procedure doStepDynamite(Gear: PGear); |
1156 begin |
1188 begin |
1157 doStepFallingGear(Gear); |
1189 doStepFallingGear(Gear); |
1158 AllInactive:= false; |
1190 AllInactive:= false; |
1159 if Gear^.Timer mod 166 = 0 then inc(Gear^.Tag); |
1191 if Gear^.Timer mod 166 = 0 then inc(Gear^.Tag); |
|
1192 if Gear^.Timer = 1000 then // might need better timing |
|
1193 makeHogsWorry(Gear^.X, Gear^.Y, 75); |
1160 if Gear^.Timer = 0 then |
1194 if Gear^.Timer = 0 then |
1161 begin |
1195 begin |
1162 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 75, EXPLAutoSound); |
1196 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 75, EXPLAutoSound); |
1163 DeleteGear(Gear); |
1197 DeleteGear(Gear); |
1164 exit |
1198 exit |
1321 Gear^.Y:= Gear^.Y + Gear^.dY; |
1355 Gear^.Y:= Gear^.Y + Gear^.dY; |
1322 |
1356 |
1323 if (hwRound(Gear^.Y) > cWaterLine) then |
1357 if (hwRound(Gear^.Y) > cWaterLine) then |
1324 begin |
1358 begin |
1325 for i:= 0 to 3 do |
1359 for i:= 0 to 3 do |
1326 begin |
|
1327 AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 16 + Random(16), vgtSteam); |
1360 AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 16 + Random(16), vgtSteam); |
1328 PlaySound(sndVaporize, false, nil); |
1361 PlaySound(sndVaporize, false, nil); |
1329 end; |
|
1330 DeleteGear(Gear); |
1362 DeleteGear(Gear); |
1331 exit |
1363 exit |
1332 end |
1364 end |
1333 end else begin |
1365 end else begin |
1334 if (Gear^.State and gsttmpFlag) <> 0 then |
1366 if (Gear^.State and gsttmpFlag) <> 0 then |
1527 if int2hwFloat(TargetPoint.Y) - Gear^.Y > _0 then |
1559 if int2hwFloat(TargetPoint.Y) - Gear^.Y > _0 then |
1528 Gear^.dX:= Gear^.dX - cBombsSpeed * hwSqrt((int2hwFloat(TargetPoint.Y) - Gear^.Y) * 2 / cGravity) * Gear^.Tag; |
1560 Gear^.dX:= Gear^.dX - cBombsSpeed * hwSqrt((int2hwFloat(TargetPoint.Y) - Gear^.Y) * 2 / cGravity) * Gear^.Tag; |
1529 |
1561 |
1530 Gear^.Health:= 6; |
1562 Gear^.Health:= 6; |
1531 Gear^.doStep:= @doStepAirAttackWork; |
1563 Gear^.doStep:= @doStepAirAttackWork; |
1532 PlaySound(sndIncoming, false, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack) |
|
1533 end; |
1564 end; |
1534 |
1565 |
1535 //////////////////////////////////////////////////////////////////////////////// |
1566 //////////////////////////////////////////////////////////////////////////////// |
1536 |
1567 |
1537 procedure doStepAirBomb(Gear: PGear); |
1568 procedure doStepAirBomb(Gear: PGear); |
2420 // Gear^.Tex:= RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(round(Gear^.Health / 20)) + '%', cWhiteColor, fntSmall) |
2451 // Gear^.Tex:= RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(round(Gear^.Health / 20)) + '%', cWhiteColor, fntSmall) |
2421 //AddCaption(trmsg[sidFuel]+': '+inttostr(round(Gear^.Health/20))+'%', cWhiteColor, capgrpAmmostate); |
2452 //AddCaption(trmsg[sidFuel]+': '+inttostr(round(Gear^.Health/20))+'%', cWhiteColor, capgrpAmmostate); |
2422 end |
2453 end |
2423 end; |
2454 end; |
2424 |
2455 |
|
2456 //////////////////////////////////////////////////////////////////////////////// |
2425 procedure doStepJetpack(Gear: PGear); |
2457 procedure doStepJetpack(Gear: PGear); |
2426 var HHGear: PGear; |
2458 var HHGear: PGear; |
2427 begin |
2459 begin |
2428 Gear^.doStep:= @doStepJetpackWork; |
2460 Gear^.doStep:= @doStepJetpackWork; |
2429 |
2461 |