koishi-plugin-smmcat-gensokyo 0.0.47 → 0.0.48
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/buffFn.d.ts +2 -0
- package/lib/index.js +14 -9
- package/package.json +1 -1
package/lib/data/buffFn.d.ts
CHANGED
|
@@ -60,6 +60,8 @@ type BuffFnList = {
|
|
|
60
60
|
[key: string]: BuffConfig;
|
|
61
61
|
};
|
|
62
62
|
export declare const BuffFn: BuffFnList;
|
|
63
|
+
/** BUFF状态持续时间格式化 */
|
|
64
|
+
export declare function buffTimeFormat(time: number): any;
|
|
63
65
|
/** 为目标添加BUFF */
|
|
64
66
|
export declare function giveBuff(agent: BattleAttribute, buff: {
|
|
65
67
|
name: string;
|
package/lib/index.js
CHANGED
|
@@ -668,6 +668,11 @@ var BuffFn = {
|
|
|
668
668
|
}, "fn")
|
|
669
669
|
}
|
|
670
670
|
};
|
|
671
|
+
function buffTimeFormat(time) {
|
|
672
|
+
const dict = { 1: "¹", 2: "²", 3: "³", 4: "⁴", 5: "⁵", 6: "⁶", 7: "⁷", 8: "⁸", 9: "⁹" };
|
|
673
|
+
return dict[time] || "⁺";
|
|
674
|
+
}
|
|
675
|
+
__name(buffTimeFormat, "buffTimeFormat");
|
|
671
676
|
function giveBuff(agent, buff) {
|
|
672
677
|
const buffInfo = BuffFn[buff.name] || null;
|
|
673
678
|
if (!buffInfo) return;
|
|
@@ -676,7 +681,7 @@ function giveBuff(agent, buff) {
|
|
|
676
681
|
if (agent.buff[buff.name]) again = true;
|
|
677
682
|
agent.buff[buff.name] = buff;
|
|
678
683
|
const dict = { 1: "¹", 2: "²", 3: "³", 4: "⁴", 5: "⁵", 6: "⁶", 7: "⁷", 8: "⁸", 9: "⁹" };
|
|
679
|
-
return again ? `${getLineupName(agent)}被再次挂上了${buff.name}${
|
|
684
|
+
return again ? `${getLineupName(agent)}被再次挂上了${buff.name}${buffTimeFormat(buff.timer)}` : `${getLineupName(agent)}被挂上了${buff.name}${buffTimeFormat(buff.timer)}`;
|
|
680
685
|
}
|
|
681
686
|
__name(giveBuff, "giveBuff");
|
|
682
687
|
function clearBuff(agent, buff) {
|
|
@@ -809,7 +814,7 @@ var PassiveFn = {
|
|
|
809
814
|
const val = Math.floor(config.harm * 0.1);
|
|
810
815
|
if (val) {
|
|
811
816
|
const res = giveCure(config.linkAgent.self, val);
|
|
812
|
-
return `‣ ${getLineupName(config.linkAgent.self)}
|
|
817
|
+
return `‣ ${getLineupName(config.linkAgent.self)}触发被动 ¦${this.name}¦ HP+${res.val}`;
|
|
813
818
|
}
|
|
814
819
|
return ``;
|
|
815
820
|
}, "damageFn")
|
|
@@ -822,7 +827,7 @@ var PassiveFn = {
|
|
|
822
827
|
const val = Math.floor(config.harm * 0.2);
|
|
823
828
|
if (val && random(0, 10) <= 4) {
|
|
824
829
|
const value = new BuffDamage(val, config.linkAgent.self, true).giveDamage();
|
|
825
|
-
return `‣ ${getLineupName(config.linkAgent.goal)}
|
|
830
|
+
return `‣ ${getLineupName(config.linkAgent.goal)}触发被动 ¦${this.name}¦ HP-${value}`;
|
|
826
831
|
}
|
|
827
832
|
return ``;
|
|
828
833
|
}, "damageFn")
|
|
@@ -836,7 +841,7 @@ var PassiveFn = {
|
|
|
836
841
|
const upVal = Math.floor(config.harm * 0.3);
|
|
837
842
|
if (upVal) {
|
|
838
843
|
config.harm += Math.floor(config.harm * 0.3);
|
|
839
|
-
return `‣ ${getLineupName(config.linkAgent.self)}
|
|
844
|
+
return `‣ ${getLineupName(config.linkAgent.self)}触发被动 ¦${this.name}¦ 伤害+${upVal}`;
|
|
840
845
|
}
|
|
841
846
|
return ``;
|
|
842
847
|
}
|
|
@@ -852,7 +857,7 @@ var PassiveFn = {
|
|
|
852
857
|
const upVal = Math.floor(config.harm * 0.3);
|
|
853
858
|
if (upVal) {
|
|
854
859
|
config.harm += Math.floor(config.harm * 0.3);
|
|
855
|
-
return `‣ ${getLineupName(config.linkAgent.self)}
|
|
860
|
+
return `‣ ${getLineupName(config.linkAgent.self)}触发被动 ¦${this.name}¦ 伤害+${upVal}`;
|
|
856
861
|
}
|
|
857
862
|
return ``;
|
|
858
863
|
}
|
|
@@ -871,7 +876,7 @@ var PassiveFn = {
|
|
|
871
876
|
);
|
|
872
877
|
if (upVal) {
|
|
873
878
|
const value = new BuffDamage(upVal, config.linkAgent.goal, true).giveDamage();
|
|
874
|
-
return `‣ ${getLineupName(config.linkAgent.self)}
|
|
879
|
+
return `‣ ${getLineupName(config.linkAgent.self)}触发被动 ¦${this.name}¦ HP-${value}`;
|
|
875
880
|
}
|
|
876
881
|
return ``;
|
|
877
882
|
}
|
|
@@ -880,7 +885,7 @@ var PassiveFn = {
|
|
|
880
885
|
},
|
|
881
886
|
"剧毒": {
|
|
882
887
|
name: "剧毒",
|
|
883
|
-
info: "
|
|
888
|
+
info: "造成伤害时有20%概率为目标附加中毒状态2回合,对已在中毒状态的目标 80% 概率直接催化中毒(结算剩余中毒总计伤害)",
|
|
884
889
|
type: "atk",
|
|
885
890
|
damageFn: /* @__PURE__ */ __name(function(config) {
|
|
886
891
|
if (config.linkAgent.goal.buff["中毒"] && random(0, 10) <= 8) {
|
|
@@ -888,11 +893,11 @@ var PassiveFn = {
|
|
|
888
893
|
clearBuff(config.linkAgent.goal, { name: "中毒" });
|
|
889
894
|
const upDamage = Math.min(20, Math.floor((config.agent.goal.maxHp + config.agent.goal.maxHp) * 0.05) || 1) * timeVal;
|
|
890
895
|
const value = new BuffDamage(upDamage, config.linkAgent.goal, true).giveDamage();
|
|
891
|
-
return `‣ ${getLineupName(config.linkAgent.self)}
|
|
896
|
+
return `‣ ${getLineupName(config.linkAgent.self)}触发被动 ¦${this.name}¦ 催化中毒${buffTimeFormat(timeVal)} 目标HP-${value}`;
|
|
892
897
|
} else {
|
|
893
898
|
if (random(0, 10) <= 2) {
|
|
894
899
|
giveBuff(config.linkAgent.goal, { name: "中毒", timer: 2 });
|
|
895
|
-
return `‣ ${getLineupName(config.linkAgent.self)}
|
|
900
|
+
return `‣ ${getLineupName(config.linkAgent.self)}触发被动 ¦${this.name}¦ 附着2回合⌈中毒⌋`;
|
|
896
901
|
}
|
|
897
902
|
return ``;
|
|
898
903
|
}
|