ddd于禁【镇军】技能效果更正
This commit is contained in:
parent
96da56b860
commit
2999b19b3f
298
character/ddd.js
298
character/ddd.js
|
@ -1630,185 +1630,147 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
dddzhengjun:{
|
dddzhengjun:{
|
||||||
trigger:{
|
trigger:{global:['damageEnd','loseHpEnd','recoverEnd','loseAfter','equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter']},
|
||||||
global:['loseAfter','equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter'],
|
|
||||||
},
|
|
||||||
filter(event,player){
|
filter(event,player){
|
||||||
if(!player.isPhaseUsing()) return false;
|
if(!player.isPhaseUsing()) return false;
|
||||||
var boolh=!player.hasSkill('dddzhengjun_handcard',null,false,false),boole=(!player.hasSkill('dddzhengjun_equip')&&player.canMoveCard(null,true));
|
if(event.name=='damage'||event.name=='loseHp'||event.name=='recover'){
|
||||||
var hs=player.countCards('h'),es=player.countCards('e');
|
if(player.hasSkill('dddzhengjun_hp')) return false;
|
||||||
return game.hasPlayer(function(current){
|
return event.player.getHp()==player.getHp();
|
||||||
// if(player==current) return false;
|
}
|
||||||
if(boolh&¤t.countCards('h')==hs){
|
return game.hasPlayer(target=>{
|
||||||
var num=event.getl(current).hs.length;
|
if(event.getg&&event.getg(target)&&event.getg(target).length){
|
||||||
if(event.getg) num-=event.getg(current).length;
|
return !player.hasSkill('dddzhengjun_hs')&&target.countCards('h')==player.countCards('h');
|
||||||
if(num!=0) return game.hasPlayer(current=>{
|
|
||||||
if(player==current) return false;
|
|
||||||
return current.countCards('h')==player.countCards('h');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
if(boole&¤t.countCards('e')==es){
|
const evt=event.getl(target);
|
||||||
var num=event.getl(current).es.length;
|
if(evt){
|
||||||
if(event.name=='equip'&¤t==event.player) num--;
|
if(evt.hs&&evt.hs.length){
|
||||||
if(num!=0) return game.hasPlayer(current=>{
|
return !player.hasSkill('dddzhengjun_hs')&&target.countCards('h')==player.countCards('h');
|
||||||
if(player==current) return false;
|
}
|
||||||
return current.countCards('e')==player.countCards('e');
|
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 false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
direct:true,
|
async cost(event,trigger,player){
|
||||||
*content(event,map){
|
if(trigger.name=='damage'||trigger.name=='loseHp'||trigger.name=='recover'){
|
||||||
var player=map.player,trigger=map.trigger;
|
let list=['失去体力','cancel2'];
|
||||||
var boolh=!player.hasSkill('dddzhengjun_handcard',null,false,false),hs=player.countCards('h');
|
if(trigger.player.isDamaged()) list.unshift('回复体力');
|
||||||
if(boolh&&game.hasPlayer(function(current){
|
const {result:{control}}=await player.chooseControl(list)
|
||||||
// if(player==current) return false;
|
.set('prompt',get.prompt('dddzhengjun',trigger.player))
|
||||||
if(boolh&¤t.countCards('h')==hs){
|
.set('prompt2','令'+get.translation(event.player)+'执行其中一项')
|
||||||
var num=trigger.getl(current).hs.length;
|
.set('ai',()=>{
|
||||||
if(trigger.getg) num-=trigger.getg(current).length;
|
const player=get.event('player'),target=get.event().getTrigger().player;
|
||||||
if(num!=0) return game.hasPlayer(current=>{
|
if(get.event('controls').includes('回复体力')&&get.recoverEffect(target,player,player)>0) return '回复体力';
|
||||||
if(player==current) return false;
|
return get.effect(target,{name:'losehp'},player,player)>0?'失去体力':'cancel2';
|
||||||
return current.countCards('h')==player.countCards('h');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
})){
|
|
||||||
var result=yield player.chooseTarget(get.prompt('dddzhengjun'),'令一名手牌数与你相等的其他角色摸或弃置一张牌',(card,player,target)=>{
|
|
||||||
return player.countCards('h')==target.countCards('h')&&player!=target;
|
|
||||||
}).set('ai',target=>{
|
|
||||||
var player=get.player();
|
|
||||||
return Math.max(get.effect(target,{name:'draw'},player,player),get.effect(target,{name:'guohe'},player,player)/2);
|
|
||||||
});
|
});
|
||||||
if(result.bool){
|
event.result={
|
||||||
var target=result.targets[0];
|
bool:control!='cancel2',
|
||||||
var choices=['摸牌'];
|
targets:[trigger.player],
|
||||||
if(target.countCards('he')) choices.push('弃牌');
|
cost_data:control,
|
||||||
result=yield player.chooseControl(choices).set('prompt',`整军:请选择一项`).set('prompt2',`令${get.translation(target)}摸一张牌或弃置一张牌`).set('ai',()=>{
|
};
|
||||||
return get.event('choice');
|
|
||||||
}).set('choice',get.attitude(player,target)>0||!choices.includes('弃牌')?0:1);
|
|
||||||
player.logSkill('dddzhengjun',target);
|
|
||||||
player.addTempSkill('dddzhengjun_handcard','phaseUseAfter');
|
|
||||||
if(result.control=='摸牌') target.draw();
|
|
||||||
else target.chooseToDiscard('he',true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
var boole=(!player.hasSkill('dddzhengjun_equip')&&player.canMoveCard(null,true)),es=player.countCards('h');
|
else{
|
||||||
if(boolh&&game.hasPlayer(function(current){
|
let map={};
|
||||||
// if(player==current) return false;
|
const hs_targets=game.filterPlayer(target=>{
|
||||||
if(boole&¤t.countCards('e')==es){
|
if(trigger.getg&&trigger.getg(target)&&trigger.getg(target).length){
|
||||||
var num=trigger.getl(current).es.length;
|
return !player.hasSkill('dddzhengjun_hs')&&target.countCards('h')==player.countCards('h');
|
||||||
if(trigger.name=='equip'&&trigger.player==current) num--;
|
}
|
||||||
if(num!=0) return game.hasPlayer(current=>{
|
const evt=trigger.getl(target);
|
||||||
if(player==current) return false;
|
if(evt){
|
||||||
return current.countCards('e')==player.countCards('e');
|
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 false;
|
||||||
var result=yield player.chooseBool(get.prompt('dddzhengjun'),'移动一名装备区牌数与你相等的其他角色装备区里的一张牌').set('ai',function(){
|
});
|
||||||
var targets=game.filterPlayer(target=>player.countCards('e')==target.countCards('e')&&player!=target);
|
const es_targets=game.filterPlayer(target=>{
|
||||||
return get.player().canMoveCard(true,true,targets);
|
const evt=trigger.getl(target);
|
||||||
});
|
if(evt){
|
||||||
if(result.bool){
|
if(evt.es&&evt.es.length){
|
||||||
player.logSkill('dddzhengjun');
|
return !player.hasSkill('dddzhengjun_es')&&target.countCards('e')==player.countCards('e')&&player.canMoveCard(null,true,target);
|
||||||
player.addTempSkill('dddzhengjun_equip','phaseUseAfter');
|
}
|
||||||
player.moveCard(true,true,game.filterPlayer(target=>player.countCards('e')==target.countCards('e')&&player!=target));
|
}
|
||||||
}
|
return false;
|
||||||
}
|
});
|
||||||
},
|
if(hs_targets.length){
|
||||||
content_old(){
|
let target;
|
||||||
'step 0'
|
if(hs_targets.length==1) target=hs_targets[0];
|
||||||
var boolh=!player.hasSkill('dddzhengjun_handcard',null,false,false),hs=player.countCards('h');
|
else{
|
||||||
if(boolh&&game.hasPlayer(function(current){
|
target=await player.chooseTarget(get.prompt('dddzhengjun'),'令其中一名角色摸一张牌或弃置一张牌',(card,player,target)=>{
|
||||||
if(player==current) return false;
|
return get.event('targets').includes(target);
|
||||||
if(boolh&¤t.countCards('h')==hs){
|
}).set('ai',target=>{
|
||||||
var num=trigger.getl(current).hs.length;
|
const player=get.event('player');
|
||||||
if(trigger.getg) num-=trigger.getg(current).length;
|
return Math.max(get.effect(target,{name:'guohe_copy2'},target,player),get.effect(target,{name:'draw'},player,player));
|
||||||
if(num!=0) return true;
|
}).set('targets',hs_targets).forResultTargets()[0];
|
||||||
}
|
}
|
||||||
return false;
|
if(target){
|
||||||
})){
|
let list=['摸牌'];
|
||||||
player.chooseTarget('整军:是否令一名角色摸一张牌?').set('ai',function(target){
|
if(target.countCards('h')) list.push('弃牌');
|
||||||
var player=_status.event.player;
|
const {result:{control}}=await player.chooseControl(list,'cancel2')
|
||||||
return get.effect(target,{name:'draw'},player,player);
|
.set('prompt',get.prompt('dddzhengjun',target))
|
||||||
});
|
.set('prompt2','令'+get.translation(target)+'执行其中一项')
|
||||||
}
|
.set('ai',()=>{
|
||||||
else event.goto(2);
|
const player=get.event('player'),target=get.event().getTrigger().player;
|
||||||
'step 1'
|
if(get.event('controls').includes('弃牌')&&get.effect(target,{name:'guohe_copy2'},player,player)>0) return '弃牌';
|
||||||
if(result.bool){
|
return get.effect(target,{name:'draw'},player,player)>0?'摸牌':'cancel2';
|
||||||
var target=result.targets[0];
|
});
|
||||||
player.logSkill('dddzhengjun',target);
|
if(control!='cancel2'){
|
||||||
player.addTempSkill('dddzhengjun_handcard','phaseUseAfter');
|
map.hs_target=[target,control];
|
||||||
target.draw();
|
}
|
||||||
}
|
|
||||||
'step 2'
|
|
||||||
var boole=(!player.hasSkill('dddzhengjun_equip')&&player.canMoveCard(null,true)),es=player.countCards('h');
|
|
||||||
if(boolh&&game.hasPlayer(function(current){
|
|
||||||
if(player==current) return false;
|
|
||||||
if(boole&¤t.countCards('e')==es){
|
|
||||||
var num=trigger.getl(current).es.length;
|
|
||||||
if(trigger.name=='equip'&&trigger.player==current) num--;
|
|
||||||
if(num!=0) return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
})){
|
|
||||||
player.chooseBool('整军:是否移动场上的一张装备牌?').set('ai',function(){
|
|
||||||
return _status.event.player.canMoveCard(true,true);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
else event.finish();
|
|
||||||
'step 3'
|
|
||||||
if(result.bool){
|
|
||||||
player.logSkill('dddzhengjun');
|
|
||||||
player.addTempSkill('dddzhengjun_equip','phaseUseAfter');
|
|
||||||
player.moveCard(true).set('nojudge',true);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
group:'dddzhengjun_hp',
|
|
||||||
subSkill:{
|
|
||||||
equip:{charlotte:true},
|
|
||||||
handcard:{charlotte:true},
|
|
||||||
hp:{
|
|
||||||
trigger:{global:['damageEnd','loseHpEnd','recoverEnd']},
|
|
||||||
direct:true,
|
|
||||||
filter(event,player){
|
|
||||||
if(player.hp!=event.player.hp) return false;
|
|
||||||
if(event.hujia&&event.hujia==event.num) return false;
|
|
||||||
if(!game.hasPlayer(current=>current.getHp()==player.getHp()&¤t!=player)) return false;
|
|
||||||
var evt=event.getParent('phaseUse');
|
|
||||||
if(!evt||evt.player!=player) return false;
|
|
||||||
return !player.hasHistory('useSkill',function(evt){
|
|
||||||
if(evt.skill=='dddzhengjun_hp'){
|
|
||||||
if(evt.event.getParent('phaseUse')==event) return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
content(){
|
|
||||||
'step 0'
|
|
||||||
player.chooseTarget(get.prompt('dddzhengjun'),'令一名体力值与你相等的其他角色回复或失去1点体力',function(card,player,target){
|
|
||||||
return target.getHp()==player.getHp()&&player!=target;
|
|
||||||
}).set('ai',target=>{
|
|
||||||
var player=get.player();
|
|
||||||
return Math.max(get.recoverEffect(target,player,player),get.effect(target,{name:'losehp'},player,player));
|
|
||||||
});
|
|
||||||
'step 1'
|
|
||||||
if(result.bool){
|
|
||||||
var target=result.targets[0];
|
|
||||||
event.target=target;
|
|
||||||
var choices=['失去体力'];
|
|
||||||
if(target.isDamaged()) choices.push('回复体力');
|
|
||||||
player.chooseControl(choices).set('prompt',`整军:请选择一项`).set('prompt2',`令${get.translation(target)}失去1点体力或回复1点体力`).set('ai',()=>{
|
|
||||||
return get.event('choice');
|
|
||||||
}).set('choice',get.recoverEffect(target,player,player)>0&&target.isDamaged()?1:0);
|
|
||||||
}
|
}
|
||||||
else event.finish();
|
|
||||||
'step 2'
|
|
||||||
player.logSkill('dddzhengjun_hp',target);
|
|
||||||
target[result.control=='失去体力'?'loseHp':'draw']();
|
|
||||||
}
|
}
|
||||||
},
|
if(es_targets.length){
|
||||||
|
let target;
|
||||||
|
if(hs_targets.length==1){
|
||||||
|
const {result:{bool}}=await player.chooseBool()
|
||||||
|
.set('prompt',get.prompt('dddzhengjun',hs_targets[0]))
|
||||||
|
.set('prompt2','移动'+get.translation(hs_targets[0])+'的一张装备牌')
|
||||||
|
.set('choice',()=>player.canMoveCard(true,true,hs_targets[0]));
|
||||||
|
if(bool) target=hs_targets[0];
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
target=await player.chooseTarget(get.prompt('dddzhengjun'),'移动其中一名角色的一张装备牌',(card,player,target)=>{
|
||||||
|
return get.event('targets').includes(target);
|
||||||
|
}).set('ai',target=>{
|
||||||
|
const player=get.event('player');
|
||||||
|
return player.canMoveCard(true,true,target)?(1+Math.random()):0;
|
||||||
|
}).set('targets',es_targets).forResultTargets()[0];
|
||||||
|
}
|
||||||
|
if(target){
|
||||||
|
map.es_target=target;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
event.result={
|
||||||
|
bool:(map.hs_target||map.es_target),
|
||||||
|
targets:[(map.hs_target||[])[0]].concat(map.es_target?[map.es_target]:[]),
|
||||||
|
cost_data:map,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async content(event,trigger,player){
|
||||||
|
const data=event.cost_data;
|
||||||
|
if(trigger.name=='damage'||trigger.name=='loseHp'||trigger.name=='recover'){
|
||||||
|
player.addTempSkill('dddzhengjun_hp','phaseUseAfter');
|
||||||
|
await trigger.player[data=='回复体力'?'recover':'loseHp']();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(data.hs_target){
|
||||||
|
player.addTempSkill('dddzhengjun_hs','phaseUseAfter');
|
||||||
|
if(data.hs_target[1]=='摸牌') await data.hs_target[0].draw();
|
||||||
|
else await data.hs_target[0].chooseToDiscard('he',true);
|
||||||
|
}
|
||||||
|
if(data.es_target){
|
||||||
|
player.addTempSkill('dddzhengjun_es','phaseUseAfter');
|
||||||
|
await player.moveCard(true,data.es_target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
subSkill:{
|
||||||
|
hs:{charlotte:true},
|
||||||
|
es:{charlotte:true},
|
||||||
|
hp:{charlotte:true},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
dddxianxi:{
|
dddxianxi:{
|
||||||
|
|
Loading…
Reference in New Issue