@rpg-engine/long-bow 0.2.7 → 0.2.9
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/dist/components/QuestInfo/QuestInfo.d.ts +9 -9
- package/dist/components/QuestList.d.ts +11 -0
- package/dist/long-bow.cjs.development.js +150 -48
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +150 -48
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/stories/QuestList.stories.d.ts +8 -0
- package/package.json +6 -6
- package/src/components/Character/CharacterSelection.tsx +20 -18
- package/src/components/Item/Inventory/ItemSlot.tsx +31 -11
- package/src/components/PropertySelect/PropertySelect.tsx +9 -1
- package/src/components/QuestInfo/QuestInfo.tsx +149 -46
- package/src/components/QuestList.tsx +124 -0
- package/src/mocks/equipmentSet.mocks.ts +4 -6
- package/src/mocks/itemContainer.mocks.ts +10 -33
- package/src/stories/QuestInfo.stories.tsx +67 -36
- package/src/stories/QuestList.stories.tsx +54 -0
|
@@ -19,6 +19,7 @@ export const items: IItem[] = [
|
|
|
19
19
|
layer: 1,
|
|
20
20
|
isItemContainer: false,
|
|
21
21
|
isSolid: false,
|
|
22
|
+
isTwoHanded: false,
|
|
22
23
|
key: 'short-sword-66',
|
|
23
24
|
texturePath: 'swords/short-sword.png',
|
|
24
25
|
textureKey: 'short-sword',
|
|
@@ -48,6 +49,7 @@ export const items: IItem[] = [
|
|
|
48
49
|
maxStackSize: 1,
|
|
49
50
|
isUsable: false,
|
|
50
51
|
isStorable: true,
|
|
52
|
+
isTwoHanded: false,
|
|
51
53
|
layer: 1,
|
|
52
54
|
isItemContainer: false,
|
|
53
55
|
isSolid: false,
|
|
@@ -78,6 +80,7 @@ export const items: IItem[] = [
|
|
|
78
80
|
isEquipable: false,
|
|
79
81
|
isStackable: true,
|
|
80
82
|
maxStackSize: 99,
|
|
83
|
+
isTwoHanded: false,
|
|
81
84
|
stackQty: 3,
|
|
82
85
|
isUsable: true,
|
|
83
86
|
isStorable: true,
|
|
@@ -112,6 +115,7 @@ export const items: IItem[] = [
|
|
|
112
115
|
stackQty: 13,
|
|
113
116
|
isUsable: true,
|
|
114
117
|
isStorable: true,
|
|
118
|
+
isTwoHanded: false,
|
|
115
119
|
layer: 1,
|
|
116
120
|
isItemContainer: false,
|
|
117
121
|
isSolid: false,
|
|
@@ -140,7 +144,8 @@ export const items: IItem[] = [
|
|
|
140
144
|
isEquipable: false,
|
|
141
145
|
isStackable: true,
|
|
142
146
|
maxStackSize: 999,
|
|
143
|
-
|
|
147
|
+
isTwoHanded: false,
|
|
148
|
+
|
|
144
149
|
isUsable: true,
|
|
145
150
|
isStorable: true,
|
|
146
151
|
layer: 1,
|
|
@@ -174,6 +179,7 @@ export const items: IItem[] = [
|
|
|
174
179
|
stackQty: 32,
|
|
175
180
|
isUsable: false,
|
|
176
181
|
isStorable: true,
|
|
182
|
+
isTwoHanded: false,
|
|
177
183
|
layer: 1,
|
|
178
184
|
isItemContainer: false,
|
|
179
185
|
isSolid: false,
|
|
@@ -193,37 +199,7 @@ export const items: IItem[] = [
|
|
|
193
199
|
createdAt: '2022-06-04T03:18:09.335Z',
|
|
194
200
|
updatedAt: '2022-06-04T18:16:49.056Z',
|
|
195
201
|
},
|
|
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
|
-
// },
|
|
202
|
+
|
|
227
203
|
{
|
|
228
204
|
_id: '392acek4j7c8e8002ff60404',
|
|
229
205
|
type: ItemType.Container,
|
|
@@ -233,9 +209,10 @@ export const items: IItem[] = [
|
|
|
233
209
|
isEquipable: false,
|
|
234
210
|
isStackable: true,
|
|
235
211
|
maxStackSize: 999,
|
|
236
|
-
|
|
212
|
+
|
|
237
213
|
isUsable: false,
|
|
238
214
|
isStorable: true,
|
|
215
|
+
isTwoHanded: false,
|
|
239
216
|
layer: 1,
|
|
240
217
|
isItemContainer: true,
|
|
241
218
|
isSolid: false,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { QuestStatus, QuestType } from '@rpg-engine/shared';
|
|
1
2
|
import { Meta, Story } from '@storybook/react';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import {
|
|
@@ -5,7 +6,6 @@ import {
|
|
|
5
6
|
QuestInfo,
|
|
6
7
|
} from '../../src/components/QuestInfo/QuestInfo';
|
|
7
8
|
import { RPGUIRoot } from '../../src/components/RPGUIRoot';
|
|
8
|
-
|
|
9
9
|
const meta: Meta = {
|
|
10
10
|
title: 'Quest Info',
|
|
11
11
|
component: QuestInfo,
|
|
@@ -25,52 +25,83 @@ const buttonMock = [
|
|
|
25
25
|
{
|
|
26
26
|
disabled: false,
|
|
27
27
|
title: 'Accept',
|
|
28
|
-
onClick: () => console.log(
|
|
28
|
+
onClick: (QuestId: string, NPCId: String) => console.log(QuestId, NPCId),
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
disabled: true,
|
|
32
32
|
title: 'Share',
|
|
33
|
-
onClick: () => console.log(
|
|
33
|
+
onClick: (QuestId: string, NPCId: String) => console.log(QuestId, NPCId),
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
disabled: false,
|
|
37
37
|
title: 'Reject',
|
|
38
|
-
onClick: () => console.log(
|
|
38
|
+
onClick: (QuestId: string, NPCId: String) => console.log(QuestId, NPCId),
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
const IQuestMock = [
|
|
43
|
+
{
|
|
44
|
+
_id: '6317996c77f2420047a20b55',
|
|
45
|
+
rewards: [
|
|
46
|
+
{
|
|
47
|
+
id: '6317996c77f2420047a20b53',
|
|
48
|
+
itemKeys: ['6317996c77f2420047a20b53'],
|
|
49
|
+
spellKeys: ['6317996c77f2420047a20b53'],
|
|
50
|
+
qty: 1,
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
objectives: [
|
|
54
|
+
{
|
|
55
|
+
id: '6317996c77f2420047a20b53',
|
|
56
|
+
type: QuestType.Kill,
|
|
57
|
+
status: QuestStatus.Pending,
|
|
58
|
+
killCount: 10,
|
|
59
|
+
killCountTarget: 30,
|
|
60
|
+
creatureKeys: ['6317996c77f2420047a20b53'],
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
npcId: '6317996b77f2420047a20825',
|
|
64
|
+
title: 'Deliver message to the trader1',
|
|
65
|
+
key: 'interaction-trader',
|
|
66
|
+
description:
|
|
67
|
+
"Need to send a message to my brother, the trader, about my father's health. I cannot do it because it is too dangerous out there. Please, help me by delivering this message to him.",
|
|
68
|
+
createdAt: '2022-09-06T19:03:08.285+0000',
|
|
69
|
+
updatedAt: '2022-09-06T19:03:08.304+0000',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
_id: '6317996c77f2420047a20b55',
|
|
73
|
+
rewards: [
|
|
74
|
+
{
|
|
75
|
+
id: '6317996c77f2420047a20b53',
|
|
76
|
+
itemKeys: ['6317996c77f2420047a20b53'],
|
|
77
|
+
spellKeys: ['6317996c77f2420047a20b53'],
|
|
78
|
+
qty: 1,
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
objectives: [
|
|
82
|
+
{
|
|
83
|
+
id: '6317996c77f2420047a20b53',
|
|
84
|
+
type: QuestType.Kill,
|
|
85
|
+
status: QuestStatus.Pending,
|
|
86
|
+
killCount: 10,
|
|
87
|
+
killCountTarget: 30,
|
|
88
|
+
creatureKeys: ['6317996c77f2420047a20b53'],
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
npcId: '6317996b77f2420047a20825',
|
|
92
|
+
title: 'Deliver message to the trader2',
|
|
93
|
+
key: 'interaction-trader',
|
|
94
|
+
description:
|
|
95
|
+
"Need to send a message to my brother, the trader, about my father's health. I cannot do it because it is too dangerous out there. Please, help me by delivering this message to him.",
|
|
96
|
+
createdAt: '2022-09-06T19:03:08.285+0000',
|
|
97
|
+
updatedAt: '2022-09-06T19:03:08.304+0000',
|
|
39
98
|
},
|
|
40
99
|
];
|
|
41
100
|
|
|
42
101
|
Default.args = {
|
|
43
|
-
title: 'Quest Info',
|
|
44
102
|
onClose: () => console.log('closing'),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<p>
|
|
50
|
-
<strong>Pellentesque habitant morbi tristique</strong> senectus et netus
|
|
51
|
-
et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat
|
|
52
|
-
vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet
|
|
53
|
-
quam egestas semper. <em>Aenean ultricies mi vitae est.</em> Mauris
|
|
54
|
-
placerat eleifend leo. Quisque sit amet est et sapien ullamcorper
|
|
55
|
-
pharetra. Vestibulum erat wisi, condimentum sed,{' '}
|
|
56
|
-
<code>commodo vitae</code>, ornare sit amet, wisi. Aenean fermentum,
|
|
57
|
-
elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus
|
|
58
|
-
lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut
|
|
59
|
-
felis.
|
|
60
|
-
</p>
|
|
61
|
-
<h1>HTML Ipsum Presents</h1>
|
|
62
|
-
<p>
|
|
63
|
-
<strong>Pellentesque habitant morbi tristique</strong> senectus et netus
|
|
64
|
-
et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat
|
|
65
|
-
vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet
|
|
66
|
-
quam egestas semper. <em>Aenean ultricies mi vitae est.</em> Mauris
|
|
67
|
-
placerat eleifend leo. Quisque sit amet est et sapien ullamcorper
|
|
68
|
-
pharetra. Vestibulum erat wisi, condimentum sed,{' '}
|
|
69
|
-
<code>commodo vitae</code>, ornare sit amet, wisi. Aenean fermentum,
|
|
70
|
-
elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus
|
|
71
|
-
lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut
|
|
72
|
-
felis.
|
|
73
|
-
</p>
|
|
74
|
-
</>
|
|
75
|
-
),
|
|
103
|
+
buttons: buttonMock,
|
|
104
|
+
quests: IQuestMock,
|
|
105
|
+
onChangeQuest: (index: number, questId: string) =>
|
|
106
|
+
console.log(index, questId),
|
|
76
107
|
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Story } from '@storybook/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { IQuestListProps, QuestList } from '../components/QuestList';
|
|
4
|
+
import { RPGUIRoot } from '../components/RPGUIRoot';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Quest List',
|
|
8
|
+
component: QuestList,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const Template: Story<IQuestListProps> = args => (
|
|
12
|
+
<RPGUIRoot>
|
|
13
|
+
<QuestList {...args} />
|
|
14
|
+
</RPGUIRoot>
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export const Default = Template.bind({});
|
|
18
|
+
|
|
19
|
+
Default.args = {
|
|
20
|
+
title: 'War of shadows',
|
|
21
|
+
description: 'The shadow of war missin completed',
|
|
22
|
+
quests: [
|
|
23
|
+
{
|
|
24
|
+
title: 'Shrine of the storm: Whispers below',
|
|
25
|
+
description: 'Defeat Lord Stormsong',
|
|
26
|
+
completed: true,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
title: 'Shrine of the storm: Whispers below',
|
|
30
|
+
description: 'Defeat Lord Stormsong',
|
|
31
|
+
completed: false,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
title: 'Shrine of the storm: Whispers below',
|
|
35
|
+
description: 'Defeat Lord Stormsong',
|
|
36
|
+
completed: false,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
title: 'Shrine of the storm: Whispers below',
|
|
40
|
+
description: 'Defeat Lord Stormsong',
|
|
41
|
+
completed: false,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
title: 'Shrine of the storm: Whispers below',
|
|
45
|
+
description: 'Defeat Lord Stormsong',
|
|
46
|
+
completed: false,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
title: 'Shrine of the storm: Whispers below',
|
|
50
|
+
description: 'Defeat Lord Stormsong',
|
|
51
|
+
completed: false,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
};
|