示例#1
0
        public void onGotoCity(GameObject go)
        {
            if (!FindBestoModel.getInstance().Canfly)
            {
                flytxt.instance.fly(FindBestoModel.getInstance().nofly_txt);
                InterfaceMgr.getInstance().close(InterfaceMgr.WORLD_MAP);
                return;
            }
            cd.updateHandle = worldmapsubwin.onCD;

            GameObject goeff = GameObject.Instantiate(EFFECT_CHUANSONG1) as GameObject;

            goeff.transform.SetParent(SelfRole._inst.m_curModel, false);

            cd.show(() =>
            {
                MapProxy.getInstance().sendBeginChangeMap(0, true);
            },
                    2.8f, false,
                    () =>
            {
                Destroy(goeff);
            }

                    );
            InterfaceMgr.getInstance().close(InterfaceMgr.WORLD_MAP);
        }
 void wait_Time_baotu()
 {
     waitTime_baotu--;
     if (waitTime_baotu <= 0)
     {
         waitTime_baotu = 0;
         CancelInvoke("wait_Time_baotu");
         FindBestoModel.getInstance().Canfly = true;
     }
 }
示例#3
0
        public void sendBeginChangeMap(int linkid, bool transmit = false, bool ontask = false, int lineid = -1)
        {
            if (FindBestoModel.getInstance().Canfly)//宝图活动战斗状态禁止传送
            {
                Variant v = new Variant();

                v["gto"]      = linkid;
                v["transmit"] = transmit;
                v["ontask"]   = ontask;
                if (lineid != -1)
                {
                    v["line"] = lineid;
                }
                debug.Log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>sendBeginChangeMap>" + v.dump());
                changingMap = true;
                sendRPC(PKG_NAME.C2S_ON_BEGIN_CHANGE_MAP_RES, v);
            }
            else
            {
                flytxt.instance.fly(FindBestoModel.getInstance().nofly_txt);
            }
        }
        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);
                }
            }
        }
        void onmoneyclick(GameObject go)
        {
            if (!FindBestoModel.getInstance().Canfly) //宝图活动战斗状态禁止传送
            {
                flytxt.instance.fly(FindBestoModel.getInstance().nofly_txt);
                InterfaceMgr.getInstance().close(InterfaceMgr.WORLD_MAP);
                InterfaceMgr.getInstance().close(InterfaceMgr.WORLD_MAP_SUB);
                return;
            }
            if (PlayerModel.getInstance().money < needMoney)
            {
                flytxt.instance.fly(ContMgr.getCont("comm_nomoney"));
            }
            else
            {
                float dis = Vector3.Distance(SelfRole._inst.m_curModel.position, new Vector3(xml.getFloat("ux"), SelfRole._inst.m_curModel.position.y, xml.getFloat("uy")));
                //  debug.Log(":::::" + dis);
                toid = id;
                if (mapid == GRMap.instance.m_nCurMapID && dis < AREA)
                {
                    GameObject goeff = GameObject.Instantiate(worldmap.EFFECT_CHUANSONG1) as GameObject;
                    goeff.transform.SetParent(SelfRole._inst.m_curModel, false);
                    MsgBoxMgr.getInstance().showConfirm(ContMgr.getCont("worldmap_tooclose"), () =>
                    {
                        cd.updateHandle = onCD;
                        cd.show(() =>
                        {
                            MapProxy.getInstance().sendBeginChangeMap(toid, true);
                        }, 2.8f, false,
                                () =>
                        {
                            Destroy(goeff);
                        }
                                );
                        InterfaceMgr.getInstance().close(InterfaceMgr.WORLD_MAP);
                        InterfaceMgr.getInstance().close(InterfaceMgr.WORLD_MAP_SUB);
                        if (a3_active.onshow)
                        {
                            InterfaceMgr.getInstance().close(InterfaceMgr.A3_ACTIVE);
                        }
                    });
                }
                else
                {
                    cd.updateHandle = onCD;
                    GameObject goeff = GameObject.Instantiate(worldmap.EFFECT_CHUANSONG1) as GameObject;
                    goeff.transform.SetParent(SelfRole._inst.m_curModel, false);
                    cd.show(() =>
                    {
                        MapProxy.getInstance().sendBeginChangeMap(toid, true);
                    }, 2.8f, false,
                            () =>
                    {
                        Destroy(goeff);
                    }
                            );

                    InterfaceMgr.getInstance().close(InterfaceMgr.WORLD_MAP);
                    InterfaceMgr.getInstance().close(InterfaceMgr.WORLD_MAP_SUB);
                    if (a3_active.onshow)
                    {
                        InterfaceMgr.getInstance().close(InterfaceMgr.A3_ACTIVE);
                    }
                }
            }



            //InterfaceMgr.getInstance().close(InterfaceMgr.WORLD_MAP);
            //InterfaceMgr.getInstance().close(InterfaceMgr.WORLD_MAP_SUB);
        }