Merge branch 'libccy:PR-Branch' into PR-Branch
This commit is contained in:
commit
fd70e43d11
1695
character/diy.js
1695
character/diy.js
File diff suppressed because it is too large
Load Diff
|
@ -5459,11 +5459,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
effect:{
|
||||
target(card,player,target){
|
||||
if(get.tag(card,'damage')&&target.hp>(player.hasSkillTag('damageBonus',true,{
|
||||
if(!target._new_guixin_eff&&get.tag(card,'damage')&&target.hp>(player.hasSkillTag('damageBonus',true,{
|
||||
card:card,
|
||||
target:target
|
||||
})?2:1)){
|
||||
if(player.hasSkillTag('jueqing',false,target)) return [1,-2];
|
||||
target._new_guixin_eff=true;
|
||||
let gain=game.countPlayer(function(current){
|
||||
if(target==current) return 0;
|
||||
if(get.attitude(target,current)>0){
|
||||
|
@ -5476,6 +5477,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
});
|
||||
if(target.isTurnedOver()) gain+=2.3;
|
||||
else gain-=2.3;
|
||||
delete target._new_guixin_eff;
|
||||
return [1,Math.max(0,gain)];
|
||||
}
|
||||
}
|
||||
|
@ -6286,11 +6288,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
effect:{
|
||||
target(card,player,target){
|
||||
if(get.tag(card,'damage')&&target.hp>(player.hasSkillTag('damageBonus',true,{
|
||||
if(!target._guixin_eff&&get.tag(card,'damage')&&target.hp>(player.hasSkillTag('damageBonus',true,{
|
||||
card:card,
|
||||
target:target
|
||||
})?2:1)){
|
||||
if(player.hasSkillTag('jueqing',false,target)) return [1,-2];
|
||||
target._guixin_eff=true;
|
||||
let gain=game.countPlayer(function(current){
|
||||
if(target==current) return 0;
|
||||
if(get.attitude(target,current)>0){
|
||||
|
@ -6303,6 +6306,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
});
|
||||
if(target.isTurnedOver()) gain+=2.3;
|
||||
else gain-=2.3;
|
||||
delete target._guixin_eff;
|
||||
return [1,Math.max(0,gain)];
|
||||
}
|
||||
}
|
||||
|
@ -8563,7 +8567,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
zhengqing_info:'锁定技。一轮游戏开始时,你移去所有角色的“擎”标记,令上一轮于一回合内造成伤害值最多的角色各获得X枚“擎”,且你与这些角色各摸一张牌(X为这些角色该回合内造成的伤害值)。若该角色为你且本次获得的“擎”数为本局游戏最多的一次,你改为摸X张牌(至多摸五张)。',
|
||||
zhuangpo:'壮魄',
|
||||
zhuangpo_info:'你可以将牌名为【杀】或牌面信息中包含“【杀】”的牌当【决斗】使用,然后你获得如下效果:1.当此【决斗】指定目标后,若你有“擎”,你可以移去任意枚“擎”,令目标角色弃置等量的牌;2.当你造成渠道为此牌的伤害时,若此牌的所有目标角色中存在有“擎”的角色,此伤害+1。',
|
||||
|
||||
|
||||
extra_feng:'神话再临·风',
|
||||
extra_huo:'神话再临·火',
|
||||
|
|
|
@ -477,7 +477,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
direct:true,
|
||||
async content(event,trigger,player){
|
||||
const result=await player.chooseTarget(get.prompt('dczhenrao'),'对一名可选角色造成1点伤害',(card,player,target)=>{
|
||||
return get.event('targets').includes(target);
|
||||
return get.event('targets').includes(target)&&!player.getStorage('dczhenrao').includes(target);
|
||||
})
|
||||
.set('targets',trigger.targets.concat(trigger.player).filter(target=>target.countCards('h')>player.countCards('h')))
|
||||
.set('ai',target=>{
|
||||
|
@ -2032,13 +2032,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
audio:2,
|
||||
trigger:{player:'useCardAfter'},
|
||||
filter:function(event,player){
|
||||
if(get.type(event.card)!='basic') return false;
|
||||
if(player.getHistory('gain',evt=>{
|
||||
return evt.getParent().name==='dccaisi';
|
||||
}).reduce((num,evt)=>{
|
||||
return num+evt.cards.length;
|
||||
},0)>player.maxHp) return false;
|
||||
return _status.currentPhase;
|
||||
return get.type(event.card)=='basic'&&_status.currentPhase;
|
||||
},
|
||||
prompt2:function(event,player){
|
||||
const num=player.countMark('dccaisi_more')+1;
|
||||
|
@ -2054,13 +2048,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(card) cards.add(card);
|
||||
else break;
|
||||
}
|
||||
if(cards.length) player.gain(cards,'gain2');
|
||||
if(cards.length) yield player.gain(cards,'gain2');
|
||||
else{
|
||||
player.chat('没有非基本牌…');
|
||||
game.log(`但是${position=='discardPile'?'弃':''}牌堆里没有非基本牌!`);
|
||||
}
|
||||
player.addTempSkill('dccaisi_more');
|
||||
player.addMark('dccaisi_more',1,false);
|
||||
const sum=player.getHistory('useSkill',evt=>evt.skill=='dccaisi').length;
|
||||
if(sum<player.maxHp){
|
||||
player.addTempSkill('dccaisi_more');
|
||||
player.addMark('dccaisi_more',1,false);
|
||||
}
|
||||
else player.tempBanSkill('dccaisi');
|
||||
},
|
||||
subSkill:{more:{charlotte:true,onremove:true}},
|
||||
},
|
||||
|
@ -2073,10 +2071,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
content:function*(event,map){
|
||||
const player=map.player;
|
||||
if(player.maxHp<game.countPlayer()){
|
||||
if(player.maxHp<game.countPlayer2()){
|
||||
yield player.gainMaxHp();
|
||||
}
|
||||
player.recover();
|
||||
yield player.recover();
|
||||
}
|
||||
},
|
||||
//魏贾充
|
||||
|
@ -12954,9 +12952,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
dcshizong_info:'当你需要使用一张基本牌时,你可以交给一名其他角色X张牌,然后其可以将一张牌置于牌堆底,视为你使用之。若其不为当前回合角色,此技能失效直到回合结束(X为你本回合发动〖恃纵〗的次数)。',
|
||||
pangshanmin:'庞山民',
|
||||
dccaisi:'才思',
|
||||
dccaisi_info:'当你于回合内/回合外使用基本牌结算结束后,若你本回合以此法得到的牌数小于你的体力上限,你可以从牌堆/弃牌堆随机获得一张非基本牌,然后本回合发动此技能获得的牌数+1。',
|
||||
dccaisi_info:'当你于回合内/回合外使用基本牌结算结束后,你可以从牌堆/弃牌堆随机获得一张非基本牌,然后若你本回合发动此技能的次数:小于你的体力上限,本回合你发动此技能获得的牌数+1;大于等于你的体力上限,本回合此技能失效。',
|
||||
dczhuoli:'擢吏',
|
||||
dczhuoli_info:'锁定技。一名角色的回合结束时,若你本回合使用或获得的牌数大于体力值,你加1点体力上限(不能超过存活角色数),回复1点体力。',
|
||||
dczhuoli_info:'锁定技。一名角色的回合结束时,若你本回合使用或获得的牌数大于体力值,你加1点体力上限(不能超过游戏人数),回复1点体力。',
|
||||
yue_caiyong:'乐蔡邕',
|
||||
yue_caiyong_prefix:'乐',
|
||||
dcjiaowei:'焦尾',
|
||||
|
|
|
@ -5861,23 +5861,23 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
str=get.prompt(event.skill,trigger[info.logTarget],player);
|
||||
}
|
||||
else if(typeof info.logTarget=='function'){
|
||||
var logTarget=info.logTarget(trigger,player);
|
||||
var logTarget=info.logTarget(trigger,player,trigger.triggername,trigger.indexedData);
|
||||
if(get.itemtype(logTarget).indexOf('player')==0) str=get.prompt(event.skill,logTarget,player);
|
||||
}
|
||||
else{
|
||||
str=get.prompt(event.skill,null,player);
|
||||
}
|
||||
}
|
||||
if(typeof str=='function'){str=str(trigger,player)}
|
||||
if(typeof str=='function'){str=str(trigger,player,trigger.triggername,trigger.indexedData)}
|
||||
var next=player.chooseBool('评鉴:'+str);
|
||||
next.set('yes',!info.check||info.check(trigger,player));
|
||||
next.set('yes',!info.check||info.check(trigger,player,trigger.triggername,trigger.indexedData));
|
||||
next.set('hsskill',event.skill);
|
||||
next.set('forceDie',true);
|
||||
next.set('ai',function(){
|
||||
return _status.event.yes;
|
||||
});
|
||||
if(typeof info.prompt2=='function'){
|
||||
next.set('prompt2',info.prompt2(trigger,player));
|
||||
next.set('prompt2',info.prompt2(trigger,player,trigger.triggername,trigger.indexedData));
|
||||
}
|
||||
else if(typeof info.prompt2=='string'){
|
||||
next.set('prompt2',info.prompt2);
|
||||
|
|
|
@ -16673,8 +16673,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
re_liru_prefix:'手杀界',
|
||||
re_chenqun:'手杀界陈群',
|
||||
re_chenqun_prefix:'手杀界',
|
||||
old_yuanshu:'手杀界袁术',
|
||||
old_yuanshu_prefix:'手杀界',
|
||||
re_liru:'手杀界李儒',
|
||||
re_liru_prefix:'手杀界',
|
||||
re_chenqun:'手杀界陈群',
|
||||
|
|
|
@ -12,11 +12,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
ol_sb_taishici:['male','wu',4,['olsbdulie','olsbdouchan']],
|
||||
ol_gaoshun:['male','qun',4,['olxianzhen','decadejinjiu'],['die_audio:re_gaoshun']],
|
||||
ol_sb_yuanshao:['male','qun',4,['olsbhetao','olsbshenli','olsbyufeng','olsbshishou'],['zhu']],
|
||||
ol_yufan:['male','wu',3,['olzongxuan','olzhiyan'],['tempname:re_yufan','die_audio:re_yufan']],
|
||||
ol_chengpu:['male','wu',4,['dclihuo','olchunlao'],['tempname:xin_chengpu','die_audio:xin_chengpu']],
|
||||
},
|
||||
characterSort:{
|
||||
onlyOL:{
|
||||
onlyOL_yijiang1:['ol_jianyong','ol_lingtong','ol_gaoshun'],
|
||||
onlyOL_yijiang2:['ol_caozhang'],
|
||||
onlyOL_yijiang2:['ol_caozhang','ol_chengpu'],
|
||||
onlyOL_yijiang3:['ol_yufan'],
|
||||
onlyOL_sb:['ol_sb_jiangwei','ol_sb_guanyu','ol_sb_taishici','ol_sb_yuanshao'],
|
||||
},
|
||||
},
|
||||
|
@ -48,6 +51,229 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
},
|
||||
skill:{
|
||||
//程普
|
||||
dclihuo:{
|
||||
audio:'relihuo',
|
||||
trigger:{player:'useCard1'},
|
||||
filter(event,player){
|
||||
return event.card.name=='sha'&&!game.hasNature(event.card,'fire');
|
||||
},
|
||||
check(event,player){
|
||||
let card=new lib.element.VCard(get.copy(event.card));
|
||||
game.setNature(card,'fire');
|
||||
const eff1=event.targets.reduce((sum,target)=>{
|
||||
return sum+get.effect(target,event.card,player,player);
|
||||
},0);
|
||||
let targets=event.targets.slice();
|
||||
if(get.info('lihuo2').filter(event,player)){
|
||||
let targetx=game.filterPlayer(target=>{
|
||||
return !targets.includes(target)&&player.canUse(card,target)&&get.effect(target,card,player,player)>0;
|
||||
});
|
||||
if(targetx.length) targets.add(targetx.sort((a,b)=>{
|
||||
return get.effect(b,card,player,player)-get.effect(a,card,player,player);
|
||||
})[0]);
|
||||
}
|
||||
const eff2=targets.reduce((sum,target)=>{
|
||||
return sum+get.effect(target,card,player,player);
|
||||
},0);
|
||||
return eff2>eff1;
|
||||
},
|
||||
content(){
|
||||
game.log(player,'将',trigger.card,'改为了火属性');
|
||||
game.setNature(trigger.card,'fire');
|
||||
player.when('useCardAfter').filter(evt=>evt==trigger).then(()=>{
|
||||
if(game.hasPlayer2(target=>{
|
||||
return target.getHistory('damage',evt=>evt.card&&evt.card==trigger.card).length;
|
||||
})){
|
||||
player.chooseToDiscard('he','疠火:弃置一张牌,或失去1点体力').set('ai',card=>{
|
||||
const player=get.event('player');
|
||||
if((get.name(card)=='tao'||get.name(card)=='jiu')&&lib.filter.cardSavable(card,player,player)) return -1;
|
||||
if(player.hp<=1){
|
||||
if(cards.length<player.getEnemies().length&&player.hasCard((cardx)=>{
|
||||
return (get.name(cardx)=='tao'||get.name(cardx)=='jiu')&&lib.filter.cardSavable(cardx,player,player);
|
||||
},'hs')) return 7-get.value(card);
|
||||
return -1;
|
||||
}
|
||||
return 24-5*cards.length-2*Math.min(4,player.getHp())-get.value(card);
|
||||
});
|
||||
}
|
||||
else event.finish();
|
||||
}).then(()=>{
|
||||
if(!result.bool) player.loseHp();
|
||||
});
|
||||
},
|
||||
ai:{fireAttack:true},
|
||||
group:'dclihuo_add',
|
||||
subSkill:{
|
||||
add:{
|
||||
inherit:'lihuo2',
|
||||
async content(event,trigger,player){
|
||||
const {result:{bool,targets}}=await player.chooseTarget(get.prompt('dclihuo'),'为'+get.translation(trigger.card)+'增加一个目标',(card,player,target)=>{
|
||||
const trigger=get.event().getTrigger();
|
||||
return !trigger.targets.includes(target)&&player.canUse(trigger.card,target);
|
||||
}).set('card',trigger.card).set('ai',target=>{
|
||||
const player=get.event('player'),trigger=get.event().getTrigger();
|
||||
return get.effect(target,trigger.card,player,player);
|
||||
});
|
||||
if(bool){
|
||||
player.logSkill('dclihuo',targets);
|
||||
trigger.targets.addArray(targets);
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
olchunlao:{
|
||||
audio:'chunlao',
|
||||
audioname:['xin_chengpu'],
|
||||
trigger:{
|
||||
player:'loseAfter',
|
||||
global:'loseAsyncAfter',
|
||||
},
|
||||
filter(event,player){
|
||||
if(event.type!='discard'||event.getlx===false) return false;
|
||||
const evt=event.getl(player);
|
||||
return evt&&evt.cards2&&evt.cards2.some(i=>i.name=='sha'&&get.position(i)=='d');
|
||||
},
|
||||
forced:true,
|
||||
locked:false,
|
||||
content(){
|
||||
const evt=trigger.getl(player);
|
||||
player.addToExpansion(evt.cards2.filter(i=>i.name=='sha'&&get.position(i)=='d'),'gain2').gaintag.add('olchunlao');
|
||||
},
|
||||
ai:{
|
||||
effect:{
|
||||
player(card,player,target){
|
||||
if(_status.currentPhase!=player) return;
|
||||
if(card.name=='sha'&&!player.getExpansions('olchunlao').length&&target.hp>1){
|
||||
return 'zeroplayertarget';
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
intro:{
|
||||
content:'expansion',
|
||||
markcount:'expansion',
|
||||
},
|
||||
onremove(player,skill){
|
||||
var cards=player.getExpansions(skill);
|
||||
if(cards.length) player.loseToDiscardpile(cards);
|
||||
},
|
||||
group:'olchunlao_save',
|
||||
subSkill:{
|
||||
save:{
|
||||
inherit:'chunlao2',
|
||||
filter(event,player){
|
||||
return event.type=='dying'&&event.dying&&event.dying.hp<=0&&player.getExpansions('olchunlao').length;
|
||||
},
|
||||
async content(event,trigger,player){
|
||||
const target=event.targets[0];
|
||||
const {result:{bool,links}}=await player.chooseCardButton(get.translation('olchunlao'),player.getExpansions('olchunlao'),true);
|
||||
if(bool){
|
||||
player.logSkill('olchunlao',target);
|
||||
await player.loseToDiscardpile(links);
|
||||
event.type='dying';
|
||||
await target.useCard({name:'jiu',isCard:true},target);
|
||||
}
|
||||
},
|
||||
ai:{
|
||||
save:true,
|
||||
skillTagFilter(player){
|
||||
return player.getExpansions('olchunlao').length;
|
||||
},
|
||||
order:6,
|
||||
result:{target:1},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
//虞翻
|
||||
olzongxuan:{
|
||||
audio:'rezongxuan',
|
||||
trigger:{global:['loseAfter','loseAsyncAfter']},
|
||||
filter(event,player){
|
||||
if(event.type!='discard'||event.getlx===false) return false;
|
||||
return get.info('olzongxuan').getCards(event,player).length;
|
||||
},
|
||||
check(event,player){
|
||||
if(event.getParent(3).name!='phaseDiscard') return false;
|
||||
const cards=get.info('olzongxuan').getCards(event,player);
|
||||
return game.hasPlayer(target=>{
|
||||
if(cards.some(i=>get.type(i,target)=='equip')&&(get.attitude(player,target)>0||get.recoverEffect(target,player,player)>0)) return true;
|
||||
if(cards.some(i=>get.type(i,target)!='equip')&&target.getHp()>=player.getHp()&&get.effect(target,{name:'losehp'},player,player)>0) return true;
|
||||
return false;
|
||||
});
|
||||
},
|
||||
async content(event,trigger,player){
|
||||
const {result:{bool,moved}}=await player.chooseToMove('纵玄:将任意张牌置于牌堆顶',true).set('list',[
|
||||
['本次弃置的牌',get.info('olzongxuan').getCards(trigger,player)],
|
||||
['牌堆顶'],
|
||||
]).set('filterOk',moved=>moved[1].length).set('processAI',list=>{
|
||||
const player=get.event('player');
|
||||
const cards=list[0][1].slice(),cards2=cards.filter(card=>{
|
||||
return game.hasPlayer(target=>{
|
||||
if(get.type(card,target)=='equip'&&(get.attitude(player,target)>0||get.recoverEffect(target,player,player)>0)) return true;
|
||||
if(get.type(card,target)!='equip'&&target.getHp()>=player.getHp()&&get.effect(target,{name:'losehp'},player,player)>0) return true;
|
||||
return false;
|
||||
});
|
||||
}),cards3=(cards2.length?cards2.randomGet():cards.randomGet());
|
||||
return [[],[cards3]];
|
||||
});
|
||||
if(bool){
|
||||
let cards=moved[1].slice();
|
||||
game.log(player,'将',cards,'置于了牌堆顶');
|
||||
while(cards.length){
|
||||
ui.cardPile.insertBefore(cards.pop().fix(),ui.cardPile.firstChild);
|
||||
}
|
||||
}
|
||||
},
|
||||
getCards(event,player){
|
||||
let cards=[];
|
||||
for(const target of [player,player.getPrevious()]){
|
||||
const evt=event.getl(target);
|
||||
if(evt&&evt.cards2&&evt.cards2.some(i=>get.position(i)=='d')) cards.addArray(evt.cards2.filter(i=>get.position(i)=='d'));
|
||||
}
|
||||
return cards;
|
||||
},
|
||||
},
|
||||
olzhiyan:{
|
||||
audio:'zhiyan',
|
||||
audioname:['re_yufan'],
|
||||
trigger:{global:'phaseJieshuBegin'},
|
||||
filter(event,player){
|
||||
return event.player==player||event.player==player.getPrevious();
|
||||
},
|
||||
direct:true,
|
||||
async content(event,trigger,player){
|
||||
const {result:{bool,targets}}=await player.chooseTarget(get.prompt2('olzhiyan')).set('ai',target=>{
|
||||
const player=get.event('player'),cards=get.event('cards');
|
||||
if(!cards.length) return 0;
|
||||
const card=cards[0],att=get.attitude(player,target);
|
||||
if(get.type(card,target)=='equip'&&(get.attitude(player,target)>0||get.recoverEffect(target,player,player)>0)) return get.recoverEffect(target,player,player)*20+att/114514;
|
||||
if(get.type(card,target)!='equip'){
|
||||
if(target.getHp()>=player.getHp()) return get.effect(target,{name:'losehp'},player,player)*20-att/114514;
|
||||
return get.effect(target,{name:'draw'},player,player);
|
||||
}
|
||||
return 0;
|
||||
}).set('cards',Array.from(ui.cardPile.childNodes||[])||[]);
|
||||
if(bool){
|
||||
const target=targets[0];
|
||||
player.logSkill('olzhiyan',target);
|
||||
const {result}=await target.draw('visible');
|
||||
if(result){
|
||||
const card=result[0];
|
||||
if(get.type(card,target)=='equip'){
|
||||
if(target.getCards('h').includes(card)&&target.hasUseTarget(card)){
|
||||
const {result:{bool}}=await target.chooseUseTarget(card,true,'nopopup');
|
||||
if(bool) await target.recover();
|
||||
}
|
||||
}
|
||||
else if(target.getHp()>=player.getHp()) await target.loseHp();
|
||||
}
|
||||
}
|
||||
},
|
||||
ai:{expose:0.2},
|
||||
},
|
||||
//OL谋袁绍
|
||||
//真·四世三公——袁神,启动
|
||||
olsbhetao:{
|
||||
|
@ -1067,9 +1293,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
sizhaojian_append:'<span class="text" style="font-family: yuanli">【思召剑】于闪闪节(3月2日-3月15日)外离开装备区后,销毁此牌</span>',
|
||||
olsbshishou:'士首',
|
||||
olsbshishou_info:'主公技,其他群势力角色失去装备区的牌后,若你的装备区中没有武器牌,其可将【思召剑】置入你的装备区。',
|
||||
ol_yufan:'OL界虞翻',
|
||||
ol_yufan_prefix:'OL界',
|
||||
olzongxuan:'纵玄',
|
||||
olzongxuan_info:'当你或你的上家因弃置而失去牌后,你可以将位于弃牌堆的这些牌中的任意牌以任意顺序置于牌堆顶。',
|
||||
olzhiyan:'直言',
|
||||
olzhiyan_info:'你或你的上家的结束阶段,你可以令一名角色正面朝上摸一张牌,然后若此牌:为装备牌,则其使用此牌并回复1点体力;不为装备牌且其体力值大于等于你,则其失去1点体力。',
|
||||
ol_chengpu:'OL界程普',
|
||||
ol_chengpu_prefix:'OL界',
|
||||
dclihuo:'疠火',
|
||||
dclihuo_info:'①你使用的非火【杀】可以改为火【杀】,若如此做,此牌结算完毕后,若此牌造成过伤害,则你弃置一张牌或失去1点体力。②你使用火【杀】可以额外指定一个目标。',
|
||||
olchunlao:'醇醪',
|
||||
olchunlao_info:'①当你的【杀】因弃置进入弃牌堆后,你将位于弃牌堆的这些牌称为“醇”置于武将牌上。②一名角色处于濒死状态时,你可以将一张“醇”置入弃牌堆,然后令其视为使用一张【酒】。',
|
||||
|
||||
onlyOL_yijiang1:'OL专属·将1',
|
||||
onlyOL_yijiang2:'OL专属·将2',
|
||||
onlyOL_yijiang3:'OL专属·将3',
|
||||
onlyOL_sb:'OL专属·上兵伐谋',
|
||||
},
|
||||
};
|
||||
|
|
|
@ -920,6 +920,7 @@ window.noname_character_rank={
|
|||
'sp_jiangwan',
|
||||
'xinchang',
|
||||
'xin_yufan',
|
||||
'ol_yufan',
|
||||
'tw_re_caohong',
|
||||
'tw_mayunlu',
|
||||
'tw_hucheer',
|
||||
|
@ -1539,6 +1540,7 @@ window.noname_character_rank={
|
|||
'sp_jiben',
|
||||
'sp_fuwan',
|
||||
're_chengpu',
|
||||
'ol_chengpu',
|
||||
're_niujin',
|
||||
'wangfuzhaolei',
|
||||
'caizhenji',
|
||||
|
@ -2409,6 +2411,7 @@ window.noname_character_rank={
|
|||
're_liubiao',
|
||||
'liubiao',
|
||||
're_chengpu',
|
||||
'ol_chengpu',
|
||||
're_manchong',
|
||||
're_yufan',
|
||||
're_liru',
|
||||
|
@ -2516,6 +2519,7 @@ window.noname_character_rank={
|
|||
'sp_zhangchangpu',
|
||||
'ol_dongzhao',
|
||||
'xin_yufan',
|
||||
'ol_yufan',
|
||||
'xuangongzhu',
|
||||
'xinchang',
|
||||
'tw_mayunlu',
|
||||
|
|
|
@ -11709,16 +11709,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
filter:function (event){
|
||||
return (event.num>0)
|
||||
},
|
||||
getIndex(event, player, triggername){
|
||||
return event.num;
|
||||
},
|
||||
content:function (){
|
||||
'step 0'
|
||||
event.count=trigger.num;
|
||||
'step 1'
|
||||
player.draw(2);
|
||||
event.count--;
|
||||
if(_status.connectMode) game.broadcastAll(function(){_status.noclearcountdown=true});
|
||||
event.given_map={};
|
||||
event.num=2;
|
||||
'step 2'
|
||||
'step 1'
|
||||
player.chooseCardTarget({
|
||||
filterCard:function(card){
|
||||
return get.itemtype(card)=='card'&&!card.hasGaintag('reyiji_tag');
|
||||
|
@ -11737,7 +11737,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
return get.value(card,target)*get.attitude(player,target);
|
||||
},
|
||||
});
|
||||
'step 3'
|
||||
'step 2'
|
||||
if(result.bool){
|
||||
var res=result.cards,target=result.targets[0].playerid;
|
||||
player.addGaintag(res,'reyiji_tag');
|
||||
|
@ -11750,9 +11750,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(_status.connectMode){
|
||||
game.broadcastAll(function(){delete _status.noclearcountdown;game.stopCountChoose()});
|
||||
}
|
||||
event.goto(5);
|
||||
event.finish();
|
||||
}
|
||||
'step 4'
|
||||
'step 3'
|
||||
if(_status.connectMode){
|
||||
game.broadcastAll(function(){delete _status.noclearcountdown;game.stopCountChoose()});
|
||||
}
|
||||
|
@ -11771,16 +11771,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
giver:player,
|
||||
animate:'giveAuto',
|
||||
}).setContent('gaincardMultiple');
|
||||
'step 5'
|
||||
if(event.count>0&&player.hasSkill('new_reyiji')){
|
||||
player.chooseBool(get.prompt2('new_reyiji'));
|
||||
}
|
||||
else event.finish();
|
||||
'step 6'
|
||||
if(result.bool){
|
||||
player.logSkill('new_reyiji');
|
||||
event.goto(1);
|
||||
}
|
||||
},
|
||||
ai:{
|
||||
maixie:true,
|
||||
|
|
|
@ -342,6 +342,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
async content(event,trigger,player){
|
||||
if (_status.connectMode) game.broadcastAll(() => { _status.noclearcountdown = true });
|
||||
const given_map = {};
|
||||
event.given_map = given_map;
|
||||
const expansions = player.getExpansions('sbqingjian');
|
||||
let result;
|
||||
while (true) {
|
||||
|
@ -358,8 +359,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
result = await player.chooseTarget(`选择一名角色获得${get.translation(toGive)}`, expansions.length === 1).set('ai', target => {
|
||||
const att = get.attitude(get.player(), target);
|
||||
if (get.event('toEnemy')) return Math.max(0.01, 100 - att);
|
||||
else if (att > 0) return Math.max(0.1, att / (1 + target.countCards('h') + (get.event().getParent().given_map[target.playerid] || 0)));
|
||||
else return Math.max(0.01, (100 + att) / 100);
|
||||
else if (att > 0) return Math.max(0.1, att / Math.sqrt(1 + target.countCards('h') + (get.event().getParent().given_map[target.playerid] || 0)));
|
||||
else return Math.max(0.01, (100 + att) / 200);
|
||||
}).set('toEnemy', get.value(toGive[0], player, 'raw') < 0).forResult();
|
||||
if (result.bool) {
|
||||
expansions.removeArray(toGive);
|
||||
|
|
|
@ -98,17 +98,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
stdshushen:{
|
||||
audio:'shushen',
|
||||
trigger:{player:'recoverEnd'},
|
||||
direct:true,
|
||||
getIndex(event){
|
||||
return event.num||1;
|
||||
},
|
||||
async cost(event,trigger,player){
|
||||
event.result = await player.chooseTarget(get.prompt2('stdshushen'),lib.filter.notMe)
|
||||
.set('ai',target=>get.attitude(_status.event.player,target)).forResult();
|
||||
},
|
||||
async content(event,trigger,player){
|
||||
event.num=trigger.num||1;
|
||||
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) return;
|
||||
const target=targets[0];
|
||||
player.logSkill('stdshushen',target);
|
||||
target.draw(target.countCards('h')?1:2);
|
||||
}while(--event.num>0&&player.hasSkill('stdshushen'));
|
||||
const target = event.targets[0];
|
||||
await target.draw(target.countCards('h') > 0 ? 1 : 2);
|
||||
},
|
||||
ai:{threaten:0.8,expose:0.1},
|
||||
},
|
||||
|
@ -178,13 +177,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
trigger:{global:'useCardToTarget'},
|
||||
logTarget:'target',
|
||||
audio:'tongji',
|
||||
direct:true,
|
||||
filter(event,player){
|
||||
return event.card.name=='sha'&&event.player!=player&&!event.targets.includes(player)&&
|
||||
event.target.inRange(player)&&event.target.countCards('he')>0;
|
||||
},
|
||||
async content(event,trigger,player){
|
||||
const {result:{bool,cards}}=await trigger.target.chooseCard('he','是否对'+get.translation(player)+'发动【同疾】?','弃置一张牌,将'+get.translation(trigger.card)+'转移给'+get.translation(player))
|
||||
async cost(event, trigger, player){
|
||||
const {result} = await trigger.target.chooseCard('he', '是否对'+get.translation(player)+'发动【同疾】?',
|
||||
'弃置一张牌,将'+get.translation(trigger.card)+'转移给'+get.translation(player), lib.filter.cardDiscardable)
|
||||
.set('ai',card=>{
|
||||
if(!_status.event.check) return -1;
|
||||
return get.unuseful(card)+9;
|
||||
|
@ -204,15 +203,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
return -1;
|
||||
})()>0);
|
||||
if(bool){
|
||||
player.logSkill('retongji',trigger.target);
|
||||
trigger.target.discard(cards);
|
||||
const evt=trigger.getParent();
|
||||
evt.triggeredTargets2.remove(trigger.target);
|
||||
evt.targets.remove(trigger.target);
|
||||
evt.targets.push(player);
|
||||
if(result.bool){
|
||||
event.result = {
|
||||
bool:true,
|
||||
cost_data:{
|
||||
cards: result.cards
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
async content(event,trigger,player){
|
||||
trigger.target.discard(event.cost_data.cards);
|
||||
const evt=trigger.getParent();
|
||||
evt.triggeredTargets2.remove(trigger.target);
|
||||
evt.targets.remove(trigger.target);
|
||||
evt.targets.push(player);
|
||||
},
|
||||
},
|
||||
hujia:{
|
||||
audio:2,
|
||||
|
@ -324,13 +330,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
guicai:{
|
||||
audio:2,
|
||||
trigger:{global:'judge'},
|
||||
direct:true,
|
||||
preHidden:true,
|
||||
filter(event,player){
|
||||
return player.countCards(get.mode()=='guozhan'?'hes':'hs')>0;
|
||||
},
|
||||
async content(event,trigger,player){
|
||||
const {result:{bool:chooseCardResultBool,cards:chooseCardResultCards}}=await player.chooseCard(get.translation(trigger.player)+'的'+(trigger.judgestr||'')+'判定为'+
|
||||
async cost(event, trigger, player){
|
||||
const {result:{bool,cards}}=await player.chooseCard(get.translation(trigger.player)+'的'+(trigger.judgestr||'')+'判定为'+
|
||||
get.translation(trigger.player.judging[0])+','+get.prompt('guicai'),get.mode()=='guozhan'?'hes':'hs',card=>{
|
||||
const player=_status.event.player;
|
||||
const mod2=game.checkMod(card,player,'unchanged','cardEnabled2',player);
|
||||
|
@ -352,7 +357,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
return -result-get.value(card)/2;
|
||||
}
|
||||
}).set('judging',trigger.player.judging[0]).setHiddenSkill('guicai');
|
||||
if(!chooseCardResultBool) return;
|
||||
if(bool) event.result = {bool,cost_data:{cards}}
|
||||
},
|
||||
//技能的logSkill跟着打出牌走 不进行logSkill
|
||||
popup:false,
|
||||
async content(event,trigger,player){
|
||||
const chooseCardResultCards = event.cost_data.cards;
|
||||
player.respond(chooseCardResultCards,'guicai','highlight','noOrdering');
|
||||
if(trigger.player.judging[0].clone){
|
||||
trigger.player.judging[0].clone.classList.remove('thrownhighlight');
|
||||
|
@ -418,29 +428,30 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
ganglie_three:{
|
||||
audio:'ganglie',
|
||||
trigger:{player:'damageEnd'},
|
||||
direct:true,
|
||||
async content(event,trigger,player){
|
||||
const {result:{bool:chooseTargetResultBool,targets:chooseTargetResultTargets}}=await player.chooseTarget(get.prompt2('ganglie_three'),(card,player,target)=>{
|
||||
async cost(event, trigger, player){
|
||||
const {result} = await player.chooseTarget(get.prompt2('ganglie_three'),(card,player,target)=>{
|
||||
return target.isEnemyOf(player);
|
||||
}).set('ai',target=>{
|
||||
return -get.attitude(_status.event.player,target)/(1+target.countCards('h'));
|
||||
return -get.attitude(_status.event.player,target)/Math.sqrt(1+target.countCards('h'));
|
||||
});
|
||||
if(!chooseTargetResultBool) return;
|
||||
event.target=chooseTargetResultTargets[0];
|
||||
player.logSkill('ganglie_three',event.target);
|
||||
event.result = result;
|
||||
},
|
||||
async content(event, trigger, player){
|
||||
event.target = event.targets[0];
|
||||
player.logSkill('ganglie_three', event.target);
|
||||
const judgeEvent=player.judge(card=>{
|
||||
if(get.suit(card)=='heart') return -2;
|
||||
return 2;
|
||||
});
|
||||
judgeEvent.judge2=result=>result.bool;
|
||||
const {result:{judge}}=await judgeEvent;
|
||||
if(judge<2) return;
|
||||
const {result:{bool:chooseToDiscardResultBool}}=await event.target.chooseToDiscard(2).set('ai',card=>{
|
||||
if(card.name=='tao') return -10;
|
||||
if(card.name=='jiu'&&_status.event.player.hp==1) return -10;
|
||||
judgeEvent.judge2 = (result => result.bool);
|
||||
const {result:{judge}} = await judgeEvent;
|
||||
if (judge < 2) return;
|
||||
const {result:{bool:chooseToDiscardResultBool}} = await event.target.chooseToDiscard(2).set('ai',card=>{
|
||||
if (card.name=='tao') return -10;
|
||||
if (card.name=='jiu' && _status.event.player.hp==1) return -10;
|
||||
return get.unuseful(card)+2.5*(5-get.owner(card).hp);
|
||||
});
|
||||
if(chooseToDiscardResultBool==false){
|
||||
if (chooseToDiscardResultBool === false) {
|
||||
event.target.damage();
|
||||
}
|
||||
},
|
||||
|
@ -458,24 +469,24 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
tuxi:{
|
||||
audio:2,
|
||||
trigger:{player:'phaseDrawBegin1'},
|
||||
direct:true,
|
||||
filter(event,player){
|
||||
return !event.numFixed;
|
||||
},
|
||||
async content(event,trigger,player){
|
||||
let num=game.countPlayer(current=>current!=player&¤t.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=>{
|
||||
if(!_status.event.aicheck) return 0;
|
||||
const att=get.attitude(_status.event.player,target);
|
||||
if(target.hasSkill('tuntian')) return att/10;
|
||||
return 1-att;
|
||||
}).set('aicheck',check);
|
||||
if(!bool) return;
|
||||
player.logSkill('tuxi',targets);
|
||||
player.gainMultiple(targets);
|
||||
async cost(event, trigger, player){
|
||||
let num = game.countPlayer(current => current != player && current.countCards('h') && get.attitude(player,current) <= 0);
|
||||
let check = (num >= 2);
|
||||
const {result} = await player.chooseTarget(get.prompt('tuxi'), '获得其他一至两名角色的各一张手牌', [1,2], (card, player, target) => {
|
||||
return target.countCards('h') > 0 && player != target;
|
||||
}, target => {
|
||||
if (!_status.event.aicheck) return 0;
|
||||
const att=get.attitude(_status.event.player, target);
|
||||
if (target.hasSkill('tuntian')) return att / 10;
|
||||
return 1 - att;
|
||||
}).set('aicheck', check);
|
||||
event.result = result;
|
||||
},
|
||||
async content(event, trigger, player){
|
||||
player.gainMultiple(event.targets);
|
||||
trigger.changeToZero();
|
||||
game.asyncDelay();
|
||||
},
|
||||
|
@ -540,71 +551,63 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
filter(event){
|
||||
return event.num>0;
|
||||
},
|
||||
async content(event,trigger,player){
|
||||
event.count=trigger.num;
|
||||
// event.goto -> while
|
||||
while(true){
|
||||
event.count--;
|
||||
const {cards}=await game.cardsGotoOrdering(get.cards(2));
|
||||
if(_status.connectMode) game.broadcastAll(function(){_status.noclearcountdown=true});
|
||||
event.given_map={};
|
||||
if(!cards.length) return;
|
||||
// event.goto -> do while
|
||||
do{
|
||||
const {result:{bool,links}} =
|
||||
cards.length==1?
|
||||
{result:{links:cards.slice(0),bool: true}}:
|
||||
await player.chooseCardButton('遗计:请选择要分配的牌',true,cards,[1,cards.length])
|
||||
.set('ai',()=>{
|
||||
if(ui.selected.buttons.length==0) return 1;
|
||||
return 0;
|
||||
});
|
||||
if(!bool) return;
|
||||
cards.removeArray(links);
|
||||
event.togive=links.slice(0);
|
||||
const {result:{targets}}=await player.chooseTarget('选择一名角色获得'+get.translation(links),true)
|
||||
.set('ai',target=>{
|
||||
const att=get.attitude(_status.event.player,target);
|
||||
if(_status.event.enemy){
|
||||
return -att;
|
||||
}
|
||||
else if(att>0){
|
||||
return att/(1+target.countCards('h'));
|
||||
}
|
||||
else{
|
||||
return att/100;
|
||||
}
|
||||
})
|
||||
.set('enemy',get.value(event.togive[0],player,'raw')<0);
|
||||
if(targets.length){
|
||||
const id=targets[0].playerid,
|
||||
map=event.given_map;
|
||||
if(!map[id]) map[id]=[];
|
||||
map[id].addArray(event.togive);
|
||||
}
|
||||
}while(cards.length>0);
|
||||
if(_status.connectMode){
|
||||
game.broadcastAll(function(){delete _status.noclearcountdown;game.stopCountChoose()});
|
||||
getIndex(event, player, triggername){
|
||||
return event.num;
|
||||
},
|
||||
async content(event, trigger, player){
|
||||
const {cards}=await game.cardsGotoOrdering(get.cards(2));
|
||||
if(_status.connectMode) game.broadcastAll(function(){_status.noclearcountdown=true});
|
||||
event.given_map={};
|
||||
if(!cards.length) return;
|
||||
// event.goto -> do while
|
||||
do{
|
||||
const {result:{bool,links}} =
|
||||
cards.length==1?
|
||||
{result:{links:cards.slice(0),bool: true}}:
|
||||
await player.chooseCardButton('遗计:请选择要分配的牌',true,cards,[1,cards.length])
|
||||
.set('ai',()=>{
|
||||
if(ui.selected.buttons.length==0) return 1;
|
||||
return 0;
|
||||
});
|
||||
if(!bool) return;
|
||||
cards.removeArray(links);
|
||||
event.togive=links.slice(0);
|
||||
const {result:{targets}}=await player.chooseTarget('选择一名角色获得'+get.translation(links),true)
|
||||
.set('ai',target=>{
|
||||
const att=get.attitude(_status.event.player,target);
|
||||
if(_status.event.enemy){
|
||||
return -att;
|
||||
}
|
||||
else if(att>0){
|
||||
return att/(1+target.countCards('h'));
|
||||
}
|
||||
else{
|
||||
return att/100;
|
||||
}
|
||||
})
|
||||
.set('enemy',get.value(event.togive[0],player,'raw')<0);
|
||||
if(targets.length){
|
||||
const id=targets[0].playerid,
|
||||
map=event.given_map;
|
||||
if(!map[id]) map[id]=[];
|
||||
map[id].addArray(event.togive);
|
||||
}
|
||||
const list=[];
|
||||
for(const i in event.given_map){
|
||||
const source=(_status.connectMode?lib.playerOL:game.playerMap)[i];
|
||||
player.line(source,'green');
|
||||
if(player!==source&&(get.mode()!=='identity'||player.identity!=='nei')) player.addExpose(0.2);
|
||||
list.push([source, event.given_map[i]]);
|
||||
}
|
||||
game.loseAsync({
|
||||
gain_list:list,
|
||||
giver:player,
|
||||
animate:'draw',
|
||||
}).setContent('gaincardMultiple');
|
||||
if(event.count>0&&player.hasSkill(event.name)&&!get.is.blocked(event.name, player)){
|
||||
const {result:{bool:chooseBoolResultBool}}=await player.chooseBool(get.prompt2(event.name)).set('frequentSkill',event.name);
|
||||
if(chooseBoolResultBool) player.logSkill(event.name);
|
||||
else return;
|
||||
}
|
||||
else return;
|
||||
}while(cards.length>0);
|
||||
if(_status.connectMode){
|
||||
game.broadcastAll(function(){delete _status.noclearcountdown;game.stopCountChoose()});
|
||||
}
|
||||
const list=[];
|
||||
for(const i in event.given_map){
|
||||
const source=(_status.connectMode?lib.playerOL:game.playerMap)[i];
|
||||
player.line(source,'green');
|
||||
if(player!==source&&(get.mode()!=='identity'||player.identity!=='nei')) player.addExpose(0.2);
|
||||
list.push([source, event.given_map[i]]);
|
||||
}
|
||||
game.loseAsync({
|
||||
gain_list:list,
|
||||
giver:player,
|
||||
animate:'draw',
|
||||
}).setContent('gaincardMultiple');
|
||||
},
|
||||
ai:{
|
||||
maixie:true,
|
||||
|
@ -1632,7 +1635,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
audio:2,
|
||||
audioname:['re_daqiao','daxiaoqiao'],
|
||||
trigger:{target:'useCardToTarget'},
|
||||
direct:true,
|
||||
preHidden:true,
|
||||
filter(event,player){
|
||||
if(event.card.name!='sha') return false;
|
||||
|
@ -1642,8 +1644,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
current!=player&&lib.filter.targetEnabled(event.card,event.player,current);
|
||||
});
|
||||
},
|
||||
async content(event,trigger,player){
|
||||
const [bool,targets,cards]=await player.chooseCardTarget({
|
||||
async cost(event,trigger,player){
|
||||
event.result = await player.chooseCardTarget({
|
||||
position:'he',
|
||||
filterCard:lib.filter.cardDiscardable,
|
||||
filterTarget:(card,player,target)=>{
|
||||
|
@ -1674,17 +1676,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
source:trigger.player,
|
||||
card:trigger.card,
|
||||
})
|
||||
.setHiddenSkill(event.name)
|
||||
.forResult('bool','targets','cards');
|
||||
if(bool){
|
||||
const target=targets[0];
|
||||
player.logSkill(event.name,target);
|
||||
player.discard(cards);
|
||||
const evt=trigger.getParent();
|
||||
evt.triggeredTargets2.remove(player);
|
||||
evt.targets.remove(player);
|
||||
evt.targets.push(target);
|
||||
}
|
||||
.setHiddenSkill(event.name).forResult();
|
||||
},
|
||||
async content(event,trigger,player){
|
||||
const target = event.targets[0];
|
||||
player.logSkill(event.name,target);
|
||||
player.discard(event.cards);
|
||||
const evt=trigger.getParent();
|
||||
evt.triggeredTargets2.remove(player);
|
||||
evt.targets.remove(player);
|
||||
evt.targets.push(target);
|
||||
},
|
||||
ai:{
|
||||
effect:{
|
||||
|
@ -1759,23 +1760,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
global:['equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter'],
|
||||
},
|
||||
frequent:true,
|
||||
filter(event,player){
|
||||
getIndex(event, player){
|
||||
const evt=event.getl(player);
|
||||
return evt&&evt.player==player&&evt.es&&evt.es.length>0;
|
||||
if (evt && evt.player === player && evt.es) return evt.es.length;
|
||||
return false;
|
||||
},
|
||||
async content(event,trigger,player){
|
||||
event.count=trigger.getl(player).es.length;
|
||||
while(event.count-->0){
|
||||
player.draw(2);
|
||||
if(!event.count||!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;
|
||||
}
|
||||
}
|
||||
player.draw(2);
|
||||
},
|
||||
ai:{
|
||||
noe:true,
|
||||
|
@ -2209,9 +2200,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
trigger:{
|
||||
player:"phaseDrawEnd",
|
||||
},
|
||||
direct:true,
|
||||
async content(event,trigger,player){
|
||||
const list=['弃牌','摸牌','取消'];
|
||||
async cost(event,trigger,player){
|
||||
const list=['弃牌','摸牌','cancel2'];
|
||||
if(!player.countCards('he')) list.remove('弃牌');
|
||||
const control=await player.chooseControl(list,()=>{
|
||||
const player=_status.event.player;
|
||||
|
@ -2230,16 +2220,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
})
|
||||
.set('prompt',get.prompt2('new_jiangchi'))
|
||||
.forResultControl();
|
||||
if (control === 'cancel2') event.result = {bool: false};
|
||||
else event.result = {
|
||||
bool: true,
|
||||
cost_data: control
|
||||
};
|
||||
},
|
||||
async content(event,trigger,player){
|
||||
const control = event.cost_data;
|
||||
|
||||
if(control=='弃牌'){
|
||||
player.chooseToDiscard(true,'he');
|
||||
player.addTempSkill('jiangchi2','phaseUseEnd');
|
||||
player.logSkill('new_jiangchi');
|
||||
}
|
||||
else if(control=='摸牌'){
|
||||
player.draw();
|
||||
player.addTempSkill('new_jiangchi3','phaseEnd');
|
||||
player.logSkill('new_jiangchi');
|
||||
}
|
||||
},
|
||||
},
|
||||
|
@ -2301,30 +2297,27 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
global:['dying','gainAfter','loseAsyncAfter'],
|
||||
},
|
||||
audio:2,
|
||||
filter(event,player){
|
||||
if(event.name=='dying') return true;
|
||||
if(event.giver!=player) return false;
|
||||
if(event.name=='gain'){
|
||||
return event.player!=player&&event.getg(event.player).length>0;
|
||||
getIndex:function(event, player){
|
||||
if (event.name !== 'loseAsync') return [event.player];
|
||||
else return game.filterPlayer(current => current != player && event.getg(current).length > 0).sortBySeat();
|
||||
},
|
||||
filter(event, player, triggername, target){
|
||||
if (!target.isIn()) return false;
|
||||
if (event.name === 'dying') return true;
|
||||
if (event.giver !== player) return false;
|
||||
if (event.name === 'gain') {
|
||||
return event.player!=player&&event.getg(target).length>0;
|
||||
}
|
||||
return game.hasPlayer(current=>current!=player&&event.getg(current).length>0);
|
||||
},
|
||||
direct:true,
|
||||
async content(event,trigger,player){
|
||||
if(trigger.name!='loseAsync') event.targets=[trigger.player];
|
||||
else event.targets=game.filterPlayer(current=>current!=player&&trigger.getg(current).length>0);
|
||||
do{
|
||||
const target=event.targets.shift();
|
||||
event.target=target;
|
||||
const {result:{bool}}=await player.chooseBool(get.prompt2('xinfu_jiyuan',target)).set('ai',()=>{
|
||||
const evt=_status.event;
|
||||
return get.attitude(player,evt.getParent().target)>0;
|
||||
});
|
||||
if(bool){
|
||||
player.logSkill('xinfu_jiyuan',target);
|
||||
target.draw();
|
||||
}
|
||||
}while(event.targets.length>0);
|
||||
logTarget(event, player, triggername, target){
|
||||
return target;
|
||||
},
|
||||
check(event, player, triggername, target){
|
||||
return get.attitude(player,target) > 0;
|
||||
},
|
||||
async content(event, trigger, player){
|
||||
event.targets[0].draw();
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -15597,7 +15597,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
twfengji:'蜂集',
|
||||
twfengji_info:'出牌阶段开始时,若你没有“示”,则你可以将一张牌作为“示”置于武将牌上并施法:从牌堆中获得X张与“示”牌名相同的牌,然后移去“示”。',
|
||||
twyiju:'蚁聚',
|
||||
twyiju_info:'非锁定技。若你的武将牌上有“示”,则:①你使用【杀】的次数上限和攻击范围的基数改为你的体力值。②当你受到伤害时,你移去“示”,且令此伤害+1。',
|
||||
twyiju_info:'若你的武将牌上有“示”,则:①你使用【杀】的次数上限和攻击范围的基数改为你的体力值。②当你受到伤害时,你移去“示”,且令此伤害+1。',
|
||||
twbudao:'布道',
|
||||
twbudao_info:'限定技。准备阶段,你可减1点体力上限,回复1点体力并选择获得一个〖布道〗技能池里的技能(三选一)。然后你可以令一名其他角色也获得此技能并交给你一张牌。',
|
||||
twzhouhu:'咒护',
|
||||
|
|
|
@ -5415,7 +5415,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
frequent:true,
|
||||
filter:function(event,player,name){
|
||||
if(player==_status.currentPhase) return (name=='logSkill'&&event.skill=='dcliying'&&player.getExpansions('dcwangyuan').length<game.countPlayer());
|
||||
if(player==_status.currentPhase) return (name=='logSkill'&&event.skill=='dcliying'&&player.getExpansions('dcwangyuan').length<game.countPlayer2());
|
||||
if(name=='logSkill') return false;
|
||||
if(player.getExpansions('dcwangyuan').length>=game.countPlayer()) return false;
|
||||
if(event.name=='gain'&&event.player==player) return false;
|
||||
|
|
|
@ -13933,14 +13933,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
liaohua:['liaohua','re_liaohua','xin_liaohua'],
|
||||
bulianshi:['bulianshi','dc_bulianshi','re_bulianshi','old_bulianshi'],
|
||||
handang:['handang','xin_handang','re_handang','tw_handang','old_handang'],
|
||||
chengpu:['chengpu','re_chengpu','xin_chengpu','tw_chengpu','ns_chengpu'],
|
||||
chengpu:['chengpu','ol_chengpu','re_chengpu','xin_chengpu','tw_chengpu','ns_chengpu'],
|
||||
liubiao:['liubiao','xin_liubiao','re_liubiao','sb_liubiao','oldre_liubiao','old_liubiao'],
|
||||
manchong:['manchong','re_manchong'],
|
||||
caochong:['caochong','re_caochong','old_caochong'],
|
||||
guohuai:['guohuai','re_guohuai','xin_guohuai','tw_guohuai','ol_guohuai'],
|
||||
jianyong:['jianyong','ol_jianyong','re_jianyong','xin_jianyong'],
|
||||
panzhangmazhong:['panzhangmazhong','re_panzhangmazhong','xin_panzhangmazhong'],
|
||||
yufan:['yufan','xin_yufan','re_yufan'],
|
||||
yufan:['yufan','ol_yufan','xin_yufan','re_yufan'],
|
||||
zhuran:['zhuran','re_zhuran','xin_zhuran','old_zhuran'],
|
||||
liru:['xin_liru','dc_liru','re_liru','yj_liru','+liru'],
|
||||
fuhuanghou:['fuhuanghou','re_fuhuanghou','xin_fuhuanghou','old_fuhuanghou'],
|
||||
|
|
|
@ -3554,7 +3554,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
trigger:{global:'phaseJieshuBegin'},
|
||||
filter:function(event,player){
|
||||
return player.hasMark('xijue')&&event.player.isAlive()&&event.player!=player&&player.countCards('h',function(card){
|
||||
if(_status.connectMode) return true;
|
||||
if(_status.connectMode||get.mode()!='guozhan') return true;
|
||||
return get.type(card)=='basic';
|
||||
});
|
||||
},
|
||||
|
@ -3567,7 +3567,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(get.damageEffect(trigger.player,player,player)<=0){
|
||||
nono=true;
|
||||
}
|
||||
var next=player.chooseToDiscard('是否弃置一枚“爵”和一张基本牌,对'+get.translation(trigger.player)+'发动【骁果】?',{type:'basic'});
|
||||
var next=player.chooseToDiscard(`是否弃置一枚“爵”和一张${get.mode()=='guozhan'?'基本':'手'}牌,对${get.translation(trigger.player)}发动【骁果】?`,'h',function(card,player){
|
||||
if(get.mode()!='guozhan') return true;
|
||||
return get.type(card,player)=='basic';
|
||||
});
|
||||
next.set('ai',function(card){
|
||||
if(_status.event.nono) return 0;
|
||||
return 8-get.useful(card);
|
||||
|
@ -3799,7 +3802,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
xijue_tuxi_info:'摸牌阶段摸牌时,你可以少摸任意张牌,然后获得等量的角色的各一张手牌。',
|
||||
xijue_tuxi_info_guozhan:'摸牌阶段摸牌时,你可以少摸至多两张牌,然后获得等量的角色的各一张手牌。',
|
||||
xijue_xiaoguo:'骁果',
|
||||
xijue_xiaoguo_info:'其他角色的结束阶段开始时,你可以弃置一张基本牌,令该角色选择一项:1.弃置一张装备牌,然后你摸一张牌;2.受到你对其造成的1点伤害。',
|
||||
xijue_xiaoguo_info:'其他角色的结束阶段开始时,你可以弃置一张手牌,令该角色选择一项:1.弃置一张装备牌,然后你摸一张牌;2.受到你对其造成的1点伤害。',
|
||||
xijue_xiaoguo_info_guozhan:'其他角色的结束阶段开始时,你可以弃置一张基本牌,令该角色选择一项:1.弃置一张装备牌;2.受到你对其造成的1点伤害。',
|
||||
gz_duyu:'杜预',
|
||||
duyu:'晋杜预',
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
window.noname_asset_list=[
|
||||
'v1.10.8',
|
||||
'v1.10.10',
|
||||
/*audio start*/
|
||||
'audio/background/aozhan_chaoming.mp3',
|
||||
'audio/background/aozhan_online.mp3',
|
||||
|
@ -296,6 +296,8 @@ window.noname_asset_list=[
|
|||
'audio/die/dc_mengda.mp3',
|
||||
'audio/die/dc_ruiji.mp3',
|
||||
'audio/die/dc_sb_lusu.mp3',
|
||||
'audio/die/dc_sb_simayi.mp3',
|
||||
'audio/die/dc_sb_simayi_shadow.mp3',
|
||||
'audio/die/dc_sb_zhouyu.mp3',
|
||||
'audio/die/dc_sp_jiaxu.mp3',
|
||||
'audio/die/dc_sunchen.mp3',
|
||||
|
@ -627,6 +629,7 @@ window.noname_asset_list=[
|
|||
'audio/die/ol_sb_jiangwei.mp3',
|
||||
'audio/die/ol_sb_taishici.mp3',
|
||||
'audio/die/ol_sb_yuanshao.mp3',
|
||||
'audio/die/ol_sb_yuanshao_shadow.mp3',
|
||||
'audio/die/ol_sp_zhugeliang.mp3',
|
||||
'audio/die/ol_sunjian.mp3',
|
||||
'audio/die/ol_wangrong.mp3',
|
||||
|
@ -2103,6 +2106,14 @@ window.noname_asset_list=[
|
|||
'audio/skill/dcsbmengmou2.mp3',
|
||||
'audio/skill/dcsbmingshi1.mp3',
|
||||
'audio/skill/dcsbmingshi2.mp3',
|
||||
'audio/skill/dcsbpingliao_dc_sb_simayi_shadow1.mp3',
|
||||
'audio/skill/dcsbpingliao_dc_sb_simayi_shadow2.mp3',
|
||||
'audio/skill/dcsbpingliao1.mp3',
|
||||
'audio/skill/dcsbpingliao2.mp3',
|
||||
'audio/skill/dcsbquanmou_dc_sb_simayi_shadow1.mp3',
|
||||
'audio/skill/dcsbquanmou_dc_sb_simayi_shadow2.mp3',
|
||||
'audio/skill/dcsbquanmou1.mp3',
|
||||
'audio/skill/dcsbquanmou2.mp3',
|
||||
'audio/skill/dcsbronghuo1.mp3',
|
||||
'audio/skill/dcsbronghuo2.mp3',
|
||||
'audio/skill/dcsbyingmou1.mp3',
|
||||
|
@ -3671,17 +3682,31 @@ window.noname_asset_list=[
|
|||
'audio/skill/olsbfumeng2.mp3',
|
||||
'audio/skill/olsbguidao1.mp3',
|
||||
'audio/skill/olsbguidao2.mp3',
|
||||
'audio/skill/olsbhetao_ol_sb_yuanshao_shadow1.mp3',
|
||||
'audio/skill/olsbhetao_ol_sb_yuanshao_shadow2.mp3',
|
||||
'audio/skill/olsbhetao_ol_sb_yuanshao_shadow3.mp3',
|
||||
'audio/skill/olsbhetao1.mp3',
|
||||
'audio/skill/olsbhetao2.mp3',
|
||||
'audio/skill/olsbhetao3.mp3',
|
||||
'audio/skill/olsbranji1.mp3',
|
||||
'audio/skill/olsbranji2.mp3',
|
||||
'audio/skill/olsbshenli_ol_sb_yuanshao_shadow1.mp3',
|
||||
'audio/skill/olsbshenli_ol_sb_yuanshao_shadow2.mp3',
|
||||
'audio/skill/olsbshenli_ol_sb_yuanshao_shadow3.mp3',
|
||||
'audio/skill/olsbshenli1.mp3',
|
||||
'audio/skill/olsbshenli2.mp3',
|
||||
'audio/skill/olsbshenli3.mp3',
|
||||
'audio/skill/olsbshishou_ol_sb_yuanshao_shadow1.mp3',
|
||||
'audio/skill/olsbshishou_ol_sb_yuanshao_shadow2.mp3',
|
||||
'audio/skill/olsbshishou_ol_sb_yuanshao_shadow3.mp3',
|
||||
'audio/skill/olsbshishou1.mp3',
|
||||
'audio/skill/olsbshishou2.mp3',
|
||||
'audio/skill/olsbshishou3.mp3',
|
||||
'audio/skill/olsbweilin1.mp3',
|
||||
'audio/skill/olsbweilin2.mp3',
|
||||
'audio/skill/olsbyufeng_ol_sb_yuanshao_shadow1.mp3',
|
||||
'audio/skill/olsbyufeng1.mp3',
|
||||
'audio/skill/olsbyufeng2.mp3',
|
||||
'audio/skill/olsbzhuri1.mp3',
|
||||
'audio/skill/olsbzhuri2.mp3',
|
||||
'audio/skill/olshandao1.mp3',
|
||||
|
@ -7250,6 +7275,7 @@ window.noname_asset_list=[
|
|||
'image/character/hhzz_shiona.jpg',
|
||||
'image/character/hhzz_takaramono1.jpg',
|
||||
'image/character/hhzz_takaramono2.jpg',
|
||||
'image/character/hidden_image.jpg',
|
||||
'image/character/hs_aedwin.jpg',
|
||||
'image/character/hs_aerfusi.jpg',
|
||||
'image/character/hs_aiqinvyao.jpg',
|
||||
|
@ -7749,6 +7775,7 @@ window.noname_asset_list=[
|
|||
'image/character/ol_caiwenji.jpg',
|
||||
'image/character/ol_caozhang.jpg',
|
||||
'image/character/ol_chendeng.jpg',
|
||||
'image/character/ol_chengpu.jpg',
|
||||
'image/character/ol_dengai.jpg',
|
||||
'image/character/ol_dengzhi.jpg',
|
||||
'image/character/ol_dianwei.jpg',
|
||||
|
@ -7787,6 +7814,7 @@ window.noname_asset_list=[
|
|||
'image/character/ol_sb_jiangwei.jpg',
|
||||
'image/character/ol_sb_taishici.jpg',
|
||||
'image/character/ol_sb_yuanshao.jpg',
|
||||
'image/character/ol_sb_yuanshao_shadow.jpg',
|
||||
'image/character/ol_sp_zhugeliang.jpg',
|
||||
'image/character/ol_sunjian.jpg',
|
||||
'image/character/ol_wanglang.jpg',
|
||||
|
@ -7802,6 +7830,7 @@ window.noname_asset_list=[
|
|||
'image/character/ol_yanwen.jpg',
|
||||
'image/character/ol_yuanshao.jpg',
|
||||
'image/character/ol_yuanshu.jpg',
|
||||
'image/character/ol_yufan.jpg',
|
||||
'image/character/ol_yujin.jpg',
|
||||
'image/character/ol_zhangchangpu.jpg',
|
||||
'image/character/ol_zhangliao.jpg',
|
||||
|
|
|
@ -124,6 +124,7 @@ window.noname_source_list=[
|
|||
|
||||
'game/asset.js',
|
||||
'game/codemirror.js',
|
||||
'game/compiler-sfc.browser.js',
|
||||
'game/config.js',
|
||||
'game/core-js-bundle.js',
|
||||
'game/directory.js',
|
||||
|
@ -140,6 +141,7 @@ window.noname_source_list=[
|
|||
'game/server.js',
|
||||
'game/source.js',
|
||||
'game/update.js',
|
||||
'game/vue.esm-browser.js',
|
||||
|
||||
'image/card/cardtempname_bg.png',
|
||||
'image/flappybird/BG.png',
|
||||
|
|
|
@ -1,30 +1,27 @@
|
|||
window.noname_update={
|
||||
version:'1.10.9',
|
||||
update:'1.10.8',
|
||||
version:'1.10.10',
|
||||
update:'1.10.9',
|
||||
changeLog:[
|
||||
'整合@mengxinzxz @copcap @hadeszoro @universe-st @cjk7989 @PZ157 @lieren2023 @Ansolve @Rintim @kuangshen04 @XboxSoldier 的Pull Request',
|
||||
'OL谋袁绍、郭图、刘磐、陆凯、谋关羽(初版)',
|
||||
'十周年谋司马懿、曹爽、星张春华、司马师、王凌、蒋济、公孙修、胡遵、吕范、李傕郭汜、臧霸、陈武董袭',
|
||||
'“转化牌花色/点数”的模糊匹配',
|
||||
'整合@kuangshen04 @mengxinzxz @lieren2023 @nonameShijian @PZ157 @XboxSoldier @universe-st @copcap 的Pull Request',
|
||||
'OL界程普、界虞翻',
|
||||
'手杀杨奉、谋夏侯惇、谋高顺',
|
||||
'引入Vue框架和新的换肤机制',
|
||||
'其他AI优化与bug修复',
|
||||
],
|
||||
files:[
|
||||
'card/extra.js',
|
||||
'card/guozhan.js',
|
||||
'service-worker.js',
|
||||
|
||||
'card/mtg.js',
|
||||
'card/standard.js',
|
||||
|
||||
'character/clan.js',
|
||||
'character/collab.js',
|
||||
'character/ddd.js',
|
||||
'character/diy.js',
|
||||
'character/extra.js',
|
||||
'character/gwent.js',
|
||||
'character/huicui.js',
|
||||
'character/jsrg.js',
|
||||
'character/mobile.js',
|
||||
'character/offline.js',
|
||||
'character/old.js',
|
||||
'character/onlyOL.js',
|
||||
'character/ow.js',
|
||||
'character/rank.js',
|
||||
'character/refresh.js',
|
||||
'character/sb.js',
|
||||
|
@ -36,17 +33,19 @@ window.noname_update={
|
|||
'character/swd.js',
|
||||
'character/tw.js',
|
||||
'character/xianding.js',
|
||||
'character/xianjian.js',
|
||||
'character/xinghuoliaoyuan.js',
|
||||
'character/yijiang.js',
|
||||
'character/yingbian.js',
|
||||
'character/yxs.js',
|
||||
|
||||
'game/compiler-sfc.browser.js',
|
||||
'game/game.js',
|
||||
'game/pinyinjs.js',
|
||||
'game/vue.esm-browser.js',
|
||||
|
||||
'layout/default/layout.css',
|
||||
|
||||
'mode/boss.js',
|
||||
'mode/brawl.js',
|
||||
'mode/guozhan.js',
|
||||
'mode/identity.js',
|
||||
'mode/versus.js',
|
||||
|
||||
'noname/game/index.js',
|
||||
|
@ -56,17 +55,9 @@ window.noname_update={
|
|||
|
||||
'noname/library/index.js',
|
||||
|
||||
'noname/library/element/button.js',
|
||||
'noname/library/element/content.js',
|
||||
'noname/library/element/contents.js',
|
||||
'noname/library/element/gameEvent.js',
|
||||
'noname/library/element/player.js',
|
||||
'noname/library/element/vcard.js',
|
||||
|
||||
'noname/library/init/index.js',
|
||||
|
||||
'noname/ui/create/index.js',
|
||||
|
||||
'noname/ui/create/menu/index.js',
|
||||
]
|
||||
};
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 27 KiB |
Binary file not shown.
After Width: | Height: | Size: 52 KiB |
Binary file not shown.
After Width: | Height: | Size: 49 KiB |
|
@ -2688,6 +2688,12 @@ div:not(.handcards)>.card>.info>span,
|
|||
background: rgba(63, 119, 173,1);
|
||||
border: 1px solid rgba(63, 119, 173, 1);
|
||||
}
|
||||
.hp[data-condition="hidden"]>div:not(.lost):not(.shield) {
|
||||
background-image:url('../../theme/style/hp/image/hidden_hp.png') !important;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.hp[data-condition="high"]>div:not(.lost):not(.shield) {
|
||||
background: rgba(57, 123, 4,1);
|
||||
border: 1px solid rgba(39, 79, 7, 1);
|
||||
|
@ -2869,7 +2875,18 @@ div:not(.handcards)>.card>.info>span,
|
|||
#arena:not(.observe) .unseen2_v>.avatar2,
|
||||
#arena:not(.observe) .unseen_v>.name:not(.name2):not(.name_seat),
|
||||
#arena:not(.observe) .unseen2_v>.name2 {
|
||||
opacity: 0.2 !important
|
||||
opacity: 0.2 !important;
|
||||
}
|
||||
|
||||
.player>.unseen_show>.avatar,
|
||||
.player>.unseen2_show>.avatar2 {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
#arena:not(.observe) .player:not([data-position='0']).unseen_show>.avatar,
|
||||
#arena:not(.observe) .player:not([data-position='0']).unseen2_show>.avatar2 {
|
||||
opacity: 1 !important;
|
||||
background-image:url('../../image/character/hidden_image.jpg') !important;
|
||||
}
|
||||
|
||||
.player>.name_seat {
|
||||
|
|
|
@ -12797,6 +12797,11 @@ return event.junling=='junling5'?1:0;});
|
|||
inherit:'xiaoji',
|
||||
audio:'xiaoji',
|
||||
preHidden:true,
|
||||
getIndex(event, player){
|
||||
const evt=event.getl(player);
|
||||
if (evt && evt.player === player && evt.es) return 1;
|
||||
return false;
|
||||
},
|
||||
content:function(){
|
||||
player.draw(player==_status.currentPhase?1:3);
|
||||
}
|
||||
|
@ -13131,7 +13136,7 @@ return event.junling=='junling5'?1:0;});
|
|||
}
|
||||
var info=get.info(trigger.skill);
|
||||
var next=player.chooseBool('是否明置'+get.translation(event.name)+'以发动【'+get.translation(trigger.skill)+'】?');
|
||||
next.set('yes',!info.check||info.check(trigger._trigger,player));
|
||||
next.set('yes',!info.check||info.check(trigger._trigger,player,trigger.triggername,trigger.indexedData));
|
||||
next.set('hsskill',trigger.skill);
|
||||
next.set('ai',nai);
|
||||
}
|
||||
|
|
|
@ -4302,7 +4302,7 @@ export class Game extends Uninstantable {
|
|||
* @param { GameEventPromise } event
|
||||
* @returns { GameEventPromise }
|
||||
*/
|
||||
static createTrigger(name, skill, player, event) {
|
||||
static createTrigger(name, skill, player, event, indexedData) {
|
||||
let info = get.info(skill);
|
||||
if (!info) return false;
|
||||
if ((player.isOut() || player.removed) && !info.forceOut) return;
|
||||
|
@ -4314,6 +4314,7 @@ export class Game extends Uninstantable {
|
|||
next.forceDie = true;
|
||||
next.includeOut = true;
|
||||
next._trigger = event;
|
||||
next.indexedData = indexedData;
|
||||
next.setContent('createTrigger');
|
||||
return next;
|
||||
}
|
||||
|
|
|
@ -323,21 +323,23 @@ export class Get extends Uninstantable {
|
|||
static infoHp(hp) {
|
||||
if (typeof hp == 'number') return hp;
|
||||
else if (typeof hp == 'string' && hp.includes('/')) {
|
||||
return parseInt(hp.split('/')[0]);
|
||||
const num = hp.split('/')[0];
|
||||
if (num) return num == 'Infinity' ? Infinity : parseInt(num);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
static infoMaxHp(hp) {
|
||||
if (typeof hp == 'number') return hp;
|
||||
else if (typeof hp == 'string' && hp.includes('/')) {
|
||||
return parseInt(hp.split('/')[1]);
|
||||
const num = hp.split('/')[1];
|
||||
if (num) return num == 'Infinity' ? Infinity : parseInt(num);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
static infoHujia(hp) {
|
||||
if (typeof hp == 'string' && hp.includes('/')) {
|
||||
var splited = hp.split('/');
|
||||
if (splited.length > 2) return parseInt(splited[2]);
|
||||
const num = hp.split('/')[2];
|
||||
if (num) return num == 'Infinity' ? Infinity : parseInt(num);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -2134,7 +2134,9 @@ export const Content = {
|
|||
event.doing = doingList.shift();
|
||||
while(true){
|
||||
if (trigger.filterStop && trigger.filterStop()) return;
|
||||
const usableSkills = event.doing.todoList.filter(info => lib.filter.filterTrigger(trigger, info.player, event.triggername, info.skill));
|
||||
const usableSkills = event.doing.todoList.filter(info => {
|
||||
return lib.filter.filterTrigger(trigger, info.player, event.triggername, info.skill, info.indexedData);
|
||||
});
|
||||
if (usableSkills.length == 0){
|
||||
break;
|
||||
}
|
||||
|
@ -2155,25 +2157,32 @@ export const Content = {
|
|||
event.current = silentSkill;
|
||||
}
|
||||
else {
|
||||
const currentChoice = event.choice[0];
|
||||
if (event.choice.length == 1) {
|
||||
const currentChoice = event.choice[0], skillsToChoose = event.choice.map(i => i.skill).unique();
|
||||
if (event.choice.length === 1 || skillsToChoose.length === 1) {
|
||||
event.current = currentChoice;
|
||||
}
|
||||
else{
|
||||
const currentPlayer = currentChoice.player , skillsToChoose = event.choice.map(i => i.skill);
|
||||
const currentPlayer = currentChoice.player;
|
||||
const next = currentPlayer.chooseControl(skillsToChoose);
|
||||
next.set('prompt', '选择下一个触发的技能');
|
||||
next.set('forceDie', true);
|
||||
next.set('arrangeSkill', true);
|
||||
next.set('includeOut', true);
|
||||
const {result} = await next;
|
||||
event.current = event.doing.todoList.find(info => info.skill == result.control);
|
||||
event.current = usableSkills.find(info => info.skill == result.control);
|
||||
}
|
||||
}
|
||||
}
|
||||
event.doing.doneList.push(event.current);
|
||||
event.doing.todoList.remove(event.current);
|
||||
await game.createTrigger(event.triggername, event.current.skill, event.current.player, trigger);
|
||||
const result = await game.createTrigger(event.triggername, event.current.skill, event.current.player, trigger, event.current.indexedData).forResult();
|
||||
if (get.itemtype(event.doing.player) === 'player' && result === 'cancelled'){
|
||||
for (let i = 0; i < event.doing.todoList.length; i++) {
|
||||
if (event.current.skill === event.doing.todoList[i].skill) {
|
||||
event.doing.doneList.push(event.doing.todoList.splice(i--, 1)[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2189,7 +2198,7 @@ export const Content = {
|
|||
game.expandSkills(invisible);
|
||||
if (hidden.includes(event.skill)) {
|
||||
if (!info.silent && player.hasSkillTag('nomingzhi', false, null, true)) event.finish();
|
||||
else if (!info.direct) event.trigger('triggerHidden');
|
||||
else if (!info.direct && typeof info.cost !== 'function') event.trigger('triggerHidden');
|
||||
else event.skillHidden = true;
|
||||
}
|
||||
else if (invisible.includes(event.skill)) event.trigger('triggerInvisible');
|
||||
|
@ -2200,7 +2209,10 @@ export const Content = {
|
|||
"step 1";
|
||||
if (event.cancelled) return event.finish();
|
||||
var info = get.info(event.skill);
|
||||
if (event.revealed || info.forced) return;
|
||||
if (event.revealed || info.forced) {
|
||||
event._result = { bool: true };
|
||||
return;
|
||||
}
|
||||
const checkFrequent = function (info) {
|
||||
if (player.hasSkillTag('nofrequent', false, event.skill)) return false;
|
||||
if (typeof info.frequent == 'boolean') return info.frequent;
|
||||
|
@ -2214,6 +2226,24 @@ export const Content = {
|
|||
event._result = { bool: true };
|
||||
event._direct = true;
|
||||
}
|
||||
else if(typeof info.cost === 'function'){
|
||||
if (checkFrequent(info)) event.frequentSkill = true;
|
||||
if (player.isUnderControl()) game.swapPlayerAuto(player);
|
||||
//创建cost事件
|
||||
var next = game.createEvent(`${event.skill}_cost`);
|
||||
next.player = player;
|
||||
if (event.frequentSkill) next.set('frequentSkill', event.skill);
|
||||
next.set('forceDie', true);
|
||||
next.set('includeOut', true);
|
||||
next._trigger = trigger;
|
||||
next.triggername = event.triggername;
|
||||
next.skillHidden = event.skillHidden;
|
||||
next.indexedData = event.indexedData;
|
||||
if (info.forceDie) next.forceDie = true;
|
||||
if (info.forceOut) next.includeOut = true;
|
||||
next.skill = event.skill;
|
||||
next.setContent(info.cost);
|
||||
}
|
||||
else {
|
||||
if (checkFrequent(info)) event.frequentSkill = true;
|
||||
var str;
|
||||
|
@ -2221,19 +2251,19 @@ export const Content = {
|
|||
if (info.prompt) str = info.prompt;
|
||||
else if (typeof info.logTarget == 'string') str = get.prompt(event.skill, trigger[info.logTarget], player);
|
||||
else if (typeof info.logTarget == 'function') {
|
||||
const logTarget = info.logTarget(trigger, player);
|
||||
const logTarget = info.logTarget(trigger, player, event.triggername, event.indexedData);
|
||||
if (get.itemtype(logTarget).startsWith('player')) str = get.prompt(event.skill, logTarget, player);
|
||||
}
|
||||
else str = get.prompt(event.skill, null, player);
|
||||
if (typeof str == 'function') str = str(trigger, player);
|
||||
if (typeof str == 'function') str = str(trigger, player, event.triggername, event.indexedData);
|
||||
|
||||
var next = player.chooseBool(str);
|
||||
if (event.frequentSkill) next.set('frequentSkill', event.skill);
|
||||
next.set('forceDie', true);
|
||||
next.set('includeOut', true);
|
||||
next.ai = () => !check || check(trigger, player);
|
||||
next.ai = () => !check || check(trigger, player, event.triggername, event.indexedData);
|
||||
|
||||
if (typeof info.prompt2 == 'function') next.set('prompt2', info.prompt2(trigger, player));
|
||||
if (typeof info.prompt2 == 'function') next.set('prompt2', info.prompt2(trigger, player, event.triggername, event.indexedData));
|
||||
else if (typeof info.prompt2 == 'string') next.set('prompt2', info.prompt2);
|
||||
else if (info.prompt2 != false) {
|
||||
if (lib.dynamicTranslate[event.skill]) next.set('prompt2', lib.dynamicTranslate[event.skill](player, event.skill));
|
||||
|
@ -2257,18 +2287,29 @@ export const Content = {
|
|||
}
|
||||
"step 3";
|
||||
var info = get.info(event.skill);
|
||||
if (result && result.bool == false) {
|
||||
if (!result || !result.bool) {
|
||||
if (info.oncancel) info.oncancel(trigger, player);
|
||||
if (event.indexedData === true) {
|
||||
event.result = 'cancelled';
|
||||
}
|
||||
return event.finish();
|
||||
}
|
||||
let targets = null;
|
||||
if (result.targets && result.targets.length > 0) {
|
||||
targets = result.targets.slice(0);
|
||||
}
|
||||
else if (info.logTarget) {
|
||||
if (typeof info.logTarget === 'string') targets = trigger[info.logTarget];
|
||||
else if (typeof info.logTarget === 'function') targets = info.logTarget(trigger, player, event.triggername, event.indexedData);
|
||||
}
|
||||
if (get.itemtype(targets) === 'player'){
|
||||
targets = [targets];
|
||||
}
|
||||
if (info.popup != false && !info.direct) {
|
||||
if (info.popup) {
|
||||
player.popup(info.popup);
|
||||
game.log(player, '发动了', '【' + get.skillTranslation(event.skill, player) + '】');
|
||||
}
|
||||
else if (!info.logTarget || info.logLine === false) player.logSkill(event.skill, false, info.line);
|
||||
else if (typeof info.logTarget == 'string') player.logSkill(event.skill, trigger[info.logTarget], info.line);
|
||||
else if (typeof info.logTarget == 'function') player.logSkill(event.skill, info.logTarget(trigger, player), info.line);
|
||||
let popup_info = event.skill;
|
||||
if(typeof info.popup === 'string') popup_info = [event.skill, info.popup];
|
||||
if (info.logLine === false) player.logSkill(popup_info, false, info.line);
|
||||
else player.logSkill(popup_info, targets, info.line);
|
||||
}
|
||||
var next = game.createEvent(event.skill);
|
||||
if (typeof info.usable == 'number') {
|
||||
|
@ -2280,7 +2321,6 @@ export const Content = {
|
|||
next.player = player;
|
||||
next._trigger = trigger;
|
||||
next.triggername = event.triggername;
|
||||
|
||||
// if ("contents" in info && Array.isArray(info.contents)) {
|
||||
// next.setContents(info.contents);
|
||||
// } else {
|
||||
|
@ -2290,6 +2330,12 @@ export const Content = {
|
|||
next.skillHidden = event.skillHidden;
|
||||
if (info.forceDie) next.forceDie = true;
|
||||
if (info.forceOut) next.includeOut = true;
|
||||
//传入数据
|
||||
if (get.itemtype(targets) == 'players') next.targets = targets.slice(0);
|
||||
if (get.itemtype(result.cards) === 'cards') next.cards = result.cards.slice(0);
|
||||
//语法糖部分
|
||||
if ('cost_data' in result) next.cost_data = result.cost_data;
|
||||
next.indexedData = event.indexedData;
|
||||
"step 4";
|
||||
if (!player._hookTrigger) return;
|
||||
if (player._hookTrigger.some(i => {
|
||||
|
@ -2890,35 +2936,40 @@ export const Content = {
|
|||
},
|
||||
phaseUse: function () {
|
||||
"step 0";
|
||||
const stat = player.getStat();
|
||||
for (let i in stat.skill) {
|
||||
let bool = false;
|
||||
const info = lib.skill[i];
|
||||
if (!info) continue;
|
||||
if (info.enable != undefined) {
|
||||
if (typeof info.enable == 'string' && info.enable == 'phaseUse') bool = true;
|
||||
else if (typeof info.enable == 'object' && info.enable.includes('phaseUse')) bool = true;
|
||||
}
|
||||
if (bool) stat.skill[i] = 0;
|
||||
}
|
||||
for (let i in stat.card) {
|
||||
let bool = false;
|
||||
const info = lib.card[i];
|
||||
if (!info) continue;
|
||||
if (info.updateUsable == 'phaseUse') stat.card[i] = 0;
|
||||
}
|
||||
"step 1";
|
||||
event.trigger('phaseUseBefore');
|
||||
"step 2";
|
||||
event.trigger('phaseUseBegin');
|
||||
"step 3";
|
||||
if (!event.logged) {
|
||||
game.log(player, '进入了出牌阶段');
|
||||
event.logged = true;
|
||||
const stat = player.getStat();
|
||||
for (let i in stat.skill) {
|
||||
let bool = false;
|
||||
const info = lib.skill[i];
|
||||
if (!info) continue;
|
||||
if (info.enable != undefined) {
|
||||
if (typeof info.enable == 'string' && info.enable == 'phaseUse') bool = true;
|
||||
else if (typeof info.enable == 'object' && info.enable.includes('phaseUse')) bool = true;
|
||||
}
|
||||
if (bool) stat.skill[i] = 0;
|
||||
}
|
||||
for (let i in stat.card) {
|
||||
let bool = false;
|
||||
const info = lib.card[i];
|
||||
if (!info) continue;
|
||||
if (info.updateUsable == 'phaseUse') stat.card[i] = 0;
|
||||
}
|
||||
}
|
||||
var next = player.chooseToUse();
|
||||
if (!lib.config.show_phaseuse_prompt) {
|
||||
next.set('prompt', false);
|
||||
}
|
||||
next.set('type', 'phase');
|
||||
"step 1";
|
||||
"step 4";
|
||||
if (result.bool && !event.skipped) {
|
||||
event.goto(0);
|
||||
event.goto(3);
|
||||
}
|
||||
game.broadcastAll(function () {
|
||||
if (ui.tempnowuxie) {
|
||||
|
@ -2926,6 +2977,10 @@ export const Content = {
|
|||
delete ui.tempnowuxie;
|
||||
}
|
||||
});
|
||||
"step 5";
|
||||
event.trigger('phaseUseEnd');
|
||||
"step 6";
|
||||
event.trigger('phaseUseAfter');
|
||||
},
|
||||
phaseDiscard: function () {
|
||||
"step 0";
|
||||
|
@ -3706,7 +3761,7 @@ export const Content = {
|
|||
player.logSkill.apply(player, event.logSkill);
|
||||
}
|
||||
}
|
||||
if (!game.online) {
|
||||
if (!game.online && !event.chooseonly) {
|
||||
if (typeof event.delay == 'boolean') {
|
||||
event.done = player.discard(event.result.cards).set('delay', event.delay);
|
||||
}
|
||||
|
|
|
@ -333,10 +333,10 @@ export class GameEvent {
|
|||
this.untrigger(arg1, arg2);
|
||||
this.finish();
|
||||
if (notrigger != 'notrigger') {
|
||||
this.trigger(this.name + 'Cancelled');
|
||||
if (this.player && lib.phaseName.includes(this.name)) this.player.getHistory('skipped').add(this.name);
|
||||
return this.trigger(this.name + 'Cancelled');
|
||||
}
|
||||
return this;
|
||||
return null;
|
||||
}
|
||||
neutralize(event) {
|
||||
this.untrigger();
|
||||
|
@ -791,11 +791,36 @@ export class GameEvent {
|
|||
|
||||
const info = lib.skill[skill];
|
||||
const list = info.firstDo ? firstDo.todoList : info.lastDo ? lastDo.todoList : this.todoList;
|
||||
list.push({
|
||||
skill: skill,
|
||||
player: this.player,
|
||||
priority: get.priority(skill),
|
||||
});
|
||||
if (typeof info.getIndex === 'function') {
|
||||
const indexedResult = info.getIndex(event, player, name);
|
||||
if(Array.isArray(indexedResult)){
|
||||
indexedResult.forEach(indexedData => {
|
||||
list.push({
|
||||
skill: skill,
|
||||
player: this.player,
|
||||
priority: get.priority(skill),
|
||||
indexedData,
|
||||
})
|
||||
});
|
||||
}
|
||||
else if (typeof indexedResult === 'number' && indexedResult>0){
|
||||
for(let i = 0; i < indexedResult; i++){
|
||||
list.push({
|
||||
skill: skill,
|
||||
player: this.player,
|
||||
priority: get.priority(skill),
|
||||
indexedData: true,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
list.push({
|
||||
skill: skill,
|
||||
player: this.player,
|
||||
priority: get.priority(skill),
|
||||
});
|
||||
}
|
||||
if (typeof list.player == 'string') list.sort((a, b) => (b.priority - a.priority) || (playerMap.indexOf(a) - playerMap.indexOf(b)));
|
||||
else list.sort((a, b) => b.priority - a.priority);
|
||||
allbool = true;
|
||||
|
|
|
@ -371,6 +371,7 @@ export class Player extends HTMLDivElement {
|
|||
* ```
|
||||
*/
|
||||
when() {
|
||||
const player = this;
|
||||
if (!_status.postReconnect.player_when) _status.postReconnect.player_when = [
|
||||
function (map) {
|
||||
"use strict";
|
||||
|
@ -386,7 +387,13 @@ export class Player extends HTMLDivElement {
|
|||
];
|
||||
let triggerNames = Array.from(arguments);
|
||||
let trigger;
|
||||
let instantlyAdd = true;
|
||||
if (triggerNames.length == 0) throw 'player.when的参数数量应大于0';
|
||||
//从triggerNames中取出instantlyAdd的部分
|
||||
if (triggerNames.includes(false)) {
|
||||
instantlyAdd = false;
|
||||
triggerNames.remove(false);
|
||||
}
|
||||
// add other triggerNames
|
||||
// arguments.length = 1
|
||||
if (triggerNames.length == 1) {
|
||||
|
@ -506,7 +513,7 @@ export class Player extends HTMLDivElement {
|
|||
}
|
||||
});
|
||||
}, skillName);
|
||||
this.addSkill(skillName);
|
||||
if (instantlyAdd !== false) this.addSkill(skillName);
|
||||
_status.postReconnect.player_when[1][skillName] = true;
|
||||
return {
|
||||
/**
|
||||
|
@ -603,6 +610,14 @@ export class Player extends HTMLDivElement {
|
|||
if (skill.contentFuns.length > 0) createContent();
|
||||
return this;
|
||||
},
|
||||
/**
|
||||
* 获得技能
|
||||
* 如果instantlyAdd为false,则需要以此法获得技能
|
||||
**/
|
||||
finish() {
|
||||
player.addSkill(skillName);
|
||||
return this;
|
||||
}
|
||||
};
|
||||
}
|
||||
/**
|
||||
|
@ -1651,6 +1666,7 @@ export class Player extends HTMLDivElement {
|
|||
this.sex = lib.character[this.name][0];
|
||||
if (this.group == 'unknown') this.group = lib.character[this.name][1];
|
||||
this.classList.remove('unseen');
|
||||
this.classList.remove('unseen_show');
|
||||
break;
|
||||
case 1:
|
||||
if (log !== false) game.log(this, '展示了副将', '#b' + this.name2);
|
||||
|
@ -1658,6 +1674,7 @@ export class Player extends HTMLDivElement {
|
|||
if (this.sex == 'unknown') this.sex = lib.character[this.name2][0];
|
||||
if (this.name.startsWith('unknown')) this.name = this.name2;
|
||||
this.classList.remove('unseen2');
|
||||
this.classList.remove('unseen2_show');
|
||||
break;
|
||||
case 2:
|
||||
if (log !== false) {
|
||||
|
@ -1671,6 +1688,8 @@ export class Player extends HTMLDivElement {
|
|||
if (this.group == 'unknown') this.group = lib.character[this.name][1];
|
||||
this.classList.remove('unseen');
|
||||
this.classList.remove('unseen2');
|
||||
this.classList.remove('unseen_show');
|
||||
this.classList.remove('unseen2_show');
|
||||
break;
|
||||
}
|
||||
if (!this.isUnseen(2)) {
|
||||
|
@ -2095,6 +2114,7 @@ export class Player extends HTMLDivElement {
|
|||
}
|
||||
//原有函数
|
||||
init(character, character2, skill, update) {
|
||||
let hidden = false;
|
||||
if (typeof character == 'string' && !lib.character[character]) {
|
||||
lib.character[character] = get.character(character);
|
||||
}
|
||||
|
@ -2150,7 +2170,7 @@ export class Player extends HTMLDivElement {
|
|||
skills = [];
|
||||
this.name = 'unknown';
|
||||
this.sex = 'male';
|
||||
this.storage.nohp = true;
|
||||
hidden = true;
|
||||
skills.add('g_hidden_ai');
|
||||
}
|
||||
if (character2 && lib.character[character2]) {
|
||||
|
@ -2204,17 +2224,19 @@ export class Player extends HTMLDivElement {
|
|||
if (info2[4].includes('hiddenSkill') && !this.noclick) {
|
||||
if (!this.hiddenSkills) this.hiddenSkills = [];
|
||||
this.hiddenSkills.addArray(info2[3]);
|
||||
this.storage.nohp = true;
|
||||
hidden = true;
|
||||
skills.add('g_hidden_ai');
|
||||
}
|
||||
else skills = skills.concat(info2[3]);
|
||||
}
|
||||
if (this.storage.nohp) {
|
||||
if (this.storage.nohp || hidden) {
|
||||
this.storage.rawHp = this.hp;
|
||||
this.storage.rawMaxHp = this.maxHp;
|
||||
this.hp = 1;
|
||||
this.maxHp = 1;
|
||||
this.node.hp.hide();
|
||||
if (this.storage.nohp) {
|
||||
this.node.hp.hide();
|
||||
}
|
||||
}
|
||||
if (skill != false) {
|
||||
skills = skills.filter(skill => {
|
||||
|
@ -2283,6 +2305,7 @@ export class Player extends HTMLDivElement {
|
|||
this.node.name.classList.add('long');
|
||||
}
|
||||
if (info[4].includes('hiddenSkill') && !this.noclick) {
|
||||
if (!_status.video && get.mode() != 'guozhan') this.classList.add('unseen_show');
|
||||
this.classList.add(_status.video ? 'unseen_v' : 'unseen');
|
||||
if (!this.node.name_seat && !_status.video) {
|
||||
this.node.name_seat = ui.create.div('.name.name_seat', get.verticalStr(get.translation(this.name)), this);
|
||||
|
@ -2304,6 +2327,7 @@ export class Player extends HTMLDivElement {
|
|||
|
||||
this.node.count.classList.add('p2');
|
||||
if (info2[4].includes('hiddenSkill') && !this.noclick) {
|
||||
if (!_status.video && get.mode() != 'guozhan') this.classList.add('unseen2_show');
|
||||
this.classList.add(_status.video ? 'unseen2_v' : 'unseen2');
|
||||
}
|
||||
this.node.name2.innerHTML = get.slimName(character2);
|
||||
|
@ -2321,19 +2345,32 @@ export class Player extends HTMLDivElement {
|
|||
*
|
||||
* 如果lib.character[character]不存在,且想引用其他路径的图片素材或阵亡素材,请以[character,[]]的形式写入lib.character.characterSubstitute[name]中,第二个数组填入形式同lib.character[4]的书写形式
|
||||
*
|
||||
* @param { string | string }
|
||||
* @param { string | object | function } map
|
||||
* @param { string } character
|
||||
*/
|
||||
changeSkin(skill, character) {
|
||||
if (!skill || !character) {
|
||||
console.log('error: no sourceSkill or character to changeSkin', get.translation(this));
|
||||
changeSkin(map, character) {
|
||||
if (!map || !character) {
|
||||
console.warn('error: no sourceMap or character to changeSkin', get.translation(this));
|
||||
return;
|
||||
}
|
||||
if (typeof map == 'string') {
|
||||
map = { skill: map };
|
||||
}
|
||||
for (const i of ['name', 'name1', 'name2']) {
|
||||
if (i == 'name1' && this.name === this.name1) continue;
|
||||
const list = lib.characterSubstitute[this[i]];
|
||||
if (this[i] && list) {
|
||||
if ((get.character(this[i], 3) || []).includes(skill)) {
|
||||
const name = (i == 'name2' ? 'name2' : 'name');
|
||||
const name = (i == 'name2' ? 'name2' : 'name');
|
||||
if ((() => {
|
||||
if (typeof map == 'function') {
|
||||
return map(this, name);
|
||||
}
|
||||
if (typeof map.skill == 'string' && (get.character(this[i], 3) || []).includes(map.skill)) return true;
|
||||
if (typeof map.characterName == 'string' && this[i] == map.characterName) return true;
|
||||
if (typeof map.characterSkinName == 'string' && this.skin[name] == map.characterSkinName) return true;
|
||||
if (typeof map.source == 'string' && name == map.source) return true;
|
||||
return false;
|
||||
})()) {
|
||||
if (this.skin[name] != character) {
|
||||
const origin = this.skin[name];
|
||||
game.broadcastAll((player, name, character, list, origin) => {
|
||||
|
@ -2359,6 +2396,31 @@ export class Player extends HTMLDivElement {
|
|||
}
|
||||
}
|
||||
}
|
||||
changeSkinByName(character, index){
|
||||
const name = (index == 2 ? 'name2' : 'name');
|
||||
const list = lib.characterSubstitute[this[name]];
|
||||
if (list && lib.characterSubstitute[this[name]]) {
|
||||
const origin = this.skin[name];
|
||||
game.broadcastAll((player, name, character, list, origin) => {
|
||||
player.tempname.remove(origin);
|
||||
player.tempname.add(character);
|
||||
player.skin[name] = character;
|
||||
const goon = (!lib.character[character]);
|
||||
if (goon) lib.character[character] = ['', '', 0, [], (list.find(i => i[0] == character) || [character, []])[1]];
|
||||
player.smoothAvatar(name == 'name2');
|
||||
player.node['avatar' + name.slice(4)].setBackground(character, 'character');
|
||||
player.node['avatar' + name.slice(4)].show();
|
||||
if (goon) delete lib.character[character];
|
||||
}, this, name, character, list, origin);
|
||||
game.addVideo('changeSkin', this, {
|
||||
from: origin,
|
||||
to: character,
|
||||
name: name,
|
||||
list: list,
|
||||
avatar2: name == 'name2',
|
||||
});
|
||||
}
|
||||
}
|
||||
initOL(name, character) {
|
||||
this.node.avatar.setBackground(character, 'character');
|
||||
this.node.avatar.show();
|
||||
|
@ -2678,6 +2740,8 @@ export class Player extends HTMLDivElement {
|
|||
this.node.hp.show();
|
||||
this.classList.remove('unseen');
|
||||
this.classList.remove('unseen2');
|
||||
this.classList.remove('unseen_show');
|
||||
this.classList.remove('unseen2_show');
|
||||
|
||||
this.node.identity.style.backgroundColor = '';
|
||||
this.node.intro.innerHTML = '';
|
||||
|
@ -3042,20 +3106,22 @@ export class Player extends HTMLDivElement {
|
|||
}
|
||||
}
|
||||
if (!this.storage.nohp) {
|
||||
if (this.maxHp == Infinity) {
|
||||
hp.innerHTML = '∞';
|
||||
const hidden = (this.classList.contains('unseen_show') || this.classList.contains('unseen2_show'));
|
||||
const maxHp = (hidden ? 1 : this.maxHp);
|
||||
if (maxHp == Infinity) {
|
||||
hp.innerHTML = (this.hp == Infinity ? '∞' : (this.hp + '<br>/<br>' + '∞' + '<div></div>'));
|
||||
}
|
||||
else if (game.layout == 'default' && this.maxHp > 14) {
|
||||
hp.innerHTML = this.hp + '/' + this.maxHp;
|
||||
else if (game.layout == 'default' && maxHp > 14) {
|
||||
hp.innerHTML = this.hp + '/' + maxHp;
|
||||
hp.classList.add('text');
|
||||
}
|
||||
else if (get.is.newLayout() &&
|
||||
(
|
||||
this.maxHp > 9 ||
|
||||
(this.maxHp > 5 && this.classList.contains('minskin')) ||
|
||||
((game.layout == 'mobile' || game.layout == 'long') && this.dataset.position == 0 && this.maxHp > 7)
|
||||
maxHp > 9 ||
|
||||
(maxHp > 5 && this.classList.contains('minskin')) ||
|
||||
((game.layout == 'mobile' || game.layout == 'long') && this.dataset.position == 0 && maxHp > 7)
|
||||
)) {
|
||||
hp.innerHTML = this.hp + '<br>/<br>' + this.maxHp + '<div></div>';
|
||||
hp.innerHTML = this.hp + '<br>/<br>' + maxHp + '<div></div>';
|
||||
if (this.hp == 0) {
|
||||
hp.lastChild.classList.add('lost');
|
||||
}
|
||||
|
@ -3066,16 +3132,16 @@ export class Player extends HTMLDivElement {
|
|||
hp.innerHTML = '';
|
||||
hp.classList.remove('text');
|
||||
hp.classList.remove('textstyle');
|
||||
while (this.maxHp > hp.childNodes.length) {
|
||||
while (maxHp > hp.childNodes.length) {
|
||||
ui.create.div(hp);
|
||||
}
|
||||
while (Math.max(0, this.maxHp) < hp.childNodes.length) {
|
||||
while (Math.max(0, maxHp) < hp.childNodes.length) {
|
||||
hp.removeChild(hp.lastChild);
|
||||
}
|
||||
for (var i = 0; i < this.maxHp; i++) {
|
||||
for (var i = 0; i < maxHp; i++) {
|
||||
var index = i;
|
||||
if (get.is.newLayout()) {
|
||||
index = this.maxHp - i - 1;
|
||||
index = maxHp - i - 1;
|
||||
}
|
||||
if (i < this.hp) {
|
||||
hp.childNodes[index].classList.remove('lost');
|
||||
|
@ -3084,23 +3150,26 @@ export class Player extends HTMLDivElement {
|
|||
hp.childNodes[index].classList.add('lost');
|
||||
}
|
||||
}
|
||||
// if(this.maxHp==9){
|
||||
// if(maxHp==9){
|
||||
// hp.classList.add('long');
|
||||
// }
|
||||
// else{
|
||||
// hp.classList.remove('long');
|
||||
// }
|
||||
}
|
||||
if (hp.classList.contains('room')) {
|
||||
if (hidden) {
|
||||
hp.dataset.condition = 'hidden';
|
||||
}
|
||||
else if (hp.classList.contains('room')) {
|
||||
hp.dataset.condition = 'high';
|
||||
}
|
||||
else if (this.hp == 0) {
|
||||
hp.dataset.condition = '';
|
||||
}
|
||||
else if (this.hp > Math.round(this.maxHp / 2) || this.hp === this.maxHp) {
|
||||
else if (this.hp > Math.round(maxHp / 2) || this.hp === maxHp) {
|
||||
hp.dataset.condition = 'high';
|
||||
}
|
||||
else if (this.hp > Math.floor(this.maxHp / 3)) {
|
||||
else if (this.hp > Math.floor(maxHp / 3)) {
|
||||
hp.dataset.condition = 'mid';
|
||||
}
|
||||
else {
|
||||
|
@ -3233,6 +3302,7 @@ export class Player extends HTMLDivElement {
|
|||
num = this.storage[i].length;
|
||||
}
|
||||
if (num) {
|
||||
if (num == Infinity) num = '∞';
|
||||
if (!this.marks[i].markcount) {
|
||||
this.marks[i].markcount = ui.create.div('.markcount.menubutton', this.marks[i]);
|
||||
}
|
||||
|
@ -3941,7 +4011,7 @@ export class Player extends HTMLDivElement {
|
|||
return next;
|
||||
}
|
||||
phaseUse() {
|
||||
var next = game.createEvent('phaseUse');
|
||||
var next = game.createEvent('phaseUse', false);
|
||||
next.player = this;
|
||||
next.setContent('phaseUse');
|
||||
return next;
|
||||
|
@ -4155,7 +4225,8 @@ export class Player extends HTMLDivElement {
|
|||
next.filterCard = get.filter(arguments[i]);
|
||||
}
|
||||
else if (typeof arguments[i] == 'string') {
|
||||
get.evtprompt(next, arguments[i]);
|
||||
if (arguments[i]=='chooseonly') next.chooseonly=true;
|
||||
else get.evtprompt(next, arguments[i]);
|
||||
}
|
||||
if (arguments[i] === null) {
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
|
@ -7843,14 +7914,14 @@ export class Player extends HTMLDivElement {
|
|||
skillName = 'player_tempSkills_' + Math.random().toString(36).slice(-8);
|
||||
} while (player.additionalSkills[skillName] != null);
|
||||
player.addAdditionalSkill(skillName, skillsToAdd);
|
||||
player.when(expire).assign({
|
||||
player.when(expire,false).assign({
|
||||
firstDo: true,
|
||||
priority: Infinity,
|
||||
}).vars({
|
||||
skillName
|
||||
}).then(() => {
|
||||
player.removeAdditionalSkills(skillName);
|
||||
});
|
||||
}).finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -7893,13 +7964,13 @@ export class Player extends HTMLDivElement {
|
|||
|
||||
if (!expire) expire = { global: ['phaseAfter', 'phaseBeforeStart'] };
|
||||
else if (typeof expire == 'string' || Array.isArray(expire)) expire = { global: expire };
|
||||
this.when(expire).assign({
|
||||
this.when(expire,false).assign({
|
||||
firstDo: true,
|
||||
}).vars({
|
||||
bannedSkill: skill,
|
||||
}).then(() => {
|
||||
delete player.storage[`temp_ban_${bannedSkill}`];
|
||||
});
|
||||
}).finish();
|
||||
}
|
||||
return skill;
|
||||
}
|
||||
|
|
|
@ -9830,7 +9830,7 @@ export class Library extends Uninstantable {
|
|||
* @param {string} skill
|
||||
* @returns {boolean}
|
||||
*/
|
||||
filterTrigger: function (event, player, triggername, skill) {
|
||||
filterTrigger: function (event, player, triggername, skill, indexedData) {
|
||||
if (player._hookTrigger && player._hookTrigger.some(i => {
|
||||
const info = lib.skill[i].hookTrigger;
|
||||
return info && info.block && info.block(event, player, triggername, skill);
|
||||
|
@ -9853,7 +9853,7 @@ export class Library extends Uninstantable {
|
|||
if (Array.isArray(info.trigger[role])) return info.trigger[role].includes(triggername);
|
||||
return info.trigger[role] == triggername;
|
||||
})) return false;
|
||||
if (info.filter && !info.filter(event, player, triggername)) return false;
|
||||
if (info.filter && !info.filter(event, player, triggername, indexedData)) return false;
|
||||
if (event._notrigger.includes(player) && !lib.skill.global.includes(skill)) return false;
|
||||
if (typeof info.usable == 'number' && player.hasSkill('counttrigger') &&
|
||||
player.storage.counttrigger && player.storage.counttrigger[skill] >= info.usable) return false;
|
||||
|
@ -10396,7 +10396,7 @@ export class Library extends Uninstantable {
|
|||
return (Math.random() - 0.5);
|
||||
},
|
||||
seat: function (a, b) {
|
||||
var player = lib.tempSortSeat || _status.event.player;
|
||||
var player = lib.tempSortSeat || _status.event.player || game.me || game.players[0];
|
||||
var delta = get.distance(player, a, 'absolute') - get.distance(player, b, 'absolute');
|
||||
if (delta) return delta;
|
||||
delta = parseInt(a.dataset.position) - parseInt(b.dataset.position);
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 4.0 KiB |
Loading…
Reference in New Issue