'********************************************************************
' Creat By Alexandre Lomuto                                         *
' atomose.fr                                                        *
' Créé avec : LibertyBasic 4.5(pro edition)                         *
'********************************************************************

    Version$ = "0.953 alpha 1"
    version = 1 : langue$ = "Français"
    nomainwin

[start]
if main1 = 1 then close #main
main1 = 1 : load = 0
WindowWidth = 800 : WindowHeight = 600
BackgroundColor$ = "white" : ForegroundColor$ = "black"
UpperLeftX=int((DisplayWidth-WindowWidth)/2) : UpperLeftY=int((DisplayHeight-WindowHeight)/2)
graphicbox #main.map, 0, 0, WindowWidth, WindowHeight

button #main.fr, "Fr", [fr],UL 15,545,20,20
button #main.en, "En", [en],UL 40,545,20,20

if version = 1 then
    button #main.a, "COMMENCER", [GameStart],UL 325,200,150,45
    button #main.b, "CHARGER", [load],UL 325,260,150,45
    button #main.d, "AIDE", [help],UL 325,320,150,45
    button #main.e, "QUITTER", [quit],UL 325,400,150,45
end if
if version = 2 then
    button #main.a, "START", [GameStart],UL 325,200,150,45
    button #main.b, "LOAD", [load],UL 325,260,150,45
    button #main.d, "HELP", [help],UL 325,320,150,45
    button #main.e, "QUIT", [quit],UL 325,400,150,45
end if

open " " for window_nf as #main
#main, "trapclose [quit]"
#main.map , "down"
print #main, "font Times New Roman 12 bold; color black"
print #main.map, "font Times New Roman 7; color black"
if version = 1 then print #main.map, "place 340 550 ;\"; "Jeu créé par Alexandre Lomuto "
if version = 2 then print #main.map, "place 335 550 ;\"; "Game creat by Alexandre Lomuto "
print #main.map, "place 336 125 ;\"; "Version : ";Version$; " - ";langue$
print #main.map, "font Times New Roman 40; color black"
print #main.map, "place 200 100 ;\"; "Sword Art Offline"
print #main.fr, "!font Times New Roman 8"
print #main.en, "!font Times New Roman 8"
wait

[w]
wait
[fr]
version = 1 : langue$ = "Français" : goto [start]
[en]
version = 2 : langue$ = "English"  : goto [start]

[help]
if main1 = 1 then close #main
main1 = 1
graphicbox #main.map, 0, 0, WindowWidth, WindowHeight
if version = 2 then button #main.back, "BACK", [start],UL 20,530,120,25
if version = 1 then button #main.back, "RETOUR", [start],UL 20,530,120,25
open " " for window_nf as #main
#main, "trapclose [quit]"
print #main.map, "font Times New Roman 9; color black"
print #main.map, "place 20 30 ;\"; "Sword Art Offline : Aide ---------------------------------------------------------- "
print #main.map, "place 20 60 ;\"; "Vous commencez sans équipement au niveau le plus bas du donjon, le niveau 1. Une fois que vous aurez choisi votre personnage partez explorer la carte \pour vous entrainer et augmenter votre niveau.Allez en ville pour acheter armes et armures dans les boutiques ou améliorer votre équipement chez le forgeron.\\Soignez vous chez la soigneuse si besoin. Lorsque vous serez suffisament fort, allez jusqu'au donjon et affronter ses gardiens jusqu'au boss de palier qui vous \permettra d'aller au niveau suivant.\\\Toute fois, faite attention... Chaque mort dans ce jeu sera.... définitive !"
print #main.map, "place 20 400 ;\"; "Sword Art Offline : About the game ----------------------------------------------- "
print #main.map, "place 20 430 ;\"; "This game is make by Alexandre Lomuto. Freeware : This game is free and can be copied as needed. This software is on open source, you can take or change \elements as you want."
print #main.map, "place 20 475 ;\"; "Version ";Version$;"\Production 2016\All copyrights reserved "
print #main, "font Times New Roman 10 bold"
wait

[quit]
if bag = 1 then close #main6 : bag = 0
close #main
end

[SimpleClick1]
print #main.map, "font Times New Roman 9"
print #main.map, "place 35 90 ;\"; "Atk : 10"
print #main.map, "place 35 110 ;\"; "Def : 2"
print #main.map, "place 35 130 ;\"; "Hp : 46"
print #main.map, "place 35 150 ;\"; "Pm : 11"
print #main.map, "place 25 190 ;\"; "Money at start : 30"
print #main.map, "place 35 250 ;\"; "Agi : 8"
print #main.map, "place 35 270 ;\"; "Str : 11"
print #main.map, "place 35 290 ;\"; "Int : 6"
return
[SimpleClick2]
print #main.map, "font Times New Roman 9"
print #main.map, "place 190 90 ;\"; "Atk : 12"
print #main.map, "place 190 110 ;\"; "Def : 1"
print #main.map, "place 190 130 ;\"; "Hp : 37"
print #main.map, "place 190 150 ;\"; "Pm : 25"
print #main.map, "place 180 190 ;\"; "Money at start : 40"
print #main.map, "place 190 250 ;\"; "Agi : 14"
print #main.map, "place 190 270 ;\"; "Str : 8"
print #main.map, "place 190 290 ;\"; "Int : 10"
return
[SimpleClick3]
print #main.map, "font Times New Roman 9"
print #main.map, "place 350 90 ;\"; "Atk : 7"
print #main.map, "place 350 110 ;\"; "Def : 4"
print #main.map, "place 350 130 ;\"; "Hp : 88"
print #main.map, "place 350 150 ;\"; "Pm : 5"
print #main.map, "place 340 190 ;\"; "Money at start : 25"
print #main.map, "place 350 250 ;\"; "Agi : 7"
print #main.map, "place 350 270 ;\"; "Str : 16"
print #main.map, "place 350 290 ;\"; "Int : 5"
return
[SimpleClick4]
print #main.map, "font Times New Roman 9"
print #main.map, "place 520 90 ;\"; "Atk : 4"
print #main.map, "place 520 110 ;\"; "Def : 2"
print #main.map, "place 520 130 ;\"; "Hp : 31"
print #main.map, "place 520 150 ;\"; "Pm : 26"
print #main.map, "place 510 190 ;\"; "Money at start : 225"
print #main.map, "place 520 250 ;\"; "Agi : 6"
print #main.map, "place 520 270 ;\"; "Str : 5"
print #main.map, "place 520 290 ;\"; "Int : 14"
return
[SimpleClick5]
print #main.map, "font Times New Roman 9"
print #main.map, "place 680 90 ;\"; "Atk : 5"
print #main.map, "place 680 110 ;\"; "Def : 1"
print #main.map, "place 680 130 ;\"; "Hp : 38"
print #main.map, "place 680 150 ;\"; "Pm : 55"
print #main.map, "place 670 190 ;\"; "Money at start : 55"
print #main.map, "place 680 250 ;\"; "Agi : 5"
print #main.map, "place 680 270 ;\"; "Str : 5"
print #main.map, "place 680 290 ;\"; "Int : 25"
return

