J'ai un problème avec un jeu "pokémon" en batch.

Alvin1614 Messages postés 115 Statut Membre -  
Alvin1614 Messages postés 115 Statut Membre -
Bonjour, j'ai un problème avec un jeu pokémon...
l'erreur se passe quand on va dans les hautes herbes et que l'on veut courir attaquer ou mordre...
voila le jeux :

@echo off
Title PokeBatch - L'expérience Pokemon en Batch
echo \---------------------------------------------------\
echo  \    PokeBatch - L'expérience Pokemon en Batch      \
echo   \---------------------------------------------------\
pause
                              
cls
echo Professeur Chêne approche
echo Professeur Chêne: Salut. Mon nom est Professeur Chêne.
echo Professeur Chêne: Bienvenue dans le monde merveilleux des Pokemon!
pause

:choosename
cls
echo Professeur Chêne: Je ne me souviens pas de votre nom. Quel est-il?
set /p name=
pause
if '%name%' == '' goto choosename

cls
echo Salut %name%! C'est agréable de te (re)voir !
pause

::girlorboy
::cls
::echo %name%, Are you a boy or a girl?
::echo (Enter 'boy', or 'girl')
::set /p gender=
::pause
::if '%gender%'=='boy' goto skip
::if '%gender%'=='girl' goto skip
::goto girlorboy
::skip

::cls
::echo Professeur Chêne: Aah.. so you are a %gender%
::pause

cls
echo Professeur Chêne: Donc %name% qu'attendez-vous? Choisissez votre pokémon !
pause

set starter='Bulbasaur'

cls
echo \---------------------------------------------------\
echo  \                  Bulbasaur (Lvl 4)                \
echo   \---------------------------------------------------\

echo Professeur Chêne: Voulez-vous choisir Bulbasaur?
echo (Appuyez sur "y" pour choisir Bulbasaur)
pause
set /p yno=

if '%yno%' == 'y' (
    set starter=Bulbasaur
    goto chosen
)

cls
echo \---------------------------------------------------\
echo  \                  Squirtle (Lvl 4)                 \
echo   \---------------------------------------------------\

echo Professeur Chêne: Voulez-vous choisir Squirtle?
echo (Appuyez sur "y" pour choisir Squirtle)
pause
set /p yno=

if '%yno%' == 'y' (
    set starter=Squirtle
    goto chosen
)

cls
echo \---------------------------------------------------\
echo  \                 Charmandar (Lvl 4)                \
echo   \---------------------------------------------------\

echo Professeur Chêne: Voulez-vous choisir Charmandar?
echo (Appuyez sur "y" pour choisir Charmandar)
pause
set /p yno=

if '%yno%' == 'y' (
    set starter=Charmandar
    goto chosen
)

cls
echo Professeur Chêne: Oh, attendez, il y en a encore un...
pause

cls
echo \---------------------------------------------------\
echo  \                   Pikachu (Lvl 4)                 \
echo   \---------------------------------------------------\
echo Professeur Chêne: Voulez-vous choisir Pikachu?
echo Soyez prudent, ce pokémon est très énergique.
echo (Appuyez sur "y" pour choisir Pikachu)
pause
set /p yno=

if '%yno%' == 'y' (
    set starter=Pikachu
    goto chosen
)

:chosen
cls
echo Professeur Chêne: Félicitation ! Vous êtes maintenant un formateur Pokemon !
echo Prenez ceci avec vous.
echo (Pokegear reçue)
echo Professeur Chêne: Ceci peut vous aider.
pause

cls
echo Professeur Chêne: Maintenant, votre journée commence avec %starter%
echo Professeur Chêne: Collectez des badges de gymnastique et participez à la Pokemon League.
echo Professeur Chêne: Bonne chance !
pause

:start
set starter-lvl=4
set starter-pv=20
set starter-att=2
set starter-def=2
set starter-spd=2
set starter-spatt=2
set starter-spdef=2
set mom=0
set fstone=0
set rwing=0
set leaguecup=0

::Maribou town
::Rienna city
::Vicarian city
::Aminos city

:city1
::Maribou town
cls
echo Vous êtes dans la ville de Maribou
echo Entrez un numéro pour sélectionner une option (1,2,3,4)
echo 1) Aller à votre maison
echo 2) Aller au Pokemon Center
echo 3) Aller au Pokemon Lab
echo 4) Aller à l'herbe haute pour quitter la ville de Maribou
pause
set /p city1option=

if '%city1option%' == '1' goto city1-1
if '%city1option%' == '2' goto city1-2
if '%city1option%' == '3' goto city1-3
if '%city1option%' == '4' goto city1-4

:city1-1
cls
echo \---------------------------------------------------\
echo  \                    La maison                      \
echo   \---------------------------------------------------\
echo      __!!_______________
echo     /  !!             /\\
echo    /  /__\           /  \\
echo   /_________________/    \\
echo   !                !  /\  !
echo   !                ! /  \ !
echo   !________________! !  ! !
echo.
echo Vous êtes dans votre maison
echo Entrez un numéro pour choisir une option (1,2,3)
echo 1) Appeler votre Maman
echo 2) Manger les restes du repas
echo 3) Retourner à la ville
pause

set /p city1-1option=

if '%city1-1option%' == '1' goto city1-1-1
if '%city1-1option%' == '2' goto city1-1-2
if '%city1-1option%' == '3' goto city1

:city1-1-1
cls
if '%mom%' == '0' (
    echo Maman: %name%! Je vous déteste vous et votre père inconnu !
    echo Maman: Vous partez dans le monde à pied pendant des années et vous ne revenez jamais !
    echo Maman: Au moins, prenez ces chaussures de course.
    echo Maman: Elles n'auront aucun effet sur PokeBatch mais je vous les donne juste pour ne pas que vous vous plainiez.
    set mom=1
    pause
    goto city1-1
)
if '%mom%' == '1' (
    echo Maman: Quel est le problème ? Vous avez rapporté quelque chose pour moi ?
    echo Maman: Non? Alors, sortez de ma maison! :D
    pause
    goto city1-1
)
if '%mom%' == '2' (
    echo Maman: Quel est le problème? Avez-vous apporté quelque chose pour moi?
    echo Maman: Ooooh! C'est un diamant ENORME! Je vous aime presque! :)
    echo (Le diamant est donné à Maman)
    echo Maman: Prenez cette pierre de feu de la collection de votre père.
    echo (Vous avez reçu la pierre de feu)
    set fstone=1
    set mom=3
    pause
    goto city1-1
)
if '%mom%' == '3' (
    echo Maman: Avez-vous apporté quelque chose d'autre pour moi?
    echo Non? Oh bien, pensez que je vous hais encore. :)
    pause
    goto city1-1
)
if '%mom%' == '4' (
    echo Maman: Bien? Qu'Est-ce que c'est? Une surprise que vous dites?
    echo (Le collier de Jade est remis à Maman)
    echo Maman: Je vous aime !!!
    echo Maman: Vous méritez cette allée Arc-En-Ciel !
    echo (Vous avez reçu l'allée Arc-En-Ciel)
    set rwing=1
    set mom=5
    echo Maman: Permettez-moi de lire ce que votre père a écrit :
    echo "Seul un vrai Pokemon Champion peut utiliser cette allée Arc-En-Ciel"
    echo "Le légendaire Ho-Oh apparaîtra devant celui qui est pur de cœur et a une forte volonté."
    echo "Il doit se rendre au clocher de la ville de Vicarian à la fois."
    echo "Mais il y a une chose que tu devrais sav... "
    echo Maman: Et le reste est illisible. Votre père fou et ses divagations sur un pokémon légendaire sont absolument idiotes.
    pause
    goto city1-1
)
if '%mom%' == '5' (
    echo Maman: Vous savez quoi? Vous n'êtes pas si mauvais :)
    pause
    goto city1-1
)
if '%mom%' == '6' (
    echo Maman: Qu'est-ce que ... Est-ce un Ho-Oh? : O
    echo Maman: Cela signifie que votre père n'était pas un fou !
    pause
    goto city1-1
)

:city1-1-2
cls
echo Vous avez mangé beaucoup ! Miam miam !
echo Vous êtes mort de fatigue ! Qu'est-ce qu'il y avait dans cette nourriture ?
echo Vous vous réveillez 12 heures plus tard. Votre %starter% a récupéré son pv.
set /a starter-pv=10*%starter-lvl%
pause
goto :city1-1

:city1-2
cls
echo \---------------------------------------------------\
echo  \                   Pokemon Center                  \
echo   \---------------------------------------------------\
echo.
echo     ___________________
echo    /___________________\
echo    !       //_\\       !
echo    !_______\\_//_______!
echo    !     !  ___  !     !
echo    !     ! !   ! !     !
echo    !_____! !___! !_____!
echo.
echo Vous êtes à l'intérieur du Pokemon Center
echo Entrez un numéro pour choisir une option (1,2,3)
echo 1) Reprenez votre pokémon guéri par Nurse Joy
echo 2) Recevoir d'autres services de Nurse Joy
echo 3) Retourner en ville
pause

set /p city1-2option=

if '%city1-2option%' == '1' goto city1-2-1
if '%city1-2option%' == '2' goto city1-2-2
if '%city1-2option%' == '3' goto city1

:city1-2-1
cls
echo Nurse Joy: Votre %starter% n'a pas l'air en très bon état...
echo Nurse Joy: Laissez-moi le soigner ici avec beaucoup d'amour ;)
echo Nurse Joy: Ici, petit %starter%, tu seras mieux que jamais !
echo %starter%: %STARTER%!
echo Votre %starter% a retrouvé son pv
set /a starter-pv=10*%starter-lvl%
pause
goto city1-2

