From 7ce14447ed73e74858589c6c697d384380752f4b Mon Sep 17 00:00:00 2001 From: libccy Date: Sun, 10 May 2015 13:34:37 +0800 Subject: [PATCH] x --- card/swd.js | 2 +- character/extra.js | 75 +---------- character/swd.js | 26 +++- character/xianjian.js | 2 +- character/yijiang.js | 1 + game/game.js | 15 ++- layout/mode/chess.css | 1 + mode/chess.js | 286 ++++++++++++++++++++++++++++++++++++------ 8 files changed, 291 insertions(+), 117 deletions(-) diff --git a/card/swd.js b/card/swd.js index cfdf1b46c..9151644a2 100644 --- a/card/swd.js +++ b/card/swd.js @@ -546,7 +546,7 @@ card.swd={ skills:['sadengjinhuan'], ai:{ basic:{ - equipValue:6 + equipValue:5.5 } }, }, diff --git a/character/extra.js b/character/extra.js index 0f42b786b..dc2d3b989 100644 --- a/character/extra.js +++ b/character/extra.js @@ -4,7 +4,7 @@ character.extra={ shen_zhaoyun:['male','shu',2,['juejing','longhun'],['fullskin'],['fullskin']], shen_zhugeliang:['male','shu',3,['qixing','kuangfeng','dawu'],['fullskin']], shen_lvmeng:['male','wu',3,['shelie','gongxin'],['fullskin']], - shen_zhouyu:['male','wu',4,['yeyan','swdqinyin'],['fullskin']], + shen_zhouyu:['male','wu',4,['yeyan','qinyin'],['fullskin']], shen_simayi:['male','wei',4,['renjie','sbaiyin','lianpo'],['fullskin']], shen_caocao:['male','wei',3,['guixin','feiying'],['fullskin']], shen_lvbu:['male','qun',5,['baonu','wuqian','shenfen'],['fullskin']], @@ -755,75 +755,12 @@ character.extra={ } }, qinyin:{ - trigger:{player:'phaseEnd'}, - filter:function(event,player){ - return player.getStat('damage')>=2; - }, + inherit:'swdqinyin', + trigger:{player:'phaseDiscardEnd'}, direct:true, - content:function(){ - "step 0" - var recover=0,lose=0; - for(var i=0;i0){ - if(game.players[i].hp<2){ - lose--; - recover+=0.5; - } - lose--; - recover++; - } - else if(ai.get.attitude(player,game.players[i])<0){ - if(game.players[i].hp<2){ - lose++; - recover-=0.5; - } - lose++; - recover--; - } - } - else{ - if(ai.get.attitude(player,game.players[i])>0){ - lose--; - } - else if(ai.get.attitude(player,game.players[i])<0){ - lose++; - } - } - } - } - player.chooseControl('失去体力','回复体力','cancel').ai=function(){ - if(lose>recover&&lose>0) return 0; - if(lose0) return 1; - return 2; - } - "step 1" - if(result.bool==false||result.control=='cancel'){ - event.finish(); - } - else{ - player.logSkill('qinyin'); - event.bool=(result.control=='回复体力'); - event.num=0; - event.players=game.players.slice(0); - } - "step 2" - if(event.num1 }, - ai:{ - expose:0.1, - } }, longhun:{ group:['longhun1','longhun2','longhun3','longhun4'], @@ -1120,7 +1057,7 @@ character.extra={ shelie_info:'摸牌阶段,你可以放弃摸牌,改为从牌堆顶亮出五张牌,你获得不同花色的牌各一张,将其余的牌置入弃牌堆。', gongxin_info:'出牌阶段,你可以观看一名其他角色的手牌,并可以展示其中一张红桃牌,然后将其弃置或置于牌堆顶,每阶段限一次。', guixin_info:'每当你受到1次伤害后,若至少一名其他角色的区域里有牌,你可以选择所有其他角色,获得这些角色区域里的一张牌,然后将你的武将牌翻面。', - qinyin_info:'回合结束阶段,若你于回合造成了超过2点伤害,你可以选择一项:1.令所有角色各回复1点体力;2.令所有角色各失去1点体力。每阶段限一次。', + qinyin_info:'每当你于弃牌阶段内因你的弃置而失去第X张手牌时(X至少为2),你可以选择一项:1.令所有角色各回复1点体力;2.令所有角色各失去1点体力。每阶段限一次。', yeyan_info:'限定技,出牌阶段,你可以对一至三名角色造成至多共3点火焰伤害(你可以任意分配每名目标角色受到的伤害点数),若你将对一名角色分配2点或更多的火焰伤害,你须先弃置四张不同花色的手牌再失去3点体力。', qixing:'七星', qixing_bg:'星', diff --git a/character/swd.js b/character/swd.js index 99ce8303a..5ae11b7c7 100644 --- a/character/swd.js +++ b/character/swd.js @@ -2844,7 +2844,8 @@ character.swd={ } } } - player.chooseControl('失去体力','回复体力','cancel').ai=function(){ + player.chooseControl('失去体力','回复体力','cancel', + ui.create.dialog('是否发动【琴音】')).ai=function(){ // console.log(lose,recover); if(lose>recover&&lose>0) return 0; if(lose0) return 1; @@ -2855,7 +2856,7 @@ character.swd={ event.finish(); } else{ - player.logSkill('swdqinyin'); + player.logSkill(_status.event.name); event.bool=(result.control=='回复体力'); event.num=0; event.players=game.players.slice(0); @@ -5160,6 +5161,7 @@ character.swd={ return false; } }, + group:'tianshu_remove', createDialog:function(player,target,onlylist){ var names=[]; var list=[]; @@ -5205,6 +5207,9 @@ character.swd={ }, content:function(){ "step 0" + if(player.storage.tianshu){ + player.unmark(player.storage.tianshu+'_charactermark'); + } event.skillai=function(list){ return list.randomGet(); }; @@ -5220,9 +5225,6 @@ character.swd={ event._result=event.skillai(lib.skill.tianshu.createDialog(player,target,true)); } "step 1" - if(player.storage.tianshu){ - player.unmark(player.storage.tianshu+'_charactermark'); - } if(event.dialog){ event.dialog.close(); } @@ -5250,6 +5252,18 @@ character.swd={ } } }, + tianshu_remove:{ + trigger:{player:'phaseUseBegin'}, + forced:true, + popup:false, + content:function(){ + if(player.storage.tianshu){ + player.unmark(player.storage.tianshu+'_charactermark'); + delete player.storage.tianshu; + delete player.additionalSkills.tianshu; + } + } + }, tianshu_ai:{}, tianshu2:{ trigger:{player:'phaseBegin'}, @@ -7963,7 +7977,7 @@ character.swd={ tanlin_info:'出牌阶段限一次,你可以与一名其他角色进行拼点,若你赢,你获得双方拼点牌、对该角色使用卡牌无视距离且可以额外使用一张杀直到回合结束,若你没赢,你受到该角色的一点伤害。', pozhen_info:'每当你受到一次伤害,若你的手牌数大于伤害来源,你可以弃置X张手牌对其造成一点伤害;若你的手牌数小于伤害来源,你可以弃置其X张手牌。X为你与伤害来源的手牌数之差。', yunchou_info:'出牌阶段限一次,你可以弃置任意张手牌,并弃置一张其他角色的手牌,你弃置的手牌中每有一张与此牌的颜色相同,你摸一张牌,否则对方摸一张牌', - tianshu_info:'出牌阶段,你可以弃置一张锦囊牌,并获得场上一名存活角色的一项技能(再使用则会替换前一次获得的技能)', + tianshu_info:'出牌阶段,你可以弃置一张锦囊牌,并获得场上一名存活角色的一项技能直到你的下一回合开始(多次使用会替换前一次获得的技能)', luomei_info:'每当你使用或打出一张梅花花色的牌,你可以摸一张牌', xingdian_info:'出牌阶段限一次,你可以弃置一张手牌,然后指定至多两名角色令其各弃置一张牌', yulin_info:'每当你即将受到伤害,你可以弃置一张装备牌抵消此伤害', diff --git a/character/xianjian.js b/character/xianjian.js index c06807d94..e3e45eb3e 100644 --- a/character/xianjian.js +++ b/character/xianjian.js @@ -892,9 +892,9 @@ character.xianjian={ filter:function(event,player){ return _status.currentPhase!=player; }, + priority:101, content:function(){ var cards=[]; - // var max=player.hp<=2?3:2; var max=Math.min(ui.cardPile.childNodes.length,lib.skill.longxi.max); for(var i=0;i.card'+pos+ '{left:'+(22+i*148)+'px;top:'+(22+j*148)+'px}',0); - if(j==ui.chessheight-1){ - ui.chesssheet.sheet.insertRule('#arena.chess #chess>.popup'+pos+ - '{left:'+(19+i*148)+'px;top:'+(-19+j*148)+'px}',0); - } - else{ - ui.chesssheet.sheet.insertRule('#arena.chess #chess>.popup'+pos+ - '{left:'+(19+i*148)+'px;top:'+(142+j*148)+'px}',0); - } + ui.chesssheet.sheet.insertRule('#arena.chess #chess>.popup'+pos+ + '{left:'+(19+i*148)+'px;top:'+(142+j*148)+'px}',0); } } @@ -754,12 +770,9 @@ mode.chess={ for(var i=0;i7){ - game.players[i].popup('距离:'+dist,'thunder'); - } - else{ - game.players[i].popup('距离:'+dist); - } + var dist2=get.distance(game.me,game.players[i]); + var nature=dist>7?'thunder':''; + game.players[i].popup('距离:'+dist2+'/'+dist,nature); } } },true); @@ -786,6 +799,14 @@ mode.chess={ } }, setChessInfo:function(p){ + if(!p){ + if(ui.phasequeue&&ui.phasequeue.length){ + p=ui.phasequeue[0].link; + } + else{ + p=game.me; + } + } ui.chessinfo.innerHTML=''; ui.phasequeue=[]; for(var i=0;i0; + }, + check:function(event,player){ + var targets=lib.skill.guanchuan.getTargets(player,event.targets[0]); + var eff=0; + for(var i=0;i0; + }, + content:function(){ + var targets=lib.skill.guanchuan.getTargets(player,trigger.targets[0]); + for(var i=0;i1&&lib.filter.filterCard({name:'sha'},player); + }, + filterCard:{name:'sha'}, + selectCard:2, + check:function(card){ + var num=0; + var player=_status.event.player; + for(var i=0;i0){ + num++; + if(num>1) return 8-ai.get.value(card); + } + } + return 0; + }, + selectTarget:[1,Infinity], + discard:false, + prepare:function(cards,player,targets){ + player.$throw(cards); + player.line(targets); + }, + filterTarget:function(card,player,target){ + return lib.filter.targetEnabled({name:'sha'},player,target)&& + get.distance(player,target,'pure')<=5; + }, + content:function(){ + targets.sort(lib.sort.seat); + player.useCard({name:'sha'},cards,targets,'luanjian').animate=false; + }, + multitarget:true, + ai:{ + order:function(){ + return lib.card.sha.ai.order+0.1; + }, + result:{ + target:function(player,target){ + var added=false; + if(!player.skills.contains('unequip')){ + added=true; + player.skills.push('unequip'); + } + var eff=ai.get.effect(target,{name:'sha'},player,target); + if(added){ + player.skills.remove('unequip'); + } + return eff; + } + }, + effect:{ + player:function(card,player){ + if(_status.currentPhase!=player) return; + if(card.name=='sha'&&player.num('h','sha')<2&&player.num('h')<=player.hp){ + var num=0; + var player=_status.event.player; + for(var i=0;i1) return [0,0,0,0]; + } + } + } + } + }, + } + }, + zhiming:{ + trigger:{source:'damageBegin'}, + filter:function(event,player){ + return get.distance(event.player,player,'attack')>1; + }, + forced:true, + content:function(){ + trigger.num++; + } + }, + lianshe:{ + mod:{ + cardUsable:function(card,player,num){ + if(card.name=='sha'){ + return num+get.cardCount(true,player)-get.cardCount('sha',player); + } + }, + attackFrom:function(from,to,distance){ + return distance-1; + } + }, + }, + pianyi:{ + trigger:{player:'phaseEnd'}, + direct:true, + filter:function(event,player){ + return !player.getStat('damage'); + }, + content:function(){ + "step 0" + player.chooseToMove(1,'是否发动【翩仪】?'); + "step 1" + if(result.bool){ + player.logSkill('pianyi'); + } + } + }, + lingdong:{ + trigger:{player:'phaseEnd'}, + direct:true, + filter:function(event,player){ + return get.cardCount('sha',player)>0; + }, + content:function(){ + "step 0" + player.chooseToMove(get.cardCount('sha',player),'是否发动【灵动】?'); + "step 1" + if(result.bool){ + player.logSkill('pianyi'); + } + } + }, _noactpunish:{ trigger:{player:'useCard'}, filter:function(event,player){ @@ -969,11 +1161,14 @@ mode.chess={ usable:1, direct:true, delay:false, + preservecancel:true, content:function(){ "step 0" - player.chooseToMove(player.skills.contains('noactpunish')?2:1); + var move=player.skills.contains('noactpunish')?2:1; + move=game.checkMod(player,move,'chessMove',player.get('s')); + player.chooseToMove(move).phasing=true; "step 1" - if(result=='cancelled'){ + if(!result.bool){ player.getStat().skill._chessmove--; } }, @@ -1021,7 +1216,7 @@ mode.chess={ popup:false, filter:function(event,player){ if(event.autochoose&&event.autochoose()) return false; - return !_status.auto&&player.isUnderControl(); + return player.isUnderControl(); }, content:function(){ game.modeSwapPlayer(player); @@ -1046,6 +1241,7 @@ mode.chess={ _chessmove:'移动', chessscroll_speed_config:'边缘滚动速度', chess_character_config:'战棋武将', + only_chess_character_config:'只用战棋武将', chess_caocao:'曹操', chess_xunyu:'荀彧', @@ -1085,6 +1281,19 @@ mode.chess={ chess_jinchidiao:'金翅雕', chess_beimingjukun:'北溟巨鲲', chess_wuzhaojinlong:'五爪金龙', + + pianyi:'翩仪', + pianyi_info:'回合结束阶段,若你没有于本回合内造成伤害,你获得一次移动机会', + lingdong:'灵动', + lingdong_info:'回合结束阶段,你可以移动X个格,X为你回合内出杀的次数', + lianshe:'连射', + lianshe_info:'你的攻击范围+1;回合内,你回合内,每当你使用一张不是杀的牌,你可以额外使用一张杀', + zhiming:'致命', + zhiming_info:'锁定技,当你使用杀造成伤害时,若你不在目标的攻击范围内,此伤害+1', + sanjiansheji:'散箭', + sanjiansheji_info:'你可以将两张杀当杀使用,此杀可以指定距离你5格以内任意名目标', + guanchuan:'贯穿', + guanchuan_info:'当你使用杀指定惟一的目标后,可将攻击射线内的其他角色也加入目标', }, ui:{ create:{ @@ -1113,6 +1322,10 @@ mode.chess={ ui.movegrids.shift().delete(); } } + _status.event.result={ + bool:true, + move:this.link.dataset.position + }; game.resume(); } } @@ -1131,7 +1344,7 @@ mode.chess={ // chess_xiahoudun:['male','wei',3,['']], // chess_dianwei:['male','wei',3,['']], // chess_xuzhu:['male','wei',3,['']], - // chess_zhangliao:['male','wei',3,['']], + chess_zhangliao:['male','wei',4,['gongji','zhiming']], // chess_jiaxu:['male','wei',3,['']], // // chess_liubei:['male','shu',3,['']], @@ -1139,27 +1352,28 @@ mode.chess={ // chess_zhangfei:['male','shu',3,['']], // chess_zhaoyun:['male','shu',3,['']], // chess_machao:['male','shu',3,['']], - // chess_huangzhong:['male','shu',3,['']], + chess_huangzhong:['male','shu',4,['sanjiansheji','liegong']], // chess_maliang:['male','shu',3,['']], // chess_zhugeliang:['male','shu',3,['']], // // chess_sunquan:['male','wu',3,['']], - // chess_zhouyu:['male','wu',3,['']], + // chess_zhouyu:['male','wu',3,['qinyin']], // chess_lvmeng:['male','wu',3,['']], // chess_huanggai:['male','wu',3,['']], // chess_lusu:['male','wu',3,['']], // chess_luxun:['male','wu',3,['']], // chess_ganning:['male','wu',3,['']], - // chess_taishici:['male','wu',3,['']], + chess_taishici:['male','wu',4,['guanchuan','pojun']], // // chess_lvbu:['male','qun',3,['']], - // chess_sunshangxiang:['male','qun',3,['']], - // chess_diaochan:['male','qun',3,['']], - // chess_huatuo:['male','qun',3,['']], + chess_sunshangxiang:['female','wu',3,['lingdong','lianshe']], + chess_diaochan:['female','qun',3,['xingzhui','pianyi']], + chess_huatuo:['male','qun',3,['zhenjiu','mazui']], // chess_zhangjiao:['male','qun',3,['']], // chess_menghuo:['male','qun',3,['']], // // chess_dongzhuo:['male','qun',3,['']], + // chess_xingtian:['male','qun',3,['']], // chess_jinchidiao:['male','qun',3,['']], // chess_beimingjukun:['male','qun',3,['']], // chess_wuzhaojinlong:['male','qun',3,['']], @@ -1173,18 +1387,18 @@ mode.chess={ }, config:['battle_number','ban_weak','free_choose','change_choice', function(lib,get,ui){ - var current=get.config('chessscroll_speed'); - if(typeof current!=='number'){ - game.saveConfig('chessscroll_speed',20,true); - current=20; - } - return ui.create.switcher('chessscroll_speed',[0,10,20,30],current,ui.click.sidebar.local); - },function(lib,get,ui){ var current=get.config('chess_character'); if(typeof current!=='boolean'){ game.saveConfig('chess_character',true); current=true; } return ui.create.switcher('chess_character',current,ui.click.sidebar.local2); + },function(lib,get,ui){ + var current=get.config('chessscroll_speed'); + if(typeof current!=='number'){ + game.saveConfig('chessscroll_speed',20,true); + current=20; + } + return ui.create.switcher('chessscroll_speed',[0,10,20,30],current,ui.click.sidebar.local); }], }