コード例 #1
0
ファイル: BattleProxy.cs プロジェクト: atom-chen/rongyaojt
        private void on_single_skill_res(Variant msgData)
        {
            debug.Log("UUUUUUU" + msgData.dump());
            uint     @uint = msgData["to_iid"]._uint;
            uint     uint2 = msgData["frm_iid"]._uint;
            BaseRole role  = RoleMgr._instance.getRole(@uint);
            BaseRole role2 = RoleMgr._instance.getRole(uint2);
            bool     flag  = !msgData.ContainsKey("states");

            if (!flag)
            {
                bool flag2 = role != null && role.m_isMain;
                if (flag2)
                {
                    Variant variant = msgData["states"];
                    bool    flag3   = msgData["sid"];
                    if (flag3)
                    {
                        int type = msgData["sid"];
                        FightText.play(FightText.BUFF_TEXT, role.getHeadPos(), 0, false, type);
                    }
                    ModelBase <A3_BuffModel> .getInstance().addBuffList(variant);

                    bool flag4 = variant["id"] == 10000;
                    if (flag4)
                    {
                        BaseProxy <A3_ActiveProxy> .getInstance().dispatchEvent(GameEvent.Create(A3_ActiveProxy.EVENT_ONBLESS, this, variant, false));
                    }
                }
                else
                {
                    ModelBase <A3_BuffModel> .getInstance().addOtherBuff(role, msgData["states"]["id"]);
                }
                bool flag5 = msgData.ContainsKey("states");
                if (flag5)
                {
                    SXML   sXML    = XMLMgr.instance.GetSXML("skill.state", "id==" + msgData["states"]["id"]);
                    string @string = sXML.getString("effect");
                    bool   flag6   = role2 is MonsterRole && (role2 as MonsterRole).issummon && @uint == uint2;
                    if (flag6)
                    {
                        role2.PlaySkill(msgData["sid"]);
                    }
                    bool flag7 = @string != "null";
                    if (flag7)
                    {
                        float      @float     = sXML.getFloat("last");
                        GameObject original   = Resources.Load <GameObject>(@string);
                        GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(original);
                        gameObject.transform.SetParent(role.m_curModel, false);
                        UnityEngine.Object.Destroy(gameObject, @float);
                        bool flag8 = sXML.getFloat("head") > 0f;
                        if (flag8)
                        {
                            gameObject.transform.localPosition = new Vector3(0f, role.headOffset_half.y / 2f + sXML.getFloat("head"), 0f);
                        }
                    }
                }
            }
        }
コード例 #2
0
        public void PickUpItem()
        {
            if (NetClient.instance == null)
            {
                dispose();
                return;
            }

            long curMs = NetClient.instance.CurServerTimeStampMS;

            if (curMs < cantGetTimer)
            {
                return;
            }

            if (NetClient.instance != null)
            {
                if (curMs - itemdta.initedTimer < 100)
                {
                    return;
                }
            }

            if (isFake)
            {
                FightText.play(FightText.MONEY_TEXT, SelfRole._inst.getHeadPos(), itemdta.count);
                dispose();
            }
            else
            {
                //int timer = NetClient.instance.CurServerTimeStamp;
                //if (timer - lastGetTimer < 3)
                //    return;
                //lastGetTimer = timer;
                //BaseRoomItem.instance.removeDropItm(itemdta.dpid);

                if (SelfRole.fsm.Autofighting &&
                    !AutoPlayModel.getInstance().WillPick((uint)itemdta.tpid))
                {
                    return;
                }
                if (a3_BagModel.getInstance().curi <= a3_BagModel.getInstance().getItems().Count&& (
                        a3_BagModel.getInstance().getItemNumByTpid((uint)itemdta.tpid) == 0 ||
                        a3_BagModel.getInstance().getItemNumByTpid((uint)itemdta.tpid) >= a3_BagModel.getInstance().getItemDataById((uint)itemdta.tpid).maxnum) &&
                    itemdta.tpid != 0)
                {
                    flytxt.instance.fly(ContMgr.getCont("BagProxy_noplace"));
                    return;
                }
                if (itemdta.ownerId == PlayerModel.getInstance().cid || itemdta.ownerId == 0)
                {
                    if (!A3_RollModel.getInstance().rollMapping.ContainsKey(itemdta.dpid))
                    {
                        BaseRoomItem.instance.removeDropItm(itemdta.dpid, false);
                    }
                }

                MapProxy.getInstance().sendPickUpItem(itemdta.dpid);
            }
        }
コード例 #3
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);
                }
            }
        }
コード例 #4
0
        public void OnTriggerEnter(Collider other)
        {
            int layer = EnumLayer.LM_SELFROLE;

            if (other.gameObject.layer == layer)
            {
                FightText.play(FightText.MONEY_TEXT, SelfRole._inst.getHeadPos(), 10);
                Destroy(gameObject);
            }
        }
コード例 #5
0
ファイル: RoomDropItem.cs プロジェクト: atom-chen/rongyaojt
        public void OnTriggerEnter(Collider other)
        {
            int  lM_SELFROLE = EnumLayer.LM_SELFROLE;
            bool flag        = other.gameObject.layer == lM_SELFROLE;

            if (flag)
            {
                FightText.play(FightText.MONEY_TEXT, SelfRole._inst.getHeadPos(), 10, false, -1);
                UnityEngine.Object.Destroy(base.gameObject);
            }
        }
コード例 #6
0
ファイル: DropItem.cs プロジェクト: atom-chen/rongyaojt
        public void PickUpItem()
        {
            bool flag = NetClient.instance == null;

            if (flag)
            {
                this.dispose();
            }
            else
            {
                long curServerTimeStampMS = NetClient.instance.CurServerTimeStampMS;
                bool flag2 = curServerTimeStampMS < DropItem.cantGetTimer;
                if (!flag2)
                {
                    bool flag3 = NetClient.instance != null;
                    if (flag3)
                    {
                        bool flag4 = curServerTimeStampMS - this.itemdta.initedTimer < 100L;
                        if (flag4)
                        {
                            return;
                        }
                    }
                    bool flag5 = this.isFake;
                    if (flag5)
                    {
                        FightText.play(FightText.MONEY_TEXT, SelfRole._inst.getHeadPos(), this.itemdta.count, false, -1);
                        this.dispose();
                    }
                    else
                    {
                        bool flag6 = SelfRole.fsm.Autofighting && !ModelBase <AutoPlayModel> .getInstance().WillPick((uint)this.itemdta.tpid);

                        if (!flag6)
                        {
                            BaseProxy <MapProxy> .getInstance().sendPickUpItem(this.itemdta.dpid);
                        }
                    }
                }
            }
        }
コード例 #7
0
 override public void onGetMapMoney(int money)
 {
     FightText.play(FightText.MONEY_TEXT, lgSelfPlayer.instance.grAvatar.getHeadPos(), money, false);
 }
コード例 #8
0
        void on_single_skill_res(Variant msgData)
        {
            debug.Log("UUUUUUU" + msgData.dump());
            uint     to_iid  = msgData["to_iid"]._uint;
            uint     frm_iid = msgData["frm_iid"]._uint;
            BaseRole toRole  = RoleMgr._instance.getRole(to_iid);
            BaseRole frmRole = RoleMgr._instance.getRole(frm_iid);

            //toRole.m_unTeamID = 0;

            if (!msgData.ContainsKey("states"))
            {
                return;
            }

            if (toRole != null && toRole.m_isMain)
            {
                Variant data = msgData["states"];
                if (msgData["sid"])
                {
                    int runeid = msgData["sid"];
                    //skill_id = runeid;
                    FightText.play(FightText.BUFF_TEXT, toRole.getHeadPos(), 0, false, runeid, null, toRole);
                }
                //if (data["id"] != 10000)
                A3_BuffModel.getInstance().addBuffList(data);

                ////副本祝福
                //if (data["id"] == 10000)
                //{
                //    A3_ActiveProxy.getInstance().dispatchEvent(GameEvent.Create(A3_ActiveProxy.EVENT_ONBLESS, this, data));
                //}
            }
            else
            {
                A3_BuffModel.getInstance().addOtherBuff(toRole, msgData["states"]["id"]);
            }

            if (msgData.ContainsKey("states"))
            {//技能的配置表特效播放
                SXML   xml      = XMLMgr.instance.GetSXML("skill.state", "id==" + msgData["states"]["id"]);
                string eff_file = xml.getString("effect");
                if (frmRole is MonsterRole && (frmRole as MonsterRole).issummon && to_iid == frm_iid)
                {
                    frmRole.PlaySkill(msgData["sid"]);
                }
                if (eff_file != "null")
                {
                    if (SceneCamera.m_nSkillEff_Level == 1 || toRole.m_isMain ||
                        (frmRole is MonsterRole && (frmRole as MonsterRole).masterid == PlayerModel.getInstance().cid))
                    {//屏蔽隐藏其他玩家时的buff特效
                        float      time      = xml.getFloat("last");
                        GameObject fx_prefab = GAMEAPI.ABFight_LoadPrefab(eff_file);
                        GameObject fx_inst   = GameObject.Instantiate(fx_prefab) as GameObject;

                        fx_inst.transform.SetParent(toRole.m_curModel, false);
                        GameObject.Destroy(fx_inst, time);

                        if (xml.getFloat("head") > 0)
                        {//头顶显示
                            fx_inst.transform.localPosition = new Vector3(0, toRole.headOffset_half.y / 2 + xml.getFloat("head"), 0);
                        }
                    }
                }
            }
        }
コード例 #9
0
        void doHurt(Variant v)
        {
            //debug.Log("doHurt:::::" + v.dump());
            uint to_iid   = v["to_iid"]._uint;
            int  damage   = v["dmg"]._int;
            bool isdie    = v["isdie"]._bool;//<v name="isdie" type="bool" />
            int  hprest   = v["hprest"]._int;
            uint frm_iid  = v["frm_iid"]._uint;
            uint skill_id = v["skill_id"]._uint;
            bool stagger  = false;

            if (v.ContainsKey("stagger"))
            {
                stagger = v["stagger"];
            }

            BaseRole toRole = RoleMgr._instance.getRole(to_iid);

            if (isdie)
            {
                if (toRole is P5Assassin)
                {
                    MediaClient.instance.PlaySoundUrl("audio_common_assassin_dead", false, null);
                }
                if (toRole is P2Warrior)
                {
                    MediaClient.instance.PlaySoundUrl("audio_common_warrior_dead", false, null);
                }
                if (toRole is P3Mage)
                {
                    MediaClient.instance.PlaySoundUrl("audio_common_mage_dead", false, null);
                }
            }

            if (toRole == null)
            {
                return;
            }
            BaseRole frm = RoleMgr._instance.getRole(frm_iid);

            //隐身的第一击额外伤害
            if (v.ContainsKey("invisible_first_atk") && frm != null && frm.m_isMain)
            {
                if (v["rune_id"])
                {
                    int runeid     = v["rune_id"];
                    int damage_atk = v["invisible_first_atk"];
                    FightText.play(FightText.IMG_TEXT, toRole.getHeadPos(), damage_atk, false, runeid, null, toRole);
                }
                //FightText.play(FightText.userText, toRole.getHeadPos(), v["invisible_first_atk"]);
                //flytxt.instance.fly("隐身的第一击额外伤害");
                //FightText.play(FightText.IMG_TEXT, role.getHeadPos(), hpchange, false, rune_id);
            }
            //0:未命中 , 1:命中(普通命中) , 2:暴击,3:双倍,4:反射,5:抵消,6:无视防御
            if (frm is MS0000)
            {
                debug.Log("伤害" + skill_id);
            }
            if (v.ContainsKey("hited"))
            {
                if (v.ContainsKey("ignore_defense_damage") && frm != null && frm.m_isMain)
                {
                    doHurt(toRole, frm, damage, isdie, hprest, 6, false, stagger, skill_id);
                    //FightText.play(FightText.IMG_TEXT_2, toRole.getHeadPos(), damage, false, 6,null,toRole);
                }
                else
                {
                    int hited = v["hited"];
                    switch (hited)
                    {
                    case 0:    //未命中
                        if (frm != null && (toRole.m_isMain || frm.m_isMain))
                        {
                            FightText.play(FightText.MISS_TEXT, frm.getHeadPos(), 0, false, -1, null, frm);
                        }
                        break;

                    case 1:    //命中(普通命中)
                        doHurt(toRole, frm, damage, isdie, hprest, 1, false, stagger, skill_id); break;

                    case 2:    //暴击
                        doHurt(toRole, frm, damage, isdie, hprest, 2, false, stagger, skill_id); break;

                    case 3:    //双倍
                        doHurt(toRole, frm, damage, isdie, hprest, 3, false, stagger, skill_id); break;

                    case 4:    //反射
                        if (v["rune_id"] && frm.m_isMain)
                        {
                            int runeid = v["rune_id"];
                            FightText.play(FightText.IMG_TEXT, toRole.getHeadPos(), damage, false, runeid, null, toRole);
                        }
                        else if (v["rune_id"] && toRole.m_isMain)
                        {
                            doHurt(toRole, frm, damage, isdie, hprest, 4, false, stagger, skill_id);
                        }
                        break;

                    case 5:    //抵消
                        doHurt(toRole, frm, damage, isdie, hprest, 5, false, stagger, skill_id); break;
                    }
                }
            }
            else
            {
                doHurt(toRole, frm, damage, isdie, hprest, -1, true, stagger);
            }

            if (toRole.m_isMain)
            {
                //重置护盾充能时间
                hudunModel.isNoAttack = false;
                if (a3_herohead.instance != null)
                {
                    a3_herohead.instance.wait_attack(hudunModel.noAttackTime);
                }
                if (frm is ProfessionRole)
                {//屏幕受攻击预警
                    if (a3_lowblood.instance != null)
                    {
                        a3_lowblood.instance.begin();
                    }
                }
                if (a3_insideui_fb.instance != null && PlayerModel.getInstance().inFb)
                {
                    a3_insideui_fb.instance.Cancel();
                }
            }
            if (PlayerModel.getInstance().treasure_num > 0)
            {
                if (frm is ProfessionRole && toRole.m_isMain)
                {
                    FindBestoModel.getInstance().Canfly = false;
                    if (a3_herohead.instance != null)
                    {
                        a3_herohead.instance.wait_attack_baotu(FindBestoModel.getInstance().waitTime);
                    }
                }
            }
            if (v.ContainsKey("dmg_shield"))
            {
                //pvp盾受到的伤害
                FightText.play(FightText.SHEILD_TEXT, toRole.getHeadPos(), v["dmg_shield"], false, -1, null, toRole);
                onShield(toRole);
            }

            if (v.ContainsKey("holy_shield"))
            {
                //剩余pvp盾值
                if (toRole.m_isMain)
                {
                    hudunModel.NowCount = v["holy_shield"];
                }
                if (v["holy_shield"] <= 0)
                {
                    //dispatchEvent(GameEvent.Create(EVENT_SHIELD_LOST, this, null));
                    onShieldLost(toRole);
                }
            }
        }
