@rpg-engine/long-bow 0.6.83 → 0.6.85
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/long-bow.cjs.development.js +66 -42
- 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 +66 -42
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Quests/QuestList.tsx +72 -89
package/package.json
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IQuest,
|
|
3
|
-
IQuestObjectiveInteraction,
|
|
4
|
-
IQuestObjectiveKill,
|
|
5
|
-
QuestStatus,
|
|
6
|
-
} from '@rpg-engine/shared';
|
|
1
|
+
import { IQuest, QuestStatus } from '@rpg-engine/shared';
|
|
7
2
|
import React from 'react';
|
|
8
3
|
import styled from 'styled-components';
|
|
9
4
|
import { uiColors } from '../../constants/uiColors';
|
|
@@ -32,18 +27,6 @@ export const QuestList: React.FC<IQuestListProps> = ({ quests }) => {
|
|
|
32
27
|
<Label>Description:</Label>
|
|
33
28
|
<Value>{quest.description}</Value>
|
|
34
29
|
</QuestItem>
|
|
35
|
-
{quest.objectives && quest.objectives.length > 0 && (
|
|
36
|
-
<QuestItem>
|
|
37
|
-
<Label>Objectives:</Label>
|
|
38
|
-
<Value>{formatObjectives(quest.objectives)}</Value>
|
|
39
|
-
</QuestItem>
|
|
40
|
-
)}
|
|
41
|
-
{quest.rewards && quest.rewards.length > 0 && (
|
|
42
|
-
<QuestItem>
|
|
43
|
-
<Label>Rewards:</Label>
|
|
44
|
-
<Value>{formatRewards(quest.rewards)}</Value>
|
|
45
|
-
</QuestItem>
|
|
46
|
-
)}
|
|
47
30
|
</QuestCard>
|
|
48
31
|
))
|
|
49
32
|
) : (
|
|
@@ -104,77 +87,77 @@ const NoQuestContainer = styled.div`
|
|
|
104
87
|
}
|
|
105
88
|
`;
|
|
106
89
|
|
|
107
|
-
const formatObjectives = (
|
|
108
|
-
|
|
109
|
-
) => {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
const formatRewards = (rewards: IQuest['rewards']) => {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
};
|
|
90
|
+
// const formatObjectives = (
|
|
91
|
+
// objectives: (IQuestObjectiveKill | IQuestObjectiveInteraction)[]
|
|
92
|
+
// ) => {
|
|
93
|
+
// try {
|
|
94
|
+
// if (!objectives || !Array.isArray(objectives)) return '';
|
|
95
|
+
// return objectives
|
|
96
|
+
// .map(objective => {
|
|
97
|
+
// if ('killCountTarget' in objective) {
|
|
98
|
+
// const killObjective = objective as IQuestObjectiveKill;
|
|
99
|
+
// return `Kill ${formatText(
|
|
100
|
+
// killObjective.creatureKeys?.join(', ') ?? ''
|
|
101
|
+
// )}: ${killObjective.killCount ?? 0}/${killObjective.killCountTarget ??
|
|
102
|
+
// 0}`;
|
|
103
|
+
// } else if ('targetNPCkey' in objective) {
|
|
104
|
+
// const interactionObjective = objective as IQuestObjectiveInteraction;
|
|
105
|
+
// return `Interact with NPC: ${formatText(
|
|
106
|
+
// interactionObjective.targetNPCkey ?? ''
|
|
107
|
+
// )}`;
|
|
108
|
+
// } else {
|
|
109
|
+
// return '';
|
|
110
|
+
// }
|
|
111
|
+
// })
|
|
112
|
+
// .filter(Boolean)
|
|
113
|
+
// .join('; ');
|
|
114
|
+
// } catch (error) {
|
|
115
|
+
// console.error('Error formatting objectives:', error);
|
|
116
|
+
// return '';
|
|
117
|
+
// }
|
|
118
|
+
// };
|
|
119
|
+
|
|
120
|
+
// const formatRewards = (rewards: IQuest['rewards']) => {
|
|
121
|
+
// try {
|
|
122
|
+
// if (!rewards || !Array.isArray(rewards)) return '';
|
|
123
|
+
|
|
124
|
+
// return rewards
|
|
125
|
+
// .map(reward => {
|
|
126
|
+
// const itemKeysFormatted = reward?.itemKeys
|
|
127
|
+
// ?.map(itemKey =>
|
|
128
|
+
// itemKey && reward?.qty !== undefined
|
|
129
|
+
// ? `${itemKey} x${reward.qty}`
|
|
130
|
+
// : ''
|
|
131
|
+
// )
|
|
132
|
+
// .filter(Boolean)
|
|
133
|
+
// .join(', ');
|
|
134
|
+
|
|
135
|
+
// const spellKeysFormatted = reward?.spellKeys
|
|
136
|
+
// ?.filter(Boolean)
|
|
137
|
+
// .join(', ');
|
|
138
|
+
|
|
139
|
+
// const formattedReward = itemKeysFormatted
|
|
140
|
+
// ? `${formatText(itemKeysFormatted)}`
|
|
141
|
+
// : '';
|
|
142
|
+
|
|
143
|
+
// if (spellKeysFormatted) {
|
|
144
|
+
// return formattedReward
|
|
145
|
+
// ? `${formattedReward}, Spells: ${formatText(spellKeysFormatted)}`
|
|
146
|
+
// : `Spells: ${formatText(spellKeysFormatted)}`;
|
|
147
|
+
// }
|
|
148
|
+
|
|
149
|
+
// return formattedReward || '';
|
|
150
|
+
// })
|
|
151
|
+
// .filter(Boolean)
|
|
152
|
+
// .join('; ');
|
|
153
|
+
// } catch (error) {
|
|
154
|
+
// console.error(
|
|
155
|
+
// `Error formatting rewards: ${JSON.stringify(rewards)}:`,
|
|
156
|
+
// error
|
|
157
|
+
// );
|
|
158
|
+
// return '';
|
|
159
|
+
// }
|
|
160
|
+
// };
|
|
178
161
|
|
|
179
162
|
const formatText = (text: string) => {
|
|
180
163
|
if (!text) return '';
|