forked from halo-battle/game
Version 1.13a
This commit is contained in:
parent
de31cd3e9a
commit
ba8f323879
1634 changed files with 10080 additions and 213021 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if(!defined('INDEX') || SURFACE != "planete") { header('Location: ./'.$VAR['first_page']); exit; }
|
||||
$titre = 'Bourse';
|
||||
|
||||
$a = gpc('a');
|
||||
|
|
@ -27,8 +27,10 @@ if(is_numeric($a) && is_numeric(gpc('a'.$a, 'post'))){
|
|||
|
||||
//On vérifie que le joueur ait assez de crédits pour acheter
|
||||
if ($prix <= $planete->credits) {
|
||||
$planete->credits -= $prix;
|
||||
$planete->addCredits(-1*$prix);
|
||||
$planete->addModifUser('credits');
|
||||
$planete->$var += $nb;
|
||||
$planete->addModif('force');
|
||||
|
||||
if (empty($action['graph'])) $action['graph'] = array();
|
||||
else $action['graph'] = unserialize($action['graph']);
|
||||
|
|
@ -58,8 +60,10 @@ elseif(is_numeric($v) && is_numeric(gpc('a'.$v, 'post'))){
|
|||
$bdd->deconnexion();
|
||||
|
||||
$prix = ceil(pow($action['dispo'], -0.1) * $nb * 1.8)/10;
|
||||
$planete->credits += $prix;
|
||||
$planete->addCredits($prix);
|
||||
$planete->addModifUser('credits');
|
||||
$planete->$var -= $nb;
|
||||
$planete->addModif('force');
|
||||
|
||||
if (empty($action['graph'])) $action['graph'] = array();
|
||||
else $action['graph'] = unserialize($action['graph']);
|
||||
|
|
@ -84,4 +88,5 @@ foreach($bourse as $key => $action){
|
|||
|
||||
$page = 'marche';
|
||||
$template->assign('bourse', $bourse);
|
||||
unset($a, $v, $var, $bourse, $graph, $key, $action, $nb, $prix);
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue