Beispiel #1
0
        /* Put the autoinscription on an object */
        public static int apply_autoinscription(Object.Object o_ptr)
        {
            string o_name = "";             //80
            string note   = get_autoinscription(o_ptr.kind);

            /* Don't inscribe unaware objects */
            if (note == null || note.Length == 0 || !o_ptr.flavor_is_aware())
            {
                return(0);
            }

            /* Don't re-inscribe if it's already inscribed */
            if (o_ptr.note != null)
            {
                return(0);
            }

            /* Get an object description */
            o_name = o_ptr.object_desc(Object.Object.Detail.PREFIX | Object.Object.Detail.FULL);

            if (note == null)
            {
                o_ptr.note = Quark.Add(note);
            }
            else
            {
                o_ptr.note = null;
            }

            Utilities.msg("You autoinscribe {0}.", o_name);

            return(1);
        }
Beispiel #2
0
        public static Quark Add(string Value)
        {
            foreach (Quark q in quarks){
                if(q.ToString() == Value) {
                    return q;
                }
            }

            Quark ret = new Quark();
            ret.value = Value;

            quarks.Add(ret);

            return ret;
        }
Beispiel #3
0
        public static Quark Add(string Value)
        {
            foreach (Quark q in quarks)
            {
                if (q.ToString() == Value)
                {
                    return(q);
                }
            }

            Quark ret = new Quark();

            ret.value = Value;

            quarks.Add(ret);

            return(ret);
        }
Beispiel #4
0
        /*
         * Initialize some other arrays
         */
        static Parser.Error init_other()
        {
            /*** Prepare the various "bizarre" arrays ***/

            /* Initialize the "quark" package */
            Quark.Init();

            /* Initialize squelch things */
            Squelch.Init();
            TextUI.knowledge_init();

            /* Initialize the "message" package */
            Message.Init();

            /*** Prepare grid arrays ***/

            /* Array of grids */
            Misc.temp_g = new ushort[Misc.TEMP_MAX];

            Cave.instance = new Cave();

            /* Array of stacked monster messages */
            Monster_Message.mon_msg          = new Monster_Race_Message[Misc.MAX_STORED_MON_MSG];
            Monster_Message.mon_message_hist = new Monster_Message_History[Misc.MAX_STORED_MON_CODES];

            /*** Prepare "vinfo" array ***/

            /* Used by "update_view()" */
            Cave.vinfo_init();


            /*** Prepare entity arrays ***/

            /* Objects */
            Object.Object.Init();

            /*** Prepare lore array ***/

            /* Lore */
            Misc.l_list = new Monster_Lore[Misc.z_info.r_max];


            /*** Prepare mouse buttons ***/
            Button.Init(Button.add_text, Button.kill_text);


            /*** Prepare quest array ***/

            /* Quests */
            Misc.q_list = new Quest[Misc.MAX_Q_IDX];


            /*** Prepare the inventory ***/

            /* Allocate it */
            Player.Player.instance.inventory = new Object.Object[Misc.ALL_INVEN_TOTAL];
            for (int i = 0; i < Player.Player.instance.inventory.Count(); i++)
            {
                Player.Player.instance.inventory[i] = new Object.Object();
            }


            /*** Prepare the options ***/
            Option.set_defaults();

            /* Initialize the window flags */
            for (int i = 0; i < Misc.ANGBAND_TERM_MAX; i++)
            {
                /* Assume no flags */
                Player_Other.instance.window_flag[i] = (uint)0L;             //God damn it, who wrote that?!?! -werror should be on!!!
            }


            /*** Pre-allocate space for the "format()" buffer ***/             //Nick: Not needed in C#
            /* Hack -- Just call the "format()" function */
            //format("I wish you could swim, like dolphins can swim...");

            /* Success */
            return(0);
        }