示例#1
0
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
示例#2
0
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
示例#3
0
    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]
示例#4
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"
示例#5
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"
示例#6
0
    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]