Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

Any easy way to summon 1 archer for every 2 soldiers?


I have been doing this, but it is not as efficient:

def summon():
    if > 45:


There are a few ways to do it.

  1. You could add 1 to a counter every time you summon a soldier and reset it when you summon an archer. (similar to decoy drill but resenting the count instead of break)

  2. You could use % and len(self.findFriends())

  3. There is a level in the mountain world that covers that exact topic. You could go play that.


I confirm, there is a mountain level teaching you this, bu’t I can remember the name.
The idea is to:

#define a summon array
#an a looping counther through the array

Then in your summoning function you’ll try to summon from the summonList (pseudocode):

if enough gold to summon summonList[summonNext] :
     summon summonList[summonNext]
     #increment the counter looping back to 0 if it overpasses the array length
     summonNext=(summonNext+1) % len(summonList)


Yeah, that’s definitely the better way to do it.

My method will only work for 2 types. After that will become too complicated.