This commit is contained in:
libccy 2017-02-25 18:07:40 +08:00
parent b368116bfb
commit 0f2e856f24
14 changed files with 266 additions and 45 deletions

View File

@ -67,7 +67,7 @@ card.extra={
}, },
}, },
order:function(){ order:function(){
return lib.card.sha.ai.order+0.2; return ai.get.order({name:'sha'})+0.2;
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){

View File

@ -1368,7 +1368,9 @@ card.gujian={
prompt:'将一张手牌当杀使用', prompt:'将一张手牌当杀使用',
check:function(card){return 5-ai.get.value(card)}, check:function(card){return 5-ai.get.value(card)},
ai:{ ai:{
order:3.1, order:function(){
return ai.get.order({name:'sha'})+0.1;
},
skillTagFilter:function(player,tag,arg){ skillTagFilter:function(player,tag,arg){
if(arg!='use') return false; if(arg!='use') return false;
if(!player.num('h')) return false; if(!player.num('h')) return false;

View File

@ -116,7 +116,10 @@ card.standard={
useful:[5,1], useful:[5,1],
value:[5,1], value:[5,1],
}, },
order:3, order:function(){
if(_status.event.player.hasGlobalTag('presha')) return 10;
return 3;
},
result:{ result:{
target:function(player,target){ target:function(player,target){
if(player.hasSkill('jiu')&&!target.num('e','baiyin')){ if(player.hasSkill('jiu')&&!target.num('e','baiyin')){

View File

@ -402,7 +402,9 @@ card.swd={
result:{ result:{
target:1 target:1
}, },
order:3.1 order:function(){
return ai.get.order({name:'sha'})+0.1;
},
} }
}, },
xuejibingbao:{ xuejibingbao:{
@ -1568,7 +1570,7 @@ card.swd={
}, },
}, },
order:function(){ order:function(){
return lib.card.sha.ai.order+0.2; return ai.get.order({name:'sha'})+0.2;
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){
@ -2253,7 +2255,9 @@ card.swd={
} }
}, },
ai:{ ai:{
order:3.11, order:function(){
return ai.get.order({name:'sha'})+0.11;
},
result:{ result:{
target:function(player,target){ target:function(player,target){
return ai.get.effect(target,{name:'sha'},player,target); return ai.get.effect(target,{name:'sha'},player,target);

View File

@ -3098,7 +3098,7 @@ character.shenhua={
return 9; return 9;
} }
} }
return lib.card.sha.ai.order-1; return ai.get.order({name:'sha'})-1;
}, },
result:{ result:{
player:function(player){ player:function(player){

View File

@ -846,7 +846,9 @@ character.sp={
if(!player.storage.fanghun) return false; if(!player.storage.fanghun) return false;
if(!player.num('h','shan')) return false; if(!player.num('h','shan')) return false;
}, },
order:3.1, order:function(){
return ai.get.order({name:'sha'})+0.1;
},
useful:-1, useful:-1,
value:-1 value:-1
} }
@ -4876,7 +4878,7 @@ character.sp={
viewAs:{name:'sha',nature:'thunder'}, viewAs:{name:'sha',nature:'thunder'},
ai:{ ai:{
order:function(){ order:function(){
return lib.card.sha.ai.order+0.1; return ai.get.order({name:'sha'})+0.1;
} }
} }
}, },

View File

@ -708,7 +708,7 @@ character.standard={
} }
}, },
order:function(){ order:function(){
return lib.card.sha.ai.order-0.1; return ai.get.order({name:'sha'})-0.1;
}, },
} }
}, },
@ -993,7 +993,9 @@ character.standard={
skillTagFilter:function(player){ skillTagFilter:function(player){
if(!player.num('h','shan')) return false; if(!player.num('h','shan')) return false;
}, },
order:3.1, order:function(){
return ai.get.order({name:'sha'})+0.1;
},
useful:-1, useful:-1,
value:-1 value:-1
} }

