예제 #1
0
        public SummonToForm(Summon s)
        {
            Index       = s.Index;
            SummonSpell = string.Copy(s.SummonSpell);

            Name      = s.Name;
            Size      = s.Size;
            Type      = s.Type;
            Abilities = new Abilities()
            {
                Str = s.Abilities.Str,
                Dex = s.Abilities.Dex,
                Con = s.Abilities.Con,
                Int = s.Abilities.Int,
                Wis = s.Abilities.Wis,
                Cha = s.Abilities.Cha
            };

            BaseAbilities = new Abilities()
            {
                Str = s.Abilities.Str,
                Dex = s.Abilities.Dex,
                Con = s.Abilities.Con,
                Int = s.Abilities.Int,
                Wis = s.Abilities.Wis,
                Cha = s.Abilities.Cha
            };

            NaturalArmor = s.NaturalArmor;
            Feats        = new List <string>(s.Feats);
            SpecAtks     = new List <string>(s.SpecAtks);
            SpecQual     = new List <string>(s.SpecQual);

            Saves = new Saves()
            {
                Fort = s.Saves.Fort,
                Ref  = s.Saves.Ref,
                Will = s.Saves.Will
            };

            Saves.Fort -= s.Abilities.ConMod;
            Saves.Ref  -= s.Abilities.DexMod;
            Saves.Will -= s.Abilities.WisMod;

            if (Feats.Any(x => x.ToUpper() == "IRON WILL"))
            {
                Saves.Will -= 2; MiscWill += 2;
            }

            Environment = s.Environment;

            Movement = s.Movement;

            Space = s.Space;
            Reach = s.Reach;

            Attacks     = new List <Attack>(s.Attacks);
            FullAttacks = new List <FullAttack>(s.FullAttacks);

            Skills = Summon.GetSkillMods(s.Skills);

            for (int i = 0; i < s.Skills.Count; i++)
            {
                Skills[i] = Summon.CorrectSkillModBackward(Skills[i], BaseAbilities);
            }

            Notes       = new List <string>(s.Notes);
            BAB         = s.BAB;
            MiscGrapple = s.Grapple - s.BAB - s.Abilities.StrMod - Summon.GetGrappleSizeMod(s.Size);
            HitDie      = s.HitDie;
            Level       = s.Level;
        }
예제 #2
0
파일: Summoned.cs 프로젝트: Nifusion/DSA
        private void LoadPage(SummonToForm st)
        {
            flag1 = true;
            rtbNotes.Clear();
            lbAttacks.Items.Clear();
            lbFeats.Items.Clear();
            lbAttacks.Items.Clear();
            lbFullAttacks.Items.Clear();
            lbSkills.Items.Clear();
            lbSpecialAttacks.Items.Clear();
            lbSpecialQualities.Items.Clear();


            for (int i = 0; i < st.Skills.Count; i++)
            {
                lbSkills.Items.Add(Summon.CorrectSkillModForward(st.Skills[i], st.Abilities));
            }

            for (int i = 0; i < st.Feats.Count; i++)
            {
                lbFeats.Items.Add(st.Feats[i]);
            }

            for (int i = 0; i < st.SpecAtks.Count; i++)
            {
                lbSpecialAttacks.Items.Add(st.SpecAtks[i]);
            }

            for (int i = 0; i < st.SpecQual.Count; i++)
            {
                lbSpecialQualities.Items.Add(st.SpecQual[i]);
            }

            for (int i = 0; i < st.Attacks.Count; i++)
            {
                lbAttacks.Items.Add(st.Attacks[i]);
            }

            for (int i = 0; i < st.FullAttacks.Count; i++)
            {
                lbFullAttacks.Items.Add(st.FullAttacks[i].ToString());
            }

            rtbNotes.AppendText(string.Join("\r", st.Notes));

            tbSummonName.Text = st.Name;
            nudRounds.Value   = st.Rounds;

            nudSTR.Value = st.Abilities.Str;
            nudDEX.Value = st.Abilities.Dex;
            nudCON.Value = st.Abilities.Con;
            nudINT.Value = st.Abilities.Int;
            nudWIS.Value = st.Abilities.Wis;
            nudCHA.Value = st.Abilities.Cha;

            cbSize.Text         = st.Size.ToString();
            tbType.Text         = st.Type;
            nudInitiative.Value = st.Abilities.DexMod;
            tbSpeed.Text        = st.Movement;

            labelACDex.Text     = st.Abilities.DexMod.ToString();
            labelACNatural.Text = st.NaturalArmor.ToString();
            labelACSize.Text    = Summon.GetSizeMod(st.Size).ToString();

            labelTouchDex.Text  = st.Abilities.DexMod.ToString();
            labelTouchSize.Text = Summon.GetSizeMod(st.Size).ToString();

            labelFlatNatural.Text = st.NaturalArmor.ToString();
            labelFlatSize.Text    = Summon.GetSizeMod(st.Size).ToString();

            tbSpaceReach.Text = string.Format("{0}, {1}", st.Space, st.Reach);

            labelFortBase.Text    = st.Saves.Fort.ToString();
            labelFortAbility.Text = st.Abilities.ConMod.ToString();
            nudFortMisc.Value     = st.MiscFort;

            labelRefBase.Text    = st.Saves.Ref.ToString();
            labelRefAbility.Text = st.Abilities.DexMod.ToString();
            nudRefMisc.Value     = st.MiscRef;

            labelWillBase.Text    = st.Saves.Will.ToString();
            labelWillAbility.Text = st.Abilities.WisMod.ToString();
            nudWillMisc.Value     = st.MiscWill;


            tbEnvironment.Text = st.Environment;
            tbHitDie.Text      = string.Format("{0}d{1}", st.Level, st.HitDie);

            int toughnessAddition = GetToughnessHP(st);

            int prevMaxHP = int.Parse(nudMaxHP.Value.ToString());
            int newMaxHP  = int.Parse(Math.Floor(st.Level * 1.000 * Math.Ceiling(st.HitDie * 1.000 / 2) + st.Level * .500 + st.Abilities.ConMod * 1.000 * st.Level + toughnessAddition).ToString());

            nudMaxHP.Value = decimal.Parse(newMaxHP.ToString());
            //new summon
            if (prevMaxHP == 0)
            {
                nudCurrentHP.Value = newMaxHP;
            }
            //nothing changed; regular update
            else if (prevMaxHP == newMaxHP)
            {
            }
            //CON changed
            else
            {
                int difference = prevMaxHP - currentST.CurrentHP;
                nudCurrentHP.Value = newMaxHP - difference;
            }

            labelBaseAttackBonus.Text = st.BAB.ToString();

            //nudGrappleBonus.Value =
            labelGrappleBase.Text    = st.BAB.ToString();
            labelGrappleAbility.Text = st.Abilities.StrMod.ToString();
            labelGrappleSize.Text    = Summon.GetGrappleSizeMod(st.Size).ToString();
            nudGrappleMisc.Value     = st.MiscGrapple;

            //nudMeleeBonus.Value =
            labelMeleeBase.Text    = labelBaseAttackBonus.Text;
            labelMeleeAbility.Text = (HasWeaponFinesse(st) ? Math.Max(st.Abilities.StrMod, st.Abilities.DexMod) : st.Abilities.StrMod).ToString();
            labelMeleeSize.Text    = Summon.GetSizeMod(st.Size).ToString();
            nudMeleeMisc.Value     = st.MiscMelee;

            //nudRangeBonus.Value =
            labelRangeBase.Text    = labelBaseAttackBonus.Text;
            labelRangeAbility.Text = st.Abilities.DexMod.ToString();
            labelRangeSize.Text    = Summon.GetSizeMod(st.Size).ToString();
            nudRangeMisc.Value     = st.MiscRange;
            flag1 = false;
        }