Пример #1
0
        private static void PrepareForSavingThrow(DiceRoll diceRoll, int dieOwnerId, string rollData, ref string dieBackColorOverride,
                                                  ref string dieTextColorOverride, ref double modifier, ref string diePlayerName,
                                                  ref double scaleOverride, ref int dieOwnerOverride)
        {
            Ability savingThrowAbility = DndUtils.ToAbility(rollData);

            if (savingThrowAbility == Ability.none)
            {
                return;
            }

            // We have a saving throw!
            Creature targetCreature = DndUtils.GetCreatureById(dieOwnerId);

            if (targetCreature == null)
            {
                return;
            }
            dieOwnerOverride = dieOwnerId;

            diePlayerName = targetCreature.Name;
            if (scaleOverride > 1)
            {
                scaleOverride = 1;                 // Player dice are always thrown at no more than 100% scale.
            }
            modifier                 = targetCreature.GetSavingThrowModifier(savingThrowAbility);
            dieBackColorOverride     = GetDieBackColor(targetCreature);
            dieTextColorOverride     = GetDieTextColor(targetCreature, dieBackColorOverride);
            diceRoll.SavingThrow     = savingThrowAbility;
            diceRoll.Type            = DiceRollType.DamagePlusSavingThrow;
            diceRoll.HiddenThreshold = INT_ViewerSpellCasterDC;
            diceRoll.TrailingEffects.Clear();              // No viewer trailing effects on saving throws.
            diceRoll.DieTotalMessage = "";
        }
        public bool Matches(string message)
        {
            testAllPlayers = false;
            Match match = Regex.Match(message, @"^sv\s+(\w+)" + PlayerSpecifier);

            if (match.Success)
            {
                SetTargetPlayer(match.Groups);
                abilityToTest = DndUtils.ToAbility(match.Groups[1].Value);
                return(abilityToTest != Ability.none);
            }
            match = Regex.Match(message, @"^svs\s+(\w+)$");
            if (match.Success)
            {
                testSelectedPlayers = true;
                abilityToTest       = DndUtils.ToAbility(match.Groups[1].Value);
                return(abilityToTest != Ability.none);
            }
            match = Regex.Match(message, @"^sva\s+(\w+)$");
            if (match.Success)
            {
                testAllPlayers = true;
                abilityToTest  = DndUtils.ToAbility(match.Groups[1].Value);
                return(abilityToTest != Ability.none);
            }
            return(false);
        }
Пример #3
0
        public bool Matches(string message)
        {
            testAllPlayers = false;
            TargetPlayer   = null;
            Match match = Regex.Match(message, @"^sk\s+(\w+)" + PlayerSpecifier);

            if (match.Success)
            {
                SetTargetPlayer(match.Groups);
                skillToTest = DndUtils.ToSkill(match.Groups[1].Value);
                return(skillToTest != Skills.none);
            }
            match = Regex.Match(message, @"^ska\s+(\w+)$");
            if (match.Success)
            {
                testAllPlayers = true;
                skillToTest    = DndUtils.ToSkill(match.Groups[1].Value);
                return(skillToTest != Skills.none);
            }

            match = Regex.Match(message, @"^sks\s+(\w+)$");
            if (match.Success)
            {
                testSelectedPlayers = true;
                skillToTest         = DndUtils.ToSkill(match.Groups[1].Value);
                return(skillToTest != Skills.none);
            }
            return(false);
        }
Пример #4
0
        private static DiceDto AddDieStr(DiceRoll diceRoll, CardDto cardDto, DndViewer viewer, string dieStr, string dieLabelOverride = null, int targetCharacterId = int.MinValue)
        {
            string      dieBackColorOverride = viewer.DieBackColor;
            string      dieTextColorOverride = viewer.DieTextColor;
            int         parenIndex           = dieStr.IndexOf("(");
            DamageType  damageType           = DamageType.None;
            DieCountsAs dieCountsAs          = DieCountsAs.totalScore;
            string      diePlayerName        = cardDto.Card.UserName;
            double      modifier             = 0;
            double      scaleOverride        = viewer.Reputation + 0.30;
            int         dieOwnerOverride     = int.MinValue;

            if (parenIndex >= 0)
            {
                ProcessDieDetails(diceRoll, targetCharacterId, ref dieStr, ref dieBackColorOverride, ref dieTextColorOverride, parenIndex, ref damageType, ref dieCountsAs, ref modifier, ref diePlayerName, ref scaleOverride, ref dieOwnerOverride);
            }

            string[] dieParts = dieStr.Split('d');
            if (dieParts.Length != 2)
            {
                return(null);
            }

            string dieLabel;

            if (string.IsNullOrWhiteSpace(dieLabelOverride) || dieLabelOverride.Trim() == "\"\"")
            {
                dieLabel = $"{cardDto.Card.UserName}";
            }
            else
            {
                dieLabel = dieLabelOverride.Trim().TrimStart('"').TrimEnd('"');
            }

            int quantity;
            int sides;

            if (!int.TryParse(dieParts[0], out quantity) || !int.TryParse(dieParts[1], out sides))
            {
                return(null);
            }
            DiceDto diceDto = new DiceDto()
            {
                PlayerName  = diePlayerName,
                CreatureId  = dieOwnerOverride,
                Sides       = sides,
                Quantity    = quantity,
                Label       = dieLabel.Replace("target_name", DndUtils.GetFirstName(diePlayerName)),
                Scale       = scaleOverride,
                Modifier    = modifier,
                DamageType  = damageType,
                BackColor   = dieBackColorOverride,
                FontColor   = dieTextColorOverride,
                DieCountsAs = dieCountsAs,
                Data        = cardDto.Card.Guid
            };

            diceRoll.DiceDtos.Add(diceDto);
            return(diceDto);
        }
Пример #5
0
 public void TestWeaponConversion()
 {
     Assert.AreEqual(Weapons.None, DndUtils.ToWeapon("yo yo yo yo"));
     Assert.AreEqual(Weapons.Battleaxe, DndUtils.ToWeapon("BattleAxe"));
     Assert.AreEqual(Weapons.Blowgun, DndUtils.ToWeapon("blowgun"));
     Assert.AreEqual(Weapons.Crossbow_Hand | Weapons.Crossbow_Heavy | Weapons.Crossbow_Light, DndUtils.ToWeapon("Crossbow_Heavy, Crossbow_Hand, Crossbow_Light"));
     Assert.AreEqual(Weapons.Crossbow_Hand | Weapons.Crossbow_Heavy | Weapons.Crossbow_Light, DndUtils.ToWeapon("Heavy crossbow, hand crossbow, light crossbow"));
 }
Пример #6
0
 public void TestCurrencyConversion()
 {
     Assert.AreEqual(1, DndUtils.GetGoldPieces("1 gp"));
     Assert.AreEqual(1.0 / 100, DndUtils.GetGoldPieces("1 cp"));
     Assert.AreEqual(1.0 / 10, DndUtils.GetGoldPieces("1 sp"));
     Assert.AreEqual(1.0 / 2, DndUtils.GetGoldPieces("1 ep"));
     Assert.AreEqual(10, DndUtils.GetGoldPieces("1 pp"));
 }
Пример #7
0
 public void TestStringToAbilityConversion()
 {
     Assert.AreEqual(Ability.dexterity | Ability.intelligence, DndUtils.ToAbility("dexterity,intelligence"));
     Assert.AreEqual(Ability.dexterity | Ability.intelligence, DndUtils.ToAbility("Intelligence,Dexterity"));
     Assert.AreEqual(Ability.charisma | Ability.constitution | Ability.dexterity | Ability.intelligence | Ability.strength, DndUtils.ToAbility("Charisma,  constitution ,Dexterity, Intelligence , Strength"));
     Assert.AreEqual(Ability.constitution, DndUtils.ToAbility("Constitution"));
     Assert.AreEqual(Ability.strength, DndUtils.ToAbility("strength"));
 }
