def on_cast_alive(self, gameworld, tx, ty, tpid): actor = self.invoker.actor va = mathops.vector_towards(actor.x, actor.y, tx, ty - 30, self.speed) vb = mathops.vector_towards(actor.x, actor.y, tx, ty, self.speed) vc = mathops.vector_towards(actor.x, actor.y, tx, ty + 30, self.speed) if vb == None: return xdir = 1 if actor.direction == 0 else -1 sh = Shot(registry['shots'][1]['animations'], actor.x + (5 * xdir), actor.y - 5, va[0], va[1], self.invoker.team, Kunai(self.damage, self.invoker.team)) gameworld.on_sd_register_shot(sh) sh = Shot(registry['shots'][1]['animations'], actor.x + (5 * xdir), actor.y - 5, vb[0], vb[1], self.invoker.team, Kunai(self.damage, self.invoker.team)) gameworld.on_sd_register_shot(sh) sh = Shot(registry['shots'][1]['animations'], actor.x + (5 * xdir), actor.y - 5, vc[0], vc[1], self.invoker.team, Kunai(self.damage, self.invoker.team)) gameworld.on_sd_register_shot(sh) gameworld.on_sd_skill_deployed(self.invoker.pid, 5)
def on_cast_alive(self, gameworld, tx, ty, tpid): actor = self.invoker.actor va = mathops.vector_towards(actor.x, actor.y, tx, ty-30, self.speed) vb = mathops.vector_towards(actor.x, actor.y, tx, ty, self.speed) vc = mathops.vector_towards(actor.x, actor.y, tx, ty+30, self.speed) if vb == None: return xdir = 1 if actor.direction == 0 else -1 sh = Shot(registry['shots'][1]['animations'], actor.x+(5*xdir), actor.y-5, va[0], va[1], self.invoker.team, Kunai(self.damage, self.invoker.team)) gameworld.on_sd_register_shot(sh) sh = Shot(registry['shots'][1]['animations'], actor.x+(5*xdir), actor.y-5, vb[0], vb[1], self.invoker.team, Kunai(self.damage, self.invoker.team)) gameworld.on_sd_register_shot(sh) sh = Shot(registry['shots'][1]['animations'], actor.x+(5*xdir), actor.y-5, vc[0], vc[1], self.invoker.team, Kunai(self.damage, self.invoker.team)) gameworld.on_sd_register_shot(sh) gameworld.on_sd_skill_deployed(self.invoker.pid, 5)
def on_tick(self, gameworld): if self.cast_on != gameworld.iteration: return None actor = self.invoker.actor vt = mathops.vector_towards(actor.x, actor.y, self.tx, self.ty, self.speed) if vt == None: return xdir = 1 if actor.direction == 0 else -1 sh = Shot(self.scroll_geometry_set, actor.x+(28*xdir), actor.y-17, vt[0], vt[1], self.invoker.team, Scroll(self.damage, self.invoker.team)) gameworld.on_sd_register_shot(sh)
def on_cast_alive(self, gameworld, tx, ty, tpid): actor = self.invoker.actor vt = mathops.vector_towards(actor.x, actor.y, tx, ty, self.speed) if vt == None: return xdir = 1 if actor.direction == 0 else -1 sh = Shot(self.shuriken_geometry_set, actor.x+(5*xdir), actor.y-5, vt[0], vt[1], self.invoker.team, Shuriken(self.damage, self.invoker.team)) gameworld.on_sd_register_shot(sh) gameworld.on_sd_skill_deployed(self.invoker.pid, 6)
def on_cast_alive(self, gameworld, tx, ty, tpid): actor = self.invoker.actor vt = mathops.vector_towards(actor.x, actor.y, tx, ty, self.speed) if vt == None: return xdir = 1 if actor.direction == 0 else -1 sh = Shot(self.shuriken_geometry_set, actor.x + (5 * xdir), actor.y - 5, vt[0], vt[1], self.invoker.team, Shuriken(self.damage, self.invoker.team)) gameworld.on_sd_register_shot(sh) gameworld.on_sd_skill_deployed(self.invoker.pid, 6)
def on_actor(self, actor): if actor in self.already_encountered: return self.already_encountered.append(actor) actor.meta.on_damage(self.damage) # push back the actor vx, vy = mathops.vector_towards(actor.x, actor.y, self.shot.x, self.shot.y, self.push_force) # apply the vector in reverse (AWAY from invoker) actor.dx -= vx actor.dy -= vy actor.meta.ministun += self.ros actor.no_anchor += self.ros actor.meta.on_stunned()