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 then |
|
28 begin |
|
29 if (gi^.State and gstMoving) = 0 then |
|
30 gi^.State:= gi^.State or gstLoser; |
|
31 if (CurrentHedgehog^.Gear = gi) then |
|
32 PlaySound(sndOops, false, PHedgehog(gi^.Hedgehog)^.Team^.voicepack) |
|
33 else |
|
34 begin |
|
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 //////////////////////////////////////////////////////////////////////////////// |
|
45 procedure doStepDrowningGear(Gear: PGear); forward; |
19 procedure doStepDrowningGear(Gear: PGear); forward; |
46 |
20 |
47 function CheckGearDrowning(Gear: PGear): boolean; |
21 function CheckGearDrowning(Gear: PGear): boolean; |
48 var skipSpeed, skipAngle, skipDecay: hwFloat; |
22 var skipSpeed, skipAngle, skipDecay: hwFloat; |
49 begin |
23 begin |
185 AllInactive:= false; |
159 AllInactive:= false; |
186 |
160 |
187 doStepFallingGear(Gear); |
161 doStepFallingGear(Gear); |
188 |
162 |
189 dec(Gear^.Timer); |
163 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; |
|
197 if Gear^.Timer = 0 then |
164 if Gear^.Timer = 0 then |
198 begin |
165 begin |
199 case Gear^.Kind of |
166 case Gear^.Kind of |
200 gtAmmo_Bomb: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
167 gtAmmo_Bomb: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
201 gtBall: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 40, EXPLAutoSound); |
168 gtBall: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 40, EXPLAutoSound); |
1189 procedure doStepDynamite(Gear: PGear); |
1157 procedure doStepDynamite(Gear: PGear); |
1190 begin |
1158 begin |
1191 doStepFallingGear(Gear); |
1159 doStepFallingGear(Gear); |
1192 AllInactive:= false; |
1160 AllInactive:= false; |
1193 if Gear^.Timer mod 166 = 0 then inc(Gear^.Tag); |
1161 if Gear^.Timer mod 166 = 0 then inc(Gear^.Tag); |
1194 if Gear^.Timer = 1000 then // might need better timing |
|
1195 makeHogsWorry(Gear^.X, Gear^.Y, 75); |
|
1196 if Gear^.Timer = 0 then |
1162 if Gear^.Timer = 0 then |
1197 begin |
1163 begin |
1198 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 75, EXPLAutoSound); |
1164 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 75, EXPLAutoSound); |
1199 DeleteGear(Gear); |
1165 DeleteGear(Gear); |
1200 exit |
1166 exit |
1356 Gear^.Y:= Gear^.Y + Gear^.dY; |
1322 Gear^.Y:= Gear^.Y + Gear^.dY; |
1357 |
1323 |
1358 if (hwRound(Gear^.Y) > cWaterLine) then |
1324 if (hwRound(Gear^.Y) > cWaterLine) then |
1359 begin |
1325 begin |
1360 for i:= 0 to 3 do |
1326 for i:= 0 to 3 do |
|
1327 begin |
1361 AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 16 + Random(16), vgtSteam); |
1328 AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 16 + Random(16), vgtSteam); |
1362 PlaySound(sndVaporize, false, nil); |
1329 PlaySound(sndVaporize, false, nil); |
|
1330 end; |
1363 DeleteGear(Gear); |
1331 DeleteGear(Gear); |
1364 exit |
1332 exit |
1365 end |
1333 end |
1366 end else begin |
1334 end else begin |
1367 if (Gear^.State and gsttmpFlag) <> 0 then |
1335 if (Gear^.State and gsttmpFlag) <> 0 then |
1560 if int2hwFloat(TargetPoint.Y) - Gear^.Y > _0 then |
1528 if int2hwFloat(TargetPoint.Y) - Gear^.Y > _0 then |
1561 Gear^.dX:= Gear^.dX - cBombsSpeed * hwSqrt((int2hwFloat(TargetPoint.Y) - Gear^.Y) * 2 / cGravity) * Gear^.Tag; |
1529 Gear^.dX:= Gear^.dX - cBombsSpeed * hwSqrt((int2hwFloat(TargetPoint.Y) - Gear^.Y) * 2 / cGravity) * Gear^.Tag; |
1562 |
1530 |
1563 Gear^.Health:= 6; |
1531 Gear^.Health:= 6; |
1564 Gear^.doStep:= @doStepAirAttackWork; |
1532 Gear^.doStep:= @doStepAirAttackWork; |
|
1533 PlaySound(sndIncoming, false, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack) |
1565 end; |
1534 end; |
1566 |
1535 |
1567 //////////////////////////////////////////////////////////////////////////////// |
1536 //////////////////////////////////////////////////////////////////////////////// |
1568 |
1537 |
1569 procedure doStepAirBomb(Gear: PGear); |
1538 procedure doStepAirBomb(Gear: PGear); |
2452 // Gear^.Tex:= RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(round(Gear^.Health / 20)) + '%', $FFFFFFFF, fntSmall) |
2421 // Gear^.Tex:= RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(round(Gear^.Health / 20)) + '%', $FFFFFFFF, fntSmall) |
2453 //AddCaption(trmsg[sidFuel]+': '+inttostr(round(Gear^.Health/20))+'%', $FFFFFF, capgrpAmmostate); |
2422 //AddCaption(trmsg[sidFuel]+': '+inttostr(round(Gear^.Health/20))+'%', $FFFFFF, capgrpAmmostate); |
2454 end |
2423 end |
2455 end; |
2424 end; |
2456 |
2425 |
2457 //////////////////////////////////////////////////////////////////////////////// |
|
2458 procedure doStepJetpack(Gear: PGear); |
2426 procedure doStepJetpack(Gear: PGear); |
2459 var HHGear: PGear; |
2427 var HHGear: PGear; |
2460 begin |
2428 begin |
2461 Gear^.doStep:= @doStepJetpackWork; |
2429 Gear^.doStep:= @doStepJetpackWork; |
2462 |
2430 |