using GUPS.AntiCheat.Protected; using Newtonsoft.Json; using System; using System.Collections.Generic; public enum eInAppInitType { None, Week1, Week2, Week3, One1, One2, Disable_Buy1, Disable_Buy2 } public enum eShopBuyType { IAP, AD, Coin, Heart } [Serializable] public class shoptabledata { public string s_ID, s_Name, s_PeakEffective, s_Items, s_Icon; public eInAppInitType e_InAppInitType; public eShopBuyType e_BuyType; ProtectedInt32 _Price; public int n_Price { get { return _Price; } set { _Price = value; _Price.Obfuscate(); } } ProtectedInt32 _Limit; public int n_Limit { get { return _Limit; } set { _Limit = value; _Limit.Obfuscate(); } } ProtectedInt32 _RewardHeart; public int n_RewardHeart { get { return _RewardHeart; } set { _RewardHeart = value; _RewardHeart.Obfuscate(); } } ProtectedInt32 _RewardChatCoin; public int n_RewardChatCoin { get { return _RewardChatCoin; } set { _RewardChatCoin = value; _RewardChatCoin.Obfuscate(); } } ProtectedInt32 _RewardGacha; public int n_RewardGacha { get { return _RewardGacha; } set { _RewardGacha = value; _RewardGacha.Obfuscate(); } } ProtectedInt32 _BonusGameRefill; public int n_BonusGameRefill { get { return _BonusGameRefill; } set { _BonusGameRefill = value; _BonusGameRefill.Obfuscate(); } } ProtectedBool _AdRemove; public bool b_AdRemove { get { return _AdRemove; } set { _AdRemove = value; _AdRemove.Obfuscate(); } } ProtectedBool _InfinityMiniGame; public bool b_InfinityMiniGame { get { return _InfinityMiniGame; } set { _InfinityMiniGame = value; _InfinityMiniGame.Obfuscate(); } } ProtectedBool _LuckyGameCharge; public bool b_LuckyGameCharge { get { return _LuckyGameCharge; } set { _LuckyGameCharge = value; _LuckyGameCharge.Obfuscate(); } } public string Get_Amount() { if (n_RewardHeart > 0) return n_RewardHeart.ToString(); if (n_RewardChatCoin > 0) return n_RewardChatCoin.ToString(); if (n_RewardGacha > 0) return n_RewardGacha.ToString(); return ""; } public string Get_BuyItemMsg() { var msg = ""; if (n_RewardHeart > 0) { if (!string.IsNullOrEmpty(msg)) msg += "\n"; msg += $"¾Ù¹ü ¿ÀÇ ÀçÈ­ {n_RewardHeart}°³¸¦ ȹµæÇß½À´Ï´Ù."; } if (n_RewardChatCoin > 0) { if (!string.IsNullOrEmpty(msg)) msg += "\n"; msg += $"äÆÃ ÄÚÀÎ {n_RewardChatCoin}°³¸¦ ȹµæÇß½À´Ï´Ù."; } if (n_RewardGacha > 0) { if (!string.IsNullOrEmpty(msg)) msg += "\n"; msg += $"»Ì±â ÀçÈ­ {n_RewardGacha}°³¸¦ ȹµæÇß½À´Ï´Ù."; } if (b_AdRemove) { if (!string.IsNullOrEmpty(msg)) msg += "\n"; msg += $"±¤°í Á¦°Å±ÇÀ» ȹµæÇß½À´Ï´Ù."; } //if (m_Data.n_BonusGameRefill > 0) //{ // if (!string.IsNullOrEmpty(msg)) msg += "\n"; // msg += $"º¸³Ê½º °ÔÀÓ ¸®ÇÊ È½¼ö°¡ {m_Data.n_BonusGameRefill} Ãß°¡ µÇ¾ú½À´Ï´Ù."; //} if (b_InfinityMiniGame) { if (!string.IsNullOrEmpty(msg)) msg += "\n"; msg += $"¹Ì´Ï °ÔÀÓ ¹«Á¦ÇÑ ÀÔÀåÀ» ȹµæÇß½À´Ï´Ù.\n"; msg += $"¹Ì´Ï °ÔÀÓ Çǹö Áö¼Ó½Ã°£ÀÌ 2¹è Áõ°¡ Çß½À´Ï´Ù."; } if (b_LuckyGameCharge) { if (!string.IsNullOrEmpty(msg)) msg += "\n"; msg += $"»Ì±â ºñ¿ëÀÌ 50% °¨¼Ò Çß½À´Ï´Ù.\n"; msg += $"»Ì±â È®·üÀÌ ´ëÆø Áõ°¡ Çß½À´Ï´Ù."; } if (string.IsNullOrEmpty(msg)) msg = "º¸»óÀÌ ¾ø½À´Ï´Ù.\nº¸»óÀ» ¼³Á¤ÇØ ÁÖ¼¼¿ä!"; return msg; } } public class table_shop : table_base { public static table_shop Ins; List tableDatas; protected override void Awake() { Ins = this; base.Awake(); } protected override void Start() { tableDatas = JsonConvert.DeserializeObject>(json_last); base.Start(); } public List Get_DataList() { return tableDatas; } public shoptabledata Get_Data(string id) { return Get_DataList().Find(f => f.s_ID.Equals(id)); } }