public void onCD2(cd item)
    {
        int temp = (int)(cd.secCD - cd.lastCD) / 100;

        collectStr2   = ContMgr.getCont("openbox");
        item.txt.text = collectStr2 + ((float)temp / 10f).ToString();
    }
Esempio n. 2
0
        internal void <Transmit> b__30_0(cd cdt)
        {
            int num = (int)(cd.secCD - cd.lastCD) / 100;

            cdt.txt.text = ContMgr.getCont("worldmap_cd", new string[]
            {
                ((float)num / 10f).ToString()
            });
        }
Esempio n. 3
0
 static public void Transmit(int toid, Action after = null, bool transmit = false, bool ontask = false, int lineid = -1, bool taskTrans = false /*任务传送*/) //传送
 {
     if (!MapModel.getInstance().dicMappoint.ContainsKey(GRMap.instance.m_nCurMapID))
     {
         return;
     }
     if (toid != MapModel.getInstance().dicMappoint[GRMap.instance.m_nCurMapID] || lineid != -1)
     {
         if (!FindBestoModel.getInstance().Canfly) //宝图活动战斗状态禁止传送
         {
             flytxt.instance.fly(FindBestoModel.getInstance().nofly_txt);
             return;
         }
         cd.updateHandle = (cd cdt) =>
         {
             int temp = (int)(cd.secCD - cd.lastCD) / 100;
             cdt.txt.text = ContMgr.getCont("worldmap_cd", ((float)temp / 10f).ToString());
         };
         GameObject goeff = GameObject.Instantiate(worldmap.EFFECT_CHUANSONG1) as GameObject;
         goeff.transform.SetParent(SelfRole._inst.m_curModel, false);
         s_bInTransmit = true;
         cd.show(() =>
         {
             MapProxy.getInstance().sendBeginChangeMap(toid, true, false, lineid);
             DoAfterMgr.instacne.addAfterRender(() =>
             {
                 after?.Invoke();
             });
             s_bInTransmit = false;
         }, 3f, false,
                 () =>
         {
             GameObject.Destroy(goeff);
             s_bInTransmit = false;
         }
                 );
     }
     else
     {
         after?.Invoke();
     }
     debug.Log("我的传送是自动任务传送:" + taskTrans);
     if (a3_liteMinimap.instance && a3_liteMinimap.instance.ZidongTask && !taskTrans)
     {
         a3_liteMinimap.instance.ZidongTask = false;
     }
     if (a3_liteMinimap.instance && !a3_liteMinimap.instance.ZidongTask && taskTrans)
     {
         if (a3_liteMinimap.instance.ZidongTaskType == TaskType.MAIN)
         {
             a3_liteMinimap.instance.TaskBtn(null, true);
         }
     }
 }
Esempio n. 4
0
 static public void showPet(Variant data)
 {
     if (data["iid"] != PlayerModel.getInstance().iid)
     {
         if (data["pet_food_last_time"] == 0)
         {
             OtherPlayerMgr._inst.PlayPetAvatarChange(data["iid"], 0, 0);
             debug.Log("饲料到期");
         }
         else
         {
             OtherPlayerMgr._inst.PlayPetAvatarChange(data["iid"], data["pet_id"], 0);
         }
     }
     else
     {
         PlayerModel.getInstance().last_time = data["pet_food_last_time"];//刷新playermodel里面的数据,宠物到期;
         _inst.ChangePetAvatar(0, 0);
         flytxt.instance.fly(ContMgr.getCont("pet_no_feed"));
         debug.Log("饲料到期");
     }
 }
Esempio n. 5
0
    public void OnTriggerEnter(Collider other)
    {
        HitData hd = other.gameObject.GetComponent <HitData>();

        if (hd == null)
        {
            return;
        }
        if (hd.m_haveHittedList.Contains(m_selfRole.m_unIID))
        {
            return;
        }
        else
        {
            hd.m_haveHittedList.Add(m_selfRole.m_unIID);
        }

        if (PlayerModel.getInstance().up_lvl >= 1)
        {
            if (CanHited(m_selfRole, hd))
            {
                //临时处理只碰一次
                if (hd.m_bOnlyHit)
                {
                    other.enabled = false;
                }

                if (hd.m_unSkillID == 3003)
                {//冰雨技能攻击到时播放dead2的特效
                    hd.HitAndStop(EnumAni.ANI_T_FXDEAD1);
                }
                else if (hd.m_unSkillID == 3006)
                {//陨石可穿过模型
                }
                else
                {
                    //停止动画
                    hd.HitAndStop();
                }

                if (hd.m_CastRole != null && hd.m_CastRole.isfake)
                {
                    m_selfRole.onHurt(hd);
                }

                //主角自己受到的伤害让服务器下发好了,自己不用去关心
                //m_selfRole.onHurt(hd);
                m_selfRole.ShowHurtFX(hd.m_nHurtFX);


                //if (hd.m_bNeedKill)
                //{
                //    GameObject.Destroy(other.gameObject);
                //}
                //播放死亡
                //GameObject.Destroy(other.gameObject);

                //显示迎战的ui
                if (!hd.m_CastRole.m_isMain && hd.m_CastRole is ProfessionRole && PlayerModel.getInstance().now_pkState == 0)//PlayerModel.getInstance().now_pkState == 0 && hd.m_CastRole is ProfessionRole && PlayerModel.getInstance().now_nameState==0
                {
                    if (!hd.m_CastRole.isDead || hd.m_CastRole != null || !m_selfRole.isDead)
                    {
                        a3_expbar.instance.ShowAgainst(hd.m_CastRole);
                    }
                }

                //我非全体模式时,打我的人是我的团员或者对友,飘字提示
                if (PlayerModel.getInstance().now_pkState != 1 && !hd.m_CastRole.m_isMain && hd.m_CastRole is ProfessionRole)
                {
                    if ((TeamProxy.getInstance().MyTeamData != null && TeamProxy.getInstance().MyTeamData.IsInMyTeam(hd.m_CastRole.roleName)) ||
                        (PlayerModel.getInstance().clanid != 0 && PlayerModel.getInstance().clanid == hd.m_CastRole.m_unLegionID))
                    {
                        flytxt.instance.fly(ContMgr.getCont("a3_pkmodel"));
                    }
                }
            }
        }
    }
Esempio n. 6
0
    public MonsterRole AddDartCar(Variant d)//镖车
    {
        init();
        if (GRMap.grmap_loading)
        {
            cacheProxy.Add(d);
            return(null);
        }
        Vector3 born_pt  = new Vector3(d["x"] / GameConstant.PIXEL_TRANS_UNITYPOS, 0f, d["y"] / GameConstant.PIXEL_TRANS_UNITYPOS);
        int     id       = d["mid"];
        uint    serverid = d["iid"];

        if (m_mapMonster.ContainsKey(serverid))
        {
            return(m_mapMonster[serverid]);
        }

        SXML   xml    = dMon[id];
        int    tempid = xml.getInt("obj");
        float  scale  = xml.getFloat("scale");
        string name   = string.Empty;

        if (serverid <= 0)
        {
            if (Globle.m_nTestMonsterID > 0)
            {
                tempid = Globle.m_nTestMonsterID;
            }
        }
        MDC000 mon = new MDC000();

        mon.tempXMl  = xml;
        mon.isBoos   = xml.getInt("boss") == 1;
        mon.isBoss_c = xml.getInt("boss_c") == 1;
        if (scale > 0f)
        {
            mon.scale = scale;
        }
        if (mon != null)
        {
            if (serverid > 0)
            {
                mon.m_unIID = serverid;
                m_mapMonster.Add(serverid, mon);//这个地图上的所有的monster
            }
            else
            {
                mon.isfake  = true;
                mon.m_unIID = idIdx;
                m_mapFakeMonster.Add(idIdx, mon);
                idIdx++;
            }

            mon.Init("monster_" + tempid, EnumLayer.LM_MONSTER, born_pt, 0);
            mon.curhp       = d["hp"];
            mon.maxHp       = d["battleAttrs"]["max_hp"];
            mon.escort_name = d["escort_name"];
            PlayerNameUIMgr.getInstance().show(mon);
            PlayerNameUIMgr.getInstance().setDartName(mon, d["escort_name"] + ContMgr.getCont("MonsterMgr1"));
            mon.roleName  = d["escort_name"] + ContMgr.getCont("MonsterMgr1");
            mon.monsterid = id;
            if (mon.roleName == A3_LegionModel.getInstance().myLegion.name)
            {
                mon.m_isMarked = false;
            }

            //if (GRMap.grmap_loading == false)
            //    mon.refreshViewType(2);

            mon.dartid = id;
            mon.isDart = true;
        }
        m_listMonster.Add(mon);
        if (mon != null)
        {
            dispatchEvent(GameEvent.Create(MonsterMgr.EVENT_MONSTER_ADD, this, mon));
        }


        if (d.ContainsKey("moving"))
        {
            uint  iid  = d["iid"]._uint;
            var   vv   = MonsterMgr._inst.getMonster(iid);
            float to_x = d["moving"]["to_x"]._float;
            float to_y = d["moving"]["to_y"]._float;

            NavMeshHit hit;
            Vector3    vec = new Vector3(to_x * 32 / GameConstant.PIXEL_TRANS_UNITYPOS, 0f, to_y * 32 / GameConstant.PIXEL_TRANS_UNITYPOS);
            NavMesh.SamplePosition(vec, out hit, 100f, vv.m_layer);
            vv.SetDestPos(hit.position);
        }
        return(mon);
    }
Esempio n. 7
0
    public MonsterRole AddSummon(Variant m)
    {
        init();
        if (GRMap.grmap_loading)
        {
            cacheProxy.Add(m);
            return(null);
        }

        Vector3 born_pt  = new Vector3(m["x"] / GameConstant.PIXEL_TRANS_UNITYPOS, 0f, m["y"] / GameConstant.PIXEL_TRANS_UNITYPOS);
        int     id       = m["mid"];
        uint    serverid = m["iid"];

        if (m_mapMonster.ContainsKey(serverid))
        {
            if (m["owner_cid"] == PlayerModel.getInstance().cid)
            {
                if (a3_herohead.instance)
                {
                    A3_SummonModel.getInstance().lastatkID = 0;
                    a3_herohead.instance.refresh_sumHp(m["hp"], m["battleAttrs"]["max_hp"]);
                    a3_herohead.instance.refresh_sumbar();
                    a3_herohead.instance.do_sum_CD = false;
                }
            }
            return(m_mapMonster[serverid]);
        }

        //return null;

        SXML   xml    = dMon[id];
        int    tempid = xml.getInt("obj");
        float  scale  = xml.getFloat("scale");
        string name   = xml.getString("name");

        if (serverid <= 0)
        {
            if (Globle.m_nTestMonsterID > 0)
            {
                tempid = Globle.m_nTestMonsterID;
            }
        }

        MS0000 mon = new MS0000();

        mon.tempXMl = xml;

        mon.isBoos   = xml.getInt("boss") == 1;
        mon.isBoss_c = xml.getInt("boss_c") == 1;
        if (scale > 0f)
        {
            mon.scale = scale;
        }

        if (mon != null)
        {
            if (serverid > 0)
            {
                mon.m_unIID = serverid;
                m_mapMonster.Add(serverid, mon);
                roleSummonMapping[m["owner_cid"]] = serverid;       // 人物对应的召唤兽 id
            }
            else
            {
                mon.isfake  = true;
                mon.m_unIID = idIdx;
                m_mapFakeMonster.Add(idIdx, mon);
                idIdx++;
            }

            mon.masterid = m["owner_cid"];
            mon.issummon = true;
            mon.summonid = id;

            if (SceneCamera.m_nModelDetail_Level != 1 && mon.masterid != PlayerModel.getInstance().cid)
            {//设置隐藏召唤兽
                mon.Init("monster_" + tempid, EnumLayer.LM_DEFAULT, born_pt, 0);
            }
            else
            {
                mon.Init("monster_" + tempid, EnumLayer.LM_MONSTER, born_pt, 0);
            }
            mon.m_layer = EnumLayer.LM_MONSTER;

            PlayerNameUIMgr.getInstance().show(mon);
            PlayerNameUIMgr.getInstance().setName(mon, name, m["owner_name"] + ContMgr.getCont("MonsterMgr"));
            mon.roleName  = name;
            mon.monsterid = id;

            //if (GRMap.grmap_loading == false)
            //    mon.refreshViewType(2);


            //mon.master = RoleMgr._instance.getRole(m["owner_cid"]);

            if (mon.masterid == PlayerModel.getInstance().cid)
            {
                if (a3_herohead.instance)
                {
                    A3_SummonModel.getInstance().lastatkID = 0;
                    a3_herohead.instance.refresh_sumHp(m["hp"], m["battleAttrs"]["max_hp"]);
                    a3_herohead.instance.refresh_sumbar();
                    a3_herohead.instance.do_sum_CD = false;
                }
            }
        }
        m_listMonster.Add(mon);

        if (mon != null)
        {
            dispatchEvent(GameEvent.Create(MonsterMgr.EVENT_MONSTER_ADD, this, mon));
        }

        if (mon != null)
        {
            mon.curhp     = m["hp"];
            mon.maxHp     = m["battleAttrs"]["max_hp"];
            mon.owner_cid = m["owner_cid"];
        }
        return(mon);
    }