Drill rocket
authorunc0rr
Fri, 02 Jan 2009 21:39:51 +0000
changeset 1573 cf88e0ace609
parent 1572 e1b40c3560bb
child 1574 2ff75b2abff0
Drill rocket
QTfrontend/CMakeLists.txt
QTfrontend/hwconsts.cpp.in
hedgewars/GSHandlers.inc
hedgewars/HHHandlers.inc
hedgewars/uAIAmmoTests.pas
hedgewars/uConsts.pas
hedgewars/uGears.pas
hedgewars/uLocale.pas
share/hedgewars/Data/Locale/bg.txt
share/hedgewars/Data/Locale/cz.txt
share/hedgewars/Data/Locale/de.txt
share/hedgewars/Data/Locale/en.txt
share/hedgewars/Data/Locale/es.txt
share/hedgewars/Data/Locale/fr.txt
share/hedgewars/Data/Locale/it.txt
share/hedgewars/Data/Locale/pl.txt
share/hedgewars/Data/Locale/pt-br.txt
share/hedgewars/Data/Locale/ru.txt
share/hedgewars/Data/Locale/sk.txt
share/hedgewars/Data/Locale/sv.txt
share/hedgewars/Data/Locale/uk.txt
share/hedgewars/Data/Locale/zh_CN.txt
--- a/QTfrontend/CMakeLists.txt	Fri Jan 02 21:26:31 2009 +0000
+++ b/QTfrontend/CMakeLists.txt	Fri Jan 02 21:39:51 2009 +0000
@@ -81,7 +81,7 @@
 if(MINGW)
 	# resource compilation for mingw
 	add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o
-	COMMAND windres -I ${CMAKE_CURRENT_SOURCE_DIR}
+	COMMAND ${WINDRES} -I ${CMAKE_CURRENT_SOURCE_DIR}
 	-i ${CMAKE_CURRENT_SOURCE_DIR}/hedgewars.rc
 	-o ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o)
 	set(hwfr_src ${hwfr_src} ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o)
--- a/QTfrontend/hwconsts.cpp.in	Fri Jan 02 21:26:31 2009 +0000
+++ b/QTfrontend/hwconsts.cpp.in	Fri Jan 02 21:39:51 2009 +0000
@@ -29,7 +29,7 @@
 QStringList * Themes;
 QStringList * mapList;
 
-QString * cDefaultAmmoStore = new QString("eammstore 9391929422199121032235111001");
+QString * cDefaultAmmoStore = new QString("eammstore 93919294221991210322351110012");
 
 QColor * color1 = new QColor(221,   0,   0);
 QColor * color2 = new QColor( 67, 118, 233);
--- a/hedgewars/GSHandlers.inc	Fri Jan 02 21:26:31 2009 +0000
+++ b/hedgewars/GSHandlers.inc	Fri Jan 02 21:39:51 2009 +0000
@@ -1837,3 +1837,63 @@
 if (Gear^.Tag = 47) or (cWaterLine = 0) then
 	DeleteGear(Gear)
 end;
+
+////////////////////////////////////////////////////////////////////////////////
+procedure doStepDiggingGear(Gear: PGear);
+var ox,oy: hwFloat;
+begin
+	ox:= Gear^.X;
+	oy:= Gear^.Y;
+	Gear^.X:= Gear^.X + Gear^.dX;
+	Gear^.Y:= Gear^.Y + Gear^.dY;
+	DrawTunnel(oX, oY, Gear^.dX, Gear^.dY, 2, 6);
+	CheckGearDrowning(Gear);
+end;
+
+procedure doStepDrill(Gear: PGear);
+var newX, newY, oldDx, oldDy: hwFloat;
+	t: PGearArray;
+begin
+	AllInactive:= false;
+
+	if (Gear^.Timer = 5000) then begin //flying
+		Gear^.dX:= Gear^.dX + cWindSpeed;
+		oldDx:= Gear^.dX;
+		oldDy:= Gear^.dY;
+		doStepFallingGear(Gear);
+		if (GameTicks and $3F) = 0 then
+			AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0);
+	end;
+
+	if ((Gear^.State and gstCollision) <> 0) and (Gear^.Timer = 5000) then
+		begin //hit
+		Gear^.dX:= oldDx;
+		Gear^.dY:= oldDy;
+		t:= CheckGearsCollision(Gear);
+		if (t^.Count = 0) then
+			begin //hit the ground not the hedgehog
+			newy:= hwSqrt((_0_5 * Gear^.dY * Gear^.dY) / Distance(Gear^.dX, Gear^.dY));
+			if (Gear^.dY < _0) then newY := -newY;
+			newx:= newy * Gear^.dX / Gear^.dY;
+			Gear^.dX := newx;
+			Gear^.dY := newy;
+			dec(Gear^.Timer);
+			end
+		else
+			Gear^.Timer:= 0
+		end;
+
+	if (Gear^.Timer > 0) and (Gear^.Timer < 5000) and ((Gear^.Timer mod 20) = 0) then doStepDiggingGear(Gear);
+
+	if (Gear^.Timer = 0)
+	or ((Gear^.Timer < 5000)
+		and not TestCollisionYWithGear(Gear, hwSign(Gear^.dY))
+	and not TestCollisionXWithGear(Gear, hwSign(Gear^.dX))) then
+		begin //out of time or exited ground
+		doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound);
+		DeleteGear(Gear);
+		exit
+		end;
+
+	if (Gear^.Timer < 5000) then dec(Gear^.Timer);
+end;
\ No newline at end of file
--- a/hedgewars/HHHandlers.inc	Fri Jan 02 21:26:31 2009 +0000
+++ b/hedgewars/HHHandlers.inc	Fri Jan 02 21:39:51 2009 +0000
@@ -170,6 +170,7 @@
                    amWatermelon: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtWatermelon,  0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, Ammo^[CurSlot, CurAmmo].Timer);
                   amHellishBomb: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtHellishBomb,    0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 5000);
                        amNapalm: AddGear(Ammo^[CurSlot, CurAmmo].Pos, 0, gtAirAttack, 2, _0, _0, 0);
+                        amDrill: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtDrill, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0);
                   end;
 
         uStats.AmmoUsed(Ammo^[CurSlot, CurAmmo].AmmoType);
--- a/hedgewars/uAIAmmoTests.pas	Fri Jan 02 21:26:31 2009 +0000
+++ b/hedgewars/uAIAmmoTests.pas	Fri Jan 02 21:39:51 2009 +0000
@@ -72,7 +72,8 @@
 			(proc: nil;              flags: 0), // amSeduction
 			(proc: nil;              flags: 0), // amBanana
 			(proc: nil;              flags: 0), // amHellishBomb
-			(proc: nil;              flags: 0)  // amNapalm
+			(proc: nil;              flags: 0), // amNapalm
+			(proc: nil;              flags: 0)  // amDrill
 			);
 
 const BadTurn = Low(LongInt) div 4;
--- a/hedgewars/uConsts.pas	Fri Jan 02 21:26:31 2009 +0000
+++ b/hedgewars/uConsts.pas	Fri Jan 02 21:39:51 2009 +0000
@@ -49,7 +49,7 @@
 			sprHurrah, sprLemonade, sprExplPart, sprExplPart2,
 			sprCakeWalk, sprCakeDown, sprAMAmmosBW, sprWatermelon,
 			sprEvilTrace, sprHellishBomb, sprSeduction, sprDress,
-			sprCensored);
+			sprCensored, sprDrill, sprHandDrill);
 
 	TGearType = (gtAmmo_Bomb, gtHedgehog, gtAmmo_Grenade, gtHealthTag, // 3
 			gtGrave, gtUFO, gtShotgunShot, gtPickHammer, gtRope, // 8
@@ -59,7 +59,7 @@
 			gtParachute, gtAirAttack, gtAirBomb, gtBlowTorch, gtGirder, // 28
 			gtTeleport, gtSwitcher, gtTarget, gtMortar, // 32
 			gtWhip, gtKamikaze, gtCake, gtSeduction, gtWatermelon, gtMelonPiece, // 38
-			gtHellishBomb, gtEvilTrace, gtWaterUp);
+			gtHellishBomb, gtEvilTrace, gtWaterUp, gtDrill);
 
 	TVisualGearType = (vgtFlake, vgtCloud, vgtExplPart, vgtExplPart2, vgtFire,
 			vgtSmallDamageTag);
@@ -81,7 +81,7 @@
 			amSkip, amRope, amMine, amDEagle, amDynamite, amFirePunch, amWhip,
 			amBaseballBat, amParachute, amAirAttack, amMineStrike, amBlowTorch,
 			amGirder, amTeleport, amSwitch, amMortar, amKamikaze, amCake,
-			amSeduction, amWatermelon, amHellishBomb, amNapalm);
+			amSeduction, amWatermelon, amHellishBomb, amNapalm, amDrill);
 
 	THWFont = (fnt16, fntBig, fntSmall);
 
@@ -445,7 +445,11 @@
 			(FileName:    'HHDress'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
 			Width:  64; Height: 64; saveSurf: false),// sprDress
 			(FileName:   'Censored'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
-			Width:  64; Height: 16; saveSurf: false) // sprCensored
+			Width:  64; Height: 16; saveSurf: false),// sprCensored
+			(FileName:      'Drill'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
+			Width:  16; Height: 16; saveSurf: false),// sprDrill
+			(FileName:    'amDrill'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
+			Width:  32; Height: 32; saveSurf: false)// sprHandDrill
 			);
 
 	Wavez: array [TWave] of record
@@ -1079,7 +1083,26 @@
 			isDamaging: true;
 			SkipTurns: 0;
 			PosCount: 2;
-			PosSprite: sprAmAirplane)
+			PosSprite: sprAmAirplane),
+			(NameId: sidDrill;
+			NameTex: nil;
+			Probability: 0;
+			NumberInCase: 1;
+			Ammo: (Propz: ammoprop_Power or
+							ammoprop_AltUse;
+					Count: AMMO_INFINITE;
+					NumPerTurn: 0;
+					Timer: 0;
+					Pos: 0;
+					AmmoType: amDrill);
+			Slot: 0;
+			TimeAfterTurn: 3000;
+			minAngle: 0;
+			maxAngle: 0;
+			isDamaging: true;
+			SkipTurns: 0;
+			PosCount: 1;
+			PosSprite: sprDrill)
 			);
 
 var CountTexz: array[1..9] of PTexture;
--- a/hedgewars/uGears.pas	Fri Jan 02 21:26:31 2009 +0000
+++ b/hedgewars/uGears.pas	Fri Jan 02 21:39:51 2009 +0000
@@ -144,7 +144,8 @@
 			@doStepCluster,
 			@doStepBomb,
 			@doStepSmokeTrace,
-			@doStepWaterUp
+			@doStepWaterUp,
+			@doStepDrill
 			);
 
 procedure InsertGearToList(Gear: PGear);
@@ -342,6 +343,10 @@
                 Result^.Elasticity:= _0_5;
                 Result^.Friction:= _0_96;
                 end;
+       gtDrill: begin
+                Result^.Timer:= 5000;
+                Result^.Radius:= 4;
+                end;
      end;
 InsertGearToList(Result);
 AddGear:= Result
@@ -783,6 +788,7 @@
 		case amt of
 			amBazooka,
 			amMortar: DrawRotated(sprHandBazooka, hx, hy, hwSign(Gear^.dX), aangle);
+                        amDrill: DrawRotated(sprHandDrill, hx, hy, hwSign(Gear^.dX), aangle);
 			amRope: DrawRotated(sprHandRope, hx, hy, hwSign(Gear^.dX), aangle);
 			amShotgun: DrawRotated(sprHandShotgun, hx, hy, hwSign(Gear^.dX), aangle);
 			amDEagle: DrawRotated(sprHandDEagle, hx, hy, hwSign(Gear^.dX), aangle);
@@ -1033,6 +1039,7 @@
       begin
       case Gear^.Kind of
        gtAmmo_Bomb: DrawRotated(sprBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle);
+       gtDrill: DrawRotated(sprDrill, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
         gtHedgehog: DrawHH(Gear);
     gtAmmo_Grenade: DrawRotated(sprGrenade, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
        gtHealthTag: if Gear^.Tex <> nil then DrawCentered(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Tex);
@@ -1245,6 +1252,7 @@
 			gtMine,
 			gtTarget,
 			gtCase: begin
+					if (Ammo^.Kind = gtDrill) then begin Ammo^.Timer:= 0; exit; end;
 					inc(t^.ar[i]^.Damage, Damage);
 
 					if (t^.ar[i]^.Kind = gtHedgehog) and (Damage > 0) then
--- a/hedgewars/uLocale.pas	Fri Jan 02 21:26:31 2009 +0000
+++ b/hedgewars/uLocale.pas	Fri Jan 02 21:39:51 2009 +0000
@@ -24,7 +24,7 @@
 			sidParachute, sidAirAttack, sidMineStrike, sidBlowTorch,
 			sidGirder, sidTeleport, sidSwitch, sidMortar, sidWhip,
 			sidKamikaze, sidCake, sidSeduction, sidWatermelon,
-			sidHellishBomb);
+			sidHellishBomb, sidDrill);
 
 	TMsgStrId = (sidStartFight, sidDraw, sidWinner, sidVolume, sidPaused,
 			sidConfirm, sidSuddenDeath);
--- a/share/hedgewars/Data/Locale/bg.txt	Fri Jan 02 21:26:31 2009 +0000
+++ b/share/hedgewars/Data/Locale/bg.txt	Fri Jan 02 21:39:51 2009 +0000
@@ -28,6 +28,7 @@
 00:25=Seduction
 00:26=Watermelon bomb
 00:27=Hellish hand-grenade
+00:28=Drill Rocket
 
 01:00=Бой!
 01:01=Равен рунд
--- a/share/hedgewars/Data/Locale/cz.txt	Fri Jan 02 21:26:31 2009 +0000
+++ b/share/hedgewars/Data/Locale/cz.txt	Fri Jan 02 21:39:51 2009 +0000
@@ -28,6 +28,7 @@
 00:25=Omámení
 00:26=Bomba z vodního melounu
 00:27=Ďábelský ruční granát
+00:28=Drill Rocket
 
 01:00=Do boje!
 01:01=Kolo nerozhodně
--- a/share/hedgewars/Data/Locale/de.txt	Fri Jan 02 21:26:31 2009 +0000
+++ b/share/hedgewars/Data/Locale/de.txt	Fri Jan 02 21:39:51 2009 +0000
@@ -28,6 +28,7 @@
 00:25=Seduction
 00:26=Watermelon bomb
 00:27=Hellish hand-grenade
+00:28=Drill Rocket
 
 01:00=Auf in die Schlacht!
 01:01=Unentschieden
--- a/share/hedgewars/Data/Locale/en.txt	Fri Jan 02 21:26:31 2009 +0000
+++ b/share/hedgewars/Data/Locale/en.txt	Fri Jan 02 21:39:51 2009 +0000
@@ -28,6 +28,7 @@
 00:25=Seduction
 00:26=Watermelon Bomb
 00:27=Hellish hand-grenade
+00:28=Drill Rocket
 
 01:00=Let's fight!
 01:01=Round draw
--- a/share/hedgewars/Data/Locale/es.txt	Fri Jan 02 21:26:31 2009 +0000
+++ b/share/hedgewars/Data/Locale/es.txt	Fri Jan 02 21:39:51 2009 +0000
@@ -28,6 +28,7 @@
 00:25=Seducción
 00:26=Sandía bomba
 00:27=Granada infernal
+00:28=Drill Rocket
 
 01:00=Luchad!
 01:01=Empate
--- a/share/hedgewars/Data/Locale/fr.txt	Fri Jan 02 21:26:31 2009 +0000
+++ b/share/hedgewars/Data/Locale/fr.txt	Fri Jan 02 21:39:51 2009 +0000
@@ -28,6 +28,7 @@
 00:25=Seduction
 00:26=Watermelon bomb
 00:27=Hellish hand-grenade
