Exemple #1
0
        public bool InternalCanCastAbility(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility)
        {
            if (AbilityType == AbilityType.Passive && AbilityType != AbilityType.Active)
            {
                return(false);
            }

            if (!CanCastAbility(dotariaPlayer, playerAbility))
            {
                return(false);
            }

            if (AbilityTargetType != AbilityTargetType.TargetUnit)
            {
                return(true);
            }

            if (AbilityTargetUnitType == AbilityTargetUnitType.Living)
            {
                if (AbilityTargetUnitType == AbilityTargetUnitType.Living)
                {
                    EntitiesHelper.GetLocalHoveredEntity(out Player player, out NPC npc);

                    return(player != null || npc != null);
                }

                if (AbilityTargetUnitType == AbilityTargetUnitType.Heroes)
                {
                    return(EntitiesHelper.GetLocalHoveredPlayer() != null);
                }

                if (AbilityTargetUnitType == AbilityTargetUnitType.Units)
                {
                    return(EntitiesHelper.GetLocalHoveredNPC() != null);
                }
            }

            return(true);
        }
Exemple #2
0
 public virtual void OnAbilityCooldownExpired(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility) =>
 dotariaPlayer.TryActivateAbility(this);
Exemple #3
0
 public virtual bool CastAbility(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility, bool casterIsLocalPlayer) => true;
Exemple #4
0
 public virtual void OnAbilityCasted(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility)
 {
 }
Exemple #5
0
 public virtual void OnPlayerPreUpdateMovement(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility)
 {
 }
Exemple #6
0
 public virtual bool OnPlayerPreHurt(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility, bool pvp, bool quiet, ref int damage, ref int hitDirection, ref bool crit, ref bool customDamage, ref bool playSound, ref bool genGore, ref PlayerDeathReason damageSource) => true;
Exemple #7
0
 public virtual void ModifyPlayerDrawLayers(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility, List <PlayerLayer> layers)
 {
 }
Exemple #8
0
 public virtual void OnPlayerHitNPCWithProjectile(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility, NPC npc, Projectile projectile, int damage, float knockback, bool crit)
 {
 }
Exemple #9
0
 public virtual float GetAbilityDamage(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility) => 0;
Exemple #10
0
 public float InternalGetAbilityDamage(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility) => GetAbilityDamage(dotariaPlayer, playerAbility) * dotariaPlayer.SpellAmplification;
Exemple #11
0
 public abstract float GetManaCost(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility);
Exemple #12
0
        public float InternalGetManaCost(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility)
        {
            float manacost = GetManaCost(dotariaPlayer, playerAbility);

            return(manacost < 0 ? 0 : manacost);
        }
Exemple #13
0
 public abstract float GetCooldown(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility);
Exemple #14
0
 public int InternalGetCooldown(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility) => (int)Math.Ceiling(GetCooldown(dotariaPlayer, playerAbility));
Exemple #15
0
 public virtual DispelType GetDispelType(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility) => BaseDispelType;
Exemple #16
0
 public virtual void OnPlayerHitNPCWithItem(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility, NPC npc, Player player, Item item, int damage, float knockback, bool crit)
 {
 }
Exemple #17
0
 public float InternalGetCastRange(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility) => GetCastRange(dotariaPlayer, playerAbility);
Exemple #18
0
 public virtual void OnPlayerKilledNPC(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility, NPC npc)
 {
 }
Exemple #19
0
 public virtual float GetCastRange(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility) => BaseCastRange;
Exemple #20
0
 public virtual void ModifyWeaponDamage(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility, Item item, ref float add, ref float mult, ref float flat)
 {
 }
Exemple #21
0
 public virtual bool CanLevelUp(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility) => playerAbility.Level + 1 < dotariaPlayer.Level;
Exemple #22
0
 public virtual void OnPlayerPostHurt(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility, bool pvp, bool quiet, double damage, int hitDirection, bool crit)
 {
 }
Exemple #23
0
        public virtual int GetRequiredLevelForNextUpgrade(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility)
        {
            if (AbilitySlot == AbilitySlot.Ultimate)
            {
                return((playerAbility.Level + 1) * 6);
            }

            return((playerAbility.Level * 2) + 1);
        }
Exemple #24
0
 // TODO Change this to abstract
 public virtual string GetAbilityTooltip(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility) => "ABILITY NOT YET IMPLEMENTED/\nTOOLTIP NOT YET WRITTEN";
Exemple #25
0
 public virtual void OnAbilityLeveledUp(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility)
 {
 }
Exemple #26
0
 public void InternalOnAbilityCooldownExpired(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility) =>
 OnAbilityCooldownExpired(dotariaPlayer, playerAbility);
Exemple #27
0
 public virtual bool CanCastAbility(DoTariaPlayer dotariaPlayer, PlayerAbility playerAbility) => true;