Esempio n. 1
0
        public void UpdateSkill(Player player)
        {
            Owner = player.whoAmI;
            if (!Active)
            {
                if (Cooldown > 0)
                {
                    if (MainMod.DebugMode)
                    {
                        Cooldown = 0;
                    }
                    else
                    {
                        Cooldown--;
                    }
                }
                return;
            }
            if (CastTime < GetBase.CastTime)
            {
                switch (GetBase.PositionToTake)
                {
                case SkillBase.PositionToTakeOnCastEnum.Mouse:
                    CastPosition = SkillBase.GetMousePositionInTheWorld;
                    break;

                case SkillBase.PositionToTakeOnCastEnum.Player:
                    CastPosition = player.Center;
                    break;
                }
                return;
            }
            byte[] Keys = PlayerDamageCooldown.Keys.ToArray();
            foreach (byte key in Keys)
            {
                PlayerDamageCooldown[key]--;
                if (PlayerDamageCooldown[key] <= 0)
                {
                    PlayerDamageCooldown.Remove(key);
                }
            }
            Keys = NpcDamageCooldown.Keys.ToArray();
            foreach (byte key in Keys)
            {
                NpcDamageCooldown[key]--;
                if (NpcDamageCooldown[key] <= 0)
                {
                    NpcDamageCooldown.Remove(key);
                }
            }
            TargetTranslator.Translator[] Keys2 = ExtraTargetDamageCooldown.Keys.ToArray();
            foreach (TargetTranslator.Translator target in Keys2)
            {
                ExtraTargetDamageCooldown[target]--;
                if (ExtraTargetDamageCooldown[target] <= 0)
                {
                    ExtraTargetDamageCooldown.Remove(target);
                }
            }
        }
Esempio n. 2
0
 public void RemovePlayerCooldown(Player player)
 {
     if (PlayerDamageCooldown.ContainsKey((byte)player.whoAmI))
     {
         PlayerDamageCooldown.Remove((byte)player.whoAmI);
     }
 }