From 14461d53554fb13b3dfe70f359de5e5ff1e6a8a6 Mon Sep 17 00:00:00 2001 From: awing-ding <66324442+awing-ding@users.noreply.github.com> Date: Wed, 3 Jun 2020 08:10:41 +0200 Subject: [PATCH 1/3] Add files via upload --- __pycache__/defDeplacement.cpython-38.pyc | Bin 0 -> 1467 bytes defDeplacement.py | 42 ++++++++++++++ "syst\303\250me combat.py" | 66 ++++++++++++++++++++++ test_jeu_video_n1.py | 59 ++++++++----------- 4 files changed, 133 insertions(+), 34 deletions(-) create mode 100644 __pycache__/defDeplacement.cpython-38.pyc create mode 100644 defDeplacement.py create mode 100644 "syst\303\250me combat.py" diff --git a/__pycache__/defDeplacement.cpython-38.pyc b/__pycache__/defDeplacement.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..687244ce73304775d4c033e7946c02623939dea6 GIT binary patch literal 1467 zcmb7E&2G~`5cYrEHf>QkP%dZ>NF^72NNMIWI83+x}( zr3DVSXl?MoN9#ZU9kecluz}WtP1r)~Ll?Hu2C(zV>g^6NLTgd%GZfuLWia-GZCl31 zvrd1yXAZb#5DU$+m|aW7P0uO)T&2R4ezpH)DHq?Y)ZdST!{|bDrK2mJC9z6l;L$nP zw?^hsUltP{7YwAS8Rer zI9w1X;Y?Ed*;RU#rP2)fxZv!BE!Vq>P6;o&%>$pOZ*Mpg2XV^sShIl~A@wu{Zo)L^ zxe}!pEC#NPD*aUCg;5=BmwSU=Uyx{C1aaX1jHo(>QqzY#>)}3c zFt|OnB|NpSfm|h0HH03#Y{8RfJ@}_B_(Vx#mUWlGe7h2x2JxzeO`d+QQ~fonZ(Gr~ hR869$fud8Z0+!*?NJ5eEE?;p_M9%TRk literal 0 HcmV?d00001 diff --git a/defDeplacement.py b/defDeplacement.py new file mode 100644 index 0000000..a41bc31 --- /dev/null +++ b/defDeplacement.py @@ -0,0 +1,42 @@ +def foret(): + print("t'es dans la foret") + return(foret) + +def lac(): + print("t'es au lac") + return(lac) + + +def montagnes(): + print("t'es dans les montagnes") + return(montagnes) + +def village(): + print("t'es au village") + deplacementVillage= str(input("veux tu aller vers: la forge ou la bibliotheque ? ")) + verification = False + while verification == False: + if deplacementVillage == "forge" or deplacementVillage == "bibliotheque" : + if deplacementVillage == "forge": + zone = "forge" + forge() + verification = True + elif deplacementVillage== "bibliotheque": + zone = "bibliotheque" + bibliotheque() + verification = True + else: + print("je n'ai pas compris veux tu aller dans la forge ou la bibliotheque") + return(village) + +def forge(): + print("t'es dans la forge") + return(forge) + +def bibliotheque(): + print("t'es dans la bibliotheque") + return(bibliotheque) + +def grotte(): + print("t'es dans la grotte") + return(grotte) \ No newline at end of file diff --git "a/syst\303\250me combat.py" "b/syst\303\250me combat.py" new file mode 100644 index 0000000..80022a7 --- /dev/null +++ "b/syst\303\250me combat.py" @@ -0,0 +1,66 @@ +# Créé par Perso, le 02/06/2020 en Python 3.4 +from random import randint +def stat_mob(level): + if level <= 5: + stat__mob = [randint(2,5),randint(5,8),randint(1,5)] + elif level > 5 and level <= 10: + stat__mob = [randint(3,7),randint(7,10),randint(5,10)] + elif level > 10 and level <= 15: + stat__mob = [randint(5,10),randint(10,14),randint(10,15)] + elif level > 15: + stat__mob = [randint(10,15),randint(15,20),randint(15,20)] + return(stat__mob) +def spawn_mob(zone,level): + if zone == "foret": + mob = "sanglier" + stats_mob = stat_mob(level) + elif zone == "grotte": + mob = "ours" + stats_mob = stat_mob(level) + elif zone == "lac": + mob = "poisson" + stats_mob = [1,1] + elif zone == "village": + mob = "bandit" + stats_mob = stat_mob(level) + elif zone == "montagne": + mob = "loup" + stats_mob = stat_mob(level) + return(mob,stats_mob) +def combat(mob,stat_mob,stat,level): + print("Attention un "+str(mob)+" sauvage apparait, il a "+str(stat_mob[0])+" d'attque et "+str(stat_mob[1])+" point de vie") + Loot = None + ExpGagner = 0 + PV = stat[0] + ATK = stat[1] + ATKmob = stat_mob[0] + PVmob = stat_mob[1] + while PV > 0 and PVmob > 0: + print(str(mob)+" attaque, il vous fait:"+str(ATKmob)+" pts de degat") + PV = PV - ATKmob + if PV <= 0: + print("Tu es mort-Adele") + elif PV > 0: + print("il vous reste "+str(PV)+" point de vie") + else : + print("tu attaques avec la puissance de... tes poings, tu fais "+str(ATK)+" point de degat") + PVmob = PVmob - ATK + if PVmob <= 0 : + print("il lui reste 0 point de vie") + else: + print("il lui reste "+str(PVmob)+" point de vie") + if PVmob <= 0: + print("tu as battu ce machin truc") + if PVmob == 0 and PV > 0: + Loot = loot(mob,stat_mob[2])[0] + ExpGagner = loot(mob,stat_mob)[1] + return(ExpGagner,Loot) +def loot(mob,stat): + Nb = 1 + if Nb == 1: + loot = "quelque chose" + exp = stat[2] + return(loot,exp) +PV = 20 +ATK = 5 +stat = [PV,ATK] diff --git a/test_jeu_video_n1.py b/test_jeu_video_n1.py index 516e0f0..d37edcd 100644 --- a/test_jeu_video_n1.py +++ b/test_jeu_video_n1.py @@ -1,12 +1,5 @@ -# -*- coding: utf-8 -*- -""" -Created on Tue Jun 2 19:07:09 2020 - -@author: Antoine -""" - -# Créé par Perso, le 02/06/2020 en Python 3.4 -import random +# Créé par Perso, le 02/06/2020 en Python 3.4 +from random import* def foret(): print("t'es dans la foret") @@ -25,29 +18,27 @@ def village(): def grotte(): print("t'es dans la grotte") - -verification = False -while verification != True : - deplacement= input("veux tu aller vers: la foret, le village, la grotte, les montagnes, le lac ?") - if deplacement== "foret": - zone = "foret" - foret() - verification = True - elif deplacement == "grotte": - zone = "grotte" - grotte() - verification = True - elif deplacement == "montagnes": - zone = "montagnes" - montagnes() - verification = True - elif deplacement == "village": - zone = "village" - village() - verification = True - elif deplacement== "lac": - zone = "lac" - lac() - - verification = True +direction=randint(1,5) +if direction==1: + zone= foret() +elif direction==2: + zone= grotte() +elif direction==3: + zone= village() +elif direction==4: + zone= montagnes() +elif direction==5: + zone= lac() + +deplacement = input("veux tu aller vers: la foret, le village, la grotte, les montagnes, le lac ?") +if deplacement== "foret": + zone= foret() +elif deplacement== "grotte": + zone= grotte() +elif deplacement== "montagnes": + zone= montagnes() +elif deplacement== "village": + zone= village() +elif deplacement== "lac": + zone= lac() From 1214553aa0d8955dadc67c388bc9de0fd72a1d21 Mon Sep 17 00:00:00 2001 From: awing-ding <66324442+awing-ding@users.noreply.github.com> Date: Wed, 3 Jun 2020 08:12:38 +0200 Subject: [PATCH 2/3] Delete test_jeu_video2-1.py --- test_jeu_video2-1.py | 131 ------------------------------------------- 1 file changed, 131 deletions(-) delete mode 100644 test_jeu_video2-1.py diff --git a/test_jeu_video2-1.py b/test_jeu_video2-1.py deleted file mode 100644 index d3c8cb5..0000000 --- a/test_jeu_video2-1.py +++ /dev/null @@ -1,131 +0,0 @@ -# -*- coding: utf-8 -*- -""" -Created on Tue Jun 2 19:07:09 2020 - -@author: Antoine -""" - -# Créé par Perso, le 02/06/2020 en Python 3.4 -from random import* - -from random import* -def stat_mob(level): - if level <= 5: - stat__mob = [randint(2,5),randint(5,8),randint(1,5)] - elif level > 5 and level <= 10: - stat__mob = [randint(3,7),randint(7,10),randint(5,10)] - elif level > 10 and level <= 15: - stat__mob = [randint(5,10),randint(10,14),randint(10,15)] - elif level > 15: - stat__mob = [randint(10,15),randint(15,20),randint(15,20)] - return(stat__mob) -def spawn_mob(zone,level): - if zone == "foret": - mob = "sanglier" - stats_mob = stat_mob(level) - elif zone == "grotte": - mob = "ours" - stats_mob = stat_mob(level) - elif zone == "lac": - mob = "poisson" - stats_mob = [1,1] - elif zone == "village": - mob = "bandit" - stats_mob = stat_mob(level) - elif zone == "montagne": - mob = "loup" - stats_mob = stat_mob(level) - return(mob,stats_mob) -def combat(mob,stat_mob,stat,level): - print("Attention un "+str(mob)+" sauvage apparait, il a "+str(stat_mob[0])+" d'attque et "+str(stat_mob[1])+" point de vie") - Loot = None - ExpGagner = 0 - PV = stat[0] - ATK = stat[1] - ATKmob = stat_mob[0] - PVmob = stat_mob[1] - while PV > 0 and PVmob > 0: - print(str(mob)+" attaque, il vous fait:"+str(ATKmob)+" pts de degat") - PV = PV - ATKmob - if PV <= 0: - print("Tu es mort-Adele") - elif PV > 0: - print("il vous reste "+str(PV)+" point de vie") - else : - print("tu attaques avec la puissance de... tes poings, tu fais "+str(ATK)+" point de degat") - PVmob = PVmob - ATK - if PVmob <= 0 : - print("il lui reste 0 point de vie") - else: - print("il lui reste "+str(PVmob)+" point de vie") - if PVmob <= 0: - print("tu as battu ce machin truc") - if PVmob == 0 and PV > 0: - Loot = loot(mob,stat_mob[2])[0] - ExpGagner = loot(mob,stat_mob)[1] - return(ExpGagner,Loot) -def loot(mob,stat): - Nb = 1 - if Nb == 1: - loot = "quelque chose" - exp = stat[2] - return(loot,exp) -PV = 20 -ATK = 5 -stat = [PV,ATK] - - -def foret(): - print("t'es dans la foret") - return(foret) - -def lac(): - print("t'es au lac") - return(lac) - - -def montagnes(): - print("t'es dans les montagnes") - return(montagnes) - -def village(): - print("t'es au village") - deplacementvillage= str(input("veux tu aller vers: la forge ou la bibliotheque ? ")) - if deplacementvillage== "forge": - zone= forge() - elif deplacementvillage== "bibliotheque": - zone= bibliotheque() - return(village) - -def forge(): - print("t'es dans la forge") - return(forge) - -def bibliotheque(): - print("t'es dans la bibliotheque") - return(bibliotheque) - -def grotte(): - print("t'es dans la grotte") - return(grotte) - - -verification = False -while verification != True : - deplacement= str(input("veux tu aller vers: la foret, le village, la grotte, les montagnes ou le lac ? ")) - if deplacement== "foret": - zone= foret() - verification = True - elif deplacement == "grotte": - zone = grotte() - verification = True - elif deplacement == "montagnes": - zone = montagnes() - verification = True - elif deplacement == "village": - zone= village() - verification = True - elif deplacement== "lac": - zone= lac() - verification = True - From 0c8fe3102238540236c73f8c9777dedd81092665 Mon Sep 17 00:00:00 2001 From: awing-ding <66324442+awing-ding@users.noreply.github.com> Date: Wed, 3 Jun 2020 08:13:13 +0200 Subject: [PATCH 3/3] =?UTF-8?q?Delete=20syst=C3=A8me=20combat.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "syst\303\250me combat.py" | 66 -------------------------------------- 1 file changed, 66 deletions(-) delete mode 100644 "syst\303\250me combat.py" diff --git "a/syst\303\250me combat.py" "b/syst\303\250me combat.py" deleted file mode 100644 index 80022a7..0000000 --- "a/syst\303\250me combat.py" +++ /dev/null @@ -1,66 +0,0 @@ -# Créé par Perso, le 02/06/2020 en Python 3.4 -from random import randint -def stat_mob(level): - if level <= 5: - stat__mob = [randint(2,5),randint(5,8),randint(1,5)] - elif level > 5 and level <= 10: - stat__mob = [randint(3,7),randint(7,10),randint(5,10)] - elif level > 10 and level <= 15: - stat__mob = [randint(5,10),randint(10,14),randint(10,15)] - elif level > 15: - stat__mob = [randint(10,15),randint(15,20),randint(15,20)] - return(stat__mob) -def spawn_mob(zone,level): - if zone == "foret": - mob = "sanglier" - stats_mob = stat_mob(level) - elif zone == "grotte": - mob = "ours" - stats_mob = stat_mob(level) - elif zone == "lac": - mob = "poisson" - stats_mob = [1,1] - elif zone == "village": - mob = "bandit" - stats_mob = stat_mob(level) - elif zone == "montagne": - mob = "loup" - stats_mob = stat_mob(level) - return(mob,stats_mob) -def combat(mob,stat_mob,stat,level): - print("Attention un "+str(mob)+" sauvage apparait, il a "+str(stat_mob[0])+" d'attque et "+str(stat_mob[1])+" point de vie") - Loot = None - ExpGagner = 0 - PV = stat[0] - ATK = stat[1] - ATKmob = stat_mob[0] - PVmob = stat_mob[1] - while PV > 0 and PVmob > 0: - print(str(mob)+" attaque, il vous fait:"+str(ATKmob)+" pts de degat") - PV = PV - ATKmob - if PV <= 0: - print("Tu es mort-Adele") - elif PV > 0: - print("il vous reste "+str(PV)+" point de vie") - else : - print("tu attaques avec la puissance de... tes poings, tu fais "+str(ATK)+" point de degat") - PVmob = PVmob - ATK - if PVmob <= 0 : - print("il lui reste 0 point de vie") - else: - print("il lui reste "+str(PVmob)+" point de vie") - if PVmob <= 0: - print("tu as battu ce machin truc") - if PVmob == 0 and PV > 0: - Loot = loot(mob,stat_mob[2])[0] - ExpGagner = loot(mob,stat_mob)[1] - return(ExpGagner,Loot) -def loot(mob,stat): - Nb = 1 - if Nb == 1: - loot = "quelque chose" - exp = stat[2] - return(loot,exp) -PV = 20 -ATK = 5 -stat = [PV,ATK]