Adjustments to training mode and credits by Smaxx
authornemo
Thu, 15 Oct 2009 18:02:01 +0000
changeset 2460 ac0c497fb842
parent 2459 a4176afd61e1
child 2461 5e58b1e3210b
Adjustments to training mode and credits by Smaxx
QTfrontend/about.cpp
hedgewars/GSHandlers.inc
hedgewars/uGears.pas
hedgewars/uMisc.pas
share/hedgewars/Data/Trainings/003_RCPlane.txt
--- a/QTfrontend/about.cpp	Thu Oct 15 17:51:54 2009 +0000
+++ b/QTfrontend/about.cpp	Thu Oct 15 18:02:01 2009 +0000
@@ -66,7 +66,8 @@
 			"Mine number and time game settings: David A. Cuadrado &lt;<a href=\"mailto:krawek@gmail.com\">krawek@gmail.com</a>&gt;<br>"
 			"Frontend improvements: Martin Minarik &lt;<a href=\"mailto:ttsmj@pokec.sk\">ttsmj@pokec.sk</a>&gt;<br>"
 			"Frontend improvements: Kristian Lehmann &lt;<a href=\"mailto:email@thexception.net\">email@thexception.net</a>&gt;<br>"
-			"Mac OS X port: Vittorio Giovara &lt;<a href=\"mailto:vittorio.giovara@gmail.com\">vittorio.giovara@gmail.com</a>&gt;"
+			"Mac OS X port, OpenAL wrapper library: Vittorio Giovara &lt;<a href=\"mailto:vittorio.giovara@gmail.com\">vittorio.giovara@gmail.com</a>&gt;<br>"
+			"Gamepad support and additional effects: Mario Liebisch &lt;<a href=\"mailto:mario.liebisch+hw@googlemail.com\">mario.liebisch+hw@googlemail.com</a>&gt;"
 			"</p><h2>" +
 
 			QLabel::tr("Art:") + "</h2>"
@@ -106,7 +107,7 @@
 			"French: Antoine Turmel &lt;<a href=\"mailto:geekshadow@gmail.com\">geekshadow@gmail.com</a>&gt;<br>"
 			"German: Peter Hüwe &lt;<a href=\"mailto:PeterHuewe@gmx.de\">PeterHuewe@gmx.de</a>&gt;<br>"
 			"Italian: Luca Bonora &lt;<a href=\"mailto:bonora.luca@gmail.com\">bonora.luca@gmail.com</a>&gt;<br>"
-			"Japanese: ADAM Etienne &lt;<a href=\"mailto:etienne.adam@gmail.com\">etienne.adam@gmail.com></a>&gt;<br>"
+			"Japanese: ADAM Etienne &lt;<a href=\"mailto:etienne.adam@gmail.com\">etienne.adam@gmail.com</a>&gt;<br>"
 			"Polish: Maciej Mroziński &lt;<a href=\"mailto:mynick2@o2.pl\">mynick2@o2.pl</a>&gt;, Wojciech Latkowski &lt;<a href=\"mailto:magik_15l@poczta.fm\">magik_15l@poczta.fm</a>&gt;, Maciej Górny<br>"
 			"Russian: Andrey Korotaev &lt;<a href=\"mailto:unC0Rr@gmail.com\">unC0Rr@gmail.com</a>&gt;<br>"
 			"Slovak: Jose Riha<br>"
--- a/hedgewars/GSHandlers.inc	Thu Oct 15 17:51:54 2009 +0000
+++ b/hedgewars/GSHandlers.inc	Thu Oct 15 18:02:01 2009 +0000
@@ -1206,6 +1206,36 @@
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
+
+procedure doStepTarget(Gear: PGear);
+begin
+if (Gear^.Timer = 0) and (Gear^.Tag = 0) then
+	PlaySound(sndWarp, false, nil);
+
+if (Gear^.Tag = 0) and (Gear^.Timer < 1000) then
+	inc(Gear^.Timer)
+else if Gear^.Tag = 1 then
+	if Gear^.Timer > 0 then
+		dec(Gear^.Timer)
+	else
+		begin
+			TrainingTargetGear:= AddGear(0, 0, gtTarget, 0, _0, _0, 0);
+			FindPlace(TrainingTargetGear, false, 0, LAND_WIDTH);
+			inc(TurnTimeLeft, TrainingTimeInc);
+			
+			if TrainingTimeInc > TrainingTimeInM then
+				dec(TrainingTimeInc, TrainingTimeInD);
+			if TurnTimeLeft > TrainingTimeMax then
+				TurnTimeLeft:= TrainingTimeMax;
+			
+			DeleteGear(Gear);
+			exit;
+		end;
+
+doStepCase(Gear)
+end;
+
+////////////////////////////////////////////////////////////////////////////////
 procedure doStepIdle(Gear: PGear);
 begin
 AllInactive:= false;
