1 | 1 |
new file mode 100755 |
... | ... |
@@ -0,0 +1,160 @@ |
1 |
+<?php |
|
2 |
+session_start(); |
|
3 |
+include('fonctions.php'); |
|
4 |
+connectionBDD(); |
|
5 |
+$obj = 'objets'.$_GET['ObjetNum']; |
|
6 |
+$_SESSION[$obj]=0; |
|
7 |
+ //Pour une partie de la journ�e (petitmatin,matin�e,apresmidi,soir�e) 3 encas sont possible avant de changer l'heure... |
|
8 |
+ $_SESSION['enCas']++; |
|
9 |
+ if($_SESSION['enCas']>3){ |
|
10 |
+ ChangementHeureJournee(); |
|
11 |
+ } |
|
12 |
+ //augmentation des caracteristiques |
|
13 |
+ $_SESSION['Aug_Int'] += $_GET['augInt']; |
|
14 |
+ $_SESSION['Aug_For'] += $_GET['augFor']; |
|
15 |
+ $_SESSION['Aug_Vit'] += $_GET['augVit']; |
|
16 |
+ $_SESSION['Aug_Cha'] += $_GET['augCha']; |
|
17 |
+ $_SESSION['Aug_Dex'] += $_GET['augDex']; |
|
18 |
+ $_SESSION['Aug_Sag'] += $_GET['augSag']; |
|
19 |
+ CalculCaractAugmentee(FALSE); |
|
20 |
+ //changement des pr�f�rences |
|
21 |
+ switch($_GET['typeObjet']){ |
|
22 |
+ case 1: |
|
23 |
+ $_SESSION['VitActuelleAug']+=($_SESSION['N_pomme']/2); |
|
24 |
+ $_SESSION['VitActuelle']+=($_SESSION['N_pomme']/2); |
|
25 |
+ $_SESSION['FatigueActuelle']+=$_SESSION['N_pomme']; |
|
26 |
+ |
|
27 |
+ $_SESSION['N_pomme'] += 10; |
|
28 |
+ $_SESSION['N_viandeSeche'] -= 8; |
|
29 |
+ $_SESSION['N_orange'] += 5; |
|
30 |
+ $_SESSION['N_pain'] -= 4; |
|
31 |
+ $_SESSION['N_chocolat'] += 2; |
|
32 |
+ $_SESSION['N_lait'] -= 2; |
|
33 |
+ |
|
34 |
+ break; |
|
35 |
+ case 2: |
|
36 |
+ $_SESSION['VitActuelleAug']+=($_SESSION['N_viandeSeche']/2); |
|
37 |
+ $_SESSION['VitActuelle']+=($_SESSION['N_viandeSeche']/2); |
|
38 |
+ $_SESSION['FatigueActuelle']+=$_SESSION['N_viandeSeche']; |
|
39 |
+ |
|
40 |
+ $_SESSION['N_pomme'] -= 8; |
|
41 |
+ $_SESSION['N_viandeSeche'] += 10; |
|
42 |
+ $_SESSION['N_orange'] -= 4; |
|
43 |
+ $_SESSION['N_pain'] += 5; |
|
44 |
+ $_SESSION['N_chocolat'] -= 2; |
|
45 |
+ $_SESSION['N_lait'] += 2; |
|
46 |
+ |
|
47 |
+ break; |
|
48 |
+ case 3: |
|
49 |
+ $_SESSION['VitActuelleAug']+=($_SESSION['N_orange']/2); |
|
50 |
+ $_SESSION['VitActuelle']+=($_SESSION['N_orange']/2); |
|
51 |
+ $_SESSION['FatigueActuelle']+=$_SESSION['N_orange']; |
|
52 |
+ |
|
53 |
+ $_SESSION['N_pomme'] += 2; |
|
54 |
+ $_SESSION['N_viandeSeche'] -= 4; |
|
55 |
+ $_SESSION['N_orange'] += 10; |
|
56 |
+ $_SESSION['N_pain'] -= 2; |
|
57 |
+ $_SESSION['N_chocolat'] += 5; |
|
58 |
+ $_SESSION['N_lait'] -= 8; |
|
59 |
+ |
|
60 |
+ break; |
|
61 |
+ case 4: |
|
62 |
+ $_SESSION['VitActuelleAug']+=($_SESSION['N_pain']/2); |
|
63 |
+ $_SESSION['VitActuelle']+=($_SESSION['N_pain']/2); |
|
64 |
+ $_SESSION['FatigueActuelle']+=$_SESSION['N_pain']; |
|
65 |
+ |
|
66 |
+ $_SESSION['N_pomme'] -= 8; |
|
67 |
+ $_SESSION['N_viandeSeche'] -= 2; |
|
68 |
+ $_SESSION['N_orange'] -= 4; |
|
69 |
+ $_SESSION['N_pain'] += 10; |
|
70 |
+ $_SESSION['N_chocolat'] += 2; |
|
71 |
+ $_SESSION['N_lait'] += 5; |
|
72 |
+ |
|
73 |
+ break; |
|
74 |
+ case 5: |
|
75 |
+ $_SESSION['VitActuelleAug']+=($_SESSION['N_chocolat']/2); |
|
76 |
+ $_SESSION['VitActuelle']+=($_SESSION['N_chocolat']/2); |
|
77 |
+ $_SESSION['FatigueActuelle']+=$_SESSION['N_chocolat']; |
|
78 |
+ |
|
79 |
+ $_SESSION['N_pomme'] -= 2; |
|
80 |
+ $_SESSION['N_viandeSeche'] -= 8; |
|
81 |
+ $_SESSION['N_orange'] -= 4; |
|
82 |
+ $_SESSION['N_pain'] += 5; |
|
83 |
+ $_SESSION['N_chocolat'] += 10; |
|
84 |
+ $_SESSION['N_lait'] += 2; |
|
85 |
+ |
|
86 |
+ break; |
|
87 |
+ case 6: |
|
88 |
+ $_SESSION['VitActuelleAug']+=($_SESSION['N_lait']/2); |
|
89 |
+ $_SESSION['VitActuelle']+=($_SESSION['N_lait']/2); |
|
90 |
+ $_SESSION['FatigueActuelle']+=$_SESSION['N_lait']; |
|
91 |
+ |
|
92 |
+ $_SESSION['N_pomme'] += 5; |
|
93 |
+ $_SESSION['N_viandeSeche'] += 2; |
|
94 |
+ $_SESSION['N_orange'] -= 2; |
|
95 |
+ $_SESSION['N_pain'] -= 4; |
|
96 |
+ $_SESSION['N_chocolat'] -= 8; |
|
97 |
+ $_SESSION['N_lait'] += 10; |
|
98 |
+ |
|
99 |
+ break; |
|
100 |
+ default: |
|
101 |
+ } |
|
102 |
+ //coh�rence des pr�f�rences |
|
103 |
+ if($_SESSION['N_pomme']>100){ |
|
104 |
+ $_SESSION['N_pomme']=100; |
|
105 |
+ }else if($_SESSION['N_pomme']<0){ |
|
106 |
+ $_SESSION['N_pomme']=0; |
|
107 |
+ } |
|
108 |
+ if($_SESSION['N_viandeSeche']>100){ |
|
109 |
+ $_SESSION['N_viandeSeche']=100; |
|
110 |
+ }else if($_SESSION['N_viandeSeche']<0){ |
|
111 |
+ $_SESSION['N_viandeSeche']=0; |
|
112 |
+ } |
|
113 |
+ if($_SESSION['N_orange']>100){ |
|
114 |
+ $_SESSION['N_orange']=100; |
|
115 |
+ }else if($_SESSION['N_orange']<0){ |
|
116 |
+ $_SESSION['N_orange']=0; |
|
117 |
+ } |
|
118 |
+ if($_SESSION['N_pain']>100){ |
|
119 |
+ $_SESSION['N_pain']=100; |
|
120 |
+ }else if($_SESSION['N_pain']<0){ |
|
121 |
+ $_SESSION['N_pain']=0; |
|
122 |
+ } |
|
123 |
+ if($_SESSION['N_chocolat']>100){ |
|
124 |
+ $_SESSION['N_chocolat']=100; |
|
125 |
+ }else if($_SESSION['N_chocolat']<0){ |
|
126 |
+ $_SESSION['N_chocolat']=0; |
|
127 |
+ } |
|
128 |
+ if($_SESSION['N_lait']>100){ |
|
129 |
+ $_SESSION['N_lait']=100; |
|
130 |
+ }else if($_SESSION['N_lait']<0){ |
|
131 |
+ $_SESSION['N_lait']=0; |
|
132 |
+ } |
|
133 |
+ //augmentation de la fatigue et coh�rence |
|
134 |
+ $_SESSION['FatigueActuelle'] += $_GET['augFat']; |
|
135 |
+ if($_SESSION['FatigueActuelle']>100){ |
|
136 |
+ $_SESSION['FatigueActuelle']=100; |
|
137 |
+ }else if($_SESSION['FatigueActuelle']<1){ |
|
138 |
+ $_SESSION['FatigueActuelle']=0; |
|
139 |
+ header("location:fatigue.php"); |
|
140 |
+ } |
|
141 |
+ //coh�rence des points de vie |
|
142 |
+ if($_SESSION['VitActuelle']>$_SESSION['Vit']){ |
|
143 |
+ $_SESSION['VitActuelle']=$_SESSION['Vit']; |
|
144 |
+ } |
|
145 |
+ if($_SESSION['VitActuelleAug']>$_SESSION['VitAug']){ |
|
146 |
+ $_SESSION['VitActuelleAug']=$_SESSION['VitAug']; |
|
147 |
+ }else if($_SESSION['VitActuelleAug']<0){ |
|
148 |
+ $_SESSION['VitActuelleAug']=0; |
|
149 |
+ header("location:mort.php"); |
|
150 |
+ } |
|
151 |
+ |
|
152 |
+ //retour a la page precedente |
|
153 |
+ if($_GET['Retour']==0){ |
|
154 |
+ header("location:FicheDSac.php?pageprecedente=".$pageprecedente); |
|
155 |
+ }else if($_GET['Retour']==1){ |
|
156 |
+ header("location:D_echoppe_marchand.php?dialogueMarchand=6"); |
|
157 |
+ } |
|
158 |
+ |
|
159 |
+mysql_close(); |
|
160 |
+?> |