コード例 #1
0
    public static void FrameMove(float fdt)
    {
        List <uint> list = new List <uint>();

        foreach (OneFollowBlt current in FollowBullet_Mgr.m_mapFollowBullet.Values)
        {
            try
            {
                float num = current.costtime / current.maxtime;
                current.costtime += fdt;
                bool flag = num > 1f;
                if (flag)
                {
                    bool flag2 = current.aniTrack != null;
                    if (flag2)
                    {
                        current.aniTrack.speed = 0f;
                    }
                    bool flag3 = current.aniFx != null;
                    if (flag3)
                    {
                        current.aniFx.SetTrigger(EnumAni.ANI_T_FXDEAD);
                    }
                    UnityEngine.Object.Destroy(current.blt_hd.m_hdRootObj, 1f);
                    list.Add(current.id);
                    bool flag4 = current.locker is MonsterRole;
                    if (flag4)
                    {
                        MonsterRole monsterRole = current.locker as MonsterRole;
                        bool        isfake      = monsterRole.isfake;
                        if (isfake)
                        {
                            monsterRole.onHurt(current.blt_hd);
                        }
                        else
                        {
                            bool flag5 = current.blt_hd.m_CastRole == SelfRole._inst;
                            if (flag5)
                            {
                                List <uint> list2 = new List <uint>();
                                list2.Add(monsterRole.m_unIID);
                                int  lockid = -1;
                                bool flag6  = SelfRole._inst.m_LockRole != null && SelfRole._inst.m_LockRole.m_unIID == monsterRole.m_unIID;
                                if (flag6)
                                {
                                    lockid = (int)SelfRole._inst.m_LockRole.m_unIID;
                                }
                                BaseProxy <BattleProxy> .getInstance().sendcast_target_skill(current.blt_hd.m_unSkillID, list2, 0, lockid);
                            }
                        }
                    }
                }
                else
                {
                    Vector3 position = current.locker.m_curModel.position;
                    position.y += 1.5f;
                    Vector3 position2 = current.beginpos + (position - current.beginpos) * num;
                    current.blt_hd.m_hdRootObj.transform.position = position2;
                }
            }
            catch (Exception var_16_1FB)
            {
                list.Add(current.id);
                break;
            }
        }
        for (int i = 0; i < list.Count; i++)
        {
            FollowBullet_Mgr.m_mapFollowBullet.Remove(list[i]);
        }
    }
コード例 #2
0
    public MonsterRole FindNearestMonster(Vector3 pos, Func <MonsterRole, bool> handle = null, bool useMark = false, PK_TYPE pkState = PK_TYPE.PK_PEACE, bool onTask = false)
    {
        float       num         = 9999999f;
        MonsterRole monsterRole = null;

        RoleMgr.ClearMark(!useMark, pkState, (BaseRole m) => (m.m_curPhy.position - pos).magnitude < (SelfRole.fsm.Autofighting ? StateInit.Instance.Distance : SelfRole._inst.m_LockDis));
        foreach (MonsterRole current in this.m_mapMonster.Values)
        {
            bool flag = current.isDead || current is CollectRole || (current is MS0000 && (long)((MS0000)current).owner_cid == (long)((ulong)ModelBase <PlayerModel> .getInstance().cid)) || (current is MDC000 && ((MDC000)current).escort_name == ModelBase <A3_LegionModel> .getInstance().myLegion.clname);
            if (!flag)
            {
                bool flag2 = current is MDC000 && (int)((float)((MDC000)current).curhp / (float)((MDC000)current).maxHp * 100f) <= 20;
                if (!flag2)
                {
                    TaskMonId expr_104 = this.taskMonId;
                    bool      flag3    = expr_104 != null && expr_104.applied && this.taskMonId.value != current.monsterid;
                    if (!flag3)
                    {
                        bool flag4 = handle != null && handle(current);
                        if (!flag4)
                        {
                            bool flag5 = onTask && ModelBase <PlayerModel> .getInstance().task_monsterIdOnAttack.ContainsKey(ModelBase <A3_TaskModel> .getInstance().main_task_id) && current.monsterid != ModelBase <PlayerModel> .getInstance().task_monsterIdOnAttack[ModelBase <A3_TaskModel> .getInstance().main_task_id];

                            if (!flag5)
                            {
                                bool flag6 = BaseProxy <TeamProxy> .getInstance().MyTeamData != null;

                                if (flag6)
                                {
                                    bool mwlr_on = ModelBase <A3_ActiveModel> .getInstance().mwlr_on;

                                    if (mwlr_on)
                                    {
                                        bool flag7 = ModelBase <A3_ActiveModel> .getInstance().mwlr_target_monId != current.monsterid;

                                        if (flag7)
                                        {
                                            continue;
                                        }
                                    }
                                    bool flag8 = current.ownerName != null && !BaseProxy <TeamProxy> .getInstance().MyTeamData.IsInMyTeam(current.ownerName);

                                    if (flag8)
                                    {
                                        continue;
                                    }
                                }
                                else
                                {
                                    bool flag9 = current.ownerName != null && current.ownerName != ModelBase <PlayerModel> .getInstance().name;

                                    if (flag9)
                                    {
                                        continue;
                                    }
                                }
                                bool flag10 = SelfRole.fsm.Autofighting && (current.m_curPhy.position - StateInit.Instance.Origin).magnitude > StateInit.Instance.Distance;
                                if (!flag10)
                                {
                                    bool flag11 = pkState != PK_TYPE.PK_PKALL && current is MS0000 && ((MS0000)current).owner_cid != 0;
                                    if (!flag11)
                                    {
                                        float magnitude = (current.m_curPhy.position - pos).magnitude;
                                        bool  flag12    = magnitude < (SelfRole.fsm.Autofighting ? Mathf.Min(SelfRole._inst.m_LockDis, StateInit.Instance.Distance) : SelfRole._inst.m_LockDis) && magnitude < num;
                                        if (flag12)
                                        {
                                            num         = magnitude;
                                            monsterRole = current;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        bool flag13 = monsterRole != null & useMark;

        if (flag13)
        {
            monsterRole.m_isMarked = true;
        }
        return(monsterRole);
    }
コード例 #3
0
    public BaseRole FindNearestEnemyOne(Vector3 pos, bool isredname = false, Func <ProfessionRole, bool> selector = null, bool useMark = false, PK_TYPE pkState = PK_TYPE.PK_PEACE)
    {
        float    num      = 9999999f;
        BaseRole baseRole = null;

        switch (pkState)
        {
        case PK_TYPE.PK_PEACE:
        case PK_TYPE.PK_PKALL:
        {
IL_2F:
            Func <BaseRole, bool> filterHandle = (BaseRole p) => !p.isDead && (p.m_curPhy.position - pos).magnitude < (SelfRole.fsm.Autofighting ? StateInit.Instance.Distance : SelfRole._inst.m_LockDis);
            goto IL_4D;
        }

        case PK_TYPE.PK_TEAM:
        {
            Func <BaseRole, bool> filterHandle = delegate(BaseRole p)
            {
                bool arg_C1_0;
                if (!p.isDead && (p.m_curPhy.position - pos).magnitude < (SelfRole.fsm.Autofighting ? StateInit.Instance.Distance : SelfRole._inst.m_LockDis))
                {
                    ItemTeamMemberData expr_6E = BaseProxy <TeamProxy> .getInstance().MyTeamData;

                    bool?arg_AA_0;
                    if (expr_6E == null)
                    {
                        arg_AA_0 = null;
                    }
                    else
                    {
                        List <ItemTeamData> expr_82 = expr_6E.itemTeamDataList;
                        arg_AA_0 = ((expr_82 != null) ? new bool?(!expr_82.Exists((ItemTeamData m) => m.cid == p.m_unCID)) : null);
                    }
                    arg_C1_0 = (arg_AA_0 ?? true);
                }
                else
                {
                    arg_C1_0 = false;
                }
                return(arg_C1_0);
            };
            goto IL_4D;
        }
        }
        goto IL_2F;
IL_4D:
        bool flag = false;

        while (true)
        {
            foreach (ProfessionRole current in this.m_mapOtherPlayer.Values)
            {
                bool flag2 = OtherPlayerMgr._inst.m_mapOtherPlayer[current.m_unIID].zhuan >= 1;
                if (flag2)
                {
                    bool flag3 = current.isDead || current.invisible;
                    if (!flag3)
                    {
                        bool isMarked = current.m_isMarked;
                        if (!isMarked)
                        {
                            if (isredname)
                            {
                                bool flag4 = current.rednm <= 0;
                                if (flag4)
                                {
                                    continue;
                                }
                            }
                            bool flag5 = selector != null && selector(current);
                            if (!flag5)
                            {
                                float magnitude = (current.m_curModel.position - pos).magnitude;
                                bool  flag6     = magnitude < (SelfRole.fsm.Autofighting ? StateInit.Instance.Distance : SelfRole._inst.m_LockDis) && magnitude < num;
                                if (flag6)
                                {
                                    num      = magnitude;
                                    baseRole = current;
                                }
                            }
                        }
                    }
                }
            }
            bool flag7 = baseRole == null;
            if (!flag7)
            {
                break;
            }
            baseRole = MonsterMgr._inst.FindNearestSummon(pos);
            bool flag8 = baseRole == null;
            if (!flag8)
            {
                goto IL_1C9;
            }
            Func <BaseRole, bool> filterHandle;
            RoleMgr.ClearMark(!useMark, pkState, filterHandle);
            bool flag9 = !flag;
            if (!flag9)
            {
                break;
            }
            flag = true;
        }
        goto IL_1D9;
IL_1C9:
        if (useMark)
        {
            baseRole.m_isMarked = true;
        }
IL_1D9:
        bool flag10 = baseRole != null & useMark;

        if (flag10)
        {
            baseRole.m_isMarked = true;
        }
        return(baseRole);
    }
コード例 #4
0
    public MonsterRole FindNearestSummon(Vector3 pos)
    {
        MonsterRole result = null;
        float       num    = 3.40282347E+38f;

        foreach (MonsterRole current in this.m_mapMonster.Values)
        {
            int  ownerCid = 0;
            bool flag     = current is MS0000;
            if (flag)
            {
                ownerCid = ((MS0000)current).owner_cid;
            }
            bool isMarked = current.m_isMarked;
            if (!isMarked)
            {
                bool flag2 = ownerCid == 0;
                if (!flag2)
                {
                    bool flag3 = ModelBase <PlayerModel> .getInstance().pk_state > PK_TYPE.PK_PEACE;

                    if (flag3)
                    {
                        bool flag4 = (long)ownerCid == (long)((ulong)ModelBase <PlayerModel> .getInstance().cid);
                        if (flag4)
                        {
                            continue;
                        }
                        bool flag5 = ModelBase <PlayerModel> .getInstance().pk_state == PK_TYPE.PK_TEAM;

                        if (flag5)
                        {
                            bool arg_102_0;
                            if (BaseProxy <TeamProxy> .getInstance().MyTeamData != null)
                            {
                                List <ItemTeamData> expr_E6 = BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList;

                                arg_102_0 = (expr_E6 != null && expr_E6.Exists((ItemTeamData member) => (ulong)member.cid == (ulong)((long)ownerCid)));
                            }
                            else
                            {
                                arg_102_0 = false;
                            }
                            bool flag6 = arg_102_0;
                            if (flag6)
                            {
                                continue;
                            }
                            bool flag7 = (long)ownerCid == (long)((ulong)ModelBase <PlayerModel> .getInstance().cid);
                            if (flag7)
                            {
                                continue;
                            }
                        }
                    }
                    float magnitude = (current.m_curPhy.position - pos).magnitude;
                    bool  flag8     = magnitude < (SelfRole.fsm.Autofighting ? Mathf.Min(SelfRole._inst.m_LockDis, StateInit.Instance.Distance) : SelfRole._inst.m_LockDis) && magnitude < num;
                    if (flag8)
                    {
                        num    = magnitude;
                        result = current;
                    }
                }
            }
        }
        return(result);
    }