Repository navigation
Issue.3638 magic items migration - #4247
Merged
Merged
Conversation
im.cpp: a recipe prototype's spell level is now an explicit 0 (magic items have no level any more; the term's weight is the recipe's k0), and wand/staff charges come from kMaxCharges instead of the zeroed val[1]. item_creation.cpp: a crafted potion records the maker's skill and Int like a wand or staff, and all three use the recipe's own skill instead of a hard-coded kMakeStaff. The dead val[0] tweak is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… edits (#3638) A potion made by do_create now matches one brewed by an im-recipe: the brew luck is drawn once and stored in kPotionBrewRoll, so every quaff is the same, and the item is marked kTransformed (wands and staffs too), so an olc edit of the prototype does not overwrite the maker's skill and Int. The draw moved to RollPotionBrewLuck() in magic_utils, shared with im.cpp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Magic items: finish the val[] migration in brewing and crafting (#3638)
Доделывает два места из issue #3638, где после переноса магпредметов на extra_values код еще читал обнуленный сырой
val[]. Два коммита в веткеissue.3638-magic-items-migration.1. Варка по im-рецепту (
im.cpp)kMaxCharges, а не из обнуленногоval[1].Поправка к issue: вероятность варки (
prob) от этих чисел не зависит, она считается до того, как к энергии добавляются параметры прототипа. Обнуленный уровень менял только результат: таймер, заряды и уже мертвыйval[0].Баланс таймера. Все 60 рецептов делают зелья (и один свиток), так что из этой формулы живой выход у них один: таймер. Раньше уровень прототипа забирал на себя большую часть энергии, и превышение качества ингредиентов растягивало таймер умеренно. Без уровня вся энергия уходит в таймер: в моделировании он выходил до 26 раз длиннее прежнего.
Лечится правкой
recipes.xml, не кода.k0рецепта теперь ни на что не влияет (уровень 0, выходval[0]мертвый), поэтому потерянная энергия переносится вk1: у зелья и свитка «количество» всегда 1 и его выход не используется. Новое значениеk1 = k1 + k0 * уровень прототипа. Моделирование 100 000 случайных варок (качество, добавки, уровни) дает в точности прежние таймеры.OUTPUT/recipes.xml, сделан из боевого). В ветку он не входит.lib/cfg/craft/ingredient_magic/recipes.xmlв репозитории совпадает с боевым и тоже требует этой правки.7.obj,8.obj). Если на бою уровни прототипов 750 и 801-860 другие, у этих рецептов будет расхождение.k1задает заряды.2. Изготовление по рецепту (
item_creation.cpp)kMakerSkill) и его Инт (kMakerStat). Раньше ветка зелья крутила мертвыйval[0]и ничего не записывала, так что сила зелья не зависела от мастера: включались зашитые 80/25.kMakeStaff, и для жезла с посохом тоже.kPotionBrewRoll, поэтому каждый глоток одинаков;kTransformed(и жезл с посохом тоже), чтобы правка прототипа в olc не затерла умение и Инт мастера.RollPotionBrewLuck()(magic_utils);im.cppвызывает его вместо своей копии.Сейчас этот путь недостижим: команда варки (
MAKE_POTION, «сварить отвар») закомментирована, а вitem_creation.xmlтолько рецепты луков и одежды. Правка нужна на будущее, когда варку включат.Проверка
build/) и неединая (build_nounity/) сборки собираются без предупреждений; проходят 932 и 886 тестов.item_creationнедостижим, а варку по im-рецепту стоит проверить уже с новымrecipes.xml.