当前位置: 首页>>代码示例>>C#>>正文


C# Object.flavor_aware方法代码示例

本文整理汇总了C#中System.Object.flavor_aware方法的典型用法代码示例。如果您正苦于以下问题:C# Object.flavor_aware方法的具体用法?C# Object.flavor_aware怎么用?C# Object.flavor_aware使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Object的用法示例。


在下文中一共展示了Object.flavor_aware方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: do_ident_item

        /*
         * Identify an item.
         *
         * `item` is used to print the slot occupied by an object in equip/inven.
         * Any negative value assigned to "item" can be used for specifying an object
         * on the floor.
         */
        public static void do_ident_item(int item, Object.Object o_ptr)
        {
            string o_name = "";//80

            Message_Type msg_type = (Message_Type)0;
            int i;
            bool bad = true;

            /* Identify it */
            o_ptr.flavor_aware();
            o_ptr.notice_everything();

            /* Apply an autoinscription, if necessary */
            Squelch.apply_autoinscription(o_ptr);

            /* Set squelch flag */
            Misc.p_ptr.notice |= (int)Misc.PN_SQUELCH;

            /* Recalculate bonuses */
            Misc.p_ptr.update |= (Misc.PU_BONUS);

            /* Combine / Reorder the pack (later) */
            Misc.p_ptr.notice |= (int)(Misc.PN_COMBINE | Misc.PN_REORDER | Misc.PN_SORT_QUIVER);

            /* Window stuff */
            Misc.p_ptr.redraw |= (Misc.PR_INVEN | Misc.PR_EQUIP);

            /* Description */
            o_name = o_ptr.object_desc(Object.Object.Detail.PREFIX | Object.Object.Detail.FULL);

            /* Determine the message type. */
            /* CC: we need to think more carefully about how we define "bad" with
             * multiple pvals - currently using "all nonzero pvals < 0" */
            for (i = 0; i < o_ptr.num_pvals; i++)
                if (o_ptr.pval[i] > 0)
                    bad = false;

            if (bad)
                msg_type = Message_Type.MSG_IDENT_BAD;
            else if (o_ptr.artifact != null)
                msg_type = Message_Type.MSG_IDENT_ART;
            else if (o_ptr.ego != null)
                msg_type = Message_Type.MSG_IDENT_EGO;
            else
                msg_type = Message_Type.MSG_GENERIC;

            /* Log artifacts to the history list. */
            if (o_ptr.artifact != null)
                History.add_artifact(o_ptr.artifact, true, true);

            /* Describe */
            if (item >= Misc.INVEN_WIELD)
            {
                Utilities.msgt(msg_type, "{0}: {1} ({2}).", Object.Object.describe_use(item), o_name, Object.Object.index_to_label(item));
                //Utilities.msgt(msg_type, "%^s: %s (%c).", describe_use(item), o_name, index_to_label(item));
            }
            else if (item >= 0)
            {
                Utilities.msgt(msg_type, "In your pack: {0} ({1}).", o_name, Object.Object.index_to_label(item));
                //Utilities.msgt(msg_type, "In your pack: %s (%c).", o_name, index_to_label(item));
            }
            else
            {
                Utilities.msgt(msg_type, "On the ground: {0}.", o_name);
            }
        }
开发者ID:jobjingjo,项目名称:csangband,代码行数:73,代码来源:Spell.cs


注:本文中的System.Object.flavor_aware方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。