@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpg-engine/long-bow",
3
- "version": "0.6.83",
3
+ "version": "0.6.85",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -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
- objectives: (IQuestObjectiveKill | IQuestObjectiveInteraction)[]
109
- ) => {
110
- try {
111
- if (!objectives || !Array.isArray(objectives)) return '';
112
- return objectives
113
- .map(objective => {
114
- if ('killCountTarget' in objective) {
115
- const killObjective = objective as IQuestObjectiveKill;
116
- return `Kill ${formatText(
117
- killObjective.creatureKeys?.join(', ') ?? ''
118
- )}: ${killObjective.killCount ?? 0}/${killObjective.killCountTarget ??
119
- 0}`;
120
- } else if ('targetNPCkey' in objective) {
121
- const interactionObjective = objective as IQuestObjectiveInteraction;
122
- return `Interact with NPC: ${formatText(
123
- interactionObjective.targetNPCkey ?? ''
124
- )}`;
125
- } else {
126
- return '';
127
- }
128
- })
129
- .filter(Boolean)
130
- .join('; ');
131
- } catch (error) {
132
- console.error('Error formatting objectives:', error);
133
- return '';
134
- }
135
- };
136
-
137
- const formatRewards = (rewards: IQuest['rewards']) => {
138
- try {
139
- if (!rewards || !Array.isArray(rewards)) return '';
140
-
141
- return rewards
142
- .map(reward => {
143
- const itemKeysFormatted = reward?.itemKeys
144
- ?.map(itemKey =>
145
- itemKey && reward?.qty !== undefined
146
- ? `${itemKey} x${reward.qty}`
147
- : ''
148
- )
149
- .filter(Boolean)
150
- .join(', ');
151
-
152
- const spellKeysFormatted = reward?.spellKeys
153
- ?.filter(Boolean)
154
- .join(', ');
155
-
156
- const formattedReward = itemKeysFormatted
157
- ? `${formatText(itemKeysFormatted)}`
158
- : '';
159
-
160
- if (spellKeysFormatted) {
161
- return formattedReward
162
- ? `${formattedReward}, Spells: ${formatText(spellKeysFormatted)}`
163
- : `Spells: ${formatText(spellKeysFormatted)}`;
164
- }
165
-
166
- return formattedReward || '';
167
- })
168
- .filter(Boolean)
169
- .join('; ');
170
- } catch (error) {
171
- console.error(
172
- `Error formatting rewards: ${JSON.stringify(rewards)}:`,
173
- error
174
- );
175
- return '';
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 '';