Пример #1
0
        public void OpenLev(GCPushLevelOpen open)
        {
            var levId = open.Chapter * 100 + open.Level;

            bool find = false;

            foreach (var c in copyInfo.CopyInfoList)
            {
                if (c.Id == levId)
                {
                    c.IsPass = true;
                    find     = true;
                    break;
                }
                else if (c.Id < levId)
                {
                    c.IsPass = true;
                }
            }

            if (!find)
            {
                var nc = new CopyInfo();
                nc.Id     = levId;
                nc.IsPass = true;
                copyInfo.CopyInfoList.Add(nc);
            }
            MyEventSystem.PushEventStatic(MyEvent.EventType.UpdateCopy);
        }
Пример #2
0
        //TODO: 单人副本中需要判断是否升级以及升级相关处理
        public void ChangeExp(int e)
        {
            Exp += e;
            var maxExp = _ObjUnitData.MaxExp;

            if (Exp >= maxExp)
            {
                LevelUp();
            }
            else
            {
                if (IsMine())
                {
                    var sync = CGAddProp.CreateBuilder();
                    sync.Key   = (int)CharAttribute.CharAttributeEnum.EXP;
                    sync.Value = e;
                    KBEngine.Bundle.sendImmediate(sync);
                }
            }

            var evt = new MyEvent(MyEvent.EventType.UpdatePlayerData);

            evt.localID = GetLocalId();
            MyEventSystem.myEventSystem.PushEvent(evt);
            if (IsMine())
            {
                MyEventSystem.PushEventStatic(MyEvent.EventType.UpdatePlayerData);
            }
        }
Пример #3
0
        /// <summary>
        /// 穿上装备
        /// </summary>
        /// <param name="result">Result.</param>
        void UseEquipNetworkResp(GCUserDressEquip result)
        {
            Log.Net("UseEquipNetworkResp " + result);
            if (oldEquip != null)
            {
                PopEquipData(equipSlot);
            }
            var ed = new EquipData(result.DressEquip);

            EquipmentData.Add(ed);

            if (result.HasPackEquip)
            {
                var newBagItem = new BackpackData(result.PackEquip);
                PutItemInBackpackIndex(newBagItem);
            }
            MyEventSystem.PushEventStatic(MyEvent.EventType.UpdateItemCoffer);

            //更新角色属性面板的装备信息
            //以及角色本身的装备信息
            var evt = new MyEvent(MyEvent.EventType.CharEquipChanged);

            evt.localID   = ObjectManager.objectManager.GetMyLocalId();
            evt.equipData = ed;
            evt.boolArg   = true;
            MyEventSystem.myEventSystem.PushEvent(evt);

            //通知角色属性面板 更新UI上面的icon
            evt = new MyEvent(MyEvent.EventType.RefreshEquip);
            MyEventSystem.myEventSystem.PushEvent(evt);
        }
Пример #4
0
        void OnLevelUp()
        {
            if (equipData != null)
            {
                var lev       = equipData.entry.Level;
                var needLevel = GMDataBaseSystem.SearchIdStatic <EquipLevelData>(GameData.EquipLevel, lev);
                var myLev     = ObjectManager.objectManager.GetMyAttr().Level;
                if (needLevel.level > myLev)
                {
                    WindowMng.windowMng.ShowNotifyLog(string.Format("只有自身达到{0}级,才能掌控更高级装备", needLevel.level));
                    return;
                }

                var lv = WindowMng.windowMng.PushView("UI/LevelUpEquip");
                var eq = lv.GetComponent <LevelUpEquip>();
                eq.SetEquip(equipData);
            }
            else
            {
                var lv  = WindowMng.windowMng.PushView("UI/LevelUpGem");
                var gem = lv.GetComponent <LevelUpGem>();
                gem.SetData(backpackData);
                MyEventSystem.PushEventStatic(MyEvent.EventType.UpdateItemCoffer);
            }
        }
Пример #5
0
 public void SetExp(int e)
 {
     Exp = e;
     if (IsMine())
     {
         MyEventSystem.PushEventStatic(MyEvent.EventType.UpdatePlayerData);
     }
 }
Пример #6
0
 public void ActivateSkill(GCPushActivateSkill skill)
 {
     foreach (var a in activeSkill)
     {
         if (a.skillId == skill.SkillId)
         {
             a.SetLevel(skill.Level);
             break;
         }
     }
     MyEventSystem.PushEventStatic(MyEvent.EventType.UpdateSkill);
 }
Пример #7
0
        IEnumerator NormalBoss()
        {
            while (!bossSpawn)
            {
                yield return(new WaitForSeconds(1));
            }
            MyEventSystem.PushEventStatic(MyEvent.EventType.SpeakOver);

            while (!bossDead)
            {
                yield return(new WaitForSeconds(2));
            }
            BattleManager.battleManager.GameOver();
        }
Пример #8
0
        /// <summary>
        /// 装备宝石升级成功
        /// </summary>
        /// <param name="update">Update.</param>
        public void EquipDataUpdate(GCPushEquipDataUpdate update)
        {
            int c = 0;

            foreach (var b in EquipmentData)
            {
                if (b.id == update.PackInfo.PackEntry.Id)
                {
                    EquipmentData.RemoveAt(c);
                    break;
                }
                c++;
            }
            EquipmentData.Add(new EquipData(update.PackInfo));
            MyEventSystem.PushEventStatic(MyEvent.EventType.UpdateItemCoffer);
        }
Пример #9
0
        void OnInfo(GameObject g)
        {
            Log.GUI("OnInfo " + gameObject + " cb " + cb);
            if (cb != null)
            {
                cb();
            }
            else
            {
                if (equipData != null)
                {
                    Log.GUI("ShowDetailForEquip " + equipData.itemData.ItemName);
                }
                var win    = WindowMng.windowMng.PushView("UI/DetailInfo");
                var detail = win.GetComponent <DetailInfo>();
                detail.SetEquip(equipData);
                detail.backpackData = backpack;

                MyEventSystem.PushEventStatic(MyEvent.EventType.UpdateDetailUI);
            }
        }
Пример #10
0
        IEnumerator CreateZhiRuo()
        {
            GameObject myplayer = null;

            while (myplayer == null)
            {
                yield return(new WaitForSeconds(1));

                myplayer = ObjectManager.objectManager.GetMyPlayer();
            }

            var myp = new GameObject("TempNpcPos");

            yield return(new WaitForSeconds(1));

            myp.transform.position = myplayer.transform.position + new Vector3(Random.Range(-3.0f, 3.0f), 0.2f, Random.Range(-3.0f, 3.0f));
            ObjectManager.objectManager.CreateNpc(Util.GetNpcData(20008), myp);

            string[] text = new string[] {
                "至若:哥哥,这里真的有苍冥水么",
                "我也不知道,咱们先看看吧",
            };
            NpcDialogInterface.ShowTextList(text, null);

            yield return(StartCoroutine(eh.WaitEvt(MyEvent.EventType.EnterNextZone)));

            text = new string[] {
                "至若:为何寻了半天也没见苍冥水的踪迹?",
                "难道因为魔神苏醒,连苍冥水也被毁掉了?",
                "至若:若是如此那可怎么办?",
                "现在也只能走一步看一步了",
            };
            NpcDialogInterface.ShowTextList(text, null);

            yield return(StartCoroutine(eh.WaitEvt(MyEvent.EventType.BossSpawn)));

            var sover = false;

            text = new string[] {
                "wu.......",
                "至若:这是什么声音?",
                "至若小心。",
            };
            NpcDialogInterface.ShowTextList(text, () => sover = true);
            while (!sover)
            {
                yield return(null);
            }

            MyEventSystem.PushEventStatic(MyEvent.EventType.SpeakOver);

            yield return(StartCoroutine(eh.WaitEvt(MyEvent.EventType.BossDead)));

            text = new string[] {
                "至若:那闪闪发光的是什么东西?",
                "好像是一个瓶子,有一股清幽之气",
                "至若:先收起来吧,回去问问巨牙子爷爷",
            };

            bool over = false;

            NpcDialogInterface.ShowTextList(text, () => {
                over = true;
            });
            while (!over)
            {
                yield return(null);
            }
            GameInterface_Player.SetIntState(GameBool.cunZhangState, 5);
            yield return(StartCoroutine(eh.WaitEvt(MyEvent.EventType.LevelFinish)));

            text = new string[] {
                "幽冥之中传来一阵笑声,嘿嘿嘿",
            };
            over = false;
            NpcDialogInterface.ShowTextList(text, () => {
                over = true;
            });
            while (!over)
            {
                yield return(null);
            }


            BattleManager.battleManager.GameOver();
        }
