예제 #1
0
    /// <summary>
    /// 根据玩家的战斗阶段初始化
    /// </summary>
    /// <param name="eRoleStage"></param>
    /// <param name="unBackUpTime"></param>
    /// <param name="unTimeLimit"></param>
    /// <param name="eQueryTimeType"></param>
    public void OnSelfEnterRoleStage(EClientRoleStage eRoleStage, uint unBackUpTime, uint unTimeLimit, EQueryTimeType eQueryTimeType)
    {
        this.m_eRoleStage     = eRoleStage;
        this.m_eQueryTimeType = eQueryTimeType;
        switch (this.m_eRoleStage)
        {
        case EClientRoleStage.ROLE_STAGE_REMOVE:
            break;

        case EClientRoleStage.ROLE_STAGE_WAIT:
            this.EndShowStage();
            break;
        }
        if (base.Prepared)
        {
            if (this.m_eRoleStage == EClientRoleStage.ROLE_STAGE_MOVE)
            {
                base.uiBehaviour.m_Button_Finish.SetVisible(true);
                base.uiBehaviour.m_Label_Finish.SetText("Stop");
            }
            else if (this.m_eRoleStage == EClientRoleStage.ROLE_STAGE_ACTION)
            {
                base.uiBehaviour.m_Button_Finish.SetVisible(true);
                base.uiBehaviour.m_Label_Finish.SetText("End");
            }
            else if (this.m_eRoleStage == EClientRoleStage.ROLE_STAGE_WAIT)
            {
                base.uiBehaviour.m_Button_Finish.SetVisible(false);
            }
            else if (this.m_eRoleStage == EClientRoleStage.ROLE_STAGE_SELECT_BORN_POS)
            {
                base.uiBehaviour.m_Button_Finish.SetVisible(false);
            }
        }
    }
예제 #2
0
    /// <summary>
    /// 发送给服务器结束本战斗阶段
    /// </summary>
    /// <param name="stage"></param>
    public void SendFinishRoleStage(EClientRoleStage stage)
    {
        CptcC2MReq_EndRoleStage msg = new CptcC2MReq_EndRoleStage();

        msg.beastId = Singleton <BeastRole> .singleton.Id;
        msg.stage   = (int)Singleton <BeastRole> .singleton.eRoleStage;
        this.SendMsg(msg);
        this.m_log.Debug("SendFinishedRoleStage:" + stage.ToString());
    }
예제 #3
0
    public void OnBeastEnterRoleStage(long unBeastId, EClientRoleStage eRoleStage, uint unBackupLimit, uint unTimeLimit, uint unTargetBeastId, EQueryTimeType eQueryTimeType)
    {
        Beast beastById = this.GetBeastById(unBeastId);

        if (beastById != null)
        {
            beastById.TargetBeastId = unTargetBeastId;
            beastById.OnEnterRoleStage(eRoleStage, unBackupLimit, unTimeLimit, unTargetBeastId, eQueryTimeType);
        }
    }
예제 #4
0
 public void EnableButtonFinish(bool enable, EClientRoleStage eRoleStage)
 {
     if (base.Prepared)
     {
         base.uiBehaviour.m_Button_Finish.SetVisible(enable);
         if (eRoleStage == EClientRoleStage.ROLE_STAGE_MOVE || eRoleStage == EClientRoleStage.ROLE_STAGE_REMOVE)
         {
             base.uiBehaviour.m_Label_Finish.SetText("Stop");
         }
         if (eRoleStage == EClientRoleStage.ROLE_STAGE_ACTION)
         {
             base.uiBehaviour.m_Label_Finish.SetText("End");
         }
     }
 }
예제 #5
0
 /// <summary>
 /// 神兽进入阶段
 /// </summary>
 /// <param name="eNewRoleStage"></param>
 /// <param name="unBackUpTime"></param>
 /// <param name="unTimeLimit"></param>
 /// <param name="unTargetPlayerID"></param>
 /// <param name="eQueryTimeType"></param>
 public void OnEnterRoleStage(EClientRoleStage eNewRoleStage, uint unBackUpTime, uint unTimeLimit, uint unTargetPlayerID, EQueryTimeType eQueryTimeType)
 {
     //如果又一次重新进入该操作状态,就刷新该状态
     if (this.eRoleStage == eNewRoleStage)
     {
         this.RefreshRoleStage(unBackUpTime, unTimeLimit, unTargetPlayerID, eQueryTimeType);
     }
     else
     {
         if (eNewRoleStage == EClientRoleStage.ROLE_STAGE_WAIT)
         {
             //如果是操作等待状态的时候,就不随机播放声音
             this.m_bToPlayVoiceInRound  = false;
             this.m_bToPlayVoiceOutRound = true;
             this.m_fvoiceOutRoundMoment = Time.time + (float)UnityEngine.Random.Range(60, 90);
         }
         else
         {
             this.m_bToPlayVoiceOutRound = false;
         }
         if (eNewRoleStage == EClientRoleStage.ROLE_STAGE_MOVE)
         {
             this.PlayAnim("Run");
         }
         else
         {
             if (this.eRoleStage == EClientRoleStage.ROLE_STAGE_MOVE)
             {
                 this.StopAnim("Run");
             }
         }
         this.eRoleStage = eNewRoleStage;
         if (eNewRoleStage == EClientRoleStage.ROLE_STAGE_ACTION)
         {
             Debug.Log("进入到Action阶段");
         }
         if (this.Role)
         {
             Singleton <BeastRole> .singleton.OnEnterRoleStage(eNewRoleStage, unBackUpTime, unTimeLimit, unTargetPlayerID, eQueryTimeType);
         }
     }
 }
