Example #1
0
    public override void DoBeforeEntering()
    {
        //m_MonsterBehaviour.ClientEndPos.Value = null;
        m_currentSkillBase = this.m_MonsterBehaviour.m_SkillBaseList.FirstOrDefault(p => p.SkillId == m_currentSkillID);
        if (m_currentSkillBase == null)
        {
            TraceUtil.Log(SystemModel.Common, TraceLevel.Error, "找不到相关技能");
            TraceUtil.Log(SystemModel.NotFoundInTheDictionary, TraceLevel.Error, "找不到相关技能");
        }
        else
        {
            m_currentSkillBase.AddActionDelegate(ActionHandle);
            m_currentSkillBase.AddSkillBulletFireDelegate(FireBulletHandle);
            m_currentSkillBase.AddSkillEffectFireDelegate(FireSkillActionEffect);
            m_currentSkillBase.AddSkillOverDelegate(ActionOverHandle);
            m_currentSkillBase.Fire();
        }


        if (Vector3.Distance(m_MonsterBehaviour.ThisTransform.position, m_shouldPos) >= 10)
        {
            //相差太大的情况:
            m_MonsterBehaviour.MoveToPoint(m_shouldPos);
        }
        else
        {
            m_MonsterBehaviour.MoveToPoint(m_shouldPos);
        }

        m_MonsterBehaviour.ThisTransform.LookAt(new Vector3(m_attackLookAtPos.x, m_MonsterBehaviour.ThisTransform.position.y, m_attackLookAtPos.z));

        //清零位移
        m_displacement = 0;

        //清除路点信息
        m_MonsterBehaviour.PointQueue.Clear();
        if (GameManager.Instance.CurrentGameMode == GameMode.SINGLE_PLAYER)
        {
            float xValue, yValue;
            this.m_MonsterBehaviour.ThisTransform.position.SetToServer(out xValue, out yValue);
            SMsgFightCommand_CS sMsgFightCommand_CS = new SMsgFightCommand_CS();
            sMsgFightCommand_CS.uidFighter  = this.m_MonsterBehaviour.RoleDataModel.SMsg_Header.uidEntity;
            sMsgFightCommand_CS.nFightCode  = m_currentSkillBase.SkillId;
            sMsgFightCommand_CS.byType      = 1;
            sMsgFightCommand_CS.fighterPosX = xValue;
            sMsgFightCommand_CS.fighterPosY = yValue;

            NetServiceManager.Instance.BattleService.SendFightCommandCS(sMsgFightCommand_CS);
        }
        m_MonsterBehaviour.FixMonsterYToOrigin();
        base.DoBeforeEntering();
    }
Example #2
0
    public override void DoBeforeEntering()
    {
        /*找到当前选择的技能
         * 施放技能
         * 监听技能Action委托,获得技能数据,并保存起来。
         * 在Act处理里将使用这些技能数据做表现
         * */
        if (m_PlayerBehaviour.IsHero)
        {
            if (!m_PlayerBehaviour.m_keepNormalSkillStep)
            {
                m_normalAttackStep = 0;
            }
        }
        //普攻技能步骤过滤 如果是突进,判断是否突进技能CD完毕,如果完毕则正常,否则跳过两个技能。
        if (this.m_PlayerBehaviour.IsHero && m_normalAttackStep == 0)
        {
            if (m_PlayerBehaviour.MarchForwardCDTime > 0 ||
                MonsterManager.Instance.LockedMonster == null ||
                Vector3.Distance(m_PlayerBehaviour.ThisTransform.position, MonsterManager.Instance.LockedMonster.GO.transform.position) <= CommonDefineManager.Instance.CommonDefine.ChargeMinRange) // still colddowning or no target
            {
                m_normalAttackStep += 2;                                                                                                                                                             // skip march forward skill
            }
        }
        SelectNormalSkill();
        //Debug.Log("SKill Id:" + m_skillBase.SkillId+" AttackStep:"+m_normalAttackStep);
        IsSkillBeBreaked = false;
        if (this.m_PlayerBehaviour.IsHero)
        {
            SendNormalSkillCommand(m_skillBase.SkillId);
        }
        if (this.m_PlayerBehaviour.IsHero && m_normalAttackStep == 0)
        {
            m_PlayerBehaviour.MarchForwardCDTime = m_skillBase.SkillData.m_coolDown;  // reset colddown time
        }
        m_skillBase.Fire();

        m_PlayerBehaviour.ClientMove = false;
    }
