Skip to content

feat(items): the second item chain's cases with values come from the data - #829

Open
ezequielzacca wants to merge 304 commits into
sven-n:mainfrom
ezequielzacca:feat/item-tooltip-chain-values
Open

ezequielzacca wants to merge 304 commits into
sven-n:mainfrom
ezequielzacca:feat/item-tooltip-chain-values

Conversation

@ezequielzacca

@ezequielzacca ezequielzacca commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

This step's own changes: compare with #828. The diff of this PR also holds every earlier step of #815, since a PR from a fork can only target this repository's branches.

Summary

Step 5c-1 of #815 (data-driven item tooltips; design). Stacked on #828 (→ #827 → … → #813): only the last three commits are this step.

#820 (5a) left 34 cases of the second item chain as code, because they need values, logic or texts the data couldn't express yet. With what 5b added, 30 of them become the items' descriptions, and so does the Weapon of Archangel's separate case.

The commits

  1. feat(items): the second item chain's cases with values come from the data. The 30 cases, plus what they need.
  2. fix(items): the Command Fruits' class line follows the hero's class. One deliberate color change.
  3. feat(items): the Weapon of Archangel's tooltip comes from the data. Including its skill's mana.

What moved

The new lines go at the start of each item's description, where the chain wrote them:

  • the 2nd and 3rd class quest items;
  • the Devil Square, Blood Castle and Kalima tickets;
  • the Doppelganger and Varka tickets, with their map's name written into each language's text;
  • the elite potions, buff scrolls, elixirs and seals;
  • the cherry blossom items, the cash shop cards and the gamble items;
  • the Wizard's Ring by level, the wing-mix charms and the Secromicon items;
  • the Chaos Castle and paid channel tickets, and the Heart;
  • the Weapon of Archangel, as a preview of the reward weapon by + level.

Texts that several items share are shared texts of Tooltip.json (24 new).

Stays code (4 cases), because the lines need the game:

  • the reset fruits' "reset points", which are durability × 10;
  • the Talisman of Resurrection's saved revive place;
  • the socket seeds and spheres, which the socket system writes;
  • the Sign of Dimensions' "you need 5 − durability more".

New in the data

  • Add option values: {addOptionValue1}, {addOptionValue2} and {addOptionDuration} (a text, "1 Hour"). They're the item's add option from the game's ItemAddOption data, read as the code read it, for the potions', scrolls', seals' and charms' effects.
  • skillMana:<skill> as a line's value, the mana a skill costs, by its number as "skill" writes it:
    {"text": {"en": "Cyclone Cutting skill (Mana:{mana})", …}, "values": {"mana": "skillMana:22"}, "color": "blue", "levels": [1, 1]}
  • class:<class> conditions, true when the hero is of that class (written as in classRequirements).
  • colors and bold on description lines, as layout lines have.

