コード例 #1
0
        public static Object.Object_Kind Longsword()
        {
            Object.Object_Kind ok = new Object.Object_Kind();
            ok.Name = "Test Longsword";
            ok.Text = "A test longsword [0].";
            ok.Base = Sword_Base();
            ok.kidx = 0;
            ok.tval = Object.TVal.TV_SWORD;
            ok.sval = (int)Object.SVal.sval_sword.SV_LONG_SWORD;
            ok.pval = new random_value[] {
                new random_value(),
                new random_value(),
                new random_value()
            };

            ok.to_h = new random_value(1, 0, 0, 0);
            ok.to_d = new random_value(1, 0, 0, 0);
            ok.to_a = new random_value(2, 0, 0, 0);

            ok.dd     = 4;
            ok.ds     = 6;
            ok.weight = 16;

            ok.cost = 20;

            ok.d_attr = 0;
            ok.d_char = '|';

            ok.alloc_prob = 20;
            ok.alloc_min  = 1;
            ok.alloc_max  = 10;
            ok.level      = 0;

            ok.effect        = Effect.XXX;      //That's default, right?
            ok.gen_mult_prob = 0;
            ok.flavor        = null;
            return(ok);
        }
コード例 #2
0
        public static Object.Object_Kind Torch()
        {
            Object.Object_Kind t = new Object.Object_Kind();
            t.Name = "Test Torch";
            t.Text = "A test torch [1].";
            t.kidx = 1;
            t.tval = Object.TVal.TV_LIGHT;
            t.sval = Object.SVal.SV_LIGHT_TORCH;
            t.pval = new random_value[] {
                new random_value(5000, 0, 0, 0),
                new random_value(),
                new random_value(),
            };

            t.to_h = new random_value();
            t.to_d = new random_value();
            t.to_a = new random_value();

            t.dd     = 1;
            t.ds     = 1;
            t.weight = 10;

            t.cost = 1;

            t.d_attr = 0;
            t.d_char = '~';

            t.alloc_prob = 10;
            t.alloc_min  = 1;
            t.alloc_max  = 10;
            t.level      = 0;

            t.effect        = Effect.XXX;
            t.gen_mult_prob = 0;
            t.flavor        = null;
            return(t);
        }
コード例 #3
0
        public static Object.Object_Kind Gold()
        {
            Object.Object_Kind g = new Object.Object_Kind();
            g.Name = "Test Gold";
            g.Text = "Test gold [2].";
            g.kidx = 2;
            g.tval = Object.TVal.TV_GOLD;
            g.sval = 0;
            g.pval = new random_value[] {
                new random_value(),
                new random_value(),
                new random_value(),
            };

            g.to_h = new random_value();
            g.to_d = new random_value();
            g.to_a = new random_value();

            g.dd     = 1;
            g.ds     = 1;
            g.weight = 1;

            g.cost = 0;

            g.d_attr = 0;
            g.d_char = '$';

            g.alloc_prob = 0;
            g.alloc_min  = 0;
            g.alloc_max  = 0;
            g.level      = 0;

            g.effect        = Effect.XXX;
            g.gen_mult_prob = 0;
            g.flavor        = null;
            return(g);
        }
コード例 #4
0
        public Player()
        {
            instance = this;
            bool keep_randarts = false;

            inventory = null;

            /* Preserve p_ptr.randarts so that players can use loaded randarts even
             * if they create a completely different character */
            if (randarts)
            {
                keep_randarts = true;
            }

            /* Wipe the player */
            //(void)WIPE(p, struct player); //Already have a clean slate

            randarts = keep_randarts;

            //Enable below else later

            /* Start with no artifacts made yet */
            for (int i = 0; Misc.z_info != null && i < Misc.z_info.a_max; i++)
            {
                Artifact a_ptr = Misc.a_info[i];
                if (a_ptr == null)
                {
                    continue;
                }
                a_ptr.created = false;
                a_ptr.seen    = false;
            }


            /* Start with no quests */
            for (int i = 0; Misc.q_list != null && i < Misc.MAX_Q_IDX; i++)
            {
                if (Misc.q_list[i] == null)
                {
                    Misc.q_list[i] = new Quest();
                }
                Misc.q_list[i].level = 0;
            }

            if (Misc.q_list != null)
            {
                Misc.q_list[0].level = 99;
                Misc.q_list[1].level = 100;
            }

            for (int i = 1; Misc.z_info != null && i < Misc.z_info.k_max; i++)
            {
                Object.Object_Kind k_ptr = Misc.k_info[i];
                if (k_ptr == null)
                {
                    continue;
                }
                k_ptr.tried = false;
                k_ptr.aware = false;
            }

            for (int i = 1; Misc.z_info != null && i < Misc.z_info.r_max; i++)
            {
                Monster_Race r_ptr = Misc.r_info[i];
                Monster_Lore l_ptr = Misc.l_list[i];
                if (r_ptr == null || l_ptr == null)
                {
                    continue;
                }
                r_ptr.cur_num = 0;
                r_ptr.max_num = 100;
                if (r_ptr.flags.has(Monster_Flag.UNIQUE.value))
                {
                    r_ptr.max_num = 1;
                }
                l_ptr.pkills = 0;
            }


            /* Hack -- no ghosts */
            if (Misc.z_info != null && Misc.r_info[Misc.z_info.r_max - 1] != null)
            {
                Misc.r_info[Misc.z_info.r_max - 1].max_num = 0;
            }


            /* Always start with a well fed player (this is surely in the wrong fn) */
            food = Misc.PY_FOOD_FULL - 1;


            /* None of the spells have been learned yet */
            for (int i = 0; i < Misc.PY_MAX_SPELLS; i++)
            {
                spell_order[i] = 99;
            }

            inventory = new Object.Object[Misc.ALL_INVEN_TOTAL];
            for (int i = 0; i < Misc.ALL_INVEN_TOTAL; i++)
            {
                inventory[i] = new Object.Object();
            }

            /* First turn. */
            Misc.turn    = 1;
            total_energy = 0;
            resting_turn = 0;
            /* XXX default race/class */
            Race  = Misc.races;
            Class = Misc.classes;
        }