对决模式换座位
This commit is contained in:
parent
c088930c37
commit
b5daee0a3f
|
@ -493,7 +493,7 @@ character.gujian={
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
xiuhua:{
|
xiuhua:{
|
||||||
forbid:['versus'],
|
changeSeat:true,
|
||||||
trigger:{player:'shaHit'},
|
trigger:{player:'shaHit'},
|
||||||
filter:function(event,player){
|
filter:function(event,player){
|
||||||
return event.target!=player.previous;
|
return event.target!=player.previous;
|
||||||
|
@ -580,7 +580,7 @@ character.gujian={
|
||||||
jizhan:{
|
jizhan:{
|
||||||
enable:'phaseUse',
|
enable:'phaseUse',
|
||||||
usable:1,
|
usable:1,
|
||||||
forbid:['versus'],
|
changeSeat:true,
|
||||||
filterTarget:function(card,player,target){
|
filterTarget:function(card,player,target){
|
||||||
return player!=target&&player.next!=target&&player.canUse('sha',target,false);
|
return player!=target&&player.next!=target&&player.canUse('sha',target,false);
|
||||||
},
|
},
|
||||||
|
@ -602,7 +602,6 @@ character.gujian={
|
||||||
direct:true,
|
direct:true,
|
||||||
filter:function(event,player){
|
filter:function(event,player){
|
||||||
if(event.card.name!='sha') return false;
|
if(event.card.name!='sha') return false;
|
||||||
// if(event.skill=='qianjun') return false;
|
|
||||||
if(event.targets.length!=1) return false;
|
if(event.targets.length!=1) return false;
|
||||||
if(player.num('h',{type:'basic'})==player.num('h')) return false;
|
if(player.num('h',{type:'basic'})==player.num('h')) return false;
|
||||||
var target=event.targets[0];
|
var target=event.targets[0];
|
||||||
|
@ -619,6 +618,7 @@ character.gujian={
|
||||||
for(var i=0;i<game.players.length;i++){
|
for(var i=0;i<game.players.length;i++){
|
||||||
if(player!=game.players[i]&&trigger.targets[0]!=game.players[i]&&get.distance(trigger.targets[0],game.players[i])<=1){
|
if(player!=game.players[i]&&trigger.targets[0]!=game.players[i]&&get.distance(trigger.targets[0],game.players[i])<=1){
|
||||||
event.targets.push(game.players[i]);
|
event.targets.push(game.players[i]);
|
||||||
|
game.players[i].classList.add('selected');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var num=0;
|
var num=0;
|
||||||
|
@ -636,6 +636,7 @@ character.gujian={
|
||||||
player.logSkill('qianjun',targets);
|
player.logSkill('qianjun',targets);
|
||||||
for(var i=0;i<targets.length;i++){
|
for(var i=0;i<targets.length;i++){
|
||||||
trigger.targets.add(targets[i]);
|
trigger.targets.add(targets[i]);
|
||||||
|
targets[i].classList.add('selected');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,28 +7,10 @@ character.jiange={
|
||||||
jg_xiahouyuan:['male','wei',4,['shensu','juechen'],['fullskin']],
|
jg_xiahouyuan:['male','wei',4,['shensu','juechen'],['fullskin']],
|
||||||
jg_caozhen:['male','wei',4,['chiying','jingfan'],['fullskin']],
|
jg_caozhen:['male','wei',4,['chiying','jingfan'],['fullskin']],
|
||||||
jg_zhanghe:['male','wei',4,['huodi','jueji'],['fullskin']],
|
jg_zhanghe:['male','wei',4,['huodi','jueji'],['fullskin']],
|
||||||
jg_simayi:['male','wei',6,['xuanlei','sfanshi','konghun'],['fullskin']],
|
jg_simayi:['male','wei',5,['xuanlei','sfanshi','konghun'],['fullskin']],
|
||||||
},
|
},
|
||||||
skill:{
|
skill:{
|
||||||
sfanshi:{
|
sfanshi:{
|
||||||
init:function(player){
|
|
||||||
player.maxHp=Math.floor(game.players.length/2)+2;
|
|
||||||
player.hp=player.maxHp;
|
|
||||||
player.update();
|
|
||||||
},
|
|
||||||
trigger:{global:'dieAfter'},
|
|
||||||
forced:true,
|
|
||||||
content:function(){
|
|
||||||
player.maxHp=Math.floor(game.players.length/2)+2;
|
|
||||||
player.hp=Math.min(player.hp,player.maxHp);
|
|
||||||
player.update();
|
|
||||||
},
|
|
||||||
group:'sfanshi2',
|
|
||||||
ai:{
|
|
||||||
mingzhi:false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
sfanshi2:{
|
|
||||||
trigger:{player:'phaseEnd'},
|
trigger:{player:'phaseEnd'},
|
||||||
forced:true,
|
forced:true,
|
||||||
check:function(){
|
check:function(){
|
||||||
|
@ -48,7 +30,7 @@ character.jiange={
|
||||||
"step 0"
|
"step 0"
|
||||||
player.chooseTarget('是否发动【控魂】?',function(card,player,target){
|
player.chooseTarget('是否发动【控魂】?',function(card,player,target){
|
||||||
return player!=target;
|
return player!=target;
|
||||||
},[1,Math.floor(game.players.length/2)]).ai=function(target){
|
},[1,Math.floor((game.players.length-1)/2)]).ai=function(target){
|
||||||
return ai.get.damageEffect(target,player,player,'thunder')+1;
|
return ai.get.damageEffect(target,player,player,'thunder')+1;
|
||||||
}
|
}
|
||||||
"step 1"
|
"step 1"
|
||||||
|
@ -575,10 +557,9 @@ character.jiange={
|
||||||
xuanlei:'玄雷',
|
xuanlei:'玄雷',
|
||||||
xuanlei_info:'锁定技,准备阶段,你令所有判定区内有牌的其他角色受到1点雷电伤害',
|
xuanlei_info:'锁定技,准备阶段,你令所有判定区内有牌的其他角色受到1点雷电伤害',
|
||||||
sfanshi:'反噬',
|
sfanshi:'反噬',
|
||||||
sfanshi2:'反噬',
|
sfanshi_info:'锁定技,结束阶段,你失去1点体力',
|
||||||
sfanshi_info:'锁定技,你的体力上限为场上存活角色数的一半+2(向下取整),结束阶段,你失去1点体力',
|
|
||||||
konghun:'控魂',
|
konghun:'控魂',
|
||||||
konghun_info:'出牌阶段开始时,若你的体力值不大于1(场上存活角色数不小于6时改为2),你可以对至多X名角色各造成1点雷电伤害,然后你恢复等量体力,X为场上存活角色数的一半(向下取整)',
|
konghun_info:'出牌阶段开始时,若你的体力值不大于1(场上存活角色数不小于6时改为2),你可以对至多X名角色各造成1点雷电伤害,然后你恢复等量体力,X为场上其他存活角色数的一半(向下取整)',
|
||||||
jizhen_info:'结束阶段,你可以令所至多两名已受伤角色摸一张牌',
|
jizhen_info:'结束阶段,你可以令所至多两名已受伤角色摸一张牌',
|
||||||
// biantian2_info:'已获得大雾标记',
|
// biantian2_info:'已获得大雾标记',
|
||||||
// biantian3_info:'已获得狂风标记',
|
// biantian3_info:'已获得狂风标记',
|
||||||
|
|
|
@ -953,7 +953,7 @@ character.sp={
|
||||||
content:function(){
|
content:function(){
|
||||||
"step 0"
|
"step 0"
|
||||||
var nono=(Math.abs(ai.get.attitude(player,trigger.player))<3);
|
var nono=(Math.abs(ai.get.attitude(player,trigger.player))<3);
|
||||||
player.chooseToDiscard('是否发动【鸩毒】?').ai=function(card){
|
player.chooseToDiscard('是否对'+get.translation(trigger.player)+'发动【鸩毒】?').ai=function(card){
|
||||||
if(nono) return -1;
|
if(nono) return -1;
|
||||||
if(ai.get.damageEffect(trigger.player,player,player)>0){
|
if(ai.get.damageEffect(trigger.player,player,player)>0){
|
||||||
return 7-ai.get.useful(card);
|
return 7-ai.get.useful(card);
|
||||||
|
|
|
@ -171,11 +171,8 @@ character.swd={
|
||||||
if(player.identity=='unknown') return 0;
|
if(player.identity=='unknown') return 0;
|
||||||
return get.population(player.identity)>=3?-1:0;
|
return get.population(player.identity)>=3?-1:0;
|
||||||
}
|
}
|
||||||
case 'versus':{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
default:{
|
default:{
|
||||||
return 0;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -1214,7 +1214,7 @@ character.xianjian={
|
||||||
check:function(event,player){
|
check:function(event,player){
|
||||||
return ai.get.effect(player,event.card,event.player,player)<0
|
return ai.get.effect(player,event.card,event.player,player)<0
|
||||||
},
|
},
|
||||||
forbid:['versus'],
|
changeSeat:true,
|
||||||
trigger:{target:'useCardToBefore'},
|
trigger:{target:'useCardToBefore'},
|
||||||
content:function(){
|
content:function(){
|
||||||
if(trigger.player==player.next){
|
if(trigger.player==player.next){
|
||||||
|
@ -1241,7 +1241,7 @@ character.xianjian={
|
||||||
yujian:{
|
yujian:{
|
||||||
enable:'phaseUse',
|
enable:'phaseUse',
|
||||||
usable:1,
|
usable:1,
|
||||||
forbid:['versus'],
|
changeSeat:true,
|
||||||
filterTarget:function(card,player,target){
|
filterTarget:function(card,player,target){
|
||||||
return player!=target&&player.next!=target;
|
return player!=target&&player.next!=target;
|
||||||
},
|
},
|
||||||
|
|
|
@ -420,7 +420,7 @@ character.yxs={
|
||||||
qiandu:{
|
qiandu:{
|
||||||
enable:'phaseUse',
|
enable:'phaseUse',
|
||||||
usable:1,
|
usable:1,
|
||||||
forbid:['versus'],
|
changeSeat:true,
|
||||||
filterTarget:function(card,player,target){
|
filterTarget:function(card,player,target){
|
||||||
return player!=target&&player.next!=target;
|
return player!=target&&player.next!=target;
|
||||||
},
|
},
|
||||||
|
|
|
@ -5651,8 +5651,9 @@ window.play={};
|
||||||
player1.dataset.position=player2.dataset.position;
|
player1.dataset.position=player2.dataset.position;
|
||||||
player2.dataset.position=temp1;
|
player2.dataset.position=temp1;
|
||||||
game.arrangePlayers();
|
game.arrangePlayers();
|
||||||
if(player1==game.me||player2==game.me){
|
if(player1.dataset.position=='0'||player2.dataset.position=='0'){
|
||||||
pos=parseInt(game.me.dataset.position);
|
pos=parseInt(player1.dataset.position);
|
||||||
|
if(pos==0) pos=parseInt(player2.dataset.position);
|
||||||
num=game.players.length+game.dead.length;
|
num=game.players.length+game.dead.length;
|
||||||
for(i=0;i<game.players.length;i++){
|
for(i=0;i<game.players.length;i++){
|
||||||
temp1=parseInt(game.players[i].dataset.position)-pos;
|
temp1=parseInt(game.players[i].dataset.position)-pos;
|
||||||
|
|
|
@ -25,7 +25,6 @@ mode.versus={
|
||||||
_status.round=0;
|
_status.round=0;
|
||||||
if(lib.storage.single_control){
|
if(lib.storage.single_control){
|
||||||
lib.skill.global.push('versus_swap');
|
lib.skill.global.push('versus_swap');
|
||||||
// ui.autoreplace=ui.create.system(lib.storage.autoreplaceinnerhtml||'自动切换',game.switchAutoreplace,true);
|
|
||||||
ui.autoreplace=ui.create.div('.caption.normal');
|
ui.autoreplace=ui.create.div('.caption.normal');
|
||||||
ui.autoreplace.innerHTML='<div class="underline">自动换人</div>';
|
ui.autoreplace.innerHTML='<div class="underline">自动换人</div>';
|
||||||
ui.autoreplace.style.textAlign='center';
|
ui.autoreplace.style.textAlign='center';
|
||||||
|
@ -38,15 +37,11 @@ mode.versus={
|
||||||
ui.versushs=ui.create.system('手牌',null,true);
|
ui.versushs=ui.create.system('手牌',null,true);
|
||||||
lib.setPopped(ui.versusreplace,game.versusHoverReplace);
|
lib.setPopped(ui.versusreplace,game.versusHoverReplace);
|
||||||
lib.setPopped(ui.versushs,game.versusHoverHandcards);
|
lib.setPopped(ui.versushs,game.versusHoverHandcards);
|
||||||
// ui.versusreplace.addEventListener(lib.config.touchscreen?'touchstart':'mouseenter',game.versusHoverReplace);
|
|
||||||
// ui.versushs.addEventListener(lib.config.touchscreen?'touchstart':'mouseenter',game.versusHoverHandcards);
|
|
||||||
}
|
}
|
||||||
_status.friendCount=ui.create.system('我方阵亡:'+get.cnNumber(0),null,true);
|
_status.friendCount=ui.create.system('我方阵亡:'+get.cnNumber(0),null,true);
|
||||||
_status.enemyCount=ui.create.system('敌方阵亡:'+get.cnNumber(0),null,true);
|
_status.enemyCount=ui.create.system('敌方阵亡:'+get.cnNumber(0),null,true);
|
||||||
lib.setPopped(_status.friendCount,game.versusHoverFriend);
|
lib.setPopped(_status.friendCount,game.versusHoverFriend);
|
||||||
lib.setPopped(_status.enemyCount,game.versusHoverEnemy);
|
lib.setPopped(_status.enemyCount,game.versusHoverEnemy);
|
||||||
// _status.friendCount.addEventListener(lib.config.touchscreen?'touchstart':'mouseenter',game.versusHoverFriend);
|
|
||||||
// _status.enemyCount.addEventListener(lib.config.touchscreen?'touchstart':'mouseenter',game.versusHoverEnemy);
|
|
||||||
|
|
||||||
if(lib.storage.zhu){
|
if(lib.storage.zhu){
|
||||||
_status.currentSide=true;
|
_status.currentSide=true;
|
||||||
|
@ -70,7 +65,6 @@ mode.versus={
|
||||||
this.dialog.classList.add('noslide');
|
this.dialog.classList.add('noslide');
|
||||||
for(var i=0;i<this.dialog.buttons.length;i++) this.dialog.buttons[i].style.opacity=1;
|
for(var i=0;i<this.dialog.buttons.length;i++) this.dialog.buttons[i].style.opacity=1;
|
||||||
this.dialog.add('选项');
|
this.dialog.add('选项');
|
||||||
// this.dialog.add(ui.create.div('.placeholder'));
|
|
||||||
this.dialog.versus_zhu=this.dialog.add(ui.create.switcher('versus_zhu',lib.storage.zhu)).querySelector('.toggle');
|
this.dialog.versus_zhu=this.dialog.add(ui.create.switcher('versus_zhu',lib.storage.zhu)).querySelector('.toggle');
|
||||||
this.dialog.versus_only_zhu=this.dialog.add(ui.create.switcher('versus_only_zhu',lib.storage.only_zhu)).querySelector('.toggle');
|
this.dialog.versus_only_zhu=this.dialog.add(ui.create.switcher('versus_only_zhu',lib.storage.only_zhu)).querySelector('.toggle');
|
||||||
this.dialog.versus_main_zhu=this.dialog.add(ui.create.switcher('versus_main_zhu',lib.storage.main_zhu)).querySelector('.toggle');
|
this.dialog.versus_main_zhu=this.dialog.add(ui.create.switcher('versus_main_zhu',lib.storage.main_zhu)).querySelector('.toggle');
|
||||||
|
@ -82,7 +76,6 @@ mode.versus={
|
||||||
this.dialog.versus_only_zhu.parentNode.classList.add('disabled');
|
this.dialog.versus_only_zhu.parentNode.classList.add('disabled');
|
||||||
this.dialog.versus_main_zhu.parentNode.classList.add('disabled');
|
this.dialog.versus_main_zhu.parentNode.classList.add('disabled');
|
||||||
}
|
}
|
||||||
// this.dialog.versus_replace=this.dialog.add(ui.create.switcher('versus_replace',lib.storage.replace)).querySelector('.toggle');
|
|
||||||
this.dialog.versus_assign_enemy=this.dialog.add(ui.create.switcher('versus_assign_enemy',lib.storage.assign_enemy)).querySelector('.toggle');
|
this.dialog.versus_assign_enemy=this.dialog.add(ui.create.switcher('versus_assign_enemy',lib.storage.assign_enemy)).querySelector('.toggle');
|
||||||
this.dialog.versus_random_seat=this.dialog.add(ui.create.switcher('versus_random_seat',lib.storage.random_seat)).querySelector('.toggle');
|
this.dialog.versus_random_seat=this.dialog.add(ui.create.switcher('versus_random_seat',lib.storage.random_seat)).querySelector('.toggle');
|
||||||
this.dialog.versus_noreplace_end=this.dialog.add(ui.create.switcher('versus_noreplace_end',lib.storage.noreplace_end)).querySelector('.toggle');
|
this.dialog.versus_noreplace_end=this.dialog.add(ui.create.switcher('versus_noreplace_end',lib.storage.noreplace_end)).querySelector('.toggle');
|
||||||
|
@ -92,9 +85,6 @@ mode.versus={
|
||||||
this.dialog.versus_number=this.dialog.add(ui.create.switcher('versus_number',[1,2,3],lib.storage.number)).querySelector('.toggle');
|
this.dialog.versus_number=this.dialog.add(ui.create.switcher('versus_number',[1,2,3],lib.storage.number)).querySelector('.toggle');
|
||||||
this.dialog.replace_number=this.dialog.add(ui.create.switcher('replace_number',[0,1,2,3,4,5,7,9,17],lib.storage.replace_number)).querySelector('.toggle');
|
this.dialog.replace_number=this.dialog.add(ui.create.switcher('replace_number',[0,1,2,3,4,5,7,9,17],lib.storage.replace_number)).querySelector('.toggle');
|
||||||
this.dialog.choice=this.dialog.add(ui.create.switcher('choice',[12,16,20,24,40,'∞'],lib.storage.choice)).querySelector('.toggle');
|
this.dialog.choice=this.dialog.add(ui.create.switcher('choice',[12,16,20,24,40,'∞'],lib.storage.choice)).querySelector('.toggle');
|
||||||
|
|
||||||
// this.dialog.add(ui.create.div('.placeholder'));
|
|
||||||
// this.dialog.add(ui.create.div('.placeholder'));
|
|
||||||
};
|
};
|
||||||
event.confirm=function(){
|
event.confirm=function(){
|
||||||
var dialog=event.dialog;
|
var dialog=event.dialog;
|
||||||
|
@ -253,7 +243,6 @@ mode.versus={
|
||||||
event.custom.add.window=function(){
|
event.custom.add.window=function(){
|
||||||
var dialog=_status.event.dialog;
|
var dialog=_status.event.dialog;
|
||||||
if(_status.friend.length==_status.enemy.length&&_status.friend.length>=dialog.versus_number.link+dialog.replace_number.link){
|
if(_status.friend.length==_status.enemy.length&&_status.friend.length>=dialog.versus_number.link+dialog.replace_number.link){
|
||||||
// if(!ui.confirm) ui.confirm=ui.create.control('start',_status.event.confirm);
|
|
||||||
event.fill.firstChild.innerHTML='开始';
|
event.fill.firstChild.innerHTML='开始';
|
||||||
_status.choosefinished=true;
|
_status.choosefinished=true;
|
||||||
}
|
}
|
||||||
|
@ -268,7 +257,6 @@ mode.versus={
|
||||||
}
|
}
|
||||||
game.save('only_zhu',dialog.versus_only_zhu.link);
|
game.save('only_zhu',dialog.versus_only_zhu.link);
|
||||||
game.save('main_zhu',dialog.versus_main_zhu.link);
|
game.save('main_zhu',dialog.versus_main_zhu.link);
|
||||||
// game.save('replace',dialog.versus_replace.link);
|
|
||||||
game.save('assign_enemy',dialog.versus_assign_enemy.link);
|
game.save('assign_enemy',dialog.versus_assign_enemy.link);
|
||||||
game.save('random_seat',dialog.versus_random_seat.link);
|
game.save('random_seat',dialog.versus_random_seat.link);
|
||||||
game.save('noreplace_end',dialog.versus_noreplace_end.link);
|
game.save('noreplace_end',dialog.versus_noreplace_end.link);
|
||||||
|
@ -358,6 +346,14 @@ mode.versus={
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
for(var i in lib.skill){
|
||||||
|
if(lib.skill[i].changeSeat){
|
||||||
|
lib.skill[i]={};
|
||||||
|
if(lib.translate[i+'_info']){
|
||||||
|
lib.translate[i+'_info']='固定位置时不可用';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
for(i=0;i<position;i++){
|
for(i=0;i<position;i++){
|
||||||
game.friend.push(game.players[i-position+num*2]);
|
game.friend.push(game.players[i-position+num*2]);
|
||||||
}
|
}
|
||||||
|
@ -569,9 +565,6 @@ mode.versus={
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
swapSeat:function(){
|
|
||||||
;
|
|
||||||
},
|
|
||||||
versusClickToSwap:function(e){
|
versusClickToSwap:function(e){
|
||||||
if(_status.dragged) return;
|
if(_status.dragged) return;
|
||||||
if(this.link==game.me){
|
if(this.link==game.me){
|
||||||
|
@ -898,7 +891,6 @@ mode.versus={
|
||||||
versus_only_zhu_config:'只当主将',
|
versus_only_zhu_config:'只当主将',
|
||||||
versus_die_stop_config:'死亡后终止结算',
|
versus_die_stop_config:'死亡后终止结算',
|
||||||
versus_main_zhu_config:'主将死亡后结束',
|
versus_main_zhu_config:'主将死亡后结束',
|
||||||
versus_replace_config:'死亡后自动换人',
|
|
||||||
versus_assign_enemy_config:'指定对手',
|
versus_assign_enemy_config:'指定对手',
|
||||||
versus_random_seat_config:'随机座位',
|
versus_random_seat_config:'随机座位',
|
||||||
versus_noreplace_end_config:'无替补时结束',
|
versus_noreplace_end_config:'无替补时结束',
|
||||||
|
|
Loading…
Reference in New Issue