Пример #1
0
        public static Monster TrollInitialize(Monster a_monster)
        {
            if (a_monster.Lvl >= 6 && a_monster.Lvl <= 10)       // Trolls in this are typically levels 6-10
            {
            }
            else
            {
                RollingDie fourD = new RollingDie(4);
                a_monster.Lvl = 5 + fourD.Roll();
            }
            a_monster.AC     = 8;
            a_monster.HitDie = "d10 +2";
            string timesroll = a_monster.Lvl.ToString();
            string dieroll   = timesroll + a_monster.HitDie;

            (int i1, int i2, int i3) = RollingDie.Diecheck(dieroll);
            if (i1 != 0)
            {
                RollingDie thisRoll = new RollingDie(i1, i2, i3);
                a_monster.MaxHp = thisRoll.Roll();
            }
            a_monster.Hp         = a_monster.MaxHp;
            a_monster.InitMod    = 12;
            a_monster.NoOfAtt    = 3;
            a_monster.DamPerAtt1 = "1d4 +3";
            a_monster.DamPerAtt2 = "1d4 +3";
            a_monster.DamPerAtt3 = "1d12 +4";
            a_monster.DefeatMult = 1.6;        //has multi-attacks plus Regeneration ability

            //  need to put in code to clear other abilities here
            // & auto-add Regeneration Ability

            return(a_monster);
        }
Пример #2
0
        private void PlayRollDiceBtn_Click(object sender, RoutedEventArgs e)
        {
            String diecheck = RollDiePlay.Text;

            (int i1, int i2, int i3) = RollingDie.Diecheck(diecheck);
            if (i1 != 0)
            {
                RollingDie thisRoll = new RollingDie(i1, i2, i3);
                // MessageBox.Show($"{thisRoll.Roll() } {RollDiePlay.Text }");   // we will make this talk out to a rolling chat box in a sec
                txtPlayerDialog.AppendText($" {thisRoll.Roll() } {RollDiePlay.Text } \n");
            }
        }
Пример #3
0
        public int characterAttackCalc(Fant_Entity Defender)
        {
            RollingDie twentyside = new RollingDie(20, 1);
            int        tohit;
            int        attRoll = twentyside.Roll();

            if (Defender.AC < hitOn20)
            {
                tohit = 20 - (hitOn20 - Defender.AC);
            }
            else if (Defender.AC >= (hitOn20 + 5))
            {
                tohit = 20 + ((Defender.AC - hitOn20) - 5);
            }
            else
            {
                tohit = 20;
            }

            if (attRoll >= tohit)
            {
                int    damage      = 0;
                string damagerange = "";
                foreach (PhysObj CheckObject in this.Inventory)
                {
                    if (CheckObject.IsEquipped == true && CheckObject.ObjType is "Weapon")     // this was just a rough first concept check
                    {
                        damagerange = CheckObject.Damage;                                      // need to allow for two handed etc etc etc
                        (int i1, int i2, int i3) = RollingDie.Diecheck(damagerange);
                        RollingDie thisRoll = new RollingDie(i1, i2, i3);
                        damage = thisRoll.Roll();
                    }
                }
                int DamStrAdj = 0;                    // + str adj to damage
                if (this.Str <= 5)
                {
                    DamStrAdj = -1;
                }
                else if (this.Str == 16 || this.Str == 17)
                {
                    DamStrAdj = 1;
                }
                else if (this.Str >= 18)
                {
                    DamStrAdj = 2;
                }

                damage = (damage + DamStrAdj);
                if (damage < 1)
                {
                    damage = 1;
                }



                Defender.Hp -= damage;                          // same as  Defender.Hp = Defender.Hp - damage;
                if (Defender.Hp <= 0)                           // will change this to proper level for unconsciouness
                {
                    // WriteLine($"{Defender.Name} has died.");
                    Defender.IsAlive = false;
                }
                return(Defender.Hp);
            }
            else
            {// WriteLine($"{name} missed!");
                return(Defender.Hp);
            }
        }
Пример #4
0
        public int monsterAttackCalc(Fant_Entity Defender)
        {
            int cumDamage = 0;

            RollingDie twentyside = new RollingDie(20, 1);
            int        tohit;

            if (Defender.AC < hitOn20)
            {
                tohit = 20 - (hitOn20 - Defender.AC);
            }
            else if (Defender.AC >= (hitOn20 + 5))
            {
                tohit = 20 + ((Defender.AC - hitOn20) - 5);
            }
            else
            {
                tohit = 20;
            }

            int attRoll = twentyside.Roll();

            if (attRoll >= tohit)
            {
                string dieroll = this.damPerAtt1;
                (int i1, int i2, int i3) = RollingDie.Diecheck(dieroll);
                if (i1 != 0)
                {
                    RollingDie thisRoll = new RollingDie(i1, i2, i3);
                    int        damage   = thisRoll.Roll();
                    cumDamage += damage;
                }
            }
            if (this.NoOfAtt >= 2)
            {
                int attRoll2 = twentyside.Roll();
                if (attRoll2 >= tohit)
                {
                    string dieroll2 = this.damPerAtt2;
                    (int i1, int i2, int i3) = RollingDie.Diecheck(dieroll2);
                    if (i1 != 0)
                    {
                        RollingDie thisRoll = new RollingDie(i1, i2, i3);
                        int        damage2  = thisRoll.Roll();
                        cumDamage += damage2;
                    }
                }
            }
            if (this.NoOfAtt >= 3)
            {
                int attRoll3 = twentyside.Roll();
                if (attRoll3 >= tohit)
                {
                    string dieroll3 = this.damPerAtt3;
                    (int i1, int i2, int i3) = RollingDie.Diecheck(dieroll3);
                    if (i1 != 0)
                    {
                        RollingDie thisRoll = new RollingDie(i1, i2, i3);
                        int        damage3  = thisRoll.Roll();
                        cumDamage += damage3;
                    }
                }
            }
            Defender.Hp -= cumDamage;                          // same as  Defender.Hp = Defender.Hp - damage;

            return(Defender.Hp);
        }