public void playSkillAction(uint sid, string eff = null, LGAvatarGameInst to_lc = null)
        {
            bool destroy = base.destroy;

            if (!destroy)
            {
                this._isCastingSkill = true;
                this._curCastingTm   = (float)this.g_mgr.g_netM.CurServerTimeStampMS;
                bool flag = base.IsMoving();
                if (flag)
                {
                    base.stop();
                }
                bool flag2 = to_lc != null;
                if (flag2)
                {
                    bool flag3 = to_lc != this;
                    if (flag3)
                    {
                        base.RotationToPt(to_lc.x, to_lc.y);
                    }
                }
                Variant data = this.data;
                base.play_animation(string.Concat(sid), 1);
                bool flag4 = eff != null;
                if (flag4)
                {
                    MapEffMgr.getInstance().play(eff, this.pGameobject.transform, 450f - this.lg_ori_angle, 0f);
                }
            }
        }
        protected override void playAttackAni(bool criatk = false)
        {
            base.playAttackAni(criatk);

            Variant mon = MonsterConfig.instance.getMonster(viewInfo["mid"]);

            if (mon.ContainsKey("atk_effect"))
            {
                MapEffMgr.getInstance().play(mon["atk_effect"], pGameobject.transform, 450f - lg_ori_angle, 0f);
            }

            //Variant attConf = localGeneral.getMonAttSound(viewInfo["mid"]._str);
            //if (attConf == null)
            //{
            //    attConf = localGeneral.getMonAttSound("normal");
            //}

            //if (attConf != null)
            //{
            //    this.g_mgr.g_uiM.dispatchEvent(
            //        GameEvent.Create(GAME_EVENT.LG_MEDIA_PLAY, this,
            //        GameTools.createGroup("sid", attConf["sid"]._str, "loop", false))
            //        );
            //}
        }
        public void jump(SkillXmlData jumpDta, LGAvatarGameInst to_lc)
        {
            base.stop();
            base.RotationToPt(to_lc.x, to_lc.y);
            Transform transform = to_lc.gameObj.transform;

            this.pGameobject.transform.position = transform.position;
            this.setPos(to_lc.x, to_lc.y);
            Vector3 position  = this.gameObj.transform.position;
            Vector3 position2 = transform.position;
            float   num       = Vector3.Distance(position, position2);
            Vector3 end       = Vector3.Lerp(position, position2, (float)((double)num - 1.5) / num);
            bool    flag      = jumpDta.jump_canying != "null";

            if (flag)
            {
                MapEffMgr.getInstance().playMoveto(jumpDta.jump_canying, position, end, 0.4f);
            }
            bool flag2 = jumpDta.eff != "null";

            if (flag2)
            {
                MapEffMgr.getInstance().play(jumpDta.eff, transform.position, transform.rotation, 0f, null);
            }
        }
Beispiel #4
0
        public void onHurt(Variant d)
        {
            Vector3 headPos = this.getHeadPos();
            bool    flag    = d.ContainsKey("ft");

            if (flag)
            {
                bool flag2 = d.ContainsKey("criatk");
                if (flag2)
                {
                    FightText.play(d["ft"], headPos, d["dmg"], d["criatk"], -1);
                }
                else
                {
                    FightText.play(d["ft"], headPos, d["dmg"], false, -1);
                }
            }
            bool flag3 = d.ContainsKey("hurteff");

            if (flag3)
            {
                bool flag4 = this.middleoffset == Vector3.zero;
                if (flag4)
                {
                    this.middleoffset = new Vector3(0f, this.m_char.chaHeight * 0.5f, 0f);
                }
                bool flag5 = this.pTrans == null;
                if (!flag5)
                {
                    bool flag6 = !this.lgAvatar.IsDie() && !this.lgAvatar.m_bSinging;
                    if (flag6)
                    {
                        bool flag7 = this.m_char.curAnimName == "idle" || this.m_char.curAnimName == "run" || this.m_char.curAnimName == "hurt";
                        if (flag7)
                        {
                            this.setAni("hurt", 1);
                        }
                    }
                    uint id    = 1001u;
                    bool flag8 = d.ContainsKey("skill_id");
                    if (flag8)
                    {
                        id = d["skill_id"];
                    }
                    SkillHitedXml hitxml = ModelBase <SkillModel> .getInstance().getSkillXml(id).hitxml;

                    bool flag9 = hitxml != null;
                    if (flag9)
                    {
                        this.m_char.setMtlColor(gameST.HIT_Rim_Color_nameID, hitxml.rimColor);
                        this.m_char.setMtlColor(gameST.HIT_Main_Color_nameID, hitxml.mainColor);
                        this.m_bhitFlashGoUp = true;
                        this.m_bDoHitFlash   = true;
                    }
                    MapEffMgr.getInstance().play("hurt", this.pTrans.position + this.middleoffset, this.pTrans.eulerAngles, 0f);
                }
            }
        }
