diff --git a/GameEngine/HeroItems.php b/GameEngine/HeroItems.php index cded35b7..6cba9bbe 100644 --- a/GameEngine/HeroItems.php +++ b/GameEngine/HeroItems.php @@ -310,20 +310,32 @@ class HeroItems } /** - * Argint -> aur. $gold = cat aur vrei sa primesti. + * Argint -> aur. $silver = cat ARGINT dai (nu cat aur primesti). + * + * Asta e citirea naturala a campului din interfata si potriveste Travian: + * scrii suma pe care o dai, nu pe cea pe care o primesti. Se schimba doar + * multiplii intregi ai ratei; restul de argint sub o unitate de aur ramane + * la tine, nu se pierde. */ - public function exchangeSilverToGold($uid, $gold) + public function exchangeSilverToGold($uid, $silver) { - $uid = (int) $uid; - $gold = (int) $gold; + $uid = (int) $uid; + $silver = (int) $silver; - if ($gold <= 0 || $gold > 100000) { + if ($silver <= 0 || $silver > 100000000) { return self::EXCHANGE_INVALID; } - $silver = $gold * self::silverForOneGold(); + $rate = self::silverForOneGold(); + $gold = intdiv($silver, $rate); - return $this->runExchange($uid, $gold, $silver, false); + if ($gold <= 0) { + // sub rata de schimb nu se poate obtine nici macar o unitate de aur + return self::EXCHANGE_NOT_ENOUGH; + } + + // consumam exact cat acopera aurul primit, nu toata suma introdusa + return $this->runExchange($uid, $gold, $gold * $rate, false); } /** diff --git a/GameEngine/Lang/en.php b/GameEngine/Lang/en.php index 16687243..b1a0c167 100755 --- a/GameEngine/Lang/en.php +++ b/GameEngine/Lang/en.php @@ -2824,7 +2824,7 @@ tz_def('HERO_EXCHANGE_S2G', 'Silver to gold'); tz_def('HERO_EXCHANGE_OK', 'Exchange completed.'); tz_def('HERO_EXCHANGE_NOTENOUGH', 'You do not have enough for this exchange.'); tz_def('HERO_EXCHANGE_FAIL', 'The exchange could not be completed.'); -tz_def('HERO_EXCHANGE_HINT', 'The amount you type is the gold given or received; silver is calculated at the rate shown.'); +tz_def('HERO_EXCHANGE_HINT', 'You type the amount you give. Silver left over below one unit of gold stays with you.'); tz_def('HERO_RES_PRODUCTION', 'Resources'); tz_def('HERO_RES_TYPE', 'Produced resource'); tz_def('HERO_RES_ALL', 'All resources'); diff --git a/GameEngine/Lang/ro.php b/GameEngine/Lang/ro.php index 31bf7571..06db3c8e 100644 --- a/GameEngine/Lang/ro.php +++ b/GameEngine/Lang/ro.php @@ -2809,7 +2809,7 @@ tz_def('HERO_EXCHANGE_S2G', 'Argint in aur'); tz_def('HERO_EXCHANGE_OK', 'Schimb efectuat.'); tz_def('HERO_EXCHANGE_NOTENOUGH', 'Nu ai suficient pentru acest schimb.'); tz_def('HERO_EXCHANGE_FAIL', 'Schimbul nu a putut fi efectuat.'); -tz_def('HERO_EXCHANGE_HINT', 'Valoarea introdusa e aurul dat sau primit; argintul se calculeaza la rata afisata.'); +tz_def('HERO_EXCHANGE_HINT', 'Introduci suma pe care o dai. Argintul ramas sub o unitate de aur ramane la tine.'); tz_def('HERO_RES_PRODUCTION', 'Resurse'); tz_def('HERO_RES_TYPE', 'Resursa produsa'); tz_def('HERO_RES_ALL', 'Toate resursele'); diff --git a/Templates/Build/37_auction.tpl b/Templates/Build/37_auction.tpl index 468c130d..f8e7b2c1 100644 --- a/Templates/Build/37_auction.tpl +++ b/Templates/Build/37_auction.tpl @@ -116,20 +116,22 @@ $t4RateS2G = HeroItems::silverForOneGold();
+ : 'You type the amount you give. Silver left over below one unit of gold stays with you.'; ?>
| - uid."\">"; - }else{ - echo "".$hero_info['name'].""; - } - ?> - ( getUnitName($hero_info['unit'])."\" title=\"".$technology->getUnitName($hero_info['unit'])."\" /> ".$technology->getUnitName($hero_info['unit']); ?> ) | -|||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| - | - | ![]() |
- - - | -- | |||||||||||||||||||||||||||||||||||||||||||||
| - | - | " title="" /> |
- - - | -- | |||||||||||||||||||||||||||||||||||||||||||||
| - | % | -![]() |
- - - | -- | |||||||||||||||||||||||||||||||||||||||||||||
| - | % | -![]() |
- - - | -- | |||||||||||||||||||||||||||||||||||||||||||||
| - | / | -![]() |
- - - | -- | |||||||||||||||||||||||||||||||||||||||||||||
| - |
-
+/* Aspect in stilul T4 (vezi modelul cerut). Clasele au prefix "t4h-" ca sa nu
+ se amestece cu stilurile paginii; tabelul clasic "distribution" nu mai e
+ folosit AICI, dar restul paginilor raman neatinse. */
+.t4h-wrap{max-width:560px;font-size:12px}
+/* colturi drepte si chenar, ca la tabelele originale din joc; fundalul gri si
+ barile verzi raman cum erau */
+.t4h-panel{background:#f2f2f2;border:1px solid #c9c9c9;padding:6px 8px;margin-bottom:8px}
+.t4h-head{display:flex;justify-content:space-between;align-items:center;font-weight:bold;color:#333;margin-bottom:5px}
+.t4h-tbl{width:100%;border-collapse:collapse}
+.t4h-tbl td{padding:3px 5px;vertical-align:middle;background:none;border:1px solid #dcdcdc}
+.t4h-name{width:112px;color:#333}
+.t4h-val{width:78px;color:#000}
+.t4h-barcell{width:100%}
+.t4h-bar{background:#fff;border:1px solid #c9c9c9;height:13px;overflow:hidden}
+.t4h-bar i{display:block;height:100%;background:#7db72f}
+.t4h-bar.dark i{background:#3f7a12}
+.t4h-up{width:34px;text-align:center;white-space:nowrap}
+/* plusul se pierdea pe fundalul gri - acum e verde inchis si ingrosat */
+.t4h-up a{color:#1f7a1f;font-weight:bold;text-decoration:none;font-size:13px}
+.t4h-up a:hover{color:#0f5c0f;text-decoration:underline}
+.t4h-up .none{color:#b0b0b0}
+.t4h-num{width:38px;text-align:right;font-weight:bold;color:#333}
+/* toate cele 5 optiuni pe acelasi rand, aliniate (inclusiv cerealele) */
+.t4h-res form{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px}
+.t4h-res label{display:inline-flex;align-items:center;gap:3px;white-space:nowrap;cursor:pointer}
+.t4h-res .t4h-note{flex-basis:100%;margin-top:2px}
+.t4h-res img.mini{vertical-align:middle;margin:0 2px}
+.t4h-res img.t4h-resall{height:16px;width:auto}
+.t4h-note{color:#777;font-size:11px;margin-top:4px}
+
+
+
+
+
+
@@ -284,7 +305,8 @@ if ($hour > 1759 || $hour < 500) {
top: 18px; /* centrat pe bara gri */
width: auto;
min-width: 100px;
- height: 22px;
+ height: auto;
+ min-height: 22px;
line-height: 22px;
text-align: center;
font-size: 11px;
@@ -297,6 +319,21 @@ if ($hour > 1759 || $hour < 500) {
margin-right: 4px;
}
+ /* ARGINT (erou T4) - pe rand propriu, chiar sub aur */
+ #silverHeader {
+ display: block;
+ white-space: nowrap;
+ line-height: 16px;
+ margin-top: -4px;
+ }
+
+ #silverHeader img {
+ vertical-align: middle;
+ margin-right: 4px;
+ width: 12px;
+ height: 12px;
+ }
+
diff --git a/img/hero/res_all.png b/img/hero/res_all.png
new file mode 100644
index 00000000..a243590c
Binary files /dev/null and b/img/hero/res_all.png differ
diff --git a/img/hero/silver.png b/img/hero/silver.png
new file mode 100644
index 00000000..7bc38cf7
Binary files /dev/null and b/img/hero/silver.png differ
+
+ "
+ . "uid . "\">"
+ . ""
+ . "";
+ } else {
+ echo "" . $hero_info['name'] . "";
+ }
+ ?>
+
+ ( getUnitName($hero_info['unit']) . "\" title=\"" . $technology->getUnitName($hero_info['unit']) . "\" /> "
+ . $technology->getUnitName($hero_info['unit']);
+ ?> )
+
+
+
+
+
+
+
+
- if($curExp < $maxExp && $expNext > $expCurrent && $curLevel < 100){
- $percent = ($curExp - $expCurrent) / ($expNext - $expCurrent) * 100;
- $percent = max(0, min(100, $percent));
- ?>
-
: |
- % |
- |
- ![]()
- |
-
- | : |
- 100% |
- |
- ![]()
- |
-
- | | ||||||||||||||||||||||||||||||||||||||