diff --git a/character/diy.js b/character/diy.js index 786e0c931..eef9dffdc 100755 --- a/character/diy.js +++ b/character/diy.js @@ -1774,12 +1774,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.awakenSkill('tomoyo_zhengfeng'); player.loseMaxHp(); 'step 1' - player.removeSkill('tomoyo_wuwei'); + player.removeSkills('tomoyo_wuwei'); 'step 2' player.draw(2); player.recover(); 'step 3' - player.addSkill('tomoyo_changshi'); + player.addSkills('tomoyo_changshi'); }, }, }, @@ -2195,12 +2195,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ multiline:true, line:{color:[253, 153, 182]}, content(){ - game.countPlayer(function(current){ + game.filterPlayer().sortBySeat().forEach(function(current){ if(!targets.includes(current)){ - current.removeSkill('seira_yinyuan'); + current.removeSkills('seira_yinyuan'); } else{ - current.addSkillLog('seira_yinyuan'); + current.addSkills('seira_yinyuan'); } }); game.delayx(); @@ -2350,7 +2350,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.draw(2); player.markAuto('nsxingyun',[lib.skill.nsxingyun.getSixiang(trigger.card)]); 'step 1' - if(player.getStorage('nsxingyun').length>=4) player.addSkillLog('bazhen'); + if(player.getStorage('nsxingyun').length>=4) player.addSkills('bazhen'); }, }, round:{ @@ -3416,8 +3416,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(owner&&owner!=player) owner.give(card,player); 'step 1' if(player.hp{ + player.addAdditionalSkill('junkyuheng',skills); + game.log(player,'获得了以下技能:','#g'+get.translation(skills)); + }); } }, group:'junkyuheng_remove', @@ -17664,22 +17660,25 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return player.additionalSkills.junkyuheng&&player.additionalSkills.junkyuheng.length>0; }, content(){ - player.draw(player.additionalSkills.junkyuheng.length); - game.log(player,'失去了以下技能:','#g'+get.translation(player.additionalSkills.junkyuheng)); - player.removeAdditionalSkill('junkyuheng'); + const skills = player.additionalSkills.junkyuheng; + player.draw(skills.length); + player.changeSkills([],skills).set('$handle',(player,addSkills,removeSkills)=>{ + game.log(player,'失去了以下技能:','#g'+get.translation(removeSkills)); + player.removeAdditionalSkill('junkyuheng'); + }); }, }, }, }, junkdili:{ audio:'dili', - trigger:{player:'logSkill'}, + trigger:{player:'changeSkillsAfter'}, forced:true, juexingji:true, skillAnimation:true, animationColor:'wood', filter(event,player){ - if(event.skill!='junkyuheng') return false; + if(!event.addSkill.length) return false; var skills=player.getSkills(null,false,false).filter(function(i){ var info=get.info(i); return info&&!info.charlotte; @@ -17734,12 +17733,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(result.bool){ var skills=result.links; game.log(player,'失去了以下技能:','#g'+get.translation(skills)); - player.removeSkill(skills.slice(0)); + player.removeSkills(skills.slice(0)); } var list=lib.skill.junkdili.derivation; - for(var i=0;i东吴命运线·改中随机获得等量的技能。②回合结束时,你失去所有因〖驭衡①〗获得的技能,然后摸等量的牌。', junkdili:'帝力', - junkdili_info:'觉醒技。当你发动〖驭衡①〗后,若你拥有的技能数大于你的体力上限,则你减1点体力上限,选择失去任意个其他技能,然后获得以下技能中的前等量个:〖圣质〗/〖权道〗/〖持纲〗。', + junkdili_info:'觉醒技。当你获得技能后,若你拥有的技能数大于你的体力上限,则你减1点体力上限,选择失去任意个其他技能,然后获得以下技能中的前等量个:〖圣质〗/〖权道〗/〖持纲〗。', junkshengzhi:'圣质', junkshengzhi_info:'锁定技。当你发动非锁定技后,你令你本回合使用的下一张牌无距离和次数限制。', junkquandao:'权道', diff --git a/character/extra.js b/character/extra.js index 4f32fd6ff..26c3a7180 100755 --- a/character/extra.js +++ b/character/extra.js @@ -1629,7 +1629,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 0' player.awakenSkill('dcqijing'); player.loseMaxHp(); - player.addSkillLog('dccuixin'); + player.addSkills('dccuixin'); 'step 1' if(game.countPlayer()>2){ if(player==trigger.player&&!trigger.skill){ @@ -3250,7 +3250,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ skills.add(fullskills.randomRemove(1)[0]); } for(var i of skills){ - player.addSkillLog(i); + player.addSkills(i); } player.markAuto('yuheng',skills); }, @@ -4108,7 +4108,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content(){ game.log(player,'成功完成使命'); player.awakenSkill('tspowei'); - player.addSkillLog('shenzhu'); + player.addSkills('shenzhu'); }, }, fail:{ @@ -4350,7 +4350,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var target=result.targets[0]; player.line(target,'green'); target.storage.zuoxing=player; - target.addSkill('zuoxing'); + target.addSkills('zuoxing'); } }, derivation:'zuoxing', @@ -4771,7 +4771,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(lib.character[target.name]) list.addArray(lib.character[target.name][3]); if(lib.character[target.name1]) list.addArray(lib.character[target.name1][3]); if(lib.character[target.name2]) list.addArray(lib.character[target.name2][3]); - player.addSkill(list); + player.addSkills(list); game.broadcastAll(function(list){ lib.character.key_shiki[3].addArray(list); game.expandSkills(list); @@ -5094,8 +5094,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, content(){ player.awakenSkill(event.name); - player.addSkill('tianxing'); - player.addSkill('new_rejianxiong'); + player.addSkills(['tianxing','new_rejianxiong']); player.loseMaxHp(); player.gain(player.getExpansions('chuyuan'),'gain2','fromStorage'); }, @@ -5126,7 +5125,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return 'rerende'; }); 'step 2' - player.addSkillLog(result.control); + player.addSkills(result.control); }, }, olzhiti:{ @@ -5901,9 +5900,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return player.countMark('renjie')>=4; }, content(){ - player.loseMaxHp(); - player.addSkill('jilue'); player.awakenSkill('sbaiyin'); + player.loseMaxHp(); + player.addSkills('jilue'); }, derivation:['jilue','reguicai','fangzhu','rejizhi','rezhiheng','rewansha'], }, diff --git a/character/huicui.js b/character/huicui.js index 312c23e05..7148ac49e 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -527,12 +527,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, content:function(){ var num=Math.min(cards.length,4-player.countMark('dcmanwang')); - if(num>=1) player.addSkill('dcpanqin'); + if(num>=1) player.addSkills('dcpanqin'); if(num>=2) player.draw(); if(num>=3) player.recover(); if(num>=4){ player.draw(2); - player.removeSkill('dcpanqin'); + player.removeSkills('dcpanqin'); } }, ai:{ @@ -578,7 +578,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ switch(player.countMark('dcmanwang')){ case 1: player.draw(2); - player.removeSkill('dcpanqin'); + player.removeSkills('dcpanqin'); break; case 2: player.recover(); @@ -587,7 +587,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.draw(); break; case 4: - player.addSkill('dcpanqin'); + player.addSkills('dcpanqin'); break; } 'step 1' @@ -3337,11 +3337,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:function(){ 'step 0' player.awakenSkill('dcchongxu'); + player.removeSkills('dchuiling'); player.gainMaxHp(Math.min(game.countPlayer(),player.countMark('dchuiling'))); - player.removeSkill('dchuiling'); 'step 1' - player.addSkillLog('dctaji'); - player.addSkillLog('dcqinghuang'); + player.addSkills(['dctaji','dcqinghuang']); }, ai:{ order:function(itemp,player){ @@ -7643,7 +7642,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ else event.goto(3); 'step 2' game.broadcastAll('closeDialog',event.videoId); - target.addSkillLog(result.control); + target.addSkills(result.control); 'step 3' var storage=player.storage.dunshi; if(event.links.includes(1)){ @@ -10030,8 +10029,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(player.maxHp>player.hp) player.recover(player.maxHp-player.hp); 'step 2' player.drawTo(Math.min(5,player.maxHp)); - player.addSkillLog('llqshenwei'); - player.addSkillLog('wushuang'); + player.addSkills(['llqshenwei','wushuang']); }, }, llqshenwei:{ diff --git a/character/jsrg.js b/character/jsrg.js index 898a66ee5..a96d97221 100644 --- a/character/jsrg.js +++ b/character/jsrg.js @@ -3965,9 +3965,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:function(){ player.awakenSkill('jsrgzhasi'); trigger.cancel(); - player.removeSkill('jsrgzhiheng'); - game.log(player,'失去了技能','#g【猘横】'); - player.addSkillLog('rezhiheng'); + player.removeSkill(); + player.changeSkills(['rezhiheng'],['jsrgzhiheng']); player.addSkill('jsrgzhasi_undist'); }, derivation:'rezhiheng', @@ -7652,8 +7651,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.awakenSkill('jsrghuilie'); player.loseMaxHp(); 'step 1' - player.addSkillLog('jsrgpingrong'); - player.addSkillLog('feiying'); + player.addSkills(['jsrgpingrong','feiying']); } }, jsrgpingrong:{ diff --git a/character/mobile.js b/character/mobile.js index a594b1931..379dc0ed6 100644 --- a/character/mobile.js +++ b/character/mobile.js @@ -6783,7 +6783,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:function(){ player.awakenSkill('moucuan'); player.loseMaxHp(); - player.addSkill('binghuo'); + player.addSkills('binghuo'); }, ai:{combo:'jibing'}, }, @@ -9902,7 +9902,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return info&&!info.hiddenSkill&&!info.zhuSkill&&!info.charlotte; }); if(skills.length){ - for(var i of skills) player.addSkillLog(i); + player.addSkills(skills); game.broadcastAll(function(list){ game.expandSkills(list); for(var i of list){ @@ -9943,7 +9943,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return list.randomGet(); }); 'step 1' - player.addSkillLog(result.control); + player.addSkills(result.control); game.broadcastAll(function(skill){ var list=[skill];game.expandSkills(list); for(var i of list){ @@ -11584,8 +11584,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.gain(gains,'gain2'); } 'step 3' - player.addSkill('reqingce'); - game.log(player,'获得了技能','#g【清侧】'); + player.addSkills('reqingce'); player.loseMaxHp(); }, }, @@ -12960,8 +12959,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 1' if(result.bool){ player.line(trigger.source,'fire'); - trigger.source.addSkillLog('new_rewusheng'); - trigger.source.addSkillLog('redangxian'); + trigger.source.addSkills(['new_rewusheng','redangxian']); } }, }, @@ -13110,8 +13108,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ animationColor:'thunder', content:function(){ player.awakenSkill('remoucheng'); - player.removeSkill('relianji'); - player.addSkill('jingong'); + player.changeSkills(['jingong','relianji']); player.gainMaxHp(); player.recover(); }, diff --git a/character/offline.js b/character/offline.js index 66475b875..89050d4e9 100644 --- a/character/offline.js +++ b/character/offline.js @@ -1075,7 +1075,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.awakenSkill('pksanchen'); player.gainMaxHp(); player.recover(); - player.addSkillLog('pkmiewu'); + player.addSkills('pkmiewu'); }, ai:{ combo:'wuku', diff --git a/character/old.js b/character/old.js index 9544cadbc..def28bd53 100755 --- a/character/old.js +++ b/character/old.js @@ -200,7 +200,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 1' if(result.bool){ player.logSkill('junkguixin'); - player.addSkillLog(result.links[0]); + player.addSkills(result.links[0]); } }, content_修改势力:function(){ diff --git a/character/onlyOL.js b/character/onlyOL.js index 0a6943813..65a2856f0 100644 --- a/character/onlyOL.js +++ b/character/onlyOL.js @@ -519,11 +519,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var trigger=map.trigger; player.awakenSkill('olsbranji'); var num=lib.skill.olsbranji.getNum(trigger,player); + const skills = []; if(num>=player.getHp()){ - player.addSkillLog('kunfen'); + skills.push('kunfen'); player.storage.kunfen=true; } - if(num<=player.getHp()) player.addSkillLog('zhaxiang'); + if(num<=player.getHp()) skills.push('zhaxiang'); + player.addSkills(skills); if(player.countCards('h')!=player.getHandcardLimit()||player.isDamaged()){ var result,num1=player.countCards('h')-player.getHandcardLimit(); if(!num1) result={index:1}; diff --git a/character/refresh.js b/character/refresh.js index b4f290c4e..ec9947263 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -559,8 +559,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 1' player.drawTo(player.maxHp); 'step 2' - player.addSkillLog('benghuai'); - player.addSkillLog('reweizhong'); + player.addSkills(['benghuai','reweizhong']); } }, reweizhong:{ @@ -3861,7 +3860,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:function(){ player.awakenSkill('xsqianxin'); player.loseMaxHp(); - player.addSkill('rejianyan'); + player.addSkills('rejianyan'); }, derivation:'rejianyan', }, @@ -5588,7 +5587,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.recover(); player.draw(2); player.loseMaxHp(); - player.addSkill('xinpaiyi'); + player.addSkills('xinpaiyi'); }, }, xinpaiyi:{ @@ -6102,8 +6101,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.chooseDrawRecover(2,true); "step 1" player.loseMaxHp(); - player.storage.olzhiji=true; - player.addSkill('reguanxing'); + player.addSkills('reguanxing'); } }, //界郭图张嶷 @@ -7733,7 +7731,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:function(){ player.awakenSkill('olzaoxian'); player.loseMaxHp(); - player.addSkill('jixi'); + player.addSkills('jixi'); player.insertPhase(); } }, @@ -9603,7 +9601,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return ['olhuoji','bazhen'].randomGet(); }; 'step 6' - player.addSkillLog(result.control); + player.addSkills(result.control); }, derivation:['bazhen','olhuoji','olkanpo'], ai:{ @@ -10273,14 +10271,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audioname:['re_sunyi'], inherit:'hunzi', content:function(){ + player.awakenSkill(event.name); player.loseMaxHp(); //player.recover(); - player.addSkill('reyingzi'); - player.addSkill('gzyinghun'); + player.addSkills(['reyingzi','gzyinghun']); player.addTempSkill('olhunzi_effect'); - game.log(player,'获得了技能','#g【英姿】','和','#g【英魂】'); - player.awakenSkill(event.name); - player.storage[event.name]=true; }, subSkill:{ effect:{ @@ -11035,7 +11030,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 1' if(!result.bool) target.loseHp(); 'step 2' - target.addSkillLog('rechanyuan'); + target.addSkills('rechanyuan'); if(targets.length) event.goto(0); }, }, @@ -13155,7 +13150,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.awakenSkill('qinxue'); player.loseMaxHp(); player.chooseDrawRecover(2,true); - player.addSkill('gongxin'); + player.addSkills('gongxin'); } }, qingjian:{ @@ -14025,7 +14020,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, content:function(){ player.awakenSkill('qianxin'); - player.addSkill('jianyan'); + player.addSkills('jianyan'); player.loseMaxHp(); } }, diff --git a/noname/library/element/content.js b/noname/library/element/content.js index 8b90bc81e..ec92e7798 100644 --- a/noname/library/element/content.js +++ b/noname/library/element/content.js @@ -12,7 +12,7 @@ export const Content = { event.trigger(event.name); }, //变更技能 - changeSkills: async function (event,trigger,player) { + async changeSkills (event,trigger,player) { //去重检查 event.addSkill.unique(); event.removeSkill.unique(); @@ -26,8 +26,14 @@ export const Content = { await event.trigger('changeSkillsBefore'); await event.trigger('changeSkillsBegin'); //处理失去和获得的技能 - if(event.addSkill.length) player.addSkillLog(event.addSkill); - if(event.removeSkill.length) player.removeSkillLog(event.removeSkill); + if(event.$handle){ + event.$handle(player,event.addSkill,event.removeSkill,event); + } + else{ + if(event.addSkill.length) player.addSkillLog(event.addSkill); + if(event.removeSkill.length) player.removeSkillLog(event.removeSkill); + } + //手动触发时机 await event.trigger('changeSkillsEnd'); await event.trigger('changeSkillsAfter'); },