def printLoadScreen(position):
    from Maingame import stdscr
    from Maingame import curses
    from Maingame import nextLine
    curses.init_pair(1, curses.COLOR_BLACK, curses.COLOR_WHITE)
    if position == 1:
        for lineno, line in enumerate(loadScreenLayout1):
            stdscr.addstr(loadScreenLayout1[lineno], curses.color_pair(1))
            nextLine()
    elif position == 2:
        for lineno, line in enumerate(loadScreenLayout2):
            stdscr.addstr(loadScreenLayout2[lineno], curses.color_pair(1))
            nextLine()
    elif position == 3:
        for lineno, line in enumerate(loadScreenLayout3):
            stdscr.addstr(loadScreenLayout3[lineno], curses.color_pair(1))
            nextLine()
    elif position == 4:
        for lineno, line in enumerate(loadScreenLayout4):
            stdscr.addstr(loadScreenLayout4[lineno], curses.color_pair(1))
            nextLine()
    elif position == 5:
        for lineno, line in enumerate(loadScreenLayout5):
            stdscr.addstr(loadScreenLayout5[lineno], curses.color_pair(1))
            nextLine()
Exemplo n.º 2
0
 def block(player):
   from Maingame import stdscr
   from Maingame import getchar
   from Maingame import curses
   stdscr.addstr("Do you want to block? You'll take 1/4 damage but can't attack",curses.color_pair(1))
   stdscr.addstr("1 to block, anything else to not")
   block = getchar()
   if block == 1:
     player.isBlocking = True
Exemplo n.º 3
0
def printTitleScreen(position):
    from Maingame import stdscr
    from Maingame import curses
    from Maingame import nextLine
    curses.init_pair(1, curses.COLOR_BLACK, curses.COLOR_WHITE)
    if position == 1:
        for lineno, line in enumerate(titleScreenLayout1):
            stdscr.addstr(titleScreenLayout1[lineno], curses.color_pair(1))
            nextLine()
    elif position == 2:
        for lineno, line in enumerate(titleScreenLayout2):
            stdscr.addstr(titleScreenLayout2[lineno], curses.color_pair(1))
            nextLine()
Exemplo n.º 4
0
  def normalAttack(player, enemy):
    from Maingame import stdscr
    if self.isBlocking == False:
      attackChance = random.randint(1,player.attack)
      defenseChance = enemy.defense
      if attackChance >= defenseChance:
        damage = player.attack * 3
        damage -= enemy.defense
        if enemy.isBlocking == True:
          damage *= 0.75
          damage = int(damage)
        enemy.health -= damage
      else:
        damage = player.attack - (enemy.defense / 2)
        enemy.health -= damage

      #add alternate path in event of 0 damage or negative
      stdscr.addstr("You attacked the "+enemy.name+" for "+str(damage)+" damage!")
Exemplo n.º 5
0
def saveScreen():
    from Maingame import stdscr
    from Maingame import curses
    curses.init_pair(1, curses.COLOR_BLACK, curses.COLOR_WHITE)
    stdscr.addstr("saving... Wait 10 seconds before closing ",
                  curses.color_pair(1))
def classChoice():
    from Maingame import stdscr
    from Maingame import curses
    from Maingame import nextLine
    from Maingame import getchar
    doLoop = True
    nextLine()
    stdscr.addstr("Choose your class (1, 2, 3, or 4):", curses.color_pair(1))
    nextLine()
    nextLine()
    stdscr.addstr("1) Warrior", curses.color_pair(1))
    nextLine()
    nextLine()
    stdscr.addstr("2) Sorcerer", curses.color_pair(1))
    nextLine()
    nextLine()
    stdscr.addstr("3) Rogue", curses.color_pair(1))
    nextLine()
    nextLine()
    stdscr.addstr("4) Necromancer", curses.color_pair(1))
    stdscr.refresh()
    classChoice = 7
    chosenCorrectly = True
    while chosenCorrectly:
        classChoice = getchar()
        if classChoice == "1" or classChoice == "2" or classChoice == "3" or classChoice == "4":
            chosenCorrectly = False
    if classChoice == "1":
        nextLine()
        nextLine()
        stdscr.addstr("Name your warrior: ", curses.color_pair(1))
        stdscr.refresh()
        nameChoice = stdscr.getstr()
        nameChoice = nameChoice.decode("utf-8")
        player = Entities.Warrior(nameChoice)
        return player
    elif classChoice == "2":
        nextLine()
        nextLine()
        stdscr.addstr("Name your sorcerer: ", curses.color_pair(1))
        stdscr.refresh()
        nameChoice = stdscr.getstr()
        nameChoice = nameChoice.decode("utf-8")
        player = Entities.Sorcerer(nameChoice)
        stdscr.addstr("character has been made", curses.color_pair(1))
        return player
    elif classChoice == "3":
        nextLine()
        nextLine()
        stdscr.addstr("Name your rogue: ", curses.color_pair(1))
        stdscr.refresh()
        nameChoice = stdscr.getstr()
        nameChoice = nameChoice.decode("utf-8")
        player = Entities.Rogue(nameChoice)
        return player
    elif classChoice == "4":
        nextLine()
        nextLine()
        stdscr.addstr("Name your necromancer: ", curses.color_pair(1))
        stdscr.refresh()
        nameChoice = stdscr.getstr()
        nameChoice = nameChoice.decode("utf-8")
        player = Entities.Necromancer(nameChoice)
        return player
Exemplo n.º 7
0
 def fool(self, fooled):
   from Maingame import stdscr
   stdscr.addstr("you've been fooled "+fooled.name)
Exemplo n.º 8
0
 def levelUp(leveler):
   from Maingame import stdscr
   from Maingame import curses
   stdscr.addstr ("You leveled up to level "+str((leveler.level)+1)+"!!", curses.color_pair(1))
   leveler.level += 1