ddd于禁【整军】bugfix+写法简化

This commit is contained in:
mengxinzxz 2024-03-24 13:15:03 +08:00
parent 18de0e78ee
commit b55934be8b
2 changed files with 38 additions and 48 deletions

View File

@ -1637,22 +1637,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(player.hasSkill('dddzhengjun_hp')) return false;
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=>{
if(event.getg&&event.getg(target)&&event.getg(target).length){
return !player.hasSkill('dddzhengjun_hs')&&target.countCards('h')==player.countCards('h');
}
if(event.getg&&event.getg(target)&&event.getg(target).length&&hs_check(player,target)) return true;
const evt=event.getl(target);
if(evt){
if(evt.hs&&evt.hs.length){
return !player.hasSkill('dddzhengjun_hs')&&target.countCards('h')==player.countCards('h');
}
if(evt.es&&evt.es.length){
return !player.hasSkill('dddzhengjun_es')&&target.countCards('e')==player.countCards('e')&&player.canMoveCard(null,true,target);
}
}
return false;
if(evt&&evt.hs&&evt.hs.length&&hs_check(player,target)) return true;
if(event.name=='equip'&&event.player==target&&(!evt||evt.cards.length!=1)&&es_check) return true;
return evt&&evt.es&&evt.es.length&&es_check;
});
},
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){
if(trigger.name=='damage'||trigger.name=='loseHp'||trigger.name=='recover'){
let list=['失去体力','cancel2'];
@ -1674,25 +1674,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
else{
let map={};
const hs_targets=game.filterPlayer(target=>{
if(trigger.getg&&trigger.getg(target)&&trigger.getg(target).length){
return !player.hasSkill('dddzhengjun_hs')&&target.countCards('h')==player.countCards('h');
}
if(!get.info('dddzhengjun').hs_check) return false;
if(trigger.getg&&trigger.getg(target)&&trigger.getg(target).length) return true;
const evt=trigger.getl(target);
if(evt){
if(evt.es&&evt.es.length){
return !player.hasSkill('dddzhengjun_es')&&target.countCards('e')==player.countCards('e')&&player.canMoveCard(null,true,target);
}
}
return false;
return evt&&evt.hs&&evt.hs.length;
});
const es_targets=game.filterPlayer(target=>{
if(!get.info('dddzhengjun').es_check) return false;
const evt=trigger.getl(target);
if(evt){
if(evt.es&&evt.es.length){
return !player.hasSkill('dddzhengjun_es')&&target.countCards('e')==player.countCards('e')&&player.canMoveCard(null,true,target);
}
}
return false;
if(trigger.name=='equip'&&trigger.player==target&&(!evt||evt.cards.length!=1)) return true;
return evt&&evt.es&&evt.es.length;
});
if(hs_targets.length){
let target;

View File

@ -6620,16 +6620,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var target=result.targets[0];
player.logSkill('cixiao',target);
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();
'step 2'
@ -6670,16 +6660,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
}).concat(result.targets),'green');
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();
'step 4'
@ -6726,7 +6706,26 @@ game.import('character',function(lib,game,ui,get,ai,_status){
marktext:'子',
intro:{
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',
},