New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
createItemType Via Lua #3354
createItemType Via Lua #3354
Conversation
@@ -312,6 +322,8 @@ class ItemType | |||
std::unique_ptr<Abilities> abilities; | |||
std::unique_ptr<ConditionDamage> conditionDamage; | |||
|
|||
std::map<std::string, bool> hasEdited; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I will use a unordered_map
, I am hoping to find more things to improve the code
Co-authored-by: Evil Puncker <EPuncker@users.noreply.github.com>
If you're constraining this to just |
For now we can't really get around having it extra like we did with monsters because of the loading order (might throw errors and such if we load items from lua later than we do at xml), at current state as we approach further into lua handling stuff this is already a good enhancement and if we every going to rely on lua only we can start re arranging loading order and such so we have everything in one place. Resolve the conflicts and then we should finaly merge it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tons of formatting issues in luascript.cpp
which need to be resolved but other then that it looks fine.
} else if (abilitieName == "absorbpercentall") { | ||
int16_t value = getNumber<int16_t>(L, 3); | ||
for (uint8_t i = COMBAT_NONE; i <= COMBAT_COUNT; i++) { | ||
abilities.absorbPercent[i] += value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
abilities.absorbPercent[i] += value; | |
abilities.absorbPercent[indexToCombatType(i)] += value; |
} else if (abilitieName == "fieldabsorbpercentall") { | ||
int16_t value = getNumber<int16_t>(L, 3); | ||
for (uint8_t i = COMBAT_NONE; i <= COMBAT_COUNT; i++) { | ||
abilities.fieldAbsorbPercent[i] += value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
abilities.fieldAbsorbPercent[i] += value; | |
abilities.fieldAbsorbPercent[indexToCombatType(i)] += value; |
Pull Request Prelude
Changes Proposed
Issues addressed: Inspired by this PR #3010
Some peculiarities:
/reload scripts
instead use/reload items
as commonly done with xmlNote:
items.lua
file is by convention, but you can create all the luas files you want in thedata/items
folder so that you can sort sets of items by file as you wish.How it looks: