예제 #1
0
        public void RollDice(Int16 nbrDice, Int16 dicetype, bool rerollduplicates)
        {
            //[0] contains the total value of all dice rolled.
            //other array position 1 to nbrdice contains the dice result

            Int16[] thishandresult = new Int16[nbrDice + 1];
            thishandresult[0] = 0;
            DiceBag dice = new DiceBag();


            for (Int16 i = 1; i <= nbrDice; i++)
            {
                dice.RollDie(dicetype);

                bool dicerollaccepted = true;

                //dicerollaccepted = ValidateRollAlreadyExists(thishandresult, dice.diceresult);

                if (dicerollaccepted)
                {
                    thishandresult[0] += dice.diceresult;
                    thishandresult[i]  = dice.diceresult;
                }
            }
            handresult = thishandresult;
        }
예제 #2
0
        public void FDE21_RoleAndSkills()
        {
            DiceBag hand = new DiceBag();

            RoleID        = hand.ThrowDice(1, 9);
            CharacterRole = GetRole();

            DistributeCareerPoints(BaseCareerPoints, 1);
        }
예제 #3
0
        private void FDE1_GenerateStats(DiceBag mydicebag)
        {
            //DiceBag hand = new DiceBag();
            DiceBag hand = mydicebag;

            INT  = hand.ThrowDice(2, 6, 11);
            REF  = hand.ThrowDice(2, 6, 11);
            TECH = hand.ThrowDice(2, 6, 11);
            COOL = hand.ThrowDice(2, 6, 11);
            ATTR = hand.ThrowDice(2, 6, 11);
            LUCK = hand.ThrowDice(2, 6, 11);
            MA   = hand.ThrowDice(2, 6, 11);
            BODY = hand.ThrowDice(2, 6, 11);
            EMP  = hand.ThrowDice(2, 6, 11);
        }
예제 #4
0
        public void CreateFastDirtyExpandable(bool bprint)
        {
            DiceBag fdedicebag = new DiceBag();

            FDE1_GenerateStats(fdedicebag);
            FDE21_RoleAndSkills();
            FDE22_Advanced();
            FDE3_Cyberwear();
            FDE4_ArmorAndWeapons();

            if (bprint)
            {
                FDE5_PrintCharacter();
            }
        }
예제 #5
0
        public Int16 ThrowDice(Int16 nbrDice, Int16 dicetype)
        {
            Int16[] thishandresult = new Int16[nbrDice + 1];
            thishandresult[0] = 0;

            for (Int16 i = 1; i <= nbrDice; i++)
            {
                DiceBag dice = new DiceBag();
                dice.RollDie(dicetype);

                thishandresult[0] += dice.diceresult;
                thishandresult[i]  = dice.diceresult;
            }

            return(thishandresult[0]);
        }
예제 #6
0
        // [0] : Total for all dice
        // [i] : result of a die roll


        public void RollDice(Int16 nbrDice, Int16 dicetype)
        {
            //[0] contains the total value of all dice rolled.
            //other array position 1 to nbrdice contains the dice result

            Int16[] thishandresult = new Int16[nbrDice + 1];
            thishandresult[0] = 0;

            for (Int16 i = 1; i <= nbrDice; i++)
            {
                DiceBag dice = new DiceBag();
                dice.RollDie(dicetype);

                thishandresult[0] += dice.diceresult;
                thishandresult[i]  = dice.diceresult;
            }
            handresult = thishandresult;
        }
예제 #7
0
        public Int16 ThrowDice(Int16 nbrDice, Int16 dicetype, Int16 ReRollIfHigherThan)
        {
            Int16[] thishandresult = new Int16[nbrDice + 1];

            DiceBag dice = new DiceBag();


            do
            {
                thishandresult[0] = 0;
                for (Int16 i = 1; i <= nbrDice; i++)
                {
                    dice.RollDie(dicetype);

                    thishandresult[0] += dice.diceresult;
                    thishandresult[i]  = dice.diceresult;
                }
            }while (thishandresult[0] >= ReRollIfHigherThan);

            return(thishandresult[0]);
        }
