This commit is contained in:
libccy 2017-01-16 15:48:07 +08:00
parent 951723aa87
commit f8d6b19340
17 changed files with 453 additions and 106 deletions

View File

@ -55,14 +55,14 @@ character.extra={
} }
} }
var prompt=get.prompt('qinyin')+'(剩余'+get.cnNumber(event.count)+'次)'; var prompt=get.prompt('qinyin')+'(剩余'+get.cnNumber(event.count)+'次)';
player.chooseControl('失去体力','回复体力','cancel', player.chooseControl('失去体力','回复体力','cancel2',
ui.create.dialog(get.prompt('qinyin'),'hidden')).ai=function(){ ui.create.dialog(get.prompt('qinyin'),'hidden')).ai=function(){
if(lose>recover&&lose>0) return 0; if(lose>recover&&lose>0) return 0;
if(lose<recover&&recover>0) return 1; if(lose<recover&&recover>0) return 1;
return 2; return 2;
} }
"step 1" "step 1"
if(result.bool==false||result.control=='cancel'){ if(result.control=='cancel2'){
event.finish(); event.finish();
} }
else{ else{

View File

@ -1964,14 +1964,14 @@ character.hearth={
}, },
content:function(){ content:function(){
'step 0' 'step 0'
player.chooseControl('draw_card','出杀','cancel',function(){ player.chooseControl('draw_card','出杀','cancel2',function(){
if(ai.get.effect(trigger.target,{name:'sha'},player,player)>0){ if(ai.get.effect(trigger.target,{name:'sha'},player,player)>0){
return '出杀'; return '出杀';
} }
return 'draw_card'; return 'draw_card';
}).prompt='是对'+get.translation(trigger.target)+'发动否发动【远征】?'; }).prompt='是对'+get.translation(trigger.target)+'发动否发动【远征】?';
'step 1' 'step 1'
if(result.control!='cancel'){ if(result.control!='cancel2'){
if(result.control=='draw_card'){ if(result.control=='draw_card'){
player.draw(); player.draw();
player.logSkill('yuanzheng'); player.logSkill('yuanzheng');
@ -3829,10 +3829,10 @@ character.hearth={
var cards=[ui.cardPile.childNodes[0],ui.cardPile.childNodes[1]]; var cards=[ui.cardPile.childNodes[0],ui.cardPile.childNodes[1]];
var att=ai.get.attitude(player,trigger.player); var att=ai.get.attitude(player,trigger.player);
var delta=trigger.judge(ui.cardPile.childNodes[1])-trigger.judge(ui.cardPile.childNodes[0]); var delta=trigger.judge(ui.cardPile.childNodes[1])-trigger.judge(ui.cardPile.childNodes[0]);
player.chooseControl('调换顺序','cancel', player.chooseControl('调换顺序','cancel2',
ui.create.dialog('先知:'+get.translation(trigger.player)+'的'+str+'判定',cards,'hidden')).ai=function(){ ui.create.dialog('先知:'+get.translation(trigger.player)+'的'+str+'判定',cards,'hidden')).ai=function(){
if(att*delta>0) return '调换顺序'; if(att*delta>0) return '调换顺序';
else return 'cancel'; else return 'cancel2';
}; };
'step 1' 'step 1'
if(result.control=='调换顺序'){ if(result.control=='调换顺序'){
@ -5258,7 +5258,7 @@ character.hearth={
ayuling:'玉灵', ayuling:'玉灵',
ayuling_info:'每当你受到一次伤害,你可以获得一张随机青玉牌;每当你使用一张青玉牌,你的手牌上限+1当你累计使用两张青玉牌后你可以于回合开始阶段摸一张牌当你累计使用六张青玉牌后你可以于回合结束阶段摸一张牌', ayuling_info:'每当你受到一次伤害,你可以获得一张随机青玉牌;每当你使用一张青玉牌,你的手牌上限+1当你累计使用两张青玉牌后你可以于回合开始阶段摸一张牌当你累计使用六张青玉牌后你可以于回合结束阶段摸一张牌',
lianjin:'炼金', lianjin:'炼金',
lianjin_info:'出牌阶段限两次,将一张手牌永久转化为一张由三张随机牌组成的药水', lianjin_info:'出牌阶段限两次,你可以将一张手牌永久转化为一张由三张随机牌组成的药水',
shouji:'收集', shouji:'收集',
shouji_info:'每回合限发动一次,每当你使用一张杀,你可以获得一张目标随机手牌的复制;每当你的杀被闪避,你可以获得一张目标随机装备牌的复制', shouji_info:'每回合限发动一次,每当你使用一张杀,你可以获得一张目标随机手牌的复制;每当你的杀被闪避,你可以获得一张目标随机装备牌的复制',
guimou:'鬼谋', guimou:'鬼谋',

View File

@ -2377,13 +2377,13 @@ character.ow={
if(player.hp<player.maxHp){ if(player.hp<player.maxHp){
controls.push('recover_hp'); controls.push('recover_hp');
} }
controls.push('cancel'); controls.push('cancel2');
player.chooseControl(controls).set('prompt',get.prompt('ziyu')).set('ai',function(event,player){ player.chooseControl(controls).set('prompt',get.prompt('ziyu')).set('ai',function(event,player){
if(player.hp<player.maxHp) return 'recover_hp'; if(player.hp<player.maxHp) return 'recover_hp';
return 'draw_card'; return 'draw_card';
}); });
"step 1" "step 1"
if(result.control!='cancel'){ if(result.control!='cancel2'){
player.logSkill('ziyu'); player.logSkill('ziyu');
if(result.control=='draw_card'){ if(result.control=='draw_card'){
player.draw(); player.draw();
@ -2406,13 +2406,13 @@ character.ow={
if(player.hp<player.maxHp){ if(player.hp<player.maxHp){
controls.push('recover_hp'); controls.push('recover_hp');
} }
controls.push('cancel'); controls.push('cancel2');
player.chooseControl(controls).set('prompt',get.prompt('ziyu')).set('ai',function(event,player){ player.chooseControl(controls).set('prompt',get.prompt('ziyu')).set('ai',function(event,player){
if(player.hp<player.maxHp) return 'recover_hp'; if(player.hp<player.maxHp) return 'recover_hp';
return 'draw_card'; return 'draw_card';
}); });
"step 1" "step 1"
if(result.control!='cancel'){ if(result.control!='cancel2'){
player.logSkill('ziyu'); player.logSkill('ziyu');
if(result.control=='draw_card'){ if(result.control=='draw_card'){
player.draw(); player.draw();

View File

@ -350,6 +350,7 @@ window.characterRank={
'hs_liadrin', 'hs_liadrin',
'hs_anomalus', 'hs_anomalus',
'mifuren', 'mifuren',
'hanba',
], ],
b:[ b:[
'caochun', 'caochun',
@ -366,7 +367,6 @@ window.characterRank={
'hs_nozdormu', 'hs_nozdormu',
'yxs_lishimin', 'yxs_lishimin',
'hs_ruanniguai', 'hs_ruanniguai',
'hanba',
'daxiaoqiao', 'daxiaoqiao',
'pal_linyueru', 'pal_linyueru',
'zhuran', 'zhuran',

View File

@ -89,7 +89,7 @@ character.refresh={
list.push('jiu'); list.push('jiu');
} }
if(list.length){ if(list.length){
list.push('cancel'); list.push('cancel2');
player.chooseControl(list,function(){ player.chooseControl(list,function(){
var controls=_status.event.controls; var controls=_status.event.controls;
var player=_status.event.player; var player=_status.event.player;
@ -103,7 +103,7 @@ character.refresh={
} }
} }
} }
return 'cancel'; return 'cancel2';
}).set('prompt','是否视为使用一张基本牌?'); }).set('prompt','是否视为使用一张基本牌?');
} }
else{ else{
@ -119,7 +119,7 @@ character.refresh={
event.finish(); event.finish();
} }
'step 1' 'step 1'
if(result&&result.control&&result.control!='cancel'){ if(result&&result.control&&result.control!='cancel2'){
if(result.control=='sha'){ if(result.control=='sha'){
player.chooseTarget(function(card,player,target){ player.chooseTarget(function(card,player,target){
return player.canUse({name:'sha'},target,true,true); return player.canUse({name:'sha'},target,true,true);
@ -834,14 +834,14 @@ character.refresh={
content:function(){ content:function(){
"step 0" "step 0"
if(get.itemtype(trigger.cards)=='cards'&&get.position(trigger.cards[0])=='d'){ if(get.itemtype(trigger.cards)=='cards'&&get.position(trigger.cards[0])=='d'){
player.chooseControl('rejianxiong_mopai','rejianxiong_napai','cancel').ai=function(){ player.chooseControl('rejianxiong_mopai','rejianxiong_napai','cancel2').ai=function(){
var trigger=_status.event.getTrigger(); var trigger=_status.event.getTrigger();
if(trigger.cards.length==1&&trigger.cards[0].name=='sha') return 0; if(trigger.cards.length==1&&trigger.cards[0].name=='sha') return 0;
return 1; return 1;
}; };
} }
else{ else{
player.chooseControl('rejianxiong_mopai','cancel'); player.chooseControl('rejianxiong_mopai','cancel2');
} }
"step 1" "step 1"
if(result.control=='rejianxiong_napai'){ if(result.control=='rejianxiong_napai'){

View File

@ -151,7 +151,7 @@ character.shenhua={
audio:'kuanggu', audio:'kuanggu',
content:function(){ content:function(){
'step 0' 'step 0'
var controls=['draw_card','cancel']; var controls=['draw_card','cancel2'];
if(player.hp<player.maxHp) controls.unshift('recover_hp'); if(player.hp<player.maxHp) controls.unshift('recover_hp');
player.chooseControl(controls).set('prompt',get.prompt('xinkuanggu')).set('ai',function(event,player){ player.chooseControl(controls).set('prompt',get.prompt('xinkuanggu')).set('ai',function(event,player){
if(player.hp==player.maxHp) return 'draw_card'; if(player.hp==player.maxHp) return 'draw_card';
@ -160,7 +160,7 @@ character.shenhua={
return 'recover_hp'; return 'recover_hp';
}); });
'step 1' 'step 1'
if(result.control!='cancel'){ if(result.control!='cancel2'){
player.logSkill('xinkuanggu'); player.logSkill('xinkuanggu');
if(result.control=='draw_card'){ if(result.control=='draw_card'){
player.draw(); player.draw();
@ -1263,10 +1263,10 @@ character.shenhua={
event.control=ui.create.control(); event.control=ui.create.control();
} }
else{ else{
event.control=ui.create.control(['cancel']); event.control=ui.create.control(['cancel2']);
} }
event.clickControl=function(link){ event.clickControl=function(link){
if(link!='cancel'){ if(link!='cancel2'){
var currentname=event.dialog.querySelector('.selected.button').link; var currentname=event.dialog.querySelector('.selected.button').link;
var mark=player.marks.huashen; var mark=player.marks.huashen;
if(trigger.name=='game'){ if(trigger.name=='game'){
@ -1358,7 +1358,7 @@ character.shenhua={
event.control.style.opacity=0; event.control.style.opacity=0;
} }
else{ else{
event.control.replace(['cancel']); event.control.replace(['cancel2']);
} }
} }
else{ else{
@ -1388,7 +1388,7 @@ character.shenhua={
event.control.style.opacity=0; event.control.style.opacity=0;
} }
else{ else{
event.control.replace(['cancel']); event.control.replace(['cancel2']);
} }
event.control.custom=event.clickControl; event.control.custom=event.clickControl;
return; return;

View File

@ -18,7 +18,7 @@ character.sp={
simalang:['male','wei',3,['junbing','quji']], simalang:['male','wei',3,['junbing','quji']],
zhangxingcai:['female','shu',3,['shenxian','qiangwu']], zhangxingcai:['female','shu',3,['shenxian','qiangwu']],
fuwan:['male','qun',4,['moukui']], fuwan:['male','qun',4,['moukui']],
sp_sunshangxiang:['female','shu',3,['liangzhu','xiaoji']], sp_sunshangxiang:['female','shu',3,['liangzhu','fanxiang']],
caoang:['male','wei',4,['kaikang']], caoang:['male','wei',4,['kaikang']],
re_yuanshu:['male','qun',4,['wangzun','tongji']], re_yuanshu:['male','qun',4,['wangzun','tongji']],
sp_caoren:['male','wei',4,['kuiwei','yanzheng']], sp_caoren:['male','wei',4,['kuiwei','yanzheng']],
@ -4012,9 +4012,9 @@ character.sp={
content:function(){ content:function(){
'step 0' 'step 0'
player.addTempSkill('fengpo3','phaseAfter'); player.addTempSkill('fengpo3','phaseAfter');
player.chooseControl('draw_card','加伤害','cancel').set('prompt',get.prompt('fengpo')); player.chooseControl('draw_card','加伤害','cancel2').set('prompt',get.prompt('fengpo'));
'step 1' 'step 1'
if(result.control&&result.control!='cancel'){ if(result.control&&result.control!='cancel2'){
player.logSkill('fengpo'); player.logSkill('fengpo');
var nd=trigger.target.num('h',{suit:'diamond'}); var nd=trigger.target.num('h',{suit:'diamond'});
if(result.control=='draw_card'){ if(result.control=='draw_card'){
@ -4346,15 +4346,15 @@ character.sp={
}, },
content:function(){ content:function(){
'step 0' 'step 0'
player.chooseControl('basic','trick','equip','cancel',function(){ player.chooseControl('basic','trick','equip','cancel2',function(){
var source=_status.event.source; var source=_status.event.source;
if(ai.get.attitude(_status.event.player,source)>0) return 'cancel'; if(ai.get.attitude(_status.event.player,source)>0) return 'cancel2';
if(_status.currentPhase!=source) return 'trick'; if(_status.currentPhase!=source) return 'trick';
if(lib.filter.cardUsable({name:'sha'},source)&&source.num('h')>=2) return 'basic'; if(lib.filter.cardUsable({name:'sha'},source)&&source.num('h')>=2) return 'basic';
return 'trick'; return 'trick';
}).set('prompt',get.prompt('jilei',trigger.source)).set('source',trigger.source); }).set('prompt',get.prompt('jilei',trigger.source)).set('source',trigger.source);
'step 1' 'step 1'
if(result.control!='cancel'){ if(result.control!='cancel2'){
player.logSkill('jilei',trigger.source); player.logSkill('jilei',trigger.source);
player.popup(get.translation(result.control)+'牌'); player.popup(get.translation(result.control)+'牌');
trigger.source.storage.jilei2=result.control; trigger.source.storage.jilei2=result.control;
@ -5009,19 +5009,79 @@ character.sp={
liangzhu:{ liangzhu:{
audio:2, audio:2,
trigger:{global:'recoverAfter'}, trigger:{global:'recoverAfter'},
check:function(event,player){ direct:true,
return ai.get.attitude(player,event.player)>=0;
},
filter:function(event,player){ filter:function(event,player){
return event.player!=player&&_status.currentPhase==event.player; return _status.currentPhase==event.player;
}, },
content:function(){ content:function(){
game.asyncDraw([trigger.player,player]); 'step 0'
if(player==trigger.player){
player.chooseControl('摸一张','摸两张','cancel2',function(){
return '摸两张';
}).set('prompt',get.prompt('liangzhu'));
event.single=true;
}
else{
player.chooseTarget(get.prompt('liangzhu'),function(card,player,target){
return target==_status.event.player||target==_status.event.target;
}).set('target',trigger.player).set('ai',function(target){
var player=_status.event.player;
if(player==target) return 1;
return ai.get.attitude(player,target)-1.5;
});
}
'step 1'
if(event.single){
if(result.control!='cancel2'){
player.logSkill('liangzhu',player);
if(result.control=='摸一张'){
player.draw();
}
else{
player.draw(2);
player.storage.liangzhu=player;
}
}
}
else if(result.bool){
var target=result.targets[0];
player.logSkill('liangzhu',target);
if(target==player){
target.draw();
}
else{
target.draw(2);
target.storage.liangzhu=player;
}
}
}, },
ai:{ ai:{
expose:0.2 expose:0.1
} }
}, },
fanxiang:{
skillAnimation:true,
animationColor:'fire',
audio:2,
unique:true,
forceunique:true,
trigger:{player:'phaseBegin'},
filter:function(event,player){
for(var i=0;i<game.players.length;i++){
if(game.players[i].storage.liangzhu==player&&game.players[i].isDamaged()){
return true;
}
}
return false;
},
forced:true,
content:function(){
player.gainMaxHp();
player.recover();
player.removeSkill('liangzhu');
player.addSkill('xiaoji');
},
},
mingshi:{ mingshi:{
audio:2, audio:2,
trigger:{player:'damageBegin'}, trigger:{player:'damageBegin'},
@ -6457,6 +6517,7 @@ character.sp={
player.storage.bifa[1].gain(result.cards,player); player.storage.bifa[1].gain(result.cards,player);
player.$give(result.cards,player.storage.bifa[1]); player.$give(result.cards,player.storage.bifa[1]);
player.gain(player.storage.bifa[0],'draw2'); player.gain(player.storage.bifa[0],'draw2');
game.log(player,'获得了',player.storage.bifa[0]);
} }
else{ else{
ui.discardPile.appendChild(player.storage.bifa[0]); ui.discardPile.appendChild(player.storage.bifa[0]);
@ -7367,6 +7428,8 @@ character.sp={
yawang:'雅望', yawang:'雅望',
xunzhi:'殉志', xunzhi:'殉志',
yingjian:'影箭', yingjian:'影箭',
fanxiang:'返乡',
fanxiang_info:'觉醒技准备阶段开始时若全场有至少一名已受伤且你曾发动【良助】令其摸牌的角色则你回复1点体力和体力上限失去技能【良助】并获得技能【枭姬】',
yingjian_info:'回合开始阶段,你可以视为使用一张无视距离的杀', yingjian_info:'回合开始阶段,你可以视为使用一张无视距离的杀',
xunzhi_info:'准备阶段开始时若你的上家和下家与你的体力值均不相等你可以失去1点体力。若如此做你的手牌上限+2', xunzhi_info:'准备阶段开始时若你的上家和下家与你的体力值均不相等你可以失去1点体力。若如此做你的手牌上限+2',
yawang_info:'锁定技摸牌阶段开始时你放弃摸牌改为摸x张牌然后你于出牌阶段内至多使用x张牌x为与你体力值相等的角色数', yawang_info:'锁定技摸牌阶段开始时你放弃摸牌改为摸x张牌然后你于出牌阶段内至多使用x张牌x为与你体力值相等的角色数',
@ -7417,7 +7480,7 @@ character.sp={
tongji_info:'锁定技。若你的手牌数大于你的体力值,则只要你在任一其他角色的攻击范围内,该角色使用【杀】时便不能指定你以外的角色为目标', tongji_info:'锁定技。若你的手牌数大于你的体力值,则只要你在任一其他角色的攻击范围内,该角色使用【杀】时便不能指定你以外的角色为目标',
wangzun_info:'其他角色的回合开始时,你可以摸一张牌,然后令该角色此回合的手牌上限-1直到你的回合开始你不能再次发动此技', wangzun_info:'其他角色的回合开始时,你可以摸一张牌,然后令该角色此回合的手牌上限-1直到你的回合开始你不能再次发动此技',
kaikang_info:'每当你距离1以内的角色成为杀的目标后你可以摸一张牌。若如此做你交给其一张牌并展示之若该牌为装备牌该角色可以使用此牌。', kaikang_info:'每当你距离1以内的角色成为杀的目标后你可以摸一张牌。若如此做你交给其一张牌并展示之若该牌为装备牌该角色可以使用此牌。',
liangzhu_info:'其他角色在其回合内回复体力时,你可以与其各摸一张牌 ', liangzhu_info:'当一名角色于其出牌阶段内回复体力时你可以选择一项1、摸一张牌2、令该角色摸两张牌 ',
mingshi_info:'当你即将受到伤害时,若伤害来源的体力值大于你,你可以弃置一张黑色手牌令伤害-1 ', mingshi_info:'当你即将受到伤害时,若伤害来源的体力值大于你,你可以弃置一张黑色手牌令伤害-1 ',
lirang_info:'你可以将你弃置的卡牌交给一名其他角色 ', lirang_info:'你可以将你弃置的卡牌交给一名其他角色 ',
moukui_info:'当你使用【杀】指定一名角色为目标后,你可以选择一项:摸一张牌,或弃置其一张牌。若如此做,此【杀】被【闪】抵消时,该角色弃置你的一张牌。 ', moukui_info:'当你使用【杀】指定一名角色为目标后,你可以选择一项:摸一张牌,或弃置其一张牌。若如此做,此【杀】被【闪】抵消时,该角色弃置你的一张牌。 ',

View File

@ -6576,7 +6576,7 @@ character.swd={
if(todiscard.length){ if(todiscard.length){
choice.push('discard_card'); choice.push('discard_card');
} }
choice.push('cancel'); choice.push('cancel2');
if(choice.length>1){ if(choice.length>1){
if(event.isMine()){ if(event.isMine()){
event.dialog=ui.create.dialog(get.prompt('xielv')); event.dialog=ui.create.dialog(get.prompt('xielv'));
@ -6584,7 +6584,7 @@ character.swd={
player.chooseControl(choice).ai=function(){ player.chooseControl(choice).ai=function(){
if(choice.contains('recover_hp')) return 'recover_hp'; if(choice.contains('recover_hp')) return 'recover_hp';
else if(ainum>0) return 'discard_card'; else if(ainum>0) return 'discard_card';
else return 'cancel'; else return 'cancel2';
} }
event.todiscard=todiscard; event.todiscard=todiscard;
event.filter=filter; event.filter=filter;

View File

@ -662,13 +662,13 @@ character.yijiang={
if(player.hp<player.maxHp){ if(player.hp<player.maxHp){
controls.push('recover_hp'); controls.push('recover_hp');
} }
controls.push('cancel'); controls.push('cancel2');
player.chooseControl(controls).set('prompt',get.prompt('guizao')).set('ai',function(event,player){ player.chooseControl(controls).set('prompt',get.prompt('guizao')).set('ai',function(event,player){
if(player.hp<player.maxHp) return 'recover_hp'; if(player.hp<player.maxHp) return 'recover_hp';
return 'draw_card'; return 'draw_card';
}); });
"step 1" "step 1"
if(result.control!='cancel'){ if(result.control!='cancel2'){
player.logSkill('guizao'); player.logSkill('guizao');
if(result.control=='draw_card'){ if(result.control=='draw_card'){
player.draw(); player.draw();
@ -6455,7 +6455,7 @@ character.yijiang={
direct:true, direct:true,
content:function(){ content:function(){
"step 0" "step 0"
player.chooseControl('jiangchi_less','jiangchi_more','cancel',function(){ player.chooseControl('jiangchi_less','jiangchi_more','cancel2',function(){
var player=_status.event.player; var player=_status.event.player;
if(player.num('h')>3&&player.num('h','sha')>1){ if(player.num('h')>3&&player.num('h','sha')>1){
return 'jiangchi_less'; return 'jiangchi_less';
@ -6466,7 +6466,7 @@ character.yijiang={
if(player.hp-player.num('h')>1){ if(player.hp-player.num('h')>1){
return 'jiangchi_more'; return 'jiangchi_more';
} }
return 'cancel'; return 'cancel2';
}); });
"step 1" "step 1"
if(result.control=='jiangchi_less'){ if(result.control=='jiangchi_less'){

View File

@ -166,7 +166,7 @@ play.boss={
lib.translate[i]=lib.translate[i]||mode.versus.translate[i]; lib.translate[i]=lib.translate[i]||mode.versus.translate[i];
} }
for(var i in mode.versus.skill){ for(var i in mode.versus.skill){
if(i!='versus_swap'){ if(i!='versus_swap'&&i!='versus_ladder'){
lib.skill[i]=lib.init.eval(mode.versus.skill[i]); lib.skill[i]=lib.init.eval(mode.versus.skill[i]);
game.finishSkill(i); game.finishSkill(i);
} }

View File

@ -71,10 +71,10 @@ play.soldier={
if(event.isMine()){ if(event.isMine()){
event.dialog=ui.create.dialog('选择替你承受伤害的士兵'); event.dialog=ui.create.dialog('选择替你承受伤害的士兵');
} }
player.chooseControl(player.storage.soldier,'cancel'); player.chooseControl(player.storage.soldier,'cancel2');
"step 1" "step 1"
if(event.dialog) event.dialog.close(); if(event.dialog) event.dialog.close();
if(result.control!='cancel'&&result.control){ if(result.control!='cancel2'&&result.control){
game.log(player,'牺牲了'+get.translation(result.control)); game.log(player,'牺牲了'+get.translation(result.control));
player.storage.soldier.remove(result.control); player.storage.soldier.remove(result.control);
player.removeSkill(result.control); player.removeSkill(result.control);

View File

@ -1638,7 +1638,7 @@
this.innerHTML='已隐藏'; this.innerHTML='已隐藏';
game.saveConfig('hiddenModePack',['stone','chess','boss','tafang']); game.saveConfig('hiddenModePack',['stone','chess','boss','tafang']);
game.saveConfig('hiddenCardPack',['zhenfa','yunchou','swd','shenqi','hearth']); game.saveConfig('hiddenCardPack',['zhenfa','yunchou','swd','shenqi','hearth']);
game.saveConfig('hiddenCharacterPack',['diy','yxs','hearth','swd','gujian','xianjian','xiake','boss','ow']); game.saveConfig('hiddenCharacterPack',['diy','yxs','hearth','swd','gujian','xianjian','boss','ow']);
var that=this; var that=this;
setTimeout(function(){ setTimeout(function(){
that.innerHTML='隐藏非官方扩展包'; that.innerHTML='隐藏非官方扩展包';
@ -2747,15 +2747,29 @@
update:function(config,map){ update:function(config,map){
if(config.versus_mode=='four'){ if(config.versus_mode=='four'){
map.change_choice.hide(); map.change_choice.hide();
map.enable_all.show(); map.ladder.show();
map.four_assign.show(); if(config.ladder){
map.four_cross.show(); map.ladder_monthly.show();
map.ladder_reset.show();
}
else{
map.ladder_monthly.hide();
map.ladder_reset.hide();
}
map.enable_all.show();
map.four_assign.show();
map.expand_dialog.show();
// map.four_cross.show();
} }
else{ else{
map.change_choice.show(); map.change_choice.show();
map.ladder.hide();
map.ladder_monthly.hide();
map.ladder_reset.hide();
map.enable_all.hide(); map.enable_all.hide();
map.four_assign.hide(); map.four_assign.hide();
map.four_cross.hide(); map.expand_dialog.show();
// map.four_cross.hide();
} }
if(config.versus_mode=='jiange'||config.versus_mode=='two'){ if(config.versus_mode=='jiange'||config.versus_mode=='two'){
map.free_choose.show(); map.free_choose.show();
@ -2792,6 +2806,17 @@
restart:true, restart:true,
frequent:true, frequent:true,
}, },
ladder:{
name:'天梯模式',
init:true,
frequent:true,
restart:true
},
ladder_monthly:{
name:'每月重置天梯',
init:true,
frequent:true,
},
enable_all:{ enable_all:{
name:'启用全部武将', name:'启用全部武将',
init:false, init:false,
@ -2804,12 +2829,12 @@
frequent:true, frequent:true,
restart:true, restart:true,
}, },
four_cross:{ // four_cross:{
name:'交叉座位', // name:'交叉座位',
init:false, // init:false,
frequent:true, // frequent:true,
restart:true, // restart:true,
}, // },
free_choose:{ free_choose:{
name:'自由选将', name:'自由选将',
init:true, init:true,
@ -2869,6 +2894,10 @@
name:'替补模式', name:'替补模式',
init:false, init:false,
frequent:true, frequent:true,
},
expand_dialog:{
name:'默认展开选将框',
init:false,
}, },
ban_weak:{ ban_weak:{
name:'屏蔽弱将', name:'屏蔽弱将',
@ -2878,8 +2907,38 @@
ban_strong:{ ban_strong:{
name:'屏蔽强将', name:'屏蔽强将',
init:false, init:false,
restart:true, restart:true
}, },
ladder_reset:{
name:'重置天梯数据',
onclick:function(){
var node=this;
if(node._clearing){
game.save('ladder',{
current:900,
top:900,
month:(new Date()).getMonth()
});
ui.ladder.innerHTML='卫士五';
clearTimeout(node._clearing);
node.innerHTML='重置天梯数据';
delete node._clearing;
return;
}
node.innerHTML='单击以确认 (3)';
node._clearing=setTimeout(function(){
node.innerHTML='单击以确认 (2)';
node._clearing=setTimeout(function(){
node.innerHTML='单击以确认 (1)';
node._clearing=setTimeout(function(){
node.innerHTML='重置天梯数据';
delete node._clearing;
},1000);
},1000);
},1000);
},
clear:true,
},
} }
}, },
connect:{ connect:{
@ -4961,6 +5020,16 @@
window.lib=lib; window.lib=lib;
window._status=_status; window._status=_status;
}, },
p:function(name,i){
var target;
if(typeof i=='number'){
target=game.players[i];
}
else{
target=game.me.next;
}
target.init(name);
},
e:function(){ e:function(){
var cards=[],target; var cards=[],target;
for(var i=0;i<arguments.length;i++){ for(var i=0;i<arguments.length;i++){
@ -5329,7 +5398,8 @@
red:'红色', red:'红色',
black:'黑色', black:'黑色',
ok:"确定", ok:"确定",
cancel:"取消", cancel:"取消",
cancel2:"取消",
restart:"重新开始", restart:"重新开始",
setting:"设置", setting:"设置",
start:"开始", start:"开始",
@ -10985,7 +11055,12 @@
} }
else if(!nopop) this.popup(get.skillTranslation(name,this)); else if(!nopop) this.popup(get.skillTranslation(name,this));
if(typeof targets=='object'&&targets.length){ if(typeof targets=='object'&&targets.length){
game.log(this,'对',targets,'发动了','【'+get.skillTranslation(name,this)+'】'); var str='对<span class="bluetext">'+(targets[0]==this?'自己':get.translation(targets[0]));
for(var i=1;i<targets.length;i++){
str+='、'+(targets[i]==this?'自己':get.translation(targets[i]));
}
str+='</span>发动了【'+get.skillTranslation(name,this)+'】';
game.log(this,str);
} }
else{ else{
game.log(this,'发动了','【'+get.skillTranslation(name,this)+'】'); game.log(this,'发动了','【'+get.skillTranslation(name,this)+'】');
@ -18762,6 +18837,54 @@
} }
game.changeCoin(_status.coin); game.changeCoin(_status.coin);
} }
if(get.mode()=='versus'&&_status.ladder){
var mmr=_status.ladder_mmr;
mmr+=10-get.rank(game.me.name,true)*2;
if(result=='战斗胜利'){
mmr=20+Math.round(mmr);
if(mmr>40){
mmr=40;
}
else if(mmr<10){
mmr=10;
}
dialog.add(ui.create.div('','获得'+mmr+'积分'));
}
else{
mmr=-30+Math.round(mmr/2);
if(mmr>-20){
mmr=-20;
}
else if(mmr<-35){
mmr=-35;
}
if(lib.storage.ladder.current<900){
mmr=Math.round(mmr/4);
}
else if(lib.storage.ladder.current<1400){
mmr=Math.round(mmr/2);
}
else if(lib.storage.ladder.current<2000){
mmr=Math.round(mmr/1.5);
}
else if(lib.storage.ladder.current>2500){
mmr=Math.round(mmr*1.5);
}
dialog.add(ui.create.div('','失去'+(-mmr)+'积分'));
}
if(_status.ladder_tmp){
lib.storage.ladder.current+=40;
delete _status.ladder_tmp;
}
lib.storage.ladder.current+=mmr;
if(lib.storage.ladder.top<lib.storage.ladder.current){
lib.storage.ladder.top=lib.storage.ladder.current;
}
game.save('ladder',lib.storage.ladder);
if(ui.ladder&&game.getLadderName){
ui.ladder.innerHTML=game.getLadderName(lib.storage.ladder.current);
}
}
if(true){ if(true){
if(game.players.length){ if(game.players.length){
table=document.createElement('table'); table=document.createElement('table');
@ -21203,8 +21326,10 @@
else if(config.input){ else if(config.input){
node.classList.add('switcher'); node.classList.add('switcher');
var input=ui.create.div(node); var input=ui.create.div(node);
input.contentEditable=true; if(!config.fixed){
input.style.webkitUserSelect='text'; input.contentEditable=true;
input.style.webkitUserSelect='text';
}
input.style.minWidth='10px'; input.style.minWidth='10px';
input.onkeydown=function(e){ input.onkeydown=function(e){
if(e.keyCode==13){ if(e.keyCode==13){
@ -21676,7 +21801,7 @@
morenodes._onclick.call(morenodes,'unexpand'); morenodes._onclick.call(morenodes,'unexpand');
} }
} }
}); },{passive:true});
} }
}()); }());
@ -31708,8 +31833,13 @@
if(rank.bm.contains(name)) return num?Math.round(2*(num-1)/8+1):'bm'; if(rank.bm.contains(name)) return num?Math.round(2*(num-1)/8+1):'bm';
if(rank.c.contains(name)) return num?Math.round(1*(num-1)/8+1):'c'; if(rank.c.contains(name)) return num?Math.round(1*(num-1)/8+1):'c';
if(rank.d.contains(name)) return num?Math.round(0*(num-1)/8+1):'d'; if(rank.d.contains(name)) return num?Math.round(0*(num-1)/8+1):'d';
if(lib.customCharacters.contains(name)) return num?Math.round(8*(num-1)/8+1):'s'; if(lib.character[name]&&lib.character[name][4]){
if(lib.characterPack.boss&&lib.characterPack.boss[name]) return num?Math.round(9*(num-1)/8+1):'sp'; if(lib.character[name][4].contains('boss')||
lib.character[name][4].contains('bossallowed')||
lib.character[name][4].contains('hiddenboss')){
return num?Math.round(9*(num-1)/8+1):'sp';
}
}
return num?1:'x'; return num?1:'x';
}, },
targetsInfo:function(targets){ targetsInfo:function(targets){

View File

@ -13,7 +13,7 @@ character.pack={
swd:'轩辕剑', swd:'轩辕剑',
gujian:'古剑奇谭', gujian:'古剑奇谭',
xianjian:'仙剑', xianjian:'仙剑',
xiake:'侠客', // xiake:'侠客',
}; };
character.hearthpack={ character.hearthpack={
classic:'经典', classic:'经典',

View File

@ -16,7 +16,7 @@ window.noname_source_list=[
'character/gujian.js', 'character/gujian.js',
'character/guozhan.js', 'character/guozhan.js',
'character/hearth.js', 'character/hearth.js',
'character/jiange.js', // 'character/jiange.js',
'character/ow.js', 'character/ow.js',
'character/rank.js', 'character/rank.js',
'character/refresh.js', 'character/refresh.js',
@ -24,7 +24,7 @@ window.noname_source_list=[
'character/sp.js', 'character/sp.js',
'character/standard.js', 'character/standard.js',
'character/swd.js', 'character/swd.js',
'character/xiake.js', // 'character/xiake.js',
'character/xianjian.js', 'character/xianjian.js',
'character/yijiang.js', 'character/yijiang.js',
'character/yxs.js', 'character/yxs.js',

View File

@ -1,7 +1,8 @@
window.noname_update={ window.noname_update={
version:'1.9.4', version:'1.9.4',
changeLog:[ changeLog:[
'新武将', '武将修改',
'4v4改进',
], ],
files:{ files:{
global:[ global:[

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -80,23 +80,43 @@ mode.versus={
} }
} }
else if(_status.mode=='four'){ else if(_status.mode=='four'){
var list=['zhong','ezhong','zhong','ezhong','zhong','ezhong','zhong','ezhong']; var list=[
list[2*Math.floor(Math.random()*4)]='zhu'; ['zhong','ezhong','ezhong','zhong','zhong','ezhong','ezhong','zhong'],
list[2*Math.floor(Math.random()*4)+1]='ezhu'; ['zhong','ezhong','zhong','ezhong','ezhong','zhong','ezhong','zhong'],
if(!get.config('four_cross')){ ['zhong','ezhong','ezhong','zhong','ezhong','zhong','zhong','ezhong'],
list.randomSort(); ['zhong','ezhong','zhong','ezhong','zhong','ezhong','zhong','ezhong'],
['zhong','ezhong','ezhong','zhong','ezhong','zhong','ezhong','zhong'],
].randomGet();
var rand1=Math.floor(Math.random()*4);
var rand2=Math.floor(Math.random()*4);
for(var i=0;i<list.length;i++){
if(list[i]=='zhong'){
if(rand1==0){
list[i]='zhu';
}
rand1--;
}
else{
if(rand2==0){
list[i]='ezhu';
}
rand2--;
}
} }
else{
for(var i in lib.skill){ for(var i in lib.skill){
if(lib.skill[i].changeSeat){ if(lib.skill[i].changeSeat){
lib.skill[i]={}; lib.skill[i]={};
if(lib.translate[i+'_info']){ if(lib.translate[i+'_info']){
lib.translate[i+'_info']='此模式下不可用'; lib.translate[i+'_info']='此模式下不可用';
}
} }
} }
} }
var side=Math.random()<0.5; var side=Math.random()<0.5;
var num=Math.floor(Math.random()*8);
list=list.splice(8-num).concat(list);
_status.firstAct=game.players[num];
for(var i=0;i<8;i++){ for(var i=0;i<8;i++){
if(list[i][0]=='e'){ if(list[i][0]=='e'){
game.players[i].side=side; game.players[i].side=side;
@ -334,9 +354,35 @@ mode.versus={
} }
game.me.directgain(get.cards(hs.length)); game.me.directgain(get.cards(hs.length));
} }
if(_status.ladder){
lib.storage.ladder.current-=40;
_status.ladder_tmp=true;
game.save('ladder',lib.storage.ladder);
game.addGlobalSkill('versus_ladder');
}
game.phaseLoop(_status.firstAct); game.phaseLoop(_status.firstAct);
}, },
game:{ game:{
getLadderName:function(score){
if(score<900) return '平民';
if(score<1000) return '卫士五';
if(score<1100) return '卫士四';
if(score<1200) return '卫士三';
if(score<1300) return '卫士二';
if(score<1400) return '卫士一';
if(score<1500) return '校尉三';
if(score<1600) return '校尉二';
if(score<1700) return '校尉一';
if(score<1800) return '中郎将三';
if(score<1900) return '中郎将二';
if(score<2000) return '中郎将一';
if(score<2100) return '大将五';
if(score<2200) return '大将四';
if(score<2300) return '大将三';
if(score<2400) return '大将二';
if(score<2500) return '大将一';
return '枭雄';
},
checkOnlineResult:function(player){ checkOnlineResult:function(player){
return game.players[0].side==player.side; return game.players[0].side==player.side;
}, },
@ -842,18 +888,7 @@ mode.versus={
event.list=[]; event.list=[];
event.filterChoice=function(name){ event.filterChoice=function(name){
if(get.config('enable_all')) return false; if(get.config('enable_all')) return false;
if(lib.banFour.contains(name)){ return !lib.choiceFour.contains(name);
return true;
}
if(lib.characterPack.refresh[name]) return false;
if(lib.characterPack.standard[name]){
if(lib.characterPack.refresh['re_'+name]) return true;
return false;
}
if(lib.characterPack.shenhua[name]) return false;
if(lib.characterPack.sp[name]) return false;
if(lib.characterPack.yijiang[name]) return false;
return true;
} }
for(i in lib.character){ for(i in lib.character){
if(event.filterChoice(i)) continue; if(event.filterChoice(i)) continue;
@ -868,13 +903,46 @@ mode.versus={
} }
event.list.randomSort(); event.list.randomSort();
event.list2=list2; event.list2=list2;
event.current=game.players.randomGet(); event.current=_status.firstAct;
_status.firstAct=event.current;
event.four_assign=get.config('four_assign'); event.four_assign=get.config('four_assign');
event.flipassign=true; event.flipassign=true;
if(get.config('ladder')){
var date=new Date();
if(!lib.storage.ladder){
lib.storage.ladder={
current:900,
top:900,
month:date.getMonth()
};
game.save('ladder',lib.storage.ladder);
}
else if(date.getMonth()!=lib.storage.ladder.month&&get.config('ladder_monthly')){
lib.storage.ladder.month=date.getMonth();
lib.storage.ladder.current=900;
game.save('ladder',lib.storage.ladder);
}
ui.ladder=ui.create.system(game.getLadderName(lib.storage.ladder.current),null,true);
lib.setPopped(ui.ladder,function(uiintro){
var uiintro=ui.create.dialog('hidden');
uiintro.add('<div class="text center">当前分数:<div style="width:40px;text-align:left;font-family:xinwei">'+(lib.storage.ladder.current+(_status.ladder_tmp?40:0))+'</div></div>');
uiintro.add('<div class="text center">历史最高:<div style="width:40px;text-align:left;font-family:xinwei">'+lib.storage.ladder.top+'</div></div>');
uiintro.content.lastChild.style.paddingBottom='8px';
return uiintro;
},180);
_status.ladder=true;
_status.ladder_mmr=0;
}
"step 1" "step 1"
if(event.current==game.me||(event.four_assign&&event.current.side==game.me.side)){ if(event.current==game.me||(event.four_assign&&event.current.side==game.me.side)){
var dialog=event.xdialog||ui.create.characterDialog(event.filterChoice,'expandall'); var dialog=event.xdialog;
if(!dialog){
if(get.config('expand_dialog')){
dialog=event.xdialog||ui.create.characterDialog(event.filterChoice,'expandall');
}
else{
dialog=event.xdialog||ui.create.characterDialog(event.filterChoice);
}
}
var names=[]; var names=[];
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i].name){ if(game.players[i].name){
@ -1505,7 +1573,7 @@ mode.versus={
} }
var filterChoice=function(name){ var filterChoice=function(name){
if(name=='zuoci') return true; if(name=='zuoci') return true;
if(lib.banFour.contains(name)){ if(!lib.choiceFour.contains(name)){
return true; return true;
} }
if(lib.characterPack.refresh&&lib.characterPack.refresh[name]){ if(lib.characterPack.refresh&&lib.characterPack.refresh[name]){
@ -2413,16 +2481,21 @@ mode.versus={
boss_lieshiyazi:['male','wei',4,['boss_jiguan','boss_nailuo'],['jiangemech','hiddenboss','bossallowed'],'wei'], boss_lieshiyazi:['male','wei',4,['boss_jiguan','boss_nailuo'],['jiangemech','hiddenboss','bossallowed'],'wei'],
} }
}, },
banFour:[ choiceFour:[
'yuanshu','re_yuanshu','zhangxingcai','hetaiyou','wenpin','yuji', 'sunquan','re_ganning','re_lvmeng','re_zhouyu','re_luxun','sunshangxiang',
'lusu','guanping','zhangzong','zhoutai','sp_zhangjiao','zhangjiao', 're_liubei','re_guanyu','re_zhangfei','zhugeliang','re_zhaoyun','re_machao','huangyueying','re_xushu',
'shixie','zhanglu','chenlin','mayunlu','yangxiu','zhugeke','chengyu', 're_caocao','re_simayi','re_zhangliao','re_xuzhu','re_guojia','zhenji','re_lidian',
'zhangbao','zhangliang','sunhao','wutugu','zhugeguo','liuzan','lingcao', 're_lvbu','diaochan','re_huatuo',
'sunru','lingju','lifeng','hanba','sunluyu','zhuling','daxiaoqiao', 'xiahouyuan','huangzhong','xiaoqiao',
'sp_zhaoyun','sp_diaochan','sp_pangtong','sp_caoren','sp_daqiao', 'dianwei','pangtong','sp_zhugeliang','taishici','pangde','yanwen',
'sp_ganning','sp_zhangfei','sp_xiahoudun', 'xuhuang','sunjian','jiaxu','dongzhuo',
'zuoci','yuanshao','caopi','zhangzhang', 'zhanghe','dengai','jiangwei','liushan','sunce',
'huaxiong','guanzhang','liuxie','fuwan','sp_sunshangxiang','hanhaoshihuan', 'caozhi','zhangchunhua','masu','fazheng','xushu','lingtong','wuguotai','xusheng','chengong','gaoshun',
'xunyou','wangyi','zhonghui','madai','liaohua','chengpu','handang','bulianshi',
'jianyong','panzhangmazhong','yufan','liru','fuhuanghou',
'caozhen','chenqun','hanhaoshihuan','wuyi','zhoucang','guyong','sunluban','jushou','caifuren',
'caoxiu','liuchen','gongsunyuan',
'guohuanghou','liyan','cenhun','liuyu'
], ],
translate:{ translate:{
zhu:'主', zhu:'主',
@ -3505,6 +3578,86 @@ mode.versus={
} }
}, },
}, },
versus_ladder:{
trigger:{global:['damageEnd','recoverEnd','dieEnd','gainEnd','phaseDiscardEnd']},
forced:true,
popup:false,
silent:true,
filter:function(event,player){
if(!_status.ladder) return false;
if(event._ladder_mmr_counted) return false;
return event.source==game.me||event.player==game.me;
},
content:function(){
switch(event.triggername){
case 'damageEnd':{
if(trigger.source.side!=trigger.player.side){
if(trigger.source==game.me){
_status.ladder_mmr+=0.5*Math.max(1,trigger.num);
}
else{
_status.ladder_mmr+=0.2*Math.max(1,trigger.num);
}
}
break;
}
case 'recoverEnd':{
if(trigger.source!=trigger.player){
if(trigger.source==game.me){
if(trigger.player.side==game.me.side){
_status.ladder_mmr+=0.5*trigger.num;
}
else{
_status.ladder_mmr-=0.3*trigger.num;
}
}
}
else{
_status.ladder_mmr+=0.3*trigger.num;
}
break;
}
case 'dieEnd':{
if(trigger.source==game.me&&trigger.player.side!=game.me.side){
_status.ladder_mmr+=2;
}
break;
}
case 'gainEnd':{
if(trigger.cards&&trigger.cards.length){
if(trigger.source==game.me&&trigger.player!=game.me){
if(trigger.player.side==game.me.side){
_status.ladder_mmr+=0.3*trigger.cards.length;
}
else{
_status.ladder_mmr-=0.1*trigger.cards.length;
}
}
else{
if(trigger.source){
if(trigger.source.side!=game.me.side){
_status.ladder_mmr+=0.3*trigger.cards.length;
}
}
else{
_status.ladder_mmr+=0.1*trigger.cards.length;
}
}
}
break;
}
case 'phaseDiscardEnd':{
if(trigger.player==player){
if(trigger.cards&&trigger.cards.length){
_status.ladder_mmr-=0.2*trigger.cards.length;
}
}
break;
}
}
trigger._ladder_mmr_counted=true;
}
}
}, },
element:{ element:{
content:{ content:{