コード例 #10
0
        public void onAttchange(Variant msgData)
        {
            debug.Log("onAttchange::" + msgData.dump());
            BaseRole role = this.getRole(msgData["iid"]);
            bool     flag = role == null;

            if (!flag)
            {
                bool isMain = role.m_isMain;
                bool flag2  = msgData.ContainsKey("hpchange");
                if (flag2)
                {
                    Variant variant  = msgData["hpchange"];
                    int     num      = variant["hpchange"];
                    int     num2     = variant["hp_left"];
                    Variant variant2 = new Variant();
                    bool    flag3    = isMain;
                    if (flag3)
                    {
                        ModelBase <PlayerModel> .getInstance().modHp(num2);
                    }
                    bool flag4 = num > 0;
                    if (flag4)
                    {
                        role.modHp(num2);
                        bool flag5 = isMain;
                        if (flag5)
                        {
                            FightText.play(FightText.HEAL_TEXT, role.getHeadPos(), num, false, -1);
                        }
                        bool flag6 = this.healEff == null;
                        if (flag6)
                        {
                            this.healEff = Resources.Load <GameObject>("FX/comFX/fuwenFX/FX_fuwen_chuyong");
                        }
                        bool flag7 = this.healEff != null && role is ProfessionRole;
                        if (flag7)
                        {
                            GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.healEff);
                            UnityEngine.Object.Destroy(gameObject, 1f);
                            gameObject.transform.SetParent(role.m_curModel, false);
                        }
                        bool flag8 = msgData.ContainsKey("rune_ids");
                        if (flag8)
                        {
                            List <Variant> arr = msgData["rune_ids"]._arr;
                            foreach (Variant current in arr)
                            {
                                FightText.play(FightText.ADD_IMG_TEXT, role.getHeadPos(), num, false, current);
                            }
                        }
                    }
                    else
                    {
                        bool flag9 = num < 0;
                        if (flag9)
                        {
                            uint     iid      = variant["frm_iid"];
                            BaseRole role2    = RoleMgr._instance.getRole(iid);
                            Variant  variant3 = msgData["rune_ids"];
                            int      isCrit   = variant3[0];
                            bool     flag10   = msgData.ContainsKey("rune_ids");
                            if (flag10)
                            {
                                List <Variant> arr2 = msgData["rune_ids"]._arr;
                                foreach (Variant current2 in arr2)
                                {
                                    role.onServerHurt(-num, num2, variant["die"], role2, isCrit, false, false);
                                }
                            }
                        }
                    }
                }
                bool flag11 = msgData.ContainsKey("mpchange");
                if (flag11)
                {
                    Variant variant4 = msgData["mpchange"];
                    int     num3     = variant4["mpchange"];
                    int     mprest   = variant4["mp_left"];
                    bool    flag12   = isMain;
                    if (flag12)
                    {
                        ModelBase <PlayerModel> .getInstance().modMp(mprest);
                    }
                }
                bool flag13 = msgData.ContainsKey("pk_state");
                if (flag13)
                {
                    switch (msgData["pk_state"])
                    {
                    case 0:
                        role.m_ePK_Type = PK_TYPE.PK_PEACE;
                        break;

                    case 1:
                        role.m_ePK_Type = PK_TYPE.PK_PKALL;
                        break;

                    case 2:
                        role.m_ePK_Type = PK_TYPE.PK_TEAM;
                        break;

                    case 3:
                        role.m_ePK_Type = PK_TYPE.PK_LEGION;
                        break;

                    case 4:
                        role.m_ePK_Type = PK_TYPE.PK_HERO;
                        break;
                    }
                }
                bool flag14 = msgData.ContainsKey("clanid");
                if (flag14)
                {
                    role.m_unLegionID = msgData["clanid"];
                }
                bool flag15 = msgData.ContainsKey("teamid");
                if (flag15)
                {
                    role.m_unTeamID = msgData["teamid"];
                }
                bool flag16 = msgData.ContainsKey("rune_ids");
                if (flag16)
                {
                    List <Variant> arr3 = msgData["rune_ids"]._arr;
                    foreach (Variant current3 in arr3)
                    {
                        GameObject runeEff = EffMgr.getRuneEff(current3._int);
                        bool       flag17  = runeEff != null;
                        if (flag17)
                        {
                            GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(runeEff);
                            UnityEngine.Object.Destroy(gameObject2, 2f);
                            gameObject2.transform.SetParent(role.m_curModel, false);
                        }
                    }
                }
                bool flag18 = msgData.ContainsKey("sprite_flag");
                if (flag18)
                {
                    uint        num4    = msgData["sprite_flag"];
                    uint        iid2    = msgData["iid"];
                    MonsterRole monster = MonsterMgr._inst.getMonster(iid2);
                    bool        flag19  = monster != null;
                    if (flag19)
                    {
                        SkinnedMeshRenderer component = monster.m_curModel.FindChild("body").GetComponent <SkinnedMeshRenderer>();
                        uint num5 = num4;
                        if (num5 != 0u)
                        {
                            if (num5 == 1u)
                            {
                                component.sharedMaterial = Resources.Load <Material>("default/monster_1021_heite_gold");
                            }
                        }
                        else
                        {
                            Material[] sharedMaterials = component.sharedMaterials;
                            for (int i = 0; i < sharedMaterials.Length; i++)
                            {
                                Material material = sharedMaterials[i];
                                material.shader = Shader.Find("A3/A3_Char_Streamer_H");
                                material.SetColor("_RimColor", new Color(0f, 0f, 0f, 0f));
                                material.SetFloat("_RimWidth", 0f);
                            }
                        }
                    }
                }
            }
        }
