难升米, clearMark
This commit is contained in:
parent
81b317b177
commit
bb1df8fabd
172
character/tw.js
172
character/tw.js
|
@ -13814,76 +13814,44 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
renshe:{
|
chijie:{
|
||||||
audio:2,
|
audio:true,
|
||||||
trigger:{player:'damageEnd'},
|
forbid:['guozhan'],
|
||||||
|
trigger:{
|
||||||
|
global:'phaseBefore',
|
||||||
|
player:'enterGame',
|
||||||
|
},
|
||||||
direct:true,
|
direct:true,
|
||||||
|
filter:function(event,player){
|
||||||
|
return (event.name!='phase'||game.phaseNumber==0)&&game.hasPlayer(function(current){
|
||||||
|
return current.group!=player.group&&lib.group.includes(current.group);
|
||||||
|
});
|
||||||
|
},
|
||||||
content:function(){
|
content:function(){
|
||||||
'step 0'
|
'step 0'
|
||||||
var choiceList=['令一名其他角色与你各摸一张牌','令自己下个出牌阶段可以多发动一次【外使】'];
|
var list=lib.group.filter(function(group){
|
||||||
event.count=0;
|
return group!=player.group&&game.hasPlayer(function(current){
|
||||||
if(game.hasPlayer(current=>current!=player)){
|
return current.group==group;
|
||||||
choiceList.shift();
|
});
|
||||||
event.count++;
|
});
|
||||||
}
|
list.push('cancel2');
|
||||||
if(lib.skill.chijie.filter&&lib.skill.chijie.filter({},player)) choiceList.push('将自己的势力变更为场上存在的一个其他势力');
|
player.chooseControl(list).set('prompt',get.prompt('chijie')).set('prompt2','将自己的势力变更为场上存在的一个势力').set('ai',function(){
|
||||||
player.chooseControl('cancel2').set('prompt',get.prompt('renshe')).set('choiceList',choiceList).set('ai',function(){
|
return list.randomGet();
|
||||||
if(game.hasPlayer(function(current){
|
|
||||||
return get.attitude(player,current)>0||current.hasSkillTag('nogain');
|
|
||||||
})) return 0;
|
|
||||||
return 1;
|
|
||||||
});
|
});
|
||||||
'step 1'
|
'step 1'
|
||||||
if(result.control=='cancel2') event.finish();
|
if(result.control!='cancel2'){
|
||||||
else{
|
player.logSkill('chijie');
|
||||||
event.index=result.index;
|
player.changeGroup(result.control);
|
||||||
player.logSkill('renshe');
|
|
||||||
if(event.index+event.count==0){
|
|
||||||
player.chooseTarget('请选择一名角色,与其各摸一张牌',lib.filter.notMe,true).ai=function(target){
|
|
||||||
if(target.hasSkillTag('nogain')) return 0.1;
|
|
||||||
return get.attitude(_status.event.player,target);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else if(result.index+event.count==1){
|
|
||||||
player.storage.waishi++;
|
|
||||||
event.finish();
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
var next=game.createEvent('renshe_changeGroup');
|
|
||||||
next.player=player;
|
|
||||||
next.renshe=true;
|
|
||||||
next.setContent(lib.skill.chijie.content);
|
|
||||||
event.finish();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
'step 2'
|
|
||||||
if(result.bool){
|
|
||||||
player.line(result.targets[0],'green');
|
|
||||||
game.asyncDraw([player,result.targets[0]].sortBySeat());
|
|
||||||
}
|
|
||||||
else event.finish();
|
|
||||||
'step 3'
|
|
||||||
game.delay();
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
waishi:{
|
waishi:{
|
||||||
audio:2,
|
audio:2,
|
||||||
group:'waishi_afterstory',
|
|
||||||
subSkill:{
|
|
||||||
afterstory:{
|
|
||||||
trigger:{player:'phaseUseEnd'},
|
|
||||||
forced:true,
|
|
||||||
silent:true,
|
|
||||||
popup:false,
|
|
||||||
content:function(){player.storage.waishi=1},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
init:function(player,skill){
|
|
||||||
player.storage[skill]=1;
|
|
||||||
},
|
|
||||||
enable:'phaseUse',
|
enable:'phaseUse',
|
||||||
filter:function(event,player){
|
filter:function(event,player){
|
||||||
return typeof player.storage.waishi!='number'||player.storage.waishi>0;
|
let used=player.getStat('skill').waishi;
|
||||||
|
if(used&&used>player.countMark('waishi_remover')) return false;
|
||||||
|
return player.countCards('he')>0&&game.hasPlayer(target=>target!=player&&target.countCards('h')>0);
|
||||||
},
|
},
|
||||||
filterTarget:function(card,player,target){
|
filterTarget:function(card,player,target){
|
||||||
return target!=player&&target.countCards('h')>=ui.selected.cards.length;
|
return target!=player&&target.countCards('h')>=ui.selected.cards.length;
|
||||||
|
@ -13905,11 +13873,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
delay:0,
|
delay:0,
|
||||||
content:function(){
|
content:function(){
|
||||||
'step 0'
|
'step 0'
|
||||||
if(typeof player.storage.waishi!='number') player.storage.waishi=1;
|
player.choosePlayerCard(target,true,'h',cards.length);
|
||||||
player.storage.waishi--;
|
|
||||||
player.choosePlayerCard(target,true,'h',cards.length).chooseonly=true;
|
|
||||||
'step 1'
|
'step 1'
|
||||||
player.swapHandcards(target,cards,result.cards);
|
player.swapHandcards(target,cards,result.cards);
|
||||||
|
game.delayex();
|
||||||
'step 2'
|
'step 2'
|
||||||
if(target.countCards('h')>player.countCards('h')||player.group==target.group) player.draw();
|
if(target.countCards('h')>player.countCards('h')||player.group==target.group) player.draw();
|
||||||
},
|
},
|
||||||
|
@ -13922,36 +13889,79 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
subSkill:{
|
||||||
|
remover:{
|
||||||
|
charlotte:true,
|
||||||
|
onremove:function(player){
|
||||||
|
player.clearMark('waishi_remover',false);
|
||||||
|
},
|
||||||
|
intro:{
|
||||||
|
content:'〖外使〗的发动次数+#',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
chijie:{
|
renshe:{
|
||||||
audio:true,
|
audio:2,
|
||||||
forbid:['guozhan'],
|
trigger:{player:'damageEnd'},
|
||||||
trigger:{
|
|
||||||
global:'phaseBefore',
|
|
||||||
player:'enterGame',
|
|
||||||
},
|
|
||||||
direct:true,
|
direct:true,
|
||||||
filter:function(event,player){
|
|
||||||
return (event.name!='phase'||game.phaseNumber==0)&&game.hasPlayer(function(current){
|
|
||||||
return current.group!=player.group;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
content:function(){
|
content:function(){
|
||||||
'step 0'
|
'step 0'
|
||||||
|
var choiceList=[
|
||||||
|
'将势力变更为场上现存的一个其他势力',
|
||||||
|
'令〖外使〗的发动次数+1直到下个出牌阶段结束',
|
||||||
|
'与另一名其他角色各摸一张牌',
|
||||||
|
];
|
||||||
|
var controls=['选项二'];
|
||||||
|
if(game.hasPlayer(current=>{
|
||||||
|
return current.group!=player.group&&lib.group.includes(current.group);
|
||||||
|
})) controls.unshift('选项一');
|
||||||
|
if(game.hasPlayer(current=>current!=player)) controls.push('选项三');
|
||||||
|
player.chooseControl(controls,'cancel2').set('prompt',get.prompt('renshe')).set('choiceList',choiceList).set('ai',function(){
|
||||||
|
if(game.hasPlayer(function(current){
|
||||||
|
return get.attitude(player,current)>0||current.hasSkillTag('nogain');
|
||||||
|
})) return '选项三'
|
||||||
|
return '选项二';
|
||||||
|
});
|
||||||
|
'step 1'
|
||||||
|
if(result.control=='cancel2') event.finish();
|
||||||
|
else{
|
||||||
|
player.logSkill('renshe');
|
||||||
|
switch(result.control){
|
||||||
|
case '选项一':
|
||||||
|
event.goto(3);
|
||||||
|
break;
|
||||||
|
case '选项二':
|
||||||
|
player.addMark('waishi_remover',1,false);
|
||||||
|
player.addTempSkill('waishi_remover',{player:'phaseUseAfter'});
|
||||||
|
event.finish();
|
||||||
|
break;
|
||||||
|
case '选项三':
|
||||||
|
player.chooseTarget('请选择一名角色,与其各摸一张牌',lib.filter.notMe,true).set('ai',function(target){
|
||||||
|
if(target.hasSkillTag('nogain')) return 0.1;
|
||||||
|
return get.attitude(_status.event.player,target);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'step 2'
|
||||||
|
if(result.bool){
|
||||||
|
var target=result.targets[0];
|
||||||
|
player.line(target,'green');
|
||||||
|
game.asyncDraw([player,target].sortBySeat());
|
||||||
|
}
|
||||||
|
game.delayex();
|
||||||
|
event.finish();
|
||||||
|
'step 3'
|
||||||
var list=lib.group.filter(function(group){
|
var list=lib.group.filter(function(group){
|
||||||
return group!=player.group&&game.hasPlayer(function(current){
|
return group!=player.group&&game.hasPlayer(function(current){
|
||||||
return current.group==group;
|
return current.group==group;
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
if(!event.renshe) list.push('cancel2');
|
player.chooseControl(list).set('prompt',get.prompt('chijie')).set('prompt2','将自己的势力变更为场上存在的一个势力').set('ai',function(){
|
||||||
player.chooseControl(list).set('prompt',event.renshe?'请选择一个势力':get.prompt('chijie')).set('prompt2',event.renshe?'':'将自己的势力变更为场上存在的一个势力').set('',function(){
|
|
||||||
return list.randomGet();
|
return list.randomGet();
|
||||||
});
|
});
|
||||||
'step 1'
|
'step 4'
|
||||||
if(result.control!='cancel2'){
|
player.changeGroup(result.control);
|
||||||
if(!event.renshe) player.logSkill('chijie');
|
|
||||||
player.changeGroup(result.control);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
//英文版特典武将凯撒
|
//英文版特典武将凯撒
|
||||||
|
|
20
game/game.js
20
game/game.js
|
@ -21810,6 +21810,10 @@
|
||||||
this.updateMarks();
|
this.updateMarks();
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
clearMark:function(i,log){
|
||||||
|
let num=this.countMark(i);
|
||||||
|
if(num>0) this.removeMark(i,num,log)
|
||||||
|
},
|
||||||
removeMark:function(i,num,log){
|
removeMark:function(i,num,log){
|
||||||
if(typeof num!='number'||!num) num=1;
|
if(typeof num!='number'||!num) num=1;
|
||||||
if(typeof this.storage[i]!='number'||!this.storage[i]) return;
|
if(typeof this.storage[i]!='number'||!this.storage[i]) return;
|
||||||
|
@ -56788,7 +56792,7 @@
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(i=0;i<game.players.length;i++){
|
for(let i=0;i<game.players.length;i++){
|
||||||
if(game.players[i].isOut()||game.players[i].hasSkill('undist')||game.players[i].isMin(true)) length--;
|
if(game.players[i].isOut()||game.players[i].hasSkill('undist')||game.players[i].isMin(true)) length--;
|
||||||
}
|
}
|
||||||
if(method=='absolute') return n;
|
if(method=='absolute') return n;
|
||||||
|
@ -56806,15 +56810,15 @@
|
||||||
}),equips2=to.getCards('e',function(card){
|
}),equips2=to.getCards('e',function(card){
|
||||||
return !ui.selected.cards||!ui.selected.cards.contains(card);
|
return !ui.selected.cards||!ui.selected.cards.contains(card);
|
||||||
});
|
});
|
||||||
for(i=0;i<equips1.length;i++){
|
for(let i=0;i<equips1.length;i++){
|
||||||
var info=get.info(equips1[i]).distance;
|
let info=get.info(equips1[i]).distance;
|
||||||
if(!info) continue;
|
if(!info) continue;
|
||||||
if(info.globalFrom){
|
if(info.globalFrom){
|
||||||
n+=info.globalFrom;
|
n+=info.globalFrom;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(i=0;i<equips2.length;i++){
|
for(let i=0;i<equips2.length;i++){
|
||||||
var info=get.info(equips2[i]).distance;
|
let info=get.info(equips2[i]).distance;
|
||||||
if(!info) continue;
|
if(!info) continue;
|
||||||
if(info.globalTo){
|
if(info.globalTo){
|
||||||
n+=info.globalTo;
|
n+=info.globalTo;
|
||||||
|
@ -56845,8 +56849,8 @@
|
||||||
return Math.max(range,newRange)
|
return Math.max(range,newRange)
|
||||||
},1);
|
},1);
|
||||||
m+=(1-attakRange);
|
m+=(1-attakRange);
|
||||||
for(i=0;i<equips2.length;i++){
|
for(let i=0;i<equips2.length;i++){
|
||||||
var info=get.info(equips2[i]).distance;
|
let info=get.info(equips2[i]).distance;
|
||||||
if(!info) continue;
|
if(!info) continue;
|
||||||
if(info.attaclTo){
|
if(info.attaclTo){
|
||||||
m+=info.attaclTo;
|
m+=info.attaclTo;
|
||||||
|
@ -56854,7 +56858,7 @@
|
||||||
}
|
}
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
if(method=='unchecked') return n;
|
else if(method=='unchecked') return n;
|
||||||
return Math.max(1,n);
|
return Math.max(1,n);
|
||||||
},
|
},
|
||||||
info:function(item,player){
|
info:function(item,player){
|
||||||
|
|
Loading…
Reference in New Issue