This commit is contained in:
parent
7353e06bba
commit
b4ba1f72ae
293
character/diy.js
293
character/diy.js
|
@ -33,6 +33,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
ns_zuoci:['male','qun',3,['nsxinsheng','nsdunxing']],
|
||||
ns_lvzhi:['female','qun',3,['nsnongquan','nsdufu']],
|
||||
ns_wangyun:["male","qun",4,["liangji","jugong","chengmou"]],
|
||||
ns_nanhua:["male","qun",3,["nshuanxian","nstaiping","nsshoudao"]],
|
||||
ns_nanhua_left:["male","qun",2,[],['unseen']],
|
||||
ns_nanhua_right:["female","qun",2,[],['unseen']],
|
||||
},
|
||||
characterIntro:{
|
||||
diy_feishi:'字公举,生卒年不详,益州犍为郡南安县(今四川省乐山市)人。刘璋占据益州时,以费诗为绵竹县县令。刘备进攻刘璋夺取益州,费诗举城而降,后受拜督军从事,转任牂牁郡太守,再为州前部司马。',
|
||||
|
@ -45,12 +48,291 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
diy_tianyu:'字国让,渔阳雍奴(今天津市武清区东北)人。三国时期曹魏将领。初从刘备,因母亲年老回乡,后跟随公孙瓒,公孙瓒败亡,劝说鲜于辅加入曹操。曹操攻略河北时,田豫正式得到曹操任用,历任颖阴、郎陵令、弋阳太守等。',
|
||||
},
|
||||
characterTitle:{
|
||||
ns_zuoci:'#bskystarwuwei'
|
||||
ns_zuoci:'#bskystarwuwei',
|
||||
ns_lvzhi:'#bskystarwuwei',
|
||||
ns_wangyun:'#rSukincen',
|
||||
ns_nanhua:'#g戒除联盟',
|
||||
},
|
||||
perfectPair:{
|
||||
yuji:['zuoci']
|
||||
},
|
||||
skill:{
|
||||
nstaiping:{
|
||||
trigger:{player:'damageEnd'},
|
||||
filter:function(event,player){
|
||||
return player.storage.nshuanxian_damage&&player.getSubPlayers('nshuanxian').length;
|
||||
},
|
||||
},
|
||||
nsshoudao:{},
|
||||
nshuanxian:{
|
||||
trigger:{global:'gameStart',player:'enterGame'},
|
||||
forced:true,
|
||||
nosub:true,
|
||||
unique:true,
|
||||
group:['nshuanxian_left','nshuanxian_right','nshuanxian_damage','nshuanxian_swap'],
|
||||
content:function(){
|
||||
player.storage.nshuanxian_right=player.addSubPlayer({
|
||||
name:'ns_nanhua_right',
|
||||
skills:['nshuanxian_left','nshuanxian_draw','nshuanxian_swap'],
|
||||
hp:2,
|
||||
maxHp:2,
|
||||
hs:get.cards(2),
|
||||
skill:'nshuanxian',
|
||||
intro:'你的本体回合结束后,切换至此随从并进行一个额外的回合;若你的上家与下家不同,在你的下家的准备阶段,切换至此随从',
|
||||
intro2:'当前回合结束后切换回本体',
|
||||
onremove:function(player){
|
||||
delete player.storage.nshuanxian_right;
|
||||
}
|
||||
});
|
||||
},
|
||||
ai:{
|
||||
maixie:true,
|
||||
effect:{
|
||||
target:function(card,player,target){
|
||||
if(get.tag(card,'damage')){
|
||||
if(!target.hasFriend()) return;
|
||||
if(!target.storage.nshuanxian_damage) return [0.5,1];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// mod:{
|
||||
// globalFrom:function(from,to,distance){
|
||||
//
|
||||
// },
|
||||
// globalTo:function(from,to,distance){
|
||||
//
|
||||
// }
|
||||
// },
|
||||
// global:'nshuanxian_choose',
|
||||
subSkill:{
|
||||
chosen:{},
|
||||
leftdist:{
|
||||
mod:{
|
||||
globalFrom:function(from,to,distance){
|
||||
|
||||
},
|
||||
globalTo:function(from,to,distance){
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
rightdist:{
|
||||
mod:{
|
||||
globalFrom:function(from,to,distance){
|
||||
|
||||
},
|
||||
globalTo:function(from,to,distance){
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
swap:{
|
||||
trigger:{global:'phaseBegin'},
|
||||
forced:true,
|
||||
popup:false,
|
||||
filter:function(event,player){
|
||||
return event.player!=player;
|
||||
},
|
||||
priority:20,
|
||||
content:function(){
|
||||
var next=player.getNext();
|
||||
var prev=player.getPrevious();
|
||||
var left=player.storage.nshuanxian_left;
|
||||
var right=player.storage.nshuanxian_right;
|
||||
if(prev==next||(trigger.player!=next&&trigger.player!=prev)){
|
||||
if(player.hasSkill('subplayer')){
|
||||
player.exitSubPlayer();
|
||||
}
|
||||
}
|
||||
else if(prev==trigger.player&&player.name!=left&&left){
|
||||
if(!player.hasSkill('subplayer')){
|
||||
player.callSubPlayer(left);
|
||||
}
|
||||
else{
|
||||
player.toggleSubPlayer(left);
|
||||
}
|
||||
}
|
||||
else if(next==trigger.player&&player.name!=right&&right){
|
||||
if(!player.hasSkill('subplayer')){
|
||||
player.callSubPlayer(right);
|
||||
}
|
||||
else{
|
||||
player.toggleSubPlayer(right);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
damage:{
|
||||
trigger:{player:'damageEnd'},
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
return !player.storage.nshuanxian_damage;
|
||||
},
|
||||
content:function(){
|
||||
player.storage.nshuanxian_damage=true;
|
||||
player.storage.nshuanxian_left=player.addSubPlayer({
|
||||
name:'ns_nanhua_left',
|
||||
skills:['nshuanxian_middle','nshuanxian_draw','nshuanxian_swap'],
|
||||
hp:2,
|
||||
maxHp:2,
|
||||
hs:get.cards(2),
|
||||
skill:'nshuanxian',
|
||||
intro:'你的本体回合开始前,切换至此随从并进行一个额外的回合;若你的上家与下家不同,在你的上家的准备阶段,切换至此随从',
|
||||
intro2:'当前回合结束后切换回本体',
|
||||
onremove:function(player){
|
||||
delete player.storage.nshuanxian_left;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
draw:{
|
||||
trigger:{player:'phaseDrawBegin'},
|
||||
silent:true,
|
||||
filter:function(event){
|
||||
return event.num>0;
|
||||
},
|
||||
content:function(){
|
||||
trigger.num--;
|
||||
}
|
||||
},
|
||||
left:{
|
||||
trigger:{player:'phaseBefore'},
|
||||
forced:true,
|
||||
popup:false,
|
||||
priority:50,
|
||||
filter:function(event,player){
|
||||
if(event.skill=='nshuanxian_middle') return false;
|
||||
if(event.skill=='nshuanxian_right') return false;
|
||||
var left=player.storage.nshuanxian_left;
|
||||
if(player.hasSkill('subplayer')){
|
||||
if(!left) return player.name==player.storage.nshuanxian_right;
|
||||
return player.storage.subplayer.skills.contains(left);
|
||||
}
|
||||
else{
|
||||
if(!left) return false;
|
||||
return player.hasSkill(left);
|
||||
}
|
||||
},
|
||||
content:function(){
|
||||
if(player.hasSkill('subplayer')){
|
||||
var left=player.storage.nshuanxian_left;
|
||||
if(left&&player.storage.subplayer.skills.contains(left)){
|
||||
player.toggleSubPlayer(player.storage.nshuanxian_left);
|
||||
}
|
||||
else{
|
||||
player.exitSubPlayer();
|
||||
}
|
||||
}
|
||||
else{
|
||||
player.callSubPlayer(player.storage.nshuanxian_left);
|
||||
}
|
||||
}
|
||||
},
|
||||
middle:{
|
||||
trigger:{player:['phaseAfter','phaseCancelled']},
|
||||
forced:true,
|
||||
popup:false,
|
||||
priority:-50,
|
||||
filter:function(event,player){
|
||||
if(player.hasSkill('nshuanxian_chosen')) return false;
|
||||
return true;
|
||||
},
|
||||
content:function(){
|
||||
player.exitSubPlayer();
|
||||
player.insertPhase();
|
||||
}
|
||||
},
|
||||
right:{
|
||||
trigger:{player:['phaseAfter','phaseCancelled']},
|
||||
forced:true,
|
||||
popup:false,
|
||||
priority:-50,
|
||||
filter:function(event,player){
|
||||
if(player.hasSkill('nshuanxian_chosen')) return false;
|
||||
if(player.hasSkill('subplayer')) return false;
|
||||
var right=player.storage.nshuanxian_right;
|
||||
if(!right) return false;
|
||||
return player.hasSkill(right);
|
||||
},
|
||||
content:function(){
|
||||
player.callSubPlayer(player.storage.nshuanxian_right);
|
||||
player.insertPhase();
|
||||
player.addTempSkill('nshuanxian_chosen',['phaseBegin','phaseCancelled']);
|
||||
}
|
||||
},
|
||||
end:{
|
||||
trigger:{player:['phaseAfter','phaseCancelled']},
|
||||
forced:true,
|
||||
popup:false,
|
||||
priority:-50,
|
||||
filter:function(event,player){
|
||||
if(player.hasSkill('nshuanxian_chosen')) return false;
|
||||
return true;
|
||||
},
|
||||
content:function(){
|
||||
if(player.hasSkill('subplayer')){
|
||||
player.exitSubPlayer();
|
||||
}
|
||||
},
|
||||
content_old:function(){
|
||||
'step 0'
|
||||
var controls=['本体'];
|
||||
var left=player.storage.nshuanxian_left;
|
||||
var right=player.storage.nshuanxian_right;
|
||||
if(player.hasSkill('subplayer')){
|
||||
if(player.storage.subplayer.skills.contains(left)){
|
||||
controls.unshift('幻身·左');
|
||||
}
|
||||
if(player.storage.subplayer.skills.contains(right)){
|
||||
controls.push('幻身·右');
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(player.hasSkill(left)){
|
||||
controls.unshift('幻身·左');
|
||||
}
|
||||
if(player.hasSkill(right)){
|
||||
controls.push('幻身·右');
|
||||
}
|
||||
}
|
||||
if(controls.length>1){
|
||||
player.chooseControl(controls,function(event,player){
|
||||
return Math.floor(Math.random()*_status.event.num);
|
||||
}).set('prompt','选择一个形态直到下一回合开始').set('num',controls.length);
|
||||
}
|
||||
else{
|
||||
event.finish();
|
||||
}
|
||||
'step 1'
|
||||
switch(result.control){
|
||||
case '幻身·左':{
|
||||
if(!player.hasSkill('subplayer')){
|
||||
player.callSubPlayer(player.storage.nshuanxian_left);
|
||||
}
|
||||
else{
|
||||
player.toggleSubPlayer(player.storage.nshuanxian_left);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case '幻身·右':{
|
||||
if(!player.hasSkill('subplayer')){
|
||||
player.callSubPlayer(player.storage.nshuanxian_right);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
if(player.hasSkill('subplayer')){
|
||||
player.exitSubPlayer();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
player.addTempSkill('nshuanxian_chosen','phaseBegin');
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
nsnongquan:{
|
||||
enable:'phaseUse',
|
||||
filter:function(event,player){
|
||||
|
@ -1616,7 +1898,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
ns_zuoci:'左慈',
|
||||
ns_wangyun:'王允',
|
||||
ns_lvzhi:'吕后',
|
||||
ns_nanhua:'南华',
|
||||
ns_nanhua_left:'幻身·左',
|
||||
ns_nanhua_right:'幻身·右',
|
||||
|
||||
nshuanxian:'幻仙',
|
||||
nshuanxian_info:'锁定技,游戏开始时,你获得随从“幻身·右”,当你首次受到伤害时,你获得随从“幻身·左”(体力上限2,初始手牌2,摸牌阶段少摸一张牌);在你的回合中(如果有对应幻身),你以【幻身·左-本体-幻身·右】的顺序进行3个连续回合',
|
||||
nstaiping:'太平',
|
||||
nstaiping_info:'当你受到一点伤害后(首次伤害除外),你可以选择一项: ①令一个“幻身”增加一点体力上限。②令一个“幻身”回复一点体力。',
|
||||
nsshoudao:'授道',
|
||||
nsshoudao_info:'当“幻身”全部死亡时,你获得技能“雷击”和“鬼道”。当你死亡时,若此时有两个“幻身”,你可以令一名其他角色获得技能“雷击”和“鬼道”。若有一个“幻身”,你可以令一名其他角色获得技能“雷击”或“鬼道”。(杀死你的角色除外)',
|
||||
nsnongquan:'弄权',
|
||||
nsnongquan_info:'出牌阶段不限次数,你可以将最后一张手牌当【无中生有】使用',
|
||||
nsdufu:'毒妇',
|
||||
|
|
|
@ -48,15 +48,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
filter:function(event,player){
|
||||
return !player.hasSkill('subplayer')&&player.getSubPlayers('lingyong_get').length>0;
|
||||
},
|
||||
unique:true,
|
||||
forceunique:true,
|
||||
nosub:true,
|
||||
group:'lingyong_get',
|
||||
direct:true,
|
||||
delay:0,
|
||||
skillAnimation:true,
|
||||
animationColor:'thunder',
|
||||
content:function(){
|
||||
player.callSubPlayer('lingyong_get');
|
||||
player.callSubPlayer().set('tag','lingyong_get');
|
||||
},
|
||||
ai:{
|
||||
order:1,
|
||||
|
@ -77,9 +76,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
return ![player.name,player.name1,player.name2].contains(event.player.name);
|
||||
},
|
||||
content:function(){
|
||||
var skills=lib.character[trigger.player.name][3].slice(0);
|
||||
for(var i=0;i<skills.length;i++){
|
||||
if(lib.skill[skills[i]].nosub){
|
||||
skills.splice(i--,1);
|
||||
}
|
||||
}
|
||||
player.addSubPlayer({
|
||||
name:trigger.player.name,
|
||||
skills:lib.character[trigger.player.name][3],
|
||||
skills:skills,
|
||||
hs:get.cards(2),
|
||||
intro:'出牌阶段,你可以调遣此随从(直到随从死亡不可再次切换)'
|
||||
});
|
||||
|
|
110
game/game.js
110
game/game.js
|
@ -8989,7 +8989,59 @@
|
|||
element:{
|
||||
content:{
|
||||
toggleSubPlayer:function(){
|
||||
'step 0'
|
||||
var list=event.list||player.storage.subplayer.skills.slice(0);
|
||||
list.remove(player.storage.subplayer.name2);
|
||||
event.list=list;
|
||||
if(!event.directresult){
|
||||
if(list.length>1){
|
||||
var dialog=ui.create.dialog('更换一个随从','hidden');
|
||||
dialog.add([list,'character']);
|
||||
player.chooseButton(dialog,true);
|
||||
}
|
||||
else if(list.length==1){
|
||||
event.directresult=list[0];
|
||||
}
|
||||
else{
|
||||
event.finish();
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(!list.contains(event.directresult)){
|
||||
event.finish();
|
||||
}
|
||||
}
|
||||
'step 1'
|
||||
if(!event.directresult){
|
||||
if(result&&result.bool&&result.links[0]){
|
||||
event.directresult=result.links[0];
|
||||
}
|
||||
else{
|
||||
event.finish();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(player.storage.subplayer){
|
||||
var current=player.storage.subplayer.name2;
|
||||
if(event.directresult==current){
|
||||
event.finish();
|
||||
return;
|
||||
}
|
||||
player.storage[current].hp=player.hp;
|
||||
player.storage[current].maxHp=player.maxHp;
|
||||
player.storage[current].hs=player.getCards('h');
|
||||
player.storage[current].es=player.getCards('e');
|
||||
player.lose(player.getCards('he'),ui.special)._triggered=null;
|
||||
|
||||
var cfg=player.storage[event.directresult];
|
||||
player.storage.subplayer.name2=event.directresult;
|
||||
player.reinit(current,event.directresult,[
|
||||
cfg.hp,
|
||||
cfg.maxHp
|
||||
]);
|
||||
if(cfg.hs.length) player.directgain(cfg.hs);
|
||||
if(cfg.es.length) player.directequip(cfg.es);
|
||||
}
|
||||
},
|
||||
exitSubPlayer:function(){
|
||||
'step 0'
|
||||
|
@ -9011,6 +9063,9 @@
|
|||
]);
|
||||
player.update();
|
||||
if(event.remove){
|
||||
if(player.storage[current].onremove){
|
||||
player.storage[current].onremove(player);
|
||||
}
|
||||
delete player.storage[current];
|
||||
player.storage.subplayer.skills.remove(current);
|
||||
game.log(player,'牺牲了随从','#g'+current);
|
||||
|
@ -9026,6 +9081,10 @@
|
|||
player.directequip(player.storage.subplayer.es);
|
||||
}
|
||||
player.removeSkill('subplayer');
|
||||
'step 2'
|
||||
if(event.remove){
|
||||
event.trigger('removeSubPlayer');
|
||||
}
|
||||
},
|
||||
callSubPlayer:function(){
|
||||
'step 0'
|
||||
|
@ -9063,7 +9122,7 @@
|
|||
var cfg=player.storage[event.directresult];
|
||||
var source=cfg.source||player.name;
|
||||
var name=event.directresult;
|
||||
game.log(player,'调遣了随从','#b'+name);
|
||||
game.log(player,'调遣了随从','#g'+name);
|
||||
player.storage.subplayer={
|
||||
name:source,
|
||||
name2:event.directresult,
|
||||
|
@ -15722,6 +15781,9 @@
|
|||
for(var i=0;i<cards.length;i++){
|
||||
this.$equip(cards[i]);
|
||||
}
|
||||
if(!_status.video){
|
||||
game.addVideo('directequip',this,get.cardsInfo(cards));
|
||||
}
|
||||
},
|
||||
directgain:function(cards){
|
||||
var hs=this.getCards('h');
|
||||
|
@ -16866,6 +16928,7 @@
|
|||
},
|
||||
addSubPlayer:function(cfg){
|
||||
var skill='subplayer_'+cfg.name+'_'+get.id();
|
||||
game.log(this,'获得了随从','#g'+get.translation(cfg.name))
|
||||
cfg.hs=cfg.hs||[];
|
||||
cfg.es=cfg.es||[];
|
||||
cfg.skills=cfg.skills||[];
|
||||
|
@ -16883,7 +16946,6 @@
|
|||
cfg.source=this.name;
|
||||
}
|
||||
}
|
||||
|
||||
game.broadcastAll(function(player,skill,cfg){
|
||||
lib.skill[skill]={
|
||||
intro:{
|
||||
|
@ -16901,9 +16963,21 @@
|
|||
},this,skill,cfg);
|
||||
game.addVideo('addSubPlayer',this,[skill,lib.skill[skill],lib.character[skill],lib.translate[skill],{name:cfg.name}]);
|
||||
this.addSkill(skill);
|
||||
return skill;
|
||||
},
|
||||
removeSubPlayer:function(){
|
||||
|
||||
removeSubPlayer:function(name){
|
||||
if(this.hasSkill('subplayer')&&this.name==name){
|
||||
this.exitSubPlayer(true);
|
||||
}
|
||||
else{
|
||||
if(player.storage[name].onremove){
|
||||
player.storage[name].onremove(player);
|
||||
}
|
||||
this.removeSkill(name);
|
||||
delete this.storage[name];
|
||||
game.log(player,'牺牲了随从','#g'+name);
|
||||
_status.event.trigger('removeSubPlayer');
|
||||
}
|
||||
},
|
||||
callSubPlayer:function(){
|
||||
if(this.hasSkill('subplayer')) return;
|
||||
|
@ -16911,12 +16985,24 @@
|
|||
next.player=this;
|
||||
for(var i=0;i<arguments.length;i++){
|
||||
if(typeof arguments[i]=='string'){
|
||||
next.tag=arguments[i];
|
||||
next.directresult=arguments[i];
|
||||
}
|
||||
}
|
||||
next.setContent('callSubPlayer');
|
||||
return next;
|
||||
},
|
||||
toggleSubPlayer:function(){
|
||||
if(!this.hasSkill('subplayer')) return;
|
||||
var next=game.createEvent('toggleSubPlayer');
|
||||
next.player=this;
|
||||
for(var i=0;i<arguments.length;i++){
|
||||
if(typeof arguments[i]=='string'){
|
||||
next.directresult=arguments[i];
|
||||
}
|
||||
}
|
||||
next.setContent('toggleSubPlayer');
|
||||
return next;
|
||||
},
|
||||
exitSubPlayer:function(remove){
|
||||
if(!this.hasSkill('subplayer')) return;
|
||||
var next=game.createEvent('exitSubPlayer');
|
||||
|
@ -20932,6 +21018,7 @@
|
|||
},
|
||||
mad:{
|
||||
mark:true,
|
||||
locked:true,
|
||||
intro:{
|
||||
content:'已进入混乱状态',
|
||||
name:'混乱',
|
||||
|
@ -24109,6 +24196,14 @@
|
|||
console.log(player);
|
||||
}
|
||||
},
|
||||
directequip:function(player,cards){
|
||||
if(player&&cards){
|
||||
player.directequip(get.infoCards(cards));
|
||||
}
|
||||
else{
|
||||
console.log(player);
|
||||
}
|
||||
},
|
||||
gain12:function(player,cards12){
|
||||
if(player&&cards12){
|
||||
var cards1=get.infoCards(cards12[0]);
|
||||
|
@ -35934,6 +36029,7 @@
|
|||
}
|
||||
|
||||
if(lib.character[i][4].contains('stonehidden')) continue;
|
||||
if(lib.character[i][4].contains('unseen')) continue;
|
||||
if(lib.config.banned.contains(i)) continue;
|
||||
if(filter&&filter(i)) continue;
|
||||
list.push(i);
|
||||
|
@ -43164,8 +43260,8 @@
|
|||
if(lib.character[i][4]){
|
||||
if(lib.character[i][4].contains('boss')) continue;
|
||||
if(lib.character[i][4].contains('hiddenboss')) continue;
|
||||
if(lib.character[i][4].contains('minskin')) return true;
|
||||
if(lib.character[i][4].contains('unseen')) return true;
|
||||
if(lib.character[i][4].contains('minskin')) continue;
|
||||
if(lib.character[i][4].contains('unseen')) continue;
|
||||
}
|
||||
for(var j=0;j<lib.character[i][3].length;j++){
|
||||
var skill=lib.character[i][3][j];
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 128 KiB |
Binary file not shown.
After Width: | Height: | Size: 33 KiB |
Binary file not shown.
After Width: | Height: | Size: 39 KiB |
Loading…
Reference in New Issue