noname/card/standard.js

2483 lines
70 KiB
JavaScript
Raw Normal View History

'use strict';
2017-04-17 05:18:46 +00:00
game.import('card',function(lib,game,ui,get,ai,_status){
2017-04-15 00:25:50 +00:00
return {
name:'standard',
connect:true,
card:{
damage:{
ai:{
result:{
target:-1.5
},
tag:{
damage:1
}
2015-04-29 03:25:17 +00:00
}
2017-04-15 00:25:50 +00:00
},
recover:{
ai:{
result:{
target:1.5
},
tag:{
recover:1
}
2015-04-29 03:25:17 +00:00
}
2017-04-15 00:25:50 +00:00
},
firedamage:{
ai:{
result:{
target:-1.5
},
tag:{
damage:1,
fireDamage:1,
natureDamage:1,
}
2015-04-29 03:25:17 +00:00
}
2017-04-15 00:25:50 +00:00
},
thunderdamage:{
ai:{
result:{
target:-1.5
},
tag:{
damage:1,
thunderDamage:1,
natureDamage:1,
}
2015-04-29 03:25:17 +00:00
}
2017-04-15 00:25:50 +00:00
},
respondShan:{
ai:{
result:{
target:-1.5,
},
tag:{
respond:1,
respondShan:1,
damage:1
}
2015-04-29 03:25:17 +00:00
}
},
2017-04-15 00:25:50 +00:00
sha:{
audio:true,
fullskin:true,
nature:['thunder','fire'],
type:'basic',
enable:true,
usable:1,
range:{attack:1},
selectTarget:1,
filterTarget:function(card,player,target){return player!=target},
content:function(){
"step 0"
2017-07-13 02:23:11 +00:00
if(typeof event.shanRequired!='number'||!event.shanRequired||event.shanRequired<0){
event.shanRequired=1;
}
2019-11-22 05:15:05 +00:00
if(typeof event.baseDamage!='number') event.baseDamage=1;
if(typeof event.extraDamage!='number') event.extraDamage=0;
2017-07-13 02:23:11 +00:00
"step 1"
2019-12-07 12:48:38 +00:00
if(event.directHit||(!_status.connectMode&&lib.config.skip_shan&&!target.hasShan())){
2017-04-15 00:25:50 +00:00
event._result={bool:false};
}
2017-11-07 11:58:19 +00:00
else if(event.skipShan){
2019-12-25 05:19:50 +00:00
event._result={bool:true,result:'shaned'};
2017-11-07 11:58:19 +00:00
}
2017-04-15 00:25:50 +00:00
else{
2019-12-05 15:05:56 +00:00
var next=target.chooseToUse('请使用一张闪响应杀');
2019-12-09 14:50:07 +00:00
next.set('type','respondShan');
2019-12-05 15:05:56 +00:00
next.set('filterCard',function(card,player){
if(get.name(card)!='shan') return false;
return lib.filter.cardEnabled(card,player,'forceEnable');
});
2017-07-13 02:23:11 +00:00
if(event.shanRequired>1){
2019-12-05 15:05:56 +00:00
next.set('prompt2','(共需使用'+event.shanRequired+'张闪)');
2017-07-13 02:23:11 +00:00
}
2019-12-05 15:05:56 +00:00
next.set('ai1',function(card){
2017-04-15 00:25:50 +00:00
var target=_status.event.player;
var evt=_status.event.getParent();
2019-12-05 15:05:56 +00:00
var bool=true;
2019-12-12 15:00:19 +00:00
if(_status.event.shanRequired>1&&!get.is.object(card)&&target.countCards('h','shan')<_status.event.shanRequired){
2019-12-05 15:05:56 +00:00
bool=false;
2017-07-13 02:23:11 +00:00
}
2019-12-05 15:05:56 +00:00
else if(target.hasSkillTag('useShan')){
bool=true;
2015-12-08 13:54:44 +00:00
}
2019-12-05 15:05:56 +00:00
else if(target.hasSkillTag('noShan')){
bool=false;
2017-12-31 10:52:23 +00:00
}
2019-12-05 15:05:56 +00:00
else if(get.damageEffect(target,evt.player,target,evt.card.nature)>=0) bool=false;
if(bool){
if(typeof card=='string'){
var info=get.info(card);
if(info.ai&&info.ai.order){
if(typeof info.ai.order=='number'){
return info.ai.order;
}
else if(typeof info.ai.order=='function'){
return info.ai.order();
}
}
}
return 3;
}
return 0;
2017-07-13 02:23:11 +00:00
}).set('shanRequired',event.shanRequired);
2019-12-05 15:05:56 +00:00
next.set('respondTo',[player,card]);
//next.autochoose=lib.filter.autoRespondShan;
2017-04-15 00:25:50 +00:00
}
2017-07-13 02:23:11 +00:00
"step 2"
2019-12-12 15:00:19 +00:00
if(!result||!result.bool||!result.result||result.result!='shaned'){
2017-04-15 00:25:50 +00:00
event.trigger('shaHit');
}
else{
2017-07-13 02:23:11 +00:00
event.shanRequired--;
if(event.shanRequired>0){
event.goto(1);
}
else{
event.trigger('shaMiss');
event.responded=result;
}
2017-04-15 00:25:50 +00:00
}
2017-07-13 02:23:11 +00:00
"step 3"
2019-12-12 15:00:19 +00:00
if((!result||!result.bool||!result.result||result.result!='shaned')&&!event.unhurt){
2019-06-17 07:19:46 +00:00
target.damage(get.nature(event.card),event.baseDamage+event.extraDamage);
2017-04-15 00:25:50 +00:00
event.result={bool:true}
event.trigger('shaDamage');
}
else{
event.result={bool:false}
event.trigger('shaUnhirt');
}
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
ai:{
basic:{
useful:[5,1],
value:[5,1],
2015-04-29 03:25:17 +00:00
},
2020-03-25 12:27:23 +00:00
order:function(item){
2017-04-15 00:25:50 +00:00
if(_status.event.player.hasSkillTag('presha',true,null,true)) return 10;
2020-03-25 12:27:23 +00:00
if(lib.linked.contains(get.nature(item))) return 3.1;
2017-04-15 00:25:50 +00:00
return 3;
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
result:{
2020-03-25 12:27:23 +00:00
target:function(player,target,card,isLink){
if(!isLink&&player.hasSkill('jiu')&&!target.hasSkillTag('filterDamage',null,{
2020-02-14 05:33:43 +00:00
player:player,
2020-03-23 09:11:24 +00:00
card:card,
jiu:true,
2020-02-14 05:33:43 +00:00
})){
2017-04-15 00:25:50 +00:00
if(get.attitude(player,target)>0){
2020-02-14 05:33:43 +00:00
return -7;
2017-04-15 00:25:50 +00:00
}
else{
2020-02-14 05:33:43 +00:00
return -4;
2017-04-15 00:25:50 +00:00
}
}
return -1.5;
},
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
tag:{
respond:1,
respondShan:1,
damage:function(card){
if(card.nature=='poison') return;
return 1;
},
natureDamage:function(card){
if(card.nature) return 1;
},
fireDamage:function(card,nature){
if(card.nature=='fire') return 1;
},
thunderDamage:function(card,nature){
if(card.nature=='thunder') return 1;
},
poisonDamage:function(card,nature){
if(card.nature=='poison') return 1;
}
2015-04-29 03:25:17 +00:00
}
}
2017-04-15 00:25:50 +00:00
},
shacopy:{
ai:{
basic:{
useful:[5,1],
value:[5,1],
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
order:3,
result:{
target:-1.5,
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
tag:{
respond:1,
respondShan:1,
damage:function(card){
if(card.nature=='poison') return;
return 1;
},
natureDamage:function(card){
if(card.nature) return 1;
},
fireDamage:function(card,nature){
if(card.nature=='fire') return 1;
},
thunderDamage:function(card,nature){
if(card.nature=='thunder') return 1;
},
poisonDamage:function(card,nature){
if(card.nature=='poison') return 1;
}
2015-04-29 03:25:17 +00:00
}
}
2016-05-11 15:50:00 +00:00
},
2017-04-15 00:25:50 +00:00
shan:{
audio:true,
fullskin:true,
type:'basic',
2017-05-01 06:19:34 +00:00
cardcolor:'red',
2019-12-05 15:05:56 +00:00
notarget:true,
2020-02-14 05:33:43 +00:00
nodelay:true,
2019-12-05 15:05:56 +00:00
content:function(){
event.result='shaned';
2020-02-14 05:33:43 +00:00
event.getParent().delayx=false;
game.delay(0.5);
2019-12-05 15:05:56 +00:00
},
2017-04-15 00:25:50 +00:00
ai:{
basic:{
useful:[7,2],
2019-12-05 15:05:56 +00:00
value:[7,2],
},
result:{player:1},
2019-12-06 04:56:09 +00:00
//expose:0.2
2017-04-15 00:25:50 +00:00
}
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
tao:{
fullskin:true,
type:'basic',
2017-05-01 06:19:34 +00:00
cardcolor:'red',
2017-07-06 16:25:54 +00:00
toself:true,
2017-04-15 00:25:50 +00:00
enable:function(card,player){
return player.hp<player.maxHp;
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
savable:true,
selectTarget:-1,
filterTarget:function(card,player,target){
return target==player&&target.hp<target.maxHp;
},
modTarget:function(card,player,target){
return target.hp<target.maxHp;
},
content:function(){
2020-01-11 12:17:57 +00:00
target.recover(event.baseDamage||1);
2017-04-15 00:25:50 +00:00
},
ai:{
basic:{
order:function(card,player){
if(player.hasSkillTag('pretao')) return 5;
return 2;
},
useful:[8,6.5,5,4],
value:[8,6.5,5,4],
},
result:{
target:function(player,target){
// if(player==target&&player.hp<=0) return 2;
2019-10-09 14:31:43 +00:00
if(player.hasSkillTag('nokeep')) return 2;
2017-04-15 00:25:50 +00:00
var nd=player.needsToDiscard();
var keep=false;
if(nd<=0){
keep=true;
}
else if(nd==1&&target.hp>=2&&target.countCards('h','tao')<=1){
keep=true;
}
var mode=get.mode();
if(target.hp>=2&&keep&&target.hasFriend()){
if(target.hp>2||nd==0) return 0;
if(target.hp==2){
if(game.hasPlayer(function(current){
if(target!=current&&get.attitude(target,current)>=3){
if(current.hp<=1) return true;
if((mode=='identity'||mode=='versus'||mode=='chess')&&current.identity=='zhu'&&current.hp<=2) return true;
}
})){
return 0;
2015-06-27 16:21:25 +00:00
}
2017-04-15 00:25:50 +00:00
}
}
if(target.hp<0&&target!=player&&target.identity!='zhu') return 0;
var att=get.attitude(player,target);
if(att<3&&att>=0&&player!=target) return 0;
var tri=_status.event.getTrigger();
if(mode=='identity'&&player.identity=='fan'&&target.identity=='fan'){
if(tri&&tri.name=='dying'&&tri.source&&tri.source.identity=='fan'&&tri.source!=target){
var num=game.countPlayer(function(current){
if(current.identity=='fan'){
return current.countCards('h','tao');
}
});
if(num>1&&player==target) return 2;
2017-02-11 14:16:35 +00:00
return 0;
2015-06-27 16:21:25 +00:00
}
}
2017-04-15 00:25:50 +00:00
if(mode=='identity'&&player.identity=='zhu'&&target.identity=='nei'){
if(tri&&tri.name=='dying'&&tri.source&&tri.source.identity=='zhong'){
return 0;
}
2015-04-29 03:25:17 +00:00
}
2017-04-15 00:25:50 +00:00
if(mode=='stone'&&target.isMin()&&
player!=target&&tri&&tri.name=='dying'&&player.side==target.side&&
tri.source!=target.getEnemy()){
return 0;
}
2017-04-15 00:25:50 +00:00
return 2;
},
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
tag:{
recover:1,
save:1,
}
2015-04-29 03:25:17 +00:00
}
},
2017-04-15 00:25:50 +00:00
bagua:{
fullskin:true,
type:'equip',
subtype:'equip2',
ai:{
basic:{
equipValue:7.5
}
},
skills:['bagua_skill']
},
jueying:{
fullskin:true,
type:'equip',
subtype:'equip3',
distance:{globalTo:1},
},
dilu:{
fullskin:true,
type:'equip',
subtype:'equip3',
distance:{globalTo:1},
},
zhuahuang:{
fullskin:true,
type:'equip',
subtype:'equip3',
distance:{globalTo:1},
},
chitu:{
fullskin:true,
type:'equip',
subtype:'equip4',
distance:{globalFrom:-1},
},
dawan:{
fullskin:true,
type:'equip',
subtype:'equip4',
distance:{globalFrom:-1},
},
zixin:{
fullskin:true,
type:'equip',
subtype:'equip4',
distance:{globalFrom:-1},
},
zhuge:{
fullskin:true,
type:'equip',
subtype:'equip1',
ai:{
2020-02-16 04:25:41 +00:00
order:function(){
return get.order({name:'sha'})-0.1;
},
2017-05-22 03:18:10 +00:00
equipValue:function(card,player){
if(!game.hasPlayer(function(current){
2019-10-19 11:18:56 +00:00
return player.canUse('sha',current)&&get.distance(player,current)<=1&&get.effect(current,{name:'sha'},player,player)>0;
2017-05-22 03:18:10 +00:00
})){
return 1;
}
if(player.hasSha()&&_status.currentPhase==player){
2019-10-19 11:18:56 +00:00
if(player.getEquip('zhuge')&&player.countUsed('sha')||player.getCardUsable('sha')==0){
2017-05-22 03:18:10 +00:00
return 10;
2017-04-15 00:25:50 +00:00
}
2017-04-02 08:29:11 +00:00
}
2017-05-22 03:18:10 +00:00
var num=player.countCards('h','sha');
2018-08-06 17:01:36 +00:00
if(num>1) return 6+num;
return 3+num;
2017-05-22 03:18:10 +00:00
},
basic:{
equipValue:5
2017-04-15 00:25:50 +00:00
},
tag:{
valueswap:1
2015-04-29 03:25:17 +00:00
}
2017-04-02 08:29:11 +00:00
},
2017-04-15 00:25:50 +00:00
skills:['zhuge_skill']
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
cixiong:{
fullskin:true,
type:'equip',
subtype:'equip1',
distance:{attackFrom:-1},
ai:{
basic:{
equipValue:2
}
},
skills:['cixiong_skill']
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
qinggang:{
fullskin:true,
type:'equip',
subtype:'equip1',
distance:{attackFrom:-1},
ai:{
basic:{
equipValue:2
}
},
skills:['qinggang_skill']
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
qinglong:{
fullskin:true,
type:'equip',
subtype:'equip1',
distance:{attackFrom:-2},
ai:{
2017-05-22 03:18:10 +00:00
equipValue:function(card,player){
return Math.min(2.5+player.countCards('h','sha'),4);
},
2017-04-15 00:25:50 +00:00
basic:{
2017-05-22 03:18:10 +00:00
equipValue:3.5
2015-04-29 03:25:17 +00:00
}
2017-04-15 00:25:50 +00:00
},
2018-08-13 07:17:34 +00:00
skills:['qinglong_skill','qinglong_guozhan']
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
zhangba:{
fullskin:true,
type:'equip',
subtype:'equip1',
distance:{attackFrom:-2},
ai:{
2017-05-22 03:18:10 +00:00
equipValue:function(card,player){
var num=2.5+player.countCards('h')/3;
return Math.min(num,4);
},
2017-04-15 00:25:50 +00:00
basic:{
2017-05-22 03:18:10 +00:00
equipValue:3.5
2015-04-29 03:25:17 +00:00
}
2017-04-15 00:25:50 +00:00
},
skills:['zhangba_skill']
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
guanshi:{
fullskin:true,
type:'equip',
subtype:'equip1',
distance:{attackFrom:-2},
ai:{
2017-05-22 03:18:10 +00:00
equipValue:function(card,player){
var num=2.5+(player.countCards('h')+player.countCards('e'))/2.5;
return Math.min(num,5);
},
2017-04-15 00:25:50 +00:00
basic:{
2017-05-22 03:18:10 +00:00
equipValue:4.5,
2015-04-29 03:25:17 +00:00
}
2017-04-15 00:25:50 +00:00
},
skills:['guanshi_skill']
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
fangtian:{
fullskin:true,
type:'equip',
subtype:'equip1',
distance:{attackFrom:-3},
ai:{
basic:{
equipValue:2.5
}
},
2018-08-13 07:17:34 +00:00
skills:['fangtian_skill','fangtian_guozhan']
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
qilin:{
fullskin:true,
type:'equip',
subtype:'equip1',
distance:{attackFrom:-4},
ai:{
basic:{
equipValue:3
}
},
skills:['qilin_skill']
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
wugu:{
audio:true,
fullskin:true,
type:'trick',
enable:true,
2017-07-13 01:28:29 +00:00
cardcolor:'red',
2019-12-29 10:04:02 +00:00
selectTarget:-1,
2017-04-15 00:25:50 +00:00
filterTarget:true,
contentBefore:function(){
"step 0"
if(get.is.versus()){
player.chooseControl('顺时针','逆时针',function(event,player){
if(player.next.side==player.side) return '逆时针';
return '顺时针';
}).set('prompt','选择'+get.translation(card)+'的结算方向');
2017-02-08 01:53:23 +00:00
}
2017-04-15 00:25:50 +00:00
else{
2020-03-05 13:10:37 +00:00
event.goto(2);
2017-04-15 00:25:50 +00:00
}
2020-03-05 13:10:37 +00:00
"step 1"
2017-04-15 00:25:50 +00:00
if(result&&result.control=='顺时针'){
var evt=event.getParent();
evt.fixedSeat=true;
evt.targets.sortBySeat();
evt.targets.reverse();
if(evt.targets[evt.targets.length-1]==player){
evt.targets.unshift(evt.targets.pop());
}
}
2020-03-05 13:10:37 +00:00
"step 2"
2017-04-15 00:25:50 +00:00
ui.clear();
2017-04-23 06:40:20 +00:00
var num;
2020-03-05 13:10:37 +00:00
if(event.targets){
num=event.targets.length;
2017-04-23 06:40:20 +00:00
}
else{
num=game.countPlayer();
}
var cards=get.cards(num);
2020-03-05 13:10:37 +00:00
game.cardsGotoOrdering(cards).relatedEvent=event.getParent();
2016-04-02 08:05:24 +00:00
var dialog=ui.create.dialog('五谷丰登',cards,true);
_status.dieClose.push(dialog);
2017-04-15 00:25:50 +00:00
dialog.videoId=lib.status.videoId++;
game.addVideo('cardDialog',null,['五谷丰登',get.cardsInfo(cards),dialog.videoId]);
event.getParent().preResult=dialog.videoId;
game.broadcast(function(cards,id){
var dialog=ui.create.dialog('五谷丰登',cards,true);
_status.dieClose.push(dialog);
dialog.videoId=id;
},cards,dialog.videoId);
2017-11-18 10:26:57 +00:00
game.log(event.card,'亮出了',cards);
2017-04-15 00:25:50 +00:00
},
content:function(){
"step 0"
for(var i=0;i<ui.dialogs.length;i++){
if(ui.dialogs[i].videoId==event.preResult){
event.dialog=ui.dialogs[i];break;
}
}
if(!event.dialog){
event.finish();
return;
}
if(event.dialog.buttons.length>1){
var next=target.chooseButton(true,function(button){
return get.value(button.link,_status.event.player);
});
next.set('dialog',event.preResult);
next.set('closeDialog',false);
next.set('dialogdisplay',true);
}
else{
event.directButton=event.dialog.buttons[0];
}
"step 1"
var dialog=event.dialog;
var card;
if(event.directButton){
card=event.directButton.link;
}
else{
card=result.links[0];
2015-11-04 01:59:00 +00:00
}
2016-04-02 08:05:24 +00:00
2017-04-15 00:25:50 +00:00
var button;
for(var i=0;i<dialog.buttons.length;i++){
if(dialog.buttons[i].link==card){
button=dialog.buttons[i];
2020-01-05 09:03:08 +00:00
button.querySelector('.info').innerHTML=get.translation(target);
2017-04-15 00:25:50 +00:00
dialog.buttons.remove(button);
break;
}
2016-04-02 08:05:24 +00:00
}
2017-04-15 00:25:50 +00:00
var capt=get.translation(target)+'选择了'+get.translation(button.link);
if(card){
2020-03-19 13:24:54 +00:00
target.gain(card,'visible');
2017-04-15 00:25:50 +00:00
target.$gain2(card);
game.broadcast(function(card,id,name,capt){
var dialog=get.idDialog(id);
if(dialog){
dialog.content.firstChild.innerHTML=capt;
for(var i=0;i<dialog.buttons.length;i++){
if(dialog.buttons[i].link==card){
dialog.buttons[i].querySelector('.info').innerHTML=name;
dialog.buttons.splice(i--,1);
break;
}
}
}
2020-01-05 09:03:08 +00:00
},card,dialog.videoId,get.translation(target),capt);
2017-04-15 00:25:50 +00:00
}
dialog.content.firstChild.innerHTML=capt;
game.addVideo('dialogCapt',null,[dialog.videoId,dialog.content.firstChild.innerHTML]);
game.log(target,'选择了',button.link);
game.delay();
},
contentAfter:function(){
for(var i=0;i<ui.dialogs.length;i++){
if(ui.dialogs[i].videoId==event.preResult){
var dialog=ui.dialogs[i];
dialog.close();
_status.dieClose.remove(dialog);
if(dialog.buttons.length){
event.remained=[];
for(var i=0;i<dialog.buttons.length;i++){
event.remained.push(dialog.buttons[i].link);
2016-04-02 08:05:24 +00:00
}
2017-04-15 00:25:50 +00:00
event.trigger('wuguRemained');
2016-04-02 08:05:24 +00:00
}
2017-04-15 00:25:50 +00:00
break;
2016-04-02 08:05:24 +00:00
}
2017-04-15 00:25:50 +00:00
}
game.broadcast(function(id){
var dialog=get.idDialog(id);
if(dialog){
dialog.close();
_status.dieClose.remove(dialog);
}
},event.preResult);
game.addVideo('cardDialog',null,event.preResult);
},
ai:{
wuxie:function(){
if(Math.random()<0.5) return 0;
},
basic:{
order:3,
useful:1,
},
result:{
target:function(player,target){
if(get.is.versus()){
if(target==player) return 1.5;
return 1;
2017-02-05 11:55:50 +00:00
}
2017-04-15 00:25:50 +00:00
if(player.hasUnknown(2)){
return 0;
}
return 2-2*get.distance(player,target,'absolute')/game.countPlayer();
2017-02-05 11:55:50 +00:00
}
2017-04-15 00:25:50 +00:00
},
tag:{
draw:1,
multitarget:1
2015-11-04 01:59:00 +00:00
}
}
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
taoyuan:{
audio:true,
fullskin:true,
type:'trick',
enable:true,
2019-12-29 10:04:02 +00:00
selectTarget:-1,
2018-01-11 15:07:44 +00:00
cardcolor:'red',
2019-10-09 14:31:43 +00:00
reverseOrder:true,
2017-04-15 00:25:50 +00:00
filterTarget:function(card,player,target){
2019-06-17 07:19:46 +00:00
//return target.hp<target.maxHp;
return true;
2015-05-02 14:43:52 +00:00
},
2019-10-09 14:31:43 +00:00
ignoreTarget:function(card,player,target){
return target.isHealthy();
2019-07-31 12:01:43 +00:00
},
2017-04-15 00:25:50 +00:00
content:function(){
target.recover();
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
ai:{
basic:{
2020-03-19 13:24:54 +00:00
order:function(){
return 11;
2020-03-19 13:24:54 +00:00
},
2017-04-15 00:25:50 +00:00
useful:[3,1],
value:0
},
result:{
target:function(player,target){
return (target.hp<target.maxHp)?2:0;
2015-04-29 03:25:17 +00:00
}
2017-04-15 00:25:50 +00:00
},
tag:{
recover:0.5,
multitarget:1
2015-04-29 03:25:17 +00:00
}
}
},
2017-04-15 00:25:50 +00:00
nanman:{
audio:true,
fullskin:true,
type:'trick',
enable:true,
2019-12-29 10:04:02 +00:00
selectTarget:-1,
2017-04-15 00:25:50 +00:00
filterTarget:function(card,player,target){
return target!=player;
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
reverseOrder:true,
content:function(){
"step 0"
2019-11-22 05:15:05 +00:00
if(typeof event.baseDamage!='number') event.baseDamage=1;
2019-10-31 04:40:01 +00:00
if(event.directHit) event._result={bool:false};
else{
var next=target.chooseToRespond({name:'sha'});
next.set('ai',function(card){
var evt=_status.event.getParent();
if(get.damageEffect(evt.target,evt.player,evt.target)>=0) return 0;
if(evt.player.hasSkillTag('notricksource')) return 0;
if(evt.target.hasSkillTag('notrick')) return 0;
return 11-get.value(card);
});
next.autochoose=lib.filter.autoRespondSha;
}
2017-04-15 00:25:50 +00:00
"step 1"
if(result.bool==false){
2020-01-03 15:34:12 +00:00
target.damage(event.baseDamage,event.customSource||player);
2015-04-29 03:25:17 +00:00
}
},
2017-04-15 00:25:50 +00:00
ai:{
wuxie:function(target,card,player,viewer){
if(get.attitude(viewer,target)>0&&target.countCards('h','sha')){
if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0;
2015-12-06 15:23:47 +00:00
}
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
basic:{
order:9,
useful:[5,1],
value:5
},
result:{
target:function(player,target){
if(player.hasUnknown(2)&&get.mode()!='guozhan') return 0;
var nh=target.countCards('h');
if(get.mode()=='identity'){
if(target.isZhu&&nh<=2&&target.hp<=1) return -100;
}
if(nh==0) return -2;
if(nh==1) return -1.7
return -1.5;
},
},
tag:{
respond:1,
respondSha:1,
damage:1,
multitarget:1,
multineg:1,
}
2015-04-29 03:25:17 +00:00
}
},
2017-04-15 00:25:50 +00:00
wanjian:{
audio:true,
fullskin:true,
type:'trick',
enable:true,
2019-12-29 10:04:02 +00:00
selectTarget:-1,
2017-04-15 00:25:50 +00:00
reverseOrder:true,
filterTarget:function(card,player,target){
return target!=player;
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
content:function(){
"step 0"
2019-11-22 05:15:05 +00:00
if(typeof event.baseDamage!='number') event.baseDamage=1;
2019-10-31 04:40:01 +00:00
if(event.directHit) event._result={bool:false};
else{
var next=target.chooseToRespond({name:'shan'});
next.set('ai',function(card){
var evt=_status.event.getParent();
if(get.damageEffect(evt.target,evt.player,evt.target)>=0) return 0;
if(evt.player.hasSkillTag('notricksource')) return 0;
if(evt.target.hasSkillTag('notrick')) return 0;
if(evt.target.hasSkillTag('noShan')){
return -1;
}
2017-04-15 00:25:50 +00:00
return 11-get.value(card);
2019-10-31 04:40:01 +00:00
});
next.autochoose=lib.filter.autoRespondShan;
}
2017-04-15 00:25:50 +00:00
"step 1"
if(result.bool==false){
2019-11-22 05:15:05 +00:00
target.damage(event.baseDamage);
2017-04-15 00:25:50 +00:00
}
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
ai:{
wuxie:function(target,card,player,viewer){
if(get.attitude(viewer,target)>0&&target.countCards('h','shan')){
if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0;
2015-12-06 15:23:47 +00:00
}
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
basic:{
order:9,
useful:1,
value:5
},
result:{
target:function(player,target){
if(player.hasUnknown(2)&&get.mode()!='guozhan') return 0;
var nh=target.countCards('h');
if(get.mode()=='identity'){
if(target.isZhu&&nh<=2&&target.hp<=1) return -100;
}
if(nh==0) return -2;
if(nh==1) return -1.7
return -1.5;
},
},
tag:{
respond:1,
respondShan:1,
damage:1,
multitarget:1,
multineg:1,
2017-02-08 01:53:23 +00:00
}
}
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
wuzhong:{
audio:true,
fullskin:true,
type:'trick',
enable:true,
selectTarget:-1,
2017-05-01 06:19:34 +00:00
cardcolor:'red',
2017-07-06 16:25:54 +00:00
toself:true,
2017-04-15 00:25:50 +00:00
filterTarget:function(card,player,target){
return target==player;
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
modTarget:true,
content:function(){
if(get.is.versus()){
if(game.friend.contains(target)){
if(game.friend.length<game.enemy.length){
target.draw(3);return;
2015-04-29 03:25:17 +00:00
}
}
else{
2017-04-15 00:25:50 +00:00
if(game.friend.length>game.enemy.length){
target.draw(3);return;
2015-04-29 03:25:17 +00:00
}
}
}
2017-04-15 00:25:50 +00:00
target.draw(2);
},
ai:{
basic:{
order:7.2,
2017-07-20 00:52:37 +00:00
useful:4.5,
2017-04-15 00:25:50 +00:00
value:9.2
},
result:{
target:2,
},
tag:{
draw:2
2015-04-29 03:25:17 +00:00
}
}
2017-04-15 00:25:50 +00:00
},
juedou:{
audio:true,
fullskin:true,
type:'trick',
enable:true,
filterTarget:function(card,player,target){
return target!=player;
},
content:function(){
"step 0"
if(event.turn==undefined) event.turn=target;
2019-11-22 05:15:05 +00:00
if(typeof event.baseDamage!='number') event.baseDamage=1;
2019-07-14 10:57:05 +00:00
if(typeof event.extraDamage!='number'){
event.extraDamage=0;
2019-11-22 05:15:05 +00:00
if(!event.shaReq) event.shaReq={};
if(typeof event.shaReq[player.playerid]!='number') event.shaReq[player.playerid]=1;
if(typeof event.shaReq[target.playerid]!='number') event.shaReq[target.playerid]=1;
2019-07-14 10:57:05 +00:00
}
event.playerCards=[];
event.targetCards=[];
2017-04-15 00:25:50 +00:00
"step 1"
event.trigger('juedou');
2019-11-22 05:15:05 +00:00
event.shaRequired=event.shaReq[event.turn.playerid];
2017-04-15 00:25:50 +00:00
"step 2"
if(event.directHit){
event._result={bool:false};
2015-04-29 03:25:17 +00:00
}
else{
2017-04-15 00:25:50 +00:00
var next=event.turn.chooseToRespond({name:'sha'});
2019-11-22 05:15:05 +00:00
if(event.shaRequired>1){
next.set('prompt2','共需打出'+event.shaRequired+'张杀')
}
2017-04-15 00:25:50 +00:00
next.set('ai',function(card){
var event=_status.event;
var player=event.splayer;
var target=event.starget;
if(player.hasSkillTag('notricksource')) return 0;
if(target.hasSkillTag('notrick')) return 0;
2019-11-22 05:15:05 +00:00
if(event.shaRequired>1&&player.countCards('h','sha')<event.shaRequired) return 0;
2017-04-15 00:25:50 +00:00
if(event.player==target){
if(player.hasSkill('naman')) return -1;
if(get.attitude(target,player)<0||event.player.hp<=1){
return get.unuseful2(card)
}
return -1;
}
else{
if(target.hasSkill('naman')) return -1;
if(get.attitude(player,target)<0||event.player.hp<=1){
return get.unuseful2(card)
}
return -1;
}
});
next.set('splayer',player);
next.set('starget',target);
2019-11-22 05:15:05 +00:00
next.set('shaRequired',event.shaRequired);
2017-04-15 00:25:50 +00:00
next.autochoose=lib.filter.autoRespondSha;
2015-12-03 16:28:06 +00:00
if(event.turn==target){
2017-04-15 00:25:50 +00:00
next.source=player;
}
else{
next.source=target;
}
}
"step 3"
if(event.target.isDead()||event.player.isDead()){
event.finish();
}
else{
if(result.bool){
2019-11-22 05:15:05 +00:00
event.shaRequired--;
2019-07-14 10:57:05 +00:00
if(event.turn==target){
2019-08-24 15:41:12 +00:00
if(result.cards) event.targetCards.addArray(result.cards);
2019-11-22 05:15:05 +00:00
if(event.shaRequired>0) event.goto(2);
else{
event.turn=player;
event.goto(1);
}
2019-07-14 10:57:05 +00:00
}
else{
2019-08-24 15:41:12 +00:00
if(result.cards) event.playerCards.addArray(result.cards);
2019-11-22 05:15:05 +00:00
if(event.shaRequired>0) event.goto(2);
else{
event.turn=target;
event.goto(1);
}
2019-07-14 10:57:05 +00:00
}
2015-12-03 16:28:06 +00:00
}
else{
2017-04-15 00:25:50 +00:00
if(event.turn==target){
2019-08-24 15:41:12 +00:00
target.damage(event.baseDamage+event.extraDamage);
2017-04-15 00:25:50 +00:00
}
else{
2019-07-14 10:57:05 +00:00
player.damage(target,event.baseDamage+event.extraDamage);
2017-04-15 00:25:50 +00:00
}
}
}
},
ai:{
2019-12-28 14:03:35 +00:00
wuxie:function(target,card,player,viewer){
if(player==game.me&&get.attitude(viewer,player)>0){
return 0;
}
},
2017-04-15 00:25:50 +00:00
basic:{
order:5,
useful:1,
2018-01-10 10:21:50 +00:00
value:5.5
2017-04-15 00:25:50 +00:00
},
result:{
target:-1.5,
player:function(player,target){
if(get.damageEffect(target,player,target)>0&&get.attitude(player,target)>0&&get.attitude(target,player)>0){
return 0;
}
var hs1=target.getCards('h','sha');
var hs2=player.getCards('h','sha');
if(hs1.length>hs2.length+1){
return -2;
}
var hsx=target.getCards('h');
if(hsx.length>2&&hs2.length==0&&hsx[0].number<6){
return -2;
}
if(hsx.length>3&&hs2.length==0){
return -2;
}
if(hs1.length>hs2.length&&(!hs2.length||hs1[0].number>hs2[0].number)){
return -2;
}
return -0.5;
2015-12-03 16:28:06 +00:00
}
2017-04-15 00:25:50 +00:00
},
tag:{
respond:2,
respondSha:2,
damage:1,
2015-04-29 03:25:17 +00:00
}
}
},
2017-04-15 00:25:50 +00:00
shunshou:{
audio:true,
fullskin:true,
type:'trick',
enable:true,
range:{global:1},
selectTarget:1,
postAi:function(targets){
return targets.length==1&&targets[0].countCards('j');
},
filterTarget:function(card,player,target){
if(player==target) return false;
2019-11-07 14:38:08 +00:00
return target.countGainableCards(player,get.is.single()?'he':'hej')>0;
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
content:function(){
2019-11-07 14:38:08 +00:00
var position=get.is.single()?'he':'hej';
if(target.countGainableCards(player,position)){
player.gainPlayerCard(position,target,true);
2017-04-15 00:25:50 +00:00
}
},
ai:{
wuxie:function(target,card,player,viewer){
if(get.attitude(viewer,player)>0&&get.attitude(viewer,target)>0){
2015-04-29 03:25:17 +00:00
return 0;
}
2017-04-15 00:25:50 +00:00
},
basic:{
order:7.5,
useful:4,
value:9
},
result:{
target:function(player,target){
if(get.attitude(player,target)<=0) return (target.countCards('he')>0)?-1.5:1.5;
var js=target.getCards('j');
if(js.length){
var jj=js[0].viewAs?{name:js[0].viewAs}:js[0];
if(jj.name=='shunshou') return 3;
if(js.length==1&&get.effect(target,jj,target,player)>=0){
return -1.5;
}
return 3;
}
return -1.5;
},
player:function(player,target){
if(get.attitude(player,target)<0&&!target.countCards('he')){
return 0;
}
if(get.attitude(player,target)>1){
var js=target.getCards('j');
if(js.length){
var jj=js[0].viewAs?{name:js[0].viewAs}:js[0];
if(jj.name=='shunshou') return 1;
if(js.length==1&&get.effect(target,jj,target,player)>=0){
return 0;
}
return 1;
}
return 0;
}
return 1;
2015-04-29 03:25:17 +00:00
}
2017-04-15 00:25:50 +00:00
},
tag:{
loseCard:1,
gain:1,
2015-04-29 03:25:17 +00:00
}
}
},
2017-04-15 00:25:50 +00:00
guohe:{
audio:true,
fullskin:true,
type:'trick',
enable:true,
selectTarget:1,
postAi:function(targets){
return targets.length==1&&targets[0].countCards('j');
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
filterTarget:function(card,player,target){
if(player==target) return false;
2019-11-07 14:38:08 +00:00
return target.countDiscardableCards(player,get.is.single()?'he':'hej');
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
content:function(){
2019-11-07 14:38:08 +00:00
'step 0'
if(!get.is.single()&&target.countDiscardableCards(player,'hej')){
2017-04-15 00:25:50 +00:00
player.discardPlayerCard('hej',target,true);
2019-11-07 14:38:08 +00:00
event.finish();
}
else{
var bool1=target.countDiscardableCards(player,'h');
var bool2=target.countDiscardableCards(player,'e');
if(bool1&&bool2){
player.chooseControl('手牌区','装备区').set('ai',function(){
return Math.random()<0.5?1:0;
}).set('prompt','弃置'+(get.translation(target))+'装备区的一张牌,或观看其手牌并弃置其中的一张牌。');
}
else event._result={control:bool1?'手牌区':'装备区'};
2017-04-15 00:25:50 +00:00
}
2019-11-07 14:38:08 +00:00
'step 1'
var pos=result.control=='手牌区'?'h':'e';
player.discardPlayerCard(target,pos,true,'visible');
2017-04-15 00:25:50 +00:00
},
ai:{
basic:{
order:9,
useful:1,
value:5,
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
result:{
target:function(player,target){
2017-05-10 06:40:14 +00:00
var att=get.attitude(player,target);
2017-04-15 00:25:50 +00:00
var nh=target.countCards('h');
2017-05-10 06:40:14 +00:00
if(att>0){
var js=target.getCards('j');
if(js.length){
var jj=js[0].viewAs?{name:js[0].viewAs}:js[0];
if(jj.name=='guohe'||js.length>1||get.effect(target,jj,target,player)<0){
2018-08-10 15:48:28 +00:00
return 3;
2017-05-10 06:40:14 +00:00
}
}
if(target.getEquip('baiyin')&&target.isDamaged()&&
2017-05-18 22:15:32 +00:00
get.recoverEffect(target,player,player)>0){
2017-05-10 06:40:14 +00:00
if(target.hp==1&&!target.hujia) return 1.6;
if(target.hp==2) return 0.01;
return 0;
2015-11-06 10:05:08 +00:00
}
}
2017-05-10 06:40:14 +00:00
var es=target.getCards('e');
var noe=(es.length==0||target.hasSkillTag('noe'));
var noe2=(es.length==1&&es[0].name=='baiyin'&&target.isDamaged());
var noh=(nh==0||target.hasSkillTag('noh'));
if(noh&&(noe||noe2)) return 0;
if(att<=0&&!target.countCards('he')) return 1.5;
2017-04-15 00:25:50 +00:00
return -1.5;
},
},
tag:{
loseCard:1,
discard:1
2015-11-06 10:05:08 +00:00
}
2015-04-29 03:25:17 +00:00
}
},
2017-04-15 00:25:50 +00:00
jiedao:{
audio:true,
fullskin:true,
type:'trick',
enable:true,
selectTarget:2,
singleCard:true,
multitarget:true,
targetprompt:['被借刀','出杀目标'],
complexTarget:true,
2017-08-05 02:57:53 +00:00
multicheck:function(){
return game.hasPlayer(function(current){
if(current.getEquip(1)){
return game.hasPlayer(function(current2){
2019-11-23 12:41:07 +00:00
return lib.filter.filterTarget({name:'sha'},current,current2);
2017-08-05 02:57:53 +00:00
})
}
});
},
2017-04-15 00:25:50 +00:00
filterTarget:function(card,player,target){
if(ui.selected.targets.length==0){
return (player!=target&&target.getCards('e',{subtype:'equip1'}).length);
}
else{
2019-11-23 12:41:07 +00:00
return lib.filter.filterTarget({name:'sha'},ui.selected.targets[0],target);
2017-04-15 00:25:50 +00:00
}
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
content:function(){
"step 0"
2020-03-05 13:10:37 +00:00
if(event.directHit||(!_status.connectMode&&lib.config.skip_shan&&!target.hasSha())){
2017-04-15 00:25:50 +00:00
event.directfalse=true;
}
else{
target.chooseToUse('对'+get.translation(event.addedTarget)+'使用一张杀,或令'+get.translation(player)+'获得你的武器牌',
2019-11-14 05:47:38 +00:00
{name:'sha'}).set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){
if(target!=_status.event.sourcex&&!ui.selected.targets.contains(_status.event.sourcex)) return false;
return lib.filter.filterTarget.apply(this,arguments);
2020-03-05 13:10:37 +00:00
}).set('sourcex',event.addedTarget).set('addCount',false).set('respondTo',[player,card]);
2017-04-15 00:25:50 +00:00
}
"step 1"
if(event.directfalse||result.bool==false){
2020-01-13 15:03:45 +00:00
var cards=target.getCards('e',{subtype:'equip1'});
2020-01-13 16:34:32 +00:00
if(cards.length) player.gain(cards,target,'give');
2017-04-15 00:25:50 +00:00
}
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
ai:{
basic:{
order:8,
value:2,
useful:1,
},
result:{
target:-1.5,
player:function(player){
if(player.getCards('he',{subtype:'equip1'}).length) return 0;
return 1.5;
},
},
tag:{
gain:1,
use:1,
useSha:1,
loseCard:1,
}
2015-04-29 03:25:17 +00:00
}
},
2017-04-15 00:25:50 +00:00
wuxie:{
audio:true,
fullskin:true,
type:'trick',
ai:{
basic:{
useful:[6,4],
value:[6,4],
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
result:{player:1},
expose:0.2
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
notarget:true,
2019-10-09 14:31:43 +00:00
contentBefore:function(){
'step 0'
2020-03-05 13:10:37 +00:00
if(get.mode()=='guozhan'&&get.cardtag(card,'guo')){
2019-10-09 14:31:43 +00:00
var trigger=event.getParent(2);
if(trigger.triggername!='phaseJudge'&&!trigger.statecard&&trigger.target.identity!='ye'&&trigger.target.identity!='unknown'){
player.chooseControl('对单体使用','对势力使用').set('prompt','请选择'+get.translation(card)+'的使用方式').set('ai',function(){
return '对势力使用'
});
}
else event.finish();
}
else event.finish();
'step 1'
if(result.control=='对势力使用'){
player.chat('对势力使用');
event.getParent(2).guowuxie=true;
}
},
2017-04-15 00:25:50 +00:00
content:function(){
2019-10-31 04:40:01 +00:00
var evt=event.getParent();
event.result={
wuxied:true,
directHit:evt.directHit||[],
nowuxie:evt.nowuxie,
};
2017-04-15 00:25:50 +00:00
if(player.isOnline()){
player.send(function(player){
if(ui.tempnowuxie&&!player.hasWuxie()){
ui.tempnowuxie.close();
delete ui.tempnowuxie;
}
},player);
}
else if(player==game.me){
2016-04-11 10:14:04 +00:00
if(ui.tempnowuxie&&!player.hasWuxie()){
ui.tempnowuxie.close();
delete ui.tempnowuxie;
}
}
2017-04-15 00:25:50 +00:00
},
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
lebu:{
audio:true,
fullskin:true,
type:'delay',
filterTarget:function(card,player,target){
return (lib.filter.judge(card,player,target)&&player!=target);
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
judge:function(card){
if(get.suit(card)=='heart') return 0;
return -3;
},
effect:function(){
if(result.bool==false){
player.skip('phaseUse');
2015-04-29 03:25:17 +00:00
}
},
2017-04-15 00:25:50 +00:00
ai:{
basic:{
order:1,
useful:1,
value:8,
},
result:{
target:function(player,target){
var num=target.hp-target.countCards('h')-2;
if(num>-1) return -0.01;
if(target.hp<3) num--;
if(target.isTurnedOver()) num/=2;
var dist=get.distance(player,target,'absolute');
if(dist<1) dist=1;
return num/Math.sqrt(dist);
}
},
tag:{
skip:'phaseUse'
}
2015-04-29 03:25:17 +00:00
}
2017-01-15 09:55:22 +00:00
},
2017-04-15 00:25:50 +00:00
shandian:{
audio:true,
fullskin:true,
type:'delay',
2017-05-06 17:25:44 +00:00
cardnature:'thunder',
2017-04-15 00:25:50 +00:00
modTarget:function(card,player,target){
return lib.filter.judge(card,player,target);
},
enable:function(card,player){
return player.canAddJudge(card);
},
filterTarget:function(card,player,target){
return (lib.filter.judge(card,player,target)&&player==target);
},
selectTarget:[-1,-1],
judge:function(card){
if(get.suit(card)=='spade'&&get.number(card)>1&&get.number(card)<10) return -6;
return 0;
},
effect:function(){
2017-04-15 00:57:33 +00:00
if(result.bool==false){
2017-04-15 00:25:50 +00:00
player.damage(3,'thunder','nosource');
}
else{
player.addJudgeNext(card);
}
},
cancel:function(){
2017-04-02 05:04:48 +00:00
player.addJudgeNext(card);
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
ai:{
basic:{
order:1,
useful:0,
value:0,
},
result:{
target:function(player,target){
var num=game.countPlayer(function(current){
var skills=current.getSkills();
for(var j=0;j<current.skills.length;j++){
var rejudge=get.tag(current.skills[j],'rejudge',current);
if(rejudge!=undefined){
if(get.attitude(target,current)>0&&
get.attitude(current,target)>0){
return rejudge;
}
else{
return -rejudge;
}
}
}
});
if(num>0) return num;
if(num==0){
var mode=get.mode();
if(mode=='identity'){
if(target.identity=='nei') return 1;
var situ=get.situation();
if(target.identity=='fan'){
if(situ>1) return 1;
2017-02-11 14:16:35 +00:00
}
else{
2017-04-15 00:25:50 +00:00
if(situ<-1) return 1;
2017-02-11 14:16:35 +00:00
}
2015-04-29 03:25:17 +00:00
}
2017-04-15 00:25:50 +00:00
else if(mode=='guozhan'){
if(target.identity=='ye') return 1;
if(game.hasPlayer(function(current){
return current.identity=='unknown';
})){
return -1;
}
if(get.population(target.identity)==1){
if(target.maxHp>2&&target.hp<2) return 1;
if(game.countPlayer()<3) return -1;
if(target.hp<=2&&target.countCards('he')<=3) return 1;
}
2015-04-29 03:25:17 +00:00
}
}
2017-04-15 00:25:50 +00:00
return -1;
2015-04-29 03:25:17 +00:00
}
2017-04-15 00:25:50 +00:00
},
tag:{
// damage:1,
// natureDamage:1,
// thunderDamage:1,
2015-04-29 03:25:17 +00:00
}
2016-07-05 14:11:33 +00:00
}
},
2017-04-15 00:25:50 +00:00
hanbing:{
fullskin:true,
type:"equip",
subtype:"equip1",
distance:{attackFrom:-1},
skills:['hanbing_skill'],
ai:{
basic:{
equipValue:2
}
2016-07-05 14:11:33 +00:00
},
},
2017-04-15 00:25:50 +00:00
renwang:{
fullskin:true,
type:"equip",
subtype:"equip2",
skills:['renwang_skill'],
ai:{
basic:{
equipValue:7.5
},
},
2016-07-05 14:11:33 +00:00
},
},
2017-04-15 00:25:50 +00:00
skill:{
2018-08-13 07:17:34 +00:00
qinglong_guozhan:{
2019-11-14 05:47:38 +00:00
equipSkill:true,
2018-08-13 07:17:34 +00:00
trigger:{player:'useCard'},
forced:true,
2020-02-14 05:33:43 +00:00
audio:'qinglong_skill',
2019-06-17 07:19:46 +00:00
filter:function(event,player){
return get.mode()=='guozhan'&&event.card.name=='sha';
2018-08-13 07:17:34 +00:00
},
content:function(){
2020-02-14 05:33:43 +00:00
if(!_status.qinglong_guozhan) _status.qinglong_guozhan=[];
_status.qinglong_guozhan=[];
_status.qinglong_guozhan.add(trigger);
game.countPlayer2(function(current){
current.addTempSkill('qinglong_guozhan_mingzhi');
});
var next=game.createEvent('qinglong_guozhan');
event.next.remove(next);
trigger.after.add(next);
next.setContent(function(){
_status.qinglong_guozhan.remove(event.parent);
});
2018-08-13 07:17:34 +00:00
}
},
qinglong_guozhan_mingzhi:{
ai:{
2020-02-14 05:33:43 +00:00
nomingzhi:true,
skillTagFilter:function(player){
if(_status.qinglong_guozhan){
for(var i=0;i<_status.qinglong_guozhan.length;i++){
if(_status.qinglong_guozhan[i].targets.contains(player)) return true;
}
}
return false;
},
2018-08-13 07:17:34 +00:00
}
},
2017-04-15 00:25:50 +00:00
hanbing_skill:{
2019-11-14 05:47:38 +00:00
equipSkill:true,
trigger:{source:'damageBegin2'},
2019-06-17 07:19:46 +00:00
//direct:true,
2017-04-15 00:25:50 +00:00
audio:true,
filter:function(event){
2019-06-17 07:19:46 +00:00
return event.card&&event.card.name=='sha'&&event.notLink()&&event.player.getCards('he').length>0;
2017-04-15 00:25:50 +00:00
},
2019-11-22 05:15:05 +00:00
//priority:1,
2019-06-17 07:19:46 +00:00
check:function(event,player){
2019-08-24 15:41:12 +00:00
var target=event.player;
2020-02-14 05:33:43 +00:00
var eff=get.damageEffect(target,player,player);
if(get.attitude(player,target)>0){
if(eff>=0) return false;
return true;
}
if(eff<=0) return true;
if(target.hp==1) return false;
if(event.num>1||player.hasSkill('tianxianjiu')||
2019-06-17 07:19:46 +00:00
player.hasSkill('luoyi2')||player.hasSkill('reluoyi2')) return false;
2020-02-14 05:33:43 +00:00
if(target.countCards('he')<2) return false;
var num=0;
var cards=target.getCards('he');
for(var i=0;i<cards.length;i++){
if(get.value(cards[i])>6) num++;
}
if(num>=2) return true;
return false;
},
logTarget:"player",
2019-06-17 07:19:46 +00:00
content:function(){
"step 0"
2020-02-14 05:33:43 +00:00
trigger.cancel();
2017-04-15 00:25:50 +00:00
"step 1"
2019-06-17 07:19:46 +00:00
if(trigger.player.countDiscardableCards(player,'he')){
2019-08-24 15:41:12 +00:00
player.line(trigger.player);
2019-06-17 07:19:46 +00:00
player.discardPlayerCard('he',trigger.player,true);
}
"step 2"
if(trigger.player.countDiscardableCards(player,'he')){
2020-02-14 05:33:43 +00:00
player.line(trigger.player);
2019-06-17 07:19:46 +00:00
player.discardPlayerCard('he',trigger.player,true);
2016-07-05 14:11:33 +00:00
}
}
2017-04-15 00:25:50 +00:00
},
renwang_skill:{
2019-11-14 05:47:38 +00:00
equipSkill:true,
2019-06-17 07:19:46 +00:00
trigger:{target:'shaBegin'},
2017-04-15 00:25:50 +00:00
forced:true,
priority:6,
audio:true,
2018-08-20 05:51:05 +00:00
filter:function(event,player){
2019-11-14 05:47:38 +00:00
if(player.hasSkillTag('unequip2')) return false;
2018-08-20 05:51:05 +00:00
if(event.player.hasSkillTag('unequip',false,{
name:event.card?event.card.name:null,
target:player,
card:event.card
})) return false;
2017-04-15 00:25:50 +00:00
return (event.card.name=='sha'&&get.color(event.card)=='black')
},
content:function(){
2017-09-15 07:51:09 +00:00
trigger.cancel();
2017-04-15 00:25:50 +00:00
},
ai:{
effect:{
2019-11-14 05:47:38 +00:00
target:function(card,player,target){
2020-02-14 05:33:43 +00:00
if(target.hasSkillTag('unequip2')) return;
2018-08-20 05:51:05 +00:00
if(player.hasSkillTag('unequip',false,{
name:card?card.name:null,
target:player,
card:card
2020-02-14 05:33:43 +00:00
})||player.hasSkillTag('unequip_ai',false,{
name:card?card.name:null,
target:player,
card:card
2018-08-20 05:51:05 +00:00
})) return;
2017-04-15 00:25:50 +00:00
if(card.name=='sha'&&get.color(card)=='black') return 'zerotarget';
2017-02-08 01:53:23 +00:00
}
}
2015-04-29 03:25:17 +00:00
}
},
2017-04-15 00:25:50 +00:00
zhuge_skill:{
2019-11-14 05:47:38 +00:00
equipSkill:true,
2020-01-11 12:17:57 +00:00
audio:true,
firstDo:true,
trigger:{player:'useCard1'},
forced:true,
filter:function(event,player){
return !event.audioed&&event.card.name=='sha'&&player.countUsed('sha',true)>1&&event.getParent().type=='phase';
},
content:function(){
trigger.audioed=true;
},
2017-04-15 00:25:50 +00:00
mod:{
cardUsable:function(card,player,num){
if(card.name=='sha'){
2019-11-16 05:36:25 +00:00
if(get.is.versus()||get.is.changban()){
2017-04-15 00:25:50 +00:00
return num+3;
}
return Infinity;
}
}
},
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
cixiong_skill:{
2019-11-14 05:47:38 +00:00
equipSkill:true,
2019-10-24 04:55:01 +00:00
trigger:{player:'useCardToPlayered'},
2017-04-15 00:25:50 +00:00
audio:true,
logTarget:'target',
2020-03-13 10:02:18 +00:00
check:function(event,player){
if(get.attitude(player,event.target)>0) return true;
2020-03-13 13:15:17 +00:00
var target=event.target;
2020-03-13 10:02:18 +00:00
return target.countCards('h')==0||!target.hasSkillTag('noh');
},
2017-04-15 00:25:50 +00:00
filter:function(event,player){
2019-10-24 04:55:01 +00:00
if(event.card.name!='sha') return false;
2017-04-15 00:25:50 +00:00
if(player.sex=='male'&&event.target.sex=='female') return true;
if(player.sex=='female'&&event.target.sex=='male') return true;
2017-02-28 05:24:12 +00:00
return false;
2017-04-15 00:25:50 +00:00
},
content:function(){
"step 0"
trigger.target.chooseToDiscard('弃置一张手牌,或令'+get.translation(player)+'摸一张牌').set('ai',function(card){
var trigger=_status.event.getTrigger();
return -get.attitude(trigger.target,trigger.player)-get.value(card);
});
"step 1"
if(result.bool==false) player.draw();
2017-02-28 05:24:12 +00:00
}
2016-04-04 14:15:58 +00:00
},
2017-04-15 00:25:50 +00:00
qinggang_skill:{
2019-11-14 05:47:38 +00:00
equipSkill:true,
audio:true,
trigger:{
player:'useCardToPlayered',
},
filter:function(event){
return event.card.name=='sha';
},
forced:true,
logTarget:'target',
content:function(){
trigger.target.addTempSkill('qinggang2');
trigger.target.storage.qinggang2.add(trigger.card);
},
2020-02-14 05:33:43 +00:00
ai:{
unequip_ai:true,
2017-04-15 00:25:50 +00:00
skillTagFilter:function(player,tag,arg){
if(arg&&arg.name=='sha') return true;
return false;
}
2020-02-14 05:33:43 +00:00
}
2019-11-14 05:47:38 +00:00
},
qinggang2:{
firstDo:true,
ai:{unequip2:true},
init:function(player,skill){
if(!player.storage[skill]) player.storage[skill]=[];
},
onremove:true,
trigger:{
player:['damage','damageCancelled','damageZero'],
target:['shaMiss','useCardToExcluded'],
},
charlotte:true,
filter:function(event,player){
return player.storage.qinggang2&&event.card&&player.storage.qinggang2.contains(event.card);
},
silent:true,
forced:true,
popup:false,
priority:12,
content:function(){
player.storage.qinggang2.remove(trigger.card);
if(!player.storage.qinggang2.length) player.removeSkill('qinggang2');
},
2016-07-01 03:09:23 +00:00
},
2017-04-15 00:25:50 +00:00
qinglong_skill:{
2019-11-14 05:47:38 +00:00
equipSkill:true,
2017-04-15 00:25:50 +00:00
trigger:{player:'shaMiss'},
direct:true,
filter:function(event,player){
2018-08-13 07:17:34 +00:00
if(get.mode()=='guozhan') return false;
2020-01-13 15:03:45 +00:00
return player.canUse('sha',event.target,false)&&player.hasSha();
2017-04-15 00:25:50 +00:00
},
content:function(){
"step 0"
if(player.hasSkill('jiu')){
game.broadcastAll(function(player){
player.removeSkill('jiu');
},player);
event.jiu=true;
}
2017-11-22 08:28:59 +00:00
player.chooseToUse(get.prompt('qinglong'),{name:'sha'},trigger.target,-1).set('addCount',false).logSkill='qinglong_skill';
2017-04-15 00:25:50 +00:00
"step 1"
if(result.bool);
else if(event.jiu){
player.addSkill('jiu');
}
}
2016-01-24 08:34:21 +00:00
},
2017-04-15 00:25:50 +00:00
zhangba_skill:{
2019-11-14 05:47:38 +00:00
equipSkill:true,
2017-04-15 00:25:50 +00:00
enable:['chooseToUse','chooseToRespond'],
filterCard:true,
selectCard:2,
position:'h',
viewAs:{name:'sha'},
2020-03-07 14:00:26 +00:00
complexCard:true,
2017-04-15 00:25:50 +00:00
filter:function(event,player){
2017-03-27 08:48:22 +00:00
return player.countCards('h')>=2;
2016-07-01 03:09:23 +00:00
},
2017-04-15 00:25:50 +00:00
audio:true,
prompt:'将两张手牌当杀使用或打出',
check:function(card){
if(card.name=='sha') return 0;
2020-03-09 13:12:08 +00:00
return 5-get.value(card)
2017-04-15 00:25:50 +00:00
},
ai:{
respondSha:true,
skillTagFilter:function(player){
return player.countCards('h')>=2;
},
}
2015-04-29 03:25:17 +00:00
},
2017-04-15 00:25:50 +00:00
guanshi_skill:{
2019-11-14 05:47:38 +00:00
equipSkill:true,
2017-04-15 00:25:50 +00:00
trigger:{player:'shaMiss'},
direct:true,
audio:true,
filter:function(event,player){
return player.countCards('he')>2&&event.target.isAlive();
},
content:function(){
"step 0"
var next=player.chooseToDiscard(get.prompt('guanshi'),2,'he',function(card){
return _status.event.player.getCards('e',{subtype:'equip1'}).contains(card)==false;
});
next.logSkill='guanshi_skill';
next.set('ai',function(card){
var evt=_status.event.getParent();
if(get.attitude(evt.player,evt._trigger.target)<0){
if(evt.player.hasSkill('jiu')||
evt.player.hasSkill('tianxianjiu')||
evt._trigger.target.hp==1){
return 8-get.value(card)
}
return 5-get.value(card)
2015-04-29 03:25:17 +00:00
}
2017-04-15 00:25:50 +00:00
return -1;
});
"step 1"
if(result.bool){
trigger.untrigger();
trigger.trigger('shaHit');
trigger._result.bool=false;
2019-12-12 15:00:19 +00:00
trigger._result.result=null;
2015-04-29 03:25:17 +00:00
}
}
},
2017-04-15 00:25:50 +00:00
fangtian_skill:{
2019-11-14 05:47:38 +00:00
equipSkill:true,
2019-12-13 14:13:01 +00:00
audio:true,
2020-01-11 12:17:57 +00:00
trigger:{player:'useCard1'},
forced:true,
firstDo:true,
filter:function(event,player){
if(event.card.name!='sha'||get.mode()=='guozhan') return false;
var card=event.card;
var range;
var select=get.copy(get.info(card).selectTarget);
if(select==undefined){
if(get.info(card).filterTarget==undefined) return false;
range=[1,1];
}
else if(typeof select=='number') range=[select,select];
else if(get.itemtype(select)=='select') range=select;
else if(typeof select=='function') range=select(card,player);
game.checkMod(card,player,range,'selectTarget',player);
return range[1]!=-1&&event.targets.length>range[1];
},
content:function(){},
2017-04-15 00:25:50 +00:00
mod:{
selectTarget:function(card,player,range){
if(card.name!='sha') return;
2018-08-13 07:17:34 +00:00
if(get.mode()=='guozhan') return;
2017-04-15 00:25:50 +00:00
if(range[1]==-1) return;
var cards=player.getCards('h');
2020-01-11 12:17:57 +00:00
if(!cards.length) return;
2017-04-15 00:25:50 +00:00
for(var i=0;i<cards.length;i++){
if(cards[i].classList.contains('selected')==false)
return;
}
range[1]+=2;
}
2015-04-29 03:25:17 +00:00
}
2016-07-17 03:28:46 +00:00
},
2018-08-13 07:17:34 +00:00
fangtian_guozhan:{
2019-11-14 05:47:38 +00:00
equipSkill:true,
2019-12-13 14:13:01 +00:00
trigger:{player:'useCard2'},
2018-08-13 07:17:34 +00:00
filter:function(event,player){
if(get.mode()!='guozhan') return false;
2019-12-13 14:13:01 +00:00
if(event.card.name!='sha') return false;
return game.hasPlayer(function(target){
if(event.targets.contains(target)) return false;
if(!lib.filter.filterTarget(event.card,player,target)) return false;
if(target.identity=='ye'||target.identity=='unknown') return true;
for(var i=0;i<event.targets.length;i++){
if(target.identity==event.targets[i].identity) return false;
}
return true;
});
2018-08-13 07:17:34 +00:00
},
2019-12-13 14:13:01 +00:00
direct:true,
2018-08-13 07:17:34 +00:00
content:function(){
2019-12-13 14:13:01 +00:00
'step 0'
player.chooseTarget(get.prompt2('fangtian'),[1,Infinity],function(card,player,target){
var cardx=_status.event.cardx;
if(!lib.filter.filterTarget(cardx,player,target)) return false;
var targets=_status.event.targets.slice(0).concat(ui.selected.targets);
if(targets.contains(target)) return false;
if(target.identity=='ye'||target.identity=='unknown') return true;
2019-08-13 04:37:11 +00:00
for(var i=0;i<targets.length;i++){
2019-12-13 14:13:01 +00:00
if(target.identity==targets[i].identity) return false;
2018-08-13 07:17:34 +00:00
}
2019-12-13 14:13:01 +00:00
return true;
2020-02-16 04:25:41 +00:00
}).set('promptbar','none').set('cardx',trigger.card).set('targets',trigger.targets).set('ai',function(target){
2019-12-13 14:13:01 +00:00
var player=_status.event.player;
return get.effect(target,_status.event.cardx,player,player)
});
'step 1'
if(result.bool){
player.logSkill('fangtian_skill',result.targets);
if(!player.storage.fangtian_guozhan_trigger) player.storage.fangtian_guozhan_trigger=[];
player.storage.fangtian_guozhan_trigger.add(trigger.card);
trigger.targets.addArray(result.targets);
player.addTempSkill('fangtian_guozhan_trigger');
2018-08-13 07:17:34 +00:00
}
2019-12-13 14:13:01 +00:00
},
2018-08-13 07:17:34 +00:00
},
fangtian_guozhan_trigger:{
trigger:{player:'shaMiss'},
silent:true,
onremove:true,
content:function(){
2019-12-13 14:13:01 +00:00
if(player.storage[event.name].contains(trigger.card)) trigger.getParent().excluded.addArray(trigger.getParent().targets);
},
group:'fangtian_guozhan_remove',
2018-08-13 07:17:34 +00:00
},
fangtian_guozhan_remove:{
2019-12-13 14:13:01 +00:00
trigger:{player:['useCardAfter','useCardCancelled']},
2018-08-13 07:17:34 +00:00
silent:true,
filter:function(event,player){
return player.storage.fangtian_guozhan_trigger&&player.storage.fangtian_guozhan_trigger.contains(event.card);
},
content:function(){
player.storage.fangtian_guozhan_trigger.remove(trigger.card);
}
},
2017-04-15 00:25:50 +00:00
qilin_skill:{
2019-11-14 05:47:38 +00:00
equipSkill:true,
trigger:{source:'damageBegin2'},
2017-04-15 00:25:50 +00:00
filter:function(event,player){
2019-07-07 10:35:24 +00:00
return event.card&&event.card.name=='sha'&&event.notLink()&&event.player.getCards('e',{subtype:['equip3','equip4','equip6']}).length>0
2017-04-15 00:25:50 +00:00
},
direct:true,
audio:true,
content:function(){
"step 0"
2019-06-17 07:19:46 +00:00
var att=(get.attitude(player,trigger.player)<=0);
2017-04-15 00:25:50 +00:00
var next=player.chooseButton();
next.set('att',att);
2019-07-07 10:35:24 +00:00
next.set('createDialog',['是否发动【麒麟弓】,弃置'+get.translation(trigger.player)+'的一张坐骑牌?',trigger.player.getCards('e',{subtype:['equip3','equip4','equip6']})]);
2017-04-15 00:25:50 +00:00
next.set('ai',function(button){
if(_status.event.att) return get.buttonValue(button);
return 0;
});
"step 1"
if(result.bool){
2019-06-17 07:19:46 +00:00
player.logSkill('qilin_skill',trigger.player);
trigger.player.discard(result.links[0]);
2017-04-15 00:25:50 +00:00
}
2015-04-29 03:25:17 +00:00
}
},
2017-04-15 00:25:50 +00:00
bagua_skill:{
2019-11-14 05:47:38 +00:00
equipSkill:true,
2019-12-05 15:05:56 +00:00
trigger:{player:['chooseToRespondBegin','chooseToUseBegin']},
2017-04-15 00:25:50 +00:00
filter:function(event,player){
if(event.responded) return false;
2020-02-14 05:33:43 +00:00
if(event.bagua_skill) return false;
2019-12-06 04:56:09 +00:00
if(!event.filterCard({name:'shan'},player,event)) return false;
2019-12-05 15:05:56 +00:00
if(event.name=='chooseToRespond'&&!lib.filter.cardRespondable({name:'shan'},player,event)) return false;
2019-11-14 05:47:38 +00:00
if(player.hasSkillTag('unequip2')) return false;
2017-04-15 00:25:50 +00:00
var evt=event.getParent();
2018-08-20 05:51:05 +00:00
if(evt.player&&evt.player.hasSkillTag('unequip',false,{
name:evt.card?evt.card.name:null,
target:player,
card:evt.card
})) return false;
2017-04-15 00:25:50 +00:00
return true;
},
audio:true,
check:function(event,player){
2019-12-07 12:48:38 +00:00
if(event&&(event.ai||event.ai1)){
var ai=event.ai||event.ai1;
var tmp=_status.event;
_status.event=event;
var result=ai({name:'shan'},_status.event.player,event);
_status.event=tmp;
return result>0;
}
2017-04-15 00:25:50 +00:00
return true;
},
content:function(){
"step 0"
2020-02-23 05:45:11 +00:00
trigger.bagua_skill=true;
2017-04-15 00:25:50 +00:00
player.judge('bagua',function(card){return (get.color(card)=='red')?1.5:-0.5});
"step 1"
if(result.judge>0){
trigger.untrigger();
2019-12-28 14:03:35 +00:00
trigger.set('responded',true);
2020-03-05 13:10:37 +00:00
trigger.result={bool:true,card:{name:'shan',isCard:true}}
2015-04-29 03:25:17 +00:00
}
2017-04-15 00:25:50 +00:00
},
ai:{
2019-12-06 15:36:01 +00:00
respondShan:true,
2017-04-15 00:25:50 +00:00
effect:{
target:function(card,player,target,effect){
2020-02-14 05:33:43 +00:00
if(target.hasSkillTag('unequip2')) return;
2018-08-20 05:51:05 +00:00
if(player.hasSkillTag('unequip',false,{
name:card?card.name:null,
target:player,
card:card
2020-02-14 05:33:43 +00:00
})||player.hasSkillTag('unequip_ai',false,{
name:card?card.name:null,
target:player,
card:card
2018-08-20 05:51:05 +00:00
})) return;
2017-04-15 00:25:50 +00:00
if(get.tag(card,'respondShan')) return 0.5;
}
2017-02-04 17:02:18 +00:00
}
2016-04-02 08:05:24 +00:00
}
},
2017-04-15 00:25:50 +00:00
_wuxie:{
2019-12-28 14:03:35 +00:00
trigger:{player:['useCardToBegin','phaseJudge']},
2017-04-15 00:25:50 +00:00
priority:5,
popup:false,
forced:true,
filter:function(event,player){
2017-11-08 02:40:40 +00:00
if(event.card.storage&&event.card.storage.nowuxie) return false;
2017-04-15 00:25:50 +00:00
if(event.name!='phaseJudge'){
2019-10-31 04:40:01 +00:00
if(event.getParent().nowuxie) return false;
2017-04-15 00:25:50 +00:00
var info=get.info(event.card);
if(!event.target){
if(info.wuxieable) return true;
return false;
}
2017-04-15 03:39:51 +00:00
if(event.player.hasSkillTag('playernowuxie',false,event.card)) return false;
2017-04-15 00:25:50 +00:00
if(get.type(event.card)!='trick'&&!info.wuxieable) return false;
2016-04-13 04:17:17 +00:00
}
2017-04-15 00:25:50 +00:00
return true;
},
content:function(){
'step 0'
if(trigger.multitarget){
event.targets=trigger.targets;
}
event.target=trigger.target;
if(event.triggername=='phaseJudge'){
event.target=trigger.player;
2016-04-13 04:17:17 +00:00
}
2017-04-15 00:25:50 +00:00
event.sourcex=event.targets||event.target;
if(!event.targets&&trigger.targets&&trigger.targets.length==1){
event.sourcex2=trigger.player;
2016-04-02 08:05:24 +00:00
}
2017-04-15 00:25:50 +00:00
event.source=trigger.player;
event.state=true;
event.card=trigger.card;
event._global_waiting=true;
event.tempnowuxie=(trigger.targets&&trigger.targets.length>1&&!trigger.multitarget);
event.filterCard=function(card,player){
2019-11-22 05:15:05 +00:00
if(get.name(card)!='wuxie') return false;
2017-04-15 00:25:50 +00:00
return lib.filter.cardEnabled(card,player,'forceEnable');
};
event.send=function(player,state,isJudge,card,source,target,targets,id,id2,tempnowuxie,skillState){
if(skillState){
player.applySkills(skillState);
}
state=state?1:-1;
var str='';
if(isJudge){
str+=get.translation(source)+'的';
}
if(isJudge){
str+=get.translation(card,'viewAs');
}
else{
str+=get.translation(card);
}
if((targets||target)&&!isJudge){
str+='对'+get.translation(targets||target);
}
str+='将'+(state>0?'生效':'失效')+',是否无懈?';
2016-04-06 03:07:53 +00:00
2017-04-15 00:25:50 +00:00
if(player.isUnderControl(true)&&!_status.auto&&!ui.tempnowuxie&&tempnowuxie){
var translation=get.translation(card.name);
if(translation.length>=4){
translation=lib.translate[card.name+'_ab']||translation.slice(0,2);
}
ui.tempnowuxie=ui.create.control('不无懈'+translation,ui.click.tempnowuxie,'stayleft');
ui.tempnowuxie._origin=id2;
2016-07-16 03:32:55 +00:00
}
2017-04-15 00:25:50 +00:00
var next=player.chooseToUse({
filterCard:function(card,player){
2019-11-22 05:15:05 +00:00
if(get.name(card)!='wuxie') return false;
2017-04-15 00:25:50 +00:00
return lib.filter.cardEnabled(card,player,'forceEnable');
},
prompt:str,
type:'wuxie',
state:state,
_global_waiting:true,
ai1:function(){
if(isJudge){
var name=card.viewAs||card.name;
var info=lib.card[name];
if(info&&info.ai&&info.ai.wuxie){
var aiii=info.ai.wuxie(source,card,source,_status.event.player,state);
if(typeof aiii=='number') return aiii;
2016-04-02 08:05:24 +00:00
}
2017-04-15 00:25:50 +00:00
if(Math.abs(get.attitude(_status.event.player,source))<3) return 0;
2017-11-22 12:44:09 +00:00
if(source.hasSkillTag('guanxing')&&(source!=player||!source.hasSkill('guanxing_fail'))) return 0;
2017-04-15 00:25:50 +00:00
if(name!='lebu'&&name!='bingliang'){
if(source!=_status.event.player){
return 0;
}
}
var card2;
if(name!=card.name){
card2={name:name};
}
else{
card2=card;
}
var eff=get.effect(source,card2,source,source);
if(eff>=0) return 0;
return state*get.attitude(_status.event.player,source);
2016-04-11 06:13:35 +00:00
}
2020-03-07 14:00:26 +00:00
else if(target){
2017-04-15 00:25:50 +00:00
var triggerevent=_status.event.getTrigger();
if(triggerevent&&triggerevent.parent&&
triggerevent.parent.postAi&&
triggerevent.player.isUnknown(_status.event.player)){
return 0;
}
var info=get.info(card);
if(info.ai&&info.ai.wuxie){
var aiii=info.ai.wuxie(target,card,source,_status.event.player,state);
if(typeof aiii=='number') return aiii;
}
if(info.multitarget&&targets){
var eff=0;
for(var i=0;i<targets.length;i++){
eff+=get.effect(targets[i],card,source,_status.event.player)
}
return -eff*state;
}
if(Math.abs(get.attitude(_status.event.player,target))<3) return 0;
return -get.effect(target,card,source,_status.event.player)*state;
2016-04-11 06:13:35 +00:00
}
2020-03-07 14:00:26 +00:00
else{
var triggerevent=_status.event.getTrigger();
if(triggerevent&&triggerevent.parent&&
triggerevent.parent.postAi&&
triggerevent.player.isUnknown(_status.event.player)){
return 0;
}
var info=get.info(card);
if(info.ai&&info.ai.wuxie){
var aiii=info.ai.wuxie(target,card,source,_status.event.player,state);
if(typeof aiii=='number') return aiii;
}
if(Math.abs(get.attitude(_status.event.player,source))<3) return 0;
return -get.attitude(_status.event.player,source)
}
2017-04-15 00:25:50 +00:00
},
source:target,
source2:targets,
id:id,
id2:id2
});
2019-10-09 14:31:43 +00:00
if(event.stateplayer&&event.statecard) next.set('respondTo',[event.stateplayer,event.statecard]);
else if(!isJudge){
2017-11-07 13:00:33 +00:00
next.set('respondTo',[source,card]);
}
2017-04-15 00:25:50 +00:00
if(game.online){
_status.event._resultid=id;
game.resume();
}
else{
next.nouse=true;
}
};
2018-08-13 10:54:35 +00:00
event.settle=function(){
if(!event.state){
if(event.triggername=='phaseJudge'){
trigger.untrigger();
trigger.cancelled=true;
}
else{
trigger.cancel();
2019-10-09 14:31:43 +00:00
if(event.guowuxie==true){
2018-08-13 10:54:35 +00:00
if(trigger.target.identity!='ye'&&trigger.target.identity!='unknown'){
trigger.getParent().excluded.addArray(game.filterPlayer(function(current){
return current.identity==trigger.target.identity;
}));
}
}
}
}
event.finish();
};
2017-04-15 00:25:50 +00:00
'step 1'
var list=game.filterPlayer(function(current){
2019-10-31 04:40:01 +00:00
if(event.nowuxie) return false;
if(event.directHit&&event.directHit.contains(current)) return false;
2017-07-28 08:21:24 +00:00
if(event.triggername=='phaseJudge'){
if(game.checkMod(trigger.card,player,current,'unchanged','wuxieJudgeEnabled',current)==false) return false;
if(game.checkMod(trigger.card,player,current,'unchanged','wuxieJudgeRespondable',player)==false) return false;
2019-10-09 14:31:43 +00:00
if(event.stateplayer&&event.statecard&&(game.checkMod(event.statecard,event.stateplayer,player,current,'unchanged','wuxieRespondable',event.stateplayer)==false)) return false;
2017-07-28 08:21:24 +00:00
}
else{
2019-10-31 04:40:01 +00:00
if(!event.statecard&&trigger.getParent().directHit.contains(current)) return false;
2017-07-28 08:21:24 +00:00
if(game.checkMod(trigger.card,player,trigger.target,current,'unchanged','wuxieEnabled',current)==false) return false;
if(game.checkMod(trigger.card,player,trigger.target,current,'unchanged','wuxieRespondable',player)==false) return false;
2019-10-09 14:31:43 +00:00
if(event.stateplayer&&event.statecard&&(game.checkMod(event.statecard,event.stateplayer,trigger.player,current,'unchanged','wuxieRespondable',event.stateplayer)==false)) return false;
2017-07-28 08:21:24 +00:00
}
2017-04-15 00:25:50 +00:00
return current.hasWuxie();
});
event.list=list;
event.id=get.id();
list.sort(function(a,b){
return get.distance(event.source,a,'absolute')-get.distance(event.source,b,'absolute');
});
'step 2'
if(event.list.length==0){
2018-08-13 10:54:35 +00:00
event.settle();
2017-04-15 00:25:50 +00:00
}
else if(_status.connectMode&&(event.list[0].isOnline()||event.list[0]==game.me)){
event.goto(4);
2016-04-02 08:05:24 +00:00
}
else{
2017-04-15 00:25:50 +00:00
event.current=event.list.shift();
event.send(event.current,event.state,event.triggername=='phaseJudge',
event.card,event.source,event.target,event.targets,event.id,trigger.parent.id,event.tempnowuxie);
2016-04-02 08:05:24 +00:00
}
2017-04-15 00:25:50 +00:00
'step 3'
if(result.bool){
event.wuxieresult=event.current;
2016-04-02 08:05:24 +00:00
event.wuxieresult2=result;
2017-04-15 00:25:50 +00:00
event.goto(8);
2016-04-02 08:05:24 +00:00
}
else{
2017-04-15 00:25:50 +00:00
event.goto(2);
2016-04-02 08:05:24 +00:00
}
2017-04-15 00:25:50 +00:00
'step 4'
var id=event.id;
var sendback=function(result,player){
if(result&&result.id==id&&!event.wuxieresult&&result.bool){
event.wuxieresult=player;
event.wuxieresult2=result;
game.broadcast('cancel',id);
if(_status.event.id==id&&_status.event.name=='chooseToUse'&&_status.paused){
return (function(){
event.resultOL=_status.event.resultOL;
ui.click.cancel();
if(ui.confirm) ui.confirm.close();
});
}
}
else{
if(_status.event.id==id&&_status.event.name=='chooseToUse'&&_status.paused){
return (function(){
event.resultOL=_status.event.resultOL;
});
}
}
};
2016-04-02 08:05:24 +00:00
2017-04-15 00:25:50 +00:00
var withme=false;
var withol=false;
var list=event.list;
for(var i=0;i<list.length;i++){
if(list[i].isOnline()){
withol=true;
list[i].wait(sendback);
list[i].send(event.send,list[i],event.state,event.triggername=='phaseJudge',
event.card,event.source,event.target,event.targets,event.id,trigger.parent.id,event.tempnowuxie,get.skillState(list[i]));
list.splice(i--,1);
}
else if(list[i]==game.me){
withme=true;
event.send(list[i],event.state,event.triggername=='phaseJudge',
event.card,event.source,event.target,event.targets,event.id,trigger.parent.id,event.tempnowuxie);
list.splice(i--,1);
}
2016-04-02 08:05:24 +00:00
}
2017-04-15 00:25:50 +00:00
if(!withme){
event.goto(6);
}
if(_status.connectMode){
if(withme||withol){
for(var i=0;i<game.players.length;i++){
game.players[i].showTimer();
}
2016-04-04 11:20:05 +00:00
}
2016-04-03 09:56:33 +00:00
}
2017-04-15 00:25:50 +00:00
event.withol=withol;
'step 5'
if(result&&result.bool&&!event.wuxieresult){
game.broadcast('cancel',event.id);
event.wuxieresult=game.me;
event.wuxieresult2=result;
2016-04-02 08:05:24 +00:00
}
2017-04-15 00:25:50 +00:00
'step 6'
if(event.withol&&!event.resultOL){
game.pause();
}
'step 7'
for(var i=0;i<game.players.length;i++){
game.players[i].hideTimer();
}
'step 8'
if(event.wuxieresult){
2017-11-07 13:00:33 +00:00
var next=event.wuxieresult.useResult(event.wuxieresult2);
2020-03-05 13:10:37 +00:00
if(event.stateplayer&&event.statecard) next.respondTo=[event.stateplayer,event.statecard];
else if(event.triggername!='phaseJudge'){
next.respondTo=[trigger.player,trigger.card];
2017-11-07 13:00:33 +00:00
}
2017-04-15 00:25:50 +00:00
}
'step 9'
if(event.wuxieresult){
2019-10-31 04:40:01 +00:00
if(result.wuxied){
event.nowuxie=result.nowuxie;
event.directHit=result.directHit;
2020-02-23 05:45:11 +00:00
event.stateplayer=event.wuxieresult;
2019-10-09 14:31:43 +00:00
if(event.wuxieresult2&&event.wuxieresult2.used){
event.statecard=event.wuxieresult2.used;
}
else{
event.statecard=true;
2018-08-13 10:54:35 +00:00
}
2017-04-15 00:25:50 +00:00
event.state=!event.state;
2020-02-23 05:45:11 +00:00
event.goto(1);
2016-04-02 08:05:24 +00:00
}
2020-02-23 05:45:11 +00:00
else event.settle();
2017-04-15 00:25:50 +00:00
}
else if(event.list.length){
event.goto(2);
}
else{
2018-08-13 10:54:35 +00:00
event.settle();
2016-04-02 08:05:24 +00:00
}
2017-04-15 00:25:50 +00:00
delete event.resultOL;
delete event.wuxieresult;
delete event.wuxieresult2;
2016-04-02 08:05:24 +00:00
}
2017-04-15 00:25:50 +00:00
},
},
translate:{
sha:'杀',
huosha:'火杀',
leisha:'雷杀',
shan:'闪',
tao:'桃',
bagua:'八卦阵',
bagua_bg:'卦',
bagua_skill:'八卦阵',
jueying:'绝影',
dilu:'的卢',
zhuahuang:'爪黄飞电',
jueying_bg:'+马',
dilu_bg:'+马',
zhuahuang_bg:'+马',
chitu:'赤兔',
chitu_bg:'-马',
dawan:'大宛',
dawan_bg:'-马',
zixin:'紫骍',
zixin_bg:'-马',
zhuge:'诸葛连弩',
cixiong:'雌雄双股剑',
zhuge_bg:'弩',
cixiong_bg:'双',
qinggang:'青釭剑',
qinglong:'青龙偃月刀',
zhangba:'丈八蛇矛',
qinglong_bg:'偃',
zhangba_bg:'蛇',
guanshi:'贯石斧',
fangtian:'方天画戟',
qilin:'麒麟弓',
qilin_bg:'弓',
zhuge_skill:'诸葛连弩',
cixiong_skill:'雌雄双股剑',
qinggang_skill:'青釭剑',
qinglong_skill:'青龙偃月刀',
2020-02-14 05:33:43 +00:00
qinglong_guozhan:'青龙偃月刀',
2017-04-15 00:25:50 +00:00
zhangba_skill:'丈八蛇矛',
guanshi_skill:'贯石斧',
fangtian_skill:'方天画戟',
qilin_skill:'麒麟弓',
wugu:'五谷丰登',
taoyuan:'桃园结义',
nanman:'南蛮入侵',
wanjian:'万箭齐发',
wuzhong:'无中生有',
juedou:'决斗',
wugu_bg:'谷',
taoyuan_bg:'园',
nanman_bg:'蛮',
wanjian_bg:'箭',
wuzhong_bg:'生',
juedou_bg:'斗',
shunshou:'顺手牵羊',
guohe:'过河拆桥',
guohe_bg:'拆',
jiedao:'借刀杀人',
wuxie:'无懈可击',
wuxie_bg:'懈',
lebu:'乐不思蜀',
shandian:'闪电',
shandian_bg:'电',
hanbing:'寒冰剑',
renwang:'仁王盾',
hanbing_bg:'冰',
renwang_bg:'盾',
hanbing_skill:'寒冰剑',
renwang_skill:'仁王盾',
2019-12-13 14:13:01 +00:00
hanbing_info:'当你使用杀造成伤害时,你可以防止此伤害,改为依次弃置目标角色的两张牌。',
hanbing_skill_info:'当你使用杀造成伤害时,你可以防止此伤害,改为依次弃置目标角色的两张牌。',
renwang_info:'锁定技,黑色的杀对你无效',
renwang_skill_info:'锁定技,黑色的杀对你无效',
sha_info:'出牌阶段,对攻击范围内的一名角色使用,令其使用一张【闪】,否则受到一点伤害。',
2019-12-12 04:55:15 +00:00
shan_info:'抵消一张【杀】',
2017-04-15 00:25:50 +00:00
tao_info:'出牌阶段,对自己使用,回复一点体力。',
2019-12-13 14:13:01 +00:00
bagua_info:'当你需要使用或打出一张【闪】时,你可以进行一次判定,若判定结果为红色,视为你使用或打出了一张【闪】。',
bagua_skill_info:'当你需要使用或打出一张【闪】时,你可以进行一次判定,若判定结果为红色,视为你使用或打出了一张【闪】。',
jueying_info:'锁定技,其他角色计算与你的距离+1。',
dilu_info:'锁定技,其他角色计算与你的距离+1。',
zhuahuang_info:'锁定技,其他角色计算与你的距离+1。',
chitu_info:'锁定技,你计算与其他角色的距离-1。',
dawan_info:'锁定技,你计算与其他角色的距离-1。',
zixin_info:'锁定技,你计算与其他角色的距离-1。',
zhuge_skill_info:'锁定技,你于出牌阶段内使用【杀】无次数限制。',
zhuge_info:'锁定技,你于出牌阶段内使用【杀】无次数限制。',
cixiong_skill_info:'当你使用【杀】指定一名异性的目标角色后你可以令其选择一项1.弃置一张手牌2.令你摸一张牌。',
cixiong_info:'当你使用【杀】指定一名异性的目标角色后你可以令其选择一项1.弃置一张手牌2.令你摸一张牌。',
qinggang_skill_info:'锁定技,当你使用【杀】指定一名目标角色后,你令其防具技能无效直到此【杀】被抵消或造成伤害。',
qinggang_info:'锁定技,当你使用【杀】指定一名目标角色后,你令其防具技能无效直到此【杀】被抵消或造成伤害。',
qinglong_skill_info:'当你使用的【杀】被目标角色使用的【闪】抵消时,你可以对其使用一张【杀】(无距离限制)。',
qinglong_guozhan_info:'锁定技,当你使用【杀】指定目标后,所有目标角色不能明置武将牌直到此【杀】结算完毕为止。',
qinglong_info:'当你使用的【杀】被目标角色使用的【闪】抵消时,你可以对其使用一张【杀】(无距离限制)。',
qinglong_info_guozhan:'锁定技,当你使用【杀】指定目标后,所有目标角色不能明置武将牌直到此【杀】结算完毕为止。',
2017-04-15 00:25:50 +00:00
zhangba_skill_info:'你可以将两张手牌当【杀】使用或打出。',
zhangba_info:'你可以将两张手牌当【杀】使用或打出。',
2019-12-13 14:13:01 +00:00
guanshi_skill_info:'当你使用的【杀】被目标角色使用的【闪】抵消时,你可以弃置两张牌,令此【杀】依然对其造成伤害。',
guanshi_info:'当你使用的【杀】被目标角色使用的【闪】抵消时,你可以弃置两张牌,令此【杀】依然对其造成伤害。',
2017-04-15 00:25:50 +00:00
fangtian_skill_info:'你使用的【杀】若是你最后的手牌,你可以额外选择至多两个目标。',
fangtian_info:'你使用的【杀】若是你最后的手牌,你可以额外选择至多两个目标。',
2018-08-13 07:17:34 +00:00
fangtian_info_guozhan:'你使用【杀】可以指定任意名角色为目标(不能包含势力相同的角色),若任意一名目标角色使用【闪】抵消了此【杀】,则此【杀】对剩余的目标角色无效。',
2019-12-13 14:13:01 +00:00
qilin_skill_info:'当你使用【杀】对目标角色造成伤害时,你可以弃置其装备区里的一张坐骑牌。',
qilin_info:'当你使用【杀】对目标角色造成伤害时,你可以弃置其装备区里的一张坐骑牌。',
2017-04-23 06:40:20 +00:00
wugu_info:'出牌阶段,对所有角色使用。(选择目标后)你从牌堆顶亮出等同于目标数量的牌,每名目标角色获得这些牌中(剩余的)的任意一张。',
2017-04-15 00:25:50 +00:00
taoyuan_info:'出牌阶段对所有角色使用。每名目标角色回复1点体力。',
nanman_info:'出牌阶段对所有其他角色使用。每名目标角色需打出一张【杀】否则受到1点伤害。',
wanjian_info:'出牌阶段对所有其他角色使用。每名目标角色需打出一张【闪】否则受到1点伤害。',
wuzhong_info:'出牌阶段,对你使用。你摸两张牌。',
juedou_info:'出牌阶段对一名其他角色使用。由其开始其与你轮流打出一张【杀】直到其中一方未打出【杀】为止。未打出【杀】的一方受到另一方对其造成的1点伤害。',
shunshou_info:'出牌阶段对距离为1且区域里有牌的一名其他角色使用。你获得其区域里的一张牌。',
guohe_info:'出牌阶段,对区域里有牌的一名其他角色使用。你弃置其区域里的一张牌。',
jiedao_info:'出牌阶段,对装备区里有武器牌且有使用【杀】的目标的一名其他角色使用。令其对你指定的一名角色使用一张【杀】,否则将其装备区里的武器牌交给你。',
wuxie_info:'一张锦囊牌生效前,对此牌使用。抵消此牌对一名角色产生的效果,或抵消另一张【无懈可击】产生的效果。',
lebu_info:'出牌阶段,对一名其他角色使用。若判定结果不为红桃,跳过其出牌阶段。',
shandian_info:'出牌阶段对自己使用。若判定结果为黑桃2~9则目标角色受到3点雷电伤害。若判定不为黑桃2~9将之移动到下家的判定区里。',
2016-04-02 08:05:24 +00:00
},
2017-04-15 00:25:50 +00:00
list:[
["spade",7,"sha"],
["spade",8,"sha"],
["spade",8,"sha"],
["spade",9,"sha"],
["spade",9,"sha"],
["spade",10,"sha"],
["spade",10,"sha"],
["club",2,"sha"],
["club",3,"sha"],
["club",4,"sha"],
["club",5,"sha"],
["club",6,"sha"],
["club",7,"sha"],
["club",8,"sha"],
["club",8,"sha"],
["club",9,"sha"],
["club",9,"sha"],
["club",10,"sha"],
["club",10,"sha"],
["club",11,"sha"],
["club",11,"sha"],
["heart",10,"sha"],
["heart",10,"sha"],
["heart",11,"sha"],
["diamond",6,"sha"],
["diamond",7,"sha"],
["diamond",8,"sha"],
["diamond",9,"sha"],
["diamond",10,"sha"],
["diamond",13,"sha"],
["heart",2,"shan"],
["heart",2,"shan"],
["heart",13,"shan"],
["diamond",2,"shan"],
["diamond",2,"shan"],
["diamond",3,"shan"],
["diamond",4,"shan"],
["diamond",5,"shan"],
["diamond",6,"shan"],
["diamond",7,"shan"],
["diamond",8,"shan"],
["diamond",9,"shan"],
["diamond",10,"shan"],
["diamond",11,"shan"],
["diamond",11,"shan"],
["heart",3,"tao"],
["heart",4,"tao"],
["heart",6,"tao"],
["heart",7,"tao"],
["heart",8,"tao"],
["heart",9,"tao"],
["heart",12,"tao"],
["diamond",12,"tao"],
2015-04-29 03:25:17 +00:00
2017-04-15 00:25:50 +00:00
["spade",2,"bagua"],
["club",2,"bagua"],
["spade",5,"jueying"],
["club",5,"dilu"],
["heart",13,"zhuahuang"],
["heart",5,"chitu"],
["spade",13,"dawan"],
["diamond",13,"zixin"],
["club",1,"zhuge"],
["diamond",1,"zhuge"],
["spade",2,"cixiong"],
["spade",6,"qinggang"],
["spade",5,"qinglong"],
["spade",12,"zhangba"],
["diamond",5,"guanshi"],
["diamond",12,"fangtian"],
["heart",5,"qilin"],
2015-04-29 03:25:17 +00:00
2017-04-15 00:25:50 +00:00
["heart",3,"wugu"],
["heart",4,"wugu"],
["heart",1,"taoyuan"],
["spade",7,"nanman"],
["spade",13,"nanman"],
["club",7,"nanman"],
["heart",1,"wanjian"],
["spade",1,"juedou"],
["club",1,"juedou"],
["diamond",1,"juedou"],
["heart",7,"wuzhong"],
["heart",8,"wuzhong"],
["heart",9,"wuzhong"],
["heart",11,"wuzhong"],
["spade",3,'shunshou'],
["spade",4,'shunshou'],
["spade",11,'shunshou'],
["diamond",3,'shunshou'],
["diamond",4,'shunshou'],
["spade",3,'guohe'],
["spade",4,'guohe'],
["spade",12,'guohe'],
["club",3,'guohe'],
["club",4,'guohe'],
["heart",12,'guohe'],
["club",12,'jiedao'],
["club",13,'jiedao'],
["spade",11,'wuxie'],
["club",12,'wuxie'],
["club",13,'wuxie'],
["spade",6,'lebu'],
["club",6,'lebu'],
["heart",6,'lebu'],
2019-11-03 01:16:02 +00:00
["spade",1,'shandian'],
2017-04-15 00:25:50 +00:00
["spade",2,'hanbing'],
["club",2,'renwang'],
2019-11-03 01:16:02 +00:00
["heart",12,'shandian'],
2017-04-15 00:25:50 +00:00
["diamond",12,'wuxie'],
],
};
2017-04-14 23:35:56 +00:00
});