public static void OpenInstanceUI(int instanceID, bool hideTheVisible = false, UIType type = UIType.FullScreen)
    {
        InstanceManagerUI.InstanceID = instanceID;
        ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(instanceID);

        int chapterID = zhuXianPeiZhi.chapterId;
        ZhuXianZhangJiePeiZhi zhuXianZhangJiePeiZhi = DataReader <ZhuXianZhangJiePeiZhi> .Get(chapterID);

        List <ChapterInfo> dataByInstanceType = DungeonManager.Instance.GetDataByInstanceType(zhuXianZhangJiePeiZhi.chapterType);

        if (dataByInstanceType.get_Count() == 0 || dataByInstanceType.Find((ChapterInfo a) => a.chapterId == chapterID) == null)
        {
            DungeonManager.Instance.SendGetDungeonDataReq(chapterID, (DungeonType.ENUM)zhuXianZhangJiePeiZhi.chapterType, delegate
            {
                InstanceManagerUI.OpenInstanceUI(instanceID, hideTheVisible, type);
            });
            return;
        }
        FuBenJiChuPeiZhi fuBenJiChuPeiZhi = DataReader <FuBenJiChuPeiZhi> .Get(instanceID);

        if (fuBenJiChuPeiZhi.type == 103)
        {
            InstanceSelectUI instanceSelectUI = UIManagerControl.Instance.OpenUI("InstanceSelectUI", null, true, UIType.FullScreen) as InstanceSelectUI;
            instanceSelectUI.RefreshUIByInstanceID(instanceID);
        }
        else
        {
            InstanceSelectUI instanceSelectUI2 = UIManagerControl.Instance.OpenUI("InstanceSelectUI", null, true, UIType.FullScreen) as InstanceSelectUI;
            instanceSelectUI2.RefreshUIByInstanceID(instanceID);
            InstanceDetailUI instanceDetailUI = UIManagerControl.Instance.OpenUI("InstanceDetailUI", null, false, UIType.Pop) as InstanceDetailUI;
            instanceDetailUI.RefreshUI(instanceID);
        }
    }
    private void OnClcikInstancesLayoutItem(GameObject sender)
    {
        InstancesLayoutItem component = sender.GetComponent <InstancesLayoutItem>();
        Hashtable           hashtable = DungeonManager.Instance.CheckLock(component.instanceID);
        bool   flag = (bool)hashtable.get_Item("ISLock");
        string text = (string)hashtable.get_Item("LockReason");

        if (flag)
        {
            UIManagerControl.Instance.ShowToastText(text);
        }
        else
        {
            FuBenJiChuPeiZhi fuBenJiChuPeiZhi = DataReader <FuBenJiChuPeiZhi> .Get(component.instanceID);

            if (fuBenJiChuPeiZhi.type != 103)
            {
                UIBase uIIfExist = UIManagerControl.Instance.GetUIIfExist("InstanceSelectUI");
                if (uIIfExist != null)
                {
                    (uIIfExist as InstanceSelectUI).RefreshUIByInstanceID(component.instanceID);
                }
                InstanceDetailUI instanceDetailUI = UIManagerControl.Instance.OpenUI("InstanceDetailUI", null, false, UIType.Pop) as InstanceDetailUI;
                InstanceManagerUI.InstanceID = component.instanceID;
                instanceDetailUI.RefreshUI(component.instanceID);
            }
        }
    }
    public static int GetInstanceLimitPetType()
    {
        if (InstanceManagerUI.InstanceID <= 0)
        {
            return(0);
        }
        FuBenJiChuPeiZhi fuBenJiChuPeiZhi = DataReader <FuBenJiChuPeiZhi> .Get(InstanceManagerUI.InstanceID);

        if (fuBenJiChuPeiZhi == null)
        {
            return(0);
        }
        return(fuBenJiChuPeiZhi.petType);
    }
示例#4
0
    public bool IsFinish(int instanceID)
    {
        if (instanceID <= 0)
        {
            return(false);
        }
        FuBenJiChuPeiZhi fuBenJiChuPeiZhi = DataReader <FuBenJiChuPeiZhi> .Get(instanceID);

        if (fuBenJiChuPeiZhi == null)
        {
            return(false);
        }
        List <ChapterInfo> dataByInstanceType = this.GetDataByInstanceType(fuBenJiChuPeiZhi.type);

        if (dataByInstanceType == null)
        {
            return(false);
        }
        ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(instanceID);

        if (zhuXianPeiZhi == null)
        {
            return(false);
        }
        ZhuXianZhangJiePeiZhi zhuXianZhangJiePeiZhi = DataReader <ZhuXianZhangJiePeiZhi> .Get(zhuXianPeiZhi.chapterId);

        if (zhuXianZhangJiePeiZhi == null)
        {
            return(false);
        }
        if (zhuXianZhangJiePeiZhi.chapterOrder - 1 < 0 || zhuXianZhangJiePeiZhi.chapterOrder - 1 >= dataByInstanceType.get_Count())
        {
            return(false);
        }
        ChapterInfo chapterInfo = dataByInstanceType.get_Item(zhuXianZhangJiePeiZhi.chapterOrder - 1);

        for (int i = 0; i < chapterInfo.dungeons.get_Count(); i++)
        {
            if (instanceID == chapterInfo.dungeons.get_Item(i).dungeonId)
            {
                return(chapterInfo.dungeons.get_Item(i).clearance);
            }
        }
        return(false);
    }
示例#5
0
    public void StartMopup(int instanceID, int times)
    {
        if (times > 1)
        {
            this.isMutliMopup = true;
        }
        else
        {
            this.isMutliMopup = false;
        }
        this.mopupTimes           = times;
        this.currentMopupInstance = instanceID;
        this.currentInstanceData  = DataReader <FuBenJiChuPeiZhi> .Get(instanceID);

        if (this.currentInstanceData == null)
        {
            Debug.LogWarning("没找到副本ID " + instanceID);
            return;
        }
        this.GoOnMopUp();
    }
    public void EnterChangeCareerInstance(int profession)
    {
        this.IsWinWithChange = false;
        this.IsQuit          = false;
        this.dst_profession  = profession;
        RoleCreate roleCreate = DataReader <RoleCreate> .Get(profession);

        if (roleCreate == null)
        {
            return;
        }
        FuBenJiChuPeiZhi fuBenJiChuPeiZhi = DataReader <FuBenJiChuPeiZhi> .Get(ChangeCareerInstance.ChangeCareerInstanceDataID);

        if (fuBenJiChuPeiZhi == null)
        {
            return;
        }
        ChangeCareerManager.Instance.SendInChallengeNty();
        InstanceManager.ChangeInstanceManager(ChangeCareerInstance.Instance, false);
        InstanceManager.SimulateEnterField(10, null);
        InstanceManager.SimulateSwicthMap(ChangeCareerInstance.Instance.InstanceData.scene, LocalInstanceHandler.Instance.CreateSelfInfo(fuBenJiChuPeiZhi.type, fuBenJiChuPeiZhi.id, fuBenJiChuPeiZhi.scene, profession, roleCreate.modle, this.GetDecorations(profession), null, this.GetBattleSkillInfos(profession)), null, 0);
    }
