lib.skill.tspowei = {
audio:2,
dutySkill:true,
forced:true,
trigger:{
global:"damageEnd",
},
logTarget:"player",
filter:function(event,player){
return event.player&&event.player.isIn()&&event.player.hasMark('dulie');
},
content:function(){
trigger.player.removeMark('dulie',trigger.player.countMark('dulie'));
},
derivation:"shenzhu",
group:["tspowei_init","tspowei_move","tspowei_achieve","tspowei_fail","tspowei_use"],
subSkill:{
use:{
audio:"tspowei",
trigger:{
global:"phaseBegin",
},
direct:true,
filter:function(event,player){
return event.player!=player&&event.player.hasMark('dulie')&&
(player.countCards('h')>0||player.hp>=event.player.hp&&event.player.countCards('h')>0);
},
content:function(){
'step 0'
var list=[],target=trigger.player,choiceList=[
'弃置一张牌并对其造成1点伤害',
'获得其一张手牌',
];
event.target=target;
if(player.hasCard(function(card){
return lib.filter.cardDiscardable(card,player,'tspowei_use');
},'h')) list.push('选项一');
else choiceList[0]='<span style="opacity:0.5">'+choiceList[0]+'</span>';
if(player.hp>=target.hp&&target.countCards('h')>0) list.push('选项二');
else choiceList[1]='<span style="opacity:0.5">'+choiceList[1]+'</span>';
player.chooseControl(list,'cancel2').set('prompt',get.prompt('tspowei',target)).set('choiceList',choiceList).set('ai',function(){
var evt=_status.event.getParent();
if(evt.player.hasCard(function(card){
return lib.filter.cardDiscardable(card,evt.player,'tspowei_use')&&get.value(card,evt.player)<7;
},'h')&&get.damageEffect(evt.target,evt.player,evt.player)>0) return '选项一';
if(evt.player.hp>=evt.target.hp&&evt.target.countCards('h')>0&&get.attitude(evt.player,evt.target)<=0&&!evt.target.hasSkillTag('noh')) return '选项二';
return 'cancel2';
});
'step 1'
if(result.control!='cancel2'){
if(result.control=='选项二'){
player.logSkill('tspowei',target);
player.gainPlayerCard(target,'h',true);
event.goto(3);
}
}
else event.finish();
'step 2'
player.chooseToDiscard('h',true).logSkill=['tspowei_use',target];
target.damage();
'step 3'
player.addTempSkill('tspowei_inRange');
},
ai:{
expose:0.2,
},
sub:true,
},
inRange:{
charlotte:true,
mod:{
inRangeOf:function(from,to){
if(from==_status.currentPhase) return true;
},
},
sub:true,
},
init:{
audio:"tspowei",
trigger:{
global:"phaseBefore",
player:"enterGame",
},
forced:true,
filter:function(event,player){
return event.name!='phase'||game.phaseNumber==0;
},
logTarget:function(event,player){
return game.filterPlayer((current)=>current!=player&&!current.hasMark('dulie'));
},
content:function(){
var list=game.filterPlayer((current)=>current!=player&&!current.hasMark('dulie')).sortBySeat();
for(var i of list) i.addMark('dulie',1,false);
},
sub:true,
},
move:{
audio:"tspowei",
trigger:{
player:"phaseBegin",
},
forced:true,
filter:function(event,player){
return game.hasPlayer((current)=>current!=player&¤t.hasMark('dulie'));
},
content:function(){
var list=game.filterPlayer((current)=>current!=player&¤t.hasMark('dulie')).sortBySeat();
var map={};
for(var i of list){
var num=i.countMark('dulie');
i.removeMark('dulie',num);
map[i.playerid]=num;
}
for(var i of list){
var next=i.next;
if(next==player) next=next.next;
next.addMark('dulie',map[i.playerid]);
}
},
sub:true,
},
achieve:{
audio:"tspowei1",
trigger:{
player:"phaseBegin",
},
forced:true,
skillAnimation:true,
animationColor:"metal",
filter:function(event,player){
return !game.hasPlayer(function(current){
return current.hasMark('dulie');
});
},
content:function(){
game.log(player,'成功完成使命');
player.awakenSkill('tspowei');
player.shixiaoSkill('tspowei');
player.addSkillLog('shenzhu');
},
sub:true,
},
fail:{
audio:"tspowei2",
trigger:{
player:"dying",
},
forced:true,
content:function(){
'step 0'
game.log(player,'使命失败');
player.awakenSkill('tspowei');
player.failSkill('tspowei');
player.shixiaoSkill('tspowei');
if(player.hp<1) player.recover(1-player.hp);
'step 1'
var num=player.countCards('e');
if(num>0) player.chooseToDiscard('e',true,num);
},
sub:true,
},
},
}
audio:2,
dutySkill:true,
forced:true,
trigger:{
global:"damageEnd",
},
logTarget:"player",
filter:function(event,player){
return event.player&&event.player.isIn()&&event.player.hasMark('dulie');
},
content:function(){
trigger.player.removeMark('dulie',trigger.player.countMark('dulie'));
},
derivation:"shenzhu",
group:["tspowei_init","tspowei_move","tspowei_achieve","tspowei_fail","tspowei_use"],
subSkill:{
use:{
audio:"tspowei",
trigger:{
global:"phaseBegin",
},
direct:true,
filter:function(event,player){
return event.player!=player&&event.player.hasMark('dulie')&&
(player.countCards('h')>0||player.hp>=event.player.hp&&event.player.countCards('h')>0);
},
content:function(){
'step 0'
var list=[],target=trigger.player,choiceList=[
'弃置一张牌并对其造成1点伤害',
'获得其一张手牌',
];
event.target=target;
if(player.hasCard(function(card){
return lib.filter.cardDiscardable(card,player,'tspowei_use');
},'h')) list.push('选项一');
else choiceList[0]='<span style="opacity:0.5">'+choiceList[0]+'</span>';
if(player.hp>=target.hp&&target.countCards('h')>0) list.push('选项二');
else choiceList[1]='<span style="opacity:0.5">'+choiceList[1]+'</span>';
player.chooseControl(list,'cancel2').set('prompt',get.prompt('tspowei',target)).set('choiceList',choiceList).set('ai',function(){
var evt=_status.event.getParent();
if(evt.player.hasCard(function(card){
return lib.filter.cardDiscardable(card,evt.player,'tspowei_use')&&get.value(card,evt.player)<7;
},'h')&&get.damageEffect(evt.target,evt.player,evt.player)>0) return '选项一';
if(evt.player.hp>=evt.target.hp&&evt.target.countCards('h')>0&&get.attitude(evt.player,evt.target)<=0&&!evt.target.hasSkillTag('noh')) return '选项二';
return 'cancel2';
});
'step 1'
if(result.control!='cancel2'){
if(result.control=='选项二'){
player.logSkill('tspowei',target);
player.gainPlayerCard(target,'h',true);
event.goto(3);
}
}
else event.finish();
'step 2'
player.chooseToDiscard('h',true).logSkill=['tspowei_use',target];
target.damage();
'step 3'
player.addTempSkill('tspowei_inRange');
},
ai:{
expose:0.2,
},
sub:true,
},
inRange:{
charlotte:true,
mod:{
inRangeOf:function(from,to){
if(from==_status.currentPhase) return true;
},
},
sub:true,
},
init:{
audio:"tspowei",
trigger:{
global:"phaseBefore",
player:"enterGame",
},
forced:true,
filter:function(event,player){
return event.name!='phase'||game.phaseNumber==0;
},
logTarget:function(event,player){
return game.filterPlayer((current)=>current!=player&&!current.hasMark('dulie'));
},
content:function(){
var list=game.filterPlayer((current)=>current!=player&&!current.hasMark('dulie')).sortBySeat();
for(var i of list) i.addMark('dulie',1,false);
},
sub:true,
},
move:{
audio:"tspowei",
trigger:{
player:"phaseBegin",
},
forced:true,
filter:function(event,player){
return game.hasPlayer((current)=>current!=player&¤t.hasMark('dulie'));
},
content:function(){
var list=game.filterPlayer((current)=>current!=player&¤t.hasMark('dulie')).sortBySeat();
var map={};
for(var i of list){
var num=i.countMark('dulie');
i.removeMark('dulie',num);
map[i.playerid]=num;
}
for(var i of list){
var next=i.next;
if(next==player) next=next.next;
next.addMark('dulie',map[i.playerid]);
}
},
sub:true,
},
achieve:{
audio:"tspowei1",
trigger:{
player:"phaseBegin",
},
forced:true,
skillAnimation:true,
animationColor:"metal",
filter:function(event,player){
return !game.hasPlayer(function(current){
return current.hasMark('dulie');
});
},
content:function(){
game.log(player,'成功完成使命');
player.awakenSkill('tspowei');
player.shixiaoSkill('tspowei');
player.addSkillLog('shenzhu');
},
sub:true,
},
fail:{
audio:"tspowei2",
trigger:{
player:"dying",
},
forced:true,
content:function(){
'step 0'
game.log(player,'使命失败');
player.awakenSkill('tspowei');
player.failSkill('tspowei');
player.shixiaoSkill('tspowei');
if(player.hp<1) player.recover(1-player.hp);
'step 1'
var num=player.countCards('e');
if(num>0) player.chooseToDiscard('e',true,num);
},
sub:true,
},
},
}