Merge pull request #971 from copcap/dev

补充未事件化的获得技能
This commit is contained in:
Spmario233 2024-02-19 19:53:55 +08:00 committed by GitHub
commit 61f8a33187
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 85 additions and 70 deletions

View File

@ -100,9 +100,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var key=`${suit}+${get.type2(trigger.card)}`;
if(key in storage){
if(!player.hasSkill('qice')){
player.addTempSkill('qice','roundStart');
player.addTempSkills('qice','roundStart');
player.popup('奇策');
game.log(player,'获得了技能','#g【奇策】');
// game.log(player,'获得了技能','#g【奇策】');
}
event.goto(2);
}

View File

@ -603,7 +603,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
]);
'step 1'
var skill=result.control;
player.addTempSkill(skill,'dcbianzhuangAfter');
player.addTempSkills(skill,'dcbianzhuangAfter');
for(var i in lib.skill.dcbianzhuang.characterMap){
if(lib.skill.dcbianzhuang.characterMap[i]==skill){
player.flashAvatar('dcbianzhuang',i);

View File

@ -2486,7 +2486,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(result.bool){
var target=trigger.player,cards=result.cards;
player.logSkill('dddqiahua',target);
target.addTempSkill('dddxunxun');
target.addTempSkills('dddxunxun');
player.addShownCards(cards,'visible_dddxianglang');
game.log(player,'选择了',cards,'作为“明”');
player.showCards(cards,get.translation(player)+'对'+get.translation(target)+'发动了【恰化】');

View File

@ -5548,7 +5548,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.removeMark('baonu',2);
player.addTempSkills('wushuang');
player.popup('无双');
game.log(player,'获得了技能','#g【无双】');
// game.log(player,'获得了技能','#g【无双】');
target.addTempSkill('ol_wuqian_targeted');
},
ai:{
@ -7516,13 +7516,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
else event.finish();
'step 2'
player.addTempSkill(result.control,{player:'dieAfter'});
player.popup(result.control,'thunder');
player.addTempSkills(result.control,{player:'dieAfter'});
// player.popup(result.control,'thunder');
player.storage.drlt_duorui=[result.control];
player.storage.drlt_duorui_player=trigger.player;
trigger.player.storage.drlt_duorui=[result.control];
trigger.player.addTempSkill('drlt_duorui1',{player:'phaseAfter'});
game.log(player,'获得了技能','#g【'+get.translation(result.control)+'】')
// game.log(player,'获得了技能','#g【'+get.translation(result.control)+'】')
},
group:['duorui_clear'],
},

View File

@ -1257,9 +1257,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
for(var target of game.filterPlayer()){
if(user==target) continue;
var targetsx=[user,target];
targetsx.forEach(i=>i.addSkill('dcbeini_fengyin'));
targetsx.forEach(i=>i.addSkill('dcbeini_fengyin2'));
var effx=get.effect(target,sha,user,player);
targetsx.forEach(i=>i.removeSkill('dcbeini_fengyin'));
targetsx.forEach(i=>i.removeSkill('dcbeini_fengyin2'));
if(user==player) effx+=1;
if(get.attitude(player,user)>0) effx-=0.1;
if(effx>eff){
@ -1291,6 +1291,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
fengyin:{
inherit:'fengyin',
},
fengyin2:{
inherit:'fengyin',
},
}
},
dcshizong:{
@ -10548,7 +10551,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.line(target,'green');
player.markAuto('remeibu_gain',[get.suit(card,player)]);
player.addTempSkill('remeibu_gain');
target.addTempSkill('rezhixi','phaseUseEnd');
target.addTempSkills('rezhixi','phaseUseEnd');
}
},
ai:{

View File

@ -1170,7 +1170,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var target=trigger.player;
var card=result.cards[0];
player.line(target,'green');
target.addTempSkill('mbzhixi','phaseUseAfter');
target.addTempSkills('mbzhixi','phaseUseAfter');
if(card.name!='sha'&&get.type(card)!='trick'&&get.color(card)!='black'){
target.addTempSkill('new_meibu_range','phaseUseAfter');
target.markAuto('new_meibu_range',player);

View File

@ -4965,9 +4965,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
else event.finish();
'step 2'
var skill=result.control;
player.addTempSkill(skill);
player.popup(skill,'wood');
game.log(player,'获得了技能','#g【'+get.translation(skill)+'】');
player.addTempSkills(skill);
// player.popup(skill,'wood');
// game.log(player,'获得了技能','#g【'+get.translation(skill)+'】');
},
},
sphuangen:{

View File

@ -721,7 +721,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
const storage=player.getStorage('olqingyuan');
if(event.name=='gain'||event.name=='loseAsync'){
if(player.hasSkill('olqingyuan_used')) return false;
return storage.some(target=>event.getg(target).length)&&storage.some(target=>target.hasCard(card=>lib.filter.canBeGained(card,target,player),'he'));
return storage.some(target=>event.getg(target).length)&&storage.some(target=>target.hasCard(card=>lib.filter.canBeGained(card,target,player),'h'));
}
if(!game.hasPlayer(target=>!storage.includes(target)&&target!=player)) return false;
if(event.name=='damage'&&player.getAllHistory('damage').indexOf(event)!=0) return false;
@ -730,23 +730,27 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true,
async content(event,trigger,player){
if(trigger.name=='gain'||trigger.name=='loseAsync'){
const target=player.getStorage('olqingyuan').filter(target=>target.hasCard(card=>lib.filter.canBeGained(card,target,player),'he')).randomGet();
const target=player.getStorage('olqingyuan').filter(target=>target.hasCard(card=>lib.filter.canBeGained(card,target,player),'h')).randomGet();
player.line(target);
player.addTempSkill('olqingyuan_used');
player.gain(target.getCards('he',card=>{
player.gain(target.getCards('h',card=>{
return lib.filter.canBeGained(card,target,player);
}).randomGet(),target,'giveAuto');
}
else{
const {result:{bool,targets}}=await player.chooseTarget((card,player,target)=>{
const filterTarget=(card,player,target)=>{
return target!=player&&!player.getStorage('olqingyuan').includes(target);
},true).set('prompt2','每回合限一次,当你以此法选择的角色获得牌后,你随机获得其中一名角色的一张牌')
},targetsx=game.filterPlayer(current=>filterTarget(null,player,current));
let result;
if(targetsx.length==1) result={bool:true,targets:targetsx};
else result=await player.chooseTarget(filterTarget,true).set('prompt2','每回合限一次,当你以此法选择的角色获得牌后,你随机获得其中一名角色的一张手牌')
.set('prompt','请选择【轻缘】的目标').set('ai',target=>{
const player=get.event('player');
return get.effect(target,new lib.element.VCard({name:'shunshou_copy2'}),player,player);
});
if(bool){
const target=targets[0];
})
.forResult();
if(result.bool){
const target=result.targets[0];
player.line(target);
game.log(player,'选择了',target);
player.markAuto('olqingyuan',[target]);
@ -764,14 +768,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
locked:false,
enable:'chooseToUse',
filterCard(card){
return get.itemtype(card)=='card'&&card.hasGaintag('olchongshen');
return get.itemtype(card)=='card'&&card.hasGaintag('olchongshen')&&get.color(card)=='red';
},
position:'h',
viewAs:{name:'shan'},
viewAsFilter(player){
if(!player.countCards('h',card=>card.hasGaintag('olchongshen'))) return false;
if(!player.countCards('h',card=>card.hasGaintag('olchongshen')&&get.color(card)=='red')) return false;
},
prompt:'将本轮得到的牌当作【闪】使用',
prompt:'将本轮得到的红色牌当作【闪】使用',
check(card){
return 7-get.value(card);
},
@ -779,7 +783,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
order:2,
respondShan:true,
skillTagFilter(player,tag,arg){
if(arg=='respond'||!player.countCards('h',card=>_status.connectMode||card.hasGaintag('olchongshen'))) return false;
if(arg=='respond'||!player.countCards('h',card=>_status.connectMode||card.hasGaintag('olchongshen')&&get.color(card)=='red')) return false;
},
effect:{
target(card,player,target,current){
@ -790,7 +794,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
group:'olchongshen_mark',
mod:{
aiValue(player,card,num){
if(get.name(card)!='shan'&&(get.itemtype(card)=='card'&&!card.hasGaintag('olchongshen'))) return;
if(get.name(card)!='shan'&&(get.itemtype(card)=='card'&&(!card.hasGaintag('olchongshen')||get.color(card)!='red'))) return;
let cards=player.getCards('hs',card=>get.name(card)=='shan'||card.hasGaintag('olchongshen'));
cards.sort((a,b)=>(get.name(b)=='shan'?1:2)-(get.name(a)=='shan'?1:2));
const geti=()=>{
@ -803,12 +807,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
aiUseful(){
return lib.skill.olchongshen.mod.aiValue.apply(this,arguments);
},
ignoredHandcard(card,player){
if(card.hasGaintag('olchongshen')) return true;
},
cardDiscardable(card,player,name){
if(name=='phaseDiscard'&&card.hasGaintag('olchongshen')) return false;
},
// ignoredHandcard(card,player){
// if(card.hasGaintag('olchongshen')) return true;
// },
// cardDiscardable(card,player,name){
// if(name=='phaseDiscard'&&card.hasGaintag('olchongshen')) return false;
// },
},
init(player){
if(game.phaseNumber>0){
@ -10564,7 +10568,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){
var target=trigger.getParent().target;
trigger.num=Math.max(1,target.getAllHistory('useCard',(evt)=>evt.card.name=='sha').length);
target.addTempSkill('juesheng',{player:'phaseAfter'});
target.addTempSkills('juesheng',{player:'phaseAfter'});
},
},
},
@ -15289,7 +15293,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var target=trigger.player;
var card=result.cards[0];
player.line(target,'green');
target.addTempSkill('new_zhixi','phaseUseAfter');
target.addTempSkills('new_zhixi','phaseUseAfter');
if(card.name!='sha'&&get.type(card)!='trick'&&get.color(card)!='black'){
target.addTempSkill('new_meibu_range','phaseUseAfter');
target.markAuto('new_meibu_range',player);
@ -17663,7 +17667,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 2'
var map=event.result||result;
if(map&&map.skills&&map.skills.length){
player.addSkils(map.skills);
player.addSkills(map.skills);
}
game.broadcastAll(function(list){
game.expandSkills(list);
@ -27213,9 +27217,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
olshandao_info:'出牌阶段限一次,你可以选择任意名角色,你选择这些角色的各一张牌,依次将这些牌放置到牌堆顶,然后你视为对这些角色使用【五谷丰登】,然后你视为对这些角色外的所有其他角色使用【万箭齐发】。',
ol_hujinding:'胡金定',
olqingyuan:'轻缘',
olqingyuan_info:'锁定技。①游戏开始时,或当你于本局游戏首次受到伤害后,你选择一名未以此法选择过的其他角色。②每回合限一次,你发动〖轻缘①〗选择过的角色得到牌后,你随机获得其中一名角色的随机一张牌。',
olqingyuan_info:'锁定技。①游戏开始时,或当你于本局游戏首次受到伤害后,你选择一名未以此法选择过的其他角色。②每回合限一次,你发动〖轻缘①〗选择过的角色得到牌后,你随机获得其中一名角色的随机一张牌。',
olchongshen:'重身',
olchongshen_info:'你可以将本轮得到的手牌当作【闪】使用,且这些牌不计入你的手牌上限。',
olchongshen_info:'你可以将本轮得到的红色手牌当作【闪】使用。',
sp_tianji:'天极·皇室宗亲',
sp_sibi:'四弼·辅国文曲',

View File

@ -1483,10 +1483,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(i!=skills.length-1) str+='、';
}
game.log(target,'的技能','#g'+str,'失效了');
game.log(player,'获得了技能','#g'+str);
// game.log(player,'获得了技能','#g'+str);
player.popup(skills,'thunder');
for(var skill of skills){
player.addTempSkill(skill,['phaseUseAfter','phaseAfter']);
player.addTempSkills(skill,['phaseUseAfter','phaseAfter']);
}
}
}
@ -1569,10 +1569,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(i!=skills.length-1) str+='、';
}
game.log(target,'的技能','#g'+str,'失效了');
game.log(player,'获得了技能','#g'+str);
// game.log(player,'获得了技能','#g'+str);
player.popup(skills,'thunder');
for(var skill of skills){
player.addTempSkill(skill,['phaseUseAfter','phaseAfter']);
player.addTempSkills(skill,['phaseUseAfter','phaseAfter']);
}
}
}

View File

@ -4334,7 +4334,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.awakenSkill('twmibei');
player.logSkill('twmibei_achieve');
game.log(player,'成功完成使命');
player.addSkils('twmouli');
player.addSkills('twmouli');
},
intro:{content:'已使用牌名:$'},
subSkill:{

View File

@ -213,7 +213,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
frequent:true,
async content(event,trigger,player){
let cards=get.cards(3);
const {result:{bool,links}}=await player.chooseButton(['灵慧:是否使用其中的一张牌并随机获得其中一张剩余牌?',cards]).set('ai',button=>{
await game.cardsGotoOrdering(cards);
const {result:{bool,links}}=await player.chooseButton(['灵慧:是否使用其中的一张牌并随机获得其中一张剩余牌?',cards]).set('filterButton',button=>{
return get.player().hasUseTarget(button.link);
}).set('ai',button=>{
return get.event('player').getUseValue(button.link);
});
if(bool){
@ -222,14 +225,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.$gain2(card,false);
await game.asyncDelayx();
await player.chooseUseTarget(true,card,false);
if(cards.length) await player.gain(cards.randomGet(),'gain2');
}
if(cards.length){
for(let i=cards.length-1;i--;i>=0){
ui.cardPile.insertBefore(cards[i],ui.cardPile.firstChild);
cards=cards.filterInD();
if(cards.length){
const cardx=cards.randomRemove();
await player.gain(cardx,'gain2');
}
}
game.updateRoundNumber();
if(cards.length){
cards.reverse();
game.cardsGotoPile(cards.filterInD(),'insert');
game.log(player,'将',get.cnNumber(cards.length),'张牌置于了牌堆顶');
}
},
},
dcxiace:{
@ -246,6 +252,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}));
return bool1||bool2;
},
direct:true,
async content(event,trigger,player){
if(trigger.player==player&&!player.hasHistory('custom',evt=>evt.dcxiace=='player')&&game.hasPlayer(target=>target!=player&&!target.hasSkill('fengyin'))){
const {result:{bool,targets}}=await player.chooseTarget((card,player,target)=>{
@ -296,6 +303,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return lib.skill.luanfeng.check(event,player);
},
logTarget:'player',
skillAnimation:true,
animationColor:'thunder',
async content(event,trigger,player){
player.awakenSkill('dcyuxin');
trigger.player.recover((trigger.player==player?1:player.getHp())-trigger.player.hp);
@ -13440,7 +13449,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
});
if(card) cards2.push(card);
}
player.addTempSkill(skill);
player.addTempSkills(skill);
if(cards2.length) player.gain(cards2,'gain2','log');
},
},

View File

@ -2029,8 +2029,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 2'
player.gain(cards,'gain2');
if(get.color(cards[0])!=get.color(cards[1])){
player.addTempSkill('wusheng');
player.addTempSkill('paoxiao');
player.addTempSkills(['wusheng','paoxiao']);
}
},
derivation:['wusheng','paoxiao'],
@ -9542,13 +9541,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{source:'damageSource'},
forced:true,
filter:function(event,player){
if(player.hasSkill('fuhun3')) return false;
if(['new_rewusheng','olpaoxiao'].every(skill=>player.hasSkill(skill,null,false,false))) return false;
return event.getParent().skill=='fuhun';
},
content:function(){
player.addTempSkill('new_rewusheng');
player.addTempSkill('olpaoxiao');
player.addTempSkill('fuhun3');
player.addTempSkills(['new_rewusheng','olpaoxiao']);
// player.addTempSkill('fuhun3');
}
},
fuhun3:{},
@ -14328,7 +14326,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
xinxuanhuo_info:'摸牌阶段开始时,你可以改为令一名其他角色摸两张牌,然后该角色需对其攻击范围内你选择的另一名角色使用一张【杀】,否则你获得其两张牌。',
fuhun:'父魂',
fuhun2:'父魂',
fuhun_info:'你可以将两张手牌当做【杀】使用或打出;出牌阶段,若你以此法使用的【杀】造成伤害,你获得技能〖武圣〗和〖咆哮〗直到回合结束。',
fuhun_info:'你可以将两张手牌当做【杀】使用或打出;当你于出牌阶段以此法使用的【杀】造成伤害,你获得〖武圣〗和〖咆哮〗直到回合结束。',
yuce:'御策',
yuce_info:'当你受到伤害后你可以展示一张手牌并令伤害来源选择一项弃置一张与此牌类型不同的手牌或令你回复1点体力。',
xiansi:'陷嗣',
@ -14528,7 +14526,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
oldmiji:'秘计',
oldmiji_info:'准备/结束阶段开始时若你已受伤你可以判定若判定结果为黑色你观看牌堆顶的X张牌X为你已损失的体力值然后将这些牌交给一名角色。',
old_fuhun:'父魂',
old_fuhun_info:'摸牌阶段开始时,你可以放弃摸牌,改为从牌堆顶亮出两张牌并获得之,若亮出的牌颜色不同,你获得技能“武圣”、“咆哮”,直到回合结束。',
old_fuhun_info:'摸牌阶段开始时,你可以放弃摸牌,改为从牌堆顶亮出两张牌并获得之,若亮出的牌颜色不同,你获得〖武圣〗和〖咆哮〗直到回合结束。',
rejueqing:'绝情',
rejueqing_info:'当你对其他角色造成伤害时,你可以令此伤害值+X。若如此做你失去X点体力并修改〖绝情〗X为伤害值。',
rejueqing_1st:'绝情',

View File

@ -1673,9 +1673,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
else event.finish();
'step 1'
player.addTempSkill(result.control,'phaseUseEnd');
player.addTempSkills(result.control,'phaseUseEnd');
player.popup(result.control);
game.log(player,'获得了','#g【'+get.translation(result.control)+'】');
// game.log(player,'获得了','#g【'+get.translation(result.control)+'】');
},
ai:{threaten:0.9},
subSkill:{
@ -3407,13 +3407,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(list.length==result.cards.length){
target.draw();
player.getStat('skill').sanchen--;
if(get.mode()=='guozhan') player.addTempSkill('pozhu');
if(get.mode()=='guozhan') player.addTempSkills('pozhu');
}
}
else{
target.draw();
player.getStat('skill').sanchen--;
if(get.mode()=='guozhan') player.addTempSkill('pozhu');
if(get.mode()=='guozhan') player.addTempSkills('pozhu');
}
},
ai:{
@ -3954,7 +3954,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
dezhang_info:'觉醒技。准备阶段若你没有“绥”则你减1点体力上限并获得〖卫戍〗。',
weishu:'卫戍',
weishu_info:'锁定技。①当你于摸牌阶段外不因〖卫戍①〗而摸牌后,你令一名角色摸一张牌。②当你于弃牌阶段外不因〖卫戍②〗而弃置牌后,你弃置一名其他角色的一张牌。',
jin_jiachong:'贾充',
jin_jiachong:'晋贾充',
jin_jiachong_prefix:'晋',
xiongshu:'凶竖',
xiongshu_info:'其他角色的出牌阶段开始时你可弃置X张牌X为你本轮内此前已发动过此技能的次数为0则不弃并展示其一张手牌然后你预测“其本阶段内是否会使用与展示牌牌名相同的牌”。此阶段结束时若你的预测正确则你对其造成1点伤害否则你获得展示牌。',
jianhui:'奸回',

View File

@ -8577,7 +8577,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
if(!player.hasSkill('olxuanfeng')) list.push('olxuanfeng');
if(!player.hasSkill('rewansha')) list.push('rewansha');
if(list.length==1){
player.addTempSkill(list[0]);
player.addTempSkills(list[0]);
event.finish();
}
else{
@ -8602,8 +8602,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}).set('prompt','选择获得一项技能直到回合结束');
}
'step 1'
player.addTempSkill(result.control);
player.popup(get.translation(result.control));
player.addTempSkills(result.control);
// player.popup(get.translation(result.control));
},
ai:{
order:function(){

View File

@ -11030,9 +11030,9 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
'step 2'
if(result.control!='cancel2'){
var skill='jiahe_'+result.control;
player.addTempSkill(skill);
player.addTempSkills(skill);
if(!event.done) player.logSkill('jiahe_put');
game.log(player,'获得了技能','【'+get.translation(skill)+'】');
// game.log(player,'获得了技能','【'+get.translation(skill)+'】');
if(event.num>=5&&!event.done){
event.done=true;
event.goto(1);