@occultus/condition-api 0.22.0-alpha.4 → 0.22.0-alpha.5

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": "@occultus/condition-api",
3
- "version": "0.22.0-alpha.4",
3
+ "version": "0.22.0-alpha.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://codeberg.org/TeamOccultus/StarTenonAPI"
@@ -7,10 +7,7 @@ import { TextProvider } from "@occultus/text-api";
7
7
  * 定义了条件的基本结构和必须实现的方法,所有具体的条件类都应该继承此抽象类并实现其抽象方法
8
8
  */
9
9
  export abstract class Conditions {
10
- /**
11
- * @param data 条件所需的数据
12
- */
13
- constructor(protected data: unknown) {}
10
+ constructor() {}
14
11
  /**
15
12
  * 检查玩家是否满足条件
16
13
  *
@@ -14,7 +14,7 @@ export class ExpConditions extends Conditions {
14
14
  protected experience: number,
15
15
  protected consumeAmount = false
16
16
  ) {
17
- super(experience);
17
+ super();
18
18
  }
19
19
  check(player: Player) {
20
20
  if (getAllExp(player) >= this.experience) {
@@ -20,7 +20,7 @@ export class ItemConditions extends Conditions {
20
20
  protected amount: number = 1,
21
21
  protected consumeAmount = false
22
22
  ) {
23
- super(itemType);
23
+ super();
24
24
  }
25
25
  /**
26
26
  * 获取条件对应的 ItemStack
@@ -22,7 +22,7 @@ export class ItemTagConditions extends Conditions {
22
22
  protected translateKey: string,
23
23
  protected consumeAmount: boolean = false
24
24
  ) {
25
- super(tag);
25
+ super();
26
26
  }
27
27
  /**
28
28
  * 检查玩家是否符合该条件的要求
@@ -12,7 +12,7 @@ export class KillEntityConditions extends Conditions {
12
12
  * @param entityType 满足条件所需要的实体类型
13
13
  */
14
14
  constructor(public entityType: string) {
15
- super(entityType);
15
+ super();
16
16
  }
17
17
  check(player: Player) {
18
18
  return false;
@@ -14,7 +14,7 @@ export class KillEntityFamilyConditions extends Conditions {
14
14
  public family: string,
15
15
  public localizationKey: string
16
16
  ) {
17
- super(family);
17
+ super();
18
18
  }
19
19
  check(player: Player) {
20
20
  return false;
@@ -13,7 +13,7 @@ export class LevelConditions extends Conditions {
13
13
  protected level: number,
14
14
  protected consumeAmount = false
15
15
  ) {
16
- super(level);
16
+ super();
17
17
  }
18
18
  check(player: Player) {
19
19
  if (player.level >= this.level) {
package/src/index.ts CHANGED
@@ -2,9 +2,9 @@
2
2
  * @module @occultus/condition-api
3
3
  */
4
4
  export * from "./api/ItemConditions";
5
- export * from "./api/KillEntityCondition";
5
+ export * from "./api/KillEntityConditions";
6
6
  export * from "./api/KillEntityFamilyCondition";
7
- export * from "./api/LevelCondition";
7
+ export * from "./api/LevelConditions";
8
8
  export * from "./api/ExpCondition";
9
9
  export * from "./api/ItemTagConditions"
10
10
  export * from "./api/Conditions";