summaryrefslogtreecommitdiff
path: root/src/ego_item_type.hpp
blob: 2082c0834c6d84cc7757b96f751a373ecc8d53cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#pragma once

#include "ego_flag_set.hpp"
#include "h-basic.h"
#include "object_flag_set.hpp"

#include <array>

/*
 * Size of flag rarity tables
 */
constexpr int FLAG_RARITY_MAX = 6;

/**
 * Ego item descriptors.
 */
struct ego_item_type
{
	const char *name = nullptr;              /* Name */

	bool_ before = FALSE;                    /* Before or after the object name ? */

	byte tval[10] = { 0 };
	byte min_sval[10] = { 0 };
	byte max_sval[10] = { 0 };

	byte rating = 0;                         /* Rating boost */

	byte level = 0;                          /* Minimum level */
	byte rarity = 0;                         /* Object rarity */
	byte mrarity = 0;                        /* Object rarity */

	s16b max_to_h = 0;                       /* Maximum to-hit bonus */
	s16b max_to_d = 0;                       /* Maximum to-dam bonus */
	s16b max_to_a = 0;                       /* Maximum to-ac bonus */

	s16b activate = 0;                       /* Activation Number */

	s32b max_pval = 0;                       /* Maximum pval */

	s32b cost = 0;                           /* Ego-item "cost" */

	byte rar[FLAG_RARITY_MAX] = { 0 };

	std::array<object_flag_set, FLAG_RARITY_MAX> flags;
	std::array<object_flag_set, FLAG_RARITY_MAX> oflags;

	std::array<ego_flag_set, FLAG_RARITY_MAX> fego;

	object_flag_set need_flags;
	object_flag_set forbid_flags;

	s16b power = -1;                        /* Power granted, if any */

public:
	ego_item_type()
	{
		std::fill(std::begin(tval),
		          std::end(tval),
		          255);
	}
};