Merge pull request #945 from copcap/dev

刘繇主公技重写;同名替换补充;bugfix
This commit is contained in:
Spmario233 2024-02-14 18:51:47 +08:00 committed by GitHub
commit 01990ed554
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 107 additions and 78 deletions

View File

@ -71,12 +71,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
characterReplace:{
shen_zhangliao:['ol_zhangliao','shen_zhangliao'],
shen_zhaoyun:['shen_zhaoyun','old_shen_zhaoyun','boss_zhaoyun'],
shen_zhaoyun:['shen_zhaoyun','dc_zhaoyun','old_shen_zhaoyun','boss_zhaoyun'],
shen_guanyu:['shen_guanyu','tw_shen_guanyu'],
shen_sunquan:['shen_sunquan','junk_sunquan'],
shen_lvmeng:['shen_lvmeng','tw_shen_lvmeng'],
shen_machao:['shen_machao','ps_shen_machao'],
shen_jiaxu:['le_shen_jiaxu','shen_jiaxu'],
shen_caocao:['shen_caocao','old_caocao'],
},
characterFilter:{
shen_diaochan(mode){

View File

@ -11618,7 +11618,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
gaoxiang:['gaoxiang','jsrg_gaoxiang'],
lingcao:['lingcao','dc_lingcao'],
sp_menghuo:['sp_menghuo','dc_sp_menghuo'],
sunchen:['dc_sunchen','ps_sunchen'],
sunchen:['dc_sunchen','pe_sunchen'],
},
translate:{
re_panfeng:'潘凤',

View File

@ -7734,7 +7734,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
xuhuang:['re_xuhuang','ol_xuhuang','sb_xuhuang','xuhuang'],
menghuo:['menghuo','re_menghuo','sb_menghuo','tw_menghuo'],
zhurong:['zhurong','ol_zhurong','re_zhurong','sb_zhurong'],
sunjian:['sunjian','ol_sunjian','re_sunjian'],
sunjian:['sunjian','ol_sunjian','re_sunjian','tw_ol_sunjian'],
jiaxu:['jiaxu','re_jiaxu','ns_jiaxu','ps_jiaxu'],
dongzhuo:['dongzhuo','ol_dongzhuo','re_dongzhuo','sp_dongzhuo','yj_dongzhuo'],
dengai:['dengai','ol_dengai','re_dengai'],
@ -7749,7 +7749,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
guanqiujian:['guanqiujian','re_guanqiujian','tw_guanqiujian','old_guanqiujian'],
chendao:['chendao','ns_chendao','old_chendao'],
zhugezhan:['zhugezhan','old_zhugezhan'],
ol_lusu:['re_lusu','ol_lusu'],
ol_lusu:['re_lusu','ol_lusu','dc_sb_lusu'],
zhanghe:['zhanghe','re_zhanghe','sb_zhanghe'],
yl_luzhi:['yl_luzhi','sb_yl_luzhi','tw_yl_luzhi'],
sunliang:['sunliang','xin_sunliang'],

View File

@ -26010,6 +26010,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
fanjiangzhangda:['fanjiangzhangda','jsrg_fanjiangzhangda'],
simalang:['re_simalang','simalang'],
zhugedan:['re_zhugedan','zhugedan'],
zhangren:['jsrg_zhangren','zhangren'],
wenqin:['ol_wenqin','pe_wenqin'],
},
translate:{
"xinfu_lingren":"凌人",

View File

@ -2349,7 +2349,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
zhugeliang:['zhugeliang','re_zhugeliang','sb_zhugeliang','ps2066_zhugeliang','ps_zhugeliang'],
huangyueying:['huangyueying','re_huangyueying','junk_huangyueying','sb_huangyueying'],
sunquan:['sunquan','re_sunquan','sb_sunquan','dc_sunquan'],
zhouyu:['zhouyu','re_zhouyu','sb_zhouyu','ps1062_zhouyu','ps2080_zhouyu'],
zhouyu:['zhouyu','re_zhouyu','dc_sb_zhouyu','sb_zhouyu','ps1062_zhouyu','ps2080_zhouyu'],
luxun:['luxun','re_luxun','jsrg_luxun'],
lvmeng:['lvmeng','re_lvmeng','sb_lvmeng'],
huanggai:['huanggai','re_huanggai','sb_huanggai'],

View File

@ -2021,80 +2021,103 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
},
//刘繇
twniju: {
unique: true,
audio: 2,
zhuSkill: true,
trigger: { player: 'compare', target: 'compare' },
filter: function (event, player) {
return !event.iwhile && player.hasZhuSkill('twniju');
twniju:{
audio:2,
zhuSkill:true,
trigger:{
global:'compare',
},
direct: true,
content: function () {
'step 0'
var list = ['我加', '他加', '我减', '他减', 'cancel2'];
player.chooseControl(list).set('prompt', get.prompt2('twniju')).set('ai', function () { return ['我加', '他减'].randomGet() });
'step 1'
if (result.control != 'cancel2') {
player.logSkill('twniju');
var num = game.countPlayer(function (current) {
return current.group == 'qun';
});
event.num = num;
switch (result.control) {
case '我加':
player.popup('+', num);
if (player == trigger.player) {
trigger.num1 += num;
if (trigger.num1 > 13) trigger.num1 = 13;
priority:1,
filter(event,player){
if(!player.hasZhuSkill('twniju')) return false;
if(event.iwhile||(event.target&&event.compareMeanwhile)) return false;
return true;
},
direct:true,
async content(event,trigger,player){
const num=game.countPlayer(current=>current.group==='qun');
const dialog=[
get.prompt('twniju'),
`<div class="text center">令一张拼点牌的点数+${num}或-${num}</div>`,
[[
['addNumber','增加'],
['subtractNumber','减少']
],'tdnodes'],
];
const lose_list=trigger.lose_list.slice().sort((a,b)=>lib.sort.seat(a[0],b[0]));
dialog.push(`<div class="text center">${lose_list.map(list=>{
return get.translation(list[0]);
}).join('  /  ')}</div>`);
const cards=lose_list.map(list=>list[1]).flat();
dialog.push(cards);
const result=await player.chooseButton(dialog,2)
.set('filterButton',button=>{
const type=typeof button.link;
if(ui.selected.buttons.length&&type===typeof ui.selected.buttons[0].link) return false;
return true;
})
.forResult()
if(!result.bool) return;
const {links}=result;
if(typeof links[0]!=='string') links.reverse();
let [fn,card]=links;
const selectedPlayer=lose_list[cards.indexOf(card)][0];
player.logSkill('twniju',selectedPlayer);
selectedPlayer.addTempSkill('twniju_change');
if(!selectedPlayer.storage.twniju_change) selectedPlayer.storage.twniju_change=[];
selectedPlayer.storage.twniju_change.push([fn,num,card]);
player.when('chooseToCompareAfter')
.filter(evt=>evt===trigger)
.vars({
toDraw:num,
})
.then(()=>{
const num1=trigger.result.num1,num2=trigger.result.num2;
let bool=false;
if(typeof num1==='number'&&typeof num2==='number'){
if(num1===num2){
bool=true;
}
else {
trigger.num2 += num;
if (trigger.num2 > 13) trigger.num2 = 13;
}
else{
const num1List=num1.toUniqued();
const totalList=num1List.concat(num2).toUniqued();
if(totalList.length<num1List.length+num2.length){
bool=true;
}
game.log(player, '的拼点牌点数+', num);
break;
case '他加':
trigger.target.popup('+', num);
if (player == trigger.player) {
trigger.num2 += num;
if (trigger.num2 > 13) trigger.num2 = 13;
}
else {
trigger.num1 += num;
if (trigger.num1 > 13) trigger.num1 = 13;
}
game.log(trigger.target, '的拼点牌点数+', num);
break;
case '我减':
player.popup('-', num);
if (player == trigger.player) {
trigger.num1 -= num;
if (trigger.num1 < 1) trigger.num1 = 1;
}
else {
trigger.num2 -= num;
if (trigger.num2 < 1) trigger.num2 = 1;
}
game.log(player, '的拼点牌点数-', num);
break;
case '他减':
trigger.target.popup('-', num);
if (player == trigger.player) {
trigger.num2 -= num;
if (trigger.num2 < 1) trigger.num2 = 1;
}
else {
trigger.num1 -= num;
if (trigger.num1 < 1) trigger.num1 = 1;
}
game.log(trigger.target, '的拼点牌点数-', num);
break;
}
if(bool) player.draw(toDraw);
})
},
subSkill:{
change:{
trigger:{global:'compare'},
filter(event,player){
const storage=player.getStorage('twniju_change');
if(!storage.length) return false;
if((player!==event.player||event.iwhile)&&player!==event.target) return false;
return event.lose_list.some(list=>{
const cards=Array.isArray(list[1])?list[1]:[list[1]];
return list[0]===player&&storage.some(s=>cards.includes(s[2]));
});
},
charlotte:true,
forced:true,
silent:true,
async content(event,trigger,player){
const [fn,num]=player.getStorage('twniju_change').find(s=>{
return trigger.lose_list.some(list=>{
const cards=Array.isArray(list[1])?list[1]:[list[1]];
return list[0]===player&&cards.includes(s[2]);
});
});
const numId=player===trigger.player?'num1':'num2';
trigger[fn](numId,num);
if(trigger[numId]>13) trigger[numId]=13;
else if(trigger[numId]<1) trigger[numId]=1;
game.log(player,'的拼点牌点数',fn==='addNumber'?'+':'-',num);
}
}
else event.finish();
'step 2'
if (trigger.num1 == trigger.num2) player.draw(num);
},
},
},
//刘虞
@ -15952,7 +15975,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
twzhuiting:'坠廷',
twzhuiting_info:'主公技,当一张锦囊牌即将对你生效时,其他魏势力角色和群势力角色可将一张与此牌颜色相同的牌当作【无懈可击】使用。',
twniju:'逆拒',
twniju_info:'主公技,当你的拼点牌亮出后,你可以令其中一张拼点牌的点数+X或-X然后若这两张牌的点数相等你摸X张牌X为场上群势力角色数。',
twniju_info:'主公技。当你的拼点牌亮出后,你可以令本次拼点事件中的一张拼点牌的点数+X或-X。然后当本次拼点事件结束后若有两张拼点牌的点数相等你摸X张牌X为场上群势力角色数。',
ol_liuyu:'TW刘虞',
ol_liuyu_prefix:'TW',
twchongwang:'崇望',

View File

@ -3774,7 +3774,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
characterReplace:{
yanghu:['jin_yanghu','dc_yanghu','sp_yanghu'],
jiachong:['jin_jiachong','jiachong'],
jiachong:['dc_jiachong','jin_jiachong','jiachong'],
yangyan:['yangyan','old_yangyan'],
yangzhi:['yangzhi','old_yangzhi'],
},

View File

@ -8123,7 +8123,10 @@ export const Content = {
var owner = get.owner(cards[0]);
if (owner) {
event.relatedLose = owner.lose(cards, ui.special).set('getlx', false);
if (cardInfo && !cardInfo.blankCard) event.relatedLose.set('visible',true);
if (cardInfo && !cardInfo.blankCard) {
event.relatedLose.set('visible', true);
event.set('visible', true);
}
}
else if (get.position(cards[0]) == 'c') event.updatePile = true;
}