This commit is contained in:
parent
e4a55059a6
commit
242e2bba28
|
@ -74,14 +74,8 @@ card.extra={
|
||||||
if(player.getActCount()+1>=player.actcount) return 0;
|
if(player.getActCount()+1>=player.actcount) return 0;
|
||||||
}
|
}
|
||||||
var shas=player.get('h','sha');
|
var shas=player.get('h','sha');
|
||||||
if(shas.length>1){
|
if(shas.length>1&&player.getCardUsable('sha')>1){
|
||||||
if(player.num('e','zhuge')) return 0;
|
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
var card;
|
var card;
|
||||||
if(shas.length){
|
if(shas.length){
|
||||||
|
|
48
card/swd.js
48
card/swd.js
|
@ -1585,14 +1585,8 @@ card.swd={
|
||||||
if(player.getActCount()+1>=player.actcount) return false;
|
if(player.getActCount()+1>=player.actcount) return false;
|
||||||
}
|
}
|
||||||
var shas=player.get('h','sha');
|
var shas=player.get('h','sha');
|
||||||
if(shas.length>1){
|
if(shas.length>1&&player.getCardUsable('sha')>1){
|
||||||
if(player.num('e','zhuge')) return 0;
|
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
var card;
|
var card;
|
||||||
if(shas.length){
|
if(shas.length){
|
||||||
|
@ -1715,7 +1709,7 @@ card.swd={
|
||||||
chongzhu:true,
|
chongzhu:true,
|
||||||
type:'trick',
|
type:'trick',
|
||||||
enable:function(){
|
enable:function(){
|
||||||
return game.players.length>2;
|
return game.countPlayer()>2;
|
||||||
},
|
},
|
||||||
filterTarget:function(card,player,target){
|
filterTarget:function(card,player,target){
|
||||||
return player.next==target||player.previous==target;
|
return player.next==target||player.previous==target;
|
||||||
|
@ -1774,11 +1768,7 @@ card.swd={
|
||||||
result:{
|
result:{
|
||||||
target:function(player,target){
|
target:function(player,target){
|
||||||
if(target.hasSkillTag('nothunder')) return 0;
|
if(target.hasSkillTag('nothunder')) return 0;
|
||||||
var num=0;
|
if(target.hasUnknown(2)) return 0;
|
||||||
for(var i=0;i<game.players.length;i++){
|
|
||||||
if(game.players[i].ai.shown==0) num++;
|
|
||||||
}
|
|
||||||
if(num>1) return 0;
|
|
||||||
var nh=target.num('h');
|
var nh=target.num('h');
|
||||||
if(lib.config.mode=='identity'){
|
if(lib.config.mode=='identity'){
|
||||||
if(target.isZhu&&nh<=2&&target.hp<=1) return -100;
|
if(target.isZhu&&nh<=2&&target.hp<=1) return -100;
|
||||||
|
@ -3191,12 +3181,11 @@ card.swd={
|
||||||
target:function(player,target){
|
target:function(player,target){
|
||||||
if(player.num('h')<=1) return 0;
|
if(player.num('h')<=1) return 0;
|
||||||
if(ai.get.attitude(player,target)>=0) return 0;
|
if(ai.get.attitude(player,target)>=0) return 0;
|
||||||
for(var i=0;i<game.players.length;i++){
|
if(game.hasPlayer(function(current){
|
||||||
if(player!=game.players[i]&&
|
return (player!=current&&target.canUse('sha',current)&&
|
||||||
target.canUse('sha',game.players[i])&&
|
ai.get.effect(current,{name:'sha'},target,player)>0)
|
||||||
ai.get.effect(game.players[i],{name:'sha'},target,player)>0){
|
})){
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -4080,13 +4069,11 @@ card.swd={
|
||||||
if(player.hasSkill('hslingjian_chaofeng')) return;
|
if(player.hasSkill('hslingjian_chaofeng')) return;
|
||||||
if(card.name=='sha'){
|
if(card.name=='sha'){
|
||||||
if(target.hasSkill('hslingjian_chaofeng')) return;
|
if(target.hasSkill('hslingjian_chaofeng')) return;
|
||||||
for(var i=0;i<game.players.length;i++){
|
if(game.hasPlayer(function(current){
|
||||||
if(game.players[i].hasSkill('hslingjian_chaofeng')){
|
return (current.hasSkill('hslingjian_chaofeng')&&
|
||||||
if(game.players[i].hp<game.players[i].num('h')&&
|
current.hp<current.num('h')&&get.distance(player,current,'attack')<=1);
|
||||||
get.distance(player,game.players[i],'attack')<=1){
|
})){
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4212,10 +4199,9 @@ card.swd={
|
||||||
filter:function(event,player){
|
filter:function(event,player){
|
||||||
var nh=player.num('h');
|
var nh=player.num('h');
|
||||||
if(nh==0) return false;
|
if(nh==0) return false;
|
||||||
for(var i=0;i<game.players.length;i++){
|
return game.hasPlayer(function(current){
|
||||||
if(game.players[i]!=player&&game.players[i].num('h')>nh) return true;
|
return current!=player&¤t.num('h')>nh;
|
||||||
}
|
});
|
||||||
return false;
|
|
||||||
},
|
},
|
||||||
check:function(card){
|
check:function(card){
|
||||||
return 8-ai.get.value(card);
|
return 8-ai.get.value(card);
|
||||||
|
|
|
@ -3363,7 +3363,7 @@ character.shenhua={
|
||||||
},
|
},
|
||||||
filter:function(event,player){
|
filter:function(event,player){
|
||||||
var length=event.target.num('h');
|
var length=event.target.num('h');
|
||||||
return (length>=player.hp||length<=get.attackRange(player));
|
return (length>=player.hp||length<=player.getAttackRange());
|
||||||
},
|
},
|
||||||
content:function(){
|
content:function(){
|
||||||
trigger.directHit=true;
|
trigger.directHit=true;
|
||||||
|
|
|
@ -905,7 +905,7 @@ character.yxs={
|
||||||
trigger:{player:'shaBegin'},
|
trigger:{player:'shaBegin'},
|
||||||
forced:true,
|
forced:true,
|
||||||
content:function(){
|
content:function(){
|
||||||
var range=get.attackRange(player);
|
var range=player.getAttackRange();
|
||||||
if(range>trigger.target.hp){
|
if(range>trigger.target.hp){
|
||||||
trigger.directHit=true;
|
trigger.directHit=true;
|
||||||
}
|
}
|
||||||
|
|
128
game/game.js
128
game/game.js
|
@ -12789,6 +12789,70 @@
|
||||||
}
|
}
|
||||||
},time)
|
},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(){
|
getHandcardLimit:function(){
|
||||||
return game.checkMod(this,this.hp,'maxHandcard',this.get('s'))
|
return game.checkMod(this,this.hp,'maxHandcard',this.get('s'))
|
||||||
},
|
},
|
||||||
|
@ -31933,10 +31997,10 @@
|
||||||
var range=get.info(this).range;
|
var range=get.info(this).range;
|
||||||
if(range){
|
if(range){
|
||||||
if(typeof range.attack==='number'){
|
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'){
|
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;
|
if(method=='attack') return m;
|
||||||
return n;
|
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){
|
info:function(item){
|
||||||
if(typeof item=='string'){
|
if(typeof item=='string'){
|
||||||
return lib.skill[item];
|
return lib.skill[item];
|
||||||
|
@ -34851,13 +34861,13 @@
|
||||||
tr=document.createElement('tr');
|
tr=document.createElement('tr');
|
||||||
table.appendChild(tr);
|
table.appendChild(tr);
|
||||||
td=document.createElement('td');
|
td=document.createElement('td');
|
||||||
td.innerHTML=get.attackRange(node);
|
td.innerHTML=node.getAttackRange();
|
||||||
tr.appendChild(td);
|
tr.appendChild(td);
|
||||||
td=document.createElement('td');
|
td=document.createElement('td');
|
||||||
td.innerHTML=get.globalFrom(node);
|
td.innerHTML=node.getGlobalFrom();
|
||||||
tr.appendChild(td);
|
tr.appendChild(td);
|
||||||
td=document.createElement('td');
|
td=document.createElement('td');
|
||||||
td.innerHTML=get.globalTo(node);
|
td.innerHTML=node.getGlobalTo();
|
||||||
tr.appendChild(td);
|
tr.appendChild(td);
|
||||||
|
|
||||||
uiintro.content.appendChild(table);
|
uiintro.content.appendChild(table);
|
||||||
|
|
Loading…
Reference in New Issue