This commit is contained in:
libccy 2015-10-27 15:56:42 +08:00
parent dd9f3ca6dd
commit 527af1bebf
10 changed files with 177 additions and 35 deletions

View File

@ -1,6 +1,4 @@
1.3.1 1.3.2
战棋模式改进 战棋模式调整(见帮助)
单人控制改进 通用选项:不无懈自己
新武将 奇策调整
修bug
统率模式(战棋子模式)

View File

@ -1195,6 +1195,15 @@ card.standard={
return; return;
} }
} }
if(lib.config.wuxie_self&&event.state){
if((event.current==game.me||event.current.isUnderControl())&&
(trigger.player==game.me||trigger.player.isUnderControl())){
if(trigger.targets&&trigger.targets.length==1){
event._result={bool:false};
return;
}
}
}
if(event.current.num('h','wuxie')==0){ if(event.current.num('h','wuxie')==0){
var noask=true; var noask=true;
var skills=event.current.get('s',true).concat(lib.skill.global); var skills=event.current.get('s',true).concat(lib.skill.global);

View File

@ -2914,7 +2914,7 @@ character.swd={
event.finish(); event.finish();
} }
else{ else{
player.logSkill(_status.event.name); player.logSkill('qinyin');
event.bool=(result.control=='回复体力'); event.bool=(result.control=='回复体力');
event.num=0; event.num=0;
event.players=game.players.slice(0); event.players=game.players.slice(0);

View File

@ -2118,6 +2118,10 @@ character.yijiang={
if(lib.card[i].mode&&lib.card[i].mode.contains(lib.config.mode)==false) continue; if(lib.card[i].mode&&lib.card[i].mode.contains(lib.config.mode)==false) continue;
if(lib.card[i].type=='trick') list.push(['锦囊','',i]); if(lib.card[i].type=='trick') list.push(['锦囊','',i]);
} }
list=['taoyuan','wugu','juedou','huogong','jiedao','tiesuo','guohe','shunshou','wuzhong','wanjian','nanman'];
for(var i=0;i<list.length;i++){
list[i]=['锦囊','',list[i]];
}
var dialog=ui.create.dialog([list,'vcard']); var dialog=ui.create.dialog([list,'vcard']);
player.chooseButton(dialog,function(button){ player.chooseButton(dialog,function(button){
var recover=0,lose=1; var recover=0,lose=1;

View File

@ -108,6 +108,7 @@ window.config={
revive_config:'开启复活', revive_config:'开启复活',
auto_skill_config:'自动发动常用技能', auto_skill_config:'自动发动常用技能',
auto_confirm_config:'自动确认', auto_confirm_config:'自动确认',
wuxie_self_config:'不无懈自己',
enable_drag_config:'启用拖拽', enable_drag_config:'启用拖拽',
hover_all_config:'悬停显示信息', hover_all_config:'悬停显示信息',
hover_handcard_config:'悬停手牌显示信息', hover_handcard_config:'悬停手牌显示信息',

View File

@ -7733,6 +7733,7 @@
gameconfig.push(ui.create.switcher('cheat',lib.config.cheat,ui.click.sidebar.cheat)); gameconfig.push(ui.create.switcher('cheat',lib.config.cheat,ui.click.sidebar.cheat));
gameconfig.push(ui.create.switcher('auto_confirm',lib.config.auto_confirm,ui.click.sidebar.global)); gameconfig.push(ui.create.switcher('auto_confirm',lib.config.auto_confirm,ui.click.sidebar.global));
gameconfig.push(ui.create.switcher('enable_drag',lib.config.enable_drag,ui.click.sidebar.global)); gameconfig.push(ui.create.switcher('enable_drag',lib.config.enable_drag,ui.click.sidebar.global));
gameconfig.push(ui.create.switcher('wuxie_self',lib.config.wuxie_self,ui.click.sidebar.global));
gameconfig.push(ui.create.switcher('duration',[500,700,1000],lib.config.duration,ui.click.sidebar.global)); gameconfig.push(ui.create.switcher('duration',[500,700,1000],lib.config.duration,ui.click.sidebar.global));
gameconfig.push(ui.create.switcher('hoveration',[700,1000,1500],lib.config.hoveration,ui.click.sidebar.global)); gameconfig.push(ui.create.switcher('hoveration',[700,1000,1500],lib.config.hoveration,ui.click.sidebar.global));
gameconfig.push(ui.create.div('.placeholder')); gameconfig.push(ui.create.div('.placeholder'));
@ -12330,7 +12331,12 @@
for(j in character[i]){ for(j in character[i]){
if(j=='mode'||j=='forbid') continue; if(j=='mode'||j=='forbid') continue;
if(j=='character'&&!lib.config.characters.contains(i)){ if(j=='character'&&!lib.config.characters.contains(i)){
if(lib.config.mode!='chess'||get.config('chess_mode')!='leader'){ if(lib.config.mode=='chess'&&get.config('chess_mode')=='leader'){
for(k in character[i][j]){
lib.hiddenCharacters.push(k);
}
}
else{
continue; continue;
} }
} }

View File

@ -6,8 +6,8 @@ table{table-layout: fixed;}
/*--------场景--------*/ /*--------场景--------*/
#window{width: 100%;height: 100%;top: 0;left: 0;transition-property:opacity;overflow:hidden} #window{width: 100%;height: 100%;top: 0;left: 0;transition-property:opacity;overflow:hidden}
#arena{width:90%;height: 90%;top: calc(5% + 10px);left: 5%;} #arena{width:90%;height: 90%;top: calc(5% + 10px);left: 5%;}
#arena.right{left:240px;opacity: 0.6;} #arena.right:not(.noleft){left:240px;opacity: 0.6;}
#arena.left{left:calc(10% - 240px);opacity: 0.6;} #arena.left:not(.noleft){left:calc(10% - 240px);opacity: 0.6;}
#arena.top{top:-100%;} #arena.top{top:-100%;}
#arena.paused{/*-webkit-filter:blur(3px);*/opacity: 0.3 !important;} #arena.paused{/*-webkit-filter:blur(3px);*/opacity: 0.3 !important;}
#arena.paused2{opacity: 0.1 !important;} #arena.paused2{opacity: 0.1 !important;}
@ -217,6 +217,8 @@ margin-bottom: 5px;
font-family: 'huangcao'; font-family: 'huangcao';
font-size: 20px; font-size: 20px;
letter-spacing: -2px; letter-spacing: -2px;
}
.player>.avatar>.action:not(.freecolor){
text-shadow: black 0 0 1px, rgba(10, 155, 67, 1) 0 0 5px, rgba(10, 155, 67, 1) 0 0 10px; text-shadow: black 0 0 1px, rgba(10, 155, 67, 1) 0 0 5px, rgba(10, 155, 67, 1) 0 0 10px;
} }
.player>.avatar:not(.glow2)>.action{opacity: 0} .player>.avatar:not(.glow2)>.action{opacity: 0}
@ -853,6 +855,6 @@ div[data-color="unknownm"]{
#arena{width: 1152px;left: calc(50% - 576px);} #arena{width: 1152px;left: calc(50% - 576px);}
} }
@media screen and (min-width: 1600px) { @media screen and (min-width: 1600px) {
#arena.right{left: calc(50% - 576px);} #arena.right:not(.noleft){left: calc(50% - 576px);}
#arena.left{left: calc(50% - 576px);} #arena.left:not(.noleft){left: calc(50% - 576px);}
} }

View File

@ -1,8 +1,8 @@
#arena.chess{ #arena.chess{
width:100%; width:100% !important;
height:100%; height:100% !important;
left:0; left:0 !important;
top:0; top:0 !important;
transition:all 0s !important; transition:all 0s !important;
} }
#arena.chess>#me, #arena.chess>#me,

View File

@ -1,6 +1,7 @@
'use strict'; 'use strict';
mode.chess={ mode.chess={
canvasUpdates2:[], canvasUpdates2:[],
hiddenCharacters:[],
element:{ element:{
card:{ card:{
moveTo:function(player,method){ moveTo:function(player,method){
@ -521,6 +522,39 @@ mode.chess={
game:{ game:{
minskin:true, minskin:true,
singleHandcard:true, singleHandcard:true,
addChessPlayer:function(name,enemy,num){
if(typeof num!='number'){
num=4;
}
var grids=[];
var gridnum=ui.chessheight*ui.chesswidth;
for(var i=0;i<gridnum;i++){
grids.push(i);
}
for(var i=0;i<game.players.length;i++){
grids.remove(parseInt(game.players[i].dataset.position));
}
var player=ui.create.player().animate('start');
player.init(name);
if(enemy){
player.side=!game.me.side;
player.setIdentity('enemy');
}
else{
player.side=game.me.side;
player.setIdentity('friend');
}
player.node.identity.dataset.color=get.translation(player.side+'Color');
game.players.push(player);
ui.chess.appendChild(player);
player.dataset.position=grids.randomGet();
lib.posmap[player.dataset.position]=player;
if(num){
player.directgain(get.cards(num));
}
game.arrangePlayers();
return player;
},
addOverDialog:function(dialog,result){ addOverDialog:function(dialog,result){
dialog.classList.add('center'); dialog.classList.add('center');
if(result=='战斗胜利'){ if(result=='战斗胜利'){
@ -547,13 +581,20 @@ mode.chess={
}, },
controlOver:function(){ controlOver:function(){
if(_status.enterArena){ if(_status.enterArena){
game.data.arena.acted.length=0;
if(_status.victory){ if(_status.victory){
game.data.arena.win++; game.data.arena.win++;
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
game.data.arena.dead.remove(game.players[i].name); if(_status.arenaAdd&&_status.arenaAdd.contains(game.players[i].name)){
continue;
}
if(game.data.arena.dead.contains(game.players[i].name)){
game.data.arena.dead.remove(game.players[i].name);
game.data.arena.acted.push(game.players[i].name);
}
} }
game.saveData();
} }
game.saveData();
} }
else{ else{
if(_status.challenge&&(_status.zhaoxiang||_status.victory)){ if(_status.challenge&&(_status.zhaoxiang||_status.victory)){
@ -600,7 +641,7 @@ mode.chess={
} }
} }
var num2=game.players.length-num1; var num2=game.players.length-num1;
if(num2>num1&&get.config('chess_mode')!='leader'){ if(num2>num1){
if(next.side==game.me.side){ if(next.side==game.me.side){
next=game.me; next=game.me;
} }
@ -912,6 +953,13 @@ mode.chess={
ui.chess.appendChild(friend); ui.chess.appendChild(friend);
friend.dataset.position=grids.randomRemove(); friend.dataset.position=grids.randomRemove();
lib.posmap[friend.dataset.position]=friend; lib.posmap[friend.dataset.position]=friend;
if(_status.enterArena&&game.data.arena.acted.contains(friend.name)){
friend.hp--;
friend.update();
}
if(_status.enterArena){
friend.addSkill('arenaAdd');
}
} }
while(_status.enemylist.length){ while(_status.enemylist.length){
enemy=ui.create.player().animate('start'); enemy=ui.create.player().animate('start');
@ -1593,24 +1641,26 @@ mode.chess={
} }
var rank=game.getRank(_status.challenge); var rank=game.getRank(_status.challenge);
var total=Math.max(2,_status.mylist.length-1); var total=Math.max(2,_status.mylist.length-1);
var list;
switch(rank){
case 's':list=game.rank.ap;break;
case 'ap':list=game.rank.s.concat(game.rank.a);break;
case 'a':list=game.rank.ap.concat(game.rank.am);break;
case 'am':list=game.rank.a.concat(game.rank.bp);break;
case 'bp':list=game.rank.am.concat(game.rank.b);break;
case 'b':list=game.rank.bp.concat(game.rank.bm);break;
case 'bm':list=game.rank.b.concat(game.rank.c);break;
case 'c':list=game.rank.bm.concat(game.rank.d);break;
case 'd':list=game.rank.c;break;
}
for(var i=0;i<total;i++){ for(var i=0;i<total;i++){
if(Math.random()<0.7){ if(Math.random()<0.7){
_status.enemylist.push(Array.prototype.randomGet.apply(game.rank[rank],_status.enemylist)); _status.enemylist.push(Array.prototype.randomGet.apply(
game.rank[rank],_status.enemylist.concat(_status.mylist)));
} }
else{ else{
var list; _status.enemylist.push(Array.prototype.randomGet.apply(
switch(rank){ list,_status.enemylist.concat(_status.mylist)));
case 's':list=game.rank.ap;break;
case 'ap':list=game.rank.s.concat(game.rank.a);break;
case 'a':list=game.rank.ap.concat(game.rank.am);break;
case 'am':list=game.rank.a.concat(game.rank.bp);break;
case 'bp':list=game.rank.am.concat(game.rank.b);break;
case 'b':list=game.rank.bp.concat(game.rank.bm);break;
case 'bm':list=game.rank.b.concat(game.rank.c);break;
case 'c':list=game.rank.bm.concat(game.rank.d);break;
case 'd':list=game.rank.c;break;
}
_status.enemylist.push(Array.prototype.randomGet.apply(game.rank[rank],_status.enemylist));
} }
} }
} }
@ -1635,11 +1685,18 @@ mode.chess={
case 'leader_medium':list=game.rank.b.concat(game.rank.bp).concat(game.rank.am);break; case 'leader_medium':list=game.rank.b.concat(game.rank.bp).concat(game.rank.am);break;
case 'leader_hard':list=game.rank.a.concat(game.rank.ap).concat(game.rank.s);break; case 'leader_hard':list=game.rank.a.concat(game.rank.ap).concat(game.rank.s);break;
} }
for(var i=0;i<lib.hiddenCharacters.length;i++){
if(list.length<=number){
break;
}
list.remove(lib.hiddenCharacters[i]);
}
for(var i=0;i<_status.mylist.length;i++){ for(var i=0;i<_status.mylist.length;i++){
list.remove(_status.mylist[i]); list.remove(_status.mylist[i]);
} }
_status.enemylist=list.randomGets(number); _status.enemylist=list.randomGets(number);
} }
var numdel=_status.enemylist.length-_status.mylist.length;
var reward=0; var reward=0;
for(var i=0;i<_status.enemylist.length;i++){ for(var i=0;i<_status.enemylist.length;i++){
switch(game.getRank(_status.enemylist[i])){ switch(game.getRank(_status.enemylist[i])){
@ -1654,6 +1711,13 @@ mode.chess={
case 'd':reward+=5;break; case 'd':reward+=5;break;
} }
} }
if(numdel>0){
switch(difficulty){
case 'leader_easy':reward+=10*numdel;break;
case 'leader_medium':reward+=20*numdel;break;
case 'leader_hard':reward+=40*numdel;break;
}
}
var punish=0; var punish=0;
for(var i=0;i<_status.mylist.length;i++){ for(var i=0;i<_status.mylist.length;i++){
switch(game.getRank(_status.mylist[i])){ switch(game.getRank(_status.mylist[i])){
@ -1668,6 +1732,13 @@ mode.chess={
case 'd':punish+=2;break; case 'd':punish+=2;break;
} }
} }
if(numdel<0){
switch(difficulty){
case 'leader_easy':punish-=5*numdel;break;
case 'leader_medium':punish-=10*numdel;break;
case 'leader_hard':punish-=20*numdel;break;
}
}
game.reward=Math.max(3*_status.enemylist.length,reward-punish); game.reward=Math.max(3*_status.enemylist.length,reward-punish);
if(!_status.lord){ if(!_status.lord){
switch(difficulty){ switch(difficulty){
@ -1942,6 +2013,7 @@ mode.chess={
game.data.arena={ game.data.arena={
win:0, win:0,
dead:[], dead:[],
acted:[],
choice:choice, choice:choice,
arenachoice:event.arenachoice arenachoice:event.arenachoice
} }
@ -1991,6 +2063,7 @@ mode.chess={
} }
'step 6' 'step 6'
game.minskin=true; game.minskin=true;
ui.arena.classList.add('noleft');
var nodes=event.arenachoicenodes; var nodes=event.arenachoicenodes;
for(var i=0;i<nodes.length;i++){ for(var i=0;i<nodes.length;i++){
nodes[i].style.webkitTransform='scale(0.8)'; nodes[i].style.webkitTransform='scale(0.8)';
@ -2060,6 +2133,13 @@ mode.chess={
} }
else{ else{
nodes[i].style.opacity=1; nodes[i].style.opacity=1;
if(game.data.arena.acted.contains(nodes[i].name)){
var acted=ui.create.div('.action',nodes[i].node.avatar);
acted.style.opacity=1;
acted.innerHTML='疲劳';
acted.dataset.nature='soilm';
acted.classList.add('freecolor');
}
} }
} }
} }
@ -2666,6 +2746,45 @@ mode.chess={
} }
}, },
skill:{ skill:{
arenaAdd:{
enable:'phaseUse',
usable:1,
filter:function(event,player){
return _status.enterArena&&player.side==game.me.side&&game.data.arena.arenachoice.length>game.data.arena.dead.length;
},
direct:true,
delay:0,
preservecancel:true,
content:function(){
"step 0"
var list=game.data.arena.arenachoice.slice(0);
for(var i=0;i<game.data.arena.dead.length;i++){
list.remove(game.data.arena.dead[i]);
}
event.dialog=ui.create.dialog('选择一个出场武将',[list,'character']);
game.pause();
event.custom.replace.button=function(button){
event.choice=button.link;
game.resume();
}
event.custom.replace.confirm=game.resume;
"step 1"
event.dialog.close();
if(event.choice){
var name=event.choice;
game.addChessPlayer(name);
game.data.arena.dead.push(name);
game.saveData();
if(!_status.arenaAdd){
_status.arenaAdd=[];
}
_status.arenaAdd.push(name);
}
else{
player.getStat('skill').arenaAdd--;
}
},
},
leader_zhaoxiang:{ leader_zhaoxiang:{
unique:true, unique:true,
enable:'phaseUse', enable:'phaseUse',
@ -3670,6 +3789,9 @@ mode.chess={
epic:'史诗', epic:'史诗',
legend:'传说', legend:'传说',
arenaAdd:'援军',
arenaAdd_info:'出牌阶段限一次,你可以令一名未出场的已方角色加入战场。战斗结束后,该角色无论是否存活均不能再次出场',
pianyi:'翩仪', pianyi:'翩仪',
pianyi_info:'回合结束阶段,若你没有于本回合内造成伤害,你获得一次移动机会', pianyi_info:'回合结束阶段,若你没有于本回合内造成伤害,你获得一次移动机会',
lingdong:'移动射击', lingdong:'移动射击',
@ -3846,7 +3968,7 @@ mode.chess={
'金钱可以用来招募随机武将,招到已有武将,或遣返不需要的武将时可得到招募令<li>'+ '金钱可以用来招募随机武将,招到已有武将,或遣返不需要的武将时可得到招募令<li>'+
'战斗中有君主出场时可招降敌将成功率取决于敌将的稀有度、剩余体力值以及手牌数。成功后战斗立即结束且没有金钱奖励。每发动一次招降无论成功还是失败都会扣除10招募令<li>'+ '战斗中有君主出场时可招降敌将成功率取决于敌将的稀有度、剩余体力值以及手牌数。成功后战斗立即结束且没有金钱奖励。每发动一次招降无论成功还是失败都会扣除10招募令<li>'+
'挑战武将会与该武将以及与其强度相近的武将进行战斗敌方人数与我方出场人数相同但不少于3。胜利后可通过招募令招募该武将<li>'+ '挑战武将会与该武将以及与其强度相近的武将进行战斗敌方人数与我方出场人数相同但不少于3。胜利后可通过招募令招募该武将<li>'+
'竞技场中,你随机选择9名武将每次派出1〜3名武将参战。战斗中阵亡的武将不能再次上场。当取得12场胜利或所有武将全部阵亡后结束并根据胜场数获得随机奖励' '竞技场<br>随机选择9名武将每次派出1〜3名武将参战。战斗中阵亡的武将不能再次上场。<br><br>战斗后武将进入疲劳状态,若立即再次出场则初始体力值-1。<br><br>战斗中本方武将行动时可召唤后援,令一名未出场的已方武将加入战斗。后援武将在战斗结束后无论存活与否均不能再次出场<br><br>当取得12场胜利或所有武将全部阵亡后结束并根据胜场数获得随机奖励'
}, },
config:[ config:[
function(game,lib,get,ui){ function(game,lib,get,ui){

View File

@ -588,7 +588,7 @@ mode.identity={
case 'zhong': case 'zhong':
switch(identity2){ switch(identity2){
case 'zhu': return 10; case 'zhu': return 10;
case 'zhong': return get.population('fan')>0?4:0.1; case 'zhong': return 4;
case 'nei': case 'nei':
if(get.population('fan')==0) return -2; if(get.population('fan')==0) return -2;
return Math.min(3,-situation); return Math.min(3,-situation);