예제 #8
0
        private Int16 DistributeCareerPoints_SpecialAbility(Int16 CharacterClassLevel)
        {
            Int16 SkillLevel;

            SkillLevel = 0;
            DiceBag hand = new DiceBag();

            switch (CharacterClassLevel)
            {
            case 0: SkillLevel = hand.ThrowDice(1, 10);
                break;

            case 1: SkillLevel = hand.ThrowDice(1, 5);
                break;

            case 2: SkillLevel = 6;
                break;

            case 3: SkillLevel = 7;
                break;

            case 4: SkillLevel = 8;
                break;

            case 5: SkillLevel = 9;
                break;

            case 6: SkillLevel = 10;
                break;

            default:
                SkillLevel = hand.ThrowDice(1, 10);;
                break;
            }
            return(SkillLevel);
        }
예제 #9
0
        //  Fast Dirty Expandable Pickup Skills (for advanced NPC only)
        public void FDE_DistributePickupSkills()
        {
            //If advanced NPC, roll an additional 2D10 and distribute these points among 5 pickup skills.

            Int16 myPickupskillsPoints = 0;

            if (bAdvancedNPCYN)
            {
                DiceBag hand = new DiceBag();
                hand.RollDice(2, 10);

                myPickupskillsPoints     = hand.handresult[0];
                PickupSkillPointsInitial = myPickupskillsPoints;

                Int16 PickupSkillsBalancePoints = myPickupskillsPoints;

                Int16[] mypickupkills = new Int16[6];
                mypickupkills[0] = 0;
                Int16 skillincrement = 1;

                //distribute this total of pickup skill points into 5 skills at random (like other methods).
                do
                {
                    Int16 statposition;

                    //we randomly select a position 1 to 5 to determine which pickup skill will get the increment.
                    statposition = hand.ThrowDice(1, 5);
                    if (mypickupkills[statposition] + skillincrement <= 10)
                    {
                        mypickupkills[statposition] += skillincrement;
                    }

                    //the space [0] contains the total points assigned this loop.
                    mypickupkills[0] += skillincrement;

                    //we reduce the number of points to assign by the increment;
                    PickupSkillsBalancePoints -= skillincrement;
                }while (PickupSkillsBalancePoints > 0);

                //cleanup the array by removing the skills that have zero level.
                Int16[] mypickupkillsCleared = new Int16[6];

                mypickupkillsCleared[0] = mypickupkills[0];
                Int16 nClearedPosCtr = 0;

                for (Int16 i = 1; i <= 5; i++)
                {
                    if (mypickupkills[i] > 0)
                    {
                        nClearedPosCtr += 1;
                        mypickupkillsCleared[nClearedPosCtr] = mypickupkills[i];
                    }
                }

                PickupSkills = mypickupkillsCleared;
            }
            else
            {
                // No pickup skills because this NPC is not "Advanced".
            }
        }
