Skip to content

Commit

Permalink
Merge pull request #24 from damian-pastorini/develop
Browse files Browse the repository at this point in the history
- Reldens - Items System
  • Loading branch information
damian-pastorini authored Aug 4, 2020
2 parents be3c2f7 + 3693a29 commit b1dcc24
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module.exports = {
INC_P: 5,
DEC_P: 6,
SET: 7,
SET_N: 9,
METHOD: 8
},
PROP_GET: 'g',
Expand Down
2 changes: 1 addition & 1 deletion lib/item/type/item-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class ItemBase
ownerProperty = ownerProperty - Math.round(ownerProperty * modifier.value / 100);
}
}
if(modifier.operation === ItemsConst.OPS.SET){
if(modifier.operation === ItemsConst.OPS.SET || modifier.operation === ItemsConst.OPS.SET_N){
if(revert){
ownerProperty = false;
} else {
Expand Down
3 changes: 3 additions & 0 deletions lib/server/storage-observer.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ class StorageObserver
if(item.items_item.items_modifiers){
let modifiers = {};
for(let modifierData of item.items_item.items_modifiers){
if(modifierData.operation !== ItemsConst.OPS.SET){
modifierData.value = Number(modifierData.value);
}
modifiers[modifierData.id] = new Modifier(modifierData);
}
itemObj.modifiers = modifiers;
Expand Down
4 changes: 4 additions & 0 deletions migrations/production/reldens-items-update-v0.5.7.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

# Fixed modifiers table:

ALTER TABLE `items_item_modifiers` CHANGE COLUMN `operation` `operation` INT(11) NOT NULL COLLATE 'utf8_unicode_ci' AFTER `property_key`;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@reldens/items-system",
"scope": "@reldens",
"version": "0.5.6",
"version": "0.5.7",
"description": "Reldens - Items System",
"author": "Damian A. Pastorini",
"license": "MIT",
Expand Down

0 comments on commit b1dcc24

Please sign in to comment.