bug修复

This commit is contained in:
libccy 2015-05-05 22:57:35 +08:00
parent 482d6c8b58
commit 58f50110cd
6 changed files with 107 additions and 18 deletions

View File

@ -1190,6 +1190,7 @@ character.sp={
order:4, order:4,
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.isMin()) return 0;
if(player.hp>1){ if(player.hp>1){
if(game.phaseNumber<game.players.length) return 0; if(game.phaseNumber<game.players.length) return 0;
if(target.hp==1&&target.maxHp>2) return 0; if(target.hp==1&&target.maxHp>2) return 0;
@ -1483,7 +1484,7 @@ character.sp={
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(_status.auto||player!=game.me){ if(_status.auto||player!=game.me){
if(ai.get.attitude(player,target)<0) return -1; if(ai.get.attitude(player,target)<=0) return false;
} }
return player!=target; return player!=target;
}, },
@ -1512,7 +1513,7 @@ character.sp={
if(player.hp==2&&num<=1) return 1; if(player.hp==2&&num<=1) return 1;
if(player.hp==3&&num==0) return 1; if(player.hp==3&&num==0) return 1;
if(player.hp>=3&&num>=3) return -10; if(player.hp>=3&&num>=3) return -10;
if(lib.config.mode!='versus'){ if(lib.config.mode=='identity'||lib.config.mode=='guozhan'){
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(lib.config.mode=='identity'){ if(lib.config.mode=='identity'){
if(game.players[i].ai.shown<=0) return -10; if(game.players[i].ai.shown<=0) return -10;
@ -2162,6 +2163,7 @@ character.sp={
effect:{ effect:{
target:function(card,player,target){ target:function(card,player,target){
if(get.tag(card,'damage')){ if(get.tag(card,'damage')){
if(!target.hasFriend()) return;
if(target.hp>=4) return [0,1]; if(target.hp>=4) return [0,1];
} }
if(get.tag(card,'recover')&&player.hp>=player.maxHp-1) return [0,0]; if(get.tag(card,'recover')&&player.hp>=player.maxHp-1) return [0,0];

View File

@ -3069,7 +3069,9 @@ character.yijiang={
if(isjudge){ if(isjudge){
return !target.hasJudge(card.name); return !target.hasJudge(card.name);
} }
return true; else{
return !target.isMin();
}
}).ai=function(target){ }).ai=function(target){
return ai.get.effect(target,card,player,player); return ai.get.effect(target,card,player,player);
} }

View File

@ -2078,7 +2078,7 @@ window.play={};
this.update(); this.update();
return this; return this;
}, },
uninit:function(stat){ uninit:function(){
var that=this; var that=this;
this.node.avatar.hide(); this.node.avatar.hide();
this.node.count.hide(); this.node.count.hide();
@ -2113,9 +2113,7 @@ window.play={};
this.hiddenSkills=[]; this.hiddenSkills=[];
this.forbiddenSkills=[]; this.forbiddenSkills=[];
this.modeSkills=[]; this.modeSkills=[];
if(stat!==false){ this.stat=[{card:{},skill:{}}];
this.stat=[{card:{},skill:{}}];
}
this.tempSkills={}; this.tempSkills={};
this.storage={}; this.storage={};
this.marks={}; this.marks={};
@ -3830,6 +3828,14 @@ window.play={};
} }
return false; return false;
}, },
hasFriend:function(){
for(var i=0;i<game.players.length;i++){
if(game.players[i]!=this&&ai.get.attitude(game.players[i],this)>=0){
return true;
}
}
return false;
},
getJudge:function(name){ getJudge:function(name){
var judges=this.node.judges.childNodes; var judges=this.node.judges.childNodes;
for(var i=0;i<judges.length;i++){ for(var i=0;i<judges.length;i++){
@ -5294,6 +5300,56 @@ window.play={};
dialog.add(ui.create.div('.placeholder')); dialog.add(ui.create.div('.placeholder'));
dialog.content.appendChild(table); dialog.content.appendChild(table);
} }
if(game.additionaldead&&game.additionaldead.length){
table=document.createElement('table');
table.style.opacity='0.5';
for(i=0;i<game.additionaldead.length;i++){
tr=document.createElement('tr');
td=document.createElement('td');
td.innerHTML=get.translation(game.additionaldead[i]);
tr.appendChild(td);
td=document.createElement('td');
num=0;
for(j=0;j<game.additionaldead[i].stat.length;j++){
if(game.additionaldead[i].stat[j].damage!=undefined) num+=game.additionaldead[i].stat[j].damage;
}
td.innerHTML=num;
tr.appendChild(td);
td=document.createElement('td');
num=0;
for(j=0;j<game.additionaldead[i].stat.length;j++){
if(game.additionaldead[i].stat[j].damaged!=undefined) num+=game.additionaldead[i].stat[j].damaged;
}
td.innerHTML=num;
tr.appendChild(td);
td=document.createElement('td');
num=0;
for(j=0;j<game.additionaldead[i].stat.length;j++){
if(game.additionaldead[i].stat[j].gain!=undefined) num+=game.additionaldead[i].stat[j].gain;
}
td.innerHTML=num;
tr.appendChild(td);
td=document.createElement('td');
num=0;
for(j=0;j<game.additionaldead[i].stat.length;j++){
for(k in game.additionaldead[i].stat[j].card){
num+=game.additionaldead[i].stat[j].card[k];
}
}
td.innerHTML=num;
tr.appendChild(td);
td=document.createElement('td');
num=0;
for(j=0;j<game.additionaldead[i].stat.length;j++){
if(game.additionaldead[i].stat[j].kill!=undefined) num+=game.additionaldead[i].stat[j].kill;
}
td.innerHTML=num;
tr.appendChild(td);
table.appendChild(tr);
}
dialog.add(ui.create.div('.placeholder'));
dialog.content.appendChild(table);
}
} }
dialog.add(ui.create.div('.placeholder')); dialog.add(ui.create.div('.placeholder'));
dialog.add(ui.create.div('.placeholder')); dialog.add(ui.create.div('.placeholder'));
@ -5689,7 +5745,7 @@ window.play={};
swapSeat:function(player1,player2,prompt,behind){ swapSeat:function(player1,player2,prompt,behind){
if(behind){ if(behind){
var totalPopulation=game.players.length+game.dead.length+1; var totalPopulation=game.players.length+game.dead.length+1;
for(var iwhile=0;i<totalPopulation;i++){ for(var iwhile=0;iwhile<totalPopulation;iwhile++){
if(player1.next!=player2){ if(player1.next!=player2){
game.swapSeat(player1,player1.next,false,false); game.swapSeat(player1,player1.next,false,false);
} }
@ -8332,6 +8388,7 @@ window.play={};
}, },
window:function(){ window:function(){
if(_status.dragged) return; if(_status.dragged) return;
if(_status.reloading) return;
if(_status.clicked){ if(_status.clicked){
_status.clicked=false; _status.clicked=false;
} }
@ -9582,7 +9639,7 @@ window.play={};
else{ else{
var length=game.players.length; var length=game.players.length;
var totalPopulation=game.players.length+game.dead.length+1; var totalPopulation=game.players.length+game.dead.length+1;
for(var iwhile=0;iwhile<totalPopulation;i++){ for(var iwhile=0;iwhile<totalPopulation;iwhile++){
if(player.nextSeat!=to){ if(player.nextSeat!=to){
player=player.nextSeat; player=player.nextSeat;
if(player.isAlive()&&!player.isOut()&&!player.isMin()) n++; if(player.isAlive()&&!player.isOut()&&!player.isMin()) n++;

View File

@ -76,6 +76,9 @@
max-height:148px; max-height:148px;
left:auto; left:auto;
} }
.player.minskin .judges{
top:14px;
}
.player .marks>div, .player .marks>div,
.player .judges>div{ .player .judges>div{
margin-right:0; margin-right:0;

View File

@ -102,6 +102,7 @@ mode.stone={
else{ else{
game.pause(); game.pause();
_status.deadfriend.push(this); _status.deadfriend.push(this);
game.additionaldead.push(this);
setTimeout(function(){ setTimeout(function(){
var player=ui.create.player(); var player=ui.create.player();
player.dataset.position=dead.dataset.position; player.dataset.position=dead.dataset.position;
@ -133,6 +134,7 @@ mode.stone={
else{ else{
game.pause(); game.pause();
_status.deadenemy.push(this); _status.deadenemy.push(this);
game.additionaldead.push(this);
setTimeout(function(){ setTimeout(function(){
var player=ui.create.player(); var player=ui.create.player();
player.dataset.position=dead.dataset.position; player.dataset.position=dead.dataset.position;
@ -268,6 +270,7 @@ mode.stone={
_status.deadfriend=[]; _status.deadfriend=[];
_status.deadenemy=[]; _status.deadenemy=[];
game.additionaldead=[];
}, },
start:function(){ start:function(){
var next=game.createEvent('game',false); var next=game.createEvent('game',false);
@ -281,8 +284,6 @@ mode.stone={
game.enemy=game.me.next; game.enemy=game.me.next;
game.chooseCharacter(); game.chooseCharacter();
"step 2" "step 2"
game.me.identity='zhu';
game.enemy.identity='zhu';
game.me.side=Math.random()<0.5; game.me.side=Math.random()<0.5;
game.enemy.side=!game.me.side; game.enemy.side=!game.me.side;
game.gameDraw(game.me,2); game.gameDraw(game.me,2);
@ -329,6 +330,7 @@ mode.stone={
return (get.config('double_character')?2:1)*get.config('battle_number'); return (get.config('double_character')?2:1)*get.config('battle_number');
}; };
next.custom.add.button=function(){ next.custom.add.button=function(){
if(ui.cheat2&&ui.cheat2.backup) return;
_status.event.dialog.content.childNodes[0].innerHTML= _status.event.dialog.content.childNodes[0].innerHTML=
'按顺序选择出场角色'+(get.config('double_character')?'(双将)':''); '按顺序选择出场角色'+(get.config('double_character')?'(双将)':'');
_status.event.dialog.content.childNodes[1].innerHTML= _status.event.dialog.content.childNodes[1].innerHTML=
@ -472,8 +474,13 @@ mode.stone={
return true; return true;
}, },
selectTarget:2, selectTarget:2,
multitarget:true,
multiline:true,
content:function(){ content:function(){
target.die(); targets.sort(lib.sort.seat);
for(var i=0;i<targets.length;i++){
targets[i].die();
}
}, },
ai:{ ai:{
result:{ result:{
@ -710,8 +717,14 @@ mode.stone={
return target.isMin(); return target.isMin();
}, },
selectTarget:-1, selectTarget:-1,
multitarget:true,
multiline:true,
content:function(){ content:function(){
target.loseHp(); targets.sort(lib.sort.seat);
for(var i=0;i<targets.length;i++){
targets[i].loseHp();
}
ui.clear();
}, },
ai:{ ai:{
order:9, order:9,
@ -763,8 +776,8 @@ mode.stone={
stone_banxian:['male','qun',3,['stone_banxian'],['minskin','stone'],[3,0]], stone_banxian:['male','qun',3,['stone_banxian'],['minskin','stone'],[3,0]],
stone_daogu:['female','qun',1,['stone_daogu'],['minskin','stone'],[1,2]], stone_daogu:['female','qun',1,['stone_daogu'],['minskin','stone'],[1,2]],
stone_gongzhu:['female','wu',1,['shushen'],['minskin','stone'],[3,2]], stone_gongzhu:['female','wu',1,['shushen'],['minskin','stone'],[2,2]],
stone_genv:['female','wei',1,['jieyin'],['minskin','stone'],[2,2]], stone_genv:['female','wei',1,['jieyin'],['minskin','stone'],[1,2]],
stone_wunv:['female','qun',1,['biyue'],['minskin','stone'],[3,2]], stone_wunv:['female','qun',1,['biyue'],['minskin','stone'],[3,2]],
stone_huanghou:['female','qun',2,['stone_huanghou'],['minskin','stone'],[3,1]], stone_huanghou:['female','qun',2,['stone_huanghou'],['minskin','stone'],[3,1]],
stone_feipin:['female','qun',1,['guixiu'],['minskin','stone'],[1,2]], stone_feipin:['female','qun',1,['guixiu'],['minskin','stone'],[1,2]],
@ -1356,7 +1369,14 @@ mode.stone={
ai:{ ai:{
get:{ get:{
attitude:function(from,to){ attitude:function(from,to){
return (to.identity=='zhu'?6:5)*(from.side==to.side?1:-1); var num;
if(to.isMin()&&!to.skills.contains('chaofeng')){
num=5;
}
else{
num=6;
}
return num*(from.side==to.side?1:-1);
} }
} }
}, },
@ -1370,6 +1390,6 @@ mode.stone={
'<li>牌堆中随机加入总量1/6的炉石牌效果主要与随从有关炉石牌根据强度不同可能会消耗额外的行动值'+ '<li>牌堆中随机加入总量1/6的炉石牌效果主要与随从有关炉石牌根据强度不同可能会消耗额外的行动值'+
'<li>主将可重铸装备牌和随从牌但回合内总的重铸次数不能超过3随从不能重铸任何牌包括铁索等默认可以重铸的牌'+ '<li>主将可重铸装备牌和随从牌但回合内总的重铸次数不能超过3随从不能重铸任何牌包括铁索等默认可以重铸的牌'+
'<li>嘲讽:若一方阵营中有嘲讽角色,则同阵营的无嘲讽角色不以能成为杀或决斗的目标'+ '<li>嘲讽:若一方阵营中有嘲讽角色,则同阵营的无嘲讽角色不以能成为杀或决斗的目标'+
'<li>主将或随从死亡后立即移出游戏,主将死亡后替补登场,无替补时游戏结束' '<li>行动顺序为先主将后随从。主将或随从死亡后立即移出游戏,主将死亡后替补登场替补登场时摸2+X张牌X为对方存活的随从数,无替补时游戏结束'
} }
} }

View File

@ -99,6 +99,7 @@ mode.versus={
ui.control.style.top='calc(100% - 30px)'; ui.control.style.top='calc(100% - 30px)';
_status.friend=[]; _status.friend=[];
_status.enemy=[]; _status.enemy=[];
game.additionaldead=[];
_status.color=Math.random()<0.5; _status.color=Math.random()<0.5;
var i,list=[]; var i,list=[];
for(i in lib.character){ for(i in lib.character){
@ -553,7 +554,11 @@ mode.versus={
_status.friend.remove(event.character); _status.friend.remove(event.character);
_status.enemy.remove(event.character); _status.enemy.remove(event.character);
source.revive(); source.revive();
source.uninit(false); game.additionaldead.push({
name:source.name,
stat:source.stat
});
source.uninit();
source.init(event.character); source.init(event.character);
source.node.identity.dataset.color=get.translation(source.side+'Color'); source.node.identity.dataset.color=get.translation(source.side+'Color');
source.draw(4); source.draw(4);