This commit is contained in:
libccy 2017-02-10 16:13:06 +08:00
parent cd554129cd
commit 85046e9bc0
11 changed files with 130 additions and 76 deletions

View File

@ -1187,16 +1187,36 @@ card.swd={
}
},
ai:{
order:1,
order:4,
result:{
target:function(player,target){
if(target.get('e','2')){
if(target.num('h')) return -0.6;
if(target.num('h')&&!target.hasSkillTag('noe')) return -0.6;
return 0;
}
else{
if(target.num('h')) return 0.5;
return 1;
var hs=target.get('h');
var num=0;
if(target.hasSkillTag('noe')){
num=1;
}
if(player==target){
if(hs.length==2) return num;
if(hs.length==1) return num+1;
if(hs.length<=4){
for(var i=0;i<hs.length;i++){
if(ai.get.value(hs[i])>6) return num;
}
}
if(hs.length>4) return num+0.5;
}
else{
if(hs.length){
if(hs.length<=3) return num;
return num+0.5;
}
}
return num+1;
}
}
},
@ -1229,7 +1249,7 @@ card.swd={
order:9,
result:{
target:function(player,target){
if(target.num('h')<target.hp) return 1;
if(!player.needsToDiscard()) return 1;
return 0;
}
},
@ -1257,7 +1277,19 @@ card.swd={
result:{
target:function(player,target){
if(target.hasSkillTag('noe')) return target.num('e')*2;
return -target.num('e');
var num=0;
var es=target.get('e');
for(var i=0;i<es.length;i++){
var subtype=get.subtype(es[i]);
if(subtype=='equip1'||subtype=='equip3'){
num++;
}
}
var mn=target.getEquip('muniu');
if(mn&&mn.cards&&mn.cards.length){
num+=mn.cards.length;
}
return -num;
}
},
useful:[2,0.5],
@ -1285,7 +1317,7 @@ card.swd={
target.addTempSkill('qianxing',{player:'turnOverAfter'});
},
ai:{
order:9,
order:2,
result:{
target:-1,
},
@ -4110,10 +4142,7 @@ card.swd={
}
},
ai:{
order:function(card,player){
if(player.num('h',{type:'hslingjian'})) return 8.5;
return 1;
},
order:1,
result:{
player:1,
}

View File

@ -776,21 +776,21 @@ character.gujian={
direct:true,
content:function(){
"step 0"
player.chooseToDiscard(get.prompt('fumo',trigger.source),2,function(card){
var next=player.chooseToDiscard(get.prompt('fumo',trigger.source),2,function(card){
if(ui.selected.cards.length){
return get.color(card)==get.color(ui.selected.cards[0]);
}
return player.num('h',{color:get.color(card)})>1;
}).set('complexCard',true).ai=function(card){
}).set('complexCard',true);
next.ai=function(card){
if(ai.get.damageEffect(trigger.source,player,player,'thunder')>0){
return 8-ai.get.value(card);
}
return 0;
};
next.logSkill=['fumo',trigger.source,'thunder'];
"step 1"
if(result.bool){
player.logSkill('fumo',trigger.source,'thunder');
// player.line(trigger.source,'thunder');
trigger.source.damage('thunder');
}
},

View File

@ -1358,7 +1358,6 @@ character.refresh={
}
return target.num('he')>0;
},
complexTarget:true,
filter:function(event,player){
return player.num('he')>0;
},

View File

@ -55,7 +55,7 @@ character.shenhua={
},
selectCard:[0,Infinity],
selectTarget:2,
complexTarget:true,
complexCard:true,
filterTarget:function(card,player,target){
if(player==target) return false;
if(ui.selected.targets.length==0) return true;
@ -887,7 +887,6 @@ character.shenhua={
return target.num('ej')>0;
}
},
complexTarget:true,
selectTarget:2,
filterCard:lib.filter.cardDiscardable,
prompt:'是否发动巧变跳过出牌阶段?',
@ -2079,7 +2078,7 @@ character.shenhua={
},
selectCard:[0,Infinity],
selectTarget:2,
complexTarget:true,
complexCard:true,
filterTarget:function(card,player,target){
if(player==target) return false;
if(ui.selected.targets.length==0) return true;

View File

@ -1076,7 +1076,6 @@ character.sp={
init:function(player){
player.storage.jianshu=false;
},
complexTarget:true,
filterTarget:function(card,player,target){
if(ui.selected.targets.length){
return target.num('h')>0&&target.distanceTo(ui.selected.targets[0])<=1;
@ -6483,6 +6482,7 @@ character.sp={
position:'he',
selectCard:[1,Infinity],
complexSelect:true,
complexCard:true,
filterTarget:function(card,player,target){
return target!=player&&get.distance(player,target,'attack')<=1&&ui.selected.cards.length==target.hp;
},

View File

@ -1536,7 +1536,6 @@ character.standard={
check:function(card){return 10-ai.get.value(card)},
filterCard:true,
position:'he',
complexTarget:true,
filterTarget:function(card,player,target){
if(player==target) return false;
if(target.sex!='male') return false;

View File

@ -6986,7 +6986,6 @@ character.swd={
return true;
},
complexCard:true,
complexTarget:true,
selectCard:[1,Infinity],
filterTarget:function(card,player,target){
if(player==target) return false;

View File

@ -5337,7 +5337,6 @@ character.yijiang={
return false;
},
selectTarget:2,
complexTarget:true,
content:function(){
'step 0'
var gainner,giver;
@ -5419,7 +5418,6 @@ character.yijiang={
selectTarget:2,
multitarget:true,
discard:false,
complexTarget:true,
targetprompt:['得到牌','出杀目标'],
prepare:'give',
filterTarget:function(card,player,target){
@ -6752,7 +6750,6 @@ character.yijiang={
return Math.abs(ui.selected.targets[0].num('e')-target.num('e'))<=player.maxHp-player.hp;
},
multitarget:true,
complexTarget:true,
content:function(){
"step 0"
event.cards=[targets[0].get('e'),targets[1].get('e')];

View File

@ -2336,7 +2336,6 @@ character.yxs={
return 7-ai.get.value(card);
},
multitarget:true,
complexTarget:true,
targetprompt:['被移走','移动目标'],
filterTarget:function(card,player,target){
if(ui.selected.targets.length){

View File

@ -20504,59 +20504,63 @@
var cards=player.get(event.position||'h');
var firstCheck=false;
range=get.select(event.selectCard);
if(!event._cardChoice&&typeof event.selectCard!='function'){
if(range[0]==1&&range[1]==1){
event._cardChoice=[];
}
else if(typeof event.filterCard!='function'){
event._cardChoice=[];
}
else if(!event.complexCard){
event._cardChoice=[];
}
if(event._cardChoice){
firstCheck=true;
}
if(!event._cardChoice&&typeof event.selectCard!='function'&&!event.complexCard&&range[1]!=-1){
event._cardChoice=[];
firstCheck=true;
}
// if(event.name=='chooseToUse'&&event.parent.name=='phaseUse'&&!event.skill&&
// !event._targetChoice&&event._cardChoice&&event._cardChoice.length){
// event._targetChoice=new Map();
// var tmpselect=ui.selected;
// for(var i=0;i<event._cardChoice.length;i++){
// var targets=[];
// if(!lib.card[event._cardChoice[i].name].complexTarget){
// ui.selected={buttons:[],cards:[event._cardChoice[i]],targets:[]};
// for(var j=0;j<game.players.length;j++){
// if(event.filterTarget(event._cardChoice[i],,game.players[i]))
// }
// }
// }
// }
var selectableCards=false;
if(range[0]!=range[1]||range[0]>1) auto=false;
for(i=0;i<cards.length;i++){
if(event._cardChoice&&!firstCheck){
if(ui.selected.cards.length>=range[1]||
!event._cardChoice.contains(cards[i])||
!lib.filter.cardAiIncluded(cards[i])){
cards[i].classList.remove('selectable');
}
else{
cards[i].classList.add('selectable');
var nochess=true;
if(!lib.filter.cardAiIncluded(cards[i])){
nochess=false;
}
else if(event._cardChoice&&!firstCheck){
if(!event._cardChoice.contains(cards[i])){
nochess=false;
}
}
else{
if(event.filterCard(cards[i],player)&&
lib.filter.cardAiIncluded(cards[i])&&
(player.isOut()==false||event.includeOutCard)&&
lib.filter.cardRespondable(cards[i],player)&&
!cards[i].classList.contains('uncheck')){
if(ui.selected.cards.length<range[1]){
cards[i].classList.add('selectable');
if(event._cardChoice){
event._cardChoice.push(cards[i]);
}
}
else if(range[1]==-1){
cards[i].classList.add('selected');
ui.selected.cards.add(cards[i]);
}
else{
cards[i].classList.remove('selectable');
if(player.isOut()||!lib.filter.cardRespondable(cards[i],player)||
cards[i].classList.contains('uncheck')||
!event.filterCard(cards[i],player)){
nochess=false;
}
}
if(nochess){
if(ui.selected.cards.length<range[1]){
cards[i].classList.add('selectable');
if(event._cardChoice){
event._cardChoice.push(cards[i]);
}
}
else if(range[1]==-1){
cards[i].classList.add('selected');
ui.selected.cards.add(cards[i]);
}
else{
cards[i].classList.remove('selectable');
if(range[1]==-1){
cards[i].classList.remove('selected');
ui.selected.cards.remove(cards[i]);
}
}
}
else{
cards[i].classList.remove('selectable');
if(range[1]==-1){
cards[i].classList.remove('selected');
ui.selected.cards.remove(cards[i]);
}
}
if(cards[i].classList.contains('selected')){
@ -20582,20 +20586,33 @@
}
else{
var card=get.card();
var firstCheck=false;
range=get.select(event.selectTarget);
var selectableTargets=false;
if(range[0]!=range[1]||range[0]>1) auto=false;
for(i=0;i<game.players.length;i++){
var nochess=true;
if(game.chess&&!event.chessForceAll){
if(player&&get.distance(player,game.players[i],'pure')>7){
if(game.chess&&!event.chessForceAll&&player&&get.distance(player,game.players[i],'pure')>7){
nochess=false;
}
else if(game.players[i].isOut()){
nochess=false;
}
else if(event._targetChoice){
var targetChoice=event.targetChoice.get(card);
if(!Array.isArray(targetChoice)||!targetChoice.contains(game.players[i])){
nochess=false;
}
}
if(event.filterTarget(card,player,game.players[i])&&!game.players[i].forceout&&
(game.players[i].isOut()==false||event.includeOutTarget)&&nochess){
else if(!event.filterTarget(card,player,game.players[i])){
nochess=false;
}
if(nochess){
if(ui.selected.targets.length<range[1]){
game.players[i].classList.add('selectable');
if(Array.isArray(event._targetChoice)){
event._targetChoice.push(game.players[i]);
}
}
else if(range[1]==-1){
game.players[i].classList.add('selected');
@ -20615,9 +20632,9 @@
if(game.players[i].classList.contains('selected')){
game.players[i].classList.add('selectable');
}
else if(!selectableTargets&&game.players[i].classList.contains('selectable')){
selectableTargets=true;
}
else if(!selectableTargets&&game.players[i].classList.contains('selectable')){
selectableTargets=true;
}
if(game.players[i].instance){
if(game.players[i].classList.contains('selected')){
game.players[i].instance.classList.add('selected');
@ -32906,6 +32923,23 @@
};
var get={
is:{
node:function(obj){
var str=Object.prototype.toString.call(obj);
if(str&&str.indexOf('[object HTML')) return true;
return false;
},
div:function(obj){
return Object.prototype.toString.call(obj) === '[object HTMLDivElement]';
},
map:function(obj){
return Object.prototype.toString.call(obj) === '[object Map]';
},
set:function(obj){
return Object.prototype.toString.call(obj) === '[object Set]';
},
object:function(obj){
return Object.prototype.toString.call(obj) === '[object Object]';
},
singleSelect:function(func){
if(typeof func=='function') return false;
var select=get.select(func);

View File

@ -4170,7 +4170,6 @@ mode.stone={
}
return true;
},
complexTarget:true,
selectTarget:2,
multitarget:true,
multiline:true,