千 里 单 机

This commit is contained in:
Spmario233 2020-08-11 21:05:00 +08:00 committed by GitHub
parent 82cede0f0d
commit ef51702769
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 3062 additions and 2477 deletions

View File

@ -870,13 +870,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
return 0;
},
result:{
player:function(player,target){
return game.countPlayer(function(current){
if(current==target||(get.distance(target,current,'pure')==1&&current.countCards('he'))){
return -get.sgn(get.attitude(player,current));
}
});
}
target:-1,
}
}
},
@ -933,13 +927,17 @@ game.import('card',function(lib,game,ui,get,ai,_status){
multineg:1,
},
result:{
player:function(player,target){
return game.countPlayer(function(current){
if(current==target||(get.distance(target,current,'pure')==1)){
return get.sgn(get.effect(current,{name:'chiyuxi'},player,player));
}
});
}
target:function(player,target){
if(target.hasSkillTag('nofire')) return 0;
if(player.hasUnknown(2)) return 0;
var nh=target.countCards('h');
if(lib.config.mode=='identity'){
if(target.isZhu&&nh<=2&&target.hp<=1) return -100;
}
if(nh==0) return -2;
if(nh==1) return -1.7
return -1.5;
},
}
}
},

View File

@ -280,27 +280,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){
return 0;
},
result:{
player:function(player,target){
if(get.mode()=='versus') return game.countPlayer(function(current){
if(target.isFriendOf(current)){
if(current.isFriendOf(player)&&current.isLinked()){
return get.attitude(player,target);
}
else if(current.isEnemyOf(player)&&!current.isLinked()){
return -get.attitude(player,target)*0.6;
}
}
});
return game.countPlayer(function(current){
if(target.isMajor()==current.isMajor()){
if(current.isLinked()){
return get.attitude(player,target);
}
else{
return -get.attitude(player,target)*0.8;
}
}
});
target:function(player,target){
if(get.mode()=='versus'){
if(target.isFriendOf(player)) return target.isLinked()?1:0;
return target.isLinked()?0:-1;
}
return target.isLinked()?1:-1;
}
}
}
@ -390,8 +375,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){
value:4,
useful:2,
result:{
player:1.5,
target:1,
target:function(player,target){
if(player==target) return 2;
return 1;
},
},
},
},

File diff suppressed because it is too large Load Diff

View File

@ -677,7 +677,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
list:[
['spade',1,'caomu'],
['club',3,'caomu'],
['heart',12,'shengdong',],
['heart',12,'shengdong'],
['club',9,'shengdong'],
['spade',9,'shengdong'],
['diamond',4,'zengbin'],
@ -695,7 +695,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
["club",13,'jinchan'],
["club",12,'qijia'],
["club",13,'qijia'],
["spade",1,'fulei','thunder'],
["spade",1,'fulei'],
["spade",6,'qibaodao'],
["spade",5,'zhungangshuo'],
["spade",2,'lanyinjia'],

View File

@ -278,7 +278,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
result:{
target:function(player,target){
// if(player==target&&player.hp<=0) return 2;
if(player.hasSkillTag('nokeep')) return 2;
if(player.hasSkillTag('nokeep',true,null,true)) return 2;
var nd=player.needsToDiscard();
var keep=false;
if(nd<=0){

View File

@ -3145,14 +3145,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
mod:{
cardUsable:function (card,player,num){
if(player.hasMark('drlt_jieying_mark')&&game.hasPlayer(function(current){
if(player.hasMark('drlt_jieying_mark')&&card.name=='sha') return num+game.countPlayer(function(current){
return current.hasSkill('drlt_jieying');
})&&card.name=='sha') return num+1;
});
},
maxHandcard:function (player,num){
if(player.hasMark('drlt_jieying_mark')&&game.hasPlayer(function(current){
if(player.hasMark('drlt_jieying_mark')) return num+game.countPlayer(function(current){
return current.hasSkill('drlt_jieying');
})) return num+1;
});
},
},
audio:'drlt_jieying',
@ -3166,12 +3166,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
});
},
content:function(){
trigger.num++;
trigger.num+=game.countPlayer(function(current){
return current.hasSkill('drlt_jieying');
});
},
ai:{
nokeep:true,
skillTagFilter:function(player){
return player.hasMark('drlt_jieying_mark');
if(!player.hasMark('drlt_jieying_mark')) return false;
},
},
},
@ -3225,8 +3227,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var target=result.targets[0];
player.line(target);
player.logSkill('drlt_jieying',target);
player.removeMark('drlt_jieying_mark',1);
target.addMark('drlt_jieying_mark',1);
var mark=player.countMark('drlt_jieying_mark');
player.removeMark('drlt_jieying_mark',mark);
target.addMark('drlt_jieying_mark',mark);
};
},
},
@ -3244,7 +3247,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(trigger.player.countCards('h')>0){
trigger.player.give(trigger.player.getCards('h'),player);
}
trigger.player.removeMark('drlt_jieying_mark',1);
trigger.player.removeMark('drlt_jieying_mark',trigger.player.countMark('drlt_jieying_mark'));
},
},
},

View File

