7692 【2.0.200】【开发】VIP功能新BOSS之家购买次数
| | |
| | | break;
|
| | | case 1:
|
| | | bossHomeModel.wearyValue = (int)info.KillCnt;
|
| | | bossHomeModel.boughtTimes = (int)info.BuyCnt;
|
| | | break;
|
| | | case 2:
|
| | | crossServerBossModel.wearyValue = (int)info.KillCnt;
|
| | |
| | | using UnityEngine;
|
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | //A3 B7 当日累计攻击boss次数 #tagMCBOSSAttactCnt
|
| | |
|
| | | public class HA3B7_tagMCBOSSAttactCnt : GameNetPackBasic
|
| | | {
|
| | | public byte Cnt;
|
| | | public tagMCBossCntInfo[] KillCntInfoList = null;
|
| | |
|
| | | public HA3B7_tagMCBOSSAttactCnt()
|
| | | {
|
| | | _cmd = (ushort)0xA3B7;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes(byte[] vBytes)
|
| | | {
|
| | | TransBytes(out Cnt, vBytes, NetDataType.BYTE);
|
| | | KillCntInfoList = new tagMCBossCntInfo[Cnt];
|
| | | for (int i = 0; i < Cnt; i++)
|
| | | {
|
| | | KillCntInfoList[i] = new tagMCBossCntInfo();
|
| | | TransBytes(out KillCntInfoList[i].BossType, vBytes, NetDataType.BYTE);
|
| | | TransBytes(out KillCntInfoList[i].KillCnt, vBytes, NetDataType.DWORD);
|
| | | TransBytes(out KillCntInfoList[i].ItemAddCnt, vBytes, NetDataType.DWORD);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagMCBossCntInfo
|
| | | {
|
| | | public byte BossType; //编号类型0-世界boss 1-boss之家
|
| | | public uint KillCnt; //击杀次数
|
| | | public uint ItemAddCnt; //物品增加次数
|
| | | }
|
| | |
|
| | | } |
| | | //A3 B7 当日累计攻击boss次数 #tagMCBOSSAttactCnt
|
| | |
|
| | | public class HA3B7_tagMCBOSSAttactCnt : GameNetPackBasic {
|
| | | public byte Cnt;
|
| | | public tagMCBossCntInfo[] KillCntInfoList = null;
|
| | |
|
| | | public HA3B7_tagMCBOSSAttactCnt () {
|
| | | _cmd = (ushort)0xA3B7;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Cnt, vBytes, NetDataType.BYTE);
|
| | | KillCntInfoList = new tagMCBossCntInfo[Cnt];
|
| | | for (int i = 0; i < Cnt; i ++) {
|
| | | KillCntInfoList[i] = new tagMCBossCntInfo();
|
| | | TransBytes (out KillCntInfoList[i].BossType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out KillCntInfoList[i].KillCnt, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out KillCntInfoList[i].ItemAddCnt, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out KillCntInfoList[i].BuyCnt, vBytes, NetDataType.BYTE);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagMCBossCntInfo {
|
| | | public byte BossType; //编号类型0-世界boss 1-boss之家
|
| | | public uint KillCnt; //击杀次数
|
| | | public uint ItemAddCnt; //物品增加次数
|
| | | public byte BuyCnt; //购买次数
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | Utils.BeginObjectRegister(typeof(VipPrivilegeType), L, translator, 0, 0, 0, 0); |
| | | Utils.EndObjectRegister(typeof(VipPrivilegeType), L, translator, null, null, null, null, null); |
| | | |
| | | Utils.BeginClassRegister(typeof(VipPrivilegeType), L, null, 35, 0, 0); |
| | | Utils.BeginClassRegister(typeof(VipPrivilegeType), L, null, 36, 0, 0); |
| | | |
| | | Utils.RegisterObject(L, translator, Utils.CLS_IDX, "TreasureAtk", VipPrivilegeType.TreasureAtk); |
| | | |
| | |
| | | Utils.RegisterObject(L, translator, Utils.CLS_IDX, "JadeDynastyBoss", VipPrivilegeType.JadeDynastyBoss); |
| | | |
| | | Utils.RegisterObject(L, translator, Utils.CLS_IDX, "BatchAlchemyFairy", VipPrivilegeType.BatchAlchemyFairy); |
| | | |
| | | Utils.RegisterObject(L, translator, Utils.CLS_IDX, "BossHomeBuyTimes", VipPrivilegeType.BossHomeBuyTimes); |
| | | |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "__CastFrom", __CastFrom); |
| | | |
| | |
| | | { |
| | | translator.PushVipPrivilegeType(L, VipPrivilegeType.BatchAlchemyFairy); |
| | | } |
| | | else if (LuaAPI.xlua_is_eq_str(L, 1, "BossHomeBuyTimes")) |
| | | { |
| | | translator.PushVipPrivilegeType(L, VipPrivilegeType.BossHomeBuyTimes); |
| | | } |
| | | else |
| | | { |
| | | return LuaAPI.luaL_error(L, "invalid string for VipPrivilegeType!"); |
| | |
| | | { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | System.Type type = typeof(Snxxz.UI.BossHomeModel); |
| | | Utils.BeginObjectRegister(type, L, translator, 0, 10, 4, 4); |
| | | Utils.BeginObjectRegister(type, L, translator, 0, 10, 5, 5); |
| | | |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "Init", _m_Init); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "UnInit", _m_UnInit); |
| | |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "selectedFloor", _g_get_selectedFloor); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "selectedBoss", _g_get_selectedBoss); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "wearyValue", _g_get_wearyValue); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "boughtTimes", _g_get_boughtTimes); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "bossHomeRedpoint", _g_get_bossHomeRedpoint); |
| | | |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "selectedFloor", _s_set_selectedFloor); |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "selectedBoss", _s_set_selectedBoss); |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "wearyValue", _s_set_wearyValue); |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "boughtTimes", _s_set_boughtTimes); |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "bossHomeRedpoint", _s_set_bossHomeRedpoint); |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_boughtTimes(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | Snxxz.UI.BossHomeModel gen_to_be_invoked = (Snxxz.UI.BossHomeModel)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.boughtTimes); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_bossHomeRedpoint(RealStatePtr L) |
| | | { |
| | | try { |
| | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _s_set_boughtTimes(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | Snxxz.UI.BossHomeModel gen_to_be_invoked = (Snxxz.UI.BossHomeModel)translator.FastGetCSObj(L, 1); |
| | | gen_to_be_invoked.boughtTimes = LuaAPI.xlua_tointeger(L, 2); |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _s_set_bossHomeRedpoint(RealStatePtr L) |
| | | { |
| | | try { |
| | |
| | | { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | System.Type type = typeof(Snxxz.UI.HazyRegionModel); |
| | | Utils.BeginObjectRegister(type, L, translator, 0, 23, 18, 3); |
| | | Utils.BeginObjectRegister(type, L, translator, 0, 23, 19, 3); |
| | | |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "Init", _m_Init); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnBeforePlayerDataInitialize", _m_OnBeforePlayerDataInitialize); |
| | |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "requireIncidentAnimation", _g_get_requireIncidentAnimation); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "incidentDirty", _g_get_incidentDirty); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "openActviePoint", _g_get_openActviePoint); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "autoOpenLimitLevel", _g_get_autoOpenLimitLevel); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "selectIncident", _g_get_selectIncident); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "InFakeHazyRegion", _g_get_InFakeHazyRegion); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "incidentTypesSort", _g_get_incidentTypesSort); |
| | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_autoOpenLimitLevel(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | Snxxz.UI.HazyRegionModel gen_to_be_invoked = (Snxxz.UI.HazyRegionModel)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.autoOpenLimitLevel); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_selectIncident(RealStatePtr L) |
| | | { |
| | | try { |
| | |
| | | table.SetMetaTable(meta); |
| | | meta.Dispose(); |
| | | |
| | | table.Set("this", this); |
| | | table.Set("transform", this.transform); |
| | | LuaUtility.DoString(fileName, "LuaBehaviour", table); |
| | | |
| | | var luaAwake = table.Get<Action>("Awake"); |
| | |
| | | }
|
| | | }
|
| | |
|
| | | int m_BoughtTimes = 0;
|
| | | public int boughtTimes {
|
| | | get { return m_BoughtTimes; }
|
| | | set {
|
| | | m_BoughtTimes = value;
|
| | | }
|
| | | }
|
| | |
|
| | | public int remindTimes {
|
| | | get {
|
| | | var wearyValueLimit = vipModel.GetVipPrivilegeCnt(VipPrivilegeType.BossHomeAwardLimit);
|
| | | return wearyValueLimit + boughtTimes - wearyValue;
|
| | | }
|
| | | }
|
| | |
|
| | | public event Action<int> bossHomeFloorSelectedEvent;
|
| | | public event Action<int> bossSelectedEvent;
|
| | | public event Action bossWearyValueChangeEvent;
|
| | |
| | | {
|
| | | var bossId = sortedBosses[i];
|
| | | var bossHomeConfig = BossHomeConfig.Get(bossId);
|
| | | if (findPreciousModel.IsBossUnlock(bossId) |
| | | if (findPreciousModel.IsBossUnlock(bossId)
|
| | | && vipLevel >= GetFloorVipRequirement(bossHomeConfig.FloorNum))
|
| | | {
|
| | | return bossHomeConfig.FloorNum;
|
| | |
| | | m_WearyContainer.gameObject.SetActive(wearyValueLimit > 0);
|
| | | if (wearyValueLimit > 0)
|
| | | {
|
| | | m_WearyValue.text = Language.Get("WorldBoss_Endurance0", wearyValueLimit - model.wearyValue);
|
| | | m_WearyValue.colorType = model.wearyValue >= wearyValueLimit ? TextColType.Red : TextColType.DarkGreen;
|
| | | var countInfo = string.Format("{0}/{1}", model.remindTimes, wearyValueLimit);
|
| | | m_WearyValue.text = countInfo;
|
| | | m_WearyValue.colorType = model.remindTimes <= 0 ? TextColType.Red : TextColType.DarkGreen;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | show = !GeneralDefine.worldBossNoRebornRemindMaps.Contains(mapId);
|
| | | break;
|
| | | case FindPreciousType.BossHome:
|
| | | killable = bossHomeModel.wearyValue < vipModel.GetVipPrivilegeCnt(VipPrivilegeType.BossHomeAwardLimit);
|
| | | killable = bossHomeModel.remindTimes > 0;
|
| | | show = !GeneralDefine.bossHomeNoRebornRemindMaps.Contains(mapId);
|
| | | break;
|
| | | case FindPreciousType.ElderGodArea:
|
| | |
| | | AssistXianYuanCoinsRatioAdd = 34,//助战仙缘币获得倍率加成(万分比)
|
| | | JadeDynastyBoss = 35,
|
| | | BatchAlchemyFairy = 36,//批量炼制仙丹
|
| | | BossHomeBuyTimes=37,//boss之家购买次数
|
| | | }
|
| | |
|
| | | [XLua.LuaCallCSharp]
|