1 | 1 |
new file mode 100755 |
... | ... |
@@ -0,0 +1,215 @@ |
1 |
+<?php |
|
2 |
+//creation de la session ... inclusion du code ... verification de la session connect�e... |
|
3 |
+session_start(); |
|
4 |
+include ('fonctions.php'); |
|
5 |
+check_session(); |
|
6 |
+include ('fonctionsDenTete.php'); |
|
7 |
+ //teste si l'on vient de la fiche d'etat si oui on ne fait plus rien... |
|
8 |
+ if(!isset($_GET['etat'])){ |
|
9 |
+ //double test pour savoir si on vient bien d'un lien du changement de niveau |
|
10 |
+ //cas 0: on vient de n'importe quelle page |
|
11 |
+ //cas 1 et 2: on vient d'un lien de la page de changement de niveau |
|
12 |
+ if(!isset($_GET['choixChangementNiveau'])){ |
|
13 |
+ if($_SESSION['triche']==0){ |
|
14 |
+ $_SESSION['triche']=1; |
|
15 |
+ }else{ |
|
16 |
+ header("location:CasDeTriche.php"); |
|
17 |
+ } |
|
18 |
+ }else{ |
|
19 |
+ if (($_GET['choixChangementNiveau']<6&&$_SESSION['triche']==1)||($_GET['choixChangementNiveau']>5&&$_SESSION['triche']==2)){ |
|
20 |
+ //changement de la var Triche pour r�gler le probl�me des niveau automatiques... |
|
21 |
+ if($_GET['choixChangementNiveau']<6){ |
|
22 |
+ $_SESSION['triche']=2; |
|
23 |
+ }else{ |
|
24 |
+ $_SESSION['triche']=3; |
|
25 |
+ } |
|
26 |
+ //le code pour le changement de niveau.. |
|
27 |
+ switch($_GET['choixChangementNiveau']){ |
|
28 |
+ case 0: |
|
29 |
+ //Force |
|
30 |
+ $_SESSION['Niveau']++; |
|
31 |
+ $_SESSION['xp'] = 0; |
|
32 |
+ $_SESSION['xpMax'] = round($_SESSION['xpMax']+($_SESSION['xpMax']/2)); |
|
33 |
+ $_SESSION['For'] = maxCent($_SESSION['For']+4); |
|
34 |
+ break; |
|
35 |
+ case 1: |
|
36 |
+ //vitalit� |
|
37 |
+ $_SESSION['Niveau']++; |
|
38 |
+ $_SESSION['xp'] = 0; |
|
39 |
+ $_SESSION['xpMax'] = round($_SESSION['xpMax']+($_SESSION['xpMax']/2)); |
|
40 |
+ $_SESSION['Vit'] = maxCent($_SESSION['Vit']+4); |
|
41 |
+ break; |
|
42 |
+ case 2: |
|
43 |
+ //intelligence |
|
44 |
+ $_SESSION['Niveau']++; |
|
45 |
+ $_SESSION['xp'] = 0; |
|
46 |
+ $_SESSION['xpMax'] = round($_SESSION['xpMax']+($_SESSION['xpMax']/2)); |
|
47 |
+ $_SESSION['Int'] = maxCent($_SESSION['Int']+4); |
|
48 |
+ break; |
|
49 |
+ case 3: |
|
50 |
+ //sagesse |
|
51 |
+ $_SESSION['Niveau']++; |
|
52 |
+ $_SESSION['xp'] = 0; |
|
53 |
+ $_SESSION['xpMax'] = round($_SESSION['xpMax']+($_SESSION['xpMax']/2)); |
|
54 |
+ $_SESSION['Sag'] = maxCent($_SESSION['Sag']+4); |
|
55 |
+ break; |
|
56 |
+ case 4: |
|
57 |
+ //charisme |
|
58 |
+ $_SESSION['Niveau']++; |
|
59 |
+ $_SESSION['xp'] = 0; |
|
60 |
+ $_SESSION['xpMax'] = round($_SESSION['xpMax']+($_SESSION['xpMax']/2)); |
|
61 |
+ $_SESSION['Cha'] = maxCent($_SESSION['Cha']+4); |
|
62 |
+ break; |
|
63 |
+ case 5: |
|
64 |
+ //dexterit� |
|
65 |
+ $_SESSION['Niveau']++; |
|
66 |
+ $_SESSION['xp'] = 0; |
|
67 |
+ $_SESSION['xpMax'] = round($_SESSION['xpMax']+($_SESSION['xpMax']/2)); |
|
68 |
+ $_SESSION['Dex'] = maxCent($_SESSION['Dex']+4); |
|
69 |
+ break; |
|
70 |
+ case 6: |
|
71 |
+ //Force |
|
72 |
+ $_SESSION['For'] = maxCent($_SESSION['For']+2); |
|
73 |
+ header("location:".$_SESSION['pageprecedentCombat']."?combatFini=1&objetTomber=".$_GET['objetTomber']); |
|
74 |
+ break; |
|
75 |
+ case 7: |
|
76 |
+ //vitalit� |
|
77 |
+ $_SESSION['Vit'] = maxCent($_SESSION['Vit']+2); |
|
78 |
+ header("location:".$_SESSION['pageprecedentCombat']."?combatFini=1&objetTomber=".$_GET['objetTomber']); |
|
79 |
+ break; |
|
80 |
+ case 8: |
|
81 |
+ //intelligence |
|
82 |
+ $_SESSION['Int'] = maxCent($_SESSION['Int']+2); |
|
83 |
+ header("location:".$_SESSION['pageprecedentCombat']."?combatFini=1&objetTomber=".$_GET['objetTomber']); |
|
84 |
+ break; |
|
85 |
+ case 9: |
|
86 |
+ //sagesse |
|
87 |
+ $_SESSION['Sag'] = maxCent($_SESSION['Sag']+2); |
|
88 |
+ header("location:".$_SESSION['pageprecedentCombat']."?combatFini=1&objetTomber=".$_GET['objetTomber']); |
|
89 |
+ break; |
|
90 |
+ case 10: |
|
91 |
+ //charisme |
|
92 |
+ $_SESSION['Cha'] = maxCent($_SESSION['Cha']+2); |
|
93 |
+ header("location:".$_SESSION['pageprecedentCombat']."?combatFini=1&objetTomber=".$_GET['objetTomber']); |
|
94 |
+ break; |
|
95 |
+ case 11: |
|
96 |
+ //dexterit� |
|
97 |
+ $_SESSION['Dex'] = maxCent($_SESSION['Dex']+2); |
|
98 |
+ header("location:".$_SESSION['pageprecedentCombat']."?combatFini=1&objetTomber=".$_GET['objetTomber']); |
|
99 |
+ break; |
|
100 |
+ } |
|
101 |
+ $_SESSION['FatigueActuelle'] = $_SESSION['FatigueMax']; |
|
102 |
+ $_SESSION['VitActuelle'] = $_SESSION['Vit']; |
|
103 |
+ CalculCaractAugmentee(TRUE); |
|
104 |
+ }else{ |
|
105 |
+ header("location:CasDeTriche.php"); |
|
106 |
+ } |
|
107 |
+ } |
|
108 |
+ } |
|
109 |
+?> |
|
110 |
+<html> |
|
111 |
+<head> |
|
112 |
+<title>Ville de Dragons</title> |
|
113 |
+<link rel='stylesheet' href='Style.css' type='text/css'> |
|
114 |
+</head> |
|
115 |
+<body> |
|
116 |
+<?php |
|
117 |
+ AfficheBarreDEtat(0); |
|
118 |
+?> |
|
119 |
+<table border="0" height="100%" width="100%"> |
|
120 |
+ <tr> |
|
121 |
+ <td valign="center"> |
|
122 |
+ <table border="0" cellspacing="0" cellpadding="0" align="center"> |
|
123 |
+ <tr> |
|
124 |
+ <td width="400"> |
|
125 |
+ <?php |
|
126 |
+ if (!isset($_GET['choixChangementNiveau'])){ |
|
127 |
+ echo "<h2>BRAVO ! </h2><br>Vous venez de passer niveau ".($_SESSION['Niveau']+1)."<br>" |
|
128 |
+ ."<p align='left'>Veuillez choisir la caracteristique principale <br>que vous d�sirez augmenter ( +4 ) :</p>"; |
|
129 |
+ }else{ |
|
130 |
+ echo "<h2>BRAVO ! </h2><br>Vous venez de passer niveau ".$_SESSION['Niveau']."<br>" |
|
131 |
+ ."<p align='left'>Veuillez choisir la caracteristique secondaire <br>que vous d�sirez augmenter ( +2 ) :</p>"; |
|
132 |
+ } |
|
133 |
+ echo "<center><img src='images/fioriture.png'></center>"; |
|
134 |
+ if (!isset($_GET['choixChangementNiveau'])){ |
|
135 |
+ if ($_SESSION['For']!=100){ |
|
136 |
+ echo "<a href='changementNiveau.php?choixChangementNiveau=0&objetTomber=".$_GET['objetTomber']."'>La Force</a>"; |
|
137 |
+ } |
|
138 |
+ if ($_SESSION['Vit']!=100){ |
|
139 |
+ echo "<br><a href='changementNiveau.php?choixChangementNiveau=1&objetTomber=".$_GET['objetTomber']."'>La Vitalit�</a>"; |
|
140 |
+ } |
|
141 |
+ if ($_SESSION['Int']!=100){ |
|
142 |
+ echo "<br><a href='changementNiveau.php?choixChangementNiveau=2&objetTomber=".$_GET['objetTomber']."'>L'Intelligence</a>"; |
|
143 |
+ } |
|
144 |
+ if ($_SESSION['Sag']!=100){ |
|
145 |
+ echo "<br><a href='changementNiveau.php?choixChangementNiveau=3&objetTomber=".$_GET['objetTomber']."'>La Sagesse</a>"; |
|
146 |
+ } |
|
147 |
+ if ($_SESSION['Cha']!=100){ |
|
148 |
+ echo "<br><a href='changementNiveau.php?choixChangementNiveau=4&objetTomber=".$_GET['objetTomber']."'>Le Charisme</a>"; |
|
149 |
+ } |
|
150 |
+ if ($_SESSION['Dex']!=100){ |
|
151 |
+ echo "<br><a href='changementNiveau.php?choixChangementNiveau=5&objetTomber=".$_GET['objetTomber']."'>La Dext�rit�</a>"; |
|
152 |
+ } |
|
153 |
+ }else{ |
|
154 |
+ if ($_SESSION['For']!=100){ |
|
155 |
+ echo "<a href='changementNiveau.php?choixChangementNiveau=6&objetTomber=".$_GET['objetTomber']."'>La Force</a>"; |
|
156 |
+ } |
|
157 |
+ if ($_SESSION['Vit']!=100){ |
|
158 |
+ echo "<br><a href='changementNiveau.php?choixChangementNiveau=7&objetTomber=".$_GET['objetTomber']."'>La Vitalit�</a>"; |
|
159 |
+ } |
|
160 |
+ if ($_SESSION['Int']!=100){ |
|
161 |
+ echo "<br><a href='changementNiveau.php?choixChangementNiveau=8&objetTomber=".$_GET['objetTomber']."'>L'Intelligence</a>"; |
|
162 |
+ } |
|
163 |
+ if ($_SESSION['Sag']!=100){ |
|
164 |
+ echo "<br><a href='changementNiveau.php?choixChangementNiveau=9&objetTomber=".$_GET['objetTomber']."'>La Sagesse</a>"; |
|
165 |
+ } |
|
166 |
+ if ($_SESSION['Cha']!=100){ |
|
167 |
+ echo "<br><a href='changementNiveau.php?choixChangementNiveau=10&objetTomber=".$_GET['objetTomber']."'>Le Charisme</a>"; |
|
168 |
+ } |
|
169 |
+ if ($_SESSION['Dex']!=100){ |
|
170 |
+ echo "<br><a href='changementNiveau.php?choixChangementNiveau=11&objetTomber=".$_GET['objetTomber']."'>La Dext�rit�</a>"; |
|
171 |
+ } |
|
172 |
+ } |
|
173 |
+ ?> |
|
174 |
+ </td> |
|
175 |
+ <td width="300"> |
|
176 |
+ <table border="0" cellspacing="0" cellpadding="0" align="center"> |
|
177 |
+ <tr> |
|
178 |
+ <td background="images/bordure_01.gif" width="14" height="19"> |
|
179 |
+ </td> |
|
180 |
+ <td background="images/bordure_02.gif" width="200" height="19"> |
|
181 |
+ </td> |
|
182 |
+ <td background="images/bordure_03.gif" width="14" height="19"> |
|
183 |
+ </td> |
|
184 |
+ </tr> |
|
185 |
+ <tr> |
|
186 |
+ <td background="images/bordure_04.gif" width="14" height="341"> |
|
187 |
+ </td> |
|
188 |
+ <td width="200" height="341" align="center" valign="center"> |
|
189 |
+ <?php |
|
190 |
+ echo "<img src='images/dessins/chgtniveau.jpg' border ='0' width='200' height='341'>"; |
|
191 |
+ ?> |
|
192 |
+ </td> |
|
193 |
+ <td background="images/bordure_06.gif" width="14" height="341"> |
|
194 |
+ </td> |
|
195 |
+ </tr> |
|
196 |
+ <tr> |
|
197 |
+ <td background="images/bordure_07.gif" width="14" height="18"> |
|
198 |
+ </td> |
|
199 |
+ <td background="images/bordure_08.gif" width="200" height="18"> |
|
200 |
+ </td> |
|
201 |
+ <td background="images/bordure_09.gif" width="14" height="18"> |
|
202 |
+ </td> |
|
203 |
+ </tr> |
|
204 |
+ </table> |
|
205 |
+ </td> |
|
206 |
+ </tr> |
|
207 |
+ </table> |
|
208 |
+ </td> |
|
209 |
+ </tr> |
|
210 |
+</table> |
|
211 |
+</body> |
|
212 |
+</html> |
|
213 |
+<?php |
|
214 |
+ mysql_close(); |
|
215 |
+?> |