@ -4095,9 +4095,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
//audio:'kuangcai',
silent:true,
popup:false,
usable:5,
//usable:5,
filter:function(event,player){
if(!player.forceCountChoose){
if(!player.forceCountChoose||!player.forceCountChoose.phaseUse){
return false;
}
return true;
@ -4129,7 +4129,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
//ui.auto.show();
player.removeSkill('kuangcai_use');
player.removeSkill('kuangcai_cancel');
if(player.storage.counttrigger) delete player.storage.counttrigger.kuangcai_use;
}
}
},
@ -4779,7 +4778,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(!['basic','trick'].contains(get.type(event.card))) return false;
return player.getHistory('useCard',function(ev){
return ev.getParent('phaseUse')==evt&&get.tag(ev.card,'damage')&&['basic','trick'].contains(get.type(ev.card));
}).indexOf(event)==0;
}).indexOf(event)==0&&game.hasPlayer(function(current){
return current!=player&&!current.storage.weifeng2&&event.targets.contains(current);
});
},
content:function(){
'step 0'

View File

@ -20,7 +20,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
sp_guozhan2:["mifuren","mateng","tianfeng","chendong","sp_dongzhuo","jiangfei","jiangqing","kongrong","bianfuren","liqueguosi","lvfan","cuimao","jiling","zhangren","zoushi"],
sp_guandu:["sp_zhanghe","xunchen","sp_shenpei","gaolan","lvkuanglvxiang","chunyuqiong","sp_xuyou"],
sp_single:["hejin","hansui","niujin"],
sp_others:["hanba"],
sp_others:["hanba","caiyang"],
},
},
characterFilter:{
@ -32,6 +32,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
},
character:{
caiyang:['male','qun',1,['yinka'],['forbidai','unseen']],
sp_xuyou:['male','qun',3,['spshicai','spfushi']],
chunyuqiong:['male','qun',5,['cangchu','sushou','liangying']],
lvkuanglvxiang:['male','qun',4,['liehou','qigong']],
@ -199,6 +200,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
//kaisa:["male","western",4,["zhengfu"]],
},
characterIntro:{
caiyang:'蔡阳201年又作蔡扬东汉丞相曹操部下武将汝南太守。于建安六年201奉曹操之命攻击与刘备联合的汝南贼龚都等人兵败被刘备所杀。明代小说《三国演义》改编为“云长擂鼓斩蔡阳”。',
pujing:'湖北省当阳境内有一座山,名叫玉泉山。东汉建安末年,山上住着一个老和尚,法名普净,普净原来是沂水关镇国寺方丈,后因云游天下,来到此处,风这地方山明水秀,就于山中结草为庵,每天坐禅参道,身边只有一个小和尚,外出化一些斋饭,供养师父。在《三国演义》中,当关羽通过汜水关时,正是由于普净提醒,关羽才揭穿了卞喜的阴谋,并杀死了卞喜。关羽死后,其怨魂亦在普净的指点下醒悟,放下了心中的仇恨,专心致力于造福一方百姓。',
huban:'为《三国演义》所杜撰的人物,正史无记载,荥阳太守王植麾下从事、桓帝时议郎胡华之子。关羽过五关斩六将时其中一关就是王植所镇守,胡班奉命放火夜袭关公,因敬服公之气概,并得其父托公所带家书,班看毕,叹曰:“险些误杀忠良!”故将之放走。胡班到荆州来投降关公,公念其旧日相救之情,甚爱之;令随费诗入川,见汉中王受爵。费诗辞别关公,带了胡班,自回蜀中去了。',
chunyuqiong:'淳于琼200年字仲简颍川治今河南禹州人。东汉时期官吏于汉灵帝中平五年188被任命为西园八校尉之一的右校尉与蹇硕、袁绍、鲍鸿、曹操、赵融、冯芳、夏牟同列。为袁绍大将与张郃、高览等人齐名。在官渡之战时镇守乌巢遭到曹操的偷袭而惨败自己也被曹操处斩。',
lvkuanglvxiang:'吕旷(生卒年不详),与吕翔同是袁绍属下,袁绍去世后,为袁尚守东平,后来投降曹操,并被封为列侯。在《三国演义》中,在曹操准备往南准备攻击前,两人跟著大将曹仁和将军李典准备要攻击刘备。但吕旷被赵云刺下马身亡,而吕翔也死于张飞矛下,可以算是出师未捷身先死',
caobuxing:'曹不兴亦名弗兴三国时著名画家。孙吴吴兴今浙江湖州生卒年不详。他在黄武年间222—229年享有很大的声誉。被称为“佛画之祖”。与东晋顾恺之、南朝宋陆探微、南朝梁张僧繇并称“六朝四大家”。又与赵达的算术、严武的弈棋、皇象的草书等号称“吴中八绝”。曹不兴善画龙、虎、马及人物有“落墨为蝇”等传奇故事其佛画成就对后世影响很大相传其所画龙头令谢赫叹服不已。画迹今已不存据《贞观公私画史》载作品有《青溪龙》、《赤盘龙》、《南海监牧进十种马图》、《夷事夷兽样》、《桃源图》等惜早已散佚。 但之后的著名画家卫协直接师承其法。',
@ -529,6 +533,34 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
},
skill:{
//蔡阳
yinka:{
trigger:{player:['drawBegin','judgeBegin']},
direct:true,
filter:function(){
return ui.cardPile.childNodes.length>0;
},
content:function(){
'step 0'
player.chooseButton(['印卡:请选择要置于牌堆'+(trigger.bottom?'底':'顶')+'的牌(先选择的在上)',Array.from(ui.cardPile.childNodes)],[1,trigger.num||1]);
'step 1'
if(result.bool){
while(result.links.length){
if(trigger.bottom){
var card=result.links.shift();
ui.cardPile.removeChild(card);
ui.cardPile.appendChild(card);
}
else{
var card=result.links.pop();
ui.cardPile.removeChild(card);
ui.cardPile.insertBefore(card,ui.cardPile.firstChild)
}
}
}
},
ai:{isLuckyStar:true},
},
//吕旷吕翔和淳于琼和官渡哔哔机
spshicai:{
audio:2,
@ -16815,6 +16847,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:2,
trigger:{
global:"gameDrawAfter",
player:"enterGame",
},
forced:true,
filter:function (){
@ -19310,6 +19343,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
zezhu_info:'出牌阶段限一次,你可以获得双方主帅的各一张牌(若无牌则改为你摸一张牌),然后交给双方主帅各一张牌。',
chenggong:'逞功',
chenggong_info:'当有角色使用牌指定目标后若此牌对目标数大于1则你可令使用者摸一张牌。',
caiyang:'蔡阳',
yinka:'印卡',
sp_default:"常规",
sp_whlw:"文和乱武",

View File

@ -10426,6 +10426,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){
"step 0"
player.draw();
var cards=Array.from(ui.ordering.childNodes);
while(cards.length){
cards.shift().discard();
}
"step 1"
var evt=_status.event.getParent('phase');
if(evt){

View File

@ -1,5 +1,5 @@
window.noname_asset_list=[
'v1.9.100.7',
'v1.9.101',
'audio/background/aozhan_chaoming.mp3',
'audio/background/aozhan_online.mp3',
'audio/background/aozhan_rewrite.mp3',
@ -3189,6 +3189,9 @@ window.noname_asset_list=[
'image/character/yj_zhangliao.jpg',
'image/character/key_miki.jpg',
'image/character/key_shiki.jpg',
'image/character/caiyang.jpg',
'image/character/huban.jpg',
'image/character/pujing.jpg',
'image/character/baiwuchang.jpg',
'image/character/baosanniang.jpg',

View File

@ -6013,6 +6013,11 @@
init:true,
frequent:true
},
qianlidanji:{
name:'千里单骑',
init:true,
frequent:true
},
liangjunduilei:{
name:'两军对垒',
init:true,
@ -9883,7 +9888,7 @@
if(!_status.event.targets.contains(target)) return false;
return lib.filter[_status.event.nodistance?'targetEnabled':'filterTarget'].apply(this,arguments);
});
next.set('ai',event.ai||get.effect);
next.set('ai',event.ai||get.effect_use);
next.set('selectTarget',event.selectTarget||lib.filter.selectTarget);
if(event.nodistance) next.set('nodistance',true);
if(event.forced) next.set('forced',true);
@ -13677,39 +13682,48 @@
}
}
}
if(true){
var str='';
if(targets.length){
str+='对<span class="bluetext">'+(targets[0]==player?'自己':get.translation(targets[0]));
for(var i=1;i<targets.length;i++){
str+='、'+(targets[i]==player?'自己':get.translation(targets[i]));
}
str+='</span>'
}
str+='使用了';
if(targets.length){
var str=(targets.length==1&&targets[0]==player)?'#b自己':targets;
if(cards.length&&!card.isCard){
if(event.addedTarget){
game.log(player,str,card,'',cards,',指向',event.addedTargets,'');
game.log(player,'对',str,'使用了',card,'',cards,',指向',event.addedTargets,'');
}
else{
game.log(player,str,card,'',cards,'');
game.log(player,'对',str,'使用了',card,'',cards,'');
}
}
else{
if(event.addedTarget){
game.log(player,str,card,'(指向',event.addedTargets,'');
game.log(player,'对',str,'使用了',card,'(指向',event.addedTargets,'');
}
else{
game.log(player,str,card);
game.log(player,'对',str,'使用了',card);
}
}
if(card.name=='wuxie'){
game.logv(player,[card,cards],[event.getTrigger().card]);
}
else{
if(cards.length&&!card.isCard){
if(event.addedTarget){
game.log(player,'使用了',card,'',cards,',指向',event.addedTargets,'');
}
else{
game.log(player,'使用了',card,'',cards,'');
}
}
else{
game.logv(player,[card,cards],targets);
if(event.addedTarget){
game.log(player,'使用了',card,'(指向',event.addedTargets,'');
}
else{
game.log(player,'使用了',card);
}
}
}
if(card.name=='wuxie'){ game.logv(player,[card,cards],[event.getTrigger().card]);
}
else{
game.logv(player,[card,cards],targets);
}
event.trigger('useCard1');
"step 1"
event.trigger('useCard2');
@ -17360,7 +17374,7 @@
next.selectTarget=lib.filter.selectTarget;
}
if(next.ai1==undefined) next.ai1=get.order;
if(next.ai2==undefined) next.ai2=get.effect;
if(next.ai2==undefined) next.ai2=get.effect_use;
next.setContent('chooseToUse');
next._args=Array.from(arguments);
return next;
@ -19276,12 +19290,8 @@
if(lib.translate[name]){
this.trySkillAnimate(name,popname,checkShow);
if(typeof targets=='object'&&targets.length){
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>发动了';
game.log(this,str,'【'+get.skillTranslation(name,this)+'】');
var str=(targets[0]==this?'#b自己':targets);
game.log(this,'对',str,'发动了','【'+get.skillTranslation(name,this)+'】');
}
else{
game.log(this,'发动了','【'+get.skillTranslation(name,this)+'】');
@ -32551,24 +32561,16 @@
}
},
log:function(){
var str='',logvid=null;
var str='',str2='',logvid=null;
for(var i=0;i<arguments.length;i++){
var itemtype=get.itemtype(arguments[i]);
if(itemtype=='player'||itemtype=='players'){
if(lib.config.log_highlight){
str+='<span class="bluetext">'+get.translation(arguments[i])+'</span>';
}
else{
str+=get.translation(arguments[i]);
}
str+='<span class="bluetext">'+get.translation(arguments[i])+'</span>';
str2+=get.translation(arguments[i]);
}
else if(itemtype=='cards'||itemtype=='card'||(typeof arguments[i]=='object'&&arguments[i]&&arguments[i].name)){
if(lib.config.log_highlight){
str+='<span class="yellowtext">'+get.translation(arguments[i])+'</span>';
}
else{
str+=get.translation(arguments[i]);
}
str+='<span class="yellowtext">'+get.translation(arguments[i])+'</span>';
str2+=get.translation(arguments[i]);
}
else if(typeof arguments[i]=='object'){
if(arguments[i]){
@ -32577,52 +32579,52 @@
}
else{
str+=get.translation(arguments[i]);
str2+=get.translation(arguments[i]);
}
}
}
else if(typeof arguments[i]=='string'){
if(lib.config.log_highlight){
if(arguments[i][0]=='【'&&arguments[i][arguments[i].length-1]=='】'){
str+='<span class="greentext">'+get.translation(arguments[i])+'</span>';
}
else if(arguments[i][0]=='#'){
var color='';
switch(arguments[i][1]){
case 'b':color='blue';break;
case 'y':color='yellow';break;
case 'g':color='green';break;
}
str+='<span class="'+color+'text">'+get.translation(arguments[i].slice(2))+'</span>';
}
else{
str+=get.translation(arguments[i]);
if(arguments[i][0]=='【'&&arguments[i][arguments[i].length-1]=='】'){
str+='<span class="greentext">'+get.translation(arguments[i])+'</span>';
str2+=get.translation(arguments[i]);
}
else if(arguments[i][0]=='#'){
var color='';
switch(arguments[i][1]){
case 'b':color='blue';break;
case 'y':color='yellow';break;
case 'g':color='green';break;
}
str+='<span class="'+color+'text">'+get.translation(arguments[i].slice(2))+'</span>';
str2+=get.translation(arguments[i].slice(2));
}
else{
str+=get.translation(arguments[i]);
str2+=get.translation(arguments[i]);
}
}
else{
str+=arguments[i];
str2+=arguments[i];
}
}
var node=ui.create.div();
node.innerHTML=str;
node.innerHTML=lib.config.log_highlight?str:str2;
ui.sidebar.insertBefore(node,ui.sidebar.firstChild);
game.addVideo('log',null,str);
game.broadcast(function(str){
game.log(str);
},str);
game.addVideo('log',null,lib.config.log_highlight?str:str2);
game.broadcast(function(str,str2){
game.log(lib.config.log_highlight?str:str2);
},str,str2);
if(!_status.video&&!game.online){
if(!logvid){
logvid=_status.event.getLogv();
}
if(logvid){
game.logv(logvid,'<div class="text center">'+str+'</div>');
game.logv(logvid,'<div class="text center">'+lib.config.log_highlight?str:str2+'</div>');
}
}
// if(lib.config.title) document.title=str;
// if(lib.config.title) document.title=lib.config.log_highlight?str:str2;
if(lib.config.show_log!='off'&&!game.chess){
var nodeentry=node.cloneNode(true);
ui.arenalog.insertBefore(nodeentry,ui.arenalog.firstChild);
@ -40184,7 +40186,7 @@
row2.hide();
}
if(lib.config.mode=='identity'||lib.config.mode=='guozhan'){
if(!game.phaseNumber){
if(!game.phaseNumber||_status.qianlidanji){
nodereplace.classList.add('unselectable');
}
else if(_status.event.isMine()&&ui.auto.classList.contains('hidden')){
@ -49507,7 +49509,7 @@
uiintro.addText(get.colorspan(lib.characterTitle[node.name]));
}
if(node.isUnderControl()||(game.me&&game.me.hasSkillTag('viewHandcard',null,node,true))){
if(node.isUnderControl()||(!game.observe&&game.me&&game.me.hasSkillTag('viewHandcard',null,node,true))){
var hs=node.getCards('h');
if(hs.length){
uiintro.add('<div class="text center">手牌</div>');
@ -50726,6 +50728,32 @@
}
return result;
},
effect_use:function(target,card,player,player2,isLink){
var event=_status.event;
var eventskill=null;
if(player==undefined) player=_status.event.player;
if(typeof card!='string'&&(typeof card!='object'||!card.name)){
var skillinfo=get.info(event.skill);
if(event.skill&&skillinfo.viewAs==undefined) card=_status.event.skill;
else{
card=get.card();
if(skillinfo&&skillinfo.viewAs&&card.name===skillinfo.viewAs.name){
eventskill=event.skill;
}
}
}
var info=get.info(card);
if(typeof card=='object'&&info&&info.changeTarget){
var targets=[target];
info.changeTarget(player,targets);
var eff=0;
for(var i of targets){
eff+=get.effect(i,card,player,player2,isLink);
}
return eff;
}
return get.effect.apply(this,arguments);
},
effect:function(target,card,player,player2,isLink){
var event=_status.event;
var eventskill=null;

View File

@ -1,21 +1,21 @@
window.noname_update={
version:'1.9.100.7.1',
update:'1.9.100.7',
version:'1.9.101',
update:'1.9.100.7.1',
changeLog:[
'神山识',
'千里单骑(乱斗)',
'bug修复',
],
files:[
//'card/extra.js',
//'card/huanlekapai.js',
//'card/sp.js',
//'card/standard.js',
'card/sp.js',
'card/standard.js',
//'card/swd.js',
//'card/mtg.js',
//'card/gujian.js',
//'card/guozhan.js',
//'card/gwent.js',
'card/gujian.js',
'card/guozhan.js',
'card/gwent.js',
//'card/yunchou.js',
//'card/zhenfa.js',
//'card/zhulu.js',
@ -25,18 +25,18 @@ window.noname_update={
//'character/gujian.js',
//'character/gwent.js',
//'character/hearth.js',
//'character/mobile.js',
'character/mobile.js',
//'character/mtg.js',
//'character/old.js',
//'character/refresh.js',
//'character/shenhua.js',
//'character/sp.js',
'character/sp.js',
//'character/tw.js',
//'character/standard.js',
//'character/swd.js',
//'character/xianjian.js',
//'character/xinghuoliaoyuan.js',
//'character/yijiang.js',
'character/yijiang.js',
//'character/yxs.js',
//'extension/boss/extension.js',
//'layout/default/layout.css',
@ -48,10 +48,10 @@ window.noname_update={
//'mode/tafang.js',
//'mode/single.js',
//'mode/stone.js',
//'mode/brawl.js',
'mode/brawl.js',
//'mode/versus.js',
//'mode/boss.js',
//'game/game.js',
'game/game.js',
//'game/NoSleep.js',
//'game/config.js',
//'game/package.js',

BIN
image/character/caiyang.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

BIN
image/character/huban.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

BIN
image/character/pujing.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

View File

@ -424,6 +424,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
},
init:function(){},
content:{
submode:'normal',
chooseCharacterBefore:function(){
game.identityVideoName='幻化之战';
var skills=[];
@ -2443,6 +2444,544 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}
}
},
qianlidanji:{
name:'千里单骑',
mode:'identity',
showcase:function(init){
var node=this;
var player1;
if(init){
player1=ui.create.player(null,true).init('jsp_guanyu');
player1.node.marks.remove();
player1.node.hp.remove();
player1.style.left='20px';
player1.style.top='20px';
player1.style.transform='scale(0.9)';
player1.node.count.remove();
this.appendChild(player1);
this.player1=player1;
}
else{
player1=this.player1;
}
var rect1=player1.getBoundingClientRect();
var func=function(){
var player2=ui.create.player(null,true).init('caiyang');
player2.node.marks.remove();
player2.node.hp.remove();
player2.style.left='auto';
player2.style.right='20px';
player2.style.top='20px';
player2.node.count.remove();
player2.style.transform='scale(0.7)';
player2.style.opacity=0;
node.appendChild(player2);
ui.refresh(player2);
player2.style.opacity=1;
player2.style.transform='scale(0.9)';
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;
setTimeout(function(){
if(!player2) return;
game.linexy([left1,top1,left2,top2]);
var popup=ui.create.div('.damage');
popup.innerHTML='-1';
popup.dataset.nature='soil';
player2.appendChild(popup);
ui.refresh(popup);
popup.classList.add('damageadded');
popup.listenTransition(function(){
setTimeout(function(){
popup.delete();
},200);
});
},600);
setTimeout(function(){
if(!player2) return;
player2.style.transition='all 0.5s';
player2.style.transform='scale(1.2)';
player2.delete();
},1100);
};
node.showcaseinterval=setInterval(func,2600);
func();
},
intro:[
'无尽而漫长的单挑试炼',
(lib.config.qianlidanji_level?('你的最高纪录是连续通过'+lib.config.qianlidanji_level+'关,是否能够突破这一记录呢?'):'你能否过五关斩六将,击败古城战神蔡阳呢?'),
],
init:function(){
if(!_status.qianlidanji) _status.qianlidanji={
completeNumber:0,
used:['pujing','huban','caiyang'],
addFellow:function(name){
game.fan.dataset.position=2;
ui.arena.setNumber(3);
game.fellow=game.addFellow(1,name);
game.fellow.gain(get.cards(4));
game.fellow.identity='zhong';
game.fellow.setIdentity();
game.fellow.identityShown=true;
game.fellow.node.identity.classList.remove('guessing');
_status.event.getParent('phaseLoop').player=game.fellow;
},
completeReward:[
['回复1点体力并摸一张牌',function(){
game.zhu.recover();
game.zhu.draw();
}],
['摸三张牌',function(){
game.zhu.recover();
}],
['将一张防具牌置入装备区并摸一张牌',function(){
var card=get.cardPile(function(card){
return get.subtype(card)=='equip2'&&!get.cardtag(card,'gifts');
});
if(card) game.zhu.equip(card);
game.zhu.draw();
}],
['将一张武器牌置入装备区并摸一张牌',function(){
var card=get.cardPile(function(card){
return get.subtype(card)=='equip1'&&!get.cardtag(card,'gifts');
});
if(card) game.zhu.equip(card);
game.zhu.draw();
}],
['回复2点体力并弃置一张牌',function(){
game.zhu.recover(2);
game.zhu.chooseToDiscard('he',true);
}],
['摸五张牌,然后弃置三张牌',function(){
game.zhu.draw(5);
game.zhu.chooseToDiscard(3,'he',true);
}],
['摸五张牌,然后对手摸两张牌',function(){
game.zhu.draw(5);
game.fan.draw(2);
}],
['将一张武器牌和一张防具牌置入装备区',function(){
var card=get.cardPile(function(card){
return get.subtype(card)=='equip1'&&!get.cardtag(card,'gifts');
});
if(card) game.zhu.equip(card);
var card2=get.cardPile(function(card){
return get.subtype(card)=='equip2'&&!get.cardtag(card,'gifts');
});
if(card2) game.zhu.equip(card2);
}],
['将一张武器牌和一张防御坐骑牌置入装备区',function(){
var card=get.cardPile(function(card){
return get.subtype(card)=='equip1'&&!get.cardtag(card,'gifts');
});
if(card) game.zhu.equip(card);
var card2=get.cardPile(function(card){
return get.subtype(card)=='equip3'&&!get.cardtag(card,'gifts');
});
if(card2) game.zhu.equip(card2);
}],
['弃置所有手牌并于下一关获得【涅槃】(标)',function(){
var hs=game.zhu.getCards('h');
if(hs.length) game.zhu.discard(hs);
game.zhu.addTempSkill('oldniepan','dieBegin');
game.zhu.restoreSkill('oldniepan');
}],
['获得两张锦囊牌',function(){
var list=[];
while(list.length<2){
var card=get.cardPile(function(card){
return !list.contains(card)&&get.type(card,'trick')=='trick';
});
if(!card) break;
list.push(card);
}
if(list.length) game.zhu.gain(list,'gain2','log');
}],
['将体力回复至体力上限,然后弃置一张牌',function(){
var num=game.zhu.maxHp-game.zhu.hp;
if(num) game.zhu.recover(num);
game.zhu.chooseToDiscard('he',true);
}],
['弃置两张牌,在下一关的第一个回合后进行一个额外的回合',function(){
game.zhu.chooseToDiscard(2,true,'he');
game.zhu.addSkill('qianlidanji_phase');
}],
['摸一张牌,然后将对手翻面',function(){
game.zhu.draw();
game.fan.turnOver(true);
}],
['摸一张牌然后令对手受到1点伤害',function(){
game.zhu.draw();
game.fan.damage(game.zhu);
}],
['获得五张基本牌',function(){
var list=[];
while(list.length<5){
var card=get.cardPile(function(card){
return !list.contains(card)&&get.type(card)=='basic';
});
if(!card) break;
list.push(card);
}
if(list.length) game.zhu.gain(list,'gain2','log');
}],
['失去1点体力然后摸五张牌',function(){
game.zhu.loseHp();
game.zhu.draw(5);
}],
['失去体力至1点然后摸七张牌',function(){
var num=game.zhu.hp-1;
if(num) game.zhu.loseHp(num);
game.zhu.draw(7)
}],
['弃置一张牌然后令对手受到2点伤害',function(){
game.zhu.chooseToDiscard('he',true);
game.fan.damage(game.zhu,2);
}],
['在下一关中召唤普净一同战斗',function(){
_status.qianlidanji.addFellow('pujing');
}],
['在下一关中召唤胡班一同战斗',function(){
_status.qianlidanji.addFellow('huban');
}],
],
replace_character:function(){
'step 0'
_status.qianlidanji.completeNumber++;
if(!lib.config.qianlidanji_level||lib.config.qianlidanji_level<_status.qianlidanji.completeNumber){
lib.config.qianlidanji_level=_status.qianlidanji.completeNumber;
game.saveConfig('qianlidanji_level',lib.config.qianlidanji_level);
}
if(game.fellow&&game.fellow.isAlive()){
if(ui.land&&ui.land.player==game.fellow){
game.addVideo('destroyLand');
ui.land.destroy();
}
game.zhu.next=game.fan;
game.fan.next=game.zhu;
game.zhu.nextSeat=game.fan;
game.fan.nextSeat=game.zhu;
game.players.remove(game.fellow);
_status.dying.remove(game.fellow);
game.fellow.out();
for(var mark in game.fellow.marks){
game.fellow.unmarkSkill(mark);
}
while(game.fellow.node.marks.childNodes.length>1){
game.fellow.node.marks.lastChild.remove();
}
for(var i in game.fellow.tempSkills){
game.fellow.removeSkill(i);
}
var skills=game.fellow.getSkills();
for(var i=0;i<skills.length;i++){
if(lib.skill[skills[i]].temp){
game.fellow.removeSkill(skills[i]);
}
}
var cards=game.fellow.getCards('hej');
while(cards.length){
ui.discardPile.appendChild(cards.shift());
}
}
'step 1'
if(game.fellow){
game.dead.remove(game.fellow);
game.fellow.remove();
game.fan.dataset.position=1;
ui.arena.setNumber(2);
game.zhu.next=game.fan;
game.fan.next=game.zhu;
game.zhu.nextSeat=game.fan;
game.fan.nextSeat=game.zhu;
}
if(_status.qianlidanji.completeNumber!=5){
var list=_status.qianlidanji.completeReward.randomGets(3);
var list2=[];
for(var i=0;i<list.length;i++){
list2.push(list[i][1]);
list[i]=list[i][0];
}
if(_status.qianlidanji.completeNumber>=6){
list.push('我不想再打了,直接在这里结束吧!');
list2.push(function(){
game.over(true);
});
}
event.list=list2;
game.zhu.chooseControl().set('choiceList',list).set('prompt','请选择一项奖励(当前已通过'+_status.qianlidanji.completeNumber+'关)');
}
'step 2'
if(_status.qianlidanji.completeNumber!=5){
if(result.index==3){
game.over(true);
return;
}
event.reward=event.list[result.index];
}
_status.characterlist.removeArray(_status.qianlidanji.used);
if(_status.qianlidanji.completeNumber==5) event._result={links:['caiyang']};
else game.zhu.chooseButton(['选择下一关出战的对手',[_status.characterlist.randomGets(3),'character']],true);
'step 3'
_status.event.getParent('phaseLoop').player=game.zhu;
var source=game.fan;
var name=result.links[0];
source.revive(null,false);
_status.characterlist.remove(name);
_status.qianlidanji.used.push(name);
source.uninit();
source.init(name);
game.addVideo('reinit',source,[name]);
source.lose(source.getCards('hej'))._triggered=null;
var gain=4;
var add=0;
switch(_status.qianlidanji.completeNumber){
case 5:break;
case 1:gain=5;break;
case 2:gain=5;add=1;break;
case 3:gain=6;add=1;break;
default:gain=6;add=2;break;
};
source.hp+=add;
source.maxHp+=add;
source.update();
source.gain(get.cards(gain))._triggered=null;
game.triggerEnter(source);
if(event.reward) event.reward();
'step 4'
var cards=Array.from(ui.ordering.childNodes);
while(cards.length){
cards.shift().discard();
}
var evt=_status.event.getParent('phase');
if(evt){
game.resetSkills();
_status.event=evt;
_status.event.finish();
_status.event.untrigger(true);
}
},
};
_status.qianlidanji.player_number=get.config('player_number');
game.saveConfig('player_number','2','identity');
},
content:{
submode:'normal',
chooseCharacterBefore:function(){
game.identityVideoName='千里单骑';
game.saveConfig('player_number',_status.qianlidanji.player_number,'identity');
game.chooseCharacter=function(){
var next=game.createEvent('chooseCharacter',false);
next.showConfig=true;
next.setContent(function(){
"step 0"
ui.arena.classList.add('choose-character');
game.me.identity='zhu';
game.zhu=game.me;
game.fan=game.me.next;
game.fan.identity='fan';
game.zhu.setIdentity();
game.zhu.identityShown=true;
game.zhu.node.identity.classList.remove('guessing');
game.fan.setIdentity();
game.fan.identityShown=true;
game.fan.node.identity.classList.remove('guessing');
event.list=[];
for(var i in lib.character){
if(lib.filter.characterDisabled(i)) continue;
event.list.push(i);
}
event.list.randomSort();
_status.characterlist=event.list.slice(0);
var list=event.list.slice(0,5);
delete event.swapnochoose;
var dialog;
if(event.swapnodialog){
dialog=ui.dialog;
event.swapnodialog(dialog,list);
delete event.swapnodialog;
}
else{
var str='选择角色';
dialog=ui.create.dialog(str,'hidden',[list,'character']);
}
dialog.setCaption('选择角色');
game.me.chooseButton(dialog,true).set('onfree',true);
ui.create.cheat=function(){
_status.createControl=ui.cheat2;
ui.cheat=ui.create.control('更换',function(){
if(ui.cheat2&&ui.cheat2.dialog==_status.event.dialog){
return;
}
if(game.changeCoin){
game.changeCoin(-3);
}
event.list.randomSort();
list=event.list.slice(0,5);
var buttons=ui.create.div('.buttons');
var node=_status.event.dialog.buttons[0].parentNode;
_status.event.dialog.buttons=ui.create.buttons(list,'character',buttons);
_status.event.dialog.content.insertBefore(buttons,node);
buttons.animate('start');
node.remove();
game.uncheck();
game.check();
});
delete _status.createControl;
};
if(lib.onfree){
lib.onfree.push(function(){
event.dialogxx=ui.create.characterDialog('heightset');
if(ui.cheat2){
ui.cheat2.animate('controlpressdownx',500);
ui.cheat2.classList.remove('disabled');
}
});
}
else{
event.dialogxx=ui.create.characterDialog('heightset');
}
ui.create.cheat2=function(){
ui.cheat2=ui.create.control('自由选将',function(){
if(this.dialog==_status.event.dialog){
if(game.changeCoin){
game.changeCoin(50);
}
this.dialog.close();
_status.event.dialog=this.backup;
this.backup.open();
delete this.backup;
game.uncheck();
game.check();
if(ui.cheat){
ui.cheat.animate('controlpressdownx',500);
ui.cheat.classList.remove('disabled');
}
}
else{
if(game.changeCoin){
game.changeCoin(-10);
}
this.backup=_status.event.dialog;
_status.event.dialog.close();
_status.event.dialog=_status.event.parent.dialogxx;
this.dialog=_status.event.dialog;
this.dialog.open();
game.uncheck();
game.check();
if(ui.cheat){
ui.cheat.classList.add('disabled');
}
}
});
if(lib.onfree){
ui.cheat2.classList.add('disabled');
}
}
if(!_status.brawl||!_status.brawl.chooseCharacterFixed){
if(!ui.cheat&&get.config('change_choice'))
ui.create.cheat();
if(!ui.cheat2&&get.config('free_choose'))
ui.create.cheat2();
}
"step 1"
if(ui.cheat){
ui.cheat.close();
delete ui.cheat;
}
if(ui.cheat2){
ui.cheat2.close();
delete ui.cheat2;
}
game.addRecentCharacter(result.buttons[0].link);
game.zhu.init(result.buttons[0].link);
_status.characterlist.remove(result.buttons[0].link);
_status.qianlidanji.used.add(result.buttons[0].link);
game.zhu.chooseControl('地狱','困难','普通','简单','无双').set('prompt','请选择游戏难度');
"step 2"
var hp=Math.floor(result.index/2);
event.draw=Math.floor((result.index+1)/2);
if(hp){
game.zhu.hp+=hp;
game.zhu.maxHp+=hp;
game.zhu.update();
}
game.zhu.chooseButton(['请选择对手的登场武将',[_status.characterlist.randomGets(3),'character']],true);
"step 3"
game.fan.init(result.links[0]);
_status.characterlist.remove(result.links[0]);
_status.qianlidanji.used.add(result.links[0]);
if(event.draw){
game.zhu.directgain(get.cards(event.draw));
}
setTimeout(function(){
ui.arena.classList.remove('choose-character');
},500);
var pack={
character:{
pujing:['male','qun',1,[],[]],
huban:['male','qun',2,[],[]],
},
translate:{
pujing:'普净',
huban:'胡班',
},
skill:{
qianlidanji_phase:{
trigger:{global:'phaseBefore'},
forced:true,
silent:true,
firstDo:true,
content:function(){
player.removeSkill('qianlidanji_phase');
player.insertPhase();
},
},
},
};
for(var i in pack){
for(var j in pack[i]){
lib[i][j]=pack[i][j];
}
}
delete pack.skill;
game.addVideo('arrangeLib',null,pack);
game.addOverDialog=function(dialog){
dialog.addText('共计通过'+_status.qianlidanji.completeNumber+'关');
};
lib.element.player.dieAfter=function(){
if(this==game.fellow) return;
_status.characterlist.removeArray(_status.qianlidanji.used);
if(game.zhu==this||!_status.characterlist.length){
var bool=false;
if(_status.qianlidanji.completeNumber>5) bool=true;
game.over(bool);
}
else{
var next=game.createEvent('qianlidanji_replace',false);
next.setContent(_status.qianlidanji.replace_character);
}
};
lib.element.player.dieAfter2=function(){
_status.characterlist.removeArray(_status.qianlidanji.used);
};
game.zhu.dieAfter=lib.element.player.dieAfter;
game.fan.dieAfter=lib.element.player.dieAfter;
game.zhu.dieAfter2=lib.element.player.dieAfter2;
game.fan.dieAfter2=lib.element.player.dieAfter2;
});
};
}
}
},
liangjunduilei:{
name:'两军对垒',
mode:'versus',