From 3e3079428617fdadaf1f34215851a8613a654299 Mon Sep 17 00:00:00 2001 From: Spmario233 Date: Tue, 15 Aug 2023 19:56:10 +0800 Subject: [PATCH] Video Contents --- character/extra.js | 39 ++++++++++++++++++++++++++++++++++++++- game/game.js | 33 +++++++++++++++++++++++++++++---- 2 files changed, 67 insertions(+), 5 deletions(-) diff --git a/character/extra.js b/character/extra.js index 6501a7c4a..2c0dc1e4f 100755 --- a/character/extra.js +++ b/character/extra.js @@ -116,11 +116,27 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.chooseButton([ '挈挟:选择至多'+get.cnNumber(num)+'张武将置入武器栏', [list,'character'], - ],[1,num],true) + ],[1,num],true).set('ai',function(button){ + var name=button.link; + var info=lib.character[name]; + var skills=info[3].filter(function(skill){ + var info=get.skillInfoTranslation(skill); + if(!info.includes('【杀】')) return false; + var list=get.skillCategoriesOf(skill); + list.remove('锁定技'); + return list.length==0; + }); + var eff=0.2; + for(var i of skills){ + eff+=get.skillRank(i,'in'); + } + return eff; + }) } 'step 1' if(result.bool){ var list=result.links; + game.addVideo('skill',player,['qiexie',[list]]) game.broadcastAll(function(list){ for(var name of list) lib.skill.qiexie.createCard(name); },list); @@ -135,7 +151,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){ for(var card of cards) player.equip(card); } }, + video:function(player,info){ + for(var name of info[0]){ + lib.skill.qiexie.createCard(name); + } + }, createCard:function(name){ + if(!_status.postReconnect.qiexie) _status.postReconnect.qiexie=[ + function(list){ + for(var name of list) lib.skill.qiexie.createCard(name); + },[] + ]; + _status.postReconnect.qiexie[1].add(name) if(!lib.card['qiexie_'+name]){ if(lib.translate[name+'_ab']) lib.translate['qiexie_'+name]=lib.translate[name+'_ab']; else lib.translate['qiexie_'+name]=lib.translate[name]; @@ -242,11 +269,21 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return !game.hasPlayer(current=>(current!=target&&player.inRange(current)&&get.distance(player,current)>distance)); }, position:'he', + check:card=>6-get.value(card), content:function(){ player.addTempSkill('cuijue_used','phaseUseAfter'); player.markAuto('cuijue_used',[target]); target.damage('nocard'); }, + ai:{ + order:2, + result:{ + target:-1.5 + }, + tag:{ + damage:1 + } + }, subSkill:{ used:{ onremove:true, diff --git a/game/game.js b/game/game.js index 9b243cd33..a693edc93 100644 --- a/game/game.js +++ b/game/game.js @@ -61,6 +61,7 @@ }, renku:[], prehidden_skills:[], + postReconnect:{}, }; var lib={ configprefix:'noname_0.9_', @@ -18475,6 +18476,7 @@ if(!map){ map=(player.expandedSlots||{}); } + game.addVideo('$syncExpand',player,get.copy(map)) game.broadcast(function(player,map){ player.expandedSlots=map; player.$syncExpand(map); @@ -18488,6 +18490,7 @@ if(!map){ map=(player.disabledSlots||{}); } + game.addVideo('$syncDisable',player,get.copy(map)) game.broadcast(function(player,map){ player.disabledSlots=map; player.$syncDisable(map); @@ -19128,8 +19131,9 @@ }, $disableJudge:function(){ var player=this; - var card=game.createCard('disable_judge','',''); + game.addVideo('$disableJudge',player); player.storage._disableJudge=true; + var card=game.createCard('disable_judge','',''); card.fix(); card.classList.add('feichu'); card.style.transform=''; @@ -19139,6 +19143,7 @@ }, $enableJudge:function(){ var player=this; + game.addVideo('$enableJudge',player); player.storage._disableJudge=false; for(var i=0;i