戚乱、窃听、智囊修正,木牛AI
This commit is contained in:
parent
c486dec226
commit
4705ff37db
|
@ -132,6 +132,7 @@ card.refresh={
|
||||||
var dialog=ui.create.dialog('木牛流马',player.get('e','5').cards);
|
var dialog=ui.create.dialog('木牛流马',player.get('e','5').cards);
|
||||||
var trigger=event.parent.parent;
|
var trigger=event.parent.parent;
|
||||||
player.chooseButton(dialog,function(button){
|
player.chooseButton(dialog,function(button){
|
||||||
|
if(get.info(button.link).selectTarget==-1){
|
||||||
if(get.type(button.link)=='delay') return -1;
|
if(get.type(button.link)=='delay') return -1;
|
||||||
if(get.type(button.link)=='equip'){
|
if(get.type(button.link)=='equip'){
|
||||||
var current=player.get('e',{subtype:get.subtype(button.link)})[0];
|
var current=player.get('e',{subtype:get.subtype(button.link)})[0];
|
||||||
|
@ -139,6 +140,8 @@ card.refresh={
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if(get.tag(button.link,'multitarget')) return -1;
|
if(get.tag(button.link,'multitarget')) return -1;
|
||||||
|
if(button.link.name=='huoshaolianying') return -1;
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}).filterButton=function(button){
|
}).filterButton=function(button){
|
||||||
return trigger.filterCard(button.link,player,trigger);
|
return trigger.filterCard(button.link,player,trigger);
|
||||||
|
|
|
@ -424,12 +424,15 @@ character.jiange={
|
||||||
event.cards2.push(event.cards[i]);
|
event.cards2.push(event.cards[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(event.cards2.length==0){
|
if(!event.isMine()){
|
||||||
player.showCards(event.cards);
|
player.showCards(event.cards);
|
||||||
event.target=player;
|
}
|
||||||
|
"step 1"
|
||||||
|
if(event.cards2.length==0){
|
||||||
|
event.finish();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
var dialog=ui.create.dialog('将三张牌中的锦囊牌或装备牌交给一名角色');
|
var dialog=ui.create.dialog('将三张牌中的锦囊牌或装备牌交给一名角色','hidden');
|
||||||
dialog.add(event.cards);
|
dialog.add(event.cards);
|
||||||
for(var i=0;i<dialog.buttons.length;i++){
|
for(var i=0;i<dialog.buttons.length;i++){
|
||||||
if(event.cards2.contains(dialog.buttons[i].link)){
|
if(event.cards2.contains(dialog.buttons[i].link)){
|
||||||
|
@ -442,7 +445,7 @@ character.jiange={
|
||||||
var next=player.chooseTarget(true,dialog);
|
var next=player.chooseTarget(true,dialog);
|
||||||
next.ai=function(target){
|
next.ai=function(target){
|
||||||
if(player.num('j','lebu')){
|
if(player.num('j','lebu')){
|
||||||
if(target==player) return 0;
|
if(target==player) return 0.1;
|
||||||
}
|
}
|
||||||
var att=ai.get.attitude(player,target);
|
var att=ai.get.attitude(player,target);
|
||||||
if(player.num('h')>player.hp){
|
if(player.num('h')>player.hp){
|
||||||
|
@ -451,16 +454,13 @@ character.jiange={
|
||||||
if(target==player) return att+5;
|
if(target==player) return att+5;
|
||||||
return att;
|
return att;
|
||||||
}
|
}
|
||||||
if(!event.isMine()){
|
|
||||||
dialog.style.display='none';
|
|
||||||
}
|
}
|
||||||
}
|
"step 2"
|
||||||
"step 1"
|
|
||||||
if(result&&result.targets&&result.targets.length){
|
if(result&&result.targets&&result.targets.length){
|
||||||
event.target=result.targets[0];
|
event.target=result.targets[0];
|
||||||
}
|
}
|
||||||
if(event.cards2.length){
|
if(event.cards2.length){
|
||||||
event.target.gain(event.cards2,'gain');
|
event.target.gain(event.cards2,'gain2');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ai:{
|
ai:{
|
||||||
|
|
|
@ -980,23 +980,38 @@ character.sp={
|
||||||
trigger:{source:'dieAfter'},
|
trigger:{source:'dieAfter'},
|
||||||
forced:true,
|
forced:true,
|
||||||
priority:-10,
|
priority:-10,
|
||||||
content:function(){
|
silent:true,
|
||||||
if(_status.currentPhase!=trigger.player){
|
popup:false,
|
||||||
player.addSkill('qiluan2')
|
filter:function(event){
|
||||||
}
|
return _status.currentPhase!=event.player;
|
||||||
else{
|
|
||||||
player.draw(3);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
content:function(){
|
||||||
|
player.storage.qiluan=true;
|
||||||
|
},
|
||||||
|
group:['qiluan2','qiluan3']
|
||||||
},
|
},
|
||||||
qiluan2:{
|
qiluan2:{
|
||||||
trigger:{global:'phaseAfter'},
|
trigger:{global:'phaseAfter'},
|
||||||
forced:true,
|
forced:true,
|
||||||
|
filter:function(event,player){
|
||||||
|
return player.storage.qiluan?true:false;
|
||||||
|
},
|
||||||
content:function(){
|
content:function(){
|
||||||
player.draw(3);
|
player.draw(3);
|
||||||
player.removeSkill('qiluan2');
|
player.storage.qiluan=false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
qiluan3:{
|
||||||
|
trigger:{source:'dieAfter'},
|
||||||
|
forced:true,
|
||||||
|
priority:-10,
|
||||||
|
filter:function(event){
|
||||||
|
return _status.currentPhase==event.player;
|
||||||
|
},
|
||||||
|
content:function(){
|
||||||
|
player.draw(3);
|
||||||
|
},
|
||||||
|
},
|
||||||
shangyi:{
|
shangyi:{
|
||||||
enable:'phaseUse',
|
enable:'phaseUse',
|
||||||
usable:1,
|
usable:1,
|
||||||
|
|
|
@ -1001,6 +1001,7 @@ character.yijiang={
|
||||||
},
|
},
|
||||||
qieting:{
|
qieting:{
|
||||||
global:'qieting2',
|
global:'qieting2',
|
||||||
|
globalSilent:true,
|
||||||
trigger:{global:'phaseEnd'},
|
trigger:{global:'phaseEnd'},
|
||||||
filter:function(event,player){
|
filter:function(event,player){
|
||||||
return event.player!=player&&!event.player.tempSkills['qieting3'];
|
return event.player!=player&&!event.player.tempSkills['qieting3'];
|
||||||
|
|
|
@ -303,6 +303,16 @@ mode.guozhan={
|
||||||
ifo.init(game.players[i]);
|
ifo.init(game.players[i]);
|
||||||
game.players[i].initedSkills.push(game.players[i].hiddenSkills[j]);
|
game.players[i].initedSkills.push(game.players[i].hiddenSkills[j]);
|
||||||
}
|
}
|
||||||
|
if(ifo.globalSilent){
|
||||||
|
if(typeof ifo.global=='string'){
|
||||||
|
lib.skill.global.add(ifo.global);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
for(var j=0;j<ifo.global.length;j++){
|
||||||
|
lib.skill.global.add(ifo.global[j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ui.auto.show();
|
// ui.auto.show();
|
||||||
|
@ -422,7 +432,7 @@ mode.guozhan={
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
var initdraw=get.config('initshow_draw');
|
var initdraw=get.config('initshow_draw');
|
||||||
if(!_status.initshown&&initdraw){
|
if(!_status.initshown&&initdraw&&this.isAlive()){
|
||||||
this.popup('首亮');
|
this.popup('首亮');
|
||||||
game.log(get.translation(this)+'首先明置武将,得到奖励');
|
game.log(get.translation(this)+'首先明置武将,得到奖励');
|
||||||
game.log(get.translation(this)+'摸了'+get.cnNumber(initdraw)+'张牌');
|
game.log(get.translation(this)+'摸了'+get.cnNumber(initdraw)+'张牌');
|
||||||
|
|
Loading…
Reference in New Issue