# HG changeset patch
# User nemo
# Date 1290348764 18000
# Node ID 3cfd2e15464a4b14fd7e9f1ae27fc5480efa50b3
# Parent  54dedd218dde58c057a759a0b2c039a92561aafc
After repeated requests, variable length rope.  Intended for the infinite rope folks, but values less than 100 make rope more interesting IMO.

diff -r 54dedd218dde -r 3cfd2e15464a QTfrontend/ammoSchemeModel.cpp
--- a/QTfrontend/ammoSchemeModel.cpp	Sun Nov 21 16:55:19 2010 +0300
+++ b/QTfrontend/ammoSchemeModel.cpp	Sun Nov 21 09:12:44 2010 -0500
@@ -60,6 +60,7 @@
         << QVariant(25)            // health case amt 34
         << QVariant(47)            // water rise amt 35
         << QVariant(5)             // health dec amt 36
+        << QVariant(100)           // rope modfier   37
         ;
 
 AmmoSchemeModel::AmmoSchemeModel(QObject* parent, const QString & fileName) :
@@ -120,6 +121,7 @@
         << "healthcaseamount" // 34
         << "waterrise"        // 35
         << "healthdecrease"   // 36
+        << "ropepct"          // 37
         ;
 
     QList<QVariant> proMode;
@@ -161,6 +163,7 @@
         << QVariant(25)            // health case amt 34
         << QVariant(47)            // water rise amt 35
         << QVariant(5)             // health dec amt 36
+        << QVariant(100)           // rope modfier   37
         ;
 
     QList<QVariant> shoppa;
@@ -202,6 +205,7 @@
         << QVariant(25)            // health case amt 34
         << QVariant(47)            // water rise amt 35
         << QVariant(5)             // health dec amt 36
+        << QVariant(100)           // rope modfier   37
         ;
 
     QList<QVariant> cleanslate;
@@ -243,6 +247,7 @@
         << QVariant(25)            // health case amt 34
         << QVariant(47)            // water rise amt 35
         << QVariant(5)             // health dec amt 36
+        << QVariant(100)           // rope modfier   37
         ;
 
     QList<QVariant> minefield;
@@ -284,6 +289,7 @@
         << QVariant(25)            // health case amt 34
         << QVariant(47)            // water rise amt 35
         << QVariant(5)             // health dec amt 36
+        << QVariant(100)           // rope modfier   37
         ;
 
     QList<QVariant> barrelmayhem;
@@ -325,6 +331,7 @@
         << QVariant(25)            // health case amt 34
         << QVariant(47)            // water rise amt 35
         << QVariant(5)             // health dec amt 36
+        << QVariant(100)           // rope modfier   37
         ;
 
     QList<QVariant> tunnelhogs;
@@ -366,6 +373,7 @@
         << QVariant(25)            // health case amt 34
         << QVariant(47)            // water rise amt 35
         << QVariant(5)             // health dec amt 36
+        << QVariant(100)           // rope modfier   37
         ;
 
     QList<QVariant> forts;
@@ -407,6 +415,7 @@
         << QVariant(25)            // health case amt 34
         << QVariant(47)            // water rise amt 35
         << QVariant(5)             // health dec amt 36
+        << QVariant(100)           // rope modfier   37
         ;
 
     QList<QVariant> timeless;
@@ -448,6 +457,7 @@
         << QVariant(30)            // health case amt 34
         << QVariant(0)             // water rise amt 35
         << QVariant(0)             // health dec amt 36
+        << QVariant(100)           // rope modfier   37
         ;
 
     QList<QVariant> thinkingportals;
@@ -489,6 +499,7 @@
         << QVariant(25)            // health case amt 34
         << QVariant(47)            // water rise amt 35
         << QVariant(5)             // health dec amt 36
+        << QVariant(100)           // rope modfier   37
         ;
 
     QList<QVariant> kingmode;
@@ -530,6 +541,7 @@
         << QVariant(30)            // health case amt 34
         << QVariant(30)            // water rise amt 35
         << QVariant(5)             // health dec amt 36
+        << QVariant(100)           // rope modfier   37
         ;
 
 
diff -r 54dedd218dde -r 3cfd2e15464a QTfrontend/gamecfgwidget.cpp
--- a/QTfrontend/gamecfgwidget.cpp	Sun Nov 21 16:55:19 2010 +0300
+++ b/QTfrontend/gamecfgwidget.cpp	Sun Nov 21 09:12:44 2010 -0500
@@ -179,6 +179,7 @@
     sl.append(QString("e$hcaseamount %1").arg(schemeData(34).toInt()));
     sl.append(QString("e$waterrise %1").arg(schemeData(35).toInt()));
     sl.append(QString("e$healthdec %1").arg(schemeData(36).toInt()));
+    sl.append(QString("e$ropepct %1").arg(schemeData(37).toInt()));
     sl.append(QString("e$template_filter %1").arg(pMapContainer->getTemplateFilter()));
     sl.append(QString("e$mapgen %1").arg(pMapContainer->get_mapgen()));
     sl.append(QString("e$maze_size %1").arg(pMapContainer->get_maze_size()));
diff -r 54dedd218dde -r 3cfd2e15464a QTfrontend/hedgewars.qrc
--- a/QTfrontend/hedgewars.qrc	Sun Nov 21 16:55:19 2010 +0300
+++ b/QTfrontend/hedgewars.qrc	Sun Nov 21 09:12:44 2010 -0500
@@ -80,6 +80,7 @@
     <file>res/iconTime.png</file>
     <file>res/iconMine.png</file>
     <file>res/iconDud.png</file>
+    <file>res/iconRope.png</file>
     <file>res/dice.png</file>
     <file>res/Star.png</file>
     <file>res/file_save.png</file>
diff -r 54dedd218dde -r 3cfd2e15464a QTfrontend/pages.cpp
--- a/QTfrontend/pages.cpp	Sun Nov 21 16:55:19 2010 +0300
+++ b/QTfrontend/pages.cpp	Sun Nov 21 09:12:44 2010 -0500
@@ -1671,92 +1671,105 @@
     glBSLayout->addWidget(SB_CaseProb,6,2,1,1);
 
     l = new QLabel(gbBasicSettings);
-    l->setText(QLabel::tr("% Health Crates"));
+    l->setText(QLabel::tr("% Rope Length"));
     l->setWordWrap(true);
     glBSLayout->addWidget(l,7,0,1,1);
     l = new QLabel(gbBasicSettings);
     l->setFixedSize(32,32);
-    l->setPixmap(QPixmap(":/res/iconHealth.png")); // TODO: icon
+    l->setPixmap(QPixmap(":/res/iconRope.png"));
     glBSLayout->addWidget(l,7,1,1,1);
-    SB_HealthCrates = new QSpinBox(gbBasicSettings);
-    SB_HealthCrates->setRange(0, 100);
-    SB_HealthCrates->setValue(35);
-    SB_HealthCrates->setSingleStep(5);
-    glBSLayout->addWidget(SB_HealthCrates,7,2,1,1);
+    SB_RopeModifier = new QSpinBox(gbBasicSettings);
+    SB_RopeModifier->setRange(25, 999);
+    SB_RopeModifier->setValue(100);
+    SB_RopeModifier->setSingleStep(25);
+    glBSLayout->addWidget(SB_RopeModifier,7,2,1,1);
 
     l = new QLabel(gbBasicSettings);
-    l->setText(QLabel::tr("Health in Crates"));
+    l->setText(QLabel::tr("% Health Crates"));
     l->setWordWrap(true);
     glBSLayout->addWidget(l,8,0,1,1);
     l = new QLabel(gbBasicSettings);
     l->setFixedSize(32,32);
     l->setPixmap(QPixmap(":/res/iconHealth.png")); // TODO: icon
     glBSLayout->addWidget(l,8,1,1,1);
+    SB_HealthCrates = new QSpinBox(gbBasicSettings);
+    SB_HealthCrates->setRange(0, 100);
+    SB_HealthCrates->setValue(35);
+    SB_HealthCrates->setSingleStep(5);
+    glBSLayout->addWidget(SB_HealthCrates,8,2,1,1);
+
+    l = new QLabel(gbBasicSettings);
+    l->setText(QLabel::tr("Health in Crates"));
+    l->setWordWrap(true);
+    glBSLayout->addWidget(l,9,0,1,1);
+    l = new QLabel(gbBasicSettings);
+    l->setFixedSize(32,32);
+    l->setPixmap(QPixmap(":/res/iconHealth.png")); // TODO: icon
+    glBSLayout->addWidget(l,9,1,1,1);
     SB_CrateHealth = new QSpinBox(gbBasicSettings);
     SB_CrateHealth->setRange(0, 200);
     SB_CrateHealth->setValue(25);
     SB_CrateHealth->setSingleStep(5);
