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,27 +1,51 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
$page = 'ressources';
|
||||
if(!defined('INDEX')) { header('Location: ./'.$VAR['first_page']); exit; }
|
||||
$titre = 'Ressources';
|
||||
|
||||
if (isset($_POST['coeff_metal']) && isset($_POST['coeff_cs'])) {
|
||||
if (SURFACE == "planete")
|
||||
{
|
||||
$page = 'ressources';
|
||||
if (isset($_POST['coeff_metal']) && isset($_POST['coeff_cs'])) {
|
||||
|
||||
$planete->coeff_bat[0] = floor($_POST['coeff_metal'])/100;
|
||||
if (isset($_POST['coeff_cristal'])) $planete->coeff_bat[1] = floor($_POST['coeff_cristal'])/100;
|
||||
if (isset($_POST['coeff_hydrogene'])) $planete->coeff_bat[2] = floor($_POST['coeff_hydrogene'])/100;
|
||||
$planete->coeff_bat[3] = floor($_POST['coeff_cs'])/100;
|
||||
if (isset($_POST['coeff_ce'])) $planete->coeff_bat[4] = floor($_POST['coeff_ce'])/100;
|
||||
$planete->addModif("coeff_bat");
|
||||
|
||||
redirection('?p=ressources');
|
||||
}
|
||||
|
||||
$tablo = $planete->production(3600, true);
|
||||
|
||||
$template->assign('ressources_prod', $tablo[1]);
|
||||
$template->assign('ressources_conso', $tablo[2]);
|
||||
$template->assign('ressources_coef', $tablo[0]);
|
||||
$template->assign('ressources_silo', array($planete->batiments[10], pow(2, $planete->batiments[10]) * 100000));
|
||||
$template->assign('ressources_toto', array($tablo[1][2] - $tablo[2][3], '(0)'));
|
||||
|
||||
$template->assign('ressources_tab', array(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100));
|
||||
|
||||
$planete->coeff_bat[0] = floor($_POST['coeff_metal'])/100;
|
||||
if (isset($_POST['coeff_cristal'])) $planete->coeff_bat[1] = floor($_POST['coeff_cristal'])/100;
|
||||
if (isset($_POST['coeff_hydrogene'])) $planete->coeff_bat[2] = floor($_POST['coeff_hydrogene'])/100;
|
||||
$planete->coeff_bat[3] = floor($_POST['coeff_cs'])/100;
|
||||
if (isset($_POST['coeff_ce'])) $planete->coeff_bat[4] = floor($_POST['coeff_ce'])/100;
|
||||
$planete->addModif("coeff_bat");
|
||||
unset($tablo);
|
||||
}
|
||||
else
|
||||
{
|
||||
$page = 'ressources_alli';
|
||||
|
||||
$don_credits = intval(gpc("credits", "post"));
|
||||
if (!empty($don_credits) && $don_credits > 0)
|
||||
{
|
||||
//Si le joueur n'a pas assez de crédits
|
||||
if ($don_credits > $planete->credits)
|
||||
erreur('Vous n\'avez pas suffisamment de crédits pour en donner autant.', 'red', $VAR['menu']['ressources']);
|
||||
|
||||
redirection('?p=ressources');
|
||||
}
|
||||
$planete->addCreditsAlliance($don_credits);
|
||||
$planete->addCredits(-1 * $don_credits);
|
||||
|
||||
$tablo = $planete->production(3600, true);
|
||||
erreur('Votre don de '.$don_credits.' '.$LANG[$race]["ressources"]["noms"]["credits"].' a été effectué avec succès.', 'green', $VAR['menu']['ressources']);
|
||||
}
|
||||
|
||||
$template->assign('ressources_prod', $tablo[1]);
|
||||
$template->assign('ressources_conso', $tablo[2]);
|
||||
$template->assign('ressources_coef', $tablo[0]);
|
||||
$template->assign('ressources_silo', array($planete->batiments[10], pow(2, $planete->batiments[10]) * 100000));
|
||||
$template->assign('ressources_toto', array($tablo[1][2] - $tablo[2][3], '(0)'));
|
||||
|
||||
$template->assign('ressources_tab', array(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100));
|
||||
unset($don_credits);
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue