Merge pull request #950 from libccy/changeSkill-dev

[WIP] “获得/失去技能时”的时机
This commit is contained in:
Spmario233 2024-02-15 21:27:54 +08:00 committed by GitHub
commit 0275ec4a28
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
28 changed files with 617 additions and 504 deletions

View File

@ -441,9 +441,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
else event.goto(2); else event.goto(2);
'step 1' 'step 1'
if(result.bool){ if(result.bool){
player.removeSkill('clanbaozu'); player.removeSkills('clanbaozu');
player.popup('保族');
game.log(player,'失去了技能','#g【保族】');
} }
else player.loseHp(); else player.loseHp();
'step 2' 'step 2'
@ -1542,7 +1540,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return player.getStorage('clanfangzhen_remove').includes(game.roundNumber); return player.getStorage('clanfangzhen_remove').includes(game.roundNumber);
}, },
content(){ content(){
player.removeSkill('clanfangzhen'); player.removeSkills('clanfangzhen');
} }
} }
} }
@ -1812,9 +1810,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.finish(); event.finish();
} }
'step 6' 'step 6'
player.removeSkill(result.control); player.removeSkills(result.control);
player.popup(result.control);
game.log(player,'失去了技能','#g【'+get.translation(result.control)+'】');
}, },
ai:{ ai:{
expose:0.1, expose:0.1,
@ -2392,9 +2388,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}); });
'step 1' 'step 1'
if(result.control!='cancel2'){ if(result.control!='cancel2'){
player.removeSkill(result.control); player.removeSkills(result.control);
player.popup(result.control);
game.log(player,'失去了技能','#g【'+get.translation(result.control)+'】');
} }
else{ else{
player.loseHp(); player.loseHp();

View File

@ -618,7 +618,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.addMark('dcbianzhuang',1,false); player.addMark('dcbianzhuang',1,false);
if(player.countMark('dcbianzhuang')>2){ if(player.countMark('dcbianzhuang')>2){
player.storage.dcbianzhuang_inited=true; player.storage.dcbianzhuang_inited=true;
player.reinit('zhutiexiong','wu_zhutiexiong'); player.reinitCharacter('zhutiexiong','wu_zhutiexiong');
} }
} }
}, },

View File

@ -2812,8 +2812,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}); });
} }
else{ else{
game.log(player,'失去了技能','#g【齐策】'); player.removeSkills('dddqice');
player.removeSkill('dddqice');
event.finish(); event.finish();
} }
'step 1' 'step 1'
@ -3165,8 +3164,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
else{ else{
if(!targets.includes(player)) player.loseMaxHp(); if(!targets.includes(player)) player.loseMaxHp();
if(targets.length==1){ if(targets.length==1){
player.removeSkill('dddxiaheng'); player.removeSkills('dddxiaheng');
game.log(player,'失去了技能','#g【侠横】');
} }
} }
'step 5' 'step 5'
@ -3272,8 +3270,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}).setContent('gaincardMultiple'); }).setContent('gaincardMultiple');
if(!lose) event.finish(); if(!lose) event.finish();
'step 5' 'step 5'
player.removeSkill('dddfengzheng'); player.removeSkills('dddfengzheng');
game.log(player,'失去了技能','#g【丰政】');
}, },
subSkill:{ subSkill:{
global:{ global:{
@ -4435,8 +4432,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
// return event.source&&event.source.isIn()&&event.source.getEquips(1).length>0; // return event.source&&event.source.isIn()&&event.source.getEquips(1).length>0;
// }, // },
content(){ content(){
player.removeSkill('dddxiaoxing'); player.removeSkills('dddxiaoxing');
game.log(player,'失去了技能','#g【枭行】');
}, },
content_old(){ content_old(){
'step 0' 'step 0'
@ -4448,8 +4444,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(result.bool){ if(result.bool){
trigger.source.logSkill('dddxiaoxing',player); trigger.source.logSkill('dddxiaoxing',player);
trigger.source.disableEquip(1); trigger.source.disableEquip(1);
player.removeSkill('dddxiaoxing'); player.removeSkills('dddxiaoxing');
game.log(player,'失去了技能','#g【枭行】');
} }
} }
} }
@ -4541,8 +4536,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.gain(cards,'log'); player.gain(cards,'log');
} }
'step 5' 'step 5'
player.removeSkill('dddlangzhi'); player.removeSkills('dddlangzhi');
game.log(player,'失去了技能','#g【狼志】');
event.finish(); event.finish();
'step 6' 'step 6'
game.broadcastAll('closeDialog',event.videoId); game.broadcastAll('closeDialog',event.videoId);
@ -4610,7 +4604,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
else event.finish(); else event.finish();
'step 2' 'step 2'
var skill=result.control; var skill=result.control;
player.addSkillLog(skill); player.addSkills(skill);
}, },
content_old(){ content_old(){
'step 0' 'step 0'
@ -4648,14 +4642,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.draw(3); player.draw(3);
} }
else event.finish(); else event.finish();
for(var i of skills){ player.addSkills(skills);
player.addSkillLog(i);
}
} }
else event.finish(); else event.finish();
'step 2' 'step 2'
player.removeSkill('dddfuyi'); player.removeSkills('dddfuyi');
game.log(player,'失去了技能','#g【附义】');
}, },
subSkill:{ subSkill:{
sha:{ sha:{
@ -5290,8 +5281,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
else event.finish(); else event.finish();
'step 3' 'step 3'
if(target.isIn()){event.finish(); return}; if(target.isIn()){event.finish(); return};
player.removeSkill('dddbailei'); player.removeSkills('dddbailei');
game.log(player,'失去了技能','#g【拜泪】');
}, },
subSkill:{ subSkill:{
animate:{ animate:{

View File

@ -1774,12 +1774,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.awakenSkill('tomoyo_zhengfeng'); player.awakenSkill('tomoyo_zhengfeng');
player.loseMaxHp(); player.loseMaxHp();
'step 1' 'step 1'
player.removeSkill('tomoyo_wuwei'); player.removeSkills('tomoyo_wuwei');
'step 2' 'step 2'
player.draw(2); player.draw(2);
player.recover(); player.recover();
'step 3' 'step 3'
player.addSkill('tomoyo_changshi'); player.addSkills('tomoyo_changshi');
}, },
}, },
}, },
@ -2195,12 +2195,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
multiline:true, multiline:true,
line:{color:[253, 153, 182]}, line:{color:[253, 153, 182]},
content(){ content(){
game.countPlayer(function(current){ game.filterPlayer().sortBySeat().forEach(function(current){
if(!targets.includes(current)){ if(!targets.includes(current)){
current.removeSkill('seira_yinyuan'); current.removeSkills('seira_yinyuan');
} }
else{ else{
current.addSkillLog('seira_yinyuan'); current.addSkills('seira_yinyuan');
} }
}); });
game.delayx(); game.delayx();
@ -2350,7 +2350,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.draw(2); player.draw(2);
player.markAuto('nsxingyun',[lib.skill.nsxingyun.getSixiang(trigger.card)]); player.markAuto('nsxingyun',[lib.skill.nsxingyun.getSixiang(trigger.card)]);
'step 1' 'step 1'
if(player.getStorage('nsxingyun').length>=4) player.addSkillLog('bazhen'); if(player.getStorage('nsxingyun').length>=4) player.addSkills('bazhen');
}, },
}, },
round:{ round:{
@ -3416,8 +3416,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(owner&&owner!=player) owner.give(card,player); if(owner&&owner!=player) owner.give(card,player);
'step 1' 'step 1'
if(player.hp<player.maxHp) player.recover(player.maxHp-player.hp); if(player.hp<player.maxHp) player.recover(player.maxHp-player.hp);
player.removeSkill('mia_shihui'); player.changeSkills(['mia_fengfa'],['mia_shihui']);
player.addSkill('mia_fengfa');
}, },
}, },
fail:{ fail:{
@ -3841,7 +3840,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.storage.tenzen_lingyu=true; player.storage.tenzen_lingyu=true;
player.loseMaxHp(); player.loseMaxHp();
if(player.isHealthy()) player.draw(2); if(player.isHealthy()) player.draw(2);
player.addSkill('tenzen_tianquan'); player.addSkills('tenzen_tianquan');
}, },
}, },
tenzen_tianquan:{ tenzen_tianquan:{
@ -4626,14 +4625,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content(){ content(){
'step 0' 'step 0'
player.awakenSkill('yukito_yaxiang'); player.awakenSkill('yukito_yaxiang');
player.reinit('key_yukito','key_crow'); player.reinitCharacter('key_yukito', 'key_crow', false);
'step 1' 'step 1'
if(target.hp<3) target.recover(3-target.hp); if(target.hp<3) target.recover(3-target.hp);
'step 2' 'step 2'
var cards=target.getCards('j'); var cards=target.getCards('j');
if(cards.length) target.discard(cards); if(cards.length) target.discard(cards);
'step 3' 'step 3'
target.addSkill('misuzu_zhongyuan'); target.addSkills('misuzu_zhongyuan');
}, },
derivation:'misuzu_zhongyuan', derivation:'misuzu_zhongyuan',
ai:{ ai:{
@ -4860,7 +4859,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content(){ content(){
player._chihaya_liewu=true; player._chihaya_liewu=true;
player.loseMaxHp(4); player.loseMaxHp(4);
player.addSkill('chihaya_huairou'); player.addSkills('chihaya_huairou');
}, },
}, },
chihaya_huairou:{ chihaya_huairou:{
@ -5248,7 +5247,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.logSkill('hiroto_huyu',target); player.logSkill('hiroto_huyu',target);
target.give(result.cards,player); target.give(result.cards,player);
player.storage.hiroto_huyu2=target; player.storage.hiroto_huyu2=target;
player.addSkill('hiroto_zonglve'); player.addSkills('hiroto_zonglve');
player.addSkill('hiroto_huyu2'); player.addSkill('hiroto_huyu2');
} }
}, },
@ -5259,9 +5258,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true, forced:true,
popup:false, popup:false,
charlotte:true, charlotte:true,
content(){ async content(event,trigger,player){
player.removeSkill('hiroto_huyu2'); player.removeSkill('hiroto_huyu2');
player.removeSkill('hiroto_zonglve'); await player.removeSkills('hiroto_zonglve');
player.removeGaintag('hiroto_huyu2'); player.removeGaintag('hiroto_huyu2');
var target=player.storage.hiroto_huyu2; var target=player.storage.hiroto_huyu2;
if(target&&target.isIn()){ if(target&&target.isIn()){
@ -5348,8 +5347,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content(){ content(){
player.awakenSkill('hiroto_tuolao'); player.awakenSkill('hiroto_tuolao');
player.draw(3); player.draw(3);
player.removeSkill('hiroto_huyu'); player.changeSkills(['hiroto_zonglve'],['hiroto_huyu']);
player.addSkill('hiroto_zonglve');
}, },
}, },
shizuku_sizhi:{ shizuku_sizhi:{
@ -5711,7 +5709,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.recover(); player.recover();
var list=['umi_chaofan','ao_xishi','tsumugi_mugyu','kamome_jieban']; var list=['umi_chaofan','ao_xishi','tsumugi_mugyu','kamome_jieban'];
var skill=list.randomGet(); var skill=list.randomGet();
player.addSkillLog(skill); player.addSkills(skill);
player.flashAvatar('shiroha_jiezhao','key_'+skill.split('_')[0]); player.flashAvatar('shiroha_jiezhao','key_'+skill.split('_')[0]);
} }
}, },
@ -6286,8 +6284,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return info&&info.charlotte==true; return info&&info.charlotte==true;
}); });
if(skills.length){ if(skills.length){
target.removeSkill(skills); target.removeSkills(skills);
player.addSkill(skills); player.addSkills(skills);
lib.translate.yuu_lveduo_info=lib.translate.yuu_lveduo_full_info; lib.translate.yuu_lveduo_info=lib.translate.yuu_lveduo_full_info;
} }
if(target.name=='key_yusa'){ if(target.name=='key_yusa'){
@ -6354,7 +6352,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.awakenSkill('godan_xiaoyuan'); player.awakenSkill('godan_xiaoyuan');
player.loseMaxHp(3); player.loseMaxHp(3);
player.draw(3); player.draw(3);
player.removeSkill('godan_feiqu'); player.removeSkills('godan_feiqu');
}, },
}, },
abyusa_jueqing:{ abyusa_jueqing:{
@ -6882,7 +6880,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(cards.length) player.discard(cards); if(cards.length) player.discard(cards);
player.removeSkill('kud_qiaoshou_equip'); player.removeSkill('kud_qiaoshou_equip');
player.draw(cards.length); player.draw(cards.length);
player.addSkill('kud_chongzhen'); player.addSkills('kud_chongzhen');
'step 1' 'step 1'
var num=2-player.hp; var num=2-player.hp;
if(num) player.recover(num); if(num) player.recover(num);
@ -7817,9 +7815,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.recover(num); player.recover(num);
player.draw(num); player.draw(num);
if(_status.characterlist&&_status.characterlist.includes('key_midori')){ if(_status.characterlist&&_status.characterlist.includes('key_midori')){
player.reinit('key_mio','key_midori',false); player.reinitCharacter('key_mio','key_midori', false);
_status.characterlist.remove('key_midori');
_status.characterlist.add('key_mio');
} }
}, },
}, },
@ -7892,9 +7888,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.recover(num); player.recover(num);
player.draw(num); player.draw(num);
if(_status.characterlist&&_status.characterlist.includes('key_mio')){ if(_status.characterlist&&_status.characterlist.includes('key_mio')){
player.reinit('key_midori','key_mio',false); player.reinitCharacter('key_midori', 'key_mio', false);
_status.characterlist.remove('key_mio');
_status.characterlist.add('key_midori');
} }
}, },
}, },
@ -8043,10 +8037,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
animationColor:'orange', animationColor:'orange',
content(){ content(){
player.awakenSkill('yuzuru_deyi'); player.awakenSkill('yuzuru_deyi');
player.removeSkill('yuzuru_wuxin'); player.changeSkills(['yuzuru_kunfen','yuzuru_quji','yuzuru_wangsheng'],['yuzuru_wuxin']);
player.addSkillLog('yuzuru_kunfen');
player.addSkillLog('yuzuru_quji');
player.addSkillLog('yuzuru_wangsheng');
player.loseMaxHp(); player.loseMaxHp();
player.recover(); player.recover();
}, },
@ -8243,8 +8234,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
content(){ content(){
player.awakenSkill('ao_shixin'); player.awakenSkill('ao_shixin');
player.removeSkill('ao_kuihun'); player.changeSkills(['ao_diegui'],['ao_kuihun']);
player.addSkill('ao_diegui');
player.gainMaxHp(); player.gainMaxHp();
player.recover(); player.recover();
}, },
@ -8872,10 +8862,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
content(){ content(){
player.awakenSkill('riki_mengzhong'); player.awakenSkill('riki_mengzhong');
player.removeSkill('riki_spwenji'); player.removeSkills('riki_spwenji');
player.gainMaxHp(); player.gainMaxHp();
player.recover(); player.recover();
player.addSkill('riki_chongzhen'); player.addSkills('riki_chongzhen');
}, },
}, },
riki_chongzhen:{ riki_chongzhen:{
@ -10035,7 +10025,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
content(){ content(){
player.awakenSkill('yui_takaramono'); player.awakenSkill('yui_takaramono');
player.addSkill('yui_yinhang'); player.addSkills('yui_yinhang');
player.storage._ichiban_no_takaramono=true; player.storage._ichiban_no_takaramono=true;
player.gainMaxHp(); player.gainMaxHp();
player.recover(); player.recover();
@ -10676,7 +10666,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return event.getParent(2).name=='komari_xueshang'&&event.getParent(2).player==player; return event.getParent(2).name=='komari_xueshang'&&event.getParent(2).player==player;
}, },
content(){ content(){
player.removeSkill('komari_xueshang'); player.removeSkills('komari_xueshang');
player.gainMaxHp(true); player.gainMaxHp(true);
player.recover(); player.recover();
}, },
@ -10760,7 +10750,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content(){ content(){
'step 0' 'step 0'
player.awakenSkill('umi_qihuan'); player.awakenSkill('umi_qihuan');
player.reinit('key_umi','key_umi2'); player.reinitCharacter('key_umi', 'key_umi2', false);
player.recover(game.countGroup()||1); player.recover(game.countGroup()||1);
if(!game.dead.length) event.finish(); if(!game.dead.length) event.finish();
'step 1' 'step 1'
@ -10806,8 +10796,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.chooseControl(list).set('prompt','选择获得一个技能'); player.chooseControl(list).set('prompt','选择获得一个技能');
} }
'step 4' 'step 4'
player.addSkill(result.control,get.groupnature(event.temp.group)||'key'); //player.addSkills(result.control,get.groupnature(event.temp.group)||'key');
player.addSkill(result.control); player.addSkills(result.control);
var info=get.info(result.control); var info=get.info(result.control);
if(info.zhuSkill){ if(info.zhuSkill){
if(!player.storage.zhuSkill_umi_qihuan) player.storage.zhuSkill_umi_qihuan=[]; if(!player.storage.zhuSkill_umi_qihuan) player.storage.zhuSkill_umi_qihuan=[];
@ -17649,8 +17639,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 1' 'step 1'
if(result.bool){ if(result.bool){
var skills=lib.skill.junkyuheng.derivation.randomGets(result.cards.length); var skills=lib.skill.junkyuheng.derivation.randomGets(result.cards.length);
player.addAdditionalSkill('junkyuheng',skills); player.changeSkills(skills,[]).set('$handle',(player,skills)=>{
game.log(player,'获得了以下技能:','#g'+get.translation(skills)); player.addAdditionalSkill('junkyuheng',skills);
game.log(player,'获得了以下技能:','#g'+get.translation(skills));
});
} }
}, },
group:'junkyuheng_remove', group:'junkyuheng_remove',
@ -17664,22 +17656,25 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return player.additionalSkills.junkyuheng&&player.additionalSkills.junkyuheng.length>0; return player.additionalSkills.junkyuheng&&player.additionalSkills.junkyuheng.length>0;
}, },
content(){ content(){
player.draw(player.additionalSkills.junkyuheng.length); const skills = player.additionalSkills.junkyuheng;
game.log(player,'失去了以下技能:','#g'+get.translation(player.additionalSkills.junkyuheng)); player.draw(skills.length);
player.removeAdditionalSkill('junkyuheng'); player.changeSkills([],skills).set('$handle',(player,addSkills,removeSkills)=>{
game.log(player,'失去了以下技能:','#g'+get.translation(removeSkills));
for(let skill of removeSkills) player.removeAdditionalSkill('junkyuheng',skill);
});
}, },
}, },
}, },
}, },
junkdili:{ junkdili:{
audio:'dili', audio:'dili',
trigger:{player:'logSkill'}, trigger:{player:'changeSkillsAfter'},
forced:true, forced:true,
juexingji:true, juexingji:true,
skillAnimation:true, skillAnimation:true,
animationColor:'wood', animationColor:'wood',
filter(event,player){ filter(event,player){
if(event.skill!='junkyuheng') return false; if(!event.addSkill.length) return false;
var skills=player.getSkills(null,false,false).filter(function(i){ var skills=player.getSkills(null,false,false).filter(function(i){
var info=get.info(i); var info=get.info(i);
return info&&!info.charlotte; return info&&!info.charlotte;
@ -17734,12 +17729,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(result.bool){ if(result.bool){
var skills=result.links; var skills=result.links;
game.log(player,'失去了以下技能:','#g'+get.translation(skills)); game.log(player,'失去了以下技能:','#g'+get.translation(skills));
player.removeSkill(skills.slice(0)); player.removeSkills(skills.slice(0));
} }
var list=lib.skill.junkdili.derivation; var list=lib.skill.junkdili.derivation;
for(var i=0;i<Math.min(skills.length,list.length);i++){ list=list.slice(0,Math.min(skills.length,list.length));
player.addSkillLog(list[i]); player.addSkills(list);
}
}, },
derivation:['junkshengzhi','junkquandao','junkchigang'], derivation:['junkshengzhi','junkquandao','junkchigang'],
}, },
@ -18952,7 +18946,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
junkyuheng:'驭衡', junkyuheng:'驭衡',
junkyuheng_info:'锁定技。①回合开始时,你须弃置任意张花色不同的牌,从<span style="font-family: yuanli">东吴命运线·改</span>中随机获得等量的技能。②回合结束时,你失去所有因〖驭衡①〗获得的技能,然后摸等量的牌。', junkyuheng_info:'锁定技。①回合开始时,你须弃置任意张花色不同的牌,从<span style="font-family: yuanli">东吴命运线·改</span>中随机获得等量的技能。②回合结束时,你失去所有因〖驭衡①〗获得的技能,然后摸等量的牌。',
junkdili:'帝力', junkdili:'帝力',
junkdili_info:'觉醒技。当你发动〖驭衡①〗若你拥有的技能数大于你的体力上限则你减1点体力上限选择失去任意个其他技能然后获得以下技能中的前等量个〖圣质〗/〖权道〗/〖持纲〗。', junkdili_info:'觉醒技。当你获得技能若你拥有的技能数大于你的体力上限则你减1点体力上限选择失去任意个其他技能然后获得以下技能中的前等量个〖圣质〗/〖权道〗/〖持纲〗。',
junkshengzhi:'圣质', junkshengzhi:'圣质',
junkshengzhi_info:'锁定技。当你发动非锁定技后,你令你本回合使用的下一张牌无距离和次数限制。', junkshengzhi_info:'锁定技。当你发动非锁定技后,你令你本回合使用的下一张牌无距离和次数限制。',
junkquandao:'权道', junkquandao:'权道',

View File

@ -998,12 +998,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var target=trigger.player; var target=trigger.player;
player.awakenSkill('jxzhaoluan'); player.awakenSkill('jxzhaoluan');
trigger.cancel(); trigger.cancel();
target.getSkills(null,false,false).forEach(skill=>{ const skills = target.getSkills(null,false,false).filter(skill=>{
var info=get.info(skill); var info=get.info(skill);
if(info&&!info.charlotte&&!get.is.locked(skill)){ if(info&&!info.charlotte&&!get.is.locked(skill)){
target.removeSkill(skill); return true;
} }
}); });
if(skills.length) yield target.removeSkills(skills);
yield target.gainMaxHp(3); yield target.gainMaxHp(3);
var num=3-target.getHp(true); var num=3-target.getHp(true);
if(num>0) yield target.recover(num); if(num>0) yield target.recover(num);
@ -1630,7 +1631,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 0' 'step 0'
player.awakenSkill('dcqijing'); player.awakenSkill('dcqijing');
player.loseMaxHp(); player.loseMaxHp();
player.addSkillLog('dccuixin'); player.addSkills('dccuixin');
'step 1' 'step 1'
if(game.countPlayer()>2){ if(game.countPlayer()>2){
if(player==trigger.player&&!trigger.skill){ if(player==trigger.player&&!trigger.skill){
@ -3199,7 +3200,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return info&&!info.charlotte&&!get.is.locked(i); return info&&!info.charlotte&&!get.is.locked(i);
}); });
if(skills.length){ if(skills.length){
for(var i of skills) player.removeSkill(i); player.removeSkills(skills);
} }
//初始化技能库 //初始化技能库
var list1=['dili_shengzhi','dili_chigang','dili_qionglan','dili_quandao','dili_jiaohui','dili_yuanlv']; var list1=['dili_shengzhi','dili_chigang','dili_qionglan','dili_quandao','dili_jiaohui','dili_yuanlv'];
@ -3251,7 +3252,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
skills.add(fullskills.randomRemove(1)[0]); skills.add(fullskills.randomRemove(1)[0]);
} }
for(var i of skills){ for(var i of skills){
player.addSkillLog(i); player.addSkills(i);
} }
player.markAuto('yuheng',skills); player.markAuto('yuheng',skills);
}, },
@ -3440,10 +3441,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},'请选择火【杀】的目标('+(event.num==9?'⑨':event.num)+'/9',false); },'请选择火【杀】的目标('+(event.num==9?'⑨':event.num)+'/9',false);
'step 2' 'step 2'
if(result.bool&&event.num<9) event.goto(1); if(result.bool&&event.num<9) event.goto(1);
else{ else player.removeSkills('jiufa');
player.removeSkill('jiufa'); 'step 3'
player.addSkill('pingxiang_effect'); player.addSkill('pingxiang_effect');
}
}, },
ai:{ ai:{
order(){ order(){
@ -4109,7 +4109,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content(){ content(){
game.log(player,'成功完成使命'); game.log(player,'成功完成使命');
player.awakenSkill('tspowei'); player.awakenSkill('tspowei');
player.addSkillLog('shenzhu'); player.addSkills('shenzhu');
}, },
}, },
fail:{ fail:{
@ -4351,7 +4351,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var target=result.targets[0]; var target=result.targets[0];
player.line(target,'green'); player.line(target,'green');
target.storage.zuoxing=player; target.storage.zuoxing=player;
target.addSkill('zuoxing'); target.addSkills('zuoxing');
} }
}, },
derivation:'zuoxing', derivation:'zuoxing',
@ -4772,7 +4772,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(lib.character[target.name]) list.addArray(lib.character[target.name][3]); if(lib.character[target.name]) list.addArray(lib.character[target.name][3]);
if(lib.character[target.name1]) list.addArray(lib.character[target.name1][3]); if(lib.character[target.name1]) list.addArray(lib.character[target.name1][3]);
if(lib.character[target.name2]) list.addArray(lib.character[target.name2][3]); if(lib.character[target.name2]) list.addArray(lib.character[target.name2][3]);
player.addSkill(list); player.addSkills(list);
game.broadcastAll(function(list){ game.broadcastAll(function(list){
lib.character.key_shiki[3].addArray(list); lib.character.key_shiki[3].addArray(list);
game.expandSkills(list); game.expandSkills(list);
@ -5095,8 +5095,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
content(){ content(){
player.awakenSkill(event.name); player.awakenSkill(event.name);
player.addSkill('tianxing'); player.addSkills(['tianxing','new_rejianxiong']);
player.addSkill('new_rejianxiong');
player.loseMaxHp(); player.loseMaxHp();
player.gain(player.getExpansions('chuyuan'),'gain2','fromStorage'); player.gain(player.getExpansions('chuyuan'),'gain2','fromStorage');
}, },
@ -5118,7 +5117,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.loseMaxHp(); player.loseMaxHp();
player.gain(player.getExpansions('chuyuan'),'gain2','fromStorage'); player.gain(player.getExpansions('chuyuan'),'gain2','fromStorage');
"step 1" "step 1"
player.removeSkill('chuyuan'); player.removeSkills('chuyuan');
player.chooseControl('rerende','rezhiheng','olluanji','caopi_xingdong').set('prompt','选择获得一个技能').set('ai',function(){ player.chooseControl('rerende','rezhiheng','olluanji','caopi_xingdong').set('prompt','选择获得一个技能').set('ai',function(){
var player=_status.event.player; var player=_status.event.player;
if(!player.hasSkill('luanji')&&!player.hasSkill('olluanji')&&player.getUseValue({name:'wanjian'})>4) return 'olluanji'; if(!player.hasSkill('luanji')&&!player.hasSkill('olluanji')&&player.getUseValue({name:'wanjian'})>4) return 'olluanji';
@ -5127,7 +5126,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return 'rerende'; return 'rerende';
}); });
'step 2' 'step 2'
player.addSkillLog(result.control); player.addSkills(result.control);
}, },
}, },
olzhiti:{ olzhiti:{
@ -5902,9 +5901,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return player.countMark('renjie')>=4; return player.countMark('renjie')>=4;
}, },
content(){ content(){
player.loseMaxHp();
player.addSkill('jilue');
player.awakenSkill('sbaiyin'); player.awakenSkill('sbaiyin');
player.loseMaxHp();
player.addSkills('jilue');
}, },
derivation:['jilue','reguicai','fangzhu','rejizhi','rezhiheng','rewansha'], derivation:['jilue','reguicai','fangzhu','rejizhi','rezhiheng','rewansha'],
}, },
@ -7534,7 +7533,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true, forced:true,
popup:false, popup:false,
content(){ content(){
player.removeSkill(player.storage.drlt_duorui[0]); player.removeSkills(player.storage.drlt_duorui[0]);
delete player.storage.drlt_duorui_player; delete player.storage.drlt_duorui_player;
player.storage.drlt_duorui=[]; player.storage.drlt_duorui=[];
}, },

View File

@ -246,7 +246,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(get.type(name)==='delay') return false; if(get.type(name)==='delay') return false;
const card=new lib.element.VCard({name:name}); const card=new lib.element.VCard({name:name});
return get.tag(card,'damage')&&!player.getStorage('dcdehua').includes(name); return get.tag(card,'damage')&&!player.getStorage('dcdehua').includes(name);
})) player.removeSkillLog('dcdehua'); })) player.removeSkills('dcdehua');
}, },
mod:{ mod:{
maxHandcard(player,num){ maxHandcard(player,num){
@ -527,12 +527,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
content:function(){ content:function(){
var num=Math.min(cards.length,4-player.countMark('dcmanwang')); var num=Math.min(cards.length,4-player.countMark('dcmanwang'));
if(num>=1) player.addSkill('dcpanqin'); if(num>=1) player.addSkills('dcpanqin');
if(num>=2) player.draw(); if(num>=2) player.draw();
if(num>=3) player.recover(); if(num>=3) player.recover();
if(num>=4){ if(num>=4){
player.draw(2); player.draw(2);
player.removeSkill('dcpanqin'); player.removeSkills('dcpanqin');
} }
}, },
ai:{ ai:{
@ -578,7 +578,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
switch(player.countMark('dcmanwang')){ switch(player.countMark('dcmanwang')){
case 1: case 1:
player.draw(2); player.draw(2);
player.removeSkill('dcpanqin'); player.removeSkills('dcpanqin');
break; break;
case 2: case 2:
player.recover(); player.recover();
@ -587,7 +587,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.draw(); player.draw();
break; break;
case 4: case 4:
player.addSkill('dcpanqin'); player.addSkills('dcpanqin');
break; break;
} }
'step 1' 'step 1'
@ -3337,11 +3337,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
'step 0' 'step 0'
player.awakenSkill('dcchongxu'); player.awakenSkill('dcchongxu');
player.removeSkills('dchuiling');
player.gainMaxHp(Math.min(game.countPlayer(),player.countMark('dchuiling'))); player.gainMaxHp(Math.min(game.countPlayer(),player.countMark('dchuiling')));
player.removeSkill('dchuiling');
'step 1' 'step 1'
player.addSkillLog('dctaji'); player.addSkills(['dctaji','dcqinghuang']);
player.addSkillLog('dcqinghuang');
}, },
ai:{ ai:{
order:function(itemp,player){ order:function(itemp,player){
@ -7643,7 +7642,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
else event.goto(3); else event.goto(3);
'step 2' 'step 2'
game.broadcastAll('closeDialog',event.videoId); game.broadcastAll('closeDialog',event.videoId);
target.addSkillLog(result.control); target.addSkills(result.control);
'step 3' 'step 3'
var storage=player.storage.dunshi; var storage=player.storage.dunshi;
if(event.links.includes(1)){ if(event.links.includes(1)){
@ -10030,8 +10029,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(player.maxHp>player.hp) player.recover(player.maxHp-player.hp); if(player.maxHp>player.hp) player.recover(player.maxHp-player.hp);
'step 2' 'step 2'
player.drawTo(Math.min(5,player.maxHp)); player.drawTo(Math.min(5,player.maxHp));
player.addSkillLog('llqshenwei'); player.addSkills(['llqshenwei','wushuang']);
player.addSkillLog('wushuang');
}, },
}, },
llqshenwei:{ llqshenwei:{

View File

@ -1204,7 +1204,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(bool){ if(bool){
player.logSkill('jsrgfangjie'); player.logSkill('jsrgfangjie');
await player.discard(links); await player.discard(links);
player.removeSkillLog('jsrgfangjie'); player.removeSkills('jsrgfangjie');
} }
} }
}, },
@ -3965,9 +3965,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
player.awakenSkill('jsrgzhasi'); player.awakenSkill('jsrgzhasi');
trigger.cancel(); trigger.cancel();
player.removeSkill('jsrgzhiheng'); player.changeSkills(['rezhiheng'],['jsrgzhiheng']);
game.log(player,'失去了技能','#g【猘横】');
player.addSkillLog('rezhiheng');
player.addSkill('jsrgzhasi_undist'); player.addSkill('jsrgzhasi_undist');
}, },
derivation:'rezhiheng', derivation:'rezhiheng',
@ -6272,8 +6270,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger.targets.forEach(i=>i.removeSkill('huogong2')); trigger.targets.forEach(i=>i.removeSkill('huogong2'));
} }
else{ else{
player.removeSkill('jsrgguanhuo'); player.removeSkills('jsrgguanhuo');
game.log(player,'失去了技能','#g【观火】');
} }
}, },
ai:{ ai:{
@ -7652,8 +7649,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.awakenSkill('jsrghuilie'); player.awakenSkill('jsrghuilie');
player.loseMaxHp(); player.loseMaxHp();
'step 1' 'step 1'
player.addSkillLog('jsrgpingrong'); player.addSkills(['jsrgpingrong','feiying']);
player.addSkillLog('feiying');
} }
}, },
jsrgpingrong:{ jsrgpingrong:{

View File

@ -5907,7 +5907,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(result.bool){ if(result.bool){
var es=target.getCards('e'); var es=target.getCards('e');
target.give(es,player,'give'); target.give(es,player,'give');
player.removeSkill('mobileyanzhu'); player.removeSkills('mobileyanzhu');
player.storage.mobileyanzhu=true; player.storage.mobileyanzhu=true;
player.popup('兴学'); player.popup('兴学');
game.log(player,'修改了技能','#g【兴学】'); game.log(player,'修改了技能','#g【兴学】');
@ -6783,7 +6783,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
player.awakenSkill('moucuan'); player.awakenSkill('moucuan');
player.loseMaxHp(); player.loseMaxHp();
player.addSkill('binghuo'); player.addSkills('binghuo');
}, },
ai:{combo:'jibing'}, ai:{combo:'jibing'},
}, },
@ -9783,10 +9783,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.skills=skills; event.skills=skills;
player.chooseControl(skills).set('dialog',['选择令'+get.translation(target)+'获得一个技能',[chara,'character']]); player.chooseControl(skills).set('dialog',['选择令'+get.translation(target)+'获得一个技能',[chara,'character']]);
'step 2' 'step 2'
target.addSkillLog(result.control); target.addSkills(result.control);
target.setAvatarQueue(target.name1||target.name,[event.chara[event.skills.indexOf(result.control)]]); target.setAvatarQueue(target.name1||target.name,[event.chara[event.skills.indexOf(result.control)]]);
'step 3'
if(target.isZhu2()) event.trigger('zhuUpdate');
}, },
}, },
hongyi:{ hongyi:{
@ -9898,13 +9896,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
content:function(){ content:function(){
player.awakenSkill('requanfeng'); player.awakenSkill('requanfeng');
player.removeSkill('hongyi'); player.removeSkills('hongyi');
var skills=trigger.player.getStockSkills('仲村由理','天下第一').filter(function(skill){ var skills=trigger.player.getStockSkills('仲村由理','天下第一').filter(function(skill){
var info=get.info(skill); var info=get.info(skill);
return info&&!info.hiddenSkill&&!info.zhuSkill&&!info.charlotte; return info&&!info.hiddenSkill&&!info.zhuSkill&&!info.charlotte;
}); });
if(skills.length){ if(skills.length){
for(var i of skills) player.addSkillLog(i); player.addSkills(skills);
game.broadcastAll(function(list){ game.broadcastAll(function(list){
game.expandSkills(list); game.expandSkills(list);
for(var i of list){ for(var i of list){
@ -9945,7 +9943,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return list.randomGet(); return list.randomGet();
}); });
'step 1' 'step 1'
player.addSkillLog(result.control); player.addSkills(result.control);
game.broadcastAll(function(skill){ game.broadcastAll(function(skill){
var list=[skill];game.expandSkills(list); var list=[skill];game.expandSkills(list);
for(var i of list){ for(var i of list){
@ -11586,8 +11584,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.gain(gains,'gain2'); player.gain(gains,'gain2');
} }
'step 3' 'step 3'
player.addSkill('reqingce'); player.addSkills('reqingce');
game.log(player,'获得了技能','#g【清侧】');
player.loseMaxHp(); player.loseMaxHp();
}, },
}, },
@ -12962,8 +12959,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 1' 'step 1'
if(result.bool){ if(result.bool){
player.line(trigger.source,'fire'); player.line(trigger.source,'fire');
trigger.source.addSkillLog('new_rewusheng'); trigger.source.addSkills(['new_rewusheng','redangxian']);
trigger.source.addSkillLog('redangxian');
} }
}, },
}, },
@ -13112,8 +13108,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
animationColor:'thunder', animationColor:'thunder',
content:function(){ content:function(){
player.awakenSkill('remoucheng'); player.awakenSkill('remoucheng');
player.removeSkill('relianji'); player.changeSkills(['jingong','relianji']);
player.addSkill('jingong');
player.gainMaxHp(); player.gainMaxHp();
player.recover(); player.recover();
}, },

View File

@ -1075,7 +1075,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.awakenSkill('pksanchen'); player.awakenSkill('pksanchen');
player.gainMaxHp(); player.gainMaxHp();
player.recover(); player.recover();
player.addSkillLog('pkmiewu'); player.addSkills('pkmiewu');
}, },
ai:{ ai:{
combo:'wuku', combo:'wuku',
@ -5324,7 +5324,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.storage.suiren=true; player.storage.suiren=true;
player.awakenSkill('suiren'); player.awakenSkill('suiren');
player.logSkill('suiren',result.targets); player.logSkill('suiren',result.targets);
player.removeSkill('reyicong'); player.removeSkills('reyicong');
player.gainMaxHp(); player.gainMaxHp();
player.recover(); player.recover();
result.targets[0].draw(3); result.targets[0].draw(3);

View File

@ -200,7 +200,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 1' 'step 1'
if(result.bool){ if(result.bool){
player.logSkill('junkguixin'); player.logSkill('junkguixin');
player.addSkillLog(result.links[0]); player.addSkills(result.links[0]);
} }
}, },
content_修改势力:function(){ content_修改势力:function(){

View File

@ -519,11 +519,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var trigger=map.trigger; var trigger=map.trigger;
player.awakenSkill('olsbranji'); player.awakenSkill('olsbranji');
var num=lib.skill.olsbranji.getNum(trigger,player); var num=lib.skill.olsbranji.getNum(trigger,player);
const skills = [];
if(num>=player.getHp()){ if(num>=player.getHp()){
player.addSkillLog('kunfen'); skills.push('kunfen');
player.storage.kunfen=true; player.storage.kunfen=true;
} }
if(num<=player.getHp()) player.addSkillLog('zhaxiang'); if(num<=player.getHp()) skills.push('zhaxiang');
player.addSkills(skills);
if(player.countCards('h')!=player.getHandcardLimit()||player.isDamaged()){ if(player.countCards('h')!=player.getHandcardLimit()||player.isDamaged()){
var result,num1=player.countCards('h')-player.getHandcardLimit(); var result,num1=player.countCards('h')-player.getHandcardLimit();
if(!num1) result={index:1}; if(!num1) result={index:1};

View File

@ -559,8 +559,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 1' 'step 1'
player.drawTo(player.maxHp); player.drawTo(player.maxHp);
'step 2' 'step 2'
player.addSkillLog('benghuai'); player.addSkills(['benghuai','reweizhong']);
player.addSkillLog('reweizhong');
} }
}, },
reweizhong:{ reweizhong:{
@ -3861,7 +3860,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
player.awakenSkill('xsqianxin'); player.awakenSkill('xsqianxin');
player.loseMaxHp(); player.loseMaxHp();
player.addSkill('rejianyan'); player.addSkills('rejianyan');
}, },
derivation:'rejianyan', derivation:'rejianyan',
}, },
@ -5588,7 +5587,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.recover(); player.recover();
player.draw(2); player.draw(2);
player.loseMaxHp(); player.loseMaxHp();
player.addSkill('xinpaiyi'); player.addSkills('xinpaiyi');
}, },
}, },
xinpaiyi:{ xinpaiyi:{
@ -6102,8 +6101,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.chooseDrawRecover(2,true); player.chooseDrawRecover(2,true);
"step 1" "step 1"
player.loseMaxHp(); player.loseMaxHp();
player.storage.olzhiji=true; player.addSkills('reguanxing');
player.addSkill('reguanxing');
} }
}, },
//界郭图张嶷 //界郭图张嶷
@ -7733,7 +7731,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
player.awakenSkill('olzaoxian'); player.awakenSkill('olzaoxian');
player.loseMaxHp(); player.loseMaxHp();
player.addSkill('jixi'); player.addSkills('jixi');
player.insertPhase(); player.insertPhase();
} }
}, },
@ -9603,7 +9601,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return ['olhuoji','bazhen'].randomGet(); return ['olhuoji','bazhen'].randomGet();
}; };
'step 6' 'step 6'
player.addSkillLog(result.control); player.addSkills(result.control);
}, },
derivation:['bazhen','olhuoji','olkanpo'], derivation:['bazhen','olhuoji','olkanpo'],
ai:{ ai:{
@ -10115,10 +10113,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.gainMaxHp(); player.gainMaxHp();
'step 1' 'step 1'
if(player.hp<3) player.recover(3-player.hp); if(player.hp<3) player.recover(3-player.hp);
player.addSkillLog('sishu'); player.addSkills(['sishu', 'rejijiang']);
player.addSkillLog('rejijiang');
'step 2'
if(player.isZhu2()) event.trigger('zhuUpdate');
} }
}, },
olfangquan:{ olfangquan:{
@ -10276,14 +10271,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audioname:['re_sunyi'], audioname:['re_sunyi'],
inherit:'hunzi', inherit:'hunzi',
content:function(){ content:function(){
player.awakenSkill(event.name);
player.loseMaxHp(); player.loseMaxHp();
//player.recover(); //player.recover();
player.addSkill('reyingzi'); player.addSkills(['reyingzi','gzyinghun']);
player.addSkill('gzyinghun');
player.addTempSkill('olhunzi_effect'); player.addTempSkill('olhunzi_effect');
game.log(player,'获得了技能','#g【英姿】','和','#g【英魂】');
player.awakenSkill(event.name);
player.storage[event.name]=true;
}, },
subSkill:{ subSkill:{
effect:{ effect:{
@ -11038,7 +11030,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 1' 'step 1'
if(!result.bool) target.loseHp(); if(!result.bool) target.loseHp();
'step 2' 'step 2'
target.addSkillLog('rechanyuan'); target.addSkills('rechanyuan');
if(targets.length) event.goto(0); if(targets.length) event.goto(0);
}, },
}, },
@ -13158,7 +13150,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.awakenSkill('qinxue'); player.awakenSkill('qinxue');
player.loseMaxHp(); player.loseMaxHp();
player.chooseDrawRecover(2,true); player.chooseDrawRecover(2,true);
player.addSkill('gongxin'); player.addSkills('gongxin');
} }
}, },
qingjian:{ qingjian:{
@ -14028,7 +14020,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
content:function(){ content:function(){
player.awakenSkill('qianxin'); player.awakenSkill('qianxin');
player.addSkill('jianyan'); player.addSkills('jianyan');
player.loseMaxHp(); player.loseMaxHp();
} }
}, },

View File

@ -552,8 +552,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.log(player,'选择了',target2); game.log(player,'选择了',target2);
const skills=target2.getStockSkills(true,true); const skills=target2.getStockSkills(true,true);
const skills2=player.getStockSkills(true,true); const skills2=player.getStockSkills(true,true);
player.addSkillLog(skills); player.changeSkills(skills,skills2);
player.removeSkillLog(skills2);
} }
} }
}, },
@ -782,7 +781,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
animationColor:'thunder', animationColor:'thunder',
async content(event,trigger,player){ async content(event,trigger,player){
player.awakenSkill('sbsongwei_delete'); player.awakenSkill('sbsongwei_delete');
event.target.removeSkillLog(event.target.getStockSkills(false,true)); event.target.removeSkills(event.target.getStockSkills(false,true));
}, },
ai:{ ai:{
order:13, order:13,
@ -1245,17 +1244,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
locked:false, locked:false,
skillAnimation:true, skillAnimation:true,
animationColor:'fire', animationColor:'fire',
content:function(){ async content(event,trigger,player){
player.awakenSkill('sbhuoji'); player.awakenSkill('sbhuoji');
game.log(player,'成功完成使命'); game.log(player,'成功完成使命');
var list=[]; if (get.character(player.name1)[3].includes('sbhuoji')) {
if(player.name&&get.character(player.name)[3].includes('sbhuoji')) list.add(player.name); player.reinitCharacter(player.name1, 'sb_zhugeliang', false);
if(player.name1&&get.character(player.name1)[3].includes('sbhuoji')) list.add(player.name1); }
if(player.name2&&get.character(player.name2)[3].includes('sbhuoji')) list.add(player.name2); else if (player.name2&&get.character(player.name2)[3].includes('sbhuoji')) {
if(list.length) list.forEach(name=>player.reinit(name,'sb_zhugeliang')); player.reinitCharacter(player.name2, 'sb_zhugeliang', false);
}
else{ else{
player.removeSkill(['sbhuoji','sbkanpo']); player.changeSKills(['sbguanxing','sbkongcheng'],['sbhuoji','sbkanpo']);
player.addSkill(['sbguanxing','sbkongcheng']);
} }
}, },
}, },
@ -2302,8 +2301,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 2' 'step 2'
player.draw(3); player.draw(3);
'step 3' 'step 3'
player.addSkillLog('sbyingzi'); player.addSkills(['sbyingzi','gzyinghun']);
player.addSkillLog('gzyinghun');
}, },
ai:{ ai:{
threaten:function(player,target){ threaten:function(player,target){
@ -3655,8 +3653,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 0' 'step 0'
player.recover(3); player.recover(3);
'step 1' 'step 1'
player.removeSkill('sbrende'); player.removeSkills('sbrende');
game.log(player,'失去了技能','#g【'+get.translation('sbrende')+'】');
game.delayx(); game.delayx();
}, },
ai:{ ai:{
@ -5914,7 +5911,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
content:function(){ content:function(){
player.awakenSkill('sbdujiang'); player.awakenSkill('sbdujiang');
player.addSkillLog('sbduojing'); player.addSkills('sbduojing');
player.storage.sbkeji=true; player.storage.sbkeji=true;
} }
}, },

View File

@ -667,7 +667,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.gain(gains,'gain2','log'); player.gain(gains,'gain2','log');
} }
'step 2' 'step 2'
player.addSkill('qingce'); player.addSkills('qingce');
game.log(player,'获得了技能','#g【清侧】'); game.log(player,'获得了技能','#g【清侧】');
player.loseMaxHp(); player.loseMaxHp();
}, },
@ -808,7 +808,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.gain(gains,'gain2','log'); player.gain(gains,'gain2','log');
} }
'step 2' 'step 2'
player.addSkillLog('drlt_qingce'); player.addSkills('drlt_qingce');
player.loseMaxHp(); player.loseMaxHp();
}, },
}, },
@ -1209,8 +1209,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
"step 1" "step 1"
var num=player.maxHp-player.countCards('h'); var num=player.maxHp-player.countCards('h');
if(num>0) player.draw(num); if(num>0) player.draw(num);
player.removeSkill('drlt_jueyan'); player.changeSkills(['drlt_huairou'],['drlt_jueyan']);
player.addSkill('drlt_huairou');
}, },
}, },
"drlt_huairou":{ "drlt_huairou":{
@ -2648,13 +2647,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
}, },
}, },
"nzry_shenshi1":{ nzry_shenshi1:{
audio:2, audio:2,
trigger:{ trigger:{
global:'phaseJieshuBegin', global:'phaseJieshuBegin',
}, },
forced:true, forced:true,
popup:false, popup:false,
charlotte:true,
filter:function(event,player){ filter:function(event,player){
return player.storage.nzry_shenshi1!=undefined&&player.storage.nzry_shenshi2!=undefined; return player.storage.nzry_shenshi1!=undefined&&player.storage.nzry_shenshi2!=undefined;
}, },
@ -3345,10 +3345,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.chooseDrawRecover(2,true); player.chooseDrawRecover(2,true);
"step 1" "step 1"
player.loseMaxHp(); player.loseMaxHp();
player.storage.zhiji=true; player.addSkills('reguanxing');
if(player.hp>player.maxHp) player.hp=player.maxHp;
player.update();
player.addSkill('reguanxing');
} }
}, },
xiangle:{ xiangle:{
@ -3498,9 +3495,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.gainMaxHp(); player.gainMaxHp();
player.recover(); player.recover();
'step 1' 'step 1'
player.addSkillLog('rejijiang'); player.addSkills('rejijiang');
'step 2'
if(player.isZhu2()) event.trigger('zhuUpdate');
} }
}, },
qiaobian:{ qiaobian:{
@ -3726,7 +3721,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
player.awakenSkill('zaoxian'); player.awakenSkill('zaoxian');
player.loseMaxHp(); player.loseMaxHp();
player.addSkill('jixi'); player.addSkills('jixi');
} }
}, },
jixi:{ jixi:{
@ -3820,12 +3815,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true, forced:true,
//priority:3, //priority:3,
content:function(){ content:function(){
player.loseMaxHp();
player.addSkill('reyingzi');
player.addSkill('gzyinghun');
game.log(player,'获得了技能','#g【英姿】和【英魂】')
player.awakenSkill(event.name); player.awakenSkill(event.name);
player.storage[event.name]=true; player.loseMaxHp();
player.addSkills(['reyingzi','gzyinghun']);
}, },
ai:{ ai:{
threaten:function(player,target){ threaten:function(player,target){
@ -7652,7 +7644,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
else{ else{
event.betrayer.popup('质疑错误','fire'); event.betrayer.popup('质疑错误','fire');
event.betrayer.addSkillLog('chanyuan'); event.betrayer.addSkills('chanyuan');
} }
'step 7' 'step 7'
game.delay(2); game.delay(2);

View File

@ -2168,8 +2168,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.awakenSkill('rechuhai'); player.awakenSkill('rechuhai');
game.log(player,'成功完成使命'); game.log(player,'成功完成使命');
if(player.isDamaged()) player.recover(player.maxHp-player.hp); if(player.isDamaged()) player.recover(player.maxHp-player.hp);
player.removeSkill('xianghai'); player.changeSkills(['zhangming'],['xianghai']);
player.addSkill('zhangming');
}, },
}, },
fail:{ fail:{
@ -2741,7 +2740,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
if(cards.length) player.gain(cards,'gain2'); if(cards.length) player.gain(cards,'gain2');
'step 1' 'step 1'
player.addSkill('xinmouli'); player.addSkills('xinmouli');
}, },
group:['mibei_fail','mibei_silent'], group:['mibei_fail','mibei_silent'],
derivation:'xinmouli', derivation:'xinmouli',
@ -3179,7 +3178,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
game.log(player,'成功完成使命'); game.log(player,'成功完成使命');
player.awakenSkill('qingyu'); player.awakenSkill('qingyu');
player.addSkillLog('xuancun'); player.addSkills('xuancun');
}, },
}, },
fail:{ fail:{
@ -5767,7 +5766,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.awakenSkill('spsanchen'); player.awakenSkill('spsanchen');
player.gainMaxHp(); player.gainMaxHp();
player.recover(); player.recover();
player.addSkillLog('spmiewu'); player.addSkills('spmiewu');
}, },
ai:{ ai:{
combo:'wuku', combo:'wuku',

View File

@ -1852,8 +1852,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(result.bool){ if(result.bool){
var target=result.targets[0]; var target=result.targets[0];
event.target=target; event.target=target;
var num=target.maxHp;
event.num=num;
player.logSkill('skill_zhangji_B',target); player.logSkill('skill_zhangji_B',target);
var list=[]; var list=[];
for(var i=0;i<_status.characterlist.length;i++){ for(var i=0;i<_status.characterlist.length;i++){
@ -1872,10 +1870,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 2' 'step 2'
if(result.bool){ if(result.bool){
event.character=result.links[0]; event.character=result.links[0];
if(target.name2!=undefined) target.chooseControl(target.name,target.name2).set('prompt','请选择要更换的武将牌').set('ai',function(){ if(target.name2!=undefined) target.chooseControl(target.name1,target.name2).set('prompt','请选择要更换的武将牌').set('ai',function(){
return lib.skill.skill_zhangji_B.getNum(target.name)<lib.skill.skill_zhangji_B.getNum(target.name2)?target.name:target.name2; return lib.skill.skill_zhangji_B.getNum(target.name)<lib.skill.skill_zhangji_B.getNum(target.name2)?target.name:target.name2;
}); });
else result.control=target.name; else result.control=target.name1;
} }
else{ else{
target.chat('拒绝'); target.chat('拒绝');
@ -1883,10 +1881,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.finish(); event.finish();
} }
'step 3' 'step 3'
if(result.control==target.name) target.changeGroup('wei',false); target.reinitCharacter(result.control,event.character);
game.log(target,'将','#g'+get.translation(result.control),'替换为了','#g'+get.translation(event.character));
target.reinit(result.control,event.character,false);
target.maxHp=num;
target.update(); target.update();
}, },
subSkill:{ subSkill:{
@ -3955,7 +3950,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
'step 0' 'step 0'
player.awakenSkill('olhuiqi'); player.awakenSkill('olhuiqi');
player.addSkillLog('olxieju'); player.addSkills('olxieju');
player.insertPhase(); player.insertPhase();
} }
}, },
@ -5854,9 +5849,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}); });
} }
'step 1' 'step 1'
player.removeSkill(result.control); player.removeSkills(result.control);
player.popup(result.control);
game.log(player,'失去了技能','#g【'+get.translation(result.control)+'】');
} }
} }
}, },
@ -7118,9 +7111,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.log(player,'删除了','#g【笔心】','描述的前五个字符'); game.log(player,'删除了','#g【笔心】','描述的前五个字符');
if(player.countMark('olbixin')==3){ if(player.countMark('olbixin')==3){
game.log(player,'交换了','#g【笔心】','方括号中的两个数字'); game.log(player,'交换了','#g【笔心】','方括号中的两个数字');
player.removeSkill('olximo'); //player.removeSkill('olximo');
game.log(player,'失去了技能','#g【洗墨】'); //game.log(player,'失去了技能','#g【洗墨】');
player.addSkillLog('olfeibai'); player.changeSkills(['olfeibai'],['olximo']);
} }
}, },
ai:{ ai:{
@ -8461,7 +8454,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
else event.finish(); else event.finish();
'step 2' 'step 2'
target.addSkill(result.control); target.addSkills(result.control);
'step 3' 'step 3'
var num=player.countCards('h'); var num=player.countCards('h');
if(num>0) player.chooseToDiscard('h',num,true); if(num>0) player.chooseToDiscard('h',num,true);
@ -10293,12 +10286,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
content:function(){ content:function(){
var num=Math.min(cards.length,4-player.countMark('spmanwang')); var num=Math.min(cards.length,4-player.countMark('spmanwang'));
if(num>=1) player.addSkill('sppanqin'); if(num>=1) player.addSkills('sppanqin');
if(num>=2) player.draw(); if(num>=2) player.draw();
if(num>=3) player.recover(); if(num>=3) player.recover();
if(num>=4){ if(num>=4){
player.draw(2); player.draw(2);
player.removeSkill('sppanqin'); player.removeSkills('sppanqin');
} }
}, },
intro:{content:'已经移去过#个选项'}, intro:{content:'已经移去过#个选项'},
@ -10385,7 +10378,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
switch(player.countMark('spmanwang')){ switch(player.countMark('spmanwang')){
case 1: case 1:
player.draw(2); player.draw(2);
player.removeSkill('sppanqin'); player.removeSkills('sppanqin');
break; break;
case 2: case 2:
player.recover(); player.recover();
@ -10394,7 +10387,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.draw(); player.draw();
break; break;
case 4: case 4:
player.addSkill('sppanqin'); player.addSkills('sppanqin');
break; break;
} }
}, },
@ -10482,7 +10475,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
for(var i of lib.skill.rebaobian.derivation){ for(var i of lib.skill.rebaobian.derivation){
if(!player.hasSkill(i,null,null,false)){ if(!player.hasSkill(i,null,null,false)){
player.addSkillLog(i); player.addSkills(i);
break; break;
} }
} }
@ -11220,7 +11213,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
target.gainMaxHp(); target.gainMaxHp();
target.recover(); target.recover();
target.draw(3); target.draw(3);
target.addSkill('olzaowang2'); target.addSkills('olzaowang2');
}, },
ai:{ ai:{
order:2, order:2,
@ -11950,7 +11943,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
else event.finish(); else event.finish();
'step 2' 'step 2'
target.addSkillLog(result.control); target.addSkills(result.control);
}, },
}, },
//邓芝 //邓芝
@ -12582,7 +12575,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
'step 0' 'step 0'
player.awakenSkill('olxushen'); player.awakenSkill('olxushen');
player.addSkill('olzhennan'); player.addSkills('olzhennan');
player.recover(1-player.hp); player.recover(1-player.hp);
'step 1' 'step 1'
if(!player.isDying()&&!game.hasPlayer(function(current){ if(!player.isDying()&&!game.hasPlayer(function(current){
@ -12613,12 +12606,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
else event.finish(); else event.finish();
'step 4' 'step 4'
target.reinit(result.control,'guansuo'); target.reinitCharacter(result.control,'guansuo');
if(target.name=='guansuo'&&target.group!='shu') target.changeGroup('shu');
if(_status.characterlist){
_status.characterlist.add(result.control);
_status.characterlist.remove('guansuo');
}
}, },
}, },
olzhennan:{ olzhennan:{
@ -13677,7 +13665,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return list.randomGet(); return list.randomGet();
}); });
'step 1' 'step 1'
player.addSkillLog(result.control); player.addSkills(result.control);
game.broadcastAll(function(skill){ game.broadcastAll(function(skill){
var list=[skill];game.expandSkills(list); var list=[skill];game.expandSkills(list);
for(var i of list){ for(var i of list){
@ -13740,7 +13728,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(player.storage.retuogu) player.removeSkill(player.storage.retuogu); if(player.storage.retuogu) player.removeSkill(player.storage.retuogu);
player.storage.retuogu=result.control; player.storage.retuogu=result.control;
player.markSkill('retuogu'); player.markSkill('retuogu');
player.addSkillLog(result.control); player.addSkills(result.control);
game.broadcastAll(function(skill){ game.broadcastAll(function(skill){
var list=[skill]; var list=[skill];
game.expandSkills(list); game.expandSkills(list);
@ -14074,8 +14062,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
content:function(){ content:function(){
player.awakenSkill('xinmoucheng'); player.awakenSkill('xinmoucheng');
player.addSkill('xinjingong'); player.changeSkills(['xinjingong'],['xinlianji']);
player.removeSkill('xinlianji');
}, },
}, },
xinjingong:{ xinjingong:{
@ -16276,9 +16263,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
animationColor:'gray', animationColor:'gray',
content:function(){ content:function(){
player.awakenSkill('moucheng'); player.awakenSkill('moucheng');
player.removeSkill('wylianji');
game.log(player,'失去了技能','#g【连计】'); game.log(player,'失去了技能','#g【连计】');
player.addSkillLog('jingong'); player.changeSkills(['jingong'],['wylianji']);
} }
} }
} }
@ -17532,11 +17518,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.awakenSkill('fuhan'); player.awakenSkill('fuhan');
'step 1' 'step 1'
event.num=Math.min(event.num,8); event.num=Math.min(event.num,8);
player.reinit('zhaoxiang',result.links[0],false); player.reinitCharacter('zhaoxiang',result.links[0]);
if(_status.characterlist){
_status.characterlist.add('zhaoxiang');
_status.characterlist.remove(result.links[0]);
}
'step 2' 'step 2'
var num=event.num-player.maxHp; var num=event.num-player.maxHp;
if(num>0) player.gainMaxHp(num); if(num>0) player.gainMaxHp(num);
@ -17681,7 +17663,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 2' 'step 2'
var map=event.result||result; var map=event.result||result;
if(map&&map.skills&&map.skills.length){ if(map&&map.skills&&map.skills.length){
for(var i of map.skills) player.addSkillLog(i); player.addSkils(map.skills);
} }
game.broadcastAll(function(list){ game.broadcastAll(function(list){
game.expandSkills(list); game.expandSkills(list);
@ -17689,7 +17671,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var info=lib.skill[i]; var info=lib.skill[i];
if(!info) continue; if(!info) continue;
if(!info.audioname2) info.audioname2={}; if(!info.audioname2) info.audioname2={};
info.audioname2.old_yuanshu='weidi'; info.audioname2.zhaoxiang='fuhan';
} }
},map.skills); },map.skills);
'step 3' 'step 3'
@ -17906,12 +17888,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}).set('choiceList',['获得技能〖妄尊〗',str]).set('choice',choice); }).set('choiceList',['获得技能〖妄尊〗',str]).set('choice',choice);
'step 2' 'step 2'
if(result.control=='选项一'){ if(result.control=='选项一'){
player.addSkillLog('rewangzun'); player.addSkills('rewangzun');
} }
else{ else{
player.draw(2); player.draw(2);
if(event.list){ if(event.list){
for(var i of event.list) player.addSkillLog(event.list); player.addSkills(event.list);
game.broadcastAll(function(list){ game.broadcastAll(function(list){
game.expandSkills(list); game.expandSkills(list);
for(var i of list){ for(var i of list){
@ -18535,16 +18517,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
charlotte:true, charlotte:true,
}, },
weidi:{ weidi:{
trigger:{global:['gameStart','zhuUpdate']}, init(player){
forced:true, const list=[];
audio:2, const zhu=get.zhu(player);
filter:function(event,player){
var mode=get.mode();
return (mode=='identity'||(mode=='versus'&&_status.mode=='four'));
},
content:function(){
var list=[];
var zhu=get.zhu(player);
if(zhu&&zhu!=player&&zhu.skills){ if(zhu&&zhu!=player&&zhu.skills){
for(var i=0;i<zhu.skills.length;i++){ for(var i=0;i<zhu.skills.length;i++){
if(lib.skill[zhu.skills[i]]&&lib.skill[zhu.skills[i]].zhuSkill){ if(lib.skill[zhu.skills[i]]&&lib.skill[zhu.skills[i]].zhuSkill){
@ -18562,7 +18537,25 @@ game.import('character',function(lib,game,ui,get,ai,_status){
info.audioname2.yuanshu='weidi'; info.audioname2.yuanshu='weidi';
} }
},list); },list);
} },
trigger:{global:['gameStart','changeSkillsAfter']},
forced:true,
audio:2,
filter:function(event,player){
const mode = get.mode();
if (mode != 'identity' && (mode != 'versus' || _status.mode != 'four')) return false;
const zhu = get.zhu(player);
if (!zhu || zhu == player) return false;
if(event.name == 'gameStart') return true;
return event.player == zhu && (event.addSkill.some(skill => {
return lib.skill[skill] && lib.skill[skill].zhuSkill;
}) || event.addSkill.some(skill => {
return lib.skill[skill] && lib.skill[skill].zhuSkill;
}));
},
async content (event, trigger, player) {
lib.skill.weidi.init(player);
},
}, },
zhenlue:{ zhenlue:{
audio:2, audio:2,
@ -18694,9 +18687,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return info&&info.zhuSkill; return info&&info.zhuSkill;
}); });
if(skills.length){ if(skills.length){
for(var i of skills) target.addSkillLog(i); target.addSkills(skills);
} }
if(target.isZhu2()) event.trigger('zhuUpdate');
} }
}, },
ai:{expose:0.2}, ai:{expose:0.2},
@ -19409,9 +19401,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}); });
'step 2' 'step 2'
if(result.control=='xindangxian') player.storage.xinfuli=true; if(result.control=='xindangxian') player.storage.xinfuli=true;
player.addSkill(result.control); player.addSkills(result.control);
player.popup(result.control);
game.log(player,'获得了技能','#g【'+get.translation(result.control)+'】');
}, },
ai:{threaten:2.5}, ai:{threaten:2.5},
intro:{ intro:{
@ -19439,8 +19429,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
else event.finish(); else event.finish();
'step 2' 'step 2'
if(result.control){ if(result.control){
player.addSkillLog(result.control); player.addSkills(result.control);
player.popup(result.control);
} }
}, },
ai:{threaten:2}, ai:{threaten:2},
@ -20277,10 +20266,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return player.getExpansions('fentian').length>=3; return player.getExpansions('fentian').length>=3;
}, },
content:function(){ content:function(){
player.loseMaxHp();
player.addSkill('xintan');
player.storage.zhiri=true;
player.awakenSkill('zhiri'); player.awakenSkill('zhiri');
player.loseMaxHp();
player.storage.zhiri=true;
} }
}, },
xintan:{ xintan:{
@ -20329,11 +20317,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return !player.storage.danji&&player.countCards('h')>player.hp; return !player.storage.danji&&player.countCards('h')>player.hp;
}, },
content:function(){ content:function(){
player.storage.danji=true;
player.loseMaxHp();
player.addSkill('mashu');
player.addSkill('nuzhan');
player.awakenSkill('danji'); player.awakenSkill('danji');
player.loseMaxHp();
player.addSkills(['mashu','nuzhan']);
}, },
ai:{ ai:{
maixie:true, maixie:true,
@ -21717,15 +21703,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
content:function(){ content:function(){
"step 0" "step 0"
player.awakenSkill('fengliang');
player.loseMaxHp(); player.loseMaxHp();
"step 1" "step 1"
if(player.hp<2){ if(player.hp<2){
player.recover(2-player.hp); player.recover(2-player.hp);
} }
"step 2" "step 2"
player.addSkill('oltiaoxin'); player.addSkills('oltiaoxin');
player.storage.kunfen=true;
player.awakenSkill('fengliang');
}, },
}, },
zhuiji:{ zhuiji:{
@ -22482,12 +22467,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
forced:true, forced:true,
content:function(){ content:function(){
player.storage.fanxiang=true; player.awakenSkill('fanxiang');
player.gainMaxHp(); player.gainMaxHp();
player.recover(); player.recover();
player.removeSkill('liangzhu'); player.changeSkills(['xiaoji'],['liangzhu']);
player.addSkill('xiaoji');
player.awakenSkill('fanxiang');
}, },
}, },
mingshi:{ mingshi:{
@ -23062,11 +23045,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.awakenSkill('cunsi'); player.awakenSkill('cunsi');
var cards=player.getCards('h'); var cards=player.getCards('h');
player.give(cards,target); player.give(cards,target);
player.storage.cunsi=true;
game.delay();
target.addSkill('yongjue');
target.markSkillCharacter('yongjue',player,'存嗣','<div class="skill">【勇决】</div><div>每当其他角色于回合内使用一张杀,若目标不是你,你可以获得之,每回合限一次</div>');
"step 1" "step 1"
target.addSkills('yongjue');
"step 2"
target.markSkillCharacter('yongjue',player,'存嗣','<div class="skill">【勇决】</div><div>每当其他角色于回合内使用一张杀,若目标不是你,你可以获得之,每回合限一次</div>');
player.turnOver(); player.turnOver();
}, },
intro:{ intro:{
@ -23559,7 +23541,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
content:function(){ content:function(){
"step 0" "step 0"
player.removeSkill('huxiao'); player.removeSkills('huxiao');
player.gainMaxHp(); player.gainMaxHp();
"step 1" "step 1"
player.recover(); player.recover();
@ -23646,7 +23628,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
animationColor:'orange', animationColor:'orange',
content:function(){ content:function(){
'step 0' 'step 0'
player.removeSkill('oldhuxiao'); player.removeSkills('oldhuxiao');
player.gainMaxHp(); player.gainMaxHp();
'step 1' 'step 1'
player.recover(); player.recover();
@ -24679,11 +24661,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
unique:true, unique:true,
juexingji:true, juexingji:true,
content:function(){ content:function(){
player.draw(player.maxHp);
player.addSkill('benghuai');
player.addSkill('weizhong');
player.storage.juyi=true;
player.awakenSkill('juyi'); player.awakenSkill('juyi');
player.draw(player.maxHp);
player.addSkills(['benghuai','weizhong']);
} }
}, },
weizhong:{ weizhong:{
@ -25526,18 +25506,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.awakenSkill('xinfu_xushen'); player.awakenSkill('xinfu_xushen');
player.logSkill('xinfu_xushen',trigger.source); player.logSkill('xinfu_xushen',trigger.source);
if(trigger.source.name2!=undefined){ if(trigger.source.name2!=undefined){
trigger.source.chooseControl(trigger.source.name,trigger.source.name2).set('prompt','请选择要更换的武将牌'); trigger.source.chooseControl(trigger.source.name1,trigger.source.name2).set('prompt','请选择要更换的武将牌');
}else event._result={control:trigger.source.name}; }else event._result={control:trigger.source.name1};
} }
else event.finish(); else event.finish();
"step 2" "step 2"
trigger.source.reinit(result.control,'guansuo'); trigger.source.reinitCharacter(result.control,'guansuo');
if(_status.characterlist){
_status.characterlist.add(result.control);
_status.characterlist.remove('guansuo');
}
player.recover(); player.recover();
player.addSkill('xinfu_zhennan'); player.addSkills('xinfu_zhennan');
}, },
mark:true, mark:true,
intro:{ intro:{

View File

@ -921,7 +921,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if (result.bool) { if (result.bool) {
var target = result.targets[0]; var target = result.targets[0];
player.line(target, 'thunder'); player.line(target, 'thunder');
target.addSkillLog('dccanyun'); target.addSkills('dccanyun');
} }
}, },
}, },
@ -1174,14 +1174,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player){ filter:function(event,player){
return player.countCards('h')>player.hp; return player.countCards('h')>player.hp;
}, },
content:function(){ async content(event, trigger, player){
'step 0'
player.loseMaxHp();
'step 1'
player.recover(player.maxHp-player.hp);
player.addSkill('mashu');
player.addSkill('dcnuchen');
player.awakenSkill('dcdanji'); player.awakenSkill('dcdanji');
await player.loseMaxHp();
await player.recover(player.maxHp-player.hp);
await player.addSkills(['mashu','dcnuchen']);
}, },
ai:{ ai:{
maixie:true, maixie:true,
@ -1877,9 +1874,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.num2=target.countCards('e'); event.num2=target.countCards('e');
if(event.num2==4&&num!=4){ if(event.num2==4&&num!=4){
player.trySkillAnimate('dccuichuan_animate','dccuichuan_animate',player.checkShow('dccuichuan')); player.trySkillAnimate('dccuichuan_animate','dccuichuan_animate',player.checkShow('dccuichuan'));
player.removeSkill('dccuichuan'); //player.removeSkill('dccuichuan');
game.log(player,'失去了技能','#g【榱椽】'); //game.log(player,'失去了技能','#g【榱椽】');
player.addSkillLog('dczuojian'); player.changeSkills(['dczuojian'],['dccuichuan']);
target.insertPhase(); target.insertPhase();
game.delayx(); game.delayx();
} }
@ -4164,12 +4161,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var target=result.targets[0]; var target=result.targets[0];
player.awakenSkill('chuanshu'); player.awakenSkill('chuanshu');
player.logSkill('chuanshu',target); player.logSkill('chuanshu',target);
target.addSkillLog('chaofeng'); target.addSkills('chaofeng');
if(player.isDead()) event.finish(); if(player.isDead()) event.finish();
} }
else event.finish(); else event.finish();
'step 2' 'step 2'
for(var i of lib.skill.chuanshu.derivation) player.addSkillLog(i); player.addSkills(lib.skill.chuanshu.derivation);
}, },
derivation:['ollongdan','drlt_congjian','chuanyun'], derivation:['ollongdan','drlt_congjian','chuanyun'],
}, },
@ -5661,8 +5658,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.recover(num); player.recover(num);
} }
'step 2' 'step 2'
player.removeSkill('mouni'); //player.removeSkill('mouni');
player.addSkill('zhangu'); player.changeSkills(['zhangu'],['mouni']);
}, },
}, },
zhangu:{ zhangu:{
@ -6443,7 +6440,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(result.bool){ if(result.bool){
var target=result.targets[0]; var target=result.targets[0];
player.logSkill('cixiao',target); player.logSkill('cixiao',target);
target.addSkill('panshi'); target.addSkills('panshi');
} }
event.finish(); event.finish();
'step 2' 'step 2'
@ -6479,11 +6476,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.discard(result.cards).delay=false; player.discard(result.cards).delay=false;
player.line2(game.filterPlayer(function(current){ player.line2(game.filterPlayer(function(current){
if(current.hasSkill('panshi')){ if(current.hasSkill('panshi')){
current.removeSkill('panshi'); current.removeSkills('panshi');
return true; return true;
} }
}).concat(result.targets),'green'); }).concat(result.targets),'green');
target.addSkill('panshi'); target.addSkills('panshi');
} }
else event.finish(); else event.finish();
'step 4' 'step 4'
@ -6573,7 +6570,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
content:function(){ content:function(){
player.awakenSkill('decadexushen'); player.awakenSkill('decadexushen');
player.addSkill('decadezhennan'); player.addSkills('decadezhennan');
player.addTempSkill('decadexushen2'); player.addTempSkill('decadexushen2');
trigger.decadexushen=true; trigger.decadexushen=true;
player.recover(); player.recover();
@ -6608,16 +6605,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(target.name2!=undefined){ if(target.name2!=undefined){
target.chooseControl(target.name1,target.name2).set('prompt','请选择要更换的武将牌'); target.chooseControl(target.name1,target.name2).set('prompt','请选择要更换的武将牌');
} }
else event._result={control:target.name}; else event._result={control:target.name1};
} }
else event.goto(4); else event.goto(4);
'step 3' 'step 3'
target.reinit(result.control,'dc_guansuo'); target.reinitCharacter(result.control,'dc_guansuo');
if(target.name=='dc_guansuo'&&target.group!='shu') target.changeGroup('shu');
if(_status.characterlist){
_status.characterlist.add(result.control);
_status.characterlist.remove('dc_guansuo');
}
'step 4' 'step 4'
target.draw(3); target.draw(3);
}, },
@ -6697,35 +6689,29 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
yujuex:{ yujuex:{
audio:'yujue', audio:'yujue',
content:function(){ async content(event,trigger,player){
'step 0' await player.disableEquip(lib.skill.yujue_backup.position);
player.disableEquip(lib.skill.yujue_backup.position);
'step 1'
if(player.isIn()&&game.hasPlayer(function(current){ if(player.isIn()&&game.hasPlayer(function(current){
return current!=player&&current.countCards('h'); return current!=player&&current.countCards('h');
})){ })){
player.chooseTarget(true,'选择一名角色交给你一张牌并获得技能〖执笏〗',function(card,player,target){ const result = await player.chooseTarget(true,'选择一名角色交给你一张牌并获得技能〖执笏〗',function(card,player,target){
if(player==target) return false; if(player==target) return false;
return target.countCards('h')>0; return target.countCards('h')>0;
}).set('ai',function(target){ }).set('ai',function(target){
return get.attitude(_status.event.player,target)*target.countCards('h'); return get.attitude(_status.event.player,target)*target.countCards('h');
}); }).forResult();
} if(result.bool){
else event.finish(); var target=result.targets[0];
'step 2' event.target=target;
if(result.bool){ player.line(target);
var target=result.targets[0]; const result2 = await target.chooseCard('h',true,'交给'+get.translation(player)+'一张手牌').forResult();
event.target=target; if(result2.bool&&result2.cards&&result2.cards.length){
player.line(target); await target.give(result2.cards,player);
target.chooseCard('h',true,'交给'+get.translation(player)+'一张手牌'); target.storage.zhihu_mark=player;
} await target.addSkills('zhihu');
else event.finish(); target.addSkill('zhihu_mark');
'step 3' }
if(result.bool&&result.cards&&result.cards.length){ }
target.give(result.cards,player);
target.storage.zhihu_mark=player;
target.addSkill('zhihu');
target.addSkill('zhihu_mark');
} }
}, },
}, },
@ -6747,7 +6733,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
onremove:function(player){ onremove:function(player){
delete player.storage.zhihu_mark; delete player.storage.zhihu_mark;
player.removeSkill('zhihu'); player.removeSkills('zhihu');
}, },
trigger:{global:'phaseBeginStart'}, trigger:{global:'phaseBeginStart'},
firstDo:true, firstDo:true,
@ -9431,8 +9417,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.line(list[i],'green'); player.line(list[i],'green');
} }
} }
player.removeSkill('guju'); //player.removeSkill('guju');
player.addSkill('bmcanshi'); player.changeSkills(['bmcanshi'],['guju']);
} }
}, },
bmcanshi:{ bmcanshi:{

View File

@ -2103,8 +2103,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
const cards=player.getEquips(1); const cards=player.getEquips(1);
if(cards.length) player.discard(cards); if(cards.length) player.discard(cards);
player.loseMaxHp(); player.loseMaxHp();
player.addSkill('mashu'); player.addSkills(['mashu','shenji']);
player.addSkill('shenji');
}, },
derivation:['mashu','shenji'], derivation:['mashu','shenji'],
}, },

