Beispiel #1
0
/*
 * Output object information
 */
static textblock *object_info_out(const object_type *o_ptr, oinfo_detail_t mode)
{
	bool something = FALSE;

	bool full = mode & OINFO_FULL;
	bool terse = mode & OINFO_TERSE;
	bool subjective = mode & OINFO_SUBJ;
	bool ego = mode & OINFO_EGO;
	bool dummy = mode & OINFO_DUMMY;

	textblock *tb = textblock_new();

	if (subjective) describe_origin(tb, o_ptr);
	if (!terse) describe_flavor_text(tb, o_ptr);

	if (describe_set(tb, o_ptr, mode)) something = TRUE;
	if (describe_stats(tb, o_ptr, mode)) something = TRUE;
	if (describe_bonus(tb, o_ptr, mode)) something = TRUE;
	if (describe_slays(tb, o_ptr, mode)) something = TRUE;
	if (describe_brands(tb, o_ptr, mode)) something = TRUE;
	if (describe_immune(tb, o_ptr, mode)) something = TRUE;
	if (describe_sustains(tb, o_ptr, mode)) something = TRUE;
	if (describe_misc_magic(tb, o_ptr, mode)) something = TRUE;
	if (ego && describe_ego(tb, o_ptr)) something = TRUE;
	if (describe_ignores(tb, o_ptr, mode)) something = TRUE;
	if (describe_curses(tb, o_ptr, mode)) something = TRUE;
	if (describe_effect(tb, o_ptr, mode)) something = TRUE;
	
	if (subjective && describe_combat(tb, o_ptr, mode))
	{
		something = TRUE;
		textblock_append(tb, "\n");
	}

	if (!terse && describe_food(tb, o_ptr, subjective, full)) something = TRUE;
	if (describe_light(tb, o_ptr, terse)) something = TRUE;
	if (!terse && subjective && describe_digger(tb, o_ptr, mode)) something = TRUE;

	//if (!something)
	//	textblock_append(tb, "\n");
	if (!terse && !dummy) {
	    textblock_append(tb, "\n");
	    textblock_append(tb, obj_class_info[o_ptr->tval]);
	    textblock_append(tb, "\n");
	}
	return tb;
}
Beispiel #2
0
/*
 * Output object information
 */
bool object_info_out(const object_type *o_ptr)
{
	u32b f1, f2, f3;
	u32b ff1, ff2, ff3;
	bool something = FALSE;

	/* Grab the object flags */
	object_info_out_flags(o_ptr, &f1, &f2, &f3);

	/* Hack - grab the ID-independent flags */
	/* Used to show handedness even when not ID'd */
	object_flags(o_ptr, &ff1, &ff2, &ff3);

	/* Describe the object */
	if (describe_stats(o_ptr, f1))						something = TRUE;
	if (describe_neg_stats(o_ptr, f1))					something = TRUE;
	if (describe_secondary(o_ptr, f1))					something = TRUE;
	if (describe_slay(o_ptr, f1))						something = TRUE;
	if (describe_brand(o_ptr, f1))						something = TRUE;
	if (describe_misc_weapon_attributes(o_ptr, f1))		something = TRUE;
	if (describe_resist(o_ptr, f2))						something = TRUE;
	if (describe_vulnerability(o_ptr, f2))				something = TRUE;
	if (describe_sustains(o_ptr, f2))					something = TRUE;
	if (describe_misc_magic(o_ptr, f2, f3))				something = TRUE;
	if (describe_activation(o_ptr, f3))					something = TRUE;
	if (describe_ignores(o_ptr, f3))					something = TRUE;
	if (describe_abilities(o_ptr))						something = TRUE;
	
	if (describe_handedness(o_ptr, ff3))				something = TRUE;
	if (describe_polearmness(ff3))						something = TRUE;
	if (describe_archery(o_ptr))						something = TRUE;

	
	/* We are done. */
	return something;
}
Beispiel #3
0
/*
 * Output object information
 */
