koishi-plugin-smmcat-gensokyo 0.0.46 → 0.0.47

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.
@@ -43,13 +43,15 @@ interface BuffConfig<T extends BuffType = BuffType> {
43
43
  info: string;
44
44
  /** 印记 */
45
45
  key?: string;
46
- /** 被动函数 */
46
+ /** 附着时触发 */
47
47
  initFn?(agent: BattleAttribute, cb?: (val: Extract<BuffItemParams, {
48
48
  type: T;
49
49
  }>) => void): void;
50
+ /** 结算时触发 */
50
51
  fn(agent: BattleAttribute, cb?: (val: Extract<BuffItemParams, {
51
52
  type: T;
52
53
  }>) => void): void;
54
+ /** 被治疗时触发 */
53
55
  cureFn?(agent: BattleAttribute, cb?: (val: Extract<BuffItemParams, {
54
56
  type: T;
55
57
  }>) => void): string;
package/lib/index.js CHANGED
@@ -281,7 +281,7 @@ var monsterData = {
281
281
  speed: 5,
282
282
  giveExp: 16,
283
283
  giveMonetary: 5,
284
- passiveList: [],
284
+ passiveList: ["剧毒"],
285
285
  giveProps: [
286
286
  { name: "初级复活卷轴", val: 1, radomVal: 50 }
287
287
  ],
@@ -671,9 +671,7 @@ var BuffFn = {
671
671
  function giveBuff(agent, buff) {
672
672
  const buffInfo = BuffFn[buff.name] || null;
673
673
  if (!buffInfo) return;
674
- if (buffInfo.type == "印记" /* 印记 */) {
675
- buffInfo.initFn?.(agent);
676
- }
674
+ buffInfo.initFn?.(agent);
677
675
  let again = false;
678
676
  if (agent.buff[buff.name]) again = true;
679
677
  agent.buff[buff.name] = buff;
@@ -811,7 +809,7 @@ var PassiveFn = {
811
809
  const val = Math.floor(config.harm * 0.1);
812
810
  if (val) {
813
811
  const res = giveCure(config.linkAgent.self, val);
814
- return `‣ ${getLineupName(config.linkAgent.self)}:[${this.name}] HP+${res.val}`;
812
+ return `‣ ${getLineupName(config.linkAgent.self)}触发被动:[${this.name}] HP+${res.val}`;
815
813
  }
816
814
  return ``;
817
815
  }, "damageFn")
@@ -824,7 +822,7 @@ var PassiveFn = {
824
822
  const val = Math.floor(config.harm * 0.2);
825
823
  if (val && random(0, 10) <= 4) {
826
824
  const value = new BuffDamage(val, config.linkAgent.self, true).giveDamage();
827
- return `‣ ${getLineupName(config.linkAgent.self)}:[${this.name}] HP-${value}`;
825
+ return `‣ ${getLineupName(config.linkAgent.goal)}触发被动¦${this.name}¦ HP-${value}`;
828
826
  }
829
827
  return ``;
830
828
  }, "damageFn")
@@ -838,7 +836,7 @@ var PassiveFn = {
838
836
  const upVal = Math.floor(config.harm * 0.3);
839
837
  if (upVal) {
840
838
  config.harm += Math.floor(config.harm * 0.3);
841
- return `‣ ${getLineupName(config.linkAgent.self)}:[${this.name}] 伤害+${upVal}`;
839
+ return `‣ ${getLineupName(config.linkAgent.self)}触发被动¦${this.name}¦ 伤害+${upVal}`;
842
840
  }
843
841
  return ``;
844
842
  }
@@ -854,7 +852,7 @@ var PassiveFn = {
854
852
  const upVal = Math.floor(config.harm * 0.3);
855
853
  if (upVal) {
856
854
  config.harm += Math.floor(config.harm * 0.3);
857
- return `‣ ${getLineupName(config.linkAgent.self)}:[${this.name}] 伤害+${upVal}`;
855
+ return `‣ ${getLineupName(config.linkAgent.self)}触发被动¦${this.name}¦ 伤害+${upVal}`;
858
856
  }
859
857
  return ``;
860
858
  }
@@ -863,22 +861,42 @@ var PassiveFn = {
863
861
  },
864
862
  "针女": {
865
863
  name: "针女",
866
- info: "攻击时有40%概率额外造成敌方5%血量真实伤害(伤害最大不超过使用者攻击力的120%)",
864
+ info: "造成暴击有50%概率额外造成敌方5%血量真实伤害(伤害最大不超过使用者攻击力的120%)",
867
865
  type: "atk",
868
866
  damageFn: /* @__PURE__ */ __name(function(config) {
869
- if (random(0, 10) <= 4) {
867
+ if (config.isCsp && random(0, 10) <= 5) {
870
868
  const upVal = Math.min(
871
- config.linkAgent.self.atk + config.linkAgent.self.gain.atk,
869
+ Math.floor((config.linkAgent.self.atk + config.linkAgent.self.gain.atk) * 1.2),
872
870
  Math.floor(config.linkAgent.goal.maxHp * 0.05)
873
871
  );
874
872
  if (upVal) {
875
873
  const value = new BuffDamage(upVal, config.linkAgent.goal, true).giveDamage();
876
- return `‣ ${getLineupName(config.linkAgent.goal)}:[${this.name}] HP-${value}`;
874
+ return `‣ ${getLineupName(config.linkAgent.self)}触发被动¦${this.name}¦ HP-${value}`;
877
875
  }
878
876
  return ``;
879
877
  }
880
878
  return ``;
881
879
  }, "damageFn")
880
+ },
881
+ "剧毒": {
882
+ name: "剧毒",
883
+ info: "造成伤害有20%概率附加中毒状态2回合,对已在中毒状态的目标 80% 概率直接催化中毒(结算剩余中毒总计伤害)",
884
+ type: "atk",
885
+ damageFn: /* @__PURE__ */ __name(function(config) {
886
+ if (config.linkAgent.goal.buff["中毒"] && random(0, 10) <= 8) {
887
+ const timeVal = config.linkAgent.goal.buff["中毒"].timer;
888
+ clearBuff(config.linkAgent.goal, { name: "中毒" });
889
+ const upDamage = Math.min(20, Math.floor((config.agent.goal.maxHp + config.agent.goal.maxHp) * 0.05) || 1) * timeVal;
890
+ const value = new BuffDamage(upDamage, config.linkAgent.goal, true).giveDamage();
891
+ return `‣ ${getLineupName(config.linkAgent.self)}触发被动¦${this.name}¦ 催化中毒 目标HP-${value}`;
892
+ } else {
893
+ if (random(0, 10) <= 2) {
894
+ giveBuff(config.linkAgent.goal, { name: "中毒", timer: 2 });
895
+ return `‣ ${getLineupName(config.linkAgent.self)}触发被动¦${this.name}¦ 附着2回合⌈中毒⌋`;
896
+ }
897
+ return ``;
898
+ }
899
+ }, "damageFn")
882
900
  }
883
901
  };
884
902
 
@@ -971,7 +989,7 @@ var Damage = class {
971
989
  }
972
990
  }
973
991
  fn && fn(this.config);
974
- if (this.config.linkAgent.self.passiveList?.length) {
992
+ if (!this.config.isRealHarm && this.config.linkAgent.self.passiveList?.length) {
975
993
  this.config.linkAgent.self.passiveList.forEach((passiveName) => {
976
994
  if (PassiveFn[passiveName].type == "atk") {
977
995
  const msg = PassiveFn[passiveName].damageFn(this.config);
@@ -1024,7 +1042,7 @@ var BuffDamage = class {
1024
1042
  }
1025
1043
  };
1026
1044
  function giveDamage(self, goal, damage) {
1027
- if (damage.linkAgent.goal.passiveList?.length) {
1045
+ if (!damage.isRealHarm && damage.linkAgent.goal.passiveList?.length) {
1028
1046
  damage.linkAgent.goal.passiveList.forEach((passiveName) => {
1029
1047
  if (PassiveFn[passiveName].type == "hit") {
1030
1048
  const msg = PassiveFn[passiveName].damageFn(damage);
@@ -1434,7 +1452,7 @@ var skillFn = {
1434
1452
  });
1435
1453
  msgList.push(`- ${getLineupName(agent.goal)} 受到 ${damageData.harm} 伤害。` + baseMoreDamage(damageData));
1436
1454
  }
1437
- while (random(0, 10) <= 4) {
1455
+ while (random(0, 10) <= 4 && agent.goal.hp > 0) {
1438
1456
  const damageData = new Damage(agent).result({
1439
1457
  before: /* @__PURE__ */ __name((val) => {
1440
1458
  val.default_harm = Math.floor((agent.self.atk + agent.self.gain.atk) * 0.3) + Math.floor(agent.self.mp * 0.05);
@@ -3056,7 +3074,7 @@ var GensokyoMap = {
3056
3074
  needLv: 1,
3057
3075
  left: "绿野平原四",
3058
3076
  top: "绿野平原三",
3059
- monster: [{ name: "绿毒蛇", lv: 12 }]
3077
+ monster: [{ name: "绿毒蛇", lv: 32 }]
3060
3078
  },
3061
3079
  "野猪巢穴": {
3062
3080
  floor: 1,
@@ -3870,6 +3888,10 @@ function apply(ctx, config) {
3870
3888
  ctx.command("幻想乡/查询怪物 <monster> <lv:posint>").action(async ({ session }, monster, lv) => {
3871
3889
  if (!monster) return `请输入要查询的怪物!`;
3872
3890
  if (!lv) lv = 1;
3891
+ if (lv > 60) {
3892
+ await session.send(`抱歉,目前最高只能查询怪物 lv60 级的属性`);
3893
+ lv = 60;
3894
+ }
3873
3895
  const result = Monster.getMonsterAttributeData(monster, lv);
3874
3896
  if (!result) return `没有找到该怪物信息...`;
3875
3897
  return Monster.monsterAttributeTextFormat(result);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-smmcat-gensokyo",
3
3
  "description": "名为《幻想乡》的文字冒险游戏",
4
- "version": "0.0.46",
4
+ "version": "0.0.47",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [