Example #1
0
    /// <summary>
    /// 选择普通攻击的技能,【向前还是向后】
    /// </summary>
    /// <param name="step"></param>
    private void SelectNormalSkill()
    {
        int step = m_normalAttackStep;

        if (m_skillBase != null)
        {
            m_skillBase.RemoveActionDelegate(ActionHandler);
            m_skillBase.DeleteSkillOverDelegate(SkillOverHandler);
        }
        //检测的距离和角度
        var detectDistance = CommonDefineManager.Instance.CommonDefine.DetectDistance[0];
        var detectAngle    = CommonDefineManager.Instance.CommonDefine.DetectDistance[1];
        var monsters       = MonsterManager.Instance.SearchBeAttackedMonster(this.m_PlayerBehaviour.transform.position, detectDistance, m_attackDire, detectAngle);

        var triggerCollidder = monsters.Any(P =>
        {
            var distance = Vector3.Distance(P.Behaviour.transform.position, this.m_PlayerBehaviour.ThisTransform.position);
            return(((MonsterBehaviour)P.Behaviour).m_MonsterConfigData._hitRadius >= distance);
        });
        //TraceUtil.Log("SkillStep:" + step + "  ISBAckup:" + triggerCollidder);
        //TraceUtil.Log("SkillID:" + PlayerDataManager.Instance.GetBattleItemData(this.m_PlayerBehaviour.PlayerKind).GetPlayerNormalSkillId(step, triggerCollidder));
        int skillId = PlayerDataManager.Instance.GetBattleItemData(this.m_PlayerBehaviour.PlayerKind).GetPlayerNormalSkillId(step, triggerCollidder);

        //Debug.Log("skillId:" + skillId + "  step:" + step);
        this.m_PlayerBehaviour.GetSkillBySkillID(skillId);
        //TraceUtil.Log("skillbase is null?:" + (this.m_PlayerBehaviour.SelectedSkillBase == null));
        m_skillBase = this.m_PlayerBehaviour.SelectedSkillBase;
        m_skillBase.AddActionDelegate(ActionHandler);
        m_skillBase.AddSkillOverDelegate(SkillOverHandler);
    }
Example #2
0
    public void BreakSkill()
    {
        if (m_skillBase != null)
        {
            m_skillBase.BreakSkill();
            m_skillBase.RemoveActionDelegate(ActionHandler);
            m_skillBase.DeleteSkillOverDelegate(SkillOverHandler);
            //m_skillBase.RemoveSkillEffectFireDelegate(FireSkillActionEffect);
            //m_skillBase.RemoveSkillBulletFireDelegate(FireSkillBullet);

            ChangeDisplayState(1);
        }

        /*
         *
         * if (m_curSkillEffect != null)
         * {
         *  GameObjectPool.Instance.Release(m_curSkillEffect);
         * }
         * if (m_curBullet != null)
         * {
         *  DestroyImmediate(m_curBullet);
         * }
         */
    }
Example #3
0
    public override void DoBeforeLeaving()
    {
        m_MonsterBehaviour.Invincible = false;
        m_MonsterBehaviour.IronBody   = false;
        if (m_currentSkillBase != null)
        {
            m_currentSkillBase.RemoveActionDelegate(ActionHandle);
            m_currentSkillBase.RemoveSkillBulletFireDelegate(FireBulletHandle);
            m_currentSkillBase.RemoveSkillEffectFireDelegate(FireSkillActionEffect);
            m_currentSkillBase.DeleteSkillOverDelegate(ActionOverHandle);

            m_currentSkillBase.BreakSkill();
        }
        //保证显身

        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      = 0;
            sMsgFightCommand_CS.fighterPosX = xValue;
            sMsgFightCommand_CS.fighterPosY = yValue;

            NetServiceManager.Instance.BattleService.SendFightCommandCS(sMsgFightCommand_CS);
        }

        m_MonsterBehaviour.ChangeDisplayState(1);
        base.DoBeforeLeaving();
    }
Example #4
0
    public override void DoBeforeLeaving()
    {
        m_PlayerBehaviour.Invincible = false;
        m_PlayerBehaviour.IronBody   = false;
        m_skillBase.RemoveActionDelegate(ActionHandler);
        m_skillBase.DeleteSkillOverDelegate(SkillOverHandler);
        m_skillBase.BreakSkill();

        /*if (m_skillCamera != null)
         *  m_skillCamera.GetComponent<SkillCamera>().OnDestroy();*/
        //技能结束,必须保证角色显身
        m_PlayerBehaviour.ChangeDisplayState(1);
        //m_PlayerBehaviour.ChangeDisplayState(1);

        if (GameManager.Instance.CurrentGameMode == GameMode.SINGLE_PLAYER)
        {
            float xValue, yValue;
            this.m_PlayerBehaviour.ThisTransform.position.SetToServer(out xValue, out yValue);
            SMsgFightCommand_CS sMsgFightCommand_CS = new SMsgFightCommand_CS();
            sMsgFightCommand_CS.uidFighter  = this.m_PlayerBehaviour.RoleDataModel.SMsg_Header.uidEntity;
            sMsgFightCommand_CS.nFightCode  = m_skillBase.SkillId;
            sMsgFightCommand_CS.byType      = 0;
            sMsgFightCommand_CS.fighterPosX = xValue;
            sMsgFightCommand_CS.fighterPosY = yValue;

            NetServiceManager.Instance.BattleService.SendFightCommandCS(sMsgFightCommand_CS);
        }

        base.DoBeforeLeaving();
    }
Example #5
0
    public override void DoBeforeLeaving()
    {
        m_PlayerBehaviour.Invincible = false;
        m_PlayerBehaviour.IronBody   = false;

        m_PlayerBehaviour.ChangeDisplayState(1);

        if (m_skillBase != null)
        {
            m_skillBase.RemoveActionDelegate(ActionHandler);
            m_skillBase.DeleteSkillOverDelegate(SkillOverHandler);
        }

        UIEventManager.Instance.TriggerUIEvent(UIEventType.SirenSkillFire, false);
        PlayerManager.Instance.HideHeroTitle(false);

        base.DoBeforeLeaving();
    }
Example #6
0
    public override void DoBeforeLeaving()
    {
        m_PlayerBehaviour.Invincible = false;
        m_PlayerBehaviour.IronBody   = false;
        m_skillBase.RemoveActionDelegate(ActionHandler);
        m_skillBase.DeleteSkillOverDelegate(SkillOverHandler);
        IsSkillBeBreaked = true;
        m_skillBase.BreakSkill();
        if (GameManager.Instance.CurrentGameMode == GameMode.SINGLE_PLAYER)
        {
            float xValue, yValue;
            this.m_PlayerBehaviour.ThisTransform.position.SetToServer(out xValue, out yValue);
            SMsgFightCommand_CS sMsgFightCommand_CS = new SMsgFightCommand_CS();
            sMsgFightCommand_CS.uidFighter  = this.m_PlayerBehaviour.RoleDataModel.SMsg_Header.uidEntity;
            sMsgFightCommand_CS.nFightCode  = m_skillBase.SkillId;
            sMsgFightCommand_CS.byType      = 0;
            sMsgFightCommand_CS.fighterPosX = xValue;
            sMsgFightCommand_CS.fighterPosY = yValue;

            NetServiceManager.Instance.BattleService.SendFightCommandCS(sMsgFightCommand_CS);
        }

        base.DoBeforeLeaving();
    }