Beispiel #5
0
        protected override void playAttackAni(bool criatk = false)
        {
            base.playAttackAni(criatk);
            Variant monster = MonsterConfig.instance.getMonster(this.viewInfo["mid"]);
            bool    flag    = monster.ContainsKey("atk_effect");

            if (flag)
            {
                MapEffMgr.getInstance().play(monster["atk_effect"], base.pGameobject.transform, 450f - this.lg_ori_angle, 0f);
            }
        }
 protected override void onDispose()
 {
     this.grLoadedhandle = null;
     this.dCacheEffect.Clear();
     foreach (string current in this.dEffing.Keys)
     {
         MapEffMgr.getInstance().removeEffItem(current);
     }
     this.dEffing.Clear();
     base.onDispose();
 }
        public void removeEffect(string id)
        {
            bool flag = this.data == null;

            if (!flag)
            {
                string text = this.data["iid"]._str + id;
                this.dEffing.Remove(text);
                MapEffMgr.getInstance().removeEffItem(text);
            }
        }
Beispiel #8
0
        public void playSong(uint skillid)
        {
            bool flag = this.pTrans == null;

            if (!flag)
            {
                SkillXmlData skillXml = ModelBase <SkillModel> .getInstance().getSkillXml(skillid);

                MapEffMgr.getInstance().play(skillXml.eff + "_song", this.pTrans, UnityEngine.Random.Range(0f, 359f), 0f);
            }
        }
Beispiel #9
0
        public void doSkillPreload()
        {
            Dictionary <uint, SkillData> skillDatas = ModelBase <SkillModel> .getInstance().skillDatas;

            foreach (SkillData current in skillDatas.Values)
            {
                bool flag = this.dSkillPreload.ContainsKey(current.id);
                if (!flag)
                {
                    this.dSkillPreload[current.id] = 1;
                    base.play_animation(current.id.ToString(), 1);
                    bool flag2 = current.eff != "null";
                    if (flag2)
                    {
                        MapEffMgr.getInstance().play(current.eff, Vector3.zero, Vector3.zero, 0.1f);
                    }
                }
            }
        }
Beispiel #10
0
        public void jump(SkillXmlData jumpDta, float tx, float ty)
        {
            base.stop();
            Vector3 position = this.gameObj.transform.position;
            Vector3 vector   = new Vector3(tx / 53.333f, GRClient.instance.getZ(tx, ty), ty / 53.333f);
            float   num      = Vector3.Distance(position, vector);
            Vector3 end      = Vector3.Lerp(position, vector, (float)((double)num - 1.5) / num);
            bool    flag     = jumpDta.jump_canying != "null";

            if (flag)
            {
                MapEffMgr.getInstance().playMoveto(jumpDta.jump_canying, position, end, 0.4f);
            }
            bool flag2 = jumpDta.eff != "null";

            if (flag2)
            {
                MapEffMgr.getInstance().play(jumpDta.eff, vector, this.gameObj.transform.rotation, 0f, null);
            }
            this.setPos(tx, ty);
        }
Beispiel #11
0
        public void playDrop_jinbi_fx()
        {
            bool flag = this.m_char != null && this.m_char.gameObject != null;

            if (flag)
            {
                Transform transform = this.m_char.gameObject.transform;
                bool      flag2     = transform.childCount > 0;
                if (flag2)
                {
                    Transform child = transform.GetChild(0);
                    bool      flag3 = child.childCount > 0;
                    if (flag3)
                    {
                        Transform child2 = child.GetChild(0);
                        Vector3   pos    = child2.localToWorldMatrix.MultiplyPoint(Vector3.zero);
                        MapEffMgr.getInstance().play("drop_jinbin", pos, Quaternion.identity, 0f, null);
                    }
                }
            }
        }
Beispiel #12
0
        //protected override void onClick(GameEvent e)
        //{
        //    base.onClick(e);
        //    GameTools.PrintNotice("monster click mid[" + getMid() + "] iid[" + getIid() + "]!");
        //    selfPlayer.onSelectMonster(this);
        //}

        protected override void playAttackAni(bool criatk = false)
        {
            //   return;

            //   debug.Log(":::" + m_ani);
            if (m_ani == "run" || m_ani == "idle")
            {
                base.playAttackAni(criatk);
                Variant mon = MonsterConfig.instance.getMonster(viewInfo["mid"]._str);
                if (mon.ContainsKey("atk_effect"))
                {
                    MapEffMgr.getInstance().play(mon["atk_effect"], pGameobject.transform, 450f - lg_ori_angle, 0f);
                }
            }


            //if (attConf != null)
            //{
            //    this.g_mgr.g_uiM.dispatchEvent(
            //        GameEvent.Create(GAME_EVENT.LG_MEDIA_PLAY, this,
            //        GameTools.createGroup("sid", attConf["sid"]._str, "loop", false))
            //        );
            //}
        }
Beispiel #13
0
        public void addEffect(string id, string eff, bool needCache = false)
        {
            bool destroy = base.destroy;

            if (!destroy)
            {
                bool flag = this.grAvatar != null && this.grAvatar.inited && this.data != null;
                if (flag)
                {
                    string     text       = this.data["iid"]._str + id;
                    EffectItem effectItem = MapEffMgr.getInstance().addEffItem(text, eff, MapEffMgr.TYPE_AUTO, this.pGameobject.transform);
                    effectItem.scale = this.grAvatar.m_char.scale.x;
                    bool flag2 = !effectItem.isAutoRemove;
                    if (flag2)
                    {
                        this.dEffing[text] = 1;
                    }
                }
                else if (needCache)
                {
                    this.dCacheEffect[id] = eff;
                }
            }
        }