刘晔【筹略】修改写法

This commit is contained in:
Spmario233 2024-05-10 19:54:29 +08:00
parent 12a1cf042a
commit a1b7eb31be
1 changed files with 30 additions and 35 deletions

View File

@ -16469,57 +16469,52 @@ const skills = {
choulve: { choulve: {
audio: 2, audio: 2,
trigger: { player: "phaseUseBegin" }, trigger: { player: "phaseUseBegin" },
direct: true,
filter: function (event, player) { filter: function (event, player) {
return game.hasPlayer(function (current) { return game.hasPlayer(function (current) {
return current != player && current.countCards("he"); return current != player && current.countCards("he");
}); });
}, },
content: function () { async cost(event, trigger, player){
"step 0"; let str = "令一名其他角色交给你一张牌";
var str = "令一名其他角色交给你一张牌"; const history = player.getAllHistory("damage", function (evt) {
var history = player.getAllHistory("damage", function (evt) {
return evt.card && evt.card.name && lib.card[evt.card.name]; return evt.card && evt.card.name && lib.card[evt.card.name];
}); });
if (history.length) event.cardname = history[history.length - 1].card.name; if (history.length) event.cardname = history[history.length - 1].card.name;
if (event.cardname) { if (event.cardname) {
str += "若其如此做,视为你使用【" + get.translation(event.cardname) + "】"; str += "若其如此做,视为你使用【" + get.translation(event.cardname) + "】";
} }
var goon = true; let goon = true;
if (event.cardname) { if (event.cardname) {
goon = game.hasPlayer(function (current) { goon = game.hasPlayer(function (current) {
return player.canUse(event.cardname, current) && get.effect(current, { name: event.cardname }, player, player) > 0; return player.canUse(event.cardname, current) && get.effect(current, { name: event.cardname }, player, player) > 0;
}); });
} }
player const result = await player.chooseTarget(get.prompt("choulve"), str, function (card, player, target) {
.chooseTarget(get.prompt("choulve"), str, function (card, player, target) { return target != player && target.countCards("he");
return target != player && target.countCards("he"); }).set("ai", function (target) {
}) const event = get.event();
.set("ai", function (target) { if (!event.goon) return 0;
if (!_status.event.goon) return 0; var player = event.player;
var player = _status.event.player; if (get.attitude(player, target) >= 0 && get.attitude(target, player) >= 0) {
if (get.attitude(player, target) >= 0 && get.attitude(target, player) >= 0) { return Math.sqrt(target.countCards("he"));
return Math.sqrt(target.countCards("he")); }
} return 0;
return 0; }).set("goon", goon).forResult();
}) if(result.bool){
.set("goon", goon); result.cost_data = {cardname: event.cardname};
"step 1"; event.result = result;
if (result.bool) {
var target = result.targets[0];
player.logSkill("choulve", target);
target
.chooseCard("he", "是否交给" + get.translation(player) + "一张牌?", event.cardname ? "若如此做,视为" + get.translation(player) + "使用【" + get.translation(event.cardname) + "】" : null)
.set("ai", function (card) {
if (_status.event.goon) return 7 - get.value(card);
return 0;
})
.set("goon", get.attitude(target, player) > 1);
event.target = target;
} else {
event.finish();
} }
"step 2"; },
content: function () {
"step 0";
event.cardname = event.cost_data.cardname;
var target = targets[0];
target.chooseCard("he", "是否交给" + get.translation(player) + "一张牌?", event.cardname ? "若如此做,视为" + get.translation(player) + "使用【" + get.translation(event.cardname) + "】" : null).set("ai", function (card) {
if (_status.event.goon) return 7 - get.value(card);
return 0;
}).set("goon", get.attitude(target, player) > 1);
event.target = target;
"step 1";
if (result.bool) { if (result.bool) {
event.target.give(result.cards, player); event.target.give(result.cards, player);
if (event.cardname) { if (event.cardname) {