Example #1
0
 private void DeleteEquipAbility(Item.CEquip equip)
 {
     foreach (var ability in equip.equipAbilities)
     {
         _equipAbilityIncreaseSizeArr[(int)ability.equipEffect] -= ability.value;
     }
 }
Example #2
0
 private void SwapEquip(ref Item.CEquip lhs, ref Item.CEquip rhs)
 {
     Item.CEquip temp;
     temp = lhs;
     lhs = rhs;
     rhs = temp;
 }
Example #3
0
 /// <summary>
 /// 장비 패시브를 추가 조건에 따라 실행
 /// ex) n회에 한 번 실행 / n 이상일 때 실행 / n 이하일 때 실행
 /// </summary>
 /// <param name="equip">적용 장비</param>
 /// <param name="count"></param>
 private void ExecuteEquipPassive(Item.CEquip equip, int count)
 {
     switch (equip.PassiveConditionOption)
     {
         case Item.EEquipEventCountOption.Accumulate:
             equip.passiveCurrentCount += count;
             if(equip.passiveCurrentCount >= equip.PassiveUseCount)
             {
                 _inventoryUser.GetComponent<CPlayerPara>().TakeUseEffectHandleList(equip.passiveEffect);
                 equip.passiveCurrentCount = 0;
             }
             break;
         case Item.EEquipEventCountOption.Each_Below:
             if (equip.PassiveUseCount >= count)
             {
                 _inventoryUser.GetComponent<CPlayerPara>().TakeUseEffectHandleList(equip.passiveEffect);
             }
             break;
         case Item.EEquipEventCountOption.Each_Over:
             if (equip.PassiveUseCount <= count)
             {
                 _inventoryUser.GetComponent<CPlayerPara>().TakeUseEffectHandleList(equip.passiveEffect);
             }
             break;
         default:
             Debug.Log("Error case");
             break;
     }
 }
Example #4
0
    private void Awake()
    {
        if (equipStat == null)
        {
            equipStat = new Item.CEquip("", 0, null);
        }

        Item = equipStat;
    }
Example #5
0
        public static string CreateExplainText(CEquip equip)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(CreateAbilityText(equip.equipAbilities));
            sb.Append(CreatePassiveText(
                          equip.PassiveCondition, equip.PassiveUseCount, equip.PassiveConditionOption, equip.passiveEffect)
                      );
            sb.Append(CreateUpgradeText(equip.UpgradeCondition, equip.UpgradeCount, equip.upgradeAbilities));
            return(sb.ToString());
        }
Example #6
0
    /// <summary>
    /// 장비 성장
    /// </summary>
    /// <param name="equip"></param>
    private void ExecuteEquipUpgrade(Item.CEquip equip)
    {
        if(equip.UpgradeCurrentCount >= equip.UpgradeCount)
        {
            return;
        }

        equip.UpgradeCurrentCount++;
        if (equip.UpgradeCurrentCount == equip.UpgradeCount)
        {
            Debug.Log("Equip Upgrade");
        }
    }
Example #7
0
    /// <summary>
    /// 가방에 장비 아이템 넣기
    /// </summary>
    /// <returns>아이템 넣기 성공했는지</returns>
    public bool AddEquip(Item.CEquip newEquip)
    {
        if(_equipItems.Count >= _equipItems.Capacity)
        {
            return false;
        }

        if(HasOverlapEquip(newEquip))
        {
            Debug.Log("overlap equip");
            return false;
        }

        _equipItems.Add(newEquip);
        AddEquipAbility(newEquip);

        return true;
    }
Example #8
0
 ///<summary>
 ///장비 상위 / 하위 아이템 중복인지 확인
 ///</summary>
 ///<returns></returns>
 private bool HasOverlapEquip(Item.CEquip newEquip)
 {
     return false;
 }
 public void DrawEquipExplain(Item.CEquip equip)
 {
     _itemExplain.text += Item.CEquipExplainText.CreateExplainText(equip);
 }