예제 #6
0
 public void OnBeastEnterRoleStage(long unBeastId, EClientRoleStage eRoleStage, uint unBackupLimit, uint unTimeLimit, EQueryTimeType eQueryTimeType)
 {
     this.OnBeastEnterRoleStage(unBeastId, eRoleStage, unBackupLimit, unTimeLimit, 0u, eQueryTimeType);
 }
예제 #7
0
 /// <summary>
 /// 神兽进入战斗阶段
 /// </summary>
 /// <param name="unBeastId"></param>
 /// <param name="eRoleStage"></param>
 /// <param name="unTimeLimit"></param>
 public void OnBeastEnterRoleStage(long unBeastId, EClientRoleStage eRoleStage, uint unTimeLimit)
 {
     this.OnBeastEnterRoleStage(unBeastId, eRoleStage, 0u, unTimeLimit, 0u, EQueryTimeType.NORMAL_QUERY_TIME);
 }
예제 #8
0
    /// <summary>
    /// 自己神兽角色进入操作状态
    /// </summary>
    /// <param name="eRoleStage"></param>
    /// <param name="unBackUpTime"></param>
    /// <param name="unTimeLimit"></param>
    /// <param name="unTargetHeroID"></param>
    /// <param name="eQueryTimeType"></param>
    public void OnEnterRoleStage(EClientRoleStage eRoleStage, uint unBackUpTime, uint unTimeLimit, uint unTargetHeroID, EQueryTimeType eQueryTimeType)
    {
        //DlgBase<DlgMain, DlgMainBehaviour>.singleton.OnSelfEnterRoleStage(eRoleStage, unBackUpTime, unTimeLimit, eQueryTimeType);
        switch (eRoleStage)
        {
        case EClientRoleStage.ROLE_STAGE_COMPUTE_STATE:
            Singleton <OpStateManager> .singleton.ChangeState(enumOpState.eOpState_Compute);

            break;

        case EClientRoleStage.ROLE_STAGE_TAKE_CARD:
            Singleton <OpStateManager> .singleton.ChangeState(enumOpState.eOpState_Wait);

            break;

        case EClientRoleStage.ROLE_STAGE_MOVE:
            Singleton <OpStateManager> .singleton.ChangeState(enumOpState.eOpState_Move);

            break;

        case EClientRoleStage.ROLE_STAGE_ACTION:
            Singleton <OpStateManager> .singleton.ChangeState(enumOpState.eOpState_Action);

            break;

        case EClientRoleStage.ROLE_STAGE_DISCARD_CRAD:
            Singleton <OpStateManager> .singleton.ChangeState(enumOpState.eOpState_DiscardCard);

            break;

        case EClientRoleStage.ROLE_STAGE_SELECT_BORN_POS:
            Singleton <OpStateManager> .singleton.ChangeState(enumOpState.eOpState_SelectBornPos);

            break;

        case EClientRoleStage.ROLE_STAGE_REVIVE:
            Singleton <OpStateManager> .singleton.ChangeState(enumOpState.eOpState_Revive);

            break;

        case EClientRoleStage.ROLE_STAGE_RE_SELECT_HERO:
            Singleton <OpStateManager> .singleton.ChangeState(enumOpState.eOpState_ReSelectHero);

            break;

        case EClientRoleStage.ROLE_STAGE_RE_SELECT_SKILL:
            Singleton <OpStateManager> .singleton.ChangeState(enumOpState.eOpState_ReSelectSkill);

            break;

        case EClientRoleStage.ROLE_STAGE_RE_SELECT_CARD:
            Singleton <OpStateManager> .singleton.ChangeState(enumOpState.eOpState_ReSelectCard);

            break;

        case EClientRoleStage.ROLE_STAGE_FIRST_AID_QUERY:
            Singleton <OpStateManager> .singleton.ChangeState(enumOpState.eOpState_FirstAidQuery);

            break;

        case EClientRoleStage.ROLE_STAGE_DODGE_QUERY:
            Singleton <OpStateManager> .singleton.ChangeState(enumOpState.eOpState_DodgeQuery);

            break;

        case EClientRoleStage.ROLE_STAGE_BASE_HURT_DEFENCE_QUERY:
            Singleton <OpStateManager> .singleton.ChangeState(enumOpState.eOpState_BaseHurtDefence);

            break;

        case EClientRoleStage.ROLE_STAGE_EXTRACT_ENEMY_CARD:
            Singleton <OpStateManager> .singleton.ChangeState(enumOpState.eOpState_ExtractEnemyCard);

            break;

        case EClientRoleStage.ROLE_STAGE_REMOVE:
            Singleton <OpStateManager> .singleton.ChangeState(enumOpState.eOpState_ReMove);

            break;

        case EClientRoleStage.ROLE_STAGE_STATUS_PURIFY:
            Singleton <OpStateManager> .singleton.ChangeState(enumOpState.eOpState_StatusPurify);

            break;

        case EClientRoleStage.ROLE_STAGE_ALTER_SELF_SKILL_CD:
            Singleton <OpStateManager> .singleton.ChangeState(enumOpState.eOpState_AlterSelfSkillCD);

            break;

        case EClientRoleStage.ROLE_STAGE_WAIT:
            Singleton <OpStateManager> .singleton.ChangeState(enumOpState.eOpState_Wait);

            break;
        }
    }