Exemplo n.º 1
0
        /*
         * This fleshes out a full player based on the choices currently made,
         * and so is called whenever things like race or class are chosen.
         */
        public void generate(Player_Sex s, Player_Race r, Player_Class c)
        {
            if (s == null)
            {
                s = Misc.sex_info[psex];
            }
            if (c == null)
            {
                c = Class;
            }
            if (r == null)
            {
                r = Race;
            }

            Sex   = s;
            Class = c;
            Race  = r;

            // Level 1
            max_lev = lev = 1;

            // Experience factor
            expfact = (byte)(Race.r_exp + Class.c_exp);

            // Hitdice
            hitdie = (byte)(Race.r_mhp + Class.c_mhp);

            // Initial hitpoints
            mhp = hitdie;

            // Pre-calculate level 1 hitdice
            player_hp[0] = hitdie;

            // Roll for age/height/weight
            get_ahw();

            //HACK - get_history relies on a pointer, so we have to pack and unpack SC...
            if (Race.history != null)
            {
                history = Race.history.get_history(out sc);
            }
            else
            {
                history = "";
            }

            sc_birth = sc;
        }
Exemplo n.º 2
0
        /*
         * This fleshes out a full player based on the choices currently made,
         * and so is called whenever things like race or class are chosen.
         */
        public void generate(Player_Sex s, Player_Race r, Player_Class c)
        {
            if (s == null) s = Misc.sex_info[psex];
            if (c == null) c = Class;
            if (r == null) r = Race;

            Sex = s;
            Class = c;
            Race = r;

            // Level 1
            max_lev = lev = 1;

            // Experience factor
            expfact = (byte)(Race.r_exp + Class.c_exp);

            // Hitdice
            hitdie = (byte)(Race.r_mhp + Class.c_mhp);

            // Initial hitpoints
            mhp = hitdie;

            // Pre-calculate level 1 hitdice
            player_hp[0] = hitdie;

            // Roll for age/height/weight
            get_ahw();

            //HACK - get_history relies on a pointer, so we have to pack and unpack SC...
            if(Race.history != null) {
                history = Race.history.get_history(out sc);
            } else {
                history = "";
            }

            sc_birth = sc;
        }