Пример #1
0
 void HealCaster()
 {
     if (caster)
     {
         DrainEffect incumbentDrain = caster.GetComponent <EntityEffectManager>().FindDrainStatIncumbent(drainStat);
         if (incumbentDrain != null)
         {
             incumbentDrain.Heal(lastMagnitudeIncreaseAmount);
         }
     }
 }
Пример #2
0
        public override void MagicRound()
        {
            base.MagicRound();

            DrainEffect incumbentDrain = manager.FindDrainStatIncumbent(healStat);

            if (incumbentDrain != null)
            {
                int magnitude = GetMagnitude(caster);
                incumbentDrain.Heal(magnitude);
                Debug.LogFormat("Healed {0} Drain {1} by {2} points", GetPeeredEntityBehaviour(manager).name, incumbentDrain.DrainStat.ToString(), magnitude);
            }
            else
            {
                Debug.LogFormat("Could not find incumbent Drain {0} on target", healStat.ToString());
            }
        }
Пример #3
0
        DrainEffect FindDrainStatIncumbent()
        {
            // Search for any matching incumbents on this host
            EntityEffectManager.InstancedBundle[] bundles = manager.EffectBundles;
            foreach (EntityEffectManager.InstancedBundle bundle in bundles)
            {
                foreach (IEntityEffect effect in bundle.liveEffects)
                {
                    if (effect is DrainEffect)
                    {
                        // Heal stat must match drain stat
                        DrainEffect drainEffect = effect as DrainEffect;
                        if (drainEffect.IsIncumbent && drainEffect.DrainStat == healStat)
                        {
                            return(drainEffect);
                        }
                    }
                }
            }

            return(null);
        }