예제 #1
0
 def __init__(self, prototype, square, qty):
     prototype.init_dict(self)
     self.qty = to_int(qty) # does the value come from the map? (already done in rules)
     self.qty_max = self.qty
     if self.resource_type == 1: # wood
         self.resource_regen = to_int(".01")
     Entity.__init__(self, square)
예제 #2
0
    def __init__(self, prototype, player, place, x, y, o=90):
        if prototype is not None:
            prototype.init_dict(self)
        self.orders = []

        # attributes required by transports and shelters (inside)
        self.objects = []
        self.world = place.world
        self.neighbors = []
        self.title = []

        self.set_player(player)

        # stats "with a max"
        self.hp = self.hp_max
        if self.mana_start > 0:
            self.mana = self.mana_start
        else:
            self.mana = self.mana_max

        # stat defined for the whole game
        self.minimal_damage = rules.get("parameters", "minimal_damage")
        if self.minimal_damage is None:
            self.minimal_damage = int(.17 * PRECISION)

        # move to initial place
        Entity.__init__(self, place, x, y, o)
        self.position_to_hold = place  # defend the creation place

        if self.decay:
            self.time_limit = self.world.time + self.decay
예제 #3
0
    def __init__(self, prototype, player, place, x, y, o=90):
        if prototype is not None:
            prototype.init_dict(self)
        self.orders = []
        # transport data
        self.objects = []
        self.world = place.world # XXXXXXXXXX required by transport

        # set a player
        self.set_player(player)
        # stats "with a max"
        self.hp = self.hp_max
        # Start with mana_start
        if self.mana_start > 0:
            self.mana = self.mana_start
        else:
        # start with mana_max
            self.mana = self.mana_max

        # stat defined for the whole game
        self.minimal_damage = rules.get("parameters", "minimal_damage")
        if self.minimal_damage is None:
            self.minimal_damage = DEFAULT_MINIMAL_DAMAGE

        # move to initial place
        Entity.__init__(self, place, x, y, o)

        if self.decay:
            self.time_limit = self.world.time + self.decay
예제 #4
0
 def __init__(self, prototype, square, qty):
     prototype.init_dict(self)
     self.qty = to_int(qty) # XXX does the value come from the map? (already done in rules)
     self.qty_max = self.qty
     if self.resource_type == 1: # wood
         self.resource_regen = to_int(".01")
     Entity.__init__(self, square)
예제 #5
0
 def __init__(self, place, type_name, is_a_portal):
     self.type_name = type_name
     self.is_a_portal = is_a_portal
     place, x, y, o = place
     Entity.__init__(self, place, x, y, o)
     place.exits.append(self)
     self._blockers = []
예제 #6
0
    def __init__(self, prototype, player, place, x, y, o=90):
        if prototype is not None:
            prototype.init_dict(self)
        self.orders = []
        # transport data
        self.objects = []
        self.world = place.world # XXXXXXXXXX required by transport

        # set a player
        self.set_player(player)

        # stats "with a max"
        self.hp = self.hp_max
        if self.mana_start > 0:
            self.mana = self.mana_start
        else:
            self.mana = self.mana_max

        # stat defined for the whole game
        self.minimal_damage = rules.get("parameters", "minimal_damage")
        if self.minimal_damage is None:
            self.minimal_damage = DEFAULT_MINIMAL_DAMAGE

        # move to initial place
        Entity.__init__(self, place, x, y, o)

        if self.decay:
            self.time_limit = self.world.time + self.decay
예제 #7
0
    def __init__(self, prototype, player, place, x, y, o=90):
        if prototype is not None:
            prototype.init_dict(self)
        self.orders = []
        # transport data
        self.objects = []
        self.world = place.world # XXXXXXXXXX required by transport

        # set a player
        self.set_player(player)
        # stats "with a max"
        self.hp = self.hp_max
        self.mana = self.mana_max

        # move to initial place
        Entity.__init__(self, place, x, y, o)

        if self.decay:
            self.time_limit = self.world.time + self.decay
예제 #8
0
 def __init__(self, place, type_name):
     self.type_name = type_name
     place, x, y, o = place
     Entity.__init__(self, place, x, y, o)
     place.exits.append(self)
예제 #9
0
 def __init__(self, place, type_name):
     self.type_name = type_name
     place, x, y, o = place
     Entity.__init__(self, place, x, y, o)
     place.exits.append(self)
     self._blockers = []
예제 #10
0
 def __init__(self, unit):
     self.unit = copy.copy(unit)
     Entity.__init__(self, unit.place, unit.x, unit.y)
     self.time_limit = self.place.world.time + 300 * PRECISION
예제 #11
0
 def delete(self):
     # delete first, because if self.player is None the player will miss the
     # deletion and keep a memory of his own deleted unit
     Entity.delete(self)
     self.set_player(None)
예제 #12
0
 def __init__(self, unit):
     self.unit = copy.copy(unit)
     Entity.__init__(self, unit.place, unit.x, unit.y)
     self.time_limit = self.place.world.time + 300 * PRECISION
예제 #13
0
 def delete(self):
     Entity.delete(self)
     self.set_player(None)
예제 #14
0
 def delete(self):
     self.place.exits.remove(self)
     if self.other_side:
         self.other_side.other_side = None
         self.other_side.delete()
     Entity.delete(self)
예제 #15
0
 def delete(self):
     # delete first, because if self.player is None the player will miss the
     # deletion and keep a memory of his own deleted unit
     Entity.delete(self)
     self.set_player(None)