Example #1
0
        public void Init(ref ActorMeta actorMeta)
        {
            this.InitValueDataArr(ref actorMeta, false);
            IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.ServerDataProvider);

            ActorServerData actorData = new ActorServerData();

            if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
            {
                ResHeroCfgInfo    dataByKey = GameDataMgr.heroDatabin.GetDataByKey((long)actorMeta.ConfigId);
                ResHeroEnergyInfo info2     = GameDataMgr.heroEnergyDatabin.GetDataByKey(dataByKey.dwEnergyType);
                this.EpRecFrequency = info2.iRecFrequency;
            }
            if (actorDataProvider.GetActorServerData(ref actorMeta, ref actorData))
            {
                this.actorLvl        = (int)actorData.Level;
                this.actorExp        = (int)actorData.Exp;
                this.actorStar       = (int)actorData.Star;
                this.actorQuality    = (int)actorData.TheQualityInfo.Quality;
                this.actorSubQuality = (int)actorData.TheQualityInfo.SubQuality;
            }
            else
            {
                if (actorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
                {
                    IGameActorDataProvider provider2 = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider);

                    ActorStaticData data2 = new ActorStaticData();
                    this.actorLvl = !provider2.GetActorStaticData(ref actorMeta, ref data2) ? 1 : data2.TheMonsterOnlyInfo.MonsterBaseLevel;
                }
                else
                {
                    this.actorLvl = 1;
                }
                this.actorExp        = 0;
                this.actorStar       = 1;
                this.actorQuality    = 1;
                this.actorSubQuality = 0;
            }
        }
Example #2
0
        public void InitValueDataArr(ref ActorMeta theActorMeta, bool bLobby)
        {
            IGameActorDataProvider actorDataProvider;

            if (bLobby)
            {
                actorDataProvider = Singleton <ActorDataCenter> .get_instance().GetActorDataProvider(GameActorDataProviderType.StaticLobbyDataProvider);
            }
            else
            {
                actorDataProvider = Singleton <ActorDataCenter> .get_instance().GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider);
            }
            ActorStaticData actorStaticData = default(ActorStaticData);

            actorDataProvider.GetActorStaticData(ref theActorMeta, ref actorStaticData);
            this.m_theActorMeta = theActorMeta;
            this.EnergyType     = (EnergyType)actorStaticData.TheBaseAttribute.EpType;
            ResHeroEnergyInfo dataByKey  = GameDataMgr.heroEnergyDatabin.GetDataByKey(actorStaticData.TheBaseAttribute.EpType);
            int           nMaxLimitValue = (dataByKey == null) ? 0 : dataByKey.iEnergyMax;
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            bool bPvpMode = true;

            if (curLvelContext != null)
            {
                bPvpMode = (bLobby || curLvelContext.IsMobaMode());
            }
            this.mActorValue[5] = new ValueDataInfo(5, actorStaticData.TheBaseAttribute.BaseHp, actorStaticData.TheBaseAttribute.PerLvHp, new ValueCalculator(this.DynamicAdjustorForMgcEffect), (int)actorStaticData.TheBaseAttribute.DynamicProperty, this.GetPropMaxValueLimit(5, bPvpMode));
            DebugHelper.Assert(this.mActorValue[5].totalValue > 0, "Initialize maxhp <= 0");
            this.mActorValue[1]  = new ValueDataInfo(1, actorStaticData.TheBaseAttribute.BaseAd, actorStaticData.TheBaseAttribute.PerLvAd, new ValueCalculator(this.DynamicAdjustorForMgcEffect), (int)actorStaticData.TheBaseAttribute.DynamicProperty, this.GetPropMaxValueLimit(1, bPvpMode));
            this.mActorValue[2]  = new ValueDataInfo(2, actorStaticData.TheBaseAttribute.BaseAp, actorStaticData.TheBaseAttribute.PerLvAp, new ValueCalculator(this.DynamicAdjustor), (int)actorStaticData.TheBaseAttribute.DynamicProperty, this.GetPropMaxValueLimit(2, bPvpMode));
            this.mActorValue[3]  = new ValueDataInfo(3, actorStaticData.TheBaseAttribute.BaseDef, actorStaticData.TheBaseAttribute.PerLvDef, new ValueCalculator(this.DynamicAdjustor), (int)actorStaticData.TheBaseAttribute.DynamicProperty, this.GetPropMaxValueLimit(3, bPvpMode));
            this.mActorValue[4]  = new ValueDataInfo(4, actorStaticData.TheBaseAttribute.BaseRes, actorStaticData.TheBaseAttribute.PerLvRes, new ValueCalculator(this.DynamicAdjustor), (int)actorStaticData.TheBaseAttribute.DynamicProperty, this.GetPropMaxValueLimit(4, bPvpMode));
            this.mActorValue[32] = new ValueDataInfo(32, actorStaticData.TheBaseAttribute.BaseEp, actorStaticData.TheBaseAttribute.EpGrowth, new ValueCalculator(this.EpGrowCalculator), 0, nMaxLimitValue);
            this.mActorValue[33] = new ValueDataInfo(33, actorStaticData.TheBaseAttribute.BaseEpRecover, actorStaticData.TheBaseAttribute.PerLvEpRecover, new ValueCalculator(this.EpRecCalculator), 0, this.GetPropMaxValueLimit(33, bPvpMode));
            this.mActorValue[34] = new ValueDataInfo(34, 0, 0, null, 0, this.GetPropMaxValueLimit(34, bPvpMode));
            this.mActorValue[35] = new ValueDataInfo(35, 0, 0, null, 0, this.GetPropMaxValueLimit(35, bPvpMode));
            this.mActorValue[21] = new ValueDataInfo(21, actorStaticData.TheBaseAttribute.Sight, 0, null, 0, this.GetPropMaxValueLimit(21, bPvpMode));
            this.mActorValue[15] = new ValueDataInfo(15, actorStaticData.TheBaseAttribute.MoveSpeed, 0, null, 0, this.GetPropMaxValueLimit(15, bPvpMode));
            this.mActorValue[16] = new ValueDataInfo(16, actorStaticData.TheBaseAttribute.BaseHpRecover, actorStaticData.TheBaseAttribute.PerLvHpRecover, new ValueCalculator(this.GrowCalculator), 0, this.GetPropMaxValueLimit(16, bPvpMode));
            this.mActorValue[18] = new ValueDataInfo(18, actorStaticData.TheBaseAttribute.BaseAtkSpeed, actorStaticData.TheBaseAttribute.PerLvAtkSpeed, new ValueCalculator(this.GrowCalculator), 0, this.GetPropMaxValueLimit(18, bPvpMode));
            this.mActorValue[6]  = new ValueDataInfo(6, actorStaticData.TheBaseAttribute.CriticalChance, 0, null, 0, this.GetPropMaxValueLimit(6, bPvpMode));
            this.mActorValue[12] = new ValueDataInfo(12, actorStaticData.TheBaseAttribute.CriticalDamage, 0, null, 0, this.GetPropMaxValueLimit(12, bPvpMode));
            this.mActorValue[11] = new ValueDataInfo(11, 0, 0, null, 0, this.GetPropMaxValueLimit(11, bPvpMode));
            this.mActorValue[22] = new ValueDataInfo(22, 0, 0, null, 0, this.GetPropMaxValueLimit(22, bPvpMode));
            this.mActorValue[23] = new ValueDataInfo(23, 0, 0, null, 0, this.GetPropMaxValueLimit(23, bPvpMode));
            this.mActorValue[13] = new ValueDataInfo(13, 0, 0, null, 0, this.GetPropMaxValueLimit(13, bPvpMode));
            this.mActorValue[14] = new ValueDataInfo(14, 0, 0, null, 0, this.GetPropMaxValueLimit(14, bPvpMode));
            this.mActorValue[7]  = new ValueDataInfo(7, 0, 0, null, 0, this.GetPropMaxValueLimit(7, bPvpMode));
            this.mActorValue[8]  = new ValueDataInfo(8, 0, 0, null, 0, this.GetPropMaxValueLimit(8, bPvpMode));
            this.mActorValue[19] = new ValueDataInfo(19, 0, 0, null, 0, this.GetPropMaxValueLimit(19, bPvpMode));
            this.mActorValue[9]  = new ValueDataInfo(9, 0, 0, null, 0, this.GetPropMaxValueLimit(9, bPvpMode));
            this.mActorValue[10] = new ValueDataInfo(10, 0, 0, null, 0, this.GetPropMaxValueLimit(10, bPvpMode));
            this.mActorValue[17] = new ValueDataInfo(17, 0, 0, null, 0, this.GetPropMaxValueLimit(17, bPvpMode));
            this.mActorValue[20] = new ValueDataInfo(20, 0, 0, null, 0, this.GetPropMaxValueLimitCdReduce(bPvpMode));
            this.mActorValue[24] = new ValueDataInfo(24, 0, 0, null, 0, this.GetPropMaxValueLimit(24, bPvpMode));
            this.mActorValue[25] = new ValueDataInfo(25, 0, 0, null, 0, this.GetPropMaxValueLimit(25, bPvpMode));
            this.mActorValue[26] = new ValueDataInfo(26, 0, 0, null, 0, this.GetPropMaxValueLimit(26, bPvpMode));
            this.mActorValue[27] = new ValueDataInfo(27, 0, 0, null, 0, this.GetPropMaxValueLimit(27, bPvpMode));
            this.mActorValue[28] = new ValueDataInfo(28, 0, 0, null, 0, this.GetPropMaxValueLimit(28, bPvpMode));
            this.mActorValue[29] = new ValueDataInfo(29, 0, 0, null, 0, this.GetPropMaxValueLimit(29, bPvpMode));
            this.mActorValue[30] = new ValueDataInfo(30, 0, 0, null, 0, this.GetPropMaxValueLimit(30, bPvpMode));
            this.mActorValue[31] = new ValueDataInfo(31, 0, 0, null, 0, this.GetPropMaxValueLimit(31, bPvpMode));
            this.mActorValue[36] = new ValueDataInfo(36, 0, 0, null, 0, this.GetPropMaxValueLimit(36, bPvpMode));
        }
