예제 #1
0
    protected override IEnumerator CharacterAction()
    {
        yield return(new WaitForSeconds(0.1f));

        switch (E_STATE)
        {
        case E_ArbaitState.E_WAIT:

            //대기중 수리 아이템이 있을 경우 수리로 바꿈
            if (AfootOjbect != null && bIsRepair == true)
            {
                CheckCharacterState(E_ArbaitState.E_REPAIR);
            }

            break;

        case E_ArbaitState.E_REPAIR:

            //수리
            fTime += Time.deltaTime;

            if (AfootOjbect == null || bIsRepair == false)
            {
                CheckCharacterState(E_ArbaitState.E_WAIT);
            }

            //수리 시간이 되면 0으로 초기화 하고 수리해줌
            if (fTime >= m_CharacterChangeData.fAttackSpeed)
            {
                fTime = 0.0f;

                Debug.Log(m_CharacterChangeData.fAttackSpeed);

                animator.SetTrigger("bIsRepair");

                //크리티컬 확률
                if (Random.Range(1, 100) <= Mathf.Round(m_CharacterChangeData.fAccuracyRate))
                {
                    m_fComplate += m_CharacterChangeData.fRepairPower * 1.5f * fRepairDownPercent;
                }
                else
                {
                    m_fComplate += m_CharacterChangeData.fRepairPower * fRepairDownPercent;
                }

                //완성 됐을 경우
                if (m_fComplate >= weaponData.fMaxComplate)
                {
                    ScoreManager.ScoreInstance.GoldPlus(100);

                    ComplateWeapon();
                }

                SpawnManager.Instance.CheckComplateWeapon(AfootOjbect, m_fComplate, m_fTemperator);
            }
            break;

        case E_ArbaitState.E_BOSSREPAIR:

            //수리
            fTime += Time.deltaTime;

            //수리 시간이 되면 0으로 초기화 하고 수리해줌
            if (fTime >= m_fRepairTime)
            {
                fTime = 0.0f;

                animator.SetTrigger("bIsRepair");

                RepairShowObject.SetCurCompletion(m_CharacterChangeData.fRepairPower);
            }

            break;
        }
    }
예제 #2
0
    protected override IEnumerator CharacterAction()
    {
        yield return(new WaitForSeconds(0.1f));

        if (m_CharacterChangeData.fAttackSpeed < 0.3)
        {
            fMinAttackSpeed = 0.3f;
        }

        else
        {
            fMinAttackSpeed = m_CharacterChangeData.fAttackSpeed;
        }

        switch (E_STATE)
        {
        case E_ArbaitState.E_WAIT:
            SpawnManager.Instance.InsertWeaponArbait(m_CharacterChangeData.index, nBatchIndex);

            //대기중 수리 아이템이 있을 경우 수리로 바꿈
            if (AfootOjbect != null && bIsRepair == true)
            {
                CheckCharacterState(E_ArbaitState.E_REPAIR);
            }

            break;

        case E_ArbaitState.E_REPAIR:

            //수리
            fTime += Time.deltaTime;

            if (AfootOjbect == null || bIsRepair == false)
            {
                CheckCharacterState(E_ArbaitState.E_WAIT);
            }

            if (AfootOjbect == RepairShowObject.AfootObject)
            {
                SpawnManager.Instance.InsertWeaponArbait(m_CharacterChangeData.index, nBatchIndex);
            }

            //수리 시간이 되면 0으로 초기화 하고 수리해줌
            if (fTime >= fMinAttackSpeed)
            {
                fTime           = 0.0f;
                m_dCalComaplete = 0;

                dDodomchitRepair = m_CharacterChangeData.dRepairPower * fDodomchitRepairPercent * 0.01f;

                if (playerData.AccessoryEquipmnet != null)
                {
                    if (playerData.AccessoryEquipmnet.nIndex == (int)E_BOSS_ITEM.DODOM_GLASS)
                    {
                        fBossRepairPercent   = playerData.AccessoryEquipmnet.fBossOptionValue;
                        fBossCriticalPercent = playerData.AccessoryEquipmnet.fBossOptionValue;
                    }
                    else
                    {
                        fBossRepairPercent   = 0;
                        fBossCriticalPercent = 0;
                    }
                }


                //크리티컬 확률
                if (UnityEngine.Random.Range(0, 100) <= Math.Round(m_CharacterChangeData.fCritical + fBossCriticalPercent))
                {
                    animator.SetTrigger("bIsCriticalRepair");
                    m_dCalComaplete += m_CharacterChangeData.dRepairPower * 1.5f + dDodomchitRepair;
                }
                else
                {
                    animator.SetTrigger("bIsNormalRepair");
                    m_dCalComaplete += m_CharacterChangeData.dRepairPower + dDodomchitRepair;
                }

                m_dCalComaplete += m_dCalComaplete * fBossRepairPercent * 0.01f;

                m_dCalComaplete += m_dCalComaplete * playerData.changeStats.fArbaitsPower * 0.01f;

                if (spawnManager.shopCash.isConumeBuff_Staff)
                {
                    m_dCalComaplete *= 2;
                }

                m_dComplate += m_dCalComaplete;

                //완성 됐을 경우
                if (m_dComplate >= weaponData.dMaxComplate)
                {
                    ScoreManager.ScoreInstance.GoldPlus(100);
                    SpawnManager.Instance.questManager.QuestSuccessCheck(QuestType.E_QUESTTYPE_ARBAITSUCCESS, 1);
                    ComplateWeapon();
                }

                SpawnManager.Instance.CheckComplateWeapon(AfootOjbect, m_dComplate, m_fTemperator);
            }
            break;

        case E_ArbaitState.E_BOSSREPAIR:

            //수리
            fTime += Time.deltaTime;

            //수리 시간이 되면 0으로 초기화 하고 수리해줌
            if (fTime >= fMinAttackSpeed)
            {
                fTime           = 0.0f;
                m_dCalComaplete = 0;

                dDodomchitRepair = m_CharacterChangeData.dRepairPower * fDodomchitRepairPercent * 0.01f;

                if (playerData.AccessoryEquipmnet != null)
                {
                    if (playerData.AccessoryEquipmnet.nIndex == (int)E_BOSS_ITEM.DODOM_GLASS)
                    {
                        fBossRepairPercent   = playerData.AccessoryEquipmnet.fBossOptionValue;
                        fBossCriticalPercent = playerData.AccessoryEquipmnet.fBossOptionValue;
                    }
                    else
                    {
                        fBossRepairPercent   = 0;
                        fBossCriticalPercent = 0;
                    }
                }


                //크리티컬 확률
                if (UnityEngine.Random.Range(0, 100) <= Math.Round(m_CharacterChangeData.fCritical + fBossCriticalPercent))
                {
                    animator.SetTrigger("bIsCriticalRepair");
                    m_dCalComaplete += m_CharacterChangeData.dRepairPower * 1.5f + dDodomchitRepair;
                }
                else
                {
                    animator.SetTrigger("bIsNormalRepair");
                    m_dCalComaplete += m_CharacterChangeData.dRepairPower + dDodomchitRepair;
                }

                m_dCalComaplete += m_dCalComaplete * fBossRepairPercent * 0.01f;

                m_dCalComaplete += m_dCalComaplete * playerData.changeStats.fArbaitsPower * 0.01f;

                if (spawnManager.shopCash.isConumeBuff_Staff)
                {
                    m_dCalComaplete *= 2;
                }

                RepairShowObject.SetCurCompletion(m_dCalComaplete);
            }

            break;
        }
    }