This commit is contained in:
libccy 2017-05-11 03:08:28 +08:00
parent 423c2d3436
commit b18b195947
13 changed files with 449 additions and 26 deletions

View File

@ -3,15 +3,269 @@ game.import('card',function(lib,game,ui,get,ai,_status){
return { return {
name:'gwent', name:'gwent',
card:{ card:{
gw_niuquzhijing:{
fullborder:'gold',
type:'spell',
subtype:'spell_gold',
vanish:true,
enable:function(card,player){
if(game.hasPlayer(function(current){
return current.hp!=player.hp;
})){
return !player.storage.spell_gold;
}
},
filterTarget:function(card,player,target){
return target.isHighestHp()||target.isLowestHp();
},
chongzhu:function(event,player){
return player.storage.spell_gold?true:false;
},
selectTarget:-1,
multitarget:true,
multiline:true,
contentBefore:function(){
player.$skill('纽曲之镜','legend','metal');
game.delay(2);
},
content:function(){
var max=null,min=null;
for(var i=0;i<game.players.length;i++){
if(game.players[i].isHighestHp()){
max=game.players[i].hp;break;
}
}
for(var i=0;i<game.players.length;i++){
if(game.players[i].isLowestHp()){
min=game.players[i].hp;break;
}
}
if(max!=min&&max!=null&&min!=null){
for(var i=0;i<targets.length;i++){
if(targets[i].hp==max){
targets[i].hp=min;
}
else if(targets[i].hp==min){
targets[i].hp=max;
if(targets[i].maxHp<targets[i].hp){
targets[i].maxHp=targets[i].hp;
}
}
targets[i].update();
}
}
},
contentAfter:function(){
player.storage.spell_gold=true;
var evt=_status.event.getParent('phaseUse');
if(evt&&evt.name=='phaseUse'){
evt.skipped=true;
}
},
ai:{
value:8,
result:{
target:function(player,target){
if(target.isHighestHp) return -10;
return 10;
}
},
order:3.5,
multitarget:true,
}
},
gw_zhongmozhizhan:{
fullborder:'gold',
type:'spell',
subtype:'spell_gold',
vanish:true,
enable:function(card,player){
return !player.storage.spell_gold;
},
filterTarget:function(card,player,target){
return target.countCards('hej');
},
chongzhu:function(event,player){
return player.storage.spell_gold?true:false;
},
selectTarget:-1,
multitarget:true,
multiline:true,
contentBefore:function(){
player.$skill('终末之战','legend','metal');
game.delay(2);
},
content:function(){
'step 0'
event.num=0;
'step 1'
if(event.num<targets.length){
ui.clear();
var target=targets[event.num];
var cards=target.getCards('hej');
target.lose(cards)._triggered=null;
target.$throw(cards);
event.num++;
event.redo();
game.delay(0.7);
}
'step 2'
ui.clear();
},
contentAfter:function(){
player.storage.spell_gold=true;
var evt=_status.event.getParent('phaseUse');
if(evt&&evt.name=='phaseUse'){
evt.skipped=true;
}
},
ai:{
value:8,
result:{
target:function(player,target){
return -Math.sqrt(target.countCards('he'));
}
},
order:0.5,
multitarget:true,
multineg:true
}
},
gw_butianshu:{
fullborder:'silver',
type:'spell',
subtype:'spell_silver',
vanish:true,
enable:function(card,player){
return player.storage.spell_silver!=2;
},
filterTarget:true,
chongzhu:function(event,player){
return player.storage.spell_silver==2?true:false;
},
contentBefore:function(){
player.$skill('卜天术','legend','water');
game.delay(2);
},
content:function(){
'step 0'
var list=[];
for(var i in lib.card){
if(lib.card[i].mode&&lib.card[i].mode.contains(lib.config.mode)==false) continue;
if(lib.card[i].type=='delay') list.push([cards[0].suit,cards[0].number,i]);
}
var dialog=ui.create.dialog('卜天术',[list,'vcard']);
var bing=target.countCards('h')<=1;
player.chooseButton(dialog,true,function(button){
if(ai.get.effect(target,{name:button.link[2]},player,player)>0){
if(button.link[2]=='bingliang'){
if(bing) return 2;
return 0.7;
}
if(button.link[2]=='lebu'){
return 1;
}
if(button.link[2]=='guiyoujie'){
return 0.5;
}
if(button.link[2]=='caomu'){
return 0.3;
}
return 0.2;
}
return 0;
}).filterButton=function(button){
return !target.hasJudge(button.link[2]);
};
'step 1'
var card=game.createCard(result.links[0][2]);
event.judgecard=card;
target.$draw(card);
game.delay(0.7);
'step 2'
target.addJudge(event.judgecard);
},
contentAfter:function(){
if(player.storage.spell_silver==1){
player.storage.spell_silver=2;
}
else{
player.storage.spell_silver=1;
}
},
ai:{
value:8,
result:{
player:function(player,target){
var eff=0;
for(var i in lib.card){
if(lib.card[i].type=='delay'){
var current=ai.get.effect(target,{name:i},player,player);
if(current>eff){
eff=current;
}
}
}
return eff;
}
},
order:6,
}
},
gw_zhihuanjun:{
fullborder:'bronze',
type:'spell',
subtype:'spell_bronze',
enable:true,
filterTarget:function(card,player,target){
return target.isDamaged();
},
content:function(){
target.loseMaxHp(true);
},
ai:{
value:4,
result:{
target:function(player,target){
if(target.maxHp-target.hp==1){
return -1/target.maxHp;
}
else{
return -1/target.maxHp/3;
}
}
},
order:8,
}
}
}, },
skill:{ skill:{
},
help:{
'昆特牌':'<ul><li>法术为分金、银、铜三类,金卡和银卡不出现在牌堆中<li>'+
'每局最多使用两张银卡,使用过两张银卡法术后可将多余的银卡重铸为铜卡<li>'+
'每局最多使用一张金卡,使用过金卡法术后可将多余的金卡重铸为银卡(若已使用两张银卡则改为铜卡)<li>'+
'若本局使用的银卡数不超过2摸牌阶段有一定概率摸到银卡在游戏的前10个摸牌阶段中至少会摸到2张银卡<li>'+
'若本局未使用过金卡摸牌阶段有一定概率摸到金卡在游戏的前10个摸牌阶段中至少会摸到1张金卡<li>'+
'进行洗牌时金卡、银卡将从弃牌堆中消失,不进入牌堆'
}, },
translate:{ translate:{
spell:'法术',
spell_gold:'金卡法术',
spell_silver:'银卡法术',
spell_bronze:'铜卡法术',
gw_zhongmozhizhan:'终末之战',
gw_zhongmozhizhan_info:'结束出牌阶段,将所有角色区域内的所有牌置入弃牌堆,且不触发技能(每局最多用一张金卡法术,多余的法术可重铸)',
gw_butianshu:'卜天术',
gw_butianshu_info:'出牌阶段对任意角色使用,将任意一张延时锦囊牌置入其判定区(每局最多用两张银卡法术,多余的法术可重铸)',
gw_zhihuanjun:'致幻菌',
gw_zhihuanjun_info:'出牌阶段对一名已受伤角色使用,令其减少一点体力上限',
gw_niuquzhijing:'纽曲之镜',
gw_niuquzhijing_info:'结束出牌阶段,交换全场体力值最大和最小角色的体力值,且不触发技能(每局最多用一张金卡法术,多余的法术可重铸)',
}, },
cardType:{ cardType:{
spell:0.5,
spell_bronze:0.2, spell_bronze:0.2,
spell_silver:0.3, spell_silver:0.3,
spell_gold:0.4 spell_gold:0.4

View File

@ -4715,6 +4715,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){
jiqi:0.4, jiqi:0.4,
jiguan:0.45 jiguan:0.45
}, },
help:{
'轩辕剑':'<ul><li>零件、祭器牌可用于煅造装备煅造得到强化装备并可装备给距离1以内的角色<li>'+
'煅造装备时失去牌不触发技能<li>'+
'进行洗牌时强化装备将从弃牌堆中消失,不进入牌堆<li>'+
'专属、特殊装备无法被强化'
},
translate:{ translate:{
_yuchan_equip:'玉蝉', _yuchan_equip:'玉蝉',
yuchanqian_duanzao:'玉蝉', yuchanqian_duanzao:'玉蝉',

View File

@ -7695,11 +7695,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(lib.card[i].mode&&lib.card[i].mode.contains(lib.config.mode)==false) continue; if(lib.card[i].mode&&lib.card[i].mode.contains(lib.config.mode)==false) continue;
if(lib.card[i].type=='delay') list.push([cards[0].suit,cards[0].number,i]); if(lib.card[i].type=='delay') list.push([cards[0].suit,cards[0].number,i]);
} }
var dialog=ui.create.dialog([list,'vcard']); var dialog=ui.create.dialog('玄咒',[list,'vcard']);
var bing=target.countCards('h')<=1; var bing=target.countCards('h')<=1;
player.chooseButton(dialog,true,function(button){ player.chooseButton(dialog,true,function(button){
if(bing&&button.link[2]=='bingliang'){ if(ai.get.effect(target,{name:button.link[2]},player,player)>0){
return 2; if(button.link[2]=='bingliang'){
if(bing) return 2;
return 0.7;
} }
if(button.link[2]=='lebu'){ if(button.link[2]=='lebu'){
return 1; return 1;
@ -7707,7 +7709,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(button.link[2]=='guiyoujie'){ if(button.link[2]=='guiyoujie'){
return 0.5; return 0.5;
} }
if(button.link[2]=='caomu'){
return 0.3;
}
return 0.2; return 0.2;
}
return 0;
}).filterButton=function(button){ }).filterButton=function(button){
return !target.hasJudge(button.link[2]); return !target.hasJudge(button.link[2]);
}; };
@ -7716,7 +7723,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
ai:{ ai:{
result:{ result:{
target:-1 player:function(player,target){
var eff=0;
for(var i in lib.card){
if(lib.card[i].type=='delay'){
var current=ai.get.effect(target,{name:i},player,player);
if(current>eff){
eff=current;
}
}
}
return eff;
}
}, },
order:9.5, order:9.5,
} }

View File

@ -52,6 +52,10 @@ window.noname_asset_list=[
'image/card/guiyanfadao.png', 'image/card/guiyanfadao.png',
'image/card/guilingzhitao.png', 'image/card/guilingzhitao.png',
'image/card/guohe.png', 'image/card/guohe.png',
'image/card/gw_butianshu.png',
'image/card/gw_niuquzhijing.png',
'image/card/gw_zhihuanjun.png',
'image/card/gw_zhongmozhizhan.png',
'image/card/hanbing.png', 'image/card/hanbing.png',
'image/card/haotianta.png', 'image/card/haotianta.png',
'image/card/heilonglinpian.png', 'image/card/heilonglinpian.png',
@ -2504,6 +2508,9 @@ window.noname_asset_list=[
'theme/woodden/wood.png', 'theme/woodden/wood.png',
'theme/woodden/wood2.jpg', 'theme/woodden/wood2.jpg',
'theme/woodden/wood2.png', 'theme/woodden/wood2.png',
'theme/style/card/image/border_bronze.png',
'theme/style/card/image/border_gold.png',
'theme/style/card/image/border_silver.png',
'theme/style/card/image/new.png', 'theme/style/card/image/new.png',
'theme/style/card/image/ol.png', 'theme/style/card/image/ol.png',
'theme/style/cardback/image/feicheng.png', 'theme/style/cardback/image/feicheng.png',

View File

@ -17819,6 +17819,10 @@
img=null; img=null;
} }
} }
this.classList.remove('fullskin');
this.classList.remove('fullimage');
this.classList.remove('fullborder');
this.node.name.dataset.nature='';
if(!lib.config.hide_card_image&&lib.card[bg].fullskin){ if(!lib.config.hide_card_image&&lib.card[bg].fullskin){
this.classList.add('fullskin'); this.classList.add('fullskin');
if(img){ if(img){
@ -17843,6 +17847,7 @@
else this.node.background.setBackground(bg,'card'); else this.node.background.setBackground(bg,'card');
} }
else if(lib.card[bg].fullimage){ else if(lib.card[bg].fullimage){
this.classList.add('fullimage');
if(img){ if(img){
if(img.indexOf('ext:')==0){ if(img.indexOf('ext:')==0){
this.setBackgroundImage(img.replace(/ext:/,'extension/')); this.setBackgroundImage(img.replace(/ext:/,'extension/'));
@ -17862,6 +17867,45 @@
} }
else{ else{
this.setBackground('card/'+bg); this.setBackground('card/'+bg);
}
}
}
else if(lib.card[bg].fullborder){
this.classList.add('fullborder');
if(lib.card[bg].fullborder=='gold'){
this.node.name.dataset.nature='metalmm';
}
else if(lib.card[bg].fullborder=='silver'){
this.node.name.dataset.nature='watermm';
}
if(!this.node.avatar){
this.node.avatar=ui.create.div('.cardavatar');
this.insertBefore(this.node.avatar,this.firstChild);
}
if(!this.node.framebg){
this.node.framebg=ui.create.div('.cardframebg');
this.node.framebg.dataset.auto=lib.card[bg].fullborder;
this.insertBefore(this.node.framebg,this.firstChild);
}
if(img){
if(img.indexOf('ext:')==0){
this.node.avatar.setBackgroundImage(img.replace(/ext:/,'extension/'));
this.node.avatar.style.backgroundSize='cover';
}
else{
this.node.avatar.setBackgroundDB(img);
}
}
else if(lib.card[bg].image){
this.node.avatar.setBackground(lib.card[bg].image);
}
else{
var cardPack=lib.cardPack['mode_'+get.mode()];
if(Array.isArray(cardPack)&&cardPack.contains(bg)){
this.node.avatar.setBackground('mode/'+get.mode()+'/card/'+bg);
}
else{
this.node.avatar.setBackground('card/'+bg);
} }
} }
} }
@ -17895,20 +17939,20 @@
if(info.color){ if(info.color){
this.style.color=info.color; this.style.color=info.color;
} }
else if(info.fullimage){ else if(info.fullimage||info.fullborder){
this.style.color='white'; this.style.color='white';
} }
if(info.textShadow){ if(info.textShadow){
this.style.textShadow=info.textShadow; this.style.textShadow=info.textShadow;
} }
else if(info.fullimage){ else if(info.fullimage||info.fullborder){
this.style.textShadow='black 0 0 2px'; this.style.textShadow='black 0 0 2px';
} }
if(info.opacity){ if(info.opacity){
this.node.info.style.opacity=info.opacity; this.node.info.style.opacity=info.opacity;
this.node.name.style.opacity=info.opacity; this.node.name.style.opacity=info.opacity;
} }
else if(info.fullimage){ else if(info.fullimage||info.fullborder){
this.node.info.style.opacity=1; this.node.info.style.opacity=1;
this.node.name.style.opacity=1; this.node.name.style.opacity=1;
} }
@ -19473,6 +19517,33 @@
player.draw({drawDeck:1}) player.draw({drawDeck:1})
} }
} }
else if(get.subtype(cards[0])=='spell_gold'){
var list=get.libCard(function(info){
if(player.storage.spell_silver==2){
return info.subtype=='spell_bronze';
}
else{
return info.subtype=='spell_silver';
}
});
if(list.length){
player.gain(game.createCard(list.randomGet()),'draw');
}
else{
player.draw();
}
}
else if(get.subtype(cards[0])=='spell_silver'){
var list=get.libCard(function(info){
return info.subtype=='spell_bronze';
});
if(list.length){
player.gain(game.createCard(list.randomGet()),'draw');
}
else{
player.draw();
}
}
else{ else{
player.draw(); player.draw();
} }
@ -39900,6 +39971,12 @@
} }
else{ else{
for(var i=0;i<lib.inpile.length;i++){ for(var i=0;i<lib.inpile.length;i++){
if(typeof type=='function'){
if(type(lib.inpile[i])){
list.push(lib.inpile[i]);
}
}
else{
if(typeof filter=='function'&&!filter(lib.inpile[i])) continue; if(typeof filter=='function'&&!filter(lib.inpile[i])) continue;
if(type.indexOf('equip')==0&&type.length==6){ if(type.indexOf('equip')==0&&type.length==6){
if(get.subtype(lib.inpile[i])==type) list.push(lib.inpile[i]); if(get.subtype(lib.inpile[i])==type) list.push(lib.inpile[i]);
@ -39909,6 +39986,7 @@
} }
} }
} }
}
return list; return list;
}, },
typeCard:function(type,filter){ typeCard:function(type,filter){
@ -39928,6 +40006,15 @@
} }
return list; return list;
}, },
libCard:function(filter){
var list=[];
for(var i in lib.card){
if(filter(lib.card[i],i)){
list.push(i);
}
}
return list;
},
ip:function(){ ip:function(){
if(!require) return ''; if(!require) return '';
var interfaces = require('os').networkInterfaces(); var interfaces = require('os').networkInterfaces();
@ -41702,7 +41789,7 @@
uiintro.add('<div class="text center">攻击范围1</div>'); uiintro.add('<div class="text center">攻击范围1</div>');
} }
} }
else if(get.type(node)=='equip'){ else if(get.subtype(node)){
uiintro.add('<div class="text center">'+get.translation(get.subtype(node))+'</div>'); uiintro.add('<div class="text center">'+get.translation(get.subtype(node))+'</div>');
} }
else if(lib.card[name]&&lib.card[name].addinfomenu){ else if(lib.card[name]&&lib.card[name].addinfomenu){

BIN
image/card/gw_butianshu.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

View File

@ -1145,6 +1145,57 @@ body>.background.upper {
top: 85px; top: 85px;
right: 0; right: 0;
} }
.card.fullimage>.name,
.card.fullborder>.name{
font-family: 'xinwei';
}
.card>.cardframebg{
width: 100%;
height: 100%;
left: 0;
top: 0;
position: absolute;
background-size: 100% 100%;
border-radius: 8px;
}
#window[data-radius_size='reduce'] .card>.cardframebg{
border-radius: 4px;
}
#window[data-radius_size='increase'] .card>.cardframebg{
border-radius: 16px;
}
#window[data-radius_size='off'] .card>.cardframebg{
border-radius: 0;
}
.card>.cardframebg[data-auto='gold']{
background-image:url('../../theme/style/card/image/border_gold.jpg');
}
.card>.cardframebg[data-auto='silver']{
background-image:url('../../theme/style/card/image/border_silver.jpg');
}
.card>.cardframebg[data-auto='bronze']{
background-image:url('../../theme/style/card/image/border_bronze.jpg');
}
.card>.cardavatar{
width: calc(100% - 6px);
height: calc(100% - 6px);
left: 3px;
top: 3px;
position: absolute;
border-radius: 6px;
pointer-events: none;
box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px inset, rgba(0, 0, 0, 0.45) 0 0 10px inset;
}
#window[data-radius_size='reduce'] .card>.cardavatar {
border-radius: 3px;
}
#window[data-radius_size='off'] .card>.cardavatar {
border-radius: 0px;
}
#window[data-radius_size='increase'] .card>.cardavatar {
border-radius: 14px;
}
div:not(.handcards)>.card>.info, div:not(.handcards)>.card>.info,
.handcards>.card:last-child>.info, .handcards>.card:last-child>.info,

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB