break
elif isinstance(action, (parser.FireDef, parser.FireRef)):
- direction, speed, actions, offset = action(s_params, rank)
+ direction, speed, offset, tags, actions = action(s_params, rank)
if direction:
direction, type = direction
if type == "aim" or type is None:
y += off_y
bullet = owner.__class__(
- x, y, direction, speed, owner.target, actions, rank)
+ x=x, y=y, direction=direction, speed=speed,
+ target=owner.target, actions=actions, rank=rank,
+ tags=tags, Action=self.__class__)
created.append(bullet)
elif isinstance(action, parser.ChangeSpeed):
"""
def __init__(self, x=0, y=0, direction=0, speed=0, target=None,
- actions=(), rank=0.5, Action=Action):
+ actions=(), rank=0.5, tags=(), Action=Action):
self.x = self.px = x
self.y = self.py = y
self.mx = 0
self.vanished = False
self.target = target
self.rank = rank
- self.tags = set()
+ self.tags = set(tags)
# New bullets reset the parent hierarchy.
self._actions = [Action(self, None, action, params, rank)
for action, params in actions]
params=(), rank=0.5, Action=Action):
"""Construct a new Bullet from a loaded BulletML document."""
actions = [a(params, rank) for a in doc.actions]
- return cls(x, y, direction, speed, target, actions, rank, Action)
+ return cls(x=x, y=y, direction=direction, speed=speed,
+ target=target, actions=actions, rank=rank, Action=Action)
def __repr__(self):
return ("%s(%r, %r, accel=%r, direction=%r, speed=%r, "