コード例 #11
0
        public void onAttchange(Variant msgData)
        {
            debug.Log("onAttchange::" + msgData.dump());
            BaseRole role = getRole(msgData["iid"]);

            if (role == null)
            {
                return;
            }

            //if (msgData.ContainsKey("hpadd") && msgData["hpadd"].ContainsKey("die") && msgData["hpadd"]["die"]._bool)
            //    role.Die(msgData);

            bool isUser = role.m_isMain;

            if (msgData.ContainsKey("speed") && role is ProfessionRole)
            {
                var pro = (role as ProfessionRole);

                pro.speed = msgData["speed"]._int;

                if (isUser)
                {
                    PlayerModel.getInstance().speed = pro.speed;
                }
            }

            uint             frm_iid = 0;
            LGAvatarGameInst frm_lc  = null;

            if (msgData.ContainsKey("hpchange"))
            {
                Variant hpchanged = msgData["hpchange"];
                int     hpchange  = hpchanged["hpchange"];
                int     curhp     = hpchanged["hp_left"];
                Variant d         = new Variant();
                if (isUser)
                {
                    PlayerModel.getInstance().modHp(curhp);
                }
                if (hpchange > 0)
                {
                    role.modHp(curhp);
                    if (isUser)
                    {
                        FightText.play(FightText.HEAL_TEXT, role.getHeadPos(), hpchange);
                    }
                    if (healEff == null)
                    {
                        healEff = GAMEAPI.ABFight_LoadPrefab("FX_comFX_fuwenFX_FX_fuwen_chuyong");
                    }
                    if (healEff != null && role is ProfessionRole)
                    {
                        GameObject fx_inst = GameObject.Instantiate(healEff) as GameObject;
                        GameObject.Destroy(fx_inst, 1f);
                        fx_inst.transform.SetParent(role.m_curModel, false);
                    }
                    if (msgData.ContainsKey("rune_ids"))
                    {
                        List <Variant> l = msgData["rune_ids"]._arr;
                        foreach (Variant rune_id in l)
                        {
                            FightText.play(FightText.ADD_IMG_TEXT, role.getHeadPos(), hpchange, false, rune_id);
                        }
                    }
                }
                else if (hpchange < 0)
                {
                    frm_iid = hpchanged["frm_iid"];
                    BaseRole frm = RoleMgr._instance.getRole(frm_iid);

                    if (msgData.ContainsKey("rune_ids"))
                    {
                        Variant rune = msgData["rune_ids"];
                        if (rune.Count > 0)
                        {
                            int            id_rune = rune[0];
                            List <Variant> l       = msgData["rune_ids"]._arr;
                            foreach (Variant rune_id in l)
                            {
                                role.onServerHurt(-hpchange, curhp, hpchanged["die"], frm, id_rune);
                            }
                        }
                    }
                }
            }

            if (msgData.ContainsKey("mpchange"))
            {
                Variant mpchanged = msgData["mpchange"];
                int     mpchange  = mpchanged["mpchange"];
                int     curmp     = mpchanged["mp_left"];
                if (isUser)
                {
                    PlayerModel.getInstance().modMp(curmp);
                }
            }
            if (msgData.ContainsKey("pk_state"))
            {
                int pkstate = msgData["pk_state"];
                switch (pkstate)
                {
                case 0:
                    role.m_ePK_Type = PK_TYPE.PK_PEACE;
                    break;

                case 1:
                    role.m_ePK_Type = PK_TYPE.PK_PKALL;
                    break;

                case 2:
                    role.m_ePK_Type = PK_TYPE.PK_TEAM;
                    break;

                case 3:
                    role.m_ePK_Type = PK_TYPE.PK_LEGION;
                    break;

                case 4:
                    role.m_ePK_Type = PK_TYPE.PK_HERO;
                    break;

                case 5:
                    role.m_ePK_Type = PK_TYPE.Pk_SPOET;
                    break;
                }
                ;
            }
            if (msgData.ContainsKey("clanid"))
            {
                role.m_unLegionID = msgData["clanid"];
            }
            if (msgData.ContainsKey("teamid"))
            {
                role.m_unTeamID = msgData["teamid"];

                if (isUser)
                {
                    PlayerModel.getInstance().teamid = role.m_unTeamID;

                    PlayerNameUIMgr.getInstance().refeshHpColor();
                }
                else
                {
                    PlayerNameUIMgr.getInstance().refeshHpColor(role);
                }
            }

            if (msgData.ContainsKey("rune_ids"))
            {
                List <Variant> l = msgData["rune_ids"]._arr;
                foreach (Variant rune_id in l)
                {
                    GameObject eff = EffMgr.getRuneEff(rune_id._int);
                    if (eff != null)
                    {
                        GameObject fx_inst = GameObject.Instantiate(eff) as GameObject;
                        GameObject.Destroy(fx_inst, 2f);
                        fx_inst.transform.SetParent(role.m_curModel, false);
                    }
                }
                //if (!msgData.ContainsKey("hpchange"))
                //{
                //    foreach (Variant rune_id in l)
                //    {
                //        FightText.play(FightText.IMG_TEXT, role.getHeadPos(), 0, false, rune_id);
                //    }
                //}
            }

            if (msgData.ContainsKey("sprite_flag"))
            {
                uint call = msgData["sprite_flag"];
                uint iid  = msgData["iid"];
                var  vv   = MonsterMgr._inst.getMonster(iid);
                if (vv != null)
                {
                    SkinnedMeshRenderer render = vv.m_curModel.FindChild("body").GetComponent <SkinnedMeshRenderer>();
                    switch (call)
                    {
                    case 0:
                        foreach (var v in render.sharedMaterials)
                        {
                            v.shader = Shader.Find("A3/A3_Char_Streamer_H");
                            v.SetColor("_RimColor", new Color(0, 0, 0, 0));
                            v.SetFloat("_RimWidth", 0f);
                        }
                        break;

                    case 1:
                        render.sharedMaterial = U3DAPI.U3DResLoad <Material>("default/monster_1021_heite_gold");
                        break;
                    }
                }
            }

            if (isUser == false)
            {
                if (msgData.ContainsKey("dress"))
                {
                    var _role = role as ProfessionRole;

                    _role.rideId = msgData.getValue("dress")._int;

                    if (msgData.getValue("mount")._uint == (uint)RIDESTATE.UP && _role != null)
                    {
                        _role.ridestate = RIDESTATE.UP;

                        if (_role.invisible == false && _role.dianjiTime == -1 && _role.isUp == false)
                        {
                            _role.ChangeRideState(true);
                        }

                        //_role.set_Ride( msgData.getValue( "dress" )._int);
                    }

                    else if (msgData.getValue("mount")._uint == ( uint )RIDESTATE.Down && _role != null)
                    {
                        _role.ridestate = RIDESTATE.Down;

                        _role.Remove_Ride();
                    }
                }
            } //其他玩家坐骑切换

            //if (msgData.ContainsKey("speed"))
            //    role.modSpeed(msgData["speed"]._int);

            //if (msgData.ContainsKey("maxhp"))
            //{
            //    int maxhp = msgData["maxhp"];
            //    role.modMaxHp(maxhp);
            //    if (isUser)
            //    {
            //        PlayerModel.getInstance().max_hp = maxhp;
            //    }
            //}

            //if (msgData.ContainsKey("maxdp"))
            //    role.modMaxDp(msgData["maxdp"]._int);

            //if (msgData.ContainsKey("in_pczone"))
            //{
            //    if (role.isMainPlayer())
            //    {
            //        if (msgData["in_pczone"]._bool)
            //        {
            //           // lgGeneral.PKStateChange(0);需要切换pk模式 lucisa
            //        }
            //        lguiMain.PczoneChange(msgData["in_pczone"]._bool);
            //    }
            //    this.in_pczone = msgData["in_pczone"]._bool;

            //}
            //if (msgData.ContainsKey("follow"))
            //{
            //    this.follow = msgData["follow"]._bool;
            //}
            //if (msgData.ContainsKey("ghost"))
            //{
            //    this.ghost = msgData["ghost"]._bool;
            //}
            //if (msgData.ContainsKey("ride_mon_id"))
            //{
            //    this.ride_mon = msgData["ride_mon_id"];//坐骑 lucisa
            //}
        }
