Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- time = 0
- sun_f = 50 # spendable sun for sunflower simulation
- sun_f_total = 0 # total earned sun for sunflowers
- sun_s = 50 # spendable sun for sunshroom simulation
- sun_s_total = 0 # total earned sun for sunshrooms
- cooldownflower = 0
- cooldownshroom = 0
- sunflowers = 0
- sunshrooms = 0
- ageflower = [] # lists for calculating income timing and shroom evolving
- ageshroom = []
- def buildsunflower():
- global sun_f
- global sunflowers
- global cooldownflower
- if sunflowers < 12:
- sun_f -= 50 # normal cost
- elif sunflowers > 11:
- sun_f -= 75 # adjusted lily pad cost for water placement after 12 land spots fill
- sunflowers += 1 # running total for sunflowers
- ageflower.append(12) # the first income packet only requires 12 instead of 24 seconds
- cooldownflower = 9 # sets sunflower build cooldown to 8 + 1 second of human error
- def buildsunshroom():
- global sun_s
- global sunshrooms
- global cooldownshroom
- if sunshrooms < 12:
- sun_s -= 25
- elif sunshrooms > 11:
- sun_s -= 50
- sunshrooms += 1
- ageshroom.append(12)
- cooldownshroom = 9
- def update():
- global time
- global cooldownflower
- global cooldownshroom
- global ageflower
- global ageshroom
- print('\t', time, '\t\t', sun_f, '/', sun_s, '\t\t', sun_f_total, '/', sun_s_total,
- '\t\t', sunflowers, '/', sunshrooms) # per second readout
- time += 1 # running total of seconds
- cooldownflower -= 1 # reduces build cooldowns from 9
- cooldownshroom -= 1
- ageflower = [x + 1 for x in ageflower] # magical aging code I don't understand yet
- ageshroom = [x + 1 for x in ageshroom]
- for n in range(300):
- if sun_f >= 50 and cooldownflower <= 0 and sunflowers < 16: # plants flower if currency,
- buildsunflower() # cooldown, and room allow
- for x in ageflower:
- if x % 24 == 0: # adds income in multiples of 24 seconds
- sun_f += 25
- sun_f_total += 25
- if sun_s >= 25 and cooldownshroom <= 0 and sunshrooms < 16:
- buildsunshroom()
- for x in ageshroom:
- if x % 24 == 0 and x > 120: # the 120 is to check for evolved shroom
- sun_s += 25
- sun_s_total += 25
- elif x % 24 == 0:
- sun_s += 15
- sun_s_total += 15
- update() # recalculates before new loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement