QTfrontend/gamecfgwidget.cpp
changeset 4003 ca0600ab38bf
parent 4000 ddc4a09889e7
child 4143 eb7981f34800
equal deleted inserted replaced
4001:cfd83b04e0be 4003:ca0600ab38bf
    99 quint32 GameCFGWidget::getGameFlags() const
    99 quint32 GameCFGWidget::getGameFlags() const
   100 {
   100 {
   101     quint32 result = 0;
   101     quint32 result = 0;
   102 
   102 
   103     if (schemeData(1).toBool())
   103     if (schemeData(1).toBool())
   104         result |= 0x00001000;
   104         result |= 0x00001000;       // fort
   105     if (schemeData(2).toBool())
   105     if (schemeData(2).toBool())
   106         result |= 0x00000010;
   106         result |= 0x00000010;       // divide teams
   107     if (schemeData(3).toBool())
   107     if (schemeData(3).toBool())
   108         result |= 0x00000004;
   108         result |= 0x00000004;       // solid land
   109     if (schemeData(4).toBool())
   109     if (schemeData(4).toBool())
   110         result |= 0x00000008;
   110         result |= 0x00000008;       // border
   111     if (schemeData(5).toBool())
   111     if (schemeData(5).toBool())
   112         result |= 0x00000020;
   112         result |= 0x00000020;       // low gravity
   113     if (schemeData(6).toBool())
   113     if (schemeData(6).toBool())
   114         result |= 0x00000040;
   114         result |= 0x00000040;       // laser sight
   115     if (schemeData(7).toBool())
   115     if (schemeData(7).toBool())
   116         result |= 0x00000080;
   116         result |= 0x00000080;       // invulnerable
   117     if (schemeData(8).toBool())
   117     if (schemeData(8).toBool())
   118         result |= 0x00000100;
   118         result |= 0x00000100;       // mines
   119     if (schemeData(9).toBool())
   119     if (schemeData(9).toBool())
   120         result |= 0x00000200;
   120         result |= 0x00000200;       // vampirism
   121     if (schemeData(10).toBool())
   121     if (schemeData(10).toBool())
   122         result |= 0x00000400;
   122         result |= 0x00000400;       // karma
   123     if (schemeData(11).toBool())
   123     if (schemeData(11).toBool())
   124         result |= 0x00000800;
   124         result |= 0x00000800;       // artillery
   125     if (schemeData(12).toBool())
   125     if (schemeData(12).toBool())
   126         result |= 0x00002000;
   126         result |= 0x00002000;       // random
   127     if (schemeData(13).toBool())
   127     if (schemeData(13).toBool())
   128         result |= 0x00004000;
   128         result |= 0x00004000;       // king
   129     if (schemeData(14).toBool())
   129     if (schemeData(14).toBool())
   130         result |= 0x00008000;
   130         result |= 0x00008000;       // place hogs
   131     if (schemeData(15).toBool())
   131     if (schemeData(15).toBool())
   132         result |= 0x00010000;
   132         result |= 0x00010000;       // shared ammo
   133     if (schemeData(16).toBool())
   133     if (schemeData(16).toBool())
   134         result |= 0x00020000;
   134         result |= 0x00020000;       // disable girders
   135     if (schemeData(17).toBool())
   135     if (schemeData(17).toBool())
   136         result |= 0x00040000;
   136         result |= 0x00040000;       // disable land obj
   137     if (schemeData(18).toBool())
   137     if (schemeData(18).toBool())
   138         result |= 0x00080000;
   138         result |= 0x00080000;       // ai survival
   139     if (schemeData(19).toBool())
   139     if (schemeData(19).toBool())
   140         result |= 0x00100000;
   140         result |= 0x00100000;       // infinite attacks
   141     if (schemeData(20).toBool())
   141     if (schemeData(20).toBool())
   142         result |= 0x00200000;
   142         result |= 0x00200000;       // reset weaps
   143     if (schemeData(21).toBool())
   143     if (schemeData(21).toBool())
   144         result |= 0x00400000;
   144         result |= 0x00400000;       // per hog ammo
   145 
   145 
   146     return result;
   146     return result;
   147 }
   147 }
   148 
   148 
   149 quint32 GameCFGWidget::getInitHealth() const
   149 quint32 GameCFGWidget::getInitHealth() const
   157     sl.append("eseed " + pMapContainer->getCurrentSeed());
   157     sl.append("eseed " + pMapContainer->getCurrentSeed());
   158     sl.append(QString("e$gmflags %1").arg(getGameFlags()));
   158     sl.append(QString("e$gmflags %1").arg(getGameFlags()));
   159     sl.append(QString("e$damagepct %1").arg(schemeData(22).toInt()));
   159     sl.append(QString("e$damagepct %1").arg(schemeData(22).toInt()));
   160     sl.append(QString("e$turntime %1").arg(schemeData(23).toInt() * 1000));
   160     sl.append(QString("e$turntime %1").arg(schemeData(23).toInt() * 1000));
   161     sl.append(QString("e$minestime %1").arg(schemeData(27).toInt() * 1000));
   161     sl.append(QString("e$minestime %1").arg(schemeData(27).toInt() * 1000));
   162     sl.append(QString("e$landadds %1").arg(schemeData(28).toInt()));
   162     sl.append(QString("e$minesnum %1").arg(schemeData(28).toInt()));
   163     sl.append(QString("e$sd_turns %1").arg(schemeData(25).toInt()));
   163     sl.append(QString("e$sd_turns %1").arg(schemeData(25).toInt()));
   164     sl.append(QString("e$casefreq %1").arg(schemeData(26).toInt()));
   164     sl.append(QString("e$casefreq %1").arg(schemeData(26).toInt()));
   165     sl.append(QString("e$minedudpct %1").arg(schemeData(29).toInt()));
   165     sl.append(QString("e$minedudpct %1").arg(schemeData(29).toInt()));
   166     sl.append(QString("e$explosives %1").arg(schemeData(30).toInt()));
   166     sl.append(QString("e$explosives %1").arg(schemeData(30).toInt()));
   167     sl.append(QString("e$template_filter %1").arg(pMapContainer->getTemplateFilter()));
   167     sl.append(QString("e$template_filter %1").arg(pMapContainer->getTemplateFilter()));