@reldens/skills 0.10.0-beta.32 → 0.11.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.
Files changed (28) hide show
  1. package/README.md +2 -2
  2. package/lib/server/data-server-validator.js +30 -30
  3. package/lib/server/storage/models/mikro-orm/class-path-level-labels-model.js +86 -0
  4. package/lib/server/storage/models/mikro-orm/class-path-level-skills-model.js +98 -0
  5. package/lib/server/storage/models/mikro-orm/class-path-model.js +105 -0
  6. package/lib/server/storage/models/mikro-orm/level-model.js +88 -0
  7. package/lib/server/storage/models/mikro-orm/level-modifiers-model.js +119 -0
  8. package/lib/server/storage/models/mikro-orm/levels-set-model.js +79 -0
  9. package/lib/server/storage/models/mikro-orm/owners-class-path-model.js +79 -0
  10. package/lib/server/storage/models/mikro-orm/registered-models-mikro-orm.js +39 -0
  11. package/lib/server/storage/models/mikro-orm/skill-attack-model.js +156 -0
  12. package/lib/server/storage/models/mikro-orm/skill-group-relation-model.js +82 -0
  13. package/lib/server/storage/models/mikro-orm/skill-model.js +236 -0
  14. package/lib/server/storage/models/mikro-orm/skill-owner-conditions-model.js +83 -0
  15. package/lib/server/storage/models/mikro-orm/skill-owner-effects-model.js +119 -0
  16. package/lib/server/storage/models/mikro-orm/skill-physical-data-model.js +83 -0
  17. package/lib/server/storage/models/mikro-orm/skill-target-effects-model.js +125 -0
  18. package/lib/server/storage/models/mikro-orm/skills-groups-model.js +77 -0
  19. package/lib/server/storage/models/objection-js/level-model.js +3 -3
  20. package/lib/server/storage/models/objection-js/level-modifiers-model.js +3 -3
  21. package/lib/server/storage/models/objection-js/registered-models-objection-js.js +4 -4
  22. package/lib/server/storage/models/objection-js/{skill-attack.js → skill-attack-model.js} +0 -0
  23. package/lib/server/storage/models/objection-js/{skill-group-relation.js → skill-group-relation-model.js} +0 -0
  24. package/lib/server/storage/models/objection-js/skill-model.js +2 -2
  25. package/lib/server/storage/models/objection-js/skills-groups-model.js +2 -2
  26. package/lib/server/storage/models-manager.js +13 -13
  27. package/migrations/production/reldens-skills-install.sql +125 -123
  28. package/package.json +4 -4
@@ -0,0 +1,79 @@
1
+ /**
2
+ *
3
+ * Reldens - Skills - OwnersClassPathModel
4
+ *
5
+ */
6
+
7
+ const { MikroOrmCore } = require('@reldens/storage');
8
+ const { EntitySchema } = MikroOrmCore;
9
+
10
+ class OwnersClassPathModel
11
+ {
12
+
13
+ beforeDestroyCalled = 0;
14
+ afterDestroyCalled = 0;
15
+
16
+ constructor(class_path_id, owner_id, currentLevel, currentExp)
17
+ {
18
+ this.class_path_id = class_path_id;
19
+ this.owner_id = owner_id;
20
+ this.currentLevel = currentLevel;
21
+ this.currentExp = currentExp;
22
+ }
23
+
24
+ static createByProps(props)
25
+ {
26
+ const {class_path_id, owner_id, currentLevel, currentExp} = props;
27
+ return new this(class_path_id, owner_id, currentLevel, currentExp);
28
+ }
29
+
30
+ static relationMappings()
31
+ {
32
+ return {
33
+ owner_full_class_path: {
34
+ type: 'ClassPathModel',
35
+ entityName: 'classPath',
36
+ reference: 'm:1',
37
+ join: {
38
+ from: 'class_path_id',
39
+ to: 'id'
40
+ }
41
+ }
42
+ };
43
+ }
44
+
45
+ }
46
+
47
+ const schema = new EntitySchema({
48
+ class: OwnersClassPathModel,
49
+ properties: {
50
+ _id: {
51
+ primary: true,
52
+ type: 'ObjectID'
53
+ },
54
+ id: {
55
+ type: 'string',
56
+ serializedPrimaryKey: true
57
+ },
58
+ class_path_id: {
59
+ type: 'ClassPathModel',
60
+ reference: 'm:1',
61
+ nullable: true
62
+ },
63
+ owner_id: {
64
+ type: 'number'
65
+ },
66
+ currentLevel: {
67
+ type: 'number'
68
+ },
69
+ currentExp: {
70
+ type: 'number'
71
+ }
72
+ }
73
+ });
74
+
75
+ module.exports = {
76
+ OwnersClassPathModel,
77
+ entity: OwnersClassPathModel,
78
+ schema
79
+ };
@@ -0,0 +1,39 @@
1
+ /**
2
+ *
3
+ * Reldens - Skills - Registered Entities
4
+ *
5
+ */
6
+
7
+ const ClassPathModel = require('./class-path-model');
8
+ const ClassPathLevelLabelsModel = require('./class-path-level-labels-model');
9
+ const ClassPathLevelSkillsModel = require('./class-path-level-skills-model');
10
+ const LevelModel = require('./level-model');
11
+ const LevelModifiersModel = require('./level-modifiers-model');
12
+ const LevelsSetModel = require('./levels-set-model');
13
+ const OwnersClassPathModel = require('./owners-class-path-model');
14
+ const SkillModel = require('./skill-model');
15
+ const SkillAttackModel = require('./skill-attack-model');
16
+ const SkillTargetEffectsModel = require('./skill-target-effects-model');
17
+ const SkillPhysicalDataModel = require('./skill-physical-data-model');
18
+ const SkillGroupRelationModel = require('./skill-group-relation-model');
19
+ const SkillOwnerConditionsModel = require('./skill-owner-conditions-model');
20
+ const SkillOwnerEffectsModel = require('./skill-owner-effects-model');
21
+ const SkillsGroupsModel = require('./skills-groups-model');
22
+
23
+ module.exports.rawRegisteredEntities = {
24
+ classPath: ClassPathModel,
25
+ classPathLevelLabels: ClassPathLevelLabelsModel,
26
+ classPathLevelSkills: ClassPathLevelSkillsModel,
27
+ level: LevelModel,
28
+ levelModifiers: LevelModifiersModel,
29
+ levelsSet: LevelsSetModel,
30
+ ownersClassPath: OwnersClassPathModel,
31
+ skill: SkillModel,
32
+ skillAttack: SkillAttackModel,
33
+ skillTargetEffects: SkillTargetEffectsModel,
34
+ skillPhysicalData: SkillPhysicalDataModel,
35
+ skillGroupRelation: SkillGroupRelationModel,
36
+ skillOwnerConditions: SkillOwnerConditionsModel,
37
+ skillOwnerEffects: SkillOwnerEffectsModel,
38
+ skillGroups: SkillsGroupsModel
39
+ };
@@ -0,0 +1,156 @@
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
+ };
@@ -0,0 +1,82 @@
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
+ };
@@ -0,0 +1,236 @@
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
+ };
@@ -0,0 +1,83 @@
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
+ };