def go(self, effect, actor, source, target, **kargs): try: duration = kargs['actorDurations'][self.actorName] except: duration = kargs['totalDuration'] self.light = BigWorld.PyChunkLight() self.light.innerRadius = self.innerRadius self.light.outerRadius = self.outerRadius self.lightFaderAnim = Vector4Animation() self.lightFaderAnim.time = 0 self.lightFaderAnim.duration = duration col = Vector4(self.colour) self.lightFaderAnim.keyframes = [(0.0, (0, 0, 0, 0)), (0.25, col), (duration * 0.5, col), (duration, (0, 0, 0, 0))] lfo1 = Vector4LFO() lfo1.period = 0.4 lfo2 = Vector4LFO() lfo2.period = 0.149 self.lightFader = Vector4Shader() self.lightFader.addOp(_mul, _r1, lfo1, lfo2) self.lightFader.addOp(_mul, _r0, self.lightFaderAnim, _r1) try: self.light.source = source.model.root except: try: self.light.source = source.root except: self.light.source = source.node('Scene Root') self.light.visible = 1 self.light.shader = self.lightFader BigWorld.callback(duration, self.removeLight) return duration
def go(self, effect, actor, source, target, **kargs): self.colour = actor.colour lfo1 = Vector4LFO() lfo1.period = 0.4 / self.speed lfo1.amplitude = self.amplitude lfo2 = Vector4LFO() lfo2.period = 0.149 / self.speed scalarOffset = 1.0 - self.amplitude offset = Vector4(scalarOffset, scalarOffset, scalarOffset, scalarOffset) self.lightFlicker = Vector4Shader() self.lightFlicker.addOp(_mul, _r1, lfo1, lfo2) self.lightFlicker.addOp(_add, _r1, _r1, offset) self.lightFlicker.addOp(_mul, _r0, self.colour, _r1) actor.shader = self.lightFlicker return 0.0