#This is a cheat event.  It provides experience and/or gold at will.
from eventAPI import *
from APIUtils import *
from SDLKeys import *

def fireEvent(e):
    showPicture(e, "House")
    playSpecAudio(e, "House")
    choice = 0
    while (choice != SDLK_SPACE):
        choice = optionInput(e,
            ["Welcome to the Cheater's Stronghold!"],
            ["(A) 100,000 XP", "(B) 25,000 GP each", "(C) Heal all", "(T)est text", "(SPACE) to Exit"],
            [SDLK_a, SDLK_b, SDLK_c, SDLK_t, SDLK_SPACE])
        processChoice(e, choice)
    return 0

def processChoice(e, choice):
    if (choice == SDLK_a):
        splitXP(e, 100000)
    elif (choice == SDLK_b):
        x, c = 0, getPartyCount(e)
        while (x < c):
            modifyGold(e, x, 25000)
            x += 1
    elif (choice == SDLK_c):
        x, c = 0, getPartyCount(e)
        while (x < c):
            modifyHP(e, x, 100000)
            modifySP(e, x, 100000)
            modifyBP(e, x, 10000)
            x += 1
    elif (choice == SDLK_t):
        showMessage(e,
            ["ABCDEFGHIJ",
             "KLMNOPQRST",
             "UVWXYZ",
             "abcdefghij",
             "klmnopqrst",
             "uvwxyz",
             "1234567890",
             ",.?\"':;()!",
             "-/_*@"])
