@opfr/raids 0.16.10 → 1.2.0

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 (48) hide show
  1. package/dist/events/callbacks.d.ts +5 -0
  2. package/dist/events/callbacks.d.ts.map +1 -0
  3. package/dist/events/callbacks.js +38 -0
  4. package/dist/events/callbacks.js.map +1 -0
  5. package/dist/events/event.d.ts +7 -0
  6. package/dist/events/event.d.ts.map +1 -0
  7. package/dist/events/event.js +14 -0
  8. package/dist/events/event.js.map +1 -0
  9. package/dist/events/index.d.ts +2 -0
  10. package/dist/events/index.d.ts.map +1 -0
  11. package/dist/events/index.js +9 -0
  12. package/dist/events/index.js.map +1 -0
  13. package/dist/index.d.ts +1 -2
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.es.js +903 -852
  16. package/dist/index.js +1 -1
  17. package/dist/index.js.map +1 -1
  18. package/dist/index.umd.js +8 -8
  19. package/dist/raids/mysteriousIsland.d.ts +2 -3
  20. package/dist/raids/mysteriousIsland.d.ts.map +1 -1
  21. package/dist/raids/mysteriousIsland.js +221 -125
  22. package/dist/raids/mysteriousIsland.js.map +1 -1
  23. package/dist/raids/pirateCave.d.ts +2 -3
  24. package/dist/raids/pirateCave.d.ts.map +1 -1
  25. package/dist/raids/pirateCave.js +162 -96
  26. package/dist/raids/pirateCave.js.map +1 -1
  27. package/dist/raids/resources.d.ts +2 -3
  28. package/dist/raids/resources.d.ts.map +1 -1
  29. package/dist/raids/resources.js +159 -86
  30. package/dist/raids/resources.js.map +1 -1
  31. package/dist/raids/training.d.ts +2 -3
  32. package/dist/raids/training.d.ts.map +1 -1
  33. package/dist/raids/training.js +96 -49
  34. package/dist/raids/training.js.map +1 -1
  35. package/dist/utils.d.ts +4 -5
  36. package/dist/utils.d.ts.map +1 -1
  37. package/dist/utils.js +39 -40
  38. package/dist/utils.js.map +1 -1
  39. package/locales/fr.json +0 -711
  40. package/package.json +17 -14
  41. package/dist/characteristics.d.ts +0 -6
  42. package/dist/characteristics.d.ts.map +0 -1
  43. package/dist/characteristics.js +0 -27
  44. package/dist/characteristics.js.map +0 -1
  45. package/dist/types.d.ts +0 -81
  46. package/dist/types.d.ts.map +0 -1
  47. package/dist/types.js +0 -2
  48. package/dist/types.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opfr/raids",
3
- "version": "0.16.10",
3
+ "version": "1.2.0",
4
4
  "private": false,
5
5
  "description": "OPFR raids",
6
6
  "author": "Matthieu VEIGA",
@@ -8,21 +8,25 @@
8
8
  "prepublish": "npm run build",
9
9
  "build:raids": "node ./scripts/raidBuilder.mjs && npx prettier --write \"src/**/*.{js,mjs,jsx,ts,tsx,json,css,scss}\"",
10
10
  "build:images": "node ./scripts/generateImages.mjs",
11
- "build": "vite build && tsc"
11
+ "build": "vite build && tsc -p tsconfig.build.json"
12
12
  },
13
13
  "peerDependencies": {
14
- "@opfr/emojis": "^0.16.0",
15
- "@opfr/items": "^0.35.7",
16
- "@opfr/translate": "^0.4.0",
17
- "@opfr/utils-lang": "^0.17.0",
18
- "@opfr/utils-type": "^0.18.4"
14
+ "@opfr/definitions": "^1.0.0",
15
+ "@opfr/emojis": "^1.0.0",
16
+ "@opfr/entities": "^1.0.0",
17
+ "@opfr/services": "^1.0.0",
18
+ "@opfr/utils-lang": "^1.0.0",
19
+ "@opfr/utils-type": "^1.0.0",
20
+ "i18next": "^23"
19
21
  },
20
22
  "devDependencies": {
21
- "@opfr/emojis": "^0.16.0",
22
- "@opfr/items": "^0.35.10",
23
- "@opfr/translate": "^0.4.3",
24
- "@opfr/utils-lang": "^0.17.3",
25
- "@opfr/utils-type": "^0.18.7"
23
+ "@opfr/definitions": "^1.1.0",
24
+ "@opfr/emojis": "^1.0.1",
25
+ "@opfr/entities": "^1.2.0",
26
+ "@opfr/services": "^1.0.2",
27
+ "@opfr/utils-lang": "^1.0.1",
28
+ "@opfr/utils-type": "^1.0.1",
29
+ "i18next": "23.16.8"
26
30
  },
