def viewPlanetChoice(planet): x = screen.getch() if x == ord("+"): playerList = [user, easy] global time time = TimeMechanics.updateEVERYTHING(playerList, planets, time) elif x == ord("m"): if buildings.builds("mine", user, planet) == False: screen.addstr(23, 17, "Not enough resources") elif x == ord("f"): if buildings.builds("farm", user, planet) == False: screen.addstr(23, 17, "Not enough resources") elif x == ord("d"): if buildings.builds("desalination", user, planet) == False: screen.addstr(23, 17, "Not enough resources") elif x == ord("q"): menu() elif x == ord("1"): user['viewPlanetIndex'] = 0 elif x == ord("2"): user['viewPlanetIndex'] = 1
def viewPlanetChoice(planet): x = screen.getch() if x == ord("+"): playerList = [user, easy] global time time = TimeMechanics.updateEVERYTHING(playerList, planets, time) elif x == ord("m"): if buildings.builds("mine", user, planet) == False: screen.addstr(23, 17, "Not enough resources") elif x == ord("f"): if buildings.builds("farm", user, planet) == False: screen.addstr(23, 17, "Not enough resources") elif x == ord("d"): if buildings.builds("desalination", user, planet) == False: screen.addstr(23,17, "Not enough resources") elif x == ord("q"): menu() elif x == ord("1"): user['viewPlanetIndex'] = 0 elif x == ord("2"): user['viewPlanetIndex'] = 1
def build(self, building, planet, quantity, time=4, begin=True): if begin == True: time = 4 b1 = [building, planet, quantity, time] self.buildQueue.append(b1) self.buildQueue[0][3] -= 1 if time == 0: buildings.builds(building, quantity, self.user, planet, time) del self.buildQueue[0]
def console(self, message, fleetIndex=0): if message == "ATTACK": print "ATTACK" if message == "PICKUP": print "PICKUP" if message == "DROP": print "DROP" if message[0] == "BUILD": buildings.builds(message[1], int(message[2]), user, planet) print "BUILD"
def console(self, message, fleetIndex = 0): if message == "ATTACK": print "ATTACK" if message == "PICKUP": print "PICKUP" if message == "DROP": print "DROP" if message[0] == "BUILD": buildings.builds(message[1], int(message[2]), user, planet) print "BUILD"
def build(self, building, planet, quantity, time=4, begin=True): if begin == True: time = 4 b1 = [building, planet, quantity, time] self.buildQueue.append(b1) self.buildQueue[0][3] -=1 if time==0: buildings.builds(building, quantity, self.user, planet, time) del self.buildQueue[0]