moar sparkles :3
authorsheepluva
Fri, 16 Sep 2011 01:12:57 +0200
changeset 5922 7e7774e7be8c
parent 5921 43cb3139cebe
child 5923 ae8cfd039ab2
moar sparkles :3
hedgewars/GSHandlers.inc
hedgewars/uSound.pas
--- a/hedgewars/GSHandlers.inc	Thu Sep 15 18:54:16 2011 -0400
+++ b/hedgewars/GSHandlers.inc	Fri Sep 16 01:12:57 2011 +0200
@@ -2845,6 +2845,21 @@
     if Gear^.Health < Gear^.Damage then
     begin
         doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, Gear^.Hedgehog, EXPLAutoSound);
+        for i:= 0 to 31 do
+            begin
+            sparkles:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtStraightShot);
+            if sparkles <> nil then
+                with sparkles^ do
+                    begin
+                    sparkles^.Tint:= ((random(210)+45) shl 24) or ((random(210)+45) shl 16) or ((random(210)+45) shl 8) or $FF;
+                    dx:= 0.001 * (random(200));
+                    dy:= 0.001 * (random(200));
+                    if random(2) = 0 then dx := -dx;
+                    if random(2) = 0 then dy := -dy;
+                    FrameTicks:= random(250) + 250;
+                    State:= ord(sprSnowDust);
+                    end;
+            end;
         AfterAttack;
         DeleteGear(Gear);
         DeleteGear(HHGear);
@@ -2861,11 +2876,11 @@
     AllInactive := false;
     dec(Gear^.Timer);
     if Gear^.Timer = 0 then
-    begin
+        begin
         Gear^.Pos := 1;
         PlaySound(sndKamikaze, Gear^.Hedgehog^.Team^.voicepack);
         Gear^.doStep := @doStepKamikazeWork
-    end
+        end
 end;
 
 procedure doStepKamikaze(Gear: PGear);
--- a/hedgewars/uSound.pas	Thu Sep 15 18:54:16 2011 -0400
+++ b/hedgewars/uSound.pas	Fri Sep 16 01:12:57 2011 +0200
@@ -290,7 +290,7 @@
 procedure AddVoice(snd: TSound; voicepack: PVoicepack);
 var i : LongInt;
 begin
-    if (not isSoundEnabled) or fastUntilLag or ((LastSound.snd = snd) and  (LastSound.voicepack = voicepack)) then exit;
+    if (not isSoundEnabled) or fastUntilLag or ((LastVoice.snd = snd) and  (LastVoice.voicepack = voicepack)) then exit;
     i:= 0;
     while (i<8) and (VoiceList[i].snd <> sndNone) do inc(i);