#!/usr/bin/env python3
### Made by Ayden G.W for his ICS-201 Class.

from ADF import *

report("\nBegan loading GameFile.\n")

timedBusyWait(0.5)

fightNoises = soundPalette()
fightSound = sound("fight01.ogg","Fight")
fightNoises.add(sound("default/fightWon.ogg","fightWon"))
fightNoises.add(fightSound)

plyr.give(["Knife",pistol(),1,["weapon"]])
plyr.give(["Pistol",knife(),1,["weapon"]])

plyr.setSoundPalette(soundPalette())

addCommand(["help",printHelp])

addCommand(["inventory",printInventory])

addCommand(["use",use])

def quit(args):
    exit()

addCommand(["exit",quit])

def printInfoAboutPlyr(args):
    write("Your level: "+str(plyr.getLevel())+"\nYour XP: "+str(plyr.getXP()))
    write("\nYour Gold: "+str(plyr.getGold())+"\nYour Health: "+str(plyr.getHealth())+"\n\n")
addCommand(["info",printInfoAboutPlyr])


depth = 1
loops = 0
depths = []

def depth1():
    global depth
    inf = ["Welcome to Ayden's DEMO.","I will be showcasing my awesome framework!"]
    opt = ["Test Fights with an enemy!"]
    while True:
        cleanup()
        sel = initLevel(inf,opt)
        resolved,choice = resolveInput(sel)

        if resolved == "choice":
            if choice == 1:
                global plyr
                global fightNoises
                enemy = ghoul()
                enemy.changeLevel(plyr.getLevel() // 2)
                enterCombat(plyr,enemy,fightNoises,10)
                depth = 1 # Goto depth2
                break

depths.append(depth1)

### NOTE: INSERT ANOTHER DEPTH AFTER THIS LINE TO MAKE A STORY

while True:
    loops = loops + 1

    depths[depth-1]()

    if loops > len(depths):
        continueGame = False    # NOTE: Catch infinite loops
        break

write("\nGame over.\n")