Пример #8
0
 public void TestStringToVantageConversion()
 {
     Assert.AreEqual(VantageKind.Advantage, DndUtils.ToVantage("advantage"));
     Assert.AreEqual(VantageKind.Disadvantage, DndUtils.ToVantage("disadvantage"));
     Assert.AreEqual(VantageKind.Normal, DndUtils.ToVantage("normal"));
     Assert.AreEqual(VantageKind.Normal, DndUtils.ToVantage(""));
     Assert.AreEqual(VantageKind.Normal, DndUtils.ToVantage("anything else"));
 }
Пример #9
0
        public bool Matches(string message)
        {
            Match match = Regex.Match(message, @"^sk\s+(\w+)$");

            if (match.Success)
            {
                skillToTest = DndUtils.ToSkill(match.Groups[1].Value);
                return(skillToTest != Skills.none);
            }
            return(false);
        }
        public bool Matches(string message)
        {
            Match match = Regex.Match(message, @"^sv\s+(\w+)$");

            if (match.Success)
            {
                abilityToTest = DndUtils.ToAbility(match.Groups[1].Value);
                return(abilityToTest != Ability.None);
            }
            return(false);
        }
Пример #11
0
 void AddChargedSpellItems(Character character)
 {
     foreach (KnownSpell knownSpell in character.KnownSpells)
     {
         if (knownSpell.CanBeRecharged())
         {
             string beginLabel = $"{knownSpell.ItemName}: ";
             int    maxCharges = knownSpell.TotalCharges;
             string key        = DndUtils.ToVarName(knownSpell.ItemName);
             AddedToUI(character, key);
             AddRechargeable(character, beginLabel, maxCharges, key);
         }
     }
 }
Пример #12
0
 public void TestAllAlignments()
 {
     Assert.AreEqual(Alignment.Any, DndUtils.ToAlignment("any"));
     Assert.AreEqual(Alignment.ChaoticEvil, DndUtils.ToAlignment("chaoticEvil"));
     Assert.AreEqual(Alignment.ChaoticNeutral, DndUtils.ToAlignment("chaoticNeutral"));
     Assert.AreEqual(Alignment.ChaoticGood, DndUtils.ToAlignment("chaoticGood"));
     Assert.AreEqual(Alignment.NeutralEvil, DndUtils.ToAlignment("neutral evil"));
     Assert.AreEqual(Alignment.TrueNeutral, DndUtils.ToAlignment("neutral"));
     Assert.AreEqual(Alignment.NeutralGood, DndUtils.ToAlignment("neutral good"));
     Assert.AreEqual(Alignment.LawfulEvil, DndUtils.ToAlignment("lawful evil"));
     Assert.AreEqual(Alignment.LawfulNeutral, DndUtils.ToAlignment("lawful neutral"));
     Assert.AreEqual(Alignment.LawfulGood, DndUtils.ToAlignment("lawful good"));
     Assert.AreEqual(Alignment.Unaligned, DndUtils.ToAlignment("unaligned"));
 }
Пример #13
0
        public void SpellSorcererSlotTests()
        {
            const string Sorcerer = "Sorcerer";

            Assert.AreEqual(4, DndUtils.GetAvailableSpellSlots(Sorcerer, Level1, Cantrip));
            Assert.AreEqual(2, DndUtils.GetAvailableSpellSlots(Sorcerer, Level1, SlotLevel1));
            Assert.AreEqual(0, DndUtils.GetAvailableSpellSlots(Sorcerer, Level1, SlotLevel2));

            Assert.AreEqual(3, DndUtils.GetAvailableSpellSlots(Sorcerer, Level2, SlotLevel1));
            Assert.AreEqual(0, DndUtils.GetAvailableSpellSlots(Sorcerer, Level2, SlotLevel2));

            Assert.AreEqual(4, DndUtils.GetAvailableSpellSlots(Sorcerer, Level3, SlotLevel1));
            Assert.AreEqual(2, DndUtils.GetAvailableSpellSlots(Sorcerer, Level3, SlotLevel2));
            Assert.AreEqual(0, DndUtils.GetAvailableSpellSlots(Sorcerer, Level3, SlotLevel3));

            Assert.AreEqual(4, DndUtils.GetAvailableSpellSlots(Sorcerer, Level4, SlotLevel1));
            Assert.AreEqual(3, DndUtils.GetAvailableSpellSlots(Sorcerer, Level4, SlotLevel2));
            Assert.AreEqual(0, DndUtils.GetAvailableSpellSlots(Sorcerer, Level4, SlotLevel3));

            Assert.AreEqual(4, DndUtils.GetAvailableSpellSlots(Sorcerer, Level5, SlotLevel1));
            Assert.AreEqual(3, DndUtils.GetAvailableSpellSlots(Sorcerer, Level5, SlotLevel2));
            Assert.AreEqual(2, DndUtils.GetAvailableSpellSlots(Sorcerer, Level5, SlotLevel3));
            Assert.AreEqual(0, DndUtils.GetAvailableSpellSlots(Sorcerer, Level5, SlotLevel4));

            Assert.AreEqual(4, DndUtils.GetAvailableSpellSlots(Sorcerer, Level6, SlotLevel1));
            Assert.AreEqual(3, DndUtils.GetAvailableSpellSlots(Sorcerer, Level6, SlotLevel2));
            Assert.AreEqual(3, DndUtils.GetAvailableSpellSlots(Sorcerer, Level6, SlotLevel3));
            Assert.AreEqual(0, DndUtils.GetAvailableSpellSlots(Sorcerer, Level6, SlotLevel4));

            Assert.AreEqual(4, DndUtils.GetAvailableSpellSlots(Sorcerer, Level7, SlotLevel1));
            Assert.AreEqual(3, DndUtils.GetAvailableSpellSlots(Sorcerer, Level7, SlotLevel2));
            Assert.AreEqual(3, DndUtils.GetAvailableSpellSlots(Sorcerer, Level7, SlotLevel3));
            Assert.AreEqual(1, DndUtils.GetAvailableSpellSlots(Sorcerer, Level7, SlotLevel4));
            Assert.AreEqual(0, DndUtils.GetAvailableSpellSlots(Sorcerer, Level7, SlotLevel5));

            Assert.AreEqual(4, DndUtils.GetAvailableSpellSlots(Sorcerer, Level8, SlotLevel1));
            Assert.AreEqual(3, DndUtils.GetAvailableSpellSlots(Sorcerer, Level8, SlotLevel2));
            Assert.AreEqual(3, DndUtils.GetAvailableSpellSlots(Sorcerer, Level8, SlotLevel3));
            Assert.AreEqual(2, DndUtils.GetAvailableSpellSlots(Sorcerer, Level8, SlotLevel4));
            Assert.AreEqual(0, DndUtils.GetAvailableSpellSlots(Sorcerer, Level8, SlotLevel5));

            Assert.AreEqual(4, DndUtils.GetAvailableSpellSlots(Sorcerer, Level9, SlotLevel1));
            Assert.AreEqual(3, DndUtils.GetAvailableSpellSlots(Sorcerer, Level9, SlotLevel2));
            Assert.AreEqual(3, DndUtils.GetAvailableSpellSlots(Sorcerer, Level9, SlotLevel3));
            Assert.AreEqual(3, DndUtils.GetAvailableSpellSlots(Sorcerer, Level9, SlotLevel4));
            Assert.AreEqual(1, DndUtils.GetAvailableSpellSlots(Sorcerer, Level9, SlotLevel5));
            Assert.AreEqual(0, DndUtils.GetAvailableSpellSlots(Sorcerer, Level9, SlotLevel6));
        }
Пример #14
0
 private void AddSpellSlots(Character character)
 {
     int[] spellSlotLevels = character.GetSpellSlotLevels();
     for (int i = 1; i < spellSlotLevels.Length; i++)
     {
         if (spellSlotLevels[i] == 0)
         {
             continue;
         }
         string beginLabel = $"{DndUtils.GetOrdinal(i)}: ";
         int    maxCharges = spellSlotLevels[i];
         string key        = DndUtils.GetSpellSlotLevelKey(i);
         AddedToUI(character, key);
         AddRechargeable(character, beginLabel, maxCharges, key);
     }
 }
Пример #15
0
 public void TestDamageConversion()
 {
     Assert.AreEqual(DamageType.Fire, DndUtils.ToDamage("fire"));
     Assert.AreEqual(DamageType.Force, DndUtils.ToDamage("force"));
     Assert.AreEqual(DamageType.Lightning, DndUtils.ToDamage("lightning"));
     Assert.AreEqual(DamageType.Necrotic, DndUtils.ToDamage("necrotic"));
     Assert.AreEqual(DamageType.Piercing, DndUtils.ToDamage("piercing"));
     Assert.AreEqual(DamageType.Poison, DndUtils.ToDamage("poison"));
     Assert.AreEqual(DamageType.Psychic, DndUtils.ToDamage("psychic"));
     Assert.AreEqual(DamageType.Radiant, DndUtils.ToDamage("radiant"));
     Assert.AreEqual(DamageType.Slashing, DndUtils.ToDamage("slashing"));
     Assert.AreEqual(DamageType.Thunder, DndUtils.ToDamage("thunder"));
     Assert.AreEqual(DamageType.Condition, DndUtils.ToDamage("condition"));
     Assert.AreEqual(DamageType.Acid, DndUtils.ToDamage("acid"));
     Assert.AreEqual(DamageType.Bludgeoning, DndUtils.ToDamage("bludgeoning"));
     Assert.AreEqual(DamageType.Acid | DamageType.Bludgeoning, DndUtils.ToDamage("acid, bludgeoning"));
     Assert.AreEqual(DamageType.Cold, DndUtils.ToDamage("cold"));
     Assert.AreEqual(DamageType.None, DndUtils.ToDamage("scooby doo"));
 }
Пример #16
0
        public bool Matches(string message)
        {
            const string playSceneCommand = "PlayScene";

            if (!message.StartsWith(playSceneCommand + "("))
            {
                return(false);
            }

            sceneName = message.Substring(playSceneCommand.Length + 1).Trim();
            if (sceneName.EndsWith(")"))
            {
                sceneName = sceneName.EverythingBeforeLast(")");
            }

            sceneName = DndUtils.GetRandomSceneIfNecessary(sceneName);

            return(true);
        }
Пример #17
0
        public bool Matches(string message)
        {
            testAllPlayers = false;
            Match match = Regex.Match(message, @"^sv\s+(\w+)$");

            if (match.Success)
            {
                abilityToTest = DndUtils.ToAbility(match.Groups[1].Value);
                return(abilityToTest != Ability.none);
            }
            match = Regex.Match(message, @"^sva\s+(\w+)$");
            if (match.Success)
            {
                testAllPlayers = true;
                abilityToTest  = DndUtils.ToAbility(match.Groups[1].Value);
                return(abilityToTest != Ability.none);
            }
            return(false);
        }
Пример #18
0
        private static void ProcessDieDetails(DiceRoll diceRoll, int dieOwnerId, ref string dieStr, ref string dieBackColorOverride,
                                              ref string dieTextColorOverride, int parenIndex, ref DamageType damageType, ref DieCountsAs dieCountsAs,
                                              ref double modifier, ref string diePlayerName, ref double scaleOverride, ref int dieOwnerOverride)
        {
            string dieTypeStr = dieStr.Substring(parenIndex).Trim();

            dieStr = dieStr.Substring(0, parenIndex);

            int colonPos = dieTypeStr.IndexOf(':');

            if (colonPos > 0)
            {
                // Die format specifier - "type:detail", e.g., "save:Dexterity" for a Dexterity saving throw.
                string[] dieTypeParts = dieTypeStr.TrimStart('(').TrimEnd(')').Split(':');
                if (dieTypeParts.Length == 2)
                {
                    string rollKindStr = dieTypeParts[0];
                    string rollData    = dieTypeParts[1];
                    if (rollKindStr == "save")
                    {
                        PrepareForSavingThrow(diceRoll, dieOwnerId, rollData, ref dieBackColorOverride, ref dieTextColorOverride, ref modifier, ref diePlayerName, ref scaleOverride, ref dieOwnerOverride);
                        dieCountsAs = DieCountsAs.savingThrow;
                    }
                    else
                    {
                        dieCountsAs = DieCountsAs.totalScore;
                    }
                }
            }
            else
            {
                // Probably just straight damage...
                damageType = DndUtils.ToDamage(dieTypeStr);
                if (damageType != DamageType.None)
                {
                    dieCountsAs = DieCountsAs.damage;
                }
            }
        }
        public bool Matches(string message)
        {
            testAllPlayers = false;
            Match match = Regex.Match(message, @"^InstantRoll\s+(\w+)\s+([\w\.\[\]\(\)\{\}\:""\s]+)" + PlayerSpecifier);

            if (!match.Success)
            {
                testAllPlayers = true;
                match          = Regex.Match(message, @"^InstantRoll\s+(\w+)\s+([\w\.\[\]\(\)\{\}\:""\s]+)");
            }
            if (match.Success)
            {
                if (!testAllPlayers)
                {
                    SetTargetPlayer(match.Groups);
                }
                dieStr       = match.Groups[2].Value;
                diceRollType = DndUtils.ToDiceRollType(match.Groups[1].Value);
                return(true);
            }

            testAllPlayers = false;
            return(false);
        }
