Save_EquipItem_SlotLvUpInit
This commit is contained in:
parent
06b3622387
commit
b9e7bbd74a
|
|
@ -1270,7 +1270,8 @@ handlers.Save_EquipItem_SlotLvUp = function(args)
|
|||
var table = Get_MissionTable();
|
||||
var m_SD_Slot = urod.Slot.find(f => f.Parts == esu_data.e_EquipParts);
|
||||
var price = parseInt(Get_K_Value(m_SD_Slot.Lv, esu_data.f_BalanceConstantPrice, esu_data.n_DefaultValuePrice, esu_data.f_LevelPerValuePrice));
|
||||
log.info("슬롯 강화 비용 " + price)
|
||||
if (price <= 0) price = 1;
|
||||
log.info("슬롯 강화 비용 " + price);
|
||||
if (Use_Item(table, urod, esu_data.n_ConsumeGoodsID, price))
|
||||
{
|
||||
m_SD_Slot.Use += price;
|
||||
|
|
@ -1284,6 +1285,34 @@ handlers.Save_EquipItem_SlotLvUp = function(args)
|
|||
}
|
||||
return Get_Return(1);
|
||||
}
|
||||
handlers.Save_EquipItem_SlotLvUpInit = function(args)
|
||||
{
|
||||
var readonlydata = Get_UserReadOnlyData();
|
||||
var error = Get_Error(readonlydata, args.Token);
|
||||
if (error < 0) return Get_Return(error);
|
||||
|
||||
var urod = Get_JsonUserData(readonlydata);
|
||||
|
||||
var itemtable = Get_ItemTable();
|
||||
var itemdata = itemtable.find(f=>f.n_ItemID == args.ItemID);
|
||||
if (!itemdata) return Get_Return(3);
|
||||
|
||||
var esu_table = Get_EquipmentSlotUpgradeTable();
|
||||
var esu_data = esu_table.find(f=>f.e_EquipParts == itemdata.e_ItemType);
|
||||
if (!esu_data) return Get_Return(4);
|
||||
|
||||
var m_SD_Slot = urod.Slot.find(f => f.Parts == esu_data.e_EquipParts);
|
||||
if (m_SD_Slot.Lv > 0)
|
||||
{
|
||||
Add_Item(Get_MissionTable(), Get_ItemTable(), urod, esu_data.n_ConsumeGoodsID, m_SD_Slot.Use);
|
||||
m_SD_Slot.Use = 0;
|
||||
m_SD_Slot.Lv = 0;
|
||||
|
||||
Set_JsonUserData(urod);
|
||||
return Get_Return(0);
|
||||
}
|
||||
return Get_Return(1);
|
||||
}
|
||||
/////////////////////////////////// 서버 처리
|
||||
|
||||
handlers.Write_UnityInApp = function(args)
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Binary file not shown.
|
|
@ -1483,6 +1483,44 @@ public class ServerInfo : MyCoroutine
|
|||
Set_Coroutine(() => { Save_EquipItem_SlotLvUp(itemid, _act); }, 2f);
|
||||
});
|
||||
}
|
||||
public void Save_EquipItem_SlotLvUpInit(int itemid, Action _act)
|
||||
{
|
||||
NetWait.Ins.Set(true);
|
||||
PlayFabClientAPI.ExecuteCloudScript(new ExecuteCloudScriptRequest
|
||||
{
|
||||
FunctionName = MethodBase.GetCurrentMethod().Name,
|
||||
GeneratePlayStreamEvent = true,
|
||||
FunctionParameter = new
|
||||
{
|
||||
Token = m_LoginInfo.EntityToken.EntityToken,
|
||||
ItemID = itemid,
|
||||
}
|
||||
},
|
||||
result =>
|
||||
{
|
||||
if (result.Error == null)
|
||||
{
|
||||
NetWait.Ins.Set(false);
|
||||
var str_result = result.FunctionResult.ToString();
|
||||
var error = MyErrorCheck(str_result);
|
||||
// (0 성공, 1 실패 (초기화 할 필요 없음), 3 실패 (없는 아이템), 4 실패 (업그레이드 정보 없는 파츠))
|
||||
switch (error)
|
||||
{
|
||||
case 0: _act?.Invoke(); break;
|
||||
case 1: ToastUI.Ins.Set(999900021); break;
|
||||
//case 2: ToastUI.Ins.Set(999900003); break; 없음
|
||||
case 3: ToastUI.Ins.Set(999900014); break;
|
||||
case 4: ToastUI.Ins.Set(999900020); break;
|
||||
}
|
||||
}
|
||||
else
|
||||
Set_Coroutine(() => { Save_EquipItem_SlotLvUpInit(itemid, _act); }, 2f);
|
||||
},
|
||||
fail =>
|
||||
{
|
||||
Set_Coroutine(() => { Save_EquipItem_SlotLvUpInit(itemid, _act); }, 2f);
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 우편
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public class EquipmentItemPopup : EquipmentPopupItemInfoBase
|
|||
m_EquipItemEnchantOption.Set(m_SD_Slot);
|
||||
}
|
||||
|
||||
int Get_Price() { return (int)m_ESUTD.Get_Price(m_SD_Slot.Lv); }
|
||||
int Get_Price() { var price = (int)m_ESUTD.Get_Price(m_SD_Slot.Lv); return price > 0 ? price : 1; }
|
||||
public eItem Get_Parts() { return m_Data.e_EquipParts; }
|
||||
|
||||
public void OnClick_Reinforce()
|
||||
|
|
@ -87,8 +87,16 @@ public class EquipmentItemPopup : EquipmentPopupItemInfoBase
|
|||
}
|
||||
public void OnClick_ReinforceReset()
|
||||
{
|
||||
ServerInfo.Ins.m_ServerData.Init_SlotLv(m_ESUTD.e_EquipParts, m_ESUTD.n_ConsumeGoodsID);
|
||||
Set_UI();
|
||||
var sdata = ServerInfo.Ins.m_ServerData;
|
||||
if (sdata.Get_SlotData(m_ESUTD.e_EquipParts).Lv > 0)
|
||||
ServerInfo.Ins.Save_EquipItem_SlotLvUpInit(m_Data.n_EquipID, () =>
|
||||
{
|
||||
sdata.Init_SlotLv(m_ESUTD.e_EquipParts, m_ESUTD.n_ConsumeGoodsID);
|
||||
Set_UI();
|
||||
NewGameUI.Ins.m_EquipmentUI.m_equipItems.Set();
|
||||
});
|
||||
else
|
||||
ToastUI.Ins.Set(999900021);
|
||||
}
|
||||
|
||||
public override void OnClick_Back()
|
||||
|
|
|
|||
Loading…
Reference in New Issue