Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import time
- global eggs
- eggs = 0
- global queen_health
- queen_health = 5
- global battle_ants
- battle_ants = 2
- global work_ants
- work_ants = 5
- global game_name
- game_name = "Antz"
- global food
- food = 0
- global defense
- defense = battle_ants*2+work_ants
- global day
- day = 1
- global ant_pop
- ant_pop = 1+battle_ants+work_ants
- global work_energy
- work_energy = 5
- global rest
- rest = 2
- global babys
- babys = 0
- global colony
- colony = ""
- global name
- name = ""
- start()
- def start():
- global name
- print "Welcome to the World of Ants!"
- time.sleep(1)
- print ""
- print ""
- name = raw_input("Please choose a name for your queen:")
- print "Alright ",name," you're ready to go!"
- print "I must warn you,",name," that this world is a dangerous place."
- time.sleep(1)
- print "Make sure to watch out for different dangers."
- ready = raw_input("Continue Y/N:")
- if ready=="Y":pre()
- else:
- print "Okay then."
- def pre():
- print "You move away from your family's colony."
- time.sleep(1)
- print "You will need 100 pieces of food, 5 carpenter ants and 2 fire ants to start a colony."
- time.sleep(1)
- print "When you have reached this goal you may type establish, to establish your colony."
- time.sleep(1)
- print "To get started try forging by typing 'forge'."
- command = raw_input("Command:")
- if command=="forge": s_forge()
- def pre_2():
- if food > 99:
- print "Good Job! You've collected the required food to start a colony."
- print "You now must recruit a few ants to join your empire!"
- recruit_pre()
- else:
- command = raw_input("Command:")
- if command=="forge": s_forge()
- else: pre_2()
- def s_forge():
- global food
- print "Please wait 3 seconds."
- print "3 Seconds remaining."
- time.sleep(1)
- print "2 Seconds remaining."
- time.sleep(1)
- print "1 Second remaining."
- col = random.random()
- food1 = col+50
- food = food+col+50
- print "Food Collected:",food1
- print "Total Food:",food
- pre_2()
- def recruit_pre():
- global name
- global colony
- print "To recruit that ants needed type recruit."
- recruit = raw_input("Command:")
- if recruit=="recruit":
- print "You're ready to establish your colony,",name,"!"
- colony = raw_input("Please name your colony:")
- print "Alright,",name," your ants are hard at work building ",colony,"."
- time.sleep(1)
- print "Please wait 5 seconds as they build ",colony,"."
- print "5"
- time.sleep(1)
- print "4"
- time.sleep(1)
- print "3"
- time.sleep(1)
- print "2"
- time.sleep(1)
- print "1"
- print "You colony has been constructed!"
- day_s()
- else: recruit_pre()
- def day_s():
- global ant_pop
- global eggs
- global queen_health
- global battle_ants
- global work_ants
- global game_name
- global food
- global defense
- global day
- global work_energy
- global rest
- global babys
- print "Day:",day
- print ""
- print "Total Ant Population:",ant_pop
- print " Carpenter Ants:",work_ants
- print " Fire Ants:",battle_ants
- print " Unassign workers:",babys
- print ""
- print "Food Supplies:",food
- print "Carpenter Ant's Energy:",work_energy
- command = raw_input("Command:")
- if command =="recruit":
- recruit_pre()
- if command =="forge":
- collect()
- if command == "rest":
- if rest > 0:
- rest = rest-1
- print "please wait 3 seconds."
- time.sleep(1)
- print "2 seconds remaining"
- time.sleep(1)
- print "1 second remaining"
- time.sleep(1)
- work_energy=work_energy+1
- print "Total work energy:",work_energy
- else:
- print "You can't rest anymore this day!"
- print "Please end the day and try again"
- time.sleep(1)
- print ""
- day_s()
- if command == "reproduce":
- reproduce()
- if command == "end":
- pre_day = day
- day=day+1
- food = food-ant_pop
- babys = ant_pop/6
- ant_pop=ant_pop+babys
- rest = 2
- work_energy = 4
- ant_pop=battle_ants+work_ants+1+babys
- print "The day has ended."
- print ""
- print "Day",pre_day," Information"
- print "Food Used:",ant_pop
- print "Babys Born:",babys
- print ""
- print ""
- if food < 1: food = 0
- print "You colony is starving!"
- percentage = work_ants/10
- work_ants = work_ants+percentage
- p_fire_ants = battle_ants/20
- work_ants = work_ants+p_fire_ants
- dif_fire = battle_ants-p_fire_ants
- dif_work = work_ants-percentage
- print "Fire Ant Deaths:",dif_fire
- print "Carpenter Ant Deaths:",dif_work
- print "Please consider forging!"
- time.sleep(2)
- day_s()
- day_s()
- def collect():
- global food
- global work_ants
- global work_energy
- if work_ants > 0:
- if work_energy > 0:
- print "Your ants are collecting food..."
- print "please wait 3 seconds."
- time.sleep(1)
- print "2 seconds remaining"
- time.sleep(1)
- print "1 second remaining"
- time.sleep(1)
- work_energy=work_energy-1
- food_collect = random.random()
- food_add = food_collect+work_ants
- food = food+food_add
- food_bonus = random.random()
- if food_bonus > 0.7:
- print "While your ants were out collecting food they came upon a large mass of food dropped by humans."
- choice = raw_input("Would you like to collect this food Y/N:")
- if choice=="Y":
- food=food+25
- work_ants=work_ants-5
- print "Food collected: 25"
- print "Work Ant Deaths:5"
- day_s()
- else: s_forge()
- print "You've collected ",food_add," pieces of food."
- print "Total food:",food
- print ""
- print "-----------------"
- print ""
- day_s()
- else:
- print "You don't have enough energy to perform forging!"
- print ""
- print ""
- time.sleep(2)
- day_s()
- def reproduce():
- global eggs
- global work_ants
- global battle_ants
- global food
- choice = raw_input("Would you like to breed fire ants or carpenter ants:")
- if choice=="fire ants":
- if food > 4: breed_cal = food
- fire_ant_cost = 5
- number = breed_cal/fire_ant_cost-5
- print "You can breed ",number
- number_breed = float (raw_input("How many:"))
- if number_breed < number:
- battle_ants = (battle_ants * 1)+ number_breed
- number_breed = number_breed*5
- food = food-number_breed
- print "Total Fire Ants:",battle_ants
- day_s()
- else:
- print "You don't have enough food for that many fire ants!"
- day_s()
- else: print "Unknown command."
- reproduce()
- if choice=="carpenter ants":
- if food > 2:
- breed_cal = food
- carp_ant_cost = 3
- number = breed_cal/carp_ant_cost-3
- print "You can breed ",number
- number_breed = float (raw_input("How many:"))
- if number_breed < number:
- work_ants = (work_ants * 1)+ number_breed
- number_breed = number_breed*3
- food = food-number_breed
- print "Total Carpenter Ants:",work_ants
- day_s()
- else: print "You don't have enough food for that many carpenter ants!"
- day_s()
- else: print "Unknown command."
- reproduce()
- else: print "Unknown command."
- reproduce()
- def assign():
- global babys
- global work_ants
- global battle_ants
- assign_ants = raw_input("")
- start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement