Beispiel #1
0
 public override void onInit()
 {
     lgSelfPlayer.instance = this;
     this.g_mgr.g_gameM.addEventListenerCL("LG_JOIN_WORLD", 3034u, new Action <GameEvent>(this.onJoinWorld));
     this.g_mgr.g_gameM.addEventListenerCL("LG_MAP", 2160u, new Action <GameEvent>(this.onChangeMap));
     this.g_mgr.g_netM.addEventListener(40u, new Action <GameEvent>(this.onDetailInfoChangeRes));
     this.g_mgr.g_netM.addEventListener(32u, new Action <GameEvent>(this.onSelfAttChange));
     this.g_mgr.g_netM.addEventListener(61u, new Action <GameEvent>(this.onModExpRes));
 }
Beispiel #2
0
        public void useSkill(uint skillid, uint sklvl, bool force = false, LGAvatarGameInst mon = null)
        {
            float time = Time.time;
            bool  flag = time - this.lastSkillUseTimer < 0.2f;

            if (!flag)
            {
                this.lastSkillUseTimer = time;
                lgSelfPlayer instance = lgSelfPlayer.instance;
                bool         flag2    = !instance.canAttack() && !force;
                if (!flag2)
                {
                    bool             flag3 = mon == null;
                    LGAvatarGameInst lGAvatarGameInst;
                    if (flag3)
                    {
                        lGAvatarGameInst = skillbar.getAttackTarget(9999999);
                    }
                    else
                    {
                        lGAvatarGameInst = mon;
                    }
                    bool flag4 = this.autofighting && lGAvatarGameInst == null;
                    if (!flag4)
                    {
                        bool flag5 = skillid != 1001u;
                        if (flag5)
                        {
                            instance.attack(lGAvatarGameInst, false, skillid);
                        }
                        else
                        {
                            float num   = (float)muNetCleint.instance.CurServerTimeStampMS;
                            bool  flag6 = this._cur_truns_tm + this._turns_Interval < num || this.curNormalSkillTurn == 2u || (lGAvatarGameInst != null && this.lastIId != lGAvatarGameInst.iid);
                            if (flag6)
                            {
                                bool flag7 = lGAvatarGameInst != null;
                                if (flag7)
                                {
                                    this.lastIId = lGAvatarGameInst.iid;
                                }
                                this.curNormalSkillTurn = 0u;
                            }
                            else
                            {
                                this.curNormalSkillTurn += 1u;
                            }
                            uint skillid2 = skillid + this.curNormalSkillTurn;
                            this._cur_truns_tm = num;
                            instance.attack(lGAvatarGameInst, false, skillid2);
                        }
                    }
                }
            }
        }
Beispiel #3
0
        public bool eqpchk(lgSelfPlayer self, Variant attchk, gameManager mgr)
        {
            bool flag = this._selfPlayer == null;

            if (flag)
            {
                this._selfPlayer = self;
            }
            bool flag2 = this.g_mgr == null;

            if (flag2)
            {
                this.g_mgr = mgr;
            }
            string str   = attchk["name"];
            string key   = "check_" + str;
            bool   flag3 = !this.checkMethod.ContainsKey(key);

            return(flag3 || this.checkMethod[key](attchk));
        }
Beispiel #4
0
        public bool attchk(lgSelfPlayer self, Variant attchk, gameManager mgr = null)
        {
            Variant variant = self.get_value(attchk["name"]);
            bool    flag    = attchk["name"] == "carr";
            bool    result;

            if (flag)
            {
                result = lgSelfPlayer.check_carr(attchk["and"], self.data);
            }
            else
            {
                bool flag2 = attchk["name"] == "autofinlvl";
                if (flag2)
                {
                    result = (variant != null);
                }
                else
                {
                    bool flag3 = attchk.ContainsKey("have");
                    if (flag3)
                    {
                        bool isArr = variant.isArr;
                        if (isArr)
                        {
                            bool flag4 = variant._arr.IndexOf(attchk["have"]) != -1;
                            if (flag4)
                            {
                                result = true;
                                return(result);
                            }
                        }
                        else
                        {
                            bool flag5 = variant == attchk["have"];
                            if (flag5)
                            {
                                result = true;
                                return(result);
                            }
                        }
                    }
                    bool isArr2 = variant.isArr;
                    if (isArr2)
                    {
                        result = false;
                    }
                    else
                    {
                        bool flag6 = attchk.ContainsKey("equal");
                        if (flag6)
                        {
                            bool flag7 = variant == attchk["equal"];
                            result = flag7;
                        }
                        else
                        {
                            bool flag8 = attchk.ContainsKey("min") || attchk.ContainsKey("max");
                            if (flag8)
                            {
                                bool flag9 = attchk.ContainsKey("min");
                                if (flag9)
                                {
                                    bool flag10 = variant < attchk["min"];
                                    if (flag10)
                                    {
                                        result = false;
                                        return(result);
                                    }
                                }
                                bool flag11 = attchk.ContainsKey("max");
                                if (flag11)
                                {
                                    bool flag12 = variant > attchk["max"];
                                    if (flag12)
                                    {
                                        result = false;
                                        return(result);
                                    }
                                }
                                result = true;
                            }
                            else
                            {
                                result = false;
                            }
                        }
                    }
                }
            }
            return(result);
        }
