This commit is contained in:
libccy 2015-05-12 17:51:40 +08:00
parent 3c5bed7959
commit 02b03b1ca5
16 changed files with 1045 additions and 126 deletions

View File

@ -251,7 +251,7 @@ card.qimou={
ai:{ ai:{
order:6.5, order:6.5,
tag:{ tag:{
discard:1, loseCard:1,
multitarget:1, multitarget:1,
multineg:1 multineg:1
}, },

View File

@ -164,7 +164,7 @@ card.refresh={
order:4, order:4,
result:{ result:{
player:function(player){ player:function(player){
if(player.tempSkills['muniu_skill8']) return 0; if(player.skills.contains('muniu_skill8')) return 0;
if(_status.dying) return ai.get.attitude(player,_status.dying); if(_status.dying) return ai.get.attitude(player,_status.dying);
return 1; return 1;
} }

View File

@ -266,6 +266,8 @@ card.yibao={
player.$compare(event.card1,target,event.card2); player.$compare(event.card1,target,event.card2);
game.delay(4); game.delay(4);
"step 3" "step 3"
game.log(get.translation(player)+'展示了'+get.translation(event.card1));
game.log(get.translation(target)+'展示了'+get.translation(event.card2));
if(get.color(event.card2)==get.color(event.card1)){ if(get.color(event.card2)==get.color(event.card1)){
player.discard(event.card1).animate=false; player.discard(event.card1).animate=false;
target.$gain2(event.card2); target.$gain2(event.card2);

View File

@ -490,7 +490,7 @@ character.extra={
intro:{ intro:{
mark:function(dialog,content,player){ mark:function(dialog,content,player){
if(content&&content.length){ if(content&&content.length){
if(player==game.me){ if(player==game.me||player.isUnderControl()){
dialog.add(content); dialog.add(content);
} }
else{ else{
@ -500,7 +500,7 @@ character.extra={
}, },
content:function(content,player){ content:function(content,player){
if(content&&content.length){ if(content&&content.length){
if(player==game.me){ if(player==game.me||player.isUnderControl()){
return get.translation(content); return get.translation(content);
} }
return '共有'+get.cnNumber(content.length)+'张星'; return '共有'+get.cnNumber(content.length)+'张星';
@ -590,6 +590,9 @@ character.extra={
for(var i=0;i<result.links.length;i++){ for(var i=0;i<result.links.length;i++){
player.storage.qixing.remove(result.links[i]); player.storage.qixing.remove(result.links[i]);
} }
if(player.storage.qixing.length==0){
player.unmarkSkill('qixing');
}
player.discard(result.links); player.discard(result.links);
}, },
group:'dawu3' group:'dawu3'
@ -666,6 +669,9 @@ character.extra={
for(var i=0;i<result.links.length;i++){ for(var i=0;i<result.links.length;i++){
player.storage.qixing.remove(result.links[i]); player.storage.qixing.remove(result.links[i]);
} }
if(player.storage.qixing.length==0){
player.unmarkSkill('qixing');
}
player.discard(result.links); player.discard(result.links);
}, },
}, },

View File

@ -192,7 +192,8 @@ character.fire={
} }
return 0; return 0;
}, },
player:function(player){ player:function(player,target){
if(target.skills.contains('jueqing')) return -10;
var mn=1; var mn=1;
var hs=player.get('h'); var hs=player.get('h');
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){

View File

@ -314,7 +314,7 @@ character.sp={
if(cards.length){ if(cards.length){
var dialog; var dialog;
if(event.isMine()){ if(event.isMine()){
dialog=ui.create.dialog('是否发动【漫卷】?'); dialog=ui.create.dialog('是否发动【'+get.translation(event.name)+'】?');
dialog.style.opacity='none'; dialog.style.opacity='none';
dialog.add(cards); dialog.add(cards);
for(var i=0;i<dialog.buttons.length;i++){ for(var i=0;i<dialog.buttons.length;i++){
@ -336,7 +336,7 @@ character.sp={
} }
"step 2" "step 2"
if(result.bool){ if(result.bool){
player.logSkill('manjuan'); player.logSkill(event.name);
game.log(get.translation(player)+'获得了'+get.translation(event.cards)); game.log(get.translation(player)+'获得了'+get.translation(event.cards));
player.gain(event.cards,'gain2'); player.gain(event.cards,'gain2');
} }

View File

@ -434,6 +434,7 @@ character.xianjian={
}, },
wangyou3:{}, wangyou3:{},
changnian:{ changnian:{
forbid:['boss'],
trigger:{player:'dieBegin'}, trigger:{player:'dieBegin'},
direct:true, direct:true,
unique:true, unique:true,

View File

@ -306,6 +306,7 @@ character.yxs={
game.log(get.translation(player)+'预言'+result.control); game.log(get.translation(player)+'预言'+result.control);
player.storage.bolehuiyan=result.control; player.storage.bolehuiyan=result.control;
player.popup(result.control); player.popup(result.control);
player.line(trigger.target,'green');
game.delay(); game.delay();
} }
} }

View File

@ -266,6 +266,15 @@ character.zhuogui={
suoling:{ suoling:{
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
forced:true, forced:true,
filter:function(event,player){
if(player.isLinked()) return true;
for(var i=0;i<game.players.length;i++){
if(game.players[i]!=player&&!game.players[i].isLinked()){
return true;
}
}
return false;
},
content:function(){ content:function(){
"step 0" "step 0"
event.targets=game.players.slice(0); event.targets=game.players.slice(0);

View File

@ -7,6 +7,7 @@ window.config={
forbidversus:['swd_kangnalishi'], forbidversus:['swd_kangnalishi'],
forbidstone:['zhugedan','pal_xuanxiao'], forbidstone:['zhugedan','pal_xuanxiao'],
forbidchess:['hetaihou','swd_kangnalishi'], forbidchess:['hetaihou','swd_kangnalishi'],
forbidboss:['caiwenji','gjqt_aruan','pal_xuanxiao','swd_hupo'],
forbiddouble:['zhugedan','swd_kangnalishi','swd_nicole','dongzhuo','jg_simayi'], forbiddouble:['zhugedan','swd_kangnalishi','swd_nicole','dongzhuo','jg_simayi'],
layoutfixed:['chess','boss'], layoutfixed:['chess','boss'],
all:{ all:{

View File

@ -1797,10 +1797,9 @@ window.play={};
else{ else{
game.log(get.translation(player)+'遇难') game.log(get.translation(player)+'遇难')
} }
var i;
event.cards=player.get('hej'); event.cards=player.get('hej');
if(event.cards.length){ if(event.cards.length){
for(i=0;i<event.cards.length;i++){ for(var i=0;i<event.cards.length;i++){
event.cards[i].goto(ui.discardPile); event.cards[i].goto(ui.discardPile);
} }
player.$throw(event.cards,1000); player.$throw(event.cards,1000);
@ -1819,6 +1818,10 @@ window.play={};
player.node.marks.firstChild.remove(); player.node.marks.firstChild.remove();
} }
} }
for(var i in player.tempSkills){
player.skills.remove(i);
delete player.tempSkills[i];
}
player.classList.add('dead'); player.classList.add('dead');
player.classList.remove('turnedover'); player.classList.remove('turnedover');
player.classList.remove('out'); player.classList.remove('out');
@ -3806,7 +3809,9 @@ window.play={};
isOut:function(){ isOut:function(){
return this.classList.contains('out'); return this.classList.contains('out');
}, },
isMin:function(){ isMin:function(distance){
if(distance&&lib.config.mode!='stone') return false;
if(this.forcemin) return true;
return this.classList.contains('minskin')&&lib.config.mode!='chess'; return this.classList.contains('minskin')&&lib.config.mode!='chess';
}, },
isIn:function(){ isIn:function(){
@ -3818,7 +3823,7 @@ window.play={};
return ui.autoreplace&&ui.autoreplace.classList.contains('on')&& return ui.autoreplace&&ui.autoreplace.classList.contains('on')&&
this.side==game.me.side; this.side==game.me.side;
} }
else if(lib.config.mode=='chess'){ else if(lib.config.mode=='chess'||lib.config.mode=='boss'){
return this.side==game.me.side; return this.side==game.me.side;
} }
return false; return false;
@ -4386,17 +4391,11 @@ window.play={};
if(event.player&&event.player.removed) return; if(event.player&&event.player.removed) return;
if(!event.player&&name!='gameStart') return; if(!event.player&&name!='gameStart') return;
event._endTrigger=event.player||game.me; event._endTrigger=event.player||game.me;
for(iwhile=0;iwhile<totalPopulation;iwhile++){
if(event._endTrigger.isDead()){ if(!game.players.contains(event._endTrigger)){
event._endTrigger=event._endTrigger.next; event._endTrigger=game.findNext(event._endTrigger);
}
else{
break;
}
}
if(event._endTrigger.isDead()){
event._endTrigger=game.players.randomGet();
} }
var player=event._endTrigger; var player=event._endTrigger;
var list=[],others=[]; var list=[],others=[];
for(i=0;i<game.players.length;i++){ for(i=0;i<game.players.length;i++){
@ -4455,7 +4454,7 @@ window.play={};
} }
} }
player=player.next; player=player.next;
if(player==event._endTrigger){ if(!player||player==event._endTrigger){
break; break;
} }
} }
@ -4584,6 +4583,7 @@ window.play={};
return this.add(item,noclick,true); return this.add(item,noclick,true);
}, },
open:function(){ open:function(){
if(this.noopen) return;
for(var i=0;i<ui.dialogs.length;i++){ for(var i=0;i<ui.dialogs.length;i++){
if(ui.dialogs[i]==this){ if(ui.dialogs[i]==this){
this.show(); this.show();
@ -5962,6 +5962,16 @@ window.play={};
} }
} }
}, },
findNext:function(player){
var players=get.players(lib.sort.position);
var position=parseInt(player.dataset.position);
for(var i=0;i<players.length;i++){
if(parseInt(players[i].dataset.position)>=position){
return players[i];
}
}
return players[0];
},
phaseLoop:function(player){ phaseLoop:function(player){
var next=game.createEvent('phaseLoop'); var next=game.createEvent('phaseLoop');
next.player=player; next.player=player;
@ -5969,19 +5979,8 @@ window.play={};
"step 0" "step 0"
player.phase(); player.phase();
"step 1" "step 1"
var players,i; if(!game.players.contains(event.player.next)){
if(game.players.contains(event.player.next)==false){ event.player=game.findNext(event.player.next);
players=get.players(lib.sort.position);
if(parseInt(players[players.length-1].dataset.position)<parseInt(event.player.dataset.position)){
event.player=game.me;
}
else{
for(i=0;i<game.players.length;i++){
if(parseInt(game.players[i].dataset.position)>=parseInt(event.player.dataset.position)){
event.player=game.players[i];break;
}
}
}
} }
else{ else{
event.player=event.player.next; event.player=event.player.next;
@ -7099,6 +7098,9 @@ window.play={};
else if(typeof lib.config.current_mode[i]==='function'){ else if(typeof lib.config.current_mode[i]==='function'){
modeconfig.push(lib.config.current_mode[i](game,lib,get,ui)); modeconfig.push(lib.config.current_mode[i](game,lib,get,ui));
} }
else{
modeconfig.push(ui.create.div('.placeholder'));
}
} }
} }
} }
@ -8768,14 +8770,14 @@ window.play={};
player:function(){ player:function(){
return ui.click.target.apply(this,arguments); return ui.click.target.apply(this,arguments);
}, },
target:function(){ target:function(e){
if(_status.dragged) return; if(_status.dragged) return;
if(_status.clicked) return; if(_status.clicked) return;
if(ui.intro) return; if(ui.intro) return;
_status.clicked=true; _status.clicked=true;
var custom=_status.event.custom; var custom=_status.event.custom;
if(custom.replace.target){ if(custom.replace.target){
custom.replace.target(this); custom.replace.target(this,e);
return; return;
} }
if(this.classList.contains('selectable')==false) return; if(this.classList.contains('selectable')==false) return;
@ -8792,6 +8794,7 @@ window.play={};
} }
else{ else{
ui.selected.targets.add(this); ui.selected.targets.add(this);
if(_status.event.name=='chooseToUse'){
var targetprompt=null; var targetprompt=null;
if(_status.event.targetprompt){ if(_status.event.targetprompt){
targetprompt=_status.event.targetprompt; targetprompt=_status.event.targetprompt;
@ -8816,6 +8819,7 @@ window.play={};
this.prompt(targetprompt); this.prompt(targetprompt);
} }
} }
}
this.classList.add('selected'); this.classList.add('selected');
} }
if(custom.add.target){ if(custom.add.target){
@ -9911,7 +9915,7 @@ window.play={};
n=Math.abs(fxy[0]-txy[0])+Math.abs(fxy[1]-txy[1]); n=Math.abs(fxy[0]-txy[0])+Math.abs(fxy[1]-txy[1]);
if(method=='raw'||method=='pure'||method=='absolute') return n; if(method=='raw'||method=='pure'||method=='absolute') return n;
} }
else if(to.isMin()||from.isMin()){ else if(to.isMin(true)||from.isMin(true)){
if(method=='raw'||method=='pure'||method=='absolute') return 1; if(method=='raw'||method=='pure'||method=='absolute') return 1;
} }
else{ else{
@ -9920,14 +9924,14 @@ window.play={};
for(var iwhile=0;iwhile<totalPopulation;iwhile++){ 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(true)) n++;
} }
else{ else{
break; break;
} }
} }
for(i=0;i<game.players.length;i++){ for(i=0;i<game.players.length;i++){
if(game.players[i].isOut()||game.players[i].isMin()) length--; if(game.players[i].isOut()||game.players[i].isMin(true)) length--;
} }
if(method=='absolute') return n; if(method=='absolute') return n;
if(from.isDead()) length++; if(from.isDead()) length++;
@ -11052,9 +11056,15 @@ window.play={};
if(player.get('e').contains(card)){ if(player.get('e').contains(card)){
return ai.get.equipValue(card)/3; return ai.get.equipValue(card)/3;
} }
if(player.num('h')==1) return 2; var nh=player.num('h');
if(player.num('h')==2) return 1.6; switch(nh){
return 1; case 1:return 2;
case 2:return 1.6;
case 3:return 1;
case 4:return 0.8;
case 5:return 0.6;
default:return 0.4;
}
}, },
attitude2:function(to){ attitude2:function(to){
return ai.get.attitude(_status.event.player,to); return ai.get.attitude(_status.event.player,to);

View File

@ -3,63 +3,114 @@
height:calc(50% + 200px); height:calc(50% + 200px);
text-align:center; text-align:center;
top:calc(50% - 200px); top:calc(50% - 200px);
top:60px;
white-space:nowrap; white-space:nowrap;
z-index:1; z-index:1;
}
#bosslist.scroll{
overflow-x:scroll; overflow-x:scroll;
} }
.bosspaused>#bosslist, .bosspaused>#bosslist,
.bosspaused>#control{ .bosspaused>#control,
.bosspaused>.dialog.bosscharacter{
opacity:0.2 !important; opacity:0.2 !important;
} }
#bosslist>.player.bossshow{ #bosslist.hidden>.player{
opacity:1; transition:all 0s;
-webkit-animation:boss_start 0.5s;
-webkit-transform:none;
}
#bosslist>.player{
position:relative;
margin:10px;
left:0;
top:0;
width:180px;
height:216px;
opacity: 0;
transition: all 0.3s;
-webkit-transform:translateY(-200px);
}
#bosslist>.player:hover{
-webkit-transform:scale(1.1);
} }
#bosslist>div:first-child, #bosslist>div:first-child,
#bosslist>div:last-child{ #bosslist>div:last-child{
width:20px; width:20px;
position:relative; position:relative;
} }
#bosslist>.player>div:not(.hp):not(.identity):not(.avatar){
.player.bossplayer.bossing{
position:absolute;
}
.player.bossing .avatar{
transition:all 0.5s;
}
.player.bossplayer.highlight{
-webkit-transform:scale(1.1);
opacity:1;
}
#bosslist.removing>.player.bossplayer.highlight{
transition:all 0s;
opacity:0;
}
.player.bossplayer{
position:relative;
margin:10px;
left:0;
top:0;
width:180px;
height:216px;
transition: all 0.3s;
opacity:0.6;
-webkit-animation:game_start 0.5s;
}
.player.bossplayer>div:not(.hp):not(.identity):not(.avatar){
display:none !important; display:none !important;
} }
#bosslist>.player>.identity{ .player.bossplayer>.identity{
left:16px; left:16px;
top:20px; top:20px;
line-height:24px; line-height:24px;
white-space:normal; white-space:normal;
} }
#bosslist>.player>.hp{ .player.bossplayer>.hp{
top:22px; top:22px;
left:144px; left:144px;
} }
#bosslist>.player>.avatar{ .player.bossplayer>.avatar{
width:156px; width:156px;
height:192px; height:192px;
} }
#control.bosslist{ #control.bosslist{
top:calc(50% + 100px); top:calc(100% - 50px);
} position:fixed;
#control.bosslist>div{
transition:opacity 0.5s;
} }
@-webkit-keyframes boss_start{from {opacity: 0;-webkit-transform:translateY(-200px);}} .dialog.bosscharacter{
top:auto;
bottom:65px;
height:calc(100% - 383px);
background: rgba(0,0,0,0.2);
box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px;
border-radius:8px;
}
.bosschongzheng{
width:calc(100% - 20px);
white-space:nowrap;
position:relative;
}
.bosschongzheng div{
position:relative;
}
.bosschongzheng>div{
width:100%;
display:block;
margin-bottom:5px;
}
.bosschongzheng>div>div:first-child{
text-align:left;
width:30%;
}
.bosschongzheng>div>div:last-child{
text-align:right;
width:70%;
}
@media screen and (min-height: 800px) {
.dialog.bosscharacter{
height:417px;
bottom:calc(50% - 335px);
}
#control.bosslist{
top:calc(50% + 350px);
}
#bosslist{
top:calc(40% - 260px);
}
}