-    glBSLayout->addWidget(SB_CrateHealth,8,2,1,1);
+    glBSLayout->addWidget(SB_CrateHealth,9,2,1,1);
 
     l = new QLabel(gbBasicSettings);
     l->setText(QLabel::tr("Mines Time"));
     l->setWordWrap(true);
-    glBSLayout->addWidget(l,9,0,1,1);
+    glBSLayout->addWidget(l,10,0,1,1);
     l = new QLabel(gbBasicSettings);
     l->setFixedSize(32,32);
     l->setPixmap(QPixmap(":/res/iconTime.png")); // TODO: icon
-    glBSLayout->addWidget(l,9,1,1,1);
+    glBSLayout->addWidget(l,10,1,1,1);
     SB_MinesTime = new QSpinBox(gbBasicSettings);
     SB_MinesTime->setRange(-1, 5);
     SB_MinesTime->setValue(3);
     SB_MinesTime->setSingleStep(1);
     SB_MinesTime->setSpecialValueText(tr("Random"));
     SB_MinesTime->setSuffix(" "+ tr("Seconds"));
-    glBSLayout->addWidget(SB_MinesTime,9,2,1,1);
+    glBSLayout->addWidget(SB_MinesTime,10,2,1,1);
 
     l = new QLabel(gbBasicSettings);
     l->setText(QLabel::tr("Mines"));
     l->setWordWrap(true);
-    glBSLayout->addWidget(l,10,0,1,1);
+    glBSLayout->addWidget(l,11,0,1,1);
     l = new QLabel(gbBasicSettings);
     l->setFixedSize(32,32);
     l->setPixmap(QPixmap(":/res/iconMine.png")); // TODO: icon
-    glBSLayout->addWidget(l,10,1,1,1);
+    glBSLayout->addWidget(l,11,1,1,1);
     SB_Mines = new QSpinBox(gbBasicSettings);
     SB_Mines->setRange(0, 80);
     SB_Mines->setValue(0);
     SB_Mines->setSingleStep(5);
-    glBSLayout->addWidget(SB_Mines,10,2,1,1);
+    glBSLayout->addWidget(SB_Mines,11,2,1,1);
 
     l = new QLabel(gbBasicSettings);
     l->setText(QLabel::tr("% Dud Mines"));
     l->setWordWrap(true);
-    glBSLayout->addWidget(l,11,0,1,1);
+    glBSLayout->addWidget(l,12,0,1,1);
     l = new QLabel(gbBasicSettings);
     l->setFixedSize(32,32);
     l->setPixmap(QPixmap(":/res/iconDud.png"));
-    glBSLayout->addWidget(l,11,1,1,1);
+    glBSLayout->addWidget(l,12,1,1,1);
     SB_MineDuds = new QSpinBox(gbBasicSettings);
     SB_MineDuds->setRange(0, 100);
     SB_MineDuds->setValue(0);
     SB_MineDuds->setSingleStep(5);
-    glBSLayout->addWidget(SB_MineDuds,11,2,1,1);
+    glBSLayout->addWidget(SB_MineDuds,12,2,1,1);
 
 
     l = new QLabel(gbBasicSettings);
     l->setText(QLabel::tr("Explosives"));
     l->setWordWrap(true);
-    glBSLayout->addWidget(l,12,0,1,1);
+    glBSLayout->addWidget(l,13,0,1,1);
     l = new QLabel(gbBasicSettings);
     l->setFixedSize(32,32);
     l->setPixmap(QPixmap(":/res/iconDamage.png"));
-    glBSLayout->addWidget(l,12,1,1,1);
+    glBSLayout->addWidget(l,13,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,12,2,1,1);
-
+    glBSLayout->addWidget(SB_Explosives,13,2,1,1);
 
     l = new QLabel(gbBasicSettings);
     l->setText(QLabel::tr("Scheme Name:"));
@@ -1823,6 +1836,7 @@
     mapper->addMapping(SB_CrateHealth, 34);
     mapper->addMapping(SB_WaterRise, 35);
     mapper->addMapping(SB_HealthDecrease, 36);
+    mapper->addMapping(SB_RopeModifier, 37);
 
     mapper->toFirst();
 }
diff -r 54dedd218dde -r 3cfd2e15464a QTfrontend/pages.h
--- a/QTfrontend/pages.h	Sun Nov 21 16:55:19 2010 +0300
+++ b/QTfrontend/pages.h	Sun Nov 21 09:12:44 2010 -0500
@@ -497,6 +497,7 @@
     QSpinBox * SB_Mines;
     QSpinBox * SB_MineDuds;
     QSpinBox * SB_Explosives;
+    QSpinBox * SB_RopeModifier;
     QLineEdit * LE_name;
     QComboBox * selectScheme;
 
diff -r 54dedd218dde -r 3cfd2e15464a QTfrontend/res/iconRope.png
Binary file QTfrontend/res/iconRope.png has changed
diff -r 54dedd218dde -r 3cfd2e15464a hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Sun Nov 21 16:55:19 2010 +0300
+++ b/hedgewars/GSHandlers.inc	Sun Nov 21 09:12:44 2010 -0500
@@ -1132,7 +1132,7 @@
 
         Gear^.dX := SignAs(AngleSin(HHGear^.Angle), HHGear^.dX);
         Gear^.dY := -AngleCos(HHGear^.Angle);
-        Gear^.Friction := _450;
+        Gear^.Friction := _450 * _0_01 * cRopePercent;
         Gear^.Elasticity := _0;
         Gear^.State := Gear^.State and not gsttmpflag;
         Gear^.doStep := @doStepRope;
diff -r 54dedd218dde -r 3cfd2e15464a hedgewars/uCommands.pas
--- a/hedgewars/uCommands.pas	Sun Nov 21 16:55:19 2010 +0300
+++ b/hedgewars/uCommands.pas	Sun Nov 21 09:12:44 2010 -0500
@@ -150,6 +150,7 @@
     RegisterVariable('waterrise', vtLongInt, @cWaterRise    , false);
     RegisterVariable('healthdec', vtLongInt, @cHealthDecrease, false);
     RegisterVariable('damagepct',vtLongInt, @cDamagePercent , false);
+    RegisterVariable('ropepct' , vtLongInt, @cRopePercent   , false);
     RegisterVariable('minedudpct',vtLongInt,@cMineDudPercent, false);
     RegisterVariable('minesnum', vtLongInt, @cLandMines     , false);
     RegisterVariable('explosives',vtLongInt,@cExplosives    , false);
@@ -234,4 +235,4 @@
     end;
 end;
 
-end.
\ No newline at end of file
+end.
diff -r 54dedd218dde -r 3cfd2e15464a hedgewars/uConsts.pas
--- a/hedgewars/uConsts.pas	Sun Nov 21 16:55:19 2010 +0300
+++ b/hedgewars/uConsts.pas	Sun Nov 21 09:12:44 2010 -0500
@@ -103,7 +103,7 @@
     cPowerDivisor = 1500;
 
     MAXNAMELEN = 192;
-    MAXROPEPOINTS = 384;
+    MAXROPEPOINTS = 3840;
 
     // some opengl headers do not have these macros
     GL_BGR              = $80E0;
diff -r 54dedd218dde -r 3cfd2e15464a hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Sun Nov 21 16:55:19 2010 +0300
+++ b/hedgewars/uGears.pas	Sun Nov 21 09:12:44 2010 -0500
@@ -273,7 +273,7 @@
                 end;
         gtRope: begin
                 gear^.Radius:= 3;
-                gear^.Friction:= _450;
+                gear^.Friction:= _450 * _0_01 * cRopePercent;
                 RopePoints.Count:= 0;
                 end;
         gtMine: begin
diff -r 54dedd218dde -r 3cfd2e15464a hedgewars/uVariables.pas
--- a/hedgewars/uVariables.pas	Sun Nov 21 16:55:19 2010 +0300
+++ b/hedgewars/uVariables.pas	Sun Nov 21 09:12:44 2010 -0500
@@ -51,6 +51,7 @@
     cTemplateFilter : LongInt;
     cMapGen         : LongInt;
     cMazeSize       : LongInt;
+    cRopePercent    : LongWord;
 
     cHedgehogTurnTime: Longword;
     cMinesTime       : LongInt;
@@ -2159,6 +2160,7 @@
     TurnTimeLeft        := 0;
     cSuddenDTurns       := 15;
     cDamagePercent      := 100;
+    cRopePercent        := 100;
     cMineDudPercent     := 0;
     cTemplateFilter     := 0;
     cMapGen             := 0;   // MAPGEN_REGULAR