+00:28=Drill Rocket
 
 01:00=C'est parti!
 01:01=Round ex aequo
--- a/share/hedgewars/Data/Locale/it.txt	Fri Jan 02 21:26:31 2009 +0000
+++ b/share/hedgewars/Data/Locale/it.txt	Fri Jan 02 21:39:51 2009 +0000
@@ -28,6 +28,7 @@
 00:25=Seduzione
 00:26=Bomba anguria
 00:27=Granata infernale
+00:28=Drill Rocket
 
 01:00=Combattiamo!
 01:01=Round in parità
--- a/share/hedgewars/Data/Locale/pl.txt	Fri Jan 02 21:26:31 2009 +0000
+++ b/share/hedgewars/Data/Locale/pl.txt	Fri Jan 02 21:39:51 2009 +0000
@@ -28,6 +28,7 @@
 00:25=Uwodzenie
 00:26=Bomba arbuzowa
 00:27=Piekielna bomba
+00:28=Drill Rocket
 
 01:00=Walczmy!
 01:01=Remis
--- a/share/hedgewars/Data/Locale/pt-br.txt	Fri Jan 02 21:26:31 2009 +0000
+++ b/share/hedgewars/Data/Locale/pt-br.txt	Fri Jan 02 21:39:51 2009 +0000
@@ -28,6 +28,7 @@
 00:25=Sedução
 00:26=Bomba de Melância
 00:27=Granada infernal
+00:28=Drill Rocket
 
 01:00=Hora de lutar!
 01:01=Partida empatou
--- a/share/hedgewars/Data/Locale/ru.txt	Fri Jan 02 21:26:31 2009 +0000
+++ b/share/hedgewars/Data/Locale/ru.txt	Fri Jan 02 21:39:51 2009 +0000
@@ -28,6 +28,7 @@
 00:25=Соблазнение
 00:26=Арбузная бомба
 00:27=Адская граната
+00:28=Сверлящая ракета
 
 01:00=Вперёд к победе!
 01:01=Ничья
--- a/share/hedgewars/Data/Locale/sk.txt	Fri Jan 02 21:26:31 2009 +0000
+++ b/share/hedgewars/Data/Locale/sk.txt	Fri Jan 02 21:39:51 2009 +0000
@@ -28,6 +28,7 @@
 00:25=Zvádzanie
 00:26=Melónová bomba
 00:27=Pekelný granát
+00:28=Drill Rocket
 
 01:00=Do boja!
 01:01=Remíza
--- a/share/hedgewars/Data/Locale/sv.txt	Fri Jan 02 21:26:31 2009 +0000
+++ b/share/hedgewars/Data/Locale/sv.txt	Fri Jan 02 21:39:51 2009 +0000
@@ -28,6 +28,7 @@
 00:25=Förförelse
 00:26=Vattenmelonsbomb
 00:27=Helvetisk handgranat
+00:28=Drill Rocket
 
 01:00=Nu kör vi!
 01:01=Oavgjort
--- a/share/hedgewars/Data/Locale/uk.txt	Fri Jan 02 21:26:31 2009 +0000
+++ b/share/hedgewars/Data/Locale/uk.txt	Fri Jan 02 21:39:51 2009 +0000
@@ -28,6 +28,7 @@
 00:25=Зваблення
 00:26=Watermelon bomb
 00:27=Hellish hand-grenade
+00:28=Drill Rocket
 
 01:00=Уперед до перемоги!
 01:01=Нічия
--- a/share/hedgewars/Data/Locale/zh_CN.txt	Fri Jan 02 21:26:31 2009 +0000
+++ b/share/hedgewars/Data/Locale/zh_CN.txt	Fri Jan 02 21:39:51 2009 +0000
@@ -28,6 +28,7 @@
 00:25=吸引
 00:26=西瓜炸弹
 00:27=地狱礼花
+00:28=Drill Rocket
 
 01:00=战斗啦!
 01:01=平手