コード例 #1
0
        public void enforcePerkLegality(Player player)
        {
            int num = ConfigPerks.NUM_RANDOM_PERKS_PER_ITEM_RARITY[this.Rarity];

            while (this.Perks.PerkInstances.Count > num)
            {
                this.Perks.PerkInstances.RemoveAt(this.Perks.PerkInstances.Count - 1);
            }
            while (this.Perks.PerkInstances.Count < num)
            {
                this.Perks.PerkInstances.Add(ConfigPerks.RollNewRandomItemPerkInstance(this.Item.Type, this.Perks, player));
            }
            for (int i = 0; i < this.Perks.PerkInstances.Count; i++)
            {
                ItemType itemType           = this.Item.Type;
                PerkType type               = this.Perks.PerkInstances[i].Type;
                ConfigPerks.SharedData data = ConfigPerks.SHARED_DATA[type];
                if (!ConfigPerks.ItemTypeSupportsPerk(itemType, type))
                {
                    this.Perks.PerkInstances[i] = ConfigPerks.RollNewRandomItemPerkInstance(itemType, this.Perks, player);
                }
                else if (!player.hasUnlockedSkill(data.LinkedToSkill))
                {
                    this.Perks.PerkInstances[i] = ConfigPerks.RollNewRandomItemPerkInstance(itemType, this.Perks, player);
                }
                else if (this.Perks.PerkInstances[i].Modifier < data.ModifierMin)
                {
                    this.Perks.PerkInstances[i].Modifier = data.ModifierMin;
                }
                else if (this.Perks.PerkInstances[i].Modifier > data.ModifierMax)
                {
                    this.Perks.PerkInstances[i].Modifier = data.ModifierMax;
                }
            }
        }
コード例 #2
0
        public static string GetDescription(string[] parameters)
        {
            Parameters parameters2 = ParseParameters(parameters);

            switch (parameters2.SkillType)
            {
            case SkillType.BossDefender:
                return(_.L(ConfigLoca.BOSS_AI_DEFENDER, null, false));

            case SkillType.BossSplitter:
                return(_.L(ConfigLoca.BOSS_AI_SPLITTER, null, false));

            case SkillType.NONE:
                return("Error! Invalid caster");
            }
            int count = parameters2.PerkTypes.Count;

            for (int i = 0; i < count; i++)
            {
                ConfigPerks.SharedData data = ConfigPerks.SHARED_DATA[parameters2.PerkTypes[i]];
                if (data.LinkedToSkill != parameters2.SkillType)
                {
                    return("Error! Invalid caster");
                }
            }
            if (count > 0)
            {
                return(_.L(ConfigLoca.BOSS_AI_CASTER_WITH_PERK, new < > __AnonType0 <string, string>(_.L(ConfigPerks.SHARED_DATA[parameters2.PerkTypes[0]].ShortDescription, null, false), _.L(ConfigSkills.SHARED_DATA[parameters2.SkillType].Name, null, false)), false));
            }
            return(_.L(ConfigLoca.BOSS_AI_CASTER, new < > __AnonType1 <string>(_.L(ConfigSkills.SHARED_DATA[parameters2.SkillType].Name, null, true)), false));
        }
コード例 #3
0
 public void startBuffFromPerk(CharacterInstance c, PerkType perkType, float durationSeconds, double modifier, BuffSource source, [Optional, DefaultParameterValue(null)] CharacterInstance sourceCharacter)
 {
     if (!c.IsDead)
     {
         if (source.IconProvider != null)
         {
         }
         ConfigPerks.SharedData data = ConfigPerks.SHARED_DATA[perkType];
         Buff buff2 = new Buff();
         buff2.Source                 = source;
         buff2.SourceCharacter        = sourceCharacter;
         buff2.FromPerk               = perkType;
         buff2.BaseStat1              = data.BuffBaseStat1;
         buff2.BaseStat2              = data.BuffBaseStat2;
         buff2.Stuns                  = data.Stuns;
         buff2.Modifier               = (float)modifier;
         buff2.ModifierBuildupTick    = data.ModifierBuildupTick;
         buff2.DurationSeconds        = durationSeconds;
         buff2.AllSkillsCooldownBonus = !data.AllSkillsCooldownBonus ? 0f : ((float)modifier);
         buff2.DamagePerSecond        = !data.DamagePerSecond ? 0.0 : modifier;
         buff2.ViewScaleModifier      = data.ViewScaleModifier;
         buff2.HudSprite              = (source.IconProvider == null) ? null : source.IconProvider.getSpriteId();
         buff2.HudShowStacked         = data.ShowStackedInHud;
         buff2.HudShowModifier        = data.ShowModifierInHud;
         buff2.HudHideTimer           = data.HideTimerInHud;
         Buff buff = buff2;
         this.startBuff(c, buff);
     }
 }
コード例 #4
0
 public int getRunestoneSkillGroupIndex(string runestoneId)
 {
     ConfigRunestones.SharedData runestoneData = ConfigRunestones.GetRunestoneData(runestoneId);
     ConfigPerks.SharedData      data2         = ConfigPerks.SHARED_DATA[runestoneData.PerkInstance.Type];
     ConfigSkills.SharedData     data3         = ConfigSkills.SHARED_DATA[data2.LinkedToSkill];
     return(data3.Group);
 }
コード例 #5
0
 public void initialize(string upgradeId, RunestoneMilestone upgradeMilestone, int levelRequirement, bool stripedRow, bool isUnlocked)
 {
     this.UpgradeMilestone = upgradeMilestone;
     this.LevelReq.text    = "Rank " + levelRequirement;
     this.Icon.enabled     = true;
     if (this.UpgradeMilestone.Perk != null)
     {
         PerkInstance           perk     = this.UpgradeMilestone.Perk;
         PerkType               perkType = perk.Type;
         ConfigPerks.SharedData data     = ConfigPerks.SHARED_DATA[perkType];
         this.Icon.sprite      = PlayerView.Binder.SpriteResources.getSprite("Menu", data.SmallSprite);
         this.Description.text = MenuHelpers.GetFormattedPerkDescription(perkType, perk.Modifier, data.DurationSeconds, data.Threshold, 0f, true);
     }
     else
     {
         this.Icon.sprite      = null;
         this.Description.text = "CHANGE ME";
     }
     this.Background.color = !stripedRow ? ConfigUi.LIST_CELL_REGULAR_COLOR : ConfigUi.LIST_CELL_STRIPED_COLOR;
     if (isUnlocked)
     {
         this.CanvasGroup.alpha = 1f;
         this.Icon.material     = null;
     }
     else
     {
         this.CanvasGroup.alpha = 0.5f;
         this.Icon.material     = PlayerView.Binder.DisabledUiMaterial;
     }
 }
コード例 #6
0
ファイル: PerkSystem.cs プロジェクト: hackerlank/UnityGameSrc
 protected void Awake()
 {
     if (!ConfigApp.ProductionBuild)
     {
         for (int i = 0; i < ConfigPerks.ALL_PERKS.Count; i++)
         {
             ConfigPerks.SharedData data = ConfigPerks.SHARED_DATA[ConfigPerks.ALL_PERKS[i]];
         }
     }
 }
コード例 #7
0
 public float getSkillCooldownModifier(SkillType skillType)
 {
     if (skillType != SkillType.NONE)
     {
         ConfigPerks.SharedData data = ConfigPerks.SHARED_DATA[this.Type];
         if (data.AllSkillsCooldownBonus)
         {
             return(this.Modifier);
         }
         if (data.SkillCooldownBonus == skillType)
         {
             return(this.Modifier);
         }
     }
     return(0f);
 }
コード例 #8
0
            public override bool canComplete(Player player)
            {
                switch (this.m_type)
                {
                case Type.Freeze:
                    for (int i = 0; i < player.Runestones.RunestoneInstances.Count; i++)
                    {
                        PerkType type = player.Runestones.RunestoneInstances[i].getPerkType();
                        ConfigPerks.SharedData data = ConfigPerks.SHARED_DATA[type];
                        if (data.EffectType == ConfigPerks.GlobalFrostEffect.EffectType)
                        {
                            return(true);
                        }
                    }
                    break;

                case Type.Poison:
                    for (int j = 0; j < player.Runestones.RunestoneInstances.Count; j++)
                    {
                        PerkType type2 = player.Runestones.RunestoneInstances[j].getPerkType();
                        ConfigPerks.SharedData data2 = ConfigPerks.SHARED_DATA[type2];
                        if (data2.EffectType == ConfigPerks.GlobalPoisonEffect.EffectType)
                        {
                            return(true);
                        }
                    }
                    break;

                case Type.Stun:
                    for (int k = 0; k < player.Runestones.RunestoneInstances.Count; k++)
                    {
                        PerkType type3 = player.Runestones.RunestoneInstances[k].getPerkType();
                        ConfigPerks.SharedData data3 = ConfigPerks.SHARED_DATA[type3];
                        if (data3.Stuns)
                        {
                            return(true);
                        }
                    }
                    break;
                }
                return(false);
            }
コード例 #9
0
        public static string GetFormattedPlayerUpgradePerkDescription(PerkInstance pi, float evolveBonus, bool colors)
        {
            ConfigPerks.SharedData data = ConfigPerks.SHARED_DATA[pi.Type];
            string input = _.L(data.Description, null, false);
            Match  match = Regex.Match(input, @"(\$.*\$)");

            if ((match.Groups.Count <= 1) || !match.Groups[1].Success)
            {
                return(input);
            }
            string baseString = match.Groups[1].ToString();
            string newValue   = GetFormattedPerkString(pi.Type, baseString, pi.Modifier, data.DurationSeconds, data.Threshold, evolveBonus, false, true, false);

            if (colors)
            {
                string[] textArray1 = new string[] { "<color=#", ConfigUi.PERK_DESCRIPTION_VARIABLE_TEXT_COLOR_HEX, ">", newValue, "</color>" };
                newValue = string.Concat(textArray1);
            }
            return(input.Replace(baseString, newValue));
        }
コード例 #10
0
        public static string GetFormattedItemPerkDescription(ItemInstance ii, PerkInstance pi)
        {
            ConfigPerks.SharedData data = ConfigPerks.SHARED_DATA[pi.Type];
            string input = _.L(data.Description, null, false);
            Match  match = Regex.Match(input, @"(\$.*\$)");

            if ((match.Groups.Count <= 1) || !match.Groups[1].Success)
            {
                return("CHANGE ME");
            }
            int    evolveRank = ii.EvolveRank;
            string baseString = match.Groups[1].ToString();
            string str3       = GetFormattedPerkString(pi.Type, baseString, pi.Modifier, data.DurationSeconds, data.Threshold, ii.getEvolveBonusForPerk(pi.Type, 1), false, false, false);
            string str4       = GetFormattedPerkString(pi.Type, baseString, pi.Modifier, data.DurationSeconds, data.Threshold, ii.getEvolveBonusForPerk(pi.Type, evolveRank), false, true, false);

            if (1 < evolveRank)
            {
                string[] textArray1 = new string[] { "<color=#", ConfigUi.PERK_DESCRIPTION_VARIABLE_TEXT_COLOR_HEX, ">", str3, "</color>", "+", "<color=#", ConfigUi.PERK_DESCRIPTION_BONUS_VARIABLE_TEXT_COLOR_HEX, ">", str4, "</color>" };
                return(input.Replace(baseString, string.Concat(textArray1)));
            }
            string[] textArray2 = new string[] { "<color=#", ConfigUi.PERK_DESCRIPTION_VARIABLE_TEXT_COLOR_HEX, ">", str4, "</color>" };
            return(input.Replace(baseString, string.Concat(textArray2)));
        }
コード例 #11
0
        protected override void onRefresh()
        {
            Player            player          = GameLogic.Binder.GameState.Player;
            CharacterInstance activeCharacter = player.ActiveCharacter;

            GameLogic.Item item = this.getReferenceItem();
            if (this.ItemInstance != null)
            {
                int num;
                this.PowerText.text = MenuHelpers.BigValueToString(App.Binder.ConfigMeta.ItemPowerCurve(this.ItemInstance.Item.Type, player.getRiggedItemLevel(this.ItemInstance), this.ItemInstance.Rank));
                int num2 = activeCharacter.getItemInstantUpgradeCount(this.ItemInstance, out num);
                if (num2 > ConfigMeta.ITEM_INSTANT_UPGRADE_LEVEL_THRESHOLD)
                {
                    this.SpecialOfferPanel.SetActive(true);
                    this.InstantUpgradeText.text = _.L(ConfigLoca.ITEMINFO_INSTANT_UPGRADE_DESCIPTION, new < > __AnonType8 <int>(num), false);
                    this.InstantUpgradeButton.ButtonScript.interactable = num2 > 0;
                    this.InstantUpgradeButton.ButtonImage.material      = !this.InstantUpgradeButton.ButtonScript.interactable ? PlayerView.Binder.DisabledUiMaterial : null;
                    this.InstantUpgradeButton.ButtonIcon.material       = this.InstantUpgradeButton.ButtonImage.material;
                }
                else
                {
                    this.SpecialOfferPanel.SetActive(false);
                }
                if (player.canEvolveItem(this.ItemInstance))
                {
                    this.EquipButton.enabled       = true;
                    this.EquipButtonImage.material = null;
                    this.EquipButtonText.text      = StringExtensions.ToUpperLoca(_.L(ConfigLoca.UI_PROMPT_UPGRADE, null, false));
                    this.EquipButtonPulse.enabled  = true;
                }
                else if (activeCharacter.isItemInstanceEquipped(this.ItemInstance))
                {
                    this.EquipButton.enabled        = false;
                    this.EquipButtonImage.material  = PlayerView.Binder.DisabledUiMaterial;
                    this.EquipButtonText.text       = StringExtensions.ToUpperLoca(_.L(ConfigLoca.UI_PROMPT_EQUIPPED, null, false));
                    this.EquipButtonPulse.enabled   = false;
                    this.IconSelectedBorder.enabled = true;
                }
                else if (!activeCharacter.hasReachedUnlockFloorForItem(this.ItemInstance))
                {
                    this.EquipButton.enabled        = false;
                    this.EquipButtonImage.material  = PlayerView.Binder.DisabledUiMaterial;
                    this.EquipButtonText.text       = StringExtensions.ToUpperLoca(_.L(ConfigLoca.UI_PROMPT_FLOOR_X, new < > __AnonType15 <int>(this.ItemInstance.UnlockFloor), false));
                    this.EquipButtonPulse.enabled   = false;
                    this.IconSelectedBorder.enabled = false;
                }
                else if (!this.ItemInstance.Unlocked)
                {
                    this.EquipButton.enabled        = false;
                    this.EquipButtonImage.material  = PlayerView.Binder.DisabledUiMaterial;
                    this.EquipButtonText.text       = StringExtensions.ToUpperLoca(_.L(ConfigLoca.UI_PROMPT_LOCKED, null, false));
                    this.EquipButtonPulse.enabled   = false;
                    this.IconSelectedBorder.enabled = false;
                }
                else
                {
                    this.EquipButton.enabled        = true;
                    this.EquipButtonImage.material  = null;
                    this.EquipButtonText.text       = StringExtensions.ToUpperLoca(_.L(ConfigLoca.UI_PROMPT_EQUIP, null, false));
                    this.EquipButtonPulse.enabled   = false;
                    this.IconSelectedBorder.enabled = false;
                }
                this.LevelText.text = (player.getRiggedItemLevel(this.ItemInstance) + this.ItemInstance.Rank).ToString();
            }
            else
            {
                this.PowerText.text = "0";
                this.LevelText.text = "1";
                this.SpecialOfferPanel.SetActive(false);
            }
            if ((this.ItemInstance != null) && (this.ItemInstance.Perks.count() > 0))
            {
                this.RerollButton.interactable = true;
                this.RerollCost.text           = App.Binder.ConfigMeta.ItemRerollDiamondCostCurve(this.ItemInstance.Rarity, this.ItemInstance.RerollCount).ToString();
            }
            else
            {
                this.RerollButton.interactable = false;
                this.RerollCost.text           = "-";
            }
            this.RerollButtonImage.material = !this.RerollButton.interactable ? PlayerView.Binder.DisabledUiMaterial : null;
            int num3 = item.FixedPerks.count();

            if (num3 > 0)
            {
                IconWithText           text      = this.Perks[0];
                PerkInstance           instance2 = item.FixedPerks.PerkInstances[0];
                ConfigPerks.SharedData data      = ConfigPerks.SHARED_DATA[instance2.Type];
                text.gameObject.SetActive(true);
                text.Text.text = MenuHelpers.GetFormattedPerkDescription(instance2.Type, instance2.Modifier, data.DurationSeconds, data.Threshold, 0f, false);
            }
            else
            {
                this.Perks[0].gameObject.SetActive(false);
            }
            int count = this.ItemInstance.Perks.PerkInstances.Count;

            for (int i = 1; i < this.Perks.Count; i++)
            {
                IconWithText text2     = this.Perks[i];
                PerkInstance instance3 = null;
                if ((this.ItemInstance != null) && ((i - 1) < count))
                {
                    instance3 = this.ItemInstance.Perks.PerkInstances[i - 1];
                }
                if (instance3 != null)
                {
                    ConfigPerks.SharedData data2 = ConfigPerks.SHARED_DATA[instance3.Type];
                    text2.gameObject.SetActive(true);
                    text2.Icon.sprite = PlayerView.Binder.SpriteResources.getSprite("Menu", data2.SmallSprite);
                    if (this.ItemInstance != null)
                    {
                        text2.Text.text = MenuHelpers.GetFormattedPerkDescription(instance3.Type, instance3.Modifier, data2.DurationSeconds, data2.Threshold, 0f, true);
                    }
                    else
                    {
                        text2.Text.text = "CHANGE ME";
                    }
                }
                else
                {
                    text2.gameObject.SetActive(false);
                }
            }
            this.PerksTitleDivier.SetActive((num3 + count) > 0);
        }
コード例 #12
0
 private void loadPetCharacterCsv(string csvFilePath)
 {
     string[,] strArray = CsvUtils.Deserialize(ResourceUtil.LoadSafe <TextAsset>(csvFilePath, false).text);
     for (int i = 0; i < strArray.GetLength(1); i++)
     {
         if (strArray[0, i] == null)
         {
             continue;
         }
         Character e    = new Character();
         int       num2 = 0;
         e.Id   = strArray[num2++, i];
         e.Name = _.L(strArray[num2++, i], null, false);
         num2++;
         e.FlavorText      = _.L(strArray[num2++, i], null, false);
         e.Type            = GameLogic.CharacterType.Pet;
         e.Prefab          = base.parseEnumType <CharacterPrefab>(strArray[num2++, i]);
         e.Rarity          = base.parseInt(strArray[num2++, i]);
         e.AvatarSpriteId  = strArray[num2++, i];
         e.CoreAiBehaviour = base.parseEnumType <AiBehaviourType>(strArray[num2++, i]);
         KeyValuePair <string, float>   pair      = base.parseStringFloatPair(strArray[num2++, i]);
         KeyValuePair <string, float>   pair2     = base.parseStringFloatPair(strArray[num2++, i]);
         KeyValuePair <string, float>   pair3     = base.parseStringFloatPair(strArray[num2++, i]);
         KeyValuePair <string, float>   pair4     = base.parseStringFloatPair(strArray[num2++, i]);
         KeyValuePair <string, float>[] pairArray = new KeyValuePair <string, float>[] { pair, pair2, pair3, pair4 };
         e.FixedPerks = new GatedPerkContainer();
         for (int j = 0; j < pairArray.Length; j++)
         {
             if (string.IsNullOrEmpty(pairArray[j].Key) || (j >= ConfigGameplay.PET_PERK_MILESTONE_LEVELS.Count))
             {
                 break;
             }
             int      num4               = ConfigGameplay.PET_PERK_MILESTONE_LEVELS[j];
             PerkType perkType           = base.parseEnumType <PerkType>(pairArray[j].Key);
             ConfigPerks.SharedData data = ConfigPerks.SHARED_DATA[perkType];
             float bestModifier          = (data.LinkedToRunestone == null) ? pairArray[j].Value : ConfigRunestones.GetRunestoneData(data.LinkedToRunestone).PerkInstance.Modifier;
             if (bestModifier == 0f)
             {
                 bestModifier = ConfigPerks.GetBestModifier(perkType);
             }
             GatedPerkContainer.Entry item = new GatedPerkContainer.Entry();
             item.RankReq = num4;
             PerkInstance instance = new PerkInstance();
             instance.Type     = perkType;
             instance.Modifier = bestModifier;
             item.PerkInstance = instance;
             e.FixedPerks.Entries.Add(item);
         }
         e.RangedProjectileType        = base.parseEnumType <ProjectileType>(strArray[num2++, i]);
         e.MainHeroDamagePerHitPct     = base.parseFloat(strArray[num2++, i]);
         e.AttackContactTimeNormalized = base.parseFloat(strArray[num2++, i]);
         e.BaseStats = new Dictionary <string, double>();
         e.BaseStats.Add(BaseStatProperty.AttacksPerSecond.ToString(), base.parseDouble(strArray[num2++, i]));
         e.BaseStats.Add(BaseStatProperty.AttackRange.ToString(), base.parseDouble(strArray[num2++, i]));
         e.BaseStats.Add(BaseStatProperty.CriticalHitChancePct.ToString(), base.parseDouble(strArray[num2++, i]));
         e.BaseStats.Add(BaseStatProperty.CriticalHitMultiplier.ToString(), base.parseDouble(strArray[num2++, i]));
         e.BaseStats.Add(BaseStatProperty.CleaveDamagePct.ToString(), base.parseDouble(strArray[num2++, i]));
         e.BaseStats.Add(BaseStatProperty.CleaveRange.ToString(), base.parseDouble(strArray[num2++, i]));
         e.BaseStats.Add(BaseStatProperty.MovementSpeed.ToString(), base.parseDouble(strArray[num2++, i]));
         e.BaseStats.Add(BaseStatProperty.Threat.ToString(), base.parseDouble(strArray[num2++, i]));
         e.BaseStats.Add(BaseStatProperty.Life.ToString(), 999.0);
         e.BaseStats.Add(BaseStatProperty.DamagePerHit.ToString(), 0.0);
         e.BaseStats.Add(BaseStatProperty.UniversalArmorBonus.ToString(), 0.0);
         e.BaseStats.Add(BaseStatProperty.SkillDamage.ToString(), 0.0);
         e.BaseStats.Add(BaseStatProperty.UniversalXpBonus.ToString(), 0.0);
         this.postProcess(e);
     }
 }
