Merge branch 'libccy:PR-Branch' into PR-Branch

This commit is contained in:
157 2023-12-20 22:59:56 +08:00 committed by GitHub
commit 913fc6562e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
408 changed files with 56143 additions and 119994 deletions

BIN
audio/die/ol_feiyi.mp3 Normal file

Binary file not shown.

Binary file not shown.

BIN
audio/skill/hezhong1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/hezhong2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/olsbranji1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/olsbranji2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/olsbzhuri1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/olsbzhuri2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/yanru1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/yanru2.mp3 Normal file

Binary file not shown.

View File

@ -71,7 +71,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
zhanghu:['male','wei',4,['cuijian','zhtongyuan']],
luyusheng:['female','wu',3,['zhente','zhiwei']],
huaxin:['male','wei',3,['spwanggui','xibing']],
mengyou:['male','qun',5,['hmmanyi','dcmanzhi']],
mengyou:['male','qun',5,['manyi','dcmanzhi']],
liuyong:['male','shu',3,['zhuning','fengxiang']],
dc_sunru:['female','wu',3,['xiecui','youxu']],
xiahoulingnv:['female','wei',4,['fuping','weilie']],

View File

@ -6,7 +6,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
character:{
ol_sb_jiangwei:['male','shu',4,['olsbzhuri','olsbranji']],
ol_caozhang:['male','wei',4,['oljiangchi']],
ol_jianyong:['male','shu',3,['olqiaoshui','jyzongshi']],
ol_jianyong:['male','shu',3,['olqiaoshui','jyzongshi'],['tempname:re_jianyong','die_audio:re_jianyong']],
ol_lingtong:['male','wu',4,['olxuanfeng'],['die_audio:re_lingtong']],
},
characterSort:{
@ -252,7 +252,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
//界简雍
olqiaoshui:{
audio:2,
audio:'reqiaoshui',
inherit:'reqiaoshui',
filter:function(event,player){
return player.countCards('h')>0&&!player.hasSkill('olqiaoshui_used');

View File

@ -350,6 +350,7 @@ window.noname_character_rank={
'sb_zhugeliang',
'ol_jianyong',
'ol_sb_jiangwei',
'dc_sb_zhouyu',
],
am:[
'diy_caiwenji',
@ -642,6 +643,7 @@ window.noname_character_rank={
'dc_guansuo',
'dc_dongzhao',
'zhugeruoxue',
'dc_sb_lusu',
],
bp:[
'chess_diaochan',
@ -2076,6 +2078,7 @@ window.noname_character_rank={
'yj_zhoubuyi',
'ol_jianyong',
'ol_sb_jiangwei',
'dc_sb_zhouyu',
],
rare:[
'ol_caozhang',
@ -2543,6 +2546,7 @@ window.noname_character_rank={
'yue_zhoufei',
'ol_dingshangwan',
'ol_liwan',
'dc_sb_lusu',
],
junk:[
'sunshao',

View File

@ -15568,14 +15568,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
re_lidian_prefix:'界',
re_xushu:'界徐庶',
re_xushu_prefix:'界',
ol_jianyong:'OL界简雍',
ol_jianyong_prefix:'OL界',
olqiaoshui:'巧说',
olqiaoshui_info:'出牌阶段,你可与一名其他角色拼点。若你赢,你使用的下一张基本牌或普通锦囊牌可以额外指定任意一名其他角色为目标或减少指定一个目标;若你没赢,此技能于本回合失效且本回合你不能使用锦囊牌。',
ol_caozhang:'OL界曹彰',
ol_caozhang_prefix:'OL界',
oljiangchi:'将驰',
oljiangchi_info:'摸牌阶段结束时,你可以选择一项:①摸一张牌,本回合使用【杀】的次数上限-1且【杀】不计入手牌上限。②重铸一张牌本回合使用【杀】无距离限制且使用【杀】的次数上限+1。',
refresh_standard:'界限突破·标',
refresh_feng:'界限突破·风',

View File

@ -3953,8 +3953,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return player!=target&&target.canEquip(card);
},
async content(event, trigger, player){
await event.target.promises.equip(event.cards[0]);
await player.promises.draw();
event.target.equip(event.cards[0]);
player.draw();
},
discard:false,
lose:false,

View File

@ -13,12 +13,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
sp_huben:['duanjiong','ol_mengda',"caohong","xiahouba","zhugeke","zumao","wenpin","litong","mazhong","heqi","quyi","luzhi","zangba","yuejin","dingfeng","wuyan","ol_zhuling","tianyu","huojun",'zhaoyǎn','dengzhong','ol_furong','macheng','ol_zhangyì','ol_zhujun','maxiumatie','luoxian','ol_huban','haopu','ol_qianzhao'],
sp_liesi:['mizhu','weizi','ol_liuba','zhangshiping'],
sp_default:["sp_diaochan","sp_zhaoyun","sp_sunshangxiang","sp_caoren","sp_jiangwei","sp_machao","sp_caiwenji","jsp_guanyu","jsp_huangyueying","sp_pangde","sp_jiaxu","yuanshu",'sp_zhangliao','sp_ol_zhanghe','sp_menghuo'],
sp_qifu:["caoying",'panshu',"caochun","yuantanyuanshang",'caoshuang','wolongfengchu','guansuo','baosanniang','fengfangnv','jin_zhouchu'],
sp_qifu:['ol_feiyi',"caoying",'panshu',"caochun","yuantanyuanshang",'caoshuang','wolongfengchu','guansuo','baosanniang','fengfangnv','jin_zhouchu'],
sp_wanglang:['ol_wanglang','ol_puyuan','ol_zhouqun'],
sp_zhongdan:["cuiyan","huangfusong"],
sp_guozhan2:["sp_dongzhuo","liqueguosi","zhangren"],
sp_others:["hanba","caiyang"],
sp_waitforsort:['ol_luyusheng','ol_pengyang','ol_tw_zhangji','ol_feiyi','ol_dingshangwan','ol_liwan','ol_liuyan'],
sp_waitforsort:['ol_luyusheng','ol_pengyang','ol_tw_zhangji','ol_dingshangwan','ol_liwan','ol_liuyan'],
},
},
characterFilter:{
@ -1584,7 +1584,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return str+parseFloat(num);
},'');
},
content:'使用点数大于$的普通锦囊牌额外结算一次',
content:'使用的下一张点数大于$的普通锦囊牌额外结算一次',
},
audio:'hezhong',
trigger:{player:'useCard'},
@ -1594,14 +1594,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return typeof num=='number'&&player.getStorage('hezhong_0').some(numx=>num>numx);
},
forced:true,
usable:1,
content:function(){
player.unmarkSkill('hezhong_0');
trigger.effectCount++;
game.log(trigger.card,'额外结算一次');
},
ai:{
effect:{
player:function(card,player,target){
if(card.name=='tiesuo') return 'zerotarget';
if(card.name=='tiesuo'&&(!player.storage.counttrigger||!player.storage.counttrigger.hezhong_0)) return 'zerotarget';
},
},
},
@ -1618,7 +1620,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return str+parseFloat(num);
},'');
},
content:'使用点数小于$的普通锦囊牌额外结算一次',
content:'使用的下一张点数小于$的普通锦囊牌额外结算一次',
},
audio:'hezhong',
trigger:{player:'useCard'},
@ -1628,14 +1630,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return typeof num=='number'&&player.getStorage('hezhong_1').some(numx=>num<numx);
},
forced:true,
usable:1,
content:function(){
player.unmarkSkill('hezhong_1');
trigger.effectCount++;
game.log(trigger.card,'额外结算一次');
},
ai:{
effect:{
player:function(card,player,target){
if(card.name=='tiesuo') return 'zerotarget';
if(card.name=='tiesuo'&&(!player.storage.counttrigger||!player.storage.counttrigger.hezhong_1)) return 'zerotarget';
},
},
},
@ -24552,6 +24556,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.delayx();
}
},
ai:{
threaten:3,
},
hasMark:(mark,player,target)=>{
if(!target) return player.getStorage('jianjie_'+mark).length>0;
return target.getStorage('jianjie_'+mark).contains(player);
@ -24625,17 +24632,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
},
expose:0.4,
threaten:3,
},
},
die:{
audio:'xinfu_jianjie',
trigger:{global:'die'},
forced:true,
filter:function(event,player){
const skill=lib.skill.jianjie;
return skill.hasMark('huoji',player,event.player)||skill.hasMark('lianhuan',player,event.player);
},
forced:true,
logTarget:'player',
content:function(){
'step 0'
if(lib.skill.jianjie.hasMark('huoji',player,trigger.player)){
@ -24643,7 +24650,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return get.attitude(get.player(),target);
});
}
else event.goto(3);
else event.goto(2);
'step 1'
if(result.bool){
var target=result.targets[0];
@ -24668,7 +24675,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.delayx();
}
},
logTarget:'player',
},
huoji:{
marktext:'龙',
@ -26651,7 +26657,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
yanru:'宴如',
yanru_info:'出牌阶段各限一次,若你的手牌数为:①奇数,你可以摸三张牌,然后弃置至少一半手牌(向下取整);②偶数,你可以弃置至少一半手牌,然后摸三张牌。',
hezhong:'和衷',
hezhong_info:'每回合每项限一次当你的手牌数变为1后你可以展示唯一手牌A并摸一张牌,然后你选择一项:①本回合使用点数大于A的点数的普通锦囊牌额外结算一次②本回合使用点数小于A的点数的普通锦囊牌额外结算一次。',
hezhong_info:'每回合每项限一次当你的手牌数变为1后你可以展示唯一手牌并摸一张牌,然后你选择一项:①本回合使用的下一张点数大于此牌的点数的普通锦囊牌额外结算一次;②本回合使用的下一张点数小于此牌的点数的普通锦囊牌额外结算一次。',
lvboshe:'吕伯奢',
olfushi:'缚豕',
olfushi_info:'①一名角色使用【杀】结算结束后若你至其的距离不大于1你将此【杀】对应的所有实体牌置于武将牌上。②当你需要使用一张【杀】时你可以将任意张“缚豕”牌置入弃牌堆并摸等量的牌视为使用一张【杀】并选择X项X为你以此法重铸的牌数且至多为31.你为此【杀】额外指定一个目标2.你选择此【杀】的一个目标角色,此牌对其造成的伤害-13.你选择此【杀】的一个目标角色,此【杀】对其造成的伤害+1。当此【杀】指定最后一个目标后若此牌被选择的效果选项相邻且此牌的目标角色座位连续则此【杀】不计入次数限制。',

View File

@ -101,15 +101,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
direct:true,
async content(event,trigger,player){
event.num=trigger.num||1;
while(player.hasSkill('stdshushen')){
do {
const {result:{bool,targets}}=await player.chooseTarget(get.prompt2('stdshushen'),lib.filter.notMe)
.set('ai',target=>get.attitude(_status.event.player,target));
if(!bool) break;
const target = targets[0];
if(!bool) return;
const target=targets[0];
player.logSkill('stdshushen',target);
await target.draw(target.countCards('h')?1:2);
if(--event.num<1) break;
};
target.draw(target.countCards('h')?1:2);
}while(--event.num>0&&player.hasSkill('stdshushen'));
},
ai:{threaten:0.8,expose:0.1},
},
@ -122,8 +121,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return player.isPhaseUsing()&&event.card&&event.card.name=='sha'&&event.player!=player&&event.player.isIn();
},
async content(event,trigger,player){
if(trigger.player.hp<player.hp) await player.draw(2);
else await player.loseHp();
if(trigger.player.hp<player.hp) player.draw(2);
else player.loseHp();
},
ai:{
halfneg:true,
@ -138,7 +137,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
logTarget:'player',
async content(event,trigger,player){
await player.draw();
player.draw();
let zhu=false;
const target=trigger.player;
switch(get.mode()){
@ -160,7 +159,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
}
if(zhu){
await player.draw();
player.draw();
target.addTempSkill('rewangzun2');
target.addMark('rewangzun2',1,false);
}
@ -207,7 +206,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
})()>0);
if(bool){
player.logSkill('retongji',trigger.target);
await trigger.target.discard(cards);
trigger.target.discard(cards);
const evt=trigger.getParent();
evt.triggeredTargets2.remove(trigger.target);
evt.targets.remove(trigger.target);
@ -226,9 +225,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(player.storage.hujiaing) return false;
if(!player.hasZhuSkill('hujia')) return false;
if(!event.filterCard({name:'shan'},player,event)) return false;
return game.hasPlayer(function(current){
return current!=player&&current.group=='wei';
});
return game.hasPlayer(current=>current!=player&&current.group=='wei');
},
check(event,player){
if(get.damageEffect(player,event.player,player)>=0) return false;
@ -276,9 +273,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
skillTagFilter(player){
if(player.storage.hujiaing) return false;
if(!player.hasZhuSkill('hujia')) return false;
return game.hasPlayer(function(current){
return current!=player&&current.group=='wei';
});
return game.hasPlayer(current=>current!=player&&current.group=='wei');
},
},
},
@ -290,7 +285,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return get.itemtype(event.cards)=='cards'&&get.position(event.cards[0],true)=='o';
},
async content(event,trigger,player){
await player.gain(trigger.cards,'gain2');
player.gain(trigger.cards,'gain2');
},
ai:{
maixie:true,
@ -312,7 +307,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return (event.source&&event.source.countGainableCards(player,event.source!=player?'he':'e')&&event.num>0);
},
async content(event,trigger,player){
await player.gainPlayerCard(true,trigger.source,trigger.source!=player?'he':'e');
player.gainPlayerCard(true,trigger.source,trigger.source!=player?'he':'e');
},
ai:{
maixie_defend:true,
@ -358,7 +353,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
}).set('judging',trigger.player.judging[0]).setHiddenSkill('guicai');
if(!chooseCardResultBool) return;
await player.respond(chooseCardResultCards,'guicai','highlight','noOrdering');
player.respond(chooseCardResultCards,'guicai','highlight','noOrdering');
if(trigger.player.judging[0].clone){
trigger.player.judging[0].clone.classList.remove('thrownhighlight');
game.broadcast(function(card){
@ -368,11 +363,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},trigger.player.judging[0]);
game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[0].clone]));
}
await game.cardsDiscard(trigger.player.judging[0]);
game.cardsDiscard(trigger.player.judging[0]);
trigger.player.judging[0]=chooseCardResultCards[0];
trigger.orderingCards.addArray(chooseCardResultCards);
game.log(trigger.player,'的判定牌改为',chooseCardResultCards[0]);
await game.asyncDelay(2);
game.asyncDelay(2);
},
ai:{
rejudge:true,
@ -468,11 +463,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return !event.numFixed;
},
async content(event,trigger,player){
let check;
let i,num=game.countPlayer(function(current){
return current!=player&&current.countCards('h')&&get.attitude(player,current)<=0;
});
check=(num>=2);
let num=game.countPlayer(current=>current!=player&&current.countCards('h')&&get.attitude(player,current)<=0);
let check=num>=2;
const {result:{bool,targets}}=await player.chooseTarget(get.prompt('tuxi'),'获得其他一至两名角色的各一张手牌',[1,2],(card,player,target)=>{
return target.countCards('h')>0&&player!=target;
},target=>{
@ -483,9 +475,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}).set('aicheck',check);
if(!bool) return;
player.logSkill('tuxi',targets);
await player.gainMultiple(targets);
player.gainMultiple(targets);
trigger.changeToZero();
await game.asyncDelay();
game.asyncDelay();
},
ai:{
threaten:2,
@ -498,9 +490,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
check(event,player){
if(player.skipList.includes('phaseUse')||player.countCards('h')<3) return false;
if(!player.hasSha()) return false;
return game.hasPlayer(function(current){
return get.attitude(player,current)<0&&player.canUse('sha',current);
});
return game.hasPlayer(current=>get.attitude(player,current)<0&&player.canUse('sha',current));
},
preHidden:true,
filter(event,player){
@ -530,19 +520,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'judgeEnd'},
preHidden:true,
frequent(event){
if(event.result.card.name=='du') return false;
//if(get.mode()=='guozhan') return false;
return true;
return event.result.card.name!=='du';
},
check(event){
if(event.result.card.name=='du') return false;
return true;
return event.result.card.name!=='du';
},
filter(event,player){
return get.position(event.result.card,true)=='o';
},
async content(event,trigger,player){
await player.gain(trigger.result.card,'gain2');
player.gain(trigger.result.card,'gain2');
}
},
yiji:{
@ -567,7 +555,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
cards.length==1?
{result:{links:cards.slice(0),bool: true}}:
await player.chooseCardButton('遗计:请选择要分配的牌',true,cards,[1,cards.length])
.set('ai',button=>{
.set('ai',()=>{
if(ui.selected.buttons.length==0) return 1;
return 0;
});
@ -604,7 +592,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.line(source,'green');
list.push([source, event.given_map[i]]);
}
await game.loseAsync({
game.loseAsync({
gain_list:list,
giver:player,
animate:'draw',
@ -625,14 +613,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(get.tag(card,'damage')){
if(player.hasSkillTag('jueqing',false,target)) return [1,-2];
if(!target.hasFriend()) return;
var num=1;
let num=1;
if(get.attitude(player,target)>0){
if(player.needsToDiscard()){
num=0.7;
}
else{
num=0.5;
}
if(player.needsToDiscard()) num=0.7;
else num=0.5;
}
if(target.hp>=4) return [1,num*2];
if(target.hp==3) return [1,num*1.5];
@ -674,13 +658,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
}
if(event.cards.length){
await player.gain(event.cards,'gain2');
player.gain(event.cards,'gain2');
}
return;
}
if(!bool){
if(event.cards.length){
await player.gain(event.cards,'gain2');
player.gain(event.cards,'gain2');
}
return;
}
@ -713,13 +697,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
i--;
}
}
await player.gain(event.cards,'gain2');
player.gain(event.cards,'gain2');
player.storage.xinluoshen=event.cards.slice(0);
return;
}
if(!bool){
if(event.cards.length){
await player.gain(event.cards,'gain2');
player.gain(event.cards,'gain2');
player.storage.xinluoshen=event.cards.slice(0);
return;
}
@ -748,16 +732,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
mod:{
aiValue(player,card,num){
if(get.name(card)!='shan'&&get.color(card)!='black') return;
var cards=player.getCards('hs',function(card){
return get.name(card)=='shan'||get.color(card)=='black';
});
cards.sort(function(a,b){
const cards=player.getCards('hs',card=>get.name(card)=='shan'||get.color(card)=='black');
cards.sort((a,b)=>{
return (get.name(b)=='shan'?1:2)-(get.name(a)=='shan'?1:2);
});
var geti=function(){
if(cards.contains(card)){
return cards.indexOf(card);
}
const geti=()=>{
if(cards.includes(card)) cards.indexOf(card);
return cards.length;
};
if(get.name(card)=='shan') return Math.min(num,[6,4,3][Math.min(geti(),2)])*0.6;
@ -809,19 +789,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(ui.selected.cards.length>1) 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;
var player=get.owner(card);
var num=0;
var evt2=_status.event.getParent();
var num=0;
player.getHistory('lose',function(evt){
const player=get.owner(card);
let num=0;
const evt2=_status.event.getParent();
player.getHistory('lose',evt=>{
if(evt.getParent().skill=='rende'&&evt.getParent(3)==evt2) num+=evt.cards.length;
});
if(player.hp==player.maxHp||num>1||player.countCards('h')<=1){
if(ui.selected.cards.length){
return -1;
}
var players=game.filterPlayer();
for(var i=0;i<players.length;i++){
const players=game.filterPlayer();
for(let i=0;i<players.length;i++){
if(players[i].hasSkill('haoshi')&&
!players[i].isTurnedOver()&&
!players[i].hasJudge('lebu')&&
@ -842,8 +821,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.getHistory('lose',evt=>{
if(evt.getParent(2).name=='rende'&&evt.getParent(5)==evt2) num+=evt.cards.length;
});
await player.give(event.cards,event.target);
if(num<2&&num+event.cards.length>1) await player.recover();
player.give(event.cards,event.target);
if(num<2&&num+event.cards.length>1) player.recover();
},
ai:{
order(skill,player){
@ -856,12 +835,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
target(player,target){
if(target.hasSkillTag('nogain')) return 0;
if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){
if(target.hasSkillTag('nodu')) return 0;
return -10;
return target.hasSkillTag('nodu')?0:-10;
}
if(target.hasJudge('lebu')) return 0;
var nh=target.countCards('h');
var np=player.countCards('h');
const nh=target.countCards('h');
const np=player.countCards('h');
if(player.hp==player.maxHp||player.storage.rende<0||player.countCards('h')<=1){
if(nh>=np-1&&np<=player.hp&&!target.hasSkill('haoshi')) return 0;
}
@ -872,8 +850,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
target(card,player,target){
if(player==target&&get.type(card)=='equip'){
if(player.countCards('e',{subtype:get.subtype(card)})){
var players=game.filterPlayer();
for(var i=0;i<players.length;i++){
const players=game.filterPlayer();
for(let i=0;i<players.length;i++){
if(players[i]!=player&&get.attitude(player,players[i])>0){
return 0;
}
@ -899,9 +877,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
group:['jijiang1'],
zhuSkill:true,
filter(event,player){
if(!player.hasZhuSkill('jijiang')||!game.hasPlayer(function(current){
return current!=player&&current.group=='shu';
})) return false;
if(!player.hasZhuSkill('jijiang')||!game.hasPlayer(current=>current!=player&&current.group=='shu')) return false;
return !event.jijiang&&(event.type!='phase'||!player.hasSkill('jijiang3'));
},
enable:['chooseToUse','chooseToRespond'],
@ -914,9 +890,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
respondSha:true,
skillTagFilter(player){
if(!player.hasZhuSkill('jijiang')||!game.hasPlayer(function(current){
return current!=player&&current.group=='shu';
})) return false;
if(!player.hasZhuSkill('jijiang')||!game.hasPlayer(current=>current!=player&&current.group=='shu')) return false;
},
},
},
@ -1003,7 +977,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
prompt:'将一张红色牌当杀使用或打出',
check(card){
var val=get.value(card);
const val=get.value(card);
if(_status.event.name=='chooseToRespond') return 1/Math.max(0.1,val);
return 5-val;
},
@ -1036,7 +1010,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
async content(event,trigger,player){
player.awakenSkill('zhongyi');
player.addTempSkill('zhongyi2','roundStart');
await player.addToExpansion(player,'give',event.cards).gaintag.add('zhongyi2');
player.addToExpansion(player,'give',event.cards).gaintag.add('zhongyi2');
},
},
zhongyi2:{
@ -1050,7 +1024,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
async content(event,trigger,player){trigger.num++},
intro:{content:'expansion',markcount:'expansion'},
onremove(player,skill){
var cards=player.getExpansions(skill);
const cards=player.getExpansions(skill);
if(cards.length) player.loseToDiscardpile(cards);
},
},
@ -1095,7 +1069,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
async content(event,trigger,player){
const num=player.hasSkill('yizhi')&&player.hasSkill('guanxing')?5:Math.min(5,game.countPlayer());
const cards=get.cards(num);
await game.cardsGotoOrdering(cards);
game.cardsGotoOrdering(cards);
const next=player.chooseToMove();
next.set('list',[
['牌堆顶',cards],
@ -1134,7 +1108,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
const top=moved[0];
const bottom=moved[1];
top.reverse();
await game.cardsGotoPile(
game.cardsGotoPile(
top.concat(bottom),
['top_cards',top],
(event,card)=>{
@ -1144,7 +1118,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
);
player.popup(get.cnNumber(top.length)+'上'+get.cnNumber(bottom.length)+'下');
game.log(player,'将'+get.cnNumber(top.length)+'张牌置于牌堆顶');
await game.asyncDelayx();
game.asyncDelayx();
},
ai:{
threaten:1.2
@ -1178,7 +1152,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audioname:['re_zhugeliang'],
filter(event,player){
if(player.countCards('h')) return false;
for(var i=0;i<event.cards.length;i++){
for(let i=0;i<event.cards.length;i++){
if(event.cards[i].original=='h') return true;
}
return false;
@ -1199,7 +1173,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return event.skill=='longdan_sha'||event.skill=='longdan_shan';
},
async content(event,trigger,player){
await player.draw();
player.draw();
player.storage.fanghun2++;
}
},
@ -1327,7 +1301,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return (get.type(event.card)=='trick'&&event.card.isCard);
},
async content(event,trigger,player){
await player.draw();
player.draw();
},
ai:{
threaten:1.4,
@ -1344,7 +1318,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return (get.type(event.card,'trick')=='trick'&&event.cards[0]&&event.cards[0]==event.card);
},
async content(event, trigger, player){
await player.draw();
player.draw();
},
ai:{
threaten:1.4,
@ -1354,8 +1328,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
qicai:{
mod:{
targetInRange(card,player,target,now){
var type=get.type(card);
if(type=='trick'||type=='delay') return true;
if(['trick','delay'].includes(get.type(card))) return true;
}
},
},
@ -1363,8 +1336,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
// alter:true,
mod:{
targetInRange(card,player,target,now){
var type=get.type(card);
if(type=='trick'||type=='delay') return true;
if(['trick','delay'].includes(get.type(card))) return true;
}
},
},
@ -1385,18 +1357,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filterCard:true,
selectCard:[1,Infinity],
check(card){
var player=_status.event.player;
if(get.is.altered('xinzhiheng')&&get.position(card)=='h'&&!player.countCards('h',function(card){
return get.value(card)>=8;
})){
const player=_status.event.player;
if(get.is.altered('xinzhiheng')&&get.position(card)=='h'&&!player.countCards('h',card=>get.value(card)>=8)){
return 8-get.value(card);
}
return 6-get.value(card)
},
delay:0,
async content(event,trigger,player){
if(!player.hasSkill('xinzhiheng_delay')) await game.asyncDelayx();
await player.draw(event.cards.length);
if(!player.hasSkill('xinzhiheng_delay')) game.asyncDelayx();
player.draw(event.cards.length);
},
group:'xinzhiheng_draw',
subSkill:{
@ -1407,7 +1377,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(event.getParent(2).skill!='xinzhiheng') return false;
if(!get.is.altered('xinzhiheng')) return false;
if(player.countCards('h')) return false;
for(var i=0;i<event.cards.length;i++){
for(let i=0;i<event.cards.length;i++){
if(event.cards[i].original=='h') return true;
}
return false;
@ -1455,7 +1425,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return 6-get.value(card)
},
async content(event,trigger,player){
await player.draw(event.cards.length);
player.draw(event.cards.length);
},
ai:{
order:1,
@ -1497,7 +1467,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return true;
},
async content(event,trigger,player){
await player.recover();
player.recover();
},
global:'xinjiuyuan2',
},
@ -1508,7 +1478,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter(event,player){
if(!get.is.altered('xinjiuyuan')) return false;
if(player.group!='wu') return false;
return game.hasPlayer(function(target){
return game.hasPlayer(target=>{
return player!=target&&target.isDamaged()&&target.hp<player.hp&&target.hasZhuSkill('xinjiuyuan',player);
});
},
@ -1521,8 +1491,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
const {result:{bool}}=await player.chooseBool(get.prompt('xinjiuyuan',current)).set('choice',get.attitude(player,current)>0);
if(bool){
player.logSkill('xinjiuyuan',event.current);
await event.current.recover();
await player.draw();
event.current.recover();
player.draw();
}
}
}
@ -1551,8 +1521,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
filter(event,player){
if(player.getHistory('skipped').contains('phaseUse')) return true;
var history=player.getHistory('useCard').concat(player.getHistory('respond'));
for(var i=0;i<history.length;i++){
const history=player.getHistory('useCard').concat(player.getHistory('respond'));
for(let i=0;i<history.length;i++){
if(history[i].card.name=='sha'&&history[i].isPhaseUsing()) return false;
}
return true;
@ -1566,8 +1536,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
enable:'phaseUse',
prompt:'失去1点体力并摸两张牌',
async content(event,trigger,player){
await player.loseHp(1);
await player.draw(2);
player.loseHp(1);
player.draw(2);
},
ai:{
basic:{
@ -1621,19 +1591,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.choice=control;
target.chat('我选'+get.translation(event.choice));
const {result:{bool,cards}}=await target.gainPlayerCard(player,true,'h');
if(bool&&get.suit(cards[0],player)+'2'!=event.choice) await target.damage('nocard');
if(bool&&get.suit(cards[0],player)+'2'!=event.choice) target.damage('nocard');
},
ai:{
order:1,
result:{
target(player,target){
var eff=get.damageEffect(target,player);
const eff=get.damageEffect(target,player);
if(eff>=0) return 1+eff;
var value=0,i;
var cards=player.getCards('h');
for(i=0;i<cards.length;i++){
value+=get.value(cards[i]);
}
let value=0,i;
const cards=player.getCards('h');
for(i=0;i<cards.length;i++) value+=get.value(cards[i]);
value/=player.countCards('h');
if(target.hp==1) return Math.min(0,value-7);
return Math.min(0,value-5);
@ -1667,7 +1635,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter(event,player){
if(event.card.name!='sha') return false;
if(player.countCards('he')==0) return false;
return game.hasPlayer(function(current){
return game.hasPlayer(current=>{
return player.inRange(current)&&current!=event.player&&
current!=player&&lib.filter.targetEnabled(event.card,event.player,current);
});
@ -1707,7 +1675,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(bool){
const target=targets[0];
player.logSkill(event.name,target);
await player.discard(cards);
player.discard(cards);
const evt=trigger.getParent();
evt.triggeredTargets2.remove(player);
evt.targets.remove(player);
@ -1719,11 +1687,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
target(card,player,target){
if(target.countCards('he')==0) return;
if(card.name!='sha') return;
var min=1;
var friend=get.attitude(player,target)>0;
var vcard={name:'shacopy',nature:card.nature,suit:card.suit};
var players=game.filterPlayer();
for(var i=0;i<players.length;i++){
let min=1;
const friend=get.attitude(player,target)>0;
const vcard={name:'shacopy',nature:card.nature,suit:card.suit};
const players=game.filterPlayer();
for(let i=0;i<players.length;i++){
if(player!=players[i]&&
get.attitude(target,players[i])<0&&
target.canUse(card,players[i])){
@ -1758,11 +1726,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
frequent:true,
filter(event,player){
if(player.countCards('h')) return false;
var evt=event.getl(player);
const evt=event.getl(player);
return evt&&evt.player==player&&evt.hs&&evt.hs.length>0;
},
async content(event,trigger,player){
await player.draw();
player.draw();
},
ai:{
threaten:0.8,
@ -1788,23 +1756,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
frequent:true,
filter(event,player){
var evt=event.getl(player);
const evt=event.getl(player);
return evt&&evt.player==player&&evt.es&&evt.es.length>0;
},
async content(event,trigger,player){
event.count=trigger.getl(player).es.length;
while(true){
event.count--;
await player.draw(2);
if(event.count>0&&player.hasSkill(event.name)&&!get.is.blocked(event.name,player)){
do {
player.draw(2);
if(!player.hasSkill(event.name)) break;
if(!get.is.blocked(event.name,player)){
const chooseBoolEvent=player.chooseBool(get.prompt2('xiaoji')).set('frequentSkill','xiaoji');
chooseBoolEvent.ai=lib.filter.all;
const {result:{bool}}=await chooseBoolEvent;
if(bool){
player.logSkill('xiaoji');
}else break;
}
if(bool) player.logSkill('xiaoji');
else break;
}
}while(event.count-->0);
},
ai:{
noe:true,
@ -1823,12 +1790,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
usable:1,
selectCard:2,
check(card){
var player=get.owner(card);
if(player.countCards('h')>player.hp)
return 8-get.value(card)
if(player.hp<player.maxHp)
return 6-get.value(card)
return 4-get.value(card)
const player=get.owner(card);
if(player.countCards('h')>player.hp) return 8-get.value(card);
if(player.hp<player.maxHp) return 6-get.value(card);
return 4-get.value(card);
},
filterTarget(card,player,target){
if(!target.hasSex('male')) return false;
@ -1837,8 +1802,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return true;
},
async content(event,trigger,player){
await player.recover();
await event.target.recover();
player.recover();
event.target.recover();
},
ai:{
order:5.5,
@ -1868,15 +1833,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return player.countCards('he')>0;
},
check(card){
var player=_status.event.player;
const player=_status.event.player;
if(get.position(card)=='e'){
var subtype=get.subtype(card);
if(!game.hasPlayer(function(current){
return current!=player&&current.hp!=player.hp&&get.attitude(player,current)>0&&!current.countCards('e',{subtype:subtype});
const subtype=get.subtype(card);
if(!game.hasPlayer(current=>{
return current!=player&&current.hp!=player.hp&&get.attitude(player,current)>0&&!current.countCards('e',{subtype});
})){
return 0;
}
if(player.countCards('h',{subtype:subtype})) return 20-get.value(card);
// 你还想我兼容{subtype:subtype}?不可能!
if(player.countCards('h',{subtype})) return 20-get.value(card);
return 10-get.value(card);
}
else{
@ -1887,7 +1853,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
filterTarget(card,player,target){
if(!target.hasSex('male')) return false;
var card=ui.selected.cards[0];
card=ui.selected.cards[0];
if(!card) return false;
if(get.position(card)=='e'&&target.countCards('e',{subtype:get.subtype(card)})) return false;
return true;
@ -1899,34 +1865,34 @@ game.import('character',function(lib,game,ui,get,ai,_status){
const {cards,target}=event;
if(get.position(cards[0])=='e'){
player.$give(cards,target);
await target.equip(cards[0]);
target.equip(cards[0]);
}
else{
await player.discard(cards);
player.discard(cards);
}
if(player.hp>target.hp){
await player.draw();
if(target.isDamaged()) await target.recover();
player.draw();
if(target.isDamaged()) target.recover();
}
else if(player.hp<target.hp){
await target.draw();
if (player.isDamaged()) await player.recover();
target.draw();
if (player.isDamaged()) player.recover();
}
},
ai:{
order(){
var player=_status.event.player;
var es=player.getCards('e');
for(var i=0;i<es.length;i++){
const player=_status.event.player;
const es=player.getCards('e');
for(let i=0;i<es.length;i++){
if(player.countCards('h',{subtype:get.subtype(es[i])})) return 10;
}
return 2;
},
result:{
target(player,target){
var goon=function(){
var es=player.getCards('e');
for(var i=0;i<es.length;i++){
const goon=()=>{
const es=player.getCards('e');
for(let i=0;i<es.length;i++){
if(player.countCards('h',{subtype:get.subtype(es[i])})) return true;
}
return false;
@ -1961,12 +1927,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return player.countCards('h')>=2;
},
check(card){
var player=get.owner(card);
if(player.countCards('h')>player.hp)
return 8-get.value(card)
if(player.hp<player.maxHp)
return 6-get.value(card)
return 4-get.value(card)
const player=get.owner(card);
if(player.countCards('h')>player.hp) return 8-get.value(card);
if(player.hp<player.maxHp) return 6-get.value(card);
return 4-get.value(card);
},
filterTarget(card,player,target){
if(!target.hasSex('male')) return false;
@ -1975,8 +1939,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return true;
},
async content(event,trigger,player){
await player.recover();
await event.target.recover();
player.recover();
event.target.recover();
},
ai:{
order:5.5,
@ -2001,14 +1965,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filterCard:true,
usable:1,
check(card){
return 9-get.value(card)
return 9-get.value(card);
},
filterTarget(card,player,target){
if(target.hp>=target.maxHp) return false;
return true;
},
async content(event,trigger,player){
await event.target.recover();
event.target.recover();
},
ai:{
order:9,
@ -2026,16 +1990,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
mod:{
aiValue(player,card,num){
if(get.name(card)!='tao'&&get.color(card)!='red') return;
var cards=player.getCards('hs',function(card){
return get.name(card)=='tao'||get.color(card)=='red';
});
cards.sort(function(a,b){
return (get.name(a)=='tao'?1:2)-(get.name(b)=='tao'?1:2);
});
var geti=function(){
if(cards.contains(card)){
return cards.indexOf(card);
}
const cards=player.getCards('hs',card=>get.name(card)=='tao'||get.color(card)=='red');
cards.sort((a,b)=>(get.name(a)=='tao'?1:2)-(get.name(b)=='tao'?1:2));
var geti=()=>{
if(cards.includes(card)) cards.indexOf(card);
return cards.length;
};
return Math.max(num,[6.5,4,3,2][Math.min(geti(),2)]);
@ -2077,7 +2035,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'useCardToPlayered'},
forced:true,
filter(event,player){
return event.card.name=='sha'&&!event.getParent().directHit.contains(event.target);
return event.card.name=='sha'&&!event.getParent().directHit.includes(event.target);
},
//priority:-1,
logTarget:'target',
@ -2134,15 +2092,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
skillAnimation:true,
animationColor:'gray',
filter(event,player){
return player.isDamaged()&&game.dead.filter(function(target){
return target.isFriendOf(player);
}).length>0
return player.isDamaged()&&game.dead.filter(target=>target.isFriendOf(player)).length>0
},
async content(event,trigger,player){
player.awakenSkill('zhanshen');
const cards=player.getEquips(1);
if(cards.length) await player.discard(cards);
await player.loseMaxHp();
if(cards.length) player.discard(cards);
player.loseMaxHp();
player.addSkill('mashu');
player.addSkill('shenji');
},
@ -2165,9 +2121,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
enable:'phaseUse',
usable:1,
filter(event,player){
return game.countPlayer(function(current){
return current!=player&&current.hasSex('male');
})>1;
return game.countPlayer(current=>current!=player&&current.hasSex('male'))>1;
},
check(card){return 10-get.value(card)},
filterCard:true,
@ -2186,8 +2140,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
async content(event,trigger,player){
const useCardEvent=event.targets[1].useCard({name:'juedou',isCard:true},'nowuxie',event.targets[0],'noai');
useCardEvent.animate=false;
await useCardEvent;
await game.asyncDelay(0.5);
game.asyncDelay(0.5);
},
ai:{
order:8,
@ -2211,7 +2164,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
frequent:true,
preHidden:true,
async content(event,trigger,player){
await player.draw();
player.draw();
},
},
xinbiyue:{
@ -2220,7 +2173,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
frequent:true,
// alter:true,
async content(event,trigger,player){
await player.draw(1);
player.draw();
},
},
yaowu:{
@ -2236,7 +2189,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true,
check(){return false;},
async content(event,trigger,player){
await trigger.source.chooseDrawRecover(true);
trigger.source.chooseDrawRecover(true);
},
ai:{
effect:{
@ -2273,12 +2226,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return 'cancel2';
}).set('prompt',get.prompt2('new_jiangchi'));
if(control=='弃牌'){
await player.chooseToDiscard(true,'he');
player.chooseToDiscard(true,'he');
player.addTempSkill('jiangchi2','phaseUseEnd');
player.logSkill('new_jiangchi');
}
else if(control=='摸牌'){
await player.draw();
player.draw();
player.addTempSkill('new_jiangchi3','phaseEnd');
player.logSkill('new_jiangchi');
}
@ -2293,14 +2246,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(card.name=='sha') return false;
},
ignoredHandcard(card,player){
if(get.name(card)=='sha'){
return true;
}
if(get.name(card)=='sha') return true;
},
cardDiscardable(card,player,name){
if(name=='phaseDiscard'&&get.name(card)=='sha'){
return false;
}
if(name=='phaseDiscard'&&get.name(card)=='sha') return false;
},
},
},
@ -2310,7 +2259,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:2,
async content(event,trigger,player){
const card=get.bottomCards()[0];
await game.cardsGotoOrdering(card);
game.cardsGotoOrdering(card);
event.card=card;
const {result:{bool,targets}}=await player.chooseTarget(true).set('ai',target=>{
let att=get.attitude(_status.event.player,target);
@ -2332,7 +2281,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.line(target,'green');
const gainEvent=target.gain(card,'draw');
gainEvent.giver=player;
await gainEvent;
}
},
ai:{
@ -2353,9 +2301,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(event.name=='gain'){
return event.player!=player&&event.getg(event.player).length>0;
}
return game.hasPlayer(function(current){
return current!=player&&event.getg(current).length>0;
});
return game.hasPlayer(current=>current!=player&&event.getg(current).length>0);
},
direct:true,
async content(event,trigger,player){
@ -2370,7 +2316,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
});
if(bool){
player.logSkill('xinfu_jiyuan',target);
await target.draw();
target.draw();
}
}while(event.targets.length>0);
},

View File

@ -4,7 +4,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
name:'xianding',
connect:true,
character:{
zhangjian:['male','qun',105,['dc_zj_a','dc_zj_b']],
dc_sb_zhouyu:['male','wu',4,['dcsbronghuo','dcsbyingmou']],
dc_sb_lusu:['male','wu',3,['dcsbmingshi','dcsbmengmou']],
zhangjian:['male','qun',105,['dc_zj_a','dc_zj_b'],['unseen']],
zhugeruoxue:['female','wei',3,['dcqiongying','dcnuanhui']],
caoyi:['female','wei',4,['dcmiyi','dcyinjun']],
malingli:['female','shu',3,['dclima','dcxiaoyin','dchuahuo']],
@ -80,7 +82,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
re_liuzan:['male','wu',4,['refenyin','liji']],
wenyang:['male','wei',5,['xinlvli','choujue']],
wangshuang:['male','wei',8,['spzhuilie']],
huaman:['female','shu',3,['hmmanyi','mansi','souying','zhanyuan']],
huaman:['female','shu',3,['manyi','mansi','souying','zhanyuan']],
puyuan:['male','shu',4,['pytianjiang','pyzhuren']],
guanlu:['male','wei',3,['tuiyan','busuan','mingjie']],
gexuan:['male','wu',3,['gxlianhua','zhafu']],
@ -103,9 +105,308 @@ game.import('character',function(lib,game,ui,get,ai,_status){
sp2_qifu:['dc_guansuo','xin_baosanniang','dc_zhaoxiang'],
sp2_gaoshan:['wanglang','liuhui','zhangjian'],
sp2_wumiao:['wu_zhugeliang','wu_luxun'],
sp2_mouding:['dc_sb_lusu','dc_sb_zhouyu'],
}
},
skill:{
//周瑜
//无 双 万 军 取 首
dcsbronghuo:{
audio:2,
trigger:{player:'useCard'},
filter:function(event,player){
return (event.card.name=='sha'&&game.hasNature(event.card,'fire'))||event.card.name=='huogong';
},
forced:true,
content:function(){
trigger.baseDamage=game.countGroup();
},
ai:{threaten:3.5},
},
dcsbyingmou:{
mark:true,
marktext:'☯',
zhuanhuanji:true,
intro:{
content:function(storage){
if(!storage) return '每回合限一次,当你使用牌指定第一个目标后,你可以选择一名目标角色,你将手牌数摸至与其相同(至多摸五张),然后视为对其使用一张【火攻】。'
return '每回合限一次,当你使用牌指定第一个目标后,你可以选择一名目标角色,令一名手牌数为全场最大的角色对其使用手牌中所有的【杀】和伤害类锦囊牌(若其没有可使用的牌则将手牌数弃至与你相同)。';
},
},
audio:2,
trigger:{player:'useCardToPlayered'},
filter:function(event,player){
return event.isFirstTarget;
},
usable:1,
direct:true,
content:function*(event,map){
var result,player=map.player,targets=map.trigger.targets;
var storage=player.storage.dcsbyingmou;
if(storage){
result=yield player.chooseCardTarget({
prompt:get.prompt('dcsbyingmou'),
prompt2:'选择一名目标角色,令一名手牌数为全场最大的角色对其使用手牌中所有的【杀】和伤害类锦囊牌(若其没有可使用的牌则将手牌数弃至与你相同)',
filterTarget:function(card,player,target){
if(!ui.selected.targets.length) return _status.event.targets.includes(target);
return target.isMaxHandcard();
},
selectTarget:2,
complexSelect:true,
complexTarget:true,
multitarget:true,
targetprompt:['目标角色','使用角色'],
filterCard:()=>false,
selectCard:-1,
ai2:function(target){
var player=_status.event.player;
var getNum=function(player,target,source){
return player.getCards('h',card=>{
if(get.name(card)!='sha'&&(get.type(card)!='trick'||!get.tag(card,'damage'))) return false;
return player.canUse(card,target,false);
}).reduce((sum,card)=>sum+get.effect(target,card,player,source),0);
};
if(!ui.selected.targets.length){
var targets=game.filterPlayer(target=>target.isMaxHandcard());
targets.sort((a,b)=>getNum(b,target,player)-getNum(a,target,player));
return getNum(targets[0],target,player)+1;
}
return getNum(target,ui.selected.targets[0],player)+1;
},
}).set('targets',targets);
}
else result=yield player.chooseTarget(get.prompt('dcsbyingmou'),'选择一名目标角色,将手牌数摸至与其相同,然后视为对其使用一张【火攻】',(card,player,target)=>_status.event.targets.includes(target)).set('ai',target=>{
var player=_status.event.player;
return Math.max(0,Math.min(5,target.countCards('h')-player.countCards('h')))*2+get.effect(target,{name:'huogong'},player,player);
}).set('targets',targets);
if(result.bool){
var target=result.targets[0];
if(storage){
player.logSkill('dcsbyingmou',result.targets,false);
player.line2(result.targets);
player.changeZhuanhuanji('dcsbyingmou');
var source=result.targets[1],discard=true;
while(true){
var cards=source.getCards('h',card=>{
if(get.name(card)!='sha'&&(get.type(card)!='trick'||!get.tag(card,'damage'))) return false;
return source.canUse(card,target,false);
});
if(cards.length){
if(discard) discard=false;
yield source.useCard(cards.randomGet(),target,false);
}
else break;
}
if(discard&&player.countCards('h')<source.countCards('h')) source.chooseToDiscard(source.countCards('h')-player.countCards('h'),'h',true);
}
else{
player.logSkill('dcsbyingmou',target);
player.changeZhuanhuanji('dcsbyingmou');
if(player.countCards('h')<target.countCards('h')) player.draw(Math.min(5,target.countCards('h')-player.countCards('h')));
if(player.canUse({name:'huogong'},target,false)) player.useCard({name:'huogong'},target,false);
}
}
else player.storage.counttrigger.dcsbyingmou--;
},
},
//鲁肃
dcsbmingshi:{
audio:2,
trigger:{player:'phaseDrawBegin2'},
filter:function(event,player){
return !event.numFixed;
},
frequent:true,
content:function(){
trigger.num+=2;
player.when('phaseDrawEnd').filter((evt,player)=>evt==trigger&&player.countCards('h')).then(()=>{
var str='明势:请展示三张牌并令一名其他角色选择获得其中的一张牌';
if(player.countCards('h')<=3) str='明势:展示手牌并令一名其他角色选择获得其中的一张牌';
player.chooseCardTarget({
prompt:str,
filterTarget:lib.filter.notMe,
filterCard:true,
selectCard:function(){
var player=_status.event.player;
if(player.countCards('h')<=3) return -1;
return 3;
},
position:'h',
forced:true,
ai1:function(card){
return -get.value(card);
},
ai2:function(target){
var player=_status.event.player;
if(player.hasSkill('dcsbmengmou')&&!get.is.blocked('dcsbmengmou',player)&&player.storage.dcsbmengmou&&get.attitude(player,target)<0) return get.effect(target,{name:'losehp'},player,player);
return get.attitude(player,target);
},
});
}).then(()=>{
if(result.bool){
var target=result.targets[0];
event.target=target;
var cards=result.cards;
player.showCards(cards,get.translation(player)+'发动了【明势】');
target.chooseButton(['明势:请获得其中一张牌',cards],true).set('filterButton',button=>{
return lib.filter.canBeGained(button.link,_status.event.source,_status.event.player);
}).set('ai',button=>get.value(button.link)).set('source',player);
}
else event.finish();
}).then(()=>{
if(result.bool){
var card=result.links[0];
if(lib.filter.canBeGained(card,player,target)) target.gain(card,player,'giveAuto');
else game.log('但',card,'不能被',player,'获得!');
}
});
},
},
dcsbmengmou:{
mark:true,
marktext:'☯',
zhuanhuanji:true,
intro:{
content:function(storage){
if(!storage) return '每回合限一次当你得到其他角色的牌后你可以令该角色使用至多X张【杀】且其每以此法造成1点伤害其回复1点体力。X为你的体力值'
return '每回合限一次其他角色得到你的牌后你可令该角色打出至多X张【杀】然后其失去Y点体力。X为你的体力值Y为X-其打出【杀】数)';
},
},
audio:2,
trigger:{global:['gainAfter','loseAsyncAfter']},
filter:function(event,player){
if(!player.getHp()) return false;
if(event.name=='loseAsync'&&event.type!='gain') return false;
var storage=player.storage.dcsbmengmou;
var cards;
if(storage){
if(player.hasSkill('dcsbmengmou_true')) return false;
cards=event.getl(player).cards2;
return game.hasPlayer(function(current){
if(current==player) return false;
var cardsx=event.getg(current);
return cardsx.some(i=>cards.includes(i));
});
}
else cards=event.getg(player);
if(player.hasSkill('dcsbmengmou_false')) return false;
return game.hasPlayer(function(current){
if(current==player) return false;
var cardsx=event.getl(current).cards2;
return cards.some(i=>cardsx.includes(i));
});
},
direct:true,
content:function*(event,map){
var player=map.player,trigger=map.trigger;
var storage=player.storage.dcsbmengmou;
player.addTempSkill('dcsbmengmou_effect','dcsbmengmouAfter');
var targets,cards,num=player.getHp();
if(storage){
cards=trigger.getl(player).cards2;
targets=game.filterPlayer(function(current){
if(current==player) return false;
var cardsx=trigger.getg(current);
return cardsx.some(i=>cards.includes(i));
});
}
else{
cards=trigger.getg(player);
targets=game.filterPlayer(function(current){
if(current==player) return false;
var cardsx=trigger.getl(current).cards2;
return cards.some(i=>cardsx.includes(i));
});
}
var check_true=function(player,target){
if(get.attitude(player,target)>0){
if(target.countCards('hs',card=>{
if(get.name(card)!='sha') return false;
return target.hasValueTarget(card);
})) return 4;
return 0.5;
}
if(get.attitude(player,target)<0){
if(!target.countCards('hs',card=>{
if(get.name(card)!='sha') return false;
return target.hasValueTarget(card);
})){
if(target.countCards('hs',card=>{
if(get.name(card)!='sha') return false;
return target.hasUseTarget(card);
})) return -3;
return -1;
}
return 0;
}
return 0;
};
var check_false=function(player,target){
if(get.attitude(player,target)<0) return get.effect(target,{name:'losehp'},player,player);
return 0;
};
var result,target;
if(targets.length==1){
target=targets[0];
var str;
if(storage) str='令'+get.translation(target)+'打出至多'+get.cnNumber(num)+'张【杀】然后其失去Y点体力。Y为'+num+'-其打出【杀】数)';
else str='令'+get.translation(target)+'使用至多'+get.cnNumber(num)+'张【杀】其每以此法造成1点伤害其回复1点体力';
result=yield player.chooseBool(get.prompt('dcsbmengmou',target),str).set('choice',(storage?check_true(player,target):check_false(player,target))>0);
}
else{
result=yield player.chooseTarget(get.prompt('dcsbmengmou'),lib.skill.dcsbmengmou.intro.content(storage),(card,player,target)=>_status.event.targets.includes(target)).set('ai',target=>{
return _status.event.check(_status.event.player,target);
}).set('targets',targets).set('check',storage?check_true:check_false).set('ainmate',false);
}
if(result.bool){
if(!target) target=result.targets[0];
player.logSkill('dcsbmengmou',target);
player.addTempSkill('dcsbmengmou_'+(storage||false));
player.changeZhuanhuanji('dcsbmengmou');
while(num>0){
num--;
var result2;
if(storage){
result2=yield target.chooseToRespond((card,player)=>{
return get.name(card)=='sha';
}).set('ai',card=>{
return 1+Math.random();
}).set('prompt','盟谋:是否打出一张【杀】?').set('prompt2','当前进度:'+(3-num)+'/3');
}
else result2=yield target.chooseToUse(card=>{
if(!lib.filter.cardEnabled(card,_status.event.player,_status.event)) return false;
return get.name(card)=='sha';
}).set('prompt','盟谋:是否使用一张【杀】?').set('prompt2','当前进度:'+(3-num)+'/3');
if(!result2.bool){
if(storage){
target.popup('杯具');
target.loseHp(num+1);
}
break;
}
}
}
},
subSkill:{
effect:{
charlotte:true,
trigger:{global:'damageSource'},
filter:function(event,player){
if(event.getParent().type!='card') return false;
if(event.source.isHealthy()||event.card.name!='sha') return false;
return event.getParent(4).name=='dcsbmengmou'&&event.getParent(4).player==player;
},
forced:true,
popup:false,
firstDo:true,
content:function(){
trigger.source.recover(trigger.num);
},
},
true:{charlotte:true},
false:{charlotte:false},
},
},
//张臶
dc_zj_a:{
audio:2,
@ -11613,19 +11914,38 @@ game.import('character',function(lib,game,ui,get,ai,_status){
//花鬘
manyi:{
audio:2,
audioname:['mengyou'],
},
hmmanyi:{
audioname:['mengyou','menghuo','zhurong'],
trigger:{target:'useCardToBefore'},
forced:true,
audio:'manyi',
audioname:['mengyou'],
filter:function(event,player){
return event.card.name=='nanman';
},
forced:true,
content:function(){
trigger.cancel();
},
ai:{
effect:{
target:function(card){
if(card.name=='nanman') return 'zerotarget';
},
},
},
group:'manyi_single',
subSkill:{
single:{
trigger:{
player:'enterGame',
global:'gameDrawAfter',
},
filter:function(event,player){
return get.mode()=='single'&&_status.mode=='normal';
},
direct:true,
content:function(){
player.chooseUseTarget('nanman',get.prompt('manyi'),'视为使用一张【南蛮入侵】').logSkill='manyi';
},
},
},
},
mansi:{
audio:2,
@ -12876,6 +13196,29 @@ game.import('character',function(lib,game,ui,get,ai,_status){
dczhangcai:function(player){
return '当你使用或打出'+(player.hasSkill('dczhangcai_all')?'':'点数为8的')+'牌时你可以摸X张牌X为你手牌区里'+(player.hasSkill('dczhangcai_all')?'与此牌点数相同':'点数为8')+'的牌数且至少为1。';
},
dcsbmengmou:function(player){
var storage=player.storage.dcsbmengmou;
var str='转换技,每回合每项各限一次:';
if(!storage) str+='<span class="bluetext">';
str+='阴当你得到其他角色的牌后你可以令该角色使用至多X张【杀】且其每以此法造成1点伤害其回复1点体力';
if(!storage) str+='</span>';
if(storage) str+='<span class="bluetext">';
str+='阳其他角色得到你的牌后你可令该角色打出至多X张【杀】然后其失去Y点体力。';
if(storage) str+='</span>';
str+='X为你的体力值Y为X-其打出【杀】数)';
return str;
},
dcsbyingmou:function(player){
var storage=player.storage.dcsbyingmou;
var str='转换技,每回合限一次,当你使用牌指定第一个目标后,你可以选择一名目标角色:';
if(!storage) str+='<span class="bluetext">';
str+='阴,你将手牌数摸至与其相同(至多摸五张),然后视为对其使用一张【火攻】;';
if(!storage) str+='</span>';
if(storage) str+='<span class="bluetext">';
str+='阳,令一名手牌数为全场最大的角色对其使用手牌中所有的【杀】和伤害类锦囊牌(若其没有可使用的牌则将手牌数弃至与你相同)。';
if(storage) str+='</span>';
return str;
},
},
characterReplace:{
wenyang:['wenyang','db_wenyang','diy_wenyang'],
@ -12931,8 +13274,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
wlcuorui_info_identity:'出牌阶段开始时你可以弃置一名你至其的距离不大于1的角色区域里的一张牌然后你选择一项1.弃置另一名其他角色装备区里至多两张与此牌颜色相同的牌2.展示另一名其他角色的至多两张手牌,然后获得其中与此牌颜色相同的牌。',
wlcuorui_info_guozhan:'出牌阶段开始时你可以弃置一名你至其的距离不大于1的角色区域里的一张牌然后你选择一项1.弃置另一名其他角色装备区里至多两张与此牌颜色相同的牌2.展示另一名其他角色的至多两张手牌,然后获得其中与此牌颜色相同的牌。',
huaman:'花鬘',
hmmanyi:'蛮裔',
hmmanyi_info:'锁定技,【南蛮入侵】对你无效。',
manyi:'蛮裔',
manyi_info:'锁定技,【南蛮入侵】对你无效。',
manyi_info_single_normal:'锁定技,【南蛮入侵】对你无效。当你登场时,你可以视为使用一张【南蛮入侵】。',
mansi_viewas:'蛮嗣',
mansi:'蛮嗣',
mansi_info:'出牌阶段限一次,你可以将所有手牌当做【南蛮入侵】使用;当有角色受到【南蛮入侵】的伤害后,你摸一张牌。',
@ -13386,6 +13730,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){
dc_zj_a_info:'锁定技。当你受到牌造成的伤害时,若此牌有点数,则你将此伤害值改为此牌点数,否则你防止此伤害。',
dc_zj_b:'技能',
dc_zj_b_info:'结束阶段,你可以弃置所有牌并令一名其他角色获得〖技能〗直到你的下个回合开始。',
dc_sb_lusu:'新杀谋鲁肃',
dc_sb_lusu_prefix:'新杀谋',
dcsbmingshi:'明势',
dcsbmingshi_info:'摸牌阶段,你可以多摸两张牌,然后令展示三张牌并令一名其他角色选择获得其中的一张牌。',
dcsbmengmou:'盟谋',
dcsbmengmou_info:'转换技每回合每项各限一次当你得到其他角色的牌后你可以令该角色使用至多X张【杀】且其每以此法造成1点伤害其回复1点体力其他角色得到你的牌后你可令该角色打出至多X张【杀】然后其失去Y点体力。X为你的体力值Y为X-其打出【杀】数)',
dc_sb_zhouyu:'新杀谋周瑜',
dc_sb_zhouyu_prefix:'新杀谋',
dcsbronghuo:'融火',
dcsbronghuo_info:'锁定技,当你使用火【杀】或【火攻】时,此牌伤害基值改为场上势力数。',
dcsbyingmou:'英谋',
dcsbyingmou_info:'转换技,每回合限一次,当你使用牌指定第一个目标后,你可以选择一名目标角色:阴,你将手牌数摸至与其相同(至多摸五张),然后视为对其使用一张【火攻】;阳,令一名手牌数为全场最大的角色对其使用手牌中所有的【杀】和伤害类锦囊牌(若其没有可使用的牌则将手牌数弃至与你相同)。',
sp2_yinyu:'隐山之玉',
sp2_huben:'百战虎贲',
@ -13401,6 +13757,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
sp2_wumiao:'武庙',
sp2_gaoshan:'高山仰止',
sp2_qifu:'祈福',
sp2_mouding:'谋定天下',
},
};
});

View File

@ -5114,7 +5114,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
jyzongshi:{
audio:2,
audioname:['re_jianyong','ol_jianyong'],
audioname:['re_jianyong'],
trigger:{player:['chooseToCompareAfter','compareMultipleAfter'],target:['chooseToCompareAfter','compareMultipleAfter']},
filter:function(event,player){
if(event.preserve) return false;

63889
game/game.js

File diff suppressed because it is too large Load Diff

BIN
image/character/caoyi.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -1935,10 +1935,20 @@ div:not(.handcards)>.card>.info>span,
padding: 0;
}
div:has(>div.skill):only-child {
display: flex;
flex-wrap: nowrap;
}
.skill {
left: 0 !important;
width: 70px !important;
white-space: nowrap;
flex: 0 0 70px !important;
word-break: break-word;
/* width: 70px !important;
white-space: nowrap; */
}
.skill+div {
flex: 1;
word-break: break-word;
}
.skilln {
left: 0 !important;

View File

@ -143,6 +143,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
},
start:function(){
"step 0"
_status.mode=_status.connectMode?lib.configOL.single_mode:get.config('single_mode');
var playback=localStorage.getItem(lib.configprefix+'playback');
if(playback){
ui.create.me();
@ -172,7 +173,6 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
});
}
"step 2"
_status.mode=_status.connectMode?lib.configOL.single_mode:get.config('single_mode');
if(_status.mode=='normal'){
lib.card.list=lib.singlePile.slice(0);
game.fixedPile=true;
@ -883,35 +883,6 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
},
},
skill:{
manyi:{
audio:2,
trigger:{target:'useCardToBefore'},
forced:true,
filter:function(event,player){
return event.card.name=='nanman';
},
content:function(){
trigger.cancel();
},
ai:{
effect:{
target:function(card){
if(card.name=='nanman') return 'zerotarget';
},
},
},
group:'manyi2',
},
manyi2:{
trigger:{
player:'enterGame',
global:'gameDrawAfter',
},
direct:true,
content:function(){
player.chooseUseTarget('nanman',get.prompt('manyi'),'视为使用一张【南蛮入侵】').logSkill='manyi';
},
},
wanrong:{
audio:2,
trigger:{target:'useCardToTargeted'},
@ -1191,8 +1162,6 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
changban2:'血战长坂坡',
dianjiang2:'点将单挑',
manyi:'蛮裔',
manyi_info:'锁定技,【南蛮入侵】对你无效。当你登场时,你可以视为使用一张【南蛮入侵】。',
wanrong:'婉容',
wanrong_info:'当你成为【杀】的目标后,你可以摸一张牌。',
sgzhiheng:'制衡',

View File

@ -1,11 +1,13 @@
import { ai } from './noname/ai.js';
import { Game as game } from './noname/game.js';
import { Get as get } from './noname/get.js';
import { Library as lib } from './noname/library.js';
import { status as _status } from './noname/status.js';
import { UI as ui } from './noname/ui.js';
import { GNC as gnc } from './noname/gnc/index.js';
import { AI as ai } from './noname/ai/index.js';
import { Game as game } from './noname/game/index.js';
import { Get as get } from './noname/get/index.js';
import { Library as lib } from './noname/library/index.js';
import { status as _status } from './noname/status/index.js';
import { UI as ui } from './noname/ui/index.js';
export {
gnc,
ai,
game,
get,

View File

@ -1,7 +0,0 @@
import { Basic } from "./ai/basic.js";
import { Get } from "./get.js";
export const ai = {
basic: Basic,
get: Get
};

View File

@ -1,32 +1,30 @@
import { Game } from "../game.js";
import { Get } from "../get.js";
import { status } from "../status.js";
import { Click } from "../ui/click.js";
import { selected } from "../ui/selected.js";
export class Basic {
constructor() {
throw new TypeError(`${new.target.name} is not a constructor`);
}
import { Get as get } from '../get/index.js';
import { Game as game } from '../game/index.js';
import { status as _status } from '../status/index.js';
import { UI as ui } from '../ui/index.js';
import { Library as lib } from '../library/index.js';
import { GNC as gnc } from '../gnc/index.js';
import { Uninstantable } from "../util/index.js";
export class Basic extends Uninstantable {
static chooseButton(check) {
var event = status.event;
var event = _status.event;
var i, j, range, buttons, buttons2;
var ok = false, forced = event.forced;
var iwhile = 100;
while (iwhile--) {
range = Get.select(event.selectButton);
if (selected.buttons.length >= range[0]) {
range = get.select(event.selectButton);
if (ui.selected.buttons.length >= range[0]) {
ok = true;
}
if (range[1] <= -1) {
j = 0;
for (i = 0; i < selected.buttons.length; i++) {
j += check(selected.buttons[i]);
for (i = 0; i < ui.selected.buttons.length; i++) {
j += check(ui.selected.buttons[i]);
}
return (j > 0);
}
buttons = Get.selectableButtons();
buttons = get.selectableButtons();
if (buttons.length == 0) {
return ok;
}
@ -49,41 +47,40 @@ export class Basic {
}
}
buttons[ix].classList.add('selected');
selected.buttons.add(buttons[ix]);
Game.check();
if (selected.buttons.length >= range[0]) {
ui.selected.buttons.add(buttons[ix]);
game.check();
if (ui.selected.buttons.length >= range[0]) {
ok = true;
}
if (selected.buttons.length == range[1]) {
if (ui.selected.buttons.length == range[1]) {
return true;
}
}
}
static chooseCard(check) {
var event = status.event;
var event = _status.event;
if (event.filterCard == undefined) return (check() > 0);
var i, j, range, cards, cards2, skills, check, effect;
var ok = false, forced = event.forced;
var iwhile = 100;
while (iwhile--) {
range = Get.select(event.selectCard);
if (selected.cards.length >= range[0]) {
range = get.select(event.selectCard);
if (ui.selected.cards.length >= range[0]) {
ok = true;
}
if (range[1] <= -1) {
if (selected.cards.length == 0) return true;
if (ui.selected.cards.length == 0) return true;
j = 0;
for (i = 0; i < selected.cards.length; i++) {
effect = check(selected.cards[i]);
for (i = 0; i < ui.selected.cards.length; i++) {
effect = check(ui.selected.cards[i]);
if (effect < 0) j -= Math.sqrt(-effect);
else j += Math.sqrt(effect);
}
return (j > 0);
}
cards = Get.selectableCards();
if (!status.event.player._noSkill) {
cards = cards.concat(Get.skills());
cards = get.selectableCards();
if (!_status.event.player._noSkill) {
cards = cards.concat(get.skills());
}
if (cards.length == 0) {
return ok;
@ -107,11 +104,11 @@ export class Basic {
}
}
if (typeof cards[ix] == 'string') {
Click.skill(cards[ix]);
var info = Get.info(event.skill);
ui.click.skill(cards[ix]);
var info = get.info(event.skill);
if (info.filterCard) {
check = info.check || Get.unuseful2;
return (this.chooseCard(check));
check = info.check || get.unuseful2;
return (ai.basic.chooseCard(check));
}
else {
return true;
@ -119,33 +116,32 @@ export class Basic {
}
else {
cards[ix].classList.add('selected');
selected.cards.add(cards[ix]);
Game.check();
if (selected.cards.length >= range[0]) {
ui.selected.cards.add(cards[ix]);
game.check();
if (ui.selected.cards.length >= range[0]) {
ok = true;
}
if (selected.cards.length == range[1]) {
if (ui.selected.cards.length == range[1]) {
return true;
}
}
}
}
static chooseTarget(check) {
var event = status.event;
var event = _status.event;
if (event.filterTarget == undefined) return (check() > 0);
var i, j, range, targets, targets2, effect;
var ok = false, forced = event.forced;
var iwhile = 100;
while (iwhile--) {
range = Get.select(event.selectTarget);
if (selected.targets.length >= range[0]) {
range = get.select(event.selectTarget);
if (ui.selected.targets.length >= range[0]) {
ok = true;
}
if (range[1] <= -1) {
j = 0;
for (i = 0; i < selected.targets.length; i++) {
effect = check(selected.targets[i]);
for (i = 0; i < ui.selected.targets.length; i++) {
effect = check(ui.selected.targets[i]);
if (effect < 0) j -= Math.sqrt(-effect);
else j += Math.sqrt(effect);
}
@ -154,7 +150,7 @@ export class Basic {
else if (range[1] == 0) {
return check() > 0
}
targets = Get.selectableTargets();
targets = get.selectableTargets();
if (targets.length == 0) {
return range[0] == 0 || ok;
}
@ -177,14 +173,21 @@ export class Basic {
}
}
targets[ix].classList.add('selected');
selected.targets.add(targets[ix]);
Game.check();
if (selected.targets.length >= range[0]) {
ui.selected.targets.add(targets[ix]);
game.check();
if (ui.selected.targets.length >= range[0]) {
ok = true;
}
if (selected.targets.length == range[1]) {
if (ui.selected.targets.length == range[1]) {
return true;
}
}
}
}
export class AI extends Uninstantable {
static basic = Basic;
static get = get;
};
export const ai = AI;

View File

@ -1,7 +0,0 @@
import { Player } from "../library/element/player.js";
interface AI extends Record<string, any> {
customAttitude: ((from: Player, to: Player) => number)[];
}
export const ai: AI;

View File

@ -1,3 +0,0 @@
export const ai = {
customAttitude: []
};

View File

@ -1,4 +0,0 @@
interface CardTag extends Record<string, `${number}`[]> {
}
export const cardTag: CardTag;

View File

@ -1,7 +0,0 @@
export const cardTag = {
yingbian_zhuzhan: [],
yingbian_kongchao: [],
yingbian_fujia: [],
yingbian_canqu: [],
yingbian_force: []
};

View File

@ -1,9 +0,0 @@
import { GameEvent } from "../library/element/game-event";
export interface GlobalHistory {
cardMove: GameEvent[];
custom: unknown[];
useCard: GameEvent[];
changeHp: GameEvent[];
everything: GameEvent[];
}

View File

@ -1 +0,0 @@
export const postReconnect = {};

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,378 +0,0 @@
export class Is {
constructor() {
throw new TypeError(`${new.target.name} is not a constructor`);
}
/**
* 判断是否为进攻坐骑
* @param {Card | VCard} card
* @param {false | Player} [player]
* @returns {boolean}
*/
static attackingMount(card, player) {
const subtype = get.subtype(card, player);
if (subtype == "equip4") return true;
else if (subtype == "equip6") {
const info = get.info(card, player), distance = info.distance;
if (!distance) return false;
if (distance.globalFrom && !info.notMount) return true;
}
return false;
}
/**
* 判断是否为防御坐骑
* @param {Card | VCard} card
* @param {false | Player} [player]
* @returns {boolean}
*/
static defendingMount(card, player) {
const subtype = get.subtype(card, player);
if (subtype == "equip3") return true;
else if (subtype == "equip6") {
const info = get.info(card, player), distance = info.distance;
if (!distance) return false;
if (distance.globalTo && !info.notMount) return true;
}
return false;
}
/**
* 判断坐骑栏是否被合并
*/
static mountCombined() {
if (lib.configOL) {
return lib.configOL.mount_combine;
}
else if (typeof _status.mountCombined != "boolean") {
_status.mountCombined = lib.config.mount_combine;
}
return _status.mountCombined;
}
/**
* 判断传入的参数的属性是否相同参数可以为卡牌卡牌信息属性等
* @param {...} infos 要判断的属性列表
* @param {boolean} every 是否判断每一个传入的属性是否完全相同而不是存在部分相同
*/
static sameNature() {
let processedArguments = [], every = false;
Array.from(arguments).forEach(argument => {
if (typeof argument == "boolean") every = argument;
else if (argument) processedArguments.push(argument);
});
if (!processedArguments.length) return true;
if (processedArguments.length == 1) {
const argument = processedArguments[0];
if (!Array.isArray(argument)) return false;
if (!argument.length) return true;
if (argument.length == 1) return false;
processedArguments = argument;
}
const naturesList = processedArguments.map(card => {
if (typeof card == "string") return card.split(lib.natureSeparator);
else if (Array.isArray(card)) return card;
return get.natureList(card || {});
});
const testingNaturesList = naturesList.slice(0, naturesList.length - 1);
if (every) return testingNaturesList.every((natures, index) => naturesList.slice(index + 1).every(testingNatures => testingNatures.length == natures.length && testingNatures.every(nature => natures.includes(nature))));
return testingNaturesList.every((natures, index) => {
const comparingNaturesList = naturesList.slice(index + 1);
if (natures.length) return natures.some(nature => comparingNaturesList.every(testingNatures => testingNatures.includes(nature)));
return comparingNaturesList.every(testingNatures => !testingNatures.length);
});
}
/**
* 判断传入的参数的属性是否不同参数可以为卡牌卡牌信息属性等
* @param ...infos 要判断的属性列表
* @param every {boolean} 是否判断每一个传入的属性是否完全不同而不是存在部分不同
*/
static differentNature() {
let processedArguments = [], every = false;
Array.from(arguments).forEach(argument => {
if (typeof argument == "boolean") every = argument;
else if (argument) processedArguments.push(argument);
});
if (!processedArguments.length) return false;
if (processedArguments.length == 1) {
const argument = processedArguments[0];
if (!Array.isArray(argument)) return true;
if (!argument.length) return false;
if (argument.length == 1) return true;
processedArguments = argument;
}
const naturesList = processedArguments.map(card => {
if (typeof card == "string") return card.split(lib.natureSeparator);
else if (Array.isArray(card)) return card;
return get.natureList(card || {});
});
const testingNaturesList = naturesList.slice(0, naturesList.length - 1);
if (every) return testingNaturesList.every((natures, index) => naturesList.slice(index + 1).every(testingNatures => testingNatures.every(nature => !natures.includes(nature))));
return testingNaturesList.every((natures, index) => {
const comparingNaturesList = naturesList.slice(index + 1);
if (natures.length) return natures.some(nature => comparingNaturesList.every(testingNatures => !testingNatures.length || testingNatures.some(testingNature => testingNature != nature)));
return comparingNaturesList.every(testingNatures => testingNatures.length);
});
}
/**
* 判断一张牌是否为明置手牌
*/
static shownCard(card) {
if (!card) return false;
const gaintag = card.gaintag;
return Array.isArray(gaintag) && gaintag.some(tag => tag.startsWith("visible_"));
}
/**
* 是否是虚拟牌
*/
static vituralCard(card) {
return card.isCard || (!("cards" in card) || !Array.isArray(card.cards) || card.cards.length == 0);
}
/**
* 是否是转化牌
*/
static convertedCard(card) {
return !card.isCard && ("cards" in card) && Array.isArray(card.cards) && card.cards.length > 0;
}
/**
* 是否是实体牌
*/
static ordinaryCard(card) {
return card.isCard && ("cards" in card) && Array.isArray(card.cards) && card.cards.length == 1;
}
/**
* 押韵判断
*/
static yayun(str1, str2) {
if (str1 == str2) return true;
var pinyin1 = get.pinyin(str1, false), pinyin2 = get.pinyin(str2, false);
if (!pinyin1.length || !pinyin2.length) return false;
var pron1 = pinyin1[pinyin1.length - 1], pron2 = pinyin2[pinyin2.length - 1];
if (pron1 == pron2) return true;
return get.yunjiao(pron1) == get.yunjiao(pron2);
}
static blocked(skill, player) {
if (!player.storage.skill_blocker || !player.storage.skill_blocker.length) return false;
for (var i of player.storage.skill_blocker) {
if (lib.skill[i] && lib.skill[i].skillBlocker && lib.skill[i].skillBlocker(skill, player)) return true;
}
return false;
}
static double(name, array) {
const extraInformations = get.character(name, 4);
if (!extraInformations) return false;
for (const extraInformation of extraInformations) {
if (!extraInformation.startsWith("doublegroup:")) continue;
return array ? extraInformation.split(":").slice(1) : true;
}
return false;
}
/**
* Check if the card has a Yingbian condition
*
* 检测此牌是否具有应变条件
*/
static yingbianConditional(card) {
return get.is.complexlyYingbianConditional(card) || get.is.simplyYingbianConditional(card);
}
static complexlyYingbianConditional(card) {
for (const key of lib.yingbian.condition.complex.keys()) {
if (get.cardtag(card, `yingbian_${key}`)) return true;
}
return false;
}
static simplyYingbianConditional(card) {
for (const key of lib.yingbian.condition.simple.keys()) {
if (get.cardtag(card, `yingbian_${key}`)) return true;
}
return false;
}
/**
* Check if the card has a Yingbian effect
*
* 检测此牌是否具有应变效果
*/
static yingbianEffective(card) {
for (const key of lib.yingbian.effect.keys()) {
if (get.cardtag(card, `yingbian_${key}`)) return true;
}
return false;
}
static yingbian(card) {
return get.is.yingbianConditional(card) || get.is.yingbianEffective(card);
}
static emoji(substring) {
if (substring) {
var reg = new RegExp("[~#^$@%&!?%*]", "g");
if (substring.match(reg)) {
return true;
}
for (var i = 0; i < substring.length; i++) {
var hs = substring.charCodeAt(i);
if (0xd800 <= hs && hs <= 0xdbff) {
if (substring.length > 1) {
var ls = substring.charCodeAt(i + 1);
var uc = ((hs - 0xd800) * 0x400) + (ls - 0xdc00) + 0x10000;
if (0x1d000 <= uc && uc <= 0x1f77f) {
return true;
}
}
}
else if (substring.length > 1) {
var ls = substring.charCodeAt(i + 1);
if (ls == 0x20e3) {
return true;
}
}
else {
if (0x2100 <= hs && hs <= 0x27ff) {
return true;
}
else if (0x2B05 <= hs && hs <= 0x2b07) {
return true;
}
else if (0x2934 <= hs && hs <= 0x2935) {
return true;
}
else if (0x3297 <= hs && hs <= 0x3299) {
return true;
}
else if (hs == 0xa9 || hs == 0xae || hs == 0x303d || hs == 0x3030
|| hs == 0x2b55 || hs == 0x2b1c || hs == 0x2b1b
|| hs == 0x2b50) {
return true;
}
}
}
}
return false;
}
static banWords(str) {
return get.is.emoji(str) || window.bannedKeyWords.some(item => str.includes(item));
}
static converted(event) {
return !(event.card && event.card.isCard);
}
static safari() {
return userAgent.indexOf("safari" != -1) && userAgent.indexOf("chrome") == -1;
}
static freePosition(cards) {
return !cards.some(card => !card.hasPosition || card.hasPosition());
}
static nomenu(name, item) {
var menus = ["system", "menu"];
var configs = {
show_round_menu: lib.config.show_round_menu,
round_menu_func: lib.config.round_menu_func,
touchscreen: lib.config.touchscreen,
swipe_up: lib.config.swipe_up,
swipe_down: lib.config.swipe_down,
swipe_left: lib.config.swipe_left,
swipe_right: lib.config.swipe_right,
right_click: lib.config.right_click,
phonelayout: lib.config.phonelayout
};
configs[name] = item;
if (!configs.phonelayout) return false;
if (configs.show_round_menu && menus.contains(configs.round_menu_func)) {
return false;
}
if (configs.touchscreen) {
if (menus.contains(configs.swipe_up)) return false;
if (menus.contains(configs.swipe_down)) return false;
if (menus.contains(configs.swipe_left)) return false;
if (menus.contains(configs.swipe_right)) return false;
}
else {
if (configs.right_click == "config") return false;
}
if (name) {
setTimeout(function () {
alert("请将至少一个操作绑定为显示按钮或打开菜单,否则将永远无法打开菜单");
});
}
return true;
}
static altered() {
return false;
}
static node(obj) {
var str = Object.prototype.toString.call(obj);
if (str && str.indexOf("[object HTML")) return true;
return false;
}
static div(obj) {
return Object.prototype.toString.call(obj) === "[object HTMLDivElement]";
}
static map(obj) {
return Object.prototype.toString.call(obj) === "[object Map]";
}
static set(obj) {
return Object.prototype.toString.call(obj) === "[object Set]";
}
static object(obj) {
return Object.prototype.toString.call(obj) === "[object Object]";
}
static singleSelect(func) {
if (typeof func == "function") return false;
var select = get.select(func);
return select[0] == 1 && select[1] == 1;
}
static jun(name) {
if (get.mode() == "guozhan") {
if (name && typeof name == "object") {
if (name.isUnseen && name.isUnseen(0)) return false;
name = name.name1;
}
if (typeof name == "string" && name.startsWith("gz_jun_")) {
return true;
}
}
return false;
}
static versus() {
return !_status.connectMode && get.mode() == "versus" && _status.mode == "three";
}
static changban() {
return get.mode() == "single" && _status.mode == "changban";
}
static single() {
return get.mode() == "single" && _status.mode == "normal";
}
static mobileMe(player) {
return (game.layout == "mobile" || game.layout == "long") && !game.chess && player.dataset.position == 0;
}
static newLayout() {
return game.layout != "default";
}
static phoneLayout() {
if (!lib.config.phonelayout) return false;
return (game.layout == "mobile" || game.layout == "long" || game.layout == "long2" || game.layout == "nova");
}
static singleHandcard() {
return game.singleHandcard || game.layout == "mobile" || game.layout == "long" || game.layout == "long2" || game.layout == "nova";
}
static linked2(player) {
if (game.chess) return true;
if (lib.config.link_style2 != "rotate") return true;
// if(game.chess) return false;
if (game.layout == "long" || game.layout == "long2" || game.layout == "nova") return true;
if (player.dataset.position == "0") {
return ui.arena.classList.contains("oblongcard");
}
return false;
}
static empty(obj) {
return Object.keys(obj).length == 0;
}
static pos(str) {
return str == "h" || str == "e" || str == "j" || str == "he" || str == "hj" || str == "ej" || str == "hej";
}
static locked(skill, player) {
var info = lib.skill[skill];
if (typeof info.locked == "function") return info.locked(skill, player);
if (info.locked == false) return false;
if (info.trigger && info.forced) return true;
if (info.mod) return true;
if (info.locked) return true;
return false;
}
}

View File

@ -1,13 +1,21 @@
const GeneratorFunction = (function* () {
}).constructor;
import { GeneratorFunction, Uninstantable } from "../util/index.js";
export class GNC {
constructor() {
throw new TypeError(`${new.target.name} is not a constructor`);
class Is extends Uninstantable {
static coroutine(item) {
return typeof item == "function" && item.name == "genCoroutine";
}
static generatorFunc(item) {
return item instanceof GeneratorFunction;
}
static generator(item) {
return (typeof item == "object") && ("constructor" in item) && item.constructor && ("constructor" in item.constructor) && item.constructor.constructor === GeneratorFunction;
}
};
// gnc: GeNCoroutine
export class GNC extends Uninstantable {
static of(fn) {
return this.isGeneratorFunc(fn) ? function genCoroutine() {
return gnc.is.generatorFunc(fn) ? function genCoroutine() {
let gen = fn.apply(this, arguments);
gen.status = "next";
gen.state = undefined;
@ -37,21 +45,9 @@ export class GNC {
Promise.resolve(result).then(nexts, throws);
}
return new Promise(callback);
} : (() => { throw new TypeError("gnc.of needs a GeneratorFunction.") })();
} : (() => { throw new TypeError("gnc.of needs a GeneratorFunction.") })()
}
static is = Is;
};
static isCoroutine(item) {
return typeof item == "function" && item.name == "genCoroutine";
}
/**
* @returns {item is GeneratorFunction}
*/
static isGeneratorFunc(item) {
return item instanceof GeneratorFunction;
}
static isGenerator(item) {
return typeof item == "object" && "constructor" in item && item.constructor && "constructor" in item.constructor && item.constructor.constructor === GeneratorFunction;
}
}
export const gnc = GNC;

View File

@ -1 +0,0 @@
export { Library as InternalLibrary } from "./library.js";

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +0,0 @@
import { card } from "./animate/card.js";
import { skill } from "./animate/skill.js";
export const animate = {
skill,
card
};

View File

@ -1,4 +0,0 @@
interface Card extends Record<string, Function> {
}
export const card: Card;

View File

@ -1 +0,0 @@
export const card = {};

View File

@ -1,4 +0,0 @@
interface Skill extends Record<string, Function> {
}
export const skill: Skill;

View File

@ -1 +0,0 @@
export const skill = {};

View File

@ -1,101 +0,0 @@
/**
* **无名杀消息推送库**
*
* 通过`EventTarget`机制实现消息推送和接收的解耦
* 从而使消息接收方无需依赖发布方发布方也无需考虑接收方
*
* > `lib.announce`不是`actor`模型若不存在订阅者则消息发送将无意义
*
* @example
* // 甲扩展(如《千幻聆音》)在角色皮肤切换后,调用:
* lib.announce.publish("skinChange", {
* player,
* playerName: "zhangfei",
* originSkin: "image/xxx.jpg",
* currentSkin: "image/yyy.jpg"
* });
*
* // 乙扩展监听此`skinChange`事件,并修改自己扩展相关界面的图片:
* const method = lib.announce.subscribe("skinChange", (e) => {
* div.setBackgroundImage(e.currentSkin);
* });
*
* // 若此时乙扩展不想继续订阅`skinChange`事件,可以通过`unsubscribe`解除订阅
* lib.announce.unsubscribe("skinChange", method);
*/
export const announce = {
_announce: document.createElement("Announce"),
/**
* @type {Map<(values: T) => void, Map<string, (event: Event) => void>>}
*/
_announce_cache: new Map(),
/**
* 推送任意数据给所有监听了指定事件的订阅者并返回给定的数据
*
* 若不存在订阅指定事件的订阅者则推送的数据将无意义
*
* @template T
* @param {string} name - 要推送事件的名称
* @param {T} values - 要推送的数据
* @returns {T}
*/
publish(name, values) {
if (this._announce) this._announce.dispatchEvent(new CustomEvent(name, {
detail: values
}));
return values;
},
/**
* 订阅给定名字的事件并返回给定的函数
*
* 在事件触发时执行给定的函数
*
* 给定的函数将被存储至当前实例中用于取消订阅时获取
*
* @template T
* @param {string} name - 要订阅事件的名称
* @param {(values: T) => void} method - 事件触发时执行的函数
* @returns {(values: T) => void}
*/
subscribe(name, method) {
if (this._announce && this._announce_cache) {
let subscribeFunction;
if (this._announce_cache.has(method)) {
let records = this._announce_cache.get(method);
subscribeFunction = records.get("Listener");
records.get("EventTargets").add(name);
}
else {
subscribeFunction = event => method(event.detail);
let records = new Map();
records.set("Listener", subscribeFunction);
records.set("EventTargets", [name]);
this._announce_cache.set(method, records);
}
this._announce.addEventListener(name, subscribeFunction);
}
return method;
},
/**
* 取消指定事件某一函数的订阅并返回该函数
*
* 给定的函数将不再于事件触发时执行其余同事件需触发的函数不受限制
*
* @template T
* @param {string} name - 要取消订阅事件的名称
* @param {(values: T) => void} method - 订阅指定事件的函数
* @returns {(values: T) => void}
*/
unsubscribe(name, method) {
if (this._announce && this._announce_cache && this._announce_cache.has(method)) {
let records = this._announce_cache.get(method);
const listener = records.get("Listener");
let eventTargets = records.get("EventTargets");
eventTargets.remove(name);
if (eventTargets.length <= 0) this._announce_cache.remove(method);
this._announce.removeEventListener(name, listener);
}
return method;
}
};

View File

@ -1,4 +0,0 @@
interface CardPack extends Record<string, string[]> {
}
export const cardPack: CardPack;

View File

@ -1 +0,0 @@
export const cardPack = {};

View File

@ -1 +0,0 @@
export const cardPile = {};

View File

@ -1,4 +0,0 @@
interface CardType extends Record<string, number> {
}
export const cardType: CardType;

View File

@ -1 +0,0 @@
export const cardType = {};

View File

@ -1,93 +0,0 @@
export const card = {
list: [],
cooperation_damage: {
fullskin: true
},
cooperation_draw: {
fullskin: true,
cardimage: "cooperation_damage"
},
cooperation_discard: {
fullskin: true,
cardimage: "cooperation_damage"
},
cooperation_use: {
fullskin: true,
cardimage: "cooperation_damage"
},
pss_paper: {
type: "pss",
fullskin: true
},
pss_scissor: {
type: "pss",
fullskin: true,
},
pss_stone: {
type: "pss",
fullskin: true
},
feichu_equip1: {
type: "equip",
subtype: "equip1"
},
feichu_equip2: {
type: "equip",
subtype: "equip2"
},
feichu_equip3: {
type: "equip",
subtype: "equip3"
},
feichu_equip4: {
type: "equip",
subtype: "equip4"
},
feichu_equip5: {
type: "equip",
subtype: "equip5"
},
feichu_equip6: {
type: "equip",
subtype: "equip6"
},
zhengsu_leijin: {},
zhengsu_mingzhi: {},
zhengsu_bianzhen: {},
disable_judge: {},
group_wei: {
fullskin: true
},
group_shu: {
fullskin: true
},
group_wu: {
fullskin: true
},
group_qun: {
fullskin: true
},
group_key: {
fullskin: true
},
group_jin: {
fullskin: true
},
db_atk1: {
type: "db_atk",
fullimage: true
},
db_atk2: {
type: "db_atk",
fullimage: true
},
db_def1: {
type: "db_def",
fullimage: true
},
db_def2: {
type: "db_def",
fullimage: true
}
};

View File

@ -1,98 +0,0 @@
/**
* **无名杀频道推送机制**
*
* 鉴于`Javascript`的特性及自身对所需功能的思考这是一个参考`Golang``channel`设计的完全和`go channel`不一样的异步消息传递对象
*
* 当且仅当接收方和发送方均存在时进行消息传递完全保证信息传递的单一性发送方/接收方一旦确定则无法更改和准确性发送方必然将消息发送给接收方
*
* 若存在发送方/接收方时调用`send`/`receive`将报错
*
* 若需要异步/不报错发送信息请等待`lib.actor`
*
* @template T
* @example
* // 创建一个频道
* const channel = new lib.channel();
*
* // 从某个角落接收channel发出的消息若无消息则等待
* const message = await channel.receive();
*
* // 从某个角落向channel发消息若无消息接收则等待
* await channel.send(item);
*/
export class Channel {
constructor() {
/**
* @type {"active" | "receiving" | "sending"}
*/
this.status = "active";
/**
* @type {import("./promise-resolve").PromiseResolve<T> | [T, import("./promise-resolve").PromiseResolve<void>] | null}
*/
this._buffer = null;
}
/**
* 向该频道发送消息在消息未被接受前将等待
*
* @param {T} value - 要发送的消息
* @returns {Promise<void>}
*/
send(value) {
return new Promise((resolve, reject) => {
switch (this.status) {
case "sending":
// TODO: handle the error.
reject(new Error());
break;
case "receiving": {
/**
* @type {import("./promise-resolve").PromiseResolve<T>}
*/
const buffer = this._buffer;
this._buffer = null;
buffer(value);
this.status = "active";
resolve();
break;
}
case "active":
this.status = "sending";
this._buffer = [value, resolve];
break;
}
});
}
/**
* 接收频道所发送的消息若无消息发送则等待
*
* @returns {Promise<T>} 接收到的消息
*/
receive() {
return new Promise((resolve, reject) => {
switch (this.status) {
case "receiving":
// TODO: handle the error.
reject(new Error());
break;
case "sending": {
/**
* @type {[T, import("./promise-resolve").PromiseResolve<void>]}
*/
const buffer = this._buffer;
this._buffer = null;
resolve(buffer[0]);
this.status = "active";
buffer[1]();
break;
}
case "active":
this.status = "receiving";
this._buffer = resolve;
break;
}
});
}
}

View File

@ -1,17 +0,0 @@
import { Get } from "../get.js";
import { configuration } from "./configuration.js";
export class CharacterDialogGroup {
constructor() {
throw new TypeError(`${new.target.name} is not a constructor`);
}
static 收藏(name, capt) {
return configuration.favouriteCharacter.includes(name) ? capt : null;
}
static 最近(name, capt) {
var list = Get.config("recentCharacter") || [];
return list.includes(name) ? capt : null;
}
}

View File

@ -1,4 +0,0 @@
interface CharacterFilter extends Record<string, (mode: string) => boolean> {
}
export const characterFilter: CharacterFilter;

View File

@ -1 +0,0 @@
export const characterFilter = {};

View File

@ -1,4 +0,0 @@
type CharacterSex = "double" | "female" | "male" | "none" | "unknown" | string & {};
type CharacterGroup = "wei" | "shu" | "wu" | "qun" | "jin";
type CharacterHP = number | `${number}/${number}` | `${number}/${number}/${number}`;
export type CharacterInformation = [CharacterSex, CharacterGroup, CharacterHP, string[], string[]?];

View File

@ -1,4 +0,0 @@
interface CharacterIntro extends Record<string, string> {
}
export const characterIntro: CharacterIntro;

View File

@ -1 +0,0 @@
export const characterIntro = {};

View File

@ -1,6 +0,0 @@
import { CharacterInformation } from "./character-information.js";
interface CharacterPack extends Record<string, Record<string, CharacterInformation>> {
}
export const characterPack: CharacterPack;

View File

@ -1 +0,0 @@
export const characterPack = {};

View File

@ -1,4 +0,0 @@
interface CharacterReplace extends Record<string, string[]> {
}
export const characterReplace: CharacterReplace;

View File

@ -1 +0,0 @@
export const characterReplace = {};

View File

@ -1,4 +0,0 @@
interface CharacterSort extends Record<string, Record<string, string[]>> {
}
export const characterSort: CharacterSort;

View File

@ -1 +0,0 @@
export const characterSort = {};

View File

@ -1,4 +0,0 @@
interface CharacterTitle extends Record<string, string> {
}
export const characterTitle: CharacterTitle;

View File

@ -1 +0,0 @@
export const characterTitle = {};

View File

@ -1 +0,0 @@
export const character = {};

View File

@ -1,693 +0,0 @@
export class Cheat {
constructor() {
throw new TypeError(`${new.target.name} is not a constructor`);
}
static i() {
window.cheat = lib.cheat;
window.game = game;
window.ui = ui;
window.get = get;
window.ai = ai;
window.lib = lib;
window._status = _status;
}
static dy() {
var next = game.me.next;
for (var i = 0; i < 10; i++) {
if (next.identity != "zhu") {
break;
}
next = next.next;
}
next.die();
}
static x() {
var gl = function (dir, callback) {
var files = [], folders = [];
dir = "/Users/widget/Documents/extension/" + dir;
lib.node.fs.readdir(dir, function (err, filelist) {
for (var i = 0; i < filelist.length; i++) {
if (filelist[i][0] != "." && filelist[i][0] != "_") {
if (lib.node.fs.statSync(dir + "/" + filelist[i]).isDirectory()) {
folders.push(filelist[i]);
}
else {
files.push(filelist[i]);
}
}
}
callback(folders, files);
});
}
var args = Array.from(arguments);
for (var i = 0; i < args.length; i++) {
args[i] = args[i][0];
}
gl("", function (list) {
if (args.length) {
for (var i = 0; i < list.length; i++) {
if (!args.contains(list[i][0])) {
list.splice(i--, 1);
}
}
}
if (list.length) {
for (var i = 0; i < list.length; i++) {
(function (str) {
gl(str, function (folders, files) {
if (files.length > 1) {
for (var i = 0; i < files.length; i++) {
if (files[i].includes("extension.js")) {
files.splice(i--, 1);
}
else {
if (i % 5 == 0) {
str += "\n\t\t\t";
}
str += `"${files[i]}",`;
}
}
console.log(str.slice(0, str.length - 1));
}
});
}(list[i]));
}
}
});
}
static cfg() {
var mode = lib.config.all.mode.slice(0);
mode.remove("connect");
mode.remove("brawl");
var banned = ["shen_guanyu", "shen_caocao", "caopi", "re_daqiao", "caorui",
"daqiao", "lingcao", "liuzan", "lusu", "luxun", "yanwen", "zhouyu", "ns_wangyue", "gw_yenaifa",
"old_caozhen", "swd_jiangziya", "xuhuang", "maliang", "guojia", "simayi", "swd_kangnalishi", "hs_siwangzhiyi", "hs_nozdormu", "old_zhuzhi"];
var bannedcards = ["zengbin"];
var favs = ["hs_tuoqi", "hs_siwangxianzhi", "hs_xukongzhiying", "hs_hsjiasha", "gjqt_xieyi", "gjqt_yunwuyue", "gjqt_beiluo",
"gjqt_cenying", "shen_lvmeng", "shen_zhaoyun", "shen_zhugeliang", "ow_ana", "chenlin", "ns_guanlu", "hs_guldan", "swd_guyue",
"pal_jiangyunfan", "mtg_jiesi", "swd_lanyin", "pal_liumengli", "swd_muyun", "pal_nangonghuang", "swd_muyue", "pal_murongziying",
"swd_qiner", "pal_shenqishuang", "hs_taisi", "wangji", "pal_xingxuan", "xunyou", "hs_yelise", "pal_yuejinzhao", "pal_yueqi",
"gjqt_yuewuyi", "swd_yuxiaoxue", "ow_zhaliya", "zhangchunhua", "hs_zhihuanhua", "swd_zhiyin", "old_zhonghui", "gjqt_bailitusu",
"hs_barnes", "ow_dva", "swd_hengai", "pal_jushifang", "hs_kazhakusi", "hs_lafamu", "ow_liekong", "hs_lreno", "pal_mingxiu",
"swd_murongshi", "gw_oudimu", "gjqt_ouyangshaogong", "hs_pyros", "qinmi", "gw_sanhanya", "hs_selajin", "swd_shuwaner",
"swd_situqiang", "hs_xialikeer", "pal_xuejian", "swd_yuchiyanhong", "swd_yuwentuo", "swd_zhaoyun", "zhugeliang", "gw_aigeleisi",
"gw_aimin", "gjqt_aruan", "hs_aya", "swd_cheyun", "swd_chenjingchou", "gw_diandian", "swd_huzhongxian", "hs_jinglinglong",
"hs_kaituozhe", "hs_kalimosi", "gw_linjing", "ow_luxiao", "re_luxun", "hs_morgl", "swd_sikongyu", "hs_sthrall", "sunquan",
"sunshangxiang", "gw_yioufeisisp", "gw_yisilinni", "hs_yogg", "hs_ysera", "pal_yuntianhe", "zhugejin", "zhugeke", "gw_zhuoertan",
"hs_anduin", "swd_anka", "ow_banzang", "ow_chanyata", "diaochan", "swd_duguningke", "sp_diaochan", "hetaihou", "ns_huamulan",
"swd_huanglei", "swd_huanyuanzhi", "re_huatuo", "gw_huoge", "pal_jiangcheng", "yj_jushou", "swd_kendi", "yxs_libai",
"mtg_lilianna", "xin_liru", "liuxie", "pal_lixiaoyao", "pal_longkui", "ns_nanhua", "swd_qi", "swd_septem", "gw_shasixiwusi",
"ow_tianshi", "swd_weida", "gjqt_xiayize", "swd_xiyan", "hs_xsylvanas", "hs_yelinlonghou", "ow_yuanshi", "zuoci"];
var vintage = ["tianjian", "shuiyun", "zhuyue", "zhimeng", "poyun", "qianfang", "xfenxin", "danqing", "ywuhun", "tianwu", "xuelu",
"shahun", "yuling", "duhun", "liaoyuan", "touxi", "wangchen", "poyue", "kunlunjing", "huanhun", "yunchou", "tuzhen", "cyqiaoxie",
"mufeng", "duanyi", "guozao", "yaotong", "pozhen", "tanlin", "susheng", "jikong", "shouyin", "jilve", "hxunzhi", "huodan", "shanxian",
"ziyu", "kuoyin", "feiren", "zihui", "jidong", "baoxue", "aqianghua", "maoding", "bfengshi", "zhongdun", "pingzhang", "maichong",
"guozai", "jingxiang", "yuelu", "liechao", "fengnu", "hanshuang", "enze", "malymowang", "xshixin", "qingzun"];
var favmodes = ["versus|three", "versus|four", "versus|two", "chess|combat"];
for (var i = 0; i < mode.length; i++) {
game.saveConfig(mode[i] + "_banned", banned);
game.saveConfig(mode[i] + "_bannedcards", bannedcards);
}
var characters = lib.config.all.characters.slice(0);
characters.remove("standard");
characters.remove("old");
game.saveConfig("vintageSkills", vintage);
game.saveConfig("favouriteCharacter", favs);
game.saveConfig("favouriteMode", favmodes);
game.saveConfig("theme", "simple");
game.saveConfig("player_border", "slim");
game.saveConfig("cards", lib.config.all.cards);
game.saveConfig("characters", characters);
game.saveConfig("change_skin", false);
game.saveConfig("show_splash", "off");
game.saveConfig("show_favourite", false);
game.saveConfig("animation", false);
game.saveConfig("hover_all", false);
game.saveConfig("asset_version", "v1.9");
// game.saveConfig("characters",lib.config.all.characters);
// game.saveConfig("cards",lib.config.all.cards);
game.saveConfig("plays", ["cardpile"]);
game.saveConfig("skip_shan", false);
game.saveConfig("tao_enemy", true);
game.saveConfig("layout", "long2");
game.saveConfig("hp_style", "ol");
game.saveConfig("background_music", "music_off");
game.saveConfig("background_audio", false);
game.saveConfig("background_speak", false);
game.saveConfig("show_volumn", false);
game.saveConfig("show_replay", true);
game.saveConfig("autostyle", true);
game.saveConfig("debug", true);
game.saveConfig("dev", true);
if (!lib.device) {
game.saveConfig("sync_speed", false);
}
game.reload();
}
static o() {
ui.arena.classList.remove("observe");
}
static pt() {
var list = Array.from(arguments);
while (list.length) {
var card = cheat.gn(list.pop());
if (card) ui.cardPile.insertBefore(card, ui.cardPile.firstChild);
}
}
static q() {
if (arguments.length == 0) {
var style = ui.css.card_style;
if (lib.config.card_style != "simple") {
lib.config.card_style = "simple";
ui.css.card_style = lib.init.css(lib.assetURL + "theme/style/card", "simple");
}
else {
lib.config.card_style = "default";
ui.css.card_style = lib.init.css(lib.assetURL + "theme/style/card", "default");
}
style.remove();
}
else {
for (var i = 0; i < arguments.length; i++) {
cheat.g(arguments[i]);
}
}
ui.arena.classList.remove("selecting");
ui.arena.classList.remove("tempnoe");
}
static p(name, i, skin) {
var list = ["swd", "hs", "pal", "gjqt", "ow", "gw"];
if (!lib.character[name]) {
for (var j = 0; j < list.length; j++) {
if (lib.character[list[j] + "_" + name]) {
name = list[j] + "_" + name; break;
}
}
}
if (skin) {
lib.config.skin[name] = skin
}
var target;
if (typeof i == "number") {
target = game.players[i];
}
else {
target = game.me.next;
}
if (!lib.character[name]) {
target.node.avatar.setBackground(name, "character");
target.node.avatar.show();
}
else {
target.init(name);
}
if (i === true) {
if (lib.config.layout == "long2") {
lib.init.layout("mobile");
}
else {
lib.init.layout("long2");
}
}
}
static e() {
var cards = [], target;
for (var i = 0; i < arguments.length; i++) {
if (get.itemtype(arguments[i]) == "player") {
target = arguments[i];
}
else {
cards.push(game.createCard(arguments[i]));
}
}
if (!cards.length) {
cards.push(game.createCard("qilin"));
cards.push(game.createCard("bagua"));
cards.push(game.createCard("dilu"));
cards.push(game.createCard("chitu"));
cards.push(game.createCard("muniu"));
}
target = target || game.me;
for (var i = 0; i < cards.length; i++) {
var card = target.getEquip(cards[i]);
if (card) {
card.discard();
target.removeEquipTrigger(card);
}
target.$equip(cards[i]);
}
}
static c() {
(function () {
var a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0;
var sa = 0, sb = 0, sc = 0, sd = 0, se = 0, sf = 0, sg = 0;
for (var i in lib.character) {
switch (lib.character[i][1]) {
case "wei": a++; if (lib.config.banned.contains(i)) sa++; break;
case "shu": b++; if (lib.config.banned.contains(i)) sb++; break;
case "wu": c++; if (lib.config.banned.contains(i)) sc++; break;
case "qun": d++; if (lib.config.banned.contains(i)) sd++; break;
case "jin": g++; if (lib.config.banned.contains(i)) sg++; break;
case "western": e++; if (lib.config.banned.contains(i)) se++; break;
case "key": f++; if (lib.config.banned.contains(i)) sf++; break;
}
}
console.log("魏:" + (a - sa) + "/" + a);
console.log("蜀:" + (b - sb) + "/" + b);
console.log("吴:" + (c - sc) + "/" + c);
console.log("群:" + (d - sd) + "/" + d);
console.log("晋:" + (g - sg) + "/" + g);
console.log("西:" + (e - se) + "/" + e);
console.log("键:" + (f - sf) + "/" + f);
console.log("已启用:" + ((a + b + c + d + e + f) - (sa + sb + sc + sd + se + sf)) + "/" + (a + b + c + d + e + f));
}());
(function () {
var a = 0, b = 0, c = 0, d = 0;
var aa = 0, bb = 0, cc = 0, dd = 0;
var sa = 0, sb = 0, sc = 0, sd = 0;
var sha = 0, shan = 0, tao = 0, jiu = 0, wuxie = 0, heisha = 0, hongsha = 0;
var num = { 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0, 9: 0, 10: 0, 11: 0, 12: 0, 13: 0 };
for (var i in lib.card) {
if (get.objtype(lib.card[i]) == "object" && lib.translate[i + "_info"]) {
switch (lib.card[i].type) {
case "basic": a++; break;
case "trick": b++; break;
case "equip": c++; break;
default: d++; break;
}
}
}
for (var i = 0; i < lib.card.list.length; i++) {
if (typeof lib.card[lib.card.list[i][2]] == "object") {
switch (lib.card[lib.card.list[i][2]].type) {
case "basic": aa++; break;
case "trick": case "delay": bb++; break;
case "equip": cc++; break;
default: dd++; break;
}
switch (lib.card.list[i][0]) {
case "heart": sa++; break;
case "diamond": sb++; break;
case "club": sc++; break;
case "spade": sd++; break;
}
if (lib.card.list[i][2] == "sha") {
sha++;
if (lib.card.list[i][0] == "club" || lib.card.list[i][0] == "spade") {
heisha++;
}
else {
hongsha++;
}
}
if (lib.card.list[i][2] == "shan") {
shan++;
}
if (lib.card.list[i][2] == "tao") {
tao++;
}
if (lib.card.list[i][2] == "jiu") {
jiu++;
}
if (lib.card.list[i][2] == "wuxie") {
wuxie++;
}
num[lib.card.list[i][1]]++;
}
}
var str = "基本牌" + aa + " " + "锦囊牌" + bb + " " + "装备牌" + cc + " " + "其它牌" + dd
console.log(str);
str = "红桃牌" + sa + " " + "方片牌" + sb + " " + "梅花牌" + sc + " " + "黑桃牌" + sd
console.log(str);
str = "杀" + sha + " " + "黑杀" + heisha + " " + "红杀" + hongsha + " " + "闪" + shan + " " + "桃" + tao + " " + "酒" + jiu + " " + "无懈" + wuxie
console.log(str);
if (arguments[1]) {
for (var i = 1; i <= 13; i++) {
if (i < 10) {
console.log(i + " ", num[i]);
}
else {
console.log(i, num[i]);
}
}
}
var arr = [];
for (var i = 1; i <= 13; i++) {
arr.push(num[i]);
}
console.log((a + b + c + d) + "/" + (aa + bb + cc + dd), ...arr)
}());
}
static id() {
game.showIdentity();
}
static b() {
if (!ui.dialog || !ui.dialog.buttons) return;
for (var i = 0; i < Math.min(arguments.length, ui.dialog.buttons.length); i++) {
ui.dialog.buttons[i].link = arguments[i];
}
}
static uy(me) {
if (me) {
game.me.useCard({ name: "spell_yexinglanghun" }, game.me);
}
else {
var enemy = game.me.getEnemy();
enemy.useCard({ name: "spell_yexinglanghun" }, enemy);
}
}
static gs(name, act) {
var card = game.createCard("spell_" + (name || "yexinglanghun"));
game.me.node.handcards1.appendChild(card);
if (!act) {
game.me.actused = -99;
}
ui.updatehl();
delete _status.event._cardChoice;
delete _status.event._targetChoice;
delete _status.event._skillChoice;
setTimeout(game.check, 300);
}
static gc(name, act) {
var card = game.createCard("stone_" + (name || "falifulong") + "_stonecharacter");
game.me.node.handcards1.appendChild(card);
if (!act) {
game.me.actused = -99;
}
ui.updatehl();
delete _status.event._cardChoice;
delete _status.event._targetChoice;
delete _status.event._skillChoice;
setTimeout(game.check, 300);
}
static a(bool) {
if (lib.config.test_game) {
game.saveConfig("test_game");
}
else {
if (bool) {
if (typeof bool === "string") {
game.saveConfig("test_game", bool);
}
else {
game.saveConfig("test_game", "_");
}
}
else {
game.saveConfig("test_game", true);
}
}
game.reload();
}
static as() {
ui.window.classList.remove("testing");
var bg = ui.window.querySelector(".pausedbg");
if (bg) {
bg.remove();
}
}
static uj() {
cheat.e("qilin");
game.me.next.useCard({ name: "jiedao" }, [game.me, game.me.previous]);
}
static u() {
var card = { name: "sha" }, source = game.me.next, targets = [];
for (var i = 0; i < arguments.length; i++) {
if (get.itemtype(arguments[i]) == "player") {
source = arguments[i];
}
else if (Array.isArray(arguments[i])) {
targets = arguments[i];
}
else if (typeof arguments[i] == "object" && arguments[i]) {
card = arguments[i];
}
else if (typeof arguments[i] == "string") {
card = { name: arguments[i] }
}
}
if (!targets.length) targets.push(game.me);
source.useCard(game.createCard(card.name, card.suit, card.number, card.nature), targets);
}
static r(bool) {
var list = ["s", "ap", "a", "am", "bp", "b", "bm", "c", "d"];
var str = "";
for (var i = 0; i < list.length; i++) {
if (str) str += " 、 ";
str += list[i] + "-" + lib.rank[list[i]].length;
}
console.log(str);
for (var i in lib.characterPack) {
if (!bool && lib.config.all.sgscharacters.contains(i)) continue;
var map = {};
var str = "";
for (var j in lib.characterPack[i]) {
var rank = get.rank(j);
if (!map[rank]) {
map[rank] = 1;
}
else {
map[rank]++;
}
}
for (var j = 0; j < list.length; j++) {
if (map[list[j]]) {
if (str) str += " 、 ";
str += list[j] + "-" + map[list[j]];
}
}
if (str) {
console.log(lib.translate[i + "_character_config"] + "" + str);
}
}
var list = lib.rank.s.concat(lib.rank.ap).concat(lib.rank.a).concat(lib.rank.am).
concat(lib.rank.bp).concat(lib.rank.b).concat(lib.rank.bm).concat(lib.rank.c).concat(lib.rank.d);
Object.keys(lib.character).forEach(key => {
if (!lib.config.forbidai.includes(key) && !key.startsWith("boss_") && !key.startsWith("tafang_") && !list.includes(key)) console.log(get.translation(key), key);
});
}
static h(player) {
console.log(get.translation(player.getCards("h")));
}
static g() {
for (var i = 0; i < arguments.length; i++) {
if (i > 0 && typeof arguments[i] == "number") {
for (var j = 0; j < arguments[i] - 1; j++) {
cheat.gx(arguments[i - 1]);
}
}
else {
cheat.gx(arguments[i]);
}
}
}
static ga(type) {
for (var i in lib.card) {
if (lib.card[i].type == type || lib.card[i].subtype == type) {
cheat.g(i);
}
}
}
static gg() {
for (var i = 0; i < game.players.length; i++) {
for (var j = 0; j < arguments.length; j++) {
cheat.gx(arguments[j], game.players[i]);
}
}
}
static gx(name, target) {
target = target || game.me;
var card = cheat.gn(name);
if (!card) return;
target.node.handcards1.appendChild(card);
delete _status.event._cardChoice;
delete _status.event._targetChoice;
delete _status.event._skillChoice;
game.check();
target.update();
ui.updatehl();
}
static gn(name) {
var nature = null;
var suit = null;
var suits = ["club", "spade", "diamond", "heart"];
for (var i = 0; i < suits.length; i++) {
if (name.startsWith(suits[i])) {
suit = suits[i];
name = name.slice(suits[i].length);
break;
}
}
if (name.startsWith("red")) {
name = name.slice(3);
suit = ["diamond", "heart"].randomGet();
}
if (name.startsWith("black")) {
name = name.slice(5);
suit = ["spade", "club"].randomGet();
}
if (name == "huosha") {
name = "sha";
nature = "fire";
}
else if (name == "leisha") {
name = "sha";
nature = "thunder";
}
if (!lib.card[name]) {
return null;
}
return game.createCard(name, suit, null, nature);
}
static ge(target) {
if (target) {
cheat.gx("zhuge", target);
cheat.gx("qinglong", target);
cheat.gx("bagua", target);
cheat.gx("dilu", target);
cheat.gx("chitu", target);
cheat.gx("muniu", target);
}
else {
cheat.g("zhuge");
cheat.g("qinglong");
cheat.g("bagua");
cheat.g("dilu");
cheat.g("chitu");
cheat.g("muniu");
}
}
static gj() {
cheat.g("shandian");
cheat.g("huoshan");
cheat.g("hongshui");
cheat.g("lebu");
cheat.g("bingliang");
cheat.g("guiyoujie");
}
static gf() {
for (var i in lib.card) {
if (lib.card[i].type == "food") {
cheat.g(i);
}
}
}
static d(num, target) {
if (num == undefined) num = 1;
var cards = get.cards(num);
for (var i = 0; i < num; i++) {
var card = cards[i];
game.me.node.handcards1.appendChild(card);
delete _status.event._cardChoice;
delete _status.event._targetChoice;
delete _status.event._skillChoice;
game.check();
game.me.update();
ui.updatehl();
}
}
static s() {
for (var i = 0; i < arguments.length; i++) {
game.me.addSkill(arguments[i], true);
}
delete _status.event._cardChoice;
delete _status.event._targetChoice;
delete _status.event._skillChoice;
game.check();
}
static t(num) {
if (game.players.contains(num)) {
num = game.players.indexOf(num);
}
if (num == undefined) {
for (var i = 0; i < game.players.length; i++) cheat.t(i);
return;
}
var player = game.players[num];
var cards = player.getCards("hej");
for (var i = 0; i < cards.length; i++) {
cards[i].discard();
}
player.removeEquipTrigger();
player.update();
}
static to() {
for (var i = 0; i < game.players.length; i++) {
if (game.players[i] != game.me) {
cheat.t(i);
}
}
}
static tm() {
for (var i = 0; i < game.players.length; i++) {
if (game.players[i] == game.me) {
cheat.t(i);
}
}
}
static k(i) {
if (i == undefined) i = 1;
game.players[i].hp = 1;
cheat.t(i);
cheat.g("juedou");
}
static z(name) {
switch (name) {
case "cc": name = "re_caocao"; break;
case "lb": name = "re_liubei"; break;
case "sq": name = "sunquan"; break;
case "dz": name = "dongzhuo"; break;
case "ys": name = "re_yuanshao"; break;
case "zj": name = "sp_zhangjiao"; break;
case "ls": name = "liushan"; break;
case "sc": name = "sunce"; break;
case "cp": name = "caopi"; break;
case "cr": name = "caorui"; break;
case "sx": name = "sunxiu"; break;
case "lc": name = "liuchen"; break;
case "sh": name = "sunhao"; break;
}
game.zhu.init(name);
game.zhu.maxHp++;
game.zhu.hp++;
game.zhu.update();
}
}

View File

@ -1,5 +0,0 @@
export const color = {
black: ["club", "spade"],
red: ["diamond", "heart"],
none: ["none"]
};

View File

@ -1,41 +0,0 @@
export class Comparator {
constructor() {
throw new TypeError(`${new.target.name} is not a constructor`);
}
static equals() {
if (arguments.length == 0) return false;
if (arguments.length == 1) return true;
for (let i = 1; i < arguments.length; ++i) if (arguments[i] !== arguments[0]) return false;
return true;
}
static equalAny() {
if (arguments.length == 0) return false;
if (arguments.length == 1) return true;
for (let i = 1; i < arguments.length; ++i) if (arguments[i] === arguments[0]) return true;
return false;
}
static notEquals() {
if (arguments.length == 0) return false;
if (arguments.length == 1) return true;
for (let i = 1; i < arguments.length; ++i) if (arguments[i] === arguments[0]) return false;
return true;
}
static notEqualAny() {
if (arguments.length == 0) return false;
if (arguments.length == 1) return true;
for (let i = 1; i < arguments.length; ++i) if (arguments[i] !== arguments[0]) return true;
return false;
}
static typeEquals() {
if (arguments.length == 0) return false;
if (arguments.length == 1) return arguments[0] !== null;
const type = typeof arguments[0];
for (let i = 1; i < arguments.length; ++i) if (type !== arguments[i]) return false;
return true;
}
}

View File

@ -1,15 +0,0 @@
import { APPEARANCE } from "./configuration-menu/appearance.js";
import { AUDIO } from "./configuration-menu/audio.js";
import { GENERAL } from "./configuration-menu/general.js";
import { OTHERS } from "./configuration-menu/others.js";
import { SKILL } from "./configuration-menu/skill.js";
import { VIEW } from "./configuration-menu/view.js";
export const CONFIGURATION_MENU = {
general: GENERAL,
appearence: APPEARANCE,
view: VIEW,
audio: AUDIO,
skill: SKILL,
others: OTHERS
};

View File

@ -1,6 +0,0 @@
import { CONFIGURATION } from "./appearance/configuration.js";
export const APPEARANCE = {
name: "外观",
config: CONFIGURATION
};

View File

@ -1,187 +0,0 @@
import { ANIMATION } from "./configuration/animation.js";
import { AUTOMATIC_BORDER_COUNT } from "./configuration/automatic-border-count.js";
import { AUTOMATIC_BORDER_START } from "./configuration/automatic-border-start.js";
import { BLUR_UI } from "./configuration/blur-ui.js";
import { BORDER_STYLE } from "./configuration/border-style.js";
import { BUTTON_CHARACTER_PREFIX } from "./configuration/button-character-prefix.js";
import { BUTTON_CHARACTER_STYLE } from "./configuration/button-character-style.js";
import { BUTTON_PRESS } from "./configuration/button-press.js";
import { CARD_BACK_STYLE } from "./configuration/card-back-style.js";
import { CARD_SHAPE } from "./configuration/card-shape.js";
import { CARD_STYLE } from "./configuration/card-style.js";
import { CARD_TEMPORARY_NAME } from "./configuration/card-temporary-name.js";
import { CARD_TEXT_FONT } from "./configuration/card-text-font.js";
import { CHANGE_SKIN_AUTOMATICALLY } from "./configuration/change-skin-automatically.js";
import { CHANGE_SKIN } from "./configuration/change-skin.js";
import { CONTROL_STYLE } from "./configuration/control-style.js";
import { CURSOR_STYLE } from "./configuration/cursor-style.js";
import { CUSTOM_BUTTON_CONTROL_BOTTOM } from "./configuration/custom-button-control-bottom.js";
import { CUSTOM_BUTTON_CONTROL_TOP } from "./configuration/custom-button-control-top.js";
import { CUSTOM_BUTTON_SYSTEM_BOTTOM } from "./configuration/custom-button-system-bottom.js";
import { CUSTOM_BUTTON_SYSTEM_TOP } from "./configuration/custom-button-system-top.js";
import { CUSTOM_BUTTON } from "./configuration/custom-button.js";
import { DAMAGE_SHAKE } from "./configuration/damage-shake.js";
import { DIE_MOVE } from "./configuration/die-move.js";
import { FOLD_CARD } from "./configuration/fold-card.js";
import { FOLD_MODE } from "./configuration/fold-mode.js";
import { GLASS_UI } from "./configuration/glass-ui.js";
import { GLOBAL_FONT } from "./configuration/global-font.js";
import { GLOW_PHASE } from "./configuration/glow-phase.js";
import { HP_STYLE } from "./configuration/hp-style.js";
import { IDENTITY_FONT } from "./configuration/identity-font.js";
import { IMAGE_BACKGROUND_BLUR } from "./configuration/image-background-blur.js";
import { IMAGE_BACKGROUND_RANDOM } from "./configuration/image-background-random.js";
import { IMAGE_BACKGROUND } from "./configuration/image-background.js";
import { JIU_EFFECT } from "./configuration/jiu-effect.js";
import { LAYOUT } from "./configuration/layout.js";
import { LINK_STYLE_2 } from "./configuration/link-style-2.js";
import { MENU_STYLE } from "./configuration/menu-style.js";
import { NAME_FONT } from "./configuration/name-font.js";
import { PHONE_LAYOUT } from "./configuration/phone-layout.js";
import { PLAYER_BORDER } from "./configuration/player-border.js";
import { PLAYER_HEIGHT_NOVA } from "./configuration/player-height-nova.js";
import { PLAYER_HEIGHT } from "./configuration/player-height.js";
import { PLAYER_STYLE } from "./configuration/player-style.js";
import { RADIUS_SIZE } from "./configuration/radius-size.js";
import { SEPARATE_CONTROL } from "./configuration/separate-control.js";
import { SKILL_ANIMATION_TYPE } from "./configuration/skill-animation-type.js";
import { SPLASH_STYLE } from "./configuration/splash-style.js";
import { SUITS_FONT } from "./configuration/suits-font.js";
import { TARGET_SHAKE } from "./configuration/target-shake.js";
import { THEME } from "./configuration/theme.js";
import { TURNED_STYLE } from "./configuration/turned-style.js";
import { UI_ZOOM } from "./configuration/ui-zoom.js";
export const CONFIGURATION = {
theme: THEME,
layout: LAYOUT,
splash_style: SPLASH_STYLE,
player_height: PLAYER_HEIGHT,
player_height_nova: PLAYER_HEIGHT_NOVA,
ui_zoom: UI_ZOOM,
image_background: IMAGE_BACKGROUND,
image_background_random: IMAGE_BACKGROUND_RANDOM,
image_background_blur: IMAGE_BACKGROUND_BLUR,
phonelayout: PHONE_LAYOUT,
change_skin: CHANGE_SKIN,
change_skin_auto: CHANGE_SKIN_AUTOMATICALLY,
card_style: CARD_STYLE,
cardback_style: CARD_BACK_STYLE,
hp_style: HP_STYLE,
player_style: PLAYER_STYLE,
border_style: BORDER_STYLE,
autoborder_count: AUTOMATIC_BORDER_COUNT,
autoborder_start: AUTOMATIC_BORDER_START,
player_border: PLAYER_BORDER,
menu_style: MENU_STYLE,
control_style: CONTROL_STYLE,
custom_button: CUSTOM_BUTTON,
custom_button_system_top: CUSTOM_BUTTON_SYSTEM_TOP,
custom_button_system_bottom: CUSTOM_BUTTON_SYSTEM_BOTTOM,
custom_button_control_top: CUSTOM_BUTTON_CONTROL_TOP,
custom_button_control_bottom: CUSTOM_BUTTON_CONTROL_BOTTOM,
radius_size: RADIUS_SIZE,
glow_phase: GLOW_PHASE,
fold_card: FOLD_CARD,
fold_mode: FOLD_MODE,
seperate_control: SEPARATE_CONTROL,
blur_ui: BLUR_UI,
glass_ui: GLASS_UI,
damage_shake: DAMAGE_SHAKE,
button_press: BUTTON_PRESS,
jiu_effect: JIU_EFFECT,
animation: ANIMATION,
skill_animation_type: SKILL_ANIMATION_TYPE,
die_move: DIE_MOVE,
target_shake: TARGET_SHAKE,
turned_style: TURNED_STYLE,
link_style2: LINK_STYLE_2,
cardshape: CARD_SHAPE,
cardtempname: CARD_TEMPORARY_NAME,
buttoncharacter_style: BUTTON_CHARACTER_STYLE,
buttoncharacter_prefix: BUTTON_CHARACTER_PREFIX,
cursor_style: CURSOR_STYLE,
name_font: NAME_FONT,
identity_font: IDENTITY_FONT,
cardtext_font: CARD_TEXT_FONT,
global_font: GLOBAL_FONT,
suits_font: SUITS_FONT,
update(config, map) {
if (config.custom_button) {
map.custom_button_system_top.show();
map.custom_button_system_bottom.show();
map.custom_button_control_top.show();
map.custom_button_control_bottom.show();
}
else {
map.custom_button_system_top.hide();
map.custom_button_system_bottom.hide();
map.custom_button_control_top.hide();
map.custom_button_control_bottom.hide();
}
if (config.change_skin) {
map.change_skin_auto.show();
}
else {
map.change_skin_auto.hide();
}
if (config.image_background_random) {
map.image_background_blur.show();
map.image_background.hide();
}
else {
map.image_background.show();
if (config.image_background == "default") {
map.image_background_blur.hide();
}
else {
map.image_background_blur.show();
}
}
if (config.layout == "long" || config.layout == "mobile") {
map.cardshape.show();
map.phonelayout.show();
}
else {
if (config.layout == "long2" || config.layout == "nova") {
map.phonelayout.show();
map.cardshape.show();
}
else {
map.phonelayout.hide();
map.cardshape.hide();
}
}
if (config.layout == "long") {
map.player_height.show();
}
else {
if (config.layout == "long2") {
map.player_height.show();
}
else {
map.player_height.hide();
}
}
if (config.layout == "nova") {
map.player_height_nova.show();
}
else {
map.player_height_nova.hide();
}
if (config.touchscreen) {
map.cursor_style.hide();
}
else {
map.cursor_style.show();
}
if (config.border_style == "auto") {
map.autoborder_count.show();
map.autoborder_start.show();
}
else {
map.autoborder_count.hide();
map.autoborder_start.hide();
}
}
};

View File

@ -1,6 +0,0 @@
export const ANIMATION = {
name: "游戏特效",
intro: "开启后出现属性伤害、回复体力等情况时会显示动画",
init: false,
unfrequent: true
};

View File

@ -1,20 +0,0 @@
import { ITEM } from "./automatic-border-count/item.js";
const introduction = document.createElement("body");
const kill = document.createElement("strong");
kill.append("击杀");
introduction.append(kill, " 每击杀一人,边框提升两级", document.createElement("br"));
const damage = document.createElement("strong");
damage.append("伤害");
introduction.append(damage, " 每造成两点伤害,边框提升一级", document.createElement("br"));
const mix = document.createElement("strong");
mix.append("混合");
introduction.append(mix, " 击杀量决定边框颜色,伤害量决定边框装饰");
export const AUTOMATIC_BORDER_COUNT = {
name: "边框升级方式",
intro: introduction.innerHTML,
init: "kill",
item: ITEM,
unfrequent: true
};

View File

@ -1,5 +0,0 @@
export const ITEM = {
kill: "击杀",
damage: "伤害",
mix: "混合"
};

View File

@ -1,8 +0,0 @@
import { ITEM } from "./automatic-border-start/item.js";
export const AUTOMATIC_BORDER_START = {
name: "基础边框颜色",
init: "bronze",
item: ITEM,
unfrequent: true
};

View File

@ -1,5 +0,0 @@
export const ITEM = {
bronze: "铜",
silver: "银",
gold: "金"
};

View File

@ -1,15 +0,0 @@
export const BLUR_UI = {
name: "模糊效果",
intro: "在暂停或打开菜单时开启模糊效果",
init: false,
unfrequent: true,
onclick(bool) {
game.saveConfig("blur_ui", bool);
if (bool) {
ui.window.classList.add("blur_ui");
}
else {
ui.window.classList.remove("blur_ui");
}
}
};

View File

@ -1,125 +0,0 @@
import { ITEM } from "./border-style/item.js";
export const BORDER_STYLE = {
name: "角色边框",
init: "default",
intro: "设置角色边框的样式,当设为自动时,样式将随着一局游戏中伤害或击杀的数量自动改变",
item: ITEM,
visualBar(node, item, create, switcher) {
if (node.created) {
return;
}
var button;
for (var i = 0; i < node.parentNode.childElementCount; i++) {
if (node.parentNode.childNodes[i]._link == "custom") {
button = node.parentNode.childNodes[i];
}
}
if (!button) {
return;
}
node.created = true;
var deletepic;
ui.create.filediv(".menubutton", "添加图片", node, function (file) {
if (file) {
game.putDB("image", "border_style", file, function () {
game.getDB("image", "border_style", function (fileToLoad) {
if (!fileToLoad) return;
var fileReader = new FileReader();
fileReader.onload = function (fileLoadedEvent) {
var data = fileLoadedEvent.target.result;
button.style.backgroundImage = "url(" + data + ")";
button.className = "button character";
button.style.backgroundSize = "100% 100%";
node.classList.add("showdelete");
};
fileReader.readAsDataURL(fileToLoad, "UTF-8");
});
});
}
}).inputNode.accept = "image/*";
deletepic = ui.create.div(".menubutton.deletebutton", "删除图片", node, function () {
if (confirm("确定删除自定义图片?(此操作不可撤销)")) {
game.deleteDB("image", "border_style");
button.style.backgroundImage = "none";
button.className = "button character dashedmenubutton";
node.classList.remove("showdelete");
if (lib.config.border_style == "custom") {
lib.configMenu.appearence.config.border_style.onclick("default");
switcher.lastChild.innerHTML = "默认";
}
button.classList.add("transparent");
}
});
},
visualMenu(node, link, name, config) {
node.className = "button character";
node.style.backgroundSize = "";
node.style.height = "108px";
node.dataset.decoration = "";
if (link == "default" || link == "custom" || link == "auto") {
node.style.backgroundImage = "none";
node.className = "button character dashedmenubutton";
}
else {
if (link.startsWith("dragon_")) {
link = link.slice(7);
node.dataset.decoration = link;
}
node.setBackgroundImage("theme/style/player/" + link + "1.png");
node.style.backgroundSize = "100% 100%";
}
if (link == "custom") {
node.classList.add("transparent");
game.getDB("image", "border_style", function (fileToLoad) {
if (!fileToLoad) return;
var fileReader = new FileReader();
fileReader.onload = function (fileLoadedEvent) {
var data = fileLoadedEvent.target.result;
node.style.backgroundImage = "url(" + data + ")";
node.className = "button character";
node.parentNode.lastChild.classList.add("showdelete");
node.style.backgroundSize = "100% 100%";
};
fileReader.readAsDataURL(fileToLoad, "UTF-8");
});
}
},
onclick(layout) {
game.saveConfig("border_style", layout);
if (ui.css.border_stylesheet) {
ui.css.border_stylesheet.remove();
delete ui.css.border_stylesheet;
}
if (layout == "custom") {
game.getDB("image", "border_style", function (fileToLoad) {
if (!fileToLoad) return;
var fileReader = new FileReader();
fileReader.onload = function (fileLoadedEvent) {
if (ui.css.border_stylesheet) {
ui.css.border_stylesheet.remove();
}
ui.css.border_stylesheet = lib.init.sheet();
ui.css.border_stylesheet.id = "ui.css.border";
ui.css.border_stylesheet.sheet.insertRule(`#window .player>.framebg{display:block;background-image:url("${fileLoadedEvent.target.result}")}`, 0);
ui.css.border_stylesheet.sheet.insertRule(".player>.count{z-index: 3 !important;border-radius: 2px !important;text-align: center !important;}", 0);
};
fileReader.readAsDataURL(fileToLoad, "UTF-8");
});
}
else if (layout != "default" && layout != "auto") {
ui.css.border_stylesheet = lib.init.sheet();
if (layout.startsWith("dragon_")) {
layout = layout.slice(7);
ui.arena.dataset.framedecoration = layout;
}
else {
ui.arena.dataset.framedecoration = "";
}
ui.css.border_stylesheet.sheet.insertRule(`#window .player>.framebg,#window #arena.long.mobile:not(.fewplayer) .player[data-position="0"]>.framebg{display:block;background-image:url("${lib.assetURL}theme/style/player/${layout}1.png")}`, 0);
ui.css.border_stylesheet.sheet.insertRule(`#window #arena.long:not(.fewplayer) .player>.framebg, #arena.oldlayout .player>.framebg{background-image:url("${lib.assetURL}theme/style/player/${layout}3.png")}`, 0);
ui.css.border_stylesheet.sheet.insertRule(".player>.count{z-index: 3 !important;border-radius: 2px !important;text-align: center !important;}", 0);
}
},
unfrequent: true
};

View File

@ -1,11 +0,0 @@
export const ITEM = {
gold: "金框",
silver: "银框",
bronze: "铜框",
dragon_gold: "金龙",
dragon_silver: "银龙",
dragon_bronze: "玉龙",
custom: "自定",
auto: "自动",
default: "默认"
};

View File

@ -1,8 +0,0 @@
import { ITEM } from "./button-character-prefix/item.js";
export const BUTTON_CHARACTER_PREFIX = {
name: "武将前缀",
init: "default",
item: ITEM,
unfrequent: true
};

View File

@ -1,5 +0,0 @@
export const ITEM = {
default: "默认",
simple: "不显示颜色",
off: "不显示前缀"
};

View File

@ -1,8 +0,0 @@
import { ITEM } from "./button-character-style/item.js";
export const BUTTON_CHARACTER_STYLE = {
name: "选将样式",
init: "default",
item: ITEM,
unfrequent: true
};

View File

@ -1,5 +0,0 @@
export const ITEM = {
default: "默认",
simple: "精简",
old: "旧版"
};

View File

@ -1,6 +0,0 @@
export const BUTTON_PRESS = {
name: "按钮效果",
intro: "选项条被按下时将有按下效果",
init: true,
unfrequent: true
};

View File

@ -1,138 +0,0 @@
import { ITEM } from "./card-back-style/item.js";
export const CARD_BACK_STYLE = {
name: "卡背样式",
intro: "设置背面朝上的卡牌的样式",
init: "default",
item: ITEM,
visualBar(node, item, create, switcher) {
if (node.created) {
return;
}
var button;
for (var i = 0; i < node.parentNode.childElementCount; i++) {
if (node.parentNode.childNodes[i]._link == "custom") {
button = node.parentNode.childNodes[i];
}
}
if (!button) {
return;
}
node.created = true;
var deletepic;
ui.create.filediv(".menubutton", "添加图片", node, function (file) {
if (file) {
game.putDB("image", "cardback_style", file, function () {
game.getDB("image", "cardback_style", function (fileToLoad) {
if (!fileToLoad) return;
var fileReader = new FileReader();
fileReader.onload = function (fileLoadedEvent) {
var data = fileLoadedEvent.target.result;
button.style.backgroundImage = "url(" + data + ")";
button.className = "button character";
node.classList.add("showdelete");
};
fileReader.readAsDataURL(fileToLoad, "UTF-8");
});
});
}
}).inputNode.accept = "image/*";
ui.create.filediv(".menubutton.deletebutton.addbutton", "添加翻转图片", node, function (file) {
if (file) {
game.putDB("image", "cardback_style2", file, function () {
node.classList.add("hideadd");
});
}
}).inputNode.accept = "image/*";
deletepic = ui.create.div(".menubutton.deletebutton", "删除图片", node, function () {
if (confirm("确定删除自定义图片?(此操作不可撤销)")) {
game.deleteDB("image", "cardback_style");
game.deleteDB("image", "cardback_style2");
button.style.backgroundImage = "none";
button.className = "button character dashedmenubutton";
node.classList.remove("showdelete");
node.classList.remove("hideadd");
if (lib.config.cardback_style == "custom") {
lib.configMenu.appearence.config.cardback_style.onclick("default");
switcher.lastChild.innerHTML = "默认";
}
button.classList.add("transparent");
}
});
},
visualMenu(node, link, name, config) {
node.style.backgroundSize = "100% 100%";
switch (link) {
case "default": case "custom": {
node.style.backgroundImage = "none";
node.className = "button character dashedmenubutton";
break;
}
case "new": node.className = "button character"; node.setBackgroundImage("theme/style/cardback/image/new.png"); break;
case "feicheng": node.className = "button character"; node.setBackgroundImage("theme/style/cardback/image/feicheng.png"); break;
case "official": node.className = "button character"; node.setBackgroundImage("theme/style/cardback/image/official.png"); break;
case "liusha": node.className = "button character"; node.setBackgroundImage("theme/style/cardback/image/liusha.png"); break;
case "ol": node.className = "button character"; node.setBackgroundImage("theme/style/cardback/image/ol.png"); break;
case "wood": node.className = "button card fullskin"; node.setBackgroundImage("theme/woodden/wood.jpg"); node.style.backgroundSize = "initial"; break;
case "music": node.className = "button card fullskin"; node.setBackgroundImage("theme/music/wood3.png"); break;
}
if (link == "custom") {
node.classList.add("transparent");
game.getDB("image", "cardback_style", function (fileToLoad) {
if (!fileToLoad) return;
var fileReader = new FileReader();
fileReader.onload = function (fileLoadedEvent) {
var data = fileLoadedEvent.target.result;
node.style.backgroundImage = "url(" + data + ")";
node.className = "button character";
node.parentNode.lastChild.classList.add("showdelete");
game.getDB("image", "cardback_style2", function (file) {
if (file) {
node.parentNode.lastChild.classList.add("hideadd");
}
});
};
fileReader.readAsDataURL(fileToLoad, "UTF-8");
});
}
},
onclick(layout) {
game.saveConfig("cardback_style", layout);
var style = ui.css.cardback_style;
ui.css.cardback_style = lib.init.css(lib.assetURL + "theme/style/cardback", lib.config.cardback_style);
style.remove();
if (ui.css.cardback_stylesheet) {
ui.css.cardback_stylesheet.remove();
delete ui.css.cardback_stylesheet;
}
if (ui.css.cardback_stylesheet2) {
ui.css.cardback_stylesheet2.remove();
delete ui.css.cardback_stylesheet2;
}
if (layout == "custom") {
game.getDB("image", "cardback_style", function (fileToLoad) {
if (!fileToLoad) return;
var fileReader = new FileReader();
fileReader.onload = function (fileLoadedEvent) {
if (ui.css.cardback_stylesheet) {
ui.css.cardback_stylesheet.remove();
}
ui.css.cardback_stylesheet = lib.init.sheet(".card:empty,.card.infohidden{background-image:url(" + fileLoadedEvent.target.result + ")}");
game.getDB("image", "cardback_style2", function (fileToLoad) {
if (!fileToLoad) return;
var fileReader = new FileReader();
fileReader.onload = function (fileLoadedEvent) {
if (ui.css.cardback_stylesheet2) {
ui.css.cardback_stylesheet2.remove();
}
ui.css.cardback_stylesheet2 = lib.init.sheet(".card.infohidden:not(.infoflip){background-image:url(" + fileLoadedEvent.target.result + ")}");
};
fileReader.readAsDataURL(fileToLoad, "UTF-8");
});
};
fileReader.readAsDataURL(fileToLoad, "UTF-8");
});
}
},
unfrequent: true
};

View File

@ -1,8 +0,0 @@
export const ITEM = {
official: "原版",
feicheng: "废城",
liusha: "流沙",
ol: "手杀",
custom: "自定",
default: "默认"
};

View File

@ -1,34 +0,0 @@
import { ITEM } from "./card-shape/item.js";
export const CARD_SHAPE = {
name: "手牌显示",
intro: "将手牌设置为正方形或长方形",
init: "default",
unfrequent: true,
item: ITEM,
onclick(item) {
var linked = false;
if (game.me && game.me.isLinked()) {
linked = true;
}
game.saveConfig("cardshape", item);
if (item == "oblong" && (game.layout == "long" || game.layout == "mobile" || game.layout == "long2" || game.layout == "nova")) {
ui.arena.classList.add("oblongcard");
ui.window.classList.add("oblongcard");
}
else {
ui.arena.classList.remove("oblongcard");
ui.window.classList.remove("oblongcard");
}
if (linked) {
if (get.is.linked2(game.me)) {
game.me.classList.remove("linked");
game.me.classList.add("linked2");
}
else {
game.me.classList.add("linked");
game.me.classList.remove("linked2");
}
}
}
};

View File

@ -1,4 +0,0 @@
export const ITEM = {
default: "默认",
oblong: "长方"
};

View File

@ -1,114 +0,0 @@
import { ITEM } from "./card-style/item.js";
export const CARD_STYLE = {
name: "卡牌样式",
init: "default",
intro: "设置正面朝上的卡牌的样式",
item: ITEM,
visualBar(node, item, create, switcher) {
if (node.created) {
return;
}
var button;
for (var i = 0; i < node.parentNode.childElementCount; i++) {
if (node.parentNode.childNodes[i]._link == "custom") {
button = node.parentNode.childNodes[i];
}
}
if (!button) {
return;
}
node.created = true;
var deletepic;
ui.create.filediv(".menubutton", "添加图片", node, function (file) {
if (file) {
game.putDB("image", "card_style", file, function () {
game.getDB("image", "card_style", function (fileToLoad) {
if (!fileToLoad) return;
var fileReader = new FileReader();
fileReader.onload = function (fileLoadedEvent) {
var data = fileLoadedEvent.target.result;
button.style.backgroundImage = "url(" + data + ")";
button.className = "button card fullskin";
node.classList.add("showdelete");
};
fileReader.readAsDataURL(fileToLoad, "UTF-8");
});
});
}
}).inputNode.accept = "image*";
deletepic = ui.create.div(".menubutton.deletebutton", "删除图片", node, function () {
if (confirm("确定删除自定义图片?(此操作不可撤销)")) {
game.deleteDB("image", "card_style");
button.style.backgroundImage = "none";
button.className = "button character dashedmenubutton";
node.classList.remove("showdelete");
if (lib.config.card_style == "custom") {
lib.configMenu.appearence.config.card_style.onclick("default");
switcher.lastChild.innerHTML = "默认";
}
button.classList.add("transparent");
}
});
},
visualMenu(node, link, name, config) {
node.className = "button card fullskin";
node.style.backgroundSize = "100% 100%";
switch (link) {
case "default": case "custom": {
if (lib.config.theme == "simple") {
node.style.backgroundImage = "linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4))";
node.className = "button character";
}
else {
node.style.backgroundImage = "none";
node.className = "button character dashedmenubutton";
}
break;
}
case "new": node.setBackgroundImage("theme/style/card/image/new.png"); break;
case "ol": node.setBackgroundImage("theme/style/card/image/ol.png"); break;
case "wood": node.setBackgroundImage("theme/woodden/wood.jpg"); node.style.backgroundSize = "initial"; break;
case "music": node.setBackgroundImage("theme/music/wood3.png"); break;
case "simple": node.setBackgroundImage("theme/simple/card.png"); break;
}
if (link == "custom") {
node.classList.add("transparent");
game.getDB("image", "card_style", function (fileToLoad) {
if (!fileToLoad) return;
var fileReader = new FileReader();
fileReader.onload = function (fileLoadedEvent) {
var data = fileLoadedEvent.target.result;
node.style.backgroundImage = "url(" + data + ")";
node.className = "button card fullskin";
node.parentNode.lastChild.classList.add("showdelete");
};
fileReader.readAsDataURL(fileToLoad, "UTF-8");
});
}
},
onclick(layout) {
game.saveConfig("card_style", layout);
var style = ui.css.card_style;
ui.css.card_style = lib.init.css(lib.assetURL + "theme/style/card", lib.config.card_style);
style.remove();
if (ui.css.card_stylesheet) {
ui.css.card_stylesheet.remove();
delete ui.css.card_stylesheet;
}
if (layout == "custom") {
game.getDB("image", "card_style", function (fileToLoad) {
if (!fileToLoad) return;
var fileReader = new FileReader();
fileReader.onload = function (fileLoadedEvent) {
if (ui.css.card_stylesheet) {
ui.css.card_stylesheet.remove();
}
ui.css.card_stylesheet = lib.init.sheet(".card:not(*:empty){background-image:url(" + fileLoadedEvent.target.result + ")}");
};
fileReader.readAsDataURL(fileToLoad, "UTF-8");
});
}
},
unfrequent: true
};

View File

@ -1,8 +0,0 @@
export const ITEM = {
wood: "木纹",
music: "音乐",
simple: "原版",
ol: "手杀",
custom: "自定",
default: "默认"
};

View File

@ -1,28 +0,0 @@
import { ITEM } from "./card-temporary-name/item.js";
export const CARD_TEMPORARY_NAME = {
name: "视为卡牌名称显示",
intro: "显示强制视为类卡牌(如武魂),包括拆顺对话框内的判定牌(国色)转换等名称的显示方式",
init: "image",
unfrequent: true,
item: ITEM,
onclick(item) {
game.saveConfig("cardtempname", item);
if (!game.me || !game.me.getCards) return;
var hs = game.me.getCards("h");
for (var i = 0; i < hs.length; i++) {
if (hs[i]._tempName) {
switch (item) {
case "default":
case "horizon":
case "image":
ui.create.cardTempName(hs[i]);
break;
default:
hs[i]._tempName.delete();
delete hs[i]._tempName;
}
}
}
}
};

View File

@ -1,6 +0,0 @@
export const ITEM = {
default: "纵向",
horizon: "横向",
image: "图片",
off: "禁用"
};

Some files were not shown because too many files have changed in this diff Show More