초월 옵션 리스트 제작 및 받기

This commit is contained in:
Ino 2025-07-30 16:01:56 +09:00
parent 112c4a4e7d
commit f5d3e489ce
4 changed files with 53 additions and 11 deletions

View File

@ -1116,6 +1116,33 @@ handlers.Save_PC_BuyJob = function(args)
}
}
function Make_LimitBreakOption(urod)
{
urod.LimitBreakOption = {};
urod.LimitBreakOption.Preset = [0, 0, 0];
urod.LimitBreakOption.Option = {
"1": [],
"2": [],
"3": []
};
var limitslotmagicrateTable = Get_LimitSlotMagicRateTable();
var lv = urod.PC.LLv;
if (lv > 9) lv = 9;
var lsmc_data = limitslotmagicrateTable.find(f=>f.n_NeedLimitLv == lv);
var randombaTable = Get_RandomBagTable();
var enchantgradeTable = Get_EnchantGradeTable();
for (var i = 0; i < 3; ++i)
{
for (var j = 0; j < 500; ++j)
{
var grade = Get_RandomGachaGrade(lv);
var optionitemID = Get_RandomItem(lsmc_data.n_DropIndex, grade).itemid;
var olv = Get_OptionLv(grade);
urod.LimitBreakOption.Option[i + 1].push({ id : optionitemID, lv : olv });
}
}
}
handlers.Save_PC_LimitLvUp = function(args)
{
var readonlydata = Get_UserReadOnlyData();
@ -1143,9 +1170,10 @@ handlers.Save_PC_LimitLvUp = function(args)
++urod.PC.LLv;
var matamount = limitdata_next.n_MaxAbilityPoint - limitdata.n_MaxAbilityPoint;
Add_Item(Get_MissionTable(), Get_ItemTable(), urod, matdata.n_Value, matamount);
Make_LimitBreakOption(urod);
Set_JsonUserData(urod);
return Get_Return(0);
return Get_Return(0, { option : urod.LimitBreakOption });
}
else
return Get_Return(2); // PC 레벨 부족
@ -1176,8 +1204,6 @@ handlers.Save_PC_LimitSlotOptionChange = function(args)
}
}
log.info("OpenSlotCount : " + OpenSlots.length);
log.info("LockCount : " + LockCount);
if (OpenSlots.length == 0) return Get_Return(1);
var global = Get_GlobalValueTable();
@ -1186,7 +1212,6 @@ handlers.Save_PC_LimitSlotOptionChange = function(args)
var table = Get_MissionTable();
var price = 10 * ((1 + LockCount) * LockCount / 2 + 1);
log.info("price : " + price);
if (Use_Item(table, urod, matdata.n_Value, price))
{
var rtnAdd = []; // [{ slot, randombagid, optionlv }]
@ -1200,8 +1225,6 @@ handlers.Save_PC_LimitSlotOptionChange = function(args)
var lsmc_data = limitslotmagicrateTable.find(f=>f.n_NeedLimitLv == lv);
//log.info("초월 레벨 : " + urod.PC.LLv + ", " + lv);
//log.info(lsmc_data);
var randombaTable = Get_RandomBagTable();
var enchantgradeTable = Get_EnchantGradeTable();
var grade = Get_RandomGachaGrade(lv);
//log.info("등급 : " + grade);
// 랜덤백에서 아이템 id 얻기

View File

@ -96,7 +96,7 @@ public partial class ServerData
/// { 상품ID, 0 총 구매횟수, 1 이번 구매횟수, 2 광고 남은 시간 }
/// </summary>
public Dictionary<string, SD_Shop> Shop = new Dictionary<string, SD_Shop>();
public SD_LimitBreakOption LimitBreakOption;
public List<ServerData_Book> Book;
public List<ServerData_ChapterQuest> ChapterQuest;
@ -227,6 +227,7 @@ public partial class ServerData
temp.Gacha = DSUtil.Get_T_Dic(Gacha);
temp.Common = DSUtil.Get_T_List(Common);
foreach (var item in Shop) temp.Shop.Add(item.Key, item.Value.Get());
temp.LimitBreakOption = LimitBreakOption;
temp.Book = new List<ServerData_Book_Read>();
for (int i = 0; i < Book.Count; i++)
@ -272,6 +273,7 @@ public class ServerData_Read
public SD_Farm_Read Farm;
public Dictionary<string, Dictionary<string, List<int>>> Mission = new Dictionary<string, Dictionary<string, List<int>>>();
public Dictionary<string, SD_Shop_Read> Shop = new Dictionary<string, SD_Shop_Read>();
public SD_LimitBreakOption LimitBreakOption;
public List<ServerData_Book_Read> Book;
public List<ServerData_ChapterQuest_Read> ChapterQuest;
@ -328,6 +330,7 @@ public class ServerData_Read
temp.Gacha = DSUtil.Get_T_Dic(Gacha);
temp.Common = DSUtil.Get_T_List(Common);
foreach (var item in Shop) temp.Shop.Add(item.Key, item.Value.Get());
temp.LimitBreakOption = LimitBreakOption;
temp.Book = new List<ServerData_Book>();
for (int i = 0; i < Book.Count; i++)
@ -3072,6 +3075,16 @@ public class SD_Shop_Read
return new SD_Shop { Buy = Buy, Time = Time, Buy_Total = Buy_Total };
}
}
public class SD_LimitBreakOption
{
public List<int> Preset;
public Dictionary<int, List<SD_LimitBreakOptionDetail>> Option;
}
[Serializable]
public class SD_LimitBreakOptionDetail
{
public int id, lv;
}
#endregion
#region
@ -3157,6 +3170,10 @@ public class SC_FarmSlotHarvestResult
public int gem;
public List<ItemSimpleData> Items;
}
public class SC_LimitBreakLvUpResult
{
public SD_LimitBreakOption option;
}
#endregion
#region ->

View File

@ -1091,7 +1091,7 @@ public class ServerInfo : MyCoroutine
});
}
public void Save_PC_LimitLvUp(Action _act)
public void Save_PC_LimitLvUp(Action<SC_LimitBreakLvUpResult> _act)
{
NetWait.Ins.Set(true);
PlayFabClientAPI.ExecuteCloudScript(new ExecuteCloudScriptRequest
@ -1108,11 +1108,12 @@ public class ServerInfo : MyCoroutine
if (result.Error == null)
{
NetWait.Ins.Set(false);
var error = MyErrorCheck(result.FunctionResult.ToString());
var str_result = result.FunctionResult.ToString();
var error = MyErrorCheck(str_result);
// (0 성공, 1 실패(PC Lv 부족), 2 실패 (각성 Lv 부족), 3 실패 (각성 재료 id 없음), 4 실패 (더 이상 초월 불가))
switch (error)
{
case 0: _act?.Invoke(); break;
case 0: _act?.Invoke(JsonConvert.DeserializeObject<SC_LimitBreakLvUpResult>(str_result)); break;
case 1: ToastUI.Ins.Set(264); break;
case 2: ToastUI.Ins.Set(263); break;
case 3: ToastUI.Ins.Set(999900005); break;

View File

@ -59,8 +59,9 @@ public class PCLimit_Center : PCLimit_StatInfo
{
if (sdata.PC.Lv >= Get_NeedPCLv())
{
ServerInfo.Ins.Save_PC_LimitLvUp(() =>
ServerInfo.Ins.Save_PC_LimitLvUp(result =>
{
sdata.LimitBreakOption = result.option;
sdata.Add_LimitLv();
PCLimitUI.Ins.Set();
MyValue.Get_ActorStatInfoorNull(eRole.PC);