コード例 #12
0
ファイル: BattleProxy.cs プロジェクト: atom-chen/rongyaojt
        private void doHurt(Variant v)
        {
            uint @uint   = v["to_iid"]._uint;
            int  @int    = v["dmg"]._int;
            bool @bool   = v["isdie"]._bool;
            int  int2    = v["hprest"]._int;
            uint uint2   = v["frm_iid"]._uint;
            uint uint3   = v["skill_id"]._uint;
            bool stagger = false;
            bool flag    = v.ContainsKey("stagger");

            if (flag)
            {
                stagger = v["stagger"];
            }
            BaseRole role  = RoleMgr._instance.getRole(@uint);
            bool     flag2 = @bool;

            if (flag2)
            {
                bool flag3 = role is P5Assassin;
                if (flag3)
                {
                    MediaClient.instance.PlaySoundUrl("audio/common/assassin_dead", false, null);
                }
                bool flag4 = role is P2Warrior;
                if (flag4)
                {
                    MediaClient.instance.PlaySoundUrl("audio/common/warrior_dead", false, null);
                }
                bool flag5 = role is P3Mage;
                if (flag5)
                {
                    MediaClient.instance.PlaySoundUrl("audio/common/mage_dead", false, null);
                }
            }
            bool flag6 = role == null;

            if (!flag6)
            {
                BaseRole role2 = RoleMgr._instance.getRole(uint2);
                bool     flag7 = v.ContainsKey("invisible_first_atk") && role2 != null && role2.m_isMain;
                if (flag7)
                {
                    bool flag8 = v["rune_id"];
                    if (flag8)
                    {
                        int type = v["rune_id"];
                        int num  = v["invisible_first_atk"];
                        FightText.play(FightText.IMG_TEXT, role.getHeadPos(), num, false, type);
                    }
                }
                bool flag9 = role2 is MS0000;
                if (flag9)
                {
                    debug.Log("伤害" + uint3);
                }
                bool flag10 = v.ContainsKey("hited");
                if (flag10)
                {
                    switch (v["hited"])
                    {
                    case 0:
                    {
                        bool flag11 = role2 != null && (role.m_isMain || role2.m_isMain);
                        if (flag11)
                        {
                            FightText.play(FightText.MISS_TEXT, role2.getHeadPos(), 0, false, -1);
                        }
                        break;
                    }

                    case 1:
                        this.doHurt(role, role2, @int, @bool, int2, 1, false, stagger, uint3);
                        break;

                    case 2:
                        this.doHurt(role, role2, @int, @bool, int2, 2, false, stagger, uint3);
                        break;

                    case 3:
                        this.doHurt(role, role2, @int, @bool, int2, 3, false, stagger, uint3);
                        break;

                    case 4:
                    {
                        bool flag12 = v["rune_id"] && role2.m_isMain;
                        if (flag12)
                        {
                            int type2 = v["rune_id"];
                            FightText.play(FightText.IMG_TEXT, role.getHeadPos(), @int, false, type2);
                        }
                        else
                        {
                            bool flag13 = v["rune_id"] && role.m_isMain;
                            if (flag13)
                            {
                                this.doHurt(role, role2, @int, @bool, int2, 4, false, stagger, uint3);
                            }
                        }
                        break;
                    }

                    case 5:
                        this.doHurt(role, role2, @int, @bool, int2, 5, false, stagger, uint3);
                        break;
                    }
                }
                else
                {
                    this.doHurt(role, role2, @int, @bool, int2, -1, true, stagger, 0u);
                }
                bool isMain = role.m_isMain;
                if (isMain)
                {
                    this.hudunModel.isNoAttack = false;
                    bool flag14 = a3_herohead.instance != null;
                    if (flag14)
                    {
                        a3_herohead.instance.wait_attack(this.hudunModel.noAttackTime);
                    }
                    bool flag15 = role2 is ProfessionRole;
                    if (flag15)
                    {
                        bool flag16 = a3_lowblood.instance != null;
                        if (flag16)
                        {
                            a3_lowblood.instance.begin();
                        }
                    }
                }
                bool flag17 = ModelBase <PlayerModel> .getInstance().treasure_num > 0u;

                if (flag17)
                {
                    bool flag18 = role2 is ProfessionRole && role.m_isMain;
                    if (flag18)
                    {
                        ModelBase <FindBestoModel> .getInstance().Canfly = false;

                        bool flag19 = a3_herohead.instance != null;
                        if (flag19)
                        {
                            a3_herohead.instance.wait_attack_baotu(ModelBase <FindBestoModel> .getInstance().waitTime);
                        }
                    }
                }
                bool flag20 = v.ContainsKey("dmg_shield");
                if (flag20)
                {
                    FightText.play(FightText.SHEILD_TEXT, role.getHeadPos(), v["dmg_shield"], false, -1);
                    this.onShield(role);
                }
                bool flag21 = v.ContainsKey("holy_shield");
                if (flag21)
                {
                    bool isMain2 = role.m_isMain;
                    if (isMain2)
                    {
                        this.hudunModel.NowCount = v["holy_shield"];
                    }
                    bool flag22 = v["holy_shield"] <= 0;
                    if (flag22)
                    {
                        this.onShieldLost(role);
                    }
                }
            }
        }