This commit is contained in:
libccy 2017-02-27 01:01:20 +08:00
parent c572a81125
commit b6ca1c972c
4 changed files with 101 additions and 21 deletions

View File

@ -12,7 +12,15 @@ card.guozhan={
distance:{attackFrom:-1},
skills:['feilongduofeng','feilongduofeng2'],
ai:{
equipValue:9
equipValue:function(card,player){
if(player.hasSkill('zhangwu')) return 9;
if(game.hasPlayer(function(current){
return current.hasSkill('zhangwu')&&ai.get.attitude(player,current)<=0;
})){
return 1;
}
return 8;
}
}
},
taipingyaoshu:{
@ -24,7 +32,15 @@ card.guozhan={
nopower:true,
skills:['taipingyaoshu'],
ai:{
equipValue:9
equipValue:function(card,player){
if(player.hasSkill('wendao')) return 9;
if(game.hasPlayer(function(current){
return current.hasSkill('wendao')&&ai.get.attitude(player,current)<=0;
})){
return 1;
}
return 6;
}
},
onLose:function(){
'step 0'
@ -250,15 +266,26 @@ card.guozhan={
target.chooseControl(lib.card.chiling.chooseai).set('prompt','敕令').set('choiceList',choiceList);
'step 1'
if(result.control=='选项一'){
target.showCharacter(2);
target.draw();
target.chooseControl('主将','副将',function(){
return Math.floor(Math.random()*2);
}).set('prompt','选择要明置的武将牌');
}
else if(result.control=='选项二'){
target.loseHp();
event.finish();
}
else{
target.chooseToDiscard('he',{type:'equip'},true);
event.finish();
}
'step 2'
if(result.index==0){
target.showCharacter(0);
}
else{
target.showCharacter(1);
}
target.draw();
},
ai:{
order:6,
@ -891,7 +918,6 @@ card.guozhan={
if(event.targets.length){
var target=event.targets.shift();
event.current=target;
var choiceList=['明置一张武将牌,然后摸一张牌','失去1点体力'];
if(target.num('he',{type:'equip'})){
choiceList.push('弃置一张装备牌');
@ -904,16 +930,27 @@ card.guozhan={
'step 2'
var target=event.current;
if(result.control=='选项一'){
target.showCharacter(2);
target.draw();
target.chooseControl('主将','副将',function(){
return Math.floor(Math.random()*2);
}).set('prompt','选择要明置的武将牌');
}
else if(result.control=='选项二'){
target.loseHp();
event.goto(1);
}
else{
target.chooseToDiscard('he',{type:'equip'},true);
event.goto(1);
}
'step 3'
var target=event.current;
if(result.index==0){
target.showCharacter(0);
}
else{
target.showCharacter(1);
}
target.draw();
event.goto(1);
}
},

View File

@ -6637,7 +6637,19 @@ character.sp={
},
filterTarget:function(card,player,target){
if(get.mode()=='guozhan'){
if(player.identity=='unknown'||player.identity=='ye') return player==target;
if(player==target) return true;
if(player.identity=='ye') return false;
if(player.identity=='unknown'){
if(_status.yeidentity.contains(player._group)){
return false;
}
else if(get.zhu(player)||get.population(player._group)+1<=get.population()/2){
return player._group==target.identity;
}
else{
return false;
}
}
return player.identity==target.identity;
}
else{

View File

@ -11064,7 +11064,12 @@
},
setIdentity:function(identity){
if(!identity) identity=this.identity;
this.node.identity.firstChild.innerHTML=get.translation(identity);
if(get.is.jun(this)){
this.node.identity.firstChild.innerHTML='君';
}
else{
this.node.identity.firstChild.innerHTML=get.translation(identity);
}
this.node.identity.dataset.color=identity;
},
phase:function(){
@ -20527,6 +20532,10 @@
if(!ui.exit){
ui.exit=ui.create.control('退出联机',ui.click.exit);
}
if(ui.giveup){
ui.giveup.remove();
delete ui.giveup;
}
if(game.servermode){
ui.exit.firstChild.innerHTML='返回房间';
setTimeout(function(){
@ -20973,6 +20982,10 @@
ui.auto.hide();
}
if(ui.wuxie) ui.wuxie.hide();
if(ui.giveup){
ui.giveup.remove();
delete ui.giveup;
}
if(lib.config.test_game&&!_status.connectMode){
if(lib.config.test_game!='single'){

View File

@ -297,6 +297,7 @@ mode.guozhan={
_hongfa:{
enable:'chooseToUse',
filter:function(event,player){
if(!event.filterCard({name:'sha'},player)) return false;
var zhu=get.zhu(player,'hongfa');
if(zhu&&zhu.storage.huangjintianbingfu&&zhu.storage.huangjintianbingfu.length>0){
return true;
@ -366,6 +367,9 @@ mode.guozhan={
player.syncStorage('huangjintianbingfu');
player.updateMarks('huangjintianbingfu');
},
ai:{
threaten:2,
},
group:'hongfa_hp',
subSkill:{
hp:{
@ -465,7 +469,14 @@ mode.guozhan={
wuxin:{
unique:true,
trigger:{player:'phaseDrawBegin'},
frequent:true,
// frequent:'check',
// check:function(event,player){
// var num=get.population('qun');
// if(player.hasSkill('huangjintianbingfu')){
// num+=player.storage.huangjintianbingfu.length;
// }
// return num>event.num;
// },
content:function(){
'step 0'
var num=get.population('qun');
@ -487,6 +498,9 @@ mode.guozhan={
zhangwu:{
unique:true,
forceunique:true,
ai:{
threaten:2,
},
group:['zhangwu_gain','zhangwu_draw','zhangwu_clear','zhangwu_count'],
subSkill:{
gain:{
@ -768,11 +782,12 @@ mode.guozhan={
"step 1"
if(result.bool){
var target=result.targets[0];
player.logSkill('yuanhu',target);
player.logSkill('huyuan',target);
target.equip(result.cards[0]);
if(target!=player){
player.$give(result.cards,target);
}
game.delay();
player.chooseTarget(true,'弃置一名角色的一张牌',function(card,player,target){
var source=_status.event.source;
return get.distance(source,target)<=1&&source!=target&&target.num('he');
@ -836,7 +851,7 @@ mode.guozhan={
},
content:function(){
"step 0"
target.viewCards(player+'的手牌',player.get('h'));
target.viewCards(get.translation(player)+'的手牌',player.get('h'));
"step 1"
if(!target.num('h')){
event._result={index:1};
@ -1666,7 +1681,7 @@ mode.guozhan={
return Math.random()<0.5?3:(Math.random()<0.5?2:1);
}
if(choice==0) return 0;
if(get.population(group)>0&&get.totalPopulation(group)+1<=get.population()/2){
if(get.population(group)>0&&player.wontYe()){
return Math.random()<0.2?(Math.random()<0.5?3:(Math.random()<0.5?2:1)):0;
}
var nming=0;
@ -1725,7 +1740,7 @@ mode.guozhan={
if(popu>=2||(popu==1&&game.players.length<=4)){
return true;
}
if(get.population(group)>0&&get.totalPopulation(group)+1<=get.population()/2){
if(get.population(group)>0&&player.wontYe()){
return Math.random()<0.2?true:false;
}
var nming=0;
@ -3200,14 +3215,11 @@ mode.guozhan={
}
},yelist,this.group);
}
else if(get.zhu(this)){
else if(this.wontYe()){
this.identity=this.group;
}
else if(_status.yeidentity.contains(this.group)||get.totalPopulation(this.group)+1>get.population()/2){
this.identity='ye';
}
else{
this.identity=this.group;
this.identity='ye';
}
this.setIdentity(this.identity);
this.ai.shown=1;
@ -3294,6 +3306,12 @@ mode.guozhan={
}
}
},
wontYe:function(){
var group=lib.character[this.name1][1];
if(_status.yeidentity&&_status.yeidentity.contains(group)) return false;
if(get.zhu(this)) return true;
return get.totalPopulation(group)+1<=get.population()/2;
},
perfectPair:function(){
if(_status.connectMode){
if(!lib.configOL.zhulian) return false;
@ -3468,7 +3486,7 @@ mode.guozhan={
return 4+difficulty;
}
if(from.identity=='unknown'&&lib.character[from.name1][1]==toidentity){
if(get.totalPopulation(toidentity)+1<=get.population()/2) return 4+difficulty;
if(from.wontYe()) return 4+difficulty;
}
var groups=[];
for(var i=0;i<lib.group.length;i++){
@ -3502,7 +3520,7 @@ mode.guozhan={
if(from==to) return 5+difficulty;
if(from.identity==to.identity&&from.identity!='unknown'&&from.identity!='ye') return 5+difficulty;
if(from.identity=='unknown'&&lib.character[from.name1][1]==to.identity){
if(get.totalPopulation(to.identity)+1<=get.population()/2) return 4+difficulty;
if(from.wontYe()) return 4+difficulty;
}
var toidentity=to.identity;
if(toidentity=='unknown'){