增加国战首亮摸牌、珠联璧合
修正鬼才、奇策的问题
This commit is contained in:
libccy 2015-04-29 13:33:18 +08:00
parent cdf6a46988
commit 6473848f06
8 changed files with 70 additions and 17 deletions

View File

@ -104,6 +104,11 @@ card.guozhan={
target.chooseToDiscard(2,'he',true).ai=ai.get.disvalue; target.chooseToDiscard(2,'he',true).ai=ai.get.disvalue;
}, },
ai:{ ai:{
wuxie:function(target,card,player,viewer){
if(lib.config.mode=='guozhan'){
return 0;
}
},
basic:{ basic:{
useful:4, useful:4,
value:4, value:4,

View File

@ -113,7 +113,7 @@ character.refresh={
} }
"step 2" "step 2"
if(result.bool){ if(result.bool){
player.logSkill('guicai'); player.logSkill('reguicai');
if(trigger.player.judging.clone) trigger.player.judging.clone.delete(); if(trigger.player.judging.clone) trigger.player.judging.clone.delete();
ui.discardPile.appendChild(trigger.player.judging); ui.discardPile.appendChild(trigger.player.judging);
trigger.player.judging=result.cards[0]; trigger.player.judging=result.cards[0];

View File

@ -1548,6 +1548,7 @@ character.sp={
} }
}, },
ai:{ ai:{
threaten:0.8,
expose:0.1 expose:0.1
} }
}, },

View File

