This commit is contained in:
Congyue Cui 2018-04-17 15:32:43 +08:00
parent a0dbc01f98
commit 18442f0d7c
47 changed files with 75776 additions and 75504 deletions

15
.eslintrc.json Normal file
View File

@ -0,0 +1,15 @@
{
"extends": "eslint:recommended",
"env": {
"browser": true,
"node": true,
"es6": true,
"worker": true
},
"rules": {
"no-console": 0,
"no-unused-vars": 0,
"no-undef": 0,
"no-redeclare": 0
}
}

7
.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

View File

@ -785,7 +785,8 @@ game.import('card',function(lib,game,ui,get,ai,_status){
order:4.5,
value:[5,1],
tag:{
gain:1
gain:1,
norepeat:1
},
result:{
target:function(player,target){

View File

@ -361,7 +361,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){
}
}
if(!ok) return 0;
if(ui.selected.targets.length==1) return 2;
if(ui.selected.targets.length==1){
if(target.hasSkillTag('nogain')) return 0;
return 2;
}
if(target.countCards('he')==0) return 0;
if(player.hasFriend()) return -1;
return 0;

View File

@ -117,6 +117,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true,
mark:true,
audio:2,
unique:true,
filter:function(event){
return event.num>0;
},

View File

@ -1022,6 +1022,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
order:2.1,
result:{
target:function(player,target){
if(target.hasSkillTag('nogain')) return 0;
if(get.attitude(player,target)<3) return 0;
if(target.hasJudge('lebu')) return 0;
if(target.hasSkill('aqianghua2')) return 0.1;

View File

@ -189,9 +189,11 @@ window.noname_character_rank={
'hs_kalimosi',
'hs_zhihuanhua',
'xizhicai',
'maliang',
],
am:[
'gw_oudimu',
'guanyinping',
'dongyun',
'gw_xigedelifa',
'gw_laomaotou',
@ -437,7 +439,6 @@ window.noname_character_rank={
'swd_hupo',
'caopi',
'jiaxu',
'maliang',
'zhangchunhua',
'xushu',
'xin_xushu',
@ -482,7 +483,7 @@ window.noname_character_rank={
'hs_nozdormu',
'zhoucang',
'hs_shifazhe',
'guanyinping',
'huanghao',
],
b:[
'xinxianying',
@ -492,7 +493,6 @@ window.noname_character_rank={
'hs_jiawodun',
'yxs_weizhongxian',
'cenhun',
'huanghao',
'panzhangmazhong',
'jsp_guanyu',
'wenpin',

View File

@ -168,6 +168,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
result:{
target:function(player,target){
if(target.hasSkillTag('nogain')) return 0;
if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){
if(target.hasSkillTag('nodu')) return 0;
return -10;

View File

@ -26,7 +26,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
sp_caoren:['male','wei',4,['weikui','lizhan']],
zhangbao:['male','qun',3,['zhoufu','yingbin']],
zhangliang:['male','qun',3,['fulu','fuji']],
maliang:['male','shu',3,['xiemu','naman']],
maliang:['male','shu',3,['zishu','yingyuan']],
sp_pangtong:['male','qun',3,['manjuan','zuixiang']],
zhugedan:['male','wei',4,['gongao','juyi']],
sp_jiangwei:['male','wei',4,['kunfen','fengliang']],
@ -319,6 +319,133 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
},
skill:{
zishu:{
subSkill:{
discard:{
trigger:{player:'gainAfter'},
silent:true,
filter:function(event,player){
return _status.currentPhase!=player;
},
content:function(){
if(!player.storage.zishu){
player.storage.zishu=[];
}
player.storage.zishu.addArray(trigger.cards);
}
},
discard2:{
trigger:{global:'phaseAfter'},
forced:true,
filter:function(event,player){
if(_status.currentPhase!=player&&player.storage.zishu){
var he=player.getCards('he');
for(var i=0;i<player.storage.zishu.length;i++){
if(he.contains(player.storage.zishu[i])){
return true;
}
}
return false;
}
},
content:function(){
var he=player.getCards('he');
var list=[];
for(var i=0;i<player.storage.zishu.length;i++){
if(he.contains(player.storage.zishu[i])){
list.push(player.storage.zishu[i])
}
}
player.$throw(list);
player.lose(list,ui.discardPile);
game.log(player,'将',list,'置入弃牌堆');
}
},
discard3:{
trigger:{global:'phaseBegin'},
silent:true,
content:function(){
delete player.storage.zishu;
}
},
draw:{
trigger:{player:'gainAfter'},
forced:true,
filter:function(event,player){
if(_status.currentPhase!=player) return false;
return event.getParent(2).name!='zishu_draw';
},
content:function(){
player.draw();
}
}
},
ai:{
nogain:1
},
group:['zishu_draw','zishu_discard','zishu_discard2','zishu_discard3']
},
yingyuan:{
trigger:{player:'useCardAfter'},
direct:true,
filter:function(event,player){
if(_status.currentPhase!=player) return false;
if(player.storage.yingyuan&&player.storage.yingyuan.contains(event.card.name)){
return false;
}
if(event.cards){
for(var i=0;i<event.cards.length;i++){
if(event.cards[i].isInPile()) return true;
}
}
return false;
},
content:function(){
'step 0'
player.chooseTarget(get.prompt('yingyuan'),function(card,player,target){
return target!=player;
}).set('ai',function(target){
if(target.hasJudge('lebu')) return 0;
var att=get.attitude(_status.event.player,target);
if(att<3) return 0;
if(target.hasSha()&&_status.event.sha){
att/=5;
}
if(event.wuxie&&target.needsToDiscard(1)){
att/=5;
}
return att/(1+get.distance(player,target,'absolute'));
}).set('sha',trigger.cards[0].name=='sha').set('wuxie',trigger.cards[0].name=='wuxie');
'step 1'
if(result.bool){
var list=[];
for(var i=0;i<trigger.cards.length;i++){
if(trigger.cards[i].isInPile()){
list.push(trigger.cards[i]);
}
}
player.logSkill('yingyuan',result.targets[0]);
result.targets[0].gain(list,'gain2');
if(!player.storage.yingyuan){
player.storage.yingyuan=[];
}
player.storage.yingyuan.push(trigger.card.name);
}
},
group:'yingyuan_clear',
subSkill:{
clear:{
trigger:{player:'phaseAfter'},
silent:true,
content:function(){
delete player.storage.yingyuan;
}
}
},
ai:{
threaten:1.5
}
},
choulve:{
trigger:{player:'phaseUseBegin'},
direct:true,
@ -9236,6 +9363,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
result:{
player:0,
target:function(player,target){
if(target.hasSkillTag('nogain')) return 0;
if(player.countCards('h')>1){
return 1;
}
@ -9572,6 +9700,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
quyi:'麹义',
liuye:'刘晔',
zishu:'自书',
zishu_info:'锁定技,你的回合外,你获得的牌均会在当前回合结束后置入弃牌堆;你的回合内,当你不因此技能效果获得牌时,额外摸一张牌。',
yingyuan:'应援',
yingyuan_info:'当你于回合内使用的牌置入弃牌堆后,你可以将之交给一名其他角色(相同牌名的牌每回合限一次)。',
ly_piliche:'霹雳车',
ly_piliche_info:'当你对其他角色造成伤害后,若造成伤害牌不为延时锦囊牌,你可以弃置其装备区里的防具牌与+1坐骑牌当你失去此装备时销毁之',
polu:'破橹',

View File

@ -564,6 +564,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
result:{
target:function(player,target){
if(target.hasSkillTag('nogain')) return 0;
if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){
if(target.hasSkillTag('nodu')) return 0;
return -10;

View File

@ -1100,7 +1100,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
},
hujing:{
trigger:{player:'phaseBegin'},
trigger:{player:'phaseEnd'},
forced:true,
filter:function(event,player){
return get.cardPile('lianyaohu')?true:false;
@ -10037,7 +10037,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
xiangu:'仙骨',
xiangu_info:'锁定技,你的手牌上限不会因体力值的减少而减少。',
hujing:'壶境',
hujing_info:'锁定技,准备阶段,若牌堆或弃牌堆中有炼妖壶,你装备之;当你的装备区内有炼妖壶时,你的手牌上限+2',
hujing_info:'锁定技,结束阶段,若牌堆或弃牌堆中有炼妖壶,你装备之;当你的装备区内有炼妖壶时,你的手牌上限+2',
huajian:'化剑',
huajian_info:'出牌阶段结束时,你可以将一张牌当作杀对任意一名角色使用',
xuanyuan:'轩辕',

View File

@ -31,7 +31,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
liufeng:['male','shu',4,['xiansi']],
manchong:['male','wei',3,['junxing','yuce']],
guanzhang:['male','shu',4,['fuhun']],
chenqun:['male','wei',3,['dingpin','faen']],
chenqun:['male','wei',3,['pindi','faen']],
sunluban:['female','wu',3,['chanhui','jiaojin']],
guyong:['male','wu',3,['shenxing','bingyi']],
caifuren:['female','qun',3,['qieting','xianzhou']],
@ -170,6 +170,76 @@ game.import('character',function(lib,game,ui,get,ai,_status){
liuchen:['liushan'],
},
skill:{
pindi:{
enable:'phaseUse',
filterTarget:function(card,player,target){
if(player==target) return false;
if(player.storage.pindi_target&&
player.storage.pindi_target.contains(target)){
return false;
}
return true;
},
filterCard:function(card,player){
if(player.storage.pindi_type&&
player.storage.pindi_type.contains(get.type2(card))){
return false;
}
return true;
},
subSkill:{
clear:{
trigger:{player:'phaseAfter'},
silent:true,
content:function(){
delete player.storage.pindi_target;
delete player.storage.pindi_type;
}
}
},
group:'pindi_clear',
check:function(card){
var num=_status.event.player.getStat('skill').pindi||0;
return 6+num-get.value(card);
},
position:'he',
content:function(){
'step 0'
if(!player.storage.pindi_target){
player.storage.pindi_target=[];
}
if(!player.storage.pindi_type){
player.storage.pindi_type=[];
}
player.storage.pindi_target.push(target);
player.storage.pindi_type.push(get.type2(cards[0]));
event.num=player.getStat('skill').pindi;
player.chooseControlList([
'令'+get.translation(target)+'摸'+get.cnNumber(event.num)+'张牌',
'令'+get.translation(target)+'弃置'+get.cnNumber(event.num)+'张牌'
],function(){
return _status.event.choice;
}).set('choice',get.attitude(player,target)>0?0:1);
'step 1'
if(result.index==0){
target.draw(event.num);
}
else{
target.chooseToDiscard(event.num,'he',true);
}
'step 2'
if(target.isDamaged()){
player.link(true);
}
},
ai:{
order:8,
threaten:1.8,
result:{
player:1
}
}
},
funan:{
trigger:{global:['respondAfter','useCardAfter']},
filter:function(event,player){
@ -2167,10 +2237,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
direct:true,
filter:function(event,player){
if(!player.countCards('he')) return false;
if(!event.source||event.source.isDead()) return false;
if(event.source.storage.huisheng&&event.source.storage.huisheng.contains(player)) return false;
if(!event.source||!event.source.isIn()) return false;
if(player.storage.huisheng.contains(event.source)) return false;
return true;
},
init:function(player){
player.storage.huisheng=[];
},
content:function(){
'step 0'
var att=(get.attitude(player,trigger.source)>0);
@ -2190,18 +2263,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
}
}
player.chooseCard('he',[1,player.countCards('he')],get.prompt('huisheng',trigger.source)).set('ai',function(card){
player.chooseCard('he',[1,player.countCards('he')],get.prompt2('huisheng',trigger.source)).set('ai',function(card){
if(_status.event.att){
return 10-get.value(card);
}
if(_status.event.goon){
return 8-get.value(card);
}
if(!ui.selected.cards.length){
return 7-get.value(card);
}
return 0;
}).set('goon',goon).set('att',att);
'step 1'
if(result.bool){
player.logSkill('huisheng');
player.logSkill('huisheng',trigger.source);
game.delay();
event.num=result.cards.length;
var goon=false;
if(event.num>2||get.attitude(trigger.source,player)>=0){
@ -2215,10 +2292,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
else{
str+=',或取消并弃置'+get.cnNumber(result.cards.length)+'张牌';
}
if(!trigger.source.storage.huisheng){
trigger.source.storage.huisheng=[];
}
trigger.source.storage.huisheng.push(player);
trigger.source.chooseButton([str,result.cards],forced).set('ai',function(button){
if(_status.event.goon){
return get.value(button.link);
@ -2240,6 +2313,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.$giveAuto(card,trigger.source);
}
trigger.cancel();
player.storage.huisheng.push(trigger.source);
}
else{
trigger.source.chooseToDiscard(event.num,true,'he');
@ -2247,50 +2321,67 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
},
qinqing:{
mode:['identity'],
mode:['identity','versus'],
available:function(mode){
if(mode=='versus'&&_status.mode!='four') return false;
},
trigger:{player:'phaseEnd'},
direct:true,
filter:function(event,player){
var zhu=get.zhu(player);
if(!zhu||!zhu.isZhu) return false;
var players=game.filterPlayer();
for(var i=0;i<players.length;i++){
if(players[i]==zhu||players[i]==player) continue;
if(get.distance(players[i],zhu,'attack')<=1&&players[i].countCards('he')){
return true;
}
}
return false;
return game.hasPlayer(function(current){
return current!=player&&current!=zhu&&get.distance(current,zhu,'attack')<=1;
});
},
content:function(){
'step 0'
player.chooseTarget(get.prompt('qinqing'),function(card,player,target){
if(target==player||target==get.zhu(player)) return false;
return get.distance(target,get.zhu(player),'attack')<=1&&target.countCards('he')>0;
player.chooseTarget(get.prompt('qinqing'),[1,Infinity],function(card,player,target){
var zhu=get.zhu(player);
if(target==player||target==zhu) return false;
return get.distance(target,zhu,'attack')<=1;
}).set('ai',function(target){
var player=_status.event.player;
var zhu=_status.event.zhu;
if(get.attitude(player,target)>0) return 0;
var nh=target.countCards('h');
var nh2=zhu.countCards('h');
if(nh>nh2) return 2;
if(nh==nh2&&target.countCards('e')) return 1.5;
return 1;
}).set('zhu',get.zhu(player));
var he=target.countCards('he')
if(get.attitude(_status.event.player,target)>0){
if(he==0) return 1;
if(target.countCards('h')>get.zhu(player).countCards('h')) return 1;
}
else{
if(he>0) return 1;
}
return 0;
});
'step 1'
if(result.bool){
event.target=result.targets[0];
player.logSkill('qinqing',event.target);
player.discardPlayerCard(event.target,'he',true);
event.targets=result.targets.slice(0).sortBySeat();
event.list=event.targets.slice(0);
player.logSkill('qinqing',event.targets);
}
else{
event.finish();
}
'step 2'
event.target.draw();
if(event.targets.length){
var target=event.targets.shift();
if(target.countCards('he')){
player.discardPlayerCard(target,'he',true);
}
target.draw();
event.redo();
}
'step 3'
if(event.target.countCards('h')>get.zhu(player).countCards('h')){
player.draw();
var num=0;
var zhu=get.zhu(player);
if(zhu){
var nh=zhu.countCards('h');
for(var i=0;i<event.list.length;i++){
if(event.list[i].countCards('h')>nh){
num++;
}
}
if(num){
player.draw(num);
}
}
},
ai:{
@ -5159,6 +5250,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
order:1,
result:{
target:function(player,target){
if(target.hasSkillTag('nogain')) return 0;
if(player.countCards('h')==1&&player.countCards('h','du')) return -1;
if(player.hp<=2&&player.countCards('h','shan')) return 0;
if(target.countCards('h')+player.countCards('h')>target.hp+2) return 0;
@ -6273,7 +6365,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{global:['turnOverAfter','linkAfter']},
filter:function(event,player){
if(event.name=='link') return event.player.isLinked();
return true;
return !event.player.isTurnedOver();
},
check:function(event,player){
return get.attitude(player,event.player)>0;
@ -9143,6 +9235,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
qinmi:'秦宓',
caiyong:'蔡邕',
pindi:'品第',
pindi_info:'出牌阶段你可以弃置一张牌并选择一名其他角色不能弃置相同类型牌且不能指定相同的角色然后令其执行一项摸X张牌弃置X张牌X为本回合此技能发动次数。若其已受伤你须横置自身。',
funan_jiexun:'诫训',
bizhuan:'辟撰',
bizhuan_bg:'书',
@ -9201,9 +9295,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
jiyu:'讥谀',
jiyu_info:'出牌阶段每名角色限一次若你有可以使用的手牌你可以令一名角色弃置一张手牌。若如此做你不能使用与之相同花色的牌直到回合结束。若其以此法弃置的牌为黑桃你翻面并令其失去1点体力',
qinqing:'寝情',
qinqing_info:'结束阶段开始时,你可以弃置攻击范围内含有主公的一名其他角色的一张牌,令其摸一张牌,然后若其手牌比主公多,你摸一张牌',
qinqing_info:'结束阶段你可以选择任意名攻击范围内含有主公的角色然后弃置这些角色各一张牌并令其摸一张牌无牌则不弃若如此做你摸X张牌X为其中手牌比主公多的角色数',
huisheng:'贿生',
huisheng_info:'每名角色限一次当你受到其他角色造成的伤害时你可选你的任意数量的牌令该角色观看然后该角色选择1.获得这些牌中的一张,然后防止伤害。2.弃置等量的牌',
huisheng_info:'当你受到其他角色对你造成的伤害时你可以令其观看你任意数量的牌并令其选择一项1.获得这些牌中的一张,防止此伤害,然后你不能再对其发动“贿生”;2.弃置等量的牌',
jishe:'极奢',
jishe_info:'出牌阶段若你的手牌上限大于0你可以摸一张牌然后你本回合的手牌上限-1。结束阶段开始时若你没有手牌则你可以横置至多X名角色的武将牌X为你的体力值',
lianhuo:'链祸',
@ -9382,7 +9476,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
dingpin:'定品',
dingpin_info:'出牌阶段限三次你可以弃置一张手牌然后令一名已受伤的角色进行一次判定若结果为黑色该角色摸X张牌(X为该角色已损失的体力值),然后你本回合不能再对其发动“定品”;若结果为红色,将你的武将牌翻面。',
faen:'法恩',
faen_info:'每当一名角色的武将牌翻面或横置时,你可以令其摸一张牌。',
faen_info:'当一名角色翻至正面或横置后,你可以令其摸一张牌。',
jyzongshi:'纵适',
jyzongshi_info:'每当你拼点赢,你可以获得对方此次拼点的牌;每当你拼点没赢,你可以收回你此次拼点的牌',
qiaoshui:'巧说',

View File

@ -6534,7 +6534,9 @@
game.saveConfigValue('brokenFile');
if(!lib.node.http) lib.node.http=require('http');
if(!lib.node.https) lib.node.https=require('https');
var request = (url.indexOf('https')==0?lib.node.https:lib.node.http).get(encodeURI(url), function(response) {
var opts = require('url').parse(encodeURI(url));
opts.headers={'User-Agent': navigator.userAgent};
var request = (url.indexOf('https')==0?lib.node.https:lib.node.http).get(opts, function(response) {
var stream=response.pipe(file);
stream.on('finish',function(){
lib.config.brokenFile.remove(folder);
@ -28630,6 +28632,13 @@
}
return;
}
if(info.available&&info.available(mode)==false){
lib.skill[i]={};
if(lib.translate[i+'_info']){
lib.translate[i+'_info']='此模式下不可用';
}
return;
}
if(info.viewAs){
if(typeof info.viewAs=='string'){
info.viewAs={name:info.viewAs};
@ -35873,7 +35882,7 @@
else{
updatep1.style.display='';
updatep2.style.display='';
updatep3.style.display='none'; // coding
// updatep3.style.display='none'; // coding
updatepx.style.display='none';
updatep4.innerHTML='更新';
}
@ -35897,7 +35906,7 @@
var button6=document.createElement('button');
button6.innerHTML='设为国内镜像';
button6.style.display='none';// coding
// button6.style.display='none';// coding
// button6.style.marginLeft='5px';
button6.onclick=function(){
game.saveConfig('updateURL',lib.mirrorURL);
@ -44129,6 +44138,9 @@
if(method=='trick'&&lib.card[obj.name].type=='delay') return 'trick';
return lib.card[obj.name].type;
},
type2:function(card){
return get.type(card,'trick');
},
subtype:function(obj){
if(typeof obj=='string') obj={name:obj};
if(typeof obj!='object') return;

View File

@ -1,11 +1,15 @@
window.noname_update={
version:'1.9.48.1',
update:'1.9.48',
version:'1.9.49',
// update:'1.9.48',
changeLog:[
'bug修复'
// '祭天祀地模式(在 选项-开始-身份 中开启)',
'修复国内镜像更新问题',
'武将修改',
'毛玻璃主题仅Safari可用',
'players://["chenqun","lifeng","maliang","huanghao"]'
],
files:[
'game/game.js',
// 'game/game.js',
// 'game/package.js',
// 'game/config.js',
// 'game/source.js',
@ -22,7 +26,7 @@ window.noname_update={
// 'character/gwent.js',
// 'character/diy.js',
// 'character/standard.js',
'character/shenhua.js',
// 'character/shenhua.js',
// 'character/refresh.js',
// 'character/yijiang.js',
// 'character/yxs.js',

View File

@ -5773,7 +5773,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}
else if(_status.mode=='2v2'){
if(_status.replacetwo){
// later ?
}
var friend;
for(var i=0;i<game.players.length;i++){