View File

@ -463,6 +463,10 @@
width: 630px; width: 630px;
left: calc(50% - 315px); left: calc(50% - 315px);
} }
.dialog.bosscharacter{
width: 735px;
left: calc(50% - 367.5px);
}
#arena.stone .dialog{ #arena.stone .dialog{
width: calc(90% - 440px); width: calc(90% - 440px);
left: calc(5% + 220px); left: calc(5% + 220px);

View File

@ -1,7 +1,27 @@
'use strict'; 'use strict';
mode.boss={ mode.boss={
element:{
player:{
dieAfter:function(){
if(this!=game.boss){
this.storage.boss_chongzheng=0;
}
if(this==game.boss||game.players.length==1){
game.checkResult();
}
}
}
},
game:{ game:{
reserveDead:true, reserveDead:true,
checkResult:function(){
if(game.boss==game.me){
game.over(game.boss.isAlive());
}
else{
game.over(!game.boss.isAlive());
}
},
start:function(){ start:function(){
var next=game.createEvent('game',false); var next=game.createEvent('game',false);
next.content=function(){ next.content=function(){
@ -15,7 +35,10 @@ mode.boss={
} }
} }
lib.init.css('layout/mode','boss'); lib.init.css('layout/mode','boss');
var bosslist=ui.create.div('#bosslist'); game.delay(0.1);
"step 1"
var bosslist=ui.create.div('#bosslist.hidden');
event.bosslist=bosslist;
if(!lib.config.touchscreen&&lib.config.mousewheel){ if(!lib.config.touchscreen&&lib.config.mousewheel){
bosslist._scrollspeed=30; bosslist._scrollspeed=30;
bosslist._scrollnum=10; bosslist._scrollnum=10;
@ -44,6 +67,7 @@ mode.boss={
game.onresume2=onresume; game.onresume2=onresume;
ui.create.div(bosslist); ui.create.div(bosslist);
event.current=null;
var list=[]; var list=[];
for(var i in lib.character){ for(var i in lib.character){
var info=lib.character[i]; var info=lib.character[i];
@ -62,6 +86,12 @@ mode.boss={
player.setIdentity(player.name); player.setIdentity(player.name);
player.node.identity.dataset.color=info[5]; player.node.identity.dataset.color=info[5];
bosslistlinks[cfg]=player; bosslistlinks[cfg]=player;
player.classList.add('bossplayer');
if(lib.storage.current==i){
event.current=player;
player.classList.add('highlight');
}
if(!get.config(cfg)){ if(!get.config(cfg)){
player.style.display='none'; player.style.display='none';
@ -71,52 +101,843 @@ mode.boss={
ui.create.div(bosslist); ui.create.div(bosslist);
lib.translate.boss_pangtong='涅槃凤雏'; lib.translate.boss_pangtong='涅槃凤雏';
ui.create.arena(); ui.create.arena();
var time=(ui.window.offsetWidth-30)/200; ui.create.cards();
ui.window.appendChild(ui.control); game.finishCards();
ui.arena.dataset.number=8;
ui.control.classList.add('bosslist'); ui.control.classList.add('bosslist');
ui.window.appendChild(bosslist); ui.window.appendChild(bosslist);
var interval=setInterval(function(){
if(list.length){ setTimeout(function(){
list.shift().classList.add('bossshow'); if(event.current){
var left=event.current.offsetLeft-(ui.window.offsetWidth-180)/2;
if(bosslist.scrollLeft<left){
bosslist.scrollLeft=left;
}
}
bosslist.show();
},200);
game.me=ui.create.player();
game.chooseCharacter(function(target){
if(event.current){
event.current.classList.remove('highlight');
}
event.current=target;
game.save('current',target.name);
target.classList.add('highlight');
});
"step 2"
game.bossinfo=lib.boss.global;
for(var i in lib.boss[event.current.name]){
game.bossinfo[i]=lib.boss[event.current.name][i];
}
delete lib.boss;
setTimeout(function(){
ui.control.classList.remove('bosslist');
},500);
if(!event.current){
event.current=event.bosslist.childNodes[1];
}
var rect=event.current.getBoundingClientRect();
var boss=ui.create.player().init(event.current.name);
game.boss=boss;
boss.side=true;
boss.classList.add('bossplayer');
boss.classList.add('highlight');
boss.animate('bossing');
boss.node.hp.animate('start');
boss.style.left=(rect.left-ui.arena.offsetLeft)+'px';
boss.style.top=(rect.top-ui.arena.offsetTop)+'px';
boss.setIdentity('zhu');
for(var i=0;i<result.links.length;i++){
var player=ui.create.player(ui.arena).init(result.links[i]).animate('start');
player.setIdentity('cai');
player.side=false;
game.players.push(player);
if(result.boss){
player.dataset.position=(i+1)*2;
} }
else{ else{
clearInterval(interval); player.dataset.position=i+1;
} }
},500/time); }
setTimeout(function(){ if(result.boss){
bosslist.classList.add('scroll'); game.players.unshift(boss);
},1000); boss.dataset.position=0;
setTimeout(function(){ }
var control=ui.create.control('快速开始',function(){ else{
control.hide(); game.players.push(boss);
bosslist.delete(); boss.dataset.position=7;
}
ui.create.me();
if(game.me!==boss){
ui.fakeme=ui.create.div('.player',ui.arena);
ui.fakeme.dataset.position=0;
ui.fakeme.line=lib.element.player.line;
ui.fakemebg=ui.create.div('.avatar',ui.fakeme).hide();
ui.refresh(ui.fakemebg);
game.onSwapControl();
ui.fakemebg.show();
lib.setPopped(ui.create.system('查看手牌',null,true),function(){
var uiintro=ui.create.dialog('hidden');
var players=game.players.concat(game.dead);
for(var i=0;i<players.length;i++){
if(players[i].side==game.me.side&&players[i]!=game.me){
uiintro.add(get.translation(players[i]));
var cards=players[i].get('h');
if(cards.length){
uiintro.add(cards,true);
}
else{
uiintro.add('(无)');
}
}
}
return uiintro;
}); });
},500);
game.pause();
} }
lib.setPopped(ui.create.system('重整',null,true),function(){
var uiintro=ui.create.dialog('hidden');
uiintro.add('重整');
var table=ui.create.div('.bosschongzheng');
var tr,td,added=false;
for(var i=0;i<game.dead.length;i++){
if(typeof game.dead[i].storage.boss_chongzheng!=='number') continue;
added=true;
tr=ui.create.div(table);
td=ui.create.div(tr);
td.innerHTML=get.translation(game.dead[i]);
td=ui.create.div(tr);
td.innerHTML='剩余'+get.cnNumber(game.bossinfo.chongzheng-game.dead[i].storage.boss_chongzheng)+'回合';
}
if(!added){
uiintro.add('<div class="text center">(无重整角色)</div>');
uiintro.add(ui.create.div('.placeholder.slim'))
}
else{
uiintro.add(table);
}
return uiintro;
},180);
ui.arena.appendChild(boss);
ui.refresh(boss);
boss.classList.remove('highlight');
boss.classList.remove('bossplayer');
boss.style.left='';
boss.style.top='';
boss.style.position='';
event.bosslist.delete();
game.arrangePlayers();
"step 3"
game.gameDraw(game.boss);
game.bossPhaseLoop();
} }
}, },
bossPhaseLoop:function(){
var next=game.createEvent('phaseLoop');
next.player=game.boss;
_status.looped=true;
next.content=function(){
"step 0"
if(player.chongzheng){
player.chongzheng=false;
}
else if(player.isDead()){
if(player.hp<0) player.hp=0;
player.storage.boss_chongzheng++;
if(player.hp<player.maxHp){
player.hp++;
game.log(get.translation(player)+'回复了一点体力');
}
else{
var card=get.cards()[0];
var sort=lib.config.sort_card(card);
var position=sort>0?player.node.handcards1:player.node.handcards2;
card.fix();
card.animate('start');
position.insertBefore(card,position.firstChild);
player.$draw();
game.log(get.translation(player)+'摸了一张牌');
}
player.update();
if(player.storage.boss_chongzheng>=game.bossinfo.chongzheng){
player.revive();
}
if(game.bossinfo.loopType==2){
game.boss.chongzheng=true;
}
}
else{
player.phase();
}
"step 1"
if(game.bossinfo.loopType==2){
if(event.player==game.boss){
if(!_status.last||_status.last.nextSeat==game.boss){
event.player=game.boss.nextSeat;
}
else{
event.player=_status.last.nextSeat;
}
}
else{
_status.last=player;
event.player=game.boss;
}
}
else{
event.player=event.player.nextSeat;
}
event.goto(0);
}
},
onSwapControl:function(){
if(game.me==game.boss) return;
var name=game.me.name;
if(ui.fakeme&&ui.fakeme.current!=name){
ui.fakeme.current=name;
if(ui.versushighlight&&ui.versushighlight!=game.me){
ui.versushighlight.node.avatar.classList.remove('glow2');
}
ui.versushighlight=game.me;
game.me.node.avatar.classList.add('glow2');
game.me.line(ui.fakeme,{opacity:0.5,dashed:true});
ui.fakemebg.style.backgroundImage=game.me.node.avatar.style.backgroundImage;
ui.fakemebg.style.backgroundSize='cover';
}
},
modeSwapPlayer:function(player){
game.swapControl(player);
game.onSwapControl();
},
chooseCharacter:function(func){
var next=game.createEvent('chooseCharacter',false);
next.showConfig=true;
next.customreplacetarget=func;
next.ai=function(player,list){
if(get.config('double_character')){
player.init(list[0],list[1]);
}
else{
player.init(list[0]);
}
}
next.content=function(){
"step 0"
var i;
var list=[];
event.list=list;
for(i in lib.character){
if(lib.character[i][4].contains('minskin')) continue;
if(lib.character[i][4].contains('boss')) continue;
if(lib.character[i][4].contains('hiddenboss')) continue;
if(lib.config.forbidai.contains(i)) continue;
if(lib.config.forbidall.contains(i)) continue;
if(lib.config.forbidboss.contains(i)) continue;
if(get.config('ban_weak')&&lib.config.forbidsingle.contains(i)) continue;
list.push(i);
}
list.randomSort();
var dialog=ui.create.dialog('选择参战角色','hidden');
ui.window.appendChild(dialog);
dialog.classList.add('bosscharacter');
dialog.add('0/3');
dialog.add([list.slice(0,20),'character']);
dialog.noopen=true;
var next=game.me.chooseButton(dialog,true);
next._triggered=null;
next.custom.replace.target=event.customreplacetarget;
next.selectButton=[3,3];
next.custom.add.button=function(){
if(ui.cheat2&&ui.cheat2.backup) return;
_status.event.dialog.content.childNodes[1].innerHTML=
ui.selected.buttons.length+'/3';
};
event.changeDialog=function(){
if(ui.cheat2&&ui.cheat2.dialog==_status.event.dialog){
return;
}
list.randomSort();
_status.event.dialog.close();
_status.event.dialog=ui.create.dialog('选择参战角色','hidden');
ui.window.appendChild(_status.event.dialog);
_status.event.dialog.classList.add('bosscharacter');
_status.event.dialog.add('0/3');
_status.event.dialog.add([list.slice(0,20),'character']);
game.uncheck();
game.check();
};
event.asboss=ui.create.control('应战',function(){
event.boss=true;
event.enemy=[];
for(var i=0;i<ui.selected.buttons.length;i++){
event.enemy.push(ui.selected.buttons[i].link);
event.list.remove(ui.selected.buttons[i].link);
}
while(event.enemy.length<3){
event.enemy.push(event.list.randomRemove());
}
game.uncheck();
if(ui.confirm){
ui.confirm.close();
}
game.resume();
});
ui.create.cheat=function(){
ui.cheat=ui.create.control('更换',event.changeDialog);
};
event.dialogxx=ui.create.characterDialog();
event.dialogxx.classList.add('bosscharacter');
ui.create.cheat2=function(){
ui.cheat2=ui.create.control('自由选将',function(){
if(this.dialog==_status.event.dialog){
this.dialog.close();
_status.event.dialog=this.backup;
ui.window.appendChild(this.backup);
delete this.backup;
game.uncheck();
game.check();
if(ui.cheat2x){
ui.cheat2x.close();
delete ui.cheat2x;
}
}
else{
ui.cheat2x=ui.create.groupControl(_status.event.parent.dialogxx);
this.backup=_status.event.dialog;
_status.event.dialog.close();
_status.event.dialog=_status.event.parent.dialogxx;
this.dialog=_status.event.dialog;
ui.window.appendChild(this.dialog);
game.uncheck();
game.check();
}
});
}
if(!ui.cheat&&get.config('change_choice'))
ui.create.cheat();
if(!ui.cheat2&&get.config('free_choose'))
ui.create.cheat2();
"step 1"
if(ui.cheat){
ui.cheat.close();
delete ui.cheat;
}
if(ui.cheat2){
ui.cheat2.close();
delete ui.cheat2;
}
if(ui.cheat2x){
ui.cheat2x.close();
delete ui.cheat2x;
}
event.asboss.close();
if(event.boss){
event.result={
boss:true,
links:event.enemy
};
}
else{
event.result={
boss:false,
links:result.links
};
}
}
return next;
},
},
boss:{
boss_caiwenji:{
loopType:2,
chongzheng:3
},
boss_pangtong:{
loopType:2
},
boss_zhenji:{
chongzheng:4,
},
boss_lvbu1:{
loopType:2
},
global:{
loopType:1,
chongzheng:6
},
},
character:{ character:{
boss_zhangchunhua:['female','shu',4,[],['fullskin','boss'],'wei'], boss_zhangchunhua:['female','wei',4,['jueqing','wuxin','shangshix'],['fullskin','boss'],'wei'],
boss_zhenji:['female','shu',4,[],['fullskin','boss'],'wei'], boss_zhenji:['female','wei',4,['tashui','lingbo','jiaoxia','fanghua'],['fullskin','boss'],'wei'],
boss_liubei:['male','shu',4,[],['fullskin','boss'],'qun'], // boss_liubei:['male','shu',5,['lingfeng'],['fullskin','boss'],'qun'],
boss_zhugeliang:['male','shu',4,[],['fullskin','boss'],'qun'], // boss_zhugeliang:['male','shu',4,[],['fullskin','boss'],'qun'],
boss_huangyueying:['female','shu',4,[],['fullskin','boss'],'wei'], boss_huangyueying:['female','shu',4,['boss_gongshen','boss_jizhi','qicai','boss_guiyin'],['fullskin','boss'],'wei'],
boss_pangtong:['male','shu',4,[],['fullskin','boss'],'zhu'], boss_pangtong:['male','shu',4,['boss_tianyu','qiwu','niepan','boss_yuhuo'],['fullskin','boss'],'zhu'],
boss_zhouyu:['male','wu',4,[],['fullskin','boss'],'zhu'], boss_zhouyu:['male','wu',6,['huoshen','boss_honglian','boss_xianyin'],['fullskin','boss'],'zhu'],
boss_lvbu1:['male','qun',8,['mashu','wushuang','baonu'],['fullskin','boss'],'wei'], boss_lvbu1:['male','qun',8,['mashu','wushuang','boss_baonu'],['fullskin','boss'],'wei'],
boss_lvbu2:['male','qun',4,['mashu','wushuang','xiuluo','shenwei','shenji'],['fullskin','hiddenboss'],'qun'], boss_lvbu2:['male','qun',4,['mashu','wushuang','swd_xiuluo','shenwei','shenji'],['fullskin','hiddenboss'],'qun'],
boss_caiwenji:['female','qun',8,[],['fullskin','boss'],'wei'], boss_caiwenji:['female','qun',4,['tinqin','beige','boss_hujia','boss_guihan'],['fullskin','boss'],'wei'],
boss_zhangjiao:['male','qun',8,[],['fullskin','boss'],'shu'], boss_zhangjiao:['male','qun',8,[],['fullskin','boss'],'shu'],
boss_zuoci:['male','qun',8,[],['fullskin','boss'],'shu'], boss_zuoci:['male','qun',8,[],['fullskin','boss'],'shu'],
boss_yuji:['male','qun',8,[],['fullskin','boss'],'nei'], // boss_yuji:['male','qun',8,[],['fullskin','boss'],'nei'],
boss_diaochan:['male','qun',8,[],['fullskin','boss'],'qun'], boss_diaochan:['male','qun',8,[],['fullskin','boss'],'qun'],
boss_huatuo:['male','qun',8,[],['fullskin','boss'],'wu'], boss_huatuo:['male','qun',8,[],['fullskin','boss'],'wu'],
boss_dongzhuo:['male','qun',8,[],['fullskin','boss'],'shu'], boss_dongzhuo:['male','qun',8,[],['fullskin','boss'],'shu'],
boss_shuijing:['male','qun',8,[],['fullskin','boss'],'wei'], // boss_shuijing:['male','qun',8,[],['fullskin','boss'],'wei'],
},
skill:{
tinqin:{
inherit:'manjuan'
},
boss_hujia:{
trigger:{player:'phaseEnd'},
direct:true,
filter:function(event,player){
if(player.hp==player.maxHp) return false;
if(!player.num('he')) return false;
for(var i=0;i<game.players.length;i++){
if(game.players[i]!=player&&!game.players[i].storage.boss_hujia){
return true;
}
}
return false;
},
content:function(){
"step 0"
var next=player.chooseCardTarget({
position:'he',
filterTarget:function(card,player,target){
return player!=target&&!target.storage.boss_hujia;
},
filterCard:true,
ai1:function(card){
return ai.get.unuseful(card)+9;
},
ai2:function(target){
return Math.random();
},
prompt:'是否发动【胡笳】?'
});
"step 1"
if(result.bool){
var target=result.targets[0];
player.logSkill('boss_hujia',target);
if(target.disabledSkills.boss_hujia){
target.clearSkills();
target.storage.boss_hujia=true;
delete target.disabledSkills.boss_hujia;
}
else{
target.disabledSkills.boss_hujia=lib.character[target.name][3];
}
player.discard(result.cards);
}
for(var i=0;i<game.players.length;i++){
if(game.players[i]!=player&&!game.players[i].storage.boss_hujia){
event.finish();break;
}
}
"step 2"
player.draw(2);
if(player.hp<player.maxHp){
player.recover(player.maxHp-player.hp);
}
for(var i=0;i<game.players.length;i++){
if(game.players[i]!=player){
game.players[i].maxHp=1;
game.players[i].update();
}
}
game.bossinfo.loopType=1;
},
ai:{
expose:0.2,
}
},
boss_guihan:{},
huoshen:{
trigger:{player:'damageBefore'},
forced:true,
filter:function(event){
return event.nature=='fire';
},
content:function(){
trigger.untrigger();
trigger.finish();
player.recover();
},
ai:{
effect:{
target:function(card,player,target){
if(get.tag(card,'fireDamage')){
return [0,2];
}
}
}
},
},
boss_xianyin:{
trigger:{player:'loseEnd'},
frequent:true,
filter:function(event,player){
return _status.currentPhase!=player;
},
content:function(){
"step 0"
player.judge(function(card){
return get.color(card)=='red'?1:0;
});
"step 1"
if(result.bool){
player.chooseTarget(true,'选择一个目标令其失去一点体力',function(card,player,target){
return player!=target;
}).ai=function(target){
return Math.max(1,9-target.hp);
}
}
else{
event.finish();
}
"step 2"
if(result.targets.length){
result.targets[0].loseHp();
}
},
ai:{
effect:{
target:function(card,player,target){
if(get.tag(card,'loseCard')){
return [0.5,1];
}
}
}
}
},
boss_honglian:{
trigger:{player:'phaseEnd'},
forced:true,
content:function(){
"step 0"
event.players=get.players(player);
event.players.remove(player);
event.num=0;
player.draw(2);
"step 1"
if(event.players.length){
event.players.shift().damage('fire');
event.redo();
}
},
},
boss_yuhuo:{
trigger:{player:'niepanAfter'},
forced:true,
content:function(){
player.addSkill('shenwei');
player.addSkill('zhuyu');
game.bossinfo.loopType=1;
}
},
boss_tianyu:{
inherit:'suoling'
},
boss_jizhi:{
trigger:{player:'useCard'},
frequent:true,
filter:function(event){
var type=get.type(event.card,'trick');
return (type=='trick'||type=='equip')&&event.cards[0]&&event.cards[0]==event.card;
},
content:function(){
var cards=get.cards();
player.gain(cards,'gain2');
game.log(get.translation(player)+'获得了'+get.translation(cards));
},
ai:{
threaten:1.4
}
},
boss_guiyin:{
inherit:'dunxing'
},
boss_gongshen:{
trigger:{global:'gameDrawAfter'},
forced:true,
content:function(){
for(var i=0;i<game.players.length;i++){
if(game.players[i]!=player){
game.players[i].forcemin=true;
}
}
},
global:'boss_gongshen2'
},
boss_gongshen2:{
mod:{
cardEnabled:function(card,player){
if(player.isMin()){
if(get.type(card)=='equip') return false;
}
}
}
},
fanghua:{
trigger:{player:'phaseEnd'},
forced:true,
unique:true,
filter:function(event,player){
for(var i=0;i<game.players.length;i++){
if(game.players[i].isTurnedOver()){
return true;
}
}
return false;
},
content:function(){
"step 0"
event.players=get.players(player);
event.num=0;
for(var i=0;i<event.players.length;i++){
if(!event.players[i].isTurnedOver()){
event.players.splice(i--,1);
}
}
"step 1"
if(event.players.length){
event.players.shift().loseHp();
event.redo();
}
}
},
tashui:{
trigger:{player:['useCard','respondAfter']},
direct:true,
unique:true,
filter:function(event){
return get.color(event.card)=='black';
},
content:function(){
"step 0"
game.delay(0.5);
player.chooseTarget('是否发动【踏水】?',function(card,player,target){
return player!=target;
}).ai=function(target){
if(target.isTurnedOver()) return -1;
return 1;
return ai.get.damageEffect(target,player,player,'thunder');
}
"step 1"
if(result.bool){
player.logSkill('tashui',result.targets,'thunder');
result.targets[0].turnOver();
}
},
ai:{
effect:{
player:function(card){
if(get.color(card)=='black'){
return [1,2];
}
}
}
}
},
shangshix:{
trigger:{player:['loseEnd','changeHp']},
forced:true,
unique:true,
filter:function(event,player){
return player.num('h')<4;
},
content:function(){
player.draw(4-player.num('h'));
},
group:'shangshix2',
ai:{
effect:{
target:function(card,player,target){
if(card.name=='shunshou') return;
if(card.name=='guohe'){
if(!target.num('e')) return [0,1];
}
else if(get.tag(card,'loseCard')){
return [0,1];
}
}
}
}
},
shangshix2:{
trigger:{player:'phaseEnd'},
forced:true,
unique:true,
filter:function(event,player){
return player.hp>1;
},
content:function(){
"step 0"
event.players=get.players(player);
event.num=0;
"step 1"
if(event.players.length){
event.players.shift().loseHp();
event.redo();
}
}
},
wuxin:{
inherit:'miles_xueyi',
group:'swd_wuxie'
},
shenwei:{
unique:true,
trigger:{player:'phaseDrawBegin'},
forced:true,
content:function(){
trigger.num+=Math.max(2,game.players.length-1);
},
mod:{
maxHandcard:function(player,current){
return current+Math.max(2,game.players.length-1);
}
}
},
shenji:{
unique:true,
mod:{
selectTarget:function(card,player,range){
if(card.name=='sha'||card.name=='juedou') range[1]=3;
},
}
},
boss_baonu:{
unique:true,
group:'boss_baonu2',
trigger:{player:'changeHp'},
forced:true,
priority:100,
filter:function(event,player){
return player.hp<=4
},
content:function(){
player.init('boss_lvbu2');
player.update();
ui.clear();
while(_status.event.name!='phaseLoop'){
_status.event=_status.event.parent;
}
for(var i=0;i<game.players.length;i++){
for(var j in game.players[i].tempSkills){
game.players[i].skills.remove(j);
delete game.players[i].tempSkills[j];
}
}
_status.paused=false;
_status.event.player=player;
_status.event.step=0;
game.bossinfo.loopType=1;
},
ai:{
effect:{
target:function(card,player,target){
if(get.tag(card,'damage')||get.tag(card,'loseHp')){
if(player.hp==5){
if(game.players.length<4) return [0,5];
var num=0
for(var i=0;i<game.players.length;i++){
if(game.players[i]!=game.boss&&game.players[i].hp==1){
num++;
}
}
if(num>1) return [0,2];
if(num&&Math.random()<0.7) return [0,1];
}
}
}
}
}
},
boss_baonu2:{
trigger:{player:'gameDrawBegin'},
forced:true,
popup:false,
content:function(){
player.draw(4,false);
}
},
_bossswap:{
trigger:{player:['phaseBegin','chooseToUseBegin','chooseToRespondBegin','chooseToDiscardBegin','chooseToCompareBegin',
'chooseButtonBegin','chooseCardBegin','chooseTargetBegin','chooseCardTargetBegin','chooseControlBegin',
'chooseBoolBegin','choosePlayerCardBegin','discardPlayerCardBegin','gainPlayerCardBegin']},
forced:true,
priority:100,
popup:false,
filter:function(event,player){
if(event.autochoose&&event.autochoose()) return false;
return player.isUnderControl();
},
content:function(){
game.modeSwapPlayer(player);
},
},
}, },
translate:{ translate:{
tinqin:'听琴',
boss_guihan:'归汉',
boss_guihan_info:'觉醒技当所有敌人失去技能后你摸两张牌并将体力回复至体力上限然后令所有敌人将体力上限减至1',
boss_hujia:'胡笳',
boss_hujia_info:'回合结束阶段,若你已受伤,可以弃置一张牌令一名其他角色的所有技能失效,若其所有技能已失效,改为令其失去所有技能',
boss_honglian:'红莲',
boss_honglian_info:'锁定技,回合结束阶段,你摸两张牌,并对所有敌人造成一点火焰伤害',
huoshen:'火神',
huoshen_info:'锁定技你防止即将受到的火焰伤害改为回复1点体力',
boss_xianyin:'仙音',
boss_xianyin_info:'每当你于回合外失去牌,你可以进行一次判定,若为红色,你令一名敌人失去一点体力',
boss_yuhuo:'浴火',
boss_yuhuo_info:'觉醒技,在你涅槃后,你获得技能【神威】、【朱羽】',
boss_tianyu:'天狱',
boss_jizhi:'集智',
boss_jizhi_info:'每当你使用一张锦囊牌或装备牌,你可以摸一张牌并展示之',
boss_guiyin:'归隐',
boss_guiyin_info:'锁定技,体力值比你多的角色无法在回合内对你使用卡牌',
boss_gongshen:'工神',
boss_gongshen_info:'锁定技,除你之外的角色没有装备区,也不能重铸卡牌',
fanghua:'芳华',
fanghua_info:'回合结束阶段,你可以令所有已翻面角色流失一点体力',
tashui:'踏水',
tashui_info:'每当你使用或打出一张黑色牌,你可以令一名其他角色翻面',
wuxin:'无心',
wuxin_info:'锁定技,你防止即将受到的伤害,改为流失一点体力;你不能成为其他角色的延时锦囊的目标',
shangshix:'伤逝',
shangshix2:'伤逝',
shangshix_info:'锁定技你的手牌数至少为4回合结束阶段若你的体力值大于1你令场上所有角色流失一点体力',
shenwei:'神威',
shenwei_info:'锁定技摸牌阶段你额外摸X张牌你的手牌上限+XX为敌方存活角色个数且至少为2',
shenji:'神戟',
shenji:'你使用的杀或决斗可指定至多3名角色为目标',
zhu:'神',
cai:'盟',
boss_shuijing:'水镜先生', boss_shuijing:'水镜先生',
boss_huangyueying:'奇智女杰', boss_huangyueying:'奇智女杰',
boss_zhangchunhua:'冷血皇后', boss_zhangchunhua:'冷血皇后',
@ -136,5 +957,13 @@ mode.boss={
boss_luxun:'蹁跹君子', boss_luxun:'蹁跹君子',
boss_zhenji:'洛水仙子', boss_zhenji:'洛水仙子',
boss_diaochan:'绝代妖姬', boss_diaochan:'绝代妖姬',
},
ai:{
get:{
attitude:function(from,to){
return 6*(from.side===to.side?1:-1);
} }
}
},
config:['ban_weak','change_choice','free_choose','']
} }

View File

@ -780,6 +780,7 @@ mode.chess={
game.finishCards(); game.finishCards();
game.arrangePlayers(); game.arrangePlayers();
"step 2" "step 2"
ui.control.style.display='';
var p; var p;
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i].side){ if(game.players[i].side){
@ -857,6 +858,7 @@ mode.chess={
ui.control.style.top='calc(100% - 30px)'; ui.control.style.top='calc(100% - 30px)';
var next=game.me.chooseButton(dialog,true); var next=game.me.chooseButton(dialog,true);
next._triggered=null;
next.selectButton=function(){ next.selectButton=function(){
return (get.config('double_character')?2:1)*get.config('battle_number'); return (get.config('double_character')?2:1)*get.config('battle_number');
}; };
@ -930,7 +932,7 @@ mode.chess={
ui.cheat2x.close(); ui.cheat2x.close();
delete ui.cheat2x; delete ui.cheat2x;
} }
ui.control.style.display='none';
ui.control.style.top=''; ui.control.style.top='';
ui.control.style.transition=''; ui.control.style.transition='';

View File

@ -307,12 +307,11 @@ mode.versus={
ui.auto.show(); ui.auto.show();
ui.wuxie.show(); ui.wuxie.show();
ui.control.style.display='none';
if(ui.cheat){ if(ui.cheat){
ui.cheat.close(); ui.cheat.close();
delete ui.cheat; delete ui.cheat;
} }
ui.control.style.top='';
ui.control.style.transition='';
delete _status.list; delete _status.list;
var num=lib.storage.number; var num=lib.storage.number;
ui.create.players(num*2); ui.create.players(num*2);
@ -420,6 +419,9 @@ mode.versus={
// game.enemy[i].node.identity.style.backgroundColor=get.translation(!_status.color+'Color'); // game.enemy[i].node.identity.style.backgroundColor=get.translation(!_status.color+'Color');
} }
"step 2" "step 2"
ui.control.style.top='';
ui.control.style.display='';
ui.control.style.transition='';
var num=lib.storage.number; var num=lib.storage.number;
if(result&&result.buttons){ if(result&&result.buttons){
var list=[]; var list=[];