268 var xx, yy, newDx, newDy, lx, ly: hwFloat; |
268 var xx, yy, newDx, newDy, lx, ly: hwFloat; |
269 speech: PVisualGear; |
269 speech: PVisualGear; |
270 newGear: PGear; |
270 newGear: PGear; |
271 CurWeapon: PAmmo; |
271 CurWeapon: PAmmo; |
272 usedAmmoType: TAmmoType; |
272 usedAmmoType: TAmmoType; |
273 altUse: boolean; |
273 altUse, faceLeft: boolean; |
274 elastic: hwFloat; |
274 elastic: hwFloat; |
275 begin |
275 begin |
276 newGear:= nil; |
276 newGear:= nil; |
277 bShowFinger:= false; |
277 bShowFinger:= false; |
278 CurWeapon:= GetCurAmmoEntry(Gear^.Hedgehog^); |
278 CurWeapon:= GetCurAmmoEntry(Gear^.Hedgehog^); |
412 amBaseballBat: begin |
412 amBaseballBat: begin |
413 newGear:= AddGear(hwRound(lx) + hwSign(dX) * 10, hwRound(ly), gtShover, gsttmpFlag, xx * _0_5, yy * _0_5, 0); |
413 newGear:= AddGear(hwRound(lx) + hwSign(dX) * 10, hwRound(ly), gtShover, gsttmpFlag, xx * _0_5, yy * _0_5, 0); |
414 PlaySound(sndBaseballBat) // TODO: Only play if something is hit? |
414 PlaySound(sndBaseballBat) // TODO: Only play if something is hit? |
415 end; |
415 end; |
416 amParachute: begin |
416 amParachute: begin |
|
417 faceLeft:= IsHogFacingLeft(Gear); |
417 newGear:= AddGear(hwRound(lx), hwRound(ly), gtParachute, 0, _0, _0, 0); |
418 newGear:= AddGear(hwRound(lx), hwRound(ly), gtParachute, 0, _0, _0, 0); |
|
419 if faceLeft then |
|
420 newGear^.Tag:= -1; |
418 PlaySound(sndParachute) |
421 PlaySound(sndParachute) |
419 end; |
422 end; |
420 // we save CurWeapon^.Pos (in this case: cursor direction) by using it as (otherwise irrelevant) X value of the new gear. |
423 // we save CurWeapon^.Pos (in this case: cursor direction) by using it as (otherwise irrelevant) X value of the new gear. |
421 amAirAttack: newGear:= AddGear(CurWeapon^.Pos, 0, gtAirAttack, 0, _0, _0, 0); |
424 amAirAttack: newGear:= AddGear(CurWeapon^.Pos, 0, gtAirAttack, 0, _0, _0, 0); |
422 amMineStrike: newGear:= AddGear(CurWeapon^.Pos, 0, gtAirAttack, 1, _0, _0, 0); |
425 amMineStrike: newGear:= AddGear(CurWeapon^.Pos, 0, gtAirAttack, 1, _0, _0, 0); |