Ejemplo n.º 1
0
    public void ActorEnter(Vector3 pos, Vector3 forward, int targetID, Vector3 targetPos, bool isAttack)
    {
        IsActorExit = false;
        //隐藏collider
        EnableCollider(false);
        //设置位置
        UnhideMe(pos);
        //设置朝向
        MainObj.transform.forward = forward;

        IsMoveAfterSwitch = false;
        if (targetPos != Vector3.zero)
        {//move
            IsMoveAfterSwitch = true;
            CurrentCmd        = new Player.Cmd(targetPos);
        }
        else if (isAttack)
        {//attack
            FireNormalSkill();
        }
        //初始化技能UI
        OnInitSkillBag(true);
        //通知headUI
        NotifyChanged((int)Actor.ENPropertyChanged.enMainHead, EnMainHeadType.enHpChanged);
        NotifyChanged((int)Actor.ENPropertyChanged.enMainHead, EnMainHeadType.enSwitchActor);

        //target
        TargetManager.CurrentTarget = ActorManager.Singleton.Lookup(targetID);
        //入场action
        ActionControl.AddAction(ActorAction.ENType.enActorEnterAction);


        //remove buff
        if (CurrentTableInfo.SwitchBuffIDList.Count != 0)
        {
            List <float> paramList = new List <float>(1 + CurrentTableInfo.SwitchBuffIDList.Count);
            paramList.Add((float)ResultRemoveBuff.ENRemoveBuffType.enBuffID);
            paramList.AddRange(CurrentTableInfo.SwitchBuffIDList);

            IResult r = BattleFactory.Singleton.CreateResult(ENResult.RemoveBuff, ID, ID, 0, 0, paramList.ToArray());
            if (r != null)
            {
                r.ResultExpr(paramList.ToArray());
                BattleFactory.Singleton.DispatchResult(r);
            }
        }
        //camera
        MainGame.Singleton.MainCamera.MoveAtOnce(this);
    }
Ejemplo n.º 2
0
    public bool FireSwitchSkill()
    {     //释放切入技
        if (BattleArena.Singleton.SwitchSkillCount < 1)
        { //切入技没有可用次数
            return(false);
        }
        if (null != CurrentCmd)
        {//切入技角色当前有命令
            return(false);
        }
        if (this.IsDead)
        {//角色死亡
            return(false);
        }
        if (SkillBag.Count == 0)
        {//没有可用技能
            return(false);
        }
        if (SkillBag[0].IsSilence)
        {
            return(false);
        }
        int skillID = SkillBag[0].SkillTableInfo.ID;

        if (SkillControl.IsSkillCDRunning(skillID, this))
        {//cd中
            return(false);
        }
        //Actor support = ActorManager.Singleton.Support;
        //if (support == null)
        {//将切入技角色加入列表
            ActorManager.Singleton.AddActor(ActorManager.Singleton.Support.ID, ActorManager.Singleton.Support);
        }
        //设置切入技角色目标
        ActorManager.Singleton.Support.CurrentTarget = ActorManager.Singleton.MainActor.CurrentTarget;

        CurrentCmd = new Player.Cmd(skillID);
        --BattleArena.Singleton.SwitchSkillCount;
        return(true);
    }