feat: Adds block chance as equipment filter

Adds block chance for the equipment filter of shields and bucklers. also fixes a few issues with how bucklers were interpreted internally
This commit is contained in:
kvan7
2025-06-07 09:36:53 -05:00
parent 98f56009eb
commit 5959501a14
17 changed files with 44 additions and 27 deletions

View File

@@ -54,6 +54,7 @@ export enum ItemCategory {
Focus = "Focus",
Spear = "Spear",
Flail = "Flail",
Buckler = "Buckler",
}
export interface StatMatcher {

View File

@@ -123,6 +123,7 @@ const ITEM_CATEGORY = new Map([
["Focus", { name: "Focus", craftable: true }],
["Spear", { name: "Spear", craftable: true }],
["Flail", { name: "Flail", craftable: true }],
["Buckler", { name: "Buckler", craftable: true }],
]);
const ArmourTypes = Tables.ArmourTypes();
function getArmourField(baseRid: number): BaseType["armour"] {

View File

@@ -44,7 +44,7 @@
"armour": "護甲:{0}",
"evasion_rating": "閃避值:{0}",
"energy_shield": "能量護盾:{0}",
"block": "格擋率:{0}%",
"block": "格擋率:{0}%",
"total_dps": "總 DPS{0}",
"physical_dps": "物理 DPS{0}",
"elemental_dps": "元素 DPS{0}",
@@ -140,8 +140,9 @@
"tincture": "萃取物",
"azmeri_charm": "阿茲麥麗符咒",
"weapon_crossbow": "十字弓",
"weapon_spear": "Spear",
"weapon_flail": "Flail"
"weapon_spear": "長鋒",
"weapon_flail": "鏈錘",
"armour_buckler": "輕盾"
},
"filters": {
"selected_some": "已選擇:{0}/{1},屬性",

View File

@@ -26,7 +26,7 @@ export default {
ARMOUR: '護甲: ',
EVASION: '閃避值: ',
ENERGY_SHIELD: '能量護盾: ',
BLOCK_CHANCE: '格擋率: ',
BLOCK_CHANCE: '格擋率: ',
CORRUPTED: '已汙染',
UNIDENTIFIED: '未鑑定',
ITEM_SUPERIOR: /^精良的 (.*)$/,

View File

@@ -44,7 +44,7 @@
"armour": "Rüstung: {0}",
"evasion_rating": "Ausweichwertung: {0}",
"energy_shield": "Energieschild: {0}",
"block": "Blocken: {0}%",
"block": "Blockchance: {0}%",
"total_dps": "Gesamter DPS: {0}",
"physical_dps": "Physischer DPS: {0}",
"elemental_dps": "Elementarer DPS: {0}",
@@ -141,8 +141,9 @@
"azmeri_charm": "Azmeri-Talisman",
"weapon_crossbow": "Armbrust",
"armour_focus": "Fokus",
"weapon_spear": "Spear",
"weapon_flail": "Flail"
"weapon_spear": "Speer",
"weapon_flail": "Flegel",
"armour_buckler": "Faustschild"
},
"filters": {
"selected_some": "{0} von {1}, Werte",

View File

@@ -44,7 +44,7 @@
"armour": "Armour: {0}",
"evasion_rating": "Evasion Rating: {0}",
"energy_shield": "Energy Shield: {0}",
"block": "Block: {0}%",
"block": "Block Chance: {0}%",
"total_dps": "Total DPS: {0}",
"physical_dps": "Physical DPS: {0}",
"elemental_dps": "Elemental DPS: {0}",
@@ -142,7 +142,8 @@
"weapon_crossbow": "Crossbow",
"armour_focus": "Focus",
"weapon_spear": "Spear",
"weapon_flail": "Flail"
"weapon_flail": "Flail",
"armour_buckler": "Buckler"
},
"filters": {
"selected_some": "{0} of {1}, stats",

View File

@@ -58,7 +58,7 @@ export default {
// ItemDisplayArmourEnergyShield
ENERGY_SHIELD: 'Energy Shield: ',
// ItemDisplayShieldBlockChance
BLOCK_CHANCE: 'Chance to Block: ',
BLOCK_CHANCE: 'Block chance: ',
// ItemPopupCorrupted
CORRUPTED: 'Corrupted',
// ItemPopupUnidentified

View File

@@ -44,7 +44,7 @@
"armour": "Armadura: {0}",
"evasion_rating": "Índice de evasión: {0}",
"energy_shield": "Escudo de energía: {0}",
"block": "Bloqueo: {0}%",
"block": "Probabilidad de bloqueo: {0}%",
"total_dps": "DPS total: {0}",
"physical_dps": "DPS físico: {0}",
"elemental_dps": "DPS elemental: {0}",
@@ -141,8 +141,9 @@
"azmeri_charm": "Talismán Azmeri",
"weapon_crossbow": "Ballesta",
"armour_focus": "Foco",
"weapon_spear": "Spear",
"weapon_flail": "Flail"
"weapon_spear": "Lanza",
"weapon_flail": "Mangual",
"armour_buckler": "Broquel"
},
"filters": {
"selected_some": "{0} de {1}, estadísticas",

View File

@@ -44,7 +44,7 @@
"armour": "アーマー: {0}",
"evasion_rating": "回避力: {0}",
"energy_shield": "エナジーシールド: {0}",
"block": "ブロック: {0}%",
"block": "ブロック: {0}%",
"total_dps": "DPS: {0}",
"physical_dps": "物理DPS: {0}",
"elemental_dps": "元素DPS: {0}",
@@ -140,8 +140,9 @@
"tincture": "チンキ",
"azmeri_charm": "チャーム",
"weapon_crossbow": "クロスボウ",
"weapon_spear": "Spear",
"weapon_flail": "Flail"
"weapon_spear": "",
"weapon_flail": "フレイル",
"armour_buckler": "バックラー"
},
"filters": {
"selected_some": "スタット {1}つの内{0}",

View File

@@ -137,8 +137,9 @@
"tincture": "팅크",
"azmeri_charm": "부적",
"weapon_crossbow": "석궁",
"weapon_spear": "Spear",
"weapon_flail": "Flail"
"weapon_spear": "",
"weapon_flail": "도리깨",
"armour_buckler": "버클러"
},
"filters": {
"selected_some": "{1} 중 {0}개 선택",

View File

@@ -43,7 +43,7 @@
"armour": "Armadura: {0}",
"evasion_rating": "Índice de evasão: {0}",
"energy_shield": "Escudo de energia: {0}",
"block": "Bloqueio: {0}%",
"block": "Chance de Bloqueio: {0}%",
"total_dps": "DPS total: {0}",
"physical_dps": "DPS físico: {0}",
"elemental_dps": "DPS elemental: {0}",
@@ -134,7 +134,10 @@
"tincture": "Tintura",
"azmeri_charm": "Amuleto Azmeri",
"weapon_crossbow": "Besta",
"armour_focus": "Foco"
"armour_focus": "Foco",
"weapon_spear": "Lança",
"weapon_flail": "Mangual",
"armour_buckler": "Broquel"
},
"filters": {
"selected_some": "{0} de {1}, estatísticas",

View File

@@ -60,7 +60,7 @@
"armour": "Броня: {0}",
"evasion_rating": "Уклонение: {0}",
"energy_shield": "Энерг. щит: {0}",
"block": "Блок: {0}%",
"block": "Шанс блока: {0}%",
"total_dps": "Общий ДПС: {0}",
"physical_dps": "Физический ДПС: {0}",
"elemental_dps": "Стихийный ДПС: {0}",
@@ -156,8 +156,9 @@
"tincture": "Микстура",
"azmeri_charm": "Оберег Азмери",
"weapon_crossbow": "Арбалет",
"weapon_spear": "Spear",
"weapon_flail": "Flail"
"weapon_spear": "Копьё",
"weapon_flail": "Кистень",
"armour_buckler": "Баклер"
},
"filters": {
"selected_some": "Св-ва: {0} из {1}",

View File

@@ -26,7 +26,7 @@ export default {
ARMOUR: 'Броня: ',
EVASION: 'Уклонение: ',
ENERGY_SHIELD: 'Энергетический щит: ',
BLOCK_CHANCE: 'Шанс заблокировать удар: ',
BLOCK_CHANCE: 'Шанс блока: ',
CORRUPTED: 'Осквернено',
UNIDENTIFIED: 'Неопознано',
ITEM_SUPERIOR: /^(.*) высокого качества$/,

View File

@@ -1141,7 +1141,8 @@ function parseUnneededText(section: string[], item: ParsedItem) {
item.category !== ItemCategory.Wand &&
item.category !== ItemCategory.Staff &&
item.category !== ItemCategory.Shield &&
item.category !== ItemCategory.Spear
item.category !== ItemCategory.Spear &&
item.category !== ItemCategory.Buckler
)
return "PARSER_SKIPPED";
@@ -1557,6 +1558,7 @@ function getMaxSockets(category: ItemCategory | undefined) {
case ItemCategory.Spear:
case ItemCategory.Flail:
case ItemCategory.Wand:
case ItemCategory.Buckler:
return 1;
default:
return 0;

View File

@@ -58,6 +58,7 @@ export enum ItemCategory {
TowerAugment = "TowerAugment",
Spear = "Spear",
Flail = "Flail",
Buckler = "Buckler",
}
export const WEAPON_ONE_HANDED_MELEE = new Set([
@@ -106,6 +107,7 @@ export const ARMOUR = new Set([
ItemCategory.Helmet,
ItemCategory.Shield,
ItemCategory.Focus,
ItemCategory.Buckler,
]);
export const ACCESSORY = new Set([

View File

@@ -54,7 +54,7 @@ export const ARMOUR_STATS = new Set<string>([
...QUALITY_STATS.ARMOUR.incr,
...QUALITY_STATS.EVASION.incr,
...QUALITY_STATS.ENERGY_SHIELD.incr,
stat("+#% Chance to Block"),
stat("#% increased Block chance"),
]);
function armourProps(ctx: FiltersCreationContext) {
@@ -122,7 +122,7 @@ function armourProps(ctx: FiltersCreationContext) {
if (item.armourBLOCK) {
const block = calcPropBounds(
item.armourBLOCK,
{ flat: ["+#% Chance to Block"], incr: [] },
{ flat: [], incr: ["#% increased Block chance"] },
item,
);

View File

@@ -77,6 +77,7 @@ export const CATEGORY_TO_TRADE_ID = new Map([
[ItemCategory.Focus, "armour.focus"],
[ItemCategory.Spear, "weapon.spear"],
[ItemCategory.Flail, "weapon.flail"],
[ItemCategory.Buckler, "armour.buckler"],
]);
// const TOTAL_MODS_TEXT = {