技能写法修改,Bugfix

This commit is contained in:
Spmario233 2024-02-16 23:48:32 +08:00
parent bbfa0e47e9
commit 1a1accd7a9
11 changed files with 28 additions and 32 deletions

View File

@ -5543,7 +5543,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
content(){ content(){
player.removeMark('baonu',2); player.removeMark('baonu',2);
player.addTempSkill('wushuang'); player.addTempSkills('wushuang');
player.popup('无双'); player.popup('无双');
game.log(player,'获得了技能','#g【无双】'); game.log(player,'获得了技能','#g【无双】');
target.addTempSkill('ol_wuqian_targeted'); target.addTempSkill('ol_wuqian_targeted');

View File

@ -6439,7 +6439,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var pos=lib.skill.midu_backup.equip; var pos=lib.skill.midu_backup.equip;
if(pos<=0) player.enableJudge(); if(pos<=0) player.enableJudge();
else player.enableEquip(pos); else player.enableEquip(pos);
player.addTempSkill('rehuomo',{player:'phaseBegin'}); player.addTempSkills('rehuomo',{player:'phaseBegin'});
}, },
} }
} }
@ -7151,7 +7151,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var info=get.info(i); var info=get.info(i);
return info&&!get.is.locked(i)&&!info.limited&&!info.juexingji&&!info.zhuSkill&&!info.charlotte; return info&&!get.is.locked(i)&&!info.limited&&!info.juexingji&&!info.zhuSkill&&!info.charlotte;
}); });
target.addAdditionalSkill('dcjiezhen_blocker','bazhen'); target.addAdditionalSkills('dcjiezhen_blocker','bazhen');
target.addSkill('dcjiezhen_blocker'); target.addSkill('dcjiezhen_blocker');
target.markAuto('dcjiezhen_blocker',skills); target.markAuto('dcjiezhen_blocker',skills);
player.addSkill('dcjiezhen_clear'); player.addSkill('dcjiezhen_clear');
@ -7297,7 +7297,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.awakenSkill('dczecai'); player.awakenSkill('dczecai');
var target=result.targets[0]; var target=result.targets[0];
player.logSkill('dczecai',target); player.logSkill('dczecai',target);
target.addAdditionalSkill('dczecai_effect','rejizhi'); target.addAdditionalSkills('dczecai_effect','rejizhi');
target.addTempSkill('dczecai_effect','roundStart'); target.addTempSkill('dczecai_effect','roundStart');
if(target==event.target){ if(target==event.target){
var evt=trigger._trigger; var evt=trigger._trigger;

View File

@ -2029,7 +2029,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return lib.filter.canBeDiscarded(card,player,target); return lib.filter.canBeDiscarded(card,player,target);
},'e')){ },'e')){
player.discardPlayerCard(target,'e',true); player.discardPlayerCard(target,'e',true);
target.addAdditionalSkill('jsrgqingzi_'+player.playerid,'xinshensu'); target.addAdditionalSkills('jsrgqingzi_'+player.playerid,'xinshensu');
player.markAuto('jsrgqingzi_clear',[target]); player.markAuto('jsrgqingzi_clear',[target]);
} }
event.num++; event.num++;

View File

@ -5914,7 +5914,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
delete player._mouduan_mark; delete player._mouduan_mark;
} }
},player); },player);
player.removeAdditionalSkill('mouduan'); player.removeAdditionalSkills('mouduan');
}, },
trigger:{player:'loseEnd'}, trigger:{player:'loseEnd'},
forced:true, forced:true,
@ -5930,7 +5930,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player._mouduan_mark.firstChild.innerHTML='文'; player._mouduan_mark.firstChild.innerHTML='文';
player._mouduan_mark.info.content='拥有技能【英姿】、【克己】'; player._mouduan_mark.info.content='拥有技能【英姿】、【克己】';
},player); },player);
player.addAdditionalSkill('mouduan',['yingzi','keji']); player.addAdditionalSkills('mouduan',['yingzi','keji']);
}, },
group:'mouduan2' group:'mouduan2'
}, },
@ -5956,7 +5956,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player._mouduan_mark.firstChild.innerHTML='武'; player._mouduan_mark.firstChild.innerHTML='武';
player._mouduan_mark.info.content='拥有技能【激昂】、【谦逊】'; player._mouduan_mark.info.content='拥有技能【激昂】、【谦逊】';
},player); },player);
player.addAdditionalSkill('mouduan',['jiang','qianxun']); player.addAdditionalSkills('mouduan',['jiang','qianxun']);
} }
} }
}, },

View File

@ -1137,7 +1137,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.addTempSkill('drlt_jueyan2'); player.addTempSkill('drlt_jueyan2');
break; break;
case 'equip5': case 'equip5':
player.addTempSkill('rejizhi'); player.addTempSkills('rejizhi');
break; break;
} }
}, },

