# HG changeset patch # User nemo # Date 1241385154 0 # Node ID 2985f3bd18b747615af82d98261fa432eed86ab1 # Parent 41d3afaa20c77fc237ec08d7dc0a26ac4debb19d Disable long jump in artillery mode, make snipre rifle single shot diff -r 41d3afaa20c7 -r 2985f3bd18b7 hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Sun May 03 17:35:10 2009 +0000 +++ b/hedgewars/GSHandlers.inc Sun May 03 21:12:34 2009 +0000 @@ -495,22 +495,27 @@ procedure doStepSniperRifleShot(Gear: PGear); begin +cArtillery:= true; if not cLaserSighting then // game doesn't have default laser sight. turn it on and give them a chance to aim begin cLaserSighting:= true; - cArtillery:= true; DeleteGear(Gear); AfterAttack; - dec(CurrentHedgehog^.AttacksNum); exit - end; + end +else + inc(CurrentHedgehog^.AttacksNum); // burn up a shot, Tiy wants only a single shot if (PHedgehog(Gear^.Hedgehog)^.Gear^.Message and gm_Attack) <> 0 then begin Gear^.State:= Gear^.State or gstAnimation; PlaySound(sndGun, false, nil); Gear^.doStep:= @doStepBulletWork - end + end; + +if (Gear^.Ammo^.NumPerTurn < CurrentHedgehog^.AttacksNum) and + ((GameFlags and gfArtillery) = 0) then cArtillery:= false; + end; //////////////////////////////////////////////////////////////////////////////// diff -r 41d3afaa20c7 -r 2985f3bd18b7 hedgewars/HHHandlers.inc --- a/hedgewars/HHHandlers.inc Sun May 03 17:35:10 2009 +0000 +++ b/hedgewars/HHHandlers.inc Sun May 03 21:12:34 2009 +0000 @@ -348,7 +348,7 @@ or TestCollisionYwithGear(Gear, -1)) then begin Gear^.dY:= -_0_15; - Gear^.dX:= SignAs(_0_15, Gear^.dX); + if not cArtillery then Gear^.dX:= SignAs(_0_15, Gear^.dX); Gear^.State:= Gear^.State or gstMoving or gstHHJumping; PlaySound(sndJump1, false, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack); exit @@ -632,7 +632,7 @@ Gear^.Message:= Gear^.Message and not (gm_LJump or gm_HJump); - if wasJumping and + if (not cArtillery) and wasJumping and TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then SetLittle(Gear^.dX); doStepHedgehogMoving(Gear);