Esempio n. 1
0
 /// <summary>
 /// 攻击者攻击后产生的力反馈效果
 /// </summary>
 public void ForceFeedBack(ActionVo vo)
 {
     if (vo.ForceFeedBack > 0)
     {
         var meVo = MeController.GetMeVo();
         meVo.ForceFeedBackTime = vo.ForceFeedBack * 0.001f;
         meVo.IsForceFeedBack   = true;
     }
 }
 /// <summary>
 ///     攻击动作3状态时的位移处理
 /// </summary>
 protected virtual void ProcessAttack3Move()
 {
     if (MeController.GetMeVo().job == 1)
     {
         Vector3 position = ThisTransform.position;
         int     dir      = MeController.Me.CurFaceDire == Directions.Left ? -1 : 1;
         float   x        = position.x + Time.deltaTime * dir * Attack3Speed;
         x                      = AppMap.Instance.mapParser.GetFinalPlayerX(x); //控制不让出界
         position.x             = x;
         ThisTransform.position = position;
     }
 }
 /// <summary>
 ///     请求状态改变的唯一入口,使状态的改变控制更加清晰简单
 /// </summary>
 /// <param name="nextStatu"></param>
 public virtual bool SetStatu(int nextStatu)
 {
     if (GetStatuMatrix()[CurrentStatu, nextStatu] == 0 || CurrentStatu == nextStatu || Animator == null)
     {
         return(false); //如果当前状态到下一状态的切换是不允许的,则直接返回
     }
     if (MeControler.GetMeVo().NeedKeep&& nextStatu != Status.IDLE)
     {
         return(false);
     }
     if (false == CanChangeStatus)
     {
         return(false);
     }
     if (nextStatu == Status.IDLE)
     {
         MeControler.GetMeVo().NeedKeep = false;
     }
     _changeTime   = Time.time;
     _currentStatu = nextStatu;
     Animator.SetInteger(Status.STATU, _currentStatu);
     DoStatuChange();
     return(true);
 }
Esempio n. 4
0
 // Update is called once per frame
 private void Update()
 {
     //更新技能CD
     for (int i = 0; i < LeftCdTimes.Length; i++)
     {
         if (!(LeftCdTimes[i] > 0))
         {
             continue;
         }
         LeftCdTimes[i] -= Time.deltaTime;
         if (LeftCdTimes[i] < 0)
         {
             LeftCdTimes[i] = 0;
         }
     }
     if (MeController.GetMeVo().CurHp == 0)
     {
         SkillList.Clear();
     }
     //缓存的技能施放
     if (SkillList.Count > 0 &&
         (MeController.StatuController.CurrentStatu == Status.IDLE ||
          MeController.StatuController.CurrentStatu == Status.RUN))
     {
         int skillType = SkillList[0];
         SkillList.RemoveAt(0);
         if (MeController.AttackController.AttackList.Count > 0)
         {
             MeController.AttackController.AttackList.Clear();
         }
         RequestUseSkill(skillType);
     }
     //被抓取时, 执行操作;
     if (MeController.Me.IsGrasped)
     {
         if ((Global.Times_Left + Global.Times_Right) > PlayConst.GRASP_RELEASE_MIN_KEY_COUNT)
         {
             MeController.GraspThrowController.InterceptGrasp();
         }
     }
 }
 /// <summary>
 /// 带硬直的受击1
 /// </summary>
 /// <param name="_actionVo">行为</param>
 /// <param name="_monsterVo">怪物属性</param>
 protected void SetHurt1(ActionVo _actionVo)
 {
     meController.StatuController.SetHurt1Immediately();
     meController.GetMeVo().HitRecoverTime = _actionVo.HitRecover * 0.001f;
     meController.GetMeVo().IsHitRecover   = true;
 }