Beispiel #1
0
    def onKbdEvent(self, argsList):
        'keypress handler - return 1 if the event was consumed'
        eventType, key, mx, my, px, py = argsList

        theKey = int(key)

        if (eventType == self.EventKeyDown and theKey == int(InputTypes.KB_Q)
                and self.eventManager.bAlt and self.eventManager.bShift):
            print("SHIFT-ALT-Q")  #enables squatting
            self.rnf.setCheatMode(True)
            CyInterface().addMessage(utils.getHumanID(), True, iDuration,
                                     "EXPLOITER!!! ;)", "", 0, "",
                                     ColorTypes(iRed), -1, -1, True, True)

        #Stability Cheat
        if data.bCheatMode and theKey == int(
                InputTypes.KB_S
        ) and self.eventManager.bAlt and self.eventManager.bShift:
            print("SHIFT-ALT-S")  #increases stability by one level
            utils.setStabilityLevel(
                utils.getHumanID(),
                min(5,
                    utils.getStabilityLevel(utils.getHumanID()) + 1))

        if eventType == self.EventKeyDown and theKey == int(
                InputTypes.KB_V
        ) and self.eventManager.bCtrl and self.eventManager.bShift:
            for iPlayer in range(iNumTotalPlayersB):
                pPlayer = gc.getPlayer(iPlayer)

                #pPlayer.initCity(71, 34)
                #city = gc.getMap().plot(71, 34).getPlotCity()

                lEras = [iAncient, iMedieval, iIndustrial]
                for iEra in lEras:
                    pPlayer.setCurrentEra(iEra)
                    for iUnit in range(iNumUnits):
                        print(
                            str(
                                gc.getCivilizationInfo(
                                    pPlayer.getCivilizationType()).
                                getShortDescription(0)))
                        print(str(gc.getEraInfo(iEra).getDescription()))
                        print(str(gc.getUnitInfo(iUnit).getDescription()))
                        utils.makeUnit(iUnit, iPlayer, (68, 33), 1)
                        gc.getMap().plot(68, 33).getUnit(0).kill(
                            False, iBarbarian)
	def onKbdEvent(self, argsList):
		'keypress handler - return 1 if the event was consumed'
		eventType,key,mx,my,px,py = argsList
			
		theKey=int(key)
		
		if ( eventType == self.EventKeyDown and theKey == int(InputTypes.KB_Q) and self.eventManager.bAlt and self.eventManager.bShift):
			print("SHIFT-ALT-Q") #enables squatting
			self.rnf.setCheatMode(True);
			CyInterface().addMessage(utils.getHumanID(), True, iDuration, "EXPLOITER!!! ;)", "", 0, "", ColorTypes(iRed), -1, -1, True, True)

		#Stability Cheat
		if data.bCheatMode and theKey == int(InputTypes.KB_S) and self.eventManager.bAlt and self.eventManager.bShift:
			print("SHIFT-ALT-S") #increases stability by one level
			utils.setStabilityLevel(utils.getHumanID(), min(5, utils.getStabilityLevel(utils.getHumanID()) + 1))
			
		if eventType == self.EventKeyDown and theKey == int(InputTypes.KB_W) and self.eventManager.bCtrl and CyGame().GetWorldBuilderMode():
			utils.removeStabilityOverlay() # Remove AI forbidden area overlay when exiting WB by ctrl+w