뽑기 혜택 1,2

This commit is contained in:
Ino 2025-04-18 08:07:57 +09:00
parent 423b1ded2c
commit d7f3095098
8 changed files with 127 additions and 13 deletions

View File

@ -1 +1 @@
[{"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": "30001", "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"}]
[{"n_ID": "10001", "n_Title": "290", "s_Banner": "", "b_StageLv": "True", "n_GachaPrice": "50", "n_GachaGoodsID": "1", "n_GachaTicketID": "401", "n_NormalRandombag": "30001", "n_Extra10_Randombag": "30001", "n_PickupReward": "20001"}, {"n_ID": "10002", "n_Title": "292", "s_Banner": "", "b_StageLv": "True", "n_GachaPrice": "40", "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": "30", "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": "100", "n_GachaGoodsID": "1", "n_GachaTicketID": "404", "n_NormalRandombag": "30004", "n_Extra10_Randombag": "40004", "n_PickupReward": "20004"}]

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -109,7 +109,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 48.4, y: -38.5}
m_AnchoredPosition: {x: 48.4, y: 10.4}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1555187843071484848

View File

@ -27234,6 +27234,7 @@ MonoBehaviour:
gacha_btns:
- {fileID: 6559969037301942703}
- {fileID: 6398787019567080357}
m_slider: {fileID: 2497281915973896408}
--- !u!222 &1084326001364914347
CanvasRenderer:
m_ObjectHideFlags: 0
@ -34996,7 +34997,7 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_ConstrainProportionsScale: 1
m_Children: []
m_Father: {fileID: 3443366116189850104}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -35039,8 +35040,8 @@ MonoBehaviour:
m_ChildAlignment: 0
m_StartCorner: 0
m_StartAxis: 0
m_CellSize: {x: 100, y: 100}
m_Spacing: {x: 12.5, y: 5}
m_CellSize: {x: 150, y: 150}
m_Spacing: {x: 0, y: 20}
m_Constraint: 0
m_ConstraintCount: 2
--- !u!1 &2561650608828090019
@ -99155,8 +99156,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: -34.74}
m_SizeDelta: {x: 1000, y: 461.76}
m_AnchoredPosition: {x: 3.31, y: -65}
m_SizeDelta: {x: 1622.3, y: 780.48}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &868602471563350867
CanvasRenderer:

View File

@ -83,6 +83,10 @@ public partial class ServerData
/// { 미션그룹, { 미션 Index, 0 미션 레벨, 1 미션 카운트 } }
/// </summary>
public Dictionary<string, Dictionary<string, List<ObscuredInt>>> Mission = new Dictionary<string, Dictionary<string, List<ObscuredInt>>>();
/// <summary>
/// { 뽑기ID, 0 뽑기 횟수, 1 총 뽑기 횟수 }
/// </summary>
public Dictionary<string, List<ObscuredInt>> Gacha = new Dictionary<string, List<ObscuredInt>>();
public List<ServerData_Book> Book;
@ -257,6 +261,7 @@ public partial class ServerData
temp.Farm = Farm.Get();
temp.Dungeon = DSUtil.Get_T_Dic(Dungeon);
temp.Mission = DSUtil.Get_T_Dic(Mission);
temp.Gacha = DSUtil.Get_T_Dic(Gacha);
temp.Common = DSUtil.Get_T_List(Common);
@ -299,7 +304,7 @@ public class ServerData_Read
public SD_PC_Read PC;
public Dictionary<string, SD_PCAwakenData_Read> Awaken;
public Dictionary<string, List<SD_PCLimitSlotData_Read>> LimitSlot;
public Dictionary<string, List<int>> Pet, Relic, Dungeon;
public Dictionary<string, List<int>> Pet, Relic, Dungeon, Gacha;
public Dictionary<string, int> Collection;
public Dictionary<string, double> MobKill;
public SD_Farm_Read Farm;
@ -356,6 +361,7 @@ public class ServerData_Read
temp.Farm = Farm.Get();
temp.Dungeon = DSUtil.Get_T_Dic(Dungeon);
temp.Mission = DSUtil.Get_T_Dic(Mission);
temp.Gacha = DSUtil.Get_T_Dic(Gacha);
temp.Common = DSUtil.Get_T_List(Common);
@ -1180,6 +1186,39 @@ public partial class ServerData
Get_MissionReward(table_missionlist.Ins.Get_CompleteData(group));
}
#endregion
#region ()
public int Get_GachaPoint(int id)
{
var key = Get_Key(id);
if (Gacha.ContainsKey(key))
return Gacha[key][0];
return 0;
}
public int Get_GachaCount(int id)
{
var key = Get_Key(id);
if (Gacha.ContainsKey(key))
return Gacha[key][1];
return 0;
}
public void Add_Gacha(int id, int count = 1)
{
var key = Get_Key(id);
if (!Gacha.ContainsKey(key))
Gacha.Add(key, new List<ObscuredInt> { 0, 0 });
Gacha[key][0] += count; Gacha[key][0].RandomizeCryptoKey();
Gacha[key][1] += count; Gacha[key][1].RandomizeCryptoKey();
}
public void Use_GachaPoint(int id, int point)
{
var key = Get_Key(id);
if (Gacha.ContainsKey(key))
{
Gacha[key][0] -= point;
Gacha[key][0].RandomizeCryptoKey();
}
}
#endregion
#region Common
public void Init_Daily()

