Beispiel #1
0
 def __init__(self, field, number, trainers):
     EffectSubject.__init__(self, field)
     self.number = number
     self.field = field
     try:
         trainers = iter(trainers)
     except TypeError:
         # We only got one trainer, make a lonely team for her
         trainers = [trainers]
     self.spots = [Spot(self, i, t) for i, t in enumerate(trainers)]
Beispiel #2
0
    def __init__(self, monster, spot, loader):
        EffectSubject.__init__(self, spot.field)
        self.monster = monster
        self.species = monster.species
        self.spot = spot

        self.stats = ComputedStats(self)
        self.stat_levels = Stats(loader.battle_stats)

        self.moves = list(monster.moves)

        self.level = monster.level
        self.types = monster.types

        self.trainer = spot.trainer

        self.ability_effect = None
        self.ability = monster.ability

        self.item_effect = None
        self.item = monster.item

        self.used_move_effects = []
Beispiel #3
0
    def __init__(self, loader, trainers, rand=random):
        """ Make a Battlefield, pitting the given trainers against each other!

        trainers is a list of lists of trainers, grouped by side.
        If there is only one trainer per side, a flat list is OK, as long as
        the trainers themselves aren't iterable.
        Note that a trainer controls more monsters at the same time, the
        single trainer must be repeated: [[blue, blue], [red, green]].
        Otherwise, the lonely trainer could only control one monster.
        """
        EffectSubject.__init__(self, self)
        self.loader = loader
        self.rand = rand
        self.message = MessageSender(self, self.message_module)
        self.sides = [Side(self, i, t) for i, t in enumerate(trainers)]

        self.observers = []

        self.struggle = self.loader.load_struggle()

        self.apply_default_effects()

        self.in_loop = False
        self.turn_number = 0