@rpg-engine/long-bow 0.5.12 → 0.5.14
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 +38 -28
- 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 +38 -28
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Spellbook/mockSpells.ts +5 -0
- package/src/components/TradingMenu/TradingItemRow.tsx +45 -35
- package/src/mocks/itemContainer.mocks.ts +35 -30
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpg-engine/long-bow",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.14",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
85
|
"@rollup/plugin-image": "^2.1.1",
|
|
86
|
-
"@rpg-engine/shared": "^0.8.
|
|
86
|
+
"@rpg-engine/shared": "^0.8.83",
|
|
87
87
|
"dayjs": "^1.11.2",
|
|
88
88
|
"font-awesome": "^4.7.0",
|
|
89
89
|
"fs-extra": "^10.1.0",
|
|
@@ -23,6 +23,7 @@ export const mockSpells: ISpell[] = [
|
|
|
23
23
|
targetHitAnimationKey: AnimationEffectKeys.Rooted,
|
|
24
24
|
projectileAnimationKey: AnimationEffectKeys.Energy,
|
|
25
25
|
usableEffect: () => {},
|
|
26
|
+
onlyPremiumAccountType: [],
|
|
26
27
|
},
|
|
27
28
|
{
|
|
28
29
|
key: (SpellsBlueprint.ArrowCreationSpell + '2') as SpellsBlueprint,
|
|
@@ -41,6 +42,7 @@ export const mockSpells: ISpell[] = [
|
|
|
41
42
|
targetHitAnimationKey: AnimationEffectKeys.Rooted,
|
|
42
43
|
projectileAnimationKey: AnimationEffectKeys.Energy,
|
|
43
44
|
usableEffect: () => {},
|
|
45
|
+
onlyPremiumAccountType: [],
|
|
44
46
|
},
|
|
45
47
|
{
|
|
46
48
|
key: (SpellsBlueprint.ArrowCreationSpell + '3') as SpellsBlueprint,
|
|
@@ -59,6 +61,7 @@ export const mockSpells: ISpell[] = [
|
|
|
59
61
|
targetHitAnimationKey: AnimationEffectKeys.Rooted,
|
|
60
62
|
projectileAnimationKey: AnimationEffectKeys.Energy,
|
|
61
63
|
usableEffect: () => {},
|
|
64
|
+
onlyPremiumAccountType: [],
|
|
62
65
|
},
|
|
63
66
|
{
|
|
64
67
|
key: (SpellsBlueprint.ArrowCreationSpell + '4') as SpellsBlueprint,
|
|
@@ -77,6 +80,7 @@ export const mockSpells: ISpell[] = [
|
|
|
77
80
|
targetHitAnimationKey: AnimationEffectKeys.Rooted,
|
|
78
81
|
projectileAnimationKey: AnimationEffectKeys.Energy,
|
|
79
82
|
usableEffect: () => {},
|
|
83
|
+
onlyPremiumAccountType: [],
|
|
80
84
|
},
|
|
81
85
|
{
|
|
82
86
|
key: (SpellsBlueprint.ArrowCreationSpell + '5') as SpellsBlueprint,
|
|
@@ -95,5 +99,6 @@ export const mockSpells: ISpell[] = [
|
|
|
95
99
|
targetHitAnimationKey: AnimationEffectKeys.Rooted,
|
|
96
100
|
projectileAnimationKey: AnimationEffectKeys.Energy,
|
|
97
101
|
usableEffect: () => {},
|
|
102
|
+
onlyPremiumAccountType: [],
|
|
98
103
|
},
|
|
99
104
|
];
|
|
@@ -51,35 +51,41 @@ export const TradingItemRow: React.FC<ITradeComponentProps> = ({
|
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
const renderAccountTypeIndicator = () => {
|
|
54
|
-
if (isBuy) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
54
|
+
if (isBuy && traderItem.canBePurchasedOnlyByPremiumPlans) {
|
|
55
|
+
return traderItem.canBePurchasedOnlyByPremiumPlans.map(accountType => {
|
|
56
|
+
if (accountType !== UserAccountTypes.Free) {
|
|
57
|
+
let backgroundColor;
|
|
58
|
+
let textColor = 'black';
|
|
59
|
+
|
|
60
|
+
switch (accountType) {
|
|
61
|
+
case UserAccountTypes.PremiumBronze:
|
|
62
|
+
backgroundColor = '#CD7F32';
|
|
63
|
+
break;
|
|
64
|
+
case UserAccountTypes.PremiumSilver:
|
|
65
|
+
backgroundColor = '#C0C0C0';
|
|
66
|
+
break;
|
|
67
|
+
case UserAccountTypes.PremiumGold:
|
|
68
|
+
backgroundColor = '#FFD700';
|
|
69
|
+
break;
|
|
70
|
+
case UserAccountTypes.PremiumUltimate:
|
|
71
|
+
backgroundColor = '#002E99';
|
|
72
|
+
break;
|
|
73
|
+
default:
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
|
|
75
77
|
return (
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
<PremiumLabel
|
|
79
|
+
backgroundColor={backgroundColor}
|
|
80
|
+
textColor={textColor}
|
|
81
|
+
key={accountType}
|
|
82
|
+
>
|
|
83
|
+
{capitalize(accountType) + ' PA'}
|
|
84
|
+
</PremiumLabel>
|
|
79
85
|
);
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
86
|
+
}
|
|
87
|
+
return null;
|
|
88
|
+
});
|
|
83
89
|
}
|
|
84
90
|
return null;
|
|
85
91
|
};
|
|
@@ -118,10 +124,10 @@ export const TradingItemRow: React.FC<ITradeComponentProps> = ({
|
|
|
118
124
|
<p>
|
|
119
125
|
<Ellipsis maxLines={1} maxWidth="250px">
|
|
120
126
|
{capitalize(traderItem.name)}
|
|
121
|
-
{renderAccountTypeIndicator()}
|
|
122
127
|
</Ellipsis>
|
|
123
128
|
</p>
|
|
124
129
|
<p>${traderItem.price}</p>
|
|
130
|
+
<p>{renderAccountTypeIndicator()}</p>
|
|
125
131
|
</NameValue>
|
|
126
132
|
</ItemNameContainer>
|
|
127
133
|
<QuantityContainer>
|
|
@@ -159,14 +165,18 @@ export const TradingItemRow: React.FC<ITradeComponentProps> = ({
|
|
|
159
165
|
);
|
|
160
166
|
};
|
|
161
167
|
|
|
162
|
-
|
|
163
|
-
|
|
168
|
+
const PremiumLabel = styled.span<{
|
|
169
|
+
backgroundColor: string;
|
|
170
|
+
textColor: string;
|
|
171
|
+
}>`
|
|
172
|
+
background-color: ${({ backgroundColor }) => backgroundColor};
|
|
173
|
+
color: ${({ textColor }) => textColor};
|
|
174
|
+
font-weight: bold;
|
|
175
|
+
padding: 2px 5px;
|
|
176
|
+
border-radius: 5px;
|
|
177
|
+
margin-right: 5px;
|
|
178
|
+
margin-bottom: 5px;
|
|
164
179
|
display: inline-block;
|
|
165
|
-
margin-left: 8px;
|
|
166
|
-
height: 10px;
|
|
167
|
-
width: 10px;
|
|
168
|
-
background-color: ${({ color }) => color};
|
|
169
|
-
border-radius: 50%;
|
|
170
180
|
`;
|
|
171
181
|
|
|
172
182
|
const StyledArrow = styled(SelectArrow)`
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
ItemSlotType,
|
|
6
6
|
ItemSubType,
|
|
7
7
|
ItemType,
|
|
8
|
+
UserAccountTypes,
|
|
8
9
|
} from '@rpg-engine/shared';
|
|
9
10
|
|
|
10
11
|
export const items: IItem[] = [
|
|
@@ -42,16 +43,20 @@ export const items: IItem[] = [
|
|
|
42
43
|
createdAt: '2022-06-04T03:18:09.335Z',
|
|
43
44
|
updatedAt: '2022-06-04T18:16:49.056Z',
|
|
44
45
|
rarity: ItemRarities.Legendary,
|
|
46
|
+
canBePurchasedOnlyByPremiumPlans: [
|
|
47
|
+
UserAccountTypes.PremiumGold,
|
|
48
|
+
UserAccountTypes.PremiumUltimate,
|
|
49
|
+
],
|
|
45
50
|
minRequirements: {
|
|
46
51
|
level: 10,
|
|
47
52
|
skill: {
|
|
48
53
|
name: 'sword',
|
|
49
54
|
level: 5,
|
|
50
|
-
}
|
|
55
|
+
},
|
|
51
56
|
},
|
|
52
|
-
equippedBuffDescription:
|
|
57
|
+
equippedBuffDescription: 'Character speed +10%',
|
|
53
58
|
entityEffectChance: 50,
|
|
54
|
-
entityEffects: ['freezing']
|
|
59
|
+
entityEffects: ['freezing'],
|
|
55
60
|
},
|
|
56
61
|
{
|
|
57
62
|
_id: '629acef1c7c8e8002ff73564',
|
|
@@ -541,36 +546,36 @@ export const items: IItem[] = [
|
|
|
541
546
|
rarity: ItemRarities.Common,
|
|
542
547
|
},
|
|
543
548
|
{
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
549
|
+
type: ItemType.Consumable,
|
|
550
|
+
subType: ItemSubType.Food,
|
|
551
|
+
rarity: 'Common',
|
|
552
|
+
textureAtlas: 'items',
|
|
553
|
+
allowedEquipSlotType: [],
|
|
554
|
+
maxStackSize: 100,
|
|
555
|
+
isUsable: false,
|
|
556
|
+
isStorable: true,
|
|
557
|
+
isItemContainer: false,
|
|
558
|
+
isSolid: false,
|
|
559
|
+
requiredAmmoKeys: [],
|
|
560
|
+
isTwoHanded: false,
|
|
561
|
+
hasUseWith: false,
|
|
562
|
+
entityEffects: [],
|
|
563
|
+
entityEffectChance: 0,
|
|
564
|
+
_id: '64529049d45546003b2c6c6d',
|
|
565
|
+
key: 'apple',
|
|
566
|
+
texturePath: 'foods/apple.png',
|
|
562
567
|
textureKey: 'apple',
|
|
563
568
|
isEquipable: false,
|
|
564
569
|
isStackable: true,
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
fullDescription:
|
|
572
|
-
usableEffectDescription:
|
|
573
|
-
}
|
|
570
|
+
name: 'Apple',
|
|
571
|
+
description: 'A red apple.',
|
|
572
|
+
weight: 0.05,
|
|
573
|
+
stackQty: 16,
|
|
574
|
+
attack: 0,
|
|
575
|
+
defense: 0,
|
|
576
|
+
fullDescription: '',
|
|
577
|
+
usableEffectDescription: 'Regenerates 10 HP and Mana 5 times',
|
|
578
|
+
},
|
|
574
579
|
];
|
|
575
580
|
|
|
576
581
|
export const itemContainerMock: IItemContainer = {
|