# HG changeset patch # User unc0rr # Date 1298829539 -10800 # Node ID 5d6443a7ec0369f22be624cdb669f2f4104f2565 # Parent e57a679943c24f29a4fb4d89440f644e9a2018a9# Parent fa612a614317f794965c7bcbac58a0a8f1061310 merge diff -r e57a679943c2 -r 5d6443a7ec03 hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Sun Feb 27 20:58:43 2011 +0300 +++ b/hedgewars/GSHandlers.inc Sun Feb 27 20:58:59 2011 +0300 @@ -1692,6 +1692,27 @@ else if ((GameTicks and $3F) = 25) then doStepFallingGear(Gear); + if (Gear^.Health = 0) then + begin + if not Gear^.dY.isNegative and (Gear^.dY > _0_2) and TestCollisionYwithGear(Gear, 1) then + inc(Gear^.Damage, hwRound(Gear^.dY * _70)) + else if not Gear^.dX.isNegative and (Gear^.dX > _0_2) and TestCollisionXwithGear(Gear, 1) then + inc(Gear^.Damage, hwRound(Gear^.dX * _70)) + else if Gear^.dY.isNegative and (Gear^.dY < -_0_2) and TestCollisionYwithGear(Gear, -1) then + inc(Gear^.Damage, hwRound(Gear^.dY * -_70)) + else if Gear^.dX.isNegative and (Gear^.dX < -_0_2) and TestCollisionXwithGear(Gear, -1) then + inc(Gear^.Damage, hwRound(Gear^.dX * -_70)); + + if (Gear^.Damage > random(10)) and ((GameTicks and $FF) = 0) then + AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y), vgtSmoke); + + if (Gear^.Damage > 35) then + begin + doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear^.Hedgehog, EXPLAutoSound); + DeleteGear(Gear); + exit + end + end; if ((Gear^.State and gsttmpFlag) <> 0) and (Gear^.Health <> 0) then if ((Gear^.State and gstAttacking) = 0) then @@ -1719,6 +1740,8 @@ vgtSmoke); PlaySound(sndVaporize); Gear^.Health := 0; + Gear^.Damage := 0; +AddFileLog('initial mine damage:'+IntToStr(Gear^.Damage)); end; exit end; diff -r e57a679943c2 -r 5d6443a7ec03 hedgewars/uSound.pas --- a/hedgewars/uSound.pas Sun Feb 27 20:58:43 2011 +0300 +++ b/hedgewars/uSound.pas Sun Feb 27 20:58:59 2011 +0300 @@ -44,6 +44,7 @@ procedure ChangeMusic; procedure StopSound(snd: TSound); procedure StopSound(chn: LongInt); +procedure StopSound(chn, fadems: LongInt); function ChangeVolume(voldelta: LongInt): LongInt; function AskForVoicepack(name: shortstring): Pointer;