View File

@ -2592,7 +2592,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return info&&!info.hiddenSkill&&!info.zhuSkill&&!info.charlotte; return info&&!info.hiddenSkill&&!info.zhuSkill&&!info.charlotte;
}); });
if(skills.length){ if(skills.length){
for(var i of skills) player.addSkillLog(i); //for(var i of skills) player.addSkillLog(i);
player.addSkills(skills);
player.markAuto('twduoren',skills); player.markAuto('twduoren',skills);
game.broadcastAll(function(list){ game.broadcastAll(function(list){
game.expandSkills(list); game.expandSkills(list);
@ -2616,10 +2617,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true, forced:true,
locked:false, locked:false,
content:function(){ content:function(){
for(var i of player.getStorage('twduoren')){ player.removeSkills(player.getStorage('twduoren'));
player.removeSkill(i);
game.log(player,'失去了技能','#g【'+get.translation(i)+'】');
}
delete player.storage.twduoren; delete player.storage.twduoren;
} }
} }
@ -3258,7 +3256,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(result.bool){ if(result.bool){
var target=result.targets[0]; var target=result.targets[0];
player.logSkill('twjuntun',target); player.logSkill('twjuntun',target);
target.addSkillLog('twxiongjun'); target.addSkills('twxiongjun');
if(target!=player) player.addExpose(0.25); if(target!=player) player.addExpose(0.25);
} }
}, },
@ -4336,7 +4334,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.awakenSkill('twmibei'); player.awakenSkill('twmibei');
player.logSkill('twmibei_achieve'); player.logSkill('twmibei_achieve');
game.log(player,'成功完成使命'); game.log(player,'成功完成使命');
player.addSkillLog('twmouli'); player.addSkils('twmouli');
}, },
intro:{content:'已使用牌名:$'}, intro:{content:'已使用牌名:$'},
subSkill:{ subSkill:{
@ -5347,8 +5345,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
'step 0' 'step 0'
player.awakenSkill('twneirao'); player.awakenSkill('twneirao');
player.removeSkill('twjiekuang'); player.removeSkills('twjiekuang');
game.log(player,'失去了技能','#g【竭匡】');
'step 1' 'step 1'
var num=player.countCards('he'),cards=[]; var num=player.countCards('he'),cards=[];
player.discard(player.getCards('he')); player.discard(player.getCards('he'));
@ -5360,7 +5357,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
if(cards.length) player.gain(cards,'gain2'); if(cards.length) player.gain(cards,'gain2');
'step 2' 'step 2'
player.addSkillLog('twluanlve'); player.addSkills('twluanlve');
}, },
}, },
twluanlve:{ twluanlve:{
@ -6853,12 +6850,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.gain(gains,'gain2'); player.gain(gains,'gain2');
} }
'step 3' 'step 3'
player.addSkillLog('twqingce'); player.addSkills('twqingce');
player.chooseBool('是否减1点体力上限并获得〖扫讨〗').set('ai',()=>_status.event.bool).set('bool',player.isDamaged()&&player.countCards('h')>=3?(Math.random()<0.5?true:false):false); player.chooseBool('是否减1点体力上限并获得〖扫讨〗').set('ai',()=>_status.event.bool).set('bool',player.isDamaged()&&player.countCards('h')>=3?(Math.random()<0.5?true:false):false);
'step 4' 'step 4'
if(result.bool){ if(result.bool){
player.loseMaxHp(); player.loseMaxHp();
player.addSkillLog('twsaotao'); player.addSkills('twsaotao');
game.delayx(); game.delayx();
} }
}, },
@ -8602,12 +8599,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
multiline:true, multiline:true,
content:function(){ content:function(){
'step 0' 'step 0'
game.countPlayer(function(current){ game.filterPlayer().sortBySeat().forEach(function(current){
current.removeSkill('twgonghuan'); current.removeSkills('twgonghuan');
}); });
'step 1' 'step 1'
targets.sortBySeat(); targets.sortBySeat();
for(var i of targets) i.addSkillLog('twgonghuan'); for(var i of targets) i.addSkills('twgonghuan');
}, },
derivation:'twgonghuan', derivation:'twgonghuan',
ai:{ ai:{
@ -11557,10 +11554,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
logTarget:()=>game.filterPlayer().sortBySeat(), logTarget:()=>game.filterPlayer().sortBySeat(),
content:function(){ content:function(){
'step 0' 'step 0'
game.countPlayer(function(current){ game.filterPlayer().sortBySeat().forEach(function(current){
current.addSkill('twfeifu'); current.addSkills('twfeifu');
}); });
game.log(player,'令所有其他角色获得了技能','#g【非服】') //game.log(player,'令所有其他角色获得了技能','#g【非服】')
game.delayx(); game.delayx();
'step 1' 'step 1'
player.chooseTarget('是否减1点体力上限并令一名其他角色获得技能【复纂】',lib.filter.notMe).set('ai',function(target){ player.chooseTarget('是否减1点体力上限并令一名其他角色获得技能【复纂】',lib.filter.notMe).set('ai',function(target){
@ -11574,7 +11571,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.loseMaxHp(); player.loseMaxHp();
var target=result.targets[0]; var target=result.targets[0];
player.line(target,'fire'); player.line(target,'fire');
target.addSkillLog('twfuzuan'); target.addSkills('twfuzuan');
game.delayx(); game.delayx();
} }
}, },
@ -12064,7 +12061,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}).set('choice',skills.sort((a,b)=>(map[b](target,player)||0.5)-(map[a](target,player)||0.5))[0]); }).set('choice',skills.sort((a,b)=>(map[b](target,player)||0.5)-(map[a](target,player)||0.5))[0]);
'step 1' 'step 1'
var skill=result.control; var skill=result.control;
player.addSkillLog(skill); player.addSkills(skill);
event.twbudao_skill=skill; event.twbudao_skill=skill;
player.chooseTarget(lib.filter.notMe,'是否令一名其他角色也获得【'+get.translation(skill)+'】?').set('ai',function(target){ player.chooseTarget(lib.filter.notMe,'是否令一名其他角色也获得【'+get.translation(skill)+'】?').set('ai',function(target){
var player=_status.event.player; var player=_status.event.player;
@ -12076,7 +12073,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var target=result.targets[0]; var target=result.targets[0];
event.target=target; event.target=target;
player.line(target,'green'); player.line(target,'green');
target.addSkillLog(event.twbudao_skill); target.addSkills(event.twbudao_skill);
var cards=target.getCards('he'); var cards=target.getCards('he');
if(!cards.length) event.finish(); if(!cards.length) event.finish();
else if(cards.length==1) event._result={bool:true,cards:cards}; else if(cards.length==1) event._result={bool:true,cards:cards};
@ -12594,9 +12591,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
break; break;
default: default:
player.logSkill('twlingfa'); player.logSkill('twlingfa');
player.removeSkill('twlingfa'); player.addSkills(['twzhian'],['twlingfa']);
game.log(player,'失去了技能','#g【令法】');
player.addSkillLog('twzhian');
break; break;
} }
} }
@ -13099,7 +13094,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var info=get.info(skill); var info=get.info(skill);
return info&&info.zhuSkill; return info&&info.zhuSkill;
}); });
for(var i of skills) target.addSkillLog(i); target.addSkills(skills);
//for(var i of skills) target.addSkillLog(i);
} }
}, },
}, },
@ -13493,7 +13489,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
target.disableJudge(); target.disableJudge();
player.markAuto('twjuezhu_restore',[[target,result.control]]); player.markAuto('twjuezhu_restore',[[target,result.control]]);
player.addSkill('twjuezhu_restore'); player.addSkill('twjuezhu_restore');
target.addSkill('feiying'); target.addSkills('feiying');
}, },
subSkill:{ subSkill:{
restore:{ restore:{
@ -13954,7 +13950,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var name=result.links[0]; var name=result.links[0];
player.flashAvatar('twhuashen',name); player.flashAvatar('twhuashen',name);
game.log(player,'获得了','#y'+get.translation(name),'的所有技能'); game.log(player,'获得了','#y'+get.translation(name),'的所有技能');
player.addSkill(lib.character[name][3]) player.addSkills(lib.character[name][3])
} }
'step 2' 'step 2'
var num=event.num-player.maxHp; var num=event.num-player.maxHp;

View File

@ -3208,9 +3208,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(!_status.characterlist){ if(!_status.characterlist){
lib.skill.pingjian.initList(); lib.skill.pingjian.initList();
} }
_status.characterlist.remove(character); player.reinitCharacter('ganfurenmifuren',character);
_status.characterlist.add('ganfurenmifuren');
player.reinit('ganfurenmifuren',character,false);
'step 2' 'step 2'
player.recover(1-player.hp); player.recover(1-player.hp);
player.addTempSkill('dcxunbie_muteki',{player:'phaseAfter'}); player.addTempSkill('dcxunbie_muteki',{player:'phaseAfter'});
@ -6029,9 +6027,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
content:function(){ content:function(){
player.awakenSkill('dcmoucheng'); player.awakenSkill('dcmoucheng');
player.removeSkill('dclianji'); player.changeSkills(['xinjingong'],['dclianji']);
game.log(player,'失去了技能','#g【连计】');
player.addSkillLog('xinjingong');
}, },
}, },
//周宣 //周宣
@ -6462,8 +6458,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(result.bool){ if(result.bool){
var target=result.targets[0]; var target=result.targets[0];
player.logSkill('dclianzhi_reproach',target); player.logSkill('dclianzhi_reproach',target);
player.addSkillLog('dcshouze'); player.addSkills('dcshouze');
target.addSkillLog('dcshouze'); target.addSkills('dcshouze');
target.addMark('dclingfang',Math.max(1,player.countMark('dclingfang'))); target.addMark('dclingfang',Math.max(1,player.countMark('dclingfang')));
} }
}, },
@ -7494,7 +7490,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
content:function(){ content:function(){
var targets=lib.skill.dcyaoyi.logTarget().sortBySeat(); var targets=lib.skill.dcyaoyi.logTarget().sortBySeat();
for(var target of targets) target.addSkill('dcshoutan'); for(var target of targets) target.addSkills('dcshoutan');
game.delayx(); game.delayx();
}, },
global:'dcyaoyi_blocker', global:'dcyaoyi_blocker',
@ -8122,7 +8118,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.gainMaxHp(); player.gainMaxHp();
player.recover(); player.recover();
'step 1' 'step 1'
player.removeSkill('dcyishu'); player.removeSkills('dcyishu');
'step 2' 'step 2'
var list; var list;
if(_status.characterlist){ if(_status.characterlist){
@ -8247,8 +8243,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 3' 'step 3'
var map=event.result||result; var map=event.result||result;
if(map.skills&&map.skills.length){ if(map.skills&&map.skills.length){
player.removeSkill('dchuishu'); //player.removeSkill('dchuishu');
for(var i of map.skills) player.addSkillLog(i); //for(var i of map.skills) player.addSkillLog(i);
player.changeSkills(map.skills, ['dchuishu']);
player.markAuto('zhuSkill_dcligong',map.skills); player.markAuto('zhuSkill_dcligong',map.skills);
} }
else{ else{
@ -9377,8 +9374,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
targets.sortBySeat(); targets.sortBySeat();
player.logSkill('dcpijing',targets); player.logSkill('dcpijing',targets);
game.countPlayer(function(current){ game.countPlayer(function(current){
if(!targets.includes(current)) current.removeSkill('dczimu'); if(!targets.includes(current)) current.removeSkills('dczimu');
else current.addSkill('dczimu'); else current.addSkills('dczimu');
}); });
game.delayx(); game.delayx();
} }
@ -9408,7 +9405,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
} }
'step 1' 'step 1'
player.removeSkill('dczimu'); player.removeSkills('dczimu');
if(event.delay) game.delayx(); if(event.delay) game.delayx();
}, },
marktext:'牧', marktext:'牧',
@ -9580,9 +9577,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return info&&!info.charlotte; return info&&!info.charlotte;
}); });
if(skills.length){ if(skills.length){
for(var i of skills) player.addSkillLog(i); //for(var i of skills) player.addSkillLog(i);
player.addSkills(skills);
} }
player.removeSkill('xiaowu'); player.removeSkills('xiaowu');
var num=player.countMark('shawu'); var num=player.countMark('shawu');
if(num>0){ if(num>0){
player.removeMark('shawu',num); player.removeMark('shawu',num);
@ -9611,7 +9609,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var target=result.targets[0]; var target=result.targets[0];
player.awakenSkill('huaping'); player.awakenSkill('huaping');
player.logSkill('huaping_give',target); player.logSkill('huaping_give',target);
target.addSkill('shawu'); target.addSkills('shawu');
var num=player.countMark('shawu'); var num=player.countMark('shawu');
if(num>0){ if(num>0){
player.removeMark('shawu',num); player.removeMark('shawu',num);
@ -10426,37 +10424,25 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(player!=event.dying) return false; if(player!=event.dying) return false;
return true; return true;
}, },
content:function(){ async content(event,trigger,player){
'step 0' 'step 0'
player.awakenSkill('syxiongyi'); player.awakenSkill('syxiongyi');
if(!_status.characterlist){ if(!_status.characterlist){
lib.skill.pingjian.initList(); lib.skill.pingjian.initList();
} }
event.hp=1-player.hp;
if(_status.characterlist.includes('xushi')){ if(_status.characterlist.includes('xushi')){
if(player.name1=='re_sunyi'||player.name2=='re_sunyi') event._result={control:'re_sunyi'}; if (player.name2&&get.character(player.name2)[3].includes('syxiongyi')) {
else if(player.name2!=undefined){ await player.reinitCharacter(player.name2, 'xushi');
player.chooseControl(player.name1,player.name2).set('prompt','请选择要更换的武将牌');
} }
else event._result={control:player.name1}; else {
hp+=2; await player.reinitCharacter(player.name1, 'xushi');
_status.characterlist.remove('xushi'); }
_status.characterlist.add('re_sunyi'); if(player.hp<3) await player.recover(3-player.hp);
player.reinit('re_sunyi','xushi',false);
} }
else{ else{
player.addSkillLog('olhunzi'); await player.addSkills('olhunzi');
event.goto(2); if(player.hp<1) await player.recover(1-player.hp);
} }
'step 1'
event.hp+=2;
var name=result.control;
_status.characterlist.remove('xushi');
_status.characterlist.add(name);
player.reinit(name,'xushi',false);
'step 2'
var hp=event.hp;
if(hp>0) player.recover(hp);
}, },
ai:{ ai:{
order:1, order:1,
@ -10689,8 +10675,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.awakenSkill('mengqing'); player.awakenSkill('mengqing');
player.gainMaxHp(3); player.gainMaxHp(3);
player.recover(3); player.recover(3);
player.removeSkill('zhukou'); //player.removeSkill('zhukou');
player.addSkill('yuyun'); //player.addSkill('yuyun');
player.changeSkills(['yuyun'],['zhukou']);
}, },
derivation:'yuyun', derivation:'yuyun',
}, },
@ -12065,7 +12052,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var target=result.targets[0]; var target=result.targets[0];
player.logSkill('dushi',target); player.logSkill('dushi',target);
target.markSkill('dushi'); target.markSkill('dushi');
target.addSkillLog('dushi'); target.addSkills('dushi');
} }
}, },
intro:{content:'您已经获得弘农王的诅咒'}, intro:{content:'您已经获得弘农王的诅咒'},
@ -12403,7 +12390,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.awakenSkill('choujue'); player.awakenSkill('choujue');
player.storage.choujue=true; player.storage.choujue=true;
player.loseMaxHp(); player.loseMaxHp();
player.addSkill('beishui'); player.addSkills('beishui');
}, },
}, },
beishui:{ beishui:{
@ -12425,7 +12412,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.awakenSkill('beishui'); player.awakenSkill('beishui');
player.storage.beishui=true; player.storage.beishui=true;
player.loseMaxHp(); player.loseMaxHp();
player.addSkill('qingjiao'); player.addSkills('qingjiao');
}, },
}, },
qingjiao:{ qingjiao:{
@ -12699,9 +12686,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(result.bool){ if(result.bool){
var target=result.targets[0]; var target=result.targets[0];
player.line(target,'fire'); player.line(target,'fire');
player.addSkill('hmxili'); player.addSkills(['hmxili'],['mansi']);
target.addSkill('hmxili'); target.addSkills('hmxili');
player.removeSkill('mansi');
} }
}, },
}, },

