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
战棋模式改进
单人控制改进
新武将
修bug
统率模式(战棋子模式)
1.3.2
战棋模式调整(见帮助)
通用选项:不无懈自己
奇策调整

View File

@ -1195,6 +1195,15 @@ card.standard={
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){
var noask=true;
var skills=event.current.get('s',true).concat(lib.skill.global);

View File

@ -2914,7 +2914,7 @@ character.swd={
event.finish();
}
else{
player.logSkill(_status.event.name);
player.logSkill('qinyin');
event.bool=(result.control=='回复体力');
event.num=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].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']);
player.chooseButton(dialog,function(button){
var recover=0,lose=1;

View File

@ -108,6 +108,7 @@ window.config={
revive_config:'开启复活',
auto_skill_config:'自动发动常用技能',
auto_confirm_config:'自动确认',
wuxie_self_config:'不无懈自己',
enable_drag_config:'启用拖拽',
hover_all_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('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('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('hoveration',[700,1000,1500],lib.config.hoveration,ui.click.sidebar.global));
gameconfig.push(ui.create.div('.placeholder'));
@ -12330,7 +12331,12 @@
for(j in character[i]){
if(j=='mode'||j=='forbid') continue;
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;
}
}

View File

@ -6,8 +6,8 @@ table{table-layout: fixed;}
/*--------场景--------*/
#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.right{left:240px;opacity: 0.6;}
#arena.left{left:calc(10% - 240px);opacity: 0.6;}
#arena.right:not(.noleft){left:240px;opacity: 0.6;}
#arena.left:not(.noleft){left:calc(10% - 240px);opacity: 0.6;}
#arena.top{top:-100%;}
#arena.paused{/*-webkit-filter:blur(3px);*/opacity: 0.3 !important;}
#arena.paused2{opacity: 0.1 !important;}
@ -217,6 +217,8 @@ margin-bottom: 5px;
font-family: 'huangcao';
font-size: 20px;
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;
}
.player>.avatar:not(.glow2)>.action{opacity: 0}
@ -853,6 +855,6 @@ div[data-color="unknownm"]{
#arena{width: 1152px;left: calc(50% - 576px);}
}
@media screen and (min-width: 1600px) {
#arena.right{left: calc(50% - 576px);}
#arena.left{left: calc(50% - 576px);}
#arena.right:not(.noleft){left: calc(50% - 576px);}
#arena.left:not(.noleft){left: calc(50% - 576px);}
}

View File

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

View File

@ -1,6 +1,7 @@
'use strict';
mode.chess={
canvasUpdates2:[],
hiddenCharacters:[],
element:{
card:{
moveTo:function(player,method){
@ -521,6 +522,39 @@ mode.chess={
game:{
minskin: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){
dialog.classList.add('center');
if(result=='战斗胜利'){
@ -547,14 +581,21 @@ mode.chess={
},
controlOver:function(){
if(_status.enterArena){
game.data.arena.acted.length=0;
if(_status.victory){
game.data.arena.win++;
for(var i=0;i<game.players.length;i++){
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();
}
}
else{
if(_status.challenge&&(_status.zhaoxiang||_status.victory)){
game.data.challenge=game.getLeaderList();
@ -600,7 +641,7 @@ mode.chess={
}
}
var num2=game.players.length-num1;
if(num2>num1&&get.config('chess_mode')!='leader'){
if(num2>num1){
if(next.side==game.me.side){
next=game.me;
}
@ -912,6 +953,13 @@ mode.chess={
ui.chess.appendChild(friend);
friend.dataset.position=grids.randomRemove();
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){
enemy=ui.create.player().animate('start');
@ -1593,11 +1641,6 @@ mode.chess={
}
var rank=game.getRank(_status.challenge);
var total=Math.max(2,_status.mylist.length-1);
for(var i=0;i<total;i++){
if(Math.random()<0.7){
_status.enemylist.push(Array.prototype.randomGet.apply(game.rank[rank],_status.enemylist));
}
else{
var list;
switch(rank){
case 's':list=game.rank.ap;break;
@ -1610,7 +1653,14 @@ mode.chess={
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));
for(var i=0;i<total;i++){
if(Math.random()<0.7){
_status.enemylist.push(Array.prototype.randomGet.apply(
game.rank[rank],_status.enemylist.concat(_status.mylist)));
}
else{
_status.enemylist.push(Array.prototype.randomGet.apply(
list,_status.enemylist.concat(_status.mylist)));
}
}
}
@ -1635,11 +1685,18 @@ mode.chess={
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;
}
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++){
list.remove(_status.mylist[i]);
}
_status.enemylist=list.randomGets(number);
}
var numdel=_status.enemylist.length-_status.mylist.length;
var reward=0;
for(var i=0;i<_status.enemylist.length;i++){
switch(game.getRank(_status.enemylist[i])){
@ -1654,6 +1711,13 @@ mode.chess={
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;
for(var i=0;i<_status.mylist.length;i++){
switch(game.getRank(_status.mylist[i])){
@ -1668,6 +1732,13 @@ mode.chess={
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);
if(!_status.lord){
switch(difficulty){
@ -1942,6 +2013,7 @@ mode.chess={
game.data.arena={
win:0,
dead:[],
acted:[],
choice:choice,
arenachoice:event.arenachoice
}
@ -1991,6 +2063,7 @@ mode.chess={
}
'step 6'
game.minskin=true;
ui.arena.classList.add('noleft');
var nodes=event.arenachoicenodes;
for(var i=0;i<nodes.length;i++){
nodes[i].style.webkitTransform='scale(0.8)';
@ -2060,6 +2133,13 @@ mode.chess={
}
else{
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:{
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:{
unique:true,
enable:'phaseUse',
@ -3670,6 +3789,9 @@ mode.chess={
epic:'史诗',
legend:'传说',
arenaAdd:'援军',
arenaAdd_info:'出牌阶段限一次,你可以令一名未出场的已方角色加入战场。战斗结束后,该角色无论是否存活均不能再次出场',
pianyi:'翩仪',
pianyi_info:'回合结束阶段,若你没有于本回合内造成伤害,你获得一次移动机会',
lingdong:'移动射击',
@ -3846,7 +3968,7 @@ mode.chess={
'金钱可以用来招募随机武将,招到已有武将,或遣返不需要的武将时可得到招募令<li>'+
'战斗中有君主出场时可招降敌将成功率取决于敌将的稀有度、剩余体力值以及手牌数。成功后战斗立即结束且没有金钱奖励。每发动一次招降无论成功还是失败都会扣除10招募令<li>'+
'挑战武将会与该武将以及与其强度相近的武将进行战斗敌方人数与我方出场人数相同但不少于3。胜利后可通过招募令招募该武将<li>'+
'竞技场中,你随机选择9名武将每次派出1〜3名武将参战。战斗中阵亡的武将不能再次上场。当取得12场胜利或所有武将全部阵亡后结束并根据胜场数获得随机奖励'
'竞技场<br>随机选择9名武将每次派出1〜3名武将参战。战斗中阵亡的武将不能再次上场。<br><br>战斗后武将进入疲劳状态,若立即再次出场则初始体力值-1。<br><br>战斗中本方武将行动时可召唤后援,令一名未出场的已方武将加入战斗。后援武将在战斗结束后无论存活与否均不能再次出场<br><br>当取得12场胜利或所有武将全部阵亡后结束并根据胜场数获得随机奖励'
},
config:[
function(game,lib,get,ui){

View File

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