示例#7
0
    protected override void StartExecute(bool isFastNav)
    {
        if (base.Data == null || base.Targets == null || base.Targets.get_Count() <= 0)
        {
            return;
        }
        int instanceID = base.Targets.get_Item(0);

        if (!base.IsTrigger && MainTaskManager.Instance.HasNpcId(base.Data.instanceNpc))
        {
            base.IsTrigger = true;
            InstanceManager.SecurityCheck(delegate
            {
                WaitUI.OpenUI(0u);
                if (this.Data.type == 6)
                {
                    DungeonManager.Instance.DungeonInstanceType = DungeonManager.InsType.MAIN;
                    DungeonManager.Instance.SendChallengeDungeonReq(instanceID);
                    Debug.Log("<进入普通副本[" + instanceID + "]>");
                }
                else if (this.Data.type == 5 || this.Data.type == 4 || this.Data.type == 16)
                {
                    FuBenJiChuPeiZhi fuBenJiChuPeiZhi = DataReader <FuBenJiChuPeiZhi> .Get(instanceID);
                    if (fuBenJiChuPeiZhi != null)
                    {
                        DungeonManager.Instance.DungeonInstanceType = DungeonManager.InsType.FIELD;
                        DungeonManager.Instance.DungeonTarget.Clear();
                        DungeonManager.Instance.DungeonTarget.Add(fuBenJiChuPeiZhi.time);
                        if (this.Data.type == 5 && this.Targets.get_Count() == 2)
                        {
                            DungeonManager.Instance.DungeonTarget.Add(4);
                            this.mMaxCount = this.Targets.get_Item(1);
                            DungeonManager.Instance.DungeonTarget.Add(this.mMaxCount - this.Task.count);
                        }
                        else if (this.Data.type == 4 && this.Targets.get_Count() == 3)
                        {
                            DungeonManager.Instance.DungeonTarget.Add(2);
                            this.mMonsterId = this.Targets.get_Item(1);
                            DungeonManager.Instance.DungeonTarget.Add(this.mMonsterId);
                            this.mMaxCount = this.Targets.get_Item(2);
                            DungeonManager.Instance.DungeonTarget.Add(this.mMaxCount - this.Task.count);
                        }
                        else
                        {
                            if (this.Data.type != 16 || this.Targets.get_Count() != 4)
                            {
                                Debug.Log(string.Concat(new object[]
                                {
                                    "<color=red>Error:</color>任务副本[",
                                    this.Data.id,
                                    "]配置参数[",
                                    this.Data.target,
                                    "]有误!"
                                }));
                                return;
                            }
                            DungeonManager.Instance.DungeonTarget.Add(this.Targets.get_Item(2));
                            DungeonManager.Instance.DungeonTarget.Add(this.Targets.get_Item(3));
                        }
                        DungeonManager.Instance.SendChallengeDungeonReq(fuBenJiChuPeiZhi.id);
                        Debug.Log("<进入野外副本[" + instanceID + "]>");
                    }
                }
            }, null);
        }
        else if (!base.IsTrigger)
        {
            base.IsAutoNav = true;
            if (MainTaskManager.Instance.GoToNPC(base.Data.instanceNpc, base.Task.taskId, isFastNav, 0f))
            {
                this.OnEnterNPC(base.Data.instanceNpc);
            }
        }
    }
    public void RefreshUI(int instanceID)
    {
        this.currentInstanceID = instanceID;
        FuBenJiChuPeiZhi fuBenJiChuPeiZhi = DataReader <FuBenJiChuPeiZhi> .Get(instanceID);

        if (fuBenJiChuPeiZhi != null)
        {
            this.currentInstanceType = fuBenJiChuPeiZhi.type;
        }
        if (base.get_gameObject().get_activeSelf())
        {
            this.OpenCPC();
        }
        this.BtnClean.get_gameObject().SetActive(true);
        this.RefreshPetLimit();
        ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(instanceID);

        this.TextInstanceTitle.set_text(GameDataUtils.GetChineseContent(zhuXianPeiZhi.name, false));
        this.TextEnergy.set_text(zhuXianPeiZhi.expendVit.ToString());
        this.TextPower.set_text(zhuXianPeiZhi.suitCapabilitie.ToString());
        Icon icon = DataReader <Icon> .Get(zhuXianPeiZhi.backgroundPic);

        if (icon == null)
        {
            Debug.LogError("icon == null  " + zhuXianPeiZhi.backgroundPic);
        }
        ResourceManager.SetTexture(this.ImageMap, icon.icon);
        this.Condition1.get_gameObject().SetActive(false);
        this.Condition2.get_gameObject().SetActive(false);
        this.Condition3.get_gameObject().SetActive(false);
        List <int>  star        = zhuXianPeiZhi.star;
        DungeonInfo dungeonInfo = DungeonManager.Instance.GetDungeonInfo(instanceID);
        int         star2       = dungeonInfo.star;

        for (int i = 0; i < star.get_Count(); i++)
        {
            int           num           = star.get_Item(i);
            DungeonStarLv dungeonStarLv = DataReader <DungeonStarLv> .Get(num);

            if (dungeonStarLv == null)
            {
                Debuger.Error("DungeonStarLv 不存在 starID id = " + num, new object[0]);
            }
            else if (i == 0)
            {
                this.Condition1.get_gameObject().SetActive(true);
                this.Condition1.get_transform().FindChild("TextContent").GetComponent <Text>().set_text(GameDataUtils.GetChineseContent(dungeonStarLv.introduction, false));
            }
            else if (i == 1)
            {
                this.Condition2.get_gameObject().SetActive(true);
                this.Condition2.get_transform().FindChild("TextContent").GetComponent <Text>().set_text(GameDataUtils.GetChineseContent(dungeonStarLv.introduction, false));
            }
            else if (i == 2)
            {
                this.Condition3.get_gameObject().SetActive(true);
                this.Condition3.get_transform().FindChild("TextContent").GetComponent <Text>().set_text(GameDataUtils.GetChineseContent(dungeonStarLv.introduction, false));
            }
        }
        if (star2 == 0)
        {
            this.ImageStar1_1.get_gameObject().SetActive(true);
            this.ImageStar1_2.get_gameObject().SetActive(false);
            this.ImageStar2_1.get_gameObject().SetActive(true);
            this.ImageStar2_2.get_gameObject().SetActive(false);
            this.ImageStar3_1.get_gameObject().SetActive(true);
            this.ImageStar3_2.get_gameObject().SetActive(false);
        }
        else if (star2 == 1)
        {
            this.ImageStar1_1.get_gameObject().SetActive(false);
            this.ImageStar1_2.get_gameObject().SetActive(true);
            this.ImageStar2_1.get_gameObject().SetActive(true);
            this.ImageStar2_2.get_gameObject().SetActive(false);
            this.ImageStar3_1.get_gameObject().SetActive(true);
            this.ImageStar3_2.get_gameObject().SetActive(false);
        }
        else if (star2 == 2)
        {
            this.ImageStar1_1.get_gameObject().SetActive(false);
            this.ImageStar1_2.get_gameObject().SetActive(true);
            this.ImageStar2_1.get_gameObject().SetActive(false);
            this.ImageStar2_2.get_gameObject().SetActive(true);
            this.ImageStar3_1.get_gameObject().SetActive(true);
            this.ImageStar3_2.get_gameObject().SetActive(false);
        }
        else if (star2 == 3)
        {
            this.ImageStar1_1.get_gameObject().SetActive(false);
            this.ImageStar1_2.get_gameObject().SetActive(true);
            this.ImageStar2_1.get_gameObject().SetActive(false);
            this.ImageStar2_2.get_gameObject().SetActive(true);
            this.ImageStar3_1.get_gameObject().SetActive(false);
            this.ImageStar3_2.get_gameObject().SetActive(true);
        }
        for (int j = 0; j < this.listDropItems.get_Count(); j++)
        {
            Object.Destroy(this.listDropItems.get_Item(j));
        }
        this.listDropItems.Clear();
        if (zhuXianPeiZhi.reward.get_Count() > 0)
        {
            string text = string.Empty;
            for (int k = 0; k < zhuXianPeiZhi.reward.get_Count(); k++)
            {
                if (zhuXianPeiZhi.reward.get_Item(k).key == EntityWorld.Instance.EntSelf.TypeID)
                {
                    text = zhuXianPeiZhi.reward.get_Item(k).value;
                }
            }
            if (text != string.Empty)
            {
                string[] array = text.Split(new char[]
                {
                    ','
                });
                for (int l = 0; l < array.Length; l++)
                {
                    GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("InstanceDropItem");
                    instantiate2Prefab.get_transform().SetParent(this.Drop);
                    this.listDropItems.Add(instantiate2Prefab);
                    InstanceDropItem component = instantiate2Prefab.GetComponent <InstanceDropItem>();
                    component.RefreshUI(int.Parse(array[l]));
                    component.GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickInstanceDropItem);
                }
            }
        }
        if (DataReader <FuBenJiChuPeiZhi> .Get(instanceID).type == 102)
        {
            this.TextChallengeTime.set_text(GameDataUtils.GetChineseContent(510029, false));
            this.TextTimeLast.get_gameObject().SetActive(true);
            string text2 = GameDataUtils.GetChineseContent(510104, false);
            text2 = text2.Replace("{s1}", "<color=red>" + dungeonInfo.remainingChallengeTimes.ToString() + "</color>");
            this.TextTimeLast.set_text(text2);
        }
        else
        {
            this.TextChallengeTime.set_text(GameDataUtils.GetChineseContent(510029, false));
            this.TextTimeLast.get_gameObject().SetActive(false);
        }
    }
示例#9
0
    public Hashtable CheckLock(int instanceID)
    {
        ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(instanceID);

        bool flag = true;

        if (zhuXianPeiZhi.linkTask != 0 && MainTaskManager.Instance.CurTaskId != zhuXianPeiZhi.linkTask)
        {
            flag = false;
        }
        bool   flag2 = false;
        string text  = GameDataUtils.GetChineseContent(505094, false);

        for (int i = 0; i < zhuXianPeiZhi.frontInstance.get_Count(); i++)
        {
            int num = zhuXianPeiZhi.frontInstance.get_Item(i);
            if (num != 0 && num != instanceID)
            {
                DungeonInfo dungeonInfo = DungeonManager.Instance.GetDungeonInfo(num);
                if ((dungeonInfo != null && (!dungeonInfo.clearance || !flag)) || dungeonInfo == null)
                {
                    flag2 = true;
                    FuBenJiChuPeiZhi fuBenJiChuPeiZhi = DataReader <FuBenJiChuPeiZhi> .Get(num);

                    ZhuXianPeiZhi zhuXianPeiZhi2 = DataReader <ZhuXianPeiZhi> .Get(num);

                    if (fuBenJiChuPeiZhi.type == 101)
                    {
                        text = text + string.Format(GameDataUtils.GetChineseContent(505095, false), DataReader <ZhuXianZhangJiePeiZhi> .Get(zhuXianPeiZhi2.chapterId).chapterOrder, zhuXianPeiZhi2.instance) + "\n";
                    }
                    else if (fuBenJiChuPeiZhi.type == 102)
                    {
                        text = text + string.Format(GameDataUtils.GetChineseContent(505096, false), DataReader <ZhuXianZhangJiePeiZhi> .Get(zhuXianPeiZhi2.chapterId).chapterOrder, zhuXianPeiZhi2.instance) + "\n";
                    }
                    else if (fuBenJiChuPeiZhi.type == 103)
                    {
                        text = text + string.Format(GameDataUtils.GetChineseContent(505097, false), DataReader <ZhuXianZhangJiePeiZhi> .Get(zhuXianPeiZhi2.chapterId).chapterOrder, zhuXianPeiZhi2.instance) + "\n";
                    }
                }
            }
        }
        text = text.Substring(0, text.get_Length() - 1);
        if (zhuXianPeiZhi.minLv > EntityWorld.Instance.EntSelf.Lv)
        {
            flag2 = true;
        }
        if (zhuXianPeiZhi.minLv > EntityWorld.Instance.EntSelf.Lv)
        {
            text = GameDataUtils.GetChineseContent(510114, false);
            text = text.Replace("{s1}", zhuXianPeiZhi.minLv.ToString());
        }
        else if (DataReader <FuBenJiChuPeiZhi> .Get(instanceID).type != 2 || zhuXianPeiZhi.instance != 1)
        {
            if (DataReader <FuBenJiChuPeiZhi> .Get(instanceID).type == 3)
            {
            }
        }
        Hashtable hashtable = new Hashtable();

        hashtable.Add("ISLock", flag2);
        hashtable.Add("LockReason", text);
        return(hashtable);
    }
示例#10
0
    protected static BattleBaseInfo CreateSelfBattleBaseInfo(int instanceType, FuBenJiChuPeiZhi instanceData, List <PetInfo> trialPetInfos = null, List <BattleSkillInfo> trialSkillInfos = null)
    {
        BattleBaseInfo battleBaseInfo = new BattleBaseInfo();

        battleBaseInfo.publicBaseInfo            = new PublicBaseInfo();
        battleBaseInfo.publicBaseInfo.simpleInfo = new SimpleBaseInfo();
        battleBaseInfo.battleBaseAttr            = new BattleBaseAttr();
        battleBaseInfo.wrapType = GameObjectType.ENUM.Role;
        battleBaseInfo.camp     = 1;
        battleBaseInfo.publicBaseInfo.simpleInfo.MoveSpeed = EntityWorld.Instance.EntSelf.CityBaseAttrs.MoveSpeed;
        battleBaseInfo.publicBaseInfo.simpleInfo.AtkSpeed  = EntityWorld.Instance.EntSelf.CityBaseAttrs.ActSpeed;
        battleBaseInfo.publicBaseInfo.simpleInfo.Lv        = EntityWorld.Instance.EntSelf.CityBaseAttrs.Lv;
        battleBaseInfo.publicBaseInfo.simpleInfo.Fighting  = EntityWorld.Instance.EntSelf.CityBaseAttrs.Fighting;
        battleBaseInfo.publicBaseInfo.simpleInfo.VipLv     = EntityWorld.Instance.EntSelf.CityBaseAttrs.VipLv;
        battleBaseInfo.publicBaseInfo.Atk                        = EntityWorld.Instance.EntSelf.CityBaseAttrs.Atk;
        battleBaseInfo.publicBaseInfo.Defence                    = EntityWorld.Instance.EntSelf.CityBaseAttrs.Defence;
        battleBaseInfo.publicBaseInfo.HpLmt                      = EntityWorld.Instance.EntSelf.CityBaseAttrs.HpLmt;
        battleBaseInfo.publicBaseInfo.PveAtk                     = EntityWorld.Instance.EntSelf.CityBaseAttrs.PveAtk;
        battleBaseInfo.publicBaseInfo.PvpAtk                     = EntityWorld.Instance.EntSelf.CityBaseAttrs.PvpAtk;
        battleBaseInfo.publicBaseInfo.HitRatio                   = EntityWorld.Instance.EntSelf.CityBaseAttrs.HitRatio;
        battleBaseInfo.publicBaseInfo.DodgeRatio                 = EntityWorld.Instance.EntSelf.CityBaseAttrs.DodgeRatio;
        battleBaseInfo.publicBaseInfo.CritRatio                  = EntityWorld.Instance.EntSelf.CityBaseAttrs.CritRatio;
        battleBaseInfo.publicBaseInfo.DecritRatio                = EntityWorld.Instance.EntSelf.CityBaseAttrs.DecritRatio;
        battleBaseInfo.publicBaseInfo.CritHurtAddRatio           = EntityWorld.Instance.EntSelf.CityBaseAttrs.CritHurtAddRatio;
        battleBaseInfo.publicBaseInfo.ParryRatio                 = EntityWorld.Instance.EntSelf.CityBaseAttrs.ParryRatio;
        battleBaseInfo.publicBaseInfo.DeparryRatio               = EntityWorld.Instance.EntSelf.CityBaseAttrs.DeparryRatio;
        battleBaseInfo.publicBaseInfo.ParryHurtDeRatio           = EntityWorld.Instance.EntSelf.CityBaseAttrs.ParryHurtDeRatio;
        battleBaseInfo.publicBaseInfo.SuckBloodScale             = EntityWorld.Instance.EntSelf.CityBaseAttrs.SuckBloodScale;
        battleBaseInfo.publicBaseInfo.HurtAddRatio               = EntityWorld.Instance.EntSelf.CityBaseAttrs.HurtAddRatio;
        battleBaseInfo.publicBaseInfo.HurtDeRatio                = EntityWorld.Instance.EntSelf.CityBaseAttrs.HurtDeRatio;
        battleBaseInfo.publicBaseInfo.PveHurtAddRatio            = EntityWorld.Instance.EntSelf.CityBaseAttrs.PveHurtAddRatio;
        battleBaseInfo.publicBaseInfo.PveHurtDeRatio             = EntityWorld.Instance.EntSelf.CityBaseAttrs.PveHurtDeRatio;
        battleBaseInfo.publicBaseInfo.PvpHurtAddRatio            = EntityWorld.Instance.EntSelf.CityBaseAttrs.PvpHurtAddRatio;
        battleBaseInfo.publicBaseInfo.PvpHurtDeRatio             = EntityWorld.Instance.EntSelf.CityBaseAttrs.PvpHurtDeRatio;
        battleBaseInfo.publicBaseInfo.AtkMulAmend                = EntityWorld.Instance.EntSelf.CityBaseAttrs.AtkMulAmend;
        battleBaseInfo.publicBaseInfo.DefMulAmend                = EntityWorld.Instance.EntSelf.CityBaseAttrs.DefMulAmend;
        battleBaseInfo.publicBaseInfo.HpLmtMulAmend              = EntityWorld.Instance.EntSelf.CityBaseAttrs.HpLmtMulAmend;
        battleBaseInfo.publicBaseInfo.PveAtkMulAmend             = EntityWorld.Instance.EntSelf.CityBaseAttrs.PveAtkMulAmend;
        battleBaseInfo.publicBaseInfo.PvpAtkMulAmend             = EntityWorld.Instance.EntSelf.CityBaseAttrs.PvpAtkMulAmend;
        battleBaseInfo.battleBaseAttr.ActPointLmt                = (int)float.Parse(DataReader <GlobalParams> .Get("actionpoint_limit_i").value);
        battleBaseInfo.publicBaseInfo.ActPointRecoverSpeedAmend  = EntityWorld.Instance.EntSelf.CityBaseAttrs.ActPointRecoverSpeedAmend;
        battleBaseInfo.publicBaseInfo.VpLmt                      = EntityWorld.Instance.EntSelf.CityBaseAttrs.VpLmt;
        battleBaseInfo.publicBaseInfo.VpLmtMulAmend              = EntityWorld.Instance.EntSelf.CityBaseAttrs.VpLmtMulAmend;
        battleBaseInfo.publicBaseInfo.VpAtk                      = EntityWorld.Instance.EntSelf.CityBaseAttrs.VpAtk;
        battleBaseInfo.publicBaseInfo.VpAtkMulAmend              = EntityWorld.Instance.EntSelf.CityBaseAttrs.VpAtkMulAmend;
        battleBaseInfo.publicBaseInfo.VpResume                   = EntityWorld.Instance.EntSelf.CityBaseAttrs.VpResume;
        battleBaseInfo.publicBaseInfo.IdleVpResume               = EntityWorld.Instance.EntSelf.CityBaseAttrs.IdleVpResume;
        battleBaseInfo.publicBaseInfo.WaterBuffAddProbAddAmend   = EntityWorld.Instance.EntSelf.CityBaseAttrs.WaterBuffAddProbAddAmend;
        battleBaseInfo.publicBaseInfo.WaterBuffDurTimeAddAmend   = EntityWorld.Instance.EntSelf.CityBaseAttrs.WaterBuffDurTimeAddAmend;
        battleBaseInfo.publicBaseInfo.ThunderBuffAddProbAddAmend = EntityWorld.Instance.EntSelf.CityBaseAttrs.ThunderBuffAddProbAddAmend;
        battleBaseInfo.publicBaseInfo.ThunderBuffDurTimeAddAmend = EntityWorld.Instance.EntSelf.CityBaseAttrs.ThunderBuffDurTimeAddAmend;
        battleBaseInfo.publicBaseInfo.HealIncreasePercent        = EntityWorld.Instance.EntSelf.CityBaseAttrs.HealIncreasePercent;
        battleBaseInfo.publicBaseInfo.CritAddValue               = EntityWorld.Instance.EntSelf.CityBaseAttrs.CritAddValue;
        battleBaseInfo.publicBaseInfo.HpRestore                  = EntityWorld.Instance.EntSelf.CityBaseAttrs.HpRestore;
        battleBaseInfo.battleBaseAttr.BuffMoveSpeedMulPosAmend   = 0;
        battleBaseInfo.battleBaseAttr.BuffActSpeedMulPosAmend    = 0;
        battleBaseInfo.battleBaseAttr.SkillTreatScaleBOAtk       = 0;
        battleBaseInfo.battleBaseAttr.SkillTreatScaleBOHpLmt     = 0;
        battleBaseInfo.battleBaseAttr.SkillNmlDmgScale           = 0;
        battleBaseInfo.battleBaseAttr.SkillNmlDmgAddAmend        = 0;
        battleBaseInfo.battleBaseAttr.SkillHolyDmgScaleBOMaxHp   = 0;
        battleBaseInfo.battleBaseAttr.SkillHolyDmgScaleBOCurHp   = 0;
        battleBaseInfo.battleBaseAttr.Affinity                   = 0;
        battleBaseInfo.battleBaseAttr.OnlineTime                 = 0;
        int num = instanceData.actionPoint + SkillDataManager.Instance.GetSkillProInitActPoint() + EntityWorld.Instance.EntSelf.TotalBeginActPoint;

        battleBaseInfo.battleBaseAttr.ActPoint = ((num <= battleBaseInfo.battleBaseAttr.ActPointLmt) ? num : battleBaseInfo.battleBaseAttr.ActPointLmt);
        battleBaseInfo.battleBaseAttr.Hp       = (long)((double)battleBaseInfo.publicBaseInfo.HpLmt * (1.0 + (double)battleBaseInfo.publicBaseInfo.HpLmtMulAmend * 0.001));
        battleBaseInfo.battleBaseAttr.Vp       = (int)((double)battleBaseInfo.publicBaseInfo.VpLmt * (1.0 + (double)battleBaseInfo.publicBaseInfo.VpLmtMulAmend * 0.001));
        battleBaseInfo.ownedListIdx            = 0;
        List <PetInfo> list;

        if (trialPetInfos == null)
        {
            list = PetManager.Instance.GetPetBattleInfo(instanceType);
        }
        else
        {
            list = trialPetInfos;
        }
        int num2 = 0;

        for (int i = 0; i < list.get_Count(); i++)
        {
            if (DataReader <Pet> .Get(list.get_Item(i).petId) != null)
            {
                battleBaseInfo.ownedIds.Add(list.get_Item(i).id);
                BattleSkillInfo summonSkillInfo = PetManager.Instance.GetSummonSkillInfo(list.get_Item(i), num2);
                if (summonSkillInfo != null)
                {
                    battleBaseInfo.skills.Add(summonSkillInfo);
                }
                num2++;
            }
        }
        battleBaseInfo.finalOwnerId = 0L;
        for (int j = 0; j < instanceData.beginSkill.get_Count(); j++)
        {
            battleBaseInfo.skills.Add(new BattleSkillInfo
            {
                skillId  = instanceData.beginSkill.get_Item(j),
                skillIdx = 0,
                skillLv  = 1
            });
        }
        SkillDataManager.Instance.ConstructBattleSkillInfo(battleBaseInfo.skills, trialSkillInfos, battleBaseInfo.skillExs);
        battleBaseInfo.isFit              = false;
        battleBaseInfo.isInFit            = false;
        battleBaseInfo.isFighting         = true;
        battleBaseInfo.isFixed            = false;
        battleBaseInfo.isStatic           = false;
        battleBaseInfo.isTaunt            = false;
        battleBaseInfo.isSuperArmor       = false;
        battleBaseInfo.isIgnoreDmgFormula = false;
        battleBaseInfo.isCloseRenderer    = false;
        battleBaseInfo.isMoveCast         = false;
        battleBaseInfo.isKnocking         = false;
        battleBaseInfo.isSuspended        = false;
        battleBaseInfo.isStun             = false;
        battleBaseInfo.isBoss             = false;
        return(battleBaseInfo);
    }
示例#11
0
    public static MapObjInfo CreateSelfMapObjInfo(int instanceType, int instanceDataID, int sceneID, int trailType = 0, int trailModel = 0, MapObjDecorations trialDecorations = null, List <PetInfo> trialPetInfos = null, List <BattleSkillInfo> trialSkillInfos = null)
    {
        FuBenJiChuPeiZhi fuBenJiChuPeiZhi = DataReader <FuBenJiChuPeiZhi> .Get(instanceDataID);

        MapObjInfo mapObjInfo = new MapObjInfo();

        mapObjInfo.objType = GameObjectType.ENUM.Role;
        mapObjInfo.id      = EntityWorld.Instance.EntSelf.ID;
        mapObjInfo.ownerId = EntityWorld.Instance.EntSelf.OwnerID;
        if (trailType == 0)
        {
            mapObjInfo.typeId = EntityWorld.Instance.EntSelf.TypeID;
        }
        else
        {
            mapObjInfo.typeId = trailType;
        }
        if (trailModel == 0)
        {
            mapObjInfo.modelId = EntityWorld.Instance.EntSelf.ModelID;
        }
        else
        {
            mapObjInfo.modelId = trailModel;
        }
        mapObjInfo.name      = EntityWorld.Instance.EntSelf.Name;
        mapObjInfo.rankValue = EntityWorld.Instance.EntSelf.TypeRank;
        Vector2 point = MapDataManager.Instance.GetPoint(sceneID, fuBenJiChuPeiZhi.pointId);

        string[] array = DataReader <Scene> .Get(sceneID).LockLookPoint.Split(new char[]
        {
            ';'
        });

        Vector2 vector = new Vector2(float.Parse(array[0]), float.Parse(array[1]));

        mapObjInfo.pos         = new Pos();
        mapObjInfo.pos.x       = point.x;
        mapObjInfo.pos.y       = point.y;
        mapObjInfo.vector      = new Vector2();
        mapObjInfo.vector.x    = (vector - point).get_normalized().x;
        mapObjInfo.vector.y    = (vector - point).get_normalized().y;
        mapObjInfo.mapLayer    = 0;
        mapObjInfo.decorations = new MapObjDecorations();
        if (trialDecorations == null)
        {
            mapObjInfo.decorations.career  = EntityWorld.Instance.EntSelf.Decorations.career;
            mapObjInfo.decorations.modelId = EntityWorld.Instance.EntSelf.Decorations.modelId;
            mapObjInfo.decorations.equipIds.Clear();
            if (EntityWorld.Instance.EntSelf.Decorations.equipIds != null)
            {
                mapObjInfo.decorations.equipIds.AddRange(EntityWorld.Instance.EntSelf.Decorations.equipIds);
            }
            mapObjInfo.decorations.petUUId    = EntityWorld.Instance.EntSelf.Decorations.petUUId;
            mapObjInfo.decorations.petId      = EntityWorld.Instance.EntSelf.Decorations.petId;
            mapObjInfo.decorations.petStar    = EntityWorld.Instance.EntSelf.Decorations.petStar;
            mapObjInfo.decorations.wingId     = EntityWorld.Instance.EntSelf.Decorations.wingId;
            mapObjInfo.decorations.wingLv     = EntityWorld.Instance.EntSelf.Decorations.wingLv;
            mapObjInfo.decorations.wingHidden = EntityWorld.Instance.EntSelf.Decorations.wingHidden;
            mapObjInfo.decorations.fashions.Clear();
            if (EntityWorld.Instance.EntSelf.Decorations.fashions != null)
            {
                mapObjInfo.decorations.fashions.AddRange(EntityWorld.Instance.EntSelf.Decorations.fashions);
            }
        }
        else
        {
            mapObjInfo.decorations.career  = trialDecorations.career;
            mapObjInfo.decorations.modelId = trialDecorations.modelId;
            mapObjInfo.decorations.equipIds.Clear();
            if (trialDecorations.equipIds != null)
            {
                mapObjInfo.decorations.equipIds.AddRange(trialDecorations.equipIds);
            }
            mapObjInfo.decorations.petUUId    = trialDecorations.petUUId;
            mapObjInfo.decorations.petId      = trialDecorations.petId;
            mapObjInfo.decorations.petStar    = trialDecorations.petStar;
            mapObjInfo.decorations.wingId     = trialDecorations.wingId;
            mapObjInfo.decorations.wingLv     = trialDecorations.wingLv;
            mapObjInfo.decorations.wingHidden = trialDecorations.wingHidden;
            mapObjInfo.decorations.fashions.Clear();
            if (trialDecorations.fashions != null)
            {
                mapObjInfo.decorations.fashions.AddRange(trialDecorations.fashions);
            }
        }
        mapObjInfo.battleInfo = LocalDimensionSelfInfoCreator.CreateSelfBattleBaseInfo(instanceType, fuBenJiChuPeiZhi, trialPetInfos, trialSkillInfos);
        return(mapObjInfo);
    }
