This commit is contained in:
libccy 2018-08-10 17:29:29 +08:00
parent 785a9f7de8
commit 1c93b97474
17 changed files with 722 additions and 268 deletions

View File

@ -2246,24 +2246,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
skillAnimation:true,
animationColor:'water',
unique:true,
mark:true,
init:function(player){
player.storage.nshaoling=false;
},
limited:true,
enable:'phaseUse',
filter:function(event,player){
return !player.storage.nshaoling;
},
intro:{
content:'limited'
},
filterTarget:function(card,player,target){
return target!=player;
},
content:function(){
"step 0"
player.awakenSkill('nshaoling');
player.storage.nshaoling=true;
event.targets=game.filterPlayer();
event.targets.remove(player);
event.targets.remove(target);
@ -4069,15 +4059,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
guihan:{
unique:true,
enable:'chooseToUse',
mark:true,
skillAnimation:'epic',
init:function(player){
player.storage.guihan=false;
},
limited:true,
filter:function(event,player){
if(event.type!='dying') return false;
if(player!=event.dying) return false;
if(player.storage.guihan) return false;
return true;
},
filterTarget:function(card,player,target){
@ -4087,7 +4073,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
"step 0"
player.awakenSkill('guihan');
player.recover();
player.storage.guihan=true;
"step 1"
player.draw(2);
"step 2"
@ -4115,9 +4100,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
threaten:function(player,target){
if(!target.storage.guihan) return 0.8;
}
},
intro:{
content:'limited'
}
},
luweiyan:{

View File

@ -143,18 +143,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
unique:true,
enable:'phaseUse',
filter:function(event,player){
return !player.storage.shenfen&&player.storage.baonu>=6;
},
init:function(player){
player.storage.shenfen=false;
return player.storage.baonu>=6;
},
skillAnimation:true,
animationColor:'metal',
mark:true,
limited:true,
content:function(){
"step 0"
player.awakenSkill('shenfen');
player.storage.shenfen=true;
player.storage.baonu-=6;
event.targets=game.filterPlayer();
event.targets.remove(player);
@ -175,9 +171,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.redo();
}
},
intro:{
content:'limited'
},
ai:{
order:10,
result:{
@ -845,12 +838,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:3,
animationColor:'fire',
skillAnimation:'legend',
filter:function(event,player){
return !player.storage.yeyan;
},
init:function(player){
player.storage.yeyan=false;
},
filterTarget:function(card,player,target){
var length=ui.selected.cards.length;
return (length==0||length==4);
@ -863,7 +850,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return true;
},
complexCard:true,
mark:true,
limited:true,
selectCard:[0,4],
line:'fire',
check:function(){return -1},
@ -884,9 +871,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
target.damage('fire','nocard');
}
},
intro:{
content:'limited'
},
ai:{
order:1,
result:{

View File

@ -7364,7 +7364,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
huanfeng:{
skillAnimation:'epic',
animationColor:'thunder',
trigger:{player:'phaseBegin'},
trigger:{player:'phaseBeginStart'},
forced:true,
unique:true,
filter:function(event,player){
@ -7392,7 +7392,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
hs:get.cards(4)
});
player.callSubPlayer(player.storage.huanfeng_end);
game.createTrigger('phaseBegin','shengdun',player,trigger);
// game.createTrigger('phaseBegin','shengdun',player,trigger);
},
// group:'huanfeng_end',
subSkill:{

View File

@ -43,6 +43,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
zuoci:['male','qun',3,['huashen','xinsheng']],
},
perfectPair:{
jiaxu:['liqueguosi'],
yuanshao:['yanwen'],
menghuo:['zhurong'],
sp_zhugeliang:['pangtong'],
@ -700,7 +701,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
unique:true,
priority:-10,
derivation:'guanxing',
trigger:{player:'phaseBegin'},
trigger:{player:'phaseBeginStart'},
forced:true,
filter:function(event,player){
if(player.storage.zhiji) return false;
@ -726,7 +727,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(player.hp>player.maxHp) player.hp=player.maxHp;
player.update();
player.addSkill('guanxing');
game.createTrigger('phaseBegin','guanxing',player,trigger);
}
},
xiangle:{
@ -1196,7 +1196,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:2,
derivation:['reyingzi','yinghun'],
unique:true,
trigger:{player:'phaseBegin'},
trigger:{player:'phaseBeginStart'},
filter:function(event,player){
return player.hp==1&&!player.storage.hunzi;
},
@ -1208,7 +1208,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.addSkill('yinghun');
player.awakenSkill('hunzi');
player.storage.hunzi=true;
game.createTrigger('phaseBegin','yinghun',player,trigger);
},
ai:{
threaten:function(player,target){
@ -1605,7 +1604,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
huashen2:{
audio:2,
trigger:{player:['phaseBegin','phaseEnd','huashenStart']},
trigger:{player:['phaseBeginStart','phaseEnd','huashenStart']},
filter:function(event,player,name){
if(name=='phaseBegin'&&game.phaseNumber==1) return false;
return true;
@ -1685,37 +1684,37 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
}
if(event.triggername=='phaseBegin'){
(function(){
var skills=[link];
var list=[];
game.expandSkills(skills);
var triggerevent=event._trigger;
var name='phaseBegin';
for(i=0;i<skills.length;i++){
var trigger=get.info(skills[i]).trigger;
if(trigger){
var add=false;
if(player==triggerevent.player&&trigger.player){
if(typeof trigger.player=='string'){
if(trigger.player==name) add=true;
}
else if(trigger.player.contains(name)) add=true;
}
if(trigger.global){
if(typeof trigger.global=='string'){
if(trigger.global==name) add=true;
}
else if(trigger.global.contains(name)) add=true;
}
if(add&&player.isOut()==false) list.push(skills[i]);
}
}
for(var i=0;i<list.length;i++){
game.createTrigger('phaseBegin',list[i],player,triggerevent);
}
}());
}
// if(event.triggername=='phaseBegin'){
// (function(){
// var skills=[link];
// var list=[];
// game.expandSkills(skills);
// var triggerevent=event._trigger;
// var name='phaseBegin';
// for(i=0;i<skills.length;i++){
// var trigger=get.info(skills[i]).trigger;
// if(trigger){
// var add=false;
// if(player==triggerevent.player&&trigger.player){
// if(typeof trigger.player=='string'){
// if(trigger.player==name) add=true;
// }
// else if(trigger.player.contains(name)) add=true;
// }
// if(trigger.global){
// if(typeof trigger.global=='string'){
// if(trigger.global==name) add=true;
// }
// else if(trigger.global.contains(name)) add=true;
// }
// if(add&&player.isOut()==false) list.push(skills[i]);
// }
// }
// for(var i=0;i<list.length;i++){
// game.createTrigger('phaseBegin',list[i],player,triggerevent);
// }
// }());
// }
}
}
if(type!='ai'){
@ -2596,16 +2595,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:2,
unique:true,
enable:'phaseUse',
filter:function(event,player){
return !player.storage.luanwu;
},
init:function(player){
player.storage.luanwu=false;
},
mark:true,
intro:{
content:'limited'
},
limited:true,
skillAnimation:'epic',
animationColor:'thunder',
filterTarget:function(card,player,target){
@ -2616,8 +2606,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
multiline:true,
content:function(){
"step 0"
player.unmarkSkill('luanwu')
player.storage.luanwu=true;
player.awakenSkill('luanwu');
event.current=player.next;
"step 1"
event.current.animate('target');
@ -3584,6 +3573,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){
trigger.directHit=true;
},
locked:false,
mod:{
attackFrom:function(from,to,distance){
if(get.zhu(from,'shouyue')) return distance-1;

View File

@ -2761,11 +2761,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
list.remove(players[i].name1);
list.remove(players[i].name2);
}
var dialog=ui.create.dialog('将武将牌替换为一名角色','hidden');
dialog.add([list.randomGets(5),'character']);
player.chooseButton(dialog,true).ai=function(button){
// var dialog=ui.create.dialog();
// dialog.add([list.randomGets(5),'character']);
player.chooseButton(true).set('ai',function(button){
return get.rank(button.link,true)-lib.character[button.link][2];
};
}).set('createDialog',['将武将牌替换为一名角色',[list.randomGets(5),'character']]);
player.awakenSkill('fuhan');
'step 1'
var num=player.storage.fanghun2;
@ -7540,7 +7540,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
else{
trigger.player.storage.zhoufu2_markcount=1;
trigger.player.updateMark('zhoufu2');
trigger.player.updateMarks();
}
}
},
@ -8649,13 +8649,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
unique:true,
enable:'phaseUse',
audio:2,
mark:true,
filter:function(event,player){
return !player.storage.xiongyi;
},
init:function(player){
player.storage.xiongyi=false;
},
limited:true,
filterTarget:function(card,player,target){
if(get.mode()=='guozhan'){
if(player==target) return true;
@ -8685,7 +8679,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
content:function(){
"step 0"
player.storage.xiongyi=true;
player.awakenSkill('xiongyi');
game.asyncDraw(targets,3);
"step 1"
@ -8700,9 +8693,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
}
},
intro:{
content:'limited'
},
ai:{
order:1,
result:{

View File

@ -3,6 +3,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return {
name:'yijiang',
connect:true,
connectBanned:['qinmi'],
character:{
caozhang:['male','wei',4,['jiangchi']],
guohuai:['male','wei',4,['jingce']],
@ -7706,9 +7707,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
luoying:{
unique:true,
gainable:true,
group:['luoying1','luoying2'],
},
luoying1:{
group:['luoying_discard','luoying_judge'],
subfrequent:['discard','judge'],
subSkill:{
discard:{
audio:2,
trigger:{global:'discardAfter'},
filter:function(event,player){
@ -7745,7 +7747,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
},
},
luoying2:{
judge:{
audio:2,
trigger:{global:'judgeAfter'},
frequent:'check',
@ -7761,6 +7763,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.gain(trigger.result.card,'log');
player.$gain2(trigger.result.card);
}
}
}
},
jiushi:{
group:['jiushi1','jiushi2','jiushi3'],
@ -9637,9 +9641,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
jujian:'举荐',
xinjujian:'举荐',
luoying:'落英',
luoying1:'落英',
luoying2:'落英',
luoying2_noconf:'落英·判定',
luoying_discard:'落英',
luoying_judge:'落英',
luoying_judge_noconf:'落英·判定',
jiushi:'酒诗',
jiushi1:'酒诗',
jiushi2:'酒诗',

View File

@ -1,5 +1,5 @@
window.noname_asset_list=[
'1.9.51',
'1.9.54',
'audio/background/music_danji.mp3',
'audio/background/music_default.mp3',
'audio/background/music_diaochan.mp3',
@ -733,10 +733,10 @@ window.noname_asset_list=[
'audio/skill/luoyan4.mp3',
'audio/skill/luoyi1.mp3',
'audio/skill/luoyi2.mp3',
'audio/skill/luoying11.mp3',
'audio/skill/luoying12.mp3',
'audio/skill/luoying21.mp3',
'audio/skill/luoying22.mp3',
'audio/skill/luoying_discard1.mp3',
'audio/skill/luoying_discard2.mp3',
'audio/skill/luoying_judge1.mp3',
'audio/skill/luoying_judge2.mp3',
'audio/skill/manjuan.mp3',
'audio/skill/mazui.mp3',
'audio/skill/meibu1.mp3',
@ -1796,6 +1796,7 @@ window.noname_asset_list=[
'image/character/lingcao.jpg',
'image/character/lingju.jpg',
'image/character/lingtong.jpg',
'image/character/liqueguosi.jpg',
'image/character/liru.jpg',
'image/character/litong.jpg',
'image/character/liubei.jpg',
@ -2894,5 +2895,5 @@ window.noname_skin_list={
zhugeliang:5,
zhuran:1,
zhurong:3,
zuoci:3
zuoci:4
};

View File

@ -9,6 +9,7 @@ var updates=window.noname_update;
var assetlist='';
var skinlist='window.noname_skin_list={\n';
var entrylist=[];
var entrymap={};
var get = function(dir,callback){
fs.readdir(dir,function(err,list){
var shift=function(){
@ -37,6 +38,7 @@ var get = function(dir,callback){
}
}
skinlist+='\t'+filename+':'+num+',\n';
entrymap[filename]=num;
shift();
});
delay=true;
@ -69,6 +71,20 @@ get(path.dirname(__dirname),function(){
break;
}
}
if(!diff){
for(var i in entrymap){
if(window.noname_skin_list[i]!==entrymap[i]){
diff=true;
break;
}
}
for(var i in noname_skin_list){
if(window.noname_skin_list[i]!==entrymap[i]){
diff=true;
break;
}
}
}
}
else{
diff=true;

View File

@ -20,7 +20,7 @@
};
var lib={
configprefix:'noname_0.9_',
versionOL:26,
versionOL:27,
updateURL:'https://raw.githubusercontent.com/libccy/noname',
mirrorURL:'https://gitlab.com/isgs/noname/raw',
hallURL:'noname.pub',
@ -9026,7 +9026,6 @@
setting:"设置",
start:"开始",
random:"随机",
_phasebegin:'回合开始',
_out:'无效',
agree:'同意',
refuse:'拒绝',
@ -9099,6 +9098,58 @@
},
element:{
content:{
phasing:function(){
'step 0'
while(ui.dialogs.length){
ui.dialogs[0].close();
}
if(!player.noPhaseDelay&&lib.config.show_phase_prompt){
player.popup('回合开始');
}
if(lib.config.glow_phase){
if(_status.currentPhase){
_status.currentPhase.classList.remove('glow_phase');
game.broadcast(function(player){
player.classList.remove('glow_phase');
},_status.currentPhase);
}
player.classList.add('glow_phase');
game.broadcast(function(player){
player.classList.add('glow_phase');
},player);
}
_status.currentPhase=player;
_status.discarded=[];
game.phaseNumber++;
game.syncState();
game.addVideo('phaseChange',player);
if(game.phaseNumber==1&&lib.configOL.observe){
lib.configOL.observeReady=true;
game.send('server','config',lib.configOL);
}
game.log();
game.log(player,'的回合开始');
player._noVibrate=true;
if(get.config('identity_mode')!='zhong'&&!_status.connectMode){
var num;
switch(get.config('auto_identity')){
case 'one':num=1;break;
case 'two':num=2;break;
case 'three':num=3;break;
case 'always':num=-1;break;
default:num=0;break;
}
if(num&&!_status.identityShown&&game.phaseNumber>game.players.length*num&&game.showIdentity){
if(!_status.video) player.popup('显示身份');
_status.identityShown=true;
game.showIdentity(false);
}
}
player.ai.tempIgnore=[];
player.stat.push({card:{},skill:{}});
'step 1'
event.trigger('phaseBeginStart');
},
toggleSubPlayer:function(){
'step 0'
var list=event.list||player.storage.subplayer.skills.slice(0);
@ -9486,8 +9537,23 @@
},
createTrigger:function(){
"step 0"
if(player._hookTrigger){
for(var i=0;i<player._hookTrigger.length;i++){
var info=lib.skill[player._hookTrigger[i]].hookTrigger;
if(info){
if(info.before&&info.before(event,player,event.triggername)){
event.trigger('triggerBefore');
break;
}
}
}
}
"step 1"
var info=get.info(event.skill);
if(info.filter&&!info.filter(trigger,player,event.triggername)){
if(event.cancelled){
event.finish();
}
else if(info.filter&&!info.filter(trigger,player,event.triggername)){
event.finish();
}
else if(event._trigger._notrigger.contains(player)&&!lib.skill.global.contains(event.skill)){
@ -9501,6 +9567,8 @@
event.finish();
}
else{
var fullskills=game.expandSkills(player.getSkills().concat(lib.skill.global));
if(!fullskills.contains(event.skill)){
var hidden=player.hiddenSkills.slice(0);
game.expandSkills(hidden);
if(hidden.contains(event.skill)){
@ -9514,22 +9582,20 @@
event.skillHidden=true;
}
}
}
"step 1"
if(event.cancelled){
else{
event.finish();
}
else{
event.trigger('triggerBefore');
}
}
"step 2"
var info=get.info(event.skill);
if(event.cancelled){
event.finish();
return;
}
var info=get.info(event.skill);
if(!event.revealed&&!info.forced){
var checkFrequent=function(info){
if(player.hasSkillTag('nofrequent',false,event.skill)) return false;
if(typeof info.frequent=='boolean') return info.frequent;
if(typeof info.frequent=='function') return info.frequent(trigger,player);
if(info.frequent=='check'&&typeof info.check=='function') return info.check(trigger,player);
@ -9538,15 +9604,18 @@
if(info.direct&&player.isUnderControl()){
game.modeSwapPlayer(player);
event._result={bool:true};
event._direct=true;
}
else if(checkFrequent(info)&&!lib.config.autoskilllist.contains(event.skill)){
event._result={bool:true};
}
else if(info.direct){
event._result={bool:true};
event._direct=true;
}
else if(info.direct&&player.isOnline()){
event._result={bool:true};
event._direct=true;
}
else{
var str;
@ -9581,7 +9650,8 @@
}
"step 3"
var info=get.info(event.skill);
if(result&&result.bool!=false&&info.autodelay&&(info.forced||!event.isMine())){
if(result&&result.bool!=false){
if(info.autodelay&&(info.forced||!event.isMine())){
if(typeof info.autodelay=='number'){
game.delayx(info.autodelay);
}
@ -9589,10 +9659,12 @@
game.delayx();
}
}
}
"step 4"
var info=get.info(event.skill);
if(result&&result.bool==false){
if(info.oncancel) info.oncancel(trigger,player);
event.finish();
return;
}
var next=game.createEvent(event.skill);
@ -9632,6 +9704,18 @@
}
}
}
"step 5"
if(player._hookTrigger){
for(var i=0;i<player._hookTrigger.length;i++){
var info=lib.skill[player._hookTrigger[i]].hookTrigger;
if(info){
if(info.after&&info.after(event,player,event.triggername)){
event.trigger('triggerAfter');
break;
}
}
}
}
},
playVideoContent:function(){
'step 0'
@ -13988,11 +14072,12 @@
},
smoothAvatar:function(vice,video){
var div=ui.create.div('.fullsize');
div.style.background=getComputedStyle(this.node.avatar).background;
if(vice){
div.style.background=getComputedStyle(this.node.avatar2).background;
this.node.avatar2.appendChild(div);
}
else{
div.style.background=getComputedStyle(this.node.avatar).background;
this.node.avatar.appendChild(div);
}
ui.refresh(div);
@ -14641,6 +14726,16 @@
countCards:function(arg1,arg2){
return this.getCards(arg1,arg2).length;
},
getOriginalSkills:function(){
var skills=[];
if(lib.character[this.name]&&!this.isUnseen(0)){
skills.addArray(lib.character[this.name][3]);
}
if(this.name2&&lib.character[this.name2]&&!this.isUnseen(1)){
skills.addArray(lib.character[this.name2][3]);
}
return skills;
},
getSkills:function(arg2,arg3,arg4){
var skills=this.skills.slice(0);
var es=[];
@ -16923,6 +17018,14 @@
else if(info&&info.logv!==false){
game.logv(this,name,targets);
}
if(this._hookTrigger){
for(var i=0;i<this._hookTrigger.length;i++){
var info=lib.skill[this._hookTrigger[i]].hookTrigger;
if(info&&info.log){
info.log(this,name,targets);
}
}
}
},
unprompt:function(){
if(this.node.prompt){
@ -17471,6 +17574,12 @@
}
}
}
if(info.hookTrigger){
if(!this._hookTrigger){
this._hookTrigger=[];
}
this._hookTrigger.add(skill);
}
return this;
},
addSkillLog:function(skill){
@ -17597,6 +17706,14 @@
if(!nounmark) this.unmarkSkill(skill);
this.disableSkill(skill+'_awake',skill);
this.awakenedSkills.add(skill);
if(this.storage[skill]===false) this.storage[skill]=true;
return this;
},
restoreSkill:function(skill,nomark){
if(this.storage[skill]===true) this.storage[skill]=false;
this.awakenedSkills.remove(skill);
this.enableSkill(skill+'_awake',skill);
if(!nomark) this.markSkill(skill);
return this;
},
disableSkill:function(skill,skills){
@ -17729,6 +17846,14 @@
}
}
}
if(info.hookTrigger){
if(this._hookTrigger){
this._hookTrigger.remove(skill);
if(!this._hookTrigger.length){
delete this._hookTrigger;
}
}
}
return this;
},
removeSkill:function(skill){
@ -21808,61 +21933,6 @@
}
},
},
_phasebegin:{
trigger:{player:'phaseBegin'},
forced:true,
priority:100,
popup:false,
content:function(){
while(ui.dialogs.length){
ui.dialogs[0].close();
}
if(!player.noPhaseDelay&&lib.config.show_phase_prompt){
player.popup('回合开始');
}
if(lib.config.glow_phase){
if(_status.currentPhase){
_status.currentPhase.classList.remove('glow_phase');
game.broadcast(function(player){
player.classList.remove('glow_phase');
},_status.currentPhase);
}
player.classList.add('glow_phase');
game.broadcast(function(player){
player.classList.add('glow_phase');
},player);
}
_status.currentPhase=player;
_status.discarded=[];
game.phaseNumber++;
game.syncState();
game.addVideo('phaseChange',player);
if(game.phaseNumber==1&&lib.configOL.observe){
lib.configOL.observeReady=true;
game.send('server','config',lib.configOL);
}
game.log();
game.log(player,'的回合开始');
player._noVibrate=true;
if(get.config('identity_mode')!='zhong'&&!_status.connectMode){
var num;
switch(get.config('auto_identity')){
case 'one':num=1;break;
case 'two':num=2;break;
case 'three':num=3;break;
case 'always':num=-1;break;
default:num=0;break;
}
if(num&&!_status.identityShown&&game.phaseNumber>game.players.length*num&&game.showIdentity){
if(!_status.video) player.popup('显示身份');
_status.identityShown=true;
game.showIdentity(false);
}
}
player.ai.tempIgnore=[];
player.stat.push({card:{},skill:{}});
},
},
_usecard:{
trigger:{global:'useCardAfter'},
forced:true,
@ -27205,9 +27275,17 @@
}
else if(event._triggered==1){
if(event.type=='card') event.trigger('useCardToBegin');
if(event.name=='phase'&&!event._begun){
var next=game.createEvent('phasing',false,event);
next.player=event.player;
next.setContent('phasing');
event._begun=true;
}
else{
event.trigger(event.name+'Begin');
event._triggered++;
}
}
else{
if(player&&player.classList.contains('dead')&&!event.forceDie&&event.name!='phaseLoop'){
game.broadcastAll(function(){
@ -28789,6 +28867,15 @@
lib.translate[i+'_info']=lib.translate[info.inherit+'_info'];
}
}
if(info.limited){
if(info.mark===undefined) info.mark=true;
if(!info.intro) info.intro={};
if(info.intro.content===undefined) info.intro.content='limited';
if(info.skillAnimation===undefined) info.skillAnimation=true;
if(info.init===undefined) info.init=function(player){
player.storage[i]=false;
}
}
if(info.subSkill&&!sub){
for(var j in info.subSkill){
lib.skill[i+'_'+j]=info.subSkill[j];
@ -42482,11 +42569,22 @@
},
autoskill2:function(e){
this.classList.toggle('on');
var list=[];
if(lib.skill[this.link].frequent){
list.push(this.link);
}
if(lib.skill[this.link].subfrequent){
for(var i=0;i<lib.skill[this.link].subfrequent.length;i++){
list.push(this.link+'_'+lib.skill[this.link].subfrequent[i]);
}
}
for(var i=0;i<list.length;i++){
if(this.classList.contains('on')){
lib.config.autoskilllist.remove(this.link);
lib.config.autoskilllist.remove(list[i]);
}
else{
lib.config.autoskilllist.add(this.link);
lib.config.autoskilllist.add(list[i]);
}
}
game.saveConfig('autoskilllist',lib.config.autoskilllist);
ui.click.touchpop();
@ -45219,9 +45317,21 @@
else if(lib.skill[skills[i]].temp||!node.skills.contains(skills[i])||lib.skill[skills[i]].thundertext){
uiintro.add('<div><div class="skill thundertext thunderauto">【'+translation+'】</div><div class="thundertext thunderauto">'+get.skillInfoTranslation(skills[i])+'</div></div>');
}
else if(lib.skill[skills[i]].frequent){
else if(lib.skill[skills[i]].frequent||lib.skill[skills[i]].subfrequent){
uiintro.add('<div><div class="skill">【'+translation+'】</div><div>'+get.skillInfoTranslation(skills[i])+'<br><div class="underlinenode on gray" style="position:relative;padding-left:0;padding-top:7px">自动发动</div></div></div>');
var underlinenode=uiintro.content.lastChild.querySelector('.underlinenode');
if(lib.skill[skills[i]].frequent){
if(lib.config.autoskilllist.contains(skills[i])){
underlinenode.classList.remove('on');
}
}
if(lib.skill[skills[i]].subfrequent){
for(var j=0;j<lib.skill[skills[i]].subfrequent.length;j++){
if(lib.config.autoskilllist.contains(skills[i]+'_'+lib.skill[skills[i]].subfrequent[j])){
underlinenode.classList.remove('on');
}
}
}
if(lib.config.autoskilllist.contains(skills[i])){
underlinenode.classList.remove('on');
}

View File

@ -1,19 +1,19 @@
window.noname_update={
version:'1.9.53.1',
update:'1.9.53',
version:'1.9.54',
update:'1.9.53.1',
changeLog:[
'bug修复'
],
players:[
'sunshangxiang'
'变包武将'
],
files:[
'card/standard.js',
'character/gwent.js',
'character/rank.js',
'character/standard.js',
'character/diy.js',
'character/extra.js',
'character/hearth.js',
'character/shenhua.js',
'character/sp.js',
'character/yijiang.js',
'layout/mobile/equip.css',
'layout/newlayout/equip.css'
'game/asset.js',
'game/directory.js',
'game/game.js',
'mode/guozhan.js'
]
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
image/skin/zuoci/4.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

View File

@ -267,9 +267,359 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
gz_jun_liubei:['male','shu',4,['zhangwu','jizhao','shouyue','wuhujiangdaqi']],
gz_jun_zhangjiao:['male','qun',4,['wuxin','hongfa','wendao','huangjintianbingfu']],
gz_liqueguosi:['male','qun',4,['xiongsuan']],
gz_zuoci:['male','qun',3,['gzhuashen','gzxinsheng']],
}
},
skill:{
gzxinsheng:{
trigger:{player:'damageEnd'},
frequent:true,
content:function(){
game.log(player,'获得了一张','#g化身');
lib.skill.gzhuashen.addCharacter(player,_status.characterlist.randomGet());
game.delayx();
}
},
gzhuashen:{
unique:true,
group:['gzhuashen_add','gzhuashen_swap','gzhuashen_remove','gzhuashen_disallow','gzhuashen_flash'],
init:function(player){
player.storage.gzhuashen=[];
player.storage.gzhuashen_removing=[];
player.storage.gzhuashen_trigger=[];
player.storage.gzhuashen_map={};
},
onremove:function(player){
delete player.storage.gzhuashen;
delete player.storage.gzhuashen_removing;
delete player.storage.gzhuashen_trigger;
delete player.storage.gzhuashen_map;
},
ondisable:true,
mark:true,
intro:{
mark:function(dialog,storage,player){
if(storage&&storage.length){
if(player.isUnderControl(true)){
dialog.addSmall([storage,'character']);
var skills=[];
for(var i in player.storage.gzhuashen_map){
skills.addArray(player.storage.gzhuashen_map[i]);
}
dialog.addText('可用技能:'+(skills.length?get.translation(skills):'无'));
}
else{
return '共有'+get.cnNumber(storage.length)+'张“化身”'
}
}
else{
return '没有化身';
}
},
content:function(storage,player){
if(player.isUnderControl(true)){
var skills=[];
for(var i in player.storage.gzhuashen_map){
skills.addArray(player.storage.gzhuashen_map[i]);
}
return get.translation(storage)+';可用技能:'+(skills.length?get.translation(skills):'无');
}
else{
return '共有'+get.cnNumber(storage.length)+'张“化身”'
}
}
},
filterSkill:function(name){
var skills=lib.character[name][3].slice(0);
for(var i=0;i<skills.length;i++){
var info=lib.skill[skills[i]];
if(info.unique||info.limited||info.mainSkill||info.viceSkill||get.is.locked(skills[i])){
skills.splice(i--,1);
}
}
return skills;
},
addCharacter:function(player,name){
var skills=lib.skill.gzhuashen.filterSkill(name);
if(skills.length){
player.storage.gzhuashen_map[name]=skills;
for(var i=0;i<skills.length;i++){
player.addAdditionalSkill('gzhuashen',skills[i],true);
}
}
player.storage.gzhuashen.add(name);
player.updateMarks('gzhuashen');
_status.characterlist.remove(name);
},
removeCharacter:function(player,name){
var skills=lib.skill.gzhuashen.filterSkill(name);
if(skills.length){
delete player.storage.gzhuashen_map[name];
for(var i=0;i<skills.length;i++){
var remove=true;
for(var j in player.storage.gzhuashen_map){
if(j!=name&&game.expandSkills(player.storage.gzhuashen_map[j].slice(0)).contains(skills[i])){
remove=false;break;
}
}
if(remove){
player.removeAdditionalSkill('gzhuashen',skills[i]);
player.storage.gzhuashen_removing.remove(skills[i]);
}
}
}
player.storage.gzhuashen.remove(name);
player.updateMarks('gzhuashen');
_status.characterlist.add(name);
},
getSkillSources:function(player,skill){
if(player.getStockSkills().contains(skill)) return [];
var sources=[];
for(var i in player.storage.gzhuashen_map){
if(game.expandSkills(player.storage.gzhuashen_map[i].slice(0)).contains(skill)) sources.push(i);
}
return sources;
},
subfrequent:['add'],
subSkill:{
add:{
trigger:{player:'phaseBeginStart'},
frequent:true,
filter:function(event,player){
return player.storage.gzhuashen.length<2;
},
content:function(){
'step 0'
var list=_status.characterlist.randomGets(5);
if(!list.length){
event.finish();
return;
}
player.chooseButton([1,2]).set('ai',function(button){
return get.rank(button.link,true);
}).set('createDialog',['选择至多两张武将牌作为“化身”',[list,'character']]);
'step 1'
if(result.bool){
for(var i=0;i<result.links.length;i++){
lib.skill.gzhuashen.addCharacter(player,result.links[i]);
}
game.delayx();
player.addTempSkill('gzhuashen_triggered');
game.log(player,'获得了'+get.cnNumber(result.links.length)+'张','#g化身');
}
}
},
swap:{
trigger:{player:'phaseBeginStart'},
direct:true,
filter:function(event,player){
if(player.hasSkill('gzhuashen_triggered')) return false;
return player.storage.gzhuashen.length>=2;
},
content:function(){
'step 0'
var list=player.storage.gzhuashen.slice(0);
if(!list.length){
event.finish();
return;
}
player.chooseButton().set('ai',function(){
return Math.random()-0.3;
}).set('createDialog',['是否替换一张“化身”?',[list,'character']]);
'step 1'
if(result.bool){
player.logSkill('gzhuashen');
game.log(player,'替换了一张','#g化身');
lib.skill.gzhuashen.removeCharacter(player,result.links[0]);
lib.skill.gzhuashen.addCharacter(player,_status.characterlist.randomGet());
game.delayx();
}
}
},
triggered:{},
flash:{
hookTrigger:{
log:function(player,skill){
var sources=lib.skill.gzhuashen.getSkillSources(player,skill);
if(sources.length){
player.flashAvatar('gzhuashen',sources.randomGet());
player.storage.gzhuashen_removing.add(skill);
}
}
},
trigger:{player:['useSkillBegin','useCard','respond']},
silent:true,
filter:function(event,player){
return event.skill&&lib.skill.gzhuashen.getSkillSources(player,event.skill).length>0;
},
content:function(){
lib.skill.gzhuashen_flash.hookTrigger.log(player,trigger.skill);
}
},
clear:{
trigger:{player:'phaseAfter'},
silent:true,
content:function(){
player.storage.gzhuashen_trigger.length=0;
}
},
disallow:{
trigger:{player:['triggerBefore']},
silent:true,
hookTrigger:{
before:function(event,player,name){
for(var i=0;i<player.storage.gzhuashen_trigger.length;i++){
var info=player.storage.gzhuashen_trigger[i];
if(info[0]==event._trigger&&info[1]==name){
return true;
}
}
return false;
}
},
content:function(){
trigger.cancelled=true;
}
},
remove:{
trigger:{player:['useSkillAfter','useCardAfter','respondAfter','triggerAfter']},
hookTrigger:{
after:function(event,player){
if(event._direct&&!player.storage.gzhuashen_removing.contains(event.skill)) return false;
return lib.skill.gzhuashen.getSkillSources(player,event.skill).length>0;
}
},
silent:true,
filter:function(event,player){
return event.skill&&lib.skill.gzhuashen.getSkillSources(player,event.skill).length>0;
},
content:function(){
'step 0'
if(trigger.name=='trigger'){
player.storage.gzhuashen_trigger.push([trigger._trigger,trigger.triggername]);
}
var sources=lib.skill.gzhuashen.getSkillSources(player,trigger.skill);
if(sources.length==1){
event.directresult=sources[0];
}
else{
player.chooseButton(true).set('createDialog',['移除一张“化身”牌',[sources,'character']]);
}
'step 1'
if(!event.directresult&&result&&result.links[0]){
event.directresult=result.links[0];
}
// game.broadcastAll(function(name){
// var img=name;
// if(img.indexOf('gz_')==0){
// img=name.slice(3);
// }
// lib.card['gzhuashen_'+name]={
// fullborder:'bronze',
// image:'character/'+img
// }
// lib.translate['gzhuashen_'+name]=lib.translate[name];
// },event.directresult);
// 'step 2'
var name=event.directresult;
lib.skill.gzhuashen.removeCharacter(player,name);
// player.$throw(game.createCard('gzhuashen_'+name),'','');
game.log(player,'移除了化身牌','#g'+get.translation(name));
// game.delayx(2);
}
}
},
ai:{
nofrequent:true,
skillTagFilter:function(player,tag,arg){
if(arg&&player.storage.gzhuashen){
if(lib.skill.gzhuashen.getSkillSources(player,arg).length>0){
return true;
}
}
return false;
}
}
},
xiongsuan:{
limited:true,
enable:'phaseUse',
filterCard:true,
filter:function(event,player){
return player.countCards('h');
},
filterTarget:function(card,player,target){
return target.sameIdentityAs(player);
},
check:function(card){
return 7-get.value(card);
},
content:function(){
'step 0'
player.awakenSkill('xiongsuan');
target.damage();
'step 1'
player.draw(3);
var list=[];
var skills=target.getOriginalSkills();
for(var i=0;i<skills.length;i++){
if(lib.skill[skills[i]].limited&&target.awakenedSkills.contains(skills[i])){
list.push(skills[i]);
}
}
if(list.length==1){
target.storage.xiongsuan_restore=list[0];
target.addTempSkill('xiongsuan_restore','phaseBegin');
event.finish();
}
else if(list.length>1){
player.chooseControl(list).set('prompt','选择一个限定技在回合结束后重置之');
}
else{
event.finish();
}
'step 2'
target.storage.xiongsuan_restore=result.control;
target.addTempSkill('xiongsuan_restore','phaseBegin');
},
subSkill:{
restore:{
trigger:{player:'phaseAfter'},
silent:true,
content:function(){
player.restoreSkill(player.storage.xiongsuan_restore);
}
}
},
ai:{
order:4,
damage:true,
result:{
target:function(player,target){
if(get.damageEffect(target,player,player)>0) return 10;
if(target.hp>1){
var skills=target.getOriginalSkills();
for(var i=0;i<skills.length;i++){
if(lib.skill[skills[i]].limited&&target.awakenedSkills.contains(skills[i])){
return 8;
}
}
}
if(target.hp>=4) return 5;
if(target.hp==3){
if(player.countCards('h')<=2&&game.hasPlayer(function(current){
return current.hp<=1&&get.attitude(player,current)<0;
})){
return 3;
}
}
return 0;
}
}
}
},
gzsuishi:{
audio:'suishi',
trigger:{global:'dying'},
@ -489,6 +839,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}
},
huangjintianbingfu:{
unique:true,
forceunique:true,
nopop:true,
mark:true,
intro:{
@ -842,6 +1194,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
},
gzjixi:{
inherit:'jixi',
mainSkill:true,
init:function(player){
if(player.checkMainSkill('gzjixi')){
player.removeMaxHp();
@ -856,6 +1209,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
init:function(player){
player.checkViceSkill('ziliang');
},
viceSkill:true,
direct:true,
content:function(){
'step 0'
@ -872,7 +1226,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
player.unmarkSkill('tuntian');
}
else{
player.updateMarks();
player.updateMarks('tuntian');
}
trigger.player.gain(card);
if(trigger.player==player){
@ -954,6 +1308,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
init:function(player){
player.checkMainSkill('tianfu');
},
mainSkill:true,
inherit:'kanpo',
zhenfa:'inline',
viewAsFilter:function(player){
@ -966,6 +1321,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
player.removeMaxHp();
}
},
viceSkill:true,
inherit:'guanxing',
filter:function(event,player){
return !player.hasSkill('guanxing');
@ -1171,6 +1527,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
init:function(player){
player.checkMainSkill('baoling');
},
mainSkill:true,
forced:true,
filter:function(event,player){
return player.hasViceCharacter();
@ -1679,7 +2036,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
},
},
_mingzhi1:{
trigger:{player:'phaseBegin'},
trigger:{player:'phaseBeginStart'},
priority:19,
forced:true,
popup:false,
@ -2766,6 +3123,14 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
gz_jun_liubei:'君刘备',
gz_jun_zhangjiao:'君张角',
gz_liqueguosi:'李傕郭汜',
xiongsuan:'凶算',
xiongsuan_info:'限定技出牌阶段你可以弃置一张手牌并选择与你势力相同的一名角色对其造成1点伤害然后你摸三张牌。若该角色有已发动的限定技则你选择其中一个限定技此回合结束后视为该限定技未发动过。',
gzhuashen:'化身',
gzhuashen_info:'准备阶段开始时,若你的“化身”不足两张,则你可以观看剩余武将牌堆中的五张牌,然后扣置其中至多两张武将牌在你的武将旁,称为“化身”;若“化身”有两张以上,则你可以用剩余武将牌堆顶的一张牌替换一张“化身”。你可以于相应的时机明置并发动“化身”的一个技能,技能结算完成后将该“化身”放回剩余武将牌堆。你每个时机只能发动一张“化身”的技能,且不能发动带有技能类型的技能(锁定技、限定技等)。',
gzxinsheng:'新生',
gzxinsheng_info:'当你受到伤害后,你可以从剩余武将牌堆中扣置一张牌加入到“化身”牌中。',
wuxin:'悟心',
wuxin_info:'摸牌阶段开始时你可以观看牌堆顶的X张牌X为群势力角色的数量然后将这些牌以任意顺序置于牌堆顶',
@ -3069,6 +3434,18 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}
},
player:{
sameIdentityAs:function(target){
if(this==target) return true;
if(target.identity=='unknown'||target.identity=='ye') return false;
if(this.identity=='unknown'){
var identity=lib.character[this.name1][1];
if(this.wontYe()) return identity==target.identity;
return false;
}
else{
return this.identity==target.identity;
}
},
getModeState:function(){
return {
unseen:this.isUnseen(0),