@malib/gear 0.14.0 → 0.15.1

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/internal.d.ts CHANGED
@@ -12,6 +12,12 @@ export * from "./lib/logic/exceptional";
12
12
  export * from "./lib/logic/exceptionalparts";
13
13
  export * from "./lib/logic/scroll";
14
14
  export * from "./lib/logic/upgrade";
15
+ export * from "./lib/create/interfaces/gear";
16
+ export * from "./lib/create/interfaces/itemoption";
17
+ export * from "./lib/create/interfaces/soul";
18
+ export * from "./lib/create/create-gear";
19
+ export * from "./lib/create/create-potential";
20
+ export * from "./lib/create/create-soul";
15
21
  export * from "./lib/migrate/migrate";
16
22
  export * from "./lib/serialize/fromplain";
17
23
  export * from "./lib/serialize/interface";
@@ -0,0 +1,38 @@
1
+ import { Gear, Potential } from "../..";
2
+ import { IPotentialRepository } from "./create-potential";
3
+ import { GearData, GearDataMap } from "./interfaces/gear";
4
+ /**
5
+ * 장비 정보로부터 장비를 생성합니다.
6
+ * @param node 장비 정보 노드.
7
+ * @param id 장비 아이템 ID.
8
+ * @param getPotentialFunc 코드에 해당하는 잠재능력을 반환하는 함수.
9
+ * @returns 아이템 정보에 해당하는 장비.
10
+ */
11
+ export declare function createGearFromNode(node: GearData, id: number, getPotentialFunc: (code: number, potentialLevel: number) => Potential | undefined): Gear;
12
+ export interface IGearRepository {
13
+ ids(): number[];
14
+ createGearFromId(id: number): Gear | undefined;
15
+ }
16
+ export declare class GearRepository implements IGearRepository {
17
+ /**
18
+ * KMS 장비 정보
19
+ */
20
+ private gears;
21
+ private potentialRepository;
22
+ /**
23
+ * @param gears KMS 장비 정보
24
+ * @param
25
+ */
26
+ constructor(gears: GearDataMap, potentialRepository: IPotentialRepository);
27
+ /**
28
+ * 아이템 ID 목록을 반환합니다.
29
+ * @returns 아이템 ID 목록
30
+ */
31
+ ids(): number[];
32
+ /**
33
+ * 아이템 ID로부터 장비를 생성합니다.
34
+ * @param id 장비 아이템 ID.
35
+ * @returns 아이템 ID에 해당하는 장비. 장비가 존재하지 않을 경우 `undefined`를 반환합니다.
36
+ */
37
+ createGearFromId(id: number): Gear | undefined;
38
+ }
@@ -0,0 +1,32 @@
1
+ import { Potential } from "../..";
2
+ import { ItemOption, ItemOptionMap } from "./interfaces/itemoption";
3
+ /**
4
+ * 잠재옵션 정보로부터 잠재옵션을 생성합니다.
5
+ * 잠재옵션에 `incDAMr` 속성과 `boss` 속성이 존재할 경우 `incBDR` 속성으로 대체됩니다.
6
+ * @param node 잠재옵션 정보 노드.
7
+ * @param code 잠재옵션 코드.
8
+ * @param potentialLevel 장비의 착용 가능 레벨로 계산되는 잠재옵션 레벨. `1`부터 `25`까지의 값입니다.
9
+ * @returns 정보에 해당하는 잠재옵션.
10
+ */
11
+ export declare function createPotentialFromNode(node: ItemOption, code: number, potentialLevel: number): Potential;
12
+ export interface IPotentialRepository {
13
+ createPotentialFromCode(code: number, potentialLevel: number): Potential | undefined;
14
+ }
15
+ export declare class PotentialRepository implements IPotentialRepository {
16
+ /**
17
+ * KMS 잠재옵션 정보
18
+ */
19
+ private itemOptions;
20
+ /**
21
+ * @param itemOptions KMS 잠재옵션 정보
22
+ */
23
+ constructor(itemOptions: ItemOptionMap);
24
+ /**
25
+ * 잠재옵션 코드로부터 잠재옵션을 생성합니다.
26
+ * 잠재옵션에 `incDAMr` 속성과 `boss` 속성이 존재할 경우 `incBDR` 속성으로 대체됩니다.
27
+ * @param code 잠재옵션 코드.
28
+ * @param potentialLevel 장비의 착용 가능 레벨로 계산되는 잠재옵션 레벨. `1`부터 `25`까지의 값입니다.
29
+ * @returns 코드에 해당하는 잠재옵션. 존재하지 않을 경우 `undefined`를 반환합니다.
30
+ */
31
+ createPotentialFromCode(code: number, potentialLevel: number): Potential | undefined;
32
+ }
@@ -0,0 +1,56 @@
1
+ import { Soul } from "../..";
2
+ import { SoulData, SoulDataMap } from "./interfaces/soul";
3
+ /**
4
+ * 위대한 소울 옵션 종류
5
+ */
6
+ export declare enum MagnificentSoulOptionType {
7
+ /** 공격력, 공격력% */
8
+ PAD = "PAD",
9
+ /** 마력, 마력% */
10
+ MAD = "MAD",
11
+ /** 올스탯, 올스탯% */
12
+ allStat = "allStat",
13
+ /** 최대 HP */
14
+ MHP = "MHP",
15
+ /** 크리티컬 확률 */
16
+ cr = "cr",
17
+ /** 보스 데미지 */
18
+ bdR = "bdR",
19
+ /** 방어율 무시 */
20
+ imdR = "imdR"
21
+ }
22
+ /**
23
+ * 소울 정보로부터 소울을 생성합니다.
24
+ * @param node 소울 정보.
25
+ * @param type 위대한 소울 옵션 종류. 기본값은 `PAD`입니다.
26
+ * 위대한 소울이 아닐 경우 무시합니다.
27
+ * @returns 정보에 해당하는 소울.
28
+ */
29
+ export declare function createSoulFromNode(node: SoulData, type?: MagnificentSoulOptionType): Soul;
30
+ export interface ISoulRepository {
31
+ ids(): number[];
32
+ createSoulFromId(id: number, ...args: unknown[]): Soul | undefined;
33
+ }
34
+ export declare class SoulRepository implements ISoulRepository {
35
+ /**
36
+ * KMS 소울 정보
37
+ */
38
+ private souls;
39
+ /**
40
+ * @param souls KMS 소울 정보
41
+ */
42
+ constructor(souls: SoulDataMap);
43
+ /**
44
+ * 소울 ID 목록을 반환합니다.
45
+ * @returns 소울 ID 목록
46
+ */
47
+ ids(): number[];
48
+ /**
49
+ * 소울 ID로부터 소울를 생성합니다.
50
+ * @param id 소울 ID.
51
+ * @param type 위대한 소울 옵션 종류. 기본값은 `PAD`입니다.
52
+ * 위대한 소울이 아닐 경우 무시합니다.
53
+ * @returns 정보에 해당하는 소울. 존재하지 않을 경우 `undefined`를 반환합니다.
54
+ */
55
+ createSoulFromId(id: number, type?: MagnificentSoulOptionType): Soul | undefined;
56
+ }
@@ -0,0 +1,27 @@
1
+ export interface GearDataMap {
2
+ [gearID: string]: GearData;
3
+ }
4
+ export interface GearData {
5
+ name: string;
6
+ desc?: string;
7
+ icon: number;
8
+ req?: GearReqData;
9
+ props?: Record<string, number>;
10
+ options?: Record<string, number>;
11
+ tuc?: number;
12
+ etuc?: number;
13
+ pots?: SpecialOptionData[];
14
+ }
15
+ export interface GearReqData {
16
+ level: number;
17
+ str?: number;
18
+ luk?: number;
19
+ dex?: number;
20
+ int?: number;
21
+ job?: number;
22
+ specJob?: number;
23
+ }
24
+ export interface SpecialOptionData {
25
+ option: number;
26
+ level: number;
27
+ }
@@ -0,0 +1,13 @@
1
+ export interface ItemOptionMap {
2
+ [gearID: string]: ItemOption;
3
+ }
4
+ export interface ItemOption {
5
+ optionType?: number;
6
+ reqLevel?: number;
7
+ string: string;
8
+ level: {
9
+ [level: number]: {
10
+ [name: string]: number | string;
11
+ };
12
+ };
13
+ }
@@ -0,0 +1,17 @@
1
+ export interface SoulDataMap {
2
+ [soulID: string]: SoulData;
3
+ }
4
+ export interface SoulData {
5
+ name: string;
6
+ skill: string;
7
+ multiplier: number;
8
+ magnificent?: boolean;
9
+ option?: SoulOption;
10
+ options?: MagnificentSoulOption;
11
+ }
12
+ export interface SoulOption {
13
+ [type: string]: number;
14
+ }
15
+ export interface MagnificentSoulOption {
16
+ [magnificentType: string]: SoulOption;
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malib/gear",
3
- "version": "0.14.0",
3
+ "version": "0.15.1",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",