예제 #10
0
        public void DistributeCareerPoints(Int16 CareerPoints, Int16 CharacterClassLevel)
        {
            /*
             * CharacterClassLevel
             * 1 : SpecialAbility 1-5, InitialSkillLevel : 1, MaxSkillLevel : 10, SkillIncrement: 1
             * 2 : SpecialAbility 2-6, InitialSkillLevel : 1, MaxSkillLevel : 10, SkillIncrement: 1
             * 3 : SpecialAbility 3-7, InitialSkillLevel : 1, MaxSkillLevel : 10, SkillIncrement: 1
             * 4 : SpecialAbility 4-8, InitialSkillLevel : 2, MaxSkillLevel : 10, SkillIncrement: 1
             * 5 : SpecialAbility 5-9, InitialSkillLevel : 2, MaxSkillLevel : 10, SkillIncrement: 1
             * 6 : SpecialAbility 6-10, InitialSkillLevel : 2, MaxSkillLevel : 10, SkillIncrement: 1
             */

            /*  Steps to distribute a full Career (Special Ability and 9 Career Skill points
             *
             * 1) Assign Special Ability Level based on CharacterClassLevel
             * 2) Assign InitialSkillLevel to each skill in array CareerSkills
             * 3) Calculate balance of points (CareerPoints (40) - SpecialAbilityLEvel - (InitialSkillLevel * 9 stats)
             * 4) Roll 1-9, add +1 to that array position
             *  make sure it does not exceed MaxSkillLevel per ChracterClassLevel
             *
             */

            CareerSpecialAbilityLevel = DistributeCareerPoints_SpecialAbility(CharacterClassLevel);

            Int16 InitialSkillLevel = 0;

            Int16[] mycareerskills = new Int16[10];
            switch (CharacterClassLevel)
            {
            case 1:
                InitialSkillLevel = 1;
                break;

            case 2:
                InitialSkillLevel = 1;
                break;

            case 3:
                InitialSkillLevel = 1;
                break;

            case 4:
                InitialSkillLevel = 1;
                break;

            case 5:
                InitialSkillLevel = 2;
                break;

            case 6:
                InitialSkillLevel = 2;
                break;

            default:
                break;
            }


            mycareerskills[0] = CareerSpecialAbilityLevel;

            Int16 CareerSkillsAssigned = 0;

            for (Int16 i = 1; i <= 9; i++)
            {
                mycareerskills[i]     = InitialSkillLevel;
                CareerSkillsAssigned += InitialSkillLevel;
            }


            Int16 CareerBalancePoints = 0;
            //CareerBalancePoints = (Int16)(CareerPoints - CareerSpecialAbilityLevel - CareerSkillsAssigned);

            DiceBag hand           = new DiceBag();
            Int16   skillincrement = 1;
            Int16   statposition;

            CareerBalancePoints = (Int16)(CareerPoints - (CareerSpecialAbilityLevel + CareerSkillsAssigned));
            do
            {
                //find what stat is increased

                statposition = hand.ThrowDice(1, 9);

                //Increase that stat position (0 is special ability, 1-9 is the career skill)
                if (mycareerskills[statposition] + skillincrement <= 10)
                {
                    CareerBalancePoints -= skillincrement;

                    mycareerskills[statposition] += skillincrement;

                    CareerSkillsAssigned = 0;
                    for (Int16 i = 1; i <= 9; i++)
                    {
                        CareerSkillsAssigned += mycareerskills[i];
                    }
                    CareerSkillPointsAssigned = CareerSkillsAssigned;

                    //CareerBalancePoints = (Int16)(CareerPoints - CareerSpecialAbilityLevel - CareerSkillPointsAssigned);
                }
            }while (CareerBalancePoints > 0);

            CareerSkillPoints = (Int16)(CareerSpecialAbilityLevel + CareerSkillPointsAssigned);
            CareerSkills      = mycareerskills;
        }
예제 #11
0
        public void FDE3_Cyberwear()
        {
            DiceBag mydicebag = new DiceBag();

            //not done yet.
            string[] cyberoptics = new string[] { "IR", "LL", "DC", "DE", "AD", "TA" };
            string[] cyberarm    = new string[] { "Med. Pistol", "Light Pistol", "Med. Pistol", "Light Submachinegun", "Very Heavy Pistol", "Heavy Pistol" };
            string[] cyberaudio  = new string[] { "Wearman", "Radio Splice", "Phone Link", "Amplified Hearing", "Sound Editing", "Digital Recording Link" };

            string[] cyberwear = new string[] {};

            Int16 nbrdice = 3;

            if (CharacterRole == "Solo")
            {
                nbrdice = 6;
            }

            Int16[] handresultcyberwear = new Int16[nbrdice];

            mydicebag.RollDice(nbrdice, 6, true);
            handresultcyberwear = mydicebag.handresult;

            DiceBag myseconddicebag = new DiceBag();


            for (Int16 i = 0; i <= nbrdice; i++)
            {
                myseconddicebag.RollDice(1, 6);

                switch (handresultcyberwear[i])
                {
                case 1:     //Cyberoptic
                    //cyberwear[i] = cyberoptics[myseconddicebag.handresult];
                    break;

                case 2:     //Cyberarm
                    break;

                case 3:     //Cyberaudio
                    break;

                case 4:      //Big Knucks
                    break;

                case 5:     //Rippers
                    break;

                case 6:     //Vampires
                    break;

                case 7:     //Slice n dice
                    break;

                case 8:     //Reflex Boost (Kerenzikov)
                    break;

                case 9:     //Reflex Boost (Sandevistan)
                    break;

                case 10:        //Nothing
                    break;

                default:
                    break;
                }
            }
        }
