def setAIMoves(index,currentNation,ARRAY_DICT): NATION_ARRAY = ARRAY_DICT['NATION_ARRAY'] PRICE_TRACKER = ARRAY_DICT['PRICE_TRACKER'] WAR_BRIEFING = ARRAY_DICT['WAR_BRIEFING'] TECH_MAP = ARRAY_DICT['TECH_MAP'] # Capping AI at one for now moveLimit = int(currentNation[0]['Special']['moveLimit']) aggression = currentNation[0]['Special']['aggression'] creativity = currentNation[0]['Special']['creativity'] materialism = currentNation[0]['Special']['materialism'] prudence = currentNation[0]['Special']['prudence'] wealth = currentNation[0]['Finance']['wealth'] for moveNumber in range(1, 10): moves = checkMoves(currentNation,"%^")[0] #Ensure no countries take more moves than the limit while checkMoves(currentNation,"%^")[0] > 1: bias = calculateBias(currentNation,materialism,aggression,creativity,prudence) # HAS FINANCE BIAS if bias == 0: # GAMBLE currentNation = gamble(currentNation) # BUY currentNation = aiBuy(PRICE_TRACKER,currentNation,materialism) # SELL currentNation = aiSell(PRICE_TRACKER,currentNation,aggression,materialism) # Invest Resource currentNation = investResource(currentNation,PRICE_TRACKER) # Invest in nation currentNation = investNation(currentNation,PRICE_TRACKER,NATION_ARRAY) # HAS BIAS TOWARDS WAR if bias == 1: # TODO: Add logic currentNation = drill(currentNation,NATION_ARRAY) # BUILD currentNation = build(currentNation,WAR_BRIEFING,aggression,materialism) # SCRAP currentNation = scrap(currentNation,WAR_BRIEFING,NATION_ARRAY) # ESPIONAGE~ currentNation = espionage(currentNation,NATION_ARRAY,aggression,prudence) # HAS BIAS TOWARDS SCIENCE if bias == 2: currentNation = advanceEra(currentNation,NATION_ARRAY,aggression,TECH_MAP) currentNation = gainResearchPoints(currentNation,NATION_ARRAY,aggression,TECH_MAP) currentNation = researchTechnology(currentNation,NATION_ARRAY,aggression,TECH_MAP) # If No moves, then pass if len(currentNation[0]['Nextmoves']) == 0: currentNation[0]['Nextmoves']= [['pass']] return(currentNation)
def investResource(myNation, NATION_ARRAY, PRICE_TRACKER, resource): # CHECK MAX MOVES returnCode = checkMoves(myNation, 'investResource')[1] if returnCode > 0: input('Already invested or moves used up') return (myNation) returnCode, spendAmount = enterMoney( myNation, 'How much money do you wish to invest?') if returnCode > 0: return (myNation) print('Investment amount is: ' + str(spendAmount)) # PLACE ORDER # Decrement wealth now myNation[0]['Finance'][ 'wealth'] = myNation[0]['Finance']['wealth'] - spendAmount investedPrice = PRICE_TRACKER[resource]['price'] wait = 4 myNation[0]['Nextmoves'] = myNation[0]['Nextmoves'] + [[ 'Submitted', 'investResource', resource, spendAmount, investedPrice, wait ]] print('You have chosen to invest $' + str(spendAmount) + ' in ' + str(resource)) print('Your profits will be paid into your account after' + str(wait) + ' moves.') print(myNation[0]['Nextmoves']) buffer = input('Press enter to continue \n') return (myNation)
def gambleMenu(myNation, year): clearScreen() print('My Team: ' + str(myNation[1])) print('Year: ' + str(year)) print('Trade Credits: ' + str(myNation[0]['Finance']['wealth'])) print(' ') print('') # CHECK MAX MOVES returnCode = checkMoves(myNation, 'gamble')[1] if returnCode > 0: input('Moves used up or already gambled this round. \n') return (myNation) returnCode, gambleAmount = enterMoney( myNation, 'How much money do you wish to gamble?') if returnCode > 0: return (myNation) # Decrement wealth now. myNation[0]['Finance'][ 'wealth'] = myNation[0]['Finance']['wealth'] - gambleAmount myNation[0]['Nextmoves'] = myNation[0]['Nextmoves'] + [[ 'gamble', gambleAmount ]] print('You will gamble ' + str(gambleAmount) + ' in the next round') buffer = input('Press enter to continue \n') skipflag = 'y' return (myNation)
def investNation(currentNation,PRICE_TRACKER,NATION_ARRAY): # CHECK MAX MOVES returnCode = checkMoves(currentNation,'investCountry')[1] if returnCode > 0: return(currentNation) # MORE LOGIC REQUIRED friendList = returnBestFriends(currentNation) friend = random.choice(friendList) if friend[0] < 30: return(currentNation) # Pick a random value to invest returnCode,spendAmount = arbitrarySpendAmount(currentNation) if returnCode > 0: print('not enough') return(currentNation) # get index by using value as lookup for x in range(0,len(NATION_ARRAY)): if NATION_ARRAY[x][1] == friend[1]: friendIndex = x # PLACE ORDER Decrement wealth now currentNation[0]['Finance']['wealth'] -= spendAmount friendsOriginalWealth = NATION_ARRAY[friendIndex][0]['Finance']['wealth'] wait = 4 currentNation[0]['Nextmoves'] = currentNation[0]['Nextmoves'] + [['Submitted','investCountry',friendIndex,spendAmount,friendsOriginalWealth,wait]] return(currentNation)
def drill(myNation, branch, units, WAR_BRIEFING): print('') # CHECK MAX MOVES returnCode = checkMoves(myNation, 'drill')[1] if returnCode > 0: fast_print('All moves used up, or already drilling this round.') return (myNation) intensity = 'low' while intensity != 'XYZFFJJJJJJ': print('[S] Soft') print('[M] Medium') print('[H] Hard') print('[I] More Info') print('[R] Return') intensity = input('How hard do you want to train your ' + str(branch) + '?\n').upper() clearScreen() if intensity == 'S': drillOrder = ['drill', branch, 'soft', units] break if intensity == 'M': drillOrder = ['drill', branch, 'medium', units] break if intensity == 'H': drillOrder = ['drill', branch, 'hard', units] break if intensity == 'I': fast_print( 'The harder you drill your units the more benefits you will gain, but the risk of loss also increases. \n' ) print('Soft : Might ++, low probability of loss') print('Medium: Might ++, credits ++, medium probability of loss') print( 'Hard : Might ++, credits ++ newUnits ++, high probability of loss' ) print( 'Remember drilling your units means they are off standby and unavailable for the next round, be vigilant incase you come under attack.' ) input('Enter to continue \n') if intensity == 'R' or intensity == '': return (myNation) # Deduct units for unit in units: unit = unit[0] myNation[0]['War']['weapons'][unit][1] = 0 # Place Order myNation[0]['Nextmoves'] = myNation[0]['Nextmoves'] + [drillOrder] print('You will drill your ' + str(branch) + ' at ' + str(drillOrder[2]) + ' intensity') print( 'Your ' + str(branch) + ' will embark on training, the units will be returned to you next round.' ) buffer = input('Press enter to continue \n ') return (myNation)
def researchTechnology(currentNation,NATION_ARRAY,aggression,TECH_MAP): wealth = currentNation[0]['Finance']['wealth'] era = str(currentNation[0]['Tech']['era']) researched = currentNation[0]['Tech']['researched'] rpOwned = currentNation[0]['Tech']['research points'] rpAverageCost = averageRPCost(TECH_MAP,era) # CHECK MAX MOVES returnCode = checkMoves(currentNation,'research')[1] if returnCode > 0: #print(str(currentNation[1]) + ' already researching..') return(currentNation) # WORK OUT PROBABILITY FOR INVESTING IN TECH RESEARCH # If AI is behind on development (say 30% of average) then do research averageCompletion = averageResearchCompletion(currentNation) #print('average completion ' + str(averageCompletion)) researchTechProbability = 0 if averageCompletion < 50: researchTechProbability = 4 if rpOwned > (0.8 * rpAverageCost): researchTechProbability += 2 researchTechProbability += random.randint(0,5) if researchTechProbability > 4: # Get the index key for the lowest researched tech stream # This could no doubt be done in a loop...lazy coding but it works one = currentNation[0]['Tech']['researched']['one'][2] two = currentNation[0]['Tech']['researched']['two'][2] three = currentNation[0]['Tech']['researched']['three'][2] four = currentNation[0]['Tech']['researched']['four'][2] five = currentNation[0]['Tech']['researched']['five'][2] selectionArray = [one,two,three,four,five] selectionIndex = selectionArray.index(min(selectionArray)) choice = ['one','two','three','four','five'][selectionIndex] # Sometimes wont always start from left to right randomChoice = random.randint(0,1) if randomChoice == 1: choice = random.choice(['one','two','three','four','five']) required = TECH_MAP['EraCost'][era][choice]['rp'] myTechPoints = researched[choice][0] remaining = required - myTechPoints if myTechPoints > (required - 1): print(str(currentNation[1]) + ' maxed out all tech streams. ' + str(selectionArray)) return(currentNation) #PLACE ORDER currentNation[0]['Nextmoves'] = currentNation[0]['Nextmoves'] + [['submitted','research',era, choice,required]] return(currentNation)
def gainResearchPoints(currentNation,NATION_ARRAY,aggression,TECH_MAP): wealth = currentNation[0]['Finance']['wealth'] era = currentNation[0]['Tech']['era'] rpOwned = currentNation[0]['Tech']['research points'] # Work out Average RP required for this Era rpAverageCost = averageRPCost(TECH_MAP,era) # CHECK MAX MOVES returnCode = checkMoves(currentNation,'gainResearch')[1] if returnCode > 0: #print(str(currentNation[1]) + 'Already researching') return(currentNation) # CHECK WEALTH if wealth < 100: return(currentNation) researchProbability = (rpAverageCost/rpOwned) +(aggression/100) # ELIF SWITCH MAX VALUE SELECTED if researchProbability > 4: # far below average intensity = 'Overtime' investmentPercentage = 25 rounds = 8 elif researchProbability > 1.8: # quite a bit below average intensity = 'Hard' investmentPercentage = 15 rounds = 6 elif researchProbability > 1: # just under average intensity = 'Medium' investmentPercentage = 10 rounds = 4 elif researchProbability > 0.8: # has double required intensity = 'Soft' investmentPercentage = 0 rounds = 2 else: return(currentNation) amount = round((investmentPercentage/100) * wealth) #Deduct in advance currentNation[0]['Finance']['wealth']-= amount researchOrder = ['submitted','gainResearch',intensity,investmentPercentage,rounds,amount] currentNation[0]['Nextmoves'] = currentNation[0]['Nextmoves'] + [researchOrder] # print(currentNation[1]) # print(currentNation[0]['Nextmoves']) return(currentNation)
def selectTech(myNation, one, two, three, four, five, TECH_MAP): # Check isn't already researching a tech returnCode = checkMoves(myNation, 'research')[1] if returnCode > 0: for item in myNation[0]['Nextmoves']: if 'research' in item: clearScreen() input('You are currently developing ' + str(item[3]) + ' please wait until this is complete. \n') return (myNation) era = str(myNation[0]['Tech']['era']) researched = myNation[0]['Tech']['researched'] techSelected = '' accepted = ['1', '2', '3', '4', '5'] choiceArray = ['one', 'two', 'three', 'four', 'five'] choice = '' clearScreen() while techSelected != 'Y': print('-----SELECT A TECHNOLOGY------') print('') print('1. ' + str(one[1])) print('2. ' + str(two[1])) print('3. ' + str(three[1])) print('4. ' + str(four[1])) print('5. ' + str(five[1])) selection = str(input('Select a Tech to Research \n')) if selection in accepted: choice = choiceArray[accepted.index(selection)] techSelected = 'Y' required = TECH_MAP['EraCost'][era][choice]['rp'] myTechPoints = researched[choice][0] remaining = required - myTechPoints if myTechPoints > (required - 1): input( 'You have already maxed this Tech stream. Please try another. Once all streams complete, Era will progress \n' ) return (myNation) input('You selected : ' + str(researched[choice][1])) # Nextmove contains = submitted flag(changes to pending), research flag, era for lookup, techname, pointsremaining myNation[0]['Nextmoves'] = myNation[0]['Nextmoves'] + [[ 'submitted', 'research', era, choice, required ]] print('Next moves are ' + str(myNation[0]['Nextmoves'])) return (myNation)
def academiaMenu(myNation, year, TECH_MAP): flag = '' academicSelection = ' ' while academicSelection != 'XYZFFJJJJJJ': clearScreen() print('+++++++++++++++++++++++++++++++++++++++++++++++++++') print(' + x % THIS IS ACADEMIA + X % ') print('+++++++++++++++++++++++++++++++++++++++++++++++++++') print('') print('My Team : ' + str(myNation[1])) print('Year : ' + str(year)) print('Knowledge (KP) : ' + str(myNation[0]['Tech']['knowledge'])) print('Era : ' + str(myNation[0]['Tech']['era'])) print('Research Points (RP) : ' + str(myNation[0]['Tech']['research points'])) print('Level : ' + str(myNation[0]['Tech']['level'])) print(' ') print('') flag = showAssets(myNation, year, flag) print('') print('[R] Research Grant') print('[C] Collaborate') print('[G] Grant') print('[R] Return') print(' ') print(' ') print(' ') print('Moves: ' + str(checkMoves(myNation, "%^")[0])) print('****************************************') print(' ') print(' ') academicSelection = str(input('Please chose an option \n')).upper() if academicSelection == 'A': fast_print('not ready') #myNation = drillMenu(myNation,year,WAR_BRIEFING) if academicSelection == 'R': fast_print('not ready') if academicSelection == 'O': fast_print('not ready') if academicSelection == 'T': fast_print('not ready') if academicSelection == 'T': fast_print('not ready') if academicSelection == 'S': flag = 'yes' if academicSelection == 'R' or academicSelection == '': return (myNation) return (myNation)
def techMenu(myNation, year, PRICE_TRACKER, TECH_MAP): flag = '' techSelection = ' ' while techSelection != 'XYZFFJJJJJJ': clearScreen() print('+++++++++++++++++++++++++++++++++++++++++++++++++++') print(' WELCOME TO THE TECHNOLOGY INSTITUE % ') print('+++++++++++++++++++++++++++++++++++++++++++++++++++') print('') print('My Team : ' + str(myNation[1])) print('Year : ' + str(year)) print('Knowledge (KP) : ' + str(myNation[0]['Tech']['knowledge'])) print('Era : ' + str(myNation[0]['Tech']['era'])) print('Research Points (RP) : ' + str(myNation[0]['Tech']['research points'])) print('Level : ' + str(myNation[0]['Tech']['level'])) print(' ') print('') flag = showAssets(myNation, year, flag) print('') print('[A] Academia') print('[R] Research') print('[S] Show Tech Assets') print('[R] Return') print(' ') print(' ') print(' ') print('Moves: ' + str(checkMoves(myNation, "%^")[0])) print('****************************************') print(' ') print(' ') techSelection = str(input('Please chose an option \n')).upper() if techSelection == 'A': print('Not ready yet..') #myNation = academiaMenu(myNation,year,TECH_MAP) if techSelection == 'R': myNation = researchMenu(myNation, year, TECH_MAP) if techSelection == 'O': fast_print('not ready') if techSelection == 'T': fast_print('not ready') if techSelection == 'T': fast_print('not ready') if techSelection == 'S': flag = 'yes' if techSelection == 'R' or techSelection == '': return (myNation) return (myNation)
def advanceEra(currentNation,NATION_ARRAY,aggression,TECH_MAP): era = str(currentNation[0]['Tech']['era']) one = currentNation[0]['Tech']['researched']['one'][2] two = currentNation[0]['Tech']['researched']['two'][2] three = currentNation[0]['Tech']['researched']['three'][2] four = currentNation[0]['Tech']['researched']['four'][2] five = currentNation[0]['Tech']['researched']['five'][2] # CHECK MAX MOVES returnCode = checkMoves(currentNation,'advanceEra')[1] if returnCode > 0: return(currentNation) # Only upgrade if AI has completed all tech streams 5 x 100% completion ==500 total = one + two + three + four + five if total < 500: return(currentNation) currentNation[0]['Nextmoves'] = currentNation[0]['Nextmoves'] + ['advanceEra'] return(currentNation)
def advanceEra(myNation, one, two, three, four, five, TECH_MAP, era): # Check isn't already researching a tech returnCode = checkMoves(myNation, 'advanceEra')[1] if returnCode > 0: return (myNation) era = str(myNation[0]['Tech']['era']) total = one[2] + two[2] + three[2] + four[2] + five[2] if total < 500: input( 'Not enough Development progress. Please complete development of all five tech stacks first. \n' ) # Place Order myNation[0]['Nextmoves'] = myNation[0]['Nextmoves'] + ['advanceEra'] input( str(myNation[1]) + ' will progress to the ' + str(TECH_MAP['nextEra'][era])) return (myNation)
def investResource(currentNation,PRICE_TRACKER): # CHECK MAX MOVES returnCode = checkMoves(currentNation,'investResource')[1] if returnCode > 0: #print('Already invested or moves used up') return(currentNation) gold = PRICE_TRACKER['gold']['history'][-3:] raremetals = PRICE_TRACKER['raremetals']['history'][-3:] gems = PRICE_TRACKER['gems']['history'][-3:] oil = PRICE_TRACKER['oil']['history'][-3:] resource = 'N' if non_decreasing(gold) and len(gold) > 2: resource = 'gold' if non_decreasing(raremetals) and len(raremetals) > 2: resource = 'raremetals' if non_decreasing(gems) and len(gems) > 2: resource = 'gems' if non_decreasing(oil) and len(oil) > 2: resource = 'oil' if resource == 'N': #print('dropped out') return(currentNation) returnCode,spendAmount = arbitrarySpendAmount(currentNation) if returnCode > 0: print('not enough') return(currentNation) # PLACE ORDER & Decrement wealth now currentNation[0]['Finance']['wealth'] -= spendAmount investedPrice = PRICE_TRACKER[resource]['price'] wait = 4 currentNation[0]['Nextmoves'] = currentNation[0]['Nextmoves'] + [['Submitted','investResource',resource,spendAmount,investedPrice,wait]] return(currentNation)
def investCountry(myNation, NATION_ARRAY): print( 'Investing in the growth of a country, helps boost friendship and earns money.' ) # CHECK MAX MOVES returnCode = checkMoves(myNation, 'investCountry')[1] if returnCode > 0: print('Already invested or moves used up.') return (myNation) # SELECT COUNTRY returnCode, NationChoice = selectCountry( NATION_ARRAY, myNation, '****CHOOSE A NATION TO INVEST IN****') if returnCode > 0: return (myNation) returnCode, spendAmount = enterMoney( myNation, 'How much money do you wish to invest in ' + str(NATION_ARRAY[NationChoice][1])) if returnCode > 0: return (myNation) print('Investment amount is: ' + str(spendAmount)) # PLACE ORDER # Decrement wealth now myNation[0]['Finance'][ 'wealth'] = myNation[0]['Finance']['wealth'] - spendAmount nationsOriginalWealth = NATION_ARRAY[NationChoice][0]['Finance']['wealth'] wait = 4 myNation[0]['Nextmoves'] = myNation[0]['Nextmoves'] + [[ 'Submitted', 'investCountry', NationChoice, spendAmount, nationsOriginalWealth, wait ]] print('You have chosen to invest $' + str(spendAmount) + ' in ' + str(NATION_ARRAY[NationChoice][1])) print('Your profits will be paid into your account after ' + str(wait) + ' moves.') buffer = input('Press enter to continue \n') return (myNation)
def gainResearchPoints(myNation): wealth = myNation[0]['Finance']['wealth'] if wealth < 100: input('You dont have enough money to engage in research.') return (myNation) # CHECK MAX MOVES returnCode = checkMoves(myNation, 'gainResearch')[1] if returnCode > 0: fast_print('You are already collecting research points.') return (myNation) intensity = 'low' while intensity != 'XYZFFJJJJJJ': print('[S] Soft ') print('[M] Medium ') print('[H] Hard ') print('[O] Overtime ') print('[I] More Info') print('') print('[R] Return') intensity = input( 'How hard do you want to invest in research grants? \n').upper() clearScreen() if intensity == 'S': researchOrder = ['submitted', 'gainResearch', 'Soft', 0, 2] break if intensity == 'M': researchOrder = ['submitted', 'gainResearch', 'Medium', 10, 4] break if intensity == 'H': researchOrder = ['submitted', 'gainResearch', 'Hard', 15, 6] break if intensity == 'O': researchOrder = ['submitted', 'gainResearch', 'Overtime', 25, 8] break if intensity == 'I': fast_print( 'Research grants awards knowledge and research points (RP) that will be rewarded each round but comes at a cost of wealth and time. \n' ) print( '[S] Soft : 2 rounds at no cost - small bonus each round.' ) print( '[M] Medium : 4 rounds at 10% wealth - small rp & knowledge bonus each round.' ) print( '[H] Hard : 6 rounds at 15% wealth - medium rp and knowledge bonus each round.' ) print( '[O] Overtime : 8 rounds at 25% wealth - Large rp and knowledge bonus each round.' ) input('Enter to continue \n') if intensity == 'R' or intensity == '': return (myNation) # Deduct credits amount = round((researchOrder[3] / 100) * wealth) print('Amount spent on research is $' + str(amount)) myNation[0]['Finance']['wealth'] -= amount #Add spend amount to order array to improve reward calculation researchOrder.append(amount) # Place Order myNation[0]['Nextmoves'] = myNation[0]['Nextmoves'] + [researchOrder] print('') input( 'Your ' + str(researchOrder[2]) + ' research grant will award you points each round that can be spent on developing technology. \nPress enter to continue \n' ) return (myNation)
def covert(myNation, NATION_ARRAY, WAR_BRIEFING): covertThreshold = -20 # CHECK MAX MOVES returnCode = checkMoves(myNation, 'covert')[1] if returnCode > 0: return (myNation) returnCode, NationChoice = selectCountry(NATION_ARRAY, myNation, '****CHOOSE A TARGET****') if returnCode > 0: return (myNation) # CHECK FRIENDSHIP if myNation[0]['Friendship'][NATION_ARRAY[NationChoice] [-1]]['level'] > covertThreshold: print( 'Sorry, your friendship with ' + str(NATION_ARRAY[NationChoice][-1]) + ' is ' + str(myNation[0]['Friendship'][NATION_ARRAY[NationChoice][-1]] ['level']) + '. \n Covert operations are only available when friendship deteriorates below < ' + str(covertThreshold) + '. \n Please check international relations option to view friendship levels.' ) input('') return (myNation) covertOrder = '' covertChoice = "" while covertChoice != 'XYZFFJJJJJJ': print('[E] Economy') print('[M] Military') print('[S] Science') print('[P] Politics') print(' ') print(' ') print('[I] More Info') print('[R] Return') covertChoice = input('What branch of the ' + str(NationChoice) + ' government do you wish to attack? \n').upper() clearScreen() if covertChoice == 'E': covertOrder = ['covert', NationChoice, 'economy'] break if covertChoice == 'M': covertOrder = ['covert', NationChoice, 'military'] break if covertChoice == 'S': covertOrder = ['covert', NationChoice, 'science'] break if covertChoice == 'P': covertOrder = ['covert', NationChoice, 'politics'] break if covertChoice == 'I': fast_print( 'Covert lets you steal and damage enemy assets significantly, this gains benefits but can be risky and lead to war \n' ) print( 'Depending on what branch you target, will result in corresponding gains i.e. . \n' ) print( 'As your rank increases you can chose to target a specific branch of the government. \n' ) print('Military : Might ++') print( '******IF YOUR GAMBIT FAILS, THE CONSEQUENCES COULD BE SEVERE****' ) input('Enter to continue \n') if covertChoice == 'R' or covertChoice == '': return (myNation) myNation[0]['Nextmoves'] = myNation[0]['Nextmoves'] + [covertOrder] return (myNation)
def drill(currentNation,NATION_ARRAY): returnCode = checkMoves(currentNation,'drill')[1] if returnCode > 0: #print(str(currentNation[1]) + 'Already drilling') return(currentNation) # BUILD PROBABILITY #----------------- averageMight,averageWealth,averageKnowledge,averageInfluence = getAverages(NATION_ARRAY) might = currentNation[0]['War']['might'] drillChance = 0 if might < (0.5 * averageMight): drillChance += random.randint(0,8) elif might < (0.8 * averageMight): drillChance += random.randint(0,6) else: drillChance += random.randint(0,4) # Warmongers gonna be warmongers if might > (2.5 * averageMight): drillChance += random.randint(0,20) # Drop out if threshold not met if drillChance < 2: return(currentNation) unitOne = currentNation[0]['War']['weapons']['1'] unitTwo = currentNation[0]['War']['weapons']['2'] light = unitOne[1] + unitTwo[1] unitThree = currentNation[0]['War']['weapons']['3'] unitFour = currentNation[0]['War']['weapons']['4'] unitFive = currentNation[0]['War']['weapons']['5'] core = unitThree[1] + unitFour[1] + unitFive[1] unitSix = currentNation[0]['War']['weapons']['6'] unitSeven = currentNation[0]['War']['weapons']['7'] heavy = unitSix[1] + unitSeven[1] unitEight = currentNation[0]['War']['weapons']['8'] branchChoiceArray = [] if light > 1: branchChoiceArray.append('light') if core > 1: branchChoiceArray.append('core') if heavy > 1: branchChoiceArray.append('heavy') # in the event there are no units if len(branchChoiceArray) < 1: return(currentNation) branchChoice = random.choice(branchChoiceArray) # based upon selection if branchChoice == 'light': units = [('1',unitOne[1]),('2',unitTwo[1])] branch = 'Light Units' elif branchChoice == 'core': units = [('3',unitThree[1]),('4',unitFour[1]),('5',unitFive[1])] branch = 'Core Division' elif branchChoice == 'heavy': units = [('6',unitSix[1]),('7',unitSeven[1])] branch = 'Heavy Forces' else: return(currentNation) aggression = currentNation[0]['Special']['aggression'] augmentedAggresion = random.randint(0,(100 + aggression)) # Ive tilted this a bit more towards harder drilling: can amend later if augmentedAggresion > 120: exposure = 'hard' elif augmentedAggresion > 85: exposure = 'medium' else: exposure = 'soft' drillOrder = ['drill',branch,exposure, units] # Deduct units for unit in units: unit = unit[0] currentNation[0]['War']['weapons'][unit][1] = 0 # Place Order currentNation[0]['Nextmoves'] += [drillOrder] return(currentNation)
def espionage(myNation, NATION_ARRAY, WAR_BRIEFING): # CHECK MAX MOVES returnCode = checkMoves(myNation, 'espionage')[1] if returnCode > 0: print('You have already carried out espionage this round.') return (myNation) # SELECT COUNTRY returnCode, NationChoice = selectCountry(NATION_ARRAY, myNation, '****CHOOSE A TARGET****') if returnCode > 0: return (myNation) # CHECK FRIENDSHIP EXCEEDS THRESHOLD espionageThreshold = 0 if myNation[0]['Friendship'][NATION_ARRAY[NationChoice] [-1]]['level'] > espionageThreshold: print( 'Sorry, your friendship with ' + str(NATION_ARRAY[NationChoice][-1]) + ' is ' + str(myNation[0]['Friendship'][NATION_ARRAY[NationChoice][-1]] ['level']) + '. Espionage is only available when friendship deteriorates below < ' + str(espionageThreshold) + '. \n Please check international relations option to view friendship levels.' ) input('') return (myNation) # espionageOrder = '' # espionageChoice = "" # while covertChoice != 'XYZFFJJJJJJ': # print('[E] Economy') # print('[M] Military') # print('[S] Science') # print('[P] Politics') # print('[I] More Info') # print('[R] Return') # espionageChoice = input('What branch of the ' + str(NationChoice) + ' government do you wish to infiltrate? \n').upper() # clearScreen() # if espionageChoice == 'E': # espionageOrder = ['espionage',NationChoice,'economy'] # break # if espionageChoice == 'M': # espionageOrder = ['espionage',NationChoice,'military'] # break # if espionageChoice == 'S': # espionageOrder = ['espionage',NationChoice,'science'] # break # if espionageChoice == 'P': # espionageOrder = ['espionage',NationChoice,'politics'] # break # if espionageChoice == 'I': # fast_print('Espionage lets you steal enemy assets, this gains benefits but can be risky and lead to war \n') # print('Depending on what branch you target, will result in corresponding gains i.e. . \n') # print('As your rank increases you can chose to target a specific branch of the government. \n') # print('Military : Might ++') # print('******IF YOUR GAMBIT FAILS, THE CONSEQUENCES COULD BE SEVERE****') # input('Enter to continue \n') # if espionageChoice == 'R' or espionageChoice == '': # return(myNation) espionageOrder = ['espionage', NationChoice] myNation[0]['Nextmoves'] = myNation[0]['Nextmoves'] + [espionageOrder] input('Espionage orders given..') return (myNation)
def manoeuvresMenu(myNation, year, WAR_BRIEFING): manoeuvresSelection = ' ' flag = '' while manoeuvresSelection != 'XYZFFJJJJJJ': clearScreen() unitOne = myNation[0]['War']['weapons']['1'] unitTwo = myNation[0]['War']['weapons']['2'] unitThree = myNation[0]['War']['weapons']['3'] unitFour = myNation[0]['War']['weapons']['4'] unitFive = myNation[0]['War']['weapons']['5'] unitSix = myNation[0]['War']['weapons']['6'] unitSeven = myNation[0]['War']['weapons']['7'] unitEight = myNation[0]['War']['weapons']['8'] print('+++++++++++++++++++++++++++++++++++++++++++++++++++') print(' !!MILITARY MANOEUVRES HQ!! :X ') print('+++++++++++++++++++++++++++++++++++++++++++++++++++') print('') print('My Team : ' + str(myNation[1])) print('Year : ' + str(year)) print('Might : ' + str(myNation[0]['War']['might'])) print('Rank : ' + str(myNation[0]['War']['level'])) print('Light Unit : ' + str(unitOne[1] + unitTwo[1])) print('Core Division : ' + str(unitThree[1] + unitFour[1] + unitFive[1])) print('Heavy Forces : ' + str(unitSix[1] + unitSeven[1])) print('SuperWeapons : ' + str(unitEight[1])) print('Firepower : ' + str(myNation[0]['War']['firePower'])) print(' ') print(' ') flag = showAssets(myNation, year, flag) print('') print('[D] Drill your forces') print('[J] Joint manoeuvres') print('[I] Intimidation manoeuvres') print(' ') print(' ') print('[D] Detailed forces review') print('[R] Return') print(' ') print(' ') print(' ') print('Moves: ' + str(checkMoves(myNation, "%^")[0])) print('****************************************') print(' ') print(' ') # CHECK MAX MOVES SINCE INSIDE WHILE LOOP returnCode = checkMoves(myNation, '%^')[1] if returnCode > 0: fast_print('All moves used up') return (myNation) manoeuvresSelection = input('Select an option \n').upper() clearScreen() if manoeuvresSelection == 'D': myNation = drillMenu(myNation, year, WAR_BRIEFING) if manoeuvresSelection == 'J': print('Not ready') if manoeuvresSelection == 'I': print('Not ready') if manoeuvresSelection == 'D': flag = 'yes' if manoeuvresSelection == 'R' or manoeuvresSelection == '': return (myNation) return (myNation)
def weaponsMenu(myNation, year, WAR_BRIEFING): flag = '' warSelection = ' ' while warSelection != 'XYZFFJJJJJJ': clearScreen() unitOne = myNation[0]['War']['weapons']['1'] unitTwo = myNation[0]['War']['weapons']['2'] unitThree = myNation[0]['War']['weapons']['3'] unitFour = myNation[0]['War']['weapons']['4'] unitFive = myNation[0]['War']['weapons']['5'] unitSix = myNation[0]['War']['weapons']['6'] unitSeven = myNation[0]['War']['weapons']['7'] unitEight = myNation[0]['War']['weapons']['8'] print('+++++++++++++++++++++++++++++++++++++++++++++++++++') print(' WEAPONS DEPOT :X ') print('+++++++++++++++++++++++++++++++++++++++++++++++++++') print('') print('My Team : ' + str(myNation[1])) print('Year : ' + str(year)) print('Might : ' + str(myNation[0]['War']['might'])) print('Rank : ' + str(myNation[0]['War']['level'])) print('Light Unit : ' + str(unitOne[1] + unitTwo[1])) print('Core Division : ' + str(unitThree[1] + unitFour[1] + unitFive[1])) print('Heavy Forces : ' + str(unitSix[1] + unitSeven[1])) print('SuperWeapons : ' + str(unitEight[1])) print('Firepower : ' + str(myNation[0]['War']['firePower'])) print(' ') print('') print(""" (╯°□°)--︻╦╤─ - - - """) flag = showAssets(myNation, year, flag) print('') print('[B] Build') print('[S] Scrap') print(' ') print(' ') print('[V] View my units') print('[R] Return') print(' ') print(' ') print(' ') print('Moves: ' + str(checkMoves(myNation, "%^")[0])) print('****************************************') print(' ') print(' ') # CHECK MAX MOVES SINCE INSIDE WHILE LOOP returnCode = checkMoves(myNation, '%^')[1] if returnCode > 0: fast_print('All moves used up') return (myNation) warSelection = str(input('Please chose an option \n')).upper() if warSelection == 'B': myNation = buildMenu(myNation, year, WAR_BRIEFING) if warSelection == 'S': myNation = scrapMenu(myNation, year, WAR_BRIEFING) if warSelection == 'T': fast_print('not ready') if warSelection == 'T': fast_print('not ready') if warSelection == 'V': flag = 'yes' if warSelection == 'R' or warSelection == '': return (myNation) return (myNation)
def investMenu(myNation, year, PRICE_TRACKER, NATION_ARRAY): investFlag = '' friendshipFlag = 'n' investSelection = ' ' while investSelection != 'XYZFFJJJJJJ': clearScreen() myWealth = myNation[0]['Finance']['wealth'] print('+++++++++++++++++++++++++++++++++++++++++++++++++++') print(' $$$ INVESTMENT HUB $$$ ') print('+++++++++++++++++++++++++++++++++++++++++++++++++++') print('') print('My Team: ' + str(myNation[1])) print('Year: ' + str(year)) print('Wealth : ' + str(myNation[0]['Finance']['wealth'])) print('Level : ' + str(myNation[0]['Finance']['level'])) print(' ') investFlag = showResources(myNation, year, PRICE_TRACKER, investFlag) friendshipFlag = showFriendship(myNation, friendshipFlag) print('') print('[C] Invest in Countries') print('[G] Speculate on Gold') print('[O] Speculate on Oil') print('[D] Speculate on Diamonds and Gems') print('[M] Speculate on Rare Metals') print(' ') print(' ') print(' ') print('[R] Show My Resources') print('[S] Show Marketplace stock') print('[H] Show historical prices') print('[F] Show Friendships') print('[X] Exit') print(' ') print(' ') print(' ') print('Moves: ' + str(checkMoves(myNation, "%^")[0])) print('****************************************') print(' ') print(' ') returnCode = checkMoves(myNation, '%^')[1] if returnCode > 0: fast_print('All moves used up') return (myNation) investSelection = str(input('Please chose an option \n')).upper() if investSelection == 'C': myNation = investCountry(myNation, NATION_ARRAY) if investSelection == 'G': myNation = investResource(myNation, NATION_ARRAY, PRICE_TRACKER, 'gold') if investSelection == 'O': myNation = investResource(myNation, NATION_ARRAY, PRICE_TRACKER, 'oil') if investSelection == 'D': myNation = investResource(myNation, NATION_ARRAY, PRICE_TRACKER, 'gems') if investSelection == 'M': myNation = investResource(myNation, NATION_ARRAY, PRICE_TRACKER, 'raremetals') if investSelection == 'S': for item in PRICE_TRACKER: print( str(item) + ' stock available to buy : ' + str((PRICE_TRACKER[item]['stock']))) print('') input('Press enter to continue \n') if investSelection == 'H': for item in PRICE_TRACKER: print('Historical ' + str(item) + ' prices: ' + str((PRICE_TRACKER[item]['history']))) print('') input('Press enter to continue \n') if investSelection == 'F': friendshipFlag = 'Y' if investSelection == 'R': investFlag = 'Y' if investSelection == 'X' or investSelection == '': return (myNation) return (myNation)
def buildMenu(myNation, year, WAR_BRIEFING): era = myNation[0]['Tech']['era'] WARONE = WAR_BRIEFING['weapons'][era]['1'] WARTWO = WAR_BRIEFING['weapons'][era]['2'] WARTHREE = WAR_BRIEFING['weapons'][era]['3'] WARFOUR = WAR_BRIEFING['weapons'][era]['4'] WARFIVE = WAR_BRIEFING['weapons'][era]['5'] WARSIX = WAR_BRIEFING['weapons'][era]['6'] WARSEVEN = WAR_BRIEFING['weapons'][era]['7'] WAREIGHT = WAR_BRIEFING['weapons'][era]['8'] flag = '' buildSelection = ' ' show = 'off' price = 'off' while buildSelection != 'XYZFFJJJJJJ': clearScreen() unitOne = myNation[0]['War']['weapons']['1'] unitTwo = myNation[0]['War']['weapons']['2'] unitThree = myNation[0]['War']['weapons']['3'] unitFour = myNation[0]['War']['weapons']['4'] unitFive = myNation[0]['War']['weapons']['5'] unitSix = myNation[0]['War']['weapons']['6'] unitSeven = myNation[0]['War']['weapons']['7'] unitEight = myNation[0]['War']['weapons']['8'] firstTech = myNation[0]['Tech']['researched']['one'] secondTech = myNation[0]['Tech']['researched']['two'] thirdTech = myNation[0]['Tech']['researched']['three'] fourthTech = myNation[0]['Tech']['researched']['four'] fifthTech = myNation[0]['Tech']['researched']['five'] techLevel = myNation[0]['Tech']['level'] print('+++++++++++++++++++++++++++++++++++++++++++++++++++') print(' WEAPONS PROCUREMENT :X ') print('+++++++++++++++++++++++++++++++++++++++++++++++++++') print('') print('My Team : ' + str(myNation[1])) print('Year : ' + str(year)) print('Might : ' + str(myNation[0]['War']['might'])) print('Wealth : ' + str(myNation[0]['Finance']['wealth'])) print('Tech Lv : ' + str(techLevel)) print('') print('') print('SuperWeapons: ' + str(unitEight[1])) print('Total Firepower : ' + str(myNation[0]['War']['firePower'])) print(' ') print('') print(""" (╯°□°)--︻╦╤─ - - - """) print('') print('Build') print('[A] ' + str(unitOne[0])) print('[B] ' + str(unitTwo[0])) print('[C] ' + str(unitThree[0])) print('[D] ' + str(unitFour[0])) print('[E] ' + str(unitFive[0])) print('[F] ' + str(unitSix[0])) print('[G] ' + str(unitSeven[0])) print('[H] ' + str(unitEight[0])) print('') print('') if price == 'on': print('======================') print(' Pricings ') print('======================') print('______________________') print('Light Unit :') print('----------------------') print(str(WARONE[0]) + ' = $' + str(WARONE[2])) print('buildTime = ' + str(WARONE[3])) print('MightPoints = +' + str(WARONE[4]) + '%') print('') print(str(WARTWO[0]) + ' = $' + str(WARTWO[2])) print('buildTime = ' + str(WARTWO[3])) print('MightPoints = +' + str(WARTWO[4]) + '%') print('') print('______________') print('Core Division : ') print('--------------') print(str(WARTHREE[0]) + ' = $' + str(WARTHREE[2])) print('buildTime = ' + str(WARTHREE[3])) print('MightPoints = +' + str(WARTHREE[4]) + '%') print('') print(str(WARFOUR[0]) + ' = $' + str(WARFOUR[2])) print('buildTime = ' + str(WARFOUR[3])) print('MightPoints = +' + str(WARFOUR[4]) + '%') print('') print(str(WARFIVE[0]) + ' = $' + str(WARFIVE[2])) print('buildTime = ' + str(WARFIVE[3])) print('MightPoints = +' + str(WARFIVE[4]) + '%') print('') print('______________') print('Heavy Forces : ') print('--------------') print(str(WARSIX[0]) + ' = $' + str(WARSIX[2])) print('buildTime = ' + str(WARSIX[3])) print('MightPoints = +' + str(WARSIX[4]) + '%') print('') print(str(WARSEVEN[0]) + ' = $' + str(WARSEVEN[2])) print('buildTime = ' + str(WARSEVEN[3])) print('MightPoints = +' + str(WARSEVEN[4]) + '%') print('') print('') print(str(WAREIGHT[0]) + ' = $' + str(WAREIGHT[2])) print('buildTime = ' + str(WAREIGHT[3])) print('MightPoints = +' + str(WAREIGHT[4]) + '%') print('') fast_print('Press Enter to clear ') price = 'off' print('') if show == 'on': print('Light Unit : ' + str(unitOne[1] + unitTwo[1])) print('--------------') print(str(unitOne[0]) + ' : ' + str(unitOne[1])) print(str(unitTwo[0]) + ' : ' + str(unitTwo[1])) print('') print('Core Division : ' + str(unitThree[1] + unitFour[1] + unitFive[1])) print('--------------') print(str(unitThree[0]) + ' : ' + str(unitThree[1])) print(str(unitFour[0]) + ' : ' + str(unitFour[1])) print(str(unitFive[0]) + ' : ' + str(unitFive[1])) print('') print('Heavy Forces: ' + str(unitSix[1] + unitSeven[1])) print('--------------') print(str(unitSix[0]) + ' : ' + str(unitSix[1])) print(str(unitSeven[0]) + ' : ' + str(unitSeven[1])) print('') print('Super Weapon') print('--------------') print(str(unitEight[0]) + ' : ' + str(unitEight[1])) fast_print('press Enter to clear') print(' ') show = 'off' print('Options') print('[V] View your units') print('[P] Get Unit pricings') print('[R] Return') print(' ') print(' ') print(' ') print('Moves: ' + str(checkMoves(myNation, "%^")[0])) print('****************************************') print(' ') print(' ') # CHECK MAX MOVES SINCE INSIDE WHILE LOOP returnCode = checkMoves(myNation, '%^')[1] if returnCode > 0: fast_print('All moves used up') return (myNation) buildSelection = str(input('Please chose an option \n')).upper() # LIGHT UNIT if buildSelection == 'A': clearScreen() myNation = buildUnits(myNation, year, WAR_BRIEFING, unit='1') if buildSelection == 'B': clearScreen() if firstTech[2] < 100: print('You need to complete ' + str(firstTech[1]) + ' development to unlock.') fast_print('Your Tech level is not high enough') continue myNation = buildUnits(myNation, year, WAR_BRIEFING, unit='2') # CORE DIVISION if buildSelection == 'C': clearScreen() if secondTech[2] < 100: print('You need to complete ' + str(secondTech[1]) + ' development to unlock.') fast_print('Your Tech level is not high enough') continue myNation = buildUnits(myNation, year, WAR_BRIEFING, unit='3') if buildSelection == 'D': clearScreen() if thirdTech[2] < 100: print('You need to complete ' + str(thirdTech[1]) + ' development to unlock.') fast_print('Your Tech level is not high enough') continue myNation = buildUnits(myNation, year, WAR_BRIEFING, unit='4') if buildSelection == 'E': clearScreen() if thirdTech[2] < 100: print('You need to complete ' + str(thirdTech[1]) + ' development to unlock.') fast_print('Your Tech level is not high enough') continue myNation = buildUnits(myNation, year, WAR_BRIEFING, unit='5') # HEAVY FORCES if buildSelection == 'F': clearScreen() if fourthTech[2] < 100: print('You need to complete ' + str(fourthTech[1]) + ' development to unlock.') fast_print('Your Tech level is not high enough') continue myNation = buildUnits(myNation, year, WAR_BRIEFING, unit='6') if buildSelection == 'G': clearScreen() if fourthTech[2] < 100: print('You need to complete ' + str(fourthTech[1]) + ' development to unlock.') fast_print('Your Tech level is not high enough') continue myNation = buildUnits(myNation, year, WAR_BRIEFING, unit='7') # SUPER WEAPON if buildSelection == 'H': clearScreen() if fifthTech[2] < 100: print('You need to complete ' + str(fifthTech[1]) + ' development to unlock.') fast_print('Your Tech level is not high enough') continue myNation = buildUnits(myNation, year, WAR_BRIEFING, unit='8') if buildSelection == 'V': clearScreen() show = 'on' if buildSelection == 'P': clearScreen() price = 'on' if buildSelection == 'R' or buildSelection == '': return (myNation) return (myNation)
def missionsMenu(myNation, NATION_ARRAY, year, WAR_BRIEFING): flag = '' friendshipFlag = '' missionSelection = ' ' while missionSelection != 'XYZFFJJJJJJ': clearScreen() unitOne = myNation[0]['War']['weapons']['1'] unitTwo = myNation[0]['War']['weapons']['2'] unitThree = myNation[0]['War']['weapons']['3'] unitFour = myNation[0]['War']['weapons']['4'] unitFive = myNation[0]['War']['weapons']['5'] unitSix = myNation[0]['War']['weapons']['6'] unitSeven = myNation[0]['War']['weapons']['7'] unitEight = myNation[0]['War']['weapons']['8'] print('+++++++++++++++++++++++++++++++++++++++++++++++++++') print(' MISSION PLANNING :X ') print('+++++++++++++++++++++++++++++++++++++++++++++++++++') print('') print('My Team : ' + str(myNation[1])) print('Year : ' + str(year)) print('Might : ' + str(myNation[0]['War']['might'])) print('Rank : ' + str(myNation[0]['War']['level'])) print('Light Unit : ' + str(unitOne[1] + unitTwo[1])) print('Core Division : ' + str(unitThree[1] + unitFour[1] + unitFive[1])) print('Heavy Forces : ' + str(unitSix[1] + unitSeven[1])) print('SuperWeapons : ' + str(unitEight[1])) print('Firepower : ' + str(myNation[0]['War']['firePower'])) print(' ') flag = showAssets(myNation, year, flag) friendshipFlag = showFriendship(myNation, friendshipFlag) print('') print('[E] Espionage') print('[C] Covert Operations') print('[T] Tactical Strike') print('[D] Declare War') print(' ') print(' ') print(' ') print('[F] Show Friendships (Internaitonal Relations)') print('[S] Show Military Assets') print('[H] Help & Explanation') print('[R] Return') print(' ') print(' ') print(' ') print('Moves: ' + str(checkMoves(myNation, "%^")[0])) print('****************************************') print(' ') print(' ') returnCode = checkMoves(myNation, '%^')[1] if returnCode > 0: fast_print('All moves used up') return (myNation) missionSelection = str(input('Please chose an option \n')).upper() if missionSelection == 'E': myNation = espionage(myNation, NATION_ARRAY, WAR_BRIEFING) if missionSelection == 'C': myNation = covert(myNation, NATION_ARRAY, WAR_BRIEFING) if missionSelection == 'T': fast_print('not ready') if missionSelection == 'D': fast_print('not ready') if missionSelection == 'F': friendshipFlag = 'Y' if missionSelection == 'S': flag = 'yes' if missionSelection == 'H': print('*****Explanation of Options *****') print('') print( 'ESPIONAGE: Obtains intel about enemy, a small amount of points and forces them to skip a round. May incur loss in friendship if found out.' ) print( 'COVERT OPERATIONS: Damage an enemy moderately, possibility of stealing resources, May incur signiciant loss in friendship if found out.' ) print( 'TACTICAL STRIKE: Damage an enemy severely, signiciant drop in friendship and possible repercussions.' ) print( 'DECLARE WAR: Forces the enemy into a round by round battle of attrition, only military moves can be carried out. You can win, lose, surrender or offer a truce. Will lose some global backing.' ) print( '***All Options depend on your frienship levels with the nation state.' ) print('') input('Enter to continue') if missionSelection == 'R' or missionSelection == '': return (myNation) return (myNation)
def researchMenu(myNation, year, TECH_MAP): flag = '' advanceFlag = 'On' researchSelection = ' ' while researchSelection != 'XYZFFJJJJJJ': one = myNation[0]['Tech']['researched']['one'] two = myNation[0]['Tech']['researched']['two'] three = myNation[0]['Tech']['researched']['three'] four = myNation[0]['Tech']['researched']['four'] five = myNation[0]['Tech']['researched']['five'] clearScreen() print('+++++++++++++++++++++++++++++++++++++++++++++++++++') print(' 777777 RESEARCH HUB 7777777 ') print('+++++++++++++++++++++++++++++++++++++++++++++++++++') print('') print('My Team : ' + str(myNation[1])) print('Year : ' + str(year)) print('Knowledge (KP) : ' + str(myNation[0]['Tech']['knowledge'])) print('Era : ' + str(myNation[0]['Tech']['era'])) print('Research Points (RP) : ' + str(myNation[0]['Tech']['research points'])) print('Level : ' + str(myNation[0]['Tech']['level'])) print(' ') print('') print('Development Completion') print('===================') if advanceFlag == 'On': advanceFlag = PrintResearch([one, two, three, four, five]) flag = showAssets(myNation, year, flag) print('') printCurrentResearch(myNation) print('') print('[A] Advance Era') print('[D] Develop Technology') print('[G] Research Grant') print('[P] Purchase Technology') print('[R] Return') print(' ') print(' ') print(' ') print('Moves: ' + str(checkMoves(myNation, "%^")[0])) print('****************************************') print(' ') print(' ') researchSelection = str(input('Please chose an option \n')).upper() if researchSelection == 'A': myNation = advanceEra(myNation, one, two, three, four, five, TECH_MAP, era=myNation[0]['Tech']['era']) if researchSelection == 'D': myNation = selectTech(myNation, one, two, three, four, five, TECH_MAP) if researchSelection == 'G': myNation = gainResearchPoints(myNation) if researchSelection == 'P': print('not ready..') if researchSelection == 'S': flag = 'yes' if researchSelection == 'R' or researchSelection == '': return (myNation) return (myNation)
def drillMenu(myNation, year, WAR_BRIEFING): drillSelection = ' ' flag = '' while drillSelection != 'XYZFFJJJJJJ': clearScreen() unitOne = myNation[0]['War']['weapons']['1'] unitTwo = myNation[0]['War']['weapons']['2'] unitThree = myNation[0]['War']['weapons']['3'] unitFour = myNation[0]['War']['weapons']['4'] unitFive = myNation[0]['War']['weapons']['5'] unitSix = myNation[0]['War']['weapons']['6'] unitSeven = myNation[0]['War']['weapons']['7'] unitEight = myNation[0]['War']['weapons']['8'] print('+++++++++++++++++++++++++++++++++++++++++++++++++++') print(' !!MILITARY DRILL HEADQUARTERS!! :X ') print('+++++++++++++++++++++++++++++++++++++++++++++++++++') print('') print('My Team : ' + str(myNation[1])) print('Year : ' + str(year)) print('Might : ' + str(myNation[0]['War']['might'])) print('Rank : ' + str(myNation[0]['War']['level'])) print('Light Unit : ' + str(unitOne[1] + unitTwo[1])) print('Core Division : ' + str(unitThree[1] + unitFour[1] + unitFive[1])) print('Heavy Forces : ' + str(unitSix[1] + unitSeven[1])) print('SuperWeapons : ' + str(unitEight[1])) print('Firepower : ' + str(myNation[0]['War']['firePower'])) print(' ') print(' ') flag = showAssets(myNation, year, flag) print('') print('[L] Light Unit') print('[C] Core Division ') print('[H] Heavy Forces') print(' ') print(' ') print('[D] Detailed forces review') print('[R] Return') print(' ') print(' ') print(' ') print('Moves: ' + str(checkMoves(myNation, "%^")[0])) print('****************************************') print(' ') print(' ') # CHECK MAX MOVES SINCE INSIDE WHILE LOOP returnCode = checkMoves(myNation, '%^')[1] if returnCode > 0: fast_print('All moves used up') return (myNation) drillSelection = input('Select a divison to train \n').upper() clearScreen() if drillSelection == 'L': if (unitOne[1] + unitTwo[1]) < 1: input('No Light assets to train... \n') break units = [('1', unitOne[1]), ('2', unitTwo[1])] myNation = drill(myNation, 'Light Units', units, WAR_BRIEFING) if drillSelection == 'C': if (unitThree[1] + unitFour[1] + unitFive[1]) < 1: input('No navy assets to train... \n') break units = [('3', unitThree[1]), ('4', unitFour[1]), ('5', unitFive[1])] myNation = drill(myNation, 'Core Division', units, WAR_BRIEFING) if drillSelection == 'H': if (unitSix[1] + unitSeven[1]) < 1: input('No airforce assets to train... \n') break units = [('6', unitSix[1]), ('7', unitSeven[1])] myNation = drill(myNation, 'Heavy Forces', units, WAR_BRIEFING) if drillSelection == 'D': flag = 'yes' if drillSelection == 'R' or drillSelection == '': return (myNation) return (myNation)
def warMinistry(myNation, NATION_ARRAY, year, WAR_BRIEFING): flag = '' warSelection = ' ' while warSelection != 'XYZFFJJJJJJ': clearScreen() # NUMER unitOne = myNation[0]['War']['weapons']['1'][1] unitTwo = myNation[0]['War']['weapons']['2'][1] unitThree = myNation[0]['War']['weapons']['3'][1] unitFour = myNation[0]['War']['weapons']['4'][1] unitFive = myNation[0]['War']['weapons']['5'][1] unitSix = myNation[0]['War']['weapons']['6'][1] unitSeven = myNation[0]['War']['weapons']['7'][1] unitEight = myNation[0]['War']['weapons']['8'][1] print('+++++++++++++++++++++++++++++++++++++++++++++++++++') print(' WELCOME TO THE MINISTRY OF WAR :X ') print('+++++++++++++++++++++++++++++++++++++++++++++++++++') print('') print('My Team : ' + str(myNation[1])) print('Year : ' + str(year)) print('Might : ' + str(myNation[0]['War']['might'])) print('Rank : ' + str(myNation[0]['War']['level'])) print('Firepower : ' + str(myNation[0]['War']['firePower'])) print(' ') print('') print(""" (╯°□°)--︻╦╤─ - - - """) flag = showAssets(myNation, year, flag) print('') print('[C] Combat Manevres') print('[W] Weapons') print('[O] Offensive Missions') print(' ') print(' ') print(' ') print(' ') print('[A] Show Military Assets') print('[R] Return') print(' ') print(' ') print(' ') print('Moves: ' + str(checkMoves(myNation, "%^")[0])) print('****************************************') print(' ') print(' ') warSelection = str(input('Please chose an option \n')).upper() if warSelection == 'C': myNation = manoeuvresMenu(myNation, year, WAR_BRIEFING) if warSelection == 'W': myNation = weaponsMenu(myNation, year, WAR_BRIEFING) if warSelection == 'O': myNation = missionsMenu(myNation, NATION_ARRAY, year, WAR_BRIEFING) if warSelection == 'T': fast_print('not ready') if warSelection == 'T': fast_print('not ready') if warSelection == 'A': flag = 'yes' if warSelection == 'R' or warSelection == '': return (myNation) return (myNation)
print('[L] View Leaderboard') print('[F] Finance bureau') print('[W] Ministry of War') print('[P] Political Cabinet (not available)') print('[T] Technology Institute') print('[N] Next Year') print(' ') print(' ') menuUpdate() print(' ') print(' ') print('[O] Options') print('[U] Updates') print('[X] Exit') print(' ') print('Moves: ' + str(checkMoves(myNation, "%^")[0]) + ' [U] ' + str(out)) print('****************************************') print(' ') print(' ') menuSelection = str( input('What would you like to do ' + str(userName) + '? \n')).upper() if menuSelection == 'L': stats(NATION_ARRAY) if menuSelection == 'F': myNation = fin.financeBeuro(myNation, year, PRICE_TRACKER, NATION_ARRAY) if menuSelection == 'W': myNation = warMenu.warMinistry(myNation, NATION_ARRAY, year, WAR_BRIEFING)
def scrapMenu(myNation, year, WAR_BRIEFING): era = myNation[0]['Tech']['era'] WARONE = WAR_BRIEFING['weapons'][era]['1'] WARTWO = WAR_BRIEFING['weapons'][era]['2'] WARTHREE = WAR_BRIEFING['weapons'][era]['3'] WARFOUR = WAR_BRIEFING['weapons'][era]['4'] WARFIVE = WAR_BRIEFING['weapons'][era]['5'] WARSIX = WAR_BRIEFING['weapons'][era]['6'] WARSEVEN = WAR_BRIEFING['weapons'][era]['7'] WAREIGHT = WAR_BRIEFING['weapons'][era]['8'] flag = '' buildSelection = ' ' show = 'off' price = 'off' while buildSelection != 'XYZFFJJJJJJ': clearScreen() unitOne = myNation[0]['War']['weapons']['1'] unitTwo = myNation[0]['War']['weapons']['2'] unitThree = myNation[0]['War']['weapons']['3'] unitFour = myNation[0]['War']['weapons']['4'] unitFive = myNation[0]['War']['weapons']['5'] unitSix = myNation[0]['War']['weapons']['6'] unitSeven = myNation[0]['War']['weapons']['7'] unitEight = myNation[0]['War']['weapons']['8'] techLevel = myNation[0]['Tech']['level'] print('+++++++++++++++++++++++++++++++++++++++++++++++++++') print(' SCRAP YARD :X ') print('+++++++++++++++++++++++++++++++++++++++++++++++++++') print('') print('My Team : ' + str(myNation[1])) print('Year : ' + str(year)) print('Might : ' + str(myNation[0]['War']['might'])) print('Wealth : ' + str(myNation[0]['Finance']['wealth'])) print('Tech Lv : ' + str(techLevel)) print('') print('') print('SuperWeapons: ' + str(unitEight[1])) print('Total Firepower : ' + str(myNation[0]['War']['firePower'])) print(' ') print('') print(""" (╯°□°)--︻╦╤─ - - - """) print('') print('Scrap') print('[A] ' + str(unitOne[0])) print('[B] ' + str(unitTwo[0])) print('[C] ' + str(unitThree[0])) print('[D] ' + str(unitFour[0])) print('[E] ' + str(unitFive[0])) print('[F] ' + str(unitSix[0])) print('[G] ' + str(unitSeven[0])) print('[H] ' + str(unitEight[0])) print('') print('') if price == 'on': print('======================') print(' VALUATIONS ') print('======================') print('______________________') print('Light Unit :') print('----------------------') print(str(WARONE[0]) + ' = $' + str(WARONE[2])) print('buildTime = ' + str(WARONE[3])) print('MightPoints = +' + str(WARONE[4]) + '%') print('') print(str(WARTWO[0]) + ' = $' + str(WARTWO[2])) print('buildTime = ' + str(WARTWO[3])) print('MightPoints = +' + str(WARTWO[4]) + '%') print('') print('______________') print('Core Division : ') print('--------------') print(str(WARTHREE[0]) + ' = $' + str(WARTHREE[2])) print('buildTime = ' + str(WARTHREE[3])) print('MightPoints = +' + str(WARTHREE[4]) + '%') print('') print(str(WARFOUR[0]) + ' = $' + str(WARFOUR[2])) print('buildTime = ' + str(WARFOUR[3])) print('MightPoints = +' + str(WARFOUR[4]) + '%') print('') print(str(WARFIVE[0]) + ' = $' + str(WARFIVE[2])) print('buildTime = ' + str(WARFIVE[3])) print('MightPoints = +' + str(WARFIVE[4]) + '%') print('') print('______________') print('Heavy Forces : ') print('--------------') print(str(WARSIX[0]) + ' = $' + str(WARSIX[2])) print('buildTime = ' + str(WARSIX[3])) print('MightPoints = +' + str(WARSIX[4]) + '%') print('') print(str(WARSEVEN[0]) + ' = $' + str(WARSEVEN[2])) print('buildTime = ' + str(WARSEVEN[3])) print('MightPoints = +' + str(WARSEVEN[4]) + '%') print('') print('') print(str(WAREIGHT[0]) + ' = $' + str(WAREIGHT[2])) print('buildTime = ' + str(WAREIGHT[3])) print('MightPoints = +' + str(WAREIGHT[4]) + '%') print('') fast_print('Press Enter to clear ') print('') price = 'off' if show == 'on': print('Light Unit : ' + str(unitOne[1] + unitTwo[1])) print('--------------') print(str(unitOne[0]) + ' : ' + str(unitOne[1])) print(str(unitTwo[0]) + ' : ' + str(unitTwo[1])) print('') print('Core Division : ' + str(unitThree[1] + unitFour[1] + unitFive[1])) print('--------------') print(str(unitThree[0]) + ' : ' + str(unitThree[1])) print(str(unitFour[0]) + ' : ' + str(unitFour[1])) print(str(unitFive[0]) + ' : ' + str(unitFive[1])) print('') print('Heavy Forces: ' + str(unitSix[1] + unitSeven[1])) print('--------------') print(str(unitSix[0]) + ' : ' + str(unitSix[1])) print(str(unitSeven[0]) + ' : ' + str(unitSeven[1])) print('') print('Super Weapon') print('--------------') print(str(unitEight[0]) + ' : ' + str(unitEight[1])) print('') fast_print('press Enter to clear') print(' ') show = 'off' print('Options') print('[V] View your units') print('[P] Get Unit scrap valuation') print('[R] Return') print(' ') print(' ') print(' ') print('Moves: ' + str(checkMoves(myNation, "%^")[0])) print('****************************************') print(' ') print(' ') # CHECK MAX MOVES SINCE INSIDE WHILE LOOP returnCode = checkMoves(myNation, '%^')[1] if returnCode > 0: print('Moves used up.') return (myNation) buildSelection = str(input('Please chose an option \n')).upper() if buildSelection == 'A': clearScreen() if unitOne[1] < 1: fast_print('You dont have any to scrap..') continue myNation = scrapUnits(myNation, year, WAR_BRIEFING, '1') if buildSelection == 'B': clearScreen() if unitTwo[1] < 1: fast_print('You dont have any to scrap..') continue myNation = scrapUnits(myNation, year, WAR_BRIEFING, '2') if buildSelection == 'C': clearScreen() if unitThree[1] < 1: fast_print('You dont have any to scrap..') continue myNation = scrapUnits(myNation, year, WAR_BRIEFING, '3') if buildSelection == 'D': clearScreen() if unitFour[1] < 1: fast_print('You dont have any to scrap..') continue myNation = scrapUnits(myNation, year, WAR_BRIEFING, '4') if buildSelection == 'E': clearScreen() if unitFive[1] < 1: fast_print('You dont have any to scrap..') continue myNation = scrapUnits(myNation, year, WAR_BRIEFING, '5') if buildSelection == 'F': clearScreen() if unitSix[1] < 1: fast_print('You dont have any to scrap..') continue myNation = scrapUnits(myNation, year, WAR_BRIEFING, '6') if buildSelection == 'G': clearScreen() if unitSeven[1] < 1: fast_print('You dont have any to scrap..') continue myNation = scrapUnits(myNation, year, WAR_BRIEFING, '7') if buildSelection == 'H': clearScreen() if unitEight[1] < 1: fast_print('You dont have any to scrap..') continue myNation = scrapUnits(myNation, year, WAR_BRIEFING, '8') if buildSelection == 'V': clearScreen() show = 'on' if buildSelection == 'P': clearScreen() price = 'on' if buildSelection == 'R' or buildSelection == '': return (myNation) return (myNation)