View File

@ -217,13 +217,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
derivation:"xinfu_zhanji", derivation:"xinfu_zhanji",
trigger:{global:"dieAfter"}, trigger:{global:"dieAfter"},
logTarget:'player', logTarget:'player',
content:function (){ async content(e,t,player){
player.awakenSkill('xinfu_songsang'); player.awakenSkill('xinfu_songsang');
if(player.isDamaged()){ if(player.isDamaged()){
player.recover(); player.recover();
} }
else player.gainMaxHp(); else player.gainMaxHp();
player.addSkill('xinfu_zhanji'); player.addSkills('xinfu_zhanji');
}, },
}, },
"xinfu_jixu":{ "xinfu_jixu":{

View File

@ -3026,7 +3026,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var target=result.targets[0]; var target=result.targets[0];
event.target=target; event.target=target;
player.line(target,'thunder'); player.line(target,'thunder');
target.addSkill('new_canyun'); target.addSkills('new_canyun');
target.discardPlayerCard('是否弃置自己区域内的一张梅花牌,获得技能〖绝响〗?',target,'hej').set('ai',function(card){ target.discardPlayerCard('是否弃置自己区域内的一张梅花牌,获得技能〖绝响〗?',target,'hej').set('ai',function(card){
if(get.position(card)=='j') return 100+get.value(card); if(get.position(card)=='j') return 100+get.value(card);
return 100-get.value(card); return 100-get.value(card);
@ -3036,7 +3036,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
else event.finish(); else event.finish();
"step 3" "step 3"
if(result.bool) target.addSkill('new_juexiang'); if(result.bool) target.addSkills('new_juexiang');
}, },
}, },
"new_canyun":{ "new_canyun":{
@ -3590,7 +3590,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
'step 3' 'step 3'
if(result.bool&&result.autochoose&&result.cards.length==result.rawcards.length){ if(result.bool&&result.autochoose&&result.cards.length==result.rawcards.length){
player.removeSkill('jiexun'); player.removeSkills('jiexun');
player.addSkill('funan_jiexun'); player.addSkill('funan_jiexun');
} }
} }
@ -4013,7 +4013,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(result.bool){ if(result.bool){
var target=result.targets[0] var target=result.targets[0]
player.logSkill('juexiang',target); player.logSkill('juexiang',target);
target.addSkill(lib.skill.juexiang.derivation.randomGet()); target.addSkills(lib.skill.juexiang.derivation.randomGet());
target.addTempSkill('juexiang_club',{player:'phaseZhunbeiBegin'}); target.addTempSkill('juexiang_club',{player:'phaseZhunbeiBegin'});
} }
}, },
@ -8142,7 +8142,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(result.bool){ if(result.bool){
var es=target.getCards('e'); var es=target.getCards('e');
target.give(es,player,'give'); target.give(es,player,'give');
player.removeSkill('yanzhu'); player.removeSkills('yanzhu');
} }
else{ else{
target.chooseToDiscard(true,'he'); target.chooseToDiscard(true,'he');
@ -10927,14 +10927,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
content:function(){ content:function(){
"step 0" "step 0"
player.awakenSkill('zili');
player.chooseDrawRecover(2,true,function(event,player){ player.chooseDrawRecover(2,true,function(event,player){
if(player.hp==1&&player.isDamaged()) return 'recover_hp'; if(player.hp==1&&player.isDamaged()) return 'recover_hp';
return 'draw_card'; return 'draw_card';
}); });
"step 1" "step 1"
player.loseMaxHp(); player.loseMaxHp();
player.addSkill('paiyi'); player.addSkills('paiyi');
player.awakenSkill('zili');
} }
}, },
paiyi:{ paiyi:{
@ -13718,11 +13718,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
player.awakenSkill('zbaijiang'); player.awakenSkill('zbaijiang');
player.gainMaxHp(); player.gainMaxHp();
player.removeSkill('zquanji'); player.changeSkills(['zyexin','zzili'],['zquanji','zzhenggong']);
player.removeSkill('zzhenggong');
game.log(player,'失去了技能','#g【权计】、【争功】');
player.addSkillLog('zyexin');
player.addSkillLog('zzili');
} }
}, },
zyexin:{ zyexin:{
@ -13780,10 +13776,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return player.getExpansions('zyexin').length>=4; return player.getExpansions('zyexin').length>=4;
}, },
forced:true, forced:true,
content:function(){ async content(e,t,player){
player.awakenSkill('zzili'); player.awakenSkill('zzili');
player.loseMaxHp(); player.loseMaxHp();
player.addSkill('zpaiyi'); player.addSkills('zpaiyi');
}, },
// intro:{ // intro:{
// content:'limited' // content:'limited'

View File

@ -867,7 +867,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
player.awakenSkill('dezhang'); player.awakenSkill('dezhang');
player.loseMaxHp(); player.loseMaxHp();
player.addSkill('weishu'); player.addSkills('weishu');
}, },
}, },
weishu:{ weishu:{
@ -3445,7 +3445,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
player.awakenSkill('zhaotao'); player.awakenSkill('zhaotao');
player.loseMaxHp(); player.loseMaxHp();
player.addSkillLog('pozhu'); player.addSkills('pozhu');
}, },
derivation:'pozhu', derivation:'pozhu',
}, },

View File

@ -2169,7 +2169,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
event.finish(); event.finish();
} }
else{ else{
target.addSkillLog(result.control); target.addSkills(result.control);
target.line(player); target.line(player);
player.recover(player.maxHp-player.hp); player.recover(player.maxHp-player.hp);
} }
@ -3914,7 +3914,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
if(result.bool){ if(result.bool){
var target=result.targets[0]; var target=result.targets[0];
player.logSkill('gzlianyou',target); player.logSkill('gzlianyou',target);
target.addSkillLog('gzxinghuo'); target.addSkills('gzxinghuo');
game.delayx(); game.delayx();
} }
}, },
@ -10828,8 +10828,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
if(list.length){ if(list.length){
player.gain(list,'gain2'); player.gain(list,'gain2');
if(list.length>=3&&player.hasStockSkill('lianzi')){ if(list.length>=3&&player.hasStockSkill('lianzi')){
player.removeSkill('lianzi'); player.changeSkills(['gzzhiheng'],['lianzi']);
player.addSkill('gzzhiheng');
} }
} }
}, },
@ -11997,9 +11996,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
player.recover(2-player.hp); player.recover(2-player.hp);
} }
'step 2' 'step 2'
player.removeSkill('shouyue');
player.removeSkill('wuhujiangdaqi'); player.removeSkill('wuhujiangdaqi');
player.addSkill('rerende'); player.changeSkills(['rerende'],['shouyue']);
}, },
ai:{ ai:{
order:1, order:1,
@ -12420,7 +12418,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
player.removeCharacter(1); player.removeCharacter(1);
} }
'step 1' 'step 1'
target.addSkill('gzyongjue'); target.addSkills('gzyongjue');
if(target!=player){ if(target!=player){
target.draw(2); target.draw(2);
} }
@ -12504,11 +12502,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
'step 0' 'step 0'
player.removeCharacter(1); player.removeCharacter(1);
'step 1' 'step 1'
player.removeSkill('baoling'); player.removeSkills('baoling');
player.gainMaxHp(3,true); player.gainMaxHp(3,true);
'step 2' 'step 2'
player.recover(3); player.recover(3);
player.addSkill('benghuai'); player.addSkills('benghuai');
}, },
derivation:'benghuai' derivation:'benghuai'
}, },
@ -15523,7 +15521,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
if(event.hidden) game.log(player,'替换了副将','#g'+get.translation(player.name2)); if(event.hidden) game.log(player,'替换了副将','#g'+get.translation(player.name2));
else game.log(player,'将副将从','#g'+get.translation(player.name2),'变更为','#g'+get.translation(name)); else game.log(player,'将副将从','#g'+get.translation(player.name2),'变更为','#g'+get.translation(name));
player.viceChanged=true; player.viceChanged=true;
player.reinit(player.name2,name,false); player.reinitCharacter(player.name2,name,false);
}, },
changeVice:function(){ changeVice:function(){
'step 0' 'step 0'
@ -15579,7 +15577,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
if(event.hidden) game.log(player,'替换了副将','#g'+get.translation(player.name2)); if(event.hidden) game.log(player,'替换了副将','#g'+get.translation(player.name2));
else game.log(player,'将副将从','#g'+get.translation(player.name2),'变更为','#g'+get.translation(name)); else game.log(player,'将副将从','#g'+get.translation(player.name2),'变更为','#g'+get.translation(name));
player.viceChanged=true; player.viceChanged=true;
player.reinit(player.name2,name,false); player.reinitCharacter(player.name2,name,false);
}, },
/*----分界线----*/ /*----分界线----*/
mayChangeVice:function(){ mayChangeVice:function(){

View File

@ -2785,7 +2785,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
return info&&info.zhuSkill; return info&&info.zhuSkill;
}); });
if(skills.length){ if(skills.length){
for(var i of skills) player.addSkillLog(i); player.addSkills(skills);
} }
game.zhu.node.identity.classList.remove('guessing'); game.zhu.node.identity.classList.remove('guessing');
if(lib.config.animation&&!lib.config.low_performance) game.zhu.$legend(); if(lib.config.animation&&!lib.config.low_performance) game.zhu.$legend();
@ -2800,7 +2800,6 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
},game.zhu); },game.zhu);
game.delay(2); game.delay(2);
game.zhu.playerfocus(1000); game.zhu.playerfocus(1000);
_status.event.trigger('zhuUpdate');
} }
if(!_status.over){ if(!_status.over){
@ -3875,12 +3874,13 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
'step 2' 'step 2'
player.recover(); player.recover();
player.draw(); player.draw();
player.getStockSkills(true,true).forEach(stockSkill=>{ const skills = player.getStockSkills(true,true).forEach(stockSkill=>{
if(player.hasSkill(stockSkill)) return; if(player.hasSkill(stockSkill)) return;
var info=get.info(stockSkill); var info=get.info(stockSkill);
if(!info||!info.zhuSkill) return; if(!info||!info.zhuSkill) return;
player.addSkillLog(stockSkill); return true;
}); });
if(skills.length) player.addSkills(skills)
} }
}, },
stratagem_revitalization:{ stratagem_revitalization:{

View File

@ -11,6 +11,114 @@ export const Content = {
emptyEvent: () => { emptyEvent: () => {
event.trigger(event.name); event.trigger(event.name);
}, },
//变更武将牌
async changeCharacter(event,trigger,player) {
const rawPairs = [player.name1];
if (player.name2 && lib.character[player.name2]) rawPairs.push(player.name2);
event.rawPairs = rawPairs;
const newPairs = event.newPairs;
for(let name of newPairs){
if(!lib.character[name]){
console.warn(`警告Player[${player.name}]试图将武将牌变更为不存在的武将:`,name);
return;
}
}
const removeSkills = [], addSkills = [];
//进行Log
if(event.log !== false) {
//变更前后数量相同的情况
if (rawPairs.length == newPairs.length){
for (let i = 0; i<Math.min(2, rawPairs.length); i++){
let rawName = rawPairs[i], newName = newPairs[i];
if (rawName != newName) {
game.log(player, `${i == 0 ? '主' : '副'}将从`, `#b${get.translation(rawName)}`, '变更为了', `#b${get.translation(newName)}`);
}
}
}
else if (rawPairs.length == 1 && newPairs.length == 2){
game.log(player,'将单将', `#b${get.translation(rawPairs[0])}`, '变更为了双将', `#b${get.translation(newPairs[0])}+${get.translation(newPairs[1])}`);
}
else if (rawPairs.length == 2 && newPairs.length == 1){
game.log(player,'将双将', `#b${get.translation(rawPairs[0])}+${get.translation(rawPairs[1])}`, '变更为了单将', `#b${get.translation(newPairs[0])}`);
}
}
//确定要失去和获得的技能
//失去技能时全部失去,但获得技能时,非主公角色不能获得主公技。
rawPairs.forEach(name => {
removeSkills.addArray(lib.character[name][3]);
})
newPairs.forEach(name => {
addSkills.addArray(lib.character[name][3].filter(skill => {
const info = get.info(skill);
if (!info || (info.zhuSkill && !player.isZhu2())) return false;
return true;
}));
})
//实际变更武将牌
player.reinit2(newPairs);
//操作武将牌堆
if (_status.characterlist) {
_status.characterlist.removeArray(newPairs);
_status.characterlist.addArray(rawPairs);
}
//变更一下获得前后的技能
await player.changeSkills(addSkills, removeSkills);
//变更角色的所属势力。如果新将是双势力,重选一下势力。
if(event.changeGroup !== false){
let newGroups = [];
if (!player.isUnseen(1)) {
newGroups = (get.is.double(player.name1, true) || [get.character(player.name1, 1)]);
}
else if (player.name2 && !player.isUnseen(2)) {
newGroups = (get.is.double(player.name2, true) || [get.character(player.name2, 1)]);
}
if (newGroups.length > 1) {
const newGroup = await player.chooseControl(newGroups).set('prompt','请选择一个新的势力').forResult('control');
if (newGroup != player.group) {
await player.changeGroup(newGroup);
}
}
else if(newGroups.length == 1 && newGroups[0] != player.group){
await player.changeGroup(newGroups[0]);
}
}
},
//变更技能
async changeSkills (event,trigger,player) {
//去重检查
event.addSkill.unique();
event.removeSkill.unique();
const duplicatedSkills = event.addSkill.filter(skill => event.removeSkill.includes(skill));
if (duplicatedSkills.length) {
event.addSkill.removeArray(duplicatedSkills);
event.removeSkill.removeArray(duplicatedSkills);
}
if (!event.addSkill.length&&!event.removeSkill.length) return;
//手动触发时机
await event.trigger('changeSkillsBefore');
await event.trigger('changeSkillsBegin');
//处理失去和获得的技能
if (event.$handle) {
event.$handle(player, event.addSkill, event.removeSkill, event);
}
else {
if(event.addSkill.length){
player.addSkill(event.addSkill);
game.log(player, '获得了技能', ...event.addSkill.map(i => {
return '#g【' + get.translation(i) + '】';
}));
}
if(event.removeSkill.length){
player.removeSkill(event.removeSkill);
game.log(player, '失去了技能', ...event.removeSkill.map(i => {
return '#g【' + get.translation(i) + '】';
}));
}
}
//手动触发时机
await event.trigger('changeSkillsEnd');
await event.trigger('changeSkillsAfter');
},
//增加明置手牌 //增加明置手牌
addShownCards: () => { addShownCards: () => {
const hs = player.getCards('h'), showingCards = event._cards.filter(showingCard => hs.includes(showingCard)), shown = player.getShownCards(); const hs = player.getCards('h'), showingCards = event._cards.filter(showingCard => hs.includes(showingCard)), shown = player.getShownCards();

View File

@ -731,8 +731,8 @@ export class GameEvent {
} }
} }
trigger(name) { trigger(name) {
if (_status.video) return this; if (_status.video) return;
if ((this.name === 'gain' || this.name === 'lose') && !_status.gameDrawed) return this; if ((this.name === 'gain' || this.name === 'lose') && !_status.gameDrawed) return;
if (name === 'gameDrawEnd') _status.gameDrawed = true; if (name === 'gameDrawEnd') _status.gameDrawed = true;
if (name === 'gameStart') { if (name === 'gameStart') {
lib.announce.publish('gameStart', {}); lib.announce.publish('gameStart', {});
@ -741,11 +741,11 @@ export class GameEvent {
_status.gameStarted = true; _status.gameStarted = true;
game.showHistory(); game.showHistory();
} }
if (!lib.hookmap[name] && !lib.config.compatiblemode) return this; if (!lib.hookmap[name] && !lib.config.compatiblemode) return;
if (!game.players || !game.players.length) return this; if (!game.players || !game.players.length) return;
const event = this; const event = this;
let start = [_status.currentPhase, event.source, event.player, game.me, game.players[0]].find(i => get.itemtype(i) == 'player'); let start = [_status.currentPhase, event.source, event.player, game.me, game.players[0]].find(i => get.itemtype(i) == 'player');
if (!start) return this; if (!start) return;
if (!game.players.includes(start) && !game.dead.includes(start)) start = game.findNext(start); if (!game.players.includes(start) && !game.dead.includes(start)) start = game.findNext(start);
const firstDo = { const firstDo = {
player: "firstDo", player: "firstDo",
@ -836,8 +836,9 @@ export class GameEvent {
next.triggername = name; next.triggername = name;
next.playerMap = playerMap; next.playerMap = playerMap;
event._triggering = next; event._triggering = next;
return next;
} }
return this; return null;
} }
untrigger(all = true, player) { untrigger(all = true, player) {
const evt = this._triggering; const evt = this._triggering;

View File

@ -1555,6 +1555,44 @@ export class Player extends HTMLDivElement {
if (typeof savable == 'function') savable = savable(card, this, target); if (typeof savable == 'function') savable = savable(card, this, target);
return savable; return savable;
} }
/**
* @param { String } from
* @param { String } to
* @returns { GameEventPromise }
*/
reinitCharacter(from, to, log = true){
const rawPairs = [this.name1];
if (this.name2) rawPairs.push(this.name2);
for (let i=0; i<rawPairs.length; i++){
if (rawPairs[i] == from) {
rawPairs[i] = to;
break;
}
}
return this.changeCharacter(rawPairs, log);
}
/**
* @param { String[] } newPairs
* @returns { GameEventPromise }
*/
changeCharacter(newPairs, log = true){
if (!Array.isArray(newPairs)){
console.warn(`警告Player[${this.name}].changeCharacter填写了一个错误的参数:`,newPairs);
return;
}
for(let name of newPairs){
if(!lib.character[name]){
console.warn(`警告Player[${this.name}]试图将武将牌变更为不存在的武将:`,name);
return;
}
}
const next = game.createEvent('changeCharacter');
next.player = this;
next.newPairs = newPairs;
next.log = log;
next.setContent('changeCharacter');
return next;
}
/** /**
* @param { 0 | 1 | 2 } num * @param { 0 | 1 | 2 } num
* @param { false } [log] * @param { false } [log]
@ -2344,6 +2382,69 @@ export class Player extends HTMLDivElement {
this.firstChild.innerHTML = str; this.firstChild.innerHTML = str;
return this; return this;
} }
reinit2(newPairs) {
const player = this;
game.broadcast((player, newPairs) => {
player.reinit2(newPairs);
}, this, newPairs);
const rawPairs = [this.name1];
if (this.name2 && lib.character[this.name2]) rawPairs.push(this.name2);
//单将变单将 & 双将变双将
if (rawPairs.length == newPairs.length){
for (let i = 0; i<Math.min(2, rawPairs.length); i++){
let rawName = rawPairs[i], newName = newPairs[i];
if (rawName != newName && lib.character[rawName] && lib.character[newName]) {
player.reinit(rawName, newName, null, true);
}
}
}
//单将变双将
else if (rawPairs.length == 1 && newPairs.length == 2){
player.name1 = newPairs[0];
player.name2 = newPairs[1];
player.$reinit12(newPairs);
}
//双将变单将
else if (rawPairs.length == 2 && newPairs.length == 1){
player.name1 = newPairs[0];
delete player.name2;
player.$reinit21(newPairs);
}
//修改性别
if (!player.isUnseen(1)) {
player.name = player.name1;
player.sex = get.character(player.name1)[0];
}
else if (!player.isUnseen(2)) {
player.name = player.name2;
player.sex = get.character(player.name2)[0];
}
}
$reinit12(newPairs) {
const player = this;
player.node.avatar.setBackground(newPairs[0], 'character');
player.node.name.innerHTML = get.slimName(newPairs[0]);
player.name2 = newPairs[1];
player.classList.add('fullskin2');
player.node.avatar2.classList.remove('hidden');
player.node.avatar2.setBackground(newPairs[1],'character');
player.node.name2.innerHTML = get.slimName(newPairs[1]);
if (player == game.me && ui.fakeme) {
ui.fakeme.style.backgroundImage = player.node.avatar.style.backgroundImage;
}
}
$reinit21(newPairs) {
const player = this, name = newPairs[0];
player.smoothAvatar(false);
player.node.avatar.setBackground(name,'character');
player.node.name.innerHTML = get.slimName(name);
player.classList.remove('fullskin2');
player.node.avatar2.classList.add('hidden');
player.node.name2.innerHTML = '';
if (player==game.me&&ui.fakeme) {
ui.fakeme.style.backgroundImage=player.node.avatar.style.backgroundImage;
}
}
reinit(from, to, maxHp, online) { reinit(from, to, maxHp, online) {
var info1 = lib.character[from]; var info1 = lib.character[from];
var info2 = lib.character[to]; var info2 = lib.character[to];
@ -2367,65 +2468,63 @@ export class Player extends HTMLDivElement {
else { else {
return this; return this;
} }
if (online) { if (!online) {
return; for (var i = 0; i < info1[3].length; i++) {
} this.removeSkill(info1[3][i]);
for (var i = 0; i < info1[3].length; i++) { }
this.removeSkill(info1[3][i]); for (var i = 0; i < info2[3].length; i++) {
} var info = get.info(info2[3][i]);
for (var i = 0; i < info2[3].length; i++) { if (info && info.zhuSkill && !this.isZhu2()) continue;
var info = get.info(info2[3][i]); this.addSkill(info2[3][i]);
if (info && info.zhuSkill && !this.isZhu2()) continue; }
this.addSkill(info2[3][i]); if (Array.isArray(maxHp)) {
} this.maxHp = maxHp[1];
if (Array.isArray(maxHp)) { this.hp = maxHp[0];
this.maxHp = maxHp[1];
this.hp = maxHp[0];
}
else {
var num;
if (maxHp === false) {
num = 0;
} }
else { else {
if (typeof maxHp != 'number') { var num;
maxHp = get.infoMaxHp(info2[2]); if (maxHp === false) {
num = 0;
} }
num = maxHp - get.infoMaxHp(info1[2]); else {
} if (typeof maxHp != 'number') {
if (typeof this.singleHp == 'boolean') { maxHp = get.infoMaxHp(info2[2]);
if (num % 2 != 0) { }
if (this.singleHp) { num = maxHp - get.infoMaxHp(info1[2]);
this.maxHp += (num + 1) / 2; }
this.singleHp = false; if (typeof this.singleHp == 'boolean') {
if (num % 2 != 0) {
if (this.singleHp) {
this.maxHp += (num + 1) / 2;
this.singleHp = false;
}
else {
this.maxHp += (num - 1) / 2;
this.singleHp = true;
if (!game.online) {
this.doubleDraw();
}
}
} }
else { else {
this.maxHp += (num - 1) / 2; this.maxHp += num / 2;
this.singleHp = true;
if (!game.online) {
this.doubleDraw();
}
} }
} }
else { else {
this.maxHp += num / 2; this.maxHp += num;
} }
} }
else { game.broadcast(function (player, from, to, skills) {
this.maxHp += num; player.reinit(from, to, null, true);
} player.applySkills(skills);
}, this, from, to, get.skillState(this));
} }
game.broadcast(function (player, from, to, skills) {
player.reinit(from, to, null, true);
player.applySkills(skills);
}, this, from, to, get.skillState(this));
game.addVideo('reinit3', this, { game.addVideo('reinit3', this, {
from: from, from: from,
to: to, to: to,
hp: this.maxHp, hp: this.maxHp,
avatar2: this.name2 == to avatar2: this.name2 == to
}); });
this.$reinit(from, to, maxHp, online); this.$reinit(from, to, maxHp, online);
this.update(); this.update();
} }
@ -7188,6 +7287,26 @@ export class Player extends HTMLDivElement {
} }
return skill; return skill;
} }
addSkills(skill){
if(!skill) return;
return this.changeSkills(Array.isArray(skill) ? skill : [skill], []);
}
removeSkills(skill){
if(!skill) return;
return this.changeSkills([], Array.isArray(skill) ? skill : [skill]);
}
changeSkills(addSkill = [], removeSkill = []){
const next = game.createEvent('changeSkills', false);
next.player = this;
if(!Array.isArray(addSkill) || !Array.isArray(removeSkill)){
console.warn(`警告Player[${this.name}].changeSkills的参数错误应当为数组形式。`);
return;
}
next.addSkill = addSkill.slice(0).unique();
next.removeSkill = removeSkill.slice(0).unique();
next.setContent('changeSkills');
return next;
}
addSkill(skill, checkConflict, nobroadcast, addToSkills) { addSkill(skill, checkConflict, nobroadcast, addToSkills) {
if (Array.isArray(skill)) { if (Array.isArray(skill)) {
_status.event.clearStepCache(); _status.event.clearStepCache();