コード例 #1
0
ファイル: chars.php プロジェクト: dapfru/gladiators
function update_chars($v1, $v2, $v3, $v4)
{
    global $rst, $auth;
    $rst[Charisma] += $v1;
    $rst[Command] += $v2;
    $rst[Management] += $v3;
    $rst[Commerce] += $v4;
    $rst[Points] -= $v1 + $v2 + $v3 + $v4;
    if ($rst[Points] >= 0 && ($v5 == $c || !$c)) {
        write_rst($auth->user, $rst);
    }
}
コード例 #2
0
ファイル: level.php プロジェクト: dapfru/gladiators
    }
    if ($er) {
        print icon("error", $er) . "<br>";
    }
    if (!$er) {
        runsql("update ut_gladiators g set Price=round(power(1.18,'{$level}')*(12/(10-Talent)-1)*(select Coefficient from ut_gladiator_types where TypeID=g.TypeID)*1.5*EXP((Age-23)*(Age-23)/-200)*100) where GladiatorID='{$id}'");
        $rst = $auth->rst;
        $q = select("select Price from ut_gladiators where GladiatorID='{$id}'");
        $rst[Gladiators][$id][Price] = $q[0];
        $rst[Gladiators][$id][Level] = $level;
        $rst[Gladiators][$id][Vit] = $_GET['Vit'];
        $rst[Gladiators][$id][Dex] = $_GET['Dex'];
        $rst[Gladiators][$id][Acc] = $_GET['Acc'];
        $rst[Gladiators][$id][Str] = $_GET['Str'];
        $auth->rst = $rst;
        write_rst($auth->user, $rst);
    }
    unlock_rst($auth->user);
    header("Location:/xml/gladiators/train.php");
}
require $site_path . "up.php";
require $site_path . "left.php";
$gladiator = $auth->rst[Gladiators][$id];
$k = $id;
unset($serialized);
$gladiator[Exp] = round($gladiator[Exp] + expgained($auth->rst));
$exp = $gladiator[Exp];
$q = select("select Level from ut_exp where Points<='{$exp}' order by Level desc limit 0,1");
$points = ($q[Level] - $gladiator[Level]) * 3;
if ($id && $gladiator && $points > 0) {
    ?>
コード例 #3
0
ファイル: test.php プロジェクト: dapfru/gladiators
<?php

include "../config.php";
$user = 20;
lock_rst($user);
$rst = read_rst($user);
$rst[Status][4] = strval(100);
$rst[Status][8] = strval(100);
$rst[Status][2] = strval(100);
write_rst($user, $rst);
unlock_rst($user);
コード例 #4
0
ファイル: fight.php プロジェクト: dapfru/gladiators
                    } elseif ($rst2[Gladiators][$k]) {
                        $rst2[Gladiators][$k][Morale] = $v[Morale];
                        $rst2[Gladiators][$k][Injury] = $v[Injury];
                        $rst2[Gladiators][$k][Stamina] = $v[Stamina];
                        $rst2[Gladiators][$k][Exp] += round($v[Exp], 3);
                        //print "[$k][Morale]=$v[Morale]<br>";
                        //print "[$k][Injury]=$v[Injury]<br>";
                        //print "[$k][Stamina]=$v[Stamina]<br>";
                        //print "[$k][Exp]=$v[Exp]<br>";
                    }
                }
                //exit;
                $rst1[Date] = mktime();
                $rst2[Date] = mktime();
                write_rst($user1, $rst1);
                write_rst($user2, $rst2);
                unlock_rst($user1);
                unlock_rst($user2);
                //exit;
                header("Location:online.php?id={$id}");
            }
        } else {
            print "До боя осталось: <input type=\"text\" id=\"Timer\" style=\"border:0;background-color:3B484C;color:E5CEA6\" readonly size=4>";
            print "<br><a href=/builder/?id={$id}>Вернуться к настройкам</a>";
            ?>

<script language="JavaScript">

<!-- www.cgi.ru -->

var up, down;
コード例 #5
0
ファイル: config.php プロジェクト: dapfru/gladiators
function transfer_money($money, $sender, $receiver, $type, $info)
{
    @clearstatcache();
    if ($money > 0 && $sender > 0 && $receiver > 0) {
        if ($sender == 1) {
            $senderbalance = '';
        } else {
            $sender_rst = read_rst($sender);
            $senderbalance = $sender_rst[Money] - $money;
            $sender_rst[Money] = round($senderbalance);
        }
        if ($receiver == 1) {
            $receiverbalance = '';
        } else {
            $receiver_rst = read_rst($receiver);
            $receiverbalance = $receiver_rst[Money] + $money;
            $receiver_rst[Money] = round($receiverbalance);
        }
        runsql("insert into fn_operations(Money,SenderID,ReceiverID,SenderBalance,ReceiverBalance,TypeID,OperationDate,OperationObject) values('{$money}','{$sender}','{$receiver}','{$senderbalance}','{$receiverbalance}','{$type}' ,unix_timestamp(),'{$info}')");
        if ($receiver != 1) {
            write_rst($receiver, $receiver_rst);
        }
        if ($sender != 1) {
            write_rst($sender, $sender_rst);
        }
    }
}