Merge pull request #510 from mengxinzxz/PR-Branch

die_audio修改使其支持播放本体任意武将阵亡配音
This commit is contained in:
Spmario233 2023-10-11 23:15:48 +08:00 committed by GitHub
commit fcb204e251
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 118 additions and 13 deletions

View File

@ -27,8 +27,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
character:{ character:{
xin_wuban:['male','shu',4,['xinjintao'],['clan:陈留吴氏','character:wuban']], xin_wuban:['male','shu',4,['xinjintao'],['clan:陈留吴氏','character:wuban']],
baoxin:['male','qun',4,['mutao','yimou'],['character:tw_baoxin']], baoxin:['male','qun',4,['mutao','yimou'],['character:tw_baoxin','die_audio:tw_baoxin']],
jiangji:['male','wei',3,['twjichou','jilun'],['character:tw_jiangji']], jiangji:['male','wei',3,['twjichou','jilun'],['character:tw_jiangji','die_audio:tw_jiangji']],
liwei:['male','shu',4,['jiaohua'],['character:tw_liwei','die:tw_liwei']], liwei:['male','shu',4,['jiaohua'],['character:tw_liwei','die:tw_liwei']],
laimin:['male','shu',3,['laishou','luanqun']], laimin:['male','shu',3,['laishou','luanqun']],
yj_zhoubuyi:['male','wei',3,['mbhuiyao','mbquesong']], yj_zhoubuyi:['male','wei',3,['mbhuiyao','mbquesong']],
@ -1027,7 +1027,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player){ filter:function(event,player){
var target=game.findPlayer(current=>current.hasSkill('yichong_'+player.playerid)); var target=game.findPlayer(current=>current.hasSkill('yichong_'+player.playerid));
if(!target) return false; if(!target) return false;
if(event.name=='damage') return target.hp>Math.max(1,player.hp); if(event.name=='damage') return target.hp>3;
return event.isFirstTarget&&(event.card.name=='sha'||(get.type(event.card)=='trick'&&get.tag(event.card,'damage'))); return event.isFirstTarget&&(event.card.name=='sha'||(get.type(event.card)=='trick'&&get.tag(event.card,'damage')));
}, },
direct:true, direct:true,
@ -15279,7 +15279,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
yichong:'易宠', yichong:'易宠',
yichong_info:'①准备阶段,你可以选择一名其他角色并选择一个花色,然后你获得其所有此花色的牌,移除场上的所有“雀”标记,令其获得“雀”标记直到你的下个回合开始。②拥有“雀”标记的角色获得你最后一次发动〖易宠①〗选择的花色的牌后,你获得这些牌(你至多通过每个“雀”得到一张牌)。', yichong_info:'①准备阶段,你可以选择一名其他角色并选择一个花色,然后你获得其所有此花色的牌,移除场上的所有“雀”标记,令其获得“雀”标记直到你的下个回合开始。②拥有“雀”标记的角色获得你最后一次发动〖易宠①〗选择的花色的牌后,你获得这些牌(你至多通过每个“雀”得到一张牌)。',
wufei:'诬诽', wufei:'诬诽',
wufei_info:'若场上存在拥有“雀”标记的角色A①当你使用【杀】或伤害类锦囊牌指定第一个目标后你令A成为此牌伤害来源。②当你受到伤害后若A的体力值大于1且A的体力值大于你则你可以令A受到1点无来源伤害。', wufei_info:'若场上存在拥有“雀”标记的角色A①当你使用【杀】或伤害类锦囊牌指定第一个目标后你令A成为此牌伤害来源。②当你受到伤害后若A的体力值大于3则你可以令A受到1点无来源伤害。',
yj_zhoubuyi:'☆周不疑', yj_zhoubuyi:'☆周不疑',
yj_zhoubuyi_prefix:'☆', yj_zhoubuyi_prefix:'☆',
mbhuiyao:'慧夭', mbhuiyao:'慧夭',

View File

@ -457,9 +457,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
backflow:{ backflow:{
audio:'sbzaiqi', audio:'sbzaiqi',
trigger:{ trigger:{
player:'enterGame', //player:'enterGame',
source:'damageSource', source:'damageSource',
global:'phaseBefore', //global:'phaseBefore',
}, },
usable:1, usable:1,
filter:function(event,player){ filter:function(event,player){
@ -5113,7 +5113,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
sbhuoshou:'祸首', sbhuoshou:'祸首',
sbhuoshou_info:'锁定技。①【南蛮入侵】对你无效。②当其他角色使用【南蛮入侵】指定第一个目标后,你代替其成为此牌的伤害来源。③出牌阶段开始时,你随机获得弃牌堆中的一张【南蛮入侵】。④出牌阶段,若你于此阶段使用过【南蛮入侵】,你不能使用【南蛮入侵】。', sbhuoshou_info:'锁定技。①【南蛮入侵】对你无效。②当其他角色使用【南蛮入侵】指定第一个目标后,你代替其成为此牌的伤害来源。③出牌阶段开始时,你随机获得弃牌堆中的一张【南蛮入侵】。④出牌阶段,若你于此阶段使用过【南蛮入侵】,你不能使用【南蛮入侵】。',
sbzaiqi:'再起', sbzaiqi:'再起',
sbzaiqi_info:'蓄力技(3/7。①弃牌阶段结束时你可以消耗任意点蓄力值并选择等量名角色然后令这些角色选择一项1.令你摸一张牌2.弃置一张牌然后你回复1点体力。②每回合限一次。当你造成伤害后你获得1点蓄力值。', sbzaiqi_info:'蓄力技(0/7。①弃牌阶段结束时你可以消耗任意点蓄力值并选择等量名角色然后令这些角色选择一项1.令你摸一张牌2.弃置一张牌然后你回复1点体力。②每回合限一次。当你造成伤害后你获得1点蓄力值。',
sb_zhanghe:'谋张郃', sb_zhanghe:'谋张郃',
sbqiaobian:'巧变', sbqiaobian:'巧变',
sbqiaobian_info:'每回合限一次。①你可以失去1点体力并跳过判定阶段将判定区的所有牌移动给一名其他角色无法置入其判定区的牌改为弃置之。②你可以跳过摸牌阶段于下个准备阶段摸两张牌并回复1点体力。③你可以将手牌数弃置至六张若手牌数少于六张则跳过之并跳过出牌阶段和弃牌阶段然后移动场上的一张牌。', sbqiaobian_info:'每回合限一次。①你可以失去1点体力并跳过判定阶段将判定区的所有牌移动给一名其他角色无法置入其判定区的牌改为弃置之。②你可以跳过摸牌阶段于下个准备阶段摸两张牌并回复1点体力。③你可以将手牌数弃置至六张若手牌数少于六张则跳过之并跳过出牌阶段和弃牌阶段然后移动场上的一张牌。',

View File

@ -13,7 +13,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
sp_huben:['duanjiong','ol_mengda',"caohong","xiahouba","zhugeke","zumao","wenpin","litong","mazhong","heqi","quyi","luzhi","zangba","yuejin","dingfeng","wuyan","ol_zhuling","tianyu","huojun",'zhaoyǎn','dengzhong','ol_furong','macheng','ol_zhangyì','ol_zhujun','maxiumatie','luoxian','ol_huban','haopu','ol_qianzhao'], sp_huben:['duanjiong','ol_mengda',"caohong","xiahouba","zhugeke","zumao","wenpin","litong","mazhong","heqi","quyi","luzhi","zangba","yuejin","dingfeng","wuyan","ol_zhuling","tianyu","huojun",'zhaoyǎn','dengzhong','ol_furong','macheng','ol_zhangyì','ol_zhujun','maxiumatie','luoxian','ol_huban','haopu','ol_qianzhao'],
sp_liesi:['mizhu','weizi','ol_liuba','zhangshiping'], sp_liesi:['mizhu','weizi','ol_liuba','zhangshiping'],
sp_default:["sp_diaochan","sp_zhaoyun","sp_sunshangxiang","sp_caoren","sp_jiangwei","sp_machao","sp_caiwenji","jsp_guanyu","jsp_huangyueying","sp_pangde","sp_jiaxu","yuanshu",'sp_zhangliao','sp_ol_zhanghe','sp_menghuo'], sp_default:["sp_diaochan","sp_zhaoyun","sp_sunshangxiang","sp_caoren","sp_jiangwei","sp_machao","sp_caiwenji","jsp_guanyu","jsp_huangyueying","sp_pangde","sp_jiaxu","yuanshu",'sp_zhangliao','sp_ol_zhanghe','sp_menghuo'],
sp_waitforsort:['ol_luyusheng','ol_pengyang','ol_tw_zhangji','ol_feiyi','ol_lvboshe','zhangyan'], sp_waitforsort:['ol_luyusheng','ol_pengyang','ol_tw_zhangji','ol_feiyi','lvboshe','zhangyan','ol_dingshangwan'],
sp_qifu:["caoying",'panshu',"caochun","yuantanyuanshang",'caoshuang','wolongfengchu','guansuo','baosanniang','fengfangnv','jin_zhouchu'], sp_qifu:["caoying",'panshu',"caochun","yuantanyuanshang",'caoshuang','wolongfengchu','guansuo','baosanniang','fengfangnv','jin_zhouchu'],
sp_wanglang:['ol_wanglang','ol_puyuan','ol_zhouqun'], sp_wanglang:['ol_wanglang','ol_puyuan','ol_zhouqun'],
sp_zhongdan:["cuiyan","huangfusong"], sp_zhongdan:["cuiyan","huangfusong"],
@ -28,15 +28,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ol_dongzhao:function(mode){ ol_dongzhao:function(mode){
return mode=='identity'&&['normal','zhong'].contains(_status.mode); return mode=='identity'&&['normal','zhong'].contains(_status.mode);
}, },
ol_lvboshe:function(mode){ lvboshe:function(mode){
return mode=='doudizhu'; return mode=='doudizhu';
}, },
}, },
character:{ character:{
ol_dingshangwan:['female','wei',3,['olfudao','olfengyan']],
zhangyan:['male','qun',4,['olsuji','ollangdao']], zhangyan:['male','qun',4,['olsuji','ollangdao']],
ol_tw_zhangji:['male','wei',3,['skill_zhangji_A','skill_zhangji_B'],['unseen']], ol_tw_zhangji:['male','wei',3,['skill_zhangji_A','skill_zhangji_B'],['unseen']],
ol_feiyi:['male','shu',3,['skill_feiyi_A','skill_feiyi_B'],['unseen']], ol_feiyi:['male','shu',3,['skill_feiyi_A','skill_feiyi_B'],['unseen']],
ol_lvboshe:['male','qun',4,['skill_lvboshe'],['unseen']], lvboshe:['male','qun',4,['skill_lvboshe'],['unseen']],
ol_luyusheng:['female','wu',3,['olcangxin','olrunwei']], ol_luyusheng:['female','wu',3,['olcangxin','olrunwei']],
caoxi:['male','wei',3,['olgangshu','oljianxuan']], caoxi:['male','wei',3,['olgangshu','oljianxuan']],
ol_pengyang:['male','shu',3,['olqifan','oltuishi','nzry_cunmu']], ol_pengyang:['male','shu',3,['olqifan','oltuishi','nzry_cunmu']],
@ -706,6 +707,101 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
}, },
skill:{ skill:{
//丁尚涴
olfudao:{
audio:2,
trigger:{
global:'phaseBefore',
player:'enterGame',
},
filter:function(event,player){
return event.name!='phase'||game.phaseNumber==0;
},
forced:true,
locked:false,
content:function(){
'step 0'
var list=[],num=player.countCards('he');
for(var i=-4;i<=4;i++){
if(num+i<0||i==0) continue;
list.push(i);
}
player.chooseControl(list).set('prompt','讽言:请选择一个数字').set('prompt2','令此数值作为调整的手牌数值').set('ai',function(){
var list=[],num=_status.event.player.countCards('he');
for(var i=-4;i<=4;i++){
if(num+i<0||i==0) continue;
if(i>0&&i!=4) continue;
list.push(i);
}
return list.randomGet();
});
'step 1'
var num=result.control
player.popup(num);
if(num>0) player.draw(num);
else player.chooseToDiscard('he',true,-num);
'step 2'
player.storage.olfudao=player.countCards('he');
player.markSkill('olfudao');
},
intro:{
content:'一名角色的回合结束时,若其手牌数等于#,你可以与其各摸一张牌。',
},
group:'olfudao_qiaoshi',
subSkill:{
qiaoshi:{
audio:'olfudao',
trigger:{global:'phaseEnd'},
filter:function(event,player){
if(typeof player.storage.olfudao!='number') return false;
return event.player.countCards('h')==player.storage.olfudao&&event.player.isIn();
},
check:function(event,player){
return get.attitude(player,event.player)>=0;
},
logTarget:'player',
prompt2:function(event,player){
return '与'+get.translation(event.player)+'各摸一张牌';
},
content:function(){
game.asyncDraw([trigger.player,player]);
},
},
},
},
olfengyan:{
audio:2,
trigger:{player:['damageEnd','useCard','respond']},
filter:function(event,player){
if(event.name=='damage') return event.source&&event.source.isIn()&&event.source!=player;
return Array.isArray(event.respondTo)&&event.respondTo[0]!=player;
},
logTarget:function(event,player){
if(event.name=='damage') return event.source;
return event.respondTo[0];
},
forced:true,
content:function(){
'step 0'
var target=lib.skill.olfengyan.logTarget(trigger,player);
if(trigger.name=='damage'){
event.target=target;
player.draw();
}
else{
target.draw();
target.chooseToDiscard(2,'he',true);
event.finish();
}
'step 1'
var num=player.countCards('he');
if(!num) event.finish();
else if(num==1) event._result={bool:true,cards:player.getCards('he')};
else player.chooseCard('he',true,'交给'+get.translation(target)+'一张牌');
'step 2'
if(result.bool) target.gain(result.cards,player,'giveAuto');
},
},
//张燕 //张燕
olsuji:{ olsuji:{
audio:2, audio:2,
@ -25945,7 +26041,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
skill_feiyi_A_info:'出牌阶段各限一次,若你的手牌数为:①奇数,你可以摸三张牌,然后弃置至少一半手牌(向下取整);②偶数,你可以弃置至少一半手牌,然后摸三张牌。', skill_feiyi_A_info:'出牌阶段各限一次,若你的手牌数为:①奇数,你可以摸三张牌,然后弃置至少一半手牌(向下取整);②偶数,你可以弃置至少一半手牌,然后摸三张牌。',
skill_feiyi_B:'技能', skill_feiyi_B:'技能',
skill_feiyi_B_info:'每回合每项限一次当你的手牌数变为1后你可以展示此唯一手牌A并摸一张牌然后你选择一项①本回合使用点数大于A的点数的牌额外结算一次②本回合使用点数小于A的点数的牌额外结算一次。', skill_feiyi_B_info:'每回合每项限一次当你的手牌数变为1后你可以展示此唯一手牌A并摸一张牌然后你选择一项①本回合使用点数大于A的点数的牌额外结算一次②本回合使用点数小于A的点数的牌额外结算一次。',
ol_lvboshe:'吕伯奢', lvboshe:'吕伯奢',
skill_lvboshe:'技能', skill_lvboshe:'技能',
skill_lvboshe_info:'农民的回合结束时:阴,你可以令地主进行一个额外回合;阳,你可以令其进行一个额外回合。', skill_lvboshe_info:'农民的回合结束时:阴,你可以令地主进行一个额外回合;阳,你可以令其进行一个额外回合。',
zhangyan:'张燕', zhangyan:'张燕',
@ -25953,6 +26049,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
olsuji_info:'一名角色的出牌阶段开始时,若其已受伤,你可以将一张黑色牌当【杀】使用。若其受到此【杀】的伤害,你获得其一张牌。', olsuji_info:'一名角色的出牌阶段开始时,若其已受伤,你可以将一张黑色牌当【杀】使用。若其受到此【杀】的伤害,你获得其一张牌。',
ollangdao:'狼蹈', ollangdao:'狼蹈',
ollangdao_info:'当你使用【杀】指定唯一目标时你可以与该目标角色同时选择一项1.令此【杀】伤害基数+12.令你可以为此【杀】多选择一个目标3.令此【杀】不可被响应。然后若没有角色因此【杀】死亡,你移除本次被选择的项。', ollangdao_info:'当你使用【杀】指定唯一目标时你可以与该目标角色同时选择一项1.令此【杀】伤害基数+12.令你可以为此【杀】多选择一个目标3.令此【杀】不可被响应。然后若没有角色因此【杀】死亡,你移除本次被选择的项。',
ol_dingshangwan:'OL丁尚涴',
ol_dingshangwan_prefix:'OL',
olfudao:'抚悼',
olfudao_info:'①游戏开始时,你选择弃置或摸至多四张牌,然后记录你的手牌数。②一名角色的回合结束时,若其手牌数和你发动〖抚悼①〗记录的数值相同,则你可以与其各摸一张牌。',
olfengyan:'讽言',
olfengyan_info:'锁定技。①当你受到其他角色造成的伤害后,你摸一张牌,然后交给其一张牌。②当你响应其他角色使用的牌时,其摸一张牌,然后弃置两张牌。',
sp_tianji:'天极·皇室宗亲', sp_tianji:'天极·皇室宗亲',

View File

@ -12363,6 +12363,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
luotong:['dc_luotong','luotong'], luotong:['dc_luotong','luotong'],
dc_wangchang:['dc_wangchang','tw_wangchang'], dc_wangchang:['dc_wangchang','tw_wangchang'],
guozhao:['guozhao','xin_guozhao'], guozhao:['guozhao','xin_guozhao'],
dingshangwan:['dingshangwan','ol_dingshangwan'],
}, },
translate:{ translate:{
puyuan:'蒲元', puyuan:'蒲元',

View File

@ -19928,8 +19928,10 @@
game.playAudio(path); game.playAudio(path);
} }
} }
else if(lib.character[player.name]&&lib.character[player.name][4].contains('die_audio')){ else if(lib.character[player.name]&&lib.character[player.name][4].some(tag=>tag.startsWith('die_audio'))){
game.playAudio('die',player.name); var tag=lib.character[player.name][4].find(tag=>tag.startsWith('die_audio'));
var list=tag.split(':').slice(1);
game.playAudio('die',list.length?list[0]:player.name);
} }
else{ else{
game.playAudio('die',player.name,function(){ game.playAudio('die',player.name,function(){