1 | 1 |
new file mode 100755 |
... | ... |
@@ -0,0 +1,719 @@ |
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 |
+?> |
|
7 |
+<html> |
|
8 |
+<head> |
|
9 |
+<title>Ville de Dragons</title> |
|
10 |
+<link rel='stylesheet' href='Style.css' type='text/css'> |
|
11 |
+<?php |
|
12 |
+//variable pour afficher la bonne page en cas de fermeture inopin�e de fenetre |
|
13 |
+ if(!isset($_GET['mort'])){ |
|
14 |
+ $mort=0; |
|
15 |
+ }else{ |
|
16 |
+ $mort=$_GET['mort']; |
|
17 |
+ } |
|
18 |
+//mise a Zero de certaines variable |
|
19 |
+$persoRate = FALSE; |
|
20 |
+$ennemiRate = FALSE; |
|
21 |
+$degatsSurEnnemi = 0; |
|
22 |
+$degatsSurPerso = 0; |
|
23 |
+//ajustement du au poids |
|
24 |
+switch($_SESSION['Poids']){ |
|
25 |
+ case 0: |
|
26 |
+ $ajustementTouchePerso = rand(0,20); |
|
27 |
+ $ajustementDegatsPerso = rand(0,20)-20; |
|
28 |
+ break; |
|
29 |
+ case 1: |
|
30 |
+ $ajustementTouchePerso = rand(0,10); |
|
31 |
+ $ajustementDegatsPerso = rand(0,10)-10; |
|
32 |
+ break; |
|
33 |
+ case 2: |
|
34 |
+ $ajustementTouchePerso = 0; |
|
35 |
+ $ajustementDegatsPerso = 0; |
|
36 |
+ break; |
|
37 |
+ case 3: |
|
38 |
+ $ajustementTouchePerso = rand(0,10)-10; |
|
39 |
+ $ajustementDegatsPerso = rand(0,10); |
|
40 |
+ break; |
|
41 |
+ case 4: |
|
42 |
+ $ajustementTouchePerso = rand(0,20)-20; |
|
43 |
+ $ajustementDegatsPerso = rand(0,20); |
|
44 |
+ break; |
|
45 |
+} |
|
46 |
+//ajustement du a l'alcool |
|
47 |
+if($_SESSION['FatigueActuelle']<$_SESSION['biereBu']){ |
|
48 |
+ $ajustementTouchePerso -= 10+rand(0,20); |
|
49 |
+} |
|
50 |
+//RAZ des variables de localisation des d�gats si debut de combat |
|
51 |
+if(!isset($_GET['combatengage'])){ |
|
52 |
+$_SESSION['combat_tetePerso']=1; |
|
53 |
+$_SESSION['combat_brasGPerso']=1; |
|
54 |
+$_SESSION['combat_brasDPerso']=1; |
|
55 |
+$_SESSION['combat_jambeGPerso']=1; |
|
56 |
+$_SESSION['combat_jambeDPerso']=1; |
|
57 |
+$_SESSION['combat_corpsPerso']=1; |
|
58 |
+$_SESSION['combat_teteMonstre']=1; |
|
59 |
+$_SESSION['combat_brasGMonstre']=1; |
|
60 |
+$_SESSION['combat_brasDMonstre']=1; |
|
61 |
+$_SESSION['combat_jambeGMonstre']=1; |
|
62 |
+$_SESSION['combat_jambeDMonstre']=1; |
|
63 |
+$_SESSION['combat_corpsMonstre']=1; |
|
64 |
+} |
|
65 |
+ |
|
66 |
+//variable pour savoir si le combat est engag� et pour calculer les degats |
|
67 |
+ if(isset($_GET['combatengage'])){ |
|
68 |
+ $pourcentDefenseEnnemi = maxCent(rand(0,100)); |
|
69 |
+ $pourcentDefensePerso = maxCent(rand(0,100)); |
|
70 |
+ //creation des variables de degats du tour |
|
71 |
+ switch($_GET['localisationDegatEnnemi']){ |
|
72 |
+ case 0: |
|
73 |
+ //le perso tape la tete |
|
74 |
+ if($pourcentDefenseEnnemi > $_GET['pourcentToucheEnnemi']){ |
|
75 |
+ //le perso rate |
|
76 |
+ $persoRate = TRUE; |
|
77 |
+ }else{ |
|
78 |
+ //le perso touche |
|
79 |
+ $degatsSurEnnemi = maxCent((($_SESSION['For']-$_SESSION['ennemiFor']) + 10 + rand(0,10)+$ajustementDegatsPerso)/5); |
|
80 |
+ } |
|
81 |
+ break; |
|
82 |
+ case 1: |
|
83 |
+ //le perso tape le corps |
|
84 |
+ if($pourcentDefenseEnnemi > $_GET['pourcentToucheEnnemi']){ |
|
85 |
+ //le perso rate |
|
86 |
+ $persoRate = TRUE; |
|
87 |
+ }else{ |
|
88 |
+ //le perso touche |
|
89 |
+ $degatsSurEnnemi = maxCent((($_SESSION['For']-$_SESSION['ennemiFor']) + rand(0,10)+$ajustementDegatsPerso)/5); |
|
90 |
+ } |
|
91 |
+ break; |
|
92 |
+ case 2: |
|
93 |
+ //le perso tape les jambes |
|
94 |
+ if($pourcentDefenseEnnemi > $_GET['pourcentToucheEnnemi']){ |
|
95 |
+ //le perso rate |
|
96 |
+ $persoRate = TRUE; |
|
97 |
+ }else{ |
|
98 |
+ //le perso touche |
|
99 |
+ $degatsSurEnnemi = maxCent((($_SESSION['For']-$_SESSION['ennemiFor']) + 5 + rand(0,10)+$ajustementDegatsPerso)/5); |
|
100 |
+ } |
|
101 |
+ break; |
|
102 |
+ } |
|
103 |
+ switch($_GET['localisationDegatsPerso']){ |
|
104 |
+ case 0: |
|
105 |
+ //le monstre tape la tete |
|
106 |
+ if($pourcentDefensePerso > $_GET['pourcentTouchePerso']){ |
|
107 |
+ //le monstre rate |
|
108 |
+ $ennemiRate = TRUE; |
|
109 |
+ }else{ |
|
110 |
+ //le monstre touche |
|
111 |
+ $degatsSurPerso = maxCent((($_SESSION['ennemiFor']-$_SESSION['For']) + 10 + rand(0,10))/5); |
|
112 |
+ } |
|
113 |
+ break; |
|
114 |
+ case 1: |
|
115 |
+ //le monstre tape le corps |
|
116 |
+ if($pourcentDefensePerso > $_GET['pourcentTouchePerso']){ |
|
117 |
+ //le monstre rate |
|
118 |
+ $ennemiRate = TRUE; |
|
119 |
+ }else{ |
|
120 |
+ //le monstre touche |
|
121 |
+ $degatsSurPerso = maxCent((($_SESSION['ennemiFor']-$_SESSION['For']) + rand(0,10))/5); |
|
122 |
+ } |
|
123 |
+ break; |
|
124 |
+ case 2: |
|
125 |
+ //le monstre tape les jambes |
|
126 |
+ if($pourcentDefensePerso > $_GET['pourcentTouchePerso']){ |
|
127 |
+ //le monstre rate |
|
128 |
+ $ennemiRate = TRUE; |
|
129 |
+ }else{ |
|
130 |
+ //le monstre touche |
|
131 |
+ $degatsSurPerso = maxCent((($_SESSION['ennemiFor']-$_SESSION['For']) + 5 + rand(0,10))/5); |
|
132 |
+ } |
|
133 |
+ break; |
|
134 |
+ } |
|
135 |
+//************************************************************************************************calcul des coups critiques |
|
136 |
+ //********************************************************************************MONSTRE |
|
137 |
+ $coupCritiqueMonstre = 0; |
|
138 |
+ if(!$ennemiRate){ |
|
139 |
+ if(rand(1,100)>30){ |
|
140 |
+ $coupCritiqueMonstre = 1; |
|
141 |
+ $degatsSurPerso += 1; |
|
142 |
+ if(rand(1,100)>15){ |
|
143 |
+ $coupCritiqueMonstre = 2; |
|
144 |
+ $degatsSurPerso = $degatsSurPerso*2; |
|
145 |
+ } |
|
146 |
+ } |
|
147 |
+ //actualisation des images des coups critiques |
|
148 |
+ switch($coupCritiqueMonstre){ |
|
149 |
+ case 1: |
|
150 |
+ switch($_GET['localisationDegatsPerso']){ |
|
151 |
+ case 0: |
|
152 |
+ $_SESSION['combat_tetePerso']++; |
|
153 |
+ break; |
|
154 |
+ case 1: |
|
155 |
+ $localisationAlea = rand(1,3); |
|
156 |
+ switch($localisationAlea){ |
|
157 |
+ case 1: |
|
158 |
+ $_SESSION['combat_brasGPerso']++; |
|
159 |
+ break; |
|
160 |
+ case 2: |
|
161 |
+ $_SESSION['combat_brasDPerso']++; |
|
162 |
+ break; |
|
163 |
+ case 3: |
|
164 |
+ $_SESSION['combat_corpsPerso']++; |
|
165 |
+ break; |
|
166 |
+ default: |
|
167 |
+ } |
|
168 |
+ break; |
|
169 |
+ case 2: |
|
170 |
+ if(rand(1,2)==1){ |
|
171 |
+ $_SESSION['combat_jambeGPerso']++; |
|
172 |
+ }else{ |
|
173 |
+ $_SESSION['combat_jambeDPerso']++; |
|
174 |
+ } |
|
175 |
+ break; |
|
176 |
+ default: |
|
177 |
+ } |
|
178 |
+ break; |
|
179 |
+ case 2: |
|
180 |
+ switch($_GET['localisationDegatsPerso']){ |
|
181 |
+ case 0: |
|
182 |
+ $_SESSION['combat_tetePerso']+=3; |
|
183 |
+ break; |
|
184 |
+ case 1: |
|
185 |
+ $localisationAlea = rand(1,5); |
|
186 |
+ switch($localisationAlea){ |
|
187 |
+ case 1: |
|
188 |
+ $_SESSION['combat_brasGPerso']+=2; |
|
189 |
+ break; |
|
190 |
+ case 2: |
|
191 |
+ $_SESSION['combat_brasDPerso']+=2; |
|
192 |
+ break; |
|
193 |
+ default: |
|
194 |
+ $_SESSION['combat_corpsPerso']+=1; |
|
195 |
+ } |
|
196 |
+ break; |
|
197 |
+ case 2: |
|
198 |
+ if(rand(1,2)==1){ |
|
199 |
+ $_SESSION['combat_jambeGPerso']+=2; |
|
200 |
+ }else{ |
|
201 |
+ $_SESSION['combat_jambeDPerso']+=2; |
|
202 |
+ } |
|
203 |
+ break; |
|
204 |
+ default: |
|
205 |
+ } |
|
206 |
+ break; |
|
207 |
+ default: |
|
208 |
+ } |
|
209 |
+ if($_SESSION['combat_jambeGPerso']>4){ |
|
210 |
+ $_SESSION['combat_jambeGPerso']=4; |
|
211 |
+ } |
|
212 |
+ if($_SESSION['combat_jambeDPerso']>4){ |
|
213 |
+ $_SESSION['combat_jambeDPerso']=4; |
|
214 |
+ } |
|
215 |
+ if($_SESSION['combat_brasGPerso']>4){ |
|
216 |
+ $_SESSION['combat_brasGPerso']=4; |
|
217 |
+ } |
|
218 |
+ if($_SESSION['combat_brasDPerso']>4){ |
|
219 |
+ $_SESSION['combat_brasDPerso']=4; |
|
220 |
+ } |
|
221 |
+ if($_SESSION['combat_tetePerso']>4){ |
|
222 |
+ $_SESSION['combat_tetePerso']=4; |
|
223 |
+ $mort=2; |
|
224 |
+ } |
|
225 |
+ if($_SESSION['combat_corpsPerso']>4){ |
|
226 |
+ $_SESSION['combat_corpsPerso']=4; |
|
227 |
+ $mort=2; |
|
228 |
+ } |
|
229 |
+ } |
|
230 |
+ //**********************************************************************************PERSONNAGE |
|
231 |
+ $coupCritiquePerso = 0; |
|
232 |
+ if(!$persoRate){ |
|
233 |
+ if(rand(1,100)>35){ |
|
234 |
+ $coupCritiquePerso = 1; |
|
235 |
+ $degatsSurEnnemi += 2; |
|
236 |
+ if(rand(1,100)>20){ |
|
237 |
+ $coupCritiquePerso = 2; |
|
238 |
+ $degatsSurEnnemi = $degatsSurEnnemi*2; |
|
239 |
+ } |
|
240 |
+ } |
|
241 |
+ switch($coupCritiquePerso){ |
|
242 |
+ case 1: |
|
243 |
+ switch($_GET['localisationDegatEnnemi']){ |
|
244 |
+ case 0: |
|
245 |
+ $_SESSION['combat_teteMonstre']++; |
|
246 |
+ break; |
|
247 |
+ case 1: |
|
248 |
+ $localisationAlea = rand(1,5); |
|
249 |
+ switch($localisationAlea){ |
|
250 |
+ case 1: |
|
251 |
+ $_SESSION['combat_brasGMonstre']++; |
|
252 |
+ break; |
|
253 |
+ case 2: |
|
254 |
+ $_SESSION['combat_brasDMonstre']++; |
|
255 |
+ break; |
|
256 |
+ default: |
|
257 |
+ $_SESSION['combat_corpsMonstre']++; |
|
258 |
+ } |
|
259 |
+ break; |
|
260 |
+ case 2: |
|
261 |
+ if(rand(1,2)==1){ |
|
262 |
+ $_SESSION['combat_jambeGMonstre']++; |
|
263 |
+ }else{ |
|
264 |
+ $_SESSION['combat_jambeDMonstre']++; |
|
265 |
+ } |
|
266 |
+ break; |
|
267 |
+ default: |
|
268 |
+ } |
|
269 |
+ break; |
|
270 |
+ case 2: |
|
271 |
+ switch($_GET['localisationDegatEnnemi']){ |
|
272 |
+ case 0: |
|
273 |
+ $_SESSION['combat_teteMonstre']+=3; |
|
274 |
+ break; |
|
275 |
+ case 1: |
|
276 |
+ $localisationAlea = rand(1,3); |
|
277 |
+ switch($localisationAlea){ |
|
278 |
+ case 1: |
|
279 |
+ $_SESSION['combat_brasGMonstre']+=2; |
|
280 |
+ break; |
|
281 |
+ case 2: |
|
282 |
+ $_SESSION['combat_brasDMonstre']+=2; |
|
283 |
+ break; |
|
284 |
+ case 3: |
|
285 |
+ $_SESSION['combat_corpsMonstre']+=1; |
|
286 |
+ break; |
|
287 |
+ default: |
|
288 |
+ } |
|
289 |
+ break; |
|
290 |
+ case 2: |
|
291 |
+ if(rand(1,2)==1){ |
|
292 |
+ $_SESSION['combat_jambeGMonstre']+=2; |
|
293 |
+ }else{ |
|
294 |
+ $_SESSION['combat_jambeDMonstre']+=2; |
|
295 |
+ } |
|
296 |
+ break; |
|
297 |
+ default: |
|
298 |
+ } |
|
299 |
+ break; |
|
300 |
+ default: |
|
301 |
+ } |
|
302 |
+ if($_SESSION['combat_jambeGMonstre']>4){ |
|
303 |
+ $_SESSION['combat_jambeGMonstre']=4; |
|
304 |
+ } |
|
305 |
+ if($_SESSION['combat_jambeDMonstre']>4){ |
|
306 |
+ $_SESSION['combat_jambeDMonstre']=4; |
|
307 |
+ } |
|
308 |
+ if($_SESSION['combat_brasGMonstre']>4){ |
|
309 |
+ $_SESSION['combat_brasGMonstre']=4; |
|
310 |
+ } |
|
311 |
+ if($_SESSION['combat_brasDMonstre']>4){ |
|
312 |
+ $_SESSION['combat_brasDMonstre']=4; |
|
313 |
+ } |
|
314 |
+ if($_SESSION['combat_teteMonstre']>4){ |
|
315 |
+ $_SESSION['combat_teteMonstre']=4; |
|
316 |
+ $mort=1; |
|
317 |
+ } |
|
318 |
+ if($_SESSION['combat_corpsMonstre']>4){ |
|
319 |
+ $_SESSION['combat_corpsMonstre']=4; |
|
320 |
+ $mort=1; |
|
321 |
+ } |
|
322 |
+ } |
|
323 |
+//**************************************************************************************************************fin des coups critiques |
|
324 |
+ if($_SESSION['initiative'] == 0){ |
|
325 |
+ //le perso tape en premier |
|
326 |
+ $_SESSION['ennemiVitAct'] -= $degatsSurEnnemi; |
|
327 |
+ if($_SESSION['ennemiVitAct']<=0){ |
|
328 |
+ $_SESSION['ennemiVitAct']=0; |
|
329 |
+ $mort=1; |
|
330 |
+ } |
|
331 |
+ //on enleve de l'energie au monstre(degats/3) |
|
332 |
+ $combien = maxCent($degatsSurEnnemi/3); |
|
333 |
+ ChangementEnergieCombat(1,$combien,0); |
|
334 |
+ if($_SESSION['ennemiFatigue']<=0){ |
|
335 |
+ $_SESSION['ennemiFatigue']=0; |
|
336 |
+ $mort=1; |
|
337 |
+ } |
|
338 |
+ //le monstre tape |
|
339 |
+ $_SESSION['VitActuelleAug'] -= $degatsSurPerso; |
|
340 |
+ if($_SESSION['VitActuelleAug']<=0){ |
|
341 |
+ $_SESSION['VitActuelleAug']=0; |
|
342 |
+ $mort=2; |
|
343 |
+ } |
|
344 |
+ $_SESSION['VitActuelle'] -= $degatsSurPerso; |
|
345 |
+ if($_SESSION['VitActuelle']<=0){ |
|
346 |
+ $_SESSION['VitActuelle']=0; |
|
347 |
+ } |
|
348 |
+ //on enleve de l'energie au perso(degats/3) |
|
349 |
+ $combien = maxCent($degatsSurEnnemi/3); |
|
350 |
+ ChangementEnergieCombat(1,$combien,1); |
|
351 |
+ if($_SESSION['FatigueActuelle']<=0){ |
|
352 |
+ $_SESSION['FatigueActuelle']=0; |
|
353 |
+ $mort=2; |
|
354 |
+ } |
|
355 |
+ }else{ |
|
356 |
+ //l'ennemi tape en premier |
|
357 |
+ $_SESSION['VitActuelleAug'] -= $degatsSurPerso; |
|
358 |
+ if($_SESSION['VitActuelleAug']<=0){ |
|
359 |
+ $_SESSION['VitActuelleAug']=0; |
|
360 |
+ $mort=2; |
|
361 |
+ } |
|
362 |
+ $_SESSION['VitActuelle'] -= $degatsSurPerso; |
|
363 |
+ if($_SESSION['VitActuelle']<=0){ |
|
364 |
+ $_SESSION['VitActuelle']=0; |
|
365 |
+ } |
|
366 |
+ //on enleve de l'energie au perso(degats/3) |
|
367 |
+ $combien = maxCent($degatsSurEnnemi/3); |
|
368 |
+ ChangementEnergieCombat(1,$combien,1); |
|
369 |
+ if($_SESSION['FatigueActuelle']<=0){ |
|
370 |
+ $_SESSION['FatigueActuelle']=0; |
|
371 |
+ $mort=2; |
|
372 |
+ } |
|
373 |
+ //le perso tape |
|
374 |
+ $_SESSION['ennemiVitAct'] -= $degatsSurEnnemi; |
|
375 |
+ if($_SESSION['ennemiVitAct']<=0){ |
|
376 |
+ $_SESSION['ennemiVitAct']=0; |
|
377 |
+ $mort=1; |
|
378 |
+ } |
|
379 |
+ //on enleve de l'energie au monstre(degats/3) |
|
380 |
+ $combien = maxCent($degatsSurEnnemi/3); |
|
381 |
+ ChangementEnergieCombat(1,$combien,0); |
|
382 |
+ if($_SESSION['ennemiFatigue']<=0){ |
|
383 |
+ $_SESSION['ennemiFatigue']=0; |
|
384 |
+ $mort=1; |
|
385 |
+ } |
|
386 |
+ } |
|
387 |
+ } |
|
388 |
+ |
|
389 |
+//variables pour savoir le pourcentage de toucher lors du combat |
|
390 |
+ $pourcentToucheTeteEnnemi = maxCent(($_SESSION['Dex']-$_SESSION['ennemiDex']) + 10 + rand(0,15)+$ajustementTouchePerso); |
|
391 |
+ $pourcentToucheCorpsEnnemi = maxCent(($_SESSION['Dex']-$_SESSION['ennemiDex']) + 45 + rand(0,15)+$ajustementTouchePerso); |
|
392 |
+ $pourcentToucheJambesEnnemi = maxCent(($_SESSION['Dex']-$_SESSION['ennemiDex']) + 25 + rand(0,15)+$ajustementTouchePerso); |
|
393 |
+ //variable d'ajustement en fonction des critiques sur les bras du perso(enleve pour viser l'ennemi) et sur les jambes du montre (ajoute pour viser l'ennemi) |
|
394 |
+ switch($_SESSION['combat_brasGPerso']){ |
|
395 |
+ case 2: |
|
396 |
+ $ajustementDegats = 7/8; |
|
397 |
+ break; |
|
398 |
+ case 3: |
|
399 |
+ $ajustementDegats = 5/6; |
|
400 |
+ break; |
|
401 |
+ case 4: |
|
402 |
+ $ajustementDegats = 3/4; |
|
403 |
+ break; |
|
404 |
+ default: |
|
405 |
+ $ajustementDegats = 1; |
|
406 |
+ } |
|
407 |
+ $pourcentToucheTeteEnnemi = $pourcentToucheTeteEnnemi*$ajustementDegats; |
|
408 |
+ $pourcentToucheCorpsEnnemi = $pourcentToucheCorpsEnnemi*$ajustementDegats; |
|
409 |
+ $pourcentToucheJambesEnnemi = $pourcentToucheJambesEnnemi*$ajustementDegats; |
|
410 |
+ switch($_SESSION['combat_brasDPerso']){ |
|
411 |
+ case 2: |
|
412 |
+ $ajustementDegats = 7/8; |
|
413 |
+ break; |
|
414 |
+ case 3: |
|
415 |
+ $ajustementDegats = 5/6; |
|
416 |
+ break; |
|
417 |
+ case 4: |
|
418 |
+ $ajustementDegats = 3/4; |
|
419 |
+ break; |
|
420 |
+ default: |
|
421 |
+ $ajustementDegats = 1; |
|
422 |
+ } |
|
423 |
+ $pourcentToucheTeteEnnemi = $pourcentToucheTeteEnnemi*$ajustementDegats; |
|
424 |
+ $pourcentToucheCorpsEnnemi = $pourcentToucheCorpsEnnemi*$ajustementDegats; |
|
425 |
+ $pourcentToucheJambesEnnemi = $pourcentToucheJambesEnnemi*$ajustementDegats; |
|
426 |
+ switch($_SESSION['combat_jambeGMonstre']){ |
|
427 |
+ case 2: |
|
428 |
+ $ajustementDegats = 5/4; |
|
429 |
+ break; |
|
430 |
+ case 3: |
|
431 |
+ $ajustementDegats = 6/4; |
|
432 |
+ break; |
|
433 |
+ case 4: |
|
434 |
+ $ajustementDegats = 7/4; |
|
435 |
+ break; |
|
436 |
+ default: |
|
437 |
+ $ajustementDegats = 1; |
|
438 |
+ } |
|
439 |
+ $pourcentToucheTeteEnnemi = $pourcentToucheTeteEnnemi*$ajustementDegats; |
|
440 |
+ $pourcentToucheCorpsEnnemi = $pourcentToucheCorpsEnnemi*$ajustementDegats; |
|
441 |
+ $pourcentToucheJambesEnnemi = $pourcentToucheJambesEnnemi*$ajustementDegats; |
|
442 |
+ switch($_SESSION['combat_jambeDMonstre']){ |
|
443 |
+ case 2: |
|
444 |
+ $ajustementDegats = 5/4; |
|
445 |
+ break; |
|
446 |
+ case 3: |
|
447 |
+ $ajustementDegats = 6/4; |
|
448 |
+ break; |
|
449 |
+ case 4: |
|
450 |
+ $ajustementDegats = 7/4; |
|
451 |
+ break; |
|
452 |
+ default: |
|
453 |
+ $ajustementDegats = 1; |
|
454 |
+ } |
|
455 |
+ $pourcentToucheTeteEnnemi = $pourcentToucheTeteEnnemi*$ajustementDegats; |
|
456 |
+ $pourcentToucheCorpsEnnemi = $pourcentToucheCorpsEnnemi*$ajustementDegats; |
|
457 |
+ $pourcentToucheJambesEnnemi = $pourcentToucheJambesEnnemi*$ajustementDegats; |
|
458 |
+ |
|
459 |
+//variable permettant de savoir ou va frapper le monstre |
|
460 |
+ $localisationDegatsPerso = rand(0,2); |
|
461 |
+ switch($localisationDegatsPerso){ |
|
462 |
+ case 0: |
|
463 |
+ $pourcentTouchePerso = maxCent(($_SESSION['ennemiDex']-$_SESSION['Dex']) + 10 + rand(0,15)-$ajustementTouchePerso); |
|
464 |
+ break; |
|
465 |
+ case 1: |
|
466 |
+ $pourcentTouchePerso = maxCent(($_SESSION['ennemiDex']-$_SESSION['Dex']) + 45 + rand(0,15)-$ajustementTouchePerso); |
|
467 |
+ break; |
|
468 |
+ case 2: |
|
469 |
+ $pourcentTouchePerso = maxCent(($_SESSION['ennemiDex']-$_SESSION['Dex']) + 25 + rand(0,15)-$ajustementTouchePerso); |
|
470 |
+ break; |
|
471 |
+ } |
|
472 |
+ //variable d'ajustement en fonction des critiques sur les jambes du perso(ajoute pour viser le perso) et sur les bras du montre (enleve pour viser le perso) |
|
473 |
+ switch($_SESSION['combat_brasGMonstre']){ |
|
474 |
+ case 2: |
|
475 |
+ $ajustementDegats = 7/8; |
|
476 |
+ break; |
|
477 |
+ case 3: |
|
478 |
+ $ajustementDegats = 5/6; |
|
479 |
+ break; |
|
480 |
+ case 4: |
|
481 |
+ $ajustementDegats = 3/4; |
|
482 |
+ break; |
|
483 |
+ default: |
|
484 |
+ $ajustementDegats = 1; |
|
485 |
+ } |
|
486 |
+ $pourcentTouchePerso = $pourcentTouchePerso*$ajustementDegats; |
|
487 |
+ switch($_SESSION['combat_brasDMonstre']){ |
|
488 |
+ case 2: |
|
489 |
+ $ajustementDegats = 7/8; |
|
490 |
+ break; |
|
491 |
+ case 3: |
|
492 |
+ $ajustementDegats = 5/6; |
|
493 |
+ break; |
|
494 |
+ case 4: |
|
495 |
+ $ajustementDegats = 3/4; |
|
496 |
+ break; |
|
497 |
+ default: |
|
498 |
+ $ajustementDegats = 1; |
|
499 |
+ } |
|
500 |
+ $pourcentTouchePerso = $pourcentTouchePerso*$ajustementDegats; |
|
501 |
+ switch($_SESSION['combat_jambeGPerso']){ |
|
502 |
+ case 2: |
|
503 |
+ $ajustementDegats = 5/4; |
|
504 |
+ break; |
|
505 |
+ case 3: |
|
506 |
+ $ajustementDegats = 6/4; |
|
507 |
+ break; |
|
508 |
+ case 4: |
|
509 |
+ $ajustementDegats = 7/4; |
|
510 |
+ break; |
|
511 |
+ default: |
|
512 |
+ $ajustementDegats = 1; |
|
513 |
+ } |
|
514 |
+ $pourcentTouchePerso = $pourcentTouchePerso*$ajustementDegats; |
|
515 |
+ switch($_SESSION['combat_jambeDPerso']){ |
|
516 |
+ case 2: |
|
517 |
+ $ajustementDegats = 5/4; |
|
518 |
+ break; |
|
519 |
+ case 3: |
|
520 |
+ $ajustementDegats = 6/4; |
|
521 |
+ break; |
|
522 |
+ case 4: |
|
523 |
+ $ajustementDegats = 7/4; |
|
524 |
+ break; |
|
525 |
+ default: |
|
526 |
+ $ajustementDegats = 1; |
|
527 |
+ } |
|
528 |
+ $pourcentTouchePerso = $pourcentTouchePerso*$ajustementDegats; |
|
529 |
+ |
|
530 |
+//script Javascript |
|
531 |
+echo "<script language='JavaScript'>" |
|
532 |
+ ."Fenetre = window.self;"; |
|
533 |
+echo "function Combatfini(){;" |
|
534 |
+ ."Fenetre.close();" |
|
535 |
+ ."}"; |
|
536 |
+echo "function FermeFenetre(){" |
|
537 |
+ ."window.opener.location.href = 'TraitementFinDeCombat2.php?mort=".$mort."';" |
|
538 |
+ ."}"; |
|
539 |
+echo "</script>"; |
|
540 |
+?> |
|
541 |
+</head> |
|
542 |
+<body bgcolor="#000000" onunload="FermeFenetre()"> |
|
543 |
+<table border="0" cellpadding="0" cellspacing="0" align="center" > |
|
544 |
+<tr> |
|
545 |
+ <td background="images/parchemin3_01.jpg" width="32" height="38"> |
|
546 |
+ </td> |
|
547 |
+ <td background="images/parchemin3_02.jpg" width="442" height="38"> |
|
548 |
+ </td> |
|
549 |
+ <td background="images/parchemin3_04.jpg" width="34" height="38"> |
|
550 |
+ </td> |
|
551 |
+</tr> |
|
552 |
+<tr> |
|
553 |
+ <td background="images/parchemin3_05.jpg" width="32" height="535"> |
|
554 |
+ </td> |
|
555 |
+ <td background="images/parchemin3_06.jpg" width="442" height="535"> |
|
556 |
+ |
|
557 |
+ <table border="0" cellspacing="0" cellpadding="0" align="center"> |
|
558 |
+ <tr> |
|
559 |
+ <td width="221"> |
|
560 |
+ <?php |
|
561 |
+ echo "<table border='0' cellspacing='0' cellpadding='0' align='center'>" |
|
562 |
+ ."<tr>" |
|
563 |
+ ."<td background='images/bordure_02.gif' width='50' height='19'>" |
|
564 |
+ ."</td>" |
|
565 |
+ ."</tr>" |
|
566 |
+ ."<tr>" |
|
567 |
+ ."<td width='50' height='50' align='center' valign='center'>" |
|
568 |
+ ."<table border='0'><tr><td>" |
|
569 |
+ //image perso |
|
570 |
+ ."<img src='images/dessins/combat/perso0.jpg'>" |
|
571 |
+ ."</td><td>" |
|
572 |
+ ."<img src='images/dessins/combat/persohumain/perso_humain.png' />" |
|
573 |
+ ."<img style='position:absolute;top:177;left:170' src='images/dessins/combat/persohumain/perso_humain_brasD".$_SESSION['combat_brasDPerso'].".png' />" |
|
574 |
+ ."<img style='position:absolute;top:177;left:170' src='images/dessins/combat/persohumain/perso_humain_brasG".$_SESSION['combat_brasGPerso'].".png' />" |
|
575 |
+ ."<img style='position:absolute;top:177;left:170' src='images/dessins/combat/persohumain/perso_humain_corps".$_SESSION['combat_corpsPerso'].".png' />" |
|
576 |
+ ."<img style='position:absolute;top:177;left:170' src='images/dessins/combat/persohumain/perso_humain_piedD".$_SESSION['combat_jambeDPerso'].".png' />" |
|
577 |
+ ."<img style='position:absolute;top:177;left:170' src='images/dessins/combat/persohumain/perso_humain_piedG".$_SESSION['combat_jambeGPerso'].".png' />" |
|
578 |
+ ."<img style='position:absolute;top:177;left:170' src='images/dessins/combat/persohumain/perso_humain_tete".$_SESSION['combat_tetePerso'].".png' />" |
|
579 |
+ ."</td></tr></table>" |
|
580 |
+ ."</td>" |
|
581 |
+ ."</tr>" |
|
582 |
+ ."<tr>" |
|
583 |
+ ."<td background='images/bordure_08.gif' width='50' height='18'>" |
|
584 |
+ ."</td>" |
|
585 |
+ ."</tr>" |
|
586 |
+ ."</table>"; |
|
587 |
+ ?> |
|
588 |
+ </td> |
|
589 |
+ <td width="221"> |
|
590 |
+ <?php |
|
591 |
+ echo "<table border='0' cellspacing='0' cellpadding='0' align='center'>" |
|
592 |
+ ."<tr>" |
|
593 |
+ ."<td background='images/bordure_02.gif' width='50' height='19'>" |
|
594 |
+ ."</td>" |
|
595 |
+ ."</tr>" |
|
596 |
+ |
|
597 |
+ ."<tr>" |
|
598 |
+ ."<td width='50' height='50' align='center' valign='center'>" |
|
599 |
+ ."<table border='0'><tr><td>" |
|
600 |
+ //image monstre |
|
601 |
+ ."<img src='images/dessins/".$_SESSION['ennemiImage'].".jpg' title='For:".$_SESSION['ennemiFor']." Int:".$_SESSION['ennemiInt']." Vit:".$_SESSION['ennemiVit']." Sag:".$_SESSION['ennemiSag']." Dex:".$_SESSION['ennemiDex']." Cha:".$_SESSION['ennemiCha']."'>" |
|
602 |
+ ."</td><td>" |
|
603 |
+ ."<img src='images/dessins/combat/persomonstre/perso_monstre.png' />" |
|
604 |
+ ."<img style='position:absolute;top:175;left:350' src='images/dessins/combat/persomonstre/perso_monstre_brasD".$_SESSION['combat_brasDMonstre'].".png' />" |
|
605 |
+ ."<img style='position:absolute;top:175;left:350' src='images/dessins/combat/persomonstre/perso_monstre_brasG".$_SESSION['combat_brasGMonstre'].".png' />" |
|
606 |
+ ."<img style='position:absolute;top:175;left:350' src='images/dessins/combat/persomonstre/perso_monstre_corps".$_SESSION['combat_corpsMonstre'].".png' />" |
|
607 |
+ ."<img style='position:absolute;top:175;left:350' src='images/dessins/combat/persomonstre/perso_monstre_piedD".$_SESSION['combat_jambeDMonstre'].".png' />" |
|
608 |
+ ."<img style='position:absolute;top:175;left:350' src='images/dessins/combat/persomonstre/perso_monstre_piedG".$_SESSION['combat_jambeGMonstre'].".png' />" |
|
609 |
+ ."<img style='position:absolute;top:175;left:350' src='images/dessins/combat/persomonstre/perso_monstre_tete".$_SESSION['combat_teteMonstre'].".png' />" |
|
610 |
+ ."</td></tr></table>" |
|
611 |
+ ."</td>" |
|
612 |
+ ."</tr>" |
|
613 |
+ ."<tr>" |
|
614 |
+ ."<td background='images/bordure_08.gif' width='50' height='18'>" |
|
615 |
+ ."</td>" |
|
616 |
+ ."</tr>" |
|
617 |
+ ."</table>"; |
|
618 |
+ ?> |
|
619 |
+ </td> |
|
620 |
+ </tr> |
|
621 |
+ <tr> |
|
622 |
+ <td width="221"> |
|
623 |
+ <?php |
|
624 |
+ echo "<center>" |
|
625 |
+ ."HP: ".$_SESSION['VitActuelleAug']." / ".$_SESSION['VitAug']."<br>"; |
|
626 |
+ AfficheImgBarre(0,$_SESSION['VitActuelleAug'],$_SESSION['VitAug']); |
|
627 |
+ echo "<br> Fatigue: ".$_SESSION['FatigueActuelle']." / ".$_SESSION['FatigueMax']."<br>"; |
|
628 |
+ AfficheImgBarre(1,$_SESSION['FatigueActuelle'],$_SESSION['FatigueMax']); |
|
629 |
+ if($_SESSION['FatigueActuelle']<$_SESSION['biereBu']){ |
|
630 |
+ echo "<p class='GainCarac'> Ivre</p>"; |
|
631 |
+ } |
|
632 |
+ echo "</center>"; |
|
633 |
+ ?> |
|
634 |
+ </td> |
|
635 |
+ <td width="221"> |
|
636 |
+ <?php |
|
637 |
+ echo "<center>" |
|
638 |
+ ."HP: ".$_SESSION['ennemiVitAct']." / ".$_SESSION['ennemiVit']."<br>"; |
|
639 |
+ AfficheImgBarre(0,$_SESSION['ennemiVitAct'],$_SESSION['ennemiVit']); |
|
640 |
+ echo "<br> Fatigue: ".$_SESSION['ennemiFatigue']." / ".$_SESSION['ennemiFatigueMax']."<br>"; |
|
641 |
+ AfficheImgBarre(1,$_SESSION['ennemiFatigue'],$_SESSION['ennemiFatigueMax']); |
|
642 |
+ echo "</center>"; |
|
643 |
+ ?> |
|
644 |
+ </td> |
|
645 |
+ </tr> |
|
646 |
+ <tr> |
|
647 |
+ <td colspan='2'> |
|
648 |
+ <?php |
|
649 |
+ if(isset($_GET['combatengage'])){ |
|
650 |
+ if(!$persoRate){ |
|
651 |
+ echo "<br>Vous avez fait <b>".$degatsSurEnnemi." de d�gats.</b>"; |
|
652 |
+ switch($coupCritiquePerso){ |
|
653 |
+ case 1: |
|
654 |
+ echo " <b>Coup grave !</b>"; |
|
655 |
+ break; |
|
656 |
+ case 2: |
|
657 |
+ echo " <b>Coup CRITIQUE !</b>"; |
|
658 |
+ break; |
|
659 |
+ default: |
|
660 |
+ } |
|
661 |
+ }else{ |
|
662 |
+ echo "<br>Vous avez <b>rat�.</b>"; |
|
663 |
+ } |
|
664 |
+ if(!$ennemiRate){ |
|
665 |
+ echo "<br>Vous avez �t� touch�: <b>".$degatsSurPerso." de d�gats.</b>"; |
|
666 |
+ switch($coupCritiqueMonstre){ |
|
667 |
+ case 1: |
|
668 |
+ echo " <b>Coup grave !</b>"; |
|
669 |
+ break; |
|
670 |
+ case 2: |
|
671 |
+ echo " <b>Coup CRITIQUE !</b>"; |
|
672 |
+ break; |
|
673 |
+ default: |
|
674 |
+ } |
|
675 |
+ }else{ |
|
676 |
+ echo "<br>Vous avez <B>esquiv�.</b>"; |
|
677 |
+ } |
|
678 |
+ }else{ |
|
679 |
+ echo"<br><br>"; |
|
680 |
+ } |
|
681 |
+ if($mort != 0){ |
|
682 |
+ echo "<br><br><br><br><a href=javascript:Combatfini()>[Achever le combat]</a>"; |
|
683 |
+ }else{ |
|
684 |
+ echo "<br><a href=ennemi2.php?combatengage=1&localisationDegatEnnemi=0&pourcentToucheEnnemi=".$pourcentToucheTeteEnnemi."&localisationDegatsPerso=".$localisationDegatsPerso."&pourcentTouchePerso=".$pourcentTouchePerso.">Frapper la t�te ( ".$pourcentToucheTeteEnnemi."% )</a>"; |
|
685 |
+ echo "<br><a href=ennemi2.php?combatengage=1&localisationDegatEnnemi=1&pourcentToucheEnnemi=".$pourcentToucheCorpsEnnemi."&localisationDegatsPerso=".$localisationDegatsPerso."&pourcentTouchePerso=".$pourcentTouchePerso.">Frapper le corps ( ".$pourcentToucheCorpsEnnemi."% )</a>"; |
|
686 |
+ echo "<br><a href=ennemi2.php?combatengage=1&localisationDegatEnnemi=2&pourcentToucheEnnemi=".$pourcentToucheJambesEnnemi."&localisationDegatsPerso=".$localisationDegatsPerso."&pourcentTouchePerso=".$pourcentTouchePerso.">Frapper les jambes/pattes ( ".$pourcentToucheJambesEnnemi."% )</a>"; |
|
687 |
+ } |
|
688 |
+ ?> |
|
689 |
+ </td> |
|
690 |
+ </tr> |
|
691 |
+ </table> |
|
692 |
+ |
|
693 |
+ </td> |
|
694 |
+ <td background="images/parchemin3_08.jpg" width="34" height ="535"> |
|
695 |
+ </td> |
|
696 |
+</tr> |
|
697 |
+<tr> |
|
698 |
+ <td background="images/parchemin3_10.jpg" width="32" height="45"> |
|
699 |
+ </td> |
|
700 |
+ <td background="images/parchemin3_11.jpg" width="442" height="45"> |
|
701 |
+ </td> |
|
702 |
+ <td background="images/parchemin3_13.jpg" width="34" height="45"> |
|
703 |
+ </td> |
|
704 |
+</tr> |
|
705 |
+<tr> |
|
706 |
+ <td background="images/parchemin3_14.jpg" width="32" height="150"> |
|
707 |
+ </td> |
|
708 |
+ <td background="images/parchemin3_15.jpg" width="442" height="150"> |
|
709 |
+ </td> |
|
710 |
+ <td background="images/parchemin3_17.jpg" width="33" height="150"> |
|
711 |
+ </td> |
|
712 |
+</tr> |
|
713 |
+ |
|
714 |
+</table> |
|
715 |
+</body> |
|
716 |
+</html> |
|
717 |
+<?php |
|
718 |
+ mysql_close(); |
|
719 |
+?> |