40 |
40 |
41 // Shouldn't more of this ammo switching stuff be moved to uAmmos ? |
41 // Shouldn't more of this ammo switching stuff be moved to uAmmos ? |
42 function ChangeAmmo(HHGear: PGear): boolean; |
42 function ChangeAmmo(HHGear: PGear): boolean; |
43 var slot, i: Longword; |
43 var slot, i: Longword; |
44 ammoidx: LongInt; |
44 ammoidx: LongInt; |
|
45 prevAmmo: TAmmoType; |
45 begin |
46 begin |
46 ChangeAmmo:= false; |
47 ChangeAmmo:= false; |
47 slot:= HHGear^.MsgParam; |
48 slot:= HHGear^.MsgParam; |
48 |
49 |
49 with HHGear^.Hedgehog^ do |
50 with HHGear^.Hedgehog^ do |
50 begin |
51 begin |
51 HHGear^.Message:= HHGear^.Message and (not gmSlot); |
52 HHGear^.Message:= HHGear^.Message and (not gmSlot); |
|
53 prevAmmo:= CurAmmoType; |
52 ammoidx:= 0; |
54 ammoidx:= 0; |
53 if ((HHGear^.State and (gstAttacking or gstAttacked)) <> 0) |
55 if ((HHGear^.State and (gstAttacking or gstAttacked)) <> 0) |
54 or ((MultiShootAttacks > 0) and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) = 0)) |
56 or ((MultiShootAttacks > 0) and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) = 0)) |
55 or ((HHGear^.State and gstHHDriven) = 0) then |
57 or ((HHGear^.State and gstHHDriven) = 0) then |
56 exit; |
58 exit; |
260 amPickHammer: newGear:= AddGear(hwRound(lx), hwRound(ly) + cHHRadius, gtPickHammer, 0, _0, _0, 0); |
269 amPickHammer: newGear:= AddGear(hwRound(lx), hwRound(ly) + cHHRadius, gtPickHammer, 0, _0, _0, 0); |
261 amSkip: ParseCommand('/skip', true); |
270 amSkip: ParseCommand('/skip', true); |
262 amRope: newGear:= AddGear(hwRound(lx), hwRound(ly), gtRope, 0, xx, yy, 0); |
271 amRope: newGear:= AddGear(hwRound(lx), hwRound(ly), gtRope, 0, xx, yy, 0); |
263 amMine: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtMine, gstWait, SignAs(_0_02, dX), _0, 3000); |
272 amMine: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtMine, gstWait, SignAs(_0_02, dX), _0, 3000); |
264 amSMine: newGear:= AddGear(hwRound(lx), hwRound(ly), gtSMine, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0); |
273 amSMine: newGear:= AddGear(hwRound(lx), hwRound(ly), gtSMine, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0); |
265 amKnife: newGear:= AddGear(hwRound(lx), hwRound(ly), gtKnife, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0); |
274 amKnife: begin |
|
275 newGear:= AddGear(hwRound(lx), hwRound(ly), gtKnife, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0); |
|
276 newGear^.State:= newGear^.State or gstMoving; |
|
277 newGear^.Radius:= 6 // temporarily shrink so it doesn't instantly embed in the ground |
|
278 end; |
266 amDEagle: newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtDEagleShot, 0, xx * _0_5, yy * _0_5, 0); |
279 amDEagle: newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtDEagleShot, 0, xx * _0_5, yy * _0_5, 0); |
267 amSineGun: newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtSineGunShot, 0, xx * _0_5, yy * _0_5, 0); |
280 amSineGun: newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtSineGunShot, 0, xx * _0_5, yy * _0_5, 0); |
268 amPortalGun: begin |
281 amPortalGun: begin |
269 newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtPortal, 0, xx * _0_6, yy * _0_6, |
282 newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtPortal, 0, xx * _0_6, yy * _0_6, |
270 // set selected color |
283 // set selected color |