Permalink
Browse files

Implement ExactCopy picker

  • Loading branch information...
jleclanche committed Jul 27, 2015
1 parent 7dba494 commit fe9834c6f09e27d0ed0d2f63d07ca78e6fb94fcd
Showing with 18 additions and 0 deletions.
  1. +18 −0 fireplace/dsl/picker.py
@@ -51,3 +51,21 @@ def pick(self, source) -> [str]:
entities = self.selector.eval(source.game, source)
return [self.copy(source, e) for e in entities]
class ExactCopy(Copy):
"""
Lazily create an exact copy of the target.
An exact copy will include buffs and all tags.
"""
def copy(self, source, entity):
ret = super().copy(source, entity)
for k in entity.silenceable_attributes:
v = getattr(entity, k)
setattr(ret, k, v)
ret.silenced = entity.silenced
ret.damage = entity.damage
for buff in entity.buffs:
# Recreate the buff stack
entity.buff(ret, buff.id)
return ret

0 comments on commit fe9834c

Please sign in to comment.