static textblock *object_info_out(const object_type *o_ptr, oinfo_detail_t mode)
{
	bitflag flags[OF_SIZE];
	bitflag pval_flags[MAX_PVALS][OF_SIZE];
	bool something = FALSE;
	bool known = object_is_known(o_ptr);

	bool full = mode & OINFO_FULL;
	bool terse = mode & OINFO_TERSE;
	bool subjective = mode & OINFO_SUBJ;
	bool ego = mode & OINFO_EGO;

	textblock *tb = textblock_new();

	/* Grab the object flags */
	if (full) {
		object_flags(o_ptr, flags);
		object_pval_flags(o_ptr, pval_flags);
	} else {
		object_flags_known(o_ptr, flags);
		object_pval_flags_known(o_ptr, pval_flags);
	}

	if (subjective) describe_origin(tb, o_ptr);
	if (!terse) describe_flavor_text(tb, o_ptr);

	if (!full && !known)
	{
		textblock_append(tb, "You do not know the full extent of this item's powers.\n");
		if (SENSING_REVEALS_FLAG_COUNT) {
			if (object_was_sensed(o_ptr)) {
				int unlearned = object_num_unlearned_flags(o_ptr);
				switch(unlearned) {
					case 0:
						textblock_append(tb, "It has no unknown flags.\n");
						break;
					case 1:
						textblock_append(tb, "It has 1 unknown flag.\n", unlearned);
						break;
					default:
						textblock_append(tb, "It has %d unknown flags.\n", unlearned);
						break;
				}
			}
		}

		something = TRUE;
	}

	if (describe_curses(tb, o_ptr, flags)) something = TRUE;
	if (describe_stats(tb, o_ptr, pval_flags, mode)) something = TRUE;
	if (describe_slays(tb, flags, o_ptr->tval)) something = TRUE;
	if (describe_immune(tb, flags)) something = TRUE;
	if (describe_ignores(tb, flags)) something = TRUE;
	if (describe_sustains(tb, flags)) something = TRUE;
	if (describe_misc_magic(tb, flags)) something = TRUE;
	if (ego && describe_ego(tb, o_ptr->ego)) something = TRUE;
	if (something) textblock_append(tb, "\n");

	if (describe_effect(tb, o_ptr, full, terse, subjective))
	{
		something = TRUE;
		textblock_append(tb, "\n");
	}

	if (subjective && describe_combat(tb, o_ptr, mode))
	{
		something = TRUE;
		textblock_append(tb, "\n");
	}

	if (!terse && describe_food(tb, o_ptr, subjective, full)) something = TRUE;
	if (describe_light(tb, o_ptr, flags, terse)) something = TRUE;
	if (!terse && subjective && describe_digger(tb, o_ptr, mode)) something = TRUE;

	if (!something)
		textblock_append(tb, "\n\nThis item does not seem to possess any special abilities.");

	return tb;
}
Beispiel #4
0
/*
 * Output object information
 */
