This commit is contained in:
parent
003ccb99b3
commit
d1cf4362f2
18
game/game.js
18
game/game.js
|
@ -7799,6 +7799,7 @@
|
|||
for(var i in player.tempSkills){
|
||||
player.removeSkill(i);
|
||||
}
|
||||
player.clearEquipTrigger();
|
||||
// for(var i in lib.skill.globalmap){
|
||||
// if(lib.skill.globalmap[i].contains(player)){
|
||||
// lib.skill.globalmap[i].remove(player);
|
||||
|
@ -9997,8 +9998,8 @@
|
|||
next.setContent('die');
|
||||
return next;
|
||||
},
|
||||
revive:function(hp){
|
||||
game.log(this,'复活');
|
||||
revive:function(hp,log){
|
||||
if(log!==false) game.log(this,'复活');
|
||||
if(this.maxHp<1) this.maxHp=1;
|
||||
if(hp) this.hp=hp;
|
||||
else{
|
||||
|
@ -10850,7 +10851,7 @@
|
|||
var roles=['player','source','target'];
|
||||
for(var i=0;i<roles.length;i++){
|
||||
if(typeof expire[roles[i]]=='string'){
|
||||
lib.hookmap[expire]=true;
|
||||
lib.hookmap[expire[roles[i]]]=true;
|
||||
}
|
||||
else if(Array.isArray(expire[roles[i]])){
|
||||
for(var j=0;j<expire[roles[i]].length;j++){
|
||||
|
@ -18789,6 +18790,7 @@
|
|||
script.remove();
|
||||
var mode=window.mode;
|
||||
delete window.mode;
|
||||
_status.sourcemode=lib.config.mode;
|
||||
lib.config.mode=name;
|
||||
|
||||
var i,j,k;
|
||||
|
@ -27364,6 +27366,14 @@
|
|||
return node;
|
||||
},
|
||||
cards:function(random){
|
||||
if(_status.brawl){
|
||||
if(_status.brawl.cardPile){
|
||||
lib.card.list=_status.brawl.cardPile(lib.card.list);
|
||||
}
|
||||
if(_status.brawl.orderedPile){
|
||||
random=false;
|
||||
}
|
||||
}
|
||||
if(!random){
|
||||
lib.card.list.randomSort();
|
||||
}
|
||||
|
@ -27568,7 +27578,7 @@
|
|||
var node=ui.create.div('.newgame');
|
||||
for(var i=0;i<3&&i+k*3<modes.length;i++){
|
||||
var thismode=modes[i+k*3];
|
||||
var div=ui.create.div(thismode==lib.config.mode?'.underlinenode.on':'.underlinenode',node);
|
||||
var div=ui.create.div(thismode==(_status.sourcemode||lib.config.mode)?'.underlinenode.on':'.underlinenode',node);
|
||||
div.innerHTML=lib.translate[thismode];
|
||||
div.link=thismode;
|
||||
div.addEventListener(lib.config.touchscreen?'touchend':'click',function(){
|
||||
|
|
|
@ -46,7 +46,6 @@ window.noname_source_list=[
|
|||
'layout/mode/boss.css',
|
||||
'layout/mode/chess.css',
|
||||
'layout/mode/stone.css',
|
||||
'layout/mode/brawl.css',
|
||||
'layout/newlayout/equip.css',
|
||||
'layout/newlayout/global.css',
|
||||
'layout/newlayout/layout.css',
|
||||
|
|
259
mode/brawl.js
259
mode/brawl.js
|
@ -1,9 +1,266 @@
|
|||
'use strict';
|
||||
mode.brawl={
|
||||
start:function(){
|
||||
|
||||
var dialog=ui.create.dialog();
|
||||
dialog.classList.add('fixed');
|
||||
dialog.classList.add('scroll1');
|
||||
dialog.classList.add('scroll2');
|
||||
dialog.classList.add('fullwidth');
|
||||
dialog.classList.add('fullheight');
|
||||
dialog.classList.add('noupdate');
|
||||
dialog.classList.add('character');
|
||||
dialog.contentContainer.style.overflow='visible';
|
||||
dialog.style.overflow='hidden';
|
||||
dialog.content.style.height='100%';
|
||||
dialog.contentContainer.style.transition='all 0s';
|
||||
var packnode=ui.create.div('.packnode',dialog);
|
||||
lib.setScroll(packnode);
|
||||
var clickCapt=function(){
|
||||
var active=this.parentNode.querySelector('.active');
|
||||
if(active){
|
||||
for(var i=0;i<active.nodes.length;i++){
|
||||
active.nodes[i].remove();
|
||||
if(active.nodes[i].showcaseinterval){
|
||||
clearInterval(active.nodes[i].showcaseinterval);
|
||||
delete active.nodes[i].showcaseinterval;
|
||||
}
|
||||
}
|
||||
active.classList.remove('active');
|
||||
}
|
||||
this.classList.add('active');
|
||||
for(var i=0;i<this.nodes.length;i++){
|
||||
dialog.content.appendChild(this.nodes[i]);
|
||||
}
|
||||
var showcase=this.nodes[this.nodes.length-1];
|
||||
showcase.style.height=(dialog.content.offsetHeight-showcase.offsetTop)+'px';
|
||||
if(typeof showcase.action=='function'){
|
||||
showcase.action(showcase._showcased?false:true);
|
||||
showcase._showcased=true;
|
||||
}
|
||||
}
|
||||
var createNode=function(name){
|
||||
var info=lib.brawl[name];
|
||||
var node=ui.create.div('.dialogbutton.menubutton.large',info.name,packnode,clickCapt);
|
||||
var caption=get.translation(info.mode)+'模式';
|
||||
if(info.submode){
|
||||
caption+=' - '+info.submode;
|
||||
}
|
||||
var intro;
|
||||
if(Array.isArray(info.intro)){
|
||||
intro='<ul style="text-align:left;margin-top:0;width:450px">';
|
||||
for(var i=0;i<info.intro.length;i++){
|
||||
intro+='<li>'+info.intro[i];
|
||||
}
|
||||
}
|
||||
else{
|
||||
intro=info.intro;
|
||||
}
|
||||
var showcase=ui.create.div();
|
||||
showcase.style.margin='0px';
|
||||
showcase.style.padding='0px';
|
||||
showcase.style.width='100%';
|
||||
showcase.style.display='block'
|
||||
showcase.action=info.showcase;
|
||||
node.nodes=[
|
||||
ui.create.div('.caption',caption),
|
||||
ui.create.div('.text center',intro),
|
||||
showcase
|
||||
];
|
||||
node.link=name;
|
||||
return node;
|
||||
}
|
||||
for(var i in lib.brawl){
|
||||
createNode(i);
|
||||
}
|
||||
clickCapt.call(packnode.firstChild);
|
||||
var start=ui.create.div('.menubutton.round.highlight','斗',dialog.content,function(){
|
||||
var active=packnode.querySelector('.active');
|
||||
if(active){
|
||||
for(var i=0;i<active.nodes.length;i++){
|
||||
if(active.nodes[i].showcaseinterval){
|
||||
clearInterval(active.nodes[i].showcaseinterval);
|
||||
delete active.nodes[i].showcaseinterval;
|
||||
}
|
||||
}
|
||||
dialog.delete();
|
||||
var info=lib.brawl[active.link];
|
||||
ui.brawlinfo=ui.create.system('乱斗',null,true);
|
||||
lib.setPopped(ui.brawlinfo,function(){
|
||||
var uiintro=ui.create.dialog('hidden');
|
||||
uiintro.add(info.name);
|
||||
uiintro.add('<div class="text center">'+active.nodes[1].innerHTML+'</div>');
|
||||
var ul=uiintro.querySelector('ul');
|
||||
if(ul){
|
||||
ul.style.width='180px';
|
||||
}
|
||||
uiintro.add(ui.create.div('.placeholder'));
|
||||
return uiintro;
|
||||
},250);
|
||||
_status.brawl=info.content;
|
||||
game.switchMode(info.mode);
|
||||
if(info.init){
|
||||
info.init();
|
||||
}
|
||||
}
|
||||
});
|
||||
start.style.position='absolute';
|
||||
start.style.left='auto';
|
||||
start.style.right='10px';
|
||||
start.style.top='auto';
|
||||
start.style.bottom='10px';
|
||||
start.style.width='80px';
|
||||
start.style.height='80px';
|
||||
start.style.lineHeight='80px';
|
||||
start.style.fontSize='72px';
|
||||
start.style.zIndex=2;
|
||||
},
|
||||
game:{
|
||||
|
||||
},
|
||||
brawl:{
|
||||
duzhansanguo:{
|
||||
name:'毒战三国',
|
||||
mode:'identity',
|
||||
intro:'牌堆中额外添加10%的毒',
|
||||
showcase:function(){
|
||||
var node=this;
|
||||
node.nodes=node.nodes||[];
|
||||
node.showcaseinterval=setInterval(function(){
|
||||
var card=game.createCard('du');
|
||||
node.nodes.push(card);
|
||||
card.style.position='absolute';
|
||||
var rand1=Math.round(Math.random()*100);
|
||||
var rand2=Math.round(Math.random()*100);
|
||||
card.style.left='calc('+rand1+'% - '+rand1+'px)';
|
||||
card.style.top='calc('+rand2+'% - '+rand2+'px)';
|
||||
card.style.transform='rotate('+Math.round(Math.random()*360)+'deg)';
|
||||
card.style.opacity=0;
|
||||
node.appendChild(card);
|
||||
ui.refresh(card);
|
||||
card.style.opacity=1;
|
||||
if(node.nodes.length>7){
|
||||
setTimeout(function(){
|
||||
while(node.nodes.length>5){
|
||||
node.nodes.shift().delete();
|
||||
}
|
||||
},500);
|
||||
}
|
||||
},1000);
|
||||
},
|
||||
content:{
|
||||
cardPile:function(list){
|
||||
var num=Math.ceil(list.length/10);
|
||||
while(num--){
|
||||
list.push([['heart','diamond','club','spade'].randomGet(),Math.ceil(Math.random()*13),'du']);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
},
|
||||
},
|
||||
daozhiyueying:{
|
||||
name:'导师月英',
|
||||
mode:'identity',
|
||||
intro:'牌堆中所有非延时锦囊牌数量翻倍;移除拥有集智技能的角色',
|
||||
showcase:function(init){
|
||||
var node=this;
|
||||
var player1,player2;
|
||||
if(init){
|
||||
player1=ui.create.player().init('huangyueying');
|
||||
player2=ui.create.player().init('re_huangyueying');
|
||||
player1.style.left='20px';
|
||||
player1.style.top='20px';
|
||||
player1.style.transform='scale(0.9)';
|
||||
player1.node.count.remove();
|
||||
player2.style.left='auto';
|
||||
player2.style.right='20px';
|
||||
player2.style.top='20px';
|
||||
player2.style.transform='scale(0.9)';
|
||||
player2.node.count.remove();
|
||||
this.appendChild(player1);
|
||||
this.appendChild(player2);
|
||||
this.player1=player1;
|
||||
this.player2=player2;
|
||||
}
|
||||
else{
|
||||
player1=this.player1;
|
||||
player2=this.player2;
|
||||
}
|
||||
var rect1=player1.getBoundingClientRect();
|
||||
var rect2=player2.getBoundingClientRect();
|
||||
var left1=rect1.left+rect1.width/2-ui.arena.offsetLeft;
|
||||
var left2=rect2.left+rect2.width/2-ui.arena.offsetLeft;
|
||||
var top1=rect1.top+rect1.height/2-ui.arena.offsetTop;
|
||||
var top2=rect2.top+rect2.height/2-ui.arena.offsetTop;
|
||||
node.showcaseinterval=setInterval(function(){
|
||||
game.linexy([left1,top1,left2,top2]);
|
||||
},1000);
|
||||
},
|
||||
init:function(){
|
||||
for(var i in lib.character){
|
||||
var skills=lib.character[i][3]
|
||||
if(skills.contains('jizhi')||skills.contains('rejizhi')||skills.contains('lingzhou')){
|
||||
delete lib.character[i];
|
||||
}
|
||||
}
|
||||
},
|
||||
content:{
|
||||
cardPile:function(list){
|
||||
var list2=[];
|
||||
for(var i=0;i<list.length;i++){
|
||||
list2.push(list[i]);
|
||||
if(get.type(list[i][2])=='trick'){
|
||||
list2.push(list[i]);
|
||||
}
|
||||
}
|
||||
return list2;
|
||||
}
|
||||
}
|
||||
},
|
||||
weiwoduzun:{
|
||||
name:'唯我独尊',
|
||||
mode:'identity',
|
||||
intro:[
|
||||
'牌堆中杀的数量增加30',
|
||||
'游戏开始时,主公获得一枚战神标记',
|
||||
'拥有战神标记的角色杀造成的伤害+1',
|
||||
'受到杀造成的伤害后战神印记将移到伤害来源的武将牌上'
|
||||
]
|
||||
},
|
||||
tongxingzhizheng:{
|
||||
name:'同姓之争',
|
||||
mode:'versus',
|
||||
submode:'2v2',
|
||||
intro:'姓氏相同的武将组合一队'
|
||||
},
|
||||
tongqueduopao:{
|
||||
name:'铜雀夺袍',
|
||||
mode:'identity',
|
||||
intro:[
|
||||
'主公必选曹操',
|
||||
'其余玩家从曹休、文聘、曹洪、张郃、夏侯渊、徐晃、许褚这些武将中随机选中一个',
|
||||
'游戏开始时将麒麟弓和爪黄飞电各置于每名角色的装备区内,大宛马洗入牌堆,移除其他的武器牌和坐骑牌'
|
||||
]
|
||||
},
|
||||
// shenrudihou:{
|
||||
// name:'深入敌后',
|
||||
// mode:'versus',
|
||||
// submode:'1v1',
|
||||
// intro:'选将阶段选择武将和对战阶段选择上场的武将都由对手替你选择,而且你不知道对手为你选择了什么武将'
|
||||
// },
|
||||
tongjiangmoshi:{
|
||||
name:'同将模式',
|
||||
mode:'identity',
|
||||
intro:'主公选择一个武将,所有角色均使用此武将',
|
||||
},
|
||||
baiyudujiang:{
|
||||
name:'白衣渡江',
|
||||
mode:'versus',
|
||||
submode:'2v2',
|
||||
intro:[
|
||||
'玩家在选将时可从6-8张的武将牌里选择两张武将牌,一张面向大家可见(加入游戏),另一张是隐藏面孔(暗置)',
|
||||
'选择的两张武将牌需满足以下至少两个条件:1.性别相同;2.体力上限相同;3.技能数量相同',
|
||||
'每名玩家在其回合开始或回合结束时,可以选择将自己的武将牌弃置,然后使用暗置的武将牌进行剩余的游戏'
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -57,13 +57,6 @@ mode.guozhan={
|
|||
if(ui.coin){
|
||||
_status.coinCoeff=get.coinCoeff([game.me.name1,game.me.name2]);
|
||||
}
|
||||
if(lib.storage.test&&!_status.connectMode){
|
||||
var str='';
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
str+=get.translation(game.players[i].name1)+' '+get.translation(game.players[i].name2)+'; ';
|
||||
}
|
||||
console.log(str);
|
||||
}
|
||||
var player;
|
||||
if(_status.cheat_seat){
|
||||
var seat=_status.cheat_seat.link;
|
||||
|
@ -344,9 +337,6 @@ mode.guozhan={
|
|||
},
|
||||
checkResult:function(){
|
||||
_status.overing=true;
|
||||
if(lib.storage.test&&!_status.connectMode){
|
||||
console.log(get.translation(game.players[0].identity)+'胜利');
|
||||
}
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
game.players[i].showCharacter(2);
|
||||
}
|
||||
|
|
|
@ -234,13 +234,6 @@ mode.identity={
|
|||
if(Math.random()<0.5) game.me.next.init(lib.storage.test);
|
||||
else game.me.init(lib.storage.test);
|
||||
}
|
||||
var str='';
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
str+=get.translation(game.players[i]);
|
||||
if(game.players[i]==game.zhu) str+='(主)';
|
||||
str+=' ';
|
||||
}
|
||||
console.log(str);
|
||||
game.showIdentity();
|
||||
}
|
||||
game.syncState();
|
||||
|
@ -397,17 +390,6 @@ mode.identity={
|
|||
if(game.zhong){
|
||||
game.zhong.identity='zhong';
|
||||
}
|
||||
if(lib.storage.test){
|
||||
if(game.zhu.isAlive()){
|
||||
console.log('主忠胜利');
|
||||
}
|
||||
else if(game.players[0].identity=='nei'&&game.players.length==1){
|
||||
console.log('内奸胜利');
|
||||
}
|
||||
else{
|
||||
console.log('反贼胜利');
|
||||
}
|
||||
}
|
||||
game.showIdentity();
|
||||
if(game.me.identity=='zhu'||game.me.identity=='zhong'){
|
||||
if(game.zhu.classList.contains('dead')){
|
||||
|
|
|
@ -1263,7 +1263,7 @@ mode.versus={
|
|||
var num=lib.storage.number;
|
||||
ui.create.players(num*2);
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
game.players[i].id=get.id();
|
||||
game.players[i].getId();
|
||||
game.players[i].node.action.innerHTML='行动';
|
||||
}
|
||||
if(lib.storage.single_control&&lib.storage.control_all&&game.players.length>=4){
|
||||
|
@ -2469,7 +2469,7 @@ mode.versus={
|
|||
"step 1"
|
||||
_status.friend.remove(event.character);
|
||||
_status.enemy.remove(event.character);
|
||||
source.revive();
|
||||
source.revive(null,false);
|
||||
game.additionaldead.push({
|
||||
name:source.name,
|
||||
stat:source.stat
|
||||
|
@ -2477,6 +2477,7 @@ mode.versus={
|
|||
game.addVideo('reinit',source,[event.character,get.translation(source.side+'Color')]);
|
||||
source.uninit();
|
||||
source.init(event.character);
|
||||
game.log(source,'出场');
|
||||
source.node.identity.dataset.color=get.translation(source.side+'Color');
|
||||
source.draw(4);
|
||||
_status.event.parent.parent.parent.untrigger(false,source);
|
||||
|
@ -2599,7 +2600,7 @@ mode.versus={
|
|||
game.broadcastAll(function(source,name,color){
|
||||
_status.friend.remove(name);
|
||||
_status.enemy.remove(name);
|
||||
source.revive();
|
||||
source.revive(null,false);
|
||||
source.uninit();
|
||||
source.init(name);
|
||||
source.node.identity.dataset.color=color;
|
||||
|
@ -2607,6 +2608,7 @@ mode.versus={
|
|||
ui.arena.classList.remove('selecting');
|
||||
}
|
||||
},source,name,color);
|
||||
game.log(source,'出场');
|
||||
|
||||
source.draw(4);
|
||||
_status.event.parent.parent.parent.untrigger(false,source);
|
||||
|
|
Loading…
Reference in New Issue