Skip to content

Commit

Permalink
Merge pull request #1604 from PZ157/PR-Branch
Browse files Browse the repository at this point in the history
【天则】async化
  • Loading branch information
Spmario233 authored Jul 22, 2024
2 parents 49f2ea9 + 8475de3 commit 8329470
Showing 1 changed file with 28 additions and 33 deletions.
61 changes: 28 additions & 33 deletions character/sp2/skill.js
Original file line number Diff line number Diff line change
Expand Up @@ -5400,7 +5400,6 @@ const skills = {
tianze: {
audio: 2,
trigger: { global: "useCardAfter" },
direct: true,
filter: function (event, player) {
return (
player != event.player &&
Expand All @@ -5410,41 +5409,37 @@ const skills = {
return evt && evt.hs.length && evt.getParent() == event;
}) &&
event.player.isPhaseUsing() &&
!player.hasSkill("tianze_block")
);
},
content: function () {
"step 0";
player.addTempSkill("tianze_block");
if (
!player.hasCard(function (card) {
!player.hasSkill("tianze_block") &&
player.hasCard(card => {
if (_status.connectMode && get.position(card) == "h") return true;
return get.color(card, player) == "black";
}, "he")
)
event.finish();
else
player
.chooseToDiscard(
"he",
function (card, player) {
return get.color(card, player) == "black";
},
get.prompt("tianze", trigger.player),
"弃置一张黑色牌并对其造成1点伤害"
)
.set("ai", function (card) {
if (!_status.event.goon) return 0;
return 8 - get.value(card);
})
.set("goon", get.damageEffect(trigger.player, player, player) > 0).logSkill = ["tianze", trigger.player];
"step 1";
if (result.bool) {
if (get.mode() != "identity" || player.identity != "nei") player.addExpose(0.2);
trigger.player.damage();
} else event.finish();
"step 2";
game.delayx();
);
},
async cost(event, trigger, player) {
event.result = await player
.chooseToDiscard(
"he",
function (card, player) {
return get.color(card, player) == "black";
},
get.prompt("tianze", trigger.player),
"弃置一张黑色牌并对其造成1点伤害"
)
.set("ai", function (card) {
if (!_status.event.goon) return 0;
return 8 - get.value(card);
})
.set("goon", get.damageEffect(trigger.player, player, player) > 0)
.set("logSkill", ["tianze", trigger.player])
.forResult();
},
popup: false,
async content(event, trigger, player) {
player.addTempSkill("tianze_block");
if (get.mode() != "identity" || player.identity != "nei") player.addExpose(0.2);
await trigger.player.damage();
await game.asyncDelayx();
},
group: "tianze_draw",
subSkill: {
Expand Down

0 comments on commit 8329470

Please sign in to comment.