예제 #1
0
    public void InstallAccessory(int index, Inventory inventory, int install)
    {
        //있던 보석의 능력치를 제거
        switch (m_nAccessoryState)
        {
        case 1:
            inventory.m_Ability.SetAllHp(inventory.m_Ability.m_AllHp - m_nAccessoryIncrease);
            m_UIPlayerState.SetAllHp();
            m_UIPlayerState.SetHp();
            break;

        case 2:
            inventory.m_Ability.SetAllMp(inventory.m_Ability.m_AllMp - m_nAccessoryIncrease);
            m_UIPlayerState.SetAllMp();
            m_UIPlayerState.SetMp();
            break;

        case 3:
            inventory.m_Ability.SetDefense(inventory.m_Ability.m_Defense - m_nAccessoryIncrease);
            break;

        case 4:
            inventory.m_Ability.SetAttack(inventory.m_Ability.m_Attack - m_nAccessoryIncrease);
            break;
        }
        //장착하여 보석의 능력치를 생성
        switch (index)
        {
        case 1:
            m_nAccessoryIncrease = (int)(inventory.m_Ability.m_AllHp * (DataMng.Get(TableType.AccessoryTable).ToF(index, "INCREASE") * 0.01f));
            inventory.m_Ability.SetAllHp(inventory.m_Ability.m_AllHp + m_nAccessoryIncrease);
            m_UIPlayerState.SetAllHp();
            m_UIPlayerState.SetHp();
            break;

        case 2:
            m_nAccessoryIncrease = (int)(inventory.m_Ability.m_AllMp * (DataMng.Get(TableType.AccessoryTable).ToF(index, "INCREASE") * 0.01f));
            inventory.m_Ability.SetAllMp(inventory.m_Ability.m_AllMp + m_nAccessoryIncrease);
            m_UIPlayerState.SetAllMp();
            m_UIPlayerState.SetMp();
            break;

        case 3:
            m_nAccessoryIncrease = (int)(inventory.m_Ability.m_Defense * (DataMng.Get(TableType.AccessoryTable).ToF(index, "INCREASE") * 0.01f));
            inventory.m_Ability.SetDefense(inventory.m_Ability.m_Defense + m_nAccessoryIncrease);
            break;

        case 4:
            m_nAccessoryIncrease = (int)(inventory.m_Ability.m_Attack * (DataMng.Get(TableType.AccessoryTable).ToF(index, "INCREASE") * 0.01f));
            inventory.m_Ability.SetAttack(inventory.m_Ability.m_Attack + m_nAccessoryIncrease);
            break;
        }
        m_nAccessoryState = index;
    }
예제 #2
0
    public void Drink()
    {
        AudioManager.Instance.PlayEffect(10);
        switch (m_nType)
        {
        case (int)PortionType.Hp:
            m_PlayerAbility.SetHp(m_PlayerAbility.m_Hp + m_fEffect);

            if (m_PlayerAbility.m_AllHp < m_PlayerAbility.m_Hp)
            {
                m_PlayerAbility.SetHp(m_PlayerAbility.m_AllHp);
            }
            m_UIPlayerState.SetHp();
            break;

        case (int)PortionType.Mp:
            m_PlayerAbility.SetMp(m_PlayerAbility.m_Mp + m_fEffect);

            if (m_PlayerAbility.m_AllMp < m_PlayerAbility.m_Mp)
            {
                m_PlayerAbility.SetMp(m_PlayerAbility.m_AllMp);
            }
            m_UIPlayerState.SetMp();
            break;

        case (int)PortionType.Attack:
            m_PlayerAbility.buff(m_nType, m_fEffect);

            break;

        case (int)PortionType.Defense:
            m_PlayerAbility.buff(m_nType, m_fEffect);

            break;

        default:
            return;
        }
        --m_nCount;
        m_CountTxt.text        = m_nCount.ToString();
        m_InInvenCountTxt.text = m_nCount.ToString();

        if (m_nCount < 1)
        {
            Destroy(gameObject);
            m_InInvenObj.GetComponent <PortionEquipment>().ZeroCount();
        }
    }
예제 #3
0
    public IEnumerator Cooltime(int index)
    {
        m_UIPlayerState.m_PlayerAbility.SetMp(m_UIPlayerState.m_PlayerAbility.m_Mp - m_nMp);
        m_UIPlayerState.SetMp();

        m_bCoolTimeDown[m_DicSlot[index]] = false;

        m_CoolTimeDownImg[m_DicSlot[index]].fillAmount = 1;

        while (true)
        {
            m_fCoolTimeDownSave[m_DicSlot[index]] += Time.deltaTime;
            yield return(null);

            m_CoolTimeDownImg[m_DicSlot[index]].fillAmount = 1 - (m_fCoolTimeDownSave[m_DicSlot[index]] / m_DicCoolTimeDown[index]);

            if (m_fCoolTimeDownSave[m_DicSlot[index]] > m_DicCoolTimeDown[index])
            {
                m_bCoolTimeDown[m_DicSlot[index]]     = true;
                m_fCoolTimeDownSave[m_DicSlot[index]] = 0;
                break;
            }
        }
    }