This commit is contained in:
libccy 2017-05-21 20:30:52 +08:00
parent 2c45bbe013
commit 588a2b51b1
15 changed files with 79 additions and 36 deletions

View File

@ -1351,7 +1351,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
if(!lib.config.cards.contains('gwent')) return false;
if(get.info(event.card).complexTarget) return false;
if(!event.targets) return false;
return (get.type(event.card)=='trick'&&event.cards[0]&&event.cards[0]==event.card);
if(event.card.name=='gw_zirankuizeng') return false;
return ((['spell_bronze','spell_silver'].contains(get.subtype(event.card))||get.type(event.card)=='trick')&&
event.cards[0]&&event.cards[0]==event.card);
},
content:function(){
player.storage.gw_zirankuizeng=[trigger.cards[0],trigger.targets.concat(trigger.addedTargets||[])];
@ -1448,7 +1450,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
gw_zuihouyuanwang:'最后愿望',
gw_zuihouyuanwang_info:'摸X张牌并弃置X张牌X为存活角色数',
gw_zirankuizeng:'自然馈赠',
gw_zirankuizeng_info:'重新结算一遍你上一张使用的非转化普通锦囊牌,然后摸一张牌',
gw_zirankuizeng_info:'重新结算一遍你上一张使用的非金法术(自然馈赠除外)或非转化普通锦囊牌,然后摸一张牌',
gw_poxiao:'破晓',
gw_poxiao_info:'选择一项:弃置一名角色判定区内的所有牌,或随机获得一张铜卡法术(破晓除外)并展示之',
gw_zumoshoukao:'阻魔手铐',

View File

@ -1537,7 +1537,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(_status.currentPhase!=player) return;
var num=2;
if(get.is.altered('yuling')) num=1;
if(get.cardCount(true,player)>=player.maxHp+num) return false;
if(player.countUsed()>=player.maxHp+num) return false;
}
}
},
@ -1545,7 +1545,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:['useCardAfter','phaseBegin']},
silent:true,
content:function(){
player.storage.yuling=player.maxHp+2-get.cardCount(true,player);
player.storage.yuling=player.maxHp+2-player.countUsed();
}
},
yuling6:{

View File

@ -5033,7 +5033,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'useCard'},
filter:function(event,player){
if(_status.currentPhase!=player) return false;
return get.cardCount(event.card,player)>1;
return player.countUsed(event.card)>1;
},
forced:true,
usable:3,
@ -5086,7 +5086,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'useCard'},
frequent:true,
filter:function(event,player){
return _status.currentPhase==player&&get.cardCount(true,player)==1;
return _status.currentPhase==player&&player.countUsed()==1;
},
content:function(){
var type=get.type(trigger.card);
@ -5154,10 +5154,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'phaseUseEnd'},
frequent:true,
filter:function(event,player){
return get.cardCount(true,player)>0;
return player.countUsed()>0;
},
content:function(){
player.draw(get.cardCount(true,player));
player.draw(player.countUsed());
},
ai:{
threaten:1.3
@ -5977,7 +5977,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'phaseEnd'},
frequent:true,
filter:function(event,player){
return get.cardCount(true,player)>player.hp;
return player.countUsed()>player.hp;
},
content:function(){
player.draw(2);
@ -5985,7 +5985,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
init:function(player){player.storage.jingce=true},
intro:{
content:function(storage,player){
if(_status.currentPhase==player) return '已使用'+get.cardCount(true,player)+'张牌';
if(_status.currentPhase==player) return '已使用'+player.countUsed()+'张牌';
}
}
},

View File

@ -152,7 +152,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
direct:true,
content:function(){
"step 0"
var num=get.cardCount(true,player)-player.countCards('h');
var num=player.countUsed()-player.countCards('h');
event.num=num;
if(num>0){
player.draw(num);
@ -180,7 +180,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
mod:{
globalFrom:function(from,to,distance){
if(_status.currentPhase==from){
return distance-get.cardCount(true,from);
return distance-from.countUsed();
}
}
},

View File

@ -918,14 +918,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(player.hasSkill('bfengshi4')) return false;
var num=0.2;
if(get.is.altered('bfengshi')) num=0.15;
return Math.random()<num*get.cardCount(true,player);
return Math.random()<num*player.countUsed();
},
content:function(){
trigger.directHit=true;
},
mod:{
attackFrom:function(from,to,distance){
return distance-get.cardCount(true,from);
return distance-from.countUsed();
}
},
group:['bfengshi2','bfengshi3']
@ -940,7 +940,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(player.hasSkill('bfengshi4')) return false;
var num=0.2;
if(get.is.altered('bfengshi')) num=0.15;
return event.card&&event.card.name=='sha'&&Math.random()<num*get.cardCount(true,player);
return event.card&&event.card.name=='sha'&&Math.random()<num*player.countUsed();
},
content:function(){
trigger.num++;
@ -2224,7 +2224,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
mod:{
globalFrom:function(from,to,distance){
if(_status.currentPhase==from){
return distance-get.cardCount(true,from);
return distance-from.countUsed();
}
},
},

View File

@ -3624,7 +3624,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
mod:{
cardEnabled:function(card,player){
if(_status.currentPhase!=player) return;
if(get.cardCount(true,player)>=player.storage.yawang) return false;
if(player.countUsed()>=player.storage.yawang) return false;
}
}
},

View File

