Permalink
Browse files

itemy rycerza, wtepny kod

  • Loading branch information...
1 parent a610157 commit e219aa999b0715d9de44ece42d153a8e1bfd0f4e @cranCode committed May 1, 2012
Showing with 192 additions and 25 deletions.
  1. +83 −18 tribalmain.cpp
  2. +5 −1 tribalmain.h
  3. +104 −6 tribalmain.ui
View
@@ -14,12 +14,27 @@ tribalMain::~tribalMain()
{
delete ui;
}
-
-unsigned short aktualnePunkty[18] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+//Zmienne Globalne
+unsigned short aktualnePunkty[18] = {10,0,0,0,0,0,0,0,0,0,0,0,0,0,5,6,0,0};
unsigned short sumaZagrodaBud = 0;
-unsigned short poziomZagrody = 0;
+unsigned short poziomZagrody = 1;
bool zagrodaChecked = false;
+const unsigned short dbWojo[12][8] = { /* Pikinier */ {50,30,10,1,10,15,45,20},
+ /* Miecznik */ {30,30,70,1,25,50,15,40},
+ /* Topornik */ {60,30,40,1,40,10,5,10},
+ /* Łucznik */ {100,30,60,1,15,50,40,5},
+ /* Zwiadowca */ {50,50,20,2,0,2,1,2},
+ /* LK */ {125,100,250,4,130,30,40,30},
+ /* ŁK */ {250,100,150,5,120,40,30,50},
+ /* CK */ {200,150,600,6,150,200,80,180},
+ /* Taran */ {300,200,200,5,2,20,50,20},
+ /* Katas */ {320,400,100,8,100,100,50,100},
+ /* Rycerz */ {20,20,40,10,150,250,400,150},
+ /* Gruby */ {40000,50000,50000,100,30,100,50,100}};
+
+
+
void tribalMain::liczPunkty(int budNum, int lvl)
{
unsigned short dbPunkty[30][18] = {{10,16,20,24,10,10,512,19,0,24,10,6,6,6,5,6,5,8},{2,3,4,5,2,0,102,4,0,0,2,1,1,1,1,1,1,2},{2,4,5,6,2,0,123,4,0,0,2,2,2,2,1,2,1,2},{3,5,6,6,0,0,0,6,0,0,3,1,1,1,2,1,2,2},{4,5,6,9,0,0,0,6,0,0,4,2,2,2,1,2,1,3},{4,7,9,10,0,0,0,8,0,0,4,3,3,3,2,3,2,3},{5,8,10,12,0,0,0,10,0,0,5,3,3,3,3,3,3,4},{6,9,12,14,0,0,0,11,0,0,6,3,3,3,3,3,3,5},{7,12,14,17,0,0,0,14,0,0,7,5,5,5,3,5,3,5},{9,14,17,21,0,0,0,16,0,0,9,5,5,5,5,5,5,7},{10,16,21,25,0,0,0,20,0,0,10,6,6,6,5,6,0,9},{12,20,25,29,0,0,0,23,0,0,12,8,8,8,6,8,0,9},{15,24,29,36,0,0,0,28,0,0,15,8,8,8,8,8,0,12},{18,28,36,43,0,0,0,34,0,0,18,11,11,11,8,11,0,15},{21,34,43,51,0,0,0,41,0,0,21,13,13,13,11,13,0,17},{26,42,51,0,0,0,0,49,0,0,26,15,15,15,13,15,0,20},{31,49,62,0,0,0,0,58,0,0,31,19,19,19,15,19,0,25},{37,59,74,0,0,0,0,71,0,0,37,22,22,22,19,22,0,29},{44,71,88,0,0,0,0,84,0,0,44,27,27,27,22,27,0,36},{53,85,107,0,0,0,0,101,0,0,53,32,32,32,27,32,0,43},{64,102,0,0,0,0,0,0,0,0,64,38,38,38,32,38,0,0},{77,123,0,0,0,0,0,0,0,0,77,46,46,46,38,46},{92,147,0,0,0,0,0,0,0,0,92,55,55,55,46,55,0},{110,177,0,0,0,0,0,0,0,0,110,66,66,66,55,66,0,0},{133,212,0,0,0,0,0,0,0,0,133,80,80,80,66,80,0,0},{159,0,0,0,0,0,0,0,0,0,0,95,95,95,80,95,0,0},{191,0,0,0,0,0,0,0,0,0,0,115,115,115,95,115,0,0},{229,0,0,0,0,0,0,0,0,0,0,137,137,137,115,137,0,0},{274,0,0,0,0,0,0,0,0,0,0,165,165,165,137,165,0,0},{330,0,0,0,0,0,0,0,0,0,0,198,198,198,165,198,0,0}};
@@ -43,7 +58,7 @@ void tribalMain::liczPunkty(int budNum, int lvl)
ui->Punkty->setText(kropkiInt(sumaPunktow));
liczMiejscaZagrodaBud(budNum, lvl);
}
-unsigned short miejscaZagrodaBud[18] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+unsigned short miejscaZagrodaBud[18] = {5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
void tribalMain::liczMiejscaZagrodaBud(int budNum, int lvl)
{
@@ -84,19 +99,6 @@ void tribalMain::liczMiejscaZagrodaBud(int budNum, int lvl)
}
void tribalMain::liczWojo()
{
- unsigned short dbWojo[12][8] = { /* Pikinier */ {50,30,10,1,10,15,45,20},
- /* Miecznik */ {30,30,70,1,25,50,15,40},
- /* Topornik */ {60,30,40,1,40,10,5,10},
- /* Łucznik */ {100,30,60,1,15,50,40,5},
- /* Zwiadowca */ {50,50,20,2,0,2,1,2},
- /* LK */ {125,100,250,4,130,30,40,30},
- /* ŁK */ {250,100,150,5,120,40,30,50},
- /* CK */ {200,150,600,6,150,200,80,180},
- /* Taran */ {300,200,200,5,2,20,50,20},
- /* Katas */ {320,400,100,8,100,100,50,100},
- /* Rycerz */ {20,20,40,10,150,250,400,150},
- /* Gruby */ {40000,50000,50000,100,30,100,50,100}};
-
int wpisaneWojo[12] = {ui->Piki->value(),ui->Miecze->value(),ui->Topy->value(),ui->Luki->value(),ui->Zwiady->value(),ui->LK->value(),ui->LucznicyK->value(),ui->CK->value(),ui->Tarany->value(),ui->Katasy->value(),ui->Rycek->value(),ui->Grubas->value()};
int surki[3] = {0};
@@ -256,7 +258,7 @@ void tribalMain::on_buttonClearBud_released()
ui->Mur->setValue(0);
}
-void tribalMain::on_buttonClearBud_2_released()
+void tribalMain::on_buttonClearWojo_released()
{
ui->Piki->setValue(0);
ui->Miecze->setValue(0);
@@ -271,3 +273,66 @@ void tribalMain::on_buttonClearBud_2_released()
ui->Rycek->setValue(0);
ui->Grubas->setValue(0);
}
+
+void tribalMain::on_comboItems_currentIndexChanged(int index)
+{
+ if(ui->Rycek->value()>=1)
+ {
+ switch(index)
+ {
+ case 1:
+
+
+ break;
+
+ case 2:
+
+ break;
+
+ case 3:
+
+ break;
+
+ case 4:
+
+ break;
+
+ case 5:
+
+ break;
+
+ case 6:
+
+ break;
+
+ case 7:
+
+ break;
+
+ case 8:
+
+ break;
+
+ case 9:
+
+ break;
+
+ case 10:
+
+ break;
+
+ case 11:
+
+ break;
+
+ default:
+
+ break;
+ }
+ liczWojo();
+ }
+}
+void tribalMain::resetDb(void)
+{
+
+}
View
@@ -63,7 +63,11 @@ private slots:
void on_buttonClearBud_released();
- void on_buttonClearBud_2_released();
+ void on_buttonClearWojo_released();
+
+ void on_comboItems_currentIndexChanged(int index);
+
+ void resetDb(void);
private:
Ui::tribalMain *ui;
View
@@ -125,6 +125,9 @@
<height>25</height>
</rect>
</property>
+ <property name="minimum">
+ <number>1</number>
+ </property>
<property name="maximum">
<number>30</number>
</property>
@@ -334,6 +337,9 @@
<property name="maximum">
<number>1</number>
</property>
+ <property name="value">
+ <number>1</number>
+ </property>
</widget>
<widget class="QLabel" name="imgPlac">
<property name="geometry">
@@ -489,6 +495,9 @@
<height>25</height>
</rect>
</property>
+ <property name="minimum">
+ <number>1</number>
+ </property>
<property name="maximum">
<number>30</number>
</property>
@@ -502,9 +511,15 @@
<height>25</height>
</rect>
</property>
+ <property name="minimum">
+ <number>1</number>
+ </property>
<property name="maximum">
<number>30</number>
</property>
+ <property name="value">
+ <number>1</number>
+ </property>
</widget>
<widget class="QLabel" name="imgSchowek">
<property name="geometry">
@@ -638,7 +653,7 @@
</rect>
</property>
<property name="text">
- <string>0</string>
+ <string>21</string>
</property>
</widget>
<widget class="QLabel" name="imgChlop">
@@ -686,7 +701,7 @@
</rect>
</property>
<property name="text">
- <string>0</string>
+ <string>5</string>
</property>
</widget>
<widget class="QLabel" name="imgCK">
@@ -1105,7 +1120,7 @@
</font>
</property>
<property name="text">
- <string>0/100</string>
+ <string>5/240</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -1405,19 +1420,102 @@
<string>Wyczyść</string>
</property>
</widget>
- <widget class="QPushButton" name="buttonClearBud_2">
+ <widget class="QPushButton" name="buttonClearWojo">
<property name="geometry">
<rect>
- <x>470</x>
+ <x>590</x>
<y>294</y>
- <width>91</width>
+ <width>81</width>
<height>27</height>
</rect>
</property>
<property name="text">
<string>Wyczyść</string>
</property>
</widget>
+ <widget class="QComboBox" name="comboItems">
+ <property name="geometry">
+ <rect>
+ <x>360</x>
+ <y>294</y>
+ <width>231</width>
+ <height>27</height>
+ </rect>
+ </property>
+ <item>
+ <property name="text">
+ <string>Nie ma żadnego przedmiotu</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Halabarda szwajcarska</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Długi miecz Urlicha</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Wojowniczy topór Thorgarda</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Wielki łuk Edwarda</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Luneta Kalida</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Lanca Mieszka</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Flaga Baptysty</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Łuk reflekcyjny Khana</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Wekiera Carlosa</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Ogień olimpijski</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Berło Vasca</string>
+ </property>
+ </item>
+ </widget>
+ <widget class="QLabel" name="label">
+ <property name="geometry">
+ <rect>
+ <x>220</x>
+ <y>370</y>
+ <width>50</width>
+ <height>15</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
</widget>
</widget>
</widget>

0 comments on commit e219aa9

Please sign in to comment.