koishi-plugin-smmcat-gensokyo 0.0.37 → 0.0.39
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/battle.d.ts +4 -0
- package/lib/data/buffFn.d.ts +20 -1
- package/lib/index.js +283 -54
- package/lib/utlis.d.ts +1 -0
- package/package.json +1 -1
package/lib/battle.d.ts
CHANGED
|
@@ -104,8 +104,12 @@ export type BuffGain = {
|
|
|
104
104
|
dizziness?: boolean;
|
|
105
105
|
/** 是否混乱 */
|
|
106
106
|
chaos?: boolean;
|
|
107
|
+
/** 是否沉默 */
|
|
108
|
+
silence?: boolean;
|
|
107
109
|
/** 伤害减免 */
|
|
108
110
|
reduction?: number;
|
|
111
|
+
/** 治疗加成 */
|
|
112
|
+
TreatmentUp?: number;
|
|
109
113
|
};
|
|
110
114
|
/** 最后战斗状态 */
|
|
111
115
|
type LastPlay = {
|
package/lib/data/buffFn.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ interface DeBuffParams {
|
|
|
18
18
|
interface ImprintBuffParams {
|
|
19
19
|
type: BuffType.印记;
|
|
20
20
|
key: string;
|
|
21
|
-
data
|
|
21
|
+
data?: any;
|
|
22
22
|
}
|
|
23
23
|
interface ControlBuffParams {
|
|
24
24
|
type: BuffType.控制;
|
|
@@ -41,7 +41,12 @@ interface BuffConfig<T extends BuffType = BuffType> {
|
|
|
41
41
|
type: T;
|
|
42
42
|
/** 被动说明 */
|
|
43
43
|
info: string;
|
|
44
|
+
/** 印记 */
|
|
45
|
+
key?: string;
|
|
44
46
|
/** 被动函数 */
|
|
47
|
+
initFn?(agent: BattleAttribute, cb?: (val: Extract<BuffItemParams, {
|
|
48
|
+
type: T;
|
|
49
|
+
}>) => void): void;
|
|
45
50
|
fn(agent: BattleAttribute, cb?: (val: Extract<BuffItemParams, {
|
|
46
51
|
type: T;
|
|
47
52
|
}>) => void): void;
|
|
@@ -55,5 +60,19 @@ export declare function giveBuff(agent: BattleAttribute, buff: {
|
|
|
55
60
|
name: string;
|
|
56
61
|
timer: number;
|
|
57
62
|
}): string;
|
|
63
|
+
/** 清除目标指定BUFF */
|
|
64
|
+
export declare function clearBuff(agent: BattleAttribute, buff: {
|
|
65
|
+
name: string;
|
|
66
|
+
}): {
|
|
67
|
+
err: boolean;
|
|
68
|
+
msg: string;
|
|
69
|
+
};
|
|
70
|
+
/** 清除目标指定印记 */
|
|
71
|
+
export declare function clearImprint(agent: BattleAttribute, buff: {
|
|
72
|
+
name: string;
|
|
73
|
+
}): {
|
|
74
|
+
err: boolean;
|
|
75
|
+
msg: string;
|
|
76
|
+
};
|
|
58
77
|
export declare function settlementBuff(agent: BattleAttribute): string;
|
|
59
78
|
export {};
|
package/lib/index.js
CHANGED
|
@@ -35,11 +35,11 @@ var monsterBenchmark = {
|
|
|
35
35
|
maxHp: 1.2,
|
|
36
36
|
mp: 1.1,
|
|
37
37
|
maxMp: 1.1,
|
|
38
|
-
atk: 1.
|
|
38
|
+
atk: 1.1,
|
|
39
39
|
def: 1.1,
|
|
40
40
|
chr: 1.1,
|
|
41
41
|
evasion: 1.1,
|
|
42
|
-
hit: 1.
|
|
42
|
+
hit: 1.01,
|
|
43
43
|
ghd: 1,
|
|
44
44
|
speed: 1.05
|
|
45
45
|
},
|
|
@@ -48,11 +48,11 @@ var monsterBenchmark = {
|
|
|
48
48
|
maxHp: 1.1,
|
|
49
49
|
mp: 1.1,
|
|
50
50
|
maxMp: 1.1,
|
|
51
|
-
atk: 1.
|
|
51
|
+
atk: 1.08,
|
|
52
52
|
def: 1.1,
|
|
53
53
|
chr: 1.08,
|
|
54
|
-
evasion: 1.
|
|
55
|
-
hit: 1.
|
|
54
|
+
evasion: 1.008,
|
|
55
|
+
hit: 1.008,
|
|
56
56
|
ghd: 1,
|
|
57
57
|
speed: 1.05
|
|
58
58
|
},
|
|
@@ -61,11 +61,11 @@ var monsterBenchmark = {
|
|
|
61
61
|
maxHp: 1.08,
|
|
62
62
|
mp: 1.05,
|
|
63
63
|
maxMp: 1.05,
|
|
64
|
-
atk: 1.
|
|
64
|
+
atk: 1.05,
|
|
65
65
|
def: 1.05,
|
|
66
66
|
chr: 1.05,
|
|
67
|
-
evasion: 1.
|
|
68
|
-
hit: 1.
|
|
67
|
+
evasion: 1.005,
|
|
68
|
+
hit: 1.005,
|
|
69
69
|
ghd: 1.05,
|
|
70
70
|
speed: 1.05
|
|
71
71
|
}
|
|
@@ -73,38 +73,38 @@ var monsterBenchmark = {
|
|
|
73
73
|
var userBenchmark = {
|
|
74
74
|
10: {
|
|
75
75
|
maxExp: 1.5,
|
|
76
|
-
maxHp: 1.
|
|
77
|
-
maxMp: 1.
|
|
78
|
-
atk: 1.
|
|
76
|
+
maxHp: 1.13,
|
|
77
|
+
maxMp: 1.13,
|
|
78
|
+
atk: 1.1,
|
|
79
79
|
def: 1.1,
|
|
80
80
|
chr: 1.08,
|
|
81
|
-
evasion: 1.
|
|
82
|
-
hit: 1.
|
|
81
|
+
evasion: 1.009,
|
|
82
|
+
hit: 1.008,
|
|
83
83
|
ghd: 1,
|
|
84
84
|
speed: 1.05
|
|
85
85
|
},
|
|
86
86
|
20: {
|
|
87
87
|
maxExp: 1.3,
|
|
88
|
-
maxHp: 1.
|
|
89
|
-
maxMp: 1.
|
|
90
|
-
atk: 1.
|
|
88
|
+
maxHp: 1.08,
|
|
89
|
+
maxMp: 1.08,
|
|
90
|
+
atk: 1.08,
|
|
91
91
|
def: 1.1,
|
|
92
92
|
chr: 1.04,
|
|
93
|
-
evasion: 1.
|
|
94
|
-
hit: 1.
|
|
93
|
+
evasion: 1.005,
|
|
94
|
+
hit: 1.004,
|
|
95
95
|
ghd: 1,
|
|
96
96
|
speed: 1.05
|
|
97
97
|
},
|
|
98
98
|
40: {
|
|
99
|
-
maxExp: 1.
|
|
100
|
-
maxHp: 1.
|
|
99
|
+
maxExp: 1.2,
|
|
100
|
+
maxHp: 1.05,
|
|
101
101
|
maxMp: 1.05,
|
|
102
|
-
atk: 1.
|
|
102
|
+
atk: 1.05,
|
|
103
103
|
def: 1.05,
|
|
104
104
|
chr: 1.03,
|
|
105
|
-
evasion: 1.
|
|
106
|
-
hit: 1.
|
|
107
|
-
ghd: 1.
|
|
105
|
+
evasion: 1.003,
|
|
106
|
+
hit: 1.003,
|
|
107
|
+
ghd: 1.005,
|
|
108
108
|
speed: 1.05
|
|
109
109
|
}
|
|
110
110
|
};
|
|
@@ -128,7 +128,7 @@ var monsterData = {
|
|
|
128
128
|
chr: 50,
|
|
129
129
|
csr: 0,
|
|
130
130
|
evasion: 100,
|
|
131
|
-
hit:
|
|
131
|
+
hit: 1e3,
|
|
132
132
|
ghd: 1.2,
|
|
133
133
|
speed: 4,
|
|
134
134
|
giveExp: 10,
|
|
@@ -152,7 +152,7 @@ var monsterData = {
|
|
|
152
152
|
chr: 50,
|
|
153
153
|
csr: 0,
|
|
154
154
|
evasion: 150,
|
|
155
|
-
hit:
|
|
155
|
+
hit: 1e3,
|
|
156
156
|
ghd: 1.2,
|
|
157
157
|
speed: 4,
|
|
158
158
|
giveExp: 12,
|
|
@@ -175,7 +175,7 @@ var monsterData = {
|
|
|
175
175
|
chr: 200,
|
|
176
176
|
csr: 0,
|
|
177
177
|
evasion: 200,
|
|
178
|
-
hit:
|
|
178
|
+
hit: 1e3,
|
|
179
179
|
ghd: 1.2,
|
|
180
180
|
speed: 4,
|
|
181
181
|
giveExp: 15,
|
|
@@ -200,7 +200,7 @@ var monsterData = {
|
|
|
200
200
|
chr: 100,
|
|
201
201
|
csr: 0,
|
|
202
202
|
evasion: 100,
|
|
203
|
-
hit:
|
|
203
|
+
hit: 200,
|
|
204
204
|
ghd: 1.2,
|
|
205
205
|
speed: 4,
|
|
206
206
|
giveExp: 15,
|
|
@@ -223,7 +223,7 @@ var monsterData = {
|
|
|
223
223
|
chr: 100,
|
|
224
224
|
csr: 0,
|
|
225
225
|
evasion: 100,
|
|
226
|
-
hit:
|
|
226
|
+
hit: 600,
|
|
227
227
|
ghd: 1.2,
|
|
228
228
|
speed: 5,
|
|
229
229
|
giveExp: 15,
|
|
@@ -246,7 +246,7 @@ var monsterData = {
|
|
|
246
246
|
chr: 100,
|
|
247
247
|
csr: 0,
|
|
248
248
|
evasion: 200,
|
|
249
|
-
hit:
|
|
249
|
+
hit: 1100,
|
|
250
250
|
ghd: 1.5,
|
|
251
251
|
speed: 6,
|
|
252
252
|
giveExp: 20,
|
|
@@ -270,7 +270,7 @@ var monsterData = {
|
|
|
270
270
|
chr: 120,
|
|
271
271
|
csr: 0,
|
|
272
272
|
evasion: 100,
|
|
273
|
-
hit:
|
|
273
|
+
hit: 1030,
|
|
274
274
|
ghd: 1.6,
|
|
275
275
|
speed: 5,
|
|
276
276
|
giveExp: 16,
|
|
@@ -294,7 +294,7 @@ var monsterData = {
|
|
|
294
294
|
chr: 150,
|
|
295
295
|
csr: 0,
|
|
296
296
|
evasion: 150,
|
|
297
|
-
hit:
|
|
297
|
+
hit: 1300,
|
|
298
298
|
ghd: 1.6,
|
|
299
299
|
speed: 8,
|
|
300
300
|
giveExp: 20,
|
|
@@ -303,6 +303,30 @@ var monsterData = {
|
|
|
303
303
|
{ name: "初级复活卷轴", val: 1, radomVal: 50 }
|
|
304
304
|
],
|
|
305
305
|
fn: [{ name: "恐怖催眠术", prob: 1 }, { name: "恐怖的回忆", prob: 2 }]
|
|
306
|
+
},
|
|
307
|
+
"古明地恋": {
|
|
308
|
+
name: "古明地恋",
|
|
309
|
+
type: "BOSS" /* BOSS */,
|
|
310
|
+
info: "她与觉一样拥有读心术,但她知道人们讨厌这种能力,因此将能读心的第三只眼紧闭着",
|
|
311
|
+
pic: "http://smmcat.cn/run/gensokyo/古明地恋.png",
|
|
312
|
+
hp: 135,
|
|
313
|
+
maxHp: 135,
|
|
314
|
+
mp: 140,
|
|
315
|
+
maxMp: 140,
|
|
316
|
+
atk: 5,
|
|
317
|
+
def: 2,
|
|
318
|
+
chr: 150,
|
|
319
|
+
csr: 0,
|
|
320
|
+
evasion: 200,
|
|
321
|
+
hit: 1300,
|
|
322
|
+
ghd: 1.6,
|
|
323
|
+
speed: 8,
|
|
324
|
+
giveExp: 20,
|
|
325
|
+
giveMonetary: 8,
|
|
326
|
+
giveProps: [
|
|
327
|
+
{ name: "大红药", val: 2, radomVal: 50 }
|
|
328
|
+
],
|
|
329
|
+
fn: [{ name: "紧闭的恋之瞳", prob: 3 }, { name: "初级驱散", prob: 1 }, { name: "无意识行动", prob: 2 }]
|
|
306
330
|
}
|
|
307
331
|
};
|
|
308
332
|
|
|
@@ -357,9 +381,6 @@ var Monster = {
|
|
|
357
381
|
const monster = Monster.monsterTempData[monsterName];
|
|
358
382
|
if (!monster) return null;
|
|
359
383
|
const temp = { lv, ...monster };
|
|
360
|
-
const lvScope = Object.keys(monsterBenchmark).reverse().find((item) => Number(item) < lv) || 10;
|
|
361
|
-
const useBenchmark = monsterBenchmark[lvScope];
|
|
362
|
-
console.log(useBenchmark);
|
|
363
384
|
if (lv <= 1) {
|
|
364
385
|
return temp;
|
|
365
386
|
}
|
|
@@ -413,7 +434,7 @@ var Monster = {
|
|
|
413
434
|
【防御力】${def}
|
|
414
435
|
【闪避值】${evasion}
|
|
415
436
|
【速度值】${speed}
|
|
416
|
-
【命中率】${(hit / 10
|
|
437
|
+
【命中率】${(100 + (hit - 1e3) / 10).toFixed(1)}%
|
|
417
438
|
【暴击率】${(chr / 10).toFixed(1)}%
|
|
418
439
|
【爆伤倍率】${(ghd * 100).toFixed(0)}%` + (propsList?.length ? `
|
|
419
440
|
【概率掉落道具】` + propsList.join("、") : "") + (info ? "\n\n" + info : "");
|
|
@@ -517,7 +538,7 @@ var Damage = class {
|
|
|
517
538
|
const { self, goal } = this.config.agent;
|
|
518
539
|
if (this.config.isRealHarm) return this;
|
|
519
540
|
const lvSup = /* @__PURE__ */ __name(() => Math.floor((goal.lv - self.lv) / 5) * 20, "lvSup");
|
|
520
|
-
const evaVal = Math.min(95, (goal.evasion + goal.gain.evasion - self.hit + lvSup()) / 10);
|
|
541
|
+
const evaVal = Math.min(95, (goal.evasion + goal.gain.evasion - (self.hit - 1e3) + lvSup()) / 10);
|
|
521
542
|
if (random(0, 100) <= evaVal) {
|
|
522
543
|
this.config.isEvasion = true;
|
|
523
544
|
fn && fn(this.config);
|
|
@@ -690,6 +711,17 @@ var BuffFn = {
|
|
|
690
711
|
});
|
|
691
712
|
}, "fn")
|
|
692
713
|
},
|
|
714
|
+
"沉默": {
|
|
715
|
+
name: "沉默",
|
|
716
|
+
type: "控制" /* 控制 */,
|
|
717
|
+
info: "该回合将只能进行普攻",
|
|
718
|
+
fn: /* @__PURE__ */ __name(function(agent, fn) {
|
|
719
|
+
fn && fn({
|
|
720
|
+
type: "控制" /* 控制 */,
|
|
721
|
+
name: this.name
|
|
722
|
+
});
|
|
723
|
+
}, "fn")
|
|
724
|
+
},
|
|
693
725
|
"强壮": {
|
|
694
726
|
name: "强壮",
|
|
695
727
|
type: "增益" /* 增益 */,
|
|
@@ -730,18 +762,64 @@ var BuffFn = {
|
|
|
730
762
|
}
|
|
731
763
|
});
|
|
732
764
|
}, "fn")
|
|
765
|
+
},
|
|
766
|
+
"咒": {
|
|
767
|
+
name: "咒",
|
|
768
|
+
type: "印记" /* 印记 */,
|
|
769
|
+
info: "拥有三个咒,目标玩家将即死",
|
|
770
|
+
key: "curse-buff",
|
|
771
|
+
initFn: /* @__PURE__ */ __name(function(agent, fn) {
|
|
772
|
+
if (!agent.expand["curse-buff"]) agent.expand["curse-buff"] = { val: 0 };
|
|
773
|
+
agent.expand["curse-buff"].val++;
|
|
774
|
+
}, "initFn"),
|
|
775
|
+
fn: /* @__PURE__ */ __name(function(agent, fn) {
|
|
776
|
+
fn && fn({
|
|
777
|
+
type: "印记" /* 印记 */,
|
|
778
|
+
key: "curse-buff",
|
|
779
|
+
data: {
|
|
780
|
+
msg: `印记 ⌈咒⌋ 存在${agent.expand["curse-buff"].val}个`
|
|
781
|
+
}
|
|
782
|
+
});
|
|
783
|
+
}, "fn")
|
|
733
784
|
}
|
|
734
785
|
};
|
|
735
786
|
function giveBuff(agent, buff) {
|
|
736
787
|
const buffInfo = BuffFn[buff.name] || null;
|
|
737
788
|
if (!buffInfo) return;
|
|
789
|
+
if (buffInfo.type == "印记" /* 印记 */) {
|
|
790
|
+
buffInfo?.initFn(agent);
|
|
791
|
+
}
|
|
738
792
|
let again = false;
|
|
739
793
|
if (agent.buff[buff.name]) again = true;
|
|
740
794
|
agent.buff[buff.name] = buff;
|
|
741
795
|
const dict = { 1: "¹", 2: "²", 3: "³", 4: "⁴", 5: "⁵", 6: "⁶", 7: "⁷", 8: "⁸", 9: "⁹" };
|
|
742
|
-
return `${getLineupName(agent)}被挂上了${buff.name}${dict[buff.timer] || "⁺"}`;
|
|
796
|
+
return again ? `${getLineupName(agent)}被再次挂上了${buff.name}${dict[buff.timer] || "⁺"}` : `${getLineupName(agent)}被挂上了${buff.name}${dict[buff.timer] || "⁺"}`;
|
|
743
797
|
}
|
|
744
798
|
__name(giveBuff, "giveBuff");
|
|
799
|
+
function clearBuff(agent, buff) {
|
|
800
|
+
const buffInfo = BuffFn[buff.name] || null;
|
|
801
|
+
if (!buffInfo) return;
|
|
802
|
+
if (buffInfo.type == "印记" /* 印记 */) {
|
|
803
|
+
return { err: true, msg: "清除失败,印记无法被驱除" };
|
|
804
|
+
}
|
|
805
|
+
if (agent.buff[buff.name]) {
|
|
806
|
+
delete agent.buff[buff.name];
|
|
807
|
+
return { err: false, msg: `清除${buffInfo.name}成功!` };
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
__name(clearBuff, "clearBuff");
|
|
811
|
+
function clearImprint(agent, buff) {
|
|
812
|
+
const buffInfo = BuffFn[buff.name] || null;
|
|
813
|
+
if (!buffInfo) return;
|
|
814
|
+
if (buffInfo.type !== "印记" /* 印记 */) {
|
|
815
|
+
return { err: true, msg: "清除失败,非印记" };
|
|
816
|
+
}
|
|
817
|
+
if (agent.buff[buff.name]) {
|
|
818
|
+
delete agent.buff[buff.name];
|
|
819
|
+
delete agent.expand[buffInfo.key];
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
__name(clearImprint, "clearImprint");
|
|
745
823
|
function settlementBuff(agent) {
|
|
746
824
|
if (agent.hp <= 0) return null;
|
|
747
825
|
agent.gain.atk = 0;
|
|
@@ -816,12 +894,16 @@ function settlementBuff(agent) {
|
|
|
816
894
|
break;
|
|
817
895
|
case "控制" /* 控制 */:
|
|
818
896
|
buffInfo.fn(agent, (val) => {
|
|
819
|
-
const control = { "晕眩": "dizziness", "控制": "chaos" };
|
|
897
|
+
const control = { "晕眩": "dizziness", "控制": "chaos", "沉默": "silence" };
|
|
820
898
|
if (!control[val.name]) return;
|
|
821
899
|
agent.gain[control[val.name]] = true;
|
|
822
|
-
|
|
900
|
+
msgList.push(`当前正在${val.name}中...`);
|
|
823
901
|
});
|
|
824
902
|
break;
|
|
903
|
+
case "印记" /* 印记 */:
|
|
904
|
+
buffInfo.fn(agent, (val) => {
|
|
905
|
+
msgList.push(val.data.msg);
|
|
906
|
+
});
|
|
825
907
|
default:
|
|
826
908
|
break;
|
|
827
909
|
}
|
|
@@ -1064,6 +1146,104 @@ var skillFn = {
|
|
|
1064
1146
|
});
|
|
1065
1147
|
return `${getLineupName(agent.self)} 发动恐怖的回忆!对 ${getLineupName(agent.goal)} 附加了2回合破绽状态。`;
|
|
1066
1148
|
}, "fn")
|
|
1149
|
+
},
|
|
1150
|
+
"初级驱散": {
|
|
1151
|
+
name: "初级驱散",
|
|
1152
|
+
type: "治疗技" /* 治疗技 */,
|
|
1153
|
+
info: "[治疗技]随机驱散目标1-2个负面BUFF,每个负面BUFF回复10%血量",
|
|
1154
|
+
lv: 5,
|
|
1155
|
+
mp: 40,
|
|
1156
|
+
fn: /* @__PURE__ */ __name(function(agent, agentList, fn) {
|
|
1157
|
+
const selectGoal = agent.goal;
|
|
1158
|
+
if (selectGoal.hp <= 0) {
|
|
1159
|
+
return `${getLineupName(agent.self)}已阵亡...`;
|
|
1160
|
+
}
|
|
1161
|
+
const deBuffList = Object.keys(selectGoal.buff).filter((buff) => {
|
|
1162
|
+
return ["减益" /* 减益 */, "伤害" /* 伤害 */, "控制" /* 控制 */].includes(BuffFn[buff].type);
|
|
1163
|
+
});
|
|
1164
|
+
if (deBuffList.length) {
|
|
1165
|
+
return `${getLineupName(agent.self)}释放初级驱散,对${getLineupName(selectGoal)}似乎没什么作用...`;
|
|
1166
|
+
}
|
|
1167
|
+
let upVal = 0;
|
|
1168
|
+
const selectBuff = getFreeList(deBuffList).slice(0, random(1, 2));
|
|
1169
|
+
selectBuff.forEach((buffName) => {
|
|
1170
|
+
const type = clearBuff(selectGoal, { name: buffName });
|
|
1171
|
+
!type.err && upVal++;
|
|
1172
|
+
});
|
|
1173
|
+
let value = Math.floor(upVal * (selectGoal.maxHp * 0.1));
|
|
1174
|
+
fn({
|
|
1175
|
+
value,
|
|
1176
|
+
target: [selectGoal],
|
|
1177
|
+
type: "治疗技" /* 治疗技 */,
|
|
1178
|
+
isNext: false
|
|
1179
|
+
});
|
|
1180
|
+
return `${getLineupName(agent.self)}释放初级驱散,${getLineupName(agent.goal)}被驱散了${upVal}个负面状态,并恢复${value}HP`;
|
|
1181
|
+
}, "fn")
|
|
1182
|
+
},
|
|
1183
|
+
"紧闭的恋之瞳": {
|
|
1184
|
+
name: "紧闭的恋之瞳",
|
|
1185
|
+
type: "减益技" /* 减益技 */,
|
|
1186
|
+
info: "[减益技]怪物特有技能:为玩家目标添加5回合的⌈咒⌋印记,当对方持有3个⌈咒⌋印记,将直接死亡。",
|
|
1187
|
+
lv: 5,
|
|
1188
|
+
mp: 40,
|
|
1189
|
+
fn: /* @__PURE__ */ __name(function(agent, agentList, fn) {
|
|
1190
|
+
if (agent.self.type == "玩家" || agent.goal.type == "怪物") {
|
|
1191
|
+
fn({
|
|
1192
|
+
type: "释放失败" /* 释放失败 */,
|
|
1193
|
+
isNext: true,
|
|
1194
|
+
err: "释放失败,技能只能怪物指向玩家。"
|
|
1195
|
+
});
|
|
1196
|
+
return ``;
|
|
1197
|
+
}
|
|
1198
|
+
giveBuff(agent.goal, { name: "咒", timer: 5 });
|
|
1199
|
+
const key = BuffFn["咒"].key;
|
|
1200
|
+
fn({
|
|
1201
|
+
type: "减益技" /* 减益技 */,
|
|
1202
|
+
isNext: false
|
|
1203
|
+
});
|
|
1204
|
+
if (agent.goal.expand[key].val >= 3) {
|
|
1205
|
+
agent.goal.hp = 0;
|
|
1206
|
+
clearImprint(agent.goal, { name: "咒" });
|
|
1207
|
+
return `${getLineupName(agent.self)}释放紧闭的恋之瞳,目标⌈咒⌋层达到3层,目标立即死亡`;
|
|
1208
|
+
}
|
|
1209
|
+
return `${getLineupName(agent.self)}释放紧闭的恋之瞳,目标⌈咒⌋层数${agent.goal.expand[key].val}层`;
|
|
1210
|
+
}, "fn")
|
|
1211
|
+
},
|
|
1212
|
+
"无意识行动": {
|
|
1213
|
+
name: "无意识行动",
|
|
1214
|
+
type: "伤害技" /* 伤害技 */,
|
|
1215
|
+
info: "[减益技]怪物特有技能:只有关闭恋の瞳的妖怪可用。造成(攻击1.5倍+自身闪避值5%)伤害,造成伤害有60%概率使其沉默2回合。",
|
|
1216
|
+
lv: 5,
|
|
1217
|
+
mp: 40,
|
|
1218
|
+
fn: /* @__PURE__ */ __name(function(agent, agentList, fn) {
|
|
1219
|
+
if (agent.self.type == "玩家" || agent.goal.type == "怪物") {
|
|
1220
|
+
fn({
|
|
1221
|
+
type: "释放失败" /* 释放失败 */,
|
|
1222
|
+
isNext: true,
|
|
1223
|
+
err: "释放失败,技能只能怪物指向玩家。"
|
|
1224
|
+
});
|
|
1225
|
+
return ``;
|
|
1226
|
+
}
|
|
1227
|
+
let useBuff = false;
|
|
1228
|
+
const damageData = new Damage(agent).result({
|
|
1229
|
+
before: /* @__PURE__ */ __name((val) => {
|
|
1230
|
+
val.default_harm += Math.floor(val.default_harm * 0.2) + Math.floor((val.agent.self.speed + val.agent.self.gain.speed) * 0.05);
|
|
1231
|
+
}, "before"),
|
|
1232
|
+
beforEnd: /* @__PURE__ */ __name((val) => {
|
|
1233
|
+
if (val.harm && random(0, 10) < 6) {
|
|
1234
|
+
useBuff = true;
|
|
1235
|
+
giveBuff(agent.goal, { name: "沉默", timer: 3 });
|
|
1236
|
+
}
|
|
1237
|
+
}, "beforEnd")
|
|
1238
|
+
});
|
|
1239
|
+
fn({
|
|
1240
|
+
type: "伤害技" /* 伤害技 */,
|
|
1241
|
+
damage: damageData,
|
|
1242
|
+
isNext: false,
|
|
1243
|
+
target: [agent.goal]
|
|
1244
|
+
});
|
|
1245
|
+
return `${getLineupName(agent.self)} 发动无意识行动!对 ${getLineupName(agent.goal)} 造成 ${damageData.harm} 伤害。${useBuff ? "(沉默)" : ""}` + moreDamageInfo(damageData);
|
|
1246
|
+
}, "fn")
|
|
1067
1247
|
}
|
|
1068
1248
|
};
|
|
1069
1249
|
|
|
@@ -1435,7 +1615,7 @@ MP:${item.mp}/${item.maxMp + item.gain.maxMp}`);
|
|
|
1435
1615
|
selectGoal = lifeGoalList[Math.floor(Math.random() * lifeGoalList.length)];
|
|
1436
1616
|
} else {
|
|
1437
1617
|
selectGoal = lifeGoalList[Math.floor(Math.random() * lifeGoalList.length)];
|
|
1438
|
-
if (random(0, 10) <
|
|
1618
|
+
if (random(0, 10) < 10 && agent.fn?.length) {
|
|
1439
1619
|
funType = getSkillFn(agent.fn);
|
|
1440
1620
|
}
|
|
1441
1621
|
}
|
|
@@ -1451,10 +1631,10 @@ MP:${item.mp}/${item.maxMp + item.gain.maxMp}`);
|
|
|
1451
1631
|
`${getLineupName(agent)} 使用普攻攻击了 ${getLineupName(selectGoal)},造成了${damageInfo.harm}伤害。` + moreDamageInfo(damageInfo)
|
|
1452
1632
|
);
|
|
1453
1633
|
}, "noralAtk");
|
|
1454
|
-
if (funType == "普攻") {
|
|
1634
|
+
if (funType == "普攻" || agent.gain.silence) {
|
|
1455
1635
|
noralAtk();
|
|
1456
1636
|
} else {
|
|
1457
|
-
if (skillFn[funType]) {
|
|
1637
|
+
if (skillFn[funType] && skillFn[funType].lv <= agent.lv) {
|
|
1458
1638
|
let _selectGoal = selectGoal;
|
|
1459
1639
|
if (["治疗技" /* 治疗技 */, "增益技" /* 增益技 */].includes(skillFn[funType].type)) {
|
|
1460
1640
|
_selectGoal = lifeSelfList.find((item) => item.name == select) || agent;
|
|
@@ -1475,12 +1655,16 @@ MP:${item.mp}/${item.maxMp + item.gain.maxMp}`);
|
|
|
1475
1655
|
break;
|
|
1476
1656
|
case "治疗技" /* 治疗技 */:
|
|
1477
1657
|
val.target.map((goal) => {
|
|
1658
|
+
val.value += val.value * (1 - agent.gain.TreatmentUp);
|
|
1478
1659
|
giveCure(goal, val.value);
|
|
1479
1660
|
});
|
|
1480
1661
|
break;
|
|
1481
1662
|
case "增益技" /* 增益技 */:
|
|
1482
1663
|
isMy && val.err && session.send(val.err);
|
|
1483
1664
|
break;
|
|
1665
|
+
case "减益技" /* 减益技 */:
|
|
1666
|
+
isMy && val.err && session.send(val.err);
|
|
1667
|
+
break;
|
|
1484
1668
|
case "释放失败" /* 释放失败 */:
|
|
1485
1669
|
isMy && val.err && session.send(val.err);
|
|
1486
1670
|
default:
|
|
@@ -1496,8 +1680,13 @@ MP:${item.mp}/${item.maxMp + item.gain.maxMp}`);
|
|
|
1496
1680
|
noralAtk();
|
|
1497
1681
|
}
|
|
1498
1682
|
} else {
|
|
1499
|
-
|
|
1500
|
-
|
|
1683
|
+
if (skillFn[funType] && skillFn[funType].lv > agent.lv) {
|
|
1684
|
+
isMy && await session.send(`释放技能等级要求不足(Lv.${skillFn[funType].lv}),释放失败!`);
|
|
1685
|
+
noralAtk();
|
|
1686
|
+
} else {
|
|
1687
|
+
isMy && await session.send(`未持有该技能,释放失败!`);
|
|
1688
|
+
noralAtk();
|
|
1689
|
+
}
|
|
1501
1690
|
}
|
|
1502
1691
|
}
|
|
1503
1692
|
}
|
|
@@ -1647,6 +1836,8 @@ function initBattleAttribute(data) {
|
|
|
1647
1836
|
speed: 0,
|
|
1648
1837
|
chaos: false,
|
|
1649
1838
|
dizziness: false,
|
|
1839
|
+
silence: false,
|
|
1840
|
+
TreatmentUp: 0,
|
|
1650
1841
|
reduction: 0
|
|
1651
1842
|
},
|
|
1652
1843
|
buff: {},
|
|
@@ -1686,12 +1877,17 @@ function initBattleAttribute(data) {
|
|
|
1686
1877
|
speed: 0,
|
|
1687
1878
|
chaos: false,
|
|
1688
1879
|
dizziness: false,
|
|
1880
|
+
silence: false,
|
|
1881
|
+
TreatmentUp: 0,
|
|
1689
1882
|
reduction: 0
|
|
1690
1883
|
},
|
|
1691
1884
|
buff: {},
|
|
1692
|
-
fn: monsterData2.fn ? JSON.parse(JSON.stringify(monsterData2.fn))
|
|
1885
|
+
fn: monsterData2.fn ? JSON.parse(JSON.stringify(monsterData2.fn)).filter((item) => {
|
|
1886
|
+
return skillFn[item.name] && monsterData2.lv >= skillFn[item.name].lv;
|
|
1887
|
+
}) : [],
|
|
1693
1888
|
expand: {}
|
|
1694
1889
|
};
|
|
1890
|
+
console.log(temp);
|
|
1695
1891
|
return temp;
|
|
1696
1892
|
}
|
|
1697
1893
|
}
|
|
@@ -1715,6 +1911,23 @@ var propsData = {
|
|
|
1715
1911
|
});
|
|
1716
1912
|
}, "fn")
|
|
1717
1913
|
},
|
|
1914
|
+
"大红药": {
|
|
1915
|
+
name: "大红药",
|
|
1916
|
+
type: "消耗类" /* 消耗类 */,
|
|
1917
|
+
info: "回复自身(120HP+5%最高血量上限)HP",
|
|
1918
|
+
price: 10,
|
|
1919
|
+
fn: /* @__PURE__ */ __name(async function(session) {
|
|
1920
|
+
const { maxHp } = User.getUserAttributeByUserId(session.userId);
|
|
1921
|
+
User.giveHPMP(session.userId, { hp: Math.floor(120 + maxHp * 0.05) }, async (val) => {
|
|
1922
|
+
if (val.err) {
|
|
1923
|
+
await session.send(val.err);
|
|
1924
|
+
return;
|
|
1925
|
+
}
|
|
1926
|
+
const msg = `回复成功,玩家当前血量:${val.currentHP}`;
|
|
1927
|
+
await session.send(msg);
|
|
1928
|
+
});
|
|
1929
|
+
}, "fn")
|
|
1930
|
+
},
|
|
1718
1931
|
"蓝药": {
|
|
1719
1932
|
name: "蓝药",
|
|
1720
1933
|
type: "消耗类" /* 消耗类 */,
|
|
@@ -1887,7 +2100,7 @@ var UserOccDict = {
|
|
|
1887
2100
|
ghd: 1.2,
|
|
1888
2101
|
speed: 5,
|
|
1889
2102
|
evasion: 100,
|
|
1890
|
-
hit:
|
|
2103
|
+
hit: 1100
|
|
1891
2104
|
}
|
|
1892
2105
|
},
|
|
1893
2106
|
["法师" /* 法师 */]: {
|
|
@@ -1912,7 +2125,7 @@ var UserOccDict = {
|
|
|
1912
2125
|
ghd: 1.2,
|
|
1913
2126
|
speed: 5,
|
|
1914
2127
|
evasion: 100,
|
|
1915
|
-
hit:
|
|
2128
|
+
hit: 1100
|
|
1916
2129
|
}
|
|
1917
2130
|
},
|
|
1918
2131
|
["刺客" /* 刺客 */]: {
|
|
@@ -1937,7 +2150,7 @@ var UserOccDict = {
|
|
|
1937
2150
|
ghd: 1.3,
|
|
1938
2151
|
speed: 6,
|
|
1939
2152
|
evasion: 120,
|
|
1940
|
-
hit:
|
|
2153
|
+
hit: 1100
|
|
1941
2154
|
}
|
|
1942
2155
|
}
|
|
1943
2156
|
};
|
|
@@ -2040,8 +2253,8 @@ var User = {
|
|
|
2040
2253
|
temp.ghd *= currentBenchmark.ghd;
|
|
2041
2254
|
temp.speed *= currentBenchmark.speed;
|
|
2042
2255
|
}
|
|
2043
|
-
temp.hp = Math.
|
|
2044
|
-
temp.mp = Math.
|
|
2256
|
+
temp.hp = Math.floor(temp.hp);
|
|
2257
|
+
temp.mp = Math.floor(temp.mp);
|
|
2045
2258
|
temp.maxExp = Math.floor(temp.maxExp);
|
|
2046
2259
|
temp.maxHp = Math.floor(temp.maxHp);
|
|
2047
2260
|
temp.maxMp = Math.floor(temp.maxMp);
|
|
@@ -2123,7 +2336,7 @@ ${Object.keys(UserOccDict).map((i) => `【${i}】:${UserOccDict[i].info}`).join(
|
|
|
2123
2336
|
【防御力】${temp.def} (+0)
|
|
2124
2337
|
【速度值】${temp.speed} (+0)
|
|
2125
2338
|
【闪避值】${temp.evasion} (+0)
|
|
2126
|
-
【命中率】${(temp.hit / 10
|
|
2339
|
+
【命中率】${(100 + (temp.hit - 1e3) / 10).toFixed(1)}% (+0%)
|
|
2127
2340
|
【暴击率】${(temp.chr / 10).toFixed(1)}% (+0%)
|
|
2128
2341
|
【暴击伤害】${(temp.ghd * 100).toFixed(1)}% (+0%)` + (temp.csr > 0 ? `
|
|
2129
2342
|
【暴击抵抗】${temp.csr}` : "");
|
|
@@ -2661,9 +2874,10 @@ var GensokyoMap = {
|
|
|
2661
2874
|
"森林岔口": {
|
|
2662
2875
|
floor: 2,
|
|
2663
2876
|
areaName: "森林岔口",
|
|
2664
|
-
type: "
|
|
2877
|
+
type: "BOSS区" /* BOSS区 */,
|
|
2665
2878
|
needLv: 1,
|
|
2666
|
-
left: "大草场"
|
|
2879
|
+
left: "大草场",
|
|
2880
|
+
monster: [{ name: "古明地恋", lv: 10 }]
|
|
2667
2881
|
}
|
|
2668
2882
|
}
|
|
2669
2883
|
};
|
|
@@ -3507,9 +3721,24 @@ function apply(ctx, config) {
|
|
|
3507
3721
|
await session.send(await ctx.puppeteer.render(html));
|
|
3508
3722
|
});
|
|
3509
3723
|
ctx.command("幻想乡/打怪逃跑").action(async ({ session }) => {
|
|
3724
|
+
const userData = await User.getUserAttribute(session);
|
|
3725
|
+
if (!userData) return;
|
|
3510
3726
|
await Queue.add(async () => await BattleData.battleEscape(session));
|
|
3511
3727
|
});
|
|
3512
3728
|
ctx.command("幻想乡/传送 <floor:posint>").action(async ({ session }, floor) => {
|
|
3729
|
+
const userData = await User.getUserAttribute(session);
|
|
3730
|
+
if (!userData) return;
|
|
3731
|
+
GensokyoMap.initUserPoistion(session, userData);
|
|
3732
|
+
if (BattleData.isBattle(session)) {
|
|
3733
|
+
await session.send("您正在战斗中,无法移动!");
|
|
3734
|
+
return;
|
|
3735
|
+
}
|
|
3736
|
+
if (BattleData.isTeam(session) && BattleData.teamTemp[session.userId].identity !== "队长") {
|
|
3737
|
+
return `你在队伍中,请等待队长选择移动的位置!`;
|
|
3738
|
+
}
|
|
3739
|
+
if (User.isDie(session.userId)) {
|
|
3740
|
+
return `你已经阵亡,请发送 /补给 进行治疗。`;
|
|
3741
|
+
}
|
|
3513
3742
|
if (GensokyoMap.getUserCurrentArea(session.userId).type !== "传送门" /* 传送门 */) {
|
|
3514
3743
|
return "该区域未存在传送门建筑,传送失败!";
|
|
3515
3744
|
}
|
package/lib/utlis.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const random: (min: number, max: number) => number;
|
|
2
2
|
/** 血量可视化 */
|
|
3
3
|
export declare const generateHealthDisplay: (current: number, total: number) => string;
|
|
4
|
+
/** 打乱数组 */
|
|
4
5
|
export declare const getFreeList: (arr: any[]) => any[];
|
|
5
6
|
export declare class AsyncOperationQueue {
|
|
6
7
|
queue: any[];
|