Пример #11
0
        IEnumerator CreateZhiRuoAndDongHu()
        {
            this.regEvt = new System.Collections.Generic.List <MyEvent.EventType>()
            {
                MyEvent.EventType.EnterNextZone,
                MyEvent.EventType.BossSpawn,
                MyEvent.EventType.BossDead,
                MyEvent.EventType.LevelFinish,
            };
            RegEvent();


            GameObject myplayer = null;

            while (myplayer == null)
            {
                yield return(new WaitForSeconds(1));

                myplayer = ObjectManager.objectManager.GetMyPlayer();
            }
            var myp = new GameObject("TempNpcPos");

            yield return(new WaitForSeconds(1));

            myp.transform.position = myplayer.transform.position + new Vector3(Random.Range(-3.0f, 3.0f), 0.2f, Random.Range(-3.0f, 3.0f));
            ObjectManager.objectManager.CreateNpc(Util.GetNpcData(20008), myp);
            yield return(new WaitForSeconds(1));

            myp = new GameObject("TempNpcPos");
            myp.transform.position = myplayer.transform.position + new Vector3(Random.Range(-3.0f, 3.0f), 0.2f, Random.Range(-3.0f, 3.0f));
            ObjectManager.objectManager.CreateNpc(Util.GetNpcData(20009), myp);

            string[] text = new string[] {
                "东湖:这里真的好黑呀...",
                "至若:{0}哥哥,我好怕",
                "别怕至若,我会保护你的,跟紧我。",
                "大家和我一起向前走吧",
            };
            var c = 0;

            foreach (var t in text)
            {
                text[c] = string.Format(t, ObjectManager.objectManager.GetMyName());
                c++;
            }
            NpcDialogInterface.ShowTextList(text, null);

            while (!inNextZone)
            {
                yield return(new WaitForSeconds(1));
            }
            inNextZone = false;

            text = new string[] {
                "这里的怪物很多,大家小心\n我感受到前面有强大的气息",
                "至若:{0}哥哥也要小心。"
            };
            c = 0;
            foreach (var t in text)
            {
                text[c] = string.Format(t, ObjectManager.objectManager.GetMyName());
                c++;
            }
            NpcDialogInterface.ShowTextList(text, null);


            while (!inNextZone)
            {
                yield return(new WaitForSeconds(1));
            }
            inNextZone = false;

            text = new string[] {
                "巨牙子爷爷说过这里都只是些魔王子子孙孙,为什么我感觉如此不安?",
                "至若:我也是,空气中的血腥味越来越浓了。",
                "东湖:咱们早点找到宝贝,回去吧。",
                "恩,我们继续前进吧。",
            };
            c = 0;
            foreach (var t in text)
            {
                text[c] = string.Format(t, ObjectManager.objectManager.GetMyName());
                c++;
            }
            NpcDialogInterface.ShowTextList(text, null);


            while (!bossSpawn)
            {
                yield return(new WaitForSeconds(1));
            }

            text = new string[] {
                "???: 愚蠢的人类你们唤醒了我,承受我的怒火吧~~",
                "东湖: 上古魔神的声音,这次死定了",
                "这鬼地方怎么会有上古魔神,大家小心",
                "魔神: 好久没有见到新鲜血肉了,这次就让我吃饱吧,哈哈哈",
            };
            bool sover = false;

            NpcDialogInterface.ShowTextList(text, delegate() {
                sover = true;
            });
            while (!sover)
            {
                yield return(new WaitForSeconds(1));
            }
            MyEventSystem.PushEventStatic(MyEvent.EventType.SpeakOver);

            while (!bossDead)
            {
                yield return(new WaitForSeconds(2));
            }


            text = new string[] {
                "魔神:哈哈你们激怒我了,要不是本王刚刚复活,又怎么会败在你们手上\n本王还会回来的,走之前,送你们一个礼物,哈哈~",
                ".......啊,东湖你没事吧?",
                "东湖: 我...我没事......",
            };
            bool donghuSi = false;

            NpcDialogInterface.ShowTextList(text, delegate() {
                donghuSi = true;
            });
            while (!donghuSi)
            {
                yield return(new WaitForSeconds(1));
            }
            var npc = NpcManager.Instance.GetNpcObj("东湖");
            var att = npc.GetComponent <NpcAttribute>();

            att.ChangeHP(-att.HP_Max);

            text = new string[] {
                "东湖,东湖,醒醒..醒醒...",
                "至若,我们快送东湖回去找村长",
            };
            bool gover = false;

            NpcDialogInterface.ShowTextList(text, delegate(){
                gover = true;
            });
            while (!gover)
            {
                yield return(new WaitForSeconds(1));
            }

            GameInterface_Player.SetIntState(GameBool.cunZhangState, 2);
            BattleManager.battleManager.GameOver();
        }
