@rpg-engine/long-bow 0.1.68 → 0.1.71

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 (47) hide show
  1. package/dist/components/Abstractions/SlotsContainer.d.ts +11 -0
  2. package/dist/components/DraggableContainer.d.ts +3 -2
  3. package/dist/components/Equipment/EquipmentSet.d.ts +13 -0
  4. package/dist/components/Item/Inventory/ItemSlot.d.ts +10 -2
  5. package/dist/components/Item/Inventory/itemContainerHelper.d.ts +6 -2
  6. package/dist/components/Item/SpriteFromAtlas.d.ts +2 -0
  7. package/dist/components/Multitab/Tab.d.ts +9 -0
  8. package/dist/components/Multitab/TabBody.d.ts +7 -0
  9. package/dist/components/Multitab/TabsContainer.d.ts +17 -0
  10. package/dist/components/SimpleProgressBar.d.ts +3 -4
  11. package/dist/components/SkillProgressBar.d.ts +6 -4
  12. package/dist/components/SkillsContainer.d.ts +7 -0
  13. package/dist/components/store/UI.store.d.ts +34 -0
  14. package/dist/constants/uiColors.d.ts +7 -0
  15. package/dist/index.d.ts +1 -0
  16. package/dist/long-bow.cjs.development.js +5258 -419
  17. package/dist/long-bow.cjs.development.js.map +1 -1
  18. package/dist/long-bow.cjs.production.min.js +1 -1
  19. package/dist/long-bow.cjs.production.min.js.map +1 -1
  20. package/dist/long-bow.esm.js +5260 -420
  21. package/dist/long-bow.esm.js.map +1 -1
  22. package/dist/mocks/equipmentSet.mocks.d.ts +3 -0
  23. package/dist/mocks/skills.mocks.d.ts +115 -0
  24. package/package.json +5 -3
  25. package/src/components/Abstractions/SlotsContainer.tsx +42 -0
  26. package/src/components/DraggableContainer.tsx +65 -38
  27. package/src/components/Equipment/EquipmentSet.tsx +179 -0
  28. package/src/components/I_Book.png +0 -0
  29. package/src/components/Item/Inventory/ItemContainer.tsx +70 -178
  30. package/src/components/Item/Inventory/ItemSlot.tsx +92 -24
  31. package/src/components/Item/Inventory/itemContainerHelper.ts +48 -11
  32. package/src/components/Item/SpriteFromAtlas.tsx +18 -1
  33. package/src/components/ListMenu.tsx +3 -3
  34. package/src/components/Multitab/Tab.tsx +57 -0
  35. package/src/components/Multitab/TabBody.tsx +13 -0
  36. package/src/components/Multitab/TabsContainer.tsx +97 -0
  37. package/src/components/SimpleProgressBar.tsx +14 -10
  38. package/src/components/SkillProgressBar.tsx +74 -20
  39. package/src/components/SkillsContainer.tsx +235 -0
  40. package/src/components/store/UI.store.ts +192 -0
  41. package/src/constants/uiColors.ts +7 -0
  42. package/src/index.tsx +1 -0
  43. package/src/mocks/atlas/items/items.json +4677 -189
  44. package/src/mocks/atlas/items/items.png +0 -0
  45. package/src/mocks/equipmentSet.mocks.ts +347 -0
  46. package/src/mocks/itemContainer.mocks.ts +33 -33
  47. package/src/mocks/skills.mocks.ts +116 -0
Binary file
@@ -0,0 +1,347 @@
1
+ import {
2
+ IEquipementSet,
3
+ // IItem,
4
+ ItemSlotType,
5
+ ItemSubType,
6
+ ItemType,
7
+ } from '@rpg-engine/shared';
8
+
9
+ export const items: any = {
10
+ leftHand: {
11
+ _id: '0',
12
+ type: ItemType.Weapon,
13
+ subType: ItemSubType.Sword,
14
+ textureAtlas: 'items',
15
+ allowedEquipSlotType: [ItemSlotType.LeftHand, ItemSlotType.RightHand],
16
+ maxStackSize: 1,
17
+ isUsable: false,
18
+ isStorable: true,
19
+ layer: 1,
20
+ isItemContainer: false,
21
+ isSolid: false,
22
+ key: 'basilisk-sword',
23
+ texturePath: 'swords/basilisk-sword.png',
24
+ textureKey: 'basilisk-sword',
25
+ name: 'basilisk sword',
26
+ description:
27
+ 'You see a short sword. It is a single-handed sword with a handle that just features a grip.',
28
+ attack: 5,
29
+ defense: 0,
30
+ weight: 10,
31
+ tiledId: 66,
32
+ x: 320,
33
+ y: 144,
34
+ scene: 'MainScene',
35
+ fullDescription:
36
+ 'You see a short sword. It is a single-handed sword with a handle that just features a grip.',
37
+ isEquipable: true,
38
+ isStackable: false,
39
+ createdAt: '2022-06-04T03:18:09.335Z',
40
+ updatedAt: '2022-06-04T18:16:49.056Z',
41
+ },
42
+ head: {
43
+ _id: '1',
44
+ type: ItemType.Armor,
45
+ subType: ItemSubType.Helmet,
46
+ textureAtlas: 'items',
47
+ allowedEquipSlotType: [ItemSlotType.Head],
48
+ maxStackSize: 1,
49
+ isUsable: false,
50
+ isStorable: true,
51
+ layer: 1,
52
+ isItemContainer: false,
53
+ isSolid: false,
54
+ key: 'iron-helmet',
55
+ texturePath: 'helmets/iron-helmet.png',
56
+ textureKey: 'iron-helmet',
57
+ name: 'Helmet',
58
+ description: 'You see a broad bow.',
59
+ attack: 7,
60
+ defense: 3,
61
+ weight: 13,
62
+ tiledId: 67,
63
+ x: 320,
64
+ y: 144,
65
+ scene: 'MainScene',
66
+ fullDescription: 'You see a board bow.',
67
+ isEquipable: true,
68
+ isStackable: false,
69
+ createdAt: '2022-06-04T03:18:09.335Z',
70
+ updatedAt: '2022-06-04T18:16:49.056Z',
71
+ },
72
+ armor: {
73
+ _id: '2',
74
+ type: ItemType.Armor,
75
+ subType: ItemSubType.Armor,
76
+ textureAtlas: 'items',
77
+ allowedEquipSlotType: [ItemSlotType.Torso],
78
+ isEquipable: false,
79
+ isStackable: false,
80
+ maxStackSize: 99,
81
+ stackQty: 3,
82
+ isUsable: true,
83
+ isStorable: true,
84
+ layer: 1,
85
+ isItemContainer: false,
86
+ isSolid: false,
87
+ key: 'board-sword-22',
88
+ texturePath: 'armors/golden-armor.png',
89
+ textureKey: 'golden-armor',
90
+ name: 'golden armor',
91
+ description: 'Recover your life',
92
+ attack: 7,
93
+ defense: 3,
94
+ weight: 13,
95
+ tiledId: 67,
96
+ x: 320,
97
+ y: 144,
98
+ scene: 'MainScene',
99
+ fullDescription: 'Recover your life',
100
+ createdAt: '2022-06-04T03:18:09.335Z',
101
+ updatedAt: '2022-06-04T18:16:49.056Z',
102
+ },
103
+ legs: {
104
+ _id: '3',
105
+ type: ItemType.Armor,
106
+ subType: ItemSubType.Armor,
107
+ textureAtlas: 'items',
108
+ allowedEquipSlotType: [ItemSlotType.Legs],
109
+ isEquipable: false,
110
+ isStackable: false,
111
+ maxStackSize: 99,
112
+ stackQty: 13,
113
+ isUsable: true,
114
+ isStorable: true,
115
+ layer: 1,
116
+ isItemContainer: false,
117
+ isSolid: false,
118
+ key: 'medicinal-leaf',
119
+ texturePath: 'crafting-resources/medicinal-leaf.png',
120
+ textureKey: 'medicinal-leaf',
121
+ name: 'Medicinal Leaf',
122
+ description: 'Recover your mana',
123
+ attack: 7,
124
+ defense: 3,
125
+ weight: 13,
126
+ tiledId: 67,
127
+ x: 320,
128
+ y: 144,
129
+ scene: 'MainScene',
130
+ fullDescription: 'Recover your mana',
131
+ createdAt: '2022-06-04T03:18:09.335Z',
132
+ updatedAt: '2022-06-04T18:16:49.056Z',
133
+ },
134
+ boot: {
135
+ _id: '4',
136
+ type: ItemType.Armor,
137
+ subType: ItemSubType.Boot,
138
+ textureAtlas: 'items',
139
+ allowedEquipSlotType: [ItemSlotType.Feet],
140
+ isEquipable: false,
141
+ isStackable: false,
142
+ maxStackSize: 999,
143
+ stackQty: 171,
144
+ isUsable: true,
145
+ isStorable: true,
146
+ layer: 1,
147
+ isItemContainer: false,
148
+ isSolid: false,
149
+ key: 'board-sword-22',
150
+ texturePath: 'boots/golden-boots.png',
151
+ textureKey: 'golden-boots',
152
+ name: 'golden-boots',
153
+ description: 'Open the gates, but use the key!',
154
+ attack: 7,
155
+ defense: 3,
156
+ weight: 13,
157
+ tiledId: 67,
158
+ x: 320,
159
+ y: 144,
160
+ scene: 'MainScene',
161
+ fullDescription: 'Key to open things',
162
+ createdAt: '2022-06-04T03:18:09.335Z',
163
+ updatedAt: '2022-06-04T18:16:49.056Z',
164
+ },
165
+ neck: {
166
+ _id: '5',
167
+ type: ItemType.Armor,
168
+ subType: ItemSubType.Accessory,
169
+ textureAtlas: 'items',
170
+ allowedEquipSlotType: [ItemSlotType.Neck],
171
+ isEquipable: false,
172
+ isStackable: false,
173
+ maxStackSize: 999,
174
+ stackQty: 32,
175
+ isUsable: false,
176
+ isStorable: true,
177
+ layer: 1,
178
+ isItemContainer: false,
179
+ isSolid: false,
180
+ key: 'sapphire-necklace',
181
+ texturePath: 'accessories/sapphire-necklace.png',
182
+ textureKey: 'sapphire-necklace',
183
+ name: 'sapphire-necklace',
184
+ description: 'Use this to craft things!',
185
+ attack: 7,
186
+ defense: 3,
187
+ weight: 13,
188
+ tiledId: 67,
189
+ x: 320,
190
+ y: 144,
191
+ scene: 'MainScene',
192
+ fullDescription: 'Somes shard, some crafts.',
193
+ createdAt: '2022-06-04T03:18:09.335Z',
194
+ updatedAt: '2022-06-04T18:16:49.056Z',
195
+ },
196
+ ring: {
197
+ _id: '6',
198
+ type: ItemType.Accessory,
199
+ subType: ItemSubType.Armor,
200
+ textureAtlas: 'items',
201
+ allowedEquipSlotType: [ItemSlotType.Ring],
202
+ isEquipable: false,
203
+ isStackable: false,
204
+ maxStackSize: 999,
205
+ stackQty: 32,
206
+ isUsable: false,
207
+ isStorable: true,
208
+ layer: 1,
209
+ isItemContainer: false,
210
+ isSolid: false,
211
+ key: 'jade-ring',
212
+ texturePath: '"rings/jade-ring.png',
213
+ textureKey: 'jade-ring',
214
+ name: 'jade-ring',
215
+ description: 'Chop chop.',
216
+ attack: 7,
217
+ defense: 3,
218
+ weight: 13,
219
+ tiledId: 67,
220
+ x: 320,
221
+ y: 144,
222
+ scene: 'MainScene',
223
+ fullDescription: 'Use this axe to chop wood and stuffs.',
224
+ createdAt: '2022-06-04T03:18:09.335Z',
225
+ updatedAt: '2022-06-04T18:16:49.056Z',
226
+ },
227
+ accessory: {
228
+ _id: '7',
229
+ type: ItemType.Accessory,
230
+ subType: ItemSubType.Accessory,
231
+ textureAtlas: 'items',
232
+ allowedEquipSlotType: [ItemSlotType.Accessory],
233
+ isEquipable: false,
234
+ isStackable: false,
235
+ maxStackSize: 999,
236
+ stackQty: 32,
237
+ isUsable: false,
238
+ isStorable: true,
239
+ layer: 1,
240
+ isItemContainer: false,
241
+ isSolid: false,
242
+ key: 'wolf-tooth-chain',
243
+ texturePath: 'accessories/wolf-tooth-chain.png',
244
+ textureKey: 'wolf-tooth-chain',
245
+ name: 'wolf-tooth-chain',
246
+ description: 'Chop chop.',
247
+ attack: 7,
248
+ defense: 3,
249
+ weight: 13,
250
+ tiledId: 67,
251
+ x: 320,
252
+ y: 144,
253
+ scene: 'MainScene',
254
+ fullDescription: 'Use this axe to chop wood and stuffs.',
255
+ createdAt: '2022-06-04T03:18:09.335Z',
256
+ updatedAt: '2022-06-04T18:16:49.056Z',
257
+ },
258
+ inventory: {
259
+ _id: '8',
260
+ type: ItemType.Container,
261
+ subType: ItemSubType.Other,
262
+ textureAtlas: 'items',
263
+ allowedEquipSlotType: [ItemSlotType.Inventory],
264
+ isEquipable: false,
265
+ isStackable: false,
266
+ maxStackSize: 999,
267
+ stackQty: 171,
268
+ isUsable: true,
269
+ isStorable: true,
270
+ layer: 1,
271
+ isItemContainer: true,
272
+ isSolid: false,
273
+ key: 'backpack',
274
+ texturePath: 'containers/backpack.png',
275
+ textureKey: 'backpack',
276
+ name: 'backpack',
277
+ description: 'Open the gates, but use the key!',
278
+ attack: 7,
279
+ defense: 3,
280
+ weight: 13,
281
+ tiledId: 67,
282
+ x: 320,
283
+ y: 144,
284
+ scene: 'MainScene',
285
+ fullDescription: 'Key to open things',
286
+ createdAt: '2022-06-04T03:18:09.335Z',
287
+ updatedAt: '2022-06-04T18:16:49.056Z',
288
+ generateContainerSlots: 10,
289
+ itemContainer: {
290
+ _id: '62aebdb5785a9f0089a4f8cf',
291
+ slotQty: 10,
292
+ allowedItemTypes: [],
293
+ parentItem: '8',
294
+ slots: {},
295
+ owner: '62aebdb2785a9f0089a4f869',
296
+ createdAt: '2022-06-19T06:09:57.971Z',
297
+ updatedAt: '2022-06-19T06:09:57.971Z',
298
+ isEmpty: true,
299
+ },
300
+ },
301
+ rightHand: {
302
+ _id: '629acef1c7c8e8002ff60736',
303
+ type: ItemType.Armor,
304
+ subType: ItemSubType.Shield,
305
+ textureAtlas: 'items',
306
+ allowedEquipSlotType: [ItemSlotType.LeftHand, ItemSlotType.RightHand],
307
+ maxStackSize: 1,
308
+ isUsable: false,
309
+ isStorable: true,
310
+ layer: 1,
311
+ isItemContainer: false,
312
+ isSolid: false,
313
+ key: 'plate-shield',
314
+ texturePath: 'shields/plate-shield.png',
315
+ textureKey: 'plate-shield',
316
+ name: 'Plate Shield',
317
+ description:
318
+ 'You see a short sword. It is a single-handed sword with a handle that just features a grip.',
319
+ attack: 5,
320
+ defense: 0,
321
+ weight: 10,
322
+ tiledId: 66,
323
+ x: 320,
324
+ y: 144,
325
+ scene: 'MainScene',
326
+ fullDescription:
327
+ 'You see a short sword. It is a single-handed sword with a handle that just features a grip.',
328
+ isEquipable: true,
329
+ isStackable: false,
330
+ createdAt: '2022-06-04T03:18:09.335Z',
331
+ updatedAt: '2022-06-04T18:16:49.056Z',
332
+ },
333
+ };
334
+
335
+ export const equipmentSetMock: IEquipementSet = {
336
+ _id: '629acef1c7c8e8002ff60736',
337
+ head: undefined,
338
+ armor: items.armor,
339
+ legs: undefined,
340
+ boot: items.boot,
341
+ leftHand: items.leftHand,
342
+ rightHand: undefined,
343
+ neck: undefined,
344
+ ring: undefined,
345
+ accessory: undefined,
346
+ inventory: items.inventory,
347
+ };
@@ -147,7 +147,7 @@ export const items: IItem[] = [
147
147
  isItemContainer: false,
148
148
  isSolid: false,
149
149
  key: 'board-sword-22',
150
- texturePath: 'accessories/silver-key.png',
150
+ texturePath: 'others/silver-key.png',
151
151
  textureKey: 'silver-key',
152
152
  name: 'Key',
153
153
  description: 'Open the gates, but use the key!',
@@ -193,37 +193,37 @@ export const items: IItem[] = [
193
193
  createdAt: '2022-06-04T03:18:09.335Z',
194
194
  updatedAt: '2022-06-04T18:16:49.056Z',
195
195
  },
196
- {
197
- _id: '592acek0e3c8e8002ff60343',
198
- type: ItemType.Other,
199
- subType: ItemSubType.Other,
200
- textureAtlas: 'items',
201
- allowedEquipSlotType: [ItemSlotType.LeftHand, ItemSlotType.RightHand],
202
- isEquipable: false,
203
- isStackable: true,
204
- maxStackSize: 999,
205
- stackQty: 32,
206
- isUsable: false,
207
- isStorable: true,
208
- layer: 1,
209
- isItemContainer: false,
210
- isSolid: false,
211
- key: 'hatchet-22',
212
- texturePath: 'axes/hatchet.png',
213
- textureKey: 'hatchet',
214
- name: 'Axe',
215
- description: 'Chop chop.',
216
- attack: 7,
217
- defense: 3,
218
- weight: 13,
219
- tiledId: 67,
220
- x: 320,
221
- y: 144,
222
- scene: 'MainScene',
223
- fullDescription: 'Use this axe to chop wood and stuffs.',
224
- createdAt: '2022-06-04T03:18:09.335Z',
225
- updatedAt: '2022-06-04T18:16:49.056Z',
226
- },
196
+ // {
197
+ // _id: '592acek0e3c8e8002ff60343',
198
+ // type: ItemType.Other,
199
+ // subType: ItemSubType.Other,
200
+ // textureAtlas: 'items',
201
+ // allowedEquipSlotType: [ItemSlotType.LeftHand, ItemSlotType.RightHand],
202
+ // isEquipable: false,
203
+ // isStackable: true,
204
+ // maxStackSize: 999,
205
+ // stackQty: 32,
206
+ // isUsable: false,
207
+ // isStorable: true,
208
+ // layer: 1,
209
+ // isItemContainer: false,
210
+ // isSolid: false,
211
+ // key: 'hatchet-22',
212
+ // texturePath: 'axes/hatchet.png',
213
+ // textureKey: 'hatchet',
214
+ // name: 'Axe',
215
+ // description: 'Chop chop.',
216
+ // attack: 7,
217
+ // defense: 3,
218
+ // weight: 13,
219
+ // tiledId: 67,
220
+ // x: 320,
221
+ // y: 144,
222
+ // scene: 'MainScene',
223
+ // fullDescription: 'Use this axe to chop wood and stuffs.',
224
+ // createdAt: '2022-06-04T03:18:09.335Z',
225
+ // updatedAt: '2022-06-04T18:16:49.056Z',
226
+ // },
227
227
  ];
228
228
 
229
229
  export const itemContainerMock: IItemContainer = {
@@ -238,7 +238,7 @@ export const itemContainerMock: IItemContainer = {
238
238
  3: items[3],
239
239
  4: items[4],
240
240
  5: items[5],
241
- 6: items[6],
241
+ // 6: items[6],
242
242
  //remaining slots are considered null by default
243
243
  },
244
244
  allowedItemTypes: [],
@@ -0,0 +1,116 @@
1
+ import { SkillType } from '@rpg-engine/shared';
2
+
3
+ export const skillMock = {
4
+ _id: '62aebda8785a9f0089a4f757',
5
+ stamina: {
6
+ type: SkillType.BasicAttributes,
7
+ level: 1,
8
+ skillPoints: 10,
9
+ skillPointsToNextLevel: 80,
10
+ },
11
+ magic: {
12
+ type: SkillType.BasicAttributes,
13
+ level: 1,
14
+ skillPoints: 22,
15
+ skillPointsToNextLevel: 80,
16
+ },
17
+ magicResistance: {
18
+ type: SkillType.BasicAttributes,
19
+ level: 1,
20
+ skillPoints: 13,
21
+ skillPointsToNextLevel: 80,
22
+ },
23
+ strength: {
24
+ type: SkillType.BasicAttributes,
25
+ level: 1,
26
+ skillPoints: 14,
27
+ skillPointsToNextLevel: 80,
28
+ },
29
+ resistance: {
30
+ type: SkillType.BasicAttributes,
31
+ level: 1,
32
+ skillPoints: 5,
33
+ skillPointsToNextLevel: 80,
34
+ },
35
+ dexterity: {
36
+ type: SkillType.BasicAttributes,
37
+ level: 1,
38
+ skillPoints: 52,
39
+ skillPointsToNextLevel: 80,
40
+ },
41
+ first: {
42
+ type: SkillType.Combat,
43
+ level: 1,
44
+ skillPoints: 22,
45
+ skillPointsToNextLevel: 80,
46
+ },
47
+ club: {
48
+ type: SkillType.Combat,
49
+ level: 1,
50
+ skillPoints: 12,
51
+ skillPointsToNextLevel: 80,
52
+ },
53
+ sword: {
54
+ type: SkillType.Combat,
55
+ level: 1,
56
+ skillPoints: 3,
57
+ skillPointsToNextLevel: 80,
58
+ },
59
+ axe: {
60
+ type: SkillType.Combat,
61
+ level: 1,
62
+ skillPoints: 45,
63
+ skillPointsToNextLevel: 80,
64
+ },
65
+ distance: {
66
+ type: SkillType.Combat,
67
+ level: 1,
68
+ skillPoints: 23,
69
+ skillPointsToNextLevel: 80,
70
+ },
71
+ shielding: {
72
+ type: SkillType.Combat,
73
+ level: 1,
74
+ skillPoints: 12,
75
+ skillPointsToNextLevel: 80,
76
+ },
77
+ fishing: {
78
+ type: SkillType.Gathering,
79
+ level: 1,
80
+ skillPoints: 5,
81
+ skillPointsToNextLevel: 80,
82
+ },
83
+ mining: {
84
+ type: SkillType.Crafting,
85
+ level: 1,
86
+ skillPoints: 3,
87
+ skillPointsToNextLevel: 80,
88
+ },
89
+ lumberjacking: {
90
+ type: SkillType.Crafting,
91
+ level: 1,
92
+ skillPoints: 2,
93
+ skillPointsToNextLevel: 80,
94
+ },
95
+ cooking: {
96
+ type: SkillType.Crafting,
97
+ level: 1,
98
+ skillPoints: 10,
99
+ skillPointsToNextLevel: 80,
100
+ },
101
+ alchemy: {
102
+ type: SkillType.Crafting,
103
+ level: 1,
104
+ skillPoints: 2,
105
+ skillPointsToNextLevel: 80,
106
+ },
107
+ level: 1,
108
+ xpGainRate: 100,
109
+ experience: 0,
110
+ xpToNextLevel: 40,
111
+ ownerType: 'NPC',
112
+ owner: '62aebda8785a9f0089a4f758',
113
+ createdAt: '2022-06-19T06:09:44.661Z',
114
+ updatedAt: '2022-06-19T06:09:44.661Z',
115
+ __v: 0,
116
+ };