[GameStart]
if main1 = 1 then close #main
main1 = 1
campagne = 1
RACE$ = "WARRIOR" : RACEname$ = "GUERRIER"
WindowWidth = 800 : WindowHeight = 600
UpperLeftX=int((DisplayWidth-WindowWidth)/2) : UpperLeftY=int((DisplayHeight-WindowHeight)/2)
graphicbox #main.map, 0, 0, WindowWidth, WindowHeight
button #main.selection, RACEname$, [RACE],UL 320,380,150,40
button #main.random, "ALÉATOIRE", [randomGAME],UL 320,450,150,40
if version = 2 then button #main.back, "BACK", [start],UL 320,500,150,40
if version = 1 then button #main.back, "RETOUR", [start],UL 320,500,150,40
open "Sword Art Offline" for window_nf as #main
#main, "trapclose [quit]"
print #main.map, "when leftButtonDown [SimpleClick0]"
print #main.map, "down;color black;font Times New Roman 9"
if version = 2 then
    print #main.map, "place 25 330 ;\"; "WARRIOR"
    print #main.map, "place 25 20 ;\"; "ARCHER"
    print #main.map, "place 33 20 ;\"; "TANK"
    print #main.map, "place 25 20 ;\"; "ARTISAN"
    print #main.map, "place 25 20 ;\"; "WIZARD"
end if
if version = 1 then
    print #main.map, "place 45 340 ;\"; "GUERRIER"
    print #main.map, "place 200 340 ;\"; "ARCHER"
    print #main.map, "place 375 340 ;\"; "TANK"
    print #main.map, "place 537 340 ;\"; "ARTISAN"
    print #main.map, "place 690 340 ;\"; "SORCIER"
end if

print #main.map, "font Times New Roman 15"
print #main, "font Times New Roman 9 bold"
if version = 2 then print #main.map, "place 240 40 ;\"; "SELECT YOU CHARACTER'S CLASS"
if version = 1 then print #main.map, "place 180 40 ;\"; "SELECTIONNEZ LA CLASSE DE VOTRE PERSONNAGE"
print #main.map, "size 1"
print #main.map, "line "; 0; " "; 70; " "; 800; " "; 70
print #main.map, "line "; 0; " "; 310; " "; 800; " "; 310
print #main.map, "line "; 150; " "; 70; " "; 150; " "; 310
print #main.map, "line "; 310; " "; 70; " "; 310; " "; 310
print #main.map, "line "; 480; " "; 70; " "; 480; " "; 310
print #main.map, "line "; 640; " "; 70; " "; 640; " "; 310
print #main.map, "line "; 20; " "; 65; " "; 130; " "; 65
print #main.map, "line "; 20; " "; 315; " "; 130; " "; 315
gosub [SimpleClick1]
gosub [SimpleClick2]
gosub [SimpleClick3]
gosub [SimpleClick4]
gosub [SimpleClick5]
wait

    [SimpleClick0]
    mX = MouseX
    mY = MouseY
    'notice mX;" / ";mY
    if mX<150 and mY>70 and mY<310 then
        campagne = 1
        RACE$ = "WARRIOR"
        print #main.map, "size 1; color white"
        print #main.map, "line "; 175; " "; 65; " "; 770; " "; 65
        print #main.map, "line "; 175; " "; 315; " "; 770; " "; 315
        print #main.map, "color black"
        print #main.map, "line "; 20; " "; 65; " "; 130; " "; 65
        print #main.map, "line "; 20; " "; 315; " "; 130; " "; 315
    end if
    if mX>150 and mX<310 and mY>70 and mY<310 then
        campagne = 2
        RACE$ = "ARCHER"
        print #main.map, "size 1; color white"
        print #main.map, "line "; 20; " "; 65; " "; 770; " "; 65
        print #main.map, "line "; 20; " "; 315; " "; 770; " "; 315
        print #main.map, "color black"
        print #main.map, "line "; 175; " "; 65; " "; 285; " "; 65
        print #main.map, "line "; 175; " "; 315; " "; 285; " "; 315
    end if
    if mX>310 and mX<480 and mY>70 and mY<310 then
        campagne = 3
        RACE$ = "TANK"
        print #main.map, "size 1; color white"
        print #main.map, "line "; 20; " "; 65; " "; 770; " "; 65
        print #main.map, "line "; 20; " "; 315; " "; 770; " "; 315
        print #main.map, "color black"
        print #main.map, "line "; 340; " "; 65; " "; 450; " "; 65
        print #main.map, "line "; 340; " "; 315; " "; 450; " "; 315
    end if
    if mX>480 and mX<640 and mY>70 and mY<310 then
        campagne = 4
        RACE$ = "ARTISAN"
        print #main.map, "size 1; color white"
        print #main.map, "line "; 20; " "; 65; " "; 770; " "; 65
        print #main.map, "line "; 20; " "; 315; " "; 770; " "; 315
        print #main.map, "color black"
        print #main.map, "line "; 510; " "; 65; " "; 620; " "; 65
        print #main.map, "line "; 510; " "; 315; " "; 620; " "; 315
    end if
    if mX>640 and mY>70 and mY<310 then
        campagne = 5
        RACE$ = "WIZARD"
        print #main.map, "size 1; color white"
        print #main.map, "line "; 20; " "; 65; " "; 770; " "; 65
        print #main.map, "line "; 20; " "; 315; " "; 770; " "; 315
        print #main.map, "color black"
        print #main.map, "line "; 660; " "; 65; " "; 770; " "; 65
        print #main.map, "line "; 660; " "; 315; " "; 770; " "; 315
    end if

    if version = 1 and RACE$ = "WARRIOR" then RACEname$ = "GUERRIER"
    if version = 2 and RACE$ = "WARRIOR" then RACEname$ = "WARRIOR"
    if version = 1 and RACE$ = "WIZARD" then RACEname$ = "SORCIER"
    if version = 2 and RACE$ = "WIZARD" then RACEname$ = "WIZARD"
    if RACE$ = "ARCHER" then RACEname$ = "ARCHER"
    if RACE$ = "TANK" then RACEname$ = "TANK"
    if RACE$ = "ARTISAN" then RACEname$ = "ARTISAN"
    print #main.selection, RACEname$
    Wait

[RACE]
LvlDONJON = 0
gosub [FLOOR]
Select case campagne
case 1
    goto [GameHUMAN]
case 2
    goto [GameELVE]
case 3
    goto [GameORCS]
case 4
    goto [GameDWARF]
case 5
    goto [GameNECRO]
case 6
    goto [randomGAME]
end select
wait
[randomGAME]
val = int(rnd(1)*5)+1
if val < 1 then goto [randomGAME]
campagne = val
gosub [data]
goto [RACE]

[GameHUMAN]
capacity$ = "Strength" : RACE$ = "WARRIOR" : gosub [data] : goto [GameStartMAIN]
[GameELVE]
capacity$ = "Agility" : RACE$ = "ARCHER" : gosub [data] : goto [GameStartMAIN]
[GameORCS]
capacity$ = "Strength" : RACE$ = "TANK" : gosub [data] : goto [GameStartMAIN]
[GameDWARF]
capacity$ = "Strength" : RACE$ = "ARTISAN" : gosub [data] : goto [GameStartMAIN]
[GameNECRO]
capacity$ = "Intelligence" : RACE$ = "WIZARD" : gosub [data] : goto [GameStartMAIN]

[GameStartMAIN]
if main1 = 1 and load = 0 then close #main
main1 = 1 : load = 0
WindowWidth = 850 : WindowHeight = 600
UpperLeftX=int((DisplayWidth-WindowWidth)/2) : UpperLeftY=int((DisplayHeight-WindowHeight)/2)
if NumberFLOORmonster <= 0 then BOSS = 1
graphicbox #main.map, 0, 0, WindowWidth, WindowHeight
if version = 1 then
    if BOSS = 1 then statutDONJON$ = "BOSS chalenge"
    if BOSS = 0 then statutDONJON$ = "Exploration"
    button #main.back2, "ALLER EN VILLE", [City],UL 330,430,160,40
    button #main.back3, "ALLER SUR CARTE", [Arena0],UL 330,480,160,40
    button #main.save, "SAUVER", [save],LR 100,520,90,25
    button #main.load, "CHARGER", [load],LR 100,490,90,25
end if
if version = 2 then
    if BOSS = 1 then statutDONJON$ = "BOSS chalenge"
    if BOSS = 0 then statutDONJON$ = "Explore"
    button #main.back2, "GO TO CITY", [City],UL 330,430,150,40
    button #main.back3, "GO TO MAP", [Arena0],UL 330,480,150,40
    button #main.save, "SAVE", [save],LR 100,520,90,25
    button #main.load, "LOAD", [load],LR 100,490,90,25
end if
if PoP > 0 then
    button #main.back, "+", [PoPint],UL 100,178,15,15
    button #main.back, "+", [PoPstr],UL 100,164,15,15
    button #main.back, "+", [PoPagi],UL 100,150,15,15
end if

open "Sword Art Offline" for window_nf as #main
#main.map , "down;backcolor white"
#main, "trapclose [quit]"
print #main.map, "font Times New Roman 8; color black"
if PoP > 0 and version = 1 then
    print #main.map, "place 10 160 ;\"; "Agilité : ";Agility
    print #main.map, "place 10 175 ;\"; "Force : ";Strength
    print #main.map, "place 10 190 ;\"; "Intelligence : ";intelligence
    print #main.map, "place 10 140 ;\"; "Points de caractéristique disponibles : "; PoP
end if
if PoP > 0 and version = 2 then
    print #main.map, "place 10 160 ;\"; "Agility : ";Agility
    print #main.map, "place 10 175 ;\"; "Strength : ";Strength
    print #main.map, "place 10 190 ;\"; "Intelligence : ";intelligence
    print #main.map, "place 10 140 ;\"; "Points of capability available : "; PoP
end if
print #main.map, "place 10 20 ;\"; "CLASSE : ";RACEname$
print #main.map, "place 10 40 ;\"; "Niveau  : "; lvl
print #main.map, "place 10 52 ;\"; "Expérience  : ";xp;" / ";xpTOTAL
print #main.map, "place 10 70 ;\"; "Santé  : ";pv;" / ";pvTOTAL
print #main.map, "place 10 82 ;\"; "Armure : "; def
print #main.map, "place 10 94 ;\"; "Mana  : ";pm;" / ";pmTOTAL
print #main.map, "place 10 110 ;\"; "Argent  : ";money
print #main.map, "size 1 ; color black"
print #main.map, "line "; 300; " "; 300; " "; 370; " "; 140
print #main.map, "line "; 480; " "; 300; " "; 410; " "; 140
print #main.map, "line "; 438; " "; 360; " "; 545; " "; 305
print #main.map, "line "; 234; " "; 305; " "; 340; " "; 360
print #main.map, "place "; 390; " "; 140
print #main.map, "ellipse "; 40 ; " "; 7
print #main.map, "place "; 390; " "; 300
print #main.map, "ellipse "; 183 ; " "; 20
print #main.map, "place "; 390; " "; 300
print #main.map, "ellipse "; 320 ; " "; 50
print #main.map, "place "; 390; " "; 360
print #main.map, "ellipse "; 100 ; " "; 25
print #main.map, "font Times New Roman 10; color black"
print #main.map, "place 240 270 ;\"; "City level"
print #main.map, "line "; 270; " "; 274; " "; 275; " "; 295
print #main.map, "place 250 190 ;\"; "Donjon levels"
print #main.map, "line "; 270; " "; 195; " "; 370; " "; 200
print #main.map, "place 600 305 ;\"; "Starting game level"
print #main.map, "line "; 550; " "; 300; " "; 590; " "; 300
print #main.map, "place 490 135 ;\"; "End of the game here"
print #main.map, "line "; 495; " "; 135; " "; 495; " "; 135
print #main.map, "line "; 490; " "; 140; " "; 490; " "; 295
print #main.map, "line "; 487; " "; 140; " "; 493; " "; 140
print #main.map, "line "; 487; " "; 295; " "; 493; " "; 295
print #main.map, "place 500 220 ;\"; "100 Lvl of donjon"
print #main.map, "font Times New Roman 30 bold; color black"
if version = 1 then print #main.map, "place 350 60 ;\"; "Palier ";LvlDONJON
if version = 2 then print #main.map, "place 350 60 ;\"; "Floor ";LvlDONJON
print #main, "font Times New Roman 11"
wait

[PoPint]
print #main.map, "font Times New Roman 8; color black"
if PoP >0 then
    intelligence = intelligence + 1
    PoP = PoP - 1
    pm = int(pm+1)
    pmTOTAL = int(pmTOTAL+1)
    PMregen = int(PMregen + int(0.25*pm)/12)
    if version = 1 then
        print #main.map, "place 10 94 ;\"; "Mana  : ";pm;" / ";pmTOTAL;"        "
        print #main.map, "place 10 190 ;\"; "Intelligence : ";intelligence;"     "
        print #main.map, "place 10 140 ;\"; "Points de caractéristique disponibles : "; PoP;"       "
    end if
    if version = 2 then
        print #main.map, "place 10 94 ;\"; "Mana  : ";pm;" / ";pmTOTAL;"        "
        print #main.map, "place 10 190 ;\"; "Intelligence : ";intelligence;"     "
        print #main.map, "place 10 140 ;\"; "Points of capabilities available : "; PoP;"       "
    end if
    if capacity$ = "Intelligence" then atk = atk + 1 : pm = int(pm+1) : pmTOTAL = int(pmTOTAL+1)
end if
if PoP = 0 then goto [GameStartMAIN]
wait
[PoPstr]
print #main.map, "font Times New Roman 8; color black"
if PoP >0 then
    Strength = Strength + 1
    PoP = PoP - 1
    atk = int(atk+1)
    pv = int(pv+2)
    pvTOTAL = int(pvTOTAL+2)
    if version = 2 then
        print #main.map, "place 10 175 ;\"; "Strength : ";Strength
        print #main.map, "place 10 70 ;\"; "Heal : ";pv;" / ";pvTOTAL;"        "
        print #main.map, "place 10 140 ;\"; "Points of capability available : "; PoP;"       "
    end if
    if version = 1 then
        print #main.map, "place 10 175 ;\"; "Force : ";Strength
        print #main.map, "place 10 70 ;\";  "Santé  : ";pv;" / ";pvTOTAL;"        "
        print #main.map, "place 10 140 ;\"; "Points de caractéristique disponibles : "; PoP;"       "
    end if
    if capacity$ = "Strength" then atk = atk + 1 : pv = int(pv+2) : pvTOTAL = int(pvTOTAL+2)
end if
if PoP = 0 then goto [GameStartMAIN]
wait
[PoPagi]
print #main.map, "font Times New Roman 8; color black"
if PoP >0 then
    Agility = Agility + 1
    PoP = PoP - 1
    def = def+0.25
    if version = 2 then
        print #main.map, "place 10 160 ;\"; "Agility : ";Agility
        print #main.map, "place 10 82 ;\"; "Armor : "; def;"     "
        print #main.map, "place 10 140 ;\"; "Points of capability available : "; PoP;"       "
    end if
    if version = 1 then
        print #main.map, "place 10 160 ;\"; "Agilité : ";Agility
        print #main.map, "place 10 82 ;\"; "Armure : "; def;"     "
        print #main.map, "place 10 140 ;\"; "Points de caractéristique disponibles : "; PoP;"       "
    end if
    if capacity$ = "Agility" then atk = atk + 2 : def = def+0.75
end if
if PoP = 0 then goto [GameStartMAIN]
wait

[City]
if main1 = 1 then close #main
main1 = 1 : donjon = 0 : city = 1
WindowWidth = 800 : WindowHeight = 600
UpperLeftX=int((DisplayWidth-WindowWidth)/2) : UpperLeftY=int((DisplayHeight-WindowHeight)/2)
graphicbox #main.map, 0, 0, WindowWidth, WindowHeight

if version = 2 then
    button #main.back, "", [Armory],UL 580,160,30,40
    button #main.back, "", [Weapon],UL 62,420,30,40
    button #main.back, "", [healer],UL 292,180,60,40
    button #main.back, "", [forgeron],UL 680,355,30,40
    button #main.back, "MAP", [Arena0],UL 350,500,80,40
    button #main.back4, "MENU PRINCIPAL", [GameStartMAIN],UL 10,10,120,30
end if
if version = 1 then
    button #main.back, "", [Armory],UL 580,160,30,40
    button #main.back, "", [Weapon],UL 62,420,30,40
    button #main.back, "", [healer],UL 292,180,60,40
    button #main.back, "", [forgeron],UL 680,355,30,40
    button #main.back, "CARTE", [Arena0],UL 375,520,80,40
    button #main.back4, "MENU PRINCIPAL", [GameStartMAIN],UL 10,10,120,30
end if

open "Sword Art Offline" for window_nf as #main
#main, "trapclose [quit]"
#main.map , "down;backcolor white"
print #main.map, "font Times New Roman 9; color black;size 1"
print #main, "font Times New Roman 10 bold"
print #main.map, "line "; 0; " "; 70; " "; 810; " "; 70

'healer batiment
print #main.map, "font Times New Roman 7; color black"
if version = 1 then print #main.map, "place 305 175 ;\"; "Soigneur"
if version = 2 then print #main.map, "place 305 175 ;\"; "Healer"
print #main.map, "line "; 250; " "; 150; " "; 400; " "; 150
print #main.map, "line "; 250; " "; 150; " "; 280; " "; 120
print #main.map, "line "; 400; " "; 150; " "; 370; " "; 120
print #main.map, "line "; 280; " "; 120; " "; 371; " "; 120
print #main.map, "line "; 250; " "; 150; " "; 250; " "; 220
print #main.map, "line "; 400; " "; 150; " "; 400; " "; 220
print #main.map, "line "; 250; " "; 220; " "; 400; " "; 220
print #main.map, "place 220 220"
print #main.map, "ellipse "; 20 ; " "; 8
print #main.map, "place 220 150"
print #main.map, "ellipse "; 20 ; " "; 8
print #main.map, "line "; 210; " "; 150; " "; 210; " "; 220
print #main.map, "line "; 230; " "; 150; " "; 230; " "; 220
print #main.map, "place 260 120"
print #main.map, "ellipse "; 20 ; " "; 8
print #main.map, "line "; 250; " "; 120; " "; 250; " "; 200
print #main.map, "line "; 270; " "; 120; " "; 270; " "; 130
print #main.map, "place 390 120"
print #main.map, "ellipse "; 20 ; " "; 8
print #main.map, "line "; 400; " "; 120; " "; 400; " "; 200
print #main.map, "line "; 380; " "; 120; " "; 380; " "; 130
print #main.map, "place 430 220"
print #main.map, "ellipse "; 20 ; " "; 8
print #main.map, "place 430 150"
print #main.map, "ellipse "; 20 ; " "; 8
print #main.map, "line "; 420; " "; 150; " "; 420; " "; 220
print #main.map, "line "; 440; " "; 150; " "; 440; " "; 220
print #main.map, "line "; 300; " "; 140; " "; 350; " "; 140
print #main.map, "line "; 300; " "; 140; " "; 300; " "; 130
print #main.map, "line "; 350; " "; 140; " "; 350; " "; 130
print #main.map, "line "; 300; " "; 130; " "; 350; " "; 130
print #main.map, "line "; 315; " "; 115; " "; 335; " "; 115
print #main.map, "line "; 315; " "; 115; " "; 300; " "; 130
print #main.map, "line "; 335; " "; 115; " "; 350; " "; 130

'weapon
print #main.map, "line "; 30; " "; 380; " "; 80; " "; 330
print #main.map, "line "; 80; " "; 330; " "; 100; " "; 330
print #main.map, "line "; 100; " "; 330; " "; 130; " "; 380
print #main.map, "line "; 100; " "; 330; " "; 180; " "; 260
print #main.map, "line "; 180; " "; 260; " "; 220; " "; 300
print #main.map, "line "; 80; " "; 330; " "; 160; " "; 260
print #main.map, "line "; 160; " "; 260; " "; 180; " "; 260
print #main.map, "line "; 220; " "; 300; " "; 130; " "; 380
print #main.map, "line "; 30; " "; 380; " "; 130; " "; 380
print #main.map, "line "; 30; " "; 380; " "; 30; " "; 460
print #main.map, "line "; 130; " "; 380; " "; 130; " "; 460
print #main.map, "line "; 220; " "; 300; " "; 220; " "; 380
print #main.map, "line "; 30; " "; 460; " "; 130; " "; 460
print #main.map, "line "; 130; " "; 460; " "; 220; " "; 380
print #main.map, "line "; 130; " "; 380; " "; 170; " "; 380
print #main.map, "line "; 150; " "; 380; " "; 150; " "; 400
print #main.map, "line "; 150; " "; 400; " "; 170; " "; 400
print #main.map, "line "; 170; " "; 400; " "; 170; " "; 380
print #main.map, "line "; 155; " "; 385; " "; 166; " "; 396
print #main.map, "line "; 162; " "; 395; " "; 166; " "; 391
print #main.map, "line "; 130; " "; 390; " "; 145; " "; 380
if version = 1 then print #main.map, "place 62 415 ;\"; "Armes"
if version = 2 then print #main.map, "place 62 415 ;\"; "Weapons"

'armory
print #main.map, "line "; 570; " "; 150; " "; 570; " "; 200
print #main.map, "line "; 660; " "; 150; " "; 660; " "; 200
print #main.map, "line "; 570; " "; 150; " "; 660; " "; 150
print #main.map, "line "; 570; " "; 150; " "; 600; " "; 110
print #main.map, "line "; 600; " "; 110; " "; 710; " "; 110
print #main.map, "line "; 710; " "; 110; " "; 725; " "; 125
print #main.map, "line "; 660; " "; 150; " "; 690; " "; 130
print #main.map, "line "; 690; " "; 130; " "; 695; " "; 170
print #main.map, "line "; 660; " "; 150; " "; 695; " "; 170
print #main.map, "line "; 690; " "; 130; " "; 757; " "; 120
print #main.map, "line "; 757; " "; 120; " "; 770; " "; 155
print #main.map, "line "; 695; " "; 170; " "; 770; " "; 155
print #main.map, "line "; 695; " "; 170; " "; 695; " "; 220
print #main.map, "line "; 770; " "; 155; " "; 770; " "; 205
print #main.map, "line "; 695; " "; 220; " "; 770; " "; 205
print #main.map, "line "; 570; " "; 200; " "; 660; " "; 200
print #main.map, "line "; 660; " "; 200; " "; 695; " "; 220
if version = 1 then print #main.map, "place 620 165 ;\"; "Armures"
if version = 2 then print #main.map, "place 620 165 ;\"; "Armors"

'forgeron
print #main.map, "place 650 300"
print #main.map, "ellipse "; 10 ; " "; 4
print #main.map, "place 650 380"
print #main.map, "ellipse "; 10 ; " "; 4
print #main.map, "line "; 645; " "; 300; " "; 645; " "; 380
print #main.map, "line "; 654; " "; 300; " "; 654; " "; 380
print #main.map, "place 750 350"
print #main.map, "ellipse "; 10 ; " "; 4
print #main.map, "place 750 430"
print #main.map, "ellipse "; 10 ; " "; 4
print #main.map, "line "; 745; " "; 350; " "; 745; " "; 430
print #main.map, "line "; 754; " "; 350; " "; 754; " "; 430
print #main.map, "line "; 754; " "; 350; " "; 800; " "; 340
print #main.map, "line "; 645; " "; 300; " "; 745; " "; 350
print #main.map, "line "; 645; " "; 298; " "; 800; " "; 270
if version = 1 then print #main.map, "place 677 350 ;\"; "Forgeron"
if version = 1 then print #main.map, "place 675 350 ;\"; "Black-smith"

'place public
print #main.map, "line "; 290; " "; 620; " "; 350; " "; 430
print #main.map, "line "; 530; " "; 620; " "; 480; " "; 430
print #main.map, "size 5 ; color white"
print #main.map, "line "; 213; " "; 217; " "; 227; " "; 217
print #main.map, "line "; 423; " "; 217; " "; 437; " "; 217
print #main.map, "line "; 314; " "; 120; " "; 336; " "; 120
print #main.map, "line "; 750; " "; 428; " "; 750; " "; 355
print #main.map, "line "; 748; " "; 428; " "; 748; " "; 355
print #main.map, "line "; 650; " "; 378; " "; 650; " "; 305
print #main.map, "line "; 648; " "; 378; " "; 648; " "; 305
gosub [arbresVILLE]
#main.map, "flush"
wait

[arbresVILLE]
RandomX = 120 : RandomY = 070 : gosub [tree]
RandomX = 040 : RandomY = 100 : gosub [tree]
RandomX = 150 : RandomY = 180 : gosub [tree]
RandomX = 750 : RandomY = 030 : gosub [tree]
RandomX = 600 : RandomY = 050 : gosub [tree]
RandomX = 500 : RandomY = 148 : gosub [tree]
RandomX = 050 : RandomY = 550 : gosub [tree]
RandomX = 100 : RandomY = 500 : gosub [tree]
RandomX = 200 : RandomY = 490 : gosub [tree]
RandomX = 260 : RandomY = 520 : gosub [tree]
RandomX = 750 : RandomY = 500 : gosub [tree]
RandomX = 540 : RandomY = 565 : gosub [tree]
RandomX = 600 : RandomY = 510 : gosub [tree]
return

        [tree]
        print #main.map, "size 4; color ";0;" ";0;" ";0;";"
        print #main.map, "line "; RandomX; " "; RandomY; " "; RandomX; " "; RandomY+50
        print #main.map, "size 3; color ";220;" ";100;" ";50;";"
        print #main.map, "line "; RandomX; " "; RandomY; " "; RandomX; " "; RandomY+50

        print #main.map, "size 8 ; color ";0;" ";0;" ";0;";"
        print #main.map, "place "; RandomX; " "; RandomY
        print #main.map, "ellipse "; 13 ; " "; 42
        print #main.map, "size 8 ; color ";30;" ";140;" ";60;";"
        print #main.map, "place "; RandomX; " "; RandomY
        print #main.map, "ellipse "; 10 ; " "; 40

        print #main.map, "size 6 ; color ";0;" ";0;" ";0;";"
        print #main.map, "place "; RandomX+4; " "; RandomY+4
        print #main.map, "ellipse "; 8 ; " "; 20
        print #main.map, "size 6 ; color ";30;" ";140;" ";60;";"
        print #main.map, "place "; RandomX+4; " "; RandomY+4
        print #main.map, "ellipse "; 6 ; " "; 18

        print #main.map, "size 6 ; color ";0;" ";0;" ";0;";"
        print #main.map, "place "; RandomX-3; " "; RandomY-3
        print #main.map, "ellipse "; 10 ; " "; 25
        print #main.map, "size 6 ; color ";30;" ";140;" ";60;";"
        print #main.map, "place "; RandomX-3; " "; RandomY-3
        print #main.map, "ellipse "; 8 ; " "; 22
        return


[Armory]
notice " " + chr$(13) + "Not available for now. check new version."
wait
[Weapon]
notice " " + chr$(13) + "Not available for now. check new version."
wait
[forgeron]
notice " " + chr$(13) + "Not available for now. check new version."
wait

[healer]
if main1 = 1 then close #main
main1 = 1
graphicbox #main.map, 0, 0, WindowWidth, WindowHeight
if pv < pvTOTAL then
    button #main.back, "Yes", [heal],UL 300,300,80,25
    button #main.back, "No", [City],UL 400,300,80,25
end if
if pv = pvTOTAL and version = 2 then button #main.back, "BACK", [City],UL 30,520,100,25
if pv = pvTOTAL and version = 1 then button #main.back, "RETOUR", [City],UL 30,520,100,25

open "Sword Art Offline" for window_nf as #main
#main.map , "down;backcolor white"
print #main.map, "font Times New Roman 9; color black"
print #main, "font Times New Roman 10 bold"
if version = 1 then
if pv = pvTOTAL then print #main.map, "place 260 150 ;\"; "Salut, je suis soigneuse. Tu es en pleine santé, reviens me voir si tu es blessé."
if pv < pvTOTAL then print #main.map, "place 250 150 ;\"; "Salut ! Je peux te soigner pour "; int(((pvTOTAL-pv)*2)/3);" d'or . Est ce que cela te va ?"
end if
if version = 2 then
if pv = pvTOTAL then print #main.map, "place 260 150 ;\"; "Hi ! Im a healer. You are full life. I can nothing for you."
if pv < pvTOTAL then print #main.map, "place 250 150 ;\"; "Hi ! Im a healer. I can heal you for "; int(((pvTOTAL-pv)*2)/3);" . Is it okai for you ?"
end if
wait
[heal]
if int(((pvTOTAL-pv)*2)/3) > money and version = 2 then notice " " + chr$(13) + "You need more money !" : goto [City]
if int(((pvTOTAL-pv)*2)/3) > money and version = 1 then notice " " + chr$(13) + "Vous avez beoin de plus d'argent!" : goto [City]
money = money - int(((pvTOTAL-pv)*2)/3)
if version = 2 then notice " " + chr$(13) + "You paid ";int(((pvTOTAL-pv)*2)/3);" Gold. You are now full life !"
if version = 1 then notice " " + chr$(13) + "Vous payez ";int(((pvTOTAL-pv)*2)/3);" D'or. Vous êtes maintenant en pleine santé !"
pv = pvTOTAL
goto [City]