View File

@ -14530,7 +14530,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return -1; return -1;
}; };
'step 1' 'step 1'
if(result.bool) trigger.player.addTempSkill('yuxu'); if(result.bool) trigger.player.addTempSkills('yuxu');
}, },
ai:{ ai:{
expose:0.25, expose:0.25,

View File

@ -4239,9 +4239,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var skill=result.control; var skill=result.control;
if(skill!='cancel2'){ if(skill!='cancel2'){
event.skills.remove(skill); event.skills.remove(skill);
target.addAdditionalSkill('jinghe_'+player.playerid,skill); target.addAdditionalSkills('jinghe_'+player.playerid,skill);
target.popup(skill); target.popup(skill);
game.log(target,'获得了技能','#g【'+get.translation(skill)+'】');
} }
if(event.num<event.targets.length) event.goto(1); if(event.num<event.targets.length) event.goto(1);
if(target!=game.me&&!target.isOnline2()) game.delayx(); if(target!=game.me&&!target.isOnline2()) game.delayx();
@ -4258,7 +4257,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
clear:{ clear:{
onremove:function(player){ onremove:function(player){
game.countPlayer(function(current){ game.countPlayer(function(current){
current.removeAdditionalSkill('jinghe_'+player.playerid); current.removeAdditionalSkills('jinghe_'+player.playerid);
}); });
}, },
}, },

View File

@ -3725,7 +3725,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
})){ })){
player.line(target); player.line(target);
target.markAuto('twlinglu',[player]); target.markAuto('twlinglu',[player]);
target.addAdditionalSkill('twkunsi_temp','twlinglu'); target.addAdditionalSkills('twkunsi_temp','twlinglu');
player.markAuto('twkunsi_clear',[target]); player.markAuto('twkunsi_clear',[target]);
player.addTempSkill('twkunsi_clear',{player:'phaseBegin'}); player.addTempSkill('twkunsi_clear',{player:'phaseBegin'});
} }

View File

@ -1722,9 +1722,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
else event.finish(); else event.finish();
'step 2' 'step 2'
target.line(player); target.line(player);
player.addTempSkill(result.control,'phaseUseEnd'); player.addTempSkills(result.control,'phaseUseEnd');
player.popup(result.control); player.popup(result.control);
game.log(player,'获得了','#g【'+get.translation(result.control)+'】');
}, },
ai:{ ai:{
order:function(item,player){ order:function(item,player){

View File

@ -1050,9 +1050,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
var target=result.targets[0],skill=event.skill; var target=result.targets[0],skill=event.skill;
player.line(target); player.line(target);
player.addTempSkill('gzrejinghe_clear',{player:'phaseBegin'}); player.addTempSkill('gzrejinghe_clear',{player:'phaseBegin'});
target.addAdditionalSkill('gzrejinghe_'+player.playerid,skill); target.addAdditionalSkills('gzrejinghe_'+player.playerid,skill);
target.popup(skill); target.popup(skill);
game.log(target,'获得了技能','#g【'+get.translation(skill)+'】');
} }
}, },
intro:{ intro:{
@ -1084,7 +1083,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
clear:{ clear:{
onremove:function(player){ onremove:function(player){
game.countPlayer(function(current){ game.countPlayer(function(current){
current.removeAdditionalSkill('gzrejinghe_'+player.playerid); current.removeAdditionalSkills('gzrejinghe_'+player.playerid);
}); });
}, },
}, },
@ -2833,8 +2832,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
else player.chooseControl(skills).set('prompt','选择获得一个技能直到回合结束'); else player.chooseControl(skills).set('prompt','选择获得一个技能直到回合结束');
'step 2' 'step 2'
var skill=result.control; var skill=result.control;
player.addTempSkill(skill); player.addTempSkills(skill);
game.log(player,'获得了技能','#g【'+get.translation(skill)+'】'); player.popup(skill);
}, },
derivation:['gzqice','tiaoxin','gzzhiheng','new_chuli','gzsanchen'], derivation:['gzqice','tiaoxin','gzzhiheng','new_chuli','gzsanchen'],
ai:{ ai:{
@ -4037,9 +4036,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
var skill=result.control; var skill=result.control;
if(skill!='cancel2'){ if(skill!='cancel2'){
event.skills.remove(skill); event.skills.remove(skill);
target.addAdditionalSkill('gzjinghe_'+player.playerid,skill); target.addAdditionalSkills('gzjinghe_'+player.playerid,skill);
target.popup(skill); target.popup(skill);
game.log(target,'获得了技能','#g【'+get.translation(skill)+'】');
} }
if(event.num<event.targets.length) event.goto(1); if(event.num<event.targets.length) event.goto(1);
if(target!=game.me&&!target.isOnline2()) game.delayx(); if(target!=game.me&&!target.isOnline2()) game.delayx();
@ -4056,7 +4054,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
clear:{ clear:{
onremove:function(player){ onremove:function(player){
game.countPlayer(function(current){ game.countPlayer(function(current){
current.removeAdditionalSkill('gzjinghe_'+player.playerid); current.removeAdditionalSkills('gzjinghe_'+player.playerid);
}); });
}, },
}, },
@ -5549,7 +5547,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
return player.countMark('gzsuzhi_count')<3; return player.countMark('gzsuzhi_count')<3;
}, },
content:function(){ content:function(){
player.addTempSkill('gzfankui',{player:'phaseBegin'}); player.addTempSkills('gzfankui',{player:'phaseBegin'});
}, },
group:['gzsuzhi_damage','gzsuzhi_draw','gzsuzhi_gain'], group:['gzsuzhi_damage','gzsuzhi_draw','gzsuzhi_gain'],
preHidden:['gzsuzhi_damage','gzsuzhi_draw','gzsuzhi_gain'], preHidden:['gzsuzhi_damage','gzsuzhi_draw','gzsuzhi_gain'],
@ -9745,8 +9743,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
locked:false, locked:false,
//priority:3, //priority:3,
content:function(){ content:function(){
player.addTempSkill('baka_yingzi','phaseAfter'); player.addTempSkills(['baka_yingzi','baka_yinghun']);
player.addTempSkill('baka_yinghun','phaseAfter');
}, },
ai:{ ai:{
threaten:function(player,target){ threaten:function(player,target){

View File

@ -7296,12 +7296,13 @@ export class Player extends HTMLDivElement {
return this.changeSkills([], Array.isArray(skill) ? skill : [skill]); return this.changeSkills([], Array.isArray(skill) ? skill : [skill]);
} }
changeSkills(addSkill = [], removeSkill = []){ changeSkills(addSkill = [], removeSkill = []){
const next = game.createEvent('changeSkills', false);
next.player = this;
if(!Array.isArray(addSkill) || !Array.isArray(removeSkill)){ if(!Array.isArray(addSkill) || !Array.isArray(removeSkill)){
console.warn(`警告Player[${this.name}].changeSkills的参数错误应当为数组形式。`); console.warn(`警告Player[${this.name}].changeSkills的参数错误应当为数组形式。`);
return; return;
} }
const next = game.createEvent('changeSkills', false);
next.player = this;
next.forceDie = true;
next.addSkill = addSkill.slice(0).unique(); next.addSkill = addSkill.slice(0).unique();
next.removeSkill = removeSkill.slice(0).unique(); next.removeSkill = removeSkill.slice(0).unique();
next.setContent('changeSkills'); next.setContent('changeSkills');
@ -7710,14 +7711,14 @@ export class Player extends HTMLDivElement {
} }
this.removeSkillTrigger(skill); this.removeSkillTrigger(skill);
if (!info.keepSkill) { if (!info.keepSkill) {
this.removeAdditionalSkill(skill); this.removeAdditionalSkills(skill);
} }
} }
this.enableSkill(skill + '_awake'); this.enableSkill(skill + '_awake');
} }
return skill; return skill;
} }
addTempSkills(skillsToAdd, expire, checkConflict){ addTempSkills(skillsToAdd, expire){
//请注意该方法的底层实现并非tempSkill而是additionalSkills和player.when //请注意该方法的底层实现并非tempSkill而是additionalSkills和player.when
if (typeof skillsToAdd == 'string') skillsToAdd = [skillsToAdd]; if (typeof skillsToAdd == 'string') skillsToAdd = [skillsToAdd];
if(!Array.isArray(skillsToAdd) || !skillsToAdd.length){ if(!Array.isArray(skillsToAdd) || !skillsToAdd.length){
@ -7726,7 +7727,7 @@ export class Player extends HTMLDivElement {
//确定技能要被移除的时机 //确定技能要被移除的时机
if (!expire) expire = { global: ['phaseAfter', 'phaseBeforeStart'] }; if (!expire) expire = { global: ['phaseAfter', 'phaseBeforeStart'] };
else if (typeof expire == 'string' || Array.isArray(expire)) expire = { global: expire }; else if (typeof expire == 'string' || Array.isArray(expire)) expire = { global: expire };
this.changeSkills(skillsToAdd, []).set('$handle', function(player, addSkills, removeSkills){ return this.changeSkills(skillsToAdd, []).set('$handle', function(player, addSkills, removeSkills){
if(addSkills.length){ if(addSkills.length){
game.log(player, '获得了技能', ...addSkills.map(i => { game.log(player, '获得了技能', ...addSkills.map(i => {
return '#g【' + get.translation(i) + '】'; return '#g【' + get.translation(i) + '】';