Merge pull request #694 from kuangshen04/PR-Branch

苏婆:你好
This commit is contained in:
Spmario233 2023-12-02 22:46:43 +08:00 committed by GitHub
commit 04439d6476
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 459 additions and 711 deletions

View File

@ -803,7 +803,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
silent:true, silent:true,
content:function(){ content:function(){
player.exitSubPlayer(true); player.exitSubPlayer(true);
game.createTrigger('phaseAfter','lianjing',player,trigger); if(lib.filter.filterTrigger(trigger,player,'phaseAfter','lianjing')) game.createTrigger('phaseAfter','lianjing',player,trigger);
} }
} }
}, },

View File

@ -8203,7 +8203,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
hs:get.cards(4) hs:get.cards(4)
}); });
player.callSubPlayer(player.storage.huanfeng_end); player.callSubPlayer(player.storage.huanfeng_end);
// game.createTrigger('phaseBegin','shengdun',player,trigger); // if(lib.filter.filterTrigger(trigger,player,'phaseBegin','shengdun')) game.createTrigger('phaseBegin','shengdun',player,trigger);
}, },
// group:'huanfeng_end', // group:'huanfeng_end',
subSkill:{ subSkill:{

View File

@ -3130,7 +3130,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var keys=['filterTarget','selectTarget','ai2']; var keys=['filterTarget','selectTarget','ai2'];
for(var key of keys) delete next[key]; for(var key of keys) delete next[key];
for(var i in trigger){ for(var i in trigger){
if(!next.hasOwnProperty(i)) next[i]=trigger[i]; if(!(i in next)) next[i]=trigger[i];
} }
next.filterTargetx=trigger.filterTarget||(()=>false); next.filterTargetx=trigger.filterTarget||(()=>false);
next.filterTarget=function(card,player,target){ next.filterTarget=function(card,player,target){
@ -3732,7 +3732,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(list.length>0) continue; if(list.length>0) continue;
var info=get.info(skill); var info=get.info(skill);
if(info&&(!info.unique||info.gainable)){ if(info&&(!info.unique||info.gainable)){
lib.skill.rehuashen.createAudio(name,skill,'jsrg_xushao'); // lib.skill.rehuashen.createAudio(name,skill,'jsrg_xushao');
skills.add(skill); skills.add(skill);
} }
} }
@ -3744,6 +3744,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.addSkillBlocker('sbyingmen'); player.addSkillBlocker('sbyingmen');
game.log(player,'将','#y'+get.translation(characters),'加入了','#g“访客”'); game.log(player,'将','#y'+get.translation(characters),'加入了','#g“访客”');
game.broadcastAll(function(player,characters){ game.broadcastAll(function(player,characters){
player.tempname.addArray(characters);
player.$draw(characters.map(function(name){ player.$draw(characters.map(function(name){
var cardname='huashen_card_'+name; var cardname='huashen_card_'+name;
lib.card[cardname]={ lib.card[cardname]={
@ -3764,6 +3765,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var characters2=player.getStorage('sbyingmen').slice(0); var characters2=player.getStorage('sbyingmen').slice(0);
characters2.removeArray(characters); characters2.removeArray(characters);
skills.removeArray(lib.skill.sbyingmen.getSkills(characters2,player)); skills.removeArray(lib.skill.sbyingmen.getSkills(characters2,player));
game.broadcastAll((player,characters)=>player.tempname.removeArray(characters),player,characters);
player.unmarkAuto('sbyingmen',characters); player.unmarkAuto('sbyingmen',characters);
_status.characterlist.addArray(characters); _status.characterlist.addArray(characters);
player.removeInvisibleSkill(skills); player.removeInvisibleSkill(skills);

View File

@ -10620,10 +10620,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
if(event.control=='弃置化身') return; if(event.control=='弃置化身') return;
if(player.storage.rehuashen.current!=event.card){ if(player.storage.rehuashen.current!=event.card){
const old=player.storage.rehuashen.current;
player.storage.rehuashen.current=event.card; player.storage.rehuashen.current=event.card;
game.broadcastAll(function(player,sex){ game.broadcastAll(function(player,character,old){
player.sex=sex; player.tempname.remove(old);
},player,lib.character[event.card][0]); player.tempname.add(character);
player.sex=lib.character[event.card][0];
},player,event.card,old);
game.log(player,'将性别变为了','#y'+get.translation(lib.character[event.card][0])+'性'); game.log(player,'将性别变为了','#y'+get.translation(lib.character[event.card][0])+'性');
player.changeGroup(lib.character[event.card][1]); player.changeGroup(lib.character[event.card][1]);
} }
@ -10636,7 +10639,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.popup(link); player.popup(link);
player.syncStorage('rehuashen'); player.syncStorage('rehuashen');
player.updateMarks('rehuashen'); player.updateMarks('rehuashen');
lib.skill.rehuashen.createAudio(event.card,link,'re_zuoci'); // lib.skill.rehuashen.createAudio(event.card,link,'re_zuoci');
} }
}, },
init:function(player,skill){ init:function(player,skill){
@ -10752,42 +10755,42 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
return node; return node;
}, },
createAudio:(character,skillx,name)=>{ // createAudio:(character,skillx,name)=>{
var skills=game.expandSkills([skillx]); // var skills=game.expandSkills([skillx]);
skills=skills.filter(skill=>get.info(skill)); // skills=skills.filter(skill=>get.info(skill));
if(!skills.length) return; // if(!skills.length) return;
var skillss=skills.filter(skill=>get.info(skill).derivation); // var skillss=skills.filter(skill=>get.info(skill).derivation);
if(skillss.length){ // if(skillss.length){
skillss.forEach(skill=>{ // skillss.forEach(skill=>{
var derivationSkill=get.info(skill).derivation; // var derivationSkill=get.info(skill).derivation;
skills[Array.isArray(derivationSkill)?'addArray':'add'](derivationSkill); // skills[Array.isArray(derivationSkill)?'addArray':'add'](derivationSkill);
}); // });
} // }
skills.forEach(skill=>{ // skills.forEach(skill=>{
var info=lib.skill[skill]; // var info=lib.skill[skill];
if(info){ // if(info){
if(!info.audioname2) info.audioname2={}; // if(!info.audioname2) info.audioname2={};
if(info.audioname&&info.audioname.includes(character)){ // if(info.audioname&&info.audioname.includes(character)){
if(info.audio){ // if(info.audio){
if(typeof info.audio=='string') skill=info.audio; // if(typeof info.audio=='string') skill=info.audio;
if(Array.isArray(info.audio)) skill=info.audio[0]; // if(Array.isArray(info.audio)) skill=info.audio[0];
} // }
if(!lib.skill[skill+'_'+character]) lib.skill[skill+'_'+character]={audio:2}; // if(!lib.skill[skill+'_'+character]) lib.skill[skill+'_'+character]={audio:2};
info.audioname2[name]=(skill+'_'+character); // info.audioname2[name]=(skill+'_'+character);
} // }
else if(info.audioname2[character]){ // else if(info.audioname2[character]){
info.audioname2[name]=info.audioname2[character]; // info.audioname2[name]=info.audioname2[character];
} // }
else{ // else{
if(info.audio){ // if(info.audio){
if(typeof info.audio=='string') skill=info.audio; // if(typeof info.audio=='string') skill=info.audio;
if(Array.isArray(info.audio)) skill=info.audio[0]; // if(Array.isArray(info.audio)) skill=info.audio[0];
} // }
info.audioname2[name]=skill; // info.audioname2[name]=skill;
} // }
} // }
}); // });
}, // },
mark:true, mark:true,
intro:{ intro:{
onunmark:function(storage,player){ onunmark:function(storage,player){

View File

@ -4412,9 +4412,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(!event.logged) player.logSkill('huashen'); if(!event.logged) player.logSkill('huashen');
var skill=map.skill,character=map.character; var skill=map.skill,character=map.character;
if(character!=player.storage.huashen.current){ if(character!=player.storage.huashen.current){
const old=player.storage.huashen.current;
player.storage.huashen.current=character; player.storage.huashen.current=character;
player.markSkill('huashen'); player.markSkill('huashen');
game.broadcastAll(function(character,player){ game.broadcastAll(function(player,character,old){
player.tempname.remove(old);
player.tempname.add(character);
player.sex=lib.character[character][0]; player.sex=lib.character[character][0];
//player.group=lib.character[character][1]; //player.group=lib.character[character][1];
//player.node.name.dataset.nature=get.groupnature(player.group); //player.node.name.dataset.nature=get.groupnature(player.group);
@ -4434,7 +4437,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},50); },50);
},200); },200);
} }
},character,player); },player,character,old);
game.log(player,'将性别变为了','#y'+get.translation(lib.character[character][0])+'性'); game.log(player,'将性别变为了','#y'+get.translation(lib.character[character][0])+'性');
player.changeGroup(lib.character[character][1]); player.changeGroup(lib.character[character][1]);
} }
@ -4446,7 +4449,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.popup(skill); player.popup(skill);
player.syncStorage('huashen'); player.syncStorage('huashen');
player.updateMarks('huashen'); player.updateMarks('huashen');
lib.skill.rehuashen.createAudio(character,skill,'zuoci'); // lib.skill.rehuashen.createAudio(character,skill,'zuoci');
} }
} }
} }