:city1-2-2
cls
echo %name%: Hey Joy, que diriez vous de me montrer vos "Pokemons" ?
if '%leaguecup%' == '0' (
echo Nurse Joy: Je ne pense pas que vous êtes suffisamment formé pour les gérer.
echo Nurse Joy: Décampez comme un Beedrill avant que je ne vous batte au combat !
echo Vous vous rendez en ville en vous cachant le visage

if '%leaguecup%' == '1' (
:: ;)

pause
goto city1

:city1-3
cls
echo \---------------------------------------------------\
echo  \                     Pokemon Lab                   \
echo   \---------------------------------------------------\
echo.
echo           _______
echo        .           .
echo     /      //_\\      \
echo    !_______\\ //_______!
echo    /___________________\
echo    !     !  ___  !     !
echo    !     ! /   \ !     !
echo    !_____! !___! !_____!
echo.
echo Vous êtes à l'intérieur du Pokemon Lab
echo Entrez un numéro pour choisir une option (1,2)
echo 1) Appeller le professeur Chêne
echo 2) Retourner en ville
pause

set /p city1-2option=

if '%city1-2option%' == '1' goto city1-3-1
if '%city1-2option%' == '2' goto city1

:city1-3-1
cls
echo Professeur Chêne: Oh salut %name% ! Je suis un peu occupé en ce moment.
echo Professeur Chêne: Revenez après avoir gagné un lot de Gym.
pause
goto city1

:city1-4
cls
echo \---------------------------------------------------\
echo  \                  Herbes hautes                    \
echo   \---------------------------------------------------\
echo.
echo    )\  )\ )\ )\ /(  (\ )\  )\  )\  /( /( )\  (\ (\ /)  )\
echo    /( /( )\  (\ (\ /)  )\  )\  )\ )\ )\ /(  (\ )\  )\  )\
echo    )\  (\ (\ /)  )\ (\ )\  )\  )\  /( /( )\ )\ )\ )\ /(  (\
echo.
echo Vous êtes sorti de la ville de Maribou.
echo Comme votre ville est très petite, vous pouvez déjà voir la ville de Rienna.
echo La ville de Rienna est célèbre pour ses baies et son herbe pokémon.
echo.
echo Vous marchez dans les hautes herbes.
echo Il y a quelque chose sous vos pied...

setlocal ENABLEDELAYEDEXPANSION
set /a r=%random% %%!3 +1
::Caterpie Oddish Rattata Cubone
if '%r%' == '0' (
    set wildpkmn=Caterpie
    goto wildpokemon
)
if '%r%' == '1' (
    set wildpkmn=Oddish
    goto wildpokemon
)
if '%r%' == '2' (
    set wildpkmn=Rattata
    goto wildpokemon
)
if '%r%' == '3' (
    set wildpkmn=Cubone
    goto wildpokemon
)
:wildpokemon
echo Un %wildpkmn% sauvage est apparu !
echo.
echo %wildpkmn%: %wildpkmn%
set wildpkmn-lvl=2
set wildpkmn-pv=10
set wildpkmn-pv=20
set wildpkmn-att=2
set wildpkmn-def=2
set wildpkmn-spd=2
set wildpkmn-spatt=2
set wildpkmn-spdef=2
echo.
echo %name%: Go %starter% Je te choisis!
echo %starter%: %starter%
pause

:wildpokemon-battle
cls
echo \---------------------------------------------------\
echo  \                 %wildpkmn% (Lvl %wildpkmn-lvl%)   \
echo   \---------------------------------------------------\
echo.
echo pv: %wildpkmn-pv%
echo.
echo.
echo \---------------------------------------------------\
echo  \                 %starter% (Lvl %starter-lvl%)     \
echo   \---------------------------------------------------\
echo.
echo pv: %starter-pv%
echo.
echo.
echo Que voulez-vous faire ?
echo.
echo Entrez un numéro pour choisir une option (1,2)
echo 1) Tackle Attack
echo 2) Mordre
echo 3) Courir

set /p wildpkmn-atk=
pause

set /a critical=%random% %%!1 +1

if '%wildpkmn-atk%' == '1' set impact-wildpkmn=((2*%wildpkmn-att%)/2)*(%critical%+1)
if '%wildpkmn-atk%' == '2' set impact-wildpkmn=((3*%wildpkmn-att%)/2)*(%critical%+1)

cls
echo \---------------------------------------------------\
echo  \                 %wildpkmn% (Lvl %wildpkmn-lvl%)                \
echo   \---------------------------------------------------\
echo.
echo pv: %wildpkmn-pv%

set wildpkmn-pv=%wildpkmn-pv%-(%impact-wildpkmn%-%wildpkmn-def%)

if '%critical%' == '0' echo %wildpkmn% lost %impact-wildpkmn% pv
if '%critical%' == '1' (
    echo Niveau de vie critique !
    echo %wildpkmn% lost %impact-wildpkmn% pv
)

echo pv: %wildpkmn-pv%
echo.
if %wildpkmn-pv% <=0 goto wild-1-victory

echo \---------------------------------------------------\
echo  \                 %starter% (Lvl %starter-lvl%)                \
echo   \---------------------------------------------------\
echo.
echo pv: %starter-pv%
echo.
echo.

set /a wildpkmn-hit=%random% %%!1 +1
set /a critical=%random% %%!1 +1

if '%wildpkmn-hit%' == '0' set impact-starter=((2*%starter-att%)/2)*(%critical%+1)
if '%wildpkmn-hit%' == '1' set impact-starter=((3*%starter-att%)/2)*(%critical%+1)
set starter-pv=%starter-pv%-(%impact-starter%-%starter-def%)