Beispiel #5
0
        public bool is_can_trans_job()
        {
            lgSelfPlayer g_selfPlayer = (this.g_mgr.g_gameM as muLGClient).g_selfPlayer;
            int          carr         = g_selfPlayer.data["carr"];
            int          num          = g_selfPlayer.data["carrlvl"];
            Variant      carrlvl      = (this.g_mgr.g_gameConfM as muCLientConfig).svrGeneralConf.GetCarrlvl(carr);
            bool         flag         = carrlvl != null;
            bool         result;

            if (flag)
            {
                foreach (Variant current in carrlvl["carrlvl"]._arr)
                {
                    bool flag2 = num + 1 == current["lvl"]._int;
                    if (flag2)
                    {
                        foreach (Variant current2 in current["attchk"]._arr)
                        {
                            bool flag3 = "level" == current2["name"]._str;
                            if (flag3)
                            {
                                int  num2  = g_selfPlayer.data["level"];
                                bool flag4 = num2 < current2["min"]._int;
                                if (flag4)
                                {
                                    result = false;
                                    return(result);
                                }
                            }
                            else
                            {
                                bool flag5 = "carrlvl" == current2["name"]._str;
                                if (flag5)
                                {
                                    bool flag6 = num != current2["equal"]._int;
                                    if (flag6)
                                    {
                                        result = false;
                                        return(result);
                                    }
                                }
                                else
                                {
                                    bool flag7 = "resetlvl" == current2["name"]._str;
                                    if (flag7)
                                    {
                                        int  num3  = g_selfPlayer.data["resetlvl"];
                                        bool flag8 = num3 == current2["equal"]._int;
                                        if (flag8)
                                        {
                                            result = false;
                                            return(result);
                                        }
                                    }
                                    else
                                    {
                                        bool flag9 = "finmis" == current2["name"]._str;
                                        if (flag9)
                                        {
                                            Variant missions = (this.g_mgr.g_gameConfM as muCLientConfig).svrMisConf.get_missions();
                                            bool    flag10   = missions != null;
                                            if (flag10)
                                            {
                                                uint    num4    = current2["equal"];
                                                Variant variant = missions[num4];
                                                bool    flag11  = variant != null;
                                                if (flag11)
                                                {
                                                    bool flag12 = (this.g_mgr.g_gameM as muLGClient).g_missionCT.is_mis_has_complete((int)num4);
                                                    bool flag13 = !flag12;
                                                    if (flag13)
                                                    {
                                                        result = false;
                                                        return(result);
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        result = true;
                        return(result);
                    }
                }
            }
            result = false;
            return(result);
        }
Beispiel #6
0
        public bool CanShowIcon()
        {
            lgSelfPlayer g_selfPlayer = (this.g_mgr.g_gameM as muLGClient).g_selfPlayer;
            int          carr         = g_selfPlayer.data["carr"];
            int          num          = g_selfPlayer.data["carrlvl"];
            bool         flag         = num == 3;
            bool         result;

            if (flag)
            {
                result = false;
            }
            else
            {
                bool flag2 = num == 0;
                if (flag2)
                {
                    Variant carrlvl = (this.g_mgr.g_gameConfM as muCLientConfig).svrGeneralConf.GetCarrlvl(carr);
                    bool    flag3   = carrlvl != null;
                    if (flag3)
                    {
                        foreach (Variant current in carrlvl["carrlvl"]._arr)
                        {
                            bool flag4 = num + 1 == current["lvl"];
                            if (flag4)
                            {
                                foreach (Variant current2 in current["attchk"]._arr)
                                {
                                    bool flag5 = "level" == current2["name"];
                                    if (flag5)
                                    {
                                        int  num2  = g_selfPlayer.data["level"];
                                        bool flag6 = num2 < current2["min"]._int;
                                        if (flag6)
                                        {
                                            result = false;
                                            return(result);
                                        }
                                    }
                                    else
                                    {
                                        bool flag7 = "carrlvl" == current2["name"]._str;
                                        if (flag7)
                                        {
                                            bool flag8 = num != current2["equal"]._int;
                                            if (flag8)
                                            {
                                                result = false;
                                                return(result);
                                            }
                                        }
                                    }
                                }
                                result = true;
                                return(result);
                            }
                        }
                    }
                }
                result = true;
            }
            return(result);
        }