Tooltips that changed, on purpose

  • Long lines wrap at the tooltip's width, as description lines have since feat(items): item descriptions in the item data #813. In game that's 18 items:
    • the tickets' "You will be assigned to a stage according to your level.";
    • the buff scrolls' "You may continue to use the strengthener power.";
    • the seals' and Secromicon papers' long lines;
    • the Weapon of Archangel's acquisition lines.
  • Empty lines are gone. The four cash shop cards (Summoner Character Card, Chaos Card Gold/Rare/Mini) and the three cherry blossom branches printed a text no .resx has: legacy ids 2551–2556 and 2535–2537. That gave an empty line, where the tooltip stops drawing (RenderTipTextList(), and the modern theme too). Only blank lines came after it, so the visible tooltips are the same; the recorded lines lose the empty one. (Corrected after feat(items): the item chain after the options comes from the data #830.)
  • The Master Seal of Ascension is back to its original tooltip. Its number (13/93) falls in the wing-mix charms' type range. Its own case used to come first in the chain; when refactor(items): the second item chain's tooltip texts come from the data #820 moved that case into the data, the seal started to fall through to the charm case. It has shown the charm's "Increases your luck to create wing of your wish." since then, which this fixes.
  • Command Fruits +4 (commit 2): "Can be equipped by Dark Lord" was white for every hero. Every other class line, the ones the game writes and the reset fruit's, is white for a hero of that class and dark red for the others. This one is too now.
  • The Weapon of Archangel above +2, which the item never has, no longer shows speed and requirement lines with 0. Its old code printed uninitialized locals there. They were 0 in the recorded runs, but the stack contents shift with things like the environment's size, so the recorded tooltip test could fail by chance.

The snapshot

"Every item's tooltip is as recorded" now records blank lines without color or style. A blank line shows none, and what its slot keeps of an earlier tooltip made unrelated tooltips' hashes change. It's re-recorded for the changes above.

Every other tooltip matches the old code for both heroes, in the test and in the game's tooltip-snapshot. The comparison counts a line that now wraps as the same line when its pieces join back to the old one.

.resx

75 texts that only these cases printed are gone from every language, among them the numbered potion, scroll, elixir and charm texts (2500–2516, 2732–2742). The ones still reachable through a computed Lookup() stay:

  • "Quest Item" (730) and the Archangel reward text (815), both in the server message ranges;
  • "Strength Requirement" (73) and "Agility Requirement" (75), which the skill tooltip reads by number.

Screenshots

Before (#828) and after this PR, for a level 400 Dark Knight. The other changed tooltips are listed above; the server has none of the cards, cherry branches, seals or scrolls, so they're not shown.

Weapon of Archangel +1

The reward sword's preview, by item level. The Cyclone Cutting mana (9) comes from the skill data through "values": {"mana": "skillMana:22"}. The two long "acquisition rate" lines now wrap.

Legacy theme Modern theme
Before
After
The item's data (English only)
{
  "number": 19,
  "name": "Absolute Weapon of Archangel",
  "tags": [
    "valuable",
    "noDurabilityLine"
  ],
  "description": [
    {
      "text": "@questItem"
    },
    {
      "text": "Reward received when returned to the Archangel",
      "color": "darkRed"
    },
    {
      "text": ""
    },
    {
      "text": "Wizardry Damage: 107 ~ 110",
      "levels": [
        0,
        0
      ]
    },
    {
      "text": "One-Handed Damage: 110 ~ 120",
      "levels": [
        1,
        1
      ]
    },
    {
      "text": "Two-Handed Damage: 120 ~ 140",
      "levels": [
        2,
        2
      ]
    },
    {
      "text": "Attack speed: 20",
      "levels": [
        0,
        0
      ]
    },
    {
      "text": "Attack speed: 35",
      "levels": [
        1,
        1
      ]
    },
    {
      "text": "Attack speed: 35",
      "levels": [
        2,
        2
      ]
    },
    {
      "text": "Strength Requirement: 132",
      "levels": [
        0,
        0
      ]
    },
    {
      "text": "Strength Requirement: 381",
      "levels": [
        1,
        1
      ]
    },
    {
      "text": "Strength Requirement: 140",
      "levels": [
        2,
        2
      ]
    },
    {
      "text": "Agility Requirement: 32",
      "levels": [
        0,
        0
      ]
    },
    {
      "text": "Agility Requirement: 149",
      "levels": [
        1,
        1
      ]
    },
    {
      "text": "Agility Requirement: 350",
      "levels": [
        2,
        2
      ]
    },
    {
      "text": ""
    },
    {
      "text": "Luck (success rate of Jewel of Soul +25%)",
      "color": "blue"
    },
    {
      "text": "Luck (critical damage rate +5%)",
      "color": "blue"
    },
    {
      "text": "Wizardry Dmg 53% rise",
      "color": "blue",
      "bold": true,
      "levels": [
        0,
        0
      ]
    },
    {
      "text": "Increase Wizardry Dmg +level/20",
      "color": "blue",
      "levels": [
        0,
        0
      ]
    },
    {
      "text": "Increase Wizardry Dmg +2%",
      "color": "blue",
      "levels": [
        0,
        0
      ]
    },
    {
      "text": "Cyclone Cutting skill (Mana:{mana})",
      "values": {
        "mana": "skillMana:22"
      },
      "color": "blue",
      "levels": [
        1,
        1
      ]
    },
    {
      "text": "Increase Damage +level/20",
      "color": "blue",
      "levels": [
        1,
        1
      ]
    },
    {
      "text": "Increase Damage +2%",
      "color": "blue",
      "levels": [
        1,
        1
      ]
    },
    {
      "text": "Triple Shot skill (Mana:{mana})",
      "values": {
        "mana": "skillMana:24"
      },
      "color": "blue",
      "levels": [
        2,
        2
      ]
    },
    {
      "text": "Increase Damage +level/20",
      "color": "blue",
      "levels": [
        2,
        2
      ]
    },
    {
      "text": "Increase Damage +2%",
      "color": "blue",
      "levels": [
        2,
        2
      ]
    },
    {
      "text": "Excellent Damage rate +10%",
      "color": "blue"
    },
    {
      "text": "Increase Attacking(Wizardry)speed +7",
      "color": "blue"
    },
    {
      "text": "Increases acquisition rate of Life after hunting monsters +life/8",
      "color": "blue"
    },
    {
      "text": "Increases acquisition rate of Mana after hunting monsters +Mana/8",
      "color": "blue"
    }
  ]
}

Its shared texts in Tooltip.json (English):

"questItem": "Quest Item"

Scroll of Emperor

The quest item lines, from the shared texts @questItem, @cannotStoreInVault and @cannotBeTraded.

Legacy theme Modern theme
Before
After
The item's data (English only)
{
  "number": 23,
  "name": "Scroll of the Emperor",
  "tags": [
    "secondClassQuestItem"
  ],
  "description": [
    {
      "text": "@questItem"
    },
    {
      "text": "@cannotStoreInVault",
      "color": "red"
    },
    {
      "text": "@cannotBeTraded",
      "color": "red"
    }
  ]
}

Its shared texts in Tooltip.json (English):

"cannotBeTraded": "Cannot be traded."
"cannotStoreInVault": "Cannot store in vault."
"questItem": "Quest Item"

Suspicious Scrap of Paper ×3

{durability} / 5, and a long line that now wraps.

Legacy theme Modern theme
Before
After
The item's data (English only)
{
  "number": 101,
  "name": "Suspicious Scrap of Paper",
  "description": [
    {
      "text": "{durability} / 5"
    },
    {
      "text": "It's a worn piece of paper containing incomprehensible text."
    }
  ]
}

Command Fruits +4

The one deliberate color change: for this Dark Knight, "Can be equipped by Dark Lord" is dark red now, as every class line is for a hero who can't use the item. A Dark Lord sees it white.

Legacy theme Modern theme
Before
After
The item's data (English only, the class line only)
{
  "number": 15,
  "name": "Fruits",
  "tags": [
    "valuable"
  ],
  "description": [
    {
      "text": "Can be equipped by Dark Lord",
      "color": "darkRed",
      "colors": [
        {
          "when": [
            "class:darkLord"
          ],
          "color": "white"
        }
      ],
      "levels": [
        4,
        4
      ]
    }
  ],
  "levelValues": {
    "stat": [
      "ENG",
      "STA",
      "AGI",
      "STR",
      "Command"
    ]
  }
}

Related issues

Step 5c-1 of #815. Builds on #828, #827, #825, #824, #823, #822, #821, #820, #819, #818, #817, #816 and #813.

Checklist

  • I have read and followed docs/CODING_RULES.md.
  • I have built the project locally (see docs/build/README.md).
    • Windows x64 Release: all 1011 tests pass, also as one run of the whole data test executable.
    • The new tests cover the add option values, the class condition, skillMana and the Archangel's mana.
    • Changed lines pass clang-format 21.1.8 as CI checks them.
    • In game: tooltip-snapshot of two heroes before and after, and the screenshots above in both themes.
  • Changes are focused on one concern; the diff is as small as it reasonably can be.

…m-tooltip-shared-texts

# Conflicts:
#	docs/item-data.md
#	src/source/Data/DataHandler/ItemData/ItemDataHandler.cpp
#	src/source/Data/GameData/ItemData/ItemDefinition.h
#	src/source/Engine/Object/ZzzInventory.cpp
…n texts

As the review of sven-n#813 asked for description texts: an item's level values with their translations get the checks
names get (the English text is required, a language code has only letters, digits and "-", and a language the game
has no texts in is a warning). One helper checks a description line's and a level value's text.
…em-tooltip-chain-values

# Conflicts:
#	docs/item-data.md
#	src/source/Engine/Object/ZzzInventory.cpp
…at/item-tooltip-values-to-data

# Conflicts:
#	docs/item-data.md
…/item-description-levels

# Conflicts:
#	docs/item-data.md
#	src/source/Engine/Object/ZzzInventory.cpp
…ooltip-values

# Conflicts:
#	src/source/Engine/Object/ZzzInventory.cpp
#	tests/data/test_item_descriptions.cpp
@ezequielzacca

Copy link
Copy Markdown
Contributor Author

Thanks. "The Command Fruit's class line and the Wizard's Ring's lines follow the hero and the level" adds both:

  • The Command Fruit +4: "Can be equipped by Dark Lord" is white for a Dark Lord and a Lord Emperor, and dark red for a Dark Wizard. Neither snapshot hero is a Dark Lord, so the snapshot never showed the white case.
  • The Wizard's Ring at +0 to +3: +0 and +3 show "Cannot Repair" and their durability. +1 and +2, the event rings, show instead when they can be dropped, and that they can't be stored, traded or sold.

The level texts of the Fruits and other level items were already pinned by "The tooltip texts by item level come from the descriptions as from the old code".

…or every language and the levels

Three Polish Fruits texts were from before main corrected them (17fc723): Dowodzenie, "Można użyć po zdjęciu
ekwipunku." and "Może być używany przez: Dark Lord". A test now compares the level lines whose texts other code still
prints with the game's texts in every language, another that a line is only written at its levels. The levels note
says the level variants' lines move into their items later.
…m-tooltip-chain-texts

# Conflicts:
#	tests/data/test_item_database_files.cpp
…ooltip-durability

# Conflicts:
#	docs/item-data.md
…m-tooltip-shared-texts

# Conflicts:
#	src/bin/Data/Items/Group13_Helper.json
…tat words aren't the game's texts

The "i" of "%% increase" leaked into seven translations of "Damage +20% increase effect" ("iefecto", "infeito",
"inувеличение", ...). The level lines' test no longer compares the Fruits' stat words with the game's texts, which
keep the words this step corrects.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants