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,
animationColor:'orange',
filter:function(event,player){
return true;
//return player.getStorage('dctuoyu').length==3;
return player.getStorage('dctuoyu').length==3;
},
content:function(){
'step 0'

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
window.noname_update={
version:'1.10.3',
update:'1.10.2.1',
version:'1.10.3.1',
update:'1.10.3',
changeLog:[
'整合@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修复',
],
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/gwent.js',
'character/hearth.js',
'character/huicui.js',
'character/jsrg.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/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',
]
};