ddd于禁【整军】bugfix+写法简化
This commit is contained in:
parent
18de0e78ee
commit
b55934be8b
|
@ -1637,22 +1637,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
if(player.hasSkill('dddzhengjun_hp')) return false;
|
if(player.hasSkill('dddzhengjun_hp')) return false;
|
||||||
return event.player.getHp()==player.getHp();
|
return event.player.getHp()==player.getHp();
|
||||||
}
|
}
|
||||||
|
const info=get.info('dddzhengjun');
|
||||||
|
const hs_check=info.hs_check,es_check=info.es_check;
|
||||||
return game.hasPlayer(target=>{
|
return game.hasPlayer(target=>{
|
||||||
if(event.getg&&event.getg(target)&&event.getg(target).length){
|
if(event.getg&&event.getg(target)&&event.getg(target).length&&hs_check(player,target)) return true;
|
||||||
return !player.hasSkill('dddzhengjun_hs')&&target.countCards('h')==player.countCards('h');
|
|
||||||
}
|
|
||||||
const evt=event.getl(target);
|
const evt=event.getl(target);
|
||||||
if(evt){
|
if(evt&&evt.hs&&evt.hs.length&&hs_check(player,target)) return true;
|
||||||
if(evt.hs&&evt.hs.length){
|
if(event.name=='equip'&&event.player==target&&(!evt||evt.cards.length!=1)&&es_check) return true;
|
||||||
return !player.hasSkill('dddzhengjun_hs')&&target.countCards('h')==player.countCards('h');
|
return evt&&evt.es&&evt.es.length&&es_check;
|
||||||
}
|
|
||||||
if(evt.es&&evt.es.length){
|
|
||||||
return !player.hasSkill('dddzhengjun_es')&&target.countCards('e')==player.countCards('e')&&player.canMoveCard(null,true,target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
hs_check(player,target){
|
||||||
|
return !player.hasSkill('dddzhengjun_hs')&&target.countCards('h')==player.countCards('h');
|
||||||
|
},
|
||||||
|
es_check(player,target){
|
||||||
|
return !player.hasSkill('dddzhengjun_hs')&&target.countCards('h')==player.countCards('h');
|
||||||
|
},
|
||||||
async cost(event,trigger,player){
|
async cost(event,trigger,player){
|
||||||
if(trigger.name=='damage'||trigger.name=='loseHp'||trigger.name=='recover'){
|
if(trigger.name=='damage'||trigger.name=='loseHp'||trigger.name=='recover'){
|
||||||
let list=['失去体力','cancel2'];
|
let list=['失去体力','cancel2'];
|
||||||
|
@ -1674,25 +1674,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
else{
|
else{
|
||||||
let map={};
|
let map={};
|
||||||
const hs_targets=game.filterPlayer(target=>{
|
const hs_targets=game.filterPlayer(target=>{
|
||||||
if(trigger.getg&&trigger.getg(target)&&trigger.getg(target).length){
|
if(!get.info('dddzhengjun').hs_check) return false;
|
||||||
return !player.hasSkill('dddzhengjun_hs')&&target.countCards('h')==player.countCards('h');
|
if(trigger.getg&&trigger.getg(target)&&trigger.getg(target).length) return true;
|
||||||
}
|
|
||||||
const evt=trigger.getl(target);
|
const evt=trigger.getl(target);
|
||||||
if(evt){
|
return evt&&evt.hs&&evt.hs.length;
|
||||||
if(evt.es&&evt.es.length){
|
|
||||||
return !player.hasSkill('dddzhengjun_es')&&target.countCards('e')==player.countCards('e')&&player.canMoveCard(null,true,target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
});
|
});
|
||||||
const es_targets=game.filterPlayer(target=>{
|
const es_targets=game.filterPlayer(target=>{
|
||||||
|
if(!get.info('dddzhengjun').es_check) return false;
|
||||||
const evt=trigger.getl(target);
|
const evt=trigger.getl(target);
|
||||||
if(evt){
|
if(trigger.name=='equip'&&trigger.player==target&&(!evt||evt.cards.length!=1)) return true;
|
||||||
if(evt.es&&evt.es.length){
|
return evt&&evt.es&&evt.es.length;
|
||||||
return !player.hasSkill('dddzhengjun_es')&&target.countCards('e')==player.countCards('e')&&player.canMoveCard(null,true,target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
});
|
});
|
||||||
if(hs_targets.length){
|
if(hs_targets.length){
|
||||||
let target;
|
let target;
|
||||||
|
|
|
@ -6620,16 +6620,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
var target=result.targets[0];
|
var target=result.targets[0];
|
||||||
player.logSkill('cixiao',target);
|
player.logSkill('cixiao',target);
|
||||||
target.addSkills('panshi');
|
target.addSkills('panshi');
|
||||||
// 彩蛋
|
|
||||||
var str;
|
|
||||||
if(target.name.indexOf('lvbu')!=-1){
|
|
||||||
str='公若不弃,布愿拜为义父';
|
|
||||||
} else if(target.sex=='male'){
|
|
||||||
str='我是'+get.translation(player)+'的义子';
|
|
||||||
} else if(target.sex=='female'){
|
|
||||||
str='我是'+get.translation(player)+'的义女';
|
|
||||||
} else str='我们是'+get.translation(player)+'的义子和义女';
|
|
||||||
target.storage.panshi=str;
|
|
||||||
}
|
}
|
||||||
event.finish();
|
event.finish();
|
||||||
'step 2'
|
'step 2'
|
||||||
|
@ -6670,16 +6660,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
}
|
}
|
||||||
}).concat(result.targets),'green');
|
}).concat(result.targets),'green');
|
||||||
target.addSkills('panshi');
|
target.addSkills('panshi');
|
||||||
// 彩蛋
|
|
||||||
var str;
|
|
||||||
if(target.name.indexOf('lvbu')!=-1){
|
|
||||||
str='公若不弃,布愿拜为义父';
|
|
||||||
} else if(target.sex=='male'){
|
|
||||||
str='我是'+get.translation(player)+'的义子';
|
|
||||||
} else if(target.sex=='female'){
|
|
||||||
str='我是'+get.translation(player)+'的义女';
|
|
||||||
} else str='我们是'+get.translation(player)+'的义子和义女';
|
|
||||||
target.storage.panshi=str;
|
|
||||||
}
|
}
|
||||||
else event.finish();
|
else event.finish();
|
||||||
'step 4'
|
'step 4'
|
||||||
|
@ -6726,7 +6706,26 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
marktext:'子',
|
marktext:'子',
|
||||||
intro:{
|
intro:{
|
||||||
name:'义子',
|
name:'义子',
|
||||||
content:'$',
|
//content:'我是儿子',
|
||||||
|
//R·I·P——永远怀念:被棘手砍掉的“我是儿子”
|
||||||
|
content(_,player){
|
||||||
|
const targets=game.filterPlayer2(target=>target.hasSkill('cixiao',null,null,false)).sortBySeat(player);
|
||||||
|
if(!targets.length) return '我义父呢?!';
|
||||||
|
if(['name','name1','name2'].some(name=>{
|
||||||
|
if(!player[name]||!get.character(player[name])||typeof get.translation(player[name])!='string') return false;
|
||||||
|
return player[name].includes('lvbu')&&get.translation(player[name]).includes('吕布');
|
||||||
|
})) return '公若不弃,布愿拜为义父';
|
||||||
|
return '我是'+get.translation(targets)+'的'+((player)=>{
|
||||||
|
switch(player.sex){
|
||||||
|
case 'female':
|
||||||
|
return '义女';
|
||||||
|
case 'double':
|
||||||
|
return '义子义女';
|
||||||
|
default:
|
||||||
|
return '义子';
|
||||||
|
}
|
||||||
|
})(player);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
group:'panshi_damage',
|
group:'panshi_damage',
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue