Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

itemy rycerza, wtepny kod

  • Loading branch information...
commit e219aa999b0715d9de44ece42d153a8e1bfd0f4e 1 parent a610157
cranCode authored
101  tribalmain.cpp
@@ -14,12 +14,27 @@ tribalMain::~tribalMain()
14 14
 {
15 15
     delete ui;
16 16
 }
17  
-
18  
-unsigned short aktualnePunkty[18] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  17
+//Zmienne Globalne
  18
+unsigned short aktualnePunkty[18] = {10,0,0,0,0,0,0,0,0,0,0,0,0,0,5,6,0,0};
19 19
 unsigned short sumaZagrodaBud = 0;
20  
-unsigned short poziomZagrody = 0;
  20
+unsigned short poziomZagrody = 1;
21 21
 bool zagrodaChecked = false;
22 22
 
  23
+const unsigned short dbWojo[12][8] = { /* Pikinier */ {50,30,10,1,10,15,45,20},
  24
+                                 /* Miecznik */ {30,30,70,1,25,50,15,40},
  25
+                                 /* Topornik */ {60,30,40,1,40,10,5,10},
  26
+                                 /* Łucznik */ {100,30,60,1,15,50,40,5},
  27
+                                 /* Zwiadowca */ {50,50,20,2,0,2,1,2},
  28
+                                 /* LK */ {125,100,250,4,130,30,40,30},
  29
+                                 /* ŁK */ {250,100,150,5,120,40,30,50},
  30
+                                 /* CK */ {200,150,600,6,150,200,80,180},
  31
+                                 /* Taran */ {300,200,200,5,2,20,50,20},
  32
+                                 /* Katas */ {320,400,100,8,100,100,50,100},
  33
+                                 /* Rycerz */ {20,20,40,10,150,250,400,150},
  34
+                                 /* Gruby */ {40000,50000,50000,100,30,100,50,100}};
  35
+
  36
+
  37
+
23 38
 void tribalMain::liczPunkty(int budNum, int lvl)
24 39
 {
25 40
     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)
43 58
     ui->Punkty->setText(kropkiInt(sumaPunktow));
44 59
     liczMiejscaZagrodaBud(budNum, lvl);
45 60
 }
46  
-unsigned short miejscaZagrodaBud[18] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  61
+unsigned short miejscaZagrodaBud[18] = {5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
47 62
 
48 63
 void tribalMain::liczMiejscaZagrodaBud(int budNum, int lvl)
49 64
 {
@@ -84,19 +99,6 @@ void tribalMain::liczMiejscaZagrodaBud(int budNum, int lvl)
84 99
 }
85 100
 void tribalMain::liczWojo()
86 101
 {
87  
-    unsigned short dbWojo[12][8] = { /* Pikinier */ {50,30,10,1,10,15,45,20},
88  
-                                     /* Miecznik */ {30,30,70,1,25,50,15,40},
89  
-                                     /* Topornik */ {60,30,40,1,40,10,5,10},
90  
-                                     /* Łucznik */ {100,30,60,1,15,50,40,5},
91  
-                                     /* Zwiadowca */ {50,50,20,2,0,2,1,2},
92  
-                                     /* LK */ {125,100,250,4,130,30,40,30},
93  
-                                     /* ŁK */ {250,100,150,5,120,40,30,50},
94  
-                                     /* CK */ {200,150,600,6,150,200,80,180},
95  
-                                     /* Taran */ {300,200,200,5,2,20,50,20},
96  
-                                     /* Katas */ {320,400,100,8,100,100,50,100},
97  
-                                     /* Rycerz */ {20,20,40,10,150,250,400,150},
98  
-                                     /* Gruby */ {40000,50000,50000,100,30,100,50,100}};
99  
-
100 102
     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()};
101 103
 
102 104
     int surki[3] = {0};
@@ -256,7 +258,7 @@ void tribalMain::on_buttonClearBud_released()
256 258
     ui->Mur->setValue(0);
257 259
 }
258 260
 
259  
-void tribalMain::on_buttonClearBud_2_released()
  261
+void tribalMain::on_buttonClearWojo_released()
260 262
 {
261 263
     ui->Piki->setValue(0);
262 264
     ui->Miecze->setValue(0);
@@ -271,3 +273,66 @@ void tribalMain::on_buttonClearBud_2_released()
271 273
     ui->Rycek->setValue(0);
272 274
     ui->Grubas->setValue(0);
273 275
 }
  276
+
  277
+void tribalMain::on_comboItems_currentIndexChanged(int index)
  278
+{
  279
+    if(ui->Rycek->value()>=1)
  280
+    {
  281
+        switch(index)
  282
+        {
  283
+        case 1:
  284
+
  285
+
  286
+        break;
  287
+
  288
+        case 2:
  289
+
  290
+        break;
  291
+
  292
+        case 3:
  293
+
  294
+        break;
  295
+
  296
+        case 4:
  297
+
  298
+        break;
  299
+
  300
+        case 5:
  301
+
  302
+        break;
  303
+
  304
+        case 6:
  305
+
  306
+        break;
  307
+
  308
+        case 7:
  309
+
  310
+        break;
  311
+
  312
+        case 8:
  313
+
  314
+        break;
  315
+
  316
+        case 9:
  317
+
  318
+        break;
  319
+
  320
+        case 10:
  321
+
  322
+        break;
  323
+
  324
+        case 11:
  325
+
  326
+        break;
  327
+
  328
+        default:
  329
+
  330
+        break;
  331
+        }
  332
+        liczWojo();
  333
+    }
  334
+}
  335
+void tribalMain::resetDb(void)
  336
+{
  337
+
  338
+}
6  tribalmain.h
@@ -63,7 +63,11 @@ private slots:
63 63
 
64 64
     void on_buttonClearBud_released();
65 65
 
66  
-    void on_buttonClearBud_2_released();
  66
+    void on_buttonClearWojo_released();
  67
+
  68
+    void on_comboItems_currentIndexChanged(int index);
  69
+
  70
+    void resetDb(void);
67 71
 
68 72
 private:
69 73
     Ui::tribalMain *ui;
110  tribalmain.ui
@@ -125,6 +125,9 @@
125 125
         <height>25</height>
126 126
        </rect>
127 127
       </property>
  128
+      <property name="minimum">
  129
+       <number>1</number>
  130
+      </property>
128 131
       <property name="maximum">
129 132
        <number>30</number>
130 133
       </property>
@@ -334,6 +337,9 @@
334 337
       <property name="maximum">
335 338
        <number>1</number>
336 339
       </property>
  340
+      <property name="value">
  341
+       <number>1</number>
  342
+      </property>
337 343
      </widget>
338 344
      <widget class="QLabel" name="imgPlac">
339 345
       <property name="geometry">
@@ -489,6 +495,9 @@
489 495
         <height>25</height>
490 496
        </rect>
491 497
       </property>
  498
+      <property name="minimum">
  499
+       <number>1</number>
  500
+      </property>
492 501
       <property name="maximum">
493 502
        <number>30</number>
494 503
       </property>
@@ -502,9 +511,15 @@
502 511
         <height>25</height>
503 512
        </rect>
504 513
       </property>
  514
+      <property name="minimum">
  515
+       <number>1</number>
  516
+      </property>
505 517
       <property name="maximum">
506 518
        <number>30</number>
507 519
       </property>
  520
+      <property name="value">
  521
+       <number>1</number>
  522
+      </property>
508 523
      </widget>
509 524
      <widget class="QLabel" name="imgSchowek">
510 525
       <property name="geometry">
@@ -638,7 +653,7 @@
638 653
        </rect>
639 654
       </property>
640 655
       <property name="text">
641  
-       <string>0</string>
  656
+       <string>21</string>
642 657
       </property>
643 658
      </widget>
644 659
      <widget class="QLabel" name="imgChlop">
@@ -686,7 +701,7 @@
686 701
        </rect>
687 702
       </property>
688 703
       <property name="text">
689  
-       <string>0</string>
  704
+       <string>5</string>
690 705
       </property>
691 706
      </widget>
692 707
      <widget class="QLabel" name="imgCK">
@@ -1105,7 +1120,7 @@
1105 1120
        </font>
1106 1121
       </property>
1107 1122
       <property name="text">
1108  
-       <string>0/100</string>
  1123
+       <string>5/240</string>
1109 1124
       </property>
1110 1125
       <property name="alignment">
1111 1126
        <set>Qt::AlignCenter</set>
@@ -1405,12 +1420,12 @@
1405 1420
        <string>Wyczyść</string>
1406 1421
       </property>
1407 1422
      </widget>
1408  
-     <widget class="QPushButton" name="buttonClearBud_2">
  1423
+     <widget class="QPushButton" name="buttonClearWojo">
1409 1424
       <property name="geometry">
1410 1425
        <rect>
1411  
-        <x>470</x>
  1426
+        <x>590</x>
1412 1427
         <y>294</y>
1413  
-        <width>91</width>
  1428
+        <width>81</width>
1414 1429
         <height>27</height>
1415 1430
        </rect>
1416 1431
       </property>
@@ -1418,6 +1433,89 @@
1418 1433
        <string>Wyczyść</string>
1419 1434
       </property>
1420 1435
      </widget>
  1436
+     <widget class="QComboBox" name="comboItems">
  1437
+      <property name="geometry">
  1438
+       <rect>
  1439
+        <x>360</x>
  1440
+        <y>294</y>
  1441
+        <width>231</width>
  1442
+        <height>27</height>
  1443
+       </rect>
  1444
+      </property>
  1445
+      <item>
  1446
+       <property name="text">
  1447
+        <string>Nie ma żadnego przedmiotu</string>
  1448
+       </property>
  1449
+      </item>
  1450
+      <item>
  1451
+       <property name="text">
  1452
+        <string>Halabarda szwajcarska</string>
  1453
+       </property>
  1454
+      </item>
  1455
+      <item>
  1456
+       <property name="text">
  1457
+        <string>Długi miecz Urlicha</string>
  1458
+       </property>
  1459
+      </item>
  1460
+      <item>
  1461
+       <property name="text">
  1462
+        <string>Wojowniczy topór Thorgarda</string>
  1463
+       </property>
  1464
+      </item>
  1465
+      <item>
  1466
+       <property name="text">
  1467
+        <string>Wielki łuk Edwarda</string>
  1468
+       </property>
  1469
+      </item>
  1470
+      <item>
  1471
+       <property name="text">
  1472
+        <string>Luneta Kalida</string>
  1473
+       </property>
  1474
+      </item>
  1475
+      <item>
  1476
+       <property name="text">
  1477
+        <string>Lanca Mieszka</string>
  1478
+       </property>
  1479
+      </item>
  1480
+      <item>
  1481
+       <property name="text">
  1482
+        <string>Flaga Baptysty</string>
  1483
+       </property>
  1484
+      </item>
  1485
+      <item>
  1486
+       <property name="text">
  1487
+        <string>Łuk reflekcyjny Khana</string>
  1488
+       </property>
  1489
+      </item>
  1490
+      <item>
  1491
+       <property name="text">
  1492
+        <string>Wekiera Carlosa</string>
  1493
+       </property>
  1494
+      </item>
  1495
+      <item>
  1496
+       <property name="text">
  1497
+        <string>Ogień olimpijski</string>
  1498
+       </property>
  1499
+      </item>
  1500
+      <item>
  1501
+       <property name="text">
  1502
+        <string>Berło Vasca</string>
  1503
+       </property>
  1504
+      </item>
  1505
+     </widget>
  1506
+     <widget class="QLabel" name="label">
  1507
+      <property name="geometry">
  1508
+       <rect>
  1509
+        <x>220</x>
  1510
+        <y>370</y>
  1511
+        <width>50</width>
  1512
+        <height>15</height>
  1513
+       </rect>
  1514
+      </property>
  1515
+      <property name="text">
  1516
+       <string>TextLabel</string>
  1517
+      </property>
  1518
+     </widget>
1421 1519
     </widget>
1422 1520
    </widget>
1423 1521
   </widget>

0 notes on commit e219aa9

Please sign in to comment.
Something went wrong with that request. Please try again.