def attach(self, caster, scObject):
        """
		virtual method.
		Attach an aura
		@param caster: Entity that casts Aura
		@param receiver: Entity
		"""
        self.onAttached(caster, scObject)
        return ActiveAura.attachTo(self, caster, scObject)
Ejemplo n.º 2
0
    def attach(self, attacher, scObject):
        """
		virtual method.
		Attach an aura
		@param attacher: Entity that attaches Aura
		@param receiver: Entity
		"""
        target = self.getTarget()

        if self.getEffectApplyAttribute() is not GlobalDefine.TYPE_NONE:
            if self.getTarget().activeAttributes is not None:
                target.addAttribute(attacher.id,
                                    self.getEffectApplyAttribute())
        if self.getEffectTarget() is not GlobalDefine.TYPE_NONE:
            if self.getEffectCalculation() is not GlobalDefine.TYPE_NONE:
                if self.getEffectCalculation() is not GlobalDefine.ATTRIBUTE_HEALTH or \
                  self.getEffectCalculation() is not GlobalDefine.ATTRIBUTE_ENERGY:
                    modified = self.getAmount() * target.getProperty(
                        self.getEffectCalculation())
                    target.setProperty(self.getEffectCalculation(), modified)
        self.onAttached(attacher, scObject)
        return ActiveAura.attachTo(self, attacher, scObject)