koishi-plugin-smmcat-gensokyo 0.0.11 → 0.0.13
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/data/initMonster.d.ts +6 -0
- package/lib/index.js +31 -16
- package/lib/monster.d.ts +4 -0
- package/lib/users.d.ts +2 -0
- package/package.json +1 -1
|
@@ -7,6 +7,7 @@ export declare const monsterData: {
|
|
|
7
7
|
name: string;
|
|
8
8
|
type: MonsterOccupation;
|
|
9
9
|
info: string;
|
|
10
|
+
pic: string;
|
|
10
11
|
hp: number;
|
|
11
12
|
maxHp: number;
|
|
12
13
|
mp: number;
|
|
@@ -14,6 +15,7 @@ export declare const monsterData: {
|
|
|
14
15
|
atk: number;
|
|
15
16
|
def: number;
|
|
16
17
|
chr: number;
|
|
18
|
+
csr: number;
|
|
17
19
|
evasion: number;
|
|
18
20
|
hit: number;
|
|
19
21
|
ghd: number;
|
|
@@ -24,6 +26,7 @@ export declare const monsterData: {
|
|
|
24
26
|
name: string;
|
|
25
27
|
type: MonsterOccupation;
|
|
26
28
|
info: string;
|
|
29
|
+
pic: string;
|
|
27
30
|
hp: number;
|
|
28
31
|
maxHp: number;
|
|
29
32
|
mp: number;
|
|
@@ -31,6 +34,7 @@ export declare const monsterData: {
|
|
|
31
34
|
atk: number;
|
|
32
35
|
def: number;
|
|
33
36
|
chr: number;
|
|
37
|
+
csr: number;
|
|
34
38
|
evasion: number;
|
|
35
39
|
hit: number;
|
|
36
40
|
ghd: number;
|
|
@@ -41,6 +45,7 @@ export declare const monsterData: {
|
|
|
41
45
|
name: string;
|
|
42
46
|
type: MonsterOccupation;
|
|
43
47
|
info: string;
|
|
48
|
+
pic: string;
|
|
44
49
|
hp: number;
|
|
45
50
|
maxHp: number;
|
|
46
51
|
mp: number;
|
|
@@ -48,6 +53,7 @@ export declare const monsterData: {
|
|
|
48
53
|
atk: number;
|
|
49
54
|
def: number;
|
|
50
55
|
chr: number;
|
|
56
|
+
csr: number;
|
|
51
57
|
evasion: number;
|
|
52
58
|
hit: number;
|
|
53
59
|
ghd: number;
|
package/lib/index.js
CHANGED
|
@@ -26,7 +26,7 @@ __export(src_exports, {
|
|
|
26
26
|
name: () => name
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(src_exports);
|
|
29
|
-
var
|
|
29
|
+
var import_koishi2 = require("koishi");
|
|
30
30
|
|
|
31
31
|
// src/map.ts
|
|
32
32
|
var delay = /* @__PURE__ */ __name((ms) => new Promise((resolve) => setTimeout(resolve, ms)), "delay");
|
|
@@ -381,10 +381,11 @@ var UserOccDict = {
|
|
|
381
381
|
atk: 12,
|
|
382
382
|
def: 5,
|
|
383
383
|
chr: 50,
|
|
384
|
+
csr: 0,
|
|
384
385
|
ghd: 1.2,
|
|
385
386
|
speed: 5,
|
|
386
387
|
evasion: 100,
|
|
387
|
-
hit:
|
|
388
|
+
hit: 100
|
|
388
389
|
}
|
|
389
390
|
},
|
|
390
391
|
["法师" /* 法师 */]: {
|
|
@@ -405,10 +406,11 @@ var UserOccDict = {
|
|
|
405
406
|
atk: 10,
|
|
406
407
|
def: 2,
|
|
407
408
|
chr: 50,
|
|
409
|
+
csr: 0,
|
|
408
410
|
ghd: 1.2,
|
|
409
411
|
speed: 5,
|
|
410
412
|
evasion: 100,
|
|
411
|
-
hit:
|
|
413
|
+
hit: 100
|
|
412
414
|
}
|
|
413
415
|
},
|
|
414
416
|
["刺客" /* 刺客 */]: {
|
|
@@ -429,10 +431,11 @@ var UserOccDict = {
|
|
|
429
431
|
atk: 8,
|
|
430
432
|
def: 2,
|
|
431
433
|
chr: 80,
|
|
434
|
+
csr: 0,
|
|
432
435
|
ghd: 1.3,
|
|
433
436
|
speed: 6,
|
|
434
437
|
evasion: 120,
|
|
435
|
-
hit:
|
|
438
|
+
hit: 100
|
|
436
439
|
}
|
|
437
440
|
}
|
|
438
441
|
};
|
|
@@ -483,6 +486,7 @@ var User = {
|
|
|
483
486
|
...UserOccDict[UserDict.type].initStatus,
|
|
484
487
|
lv: UserDict.lv,
|
|
485
488
|
hp: UserDict.hp,
|
|
489
|
+
mp: UserDict.mp,
|
|
486
490
|
exp: UserDict.exp,
|
|
487
491
|
pp: UserDict.pp,
|
|
488
492
|
playName: UserDict.playName,
|
|
@@ -603,11 +607,12 @@ ${Object.keys(UserOccDict).map((i) => `【${i}】:${UserOccDict[i].info}`).join(
|
|
|
603
607
|
-----------------
|
|
604
608
|
【攻击力】${temp.atk} (+0)
|
|
605
609
|
【防御力】${temp.def} (+0)
|
|
606
|
-
【命中值】${temp.hit} (+0)
|
|
607
610
|
【速度值】${temp.speed} (+0)
|
|
608
611
|
【闪避值】${temp.evasion} (+0)
|
|
612
|
+
【命中率】${(temp.hit / 10 + 100).toFixed(1)}% (+0%)
|
|
609
613
|
【暴击率】${(temp.chr / 10).toFixed(1)}% (+0%)
|
|
610
|
-
【暴击伤害】${(temp.ghd * 100).toFixed(1)}% (+0%)
|
|
614
|
+
【暴击伤害】${(temp.ghd * 100).toFixed(1)}% (+0%)` + (temp.csr > 0 ? `
|
|
615
|
+
【暴击抵抗】${temp.csr}` : "");
|
|
611
616
|
},
|
|
612
617
|
/** 写入用户数据到数据库 */
|
|
613
618
|
async setDatabaseUserAttribute(userId) {
|
|
@@ -657,12 +662,16 @@ ${Object.keys(UserOccDict).map((i) => `【${i}】:${UserOccDict[i].info}`).join(
|
|
|
657
662
|
}
|
|
658
663
|
};
|
|
659
664
|
|
|
665
|
+
// src/monster.ts
|
|
666
|
+
var import_koishi = require("koishi");
|
|
667
|
+
|
|
660
668
|
// src/data/initMonster.ts
|
|
661
669
|
var monsterData = {
|
|
662
670
|
"小蜜蜂": {
|
|
663
671
|
name: "小蜜蜂",
|
|
664
672
|
type: "野怪" /* 野怪 */,
|
|
665
673
|
info: "幻想乡一层常见的生物",
|
|
674
|
+
pic: "http://smmcat.cn/run/gensokyo/小蜜蜂.png",
|
|
666
675
|
hp: 50,
|
|
667
676
|
maxHp: 50,
|
|
668
677
|
mp: 30,
|
|
@@ -670,6 +679,7 @@ var monsterData = {
|
|
|
670
679
|
atk: 7,
|
|
671
680
|
def: 2,
|
|
672
681
|
chr: 50,
|
|
682
|
+
csr: 0,
|
|
673
683
|
evasion: 100,
|
|
674
684
|
hit: 1e3,
|
|
675
685
|
ghd: 1.2,
|
|
@@ -680,6 +690,7 @@ var monsterData = {
|
|
|
680
690
|
name: "小蜘蛛",
|
|
681
691
|
type: "野怪" /* 野怪 */,
|
|
682
692
|
info: "幻想乡一层常见的生物",
|
|
693
|
+
pic: "http://smmcat.cn/run/gensokyo/小蜘蛛.png",
|
|
683
694
|
hp: 55,
|
|
684
695
|
maxHp: 55,
|
|
685
696
|
mp: 30,
|
|
@@ -687,7 +698,8 @@ var monsterData = {
|
|
|
687
698
|
atk: 10,
|
|
688
699
|
def: 3,
|
|
689
700
|
chr: 50,
|
|
690
|
-
|
|
701
|
+
csr: 0,
|
|
702
|
+
evasion: 150,
|
|
691
703
|
hit: 1e3,
|
|
692
704
|
ghd: 1.2,
|
|
693
705
|
speed: 4,
|
|
@@ -697,6 +709,7 @@ var monsterData = {
|
|
|
697
709
|
name: "dora",
|
|
698
710
|
type: "野怪" /* 野怪 */,
|
|
699
711
|
info: "偶尔出没在一层世界的奇怪生物",
|
|
712
|
+
pic: "http://smmcat.cn/run/gensokyo/dora.png",
|
|
700
713
|
hp: 88,
|
|
701
714
|
maxHp: 88,
|
|
702
715
|
mp: 10,
|
|
@@ -704,7 +717,8 @@ var monsterData = {
|
|
|
704
717
|
atk: 20,
|
|
705
718
|
def: 5,
|
|
706
719
|
chr: 200,
|
|
707
|
-
|
|
720
|
+
csr: 0,
|
|
721
|
+
evasion: 200,
|
|
708
722
|
hit: 1e3,
|
|
709
723
|
ghd: 1.2,
|
|
710
724
|
speed: 4,
|
|
@@ -817,8 +831,8 @@ var Monster = {
|
|
|
817
831
|
},
|
|
818
832
|
/** 格式化怪物属性数据 */
|
|
819
833
|
monsterAttributeTextFormat(monster) {
|
|
820
|
-
const { name: name2, type, lv, hp, maxHp, mp, maxMp, atk, def, chr, evasion, hit, ghd, speed, info } = monster;
|
|
821
|
-
const attributeText = `Lv.${lv}【${name2}】
|
|
834
|
+
const { name: name2, type, lv, hp, maxHp, mp, maxMp, atk, def, chr, evasion, hit, ghd, speed, info, pic } = monster;
|
|
835
|
+
const attributeText = (pic ? import_koishi.h.image(pic) + "\n" : "") + `Lv.${lv}【${name2}】
|
|
822
836
|
|
|
823
837
|
【怪物类型】${type}
|
|
824
838
|
【生命值】${hp}/${maxHp}
|
|
@@ -884,7 +898,7 @@ var Damage = class {
|
|
|
884
898
|
const { self, goal } = this.config.agent;
|
|
885
899
|
if (this.config.isRealHarm) return this;
|
|
886
900
|
const lvSup = /* @__PURE__ */ __name(() => Math.floor((goal.lv - self.lv) / 5) * 20, "lvSup");
|
|
887
|
-
const evaVal = Math.min(95, (goal.evasion + goal.gain.evasion -
|
|
901
|
+
const evaVal = Math.min(95, (goal.evasion + goal.gain.evasion - self.hit + lvSup()) / 10);
|
|
888
902
|
if (random(0, 100) <= evaVal) {
|
|
889
903
|
this.config.isEvasion = true;
|
|
890
904
|
fn && fn(this.config);
|
|
@@ -1439,7 +1453,7 @@ function initBattleAttribute(data) {
|
|
|
1439
1453
|
def: userData.def,
|
|
1440
1454
|
chr: userData.chr,
|
|
1441
1455
|
ghd: userData.ghd,
|
|
1442
|
-
csr:
|
|
1456
|
+
csr: userData.csr,
|
|
1443
1457
|
evasion: userData.evasion,
|
|
1444
1458
|
hit: userData.hit,
|
|
1445
1459
|
speed: userData.speed,
|
|
@@ -1472,7 +1486,7 @@ function initBattleAttribute(data) {
|
|
|
1472
1486
|
def: monsterData2.def,
|
|
1473
1487
|
chr: monsterData2.chr,
|
|
1474
1488
|
ghd: monsterData2.ghd,
|
|
1475
|
-
csr:
|
|
1489
|
+
csr: monsterData2.csr,
|
|
1476
1490
|
evasion: monsterData2.evasion,
|
|
1477
1491
|
hit: monsterData2.hit,
|
|
1478
1492
|
speed: monsterData2.speed,
|
|
@@ -1500,7 +1514,7 @@ var name = "smmcat-gensokyo";
|
|
|
1500
1514
|
var inject = {
|
|
1501
1515
|
required: ["monetary", "database"]
|
|
1502
1516
|
};
|
|
1503
|
-
var Config =
|
|
1517
|
+
var Config = import_koishi2.Schema.object({});
|
|
1504
1518
|
function apply(ctx, config) {
|
|
1505
1519
|
ctx.on("ready", () => {
|
|
1506
1520
|
GensokyoMap.init(config, ctx);
|
|
@@ -1625,8 +1639,7 @@ function apply(ctx, config) {
|
|
|
1625
1639
|
if (!lv) lv = 1;
|
|
1626
1640
|
const result = Monster.getMonsterAttributeData(monster, lv);
|
|
1627
1641
|
if (!result) return `没有找到该怪物信息...`;
|
|
1628
|
-
return
|
|
1629
|
-
` + Monster.monsterAttributeTextFormat(result);
|
|
1642
|
+
return Monster.monsterAttributeTextFormat(result);
|
|
1630
1643
|
});
|
|
1631
1644
|
ctx.command("幻想乡/打怪遇敌 <goal>").action(async ({ session }, goal) => {
|
|
1632
1645
|
const userData = await User.getUserAttribute(session);
|
|
@@ -1706,8 +1719,10 @@ function apply(ctx, config) {
|
|
|
1706
1719
|
}
|
|
1707
1720
|
temp[session.userId] = Date.now();
|
|
1708
1721
|
const { maxHp, maxMp, playName } = User.getUserAttributeByUserId(session.userId);
|
|
1722
|
+
console.log(maxMp);
|
|
1709
1723
|
User.userTempData[session.userId].hp = maxHp;
|
|
1710
1724
|
User.userTempData[session.userId].mp = maxMp;
|
|
1725
|
+
console.log(User.userTempData[session.userId]);
|
|
1711
1726
|
await User.setDatabaseUserAttribute(session.userId);
|
|
1712
1727
|
return playName + `通过补给,目前已恢复HP和MP`;
|
|
1713
1728
|
});
|
package/lib/monster.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export type MonsterBaseAttribute = {
|
|
|
14
14
|
name: string;
|
|
15
15
|
/** 怪物说明 */
|
|
16
16
|
info?: string;
|
|
17
|
+
/** 怪物配图 */
|
|
18
|
+
pic?: string;
|
|
17
19
|
/** 类型 */
|
|
18
20
|
type: MonsterOccupation;
|
|
19
21
|
/** 血量 */
|
|
@@ -32,6 +34,8 @@ export type MonsterBaseAttribute = {
|
|
|
32
34
|
chr: number;
|
|
33
35
|
/** 暴击伤害 */
|
|
34
36
|
ghd: number;
|
|
37
|
+
/** 暴击抵抗 */
|
|
38
|
+
csr: number;
|
|
35
39
|
/** 闪避值 */
|
|
36
40
|
evasion: number;
|
|
37
41
|
/** 命中值 */
|
package/lib/users.d.ts
CHANGED