Beispiel #1
0
def drawreturnmenu(seconds, gold):
	for i in range(0,len(RETURN_LINES)):
		method.bufferxy(10, i+9,RETURN_LINES[i][:-1])
	m, s = divmod(seconds, 60)
	h, m = divmod(m, 60)
	method.bufferxy(14,11,"&MX" + str(h) + " hrs " + str(m) + " mins and " + str(s) + " secs&XX.&GX")
	method.bufferxy(34,13,"&YX" + method.dispBigNum(gold) + "&GX")
Beispiel #2
0
import math
import sys
import time
import os
import glob
import signal
import getch
import threading
import random

# Module imports
import gui
import method


method.bufferxy(0, 0, "!")
method.printBuffer()
Beispiel #3
0
def draw():
	global DEATH_FRAME, ZONE_MOBS_KILLED, MOB_MAX_HP, HIGHEST_ZONE, CURRENT_ZONE, lastch
	method.bufferxy(26,15,str(1+HERO_SCREEN)) #scroll up/down
	if RAGE:
		method.bufferxy(15,22,"&RX"+method.dispBigNum(int(HIT_DMG*(1.5+.2*HEROES[2][1]/5)))+"&XX")
	else:
		method.bufferxy(15,22,method.dispBigNum(HIT_DMG)) #Hit Dmg
	method.bufferxy(37,22,method.dispBigNum(DPS)) #DPS
	method.bufferxy(4,1,"&YX" + method.dispBigNum(MONEY) + "&YX") #money
	method.bufferxy(33,3,MOBS[CURRENT_MOB][0]) #mob name
	if CURRENT_ZONE-1>0:
		method.bufferxy(35,1,str(CURRENT_ZONE-1)) #zone num -
	if CURRENT_ZONE != HIGHEST_ZONE:
		method.bufferxy(49-len(str(CURRENT_ZONE+1)),1,str(CURRENT_ZONE+1)) #zone num + 
	method.bufferxy(42-len(str(CURRENT_ZONE))/2,1,str(CURRENT_ZONE)) #zone num
	if CURRENT_ZONE % 5 == 0: #zone mob nums
		method.bufferxy(36,15,"&RXTime: "+str(round(30.0-time.time()+BOSS_TIMER,1)) + "&XX") #boss timer
		if HIGHEST_ZONE > CURRENT_ZONE:
			method.bufferxy(46,3,"(1/1)")
		else:
			method.bufferxy(46,3,"(0/1)")
	else:
		if HIGHEST_ZONE > CURRENT_ZONE:
			method.bufferxy(44,3,"(10/10)")
		else:
			method.bufferxy(45,3,"("+str(ZONE_MOBS_KILLED)+"/10)")
	Y=int((float(MOB_HP)/float(MOB_MAX_HP))*22.0)
	for i in range(22-Y, 22):
		method.bufferxy(55,i+1,("&GG" if Y > 0.5*22.0 else ("&YY" if Y > 0.25*22.0 else "&RR")) + "XX" + "&XX") #hashtag healthbar
	if MOB_HP <= 0: #mob death animation
		method.bufferxy(36,16,"rekt&XX")
		if DEATH_FRAME == 20:
			DEATH_FRAME = 0
			createMob()
		else:
			for i in range(1,len(MOBS[CURRENT_MOB]) - (DEATH_FRAME/2)):
				method.bufferxy(32,(4 + (DEATH_FRAME/2)) +i,MOBS[CURRENT_MOB][i][:-1])
			method.bufferxy(33+MONEY_POS,14-DEATH_FRAME/2,"+&YX"+str(MONEY_BUFFER)+"&XX") #money animation
			DEATH_FRAME+=1
	else:
		for i in range(1,len(MOBS[CURRENT_MOB])): #mob drawing
			method.bufferxy(32,4+i,MOBS[CURRENT_MOB][i][:-1])
			method.bufferxy(36,16,method.dispBigNum(MOB_HP) + "&XX") #mob hp num
	if dispStats == False:
		for i in range(4):
			if (i+HERO_SCREEN*4<len(HEROES)):
				#Heroes
				method.bufferxy(1,4+3*i,HEROES[i+HERO_SCREEN*4][0]) # hero name
				method.bufferxy(15-len(str(HEROES[i+HERO_SCREEN*4][1])),4+3*i,str(HEROES[i+HERO_SCREEN*4][1])) # hero level
				method.bufferxy(14-len(method.dispBigNum(HEROES[i+HERO_SCREEN*4][3])),5+3*i,"&GX$&YX" + method.dispBigNum(HEROES[i+HERO_SCREEN*4][3]) + "&XX") #hero cost
				#Skills
				method.bufferxy(19,4+3*i,SKILLS[i+HERO_SCREEN*4][0])
				if HEROES[i+HERO_SCREEN*4][1]>0:
					if(SKILLS[i+HERO_SCREEN*4][1]==0):
						method.bufferxy(16,5+3*i,"(Passive)")
					
					elif round(SKILLS[i+HERO_SCREEN*4][1]-time.time()+SKILLS[i+HERO_SCREEN*4][2],1)<=0:
						method.bufferxy(16,5+3*i,"Ready")
					else:
						method.bufferxy(16,5+3*i,"&RX"+str(round(SKILLS[i+HERO_SCREEN*4][1]-time.time()+SKILLS[i+HERO_SCREEN*4][2],1))+"&XX")
	else:
		method.bufferxy(1,3,"=&MXStats&XX======================")
		for y in range(4,16):
			for x in range(1,29):
				method.bufferxy(x,y," ")
		method.bufferxy(1,4,"Lifetime hits: " + str(STATS[0]))
		method.bufferxy(1,5,"Lifetime mob kills: " + str(STATS[1]))
		method.bufferxy(1,6,"Lifetime Hero Levelups: " + str(STATS[2]))
		method.bufferxy(1,7,"Time since start: " + str(int(time.time())-STATS[3]) + "sec")
	if purchaseComplete!=0:
		if purchaseComplete==-1:
			method.bufferxy(1,18,"Not enough &GXmoney&XX!            ")
		else:
			method.bufferxy(1,18,HEROES[purchaseComplete-1][0] + " gained a level!              ")
		method.bufferxy(1,20,"Press any key to continue...")
	if skillActivated!=0:
		if skillActivated==-1:
			method.bufferxy(1,18,"That skill is not ready!                           ")
		elif skillActivated == -2:
			method.bufferxy(1,18,"That skill is passive!                             ")
		else:
			method.bufferxy(1,18,SKILLS[skillActivated][0] + " activated!                            ")
		method.bufferxy(1,20,"Press any key to continue...")
	if not quitMenuOpen:
		if lastch=='.' or lastch=='>': #characters at bottom
			method.bufferxy(49,22," &MX<&XX ")
		elif lastch=='h' or lastch=='H': # Information box
			method.bufferxy(49,22,"  &MX?&XX")
			method.bufferxy(1,18,"Press hero/skill key to find information about it.")
			method.bufferxy(1,19,"Press &CXQ&XX to Quit.")
			method.bufferxy(1,20,"Use &CX>&XX and &CX<&XX to attack (no need to press SHIFT)")
		elif HELP_DISP_NUM != 0:
			if HELP_DISP_NUM<5:
				method.bufferxy(1, 18,"                                                   ")
				method.bufferxy(1, 18,"&YX"+HEROES[HELP_DISP_NUM-1+4*HERO_SCREEN][0] + "&XX  (DPS: " + str(HEROES[HELP_DISP_NUM-1+4*HERO_SCREEN][2])+")")
				for i in range(2):
					method.bufferxy(1, 19+i,HERO_DESC[HELP_DISP_NUM-1+4*HERO_SCREEN][i])
			else: #Skill descriptions
				method.bufferxy(1, 18,"&YX"+SKILLS[HELP_DISP_NUM-5+4*HERO_SCREEN][0] + "&XX                                          ")
				for i in range(2):
					method.bufferxy(1, 19+i,SKILL_DESC[HELP_DISP_NUM-5+4*HERO_SCREEN][i])
		else:
			method.bufferxy(49,22,"&MX>&XX  ")
	else:
		gui.drawquitmenu()
	if loadMenuOpen:
		gui.drawloadmenu()
	if newMenuOpen:
		gui.drawnewmenu()
	if returnMenuOpen:
		gui.drawreturnmenu(timeSinceLastSession,goldGained)
Beispiel #4
0
def drawnewmenu():
	for i in range(0,len(NEW_LINES)):
		method.bufferxy(11, i+9,NEW_LINES[i][:-1])
Beispiel #5
0
def drawloadmenu():
	for i in range(0,len(LOAD_LINES)):
		method.bufferxy(12, i+9,LOAD_LINES[i][:-1])
Beispiel #6
0
def drawquitmenu():
	for i in range(0,len(QUIT_LINES)):
		method.bufferxy(12, i+9,QUIT_LINES[i][:-1])