Ejemplo n.º 1
0
def get_grade():
    if get_mode() == TDIE.Mode.master:
        switcher = {
            0: "9",
            1: "8",
            2: "7",
            3: "6",
            4: "5",
            5: "4",
            6: "4",
            7: "3",
            8: "3",
            9: "2",
            10: "2",
            11: "2",
            12: "1",
            13: "1",
            14: "1",
            15: "S1",
            16: "S1",
            17: "S1",
            18: "S2",
            19: "S3",
            20: "S4",
            21: "S4",
            22: "S4",
            23: "S5",
            24: "S5",
            25: "S6",
            26: "S6",
            27: "S7",
            28: "S7",
            29: "S8",
            30: "S8",
        }
        return switcher.get(TDIL.get_grade(), "S9")
    elif get_mode() == TDIE.Mode.death:
        if get_level() < 500:
            return None
        elif get_level() < 999:
            return "M"
        else:
            return "GM"
    else:
        return None
Ejemplo n.º 2
0
def get_state():
    return TDIE.State(TDIL.get_state())
Ejemplo n.º 3
0
def get_mode():
    return TDIE.Mode(TDIL.get_mode())
Ejemplo n.º 4
0
def get_section():
    return maths.floor(TDIL.get_level() / 100) + 1
Ejemplo n.º 5
0
def get_mrollFlags():
    return TDIE.MRollFlags(TDIL.get_mrollFlags())
Ejemplo n.º 6
0
def get_inCreditRoll():
    return TDIL.get_inCreditRoll()
Ejemplo n.º 7
0
def get_ycoord():
    return TDIL.get_ycoord()
Ejemplo n.º 8
0
def get_rotation():
    return TDIL.get_rotation()
Ejemplo n.º 9
0
def get_tetromino():
    return TDIE.Tetromino(TDIL.get_tetromino())
Ejemplo n.º 10
0
def get_timer_in_seconds():
    return maths.floor(100 * TDIL.get_timer() / 60) / 100
Ejemplo n.º 11
0
def get_level():
    return TDIL.get_level()
Ejemplo n.º 12
0
def get_gradePoints():
    return TDIL.get_gradePoints()
Ejemplo n.º 13
0
def main():

    time.sleep(1)
    print("Waiting until loading has finished...")
    while TDIH.get_state() != TDIE.State.idle:
        time.sleep(0.05)
    print("Loading completed")

    reset_all_session_files()

    gameProcessed = False

    while True:
        if TDIH.get_mode() == TDIE.Mode.death and not gameProcessed:
            if TSS.update_m_time():
                output("Last M time: " + TSS.mTime, 'w', "last_m_time.dat")

        if TDIH.get_state() == TDIE.State.gameOver and not gameProcessed:
            #update the number of games played
            TSS.update_game_counter()

            if TDIH.get_mode() == TDIE.Mode.master:
                continue
            elif TDIH.get_mode() == TDIE.Mode.death:
                # update number of death games
                TSS.update_death_games()

                # update history
                TSS.update_series()
                output(
                    "Lvl: " + str(TDIH.get_level()) + "; Tot: " +
                    str(TSS.get_series_total()) + "\n", 'a', "taphistory.dat")

                # update PB
                TSS.update_death_pb()
                output(
                    "SB: " + str(TSS.deathPB) + "; Games: " +
                    str(TSS.numberDeathGames), 'w', "tappb.dat")

                # update number of Ms
                if TSS.update_death_m():
                    output("M count: " + str(TSS.numberDeathM), 'w',
                           "tapm_count.dat")

                # update number of GMs
                if TSS.update_death_gm():
                    output("GM count: " + str(TSS.numberDeathGM), 'w',
                           "tapgm_count.dat")

                # update death levels
                TSS.update_death_levels()

                # update death average
                TSS.update_death_average()
                output("Average: " + str(TSS.deathAverage), 'w',
                       "tapaverage.dat")

                # update death M average
                if TSS.update_death_m_average():
                    output("M Avg: " + str(TSS.deathMAverage), 'w',
                           "tapmaverage.dat")

                TSS.reset_m_time()

                gameProcessed = True
        elif TDIL.get_timer() == 0:
            gameProcessed = False

        time.sleep(0.01)