示例#12
0
    private void RefreshInstanceItems(int chapter, DungeonType.ENUM dungeonType)
    {
        this.ResetItems();
        ChapterInfo        chapterInfo = this.listData.get_Item(chapter - 1);
        List <DungeonInfo> list        = new List <DungeonInfo>();

        list.AddRange(chapterInfo.dungeons);
        for (int i = 0; i < list.get_Count(); i++)
        {
            int num = i;
            for (int j = i + 1; j < list.get_Count(); j++)
            {
                DungeonInfo   dungeonInfo   = list.get_Item(num);
                ZhuXianPeiZhi zhuXianPeiZhi = DataReader <ZhuXianPeiZhi> .Get(dungeonInfo.dungeonId);

                if (zhuXianPeiZhi == null)
                {
                    Debug.LogError("GameData.InstanceConfigure no key = " + dungeonInfo.dungeonId);
                }
                else
                {
                    DungeonInfo   dungeonInfo2   = list.get_Item(j);
                    ZhuXianPeiZhi zhuXianPeiZhi2 = DataReader <ZhuXianPeiZhi> .Get(dungeonInfo2.dungeonId);

                    if (zhuXianPeiZhi2 == null)
                    {
                        Debug.LogError("GameData.InstanceConfigure no key = " + dungeonInfo2.dungeonId);
                    }
                    else if (zhuXianPeiZhi.instance > zhuXianPeiZhi2.instance)
                    {
                        num = j;
                    }
                }
            }
            if (num != i)
            {
                XUtility.ListExchange <DungeonInfo>(list, i, num);
            }
        }
        for (int k = 0; k < list.get_Count(); k++)
        {
            DungeonInfo di = list.get_Item(k);
            if (k == 0)
            {
                FuBenJiChuPeiZhi icTmp = DataReader <FuBenJiChuPeiZhi> .Get(di.dungeonId);

                ZhuXianZhangJiePeiZhi zhuXianZhangJiePeiZhi = DataReader <ZhuXianZhangJiePeiZhi> .DataList.Find((ZhuXianZhangJiePeiZhi a) => a.chapterType == icTmp.type && a.chapterOrder == DataReader <ZhuXianZhangJiePeiZhi> .Get(DataReader <ZhuXianPeiZhi> .Get(di.dungeonId).chapterId).chapterOrder);

                string   chineseContent = GameDataUtils.GetChineseContent(zhuXianZhangJiePeiZhi.chapterName, false);
                string[] array          = chineseContent.Split(new char[]
                {
                    ' '
                });
                this.TextChapterTitle.set_text(array[1] + "<size=25>(" + array[0] + ")</size>");
            }
            ZhuXianPeiZhi zhuXianPeiZhi3 = DataReader <ZhuXianPeiZhi> .Get(di.dungeonId);

            InstancesLayoutItem component;
            if (zhuXianPeiZhi3.bossInstanceBoss == 1)
            {
                GameObject boss = this.GetBoss();
                component = boss.GetComponent <InstancesLayoutItem>();
                boss.get_transform().SetParent(this.InstancesLayout);
                boss.GetComponent <RectTransform>().set_localScale(Vector3.get_one());
                boss.set_name(di.dungeonId.ToString());
            }
            else
            {
                GameObject normal = this.GetNormal();
                component = normal.GetComponent <InstancesLayoutItem>();
                normal.get_transform().SetParent(this.InstancesLayout);
                normal.GetComponent <RectTransform>().set_localScale(Vector3.get_one());
                normal.set_name(di.dungeonId.ToString());
            }
            component.GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClcikInstancesLayoutItem);
            this.listInstanceItem.Add(component);
            bool isLock = (bool)DungeonManager.Instance.CheckLock(di.dungeonId).get_Item("ISLock");
            component.RefreshUI(DataReader <FuBenJiChuPeiZhi> .Get(di.dungeonId), isLock, k, di.star);
        }
    }
示例#13
0
    public void RefreshUI(FuBenJiChuPeiZhi ic, bool isLock, int instanceIndex, int starNum)
    {
        this.instanceID = ic.id;
        string iconName = GameDataUtils.GetIconName(DataReader <ZhuXianPeiZhi> .Get(this.instanceID).icon);

        ResourceManager.SetSprite(this.ImageIcon1, ResourceManager.GetIconSprite(iconName));
        ResourceManager.SetSprite(this.ImageIcon2, ResourceManager.GetIconSprite(iconName));
        this.Text1.set_text(GameDataUtils.GetChineseContent(505085, false) + (instanceIndex + 1).ToString());
        this.Text2.set_text(GameDataUtils.GetChineseContent(505085, false) + (instanceIndex + 1).ToString());
        if (isLock)
        {
            this.Image1.get_gameObject().SetActive(true);
            this.Image2.get_gameObject().SetActive(false);
            this.Text1.get_gameObject().SetActive(true);
            this.Text2.get_gameObject().SetActive(false);
            this.Stars.get_gameObject().SetActive(false);
            this.ImageQue.get_gameObject().SetActive(true);
            this.ImageIcon1.get_gameObject().SetActive(true);
            this.ImageIcon2.get_gameObject().SetActive(false);
        }
        else
        {
            this.Image1.get_gameObject().SetActive(false);
            this.Image2.get_gameObject().SetActive(true);
            this.Text1.get_gameObject().SetActive(false);
            this.Text2.get_gameObject().SetActive(true);
            if (ic.type == 103)
            {
                this.Stars.get_gameObject().SetActive(false);
            }
            else
            {
                this.Stars.get_gameObject().SetActive(true);
            }
            this.ImageQue.get_gameObject().SetActive(false);
            this.ImageIcon1.get_gameObject().SetActive(false);
            this.ImageIcon2.get_gameObject().SetActive(true);
            if (starNum == 0)
            {
                this.ImageStar1_2.get_gameObject().SetActive(false);
                this.ImageStar2_2.get_gameObject().SetActive(false);
                this.ImageStar3_2.get_gameObject().SetActive(false);
            }
            else if (starNum == 1)
            {
                this.ImageStar1_2.get_gameObject().SetActive(true);
                this.ImageStar2_2.get_gameObject().SetActive(false);
                this.ImageStar3_2.get_gameObject().SetActive(false);
            }
            else if (starNum == 2)
            {
                this.ImageStar1_2.get_gameObject().SetActive(true);
                this.ImageStar2_2.get_gameObject().SetActive(true);
                this.ImageStar3_2.get_gameObject().SetActive(false);
            }
            else if (starNum == 3)
            {
                this.ImageStar1_2.get_gameObject().SetActive(true);
                this.ImageStar2_2.get_gameObject().SetActive(true);
                this.ImageStar3_2.get_gameObject().SetActive(true);
            }
        }
    }