diff --git a/Assets/ResWork/Table/Export/GachaConfig.json b/Assets/ResWork/Table/Export/GachaConfig.json index 694e3e5c6..f68e338a9 100644 --- a/Assets/ResWork/Table/Export/GachaConfig.json +++ b/Assets/ResWork/Table/Export/GachaConfig.json @@ -1 +1 @@ -[{"n_ID": "10001", "n_Title": "290", "s_Banner": "", "n_GachaPrice": "500", "n_GachaGoodsID": "1", "n_GachaTicketID": "401", "n_NormalRandombag": "30001", "n_Extra10_Randombag": "40001", "n_PickupReward": "20001"}, {"n_ID": "10002", "n_Title": "292", "s_Banner": "", "n_GachaPrice": "500", "n_GachaGoodsID": "1", "n_GachaTicketID": "402", "n_NormalRandombag": "30002", "n_Extra10_Randombag": "40002", "n_PickupReward": "20002"}, {"n_ID": "10003", "n_Title": "293", "s_Banner": "", "n_GachaPrice": "500", "n_GachaGoodsID": "1", "n_GachaTicketID": "403", "n_NormalRandombag": "30003", "n_Extra10_Randombag": "40003", "n_PickupReward": "20003"}, {"n_ID": "10004", "n_Title": "209", "s_Banner": "", "n_GachaPrice": "1000", "n_GachaGoodsID": "1", "n_GachaTicketID": "404", "n_NormalRandombag": "30004", "n_Extra10_Randombag": "40004", "n_PickupReward": "20004"}] \ No newline at end of file +[{"n_ID": "10001", "n_Title": "290", "s_Banner": "", "b_StageLv": "True", "n_GachaPrice": "500", "n_GachaGoodsID": "1", "n_GachaTicketID": "401", "n_NormalRandombag": "30001", "n_Extra10_Randombag": "40001", "n_PickupReward": "20001"}, {"n_ID": "10002", "n_Title": "292", "s_Banner": "", "b_StageLv": "True", "n_GachaPrice": "500", "n_GachaGoodsID": "1", "n_GachaTicketID": "402", "n_NormalRandombag": "30002", "n_Extra10_Randombag": "40002", "n_PickupReward": "20002"}, {"n_ID": "10003", "n_Title": "293", "s_Banner": "", "b_StageLv": "True", "n_GachaPrice": "500", "n_GachaGoodsID": "1", "n_GachaTicketID": "403", "n_NormalRandombag": "30003", "n_Extra10_Randombag": "40003", "n_PickupReward": "20003"}, {"n_ID": "10004", "n_Title": "209", "s_Banner": "", "b_StageLv": "False", "n_GachaPrice": "1000", "n_GachaGoodsID": "1", "n_GachaTicketID": "404", "n_NormalRandombag": "30004", "n_Extra10_Randombag": "40004", "n_PickupReward": "20004"}] \ No newline at end of file diff --git a/Assets/ResWork/Table/butler.xlsm b/Assets/ResWork/Table/butler.xlsm index b5c03c35a..469eeea28 100644 Binary files a/Assets/ResWork/Table/butler.xlsm and b/Assets/ResWork/Table/butler.xlsm differ diff --git a/Assets/Res_Addr/MainUI/NewGameUI.prefab b/Assets/Res_Addr/MainUI/NewGameUI.prefab index a54ad893d..440feebb5 100644 --- a/Assets/Res_Addr/MainUI/NewGameUI.prefab +++ b/Assets/Res_Addr/MainUI/NewGameUI.prefab @@ -136054,7 +136054,12 @@ PrefabInstance: type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target value: - objectReference: {fileID: 2484072702756935871} + objectReference: {fileID: 6559969037301942703} + - target: {fileID: 4356751522020398622, guid: cd989398c2e3d0a42b902fe9ec96fef5, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName + value: OnClick_Gacha + objectReference: {fileID: 0} - target: {fileID: 4592019639505408195, guid: cd989398c2e3d0a42b902fe9ec96fef5, type: 3} propertyPath: m_Pivot.x @@ -136376,7 +136381,12 @@ PrefabInstance: type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target value: - objectReference: {fileID: 2484072702756935871} + objectReference: {fileID: 6398787019567080357} + - target: {fileID: 4356751522020398622, guid: cd989398c2e3d0a42b902fe9ec96fef5, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName + value: OnClick_Gacha + objectReference: {fileID: 0} - target: {fileID: 4592019639505408195, guid: cd989398c2e3d0a42b902fe9ec96fef5, type: 3} propertyPath: m_Pivot.x diff --git a/Assets/Script/Server/ServerClass.cs b/Assets/Script/Server/ServerClass.cs index a99573744..31b6a6cf6 100644 --- a/Assets/Script/Server/ServerClass.cs +++ b/Assets/Script/Server/ServerClass.cs @@ -424,6 +424,17 @@ public partial class ServerData return MapData[key1][key2].isClear(); return false; } + public int MapData_Get_MaxChapter() + { + int maxchapter = 1; + var lst = table_battlemapconfig.Ins.Get_DataList(true); + for (int i = 1; i < lst.Count; i++) + { + if (MapData_isClearChaper(lst[i].n_MapID, 1)) + maxchapter = lst[i].n_MapID; + } + return maxchapter; + } public void MapData_SetClearChapter(int mapid, int diff) { Check_MapData(mapid, diff); diff --git a/Assets/Script/Table/Gacha/table_gachaconfig.cs b/Assets/Script/Table/Gacha/table_gachaconfig.cs index 79335c458..f71ba219b 100644 --- a/Assets/Script/Table/Gacha/table_gachaconfig.cs +++ b/Assets/Script/Table/Gacha/table_gachaconfig.cs @@ -15,6 +15,7 @@ public class GachaConfigTableData : TableDataBase public int n_Title; public string s_Banner; + public bool b_StageLv; protected ObscuredInt _GachaPrice; public int n_GachaPrice diff --git a/Assets/Script/Table/Gacha/table_gacharate.cs b/Assets/Script/Table/Gacha/table_gacharate.cs index 154a81e08..05b88447d 100644 --- a/Assets/Script/Table/Gacha/table_gacharate.cs +++ b/Assets/Script/Table/Gacha/table_gacharate.cs @@ -84,6 +84,7 @@ public class GachaRateTableData : TableDataBase } public List list_rate = new List(); + public int Get_RandomGrade() { return DSUtil.Get_RandomIndex(list_rate) + 1; } } public class table_gacharate : table_missionbase @@ -91,6 +92,8 @@ public class table_gacharate : table_missionbase public static table_gacharate Ins; List tableDatas; Dictionary> dic_data = new Dictionary>(); + // (temp.n_ID, n_GachaLevel) + Dictionary<(int, int), GachaRateTableData> dic_datas = new Dictionary<(int, int), GachaRateTableData>(); protected override void Awake() { @@ -117,6 +120,8 @@ public class table_gacharate : table_missionbase if (!dic_data.ContainsKey(temp.n_ID)) dic_data.Add(temp.n_ID, new List()); dic_data[temp.n_ID].Add(temp); + + dic_datas.Add((temp.n_ID, temp.n_GachaLevel), temp); } base.Start(); @@ -124,4 +129,5 @@ public class table_gacharate : table_missionbase public List Get_DataList() { return tableDatas; } public List Get_DataList(int id) { return dic_data[id]; } + public GachaRateTableData Get_Data(int id, int lv) { return dic_datas[(id, lv)]; } } \ No newline at end of file diff --git a/Assets/Script/UI/Gacha/btn_gacha.cs b/Assets/Script/UI/Gacha/btn_gacha.cs index f57ad6fe4..28fa79216 100644 --- a/Assets/Script/UI/Gacha/btn_gacha.cs +++ b/Assets/Script/UI/Gacha/btn_gacha.cs @@ -65,14 +65,34 @@ public class btn_gacha : MonoBehaviour public void OnClick_Gacha() { + var sdata = ServerInfo.Ins.m_ServerData; switch (Get_BtnType(true)) { case eGachaBtnType.OnlyTicket: + sdata.Use_Item(m_Data.n_GachaTicketID, m_Count); + Gacha_Process(); break; case eGachaBtnType.TicketAndCash: + var ticketamount = sdata.Get_ItemAmount(m_Data.n_GachaTicketID); + sdata.Use_Item(m_Data.n_GachaGoodsID, (m_Count - ticketamount) * m_Data.n_GachaPrice); + sdata.Use_Item(m_Data.n_GachaTicketID, ticketamount); + Gacha_Process(); break; case eGachaBtnType.OnlyCash: + sdata.Use_Item(m_Data.n_GachaGoodsID, m_Count * m_Data.n_GachaPrice); + Gacha_Process(); break; } } + + void Gacha_Process() + { + var sdata = ServerInfo.Ins.m_ServerData; + var rateData = table_gacharate.Ins.Get_Data(m_Data.n_ID, m_Data.b_StageLv ? sdata.MapData_Get_MaxChapter() : 1); + for (int i = 0; i < m_Count; i++) + { + var grade = rateData.Get_RandomGrade(); + Debug.Log(grade); + } + } } \ No newline at end of file