Merge pull request #691 from mengxinzxz/PR-Branch

small bugfix
This commit is contained in:
Spmario233 2023-12-01 23:17:09 +08:00 committed by GitHub
commit 401221398e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 45 additions and 51 deletions

View File

@ -5111,8 +5111,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:2, audio:2,
trigger:{player:'phaseJieshuBegin'}, trigger:{player:'phaseJieshuBegin'},
filter:function(event,player){ filter:function(event,player){
var num=player.storage.mobileyanzhu?player.maxHp:player.hp; return (player.storage.mobileyanzhu?player.maxHp:player.hp)>0;
return num>0;
}, },
direct:true, direct:true,
content:function(){ content:function(){
@ -5144,7 +5143,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
'step 3' 'step 3'
if(event.current&&event.current.countCards('he')){ if(event.current&&event.current.countCards('he')){
if(player.storage.mobileyanzhu||event.targets2.length==1) event.current.chooseCard('选择一张牌置于牌堆顶','he',true); if(!player.storage.mobileyanzhu||event.targets2.length==1) event.current.chooseCard('选择一张牌置于牌堆顶','he',true);
else event.current.chooseCardTarget({ else event.current.chooseCardTarget({
prompt:'将一张牌置于牌堆顶,或交给其他目标角色', prompt:'将一张牌置于牌堆顶,或交给其他目标角色',
filterCard:true, filterCard:true,
@ -5212,7 +5211,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.removeSkill('mobileyanzhu'); player.removeSkill('mobileyanzhu');
player.storage.mobileyanzhu=true; player.storage.mobileyanzhu=true;
player.popup('兴学'); player.popup('兴学');
game.log(player,'修改了技能','【兴学】'); game.log(player,'修改了技能','#g【兴学】');
} }
else{ else{
player.gainPlayerCard(target,true,'hej'); player.gainPlayerCard(target,true,'hej');

View File

@ -4165,7 +4165,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
init:function(player){ init:function(player){
if(!player.storage.huashen){ if(!player.storage.huashen){
player.storage.huashen={ player.storage.huashen={
shown:[],
owned:{} owned:{}
}; };
} }
@ -4173,11 +4172,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
intro:{ intro:{
content:function(storage,player){ content:function(storage,player){
var str=''; var str='';
var slist=storage.owned; var list=Object.keys(storage.owned);
var list=[];
for(var i in slist){
list.push(i);
}
if(list.length){ if(list.length){
str+=get.translation(list[0]); str+=get.translation(list[0]);
for(var i=1;i<list.length;i++){ for(var i=1;i<list.length;i++){
@ -4190,36 +4185,29 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
return str; return str;
}, },
onunmark:function(storage,player){
_status.characterlist.addArray(Object.keys(storage.owned));
storage.owned=[];
},
mark:function(dialog,content,player){ mark:function(dialog,content,player){
var slist=content.owned; var list=Object.keys(content.owned);
var list=[];
for(var i in slist){
list.push(i);
}
if(list.length){ if(list.length){
dialog.addSmall([list,(item,type,position,noclick,node)=>lib.skill.rehuashen.$createButton(item,type,position,noclick,node)]); var skill=player.storage.huashen.current2;
} var character=player.storage.huashen.current;
for(var i=0;i<dialog.buttons.length;i++){ if(skill&&character){
if(!player.isUnderControl(true)){ dialog.addSmall([[character],(item,type,position,noclick,node)=>lib.skill.rehuashen.$createButton(item,type,position,noclick,node)]);
if(!content.shown.contains(dialog.buttons[i].link)){ dialog.add('<div><div class="skill">【'+get.translation(lib.translate[skill+'_ab']||get.translation(skill).slice(0,2))+'】</div>'+
dialog.buttons[i].node.group.remove(); '<div>'+get.skillInfoTranslation(skill,player)+'</div></div>');
dialog.buttons[i].node.hp.remove();
dialog.buttons[i].node.intro.remove();
dialog.buttons[i].node.name.innerHTML=get.verticalStr('未知');
dialog.buttons[i].node.name.dataset.nature='';
dialog.buttons[i].style.background='';
dialog.buttons[i]._nointro=true;
dialog.buttons[i].classList.add('menubg');
}
} }
if(dialog.buttons[i].link==player.storage.huashen.current){ if(player.isUnderControl(true)){
dialog.buttons[i].classList.add('glow2'); dialog.addSmall([list,(item,type,position,noclick,node)=>lib.skill.rehuashen.$createButton(item,type,position,noclick,node)]);
}
else{
dialog.addText('共有'+get.cnNumber(list.length)+'张“化身”');
} }
} }
var skill=player.storage.huashen.current2; else{
if(skill){ return '没有化身';
dialog.add('<div><div class="skill">【'+get.translation(lib.translate[skill+'_ab']||get.translation(skill).slice(0,2))+'】</div>'+
'<div>'+get.skillInfoTranslation(skill,player)+'</div></div>');
} }
} }
}, },
@ -4425,7 +4413,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
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){
player.storage.huashen.current=character; player.storage.huashen.current=character;
player.storage.huashen.shown.add(character);
player.markSkill('huashen'); player.markSkill('huashen');
game.broadcastAll(function(character,player){ game.broadcastAll(function(character,player){
player.sex=lib.character[character][0]; player.sex=lib.character[character][0];

View File

@ -12790,25 +12790,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
var name=button.link[2]; var name=button.link[2];
var evt=_status.event.getParent(); var evt=_status.event.getParent();
if(get.type(name)=='basic'){ if(evt.type=='phase'){
var card={name:name,nature:button.link[3],isCard:true};
if(name=='shan') return 2; if(name=='shan') return 2;
if(evt.type=='dying'){ if(evt.type=='dying'){
if(get.attitude(player,evt.dying)<2) return false; if(get.attitude(player,evt.dying)<2) return false;
if(name=='jiu') return 2.1; if(name=='jiu') return 2.1;
return 1.9; return 1.9;
} }
if(evt.type=='phase') return player.getUseValue({name:name,nature:button.link[3],isCard:true}); return player.getUseValue(card);
return 1;
} }
if(!['chuqibuyi','shuiyanqijunx','juedou','nanman','wanjian','shunshou','zhujinqiyuan'].contains(name)) return 0; return 1;
var card={name:name,isCard:true};
if(['shunshou','zhujinqiyuan'].contains(card.name)){
if(!game.hasPlayer(function(current){
return get.attitude(player,current)!=0&&get.distance(player,current)<=1&&player.canUse(card,current)&&get.effect(current,card,player,player)>0;
})) return 0;
return player.getUseValue(card)-7;
}
return player.getUseValue(card)-4;
}, },
backup:function(links,player){ backup:function(links,player){
if(typeof links[1]=='number') links.reverse(); if(typeof links[1]=='number') links.reverse();
@ -12852,10 +12844,26 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var name=(tag=='respondSha'?'sha':'shan'); var name=(tag=='respondSha'?'sha':'shan');
return !player.storage.youlong2.contains(name); return !player.storage.youlong2.contains(name);
}, },
order:1, order:function(item,player){
result:{ if(player&&_status.event.type=='phase'){
player:1, var max=0,add=false;
var type=player.storage.youlong?'basic':'trick';
var list=lib.inpile.filter(name=>get.type(name)==type&&!player.storage.youlong2.includes(name));
if(list.includes('sha')) add=true;
list=list.map(namex=>{return {name:namex,isCard:true}});
if(add) lib.inpile_nature.forEach(naturex=>list.push({name:'sha',nature:naturex,isCard:true}));
for(var card of list){
if(player.getUseValue(card)>0){
var temp=get.order(card);
if(temp>max) max=temp;
}
}
if(max>0) max+=0.3;
return max;
}
return 1;
}, },
result:{player:1},
}, },
}, },
youlong_true:{charlotte:true}, youlong_true:{charlotte:true},