Browse code

Version initiale du programme sous forme de boucle conditionnelle

Emmanuel ROY authored on 01/05/2022 12:54:29
Showing 1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,484 @@
1
+<?php
2
+
3
+define('DEBUG', FALSE);
4
+//a faire en fonction de la variable DEBUG, avec ou sans message d'erreurs de la BDD
5
+define('BD_ADRESSE', 'localhost');
6
+define('BD_USER', 'root');
7
+define('BD_PASS', 'h0I&Z3Ld4');
8
+define('BD_NOM', 'villededragons');
9
+
10
+function connectionBDD(){
11
+	$bdd =	@mysql_connect(BD_ADRESSE,BD_USER,BD_PASS) or exit('erreur de connection...');
12
+			@mysql_select_db(BD_NOM)or exit('pb de Base de donn�es...');
13
+}
14
+
15
+function check_id($login,$pass){
16
+	connectionBDD();
17
+	$login = addslashes($login);
18
+	$pass = addslashes($pass);
19
+
20
+	$resultat = mysql_query("SELECT id_login FROM login WHERE login = '".$login."' AND password = '".$pass."'")or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
21
+	if(mysql_num_rows($resultat) == 0){
22
+		$usr_id=-1;
23
+	}else{
24
+		$tableauReponse = mysql_fetch_assoc($resultat);
25
+		$usr_id = $tableauReponse['id_login'];
26
+	}
27
+	mysql_close();
28
+	return $usr_id;
29
+}
30
+
31
+function creation_id($login,$pass){
32
+	connectionBDD();
33
+	$login = addslashes($login);
34
+	$pass = addslashes($pass);
35
+	$date = date("Y-m-d");
36
+
37
+	mysql_query("INSERT	INTO login(login,password,Date_creation) VALUES('".$login."','".$pass."','".$date."')")or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
38
+	mysql_close();
39
+}
40
+
41
+function creationSorcier(){}
42
+
43
+
44
+function existe_Log($login){
45
+	connectionBDD();
46
+	$login = addslashes($login);
47
+	$resultat = mysql_query("SELECT id_login FROM login WHERE login = '".$login."'")or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
48
+	if(mysql_num_rows($resultat) == 0){
49
+		$existe = false;
50
+	}else{
51
+		$existe = true;
52
+	}
53
+	mysql_close();
54
+	return $existe;
55
+
56
+}
57
+
58
+function check_session(){
59
+	if(!session_is_registered("user_id")){
60
+		header("location: index.php");
61
+	}
62
+}
63
+
64
+function check_ChaineDeCaracteres($chaine){
65
+	set_magic_quotes_runtime(0);
66
+	//1er caractere en majuscule
67
+	$chaineMaj = ucfirst($chaine);
68
+	//verificatitions des balises HTML
69
+	$pos = strpos($chaineMaj,'<');
70
+	if($pos !== FALSE){
71
+		return(0);
72
+	}else{
73
+		//test sur la configuration du serveur pour l'utilisation de l'echappement avec les antiSlash
74
+		if (get_magic_quotes_gpc() == 1){
75
+			return $chaine;
76
+		}else{
77
+			$chaineBonneGuillemets = addslashes($chaine);
78
+			return ($chaineBonneGuillemets);
79
+		}
80
+	}
81
+}
82
+
83
+function HTML_ChaineDeCaracteres($chaine){
84
+	return (htmlspecialchars($chaine,ENT_QUOTES));
85
+}
86
+
87
+/****************************************************************************************************************/
88
+/**************************************  FONCTIONS PROPRES AU JEU  **********************************************/
89
+/****************************************************************************************************************/
90
+function ChangementEnergie($nb,$retrait){
91
+	if($retrait == 0){
92
+		$_SESSION['FatigueActuelle'] += $nb;
93
+		if($_SESSION['FatigueActuelle']>$_SESSION['FatigueMax']){
94
+			$_SESSION['FatigueActuelle']=$_SESSION['FatigueMax'];
95
+		}
96
+	}else{
97
+		$_SESSION['FatigueActuelle'] -= $nb;
98
+		if($_SESSION['FatigueActuelle']<0){
99
+			$_SESSION['FatigueActuelle']=0;
100
+		header("location: fatigue.php");
101
+		}
102
+	}
103
+}
104
+function ChangementVie($nb,$retrait){
105
+	if($retrait == 0){
106
+		$_SESSION['VitActuelleAug'] += $nb;
107
+		$_SESSION['VitActuelle'] += $nb;
108
+		if($_SESSION['VitActuelleAug']>$_SESSION['VitAug']){
109
+			$_SESSION['VitActuelleAug']=$_SESSION['VitAug'];
110
+		}
111
+		if($_SESSION['VitActuelle']>$_SESSION['Vit']){
112
+			$_SESSION['VitActuelle']=$_SESSION['Vit'];
113
+		}
114
+	}else{
115
+		$_SESSION['VitActuelleAug'] -= $nb;
116
+		$_SESSION['VitActuelle'] -= $nb;
117
+		if($_SESSION['VitActuelle']<0){
118
+			$_SESSION['VitActuelle']=0;
119
+		}
120
+		if($_SESSION['VitActuelleAug']<0){
121
+			$_SESSION['VitActuelleAug']=0;
122
+		header("location: mort.php");
123
+		}
124
+	}
125
+}
126
+function ChangementEnergieCombat($nb,$retrait,$lequel){
127
+if($lequel==0){
128
+	//on enleve de l'energie a l'ennemi
129
+	if($retrait == 0){
130
+		$_SESSION['ennemiFatigue'] += $nb;
131
+		if($_SESSION['ennemiFatigue']>$_SESSION['ennemiFatigueMax']){
132
+			$_SESSION['ennemiFatigue']=$_SESSION['ennemiFatigueMax'];
133
+		}
134
+	}else{
135
+		$_SESSION['ennemiFatigue'] -= $nb;
136
+		if($_SESSION['ennemiFatigue']<0){
137
+			$_SESSION['ennemiFatigue']=0;
138
+		}
139
+	}
140
+}else{
141
+	//on enleve de l'energie au perso
142
+	if($retrait == 0){
143
+		$_SESSION['FatigueActuelle'] += $nb;
144
+		if($_SESSION['FatigueActuelle']>$_SESSION['FatigueMax']){
145
+			$_SESSION['FatigueActuelle']=$_SESSION['FatigueMax'];
146
+		}
147
+	}else{
148
+		$_SESSION['FatigueActuelle'] -= $nb;
149
+		if($_SESSION['FatigueActuelle']<0){
150
+			$_SESSION['FatigueActuelle']=0;
151
+		}
152
+	}
153
+}
154
+}
155
+function ChangementPoids($AlimentTresNutritif){
156
+	if($AlimentTresNutritif == 0){
157
+	$_SESSION['Poids']++;
158
+	}elseif($AlimentTresNutritif == 1){
159
+	$_SESSION['Poids']--;
160
+	}
161
+	if($_SESSION['Poids']>5){
162
+		$_SESSION['Poids']=5;
163
+	}else if($_SESSION['Poids']<1){
164
+		$_SESSION['Poids']=1;
165
+	}
166
+}
167
+function ChangementOr($combien,$retrait){
168
+	if($retrait==0){
169
+	$_SESSION['Or'] += $combien;
170
+	}else{
171
+	$_SESSION['Or'] -= $combien;
172
+	}
173
+}
174
+function ChangementVariableHistoire($laquelle,$valeur){
175
+	mysql_query("UPDATE histoire SET ".$laquelle."='".$valeur."' WHERE id = '".$_SESSION['id']."'")or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
176
+}
177
+
178
+function ChangementHeureJournee(){
179
+	//raz des encas qui font changer de journee
180
+	$_SESSION['enCas'] = 1;
181
+	//augmentation du compteur de l'heure de la journ�e
182
+	$_SESSION['repas']++;
183
+		//test pour savoir si on change de journ�e
184
+		if($_SESSION['repas']>3){
185
+			$_SESSION['repas']=0;
186
+			$_SESSION['Age']++;
187
+			$_SESSION['couple']=0;
188
+		}
189
+}
190
+
191
+function SauvegardeHistoire(){
192
+	$chaine = check_ChaineDeCaracteres($_SESSION['passeHeroique']);
193
+	$req = 'UPDATE sorcier SET passeHeroiqueSorcier = "'.$chaine.'" WHERE id = "'.$_SESSION["id"].'"';
194
+	mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
195
+}
196
+
197
+function Sauvegarde($endroit){
198
+	//remise a zero des compteurs encas et boissons
199
+	$_SESSION['biereBu'] = 0;
200
+	if($endroit==1){
201
+		//ca ne marche que pour le moment ou l'on dort dans la taverne...
202
+		ChangementHeureJournee();
203
+	}
204
+	CalculAugmentationCarac();
205
+	//insertion des nouvelles caracteristiques
206
+	$req = "UPDATE sorcier SET Niveau = '".$_SESSION['Niveau']."' ,"
207
+			."Intelligence = '".$_SESSION['Int']."' ,"
208
+			."Vitalite = '".$_SESSION['Vit']."' ,"
209
+			."Forc = '".$_SESSION['For']."' ,"
210
+			."Charisme = '".$_SESSION['Cha']."' ,"
211
+			."Dexterite = '".$_SESSION['Dex']."' ,"
212
+			."Sagesse = '".$_SESSION['Sag']."' ,"
213
+			."VitActuelle = '".$_SESSION['VitActuelle']."' ,"
214
+			."FatigueMax = '".$_SESSION['FatigueMax']."' ,"
215
+			."FatigueActuelle = '".$_SESSION['FatigueActuelle']."' ,"
216
+			."PiecesOr = '".$_SESSION['Or']."' ,"
217
+			."Poids = '".$_SESSION['Poids']."' ,"
218
+			."Age = '".$_SESSION['Age']."' ,"
219
+			."Dieu = '".$_SESSION['Dieu']."' ,"
220
+			."Heure= '".$_SESSION['repas']."' ,"
221
+			."N_pomme = '".$_SESSION['N_pomme']."' ,"
222
+			."N_viandeSeche = '".$_SESSION['N_viandeSeche']."' ,"
223
+			."N_orange = '".$_SESSION['N_orange']."' ,"
224
+			."N_pain = '".$_SESSION['N_pain']."' ,"
225
+			."N_chocolat = '".$_SESSION['N_chocolat']."' ,"
226
+			."N_lait = '".$_SESSION['N_lait']."' ,"
227
+			."experience = '".$_SESSION['xp']."' ,"
228
+			."experienceMax = '".$_SESSION['xpMax']."'"
229
+			." WHERE id = '".$_SESSION['id']."'";
230
+	CalculCaractAugmentee(TRUE);
231
+	//insertion des nouvelles valeurs de l'histoire
232
+	$req2 = "UPDATE histoire SET taverne= '".$_SESSION['taverne']."' ,"
233
+			."taverneRumeur= '".$_SESSION['taverneRumeur']."',"
234
+			."taverneRat= '".$_SESSION['taverneRat']."' ,"
235
+			."arrivee= '".$_SESSION['arrivee']."' ,"
236
+			."erudit= '".$_SESSION['erudit']."' ,"
237
+			."pretre= '".$_SESSION['pretre']."' ,"
238
+			."egliseRumeur= '".$_SESSION['egliseRumeur']."' ,"
239
+			."egliseZombis= '".$_SESSION['egliseZombis']."' ,"
240
+			."joueurs= '".$_SESSION['joueurs']."' ,"
241
+			."nains= '".$_SESSION['nains']."' ,"
242
+			."nainsHumeur= '".$_SESSION['nainsHumeur']."' ,"
243
+			."nudite= '".$_SESSION['nudite']."' ,"
244
+			."couple= '".$_SESSION['couple']."' ,"
245
+			."bagueMaisonCouple= '".$_SESSION['bagueMaisonCouple']."' ,"
246
+			."tavernier= '".$_SESSION['tavernier']."' ,"
247
+			."forgeron= '".$_SESSION['forgeron']."' ,"
248
+			."Sauvegarde= '".$endroit."'"
249
+			." WHERE id = '".$_SESSION['id']."'";
250
+	//insertion des nouveaux ou anciens objets
251
+	$req3 = "UPDATE sac SET id_objets1 = '".$_SESSION['objets1']."' ,"
252
+			."id_objets2 = '".$_SESSION['objets2']."' ,"
253
+			."id_objets3 = '".$_SESSION['objets3']."' ,"
254
+			."id_objets4 = '".$_SESSION['objets4']."'"
255
+			."WHERE id_sorcier = '".$_SESSION['id']."'";
256
+	//insertion des nouveaux ou anciens equipement
257
+	$req4 = "UPDATE equipement SET id_tete = '".$_SESSION['tete']."' ,"
258
+			."id_mainGauche = '".$_SESSION['mainGauche']."' ,"
259
+			."id_mainDroite = '".$_SESSION['mainDroite']."' ,"
260
+			."id_corps = '".$_SESSION['corps']."' ,"
261
+			."id_mains = '".$_SESSION['mains']."' ,"
262
+			."id_jambes = '".$_SESSION['jambes']."' ,"
263
+			."id_pieds = '".$_SESSION['pieds']."' ,"
264
+			."id_doigt1 = '".$_SESSION['doigt1']."' ,"
265
+			."id_doigt2 = '".$_SESSION['doigt2']."' ,"
266
+			."Sac = '".$_SESSION['sac']."'"
267
+			."WHERE id_sorcier = '".$_SESSION['id']."'";
268
+
269
+	mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
270
+	mysql_query($req2)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
271
+	mysql_query($req3)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
272
+	mysql_query($req4)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
273
+
274
+}
275
+function AfficheBarreDEtat($pageactuelle){
276
+	echo "<table border='0' cellspacing='0' cellpadding='0' align='center'>"
277
+		."<tr>"
278
+		."<td align='center' width= '225'><B>POINTS DE VIE: </B>".$_SESSION['VitActuelleAug']."/".$_SESSION['VitAug']." ";
279
+	AfficheImgBarre(0,$_SESSION['VitActuelleAug'],$_SESSION['VitAug']);
280
+	echo "</td>"
281
+		."<td align='center' width= '225'><B>FATIGUE: </B>".$_SESSION['FatigueActuelle']."/".$_SESSION['FatigueMax']." ";
282
+	AfficheImgBarre(1,$_SESSION['FatigueActuelle'],$_SESSION['FatigueMax']);
283
+	echo "</td>"
284
+		."<td align='center' width='225'><B>OR: </B>".$_SESSION['Or']." pi�ces.<BR>";
285
+		if($pageactuelle==0){
286
+		echo "<A href=FicheDEtat.php>Fiche De ".$_SESSION['Prenom']."</a>";
287
+		}
288
+	echo "</td>"
289
+		."</tr>"
290
+		."</table>";
291
+}
292
+function AfficheImgBarre($QuelleBarre,$Actuel,$Max){
293
+	switch($QuelleBarre){
294
+		case 0:
295
+		$image="images/barreHP.gif";
296
+		break;
297
+		case 1:
298
+		$image="images/barreFatigue.gif";
299
+		break;
300
+		case 2:
301
+		$image="images/barreXp.gif";
302
+		break;
303
+	}
304
+	echo "<table border='0' cellspacing='0' cellpadding='0' align='center'>"
305
+		."<tr>";
306
+	$nbVie= round((100*$Actuel)/$Max)*2;
307
+			echo "<td>"
308
+				."<img src=".$image."  width='".$nbVie."px' height='9px'>"
309
+				."</td>";
310
+	$nbMort= (200-$nbVie);
311
+			echo "<td>"
312
+				."<img src=images/barre.gif width='".$nbMort."px' height='9px'>"
313
+				."</td>";
314
+	echo "</tr>"
315
+		."</table>";
316
+}
317
+function typeAliment($nbAliment){
318
+	switch($nbAliment){
319
+	case 1:
320
+		return("fruit");
321
+	break;
322
+	case 2:
323
+		return("prot�ine");
324
+	break;
325
+	case 3:
326
+		return("agrume");
327
+	break;
328
+	case 4:
329
+		return("feculent");
330
+	break;
331
+	case 5:
332
+		return("gourmandise");
333
+	break;
334
+	case 6:
335
+		return("laitage");
336
+	break;
337
+	}
338
+
339
+}
340
+function CalculAugmentationCarac(){
341
+				//mise a zero des augmentation de caracteristiques
342
+	$_SESSION['Aug_Int'] = 0;
343
+	$_SESSION['Aug_For'] = 0;
344
+	$_SESSION['Aug_Vit'] = 0;
345
+	$_SESSION['Aug_Cha'] = 0;
346
+	$_SESSION['Aug_Dex'] = 0;
347
+	$_SESSION['Aug_Sag'] = 0;
348
+		//ajout des augmentation des caracteristiques
349
+			//sur le corps
350
+	$req = "SELECT aug_Int,aug_For,aug_Vit,aug_Cha,aug_Dex,aug_Sag FROM corps WHERE id_corps='".$_SESSION['corps']."'";
351
+	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
352
+
353
+	$tableauReponse=mysql_fetch_assoc($resultat);
354
+	$_SESSION['Aug_Int'] += $tableauReponse['aug_Int'];
355
+	$_SESSION['Aug_For'] += $tableauReponse['aug_For'];
356
+	$_SESSION['Aug_Vit'] += $tableauReponse['aug_Vit'];
357
+	$_SESSION['Aug_Cha'] += $tableauReponse['aug_Cha'];
358
+	$_SESSION['Aug_Dex'] += $tableauReponse['aug_Dex'];
359
+	$_SESSION['Aug_Sag'] += $tableauReponse['aug_Sag'];
360
+			//sur les doigts de la main gauche
361
+	$req = "SELECT aug_Int,aug_For,aug_Vit,aug_Cha,aug_Dex,aug_Sag FROM doigt WHERE id_doigt='".$_SESSION['doigt1']."'";
362
+	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
363
+
364
+	$tableauReponse=mysql_fetch_assoc($resultat);
365
+	$_SESSION['Aug_Int'] += $tableauReponse['aug_Int'];
366
+	$_SESSION['Aug_For'] += $tableauReponse['aug_For'];
367
+	$_SESSION['Aug_Vit'] += $tableauReponse['aug_Vit'];
368
+	$_SESSION['Aug_Cha'] += $tableauReponse['aug_Cha'];
369
+	$_SESSION['Aug_Dex'] += $tableauReponse['aug_Dex'];
370
+	$_SESSION['Aug_Sag'] += $tableauReponse['aug_Sag'];
371
+			//sur les doigts de la main droite
372
+	$req = "SELECT aug_Int,aug_For,aug_Vit,aug_Cha,aug_Dex,aug_Sag FROM doigt WHERE id_doigt='".$_SESSION['doigt2']."'";
373
+	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
374
+
375
+	$tableauReponse=mysql_fetch_assoc($resultat);
376
+	$_SESSION['Aug_Int'] += $tableauReponse['aug_Int'];
377
+	$_SESSION['Aug_For'] += $tableauReponse['aug_For'];
378
+	$_SESSION['Aug_Vit'] += $tableauReponse['aug_Vit'];
379
+	$_SESSION['Aug_Cha'] += $tableauReponse['aug_Cha'];
380
+	$_SESSION['Aug_Dex'] += $tableauReponse['aug_Dex'];
381
+	$_SESSION['Aug_Sag'] += $tableauReponse['aug_Sag'];
382
+			//sur les jambes
383
+	$req = "SELECT aug_Int,aug_For,aug_Vit,aug_Cha,aug_Dex,aug_Sag FROM jambes WHERE id_jambes='".$_SESSION['jambes']."'";
384
+	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
385
+
386
+	$tableauReponse=mysql_fetch_assoc($resultat);
387
+	$_SESSION['Aug_Int'] += $tableauReponse['aug_Int'];
388
+	$_SESSION['Aug_For'] += $tableauReponse['aug_For'];
389
+	$_SESSION['Aug_Vit'] += $tableauReponse['aug_Vit'];
390
+	$_SESSION['Aug_Cha'] += $tableauReponse['aug_Cha'];
391
+	$_SESSION['Aug_Dex'] += $tableauReponse['aug_Dex'];
392
+	$_SESSION['Aug_Sag'] += $tableauReponse['aug_Sag'];
393
+			//sur la main Droite
394
+	$req = "SELECT aug_Int,aug_For,aug_Vit,aug_Cha,aug_Dex,aug_Sag FROM maindroite WHERE id_maindroite='".$_SESSION['mainDroite']."'";
395
+	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
396
+
397
+	$tableauReponse=mysql_fetch_assoc($resultat);
398
+	$_SESSION['Aug_Int'] += $tableauReponse['aug_Int'];
399
+	$_SESSION['Aug_For'] += $tableauReponse['aug_For'];
400
+	$_SESSION['Aug_Vit'] += $tableauReponse['aug_Vit'];
401
+	$_SESSION['Aug_Cha'] += $tableauReponse['aug_Cha'];
402
+	$_SESSION['Aug_Dex'] += $tableauReponse['aug_Dex'];
403
+	$_SESSION['Aug_Sag'] += $tableauReponse['aug_Sag'];
404
+			//sur la main gauche
405
+	$req = "SELECT aug_Int,aug_For,aug_Vit,aug_Cha,aug_Dex,aug_Sag FROM maingauche WHERE id_maingauche='".$_SESSION['mainGauche']."'";
406
+	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
407
+
408
+	$tableauReponse=mysql_fetch_assoc($resultat);
409
+	$_SESSION['Aug_Int'] += $tableauReponse['aug_Int'];
410
+	$_SESSION['Aug_For'] += $tableauReponse['aug_For'];
411
+	$_SESSION['Aug_Vit'] += $tableauReponse['aug_Vit'];
412
+	$_SESSION['Aug_Cha'] += $tableauReponse['aug_Cha'];
413
+	$_SESSION['Aug_Dex'] += $tableauReponse['aug_Dex'];
414
+	$_SESSION['Aug_Sag'] += $tableauReponse['aug_Sag'];
415
+		//sur les mains
416
+	$req = "SELECT aug_Int,aug_For,aug_Vit,aug_Cha,aug_Dex,aug_Sag FROM mains WHERE id_mains='".$_SESSION['mains']."'";
417
+	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
418
+
419
+	$tableauReponse=mysql_fetch_assoc($resultat);
420
+	$_SESSION['Aug_Int'] += $tableauReponse['aug_Int'];
421
+	$_SESSION['Aug_For'] += $tableauReponse['aug_For'];
422
+	$_SESSION['Aug_Vit'] += $tableauReponse['aug_Vit'];
423
+	$_SESSION['Aug_Cha'] += $tableauReponse['aug_Cha'];
424
+	$_SESSION['Aug_Dex'] += $tableauReponse['aug_Dex'];
425
+	$_SESSION['Aug_Sag'] += $tableauReponse['aug_Sag'];
426
+			//sur les pieds
427
+	$req = "SELECT aug_Int,aug_For,aug_Vit,aug_Cha,aug_Dex,aug_Sag FROM pieds WHERE id_pieds='".$_SESSION['pieds']."'";
428
+	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
429
+
430
+	$tableauReponse=mysql_fetch_assoc($resultat);
431
+	$_SESSION['Aug_Int'] += $tableauReponse['aug_Int'];
432
+	$_SESSION['Aug_For'] += $tableauReponse['aug_For'];
433
+	$_SESSION['Aug_Vit'] += $tableauReponse['aug_Vit'];
434
+	$_SESSION['Aug_Cha'] += $tableauReponse['aug_Cha'];
435
+	$_SESSION['Aug_Dex'] += $tableauReponse['aug_Dex'];
436
+	$_SESSION['Aug_Sag'] += $tableauReponse['aug_Sag'];
437
+			//sur la tete
438
+	$req = "SELECT aug_Int,aug_For,aug_Vit,aug_Cha,aug_Dex,aug_Sag FROM tete WHERE id_tete='".$_SESSION['tete']."'";
439
+	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
440
+
441
+	$tableauReponse=mysql_fetch_assoc($resultat);
442
+	$_SESSION['Aug_Int'] += $tableauReponse['aug_Int'];
443
+	$_SESSION['Aug_For'] += $tableauReponse['aug_For'];
444
+	$_SESSION['Aug_Vit'] += $tableauReponse['aug_Vit'];
445
+	$_SESSION['Aug_Cha'] += $tableauReponse['aug_Cha'];
446
+	$_SESSION['Aug_Dex'] += $tableauReponse['aug_Dex'];
447
+	$_SESSION['Aug_Sag'] += $tableauReponse['aug_Sag'];
448
+
449
+}
450
+function CalculCaractAugmentee($var){
451
+	$_SESSION['IntAug'] = $_SESSION['Aug_Int'] + $_SESSION['Int'];
452
+	$_SESSION['VitAug'] = $_SESSION['Aug_Vit'] + $_SESSION['Vit'];
453
+	$_SESSION['ForAug'] = $_SESSION['Aug_For'] + $_SESSION['For'];
454
+	$_SESSION['SagAug'] = $_SESSION['Aug_Sag'] + $_SESSION['Sag'];
455
+	$_SESSION['ChaAug'] = $_SESSION['Aug_Cha'] + $_SESSION['Cha'];
456
+	$_SESSION['DexAug'] = $_SESSION['Aug_Dex'] + $_SESSION['Dex'];
457
+	if($var == TRUE){
458
+		$_SESSION['VitActuelleAug'] = $_SESSION['Aug_Vit'] + $_SESSION['VitActuelle'];
459
+	}
460
+}
461
+function maxCent($variable){
462
+	if ($variable> 100){
463
+		return(100);
464
+	}else if($variable<1){
465
+		return(1);
466
+	}else{
467
+		return($variable);
468
+	}
469
+}
470
+function recuperationNomObjetLaisser($id){
471
+	$req = "SELECT nom FROM objets WHERE id_objets='".$id."'";
472
+	$sql = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
473
+	$data = mysql_fetch_row($sql);
474
+	return $data[0];
475
+}
476
+
477
+function ChangementTexteSexe($homme,$femme){
478
+	if($_SESSION['Sexe']==1){
479
+		return $homme;
480
+	}else{
481
+		return $femme;
482
+	}
483
+}
484
+?>