@rpg-engine/long-bow 0.1.70 → 0.1.73

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 (36) hide show
  1. package/dist/components/Abstractions/SlotsContainer.d.ts +11 -0
  2. package/dist/components/DraggableContainer.d.ts +1 -0
  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 → shared}/SpriteFromAtlas.d.ts +4 -1
  7. package/dist/components/shared/SpriteIcon.d.ts +9 -0
  8. package/dist/components/store/UI.store.d.ts +34 -0
  9. package/dist/index.d.ts +3 -1
  10. package/dist/long-bow.cjs.development.js +2140 -448
  11. package/dist/long-bow.cjs.development.js.map +1 -1
  12. package/dist/long-bow.cjs.production.min.js +1 -1
  13. package/dist/long-bow.cjs.production.min.js.map +1 -1
  14. package/dist/long-bow.esm.js +2142 -450
  15. package/dist/long-bow.esm.js.map +1 -1
  16. package/dist/mocks/equipmentSet.mocks.d.ts +3 -0
  17. package/package.json +4 -2
  18. package/src/components/Abstractions/SlotsContainer.tsx +42 -0
  19. package/src/components/DraggableContainer.tsx +70 -37
  20. package/src/components/Equipment/EquipmentSet.tsx +179 -0
  21. package/src/components/Item/Inventory/ItemContainer.tsx +70 -178
  22. package/src/components/Item/Inventory/ItemSlot.tsx +93 -25
  23. package/src/components/Item/Inventory/itemContainerHelper.ts +48 -11
  24. package/src/components/ListMenu.tsx +4 -4
  25. package/src/components/Multitab/TabsContainer.tsx +2 -0
  26. package/src/components/SkillProgressBar.tsx +2 -2
  27. package/src/components/{Item → shared}/SpriteFromAtlas.tsx +24 -4
  28. package/src/components/shared/SpriteIcon.tsx +67 -0
  29. package/src/components/store/UI.store.ts +192 -0
  30. package/src/index.tsx +3 -1
  31. package/src/mocks/atlas/icons/icons.json +303 -0
  32. package/src/mocks/atlas/icons/icons.png +0 -0
  33. package/src/mocks/atlas/items/items.json +1209 -181
  34. package/src/mocks/atlas/items/items.png +0 -0
  35. package/src/mocks/equipmentSet.mocks.ts +347 -0
  36. package/src/mocks/itemContainer.mocks.ts +33 -33
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: [],