<?php
//creation de la session ... inclusion du code ... verification de la session connect�e...
session_start();
include ('fonctions.php');
check_session();
include ('fonctionsDenTete.php');
//teste si l'on vient de la fiche d'etat si oui on ne fait plus rien...
if(!isset($_GET['etat'])){
//double test pour savoir si on vient bien d'un lien du changement de niveau
//cas 0: on vient de n'importe quelle page
//cas 1 et 2: on vient d'un lien de la page de changement de niveau
if(!isset($_GET['choixChangementNiveau'])){
if($_SESSION['triche']==0){
$_SESSION['triche']=1;
}else{
header("location:CasDeTriche.php");
}
}else{
if (($_GET['choixChangementNiveau']<6&&$_SESSION['triche']==1)||($_GET['choixChangementNiveau']>5&&$_SESSION['triche']==2)){
//changement de la var Triche pour r�gler le probl�me des niveau automatiques...
if($_GET['choixChangementNiveau']<6){
$_SESSION['triche']=2;
}else{
$_SESSION['triche']=3;
}
//le code pour le changement de niveau..
switch($_GET['choixChangementNiveau']){
case 0:
//Force
$_SESSION['Niveau']++;
$_SESSION['xp'] = 0;
$_SESSION['xpMax'] = round($_SESSION['xpMax']+($_SESSION['xpMax']/2));
$_SESSION['For'] = maxCent($_SESSION['For']+4);
break;
case 1:
//vitalit�
$_SESSION['Niveau']++;
$_SESSION['xp'] = 0;
$_SESSION['xpMax'] = round($_SESSION['xpMax']+($_SESSION['xpMax']/2));
$_SESSION['Vit'] = maxCent($_SESSION['Vit']+4);
break;
case 2:
//intelligence
$_SESSION['Niveau']++;
$_SESSION['xp'] = 0;
$_SESSION['xpMax'] = round($_SESSION['xpMax']+($_SESSION['xpMax']/2));
$_SESSION['Int'] = maxCent($_SESSION['Int']+4);
break;
case 3:
//sagesse
$_SESSION['Niveau']++;
$_SESSION['xp'] = 0;
$_SESSION['xpMax'] = round($_SESSION['xpMax']+($_SESSION['xpMax']/2));
$_SESSION['Sag'] = maxCent($_SESSION['Sag']+4);
break;
case 4:
//charisme
$_SESSION['Niveau']++;
$_SESSION['xp'] = 0;
$_SESSION['xpMax'] = round($_SESSION['xpMax']+($_SESSION['xpMax']/2));
$_SESSION['Cha'] = maxCent($_SESSION['Cha']+4);
break;
case 5:
//dexterit�
$_SESSION['Niveau']++;
$_SESSION['xp'] = 0;
$_SESSION['xpMax'] = round($_SESSION['xpMax']+($_SESSION['xpMax']/2));
$_SESSION['Dex'] = maxCent($_SESSION['Dex']+4);
break;
case 6:
//Force
$_SESSION['For'] = maxCent($_SESSION['For']+2);
header("location:".$_SESSION['pageprecedentCombat']."?combatFini=1");
break;
case 7:
//vitalit�
$_SESSION['Vit'] = maxCent($_SESSION['Vit']+2);
header("location:".$_SESSION['pageprecedentCombat']."?combatFini=1");
break;
case 8:
//intelligence
$_SESSION['Int'] = maxCent($_SESSION['Int']+2);
header("location:".$_SESSION['pageprecedentCombat']."?combatFini=1");
break;
case 9:
//sagesse
$_SESSION['Sag'] = maxCent($_SESSION['Sag']+2);
header("location:".$_SESSION['pageprecedentCombat']."?combatFini=1");
break;
case 10:
//charisme
$_SESSION['Cha'] = maxCent($_SESSION['Cha']+2);
header("location:".$_SESSION['pageprecedentCombat']."?combatFini=1");
break;
case 11:
//dexterit�
$_SESSION['Dex'] = maxCent($_SESSION['Dex']+2);
header("location:".$_SESSION['pageprecedentCombat']."?combatFini=1");
break;
}
$_SESSION['FatigueActuelle'] = $_SESSION['FatigueMax'];
$_SESSION['VitActuelle'] = $_SESSION['Vit'];
CalculCaractAugmentee(TRUE);
}else{
header("location:CasDeTriche.php");
}
}
}
?>
<html>
<head>
<title>Ville de Dragons</title>
<link rel='stylesheet' href='Style.css' type='text/css'>
</head>
<body>
<?php
AfficheBarreDEtat(0);
?>
<table border="0" height="100%" width="100%">
<tr>
<td valign="center">
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="400">
<?php
if (!isset($_GET['choixChangementNiveau'])){
echo "<h2>BRAVO ! </h2><br>Vous venez de passer niveau ".($_SESSION['Niveau']+1)."<br>"
."<p align='left'>Veuillez choisir la caracteristique principale <br>que vous d�sirez augmenter ( +4 ) :</p>";
}else{
echo "<h2>BRAVO ! </h2><br>Vous venez de passer niveau ".$_SESSION['Niveau']."<br>"
."<p align='left'>Veuillez choisir la caracteristique secondaire <br>que vous d�sirez augmenter ( +2 ) :</p>";
}
echo "<center><img src='images/fioriture.png'></center>";
if (!isset($_GET['choixChangementNiveau'])){
if ($_SESSION['For']!=100){
echo "<a href='changementNiveau.php?choixChangementNiveau=0'>La Force</a>";
}
if ($_SESSION['Vit']!=100){
echo "<br><a href='changementNiveau.php?choixChangementNiveau=1'>La Vitalit�</a>";
}
if ($_SESSION['Int']!=100){
echo "<br><a href='changementNiveau.php?choixChangementNiveau=2'>L'Intelligence</a>";
}
if ($_SESSION['Sag']!=100){
echo "<br><a href='changementNiveau.php?choixChangementNiveau=3'>La Sagesse</a>";
}
if ($_SESSION['Cha']!=100){
echo "<br><a href='changementNiveau.php?choixChangementNiveau=4'>Le Charisme</a>";
}
if ($_SESSION['Dex']!=100){
echo "<br><a href='changementNiveau.php?choixChangementNiveau=5'>La Dext�rit�</a>";
}
}else{
if ($_SESSION['For']!=100){
echo "<a href='changementNiveau.php?choixChangementNiveau=6'>La Force</a>";
}
if ($_SESSION['Vit']!=100){
echo "<br><a href='changementNiveau.php?choixChangementNiveau=7'>La Vitalit�</a>";
}
if ($_SESSION['Int']!=100){
echo "<br><a href='changementNiveau.php?choixChangementNiveau=8'>L'Intelligence</a>";
}
if ($_SESSION['Sag']!=100){
echo "<br><a href='changementNiveau.php?choixChangementNiveau=9'>La Sagesse</a>";
}
if ($_SESSION['Cha']!=100){
echo "<br><a href='changementNiveau.php?choixChangementNiveau=10'>Le Charisme</a>";
}
if ($_SESSION['Dex']!=100){
echo "<br><a href='changementNiveau.php?choixChangementNiveau=11'>La Dext�rit�</a>";
}
}
?>
</td>
<td width="300">
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td background="images/bordure_01.gif" width="14" height="19">
</td>
<td background="images/bordure_02.gif" width="200" height="19">
</td>
<td background="images/bordure_03.gif" width="14" height="19">
</td>
</tr>
<tr>
<td background="images/bordure_04.gif" width="14" height="341">
</td>
<td width="200" height="341" align="center" valign="center">
<?php
echo "<img src='images/dessins/chgtniveau.jpg' border ='0' width='200' height='341'>";
?>
</td>
<td background="images/bordure_06.gif" width="14" height="341">
</td>
</tr>
<tr>
<td background="images/bordure_07.gif" width="14" height="18">
</td>
<td background="images/bordure_08.gif" width="200" height="18">
</td>
<td background="images/bordure_09.gif" width="14" height="18">
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<?php
mysql_close();
?>
|