# -*- coding: utf-8 -*-
from Passives import *
from Wands import *
from Armor import *
from Weapons import *
from Shards import *
from generator import *

if False:
    print('\n\n === PASSIVES ===')
    for a in passives:
        print(a.name.plain(), end = ', ')
    print('\n\n ===== WANDS =====')
    for a in wands:
        print(a.name.plain(), end = ', ')
    print('\n\n ===== ARMOR =====')
    for a in armor:
        print(a.name.plain(), end = ', ')
    print('\n\n ==== WEAPONS ====')
    for a in weapons:
        print(a.name.plain(), end = ', ')
    print('\n')

all = passives + wands + armor + weapons + shards
# --- Generation part -----------
generator = Generator(passives + wands + armor + weapons + shards)
generator.make()


all = {
    #Type: [ list, duplicates, not_in_shop]
    "Passives":[passives,8,9,"dup: -3 boss medalions, -1 bubble_wrap, -4 overlord; not_in_shop: -4 boss medalions, -1 bubble_wrap, -4 overlord"],
    "Armor":[armor,0,4,"not_in_shop: -4 Basic"],
    "Weapons":[weapons,5,6,"dup: -4 Soul Sword, -1 Crystal; not_in_shop: -4 Soul Sword, -1 Basic, -1 Crystal"],
    "Wands":[wands,0,0,""],
    "Shards":[shards,0,0,""],
    }
print('\n {:10s} | {:9s}  {:9s}  {:10s}  {}'.format('Type ', 'Number', 'Bought', 'Not Bought', 'Comments / Not counted'))
print(' ----------------------------------------------')
total = 0
n_bought_all = 0
not_bought_all = 0
for type in all:

    n_bought_ = 0
    for item in all[type][0]:
        if item.bought:
            n_bought_ += 1
    n_items = len(all[type][0]) - all[type][1] # All - num_dif
    n_bought = n_bought_ -all[type][2] # bought - not_in_shop
    not_bought = len(all[type][0]) -n_bought_

    print(' {:10s} | {:3} ({:3})  {:3} ({:3})  {:3} ({:3})     {:<}'.format(type, n_items, len(all[type][0]), n_bought, n_bought_, not_bought, len(all[type][0]) - n_bought_, all[type][3]))

    total += n_items
    n_bought_all += n_bought
    not_bought_all += not_bought

total_ = len(passives + wands + armor + weapons + shards)
print(' ---------------------------------------------')
print(' {:10s} | {:3d} ({:3})  {:3d}     {:^10d}\n'.format('Total', total, total_, n_bought_all, not_bought_all))

input("\n\n +3 mana bottles")
input("\n\nPress ENTER to end.")








#   JText:    txt, (color, bold, italic, underlined)
#   JLine:    line{list of JTxt}
#   Lore:     (l{list of JLine, JTxt or str})
#   Passive:  name{Json}, lore{Lore}, model{str}, rank, (curse, dmg, hp, speed, luck, mana_speed, mana_capacity, mana_cost, souls_capacity {int}, custom_on, custom_off {Bool})
#   ItemBook: list{list of Items}

#   generate(l={list of Items or books})

"""
JTxt('exemple', color = 'red', italic = False, underline = True)
JLine([Jtxt1 , Jtxt2])
Lore(['set', JTxt(Rank.A), JLine()])
Item(
    id = 'stone',
    name = JTxt('prova','dark_red', True, underlined = True),
    lore = Lore(['prova_l']),
    model = '1000',
    Itype = 'wand',
    rank = Rank.A,
    stats = Stats([ Stat('armor', 10, 'armor')]),
    cost = 0,
    element = WandElement.Fire,
    use = 'instant' or 'arch' or 'click_keep'
    custom_on = True,
    custom_off = False,
    holder = True,
    color = 'mage_armor',
    other = '<other nbt>',
    bought = False,
    give_tag = False,
    book = True,
    spell_text = [<str>, <str>]
    price = 0)
"""
