Exemple #1
0
    /// <summary>
    /// 使用绝技技能,HeroUnitUI调用
    /// </summary>
    /// <returns></returns>
    public void UI_UseUniqueSkill(params object[] objs)
    {
        UnAbleReason reason = UnAbleReason.None;

        if (self.state != FightUnit.UnitState.Fighting)
        {
            reason = UnAbleReason.NotFighting;
        }
        else if (self.isConfused)
        {
            reason = UnAbleReason.InSpecailState;
        }
        if (reason != UnAbleReason.None)
        {
            TipReason(reason);
            return;
        }
        else
        {
            if (target == null || target.state == FightUnit.UnitState.Dead)
            {
                target = FightRule.GetFightTarget(self, self.parentGroup.targetGroup);
                if (target == null)
                {
                    return;
                }
            }
            UseUniqueSkill();
        }
    }
Exemple #2
0
    /// <summary>
    /// 尝试使用绝技
    /// </summary>
    /// <returns></returns>
    public override bool UseUniqueSkill()
    {
        UnAbleReason reason = UnAbleReason.None;

        if (!self.beAbleUseSkill)
        {
            reason = UnAbleReason.InSpecailState;
        }
        else if (!FightEnergy.instance.isEnergyEnough)
        {
            reason = UnAbleReason.Energylack;
        }
        if (reason != UnAbleReason.None)
        {
            if (!isAutoUseUniqueSkill)
            {
                TipReason(reason);
            }
            return(false);
        }
        else
        {
            StopCurrent();
            specailSkill.Use(target);
            currentSkill = specailSkill;
            return(true);
        }
    }
Exemple #3
0
    /// <summary>
    /// 尝试使用技能
    /// </summary>
    /// <param name="skill"></param>
    /// <returns></returns>
    public override bool UseActiveSkill(ActiveSkill skill)
    {
        UnAbleReason reason = UnAbleReason.None;

        if (!self.beAbleUseSkill)
        {
            reason = UnAbleReason.InSpecailState;
        }
        else if (skill.cdValue != 0)
        {
            reason = UnAbleReason.InCD;
        }
        else if (self.mana < skill.normalSkillLvUp.MPCost)
        {
            reason = UnAbleReason.Manalack;
        }
        else if (self.health < skill.normalSkillLvUp.HPCost)
        {
            reason = UnAbleReason.Healthlack;
        }
        if (reason != UnAbleReason.None)
        {
            if (!isAutoUseSkill)
            {
                TipReason(reason);
            }
            return(false);
        }
        else
        {
            StopNormalAttack();
            skill.Use(target);
            currentSkill = skill;
            return(true);
        }
    }
Exemple #4
0
 /// <summary>
 /// 提示错误信息
 /// </summary>
 /// <param name="reason"></param>
 void TipReason(UnAbleReason reason)
 {
 }