def __init__(self, mdl, nw, sched, pname, cell, facing): """ Create an Avatar """ maxhp, atk = config_get_avmaxhp(), config_get_baseatk() SCharactor.__init__(self, pname, cell, facing, maxhp, atk) self._mdl = mdl self._nw = nw self._sched = sched # place in cell self.cell = cell self.cell.add_av(self) self.atk_ts = 0 # timestamp of last atk; can atk right away (no cooldown) self.atk_cd = config_get_atkcd()
def __init__(self, mdl, sched, delay, nw, cname, cell, facing): """ Starting state is idle. """ hp, atk = config_get_creepmaxhp(), config_get_baseatk() SCharactor.__init__(self, cname, cell, facing, hp, atk) self.cell = cell self.cell.add_creep(self) self._mdl = mdl self._sched = sched self._nw = nw self._sched.schedule_action(delay, self.name, self.update) self.state = 'idle' creepinfo = self.serialize() self._nw.bc_creepjoin(self.name, creepinfo)