static textblock *object_info_out(const object_type *o_ptr, oinfo_detail_t mode)
{
	bitflag flags[OF_SIZE];
	bitflag pval_flags[MAX_PVALS][OF_SIZE];
	bool something = FALSE;
	bool known = object_is_known(o_ptr);

	bool full = mode & OINFO_FULL;
	bool terse = mode & OINFO_TERSE;
	bool subjective = mode & OINFO_SUBJ;
	bool ego = mode & OINFO_EGO;

	textblock *tb = textblock_new();

	/* Grab the object flags */
	if (full) {
		object_flags(o_ptr, flags);
		object_pval_flags(o_ptr, pval_flags);
	} else {
		object_flags_known(o_ptr, flags);
		object_pval_flags_known(o_ptr, pval_flags);
	}

	if (subjective) describe_origin(tb, o_ptr);
	if (!terse) describe_flavor_text(tb, o_ptr, mode);

	if (!full && !known)
	{
		textblock_append(tb, "You do not know the full extent of this item's powers.\n");
		something = TRUE;
	}

	if (describe_curses(tb, o_ptr, flags)) something = TRUE;
	if (describe_stats(tb, o_ptr, pval_flags, mode)) something = TRUE;
	if (describe_slays(tb, flags, o_ptr->tval)) something = TRUE;
	if (describe_immune(tb, flags)) something = TRUE;
	if (describe_ignores(tb, flags)) something = TRUE;
	dedup_hates_flags(flags);
	if (describe_hates(tb, flags)) something = TRUE;
	if (describe_sustains(tb, flags)) something = TRUE;
	if (describe_misc_magic(tb, flags)) something = TRUE;
	if (ego && describe_ego(tb, o_ptr->ego)) something = TRUE;
	if (something) textblock_append(tb, "\n");

	if (!ego && describe_effect(tb, o_ptr, full, terse, subjective)) {
		something = TRUE;
		textblock_append(tb, "\n");
	}

	if (subjective && describe_combat(tb, o_ptr, mode)) {
		something = TRUE;
		textblock_append(tb, "\n");
	}

	if (!terse && describe_food(tb, o_ptr, subjective, full)) something = TRUE;
	if (describe_light(tb, o_ptr, flags, mode)) something = TRUE;
	if (!terse && subjective && describe_digger(tb, o_ptr, mode)) something = TRUE;

	if (!something)
		textblock_append(tb, "\n\nThis item does not seem to possess any special abilities.");

	return tb;
}
Beispiel #5
0
/**
 * Output object information
 */
static textblock *object_info_out(const struct object *obj, int mode)
{
	bitflag flags[OF_SIZE];
	struct element_info el_info[N_ELEMENTS(elements)];
	bool something = false;
	bool known = object_all_but_flavor_is_known(obj);

	bool terse = mode & OINFO_TERSE ? true : false;
	bool subjective = mode & OINFO_SUBJ ? true : false;
	bool ego = mode & OINFO_EGO ? true : false;
	textblock *tb = textblock_new();
	const struct object *known_obj = obj->known ? obj->known : obj;

	/* Unaware objects get simple descriptions */
	if (obj->kind != known_obj->kind) {
		textblock_append(tb, "\n\nYou do not know what this is.\n");
		return tb;
	}

	/* Grab the object flags */
	get_known_flags(obj, mode, flags);

	/* Grab the element info */
	get_known_elements(obj, mode, el_info);

	if (subjective) describe_origin(tb, obj, terse);
	if (!terse) describe_flavor_text(tb, obj, ego);

	if (!known)	{
		textblock_append(tb, "You do not know the full extent of this item's powers.\n");
		something = true;
	}

	if (describe_curses(tb, obj, flags)) something = true;
	if (describe_stats(tb, obj, mode)) something = true;
	if (describe_slays(tb, obj)) something = true;
	if (describe_brands(tb, obj)) something = true;
	if (describe_elements(tb, el_info)) something = true;
	if (describe_protects(tb, flags)) something = true;
	if (describe_ignores(tb, el_info)) something = true;
	if (describe_hates(tb, el_info)) something = true;
	if (describe_sustains(tb, flags)) something = true;
	if (describe_misc_magic(tb, flags)) something = true;
	if (describe_light(tb, obj, mode)) something = true;
	if (ego && describe_ego(tb, obj->ego)) something = true;
	if (something) textblock_append(tb, "\n");

	/* Skip all the very specific information where we are giving general
	   ego knowledge rather than for a single item - abilities can vary */
	if (!ego) {
		if (describe_effect(tb, obj, terse, subjective)) {
			something = true;
			textblock_append(tb, "\n");
		}
		
		if (subjective && describe_combat(tb, obj)) {
			something = true;
			textblock_append(tb, "\n");
		}
		
		if (!terse && subjective && describe_digger(tb, obj)) something = true;
	}

	/* Don't append anything in terse (for chararacter dump) */
	if (!something && !terse)
		textblock_append(tb, "\n\nThis item does not seem to possess any special abilities.");

	return tb;
}