@reldens/skills 0.44.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +488 -0
- package/README.md +322 -10
- package/lib/server.js +1 -24
- package/lib/skill.js +4 -4
- package/package.json +3 -4
- package/lib/server/data-server-validator.js +0 -29
- package/lib/server/storage/class-path-generator.js +0 -48
- package/lib/server/storage/conditions-generator.js +0 -29
- package/lib/server/storage/levels-generator.js +0 -41
- package/lib/server/storage/models/mikro-orm/class-path-level-labels-model.js +0 -86
- package/lib/server/storage/models/mikro-orm/class-path-level-skills-model.js +0 -98
- package/lib/server/storage/models/mikro-orm/class-path-model.js +0 -105
- package/lib/server/storage/models/mikro-orm/level-model.js +0 -88
- package/lib/server/storage/models/mikro-orm/level-modifiers-model.js +0 -119
- package/lib/server/storage/models/mikro-orm/levels-set-model.js +0 -79
- package/lib/server/storage/models/mikro-orm/owners-class-path-model.js +0 -79
- package/lib/server/storage/models/mikro-orm/registered-models-mikro-orm.js +0 -39
- package/lib/server/storage/models/mikro-orm/skill-attack-model.js +0 -156
- package/lib/server/storage/models/mikro-orm/skill-group-relation-model.js +0 -82
- package/lib/server/storage/models/mikro-orm/skill-model.js +0 -236
- package/lib/server/storage/models/mikro-orm/skill-owner-conditions-model.js +0 -83
- package/lib/server/storage/models/mikro-orm/skill-owner-effects-model.js +0 -119
- package/lib/server/storage/models/mikro-orm/skill-physical-data-model.js +0 -83
- package/lib/server/storage/models/mikro-orm/skill-target-effects-model.js +0 -125
- package/lib/server/storage/models/mikro-orm/skills-groups-model.js +0 -77
- package/lib/server/storage/models/objection-js/class-path-level-labels-model.js +0 -44
- package/lib/server/storage/models/objection-js/class-path-level-skills-model.js +0 -53
- package/lib/server/storage/models/objection-js/class-path-model.js +0 -85
- package/lib/server/storage/models/objection-js/level-model.js +0 -44
- package/lib/server/storage/models/objection-js/level-modifiers-model.js +0 -35
- package/lib/server/storage/models/objection-js/levels-set-model.js +0 -44
- package/lib/server/storage/models/objection-js/owners-class-path-model.js +0 -35
- package/lib/server/storage/models/objection-js/registered-models-objection-js.js +0 -39
- package/lib/server/storage/models/objection-js/skill-attack-model.js +0 -35
- package/lib/server/storage/models/objection-js/skill-group-relation-model.js +0 -44
- package/lib/server/storage/models/objection-js/skill-model.js +0 -89
- package/lib/server/storage/models/objection-js/skill-owner-conditions-model.js +0 -35
- package/lib/server/storage/models/objection-js/skill-owner-effects-model.js +0 -35
- package/lib/server/storage/models/objection-js/skill-physical-data-model.js +0 -35
- package/lib/server/storage/models/objection-js/skill-target-effects-model.js +0 -35
- package/lib/server/storage/models/objection-js/skills-groups-model.js +0 -35
- package/lib/server/storage/models-manager.js +0 -111
- package/lib/server/storage/modifiers-generator.js +0 -28
- package/lib/server/storage/skills-generator.js +0 -102
- package/lib/server/storage-observer.js +0 -89
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* Reldens - Skills - SkillAttackModel
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const { MikroOrmCore } = require('@reldens/storage');
|
|
8
|
-
const { EntitySchema } = MikroOrmCore;
|
|
9
|
-
|
|
10
|
-
class SkillAttackModel
|
|
11
|
-
{
|
|
12
|
-
|
|
13
|
-
beforeDestroyCalled = 0;
|
|
14
|
-
afterDestroyCalled = 0;
|
|
15
|
-
|
|
16
|
-
constructor(
|
|
17
|
-
skill_id,
|
|
18
|
-
affectedProperty,
|
|
19
|
-
allowEffectBelowZero,
|
|
20
|
-
hitDamage,
|
|
21
|
-
applyDirectDamage,
|
|
22
|
-
attackProperties,
|
|
23
|
-
defenseProperties,
|
|
24
|
-
aimProperties,
|
|
25
|
-
dodgeProperties,
|
|
26
|
-
dodgeFullEnabled,
|
|
27
|
-
dodgeOverAimSuccess,
|
|
28
|
-
damageAffected,
|
|
29
|
-
criticalAffected
|
|
30
|
-
){
|
|
31
|
-
this.skill_id = skill_id;
|
|
32
|
-
this.affectedProperty = affectedProperty;
|
|
33
|
-
this.allowEffectBelowZero = allowEffectBelowZero;
|
|
34
|
-
this.hitDamage = hitDamage;
|
|
35
|
-
this.applyDirectDamage = applyDirectDamage;
|
|
36
|
-
this.attackProperties = attackProperties;
|
|
37
|
-
this.defenseProperties = defenseProperties;
|
|
38
|
-
this.aimProperties = aimProperties;
|
|
39
|
-
this.dodgeProperties = dodgeProperties;
|
|
40
|
-
this.dodgeFullEnabled = dodgeFullEnabled;
|
|
41
|
-
this.dodgeOverAimSuccess = dodgeOverAimSuccess;
|
|
42
|
-
this.damageAffected = damageAffected;
|
|
43
|
-
this.criticalAffected = criticalAffected;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
static createByProps(props)
|
|
47
|
-
{
|
|
48
|
-
const {
|
|
49
|
-
skill_id,
|
|
50
|
-
affectedProperty,
|
|
51
|
-
allowEffectBelowZero,
|
|
52
|
-
hitDamage,
|
|
53
|
-
applyDirectDamage,
|
|
54
|
-
attackProperties,
|
|
55
|
-
defenseProperties,
|
|
56
|
-
aimProperties,
|
|
57
|
-
dodgeProperties,
|
|
58
|
-
dodgeFullEnabled,
|
|
59
|
-
dodgeOverAimSuccess,
|
|
60
|
-
damageAffected,
|
|
61
|
-
criticalAffected
|
|
62
|
-
} = props;
|
|
63
|
-
return new this(
|
|
64
|
-
skill_id,
|
|
65
|
-
affectedProperty,
|
|
66
|
-
allowEffectBelowZero,
|
|
67
|
-
hitDamage,
|
|
68
|
-
applyDirectDamage,
|
|
69
|
-
attackProperties,
|
|
70
|
-
defenseProperties,
|
|
71
|
-
aimProperties,
|
|
72
|
-
dodgeProperties,
|
|
73
|
-
dodgeFullEnabled,
|
|
74
|
-
dodgeOverAimSuccess,
|
|
75
|
-
damageAffected,
|
|
76
|
-
criticalAffected
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
static relationMappings()
|
|
81
|
-
{
|
|
82
|
-
return {
|
|
83
|
-
parent_skill: {
|
|
84
|
-
type: 'SkillModel',
|
|
85
|
-
entityName: 'skill',
|
|
86
|
-
reference: 'm:1',
|
|
87
|
-
join: {
|
|
88
|
-
from: 'skill_id',
|
|
89
|
-
to: 'id'
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const schema = new EntitySchema({
|
|
98
|
-
class: SkillAttackModel,
|
|
99
|
-
properties: {
|
|
100
|
-
_id: {
|
|
101
|
-
primary: true,
|
|
102
|
-
type: 'ObjectID'
|
|
103
|
-
},
|
|
104
|
-
id: {
|
|
105
|
-
type: 'string',
|
|
106
|
-
serializedPrimaryKey: true
|
|
107
|
-
},
|
|
108
|
-
skill_id: {
|
|
109
|
-
type: 'SkillModel',
|
|
110
|
-
reference: 'm:1',
|
|
111
|
-
nullable: true
|
|
112
|
-
},
|
|
113
|
-
affectedProperty: {
|
|
114
|
-
type: 'string'
|
|
115
|
-
},
|
|
116
|
-
allowEffectBelowZero: {
|
|
117
|
-
type: 'boolean'
|
|
118
|
-
},
|
|
119
|
-
hitDamage: {
|
|
120
|
-
type: 'number'
|
|
121
|
-
},
|
|
122
|
-
applyDirectDamage: {
|
|
123
|
-
type: 'boolean'
|
|
124
|
-
},
|
|
125
|
-
attackProperties: {
|
|
126
|
-
type: 'string'
|
|
127
|
-
},
|
|
128
|
-
defenseProperties: {
|
|
129
|
-
type: 'string'
|
|
130
|
-
},
|
|
131
|
-
aimProperties: {
|
|
132
|
-
type: 'string'
|
|
133
|
-
},
|
|
134
|
-
dodgeProperties: {
|
|
135
|
-
type: 'string'
|
|
136
|
-
},
|
|
137
|
-
dodgeFullEnabled: {
|
|
138
|
-
type: 'boolean'
|
|
139
|
-
},
|
|
140
|
-
dodgeOverAimSuccess: {
|
|
141
|
-
type: 'boolean'
|
|
142
|
-
},
|
|
143
|
-
damageAffected: {
|
|
144
|
-
type: 'boolean'
|
|
145
|
-
},
|
|
146
|
-
criticalAffected: {
|
|
147
|
-
type: 'boolean'
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
module.exports = {
|
|
153
|
-
SkillAttackModel,
|
|
154
|
-
entity: SkillAttackModel,
|
|
155
|
-
schema
|
|
156
|
-
};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* Reldens - Skills - SkillGroupRelationModel
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const { MikroOrmCore } = require('@reldens/storage');
|
|
8
|
-
const { EntitySchema } = MikroOrmCore;
|
|
9
|
-
|
|
10
|
-
class SkillGroupRelationModel
|
|
11
|
-
{
|
|
12
|
-
|
|
13
|
-
beforeDestroyCalled = 0;
|
|
14
|
-
afterDestroyCalled = 0;
|
|
15
|
-
|
|
16
|
-
constructor(skill_id, group_id)
|
|
17
|
-
{
|
|
18
|
-
this.skill_id = skill_id;
|
|
19
|
-
this.group_id = group_id;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
static createByProps(props)
|
|
23
|
-
{
|
|
24
|
-
const {skill_id, group_id} = props;
|
|
25
|
-
return new this(skill_id, group_id);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
static relationMappings()
|
|
29
|
-
{
|
|
30
|
-
return {
|
|
31
|
-
skill_id: {
|
|
32
|
-
type: 'SkillModel',
|
|
33
|
-
entityName: 'skill',
|
|
34
|
-
reference: 'm:1',
|
|
35
|
-
join: {
|
|
36
|
-
from: 'skill_id',
|
|
37
|
-
to: 'id'
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
group_id: {
|
|
41
|
-
type: 'SkillsGroupsModel',
|
|
42
|
-
entityName: 'skillGroups',
|
|
43
|
-
reference: 'm:1',
|
|
44
|
-
join: {
|
|
45
|
-
from: 'group_id',
|
|
46
|
-
to: 'id'
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const schema = new EntitySchema({
|
|
55
|
-
class: SkillGroupRelationModel,
|
|
56
|
-
properties: {
|
|
57
|
-
_id: {
|
|
58
|
-
primary: true,
|
|
59
|
-
type: 'ObjectID'
|
|
60
|
-
},
|
|
61
|
-
id: {
|
|
62
|
-
type: 'string',
|
|
63
|
-
serializedPrimaryKey: true
|
|
64
|
-
},
|
|
65
|
-
skill_id: {
|
|
66
|
-
reference: 'm:1',
|
|
67
|
-
type: 'SkillModel',
|
|
68
|
-
nullable: true
|
|
69
|
-
},
|
|
70
|
-
group_id: {
|
|
71
|
-
reference: 'm:1',
|
|
72
|
-
type: 'SkillsGroupsModel',
|
|
73
|
-
nullable: true
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
module.exports = {
|
|
79
|
-
SkillGroupRelationModel,
|
|
80
|
-
entity: SkillGroupRelationModel,
|
|
81
|
-
schema
|
|
82
|
-
};
|
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* Reldens - Skills - SkillModel
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const { MikroOrmCore } = require('@reldens/storage');
|
|
8
|
-
const { EntitySchema } = MikroOrmCore;
|
|
9
|
-
|
|
10
|
-
class SkillModel
|
|
11
|
-
{
|
|
12
|
-
|
|
13
|
-
beforeDestroyCalled = 0;
|
|
14
|
-
afterDestroyCalled = 0;
|
|
15
|
-
|
|
16
|
-
constructor(
|
|
17
|
-
key,
|
|
18
|
-
type,
|
|
19
|
-
autoValidation,
|
|
20
|
-
skillDelay,
|
|
21
|
-
castTime,
|
|
22
|
-
usesLimit,
|
|
23
|
-
range,
|
|
24
|
-
rangeAutomaticValidation,
|
|
25
|
-
rangePropertyX,
|
|
26
|
-
rangePropertyY,
|
|
27
|
-
rangeTargetPropertyX,
|
|
28
|
-
rangeTargetPropertyY,
|
|
29
|
-
allowSelfTarget,
|
|
30
|
-
criticalChance,
|
|
31
|
-
criticalMultiplier,
|
|
32
|
-
criticalFixedValue,
|
|
33
|
-
customData
|
|
34
|
-
){
|
|
35
|
-
this.key = key;
|
|
36
|
-
this.type = type;
|
|
37
|
-
this.autoValidation = autoValidation;
|
|
38
|
-
this.skillDelay = skillDelay;
|
|
39
|
-
this.castTime = castTime;
|
|
40
|
-
this.usesLimit = usesLimit;
|
|
41
|
-
this.range = range;
|
|
42
|
-
this.rangeAutomaticValidation = rangeAutomaticValidation;
|
|
43
|
-
this.rangePropertyX = rangePropertyX;
|
|
44
|
-
this.rangePropertyY = rangePropertyY;
|
|
45
|
-
this.rangeTargetPropertyX = rangeTargetPropertyX;
|
|
46
|
-
this.rangeTargetPropertyY = rangeTargetPropertyY;
|
|
47
|
-
this.allowSelfTarget = allowSelfTarget;
|
|
48
|
-
this.criticalChance = criticalChance;
|
|
49
|
-
this.criticalMultiplier = criticalMultiplier;
|
|
50
|
-
this.criticalFixedValue = criticalFixedValue;
|
|
51
|
-
this.customData = customData;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
static createByProps(props)
|
|
55
|
-
{
|
|
56
|
-
const {
|
|
57
|
-
key,
|
|
58
|
-
type,
|
|
59
|
-
autoValidation,
|
|
60
|
-
skillDelay,
|
|
61
|
-
castTime,
|
|
62
|
-
usesLimit,
|
|
63
|
-
range,
|
|
64
|
-
rangeAutomaticValidation,
|
|
65
|
-
rangePropertyX,
|
|
66
|
-
rangePropertyY,
|
|
67
|
-
rangeTargetPropertyX,
|
|
68
|
-
rangeTargetPropertyY,
|
|
69
|
-
allowSelfTarget,
|
|
70
|
-
criticalChance,
|
|
71
|
-
criticalMultiplier,
|
|
72
|
-
criticalFixedValue,
|
|
73
|
-
customData
|
|
74
|
-
} = props;
|
|
75
|
-
return new this(
|
|
76
|
-
key,
|
|
77
|
-
type,
|
|
78
|
-
autoValidation,
|
|
79
|
-
skillDelay,
|
|
80
|
-
castTime,
|
|
81
|
-
usesLimit,
|
|
82
|
-
range,
|
|
83
|
-
rangeAutomaticValidation,
|
|
84
|
-
rangePropertyX,
|
|
85
|
-
rangePropertyY,
|
|
86
|
-
rangeTargetPropertyX,
|
|
87
|
-
rangeTargetPropertyY,
|
|
88
|
-
allowSelfTarget,
|
|
89
|
-
criticalChance,
|
|
90
|
-
criticalMultiplier,
|
|
91
|
-
criticalFixedValue,
|
|
92
|
-
customData
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
static relationMappings()
|
|
97
|
-
{
|
|
98
|
-
return {
|
|
99
|
-
skill_owner_conditions: {
|
|
100
|
-
type: 'SkillOwnerConditionsModel',
|
|
101
|
-
entityName: 'skillOwnerConditions',
|
|
102
|
-
reference: '1:m',
|
|
103
|
-
join: {
|
|
104
|
-
from: 'id',
|
|
105
|
-
to: 'skill_id'
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
skill_owner_effects: {
|
|
109
|
-
type: 'SkillOwnerEffectsModel',
|
|
110
|
-
entityName: 'skillOwnerEffects',
|
|
111
|
-
reference: '1:m',
|
|
112
|
-
join: {
|
|
113
|
-
from: 'id',
|
|
114
|
-
to: 'skill_id'
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
skill_target_effects: {
|
|
118
|
-
type: 'SkillTargetEffectsModel',
|
|
119
|
-
entityName: 'skillTargetEffects',
|
|
120
|
-
reference: '1:m',
|
|
121
|
-
join: {
|
|
122
|
-
from: 'id',
|
|
123
|
-
to: 'skill_id'
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
skill_group_relations: {
|
|
127
|
-
type: 'SkillGroupRelationModel',
|
|
128
|
-
entityName: 'skillGroupRelation',
|
|
129
|
-
reference: '1:m',
|
|
130
|
-
join: {
|
|
131
|
-
from: 'id',
|
|
132
|
-
to: 'skill_id'
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
class_path_level: {
|
|
136
|
-
type: 'ClassPathLevelSkillsModel',
|
|
137
|
-
entityName: 'classPathLevelSkills',
|
|
138
|
-
reference: '1:m',
|
|
139
|
-
join: {
|
|
140
|
-
from: 'id',
|
|
141
|
-
to: 'skill_id'
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
skill_attack: {
|
|
145
|
-
type: 'SkillAttackModel',
|
|
146
|
-
entityName: 'skillAttack',
|
|
147
|
-
reference: 'm:1',
|
|
148
|
-
join: {
|
|
149
|
-
from: 'id',
|
|
150
|
-
to: 'skill_id'
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
skill_physical_data: {
|
|
154
|
-
type: 'SkillPhysicalDataModel',
|
|
155
|
-
entityName: 'skillPhysicalData',
|
|
156
|
-
reference: 'm:1',
|
|
157
|
-
join: {
|
|
158
|
-
from: 'id',
|
|
159
|
-
to: 'skill_id'
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
const schema = new EntitySchema({
|
|
168
|
-
class: SkillModel,
|
|
169
|
-
properties: {
|
|
170
|
-
_id: {
|
|
171
|
-
primary: true,
|
|
172
|
-
type: 'ObjectID'
|
|
173
|
-
},
|
|
174
|
-
id: {
|
|
175
|
-
type: 'string',
|
|
176
|
-
serializedPrimaryKey: true
|
|
177
|
-
},
|
|
178
|
-
key: {
|
|
179
|
-
type: 'string'
|
|
180
|
-
},
|
|
181
|
-
type: {
|
|
182
|
-
type: 'number'
|
|
183
|
-
},
|
|
184
|
-
autoValidation: {
|
|
185
|
-
type: 'boolean'
|
|
186
|
-
},
|
|
187
|
-
skillDelay: {
|
|
188
|
-
type: 'number'
|
|
189
|
-
},
|
|
190
|
-
castTime: {
|
|
191
|
-
type: 'number'
|
|
192
|
-
},
|
|
193
|
-
usesLimit: {
|
|
194
|
-
type: 'number'
|
|
195
|
-
},
|
|
196
|
-
range: {
|
|
197
|
-
type: 'number'
|
|
198
|
-
},
|
|
199
|
-
rangeAutomaticValidation: {
|
|
200
|
-
type: 'boolean'
|
|
201
|
-
},
|
|
202
|
-
rangePropertyX: {
|
|
203
|
-
type: 'string'
|
|
204
|
-
},
|
|
205
|
-
rangePropertyY: {
|
|
206
|
-
type: 'string'
|
|
207
|
-
},
|
|
208
|
-
rangeTargetPropertyX: {
|
|
209
|
-
type: 'string'
|
|
210
|
-
},
|
|
211
|
-
rangeTargetPropertyY: {
|
|
212
|
-
type: 'string'
|
|
213
|
-
},
|
|
214
|
-
allowSelfTarget: {
|
|
215
|
-
type: 'boolean'
|
|
216
|
-
},
|
|
217
|
-
criticalChance: {
|
|
218
|
-
type: 'number'
|
|
219
|
-
},
|
|
220
|
-
criticalMultiplier: {
|
|
221
|
-
type: 'number'
|
|
222
|
-
},
|
|
223
|
-
criticalFixedValue: {
|
|
224
|
-
type: 'number'
|
|
225
|
-
},
|
|
226
|
-
customData: {
|
|
227
|
-
type: 'string'
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
module.exports = {
|
|
233
|
-
SkillModel,
|
|
234
|
-
entity: SkillModel,
|
|
235
|
-
schema
|
|
236
|
-
};
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* Reldens - Skills - SkillOwnerConditionsModel
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const { MikroOrmCore } = require('@reldens/storage');
|
|
8
|
-
const { EntitySchema } = MikroOrmCore;
|
|
9
|
-
|
|
10
|
-
class SkillOwnerConditionsModel
|
|
11
|
-
{
|
|
12
|
-
|
|
13
|
-
beforeDestroyCalled = 0;
|
|
14
|
-
afterDestroyCalled = 0;
|
|
15
|
-
|
|
16
|
-
constructor(key, skill_id, property_key, conditional, value)
|
|
17
|
-
{
|
|
18
|
-
this.key = key;
|
|
19
|
-
this.skill_id = skill_id;
|
|
20
|
-
this.property_key = property_key;
|
|
21
|
-
this.conditional = conditional;
|
|
22
|
-
this.value = value;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
static createByProps(props)
|
|
26
|
-
{
|
|
27
|
-
const {key, skill_id, property_key, conditional, value} = props;
|
|
28
|
-
return new this(key, skill_id, property_key, conditional, value);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
static relationMappings()
|
|
32
|
-
{
|
|
33
|
-
return {
|
|
34
|
-
level_id: {
|
|
35
|
-
type: 'SkillModel',
|
|
36
|
-
entityName: 'skill',
|
|
37
|
-
reference: 'm:1',
|
|
38
|
-
join: {
|
|
39
|
-
from: 'skill_id',
|
|
40
|
-
to: 'id'
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const schema = new EntitySchema({
|
|
49
|
-
class: SkillOwnerConditionsModel,
|
|
50
|
-
properties: {
|
|
51
|
-
_id: {
|
|
52
|
-
primary: true,
|
|
53
|
-
type: 'ObjectID'
|
|
54
|
-
},
|
|
55
|
-
id: {
|
|
56
|
-
type: 'string',
|
|
57
|
-
serializedPrimaryKey: true
|
|
58
|
-
},
|
|
59
|
-
key: {
|
|
60
|
-
type: 'string'
|
|
61
|
-
},
|
|
62
|
-
skill_id: {
|
|
63
|
-
type: 'SkillModel',
|
|
64
|
-
reference: 'm:1',
|
|
65
|
-
nullable: true
|
|
66
|
-
},
|
|
67
|
-
property_key: {
|
|
68
|
-
type: 'string'
|
|
69
|
-
},
|
|
70
|
-
conditional: {
|
|
71
|
-
type: 'string'
|
|
72
|
-
},
|
|
73
|
-
value: {
|
|
74
|
-
type: 'string'
|
|
75
|
-
},
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
module.exports = {
|
|
80
|
-
SkillOwnerConditionsModel,
|
|
81
|
-
entity: SkillOwnerConditionsModel,
|
|
82
|
-
schema
|
|
83
|
-
};
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* Reldens - Skills - SkillOwnerEffectsModel
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const { MikroOrmCore } = require('@reldens/storage');
|
|
8
|
-
const { EntitySchema } = MikroOrmCore;
|
|
9
|
-
|
|
10
|
-
class SkillOwnerEffectsModel
|
|
11
|
-
{
|
|
12
|
-
|
|
13
|
-
beforeDestroyCalled = 0;
|
|
14
|
-
afterDestroyCalled = 0;
|
|
15
|
-
|
|
16
|
-
constructor(level_id, key, property_key, operation, value, minValue, maxValue, minProperty, maxProperty)
|
|
17
|
-
{
|
|
18
|
-
this.level_id = level_id;
|
|
19
|
-
this.key = key;
|
|
20
|
-
this.property_key = property_key;
|
|
21
|
-
this.operation = operation;
|
|
22
|
-
this.value = value;
|
|
23
|
-
this.minValue = minValue;
|
|
24
|
-
this.maxValue = maxValue;
|
|
25
|
-
this.minProperty = minProperty;
|
|
26
|
-
this.maxProperty = maxProperty;
|
|
27
|
-
this.type = type;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
static createByProps(props)
|
|
31
|
-
{
|
|
32
|
-
const {
|
|
33
|
-
level_id,
|
|
34
|
-
key,
|
|
35
|
-
property_key,
|
|
36
|
-
operation,
|
|
37
|
-
value,
|
|
38
|
-
minValue,
|
|
39
|
-
maxValue,
|
|
40
|
-
minProperty,
|
|
41
|
-
maxProperty
|
|
42
|
-
} = props;
|
|
43
|
-
return new this(
|
|
44
|
-
level_id,
|
|
45
|
-
key,
|
|
46
|
-
property_key,
|
|
47
|
-
operation,
|
|
48
|
-
value,
|
|
49
|
-
minValue,
|
|
50
|
-
maxValue,
|
|
51
|
-
minProperty,
|
|
52
|
-
maxProperty
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
static relationMappings()
|
|
57
|
-
{
|
|
58
|
-
return {
|
|
59
|
-
level_id: {
|
|
60
|
-
reference: 'm:1',
|
|
61
|
-
type: 'SkillModel',
|
|
62
|
-
join: {
|
|
63
|
-
from: 'skill_id',
|
|
64
|
-
to: 'id'
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const schema = new EntitySchema({
|
|
73
|
-
class: SkillOwnerEffectsModel,
|
|
74
|
-
properties: {
|
|
75
|
-
_id: {
|
|
76
|
-
primary: true,
|
|
77
|
-
type: 'ObjectID'
|
|
78
|
-
},
|
|
79
|
-
id: {
|
|
80
|
-
type: 'string',
|
|
81
|
-
serializedPrimaryKey: true
|
|
82
|
-
},
|
|
83
|
-
level_id: {
|
|
84
|
-
reference: 'm:1',
|
|
85
|
-
type: 'LevelModel',
|
|
86
|
-
nullable: true
|
|
87
|
-
},
|
|
88
|
-
key: {
|
|
89
|
-
type: 'string'
|
|
90
|
-
},
|
|
91
|
-
property_key: {
|
|
92
|
-
type: 'string'
|
|
93
|
-
},
|
|
94
|
-
operation: {
|
|
95
|
-
type: 'number'
|
|
96
|
-
},
|
|
97
|
-
value: {
|
|
98
|
-
type: 'string'
|
|
99
|
-
},
|
|
100
|
-
minValue: {
|
|
101
|
-
type: 'string'
|
|
102
|
-
},
|
|
103
|
-
maxValue: {
|
|
104
|
-
type: 'string'
|
|
105
|
-
},
|
|
106
|
-
minProperty: {
|
|
107
|
-
type: 'string'
|
|
108
|
-
},
|
|
109
|
-
maxProperty: {
|
|
110
|
-
type: 'string'
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
module.exports = {
|
|
116
|
-
SkillOwnerEffectsModel,
|
|
117
|
-
entity: SkillOwnerEffectsModel,
|
|
118
|
-
schema
|
|
119
|
-
};
|