Skip to content

Commit

Permalink
Support **kwargs in Buff() action
Browse files Browse the repository at this point in the history
  • Loading branch information
jleclanche committed Sep 6, 2015
1 parent 58618e1 commit 333207d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion fireplace/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class Args(IntEnum):

def __init__(self, *args, **kwargs):
self._args = args
self._kwargs = kwargs
self._argnames = []
for e, arg in zip(self.Args, self._args):
self._argnames.append(e.name)
Expand Down Expand Up @@ -349,7 +350,12 @@ class Args(Action.Args):
BUFF = 1

def do(self, source, target, buff):
source.buff(target, buff)
kwargs = self._kwargs.copy()
for k, v in kwargs.items():
logger.info("for %r, %r in %r.items()", k, v, kwargs)
if isinstance(v, LazyNum):
kwargs[k] = v.evaluate(source)
source.buff(target, buff, **kwargs)


class Bounce(TargetedAction):
Expand Down

0 comments on commit 333207d

Please sign in to comment.