Пример #20
0
        public void SetFromCharacter(Character character)
        {
            changingInternally = true;
            try
            {
                playerID             = character.playerID;
                headshotIndex        = character.headshotIndex;
                statGoldPieces.Text  = character.goldPieces.ToString();
                statGoldPieces3.Text = statGoldPieces.Text;
                //character.activeConditions =
                //character.advantages = ;
                statAlignment.Text  = character.alignment;
                statArmorClass.Text = character.baseArmorClass.ToString();
                //character.blindsightRadius =
                //character.burrowingSpeed =
                statCharisma.Text  = character.Charisma.ToString();
                statCharisma2.Text = character.Charisma.ToString();
                //character.climbingSpeed =
                // character.conditionImmunities =
                statConstitution.Text  = character.Constitution.ToString();
                statConstitution2.Text = character.Constitution.ToString();
                //character.creatureSize =
                //character.cursesAndBlessings =
                //character.damageImmunities =
                //character.damageResistance =
                //character.damageVulnerability =
                //character.darkvisionRadius =
                statDeathSaveSkull1.IsChecked = character.deathSaveDeath1;
                statDeathSaveSkull2.IsChecked = character.deathSaveDeath2;
                statDeathSaveSkull3.IsChecked = character.deathSaveDeath3;
                statDeathSaveHeart1.IsChecked = character.deathSaveLife1;
                statDeathSaveHeart2.IsChecked = character.deathSaveLife2;
                statDeathSaveHeart3.IsChecked = character.deathSaveLife3;
                statDexterity.Text            = character.Dexterity.ToString();
                statDexterity2.Text           = statDexterity.Text;
                //character.disadvantages =
                //character.equipment =
                statExperiencePoints.Text = character.experiencePoints.ToString();
                //character.flyingSpeed =
                statGoldPieces.Text    = character.goldPieces.ToString();
                statHitPoints.Text     = character.hitPoints.ToString();
                statInitiative.Text    = PlusModifier(character.initiative) + character.initiative.ToString();
                statInspiration.Text   = character.inspiration.ToString();
                statIntelligence.Text  = character.Intelligence.ToString();
                statIntelligence2.Text = statIntelligence.Text;
                // character.baseIntelligence = statIntelligence.ToInt();
                // character.kind =
                // character.languagesSpoken =
                // character.languagesUnderstood =

                //statLevel.Text = character.level.ToString();  read-only

                statLoad.Text = character.load.ToString();
                //character.maxHitPoints =
                SetName(statName, character.name);
                SetName(statName2, character.name);
                SetName(statName3, character.name);
                SetName(statName4, character.name);

                statSpellcastingAbility.Text = DndUtils.ToAbilityDisplayString(character.spellCastingAbility);
                if (character.spellCastingAbility == Ability.none)
                {
                    statSpellSaveDC.Text      = "-";
                    statSpellAttackBonus.Text = "-";
                }
                else
                {
                    statSpellSaveDC.Text      = character.SpellSaveDC.ToString();
                    statSpellAttackBonus.Text = character.SpellAttackBonus.ToString();
                }

                //character.offTurnActions =
                //character.onTurnActions =
                statProficiencyBonus.Text = PlusModifier(character.proficiencyBonus) + character.proficiencyBonus.ToString();
                SetSkillProficiency(character.proficientSkills | character.doubleProficiency);
                statRaceClass.Text = character.raceClass;
                //character.remainingHitDice =
                SetSavingThrowProficiency(character.savingThrowProficiency);
                SetSpellCastingAbility(character.spellCastingAbility);
                //character.senses =
                statSpeed.Text     = character.baseWalkingSpeed.ToString();
                statStrength.Text  = character.Strength.ToString();
                statStrength2.Text = statStrength.Text;
                //character.swimmingSpeed =
                //character.telepathyRadius =
                //character.tempAcrobaticsMod =
                //character.tempAnimalHandlingMod =
                //character.tempArcanaMod =
                //character.tempAthleticsMod =
                //character.tempDeceptionMod =
                //character.tempHistoryMod =
                statTempHitPoints.Text = character.tempHitPoints.ToString();
                //character.tempInsightMod =
                //character.tempIntimidationMod =
                //character.tempInvestigationMod =
                //character.tempMedicineMod =
                //character.tempNatureMod =
                //character.tempPerceptionMod =
                //character.tempPerformanceMod =
                //character.tempPersuasionMod =
                //character.tempReligionMod =
                //character.tempSavingThrowModCharisma =
                //character.tempSavingThrowModConstitution =
                //character.tempSavingThrowModDexterity =
                //character.tempSavingThrowModIntelligence =
                //character.tempSavingThrowModStrength =
                //character.tempSavingThrowModWisdom =
                //character.tempSleightOfHandMod =
                //character.tempStealthMod =
                //character.tempSurvivalMod =
                statHitDice.Text = character.totalHitDice;
                //character.tremorSenseRadius =
                //character.truesightRadius =
                statWeight.Text  = character.weight.ToString();
                statWisdom.Text  = character.Wisdom.ToString();
                statWisdom2.Text = statWisdom.Text;
                SetCalculatedFields(character);
                AddRechargeables(character);
            }
            finally
            {
                changingInternally = false;
            }
        }
Пример #21
0
 void SetName(StatBox statBox, string name)
 {
     statBox.Text      = DndUtils.GetFirstName(name);
     statBox.IsEnabled = false;
 }
Пример #22
0
 public void TestNameConversion()
 {
     Assert.AreEqual(SubClass.ArcaneTrickster, DndUtils.ToSubClass("arcane trickster"));
     Assert.AreEqual(SubClass.Banneret_PurpleDragonKnight, DndUtils.ToSubClass("Banneret / Purple Dragon Knight"));
     Assert.AreEqual(SubClass.WildMagic, DndUtils.ToSubClass("wild   magic"));
 }
Пример #23
0
 Ability GetSpellCastingAbility()
 {
     return(DndUtils.ToAbility(statSpellcastingAbility.Text));
 }
Пример #24
0
 public DiceStackDto(Roll roll)
 {
     NumSides   = roll.Sides;
     Multiplier = (int)Math.Floor(roll.Count);
     DamageType = DndUtils.ToDamage(roll.Descriptor);
 }