This commit is contained in:
libccy 2017-02-12 08:08:13 +08:00
parent b46b791f47
commit 288da46773
1 changed files with 63 additions and 83 deletions

View File

@ -214,23 +214,14 @@ character.hearth={
trigger:{player:'phaseBegin'}, trigger:{player:'phaseBegin'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
var nh=player.num('h'); return !player.isMostHandcard();
for(var i=0;i<game.players.length;i++){
if(game.players[i].num('h')>nh){
return true;
}
}
return false;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
var nh=player.num('h'); var nh=player.num('h');
var num=0; var num=game.countPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return current.num('h')>nh;
if(game.players[i].num('h')>nh){ });
num++;
}
}
player.chooseTarget(get.prompt('xingluo'),[1,num],function(card,player,target){ player.chooseTarget(get.prompt('xingluo'),[1,num],function(card,player,target){
return target.num('h')>nh; return target.num('h')>nh;
}).ai=function(target){ }).ai=function(target){
@ -645,12 +636,9 @@ character.hearth={
var info=lib.card[name]; var info=lib.card[name];
var targets=[]; var targets=[];
if(get.select(info.selectTarget)[0]==-1&&!info.modTarget){ if(get.select(info.selectTarget)[0]==-1&&!info.modTarget){
var targets=[]; var targets=game.filterPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return player.canUse(name,current);
if(player.canUse(name,game.players[i])){ });
targets.push(game.players[i]);
}
}
targets.sort(lib.sort.seat); targets.sort(lib.sort.seat);
} }
else{ else{
@ -972,13 +960,13 @@ character.hearth={
forced:true, forced:true,
popup:false, popup:false,
content:function(){ content:function(){
for(var i=0;i<game.players.length;i++){ game.countPlayer(function(current){
for(var j in game.players[i].storage.peiyu){ for(var j in current.storage.peiyu){
if(game.players[i].storage.peiyu[j]==player){ if(current.storage.peiyu[j]==player){
game.players[i].removeSkill(j); current.removeSkill(j);
} }
} }
} });
} }
}, },
wzhanyi:{ wzhanyi:{
@ -1090,33 +1078,32 @@ character.hearth={
check:function(button){ check:function(button){
var player=_status.event.player; var player=_status.event.player;
var recover=0,lose=1; var recover=0,lose=1;
for(var i=0;i<game.players.length;i++){ var players=game.filterPlayer();
if(!game.players[i].isOut()){ for(var i=0;i<players.length;i++){
if(game.players[i].hp<game.players[i].maxHp){ if(players[i].hp<players[i].maxHp){
if(ai.get.attitude(player,game.players[i])>0){ if(ai.get.attitude(player,players[i])>0){
if(game.players[i].hp<2){ if(players[i].hp<2){
lose--;
recover+=0.5;
}
lose--; lose--;
recover++; recover+=0.5;
}
else if(ai.get.attitude(player,game.players[i])<0){
if(game.players[i].hp<2){
lose++;
recover-=0.5;
}
lose++;
recover--;
} }
lose--;
recover++;
} }
else{ else if(ai.get.attitude(player,players[i])<0){
if(ai.get.attitude(player,game.players[i])>0){ if(players[i].hp<2){
lose--;
}
else if(ai.get.attitude(player,game.players[i])<0){
lose++; lose++;
recover-=0.5;
} }
lose++;
recover--;
}
}
else{
if(ai.get.attitude(player,players[i])>0){
lose--;
}
else if(ai.get.attitude(player,players[i])<0){
lose++;
} }
} }
} }
@ -1182,33 +1169,32 @@ character.hearth={
check:function(button){ check:function(button){
var player=_status.event.player; var player=_status.event.player;
var recover=0,lose=1; var recover=0,lose=1;
for(var i=0;i<game.players.length;i++){ var players=game.filterPlayer();
if(!game.players[i].isOut()){ for(var i=0;i<players.length;i++){
if(game.players[i].hp<game.players[i].maxHp){ if(players[i].hp<players[i].maxHp){
if(ai.get.attitude(player,game.players[i])>0){ if(ai.get.attitude(player,players[i])>0){
if(game.players[i].hp<2){ if(players[i].hp<2){
lose--;
recover+=0.5;
}
lose--; lose--;
recover++; recover+=0.5;
}
else if(ai.get.attitude(player,game.players[i])<0){
if(game.players[i].hp<2){
lose++;
recover-=0.5;
}
lose++;
recover--;
} }
lose--;
recover++;
} }
else{ else if(ai.get.attitude(player,players[i])<0){
if(ai.get.attitude(player,game.players[i])>0){ if(players[i].hp<2){
lose--;
}
else if(ai.get.attitude(player,game.players[i])<0){
lose++; lose++;
recover-=0.5;
} }
lose++;
recover--;
}
}
else{
if(ai.get.attitude(player,players[i])>0){
lose--;
}
else if(ai.get.attitude(player,players[i])<0){
lose++;
} }
} }
} }
@ -1339,12 +1325,9 @@ character.hearth={
while(list.length){ while(list.length){
var card={name:list.randomRemove()}; var card={name:list.randomRemove()};
var info=get.info(card); var info=get.info(card);
var targets=[]; var targets=game.filterPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return lib.filter.filterTarget(card,player,current);
if(lib.filter.filterTarget(card,player,game.players[i])){ });
targets.push(game.players[i]);
}
}
if(targets.length){ if(targets.length){
targets.sort(lib.sort.seat); targets.sort(lib.sort.seat);
if(info.selectTarget==-1){ if(info.selectTarget==-1){
@ -1548,19 +1531,16 @@ character.hearth={
filter:function(event,player){ filter:function(event,player){
if(player.hasSkill('xianji')) return false; if(player.hasSkill('xianji')) return false;
if(player.hasSkill('xianji3')) return true; if(player.hasSkill('xianji3')) return true;
for(var i=0;i<game.players.length;i++){ return game.hasPlayer(function(current){
if(game.players[i].hasSkill('xianji')) return true; return current.hasSkill('xianji');
} });
return false;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
player.removeSkill('xianji3'); player.removeSkill('xianji3');
for(var i=0;i<game.players.length;i++){ event.target=game.findPlayer(function(current){
if(game.players[i].hasSkill('xianji')){ return current.hasSkill('xianji');
event.target=game.players[i];break; });
}
}
if(event.target){ if(event.target){
player.chooseToDiscard([1,2],'献祭是否弃置1~2张手牌并令'+get.translation(event.target)+'摸等量的牌?').set('ai',function(card){ player.chooseToDiscard([1,2],'献祭是否弃置1~2张手牌并令'+get.translation(event.target)+'摸等量的牌?').set('ai',function(card){
if(ai.get.attitude(_status.event.player,_status.event.getParent().target)>1){ if(ai.get.attitude(_status.event.player,_status.event.getParent().target)>1){