27
31
  "main": "./dist/index.umd.js",
28
32
  "module": "./dist/index.es.js",
@@ -37,7 +41,6 @@
37
41
  "./assets/*": "./assets/*"
38
42
  },
39
43
  "files": [
40
- "README.md",
41
44
  "dist",
42
45
  "locales",
43
46
  "assets"
@@ -46,5 +49,5 @@
46
49
  "node_modules",
47
50
  "dist"
48
51
  ],
49
- "gitHead": "3d75a08b966e5099143579f2706860c0cacc31cd"
52
+ "gitHead": "2fb74c32079607d9d87455a6148c9c84f194f6b8"
50
53
  }
@@ -1,6 +0,0 @@
1
- import type { Characteristic } from '@opfr/utils-type';
2
- export declare const getCharacteristicCost: (currentValue: number) => 4 | 2 | 3 | 1;
3
- export declare const getComputedCharacteristicCost: (currentValue: number, pointsWanted: number) => number;
4
- export declare const getComputedCharacteristicValue: (amount: number) => number;
5
- export declare const getAvailableCharacteristicPoints: (characteristics: Record<Characteristic, number>, currentLevel: number) => number;
6
- //# sourceMappingURL=characteristics.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"characteristics.d.ts","sourceRoot":"","sources":["../src/characteristics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAOvD,eAAO,MAAM,qBAAqB,GAAI,cAAc,MAAM,kBAOzD,CAAC;AAEF,eAAO,MAAM,6BAA6B,GACxC,cAAc,MAAM,EACpB,cAAc,MAAM,WASrB,CAAC;AAEF,eAAO,MAAM,8BAA8B,GAAI,QAAQ,MAAM,WAO5D,CAAC;AAEF,eAAO,MAAM,gCAAgC,GAC3C,iBAAiB,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,EAC/C,cAAc,MAAM,WAGyC,CAAC"}
@@ -1,27 +0,0 @@
1
- import { CHARACTERISTIC_DEFAULT_POINT_COST, CHARACTERISTIC_POINT_COSTS, CHARACTERISTIC_POINT_PER_LEVEL, } from '@opfr/utils-type';
2
- export const getCharacteristicCost = (currentValue) => {
3
- for (const [threshold, amount] of CHARACTERISTIC_POINT_COSTS) {
4
- if (currentValue >= threshold) {
5
- return amount;
6
- }
7
- }
8
- return CHARACTERISTIC_DEFAULT_POINT_COST;
9
- };
10
- export const getComputedCharacteristicCost = (currentValue, pointsWanted) => {
11
- let cost = 0;
12
- for (; pointsWanted > 0; pointsWanted--) {
13
- cost += getCharacteristicCost(currentValue);
14
- currentValue++;
15
- }
16
- return cost;
17
- };
18
- export const getComputedCharacteristicValue = (amount) => {
19
- let current = 0;
20
- for (; amount > 0; amount -= getCharacteristicCost(current)) {
21
- current++;
22
- }
23
- return current;
24
- };
25
- export const getAvailableCharacteristicPoints = (characteristics, currentLevel) => currentLevel * CHARACTERISTIC_POINT_PER_LEVEL -
26
- Object.values(characteristics).reduce((acc, e) => acc + e, 0);
27
- //# sourceMappingURL=characteristics.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"characteristics.js","sourceRoot":"","sources":["../src/characteristics.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iCAAiC,EACjC,0BAA0B,EAC1B,8BAA8B,GAC/B,MAAM,kBAAkB,CAAC;AAE1B,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,YAAoB,EAAE,EAAE;IAC5D,KAAK,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,0BAA0B,EAAE,CAAC;QAC7D,IAAI,YAAY,IAAI,SAAS,EAAE,CAAC;YAC9B,OAAO,MAAM,CAAC;QAChB,CAAC;IACH,CAAC;IACD,OAAO,iCAAiC,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC3C,YAAoB,EACpB,YAAoB,EACpB,EAAE;IACF,IAAI,IAAI,GAAG,CAAC,CAAC;IAEb,OAAO,YAAY,GAAG,CAAC,EAAE,YAAY,EAAE,EAAE,CAAC;QACxC,IAAI,IAAI,qBAAqB,CAAC,YAAY,CAAC,CAAC;QAC5C,YAAY,EAAE,CAAC;IACjB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,MAAc,EAAE,EAAE;IAC/D,IAAI,OAAO,GAAG,CAAC,CAAC;IAEhB,OAAO,MAAM,GAAG,CAAC,EAAE,MAAM,IAAI,qBAAqB,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5D,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAC9C,eAA+C,EAC/C,YAAoB,EACpB,EAAE,CACF,YAAY,GAAG,8BAA8B;IAC7C,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC"}
package/dist/types.d.ts DELETED
@@ -1,81 +0,0 @@
1
- import type { Buff, ItemId } from '@opfr/items';
2
- import type { TitleId } from '@opfr/ornaments';
3
- import type { Characteristic, CharacteristicsRecord } from '@opfr/utils-type';
4
- export type RaidRewards = Partial<Record<ItemId | 'xp' | 'berry' | 'hp', number> & {
5
- title: TitleId;
6
- condition: string;
7
- }>;
8
- export type RaidPenalties = Partial<Record<ItemId | 'xp' | 'berry' | 'hp' | 'time_out', number> & {
9
- buffs: Buff[];
10
- }>;
11
- export type RaidRequirements = Partial<CharacteristicsRecord> | {
12
- sum: number;
13
- characteristics: Characteristic[];
14
- } | {
15
- conditions: string[];
16
- mode: 'include' | 'exclude';
17
- } | {
18
- warns: number;
19
- };
20
- export type RaidItemRequirements = Partial<Record<ItemId, number>> | {
21
- conditions: string[];
22
- mode: 'include' | 'exclude';
23
- };
24
- export type RaidStepId = {
25
- UserChoice: `uc_${string}`;
26
- Event: `ev_${string}`;
27
- End: `end_${string}`;
28
- ConditionCheck: `c_${string}`;
29
- ItemRequired: `rq_${string}`;
30
- Goto: `goto_${string}`;
31
- };
32
- export type RaidGoto = {
33
- id: RaidStepId['Goto'];
34
- label: string;
35
- goto: RaidStepId[keyof RaidStepId][];
36
- };
37
- export type RaidUserChoice = {
38
- id: RaidStepId['UserChoice'];
39
- label: string;
40
- output: RaidConditionCheck | RaidEvent | RaidEnd;
41
- };
42
- export type RaidItemRequired = {
43
- id: RaidStepId['ItemRequired'];
44
- label: string;
45
- requirements: RaidItemRequirements;
46
- output: RaidConditionCheck | RaidEvent | RaidEnd;
47
- hideAllIfAvailable?: boolean;
48
- doNotConsume?: boolean;
49
- };
50
- export type RaidEvent = {
51
- id: RaidStepId['Event'];
52
- title: string;
53
- text: string | ((obtainedRewards: (RaidStepId['Event'] | RaidStepId['End'])[]) => string);
54
- rewards?: RaidRewards;
55
- penalties?: RaidPenalties;
56
- outputs: (RaidUserChoice | RaidItemRequired | RaidGoto)[];
57
- };
58
- export type RaidEnd = {
59
- id: RaidStepId['End'];
60
- title: string;
61
- text: string | ((obtainedRewards: (RaidStepId['Event'] | RaidStepId['End'])[]) => string);
62
- rewards?: RaidRewards;
63
- penalties?: RaidPenalties;
64
- };
65
- export type RaidConditionCheck = {
66
- id: RaidStepId['ConditionCheck'];
67
- requirements: RaidRequirements;
68
- success: RaidEvent | RaidEnd;
69
- failure: RaidEvent | RaidEnd;
70
- };
71
- export type RaidType = 'classic' | 'special' | 'christmas';
72
- export type Raid = {
73
- id: string;
74
- cooldown: number;
75
- name: string;
76
- description: string;
77
- type: RaidType;
78
- start: RaidEvent;
79
- };
80
- export type RaidStep = RaidItemRequired | RaidEnd | RaidEvent | RaidUserChoice | RaidConditionCheck | RaidGoto;
81
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/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GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,KACzD,MAAM,CAAC,CAAC;IACjB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,SAAS,CAAC,EAAE,aAAa,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC;IACjC,YAAY,EAAE,gBAAgB,CAAC;IAC/B,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC;IAC7B,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;AAE3D,MAAM,MAAM,IAAI,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAChB,gBAAgB,GAChB,OAAO,GACP,SAAS,GACT,cAAc,GACd,kBAAkB,GAClB,QAAQ,CAAC"}
package/dist/types.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}