diff --git a/character/sp2.js b/character/sp2.js
index da9ff336f..98451e86a 100644
--- a/character/sp2.js
+++ b/character/sp2.js
@@ -192,7 +192,7 @@ game.import("character", function () {
order: 9,
result: {
player(player, target) {
- let res = 2 * get.effect(player, { name: "draw", player, player });
+ let res = 2 * get.effect(player, { name: "draw" }, player, player);
if (player !== target)
res += get.effect(player, { name: "losehp" }, player, player);
return res;
@@ -1434,7 +1434,7 @@ game.import("character", function () {
list.length > 1
? `,令${get.translation(event.card)}目标改为${get.translation(
list
- )}中的一名随机角色`
+ )}中的一名随机角色`
: ""
}。${gainText}`;
},
@@ -2252,8 +2252,8 @@ game.import("character", function () {
filter: function (event, player) {
return player.countCards("h") > 0;
},
- getSkills: function (target) {
- return target.getSkills(null, false).filter((skill) => {
+ getSkills(target, skills) {
+ return (target && !skills ? target.getSkills(null, false) : skills).filter((skill) => {
var str = get.skillInfoTranslation(skill, target);
if (str.indexOf("当你于出牌阶段") != -1) return true;
var skills = game.expandSkills([skill]);
@@ -2381,91 +2381,140 @@ game.import("character", function () {
});
},
async cost(event, trigger, player) {
- const func = function (player) {
- game.countPlayer((target) => {
- if (target != player) {
- const skills = lib.skill.dclongsong.getSkills(target);
- if (skills.length) {
- target.prompt(skills.map((i) => get.translation(i)).join("
"));
- }
- }
- });
- };
- if (event.player == game.me) func(player);
- else if (event.isOnline()) player.send(func, player);
event.result = await player
- .chooseTarget(get.prompt2("longsong"), (card, player, target) => {
- if (target == player) return false;
- return target.hasCard((card) => {
- if (get.position(card) == "h") return true;
+ .chooseCardTarget({
+ prompt: get.prompt2("longsong"),
+ filterTarget(card, player, target) {
+ if (target === player) return false;
+ const skills = lib.skill.dclongsong
+ .getSkills(target)
+ .map((skill) => get.translation(skill));
+ if (skills.length) {
+ target.prompt(skills.join("
"));
+ }
+ return target.hasCard((card) => {
+ if (get.position(card) == "h") return true;
+ return (
+ get.color(card) == "red" &&
+ lib.filter.canBeGained(card, player, target)
+ );
+ }, "he");
+ },
+ filterCard: { color: "red" },
+ selectCard: [0, 1],
+ ai1(card) {
+ const ai2 = get.event("ai2");
+ if (
+ game.hasPlayer((current) => {
+ return ai2(current) > 0;
+ })
+ ) {
+ return -1 - get.value(card);
+ }
+ return 6 - get.value(card);
+ },
+ ai2(target) {
+ const player = get.event("player"),
+ att = get.attitude(player, target);
+ if (
+ att > 0 &&
+ !target
+ .getGainableCards(player, "he")
+ .some((card) => get.color(card) == "red")
+ )
+ return 0;
return (
- get.color(card) == "red" && lib.filter.canBeGained(card, player, target)
+ lib.skill.dclongsong.getSkills(target).length +
+ (att > 0
+ ? 0
+ : Math.max(
+ 0,
+ get.effect(target, { name: "shunshou_copy2" }, player, player)
+ ))
);
- }, "he");
- })
- .set("ai", (target) => {
- const player = get.event("player"),
- att = get.attitude(player, target);
- if (
- att > 0 &&
- !target
- .getGainableCards(player, "he")
- .some((card) => get.color(card) == "red")
- )
- return 0;
- return (
- lib.skill.dclongsong.getSkills(target).length +
- (att > 0
- ? 0
- : Math.max(
- 0,
- get.effect(target, { name: "shunshou_copy2" }, player, player)
- ))
- );
+ },
})
.forResult();
},
async content(event, trigger, player) {
const target = event.targets[0],
- cards = target
+ card = event.cards[0],
+ gainableCards = target
.getGainableCards(player, "he")
.filter((card) => get.color(card) == "red");
- if (cards.length) {
- let dialog = ["龙诵:获得" + get.translation(target) + "的一张红色牌"];
- let cards1 = cards.filter((i) => get.position(i) == "h"),
- cards2 = cards.filter((i) => get.position(i) == "e");
- if (cards1.length) {
- dialog.push('