This commit is contained in:
libccy 2017-11-22 20:44:09 +08:00
parent 9355057d6f
commit b4784aa0c9
7 changed files with 361 additions and 7 deletions

View File

@ -1642,7 +1642,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
if(typeof aiii=='number') return aiii;
}
if(Math.abs(get.attitude(_status.event.player,source))<3) return 0;
if(source.hasSkill('guanxing')) return 0;
if(source.hasSkillTag('guanxing')&&(source!=player||!source.hasSkill('guanxing_fail'))) return 0;
if(name!='lebu'&&name!='bingliang'){
if(source!=_status.event.player){
return 0;

View File

@ -41,6 +41,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ns_jinke:['male','qun',4,['nspinmin','nsshishou']],
ns_yanliang:['male','qun',4,['nsduijue','nsshuangxiong','dualside'],['dualside:ns_wenchou']],
ns_wenchou:['male','qun',2,['nsguanyong','dualside'],['unseen']],
ns_caocao:['male','wei',4,['nscaiyi','nsgefa','nshaoling']],
ns_zhugeliang:['male','shu',3,['nsguanxing','kongcheng','nsxingyun']],
},
characterIntro:{
diy_feishi:'字公举,生卒年不详,益州犍为郡南安县(今四川省乐山市)人。刘璋占据益州时,以费诗为绵竹县县令。刘备进攻刘璋夺取益州,费诗举城而降,后受拜督军从事,转任牂牁郡太守,再为州前部司马。',
@ -62,11 +65,226 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ns_huangzu:'#r小芯儿童鞋',
ns_yanliang:'#r橙续缘',
ns_wenchou:'#r橙续缘',
ns_caocao:'#r一瞬间遗忘',
ns_zhugeliang:'#p死不死什么的',
},
perfectPair:{
yuji:['zuoci']
},
skill:{
nsguanxing:{
trigger:{player:'phaseBegin'},
forced:true,
filter:function(event,player){
return player.hp>0;
},
content:function(){
'step 0'
event.cards=get.cards(game.countPlayer());
event.chosen=[];
event.num=player.hp;
'step 1'
var js=player.getCards('j');
var pos;
var choice=-1;
var getval=function(card,pos){
if(js[pos]){
return (get.judge(js[pos]))(card);
}
else{
return get.value(card);
}
};
for(pos=0;pos<Math.min(event.cards.length,js.length+2);pos++){
var max=getval(event.cards[pos],pos);
for(var j=pos+1;j<event.cards.length;j++){
var current=getval(event.cards[j],pos);
if(current>max){
choice=j;
max=current;
}
}
if(choice!=-1){
break;
}
}
player.chooseCardButton('观星:选择要移动的牌(还能移动'+event.num+'张)',event.cards).set('filterButton',function(button){
return !_status.event.chosen.contains(button.link);
}).set('chosen',event.chosen).set('ai',function(button){
return button.link==_status.event.choice?1:0;
}).set('choice',event.cards[choice]);
event.pos=pos;
'step 2'
if(result.bool){
var card=result.links[0];
var index=event.cards.indexOf(card);
event.card=card;
event.chosen.push(card);
event.cards.remove(event.card);
var buttons=event.cards.slice(0);
player.chooseControl(function(){
return _status.event.controlai;
}).set('controlai',event.pos||0).set('sortcard',buttons).set('tosort',card);
}
else{
event.goto(4);
}
'step 3'
if(typeof result.index=='number'){
if(result.index>event.cards.length){
ui.cardPile.appendChild(event.card);
}
else{
event.cards.splice(result.index,0,event.card);
}
event.num--;
if(event.num>0){
event.goto(1);
}
}
'step 4'
while(event.cards.length){
ui.cardPile.insertBefore(event.cards.pop(),ui.cardPile.firstChild);
}
var js=player.getCards('j');
if(js.length==1){
if((get.judge(js[0]))(ui.cardPile.firstChild)<0){
player.addTempSkill('guanxing_fail');
}
}
},
ai:{
guanxing:true
}
},
nshaoling:{
skillAnimation:true,
animationColor:'water',
unique:true,
mark:true,
init:function(player){
player.storage.nshaoling=false;
},
enable:'phaseUse',
filter:function(event,player){
return !player.storage.nshaoling;
},
intro:{
content:'limited'
},
filterTarget:function(card,player,target){
return target!=player;
},
content:function(){
"step 0"
player.awakenSkill('nshaoling');
player.storage.nshaoling=true;
event.targets=game.filterPlayer();
event.targets.remove(player);
event.targets.remove(target);
event.targets.sortBySeat();
"step 1"
if(event.targets.length){
event.current=event.targets.shift();
if(event.current.countCards('he')&&target.isAlive()){
event.current.chooseToUse({name:'sha'},target,-1);
}
}
else{
event.finish();
}
"step 2"
if(result.bool==false){
if(event.current.countCards('he')){
event.current.chooseCard('he',true,'交给'+get.translation(player)+'一张牌');
}
else{
event.goto(4);
}
}
else{
event.goto(1);
}
"step 3"
if(result.bool){
event.current.give(result.cards,player);
}
"step 4"
player.useCard({name:'sha'},event.current,false);
event.goto(1);
},
ai:{
order:5,
result:{
target:function(player,target){
var players=game.filterPlayer();
if(player.hp>1){
if(game.phaseNumber<game.players.length) return 0;
if(player.hasUnknown()) return 0;
}
var effect=0;
for(var i=0;i<players.length;i++){
if(players[i]!=target&&players[i]!=player&&players[i].countCards('he'))
effect+=get.effect(target,{name:'sha'},players[i],target);
}
return effect;
}
}
}
},
nsgefa:{
enable:'chooseToUse',
filter:function(event,player){
return player.hp<=0;
},
filterCard:{suit:'club'},
position:'he',
viewAs:{name:'tao'},
prompt:'将一张梅花牌当桃使用',
check:function(card){return 15-get.value(card)},
ai:{
skillTagFilter:function(player){
return player.countCards('he',{suit:'club'})>0;
},
threaten:1.5,
save:true,
respondTao:true,
}
},
nscaiyi:{
trigger:{global:'drawAfter'},
check:function(event,player){
if(get.attitude(player,event.player)>=0) return false;
if(get.effect(event.player,{name:'sha'},player,player)<=0) return false;
if(get.effect(player,{name:'sha'},event.player,player)>=0) return true;
return player.hasShan()&&player.hp>=event.player.hp;
},
filter:function(event,player){
return player!=event.player&&event.result.length>0;
},
logTarget:'player',
content:function(){
'step 0'
player.viewCards(get.translation(trigger.player)+'摸到的牌',trigger.result);
if(!event.isMine()){
game.delayx();
}
'step 1'
var list=[];
for(var i=0;i<trigger.result.length;i++){
if(trigger.result[i].name=='sha'){
list.push(trigger.result[i]);
}
}
if(list.length){
player.useCard({name:'sha'},trigger.player);
}
else{
trigger.player.useCard({name:'sha'},player);
}
}
},
nspinmin:{
trigger:{player:'dieBefore'},
forced:true,
@ -2326,6 +2544,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ns_wenchou:'文丑',
ns_jinke:'荆轲',
ns_caocao:'曹操',
ns_zhugeliang:'诸葛亮',
nsguanxing:'观星',
nsguanxing_info:'锁定技准备阶段你观看牌堆的X张牌(X为场上存活人数)并且任意移动Y张牌(Y为你当前体力值)',
nscaiyi:'猜疑',
nscaiyi_info:'其他角色摸牌后,你可以观看其摸到的牌,若其中有【杀】,则视为你对其使用一张【杀】,若其中没有【杀】,则视为其对你使用一张【杀】(计入出杀次数)',
nsgefa:'割发',
nsgefa_info:'当你的体力值等于0或更低时你可以将任意一张♣牌当【桃】使用',
nshaoling:'号令',
nshaoling_info:'限定技出牌阶段你可以指定一名其他角色令另外所有其他角色角色选择一项1、对该角色使用一张【杀】2、交给你一张牌然后视为你对其使用一张【杀】',
nspinmin:'拼命',
nspinmin_info:'锁定技当你于回合内死亡时你不死亡并增加一点体力上限每回合最多增加1点且不能超过4当你于回合外死亡时你不死亡并减少一点体力上限体力上限为0会导致你死亡',
nsshishou:'失手',

View File

@ -788,6 +788,91 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
},
guanxing:{
audio:2,
audioname:['jiangwei'],
trigger:{player:'phaseBegin'},
frequent:true,
content:function(){
'step 0'
event.num=Math.min(5,game.countPlayer());
event.cards=get.cards(event.num);
event.chosen=[];
'step 1'
var js=player.getCards('j');
var pos;
var choice=-1;
var getval=function(card,pos){
if(js[pos]){
return (get.judge(js[pos]))(card);
}
else{
return get.value(card);
}
};
for(pos=0;pos<Math.min(event.cards.length,js.length+2);pos++){
var max=getval(event.cards[pos],pos);
for(var j=pos+1;j<event.cards.length;j++){
var current=getval(event.cards[j],pos);
if(current>max){
choice=j;
max=current;
}
}
if(choice!=-1){
break;
}
}
player.chooseCardButton('观星:选择要移动的牌(还能移动'+event.num+'张)',event.cards).set('filterButton',function(button){
return !_status.event.chosen.contains(button.link);
}).set('chosen',event.chosen).set('ai',function(button){
return button.link==_status.event.choice?1:0;
}).set('choice',event.cards[choice]);
event.pos=pos;
'step 2'
if(result.bool){
var card=result.links[0];
var index=event.cards.indexOf(card);
event.card=card;
event.chosen.push(card);
event.cards.remove(event.card);
var buttons=event.cards.slice(0);
player.chooseControl(function(){
return _status.event.controlai;
}).set('controlai',event.pos||0).set('sortcard',buttons).set('tosort',card);
}
else{
event.goto(4);
}
'step 3'
if(typeof result.index=='number'){
if(result.index>event.cards.length){
ui.cardPile.appendChild(event.card);
}
else{
event.cards.splice(result.index,0,event.card);
}
event.num--;
if(event.num>0){
event.goto(1);
}
}
'step 4'
while(event.cards.length){
ui.cardPile.insertBefore(event.cards.pop(),ui.cardPile.firstChild);
}
var js=player.getCards('j');
if(js.length==1){
if((get.judge(js[0]))(ui.cardPile.firstChild)<0){
player.addTempSkill('guanxing_fail');
}
}
},
ai:{
guanxing:true
}
},
guanxing_fail:{},
guanxing_old:{
audio:2,
audioname:['jiangwei'],
trigger:{player:'phaseBegin'},
@ -810,7 +895,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var top=[];
var judges=player.node.judges.childNodes;
var stopped=false;
if(!player.countCards('h','wuxie')){
if(!player.hasWuxie()){
for(var i=0;i<judges.length;i++){
var judge=get.judge(judges[i]);
cards.sort(function(a,b){

View File

@ -10960,7 +10960,12 @@
chooseControl:function(){
"step 0"
if(event.controls.length==0){
if(event.choiceList){
if(event.sortcard){
for(var i=0;i<event.sortcard.length+2;i++){
event.controls.push(get.cnNumber(i,true));
}
}
else if(event.choiceList){
for(var i=0;i<event.choiceList.length;i++){
event.controls.push('选项'+get.cnNumber(i+1,true));
}
@ -10978,15 +10983,50 @@
event.controls.push('cancel2');
}
if(event.isMine()){
if(event.dialogcontrol){
if(event.sortcard){
var prompt=event.prompt||'选择一个位置';
if(event.tosort){
prompt+='放置'+get.translation(event.tosort);
}
event.dialog=ui.create.dialog(prompt,'hidden');
event.dialog.addSmall(event.sortcard);
var buttons=event.dialog.content.lastChild;
for(var i=0;i<event.dialog.buttons.length+2;i++){
var item=ui.create.div('.button.card.pointerdiv.mebg');
item.style.width='50px';
buttons.insertBefore(item,event.dialog.buttons[i]);
item.innerHTML='<div style="font-family: xinwei;font-size: 25px;height: 75px;line-height: 25px;top: 8px;left: 10px;width: 30px;">第'+get.cnNumber(i+1,true)+'张</div>';
if(i==event.dialog.buttons.length+1){
item.firstChild.innerHTML='牌堆底';
}
item.link=get.cnNumber(i,true);
item.listen(ui.click.dialogcontrol);
}
event.dialog.forcebutton=true;
event.dialog.classList.add('forcebutton');
event.dialog.open();
}
else if(event.dialogcontrol){
event.dialog=ui.create.dialog(event.prompt||'选择一项','hidden');
for(var i=0;i<event.controls.length;i++){
var item=event.dialog.add('<div class="popup text" style="width:calc(100% - 10px);display:inline-block">'+event.controls[i]+'</div>');
var item=event.dialog.add('<div class="popup text pointerdiv" style="width:calc(100% - 10px);display:inline-block">'+event.controls[i]+'</div>');
item.firstChild.listen(ui.click.dialogcontrol);
item.firstChild.link=event.controls[i];
}
event.dialog.forcebutton=true;
event.dialog.classList.add('forcebutton');
if(event.addDialog){
for(var i=0;i<event.addDialog.length;i++){
if(get.itemtype(event.addDialog[i])=='cards'){
event.dialog.addSmall(event.addDialog[i]);
}
else{
event.dialog.add(event.addDialog[i]);
}
}
event.dialog.add(ui.create.div('.placeholder.slim'));
}
event.dialog.open();
}
else{

View File

@ -21,8 +21,8 @@ window.noname_update={
// 'character/*',
// 'character/hearth.js',
// 'character/gwent.js',
// 'character/swd.js',
// 'character/standard.js',
'character/diy.js',
'character/standard.js',
// 'character/sp.js',
// 'character/swd.js',
// 'character/rank.js',

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB