Example #1
0
        public float GetOneEquipmentBasePower(int equipmentId, int level, int breakthrough)
        {
            Equipment equipmentById = this.GetEquipmentById(equipmentId);

            if (equipmentById == null)
            {
                Logger.Warn("Invalid Equipment Id : {0:X}", new object[] { equipmentId });
                return(0f);
            }
            EquipBreakthrough breakthroughByTimes = equipmentById.GetBreakthroughByTimes(breakthrough);

            if (breakthroughByTimes == null)
            {
                Logger.Warn("Invalid Equipment Breakthrough : {0:X}", new object[] { breakthrough });
                return(0f);
            }
            PowerAttribute powerAttributes = breakthroughByTimes.powerAttributes;

            if (powerAttributes == null)
            {
                Logger.Warn("Invalid Equipment Breakthrough PowerBuffer is Not Find!", new object[0]);
                return(0f);
            }
            return(powerAttributes.GetValue(level));
        }
Example #2
0
        private EquipBreakthrough LoadEquipmentBreakthroughFromXml(SecurityElement element)
        {
            EquipBreakthrough breakthrough = new EquipBreakthrough {
                canGetSellItemGeneralRewards = StrParser.ParseBool(element.Attribute("CanGetSellItemGeneralRewards"), false)
            };

            if (element.Children != null)
            {
                foreach (SecurityElement element2 in element.Children)
                {
                    string tag = element2.Tag;
                    if (tag != null)
                    {
                        if (tag != "UpgradeRequirementAddtionalCost")
                        {
                            if (tag == "Breakthrough")
                            {
                                goto Label_00B4;
                            }
                            if (tag == "SellReward")
                            {
                                goto Label_00C5;
                            }
                            if (tag == "BaseAttributes")
                            {
                                goto Label_00DB;
                            }
                            if (tag == "PowerAttribute")
                            {
                                goto Label_016B;
                            }
                        }
                        else
                        {
                            breakthrough.upgradeRequirementAddtionalCost = Cost.LoadFromXml(element2);
                        }
                    }
                    continue;
Label_00B4:
                    breakthrough.breakThrough = Breakthrough.LoadFromXml(element2);
                    continue;
Label_00C5:
                    breakthrough.sellRewards.Add(Reward.LoadFromXml(element2));
                    continue;
Label_00DB:
                    if ((element2.Children != null) && (element2.Children.Count != 0))
                    {
                        foreach (SecurityElement element3 in element2.Children)
                        {
                            string str2;
                            if (((str2 = element3.Tag) != null) && (str2 == "Attribute"))
                            {
                                GrowthAttribute item = GrowthAttribute.LoadFromXml(element3);
                                if (item.baseValue != 0f)
                                {
                                    breakthrough.baseGrowthAttributes.Add(item);
                                }
                            }
                        }
                    }
                    continue;
Label_016B:
                    breakthrough.powerAttributes = PowerAttribute.LoadFromXml(element2);
                }
            }
            return(breakthrough);
        }