예제 #1
0
 $Calculated_Tooltip['Weapon_Damage' . $r][] = $Build_Items["Weapon" . $r]['Name'] . " (Min): " . $Build_Items["Weapon" . $r]['Damage_Min'];
 $Calculated_Tooltip['Weapon_Damage' . $r][] = "Bonus projectil damage: " . ($Mods[array_search_multi($Mods, "Name", "Projectil " . $Build_Items["Weapon" . $r]['Type'] . " Damage")]['Value'] != 0 ? $Mods[array_search_multi($Mods, "Name", "Projectil " . $Build_Items["Weapon" . $r]['Type'] . " Damage")]['Value'] : 0);
 $Calculated_Tooltip['Weapon_Damage' . $r][] = "Number of projectiles: " . $Build_Items["Weapon" . $r]['Projectiles'];
 $Calculated_Tooltip['Weapon_Damage' . $r][] = $Mods[4]['Name'] . " multiplier: " . round($Mods[4]['Value'], 2);
 $Calculated_Tooltip['Weapon_Damage' . $r][] = $Build_Items["Weapon" . $r]['Type'] . " damage multiplier: " . ($Mods[array_search_multi($Mods, "Name", "Damage " . $Build_Items["Weapon" . $r]['Type'])]['Value'] != 0 ? $Mods[array_search_multi($Mods, "Name", "Damage " . $Build_Items["Weapon" . $r]['Type'])]['Value'] : 1);
 $Calculated_Tooltip['Weapon_Damage' . $r][] = "Ethereal damage multiplier: " . ($Build_Items["Weapon" . $r]['Ethereal'] == 1 ? $Mods[125]['Value'] : 1);
 if ($Build_Items["Weapon" . $r]['Type'] == "Transference") {
     $Calculated_Tooltip['Weapon_Damage' . $r][] = "Transference strength: " . ($Build_Items["Weapon" . $r]['Type'] == "Transference" ? $Mods[188]['Value'] : 1);
 }
 $Calculated_Tooltip['Weapon_Damage' . $r][] = "Multifire: " . $Build_Items["Weapon" . $r]['Multifire'];
 $Calculated_Tooltip['Weapon_Damage' . $r][] = "<br/>(See permanent bonus tooltip for multiplier calculation.)";
 //
 // Weapon Self Damage
 $Weapon_Damage_Calculation = $Build_Items["Weapon" . $r]['Damage_Self'];
 $Weapon_Damage_Calculation *= $Mods[4]['Value'];
 $Weapon_Damage_Calculation *= $Mods[array_search_multi($Mods, "Name", "Damage " . $Build_Items["Weapon" . $r]['Type'])]['Value'] != 0 ? $Mods[array_search_multi($Mods, "Name", "Damage " . $Build_Items["Weapon" . $r]['Type'])]['Value'] : 1;
 $Weapon_Damage_Calculation *= $Build_Items["Weapon" . $r]['Ethereal'] == 1 ? $Mods[125]['Value'] : 1;
 $Weapon_Damage_Calculation *= $Build_Items["Weapon" . $r]['Multifire'];
 $Weapon_Damage_Calculation *= $Build_Items["Weapon" . $r]['Type'] == "Transference" ? $Mods[188]['Value'] : 1;
 $Weapon_Damage_Calculation *= $Build_Items["Weapon" . $r]['Type'] == "Transference" ? 1 / $Mods[187]['Value'] : 1;
 $Calculated_Self_Damage[$r] = $Weapon_Damage_Calculation;
 if ($Build_Items["Weapon" . $r]['Type'] == "Transference") {
     //$Calculated_Tooltip['Weapon_Electricity'.$r][] = "Transference efficiency: " . round((1/$Mods[187]['Value']),2). " (1 / " . $Mods[187]['Value'] . ")";
 }
 $Calculated_Tooltip['Weapon_Damage' . $r][] = "<br/>Self damage: " . round($Weapon_Damage_Calculation, 2) . " (" . $Build_Items["Weapon" . $r]['Damage_Self'] . " * Damage increase * " . round(1 / $Mods[187]['Value'], 2) . ")";
 $Calculated_Tooltip['Weapon_Damage' . $r][] = "Transference Efficiency: " . round(1 / $Mods[187]['Value'], 2);
 //
 //	Weapon Recoil
 $Calculated_Weapon_Recoil[$r] = max($Build_Items["Weapon" . $r]['Recoil'] / $Mods[23]['Value'], 0.1);
 $Calculated_Tooltip['Weapon_Recoil' . $r][] = "Recoil: " . round($Calculated_Weapon_Recoil[$r], 2) . "<br/>";
 $Calculated_Tooltip['Weapon_Recoil' . $r][] = "Recoil calculation: max(" . $Build_Items["Weapon" . $r]['Recoil'] . " / " . round($Mods[23]['Value'], 2) . ", 0.1)<br/>";