Пример #12
0
        //Load 主城剧情 如何表现CG 镜头控制 运用
        //加载主城场景
        //跨场景的剧情
        //场景暗下来 主镜头关闭
        IEnumerator StoryProgress()
        {
            yield return(StartCoroutine(NpcDialogInterface.WaitPlayerInit()));

            var text = new string[] {
                "是夜,你独自一人闯入了试炼之地,与此同时, 在村中",
            };

            yield return(StartCoroutine(NpcDialogInterface.WaitHandler(
                                            (cb) => {
                NpcDialogInterface.ShowTextList(text, () => {
                    cb();
                }
                                                );
            })));

            NpcDialogInterface.SetBlackAndStopAI();
            text = new string[] {
                "至若:东湖哥哥,你怎么了,夜里来这里干什么?",
                "东湖:我... 我... 我也不知道怎么了,只觉得胸中热气鼓荡,神不知鬼不觉就来到这里了",
                "至若:你不会魔气未净, 我去找巨牙子爷爷",
                "东湖:我... 我... 嘿嘿,小姑娘,不用去了,本王要借你的至阴之气一用",
                "至若:东湖哥哥你怎么了,为何突然说话声音变了, 东湖哥哥 东湖哥哥 ,东... 湖... 哥..., 我头有点晕...",
                "是夜,一夜无话",
            };
            yield return(StartCoroutine(
                             NpcDialogInterface.WaitHandler((cb) => {
                NpcDialogInterface.ShowTextList(text, () => {
                    cb();
                });
            })
                             ));

            NpcDialogInterface.ResetBlackAndAI();


            text = new string[] {
                "自从那日与魔神交手之后,心中总是有不详预感,不知道现在村子里面怎么样了,等找到父母留下的宝物,就尽快回去了",
            };

            yield return(StartCoroutine(
                             NpcDialogInterface.WaitHandler((cb) => {
                NpcDialogInterface.ShowTextList(text, () => {
                    cb();
                });
            })
                             ));

            yield return(StartCoroutine(eh.WaitEvt(MyEvent.EventType.EnterNextZone)));

            text = new string[] {
                "前方为何散发出幽幽蓝光,难道宝物就在那里",
            };
            yield return(StartCoroutine(
                             NpcDialogInterface.WaitHandler((cb) => {
                NpcDialogInterface.ShowTextList(text, () => {
                    cb();
                });
            })
                             ));

            yield return(StartCoroutine(eh.WaitEvt(MyEvent.EventType.BossSpawn)));

            text = new string[] {
                "???:我被困在这匣子里面整整一千年了,刑木,你怕是早就死了吧哈哈哈",
                "你是何方妖魔,竟敢直呼我先祖的名讳",
                "小娃娃,刚好,我已千年没有进食了,正好吃掉你,解解馋",
            };
            yield return(StartCoroutine(
                             NpcDialogInterface.WaitHandler((cb) => {
                NpcDialogInterface.ShowTextList(text, () => {
                    cb();
                });
            })
                             ));

            MyEventSystem.PushEventStatic(MyEvent.EventType.SpeakOver);

            yield return(StartCoroutine(eh.WaitEvt(MyEvent.EventType.BossDead)));

            text = new string[] {
                "这散落一地的宝石,似乎蕴含着极大的力量,回去问问巨牙子爷爷",
            };

            yield return(StartCoroutine(
                             NpcDialogInterface.WaitHandler((cb) => {
                NpcDialogInterface.ShowTextList(text, () => {
                    cb();
                });
            })
                             ));

            yield return(StartCoroutine(eh.WaitEvt(MyEvent.EventType.LevelFinish)));

            BattleManager.battleManager.GameOver();
            GameInterface_Player.SetIntState(GameBool.cunZhangState, 11);
        }