Fix recasting and gifting, and deprecate lib.card[card].chongzhu.
This commit is contained in:
parent
924a3b8d54
commit
fc285396d7
|
@ -281,7 +281,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
content:function(){
|
content:function(){
|
||||||
target.link();
|
target.link();
|
||||||
},
|
},
|
||||||
chongzhu:true,
|
recastable:true,
|
||||||
ai:{
|
ai:{
|
||||||
wuxie:function(target,card,player,viewer){
|
wuxie:function(target,card,player,viewer){
|
||||||
if(_status.event.getRand()<0.5) return 0;
|
if(_status.event.getRand()<0.5) return 0;
|
||||||
|
|
|
@ -556,7 +556,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
mode:['guozhan','versus'],
|
mode:['guozhan','versus'],
|
||||||
filterTarget:true,
|
filterTarget:true,
|
||||||
chongzhu:true,
|
recastable:true,
|
||||||
changeTarget:function(player,targets){
|
changeTarget:function(player,targets){
|
||||||
var target=targets[0];
|
var target=targets[0];
|
||||||
game.filterPlayer(function(current){
|
game.filterPlayer(function(current){
|
||||||
|
@ -921,7 +921,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
fullskin:true,
|
fullskin:true,
|
||||||
type:'trick',
|
type:'trick',
|
||||||
enable:true,
|
enable:true,
|
||||||
chongzhu:true,
|
recastable:true,
|
||||||
filterTarget:function(card,player,target){
|
filterTarget:function(card,player,target){
|
||||||
if(player==target) return false;
|
if(player==target) return false;
|
||||||
return (target.countCards('h')||target.isUnseen(2));
|
return (target.countCards('h')||target.isUnseen(2));
|
||||||
|
|
|
@ -447,7 +447,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
fullskin:true,
|
fullskin:true,
|
||||||
type:'trick',
|
type:'trick',
|
||||||
enable:true,
|
enable:true,
|
||||||
// chongzhu:true,
|
// recastable:true,
|
||||||
filterTarget:function(card,player,target){
|
filterTarget:function(card,player,target){
|
||||||
return target==player;
|
return target==player;
|
||||||
},
|
},
|
||||||
|
|
|
@ -259,7 +259,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
enable:function(){
|
enable:function(){
|
||||||
return game.countPlayer()>2;
|
return game.countPlayer()>2;
|
||||||
},
|
},
|
||||||
chongzhu:function(){
|
recastable:function(){
|
||||||
return game.countPlayer()<=2;
|
return game.countPlayer()<=2;
|
||||||
},
|
},
|
||||||
singleCard:true,
|
singleCard:true,
|
||||||
|
|
|
@ -266,7 +266,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
fullskin:true,
|
fullskin:true,
|
||||||
type:'trick',
|
type:'trick',
|
||||||
nodelay:true,
|
nodelay:true,
|
||||||
// chongzhu:true,
|
// recastable:true,
|
||||||
global:'g_shencaojie',
|
global:'g_shencaojie',
|
||||||
content:function(){
|
content:function(){
|
||||||
var evt=event.getParent('g_shencaojie')._trigger;
|
var evt=event.getParent('g_shencaojie')._trigger;
|
||||||
|
|
|
@ -399,10 +399,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
'step 1'
|
'step 1'
|
||||||
if(result.bool){
|
if(result.bool){
|
||||||
player.logSkill('taigongyinfu_skill');
|
player.logSkill('taigongyinfu_skill');
|
||||||
player.lose(result.cards,ui.discardPile,'visible');
|
player.recast(result.cards);
|
||||||
player.$throw(result.cards,1000);
|
|
||||||
game.log(player,'将',result.cards,'置入了弃牌堆');
|
|
||||||
player.draw();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -613,10 +613,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
ai:{expose:0.1},
|
ai:{expose:0.1},
|
||||||
},
|
},
|
||||||
_yongjian_zengyu:{
|
_gifting:{
|
||||||
enable:'phaseUse',
|
enable:'phaseUse',
|
||||||
forceLoad:true,
|
forceLoad:true,
|
||||||
filter:(event,player)=>player.hasCard(card=>lib.skill._yongjian_zengyu.filterCard(card,player),lib.skill._yongjian_zengyu.position),
|
filter:(event,player)=>player.hasCard(card=>lib.skill._gifting.filterCard(card,player),lib.skill._gifting.position),
|
||||||
filterCard:(card,player)=>game.hasPlayer(current=>player.canGift(card,current,true)),
|
filterCard:(card,player)=>game.hasPlayer(current=>player.canGift(card,current,true)),
|
||||||
filterTarget:(card,player,target)=>ui.selected.cards.every(value=>player.canGift(value,target,true)),
|
filterTarget:(card,player,target)=>ui.selected.cards.every(value=>player.canGift(value,target,true)),
|
||||||
position:'he',
|
position:'he',
|
||||||
|
@ -677,8 +677,8 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
xinge_info:'出牌阶段限一次。你可以将一张手牌交给一名其他角色。',
|
xinge_info:'出牌阶段限一次。你可以将一张手牌交给一名其他角色。',
|
||||||
xinge_append:'<span class="text" style="font-family: yuanli">咕咕咕。</span>',
|
xinge_append:'<span class="text" style="font-family: yuanli">咕咕咕。</span>',
|
||||||
|
|
||||||
_yongjian_zengyu:'赠予',
|
_gifting:'赠予',
|
||||||
_yongjian_zengyu_info:'出牌阶段,你可将一张拥有“赠”标签的手牌区装备牌置于一名其他角色的装备区内,或将一张拥有“赠”标签的手牌区非装备牌正面朝上交给一名其他角色。',
|
_gifting_info:'出牌阶段,你可将一张拥有“赠”标签的手牌区装备牌置于一名其他角色的装备区内,或将一张拥有“赠”标签的手牌区非装备牌正面朝上交给一名其他角色。',
|
||||||
},
|
},
|
||||||
list:[
|
list:[
|
||||||
['spade',1,'guaguliaodu'],
|
['spade',1,'guaguliaodu'],
|
||||||
|
|
|
@ -276,7 +276,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
enable:function(){
|
enable:function(){
|
||||||
return game.countPlayer()>2;
|
return game.countPlayer()>2;
|
||||||
},
|
},
|
||||||
chongzhu:function(){
|
recastable:function(){
|
||||||
return game.countPlayer()<=2;
|
return game.countPlayer()<=2;
|
||||||
},
|
},
|
||||||
multicheck:function(card,player){
|
multicheck:function(card,player){
|
||||||
|
|
|
@ -5,7 +5,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
card:{
|
card:{
|
||||||
pozhenjue:{
|
pozhenjue:{
|
||||||
type:'zhenfa',
|
type:'zhenfa',
|
||||||
chongzhu:true,
|
recastable:true,
|
||||||
enable:true,
|
enable:true,
|
||||||
notarget:true,
|
notarget:true,
|
||||||
content:function(){
|
content:function(){
|
||||||
|
@ -25,7 +25,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
changshezhen:{
|
changshezhen:{
|
||||||
type:'zhenfa',
|
type:'zhenfa',
|
||||||
chongzhu:true,
|
recastable:true,
|
||||||
enable:function(card,player){
|
enable:function(card,player){
|
||||||
if(player.inline()) return true;
|
if(player.inline()) return true;
|
||||||
if(player.identity=='unknown'||player.identity=='ye') return false;
|
if(player.identity=='unknown'||player.identity=='ye') return false;
|
||||||
|
@ -68,7 +68,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
tianfuzhen:{
|
tianfuzhen:{
|
||||||
type:'zhenfa',
|
type:'zhenfa',
|
||||||
chongzhu:true,
|
recastable:true,
|
||||||
enable:function(){
|
enable:function(){
|
||||||
return game.hasPlayer(function(current){
|
return game.hasPlayer(function(current){
|
||||||
return current.isMajor();
|
return current.isMajor();
|
||||||
|
@ -94,7 +94,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
dizaizhen:{
|
dizaizhen:{
|
||||||
type:'zhenfa',
|
type:'zhenfa',
|
||||||
chongzhu:true,
|
recastable:true,
|
||||||
enable:function(){
|
enable:function(){
|
||||||
return game.hasPlayer(function(current){
|
return game.hasPlayer(function(current){
|
||||||
return current.isNotMajor();
|
return current.isNotMajor();
|
||||||
|
@ -121,7 +121,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
fengyangzhen:{
|
fengyangzhen:{
|
||||||
type:'zhenfa',
|
type:'zhenfa',
|
||||||
chongzhu:true,
|
recastable:true,
|
||||||
enable:true,
|
enable:true,
|
||||||
filterTarget:function(card,player,target){
|
filterTarget:function(card,player,target){
|
||||||
return target.sieged();
|
return target.sieged();
|
||||||
|
@ -142,7 +142,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
yunchuizhen:{
|
yunchuizhen:{
|
||||||
type:'zhenfa',
|
type:'zhenfa',
|
||||||
chongzhu:true,
|
recastable:true,
|
||||||
enable:true,
|
enable:true,
|
||||||
filterTarget:function(card,player,target){
|
filterTarget:function(card,player,target){
|
||||||
return target.siege();
|
return target.siege();
|
||||||
|
@ -163,7 +163,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
qixingzhen:{
|
qixingzhen:{
|
||||||
type:'zhenfa',
|
type:'zhenfa',
|
||||||
chongzhu:true,
|
recastable:true,
|
||||||
enable:function(card,player){
|
enable:function(card,player){
|
||||||
return player.siege()||player.sieged();
|
return player.siege()||player.sieged();
|
||||||
},
|
},
|
||||||
|
@ -202,7 +202,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
shepanzhen:{
|
shepanzhen:{
|
||||||
type:'zhenfa',
|
type:'zhenfa',
|
||||||
chongzhu:true,
|
recastable:true,
|
||||||
enable:function(card,player){
|
enable:function(card,player){
|
||||||
if(player.identity=='unknown'||player.identity=='ye') return false;
|
if(player.identity=='unknown'||player.identity=='ye') return false;
|
||||||
if(get.population(player.identity)<=1) return false;
|
if(get.population(player.identity)<=1) return false;
|
||||||
|
@ -231,7 +231,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
longfeizhen:{
|
longfeizhen:{
|
||||||
type:'zhenfa',
|
type:'zhenfa',
|
||||||
chongzhu:true,
|
recastable:true,
|
||||||
enable:function(card,player){
|
enable:function(card,player){
|
||||||
return player.next.siege(player);
|
return player.next.siege(player);
|
||||||
},
|
},
|
||||||
|
@ -261,7 +261,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
huyizhen:{
|
huyizhen:{
|
||||||
type:'zhenfa',
|
type:'zhenfa',
|
||||||
chongzhu:true,
|
recastable:true,
|
||||||
enable:function(card,player){
|
enable:function(card,player){
|
||||||
return player.siege(player.next)||player.siege(player.previous);
|
return player.siege(player.next)||player.siege(player.previous);
|
||||||
},
|
},
|
||||||
|
@ -309,7 +309,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
niaoxiangzhen:{
|
niaoxiangzhen:{
|
||||||
type:'zhenfa',
|
type:'zhenfa',
|
||||||
chongzhu:true,
|
recastable:true,
|
||||||
enable:true,
|
enable:true,
|
||||||
filterTarget:function(card,player,target){
|
filterTarget:function(card,player,target){
|
||||||
if(player.identity==target.identity) return false;
|
if(player.identity==target.identity) return false;
|
||||||
|
|
|
@ -3647,7 +3647,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
result:{player:1},
|
result:{player:1},
|
||||||
effect:{
|
effect:{
|
||||||
target:function(card,player,target){
|
target:function(card,player,target){
|
||||||
if(card&&get.type(card)=='equip'&&_status.event.skill=='_yongjian_zengyu') return 0;
|
if(card&&get.type(card)=='equip'&&_status.event.skill=='_gifting') return 0;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -6147,7 +6147,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
chongzhu:true,
|
recastable:true,
|
||||||
selectTarget:2,
|
selectTarget:2,
|
||||||
postAi:()=>true,
|
postAi:()=>true,
|
||||||
contentBefore:function(){
|
contentBefore:function(){
|
||||||
|
|
78
game/game.js
78
game/game.js
|
@ -10783,7 +10783,7 @@
|
||||||
eight:'八',
|
eight:'八',
|
||||||
nine:'九',
|
nine:'九',
|
||||||
ten:'十',
|
ten:'十',
|
||||||
_chongzhu:'重铸',
|
_recasting:'重铸',
|
||||||
_lianhuan:'连环',
|
_lianhuan:'连环',
|
||||||
_lianhuan2:'连环',
|
_lianhuan2:'连环',
|
||||||
_kamisha:'神杀',
|
_kamisha:'神杀',
|
||||||
|
@ -28649,8 +28649,8 @@
|
||||||
if(!mod) return false;
|
if(!mod) return false;
|
||||||
if(strict&&mod=='unchanged'){
|
if(strict&&mod=='unchanged'){
|
||||||
if(get.position(card)!='h') return false;
|
if(get.position(card)!='h') return false;
|
||||||
const info=get.info(card);
|
const info=get.info(card),recastable=info.recastable||info.chongzhu;
|
||||||
return typeof info.chongzhu=='function'?info.chongzhu(_status.event,player):info.chongzhu;
|
return Boolean(typeof recastable=='function'?recastable(_status.event,player):recastable);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
@ -30274,18 +30274,17 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_chongzhu:{
|
_recasting:{
|
||||||
enable:'phaseUse',
|
enable:'phaseUse',
|
||||||
logv:false,
|
logv:false,
|
||||||
visible:true,
|
|
||||||
prompt:'将要重铸的牌置入弃牌堆并摸一张牌',
|
prompt:'将要重铸的牌置入弃牌堆并摸一张牌',
|
||||||
filter:(event,player)=>player.hasCard(card=>lib.skill._chongzhu.filterCard(card,player),'he'),
|
filter:(event,player)=>player.hasCard(card=>lib.skill._recasting.filterCard(card,player),lib.skill._recasting.position),
|
||||||
position:'he',
|
position:'he',
|
||||||
filterCard:(card,player)=>player.canRecast(card,null,true),
|
filterCard:(card,player)=>player.canRecast(card,null,true),
|
||||||
discard:false,
|
discard:false,
|
||||||
lose:false,
|
lose:false,
|
||||||
delay:false,
|
delay:false,
|
||||||
content:function(){
|
content:()=>{
|
||||||
player.recast(cards,null,(player,cards)=>{
|
player.recast(cards,null,(player,cards)=>{
|
||||||
var numberOfCardsToDraw=cards.length;
|
var numberOfCardsToDraw=cards.length;
|
||||||
cards.forEach(value=>{
|
cards.forEach(value=>{
|
||||||
|
@ -30369,6 +30368,71 @@
|
||||||
player.link();
|
player.link();
|
||||||
if(trigger.getParent().notLink()) trigger.getParent().lianhuanable=true;
|
if(trigger.getParent().notLink()) trigger.getParent().lianhuanable=true;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
//Deprecated skills
|
||||||
|
_chongzhu:{
|
||||||
|
get filter(){
|
||||||
|
return lib.skill._recasting.filter;
|
||||||
|
},
|
||||||
|
set filter(filter){
|
||||||
|
lib.skill._recasting.filter=filter;
|
||||||
|
},
|
||||||
|
get filterCard(){
|
||||||
|
return lib.skill._recasting.filterCard;
|
||||||
|
},
|
||||||
|
set filterCard(filterCard){
|
||||||
|
lib.skill._recasting.filterCard=filterCard;
|
||||||
|
},
|
||||||
|
get content(){
|
||||||
|
return lib.skill._recasting.content;
|
||||||
|
},
|
||||||
|
set content(content){
|
||||||
|
lib.skill._recasting.content=content;
|
||||||
|
},
|
||||||
|
get ai(){
|
||||||
|
return lib.skill._recasting.ai;
|
||||||
|
},
|
||||||
|
set ai(ai){
|
||||||
|
lib.skill._recasting.ai=ai;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
_yongjian_zengyu:{
|
||||||
|
get filter(){
|
||||||
|
return lib.skill._gifting.filter;
|
||||||
|
},
|
||||||
|
set filter(filter){
|
||||||
|
lib.skill._gifting.filter=filter;
|
||||||
|
},
|
||||||
|
get filterCard(){
|
||||||
|
return lib.skill._gifting.filterCard;
|
||||||
|
},
|
||||||
|
set filterCard(filterCard){
|
||||||
|
lib.skill._gifting.filterCard=filterCard;
|
||||||
|
},
|
||||||
|
get filterTarget(){
|
||||||
|
return lib.skill._gifting.filterTarget;
|
||||||
|
},
|
||||||
|
set filterTarget(filterTarget){
|
||||||
|
lib.skill._gifting.filterTarget=filterTarget;
|
||||||
|
},
|
||||||
|
get check(){
|
||||||
|
return lib.skill._gifting.check;
|
||||||
|
},
|
||||||
|
set check(check){
|
||||||
|
lib.skill._gifting.check=check;
|
||||||
|
},
|
||||||
|
get content(){
|
||||||
|
return lib.skill._gifting.content;
|
||||||
|
},
|
||||||
|
set content(content){
|
||||||
|
lib.skill._gifting.content=content;
|
||||||
|
},
|
||||||
|
get ai(){
|
||||||
|
return lib.skill._gifting.ai;
|
||||||
|
},
|
||||||
|
set ai(ai){
|
||||||
|
lib.skill._gifting.ai=ai;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
character:{},
|
character:{},
|
||||||
|
|
|
@ -4536,11 +4536,13 @@ div[data-decoration="bronze"]::after{
|
||||||
right: 6px;
|
right: 6px;
|
||||||
}
|
}
|
||||||
.card .tempname {
|
.card .tempname {
|
||||||
top: 6px;
|
|
||||||
left: 6px;
|
|
||||||
font-size: 22px;
|
|
||||||
color: white !important;
|
color: white !important;
|
||||||
|
font-size: 22px;
|
||||||
|
left: 8px;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
top: 4px;
|
||||||
|
writing-mode: vertical-rl;
|
||||||
|
-webkit-writing-mode: vertical-rl;
|
||||||
}
|
}
|
||||||
/*.card.equip1 .wunature,
|
/*.card.equip1 .wunature,
|
||||||
.card.equip3 .wunature,
|
.card.equip3 .wunature,
|
||||||
|
|
|
@ -8359,7 +8359,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
for(var i in lib.card){
|
for(var i in lib.card){
|
||||||
if(lib.card[i].subtype=='equip1') lib.card[i].chongzhu=true;
|
if(lib.card[i].subtype=='equip1') lib.card[i].recastable=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -480,7 +480,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
hhzz_toulianghuanzhu:{
|
hhzz_toulianghuanzhu:{
|
||||||
enable:true,
|
enable:true,
|
||||||
cardimage:"toulianghuanzhu",
|
cardimage:"toulianghuanzhu",
|
||||||
chongzhu:true,
|
recastable:true,
|
||||||
type:'trick',
|
type:'trick',
|
||||||
filterTarget:function(card,player,target){
|
filterTarget:function(card,player,target){
|
||||||
return target.skillH.length>0;
|
return target.skillH.length>0;
|
||||||
|
|
|
@ -583,7 +583,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
enable:function(event,player){
|
enable:function(event,player){
|
||||||
return player.canAddFellow();
|
return player.canAddFellow();
|
||||||
},
|
},
|
||||||
chongzhu:function(event,player){
|
recastable:function(event,player){
|
||||||
return !player.isMin()&&!player.canAddFellow();
|
return !player.isMin()&&!player.canAddFellow();
|
||||||
},
|
},
|
||||||
notarget:true,
|
notarget:true,
|
||||||
|
@ -1424,7 +1424,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
lib.card.list.randomSort();
|
lib.card.list.randomSort();
|
||||||
}
|
}
|
||||||
|
|
||||||
lib.skill._chongzhu.usable=3;
|
lib.skill._recasting.usable=3;
|
||||||
for(i in lib.skill){
|
for(i in lib.skill){
|
||||||
if(lib.skill[i].changeSeat){
|
if(lib.skill[i].changeSeat){
|
||||||
lib.skill[i]={};
|
lib.skill[i]={};
|
||||||
|
@ -2366,7 +2366,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
type:'stonecard',
|
type:'stonecard',
|
||||||
stoneact:2,
|
stoneact:2,
|
||||||
career:'priest',
|
career:'priest',
|
||||||
chongzhu:true,
|
recastable:true,
|
||||||
enable:function(event,player){
|
enable:function(event,player){
|
||||||
if(player.career!='priest') return false;
|
if(player.career!='priest') return false;
|
||||||
return !player.storage.anyingxingtai||player.storage.anyingxingtai<2;
|
return !player.storage.anyingxingtai||player.storage.anyingxingtai<2;
|
||||||
|
|
Loading…
Reference in New Issue