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)
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
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)
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
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 = []
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
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
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)
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 = []
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