Ejemplo n.º 1
0
        static int obj_desc_inscrip(Object o_ptr, ref string buf, int max, int end)
        {
            string[] u = { "", "", "", "" };
            int      n = 0;

            Object.obj_pseudo_t feel        = o_ptr.pseudo();
            Bitflag             flags_known = new Bitflag(Object_Flag.SIZE);
            Bitflag             f2          = new Bitflag(Object_Flag.SIZE);

            o_ptr.object_flags_known(ref flags_known);

            /* Get inscription */
            if (o_ptr.note != null && o_ptr.note.value != null)
            {
                u[n++] = o_ptr.note.ToString();
            }

            /* Use special inscription, if any */
            if (!o_ptr.is_known() && feel != 0)
            {
                /* cannot tell excellent vs strange vs splendid until wield */
                if (!o_ptr.was_worn() && o_ptr.ego != null)
                {
                    u[n++] = "ego";
                }
                else
                {
                    u[n++] = Misc.inscrip_text[(int)feel];             //I know that feel bro.
                }
            }
            else if (((o_ptr.ident & Object.IDENT_EMPTY) != 0) && !o_ptr.is_known())
            {
                u[n++] = "empty";
            }
            else if (!o_ptr.is_known() && o_ptr.was_worn())
            {
                if (o_ptr.wield_slot() == Misc.INVEN_WIELD || o_ptr.wield_slot() == Misc.INVEN_BOW)
                {
                    u[n++] = "wielded";
                }
                else
                {
                    u[n++] = "worn";
                }
            }
            else if (!o_ptr.is_known() && o_ptr.was_fired())
            {
                u[n++] = "fired";
            }
            else if (!o_ptr.flavor_is_aware() && o_ptr.flavor_was_tried())
            {
                u[n++] = "tried";
            }

            /* Note curses */
            Object_Flag.create_mask(f2, false, Object_Flag.object_flag_type.CURSE);
            if (flags_known.is_inter(f2))
            {
                u[n++] = "cursed";
            }

            /* Note squelch */
            if (Squelch.item_ok(o_ptr))
            {
                u[n++] = "squelch";
            }

            if (n != 0)
            {
                int i;
                for (i = 0; i < n; i++)
                {
                    if (i == 0)
                    {
                        buf = buf + " {";
                    }
                    buf = buf + u[i];
                    if (i < n - 1)
                    {
                        buf += ", ";
                    }
                }

                buf += "}";
            }

            return(end);
        }
Ejemplo n.º 2
0
        static int obj_desc_inscrip(Object o_ptr, ref string buf, int max, int end)
        {
            string[] u = {"", "", "", ""};
            int n = 0;
            Object.obj_pseudo_t feel = o_ptr.pseudo();
            Bitflag flags_known = new Bitflag(Object_Flag.SIZE);
            Bitflag f2 = new Bitflag(Object_Flag.SIZE);

            o_ptr.object_flags_known(ref flags_known);

            /* Get inscription */
            if (o_ptr.note != null && o_ptr.note.value != null)
                u[n++] = o_ptr.note.ToString();

            /* Use special inscription, if any */
            if (!o_ptr.is_known() && feel != 0)
            {
                /* cannot tell excellent vs strange vs splendid until wield */
                if (!o_ptr.was_worn() && o_ptr.ego != null)
                    u[n++] = "ego";
                else
                    u[n++] = Misc.inscrip_text[(int)feel]; //I know that feel bro.
            }
            else if (((o_ptr.ident & Object.IDENT_EMPTY) != 0) && !o_ptr.is_known())
                u[n++] = "empty";
            else if (!o_ptr.is_known() && o_ptr.was_worn())
            {
                if (o_ptr.wield_slot() == Misc.INVEN_WIELD || o_ptr.wield_slot() == Misc.INVEN_BOW)
                    u[n++] = "wielded";
                else u[n++] = "worn";
            }
            else if (!o_ptr.is_known() && o_ptr.was_fired())
                u[n++] = "fired";
            else if (!o_ptr.flavor_is_aware() && o_ptr.flavor_was_tried())
                u[n++] = "tried";

            /* Note curses */
            Object_Flag.create_mask(f2, false, Object_Flag.object_flag_type.CURSE);
            if (flags_known.is_inter(f2))
                u[n++] = "cursed";

            /* Note squelch */
            if (Squelch.item_ok(o_ptr))
                u[n++] = "squelch";

            if (n != 0)
            {
                int i;
                for (i = 0; i < n; i++)
                {
                    if(i == 0)
                        buf = buf + " {";
                    buf = buf + u[i];
                    if (i < n-1)
                        buf += ", ";
                }

                buf += "}";
            }

            return end;
        }