if '%critical%' == '0' echo %starter% lost %impact-starter% pv
if '%critical%' == '1' (
    echo Niveau de vie critique !
    echo %starter% lost %impact-starter% pv
)

echo pv: %starter-pv%
echo.
echo.

if %starter-pv% <=0 goto gameover

goto wildpokemon-battle

:wild-1-victory
cls
echo \---------------------------------------------------\
echo  \                 %wildpkmn% (Lvl %wildpkmn-lvl%)                \
echo   \---------------------------------------------------\
echo.
echo pv: 0
echo.
echo.
echo \---------------------------------------------------\
echo  \                 %starter% (Lvl %starter-lvl%)                \
echo   \---------------------------------------------------\
echo.
echo pv: %starter-pv%
echo.
echo.
echo %wildpkmn% s'est évanoui
echo.
echo %starter% a gagné 100 points d'experience
set /a starter-lvl=%starter-lvl%+1
set /a starter-pv=10*%starter-lvl%
set /a starter-att=%starter-att%+1
set /a starter-def=%starter-def%+1
set /a starter-spd=10*%starter-spd%+1
set /a starter-spatt=10*%starter-spatt%+1
set /a starter-spdef=10*%starter-spdef%+1

echo %starter% niveau atteind %starter-lvl%
echo Le niveau d'pv de votre %Starter% augmente à %starter-pv%
echo Le niveau d'attaque de votre %starter% augmente à %starter-att%
echo Le niveau de défense de votre %starter% augmente à %starter-def%
echo La vitesse de votre %starter% augmente à %starter-spd%
echo La rapidité d'attaque de votre %starter% augment à %starter-spatt%
echo La rapidité de défense de votre %starter% augmente à %starter-spdef%
pause
goto city-2

:gameover
cls
echo \---------------------------------------------------\
echo  \                 %wildpkmn% (Lvl %wildpkmn-lvl%)                \
echo   \---------------------------------------------------\
echo.
echo pv: %wildpkmn-pv%
echo.
echo.
echo \---------------------------------------------------\
echo  \                 %starter% (Lvl %starter-lvl%)                \
echo   \---------------------------------------------------\
echo.
echo pv: 0
echo.
echo.
echo %starter% S'est évanoui
echo Vous n'avez plus de Pokemeon
echo %name% retourne à la ville de Maribou
goto start

:city-2
::Rienna city
cls
echo Vous êtes dans Rienna city
echo Entrez un numéro pour choisir une option (1,2,3,4)
echo 1) Parler au campeur
echo 2) Aller à la fontaine
echo 3) Aller au carrefour
echo 4) Aller au Pokemon Center
pause
set /p city2option=

if '%city2option%' == '1' goto city2-1
if '%city2option%' == '2' goto city2-2
if '%city2option%' == '3' goto city2-3
if '%city2option%' == '4' goto city2-4


D'avance Merci ! ☺☻

ps: et si c'est possible ce serait cool que le truc génère automatiquement un fichier de sauvegarde...
Merchi ;-)

