SHARE
TWEET
Untitled
a guest
Jan 29th, 2018
59
in 19 hours
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- $db->onCampDayUp();
- $jumpers = $db->getJumpersAvailability(0, "oncamp", NULL);
- foreach ($jumpers as $jumper) {
- $maxes = array($jumper->inrun_max, $jumper->take_off_max, $jumper->flight_max, $jumper->landing_max);
- $skills = array($jumper->inrun, $jumper->take_off, $jumper->flight, $jumper->landing);
- $remain = array($jumper->inrun_remaining, $jumper->takeoff_remaining, $jumper->flight_remaining, $jumper->landing_remaining);
- $changes = array(0, 0, 0, 0, 0);
- $talent = explode("-", $jumper->talent);
- echo $jumper->skills . "<br>";
- $day = $jumper->day - 1;
- $s = $jumper->skills;
- do {
- $day++;
- $i = substr($s, $day - 1, 1) - 1;
- echo $jumper->id_jumper . " " . $i . "<br>";
- } while ($skills[$i] == $maxes[$i] && $day < 7);
- if ($day == 7 && $skills[$i] == $maxes[$i]) {
- $db->endCamp($jumper->id_jumper);
- continue;
- }
- $remain[$i] -= 6;
- $days = explode(".", $talent [$i]);
- $pot = explode(".", $talent[$i + 4]);
- $pot = refactor($pot);
- while ($remain[$i] < 1 && $skills[$i] < $maxes[$i]) {
- $skills[$i] ++;
- $changes[$i] ++;
- $remain[$i] += getRemaining($skills[$i], $days, $pot);
- }
- if ($skills[$i] == $maxes[$i]) {
- $remain[$i] = getRemaining($skills[$i], $days, $pot);
- }
- if ($day < 6) {
- if ($jumper->form < 100) {
- $changes[4] ++;
- }
- } else {
- if ($jumper->form < 99) {
- $changes[4]+=2;
- } elseif ($jumper->form == 99) {
- $changes[4] ++;
- }
- }
- $plus = explode("&", $jumper->plus);
- var_dump($changes);
- $p = array(0, 0, 0, 0, 0);
- for ($g = 0; $g < 5; $g++) {
- $p[$g] = $changes[$g] + $plus[$g];
- }
- $pe = implode("&", $p);
- echo "<br>" . $pe;
- if ($jumper->day < $day) {
- $db->updateCampDay($day, $jumper->id_jumper);
- }
- $db->updateSkills($skills, $remain, $p[0] . '' . $p[1] . '' . $p[2] . '' . $p[3], $jumper->id_jumper);
- $db->onCampLvlUp($pe, $changes[4], $jumper->id_jumper);
- }
RAW Paste Data