@@ -2219,17 +2249,13 @@
 	// pickup targets
 	t:= CheckGearNear(Gear, gtTarget, 36, 36);
 	if t <> nil then
-		begin;
-		// TODO: Sound!
-		PlaySound(sndGraveImpact, false, nil);
-		DeleteGear(t);
-		TrainingTargetGear:= AddGear(0, 0, gtTarget, 0, _0, _0, 0);
-		FindPlace(TrainingTargetGear, false, 0, LAND_WIDTH);
-		inc(TurnTimeLeft, TrainingTimeInc);
-		
-		if TrainingTimeInc > TrainingTimeInM then
-			dec(TrainingTimeInc, TrainingTimeInD);
-		if TurnTimeLeft > TrainingTimeMax then TurnTimeLeft:= TrainingTimeMax;
+		begin
+		if t^.Tag = 1 then // collect it only once
+			exit;
+		PlaySound(sndShotgunReload, false, nil);
+		t^.Tag:= 1;
+		TrainingTargetGear:= nil; // remove target cursor
+		exit;
 		end;
 
 	if (TurnTimeLeft > 0) then 
--- a/hedgewars/uGears.pas	Thu Oct 15 17:51:54 2009 +0000
+++ b/hedgewars/uGears.pas	Thu Oct 15 18:02:01 2009 +0000
@@ -151,7 +151,7 @@
 			@doStepGirder,
 			@doStepTeleport,
 			@doStepSwitcher,
-			@doStepCase,
+			@doStepTarget,
 			@doStepMortar,
 			@doStepWhip,
 			@doStepKamikaze,
@@ -358,8 +358,9 @@
                 Result^.Z:= cCurrHHZ
                 end;
       gtTarget: begin
-                Result^.Radius:= 16;
-                Result^.Elasticity:= _0_3
+                Result^.Radius:= 10;
+                Result^.Elasticity:= _0_3;
+				Result^.Timer:= 0
                 end;
       gtMortar: begin
                 Result^.Radius:= 4;
@@ -1481,7 +1482,11 @@
                     DrawRotatedF(sprTeleport, hwRound(HHGear^.X) + 1 + WorldDx, hwRound(HHGear^.Y) - 3 + WorldDy, 11 - Gear^.Pos, hwSign(HHGear^.dX), 0);
                     end;
         gtSwitcher: DrawSprite(sprSwitch, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 56 + WorldDy, (GameTicks shr 6) mod 12);
-          gtTarget: DrawSprite(sprTarget, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, 0);
+          gtTarget: begin
+					glColor4f(1, 1, 1, Gear^.Timer / 1000);
+					DrawSprite(sprTarget, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, 0);
+					glColor4f(1, 1, 1, 1);
+					end;
           gtMortar: DrawRotated(sprMortar, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
           gtCake: if Gear^.Pos = 6 then
                      DrawRotatedf(sprCakeWalk, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, (GameTicks div 40) mod 6, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90)
--- a/hedgewars/uMisc.pas	Thu Oct 15 17:51:54 2009 +0000
+++ b/hedgewars/uMisc.pas	Thu Oct 15 18:02:01 2009 +0000
@@ -73,9 +73,9 @@
 
 	GameTicks     : LongWord = 0;
 	TrainingTimeInc: Longword = 10000;
-	TrainingTimeInD: Longword = 250;
+	TrainingTimeInD: Longword = 500;
 	TrainingTimeInM: Longword = 5000;
-	TrainingTimeMax: Longword = 90000;
+	TrainingTimeMax: Longword = 60000;
 
 	TimeTrialStartTime: Longword = 0;
 	TimeTrialStopTime: Longword = 0;
--- a/share/hedgewars/Data/Trainings/003_RCPlane.txt	Thu Oct 15 17:51:54 2009 +0000
+++ b/share/hedgewars/Data/Trainings/003_RCPlane.txt	Thu Oct 15 18:02:01 2009 +0000
@@ -6,7 +6,7 @@
 $landadds 0
 $delay 0
 map EarthRise
-theme EarthRise
-ammstore 000000100000000000000000000000100000000000000000000000000000000000000000000000
+theme nature
+ammstore 000000000000000000000000000000100000000000000000000000000000000000000000000000
 addtrig C7 1 1
 addtrig F2147483649 2 1