【'+get.translation(lib.translate[storage.current2+'_ab']||get.translation(storage.current2).slice(0,2))+'】
'+get.skillInfoTranslation(storage.current2,player)+'
');
if(storage&&storage.character.length){
if(player.isUnderControl(true)){
dialog.addSmall([storage.character,(item,type,position,noclick,node)=>lib.skill.rehuashen.$createButton(item,type,position,noclick,node)]);
}
else{
dialog.addText('共有'+get.cnNumber(storage.character.length)+'张“化身”');
}
}
else{
return '没有化身';
}
},
content:function(storage,player){
return '共有'+get.cnNumber(storage.character.length)+'张“化身”'
},
markcount:function(storage,player){
if(storage&&storage.character) return storage.character.length;
return 0;
},
},
},
rexinsheng:{
unique:true,
audio:2,
trigger:{player:'damageEnd'},
frequent:true,
content:function(){
'step 0'
event.num=trigger.num;
'step 1'
lib.skill.rehuashen.addHuashens(player,1);
'step 2'
if(--event.num>0&&player.hasSkill(event.name)&&!get.is.blocked(event.name,player)){
player.chooseBool(get.prompt2('rexinsheng')).set('frequentSkill',event.name);
}
else event.finish();
'step 3'
if(result.bool&&player.hasSkill('rexinsheng')){
player.logSkill('rexinsheng');
event.goto(1);
}
},
},
reguhuo:{
audio:2,
derivation:'rechanyuan',
enable:['chooseToUse','chooseToRespond'],
hiddenCard:function(player,name){
return lib.inpile.contains(name)&&player.countCards('h')>0&&!player.hasSkill('reguhuo_phase');
},
filter:function(event,player){
if(!player.countCards('hs')||player.hasSkill('reguhuo_phase')) return false;
for(var i of lib.inpile){
var type=get.type(i);
if((type=='basic'||type=='trick')&&event.filterCard({name:i},player,event)) return true;
if(i=='sha'){
for(var j of lib.inpile_nature){
if(event.filterCard({name:i,nature:j},player,event)) return true;
}
}
}
return false;
},
chooseButton:{
dialog:function(){
var list=[];
for(var i of lib.inpile){
var type=get.type(i);
if(type=='basic'||type=='trick') list.push([type,'',i]);
if(i=='sha'){
for(var j of lib.inpile_nature) list.push(['基本','','sha',j]);
}
}
return ui.create.dialog('蛊惑',[list,'vcard']);
},
filter:function(button,player){
var evt=_status.event.getParent();
return evt.filterCard({name:button.link[2],nature:button.link[3]},player,evt);
},
check:function(button){
var player=_status.event.player;
var rand=_status.event.getParent().getRand('reguhuo');
var hasEnemy=game.hasPlayer(function(current){
return current!=player&&!current.hasSkill('rechanyuan')&&(get.realAttitude||get.attitude)(current,player)<0;
});
var card={name:button.link[2],nature:button.link[3]};
var val=_status.event.getParent().type=='phase'?player.getUseValue(card):1;
if(val<=0) return 0;
if(hasEnemy&&rand>0.3){
if(!player.countCards('h',function(cardx){
if(card.name==cardx.name){
if(card.name!='sha') return true;
return get.is.sameNature(card,cardx);
}
return false;
})) return 0;
return 3*val;
}
return val;
},
backup:function(links,player){
return {
viewAs:{
name:links[0][2],
nature:links[0][3],
suit:'none',
number:null,
},
filterCard:function(card,player,target){
var result=true;
var suit=card.suit,number=card.number;
card.suit='none';card.number=null;
var mod=game.checkMod(card,player,'unchanged','cardEnabled2',player);
if(mod!='unchanged') result=mod;
card.suit=suit;card.number=number;
return result;
},
position:'hs',
ignoreMod:true,
ai1:function(card){
var player=_status.event.player;
var hasEnemy=game.hasPlayer(function(current){
return current!=player&&!current.hasSkill('rechanyuan')&&(get.realAttitude||get.attitude)(current,player)<0;
});
var rand=_status.event.getRand('reguhuo');
var cardx=lib.skill.reguhuo_backup.viewAs;
if(hasEnemy&&rand>0.3){
if(card.name==cardx.name&&(card.name!='sha'||get.is.sameNature(card,cardx))) return 10;
return 0;
}
return 6-get.value(card);
},
precontent:function(){
player.logSkill('reguhuo');
player.addTempSkill('reguhuo_guess');
var card=event.result.cards[0];
event.result.card.suit=get.suit(card);
event.result.card.number=get.number(card);
},
}
},
prompt:function(links){
return '将一张手牌当做'+(get.translation(links[0][3])||'')+get.translation(links[0][2])+'使用';
},
},
ai:{
fireAttack:true,
respondShan:true,
respondSha:true,
skillTagFilter:function(player){
if(!player.countCards('hs')||player.hasSkill('reguhuo_phase')) return false;
},
order:10,
result:{
player:1,
},
threaten:1.3,
},
},
reguhuo_guess:{
trigger:{
player:['useCardBefore','respondBefore'],
},
forced:true,
silent:true,
popup:false,
charlotte:true,
firstDo:true,
filter:function(event,player){
return event.skill&&event.skill.indexOf('reguhuo_')==0;
},
content:function(){
'step 0'
player.addTempSkill('reguhuo_phase');
event.fake=false;
var card=trigger.cards[0];
if(card.name!=trigger.card.name||(card.name=='sha'&&!get.is.sameNature(trigger.card,card))) event.fake=true;
//player.logSkill('reguhuo');
player.line(trigger.targets,get.nature(trigger.card));
event.cardTranslate=get.translation(trigger.card.name);
trigger.card.number=get.number(card);
trigger.card.suit=get.suit(card);
//trigger.line=false;
trigger.skill='reguhuo_backup';
if(trigger.card.name=='sha'&&get.natureList(trigger.card).length) event.cardTranslate=get.translation(trigger.card.nature)+event.cardTranslate;
player.popup(event.cardTranslate,trigger.name=='useCard'?'metal':'wood');
event.prompt='是否质疑'+get.translation(player)+'声明的'+event.cardTranslate+'?';
game.log(player,'声明了','#y'+event.cardTranslate);
event.targets=game.filterPlayer(function(current){
return current!=player&&!current.hasSkill('rechanyuan');
}).sortBySeat();
event.targets2=event.targets.slice(0);
player.lose(card,ui.ordering).relatedEvent=trigger;
if(!event.targets.length) event.goto(5);
else if(_status.connectMode) event.goto(3);
event.betrays=[];
'step 1'
event.target=targets.shift();
event.target.chooseButton([event.prompt,[['reguhuo_ally','reguhuo_betray'],'vcard']],true,function(button){
var player=_status.event.player;
var evt=_status.event.getParent('reguhuo_guess');
if(!evt) return Math.random();
var ally=button.link[2]=='reguhuo_ally';
if(ally&&(player.hp<=1||get.attitude(player,evt.player)>=0)) return 1.1;
return Math.random();
});
'step 2'
if(result.links[0][2]=='reguhuo_betray'){
event.betrays.push(target);
target.addExpose(0.2);
}
event.goto(targets.length?1:5);
'step 3'
var list=event.targets.map(function(target){
return [target,[event.prompt,[['reguhuo_ally','reguhuo_betray'],'vcard']],true];
});
player.chooseButtonOL(list).set('switchToAuto',function(){
_status.event.result='ai';
}).set('processAI',function(){
var choice=Math.random()>0.5?'reguhuo_ally':'reguhuo_betray';
var player=_status.event.player;
var evt=_status.event.getParent('reguhuo_guess');
if(player.hp<=1||evt&&(get.realAttitude||get.attitude)(player,evt.player)>=0) choice='reguhuo_ally';
return {
bool:true,
links:[['','',choice]],
}
});
'step 4'
for(var i in result){
if(result[i].links[0][2]=='reguhuo_betray'){
event.betrays.push(lib.playerOL[i]);
lib.playerOL[i].addExpose(0.2);
}
}
'step 5'
for(var i of event.targets2){
var b=event.betrays.contains(i);
i.popup(b?'质疑':'不质疑',b?'fire':'wood');
game.log(i,b?'#y质疑':'#g不质疑');
}
game.delay();
'step 6'
player.showCards(trigger.cards);
if(event.betrays.length){
event.betrays.sortBySeat();
if(event.fake){
game.asyncDraw(event.betrays);
trigger.cancel();
trigger.getParent().goto(0);
game.log(player,'声明的','#y'+event.cardTranslate,'作废了')
}
else{
var next=game.createEvent('reguhuo_final',false);
event.next.remove(next);
trigger.after.push(next);
next.targets=event.betrays;
next.setContent(lib.skill.reguhuo_guess.contentx);
event.finish();
}
}
else event.finish();
'step 7'
game.delayx();
},
contentx:function(){
'step 0'
event.target=targets.shift();
event.target.chooseToDiscard('弃置一张牌或失去1点体力').set('ai',function(card){
return 9-get.value(card);
});
'step 1'
if(!result.bool) target.loseHp();
'step 2'
target.addSkillLog('rechanyuan');
if(targets.length) event.goto(0);
},
},
reguhuo_backup:{},
reguhuo_phase:{},
rechanyuan:{
init:function(player,skill){
if(player.hp<=1){
player.logSkill(skill);
player.addSkill('rechanyuan_log');
}
player.addSkillBlocker(skill);
},
onremove:function(player,skill){
player.removeSkill('rechanyuan_log');
player.removeSkillBlocker(skill);
},
skillBlocker:function(skill,player){
return skill!='chanyuan'&&skill!='rechanyuan'&&!lib.skill[skill].charlotte&&player.hp<=1;
},
mark:true,
intro:{
content:function(storage,player,skill){
var str='