+ if self.appearance:
+ appearance = self.appearance
+
+ if direction:
+ direction, type = direction
+ if type == "aim" or type is None:
+ direction += owner.aim
+ elif type == "sequence":
+ direction += action.previous_fire_direction
+ elif type == "relative":
+ direction += owner.direction
+ else:
+ direction = owner.aim
+ action.previous_fire_direction = direction
+
+ if speed:
+ speed, type = speed
+ if type == "sequence":
+ speed += action.previous_fire_speed
+ elif type == "relative":
+ # The reference Noiz implementation uses
+ # prvFireSpeed here, but the standard is
+ # pretty clear -- "In case of the type is
+ # "relative", ... the speed is relative to the
+ # speed of this bullet."
+ speed += owner.speed
+ else:
+ speed = 1
+ action.previous_fire_speed = speed
+
+ x, y = owner.x, owner.y
+ if self.offset:
+ off_x, off_y = self.offset(params, rank)
+ if self.offset.type == "relative":
+ s = sin(direction)
+ c = cos(direction)
+ x += c * off_x + s * off_y
+ y += s * off_x - c * off_y
+ else:
+ x += off_x
+ y += off_y
+
+ if appearance is None:
+ appearance = owner.appearance
+ bullet = owner.__class__(
+ x=x, y=y, direction=direction, speed=speed,
+ target=owner.target, actions=actions, rank=rank,
+ appearance=appearance, tags=tags, Action=action.__class__)
+ created.append(bullet)