From afbbc3cb3278e863c867be48ea9e74d19c2c8e4c Mon Sep 17 00:00:00 2001 From: shijian <2954700422@qq.com> Date: Wed, 6 Dec 2023 22:56:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=83=A8=E5=88=86=E6=97=A0?= =?UTF-8?q?=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/shenhua.js | 5 --- character/standard.js | 87 ++----------------------------------------- game/game.js | 8 ---- 3 files changed, 4 insertions(+), 96 deletions(-) diff --git a/character/shenhua.js b/character/shenhua.js index 90c8698e4..bad0c97ae 100755 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -3952,13 +3952,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(target.isMin()) return false; return player!=target&&target.canEquip(card); }, - content2:function(){ - target.equip(cards[0]); - player.draw(); - }, async content(event, trigger, player){ await event.target.promises.equip(event.cards[0]); - game.log('老子装完了,还没摸牌') await player.promises.draw(); }, discard:false, diff --git a/character/standard.js b/character/standard.js index ec99b9c47..ed9023aaf 100755 --- a/character/standard.js +++ b/character/standard.js @@ -588,90 +588,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event){ return (event.num>0) }, - content2:function(){ - 'step 0' - event.count=trigger.num; - 'step 1' - event.count--; - event.cards=game.cardsGotoOrdering(get.cards(2)).cards; - if(_status.connectMode) game.broadcastAll(function(){_status.noclearcountdown=true}); - event.given_map={}; - 'step 2' - if(event.cards.length>1){ - player.chooseCardButton('遗计:请选择要分配的牌',true,event.cards,[1,event.cards.length]).set('ai',function(button){ - if(ui.selected.buttons.length==0) return 1; - return 0; - }); - } - else if(event.cards.length==1){ - event._result={links:event.cards.slice(0),bool:true}; - } - else{ - event.finish(); - } - 'step 3' - if(result.bool){ - event.cards.removeArray(result.links); - event.togive=result.links.slice(0); - player.chooseTarget('选择一名角色获得'+get.translation(result.links),true).set('ai',function(target){ - var att=get.attitude(_status.event.player,target); - if(_status.event.enemy){ - return -att; - } - else if(att>0){ - return att/(1+target.countCards('h')); - } - else{ - return att/100; - } - }).set('enemy',get.value(event.togive[0],player,'raw')<0); - } - 'step 4' - if(result.targets.length){ - var id=result.targets[0].playerid,map=event.given_map; - if(!map[id]) map[id]=[]; - map[id].addArray(event.togive); - } - if(cards.length>0) event.goto(2); - 'step 5' - if(_status.connectMode){ - game.broadcastAll(function(){delete _status.noclearcountdown;game.stopCountChoose()}); - } - var list=[]; - for(var i in event.given_map){ - var source=(_status.connectMode?lib.playerOL:game.playerMap)[i]; - player.line(source,'green'); - list.push([source,event.given_map[i]]); - } - game.loseAsync({ - gain_list:list, - giver:player, - animate:'draw', - }).setContent('gaincardMultiple'); - 'step 6' - if(event.count>0&&player.hasSkill(event.name)&&!get.is.blocked(event.name,player)){ - player.chooseBool(get.prompt2(event.name)).set('frequentSkill',event.name); - } - else event.finish(); - 'step 7' - if(result.bool){ - player.logSkill(event.name); - event.goto(1); - } - }, async content(event, trigger, player) { - console.log('step 0'); event.count = trigger.num; while (event.count > 0) { - console.log('step 1'); event.count--; const { cards } = await game.cardsGotoOrdering(get.cards(2)).toPromise(); if (_status.connectMode) game.broadcastAll(function () { _status.noclearcountdown = true }); event.given_map = {}; - if (!cards.length) return event.finish(); + if (!cards.length) return; do { - console.log('step 2'); const { result: { bool, links } } = cards.length == 1 ? { result: { links: cards.slice(0), bool: true } } : @@ -680,8 +606,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if (ui.selected.buttons.length == 0) return 1; return 0; }); - if (!bool) return event.finish(); - console.log('step 3'); + if (!bool) return; cards.removeArray(links); event.togive = links.slice(0); const { result: { targets } } = await player.promises.chooseTarget('选择一名角色获得' + get.translation(links), true) @@ -698,7 +623,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }) .set('enemy', get.value(event.togive[0], player, 'raw') < 0); - console.log('step 4'); if (targets.length) { const id = targets[0].playerid, map = event.given_map; @@ -706,7 +630,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ map[id].addArray(event.togive); } } while (cards.length > 0); - console.log('step 5'); if (_status.connectMode) { game.broadcastAll(function () { delete _status.noclearcountdown; game.stopCountChoose() }); } @@ -721,15 +644,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ giver: player, animate: 'draw', }).setContent('gaincardMultiple').toPromise(); - console.log('step 6'); if (event.count > 0 && player.hasSkill(event.name) && !get.is.blocked(event.name, player)) { const { result: { bool: repeat } } = await player.promises.chooseBool(get.prompt2(event.name)).set('frequentSkill', event.name); - console.log('step 7'); if (repeat) { player.logSkill(event.name); - } + } else return; } - else return event.finish(); + else return; } }, ai:{ diff --git a/game/game.js b/game/game.js index 45e204a9b..f1c7385e7 100644 --- a/game/game.js +++ b/game/game.js @@ -32131,7 +32131,6 @@ new Promise(resolve=>{ event.resolve=resolve; //如果父级事件也是一个异步的话,那应该立即执行这个事件的 if(_status.event.next.includes(event)&&_status.event.content instanceof AsyncFunction){ - // console.log(event, '的父级事件也是一个异步,立即执行这个事件'); if (_status.event != event) { event.parent = _status.event; _status.event = event; @@ -41410,13 +41409,6 @@ new Promise(resolve=>{ lib.status.dateDelayed+=lib.getUTC(new Date())-lib.getUTC(lib.status.dateDelaying); delete lib.status.dateDelaying; } - if (belongAsyncEvent) { - console.log('-----------------------'); - console.log(event); - console.log('event.finished', event.finished); - console.log('event.after:', [...event.after]); - console.log('event.next:', [...event.next]); - } if(event.next.length>0){ var next=event.next.shift(); if(next.player&&next.player.skipList.contains(next.name)){