Add spinner for explosives, add dust on crate impact, crank up explosives a bit
authornemo
Wed, 03 Mar 2010 02:56:18 +0000
changeset 2915 a02f276035e8
parent 2914 7db64c269a5b
child 2916 31f8d418ced3
Add spinner for explosives, add dust on crate impact, crank up explosives a bit
QTfrontend/ammoSchemeModel.cpp
QTfrontend/gamecfgwidget.cpp
QTfrontend/pages.cpp
QTfrontend/pages.h
hedgewars/GSHandlers.inc
hedgewars/uConsole.pas
hedgewars/uGears.pas
hedgewars/uMisc.pas
--- a/QTfrontend/ammoSchemeModel.cpp	Wed Mar 03 02:36:52 2010 +0000
+++ b/QTfrontend/ammoSchemeModel.cpp	Wed Mar 03 02:56:18 2010 +0000
@@ -48,6 +48,7 @@
 		<< QVariant(3)             //  mines time    22
 		<< QVariant(4)             //  landadds      23
 		<< QVariant(0)             // mine dud pct   24
+		<< QVariant(2)             // explosives     25
 		;
 
 AmmoSchemeModel::AmmoSchemeModel(QObject* parent, const QString & fileName) :
@@ -89,6 +90,7 @@
 		<< "minestime"        // 22
 		<< "landadds"         // 23
 		<< "minedudpct"       // 24
+		<< "explosives"       // 25
 		;
 
 	QList<QVariant> proMode;
@@ -118,6 +120,7 @@
 		<< QVariant(3)             //  mines time    22
 		<< QVariant(4)             //  landadds      23
 		<< QVariant(0)             // mine dud pct   24
+		<< QVariant(2)             // explosives     25
 		;
 
 	QList<QVariant> shoppa;
@@ -147,6 +150,7 @@
 		<< QVariant(3)             //  mines time    22
 		<< QVariant(4)             //  landadds      23
 		<< QVariant(0)             // mine dud pct   24
+		<< QVariant(0)             // explosives     25
 		;
 
 	QList<QVariant> basketball;
@@ -176,6 +180,7 @@
 		<< QVariant(3)             //  mines time    22
 		<< QVariant(4)             //  landadds      23
 		<< QVariant(0)             // mine dud pct   24
+		<< QVariant(0)             // explosives     25
 		;
 
 	QList<QVariant> minefield;
@@ -205,6 +210,7 @@
 		<< QVariant(0)             //  mines time    22
 		<< QVariant(80)            //  landadds      23
 		<< QVariant(0)             // mine dud pct   24
+		<< QVariant(0)             // explosives     25
 		;
 
 	schemes.append(defaultScheme);
--- a/QTfrontend/gamecfgwidget.cpp	Wed Mar 03 02:36:52 2010 +0000
+++ b/QTfrontend/gamecfgwidget.cpp	Wed Mar 03 02:56:18 2010 +0000
@@ -153,6 +153,7 @@
 	sl.append(QString("e$sd_turns %1").arg(schemeData(20).toInt()));
 	sl.append(QString("e$casefreq %1").arg(schemeData(21).toInt()));
 	sl.append(QString("e$minedudpct %1").arg(schemeData(24).toInt()));
+	sl.append(QString("e$explosives %1").arg(schemeData(25).toInt()));
 	sl.append(QString("e$template_filter %1").arg(pMapContainer->getTemplateFilter()));
 
 	QString currentMap = pMapContainer->getCurrentMap();
--- a/QTfrontend/pages.cpp	Wed Mar 03 02:36:52 2010 +0000
+++ b/QTfrontend/pages.cpp	Wed Mar 03 02:56:18 2010 +0000
@@ -1307,6 +1307,22 @@
 	SB_MineDuds->setSingleStep(5);
 	glBSLayout->addWidget(SB_MineDuds,7,2,1,1);
 
+
+	l = new QLabel(gbBasicSettings);
+	l->setText(QLabel::tr("Explosives"));
+	l->setWordWrap(true);
+	glBSLayout->addWidget(l,8,0,1,1);
+	l = new QLabel(gbBasicSettings);
+	l->setFixedSize(32,32);
+	l->setPixmap(QPixmap(":/res/iconDamage.png"));
+	glBSLayout->addWidget(l,8,1,1,1);
+	SB_Explosives = new QSpinBox(gbBasicSettings);
+	SB_Explosives->setRange(0, 40);
+	SB_Explosives->setValue(0);
+	SB_Explosives->setSingleStep(1);
+	glBSLayout->addWidget(SB_Explosives,8,2,1,1);
+
+
 	l = new QLabel(gbBasicSettings);
 	l->setText(QLabel::tr("Scheme Name:"));
 
@@ -1360,6 +1376,7 @@
 	mapper->addMapping(SB_MinesTime, 22);
 	mapper->addMapping(SB_Mines, 23);
 	mapper->addMapping(SB_MineDuds, 24);
+	mapper->addMapping(SB_Explosives, 25);
 
 	mapper->toFirst();
 }
@@ -1432,7 +1449,7 @@
 	BtnOfficialServer = addButton(tr("Official server"), pageLayout, 2, 2);
 
 	// hack: temporary deactivated - requires server modifications that aren't backward compatible (yet)
-	BtnOfficialServer->setEnabled(false);
+	//BtnOfficialServer->setEnabled(false);
 
 	BtnBack = addButton(":/res/Exit.png", pageLayout, 4, 0, true);
 }
--- a/QTfrontend/pages.h	Wed Mar 03 02:36:52 2010 +0000
+++ b/QTfrontend/pages.h	Wed Mar 03 02:56:18 2010 +0000
@@ -453,6 +453,7 @@
 	QSpinBox * SB_MinesTime;
 	QSpinBox * SB_Mines;
 	QSpinBox * SB_MineDuds;
+	QSpinBox * SB_Explosives;
 	QLineEdit * LE_name;
 	QComboBox * selectScheme;
 
--- a/hedgewars/GSHandlers.inc	Wed Mar 03 02:36:52 2010 +0000
+++ b/hedgewars/GSHandlers.inc	Wed Mar 03 02:56:18 2010 +0000
@@ -1282,7 +1282,7 @@
 		end
 	else if k = gtExplosives then
 		begin
-		doMakeExplosion(x, y, 25, EXPLAutoSound);
+		doMakeExplosion(x, y, 75, EXPLAutoSound);
 		for i:= 0 to 31 do
 			begin
 			dX:= AngleCos(i * 64) * _0_5 * (getrandom + _1);
@@ -1302,10 +1302,14 @@
 	if (Gear^.dY.isNegative) and TestCollisionYwithGear(Gear, -1) then Gear^.dY:= _0 else
 	if (not Gear^.dY.isNegative) and TestCollisionYwithGear(Gear, 1) then
 		begin
+		if Gear^.dY > _0_2 then
+	        for i:= min(12, hwRound(Gear^.dY*_10)) downto 0 do 
+		        AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, vgtDust);
 		Gear^.dY:= - Gear^.dY * Gear^.Elasticity;
 		if Gear^.dY > - _0_001 then Gear^.dY:= _0
-			else if Gear^.dY < - _0_03 then PlaySound(sndGraveImpact);
+			else if Gear^.dY < - _0_03 then PlaySound(sndGraveImpact)
 		end;
+	//if Gear^.dY > - _0_001 then Gear^.dY:= _0
 	CheckGearDrowning(Gear);
 	end;
 
--- a/hedgewars/uConsole.pas	Wed Mar 03 02:36:52 2010 +0000
+++ b/hedgewars/uConsole.pas	Wed Mar 03 02:56:18 2010 +0000
@@ -242,6 +242,7 @@
 	RegisterVariable('damagepct',vtLongInt, @cDamagePercent , false);
 	RegisterVariable('minedudpct',vtLongInt,@cMineDudPercent, false);
 	RegisterVariable('landadds', vtLongInt, @cLandAdditions , false);
+	RegisterVariable('explosives',vtLongInt,@cExplosives    , false);
 	RegisterVariable('gmflags' , vtLongInt, @GameFlags      , false);
 	RegisterVariable('trflags' , vtLongInt, @TrainingFlags  , false);
 	RegisterVariable('turntime', vtLongInt, @cHedgehogTurnTime, false);
--- a/hedgewars/uGears.pas	Wed Mar 03 02:36:52 2010 +0000
+++ b/hedgewars/uGears.pas	Wed Mar 03 02:56:18 2010 +0000
@@ -1644,10 +1644,6 @@
 begin
 AddGear(0, 0, gtATStartGame, 0, _0, _0, 2000);
 
-// HACK: just for testing explosives!
-if (GameFlags and gfMines) <> 0 then
-	GameFlags:= (GameFlags or gfExplosives) and not gfMines;
-
 if (TrainingFlags and tfSpawnTargets) <> 0 then
 	begin
 	TrainingTargetGear:= AddGear(0, 0, gtTarget, 0, _0, _0, 0);
@@ -1664,11 +1660,11 @@
 			Gear^.TriggerId:= i + 1;
 			FindPlace(Gear, false, 0, LAND_WIDTH);
 			end;
-	if ((GameFlags and gfExplosives) <> 0) then
-		for i:= 0 to Pred(cLandAdditions) do
+//  No game flag for this for now
+//	if ((GameFlags and gfExplosives) <> 0) then
+		for i:= 0 to Pred(cExplosives) do
 			begin
 			Gear:= AddGear(0, 0, gtExplosives, 0, _0, _0, 0);
-			Gear^.TriggerId:= i + 1;
 			FindPlace(Gear, false, 0, LAND_WIDTH);
 			end;
 	end;
--- a/hedgewars/uMisc.pas	Wed Mar 03 02:36:52 2010 +0000
+++ b/hedgewars/uMisc.pas	Wed Mar 03 02:56:18 2010 +0000
@@ -84,6 +84,7 @@
 	cShowFPS	: boolean;
 	cCaseFactor	: Longword;
 	cLandAdditions	: Longword;
+	cExplosives	: Longword;
 	cFullScreen	: boolean;
 	cReducedQuality	: boolean;
 	cLocaleFName	: shortstring;
@@ -723,6 +724,7 @@
 	cShowFPS		:= false;
 	cCaseFactor		:= 5;  {0..9}
 	cLandAdditions		:= 4;
+	cExplosives		:= 2;
 	cFullScreen		:= false;
 	cReducedQuality		:= false;
 	cLocaleFName		:= 'en.txt';