-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathDefenseSection.lua
More file actions
executable file
·208 lines (206 loc) · 10.3 KB
/
DefenseSection.lua
File metadata and controls
executable file
·208 lines (206 loc) · 10.3 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
---@class Config
local Config = ECSLoader:ImportModule("Config")
local _Config = Config.private
---@type Stats
local Stats = ECSLoader:ImportModule("Stats")
---@type i18n
local i18n = ECSLoader:ImportModule("i18n")
---@type DataUtils
local DataUtils = ECSLoader:ImportModule("DataUtils")
function _Config:LoadDefenseSection()
return {
type = "group",
order = 4,
inline = false,
width = 2,
name = function() return STAT_CATEGORY_DEFENSE end,
args = {
showDefenseStats = {
type = "toggle",
order = 0,
name = function() return i18n("Show Defense Stats") end,
desc = function() return i18n("Shows/Hides all defense stats.") end,
width = 1.5,
get = function () return ExtendedCharacterStats.profile.defense.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.defense.display = value
Stats.RebuildStatInfos()
end,
},
armor = {
type = "toggle",
order = 1,
name = function() return STAT_ARMOR end,
desc = function() return i18n("Shows/Hides the armor value.") end,
width = 1.5,
disabled = function() return (not ExtendedCharacterStats.profile.defense.display); end,
get = function () return ExtendedCharacterStats.profile.defense.armor.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.defense.armor.display = value
Stats.RebuildStatInfos()
end,
},
meleeCritReduction = {
type = "toggle",
order = 1.81,
name = function() return i18n("Melee Crit Reduction") end,
desc = function() return i18n("Shows/Hides the reduction percentage of being critically hit by melee attacks.") end,
width = 1.5,
disabled = function() return (not ExtendedCharacterStats.profile.defense.display); end,
get = function () return ExtendedCharacterStats.profile.defense.meleeCritReduction.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.defense.meleeCritReduction.display = value
Stats.RebuildStatInfos()
end,
},
rangedCritReduction = {
type = "toggle",
order = 1.82,
name = function() return i18n("Ranged Crit Reduction") end,
desc = function() return i18n("Shows/Hides the reduction percentage of being critically hit by ranged attacks.") end,
width = 1.5,
disabled = function() return (not ExtendedCharacterStats.profile.defense.display); end,
get = function () return ExtendedCharacterStats.profile.defense.rangedCritReduction.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.defense.rangedCritReduction.display = value
Stats.RebuildStatInfos()
end,
},
spellCritReduction = {
type = "toggle",
order = 1.83,
name = function() return i18n("Spell Crit Reduction") end,
desc = function() return i18n("Shows/Hides the reduction percentage of being critically hit by spells.") end,
width = 1.5,
disabled = function() return (not ExtendedCharacterStats.profile.defense.display); end,
get = function () return ExtendedCharacterStats.profile.defense.spellCritReduction.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.defense.spellCritReduction.display = value
Stats.RebuildStatInfos()
end,
},
avoidance = {
type = "toggle",
order = 1.85,
name = function() return STAT_AVOIDANCE end,
desc = function() return i18n("Shows/Hides the total avoidance.") end,
width = 1.5,
disabled = function() return (not ExtendedCharacterStats.profile.defense.display); end,
get = function () return ExtendedCharacterStats.profile.defense.avoidance.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.defense.avoidance.display = value
Stats.RebuildStatInfos()
end,
},
avoidanceBoss = {
type = "toggle",
order = 1.86,
name = function() return i18n("Avoidance (Lvl +3)") end,
desc = function() return i18n("Shows/Hides the total avoidance (Lvl +3).") end,
width = 1.5,
disabled = function() return (not ExtendedCharacterStats.profile.defense.display); end,
get = function () return ExtendedCharacterStats.profile.defense.avoidanceBoss.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.defense.avoidanceBoss.display = value
Stats.RebuildStatInfos()
end,
},
defenseRating = {
type = "toggle",
order = 1.9,
name = function() return ITEM_MOD_DEFENSE_SKILL_RATING_SHORT end,
desc = function() return i18n("Shows/Hides the defense rating.") end,
width = 1.5,
hidden = function() return ECS.IsClassic end,
disabled = function() return (not ExtendedCharacterStats.profile.defense.display); end,
get = function () return ExtendedCharacterStats.profile.defense.defenseRating.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.defense.defenseRating.display = value
Stats.RebuildStatInfos()
end,
},
defense = {
type = "toggle",
order = 2,
name = function() return DEFENSE end,
desc = function() return i18n("Shows/Hides the defense value.") end,
width = 1.5,
disabled = function() return (not ExtendedCharacterStats.profile.defense.display); end,
get = function () return ExtendedCharacterStats.profile.defense.defense.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.defense.defense.display = value
Stats.RebuildStatInfos()
end,
},
blockChance = {
type = "toggle",
order = 3,
name = function() return BLOCK_CHANCE end,
desc = function() return i18n("Shows/Hides the block chance.") end,
width = 1.5,
hidden = function() return not IsSpellKnown(107) end,
disabled = function() return (not ExtendedCharacterStats.profile.defense.display); end,
get = function () return ExtendedCharacterStats.profile.defense.blockChance.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.defense.blockChance.display = value
Stats.RebuildStatInfos()
end,
},
blockValue = {
type = "toggle",
order = 4,
name = function() return ITEM_MOD_BLOCK_VALUE_SHORT end,
desc = function() return i18n("Shows/Hides the block value.") end,
width = 1.5,
hidden = function() return not DataUtils:CanBlock() end,
disabled = function() return (not ExtendedCharacterStats.profile.defense.display); end,
get = function () return ExtendedCharacterStats.profile.defense.blockValue.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.defense.blockValue.display = value
Stats.RebuildStatInfos()
end,
},
parry = {
type = "toggle",
order = 5,
name = function() return PARRY_CHANCE end,
desc = function() return i18n("Shows/Hides the parry chance.") end,
width = 1.5,
hidden = function() return not DataUtils:CanParry() end,
disabled = function() return (not ExtendedCharacterStats.profile.defense.display); end,
get = function () return ExtendedCharacterStats.profile.defense.parry.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.defense.parry.display = value
Stats.RebuildStatInfos()
end,
},
dodge = {
type = "toggle",
order = 6,
name = function() return DODGE_CHANCE end,
desc = function() return i18n("Shows/Hides the dodge chance.") end,
width = 1.5,
disabled = function() return (not ExtendedCharacterStats.profile.defense.display); end,
get = function () return ExtendedCharacterStats.profile.defense.dodge.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.defense.dodge.display = value
Stats.RebuildStatInfos()
end,
},
resilience = {
type = "toggle",
order = 7,
name = function() return RESILIENCE end,
desc = function() return i18n("Shows/Hides the resilience value.") end,
width = 1.5,
hidden = function() return ECS.IsClassic end,
disabled = function() return (not ExtendedCharacterStats.profile.defense.display); end,
get = function () return ExtendedCharacterStats.profile.defense.resilience.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.defense.resilience.display = value
Stats.RebuildStatInfos()
end,
},
},
}
end