예제 #12
0
        static void FastDirtyExpandable_old()
        {
            Character punk = new Character();
            DiceBag   hand = new DiceBag();

            //Step 1 Stats
            //2D6 nine times
            //Index 0 always has to total for all the dice rolled.
            punk.INT  = hand.ThrowDice(2, 6, 11);
            punk.REF  = hand.ThrowDice(2, 6, 11);
            punk.TECH = hand.ThrowDice(2, 6, 11);
            punk.COOL = hand.ThrowDice(2, 6, 11);
            punk.ATTR = hand.ThrowDice(2, 6, 11);
            punk.LUCK = hand.ThrowDice(2, 6, 11);
            punk.MA   = hand.ThrowDice(2, 6, 11);
            punk.BODY = hand.ThrowDice(2, 6, 11);
            punk.EMP  = hand.ThrowDice(2, 6, 11);

            //Step 2 Role & Skills
            punk.RoleID        = hand.ThrowDice(1, 9);
            punk.CharacterRole = punk.GetRole();

            Console.WriteLine(punk.CharacterRole);
            //Console.WriteLine("INT:" + punk.INT.ToString());
            //Console.WriteLine("REF:" + punk.REF.ToString());
            //Console.WriteLine("TECH:" + punk.TECH.ToString());
            Console.WriteLine("INT:{0}   REF:{1}   TECH:{2}", punk.INT.ToString(), punk.REF.ToString(), punk.TECH.ToString());
            Console.WriteLine("COOL:{0}  ATTR:{1}  LUCK:{2}", punk.COOL.ToString(), punk.ATTR.ToString(), punk.LUCK.ToString());
            Console.WriteLine("MA:{0}    BODY:{1}  EMP:{2}", punk.MA.ToString(), punk.BODY.ToString(), punk.EMP.ToString());
            Console.WriteLine();

            //Console.WriteLine("Press <ENTER> to view Skills...");
            //Console.ReadLine();

            punk.DistributeCareerPoints(40, 1);
            Console.WriteLine("Special Ability Level :" + punk.CareerSpecialAbilityLevel.ToString());

            for (Int16 i = 0; i <= 9; i++)
            {
                Console.WriteLine("Skill Level :" + punk.CareerSkills[i].ToString());
            }

            //Step 2.2 Pickup Skills for advanced NPC
            //ask if Advanced NPC Y/N : ?

            //bool bAdvancedNPCYN = false;

            Console.Write("Is this an advanced NPC (Y/N) :");
            ConsoleKeyInfo result = Console.ReadKey();

            //bAdvancedNPCYN = (result.Key == ConsoleKey.Y);

            punk.bAdvancedNPCYN = (result.Key == ConsoleKey.Y);
            punk.FDE_DistributePickupSkills();
            if (punk.bAdvancedNPCYN)
            {
                //Console.WriteLine();
                //Console.WriteLine(punk.PickupSkillPointsInitial.ToString());

                //punk.DisplayPickupSkills();
            }
            else
            {
                Console.WriteLine();
            }



            //Step 3 Pick Cyberwear
            //Roll 1D10. Solos roll 6 times. all others roll 3 times.
            //if duplicates rolls, re-roll.
        }