@ -1181,7 +1181,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:4,
trigger:{player:'phaseDiscardBefore'},
filter:function(event,player){
return (get.cardCount({name:'sha'},player)==0);
return player.countUsed('sha')==0;
},
content:function(){
trigger.untrigger();

View File

@ -1069,7 +1069,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'phaseEnd'},
frequent:true,
filter:function(event,player){
return get.cardCount(true,player)>=Math.min(3,player.hp);
return player.countUsed()>=Math.min(3,player.hp);
},
content:function(){
'step 0'
@ -5887,7 +5887,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'phaseAfter'},
frequent:true,
filter:function(event,player){
return get.cardCount(true,player)>=player.hp&&event.skill!='lingwu';
return player.countUsed()>=player.hp&&event.skill!='lingwu';
},
content:function(){
player.insertPhase();

View File

@ -91,7 +91,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'useCard'},
frequent:true,
filter:function(event,player){
return _status.currentPhase==player&&get.cardCount(true,player)==3;
return _status.currentPhase==player&&player.countUsed()==3;
},
content:function(){
var card=get.cardPile('chuansongmen');

View File

@ -33,7 +33,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
pal_jiangyunfan:['male','wei',4,['xunying','liefeng']],
pal_tangyurou:['female','shu',3,['txianqu','qiongguang']],
pal_longyou:['male','wei',4,['yuexing','minsha']],
// pal_xiaoman:['male','wei',4,[]],
pal_xiaoman:['female','shu',3,['anwugu','lingquan','shenwu']],
pal_xiahoujinxuan:['male','shu',3,['xuanmo','danqing']],
pal_muchanglan:['female','wu',3,['feixia','lueying']],
@ -85,6 +85,19 @@ game.import('character',function(lib,game,ui,get,ai,_status){
pal_jiangcheng:'折剑山庄庄主欧阳英的得意门生,但因其蚩尤后人魔族的身份,令他无法被容于人界;再加上人界半魔同族饱受人类迫害,故最终成为净天教教主魔君“姜世离”,毅然肩负起保护同族的重任。',
},
skill:{
shenwu:{
trigger:{player:'phaseAfter'},
forced:true,
skillAnimation:true,
animationColor:'water',
unique:true,
filter:function(event,player){
return player.countUsed()>player.hp;
},
content:function(){
player.insertPhase();
},
},
qiongguang:{
trigger:{player:'phaseDiscardEnd'},
filter:function(event,player){
@ -189,11 +202,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true,
popup:false,
filter:function(event,player){
return _status.currentPhase==player&&[2,3,4].contains(get.cardCount(true,player));
return _status.currentPhase==player&&[2,3,4].contains(player.countUsed());
},
content:function(){
var skill;
switch(get.cardCount(true,player)){
switch(player.countUsed()){
case 2:skill='yanzhan';break;
case 3:skill='tianjian';break;
case 4:skill='yufeng';break;
@ -224,7 +237,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(get.value(card,player,'raw')>=7) return;
if(player.hp<=2) return;
if(player.needsToDiscard()) return;
if(get.cardCount(true,player)>=2) return;
if(player.countUsed()>=2) return;
return 'zeroplayertarget';
}
}
@ -461,7 +474,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
mod:{
cardEnabled:function(card,player){
if(_status.currentPhase!=player) return;
if(get.cardCount(true,player)>=player.storage.anwugu2) return false;
if(player.countUsed()>=player.storage.anwugu2) return false;
},
maxHandcard:function(player,num){
return num-1;
@ -4292,6 +4305,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
pal_mingxiu:'明绣',
pal_jushifang:'居十方',
xyufeng:'御蜂',
xyufeng_info:'出牌阶段限一次,可以将一张黑桃牌当作机关蜂使用',
lingguan:'灵泉',
lingquan_info:'觉醒技,结束阶段,若你本回合使用的牌数大于你的体力值,你摸两张牌,然后获得【水蕴】',
shenwu:'神舞',
shenwu_info:'觉醒技在一名角色的结束阶段若你本局至少发动过3次【水蕴】你增加一点体力和体力上限然后获得【回梦】',
txianqu:'仙音',
txianqu_info:'出牌阶段限一次,当你即将造成伤害时,你可以防止之,然后摸两张牌并回复一点体力',
qiongguang:'穹光',

View File

@ -2021,7 +2021,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
mod:{
globalFrom:function(from,to,distance){
if(_status.currentPhase==from){
return distance-get.cardCount(true,from);
return distance-from.countUsed();
}
},
selectTarget:function(card,player,range){
@ -6752,7 +6752,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'phaseUseEnd'},
frequent:true,
filter:function(event,player){
return get.cardCount(true,player)>=player.hp;
return player.countUsed()>=player.hp;
},
content:function(){
player.draw(2);
@ -6761,7 +6761,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
init:function(player){player.storage.jingce=true},
intro:{
content:function(storage,player){
if(_status.currentPhase==player) return '已使用'+get.cardCount(true,player)+'张牌';
if(_status.currentPhase==player) return '已使用'+player.countUsed()+'张牌';
}
}
},

View File

@ -13342,6 +13342,28 @@
}
return null;
},
countUsed:function(card){
var num;
var stat=this.getStat('card');
if(!card){
num=0;
for(var i in stat){
if(typeof stat[i]=='number') num+=stat[i];
}
return num;
}
if(typeof card=='object'){
card=card.name;
}
num=stat[card];
if(typeof num!='number') return 0;
return num;
},
countSkill:function(skill){
var num=this.getStat('skill')[skill];
if(num==undefined) return 0;
return num;
},
getCards:function(arg1,arg2){
if(typeof arg1!='string'){
arg1='h';
@ -16340,7 +16362,7 @@
num=game.checkMod(card,player,num,'cardUsable',player);
if(typeof num!='number') return Infinity;
if(!pure&&_status.currentPhase==player){
return num-get.cardCount(card,player);
return num-player.countUsed(card);
}
return num;
},
@ -19265,7 +19287,7 @@
if(typeof num=='function') num=num(card,player);
num=game.checkMod(card,player,num,'cardUsable',player);
if(typeof num!='number') return true;
else return(get.cardCount(card,player)<num);
else return(player.countUsed(card)<num);
},
cardDiscardable:function(card,player,event){
event=event||_status.event;

View File

@ -4896,7 +4896,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
mod:{
cardUsable:function(card,player,num){
if(card.name=='sha'){
return num+get.cardCount(true,player)-get.cardCount('sha',player);
return num+player.countUsed()-player.countUsed('sha');
}
},
},
@ -4932,11 +4932,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
trigger:{player:'phaseEnd'},
direct:true,
filter:function(event,player){
return get.cardCount('sha',player)>0;
return player.countUsed('sha')>0;
},
content:function(){
"step 0"
player.chooseToMove(get.cardCount('sha',player),get.prompt('lingdong'));
player.chooseToMove(player.countUsed('sha'),get.prompt('lingdong'));
"step 1"
if(result.bool){
player.logSkill('lingdong');

View File

@ -1151,7 +1151,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
trigger:{global:'useCard'},
filter:function(event,player){
return event.card.name=='sha'&&event.cards.length&&
event.player.isFriendOf(player)&&get.cardCount(true,event.player)==1;
event.player.isFriendOf(player)&&event.player.countUsed()==1;
},
silent:true,
content:function(){

View File

@ -830,7 +830,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
return list;
},
getActCount:function(){
return get.cardCount(true,this)+(this.actused||0)
return this.countUsed()+(this.actused||0)
},
getLeader:function(){
return this.side==game.me.side?game.me:game.enemy;