Merge pull request #476 from libccy/PR-Branch

v1.10.3.1
This commit is contained in:
Spmario233 2023-10-06 00:57:41 +08:00 committed by GitHub
commit 42983613a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 148 additions and 193 deletions

View File

@ -590,8 +590,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
skillAnimation:true, skillAnimation:true,
animationColor:'orange', animationColor:'orange',
filter:function(event,player){ filter:function(event,player){
return true; return player.getStorage('dctuoyu').length==3;
//return player.getStorage('dctuoyu').length==3;
}, },
content:function(){ content:function(){
'step 0' 'step 0'

View File

@ -14881,7 +14881,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
zhaotongzhaoguang:"手杀赵统赵广", zhaotongzhaoguang:"手杀赵统赵广",
zhaotongzhaoguang_prefix:'手杀', zhaotongzhaoguang_prefix:'手杀',
re_liru:'手杀李儒', re_liru:'手杀李儒',
re_liru_prefix:'李儒', re_liru_prefix:'手杀',
re_chenqun:'手杀陈群', re_chenqun:'手杀陈群',
re_chenqun_prefix:'手杀', re_chenqun_prefix:'手杀',
old_yuanshu:'手杀袁术', old_yuanshu:'手杀袁术',

View File

@ -1,5 +1,5 @@
window.noname_asset_list=[ window.noname_asset_list=[
'v1.10.2.1', 'v1.10.3.1',
/*audio start*/ /*audio start*/
'audio/background/aozhan_chaoming.mp3', 'audio/background/aozhan_chaoming.mp3',
'audio/background/aozhan_online.mp3', 'audio/background/aozhan_online.mp3',
@ -724,6 +724,7 @@ window.noname_asset_list=[
'audio/die/re_taishici.mp3', 'audio/die/re_taishici.mp3',
'audio/die/re_taoqian.mp3', 'audio/die/re_taoqian.mp3',
'audio/die/re_weiyan.mp3', 'audio/die/re_weiyan.mp3',
'audio/die/re_wenpin.mp3',
'audio/die/re_wuguotai.mp3', 'audio/die/re_wuguotai.mp3',
'audio/die/re_wuyi.mp3', 'audio/die/re_wuyi.mp3',
'audio/die/re_xiahoudun.mp3', 'audio/die/re_xiahoudun.mp3',
@ -753,6 +754,7 @@ window.noname_asset_list=[
'audio/die/re_zhaoyun.mp3', 'audio/die/re_zhaoyun.mp3',
'audio/die/re_zhenji.mp3', 'audio/die/re_zhenji.mp3',
'audio/die/re_zhonghui.mp3', 'audio/die/re_zhonghui.mp3',
'audio/die/re_zhongyao.mp3',
'audio/die/re_zhoucang.mp3', 'audio/die/re_zhoucang.mp3',
'audio/die/re_zhouyu.mp3', 'audio/die/re_zhouyu.mp3',
'audio/die/re_zhugeliang.mp3', 'audio/die/re_zhugeliang.mp3',
@ -2679,6 +2681,8 @@ window.noname_asset_list=[
'audio/skill/huoji2.mp3', 'audio/skill/huoji2.mp3',
'audio/skill/huomo_huzhao1.mp3', 'audio/skill/huomo_huzhao1.mp3',
'audio/skill/huomo_huzhao2.mp3', 'audio/skill/huomo_huzhao2.mp3',
'audio/skill/huomo_re_zhongyao1.mp3',
'audio/skill/huomo_re_zhongyao2.mp3',
'audio/skill/huomo1.mp3', 'audio/skill/huomo1.mp3',
'audio/skill/huomo2.mp3', 'audio/skill/huomo2.mp3',
'audio/skill/huoshou1_re_menghuo1.mp3', 'audio/skill/huoshou1_re_menghuo1.mp3',
@ -5734,6 +5738,8 @@ window.noname_asset_list=[
'audio/skill/zhenshan2.mp3', 'audio/skill/zhenshan2.mp3',
'audio/skill/zhente1.mp3', 'audio/skill/zhente1.mp3',
'audio/skill/zhente2.mp3', 'audio/skill/zhente2.mp3',
'audio/skill/zhenwei_re_wenpin1.mp3',
'audio/skill/zhenwei_re_wenpin2.mp3',
'audio/skill/zhenwei1.mp3', 'audio/skill/zhenwei1.mp3',
'audio/skill/zhenwei2.mp3', 'audio/skill/zhenwei2.mp3',
'audio/skill/zhiba2_re_sunben1.mp3', 'audio/skill/zhiba2_re_sunben1.mp3',
@ -5888,6 +5894,8 @@ window.noname_asset_list=[
'audio/skill/zuixiang.mp3', 'audio/skill/zuixiang.mp3',
'audio/skill/zunwei1.mp3', 'audio/skill/zunwei1.mp3',
'audio/skill/zunwei2.mp3', 'audio/skill/zunwei2.mp3',
'audio/skill/zuoding_re_zhongyao1.mp3',
'audio/skill/zuoding_re_zhongyao2.mp3',
'audio/skill/zuoding1.mp3', 'audio/skill/zuoding1.mp3',
'audio/skill/zuoding2.mp3', 'audio/skill/zuoding2.mp3',
'audio/skill/zuoxing1.mp3', 'audio/skill/zuoxing1.mp3',

View File

@ -26111,60 +26111,72 @@
return list; return list;
}, },
addSkillTrigger:function(skill,hidden,triggeronly){ addSkillTrigger:function(skill,hidden,triggeronly){
let skills=game.expandSkills([skill]); var info=lib.skill[skill];
for(let skill of skills){ if(!info) return;
let info=lib.skill[skill]; if(typeof info.group=='string'){
if(!info){ this.addSkillTrigger(info.group,hidden);
console.trace(`Cannot find skill: ${skill}\nPlease check if game.expandSkills is overwritten`);
continue;
}
if(!triggeronly){
if(info.global&&(!hidden||info.globalSilent)){
if(typeof info.global=='string'){
game.addGlobalSkill(info.global,this);
}
else{
for(let j=0;j<info.global.length;j++){
game.addGlobalSkill(info.global[j],this);
}
}
}
if(this.initedSkills.contains(skill)) return this;
this.initedSkills.push(skill);
if(info.init&&!_status.video) info.init(this,skill);
}
if(info.trigger&&this.playerid){
let playerid=this.playerid;
let setTrigger=function(i,evt){
if(i=='global'){
if(!lib.hook.globaltrigger[evt]){
lib.hook.globaltrigger[evt]={};
}
if(!lib.hook.globaltrigger[evt][playerid]){
lib.hook.globaltrigger[evt][playerid]=[];
}
lib.hook.globaltrigger[evt][playerid].add(skill);
}
else{
let name=playerid+'_'+i+'_'+evt;
if(!lib.hook[name]) lib.hook[name]=[];
lib.hook[name].add(skill);
}
lib.hookmap[evt]=true;
}
for(let i in info.trigger){
if(typeof info.trigger[i]=='string') setTrigger(i,info.trigger[i]);
else if(Array.isArray(info.trigger[i])){
for(let trigger of info.trigger[i]) setTrigger(i,trigger);
}
}
}
if(info.hookTrigger){
if(!this._hookTrigger) this._hookTrigger=[];
this._hookTrigger.add(skill);
}
if(_status.event&&_status.event.addTrigger) _status.event.addTrigger(skill,this);
} }
else if(Array.isArray(info.group)){
for(var i=0;i<info.group.length;i++){
this.addSkillTrigger(info.group[i],hidden);
}
}
if(!triggeronly){
if(info.global&&(!hidden||info.globalSilent)){
if(typeof info.global=='string'){
game.addGlobalSkill(info.global,this);
}
else{
for(var j=0;j<info.global.length;j++){
game.addGlobalSkill(info.global[j],this);
}
}
}
if(this.initedSkills.contains(skill)) return this;
this.initedSkills.push(skill);
if(info.init&&!_status.video){
info.init(this,skill);
}
}
if(info.trigger&&this.playerid){
var playerid=this.playerid;
var setTrigger=function(i,evt){
if(i=='global'){
if(!lib.hook.globaltrigger[evt]){
lib.hook.globaltrigger[evt]={};
}
if(!lib.hook.globaltrigger[evt][playerid]){
lib.hook.globaltrigger[evt][playerid]=[];
}
lib.hook.globaltrigger[evt][playerid].add(skill);
}
else{
var name=playerid+'_'+i+'_'+evt;
if(!lib.hook[name]){
lib.hook[name]=[];
}
lib.hook[name].add(skill);
}
lib.hookmap[evt]=true;
}
for(var i in info.trigger){
if(typeof info.trigger[i]=='string'){
setTrigger(i,info.trigger[i]);
}
else if(Array.isArray(info.trigger[i])){
for(var j=0;j<info.trigger[i].length;j++){
setTrigger(i,info.trigger[i][j]);
}
}
}
}
if(info.hookTrigger){
if(!this._hookTrigger){
this._hookTrigger=[];
}
this._hookTrigger.add(skill);
}
if(_status.event&&_status.event.addTrigger) _status.event.addTrigger(skill,this);
return this; return this;
}, },
addSkillLog:function(skill){ addSkillLog:function(skill){
@ -26462,49 +26474,59 @@
return this; return this;
}, },
removeSkillTrigger:function(skill,triggeronly){ removeSkillTrigger:function(skill,triggeronly){
let skills=game.expandSkills([skill]); var info=lib.skill[skill];
for(let skill of skills){ if(!info) return;
let info=lib.skill[skill]; if(typeof info.group=='string'){
if(!info){ this.removeSkillTrigger(info.group);
console.trace(`Cannot find skill: ${skill}\nPlease check if game.expandSkills is overwritten`); }
continue; else if(Array.isArray(info.group)){
for(var i=0;i<info.group.length;i++){
this.removeSkillTrigger(info.group[i]);
} }
if(!triggeronly) this.initedSkills.remove(skill); }
if(info.trigger){ if(!triggeronly) this.initedSkills.remove(skill);
let playerid=this.playerid; if(info.trigger){
let removeTrigger=function(i,evt){ var playerid=this.playerid;
if(i=='global'){ var removeTrigger=function(i,evt){
for(let j in lib.hook.globaltrigger){ if(i=='global'){
if(lib.hook.globaltrigger[j][playerid]){ for(var j in lib.hook.globaltrigger){
lib.hook.globaltrigger[j][playerid].remove(skill); if(lib.hook.globaltrigger[j][playerid]){
if(lib.hook.globaltrigger[j][playerid].length==0){ lib.hook.globaltrigger[j][playerid].remove(skill);
delete lib.hook.globaltrigger[j][playerid]; if(lib.hook.globaltrigger[j][playerid].length==0){
} delete lib.hook.globaltrigger[j][playerid];
if(get.is.empty(lib.hook.globaltrigger[j])){ }
delete lib.hook.globaltrigger[j]; if(get.is.empty(lib.hook.globaltrigger[j])){
} delete lib.hook.globaltrigger[j];
} }
} }
} }
else{ }
let name=playerid+'_'+i+'_'+evt; else{
if(lib.hook[name]){ var name=playerid+'_'+i+'_'+evt;
lib.hook[name].remove(skill); if(lib.hook[name]){
if(lib.hook[name].length==0) delete lib.hook[name]; lib.hook[name].remove(skill);
if(lib.hook[name].length==0){
delete lib.hook[name];
} }
} }
} }
for(let i in info.trigger){ }
if(typeof info.trigger[i]=='string') removeTrigger(i,info.trigger[i]); for(var i in info.trigger){
else if(Array.isArray(info.trigger[i])){ if(typeof info.trigger[i]=='string'){
for(let trigger of info.trigger[i]) removeTrigger(i,trigger); removeTrigger(i,info.trigger[i]);
}
else if(Array.isArray(info.trigger[i])){
for(var j=0;j<info.trigger[i].length;j++){
removeTrigger(i,info.trigger[i][j]);
} }
} }
} }
if(info.hookTrigger){ }
if(this._hookTrigger){ if(info.hookTrigger){
this._hookTrigger.remove(skill); if(this._hookTrigger){
if(!this._hookTrigger.length) delete this._hookTrigger; this._hookTrigger.remove(skill);
if(!this._hookTrigger.length){
delete this._hookTrigger;
} }
} }
} }
@ -40250,7 +40272,7 @@
if(drawDeck&&drawDeck.drawDeck) players[0].draw(num2,drawDeck); if(drawDeck&&drawDeck.drawDeck) players[0].draw(num2,drawDeck);
else players[0].draw(num2); else players[0].draw(num2);
}, },
finishSkill:(i,history)=>{ finishSkill:(i,sub)=>{
const mode=get.mode(),info=lib.skill[i],iInfo=`${i}_info`; const mode=get.mode(),info=lib.skill[i],iInfo=`${i}_info`;
if(info.alter){ if(info.alter){
lib.translate[`${iInfo}_origin`]=lib.translate[iInfo]; lib.translate[`${iInfo}_origin`]=lib.translate[iInfo];
@ -40293,25 +40315,14 @@
}); });
} }
if(info.inherit){ if(info.inherit){
var inheritHistory=[]; const skill=lib.skill[info.inherit];
while(true){ if(skill) Object.keys(skill).forEach(value=>{
if(!info.inherit) break; if(info[value]!=undefined) return;
if(inheritHistory.includes(info.inherit)){ if(value=='audio'&&(typeof info[value]=='number'||typeof info[value]=='boolean')) info[value]=info.inherit;
console.trace(`Inherit Error: ${info.inherit} in ${i}'s inherit forms a deadlock`); else info[value]=skill[value];
break; });
} if(lib.translate[i]==undefined) lib.translate[i]=lib.translate[info.inherit];
inheritHistory.push(info.inherit); if(lib.translate[iInfo]==undefined) lib.translate[iInfo]=lib.translate[`${info.inherit}_info`];
const inheritInfo=lib.skill[info.inherit];
if(inheritInfo) Object.keys(inheritInfo).forEach(value=>{
if(info[value]!=undefined) return;
if(value=='audio'&&(typeof info[value]=='number'||typeof info[value]=='boolean')) info[value]=info.inherit;
else info[value]=inheritInfo[value];
});
if(lib.translate[i]==undefined) lib.translate[i]=lib.translate[info.inherit];
if(lib.translate[`${i}_info`]==undefined) lib.translate[`${i}_info`]=lib.translate[`${info.inherit}_info`];
if(!inheritInfo||!inheritInfo.inherit) info.inherit=void 0;
}
} }
if(info.limited){ if(info.limited){
if(info.mark===undefined) info.mark=true; if(info.mark===undefined) info.mark=true;
@ -40320,26 +40331,16 @@
if(info.skillAnimation===undefined) info.skillAnimation=true; if(info.skillAnimation===undefined) info.skillAnimation=true;
if(info.init===undefined) info.init=(player,skill)=>player.storage[skill]=false; if(info.init===undefined) info.init=(player,skill)=>player.storage[skill]=false;
} }
if(info.subSkill){ if(info.subSkill&&!sub) Object.keys(info.subSkill).forEach(value=>{
let subSkillHistory=Array.isArray(history)?history:[]; const iValue=`${i}_${value}`;
for(let value in info.subSkill){ lib.skill[iValue]=info.subSkill[value];
if(subSkillHistory.includes(value)){ lib.skill[iValue].sub=true;
console.trace(`SubSkill Error: ${value} in ${i} forms a deadlock`); if(info.subSkill[value].name) lib.translate[iValue]=info.subSkill[value].name;
continue; else lib.translate[iValue]=lib.translate[iValue]||lib.translate[i];
} if(info.subSkill[value].description) lib.translate[`${iValue}_info`]=info.subSkill[value].description;
let history=subSkillHistory.slice(0); if(info.subSkill[value].marktext) lib.translate[`${iValue}_bg`]=info.subSkill[value].marktext;
history.push(value); game.finishSkill(iValue,true);
});
const iValue=`${i}_${value}`;
lib.skill[iValue]=info.subSkill[value];
lib.skill[iValue].sub=true;
if(info.subSkill[value].name) lib.translate[iValue]=info.subSkill[value].name;
else lib.translate[iValue]=lib.translate[iValue]||lib.translate[i];
if(info.subSkill[value].description) lib.translate[`${iValue}_info`]=info.subSkill[value].description;
if(info.subSkill[value].marktext) lib.translate[`${iValue}_bg`]=info.subSkill[value].marktext;
game.finishSkill(iValue,history);
}
}
if(info.round){ if(info.round){
const k=`${i}_roundcount`; const k=`${i}_roundcount`;
if(typeof info.group=='string') info.group=[info.group,k]; if(typeof info.group=='string') info.group=[info.group,k];
@ -41237,25 +41238,15 @@
if(!player.storage.skill_blocker||!player.storage.skill_blocker.length) return out; if(!player.storage.skill_blocker||!player.storage.skill_blocker.length) return out;
return out.filter(value=>exclude&&exclude.includes(value)||!get.is.blocked(value,player)); return out.filter(value=>exclude&&exclude.includes(value)||!get.is.blocked(value,player));
}, },
expandSkills:(skill,oldHistory)=>{ expandSkills:skills=>skills.addArray(skills.reduce((previousValue,currentValue)=>{
let history=[]; const info=get.info(currentValue);
if(oldHistory) history.addArray(oldHistory); if(info){
if(Array.isArray(skill)){ if(Array.isArray(info.group)) previousValue.push(...info.group);
return skill.reduce((previous,current)=>previous.addArray(game.expandSkills(current,history)),[]); else if(info.group) previousValue.push(info.group);
} }
else console.log(currentValue);
let info=get.info(skill); return previousValue;
if(!info){ },[])),
console.trace(`Cannot find skill: ${skill}`);
return history;
}
history.add(skill);
if(info.group){
let group=Array.isArray(info.group)?info.group:[info.group];
history.addArray(game.expandSkills([].addArray(group.filter(skill=>!history.includes(skill))),history));
}
return history;
},
css:style=>Object.keys(style).forEach(value=>{ css:style=>Object.keys(style).forEach(value=>{
let uiStyle=ui.style[value]; let uiStyle=ui.style[value];
if(!uiStyle){ if(!uiStyle){

View File

@ -1,6 +1,6 @@
window.noname_update={ window.noname_update={
version:'1.10.3', version:'1.10.3.1',
update:'1.10.2.1', update:'1.10.3',
changeLog:[ changeLog:[
'整合@nonameShijian @PZ157 @MDYY1 @mengxinzxz @lieren2023 @Lucilor @kuangshen04 @BauxiteAI @copcap @Tipx-L @xiaoas @Rintim @universe-st的Pull Request', '整合@nonameShijian @PZ157 @MDYY1 @mengxinzxz @lieren2023 @Lucilor @kuangshen04 @BauxiteAI @copcap @Tipx-L @xiaoas @Rintim @universe-st的Pull Request',
'新机制:武将名称前缀的高亮显示', '新机制:武将名称前缀的高亮显示',
@ -9,51 +9,8 @@ window.noname_update={
'其他AI优化与bug修复', '其他AI优化与bug修复',
], ],
files:[ files:[
'card/extra.js',
'card/guozhan.js',
'card/standard.js',
'card/yingbian.js',
'character/clan.js',
'character/collab.js',
'character/ddd.js',
'character/diy.js',
'character/extra.js', 'character/extra.js',
'character/gwent.js',
'character/hearth.js',
'character/huicui.js',
'character/jsrg.js',
'character/mobile.js', 'character/mobile.js',
'character/offline.js',
'character/old.js',
'character/refresh.js',
'character/sb.js',
'character/shenhua.js',
'character/shiji.js',
'character/sp.js',
'character/sp2.js',
'character/standard.js',
'character/tw.js',
'character/xianding.js',
'character/xinghuoliaoyuan.js',
'character/yijiang.js',
'character/yingbian.js',
'font/motoyamaru.woff2',
'font/suits.woff2',
'game/codemirror.js',
'game/config.js',
'game/core-js-bundle.js',
'game/game.js', 'game/game.js',
'game/path.js',
'game/pinyinjs.js',
'layout/default/codemirror.css',
'layout/default/layout.css',
'layout/default/menu.css',
'layout/mobile/layout.css',
'layout/mode/stone.css',
'layout/newlayout/global.css',
'mode/boss.js',
'mode/brawl.js',
'mode/guozhan.js',
'mode/identity.js',
] ]
}; };