public ResBattleDynamicProperty GetConfig(uint id, RES_BATTLE_DYNAMIC_PROPERTY_VAR dynVar)
        {
            if (id == 0u || this._databin == null || !this._databin.ContainsKey(id))
            {
                return(null);
            }
            ResBattleDynamicProperty result = null;
            List <object>            list   = this._databin[id];

            if (dynVar == RES_BATTLE_DYNAMIC_PROPERTY_VAR.BATTLE_TIME_VAR)
            {
                this._cprItem.dwVarPara1 = this.m_frameTimer;
                int num = list.BinarySearch(this._cprItem, this);
                if (num < 0)
                {
                    num = ~num;
                    if (num > 0)
                    {
                        result = (ResBattleDynamicProperty)list.get_Item(num - 1);
                    }
                    else if (num == 0)
                    {
                        result = (ResBattleDynamicProperty)list.get_Item(num);
                    }
                }
                else
                {
                    result = (ResBattleDynamicProperty)list.get_Item(num);
                }
            }
            return(result);
        }
        public void UpdateLogic(int delta)
        {
            this.m_frameTimer += (uint)delta;
            if (this.dynamicPropertyConfig == 0u || this._updateDatabin == null || !this._updateDatabin.ContainsKey(this.dynamicPropertyConfig) || !Singleton <BattleLogic> .GetInstance().isFighting)
            {
                return;
            }
            DynamicProperty.UpdatePropertyList updatePropertyList = this._updateDatabin[this.dynamicPropertyConfig];
            for (int i = 0; i < updatePropertyList.propertyList.get_Count(); i++)
            {
                ResBattleDynamicProperty resBattleDynamicProperty = (ResBattleDynamicProperty)updatePropertyList.propertyList.get_Item(i);
                ulong logicFrameTick = Singleton <FrameSynchr> .GetInstance().LogicFrameTick;

                if (logicFrameTick < (ulong)resBattleDynamicProperty.dwVarPara1 || i == updatePropertyList.propertyList.get_Count() - 1)
                {
                    updatePropertyList.deltaTime += (uint)(logicFrameTick - this.lastSystemTime);
                    this.lastSystemTime           = logicFrameTick;
                    if (updatePropertyList.deltaTime >= resBattleDynamicProperty.dwVarPara2)
                    {
                        updatePropertyList.deltaTime -= resBattleDynamicProperty.dwVarPara2;
                        this.UpdateActorProperty(ref resBattleDynamicProperty);
                    }
                    return;
                }
            }
        }
Exemple #3
0
        public void UpdateLogic(int delta)
        {
            this.m_frameTimer += (uint)delta;
            if (((this.dynamicPropertyConfig != 0) && (this._updateDatabin != null)) && (this._updateDatabin.ContainsKey(this.dynamicPropertyConfig) && Singleton <BattleLogic> .GetInstance().isFighting))
            {
                UpdatePropertyList list = this._updateDatabin[this.dynamicPropertyConfig];
                for (int i = 0; i < list.propertyList.Count; i++)
                {
                    ResBattleDynamicProperty property = (ResBattleDynamicProperty)list.propertyList[i];
                    ulong logicFrameTick = Singleton <FrameSynchr> .GetInstance().LogicFrameTick;

                    if ((logicFrameTick < property.dwVarPara1) || (i == (list.propertyList.Count - 1)))
                    {
                        list.deltaTime     += (uint)(logicFrameTick - this.lastSystemTime);
                        this.lastSystemTime = logicFrameTick;
                        if (list.deltaTime >= property.dwVarPara2)
                        {
                            list.deltaTime -= property.dwVarPara2;
                            this.UpdateActorProperty(ref property);
                        }
                        return;
                    }
                }
            }
        }
        private void OnVisit(ResBattleDynamicProperty InProperty)
        {
            uint dwID = InProperty.dwID;

            if (InProperty.bVarType == 1)
            {
                List <object> list;
                if (this._databin.ContainsKey(dwID))
                {
                    list = this._databin[dwID];
                }
                else
                {
                    list = new List <object>();
                    this._databin.Add(dwID, list);
                }
                list.Add(InProperty);
            }
            else if (InProperty.bVarType == 2)
            {
                DynamicProperty.UpdatePropertyList updatePropertyList;
                if (this._updateDatabin.ContainsKey(dwID))
                {
                    updatePropertyList = this._updateDatabin[dwID];
                }
                else
                {
                    updatePropertyList              = new DynamicProperty.UpdatePropertyList();
                    updatePropertyList.deltaTime    = 0u;
                    updatePropertyList.propertyList = new List <object>();
                    this._updateDatabin.Add(dwID, updatePropertyList);
                }
                updatePropertyList.propertyList.Add(InProperty);
            }
        }
Exemple #5
0
        public ResBattleDynamicProperty GetConfig(uint id, RES_BATTLE_DYNAMIC_PROPERTY_VAR dynVar)
        {
            if (((id == 0) || (this._databin == null)) || !this._databin.ContainsKey(id))
            {
                return(null);
            }
            ResBattleDynamicProperty property = null;
            List <object>            list     = this._databin[id];

            if (dynVar != RES_BATTLE_DYNAMIC_PROPERTY_VAR.BATTLE_TIME_VAR)
            {
                return(property);
            }
            this._cprItem.dwVarPara1 = this.m_frameTimer;
            int num = list.BinarySearch(this._cprItem, this);

            if (num < 0)
            {
                num = ~num;
                if (num > 0)
                {
                    return((ResBattleDynamicProperty)list[num - 1]);
                }
                if (num != 0)
                {
                    return(property);
                }
                return((ResBattleDynamicProperty)list[num]);
            }
            return((ResBattleDynamicProperty)list[num]);
        }
        public int GetDynamicDamage(uint id, int baseValue)
        {
            ResBattleDynamicProperty config = this.GetConfig(id, RES_BATTLE_DYNAMIC_PROPERTY_VAR.BATTLE_TIME_VAR);

            if (config != null)
            {
                baseValue = baseValue * config.iDamage / 10000;
            }
            return(baseValue);
        }
Exemple #7
0
        public int GetDynamicDamage(uint id, int baseValue)
        {
            ResBattleDynamicProperty config = this.GetConfig(id, 1);

            if (config != null)
            {
                baseValue = baseValue * config.iDamage / 10000;
            }
            return(baseValue);
        }
Exemple #8
0
        public uint GetDynamicSoulExp(uint id, int baseValue)
        {
            ResBattleDynamicProperty config = this.GetConfig(id, 1);

            if (config != null)
            {
                baseValue = baseValue * config.iSoulExp / 10000;
            }
            return((uint)baseValue);
        }
Exemple #9
0
        public uint GetDynamicSoulExp(uint id, int baseValue)
        {
            ResBattleDynamicProperty config = this.GetConfig(id, RES_BATTLE_DYNAMIC_PROPERTY_VAR.BATTLE_TIME_VAR);

            if (config != null)
            {
                baseValue = (baseValue * config.iSoulExp) / 0x2710;
            }
            return((uint)baseValue);
        }
Exemple #10
0
        public int GetDynamicReviveTime(uint id, int baseValue)
        {
            ResBattleDynamicProperty config = this.GetConfig(id, RES_BATTLE_DYNAMIC_PROPERTY_VAR.BATTLE_TIME_VAR);

            if (config != null)
            {
                baseValue = (baseValue * config.iReviveTime) / 0x2710;
            }
            return(baseValue);
        }
        public void UpdateActorProperty(ref ResBattleDynamicProperty _property)
        {
            List <PoolObjHandle <ActorRoot> > heroActors = Singleton <GameObjMgr> .GetInstance().HeroActors;

            for (int i = 0; i < heroActors.get_Count(); i++)
            {
                PoolObjHandle <ActorRoot> ptr = heroActors.get_Item(i);
                if (_property.iSoulExp != 0 && ptr)
                {
                    ptr.handle.ValueComponent.AddSoulExp((int)IncomeControl.GetCompensateExp(ptr.handle, (uint)_property.iSoulExp), false, AddSoulType.Dynamic);
                    ptr.handle.ValueComponent.ChangeGoldCoinInBattle((int)_property.bGoldCoinInBattleAutoIncreaseValue, true, false, default(Vector3), false, default(PoolObjHandle <ActorRoot>));
                }
            }
        }
Exemple #12
0
        public void UpdateActorProperty(ref ResBattleDynamicProperty _property)
        {
            List <PoolObjHandle <ActorRoot> > heroActors = Singleton <GameObjMgr> .GetInstance().HeroActors;

            for (int i = 0; i < heroActors.Count; i++)
            {
                PoolObjHandle <ActorRoot> handle = heroActors[i];
                if ((_property.iSoulExp != 0) && (handle != 0))
                {
                    handle.handle.ValueComponent.AddSoulExp(_property.iSoulExp, false, AddSoulType.Dynamic);
                    Vector3 position = new Vector3();
                    handle.handle.ValueComponent.ChangeGoldCoinInBattle(_property.bGoldCoinInBattleAutoIncreaseValue, true, false, position, false);
                }
            }
        }
Exemple #13
0
        public void FightStart()
        {
            this._cprItem       = new ResBattleDynamicProperty();
            this._databin       = new DictionaryView <uint, List <object> >();
            this._updateDatabin = new DictionaryView <uint, UpdatePropertyList>();
            this.lastSystemTime = Singleton <FrameSynchr> .GetInstance().LogicFrameTick;

            this.ResetTimer();
            GameDataMgr.battleDynamicPropertyDB.Accept(new Action <ResBattleDynamicProperty>(this.OnVisit));
            SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

            if (curLvelContext != null)
            {
                this.dynamicPropertyConfig = curLvelContext.m_dynamicPropertyConfig;
            }
        }
Exemple #14
0
        public static int Adjustor(ValueDataInfo vdi)
        {
            int baseValue = vdi.baseValue;

            if (vdi.dynamicId < 1)
            {
                return(baseValue);
            }
            ResBattleDynamicProperty config = Singleton <BattleLogic> .get_instance().dynamicProperty.GetConfig((uint)vdi.dynamicId, 1);

            int num = 10000;

            if (config != null)
            {
                switch (vdi.Type)
                {
                case 1:
                    num = config.iAD;
                    break;

                case 2:
                    num = config.iAP;
                    break;

                case 3:
                    num = config.iDef;
                    break;

                case 4:
                    num = config.iRes;
                    break;

                case 5:
                    num = config.iHP;
                    break;

                default:
                    num = 10000;
                    break;
                }
            }
            return(baseValue * num / 10000);
        }
        public static int Adjustor(ValueDataInfo vdi)
        {
            int baseValue = vdi.baseValue;

            if (vdi.dynamicId < 1)
            {
                return(baseValue);
            }
            ResBattleDynamicProperty config = Singleton <BattleLogic> .instance.dynamicProperty.GetConfig((uint)vdi.dynamicId, RES_BATTLE_DYNAMIC_PROPERTY_VAR.BATTLE_TIME_VAR);

            int num = 10000;

            if (config != null)
            {
                switch (vdi.Type)
                {
                case RES_FUNCEFT_TYPE.RES_FUNCEFT_PHYATKPT:
                    num = config.iAD;
                    break;

                case RES_FUNCEFT_TYPE.RES_FUNCEFT_MGCATKPT:
                    num = config.iAP;
                    break;

                case RES_FUNCEFT_TYPE.RES_FUNCEFT_PHYDEFPT:
                    num = config.iDef;
                    break;

                case RES_FUNCEFT_TYPE.RES_FUNCEFT_MGCDEFPT:
                    num = config.iRes;
                    break;

                case RES_FUNCEFT_TYPE.RES_FUNCEFT_MAXHP:
                    num = config.iHP;
                    break;

                default:
                    num = 10000;
                    break;
                }
            }
            return(baseValue * num / 10000);
        }
Exemple #16
0
        public static int Adjustor(ValueDataInfo vdi)
        {
            int baseValue = vdi.baseValue;

            if (vdi.dynamicId < 1)
            {
                return(baseValue);
            }
            ResBattleDynamicProperty config = Singleton <BattleLogic> .instance.dynamicProperty.GetConfig((uint)vdi.dynamicId, RES_BATTLE_DYNAMIC_PROPERTY_VAR.BATTLE_TIME_VAR);

            int iAD = 0x2710;

            if (config != null)
            {
                switch (vdi.Type)
                {
                case RES_FUNCEFT_TYPE.RES_FUNCEFT_PHYATKPT:
                    iAD = config.iAD;
                    goto Label_00A7;

                case RES_FUNCEFT_TYPE.RES_FUNCEFT_MGCATKPT:
                    iAD = config.iAP;
                    goto Label_00A7;

                case RES_FUNCEFT_TYPE.RES_FUNCEFT_PHYDEFPT:
                    iAD = config.iDef;
                    goto Label_00A7;

                case RES_FUNCEFT_TYPE.RES_FUNCEFT_MGCDEFPT:
                    iAD = config.iRes;
                    goto Label_00A7;

                case RES_FUNCEFT_TYPE.RES_FUNCEFT_MAXHP:
                    iAD = config.iHP;
                    goto Label_00A7;
                }
                iAD = 0x2710;
            }
Label_00A7:
            return((baseValue * iAD) / 0x2710);
        }
Exemple #17
0
        public uint GetDynamicGoldCoinInBattle(uint id, int baseValue, int floatRange)
        {
            ResBattleDynamicProperty config = this.GetConfig(id, RES_BATTLE_DYNAMIC_PROPERTY_VAR.BATTLE_TIME_VAR);

            if (config != null)
            {
                baseValue = (baseValue * config.wGoldCoinInBattleIncreaseRate) / 0x2710;
            }
            int num = 0;

            if (floatRange > 0)
            {
                num = FrameRandom.Random((uint)((floatRange * 2) + 1)) - floatRange;
            }
            int num2 = baseValue + num;

            if (num2 < 0)
            {
                num2 = 0;
            }
            return((uint)num2);
        }
Exemple #18
0
        public uint GetDynamicGoldCoinInBattle(uint id, int baseValue, int floatRange)
        {
            ResBattleDynamicProperty config = this.GetConfig(id, 1);

            if (config != null)
            {
                baseValue = baseValue * (int)config.wGoldCoinInBattleIncreaseRate / 10000;
            }
            int num = 0;

            if (floatRange > 0)
            {
                num = (int)FrameRandom.Random((uint)(floatRange * 2 + 1)) - floatRange;
            }
            int num2 = baseValue + num;

            if (num2 < 0)
            {
                num2 = 0;
            }
            return((uint)num2);
        }
Exemple #19
0
        private void OnVisit(ResBattleDynamicProperty InProperty)
        {
            uint dwID = InProperty.dwID;

            if (InProperty.bVarType == 1)
            {
                List <object> list = null;
                if (this._databin.ContainsKey(dwID))
                {
                    list = this._databin[dwID];
                }
                else
                {
                    list = new List <object>();
                    this._databin.Add(dwID, list);
                }
                list.Add(InProperty);
            }
            else if (InProperty.bVarType == 2)
            {
                UpdatePropertyList list2;
                if (this._updateDatabin.ContainsKey(dwID))
                {
                    list2 = this._updateDatabin[dwID];
                }
                else
                {
                    list2 = new UpdatePropertyList {
                        deltaTime    = 0,
                        propertyList = new List <object>()
                    };
                    this._updateDatabin.Add(dwID, list2);
                }
                list2.propertyList.Add(InProperty);
            }
        }
Exemple #20
0
 public void FightOver()
 {
     this._databin = null;
     this._cprItem = null;
 }