koishi-plugin-smmcat-gensokyo 0.0.14 → 0.0.15

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/lib/props.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Context } from "koishi";
1
+ import { Context, Session } from "koishi";
2
2
  import { Config } from ".";
3
3
  /** 道具信息 */
4
4
  export type UserPropItem = {
@@ -29,6 +29,9 @@ export declare const Props: {
29
29
  init(config: Config, ctx: Context): Promise<void>;
30
30
  /** 创建本地数据 */
31
31
  initUserPropsData(userId: string): Promise<void>;
32
+ /** 获取持有道具信息 */
33
+ getPropsDataByUserId(userId: string): Promise<string>;
32
34
  /** 更新本地数据库对应数据 */
33
35
  setDatabasePropsData(userId: string): Promise<void>;
36
+ userProps(session: Session, propsName: string): Promise<void>;
34
37
  };
package/lib/skillFn.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { BattleAttribute } from "./battle";
2
2
  import { DamageConfig } from "./damage";
3
- import { UserOccupation } from "./users";
4
3
  export declare enum SkillType {
5
4
  释放失败 = "\u91CA\u653E\u5931\u8D25",
6
5
  伤害技 = "\u4F24\u5BB3\u6280",
@@ -8,6 +7,11 @@ export declare enum SkillType {
8
7
  治疗技 = "\u6CBB\u7597\u6280",
9
8
  奥义 = "\u5965\u4E49"
10
9
  }
10
+ export declare enum UserOccupation {
11
+ 剑士 = "\u5251\u58EB",
12
+ 法师 = "\u6CD5\u5E08",
13
+ 刺客 = "\u523A\u5BA2"
14
+ }
11
15
  interface DamageSkillParams {
12
16
  /** 伤害类型 */
13
17
  type: SkillType.伤害技;
package/lib/users.d.ts CHANGED
@@ -1,15 +1,11 @@
1
1
  import { Context, Session } from "koishi";
2
2
  import { Config } from ".";
3
+ import { UserOccupation } from "./skillFn";
3
4
  declare module 'koishi' {
4
5
  interface Tables {
5
6
  smm_gensokyo_user_attribute: DatabaseUserAttribute;
6
7
  }
7
8
  }
8
- export declare enum UserOccupation {
9
- 剑士 = "\u5251\u58EB",
10
- 法师 = "\u6CD5\u5E08",
11
- 刺客 = "\u523A\u5BA2"
12
- }
13
9
  /** 角色基础属性 */
14
10
  export type UserBaseAttribute = {
15
11
  /** 凭据ID */
@@ -108,12 +104,12 @@ export declare const User: {
108
104
  }) => Promise<void>): Promise<void>;
109
105
  /** 给予玩家死亡 */
110
106
  giveDie(userId: string): Promise<void>;
111
- /** 给予玩家恢复 */
107
+ /** 给予玩家复活 */
112
108
  giveLife(userId: string, val?: number): Promise<void>;
113
109
  /** 给予玩家血量或者蓝量 */
114
110
  giveHPMP(userId: string, value: {
115
- hp: number;
116
- mp: number;
111
+ hp?: number;
112
+ mp?: number;
117
113
  }, fn?: (upData: {
118
114
  currentHP: number;
119
115
  currentMP: number;
@@ -123,6 +119,10 @@ export declare const User: {
123
119
  givePP(userId: string, value: number, fn?: (upData: {
124
120
  currentPP: number;
125
121
  }) => Promise<void>): Promise<void>;
122
+ lostPP(userId: string, value: number, fn?: (upData: {
123
+ currentPP: number;
124
+ err?: string;
125
+ }) => Promise<void>): Promise<void>;
126
126
  /** 给予玩家货币 */
127
127
  giveMonetary(userId: string, val: number, fn?: (upData: {
128
128
  val: number;
@@ -135,6 +135,28 @@ export declare const User: {
135
135
  currentVal: number;
136
136
  err?: string;
137
137
  }) => Promise<void>): Promise<void>;
138
+ /** 给予玩家指定道具 */
139
+ giveProps(userId: string, props: {
140
+ name: string;
141
+ val?: number;
142
+ }[], fn?: (upData: {
143
+ currentProps: {
144
+ name: string;
145
+ val: number;
146
+ }[];
147
+ err?: string;
148
+ }) => Promise<void>): Promise<void>;
149
+ /** 去除玩家指定道具 */
150
+ loseProps(userId: string, props: {
151
+ name: string;
152
+ val?: number;
153
+ }, fn?: (upData: {
154
+ currentProps: {
155
+ name: string;
156
+ val: number;
157
+ };
158
+ err?: string;
159
+ }) => Promise<void>): Promise<void>;
138
160
  /** 目标是否死亡 */
139
161
  isDie(userId: string): boolean;
140
162
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-smmcat-gensokyo",
3
3
  "description": "名为《幻想乡》的文字冒险游戏",
4
- "version": "0.0.14",
4
+ "version": "0.0.15",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [