Exemple #1
0
        private void BonusSpells_DoubleTap(int level)
        {
            if (pushedPage != null)
            {
                return;
            }
            var sheet = CharacterSheetStorage.Instance.selectedCharacter;

            if (sheet == null)
            {
                return;
            }
            if (level < 0)
            {
                return;
            }
            if (level >= sheet.spellLevel.Length)
            {
                return;
            }
            var eivwm = new EditIntValueWithModifiers();

            eivwm.Init(sheet, sheet.spellLevel[level].bonusSpells, "Edit Bonus Spells (" + level + ")", "Bonus Spells", true);
            pushedPage = eivwm;
            Navigation.PushAsync(eivwm);
        }
        private void Total_Tapped(object sender, EventArgs e)
        {
            if (pushedPage != null)
            {
                return;
            }
            var sheet = CharacterSheetStorage.Instance.selectedCharacter;

            if (sheet == null)
            {
                return;
            }
            if (item == null)
            {
                return;
            }
            if (!item.hasUseLimit)
            {
                return;
            }
            var eivwm = new EditIntValueWithModifiers();

            eivwm.Init(sheet, item.dailyUseLimit, "Edit Gear Item", "Daily Uses Limit", false);
            pushedPage = eivwm;
            Navigation.PushAsync(eivwm);
        }
        private void Level_Tapped(object sender, EventArgs e)
        {
            if (pushedPage != null)
            {
                return;
            }
            var sheet = CharacterSheetStorage.Instance.selectedCharacter;

            if (sheet == null)
            {
                return;
            }
            var eivwm = new EditIntValueWithModifiers();

            eivwm.Init(sheet, level.level, "Edit Experience", "Experience", false);
            pushedPage = eivwm;
            Navigation.PushAsync(eivwm);
        }
        private void CurrentAttacksCount_Tapped(object sender, EventArgs e)
        {
            if (pushedPage != null)
            {
                return;
            }
            var sheet = CharacterSheetStorage.Instance.selectedCharacter;

            if (sheet == null)
            {
                return;
            }
            var eivwm = new EditIntValueWithModifiers();

            eivwm.Init(sheet, currentAttacksCount, "Edit Base Attack Bonus", "Attacks Count", false);
            pushedPage = eivwm;
            Navigation.PushAsync(eivwm);
        }
        private void EditBonus(CharacterSheet.ValueWithIntModifiers bab)
        {
            if (pushedPage != null)
            {
                return;
            }
            var sheet = CharacterSheetStorage.Instance.selectedCharacter;

            if (sheet == null)
            {
                return;
            }
            var eivwm = new EditIntValueWithModifiers();

            eivwm.Init(sheet, bab, "Edit Base Attack Bonus", "Base Attack Bonus", false);
            pushedPage = eivwm;
            Navigation.PushAsync(eivwm);
        }
        private void MiscModifiers_Tapped(object sender, EventArgs e)
        {
            if (pushedPage != null)
            {
                return;
            }
            var sheet = CharacterSheetStorage.Instance.selectedCharacter;

            if (sheet == null)
            {
                return;
            }
            var eivwm = new EditIntValueWithModifiers();

            eivwm.Init(sheet, ac.miscModifiers, "Edit Armor Class Misc Modifiers", "Misc Modifier", false);
            pushedPage = eivwm;
            Navigation.PushAsync(eivwm);
        }
Exemple #7
0
        public void DamageBonus_DoubleTap(object sender, EventArgs e)
        {
            if (pushedPage != null)
            {
                return;
            }
            var sheet = CharacterSheetStorage.Instance.selectedCharacter;

            if (sheet == null)
            {
                return;
            }
            var eivwm = new EditIntValueWithModifiers();

            eivwm.Init(sheet, sheet.damageBonusModifiers, "Edit Damage Bonus", "Damage Bonus", true);
            pushedPage = eivwm;
            Navigation.PushAsync(eivwm);
        }
        private void Left_DoubleTapped(object sender, EventArgs e)
        {
            if (pushedPage != null)
            {
                return;
            }
            var sheet = CharacterSheetStorage.Instance.selectedCharacter;

            if (sheet == null)
            {
                return;
            }
            var eivwm = new EditIntValueWithModifiers();

            eivwm.Init(sheet, item.useLimit, "Edit Special Ability", "Use Limit", false);
            pushedPage = eivwm;
            Navigation.PushAsync(eivwm);
        }
        private void ChannelsTotal_Tapped(object sender, EventArgs e)
        {
            if (pushedPage != null)
            {
                return;
            }
            var sheet = CharacterSheetStorage.Instance.selectedCharacter;

            if (sheet == null)
            {
                return;
            }
            var eivwm = new EditIntValueWithModifiers();

            eivwm.Init(sheet, channelEnergy.total, "Edit Channels Energy", "Channels Total", false);
            pushedPage = eivwm;
            Navigation.PushAsync(eivwm);
        }
Exemple #10
0
        private void Weight_Tapped(object sender, EventArgs e)
        {
            if (pushedPage != null)
            {
                return;
            }
            var sheet = CharacterSheetStorage.Instance.selectedCharacter;

            if (sheet == null)
            {
                return;
            }
            var eivwm = new EditIntValueWithModifiers();

            eivwm.Init(sheet, item.weight, "Edit Armor Weight", "Weight", false);
            pushedPage = eivwm;
            Navigation.PushAsync(eivwm);
        }
        private void SpellResistance_DoubleTapped(object sender, EventArgs e)
        {
            if (pushedPage != null)
            {
                return;
            }
            var sheet = CharacterSheetStorage.Instance.selectedCharacter;

            if (sheet == null)
            {
                return;
            }
            var eivwm = new EditIntValueWithModifiers();

            eivwm.Init(sheet, sheet.spellResistance, "Edit Spell Resistance", "Spell Resistance", true);
            pushedPage = eivwm;
            Navigation.PushAsync(eivwm);
        }
Exemple #12
0
        private void SpeedWithArmor_Tapped(object sender, EventArgs e)
        {
            if (pushedPage != null)
            {
                return;
            }
            var sheet = CharacterSheetStorage.Instance.selectedCharacter;

            if (sheet == null)
            {
                return;
            }
            var eivwm = new EditIntValueWithModifiers();

            eivwm.Init(sheet, speed.armorSpeed, "Edit Speed With Armor", "Speed With Armor", false);
            pushedPage = eivwm;
            Navigation.PushAsync(eivwm);
        }
        private void CP_DoubleTapped(object sender, EventArgs e)
        {
            if (pushedPage != null)
            {
                return;
            }
            var sheet = CharacterSheetStorage.Instance.selectedCharacter;

            if (sheet == null)
            {
                return;
            }
            var eivwm = new EditIntValueWithModifiers();

            eivwm.Init(sheet, sheet.money.cuprumPoints, "Edit Cuprum Points", "Cuprum Points", true);
            pushedPage = eivwm;
            Navigation.PushAsync(eivwm);
        }
Exemple #14
0
        private void DiceCount_Tapped(object sender, EventArgs e)
        {
            if (pushedPage != null)
            {
                return;
            }
            if (sheet == null)
            {
                return;
            }
            if (roll == null)
            {
                return;
            }
            var eivwm = new EditIntValueWithModifiers();

            eivwm.Init(sheet, roll.diceCount, "Edit Dice Count", "Dice Count", false);
            pushedPage = eivwm;
            Navigation.PushAsync(eivwm);
        }
Exemple #15
0
        private void Max_Tapped(object sender, EventArgs e)
        {
            if (pushedPage != null)
            {
                return;
            }
            if (sheet == null)
            {
                return;
            }
            if (critical == null)
            {
                return;
            }
            var eivwm = new EditIntValueWithModifiers();

            eivwm.Init(sheet, critical.max, "Edit Critical Max", "Max", false);
            pushedPage = eivwm;
            Navigation.PushAsync(eivwm);
        }
Exemple #16
0
        private void MaxDexBonus_Tapped(object sender, EventArgs e)
        {
            if (!LimitMaxDexBonus.IsChecked)
            {
                return;
            }
            if (pushedPage != null)
            {
                return;
            }
            var sheet = CharacterSheetStorage.Instance.selectedCharacter;

            if (sheet == null)
            {
                return;
            }
            var eivwm = new EditIntValueWithModifiers();

            eivwm.Init(sheet, item.maxDexBonus, "Edit Max Dex Bonus", "Max Dex Bonus", false);
            pushedPage = eivwm;
            Navigation.PushAsync(eivwm);
        }
        private void DexModifier_Tapped(object sender, EventArgs e)
        {
            if (ac.DexterityModifierSource != CharacterSheet.ArmorClass.DexterityModifierSources.Custom)
            {
                return;
            }
            if (pushedPage != null)
            {
                return;
            }
            var sheet = CharacterSheetStorage.Instance.selectedCharacter;

            if (sheet == null)
            {
                return;
            }
            var eivwm = new EditIntValueWithModifiers();

            eivwm.Init(sheet, ac.dexterityModifier, "Edit Armor Class Dexterity Modifier", "Dexterity Modifier", false);
            pushedPage = eivwm;
            Navigation.PushAsync(eivwm);
        }
Exemple #18
0
        private void WillTempModifier_Tapped(object sender, EventArgs e)
        {
            if (pushedPage != null)
            {
                return;
            }
            var st = GetST(CharacterSheet.Save.Will);

            if (st == null)
            {
                return;
            }
            var sheet = CharacterSheetStorage.Instance.selectedCharacter;

            if (sheet == null)
            {
                return;
            }
            var eivwm = new EditIntValueWithModifiers();

            eivwm.Init(sheet, st.tempModifier, "Edit Will Temp Modifier", "Temp Modifier", false);
            pushedPage = eivwm;
            Navigation.PushAsync(eivwm);
        }
Exemple #19
0
        private void CreateControls()
        {
            var sheet = CharacterSheetStorage.Instance.selectedCharacter;

            if (sheet == null)
            {
                return;
            }
            if (AbilityScores.Children.Count > 0)
            {
                return;
            }
            var abilities = Enum.GetNames(typeof(CharacterSheet.Ability));

            for (var i = 0; i < (int)CharacterSheet.Ability.Total + 1; i++)
            {
                for (var j = 0; j < 5; j++)
                {
                    View child = null;
                    if ((i <= 0) || (j <= 0))
                    {
                        child = CreateLabel(string.Empty, i > 0 ? TextAlignment.Start : TextAlignment.Center);
                    }
                    else
                    {
                        //if (j != 1)
                        {
                            var readOnly = j % 2 == 0;
                            child = CreateFrame(string.Empty);
                            ((child as Frame).Content as Label).TextDecorations = readOnly ? TextDecorations.None : TextDecorations.Underline;
                            child.BackgroundColor = readOnly ? Color.LightGray : Color.White;
                            if (!readOnly)
                            {
                                var index = i - 1;
                                var adj   = j == 3;
                                MainPage.AddTapHandler(child, (s, e) =>
                                {
                                    if (pushedPage != null)
                                    {
                                        return;
                                    }
                                    var eivwm     = new EditIntValueWithModifiers();
                                    var modname   = (adj ? "Temp Adjustment" : "Score");
                                    var abmodname = abilities[index] + " " + modname;
                                    var labs      = abilityScores[index];
                                    var vwm       = adj ? labs.tempAdjustment : labs.score;
                                    eivwm.Init(sheet, vwm, "Edit " + abmodname, abmodname, false, false);
                                    pushedPage = eivwm;
                                    Navigation.PushAsync(eivwm);
                                }, 1);
                            }
                        }

                        /*
                         * else
                         * {
                         *  child = new Frame()
                         *  {
                         *      Content = new Entry()
                         *      {
                         *          FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                         *          TextColor = Color.Black,
                         *          Keyboard = Keyboard.Numeric,
                         *          HorizontalTextAlignment = TextAlignment.Center,
                         *          HorizontalOptions = LayoutOptions.FillAndExpand,
                         *      },
                         *      BorderColor = Color.Black,
                         *      Padding = 5,
                         *  };
                         *  var index = i;
                         *  ((child as Frame).Content as Entry).TextChanged += (s, e) => UpdateModifier(index);
                         * }
                         */
                    }
                    //if (i == 0)
                    AbilityScores.Children.Add(child, j, i);

                    /*
                     * else
                     *  AbilityScores.Children.Add(child, j, i * 2 - 1);
                     */
                }
            }
            //(AbilityScores.Children[0] as Label).Text = "Ability Name";
            (AbilityScores.Children[1] as Label).Text = "Ability Score";
            (AbilityScores.Children[2] as Label).Text = "Ability Modifier";
            (AbilityScores.Children[3] as Label).Text = "Temp Adjustment";
            (AbilityScores.Children[4] as Label).Text = "Temp Modifier";
        }