将tw.js到yingbian.js中的所有addSkill改为addSkills

This commit is contained in:
Spmario233 2024-02-14 01:18:38 +08:00
parent 258d7dd868
commit 25294f52ef
7 changed files with 62 additions and 60 deletions

View File

@ -18556,7 +18556,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
},list);
},
trigger:{global:['gameStart','changeSkills']},
trigger:{global:['gameStart','changeSkillsAfter']},
forced:true,
audio:2,
filter:function(event,player){
@ -18573,7 +18573,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
async content (event, trigger, player) {
lib.skill.weidi.init(player);
}
},
},
zhenlue:{
audio:2,

View File

@ -2569,7 +2569,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return info&&!info.hiddenSkill&&!info.zhuSkill&&!info.charlotte;
});
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);
game.broadcastAll(function(list){
game.expandSkills(list);
@ -3235,7 +3236,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(result.bool){
var target=result.targets[0];
player.logSkill('twjuntun',target);
target.addSkillLog('twxiongjun');
target.addSkills('twxiongjun');
if(target!=player) player.addExpose(0.25);
}
},
@ -4313,7 +4314,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.awakenSkill('twmibei');
player.logSkill('twmibei_achieve');
game.log(player,'成功完成使命');
player.addSkillLog('twmouli');
player.addSkils('twmouli');
},
intro:{content:'已使用牌名:$'},
subSkill:{
@ -5324,7 +5325,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){
'step 0'
player.awakenSkill('twneirao');
player.removeSkill('twjiekuang');
player.removeSkills('twjiekuang');
game.log(player,'失去了技能','#g【竭匡】');
'step 1'
var num=player.countCards('he'),cards=[];
@ -5337,7 +5338,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
if(cards.length) player.gain(cards,'gain2');
'step 2'
player.addSkillLog('twluanlve');
player.addSkills('twluanlve');
},
},
twluanlve:{
@ -6830,12 +6831,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.gain(gains,'gain2');
}
'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);
'step 4'
if(result.bool){
player.loseMaxHp();
player.addSkillLog('twsaotao');
player.addSkills('twsaotao');
game.delayx();
}
},
@ -8584,7 +8585,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
});
'step 1'
targets.sortBySeat();
for(var i of targets) i.addSkillLog('twgonghuan');
for(var i of targets) i.addSkills('twgonghuan');
},
derivation:'twgonghuan',
ai:{
@ -11534,10 +11535,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
logTarget:()=>game.filterPlayer().sortBySeat(),
content:function(){
'step 0'
game.countPlayer(function(current){
current.addSkill('twfeifu');
game.filterPlayer().sortBySeat().forEach(function(current){
current.addSkills('twfeifu');
});
game.log(player,'令所有其他角色获得了技能','#g【非服】')
//game.log(player,'令所有其他角色获得了技能','#g【非服】')
game.delayx();
'step 1'
player.chooseTarget('是否减1点体力上限并令一名其他角色获得技能【复纂】',lib.filter.notMe).set('ai',function(target){
@ -11551,7 +11552,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.loseMaxHp();
var target=result.targets[0];
player.line(target,'fire');
target.addSkillLog('twfuzuan');
target.addSkills('twfuzuan');
game.delayx();
}
},
@ -12041,7 +12042,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]);
'step 1'
var skill=result.control;
player.addSkillLog(skill);
player.addSkills(skill);
event.twbudao_skill=skill;
player.chooseTarget(lib.filter.notMe,'是否令一名其他角色也获得【'+get.translation(skill)+'】?').set('ai',function(target){
var player=_status.event.player;
@ -12053,7 +12054,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var target=result.targets[0];
event.target=target;
player.line(target,'green');
target.addSkillLog(event.twbudao_skill);
target.addSkills(event.twbudao_skill);
var cards=target.getCards('he');
if(!cards.length) event.finish();
else if(cards.length==1) event._result={bool:true,cards:cards};
@ -12573,7 +12574,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.logSkill('twlingfa');
player.removeSkill('twlingfa');
game.log(player,'失去了技能','#g【令法】');
player.addSkillLog('twzhian');
player.addSkills('twzhian');
break;
}
}
@ -13076,7 +13077,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var info=get.info(skill);
return info&&info.zhuSkill;
});
for(var i of skills) target.addSkillLog(i);
target.addSkills(skills);
//for(var i of skills) target.addSkillLog(i);
}
},
},
@ -13470,7 +13472,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
target.disableJudge();
player.markAuto('twjuezhu_restore',[[target,result.control]]);
player.addSkill('twjuezhu_restore');
target.addSkill('feiying');
target.addSkills('feiying');
},
subSkill:{
restore:{
@ -13931,7 +13933,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var name=result.links[0];
player.flashAvatar('twhuashen',name);
game.log(player,'获得了','#y'+get.translation(name),'的所有技能');
player.addSkill(lib.character[name][3])
player.addSkills(lib.character[name][3])
}
'step 2'
var num=event.num-player.maxHp;

View File

@ -6029,9 +6029,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
content:function(){
player.awakenSkill('dcmoucheng');
player.removeSkill('dclianji');
game.log(player,'失去了技能','#g【连计】');
player.addSkillLog('xinjingong');
player.changeSkills(['xinjingong'],['dclianji']);
},
},
//周宣
@ -6462,8 +6460,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(result.bool){
var target=result.targets[0];
player.logSkill('dclianzhi_reproach',target);
player.addSkillLog('dcshouze');
target.addSkillLog('dcshouze');
player.addSkills('dcshouze');
target.addSkills('dcshouze');
target.addMark('dclingfang',Math.max(1,player.countMark('dclingfang')));
}
},
@ -7494,7 +7492,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
content:function(){
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();
},
global:'dcyaoyi_blocker',
@ -8247,8 +8245,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 3'
var map=event.result||result;
if(map.skills&&map.skills.length){
player.removeSkill('dchuishu');
for(var i of map.skills) player.addSkillLog(i);
//player.removeSkill('dchuishu');
//for(var i of map.skills) player.addSkillLog(i);
player.changeSkills(map.skills, ['dchuishu']);
player.markAuto('zhuSkill_dcligong',map.skills);
}
else{
@ -9377,8 +9376,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
targets.sortBySeat();
player.logSkill('dcpijing',targets);
game.countPlayer(function(current){
if(!targets.includes(current)) current.removeSkill('dczimu');
else current.addSkill('dczimu');
if(!targets.includes(current)) current.removeSkills('dczimu');
else current.addSkills('dczimu');
});
game.delayx();
}
@ -9580,7 +9579,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return info&&!info.charlotte;
});
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');
var num=player.countMark('shawu');
@ -9611,7 +9611,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var target=result.targets[0];
player.awakenSkill('huaping');
player.logSkill('huaping_give',target);
target.addSkill('shawu');
target.addSkills('shawu');
var num=player.countMark('shawu');
if(num>0){
player.removeMark('shawu',num);
@ -10445,7 +10445,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.reinit('re_sunyi','xushi',false);
}
else{
player.addSkillLog('olhunzi');
player.addSkills('olhunzi');
event.goto(2);
}
'step 1'
@ -10689,8 +10689,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.awakenSkill('mengqing');
player.gainMaxHp(3);
player.recover(3);
player.removeSkill('zhukou');
player.addSkill('yuyun');
//player.removeSkill('zhukou');
//player.addSkill('yuyun');
player.changeSkills(['yuyun'],['zhukou']);
},
derivation:'yuyun',
},
@ -12065,7 +12066,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var target=result.targets[0];
player.logSkill('dushi',target);
target.markSkill('dushi');
target.addSkillLog('dushi');
target.addSkills('dushi');
}
},
intro:{content:'您已经获得弘农王的诅咒'},
@ -12403,7 +12404,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.awakenSkill('choujue');
player.storage.choujue=true;
player.loseMaxHp();
player.addSkill('beishui');
player.addSkills('beishui');
},
},
beishui:{
@ -12425,7 +12426,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.awakenSkill('beishui');
player.storage.beishui=true;
player.loseMaxHp();
player.addSkill('qingjiao');
player.addSkills('qingjiao');
},
},
qingjiao:{
@ -12699,9 +12700,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(result.bool){
var target=result.targets[0];
player.line(target,'fire');
player.addSkill('hmxili');
target.addSkill('hmxili');
player.removeSkill('mansi');
player.addSkills(['hmxili'],['mansi']);
target.addSkills('hmxili');
}
},
},

View File

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

View File

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

View File

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

View File

@ -731,8 +731,8 @@ export class GameEvent {
}
}
trigger(name) {
if (_status.video) return this;
if ((this.name === 'gain' || this.name === 'lose') && !_status.gameDrawed) return this;
if (_status.video) return;
if ((this.name === 'gain' || this.name === 'lose') && !_status.gameDrawed) return;
if (name === 'gameDrawEnd') _status.gameDrawed = true;
if (name === 'gameStart') {
lib.announce.publish('gameStart', {});
@ -741,11 +741,11 @@ export class GameEvent {
_status.gameStarted = true;
game.showHistory();
}
if (!lib.hookmap[name] && !lib.config.compatiblemode) return this;
if (!game.players || !game.players.length) return this;
if (!lib.hookmap[name] && !lib.config.compatiblemode) return;
if (!game.players || !game.players.length) return;
const event = this;
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);
const firstDo = {
player: "firstDo",
@ -836,8 +836,9 @@ export class GameEvent {
next.triggername = name;
next.playerMap = playerMap;
event._triggering = next;
return next;
}
return this;
return null;
}
untrigger(all = true, player) {
const evt = this._triggering;