Core/GameEngine/Model/Config/VipPrivilegeConfig.cs
@@ -1,6 +1,6 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Saturday, January 06, 2018 // [ Date ]: Thursday, September 27, 2018 //-------------------------------------------------------- using UnityEngine; @@ -11,22 +11,22 @@ public partial class VipPrivilegeConfig : ConfigBase { public int VIPPrivilege { get ; private set ; } public int VIP0 { get ; private set ; } public int VIP1 { get ; private set ; } public int VIP2 { get ; private set ; } public int VIP3 { get ; private set ; } public int VIP4 { get ; private set ; } public int VIP5 { get ; private set ; } public int VIP6 { get ; private set ; } public int VIP7 { get ; private set ; } public int VIP8 { get ; private set ; } public int VIP9 { get ; private set ; } public int VIP10 { get ; private set ; } public int VIP11 { get ; private set ; } public int VIP12 { get ; private set ; } public int VIP13 { get ; private set ; } public int VIP14 { get ; private set ; } public int VIPPrivilege { get ; private set ; } public int VIP0 { get ; private set ; } public int VIP1 { get ; private set ; } public int VIP2 { get ; private set ; } public int VIP3 { get ; private set ; } public int VIP4 { get ; private set ; } public int VIP5 { get ; private set ; } public int VIP6 { get ; private set ; } public int VIP7 { get ; private set ; } public int VIP8 { get ; private set ; } public int VIP9 { get ; private set ; } public int VIP10 { get ; private set ; } public int VIP11 { get ; private set ; } public int VIP12 { get ; private set ; } public int VIP13 { get ; private set ; } public int VIP14 { get ; private set ; } public int VIP15 { get ; private set ; } public override string getKey() @@ -37,38 +37,38 @@ public override void Parse() { try { VIPPrivilege=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; VIP0=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; VIP1=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; VIP2=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; VIP3=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; VIP4=IsNumeric(rawContents[5]) ? int.Parse(rawContents[5]):0; VIP5=IsNumeric(rawContents[6]) ? int.Parse(rawContents[6]):0; VIP6=IsNumeric(rawContents[7]) ? int.Parse(rawContents[7]):0; VIP7=IsNumeric(rawContents[8]) ? int.Parse(rawContents[8]):0; VIP8=IsNumeric(rawContents[9]) ? int.Parse(rawContents[9]):0; VIP9=IsNumeric(rawContents[10]) ? int.Parse(rawContents[10]):0; VIP10=IsNumeric(rawContents[11]) ? int.Parse(rawContents[11]):0; VIP11=IsNumeric(rawContents[12]) ? int.Parse(rawContents[12]):0; VIP12=IsNumeric(rawContents[13]) ? int.Parse(rawContents[13]):0; VIP13=IsNumeric(rawContents[14]) ? int.Parse(rawContents[14]):0; VIP14=IsNumeric(rawContents[15]) ? int.Parse(rawContents[15]):0; VIPPrivilege=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; VIP0=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; VIP1=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; VIP2=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; VIP3=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; VIP4=IsNumeric(rawContents[5]) ? int.Parse(rawContents[5]):0; VIP5=IsNumeric(rawContents[6]) ? int.Parse(rawContents[6]):0; VIP6=IsNumeric(rawContents[7]) ? int.Parse(rawContents[7]):0; VIP7=IsNumeric(rawContents[8]) ? int.Parse(rawContents[8]):0; VIP8=IsNumeric(rawContents[9]) ? int.Parse(rawContents[9]):0; VIP9=IsNumeric(rawContents[10]) ? int.Parse(rawContents[10]):0; VIP10=IsNumeric(rawContents[11]) ? int.Parse(rawContents[11]):0; VIP11=IsNumeric(rawContents[12]) ? int.Parse(rawContents[12]):0; VIP12=IsNumeric(rawContents[13]) ? int.Parse(rawContents[13]):0; VIP13=IsNumeric(rawContents[14]) ? int.Parse(rawContents[14]):0; VIP14=IsNumeric(rawContents[15]) ? int.Parse(rawContents[15]):0; VIP15=IsNumeric(rawContents[16]) ? int.Parse(rawContents[16]):0; } catch (Exception ex) Core/GameEngine/Model/Config/VipPrivilegeConfig.cs.meta
@@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: fe03774548a971a4186f518d32a9833c timeCreated: 1515213454 licenseType: Pro timeCreated: 1538035356 licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] Core/GameEngine/Model/TelPartialConfig/BossInfoConfig.cs
@@ -13,12 +13,18 @@ public partial class BossInfoConfig : ConfigBase, IConfigPostProcess { private static Dictionary<int, BossInfoConfig> bossInfoDict = new Dictionary<int, BossInfoConfig>(); private static List<int> stoneIds = new List<int>(); public void OnConfigParseCompleted() { if (!bossInfoDict.ContainsKey(StoneNPCID)) { bossInfoDict.Add(StoneNPCID, this); } if (!stoneIds.Contains(StoneNPCID)) { stoneIds.Add(StoneNPCID); } } @@ -31,6 +37,11 @@ return null; } public static bool IsStone(int npcId) { return stoneIds.Contains(npcId); } } } Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA517_tagCMStartBindJadeWheel.cs
New file @@ -0,0 +1,16 @@ using UnityEngine; using System.Collections; // A5 17 绑玉转盘开始 #tagCMStartBindJadeWheel public class CA517_tagCMStartBindJadeWheel : GameNetPackBasic { public CA517_tagCMStartBindJadeWheel () { combineCmd = (ushort)0x03FE; _cmd = (ushort)0xA517; } public override void WriteToBytes () { } } Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA517_tagCMStartBindJadeWheel.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 7c268dd5f343f6c49b4c2621de591e6f timeCreated: 1538032691 licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA324_tagMCBindJadeWheelResult.cs
New file @@ -0,0 +1,19 @@ using UnityEngine; using System.Collections; using Snxxz.UI; // A3 24 通知绑玉转盘结果 #tagMCBindJadeWheelResult public class DTCA324_tagMCBindJadeWheelResult : DtcBasic { WheelOfFortuneModel wheelOfFortuneModel { get { return ModelCenter.Instance.GetModel<WheelOfFortuneModel>(); } } public override void Done(GameNetPackBasic vNetPack) { base.Done(vNetPack); HA324_tagMCBindJadeWheelResult vNetData = vNetPack as HA324_tagMCBindJadeWheelResult; if (vNetData == null) { return; } wheelOfFortuneModel.BindJadeWheelResult(vNetData); } } Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA324_tagMCBindJadeWheelResult.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: a0cbd69e7afc2474c8fd98b86348e72f timeCreated: 1538032691 licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Core/NetworkPackage/ServerPack/HA3_Function/HA324_tagMCBindJadeWheelResult.cs
New file @@ -0,0 +1,19 @@ using UnityEngine; using System.Collections; // A3 24 通知绑玉转盘结果 #tagMCBindJadeWheelResult public class HA324_tagMCBindJadeWheelResult : GameNetPackBasic { public byte Index; // 格子 public byte Cnt; //今日已转次数 public HA324_tagMCBindJadeWheelResult () { _cmd = (ushort)0xA324; } public override void ReadFromBytes (byte[] vBytes) { TransBytes (out Index, vBytes, NetDataType.BYTE); TransBytes (out Cnt, vBytes, NetDataType.BYTE); } } Core/NetworkPackage/ServerPack/HA3_Function/HA324_tagMCBindJadeWheelResult.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: d6ba1d40695294e48abc2835e49bc818 timeCreated: 1538032691 licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Fight/BossFakeLineUtility.cs
@@ -68,6 +68,31 @@ } } public bool HasSawLineStoneRecently(int bossId, int lineId) { var config = Config.Instance.Get<BossInfoConfig>(bossId); if (config == null) { return false; } var stoneId = config.StoneNPCID; //补充具体逻辑 return false; } public bool HasSawLineBossRecently(int bossId, int lineId) { var isMistakeBoss = lastBossNpcID == bossId && Time.realtimeSinceStartup < inMistakeForBossAliveOverTime; //补充具体逻辑 return false; } FindPreciousModel findPreciousModel { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } } Dictionary<int, DateTime> bossKillTimes = new Dictionary<int, DateTime>(); System/Dogz/DogzActiveWin.cs
@@ -281,7 +281,7 @@ private void UpdateDogzAssistCnt() { m_Controller.m_Scorller.RefreshActiveCellViews(); m_DogzAssistCnt.text = Language.Get("TreasurePrivilege_Dogz_1", StringUtility.Contact(model.GetAssistDogzCount(), "/", model.DogzAssistDefaultCnt)); m_DogzAssistCnt.text = Language.Get("TreasurePrivilege_Dogz_1", StringUtility.Contact(model.GetAssistDogzCount(), "/", model.curSumAssistNum)); UpdateDogzBtn(); UpdateDogzProperty(); UpdateDogzEquip(); @@ -296,11 +296,21 @@ private void AddAssist() { if(model.IsAddMaxAssist()) { SysNotifyMgr.Instance.ShowTip("DogzNumLimit"); return; } var _itemConfig = Config.Instance.Get<ItemConfig>(model.AddAssistItem); ConfirmCancel.ShowItemConfirm(Language.Get("DogzFunc102", _itemConfig.ItemName, model.GetAssistItemCnt()), model.AddAssistItem, model.GetAssistItemCnt(), () => model.AddAssistItem, model.GetAssistItemCnt(), () => { model.SendBuyAssistCnt(); if (model.curSumAssistNum + 1 >= model.DogzAssistMaxCnt) { SysNotifyMgr.Instance.ShowTip("DogzNumLimit"); } }); } private void TakeOffEquip() @@ -319,7 +329,7 @@ { if(!model.TryGetAssistDogzState(model.presentSelectDogz)) { if(model.GetAssistDogzCount() < model.DogzAssistDefaultCnt) if(model.GetAssistDogzCount() < model.curSumAssistNum) { assistEffect.Play(); assistTextEffect.Play(); System/Dogz/DogzModel.cs
@@ -19,6 +19,7 @@ public void OnBeforePlayerDataInitialize() { curSumAssistNum = DogzAssistDefaultCnt; addAssistCnt = 0; SelectDogzItemQuality = 0; SelectDogzItemStart = 0; @@ -51,7 +52,7 @@ #region 配置 private Dictionary<int, Dictionary<int, int>> m_DogzEquipLimit = new Dictionary<int, Dictionary<int, int>>(); //装备位 品质限制 public int DogzAssistDefaultCnt { get; private set; } //助战神兽总数 public int DogzAssistDefaultCnt { get; private set; } //助战神兽默认数量 public int DogzAssistMaxCnt { get; private set; }//助战神兽最大数 public int AddAssistItem { get; private set; } //增加助战神兽总数的物品Id public int DogzPackGridCnt { get; private set; } //神兽物品背包格子数 @@ -217,7 +218,27 @@ public int GetAssistItemCnt() { return AddAssistItemCnt[addAssistCnt]; if(!IsAddMaxAssist()) { return AddAssistItemCnt[addAssistCnt]; } else { return AddAssistItemCnt[AddAssistItemCnt.Length - 1]; } } public bool IsAddMaxAssist() { if (curSumAssistNum < DogzAssistMaxCnt) { return false; } else { return true; } } public int presentSelectDogz { get; set; } //当前选中的神兽id @@ -253,10 +274,11 @@ #region 协议 public int addAssistCnt { get; private set; } //额外购买的助战数 public int curSumAssistNum { get; private set; } //当前可以助战的神兽数量 public void SetServerAddAssistDogzCnt(HA3C0_tagMCDogzInfo info) { addAssistCnt = info.BuyHelpbattleCount; DogzAssistDefaultCnt += addAssistCnt; curSumAssistNum = DogzAssistDefaultCnt + addAssistCnt; if (UpdateAssistDogzEvent != null) { UpdateAssistDogzEvent(); @@ -788,7 +810,7 @@ { value.state = RedPointState.None; } bool isMaxAssistNum = GetAssistDogzCount() >= DogzAssistDefaultCnt ? true : false; bool isMaxAssistNum = GetAssistDogzCount() >= curSumAssistNum ? true : false; int minAlreadyAssistId = 0; foreach (var dogzId in m_DogzEquipLimit.Keys) { @@ -859,7 +881,7 @@ return; } } bool isMaxAssistNum = GetAssistDogzCount() >= DogzAssistDefaultCnt ? true : false; bool isMaxAssistNum = GetAssistDogzCount() >= curSumAssistNum ? true : false; if (!isMaxAssistNum) { int maxEquipNum = 0; @@ -974,7 +996,7 @@ public void UpdateAssistNumRed() { if(CheckIsAddAssistNum()) if(CheckIsAddAssistNum() && !IsAddMaxAssist()) { if(addAssistDogzRedpoint.state == RedPointState.None) { System/FindPrecious/FindPreciousModel.cs
@@ -44,9 +44,9 @@ Dictionary<int, BossSubscribe> bossSubscribes = new Dictionary<int, BossSubscribe>(); bool serverInited = false; public event Action<int> bossInfoUpdateEvent; public event Action<int> bossSubscribeChangeEvent; public event Action preciousDropRecordUpdateEvent; public event Action<int> bossInfoUpdateEvent; public event Action bossRebornNotifyChangeEvent; DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } } @@ -541,40 +541,37 @@ { return false; } else if (BossFakeLineUtility.Instance.HasSawLineBossRecently(bossId, PlayerDatas.Instance.baseData.FBID)) { return true; } else if (BossFakeLineUtility.Instance.HasSawLineStoneRecently(bossId, PlayerDatas.Instance.baseData.FBID)) { return false; } else { var isMistakeBoss = BossFakeLineUtility.Instance.lastBossNpcID == bossId && Time.realtimeSinceStartup < BossFakeLineUtility.Instance.inMistakeForBossAliveOverTime; var isLineBossAlive = IsLineBossAlive(PlayerDatas.Instance.baseData.FBID); if (isMistakeBoss && isLineBossAlive) var currentNeutralMap = false; if (Config.Instance.ContainKey<WorldBossConfig>(bossId)) { return true; var worldBossConfig = Config.Instance.Get<WorldBossConfig>(bossId); currentNeutralMap = worldBossConfig.MapID == PlayerDatas.Instance.baseData.MapID; currentNeutralMap = currentNeutralMap && GeneralConfig.Instance.neutralMaps.Contains(worldBossConfig.MapID); } if (currentNeutralMap) { return IsLineBossAlive(PlayerDatas.Instance.baseData.FBID); } else { var currentNeutralMap = false; if (Config.Instance.ContainKey<WorldBossConfig>(bossId)) if (BossFakeLineUtility.Instance.IsBossKilledRecently(bossId)) { var worldBossConfig = Config.Instance.Get<WorldBossConfig>(bossId); currentNeutralMap = worldBossConfig.MapID == PlayerDatas.Instance.baseData.MapID; currentNeutralMap = currentNeutralMap && GeneralConfig.Instance.neutralMaps.Contains(worldBossConfig.MapID); } if (currentNeutralMap) { return isLineBossAlive; return !IsAnyLineBossDead(); } else { if (BossFakeLineUtility.Instance.IsBossKilledRecently(bossId)) { return !IsAnyLineBossDead(); } else { return IsAnyLineBossAlive(); } return IsAnyLineBossAlive(); } } } @@ -710,7 +707,6 @@ } } } public static int Compare2(DropRecord _lhs, DropRecord _rhs) { System/Strengthening/GodBeastModel.cs
@@ -282,7 +282,7 @@ _ItemColor = itemModelBack.chinItemModel.ItemColor; } } if (Type >= dogz_model.DogzAssistDefaultCnt && ItemColor> _ItemColor)//出战神兽已满,且神兽背包有品质低于已助战神兽品质颜色时 if (Type >= dogz_model.curSumAssistNum && ItemColor> _ItemColor)//出战神兽已满,且神兽背包有品质低于已助战神兽品质颜色时 { redPointStre1.state = RedPointState.Simple; return; System/Vip/VipInvest/RotatePointer.cs
@@ -91,11 +91,7 @@ IsRotateBool = true; _isRotate = true; } //外部调用,设置停止角度 public void SetAngle(float angle) { Angle = angle; } //外部调用,设置停止角度 } } System/Vip/VipInvest/WheelOfFortuneModel.cs
New file @@ -0,0 +1,99 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Thursday, September 27, 2018 //-------------------------------------------------------- using LitJson; using System; using System.Collections.Generic; using TableConfig; using UnityEngine; namespace Snxxz.UI { public class WheelOfFortuneModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk { public class AngleClass { public float AngleStart; public float AngleEnd; } public int Lattice = -1;//格子 public int Number = 0;//次数 public int NeedJade = 0;//需要仙玉 public float AngleSave = 0f;//角度记录 public Dictionary<int, AngleClass> AngleDic = new Dictionary<int, AngleClass>(); private int[][] AngleList; public event Action<float> WheelOfFortuneUpdate; private string StrKey = string.Empty; private bool IsOk = false; public override void Init() { var BindJadewheel = Config.Instance.Get<FuncConfigConfig>("BindJadeWheelCfg"); NeedJade = int.Parse(BindJadewheel.Numerical1); AngleList = JsonMapper.ToObject<int[][]>(BindJadewheel.Numerical5); for (int i = 0; i < AngleList.Length; i++) { if (AngleDic.Count <= 0) { int Type = i + 1; AngleClass angleClass = new AngleClass(); angleClass.AngleStart = AngleList[i][0]; angleClass.AngleEnd = AngleList[i][1]; AngleDic.Add(Type, angleClass); } } } public override void UnInit() { } public void OnBeforePlayerDataInitialize() { IsOk = false; } public void OnPlayerLoginOk() { IsOk = true; StrKey = "IsOpenFiaryJadeRedPoint" + PlayerDatas.Instance.baseData.PlayerID; AngleSave = LocalSave.GetFloat(StrKey); } public void BindJadeWheelResult(HA324_tagMCBindJadeWheelResult Info) { Lattice = Info.Index; Number = Info.Cnt; if (IsOk) { if (AngleDic.ContainsKey(Lattice)) { float flo = UnityEngine.Random.Range(AngleDic[Lattice].AngleStart + 0.05f, AngleDic[Lattice].AngleEnd - 0.05f); LocalSave.SetFloat(StrKey, flo); AngleSave = LocalSave.GetFloat(StrKey); } if (WheelOfFortuneUpdate != null) { WheelOfFortuneUpdate(AngleSave); } } } public void StartTheDraw()//开始抽奖 { CA517_tagCMStartBindJadeWheel _tagC517 = new CA517_tagCMStartBindJadeWheel(); GameNetSystem.Instance.SendInfo(_tagC517); } } } System/Vip/VipInvest/WheelOfFortuneModel.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 7a605a41a6e674a43b7394d602e4c929 timeCreated: 1538032790 licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/Vip/VipInvest/WheelOfFortuneWin.cs
@@ -16,7 +16,11 @@ [SerializeField] Button m_LotteryBtn; [SerializeField] RotatePointer m_RotatePointer; [SerializeField] Toggle m_Toggle; [SerializeField] Button m_CloseBtn; [SerializeField] Button m_CloseBtn; VipModel m_Vipmodel; VipModel vipmodel { get { return m_Vipmodel ?? (m_Vipmodel = ModelCenter.Instance.GetModel<VipModel>()); } } WheelOfFortuneModel wheelOfFortuneModel { get { return ModelCenter.Instance.GetModel<WheelOfFortuneModel>(); } } private int remainingTimes = 0;//剩余次数 #region Built-in protected override void BindController() { @@ -30,23 +34,32 @@ } protected override void OnPreOpen() { { IsLottery();//判断是否拥有次数 } protected override void OnAfterOpen() { wheelOfFortuneModel.WheelOfFortuneUpdate += WheelOfFortuneUpdate; } protected override void OnPreClose() { } { wheelOfFortuneModel.WheelOfFortuneUpdate -= WheelOfFortuneUpdate; } private void WheelOfFortuneUpdate(float Angel) { IsLottery(); } protected override void OnAfterClose() { } private void OnClickButton() { wheelOfFortuneModel.StartTheDraw();//开始抽奖 m_RotatePointer.SetTime(); } private void OnClickToggle(bool _bool) @@ -54,7 +67,6 @@ if (_bool) { m_RotatePointer._isRotate = false; m_RotatePointer.SetAngle(m_RotatePointer.Angle); } else { @@ -62,8 +74,22 @@ } } private void IsLottery() { int LotteryNumber = vipmodel.GetVipPrivilegeCnt(VipPrivilegeType.BindJadeWheel); if (LotteryNumber > wheelOfFortuneModel.Number) { remainingTimes = LotteryNumber - wheelOfFortuneModel.Number; m_LotteryBtn.interactable = true; } else { m_LotteryBtn.interactable = false; } } #endregion } } System/WindowBase/ModelCenter.cs
@@ -195,6 +195,7 @@ RegisterModel<PrayForDurgModel>(); RegisterModel<FeatureNoticeModel>(); RegisterModel<AwardExchangeModel>(); RegisterModel<WheelOfFortuneModel>(); inited = true; } Utility/EnumHelper.cs
@@ -1105,6 +1105,7 @@ DemonJar = 25, BossHomeAwardLimit = 27, DemonJarDouble = 28, BindJadeWheel=30, }