This commit is contained in:
parent
bb0a4b59d3
commit
34c52f2bd0
|
@ -1544,7 +1544,7 @@ card.gujian={
|
|||
content:function(){
|
||||
player.chooseToUse(get.prompt('shihuifen',trigger.player).replace(/发动/,'使用'),function(card,player){
|
||||
if(card.name!='shihuifen') return false;
|
||||
var mod=game.checkMod(card,player,'unchanged','cardEnabled',player.get('s'));
|
||||
var mod=game.checkMod(card,player,'unchanged','cardEnabled',player.getSkills());
|
||||
if(mod!='unchanged') return mod;
|
||||
return true;
|
||||
},trigger.player,-1).targetRequired=true;
|
||||
|
@ -1560,7 +1560,7 @@ card.gujian={
|
|||
content:function(){
|
||||
player.chooseToUse(get.prompt('jinlianzhu',trigger.player).replace(/发动/,'使用'),function(card,player){
|
||||
if(card.name!='jinlianzhu') return false;
|
||||
var mod=game.checkMod(card,player,'unchanged','cardEnabled',player.get('s'));
|
||||
var mod=game.checkMod(card,player,'unchanged','cardEnabled',player.getSkills());
|
||||
if(mod!='unchanged') return mod;
|
||||
return true;
|
||||
},trigger.player,-1).targetRequired=true;
|
||||
|
|
|
@ -81,7 +81,7 @@ card.standard={
|
|||
next.set('ai',function(){
|
||||
var target=_status.event.player;
|
||||
var evt=_status.event.getParent();
|
||||
var sks=target.get('s');
|
||||
var sks=target.getSkills();
|
||||
if(sks.contains('leiji')||
|
||||
sks.contains('releiji')||
|
||||
sks.contains('lingbo')){
|
||||
|
@ -1225,7 +1225,7 @@ card.standard={
|
|||
result:{
|
||||
target:function(player,target){
|
||||
var num=game.countPlayer(function(current){
|
||||
var skills=current.get('s');
|
||||
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){
|
||||
|
@ -1590,7 +1590,7 @@ card.standard={
|
|||
event.tempnowuxie=(trigger.targets&&trigger.targets.length>1&&!trigger.multitarget);
|
||||
event.filterCard=function(card,player){
|
||||
if(card.name!='wuxie') return false;
|
||||
var mod=game.checkMod(card,player,'unchanged','cardEnabled',player.get('s'));
|
||||
var mod=game.checkMod(card,player,'unchanged','cardEnabled',player.getSkills());
|
||||
if(mod!='unchanged') return mod;
|
||||
return true;
|
||||
};
|
||||
|
@ -1625,7 +1625,7 @@ card.standard={
|
|||
var next=player.chooseToUse({
|
||||
filterCard:function(card,player){
|
||||
if(card.name!='wuxie') return false;
|
||||
var mod=game.checkMod(card,player,'unchanged','cardEnabled',player.get('s'));
|
||||
var mod=game.checkMod(card,player,'unchanged','cardEnabled',player.getSkills());
|
||||
if(mod!='unchanged') return mod;
|
||||
return true;
|
||||
},
|
||||
|
|
|
@ -2059,7 +2059,7 @@ card.swd={
|
|||
enable:'phaseUse',
|
||||
usable:1,
|
||||
filter:function(event,player){
|
||||
var skills=player.get('s');
|
||||
var skills=player.getSkills();
|
||||
for(var i=0;i<skills.length;i++){
|
||||
if(skills[i].indexOf('yuchan')==0&&skills[i].indexOf('_equip')!=-1){
|
||||
return player.countCards('h',{type:'basic'})>0;
|
||||
|
@ -2160,7 +2160,7 @@ card.swd={
|
|||
content:function(){
|
||||
player.chooseToUse(get.prompt('shencaojie',trigger.player).replace(/发动/,'使用'),function(card,player){
|
||||
if(card.name!='shencaojie') return false;
|
||||
var mod=game.checkMod(card,player,'unchanged','cardEnabled',player.get('s'));
|
||||
var mod=game.checkMod(card,player,'unchanged','cardEnabled',player.getSkills());
|
||||
if(mod!='unchanged') return mod;
|
||||
return true;
|
||||
},trigger.player,-1).targetRequired=true;
|
||||
|
@ -2199,7 +2199,7 @@ card.swd={
|
|||
player.storage.shenmiguo=[card,(trigger._targets||trigger.targets).slice(0)];
|
||||
player.chooseToUse('是否使用神秘果?',function(card,player){
|
||||
if(card.name!='shenmiguo'&&card.name!='yuchankan') return false;
|
||||
var mod=game.checkMod(card,player,'unchanged','cardEnabled',player.get('s'));
|
||||
var mod=game.checkMod(card,player,'unchanged','cardEnabled',player.getSkills());
|
||||
if(mod!='unchanged') return mod;
|
||||
return true;
|
||||
},trigger.player,-1).set('cardname',trigger.card.name).targetRequired=true;
|
||||
|
|
|
@ -1054,7 +1054,7 @@ card.yunchou={
|
|||
content:function(){
|
||||
player.chooseToUse(get.prompt('chenhuodajie',trigger.player).replace(/发动/,'使用'),function(card,player){
|
||||
if(card.name!='chenhuodajie') return false;
|
||||
var mod=game.checkMod(card,player,'unchanged','cardEnabled',player.get('s'));
|
||||
var mod=game.checkMod(card,player,'unchanged','cardEnabled',player.getSkills());
|
||||
if(mod!='unchanged') return mod;
|
||||
return true;
|
||||
},trigger.player,-1).targetRequired=true;
|
||||
|
|
|
@ -532,7 +532,7 @@ character.hearth={
|
|||
}).ai=function(target){
|
||||
var att=ai.get.attitude(player,target);
|
||||
if(att>=0) return 0;
|
||||
var skills=target.get('s');
|
||||
var skills=target.getSkills();
|
||||
for(var i=0;i<skills.length;i++){
|
||||
if(!get.is.locked(skills[i])){
|
||||
if(target.hasSkillTag('maixie')) return 2;
|
||||
|
@ -713,7 +713,7 @@ character.hearth={
|
|||
silent:true,
|
||||
content:function(){
|
||||
var list=['yushou_misha','yushou_huofu','yushou_leiouke'];
|
||||
var skills=player.get('s');
|
||||
var skills=player.getSkills();
|
||||
for(var i=0;i<list.length;i++){
|
||||
if(!skills.contains(list[i])) list.splice(i--,1);
|
||||
}
|
||||
|
|
|
@ -463,11 +463,11 @@ character.ow={
|
|||
var position=get.is.altered('pingzhang')?'h':'he';
|
||||
if(event.player==player){
|
||||
if(player.hasSkill('pingzhang2')) return false;
|
||||
return player.num(position,{suit:'heart'});
|
||||
return player.countCards(position,{suit:'heart'});
|
||||
}
|
||||
else{
|
||||
if(player.hasSkill('pingzhang3')) return false;
|
||||
return player.num(position,{suit:'spade'});
|
||||
return player.countCards(position,{suit:'spade'});
|
||||
}
|
||||
},
|
||||
direct:true,
|
||||
|
|
|
@ -51,7 +51,7 @@ character.refresh={
|
|||
if(player.hp==player.maxHp||player.storage.rerende<0||player.countCards('h')<=1){
|
||||
var players=game.filterPlayer();
|
||||
for(var i=0;i<players.length;i++){
|
||||
if(players[i].get('s').contains('haoshi')&&
|
||||
if(players[i].getSkills().contains('haoshi')&&
|
||||
!players[i].isTurnedOver()&&
|
||||
!players[i].hasJudge('lebu')&&
|
||||
ai.get.attitude(player,players[i])>=3&&
|
||||
|
@ -174,7 +174,7 @@ character.refresh={
|
|||
var nh=target.countCards('h');
|
||||
var np=player.countCards('h');
|
||||
if(player.hp==player.maxHp||player.storage.rerende<0||player.countCards('h')<=1){
|
||||
if(nh>=np-1&&np<=player.hp&&!target.get('s').contains('haoshi')) return 0;
|
||||
if(nh>=np-1&&np<=player.hp&&!target.getSkills().contains('haoshi')) return 0;
|
||||
}
|
||||
return Math.max(1,5-nh);
|
||||
}
|
||||
|
@ -1245,7 +1245,7 @@ character.refresh={
|
|||
"step 0"
|
||||
player.chooseControl(['red','black','basic','trick','equip']).set('ai',function(){
|
||||
var player=_status.event.player;
|
||||
if(player.num('shan')==0) return 'basic';
|
||||
if(!player.hasShan()) return 'basic';
|
||||
if(player.countCards('e')<=1) return 'equip';
|
||||
if(player.countCards('h')>2) return 'trick';
|
||||
return 'red';
|
||||
|
|
|
@ -2579,7 +2579,7 @@ character.shenhua={
|
|||
mod:{
|
||||
cardSavable:function(card,player){
|
||||
if(!_status.currentPhase) return;
|
||||
if(_status.currentPhase.get('s').contains('wansha')&&_status.currentPhase!=player){
|
||||
if(_status.currentPhase.getSkills().contains('wansha')&&_status.currentPhase!=player){
|
||||
if(card.name=='tao'&&_status.event.dying!=player) return false;
|
||||
}
|
||||
}
|
||||
|
@ -4043,7 +4043,7 @@ character.shenhua={
|
|||
check:function(button){
|
||||
var player=_status.event.player;
|
||||
if(player.countCards('h','wuzhong')){
|
||||
if(player.hp==1&&player.num('tao')){
|
||||
if(player.hp==1&&player.countCards('h','tao')){
|
||||
return button.link=='tao'?1:0;
|
||||
}
|
||||
return button.link=='wuzhong'?1:0;
|
||||
|
|
|
@ -268,7 +268,7 @@ character.sp={
|
|||
else{
|
||||
var info=lib.character[event.player.name];
|
||||
if(!info) return false;
|
||||
var skills=event.player.get('s');
|
||||
var skills=event.player.getSkills();
|
||||
for(var i=0;i<info[3].length;i++){
|
||||
if(skills.contains(info[3][i])) return true;
|
||||
}
|
||||
|
@ -302,7 +302,7 @@ character.sp={
|
|||
if(result.index==1){
|
||||
if(get.mode()!='guozhan'){
|
||||
var info=lib.character[trigger.player.name];
|
||||
var skills=trigger.player.get('s');
|
||||
var skills=trigger.player.getSkills();
|
||||
var list=[];
|
||||
for(var i=0;i<info[3].length;i++){
|
||||
if(skills.contains(info[3][i])){
|
||||
|
@ -4786,7 +4786,7 @@ character.sp={
|
|||
},
|
||||
content:function(){
|
||||
player.storage.mozhi.add(trigger.card);
|
||||
if(player.get('s').contains('mozhi')) player.markSkill('mozhi');
|
||||
if(player.getSkills().contains('mozhi')) player.markSkill('mozhi');
|
||||
}
|
||||
},
|
||||
chenqing2:{},
|
||||
|
@ -5760,7 +5760,7 @@ character.sp={
|
|||
game.log(player,'的判定牌改为',player.storage.zhoufu2);
|
||||
game.delay(2);
|
||||
"step 1"
|
||||
if(player.storage.zhoufu3.isAlive()&&player.storage.zhoufu3.get('s').contains('yingbin')){
|
||||
if(player.storage.zhoufu3.isAlive()&&player.storage.zhoufu3.getSkills().contains('yingbin')){
|
||||
player.storage.zhoufu3.logSkill('yingbin');
|
||||
player.storage.zhoufu3.draw(2);
|
||||
}
|
||||
|
@ -8034,8 +8034,8 @@ character.sp={
|
|||
mod:{
|
||||
targetEnabled:function(card,player,target){
|
||||
if(card.name!='sha') return;
|
||||
if(player==_status.currentPhase&&player.get('s').contains('chixin')){
|
||||
var num=game.checkMod(card,player,1,'cardUsable',player.get('s'))-20;
|
||||
if(player==_status.currentPhase&&player.getSkills().contains('chixin')){
|
||||
var num=game.checkMod(card,player,1,'cardUsable',player.getSkills())-20;
|
||||
var players=game.filterPlayer();
|
||||
for(var i=0;i<players.length;i++){
|
||||
if(players[i].hasSkill('chixin3')){
|
||||
|
|
|
@ -504,7 +504,7 @@ character.standard={
|
|||
}
|
||||
var players=game.filterPlayer();
|
||||
for(var i=0;i<players.length;i++){
|
||||
if(players[i].get('s').contains('haoshi')&&
|
||||
if(players[i].getSkills().contains('haoshi')&&
|
||||
!players[i].isTurnedOver()&&
|
||||
!players[i].hasJudge('lebu')&&
|
||||
ai.get.attitude(player,players[i])>=3&&
|
||||
|
@ -548,7 +548,7 @@ character.standard={
|
|||
var nh=target.countCards('h');
|
||||
var np=player.countCards('h');
|
||||
if(player.hp==player.maxHp||player.storage.rende<0||player.countCards('h')<=1){
|
||||
if(nh>=np-1&&np<=player.hp&&!target.get('s').contains('haoshi')) return 0;
|
||||
if(nh>=np-1&&np<=player.hp&&!target.getSkills().contains('haoshi')) return 0;
|
||||
}
|
||||
return Math.max(1,5-nh);
|
||||
}
|
||||
|
|
|
@ -2975,7 +2975,7 @@ character.swd={
|
|||
order:11,
|
||||
result:{
|
||||
target:function(player,target){
|
||||
var skills=target.get('s');
|
||||
var skills=target.getSkills();
|
||||
for(var i=0;i<skills.length;i++){
|
||||
if(!get.is.locked(skills[i])){
|
||||
if(target.hasSkillTag('maixie')) return -2;
|
||||
|
@ -5659,10 +5659,10 @@ character.swd={
|
|||
}
|
||||
player.chooseButton(dialog,function(button){
|
||||
var player=get.owner(button.link);
|
||||
if(get.subtype(button.link)=='equip2'&&player.num('shan')==0){
|
||||
if(get.subtype(button.link)=='equip2'&&!player.hasShan()){
|
||||
return 11-ai.get.attitude(_status.event.player,player);
|
||||
}
|
||||
if(get.subtype(button.link)=='equip1'&&player.num('sha')==0){
|
||||
if(get.subtype(button.link)=='equip1'&&!player.hasSha()){
|
||||
return 11-ai.get.attitude(_status.event.player,player);
|
||||
}
|
||||
return 5-ai.get.attitude(_status.event.player,player);
|
||||
|
@ -6366,7 +6366,7 @@ character.swd={
|
|||
// if(target.name&&!target.isUnseen(0)) names.add(target.name);
|
||||
// if(target.name1&&!target.isUnseen(0)) names.add(target.name1);
|
||||
// if(target.name2&&!target.isUnseen(1)) names.add(target.name2);
|
||||
// var pss=player.get('s');
|
||||
// var pss=player.getSkills();
|
||||
// for(var i=0;i<names.length;i++){
|
||||
// var info=lib.character[names[i]];
|
||||
// if(info){
|
||||
|
@ -6496,7 +6496,7 @@ character.swd={
|
|||
if(target.name&&!target.isUnseen(0)) names.add(target.name);
|
||||
if(target.name1&&!target.isUnseen(0)) names.add(target.name1);
|
||||
if(target.name2&&!target.isUnseen(1)) names.add(target.name2);
|
||||
var pss=player.get('s');
|
||||
var pss=player.getSkills();
|
||||
for(var i=0;i<names.length;i++){
|
||||
var info=lib.character[names[i]];
|
||||
if(info){
|
||||
|
@ -6518,7 +6518,7 @@ character.swd={
|
|||
if(target.name&&!target.isUnseen(0)) names.add(target.name);
|
||||
if(target.name1&&!target.isUnseen(0)) names.add(target.name1);
|
||||
if(target.name2&&!target.isUnseen(1)) names.add(target.name2);
|
||||
var pss=player.get('s');
|
||||
var pss=player.getSkills();
|
||||
for(var i=0;i<names.length;i++){
|
||||
var info=lib.character[names[i]];
|
||||
if(info){
|
||||
|
@ -6642,7 +6642,7 @@ character.swd={
|
|||
if(target.name&&!target.isUnseen(0)) names.add(target.name);
|
||||
if(target.name1&&!target.isUnseen(0)) names.add(target.name1);
|
||||
if(target.name2&&!target.isUnseen(1)) names.add(target.name2);
|
||||
var pss=player.get('s');
|
||||
var pss=player.getSkills();
|
||||
for(var i=0;i<names.length;i++){
|
||||
var info=lib.character[names[i]];
|
||||
if(info){
|
||||
|
|
137
game/game.js
137
game/game.js
|
@ -8806,7 +8806,7 @@
|
|||
},
|
||||
chooseToUse:function(){
|
||||
"step 0"
|
||||
var skills=player.get('s',true);
|
||||
var skills=player.getSkills(true);
|
||||
game.expandSkills(skills);
|
||||
for(var i=0;i<skills.length;i++){
|
||||
var info=lib.skill[skills[i]];
|
||||
|
@ -10791,7 +10791,7 @@
|
|||
}
|
||||
"step 1"
|
||||
if(!event.skill){
|
||||
console.log('error: no skill',get.translation(event.player),event.player.get('s'));
|
||||
console.log('error: no skill',get.translation(event.player),event.player.getSkills());
|
||||
if(event._skill){
|
||||
event.skill=event._skill;
|
||||
console.log(event._skill);
|
||||
|
@ -12574,10 +12574,10 @@
|
|||
}
|
||||
else if(arg1=='s'){
|
||||
if(typeof arg2=='boolean'){
|
||||
return game.expandSkills(this.get('s',arg2).concat(lib.skill.global)).contains(arg3);
|
||||
return game.expandSkills(this.getSkills(arg2).concat(lib.skill.global)).contains(arg3);
|
||||
}
|
||||
else{
|
||||
return game.expandSkills(this.get('s').concat(lib.skill.global)).contains(arg2);
|
||||
return game.expandSkills(this.getSkills().concat(lib.skill.global)).contains(arg2);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -12720,6 +12720,48 @@
|
|||
countCards:function(arg1,arg2){
|
||||
return this.getCards(arg1,arg2).length;
|
||||
},
|
||||
getSkills:function(arg2,arg3,arg4){
|
||||
var skills=this.skills.slice(0);
|
||||
var es=[];
|
||||
var i,j;
|
||||
if(arg3!==false){
|
||||
for(i=0;i<this.node.equips.childElementCount;i++){
|
||||
if(!this.node.equips.childNodes[i].classList.contains('removing')){
|
||||
var equipskills=get.info(this.node.equips.childNodes[i]).skills;
|
||||
if(equipskills){
|
||||
es.addArray(equipskills);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(arg2=='e'){
|
||||
return es;
|
||||
}
|
||||
}
|
||||
for(var i in this.additionalSkills){
|
||||
if(Array.isArray(this.additionalSkills[i])){
|
||||
for(j=0;j<this.additionalSkills[i].length;j++){
|
||||
if(this.additionalSkills[i][j]){
|
||||
skills.add(this.additionalSkills[i][j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(this.additionalSkills[i]&&typeof this.additionalSkills[i]=='string'){
|
||||
skills.add(this.additionalSkills[i]);
|
||||
}
|
||||
}
|
||||
for(var i in this.tempSkills){
|
||||
skills.add(i);
|
||||
}
|
||||
if(arg2) skills.addArray(this.hiddenSkills);
|
||||
if(arg3!==false) skills.addArray(es);
|
||||
for(var i in this.forbiddenSkills){
|
||||
skills.remove(i);
|
||||
}
|
||||
if(arg4!==false){
|
||||
skills=game.filterSkills(skills,this);
|
||||
}
|
||||
return skills;
|
||||
},
|
||||
get:function(arg1,arg2,arg3,arg4){
|
||||
var i,j;
|
||||
if(arg1=='s'){
|
||||
|
@ -12727,10 +12769,11 @@
|
|||
var es=[];
|
||||
if(arg3!==false){
|
||||
for(i=0;i<this.node.equips.childElementCount;i++){
|
||||
if(this.node.equips.childNodes[i].classList.contains('removing')) continue;
|
||||
var equipskills=get.info(this.node.equips.childNodes[i]).skills;
|
||||
if(equipskills){
|
||||
es.addArray(equipskills);
|
||||
if(!this.node.equips.childNodes[i].classList.contains('removing')){
|
||||
var equipskills=get.info(this.node.equips.childNodes[i]).skills;
|
||||
if(equipskills){
|
||||
es.addArray(equipskills);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(arg2=='e'){
|
||||
|
@ -15048,7 +15091,7 @@
|
|||
return this;
|
||||
},
|
||||
checkMarks:function(){
|
||||
var skills=this.get('s');
|
||||
var skills=this.getSkills();
|
||||
game.expandSkills(skills);
|
||||
for(var i in this.marks){
|
||||
if(!skills.contains(i)&&!this.marks[i].info.fixed){
|
||||
|
@ -15295,7 +15338,7 @@
|
|||
return str.slice(0,str.length-1);
|
||||
}
|
||||
var forbidlist=lib.config.forbid.concat(lib.config.customforbid);
|
||||
var skills=this.get('s');
|
||||
var skills=this.getSkills();
|
||||
for(var i=0;i<forbidlist.length;i++){
|
||||
if(lib.config.customforbid.contains(forbidlist[i])||
|
||||
!lib.config.forbidlist.contains(getName(forbidlist[i]))){
|
||||
|
@ -15348,7 +15391,7 @@
|
|||
card=get.autoViewAs(card,null,player);
|
||||
var num=get.info(card).usable;
|
||||
if(typeof num=='function') num=num(card,player);
|
||||
num=game.checkMod(card,player,num,'cardUsable',player.get('s'));
|
||||
num=game.checkMod(card,player,num,'cardUsable',player.getSkills());
|
||||
if(typeof num!='number') return Infinity;
|
||||
if(_status.currentPhase==player){
|
||||
return num-get.cardCount(card,player);
|
||||
|
@ -15358,8 +15401,8 @@
|
|||
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'));
|
||||
range=game.checkMod(player,player,range,'globalFrom',player.getSkills());
|
||||
range=game.checkMod(player,player,range,'attackFrom',player.getSkills());
|
||||
var equips=player.getCards('e');
|
||||
for(var i=0;i<equips.length;i++){
|
||||
var info=get.info(equips[i]).distance;
|
||||
|
@ -15376,7 +15419,7 @@
|
|||
getGlobalFrom:function(){
|
||||
var player=this;
|
||||
var range=0;
|
||||
range=game.checkMod(player,player,range,'globalFrom',player.get('s'));
|
||||
range=game.checkMod(player,player,range,'globalFrom',player.getSkills());
|
||||
var equips=player.getCards('e');
|
||||
for(var i=0;i<equips.length;i++){
|
||||
var info=get.info(equips[i]).distance;
|
||||
|
@ -15390,7 +15433,7 @@
|
|||
getGlobalTo:function(){
|
||||
var player=this;
|
||||
var range=0;
|
||||
range=game.checkMod(player,player,range,'globalTo',player.get('s'));
|
||||
range=game.checkMod(player,player,range,'globalTo',player.getSkills());
|
||||
var equips=player.getCards('e');
|
||||
for(var i=0;i<equips.length;i++){
|
||||
var info=get.info(equips[i]).distance;
|
||||
|
@ -15402,7 +15445,7 @@
|
|||
return (range);
|
||||
},
|
||||
getHandcardLimit:function(){
|
||||
return Math.max(0,game.checkMod(this,this.hp,'maxHandcard',this.get('s')));
|
||||
return Math.max(0,game.checkMod(this,this.hp,'maxHandcard',this.getSkills()));
|
||||
},
|
||||
getEnemies:function(func){
|
||||
var player=this;
|
||||
|
@ -15613,7 +15656,7 @@
|
|||
return get.distance(target,this,method);
|
||||
},
|
||||
hasSkill:function(skill){
|
||||
return game.expandSkills(this.get('s')).contains(skill);
|
||||
return game.expandSkills(this.getSkills()).contains(skill);
|
||||
},
|
||||
hasZhuSkill:function(skill,player){
|
||||
if(!this.hasSkill(skill)) return false;
|
||||
|
@ -15648,7 +15691,7 @@
|
|||
return false;
|
||||
},
|
||||
hasSkillTag:function(tag,hidden,arg,globalskill){
|
||||
var skills=this.get('s',hidden);
|
||||
var skills=this.getSkills(hidden);
|
||||
if(globalskill){
|
||||
skills.addArray(lib.skill.global);
|
||||
}
|
||||
|
@ -15714,7 +15757,7 @@
|
|||
},
|
||||
hasWuxie:function(){
|
||||
if(this.countCards('h','wuxie')) return true;
|
||||
var skills=this.get('s',true).concat(lib.skill.global);
|
||||
var skills=this.getSkills(true).concat(lib.skill.global);
|
||||
game.expandSkills(skills);
|
||||
for(var i=0;i<skills.length;i++){
|
||||
var ifo=get.info(skills[i]);
|
||||
|
@ -17657,7 +17700,7 @@
|
|||
}
|
||||
if(lib.config.compatiblemode){
|
||||
(function(){
|
||||
var skills=player.get('s',true).concat(lib.skill.global);
|
||||
var skills=player.getSkills(true).concat(lib.skill.global);
|
||||
game.expandSkills(skills);
|
||||
for(var i=0;i<skills.length;i++){
|
||||
var trigger=get.info(skills[i]).trigger;
|
||||
|
@ -18156,7 +18199,7 @@
|
|||
if(player==undefined) player=_status.event.player;
|
||||
var filter=get.info(card).enable;
|
||||
if(!filter) return;
|
||||
var mod=game.checkMod(card,player,'unchanged','cardEnabled',player.get('s'));
|
||||
var mod=game.checkMod(card,player,'unchanged','cardEnabled',player.getSkills());
|
||||
if(mod!='unchanged') return mod;
|
||||
if(typeof filter=='boolean') return filter;
|
||||
if(typeof filter=='function') return filter(card,player);
|
||||
|
@ -18164,7 +18207,7 @@
|
|||
cardRespondable:function(card,player){
|
||||
if(_status.event.name!='chooseToRespond') return true;
|
||||
if(player==undefined) player=_status.event.player;
|
||||
var mod=game.checkMod(card,player,'unchanged','cardRespondable',player.get('s'));
|
||||
var mod=game.checkMod(card,player,'unchanged','cardRespondable',player.getSkills());
|
||||
if(mod!='unchanged') return mod;
|
||||
return true;
|
||||
},
|
||||
|
@ -18176,13 +18219,13 @@
|
|||
if(event.getParent().player!=player) return true;
|
||||
var num=get.info(card).usable;
|
||||
if(typeof num=='function') num=num(card,player);
|
||||
num=game.checkMod(card,player,num,'cardUsable',player.get('s'));
|
||||
num=game.checkMod(card,player,num,'cardUsable',player.getSkills());
|
||||
if(typeof num!='number') return true;
|
||||
else return(get.cardCount(card,player)<num);
|
||||
},
|
||||
cardDiscardable:function(card,player,event){
|
||||
event=event||_status.event;
|
||||
var mod=game.checkMod(card,player,event.getParent().name,'unchanged','cardDiscardable',player.get('s'));
|
||||
var mod=game.checkMod(card,player,event.getParent().name,'unchanged','cardDiscardable',player.getSkills());
|
||||
if(mod!='unchanged') return mod;
|
||||
return true;
|
||||
},
|
||||
|
@ -18198,10 +18241,10 @@
|
|||
if(card==undefined) return false;
|
||||
var info=get.info(card);
|
||||
var filter=info.filterTarget;
|
||||
var mod=game.checkMod(card,player,target,'unchanged','playerEnabled',player.get('s'));
|
||||
var mod=game.checkMod(card,player,target,'unchanged','playerEnabled',player.getSkills());
|
||||
if(mod==false) return false;
|
||||
if(!info.singleCard||ui.selected.targets.length==0){
|
||||
var mod=game.checkMod(card,player,target,'unchanged','targetEnabled',target.get('s'));
|
||||
var mod=game.checkMod(card,player,target,'unchanged','targetEnabled',target.getSkills());
|
||||
if(mod!='unchanged') return mod;
|
||||
}
|
||||
if(typeof filter=='boolean') return filter;
|
||||
|
@ -18216,7 +18259,7 @@
|
|||
return false;
|
||||
},
|
||||
targetInRange:function(card,player,target){
|
||||
var mod=game.checkMod(card,player,target,'unchanged','targetInRange',player.get('s'));
|
||||
var mod=game.checkMod(card,player,target,'unchanged','targetInRange',player.getSkills());
|
||||
var extra=0;
|
||||
if(mod!='unchanged'){
|
||||
if(typeof mod=='boolean') return mod;
|
||||
|
@ -18260,7 +18303,7 @@
|
|||
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.get('s'));
|
||||
game.checkMod(card,player,range,'selectTarget',player.getSkills());
|
||||
return range;
|
||||
},
|
||||
judge:function(card,player,target){
|
||||
|
@ -18403,7 +18446,7 @@
|
|||
},
|
||||
fengyin:{
|
||||
init:function(player,skill){
|
||||
var skills=player.get('s',true,false);
|
||||
var skills=player.getSkills(true,false);
|
||||
for(var i=0;i<skills.length;i++){
|
||||
if(get.is.locked(skills[i])){
|
||||
skills.splice(i--,1);
|
||||
|
@ -18648,7 +18691,7 @@
|
|||
player.chooseToUse({
|
||||
filterCard:function(card,player,event){
|
||||
event=event||_status.event;
|
||||
var mod=game.checkMod(card,player,'unchanged','cardSavable',player.get('s'));
|
||||
var mod=game.checkMod(card,player,'unchanged','cardSavable',player.getSkills());
|
||||
if(mod!='unchanged') return mod;
|
||||
var savable=get.info(card).savable;
|
||||
if(typeof savable=='function') savable=savable(card,player,event.dying);
|
||||
|
@ -23612,10 +23655,10 @@
|
|||
else{
|
||||
var skills2;
|
||||
if(get.mode()=='guozhan'&&player.hasSkillTag('nomingzhi',false,null,true)){
|
||||
skills2=player.get('s',false,true,false);
|
||||
skills2=player.getSkills(false,true,false);
|
||||
}
|
||||
else{
|
||||
skills2=player.get('s',true,true,false);
|
||||
skills2=player.getSkills(true,true,false);
|
||||
}
|
||||
skills2=game.filterSkills(skills2.concat(lib.skill.global),player);
|
||||
event._skillChoice=[];
|
||||
|
@ -23652,7 +23695,7 @@
|
|||
}
|
||||
}
|
||||
var equipskills=[];
|
||||
var ownedskills=player.get('s',true,false);
|
||||
var ownedskills=player.getSkills(true,false);
|
||||
game.expandSkills(ownedskills);
|
||||
for(var i=0;i<skills.length;i++){
|
||||
if(!ownedskills.contains(skills[i])){
|
||||
|
@ -34879,7 +34922,7 @@
|
|||
// if(game.players){
|
||||
// for(var i=0;i<game.players.length;i++){
|
||||
// if(game.players[i]==game.me||game.players[i].isUnderControl()){
|
||||
// sks=sks.concat(game.expandSkills(game.players[i].get('s')));
|
||||
// sks=sks.concat(game.expandSkills(game.players[i].getSkills()));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
@ -38263,13 +38306,13 @@
|
|||
}
|
||||
var mode=get.mode();
|
||||
if(mode=='identity'){
|
||||
if(skill&&!game.zhu.get('s').contains(skill)) return null;
|
||||
if(skill&&!game.zhu.getSkills().contains(skill)) return null;
|
||||
if(game.zhu.isZhu) return game.zhu;
|
||||
}
|
||||
else if(mode=='versus'&&_status.mode=='four'){
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
if(game.players[i].isZhu){
|
||||
if(skill&&!(game.players[i].get('s').contains(skill))) continue;
|
||||
if(skill&&!(game.players[i].getSkills().contains(skill))) continue;
|
||||
if(!player) return game.players[i];
|
||||
if(player.side==game.players[i].side){
|
||||
return game.players[i];
|
||||
|
@ -38280,7 +38323,7 @@
|
|||
else if(mode=='guozhan'){
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
if(get.is.jun(game.players[i])&&!game.players[i].isUnseen()){
|
||||
if(skill&&!game.players[i].get('s').contains(skill)) continue;
|
||||
if(skill&&!game.players[i].getSkills().contains(skill)) continue;
|
||||
if(!player) return game.players[i];
|
||||
if(player.identity==game.players[i].identity){
|
||||
return game.players[i];
|
||||
|
@ -38699,7 +38742,7 @@
|
|||
}
|
||||
else{
|
||||
if(get.owner(card)){
|
||||
return game.checkMod(card,card.suit,'suit',get.owner(card).get('s'));
|
||||
return game.checkMod(card,card.suit,'suit',get.owner(card).getSkills());
|
||||
}
|
||||
return card.suit;
|
||||
}
|
||||
|
@ -38814,11 +38857,11 @@
|
|||
if(method=='raw'||method=='pure') return n;
|
||||
}
|
||||
|
||||
n=game.checkMod(from,to,n,'globalFrom',from.get('s'));
|
||||
n=game.checkMod(from,to,n,'globalTo',to.get('s'));
|
||||
n=game.checkMod(from,to,n,'globalFrom',from.getSkills());
|
||||
n=game.checkMod(from,to,n,'globalTo',to.getSkills());
|
||||
m=n;
|
||||
m=game.checkMod(from,to,m,'attackFrom',from.get('s'));
|
||||
m=game.checkMod(from,to,m,'attackTo',to.get('s'));
|
||||
m=game.checkMod(from,to,m,'attackFrom',from.getSkills());
|
||||
m=game.checkMod(from,to,m,'attackTo',to.getSkills());
|
||||
var equips1=from.getCards('e'),equips2=to.getCards('e');
|
||||
for(i=0;i<equips1.length;i++){
|
||||
var info=get.info(equips1[i]).distance;
|
||||
|
@ -39476,7 +39519,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
var skills=node.get('s',false,false);
|
||||
var skills=node.getSkills(false,false);
|
||||
skills=skills.slice(0);
|
||||
var skills2=game.filterSkills(skills,node);
|
||||
if(node==game.me&&node.hiddenSkills.length){
|
||||
|
@ -39529,7 +39572,7 @@
|
|||
for(i in storage){
|
||||
if(get.info(i)&&get.info(i).intro){
|
||||
intro=get.info(i).intro;
|
||||
if(node.get('s').concat(lib.skill.global).contains(i)==false&&!intro.show) continue;
|
||||
if(node.getSkills().concat(lib.skill.global).contains(i)==false&&!intro.show) continue;
|
||||
var name=intro.name?intro.name:get.translation(i);
|
||||
if(typeof name=='function'){
|
||||
name=name(storage[i],node);
|
||||
|
@ -40370,7 +40413,7 @@
|
|||
get:{
|
||||
threaten:function(target,player){
|
||||
var threaten=1;
|
||||
var skills=target.get('s');
|
||||
var skills=target.getSkills();
|
||||
for(var i=0;i<skills.length;i++){
|
||||
var info=get.info(skills[i]);
|
||||
if(info&&info.ai&&info.ai.threaten){
|
||||
|
@ -40544,7 +40587,7 @@
|
|||
if(typeof result1!='number') result1=0;
|
||||
if(typeof result2!='number') result2=0;
|
||||
var temp1,temp2,temp3,temp01=0,temp02=0,threaten=1;
|
||||
var skills1=player.get('s').concat(lib.skill.global);
|
||||
var skills1=player.getSkills().concat(lib.skill.global);
|
||||
game.expandSkills(skills1);
|
||||
var zerotarget=false,zeroplayer=false;
|
||||
for(var i=0;i<skills1.length;i++){
|
||||
|
@ -40578,7 +40621,7 @@
|
|||
}
|
||||
}
|
||||
if(target){
|
||||
var skills2=target.get('s').concat(lib.skill.global);
|
||||
var skills2=target.getSkills().concat(lib.skill.global);
|
||||
game.expandSkills(skills2);
|
||||
for(var i=0;i<skills2.length;i++){
|
||||
temp2=get.info(skills2[i]).ai;
|
||||
|
|
|
@ -895,7 +895,7 @@ mode.boss={
|
|||
var targets=player.getEnemies();
|
||||
var stop=false;
|
||||
for(var i=0;i<targets.length;i++){
|
||||
var skills=targets[i].get('s');
|
||||
var skills=targets[i].getSkills();
|
||||
for(var j=0;j<skills.length;j++){
|
||||
if(get.tag(skills[j],'rejudge',targets[i])){
|
||||
stop=true;break;
|
||||
|
|
|
@ -4988,13 +4988,13 @@ mode.chess={
|
|||
return false;
|
||||
}
|
||||
var move=2;
|
||||
move=game.checkMod(player,move,'chessMove',player.get('s'));
|
||||
move=game.checkMod(player,move,'chessMove',player.getSkills());
|
||||
return move>0;
|
||||
},
|
||||
content:function(){
|
||||
"step 0"
|
||||
var move=2;
|
||||
move=game.checkMod(player,move,'chessMove',player.get('s'));
|
||||
move=game.checkMod(player,move,'chessMove',player.getSkills());
|
||||
player.chooseToMove(move).phasing=true;
|
||||
"step 1"
|
||||
if(ui.confirm){
|
||||
|
|
|
@ -1431,7 +1431,7 @@ mode.guozhan={
|
|||
}
|
||||
var players=game.filterPlayer();
|
||||
for(var i=0;i<players.length;i++){
|
||||
if(players[i].get('s').contains('haoshi')&&
|
||||
if(players[i].getSkills().contains('haoshi')&&
|
||||
!players[i].isTurnedOver()&&
|
||||
!players[i].hasJudge('lebu')&&
|
||||
ai.get.attitude(player,players[i])>=3&&
|
||||
|
@ -1474,7 +1474,7 @@ mode.guozhan={
|
|||
var nh=target.countCards('h');
|
||||
var np=player.countCards('h');
|
||||
if(player.hp==player.maxHp||player.storage.gzrende<0||player.countCards('h')+player.storage.gzrende<=2){
|
||||
if(nh>=np-1&&np<=player.hp&&!target.get('s').contains('haoshi')) return 0;
|
||||
if(nh>=np-1&&np<=player.hp&&!target.getSkills().contains('haoshi')) return 0;
|
||||
}
|
||||
return Math.max(1,5-nh);
|
||||
}
|
||||
|
@ -1848,7 +1848,7 @@ mode.guozhan={
|
|||
}
|
||||
}
|
||||
if(config.inline||config.siege){
|
||||
var skills=player.get('s');
|
||||
var skills=player.getSkills();
|
||||
for(var i=0;i<skills.length;i++){
|
||||
var info=get.info(skills[i]).zhenfa;
|
||||
if(info&&config[info]){
|
||||
|
@ -3129,7 +3129,7 @@ mode.guozhan={
|
|||
if(sourceSkill&&sourceSkill.sourceSkill){
|
||||
skill=sourceSkill.sourceSkill;
|
||||
}
|
||||
if(game.expandSkills(this.get('s')).contains(skill)) return false;
|
||||
if(game.expandSkills(this.getSkills()).contains(skill)) return false;
|
||||
if(lib.skill.global.contains(skill)) return false;
|
||||
if(this.isUnseen(0)){
|
||||
var skills=game.expandSkills(lib.character[this.name1][3].slice(0));
|
||||
|
|
Loading…
Reference in New Issue