function printBPTable($Bin, $pIdList) { //$Bin: 1 Based Array, 21 should be Raw Materials $format = "<tr><td style='width: 5%%;'>%d:</td><td style='width: 45%%; text-align: center;'>%s</td><td style='width: 5%%;'>%d:</td><td style='width: 45%%; text-align: center;'>%s</td></tr>"; $formatb = "<tr><td style='width: 45%%; text-align: center;' colspan=2>%s</td><td style='width: 45%%; text-align: center;' colspan=2>%s</td></tr>"; echo "<table style='width: 75%; text-align: center;' align=center>"; echo "<tr><td colspan=4 style='font-weight: Bold;'>藍圖:</td></tr>"; for ($i = 1; $i <= 10; $i++) { $a = $Bin[$i] ? getWeaponName($Bin[$i]) : '沒有'; $b = $Bin[$i + 10] ? getWeaponName($Bin[$i + 10]) : '沒有'; printf($format, $i, $a, $i + 10, $b); } echo "<tr><td colspan=4 style='font-weight: Bold;'>原料: </td></tr>"; $raws = getRaw($Bin[21]); for ($i = 1; $i <= 4; $i++) { $a = $pIdList[$i] . ": " . $raws[$i]; $b = $pIdList[$i + 4] . ": " . $raws[$i + 4]; printf($formatb, $a, $b); } echo "</table>"; }
if ($UsrWepC[1] == 0) { $DisXpC = '±0%'; } else { $DisXpC = $UsrWepC[1] > 0 ? '+' . $UsrWepC[1] / 100 : $UsrWepC[1] / 100; } if ($UsrWepB[1]) { echo "<br>(狀態值: " . $DisXpB . "%)"; } echo "</font></td><td width=50 align=center>"; if ($UsrWepB[0] && $UsrWepB[1] >= 25000 && !$UsrWepB[2] && !$TactFactory['c_wep'] || $UsrWepB[0] == $AlloyID) { echo "<input type=button name='putb' value='置放' onClick=\"actionb.value='put';actionc.value='wepb';mainform.submit()\">"; } else { echo " "; } echo "</td></tr>"; echo "<tr><td width=350><b>備用裝備C:</b><font style=\"font-size: 10pt\"><br>" . getWeaponName($UsrWepC[0]); if ($UsrWepC[1]) { echo "<br>(狀態值: " . $DisXpC . "%)"; } echo "</font></td><td width=50 align=center>"; if ($UsrWepC[0] && $UsrWepC[1] >= 25000 && !$UsrWepC[2] && !$TactFactory['c_wep'] || $UsrWepC[0] == $AlloyID) { echo "<input type=button name='putc' value='置放' onClick=\"actionb.value='put';actionc.value='wepc';mainform.submit()\">"; } else { echo " "; } echo "</td></tr>"; // Raw Materials echo "<tr><td align=center colspan=2><b>加入原料</b></td></tr><tr><td align=center>"; $pFormatStr = '%s: <input type=text maxlength=3 name="raw[%d]" value=0 style="height: 14pt; width: 30px; text-align: center; ' . $BStyleA . '" onClick="this.value=\'\'" onChange="this.value=parseInt(this.value)"> '; for ($i = 1; $i <= 8; $i++) { printf($pFormatStr, $product_id_list[$i], $i);
/** * Function to translate game dependant terms to a readable format * Based on game configs in /configs/games * * @param $xlrDB string currently * @param $item integer team * @internal param \currently $xlrDB used xlrstats database * @internal param \team $item /weapon/map/event/bodypart * @return string translated string as configured in /configs/games/ */ public function getItemName($xlrDB, $item) { //config('/classes/xlrstats.server.inc'; $XlrServer = new XlrServer(); $gameName = (string) $XlrServer->serverStatus($xlrDB)->Game->attributes()->Name; config('games/' . $gameName . '.php'); if ($item == 'team') { $temp = getTeamName(); } elseif ($item == 'weapon') { $temp = getWeaponName(); } elseif ($item == 'map') { $temp = getMapName(); } elseif ($item == 'event') { $temp = getEventName(); } elseif ($item == 'bodypart') { $temp = getBodypartName(); } else { $temp = __('Undefined Item'); } return $temp; }
if ($raw[0] <= 0) { $ChosenTact = 0; } else { for ($i = 1; $i <= 8; $i++) { if ($raw[$i] < $RawReqs[$i]) { $ChosenTact = 0; break; } } } } //Grant Chosen Weapon if ($ChosenTact) { $sql = "UPDATE `" . $GLOBALS['DBPrefix'] . "phpeb_user_game_info` SET `{$TargetGrant}` = '" . $ChosenTact . "<!>0' WHERE `username` = '{$Pl_Value['USERNAME']}' LIMIT 1;"; mysql_query($sql); $CastResult = "合成工序順利完成!!<br>已製造出 <font color=blue>" . getWeaponName($ChosenTact) . "</font> !"; } else { $CastResult = "製造失敗了。也許你應改改配方和增加原料數量。"; } $sql = "UPDATE `" . $GLOBALS['DBPrefix'] . "phpeb_user_tactfactory` SET `time` = '{$CFU_Time}', `m1` = '', `m2` = '', `m3` = NULL, `m4` = NULL, `m5` = NULL, `m6` = NULL, `m7` = NULL, `m8` = NULL, `m9` = NULL, `m10` = NULL, `m11` = NULL, `m12` = NULL, `m13` = NULL, `m14` = NULL, `m15` = NULL, `m16` = NULL, `m17` = NULL, `m18` = NULL, `m19` = NULL, `m20` = NULL WHERE `username` = '{$Pl_Value['USERNAME']}' LIMIT 1"; mysql_query($sql) or die(mysql_error()); unset($sql); if (count($sqlStorage) > 0) { foreach ($sqlStorage as $sql) { mysql_query($sql); } } echo "<form action=tactfactory.php?action=main method=post name=freect target={$SecTarget}>"; echo "<input type=hidden value='none' name=actionb>"; echo "<input type=hidden value='none' name=actionc>"; echo "<input type=hidden value='{$Pl_Value['USERNAME']}' name=Pl_Value[USERNAME]>";