View File

@ -1037,7 +1037,9 @@ character.swd={
prompt:'将一张红色牌当杀使用', prompt:'将一张红色牌当杀使用',
check:function(card){return 5-ai.get.value(card)}, check:function(card){return 5-ai.get.value(card)},
ai:{ ai:{
order:3.1, order:function(){
return ai.get.order({name:'sha'})+0.1;
},
skillTagFilter:function(player,tag,arg){ skillTagFilter:function(player,tag,arg){
if(arg!='use') return false; if(arg!='use') return false;
if(!player.num('he',{color:'red'})) return false; if(!player.num('he',{color:'red'})) return false;
@ -1277,7 +1279,9 @@ character.swd={
if(player.num('h',{type:['trick','delay']})<2) return false; if(player.num('h',{type:['trick','delay']})<2) return false;
}, },
respondSha:true, respondSha:true,
order:3.1, order:function(){
return ai.get.order({name:'sha'})+0.1;
},
useful:-1, useful:-1,
value:-1 value:-1
}, },
@ -2294,7 +2298,7 @@ character.swd={
}, },
ai:{ ai:{
order:function(){ order:function(){
return lib.card.sha.ai.order+0.1; return ai.get.order({name:'sha'})+0.1;
} }
}, },
group:['linyun2'] group:['linyun2']
@ -3171,7 +3175,7 @@ character.swd={
}, },
ai:{ ai:{
order:function(){ order:function(){
return lib.card.sha.ai.order+0.1; return ai.get.order({name:'sha'})+0.1;
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){
@ -7474,7 +7478,7 @@ character.swd={
ai:{ ai:{
order:function(){ order:function(){
if(_status.event.player.num('h')==1) return 10; if(_status.event.player.num('h')==1) return 10;
return lib.card.sha.ai.order+0.1; return ai.get.order({name:'sha'})+0.1;
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){
@ -8703,7 +8707,7 @@ character.swd={
}, },
ai:{ ai:{
order:function(){ order:function(){
return lib.card.sha.ai.order+0.1; return ai.get.order({name:'sha'})+0.1;
}, },
effect:{ effect:{
target:function(card,player){ target:function(card,player){

View File

@ -141,7 +141,9 @@ character.xianjian={
}, },
group:'yanzhan2', group:'yanzhan2',
ai:{ ai:{
order:3.15 order:function(){
return ai.get.order({name:'sha'})+0.15;
},
}, },
}, },
yanzhan2:{ yanzhan2:{
@ -1238,7 +1240,7 @@ character.xianjian={
}, },
ai:{ ai:{
order:function(){ order:function(){
return lib.card.sha.ai.order+0.1; return ai.get.order({name:'sha'})+0.1;
}, },
effect:{ effect:{
player:function(card,player){ player:function(card,player){

View File

@ -1753,7 +1753,7 @@ character.yijiang={
return 9; return 9;
} }
} }
return lib.card.sha.ai.order-1; return ai.get.order({name:'sha'})-1;
}, },
result:{ result:{
player:function(player){ player:function(player){
@ -3201,7 +3201,7 @@ character.yijiang={
} }
}, },
order:function(){ order:function(){
return lib.card.sha.ai.order-0.1; return ai.get.order({name:'sha'})-0.1;
}, },
} }
}, },
@ -7140,7 +7140,9 @@ character.yijiang={
} }
}, },
ai:{ ai:{
order:3.1, order:function(){
return ai.get.order({name:'sha'})+0.05;
},
result:{ result:{
player:function(player){ player:function(player){
var target=game.findPlayer(function(current){ var target=game.findPlayer(function(current){

View File

@ -6634,7 +6634,7 @@
var hidden=player.hiddenSkills.slice(0); var hidden=player.hiddenSkills.slice(0);
game.expandSkills(hidden); game.expandSkills(hidden);
if(hidden.contains(event.skill)){ if(hidden.contains(event.skill)){
if(!info.silent&&player.hasSkillTag('nomingzhi',false,null,true)){ if(!info.silent&&player.hasGlobalTag('nomingzhi')){
event.finish(); event.finish();
} }
else if(!info.direct){ else if(!info.direct){
@ -8880,9 +8880,6 @@
event.finish(); event.finish();
} }
"step 6" "step 6"
if(event.card.name!='wuxie'){
game.broadcastAll(ui.clear);
}
event._oncancel(); event._oncancel();
}, },
useSkill:function(){ useSkill:function(){
@ -13353,7 +13350,7 @@
return (range); return (range);
}, },
getHandcardLimit:function(){ getHandcardLimit:function(){
return game.checkMod(this,this.hp,'maxHandcard',this.get('s')) return Math.max(0,game.checkMod(this,this.hp,'maxHandcard',this.get('s')));
}, },
getEnemies:function(func){ getEnemies:function(func){
var player=this; var player=this;
@ -13407,14 +13404,14 @@
return !this.isFriendOf.apply(this,arguments); return !this.isFriendOf.apply(this,arguments);
}, },
isFriendOf:function(player){ isFriendOf:function(player){
if(typeof this.side=='boolean'&&typeof player.side=='boolean'){ if(get.mode()=='guozhan'){
return this.side==player.side;
}
if(lib.config.mode=='guozhan'){
if(this.identity=='unknown'||this.identity=='ye') return false; if(this.identity=='unknown'||this.identity=='ye') return false;
if(player.identity=='unknown'||player.identity=='ye') return false; if(player.identity=='unknown'||player.identity=='ye') return false;
return this.identity==player.identity; return this.identity==player.identity;
} }
if(typeof this.side=='boolean'&&typeof player.side=='boolean'){
return this.side==player.side;
}
return this==player; return this==player;
}, },
isAlive:function(){ isAlive:function(){
@ -13578,6 +13575,24 @@
} }
} }
return false; return false;
},
hasGlobalTag:function(tag,arg){
var skills=lib.skill.global.slice(0);
game.expandSkills(skills);
for(var i=0;i<skills.length;i++){
var info=lib.skill[skills[i]];
if(info&&info.ai){
if(info.ai.skillTagFilter&&
info.ai.skillTagFilter(this,tag,arg)===false) continue;
if(typeof info.ai[tag]=='string'){
if(info.ai[tag]==arg) return true;
}
else if(info.ai[tag]){
return true;
}
}
}
return false;
}, },
hasSkillTag:function(tag,hidden,arg,globalskill){ hasSkillTag:function(tag,hidden,arg,globalskill){
var skills=this.get('s',hidden); var skills=this.get('s',hidden);
@ -16478,6 +16493,21 @@
player.stat.push({card:{},skill:{}}); player.stat.push({card:{},skill:{}});
}, },
}, },
_usecard:{
trigger:{global:'useCardAfter'},
forced:true,
popup:false,
priority:-100,
filter:function(event){
return !event._cleared&&event.card.name!='wuxie';
},
content:function(){
game.broadcastAll(function(){
ui.clear();
});
event._cleared=true;
}
},
_discard:{ _discard:{
trigger:{global:'discardAfter'}, trigger:{global:'discardAfter'},
forced:true, forced:true,
@ -21359,7 +21389,7 @@
} }
else{ else{
var skills2; var skills2;
if(get.mode()=='guozhan'&&player.hasSkillTag('nomingzhi',false,null,true)){ if(get.mode()=='guozhan'&&player.hasGlobalTag('nomingzhi')){
skills2=player.get('s',false,true,false); skills2=player.get('s',false,true,false);
} }
else{ else{
@ -25393,6 +25423,10 @@
if(info[i][4]&&info[i][4].contains('unseen')) continue; if(info[i][4]&&info[i][4].contains('unseen')) continue;
list.push(i); list.push(i);
for(var j=0;j<info[i][3].length;j++){ for(var j=0;j<info[i][3].length;j++){
if(!lib.skill[info[i][3][j]]){
console.log(info[i][3][j]);
continue;
}
if(lib.skill[info[i][3][j]].alter){ if(lib.skill[info[i][3][j]].alter){
alterableSkills.add(info[i][3][j]); alterableSkills.add(info[i][3][j]);
alterableCharacters.add(i); alterableCharacters.add(i);

View File

@ -4763,7 +4763,7 @@ mode.chess={
multitarget:true, multitarget:true,
ai:{ ai:{
order:function(){ order:function(){
return lib.card.sha.ai.order+0.1; return ai.get.order({name:'sha'})+0.1;
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){

View File

@ -226,9 +226,9 @@ mode.guozhan={
gz_hetaihou:['female','qun',3,['zhendu','qiluan']], gz_hetaihou:['female','qun',3,['zhendu','qiluan']],
gz_re_lidian:['male','wei',3,['xunxun','wangxi']], gz_re_lidian:['male','wei',3,['xunxun','wangxi']],
// gz_zangba:['male','wei',4,['hengjiang']], gz_zangba:['male','wei',4,['hengjiang']],
gz_madai:['male','shu',4,['mashu','gzqianxi']], gz_madai:['male','shu',4,['mashu','gzqianxi']],
// gz_mifuren:['female','shu',3,['gzguixiu','gzcunsi']], gz_mifuren:['female','shu',3,['gzguixiu','gzcunsi']],
gz_sunce:['male','wu',4,['jiang','yingyang','hunshang']], gz_sunce:['male','wu',4,['jiang','yingyang','hunshang']],
gz_chendong:['male','wu',4,['duanxie','fenming']], gz_chendong:['male','wu',4,['duanxie','fenming']],
gz_sp_dongzhuo:['male','qun',4,['hengzheng','baoling']], gz_sp_dongzhuo:['male','qun',4,['hengzheng','baoling']],
@ -236,10 +236,170 @@ mode.guozhan={
} }
}, },
characterIntro:{ characterIntro:{
zangba:'其父臧戒,有二子臧艾与臧舜。年少时曾召集数人将获罪的父亲救出,此后四处流亡。后来成为陶谦麾下的骑都尉,负责募兵抵抗黄巾军。与孙观、尹礼等人拥兵驻屯于开阳,自成一股独立势力,后跟随吕布。吕布战败后,投降了曹操。后与袁绍、孙权等的战役里战功赫赫,官至镇东将军。',
zhangren:'刘璋的属下,以忠勇著称。刘备入蜀时,张任曾劝刘璋提防刘备,但刘璋没有听从。魏延舞剑想趁机除掉刘璋时,张任出面对舞,解救刘璋。后在刘备进攻时于落凤坡射死了庞统。',
jiling:'东汉末年袁术帐下将领,勇猛非常,曾奉命率军攻打小沛的刘备,在吕布辕门射戟的调停下撤兵。', jiling:'东汉末年袁术帐下将领,勇猛非常,曾奉命率军攻打小沛的刘备,在吕布辕门射戟的调停下撤兵。',
zoushi:'军阀张济之妻,张绣之婶。张绣降曹后,邹氏遂被曹操霸占。贾诩献计趁机诛杀曹操,险些得手。曹操在损失爱将典韦、侄子曹安民和长子曹昂后方才逃出生天。', zoushi:'军阀张济之妻,张绣之婶。张绣降曹后,邹氏遂被曹操霸占。贾诩献计趁机诛杀曹操,险些得手。曹操在损失爱将典韦、侄子曹安民和长子曹昂后方才逃出生天。',
}, },
skill:{ skill:{
gzguixiu:{
init2:function(player){
player.logSkill('guixiu');
player.draw(2);
},
onremove:function(player){
if(player.isDamaged()){
player.logSkill('guixiu');
player.recover();
}
}
},
gzcunsi:{
derivation:'gzyongjue',
enable:'phaseUse',
filter:function(event,player){
return player.checkMainSkill('gzcunsi',false)||player.checkViceSkill('gzcunsi',false);
},
unique:true,
forceunique:true,
filterTarget:true,
skillAnimation:true,
content:function(){
'step 0'
if(player.checkMainSkill('gzcunsi',false)){
player.removeCharacter(0);
}
else{
player.removeCharacter(1);
}
'step 1'
target.addSkill('gzyongjue');
if(target!=player){
target.draw(2);
}
},
ai:{
order:9,
result:{
player:function(player,target){
var num=0;
if(player.isDamaged()&&target.isFriendOf(player)){
num++;
if(target.hasSkill('kanpo')) num+=0.5;
if(target.hasSkill('liegong')) num+=0.5;
if(target.hasSkill('tieji')) num+=0.5;
if(target.hasSkill('gzrende')) num+=1.2;
if(target.hasSkill('longdan')) num+=1.2;
if(target.hasSkill('paoxiao')) num+=1.2;
if(target!=player) num+=0.5;
}
return num;
}
}
}
},
gzyongjue:{
trigger:{global:'useCardAfter'},
filter:function(event,player){
if(event.gzyongjue==player){
for(var i=0;i<event.cards.length;i++){
if(get.position(event.cards[i])=='d'){
return true;
}
}
}
return false;
},
content:function(){
var cards=[];
for(var i=0;i<trigger.cards.length;i++){
if(get.position(trigger.cards[i])=='d'){
cards.push(trigger.cards[i]);
}
}
player.gain(cards,'gain2');
},
subSkill:{
count:{
trigger:{global:'useCard'},
filter:function(event,player){
return event.card.name=='sha'&&event.cards.length&&
event.player.isFriendOf(player)&&get.cardCount(true,event.player)==1;
},
forced:true,
popup:false,
silent:true,
content:function(){
trigger.gzyongjue=player;
}
}
},
group:'gzyongjue_count',
global:'gzyongjue_ai'
},
gzyongjue_ai:{
ai:{
presha:true,
skillTagFilter:function(player){
if(!game.hasPlayer(function(current){
return current.isFriendOf(player)&&current.hasSkill('gzyongjue');
})){
return false;
}
}
}
},
hengjiang:{
trigger:{player:'damageEnd'},
check:function(event,player){
return ai.get.attitude(player,event.source)<0||!event.source.needsToDiscard(2);
},
filter:function(event){
return event.source&&event.source.isIn()&&event.num>0;
},
logTarget:'source',
content:function(){
var source=trigger.source;
if(source.hasSkill('hengjiang2')){
source.storage.hengjiang3+=trigger.num;
source.updateMarks();
}
else{
source.storage.hengjiang2=player;
source.storage.hengjiang3=trigger.num;
source.addTempSkill('hengjiang2','phaseAfter');
}
}
},
hengjiang2:{
mark:'character',
intro:{
content:function(storage,player){
return '手牌上限-'+player.storage.hengjiang3;
},
markcount:function(storage,player){
return player.storage.hengjiang3;
}
},
mod:{
maxHandcard:function(player,num){
return num-player.storage.hengjiang3;
}
},
onremove:function(player){
delete player.storage.hengjiang2;
delete player.storage.hengjiang3;
},
trigger:{player:'phaseDiscardEnd'},
filter:function(event,player){
return player.storage.hengjiang2.isIn()&&(!event.cards||event.cards.length==0);
},
forced:true,
popup:false,
content:function(){
player.storage.hengjiang2.draw();
}
},
baoling:{ baoling:{
trigger:{player:'phaseUseEnd'}, trigger:{player:'phaseUseEnd'},
init:function(player){ init:function(player){
@ -1647,9 +1807,11 @@ mode.guozhan={
hunshang:'魂殇', hunshang:'魂殇',
hunshang_info:'副将技此武将牌减少半个阴阳鱼准备阶段若你的体力值为1则你本回合获得“英姿”和“英魂”', hunshang_info:'副将技此武将牌减少半个阴阳鱼准备阶段若你的体力值为1则你本回合获得“英姿”和“英魂”',
gzguixiu:'闺秀', gzguixiu:'闺秀',
gzguixiu_info:'当你明置此武将牌时,你可以摸两张牌;当你移除此武将牌时,你可以回复1点体力', gzguixiu_info:'当你明置此武将牌时,你摸两张牌;当你失去此技能时,你回复1点体力',
gzcunsi:'存嗣', gzcunsi:'存嗣',
gzcunsi_info:'出牌阶段,你可以移除此武将牌并选择一名角色,然后其获得技能“勇决”(若与你势力相同的一名角色于其回合内使用的第一张牌为【杀】,则该角色可以在此【杀】结算完成后获得之),若你没有获得“勇决”,则获得“勇决”的角色摸两张牌', gzcunsi_info:'出牌阶段,你可以移除此武将牌并选择一名角色,然后其获得技能“勇决”,若你没有获得“勇决”,则获得“勇决”的角色摸两张牌',
gzyongjue:'勇决',
gzyongjue_info:'若与你势力相同的一名角色于其回合内使用的第一张牌为【杀】,则该角色可以在此【杀】结算完成后获得之',
hengjiang:'横江', hengjiang:'横江',
hengjiang_info:'当你受到1点伤害后你可以令当前回合角色本回合的手牌上限-1。然后若其弃牌阶段内没有弃牌则你摸一张牌', hengjiang_info:'当你受到1点伤害后你可以令当前回合角色本回合的手牌上限-1。然后若其弃牌阶段内没有弃牌则你摸一张牌',
gzqianxi:'潜袭', gzqianxi:'潜袭',
@ -1931,23 +2093,27 @@ mode.guozhan={
} }
return false; return false;
}, },
checkViceSkill:function(skill){ checkViceSkill:function(skill,disable){
if(game.expandSkills(lib.character[this.name2][3].slice(0)).contains(skill)){ if(game.expandSkills(lib.character[this.name2][3].slice(0)).contains(skill)){
return true; return true;
} }
else{ else{
if(disable!==false){
this.disableSkill(skill,skill); this.disableSkill(skill,skill);
this.awakenedSkills.add(skill); this.awakenedSkills.add(skill);
}
return false; return false;
} }
}, },
checkMainSkill:function(skill){ checkMainSkill:function(skill,disable){
if(game.expandSkills(lib.character[this.name1][3].slice(0)).contains(skill)){ if(game.expandSkills(lib.character[this.name1][3].slice(0)).contains(skill)){
return true; return true;
} }
else{ else{
if(disable!==false){
this.disableSkill(skill,skill); this.disableSkill(skill,skill);
this.awakenedSkills.add(skill); this.awakenedSkills.add(skill);
}
return false; return false;
} }
}, },
@ -2075,7 +2241,7 @@ mode.guozhan={
this.classList.remove('unseen2'); this.classList.remove('unseen2');
break; break;
case 2: case 2:
if(log!==false) game.log(this,'展示了主将','#b'+get.translation(this.name1)+'、副将','#b'+get.translation(this.name2)); if(log!==false) game.log(this,'展示了主将','#b'+get.translation(this.name1),'、副将','#b'+get.translation(this.name2));
this.name=this.name1; this.name=this.name1;
skills=lib.character[this.name][3].concat(lib.character[this.name2][3]); skills=lib.character[this.name][3].concat(lib.character[this.name2][3]);
this.sex=lib.character[this.name][0]; this.sex=lib.character[this.name][0];

View File

@ -8426,7 +8426,7 @@ mode.stone={
}, },
ai:{ ai:{
order:function(){ order:function(){
return lib.card.sha.ai.order-0.1; return ai.get.order({name:'sha'})-0.1;
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){