public override void OnEffectApplied(GameActor actor, RuntimeGameActorEffectData effectData, float partialAmount = 1f)
 {
     base.OnEffectApplied(actor, effectData, partialAmount);
     effectData.OnActorPreDeath = delegate(Vector2 dir)
     {
         GameActorWitherEffect.DestroyFlames(effectData);
     };
     actor.healthHaver.OnPreDeath += effectData.OnActorPreDeath;
     {
         if (effectData.vfxObjects == null)
         {
             effectData.vfxObjects = new List <Tuple <GameObject, float> >();
         }
         effectData.OnFlameAnimationCompleted = delegate(tk2dSpriteAnimator spriteAnimator, tk2dSpriteAnimationClip clip)
         {
             if (effectData.destroyVfx || !actor)
             {
                 spriteAnimator.AnimationCompleted = (Action <tk2dSpriteAnimator, tk2dSpriteAnimationClip>)Delegate.Remove(spriteAnimator.AnimationCompleted, effectData.OnFlameAnimationCompleted);
                 UnityEngine.Object.Destroy(spriteAnimator.gameObject);
                 return;
             }
             if (UnityEngine.Random.value < this.flameMoveChance)
             {
                 Vector2 a = actor.specRigidbody.HitboxPixelCollider.UnitDimensions / 2f;
                 Vector2 b = BraveUtility.RandomVector2(-a + this.flameBuffer, a - this.flameBuffer);
                 Vector2 v = actor.specRigidbody.HitboxPixelCollider.UnitCenter + b;
                 spriteAnimator.transform.position = v;
             }
             spriteAnimator.Play(clip, 0f, clip.fps * UnityEngine.Random.Range(1f - this.flameFpsVariation, 1f + this.flameFpsVariation), false);
         };
     }
 }
示例#2
0
 private void OnHitEnemy(Projectile arg1, SpeculativeRigidbody arg2, bool arg3)
 {
     if (arg2 != null && arg2.aiActor != null && Owner != null)
     {
         if (BoxOTools.BasicRandom(.85f))
         {
             GameActorWitherEffect witherEffect = wither;
             if (Owner.PlayerHasActiveSynergy("Withered away"))
             {
                 wither.duration *= 2;
             }
             arg2.aiActor.ApplyEffect(witherEffect, 1f, null);
         }
     }
 }