From 9cd9115eedb28a2e1ef38c42ac9f9fd9d0d02aac Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Fri, 8 Dec 2023 10:29:22 +0800 Subject: [PATCH] =?UTF-8?q?OL=E8=B0=8B=E5=A7=9C=E7=BB=B4=E5=86=99=E6=B3=95?= =?UTF-8?q?=E4=BC=98=E5=8C=96+=E8=AF=88=E9=99=8D/=E5=9B=B0=E5=A5=8Baudiona?= =?UTF-8?q?me?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/onlyOL.js | 82 +++++++++++++++++++++++++++----------------- character/refresh.js | 6 +++- character/sp.js | 1 + 3 files changed, 56 insertions(+), 33 deletions(-) diff --git a/character/onlyOL.js b/character/onlyOL.js index 50e7ceb16..65a119828 100644 --- a/character/onlyOL.js +++ b/character/onlyOL.js @@ -11,7 +11,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, characterSort:{ onlyOL:{ - onlyOL_standard:[], onlyOL_yijiang1:['ol_caozhang','ol_jianyong','ol_lingtong'], onlyOL_sb:['ol_sb_jiangwei'], }, @@ -33,17 +32,19 @@ game.import('character',function(lib,game,ui,get,ai,_status){ direct:true, content:function*(event,map){ var player=map.player; + var trigger=map.trigger; var result=yield player.chooseTarget(get.prompt('olsbzhuri'),'与一名角色进行拼点,若你赢,你可以使用其中的一张拼点牌;若你没赢,你失去1点体力或令此技能于本回合失效',(card,player,target)=>{ return player.canCompare(target); }).set('ai',target=>{ var player=_status.event.player; var ts=target.getCards('h').sort((a,b)=>get.number(a)-get.number(b)); if(get.attitude(player,target)<0){ - var hs=player.getCards('h').sort((a,b)=>get.number(a)-get.number(b)); - if(!hs.length||!ts.length) return 0; + if(get.effect(player,{name:'losehp'},player,player)>0) return Math.random()*0.8; + var hs=player.getCards('h').sort((a,b)=>get.number(b)-get.number(a)); + var ts=target.getCards('h').sort((a,b)=>get.number(b)-get.number(a)); if(get.value(hs[0])>6) return 0; if(get.number(hs[0])>get.number(ts[0])) return 1; - return Math.random()-0.7; + return Math.random()+0.2; } return 0; }); @@ -65,11 +66,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } } else{ + var list=lib.skill.olsbranji.getList(trigger); var result3=yield player.chooseControl('失去体力','技能失效').set('prompt','逐日:失去1点体力,或令此技能于本回合失效').set('ai',()=>{ var player=_status.event.player; + if(player.getHp>2){ + var list=_status.event.list; + list.removeArray(player.skipList); + if(list.includes('phaseDraw')||list.includes('phaseUse')) return '失去体力'; + } if(get.effect(player,{name:'losehp'},player,player)>0) return '失去体力'; return '技能失效'; - }); + }).set('list',list.slice(trigger.getParent().num,list.length)); player[result3.control=='失去体力'?'loseHp':'addTempSkill'](result3.control=='失去体力'?1:'olsbzhuri_block'); } } @@ -88,67 +95,79 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'phaseJieshuBegin'}, prompt2:function(event,player){ var str='获得技能'; - var num=event.getParent().phaseList.slice(0,event.getParent().num).filter(name=>player.getHistory('useCard',evt=>evt.getParent(name).name==name).length).length; + var num=lib.skill.olsbranji.getNum(event,player); if(num>=player.getHp()) str+='【困奋】'; if(num==player.getHp()) str+='和'; if(num<=player.getHp()) str+='【诈降】'; - str+='。将手牌数调整至手牌或将体力值调整为体力上限。然后你不能回复体力直到你杀死角色。'; + str+=',然后'; + var num1=(player.countCards('h')-player.getHandcardLimit()); + if(num1||player.isDamaged()){ + if(num1) str+=(num1<0?'摸'+get.cnNumber(-num1)+'张牌':'弃置'+get.cnNumber(num1)+'张牌'); + if(num1&&player.isDamaged()) str+='或'; + if(player.isDamaged()) str+=('回复'+player.getDamagedHp()+'点体力'); + str+=',最后'; + } + str+='你不能回复体力直到你杀死角色。'; return str; }, + check:function(event,player){ + var num=lib.skill.olsbranji.getNum(event,player); + if(num==player.getHp()) return true; + return player.getHandcardLimit()-player.countCards('h')>=3&&player.getDamagedHp()>=2; + }, skillAnimation:true, animationColor:'fire', content:function*(event,map){ var player=map.player; var trigger=map.trigger; player.awakenSkill('olsbranji'); - var num=trigger.getParent().phaseList.slice(0,trigger.getParent().num).filter(name=>player.getHistory('useCard',evt=>evt.getParent(name).name==name).length).length; + var num=lib.skill.olsbranji.getNum(trigger,player); if(num>=player.getHp()) player.addSkillLog('kunfen'); if(num<=player.getHp()) player.addSkillLog('zhaxiang'); - if(player.countCards('h')!=player.getHandcardLimit()||player.hp!=player.maxHp){ - var result; - if(player.countCards('h')==player.getHandcardLimit()) result={index:1}; - else if(player.hp==player.maxHp) result={index:0}; + if(player.countCards('h')!=player.getHandcardLimit()||player.isDamaged()){ + var result,num1=player.countCards('h')-player.getHandcardLimit(); + if(!num1) result={index:1}; + else if(player.isHealthy()) result={index:0}; else{ - var num1=player.countCards('h'){ var player=_status.event.player; var list=_status.event.list; var num1=get.effect(player,{name:'wuzhong'},player,player)/2; var num2=get.recoverEffect(player,player,player); return num1*list[0]>num2*list[1]?0:1; - }).set('list',[-num1,-num2]); + }).set('list',[-num1,player.getDamagedHp()]); } if(result.index==0){ - if(player.countCards('h')0?'recover':'loseHp'](Math.abs(num)); + player.recover(player.maxHp-player.hp); } } - player.addSkill('olsbranji_norecover'); + player.when('olsbranjiAfter').then(()=>player.addSkill('olsbranji_norecover')); + player.when({source:'dieAfter'}).then(()=>player.removeSkill('olsbranji_norecover')); }, derivation:['kunfen','zhaxiang'], + getList:function(event){ + return event.getParent().phaseList.map(list=>list.split('|')[0]); + }, + getNum:function(event,player){ + return lib.skill.olsbranji.getList(event).slice(0,event.getParent().num).filter(name=>player.getHistory('useCard',evt=>evt.getParent(name).name==name).length).length; + }, subSkill:{ norecover:{ charlotte:true, mark:true, - intro:{content:'不能回复体力直到杀死角色'}, - trigger:{ - player:'recoverBefore', - source:'dieAfter', - }, + intro:{content:'不能回复体力'}, + trigger:{player:'recoverBefore'}, forced:true, - popup:false, firstDo:true, content:function(){ - if(trigger.name=='recover') trigger.cancel(); - else player.removeSkill('olsbranji_norecover'); + trigger.cancel(); }, ai:{ effect:{ @@ -325,11 +344,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ol_sb_jiangwei:'OL谋姜维', ol_sb_jiangwei_prefix:'OL谋', olsbzhuri:'逐日', - olsbzhuri_info:'你的回合阶段结束时,若你本阶段失去或得到过牌,则你可以与一名角色拼点。若你赢,你可以使用其中一张拼点牌;若你没赢,你失去1点体力或令此技能于本回合无效。', + olsbzhuri_info:'你的阶段结束时,若你本阶段失去或得到过牌,则你可以与一名角色拼点。若你赢,你可以使用其中一张拼点牌;若你没赢,你失去1点体力或令此技能于本回合无效。', olsbranji:'燃己', - olsbranji_info:'限定技,结束阶段。若你本回合使用过牌的阶段数大于等于/小于等于体力值,你获得技能〖困奋〗/〖诈降〗(同时满足则都获得),然后你将手牌数调整至手牌上限或将体力值调整为体力上限,最后你不能回复体力直到你杀死角色。', + olsbranji_info:'限定技,结束阶段。若你本回合使用过牌的阶段数大于等于/小于等于体力值,你可以获得技能〖困奋〗/〖诈降〗(同时满足则都获得)。若如此做,你将手牌数调整至手牌上限或将体力值回复至体力上限,然后你不能回复体力直到你杀死角色。', - onlyOL_standard:'OL专属·标准', onlyOL_yijiang1:'OL专属·将1', onlyOL_sb:'OL专属·上兵伐谋', }, diff --git a/character/refresh.js b/character/refresh.js index 16de23927..05e8b7644 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -13917,9 +13917,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }, zhaxiang:{ + audio:2, + audioname:['ol_sb_jiangwei'], trigger:{player:'loseHpEnd'}, forced:true, - audio:2, content:function(){ var num=trigger.num; player.draw(3*num); @@ -13960,7 +13961,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(card.name=='sha') return num+player.storage.zhaxiang2; } }, + charlotte:true, onremove:true, + audio:'zhaxiang', + audioname:['ol_sb_jiangwei'], trigger:{player:'useCard'}, forced:true, filter:function(event,player){ diff --git a/character/sp.js b/character/sp.js index 6cf560637..d09f2e737 100755 --- a/character/sp.js +++ b/character/sp.js @@ -21110,6 +21110,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, kunfen:{ audio:2, + audioname:['ol_sb_jiangwei'], trigger:{player:'phaseJieshuBegin'}, locked:function(skill,player){ if(!player||!player.storage.kunfen) return true;