Skip to content

Commit

Permalink
feat: new ench texts
Browse files Browse the repository at this point in the history
  • Loading branch information
leaftail1880 committed Aug 25, 2024
1 parent 13a726c commit 305b767
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 40 deletions.
78 changes: 39 additions & 39 deletions src/lib/assets/lang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31866,27 +31866,27 @@ export const langs: Langs = {
"tile.smooth_basalt.name": "Basalto Liso"
},
"ru_RU": {
"enchantment.arrowDamage": "Мощь",
"enchantment.arrowFire": "Воспламенение",
"enchantment.arrowInfinite": "Бесконечность",
"enchantment.arrowKnockback": "Удар",
"enchantment.crossbowMultishot": "Залп",
"enchantment.crossbowPiercing": "Бронебойность",
"enchantment.crossbowQuickCharge": "Быстрая перезарядка",
"enchantment.arrowDamage": "§fСила",
"enchantment.arrowFire": "§7Воспламенение",
"enchantment.arrowInfinite": "§7Бесконечность",
"enchantment.arrowKnockback": "§7Откидывание",
"enchantment.crossbowMultishot": "§7Тройной выстрел",
"enchantment.crossbowPiercing": "§fПронзающая стрела",
"enchantment.crossbowQuickCharge": "§7Быстрая перезарядка",
"enchantment.curse.binding": "Проклятие связи",
"enchantment.curse.vanishing": "Проклятие утраты",
"enchantment.damage.all": "Острота",
"enchantment.damage.arthropods": "Бич членистоногих",
"enchantment.damage.undead": "Небесная кара",
"enchantment.digging": "Эффективность",
"enchantment.durability": "Неразрушимость",
"enchantment.fire": "Облик огня",
"enchantment.fishingSpeed": "Приманка",
"enchantment.frostwalker": "Морозная поступь",
"enchantment.heavy_weapon.breach": "Пробитие",
"enchantment.heavy_weapon.density": "Плотность",
"enchantment.heavy_weapon.windburst": "Порыв ветра",
"enchantment.knockback": "Отбрасывание",
"enchantment.damage.all": "§fОстрота",
"enchantment.damage.arthropods": "§7Бич членистоногих",
"enchantment.damage.undead": "§7Небесная кара",
"enchantment.digging": "§fЭффективность",
"enchantment.durability": "§7Неразрушимость",
"enchantment.fire": "§7Заговор огня",
"enchantment.fishingSpeed": "§7Приманка",
"enchantment.frostwalker": "§7Ледоход",
"enchantment.heavy_weapon.breach": "§fПробитие",
"enchantment.heavy_weapon.density": "§7Плотность",
"enchantment.heavy_weapon.windburst": "§7Порыв ветра",
"enchantment.knockback": "§7Отдача",
"enchantment.level.1": "§c▌§7▌▌▌▌ §f1",
"enchantment.level.10": "§a▌▌▌▌▌▌▌▌▌▌▌▌▌▌ §f10",
"enchantment.level.2": "§g▌▌§7▌▌▌ §f2",
Expand All @@ -31897,26 +31897,26 @@ export const langs: Langs = {
"enchantment.level.7": "§5▌▌▌▌▌▌▌▌▌§7▌▌▌ §f7",
"enchantment.level.8": "§9▌▌▌▌▌▌▌▌▌▌§7▌▌ §f8",
"enchantment.level.9": "§6▌▌▌▌▌▌▌▌▌▌▌§7▌ §f9",
"enchantment.lootBonus": "Добыча",
"enchantment.lootBonusDigger": "Удача",
"enchantment.lootBonusFishing": "Морская удача",
"enchantment.mending": "Починка",
"enchantment.oxygen": "Дыхание",
"enchantment.protect.all": "Защита",
"enchantment.protect.explosion": "Взрывоустойчивость",
"enchantment.protect.fall": "Легкость",
"enchantment.protect.fire": "Огнеупорность",
"enchantment.protect.projectile": "Защита от снарядов",
"enchantment.soul_speed": "Скорость души",
"enchantment.swift_sneak": "Быстрое подкрадывание",
"enchantment.thorns": "Шипы",
"enchantment.untouching": "Шелковое касание",
"enchantment.waterWalker": "Странник глубин",
"enchantment.waterWorker": "Родство с водой",
"enchantment.tridentChanneling": "Проводник",
"enchantment.tridentLoyalty": "Верность",
"enchantment.tridentRiptide": "Тягун",
"enchantment.tridentImpaling": "Пронзание",
"enchantment.lootBonus": "§7Добыча",
"enchantment.lootBonusDigger": "§7Удача",
"enchantment.lootBonusFishing": "§7Везучий рыбак",
"enchantment.mending": "§7Починка",
"enchantment.oxygen": "§7Подводное дыхание",
"enchantment.protect.all": "§fЗащита",
"enchantment.protect.explosion": "§7Взрывоустойчивость",
"enchantment.protect.fall": "§7Невесомость",
"enchantment.protect.fire": "§7Огнеупорность",
"enchantment.protect.projectile": "§7Защита от снарядов",
"enchantment.soul_speed": "§7Скорость души",
"enchantment.swift_sneak": "§7Быстрое подкрадывание",
"enchantment.thorns": "§7Шипы",
"enchantment.untouching": "§7Шелковое касание",
"enchantment.waterWalker": "§7Подводная ходьба",
"enchantment.waterWorker": "§7Подводник",
"enchantment.tridentChanneling": "§7Громовержец",
"enchantment.tridentLoyalty": "§7Верность",
"enchantment.tridentRiptide": "§7Тягун",
"enchantment.tridentImpaling": "§7Пронзание",
"entity.area_effect_cloud.name": "Облако области эффекта",
"entity.armadillo.name": "«Армадильо»",
"entity.armor_stand.name": "Стойка для доспехов",
Expand Down
42 changes: 41 additions & 1 deletion src/modules/places/village-of-explorers/mage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class Mage extends ShopNpc {
lockBlockPriorToNpc(MinecraftBlockTypes.Anvil, this.place.name)

this.shop.body(() => 'Чего пожелаешь?')
this.shop.menu(form => {
this.shop.menu((form, player) => {
form.itemModifierSection(
'Улучшить меч',
item => ['sword'].some(e => item.typeId.endsWith(e)),
Expand Down Expand Up @@ -58,6 +58,20 @@ export class Mage extends ShopNpc {
},
)

form.itemModifierSection(
'Улучшить инструмент',
item => ['shovel', 'pickaxe', 'axe', 'hoe'].some(e => item.typeId.endsWith(e)),
'любые топор, кирка, мотыга или лопата',
(form, slot, item) => {
const ench = this.createEnch(form, item, slot)
const enchs = item.enchantable?.getEnchantments().reduce((p, c) => p + c.level, 1) ?? 1

ench(e.Efficiency, level => new MultiCost().money(level * 20).xp(level * enchs))
ench(e.Unbreaking, level => new MultiCost().money(level * 20).xp(level * enchs))
ench(e.SilkTouch, _ => new MultiCost().money(20000).xp(100))
},
)

form.itemModifierSection(
'Использовать книгу чар',
item => item.typeId === MinecraftItemTypes.EnchantedBook,
Expand Down Expand Up @@ -138,6 +152,32 @@ export class Mage extends ShopNpc {
.itemStack(new ItemStack(i.TotemOfUndying), new MultiCost().money(6_000).item(i.Emerald, 1))
.itemStack(new ItemStack(i.EnchantedGoldenApple), new MultiCost().item(i.GoldenApple).money(10_000)),
)

form.itemModifier(
'Отсортировать чарки',
FreeCost,
item => !!item.enchantable,
'любой зачарованный предмет',
(slot, item) => {
if (!item.enchantable) return
const prior = [
MinecraftEnchantmentTypes.Sharpness,
MinecraftEnchantmentTypes.Efficiency,
MinecraftEnchantmentTypes.Power,
MinecraftEnchantmentTypes.Protection,
]
for (const p of prior) {
const ench = item.enchantable.getEnchantment(p)
if (!ench) continue
if (ench.level > ench.type.maxLevel) return player.fail('С чарками такого уровня не работаю, слетят')

item.enchantable.removeEnchantment(ench.type)
item.enchantable.addEnchantment(ench)
}

slot.setItem(item)
},
)
})
}

Expand Down

0 comments on commit 305b767

Please sign in to comment.