[Arena0]
if action = 1 then wait
timer 0
if main1 = 1 then close #main
main1 = 1 : donjon = 0 : action = 0 : city = 1
WindowWidth = 800 : WindowHeight = 600
UpperLeftX=int((DisplayWidth-WindowWidth)/2) : UpperLeftY=int((DisplayHeight-WindowHeight)/2)
graphicbox #main.map, 0, 0, WindowWidth, WindowHeight
button #main.back1, "Combattre", [Arena],UL 350,320,80,30
button #main.back2, "VILLE", [City],UL 360,450,50,20
button #main.back3, "DONJON", [donjon],UL 188,196,66,25
button #main.back4, "MENU PRINCIPAL", [GameStartMAIN],UL 20,20,120,30
open "Sword Art Offline" for window_nf as #main
#main, "trapclose [quit]"
#main.map , "down"

r = 138 : v = 161 : b = 68
print #main.map, "size 520 ; color ";r;" ";v;" ";b
print #main.map, "line "; 380; " "; 285; " "; 380; " "; 285
print #main.map, "backcolor ";r;" ";v;" ";b
print #main.map, "size 80 ; color ";r;" ";v;" ";b
print #main.map, "line "; 500; " "; 460; " "; 500; " "; 460
print #main.map, "font Times New Roman 9; color black"
if version = 1 then
    print #main.map, "place 360 280 ;\"; "PALLIER ";LvlDONJON
    print #main.map, "place 320 300 ;\"; "MONSTRE NIVEAU 1 à 10"
end if
if version = 2 then
    print #main.map, "place 360 280 ;\"; "FLOOR ";LvlDONJON
    print #main.map, "place 320 300 ;\"; "MONSTER LEVEL 1 TO 10"
end if

print #main, "font Times New Roman 10 bold"
r = 186 : v = 184 : b = 135
print #main.map, "size 80 ; color ";r;" ";v;" ";b
print #main.map, "line "; 220; " "; 210; " "; 220; " "; 210

'carte
print #main.map, "size 2 ; color black"
print #main.map, "place 384 460"
print #main.map, "ellipse "; 70 ; " "; 70
print #main.map, "size 1 ; color black"
print #main.map, "place 220 210"
print #main.map, "ellipse "; 80 ; " "; 80
print #main.map, "place 220 210"
print #main.map, "ellipse "; 85 ; " "; 85
print #main.map, "place 384 460"
print #main.map, "ellipse "; 65 ; " "; 65
print #main.map, "place 380 285"
print #main.map, "ellipse "; 520 ; " "; 520
print #main.map, "place 380 285"
print #main.map, "ellipse "; 525 ; " "; 525
print #main.map, "flush"
wait


[Arena]
timer 0
action = 0
if main1 = 1 then close #main
main1 = 1
gosub [dataENEMI]
graphicbox #main.map, 0, 0, WindowWidth, WindowHeight
button #main.atk, "ATTAQUER", [Attaque],UL 300,420,200,50
button #main.run, "FUIR", [Arena0],UL 360,480,80,25
open "Sword Art Offline" for window_nf as #main
#main.map , "down;backcolor white"
print #main.map, "font Times New Roman 16; color black"
print #main.map, "place 275 50 ;\"; "Floor ";LvlDONJON;" - Land exploration"
print #main.map, "font Times New Roman 8; color black"
print #main, "font Times New Roman 10 bold"
print #main.map, "place 20 135 ;\";"Hp : "; pvENNEMI; " / "; pvTOTALennemi
print #main.map, "place 580 340 ;\"; RACE$;"   |   ";"Lvl : "; lvl
print #main.map, "place 580 355 ;\";"Xp : ";xp;" / ";xpTOTAL
print #main.map, "place 580 370 ;\";"Hp : "; pv; " / "; pvTOTAL;"           "
print #main.map, "place 20 120 ;\"; "Lvl : "; lvlENNEMI
print #main.map, "size 1"
print #main.map, "line "; 19; " "; 148; " "; 221; " "; 148
print #main.map, "line "; 579; " "; 383; " "; 781; " "; 383
print #main.map, "line "; 0; " "; 100; " "; 900; " "; 100
print #main.map, "line "; 0; " "; 400; " "; 900; " "; 400
gosub [DATAlife]
wait

[donjon]
timer 0
if main1 = 1 then close #main
main1 = 1 : city = 0 : donjon = 1 : action = 0
gosub [FLOOR2]
gosub [dataENEMI]
if BOSS = 1 then
    defENNEMI = defBOOS
    atkENNEMI = atkBOOS
    pvENNEMI = pvBOOS
    pvTOTALennemi = pvENNEMI
    xpENNEMI = xpBOSS
    moneyENNEMI = moneyBOSS
end if
graphicbox #main.map, 0, 0, WindowWidth, WindowHeight
button #main.atk, "ATTAQUER", [Attaque],UL 300,420,200,50
button #main.run, "FUIR", [Arena0],UL 360,480,80,25
open "Sword Art Offline" for window_nf as #main
print #main.map , "down;backcolor white"
print #main.map, "font Times New Roman 16; color black"
print #main.map, "place 330 30 ;\"; "Floor level "; LvlDONJON
print #main.map, "font Times New Roman 8; color black"
print #main, "font Times New Roman 10 bold"
print #main.map, "place 20 135 ;\";"Hp : "; pvENNEMI; " / "; pvTOTALennemi
print #main.map, "place 580 340 ;\"; RACE$;"   |   ";"Lvl : "; lvl
print #main.map, "place 580 355 ;\";"Xp : ";xp;" / ";xpTOTAL
print #main.map, "place 580 370 ;\";"Hp : "; pv; " / "; pvTOTAL
if BOSS = 0 then
    print #main.map, "place 20 120 ;\"; "Lvl : "; lvlENNEMI
    print #main.map, "place 300 60 ;\"; "Number of Monster in the floor : "; NumberFLOORmonster
end if
if BOSS = 1 then print #main.map, "place 20 120 ;\"; "BOSS Floor 1"
print #main.map, "size 1"
print #main.map, "line "; 19; " "; 148; " "; 221; " "; 148
print #main.map, "line "; 579; " "; 383; " "; 781; " "; 383
print #main.map, "line "; 0; " "; 100; " "; 900; " "; 100
print #main.map, "line "; 0; " "; 400; " "; 900; " "; 400
gosub [DATAlife]
wait

[DATAlife]
print #main.map, "size 6; color red"
if pvENNEMI > 0 then
    print #main.map, "line "; 20; " "; 145; " "; 220; " "; 145
    print #main.map, "line "; 580; " "; 380; " "; 780; " "; 380
end if

' incrément de 2 par % de pv
print #main.map, "color white"
if pvENNEMI< INT((pvTOTALennemi/100)*100) AND pvENNEMI>= INT((pvTOTALennemi/100)*90) then print #main.map, "line "; 221; " "; 145; " "; 200; " "; 145
if pvENNEMI < INT((pvTOTALennemi/100)*90) AND pvENNEMI >= INT((pvTOTALennemi/100)*80) then print #main.map, "line "; 221; " "; 145; " "; 180; " "; 145
if pvENNEMI < INT((pvTOTALennemi/100)*80) AND pvENNEMI >= INT((pvTOTALennemi/100)*70) then print #main.map, "line "; 221; " "; 145; " "; 160; " "; 145
if pvENNEMI < INT((pvTOTALennemi/100)*70) AND pvENNEMI >= INT((pvTOTALennemi/100)*60) then print #main.map, "line "; 221; " "; 145; " "; 140; " "; 145
if pvENNEMI < INT((pvTOTALennemi/100)*60) AND pvENNEMI >= INT((pvTOTALennemi/100)*50) then print #main.map, "line "; 221; " "; 145; " "; 120; " "; 145
if pvENNEMI < INT((pvTOTALennemi/100)*50) AND pvENNEMI >= INT((pvTOTALennemi/100)*40) then print #main.map, "line "; 221; " "; 145; " "; 100; " "; 145
if pvENNEMI < INT((pvTOTALennemi/100)*40) AND pvENNEMI >= INT((pvTOTALennemi/100)*30) then print #main.map, "line "; 221; " "; 145; " "; 80; " "; 145
if pvENNEMI < INT((pvTOTALennemi/100)*30) AND pvENNEMI >= INT((pvTOTALennemi/100)*20) then print #main.map, "line "; 221; " "; 145; " "; 60; " "; 145
if pvENNEMI < INT((pvTOTALennemi/100)*20) AND pvENNEMI >= INT((pvTOTALennemi/100)*10) then print #main.map, "line "; 221; " "; 145; " "; 40; " "; 145
if pvENNEMI < INT((pvTOTALennemi/100)*10) AND pvENNEMI >= INT((pvTOTALennemi/100)*1) then print #main.map, "line "; 221; " "; 145; " "; 30; " "; 145
if pvENNEMI <= 0 then print #main.map, "line "; 221; " "; 145; " "; 20; " "; 145

if pv< INT((pvTOTAL/100)*100) AND pv>= INT((pvTOTAL/100)*90) then print #main.map, "line "; 781; " "; 380; " "; 760; " "; 380
if pv < INT((pvTOTAL/100)*90) AND pv >= INT((pvTOTAL/100)*80) then print #main.map, "line "; 781; " "; 380; " "; 740; " "; 380
if pv < INT((pvTOTAL/100)*80) AND pv >= INT((pvTOTAL/100)*70) then print #main.map, "line "; 781; " "; 380; " "; 720; " "; 380
if pv < INT((pvTOTAL/100)*70) AND pv >= INT((pvTOTAL/100)*60) then print #main.map, "line "; 781; " "; 380; " "; 700; " "; 380
if pv < INT((pvTOTAL/100)*60) AND pv >= INT((pvTOTAL/100)*50) then print #main.map, "line "; 781; " "; 380; " "; 680; " "; 380
if pv < INT((pvTOTAL/100)*50) AND pv >= INT((pvTOTAL/100)*40) then print #main.map, "line "; 781; " "; 380; " "; 660; " "; 380
if pv < INT((pvTOTAL/100)*40) AND pv >= INT((pvTOTAL/100)*30) then print #main.map, "line "; 781; " "; 380; " "; 640; " "; 380
if pv < INT((pvTOTAL/100)*30) AND pv >= INT((pvTOTAL/100)*20) then print #main.map, "line "; 781; " "; 380; " "; 620; " "; 380
if pv < INT((pvTOTAL/100)*20) AND pv >= INT((pvTOTAL/100)*10) then print #main.map, "line "; 781; " "; 380; " "; 600; " "; 380
if pv < INT((pvTOTAL/100)*10) AND pv >= INT((pvTOTAL/100)*1) then print #main.map, "line "; 781; " "; 380; " "; 590; " "; 380
if pv <=0 then print #main.map, "line "; 781; " "; 380; " "; 580; " "; 380
return

[Attaque]
if action = 1 then wait
dommage = int((rnd(1)*int(atk+1))-defENNEMI)
dommageE = int((rnd(1)*int(atkENNEMI+1))-def/2)
if dommageE< 0 then dommageE = 0
if dommage< 0 then dommage = 0
pvENNEMI = int(pvENNEMI - dommage)
if pvENNEMI < 0 then pvENNEMI = 0
pv = int(pv - dommageE)
if pv < 0 then pv = 0
print #main.map, "color black"
if dommage >= 1 then print #main.map, "place 380 135 ;\"; "-  "; dommage; "       "
if dommage < 1 then print #main.map, "place 380 135 ;\"; "Miss                  "
if dommageE >= 1 then print #main.map, "place 380 370 ;\"; "-  "; dommageE; "       "
if dommageE < 1 then print #main.map, "place 380 370 ;\"; "Miss                   "
gosub [DATAlife]
print #main.map, "color black"
print #main.map, "place 20 135 ;\";"Hp : "; pvENNEMI; " / "; pvTOTALennemi; "       "
print #main.map, "place 580 370 ;\";"Hp : "; pv; " / "; pvTOTAL;"           "
if pv <= 0 then goto [die]
if pvENNEMI <= 0 then goto [ENDattaque]
wait

[die]
notice " " + chr$(13) + "YOU ARE DIED ! YOU HAVE TO RESTART THE GAME ;) !"
dir$ = "" : file$ = "save.ini"
if fileExist(dir$,file$) = 1 then kill "save.ini"
goto [start]

[ENDattaque]
if BOSS = 1 and pv >0 and donjon = 1 then BOSS = 2
action = 1
print #main.map, "place 250 135 ;\"; "                                                                "
print #main.map, "place 250 370 ;\"; "                                                   "
print #main.map, "place 300 250 ;\"; "Victory : + ";xpENNEMI;" Xp and + ";moneyENNEMI;" Money !"
print #main.map, "place 340 265 ;\"; "Wait a seconde ..."
xp = xp +xpENNEMI
[lvlUPsecurity]
if xp >= xpTOTAL then
    gosub [lvlUP]
    if xp >= xpTOTAL then goto [lvlUPsecurity]
end if
money = money +moneyENNEMI
if city = 1 then
    gosub [dataENEMI]
    timer 1000, [Arena]
    wait
end if
if donjon = 1 then
    NumberFLOORmonster = NumberFLOORmonster-1
    if BOSS = 2 then
        LvlDONJON = LvlDONJON + 1
        gosub [FLOOR]
    end if
    if NumberFLOORmonster <= 0 then BOSS = 1
    timer 1000, [donjon]
    wait
end if
wait


[lvlUP]
lvlIND = lvl/5
if lvlIND <1 then lvlIND = 1
select case campagne$
    case "Warrior"
    atk = int(atk + 3)
    def = int(def + 1)
    pv = int(pvTOTAL + 4)
    pm = int(pmTOTAL + 2)
    pvTOTAL = pv
    pmTOTAL = pm
    lvl = lvl +1
    xpTOTAL = xpTOTAL + int(20*lvl*lvlIND)
    Agility = Agility +2
    Strength = Strength +3
    intelligence = intelligence +1
    PoP = PoP + 3
    PoS = PoS + 1
    case "Archer"
    atk = int(atk + 4)
    def = int(def + 1)
    pv = int(pvTOTAL + 5)
    pm = int(pmTOTAL + 4)
    pvTOTAL = pv
    pmTOTAL = pm
    lvl = lvl +1
    xpTOTAL = xpTOTAL + int(20*lvl*lvlIND)
    Agility = Agility +3
    Strength = Strength +1
    intelligence = intelligence +2
    PoP = PoP + 3
    PoS = PoS + 1
    case "Tank"
    atk = int(atk + 5)
    def = int(def + 2)
    pv = int(pvTOTAL + 8)
    pm = int(pmTOTAL + 1)
    pvTOTAL = pv
    pmTOTAL = pm
    lvl = lvl +1
    xpTOTAL = xpTOTAL + int(20*lvl*lvlIND)
    Agility = Agility +1
    Strength = Strength +5
    intelligence = intelligence +1
    PoP = PoP + 3
    PoS = PoS + 1
    case "Artisan"
    atk = int(atk + 2)
    def = int(def + 2)
    pv = int(pvTOTAL + 3)
    pm = int(pmTOTAL + 1)
    pvTOTAL = pv
    pmTOTAL = pm
    lvl = lvl +1
    xpTOTAL = xpTOTAL + int(20*lvl*lvlIND)
    Agility = Agility +3
    Strength = Strength +2
    intelligence = intelligence +1
    PoP = PoP + 3
    PoS = PoS + 3
    case "Wizard"
    atk = int(atk + 1)
    def = int(def + 1)
    pv = int(pvTOTAL + 2)
    pm = int(pmTOTAL + 8)
    pvTOTAL = pv
    pmTOTAL = pm
    lvl = lvl +1
    xpTOTAL = xpTOTAL + int(20*lvl*lvlIND)
    Agility = Agility +1
    Strength = Strength +1
    intelligence = intelligence +7
    PoP = PoP + 3
    PoS = PoS + 2
end select
return

[data]
select case campagne
    case 1
    LvlDONJON= 1
    campagne$ = "Warrior"
    atk = int(10+Strength/4)
    def = int(2+Agility/8)
    pv = int(41+Strength/2)
    pm = int(11+intelligence/3)
    money = 30
    pvTOTAL = pv
    pmTOTAL = pm
    lvl = 1
    xp = 00
    xpTOTAL = 20
    Agility = 8
    Strength = 11
    intelligence = 6
    PoP = 5
    case 2
    LvlDONJON= 1
    campagne$ = "Archer"
    atk = int(12+Strength/4)
    def = int(1+Agility/8)
    pv = int(33+Strength/2)
    pm = int(25+intelligence/3)
    money = 40
    pvTOTAL = pv
    pmTOTAL = pm
    lvl = 1
    xp = 00
    xpTOTAL = 20
    Agility = 14
    Strength = 8
    intelligence = 10
    PoP = 5
    case 3
    LvlDONJON= 1
    campagne$ = "Tank"
    atk = int(7+Strength/4)
    def = int(4+Agility/8)
    pv = int(88+Strength/2)
    pm = int(5+intelligence/3)
    money = 25
    pvTOTAL = pv
    pmTOTAL = pm
    lvl = 1
    xp = 00
    xpTOTAL = 20
    Agility = 7
    Strength = 16
    intelligence = 5
    PoP = 5
    case 4
    LvlDONJON= 1
    campagne$ = "Artisan"
    atk = int(4+Strength/4)
    def = int(2+Agility/8)
    pv = int(31+Strength/2)
    pm = int(26+intelligence/3)
    money = 225
    pvTOTAL = pv
    pmTOTAL = pm
    lvl = 1
    xp = 00
    xpTOTAL = 20
    Agility = 6
    Strength = 5
    intelligence = 14
    PoP = 5
    case 5
    LvlDONJON= 1
    campagne$ = "Wizard"
    atk = int(5+Strength/4)
    def = int(1+Agility/8)
    pv = int(38+Strength/2)
    pm = int(55+intelligence/3)
    money = 55
    pvTOTAL = pv
    pmTOTAL = pm
    lvl = 1
    xp = 00
    xpTOTAL = 20
    Agility = 5
    Strength = 5
    intelligence = 25
    PoP = 5
end select
return

[FLOOR]
BOSS = 0
NumberFLOORmonster = int(7*LvlDONJON+5)
[FLOOR2]
lvlBOOS = int(LvlDONJON*10)
pvBOOS = int(30*LvlDONJON*lvlBOOS)
atkBOOS = int(10*LvlDONJON*lvlBOOS)
defBOOS = int((4*lvlENNEMI)*LvlDONJON)
xpBOSS = int(350+((5*lvlENNEMI)*LvlDONJON))
moneyBOSS = int(200+((10*lvlENNEMI)*LvlDONJON))
return

[dataENEMI]
lvlENNEMI = int(rnd(1)*(10*LvlDONJON))+LvlDONJON
pvENNEMI = int(8*lvlENNEMI+(2*LvlDONJON)) : pvTOTALennemi = pvENNEMI
atkENNEMI = int(3*lvlENNEMI)
defENNEMI = int(1*lvlENNEMI)
xpENNEMI = int(5*lvlENNEMI)
moneyENNEMI = int(3*lvlENNEMI)
return

'----sauvegarde-----------------------------------------------------------------------------------------------------------------------|
[save]
open "save.ini" for output as #save
print #save, LvlDONJON
print #save, campagne$
print #save, atk
print #save, def
print #save, pv
print #save, pm
print #save, money
print #save, def
print #save, pv
print #save, pm
print #save, money
print #save, regen
print #save, Tregen
print #save, TPMregen
print #save, pvTOTAL
print #save, pmTOTAL
print #save, PMregen
print #save, lvl
print #save, xp
print #save, xpTOTAL
print #save, CC
print #save, Agility
print #save, Strength
print #save, intelligence
print #save, PoP
print #save, PoS
print #save, NumberFLOORmonster
print #save, BOSS
print #save, RACE$
print #save, capacity$
CLOSE #save
notice " " + chr$(13) + "Game saved !"
wait

'----chargement----------------------------------------------------------------------------------------------------------------|
[load]
if version = 1 then confirm "Charger votre dernière partie?"; load$
if version = 2 then confirm "Load your last save?"; load$
if load$ = "no" then wait
dir$ = "" : file$ = "save.ini"
if fileExist(dir$,file$) = 0 then
    if version = 1 then notice " " + chr$(13) + "Aucune partie n'est sauvegardé!"
    if version = 2 then notice " " + chr$(13) + "You have no backup saved!"
    wait
end if

[loading1]
load = 1
close #main
open "save.ini" for input as #save
input #save, LvlDONJON
input #save, campagne$
input #save, atk
input #save, def
input #save, pv
input #save, pm
input #save, money
input #save, def
input #save, pv
input #save, pm
input #save, money
input #save, regen
input #save, Tregen
input #save, TPMregen
input #save, pvTOTAL
input #save, pmTOTAL
input #save, PMregen
input #save, lvl
input #save, xp
input #save, xpTOTAL
input #save, CC
input #save, Agility
input #save, Strength
input #save, intelligence
input #save, PoP
input #save, PoS
gosub [FLOOR]
input #save, NumberFLOORmonster
input #save, BOSS
input #save, RACE$
input #save, capacity$
CLOSE #save
goto [GameStartMAIN]


'fonctions ----------------------------------
function fileExist(dir$,file$)
    dim info$(10, 10)
    files dir$,file$, info$(
    if val(info$(0, 0)) > 0 then
        fileExist = 1
    else
        fileExist = 0
    end if
end function


