reldens
Version:
Reldens - MMORPG Platform
66 lines (58 loc) • 1.87 kB
JavaScript
/**
*
* Reldens - ModifiersEntity
*
*/
const { EntityProperties } = require('../../../game/server/entity-properties');
class ItemModifiersEntity extends EntityProperties
{
static propertiesConfig(extraProps)
{
let titleProperty = 'key';
let properties = {
id: {},
item_id: {
type: 'reference',
reference: 'items_item',
isRequired: true
},
[titleProperty]: {
isRequired: true
},
property_key: {
isRequired: true
},
operation: {
availableValues: [
{value: 1, label: 'Increment'},
{value: 2, label: 'Decrease'},
{value: 3, label: 'Divide'},
{value: 4, label: 'Multiply'},
{value: 5, label: 'Increment Percentage'},
{value: 6, label: 'Decrease Percentage'},
{value: 7, label: 'Set'},
{value: 8, label: 'Method'},
{value: 9, label: 'Set Number'}
],
isRequired: true
},
value: {
isRequired: true
},
maxProperty: {}
};
let showProperties = Object.keys(properties);
let editProperties = [...showProperties];
editProperties.splice(editProperties.indexOf('id'), 1);
return {
showProperties,
editProperties,
listProperties: showProperties,
filterProperties: showProperties,
properties,
titleProperty,
...extraProps
};
}
}
module.exports.ItemModifiersEntity = ItemModifiersEntity;