コード例 #13
0
        protected override void onPreShow([Optional, DefaultParameterValue(null)] object param)
        {
            RewardGalleryCell.Content content4;
            MiniPopupEntry            entry3;
            MiniPopupMenu             contentMenu = (MiniPopupMenu)base.m_contentMenu;

            this.m_param = param;
            this.m_shopPurchaseController = null;
            if (param is PlayerAugmentation)
            {
                contentMenu.MainButton.gameObject.SetActive(true);
                this.DualButtonLeft.gameObject.SetActive(false);
                this.DualButtonRight.gameObject.SetActive(false);
                PlayerAugmentation augmentation = (PlayerAugmentation)param;
                SpriteAtlasEntry   sprite       = null;
                string             overrideDescriptionTextLocalized = null;
                string             str2 = null;
                if (augmentation.PerkInstance != null)
                {
                    ConfigPerks.SharedData data = ConfigPerks.SHARED_DATA[augmentation.PerkInstance.Type];
                    sprite = data.Sprite;
                    overrideDescriptionTextLocalized = _.L(ConfigLoca.MINIPOPUP_AUGMENTATIONS_DESCRIPTION, new < > __AnonType24 <string>(_.L(data.ShortDescription, null, false)), false);
                    str2 = MenuHelpers.BigModifierToString(augmentation.PerkInstance.Modifier, true);
                }
                content4        = new RewardGalleryCell.Content();
                content4.Sprite = sprite;
                content4.Text   = str2;
                RewardGalleryCell.Content rewardContent = content4;
                string           overrideButtonText     = MenuHelpers.BigValueToString(App.Binder.ConfigMeta.GetAugmentationPrice(augmentation.Id));
                SpriteAtlasEntry atlasEntry             = ConfigUi.RESOURCE_TYPE_SPRITES[ResourceType.Token];
                entry3           = new MiniPopupEntry();
                entry3.TitleText = ConfigLoca.MINIPOPUP_AUGMENTATIONS_TITLE;
                contentMenu.populateLayout(entry3, true, rewardContent, overrideButtonText, PlayerView.Binder.SpriteResources.getSprite(atlasEntry), overrideDescriptionTextLocalized);
            }
            else if (param is ShopPurchaseController)
            {
                ShopPurchaseController controller = (ShopPurchaseController)param;
                this.m_shopPurchaseController = new ShopPurchaseController(controller.ShopEntry, controller.ShopEntryInstance, PathToShopType.Vendor, new System.Action(this.onShopClosed), new Action <ShopEntry, PurchaseResult>(this.onShopPurchaseCompleted));
                content4             = new RewardGalleryCell.Content();
                content4.Sprite      = controller.getSprite();
                content4.StickerText = controller.getStickerText();
                RewardGalleryCell.Content content2 = content4;
                if (controller.payWithAd())
                {
                    contentMenu.MainButton.gameObject.SetActive(true);
                    this.DualButtonLeft.gameObject.SetActive(false);
                    this.DualButtonRight.gameObject.SetActive(false);
                    double v = controller.getAmount();
                    content2.Text    = (v <= 1.0) ? null : ("+" + MenuHelpers.BigValueToString(v));
                    entry3           = new MiniPopupEntry();
                    entry3.TitleText = ConfigLoca.MINIPOPUP_ADS_VENDOR_TITLE;
                    contentMenu.populateLayout(entry3, true, content2, StringExtensions.ToUpperLoca(_.L(ConfigLoca.UI_PROMPT_WATCH, null, false)), null, _.L(ConfigLoca.MINIPOPUP_SPECIAL_OFFER_DESCRIPTION, null, false));
                }
                else if (controller.getRefShopEntry().Type == ShopEntryType.MegaBoxBundle)
                {
                    contentMenu.MainButton.gameObject.SetActive(true);
                    this.DualButtonLeft.gameObject.SetActive(false);
                    this.DualButtonRight.gameObject.SetActive(false);
                    double num2 = ConfigShops.CalculateMegaBoxBundleSize(controller.getRefShopEntry().Id);
                    string str4 = null;
                    if (num2 > 1.0)
                    {
                        str4 = _.L(ConfigLoca.MINIPOPUP_MEGABOX_DESCRIPTION_MANY, new < > __AnonType9 <string>(num2.ToString("0")), false);
                    }
                    else
                    {
                        str4 = _.L(ConfigLoca.MINIPOPUP_MEGABOX_DESCRIPTION_SINGLE, null, false);
                    }
                    entry3           = new MiniPopupEntry();
                    entry3.TitleText = ConfigLoca.MINIPOPUP_MEGABOX_TITLE;
                    contentMenu.populateLayout(entry3, true, content2, controller.getPriceText(1), PlayerView.Binder.SpriteResources.getSprite(controller.getPriceIcon()), str4);
                }
                else if (controller.getPurchasesRemaining() > 1)
                {
                    contentMenu.MainButton.gameObject.SetActive(false);
                    this.DualButtonLeft.gameObject.SetActive(true);
                    this.DualButtonRight.gameObject.SetActive(true);
                    this.DualButtonLeft.CornerText.text = "1x";
                    this.DualButtonLeft.Text.text       = controller.getPriceText(1);
                    this.DualButtonLeft.Icon.sprite     = PlayerView.Binder.SpriteResources.getSprite(controller.getPriceIcon());
                    int numPurchases = controller.getPurchasesRemaining();
                    this.DualButtonRight.CornerText.text = numPurchases + "x";
                    this.DualButtonRight.Text.text       = controller.getPriceText(numPurchases);
                    this.DualButtonRight.Icon.sprite     = PlayerView.Binder.SpriteResources.getSprite(controller.getPriceIcon());
                    double num4 = controller.getAmount();
                    content2.Text    = (num4 <= 1.0) ? null : ("+" + MenuHelpers.BigValueToString(num4));
                    entry3           = new MiniPopupEntry();
                    entry3.TitleText = ConfigLoca.MINIPOPUP_BASIC_VENDOR_TITLE;
                    contentMenu.populateLayout(entry3, false, content2, null, null, _.L(ConfigLoca.MINIPOPUP_BASIC_VENDOR_DESCRIPTION, null, false));
                }
                else
                {
                    contentMenu.MainButton.gameObject.SetActive(true);
                    this.DualButtonLeft.gameObject.SetActive(false);
                    this.DualButtonRight.gameObject.SetActive(false);
                    double num5 = controller.getAmount();
                    content2.Text    = (num5 <= 1.0) ? null : ("+" + MenuHelpers.BigValueToString(num5));
                    entry3           = new MiniPopupEntry();
                    entry3.TitleText = ConfigLoca.MINIPOPUP_BASIC_VENDOR_TITLE;
                    contentMenu.populateLayout(entry3, true, content2, controller.getPriceText(1), PlayerView.Binder.SpriteResources.getSprite(controller.getPriceIcon()), _.L(ConfigLoca.MINIPOPUP_BASIC_VENDOR_DESCRIPTION, null, false));
                }
            }
            else if (param is TournamentView)
            {
                this.m_tournamentView = (TournamentView)param;
                contentMenu.MainButton.gameObject.SetActive(false);
                this.DualButtonLeft.gameObject.SetActive(true);
                this.DualButtonRight.gameObject.SetActive(true);
                double num6 = this.m_tournamentView.Instance.getDonationPrice();
                this.DualButtonLeft.CornerText.text = "1x";
                this.DualButtonLeft.Text.text       = num6.ToString("0");
                this.DualButtonLeft.Icon.sprite     = PlayerView.Binder.SpriteResources.getSprite(ConfigUi.RESOURCE_TYPE_SPRITES[ResourceType.Diamond]);
                int num7 = this.m_tournamentView.Instance.getDonationsRemaining();
                this.DualButtonRight.CornerText.text = num7 + "x";
                this.DualButtonRight.Text.text       = (num7 * num6).ToString("0");
                this.DualButtonRight.Icon.sprite     = this.DualButtonLeft.Icon.sprite;
                content4        = new RewardGalleryCell.Content();
                content4.Sprite = new SpriteAtlasEntry("Menu", "icon_cardpack_floater");
                RewardGalleryCell.Content content3 = content4;
                entry3           = new MiniPopupEntry();
                entry3.TitleText = ConfigLoca.UI_BUTTON_INFO;
                contentMenu.populateLayout(entry3, false, content3, null, null, _.L(ConfigLoca.ADVPANEL_DONATE_DESCRIPTION, null, false));
            }
            this.onRefresh();
        }
コード例 #14
0
        public void refreshRunestoneSelections()
        {
            PetInstance instance = this.Player.Pets.getSelectedPetInstance();

            if (instance == null)
            {
                for (int i = this.SelectedRunestones.Count - 1; i >= 0; i--)
                {
                    if (this.SelectedRunestones[i].Source == RunestoneSelectionSource.Pet)
                    {
                        this.SelectedRunestones.RemoveAt(i);
                    }
                }
            }
            else
            {
                GatedPerkContainer fixedPerks = GameLogic.Binder.CharacterResources.getResource(instance.CharacterId).FixedPerks;
                for (int j = 0; j < ConfigSkills.ACTIVE_HERO_SKILLS.Count; j++)
                {
                    SkillType skillType         = ConfigSkills.ACTIVE_HERO_SKILLS[j];
                    string    runestoneId       = this.getSelectedRunestoneId(skillType, RunestoneSelectionSource.Pet);
                    string    linkedToRunestone = null;
                    for (int m = 0; m < fixedPerks.Entries.Count; m++)
                    {
                        if (fixedPerks.isPerkUnlocked(instance.Level, m))
                        {
                            PerkType type = fixedPerks.getPerkInstanceAtIndex(m).Type;
                            ConfigPerks.SharedData data = ConfigPerks.SHARED_DATA[type];
                            if ((data.LinkedToSkill == skillType) && (data.LinkedToRunestone != null))
                            {
                                linkedToRunestone = data.LinkedToRunestone;
                                break;
                            }
                        }
                    }
                    if (runestoneId != linkedToRunestone)
                    {
                        this.SelectedRunestones.Remove(this.getRunestoneSelection(runestoneId));
                        if (linkedToRunestone != null)
                        {
                            RunestoneSelection item = new RunestoneSelection();
                            item.Id     = linkedToRunestone;
                            item.Source = RunestoneSelectionSource.Pet;
                            this.SelectedRunestones.Add(item);
                        }
                    }
                }
                for (int k = 0; k < ConfigSkills.ACTIVE_HERO_SKILLS.Count; k++)
                {
                    SkillType type3 = ConfigSkills.ACTIVE_HERO_SKILLS[k];
                    string    str3  = this.getSelectedRunestoneId(type3, RunestoneSelectionSource.Player);
                    if (str3 != null)
                    {
                        string str4 = this.getSelectedRunestoneId(type3, RunestoneSelectionSource.Pet);
                        if (str3 == str4)
                        {
                            RunestoneSelection selection         = this.getRunestoneSelection(str3);
                            int runestoneOrderNumberForSkillType = ConfigRunestones.GetRunestoneOrderNumberForSkillType(str3, type3);
                            selection.Id = ConfigRunestones.GetRunestoneId(type3, runestoneOrderNumberForSkillType + 1);
                        }
                    }
                }
            }
        }
コード例 #15
0
 public static string GetFormattedPerkDescription(PerkType perkType, float baseModifier, float baseDuration, float baseThreshold, float bonus, bool colors)
 {
     ConfigPerks.SharedData data = ConfigPerks.SHARED_DATA[perkType];
     return(GetFormattedPerkString(perkType, _.L(data.Description, null, false), baseModifier, baseDuration, baseThreshold, bonus, !data.HideDescriptionModifierPrefix, true, colors));
 }