This commit is contained in:
libccy 2017-03-28 12:05:02 +08:00
parent bb0a4b59d3
commit 34c52f2bd0
15 changed files with 131 additions and 88 deletions

View File

@ -1544,7 +1544,7 @@ card.gujian={
content:function(){ content:function(){
player.chooseToUse(get.prompt('shihuifen',trigger.player).replace(/发动/,'使用'),function(card,player){ player.chooseToUse(get.prompt('shihuifen',trigger.player).replace(/发动/,'使用'),function(card,player){
if(card.name!='shihuifen') return false; 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; if(mod!='unchanged') return mod;
return true; return true;
},trigger.player,-1).targetRequired=true; },trigger.player,-1).targetRequired=true;
@ -1560,7 +1560,7 @@ card.gujian={
content:function(){ content:function(){
player.chooseToUse(get.prompt('jinlianzhu',trigger.player).replace(/发动/,'使用'),function(card,player){ player.chooseToUse(get.prompt('jinlianzhu',trigger.player).replace(/发动/,'使用'),function(card,player){
if(card.name!='jinlianzhu') return false; 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; if(mod!='unchanged') return mod;
return true; return true;
},trigger.player,-1).targetRequired=true; },trigger.player,-1).targetRequired=true;

View File

@ -81,7 +81,7 @@ card.standard={
next.set('ai',function(){ next.set('ai',function(){
var target=_status.event.player; var target=_status.event.player;
var evt=_status.event.getParent(); var evt=_status.event.getParent();
var sks=target.get('s'); var sks=target.getSkills();
if(sks.contains('leiji')|| if(sks.contains('leiji')||
sks.contains('releiji')|| sks.contains('releiji')||
sks.contains('lingbo')){ sks.contains('lingbo')){
@ -1225,7 +1225,7 @@ card.standard={
result:{ result:{
target:function(player,target){ target:function(player,target){
var num=game.countPlayer(function(current){ var num=game.countPlayer(function(current){
var skills=current.get('s'); var skills=current.getSkills();
for(var j=0;j<current.skills.length;j++){ for(var j=0;j<current.skills.length;j++){
var rejudge=get.tag(current.skills[j],'rejudge',current); var rejudge=get.tag(current.skills[j],'rejudge',current);
if(rejudge!=undefined){ if(rejudge!=undefined){
@ -1590,7 +1590,7 @@ card.standard={
event.tempnowuxie=(trigger.targets&&trigger.targets.length>1&&!trigger.multitarget); event.tempnowuxie=(trigger.targets&&trigger.targets.length>1&&!trigger.multitarget);
event.filterCard=function(card,player){ event.filterCard=function(card,player){
if(card.name!='wuxie') return false; 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; if(mod!='unchanged') return mod;
return true; return true;
}; };
@ -1625,7 +1625,7 @@ card.standard={
var next=player.chooseToUse({ var next=player.chooseToUse({
filterCard:function(card,player){ filterCard:function(card,player){
if(card.name!='wuxie') return false; 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; if(mod!='unchanged') return mod;
return true; return true;
}, },

View File

@ -2059,7 +2059,7 @@ card.swd={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filter:function(event,player){ filter:function(event,player){
var skills=player.get('s'); var skills=player.getSkills();
for(var i=0;i<skills.length;i++){ for(var i=0;i<skills.length;i++){
if(skills[i].indexOf('yuchan')==0&&skills[i].indexOf('_equip')!=-1){ if(skills[i].indexOf('yuchan')==0&&skills[i].indexOf('_equip')!=-1){
return player.countCards('h',{type:'basic'})>0; return player.countCards('h',{type:'basic'})>0;
@ -2160,7 +2160,7 @@ card.swd={
content:function(){ content:function(){
player.chooseToUse(get.prompt('shencaojie',trigger.player).replace(/发动/,'使用'),function(card,player){ player.chooseToUse(get.prompt('shencaojie',trigger.player).replace(/发动/,'使用'),function(card,player){
if(card.name!='shencaojie') return false; 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; if(mod!='unchanged') return mod;
return true; return true;
},trigger.player,-1).targetRequired=true; },trigger.player,-1).targetRequired=true;
@ -2199,7 +2199,7 @@ card.swd={
player.storage.shenmiguo=[card,(trigger._targets||trigger.targets).slice(0)]; player.storage.shenmiguo=[card,(trigger._targets||trigger.targets).slice(0)];
player.chooseToUse('是否使用神秘果?',function(card,player){ player.chooseToUse('是否使用神秘果?',function(card,player){
if(card.name!='shenmiguo'&&card.name!='yuchankan') return false; 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; if(mod!='unchanged') return mod;
return true; return true;
},trigger.player,-1).set('cardname',trigger.card.name).targetRequired=true; },trigger.player,-1).set('cardname',trigger.card.name).targetRequired=true;

View File

@ -1054,7 +1054,7 @@ card.yunchou={
content:function(){ content:function(){
player.chooseToUse(get.prompt('chenhuodajie',trigger.player).replace(/发动/,'使用'),function(card,player){ player.chooseToUse(get.prompt('chenhuodajie',trigger.player).replace(/发动/,'使用'),function(card,player){
if(card.name!='chenhuodajie') return false; 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; if(mod!='unchanged') return mod;
return true; return true;
},trigger.player,-1).targetRequired=true; },trigger.player,-1).targetRequired=true;

View File

@ -532,7 +532,7 @@ character.hearth={
}).ai=function(target){ }).ai=function(target){
var att=ai.get.attitude(player,target); var att=ai.get.attitude(player,target);
if(att>=0) return 0; if(att>=0) return 0;
var skills=target.get('s'); var skills=target.getSkills();
for(var i=0;i<skills.length;i++){ for(var i=0;i<skills.length;i++){
if(!get.is.locked(skills[i])){ if(!get.is.locked(skills[i])){
if(target.hasSkillTag('maixie')) return 2; if(target.hasSkillTag('maixie')) return 2;
@ -713,7 +713,7 @@ character.hearth={
silent:true, silent:true,
content:function(){ content:function(){
var list=['yushou_misha','yushou_huofu','yushou_leiouke']; 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++){ for(var i=0;i<list.length;i++){
if(!skills.contains(list[i])) list.splice(i--,1); if(!skills.contains(list[i])) list.splice(i--,1);
} }

View File

@ -463,11 +463,11 @@ character.ow={
var position=get.is.altered('pingzhang')?'h':'he'; var position=get.is.altered('pingzhang')?'h':'he';
if(event.player==player){ if(event.player==player){
if(player.hasSkill('pingzhang2')) return false; if(player.hasSkill('pingzhang2')) return false;
return player.num(position,{suit:'heart'}); return player.countCards(position,{suit:'heart'});
} }
else{ else{
if(player.hasSkill('pingzhang3')) return false; if(player.hasSkill('pingzhang3')) return false;
return player.num(position,{suit:'spade'}); return player.countCards(position,{suit:'spade'});
} }
}, },
direct:true, direct:true,

View File

@ -51,7 +51,7 @@ character.refresh={
if(player.hp==player.maxHp||player.storage.rerende<0||player.countCards('h')<=1){ if(player.hp==player.maxHp||player.storage.rerende<0||player.countCards('h')<=1){
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ 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].isTurnedOver()&&
!players[i].hasJudge('lebu')&& !players[i].hasJudge('lebu')&&
ai.get.attitude(player,players[i])>=3&& ai.get.attitude(player,players[i])>=3&&
@ -174,7 +174,7 @@ character.refresh={
var nh=target.countCards('h'); var nh=target.countCards('h');
var np=player.countCards('h'); var np=player.countCards('h');
if(player.hp==player.maxHp||player.storage.rerende<0||player.countCards('h')<=1){ 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); return Math.max(1,5-nh);
} }
@ -1245,7 +1245,7 @@ character.refresh={
"step 0" "step 0"
player.chooseControl(['red','black','basic','trick','equip']).set('ai',function(){ player.chooseControl(['red','black','basic','trick','equip']).set('ai',function(){
var player=_status.event.player; 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('e')<=1) return 'equip';
if(player.countCards('h')>2) return 'trick'; if(player.countCards('h')>2) return 'trick';
return 'red'; return 'red';

View File

@ -2579,7 +2579,7 @@ character.shenhua={
mod:{ mod:{
cardSavable:function(card,player){ cardSavable:function(card,player){
if(!_status.currentPhase) return; 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; if(card.name=='tao'&&_status.event.dying!=player) return false;
} }
} }
@ -4043,7 +4043,7 @@ character.shenhua={
check:function(button){ check:function(button){
var player=_status.event.player; var player=_status.event.player;
if(player.countCards('h','wuzhong')){ 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=='tao'?1:0;
} }
return button.link=='wuzhong'?1:0; return button.link=='wuzhong'?1:0;

View File

@ -268,7 +268,7 @@ character.sp={
else{ else{
var info=lib.character[event.player.name]; var info=lib.character[event.player.name];
if(!info) return false; if(!info) return false;
var skills=event.player.get('s'); var skills=event.player.getSkills();
for(var i=0;i<info[3].length;i++){ for(var i=0;i<info[3].length;i++){
if(skills.contains(info[3][i])) return true; if(skills.contains(info[3][i])) return true;
} }
@ -302,7 +302,7 @@ character.sp={
if(result.index==1){ if(result.index==1){
if(get.mode()!='guozhan'){ if(get.mode()!='guozhan'){
var info=lib.character[trigger.player.name]; var info=lib.character[trigger.player.name];
var skills=trigger.player.get('s'); var skills=trigger.player.getSkills();
var list=[]; var list=[];
for(var i=0;i<info[3].length;i++){ for(var i=0;i<info[3].length;i++){
if(skills.contains(info[3][i])){ if(skills.contains(info[3][i])){
@ -4786,7 +4786,7 @@ character.sp={
}, },
content:function(){ content:function(){
player.storage.mozhi.add(trigger.card); player.storage.mozhi.add(trigger.card);
if(player.get('s').contains('mozhi')) player.markSkill('mozhi'); if(player.getSkills().contains('mozhi')) player.markSkill('mozhi');
} }
}, },
chenqing2:{}, chenqing2:{},
@ -5760,7 +5760,7 @@ character.sp={
game.log(player,'的判定牌改为',player.storage.zhoufu2); game.log(player,'的判定牌改为',player.storage.zhoufu2);
game.delay(2); game.delay(2);
"step 1" "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.logSkill('yingbin');
player.storage.zhoufu3.draw(2); player.storage.zhoufu3.draw(2);
} }
@ -8034,8 +8034,8 @@ character.sp={
mod:{ mod:{
targetEnabled:function(card,player,target){ targetEnabled:function(card,player,target){
if(card.name!='sha') return; if(card.name!='sha') return;
if(player==_status.currentPhase&&player.get('s').contains('chixin')){ if(player==_status.currentPhase&&player.getSkills().contains('chixin')){
var num=game.checkMod(card,player,1,'cardUsable',player.get('s'))-20; var num=game.checkMod(card,player,1,'cardUsable',player.getSkills())-20;
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i].hasSkill('chixin3')){ if(players[i].hasSkill('chixin3')){

View File

@ -504,7 +504,7 @@ character.standard={
} }
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ 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].isTurnedOver()&&
!players[i].hasJudge('lebu')&& !players[i].hasJudge('lebu')&&
ai.get.attitude(player,players[i])>=3&& ai.get.attitude(player,players[i])>=3&&
@ -548,7 +548,7 @@ character.standard={
var nh=target.countCards('h'); var nh=target.countCards('h');
var np=player.countCards('h'); var np=player.countCards('h');
if(player.hp==player.maxHp||player.storage.rende<0||player.countCards('h')<=1){ 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); return Math.max(1,5-nh);
} }

View File

@ -2975,7 +2975,7 @@ character.swd={
order:11, order:11,
result:{ result:{
target:function(player,target){ target:function(player,target){
var skills=target.get('s'); var skills=target.getSkills();
for(var i=0;i<skills.length;i++){ for(var i=0;i<skills.length;i++){
if(!get.is.locked(skills[i])){ if(!get.is.locked(skills[i])){
if(target.hasSkillTag('maixie')) return -2; if(target.hasSkillTag('maixie')) return -2;
@ -5659,10 +5659,10 @@ character.swd={
} }
player.chooseButton(dialog,function(button){ player.chooseButton(dialog,function(button){
var player=get.owner(button.link); 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); 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 11-ai.get.attitude(_status.event.player,player);
} }
return 5-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.name&&!target.isUnseen(0)) names.add(target.name);
// if(target.name1&&!target.isUnseen(0)) names.add(target.name1); // if(target.name1&&!target.isUnseen(0)) names.add(target.name1);
// if(target.name2&&!target.isUnseen(1)) names.add(target.name2); // 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++){ // for(var i=0;i<names.length;i++){
// var info=lib.character[names[i]]; // var info=lib.character[names[i]];
// if(info){ // if(info){
@ -6496,7 +6496,7 @@ character.swd={
if(target.name&&!target.isUnseen(0)) names.add(target.name); if(target.name&&!target.isUnseen(0)) names.add(target.name);
if(target.name1&&!target.isUnseen(0)) names.add(target.name1); if(target.name1&&!target.isUnseen(0)) names.add(target.name1);
if(target.name2&&!target.isUnseen(1)) names.add(target.name2); 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++){ for(var i=0;i<names.length;i++){
var info=lib.character[names[i]]; var info=lib.character[names[i]];
if(info){ if(info){
@ -6518,7 +6518,7 @@ character.swd={
if(target.name&&!target.isUnseen(0)) names.add(target.name); if(target.name&&!target.isUnseen(0)) names.add(target.name);
if(target.name1&&!target.isUnseen(0)) names.add(target.name1); if(target.name1&&!target.isUnseen(0)) names.add(target.name1);
if(target.name2&&!target.isUnseen(1)) names.add(target.name2); 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++){ for(var i=0;i<names.length;i++){
var info=lib.character[names[i]]; var info=lib.character[names[i]];
if(info){ if(info){
@ -6642,7 +6642,7 @@ character.swd={
if(target.name&&!target.isUnseen(0)) names.add(target.name); if(target.name&&!target.isUnseen(0)) names.add(target.name);
if(target.name1&&!target.isUnseen(0)) names.add(target.name1); if(target.name1&&!target.isUnseen(0)) names.add(target.name1);
if(target.name2&&!target.isUnseen(1)) names.add(target.name2); 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++){ for(var i=0;i<names.length;i++){
var info=lib.character[names[i]]; var info=lib.character[names[i]];
if(info){ if(info){

View File

@ -8806,7 +8806,7 @@
}, },
chooseToUse:function(){ chooseToUse:function(){
"step 0" "step 0"
var skills=player.get('s',true); var skills=player.getSkills(true);
game.expandSkills(skills); game.expandSkills(skills);
for(var i=0;i<skills.length;i++){ for(var i=0;i<skills.length;i++){
var info=lib.skill[skills[i]]; var info=lib.skill[skills[i]];
@ -10791,7 +10791,7 @@
} }
"step 1" "step 1"
if(!event.skill){ 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){ if(event._skill){
event.skill=event._skill; event.skill=event._skill;
console.log(event._skill); console.log(event._skill);
@ -12574,10 +12574,10 @@
} }
else if(arg1=='s'){ else if(arg1=='s'){
if(typeof arg2=='boolean'){ 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{ 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){ countCards:function(arg1,arg2){
return this.getCards(arg1,arg2).length; 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){ get:function(arg1,arg2,arg3,arg4){
var i,j; var i,j;
if(arg1=='s'){ if(arg1=='s'){
@ -12727,10 +12769,11 @@
var es=[]; var es=[];
if(arg3!==false){ if(arg3!==false){
for(i=0;i<this.node.equips.childElementCount;i++){ for(i=0;i<this.node.equips.childElementCount;i++){
if(this.node.equips.childNodes[i].classList.contains('removing')) continue; if(!this.node.equips.childNodes[i].classList.contains('removing')){
var equipskills=get.info(this.node.equips.childNodes[i]).skills; var equipskills=get.info(this.node.equips.childNodes[i]).skills;
if(equipskills){ if(equipskills){
es.addArray(equipskills); es.addArray(equipskills);
}
} }
} }
if(arg2=='e'){ if(arg2=='e'){
@ -15048,7 +15091,7 @@
return this; return this;
}, },
checkMarks:function(){ checkMarks:function(){
var skills=this.get('s'); var skills=this.getSkills();
game.expandSkills(skills); game.expandSkills(skills);
for(var i in this.marks){ for(var i in this.marks){
if(!skills.contains(i)&&!this.marks[i].info.fixed){ if(!skills.contains(i)&&!this.marks[i].info.fixed){
@ -15295,7 +15338,7 @@
return str.slice(0,str.length-1); return str.slice(0,str.length-1);
} }
var forbidlist=lib.config.forbid.concat(lib.config.customforbid); 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++){ for(var i=0;i<forbidlist.length;i++){
if(lib.config.customforbid.contains(forbidlist[i])|| if(lib.config.customforbid.contains(forbidlist[i])||
!lib.config.forbidlist.contains(getName(forbidlist[i]))){ !lib.config.forbidlist.contains(getName(forbidlist[i]))){
@ -15348,7 +15391,7 @@
card=get.autoViewAs(card,null,player); card=get.autoViewAs(card,null,player);
var num=get.info(card).usable; var num=get.info(card).usable;
if(typeof num=='function') num=num(card,player); 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(typeof num!='number') return Infinity;
if(_status.currentPhase==player){ if(_status.currentPhase==player){
return num-get.cardCount(card,player); return num-get.cardCount(card,player);
@ -15358,8 +15401,8 @@
getAttackRange:function(){ getAttackRange:function(){
var player=this; var player=this;
var range=0; var range=0;
range=game.checkMod(player,player,range,'globalFrom',player.get('s')); range=game.checkMod(player,player,range,'globalFrom',player.getSkills());
range=game.checkMod(player,player,range,'attackFrom',player.get('s')); range=game.checkMod(player,player,range,'attackFrom',player.getSkills());
var equips=player.getCards('e'); var equips=player.getCards('e');
for(var i=0;i<equips.length;i++){ for(var i=0;i<equips.length;i++){
var info=get.info(equips[i]).distance; var info=get.info(equips[i]).distance;
@ -15376,7 +15419,7 @@
getGlobalFrom:function(){ getGlobalFrom:function(){
var player=this; var player=this;
var range=0; 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'); var equips=player.getCards('e');
for(var i=0;i<equips.length;i++){ for(var i=0;i<equips.length;i++){
var info=get.info(equips[i]).distance; var info=get.info(equips[i]).distance;
@ -15390,7 +15433,7 @@
getGlobalTo:function(){ getGlobalTo:function(){
var player=this; var player=this;
var range=0; 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'); var equips=player.getCards('e');
for(var i=0;i<equips.length;i++){ for(var i=0;i<equips.length;i++){
var info=get.info(equips[i]).distance; var info=get.info(equips[i]).distance;
@ -15402,7 +15445,7 @@
return (range); return (range);
}, },
getHandcardLimit:function(){ 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){ getEnemies:function(func){
var player=this; var player=this;
@ -15613,7 +15656,7 @@
return get.distance(target,this,method); return get.distance(target,this,method);
}, },
hasSkill:function(skill){ hasSkill:function(skill){
return game.expandSkills(this.get('s')).contains(skill); return game.expandSkills(this.getSkills()).contains(skill);
}, },
hasZhuSkill:function(skill,player){ hasZhuSkill:function(skill,player){
if(!this.hasSkill(skill)) return false; if(!this.hasSkill(skill)) return false;
@ -15648,7 +15691,7 @@
return false; return false;
}, },
hasSkillTag:function(tag,hidden,arg,globalskill){ hasSkillTag:function(tag,hidden,arg,globalskill){
var skills=this.get('s',hidden); var skills=this.getSkills(hidden);
if(globalskill){ if(globalskill){
skills.addArray(lib.skill.global); skills.addArray(lib.skill.global);
} }
@ -15714,7 +15757,7 @@
}, },
hasWuxie:function(){ hasWuxie:function(){
if(this.countCards('h','wuxie')) return true; 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); game.expandSkills(skills);
for(var i=0;i<skills.length;i++){ for(var i=0;i<skills.length;i++){
var ifo=get.info(skills[i]); var ifo=get.info(skills[i]);
@ -17657,7 +17700,7 @@
} }
if(lib.config.compatiblemode){ if(lib.config.compatiblemode){
(function(){ (function(){
var skills=player.get('s',true).concat(lib.skill.global); var skills=player.getSkills(true).concat(lib.skill.global);
game.expandSkills(skills); game.expandSkills(skills);
for(var i=0;i<skills.length;i++){ for(var i=0;i<skills.length;i++){
var trigger=get.info(skills[i]).trigger; var trigger=get.info(skills[i]).trigger;
@ -18156,7 +18199,7 @@
if(player==undefined) player=_status.event.player; if(player==undefined) player=_status.event.player;
var filter=get.info(card).enable; var filter=get.info(card).enable;
if(!filter) return; 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(mod!='unchanged') return mod;
if(typeof filter=='boolean') return filter; if(typeof filter=='boolean') return filter;
if(typeof filter=='function') return filter(card,player); if(typeof filter=='function') return filter(card,player);
@ -18164,7 +18207,7 @@
cardRespondable:function(card,player){ cardRespondable:function(card,player){
if(_status.event.name!='chooseToRespond') return true; if(_status.event.name!='chooseToRespond') return true;
if(player==undefined) player=_status.event.player; 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; if(mod!='unchanged') return mod;
return true; return true;
}, },
@ -18176,13 +18219,13 @@
if(event.getParent().player!=player) return true; if(event.getParent().player!=player) return true;
var num=get.info(card).usable; var num=get.info(card).usable;
if(typeof num=='function') num=num(card,player); 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; if(typeof num!='number') return true;
else return(get.cardCount(card,player)<num); else return(get.cardCount(card,player)<num);
}, },
cardDiscardable:function(card,player,event){ cardDiscardable:function(card,player,event){
event=event||_status.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; if(mod!='unchanged') return mod;
return true; return true;
}, },
@ -18198,10 +18241,10 @@
if(card==undefined) return false; if(card==undefined) return false;
var info=get.info(card); var info=get.info(card);
var filter=info.filterTarget; 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(mod==false) return false;
if(!info.singleCard||ui.selected.targets.length==0){ 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(mod!='unchanged') return mod;
} }
if(typeof filter=='boolean') return filter; if(typeof filter=='boolean') return filter;
@ -18216,7 +18259,7 @@
return false; return false;
}, },
targetInRange:function(card,player,target){ 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; var extra=0;
if(mod!='unchanged'){ if(mod!='unchanged'){
if(typeof mod=='boolean') return mod; if(typeof mod=='boolean') return mod;
@ -18260,7 +18303,7 @@
else if(typeof select=='number') range=[select,select]; else if(typeof select=='number') range=[select,select];
else if(get.itemtype(select)=='select') range=select; else if(get.itemtype(select)=='select') range=select;
else if(typeof select=='function') range=select(card,player); 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; return range;
}, },
judge:function(card,player,target){ judge:function(card,player,target){
@ -18403,7 +18446,7 @@
}, },
fengyin:{ fengyin:{
init:function(player,skill){ 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++){ for(var i=0;i<skills.length;i++){
if(get.is.locked(skills[i])){ if(get.is.locked(skills[i])){
skills.splice(i--,1); skills.splice(i--,1);
@ -18648,7 +18691,7 @@
player.chooseToUse({ player.chooseToUse({
filterCard:function(card,player,event){ filterCard:function(card,player,event){
event=event||_status.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; if(mod!='unchanged') return mod;
var savable=get.info(card).savable; var savable=get.info(card).savable;
if(typeof savable=='function') savable=savable(card,player,event.dying); if(typeof savable=='function') savable=savable(card,player,event.dying);
@ -23612,10 +23655,10 @@
else{ else{
var skills2; var skills2;
if(get.mode()=='guozhan'&&player.hasSkillTag('nomingzhi',false,null,true)){ if(get.mode()=='guozhan'&&player.hasSkillTag('nomingzhi',false,null,true)){
skills2=player.get('s',false,true,false); skills2=player.getSkills(false,true,false);
} }
else{ else{
skills2=player.get('s',true,true,false); skills2=player.getSkills(true,true,false);
} }
skills2=game.filterSkills(skills2.concat(lib.skill.global),player); skills2=game.filterSkills(skills2.concat(lib.skill.global),player);
event._skillChoice=[]; event._skillChoice=[];
@ -23652,7 +23695,7 @@
} }
} }
var equipskills=[]; var equipskills=[];
var ownedskills=player.get('s',true,false); var ownedskills=player.getSkills(true,false);
game.expandSkills(ownedskills); game.expandSkills(ownedskills);
for(var i=0;i<skills.length;i++){ for(var i=0;i<skills.length;i++){
if(!ownedskills.contains(skills[i])){ if(!ownedskills.contains(skills[i])){
@ -34879,7 +34922,7 @@
// if(game.players){ // if(game.players){
// for(var i=0;i<game.players.length;i++){ // for(var i=0;i<game.players.length;i++){
// if(game.players[i]==game.me||game.players[i].isUnderControl()){ // 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(); var mode=get.mode();
if(mode=='identity'){ 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; if(game.zhu.isZhu) return game.zhu;
} }
else if(mode=='versus'&&_status.mode=='four'){ else if(mode=='versus'&&_status.mode=='four'){
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i].isZhu){ 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) return game.players[i];
if(player.side==game.players[i].side){ if(player.side==game.players[i].side){
return game.players[i]; return game.players[i];
@ -38280,7 +38323,7 @@
else if(mode=='guozhan'){ else if(mode=='guozhan'){
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(get.is.jun(game.players[i])&&!game.players[i].isUnseen()){ 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) return game.players[i];
if(player.identity==game.players[i].identity){ if(player.identity==game.players[i].identity){
return game.players[i]; return game.players[i];
@ -38699,7 +38742,7 @@
} }
else{ else{
if(get.owner(card)){ 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; return card.suit;
} }
@ -38814,11 +38857,11 @@
if(method=='raw'||method=='pure') return n; if(method=='raw'||method=='pure') return n;
} }
n=game.checkMod(from,to,n,'globalFrom',from.get('s')); n=game.checkMod(from,to,n,'globalFrom',from.getSkills());
n=game.checkMod(from,to,n,'globalTo',to.get('s')); n=game.checkMod(from,to,n,'globalTo',to.getSkills());
m=n; m=n;
m=game.checkMod(from,to,m,'attackFrom',from.get('s')); m=game.checkMod(from,to,m,'attackFrom',from.getSkills());
m=game.checkMod(from,to,m,'attackTo',to.get('s')); m=game.checkMod(from,to,m,'attackTo',to.getSkills());
var equips1=from.getCards('e'),equips2=to.getCards('e'); var equips1=from.getCards('e'),equips2=to.getCards('e');
for(i=0;i<equips1.length;i++){ for(i=0;i<equips1.length;i++){
var info=get.info(equips1[i]).distance; 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); skills=skills.slice(0);
var skills2=game.filterSkills(skills,node); var skills2=game.filterSkills(skills,node);
if(node==game.me&&node.hiddenSkills.length){ if(node==game.me&&node.hiddenSkills.length){
@ -39529,7 +39572,7 @@
for(i in storage){ for(i in storage){
if(get.info(i)&&get.info(i).intro){ if(get.info(i)&&get.info(i).intro){
intro=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); var name=intro.name?intro.name:get.translation(i);
if(typeof name=='function'){ if(typeof name=='function'){
name=name(storage[i],node); name=name(storage[i],node);
@ -40370,7 +40413,7 @@
get:{ get:{
threaten:function(target,player){ threaten:function(target,player){
var threaten=1; var threaten=1;
var skills=target.get('s'); var skills=target.getSkills();
for(var i=0;i<skills.length;i++){ for(var i=0;i<skills.length;i++){
var info=get.info(skills[i]); var info=get.info(skills[i]);
if(info&&info.ai&&info.ai.threaten){ if(info&&info.ai&&info.ai.threaten){
@ -40544,7 +40587,7 @@
if(typeof result1!='number') result1=0; if(typeof result1!='number') result1=0;
if(typeof result2!='number') result2=0; if(typeof result2!='number') result2=0;
var temp1,temp2,temp3,temp01=0,temp02=0,threaten=1; 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); game.expandSkills(skills1);
var zerotarget=false,zeroplayer=false; var zerotarget=false,zeroplayer=false;
for(var i=0;i<skills1.length;i++){ for(var i=0;i<skills1.length;i++){
@ -40578,7 +40621,7 @@
} }
} }
if(target){ if(target){
var skills2=target.get('s').concat(lib.skill.global); var skills2=target.getSkills().concat(lib.skill.global);
game.expandSkills(skills2); game.expandSkills(skills2);
for(var i=0;i<skills2.length;i++){ for(var i=0;i<skills2.length;i++){
temp2=get.info(skills2[i]).ai; temp2=get.info(skills2[i]).ai;

View File

@ -895,7 +895,7 @@ mode.boss={
var targets=player.getEnemies(); var targets=player.getEnemies();
var stop=false; var stop=false;
for(var i=0;i<targets.length;i++){ 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++){ for(var j=0;j<skills.length;j++){
if(get.tag(skills[j],'rejudge',targets[i])){ if(get.tag(skills[j],'rejudge',targets[i])){
stop=true;break; stop=true;break;

View File

@ -4988,13 +4988,13 @@ mode.chess={
return false; return false;
} }
var move=2; var move=2;
move=game.checkMod(player,move,'chessMove',player.get('s')); move=game.checkMod(player,move,'chessMove',player.getSkills());
return move>0; return move>0;
}, },
content:function(){ content:function(){
"step 0" "step 0"
var move=2; 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; player.chooseToMove(move).phasing=true;
"step 1" "step 1"
if(ui.confirm){ if(ui.confirm){

View File

@ -1431,7 +1431,7 @@ mode.guozhan={
} }
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ 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].isTurnedOver()&&
!players[i].hasJudge('lebu')&& !players[i].hasJudge('lebu')&&
ai.get.attitude(player,players[i])>=3&& ai.get.attitude(player,players[i])>=3&&
@ -1474,7 +1474,7 @@ mode.guozhan={
var nh=target.countCards('h'); var nh=target.countCards('h');
var np=player.countCards('h'); var np=player.countCards('h');
if(player.hp==player.maxHp||player.storage.gzrende<0||player.countCards('h')+player.storage.gzrende<=2){ 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); return Math.max(1,5-nh);
} }
@ -1848,7 +1848,7 @@ mode.guozhan={
} }
} }
if(config.inline||config.siege){ if(config.inline||config.siege){
var skills=player.get('s'); var skills=player.getSkills();
for(var i=0;i<skills.length;i++){ for(var i=0;i<skills.length;i++){
var info=get.info(skills[i]).zhenfa; var info=get.info(skills[i]).zhenfa;
if(info&&config[info]){ if(info&&config[info]){
@ -3129,7 +3129,7 @@ mode.guozhan={
if(sourceSkill&&sourceSkill.sourceSkill){ if(sourceSkill&&sourceSkill.sourceSkill){
skill=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(lib.skill.global.contains(skill)) return false;
if(this.isUnseen(0)){ if(this.isUnseen(0)){
var skills=game.expandSkills(lib.character[this.name1][3].slice(0)); var skills=game.expandSkills(lib.character[this.name1][3].slice(0));