This commit is contained in:
libccy 2017-03-27 16:48:22 +08:00
parent e08ea8ff58
commit ab713a8101
36 changed files with 1645 additions and 1645 deletions

View File

@ -116,12 +116,12 @@ card.extra={
type:'trick', type:'trick',
enable:true, enable:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(player!=game.me&&player.num('h')<2) return false; if(player!=game.me&&player.countCards('h')<2) return false;
return target.num('h')>0; return target.countCards('h')>0;
}, },
content:function(){ content:function(){
"step 0" "step 0"
if(target.get('h').length==0){ if(target.countCards('h')==0){
event.finish(); event.finish();
return; return;
} }
@ -168,7 +168,7 @@ card.extra={
}, },
result:{ result:{
player:function(player){ player:function(player){
var nh=player.num('h'); var nh=player.countCards('h');
if(nh<=player.hp&&nh<=4&&_status.event.name=='chooseToUse'){ if(nh<=player.hp&&nh<=4&&_status.event.name=='chooseToUse'){
if(typeof _status.event.filterCard=='function'&& if(typeof _status.event.filterCard=='function'&&
_status.event.filterCard({name:'huogong'})){ _status.event.filterCard({name:'huogong'})){
@ -183,8 +183,8 @@ card.extra={
return 0; return 0;
}, },
target:function(player,target){ target:function(player,target){
if(target.hasSkill('huogong2')||target.num('h')==0) return 0; if(target.hasSkill('huogong2')||target.countCards('h')==0) return 0;
if(player.num('h')<=1) return 0; if(player.countCards('h')<=1) return 0;
if(target==player){ if(target==player){
if(typeof _status.event.filterCard=='function'&& if(typeof _status.event.filterCard=='function'&&
_status.event.filterCard({name:'huogong'})){ _status.event.filterCard({name:'huogong'})){
@ -273,7 +273,7 @@ card.extra={
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){
return -1-target.get('h').length; return -1-target.countCards('h');
} }
}, },
tag:{ tag:{
@ -402,7 +402,7 @@ card.extra={
filter:function(event){ filter:function(event){
if(event.parent.name=='_lianhuan'||event.parent.name=='_lianhuan2') return false; if(event.parent.name=='_lianhuan'||event.parent.name=='_lianhuan2') return false;
if(event.card&&event.card.name=='sha'){ if(event.card&&event.card.name=='sha'){
if(event.player.get('h').length==0) return true; if(event.player.countCards('h')==0) return true;
} }
return false; return false;
}, },
@ -413,7 +413,7 @@ card.extra={
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target,current){ target:function(card,player,target,current){
if(card.name=='sha'&&target.get('h').length==0) return [1,-2]; if(card.name=='sha'&&target.countCards('h')==0) return [1,-2];
} }
} }
} }

View File

@ -265,7 +265,7 @@ card.gujian={
if(target.hasSha()) return 2; if(target.hasSha()) return 2;
} }
else{ else{
var nh=target.num('h'); var nh=target.countCards('h');
if(nh>=3) return 1; if(nh>=3) return 1;
if(target.hasSha()) return 1; if(target.hasSha()) return 1;
if(nh&&Math.random()<0.5) return 1; if(nh&&Math.random()<0.5) return 1;
@ -312,7 +312,7 @@ card.gujian={
range:{global:1}, range:{global:1},
content:function(){ content:function(){
target.$gain2(cards); target.$gain2(cards);
target.discard(target.get('j')); target.discard(target.getCards('j'));
target.storage.molicha=card; target.storage.molicha=card;
target.storage.molicha_markcount=5; target.storage.molicha_markcount=5;
target.addSkill('molicha'); target.addSkill('molicha');
@ -322,7 +322,7 @@ card.gujian={
value:4, value:4,
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.num('j')) return 2; if(target.countCards('j')) return 2;
return 1; return 1;
} }
} }
@ -351,7 +351,7 @@ card.gujian={
if(target.hasSha()) return 2; if(target.hasSha()) return 2;
} }
else{ else{
var nh=target.num('h'); var nh=target.countCards('h');
if(nh>=3) return 1; if(nh>=3) return 1;
if(target.hasSha()) return 1; if(target.hasSha()) return 1;
if(nh&&Math.random()<0.5) return 1; if(nh&&Math.random()<0.5) return 1;
@ -452,11 +452,11 @@ card.gujian={
type:'basic', type:'basic',
enable:true, enable:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.num('he')>0; return target.countCards('he')>0;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
target.chooseToDiscard('he',[1,target.num('he')],'弃置任意张牌并摸等量的牌').ai=function(card){ target.chooseToDiscard('he',[1,target.countCards('he')],'弃置任意张牌并摸等量的牌').ai=function(card){
return 6-ai.get.value(card); return 6-ai.get.value(card);
} }
'step 1' 'step 1'
@ -470,7 +470,7 @@ card.gujian={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target==player){ if(target==player){
var cards=player.get('he'); var cards=player.getCards('he');
var num=-1; var num=-1;
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
if(ai.get.value(cards[i])<6) num++; if(ai.get.value(cards[i])<6) num++;
@ -481,10 +481,10 @@ card.gujian={
return Math.max(0,num); return Math.max(0,num);
} }
else{ else{
if(!player.needsToDiscard()&&target.num('he')<=3){ if(!player.needsToDiscard()&&target.countCards('he')<=3){
return 0; return 0;
} }
return target.num('he')/2; return target.countCards('he')/2;
} }
} }
} }
@ -537,11 +537,11 @@ card.gujian={
enable:true, enable:true,
wuxieable:true, wuxieable:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.num('h')>0&&!target.hasSkill('bingpotong'); return target.countCards('h')>0&&!target.hasSkill('bingpotong');
}, },
content:function(){ content:function(){
"step 0" "step 0"
if(target.num('h')==0||player.num('h')==0){ if(target.countCards('h')==0||player.countCards('h')==0){
event.finish(); event.finish();
return; return;
} }
@ -604,7 +604,7 @@ card.gujian={
}, },
result:{ result:{
player:function(player,target){ player:function(player,target){
if(player.num('h')<=Math.min(5,Math.max(2,player.hp))&&_status.event.name=='chooseToUse'){ if(player.countCards('h')<=Math.min(5,Math.max(2,player.hp))&&_status.event.name=='chooseToUse'){
if(typeof _status.event.filterCard=='function'&& if(typeof _status.event.filterCard=='function'&&
_status.event.filterCard({name:'dujian'})){ _status.event.filterCard({name:'dujian'})){
return -10; return -10;
@ -618,7 +618,7 @@ card.gujian={
return 0; return 0;
}, },
target:function(player,target){ target:function(player,target){
if(player.num('h')<=1) return 0; if(player.countCards('h')<=1) return 0;
return -1.5; return -1.5;
} }
}, },
@ -672,15 +672,15 @@ card.gujian={
fullskin:true, fullskin:true,
wuxieable:true, wuxieable:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.num('he')>0; return target!=player&&target.countCards('he')>0;
}, },
changeTarget:function(player,targets){ changeTarget:function(player,targets){
game.filterPlayer(function(current){ game.filterPlayer(function(current){
return get.distance(targets[0],current,'pure')==1&&current.num('he'); return get.distance(targets[0],current,'pure')==1&&current.countCards('he');
},targets); },targets);
}, },
content:function(){ content:function(){
var he=target.get('he'); var he=target.getCards('he');
if(he.length){ if(he.length){
target.discard(he.randomGet()).delay=false; target.discard(he.randomGet()).delay=false;
} }
@ -700,7 +700,7 @@ card.gujian={
result:{ result:{
player:function(player,target){ player:function(player,target){
return game.countPlayer(function(current){ return game.countPlayer(function(current){
if(current==target||(get.distance(target,current,'pure')==1&&current.num('he'))){ if(current==target||(get.distance(target,current,'pure')==1&&current.countCards('he'))){
var att=ai.get.attitude(player,current); var att=ai.get.attitude(player,current);
if(att>0){ if(att>0){
return -1; return -1;
@ -773,7 +773,7 @@ card.gujian={
content:function(){ content:function(){
var list=[1,2,3,4,5,6]; var list=[1,2,3,4,5,6];
if(player.getEnemies().contains(target)){ if(player.getEnemies().contains(target)){
if(target.num('he')==0){ if(target.countCards('he')==0){
list.remove(1); list.remove(1);
} }
if(target.isLinked()){ if(target.isLinked()){
@ -783,7 +783,7 @@ card.gujian={
list.remove(5); list.remove(5);
} }
switch(list.randomGet()){ switch(list.randomGet()){
case 1:target.discard(target.get('he').randomGet());break; case 1:target.discard(target.getCards('he').randomGet());break;
case 2:target.loseHp();break; case 2:target.loseHp();break;
case 3:target.damage();break; case 3:target.damage();break;
case 4:if(!target.isLinked()) target.link();break; case 4:if(!target.isLinked()) target.link();break;
@ -810,7 +810,7 @@ card.gujian={
if(target.isHealthy()){ if(target.isHealthy()){
list.remove(2); list.remove(2);
} }
if(!target.num('j')){ if(!target.countCards('j')){
list.remove(5); list.remove(5);
} }
if(!target.isLinked()&&!target.isTurnedOver()){ if(!target.isLinked()&&!target.isTurnedOver()){
@ -824,7 +824,7 @@ card.gujian={
case 2:target.recover();break; case 2:target.recover();break;
case 3:target.changeHujia();break; case 3:target.changeHujia();break;
case 4:target.addTempSkill('qianxing',{player:'phaseBegin'});break; case 4:target.addTempSkill('qianxing',{player:'phaseBegin'});break;
case 5:target.discard(target.get('j'));break; case 5:target.discard(target.getCards('j'));break;
case 6:{ case 6:{
if(target.isLinked()) target.link(); if(target.isLinked()) target.link();
if(target.isTurnedOver()) target.turnOver(); if(target.isTurnedOver()) target.turnOver();
@ -868,7 +868,7 @@ card.gujian={
return 0.5; return 0.5;
} }
else{ else{
switch(target.num('h')){ switch(target.countCards('h')){
case 0:return 2; case 0:return 2;
case 1:return 1.5; case 1:return 1.5;
case 2:return 1; case 2:return 1;
@ -901,7 +901,7 @@ card.gujian={
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.num('h')>=3||target.needsToDiscard()) return -1.5; if(target.countCards('h')>=3||target.needsToDiscard()) return -1.5;
return 0; return 0;
} }
} }
@ -1305,14 +1305,14 @@ card.gujian={
if(Math.random()<0.65){ if(Math.random()<0.65){
var list=player.getEnemies(); var list=player.getEnemies();
for(var i=0;i<list.length;i++){ for(var i=0;i<list.length;i++){
if(!list[i].num('he')){ if(!list[i].countCards('he')){
list.splice(i--,1); list.splice(i--,1);
} }
} }
var target=list.randomGet(); var target=list.randomGet();
if(target){ if(target){
player.logSkill('mapodoufu',target); player.logSkill('mapodoufu',target);
target.discard(target.get('he').randomGet()); target.discard(target.getCards('he').randomGet());
target.addExpose(0.2); target.addExpose(0.2);
} }
} }
@ -1362,7 +1362,7 @@ card.gujian={
filterCard:true, filterCard:true,
viewAs:{name:'sha'}, viewAs:{name:'sha'},
viewAsFilter:function(player){ viewAsFilter:function(player){
if(!player.num('h')) return false; if(!player.countCards('h')) return false;
}, },
prompt:'将一张手牌当杀使用', prompt:'将一张手牌当杀使用',
check:function(card){return 5-ai.get.value(card)}, check:function(card){return 5-ai.get.value(card)},
@ -1372,7 +1372,7 @@ card.gujian={
}, },
skillTagFilter:function(player,tag,arg){ skillTagFilter:function(player,tag,arg){
if(arg!='use') return false; if(arg!='use') return false;
if(!player.num('h')) return false; if(!player.countCards('h')) return false;
}, },
}, },
}, },
@ -1380,13 +1380,13 @@ card.gujian={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.num('h')>0; return target!=player&&target.countCards('h')>0;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
player.loseHp(); player.loseHp();
'step 1' 'step 1'
var hs=target.get('h'); var hs=target.getCards('h');
if(hs.length){ if(hs.length){
var card=hs.randomGet(); var card=hs.randomGet();
player.gain(card,target); player.gain(card,target);
@ -1418,7 +1418,7 @@ card.gujian={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(ai.get.attitude(player,target)>=0) return 0; if(ai.get.attitude(player,target)>=0) return 0;
var nh=target.num('h'); var nh=target.countCards('h');
var num=-1/Math.sqrt(1+nh); var num=-1/Math.sqrt(1+nh);
if(player.hp>=4) return num; if(player.hp>=4) return num;
if(player.hp>=3&&nh<=2) return num; if(player.hp>=3&&nh<=2) return num;
@ -1436,13 +1436,13 @@ card.gujian={
return !player.hasSkill('yuheng_plus_temp'); return !player.hasSkill('yuheng_plus_temp');
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.num('h')>0; return target!=player&&target.countCards('h')>0;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
player.loseHp(); player.loseHp();
'step 1' 'step 1'
var hs=target.get('h'); var hs=target.getCards('h');
if(hs.length){ if(hs.length){
var card=hs.randomGet(); var card=hs.randomGet();
player.gain(card,target); player.gain(card,target);
@ -1473,7 +1473,7 @@ card.gujian={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(ai.get.attitude(player,target)>=0) return 0; if(ai.get.attitude(player,target)>=0) return 0;
var nh=target.num('h'); var nh=target.countCards('h');
var num=-1/Math.sqrt(1+nh); var num=-1/Math.sqrt(1+nh);
if(player.hp>=4) return num; if(player.hp>=4) return num;
if(player.hp>=3&&nh<=2) return num; if(player.hp>=3&&nh<=2) return num;
@ -1486,13 +1486,13 @@ card.gujian={
yuheng_pro_skill:{ yuheng_pro_skill:{
enable:'phaseUse', enable:'phaseUse',
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.num('h')>0; return target!=player&&target.countCards('h')>0;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
player.loseHp(); player.loseHp();
'step 1' 'step 1'
var hs=target.get('h'); var hs=target.getCards('h');
if(hs.length){ if(hs.length){
var card=hs.randomGet(); var card=hs.randomGet();
player.gain(card,target); player.gain(card,target);
@ -1511,7 +1511,7 @@ card.gujian={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(ai.get.attitude(player,target)>=0) return 0; if(ai.get.attitude(player,target)>=0) return 0;
var nh=target.num('h'); var nh=target.countCards('h');
var num=-1/Math.sqrt(1+nh); var num=-1/Math.sqrt(1+nh);
if(player.hp>=4) return num; if(player.hp>=4) return num;
if(player.hp>=3&&nh<=2) return num; if(player.hp>=3&&nh<=2) return num;

View File

@ -87,7 +87,7 @@ card.guozhan={
useful:2, useful:2,
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.num('he')>=2) return 1; if(target.countCards('he')>=2) return 1;
return 0; return 0;
} }
} }
@ -97,7 +97,7 @@ card.guozhan={
fullskin:true, fullskin:true,
type:'trick', type:'trick',
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.num('e')>0; return target!=player&&target.countCards('e')>0;
}, },
enable:true, enable:true,
content:function(){ content:function(){
@ -106,14 +106,14 @@ card.guozhan={
if(ai.get.damageEffect(player,event.player,player,'thunder')>=0){ if(ai.get.damageEffect(player,event.player,player,'thunder')>=0){
return 'take_damage'; return 'take_damage';
} }
if(player.hp>=3&&player.num('e')>=2){ if(player.hp>=3&&player.countCards('e')>=2){
return 'take_damage'; return 'take_damage';
} }
return 'discard_card'; return 'discard_card';
}); });
'step 1' 'step 1'
if(result.control=='discard_card'){ if(result.control=='discard_card'){
target.discard(target.get('e')); target.discard(target.getCards('e'));
} }
else{ else{
target.damage('thunder'); target.damage('thunder');
@ -130,7 +130,7 @@ card.guozhan={
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){
return -target.num('e'); return -target.countCards('e');
} }
} }
} }
@ -378,7 +378,7 @@ card.guozhan={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.hasSkillTag('nofire')||target.hasSkillTag('nodamage')) return 0; if(target.hasSkillTag('nofire')||target.hasSkillTag('nodamage')) return 0;
if(target.hasSkill('xuying')&&target.num('h')==0) return 0; if(target.hasSkill('xuying')&&target.countCards('h')==0) return 0;
if(!target.isLinked()){ if(!target.isLinked()){
return ai.get.damageEffect(target,player,target,'fire'); return ai.get.damageEffect(target,player,target,'fire');
} }
@ -429,7 +429,7 @@ card.guozhan={
chongzhu:true, chongzhu:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(player==target) return false; if(player==target) return false;
return (target.get('h').length||target.isUnseen(2)); return (target.countCards('h')||target.isUnseen(2));
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -438,7 +438,7 @@ card.guozhan={
} }
player.storage.zhibi.add(target); player.storage.zhibi.add(target);
var controls=[]; var controls=[];
if(target.get('h').length) controls.push('手牌'); if(target.countCards('h')) controls.push('手牌');
if(target.isUnseen(0)) controls.push('主将'); if(target.isUnseen(0)) controls.push('主将');
if(target.isUnseen(1)) controls.push('副将'); if(target.isUnseen(1)) controls.push('副将');
if(controls.length>1){ if(controls.length>1){
@ -450,7 +450,7 @@ card.guozhan={
var str=get.translation(target)+'的'; var str=get.translation(target)+'的';
if(result.control){ if(result.control){
if(result.control=='手牌'){ if(result.control=='手牌'){
content=[str+'手牌',target.get('h')]; content=[str+'手牌',target.getCards('h')];
game.log(player,'观看了',target,'的手牌'); game.log(player,'观看了',target,'的手牌');
} }
else if(result.control=='主将'){ else if(result.control=='主将'){
@ -462,8 +462,8 @@ card.guozhan={
game.log(player,'观看了',target,'的副将'); game.log(player,'观看了',target,'的副将');
} }
} }
else if(target.get('h').length){ else if(target.countCards('h')){
content=[str+'手牌',target.get('h')]; content=[str+'手牌',target.getCards('h')];
game.log(player,'观看了',target,'的手牌'); game.log(player,'观看了',target,'的手牌');
} }
else if(target.isUnseen(0)){ else if(target.isUnseen(0)){
@ -484,7 +484,7 @@ card.guozhan={
}, },
result:{ result:{
player:function(player,target){ player:function(player,target){
if(player.num('h')<=player.hp) return 0; if(player.countCards('h')<=player.hp) return 0;
if(player.storage.zhibi&&player.storage.zhibi.contains(target)) return 0; if(player.storage.zhibi&&player.storage.zhibi.contains(target)) return 0;
return target.isUnseen()?1:0; return target.isUnseen()?1:0;
} }
@ -527,7 +527,7 @@ card.guozhan={
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){
var hs=target.get('h'); var hs=target.getCards('h');
if(hs.length<=1){ if(hs.length<=1){
if(target==player&&hs[0].name=='yiyi'){ if(target==player&&hs[0].name=='yiyi'){
return 0; return 0;
@ -615,7 +615,7 @@ card.guozhan={
priority:5, priority:5,
logTarget:'target', logTarget:'target',
filter:function(event,player){ filter:function(event,player){
return event.target.num('he'); return event.target.countCards('he');
}, },
content:function(){ content:function(){
trigger.target.chooseToDiscard('he',true); trigger.target.chooseToDiscard('he',true);
@ -836,7 +836,7 @@ card.guozhan={
content:function(){ content:function(){
"step 0" "step 0"
player.removeSkill('xietianzi'); player.removeSkill('xietianzi');
if(player.num('he')>0){ if(player.countCards('he')>0){
player.chooseToDiscard('he','是否弃置一张牌并获得一个额外回合?').set('ai',function(card){ player.chooseToDiscard('he','是否弃置一张牌并获得一个额外回合?').set('ai',function(card){
return 10-ai.get.value(card); return 10-ai.get.value(card);
}); });
@ -1069,7 +1069,7 @@ card.guozhan={
trigger:{source:'damageAfter'}, trigger:{source:'damageAfter'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
if(player.num('h')==0) return false; if(player.countCards('h')==0) return false;
if(!event.card) return false; if(!event.card) return false;
if(event.card.name!='sha') return false; if(event.card.name!='sha') return false;
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){

View File

@ -10,7 +10,7 @@ card.hearth={
'step 0' 'step 0'
target.damage('fire'); target.damage('fire');
'step 1' 'step 1'
var hs=player.get('h'); var hs=player.getCards('h');
if(hs.length){ if(hs.length){
player.discard(hs.randomGet()); player.discard(hs.randomGet());
} }
@ -24,8 +24,8 @@ card.hearth={
result:{ result:{
player:function(player,target){ player:function(player,target){
if(player==target) return -1; if(player==target) return -1;
if(player.num('h')>=player.hp) return -0.1; if(player.countCards('h')>=player.hp) return -0.1;
if(player.num('h')>1) return -0.5; if(player.countCards('h')>1) return -0.5;
return 0; return 0;
}, },
target:-1 target:-1
@ -64,11 +64,11 @@ card.hearth={
type:'trick', type:'trick',
enable:true, enable:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return player!=target&&target.num('hej')>0; return player!=target&&target.countCards('hej')>0;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
if(target.num('hej')){ if(target.countCards('hej')){
var next=player.discardPlayerCard('hej',target,true); var next=player.discardPlayerCard('hej',target,true);
next.visible=true; next.visible=true;
next.delay=false; next.delay=false;
@ -93,15 +93,15 @@ card.hearth={
useful:3, useful:3,
result:{ result:{
target:function(player,target){ target:function(player,target){
var es=target.get('e'); var es=target.getCards('e');
var nh=target.num('h'); var nh=target.countCards('h');
var noe=(es.length==0||target.hasSkillTag('noe')); var noe=(es.length==0||target.hasSkillTag('noe'));
var noe2=(es.length==1&&es[0].name=='baiyin'&&target.hp<target.maxHp); var noe2=(es.length==1&&es[0].name=='baiyin'&&target.hp<target.maxHp);
var noh=(nh==0||target.hasSkillTag('noh')); var noh=(nh==0||target.hasSkillTag('noh'));
if(noh&&noe) return 0; if(noh&&noe) return 0;
if(noh&&noe2) return 0.01; if(noh&&noe2) return 0.01;
if(ai.get.attitude(player,target)<=0) return (target.num('he'))?-1.5:1.5; if(ai.get.attitude(player,target)<=0) return (target.countCards('he'))?-1.5:1.5;
var js=target.get('j'); var js=target.getCards('j');
if(js.length){ if(js.length){
var jj=js[0].viewAs?{name:js[0].viewAs}:js[0]; var jj=js[0].viewAs?{name:js[0].viewAs}:js[0];
if(jj.name=='zhaomingdan') return 3; if(jj.name=='zhaomingdan') return 3;
@ -161,7 +161,7 @@ card.hearth={
'step 2' 'step 2'
game.delay(0.5); game.delay(0.5);
'step 3' 'step 3'
if(target.num('h')){ if(target.countCards('h')){
target.chooseToDiscard('h',true); target.chooseToDiscard('h',true);
} }
}, },
@ -171,7 +171,7 @@ card.hearth={
useful:2, useful:2,
result:{ result:{
target:function(player,target){ target:function(player,target){
return Math.max(0,2-target.num('e'))+(target.num('h')?0:0.5); return Math.max(0,2-target.countCards('e'))+(target.countCards('h')?0:0.5);
}, },
}, },
tag:{ tag:{
@ -184,12 +184,12 @@ card.hearth={
type:'trick', type:'trick',
enable:true, enable:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(player!=game.me&&player.num('h')<2) return false; if(player!=game.me&&player.countCards('h')<2) return false;
return target.num('h')>0; return target.countCards('h')>0;
}, },
content:function(){ content:function(){
"step 0" "step 0"
if(target.get('h').length==0){ if(target.countCards('h')==0){
event.finish(); event.finish();
return; return;
} }
@ -234,7 +234,7 @@ card.hearth={
}, },
result:{ result:{
player:function(player){ player:function(player){
var nh=player.num('h'); var nh=player.countCards('h');
if(nh<=player.hp&&nh<=4&&_status.event.name=='chooseToUse'){ if(nh<=player.hp&&nh<=4&&_status.event.name=='chooseToUse'){
if(typeof _status.event.filterCard=='function'&& if(typeof _status.event.filterCard=='function'&&
_status.event.filterCard({name:'shandianjian'})){ _status.event.filterCard({name:'shandianjian'})){
@ -249,8 +249,8 @@ card.hearth={
return 0; return 0;
}, },
target:function(player,target){ target:function(player,target){
if(target.hasSkill('huogong2')||target.num('h')==0) return 0; if(target.hasSkill('huogong2')||target.countCards('h')==0) return 0;
if(player.num('h')<=1) return 0; if(player.countCards('h')<=1) return 0;
if(target==player){ if(target==player){
if(typeof _status.event.filterCard=='function'&& if(typeof _status.event.filterCard=='function'&&
_status.event.filterCard({name:'shandianjian'})){ _status.event.filterCard({name:'shandianjian'})){
@ -307,17 +307,17 @@ card.hearth={
enable:true, enable:true,
type:'trick', type:'trick',
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return player!=target&&target.num('h')>0; return player!=target&&target.countCards('h')>0;
}, },
selectTarget:1, selectTarget:1,
content:function(){ content:function(){
'step 0' 'step 0'
var hs=target.get('h'); var hs=target.getCards('h');
if(hs.length){ if(hs.length){
target.discard(hs.randomGet()); target.discard(hs.randomGet());
} }
'step 1' 'step 1'
if(!target.num('h')){ if(!target.countCards('h')){
player.draw(); player.draw();
} }
}, },
@ -328,7 +328,7 @@ card.hearth={
result:{ result:{
target:-1, target:-1,
player:function(player,target){ player:function(player,target){
if(target.num('h')==1) return 1; if(target.countCards('h')==1) return 1;
} }
} }
} }
@ -438,14 +438,14 @@ card.hearth={
if(event.num){ if(event.num){
var enemies=event.current.getEnemies(); var enemies=event.current.getEnemies();
for(var i=0;i<enemies.length;i++){ for(var i=0;i<enemies.length;i++){
if(!enemies[i].num('h')){ if(!enemies[i].countCards('h')){
enemies.splice(i--,1); enemies.splice(i--,1);
} }
} }
if(enemies.length){ if(enemies.length){
var enemy=enemies.randomGet(); var enemy=enemies.randomGet();
event.current.line(enemy); event.current.line(enemy);
enemy.discard(enemy.get('h').randomGet()); enemy.discard(enemy.getCards('h').randomGet());
event.current=enemy; event.current=enemy;
event.num--; event.num--;
event.redo(); event.redo();
@ -476,7 +476,7 @@ card.hearth={
content:function(){ content:function(){
target.gainMaxHp(); target.gainMaxHp();
target.recover(); target.recover();
target.discard(target.get('h')); target.discard(target.getCards('h'));
}, },
ai:{ ai:{
basic:{ basic:{
@ -487,7 +487,7 @@ card.hearth={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.num('h','tao')) return 0; if(target.num('h','tao')) return 0;
var nh=target.num('h'); var nh=target.countCards('h');
if(nh<=2) return 1; if(nh<=2) return 1;
if(target.hp==1&&target.maxHp>2) return 1; if(target.hp==1&&target.maxHp>2) return 1;
return 0; return 0;
@ -506,7 +506,7 @@ card.hearth={
}, },
type:'trick', type:'trick',
content:function(){ content:function(){
var num=player.num('h')-target.num('h'); var num=player.countCards('h')-target.countCards('h');
if(num<-3) num=-3; if(num<-3) num=-3;
if(num>3) num=3; if(num>3) num=3;
if(num>0){ if(num>0){
@ -525,7 +525,7 @@ card.hearth={
useful:2, useful:2,
result:{ result:{
target:function(player,target){ target:function(player,target){
var nh=player.num('h')-target.num('h'); var nh=player.countCards('h')-target.countCards('h');
if(!player.hasSkill('jizhi')){ if(!player.hasSkill('jizhi')){
nh--; nh--;
} }
@ -534,7 +534,7 @@ card.hearth={
return 0; return 0;
}, },
player:function(player,target){ player:function(player,target){
var nh=target.num('h')-player.num('h'); var nh=target.countCards('h')-player.countCards('h');
if(!player.hasSkill('jizhi')){ if(!player.hasSkill('jizhi')){
nh++; nh++;
} }
@ -627,7 +627,7 @@ card.hearth={
target:function(player,target){ target:function(player,target){
if(target.hasSkillTag('nothunder')) return 0; if(target.hasSkillTag('nothunder')) return 0;
if(player.hasUnknown(2)) return 0; if(player.hasUnknown(2)) return 0;
var nh=target.num('he'); var nh=target.countCards('he');
if(target==player) nh--; if(target==player) nh--;
if(nh==2) return -2.5; if(nh==2) return -2.5;
if(nh==1) return -3; if(nh==1) return -3;

View File

@ -87,7 +87,7 @@ card.sp={
}, },
content:function(){ content:function(){
'step 0' 'step 0'
if(!player.num('h')){ if(!player.countCards('h')){
event.finish(); event.finish();
} }
else{ else{
@ -99,11 +99,11 @@ card.sp={
player.$giveAuto(result.cards,event.target1); player.$giveAuto(result.cards,event.target1);
event.target1.gain(result.cards,player); event.target1.gain(result.cards,player);
'step 2' 'step 2'
if(!event.target1.num('h')){ if(!event.target1.countCards('h')){
event.finish(); event.finish();
} }
else{ else{
var he=event.target1.get('he'); var he=event.target1.getCards('he');
if(he.length<=2){ if(he.length<=2){
event.directresult=he; event.directresult=he;
} }
@ -128,7 +128,7 @@ card.sp={
result:{ result:{
target:function(player,target){ target:function(player,target){
var ok=false; var ok=false;
var hs=player.get('h'); var hs=player.getCards('h');
if(hs.length<=1) return 0; if(hs.length<=1) return 0;
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
if(ai.get.value(hs[i])<=5){ if(ai.get.value(hs[i])<=5){
@ -138,7 +138,7 @@ card.sp={
} }
if(!ok) return 0; if(!ok) return 0;
if(ui.selected.targets.length==1) return 2; if(ui.selected.targets.length==1) return 2;
if(target.num('he')==0) return 0; if(target.countCards('he')==0) return 0;
if(player.hasFriend()) return -1; if(player.hasFriend()) return -1;
return 0; return 0;
} }
@ -154,7 +154,7 @@ card.sp={
'step 0' 'step 0'
target.draw(3); target.draw(3);
'step 1' 'step 1'
if(target.num('he',{type:'basic'})<target.num('he')){ if(target.num('he',{type:'basic'})<target.countCards('he')){
target.chooseToDiscard('弃置一张非基本牌(或取消并弃置两张牌)','he',function(card){ target.chooseToDiscard('弃置一张非基本牌(或取消并弃置两张牌)','he',function(card){
return get.type(card)!='basic'; return get.type(card)!='basic';
}).set('ai',function(card){ }).set('ai',function(card){
@ -181,7 +181,7 @@ card.sp={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.num('j','lebu')) return 0; if(target.num('j','lebu')) return 0;
return Math.max(1,2-target.num('h')/10); return Math.max(1,2-target.countCards('h')/10);
} }
} }
} }
@ -262,7 +262,7 @@ card.sp={
check:function(card){ check:function(card){
if(card.name=='du') return 20; if(card.name=='du') return 20;
var player=_status.event.player; var player=_status.event.player;
var nh=player.num('h'); var nh=player.countCards('h');
if(!player.needsToDiscard()){ if(!player.needsToDiscard()){
if(nh<3) return 0; if(nh<3) return 0;
if(nh==3) return 5-ai.get.value(card); if(nh==3) return 5-ai.get.value(card);
@ -289,7 +289,7 @@ card.sp={
},muniu,muniu.cards); },muniu,muniu.cards);
}, },
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0; return player.countCards('h')>0;
}, },
prepare:function(cards,player){ prepare:function(cards,player){
player.$give(1,player,false); player.$give(1,player,false);
@ -445,7 +445,7 @@ card.sp={
check:function(button){ check:function(button){
if(button.link.name=='du') return -2; if(button.link.name=='du') return -2;
var player=_status.event.player; var player=_status.event.player;
if(button.link.name=='xingjiegoutong'&&player.num('h')>1) return -2; if(button.link.name=='xingjiegoutong'&&player.countCards('h')>1) return -2;
if(get.select(get.info(button.link).selectTarget)[1]==-1){ if(get.select(get.info(button.link).selectTarget)[1]==-1){
if(get.type(button.link)=='delay') return -1; if(get.type(button.link)=='delay') return -1;
if(get.type(button.link)=='equip'){ if(get.type(button.link)=='equip'){

View File

@ -396,7 +396,7 @@ card.standard={
ai:{ ai:{
basic:{ basic:{
equipValue:function(card,player){ equipValue:function(card,player){
var num=2.5+player.num('h')/3; var num=2.5+player.countCards('h')/3;
return Math.min(num,4); return Math.min(num,4);
} }
} }
@ -411,7 +411,7 @@ card.standard={
ai:{ ai:{
basic:{ basic:{
equipValue:function(card,player){ equipValue:function(card,player){
var num=2.5+(player.num('h')+player.num('e'))/2.5; var num=2.5+(player.countCards('h')+player.countCards('e'))/2.5;
return Math.min(num,5); return Math.min(num,5);
} }
} }
@ -660,7 +660,7 @@ card.standard={
ai:{ ai:{
wuxie:function(target,card,player,viewer){ wuxie:function(target,card,player,viewer){
if(ai.get.attitude(viewer,target)>0&&target.num('h','sha')){ if(ai.get.attitude(viewer,target)>0&&target.num('h','sha')){
if(!target.num('h')||target.hp==1||Math.random()<0.7) return 0; if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0;
} }
}, },
basic:{ basic:{
@ -671,7 +671,7 @@ card.standard={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(player.hasUnknown(2)&&get.mode()!='guozhan') return 0; if(player.hasUnknown(2)&&get.mode()!='guozhan') return 0;
var nh=target.num('h'); var nh=target.countCards('h');
if(get.mode()=='identity'){ if(get.mode()=='identity'){
if(target.isZhu&&nh<=2&&target.hp<=1) return -100; if(target.isZhu&&nh<=2&&target.hp<=1) return -100;
} }
@ -718,7 +718,7 @@ card.standard={
ai:{ ai:{
wuxie:function(target,card,player,viewer){ wuxie:function(target,card,player,viewer){
if(ai.get.attitude(viewer,target)>0&&target.num('h','shan')){ if(ai.get.attitude(viewer,target)>0&&target.num('h','shan')){
if(!target.num('h')||target.hp==1||Math.random()<0.7) return 0; if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0;
} }
}, },
basic:{ basic:{
@ -729,7 +729,7 @@ card.standard={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(player.hasUnknown(2)&&get.mode()!='guozhan') return 0; if(player.hasUnknown(2)&&get.mode()!='guozhan') return 0;
var nh=target.num('h'); var nh=target.countCards('h');
if(get.mode()=='identity'){ if(get.mode()=='identity'){
if(target.isZhu&&nh<=2&&target.hp<=1) return -100; if(target.isZhu&&nh<=2&&target.hp<=1) return -100;
} }
@ -873,7 +873,7 @@ card.standard={
if(hs1.length>hs2.length+1){ if(hs1.length>hs2.length+1){
return -2; return -2;
} }
var hsx=target.get('h'); var hsx=target.getCards('h');
if(hsx.length>2&&hs2.length==0&&hsx[0].number<6){ if(hsx.length>2&&hs2.length==0&&hsx[0].number<6){
return -2; return -2;
} }
@ -901,14 +901,14 @@ card.standard={
range:{global:1}, range:{global:1},
selectTarget:1, selectTarget:1,
postAi:function(targets){ postAi:function(targets){
return targets.length==1&&targets[0].num('j'); return targets.length==1&&targets[0].countCards('j');
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(player==target) return false; if(player==target) return false;
return (target.num('hej')>0); return (target.countCards('hej')>0);
}, },
content:function(){ content:function(){
if(target.num('hej')){ if(target.countCards('hej')){
player.gainPlayerCard('hej',target,true); player.gainPlayerCard('hej',target,true);
} }
}, },
@ -925,8 +925,8 @@ card.standard={
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){
if(ai.get.attitude(player,target)<=0) return (target.num('he')>0)?-1.5:1.5; if(ai.get.attitude(player,target)<=0) return (target.countCards('he')>0)?-1.5:1.5;
var js=target.get('j'); var js=target.getCards('j');
if(js.length){ if(js.length){
var jj=js[0].viewAs?{name:js[0].viewAs}:js[0]; var jj=js[0].viewAs?{name:js[0].viewAs}:js[0];
if(jj.name=='shunshou') return 3; if(jj.name=='shunshou') return 3;
@ -938,11 +938,11 @@ card.standard={
return -1.5; return -1.5;
}, },
player:function(player,target){ player:function(player,target){
if(ai.get.attitude(player,target)<0&&!target.num('he')){ if(ai.get.attitude(player,target)<0&&!target.countCards('he')){
return 0; return 0;
} }
if(ai.get.attitude(player,target)>1){ if(ai.get.attitude(player,target)>1){
var js=target.get('j'); var js=target.getCards('j');
if(js.length){ if(js.length){
var jj=js[0].viewAs?{name:js[0].viewAs}:js[0]; var jj=js[0].viewAs?{name:js[0].viewAs}:js[0];
if(jj.name=='shunshou') return 1; if(jj.name=='shunshou') return 1;
@ -969,14 +969,14 @@ card.standard={
enable:true, enable:true,
selectTarget:1, selectTarget:1,
postAi:function(targets){ postAi:function(targets){
return targets.length==1&&targets[0].num('j'); return targets.length==1&&targets[0].countCards('j');
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(player==target) return false; if(player==target) return false;
return (target.num('hej')>0); return (target.countCards('hej')>0);
}, },
content:function(){ content:function(){
if(target.num('hej')){ if(target.countCards('hej')){
player.discardPlayerCard('hej',target,true); player.discardPlayerCard('hej',target,true);
} }
}, },
@ -988,15 +988,15 @@ card.standard={
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){
var es=target.get('e'); var es=target.getCards('e');
var nh=target.num('h'); var nh=target.countCards('h');
var noe=(es.length==0||target.hasSkillTag('noe')); var noe=(es.length==0||target.hasSkillTag('noe'));
var noe2=(es.length==1&&es[0].name=='baiyin'&&target.hp<target.maxHp); var noe2=(es.length==1&&es[0].name=='baiyin'&&target.hp<target.maxHp);
var noh=(nh==0||target.hasSkillTag('noh')); var noh=(nh==0||target.hasSkillTag('noh'));
if(noh&&noe) return 0; if(noh&&noe) return 0;
if(noh&&noe2) return 0.01; if(noh&&noe2) return 0.01;
if(ai.get.attitude(player,target)<=0) return (target.num('he'))?-1.5:1.5; if(ai.get.attitude(player,target)<=0) return (target.countCards('he'))?-1.5:1.5;
var js=target.get('j'); var js=target.getCards('j');
if(js.length){ if(js.length){
var jj=js[0].viewAs?{name:js[0].viewAs}:js[0]; var jj=js[0].viewAs?{name:js[0].viewAs}:js[0];
if(jj.name=='guohe') return 3; if(jj.name=='guohe') return 3;
@ -1125,7 +1125,7 @@ card.standard={
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){
var num=target.hp-target.num('h')-2; var num=target.hp-target.countCards('h')-2;
if(num>-1) return -0.01; if(num>-1) return -0.01;
if(target.hp<3) num--; if(target.hp<3) num--;
if(target.isTurnedOver()) num/=2; if(target.isTurnedOver()) num/=2;
@ -1262,7 +1262,7 @@ card.standard={
if(get.population(target.identity)==1){ if(get.population(target.identity)==1){
if(target.maxHp>2&&target.hp<2) return 1; if(target.maxHp>2&&target.hp<2) return 1;
if(game.countPlayer()<3) return -1; if(game.countPlayer()<3) return -1;
if(target.hp<=2&&target.num('he')<=3) return 1; if(target.hp<=2&&target.countCards('he')<=3) return 1;
} }
} }
} }
@ -1306,11 +1306,11 @@ card.standard={
direct:true, direct:true,
audio:true, audio:true,
filter:function(event){ filter:function(event){
return event.target.get('he').length>0; return event.target.getCards('he').length>0;
}, },
content:function(){ content:function(){
"step 0" "step 0"
player.discardPlayerCard(get.prompt('hanbing'),'he',trigger.target,Math.min(2,trigger.target.num('he')),function(button){ player.discardPlayerCard(get.prompt('hanbing'),'he',trigger.target,Math.min(2,trigger.target.countCards('he')),function(button){
var trigger=_status.event.getTrigger(); var trigger=_status.event.getTrigger();
var player=_status.event.player; var player=_status.event.player;
var eff=ai.get.damageEffect(trigger.target,player,player); var eff=ai.get.damageEffect(trigger.target,player,player);
@ -1434,7 +1434,7 @@ card.standard={
position:'h', position:'h',
viewAs:{name:'sha'}, viewAs:{name:'sha'},
filter:function(event,player){ filter:function(event,player){
return player.num('h')>=2; return player.countCards('h')>=2;
}, },
audio:true, audio:true,
prompt:'将两张手牌当杀使用或打出', prompt:'将两张手牌当杀使用或打出',
@ -1445,7 +1445,7 @@ card.standard={
ai:{ ai:{
respondSha:true, respondSha:true,
skillTagFilter:function(player){ skillTagFilter:function(player){
return player.num('h')>=2; return player.countCards('h')>=2;
}, },
} }
}, },
@ -1454,7 +1454,7 @@ card.standard={
direct:true, direct:true,
audio:true, audio:true,
filter:function(event,player){ filter:function(event,player){
return player.num('he')>2; return player.countCards('he')>2;
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -1487,7 +1487,7 @@ card.standard={
selectTarget:function(card,player,range){ selectTarget:function(card,player,range){
if(card.name!='sha') return; if(card.name!='sha') return;
if(range[1]==-1) return; if(range[1]==-1) return;
var cards=player.get('h'); var cards=player.getCards('h');
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
if(cards[i].classList.contains('selected')==false) if(cards[i].classList.contains('selected')==false)
return; return;

View File

@ -5,11 +5,11 @@ card.swd={
type:'basic', type:'basic',
enable:true, enable:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.num('h')>0; return target.countCards('h')>0;
}, },
content:function(){ content:function(){
"step 0" "step 0"
if(target.num('h')==0||player.num('h')==0){ if(target.countCards('h')==0||player.countCards('h')==0){
event.finish(); event.finish();
return; return;
} }
@ -58,7 +58,7 @@ card.swd={
}, },
result:{ result:{
player:function(player,target){ player:function(player,target){
if(player.num('h')<=Math.min(5,Math.max(2,player.hp))&&_status.event.name=='chooseToUse'){ if(player.countCards('h')<=Math.min(5,Math.max(2,player.hp))&&_status.event.name=='chooseToUse'){
if(typeof _status.event.filterCard=='function'&& if(typeof _status.event.filterCard=='function'&&
_status.event.filterCard({name:'dujian'})){ _status.event.filterCard({name:'dujian'})){
return -10; return -10;
@ -72,8 +72,8 @@ card.swd={
return 0; return 0;
}, },
target:function(player,target){ target:function(player,target){
if(target.hasSkill('dujian2')||target.num('h')==0) return 0; if(target.hasSkill('dujian2')||target.countCards('h')==0) return 0;
if(player.num('h')<=1) return 0; if(player.countCards('h')<=1) return 0;
return -1.5; return -1.5;
} }
}, },
@ -425,7 +425,7 @@ card.swd={
target:function(player,target){ target:function(player,target){
var num=1; var num=1;
if(target.hp<2) num=0.5; if(target.hp<2) num=0.5;
return num/Math.sqrt(Math.max(1,target.num('h'))); return num/Math.sqrt(Math.max(1,target.countCards('h')));
} }
} }
} }
@ -513,7 +513,7 @@ card.swd={
}, },
content:function(){ content:function(){
"step 0" "step 0"
if(target.num('h')){ if(target.countCards('h')){
var next=target.chooseToDiscard('机关火筒:弃置一张手牌或受到一点火焰伤害'); var next=target.chooseToDiscard('机关火筒:弃置一张手牌或受到一点火焰伤害');
next.set('ai',function(card){ next.set('ai',function(card){
var evt=_status.event.getParent(); var evt=_status.event.getParent();
@ -538,7 +538,7 @@ card.swd={
ai:{ ai:{
wuxie:function(target,card,player,viewer){ wuxie:function(target,card,player,viewer){
if(ai.get.attitude(viewer,target)>0){ if(ai.get.attitude(viewer,target)>0){
if(target.num('h')>0||target.hp>1) return 0; if(target.countCards('h')>0||target.hp>1) return 0;
} }
}, },
basic:{ basic:{
@ -548,7 +548,7 @@ card.swd={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(player.hasUnknown(2)) return 0; if(player.hasUnknown(2)) return 0;
var nh=target.num('h'); var nh=target.countCards('h');
if(get.mode()=='identity'){ if(get.mode()=='identity'){
if(target.isZhu&&nh<=1&&target.hp<=1) return -100; if(target.isZhu&&nh<=1&&target.hp<=1) return -100;
} }
@ -780,7 +780,7 @@ card.swd={
type:'jiguan', type:'jiguan',
wuxieable:true, wuxieable:true,
enable:function(card,player){ enable:function(card,player){
var hs=player.get('he'); var hs=player.getCards('he');
return hs.length>1||(hs.length==1&&hs[0]!=card); return hs.length>1||(hs.length==1&&hs[0]!=card);
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
@ -788,7 +788,7 @@ card.swd={
}, },
content:function(){ content:function(){
'step 0' 'step 0'
if(player.num('he')){ if(player.countCards('he')){
player.chooseCard(true,'he'); player.chooseCard(true,'he');
} }
else{ else{
@ -934,7 +934,7 @@ card.swd={
wuxieable:true, wuxieable:true,
modTarget:true, modTarget:true,
enable:function(card,player){ enable:function(card,player){
var es=player.get('e'); var es=player.getCards('e');
for(var i=0;i<es.length;i++){ for(var i=0;i<es.length;i++){
if(lib.inpile.contains(es[i].name)&& if(lib.inpile.contains(es[i].name)&&
!lib.card[es[i].name].nopower&& !lib.card[es[i].name].nopower&&
@ -946,7 +946,7 @@ card.swd={
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target==player; return target==player;
// var es=target.get('e'); // var es=target.getCards('e');
// for(var i=0;i<es.length;i++){ // for(var i=0;i<es.length;i++){
// if(lib.inpile.contains(es[i].name)) return true; // if(lib.inpile.contains(es[i].name)) return true;
// } // }
@ -955,7 +955,7 @@ card.swd={
selectTarget:-1, selectTarget:-1,
content:function(){ content:function(){
'step 0' 'step 0'
var es=target.get('e'); var es=target.getCards('e');
var list=get.typeCard('hslingjian'); var list=get.typeCard('hslingjian');
var list2=get.typeCard('jiqi'); var list2=get.typeCard('jiqi');
var list3=[]; var list3=[];
@ -1021,7 +1021,7 @@ card.swd={
order:7.5, order:7.5,
result:{ result:{
// target:function(player,target){ // target:function(player,target){
// var es=target.get('e'); // var es=target.getCards('e');
// var num=0; // var num=0;
// for(var i=0;i<es.length;i++){ // for(var i=0;i<es.length;i++){
// if(lib.inpile.contains(es[i].name)) num++; // if(lib.inpile.contains(es[i].name)) num++;
@ -1056,7 +1056,7 @@ card.swd={
value:[5,1], value:[5,1],
result:{ result:{
target:function(player,target){ target:function(player,target){
return 1/(1+target.num('e')); return 1/(1+target.countCards('e'));
} }
} }
} }
@ -1069,10 +1069,10 @@ card.swd={
derivation:true, derivation:true,
derivationpack:'swd', derivationpack:'swd',
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.num('he')>0; return target.countCards('he')>0;
}, },
content:function(){ content:function(){
target.discard(target.get('he').randomGet()); target.discard(target.getCards('he').randomGet());
}, },
ai:{ ai:{
order:9, order:9,
@ -1108,7 +1108,7 @@ card.swd={
target.equip(card); target.equip(card);
} }
'step 1' 'step 1'
var hs=target.get('h'); var hs=target.getCards('h');
if(hs.length){ if(hs.length){
target.discard(hs.randomGet()); target.discard(hs.randomGet());
} }
@ -1118,11 +1118,11 @@ card.swd={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.get('e','2')){ if(target.get('e','2')){
if(target.num('h')&&!target.hasSkillTag('noe')) return -0.6; if(target.countCards('h')&&!target.hasSkillTag('noe')) return -0.6;
return 0; return 0;
} }
else{ else{
var hs=target.get('h'); var hs=target.getCards('h');
var num=0; var num=0;
if(target.hasSkillTag('noe')){ if(target.hasSkillTag('noe')){
num=1; num=1;
@ -1192,10 +1192,10 @@ card.swd={
derivation:true, derivation:true,
derivationpack:'swd', derivationpack:'swd',
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.num('e')>0; return target!=player&&target.countCards('e')>0;
}, },
content:function(){ content:function(){
var es=target.get('e'); var es=target.getCards('e');
target.gain(es); target.gain(es);
target.$gain2(es); target.$gain2(es);
}, },
@ -1203,11 +1203,11 @@ card.swd={
order:5, order:5,
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.hasSkillTag('noe')) return target.num('e')*2; if(target.hasSkillTag('noe')) return target.countCards('e')*2;
if(target.getEquip('baiyin')&&target.isDamaged()) return 2; if(target.getEquip('baiyin')&&target.isDamaged()) return 2;
if(target.getEquip('xuanyuanjian')||target.getEquip('qiankundai')) return 1; if(target.getEquip('xuanyuanjian')||target.getEquip('qiankundai')) return 1;
var num=0; var num=0;
var es=target.get('e'); var es=target.getCards('e');
for(var i=0;i<es.length;i++){ for(var i=0;i<es.length;i++){
var subtype=get.subtype(es[i]); var subtype=get.subtype(es[i]);
if(subtype=='equip1'||subtype=='equip3'){ if(subtype=='equip1'||subtype=='equip3'){
@ -1272,7 +1272,7 @@ card.swd={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(get.distance(player,target,'absolute')<=1) return 0; if(get.distance(player,target,'absolute')<=1) return 0;
if(target.num('h')<=target.hp) return -0.1; if(target.countCards('h')<=target.hp) return -0.1;
return -1; return -1;
} }
}, },
@ -1299,7 +1299,7 @@ card.swd={
target:function(player,target){ target:function(player,target){
if(get.distance(player,target,'absolute')<=1) return 0; if(get.distance(player,target,'absolute')<=1) return 0;
if(target.hp==1) return 2; if(target.hp==1) return 2;
if(target.hp==2&&target.num('h')<=2) return 1.2; if(target.hp==2&&target.countCards('h')<=2) return 1.2;
return 1; return 1;
} }
}, },
@ -1789,7 +1789,7 @@ card.swd={
ai:{ ai:{
wuxie:function(target,card,player,viewer){ wuxie:function(target,card,player,viewer){
if(ai.get.attitude(viewer,target)>0&&target.num('h','sha')){ if(ai.get.attitude(viewer,target)>0&&target.num('h','sha')){
if(!target.num('h')||target.hp==1||Math.random()<0.7) return 0; if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0;
} }
}, },
basic:{ basic:{
@ -1801,7 +1801,7 @@ card.swd={
target:function(player,target){ target:function(player,target){
if(target.hasSkillTag('nothunder')) return 0; if(target.hasSkillTag('nothunder')) return 0;
if(target.hasUnknown(2)) return 0; if(target.hasUnknown(2)) return 0;
var nh=target.num('h'); var nh=target.countCards('h');
if(lib.config.mode=='identity'){ if(lib.config.mode=='identity'){
if(target.isZhu&&nh<=2&&target.hp<=1) return -100; if(target.isZhu&&nh<=2&&target.hp<=1) return -100;
} }
@ -1848,7 +1848,7 @@ card.swd={
ai:{ ai:{
wuxie:function(target,card,player,viewer){ wuxie:function(target,card,player,viewer){
if(ai.get.attitude(viewer,target)>0&&target.num('h','shan')){ if(ai.get.attitude(viewer,target)>0&&target.num('h','shan')){
if(!target.num('h')||target.hp==1||Math.random()<0.7) return 0; if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0;
} }
}, },
basic:{ basic:{
@ -1860,7 +1860,7 @@ card.swd={
target:function(player,target){ target:function(player,target){
if(target.hasSkillTag('nofire')) return 0; if(target.hasSkillTag('nofire')) return 0;
if(player.hasUnknown(2)) return 0; if(player.hasUnknown(2)) return 0;
var nh=target.num('h'); var nh=target.countCards('h');
if(lib.config.mode=='identity'){ if(lib.config.mode=='identity'){
if(target.isZhu&&nh<=2&&target.hp<=1) return -100; if(target.isZhu&&nh<=2&&target.hp<=1) return -100;
} }
@ -2030,7 +2030,7 @@ card.swd={
'step 0' 'step 0'
trigger.untrigger(); trigger.untrigger();
trigger.finish(); trigger.finish();
player.discard(player.get('he')); player.discard(player.getCards('he'));
player.removeSkill('huanpodan_skill'); player.removeSkill('huanpodan_skill');
'step 1' 'step 1'
player.changeHp(1-player.hp); player.changeHp(1-player.hp);
@ -2046,7 +2046,7 @@ card.swd={
silent:true, silent:true,
priority:-1, priority:-1,
content:function(){ content:function(){
var hs=player.get('h'); var hs=player.getCards('h');
var list=['yuchanqian','yuchankun','yuchanzhen','yuchanxun','yuchangen','yuchanli','yuchankan','yuchandui']; var list=['yuchanqian','yuchankun','yuchanzhen','yuchanxun','yuchangen','yuchanli','yuchankan','yuchandui'];
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
if(hs[i].name.indexOf('yuchan')==0){ if(hs[i].name.indexOf('yuchan')==0){
@ -2364,7 +2364,7 @@ card.swd={
event.finish(); event.finish();
} }
'step 1' 'step 1'
var es=player.get('h'); var es=player.getCards('h');
if(es.length){ if(es.length){
player.discard(es); player.discard(es);
} }
@ -2423,7 +2423,7 @@ card.swd={
"step 0" "step 0"
player.chooseTarget([1,1],get.prompt('baishouzhihu'),function(card,player,target){ player.chooseTarget([1,1],get.prompt('baishouzhihu'),function(card,player,target){
if(player==target) return false; if(player==target) return false;
return target.num('he')>0; return target.countCards('he')>0;
}).ai=function(target){ }).ai=function(target){
return -ai.get.attitude(player,target); return -ai.get.attitude(player,target);
}; };
@ -2656,7 +2656,7 @@ card.swd={
"step 0" "step 0"
player.chooseTarget([1,1],get.prompt('baishouzhihu_duanzao'),function(card,player,target){ player.chooseTarget([1,1],get.prompt('baishouzhihu_duanzao'),function(card,player,target){
if(player==target) return false; if(player==target) return false;
return target.num('he')>0; return target.countCards('he')>0;
}).ai=function(target){ }).ai=function(target){
return -ai.get.attitude(player,target); return -ai.get.attitude(player,target);
}; };
@ -2705,7 +2705,7 @@ card.swd={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0; return player.countCards('h')>0;
}, },
delay:false, delay:false,
content:function(){ content:function(){
@ -2792,7 +2792,7 @@ card.swd={
shouna:{ shouna:{
enable:'phaseUse', enable:'phaseUse',
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0; return player.countCards('h')>0;
}, },
usable:1, usable:1,
filterCard:true, filterCard:true,
@ -2800,10 +2800,10 @@ card.swd={
return 6-ai.get.value(card); return 6-ai.get.value(card);
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.num('h')>0; return target!=player&&target.countCards('h')>0;
}, },
content:function(){ content:function(){
var card=target.get('h').randomGet(); var card=target.getCards('h').randomGet();
var hu=player.getEquip('lianyaohu'); var hu=player.getEquip('lianyaohu');
if(card&&hu){ if(card&&hu){
if(!hu.storage.shouna){ if(!hu.storage.shouna){
@ -2819,7 +2819,7 @@ card.swd={
order:5, order:5,
result:{ result:{
target:function(player,target){ target:function(player,target){
return -1/Math.sqrt(1+target.num('h')); return -1/Math.sqrt(1+target.countCards('h'));
} }
} }
} }
@ -2865,7 +2865,7 @@ card.swd={
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0; return player.countCards('h')>0;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -3004,7 +3004,7 @@ card.swd={
forced:true, forced:true,
priority:55, priority:55,
filter:function(event){ filter:function(event){
return event.player.num('he')>0; return event.player.countCards('he')>0;
}, },
content:function(){ content:function(){
trigger.player.chooseToDiscard(true,'he'); trigger.player.chooseToDiscard(true,'he');
@ -3161,7 +3161,7 @@ card.swd={
return 7-ai.get.value(card); return 7-ai.get.value(card);
}, },
filter:function(event,player){ filter:function(event,player){
return player.hp<player.maxHp&&player.num('h')>=2; return player.hp<player.maxHp&&player.countCards('h')>=2;
}, },
content:function(){ content:function(){
player.recover(); player.recover();
@ -3216,10 +3216,10 @@ card.swd={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.num('h'); return target!=player&&target.countCards('h');
}, },
filter:function(event,player){ filter:function(event,player){
return player.num('h')?true:false; return player.countCards('h')?true:false;
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -3245,7 +3245,7 @@ card.swd={
order:7, order:7,
result:{ result:{
target:function(player,target){ target:function(player,target){
if(player.num('h')<=1) return 0; if(player.countCards('h')<=1) return 0;
if(ai.get.attitude(player,target)>=0) return 0; if(ai.get.attitude(player,target)>=0) return 0;
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return (player!=current&&target.canUse('sha',current)&& return (player!=current&&target.canUse('sha',current)&&
@ -3395,7 +3395,7 @@ card.swd={
order:10, order:10,
result:{ result:{
target:function(player,target){ target:function(player,target){
return -target.num('h'); return -target.countCards('h');
} }
} }
} }
@ -3404,20 +3404,20 @@ card.swd={
trigger:{source:'damageEnd'}, trigger:{source:'damageEnd'},
forced:true, forced:true,
filter:function(event){ filter:function(event){
return event.card&&event.card.name=='sha'&&event.player.num('he'); return event.card&&event.card.name=='sha'&&event.player.countCards('he');
}, },
content:function(){ content:function(){
trigger.player.discard(trigger.player.get('he').randomGet()); trigger.player.discard(trigger.player.getCards('he').randomGet());
} }
}, },
hslingjian_xuanfengzhiren_equip2:{ hslingjian_xuanfengzhiren_equip2:{
trigger:{player:'damageEnd'}, trigger:{player:'damageEnd'},
forced:true, forced:true,
filter:function(event){ filter:function(event){
return event.card&&event.card.name=='sha'&&event.source&&event.source.num('he'); return event.card&&event.card.name=='sha'&&event.source&&event.source.countCards('he');
}, },
content:function(){ content:function(){
trigger.source.discard(trigger.source.get('he').randomGet()); trigger.source.discard(trigger.source.getCards('he').randomGet());
} }
}, },
hslingjian_xuanfengzhiren_equip3:{ hslingjian_xuanfengzhiren_equip3:{
@ -3460,22 +3460,22 @@ card.swd={
filterCard:true, filterCard:true,
position:'he', position:'he',
filter:function(event,player){ filter:function(event,player){
return player.num('he')>0; return player.countCards('he')>0;
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.num('he')>0; return target.countCards('he')>0;
}, },
check:function(card){ check:function(card){
return 5-ai.get.value(card); return 5-ai.get.value(card);
}, },
content:function(){ content:function(){
target.discard(target.get('he').randomGet()); target.discard(target.getCards('he').randomGet());
}, },
ai:{ ai:{
order:5, order:5,
result:{ result:{
target:function(player,target){ target:function(player,target){
var dh=player.num('he')-target.num('he'); var dh=player.countCards('he')-target.countCards('he');
if(dh>0){ if(dh>0){
return -Math.sqrt(dh); return -Math.sqrt(dh);
} }
@ -3534,7 +3534,7 @@ card.swd={
filterTarget:true, filterTarget:true,
selectCard:2, selectCard:2,
filter:function(event,player){ filter:function(event,player){
return player.num('he')>=2; return player.countCards('he')>=2;
}, },
check:function(card){ check:function(card){
return 5-ai.get.value(card); return 5-ai.get.value(card);
@ -3640,7 +3640,7 @@ card.swd={
var att=ai.get.attitude(player,target); var att=ai.get.attitude(player,target);
if(get.distance(player,target,'absolute')<=1) return 0; if(get.distance(player,target,'absolute')<=1) return 0;
if(target.hp==1) return 2*att; if(target.hp==1) return 2*att;
if(target.hp==2&&target.num('h')<=2) return 1.2*att; if(target.hp==2&&target.countCards('h')<=2) return 1.2*att;
return att; return att;
} }
'step 1' 'step 1'
@ -3677,7 +3677,7 @@ card.swd={
hslingjian_yinmilichang_equip5:{ hslingjian_yinmilichang_equip5:{
mod:{ mod:{
targetEnabled:function(card,player,target,now){ targetEnabled:function(card,player,target,now){
if(target.num('h')==0){ if(target.countCards('h')==0){
if(card.name=='sha'||card.name=='juedou') return false; if(card.name=='sha'||card.name=='juedou') return false;
} }
} }
@ -3686,7 +3686,7 @@ card.swd={
noh:true, noh:true,
skillTagFilter:function(player,tag){ skillTagFilter:function(player,tag){
if(tag=='noh'){ if(tag=='noh'){
if(player.num('h')!=1) return false; if(player.countCards('h')!=1) return false;
} }
} }
} }
@ -3763,14 +3763,14 @@ card.swd={
hslingjian_shengxiuhaojiao_equip3:{ hslingjian_shengxiuhaojiao_equip3:{
mod:{ mod:{
globalTo:function(from,to,distance){ globalTo:function(from,to,distance){
if(to.hp<to.num('h')) return distance+1; if(to.hp<to.countCards('h')) return distance+1;
} }
} }
}, },
hslingjian_shengxiuhaojiao_equip4:{ hslingjian_shengxiuhaojiao_equip4:{
mod:{ mod:{
globalFrom:function(from,to,distance){ globalFrom:function(from,to,distance){
if(from.hp<from.num('h')) return distance-1; if(from.hp<from.countCards('h')) return distance-1;
} }
} }
}, },
@ -3797,7 +3797,7 @@ card.swd={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.hasSkill('hslingjian_chaofeng')){ if(target.hasSkill('hslingjian_chaofeng')){
return -Math.sqrt(target.hp+target.num('h')); return -Math.sqrt(target.hp+target.countCards('h'));
} }
return 0; return 0;
} }
@ -3827,14 +3827,14 @@ card.swd={
hslingjian_shijianhuisu_equip3:{ hslingjian_shijianhuisu_equip3:{
mod:{ mod:{
globalTo:function(from,to,distance){ globalTo:function(from,to,distance){
if(to.num('e')==1) return distance+1; if(to.countCards('e')==1) return distance+1;
} }
} }
}, },
hslingjian_shijianhuisu_equip4:{ hslingjian_shijianhuisu_equip4:{
mod:{ mod:{
globalFrom:function(from,to,distance){ globalFrom:function(from,to,distance){
if(from.num('e')==1) return distance-1; if(from.countCards('e')==1) return distance-1;
} }
} }
}, },
@ -3844,11 +3844,11 @@ card.swd={
filterCard:true, filterCard:true,
selectCard:1, selectCard:1,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return player!=target&&target.num('he')>0; return player!=target&&target.countCards('he')>0;
}, },
position:'he', position:'he',
content:function(){ content:function(){
var es=target.get('e'); var es=target.getCards('e');
target.gain(es); target.gain(es);
target.$gain2(es); target.$gain2(es);
}, },
@ -3859,8 +3859,8 @@ card.swd={
order:5, order:5,
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.hasSkillTag('noe')) return target.num('e')*2; if(target.hasSkillTag('noe')) return target.countCards('e')*2;
return -target.num('e'); return -target.countCards('e');
} }
}, },
} }
@ -3912,7 +3912,7 @@ card.swd={
longprompt:true, longprompt:true,
prompt:function(event){ prompt:function(event){
var lingjians=[],types=[]; var lingjians=[],types=[];
var hs=event.player.get('he'); var hs=event.player.getCards('he');
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
switch(get.type(hs[i])){ switch(get.type(hs[i])){
case 'equip':types.add(get.subtype(hs[i]));break; case 'equip':types.add(get.subtype(hs[i]));break;
@ -4143,7 +4143,7 @@ card.swd={
if(target.hasSkill('hslingjian_chaofeng')) return; if(target.hasSkill('hslingjian_chaofeng')) return;
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return (current.hasSkill('hslingjian_chaofeng')&& return (current.hasSkill('hslingjian_chaofeng')&&
current.hp<current.num('h')&&get.distance(player,current,'attack')<=1); current.hp<current.countCards('h')&&get.distance(player,current,'attack')<=1);
})){ })){
return false; return false;
} }
@ -4270,19 +4270,19 @@ card.swd={
usable:1, usable:1,
filterCard:true, filterCard:true,
filter:function(event,player){ filter:function(event,player){
var nh=player.num('h'); var nh=player.countCards('h');
if(nh==0) return false; if(nh==0) return false;
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return current!=player&&current.num('h')>nh; return current!=player&&current.countCards('h')>nh;
}); });
}, },
check:function(card){ check:function(card){
return 8-ai.get.value(card); return 8-ai.get.value(card);
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(target.get('h').length==0) return false; if(target.countCards('h')==0) return false;
if(target==player) return false; if(target==player) return false;
if(target.num('h')<=player.num('h')) return false; if(target.countCards('h')<=player.countCards('h')) return false;
return true; return true;
}, },
content:function(){ content:function(){
@ -4293,7 +4293,7 @@ card.swd={
}); });
"step 1" "step 1"
if(result.bool){ if(result.bool){
var card=target.get('h').randomGet(); var card=target.getCards('h').randomGet();
if(card){ if(card){
player.gain(card,target); player.gain(card,target);
target.$giveAuto(card,player); target.$giveAuto(card,player);
@ -4391,7 +4391,7 @@ card.swd={
case '5555':target.link();break; case '5555':target.link();break;
case '6666':target.draw();break; case '6666':target.draw();break;
case '7777':target.recover();break; case '7777':target.recover();break;
case '8888':target.discard(target.get('j'));break; case '8888':target.discard(target.getCards('j'));break;
case '9999':target.draw(2);target.chooseToDiscard(2,true);break; case '9999':target.draw(2);target.chooseToDiscard(2,true);break;
default: default:
for(var i=1;i<4;i++){ for(var i=1;i<4;i++){
@ -4431,7 +4431,7 @@ card.swd={
case 'diamond':player.draw();break; case 'diamond':player.draw();break;
case 'club':{ case 'club':{
player.chooseTarget('弃置一名角色的一张牌',function(card,player,target){ player.chooseTarget('弃置一名角色的一张牌',function(card,player,target){
return player!=target&&target.num('he')>0; return player!=target&&target.countCards('he')>0;
}).ai=function(target){ }).ai=function(target){
return -ai.get.attitude(player,target); return -ai.get.attitude(player,target);
}; };

View File

@ -46,12 +46,12 @@ card.yunchou={
event.dialog=ui.dialogs[i];break; event.dialog=ui.dialogs[i];break;
} }
} }
if(!event.dialog||!target.num('h')){ if(!event.dialog||!target.countCards('h')){
event.finish(); event.finish();
return; return;
} }
var minValue=20; var minValue=20;
var hs=target.get('h'); var hs=target.getCards('h');
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
minValue=Math.min(minValue,ai.get.value(hs[i],target)); minValue=Math.min(minValue,ai.get.value(hs[i],target));
} }
@ -146,8 +146,8 @@ card.yunchou={
result:{ result:{
player:1, player:1,
target:function(player,target){ target:function(player,target){
if(target.num('h')==0) return 0; if(target.countCards('h')==0) return 0;
return (Math.sqrt(target.num('h'))-get.distance(player,target,'absolute')/game.countPlayer()/3)/2; return (Math.sqrt(target.countCards('h'))-get.distance(player,target,'absolute')/game.countPlayer()/3)/2;
} }
}, },
tag:{ tag:{
@ -161,7 +161,7 @@ card.yunchou={
type:'trick', type:'trick',
enable:true, enable:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.num('h')>0&&target!=player; return target.countCards('h')>0&&target!=player;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -180,12 +180,12 @@ card.yunchou={
} }
'step 1' 'step 1'
if(event.directfalse||result.control=='选项二'){ if(event.directfalse||result.control=='选项二'){
if(target.num('h')){ if(target.countCards('h')){
if(!player.isUnderControl(true)){ if(!player.isUnderControl(true)){
target.showHandcards(); target.showHandcards();
} }
else{ else{
game.log(target,'展示了',target.get('h')); game.log(target,'展示了',target.getCards('h'));
} }
player.discardPlayerCard(target,'h',true,'visible'); player.discardPlayerCard(target,'h',true,'visible');
} }
@ -227,7 +227,7 @@ card.yunchou={
} }
} }
'step 1' 'step 1'
event.card2=target.get('h').randomGet(); event.card2=target.getCards('h').randomGet();
if(event.card2){ if(event.card2){
target.discard(event.card2); target.discard(event.card2);
} }
@ -244,7 +244,7 @@ card.yunchou={
value:[3,1], value:[3,1],
result:{ result:{
target:function(player,target){ target:function(player,target){
return -2/Math.sqrt(1+target.num('h')); return -2/Math.sqrt(1+target.countCards('h'));
}, },
}, },
tag:{ tag:{
@ -259,7 +259,7 @@ card.yunchou={
type:'trick', type:'trick',
enable:true, enable:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.num('h')>0; return target!=player&&target.countCards('h')>0;
}, },
chongzhu:function(){ chongzhu:function(){
return game.countPlayer()<=2; return game.countPlayer()<=2;
@ -308,7 +308,7 @@ card.yunchou={
content:function(){ content:function(){
'step 0' 'step 0'
var list=game.filterPlayer(function(current){ var list=game.filterPlayer(function(current){
return current!=target&&current.num('h'); return current!=target&&current.countCards('h');
}); });
if(!list.length){ if(!list.length){
target.draw(3); target.draw(3);
@ -324,7 +324,7 @@ card.yunchou={
event.current=event.list.shift(); event.current=event.list.shift();
event.current.chooseBool('是否响应'+get.translation(target)+'的舌战群儒?',function(event,player){ event.current.chooseBool('是否响应'+get.translation(target)+'的舌战群儒?',function(event,player){
if(ai.get.attitude(player,_status.event.source)>=0) return false; if(ai.get.attitude(player,_status.event.source)>=0) return false;
var hs=player.get('h'); var hs=player.getCards('h');
var dutag=player.hasSkillTag('nodu'); var dutag=player.hasSkillTag('nodu');
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
var value=ai.get.value(hs[i],player); var value=ai.get.value(hs[i],player);
@ -383,7 +383,7 @@ card.yunchou={
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){
var hs=target.get('h'); var hs=target.getCards('h');
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
var value=ai.get.value(hs[i]); var value=ai.get.value(hs[i]);
if(hs[i].number>=7&&value<=6) return 1; if(hs[i].number>=7&&value<=6) return 1;
@ -505,7 +505,7 @@ card.yunchou={
type:'trick', type:'trick',
filterTarget:true, filterTarget:true,
content:function(){ content:function(){
if(target.num('he')){ if(target.countCards('he')){
player.gainPlayerCard('he',target,true); player.gainPlayerCard('he',target,true);
} }
}, },
@ -568,7 +568,7 @@ card.yunchou={
type:'trick', type:'trick',
enable:true, enable:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return player!=target&&target.get('h').length; return player!=target&&target.countCards('h');
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -590,11 +590,11 @@ card.yunchou={
order:4, order:4,
result:{ result:{
target:function(player){ target:function(player){
if(player.get('h').length<=1) return 0; if(player.countCards('h')<=1) return 0;
return -1; return -1;
}, },
player:function(player){ player:function(player){
if(player.get('h').length<=1) return 0; if(player.countCards('h')<=1) return 0;
return 0.5; return 0.5;
} }
}, },
@ -608,18 +608,18 @@ card.yunchou={
type:'trick', type:'trick',
enable:true, enable:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.num('e'); return target.countCards('e');
}, },
selectTarget:-1, selectTarget:-1,
content:function(){ content:function(){
if(target.num('e')) target.chooseToDiscard('e',true); if(target.countCards('e')) target.chooseToDiscard('e',true);
}, },
reverseOrder:true, reverseOrder:true,
ai:{ ai:{
order:9, order:9,
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.num('e')) return -1; if(target.countCards('e')) return -1;
return 0; return 0;
} }
}, },
@ -634,7 +634,7 @@ card.yunchou={
type:'trick', type:'trick',
enable:true, enable:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.num('h')>0; return target.countCards('h')>0;
}, },
selectTarget:2, selectTarget:2,
multitarget:true, multitarget:true,
@ -643,7 +643,7 @@ card.yunchou={
content:function(){ content:function(){
"step 0" "step 0"
target.addTempSkill('toulianghuanzhu2','phaseAfter'); target.addTempSkill('toulianghuanzhu2','phaseAfter');
var hs=target.get('h'); var hs=target.getCards('h');
event.num=Math.min(2,hs.length); event.num=Math.min(2,hs.length);
if(event.num){ if(event.num){
var gived=hs.randomGets(event.num); var gived=hs.randomGets(event.num);
@ -655,7 +655,7 @@ card.yunchou={
event.finish(); event.finish();
} }
"step 1" "step 1"
if(event.addedTarget.num('h')){ if(event.addedTarget.countCards('h')){
if(_status.auto&&event.addedTarget==game.me){ if(_status.auto&&event.addedTarget==game.me){
game.delay(); game.delay();
} }
@ -679,7 +679,7 @@ card.yunchou={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(ui.selected.targets.length){ if(ui.selected.targets.length){
if(target==player&&target.num('h')<=1) return 0; if(target==player&&target.countCards('h')<=1) return 0;
return 0.5; return 0.5;
} }
if(target.hasSkill('toulianghuanzhu2')) return 0; if(target.hasSkill('toulianghuanzhu2')) return 0;
@ -824,15 +824,15 @@ card.yunchou={
fullskin:true, fullskin:true,
effect:function(){ effect:function(){
if(result.judge){ if(result.judge){
if(player.num('he')==0) player.loseHp(); if(player.countCards('he')==0) player.loseHp();
else{ else{
player.discard(player.get('he').randomGets(3)); player.discard(player.getCards('he').randomGets(3));
} }
var players=get.players(); var players=get.players();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
var dist=get.distance(player,players[i]); var dist=get.distance(player,players[i]);
if(dist<=2&&player!=players[i]){ if(dist<=2&&player!=players[i]){
var cs=players[i].get('he'); var cs=players[i].getCards('he');
if(cs.length==0) players[i].loseHp(); if(cs.length==0) players[i].loseHp();
else{ else{
players[i].discard(cs.randomGets(3-Math.max(1,dist))); players[i].discard(cs.randomGets(3-Math.max(1,dist)));
@ -915,7 +915,7 @@ card.yunchou={
filterTarget:true, filterTarget:true,
content:function(){ content:function(){
"step 0" "step 0"
if(target.num('he')<2){ if(target.countCards('he')<2){
event.directfalse=true; event.directfalse=true;
} }
else{ else{
@ -949,7 +949,7 @@ card.yunchou={
if(ai.get.damageEffect(target,player,player)<0&&ai.get.attitude(player,target)>0){ if(ai.get.damageEffect(target,player,player)<0&&ai.get.attitude(player,target)>0){
return -2; return -2;
} }
var nh=target.num('he'); var nh=target.countCards('he');
if(target==player) nh--; if(target==player) nh--;
switch(nh){ switch(nh){
case 0:case 1:return -2; case 0:case 1:return -2;
@ -1047,7 +1047,7 @@ card.yunchou={
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
if(event.player==player) return false; if(event.player==player) return false;
if(!event.player.num('he')) return false; if(!event.player.countCards('he')) return false;
if(!lib.filter.targetEnabled({name:'chenhuodajie'},player,event.player)) return false; if(!lib.filter.targetEnabled({name:'chenhuodajie'},player,event.player)) return false;
return player.hasCard('chenhuodajie'); return player.hasCard('chenhuodajie');
}, },

View File

@ -73,7 +73,7 @@ card.zhenfa={
}); });
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.isMajor()&&target.num('he')>0; return target.isMajor()&&target.countCards('he')>0;
}, },
selectTarget:-1, selectTarget:-1,
content:function(){ content:function(){
@ -237,7 +237,7 @@ card.zhenfa={
return player.next.siege(player); return player.next.siege(player);
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(target.get('he').length==0) return false; if(target.getCards('he').length==0) return false;
return target==player.next||target==player.previous; return target==player.next||target==player.previous;
}, },
selectTarget:-1, selectTarget:-1,

View File

@ -146,7 +146,7 @@ character.diy={
filterCard:{type:'equip'}, filterCard:{type:'equip'},
check:function(card){ check:function(card){
var player=_status.event.player; var player=_status.event.player;
var he=player.get('he'); var he=player.getCards('he');
var subtype=get.subtype(card); var subtype=get.subtype(card);
var value=ai.get.equipValue(card); var value=ai.get.equipValue(card);
for(var i=0;i<he.length;i++){ for(var i=0;i<he.length;i++){
@ -218,7 +218,7 @@ character.diy={
var att=ai.get.attitude(player,event.player); var att=ai.get.attitude(player,event.player);
var subtype=get.subtype(event.cards[0]); var subtype=get.subtype(event.cards[0]);
if(att>0){ if(att>0){
if(event.player.num('h')>=player.num('h')+2) return true; if(event.player.countCards('h')>=player.countCards('h')+2) return true;
return event.player.num('e',{subtype:subtype})==0; return event.player.num('e',{subtype:subtype})==0;
} }
else{ else{
@ -306,7 +306,7 @@ character.diy={
fuchou:{ fuchou:{
trigger:{target:'shaBefore'}, trigger:{target:'shaBefore'},
filter:function(event,player){ filter:function(event,player){
return player.num('he')>0; return player.countCards('he')>0;
}, },
direct:true, direct:true,
content:function(){ content:function(){
@ -382,10 +382,10 @@ character.diy={
chezhen:{ chezhen:{
mod:{ mod:{
globalFrom:function(from,to,distance){ globalFrom:function(from,to,distance){
if(from.num('e')) return distance-1; if(from.countCards('e')) return distance-1;
}, },
globalTo:function(from,to,distance){ globalTo:function(from,to,distance){
if(!to.num('e')) return distance+1; if(!to.countCards('e')) return distance+1;
} }
} }
}, },
@ -420,7 +420,7 @@ character.diy={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.num('he')>0; return target!=player&&target.countCards('he')>0;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -551,11 +551,11 @@ character.diy={
target:function(card,player,target,current){ target:function(card,player,target,current){
if(card.name=='sha'&&player.storage.zhucheng&&player.storage.zhucheng.length){ if(card.name=='sha'&&player.storage.zhucheng&&player.storage.zhucheng.length){
if(player.storage.zhucheng.length>=2){ if(player.storage.zhucheng.length>=2){
if(!player.hasFriend()&&player.num('he')-2<player.storage.zhucheng.length) return 'zeroplayertarget'; if(!player.hasFriend()&&player.countCards('he')-2<player.storage.zhucheng.length) return 'zeroplayertarget';
return 0.1; return 0.1;
} }
else{ else{
var he=player.get('he'); var he=player.getCards('he');
var sha=false; var sha=false;
for(var i=0;i<he.length;i++){ for(var i=0;i<he.length;i++){
if(he[i]=='sha'&&!sha){ if(he[i]=='sha'&&!sha){
@ -629,7 +629,7 @@ character.diy={
return false; return false;
} }
else if(1+player.maxHp-player.hp==2){ else if(1+player.maxHp-player.hp==2){
return player.num('h')>=2; return player.countCards('h')>=2;
} }
return true; return true;
}, },
@ -679,7 +679,7 @@ character.diy={
num++; num++;
} }
} }
return player.num('h')<num; return player.countCards('h')<num;
}, },
content:function(){ content:function(){
var list=['wei','shu','wu','qun']; var list=['wei','shu','wu','qun'];
@ -691,7 +691,7 @@ character.diy={
num++; num++;
} }
} }
player.draw(num-player.num('h')); player.draw(num-player.countCards('h'));
}, },
ai:{ ai:{
threaten:1.3 threaten:1.3
@ -891,7 +891,7 @@ character.diy={
trigger:{player:'phaseDrawBegin'}, trigger:{player:'phaseDrawBegin'},
forced:true, forced:true,
content:function(){ content:function(){
trigger.num+=1+Math.floor(player.num('e')/2); trigger.num+=1+Math.floor(player.countCards('e')/2);
} }
}, },
honglian:{ honglian:{
@ -921,7 +921,7 @@ character.diy={
trigger:{player:'phaseBegin'}, trigger:{player:'phaseBegin'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
return player.num('hej')>0; return player.countCards('hej')>0;
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -1085,10 +1085,10 @@ character.diy={
var att=ai.get.attitude(trigger.player,player); var att=ai.get.attitude(trigger.player,player);
var bool=0; var bool=0;
if(att<0){ if(att<0){
if(trigger.player.num('e')==0&&trigger.player.num('h')>2) bool=1; if(trigger.player.countCards('e')==0&&trigger.player.countCards('h')>2) bool=1;
else if(trigger.player.num('he')==0) bool=1; else if(trigger.player.countCards('he')==0) bool=1;
} }
else if(att==0&&trigger.player.num('he')==0){ else if(att==0&&trigger.player.countCards('he')==0){
bool=1; bool=1;
} }
trigger.player.chooseControl(function(){ trigger.player.chooseControl(function(){
@ -1099,7 +1099,7 @@ character.diy={
player.draw(); player.draw();
event.finish(); event.finish();
} }
else if(trigger.player.num('he')){ else if(trigger.player.countCards('he')){
player.discardPlayerCard(trigger.player,true,'he'); player.discardPlayerCard(trigger.player,true,'he');
} }
else{ else{
@ -1258,7 +1258,7 @@ character.diy={
"step 1" "step 1"
target.damage(); target.damage();
"step 2" "step 2"
if(target.isAlive()&&target.num('he')){ if(target.isAlive()&&target.countCards('he')){
player.discardPlayerCard(target); player.discardPlayerCard(target);
} }
}, },

View File

@ -168,7 +168,7 @@ character.extra={
"step 2" "step 2"
if(event.targets2.length){ if(event.targets2.length){
var cur=event.targets2.shift(); var cur=event.targets2.shift();
if(cur&&cur.num('he')){ if(cur&&cur.countCards('he')){
cur.chooseToDiscard('he',true,4); cur.chooseToDiscard('he',true,4);
} }
event.redo(); event.redo();
@ -304,7 +304,7 @@ character.extra={
trigger:{global:'judge'}, trigger:{global:'judge'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0&&player.storage.renjie>0; return player.countCards('h')>0&&player.storage.renjie>0;
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -418,7 +418,7 @@ character.extra={
result:{ result:{
player:function(player){ player:function(player){
var num=0; var num=0;
var cards=player.get('he'); var cards=player.getCards('he');
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
if(ai.get.value(cards[i])<6){ if(ai.get.value(cards[i])<6){
num++; num++;
@ -525,10 +525,10 @@ character.extra={
check:function(event,player){ check:function(event,player){
if(player.isTurnedOver()) return true; if(player.isTurnedOver()) return true;
var num=game.countPlayer(function(current){ var num=game.countPlayer(function(current){
if(current.num('he')&&current!=player&&ai.get.attitude(player,current)<=0){ if(current.countCards('he')&&current!=player&&ai.get.attitude(player,current)<=0){
return true; return true;
} }
if(current.num('j')&&current!=player&&ai.get.attitude(player,current)>0){ if(current.countCards('j')&&current!=player&&ai.get.attitude(player,current)>0){
return true; return true;
} }
}); });
@ -544,7 +544,7 @@ character.extra={
player.line(targets,'green'); player.line(targets,'green');
"step 1" "step 1"
if(num<event.targets.length){ if(num<event.targets.length){
var hej=event.targets[num].get('hej') var hej=event.targets[num].getCards('hej')
if(hej.length){ if(hej.length){
var card=hej.randomGet(); var card=hej.randomGet();
player.gain(card,event.targets[num]); player.gain(card,event.targets[num]);
@ -575,10 +575,10 @@ character.extra={
if(target.hp==1) return 0.8; if(target.hp==1) return 0.8;
if(target.isTurnedOver()) return [0,3]; if(target.isTurnedOver()) return [0,3];
var num=game.countPlayer(function(current){ var num=game.countPlayer(function(current){
if(current.num('he')&&current!=player&&ai.get.attitude(player,current)<=0){ if(current.countCards('he')&&current!=player&&ai.get.attitude(player,current)<=0){
return true; return true;
} }
if(current.num('j')&&current!=player&&ai.get.attitude(player,current)>0){ if(current.countCards('j')&&current!=player&&ai.get.attitude(player,current)>0){
return true; return true;
} }
}); });
@ -646,7 +646,7 @@ character.extra={
}, },
content:function(){ content:function(){
"step 0" "step 0"
player.chooseCard('选择任意张手牌与星交换',[1,player.num('h')]).ai=function(card){ player.chooseCard('选择任意张手牌与星交换',[1,player.countCards('h')]).ai=function(card){
return 1; return 1;
}; };
"step 1" "step 1"
@ -699,7 +699,7 @@ character.extra={
var att=ai.get.attitude(player,target); var att=ai.get.attitude(player,target);
if(att>=4){ if(att>=4){
if(target.hp==1&&target.maxHp>2) return att; if(target.hp==1&&target.maxHp>2) return att;
if(target.hp==2&&target.maxHp>3&&target.num('he')==0) return att*0.7; if(target.hp==2&&target.maxHp>3&&target.countCards('he')==0) return att*0.7;
return 0; return 0;
} }
return -1; return -1;
@ -1071,12 +1071,12 @@ character.extra={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.num('h'); return target!=player&&target.countCards('h');
}, },
content:function(){ content:function(){
"step 0" "step 0"
event.videoId=lib.status.videoId++; event.videoId=lib.status.videoId++;
var cards=target.get('h'); var cards=target.getCards('h');
if(player.isOnline2()){ if(player.isOnline2()){
player.send(function(cards,id){ player.send(function(cards,id){
ui.create.dialog('攻心',cards).videoId=id; ui.create.dialog('攻心',cards).videoId=id;
@ -1144,7 +1144,7 @@ character.extra={
threaten:1.5, threaten:1.5,
result:{ result:{
target:function(player,target){ target:function(player,target){
return -target.num('h'); return -target.countCards('h');
} }
}, },
order:10, order:10,

View File

@ -38,7 +38,7 @@ character.gujian={
position:'he', position:'he',
viewAs:{name:'jiu'}, viewAs:{name:'jiu'},
viewAsFilter:function(player){ viewAsFilter:function(player){
if(!player.num('he')) return false; if(!player.countCards('he')) return false;
}, },
prompt:'将一张手牌或装备牌当酒使用', prompt:'将一张手牌或装备牌当酒使用',
check:function(card){ check:function(card){
@ -88,12 +88,12 @@ character.gujian={
if(event.type!='dying') return false; if(event.type!='dying') return false;
if(player!=event.dying) return false; if(player!=event.dying) return false;
if(player.maxHp<=1) return false; if(player.maxHp<=1) return false;
if(player.num('h')==0) return false; if(player.countCards('h')==0) return false;
return true; return true;
}, },
alter:true, alter:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.num('h')>0&&target.hp>0&&target.hp<=player.maxHp; return target!=player&&target.countCards('h')>0&&target.hp>0&&target.hp<=player.maxHp;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -124,7 +124,7 @@ character.gujian={
skillTagFilter:function(player){ skillTagFilter:function(player){
if(player.maxHp<=1) return false; if(player.maxHp<=1) return false;
if(player.hp>0) return false; if(player.hp>0) return false;
if(player.num('h')==0) return false; if(player.countCards('h')==0) return false;
}, },
save:true, save:true,
result:{ result:{
@ -168,7 +168,7 @@ character.gujian={
}, },
filter:function(event,player){ filter:function(event,player){
if(!player.storage.yunyin) return true; if(!player.storage.yunyin) return true;
var hs=player.get('h'); var hs=player.getCards('h');
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
if(!player.storage.yunyin.contains(get.suit(hs[i]))) return true; if(!player.storage.yunyin.contains(get.suit(hs[i]))) return true;
} }
@ -223,7 +223,7 @@ character.gujian={
if(taoyuan>nanman) return name=='taoyuan'?1:0; if(taoyuan>nanman) return name=='taoyuan'?1:0;
return name=='nanman'?1:0; return name=='nanman'?1:0;
} }
if(player.num('h')<player.hp&&player.hp>=2){ if(player.countCards('h')<player.hp&&player.hp>=2){
return name=='wuzhong'?1:0; return name=='wuzhong'?1:0;
} }
if(player.hp<player.maxHp&&player.hp<3){ if(player.hp<player.maxHp&&player.hp<3){
@ -425,7 +425,7 @@ character.gujian={
yanjia:{ yanjia:{
enable:'phaseUse', enable:'phaseUse',
filter:function(event,player){ filter:function(event,player){
var he=player.get('he'); var he=player.getCards('he');
var num=0; var num=0;
for(var i=0;i<he.length;i++){ for(var i=0;i<he.length;i++){
var info=lib.card[he[i].name]; var info=lib.card[he[i].name];
@ -648,7 +648,7 @@ character.gujian={
}, },
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.player)<0&& return ai.get.attitude(player,event.player)<0&&
((player.num('h')>player.hp&&player.num('h','lebu')==0)||get.distance(player,event.player)>1); ((player.countCards('h')>player.hp&&player.num('h','lebu')==0)||get.distance(player,event.player)>1);
}, },
logTarget:'player', logTarget:'player',
content:function(){ content:function(){
@ -679,11 +679,11 @@ character.gujian={
trigger:{player:'phaseBegin'}, trigger:{player:'phaseBegin'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return player.num('h')>player.hp; return player.countCards('h')>player.hp;
}, },
content:function(){ content:function(){
"step 0" "step 0"
var next=player.chooseToDiscard(get.prompt('xidie'),[1,Math.min(3,player.num('h')-player.hp)]); var next=player.chooseToDiscard(get.prompt('xidie'),[1,Math.min(3,player.countCards('h')-player.hp)]);
next.ai=function(card){ next.ai=function(card){
return 6-ai.get.value(card); return 6-ai.get.value(card);
} }
@ -712,7 +712,7 @@ character.gujian={
return ai.get.attitude(player,event.source)<4; return ai.get.attitude(player,event.source)<4;
}, },
filter:function(event,player){ filter:function(event,player){
return event.source&&event.source!=player&&event.source.num('h')>0; return event.source&&event.source!=player&&event.source.countCards('h')>0;
}, },
logTarget:'source', logTarget:'source',
content:function(){ content:function(){
@ -802,7 +802,7 @@ character.gujian={
if(player==target) return false; if(player==target) return false;
if(target.isLinked()) return true; if(target.isLinked()) return true;
if(target.isTurnedOver()) return true; if(target.isTurnedOver()) return true;
if(target.num('j')) return true; if(target.countCards('j')) return true;
if(target.hp==target.maxHp) return false; if(target.hp==target.maxHp) return false;
return target.isLowestHp(); return target.isLowestHp();
}).ai=function(target){ }).ai=function(target){
@ -815,7 +815,7 @@ character.gujian={
if(target.isTurnedOver()){ if(target.isTurnedOver()){
num+=5; num+=5;
} }
if(target.num('j')){ if(target.countCards('j')){
num+=2; num+=2;
} }
if(target.isLinked()){ if(target.isLinked()){
@ -844,7 +844,7 @@ character.gujian={
event.target.turnOver(); event.target.turnOver();
} }
"step 4" "step 4"
var cards=event.target.get('j'); var cards=event.target.getCards('j');
if(cards.length){ if(cards.length){
event.target.discard(cards); event.target.discard(cards);
} }
@ -862,7 +862,7 @@ character.gujian={
trigger:{player:'damageBegin'}, trigger:{player:'damageBegin'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
return player.num('h')==0&&event.num>=1; return player.countCards('h')==0&&event.num>=1;
}, },
content:function(){ content:function(){
if(trigger.num>=1){ if(trigger.num>=1){
@ -876,7 +876,7 @@ character.gujian={
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target){ target:function(card,player,target){
if(get.tag(card,'damage')&&target.num('h')==0){ if(get.tag(card,'damage')&&target.countCards('h')==0){
if(player.hasSkillTag('jueqing')) return; if(player.hasSkillTag('jueqing')) return;
return 0.1; return 0.1;
} }
@ -921,7 +921,7 @@ character.gujian={
qinglan:{ qinglan:{
trigger:{global:'damageBefore'}, trigger:{global:'damageBefore'},
filter:function(event,player){ filter:function(event,player){
return event.nature&&player.num('he')>0; return event.nature&&player.countCards('he')>0;
}, },
direct:true, direct:true,
priority:-5, priority:-5,
@ -1072,7 +1072,7 @@ character.gujian={
}, },
content:function(){ content:function(){
"step 0" "step 0"
var cards=player.get('hej'); var cards=player.getCards('hej');
player.discard(cards); player.discard(cards);
"step 1" "step 1"
if(player.isLinked()) player.link(); if(player.isLinked()) player.link();
@ -1140,7 +1140,7 @@ character.gujian={
if(player.num('he',{subtype:get.subtype(card)})>1){ if(player.num('he',{subtype:get.subtype(card)})>1){
return 11-ai.get.equipValue(card); return 11-ai.get.equipValue(card);
} }
if(player.num('h')<player.hp){ if(player.countCards('h')<player.hp){
return 6-ai.get.value(card); return 6-ai.get.value(card);
} }
return 2-ai.get.equipValue(card); return 2-ai.get.equipValue(card);
@ -1180,7 +1180,7 @@ character.gujian={
filter:function(event,player){ filter:function(event,player){
if(event.card.name!='sha') return false; if(event.card.name!='sha') return false;
if(event.targets.length!=1) return false; if(event.targets.length!=1) return false;
if(!player.num('he')) return false; if(!player.countCards('he')) return false;
var target=event.targets[0]; var target=event.targets[0];
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return player!=current&&target!=current&&get.distance(target,current)<=1; return player!=current&&target!=current&&get.distance(target,current)<=1;
@ -1240,7 +1240,7 @@ character.gujian={
ai:{ ai:{
result:{ result:{
player:function(player){ player:function(player){
var num=player.num('h'); var num=player.countCards('h');
if(num>player.hp+1) return 1; if(num>player.hp+1) return 1;
if(player.storage.xuanning>=2) return 0; if(player.storage.xuanning>=2) return 0;
if(num>player.hp) return 1 if(num>player.hp) return 1
@ -1256,13 +1256,13 @@ character.gujian={
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
if(player.storage.xuanning){ if(player.storage.xuanning){
return (event.source&&event.source.num('he')>0); return (event.source&&event.source.countCards('he')>0);
} }
return false; return false;
}, },
logTarget:'source', logTarget:'source',
content:function(){ content:function(){
var he=trigger.source.get('he'); var he=trigger.source.getCards('he');
if(he.length){ if(he.length){
trigger.source.discard(he.randomGet()); trigger.source.discard(he.randomGet());
} }
@ -1311,7 +1311,7 @@ character.gujian={
return 8-ai.get.value(card); return 8-ai.get.value(card);
}; };
next.autochoose=function(){ next.autochoose=function(){
return this.player.num('he')==0; return this.player.countCards('he')==0;
}; };
event.current=target; event.current=target;
} }
@ -1351,7 +1351,7 @@ character.gujian={
ai:{ ai:{
result:{ result:{
player:function(player){ player:function(player){
if(player.num('h')<=player.hp&&player.hp==player.maxHp){ if(player.countCards('h')<=player.hp&&player.hp==player.maxHp){
return 0; return 0;
} }
return 1; return 1;
@ -1513,7 +1513,7 @@ character.gujian={
if(card.name=='bingliang') return 0; if(card.name=='bingliang') return 0;
if(card.name=='lebu') return 1.5; if(card.name=='lebu') return 1.5;
if(card.name=='guohe'){ if(card.name=='guohe'){
if(!target.num('e')) return 0; if(!target.countCards('e')) return 0;
return 0.5; return 0.5;
} }
if(card.name=='liuxinghuoyu') return 0; if(card.name=='liuxinghuoyu') return 0;
@ -1537,15 +1537,15 @@ character.gujian={
yuling2:{ yuling2:{
trigger:{player:['loseEnd','drawEnd'],global:'gameDrawAfter'}, trigger:{player:['loseEnd','drawEnd'],global:'gameDrawAfter'},
check:function(event,player){ check:function(event,player){
return player.num('h')<2; return player.countCards('h')<2;
}, },
priority:10, priority:10,
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
return player.num('h')<5; return player.countCards('h')<5;
}, },
content:function(){ content:function(){
player.draw(5-player.num('h')); player.draw(5-player.countCards('h'));
} }
}, },
yuling3:{ yuling3:{
@ -1553,13 +1553,13 @@ character.gujian={
priority:10, priority:10,
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
return player.num('h')>5; return player.countCards('h')>5;
}, },
check:function(event,player){ check:function(event,player){
return player.num('h')<2; return player.countCards('h')<2;
}, },
content:function(){ content:function(){
player.chooseToDiscard(true,player.num('h')-5); player.chooseToDiscard(true,player.countCards('h')-5);
} }
}, },
yuling4:{ yuling4:{

View File

@ -139,7 +139,7 @@ character.gwent={
kuanglie:{ kuanglie:{
trigger:{player:'useCardToBegin'}, trigger:{player:'useCardToBegin'},
filter:function(event,player){ filter:function(event,player){
return event.target&&event.target!=player&&event.target.num('he')&&get.color(event.card)=='black'; return event.target&&event.target!=player&&event.target.countCards('he')&&get.color(event.card)=='black';
}, },
init:function(player){ init:function(player){
player.storage.kuanglie=0; player.storage.kuanglie=0;
@ -158,7 +158,7 @@ character.gwent={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.num('he'); return target!=player&&target.countCards('he');
}, },
selectTarget:[1,Infinity], selectTarget:[1,Infinity],
content:function(){ content:function(){
@ -208,7 +208,7 @@ character.gwent={
'step 1' 'step 1'
if(event.list.length){ if(event.list.length){
var current=event.list.shift(); var current=event.list.shift();
var he=current.get('he'); var he=current.getCards('he');
player.line(current,'green'); player.line(current,'green');
if(he.length){ if(he.length){
current.discard(he.randomGet()); current.discard(he.randomGet());
@ -236,7 +236,7 @@ character.gwent={
} }
var player=_status.event.player; var player=_status.event.player;
if(player.isDamaged()){ if(player.isDamaged()){
var hs=player.get('h'); var hs=player.getCards('h');
var num=0; var num=0;
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
if(ai.get.value(hs[i])<6){ if(ai.get.value(hs[i])<6){
@ -439,18 +439,18 @@ character.gwent={
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return current.num('h')>current.hp; return current.countCards('h')>current.hp;
}); });
}, },
logTarget:function(){ logTarget:function(){
return game.filterPlayer(function(current){ return game.filterPlayer(function(current){
return current.num('h')>current.hp; return current.countCards('h')>current.hp;
}).sortBySeat(); }).sortBySeat();
}, },
content:function(){ content:function(){
'step 0' 'step 0'
var list=game.filterPlayer(function(current){ var list=game.filterPlayer(function(current){
return current.num('h')>current.hp; return current.countCards('h')>current.hp;
}).sortBySeat(); }).sortBySeat();
event.list=list; event.list=list;
'step 1' 'step 1'
@ -540,7 +540,7 @@ character.gwent={
trigger:{player:'shaBegin'}, trigger:{player:'shaBegin'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return player.num('he')>0; return player.countCards('he')>0;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -573,11 +573,11 @@ character.gwent={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.num('h')>0; return target!=player&&target.countCards('h')>0;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
var hs=target.get('h'); var hs=target.getCards('h');
player.gain(hs,target); player.gain(hs,target);
target.$giveAuto(hs,player); target.$giveAuto(hs,player);
event.hs=hs; event.hs=hs;
@ -618,7 +618,7 @@ character.gwent={
order:11, order:11,
result:{ result:{
target:function(player,target){ target:function(player,target){
return -Math.sqrt(target.num('h')); return -Math.sqrt(target.countCards('h'));
} }
} }
} }
@ -627,11 +627,11 @@ character.gwent={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.num('h')!=Math.min(3,player.hp); return target.countCards('h')!=Math.min(3,player.hp);
}, },
selectTarget:[1,3], selectTarget:[1,3],
content:function(){ content:function(){
var dh=Math.min(3,player.hp)-target.num('h'); var dh=Math.min(3,player.hp)-target.countCards('h');
if(dh>0){ if(dh>0){
target.draw(dh,false); target.draw(dh,false);
target.$draw(dh); target.$draw(dh);
@ -646,7 +646,7 @@ character.gwent={
order:11, order:11,
result:{ result:{
target:function(player,target){ target:function(player,target){
var dh=Math.min(3,player.hp)-target.num('h'); var dh=Math.min(3,player.hp)-target.countCards('h');
if(dh<0){ if(dh<0){
dh+=get.sgn(ai.get.effect(target,{name:'sha'},player,target)); dh+=get.sgn(ai.get.effect(target,{name:'sha'},player,target));
} }
@ -661,9 +661,9 @@ character.gwent={
content:function(){ content:function(){
'step 0' 'step 0'
player.chooseTarget(get.prompt('hunmo'),[1,game.countPlayer()],function(card,player,target){ player.chooseTarget(get.prompt('hunmo'),[1,game.countPlayer()],function(card,player,target){
return target.num('h')!=Math.min(3,target.hp); return target.countCards('h')!=Math.min(3,target.hp);
}).ai=function(target){ }).ai=function(target){
return ai.get.attitude(player,target)*(Math.min(3,target.hp)-target.num('h')); return ai.get.attitude(player,target)*(Math.min(3,target.hp)-target.countCards('h'));
} }
'step 1' 'step 1'
if(result.bool){ if(result.bool){
@ -677,7 +677,7 @@ character.gwent={
'step 2' 'step 2'
if(event.targets.length){ if(event.targets.length){
var target=event.targets.shift(); var target=event.targets.shift();
var dh=Math.min(3,target.hp)-target.num('h'); var dh=Math.min(3,target.hp)-target.countCards('h');
if(dh>0){ if(dh>0){
target.draw(dh,false); target.draw(dh,false);
target.$draw(dh); target.$draw(dh);

View File

@ -176,16 +176,16 @@ character.hearth={
filter:function(event,player){ filter:function(event,player){
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
if(current==player) return false; if(current==player) return false;
var nh=current.num('h'); var nh=current.countCards('h');
return nh&&nh>=player.num('h'); return nh&&nh>=player.countCards('h');
}); });
}, },
content:function(){ content:function(){
'step 0' 'step 0'
player.chooseTarget(get.prompt('kuixin'),function(card,player,target){ player.chooseTarget(get.prompt('kuixin'),function(card,player,target){
if(target==player) return false; if(target==player) return false;
var nh=target.num('h'); var nh=target.countCards('h');
return nh&&nh>=player.num('h'); return nh&&nh>=player.countCards('h');
}).ai=function(target){ }).ai=function(target){
var att=ai.get.attitude(player,target); var att=ai.get.attitude(player,target);
if(target.hasSkillTag('noe')){ if(target.hasSkillTag('noe')){
@ -196,7 +196,7 @@ character.hearth={
'step 1' 'step 1'
if(result.bool){ if(result.bool){
var target=result.targets[0]; var target=result.targets[0];
var card=target.get('h').randomGet(); var card=target.getCards('h').randomGet();
if(card){ if(card){
player.logSkill('kuixin',target); player.logSkill('kuixin',target);
player.gain(card,target); player.gain(card,target);
@ -256,7 +256,7 @@ character.hearth={
trigger:{player:'phaseUseBegin'}, trigger:{player:'phaseUseBegin'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
return player.storage.fuhua2.isIn()&&player.num('he')>0; return player.storage.fuhua2.isIn()&&player.countCards('he')>0;
}, },
mark:'character', mark:'character',
intro:{ intro:{
@ -319,10 +319,10 @@ character.hearth={
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0; return player.countCards('h')>0;
}, },
content:function(){ content:function(){
var hs=player.get('h'); var hs=player.getCards('h');
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
if(hs[i].name=='du'){ if(hs[i].name=='du'){
hs.splice(i--,1); hs.splice(i--,1);
@ -390,12 +390,12 @@ character.hearth={
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0&&!player.isTurnedOver(); return player.countCards('h')>0&&!player.isTurnedOver();
}, },
content:function(){ content:function(){
'step 0' 'step 0'
player.chooseTarget(get.prompt('gfuhun'),function(card,player,target){ player.chooseTarget(get.prompt('gfuhun'),function(card,player,target){
return target!=player&&target.num('h')>0; return target!=player&&target.countCards('h')>0;
}).ai=function(target){ }).ai=function(target){
return -ai.get.attitude(player,target); return -ai.get.attitude(player,target);
} }
@ -469,7 +469,7 @@ character.hearth={
longyi:{ longyi:{
mod:{ mod:{
maxHandcard:function(player,num){ maxHandcard:function(player,num){
var hs=player.get('h'); var hs=player.getCards('h');
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
if(get.color(hs[i])=='black'){ if(get.color(hs[i])=='black'){
num++; num++;
@ -586,12 +586,12 @@ character.hearth={
}, },
content:function(){ content:function(){
'step 0' 'step 0'
var nh=player.num('h'); var nh=player.countCards('h');
var num=game.countPlayer(function(current){ var num=game.countPlayer(function(current){
return current.num('h')>nh; return current.countCards('h')>nh;
}); });
player.chooseTarget(get.prompt('xingluo'),[1,num],function(card,player,target){ player.chooseTarget(get.prompt('xingluo'),[1,num],function(card,player,target){
return target.num('h')>nh; return target.countCards('h')>nh;
}).ai=function(target){ }).ai=function(target){
return 0.5-ai.get.attitude(player,target); return 0.5-ai.get.attitude(player,target);
} }
@ -1053,7 +1053,7 @@ character.hearth={
if(!info) return 0; if(!info) return 0;
if(!Array.isArray(info.names)) return 0; if(!Array.isArray(info.names)) return 0;
var names=info.names; var names=info.names;
if(names.contains('xingjiegoutong')&&target.num('h')>=3) return -1; if(names.contains('xingjiegoutong')&&target.countCards('h')>=3) return -1;
var num=0; var num=0;
for(var i=0;i<names.length;i++){ for(var i=0;i<names.length;i++){
var info2=lib.card[names[i]]; var info2=lib.card[names[i]];
@ -1087,10 +1087,10 @@ character.hearth={
frequent:true, frequent:true,
usable:1, usable:1,
filter:function(event){ filter:function(event){
return event.target.num('h')>0; return event.target.countCards('h')>0;
}, },
content:function(){ content:function(){
player.gain(game.createCard(trigger.target.get('h').randomGet()),'draw'); player.gain(game.createCard(trigger.target.getCards('h').randomGet()),'draw');
} }
}, },
miss:{ miss:{
@ -1156,10 +1156,10 @@ character.hearth={
return ai.get.attitude(player,event.source)<=0; return ai.get.attitude(player,event.source)<=0;
}, },
filter:function(event,player){ filter:function(event,player){
return event.source&&event.source.isAlive()&&event.source!=player&&event.source.num('h')>0; return event.source&&event.source.isAlive()&&event.source!=player&&event.source.countCards('h')>0;
}, },
content:function(){ content:function(){
var card=trigger.source.get('h').randomGet(); var card=trigger.source.getCards('h').randomGet();
if(card){ if(card){
player.gain(card,trigger.source); player.gain(card,trigger.source);
if(get.color(card)=='black'){ if(get.color(card)=='black'){
@ -1179,7 +1179,7 @@ character.hearth={
target:function(card,player,target){ target:function(card,player,target){
if(player.hasSkillTag('jueqing')) return [1,-2]; if(player.hasSkillTag('jueqing')) return [1,-2];
if(!target.hasFriend()) return false; if(!target.hasFriend()) return false;
if(get.tag(card,'damage')&&player.num('h')>1) return [1,0,0,-1]; if(get.tag(card,'damage')&&player.countCards('h')>1) return [1,0,0,-1];
} }
} }
} }
@ -1369,7 +1369,7 @@ character.hearth={
wzhanyi:{ wzhanyi:{
trigger:{player:'phaseUseBefore'}, trigger:{player:'phaseUseBefore'},
check:function(event,player){ check:function(event,player){
return player.num('h')+2<=player.hp; return player.countCards('h')+2<=player.hp;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -1975,7 +1975,7 @@ character.hearth={
tanmi:{ tanmi:{
trigger:{global:'phaseEnd'}, trigger:{global:'phaseEnd'},
filter:function(event,player){ filter:function(event,player){
return player.num('h')==0&&event.player!=player; return player.countCards('h')==0&&event.player!=player;
}, },
frequent:true, frequent:true,
content:function(){ content:function(){
@ -1992,7 +1992,7 @@ character.hearth={
noh:true, noh:true,
skillTagFilter:function(player,tag){ skillTagFilter:function(player,tag){
if(tag=='noh'){ if(tag=='noh'){
if(player.num('h')!=1) return false; if(player.countCards('h')!=1) return false;
} }
} }
} }
@ -2205,7 +2205,7 @@ character.hearth={
usable:1, usable:1,
filter:function(event,player){ filter:function(event,player){
if(player.hp==player.maxHp) return false; if(player.hp==player.maxHp) return false;
var hs=player.get('h'); var hs=player.getCards('h');
if(hs.length==0) return false; if(hs.length==0) return false;
var types=[]; var types=[];
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
@ -2223,7 +2223,7 @@ character.hearth={
'step 0' 'step 0'
player.showHandcards(); player.showHandcards();
'step 1' 'step 1'
player.recover(player.num('h')); player.recover(player.countCards('h'));
}, },
ai:{ ai:{
order:10, order:10,
@ -2245,7 +2245,7 @@ character.hearth={
}, },
selectCard:3, selectCard:3,
filter:function(event,player){ filter:function(event,player){
return player.num('he')>=3; return player.countCards('he')>=3;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -2403,7 +2403,7 @@ character.hearth={
direct:true, direct:true,
trigger:{player:'phaseBegin'}, trigger:{player:'phaseBegin'},
filter:function(event,player){ filter:function(event,player){
var hs=player.get('he'); var hs=player.getCards('he');
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
if(hs[i].number==player.storage.xunbao2.number) return true; if(hs[i].number==player.storage.xunbao2.number) return true;
} }
@ -2484,7 +2484,7 @@ character.hearth={
fbeifa:{ fbeifa:{
trigger:{player:'loseEnd'}, trigger:{player:'loseEnd'},
filter:function(event,player){ filter:function(event,player){
if(player.num('h')) return false; if(player.countCards('h')) return false;
if(player.storage.fbeifa>=3) return false; if(player.storage.fbeifa>=3) return false;
for(var i=0;i<event.cards.length;i++){ for(var i=0;i<event.cards.length;i++){
if(event.cards[i].original=='h') return true; if(event.cards[i].original=='h') return true;
@ -2581,7 +2581,7 @@ character.hearth={
usable:1, usable:1,
filter:function(event,player){ filter:function(event,player){
if(!lib.card.chiyuxi||!lib.card.jingleishan) return false; if(!lib.card.chiyuxi||!lib.card.jingleishan) return false;
return player.num('he')>0; return player.countCards('he')>0;
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(get.color(card)=='red'){ if(get.color(card)=='red'){
@ -2645,7 +2645,7 @@ character.hearth={
trigger:{player:'useCardToBegin'}, trigger:{player:'useCardToBegin'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return event.target&&event.target!=player&&get.distance(player,event.target)>1&&event.target.num('he')>0; return event.target&&event.target!=player&&get.distance(player,event.target)>1&&event.target.countCards('he')>0;
}, },
content:function(){ content:function(){
player.discardPlayerCard(trigger.target,get.prompt('yuanzheng',trigger.target),'hej').logSkill=['yuanzheng',trigger.target]; player.discardPlayerCard(trigger.target,get.prompt('yuanzheng',trigger.target),'hej').logSkill=['yuanzheng',trigger.target];
@ -2738,7 +2738,7 @@ character.hearth={
player.unmarkSkill('byuhuo'); player.unmarkSkill('byuhuo');
'step 1' 'step 1'
if(num<event.targets.length){ if(num<event.targets.length){
// if(event.targets[num].num('hej')){ // if(event.targets[num].countCards('hej')){
// player.gainPlayerCard(event.targets[num],'hej',true); // player.gainPlayerCard(event.targets[num],'hej',true);
// } // }
player.line(event.targets[num],'fire'); player.line(event.targets[num],'fire');
@ -2774,8 +2774,8 @@ character.hearth={
order:10, order:10,
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.num('j')) return 2; if(target.countCards('j')) return 2;
switch(target.num('he')){ switch(target.countCards('he')){
case 0:return 0; case 0:return 0;
case 1:return 0.5; case 1:return 0.5;
case 2:return 0.8; case 2:return 0.8;
@ -2803,7 +2803,7 @@ character.hearth={
player.chooseTarget(get.prompt('duzhang'),function(card,player,target){ player.chooseTarget(get.prompt('duzhang'),function(card,player,target){
return target!=player; return target!=player;
}).ai=function(target){ }).ai=function(target){
return -ai.get.attitude(player,target)*Math.sqrt(target.num('h')); return -ai.get.attitude(player,target)*Math.sqrt(target.countCards('h'));
} }
'step 1' 'step 1'
if(result.bool){ if(result.bool){
@ -2828,11 +2828,11 @@ character.hearth={
trigger:{player:'damageEnd'}, trigger:{player:'damageEnd'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0; return player.countCards('h')>0;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
var nh=player.num('h'); var nh=player.countCards('h');
if(nh){ if(nh){
player.draw(nh); player.draw(nh);
} }
@ -2840,7 +2840,7 @@ character.hearth={
event.finish(); event.finish();
} }
'step 1' 'step 1'
var hs=player.get('h'); var hs=player.getCards('h');
if(hs.length>10&&hs.length>player.hp){ if(hs.length>10&&hs.length>player.hp){
player.discard(hs.randomGets(hs.length-player.hp)); player.discard(hs.randomGets(hs.length-player.hp));
} }
@ -2853,7 +2853,7 @@ character.hearth={
if(get.tag(card,'damage')){ if(get.tag(card,'damage')){
if(player.hasSkillTag('jueqing')) return [1,-2]; if(player.hasSkillTag('jueqing')) return [1,-2];
if(!target.hasFriend()) return; if(!target.hasFriend()) return;
var nh=target.num('h'); var nh=target.countCards('h');
if(nh>5) return [1,-1]; if(nh>5) return [1,-1];
if(nh<=1) return [1,-0.1]; if(nh<=1) return [1,-0.1];
if(nh==2){ if(nh==2){
@ -2924,15 +2924,15 @@ character.hearth={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return player!=target&&target.num('e')>0; return player!=target&&target.countCards('e')>0;
}, },
filter:function(event,player){ filter:function(event,player){
return game.hasPlayer(function(target){ return game.hasPlayer(function(target){
return target!=player&&target.num('e'); return target!=player&&target.countCards('e');
}); });
}, },
content:function(){ content:function(){
var es=target.get('e'); var es=target.getCards('e');
if(es.length>1){ if(es.length>1){
es=es.randomGets(Math.ceil(Math.random()*2)); es=es.randomGets(Math.ceil(Math.random()*2));
} }
@ -2942,7 +2942,7 @@ character.hearth={
order:9.5, order:9.5,
result:{ result:{
target:function(player,target){ target:function(player,target){
var ne=target.num('e'); var ne=target.countCards('e');
if(ne>1) return -1.5; if(ne>1) return -1.5;
return -1; return -1;
} }
@ -2982,7 +2982,7 @@ character.hearth={
}, },
filter:function(event,player){ filter:function(event,player){
return typeof event.player.storage.shixu=='number'&& return typeof event.player.storage.shixu=='number'&&
event.player.storage.shixu>3000&&event.player.num('he')>0&&event.player.isAlive(); event.player.storage.shixu>3000&&event.player.countCards('he')>0&&event.player.isAlive();
}, },
content:function(){ content:function(){
player.line(trigger.player,'green'); player.line(trigger.player,'green');
@ -3108,7 +3108,7 @@ character.hearth={
'step 1' 'step 1'
if(event.targets.length){ if(event.targets.length){
var target=event.targets.shift(); var target=event.targets.shift();
if(!target.isTurnedOver()&&target.num('he')){ if(!target.isTurnedOver()&&target.countCards('he')){
target.chooseToDiscard(true); target.chooseToDiscard(true);
} }
event.redo(); event.redo();
@ -3151,17 +3151,17 @@ character.hearth={
trigger:{player:'damageEnd'}, trigger:{player:'damageEnd'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
return player.num('he')>0||(event.source&&event.source.num('he')>0); return player.countCards('he')>0||(event.source&&event.source.countCards('he')>0);
}, },
content:function(){ content:function(){
'step 0' 'step 0'
var hs=player.get('he'); var hs=player.getCards('he');
if(hs.length){ if(hs.length){
player.discard(hs.randomGet()) player.discard(hs.randomGet())
} }
'step 1' 'step 1'
if(trigger.source){ if(trigger.source){
var hs=trigger.source.get('he'); var hs=trigger.source.getCards('he');
if(hs.length){ if(hs.length){
trigger.source.discard(hs.randomGet()) trigger.source.discard(hs.randomGet())
} }
@ -3279,7 +3279,7 @@ character.hearth={
}); });
}, },
content:function(){ content:function(){
var hs=player.get('h'); var hs=player.getCards('h');
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
if(get.type(hs[i])=='basic'||get.info(hs[i]).unique){ if(get.type(hs[i])=='basic'||get.info(hs[i]).unique){
hs.splice(i--,1); hs.splice(i--,1);
@ -3443,11 +3443,11 @@ character.hearth={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return player.num('h')!=target.num('h'); return player.countCards('h')!=target.countCards('h');
}, },
alter:true, alter:true,
content:function(){ content:function(){
var num=player.num('h')-target.num('h'); var num=player.countCards('h')-target.countCards('h');
if(num>0){ if(num>0){
if(num>3){ if(num>3){
num=3; num=3;
@ -3472,7 +3472,7 @@ character.hearth={
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i]==player) continue; if(players[i]==player) continue;
var att=ai.get.attitude(player,players[i]); var att=ai.get.attitude(player,players[i]);
var dh=player.num('h')-players[i].num('h'); var dh=player.countCards('h')-players[i].countCards('h');
if(att*dh>num){ if(att*dh>num){
if(att>0){ if(att>0){
max=true; max=true;
@ -3488,7 +3488,7 @@ character.hearth={
}, },
result:{ result:{
player:function(player,target){ player:function(player,target){
return (player.num('h')-target.num('h'))*ai.get.attitude(player,target); return (player.countCards('h')-target.countCards('h'))*ai.get.attitude(player,target);
} }
}, },
expose:0.2 expose:0.2
@ -3511,7 +3511,7 @@ character.hearth={
content:function(){ content:function(){
'step 0' 'step 0'
player.hp=Math.min(player.storage.chongsheng,player.maxHp); player.hp=Math.min(player.storage.chongsheng,player.maxHp);
player.discard(player.get('hej')); player.discard(player.getCards('hej'));
player.draw(player.storage.chongsheng); player.draw(player.storage.chongsheng);
player.storage.chongsheng--; player.storage.chongsheng--;
if(player.storage.chongsheng<=0){ if(player.storage.chongsheng<=0){
@ -3545,13 +3545,13 @@ character.hearth={
usable:1, usable:1,
alter:true, alter:true,
filter:function(event,player){ filter:function(event,player){
return player.num('h')<(get.is.altered('guozai')?3:4); return player.countCards('h')<(get.is.altered('guozai')?3:4);
}, },
init:function(player){ init:function(player){
player.storage.guozai2=0; player.storage.guozai2=0;
}, },
content:function(){ content:function(){
var num=(get.is.altered('guozai')?3:4)-player.num('h'); var num=(get.is.altered('guozai')?3:4)-player.countCards('h');
player.draw(num); player.draw(num);
player.addSkill('guozai2'); player.addSkill('guozai2');
player.storage.guozai2+=num; player.storage.guozai2+=num;
@ -3581,13 +3581,13 @@ character.hearth={
enable:'phaseUse', enable:'phaseUse',
usable:2, usable:2,
filter:function(event,player){ filter:function(event,player){
return player.num('h')<4; return player.countCards('h')<4;
}, },
init:function(player){ init:function(player){
player.storage.guozaix2=0; player.storage.guozaix2=0;
}, },
content:function(){ content:function(){
var num=4-player.num('h'); var num=4-player.countCards('h');
player.draw(num); player.draw(num);
player.addSkill('guozaix2'); player.addSkill('guozaix2');
player.storage.guozaix2+=num; player.storage.guozaix2+=num;
@ -3780,17 +3780,17 @@ character.hearth={
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
var nh=player.num('h'); var nh=player.countCards('h');
var nm=1; var nm=1;
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
if(current!=player&&Math.abs(current.num('h')-nh)<=nm){ if(current!=player&&Math.abs(current.countCards('h')-nh)<=nm){
return true; return true;
} }
}); });
}, },
content:function(){ content:function(){
'step 0' 'step 0'
var nh=player.num('h'); var nh=player.countCards('h');
var nm=1; var nm=1;
var check=true; var check=true;
if(player.num('h','tao')){ if(player.num('h','tao')){
@ -3800,11 +3800,11 @@ character.hearth={
check=false; check=false;
} }
player.chooseTarget(get.prompt('kuixin'),function(card,player,target){ player.chooseTarget(get.prompt('kuixin'),function(card,player,target){
return target!=player&&Math.abs(target.num('h')-nh)<=nm; return target!=player&&Math.abs(target.countCards('h')-nh)<=nm;
}).ai=function(target){ }).ai=function(target){
if(!check) return 0; if(!check) return 0;
if(ai.get.attitude(player,target)<0){ if(ai.get.attitude(player,target)<0){
return target.num('h')-nh; return target.countCards('h')-nh;
} }
return 0; return 0;
}; };
@ -3812,8 +3812,8 @@ character.hearth={
if(result.bool){ if(result.bool){
var target=result.targets[0]; var target=result.targets[0];
player.logSkill('kuixin',result.targets); player.logSkill('kuixin',result.targets);
var cards0=target.get('h'); var cards0=target.getCards('h');
var cards1=player.get('h'); var cards1=player.getCards('h');
target.gain(cards1,player); target.gain(cards1,player);
player.gain(cards0,target); player.gain(cards0,target);
target.$give(cards0.length,player); target.$give(cards0.length,player);
@ -3875,7 +3875,7 @@ character.hearth={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filter:function(event,player){ filter:function(event,player){
return player.num('h',{type:'basic'})<player.num('h'); return player.num('h',{type:'basic'})<player.countCards('h');
}, },
filterCard:function(card){ filterCard:function(card){
return get.type(card)!='basic'; return get.type(card)!='basic';
@ -3922,7 +3922,7 @@ character.hearth={
usable:1, usable:1,
alter:true, alter:true,
filter:function(event,player){ filter:function(event,player){
return !player.isTurnedOver()&&player.num('h')<=player.hp; return !player.isTurnedOver()&&player.countCards('h')<=player.hp;
}, },
content:function(){ content:function(){
player.draw(get.is.altered('liechao')?3:4); player.draw(get.is.altered('liechao')?3:4);
@ -3967,7 +3967,7 @@ character.hearth={
ai:{ ai:{
nohujia:true, nohujia:true,
skillTagFilter:function(player){ skillTagFilter:function(player){
return player.hp>player.num('h'); return player.hp>player.countCards('h');
}, },
threaten:function(player,target){ threaten:function(player,target){
if(!target.hujia) return 0.8; if(!target.hujia) return 0.8;
@ -4015,7 +4015,7 @@ character.hearth={
trigger:{player:'loseEnd'}, trigger:{player:'loseEnd'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return _status.currentPhase!=player&&!player.hasSkill('fengxing2')&&player.num('he')>0; return _status.currentPhase!=player&&!player.hasSkill('fengxing2')&&player.countCards('he')>0;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -4039,7 +4039,7 @@ character.hearth={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.num('h')>0; return target.countCards('h')>0;
}, },
selectTarget:-1, selectTarget:-1,
content:function(){ content:function(){
@ -4049,7 +4049,7 @@ character.hearth={
order:8, order:8,
result:{ result:{
target:function(player,target){ target:function(player,target){
var nh=target.num('h'); var nh=target.countCards('h');
switch(nh){ switch(nh){
case 0:return 0; case 0:return 0;
case 1:return -1.5; case 1:return -1.5;
@ -4083,10 +4083,10 @@ character.hearth={
forced:true, forced:true,
priority:-1, priority:-1,
filter:function(event,player){ filter:function(event,player){
return player.num('he')>0; return player.countCards('he')>0;
}, },
content:function(){ content:function(){
player.discard(player.get('he')); player.discard(player.getCards('he'));
player.removeSkill('hsmengjing_mengye'); player.removeSkill('hsmengjing_mengye');
}, },
mark:'image', mark:'image',
@ -4124,13 +4124,13 @@ character.hearth={
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return current!=player&&current.num('h'); return current!=player&&current.countCards('h');
}); });
}, },
content:function(){ content:function(){
'step 0' 'step 0'
player.chooseTarget(get.prompt('shijie'),function(card,player,target){ player.chooseTarget(get.prompt('shijie'),function(card,player,target){
return player!=target&&target.num('h')>0; return player!=target&&target.countCards('h')>0;
}).ai=function(target){ }).ai=function(target){
return 11-ai.get.attitude(player,target); return 11-ai.get.attitude(player,target);
}; };
@ -4138,7 +4138,7 @@ character.hearth={
if(result.bool){ if(result.bool){
player.logSkill('shijie',result.targets); player.logSkill('shijie',result.targets);
var target=result.targets[0]; var target=result.targets[0];
var card=target.get('h').randomGet() var card=target.getCards('h').randomGet()
player.gain(card,target); player.gain(card,target);
event.target=target; event.target=target;
target.$giveAuto(card,player); target.$giveAuto(card,player);
@ -4179,7 +4179,7 @@ character.hearth={
target:function(player,target){ target:function(player,target){
if(player.storage.anying) return -1; if(player.storage.anying) return -1;
if(target.hp==1) return 5; if(target.hp==1) return 5;
if(player==target&&player.num('h')>player.hp) return 5; if(player==target&&player.countCards('h')>player.hp) return 5;
return 2; return 2;
} }
}, },
@ -4252,7 +4252,7 @@ character.hearth={
if(!event.targets) return false; if(!event.targets) return false;
if(event.targets.length!=1) return false; if(event.targets.length!=1) return false;
if(event.targets[0]==event.player) return false; if(event.targets[0]==event.player) return false;
var hs=player.get('h'); var hs=player.getCards('h');
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
if(hs[i].name!=event.card.name){ if(hs[i].name!=event.card.name){
var card=hs[i]; var card=hs[i];
@ -4574,17 +4574,17 @@ character.hearth={
filter:function(event,player){ filter:function(event,player){
if(event.responded) return false; if(event.responded) return false;
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return current!=player&&current.num('h'); return current!=player&&current.countCards('h');
}); });
}, },
content:function(){ content:function(){
"step 0" "step 0"
player.chooseTarget(get.prompt('jingxiang'),function(card,player,target){ player.chooseTarget(get.prompt('jingxiang'),function(card,player,target){
if(target==player) return false; if(target==player) return false;
var nh=target.num('h'); var nh=target.countCards('h');
if(nh==0) return false; if(nh==0) return false;
if(get.is.altered('jingxiang')){ if(get.is.altered('jingxiang')){
return nh<=player.num('h'); return nh<=player.countCards('h');
} }
return true; return true;
}).ai=function(target){ }).ai=function(target){
@ -4595,7 +4595,7 @@ character.hearth={
var target=result.targets[0]; var target=result.targets[0];
player.logSkill('jingxiang',target); player.logSkill('jingxiang',target);
event.target=target; event.target=target;
var cards=target.get('h'); var cards=target.getCards('h');
player.chooseCardButton('选择'+get.translation(target)+'的一张卡手牌打出',cards).filterButton=function(button){ player.chooseCardButton('选择'+get.translation(target)+'的一张卡手牌打出',cards).filterButton=function(button){
return trigger.filterCard(button.link); return trigger.filterCard(button.link);
} }
@ -4733,7 +4733,7 @@ character.hearth={
jihuo:{ jihuo:{
trigger:{player:'phaseAfter'}, trigger:{player:'phaseAfter'},
filter:function(event,player){ filter:function(event,player){
return !player.storage.jihuo&&player.num('h')>0; return !player.storage.jihuo&&player.countCards('h')>0;
}, },
direct:true, direct:true,
priority:-50, priority:-50,
@ -4783,7 +4783,7 @@ character.hearth={
game.delay(0.5); game.delay(0.5);
var target=result.targets[0]; var target=result.targets[0];
player.logSkill('tzhenji',target,'thunder'); player.logSkill('tzhenji',target,'thunder');
var cs=target.get('he'); var cs=target.getCards('he');
if(cs.length){ if(cs.length){
target.discard(cs.randomGet()); target.discard(cs.randomGet());
} }
@ -4796,7 +4796,7 @@ character.hearth={
expose:0.3, expose:0.3,
effect:{ effect:{
target:function(card,player,target){ target:function(card,player,target){
if(get.tag(card,'loseCard')&&target.num('he')){ if(get.tag(card,'loseCard')&&target.countCards('he')){
return 0.7; return 0.7;
} }
} }
@ -4830,11 +4830,11 @@ character.hearth={
} }
else{ else{
event.target.damage('thunder'); event.target.damage('thunder');
var cs=event.target.get('he'); var cs=event.target.getCards('he');
if(cs.length){ if(cs.length){
event.target.discard(cs.randomGet()); event.target.discard(cs.randomGet());
} }
cs=player.get('he'); cs=player.getCards('he');
if(cs.length){ if(cs.length){
player.discard(cs.randomGet()); player.discard(cs.randomGet());
} }
@ -4850,7 +4850,7 @@ character.hearth={
return ai.get.attitude(player,current)<0; return ai.get.attitude(player,current)<0;
}); });
var ns=target.num('h','shan'); var ns=target.num('h','shan');
var nh=target.num('h'); var nh=target.countCards('h');
if(ns>1){ if(ns>1){
return [0,hastarget?1:0]; return [0,hastarget?1:0];
} }
@ -5254,7 +5254,7 @@ character.hearth={
order:4, order:4,
result:{ result:{
player:function(player){ player:function(player){
var nh=player.num('h'); var nh=player.countCards('h');
if(nh>=player.hp) return -1; if(nh>=player.hp) return -1;
if(player.hp<=2){ if(player.hp<=2){
if(player.hp==2&&nh==0) return 1; if(player.hp==2&&nh==0) return 1;
@ -5310,12 +5310,12 @@ character.hearth={
enable:true, enable:true,
derivation:'hs_aya', derivation:'hs_aya',
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.num('he')>0; return target.countCards('he')>0;
}, },
content:function(){ content:function(){
var cards=[]; var cards=[];
var hs=target.get('h'); var hs=target.getCards('h');
var es=target.get('e'); var es=target.getCards('e');
if(hs.length) cards.push(hs.randomGet()); if(hs.length) cards.push(hs.randomGet());
if(es.length) cards.push(es.randomGet()); if(es.length) cards.push(es.randomGet());
target.discard(cards); target.discard(cards);
@ -5327,8 +5327,8 @@ character.hearth={
result:{ result:{
target:function(player,target){ target:function(player,target){
var num=0; var num=0;
if(target.num('h')) num--; if(target.countCards('h')) num--;
if(target.num('e')) num--; if(target.countCards('e')) num--;
return num; return num;
}, },
}, },
@ -5429,17 +5429,17 @@ character.hearth={
enable:true, enable:true,
derivation:'hs_xialikeer', derivation:'hs_xialikeer',
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.num('e')>0; return target.countCards('e')>0;
}, },
content:function(){ content:function(){
target.discard(target.get('e').randomGets(2)); target.discard(target.getCards('e').randomGets(2));
}, },
ai:{ ai:{
order:5, order:5,
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.hasSkillTag('noe')) return 0; if(target.hasSkillTag('noe')) return 0;
if(target.num('e')>1) return -1.5; if(target.countCards('e')>1) return -1.5;
return -1; return -1;
}, },
}, },
@ -5468,7 +5468,7 @@ character.hearth={
num=1.5; num=1.5;
} }
if(target.hp==1) return 2*num; if(target.hp==1) return 2*num;
if(target.hp==2&&target.num('h')<=2) return 1.2*num; if(target.hp==2&&target.countCards('h')<=2) return 1.2*num;
return num; return num;
} }
}, },
@ -5539,7 +5539,7 @@ character.hearth={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.hp>1){ if(target.hp>1){
if(target.num('h')>2) return 1; if(target.countCards('h')>2) return 1;
return 0.5; return 0.5;
} }
return 0.2; return 0.2;
@ -5584,7 +5584,7 @@ character.hearth={
content:function(){ content:function(){
player.recover(); player.recover();
player.draw(3); player.draw(3);
// var hs=target.get('h'); // var hs=target.getCards('h');
// target.discard(hs); // target.discard(hs);
// var cs=[]; // var cs=[];
// for(var i=0;i<hs.length;i++){ // for(var i=0;i<hs.length;i++){
@ -5598,7 +5598,7 @@ character.hearth={
order:10, order:10,
result:{ result:{
player:function(player){ player:function(player){
if(player.num('h')>1) return 1; if(player.countCards('h')>1) return 1;
if(player.hp==1) return 1; if(player.hp==1) return 1;
return 0; return 0;
} }
@ -5631,7 +5631,7 @@ character.hearth={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.hp<=1) return 2; if(target.hp<=1) return 2;
if(target.num('h')<target.hp||target.hp==2) return 1.5; if(target.countCards('h')<target.hp||target.hp==2) return 1.5;
return 1; return 1;
} }
}, },
@ -5682,11 +5682,11 @@ character.hearth={
}, },
derivation:'hs_lafamu', derivation:'hs_lafamu',
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.num('hej')>0; return target!=player&&target.countCards('hej')>0;
}, },
selectTarget:-1, selectTarget:-1,
content:function(){ content:function(){
if(target.num('hej')) player.gainPlayerCard(target,'hej',true,Math.ceil(Math.random()*2)); if(target.countCards('hej')) player.gainPlayerCard(target,'hej',true,Math.ceil(Math.random()*2));
}, },
contentAfter:function(){ contentAfter:function(){
if(!player.isTurnedOver()){ if(!player.isTurnedOver()){
@ -5740,7 +5740,7 @@ character.hearth={
selectTarget:-1, selectTarget:-1,
content:function(){ content:function(){
target.loseHp(); target.loseHp();
var he=target.get('he'); var he=target.getCards('he');
if(he.length){ if(he.length){
target.discard(he.randomGets(2)); target.discard(he.randomGets(2));
} }
@ -5772,7 +5772,7 @@ character.hearth={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.hasSkill('hsmengjing_mengye')) return 0.5; if(target.hasSkill('hsmengjing_mengye')) return 0.5;
return -target.num('he'); return -target.countCards('he');
} }
} }
} }
@ -5784,11 +5784,11 @@ character.hearth={
enable:true, enable:true,
derivation:'hs_ysera', derivation:'hs_ysera',
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return !target.num('j','lebu')||target.num('e')>0; return !target.num('j','lebu')||target.countCards('e')>0;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
var es=target.get('e'); var es=target.getCards('e');
if(es.length){ if(es.length){
target.gain(es,'gain2'); target.gain(es,'gain2');
} }
@ -5803,7 +5803,7 @@ character.hearth={
value:10, value:10,
result:{ result:{
target:function(player,target){ target:function(player,target){
var num=target.hp-target.num('he')-2; var num=target.hp-target.countCards('he')-2;
if(num>-1) return -1; if(num>-1) return -1;
if(target.hp<3) num--; if(target.hp<3) num--;
if(target.hp<2) num--; if(target.hp<2) num--;

View File

@ -62,7 +62,7 @@ character.jiange={
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i]!=player&&game.players[i].num('j')) return true; if(game.players[i]!=player&&game.players[i].countCards('j')) return true;
} }
return false; return false;
}, },
@ -70,7 +70,7 @@ character.jiange={
"step 0" "step 0"
event.targets=[]; event.targets=[];
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i]!=player&&game.players[i].num('j')){ if(game.players[i]!=player&&game.players[i].countCards('j')){
event.targets.push(game.players[i]); event.targets.push(game.players[i]);
} }
} }
@ -86,7 +86,7 @@ character.jiange={
trigger:{global:'phaseDrawBegin'}, trigger:{global:'phaseDrawBegin'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return event.num>0&&event.player!=player&&event.player.hp<event.player.maxHp&&player.num('he'); return event.num>0&&event.player!=player&&event.player.hp<event.player.maxHp&&player.countCards('he');
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -117,7 +117,7 @@ character.jiange={
content:function(){ content:function(){
"step 0" "step 0"
player.chooseTarget(get.prompt('huodi'),function(card,player,target){ player.chooseTarget(get.prompt('huodi'),function(card,player,target){
return target.num('he')&&player!=target; return target.countCards('he')&&player!=target;
}).ai=function(target){ }).ai=function(target){
return -ai.get.attitude(player,target); return -ai.get.attitude(player,target);
} }
@ -152,7 +152,7 @@ character.jiange={
direct:true, direct:true,
content:function(){ content:function(){
"step 0" "step 0"
var num=get.cardCount(true,player)-player.num('h'); var num=get.cardCount(true,player)-player.countCards('h');
event.num=num; event.num=num;
if(num>0){ if(num>0){
player.draw(num); player.draw(num);
@ -235,7 +235,7 @@ character.jiange={
"step 0" "step 0"
game.delay(0.5); game.delay(0.5);
player.chooseTarget(get.prompt('juechen'),function(card,player,target){ player.chooseTarget(get.prompt('juechen'),function(card,player,target){
return player!=target&&!trigger.targets.contains(target)&&target.num('he')>0; return player!=target&&!trigger.targets.contains(target)&&target.countCards('he')>0;
}).ai=function(target){ }).ai=function(target){
return -ai.get.attitude(player,target); return -ai.get.attitude(player,target);
} }
@ -265,7 +265,7 @@ character.jiange={
"step 1" "step 1"
if(get.color(event.cards[0])!=get.color(event.cards[1])){ if(get.color(event.cards[0])!=get.color(event.cards[1])){
player.chooseTarget('是否弃置一名角色一张牌?',function(card,player,target){ player.chooseTarget('是否弃置一名角色一张牌?',function(card,player,target){
return player!=target&&target.num('he')>0; return player!=target&&target.countCards('he')>0;
}).ai=function(target){ }).ai=function(target){
return -ai.get.attitude(player,target); return -ai.get.attitude(player,target);
} }
@ -383,7 +383,7 @@ character.jiange={
trigger:{global:'useCardAfter'}, trigger:{global:'useCardAfter'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return event.player!=player&&event.card.name=='wuxie'&&event.player.num('he')>0; return event.player!=player&&event.card.name=='wuxie'&&event.player.countCards('he')>0;
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -435,7 +435,7 @@ character.jiange={
if(target==player) return 0.1; if(target==player) return 0.1;
} }
var att=ai.get.attitude(player,target); var att=ai.get.attitude(player,target);
if(player.num('h')>player.hp){ if(player.countCards('h')>player.hp){
if(target==player) return Math.max(1,att-2); if(target==player) return Math.max(1,att-2);
} }
if(target==player) return att+5; if(target==player) return att+5;

View File

@ -27,16 +27,16 @@ character.old={
if(event.responded) return false; if(event.responded) return false;
if(!event.filterCard({name:'shan'},player,event)&&!!event.filterCard({name:'sha'},player,event)) return false; if(!event.filterCard({name:'shan'},player,event)&&!!event.filterCard({name:'sha'},player,event)) return false;
if(player.hasSkill('zhenshan2')) return false; if(player.hasSkill('zhenshan2')) return false;
var nh=player.num('h'); var nh=player.countCards('h');
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return current!=player&&current.num('h')<nh; return current!=player&&current.countCards('h')<nh;
}); });
}, },
direct:true, direct:true,
content:function(){ content:function(){
"step 0" "step 0"
player.chooseTarget(get.prompt('zhenshan'),function(card,player,target){ player.chooseTarget(get.prompt('zhenshan'),function(card,player,target){
return target.num('h')<player.num('h'); return target.countCards('h')<player.countCards('h');
}).set('ai',function(target){ }).set('ai',function(target){
return ai.get.attitude(player,target) return ai.get.attitude(player,target)
}); });
@ -62,9 +62,9 @@ character.old={
enable:'chooseToUse', enable:'chooseToUse',
filter:function(event,player){ filter:function(event,player){
if(player.hasSkill('zhenshan2')) return false; if(player.hasSkill('zhenshan2')) return false;
var nh=player.num('h'); var nh=player.countCards('h');
if(!game.hasPlayer(function(current){ if(!game.hasPlayer(function(current){
return current!=player&&current.num('h')<nh; return current!=player&&current.countCards('h')<nh;
})){ })){
return false; return false;
} }
@ -116,7 +116,7 @@ character.old={
precontent:function(){ precontent:function(){
'step 0' 'step 0'
player.chooseTarget('选择交换手牌的目标',function(card,player,target){ player.chooseTarget('选择交换手牌的目标',function(card,player,target){
return target.num('h')<player.num('h') return target.countCards('h')<player.countCards('h')
},true).ai=function(target){ },true).ai=function(target){
return ai.get.attitude(player,target); return ai.get.attitude(player,target);
} }
@ -137,9 +137,9 @@ character.old={
order:function(){ order:function(){
var player=_status.event.player; var player=_status.event.player;
var event=_status.event; var event=_status.event;
var nh=player.num('h'); var nh=player.countCards('h');
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return ai.get.attitude(player,current)>0&&current.num('h')<nh; return ai.get.attitude(player,current)>0&&current.countCards('h')<nh;
})){ })){
if(event.type=='dying'){ if(event.type=='dying'){
if(event.filterCard({name:'tao'},player,event)){ if(event.filterCard({name:'tao'},player,event)){
@ -161,9 +161,9 @@ character.old={
respondSha:true, respondSha:true,
skillTagFilter:function(player,tag,arg){ skillTagFilter:function(player,tag,arg){
if(player.hasSkill('zhenshan2')) return false; if(player.hasSkill('zhenshan2')) return false;
var nh=player.num('h'); var nh=player.countCards('h');
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return current!=player&&current.num('h')<nh; return current!=player&&current.countCards('h')<nh;
}); });
}, },
result:{ result:{
@ -209,7 +209,7 @@ character.old={
var dialog=ui.create.dialog('选择获得卡牌的目标',cards,'hidden'); var dialog=ui.create.dialog('选择获得卡牌的目标',cards,'hidden');
dialog.classList.add('noselect'); dialog.classList.add('noselect');
player.chooseTarget(true,dialog).ai=function(target){ player.chooseTarget(true,dialog).ai=function(target){
return ai.get.attitude(player,target)/Math.sqrt(1+target.num('h')); return ai.get.attitude(player,target)/Math.sqrt(1+target.countCards('h'));
} }
} }
else{ else{

View File

@ -180,7 +180,7 @@ character.ow={
return 8-ai.get.value(card); return 8-ai.get.value(card);
}, },
filter:function(event,player){ filter:function(event,player){
return player.num('he')>=2; return player.countCards('he')>=2;
}, },
content:function(){ content:function(){
player.changeHujia(2); player.changeHujia(2);
@ -252,7 +252,7 @@ character.ow={
dianji:{ dianji:{
enable:'phaseUse', enable:'phaseUse',
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0; return player.countCards('h')>0;
}, },
filterCard:true, filterCard:true,
usable:1, usable:1,
@ -275,7 +275,7 @@ character.ow={
trigger:{player:'phaseUseBegin'}, trigger:{player:'phaseUseBegin'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return player.num('he')>0; return player.countCards('he')>0;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -289,7 +289,7 @@ character.ow={
ai2:function(target){ ai2:function(target){
var att=ai.get.attitude(player,target); var att=ai.get.attitude(player,target);
if(att>=0) return 0; if(att>=0) return 0;
if(!target.num('he')) return -0.01; if(!target.countCards('he')) return -0.01;
var dist=get.distance(player,target); var dist=get.distance(player,target);
if(dist>2){ if(dist>2){
att-=2; att-=2;
@ -690,7 +690,7 @@ character.ow={
filter:function(event,player){ filter:function(event,player){
if(player.storage.qinru){ if(player.storage.qinru){
for(var i=0;i<player.storage.qinru.length;i++){ for(var i=0;i<player.storage.qinru.length;i++){
if(player.storage.qinru[i].isIn()&&player.storage.qinru[i].num('he')) return true; if(player.storage.qinru[i].isIn()&&player.storage.qinru[i].countCards('he')) return true;
} }
} }
}, },
@ -699,7 +699,7 @@ character.ow={
var list=[]; var list=[];
if(player.storage.qinru){ if(player.storage.qinru){
for(var i=0;i<player.storage.qinru.length;i++){ for(var i=0;i<player.storage.qinru.length;i++){
if(player.storage.qinru[i].isIn()&&player.storage.qinru[i].num('he')){ if(player.storage.qinru[i].isIn()&&player.storage.qinru[i].countCards('he')){
list.push(player.storage.qinru[i]); list.push(player.storage.qinru[i]);
} }
} }
@ -711,7 +711,7 @@ character.ow={
var list=[]; var list=[];
if(player.storage.qinru){ if(player.storage.qinru){
for(var i=0;i<player.storage.qinru.length;i++){ for(var i=0;i<player.storage.qinru.length;i++){
if(player.storage.qinru[i].isIn()&&player.storage.qinru[i].num('he')){ if(player.storage.qinru[i].isIn()&&player.storage.qinru[i].countCards('he')){
list.push(player.storage.qinru[i]); list.push(player.storage.qinru[i]);
} }
} }
@ -720,7 +720,7 @@ character.ow={
'step 1' 'step 1'
if(event.list.length){ if(event.list.length){
var current=event.list.shift(); var current=event.list.shift();
var he=current.get('he'); var he=current.getCards('he');
if(he.length){ if(he.length){
var card=he.randomGet(); var card=he.randomGet();
current.discard(card); current.discard(card);
@ -956,7 +956,7 @@ character.ow={
content:function(){ content:function(){
'step 0' 'step 0'
var targets=player.getEnemies(function(target){ var targets=player.getEnemies(function(target){
return target.num('he')>0; return target.countCards('he')>0;
}); });
if(targets.length){ if(targets.length){
event.targets=targets.randomGets(3); event.targets=targets.randomGets(3);
@ -971,7 +971,7 @@ character.ow={
'step 1' 'step 1'
if(event.targets.length){ if(event.targets.length){
var target=event.targets.shift(); var target=event.targets.shift();
var he=target.get('he'); var he=target.getCards('he');
if(he.length){ if(he.length){
target.discard(he.randomGet()); target.discard(he.randomGet());
} }
@ -991,7 +991,7 @@ character.ow={
usable:1, usable:1,
alter:true, alter:true,
filter:function(event,player){ filter:function(event,player){
return player.num('h')>=1; return player.countCards('h')>=1;
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player; return target!=player;
@ -1045,7 +1045,7 @@ character.ow={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0; return player.countCards('h')>0;
}, },
filterCard:true, filterCard:true,
check:function(card){ check:function(card){
@ -1175,15 +1175,15 @@ character.ow={
tiandan:{ tiandan:{
trigger:{player:'phaseDrawBegin'}, trigger:{player:'phaseDrawBegin'},
filter:function(event,player){ filter:function(event,player){
return Math.min(5,player.hp)>player.num('h')&&!player.skipList.contains('phaseUse')&&!player.skipList.contains('phaseDiscard'); return Math.min(5,player.hp)>player.countCards('h')&&!player.skipList.contains('phaseUse')&&!player.skipList.contains('phaseDiscard');
}, },
check:function(event,player){ check:function(event,player){
var nh=player.num('h'); var nh=player.countCards('h');
if(Math.min(5,player.hp)-nh>=2) return true; if(Math.min(5,player.hp)-nh>=2) return true;
return false; return false;
}, },
content:function(){ content:function(){
var num=Math.min(5,player.hp)-player.num('h'); var num=Math.min(5,player.hp)-player.countCards('h');
var cards=[]; var cards=[];
while(num--){ while(num--){
cards.push(game.createCard('sha')); cards.push(game.createCard('sha'));
@ -1214,7 +1214,7 @@ character.ow={
order:7.9, order:7.9,
result:{ result:{
target:function(player,target){ target:function(player,target){
var nh=target.num('h'); var nh=target.countCards('h');
if(ai.get.attitude(player,target)<0&&nh>=3&& if(ai.get.attitude(player,target)<0&&nh>=3&&
player.canUse('sha',target)&&player.num('h','sha')&& player.canUse('sha',target)&&player.num('h','sha')&&
ai.get.effect(target,{name:'sha'},player,player)>0){ ai.get.effect(target,{name:'sha'},player,player)>0){
@ -1283,7 +1283,7 @@ character.ow={
} }
'step 1' 'step 1'
if(!get.is.altered('baoxue')){ if(!get.is.altered('baoxue')){
var he=target.get('he'); var he=target.getCards('he');
if(he.length){ if(he.length){
target.discard(he.randomGet()); target.discard(he.randomGet());
} }
@ -1317,7 +1317,7 @@ character.ow={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filter:function(event,player){ filter:function(event,player){
return player.num('he')>0; return player.countCards('he')>0;
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&!target.hasSkill('mianzhen2'); return target!=player&&!target.hasSkill('mianzhen2');
@ -1337,7 +1337,7 @@ character.ow={
order:2.2, order:2.2,
result:{ result:{
target:function(player,target){ target:function(player,target){
return Math.min(-0.1,-1-target.num('h')+Math.sqrt(target.hp)/2); return Math.min(-0.1,-1-target.countCards('h')+Math.sqrt(target.hp)/2);
} }
} }
} }
@ -1418,7 +1418,7 @@ character.ow={
}, },
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
return player.num('h')==event.player.num('h')&&event.notLink(); return player.countCards('h')==event.player.countCards('h')&&event.notLink();
}, },
content:function(){ content:function(){
trigger.num++; trigger.num++;
@ -1442,7 +1442,7 @@ character.ow={
usable:1, usable:1,
position:'he', position:'he',
filter:function(event,player){ filter:function(event,player){
return player.num('he')>0; return player.countCards('he')>0;
}, },
filterCard:function(card){ filterCard:function(card){
var suit=get.suit(card); var suit=get.suit(card);
@ -1453,7 +1453,7 @@ character.ow={
}, },
complexCard:true, complexCard:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.num('h')>0; return target!=player&&target.countCards('h')>0;
}, },
check:function(card){ check:function(card){
if(ui.selected.cards.length>1) return 0; if(ui.selected.cards.length>1) return 0;
@ -1486,7 +1486,7 @@ character.ow={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(!player.num('h','sha')) return 0; if(!player.num('h','sha')) return 0;
if(target.num('h')<=1&&get.distance(player,target,'attack')<=1) return 0; if(target.countCards('h')<=1&&get.distance(player,target,'attack')<=1) return 0;
var min=[]; var min=[];
var num=0; var num=0;
var players=game.filterPlayer(); var players=game.filterPlayer();
@ -1502,7 +1502,7 @@ character.ow={
} }
for(var i=0;i<min.length;i++){ for(var i=0;i<min.length;i++){
if(ai.get.attitude(player,min[i])>0) return 0; if(ai.get.attitude(player,min[i])>0) return 0;
if(min[i].num('h')<=1&&get.distance(player,min[i],'attack')<=1) return 0; if(min[i].countCards('h')<=1&&get.distance(player,min[i],'attack')<=1) return 0;
} }
if(min.contains(target)) return -1; if(min.contains(target)) return -1;
return 0; return 0;
@ -1585,7 +1585,7 @@ character.ow={
game.addVideo('storage',player,['dulei',null]); game.addVideo('storage',player,['dulei',null]);
trigger.player.loseHp(); trigger.player.loseHp();
'step 2' 'step 2'
var he=trigger.player.get('he'); var he=trigger.player.getCards('he');
if(he.length){ if(he.length){
trigger.player.discard(he.randomGet()); trigger.player.discard(he.randomGet());
} }
@ -1796,7 +1796,7 @@ character.ow={
trigger:{global:'phaseBegin'}, trigger:{global:'phaseBegin'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return player.num('he')>0; return player.countCards('he')>0;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -1810,7 +1810,7 @@ character.ow={
if(Math.random()<0.5) goon=true; if(Math.random()<0.5) goon=true;
} }
if(Math.random()<0.3) goon2=true; if(Math.random()<0.3) goon2=true;
player.chooseToDiscard([1,player.num('h')],'he',get.prompt('bingqiang',trigger.player)).set('logSkill',['bingqiang',trigger.player]).ai=function(card){ player.chooseToDiscard([1,player.countCards('h')],'he',get.prompt('bingqiang',trigger.player)).set('logSkill',['bingqiang',trigger.player]).ai=function(card){
if(ui.selected.cards.length) return 0; if(ui.selected.cards.length) return 0;
if(goon) return 6-ai.get.value(card); if(goon) return 6-ai.get.value(card);
if(goon2) return 4-ai.get.value(card); if(goon2) return 4-ai.get.value(card);
@ -2096,7 +2096,7 @@ character.ow={
'step 0' 'step 0'
var num=player.storage.jijia; var num=player.storage.jijia;
if(get.is.altered('zihui')){ if(get.is.altered('zihui')){
num=Math.max(1,Math.min(num,target.num('he'))); num=Math.max(1,Math.min(num,target.countCards('he')));
} }
target.chooseToDiscard(num,'he','弃置'+get.cnNumber(num)+'张牌或受到2点火焰伤害').ai=function(card){ target.chooseToDiscard(num,'he','弃置'+get.cnNumber(num)+'张牌或受到2点火焰伤害').ai=function(card){
if(target.hasSkillTag('nofire')) return 0; if(target.hasSkillTag('nofire')) return 0;
@ -2124,7 +2124,7 @@ character.ow={
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i]==player||players[i].hasSkillTag('nofire')||get.distance(player,players[i])>2) continue; if(players[i]==player||players[i].hasSkillTag('nofire')||get.distance(player,players[i])>2) continue;
var nh=players[i].num('h'); var nh=players[i].countCards('h');
var att=ai.get.attitude(player,players[i]); var att=ai.get.attitude(player,players[i]);
if(nh<player.storage.jijia){ if(nh<player.storage.jijia){
if(att<0){ if(att<0){
@ -2164,7 +2164,7 @@ character.ow={
direct:true, direct:true,
content:function(){ content:function(){
"step 0" "step 0"
var dis=trigger.target.num('h','shan')||trigger.target.num('e','bagua')||trigger.target.num('h')>2; var dis=trigger.target.num('h','shan')||trigger.target.num('e','bagua')||trigger.target.countCards('h')>2;
var next=player.chooseToDiscard(get.prompt('xiandan')); var next=player.chooseToDiscard(get.prompt('xiandan'));
next.ai=function(card){ next.ai=function(card){
if(dis) return 7-ai.get.value(card); if(dis) return 7-ai.get.value(card);
@ -2296,7 +2296,7 @@ character.ow={
'step 0' 'step 0'
player.discardPlayerCard(get.prompt('mujing'),trigger.target).logSkill=['mujing']; player.discardPlayerCard(get.prompt('mujing'),trigger.target).logSkill=['mujing'];
'step 1' 'step 1'
if(result.bool&&player.num('h')<=trigger.target.num('h')){ if(result.bool&&player.countCards('h')<=trigger.target.countCards('h')){
player.draw(); player.draw();
} }
} }
@ -2315,13 +2315,13 @@ character.ow={
}, },
filter:function(event,player){ filter:function(event,player){
if(player.storage.zhanlong) return false; if(player.storage.zhanlong) return false;
if(player.num('he')==0) return false; if(player.countCards('he')==0) return false;
if(player.hp!=1) return false; if(player.hp!=1) return false;
return true; return true;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
player.discard(player.get('he')); player.discard(player.getCards('he'));
'step 1' 'step 1'
player.addTempSkill('zhanlong2','phaseAfter'); player.addTempSkill('zhanlong2','phaseAfter');
player.awakenSkill('zhanlong'); player.awakenSkill('zhanlong');
@ -2340,7 +2340,7 @@ character.ow={
effect:{ effect:{
target:function(card,player,target){ target:function(card,player,target){
if(!target.hasFriend()) return; if(!target.hasFriend()) return;
if(get.tag(card,'damage')==1&&target.hp==2&&target.num('he')&& if(get.tag(card,'damage')==1&&target.hp==2&&target.countCards('he')&&
!target.isTurnedOver()&&_status.currentPhase!=target){ !target.isTurnedOver()&&_status.currentPhase!=target){
if(get.distance(_status.currentPhase,target,'absolute')<=2) return [0.5,1]; if(get.distance(_status.currentPhase,target,'absolute')<=2) return [0.5,1];
return 0.8; return 0.8;
@ -2831,7 +2831,7 @@ character.ow={
trigger:{source:'damageAfter'}, trigger:{source:'damageAfter'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
if(player.num('he')==0) return false; if(player.countCards('he')==0) return false;
if(!event.card) return false; if(!event.card) return false;
if(event.card.name!='sha') return false; if(event.card.name!='sha') return false;
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
@ -2889,7 +2889,7 @@ character.ow={
if(player.storage.yuedong_recover){ if(player.storage.yuedong_recover){
return ai.get.recoverEffect(target,player,player); return ai.get.recoverEffect(target,player,player);
} }
var att=ai.get.attitude(player,target)/Math.sqrt(2+target.num('h')); var att=ai.get.attitude(player,target)/Math.sqrt(2+target.countCards('h'));
if(player==target){ if(player==target){
var num2=player.needsToDiscard(num); var num2=player.needsToDiscard(num);
if(num2>1) return att/5; if(num2>1) return att/5;
@ -2927,7 +2927,7 @@ character.ow={
selectCard:2, selectCard:2,
position:'he', position:'he',
filter:function(event,player){ filter:function(event,player){
return player.num('he')>1&&!player.storage.yuedong_recover; return player.countCards('he')>1&&!player.storage.yuedong_recover;
}, },
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-ai.get.value(card);
@ -2973,7 +2973,7 @@ character.ow={
filter:function(event,player){ filter:function(event,player){
if(get.is.altered('kuoyin')&&player.storage.yuedong_num) return false; if(get.is.altered('kuoyin')&&player.storage.yuedong_num) return false;
if(player.storage.yuedong_eff&&player.storage.yuedong_num) return false; if(player.storage.yuedong_eff&&player.storage.yuedong_num) return false;
return player.num('he')>0; return player.countCards('he')>0;
}, },
check:function(card){ check:function(card){
var player=_status.event.player; var player=_status.event.player;
@ -3048,7 +3048,7 @@ character.ow={
return 6-ai.get.value(card); return 6-ai.get.value(card);
}, },
filter:function(event,player){ filter:function(event,player){
return player.num('he')>0; return player.countCards('he')>0;
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return !target.hasSkill('guangshu_heart')&& return !target.hasSkill('guangshu_heart')&&
@ -3070,8 +3070,8 @@ character.ow={
if(!ui.selected.cards.length) return 0; if(!ui.selected.cards.length) return 0;
switch(get.suit(ui.selected.cards[0])){ switch(get.suit(ui.selected.cards[0])){
case 'heart':if(target.hp==1) return 1;return 0.1; case 'heart':if(target.hp==1) return 1;return 0.1;
case 'diamond':return 1+Math.sqrt(target.num('h')); case 'diamond':return 1+Math.sqrt(target.countCards('h'));
case 'club':return -target.num('h')-Math.sqrt(target.num('h','sha')); case 'club':return -target.countCards('h')-Math.sqrt(target.num('h','sha'));
case 'spade':return ai.get.damageEffect(target,player,target,'thunder'); case 'spade':return ai.get.damageEffect(target,player,target,'thunder');
default:return 0; default:return 0;
} }
@ -3179,7 +3179,7 @@ character.ow={
}, },
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.player)<0&& return ai.get.attitude(player,event.player)<0&&
((player.num('h')>player.hp&&player.num('h','lebu')==0)||get.distance(player,event.player)>1); ((player.countCards('h')>player.hp&&player.num('h','lebu')==0)||get.distance(player,event.player)>1);
}, },
alter:true, alter:true,
intro:{ intro:{
@ -3233,8 +3233,8 @@ character.ow={
player.$draw(); player.$draw();
} }
"step 1" "step 1"
player.storage.shanxian_h=player.get('h'); player.storage.shanxian_h=player.getCards('h');
player.storage.shanxian_e=player.get('e'); player.storage.shanxian_e=player.getCards('e');
player.storage.shanxian_n=1; player.storage.shanxian_n=1;
player.syncStorage('shanxian_e'); player.syncStorage('shanxian_e');
player.phase(); player.phase();
@ -3275,7 +3275,7 @@ character.ow={
player.storage.shanxian_n>0&&!player.hasSkill('shanxian2'); player.storage.shanxian_n>0&&!player.hasSkill('shanxian2');
}, },
check:function(event,player){ check:function(event,player){
var n1=player.num('he'); var n1=player.countCards('he');
var n2=player.storage.shanxian_h.length+player.storage.shanxian_e.length; var n2=player.storage.shanxian_h.length+player.storage.shanxian_e.length;
if(n1<n2) return true; if(n1<n2) return true;
if(player.hp==player.maxHp) return false; if(player.hp==player.maxHp) return false;
@ -3284,7 +3284,7 @@ character.ow={
return false; return false;
}, },
video:function(player){ video:function(player){
var cards=player.get('he'); var cards=player.getCards('he');
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
cards[i].remove(); cards[i].remove();
} }
@ -3305,7 +3305,7 @@ character.ow={
} }
} }
player.removeEquipTrigger(); player.removeEquipTrigger();
var cards=player.get('he'); var cards=player.getCards('he');
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
ui.discardPile.appendChild(cards[i]); ui.discardPile.appendChild(cards[i]);
} }

View File

@ -47,8 +47,8 @@ character.refresh={
if(ui.selected.cards.length&&ui.selected.cards[0].name=='du') return 0; if(ui.selected.cards.length&&ui.selected.cards[0].name=='du') return 0;
if(!ui.selected.cards.length&&card.name=='du') return 20; if(!ui.selected.cards.length&&card.name=='du') return 20;
var player=get.owner(card); var player=get.owner(card);
if(ui.selected.cards.length>=Math.max(2,player.num('h')-player.hp)) return 0; if(ui.selected.cards.length>=Math.max(2,player.countCards('h')-player.hp)) return 0;
if(player.hp==player.maxHp||player.storage.rerende<0||player.num('h')<=1){ if(player.hp==player.maxHp||player.storage.rerende<0||player.countCards('h')<=1){
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i].get('s').contains('haoshi')&& if(players[i].get('s').contains('haoshi')&&
@ -59,8 +59,8 @@ character.refresh={
return 11-ai.get.value(card); return 11-ai.get.value(card);
} }
} }
if(player.num('h')>player.hp) return 10-ai.get.value(card); if(player.countCards('h')>player.hp) return 10-ai.get.value(card);
if(player.num('h')>2) return 6-ai.get.value(card); if(player.countCards('h')>2) return 6-ai.get.value(card);
return -1; return -1;
} }
return 10-ai.get.value(card); return 10-ai.get.value(card);
@ -159,7 +159,7 @@ character.refresh={
}, },
ai:{ ai:{
order:function(skill,player){ order:function(skill,player){
if(player.hp<player.maxHp&&player.storage.rerende<2&&player.num('h')>1){ if(player.hp<player.maxHp&&player.storage.rerende<2&&player.countCards('h')>1){
return 10; return 10;
} }
return 4; return 4;
@ -171,9 +171,9 @@ character.refresh={
return -10; return -10;
} }
if(target.num('j','lebu')) return 0; if(target.num('j','lebu')) return 0;
var nh=target.num('h'); var nh=target.countCards('h');
var np=player.num('h'); var np=player.countCards('h');
if(player.hp==player.maxHp||player.storage.rerende<0||player.num('h')<=1){ if(player.hp==player.maxHp||player.storage.rerende<0||player.countCards('h')<=1){
if(nh>=np-1&&np<=player.hp&&!target.get('s').contains('haoshi')) return 0; if(nh>=np-1&&np<=player.hp&&!target.get('s').contains('haoshi')) return 0;
} }
return Math.max(1,5-nh); return Math.max(1,5-nh);
@ -210,7 +210,7 @@ character.refresh={
trigger:{source:'damageEnd'}, trigger:{source:'damageEnd'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
return event.card&&event.card.name=='sha'&&event.player.isAlive()&&event.player.num('he')>0; return event.card&&event.card.name=='sha'&&event.player.isAlive()&&event.player.countCards('he')>0;
}, },
check:function(){ check:function(){
return false; return false;
@ -282,7 +282,7 @@ character.refresh={
content:function(){ content:function(){
"step 0" "step 0"
player.chooseTarget(get.prompt('retuxi'),[1,2],function(card,player,target){ player.chooseTarget(get.prompt('retuxi'),[1,2],function(card,player,target){
return target.num('h')>0&&player!=target&&target.num('h')>=player.num('h'); return target.countCards('h')>0&&player!=target&&target.countCards('h')>=player.countCards('h');
},function(target){ },function(target){
var att=ai.get.attitude(_status.event.player,target); var att=ai.get.attitude(_status.event.player,target);
if(target.hasSkill('tuntian')) return att/10; if(target.hasSkill('tuntian')) return att/10;
@ -310,7 +310,7 @@ character.refresh={
trigger:{global:'judge'}, trigger:{global:'judge'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return player.num('he')>0; return player.countCards('he')>0;
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -368,7 +368,7 @@ character.refresh={
trigger:{player:'damageEnd'}, trigger:{player:'damageEnd'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return (event.source&&event.source.num('he')&&event.num>0&&event.source!=player); return (event.source&&event.source.countCards('he')&&event.num>0&&event.source!=player);
}, },
content:function(){ content:function(){
player.gainPlayerCard([1,trigger.num],get.prompt('fankui',trigger.source),trigger.source,ai.get.buttonValue,'he').set('logSkill',['refankui',trigger.source]); player.gainPlayerCard([1,trigger.num],get.prompt('fankui',trigger.source),trigger.source,ai.get.buttonValue,'he').set('logSkill',['refankui',trigger.source]);
@ -376,7 +376,7 @@ character.refresh={
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target){ target:function(card,player,target){
if(player.num('he')>1&&get.tag(card,'damage')){ if(player.countCards('he')>1&&get.tag(card,'damage')){
if(player.hasSkillTag('jueqing')) return [1,-1.5]; if(player.hasSkillTag('jueqing')) return [1,-1.5];
if(ai.get.attitude(target,player)<0) return [1,1]; if(ai.get.attitude(target,player)<0) return [1,1];
} }
@ -439,7 +439,7 @@ character.refresh={
return 1; return 1;
}) })
"step 2" "step 2"
if(result.judge==1&&trigger.source.num('he')){ if(result.judge==1&&trigger.source.countCards('he')){
player.discardPlayerCard(trigger.source,'he',true); player.discardPlayerCard(trigger.source,'he',true);
} }
else{ else{
@ -472,8 +472,8 @@ character.refresh={
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
if(player.storage.qinxue) return false; if(player.storage.qinxue) return false;
if(player.num('h')>=player.hp+3) return true; if(player.countCards('h')>=player.hp+3) return true;
if(player.num('h')>=player.hp+2&&game.players.length+game.dead.length>=7) return true; if(player.countCards('h')>=player.hp+2&&game.players.length+game.dead.length>=7) return true;
return false; return false;
}, },
content:function(){ content:function(){
@ -508,7 +508,7 @@ character.refresh={
ai1:function(card){ ai1:function(card){
if(ui.selected.cards.length>0) return -1; if(ui.selected.cards.length>0) return -1;
if(card.name=='du') return 20; if(card.name=='du') return 20;
return (_status.event.player.num('h')-_status.event.player.hp); return (_status.event.player.countCards('h')-_status.event.player.hp);
}, },
ai2:function(target){ ai2:function(target){
var att=ai.get.attitude(_status.event.player,target); var att=ai.get.attitude(_status.event.player,target);
@ -516,7 +516,7 @@ character.refresh={
if(target.hasSkillTag('nodu')) return 0; if(target.hasSkillTag('nodu')) return 0;
return 1-att; return 1-att;
} }
if(target.num('h')>_status.event.player.num('h')) return 0; if(target.countCards('h')>_status.event.player.countCards('h')) return 0;
return att-4; return att-4;
}, },
prompt:'请选择要送人的卡牌' prompt:'请选择要送人的卡牌'
@ -562,7 +562,7 @@ character.refresh={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0; return player.countCards('h')>0;
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return player!=target; return player!=target;
@ -610,7 +610,7 @@ character.refresh={
order:9, order:9,
result:{ result:{
target:function(player,target){ target:function(player,target){
return -target.num('he')-(player.num('h','du')?1:0); return -target.countCards('he')-(player.num('h','du')?1:0);
} }
}, },
threaten:2, threaten:2,
@ -623,7 +623,7 @@ character.refresh={
audio:2, audio:2,
trigger:{target:'useCardToBegin',player:'judgeBefore'}, trigger:{target:'useCardToBegin',player:'judgeBefore'},
filter:function(event,player){ filter:function(event,player){
if(player.num('h')==0) return false; if(player.countCards('h')==0) return false;
if(event.parent.name=='phaseJudge'){ if(event.parent.name=='phaseJudge'){
if(lib.skill.reqianxun.trigger.player=='judgeBefore'){ if(lib.skill.reqianxun.trigger.player=='judgeBefore'){
return true; return true;
@ -635,9 +635,9 @@ character.refresh={
if(event.card&&get.type(event.card)=='trick'&&event.player!=player) return true; if(event.card&&get.type(event.card)=='trick'&&event.player!=player) return true;
}, },
content:function(){ content:function(){
player.storage.reqianxun2=player.storage.reqianxun2.concat(player.get('h')); player.storage.reqianxun2=player.storage.reqianxun2.concat(player.getCards('h'));
game.addVideo('storage',player,['reqianxun2',get.cardsInfo(player.storage.reqianxun2),'cards']); game.addVideo('storage',player,['reqianxun2',get.cardsInfo(player.storage.reqianxun2),'cards']);
player.lose(player.get('h'),ui.special); player.lose(player.getCards('h'),ui.special);
player.addSkill('reqianxun2'); player.addSkill('reqianxun2');
}, },
ai:{ ai:{
@ -667,7 +667,7 @@ character.refresh={
trigger:{player:'loseEnd'}, trigger:{player:'loseEnd'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
if(player.num('h')) return false; if(player.countCards('h')) return false;
for(var i=0;i<event.cards.length;i++){ for(var i=0;i<event.cards.length;i++){
if(event.cards[i].original=='h') return true; if(event.cards[i].original=='h') return true;
} }
@ -784,7 +784,7 @@ character.refresh={
return -att; return -att;
} }
if(att>0){ if(att>0){
return att+Math.max(0,5-target.num('h')); return att+Math.max(0,5-target.countCards('h'));
} }
return att; return att;
}).set('du',event.card.name=='du'); }).set('du',event.card.name=='du');
@ -843,7 +843,7 @@ character.refresh={
ai:{ ai:{
effect:{ effect:{
target:function(card,player){ target:function(card,player){
if(get.tag(card,'respond')&&player.num('h')>1) return [1,0.2]; if(get.tag(card,'respond')&&player.countCards('h')>1) return [1,0.2];
} }
} }
} }
@ -910,7 +910,7 @@ character.refresh={
ai1:function(card){ ai1:function(card){
if(ui.selected.cards.length>0) return -1; if(ui.selected.cards.length>0) return -1;
if(card.name=='du') return 20; if(card.name=='du') return 20;
return (_status.event.player.num('h')-_status.event.player.hp); return (_status.event.player.countCards('h')-_status.event.player.hp);
}, },
ai2:function(target){ ai2:function(target){
var att=ai.get.attitude(_status.event.player,target); var att=ai.get.attitude(_status.event.player,target);
@ -992,10 +992,10 @@ character.refresh={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return player!=target&&target.num('h'); return player!=target&&target.countCards('h');
}, },
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0; return player.countCards('h')>0;
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -1024,7 +1024,7 @@ character.refresh={
ai:{ ai:{
result:{ result:{
target:function(player,target){ target:function(player,target){
var hs=player.get('h'); var hs=player.getCards('h');
if(hs.length<3) return 0; if(hs.length<3) return 0;
var bool=false; var bool=false;
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
@ -1034,7 +1034,7 @@ character.refresh={
} }
} }
if(!bool) return 0; if(!bool) return 0;
if(target.num('h')>target.hp+1&&ai.get.recoverEffect(target)>0){ if(target.countCards('h')>target.hp+1&&ai.get.recoverEffect(target)>0){
return 1; return 1;
} }
if(player.canUse('sha',target)&&(player.num('h','sha')||player.num('he',{color:'red'}))){ if(player.canUse('sha',target)&&(player.num('h','sha')||player.num('he',{color:'red'}))){
@ -1116,7 +1116,7 @@ character.refresh={
direct:true, direct:true,
filter:function(event){ filter:function(event){
return event.card&&event.card.name=='sha'&&event.cards&& return event.card&&event.card.name=='sha'&&event.cards&&
get.color(event.cards)=='black'&&event.player.num('e'); get.color(event.cards)=='black'&&event.player.countCards('e');
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -1155,9 +1155,9 @@ character.refresh={
order:8, order:8,
result:{ result:{
player:function(player){ player:function(player){
if(player.hp<=2) return player.num('h')==0?1:0; if(player.hp<=2) return player.countCards('h')==0?1:0;
if(player.num('h',{name:'sha',color:'red'})) return 1; if(player.num('h',{name:'sha',color:'red'})) return 1;
return player.num('h')<=player.hp?1:0; return player.countCards('h')<=player.hp?1:0;
} }
}, },
effect:function(card,player){ effect:function(card,player){
@ -1246,8 +1246,8 @@ character.refresh={
player.chooseControl(['red','black','basic','trick','equip']).set('ai',function(){ player.chooseControl(['red','black','basic','trick','equip']).set('ai',function(){
var player=_status.event.player; var player=_status.event.player;
if(player.num('shan')==0) return 'basic'; if(player.num('shan')==0) return 'basic';
if(player.num('e')<=1) return 'equip'; if(player.countCards('e')<=1) return 'equip';
if(player.num('h')>2) return 'trick'; if(player.countCards('h')>2) return 'trick';
return 'red'; return 'red';
}); });
"step 1" "step 1"
@ -1379,10 +1379,10 @@ character.refresh={
for(var i=0;i<ui.selected.targets.length;i++){ for(var i=0;i<ui.selected.targets.length;i++){
if(ui.selected.targets[i].group==target.group) return false; if(ui.selected.targets[i].group==target.group) return false;
} }
return target.num('he')>0; return target.countCards('he')>0;
}, },
filter:function(event,player){ filter:function(event,player){
return player.num('he')>0; return player.countCards('he')>0;
}, },
filterCard:true, filterCard:true,
position:'he', position:'he',

View File

@ -83,7 +83,7 @@ character.shenhua={
jianchu:{ jianchu:{
trigger:{player:'shaBegin'}, trigger:{player:'shaBegin'},
filter:function(event){ filter:function(event){
return event.target.num('he')>0; return event.target.countCards('he')>0;
}, },
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.player)<=0; return ai.get.attitude(player,event.player)<=0;
@ -122,14 +122,14 @@ character.shenhua={
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(player==target) return false; if(player==target) return false;
if(ui.selected.targets.length==0) return true; if(ui.selected.targets.length==0) return true;
return (Math.abs(ui.selected.targets[0].num('h')-target.num('h'))== return (Math.abs(ui.selected.targets[0].countCards('h')-target.countCards('h'))==
ui.selected.cards.length); ui.selected.cards.length);
}, },
multitarget:true, multitarget:true,
multiline:true, multiline:true,
content:function(){ content:function(){
'step 0' 'step 0'
var cards=targets[0].get('h').concat(targets[1].get('h')); var cards=targets[0].getCards('h').concat(targets[1].getCards('h'));
var dialog=ui.create.dialog('缔盟',true); var dialog=ui.create.dialog('缔盟',true);
if(player.isUnderControl(true)||targets[0].isUnderControl(true)||targets[1].isUnderControl(true)){ if(player.isUnderControl(true)||targets[0].isUnderControl(true)||targets[1].isUnderControl(true)){
dialog.add(cards); dialog.add(cards);
@ -260,21 +260,21 @@ character.shenhua={
var from,nh; var from,nh;
if(list.length==0) return null; if(list.length==0) return null;
list.sort(function(a,b){ list.sort(function(a,b){
return a.num('h')-b.num('h'); return a.countCards('h')-b.countCards('h');
}); });
if(type==1) return list[0]; if(type==1) return list[0];
from=list[0]; from=list[0];
nh=from.num('h'); nh=from.countCards('h');
list=game.filterPlayer(function(current){ list=game.filterPlayer(function(current){
return current!=player&&ai.get.attitude(player,current)<1; return current!=player&&ai.get.attitude(player,current)<1;
}); });
if(list.length==0) return null; if(list.length==0) return null;
list.sort(function(a,b){ list.sort(function(a,b){
return b.num('h')-a.num('h'); return b.countCards('h')-a.countCards('h');
}); });
for(var i=0;i<list.length;i++){ for(var i=0;i<list.length;i++){
var nh2=list[i].num('h'); var nh2=list[i].countCards('h');
if(nh2-nh<=num){ if(nh2-nh<=num){
count=nh2-nh;break; count=nh2-nh;break;
} }
@ -534,12 +534,12 @@ character.shenhua={
return ai.get.attitude(player,event.target)<=0; return ai.get.attitude(player,event.target)<=0;
}, },
filter:function(event,player){ filter:function(event,player){
if(event.target.num('h')<=player.num('h')) return true; if(event.target.countCards('h')<=player.countCards('h')) return true;
if(event.target.hp<=player.hp) return true; if(event.target.hp<=player.hp) return true;
return false; return false;
}, },
content:function(){ content:function(){
if(trigger.target.num('h')<=player.num('h')) trigger.directHit=true; if(trigger.target.countCards('h')<=player.countCards('h')) trigger.directHit=true;
if(trigger.target.hp>=player.hp) player.addTempSkill('xinliegong2','shaAfter'); if(trigger.target.hp>=player.hp) player.addTempSkill('xinliegong2','shaAfter');
}, },
ai:{ ai:{
@ -562,13 +562,13 @@ character.shenhua={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.canUse({name:'sha'},player)&&target.num('he'); return target.canUse({name:'sha'},player)&&target.countCards('he');
}, },
content:function(){ content:function(){
"step 0" "step 0"
target.chooseToUse({name:'sha'},player,-1,'挑衅:对'+get.translation(player)+'使用一张杀,或令其弃置你的一张牌').set('targetRequired',true); target.chooseToUse({name:'sha'},player,-1,'挑衅:对'+get.translation(player)+'使用一张杀,或令其弃置你的一张牌').set('targetRequired',true);
"step 1" "step 1"
if(result.bool==false&&target.num('he')>0){ if(result.bool==false&&target.countCards('he')>0){
player.discardPlayerCard(target,'he',true); player.discardPlayerCard(target,'he',true);
} }
else{ else{
@ -581,8 +581,8 @@ character.shenhua={
result:{ result:{
target:-1, target:-1,
player:function(player,target){ player:function(player,target){
if(target.num('h')==0) return 0; if(target.countCards('h')==0) return 0;
if(target.num('h')==1) return -0.1; if(target.countCards('h')==1) return -0.1;
if(player.hp<=2) return -2; if(player.hp<=2) return -2;
if(player.num('h','shan')==0) return -1; if(player.num('h','shan')==0) return -1;
return -0.5; return -0.5;
@ -601,7 +601,7 @@ character.shenhua={
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
if(player.storage.zhiji) return false; if(player.storage.zhiji) return false;
return player.num('h')==0; return player.countCards('h')==0;
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -676,12 +676,12 @@ character.shenhua={
audio:2, audio:2,
trigger:{player:'phaseUseBefore'}, trigger:{player:'phaseUseBefore'},
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0&&!player.hasSkill('fangquan3'); return player.countCards('h')>0&&!player.hasSkill('fangquan3');
}, },
direct:true, direct:true,
content:function(){ content:function(){
"step 0" "step 0"
var fang=player.hp>=2&&player.num('h')<=player.hp+1; var fang=player.hp>=2&&player.countCards('h')<=player.hp+1;
player.chooseTarget(get.prompt('fangquan'),function(card,player,target){ player.chooseTarget(get.prompt('fangquan'),function(card,player,target){
return target!=player; return target!=player;
}).set('ai',function(target){ }).set('ai',function(target){
@ -772,13 +772,13 @@ character.shenhua={
audio:2, audio:2,
trigger:{player:'phaseJudgeBefore'}, trigger:{player:'phaseJudgeBefore'},
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0; return player.countCards('h')>0;
}, },
direct:true, direct:true,
frequent:true, frequent:true,
content:function(){ content:function(){
"step 0" "step 0"
if(player.num('j')==0&&(!event.isMine()||!lib.config.autoskilllist.contains('qiaobian1'))){ if(player.countCards('j')==0&&(!event.isMine()||!lib.config.autoskilllist.contains('qiaobian1'))){
event.finish(); event.finish();
} }
else{ else{
@ -797,14 +797,14 @@ character.shenhua={
audio:2, audio:2,
trigger:{player:'phaseDrawBefore'}, trigger:{player:'phaseDrawBefore'},
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0; return player.countCards('h')>0;
}, },
direct:true, direct:true,
content:function(){ content:function(){
"step 0" "step 0"
var check,i,num=0,num2=0,players=game.filterPlayer(); var check,i,num=0,num2=0,players=game.filterPlayer();
for(i=0;i<players.length;i++){ for(i=0;i<players.length;i++){
if(player!=players[i]&&players[i].num('h')){ if(player!=players[i]&&players[i].countCards('h')){
var att=ai.get.attitude(player,players[i]); var att=ai.get.attitude(player,players[i]);
if(att<=0){ if(att<=0){
num++; num++;
@ -828,7 +828,7 @@ character.shenhua={
return 1-ai.get.attitude(evt.player,target); return 1-ai.get.attitude(evt.player,target);
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.num('h')>0; return target.countCards('h')>0;
}, },
selectTarget:[0,2], selectTarget:[0,2],
filterCard:lib.filter.cardDiscardable, filterCard:lib.filter.cardDiscardable,
@ -860,16 +860,16 @@ character.shenhua={
audio:2, audio:2,
trigger:{player:'phaseUseBefore'}, trigger:{player:'phaseUseBefore'},
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0; return player.countCards('h')>0;
}, },
direct:true, direct:true,
content:function(){ content:function(){
"step 0" "step 0"
var check=game.hasPlayer(function(current){ var check=game.hasPlayer(function(current){
return ai.get.attitude(player,current)>0&&current.num('j'); return ai.get.attitude(player,current)>0&&current.countCards('j');
}); });
if(!check){ if(!check){
if(player.num('h')>player.hp+1){ if(player.countCards('h')>player.hp+1){
check=false; check=false;
} }
else if(player.num('h',{name:['wuzhong']})){ else if(player.num('h',{name:['wuzhong']})){
@ -888,7 +888,7 @@ character.shenhua={
if(!_status.event.check) return 0; if(!_status.event.check) return 0;
var player=_status.event.player; var player=_status.event.player;
if(ui.selected.targets.length==0){ if(ui.selected.targets.length==0){
if(target.num('j')&&ai.get.attitude(player,target)>0) return 10; if(target.countCards('j')&&ai.get.attitude(player,target)>0) return 10;
if(ai.get.attitude(player,target)<0){ if(ai.get.attitude(player,target)<0){
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
@ -909,7 +909,7 @@ character.shenhua={
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(ui.selected.targets.length){ if(ui.selected.targets.length){
var from=ui.selected.targets[0]; var from=ui.selected.targets[0];
var judges=from.get('j'); var judges=from.getCards('j');
for(var i=0;i<judges.length;i++){ for(var i=0;i<judges.length;i++){
if(!target.hasJudge(judges[i].viewAs||judges[i].name)) return true; if(!target.hasJudge(judges[i].viewAs||judges[i].name)) return true;
} }
@ -922,7 +922,7 @@ character.shenhua={
return false; return false;
} }
else{ else{
return target.num('ej')>0; return target.countCards('ej')>0;
} }
}, },
selectTarget:2, selectTarget:2,
@ -996,11 +996,11 @@ character.shenhua={
trigger:{player:'phaseDiscardBefore'}, trigger:{player:'phaseDiscardBefore'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0; return player.countCards('h')>0;
}, },
content:function(){ content:function(){
"step 0" "step 0"
var discard=player.num('h')>player.hp; var discard=player.countCards('h')>player.hp;
var next=player.chooseToDiscard('是否发动巧变跳过弃牌阶段?'); var next=player.chooseToDiscard('是否发动巧变跳过弃牌阶段?');
next.logSkill='qiaobian'; next.logSkill='qiaobian';
next.ai=function(card){ next.ai=function(card){
@ -1075,9 +1075,9 @@ character.shenhua={
target:function(card,player,target,current){ target:function(card,player,target,current){
if(!target.hasFriend()&&!player.hasUnknown()) return; if(!target.hasFriend()&&!player.hasUnknown()) return;
if(_status.currentPhase==target) return; if(_status.currentPhase==target) return;
if(get.tag(card,'loseCard')&&target.num('he')){ if(get.tag(card,'loseCard')&&target.countCards('he')){
if(target.hasSkill('ziliang')) return 0.7; if(target.hasSkill('ziliang')) return 0.7;
return [0.5,Math.max(2,target.num('h'))]; return [0.5,Math.max(2,target.countCards('h'))];
} }
if(target.isUnderControl(true,player)){ if(target.isUnderControl(true,player)){
if((get.tag(card,'respondSha')&&target.num('h','sha'))|| if((get.tag(card,'respondSha')&&target.num('h','sha'))||
@ -1089,15 +1089,15 @@ character.shenhua={
else if(get.tag(card,'respondSha')||get.tag(card,'respondShan')){ else if(get.tag(card,'respondSha')||get.tag(card,'respondShan')){
if(ai.get.attitude(player,target)>0&&card.name=='juedou') return; if(ai.get.attitude(player,target)>0&&card.name=='juedou') return;
if(get.tag(card,'damage')&&target.hasSkillTag('maixie')) return; if(get.tag(card,'damage')&&target.hasSkillTag('maixie')) return;
if(target.num('h')==0) return 2; if(target.countCards('h')==0) return 2;
if(target.hasSkill('ziliang')) return 0.7; if(target.hasSkill('ziliang')) return 0.7;
if(get.mode()=='guozhan') return 0.5; if(get.mode()=='guozhan') return 0.5;
return [0.5,Math.max(target.num('h')/4,target.num('h','sha')+target.num('h','shan'))]; return [0.5,Math.max(target.countCards('h')/4,target.num('h','sha')+target.num('h','shan'))];
} }
} }
}, },
threaten:function(player,target){ threaten:function(player,target){
if(target.num('h')==0) return 2; if(target.countCards('h')==0) return 2;
return 0.5; return 0.5;
} }
} }
@ -1229,13 +1229,13 @@ character.shenhua={
forceaudio:true, forceaudio:true,
enable:'phaseUse', enable:'phaseUse',
filter:function(event,player){ filter:function(event,player){
if(player.group!='wu'||player.num('h')==0) return false; if(player.group!='wu'||player.countCards('h')==0) return false;
return game.hasPlayer(function(target){ return game.hasPlayer(function(target){
return target!=player&&target.hasZhuSkill('zhiba',player)&&target.num('h')>0; return target!=player&&target.hasZhuSkill('zhiba',player)&&target.countCards('h')>0;
}); });
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.hasZhuSkill('zhiba',player)&&target.num('h')>0; return target!=player&&target.hasZhuSkill('zhiba',player)&&target.countCards('h')>0;
}, },
usable:1, usable:1,
content:function(){ content:function(){
@ -1276,9 +1276,9 @@ character.shenhua={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(player.num('h','du')&&ai.get.attitude(player,target)<0) return -1; if(player.num('h','du')&&ai.get.attitude(player,target)<0) return -1;
if(player.num('h')<=player.hp) return 0; if(player.countCards('h')<=player.hp) return 0;
var maxnum=0; var maxnum=0;
var cards2=target.get('h'); var cards2=target.getCards('h');
for(var i=0;i<cards2.length;i++){ for(var i=0;i<cards2.length;i++){
if(cards2[i].number>maxnum){ if(cards2[i].number>maxnum){
maxnum=cards2[i].number; maxnum=cards2[i].number;
@ -1286,7 +1286,7 @@ character.shenhua={
} }
if(maxnum>10) maxnum=10; if(maxnum>10) maxnum=10;
if(maxnum<5&&cards2.length>1) maxnum=5; if(maxnum<5&&cards2.length>1) maxnum=5;
var cards=player.get('h'); var cards=player.getCards('h');
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
if(cards[i].number<maxnum) return 1; if(cards[i].number<maxnum) return 1;
} }
@ -1415,7 +1415,7 @@ character.shenhua={
trigger:{global:'damageEnd'}, trigger:{global:'damageEnd'},
filter:function(event,player){ filter:function(event,player){
return (event.card&&event.card.name=='sha'&&event.source&& return (event.card&&event.card.name=='sha'&&event.source&&
event.player.classList.contains('dead')==false&&player.num('he')); event.player.classList.contains('dead')==false&&player.countCards('he'));
}, },
direct:true, direct:true,
check:function(event,player){ check:function(event,player){
@ -1792,7 +1792,7 @@ character.shenhua={
return false; return false;
} }
else if(player.maxHp-player.hp==2){ else if(player.maxHp-player.hp==2){
return player.num('h')>=2; return player.countCards('h')>=2;
} }
return true; return true;
}, },
@ -1871,17 +1871,17 @@ character.shenhua={
filter:function(event,player){ filter:function(event,player){
return (event.card&&event.card.name=='sha'&& return (event.card&&event.card.name=='sha'&&
event.player.classList.contains('dead')==false&& event.player.classList.contains('dead')==false&&
event.player.num('h')&&player.num('h'))&&event.player!=player; event.player.countCards('h')&&player.countCards('h'))&&event.player!=player;
}, },
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.player)<0&&player.num('h')>1; return ai.get.attitude(player,event.player)<0&&player.countCards('h')>1;
}, },
priority:5, priority:5,
content:function(){ content:function(){
"step 0" "step 0"
player.chooseToCompare(trigger.player); player.chooseToCompare(trigger.player);
"step 1" "step 1"
if(result.bool&&trigger.player.num('he')){ if(result.bool&&trigger.player.countCards('he')){
player.gainPlayerCard(trigger.player,true,'he'); player.gainPlayerCard(trigger.player,true,'he');
} }
} }
@ -1925,14 +1925,14 @@ character.shenhua={
var player=_status.event.player; var player=_status.event.player;
if(ai.get.attitude(_status.event.player,target)==0) return 0; if(ai.get.attitude(_status.event.player,target)==0) return 0;
if(ai.get.attitude(_status.event.player,target)>0){ if(ai.get.attitude(_status.event.player,target)>0){
if(target.classList.contains('turnedover')) return 1000-target.num('h'); if(target.classList.contains('turnedover')) return 1000-target.countCards('h');
if(player.maxHp-player.hp<3) return -1; if(player.maxHp-player.hp<3) return -1;
return 100-target.num('h'); return 100-target.countCards('h');
} }
else{ else{
if(target.classList.contains('turnedover')) return -1; if(target.classList.contains('turnedover')) return -1;
if(player.maxHp-player.hp>=3) return -1; if(player.maxHp-player.hp>=3) return -1;
return 1+target.num('h'); return 1+target.countCards('h');
} }
} }
"step 1" "step 1"
@ -2049,17 +2049,17 @@ character.shenhua={
trigger:{player:'phaseDrawBegin'}, trigger:{player:'phaseDrawBegin'},
threaten:1.4, threaten:1.4,
check:function(event,player){ check:function(event,player){
if(player.num('h')<=1) return true; if(player.countCards('h')<=1) return true;
var min=[]; var min=[];
var temp=player.next.num('h'); var temp=player.next.countCards('h');
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i]!=player&&players[i].num('h')<temp){ if(players[i]!=player&&players[i].countCards('h')<temp){
temp=players[i].num('h'); temp=players[i].countCards('h');
} }
} }
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i]!=player&&players[i].num('h')==temp){ if(players[i]!=player&&players[i].countCards('h')==temp){
min.push(players[i]); min.push(players[i]);
} }
} }
@ -2078,7 +2078,7 @@ character.shenhua={
noh:true, noh:true,
skillTagFilter:function(player,tag){ skillTagFilter:function(player,tag){
if(tag=='noh'){ if(tag=='noh'){
if(player.num('h')!=2) return false; if(player.countCards('h')!=2) return false;
} }
} }
} }
@ -2092,12 +2092,12 @@ character.shenhua={
content:function(){ content:function(){
"step 0" "step 0"
player.removeSkill('haoshi2'); player.removeSkill('haoshi2');
if(player.num('h')<=5){ if(player.countCards('h')<=5){
event.finish(); event.finish();
return; return;
} }
player.chooseCardTarget({ player.chooseCardTarget({
selectCard:Math.floor(player.num('h')/2), selectCard:Math.floor(player.countCards('h')/2),
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.isFewestHandcard(); return target.isFewestHandcard();
}, },
@ -2128,7 +2128,7 @@ character.shenhua={
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(player==target) return false; if(player==target) return false;
if(ui.selected.targets.length==0) return true; if(ui.selected.targets.length==0) return true;
return (Math.abs(ui.selected.targets[0].num('h')-target.num('h'))== return (Math.abs(ui.selected.targets[0].countCards('h')-target.countCards('h'))==
ui.selected.cards.length); ui.selected.cards.length);
}, },
multitarget:true, multitarget:true,
@ -2138,14 +2138,14 @@ character.shenhua={
}, },
check:function(card){ check:function(card){
var list=[],player=_status.event.player; var list=[],player=_status.event.player;
var num=player.num('he'); var num=player.countCards('he');
var count; var count;
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i]!=player&&ai.get.attitude(player,players[i])>3) list.push(players[i]); if(players[i]!=player&&ai.get.attitude(player,players[i])>3) list.push(players[i]);
} }
list.sort(function(a,b){ list.sort(function(a,b){
return a.num('h')-b.num('h'); return a.countCards('h')-b.countCards('h');
}); });
if(list.length==0) return -1; if(list.length==0) return -1;
var from=list[0]; var from=list[0];
@ -2156,15 +2156,15 @@ character.shenhua={
} }
if(list.length==0) return -1; if(list.length==0) return -1;
list.sort(function(a,b){ list.sort(function(a,b){
return b.num('h')-a.num('h'); return b.countCards('h')-a.countCards('h');
}); });
if(from.num('h')>=list[0].num('h')) return -1; if(from.countCards('h')>=list[0].countCards('h')) return -1;
for(var i=0;i<list.length&&from.num('h')<list[i].num('h');i++){ for(var i=0;i<list.length&&from.countCards('h')<list[i].countCards('h');i++){
if(list[i].num('h')-from.num('h')<=num){ if(list[i].countCards('h')-from.countCards('h')<=num){
count=list[i].num('h')-from.num('h');break; count=list[i].countCards('h')-from.countCards('h');break;
} }
} }
if(count<2&&from.num('h')>=2) return -1; if(count<2&&from.countCards('h')>=2) return -1;
if(ui.selected.cards.length<count) return 11-ai.get.value(card); if(ui.selected.cards.length<count) return 11-ai.get.value(card);
return -1; return -1;
}, },
@ -2175,14 +2175,14 @@ character.shenhua={
result:{ result:{
target:function(player,target){ target:function(player,target){
var list=[]; var list=[];
var num=player.num('he'); var num=player.countCards('he');
var players=game.filterPlayer(); var players=game.filterPlayer();
if(ui.selected.targets.length==0){ if(ui.selected.targets.length==0){
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i]!=player&&ai.get.attitude(player,players[i])>3) list.push(players[i]); if(players[i]!=player&&ai.get.attitude(player,players[i])>3) list.push(players[i]);
} }
list.sort(function(a,b){ list.sort(function(a,b){
return a.num('h')-b.num('h'); return a.countCards('h')-b.countCards('h');
}); });
if(target==list[0]) return ai.get.attitude(player,target); if(target==list[0]) return ai.get.attitude(player,target);
return -ai.get.attitude(player,target); return -ai.get.attitude(player,target);
@ -2193,13 +2193,13 @@ character.shenhua={
if(players[i]!=player&&ai.get.attitude(player,players[i])<1) list.push(players[i]); if(players[i]!=player&&ai.get.attitude(player,players[i])<1) list.push(players[i]);
} }
list.sort(function(a,b){ list.sort(function(a,b){
return b.num('h')-a.num('h'); return b.countCards('h')-a.countCards('h');
}); });
if(from.num('h')>=list[0].num('h')) return -ai.get.attitude(player,target); if(from.countCards('h')>=list[0].countCards('h')) return -ai.get.attitude(player,target);
for(var i=0;i<list.length&&from.num('h')<list[i].num('h');i++){ for(var i=0;i<list.length&&from.countCards('h')<list[i].countCards('h');i++){
if(list[i].num('h')-from.num('h')<=num){ if(list[i].countCards('h')-from.countCards('h')<=num){
var count=list[i].num('h')-from.num('h'); var count=list[i].countCards('h')-from.countCards('h');
if(count<2&&from.num('h')>=2) return -ai.get.attitude(player,target); if(count<2&&from.countCards('h')>=2) return -ai.get.attitude(player,target);
if(target==list[i]) return ai.get.attitude(player,target); if(target==list[i]) return ai.get.attitude(player,target);
return -ai.get.attitude(player,target); return -ai.get.attitude(player,target);
} }
@ -2223,7 +2223,7 @@ character.shenhua={
return player!=target; return player!=target;
}).set('ai',function(target){ }).set('ai',function(target){
var player=_status.event.player; var player=_status.event.player;
if(player.maxHp-player.hp==1&&target.num('he')==0){ if(player.maxHp-player.hp==1&&target.countCards('he')==0){
return 0; return 0;
} }
if(ai.get.attitude(_status.event.player,target)>0){ if(ai.get.attitude(_status.event.player,target)>0){
@ -2237,7 +2237,7 @@ character.shenhua={
"step 1" "step 1"
if(result.bool){ if(result.bool){
event.num=player.maxHp-player.hp; event.num=player.maxHp-player.hp;
if(player.num('e')>=player.hp){ if(player.countCards('e')>=player.hp){
event.num=player.maxHp; event.num=player.maxHp;
} }
player.logSkill('yinghun',result.targets); player.logSkill('yinghun',result.targets);
@ -2269,7 +2269,7 @@ character.shenhua={
}, },
ai:{ ai:{
threaten:function(player,target){ threaten:function(player,target){
if(target.hp==1||target.num('e')>=target.hp) return 2; if(target.hp==1||target.countCards('e')>=target.hp) return 2;
if(target.hp==target.maxHp) return 0.5; if(target.hp==target.maxHp) return 0.5;
if(target.hp==2) return 1.5; if(target.hp==2) return 1.5;
return 0.5; return 0.5;
@ -2300,7 +2300,7 @@ character.shenhua={
return player!=target; return player!=target;
}).set('ai',function(target){ }).set('ai',function(target){
var player=_status.event.player; var player=_status.event.player;
if(player.maxHp-player.hp==1&&target.num('he')==0){ if(player.maxHp-player.hp==1&&target.countCards('he')==0){
return 0; return 0;
} }
if(ai.get.attitude(_status.event.player,target)>0){ if(ai.get.attitude(_status.event.player,target)>0){
@ -2545,7 +2545,7 @@ character.shenhua={
result:{ result:{
player:function(player){ player:function(player){
if(lib.config.mode=='identity'&&game.zhu.isZhu&&player.identity=='fan'){ if(lib.config.mode=='identity'&&game.zhu.isZhu&&player.identity=='fan'){
if(game.zhu.hp==1&&game.zhu.num('h')<=2) return 1; if(game.zhu.hp==1&&game.zhu.countCards('h')<=2) return 1;
} }
var num=0; var num=0;
var players=game.filterPlayer(); var players=game.filterPlayer();
@ -2554,9 +2554,9 @@ character.shenhua={
if(att>0) att=1; if(att>0) att=1;
if(att<0) att=-1; if(att<0) att=-1;
if(players[i]!=player&&players[i].hp<=3){ if(players[i]!=player&&players[i].hp<=3){
if(players[i].num('h')==0) num+=att/players[i].hp; if(players[i].countCards('h')==0) num+=att/players[i].hp;
else if(players[i].num('h')==1) num+=att/2/players[i].hp; else if(players[i].countCards('h')==1) num+=att/2/players[i].hp;
else if(players[i].num('h')==2) num+=att/4/players[i].hp; else if(players[i].countCards('h')==2) num+=att/4/players[i].hp;
} }
if(players[i].hp==1) num+=att*1.5; if(players[i].hp==1) num+=att*1.5;
} }
@ -2606,7 +2606,7 @@ character.shenhua={
prompt:'将一张红色牌当火攻使用', prompt:'将一张红色牌当火攻使用',
check:function(card){ check:function(card){
var player=_status.currentPhase; var player=_status.currentPhase;
if(player.num('h')>player.hp){ if(player.countCards('h')>player.hp){
return 6-ai.get.value(card); return 6-ai.get.value(card);
} }
return 4-ai.get.value(card) return 4-ai.get.value(card)
@ -2717,7 +2717,7 @@ character.shenhua={
content:function(){ content:function(){
'step 0' 'step 0'
player.hp=Math.min(3,player.maxHp); player.hp=Math.min(3,player.maxHp);
player.discard(player.get('hej')); player.discard(player.getCards('hej'));
player.draw(3); player.draw(3);
player.awakenSkill('niepan'); player.awakenSkill('niepan');
player.storage.niepan=true; player.storage.niepan=true;
@ -2736,7 +2736,7 @@ character.shenhua={
result:{ result:{
player:function(player){ player:function(player){
if(player.hp==0) return 10; if(player.hp==0) return 10;
if(player.hp<=2&&player.num('he')<=1) return 10; if(player.hp<=2&&player.countCards('he')<=1) return 10;
return 0; return 0;
} }
}, },
@ -2770,7 +2770,7 @@ character.shenhua={
content:function(){ content:function(){
'step 0' 'step 0'
player.hp=Math.min(3,player.maxHp); player.hp=Math.min(3,player.maxHp);
player.discard(player.get('hej')); player.discard(player.getCards('hej'));
player.draw(3); player.draw(3);
player.awakenSkill('oldniepan'); player.awakenSkill('oldniepan');
player.storage.oldniepan=true; player.storage.oldniepan=true;
@ -2789,7 +2789,7 @@ character.shenhua={
result:{ result:{
player:function(player){ player:function(player){
if(player.hp==0) return 10; if(player.hp==0) return 10;
if(player.hp<=2&&player.num('he')<=1) return 10; if(player.hp<=2&&player.countCards('he')<=1) return 10;
return 0; return 0;
} }
}, },
@ -2806,13 +2806,13 @@ character.shenhua={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filter:function(event,player){ filter:function(event,player){
if(player.num('h')==0) return false; if(player.countCards('h')==0) return false;
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return current.hp>player.hp&&current.num('h'); return current.hp>player.hp&&current.countCards('h');
}); });
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.hp>player.hp&&target.num('h')>0; return target.hp>player.hp&&target.countCards('h')>0;
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -2848,7 +2848,7 @@ character.shenhua={
result:{ result:{
target:function(player,target){ target:function(player,target){
var att=ai.get.attitude(player,target); var att=ai.get.attitude(player,target);
var oc=(target.num('h')==1); var oc=(target.countCards('h')==1);
if(att>0&&oc) return 0; if(att>0&&oc) return 0;
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
@ -2864,7 +2864,7 @@ character.shenhua={
player:function(player,target){ player:function(player,target){
if(target.hasSkillTag('jueqing')) return -10; if(target.hasSkillTag('jueqing')) return -10;
var mn=1; var mn=1;
var hs=player.get('h'); var hs=player.getCards('h');
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
mn=Math.max(mn,hs[i].number); mn=Math.max(mn,hs[i].number);
} }
@ -2873,7 +2873,7 @@ character.shenhua={
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(ai.get.attitude(player,players[i])>2){ if(ai.get.attitude(player,players[i])>2){
max=Math.max(Math.min(5,players[i].hp)-players[i].num('h'),max); max=Math.max(Math.min(5,players[i].hp)-players[i].countCards('h'),max);
} }
} }
switch(max){ switch(max){
@ -2895,11 +2895,11 @@ character.shenhua={
content:function(){ content:function(){
"step 0" "step 0"
player.chooseTarget(get.prompt('jieming'),[1,trigger.num],function(card,player,target){ player.chooseTarget(get.prompt('jieming'),[1,trigger.num],function(card,player,target){
return target.num('h')<Math.min(target.maxHp,5); return target.countCards('h')<Math.min(target.maxHp,5);
}).set('ai',function(target){ }).set('ai',function(target){
var att=ai.get.attitude(_status.event.player,target); var att=ai.get.attitude(_status.event.player,target);
if(att>2){ if(att>2){
return Math.min(5,target.maxHp)-target.num('h'); return Math.min(5,target.maxHp)-target.countCards('h');
} }
return att/3; return att/3;
}); });
@ -2907,7 +2907,7 @@ character.shenhua={
if(result.bool){ if(result.bool){
player.logSkill('jieming',result.targets); player.logSkill('jieming',result.targets);
for(var i=0;i<result.targets.length;i++){ for(var i=0;i<result.targets.length;i++){
result.targets[i].draw(Math.min(5,result.targets[i].maxHp)-result.targets[i].num('h')); result.targets[i].draw(Math.min(5,result.targets[i].maxHp)-result.targets[i].countCards('h'));
} }
} }
}, },
@ -2922,7 +2922,7 @@ character.shenhua={
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(ai.get.attitude(target,players[i])>0){ if(ai.get.attitude(target,players[i])>0){
max=Math.max(Math.min(5,players[i].hp)-players[i].num('h'),max); max=Math.max(Math.min(5,players[i].hp)-players[i].countCards('h'),max);
} }
} }
switch(max){ switch(max){
@ -2933,7 +2933,7 @@ character.shenhua={
} }
} }
if((card.name=='tao'||card.name=='caoyao')&& if((card.name=='tao'||card.name=='caoyao')&&
target.hp>1&&target.num('h')<=target.hp) return [0,0]; target.hp>1&&target.countCards('h')<=target.hp) return [0,0];
} }
}, },
} }
@ -3049,10 +3049,10 @@ character.shenhua={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return player!=target&&target.num('h')>0; return player!=target&&target.countCards('h')>0;
}, },
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0; return player.countCards('h')>0;
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -3067,7 +3067,7 @@ character.shenhua={
}, },
ai:{ ai:{
order:function(name,player){ order:function(name,player){
var cards=player.get('h'); var cards=player.getCards('h');
if(player.num('h','sha')==0){ if(player.num('h','sha')==0){
return 1; return 1;
} }
@ -3081,14 +3081,14 @@ character.shenhua={
result:{ result:{
player:function(player){ player:function(player){
if(player.num('h','sha')>0) return 0.6; if(player.num('h','sha')>0) return 0.6;
var num=player.num('h'); var num=player.countCards('h');
if(num>player.hp) return 0; if(num>player.hp) return 0;
if(num==1) return -2; if(num==1) return -2;
if(num==2) return -1; if(num==2) return -1;
return -0.7; return -0.7;
}, },
target:function(player,target){ target:function(player,target){
var num=target.num('h'); var num=target.countCards('h');
if(num==1) return -1; if(num==1) return -1;
if(num==2) return -0.7; if(num==2) return -0.7;
return -0.5 return -0.5
@ -3119,8 +3119,8 @@ character.shenhua={
audio:true, audio:true,
trigger:{player:'phaseDrawBefore'}, trigger:{player:'phaseDrawBefore'},
check:function(event,player){ check:function(event,player){
if(player.num('h')>player.hp) return true; if(player.countCards('h')>player.hp) return true;
if(player.num('h')>3) return true; if(player.countCards('h')>3) return true;
return false; return false;
}, },
content:function(){ content:function(){
@ -3159,7 +3159,7 @@ character.shenhua={
if(ui.selected.cards.length){ if(ui.selected.cards.length){
return get.suit(card)==get.suit(ui.selected.cards[0]); return get.suit(card)==get.suit(ui.selected.cards[0]);
} }
var cards=player.get('h'); var cards=player.getCards('h');
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
if(card!=cards[i]){ if(card!=cards[i]){
if(get.suit(card)==get.suit(cards[i])) return true; if(get.suit(card)==get.suit(cards[i])) return true;
@ -3196,7 +3196,7 @@ character.shenhua={
trigger:{player:'shaMiss'}, trigger:{player:'shaMiss'},
priority:-1, priority:-1,
filter:function(event){ filter:function(event){
return event.target.num('he')>0; return event.target.countCards('he')>0;
}, },
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.target)<0; return ai.get.attitude(player,event.target)<0;
@ -3223,18 +3223,18 @@ character.shenhua={
var type=get.type(result.card||result.cards[0]); var type=get.type(result.card||result.cards[0]);
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
if(type=='equip'){ if(type=='equip'){
return current.num('e'); return current.countCards('e');
} }
else{ else{
return current.num('j'); return current.countCards('j');
} }
})){ })){
var next=player.chooseTarget('是否弃置场上的一张'+get.translation(type)+'牌?',function(card,player,target){ var next=player.chooseTarget('是否弃置场上的一张'+get.translation(type)+'牌?',function(card,player,target){
if(_status.event.type=='equip'){ if(_status.event.type=='equip'){
return target.num('e')>0; return target.countCards('e')>0;
} }
else{ else{
return target.num('j')>0; return target.countCards('j')>0;
} }
}); });
next.set('ai',function(target){ next.set('ai',function(target){
@ -3313,23 +3313,23 @@ character.shenhua={
var be=target.num('e',{color:'black'}); var be=target.num('e',{color:'black'});
if(target.num('h','shan')&&be){ if(target.num('h','shan')&&be){
if(!target.hasSkill('guidao')) return 0; if(!target.hasSkill('guidao')) return 0;
return [0,hastarget?target.num('he')/2:0]; return [0,hastarget?target.countCards('he')/2:0];
} }
if(target.num('h','shan')&&target.num('h')>2){ if(target.num('h','shan')&&target.countCards('h')>2){
if(!target.hasSkill('guidao')) return 0; if(!target.hasSkill('guidao')) return 0;
return [0,hastarget?target.num('h')/4:0]; return [0,hastarget?target.countCards('h')/4:0];
} }
if(target.num('h')>3||(be&&target.num('h')>=2)){ if(target.countCards('h')>3||(be&&target.countCards('h')>=2)){
return [0,0]; return [0,0];
} }
if(target.num('h')==0){ if(target.countCards('h')==0){
return [1.5,0]; return [1.5,0];
} }
if(target.num('h')==1&&!be){ if(target.countCards('h')==1&&!be){
return [1.2,0]; return [1.2,0];
} }
if(!target.hasSkill('guidao')) return [1,0.05]; if(!target.hasSkill('guidao')) return [1,0.05];
return [1,Math.min(0.5,(target.num('h')+be)/4)]; return [1,Math.min(0.5,(target.countCards('h')+be)/4)];
} }
} }
} }
@ -3347,7 +3347,7 @@ character.shenhua={
direct:true, direct:true,
content:function(){ content:function(){
"step 0" "step 0"
var check= player.num('h')>2; var check= player.countCards('h')>2;
player.chooseTarget(get.prompt('shensu'),function(card,player,target){ player.chooseTarget(get.prompt('shensu'),function(card,player,target){
if(player==target) return false; if(player==target) return false;
return player.canUse({name:'sha'},target,false); return player.canUse({name:'sha'},target,false);
@ -3451,7 +3451,7 @@ character.shenhua={
}, },
logTarget:'target', logTarget:'target',
filter:function(event,player){ filter:function(event,player){
var length=event.target.num('h'); var length=event.target.countCards('h');
return (length>=player.hp||length<=player.getAttackRange()); return (length>=player.hp||length<=player.getAttackRange());
}, },
content:function(){ content:function(){
@ -3546,11 +3546,11 @@ character.shenhua={
effect:{ effect:{
target:function(card,player,target){ target:function(card,player,target){
if(player.hasSkillTag('jueqing')) return; if(player.hasSkillTag('jueqing')) return;
if(get.tag(card,'damage')&&target.num('h')>1) return 0.7; if(get.tag(card,'damage')&&target.countCards('h')>1) return 0.7;
} }
}, },
threaten:function(player,target){ threaten:function(player,target){
if(target.num('h')==0) return 2; if(target.countCards('h')==0) return 2;
} }
} }
}, },
@ -3639,7 +3639,7 @@ character.shenhua={
effect:{ effect:{
target:function(card,player,target){ target:function(card,player,target){
if(player.hasSkillTag('jueqing')) return; if(player.hasSkillTag('jueqing')) return;
if(get.tag(card,'damage')&&target.num('he')>1) return 0.7; if(get.tag(card,'damage')&&target.countCards('he')>1) return 0.7;
} }
}, },
} }
@ -3953,12 +3953,12 @@ character.shenhua={
return ai.get.attitude(target,current)<0; return ai.get.attitude(target,current)<0;
}); });
if(target.num('h','shan')&&target.num('e',{suit:'spade'})){ if(target.num('h','shan')&&target.num('e',{suit:'spade'})){
return [0,hastarget?target.num('he')/2:0]; return [0,hastarget?target.countCards('he')/2:0];
} }
if(target.num('h','shan')){ if(target.num('h','shan')){
return [1,hastarget?target.num('he')/2:0]; return [1,hastarget?target.countCards('he')/2:0];
} }
return [1,target.num('h')/4]; return [1,target.countCards('h')/4];
} }
} }
} }
@ -4022,7 +4022,7 @@ character.shenhua={
usable:1, usable:1,
audio:2, audio:2,
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0 return player.countCards('h')>0
}, },
chooseButton:{ chooseButton:{
dialog:function(){ dialog:function(){
@ -4072,7 +4072,7 @@ character.shenhua={
result:{ result:{
player:function(player){ player:function(player){
var num=0; var num=0;
var cards=player.get('h'); var cards=player.getCards('h');
if(cards.length>=3&&player.hp>=3) return 0; if(cards.length>=3&&player.hp>=3) return 0;
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
num+=Math.max(0,ai.get.value(cards[i],player,'raw')); num+=Math.max(0,ai.get.value(cards[i],player,'raw'));

File diff suppressed because it is too large Load Diff

View File

@ -154,7 +154,7 @@ character.standard={
trigger:{player:'damageEnd'}, trigger:{player:'damageEnd'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return (event.source&&event.source.num('he')&&event.source!=player); return (event.source&&event.source.countCards('he')&&event.source!=player);
}, },
content:function(){ content:function(){
player.gainPlayerCard(get.prompt('fankui',trigger.source),trigger.source,ai.get.buttonValue,'he').set('logSkill',['fankui',trigger.source]); player.gainPlayerCard(get.prompt('fankui',trigger.source),trigger.source,ai.get.buttonValue,'he').set('logSkill',['fankui',trigger.source]);
@ -162,7 +162,7 @@ character.standard={
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target){ target:function(card,player,target){
if(player.num('he')>1&&get.tag(card,'damage')){ if(player.countCards('he')>1&&get.tag(card,'damage')){
if(player.hasSkillTag('jueqing')) return [1,-1.5]; if(player.hasSkillTag('jueqing')) return [1,-1.5];
if(ai.get.attitude(target,player)<0) return [1,1]; if(ai.get.attitude(target,player)<0) return [1,1];
} }
@ -175,7 +175,7 @@ character.standard={
trigger:{global:'judge'}, trigger:{global:'judge'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0; return player.countCards('h')>0;
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -274,11 +274,11 @@ character.standard={
"step 0" "step 0"
var check; var check;
var i,num=game.countPlayer(function(current){ var i,num=game.countPlayer(function(current){
return current!=player&&current.num('h')&&ai.get.attitude(player,current)<=0; return current!=player&&current.countCards('h')&&ai.get.attitude(player,current)<=0;
}); });
check=(num>=2); check=(num>=2);
player.chooseTarget(get.prompt('tuxi'),[1,2],function(card,player,target){ player.chooseTarget(get.prompt('tuxi'),[1,2],function(card,player,target){
return target.num('h')>0&&player!=target; return target.countCards('h')>0&&player!=target;
},function(target){ },function(target){
if(!_status.event.aicheck) return 0; if(!_status.event.aicheck) return 0;
var att=ai.get.attitude(_status.event.player,target); var att=ai.get.attitude(_status.event.player,target);
@ -307,7 +307,7 @@ character.standard={
audio:2, audio:2,
trigger:{player:'phaseDrawBegin'}, trigger:{player:'phaseDrawBegin'},
check:function(event,player){ check:function(event,player){
if(player.num('h')<3) return false; if(player.countCards('h')<3) return false;
if(!player.hasSha()) return false; if(!player.hasSha()) return false;
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return ai.get.attitude(player,current)<0&&player.canUse('sha',current); return ai.get.attitude(player,current)<0&&player.canUse('sha',current);
@ -374,7 +374,7 @@ character.standard={
ai1:function(card){ ai1:function(card){
if(ui.selected.cards.length>0) return -1; if(ui.selected.cards.length>0) return -1;
if(card.name=='du') return 20; if(card.name=='du') return 20;
return (_status.event.player.num('h')-_status.event.player.hp); return (_status.event.player.countCards('h')-_status.event.player.hp);
}, },
ai2:function(target){ ai2:function(target){
var att=ai.get.attitude(_status.event.player,target); var att=ai.get.attitude(_status.event.player,target);
@ -498,7 +498,7 @@ character.standard={
if(ui.selected.cards.length&&ui.selected.cards[0].name=='du') return 0; if(ui.selected.cards.length&&ui.selected.cards[0].name=='du') return 0;
if(!ui.selected.cards.length&&card.name=='du') return 20; if(!ui.selected.cards.length&&card.name=='du') return 20;
var player=get.owner(card); var player=get.owner(card);
if(player.hp==player.maxHp||player.storage.rende<0||player.num('h')<=1){ if(player.hp==player.maxHp||player.storage.rende<0||player.countCards('h')<=1){
if(ui.selected.cards.length){ if(ui.selected.cards.length){
return -1; return -1;
} }
@ -512,8 +512,8 @@ character.standard={
return 11-ai.get.value(card); return 11-ai.get.value(card);
} }
} }
if(player.num('h')>player.hp) return 10-ai.get.value(card); if(player.countCards('h')>player.hp) return 10-ai.get.value(card);
if(player.num('h')>2) return 6-ai.get.value(card); if(player.countCards('h')>2) return 6-ai.get.value(card);
return -1; return -1;
} }
return 10-ai.get.value(card); return 10-ai.get.value(card);
@ -533,7 +533,7 @@ character.standard={
}, },
ai:{ ai:{
order:function(skill,player){ order:function(skill,player){
if(player.hp<player.maxHp&&player.storage.rende<2&&player.num('h')>1){ if(player.hp<player.maxHp&&player.storage.rende<2&&player.countCards('h')>1){
return 10; return 10;
} }
return 1; return 1;
@ -545,9 +545,9 @@ character.standard={
return -10; return -10;
} }
if(target.num('j','lebu')) return 0; if(target.num('j','lebu')) return 0;
var nh=target.num('h'); var nh=target.countCards('h');
var np=player.num('h'); var np=player.countCards('h');
if(player.hp==player.maxHp||player.storage.rende<0||player.num('h')<=1){ if(player.hp==player.maxHp||player.storage.rende<0||player.countCards('h')<=1){
if(nh>=np-1&&np<=player.hp&&!target.get('s').contains('haoshi')) return 0; if(nh>=np-1&&np<=player.hp&&!target.get('s').contains('haoshi')) return 0;
} }
return Math.max(1,5-nh); return Math.max(1,5-nh);
@ -736,7 +736,7 @@ character.standard={
viewAs:{name:'sha'}, viewAs:{name:'sha'},
viewAsFilter:function(player){ viewAsFilter:function(player){
if(get.zhu(player,'shouyue')){ if(get.zhu(player,'shouyue')){
if(!player.num('he')) return false; if(!player.countCards('he')) return false;
} }
else{ else{
if(!player.num('he',{color:'red'})) return false; if(!player.num('he',{color:'red'})) return false;
@ -747,7 +747,7 @@ character.standard={
ai:{ ai:{
skillTagFilter:function(player){ skillTagFilter:function(player){
if(get.zhu(player,'shouyue')){ if(get.zhu(player,'shouyue')){
if(!player.num('he')) return false; if(!player.countCards('he')) return false;
} }
else{ else{
if(!player.num('he',{color:'red'})) return false; if(!player.num('he',{color:'red'})) return false;
@ -966,7 +966,7 @@ character.standard={
kongcheng:{ kongcheng:{
mod:{ mod:{
targetEnabled:function(card,player,target,now){ targetEnabled:function(card,player,target,now){
if(target.num('h')==0){ if(target.countCards('h')==0){
if(card.name=='sha'||card.name=='juedou') return false; if(card.name=='sha'||card.name=='juedou') return false;
} }
} }
@ -976,7 +976,7 @@ character.standard={
noh:true, noh:true,
skillTagFilter:function(player,tag){ skillTagFilter:function(player,tag){
if(tag=='noh'){ if(tag=='noh'){
if(player.num('h')!=1) return false; if(player.countCards('h')!=1) return false;
} }
} }
} }
@ -986,7 +986,7 @@ character.standard={
trigger:{player:'loseEnd'}, trigger:{player:'loseEnd'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
if(player.num('h')) return false; if(player.countCards('h')) return false;
for(var i=0;i<event.cards.length;i++){ for(var i=0;i<event.cards.length;i++){
if(event.cards[i].original=='h') return true; if(event.cards[i].original=='h') return true;
} }
@ -1205,7 +1205,7 @@ character.standard={
}, },
result:{ result:{
player:function(player){ player:function(player){
if(player.num('h')>=player.hp-1) return -1; if(player.countCards('h')>=player.hp-1) return -1;
if(player.hp<3) return -1; if(player.hp<3) return -1;
return 1; return 1;
} }
@ -1228,7 +1228,7 @@ character.standard={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0; return player.countCards('h')>0;
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return player!=target; return player!=target;
@ -1247,7 +1247,7 @@ character.standard={
game.log(target,'选择了'+get.translation(result.control)); game.log(target,'选择了'+get.translation(result.control));
event.choice=result.control; event.choice=result.control;
target.popup(event.choice); target.popup(event.choice);
event.card=player.get('h').randomGet(); event.card=player.getCards('h').randomGet();
target.gain(event.card,player); target.gain(event.card,player);
player.$give(event.card,target); player.$give(event.card,target);
game.delay(); game.delay();
@ -1261,11 +1261,11 @@ character.standard={
var eff=ai.get.damageEffect(target,player); var eff=ai.get.damageEffect(target,player);
if(eff>=0) return 1+eff; if(eff>=0) return 1+eff;
var value=0,i; var value=0,i;
var cards=player.get('h'); var cards=player.getCards('h');
for(i=0;i<cards.length;i++){ for(i=0;i<cards.length;i++){
value+=ai.get.value(cards[i]); value+=ai.get.value(cards[i]);
} }
value/=player.num('h'); value/=player.countCards('h');
if(target.hp==1) return Math.min(0,value-7); if(target.hp==1) return Math.min(0,value-7);
return Math.min(0,value-5); return Math.min(0,value-5);
} }
@ -1295,7 +1295,7 @@ character.standard={
direct:true, direct:true,
priority:5, priority:5,
filter:function(event,player){ filter:function(event,player){
if(player.num('he')==0) return false; if(player.countCards('he')==0) return false;
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return get.distance(player,current,'attack')<=1&&current!=event.player&& return get.distance(player,current,'attack')<=1&&current!=event.player&&
current!=player&&lib.filter.targetEnabled(event.card,event.player,current); current!=player&&lib.filter.targetEnabled(event.card,event.player,current);
@ -1354,7 +1354,7 @@ character.standard={
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target){ target:function(card,player,target){
if(target.num('he')==0) return; if(target.countCards('he')==0) return;
if(card.name!='sha') return; if(card.name!='sha') return;
var min=1; var min=1;
var friend=ai.get.attitude(player,target)>0; var friend=ai.get.attitude(player,target)>0;
@ -1390,7 +1390,7 @@ character.standard={
trigger:{player:'loseEnd'}, trigger:{player:'loseEnd'},
frequent:true, frequent:true,
filter:function(event,player){ filter:function(event,player){
if(player.num('h')) return false; if(player.countCards('h')) return false;
for(var i=0;i<event.cards.length;i++){ for(var i=0;i<event.cards.length;i++){
if(event.cards[i].original=='h') return true; if(event.cards[i].original=='h') return true;
} }
@ -1409,7 +1409,7 @@ character.standard={
noh:true, noh:true,
skillTagFilter:function(player,tag){ skillTagFilter:function(player,tag){
if(tag=='noh'){ if(tag=='noh'){
if(player.num('h')!=1) return false; if(player.countCards('h')!=1) return false;
} }
} }
} }
@ -1448,7 +1448,7 @@ character.standard={
selectCard:2, selectCard:2,
check:function(card){ check:function(card){
var player=get.owner(card); var player=get.owner(card);
if(player.num('h')>player.hp) if(player.countCards('h')>player.hp)
return 8-ai.get.value(card) return 8-ai.get.value(card)
if(player.hp<player.maxHp) if(player.hp<player.maxHp)
return 6-ai.get.value(card) return 6-ai.get.value(card)
@ -1470,7 +1470,7 @@ character.standard={
result:{ result:{
player:function(player){ player:function(player){
if(player.hp<player.maxHp) return 4; if(player.hp<player.maxHp) return 4;
if(player.num('h')>player.hp) return 0 if(player.countCards('h')>player.hp) return 0
return -1; return -1;
}, },
target:4 target:4
@ -1498,7 +1498,7 @@ character.standard={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.hp==1) return 5; if(target.hp==1) return 5;
if(player==target&&player.num('h')>player.hp) return 5; if(player==target&&player.countCards('h')>player.hp) return 5;
return 2; return 2;
} }
}, },
@ -1579,7 +1579,7 @@ character.standard={
ai:{ ai:{
result:{ result:{
target:function(card,player,target){ target:function(card,player,target){
if(card.name=='juedou'&&target.num('h')>0) return [1,0,0,-1]; if(card.name=='juedou'&&target.countCards('h')>0) return [1,0,0,-1];
} }
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -32,7 +32,7 @@ character.xiake={
enable:'phaseUse', enable:'phaseUse',
position:'e', position:'e',
filter:function(event,player){ filter:function(event,player){
return player.num('e')>0; return player.countCards('e')>0;
}, },
filterCard:true, filterCard:true,
prompt:'将要重铸的牌置入弃牌堆并摸一张牌', prompt:'将要重铸的牌置入弃牌堆并摸一张牌',

View File

@ -171,17 +171,17 @@ character.xianjian={
usable:2, usable:2,
filter:function(event,player){ filter:function(event,player){
for(var i=0;i<event.cards.length;i++){ for(var i=0;i<event.cards.length;i++){
if(event.cards[i].original=='h') return player.num('h')<2; if(event.cards[i].original=='h') return player.countCards('h')<2;
} }
return false; return false;
}, },
content:function(){ content:function(){
player.draw(2-player.num('h')); player.draw(2-player.countCards('h'));
}, },
ai:{ ai:{
noh:true, noh:true,
skillTagFilter:function(player,tag){ skillTagFilter:function(player,tag){
var nh=player.num('h'); var nh=player.countCards('h');
if(tag=='noh'&&(nh>2||nh==0)){ if(tag=='noh'&&(nh>2||nh==0)){
return false; return false;
} }
@ -217,9 +217,9 @@ character.xianjian={
lueying:{ lueying:{
trigger:{player:'shaBegin'}, trigger:{player:'shaBegin'},
filter:function(event,player){ filter:function(event,player){
if(event.target.num('he')>0){ if(event.target.countCards('he')>0){
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return current!=player&&current!=event.target&&current.num('he'); return current!=player&&current!=event.target&&current.countCards('he');
}); });
} }
return false; return false;
@ -228,7 +228,7 @@ character.xianjian={
usable:1, usable:1,
content:function(){ content:function(){
'step 0' 'step 0'
var card=trigger.target.get('he').randomGet(); var card=trigger.target.getCards('he').randomGet();
player.gain(card,trigger.target); player.gain(card,trigger.target);
if(get.position(card)=='e'){ if(get.position(card)=='e'){
trigger.target.$give(card,player); trigger.target.$give(card,player);
@ -238,10 +238,10 @@ character.xianjian={
} }
'step 1' 'step 1'
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return current!=player&&current!=trigger.target&&current.num('he'); return current!=player&&current!=trigger.target&&current.countCards('he');
})){ })){
trigger.target.chooseTarget(function(card,player,target){ trigger.target.chooseTarget(function(card,player,target){
return target!=player&&target!=_status.event.parent.player&&target.num('he')>0; return target!=player&&target!=_status.event.parent.player&&target.countCards('he')>0;
},'选择一名角色并令'+get.translation(player)+'弃置其一张牌').ai=function(target){ },'选择一名角色并令'+get.translation(player)+'弃置其一张牌').ai=function(target){
return -ai.get.attitude(_status.event.player,target); return -ai.get.attitude(_status.event.player,target);
}; };
@ -276,11 +276,11 @@ character.xianjian={
forced:true, forced:true,
filter:function(event){ filter:function(event){
if(get.is.altered('tianjian')) return false; if(get.is.altered('tianjian')) return false;
return event.parent.skill=='tianjian'&&event.player.num('he'); return event.parent.skill=='tianjian'&&event.player.countCards('he');
}, },
popup:false, popup:false,
content:function(){ content:function(){
trigger.player.discard(trigger.player.get('he').randomGet()); trigger.player.discard(trigger.player.getCards('he').randomGet());
} }
} }
} }
@ -364,15 +364,15 @@ character.xianjian={
longxiang:{ longxiang:{
trigger:{player:'shaBegin'}, trigger:{player:'shaBegin'},
filter:function(event,player){ filter:function(event,player){
return event.target.num('h')>player.num('h'); return event.target.countCards('h')>player.countCards('h');
}, },
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.target)<0; return ai.get.attitude(player,event.target)<0;
}, },
logTarget:'target', logTarget:'target',
content:function(){ content:function(){
var hs=trigger.target.get('h'); var hs=trigger.target.getCards('h');
trigger.target.discard(hs.randomGets(hs.length-player.num('h'))); trigger.target.discard(hs.randomGets(hs.length-player.countCards('h')));
} }
}, },
huxi:{ huxi:{
@ -410,7 +410,7 @@ character.xianjian={
return 8-ai.get.value(card); return 8-ai.get.value(card);
}, },
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0; return player.countCards('h')>0;
}, },
discard:false, discard:false,
prepare:'throw', prepare:'throw',
@ -522,7 +522,7 @@ character.xianjian={
}).ai=function(target){ }).ai=function(target){
var att=ai.get.attitude(player,target); var att=ai.get.attitude(player,target);
if(att>0){ if(att>0){
return att+1/Math.sqrt(1+target.num('h')); return att+1/Math.sqrt(1+target.countCards('h'));
} }
return 0; return 0;
}; };
@ -645,13 +645,13 @@ character.xianjian={
zhaoyao:{ zhaoyao:{
trigger:{global:'phaseDrawBegin'}, trigger:{global:'phaseDrawBegin'},
filter:function(event,player){ filter:function(event,player){
return event.player!=player&&event.player.num('h')>0&&player.num('h')>0; return event.player!=player&&event.player.countCards('h')>0&&player.countCards('h')>0;
}, },
check:function(event,player){ check:function(event,player){
if(player.isUnseen()) return false; if(player.isUnseen()) return false;
if(ai.get.attitude(player,event.player)>=0) return false; if(ai.get.attitude(player,event.player)>=0) return false;
var hs=player.get('h'); var hs=player.getCards('h');
if(hs.length<event.player.num('h')) return false; if(hs.length<event.player.countCards('h')) return false;
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
var val=ai.get.value(hs[0]); var val=ai.get.value(hs[0]);
if(hs[i].number>=10&&val<=6) return true; if(hs[i].number>=10&&val<=6) return true;
@ -738,7 +738,7 @@ character.xianjian={
target:function(card,player,target,effect){ target:function(card,player,target,effect){
if(get.tag(card,'respondShan')&&effect<0){ if(get.tag(card,'respondShan')&&effect<0){
if(target.hasSkill('zhangmu_ai')) return 0; if(target.hasSkill('zhangmu_ai')) return 0;
if(target.num('h')>=2) return 0.5; if(target.countCards('h')>=2) return 0.5;
} }
} }
} }
@ -1063,17 +1063,17 @@ character.xianjian={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.num('h'); return target!=player&&target.countCards('h');
}, },
content:function(){ content:function(){
'step 0' 'step 0'
if(player.num('h')){ if(player.countCards('h')){
player.chooseCardButton('读心',target.get('h')).ai=function(button){ player.chooseCardButton('读心',target.getCards('h')).ai=function(button){
return ai.get.value(button.link)-5; return ai.get.value(button.link)-5;
} }
} }
else{ else{
player.viewCards('读心',target.get('h')); player.viewCards('读心',target.getCards('h'));
event.finish(); event.finish();
} }
'step 1' 'step 1'
@ -1099,7 +1099,7 @@ character.xianjian={
threaten:1.3, threaten:1.3,
result:{ result:{
target:function(player,target){ target:function(player,target){
return -target.num('h'); return -target.countCards('h');
} }
}, },
order:10, order:10,
@ -1326,7 +1326,7 @@ character.xianjian={
player.damage('nosource'); player.damage('nosource');
} }
"step 1" "step 1"
var he=player.get('he'); var he=player.getCards('he');
if(he.length){ if(he.length){
player.discard(he.randomGet()); player.discard(he.randomGet());
} }
@ -1367,7 +1367,7 @@ character.xianjian={
for(var i=0;i<player.storage.shuiyun.length;i++){ for(var i=0;i<player.storage.shuiyun.length;i++){
types.add(get.type(player.storage.shuiyun[i],'trick')); types.add(get.type(player.storage.shuiyun[i],'trick'));
} }
var cards=player.get('h'); var cards=player.getCards('h');
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
if(!types.contains(get.type(cards[i],'trick'))){ if(!types.contains(get.type(cards[i],'trick'))){
return true; return true;
@ -1378,7 +1378,7 @@ character.xianjian={
content:function(){ content:function(){
"step 0" "step 0"
var types=[]; var types=[];
var num=player.num('h'); var num=player.countCards('h');
for(var i=0;i<player.storage.shuiyun.length;i++){ for(var i=0;i<player.storage.shuiyun.length;i++){
types.add(get.type(player.storage.shuiyun[i],'trick')); types.add(get.type(player.storage.shuiyun[i],'trick'));
} }
@ -1421,7 +1421,7 @@ character.xianjian={
if(get.is.altered('shuiyun')) return; if(get.is.altered('shuiyun')) return;
if(card.name=='wuzhong'||card.name=='yiyi'|| if(card.name=='wuzhong'||card.name=='yiyi'||
card.name=='yuanjiao'||card.name=='shunshou') return; card.name=='yuanjiao'||card.name=='shunshou') return;
if(player.num('h')<=player.hp){ if(player.countCards('h')<=player.hp){
var types=[]; var types=[];
for(var i=0;i<player.storage.shuiyun.length;i++){ for(var i=0;i<player.storage.shuiyun.length;i++){
types.add(get.type(player.storage.shuiyun[i],'trick')); types.add(get.type(player.storage.shuiyun[i],'trick'));
@ -1481,7 +1481,7 @@ character.xianjian={
gainable:true, gainable:true,
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
if(!player.num('he')) return false; if(!player.countCards('he')) return false;
if(player==event.player) return false; if(player==event.player) return false;
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return current.hasSkill('wangyou3'); return current.hasSkill('wangyou3');
@ -1554,7 +1554,7 @@ character.xianjian={
}; };
"step 1" "step 1"
if(result.bool){ if(result.bool){
var cards=player.get('hej'); var cards=player.getCards('hej');
var target=result.targets[0]; var target=result.targets[0];
// if(player.storage.shuiyun&&player.storage.shuiyun.length){ // if(player.storage.shuiyun&&player.storage.shuiyun.length){
// target.gainMaxHp(); // target.gainMaxHp();
@ -1600,7 +1600,7 @@ character.xianjian={
usable:1, usable:1,
check:function(card){ check:function(card){
var player=_status.currentPhase; var player=_status.currentPhase;
if(player.num('h')>player.hp){ if(player.countCards('h')>player.hp){
return 7-ai.get.value(card); return 7-ai.get.value(card);
} }
return 4-ai.get.value(card); return 4-ai.get.value(card);
@ -1840,7 +1840,7 @@ character.xianjian={
trigger:{player:'phaseBegin'}, trigger:{player:'phaseBegin'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return player.storage.xuanning&&player.num('he')+player.storage.xuanning>=3; return player.storage.xuanning&&player.countCards('he')+player.storage.xuanning>=3;
}, },
alter:true, alter:true,
content:function(){ content:function(){
@ -1906,11 +1906,11 @@ character.xianjian={
poyun:{ poyun:{
trigger:{source:'damageEnd'}, trigger:{source:'damageEnd'},
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.player)<0&&event.player.num('he')>1; return ai.get.attitude(player,event.player)<0&&event.player.countCards('he')>1;
}, },
alter:true, alter:true,
filter:function(event,player){ filter:function(event,player){
return player.storage.xuanning>0&&event.player.num('he')>0; return player.storage.xuanning>0&&event.player.countCards('he')>0;
}, },
direct:true, direct:true,
content:function(){ content:function(){
@ -1952,7 +1952,7 @@ character.xianjian={
return get.color(card)=='black'&&get.type(card)!='basic'; return get.color(card)=='black'&&get.type(card)!='basic';
}); });
} }
return player.num('h',{type:'basic'})<player.num('he'); return player.num('h',{type:'basic'})<player.countCards('he');
}, },
init:function(player){ init:function(player){
player.storage.zhuyue=[]; player.storage.zhuyue=[];
@ -1967,7 +1967,7 @@ character.xianjian={
}, },
selectTarget:[1,2], selectTarget:[1,2],
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return player!=target&&target.num('he')>0; return player!=target&&target.countCards('he')>0;
}, },
usable:1, usable:1,
locked:false, locked:false,
@ -1980,7 +1980,7 @@ character.xianjian={
'step 0' 'step 0'
targets.sort(lib.sort.seat); targets.sort(lib.sort.seat);
var target=targets[0]; var target=targets[0];
var cs=target.get('he'); var cs=target.getCards('he');
if(cs.length){ if(cs.length){
target.discard(cs.randomGet()); target.discard(cs.randomGet());
} }
@ -1990,7 +1990,7 @@ character.xianjian={
} }
'step 1' 'step 1'
var target=targets[1]; var target=targets[1];
var cs=target.get('he'); var cs=target.getCards('he');
if(cs.length){ if(cs.length){
target.discard(cs.randomGet()); target.discard(cs.randomGet());
} }
@ -1999,7 +1999,7 @@ character.xianjian={
ai:{ ai:{
result:{ result:{
target:function(player,target){ target:function(player,target){
if(!target.num('he')) return -0.2; if(!target.countCards('he')) return -0.2;
return -1; return -1;
} }
}, },
@ -2109,7 +2109,7 @@ character.xianjian={
target.damage(2,'fire'); target.damage(2,'fire');
"step 2" "step 2"
if(target.isAlive()){ if(target.isAlive()){
target.discard(target.get('e')); target.discard(target.getCards('e'));
} }
}, },
ai:{ ai:{
@ -2317,7 +2317,7 @@ character.xianjian={
if(player.num('h',{subtype:get.subtype(card)})>1){ if(player.num('h',{subtype:get.subtype(card)})>1){
return 11-ai.get.equipValue(card); return 11-ai.get.equipValue(card);
} }
if(player.num('h')<player.hp){ if(player.countCards('h')<player.hp){
return 6-ai.get.value(card); return 6-ai.get.value(card);
} }
return 2-ai.get.equipValue(card); return 2-ai.get.equipValue(card);

File diff suppressed because it is too large Load Diff

View File

@ -168,7 +168,7 @@ character.yxs={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return Math.abs(target.num('h')-player.num('h'))<=1; return Math.abs(target.countCards('h')-player.countCards('h'))<=1;
}, },
content:function(){ content:function(){
player.swapHandcards(target); player.swapHandcards(target);
@ -181,9 +181,9 @@ character.yxs={
})){ })){
return 0; return 0;
} }
var nh=player.num('h'); var nh=player.countCards('h');
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return ai.get.attitude(player,current)<=0&&current.num('h')==nh+1; return ai.get.attitude(player,current)<=0&&current.countCards('h')==nh+1;
})){ })){
return 9; return 9;
} }
@ -198,7 +198,7 @@ character.yxs={
})){ })){
return 0; return 0;
} }
var n1=target.num('h'),n2=player.num('h'); var n1=target.countCards('h'),n2=player.countCards('h');
var num=0; var num=0;
if(n1-n2==1){ if(n1-n2==1){
num=1; num=1;
@ -219,10 +219,10 @@ character.yxs={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.num('h'); return target!=player&&target.countCards('h');
}, },
filter:function(event,player){ filter:function(event,player){
return player.num('h'); return player.countCards('h');
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -244,7 +244,7 @@ character.yxs={
wlianhuan:{ wlianhuan:{
trigger:{source:'damageBegin'}, trigger:{source:'damageBegin'},
filter:function(event,player){ filter:function(event,player){
return event.card&&event.card.name=='sha'&&player.num('e'); return event.card&&event.card.name=='sha'&&player.countCards('e');
}, },
direct:true, direct:true,
content:function(){ content:function(){
@ -302,7 +302,7 @@ character.yxs={
}, },
enable:'phaseUse', enable:'phaseUse',
filter:function(event,player){ filter:function(event,player){
return !player.storage.yixin&&player.num('he')>2; return !player.storage.yixin&&player.countCards('he')>2;
}, },
intro:{ intro:{
content:'limited' content:'limited'
@ -379,7 +379,7 @@ character.yxs={
ai1:function(card){ ai1:function(card){
if(ui.selected.cards.length>0) return -1; if(ui.selected.cards.length>0) return -1;
if(card.name=='du') return 20; if(card.name=='du') return 20;
return (_status.event.player.num('h')-_status.event.player.hp); return (_status.event.player.countCards('h')-_status.event.player.hp);
}, },
ai2:function(target){ ai2:function(target){
var att=ai.get.attitude(_status.event.player,target); var att=ai.get.attitude(_status.event.player,target);
@ -460,7 +460,7 @@ character.yxs={
ai1:function(card){ ai1:function(card){
if(ui.selected.cards.length>0) return -1; if(ui.selected.cards.length>0) return -1;
if(card.name=='du') return 20; if(card.name=='du') return 20;
return (_status.event.player.num('h')-_status.event.player.hp); return (_status.event.player.countCards('h')-_status.event.player.hp);
}, },
ai2:function(target){ ai2:function(target){
var att=ai.get.attitude(_status.event.player,target); var att=ai.get.attitude(_status.event.player,target);
@ -497,7 +497,7 @@ character.yxs={
content:function(){ content:function(){
'step 0' 'step 0'
player.chooseTarget(get.prompt('yaoyi'),[1,2],function(card,player,target){ player.chooseTarget(get.prompt('yaoyi'),[1,2],function(card,player,target){
return target.num('h')&&target.group!='qun'&&target!=player; return target.countCards('h')&&target.group!='qun'&&target!=player;
}).set('ai',function(target){ }).set('ai',function(target){
return 0.5-ai.get.attitude(_status.event.player,target); return 0.5-ai.get.attitude(_status.event.player,target);
}); });
@ -652,7 +652,7 @@ character.yxs={
forceunique:true, forceunique:true,
enable:'phaseUse', enable:'phaseUse',
filter:function(event,player){ filter:function(event,player){
return player.num('he')>0&&!player.hasSkill('tongyu_guiyin'); return player.countCards('he')>0&&!player.hasSkill('tongyu_guiyin');
}, },
filterCard:true, filterCard:true,
position:'he', position:'he',
@ -783,7 +783,7 @@ character.yxs={
event.finish(); event.finish();
} }
'step 1' 'step 1'
if(target.num('h')){ if(target.countCards('h')){
target.chooseToDiscard('h',true); target.chooseToDiscard('h',true);
} }
}, },
@ -873,7 +873,7 @@ character.yxs={
}, },
ai1:function(card){ ai1:function(card){
if(ui.selected.cards.length>0) return -1; if(ui.selected.cards.length>0) return -1;
return (_status.event.player.num('h')-_status.event.player.hp); return (_status.event.player.countCards('h')-_status.event.player.hp);
}, },
ai2:function(target){ ai2:function(target){
return ai.get.attitude(_status.event.player,target)-4; return ai.get.attitude(_status.event.player,target)-4;
@ -910,7 +910,7 @@ character.yxs={
filterCard:{color:'black'}, filterCard:{color:'black'},
position:'he', position:'he',
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.num('h')>0; return target!=player&&target.countCards('h')>0;
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -972,7 +972,7 @@ character.yxs={
check:function(event,player){ check:function(event,player){
if(ai.get.attitude(player,event.target)>=0) return false; if(ai.get.attitude(player,event.target)>=0) return false;
if(event.target.num('e','bagua')) return false; if(event.target.num('e','bagua')) return false;
if(event.target.hasSkillTag('respondShan')&&event.target.num('h')>=3) return false; if(event.target.hasSkillTag('respondShan')&&event.target.countCards('h')>=3) return false;
return true; return true;
}, },
logTarget:'target', logTarget:'target',
@ -1080,7 +1080,7 @@ character.yxs={
usable:1, usable:1,
filterCard:true, filterCard:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.num('h')>0&&get.distance(player,target)<=2; return target.countCards('h')>0&&get.distance(player,target)<=2;
}, },
check:function(card){ check:function(card){
return 7-ai.get.value(card); return 7-ai.get.value(card);
@ -1088,7 +1088,7 @@ character.yxs={
position:'he', position:'he',
content:function(){ content:function(){
"step 0" "step 0"
var hs=target.get('h'); var hs=target.getCards('h');
if(hs.length){ if(hs.length){
event.card=hs.randomGet(); event.card=hs.randomGet();
player.gain(event.card,target); player.gain(event.card,target);
@ -1103,7 +1103,7 @@ character.yxs={
return target!=player; return target!=player;
}).ai=function(target){ }).ai=function(target){
var att=ai.get.attitude(player,target); var att=ai.get.attitude(player,target);
if(att>3&&player.num('h')>target.num('h')){ if(att>3&&player.countCards('h')>target.countCards('h')){
return att; return att;
} }
return 0; return 0;
@ -1299,7 +1299,7 @@ character.yxs={
trigger:{player:'shaMiss'}, trigger:{player:'shaMiss'},
priority:-1, priority:-1,
filter:function(event){ filter:function(event){
return event.target.num('he')>0; return event.target.countCards('he')>0;
}, },
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.target)<0; return ai.get.attitude(player,event.target)<0;
@ -1320,20 +1320,20 @@ character.yxs={
filterCard:true, filterCard:true,
viewAs:{name:'shan'}, viewAs:{name:'shan'},
viewAsFilter:function(player){ viewAsFilter:function(player){
if(!player.num('h')) return false; if(!player.countCards('h')) return false;
if(player.num('e')) return false; if(player.countCards('e')) return false;
}, },
prompt:'将一张手牌当闪打出', prompt:'将一张手牌当闪打出',
check:function(){return 1}, check:function(){return 1},
ai:{ ai:{
respondShan:true, respondShan:true,
skillTagFilter:function(player){ skillTagFilter:function(player){
if(!player.num('h')) return false; if(!player.countCards('h')) return false;
if(player.num('e')) return false; if(player.countCards('e')) return false;
}, },
effect:{ effect:{
target:function(card,player,target,current){ target:function(card,player,target,current){
if(get.tag(card,'respondShan')&&current<0&&!target.num('e')) return 0.6 if(get.tag(card,'respondShan')&&current<0&&!target.countCards('e')) return 0.6
} }
} }
} }
@ -1343,11 +1343,11 @@ character.yxs={
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
if(event.player.isDead()) return false; if(event.player.isDead()) return false;
var nh=event.player.num('h'); var nh=event.player.countCards('h');
if(nh==0) return false; if(nh==0) return false;
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i]!=player&&players[i]!=event.player&&players[i].num('h')<=nh){ if(players[i]!=player&&players[i]!=event.player&&players[i].countCards('h')<=nh){
return true; return true;
} }
} }
@ -1355,10 +1355,10 @@ character.yxs={
}, },
content:function(){ content:function(){
'step 0' 'step 0'
var nh=trigger.player.num('h'); var nh=trigger.player.countCards('h');
var att=ai.get.attitude(player,trigger.player); var att=ai.get.attitude(player,trigger.player);
player.chooseTarget(get.prompt('xiadao'),function(card,player,target){ player.chooseTarget(get.prompt('xiadao'),function(card,player,target){
return target!=player&&target!=trigger.player&&target.num('h')<=nh; return target!=player&&target!=trigger.player&&target.countCards('h')<=nh;
}).ai=function(target){ }).ai=function(target){
if(att>0) return 0; if(att>0) return 0;
return ai.get.attitude(player,target); return ai.get.attitude(player,target);
@ -1366,7 +1366,7 @@ character.yxs={
'step 1' 'step 1'
if(result.bool){ if(result.bool){
player.logSkill('xiadao',result.targets); player.logSkill('xiadao',result.targets);
var card=trigger.player.get('h').randomGet(); var card=trigger.player.getCards('h').randomGet();
result.targets[0].gain(card,trigger.player); result.targets[0].gain(card,trigger.player);
trigger.player.$giveAuto(card,result.targets[0]); trigger.player.$giveAuto(card,result.targets[0]);
} }
@ -1427,7 +1427,7 @@ character.yxs={
direct:true, direct:true,
content:function(){ content:function(){
"step 0" "step 0"
if(player.num('he')){ if(player.countCards('he')){
player.chooseCardTarget({ player.chooseCardTarget({
prompt:get.prompt('yizhuang'), prompt:get.prompt('yizhuang'),
filterCard:lib.filter.cardDiscardable, filterCard:lib.filter.cardDiscardable,
@ -1515,10 +1515,10 @@ character.yxs={
if(player.hp<player.maxHp) return num+player.maxHp-player.hp; if(player.hp<player.maxHp) return num+player.maxHp-player.hp;
}, },
targetEnabled:function(card,player,target,now){ targetEnabled:function(card,player,target,now){
if(target.num('h')<target.maxHp){ if(target.countCards('h')<target.maxHp){
if(card.name=='shunshou'||card.name=='guohe') return false; if(card.name=='shunshou'||card.name=='guohe') return false;
} }
else if(target.num('h')>target.maxHp){ else if(target.countCards('h')>target.maxHp){
if(card.name=='lebu') return false; if(card.name=='lebu') return false;
} }
} }
@ -1608,7 +1608,7 @@ character.yxs={
unique:true, unique:true,
forceunique:true, forceunique:true,
check:function(card){ check:function(card){
if(_status.event.player.num('h')>=3){ if(_status.event.player.countCards('h')>=3){
return 5-ai.get.value(card); return 5-ai.get.value(card);
} }
return 0; return 0;
@ -1751,7 +1751,7 @@ character.yxs={
fenghuo:{ fenghuo:{
enable:'chooseToUse', enable:'chooseToUse',
filter:function(event,player){ filter:function(event,player){
return player.num('e')>0; return player.countCards('e')>0;
}, },
filterCard:true, filterCard:true,
position:'e', position:'e',
@ -1762,7 +1762,7 @@ character.yxs={
if(player.num('he',{subtype:get.subtype(card)})>1){ if(player.num('he',{subtype:get.subtype(card)})>1){
return 11-ai.get.equipValue(card); return 11-ai.get.equipValue(card);
} }
if(player.num('h')<player.hp){ if(player.countCards('h')<player.hp){
return 6-ai.get.value(card); return 6-ai.get.value(card);
} }
return 2-ai.get.equipValue(card); return 2-ai.get.equipValue(card);
@ -1777,7 +1777,7 @@ character.yxs={
check:function(event,player){ check:function(event,player){
if(player.skipList.contains('phaseUse')) return true; if(player.skipList.contains('phaseUse')) return true;
var suits=['spade','heart','diamond','club']; var suits=['spade','heart','diamond','club'];
var cards=player.get('h'); var cards=player.getCards('h');
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
suits.remove(get.suit(cards[i])); suits.remove(get.suit(cards[i]));
} }
@ -1794,13 +1794,13 @@ character.yxs={
forced:true, forced:true,
content:function(){ content:function(){
"step 0" "step 0"
if(player.num('h')){ if(player.countCards('h')){
player.showHandcards(); player.showHandcards();
} }
player.removeSkill('nichang2'); player.removeSkill('nichang2');
"step 1" "step 1"
var suits=['spade','heart','diamond','club']; var suits=['spade','heart','diamond','club'];
var cards=player.get('h'); var cards=player.getCards('h');
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
suits.remove(get.suit(cards[i])); suits.remove(get.suit(cards[i]));
} }
@ -1846,7 +1846,7 @@ character.yxs={
trigger:{player:'phaseDrawBegin'}, trigger:{player:'phaseDrawBegin'},
check:function(event,player){ check:function(event,player){
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return ai.get.attitude(player,current)<0&&current.num('h'); return ai.get.attitude(player,current)<0&&current.countCards('h');
}); });
}, },
content:function(){ content:function(){
@ -1864,7 +1864,7 @@ character.yxs={
"step 0" "step 0"
var num=Math.max(1,player.maxHp-player.hp); var num=Math.max(1,player.maxHp-player.hp);
player.chooseTarget('婉歌:获得至多'+get.cnNumber(num)+'名角色的一张手牌',[1,num],function(card,player,target){ player.chooseTarget('婉歌:获得至多'+get.cnNumber(num)+'名角色的一张手牌',[1,num],function(card,player,target){
return target.num('h')&&target!=player; return target.countCards('h')&&target!=player;
}).ai=function(target){ }).ai=function(target){
return -ai.get.attitude(player,target); return -ai.get.attitude(player,target);
}; };
@ -1918,7 +1918,7 @@ character.yxs={
"step 1" "step 1"
if(event.targets.length){ if(event.targets.length){
event.current=event.targets.shift(); event.current=event.targets.shift();
if(event.current.num('he')&&target.isAlive()){ if(event.current.countCards('he')&&target.isAlive()){
event.current.chooseToUse({name:'sha'},target,-1); event.current.chooseToUse({name:'sha'},target,-1);
} }
} }
@ -1945,7 +1945,7 @@ character.yxs={
} }
var effect=0; var effect=0;
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i].sex=='male'&&players[i]!=target&&players[i]!=player&&players[i].num('he')) if(players[i].sex=='male'&&players[i]!=target&&players[i]!=player&&players[i].countCards('he'))
effect+=ai.get.effect(target,{name:'sha'},players[i],target); effect+=ai.get.effect(target,{name:'sha'},players[i],target);
} }
return effect; return effect;
@ -2029,7 +2029,7 @@ character.yxs={
filter:function(event,player){ filter:function(event,player){
if(player.hasSkill('bolehuiyan4')) return false; if(player.hasSkill('bolehuiyan4')) return false;
if(event.target.isUnderControl()) return false; if(event.target.isUnderControl()) return false;
return event.player!=player&&event.target!=player&&event.target.num('h')>0; return event.player!=player&&event.target!=player&&event.target.countCards('h')>0;
}, },
group:['bolehuiyan2','bolehuiyan3'], group:['bolehuiyan2','bolehuiyan3'],
content:function(){ content:function(){
@ -2051,7 +2051,7 @@ character.yxs={
var equip=trigger.target.get('e','2'); var equip=trigger.target.get('e','2');
if(equip&&equip.name=='bagua') return 1; if(equip&&equip.name=='bagua') return 1;
return trigger.target.num('h')<2?0:1; return trigger.target.countCards('h')<2?0:1;
}; };
"step 1" "step 1"
if(event.dialog){ if(event.dialog){
@ -2164,7 +2164,7 @@ character.yxs={
weiyi:{ weiyi:{
trigger:{player:'damageEnd'}, trigger:{player:'damageEnd'},
filter:function(event,player){ filter:function(event,player){
return (event.source&&event.source.num('he')); return (event.source&&event.source.countCards('he'));
}, },
check:function(event,player){ check:function(event,player){
return ai.get.attitude(player,event.source)<0; return ai.get.attitude(player,event.source)<0;
@ -2177,7 +2177,7 @@ character.yxs={
expose:0.3, expose:0.3,
result:{ result:{
target:function(card,player,target){ target:function(card,player,target){
if(player.num('he')>1&&get.tag(card,'damage')){ if(player.countCards('he')>1&&get.tag(card,'damage')){
if(player.hasSkillTag('jueqing')) return [1,-1]; if(player.hasSkillTag('jueqing')) return [1,-1];
if(ai.get.attitude(target,player)<0) return [1,0,0,-1.5]; if(ai.get.attitude(target,player)<0) return [1,0,0,-1.5];
} }
@ -2263,7 +2263,7 @@ character.yxs={
ai:{ ai:{
result:{ result:{
target:function(card,player,target){ target:function(card,player,target){
if(card.name=='juedou'&&target.num('h')>0) return [1,0,0,-1]; if(card.name=='juedou'&&target.countCards('h')>0) return [1,0,0,-1];
} }
} }
} }
@ -2476,7 +2476,7 @@ character.yxs={
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(ui.selected.targets.length){ if(ui.selected.targets.length){
var from=ui.selected.targets[0]; var from=ui.selected.targets[0];
var judges=from.get('j'); var judges=from.getCards('j');
for(var i=0;i<judges.length;i++){ for(var i=0;i<judges.length;i++){
if(!target.hasJudge(judges[i].viewAs||judges[i].name)) return true; if(!target.hasJudge(judges[i].viewAs||judges[i].name)) return true;
} }
@ -2489,7 +2489,7 @@ character.yxs={
return false; return false;
} }
else{ else{
return target.num('ej')>0; return target.countCards('ej')>0;
} }
}, },
selectTarget:2, selectTarget:2,
@ -2529,7 +2529,7 @@ character.yxs={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(ui.selected.targets.length==0){ if(ui.selected.targets.length==0){
if(target.num('j')&&ai.get.attitude(player,target)>0) return 1; if(target.countCards('j')&&ai.get.attitude(player,target)>0) return 1;
if(ai.get.attitude(player,target)<0){ if(ai.get.attitude(player,target)<0){
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
@ -2558,7 +2558,7 @@ character.yxs={
trigger:{player:'loseEnd'}, trigger:{player:'loseEnd'},
frequent:true, frequent:true,
filter:function(event,player){ filter:function(event,player){
if(player.num('h')) return false; if(player.countCards('h')) return false;
for(var i=0;i<event.cards.length;i++){ for(var i=0;i<event.cards.length;i++){
if(event.cards[i].original=='h') return true; if(event.cards[i].original=='h') return true;
} }
@ -2605,7 +2605,7 @@ character.yxs={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.num('he')>0; return target!=player&&target.countCards('he')>0;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -2663,7 +2663,7 @@ character.yxs={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return player!=target&&target.num('e')>0; return player!=target&&target.countCards('e')>0;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -2740,7 +2740,7 @@ character.yxs={
threaten:1.5, threaten:1.5,
result:{ result:{
player:function(player){ player:function(player){
if(player.num('e')<3) return 1; if(player.countCards('e')<3) return 1;
return 0; return 0;
} }
} }

View File

@ -204,15 +204,15 @@ character.zhuogui={
trigger:{player:'phaseJudgeBegin'}, trigger:{player:'phaseJudgeBegin'},
forced:true, forced:true,
content:function(){ content:function(){
player.discard(player.get('j').randomGet()); player.discard(player.getCards('j').randomGet());
}, },
filter:function(event ,player){ filter:function(event ,player){
return player.num('j')>0; return player.countCards('j')>0;
}, },
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target,current){ target:function(card,player,target,current){
if(get.type(card)=='delay'&&target.num('j')==0) return 0.1; if(get.type(card)=='delay'&&target.countCards('j')==0) return 0.1;
} }
} }
} }
@ -224,21 +224,21 @@ character.zhuogui={
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i]!=player&&game.players[i].num('h')) return true; if(game.players[i]!=player&&game.players[i].countCards('h')) return true;
} }
return false; return false;
}, },
content:function(){ content:function(){
"step 0" "step 0"
player.chooseTarget('获得一名角色的一张手牌',true,function(card,player,target){ player.chooseTarget('获得一名角色的一张手牌',true,function(card,player,target){
return player!=target&&target.num('h')>0; return player!=target&&target.countCards('h')>0;
}).ai=function(target){ }).ai=function(target){
return -ai.get.attitude(player,target); return -ai.get.attitude(player,target);
}; };
"step 1" "step 1"
if(result.targets&&result.targets.length){ if(result.targets&&result.targets.length){
player.logSkill('qiangzheng',result.targets); player.logSkill('qiangzheng',result.targets);
player.gain(result.targets[0].get('h').randomGet(),result.targets[0]); player.gain(result.targets[0].getCards('h').randomGet(),result.targets[0]);
result.targets[0].$give(1,player); result.targets[0].$give(1,player);
game.delay(); game.delay();
} }

View File

@ -69,7 +69,7 @@ play.wuxing={
case 'metal': case 'metal':
switch(player.wunature){ switch(player.wunature){
case 'wood': case 'wood':
if(player.num('he')){ if(player.countCards('he')){
game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制'); game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制');
player.chooseToDiscard('你被金属性卡牌克制,需弃置一张牌',true,'he').ai=ai.get.disvalue;player.popup('金克木')};return; player.chooseToDiscard('你被金属性卡牌克制,需弃置一张牌',true,'he').ai=ai.get.disvalue;player.popup('金克木')};return;
case 'water': case 'water':
@ -81,7 +81,7 @@ play.wuxing={
case 'wood': case 'wood':
switch(player.wunature){ switch(player.wunature){
case 'soil': case 'soil':
if(player.num('he')){ if(player.countCards('he')){
game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制'); game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制');
player.chooseToDiscard('你被木属性卡牌克制,需弃置一张牌',true,'he').ai=ai.get.disvalue;player.popup('木克土')};return; player.chooseToDiscard('你被木属性卡牌克制,需弃置一张牌',true,'he').ai=ai.get.disvalue;player.popup('木克土')};return;
case 'fire': case 'fire':
@ -93,7 +93,7 @@ play.wuxing={
case 'water': case 'water':
switch(player.wunature){ switch(player.wunature){
case 'fire': case 'fire':
if(player.num('he')){ if(player.countCards('he')){
game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制'); game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制');
player.chooseToDiscard('你被水属性卡牌克制,需弃置一张牌',true,'he').ai=ai.get.disvalue;player.popup('水克火')};return; player.chooseToDiscard('你被水属性卡牌克制,需弃置一张牌',true,'he').ai=ai.get.disvalue;player.popup('水克火')};return;
case 'wood': case 'wood':
@ -105,7 +105,7 @@ play.wuxing={
case 'fire': case 'fire':
switch(player.wunature){ switch(player.wunature){
case 'metal': case 'metal':
if(player.num('he')){ if(player.countCards('he')){
game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制'); game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制');
player.chooseToDiscard('你被火属性卡牌克制,需弃置一张牌',true,'he').ai=ai.get.disvalue;player.popup('火克金')};return; player.chooseToDiscard('你被火属性卡牌克制,需弃置一张牌',true,'he').ai=ai.get.disvalue;player.popup('火克金')};return;
case 'soil': case 'soil':
@ -117,7 +117,7 @@ play.wuxing={
case 'soil': case 'soil':
switch(player.wunature){ switch(player.wunature){
case 'water': case 'water':
if(player.num('he')){ if(player.countCards('he')){
game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制'); game.log(player,'被'+get.translation(trigger.card.wunature)+'属性的卡牌克制');
player.chooseToDiscard('你被土属性卡牌克制,需弃置一张牌',true,'he').ai=ai.get.disvalue;player.popup('土克水')};return; player.chooseToDiscard('你被土属性卡牌克制,需弃置一张牌',true,'he').ai=ai.get.disvalue;player.popup('土克水')};return;
case 'metal': case 'metal':

View File

@ -7840,7 +7840,7 @@
} }
}, },
h:function(player){ h:function(player){
console.log(get.translation(player.get('h'))); console.log(get.translation(player.getCards('h')));
}, },
g:function(){ g:function(){
for(var i=0;i<arguments.length;i++){ for(var i=0;i<arguments.length;i++){
@ -7968,7 +7968,7 @@
return; return;
} }
var player=game.players[num]; var player=game.players[num];
var cards=player.get('hej'); var cards=player.getCards('hej');
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
ui.discardPile.appendChild(cards[i]); ui.discardPile.appendChild(cards[i]);
} }
@ -8172,7 +8172,7 @@
if(game.changeCoin){ if(game.changeCoin){
game.changeCoin(-3); game.changeCoin(-3);
} }
var hs=game.me.get('h'); var hs=game.me.getCards('h');
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
ui.discardPile.appendChild(hs[i]); ui.discardPile.appendChild(hs[i]);
} }
@ -8615,7 +8615,7 @@
} }
'step 1' 'step 1'
if(result&&result.bool){ if(result&&result.bool){
var hs=game.me.get('h') var hs=game.me.getCards('h')
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
ui.discardPile.appendChild(hs[i]); ui.discardPile.appendChild(hs[i]);
} }
@ -8630,7 +8630,7 @@
}; };
var sendback=function(result,player){ var sendback=function(result,player){
if(result&&result.bool){ if(result&&result.bool){
var hs=player.get('h') var hs=player.getCards('h')
game.broadcastAll(function(player,hs){ game.broadcastAll(function(player,hs){
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
ui.discardPile.appendChild(hs[i]); ui.discardPile.appendChild(hs[i]);
@ -8759,7 +8759,7 @@
}, },
phaseDiscard:function(){ phaseDiscard:function(){
"step 0" "step 0"
event.num=player.num('h')-player.getHandcardLimit(); event.num=player.countCards('h')-player.getHandcardLimit();
if(event.num<=0) event.finish(); if(event.num<=0) event.finish();
else{ else{
if(lib.config.show_phase_prompt){ if(lib.config.show_phase_prompt){
@ -9176,13 +9176,13 @@
}, },
chooseToCompareMultiple:function(){ chooseToCompareMultiple:function(){
"step 0" "step 0"
if(player.num('h')==0){ if(player.countCards('h')==0){
event.result={cancelled:true,bool:false} event.result={cancelled:true,bool:false}
event.finish(); event.finish();
return; return;
} }
for(var i=0;i<targets.length;i++){ for(var i=0;i<targets.length;i++){
if(targets[i].num('h')==0){ if(targets[i].countCards('h')==0){
event.result={cancelled:true,bool:false} event.result={cancelled:true,bool:false}
event.finish(); event.finish();
return; return;
@ -9196,7 +9196,7 @@
event.list=targets.slice(0); event.list=targets.slice(0);
event.list.unshift(player); event.list.unshift(player);
player.chooseCardOL(event.list,'请选择拼点牌',true).set('ai',event.ai).set('source',player).aiCard=function(target){ player.chooseCardOL(event.list,'请选择拼点牌',true).set('ai',event.ai).set('source',player).aiCard=function(target){
var hs=target.get('h'); var hs=target.getCards('h');
var event=_status.event; var event=_status.event;
event.player=target; event.player=target;
hs.sort(function(a,b){ hs.sort(function(a,b){
@ -9289,7 +9289,7 @@
}, },
chooseToCompare:function(){ chooseToCompare:function(){
"step 0" "step 0"
if(player.num('h')==0||target.num('h')==0){ if(player.countCards('h')==0||target.countCards('h')==0){
event.result={cancelled:true,bool:false} event.result={cancelled:true,bool:false}
event.finish(); event.finish();
return; return;
@ -9354,7 +9354,7 @@
return; return;
} }
if(event.card2.number>=10||event.card2.number<=4){ if(event.card2.number>=10||event.card2.number<=4){
if(target.num('h')>2){ if(target.countCards('h')>2){
event.addToAI=true; event.addToAI=true;
} }
} }
@ -9975,9 +9975,9 @@
} }
var directh=true; var directh=true;
for(var i=0;i<event.position.length;i++){ for(var i=0;i<event.position.length;i++){
if(event.position[i]=='h'&&target.num('h')){ if(event.position[i]=='h'&&target.countCards('h')){
event.dialog.add('手牌'); event.dialog.add('手牌');
var hs=target.get('h'); var hs=target.getCards('h');
hs.randomSort(); hs.randomSort();
if(event.visible||target.isUnderControl(true)){ if(event.visible||target.isUnderControl(true)){
event.dialog.add(hs); event.dialog.add(hs);
@ -9987,14 +9987,14 @@
event.dialog.add([hs,'blank']); event.dialog.add([hs,'blank']);
} }
} }
else if(event.position[i]=='e'&&target.num('e')){ else if(event.position[i]=='e'&&target.countCards('e')){
event.dialog.add('装备牌'); event.dialog.add('装备牌');
event.dialog.add(target.get('e')); event.dialog.add(target.getCards('e'));
directh=false; directh=false;
} }
else if(event.position[i]=='j'&&target.num('j')){ else if(event.position[i]=='j'&&target.countCards('j')){
event.dialog.add('判定牌'); event.dialog.add('判定牌');
event.dialog.add(target.get('j')); event.dialog.add(target.getCards('j'));
directh=false; directh=false;
} }
} }
@ -10069,9 +10069,9 @@
} }
var directh=true; var directh=true;
for(var i=0;i<event.position.length;i++){ for(var i=0;i<event.position.length;i++){
if(event.position[i]=='h'&&target.num('h')){ if(event.position[i]=='h'&&target.countCards('h')){
event.dialog.add('手牌'); event.dialog.add('手牌');
var hs=target.get('h'); var hs=target.getCards('h');
hs.randomSort(); hs.randomSort();
if(event.visible||target.isUnderControl(true)){ if(event.visible||target.isUnderControl(true)){
event.dialog.add(hs); event.dialog.add(hs);
@ -10081,14 +10081,14 @@
event.dialog.add([hs,'blank']); event.dialog.add([hs,'blank']);
} }
} }
else if(event.position[i]=='e'&&target.num('e')){ else if(event.position[i]=='e'&&target.countCards('e')){
event.dialog.add('装备牌'); event.dialog.add('装备牌');
event.dialog.add(target.get('e')); event.dialog.add(target.getCards('e'));
directh=false; directh=false;
} }
else if(event.position[i]=='j'&&target.num('j')){ else if(event.position[i]=='j'&&target.countCards('j')){
event.dialog.add('判定牌'); event.dialog.add('判定牌');
event.dialog.add(target.get('j')); event.dialog.add(target.getCards('j'));
directh=false; directh=false;
} }
} }
@ -10180,9 +10180,9 @@
} }
var directh=true; var directh=true;
for(var i=0;i<event.position.length;i++){ for(var i=0;i<event.position.length;i++){
if(event.position[i]=='h'&&target.num('h')){ if(event.position[i]=='h'&&target.countCards('h')){
event.dialog.add('手牌'); event.dialog.add('手牌');
var hs=target.get('h'); var hs=target.getCards('h');
hs.randomSort(); hs.randomSort();
if(event.visible||target.isUnderControl(true)){ if(event.visible||target.isUnderControl(true)){
event.dialog.add(hs); event.dialog.add(hs);
@ -10192,14 +10192,14 @@
event.dialog.add([hs,'blank']); event.dialog.add([hs,'blank']);
} }
} }
else if(event.position[i]=='e'&&target.num('e')){ else if(event.position[i]=='e'&&target.countCards('e')){
event.dialog.add('装备牌'); event.dialog.add('装备牌');
event.dialog.add(target.get('e')); event.dialog.add(target.getCards('e'));
directh=false; directh=false;
} }
else if(event.position[i]=='j'&&target.num('j')){ else if(event.position[i]=='j'&&target.countCards('j')){
event.dialog.add('判定牌'); event.dialog.add('判定牌');
event.dialog.add(target.get('j')); event.dialog.add(target.getCards('j'));
directh=false; directh=false;
} }
} }
@ -10292,11 +10292,11 @@
}, },
showHandcards:function(){ showHandcards:function(){
"step 0" "step 0"
if(player.num('h')==0){ if(player.countCards('h')==0){
event.finish(); event.finish();
return; return;
} }
var cards=player.get('h'); var cards=player.getCards('h');
var str=get.translation(player.name)+'的手牌'; var str=get.translation(player.name)+'的手牌';
if(typeof event.prompt=='string'){ if(typeof event.prompt=='string'){
str=event.prompt; str=event.prompt;
@ -11001,8 +11001,8 @@
}, },
swapHandcards:function(){ swapHandcards:function(){
'step 0' 'step 0'
event.cards1=player.get('h'); event.cards1=player.getCards('h');
event.cards2=target.get('h'); event.cards2=target.getCards('h');
player.$giveAuto(event.cards1,target); player.$giveAuto(event.cards1,target);
target.$giveAuto(event.cards2,player); target.$giveAuto(event.cards2,player);
'step 1' 'step 1'
@ -11057,7 +11057,7 @@
var sort; var sort;
var frag1=document.createDocumentFragment(); var frag1=document.createDocumentFragment();
var frag2=document.createDocumentFragment(); var frag2=document.createDocumentFragment();
var hs=player.get('h'); var hs=player.getCards('h');
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
if(hs.contains(cards[i])){ if(hs.contains(cards[i])){
cards.splice(i--,1); cards.splice(i--,1);
@ -11145,7 +11145,7 @@
lose:function(){ lose:function(){
"step 0" "step 0"
var hs=[],es=[],js=[]; var hs=[],es=[],js=[];
var hej=player.get('hej'); var hej=player.getCards('hej');
event.stockcards=cards.slice(0); event.stockcards=cards.slice(0);
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
cards[i].style.transform+=' scale(0.2)'; cards[i].style.transform+=' scale(0.2)';
@ -11493,8 +11493,8 @@
else{ else{
game.log(player,'阵亡') game.log(player,'阵亡')
} }
event.cards=player.get('hej'); event.cards=player.getCards('hej');
event.playerCards=player.get('he'); event.playerCards=player.getCards('he');
if(event.cards.length){ if(event.cards.length){
player.$throw(event.cards,1000); player.$throw(event.cards,1000);
game.log(player,'弃置了',event.cards); game.log(player,'弃置了',event.cards);
@ -12329,9 +12329,9 @@
name:this.name, name:this.name,
name1:this.name1, name1:this.name1,
name2:this.name2, name2:this.name2,
handcards:this.get('h'), handcards:this.getCards('h'),
equips:this.get('e'), equips:this.getCards('e'),
judges:this.get('j'), judges:this.getCards('j'),
views:[], views:[],
position:parseInt(this.dataset.position), position:parseInt(this.dataset.position),
hujia:this.hujia, hujia:this.hujia,
@ -12449,7 +12449,7 @@
setTimeout(function(){ setTimeout(function(){
hp.style.transition=''; hp.style.transition='';
}); });
var numh=this.num('h'); var numh=this.countCards('h');
if(_status.video){ if(_status.video){
numh=arguments[0]; numh=arguments[0];
} }
@ -12479,7 +12479,7 @@
} }
} }
if(!_status.video){ if(!_status.video){
game.addVideo('update',this,[this.num('h'),this.hp,this.maxHp,this.hujia]); game.addVideo('update',this,[this.countCards('h'),this.hp,this.maxHp,this.hujia]);
} }
if(this.node.jiu&&!this.hasSkill('jiu')){ if(this.node.jiu&&!this.hasSkill('jiu')){
this.node.jiu.delete(); this.node.jiu.delete();
@ -12603,7 +12603,7 @@
}, },
getCards:function(arg1,arg2){ getCards:function(arg1,arg2){
if(typeof arg1!='string'){ if(typeof arg1!='string'){
arg1='he'; arg1='h';
} }
var cards=[],cards1=[]; var cards=[],cards1=[];
var i,j; var i,j;
@ -13887,7 +13887,7 @@
return next; return next;
}, },
directgain:function(cards){ directgain:function(cards){
var hs=this.get('h'); var hs=this.getCards('h');
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
if(hs.contains(cards[i])){ if(hs.contains(cards[i])){
cards.splice(i--,1); cards.splice(i--,1);
@ -15034,7 +15034,7 @@
} }
} }
else{ else{
var es=this.get('e'); var es=this.getCards('e');
for(var i=0;i<es.length;i++){ for(var i=0;i<es.length;i++){
this.addEquipTrigger(es[i]); this.addEquipTrigger(es[i]);
} }
@ -15051,7 +15051,7 @@
} }
} }
else{ else{
var es=this.get('e'); var es=this.getCards('e');
for(var i=0;i<es.length;i++){ for(var i=0;i<es.length;i++){
this.removeEquipTrigger(es[i]); this.removeEquipTrigger(es[i]);
} }
@ -15327,7 +15327,7 @@
var range=0; var range=0;
range=game.checkMod(player,player,range,'globalFrom',player.get('s')); range=game.checkMod(player,player,range,'globalFrom',player.get('s'));
range=game.checkMod(player,player,range,'attackFrom',player.get('s')); range=game.checkMod(player,player,range,'attackFrom',player.get('s'));
var equips=player.get('e'); var equips=player.getCards('e');
for(var i=0;i<equips.length;i++){ for(var i=0;i<equips.length;i++){
var info=get.info(equips[i]).distance; var info=get.info(equips[i]).distance;
if(!info) continue; if(!info) continue;
@ -15344,7 +15344,7 @@
var player=this; var player=this;
var range=0; var range=0;
range=game.checkMod(player,player,range,'globalFrom',player.get('s')); range=game.checkMod(player,player,range,'globalFrom',player.get('s'));
var equips=player.get('e'); var equips=player.getCards('e');
for(var i=0;i<equips.length;i++){ for(var i=0;i<equips.length;i++){
var info=get.info(equips[i]).distance; var info=get.info(equips[i]).distance;
if(!info) continue; if(!info) continue;
@ -15358,7 +15358,7 @@
var player=this; var player=this;
var range=0; var range=0;
range=game.checkMod(player,player,range,'globalTo',player.get('s')); range=game.checkMod(player,player,range,'globalTo',player.get('s'));
var equips=player.get('e'); var equips=player.getCards('e');
for(var i=0;i<equips.length;i++){ for(var i=0;i<equips.length;i++){
var info=get.info(equips[i]).distance; var info=get.info(equips[i]).distance;
if(!info) continue; if(!info) continue;
@ -15474,27 +15474,27 @@
return true; return true;
}, },
isMostHandcard:function(equal){ isMostHandcard:function(equal){
var nh=this.num('h'); var nh=this.countCards('h');
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i].isOut()) continue; if(game.players[i].isOut()) continue;
if(equal){ if(equal){
if(game.players[i].num('h')>=nh) return false; if(game.players[i].countCards('h')>=nh) return false;
} }
else{ else{
if(game.players[i].num('h')>nh) return false; if(game.players[i].countCards('h')>nh) return false;
} }
} }
return true; return true;
}, },
isFewestHandcard:function(equal){ isFewestHandcard:function(equal){
var nh=this.num('h'); var nh=this.countCards('h');
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i].isOut()) continue; if(game.players[i].isOut()) continue;
if(equal){ if(equal){
if(game.players[i].num('h')<=nh) return false; if(game.players[i].countCards('h')<=nh) return false;
} }
else{ else{
if(game.players[i].num('h')<nh) return false; if(game.players[i].countCards('h')<nh) return false;
} }
} }
return true; return true;
@ -15571,7 +15571,7 @@
}, },
needsToDiscard:function(num){ needsToDiscard:function(num){
if(typeof num!='number') num=0; if(typeof num!='number') num=0;
return Math.max(0,num+this.num('h')-this.getHandcardLimit()); return Math.max(0,num+this.countCards('h')-this.getHandcardLimit());
}, },
distanceTo:function(target,method){ distanceTo:function(target,method){
return get.distance(this,target,method); return get.distance(this,target,method);
@ -18218,7 +18218,7 @@
return range; return range;
}, },
judge:function(card,player,target){ judge:function(card,player,target){
var judges=target.get('j'); var judges=target.getCards('j');
for(var i=0;i<judges.length;i++){ for(var i=0;i<judges.length;i++){
if((judges[i].viewAs||judges[i].name)==card.name) return false; if((judges[i].viewAs||judges[i].name)==card.name) return false;
} }
@ -21213,7 +21213,7 @@
console.log('diex'); console.log('diex');
return; return;
} }
var cards=player.get('hej'); var cards=player.getCards('hej');
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
cards[i].goto(ui.discardPile); cards[i].goto(ui.discardPile);
} }
@ -21454,7 +21454,7 @@
lose:function(player,info){ lose:function(player,info){
if(player&&info){ if(player&&info){
var hs=info[0],es=info[1],js=info[2]; var hs=info[0],es=info[1],js=info[2];
var phs=player.get('h'),pes=player.get('e'),pjs=player.get('j'); var phs=player.getCards('h'),pes=player.getCards('e'),pjs=player.getCards('j');
var checkMatch=function(l1,l2){ var checkMatch=function(l1,l2){
for(var i=0;i<l1.length;i++){ for(var i=0;i<l1.length;i++){
for(var j=0;j<l2.length;j++){ for(var j=0;j<l2.length;j++){
@ -22994,7 +22994,7 @@
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(!_status.connectMode&&game.players[i].isUnderControl(true)&&game.layout!='long2') continue; if(!_status.connectMode&&game.players[i].isUnderControl(true)&&game.layout!='long2') continue;
var hs=game.players[i].get('h'); var hs=game.players[i].getCards('h');
if(hs.length){ if(hs.length){
dialog.add('<div class="text center">'+get.translation(game.players[i])+'</div>'); dialog.add('<div class="text center">'+get.translation(game.players[i])+'</div>');
dialog.addSmall(hs); dialog.addSmall(hs);
@ -23739,7 +23739,7 @@
selected[0].classList.remove('selected'); selected[0].classList.remove('selected');
} }
if(_status.event.player){ if(_status.event.player){
var cards=_status.event.player.get('hej'); var cards=_status.event.player.getCards('hej');
for(j=0;j<cards.length;j++){ for(j=0;j<cards.length;j++){
cards[j].classList.remove('selected'); cards[j].classList.remove('selected');
cards[j].classList.remove('selectable'); cards[j].classList.remove('selectable');
@ -23763,7 +23763,7 @@
ui.selected.targets.length=0; ui.selected.targets.length=0;
} }
else if(args[i]=='card'){ else if(args[i]=='card'){
var cards=_status.event.player.get('hej'); var cards=_status.event.player.getCards('hej');
for(j=0;j<cards.length;j++){ for(j=0;j<cards.length;j++){
cards[j].classList.remove('selected'); cards[j].classList.remove('selected');
cards[j].classList.remove('selectable'); cards[j].classList.remove('selectable');
@ -23845,7 +23845,7 @@
} }
else{ else{
if(player==game.me) return; if(player==game.me) return;
game.addVideo('swapPlayer',player,get.cardsInfo(player.get('h'))); game.addVideo('swapPlayer',player,get.cardsInfo(player.getCards('h')));
var pos=parseInt(player.dataset.position); var pos=parseInt(player.dataset.position);
var num=game.players.length+game.dead.length; var num=game.players.length+game.dead.length;
var players=game.players.concat(game.dead); var players=game.players.concat(game.dead);
@ -23905,7 +23905,7 @@
ui.handcards1Container.insertBefore(ui.handcards1,ui.handcards1Container.firstChild); ui.handcards1Container.insertBefore(ui.handcards1,ui.handcards1Container.firstChild);
ui.handcards2Container.insertBefore(ui.handcards2,ui.handcards2Container.firstChild); ui.handcards2Container.insertBefore(ui.handcards2,ui.handcards2Container.firstChild);
ui.updatehl(); ui.updatehl();
game.addVideo('swapControl',player,get.cardsInfo(player.get('h'))); game.addVideo('swapControl',player,get.cardsInfo(player.getCards('h')));
if(game.me.isAlive()){ if(game.me.isAlive()){
if(ui.auto) ui.auto.show(); if(ui.auto) ui.auto.show();
@ -31683,7 +31683,7 @@
case '伤害':target.damage(num,'nosource');break; case '伤害':target.damage(num,'nosource');break;
case '回复':target.recover(num,'nosource');break; case '回复':target.recover(num,'nosource');break;
case '摸牌':target.draw(num);break; case '摸牌':target.draw(num);break;
case '弃牌':target.discard(target.get('he').randomGets(num));break; case '弃牌':target.discard(target.getCards('he').randomGets(num));break;
case '横置':target.link();break; case '横置':target.link();break;
case '翻面':target.turnOver();break; case '翻面':target.turnOver();break;
case '复活':target.revive(target.maxHp);break; case '复活':target.revive(target.maxHp);break;
@ -36581,7 +36581,7 @@
if(event.skillDialog&&get.objtype(event.skillDialog)=='div'){ if(event.skillDialog&&get.objtype(event.skillDialog)=='div'){
event.skillDialog.close(); event.skillDialog.close();
} }
var cards=event.player.get('hej'); var cards=event.player.getCards('hej');
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
cards[i].recheck('useSkill'); cards[i].recheck('useSkill');
} }
@ -36613,7 +36613,7 @@
} }
// ui.control.animate('nozoom',100); // ui.control.animate('nozoom',100);
event.restore(); event.restore();
var cards=event.player.get('hej'); var cards=event.player.getCards('hej');
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
cards[i].recheck('useSkill'); cards[i].recheck('useSkill');
} }
@ -38779,7 +38779,7 @@
m=n; m=n;
m=game.checkMod(from,to,m,'attackFrom',from.get('s')); m=game.checkMod(from,to,m,'attackFrom',from.get('s'));
m=game.checkMod(from,to,m,'attackTo',to.get('s')); m=game.checkMod(from,to,m,'attackTo',to.get('s'));
var equips1=from.get('e'),equips2=to.get('e'); var equips1=from.getCards('e'),equips2=to.getCards('e');
for(i=0;i<equips1.length;i++){ for(i=0;i<equips1.length;i++){
var info=get.info(equips1[i]).distance; var info=get.info(equips1[i]).distance;
if(!info) continue; if(!info) continue;
@ -39001,7 +39001,7 @@
}, },
selectableCards:function(sort){ selectableCards:function(sort){
if(!_status.event.player) return[]; if(!_status.event.player) return[];
var cards=_status.event.player.get('hej'); var cards=_status.event.player.getCards('hej');
var selectable=[]; var selectable=[];
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
if(cards[i].classList.contains('selectable')&& if(cards[i].classList.contains('selectable')&&
@ -39145,7 +39145,7 @@
}, },
owner:function(card,method){ owner:function(card,method){
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i].get('hej').contains(card)) return game.players[i]; if(game.players[i].getCards('hej').contains(card)) return game.players[i];
if(game.players[i].judging[0]==card&&method!='judge') return game.players[i]; if(game.players[i].judging[0]==card&&method!='judge') return game.players[i];
} }
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
@ -39429,10 +39429,10 @@
uiintro.add(capt); uiintro.add(capt);
if(node.isUnderControl()){ if(node.isUnderControl()){
var hs=node.get('h'); var hs=node.getCards('h');
if(hs.length){ if(hs.length){
uiintro.add('<div class="text center">手牌</div>'); uiintro.add('<div class="text center">手牌</div>');
uiintro.addSmall(node.get('h')); uiintro.addSmall(node.getCards('h'));
} }
} }
@ -39537,7 +39537,7 @@
} }
tr.appendChild(td); tr.appendChild(td);
td=document.createElement('td'); td=document.createElement('td');
td.innerHTML=node.num('h'); td.innerHTML=node.countCards('h');
tr.appendChild(td); tr.appendChild(td);
td=document.createElement('td'); td=document.createElement('td');
td.innerHTML=node.stat.length-1; td.innerHTML=node.stat.length-1;
@ -39551,12 +39551,12 @@
} }
} }
if(!simple||get.is.phoneLayout()){ if(!simple||get.is.phoneLayout()){
var es=node.get('e'); var es=node.getCards('e');
for(var i=0;i<es.length;i++){ for(var i=0;i<es.length;i++){
uiintro.add('<div><div class="skill">'+es[i].outerHTML+'</div><div>'+lib.translate[es[i].name+'_info']+'</div></div>'); uiintro.add('<div><div class="skill">'+es[i].outerHTML+'</div><div>'+lib.translate[es[i].name+'_info']+'</div></div>');
uiintro.content.lastChild.querySelector('.skill>.card').style.transform=''; uiintro.content.lastChild.querySelector('.skill>.card').style.transform='';
} }
var js=node.get('j'); var js=node.getCards('j');
for(var i=0;i<js.length;i++){ for(var i=0;i<js.length;i++){
if(js[i].viewAs&&js[i].viewAs!=js[i].name){ if(js[i].viewAs&&js[i].viewAs!=js[i].name){
uiintro.add('<div><div class="skill">'+js[i].outerHTML+'</div><div>'+lib.translate[js[i].viewAs]+''+lib.translate[js[i].viewAs+'_info']+'</div></div>'); uiintro.add('<div><div class="skill">'+js[i].outerHTML+'</div><div>'+lib.translate[js[i].viewAs]+''+lib.translate[js[i].viewAs+'_info']+'</div></div>');
@ -40397,7 +40397,7 @@
if(get.objtype(value)=='array'){ if(get.objtype(value)=='array'){
if(method=='raw') return value[0]; if(method=='raw') return value[0];
var num=0,i; var num=0,i;
var cards=player.get('h'); var cards=player.getCards('h');
for(i=0;i<cards.length;i++){ for(i=0;i<cards.length;i++){
if(cards[i].name==card.name&& if(cards[i].name==card.name&&
cards[i]!=card&& cards[i]!=card&&
@ -40599,13 +40599,13 @@
} }
if(target.hp<=1) result2*=2; if(target.hp<=1) result2*=2;
if(target.hp==2) result2*=1.1; if(target.hp==2) result2*=1.1;
if(target.num('h')==0){ if(target.countCards('h')==0){
result2*=1.1; result2*=1.1;
if(get.tag(card,'respondSha')||get.tag(card,'respondShan')) result2*=1.4; if(get.tag(card,'respondSha')||get.tag(card,'respondShan')) result2*=1.4;
} }
if(target.num('h')==1) result2*=1.05; if(target.countCards('h')==1) result2*=1.05;
if(target.num('h')==2) result2*=1.02; if(target.countCards('h')==2) result2*=1.02;
if(target.num('h')>3) result2*=0.9; if(target.countCards('h')>3) result2*=0.9;
if(target.hp==4) result2*=0.9; if(target.hp==4) result2*=0.9;
if(target.hp==5) result2*=0.8; if(target.hp==5) result2*=0.8;
if(target.hp>5) result2*=0.6; if(target.hp>5) result2*=0.6;
@ -40651,13 +40651,13 @@
var card=button.link; var card=button.link;
var player=get.owner(card); var player=get.owner(card);
if(!player) player=_status.event.player; if(!player) player=_status.event.player;
if(player.get('j').contains(card)){ if(player.getCards('j').contains(card)){
var efff=ai.get.effect(player,card,player,player); var efff=ai.get.effect(player,card,player,player);
if(efff>0) return 0.5; if(efff>0) return 0.5;
if(efff==0) return 0; if(efff==0) return 0;
return -1.5; return -1.5;
} }
if(player.get('e').contains(card)){ if(player.getCards('e').contains(card)){
var evalue=ai.get.equipValue(card); var evalue=ai.get.equipValue(card);
if(player.hasSkillTag('noe')){ if(player.hasSkillTag('noe')){
if(evalue>=7){ if(evalue>=7){
@ -40668,7 +40668,7 @@
return evalue/3; return evalue/3;
} }
if(player.hasSkillTag('noh')) return 0.1; if(player.hasSkillTag('noh')) return 0.1;
var nh=player.num('h'); var nh=player.countCards('h');
switch(nh){ switch(nh){
case 1:return 2; case 1:return 2;
case 2:return 1.6; case 2:return 1.6;

View File

@ -250,7 +250,7 @@ mode.boss={
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i].side==game.me.side&&players[i]!=game.me){ if(players[i].side==game.me.side&&players[i]!=game.me){
uiintro.add(get.translation(players[i])); uiintro.add(get.translation(players[i]));
var cards=players[i].get('h'); var cards=players[i].getCards('h');
if(cards.length){ if(cards.length){
uiintro.addSmall(cards,true); uiintro.addSmall(cards,true);
} }
@ -507,7 +507,7 @@ mode.boss={
player.hp++; player.hp++;
game.log(player,'回复了一点体力'); game.log(player,'回复了一点体力');
} }
else if(player.num('h')<4){ else if(player.countCards('h')<4){
var card=get.cards()[0]; var card=get.cards()[0];
var sort=lib.config.sort_card(card); var sort=lib.config.sort_card(card);
var position=sort>0?player.node.handcards1:player.node.handcards2; var position=sort>0?player.node.handcards1:player.node.handcards2;
@ -1085,14 +1085,14 @@ mode.boss={
content:function(){ content:function(){
'step 0' 'step 0'
var target=trigger.source; var target=trigger.source;
if(target.num('h')==0){ if(target.countCards('h')==0){
target.damage(2); target.damage(2);
event.finish(); event.finish();
} }
else{ else{
target.chooseControl('discard_card','get_damage',function(){ target.chooseControl('discard_card','get_damage',function(){
if(ai.get.damageEffect(target,player,target)>=0) return 'get_damage'; if(ai.get.damageEffect(target,player,target)>=0) return 'get_damage';
var nh=target.num('h'); var nh=target.countCards('h');
if(nh<=3||target.hp<=3||target.hasSkillTag('noh')) return 'discard_card'; if(nh<=3||target.hp<=3||target.hasSkillTag('noh')) return 'discard_card';
return 'get_damage'; return 'get_damage';
}) })
@ -1100,7 +1100,7 @@ mode.boss={
'step 1' 'step 1'
var target=trigger.source; var target=trigger.source;
if(result.control=='discard_card'){ if(result.control=='discard_card'){
target.discard(target.get('h')); target.discard(target.getCards('h'));
} }
else{ else{
target.damage(2); target.damage(2);
@ -1141,7 +1141,7 @@ mode.boss={
}, },
skipDamage:{ skipDamage:{
x7:function(player){ x7:function(player){
return player.num('h')==0; return player.countCards('h')==0;
}, },
x6:function(player,event){ x6:function(player,event){
return event.nature=='fire'; return event.nature=='fire';
@ -1154,11 +1154,11 @@ mode.boss={
}, },
x3:function(player,event){ x3:function(player,event){
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return current!=player&&current.num('e')>=4; return current!=player&&current.countCards('e')>=4;
}); });
}, },
x2:function(player){ x2:function(player){
return player.num('j')>=2; return player.countCards('j')>=2;
}, },
x1:function(){ x1:function(){
return game.players.length==2; return game.players.length==2;
@ -1270,7 +1270,7 @@ mode.boss={
default:return 0; default:return 0;
} }
} }
if(rand4&&player.num('h')<=1){ if(rand4&&player.countCards('h')<=1){
switch(name){ switch(name){
case 'zengbin':return 1; case 'zengbin':return 1;
case 'wuzhong':return 0.8; case 'wuzhong':return 0.8;
@ -1420,7 +1420,7 @@ mode.boss={
trigger:{global:'judge'}, trigger:{global:'judge'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return player.num('he')>0; return player.countCards('he')>0;
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -1470,13 +1470,13 @@ mode.boss={
usable:1, usable:1,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(player==target) return false; if(player==target) return false;
return target.num('h')>0; return target.countCards('h')>0;
}, },
selectTarget:2, selectTarget:2,
multitarget:true, multitarget:true,
multiline:true, multiline:true,
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0; return player.countCards('h')>0;
}, },
prepare:'throw', prepare:'throw',
discard:false, discard:false,
@ -1486,7 +1486,7 @@ mode.boss={
}, },
content:function(){ content:function(){
"step 0" "step 0"
if(targets[0].num('h')&&targets[1].num('h')){ if(targets[0].countCards('h')&&targets[1].countCards('h')){
targets[0].chooseToCompare(targets[1]); targets[0].chooseToCompare(targets[1]);
} }
else{ else{
@ -1587,7 +1587,7 @@ mode.boss={
target:function(card,player,target){ target:function(card,player,target){
if(get.tag(card,'respondShan')){ if(get.tag(card,'respondShan')){
var shans=target.num('h','shan'); var shans=target.num('h','shan');
var hs=target.num('h'); var hs=target.countCards('h');
if(shans>1) return [1,1]; if(shans>1) return [1,1];
if(shans&&hs>2) return [1,1]; if(shans&&hs>2) return [1,1];
if(shans) return [1,0.5]; if(shans) return [1,0.5];
@ -1637,7 +1637,7 @@ mode.boss={
target:function(card,player,target){ target:function(card,player,target){
if(get.tag(card,'respondShan')){ if(get.tag(card,'respondShan')){
var shans=target.num('h','shan'); var shans=target.num('h','shan');
var hs=target.num('h'); var hs=target.countCards('h');
if(shans>1) return [0,1]; if(shans>1) return [0,1];
if(shans&&hs>2) return [0,1]; if(shans&&hs>2) return [0,1];
if(shans) return [0,0]; if(shans) return [0,0];
@ -1684,7 +1684,7 @@ mode.boss={
trigger:{global:'phaseBegin'}, trigger:{global:'phaseBegin'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
return event.player!=player&&event.player.num('he')>1; return event.player!=player&&event.player.countCards('he')>1;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -1696,7 +1696,7 @@ mode.boss={
return get.position(ui.selected.cards[0])=='e'; return get.position(ui.selected.cards[0])=='e';
} }
else{ else{
return trigger.player.num('h')>1; return trigger.player.countCards('h')>1;
} }
break; break;
} }
@ -1705,17 +1705,17 @@ mode.boss={
return get.position(ui.selected.cards[0])=='h'; return get.position(ui.selected.cards[0])=='h';
} }
else{ else{
return trigger.player.num('e')>1; return trigger.player.countCards('e')>1;
} }
break; break;
} }
} }
}); });
var num=0; var num=0;
if(trigger.player.num('h')>1){ if(trigger.player.countCards('h')>1){
num++; num++;
} }
if(trigger.player.num('e')>1){ if(trigger.player.countCards('e')>1){
num++; num++;
} }
next.selectCard=[num,num]; next.selectCard=[num,num];
@ -1725,8 +1725,8 @@ mode.boss={
'step 1' 'step 1'
if(result.bool){ if(result.bool){
var he=[]; var he=[];
var hs=trigger.player.get('h'); var hs=trigger.player.getCards('h');
var es=trigger.player.get('e'); var es=trigger.player.getCards('e');
if(hs.length>1){ if(hs.length>1){
he=he.concat(hs); he=he.concat(hs);
} }
@ -2282,15 +2282,15 @@ mode.boss={
trigger:{player:'phaseJudgeBegin'}, trigger:{player:'phaseJudgeBegin'},
forced:true, forced:true,
content:function(){ content:function(){
player.discard(player.get('j').randomGet()); player.discard(player.getCards('j').randomGet());
}, },
filter:function(event ,player){ filter:function(event ,player){
return player.num('j')>0; return player.countCards('j')>0;
}, },
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target,current){ target:function(card,player,target,current){
if(get.type(card)=='delay'&&target.num('j')==0) return 0.1; if(get.type(card)=='delay'&&target.countCards('j')==0) return 0.1;
} }
} }
} }
@ -2359,7 +2359,7 @@ mode.boss={
return event.source!=undefined; return event.source!=undefined;
}, },
content:function(){ content:function(){
trigger.source.discard(trigger.source.get('h')); trigger.source.discard(trigger.source.getCards('h'));
}, },
ai:{ ai:{
threaten:0.7 threaten:0.7
@ -2372,7 +2372,7 @@ mode.boss={
logv:false, logv:false,
content:function(){ content:function(){
var targets=game.filterPlayer(function(current){ var targets=game.filterPlayer(function(current){
return current.num('e'); return current.countCards('e');
}); });
player.line(targets,'green'); player.line(targets,'green');
game.delay(); game.delay();
@ -2384,10 +2384,10 @@ mode.boss={
forced:true, forced:true,
globalFixed:true, globalFixed:true,
filter:function(event,player){ filter:function(event,player){
return player.num('e')>0&&event.player.hasSkill('boss_shanbeng')&&event.player.isDead(); return player.countCards('e')>0&&event.player.hasSkill('boss_shanbeng')&&event.player.isDead();
}, },
content:function(){ content:function(){
player.discard(player.get('e')); player.discard(player.getCards('e'));
} }
}, },
boss_didong:{ boss_didong:{
@ -2478,10 +2478,10 @@ mode.boss={
trigger:{player:'loseEnd'}, trigger:{player:'loseEnd'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
return player.num('h')<4; return player.countCards('h')<4;
}, },
content:function(){ content:function(){
player.draw(4-player.num('h')); player.draw(4-player.countCards('h'));
} }
}, },
boss_leiji:{ boss_leiji:{
@ -2530,23 +2530,23 @@ mode.boss={
var be=target.num('e',{color:'black'}); var be=target.num('e',{color:'black'});
if(target.num('h','shan')&&be){ if(target.num('h','shan')&&be){
if(!target.hasSkill('guidao')) return 0; if(!target.hasSkill('guidao')) return 0;
return [0,hastarget?target.num('he')/2:0]; return [0,hastarget?target.countCards('he')/2:0];
} }
if(target.num('h','shan')&&target.num('h')>2){ if(target.num('h','shan')&&target.countCards('h')>2){
if(!target.hasSkill('guidao')) return 0; if(!target.hasSkill('guidao')) return 0;
return [0,hastarget?target.num('h')/4:0]; return [0,hastarget?target.countCards('h')/4:0];
} }
if(target.num('h')>3||(be&&target.num('h')>=2)){ if(target.countCards('h')>3||(be&&target.countCards('h')>=2)){
return [0,0]; return [0,0];
} }
if(target.num('h')==0){ if(target.countCards('h')==0){
return [1.5,0]; return [1.5,0];
} }
if(target.num('h')==1&&!be){ if(target.countCards('h')==1&&!be){
return [1.2,0]; return [1.2,0];
} }
if(!target.hasSkill('guidao')) return [1,0.05]; if(!target.hasSkill('guidao')) return [1,0.05];
return [1,Math.min(0.5,(target.num('h')+be)/4)]; return [1,Math.min(0.5,(target.countCards('h')+be)/4)];
} }
} }
} }
@ -2556,7 +2556,7 @@ mode.boss={
audio:2, audio:2,
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
filter:function(event,player){ filter:function(event,player){
return player.num('h')==0; return player.countCards('h')==0;
}, },
content:function(){ content:function(){
player.draw(3) player.draw(3)
@ -2573,7 +2573,7 @@ mode.boss={
unique:true, unique:true,
filter:function(event,player){ filter:function(event,player){
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return current!=player&&current.num('h'); return current!=player&&current.countCards('h');
}); });
}, },
content:function(){ content:function(){
@ -2585,7 +2585,7 @@ mode.boss={
"step 1" "step 1"
if(event.players.length){ if(event.players.length){
var current=event.players.shift(); var current=event.players.shift();
var hs=current.get('h') var hs=current.getCards('h')
if(hs.length){ if(hs.length){
var card=hs.randomGet(); var card=hs.randomGet();
player.gain(card,current); player.gain(card,current);
@ -2600,7 +2600,7 @@ mode.boss={
trigger:{player:'loseEnd'}, trigger:{player:'loseEnd'},
frequent:true, frequent:true,
filter:function(event,player){ filter:function(event,player){
if(player.num('h')) return false; if(player.countCards('h')) return false;
for(var i=0;i<event.cards.length;i++){ for(var i=0;i<event.cards.length;i++){
if(event.cards[i].original=='h') return true; if(event.cards[i].original=='h') return true;
} }
@ -2614,7 +2614,7 @@ mode.boss={
"step 1" "step 1"
if(event.players.length){ if(event.players.length){
var current=event.players.shift(); var current=event.players.shift();
var hs=current.get('h'); var hs=current.getCards('h');
if(hs.length){ if(hs.length){
current.lose(hs)._triggered=null; current.lose(hs)._triggered=null;
current.$throw(hs); current.$throw(hs);
@ -2707,7 +2707,7 @@ mode.boss={
if(player.num('h','shan')) return 1; if(player.num('h','shan')) return 1;
var num=0,players=game.filterPlayer(); var num=0,players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i].canUse('sha',player)&&players[i].num('h')>1){ if(players[i].canUse('sha',player)&&players[i].countCards('h')>1){
num--; num--;
} }
else{ else{
@ -2825,7 +2825,7 @@ mode.boss={
unique:true, unique:true,
filter:function(event,player){ filter:function(event,player){
if(player.hp==player.maxHp) return false; if(player.hp==player.maxHp) return false;
if(!player.num('he')) return false; if(!player.countCards('he')) return false;
return true; return true;
}, },
content:function(){ content:function(){
@ -3188,10 +3188,10 @@ mode.boss={
unique:true, unique:true,
audio:2, audio:2,
filter:function(event,player){ filter:function(event,player){
return player.num('h')<4; return player.countCards('h')<4;
}, },
content:function(){ content:function(){
player.draw(4-player.num('h')); player.draw(4-player.countCards('h'));
}, },
group:'shangshix2', group:'shangshix2',
ai:{ ai:{
@ -3199,7 +3199,7 @@ mode.boss={
target:function(card,player,target){ target:function(card,player,target){
if(card.name=='shunshou') return; if(card.name=='shunshou') return;
if(card.name=='guohe'){ if(card.name=='guohe'){
if(!target.num('e')) return [0,1]; if(!target.countCards('e')) return [0,1];
} }
else if(get.tag(card,'loseCard')){ else if(get.tag(card,'loseCard')){
return [0,1]; return [0,1];
@ -3214,7 +3214,7 @@ mode.boss={
trigger:{player:'phaseBegin'}, trigger:{player:'phaseBegin'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return player.num('j')>0; return player.countCards('j')>0;
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -3369,7 +3369,7 @@ mode.boss={
ui.clear(); ui.clear();
if(player.isLinked()) player.link(); if(player.isLinked()) player.link();
if(player.isTurnedOver()) player.turnOver(); if(player.isTurnedOver()) player.turnOver();
player.discard(player.get('ej')); player.discard(player.getCards('ej'));
'step 3' 'step 3'
while(_status.event.name!='phaseLoop'){ while(_status.event.name!='phaseLoop'){
_status.event=_status.event.parent; _status.event=_status.event.parent;
@ -3462,7 +3462,7 @@ mode.boss={
group:'shenqu2', group:'shenqu2',
trigger:{global:'phaseBegin'}, trigger:{global:'phaseBegin'},
filter:function(event,player){ filter:function(event,player){
return player.num('h')<=player.maxHp; return player.countCards('h')<=player.maxHp;
}, },
frequent:true, frequent:true,
content:function(){ content:function(){
@ -3482,7 +3482,7 @@ mode.boss={
jiwu:{ jiwu:{
enable:'phaseUse', enable:'phaseUse',
filter:function(event,player){ filter:function(event,player){
if(player.num('h')==0) return false; if(player.countCards('h')==0) return false;
if(!player.hasSkill('qiangxi')) return true; if(!player.hasSkill('qiangxi')) return true;
if(!player.hasSkill('lieren')) return true; if(!player.hasSkill('lieren')) return true;
if(!player.hasSkill('xuanfeng')) return true; if(!player.hasSkill('xuanfeng')) return true;

View File

@ -333,7 +333,7 @@ mode.chess={
if(game.players[i].side==game.me.side&&game.players[i]!=game.me){ if(game.players[i].side==game.me.side&&game.players[i]!=game.me){
added=true; added=true;
uiintro.add(get.translation(game.players[i])); uiintro.add(get.translation(game.players[i]));
var cards=game.players[i].get('h'); var cards=game.players[i].getCards('h');
if(cards.length){ if(cards.length){
uiintro.addSmall(cards,true); uiintro.addSmall(cards,true);
} }
@ -909,7 +909,7 @@ mode.chess={
else{ else{
switch(get.config('punish')){ switch(get.config('punish')){
case '弃牌': case '弃牌':
var he=source.get('he'); var he=source.getCards('he');
if(he.length){ if(he.length){
source.discard(he); source.discard(he);
} }
@ -1726,13 +1726,13 @@ mode.chess={
next.includeOut=true; next.includeOut=true;
next.ai=function(target2){ next.ai=function(target2){
var num=0; var num=0;
if(target2.num('j')){ if(target2.countCards('j')){
num-=5; num-=5;
} }
if(target2!=game.friendZhu&&target2!=game.enemyZhu){ if(target2!=game.friendZhu&&target2!=game.enemyZhu){
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i]!=game.friendZhu&&game.players[i]!=game.enemyZhu&& if(game.players[i]!=game.friendZhu&&game.players[i]!=game.enemyZhu&&
game.players[i]!=target2&&game.players[i].side==target2.side&&game.players[i].num('j')){ game.players[i]!=target2&&game.players[i].side==target2.side&&game.players[i].countCards('j')){
num-=2; num-=2;
} }
} }
@ -1741,7 +1741,7 @@ mode.chess={
num+=1/(target2.hp+1); num+=1/(target2.hp+1);
} }
else if(rand<2/3){ else if(rand<2/3){
num+=target2.num('h')/5; num+=target2.countCards('h')/5;
} }
return num; return num;
} }
@ -1792,7 +1792,7 @@ mode.chess={
return target.side==next.side; return target.side==next.side;
},[1,num2-num1]); },[1,num2-num1]);
nevt.ai=function(target){ nevt.ai=function(target){
return Math.max(1,10-target.num('h')); return Math.max(1,10-target.countCards('h'));
}; };
nevt.includeOut=true; nevt.includeOut=true;
nevt.chessForceAll=true; nevt.chessForceAll=true;
@ -1830,7 +1830,7 @@ mode.chess={
nevt.chessForceAll=true; nevt.chessForceAll=true;
nevt.includeOut=true; nevt.includeOut=true;
nevt.ai=function(target){ nevt.ai=function(target){
var nj=target.num('j'); var nj=target.countCards('j');
if(nj){ if(nj){
return -nj; return -nj;
} }
@ -3982,7 +3982,7 @@ mode.chess={
'step 1' 'step 1'
game.log('集气石发动'); game.log('集气石发动');
player.recover('nosource'); player.recover('nosource');
var he=player.get('he'); var he=player.getCards('he');
if(he.length){ if(he.length){
player.discard(he.randomGets(2)); player.discard(he.randomGets(2));
} }
@ -4046,12 +4046,12 @@ mode.chess={
forced:true, forced:true,
popup:false, popup:false,
filter:function(event,player){ filter:function(event,player){
var nh=player.num('h'); var nh=player.countCards('h');
if(!nh) return false; if(!nh) return false;
for(var i=0;i<game.treasures.length;i++){ for(var i=0;i<game.treasures.length;i++){
if(game.treasures[i].name=='treasure_shenpanxianjing'){ if(game.treasures[i].name=='treasure_shenpanxianjing'){
for(var j=0;j<game.players.length;j++){ for(var j=0;j<game.players.length;j++){
if(game.players[j].num('h')>nh) return false; if(game.players[j].countCards('h')>nh) return false;
} }
return true; return true;
} }
@ -4082,7 +4082,7 @@ mode.chess={
} }
'step 1' 'step 1'
game.log('审判之刃发动'); game.log('审判之刃发动');
var hs=player.get('h'); var hs=player.getCards('h');
if(hs.length){ if(hs.length){
player.discard(hs.randomGet()); player.discard(hs.randomGet());
} }
@ -4256,7 +4256,7 @@ mode.chess={
case 2:chance=0.4;break; case 2:chance=0.4;break;
default:chance=0.2;break; default:chance=0.2;break;
} }
switch(target.num('he')){ switch(target.countCards('he')){
case 0:break; case 0:break;
case 1:chance/=1.2;break; case 1:chance/=1.2;break;
case 2:chance/=1.4;break; case 2:chance/=1.4;break;
@ -4575,7 +4575,7 @@ mode.chess={
filter:function(event,player){ filter:function(event,player){
if(player.isTurnedOver()) return false; if(player.isTurnedOver()) return false;
var suits=[]; var suits=[];
var hs=player.get('h'); var hs=player.getCards('h');
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
suits.add(get.suit(hs[i])); suits.add(get.suit(hs[i]));
if(suits.length>=4) return true; if(suits.length>=4) return true;
@ -4617,7 +4617,7 @@ mode.chess={
} }
} }
if(num<=1) return; if(num<=1) return;
if(_status.currentPhase==player&&player.num('h')<player.hp&&player.hp>=6){ if(_status.currentPhase==player&&player.countCards('h')<player.hp&&player.hp>=6){
if(typeof card=='string') return; if(typeof card=='string') return;
if(card.name=='wuzhong') return; if(card.name=='wuzhong') return;
if(card.name=='shunshou') return; if(card.name=='shunshou') return;
@ -4676,7 +4676,7 @@ mode.chess={
unique:true, unique:true,
filter:function(event,player){ filter:function(event,player){
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i]!=player&&game.players[i].num('h')) return true; if(game.players[i]!=player&&game.players[i].countCards('h')) return true;
} }
return false; return false;
}, },
@ -4689,7 +4689,7 @@ mode.chess={
"step 1" "step 1"
if(event.players.length){ if(event.players.length){
var current=event.players.shift(); var current=event.players.shift();
var hs=current.get('h') var hs=current.getCards('h')
if(hs.length){ if(hs.length){
var card=hs.randomGet(); var card=hs.randomGet();
player.gain(card,current); player.gain(card,current);
@ -4791,7 +4791,7 @@ mode.chess={
effect:{ effect:{
player:function(card,player){ player:function(card,player){
if(_status.currentPhase!=player) return; if(_status.currentPhase!=player) return;
if(card.name=='sha'&&player.num('h','sha')<2&&player.num('h')<=player.hp){ if(card.name=='sha'&&player.num('h','sha')<2&&player.countCards('h')<=player.hp){
var num=0; var num=0;
var player=_status.event.player; var player=_status.event.player;
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
@ -5018,7 +5018,7 @@ mode.chess={
if(get.mode()=='tafang'&&_status.enemies.contains(player)){ if(get.mode()=='tafang'&&_status.enemies.contains(player)){
return 1; return 1;
} }
var nh=player.num('h'); var nh=player.countCards('h');
if(!player.num('h','sha')&& if(!player.num('h','sha')&&
!player.num('h','shunshou')&& !player.num('h','shunshou')&&
!player.num('h','bingliang')){ !player.num('h','bingliang')){
@ -5159,7 +5159,7 @@ mode.chess={
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i]!=player&&game.players[i].num('h')&& if(game.players[i]!=player&&game.players[i].countCards('h')&&
get.distance(player,game.players[i])<=5){ get.distance(player,game.players[i])<=5){
return true; return true;
} }
@ -5170,7 +5170,7 @@ mode.chess={
"step 0" "step 0"
var players=[]; var players=[];
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i]!=player&&game.players[i].num('h')&& if(game.players[i]!=player&&game.players[i].countCards('h')&&
get.distance(player,game.players[i])<=5){ get.distance(player,game.players[i])<=5){
players.push(game.players[i]); players.push(game.players[i]);
} }

View File

@ -777,7 +777,7 @@ mode.guozhan={
'step 0' 'step 0'
player.awakenSkill('jizhao'); player.awakenSkill('jizhao');
player.storage.jizhao=true; player.storage.jizhao=true;
var num=player.maxHp-player.num('h'); var num=player.maxHp-player.countCards('h');
if(num>0){ if(num>0){
player.draw(num); player.draw(num);
} }
@ -808,7 +808,7 @@ mode.guozhan={
gzshoucheng:{ gzshoucheng:{
inherit:'shoucheng', inherit:'shoucheng',
filter:function(event,player){ filter:function(event,player){
if(event.player.num('h')) return false; if(event.player.countCards('h')) return false;
if(!event.player.isFriendOf(player)) return false; if(!event.player.isFriendOf(player)) return false;
if(_status.currentPhase==event.player) return false; if(_status.currentPhase==event.player) return false;
for(var i=0;i<event.cards.length;i++){ for(var i=0;i<event.cards.length;i++){
@ -911,7 +911,7 @@ mode.guozhan={
game.delay(2); game.delay(2);
player.chooseTarget(true,'弃置一名角色的一张牌',function(card,player,target){ player.chooseTarget(true,'弃置一名角色的一张牌',function(card,player,target){
var source=_status.event.source; var source=_status.event.source;
return get.distance(source,target)<=1&&source!=target&&target.num('he'); return get.distance(source,target)<=1&&source!=target&&target.countCards('he');
}).set('ai',function(target){ }).set('ai',function(target){
return -ai.get.attitude(_status.event.player,target); return -ai.get.attitude(_status.event.player,target);
}).set('source',target); }).set('source',target);
@ -966,16 +966,16 @@ mode.guozhan={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0; return player.countCards('h')>0;
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return player!=target&&(target.num('h')||target.isUnseen(2)); return player!=target&&(target.countCards('h')||target.isUnseen(2));
}, },
content:function(){ content:function(){
"step 0" "step 0"
target.viewCards(get.translation(player)+'的手牌',player.get('h')); target.viewCards(get.translation(player)+'的手牌',player.getCards('h'));
"step 1" "step 1"
if(!target.num('h')){ if(!target.countCards('h')){
event._result={index:1}; event._result={index:1};
} }
else if(!target.isUnseen(2)){ else if(!target.isUnseen(2)){
@ -1001,7 +1001,7 @@ mode.guozhan={
order:11, order:11,
result:{ result:{
target:function(player,target){ target:function(player,target){
return -target.num('h'); return -target.countCards('h');
} }
}, },
threaten:1.1 threaten:1.1
@ -1046,7 +1046,7 @@ mode.guozhan={
if(game.countPlayer()<4) return false; if(game.countPlayer()<4) return false;
return player.siege(event.target)&&game.hasPlayer(function(current){ return player.siege(event.target)&&game.hasPlayer(function(current){
return current.hasSkill('fengshi')&&current.siege(event.target); return current.hasSkill('fengshi')&&current.siege(event.target);
})&&event.target.num('e'); })&&event.target.countCards('e');
}, },
logTarget:'target', logTarget:'target',
content:function(){ content:function(){
@ -1389,7 +1389,7 @@ mode.guozhan={
return ai.get.effect(event.target,event.card,event.player,player)<0; return ai.get.effect(event.target,event.card,event.player,player)<0;
}, },
filter:function(event,player){ filter:function(event,player){
return player.num('h')==0&&(event.card.name=='sha'||event.card.name=='juedou'); return player.countCards('h')==0&&(event.card.name=='sha'||event.card.name=='juedou');
}, },
content:function(){ content:function(){
trigger.untrigger(); trigger.untrigger();
@ -1398,7 +1398,7 @@ mode.guozhan={
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target,current){ target:function(card,player,target,current){
if(target.num('h')==0&&(card.name=='sha'||card.name=='juedou')) return 'zeroplayertarget'; if(target.countCards('h')==0&&(card.name=='sha'||card.name=='juedou')) return 'zeroplayertarget';
}, },
} }
} }
@ -1425,7 +1425,7 @@ mode.guozhan={
if(ui.selected.cards.length&&ui.selected.cards[0].name=='du') return 0; if(ui.selected.cards.length&&ui.selected.cards[0].name=='du') return 0;
if(!ui.selected.cards.length&&card.name=='du') return 20; if(!ui.selected.cards.length&&card.name=='du') return 20;
var player=get.owner(card); var player=get.owner(card);
if(player.hp==player.maxHp||player.storage.gzrende<0||player.num('h')+player.storage.gzrende<=2){ if(player.hp==player.maxHp||player.storage.gzrende<0||player.countCards('h')+player.storage.gzrende<=2){
if(ui.selected.cards.length){ if(ui.selected.cards.length){
return -1; return -1;
} }
@ -1439,8 +1439,8 @@ mode.guozhan={
return 11-ai.get.value(card); return 11-ai.get.value(card);
} }
} }
if(player.num('h')>player.hp) return 10-ai.get.value(card); if(player.countCards('h')>player.hp) return 10-ai.get.value(card);
if(player.num('h')>2) return 6-ai.get.value(card); if(player.countCards('h')>2) return 6-ai.get.value(card);
return -1; return -1;
} }
return 10-ai.get.value(card); return 10-ai.get.value(card);
@ -1460,7 +1460,7 @@ mode.guozhan={
}, },
ai:{ ai:{
order:function(skill,player){ order:function(skill,player){
if(player.hp==player.maxHp||player.storage.gzrende<0||player.num('h')+player.storage.gzrende<=2){ if(player.hp==player.maxHp||player.storage.gzrende<0||player.countCards('h')+player.storage.gzrende<=2){
return 1; return 1;
} }
return 10; return 10;
@ -1471,9 +1471,9 @@ mode.guozhan={
return -10; return -10;
} }
if(target.num('j','lebu')) return 0; if(target.num('j','lebu')) return 0;
var nh=target.num('h'); var nh=target.countCards('h');
var np=player.num('h'); var np=player.countCards('h');
if(player.hp==player.maxHp||player.storage.gzrende<0||player.num('h')+player.storage.gzrende<=2){ if(player.hp==player.maxHp||player.storage.gzrende<0||player.countCards('h')+player.storage.gzrende<=2){
if(nh>=np-1&&np<=player.hp&&!target.get('s').contains('haoshi')) return 0; if(nh>=np-1&&np<=player.hp&&!target.get('s').contains('haoshi')) return 0;
} }
return Math.max(1,5-nh); return Math.max(1,5-nh);
@ -3092,7 +3092,7 @@ mode.guozhan={
if(source&&source.identity!='unknown'){ if(source&&source.identity!='unknown'){
if(this.identity=='ye') source.draw(1); if(this.identity=='ye') source.draw(1);
else if(this.identity!=source.identity) source.draw(get.population(this.identity)+1); else if(this.identity!=source.identity) source.draw(get.population(this.identity)+1);
else source.discard(source.get('he')); else source.discard(source.getCards('he'));
} }
game.tryResult(); game.tryResult();
}, },

View File

@ -1339,7 +1339,7 @@ mode.identity={
} }
if(this.identity=='fan'&&source) source.draw(3); if(this.identity=='fan'&&source) source.draw(3);
else if(this.identity=='zhong'&&source&&source.identity=='zhu'&&source.isZhu){ else if(this.identity=='zhong'&&source&&source.identity=='zhu'&&source.isZhu){
source.discard(source.get('he')); source.discard(source.getCards('he'));
} }
if(game.zhu&&game.zhu.storage.enhance_zhu&&get.population('fan')<3){ if(game.zhu&&game.zhu.storage.enhance_zhu&&get.population('fan')<3){
game.zhu.removeSkill(game.zhu.storage.enhance_zhu); game.zhu.removeSkill(game.zhu.storage.enhance_zhu);
@ -1608,7 +1608,7 @@ mode.identity={
} }
} }
if(fan){ if(fan){
if(to.hp>1&&to.hp>fan.hp&&to.num('he')>fan.num('he')){ if(to.hp>1&&to.hp>fan.hp&&to.countCards('he')>fan.countCards('he')){
return -3; return -3;
} }
} }
@ -1625,7 +1625,7 @@ mode.identity={
} }
} }
if(nei){ if(nei){
if(nei.hp>1&&nei.hp>to.hp&&nei.num('he')>to.num('he')){ if(nei.hp>1&&nei.hp>to.hp&&nei.countCards('he')>to.countCards('he')){
return 0; return 0;
} }
} }
@ -1666,7 +1666,7 @@ mode.identity={
} }
} }
if(fan){ if(fan){
if(to.hp>1&&to.hp>fan.hp&&to.num('he')>fan.num('he')){ if(to.hp>1&&to.hp>fan.hp&&to.countCards('he')>fan.countCards('he')){
return -3; return -3;
} }
} }
@ -1762,7 +1762,7 @@ mode.identity={
else if(php>6){ else if(php>6){
php=6; php=6;
} }
j=player.get('h').length+player.get('e').length*1.5+php*2; j=player.countCards('h')+player.countCards('e')*1.5+php*2;
if(player.identity=='zhu'){ if(player.identity=='zhu'){
zhuzhong+=j*1.2+5; zhuzhong+=j*1.2+5;
total+=j*1.2+5; total+=j*1.2+5;

View File

@ -531,7 +531,7 @@ mode.stone={
game.me.chooseBool('是否置换手牌?'); game.me.chooseBool('是否置换手牌?');
"step 4" "step 4"
if(result.bool){ if(result.bool){
var hs=game.me.get('h'); var hs=game.me.getCards('h');
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
ui.discardPile.appendChild(hs[i]); ui.discardPile.appendChild(hs[i]);
} }
@ -1846,7 +1846,7 @@ mode.stone={
fellows.randomGet().die(); fellows.randomGet().die();
} }
'step 2' 'step 2'
var hs=player.get('h'); var hs=player.getCards('h');
if(hs.length){ if(hs.length){
player.discard(hs.randomGets(2)); player.discard(hs.randomGets(2));
} }
@ -1884,7 +1884,7 @@ mode.stone={
useful:5, useful:5,
result:{ result:{
target:function(player,target){ target:function(player,target){
return -target.hp-target.num('h')/2; return -target.hp-target.countCards('h')/2;
} }
} }
} }
@ -1907,7 +1907,7 @@ mode.stone={
useful:5, useful:5,
result:{ result:{
target:function(player,target){ target:function(player,target){
return -target.hp-target.num('h')/2; return -target.hp-target.countCards('h')/2;
} }
} }
} }
@ -2237,10 +2237,10 @@ mode.stone={
enable:true, enable:true,
fullimage:true, fullimage:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.isMin()&&target.num('h')>0; return target.isMin()&&target.countCards('h')>0;
}, },
content:function(){ content:function(){
target.draw(target.num('h')); target.draw(target.countCards('h'));
}, },
ai:{ ai:{
order:4, order:4,
@ -2248,7 +2248,7 @@ mode.stone={
useful:2, useful:2,
result:{ result:{
target:function(player,target){ target:function(player,target){
return Math.max(0,target.num('h')-1); return Math.max(0,target.countCards('h')-1);
} }
} }
} }
@ -2619,7 +2619,7 @@ mode.stone={
target.damage(); target.damage();
'step 1' 'step 1'
if(target.isAlive()){ if(target.isAlive()){
var hs=target.get('h'); var hs=target.getCards('h');
if(hs.length){ if(hs.length){
target.discard(hs.randomGets(2)); target.discard(hs.randomGets(2));
} }
@ -2631,7 +2631,7 @@ mode.stone={
useful:5, useful:5,
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.num('h')) return -2; if(target.countCards('h')) return -2;
return -1.5; return -1.5;
} }
}, },
@ -2742,7 +2742,7 @@ mode.stone={
order:5, order:5,
result:{ result:{
target:function(player,target){ target:function(player,target){
return Math.max(1,target.hp-target.num('h')); return Math.max(1,target.hp-target.countCards('h'));
}, },
} }
} }
@ -2767,7 +2767,7 @@ mode.stone={
} }
else{ else{
player.chooseControl('获得行动值','摸牌').ai=function(){ player.chooseControl('获得行动值','摸牌').ai=function(){
if(player.num('h')<=1) return '摸牌'; if(player.countCards('h')<=1) return '摸牌';
return '获得行动值'; return '获得行动值';
}; };
} }
@ -2902,7 +2902,7 @@ mode.stone={
useful:5, useful:5,
result:{ result:{
target:function(player,target){ target:function(player,target){
return -target.hp-target.num('h')/2; return -target.hp-target.countCards('h')/2;
} }
} }
} }
@ -2930,7 +2930,7 @@ mode.stone={
useful:5, useful:5,
result:{ result:{
target:function(player,target){ target:function(player,target){
return -target.hp-target.num('h')/2; return -target.hp-target.countCards('h')/2;
} }
} }
} }
@ -3038,7 +3038,7 @@ mode.stone={
list.randomGet().die({source:player}); list.randomGet().die({source:player});
} }
'step 1' 'step 1'
var es=target.get('e'); var es=target.getCards('e');
if(es.length){ if(es.length){
target.discard(es.randomGet()); target.discard(es.randomGet());
} }
@ -3403,7 +3403,7 @@ mode.stone={
}); });
if(hs.length==0) return 0; if(hs.length==0) return 0;
var enemy=player.getEnemy(); var enemy=player.getEnemy();
if(enemy.num('h')<=1) return 1; if(enemy.countCards('h')<=1) return 1;
var num=0; var num=0;
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
num+=get.info(hs[i]).stoneact; num+=get.info(hs[i]).stoneact;
@ -3542,7 +3542,7 @@ mode.stone={
enable:true, enable:true,
fullimage:true, fullimage:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.isMin()&&target.num('h')>0; return target.isMin()&&target.countCards('h')>0;
}, },
selectTarget:-1, selectTarget:-1,
content:function(){ content:function(){
@ -3550,7 +3550,7 @@ mode.stone={
// if(player.hasFellowSkill('stone_shenyou')){ // if(player.hasFellowSkill('stone_shenyou')){
// num=2; // num=2;
// } // }
target.damage(target.num('h')*num); target.damage(target.countCards('h')*num);
}, },
ai:{ ai:{
order:7, order:7,
@ -3558,7 +3558,7 @@ mode.stone={
useful:5, useful:5,
result:{ result:{
target:function(player,target){ target:function(player,target){
return -Math.min(target.num('h'),target.hp); return -Math.min(target.countCards('h'),target.hp);
} }
}, },
tag:{ tag:{
@ -3591,7 +3591,7 @@ mode.stone={
useful:5, useful:5,
result:{ result:{
target:function(player,target){ target:function(player,target){
return -target.hp-target.num('h')/2; return -target.hp-target.countCards('h')/2;
} }
} }
} }
@ -3601,7 +3601,7 @@ mode.stone={
stoneact:0, stoneact:0,
career:'priest', career:'priest',
enable:function(event,player){ enable:function(event,player){
return player.getEnemy().num('h')>0; return player.getEnemy().countCards('h')>0;
}, },
fullimage:true, fullimage:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
@ -3609,7 +3609,7 @@ mode.stone={
}, },
selectTarget:-1, selectTarget:-1,
content:function(){ content:function(){
var card=target.get('h').randomGet(); var card=target.getCards('h').randomGet();
if(card){ if(card){
player.gain(game.createCard(card.name,card.suit,card.number,card.nature),'draw'); player.gain(game.createCard(card.name,card.suit,card.number,card.nature),'draw');
} }
@ -3777,7 +3777,7 @@ mode.stone={
useful:5, useful:5,
result:{ result:{
target:function(player,target){ target:function(player,target){
return -target.hp-target.num('h')/2; return -target.hp-target.countCards('h')/2;
} }
} }
} }
@ -3807,7 +3807,7 @@ mode.stone={
target:function(player,target){ target:function(player,target){
if(target.hp==1) return -1; if(target.hp==1) return -1;
if(target.hp>=4) return 1.5; if(target.hp>=4) return 1.5;
if(target.hp>=3&&target.num('h')<target.hp) return 1; if(target.hp>=3&&target.countCards('h')<target.hp) return 1;
return 0; return 0;
} }
} }
@ -4070,7 +4070,7 @@ mode.stone={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.hasSkill('warlock_yongsheng')) return 2; if(target.hasSkill('warlock_yongsheng')) return 2;
if(target.hp==1&&target.num('h')<=2) return 1; if(target.hp==1&&target.countCards('h')<=2) return 1;
return 0; return 0;
} }
}, },
@ -4458,7 +4458,7 @@ mode.stone={
filterTarget:true, filterTarget:true,
content:function(){ content:function(){
'step 0' 'step 0'
if(player.num('e')){ if(player.countCards('e')){
player.chooseToDiscard('e','是否弃置一张装备区内的牌令伤害+1').ai=function(card){ player.chooseToDiscard('e','是否弃置一张装备区内的牌令伤害+1').ai=function(card){
return 7-ai.get.value(card); return 7-ai.get.value(card);
} }
@ -4604,7 +4604,7 @@ mode.stone={
useful:5, useful:5,
result:{ result:{
target:function(player,target){ target:function(player,target){
return -target.hp-target.num('h')/2; return -target.hp-target.countCards('h')/2;
} }
}, },
} }
@ -5173,11 +5173,11 @@ mode.stone={
stoneact:2, stoneact:2,
fullimage:true, fullimage:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.isMin()&&(target.maxHp>1||target.num('he')>0); return target.isMin()&&(target.maxHp>1||target.countCards('he')>0);
}, },
content:function(){ content:function(){
"step 0" "step 0"
target.discard(target.get('he')); target.discard(target.getCards('he'));
"step 1" "step 1"
if(target.maxHp>2){ if(target.maxHp>2){
target.loseMaxHp(target.maxHp-2); target.loseMaxHp(target.maxHp-2);
@ -5186,7 +5186,7 @@ mode.stone={
ai:{ ai:{
result:{ result:{
target:function(player,target){ target:function(player,target){
return Math.min(0,2-target.hp)-target.num('h')/2; return Math.min(0,2-target.hp)-target.countCards('h')/2;
} }
}, },
order:7 order:7
@ -5439,7 +5439,7 @@ mode.stone={
content:function(){ content:function(){
"step 0" "step 0"
var targets=[player,target]; var targets=[player,target];
event.cards=[targets[0].get('e'),targets[1].get('e')]; event.cards=[targets[0].getCards('e'),targets[1].getCards('e')];
targets[0].lose(event.cards[0],ui.special); targets[0].lose(event.cards[0],ui.special);
targets[1].lose(event.cards[1],ui.special); targets[1].lose(event.cards[1],ui.special);
if(event.cards[0].length) targets[0].$give(event.cards[0],targets[1]); if(event.cards[0].length) targets[0].$give(event.cards[0],targets[1]);
@ -5453,7 +5453,7 @@ mode.stone={
targets[1].equip(event.cards[0][i]); targets[1].equip(event.cards[0][i]);
} }
"step 2" "step 2"
var dh=target.num('h')-player.num('h'); var dh=target.countCards('h')-player.countCards('h');
if(dh>0){ if(dh>0){
player.draw(dh); player.draw(dh);
} }
@ -5464,8 +5464,8 @@ mode.stone={
useful:1, useful:1,
result:{ result:{
target:function(player,target){ target:function(player,target){
var ne1=target.num('e'),ne2=player.num('e'); var ne1=target.countCards('e'),ne2=player.countCards('e');
var nh1=target.num('h'),nh2=player.num('h'); var nh1=target.countCards('h'),nh2=player.countCards('h');
if(nh1<nh2) nh1=nh2; if(nh1<nh2) nh1=nh2;
if(ne2-ne1<nh1-nh2+ne1-ne2) return -1; if(ne2-ne1<nh1-nh2+ne1-ne2) return -1;
return 0; return 0;
@ -5484,11 +5484,11 @@ mode.stone={
}, },
content:function(){ content:function(){
'step 0' 'step 0'
target.gain(target.get('e'),'gain2'); target.gain(target.getCards('e'),'gain2');
'step 1' 'step 1'
var dh=target.num('h')-player.num('h'); var dh=target.countCards('h')-player.countCards('h');
if(dh>0){ if(dh>0){
target.discard(target.get('h').randomGets(dh)); target.discard(target.getCards('h').randomGets(dh));
} }
}, },
ai:{ ai:{
@ -5497,7 +5497,7 @@ mode.stone={
useful:1, useful:1,
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.num('he')>=player.num('h')) return -1; if(target.countCards('he')>=player.countCards('h')) return -1;
return 0; return 0;
} }
} }
@ -5536,7 +5536,7 @@ mode.stone={
} }
"step 2" "step 2"
var target=player.getLeader(); var target=player.getLeader();
var hs=target.get('h'); var hs=target.getCards('h');
if(hs.length){ if(hs.length){
target.discard(hs); target.discard(hs);
} }
@ -5844,7 +5844,7 @@ mode.stone={
unique:true, unique:true,
content:function(){ content:function(){
var target=player.getLeader(); var target=player.getLeader();
var hs=target.get('h'); var hs=target.getCards('h');
if(hs.length){ if(hs.length){
target.discard(hs.randomGets(1)); target.discard(hs.randomGets(1));
} }
@ -5883,7 +5883,7 @@ mode.stone={
event.chooser.chooseTarget('吞噬:令一名友方随从死亡',function(card,playerx,target){ event.chooser.chooseTarget('吞噬:令一名友方随从死亡',function(card,playerx,target){
return player!=target&&target.isMin()&&target.side==player.side; return player!=target&&target.isMin()&&target.side==player.side;
},true).ai=function(target){ },true).ai=function(target){
return -target.hp-target.num('h')/4; return -target.hp-target.countCards('h')/4;
}; };
player.line(event.chooser); player.line(event.chooser);
"step 1" "step 1"
@ -5891,7 +5891,7 @@ mode.stone={
event.chooser.line(result.targets[0]); event.chooser.line(result.targets[0]);
game.delay(); game.delay();
var target=result.targets[0]; var target=result.targets[0];
var hs=target.get('h'); var hs=target.getCards('h');
if(hs.length){ if(hs.length){
player.gain(hs); player.gain(hs);
} }
@ -6272,7 +6272,7 @@ mode.stone={
unique:true, unique:true,
filter:function(event,player){ filter:function(event,player){
var target=player.getLeader(); var target=player.getLeader();
return target.num('e')>0; return target.countCards('e')>0;
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -6413,7 +6413,7 @@ mode.stone={
unique:true, unique:true,
filter:function(event,player){ filter:function(event,player){
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i].isMin()&&game.players[i]!=player&&game.players[i].num('h')>1){ if(game.players[i].isMin()&&game.players[i]!=player&&game.players[i].countCards('h')>1){
return true; return true;
} }
} }
@ -6423,7 +6423,7 @@ mode.stone={
"step 0" "step 0"
var list=[]; var list=[];
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i].isMin()&&game.players[i]!=player&&game.players[i].num('h')>1){ if(game.players[i].isMin()&&game.players[i]!=player&&game.players[i].countCards('h')>1){
list.push(game.players[i]); list.push(game.players[i]);
} }
} }
@ -6619,11 +6619,11 @@ mode.stone={
forced:true, forced:true,
unique:true, unique:true,
filter:function(event,player){ filter:function(event,player){
return player.getLeader().num('e')>0&&player.getEnemy().hasFellow(); return player.getLeader().countCards('e')>0&&player.getEnemy().hasFellow();
}, },
content:function(){ content:function(){
'step 0' 'step 0'
var num=player.getLeader().num('e'); var num=player.getLeader().countCards('e');
var map=[]; var map=[];
var targets=player.getEnemy().getFellow(); var targets=player.getEnemy().getFellow();
event.targets=targets; event.targets=targets;
@ -7357,7 +7357,7 @@ mode.stone={
unique:true, unique:true,
filter:function(event,player){ filter:function(event,player){
var target=player.getLeader(); var target=player.getLeader();
return target.num('e')>0; return target.countCards('e')>0;
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -7483,7 +7483,7 @@ mode.stone={
forced:true, forced:true,
unique:true, unique:true,
filter:function(event,player){ filter:function(event,player){
return event.source.side==player.side&&event.source!=player&&event.source.num('h')<=2; return event.source.side==player.side&&event.source!=player&&event.source.countCards('h')<=2;
}, },
content:function(){ content:function(){
trigger.source.classList.remove('turnedover'); trigger.source.classList.remove('turnedover');
@ -7576,7 +7576,7 @@ mode.stone={
unique:true, unique:true,
content:function(){ content:function(){
var target=player.getLeader(); var target=player.getLeader();
var hs=target.get('h'); var hs=target.getCards('h');
if(hs.length){ if(hs.length){
target.discard(hs.randomGets(2)); target.discard(hs.randomGets(2));
} }
@ -7673,7 +7673,7 @@ mode.stone={
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i].side!=player.side&& if(game.players[i].side!=player.side&&
game.players[i].isMin()&& game.players[i].isMin()&&
game.players[i].num('he')){ game.players[i].countCards('he')){
return true; return true;
} }
} }
@ -7683,16 +7683,16 @@ mode.stone={
"step 0" "step 0"
event.chooser=player.getLeader(); event.chooser=player.getLeader();
event.chooser.chooseTarget('持盾:弃置对方一名随从的所有牌',function(card,playerx,target){ event.chooser.chooseTarget('持盾:弃置对方一名随从的所有牌',function(card,playerx,target){
return player.side!=target.side&&target.isMin()&&target.num('he')>0; return player.side!=target.side&&target.isMin()&&target.countCards('he')>0;
}).ai=function(target){ }).ai=function(target){
return target.num('he'); return target.countCards('he');
}; };
player.line(event.chooser); player.line(event.chooser);
"step 1" "step 1"
if(result.bool){ if(result.bool){
event.chooser.line(result.targets[0]); event.chooser.line(result.targets[0]);
game.delay(); game.delay();
result.targets[0].discard(result.targets[0].get('he')); result.targets[0].discard(result.targets[0].getCards('he'));
} }
} }
}, },
@ -7999,7 +7999,7 @@ mode.stone={
event.target.damage(event.chooser); event.target.damage(event.chooser);
} }
else{ else{
event.target.discard(event.target.get('h')); event.target.discard(event.target.getCards('h'));
if(event.target.maxHp>2){ if(event.target.maxHp>2){
event.target.loseMaxHp(event.target.maxHp-2); event.target.loseMaxHp(event.target.maxHp-2);
} }
@ -8059,7 +8059,7 @@ mode.stone={
return event.player.hasSkill('druid_chengzhang'); return event.player.hasSkill('druid_chengzhang');
}, },
content:function(){ content:function(){
if(player.num('h')){ if(player.countCards('h')){
game.delay(); game.delay();
player.chooseToDiscard('h',true); player.chooseToDiscard('h',true);
} }
@ -8412,7 +8412,7 @@ mode.stone={
}, },
ai:{ ai:{
order:function(skill,player){ order:function(skill,player){
if(!player.get('e','1')&&player.num('e')<2){ if(!player.get('e','1')&&player.countCards('e')<2){
if(player.num('h','sha')&&player.getActCount()+3<=player.actcount){ if(player.num('h','sha')&&player.getActCount()+3<=player.actcount){
return 4; return 4;
} }
@ -8422,7 +8422,7 @@ mode.stone={
}, },
result:{ result:{
player:function(player){ player:function(player){
if(player.num('e')<=2) return 1; if(player.countCards('e')<=2) return 1;
return 0; return 0;
} }
} }
@ -8513,7 +8513,7 @@ mode.stone={
var players=get.players(); var players=get.players();
var targets=[]; var targets=[];
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i].side==player.side&&!players[i].career&&players[i].num('h')<=1){ if(players[i].side==player.side&&!players[i].career&&players[i].countCards('h')<=1){
targets.push(players[i]); targets.push(players[i]);
} }
} }
@ -8709,7 +8709,7 @@ mode.stone={
stone_fennuxiaoji1:{ stone_fennuxiaoji1:{
trigger:{player:'phaseBegin'}, trigger:{player:'phaseBegin'},
filter:function(event,player){ filter:function(event,player){
return player.num('h')==0; return player.countCards('h')==0;
}, },
content:function(){ content:function(){
player.draw(2); player.draw(2);
@ -8718,7 +8718,7 @@ mode.stone={
stone_fatiaozhuru1:{ stone_fatiaozhuru1:{
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
filter:function(event,player){ filter:function(event,player){
return player.num('h')==0; return player.countCards('h')==0;
}, },
content:function(){ content:function(){
player.draw(2); player.draw(2);
@ -8808,7 +8808,7 @@ mode.stone={
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i].side!=player.side&& if(game.players[i].side!=player.side&&
game.players[i].isMin()&& game.players[i].isMin()&&
game.players[i].num('he')){ game.players[i].countCards('he')){
return true; return true;
} }
} }
@ -8818,16 +8818,16 @@ mode.stone={
"step 0" "step 0"
event.chooser=player.getLeader(); event.chooser=player.getLeader();
event.chooser.chooseTarget('叫嚣:弃置对方一名随从的所有牌',function(card,playerx,target){ event.chooser.chooseTarget('叫嚣:弃置对方一名随从的所有牌',function(card,playerx,target){
return player.side!=target.side&&target.isMin()&&target.num('he')>0; return player.side!=target.side&&target.isMin()&&target.countCards('he')>0;
}).ai=function(target){ }).ai=function(target){
return target.num('he'); return target.countCards('he');
}; };
player.line(event.chooser); player.line(event.chooser);
"step 1" "step 1"
if(result.bool){ if(result.bool){
event.chooser.line(result.targets[0]); event.chooser.line(result.targets[0]);
game.delay(); game.delay();
result.targets[0].discard(result.targets[0].get('he')); result.targets[0].discard(result.targets[0].getCards('he'));
} }
} }
}, },
@ -8866,11 +8866,11 @@ mode.stone={
forced:true, forced:true,
unique:true, unique:true,
filter:function(event,player){ filter:function(event,player){
return player.getEnemy().num('e')>0; return player.getEnemy().countCards('e')>0;
}, },
content:function(){ content:function(){
var enemy=player.getEnemy(); var enemy=player.getEnemy();
var es=enemy.get('e'); var es=enemy.getCards('e');
if(es.length){ if(es.length){
player.getLeader().line(enemy); player.getLeader().line(enemy);
game.delay(); game.delay();
@ -8946,7 +8946,7 @@ mode.stone={
} }
targets.sort(lib.sort.seat); targets.sort(lib.sort.seat);
for(var i=0;i<targets.length;i++){ for(var i=0;i<targets.length;i++){
targets[i].discard(targets[i].get('he')); targets[i].discard(targets[i].getCards('he'));
} }
} }
}, },

View File

@ -224,7 +224,7 @@ mode.tafang={
if(game.players[i].side==game.me.side&&game.players[i]!=game.me){ if(game.players[i].side==game.me.side&&game.players[i]!=game.me){
added=true; added=true;
uiintro.add(get.translation(game.players[i])); uiintro.add(get.translation(game.players[i]));
var cards=game.players[i].get('h'); var cards=game.players[i].getCards('h');
if(cards.length){ if(cards.length){
uiintro.addSmall(cards,true); uiintro.addSmall(cards,true);
} }
@ -1122,7 +1122,7 @@ mode.tafang={
'step 1' 'step 1'
if(event.list.length){ if(event.list.length){
var target=event.list.shift(); var target=event.list.shift();
var he=target.get('he'); var he=target.getCards('he');
if(he.length){ if(he.length){
target.discard(he.randomGets(Math.ceil(Math.random()*2))); target.discard(he.randomGets(Math.ceil(Math.random()*2)));
} }
@ -1151,7 +1151,7 @@ mode.tafang={
var target=list.randomGet(); var target=list.randomGet();
player.line(target,'fire'); player.line(target,'fire');
target.damage('fire','nosource'); target.damage('fire','nosource');
var he=target.get('he'); var he=target.getCards('he');
if(he.length){ if(he.length){
target.discard(he.randomGet()); target.discard(he.randomGet());
} }

View File

@ -399,7 +399,7 @@ mode.versus={
} }
"step 4" "step 4"
if(event.replaceCard&&result.bool){ if(event.replaceCard&&result.bool){
var hs=game.me.get('h'); var hs=game.me.getCards('h');
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
ui.discardPile.appendChild(hs[i]); ui.discardPile.appendChild(hs[i]);
} }
@ -2352,13 +2352,13 @@ mode.versus={
next.includeOut=true; next.includeOut=true;
next.ai=function(target2){ next.ai=function(target2){
var num=0; var num=0;
if(target2.num('j')){ if(target2.countCards('j')){
num-=5; num-=5;
} }
if(target2.identity!='zhu'){ if(target2.identity!='zhu'){
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i].identity!='zhu'&&game.players[i]!=target2&& if(game.players[i].identity!='zhu'&&game.players[i]!=target2&&
game.players[i].side==target2.side&&game.players[i].num('j')){ game.players[i].side==target2.side&&game.players[i].countCards('j')){
num-=2; num-=2;
} }
} }
@ -2367,7 +2367,7 @@ mode.versus={
num+=1/(target2.hp+1); num+=1/(target2.hp+1);
} }
else if(rand<2/3){ else if(rand<2/3){
num+=target2.num('h')/5; num+=target2.countCards('h')/5;
} }
return num; return num;
} }
@ -2411,7 +2411,7 @@ mode.versus={
if(list.length==0) event.redo(); if(list.length==0) event.redo();
else if(list.length==1||(game.me!=game.friendZhu&&!lib.storage.single_control)||_status.currentSide!=game.me.side){ else if(list.length==1||(game.me!=game.friendZhu&&!lib.storage.single_control)||_status.currentSide!=game.me.side){
list.sort(function(a,b){ list.sort(function(a,b){
if(a.num('j')>b.num('j')) return 1; if(a.countCards('j')>b.countCards('j')) return 1;
return a.hp-b.hp; return a.hp-b.hp;
}) })
event.player=list[0]; event.player=list[0];
@ -2520,7 +2520,7 @@ mode.versus={
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i].side==game.me.side&&game.players[i]!=game.me){ if(game.players[i].side==game.me.side&&game.players[i]!=game.me){
uiintro.add(get.translation(game.players[i])); uiintro.add(get.translation(game.players[i]));
var cards=game.players[i].get('h'); var cards=game.players[i].getCards('h');
if(cards.length){ if(cards.length){
uiintro.addSmall(cards,true); uiintro.addSmall(cards,true);
} }
@ -3251,13 +3251,13 @@ mode.versus={
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return current.isEnemyOf(player)&&current.num('j'); return current.isEnemyOf(player)&&current.countCards('j');
}); });
}, },
content:function(){ content:function(){
"step 0" "step 0"
event.targets=game.filterPlayer(function(current){ event.targets=game.filterPlayer(function(current){
return current.isEnemyOf(player)&&current.num('j'); return current.isEnemyOf(player)&&current.countCards('j');
}); });
event.targets.sort(lib.sort.seat); event.targets.sort(lib.sort.seat);
player.line(event.targets,'thunder'); player.line(event.targets,'thunder');
@ -3451,7 +3451,7 @@ mode.versus={
var num=0,players=game.filterPlayer(); var num=0,players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i].isEnemyOf(player)){ if(players[i].isEnemyOf(player)){
var es=players[i].get('e'); var es=players[i].getCards('e');
for(var j=0;j<es.length;j++){ for(var j=0;j<es.length;j++){
switch(get.subtype(es[j])){ switch(get.subtype(es[j])){
case 'equip1':num+=1;break; case 'equip1':num+=1;break;
@ -3475,7 +3475,7 @@ mode.versus={
filter:function(event,player){ filter:function(event,player){
var players=game.filterPlayer(); var players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
if(players[i].isEnemyOf(player)&&players[i].num('e')){ if(players[i].isEnemyOf(player)&&players[i].countCards('e')){
return true; return true;
} }
} }
@ -3490,7 +3490,7 @@ mode.versus={
if(event.targets.length){ if(event.targets.length){
var current=event.targets.shift(); var current=event.targets.shift();
if(current.isEnemyOf(player)){ if(current.isEnemyOf(player)){
var es=current.get('e'); var es=current.getCards('e');
if(es.length){ if(es.length){
current.discard(es); current.discard(es);
player.line(current,'green'); player.line(current,'green');
@ -3514,7 +3514,7 @@ mode.versus={
return false; return false;
}, },
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0; return player.countCards('h')>0;
}, },
content:function(){ content:function(){
player.chooseToDiscard('h',true); player.chooseToDiscard('h',true);
@ -3524,16 +3524,16 @@ mode.versus={
trigger:{player:'phaseBegin'}, trigger:{player:'phaseBegin'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
var nh=player.num('h'); var nh=player.countCards('h');
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return current.isEnemyOf(player)&&current.num('h')>nh; return current.isEnemyOf(player)&&current.countCards('h')>nh;
}); });
}, },
content:function(){ content:function(){
'step 0' 'step 0'
var nh=player.num('h'); var nh=player.countCards('h');
var targets=game.filterPlayer(function(current){ var targets=game.filterPlayer(function(current){
return current.isEnemyOf(player)&&current.num('h')>nh; return current.isEnemyOf(player)&&current.countCards('h')>nh;
}); });
targets.sort(lib.sort.seat); targets.sort(lib.sort.seat);
event.targets=targets; event.targets=targets;
@ -3649,7 +3649,7 @@ mode.versus={
if(att>0&&target.num('j','lebu')){ if(att>0&&target.num('j','lebu')){
return 0.1; return 0.1;
} }
if(player.num('h')>player.hp){ if(player.countCards('h')>player.hp){
if(target==player) return Math.max(1,att-2); if(target==player) return Math.max(1,att-2);
} }
if(target==player) return att+5; if(target==player) return att+5;
@ -3873,7 +3873,7 @@ mode.versus={
if(ai.get.attitude(player,target)>-3) return 0; if(ai.get.attitude(player,target)>-3) return 0;
var eff=ai.get.damageEffect(target,player,player,'fire'); var eff=ai.get.damageEffect(target,player,player,'fire');
if(eff>0){ if(eff>0){
return eff+target.num('e')/2; return eff+target.countCards('e')/2;
} }
return 0; return 0;
} }
@ -3892,7 +3892,7 @@ mode.versus={
} }
"step 3" "step 3"
if(event.target){ if(event.target){
var es=event.target.get('e'); var es=event.target.getCards('e');
if(es.length){ if(es.length){
event.target.discard(es); event.target.discard(es);
} }
@ -4281,7 +4281,7 @@ mode.versus={
else if(source){ else if(source){
if(source.side==this.side){ if(source.side==this.side){
if(source.identity=='zhu'){ if(source.identity=='zhu'){
source.discard(source.get('he')); source.discard(source.getCards('he'));
} }
} }
else{ else{
@ -4308,7 +4308,7 @@ mode.versus={
else if(source){ else if(source){
if(source.side==this.side){ if(source.side==this.side){
if(source.identity=='zhu'){ if(source.identity=='zhu'){
source.discard(source.get('he')); source.discard(source.getCards('he'));
} }
} }
else{ else{
@ -4337,7 +4337,7 @@ mode.versus={
if(this.replacetwo){ if(this.replacetwo){
if(source){ if(source){
if(source.side==this.side){ if(source.side==this.side){
var he=source.get('he'); var he=source.getCards('he');
if(he.length){ if(he.length){
source.discard(he); source.discard(he);
} }
@ -4352,7 +4352,7 @@ mode.versus={
else if(friend&&friend.replacetwo){ else if(friend&&friend.replacetwo){
if(source){ if(source){
if(source.side==this.side){ if(source.side==this.side){
var he=source.get('he'); var he=source.getCards('he');
if(he.length){ if(he.length){
source.discard(he); source.discard(he);
} }
@ -4451,7 +4451,7 @@ mode.versus={
} }
else{ else{
if(lib.storage.versus_punish=='弃牌'){ if(lib.storage.versus_punish=='弃牌'){
source.discard(source.get('he')); source.discard(source.getCards('he'));
} }
else if(lib.storage.versus_punish=='摸牌'&&lib.storage.versus_reward){ else if(lib.storage.versus_punish=='摸牌'&&lib.storage.versus_reward){
source.draw(lib.storage.versus_reward); source.draw(lib.storage.versus_reward);