3 réponses

  1. jordane45 Messages postés 30427 Date d'inscription   Statut Modérateur Dernière intervention   4 831
     
    Bonjour,

    Alors... comme j'ai la flemme de lire tout le code et même de le tester ... il serait bien que tu nous indiques :
    - Vers quelles lignes de code ça plante
    - L'erreur rencontrée (vu que tu nous dis en avoir une....)
    0
  2. barnabe0057 Messages postés 14329 Date d'inscription   Statut Contributeur Dernière intervention   4 930
     
    Bonjour,

    Effectivement il y a quelques erreurs.

    Je suis en train d'optimiser tout ça, je te tiens au courant.
    0
  3. Alvin1614 Messages postés 115 Statut Membre 4
     
    Merci beaucoup!
    0
    1. barnabe0057 Messages postés 14329 Date d'inscription   Statut Contributeur Dernière intervention   4 930
       
      Ton code est très long et dur à lire, pour raccourcir le nombre de lignes j'ai mis tout ce qui est texte dans un fichier à part, et j'ai optimisé les parties qui se répètent comme par exemple pour le choix du pokemon.

      Je n'ai pas terminé, voilà où j'en suis :

      @echo off
      mode con: cols=89 lines=35
      chcp 1252 > nul
      Title PokeBatch - L'expérience Pokemon en Batch
      Setlocal enableextensions enableDelayedExpansion

      for /f "usebackq tokens=1* delims=#" %%A in ("pokemon.txt") do (set ContentLine%%A=%%B)

      call :texte 1 3 n

      call :texte 4 6 o
      echo. & pause

      :choosename
      cls
      call :texte 7 7 o
      echo. & set /p name="Votre nom : "
      if '!name!' == '' (goto choosename)

      cls
      call :texte 8 8 o
      echo. & pause

      call :texte 9 9 o
      echo. & pause

      :personnage
      set /a choix=0

      if !choix! EQU 0 (call :choix_pokemon Bulbasaur)
      if !choix! EQU 0 (call :choix_pokemon Squirtle)
      if !choix! EQU 0 (call :choix_pokemon Charmandar)

      cls
      call :texte 10 10 o
      echo. & pause

      call :choix_pokemon Pikachu
      if !choix! EQU 0 (goto :personnage)

      :chosen
      cls
      call :texte 11 14 o

      call :texte 15 17 o
      echo. & pause

      :start
      set /a starterlvl=4
      set /a starterpv=20
      set /a starteratt=2
      set /a starterdef=2
      set /a starterspd=2
      set /a starterspatt=2
      set /a starterspdef=2
      set /a mom=0
      set /a fstone=0
      set /a rwing=0
      set /a leaguecup=0

      ::Maribou town
      ::Rienna city
      ::Vicarian city
      ::Aminos city

      :Maribou
      ::Maribou town
      cls & set city1option=0
      call :texte 18 23 o
      echo. & set /p city1option="Votre choix : "

      if '!city1option!' == '1' (goto city1-1)
      if '!city1option!' == '2' (goto city1-2)
      if '!city1option!' == '3' (goto city1-3)
      if '!city1option!' == '4' (goto city1-4)

      goto Maribou

      :city1-1
      cls & set city1-1option=0
      call :texte 24 34 n
      call :texte 35 39 o

      echo. & set /p city1-1option="Votre choix : "

      if '!city1-1option!' == '1' (goto city1-1-1)
      if '!city1-1option!' == '2' (goto city1-1-2)
      if '!city1-1option!' == '3' (goto Maribou)

      goto :city1-1

      :city1-1-1
      cls
      if !mom! EQU 0 (call :texte 40 43 o)
      if !mom! EQU 1 (call :texte 44 45 o)
      if !mom! EQU 2 (set fstone=1 & call :texte 46 50 o)
      if !mom! EQU 3 (call :texte 51 52 o)
      if !mom! EQU 4 (set rwing=1 & call :texte 53 63 o)
      if !mom! EQU 5 (call :texte 64 64 o)
      if !mom! EQU 6 (call :texte 65 66 o)

      set /a mom+=1
      echo. & pause
      goto city1-1

      :city1-1-2
      cls
      call :texte 67 69 o
      set /a starterpv=!starterlvl!*10
      echo. & pause
      goto :city1-1

      :city1-2
      cls
      call :texte 70 81 n
      call :texte 82 86 o

      echo. & set /p city1-2option="Votre choix : "

      if '!city1-2option!' == '1' (goto city1-2-1)
      if '!city1-2option!' == '2' (goto city1-2-2)
      if '!city1-2option!' == '3' (goto Maribou)

      goto :city1-2

      :city1-2-1
      cls
      call :texte 87 91 o
      set /a starterpv=10*!starterlvl!
      echo. & pause
      goto city1-2

      :city1-2-2
      cls
      call :texte 92 92 o
      if !leaguecup! EQU 0 (call :texte 93 95 o)

      :: if !leaguecup! EQU 1 (
      :: ;)

      echo. & pause
      goto Maribou

      :city1-3
      cls & set city1-2option=0
      call :texte 96 108 n
      call :texte 109 112 o

      echo. & set /p city1-2option="Votre choix : "

      if '!city1-2option!' == '1' (goto city1-3-1)
      if '!city1-2option!' == '2' (goto Maribou)

      goto city1-3

      :city1-3-1
      cls
      call :texte 113 114 o
      echo. & pause
      goto Maribou

      :city1-4
      cls
      call :texte 115 122 n
      call :texte 123 128 n

      set /a r=%random% %%!3 +1
      ::Caterpie Oddish Rattata Cubone
      if !r! EQU 0 (set wildpkmn=Caterpie)
      if !r! EQU 1 (set wildpkmn=Oddish)
      if !r! EQU 2 (set wildpkmn=Rattata)
      if !r! EQU 3 (set wildpkmn=Cubone)

      :wildpokemon
      echo Un !wildpkmn! sauvage est apparu.
      echo.
      echo !wildpkmn!: ### !wildpkmn! ###
      set /a wildpkmnlvl=2
      set /a wildpkmnpv=10
      set /a wildpkmnpv=20
      set /a wildpkmnatt=2
      set /a wildpkmndef=2
      set /a wildpkmnspd=2
      set /a wildpkmnspatt=2
      set /a wildpkmnspdef=2
      echo.
      echo Vous: Go !starter!; Je te choisis.
      echo.
      echo !starter!: ### !starter! ###
      echo. & pause

      :wildpokemon-battle
      cls & set wildpkmnatk=0
      call :combat !wildpkmn! !wildpkmnlvl! !wildpkmnpv! !starter! !starterlvl! !starterpv!
      call :texte 149 154 n

      echo. & set /p wildpkmnatk="Votre choix : "

      set /a critical=%random% %%!1 +1

      if '!wildpkmnatk!' == '1' (
      set /a impactwildpkmn=((2*!wildpkmnatt!)/2)*(!critical!+1)
      )
      if '!wildpkmnatk!' == '2' (
      set /a impactwildpkmn=((3*!wildpkmnatt!)/2)*(!critical!+1)
      )

      cls
      echo\---------------------------------------------------\
      echo \ !wildpkmn! (Lvl !wildpkmn-lvl!) \
      echo \---------------------------------------------------\
      echo.
      echo pv: !wildpkmnpv!
      echo.

      set /a wildpkmnpv=!wildpkmnpv!-(!impactwildpkmn!-!wildpkmndef!)

      if '!critical!' == '0' (echo !wildpkmn! lost !impactwildpkmn! pv)
      if '!critical!' == '1' (
      echo Niveau de vie critique !
      echo !wildpkmn! lost !impactwildpkmn! pv
      )

      echo pv: !wildpkmnpv!
      echo.

      if !wildpkmnpv! LEQ 0 (goto wild-1-victory)

      call :texte 164 170 o

      set /a wildpkmnhit=%random% %%!1 +1
      set /a critical=%random% %%!1 +1

      if '!wildpkmnhit!' == '0' (set /a impactstarter=((2*!starteratt!)/2)*(!critical!+1))
      if '!wildpkmnhit!' == '1' (set /a impactstarter=((3*!starteratt!)/2)*(!critical!+1))
      set /a starterpv=!starterpv!-(!impactstarter!-!starterdef!)

      if '!critical!' == '0' (echo !starter! lost !impactstarter! pv)
      if '!critical!' == '1' (call :texte 171 172 o)

      call :texte 173 175 o

      if !starterpv! LEQ 0 (goto gameover)

      goto wildpokemon-battle

      :wild-1-victory
      cls
      call :combat !wildpkmn! !wildpkmnlvl! 0 !starter! !starterlvl! !starterpv!
      call :texte 176 192 o

      for %%M in (lvl att def) do (set /a starter%%M+=1)
      for %%N in (pv spd spatt spdef) do (set /a starter%%N=10*!starter%%N!+1)

      call :texte 193 199 o
      pause
      goto Rienna

      :gameover
      cls
      call :combat !wildpkmn! !wildpkmnlvl! !wildpkmnpv! !starter! !starterlvl! 0
      echo !starter! s'est évanoui
      echo Vous n'avez plus de Pokemon
      echo Vous retournez à la ville de Maribou
      goto start

      :Rienna
      ::Rienna city
      cls & set city2option=0
      call :texte 217 222 o
      pause
      set /p city2option="Votre choix : "

      if '!city2option!' == '1' (goto city2-1)
      if '!city2option!' == '2' (goto city2-2)
      if '!city2option!' == '3' (goto city2-3)
      if '!city2option!' == '4' (goto city2-4)

      pause
      exit

      :choix_pokemon
      cls
      echo \---------------------------------------------------\
      echo \ %1 (Lvl 4)
      echo \---------------------------------------------------\
      echo.
      echo Professeur Chêne: Voulez-vous choisir %1 ?
      set yno=n
      if /i %1 == Pikachu (echo Soyez prudent, ce pokemon est très énergique.)
      echo (Appuyez sur "y" pour choisir %1)
      echo. & set /p yno="Réponse: "
      if /i "!yno!"=="y" (set starter=%1 & set /a choix=1)
      goto :eof

      :texte
      for /L %%E in (%1,1,%2) do (
      ping -n 1 localhost > nul
      if %3 == o (echo. & echo.!ContentLine%%E!)
      if %3 == n (echo.!ContentLine%%E!)
      )
      goto :eof

      :combat
      echo \---------------------------------------------------\
      echo \ %1 (Lvl %2)
      echo \---------------------------------------------------\
      echo.
      echo pv: %3
      echo.
      echo.
      echo \---------------------------------------------------\
      echo \ %4 (Lvl %5)
      echo \---------------------------------------------------\
      echo.
      echo pv: %6
      echo.
      echo.
      goto :eof
      rem


      Voilà le fichier texte :

      1#\---------------------------------------------------\
      2# \ PokeBatch - L'expérience Pokemon en Batch \
      3# \---------------------------------------------------\
      4#(Professeur Chêne approche)
      5#Professeur Chêne: Salut. Mon nom est Professeur Chêne.
      6#Professeur Chêne: Bienvenue dans le monde merveilleux des Pokemon ^!
      7#Professeur Chêne: Je ne me souviens pas de votre nom. Quel est-il ?
      8#Salut, c'est agréable de te (re)voir ^!
      9#Professeur Chêne: Qu'attendez-vous donc ? Choisissez votre pokemon ^!
      10#Professeur Chêne: Oh, attendez, il y en a encore un...
      11#Professeur Chêne: Félicitation ^! Vous êtes maintenant un formateur Pokemon ^!
      12#Prenez ceci avec vous.
      13#(Pokegear reçue)
      14#Professeur Chêne: Ceci peut vous aider.
      15#Professeur Chêne: Maintenant, votre journée commence.
      16#Professeur Chêne: Collectez des badges de gymnastique et participez à la Pokemon League.
      17#Professeur Chêne: Bonne chance !
      18#Vous êtes dans la ville de Maribou
      19#Entrez un numéro pour sélectionner une option (1,2,3,4)
      20#1) Aller à votre maison
      21#2) Aller au Pokemon Center
      22#3) Aller au Pokemon Lab
      23#4) Aller à l'herbe haute pour quitter la ville de Maribou
      24#\---------------------------------------------------\
      25# \ La maison \
      26# \---------------------------------------------------\
      27# __^!^!_______________
      28# / ^!^! /\\
      29# / /__\ / \\
      30# /_________________/ \\
      31# ^! ^! /\ ^!
      32# ^! ^! / \ ^!
      33# ^!________________^! ^! ^! ^!
      34#
      35#Vous êtes dans votre maison
      36#Entrez un numéro pour choisir une option (1,2,3)
      37#1) Appeler votre Maman
      38#2) Manger les restes du repas
      39#3) Retourner à la ville
      40#Maman: Je vous déteste vous et votre père inconnu ^!
      41#Maman: Vous partez dans le monde à pied pendant des années et vous ne revenez jamais ^!
      42#Maman: Au moins, prenez ces chaussures de course.
      43#Maman: Elles n'auront aucun effet sur PokeBatch mais je vous les donne juste pour ne pas que vous vous plainiez.
      44#Maman: Quel est le problème ? Vous avez rapporté quelque chose pour moi ?
      45#Maman: Non ? Alors, sortez de ma maison ^! :D
      46#Maman: Quel est le problème ? Avez-vous apporté quelque chose pour moi ?
      47#Maman: Ooooh ^! C'est un diamant ENORME ^! Je vous aime presque ^! :)
      48#(Le diamant est donné à Maman)
      49#Maman: Prenez cette pierre de feu de la collection de votre père.
      50#(Vous avez reçu la pierre de feu)
      51#Maman: Avez-vous apporté quelque chose d'autre pour moi ?
      52#Non ? Oh bien, pensez que je vous hais encore. :)
      53#Maman: Bien ? Qu'Est-ce que c'est ? Une surprise que vous dites ?
      54#(Le collier de Jade est remis à Maman)
      55#Maman: Je vous aime ^!^!^!
      56#Maman: Vous méritez cette allée Arc-En-Ciel ^!
      57#(Vous avez reçu l'allée Arc-En-Ciel)
      58#Maman: Permettez-moi de lire ce que votre père a écrit :
      59#"Seul un vrai Pokemon Champion peut utiliser cette allée Arc-En-Ciel"
      60#"Le légendaire Ho-Oh apparaîtra devant celui qui est pur de cœur et a une forte volonté."
      61#"Il doit se rendre au clocher de la ville de Vicarian à la fois."
      62#"Mais il y a une chose que tu devrais sav... "
      63#Maman: Et le reste est illisible. Votre père fou et ses divagations sur un pokemon légendaire sont absolument idiotes.
      64#Maman: Vous savez quoi ? Vous n'êtes pas si mauvais :)
      65#Maman: Qu'est-ce que ... Est-ce un Ho-Oh ? :O
      66#Maman: Cela signifie que votre père n'était pas un fou ^!
      67#Vous avez mangé beaucoup ^! Miam miam ^!
      68#Vous êtes mort de fatigue ^! Qu'est-ce qu'il y avait dans cette nourriture ?
      69#Vous vous réveillez 12 heures plus tard. Votre pokemon a récupéré son pv.
      70#\---------------------------------------------------\
      71# \ Pokemon Center \
      72# \---------------------------------------------------\
      73#
      74# ___________________
      75# /___________________\
      76# ^! //_\\ ^!
      77# ^!_______\\_//_______^!
      78# ^! ^! ___ ^! ^!
      79# ^! ^! ^! ^! ^! ^!
      80# ^!_____^! ^!___^! ^!_____^!
      81#
      82#Vous êtes à l'intérieur du Pokemon Center
      83#Entrez un numéro pour choisir une option (1,2,3)
      84#1) Reprenez votre pokémon guéri par Nurse Joy
      85#2) Recevoir d'autres services de Nurse Joy
      86#3) Retourner en ville
      87#Nurse Joy: Votre pokemon n'a pas l'air en très bon état...
      88#Nurse Joy: Laissez-moi le soigner ici avec beaucoup d'amour ;)
      89#Nurse Joy: Ici, petit, tu seras mieux que jamais !
      90#Regénération de votre pokemon en cours ...
      91#Votre pokemon a retrouvé son pv
      92#Vous: Hey Joy, que diriez-vous de me montrer vos "Pokemons" ?
      93#Nurse Joy: Je ne pense pas que vous êtes suffisamment formé pour les gérer.
      94#Nurse Joy: Décampez comme un Beedrill avant que je ne vous batte au combat ^!
      95#(Vous vous rendez en ville en vous cachant le visage)
      96#\---------------------------------------------------\
      97# \ Pokemon Lab \
      98# \---------------------------------------------------\
      99#
      100# _______
      101# . .
      102# / //_\\ \
      103# ^!_______\\ //_______^!
      104# /___________________\
      105# ^! ^! ___ ^! ^!
      106# ^! ^! / \ ^! ^!
      107# ^!_____^! ^!___^! ^!_____^!
      108#
      109#Vous êtes à l'intérieur du Pokemon Lab
      110#Entrez un numéro pour choisir une option (1,2)
      111#1) Appeller le professeur Chêne
      112#2) Retourner en ville
      113#Professeur Chêne: Oh salut toi, je suis un peu occupé en ce moment.
      114#Professeur Chêne: Revenez après avoir gagné un lot de Gym.
      115#\---------------------------------------------------\
      116# \ Herbes hautes \
      117# \---------------------------------------------------\
      118#
      119# )\ )\ )\ )\ /( (\ )\ )\ )\ /( /( )\ (\ (\ /) )\
      120# /( /( )\ (\ (\ /) )\ )\ )\ )\ )\ /( (\ )\ )\ )\
      121# )\ (\ (\ /) )\ (\ )\ )\ )\ /( /( )\ )\ )\ )\ /( (\
      122#
      123#Vous êtes sorti de la ville de Maribou.
      124#Comme votre ville est très petite, vous pouvez déjà voir la ville de Rienna.
      125#La ville de Rienna est célèbre pour ses baies et son herbe pokémon.
      126#
      127#Vous marchez dans les hautes herbes.
      128#Il y a quelque chose sous vos pieds...
      129#Un pokemon sauvage est apparu ^!
      130#
      131#!wildpkmn!: !wildpkmn!
      132#
      133#Vous: Go !starter! Je te choisis ^!
      134#!starter!: !starter!
      135#\---------------------------------------------------\
      136# \ !wildpkmn! (Lvl !wildpkmn-lvl!) \
      137# \---------------------------------------------------\
      138#
      139#pv: !wildpkmn-pv!
      140#
      141#
      142#\---------------------------------------------------\
      143# \ !starter! (Lvl !starter-lvl!) \
      144# \---------------------------------------------------\
      145#
      146#pv: !starter-pv!
      147#
      148#
      149#Que voulez-vous faire ?
      150#
      151#Entrez un numéro pour choisir une option (1,2)
      152#1) Tackle Attack
      153#2) Mordre
      154#3) Courir
      155#\---------------------------------------------------\
      156# \ !wildpkmn! (Lvl !wildpkmn-lvl!) \
      157# \---------------------------------------------------\
      158#
      159#pv: !wildpkmn-pv!
      160#Niveau de vie critique !
      161#!wildpkmn! lost !impact-wildpkmn! pv
      162#pv: !wildpkmn-pv!
      163#
      164#\---------------------------------------------------\
      165# \ !starter! (Lvl !starter-lvl!) \
      166# \---------------------------------------------------\
      167#
      168#pv: !starter-pv!
      169#
      170#
      171#Niveau de vie critique !
      172#!starter! lost !impact-starter! pv
      173#pv: !starter-pv!
      174#
      175#
      176#\---------------------------------------------------\
      177# \ !wildpkmn! (Lvl !wildpkmn-lvl!) \
      178# \---------------------------------------------------\
      179#
      180#pv: 0
      181#
      182#
      183#\---------------------------------------------------\
      184# \ !starter! (Lvl !starter-lvl!) \
      185# \---------------------------------------------------\
      186#
      187#pv: !starter-pv!
      188#
      189#
      190#!wildpkmn! s'est évanoui
      191#
      192#!starter! a gagné 100 points d'expérience
      193#!starter! niveau atteint !starter-lvl!
      194#Le niveau de pv de votre !starter! augmente à !starter-pv!
      195#Le niveau d'attaque de votre !starter! augmente à !starter-att!
      196#Le niveau de défense de votre !starter! augmente à !starter-def!
      197#La vitesse de votre !starter! augmente à !starter-spd!
      198#La rapidité d'attaque de votre !starter! augmente à !starter-spatt!
      199#La rapidité de défense de votre !starter! augmente à !starter-spdef!
      200#\---------------------------------------------------\
      201# \ !wildpkmn! (Lvl !wildpkmn-lvl!) \
      202# \---------------------------------------------------\
      203#
      204#pv: !wildpkmn-pv!
      205#
      206#
      207#\---------------------------------------------------\
      208# \ !starter! (Lvl !starter-lvl!) \
      209# \---------------------------------------------------\
      210#
      211#pv: 0
      212#
      213#
      214#!starter! S'est évanoui
      215#Vous n'avez plus de Pokemon
      216#!name! retourne à la ville de Maribou
      217#Vous êtes dans Rienna city
      218#Entrez un numéro pour choisir une option (1,2,3,4)
      219#1) Parler au campeur
      220#2) Aller à la fontaine
      221#3) Aller au carrefour
      222#4) Aller au Pokemon Center
      0
    2. jojorealisateur Messages postés 214 Statut Membre 18
       
      Et comment on fait pour faire
      call dutexte
      qui est dans un autre fichier ???
      0
      1. barnabe0057 Messages postés 14329 Date d'inscription   Statut Contributeur Dernière intervention   4 930 > jojorealisateur Messages postés 214 Statut Membre
         
        On appelle la fonction nommée :texte en indiquant le numéro de ligne de début et le numéro de ligne de fin.
        0
    3. jojorealisateur Messages postés 214 Statut Membre 18
       
      Merci beaucoup !
      0
    4. Alvin1614 Messages postés 115 Statut Membre 4
       
      Bonjour, est-ce que le déboguagage est terminé ?
      0