@ -1269,17 +1269,11 @@ character.xianjian={
huimeng:{ huimeng:{
trigger:{player:'recoverAfter'}, trigger:{player:'recoverAfter'},
frequent:true, frequent:true,
// filter:function(event,player){
// if(event.cards){
// for(var i=0;i<event.cards.length;i++){
// if(get.color(event.cards[i])!='red') return false;
// }
// return true;
// }
// return false;
// },
content:function(){ content:function(){
player.draw(2); player.draw(2);
},
ai:{
threaten:0.8
} }
}, },
tianshe:{ tianshe:{

View File

@ -2091,7 +2091,7 @@ character.yijiang={
var num=0; var num=0;
var cards=player.get('h'); var cards=player.get('h');
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
num+=ai.get.value(cards[i]); num+=Math.max(0,ai.get.value(cards[i],player,'raw'));
} }
num/=cards.length; num/=cards.length;
num*=Math.min(cards.length,player.hp); num*=Math.min(cards.length,player.hp);
@ -3079,11 +3079,13 @@ character.yijiang={
"step 2" "step 2"
if(result.bool){ if(result.bool){
player.storage.zyexin.remove(event.card); player.storage.zyexin.remove(event.card);
player.$give(event.card,result.targets[0]); game.delay();
if(get.type(event.card)=='equip'){ if(get.type(event.card)=='equip'){
player.$give(event.card,result.targets[0]);
result.targets[0].equip(event.card); result.targets[0].equip(event.card);
} }
else if(get.type(event.card)=='delay'){ else if(get.type(event.card)=='delay'){
player.$throw(event.card);
result.targets[0].addJudge(event.card); result.targets[0].addJudge(event.card);
} }
player.logSkill('zpaiyi',result.targets); player.logSkill('zpaiyi',result.targets);

View File

@ -130,6 +130,7 @@ window.config={
mode_config:'游戏模式', mode_config:'游戏模式',
player_number_config:'角色个数', player_number_config:'角色个数',
difficulty_config:'AI对人类态度', difficulty_config:'AI对人类态度',
initshow_draw_config:'首亮摸牌',
ai_strategy_config:'内奸策略', ai_strategy_config:'内奸策略',
ai_identity_config:'身份预知', ai_identity_config:'身份预知',
keep_max_hp_config:'锁定体力上限', keep_max_hp_config:'锁定体力上限',
@ -282,10 +283,13 @@ window.config={
}, },
show_identity:true, show_identity:true,
difficulty:'normal', difficulty:'normal',
dierestart:true
}, },
guozhan:{ guozhan:{
double_hp:'pingjun', double_hp:'pingjun',
difficulty:'normal', difficulty:'normal',
initshow_draw:0,
dierestart:true
} }
}, },

View File

@ -1454,7 +1454,9 @@ window.play={};
ui.clear(); ui.clear();
}, },
draw:function(){ draw:function(){
if(event.log!=false){
game.log(get.translation(player)+'摸了'+get.cnNumber(num)+'张牌'); game.log(get.translation(player)+'摸了'+get.cnNumber(num)+'张牌');
}
var cards=get.cards(num); var cards=get.cards(num);
if(event.animate!=false){ if(event.animate!=false){
player.gain(cards,'draw'); player.gain(cards,'draw');
@ -5635,7 +5637,7 @@ window.play={};
"step 0" "step 0"
var end=player; var end=player;
do{ do{
player.draw(num,false); player.draw(num,false).log=false;
player=player.next; player=player.next;
} }
while(player!=end); while(player!=end);
@ -5655,7 +5657,7 @@ window.play={};
game.pause(); game.pause();
"step 3" "step 3"
if(event.bool){ if(event.bool){
game.me.lose(game.me.get('h')); game.me.lose(game.me.get('h'))._triggered=null;
} }
else{ else{
event.dialog.close(); event.dialog.close();
@ -5664,7 +5666,7 @@ window.play={};
} }
"step 4" "step 4"
game.delay(); game.delay();
if(!game.me.skills.contains('yuling')) game.me.draw(num,false); game.me.gain(get.cards(4))._triggered=null;
"step 5" "step 5"
event.goto(2); event.goto(2);
} }
@ -6533,6 +6535,9 @@ window.play={};
if(i=='difficulty'&&lib.config.current_mode[i]==true){ if(i=='difficulty'&&lib.config.current_mode[i]==true){
modeconfig.push(ui.create.switcher('difficulty',['easy','normal','hard'],get.config('difficulty'),ui.click.sidebar.difficulty)); modeconfig.push(ui.create.switcher('difficulty',['easy','normal','hard'],get.config('difficulty'),ui.click.sidebar.difficulty));
} }
else if(i=='initshow_draw'&&lib.config.current_mode[i]==true){
modeconfig.push(ui.create.switcher('initshow_draw',[0,1,2],get.config('initshow_draw'),ui.click.sidebar.initshow_draw));
}
else if(i=='ai_strategy'&&lib.config.current_mode[i]==true){ else if(i=='ai_strategy'&&lib.config.current_mode[i]==true){
modeconfig.push(ui.create.switcher('ai_strategy', modeconfig.push(ui.create.switcher('ai_strategy',
['ai_strategy_1','ai_strategy_2','ai_strategy_3','ai_strategy_4','ai_strategy_5','ai_strategy_6'], ['ai_strategy_1','ai_strategy_2','ai_strategy_3','ai_strategy_4','ai_strategy_5','ai_strategy_6'],
@ -8470,6 +8475,9 @@ window.play={};
difficulty:function(bool){ difficulty:function(bool){
game.saveConfig('difficulty',bool,true); game.saveConfig('difficulty',bool,true);
}, },
initshow_draw:function(bool){
game.saveConfig('initshow_draw',bool,true);
},
ai_strategy:function(strategy){ ai_strategy:function(strategy){
game.saveConfig('ai_strategy',strategy,true); game.saveConfig('ai_strategy',strategy,true);
}, },

View File

@ -421,6 +421,14 @@ mode.guozhan={
this.classList.remove('unseen2'); this.classList.remove('unseen2');
break; break;
} }
var initdraw=get.config('initshow_draw');
if(!_status.initshown&&initdraw){
this.popup('首亮');
game.log(get.translation(this)+'首先明置武将,得到奖励');
game.log(get.translation(this)+'摸了'+get.cnNumber(initdraw)+'张牌');
this.draw(initdraw).log=false;
_status.initshown=true;
}
for(var i=0;i<skills.length;i++){ for(var i=0;i<skills.length;i++){
this.hiddenSkills.remove(skills[i]); this.hiddenSkills.remove(skills[i]);
this.addSkill(skills[i]); this.addSkill(skills[i]);
@ -431,14 +439,44 @@ mode.guozhan={
next.player=this; next.player=this;
next.content=function(){ next.content=function(){
"step 0" "step 0"
player.chooseBool('是否摸一张牌?'); player.chooseBool('你的武将有单独的阴阳鱼,是否摸一张牌?');
"step 1" "step 1"
if(result.bool){ if(result.bool){
player.draw(); player.draw();
} }
} }
} }
if(this.perfectPair()){
var next=game.createEvent('guozhanDraw');
next.player=this;
next.content=function(){
"step 0"
player.popup('珠联璧合');
game.log(get.translation(player)+'发动了【珠联璧合】');
if(player.hp==player.maxHp){
player.draw(2);
event.finish();
} }
else{
player.chooseControl('draw_card','recover_hp',function(){
if(player.hp>=2||player.hp>=player.maxHp-1) return 'draw_card';
if(player.hp==2&&player.num('h')==0) return 'draw_card';
return 'recover_hp';
},ui.create.dialog('hidden','珠联璧合:选择一项奖励'));
}
"step 1"
if(result.control=='draw_card'){
player.draw(2);
}
else{
player.recover();
}
}
}
}
},
perfectPair:function(){
return false;
}, },
siege:function(player){ siege:function(player){
if(game.players.length==2) return false; if(game.players.length==2) return false;
@ -683,6 +721,7 @@ mode.guozhan={
}, },
config:{ config:{
player_number:true, player_number:true,
initshow_draw:true,
free_choose:true, free_choose:true,
change_choice:true, change_choice:true,
change_card:true, change_card:true,