Exemple #1
0
    public bool ActionTryAttack(int skillID, Actor skillTarget, bool isSyncPosValidate, Vector3 syncPos)
    {
        AttackAction action = Owner.ActionControl.AddAction(ActorAction.ENType.enAttackAction) as AttackAction;

        if (null == action)
        {
            return(false);
        }
        Owner.SkillControl.AddSkill(skillID, Owner);
        int targetID = 0;

        if (skillTarget != null && !skillTarget.IsDead)
        {
            targetID = skillTarget.ID;
        }
        action.InitImpl(skillID, targetID, isSyncPosValidate, syncPos);
        //添加怒气值
        Actor.ActorSkillInfo info = Owner.SkillBag.Find(item => item.SkillTableInfo.ID == skillID);
        if (info != null)
        {
            Owner.CurrentRage += info.SkillTableInfo.GenerateRagePoint;
            Owner.CurrentRage -= info.SkillTableInfo.CostRagePoint;
        }
        return(true);
    }