View File

@ -1,19 +1,25 @@
using CodeStage.AntiCheat.ObscuredTypes;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class GachaBase : MonoBehaviour
{
public static ObscuredInt SelectCount = 100;
public static ObscuredInt benefit1Count = 10;
public static ObscuredInt benefit2Count = 50;
public static ObscuredInt benefit1Grade = 4;
public static ObscuredInt benefit2Grade = 5;
public TextMeshProUGUI[] texts; // 0 진행율, 1 혜택1, 2 혜택2
public btn_gacha[] gacha_btns; // 0 10회, 1 1회
public Slider m_slider;
GachaConfigTableData m_Data;
public virtual void Set(int gacha)
{
gameObject.SetActive(true);
texts[1].text = DSUtil.Format(380, 0, MyText.Get_GradeName(4));
texts[2].text = DSUtil.Format(380, 0, MyText.Get_GradeName(5));
m_Data = table_gachaconfig.Ins.Get_Data_orNull(gacha);
Set_UI();
}
@ -22,5 +28,13 @@ public class GachaBase : MonoBehaviour
{
gacha_btns[0].Set(10, m_Data);
gacha_btns[1].Set(1, m_Data);
var sdata = ServerInfo.Ins.m_ServerData;
texts[0].text = DSUtil.Format("{0}/{1}", sdata.Get_GachaPoint(m_Data.n_ID), SelectCount);
m_slider.value = sdata.Get_GachaPoint(m_Data.n_ID) / (float)SelectCount;
texts[1].text = DSUtil.Format(380, benefit1Count - sdata.Get_GachaCount(m_Data.n_ID) % benefit1Count,
MyText.Get_GradeName(benefit1Grade));
texts[2].text = DSUtil.Format(380, benefit2Count - sdata.Get_GachaCount(m_Data.n_ID) % benefit2Count,
MyText.Get_GradeName(benefit2Grade));
}
}

View File

@ -24,6 +24,8 @@ public class btn_gacha : MonoBehaviour
m_Data = gachaConfigTableData;
var sdata = ServerInfo.Ins.m_ServerData;
texts[0].text = DSUtil.Format(382, m_Count);
switch (Get_BtnType(false))
{
case eGachaBtnType.OnlyTicket:
@ -91,14 +93,72 @@ public class btn_gacha : MonoBehaviour
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);
List<ItemSimpleData> items = new List<ItemSimpleData>();
List<int> grades = new List<int>();
var benefit1 = false;
var benefit2 = false;
for (int i = 0; i < m_Count; i++)
{
var grade = rateData.Get_RandomGrade();
grades.Add(grade);
var item = table_gacharandombag.Ins.Get_RandomItemData(m_Data.dic_randomgbag[m_Count], grade);
items.Add(item);
sdata.Add_Item(item.itemid, item.amount);
sdata.Add_Gacha(m_Data.n_ID, 1);
var gachaCount = sdata.Get_GachaCount(m_Data.n_ID);
if (!benefit1 && gachaCount >= GachaBase.benefit1Count && gachaCount % GachaBase.benefit1Count == 0) benefit1 = true;
if (!benefit2 && gachaCount >= GachaBase.benefit2Count && gachaCount % GachaBase.benefit2Count == 0) benefit2 = true;
}
// gachacount 가 10일 때마다 4등급 아이템 하나가 포함되어야 함
if (benefit1)
{
bool existgrade1 = false;
for (int i = 0; i < grades.Count; i++)
{
if (!existgrade1 && grades[i] == GachaBase.benefit1Grade)
existgrade1 = true;
}
if (!existgrade1)
{
for (int i = grades.Count - 1; i > 0 ; i--)
{
if (grades[i] < GachaBase.benefit1Grade)
{
items[i] = table_gacharandombag.Ins.Get_RandomItemData(m_Data.dic_randomgbag[m_Count], GachaBase.benefit1Grade);
break;
}
}
}
}
// gachacount 가 50일 때마다 5등급 아이템 하나가 포함되어야 함
if (benefit2)
{
bool existgrade2 = false;
for (int i = 0; i < grades.Count; i++)
{
if (!existgrade2 && grades[i] == GachaBase.benefit2Grade)
existgrade2 = true;
}
if (!existgrade2)
{
for (int i = grades.Count - 1; i >= 0; i--)
{
if (grades[i] < GachaBase.benefit2Grade)
{
items[i] = table_gacharandombag.Ins.Get_RandomItemData(m_Data.dic_randomgbag[m_Count], GachaBase.benefit2Grade);
break;
}
}
}
}
for (int i = 0; i < items.Count; i++)
sdata.Add_Item(items[i].itemid, items[i].amount);
ObtainItemUI.Ins.Set(items);
NewGameUI.Ins.m_GachaUI.Set_Money();
NewGameUI.Ins.m_GachaUI.m_gachaBase.Set_UI();