Пример #1
0
        /// <summary>
        /// 拷贝属性字段
        /// </summary>
        /// <param name="at"></param>
        public void Copy(ActorAttributeData at)
        {
            //同步AOI属性
            UnitId     = at.UnitId;
            Name       = at.Name;       //角色名字
            Level      = at.Level;      //等级
            TeamId     = at.TeamId;     //队伍id
            GuildId    = at.GuildId;    // 帮派id
            Camp       = at.Camp;       // 阵营id
            Honor      = at.Honor;      // 头衔Id
            Title      = at.Title;      // 称号Id
            EscortId   = at.EscortId;   // 正在进行中的护送任务id
            TransferLv = at.TransferLv; // 转职等级

            //同步表格属性
            Vocation            = at.Vocation;      //职业
            BehaviourTree       = at.BehaviourTree; //行为树路径
            SummonBehaviourTree = at.SummonBehaviourTree;
            DefaultMotionRadius = at.DefaultMotionRadius;
            WarTag        = at.WarTag;
            AttackRotaion = at.AttackRotaion;
            Quality       = at.Quality;
            Gravity       = at.Gravity;
            GuildName     = at.GuildName;

            // 同步服务端下发的属性
            foreach (var k in at.Attribute.Keys)
            {
                Attribute[k] = at.Attribute[k];
            }

            MP = at.MP;
            HP = at.HP;
        }
Пример #2
0
        protected virtual ActorAttributeData CreateActorAttrData(S2CNwarInitInfo pkg)
        {
            var player_attr = new ActorAttributeData();

            player_attr.UnitId.type    = (byte)EUnitType.UNITTYPE_PLAYER;
            player_attr.UnitId.obj_idx = pkg.brief.uuid;

            if (pkg.brief.uuid == Game.GetInstance().LocalPlayerID.obj_idx)
            {
                player_attr.Name = Game.GetInstance().LocalPlayerName;
                PKModeManagerEx.Instance.LocalPlayerNameColor = pkg.brief.name_color;
            }
            else
            {
                player_attr.Name = System.Text.Encoding.UTF8.GetString(pkg.brief.name);
            }

            player_attr.Camp = pkg.side;
            //player_attr.MapPos = new Vector2(pkg.init_pos.px, pkg.init_pos.py);

            // 记录下本地玩家的出生点信息
            if (pkg.brief.uuid == Game.Instance.LocalPlayerID.obj_idx)
            {
                LocalPlayerInitPos = 0;
            }
            return(player_attr);
        }
Пример #3
0
        /// <summary>
        /// 初始化角色属性
        /// </summary>
        public void InitAttribute(uint type_id, string name)
        {
            if (LocalActorAttribute == null)
            {
                LocalActorAttribute = new ActorAttributeData();
            }

            LocalActorAttribute.InitAttributeData(type_id);
            LocalActorAttribute.Name = name;
        }
Пример #4
0
        public void Reset(bool is_reconnect)
        {
            LocalActorAttribute = new ActorAttributeData();

            Exp    = 0;        //经验值
            ExpMax = 0;        //当前等级最大经验值

            Coin          = 0; //金币
            BindCoin      = 0; //绑金
            Diamond       = 0; //钻石
            BindDiamond   = 0; //绑钻
            SoulCream     = 0; //武魂精髓
            SoulHolyWater = 0; //铸魂圣水
            GuildMoney    = 0; //军团贡献
            BfireScore    = 0; //遗迹积分
            RaceScore     = 0; //职业积分
            ActivityScore = 0; // 活跃积分
            TrigramSp     = 0; //八卦牌剑灵货币
            HangTime      = 0; // 离线挂机可用时间
            Fury          = 0; // 怒气数值

            MoneyData.Clear();

            IsFirstCallBackExp = true;
            mLastBattlePower   = 0; //上一个战斗力
            WorldLevel         = 0; //世界等级
            LimitLevel         = 0; //限制等级
            HiBreak            = 0; //巅峰突破

            mLastHp    = 0;
            mLastHpMax = 0;

            mMainPetID    = 0;       //主宠ID
            mMainPetLevel = 0;       //主宠等级
            mMainPetExSkills.Clear();
            mInBattleStatus = false; // 是否在战斗状态

            mMountId = 0;            //坐骑ID

            BornRotation = Quaternion.identity;

            ReaminLvPoint = 0;

            if (is_reconnect == false)
            {                                  //非断线重连
                m_isFirstLoadingScene = false; //是否第一次进入场景
                m_canShowBuffTips     = true;  //是否可以显示获得buff提示
                FristGetNewMountId    = 0;
                m_hasInitOpenSysMount = false;
                m_hasOpenSysMount     = false;
            }
        }