This commit is contained in:
libccy 2017-02-11 22:54:55 +08:00
parent e4a55059a6
commit 242e2bba28
5 changed files with 90 additions and 100 deletions

View File

@ -74,14 +74,8 @@ card.extra={
if(player.getActCount()+1>=player.actcount) return 0;
}
var shas=player.get('h','sha');
if(shas.length>1){
if(player.num('e','zhuge')) return 0;
if(player.hasSkill('paoxiao')) return 0;
if(player.hasSkill('fengnu')) return 0;
if(!player.getStat().card.sha){
if(player.hasSkill('tanlin3')) return 0;
if(player.hasSkill('zhaxiang2')) return 0;
}
if(shas.length>1&&player.getCardUsable('sha')>1){
return 0;
}
var card;
if(shas.length){

View File

@ -1585,14 +1585,8 @@ card.swd={
if(player.getActCount()+1>=player.actcount) return false;
}
var shas=player.get('h','sha');
if(shas.length>1){
if(player.num('e','zhuge')) return 0;
if(player.hasSkill('paoxiao')) return 0;
if(player.hasSkill('fengnu')) return 0;
if(!player.getStat().card.sha){
if(player.hasSkill('tanlin3')) return 0;
if(player.hasSkill('zhaxiang2')) return 0;
}
if(shas.length>1&&player.getCardUsable('sha')>1){
return 0;
}
var card;
if(shas.length){
@ -1715,7 +1709,7 @@ card.swd={
chongzhu:true,
type:'trick',
enable:function(){
return game.players.length>2;
return game.countPlayer()>2;
},
filterTarget:function(card,player,target){
return player.next==target||player.previous==target;
@ -1774,11 +1768,7 @@ card.swd={
result:{
target:function(player,target){
if(target.hasSkillTag('nothunder')) return 0;
var num=0;
for(var i=0;i<game.players.length;i++){
if(game.players[i].ai.shown==0) num++;
}
if(num>1) return 0;
if(target.hasUnknown(2)) return 0;
var nh=target.num('h');
if(lib.config.mode=='identity'){
if(target.isZhu&&nh<=2&&target.hp<=1) return -100;
@ -3191,13 +3181,12 @@ card.swd={
target:function(player,target){
if(player.num('h')<=1) return 0;
if(ai.get.attitude(player,target)>=0) return 0;
for(var i=0;i<game.players.length;i++){
if(player!=game.players[i]&&
target.canUse('sha',game.players[i])&&
ai.get.effect(game.players[i],{name:'sha'},target,player)>0){
if(game.hasPlayer(function(current){
return (player!=current&&target.canUse('sha',current)&&
ai.get.effect(current,{name:'sha'},target,player)>0)
})){
return -1;
}
}
return 0;
}
}
@ -4080,10 +4069,10 @@ card.swd={
if(player.hasSkill('hslingjian_chaofeng')) return;
if(card.name=='sha'){
if(target.hasSkill('hslingjian_chaofeng')) return;
for(var i=0;i<game.players.length;i++){
if(game.players[i].hasSkill('hslingjian_chaofeng')){
if(game.players[i].hp<game.players[i].num('h')&&
get.distance(player,game.players[i],'attack')<=1){
if(game.hasPlayer(function(current){
return (current.hasSkill('hslingjian_chaofeng')&&
current.hp<current.num('h')&&get.distance(player,current,'attack')<=1);
})){
return false;
}
}
@ -4091,8 +4080,6 @@ card.swd={
}
}
}
}
}
},
hslingjian_xingtigaizao:{
nopop:true,
@ -4212,10 +4199,9 @@ card.swd={
filter:function(event,player){
var nh=player.num('h');
if(nh==0) return false;
for(var i=0;i<game.players.length;i++){
if(game.players[i]!=player&&game.players[i].num('h')>nh) return true;
}
return false;
return game.hasPlayer(function(current){
return current!=player&&current.num('h')>nh;
});
},
check:function(card){
return 8-ai.get.value(card);

View File

@ -3363,7 +3363,7 @@ character.shenhua={
},
filter:function(event,player){
var length=event.target.num('h');
return (length>=player.hp||length<=get.attackRange(player));
return (length>=player.hp||length<=player.getAttackRange());
},
content:function(){
trigger.directHit=true;

View File

@ -905,7 +905,7 @@ character.yxs={
trigger:{player:'shaBegin'},
forced:true,
content:function(){
var range=get.attackRange(player);
var range=player.getAttackRange();
if(range>trigger.target.hp){
trigger.directHit=true;
}

View File

@ -12789,6 +12789,70 @@
}
},time)
},
getCardUsable:function(card){
var player=this;
if(typeof card=='string'){
card={name:card};
}
var info=get.info(card);
if(info.autoViewAs){
card={name:info.autoViewAs,suit:card.suit,number:card.number};
}
var num=get.info(card).usable;
if(typeof num=='function') num=num(card,player);
num=game.checkMod(card,player,num,'cardUsable',player.get('s'));
if(typeof num!='number') return Infinity;
if(_status.currentPhase==player){
return num-get.cardCount(card,player);
}
return num;
},
getAttackRange:function(){
var player=this;
var range=0;
range=game.checkMod(player,player,range,'globalFrom',player.get('s'));
range=game.checkMod(player,player,range,'attackFrom',player.get('s'));
var equips=player.get('e');
for(var i=0;i<equips.length;i++){
var info=get.info(equips[i]).distance;
if(!info) continue;
if(info.globalFrom){
range+=info.globalFrom;
}
if(info.attackFrom){
range+=info.attackFrom;
}
}
return (1-range);
},
getGlobalFrom:function(){
var player=this;
var range=0;
range=game.checkMod(player,player,range,'globalFrom',player.get('s'));
var equips=player.get('e');
for(var i=0;i<equips.length;i++){
var info=get.info(equips[i]).distance;
if(!info) continue;
if(info.globalFrom){
range+=info.globalFrom;
}
}
return (-range);
},
getGlobalTo:function(){
var player=this;
var range=0;
range=game.checkMod(player,player,range,'globalTo',player.get('s'));
var equips=player.get('e');
for(var i=0;i<equips.length;i++){
var info=get.info(equips[i]).distance;
if(!info) continue;
if(info.globalTo){
range+=info.globalTo;
}
}
return (range);
},
getHandcardLimit:function(){
return game.checkMod(this,this.hp,'maxHandcard',this.get('s'))
},
@ -31933,10 +31997,10 @@
var range=get.info(this).range;
if(range){
if(typeof range.attack==='number'){
player.createRangeShadow(Math.min(8,get.attackRange(player)+range.attack-1));
player.createRangeShadow(Math.min(8,player.getAttackRange()+range.attack-1));
}
else if(typeof range.global==='number'){
player.createRangeShadow(Math.min(8,get.globalFrom(player)+range.global));
player.createRangeShadow(Math.min(8,player.getGlobalFrom()+range.global));
}
}
}
@ -34058,60 +34122,6 @@
if(method=='attack') return m;
return n;
},
cardUsable:function(player,card){
var info=get.info(card);
if(info.autoViewAs){
card={name:info.autoViewAs,suit:card.suit,number:card.number};
}
var num=get.info(card).usable;
if(typeof num=='function') num=num(card,player);
num=game.checkMod(card,player,num,'cardUsable',player.get('s'));
if(typeof num!='number') return Infinity;
else return num-get.cardCount(card,player);
},
attackRange:function(player){
var range=0;
range=game.checkMod(player,player,range,'globalFrom',player.get('s'));
range=game.checkMod(player,player,range,'attackFrom',player.get('s'));
var equips=player.get('e');
for(var i=0;i<equips.length;i++){
var info=get.info(equips[i]).distance;
if(!info) continue;
if(info.globalFrom){
range+=info.globalFrom;
}
if(info.attackFrom){
range+=info.attackFrom;
}
}
return (1-range);
},
globalFrom:function(player){
var range=0;
range=game.checkMod(player,player,range,'globalFrom',player.get('s'));
var equips=player.get('e');
for(var i=0;i<equips.length;i++){
var info=get.info(equips[i]).distance;
if(!info) continue;
if(info.globalFrom){
range+=info.globalFrom;
}
}
return (-range);
},
globalTo:function(player){
var range=0;
range=game.checkMod(player,player,range,'globalTo',player.get('s'));
var equips=player.get('e');
for(var i=0;i<equips.length;i++){
var info=get.info(equips[i]).distance;
if(!info) continue;
if(info.globalTo){
range+=info.globalTo;
}
}
return (range);
},
info:function(item){
if(typeof item=='string'){
return lib.skill[item];
@ -34851,13 +34861,13 @@
tr=document.createElement('tr');
table.appendChild(tr);
td=document.createElement('td');
td.innerHTML=get.attackRange(node);
td.innerHTML=node.getAttackRange();
tr.appendChild(td);
td=document.createElement('td');
td.innerHTML=get.globalFrom(node);
td.innerHTML=node.getGlobalFrom();
tr.appendChild(td);
td=document.createElement('td');
td.innerHTML=get.globalTo(node);
td.innerHTML=node.getGlobalTo();
tr.appendChild(td);
uiintro.content.appendChild(table);