Exemplo n.º 1
0
 public void CallOnCast(IAbilityTypeHandler Handler, uint Count)
 {
     if (OnCastEvents != null)
     {
         OnCastEvents(Handler, Count);
     }
 }
Exemplo n.º 2
0
        public override IAbilityTypeHandler Cast()
        {
            IAbilityTypeHandler NewHandler = DamagesHandler.Cast();

            if (NewHandler != null)
            {
                NewHandler.OnCastEvents += OnDealDamageTarget;
            }
            return(null);
        }
Exemplo n.º 3
0
        static public IAbilityTypeHandler GetAbilityHandler(UInt16 AbilityType)
        {
            IAbilityTypeHandler Handler = null;

            if (_AbilityTypes.TryGetValue(AbilityType, out Handler))
            {
                return(Activator.CreateInstance(Handler.GetType()) as IAbilityTypeHandler);
            }

            return(null);
        }
        public override void InitAbility(Ability Ab)
        {
            this.Ab = Ab;
            this.DamagesHandler = new DealDamagesHandler();

            if (Ab.Info.Info.GroupMates)
                this.HealHandler = new SimpleHealGroupHandler();
            else
                this.HealHandler = new SimpleHealHandler();
            HealHandler.InitAbility(Ab);
            DamagesHandler.InitAbility(Ab);
            DamagesHandler.OnCastEvents += OnDealDamageTarget;
        }
Exemplo n.º 5
0
        public Ability(AbilityInterface Interface, Ability Parent, Ability_Stats Info, Unit Caster, bool IsBuff, string OverrideHandler = "")
        {
            this.Parent = Parent;
            this.Info = Info;
            this.Caster = Caster;
            this.Interface = Interface;
            if (OverrideHandler == "")
                this.Handler = AbilityMgr.GetAbilityHandler(Info.Entry, Info.Info.HandlerName);
            else
                this.Handler = AbilityMgr.GetAbilityHandler(0, OverrideHandler);

            this.IsBuff = IsBuff;

            if (Handler != null)
                Handler.InitAbility(this);
        }
Exemplo n.º 6
0
        public void Stop()
        {
            IsDone = true;

            if (Handler != null)
            {
                Handler.Stop();
                Handler = null;
            }

            SendStop();
            if (Info.Info.ApSec != 0)
            {
                SendAbilityDone(0);
            }
        }
Exemplo n.º 7
0
        public override void InitAbility(Ability Ab)
        {
            this.Ab             = Ab;
            this.DamagesHandler = new DealDamagesHandler();

            if (Ab.Info.Info.GroupMates)
            {
                this.HealHandler = new SimpleHealGroupHandler();
            }
            else
            {
                this.HealHandler = new SimpleHealHandler();
            }
            HealHandler.InitAbility(Ab);
            DamagesHandler.InitAbility(Ab);
            DamagesHandler.OnCastEvents += OnDealDamageTarget;
        }
Exemplo n.º 8
0
        public Ability(AbilityInterface Interface, Ability Parent, Ability_Stats Info, Unit Caster, bool IsBuff, string OverrideHandler = "")
        {
            this.Parent    = Parent;
            this.Info      = Info;
            this.Caster    = Caster;
            this.Interface = Interface;
            if (OverrideHandler == "")
            {
                this.Handler = AbilityMgr.GetAbilityHandler(Info.Entry, Info.Info.HandlerName);
            }
            else
            {
                this.Handler = AbilityMgr.GetAbilityHandler(0, OverrideHandler);
            }

            this.IsBuff = IsBuff;

            if (Handler != null)
            {
                Handler.InitAbility(this);
            }
        }
Exemplo n.º 9
0
 public Ability(Ability_Info Info, Object Caster)
 {
     this.Info   = Info;
     this.Caster = Caster;
     Handler     = AbilityMgr.GetAbilityHandler(Info.AbilityType);
 }
Exemplo n.º 10
0
 public Ability(Ability_Info Info, Object Caster)
 {
     this.Info = Info;
     this.Caster = Caster;
     Handler = AbilityMgr.GetAbilityHandler(Info.AbilityType);
 }
Exemplo n.º 11
0
 public void CallOnCast(IAbilityTypeHandler Handler, uint Count)
 {
     if (OnCastEvents != null)
         OnCastEvents(Handler, Count);
 }
 public void OnDealDamageTarget(IAbilityTypeHandler Handler, uint Damage)
 {
     HealHandler.CustomValue = (uint)(((float)Damage * (float)Ab.Info.GetPercent(0)) / 100f) + Ab.Info.GetHeal(0);
     HealHandler.Cast();
 }
Exemplo n.º 13
0
        public void Stop()
        {
            IsDone = true;

            if (Handler != null)
            {
                Handler.Stop();
                Handler = null;
            }

            SendStop();
            if (Info.Info.ApSec != 0)
                SendAbilityDone(0);
        }
Exemplo n.º 14
0
 public void OnDealDamageTarget(IAbilityTypeHandler Handler, uint Damage)
 {
     HealHandler.CustomValue = (uint)(((float)Damage * (float)Ab.Info.GetPercent(0)) / 100f) + Ab.Info.GetHeal(0);
     HealHandler.Cast();
 }