diff --git a/README.md b/README.md index 326172c1..c235be0e 100644 --- a/README.md +++ b/README.md @@ -660,7 +660,8 @@ Some commands only work for clients not in proxy sessions. The chat commands are * `$item ES APHEX ZALURE TWIN +200` (ES weapon must be prefixed with "ES"; name comes before special) * `$item DF FIELD +10DEF +20EVP +4` (armor with DFP bonus, EVP bonus, and slot count) * `$item RED MERGE +10DFP +20EVP` (shield; same as armor except without slot count) - * `$item Knight/Power++` (unit) + * `$item Knight/Power +9` (unit with specific modifier) + * `$item Knight/Power++` (unit with normal modifier; ++/-- are +4/-4 and +/- are +2/-2) * `$item LIMITER K:1000` (sealed unit with kill count) * `$item Tapas PB:F,G,M&Y 120% 200IQ 5/195/0/0 green` (mag with PBs, synchro, IO, stats, and color) * `$item Trimate x10` (tool with stack size) diff --git a/src/ItemNameIndex.cc b/src/ItemNameIndex.cc index 85de65a4..43205bcd 100644 --- a/src/ItemNameIndex.cc +++ b/src/ItemNameIndex.cc @@ -674,16 +674,26 @@ ItemData ItemNameIndex::parse_item_description_phase(const std::string& descript {"+", 0x0002}, {"++", 0x0004}, }); - ret.data1w[3] = modifiers.at(desc); - bool kill_count_set = false; - for (auto& token : phosg::split(desc, ' ')) { - if (token.starts_with("k:")) { + for (const auto& token : phosg::split(desc, ' ')) { + if (token == "--") { + ret.data1w[3] = 0xFFFC; + } else if (token == "-") { + ret.data1w[3] = 0xFFFE; + } else if (token == "+") { + ret.data1w[3] = 0x0002; + } else if (token == "++") { + ret.data1w[3] = 0x0004; + } else if (token.starts_with('+')) { + ret.data1w[3] = stoul(token.substr(1), nullptr, 0); + } else if (token.starts_with('-')) { + ret.data1w[3] = static_cast(stol(token, nullptr, 0)); + } else if (token.starts_with("k:")) { ret.set_kill_count(stoul(token.substr(2), nullptr, 0)); kill_count_set = true; - break; } } + if (this->item_parameter_table->is_unsealable_item(ret) && !kill_count_set) { ret.set_kill_count(0); }