Example #3
0
 public override void DoBeforeEntering()
 {
     /*找到当前选择的技能
      * 施放技能
      * 监听技能Action委托,获得技能数据,并保存起来。
      * 在Act处理里将使用这些技能数据做表现
      * */
     this.m_PlayerBehaviour.GetSkillBySkillID(PlayerDataManager.Instance.GetBattleItemData(this.m_PlayerBehaviour.PlayerKind).ScrollSkillID);
     m_skillBase = this.m_PlayerBehaviour.SelectedSkillBase;
     m_skillBase.AddActionDelegate(ActionHandler);
     m_skillBase.AddSkillOverDelegate(SkillOverHandler);
     IsSkillBeBreaked = false;
     if (this.m_PlayerBehaviour.IsHero)
     {
         SendNormalSkillCommand(m_skillBase.SkillId);
     }
     m_skillBase.Fire();
     //m_PlayerBehaviour.ClientEndPos = null;
     m_PlayerBehaviour.ClientMove = false;
 }
Example #4
0
    //IEnumerator LateFireEffect(UIEffectGroup uiEffectGroups)
    //{
    //    yield return new WaitForSeconds(uiEffectGroups._EffectStartTime);
    //    GameObject effect = (GameObject)GameObject.Instantiate(uiEffectGroups._UIEffectPrefab);
    //    effect.transform.parent = BattleManager.Instance.transform.parent;
    //    effect.transform.localScale = Vector3.one;
    //    effect.transform.position = uiEffectGroups._EffectStartPos;
    //    yield return new WaitForSeconds(uiEffectGroups._EffectDuration);
    //    GameObject.Destroy(effect);
    //}

    void CastCurSkill()
    {
        if (m_sirenSkillList.Count <= 0)
        {
            return;
        }

        m_skillBase.RemoveActionDelegate(ActionHandler);
        m_skillBase.DeleteSkillOverDelegate(SkillOverHandler);

        SirenSkill sirenSkill = m_sirenSkillList[0];

        m_sirenSkillList.RemoveAt(0);

        this.m_PlayerBehaviour.GetSkillBySkillID(sirenSkill._SkillID);
        m_skillBase = this.m_PlayerBehaviour.SelectedSkillBase;
        m_skillBase.AddActionDelegate(ActionHandler);
        m_skillBase.AddSkillOverDelegate(SkillOverHandler);
        if (this.m_PlayerBehaviour.IsHero)
        {
            SendNormalSkillCommand(m_skillBase.SkillId);
        }
        m_skillBase.Fire();
        IsPlaySkillCamera(m_skillBase.SkillData);
        //UI特效

        /*
         * m_UIEffectGroup = m_skillBase.SkillData.m_UIEffectGroupList;
         * if (m_UIEffectGroup.Count > 0)
         * {
         *  m_delayCreateUIEffectTime = m_UIEffectGroup[0]._EffectStartTime;
         *  m_isCreateUIEffect = true;
         * }
         */

        //技能施放间隔
        m_delayCastCurSkillTime = sirenSkill._Duration;
        m_isCastCurSkill        = true;
    }
Example #5
0
    public override void DoBeforeEntering()
    {
        //获取可施行无双技
        var sirenSkillData   = SkillDataManager.Instance.GetSirenSkillData(this.m_PlayerBehaviour.PlayerKind);
        var levelList        = SirenManager.Instance.GetYaoNvList();
        var sirenList        = PlayerDataManager.Instance.GetPlayerSirenList();
        var sirenDefaltSkill = sirenSkillData._SirenSkills.SingleOrDefault(p => p._SirenID == 0);

        if (sirenDefaltSkill != null)
        {
            //默认妖女无双技
            m_sirenSkillList.Add(sirenDefaltSkill);
        }
        sirenList.ApplyAllItem(p =>
        {
            SYaoNvContext?context = levelList.SingleOrDefault(k => k.byYaoNvID == p._sirenID);
            if (context != null)
            {
                if (context.Value.byLevel > 0)    //妖女解锁
                {
                    SirenSkill sirenSkill = sirenSkillData._SirenSkills.SingleOrDefault(m => m._SirenID == p._sirenID);
                    if (sirenSkill != null)
                    {
                        m_sirenSkillList.Add(sirenSkill);
                    }
                }
            }
        });

        if (m_sirenSkillList.Count > 0)
        {
            SirenSkill sirenSkill = m_sirenSkillList[0];
            m_sirenSkillList.RemoveAt(0);

            this.m_PlayerBehaviour.GetSkillBySkillID(sirenSkill._SkillID);
            m_skillBase = this.m_PlayerBehaviour.SelectedSkillBase;

            //如果找不到技能
            if (m_skillBase == null)
            {
                OnChangeTransition(Transition.PlayerToIdle);
            }

            m_skillBase.AddActionDelegate(ActionHandler);
            m_skillBase.AddSkillOverDelegate(SkillOverHandler);
            if (this.m_PlayerBehaviour.IsHero)
            {
                SendNormalSkillCommand(m_skillBase.SkillId);
            }
            m_skillBase.Fire();
            IsPlaySkillCamera(m_skillBase.SkillData);
            //UI特效

            /*
             * m_UIEffectGroup = m_skillBase.SkillData.m_UIEffectGroupList;
             * if (m_UIEffectGroup.Count > 0)
             * {
             *  m_delayCreateUIEffectTime = m_UIEffectGroup[0]._EffectStartTime;
             *  m_isCreateUIEffect = true;
             * }
             *
             */
            //技能施放间隔
            m_delayCastCurSkillTime = sirenSkill._Duration;
            m_isCastCurSkill        = true;

            UIEventManager.Instance.TriggerUIEvent(UIEventType.SirenSkillFire, true);
            PlayerManager.Instance.HideHeroTitle(true);
        }
        else
        {
            OnChangeTransition(Transition.PlayerToIdle);
        }

        base.DoBeforeEntering();
    }
Example #6
0
    public override void DoBeforeEntering()
    {
        //取消技能选择
        this.m_PlayerBehaviour.LeaveInitiativeSkillSelectedState();

        if (this.m_PlayerBehaviour.IsHero)
        {
            if (this.m_PlayerBehaviour.FSMSystem.IsStateBreak())
            {
                this.m_PlayerBehaviour.RaiseEvent(EventTypeEnum.SkillBreakForStatistics.ToString(), null);
                //TraceUtil.Log(SystemModel.Rocky,"技能被打断统计加一");
            }

            //在这给服务器发打断指令
            this.m_PlayerBehaviour.BreakSkill();

            this.m_PlayerBehaviour.GetSkillBySkillID(this.m_PlayerBehaviour.m_nextSkillID);
        }

        /*找到当前选择的技能
         * 施放技能
         * 监听技能Action委托,获得技能数据,并保存起来。
         * 在Act处理里将使用这些技能数据做表现
         * */
        //m_playerStartPosition =this.m_roleBehaviour.transform.position;
        if (m_PlayerBehaviour.IsCopy)
        {
            m_playerStartPosition = m_hero.transform.position;

            m_touchPoint = ((PlayerInitiativeSkillFireState)m_hero.GetComponent <PlayerBehaviour>().FSMSystem.FindState(global::StateID.PlayerInitiativeSkill)).m_touchPoint;
        }
        else
        {
            m_playerStartPosition = this.m_roleBehaviour.transform.position;
        }
        //add at 2014-10-09 for 20141008 skill modify
        m_skillBase = m_PlayerBehaviour.SelectedSkillBase;

        m_skillBase.AddActionDelegate(ActionHandler);
        m_skillBase.AddSkillOverDelegate(SkillOverHandler);
        IsSkillBeBreaked = false;
        if (this.m_PlayerBehaviour.IsHero)
        {
            //for 20101008 skill modify
            if (m_skillBase.SkillData.AutoDirecting)
            {
                var lockMonster = MonsterManager.Instance.LockedMonster;
                if (lockMonster != null)
                {
                    var     targetPos = lockMonster.Behaviour.transform.position;
                    Vector3 lookAt    = new Vector3(targetPos.x, m_PlayerBehaviour.ThisTransform.position.y, targetPos.z);
                    m_PlayerBehaviour.ThisTransform.LookAt(lookAt);
                }
            }
            SendNormalSkillCommand(m_skillBase.SkillId);
        }
        m_skillBase.Fire();
        IsPlaySkillCamera(m_skillBase.SkillData);
        m_PlayerBehaviour.ClientMove = false;

        //UI特效

        /*
         * var uiEffectGroups = m_skillBase.SkillData.m_UIEffectGroupList;
         * if (uiEffectGroups.Count > 0)
         * {
         *  m_delayCreateUIEffectTime = uiEffectGroups[0]._EffectStartTime;
         *  m_isCreateUIEffect = true;
         * }
         */
    }