本文整理汇总了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);
}
}