Example #3
0

        
Example #4
0
        public void InitValueDataArr(ref ActorMeta theActorMeta, bool bLobby)
        {
            IGameActorDataProvider actorDataProvider = null;

            if (bLobby)
            {
                actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticLobbyDataProvider);
            }
            else
            {
                actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider);
            }
            ActorStaticData actorData = new ActorStaticData();

            actorDataProvider.GetActorStaticData(ref theActorMeta, ref actorData);
            this.m_theActorMeta = theActorMeta;
            this.EnergyType     = (ENERGY_TYPE)actorData.TheBaseAttribute.EpType;
            ResHeroEnergyInfo dataByKey  = GameDataMgr.heroEnergyDatabin.GetDataByKey(actorData.TheBaseAttribute.EpType);
            int           nMaxLimitValue = (dataByKey == null) ? 0 : dataByKey.iEnergyMax;
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            bool bPvpMode = true;

            if (curLvelContext != null)
            {
                bPvpMode = !bLobby?curLvelContext.IsMobaMode() : true;
            }
            this.mActorValue[5] = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_FUNCEFT_MAXHP, actorData.TheBaseAttribute.BaseHp, actorData.TheBaseAttribute.PerLvHp, new ValueCalculator(this.DynamicAdjustorForMgcEffect), (int)actorData.TheBaseAttribute.DynamicProperty, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_FUNCEFT_MAXHP, bPvpMode));
            DebugHelper.Assert(this.mActorValue[5].totalValue > 0, "Initialize maxhp <= 0");
            this.mActorValue[1]    = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_FUNCEFT_PHYATKPT, actorData.TheBaseAttribute.BaseAd, actorData.TheBaseAttribute.PerLvAd, new ValueCalculator(this.DynamicAdjustorForMgcEffect), (int)actorData.TheBaseAttribute.DynamicProperty, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_FUNCEFT_PHYATKPT, bPvpMode));
            this.mActorValue[2]    = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_FUNCEFT_MGCATKPT, actorData.TheBaseAttribute.BaseAp, actorData.TheBaseAttribute.PerLvAp, new ValueCalculator(this.DynamicAdjustor), (int)actorData.TheBaseAttribute.DynamicProperty, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_FUNCEFT_MGCATKPT, bPvpMode));
            this.mActorValue[3]    = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_FUNCEFT_PHYDEFPT, actorData.TheBaseAttribute.BaseDef, actorData.TheBaseAttribute.PerLvDef, new ValueCalculator(this.DynamicAdjustor), (int)actorData.TheBaseAttribute.DynamicProperty, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_FUNCEFT_PHYDEFPT, bPvpMode));
            this.mActorValue[4]    = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_FUNCEFT_MGCDEFPT, actorData.TheBaseAttribute.BaseRes, actorData.TheBaseAttribute.PerLvRes, new ValueCalculator(this.DynamicAdjustor), (int)actorData.TheBaseAttribute.DynamicProperty, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_FUNCEFT_MGCDEFPT, bPvpMode));
            this.mActorValue[0x20] = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_PROPERTY_MAXEP, actorData.TheBaseAttribute.BaseEp, actorData.TheBaseAttribute.EpGrowth, new ValueCalculator(this.EpGrowCalculator), 0, nMaxLimitValue);
            this.mActorValue[0x21] = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_PROPERTY_EPRECOVER, actorData.TheBaseAttribute.BaseEpRecover, actorData.TheBaseAttribute.PerLvEpRecover, new ValueCalculator(this.EpRecCalculator), 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_PROPERTY_EPRECOVER, bPvpMode));
            this.mActorValue[0x22] = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_PROPERTY_PHYARMORHURT_RATE, 0, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_PROPERTY_PHYARMORHURT_RATE, bPvpMode));
            this.mActorValue[0x23] = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_PROPERTY_MGCARMORHURT_RATE, 0, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_PROPERTY_MGCARMORHURT_RATE, bPvpMode));
            this.mActorValue[0x15] = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_FUNCEFT_SightArea, actorData.TheBaseAttribute.Sight, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_FUNCEFT_SightArea, bPvpMode));
            this.mActorValue[15]   = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_FUNCEFT_MOVESPD, actorData.TheBaseAttribute.MoveSpeed, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_FUNCEFT_MOVESPD, bPvpMode));
            this.mActorValue[0x10] = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_FUNCEFT_HPRECOVER, actorData.TheBaseAttribute.BaseHpRecover, actorData.TheBaseAttribute.PerLvHpRecover, new ValueCalculator(this.GrowCalculator), 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_FUNCEFT_HPRECOVER, bPvpMode));
            this.mActorValue[0x12] = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_FUNCEFT_ATKSPDADD, actorData.TheBaseAttribute.BaseAtkSpeed, actorData.TheBaseAttribute.PerLvAtkSpeed, new ValueCalculator(this.GrowCalculator), 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_FUNCEFT_ATKSPDADD, bPvpMode));
            this.mActorValue[6]    = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_FUNCEFT_CRITRATE, actorData.TheBaseAttribute.CriticalChance, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_FUNCEFT_CRITRATE, bPvpMode));
            this.mActorValue[12]   = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_FUNCEFT_CRITEFT, actorData.TheBaseAttribute.CriticalDamage, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_FUNCEFT_CRITEFT, bPvpMode));
            this.mActorValue[11]   = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_FUNCEFT_ANTICRIT, 0, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_FUNCEFT_ANTICRIT, bPvpMode));
            this.mActorValue[0x16] = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_FUNCEFT_HitRate, 0, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_FUNCEFT_HitRate, bPvpMode));
            this.mActorValue[0x17] = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_FUNCEFT_HitRateAvoid, 0, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_FUNCEFT_HitRateAvoid, bPvpMode));
            this.mActorValue[13]   = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_FUNCEFT_REALHURT, 0, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_FUNCEFT_REALHURT, bPvpMode));
            this.mActorValue[14]   = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_FUNCEFT_REALHURTLESS, 0, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_FUNCEFT_REALHURTLESS, bPvpMode));
            this.mActorValue[7]    = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_FUNCEFT_PHYARMORHURT, 0, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_FUNCEFT_PHYARMORHURT, bPvpMode));
            this.mActorValue[8]    = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_FUNCEFT_MGCARMORHURT, 0, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_FUNCEFT_MGCARMORHURT, bPvpMode));
            this.mActorValue[0x13] = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_FUNCEFT_BASEHURTADD, 0, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_FUNCEFT_BASEHURTADD, bPvpMode));
            this.mActorValue[9]    = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_FUNCEFT_PHYVAMP, 0, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_FUNCEFT_PHYVAMP, bPvpMode));
            this.mActorValue[10]   = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_FUNCEFT_MGCVAMP, 0, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_FUNCEFT_MGCVAMP, bPvpMode));
            this.mActorValue[0x11] = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_FUNCEFT_CTRLREDUCE, 0, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_FUNCEFT_CTRLREDUCE, bPvpMode));
            this.mActorValue[20]   = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_FUNCEFT_CDREDUCE, 0, 0, null, 0, this.GetPropMaxValueLimitCdReduce(bPvpMode));
            this.mActorValue[0x18] = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_PROPERTY_CRITICAL, 0, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_PROPERTY_CRITICAL, bPvpMode));
            this.mActorValue[0x19] = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_PROPERTY_REDUCECRITICAL, 0, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_PROPERTY_REDUCECRITICAL, bPvpMode));
            this.mActorValue[0x1a] = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_PROPERTY_PHYSICSHEM, 0, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_PROPERTY_PHYSICSHEM, bPvpMode));
            this.mActorValue[0x1b] = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_PROPERTY_MAGICHEM, 0, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_PROPERTY_MAGICHEM, bPvpMode));
            this.mActorValue[0x1c] = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_PROPERTY_ATTACKSPEED, 0, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_PROPERTY_ATTACKSPEED, bPvpMode));
            this.mActorValue[0x1d] = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_PROPERTY_TENACITY, 0, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_PROPERTY_TENACITY, bPvpMode));
            this.mActorValue[30]   = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_PROPERTY_HURTREDUCERATE, 0, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_PROPERTY_HURTREDUCERATE, bPvpMode));
            this.mActorValue[0x1f] = new ValueDataInfo(RES_FUNCEFT_TYPE.RES_PROPERTY_HURTOUTPUTRATE, 0, 0, null, 0, this.GetPropMaxValueLimit(RES_FUNCEFT_TYPE.RES_PROPERTY_HURTOUTPUTRATE, bPvpMode));
        }