Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | public static void Init()
|
| | | {
|
| | | // 登记相应的数据体及对应的数据转逻辑类
|
| | | Register(typeof(HB216_tagMCStartCustomSceneResult), typeof(DTCB216_tagMCStartCustomSceneResult));
|
| | | Register(typeof(HAC07_tagGCHorsePetBossInfo), typeof(DTCAC07_tagGCHorsePetBossInfo));
|
| | | Register(typeof(HB216_tagMCStartCustomSceneResult), typeof(DTCB216_tagMCStartCustomSceneResult));
|
| | | Register(typeof(HA905_tagGCNotifyEquipDetailInfo), typeof(DTCA905_tagGCNotifyEquipDetailInfo));
|
| | | Register(typeof(HA719_tagSCPlayerEquipCacheResult) ,typeof(DTCA719_tagSCPlayerEquipCacheResult));
|
| | | Register(typeof(HB108_tagMCYinjiStartTime) ,typeof(DTCB108_tagMCYinjiStartTime));
|
| | |
| | | {
|
| | | base.Done(vNetPack);
|
| | | var package = vNetPack as HB214_tagMCCuntomFBPrizeInfo;
|
| | |
|
| | | ClientDungeonStageUtility.ReceiveCustomItems(package);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | public static ushort clientMapId { get; private set; }
|
| | | public static Dungeon dungeonInfo { get; set; } |
| | | |
| | | static bool exitClientDungeonSymbol = false; |
| | | |
| | | const string OFFLINEMAPRECORD = "OfflineMapRecord"; |
| | | |
| | | public static event Action<HB214_tagMCCuntomFBPrizeInfo> onReceiveCustomDropItme; |
| | | |
| | | static Action<Dungeon, bool> clientCustomDungeonResult; |
| | | |
| | |
| | | { |
| | | DTC0102_tagCDBPlayer.switchAccountEvent += Reset; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk; |
| | | StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish; |
| | | }
|
| | |
|
| | | public static void SetClientDungeon(bool value, ushort mapId) |
| | |
| | | ClearClientDataMapSymbol();
|
| | | } |
| | | }
|
| | |
|
| | | public static void RequestSettleClientDungeon(int mapId, int lineId)
|
| | | {
|
| | | var pak = new CB109_tagCMGiveCustomFBPrize();
|
| | | pak.MapID = (uint)mapId;
|
| | | pak.FuncLineID = (ushort)lineId;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | } |
| | | |
| | | public static void RequestStartClientDungeon(int mapId, int lineId, Action<Dungeon, bool> callBack)
|
| | | {
|
| | |
| | | {
|
| | | var pak = new CA233_tagCMClientExitCustomScene();
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | } |
| | | |
| | | public static void ReceiveCustomItems(HB214_tagMCCuntomFBPrizeInfo package)
|
| | | {
|
| | | if (onReceiveCustomDropItme != null)
|
| | | {
|
| | | onReceiveCustomDropItme(package);
|
| | | }
|
| | | } |
| | | |
| | | public static void ReceiveStartCustomDungeonResult(HB216_tagMCStartCustomSceneResult package)
|
| | |
| | | PlayerDatas.Instance.extersion.pkState = 0;
|
| | | ModelCenter.Instance.GetModel<DungeonModel>().ResetBufData();
|
| | |
|
| | | exitClientDungeonSymbol = true;
|
| | |
|
| | | PlayerDatas.Instance.baseData.MapID = PlayerDatas.Instance.baseData.mainServerMapIdRecord;
|
| | | StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
|
| | | {
|
| | |
| | | needLoadResource = true,
|
| | | serverType = ServerType.Main,
|
| | | isClientLoadMap = true,
|
| | | refreshPlayerDatas = true
|
| | | refreshPlayerDatas = true,
|
| | | exitClientMap = true,
|
| | | });
|
| | | } |
| | | |
| | |
| | | RequestStartClientDungeon(dungeonInfo.mapId, dungeonInfo.lineId, null);
|
| | | }
|
| | | } |
| | | |
| | | private static void OnStageLoadFinish()
|
| | | {
|
| | | if (exitClientDungeonSymbol)
|
| | | {
|
| | | RequestExitClientDungeon();
|
| | | }
|
| | |
|
| | | exitClientDungeonSymbol = false;
|
| | | }
|
| | |
|
| | | private static void Reset() |
| | | { |
| | |
| | | public bool isClientLoadMap; |
| | | public bool needLoadResource; |
| | | public bool refreshPlayerDatas; |
| | | public bool exitClientMap; |
| | | |
| | | public bool serverFlag0109 = false; |
| | | } |
| | |
| | |
|
| | | unloadUnUsedOperation = Resources.UnloadUnusedAssets();
|
| | |
|
| | | if (command.exitClientMap)
|
| | | {
|
| | | ClientDungeonStageUtility.RequestExitClientDungeon(); |
| | | }
|
| | |
|
| | | if (command.refreshPlayerDatas)
|
| | | {
|
| | | var sendInfo = new CA108_tagCMRefreshMainServerRole();
|
| | |
| | | |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetRidingPetBossLineDictAction", _e_GetRidingPetBossLineDictAction); |
| | | |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "isActivityOver", _g_get_isActivityOver); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "BossIDArray", _g_get_BossIDArray); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "Boss1RewardIDArray", _g_get_Boss1RewardIDArray); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "Boss2RewardIDArray", _g_get_Boss2RewardIDArray); |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_isActivityOver(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | Snxxz.UI.RidingPetBossModel gen_to_be_invoked = (Snxxz.UI.RidingPetBossModel)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.lua_pushboolean(L, gen_to_be_invoked.isActivityOver); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_BossIDArray(RealStatePtr L) |
| | |
| | | [SerializeField] RawImage m_BossRawImage;
|
| | | DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } }
|
| | |
|
| | | RidingPetBossModel ridingPetMdoel { get { return ModelCenter.Instance.GetModel<RidingPetBossModel>(); } }
|
| | | RidingPetBossModel model { get { return ModelCenter.Instance.GetModel<RidingPetBossModel>(); } }
|
| | | //public int RawImagetestBossID = 50103006;
|
| | | public RewardPositionType rewardPositonType;
|
| | | [SerializeField] ItemCell[] m_RewardArray;
|
| | |
| | |
|
| | | public void DisplayBossRawImage()
|
| | | {
|
| | | var config = NPCConfig.Get(ridingPetMdoel.BossIDArray[0]);
|
| | | UI3DModelExhibition.Instance.ShowNPC(ridingPetMdoel.BossIDArray[0], config.UIModeLOffset, config.UIModelRotation, m_BossRawImage);
|
| | | var config = NPCConfig.Get(model.BossIDArray[0]);
|
| | | UI3DModelExhibition.Instance.ShowNPC(model.BossIDArray[0], config.UIModeLOffset, config.UIModelRotation, m_BossRawImage);
|
| | | }
|
| | |
|
| | | public void StopShowBossRawImage()
|
| | |
| | |
|
| | | public void DisplayAnotherBossRawImage()
|
| | | {
|
| | | var config = NPCConfig.Get(ridingPetMdoel.BossIDArray[1]);
|
| | | UI3DModelExhibition.InstanceClone1.ShowNPC(ridingPetMdoel.BossIDArray[1], config.UIModeLOffset, config.UIModelRotation, m_BossRawImage);
|
| | | var config = NPCConfig.Get(model.BossIDArray[1]);
|
| | | UI3DModelExhibition.InstanceClone1.ShowNPC(model.BossIDArray[1], config.UIModeLOffset, config.UIModelRotation, m_BossRawImage);
|
| | | }
|
| | |
|
| | | public void DisplaySpiritPetHP()
|
| | | {
|
| | | m_ActivityInfo.text = Language.Get("RidingPetBossRemainHP", ModelCenter.Instance.GetModel<RidingPetBossModel>().GetBossRemianedHP(bossIdIndex));
|
| | | var hp = model.GetBossRemianedHP(bossIdIndex);
|
| | | var alive = model.IsBossAlive(bossIdIndex);
|
| | | if (!alive)
|
| | | {
|
| | | m_ActivityInfo.text = Language.Get("AllianceBoss_1");
|
| | | m_ActivityInfo.color = UIHelper.GetUIColor(TextColType.Red);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_ActivityInfo.text = Language.Get("RidingPetBossRemainHP", hp);
|
| | | m_ActivityInfo.color = UIHelper.GetUIColor(TextColType.White);
|
| | | }
|
| | | }
|
| | |
|
| | | public void DisplayActivityTime()
|
| | |
| | | HourMinute hourMin;
|
| | | dailyQuestOpentime.TryGetNextOpenTime(out hourMin);
|
| | | m_ActivityInfo.text = Language.Get("RidingPetBossQuestTime", "<color=red>"+hourMin.hourBegin+":"+hourMin.minuteBegin+"</color>");
|
| | | m_ActivityInfo.color = UIHelper.GetUIColor(TextColType.White);
|
| | | }
|
| | |
|
| | | public void DisplayRewardItem()
|
| | |
| | | [XLua.Hotfix]
|
| | | public class RidingPetBossModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | Dictionary<int, bool> m_BossAliceStates = new Dictionary<int, bool>();
|
| | |
|
| | | public const int RIDINGPETBOSS_MAP = 31200;
|
| | |
|
| | | public int[] BossIDArray;
|
| | | public int[] Boss1RewardIDArray;
|
| | | public int[] Boss2RewardIDArray;
|
| | | public bool isActivityOver { get; private set; }
|
| | | public const int RIDINGPETBOSS_MAP = 31200;
|
| | |
|
| | | Dictionary<int, RidingPetBossLine> RidingPetBossLineDict = new Dictionary<int, RidingPetBossLine>();
|
| | | private string m_MountsBossID;
|
| | | private string m_Boss1RewardID;
|
| | | private string m_Boss2RewardID;
|
| | |
|
| | | public event Action GetRidingPetBossLineDictAction;
|
| | | public event Action onBossStateRefresh;
|
| | |
|
| | |
|
| | |
|
| | |
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | m_BossAliceStates.Clear();
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | |
| | |
|
| | | public void ReceivePackage(HAC07_tagGCHorsePetBossInfo package)
|
| | | {
|
| | | if (package.IsEnd == 1)
|
| | | m_BossAliceStates[0] = !MathUtility.GetBitValue(package.IsEnd, 0);
|
| | | m_BossAliceStates[1] = !MathUtility.GetBitValue(package.IsEnd, 1);
|
| | | if (onBossStateRefresh != null)
|
| | | {
|
| | | isActivityOver = true;
|
| | | onBossStateRefresh();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return RidingPetBossLineDict[index].remainedHP;
|
| | | }
|
| | | }
|
| | |
|
| | | public bool IsBossAlive(int index)
|
| | | {
|
| | | return m_BossAliceStates.ContainsKey(index) ? m_BossAliceStates[index] : false;
|
| | | }
|
| | | }
|
| | |
|
| | | public struct RidingPetBossLine
|
| | |
| | | using System.Collections; |
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | |
| | | protected override void OnPreClose()
|
| | | {
|
| | | ridingPetBossModel.GetRidingPetBossLineDictAction -= GetRidingBossDictPackageAction;
|
| | | ridingPetBossModel.onBossStateRefresh -= OnBossStateRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | |
| | | m_ContainerMounts.bossIdIndex = 0;
|
| | | m_ContainerSpiritPet.bossIdIndex = 1;
|
| | |
|
| | | m_ContainerMounts.DisplayBossName();
|
| | | m_ContainerSpiritPet.DisplayBossName();
|
| | |
|
| | |
| | | mapModel.RequestQueryMapLineState(RidingPetBossModel.RIDINGPETBOSS_MAP);
|
| | | GetRidingBossDictPackageAction();
|
| | |
|
| | |
|
| | | m_ContainerMounts.DisplayBossRawImage();
|
| | | m_ContainerSpiritPet.DisplayAnotherBossRawImage();
|
| | |
|
| | | m_ContainerMounts.DisplayRewardItem();
|
| | | m_ContainerSpiritPet.DisplayRewardItem();
|
| | | WindowCenter.Instance.windowBeforeCloseEvent += WindowBeforeCloseEvent;
|
| | |
|
| | | ridingPetBossModel.onBossStateRefresh += OnBossStateRefresh;
|
| | |
|
| | | UpdateRidingPetBottomTip();
|
| | | }
|
| | |
|
| | | private void OnBossStateRefresh()
|
| | | {
|
| | | GetRidingBossDictPackageAction();
|
| | | }
|
| | |
|
| | | private void WindowBeforeCloseEvent(Window _window)
|
| | |
| | | case DailyQuestModel.DailyQuestState.Normal:
|
| | | m_ContainerMounts.DisplaySpiritPetHP();
|
| | | m_ContainerSpiritPet.DisplaySpiritPetHP();
|
| | | m_MountsGoToButton.SetInteractable(m_MountGotoLabel, true);
|
| | | m_SpiritPetGoToButton.SetInteractable(m_PetGotoLabel, true);
|
| | |
|
| | | var isMountAlive = ridingPetBossModel.IsBossAlive(m_ContainerMounts.bossIdIndex);
|
| | | var isPetAlive = ridingPetBossModel.IsBossAlive(m_ContainerSpiritPet.bossIdIndex);
|
| | |
|
| | | m_MountsGoToButton.SetInteractable(m_MountGotoLabel, isMountAlive);
|
| | | m_SpiritPetGoToButton.SetInteractable(m_PetGotoLabel, isPetAlive);
|
| | | break;
|
| | | default:
|
| | | m_ContainerMounts.DisplayActivityTime();
|