@rpg-engine/long-bow 0.1.64 → 0.1.68

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 (30) hide show
  1. package/dist/components/DraggableContainer.d.ts +3 -0
  2. package/dist/components/Item/Cards/ItemCard.d.ts +9 -0
  3. package/dist/components/Item/Inventory/ItemContainer.d.ts +13 -0
  4. package/dist/components/Item/Inventory/ItemSlot.d.ts +11 -0
  5. package/dist/components/Item/Inventory/itemContainerHelper.d.ts +7 -0
  6. package/dist/components/Item/SpriteFromAtlas.d.ts +11 -0
  7. package/dist/hooks/useOutsideAlerter.d.ts +1 -0
  8. package/dist/index.d.ts +3 -0
  9. package/dist/long-bow.cjs.development.js +2101 -28
  10. package/dist/long-bow.cjs.development.js.map +1 -1
  11. package/dist/long-bow.cjs.production.min.js +1 -1
  12. package/dist/long-bow.cjs.production.min.js.map +1 -1
  13. package/dist/long-bow.esm.js +2100 -30
  14. package/dist/long-bow.esm.js.map +1 -1
  15. package/dist/mocks/itemContainer.mocks.d.ts +3 -0
  16. package/dist/types/eventTypes.d.ts +4 -0
  17. package/package.json +7 -7
  18. package/src/components/Chat/Chat.tsx +2 -2
  19. package/src/components/DraggableContainer.tsx +31 -8
  20. package/src/components/Item/Cards/ItemCard.tsx +36 -0
  21. package/src/components/Item/Inventory/ItemContainer.tsx +221 -0
  22. package/src/components/Item/Inventory/ItemSlot.tsx +90 -0
  23. package/src/components/Item/Inventory/itemContainerHelper.ts +44 -0
  24. package/src/components/Item/SpriteFromAtlas.tsx +69 -0
  25. package/src/hooks/useOutsideAlerter.ts +25 -0
  26. package/src/index.tsx +3 -0
  27. package/src/mocks/atlas/items/items.json +1695 -0
  28. package/src/mocks/atlas/items/items.png +0 -0
  29. package/src/mocks/itemContainer.mocks.ts +249 -0
  30. package/src/types/eventTypes.ts +4 -0
Binary file
@@ -0,0 +1,249 @@
1
+ import {
2
+ IItem,
3
+ IItemContainer,
4
+ ItemSlotType,
5
+ ItemSubType,
6
+ ItemType,
7
+ } from '@rpg-engine/shared';
8
+
9
+ export const items: IItem[] = [
10
+ {
11
+ _id: '629acef1c7c8e8002ff60736',
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: 'short-sword-66',
23
+ texturePath: 'swords/short-sword.png',
24
+ textureKey: 'short-sword',
25
+ name: 'Short 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
+ {
43
+ _id: '629acef1c7c8e8002ff73564',
44
+ type: ItemType.Weapon,
45
+ subType: ItemSubType.Bow,
46
+ textureAtlas: 'items',
47
+ allowedEquipSlotType: [ItemSlotType.LeftHand, ItemSlotType.RightHand],
48
+ maxStackSize: 1,
49
+ isUsable: false,
50
+ isStorable: true,
51
+ layer: 1,
52
+ isItemContainer: false,
53
+ isSolid: false,
54
+ key: 'board-sword-22',
55
+ texturePath: 'bows/bow.png',
56
+ textureKey: 'bow',
57
+ name: 'Bow',
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
+ {
73
+ _id: '629acef1c7c8e8002ff60723',
74
+ type: ItemType.Consumable,
75
+ subType: ItemSubType.Potion,
76
+ textureAtlas: 'items',
77
+ allowedEquipSlotType: [ItemSlotType.Inventory],
78
+ isEquipable: false,
79
+ isStackable: true,
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: 'potions/greater-life-potion.png',
89
+ textureKey: 'greater-life-potion',
90
+ name: 'Greater Life Potion',
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
+ {
104
+ _id: '629acek4j7c8e8002ff60034',
105
+ type: ItemType.Consumable,
106
+ subType: ItemSubType.Food,
107
+ textureAtlas: 'items',
108
+ allowedEquipSlotType: [ItemSlotType.Inventory],
109
+ isEquipable: false,
110
+ isStackable: true,
111
+ maxStackSize: 99,
112
+ stackQty: 13,
113
+ isUsable: true,
114
+ isStorable: true,
115
+ layer: 1,
116
+ isItemContainer: false,
117
+ isSolid: false,
118
+ key: 'board-sword-22',
119
+ texturePath: 'potions/mana-potion.png',
120
+ textureKey: 'mana-potion',
121
+ name: 'Mana Potion',
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
+ {
135
+ _id: '629acek4j7c8e8002ff60034',
136
+ type: ItemType.Consumable,
137
+ subType: ItemSubType.Accessory,
138
+ textureAtlas: 'items',
139
+ allowedEquipSlotType: [ItemSlotType.Inventory],
140
+ isEquipable: false,
141
+ isStackable: true,
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: 'accessories/silver-key.png',
151
+ textureKey: 'silver-key',
152
+ name: 'Key',
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
+ {
166
+ _id: '392acek4j7c8e8002ff60403',
167
+ type: ItemType.CraftMaterial,
168
+ subType: ItemSubType.Other,
169
+ textureAtlas: 'items',
170
+ allowedEquipSlotType: [ItemSlotType.Inventory],
171
+ isEquipable: false,
172
+ isStackable: true,
173
+ maxStackSize: 999,
174
+ stackQty: 32,
175
+ isUsable: false,
176
+ isStorable: true,
177
+ layer: 1,
178
+ isItemContainer: false,
179
+ isSolid: false,
180
+ key: 'rune-22',
181
+ texturePath: 'magics/rune.png',
182
+ textureKey: 'rune',
183
+ name: 'Some Shard',
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
+ {
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
+ ];
228
+
229
+ export const itemContainerMock: IItemContainer = {
230
+ _id: '629ba0b6fe3f43002f58f23b',
231
+ name: 'Item Container',
232
+ owner: '629ba0b6fe3f43002f58f23b',
233
+ slotQty: 20,
234
+ slots: {
235
+ 0: items[0],
236
+ 1: items[1],
237
+ 2: items[2],
238
+ 3: items[3],
239
+ 4: items[4],
240
+ 5: items[5],
241
+ 6: items[6],
242
+ //remaining slots are considered null by default
243
+ },
244
+ allowedItemTypes: [],
245
+ parentItem: '629ba0b6fe3f43002f58f239',
246
+ isEmpty: false,
247
+ createdAt: '2022-06-04T18:13:10.581Z',
248
+ updatedAt: '2022-06-04T18:13:10.581Z',
249
+ };
@@ -0,0 +1,4 @@
1
+ export interface IPosition {
2
+ x: number;
3
+ y: number;
4
+ }