Engine:
authorsmxx
Fri, 19 Feb 2010 00:53:22 +0000
changeset 2828 e45410eae9ea
parent 2827 45817d8386c7
child 2829 dfaa6f918ad2
Engine: * Code to spawn new shells wasn't commited for whatever reason
hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Fri Feb 19 00:51:37 2010 +0000
+++ b/hedgewars/GSHandlers.inc	Fri Feb 19 00:53:22 2010 +0000
@@ -458,6 +458,7 @@
 
 procedure doStepShotgunShot(Gear: PGear);
 var i: LongWord;
+    shell: PVisualGear;
 begin
 AllInactive:= false;
 
@@ -467,6 +468,10 @@
 	if Gear^.Timer = 0 then
 		begin
 		PlaySound(sndShotgunFire);
+		shell:= AddVisualGear(hwRound(Gear^.x), hwRound(Gear^.y), vgtShell);
+		shell^.dX:= gear^.dX / -4;
+		shell^.dY:= gear^.dY / -4;
+		shell^.Frame:= 0;
 		Gear^.State:= Gear^.State or gstAnimation
 		end;
 	exit
@@ -542,6 +547,7 @@
 
 procedure doStepSniperRifleShot(Gear: PGear);
 var HHGear: PGear;
+    shell: PVisualGear;
 begin
 cArtillery:= true;
 HHGear:=PHedgehog(Gear^.Hedgehog)^.Gear;
@@ -556,7 +562,11 @@
 
 if (HHGear^.Message and gm_Attack) <> 0 then
     begin
-	Gear^.State:= Gear^.State or gstAnimation;
+    shell:= AddVisualGear(hwRound(Gear^.x), hwRound(Gear^.y), vgtShell);
+    shell^.dX:= gear^.dX / -2;
+    shell^.dY:= gear^.dY / -2;
+    shell^.Frame:= 1;
+    Gear^.State:= Gear^.State or gstAnimation;
     Gear^.dX:= SignAs(AngleSin(HHGear^.Angle), HHGear^.dX) * _0_5;
     Gear^.dY:= -AngleCos(HHGear^.Angle) * _0_5;
     PlaySound(sndGun);