View File

@ -8366,7 +8366,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.addTempSkill(result.control); player.addTempSkill(result.control);
player.storage.pingjian_check[result.control]=(trigger.name=='damage'?trigger:'phaseJieshu'); player.storage.pingjian_check[result.control]=(trigger.name=='damage'?trigger:'phaseJieshu');
var name=event.list.find(name=>lib.character[name][3].includes(result.control)); var name=event.list.find(name=>lib.character[name][3].includes(result.control));
if(name) lib.skill.rehuashen.createAudio(name,result.control,'xushao'); // if(name) lib.skill.rehuashen.createAudio(name,result.control,'xushao');
if(name) game.broadcastAll((player,name)=>player.tempname.add(name),player,name);
}, },
group:'pingjian_use', group:'pingjian_use',
phaseUse_special:[], phaseUse_special:[],
@ -8454,7 +8455,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.addTempSkill(result.control); player.addTempSkill(result.control);
player.storage.pingjian_check[result.control]='phaseUse'; player.storage.pingjian_check[result.control]='phaseUse';
var name=event.list.find(name=>lib.character[name][3].includes(result.control)); var name=event.list.find(name=>lib.character[name][3].includes(result.control));
if(name) lib.skill.rehuashen.createAudio(name,result.control,'xushao'); // if(name) lib.skill.rehuashen.createAudio(name,result.control,'xushao');
if(name) game.broadcastAll((player,name)=>player.tempname.add(name),player,name);
}, },
ai:{order:12,result:{player:1}}, ai:{order:12,result:{player:1}},
}, },
@ -8473,6 +8475,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
var skill=trigger.sourceSkill||trigger.skill; var skill=trigger.sourceSkill||trigger.skill;
player.removeSkill(skill); player.removeSkill(skill);
const names=player.tempname&&player.tempname.filter(i=>lib.character[i][3].includes(skill));
if(names) game.broadcastAll((player,names)=>player.tempname.removeArray(names),player,names);
delete player.storage.pingjian_check[skill]; delete player.storage.pingjian_check[skill];
}, },
group:'pingjian_check2', group:'pingjian_check2',
@ -8495,6 +8499,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return player.storage.pingjian_check[skill]==trigger; return player.storage.pingjian_check[skill]==trigger;
}); });
player.removeSkill(skills); player.removeSkill(skills);
const names=player.tempname&&player.tempname.filter(i=>skills.some(skill=>lib.character[i][3].includes(skill)));
if(names) game.broadcastAll((player,names)=>player.tempname.removeArray(names),player,names);
for(var skill of skills) delete player.storage.pingjian_check[skill]; for(var skill of skills) delete player.storage.pingjian_check[skill];
}, },
}, },

View File

@ -100,7 +100,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.draw(3); player.draw(3);
player.addSkill('shuiyun'); player.addSkill('shuiyun');
'step 1' 'step 1'
game.createTrigger('phaseEnd','shuiyun',player,trigger); if(lib.filter.filterTrigger(trigger,player,'phaseEnd','shuiyun')) game.createTrigger('phaseEnd','shuiyun',player,trigger);
}, },
}, },
shenwu:{ shenwu:{

File diff suppressed because it is too large Load Diff