예제 #2
0
<?php

include '../resources/connect.php';
$allItems = [];
$selectedItems = [];
$item_id = $_GET["itemID"];
$sql_similar_orders = "SELECT order_id FROM order_items WHERE item_id = " . $item_id;
$similarOrders = $conn->query($sql_similar_orders);
while ($orderRow = $similarOrders->fetch_assoc()) {
    $sql_get_suggestions = "SELECT item_id FROM order_items WHERE order_id = " . $orderRow["order_id"];
    $items = $conn->query($sql_get_suggestions);
    while ($itemRow = $items->fetch_assoc()) {
        if (in_array_multi($allItems, $itemRow["item_id"])) {
            $index = array_search_multi($allItems, $itemRow["item_id"]);
            $allItems[$index][1] = $allItems[$index][1] + 1;
        } else {
            if ($itemRow["item_id"] != $item_id) {
                $tuple = [$itemRow["item_id"], 1];
                array_push($allItems, $tuple);
            }
        }
    }
}
usort($allItems, function ($a, $b) {
    return $a[1] - $b[1];
});
$sql_item_info = "SELECT category, name, item_id FROM products WHERE item_id =  ";
for ($i = 0; $i < sizeof($allItems) && $i < 3; $i++) {
    if ($i != 0) {
        $sql_item_info .= "OR item_id = ";
    }
     $row['Skill_Level'] = floor($row['Skill_Level'] / 2) + 0;
 } else {
     $row['Skill_Level'] = $row['Skill_Level'] + 0;
 }
 if ($row['Excel_Skill_ID'] >= 47 and $row['Excel_Skill_ID'] <= 82 or strpos($Skill_Mods[$Mod_ID]['Name'], "Combat Slave") !== FALSE) {
     if (strpos($Skill_Mods[$Mod_ID]['Name'], $Build_Items['Ship']['Ship_Type']) !== FALSE) {
         $Current_Mod_ID = $Mod_ID;
         $Mod_ID = array_search_multi($Mods, "Name", substr($Skill_Mods[$Mod_ID]['Name'], strlen($Build_Items['Ship']['Ship_Type']) + 1 + strpos($Skill_Mods[$Mod_ID]['Name'], $Build_Items['Ship']['Ship_Type'])));
         if ($Skill_Mods[$Mod_ID]['ToT_Calculation'] == "") {
             $Skill_Mods[$Mod_ID]['Value'] = 1;
             $Skill_Mods[$Mod_ID]['ToT_Calculation'] .= "((1";
         }
     }
     if (strpos($Skill_Mods[$Mod_ID]['Name'], "Combat Slave") !== FALSE and $Mod_ID != 48) {
         $Current_Mod_ID = $Mod_ID;
         $Mod_ID = array_search_multi($Mods, "Name", substr($Skill_Mods[$Mod_ID]['Name'], strlen("Combat Slave") + 1 + strpos($Skill_Mods[$Mod_ID]['Name'], "Combat Slave")));
         if ($Skill_Mods[$Mod_ID]['ToT_Calculation'] == "") {
             $Skill_Mods[$Mod_ID]['Value'] = 1;
             $Skill_Mods[$Mod_ID]['ToT_Calculation'] .= "((1";
         }
     }
     //echo $Current_Mod_ID . " => " . $Skill_Mods[$Mod_ID]['Name'] . " (" . $Mod_ID . "):&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . $row['Value'] . " * " . $row['Skill_Level'] . "<br/>";
     if ($row['Excel_Skill_ID'] == 51) {
         $Berserker_Class = $row['Skill_Level'];
     }
     if ($Mod_ID == 40 or $Mod_ID == 41 or $Mod_ID == 1) {
         $Skill_Mods[$Mod_ID]['Value'] += $row['Value'] * $row['Skill_Level'];
         $Skill_Mods[$Mod_ID]['ToT_Calculation'] .= " + " . $row['Value'] * $row['Skill_Level'];
         $Mods[$Mod_ID]['Calculation_' . ${$Mod_ID . "r"}] = "[Skill] " . str_replace("_", " ", $row['Name']) . " = " . $row['Value'] * $row['Skill_Level'] . " (" . $row['Value'] . " * " . $row['Skill_Level'] . ")";
     } else {
         $Skill_Mods[$Mod_ID]['Value'] *= 1 + $row['Value'] * $row['Skill_Level'];
 //
 // Bases
 //
 //
 $row['Value'] = $row['Value'] + 0;
 /*
 if ($row['Excel_Skill_ID'] >= 47 and $row['Excel_Skill_ID'] <= 82 and strpos($Skill_Mods[$Mod_ID]['Name'], "Station") === FALSE) {
 	$row['Skill_Level'] = floor($row['Skill_Level']/2) + 0;
 } else {
 	$row['Skill_Level'] = ($row['Skill_Level'] + 0);
 }
 */
 $row['Skill_Level'] = $row['Skill_Level'] + 0;
 if (strpos($Skill_Mods[$Mod_ID]['Name'], "Station") !== FALSE and $Skill_Mods[$Mod_ID]['Name'] != "Station Slots") {
     $Current_Mod_ID = $Mod_ID;
     $Mod_ID = array_search_multi($Mods, "Name", substr($Skill_Mods[$Mod_ID]['Name'], strlen("Station") + 1 + strpos($Skill_Mods[$Mod_ID]['Name'], "Station")));
     if ($Mod_ID == 0) {
         echo "Couldn't identify the base of " . $Current_Mod_ID;
     }
     if ($Skill_Mods[$Mod_ID]['ToT_Calculation'] == "") {
         $Skill_Mods[$Mod_ID]['Value'] = 1;
         $Skill_Mods[$Mod_ID]['ToT_Calculation'] .= "((1";
     }
     if ($Mod_ID == 40 or $Mod_ID == 41 or $Mod_ID == 1 or $Mod_ID == 124 or $Mod_ID == 50 or $Mod_ID == 219) {
         $Skill_Mods[$Mod_ID]['Value'] += $row['Value'] * $row['Skill_Level'];
         $Skill_Mods[$Mod_ID]['ToT_Calculation'] .= " + " . $row['Value'] * $row['Skill_Level'];
         $Mods[$Mod_ID]['Calculation_' . ${$Mod_ID . "r"}] = "[Skill] " . str_replace("_", " ", $row['Name']) . " = " . $row['Value'] * $row['Skill_Level'] . " (" . $row['Value'] . " * " . $row['Skill_Level'] . ")";
     } else {
         $Skill_Mods[$Mod_ID]['Value'] *= 1 + $row['Value'] * $row['Skill_Level'];
         $Skill_Mods[$Mod_ID]['ToT_Calculation'] .= " * " . (1 + $row['Value'] * $row['Skill_Level']);
         $Mods[$Mod_ID]['Calculation_' . ${$Mod_ID . "r"}] = "[Skill] " . str_replace("_", " ", $row['Name']) . " = " . (1 + $row['Value'] * $row['Skill_Level']) . " (1 + (" . $row['Value'] . " * " . $row['Skill_Level'] . "))";