Permalink
Browse files

Support **kwargs in Buff() action

  • Loading branch information...
jleclanche committed Sep 6, 2015
1 parent 58618e1 commit 333207d3ba4489fae95cbaf4f5b48681e086b5f1
Showing with 7 additions and 1 deletion.
  1. +7 −1 fireplace/actions.py
@@ -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)
@@ -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):

0 comments on commit 333207d

Please sign in to comment.