From f19a5d4f6987c2f6d2078733d5d61686eb1bb8c1 Mon Sep 17 00:00:00 2001 From: Rintim Date: Wed, 17 Apr 2024 13:02:37 +0800 Subject: [PATCH 01/36] fix: prettier format error. --- noname/game/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/noname/game/index.js b/noname/game/index.js index 74b898be0d..002c12b422 100644 --- a/noname/game/index.js +++ b/noname/game/index.js @@ -7308,7 +7308,7 @@ export class Game { for (let i = 0; i < event.config.size; i++) { ui.window.appendChild(event.nodes[i]); } - ("step 1"); + "step 1"; let rand1 = event.config.first; if (rand1 == "rand") { rand1 = Math.random() < 0.5; @@ -7350,7 +7350,7 @@ export class Game { } game.delay(); lib.init.onfree(); - ("step 2"); + "step 2"; if (event.checkredo()) return; if (event._skiprest) return; if (event.side < 2) { @@ -7366,7 +7366,7 @@ export class Game { event.aiMove(); game.delay(); } - ("step 3"); + "step 3"; if (typeof event.fast == "number" && get.time() - event.fast <= 1000) { event.fast = true; } else { @@ -7401,7 +7401,7 @@ export class Game { game.delay(); } } - ("step 4"); + "step 4"; if (event.checkredo()) return; if (event.skipnode) event.skipnode.delete(); if (event.replacenode) event.replacenode.delete(); @@ -7423,7 +7423,7 @@ export class Game { } } game.delay(); - ("step 5"); + "step 5"; event.prompt("选择" + get.cnNumber(event.config.num) + "名出场武将"); event.enemylist = []; for (let i = 0; i < event.avatars.length; i++) { @@ -7453,7 +7453,7 @@ export class Game { event.nodes[i].hide(); } game.pause(); - ("step 6"); + "step 6"; event.promptbar.delete(); if (ui.cardPileButton) ui.cardPileButton.style.display = ""; lib.onresize.remove(event.resize); From 02bf141a6aacd07445514a5a0e69328531192fe0 Mon Sep 17 00:00:00 2001 From: Rintim Date: Wed, 17 Apr 2024 13:03:18 +0800 Subject: [PATCH 02/36] refactor: add `bun.lockb` to ignore list. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index cf3bd6cc25..c8875aef3e 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ noname.ico package-lock.json package.json Thumbs.db +bun.lockb From 196212fa39bd60956dfb0da29f97b98c1d04ec2b Mon Sep 17 00:00:00 2001 From: Rintim Date: Wed, 17 Apr 2024 13:15:00 +0800 Subject: [PATCH 03/36] feat: add new eslint config. --- .eslintrc.json | 2 +- eslint.config.mjs | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 eslint.config.mjs diff --git a/.eslintrc.json b/.eslintrc.json index fde84ce4b7..84e8898fc3 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -31,4 +31,4 @@ "ecmaVersion": 13, "sourceType": "module" } -} \ No newline at end of file +} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000000..127cec053a --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,39 @@ +import js from "@eslint/js"; +import globals from "globals"; + +export default [ + js.configs.recommended, + { + rules: { + "no-console": 0, + "no-constant-condition": [ + "error", + { + checkLoops: false, + }, + ], + "no-irregular-whitespace": [ + "error", + { + skipStrings: true, + skipTemplates: true, + }, + ], + "no-redeclare": 0, + "no-undef": 0, + "no-unused-vars": 0, + "require-yield": 0, + }, + languageOptions: { + ecmaVersion: 13, + sourceType: "module", + globals: { + ...globals.browser, + ...globals.es2015, + ...globals.node, + ...globals.serviceworker, + ...globals.worker, + }, + }, + }, +]; From c82ad68d320375b9e3dcf04e7b82f5db9e815ca6 Mon Sep 17 00:00:00 2001 From: Rintim Date: Wed, 17 Apr 2024 13:15:11 +0800 Subject: [PATCH 04/36] fix: gnc eslint error. --- noname/gnc/index.js | 80 ++++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 38 deletions(-) diff --git a/noname/gnc/index.js b/noname/gnc/index.js index 99460f6ca9..7cbdcebd99 100644 --- a/noname/gnc/index.js +++ b/noname/gnc/index.js @@ -8,45 +8,49 @@ export class GNC { * @returns */ of(fn) { - return this.is.generatorFunc(fn) - ? /** - * @param {Parameters} args - * @returns {Promise>} - */ - function genCoroutine(...args) { - let gen = fn.apply(this, args); - gen.status = "next"; - gen.state = undefined; - const callback = (resolve, reject) => { - let result, - nexts = resolve, - throws = reject; - try { - result = gen[gen.status](gen.state); - } catch (error) { - reject(error); - return; - } - if (!result.done) { - nexts = (item) => { - gen.state = item; - gen.status = "next"; - callback(resolve, reject); - }; - throws = (err) => { - gen.state = err; - gen.status = "throw"; - callback(resolve, reject); - }; - } - result = result.value; - Promise.resolve(result).then(nexts, throws); + /** + * @param {Parameters} args + * @returns {Promise>} + */ + function genCoroutine(...args) { + /** + * @type {Generator & { status: "next" | "throw" , state?: any}} + */ + // @ts-expect-error Must Ok + let gen = fn.apply(this, args); + gen.status = "next"; + gen.state = undefined; + const callback = (resolve, reject) => { + let result, + nexts = resolve, + throws = reject; + try { + result = gen[gen.status](gen.state); + } catch (error) { + reject(error); + return; + } + if (!result.done) { + nexts = (item) => { + gen.state = item; + gen.status = "next"; + callback(resolve, reject); }; - return new Promise(callback); - } - : (() => { - throw new TypeError("gnc.of needs a GeneratorFunction."); - })(); + throws = (err) => { + gen.state = err; + gen.status = "throw"; + callback(resolve, reject); + }; + } + result = result.value; + Promise.resolve(result).then(nexts, throws); + }; + return new Promise(callback); + } + + if (!this.is.generatorFunc(fn)) throw new TypeError("gnc.of needs a GeneratorFunction."); + + return genCoroutine; } is = new Is(); } From 68e8fc89897b1c87afee8409c06e7b0ba06a5e87 Mon Sep 17 00:00:00 2001 From: Rintim Date: Wed, 17 Apr 2024 14:36:01 +0800 Subject: [PATCH 05/36] pref: make prettier to flat config. --- .prettierrc | 12 ------------ prettier.config.mjs | 13 +++++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-) delete mode 100644 .prettierrc create mode 100644 prettier.config.mjs diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index b138a611b1..0000000000 --- a/.prettierrc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "arrowParens": "always", - "bracketSpacing": true, - "endOfLine": "lf", - "printWidth": 110, - "proseWrap": "preserve", - "quoteProps": "as-needed", - "semi": true, - "tabWidth": 4, - "trailingComma": "es5", - "useTabs": true -} diff --git a/prettier.config.mjs b/prettier.config.mjs new file mode 100644 index 0000000000..e8760a4fde --- /dev/null +++ b/prettier.config.mjs @@ -0,0 +1,13 @@ +/** @type {import("prettier").Config} */ +export default { + arrowParens: "always", + bracketSpacing: true, + endOfLine: "lf", + printWidth: 110, + proseWrap: "preserve", + quoteProps: "as-needed", + semi: true, + tabWidth: 4, + trailingComma: "es5", + useTabs: true, +}; From e78f942335ed4101889ca323e96b483804040ac6 Mon Sep 17 00:00:00 2001 From: Rintim Date: Wed, 17 Apr 2024 14:43:56 +0800 Subject: [PATCH 06/36] refactor: new flat config name. --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index d2239a1e25..feaeaf832c 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -32,4 +32,4 @@ - [ ] 如果此次PR需要扩展跟进,我已在`扩展适配`中写入详细文档 - [ ] 如果这个PR解决了一个issue,我在`诱因和背景`中明确链接到该issue - [ ] 我保证该PR中没有随意修改换行符等内容,没有制造出大量的Diff -- [ ] 我保证该PR遵循项目中`.editorconfig`、`.eslintrc.json`和`.prettierrc`所规定的代码样式,并且已经通过`prettier`格式化过代码 +- [ ] 我保证该PR遵循项目中`.editorconfig`、`eslint.config.mjs`和`prettier.config.mjs`所规定的代码样式,并且已经通过`prettier`格式化过代码 From 15d15cdc69a87bf39814fbce4c688f71fdc0c45f Mon Sep 17 00:00:00 2001 From: Rintim Date: Wed, 17 Apr 2024 14:50:16 +0800 Subject: [PATCH 07/36] fix: format. --- character/rank.js | 4 +- character/sp.js | 316 ++++++++++++++++++++++++++++------------------ 2 files changed, 193 insertions(+), 127 deletions(-) diff --git a/character/rank.js b/character/rank.js index 04ecef1a0c..3ad34972e2 100644 --- a/character/rank.js +++ b/character/rank.js @@ -1,6 +1,6 @@ window.noname_character_rank = { s: [ - 'sp_sunce', + "sp_sunce", "gjqt_bailitusu", "gjqt_beiluo", "gjqt_xieyi", @@ -1720,7 +1720,7 @@ window.noname_character_rank = { ], rarity: { legend: [ - 'sp_sunce', + "sp_sunce", "star_caoren", "dc_zhaoyun", "dc_caocao", diff --git a/character/sp.js b/character/sp.js index 0caadc3a33..fdad5ff70f 100755 --- a/character/sp.js +++ b/character/sp.js @@ -143,7 +143,7 @@ game.import("character", function () { "sp_zhangliao", "sp_ol_zhanghe", "sp_menghuo", - 'sp_sunce', + "sp_sunce", ], sp_qifu: [ "ol_feiyi", @@ -184,12 +184,12 @@ game.import("character", function () { ol_mengda(mode) { return mode !== "guozhan"; }, - ol_mengda(mode){ - return mode!=='guozhan'; + ol_mengda(mode) { + return mode !== "guozhan"; }, }, character: { - sp_sunce:['male','qun',4,['olliantao']], + sp_sunce: ["male", "qun", 4, ["olliantao"]], ol_liupi: ["male", "qun", 4, ["olyicheng"]], ol_lukai: ["male", "wu", 3, ["olxuanzhu", "oljiane"]], liupan: ["male", "qun", 4, ["olpijing"]], @@ -968,117 +968,177 @@ game.import("character", function () { }, skill: { //SP孙策 - olliantao:{ - audio:2, - trigger:{player:'phaseUseBegin'}, - filter(event,player){ - return game.hasPlayer(target=>target!=player); - }, - async cost(event,trigger,player){ - event.result=await player.chooseTarget(get.prompt2('olliantao'),lib.filter.notMe).set('ai',target=>{ - const player=get.event('player'),att=get.attitude(player,target); - const colors=Object.keys(lib.color).filter(i=>i!='none'); - if(!colors.some(color=>player.hasCard(card=>{ - const juedou=get.autoViewAs({name:'juedou'},[card]); - return player.canUse(juedou,target,false); - },'h'))) return 20+(3-get.sgn(att))+Math.random(); - const effs=colors.reduce((list,color)=>{ - const cards=player.getCards('h',card=>{ - const juedou=get.autoViewAs({name:'juedou'},[card]); - return player.canUse(juedou,target,false); - }); - if(cards.length){ - list.push(cards.reduce((sum,card)=>{ - const juedou=get.autoViewAs({name:'juedou'},[card]); - return sum+get.effect(target,card,player,player); - },0)); - } - return list; - },[]); - return Math[att>0?'max':'min'].apply(Math,list); - }).forResult(); - }, - async content(event,trigger,player){ - const target=event.targets[0]; - const colors=Object.keys(lib.color).filter(i=>i!='none'); - if(colors.length&&player.countCards('h')){ - const result=await target.chooseControl(colors) - .set('prompt','连讨:请选择一个颜色').set('ai',()=>{ - const player=get.event('player'),source=get.event().getParent().player; - let controls=get.event('controls').slice(); - if(controls.length==1) return controls[0]; - const getSum=function(color,player,source){ - return source.getCards('h',card=>{ - if(get.color(card)!=color) return false; - const juedou=get.autoViewAs({name:'juedou'},[card]); - return source.canUse(juedou,player,false); - }).reduce((num,card)=>{ - const juedou=get.autoViewAs({name:'juedou'},[card]); - return num+get.effect(player,card,source,player); - },0); - }; - return controls.sort((a,b)=>getSum(b,player,source)-getSum(a,player,source))[0]; - }).set('prompt2',get.translation(player)+'将对你依次使用由其手牌中所有此颜色的牌转化的【决斗】').forResult(); - const color=result.control; - game.broadcastAll((color,target)=>{ - lib.skill.olliantao_backup.filterCardx=[color,target]; - lib.skill.olliantao_backup.filterCard=function(card,player){ - const list=lib.skill.olliantao_backup.filterCardx; - if(get.color(card)!=list[0]) return false; - const juedou=get.autoViewAs({name:'juedou'},[card]); - return player.canUse(juedou,list[1],false); - }; - },color,target); - while(target.isIn()&&player.hasCard(card=>lib.skill.olliantao_backup.filterCard(card,player))&&!game.getGlobalHistory('everything',evt=>{ - return evt.name=='dying'&&[player,target].includes(evt.player)&&evt.getParent('olliantao')==event; - }).length){ - await player.chooseToUse().set('forced',true) - .set('openskilldialog','连讨:将一张'+get.translation(color)+'手牌当作【决斗】对'+get.translation(target)+'使用') - .set('norestore',true).set('_backupevent','olliantao_backup').set('custom',{ - add:{}, - replace:{window:function(){}}, - }).backup('olliantao_backup').set('targetRequired',true).set('complexSelect',true) - .set('filterTarget',function(card,player,target){ - if(target!=_status.event.sourcex&&!ui.selected.targets.includes(_status.event.sourcex)) return false; - return lib.filter.targetEnabled.apply(this, arguments); - }).set('sourcex',target).set('addCount',false); - } - } - const num=player.getHistory('sourceDamage',evt=>{ - return evt.getParent(4)==event; - }).reduce((sum,evt)=>sum+evt.num,0); - if(num) await player.draw(num); - if(!game.hasPlayer2(current=>{ - return current.getHistory('damage',evt=>{ - return evt.getParent(4)==event; - }).length; - })){ + olliantao: { + audio: 2, + trigger: { player: "phaseUseBegin" }, + filter(event, player) { + return game.hasPlayer((target) => target != player); + }, + async cost(event, trigger, player) { + event.result = await player + .chooseTarget(get.prompt2("olliantao"), lib.filter.notMe) + .set("ai", (target) => { + const player = get.event("player"), + att = get.attitude(player, target); + const colors = Object.keys(lib.color).filter((i) => i != "none"); + if ( + !colors.some((color) => + player.hasCard((card) => { + const juedou = get.autoViewAs({ name: "juedou" }, [card]); + return player.canUse(juedou, target, false); + }, "h") + ) + ) + return 20 + (3 - get.sgn(att)) + Math.random(); + const effs = colors.reduce((list, color) => { + const cards = player.getCards("h", (card) => { + const juedou = get.autoViewAs({ name: "juedou" }, [card]); + return player.canUse(juedou, target, false); + }); + if (cards.length) { + list.push( + cards.reduce((sum, card) => { + const juedou = get.autoViewAs({ name: "juedou" }, [card]); + return sum + get.effect(target, card, player, player); + }, 0) + ); + } + return list; + }, []); + return Math[att > 0 ? "max" : "min"].apply(Math, list); + }) + .forResult(); + }, + async content(event, trigger, player) { + const target = event.targets[0]; + const colors = Object.keys(lib.color).filter((i) => i != "none"); + if (colors.length && player.countCards("h")) { + const result = await target + .chooseControl(colors) + .set("prompt", "连讨:请选择一个颜色") + .set("ai", () => { + const player = get.event("player"), + source = get.event().getParent().player; + let controls = get.event("controls").slice(); + if (controls.length == 1) return controls[0]; + const getSum = function (color, player, source) { + return source + .getCards("h", (card) => { + if (get.color(card) != color) return false; + const juedou = get.autoViewAs({ name: "juedou" }, [card]); + return source.canUse(juedou, player, false); + }) + .reduce((num, card) => { + const juedou = get.autoViewAs({ name: "juedou" }, [card]); + return num + get.effect(player, card, source, player); + }, 0); + }; + return controls.sort( + (a, b) => getSum(b, player, source) - getSum(a, player, source) + )[0]; + }) + .set( + "prompt2", + get.translation(player) + + "将对你依次使用由其手牌中所有此颜色的牌转化的【决斗】" + ) + .forResult(); + const color = result.control; + game.broadcastAll( + (color, target) => { + lib.skill.olliantao_backup.filterCardx = [color, target]; + lib.skill.olliantao_backup.filterCard = function (card, player) { + const list = lib.skill.olliantao_backup.filterCardx; + if (get.color(card) != list[0]) return false; + const juedou = get.autoViewAs({ name: "juedou" }, [card]); + return player.canUse(juedou, list[1], false); + }; + }, + color, + target + ); + while ( + target.isIn() && + player.hasCard((card) => lib.skill.olliantao_backup.filterCard(card, player)) && + !game.getGlobalHistory("everything", (evt) => { + return ( + evt.name == "dying" && + [player, target].includes(evt.player) && + evt.getParent("olliantao") == event + ); + }).length + ) { + await player + .chooseToUse() + .set("forced", true) + .set( + "openskilldialog", + "连讨:将一张" + + get.translation(color) + + "手牌当作【决斗】对" + + get.translation(target) + + "使用" + ) + .set("norestore", true) + .set("_backupevent", "olliantao_backup") + .set("custom", { + add: {}, + replace: { window: function () {} }, + }) + .backup("olliantao_backup") + .set("targetRequired", true) + .set("complexSelect", true) + .set("filterTarget", function (card, player, target) { + if ( + target != _status.event.sourcex && + !ui.selected.targets.includes(_status.event.sourcex) + ) + return false; + return lib.filter.targetEnabled.apply(this, arguments); + }) + .set("sourcex", target) + .set("addCount", false); + } + } + const num = player + .getHistory("sourceDamage", (evt) => { + return evt.getParent(4) == event; + }) + .reduce((sum, evt) => sum + evt.num, 0); + if (num) await player.draw(num); + if ( + !game.hasPlayer2((current) => { + return current.getHistory("damage", (evt) => { + return evt.getParent(4) == event; + }).length; + }) + ) { await player.draw(3); - player.addTempSkill('olliantao_buff'); - player.addMark('olliantao_buff',3,false); + player.addTempSkill("olliantao_buff"); + player.addMark("olliantao_buff", 3, false); } }, - subSkill:{ - backup:{ - viewAs:{name:'juedou'}, - position:'h', - check:()=>1+Math.random(), - precontent(){ + subSkill: { + backup: { + viewAs: { name: "juedou" }, + position: "h", + check: () => 1 + Math.random(), + precontent() { delete event.result.skill; }, }, - buff:{ - charlotte:true, - onremove:true, - mod:{ - maxHandcard(player,num){ - return num+player.countMark('olliantao_buff'); + buff: { + charlotte: true, + onremove: true, + mod: { + maxHandcard(player, num) { + return num + player.countMark("olliantao_buff"); }, - cardEnabled(card){ - if(card.name=='sha') return false; + cardEnabled(card) { + if (card.name == "sha") return false; }, }, - intro:{content:'手牌上限+#,不能使用【杀】'}, + intro: { content: "手牌上限+#,不能使用【杀】" }, }, }, }, @@ -3056,7 +3116,7 @@ game.import("character", function () { ? "" : `。若${get.translation( trigger.player - )}受到了此【杀】的伤害,你获得其一张牌。` + )}受到了此【杀】的伤害,你获得其一张牌。` }` ); next.set("norestore", true); @@ -3395,9 +3455,8 @@ game.import("character", function () { ]; [0, 1, 2].forEach((item, index) => { if (event.list.includes(item)) { - choiceList[ - index - ] = `${choiceList[index]}`; + choiceList[index] = + `${choiceList[index]}`; } else choices.push(`选项${get.cnNumber(index + 1, true)}`); }); game.me @@ -7028,7 +7087,7 @@ game.import("character", function () { delete stat.gushe; }, ai: { - combo: "gushe" + combo: "gushe", }, }, //OL刘老板 @@ -12778,10 +12837,13 @@ game.import("character", function () { (_status.connectMode || current.hasSha()) ) { current - .chooseToUse(function (card, player, event) { - if (get.name(card) != "sha") return false; - return lib.filter.filterCard.apply(this, arguments); - }, "同协:是否对" + get.translation(target) + "使用一张杀?") + .chooseToUse( + function (card, player, event) { + if (get.name(card) != "sha") return false; + return lib.filter.filterCard.apply(this, arguments); + }, + "同协:是否对" + get.translation(target) + "使用一张杀?" + ) .set("targetRequired", true) .set("complexSelect", true) .set("filterTarget", function (card, player, target) { @@ -17318,10 +17380,13 @@ game.import("character", function () { "step 0"; var target = trigger.targets[0]; target - .chooseToUse(function (card, player, event) { - if (get.name(card) != "sha") return false; - return lib.filter.filterCard.apply(this, arguments); - }, "武娘:是否对" + get.translation(player) + "使用一张杀?") + .chooseToUse( + function (card, player, event) { + if (get.name(card) != "sha") return false; + return lib.filter.filterCard.apply(this, arguments); + }, + "武娘:是否对" + get.translation(player) + "使用一张杀?" + ) .set("targetRequired", true) .set("complexSelect", true) .set("filterTarget", function (card, player, target) { @@ -21948,7 +22013,7 @@ game.import("character", function () { }, }, ai: { - combo: "wylianji" + combo: "wylianji", }, }, jingong: { @@ -28882,7 +28947,7 @@ game.import("character", function () { player.changeSkills(["xiaoji"], ["liangzhu"]); }, ai: { - combo: "liangzhu" + combo: "liangzhu", }, }, mingshi: { @@ -34505,10 +34570,11 @@ game.import("character", function () { olyicheng: "易城", olyicheng_info: "出牌阶段限一次,你可以亮出牌堆顶的三张牌,然后你可以以任意手牌交换这些牌,若这三张牌的点数和因此增加,则你可以选择用所有手牌交换这三张牌。最后你将这三张牌置于牌堆顶。", - sp_sunce:'SP孙策', - sp_sunce_prefix:'SP', - olliantao:'连讨', - olliantao_info:'出牌阶段开始时,你可以令一名其他角色选择一个颜色,然后你依次将此颜色的所有手牌当作【决斗】对其使用直到有一方进入濒死状态,然后你摸X张牌(X为你本次以此法造成的伤害数)。若没有角色因本次技能结算受到伤害,你摸三张牌,本回合手牌上限+3且本回合你不能使用【杀】。', + sp_sunce: "SP孙策", + sp_sunce_prefix: "SP", + olliantao: "连讨", + olliantao_info: + "出牌阶段开始时,你可以令一名其他角色选择一个颜色,然后你依次将此颜色的所有手牌当作【决斗】对其使用直到有一方进入濒死状态,然后你摸X张牌(X为你本次以此法造成的伤害数)。若没有角色因本次技能结算受到伤害,你摸三张牌,本回合手牌上限+3且本回合你不能使用【杀】。", sp_tianji: "天极·皇室宗亲", sp_sibi: "四弼·辅国文曲", From 615459efb4a4defaf0f386e59b84f6de5f3b30dd Mon Sep 17 00:00:00 2001 From: nonameShijian <2954700422@qq.com> Date: Wed, 17 Apr 2024 22:04:49 +0800 Subject: [PATCH 08/36] =?UTF-8?q?=E5=AE=89=E5=8D=9313=E6=9D=83=E9=99=90?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=EF=BC=8C=E5=A2=9E=E5=8A=A0=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- node_modules/@types/noname-typings/index.d.ts | 2 + .../@types/noname-typings/windowEx.d.ts | 2 + noname/init/cordova.js | 38 ++++++++++++------- 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/node_modules/@types/noname-typings/index.d.ts b/node_modules/@types/noname-typings/index.d.ts index 387ebd5ce6..c89de0bb47 100644 --- a/node_modules/@types/noname-typings/index.d.ts +++ b/node_modules/@types/noname-typings/index.d.ts @@ -9,6 +9,8 @@ /// /// /// +/// +/// /// /// /// diff --git a/node_modules/@types/noname-typings/windowEx.d.ts b/node_modules/@types/noname-typings/windowEx.d.ts index fca9c3721b..f089f64781 100644 --- a/node_modules/@types/noname-typings/windowEx.d.ts +++ b/node_modules/@types/noname-typings/windowEx.d.ts @@ -70,4 +70,6 @@ declare interface Window { initReadWriteFunction?(game: Game): Promise; bannedKeyWords: string[]; + + device: Device; } diff --git a/noname/init/cordova.js b/noname/init/cordova.js index 73e8904b28..97da9302a9 100644 --- a/noname/init/cordova.js +++ b/noname/init/cordova.js @@ -1,10 +1,10 @@ -// @ts-nocheck import { get } from "../get/index.js"; import { lib } from "../library/index.js"; import { game } from "../game/index.js"; import { _status } from "../status/index.js"; import { ui } from "../ui/index.js"; import { nonameInitialized } from "../util/index.js"; +import { checkVersion } from "../library/update.js"; export async function cordovaReady() { if (lib.device == "android") { @@ -49,18 +49,30 @@ export async function cordovaReady() { if ("cordova" in window && "plugins" in window.cordova && "permissions" in window.cordova.plugins) { const permissions = cordova.plugins.permissions; const requests = ["WRITE_EXTERNAL_STORAGE", "READ_EXTERNAL_STORAGE"]; - requests.forEach((request) => { - permissions.checkPermission( - permissions[request], - (status) => { - if (!status.hasPermission) { - permissions.requestPermission( - permissions[request], - lib.other.ignore, - lib.other.ignore - ); - } - }, + if (typeof device == 'object') { + // 安卓13或以上 + if (checkVersion(device.version, "13") >= 0) { + requests.length = 0; + requests.push('READ_MEDIA_IMAGES', 'READ_MEDIA_VIDEO', 'READ_MEDIA_AUDIO'); + } + } + Promise.all(requests.map(request => { + return new Promise((resolve, reject) => { + permissions.checkPermission(permissions[request], status => { + resolve({ + request: request, + hasPermission: status.hasPermission + }); + }, lib.other.ignore); + }); + })).then(shouldRequestPermissions => { + return shouldRequestPermissions + .filter(({ hasPermission }) => !hasPermission) + .map(({ request }) => permissions[request]); + }).then(willRequestPermissions => { + permissions.requestPermissions( + willRequestPermissions, + lib.other.ignore, lib.other.ignore ); }); From e45249f38394bf0473cef50c6a147cb06c278948 Mon Sep 17 00:00:00 2001 From: nonameShijian <2954700422@qq.com> Date: Wed, 17 Apr 2024 22:07:56 +0800 Subject: [PATCH 09/36] =?UTF-8?q?=E4=BD=8E=E7=89=88=E6=9C=ACpermissions?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- noname/init/cordova.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noname/init/cordova.js b/noname/init/cordova.js index 97da9302a9..8f350596f5 100644 --- a/noname/init/cordova.js +++ b/noname/init/cordova.js @@ -68,7 +68,7 @@ export async function cordovaReady() { })).then(shouldRequestPermissions => { return shouldRequestPermissions .filter(({ hasPermission }) => !hasPermission) - .map(({ request }) => permissions[request]); + .map(({ request }) => permissions[request] || `android.permission.${request}`); }).then(willRequestPermissions => { permissions.requestPermissions( willRequestPermissions, From 4a25a2793dde546c76d2235e93b63a4a48141475 Mon Sep 17 00:00:00 2001 From: nonameShijian <2954700422@qq.com> Date: Wed, 17 Apr 2024 22:27:00 +0800 Subject: [PATCH 10/36] =?UTF-8?q?=E4=BD=BF=E7=94=A8reject=E8=80=8C?= =?UTF-8?q?=E4=B8=8D=E6=98=AFlib.other.ignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- noname/init/cordova.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/noname/init/cordova.js b/noname/init/cordova.js index 8f350596f5..da48c7f7e1 100644 --- a/noname/init/cordova.js +++ b/noname/init/cordova.js @@ -63,7 +63,7 @@ export async function cordovaReady() { request: request, hasPermission: status.hasPermission }); - }, lib.other.ignore); + }, reject); }); })).then(shouldRequestPermissions => { return shouldRequestPermissions @@ -75,7 +75,7 @@ export async function cordovaReady() { lib.other.ignore, lib.other.ignore ); - }); + }).catch(console.log); } } game.download = function (url, folder, onsuccess, onerror, dev, onprogress) { From 2e5a95caf7e173b25c37f900853dd2545b48117f Mon Sep 17 00:00:00 2001 From: nonameShijian <2954700422@qq.com> Date: Wed, 17 Apr 2024 22:29:32 +0800 Subject: [PATCH 11/36] add type --- .../cordova-plugin-android-permissions.d.ts | 197 ++++++++++++++++++ .../noname-typings/cordova-plugin-device.d.ts | 35 ++++ 2 files changed, 232 insertions(+) create mode 100644 node_modules/@types/noname-typings/cordova-plugin-android-permissions.d.ts create mode 100644 node_modules/@types/noname-typings/cordova-plugin-device.d.ts diff --git a/node_modules/@types/noname-typings/cordova-plugin-android-permissions.d.ts b/node_modules/@types/noname-typings/cordova-plugin-android-permissions.d.ts new file mode 100644 index 0000000000..7c8af5f8b5 --- /dev/null +++ b/node_modules/@types/noname-typings/cordova-plugin-android-permissions.d.ts @@ -0,0 +1,197 @@ +// from npm @types/cordova-plugin-android-permissions + +interface PermissionStatus { + hasPermission: boolean; +} + +interface Permissions { + ACCESS_CHECKIN_PROPERTIES: "android.permission.ACCESS_CHECKIN_PROPERTIES"; + ACCESS_BACKGROUND_LOCATION: "android.permission.ACCESS_BACKGROUND_LOCATION"; + ACCESS_COARSE_LOCATION: "android.permission.ACCESS_COARSE_LOCATION"; + ACCESS_FINE_LOCATION: "android.permission.ACCESS_FINE_LOCATION"; + ACCESS_LOCATION_EXTRA_COMMANDS: "android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"; + ACCESS_MOCK_LOCATION: "android.permission.ACCESS_MOCK_LOCATION"; + ACCESS_NETWORK_STATE: "android.permission.ACCESS_NETWORK_STATE"; + ACCESS_SURFACE_FLINGER: "android.permission.ACCESS_SURFACE_FLINGER"; + ACCESS_WIFI_STATE: "android.permission.ACCESS_WIFI_STATE"; + ACCOUNT_MANAGER: "android.permission.ACCOUNT_MANAGER"; + ACTIVITY_RECOGNITION: "android.permission.ACTIVITY_RECOGNITION"; + ADD_VOICEMAIL: "com.android.voicemail.permission.ADD_VOICEMAIL"; + AUTHENTICATE_ACCOUNTS: "android.permission.AUTHENTICATE_ACCOUNTS"; + BATTERY_STATS: "android.permission.BATTERY_STATS"; + BIND_ACCESSIBILITY_SERVICE: "android.permission.BIND_ACCESSIBILITY_SERVICE"; + BIND_APPWIDGET: "android.permission.BIND_APPWIDGET"; + BIND_CARRIER_MESSAGING_SERVICE: "android.permission.BIND_CARRIER_MESSAGING_SERVICE"; + BIND_DEVICE_ADMIN: "android.permission.BIND_DEVICE_ADMIN"; + BIND_DREAM_SERVICE: "android.permission.BIND_DREAM_SERVICE"; + BIND_INPUT_METHOD: "android.permission.BIND_INPUT_METHOD"; + BIND_NFC_SERVICE: "android.permission.BIND_NFC_SERVICE"; + BIND_NOTIFICATION_LISTENER_SERVICE: "android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"; + BIND_PRINT_SERVICE: "android.permission.BIND_PRINT_SERVICE"; + BIND_REMOTEVIEWS: "android.permission.BIND_REMOTEVIEWS"; + BIND_TEXT_SERVICE: "android.permission.BIND_TEXT_SERVICE"; + BIND_TV_INPUT: "android.permission.BIND_TV_INPUT"; + BIND_VOICE_INTERACTION: "android.permission.BIND_VOICE_INTERACTION"; + BIND_VPN_SERVICE: "android.permission.BIND_VPN_SERVICE"; + BIND_WALLPAPER: "android.permission.BIND_WALLPAPER"; + BLUETOOTH: "android.permission.BLUETOOTH"; + BLUETOOTH_ADMIN: "android.permission.BLUETOOTH_ADMIN"; + BLUETOOTH_ADVERTISE: "android.permission.BLUETOOTH_ADVERTISE"; + BLUETOOTH_CONNECT: "android.permission.BLUETOOTH_CONNECT"; + BLUETOOTH_PRIVILEGED: "android.permission.BLUETOOTH_PRIVILEGED"; + BLUETOOTH_SCAN: "android.permission.BLUETOOTH_SCAN"; + BODY_SENSORS: "android.permission.BODY_SENSORS"; + BRICK: "android.permission.BRICK"; + BROADCAST_PACKAGE_REMOVED: "android.permission.BROADCAST_PACKAGE_REMOVED"; + BROADCAST_SMS: "android.permission.BROADCAST_SMS"; + BROADCAST_STICKY: "android.permission.BROADCAST_STICKY"; + BROADCAST_WAP_PUSH: "android.permission.BROADCAST_WAP_PUSH"; + CALL_PHONE: "android.permission.CALL_PHONE"; + CALL_PRIVILEGED: "android.permission.CALL_PRIVILEGED"; + CAMERA: "android.permission.CAMERA"; + CAPTURE_AUDIO_OUTPUT: "android.permission.CAPTURE_AUDIO_OUTPUT"; + CAPTURE_SECURE_VIDEO_OUTPUT: "android.permission.CAPTURE_SECURE_VIDEO_OUTPUT"; + CAPTURE_VIDEO_OUTPUT: "android.permission.CAPTURE_VIDEO_OUTPUT"; + CHANGE_COMPONENT_ENABLED_STATE: "android.permission.CHANGE_COMPONENT_ENABLED_STATE"; + CHANGE_CONFIGURATION: "android.permission.CHANGE_CONFIGURATION"; + CHANGE_NETWORK_STATE: "android.permission.CHANGE_NETWORK_STATE"; + CHANGE_WIFI_MULTICAST_STATE: "android.permission.CHANGE_WIFI_MULTICAST_STATE"; + CHANGE_WIFI_STATE: "android.permission.CHANGE_WIFI_STATE"; + CLEAR_APP_CACHE: "android.permission.CLEAR_APP_CACHE"; + CLEAR_APP_USER_DATA: "android.permission.CLEAR_APP_USER_DATA"; + CONTROL_LOCATION_UPDATES: "android.permission.CONTROL_LOCATION_UPDATES"; + DELETE_CACHE_FILES: "android.permission.DELETE_CACHE_FILES"; + DELETE_PACKAGES: "android.permission.DELETE_PACKAGES"; + DEVICE_POWER: "android.permission.DEVICE_POWER"; + DIAGNOSTIC: "android.permission.DIAGNOSTIC"; + DISABLE_KEYGUARD: "android.permission.DISABLE_KEYGUARD"; + DUMP: "android.permission.DUMP"; + EXPAND_STATUS_BAR: "android.permission.EXPAND_STATUS_BAR"; + FACTORY_TEST: "android.permission.FACTORY_TEST"; + FLASHLIGHT: "android.permission.FLASHLIGHT"; + FORCE_BACK: "android.permission.FORCE_BACK"; + GET_ACCOUNTS: "android.permission.GET_ACCOUNTS"; + GET_PACKAGE_SIZE: "android.permission.GET_PACKAGE_SIZE"; + GET_TASKS: "android.permission.GET_TASKS"; + GET_TOP_ACTIVITY_INFO: "android.permission.GET_TOP_ACTIVITY_INFO"; + GLOBAL_SEARCH: "android.permission.GLOBAL_SEARCH"; + HARDWARE_TEST: "android.permission.HARDWARE_TEST"; + INJECT_EVENTS: "android.permission.INJECT_EVENTS"; + INSTALL_LOCATION_PROVIDER: "android.permission.INSTALL_LOCATION_PROVIDER"; + INSTALL_PACKAGES: "android.permission.INSTALL_PACKAGES"; + INSTALL_SHORTCUT: "com.android.launcher.permission.INSTALL_SHORTCUT"; + INTERNAL_SYSTEM_WINDOW: "android.permission.INTERNAL_SYSTEM_WINDOW"; + INTERNET: "android.permission.INTERNET"; + KILL_BACKGROUND_PROCESSES: "android.permission.KILL_BACKGROUND_PROCESSES"; + LOCATION_HARDWARE: "android.permission.LOCATION_HARDWARE"; + MANAGE_ACCOUNTS: "android.permission.MANAGE_ACCOUNTS"; + MANAGE_APP_TOKENS: "android.permission.MANAGE_APP_TOKENS"; + MANAGE_DOCUMENTS: "android.permission.MANAGE_DOCUMENTS"; + MASTER_CLEAR: "android.permission.MASTER_CLEAR"; + MEDIA_CONTENT_CONTROL: "android.permission.MEDIA_CONTENT_CONTROL"; + MODIFY_AUDIO_SETTINGS: "android.permission.MODIFY_AUDIO_SETTINGS"; + MODIFY_PHONE_STATE: "android.permission.MODIFY_PHONE_STATE"; + MOUNT_FORMAT_FILESYSTEMS: "android.permission.MOUNT_FORMAT_FILESYSTEMS"; + MOUNT_UNMOUNT_FILESYSTEMS: "android.permission.MOUNT_UNMOUNT_FILESYSTEMS"; + NFC: "android.permission.NFC"; + PERSISTENT_ACTIVITY: "android.permission.PERSISTENT_ACTIVITY"; + POST_NOTIFICATIONS: "android.permission.POST_NOTIFICATIONS"; + PROCESS_OUTGOING_CALLS: "android.permission.PROCESS_OUTGOING_CALLS"; + READ_CALENDAR: "android.permission.READ_CALENDAR"; + READ_CALL_LOG: "android.permission.READ_CALL_LOG"; + READ_CONTACTS: "android.permission.READ_CONTACTS"; + READ_EXTERNAL_STORAGE: "android.permission.READ_EXTERNAL_STORAGE"; + READ_FRAME_BUFFER: "android.permission.READ_FRAME_BUFFER"; + READ_HISTORY_BOOKMARKS: "com.android.browser.permission.READ_HISTORY_BOOKMARKS"; + READ_INPUT_STATE: "android.permission.READ_INPUT_STATE"; + READ_LOGS: "android.permission.READ_LOGS"; + READ_MEDIA_AUDIO: "android.permission.READ_MEDIA_AUDIO"; + READ_MEDIA_IMAGES: "android.permission.READ_MEDIA_IMAGES"; + READ_MEDIA_VIDEO: "android.permission.READ_MEDIA_VIDEO"; + READ_PHONE_STATE: "android.permission.READ_PHONE_STATE"; + READ_PROFILE: "android.permission.READ_PROFILE"; + READ_SMS: "android.permission.READ_SMS"; + READ_SOCIAL_STREAM: "android.permission.READ_SOCIAL_STREAM"; + READ_SYNC_SETTINGS: "android.permission.READ_SYNC_SETTINGS"; + READ_SYNC_STATS: "android.permission.READ_SYNC_STATS"; + READ_USER_DICTIONARY: "android.permission.READ_USER_DICTIONARY"; + READ_VOICEMAIL: "com.android.voicemail.permission.READ_VOICEMAIL"; + REBOOT: "android.permission.REBOOT"; + RECEIVE_BOOT_COMPLETED: "android.permission.RECEIVE_BOOT_COMPLETED"; + RECEIVE_MMS: "android.permission.RECEIVE_MMS"; + RECEIVE_SMS: "android.permission.RECEIVE_SMS"; + RECEIVE_WAP_PUSH: "android.permission.RECEIVE_WAP_PUSH"; + RECORD_AUDIO: "android.permission.RECORD_AUDIO"; + REORDER_TASKS: "android.permission.REORDER_TASKS"; + RESTART_PACKAGES: "android.permission.RESTART_PACKAGES"; + SEND_RESPOND_VIA_MESSAGE: "android.permission.SEND_RESPOND_VIA_MESSAGE"; + SEND_SMS: "android.permission.SEND_SMS"; + SET_ACTIVITY_WATCHER: "android.permission.SET_ACTIVITY_WATCHER"; + SET_ALARM: "com.android.alarm.permission.SET_ALARM"; + SET_ALWAYS_FINISH: "android.permission.SET_ALWAYS_FINISH"; + SET_ANIMATION_SCALE: "android.permission.SET_ANIMATION_SCALE"; + SET_DEBUG_APP: "android.permission.SET_DEBUG_APP"; + SET_ORIENTATION: "android.permission.SET_ORIENTATION"; + SET_POINTER_SPEED: "android.permission.SET_POINTER_SPEED"; + SET_PREFERRED_APPLICATIONS: "android.permission.SET_PREFERRED_APPLICATIONS"; + SET_PROCESS_LIMIT: "android.permission.SET_PROCESS_LIMIT"; + SET_TIME: "android.permission.SET_TIME"; + SET_TIME_ZONE: "android.permission.SET_TIME_ZONE"; + SET_WALLPAPER: "android.permission.SET_WALLPAPER"; + SET_WALLPAPER_HINTS: "android.permission.SET_WALLPAPER_HINTS"; + SIGNAL_PERSISTENT_PROCESSES: "android.permission.SIGNAL_PERSISTENT_PROCESSES"; + STATUS_BAR: "android.permission.STATUS_BAR"; + SUBSCRIBED_FEEDS_READ: "android.permission.SUBSCRIBED_FEEDS_READ"; + SUBSCRIBED_FEEDS_WRITE: "android.permission.SUBSCRIBED_FEEDS_WRITE"; + SYSTEM_ALERT_WINDOW: "android.permission.SYSTEM_ALERT_WINDOW"; + TRANSMIT_IR: "android.permission.TRANSMIT_IR"; + UNINSTALL_SHORTCUT: "com.android.launcher.permission.UNINSTALL_SHORTCUT"; + UPDATE_DEVICE_STATS: "android.permission.UPDATE_DEVICE_STATS"; + USE_CREDENTIALS: "android.permission.USE_CREDENTIALS"; + USE_SIP: "android.permission.USE_SIP"; + VIBRATE: "android.permission.VIBRATE"; + WAKE_LOCK: "android.permission.WAKE_LOCK"; + WRITE_APN_SETTINGS: "android.permission.WRITE_APN_SETTINGS"; + WRITE_CALENDAR: "android.permission.WRITE_CALENDAR"; + WRITE_CALL_LOG: "android.permission.WRITE_CALL_LOG"; + WRITE_CONTACTS: "android.permission.WRITE_CONTACTS"; + WRITE_EXTERNAL_STORAGE: "android.permission.WRITE_EXTERNAL_STORAGE"; + WRITE_GSERVICES: "android.permission.WRITE_GSERVICES"; + WRITE_HISTORY_BOOKMARKS: "com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"; + WRITE_PROFILE: "android.permission.WRITE_PROFILE"; + WRITE_SECURE_SETTINGS: "android.permission.WRITE_SECURE_SETTINGS"; + WRITE_SETTINGS: "android.permission.WRITE_SETTINGS"; + WRITE_SMS: "android.permission.WRITE_SMS"; + WRITE_SOCIAL_STREAM: "android.permission.WRITE_SOCIAL_STREAM"; + WRITE_SYNC_SETTINGS: "android.permission.WRITE_SYNC_SETTINGS"; + WRITE_USER_DICTIONARY: "android.permission.WRITE_USER_DICTIONARY"; + WRITE_VOICEMAIL: "com.android.voicemail.permission.WRITE_VOICEMAIL"; + + checkPermission: ( + permission: string, + successCallback: (status: PermissionStatus) => void, + errorCallback: () => void + ) => void; + + requestPermission: ( + permission: string, + successCallback: (status: PermissionStatus) => void, + errorCallback: () => void + ) => void; + + requestPermissions: ( + permissions: string[], + successCallback: (status: PermissionStatus) => void, + errorCallback: () => void + ) => void; + + hasPermission: ( + permission: string, + successCallback: (status: PermissionStatus) => void, + errorCallback: () => void + ) => void; +} + +interface CordovaPlugins { + permissions: Permissions; +} \ No newline at end of file diff --git a/node_modules/@types/noname-typings/cordova-plugin-device.d.ts b/node_modules/@types/noname-typings/cordova-plugin-device.d.ts new file mode 100644 index 0000000000..7b6a2b5ba0 --- /dev/null +++ b/node_modules/@types/noname-typings/cordova-plugin-device.d.ts @@ -0,0 +1,35 @@ +// Type definitions for cordova-plugin-device +// Project: https://github.com/apache/cordova-plugin-device +// Definitions by: Microsoft Open Technologies Inc +// Tim Brust +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * This plugin defines a global device object, which describes the device's hardware and software. + * Although the object is in the global scope, it is not available until after the deviceready event. + */ +interface Device { + /** Get the version of Cordova running on the device. */ + cordova: string; + /** Indicates that Cordova initialize successfully. */ + available: boolean; + /** + * The device.model returns the name of the device's model or product. The value is set + * by the device manufacturer and may be different across versions of the same product. + */ + model: string; + /** Get the device's operating system name. */ + platform: string; + /** Get the device's Universally Unique Identifier (UUID). */ + uuid: string; + /** Get the operating system version. */ + version: string; + /** Get the device's manufacturer. */ + manufacturer: string; + /** Whether the device is running on a simulator. */ + isVirtual: boolean; + /** Get the device hardware serial number. */ + serial: string; +} + +declare var device: Device; \ No newline at end of file From 7a1f5fbd6c6165f167cfa2802e1d8311a25b28a4 Mon Sep 17 00:00:00 2001 From: copcap Date: Thu, 18 Apr 2024 03:49:45 +0800 Subject: [PATCH 12/36] =?UTF-8?q?=E7=A5=9E=E9=B2=81=E8=82=83=E6=A6=BB?= =?UTF-8?q?=E8=B0=9F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/extra.js | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/character/extra.js b/character/extra.js index 1be166f7ac..7f6c413434 100755 --- a/character/extra.js +++ b/character/extra.js @@ -753,6 +753,7 @@ game.import("character", function () { }, direct: true, changeSeat: true, + derivation: "tamo_faq", async content(event, trigger, player) { const toSortPlayers = game.filterPlayer((current) => !current.isZhu2()); toSortPlayers.sortBySeat(game.findPlayer2((current) => current.getSeatNum() == 1, true)); @@ -870,7 +871,7 @@ game.import("character", function () { }); const { result } = await next; if (!result.bool) return; - player.logSkill("tamo"); + await player.logSkill("tamo"); const resultList = result.moved[0].map((info) => { return parseInt(info.split("|")[0]); }); @@ -891,6 +892,25 @@ game.import("character", function () { game.swapSeat(list[0], list[1], false); } }, toSwapList); + if (trigger.name === "phase" && trigger.player !== toSortPlayers[0] && !trigger._finished) { + trigger.finish(); + trigger._triggered = 5; + const evt = toSortPlayers[0].insertPhase(); + delete evt.skill; + const evt2 = trigger.getParent(); + if (evt2.name == "phaseLoop" && evt2._isStandardLoop) { + evt2.player = toSortPlayers[0]; + } + //跳过新回合的phaseBefore + evt.pushHandler("onPhase", (event, option) => { + if ( + event.step === 0 && + option.state === "begin" + ) { + event.step = 1; + } + }); + } await game.asyncDelay(); }, }, @@ -1164,7 +1184,6 @@ game.import("character", function () { default: return false; } - break; } }, forced: true, @@ -10814,7 +10833,11 @@ game.import("character", function () { dingzhou_info: "出牌阶段限一次。你可以将X张牌交给一名场上有牌的角色,然后你获得其场上的所有牌(X为其场上的牌数+1)。", tamo: "榻谟", - tamo_info: "游戏开始时,你可以重新分配除主公外所有角色的座次。", + tamo_info: + "游戏开始时,你可以重新分配除主公外所有角色的座次。", + tamo_faq: "FAQ", + tamo_faq_info: + "
  • Q:在一号位不为主公的情况下,〖榻谟〗如何结算?
  • A:该角色可以正常进行座次交换。若受此技能影响导致一号位角色发生了变化,则以排列后的一号位角色为起始角色开始本局游戏。
  • ", zhimeng: "智盟", zhimeng_info: "回合结束后,你可以与一名其他角色将各自所有手牌置于处理区,然后你随机获得这些牌中的一半(向上取整),其获得剩余的牌。", From c61d6a82796a14f76fb2859e57c88ac45583f922 Mon Sep 17 00:00:00 2001 From: copcap Date: Thu, 18 Apr 2024 03:49:58 +0800 Subject: [PATCH 13/36] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=AC=A2=E4=B9=90?= =?UTF-8?q?=E6=88=90=E5=8F=8C=E6=A8=A1=E5=BC=8F=E4=B8=8BchangeSeat?= =?UTF-8?q?=E6=8A=80=E8=83=BD=E7=9A=84=E7=A6=81=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mode/versus.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mode/versus.js b/mode/versus.js index 952c2dc8c0..8a1967da4f 100644 --- a/mode/versus.js +++ b/mode/versus.js @@ -1248,14 +1248,14 @@ game.import("mode", function (lib, game, ui, get, ai, _status) { next.setContent(function () { "step 0"; ui.arena.classList.add("choose-character"); - for (var i in lib.skill) { - if (lib.skill[i].changeSeat) { - lib.skill[i] = {}; - if (lib.translate[i + "_info"]) { - lib.translate[i + "_info"] = "此模式下不可用"; - } - } - } + // for (var i in lib.skill) { + // if (lib.skill[i].changeSeat) { + // lib.skill[i] = {}; + // if (lib.translate[i + "_info"]) { + // lib.translate[i + "_info"] = "此模式下不可用"; + // } + // } + // } var bool = Math.random() < 0.5; var bool2 = Math.random() < 0.5; var ref = game.players[0]; From c6bf3f50060be84ce7ac959ab1d6024f08bf8a5b Mon Sep 17 00:00:00 2001 From: copcap Date: Thu, 18 Apr 2024 03:50:17 +0800 Subject: [PATCH 14/36] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/mobile.js | 42 ++++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/character/mobile.js b/character/mobile.js index 0a4992fc2e..027bd82106 100644 --- a/character/mobile.js +++ b/character/mobile.js @@ -394,8 +394,6 @@ game.import("character", function () { "南华老仙,是古典小说《三国演义》中的虚拟人物。其原型来自道教典籍中对庄子的封号,又称“南华仙人”、“南华真人”等。在古典小说《三国演义》通行本的第一回中,描述了南华老仙将《太平要术》赠送给张角的情节。", chenzhen: "陈震(?—公元235年),字孝起。荆州南阳郡(今河南南阳)人。三国时期蜀汉官员。刘备领荆州牧时,辟陈震为从事。后随刘备入蜀,为蜀郡北部都尉、汶山太守、犍为太守。建兴三年(225年),拜尚书,迁尚书令。建兴七年(229年),孙权称帝。蜀汉以陈震为卫尉,前往祝贺,与孙权开坛歃盟,交分天下。还蜀,封城阳亭侯。建兴十三年(235年),卒。", - nanhualaoxian: - "南华老仙,其原型来自道教典籍中对庄子的封号,又称“南华仙人”、“南华真人”等。在古典小说《三国演义》通行本的第一回中,描述了南华老仙将《太平要术》赠送给张角的情节。", hucheer: "胡车儿(生卒年不详),东汉末年武将,初从张绣,为其心腹猛将,勇冠三军,与贾诩交情甚佳。宛城大战后,张绣投降曹操,曹操爱胡车儿之骁勇,手以黄金与之。后因曹操私纳张绣亡叔张济的遗孀邹氏,张绣深感其辱,欲杀曹操,与贾诩商议后决心反曹。《三国演义》中,作者考虑到典韦的勇猛,便增加了令胡车儿盗走典韦的双戟的情节。最终典韦、曹昂(曹操长子)、曹安民(曹操侄子)皆死于此次战斗。野史说胡车儿跟随曹操征战,被赵云在长坂坡上红枪挑死。", simashi: @@ -660,7 +658,6 @@ game.import("character", function () { }, mbshishou: { audio: 2, - forced: true, trigger: { player: "useSkillAfter" }, filter(event, player) { return event.skill === "mbzuoyou" && !event.targets.includes(player); @@ -2714,7 +2711,6 @@ game.import("character", function () { }, forced: true, popup: false, - onremove: true, firstDo: true, init: function (player, skill) { player.storage[skill] = 0; @@ -10578,23 +10574,6 @@ game.import("character", function () { //钟会 requanji: { audio: 2, - mod: { - aiOrder: (player, card, num) => { - if ( - num <= 0 || - typeof card !== "object" || - !player.isPhaseUsing() || - !player.hasSkill("zili") || - player.needsToDiscard() - ) - return num; - if ( - player.getExpansions("quanji").length < 3 && - player.getUseValue(card) < Math.min(4, (player.hp * player.hp) / 4) - ) - return 0; - }, - }, trigger: { player: ["damageEnd", "phaseUseEnd"] }, frequent: true, locked: false, @@ -10634,9 +10613,24 @@ game.import("character", function () { } }, mod: { - maxHandcard: function (player, num) { + maxHandcard(player, num) { return num + player.getExpansions("quanji").length; }, + aiOrder(player, card, num) { + if ( + num <= 0 || + typeof card !== "object" || + !player.isPhaseUsing() || + !player.hasSkill("zili") || + player.needsToDiscard() + ) + return num; + if ( + player.getExpansions("quanji").length < 3 && + player.getUseValue(card) < Math.min(4, (player.hp * player.hp) / 4) + ) + return 0; + }, }, onremove: function (player, skill) { var cards = player.getExpansions("quanji"); @@ -21081,10 +21075,6 @@ game.import("character", function () { re_liru_prefix: "手杀界", re_chenqun: "手杀界陈群", re_chenqun_prefix: "手杀界", - re_liru: "手杀界李儒", - re_liru_prefix: "手杀界", - re_chenqun: "手杀界陈群", - re_chenqun_prefix: "手杀界", old_yuanshu: "手杀袁术", old_yuanshu_prefix: "手杀", baoxin: "鲍信", From 67834fa8e6a2f2d691e05ce8f2f56aeff155467e Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Thu, 18 Apr 2024 10:30:27 +0800 Subject: [PATCH 15/36] =?UTF-8?q?=E3=80=90=E6=B8=85=E4=B8=A5=E3=80=91bugfi?= =?UTF-8?q?x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/huicui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/character/huicui.js b/character/huicui.js index a4a7236292..24b065dd58 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -7987,7 +7987,7 @@ game.import("character", function () { }, async content(event, trigger, player) { if (event.cards && event.cards.length) { - await player.dicard(cards); + await player.dicard(event.cards); lib.skill.dcxieshou.change(player, 1); } else { player.drawTo(player.maxHp); From 6e466929ccd18881e22617c0292fd455e4e0740e Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Thu, 18 Apr 2024 10:37:35 +0800 Subject: [PATCH 16/36] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/diy.js | 3 +++ character/mobile.js | 6 ++++++ character/standard.js | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/character/diy.js b/character/diy.js index 36bb7ae458..4d338ba346 100755 --- a/character/diy.js +++ b/character/diy.js @@ -5467,6 +5467,9 @@ game.import("character", function () { content: () => { trigger.forceYingbian = true; }, + ai: { + combo: "asara_shelu" + }, }, yukito_kongwu: { enable: "phaseUse", diff --git a/character/mobile.js b/character/mobile.js index 0a4992fc2e..d014b83265 100644 --- a/character/mobile.js +++ b/character/mobile.js @@ -1061,6 +1061,9 @@ game.import("character", function () { }) ); }, + ai: { + combo: "mbqianlong" + }, }, mbcmqingzheng: { audio: "sbqingzheng", @@ -14213,6 +14216,9 @@ game.import("character", function () { evt.targets.push(target); } }, + ai: { + combo: "zhengjian" + }, }, //一 将 成 名 zhilve: { diff --git a/character/standard.js b/character/standard.js index 0e8a9e9946..6f2226595a 100755 --- a/character/standard.js +++ b/character/standard.js @@ -279,6 +279,9 @@ game.import("character", function () { evt.targets.remove(trigger.target); evt.targets.push(player); }, + ai: { + neg: true + }, }, hujia: { audio: 2, @@ -2492,6 +2495,7 @@ game.import("character", function () { trigger.source.chooseDrawRecover(true); }, ai: { + halfneg: true, effect: { target(card, player, target, current) { if (card.name == "sha" && get.color(card) == "red") { From e7eca38ef47417130950b1de0fe7e6d99298bb8a Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Thu, 18 Apr 2024 20:01:49 +0800 Subject: [PATCH 17/36] =?UTF-8?q?chooseCard=E6=B7=BB=E5=8A=A0autochoose?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- noname/library/element/content.js | 10 ++++++++++ noname/library/element/player.js | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/noname/library/element/content.js b/noname/library/element/content.js index 7ed9cb15c0..0cd1bda8a0 100644 --- a/noname/library/element/content.js +++ b/noname/library/element/content.js @@ -5296,6 +5296,16 @@ export const Content = { bool: true, links: [], }; + } else if (event.autochoose()) { + event.result = { + bool: true, + autochoose: true, + cards: player.getCards(event.position), + confirm: "ok", + buttons: [], + targets: [], + links: [], + }; } else { if (event.isMine()) { game.check(); diff --git a/noname/library/element/player.js b/noname/library/element/player.js index a032847db0..a8a1a244cc 100644 --- a/noname/library/element/player.js +++ b/noname/library/element/player.js @@ -4776,6 +4776,11 @@ export class Player extends HTMLDivElement { if (next.filterCard == undefined) next.filterCard = lib.filter.all; if (next.selectCard == undefined) next.selectCard = [1, 1]; if (next.ai == undefined) next.ai = get.unuseful3; + next.autochoose = function () { + if (!this.forced) return false; + if (typeof this.selectCard == "function") return false; + return get.select(this.selectCard)[0] >= this.player.countCards(this.position); + }; next.setContent("chooseCard"); next._args = Array.from(arguments); return next; From 971b6c16b338fd7be2e898abef5f6208041567b0 Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Thu, 18 Apr 2024 20:10:14 +0800 Subject: [PATCH 18/36] =?UTF-8?q?bugfix+=E6=8A=80=E8=83=BD=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/clan.js | 2 +- character/extra.js | 24 ++++++++++-------------- character/sb.js | 6 +++--- character/sp.js | 4 ++-- character/sp2.js | 2 +- 5 files changed, 17 insertions(+), 21 deletions(-) diff --git a/character/clan.js b/character/clan.js index 2e209b4705..c99823343e 100644 --- a/character/clan.js +++ b/character/clan.js @@ -1162,7 +1162,7 @@ game.import("character", function () { var num = get.cardNameLength(event.card); return typeof num == "number" && num > 0 && player.countCards("he") > 0; }, - async content(event, trigger, player) { + async cost(event, trigger, player) { var num = get.cardNameLength(trigger.card), str = ""; if (player.getDamagedHp() > 0) diff --git a/character/extra.js b/character/extra.js index 7f6c413434..1b34c98994 100755 --- a/character/extra.js +++ b/character/extra.js @@ -753,7 +753,6 @@ game.import("character", function () { }, direct: true, changeSeat: true, - derivation: "tamo_faq", async content(event, trigger, player) { const toSortPlayers = game.filterPlayer((current) => !current.isZhu2()); toSortPlayers.sortBySeat(game.findPlayer2((current) => current.getSeatNum() == 1, true)); @@ -871,7 +870,7 @@ game.import("character", function () { }); const { result } = await next; if (!result.bool) return; - await player.logSkill("tamo"); + player.logSkill("tamo"); const resultList = result.moved[0].map((info) => { return parseInt(info.split("|")[0]); }); @@ -919,8 +918,9 @@ game.import("character", function () { audio: 2, trigger: { player: "phaseAfter" }, filter(event, player) { - return game.hasPlayer((current) => { - return current.countCards("h") + player.countCards("h") > 0 && player != current; + return game.hasPlayer(target => { + if(target==player||target.countCards('h')+player.countCards('h')==0) return false; + return get.mode()=='identity'||target.countCards('h')<=player.countCards('h')+1; }); }, direct: true, @@ -932,9 +932,8 @@ game.import("character", function () { get.prompt("zhimeng"), "与一名其他角色平分手牌", (card, player, target) => { - return ( - target.countCards("h") + player.countCards("h") > 0 && player != target - ); + if(target==player||target.countCards('h')+player.countCards('h')==0) return false; + return get.mode()=='identity'||target.countCards('h')<=player.countCards('h')+1; } ) .set("ai", (target) => { @@ -1184,6 +1183,7 @@ game.import("character", function () { default: return false; } + break; } }, forced: true, @@ -10833,14 +10833,10 @@ game.import("character", function () { dingzhou_info: "出牌阶段限一次。你可以将X张牌交给一名场上有牌的角色,然后你获得其场上的所有牌(X为其场上的牌数+1)。", tamo: "榻谟", - tamo_info: - "游戏开始时,你可以重新分配除主公外所有角色的座次。", - tamo_faq: "FAQ", - tamo_faq_info: - "
  • Q:在一号位不为主公的情况下,〖榻谟〗如何结算?
  • A:该角色可以正常进行座次交换。若受此技能影响导致一号位角色发生了变化,则以排列后的一号位角色为起始角色开始本局游戏。
  • ", + tamo_info: "游戏开始时,你可以重新分配除主公外所有角色的座次。", zhimeng: "智盟", - zhimeng_info: - "回合结束后,你可以与一名其他角色将各自所有手牌置于处理区,然后你随机获得这些牌中的一半(向上取整),其获得剩余的牌。", + zhimeng_info_identity:'回合结束后,你可以选择一名其他角色。若如此做,你与其将各自所有手牌置于处理区,然后你随机获得这些牌中的一半(向上取整),其获得剩余的牌。', + zhimeng_info:'回合结束后,你可以选择一名手牌数不大于Y的其他角色(Y为你的手牌数+1)。若如此做,你与其将各自所有手牌置于处理区,然后你随机获得这些牌中的一半(向上取整),其获得剩余的牌。', shen_xuzhu: "神许褚", shen_xuzhu_prefix: "神", zhengqing: "争擎", diff --git a/character/sb.js b/character/sb.js index a294009df6..519e02fdca 100644 --- a/character/sb.js +++ b/character/sb.js @@ -890,7 +890,7 @@ game.import("character", function () { } = await player .chooseTarget( get.prompt("sbjieming"), - `令一名角色摸三张牌,然后其可以弃置任意张牌。若其弃置的牌数不大于${get.cnNumber( + `令一名角色摸四张牌,然后其可以弃置任意张牌。若其弃置的牌数不大于${get.cnNumber( num )}张,你失去1点体力。` ) @@ -921,7 +921,7 @@ game.import("character", function () { if (!bool) return; const target = targets[0]; player.logSkill("sbjieming", target); - await target.draw(3); + await target.draw(4); num = Math.max(1, player.getDamagedHp()); const { result: { bool: bool2, cards }, @@ -8984,7 +8984,7 @@ game.import("character", function () { "出牌阶段限一次。你可以选择两名有牌的其他角色,你与这些角色同时将任意张牌扣置于武将牌上。若你以此法扣置的牌唯一最少,则扣置牌最多的其他角色获得你扣置的牌,且这些角色获得各自扣置的牌;否则这两名角色中扣置牌较多的角色对较少的角色造成1点伤害,获得你扣置的牌,然后这些角色将各自扣置的牌置入弃牌堆(若这两名角色扣置的牌数相同,视为与你逆时针最近座次的角色扣置牌较多)。", sbjieming: "节命", sbjieming_info: - "当你受到伤害后,你可以令一名角色摸三张牌,然后其可以弃置任意张牌。若其弃置的牌数不大于X,你失去1点体力(X为你已损失的体力值,至少为1)。", + "当你受到伤害后,你可以令一名角色摸四张牌,然后其可以弃置任意张牌。若其弃置的牌数不大于X,你失去1点体力(X为你已损失的体力值,至少为1)。", sb_xiahoudun: "谋夏侯惇", sb_xiahoudun_prefix: "谋", sbganglie: "刚烈", diff --git a/character/sp.js b/character/sp.js index fdad5ff70f..7b764bc08c 100755 --- a/character/sp.js +++ b/character/sp.js @@ -999,7 +999,7 @@ game.import("character", function () { list.push( cards.reduce((sum, card) => { const juedou = get.autoViewAs({ name: "juedou" }, [card]); - return sum + get.effect(target, card, player, player); + return sum + get.effect(target, juedou, player, player); }, 0) ); } @@ -1030,7 +1030,7 @@ game.import("character", function () { }) .reduce((num, card) => { const juedou = get.autoViewAs({ name: "juedou" }, [card]); - return num + get.effect(player, card, source, player); + return num + get.effect(player, juedou, source, player); }, 0); }; return controls.sort( diff --git a/character/sp2.js b/character/sp2.js index 6caefd98f7..d71e54324b 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -2448,7 +2448,7 @@ game.import("character", function () { } = await player.chooseButton(dialog, true).set("ai", (button) => { const player = get.event("player"), target = get.event().getParent().targets[0]; - return get.value(card, player) * get.value(card, target) * (1 + Math.random()); + return get.value(button.link, player) * get.value(button.link, target) * (1 + Math.random()); }); if (bool) { await player.gain(links, target, "giveAuto", "bySelf"); From b025e487e4e80a5cb25f906b432a05b11f2a2cbd Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Thu, 18 Apr 2024 20:14:28 +0800 Subject: [PATCH 19/36] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=8F=90=E7=A4=BAbugfi?= =?UTF-8?q?x+=E7=B4=A0=E6=9D=90=E6=A3=80=E6=B5=8Bbugfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- noname/ui/create/menu/pages/otherMenu.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/noname/ui/create/menu/pages/otherMenu.js b/noname/ui/create/menu/pages/otherMenu.js index a36c1c3238..627c44a8b5 100644 --- a/noname/ui/create/menu/pages/otherMenu.js +++ b/noname/ui/create/menu/pages/otherMenu.js @@ -349,7 +349,7 @@ export const otherMenu = function (/** @type { boolean | undefined } */ connectM } } const str = - versionResult > 0 + versionResult < 0 ? `有新版本${description.name}可用,是否下载?` : `本地版本${lib.version}高于或等于github版本${description.name},是否强制下载?`; const str2 = description.body; @@ -454,7 +454,7 @@ export const otherMenu = function (/** @type { boolean | undefined } */ connectM const result = await asyncFilter(files.flat(), async v => { return game.promises.readFile(v.path).then(data => { return v.size != data.byteLength; - }) + }).catch(()=>true) }).then(arr => arr.map((v) => v.path)); console.log("需要更新的文件有:", result); From 1f8b03ae633f2df49daf53c8767b4b7f8f03037a Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Thu, 18 Apr 2024 20:20:44 +0800 Subject: [PATCH 20/36] bugfix --- character/huicui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/character/huicui.js b/character/huicui.js index 24b065dd58..802280436d 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -7987,7 +7987,7 @@ game.import("character", function () { }, async content(event, trigger, player) { if (event.cards && event.cards.length) { - await player.dicard(event.cards); + await player.discard(event.cards); lib.skill.dcxieshou.change(player, 1); } else { player.drawTo(player.maxHp); From 47838b00ec55d5db07a9615dfb50808ff1018e33 Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Thu, 18 Apr 2024 20:26:18 +0800 Subject: [PATCH 21/36] =?UTF-8?q?combo=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/extra.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/character/extra.js b/character/extra.js index 7f6c413434..bb91107857 100755 --- a/character/extra.js +++ b/character/extra.js @@ -9416,6 +9416,9 @@ game.import("character", function () { } } }, + ai: { + combo: "nzry_junlve" + }, }, nzry_dinghuo: { audio: 2, From 11ece00fbb423fbe9aaeb1912c08242165c35efc Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Thu, 18 Apr 2024 20:37:55 +0800 Subject: [PATCH 22/36] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/extra.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/character/extra.js b/character/extra.js index 1b34c98994..89c524f77d 100755 --- a/character/extra.js +++ b/character/extra.js @@ -753,6 +753,7 @@ game.import("character", function () { }, direct: true, changeSeat: true, + derivation: "tamo_faq", async content(event, trigger, player) { const toSortPlayers = game.filterPlayer((current) => !current.isZhu2()); toSortPlayers.sortBySeat(game.findPlayer2((current) => current.getSeatNum() == 1, true)); @@ -870,7 +871,7 @@ game.import("character", function () { }); const { result } = await next; if (!result.bool) return; - player.logSkill("tamo"); + await player.logSkill("tamo"); const resultList = result.moved[0].map((info) => { return parseInt(info.split("|")[0]); }); @@ -1183,7 +1184,6 @@ game.import("character", function () { default: return false; } - break; } }, forced: true, From d3e95c9dd6836c0edd7b110152bdb7e4587729f8 Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Thu, 18 Apr 2024 20:44:27 +0800 Subject: [PATCH 23/36] =?UTF-8?q?=E6=9C=A8=E9=B9=BF=E5=A4=A7=E7=8E=8B?= =?UTF-8?q?=E3=80=90=E5=85=BD=E6=B3=95=E3=80=91=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/mobile.js | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/character/mobile.js b/character/mobile.js index 50f286e225..eefbebc0e2 100644 --- a/character/mobile.js +++ b/character/mobile.js @@ -1907,10 +1907,9 @@ game.import("character", function () { if (name == "damageSource" && player.getHistory("sourceDamage").indexOf(event) != 0) return false; return game.hasPlayer((target) => { - if (get.mode() != "doudizhu") { - if (name == "damageEnd" && get.distance(player, target) <= 2) return false; - if (name == "damageSource" && get.distance(player, target) > 2) return false; - } + const num = (get.mode() == 'doudizhu' ? 1 : 2); + if (name == "damageEnd" && get.distance(player, target) <= num) return false; + if (name == "damageSource" && get.distance(player, target) > num) return false; const zhoufa = player.storage.zhoulin_zhoufa; if (!zhoufa) return true; if (zhoufa == "豹" || zhoufa == "兔") return true; @@ -1931,7 +1930,7 @@ game.import("character", function () { : "令其随机执行一个效果"; const nodoudizhu = get.mode() == "doudizhu" - ? "" + ? "距离" + (event.triggername == "damageEnd" ? "" : "不") + "大于1的" : "距离" + (event.triggername == "damageEnd" ? "" : "不") + "大于2的"; const { result: { bool, targets }, @@ -1941,12 +1940,9 @@ game.import("character", function () { "选择一名" + nodoudizhu + "角色," + str, (card, player, target) => { const name = _status.event.triggername; - if (get.mode() != "doudizhu") { - if (name == "damageEnd" && get.distance(player, target) <= 2) - return false; - if (name == "damageSource" && get.distance(player, target) > 2) - return false; - } + const num = (get.mode() == 'doudizhu' ? 1 : 2); + if (name == "damageEnd" && get.distance(player, target) <= num) return false; + if (name == "damageSource" && get.distance(player, target) > num) return false; const zhoufa = player.storage.zhoulin_zhoufa; if (!zhoufa) return true; if (zhoufa == "豹" || zhoufa == "兔") return true; @@ -20043,7 +20039,7 @@ game.import("character", function () { }, shoufa: function (player) { const zhoufa = player.storage.zhoulin_zhoufa; - const nodoudizhu = get.mode() == "doudizhu" ? "" : "与你距离大于/不大于2的"; + const nodoudizhu = get.mode() == "doudizhu" ? "与你距离大于/不大于1的" : "与你距离大于/不大于2的"; if (!zhoufa) return ( "当你受到伤害后/于一回合首次造成伤害后,你可以选择一名" + @@ -21157,7 +21153,7 @@ game.import("character", function () { shoufa_info: "当你受到伤害后/于一回合首次造成伤害后,你可以选择一名与你距离大于/不大于2的角色,令其随机执行以下一项:豹,令其受到1点无来源伤害;鹰,你随机获得其一张牌;熊,你随机弃置其装备区的一张牌;兔,令其摸一张牌。", shoufa_info_doudizhu: - "当你受到伤害后/于一回合首次造成伤害后,你可以选择一名角色,令其随机执行以下一项:豹,令其受到1点无来源伤害;鹰,你随机获得其一张牌;熊,你随机弃置其装备区的一张牌;兔,令其摸一张牌。", + "当你受到伤害后/于一回合首次造成伤害后,你可以选择一名与你距离大于/不大于1的角色,令其随机执行以下一项:豹,令其受到1点无来源伤害;鹰,你随机获得其一张牌;熊,你随机弃置其装备区的一张牌;兔,令其摸一张牌。", yuxiang: "御象", yuxiang_info: "锁定技,若你有护甲值,则:①你计算与其他角色的距离-1,其他角色计算与你的距离+1;②当你受到火焰伤害时,此伤害+1。", From 8df58c02e8896e1af8fa2119df2a507f3b7e0170 Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Thu, 18 Apr 2024 20:48:36 +0800 Subject: [PATCH 24/36] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/extra.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/character/extra.js b/character/extra.js index 89c524f77d..84264fa63e 100755 --- a/character/extra.js +++ b/character/extra.js @@ -10833,7 +10833,11 @@ game.import("character", function () { dingzhou_info: "出牌阶段限一次。你可以将X张牌交给一名场上有牌的角色,然后你获得其场上的所有牌(X为其场上的牌数+1)。", tamo: "榻谟", - tamo_info: "游戏开始时,你可以重新分配除主公外所有角色的座次。", + tamo_info: + "游戏开始时,你可以重新分配除主公外所有角色的座次。", + tamo_faq: "FAQ", + tamo_faq_info: + "
  • Q:在一号位不为主公的情况下,〖榻谟〗如何结算?
  • A:该角色可以正常进行座次交换。若受此技能影响导致一号位角色发生了变化,则以排列后的一号位角色为起始角色开始本局游戏。
  • ", zhimeng: "智盟", zhimeng_info_identity:'回合结束后,你可以选择一名其他角色。若如此做,你与其将各自所有手牌置于处理区,然后你随机获得这些牌中的一半(向上取整),其获得剩余的牌。', zhimeng_info:'回合结束后,你可以选择一名手牌数不大于Y的其他角色(Y为你的手牌数+1)。若如此做,你与其将各自所有手牌置于处理区,然后你随机获得这些牌中的一半(向上取整),其获得剩余的牌。', From 00b6347be5e4c4ef00d3bf8cfb58d167d01b45b9 Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Thu, 18 Apr 2024 23:06:42 +0800 Subject: [PATCH 25/36] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E3=80=90=E4=B9=90?= =?UTF-8?q?=E4=B8=8D=E6=80=9D=E8=9C=80=E3=80=91ai=E7=9A=84=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E4=B8=A5=E9=87=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- card/standard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/card/standard.js b/card/standard.js index aeca20f1be..1ce37f51d7 100644 --- a/card/standard.js +++ b/card/standard.js @@ -2989,7 +2989,7 @@ game.import("card", function () { cf = Math.pow(get.threaten(target, player), 2); if (!num) return -0.01 * cf; if (target.hp > 2) num--; - let dist = Math.sqrt(get.distance(player, target, "absolute")); + let dist = Math.sqrt(1 + get.distance(player, target, "absolute")); if (dist < 1) dist = 1; if (target.isTurnedOver()) dist++; return (Math.min(-0.1, -num) * cf) / dist; From d101393319b990fddee6a90731ad03a44a3bc6cc Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Thu, 18 Apr 2024 23:56:23 +0800 Subject: [PATCH 26/36] =?UTF-8?q?revert=E6=8B=86=E9=A1=BAai.result?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- card/standard.js | 278 ++++++++++++----------------------------------- 1 file changed, 67 insertions(+), 211 deletions(-) diff --git a/card/standard.js b/card/standard.js index 1ce37f51d7..9ea1a0d370 100644 --- a/card/standard.js +++ b/card/standard.js @@ -2146,138 +2146,48 @@ game.import("card", function () { }, result: { player: function (player, target) { - let att = get.attitude(player, target), - hs = target.hasCard( - (card) => lib.filter.canBeGained(card, player, target), - "h" - ), - lose = hs, - gain = att > 0 ? 0.52 : 1.28; - if (Math.abs(att) < 5.03) { - let temp = 0.015 * att * att; - if (att < 0) gain = 0.9 + temp; - else gain = 0.9 - temp; + const hs = target.getGainableCards(player, 'h'); + const es = target.getGainableCards(player, 'e'); + const js = target.getGainableCards(player, 'j'); + const att = get.attitude(player, target); + if (att < 0) { + if (!hs.length && !es.some(card => { + return get.value(card, target) > 0 && card != target.getEquip('jinhe'); + }) && !js.some(card => { + var cardj = card.viewAs ? { name: card.viewAs } : card; + return get.effect(target, cardj, target, player) < 0; + })) return 0; } - target.countCards("e", function (card) { - if ( - card.name != "jinhe" && - lib.filter.canBeGained(card, player, target) && - att * get.value(card, target) < 0 - ) { - lose = true; - let val = get.value(card, player); - if (val > 0) gain = Math.max(gain, val / 7); - } - }); - target.countCards("j", function (card) { - let cardj = card.viewAs ? new lib.element.VCard({ name: card.viewAs }) : card; - if ( - lib.filter.canBeGained(card, player, target) && - att * get.effect(target, cardj, target, target) < 0 - ) { - lose = true; - if (cardj.name == "lebu") { - let needs = target.needsToDiscard(2); - if (att > 0) gain = Math.max(gain, 1.6 + needs / 10); - } else if ( - cardj.name == "shandian" || - cardj.name == "fulei" || - cardj.name == "plague" - ) - gain = Math.max(gain, 1.5 / Math.max(1, target.hp)); - else if (att > 0) gain = Math.max(gain, 1.7); - } - }); - if (!lose) return 0; - return gain; + else if (att > 1) { + return (es.some(card => { + return get.value(card, target) <= 0; + }) || js.some(card => { + var cardj = card.viewAs ? { name: card.viewAs } : card; + return get.effect(target, cardj, target, player) < 0; + })) ? 1.5 : 0; + } + return 1; }, target: function (player, target) { - let att = get.attitude(player, target), - hs = target.countCards("h", (card) => - lib.filter.canBeGained(card, player, target) - ), - es = target.countCards("e", (card) => - lib.filter.canBeGained(card, player, target) - ), - js = target.countCards("j", (card) => - lib.filter.canBeGained(card, player, target) - ), - noh = !hs || target.hasSkillTag("noh"), - noe = !es || target.hasSkillTag("noe"), - check = [-1, att > 0 ? -1.3 : 1.3, att > 0 ? -2.5 : 2.5], - idx = -1; - if (hs) { - idx = 0; - if (noh) check[0] = 0.7; - } - if (es) { - if (idx < 0) idx = 1; - if ( - target.getEquip("baiyin") && - target.isDamaged() && - lib.filter.canBeGained(target.getEquip("baiyin"), player, target) - ) { - let rec = get.recoverEffect(target, player, target); - if (es == 1 || att * rec > 0) { - let val = 3 - 0.6 * Math.min(5, target.hp); - if (rec > 0) check[1] = val; - else if (rec < 0) check[1] = -val; - } - } - target.countCards("e", function (card) { - let val = get.value(card, target); - if ( - card.name == "jinhe" || - att * val >= 0 || - !lib.filter.canBeGained(card, player, target) - ) - return false; - if (att > 0) { - check[1] = Math.max(1.3, check[1]); - return true; - } - let sub = get.subtype(card); - if (sub == "equip2" || sub == "equip5") val += 4; - else if (sub == "equip1") val *= 0.4 * Math.min(3.6, target.hp); - else val *= 0.6; - if (target.hp < 3 && sub != "equip2" && sub != "equip5") val *= 0.4; - check[1] = Math.min(-0.16 * val, check[1]); - }); - if (noe) check[1] += 0.9; - } - if (js) { - let func = function (num) { - if (att > 0) check[2] = Math.max(check[2], num); - else check[2] = Math.min(check[2], 0.6 - num); - }; - if (idx < 0) idx = 2; - target.countCards("j", function (card) { - let cardj = card.viewAs - ? new lib.element.VCard({ name: card.viewAs }) - : card; - if ( - !lib.filter.canBeGained(card, player, target) || - att * get.effect(target, cardj, target, target) >= 0 - ) - return false; - if (cardj.name == "lebu") func(2.1 + 0.4 * target.needsToDiscard(2)); - else if (cardj.name == "bingliang") func(2.4); - else if ( - cardj.name == "shandian" || - cardj.name == "fulei" || - cardj.name == "plague" - ) - func(Math.abs(check[2]) / (1 + target.hp)); - else func(2.1); - }); - } - if (idx < 0) return 0; - for (let i = idx + 1; i < 3; i++) { - if ((i == 1 && !es) || (i == 2 && !js)) continue; - if ((att > 0 && check[i] > check[idx]) || (att <= 0 && check[i] < check[idx])) - idx = i; + const hs = target.getGainableCards(player, 'h'); + const es = target.getGainableCards(player, 'e'); + const js = target.getGainableCards(player, 'j'); + + if (get.attitude(player, target) <= 0) { + if (hs.length > 0) return -1.5; + return (es.some(card => { + return get.value(card, target) > 0 && card != target.getEquip('jinhe'); + }) || js.some(card => { + var cardj = card.viewAs ? { name: card.viewAs } : card; + return get.effect(target, cardj, target, player) < 0; + })) ? -1.5 : 1.5; } - return check[idx]; + return (es.some(card => { + return get.value(card, target) <= 0; + }) || js.some(card => { + var cardj = card.viewAs ? { name: card.viewAs } : card; + return get.effect(target, cardj, target, player) < 0; + })) ? 1.5 : -1.5; }, }, tag: { @@ -2546,92 +2456,38 @@ game.import("card", function () { }, result: { target: function (player, target) { - let att = get.attitude(player, target), - hs = target.countCards("h", (card) => - lib.filter.canBeDiscarded(card, player, target) - ), - es = target.countCards("e", (card) => - lib.filter.canBeDiscarded(card, player, target) - ), - js = target.countCards("j", (card) => - lib.filter.canBeDiscarded(card, player, target) - ), - noh = !hs || target.hasSkillTag("noh"), - noe = !es || target.hasSkillTag("noe"), - check = [-1, att > 0 ? -1.3 : 1.3, att > 0 ? -2.5 : 2.5], - idx = -1; - if (hs) { - idx = 0; - if (noh) check[0] = 0.7; - } - if (es) { - if (idx < 0) idx = 1; - if ( - target.getEquip("baiyin") && - target.isDamaged() && - lib.filter.canBeDiscarded(target.getEquip("baiyin"), player, target) - ) { - let rec = get.recoverEffect(target, player, target); - if (es == 1 || att * rec > 0) { - let val = 3 - 0.6 * Math.min(5, target.hp); - if (rec > 0) check[1] = val; - else if (rec < 0) check[1] = -val; - } + const att = get.attitude(player, target); + const hs = target.getDiscardableCards(player, 'h'); + const es = target.getDiscardableCards(player, 'e'); + const js = target.getDiscardableCards(player, 'j'); + if (!hs.length && !es.length && !js.length) return 0; + if (att > 0) { + if (js.some(card => { + const cardj = card.viewAs ? { name: card.viewAs } : card; + return get.effect(target, cardj, target, player) < 0; + })) return 3; + if (target.isDamaged() && es.some(card => card.name == 'baiyin') && + get.recoverEffect(target, player, player) > 0) { + if (target.hp == 1 && !target.hujia) return 1.6; } - target.countCards("e", function (card) { - let val = get.value(card, target); - if ( - card.name == "jinhe" || - att * val >= 0 || - !lib.filter.canBeDiscarded(card, player, target) - ) - return false; - if (att > 0) { - check[1] = Math.max(1.3, check[1]); - return true; - } - let sub = get.subtype(card); - if (sub == "equip2" || sub == "equip5") val += 4; - else if (sub == "equip1") val *= 0.4 * Math.min(3.6, target.hp); - else val *= 0.6; - if (target.hp < 3 && sub != "equip2" && sub != "equip5") val *= 0.4; - check[1] = Math.min(-0.16 * val, check[1]); - }); - if (noe) check[1] += 0.9; - } - if (js) { - let func = function (num) { - if (att > 0) check[2] = Math.max(check[2], num); - else check[2] = Math.min(check[2], 0.6 - num); - }; - if (idx < 0) idx = 2; - target.countCards("j", function (card) { - let cardj = card.viewAs - ? new lib.element.VCard({ name: card.viewAs }) - : card; - if ( - !lib.filter.canBeDiscarded(card, player, target) || - att * get.effect(target, cardj, target, target) >= 0 - ) - return false; - if (cardj.name == "lebu") func(2.1 + 0.4 * target.needsToDiscard(2)); - else if (cardj.name == "bingliang") func(2.4); - else if ( - cardj.name == "shandian" || - cardj.name == "fulei" || - cardj.name == "plague" - ) - func(Math.abs(check[2]) / (1 + target.hp)); - else func(2.1); - }); + if (es.some(card => { + return get.value(card, target) < 0; + })) return 1; + return -1.5; } - if (idx < 0) return 0; - for (let i = idx + 1; i < 3; i++) { - if ((i == 1 && !es) || (i == 2 && !js)) continue; - if ((att > 0 && check[i] > check[idx]) || (att <= 0 && check[i] < check[idx])) - idx = i; + else { + const noh = (hs.length == 0 || target.hasSkillTag('noh')); + const noe = (es.length == 0 || target.hasSkillTag('noe')); + const noe2 = (noe || !es.some(card => { + return get.value(card, target) > 0; + })); + const noj = (js.length == 0 || !js.some(card => { + const cardj = card.viewAs ? { name: card.viewAs } : card; + return get.effect(target, cardj, target, player) < 0; + })) + if (noh && noe2 && noj) return 1.5; + return -1.5; } - return check[idx]; }, }, tag: { From 164628ff735a85ae1bec81e427885c4448811218 Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Fri, 19 Apr 2024 00:34:41 +0800 Subject: [PATCH 27/36] =?UTF-8?q?chooseToDiscard=E5=92=8CchooseCard?= =?UTF-8?q?=E7=9A=84autochoose=E6=9C=BA=E5=88=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- noname/library/element/player.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/noname/library/element/player.js b/noname/library/element/player.js index a8a1a244cc..4212473106 100644 --- a/noname/library/element/player.js +++ b/noname/library/element/player.js @@ -4522,7 +4522,9 @@ export class Player extends HTMLDivElement { next.autochoose = function () { if (!this.forced) return false; if (typeof this.selectCard == "function") return false; + if (this.complexCard || this.complexSelect || this.filterOk) return false; var cards = this.player.getCards(this.position); + if (cards.some(card => !this.filterCard(card, this))) return false; var num = cards.length; for (var i = 0; i < cards.length; i++) { if (!lib.filter.cardDiscardable(cards[i], this.player, this)) num--; @@ -4779,6 +4781,9 @@ export class Player extends HTMLDivElement { next.autochoose = function () { if (!this.forced) return false; if (typeof this.selectCard == "function") return false; + if (this.complexCard || this.complexSelect || this.filterOk) return false; + var cards = this.player.getCards(this.position); + if (cards.some(card => !this.filterCard(card, this))) return false; return get.select(this.selectCard)[0] >= this.player.countCards(this.position); }; next.setContent("chooseCard"); From c19990ead2b8f31667ae905594e765df5980b28b Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Fri, 19 Apr 2024 00:48:57 +0800 Subject: [PATCH 28/36] =?UTF-8?q?=E7=A5=9E=E9=B2=81=E8=82=83=E3=80=90?= =?UTF-8?q?=E5=A1=8C=E8=B0=9F=E3=80=91bugfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复主公回合被跳过的bug --- character/extra.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/character/extra.js b/character/extra.js index 84264fa63e..0541d26b83 100755 --- a/character/extra.js +++ b/character/extra.js @@ -892,7 +892,7 @@ game.import("character", function () { game.swapSeat(list[0], list[1], false); } }, toSwapList); - if (trigger.name === "phase" && trigger.player !== toSortPlayers[0] && !trigger._finished) { + if (trigger.name === "phase" && !trigger.player.isZhu2() && trigger.player !== toSortPlayers[0] && !trigger._finished) { trigger.finish(); trigger._triggered = 5; const evt = toSortPlayers[0].insertPhase(); From 3d45ada48f002494c583d07e9ded698112f439d6 Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Fri, 19 Apr 2024 13:12:42 +0800 Subject: [PATCH 29/36] =?UTF-8?q?=E8=B0=83=E6=95=B4=E3=80=90=E8=A5=84?= =?UTF-8?q?=E8=83=99=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/sp.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/character/sp.js b/character/sp.js index fdad5ff70f..c3a9b0c9eb 100755 --- a/character/sp.js +++ b/character/sp.js @@ -2666,18 +2666,18 @@ game.import("character", function () { if (!ui.selected.targets.length) return 0; const target = ui.selected.targets[0]; if ( - player.getHistory("useSkill", (evt) => { + player.hasAllHistory("useSkill", (evt) => { return ( evt.skill == "olgongjie" && (evt.targets || [evt.target]).includes(target) ); - }).length && - player.getHistory("useSkill", (evt) => { + }) && + player.hasAllHistory("useSkill", (evt) => { return ( evt.skill == "olxiangxv" && (evt.targets || [evt.target]).includes(target) ); - }).length + }) ) { if (get.attitude(player, target) > 0) return 1; if (player.canSaveCard(card, player)) return 0; @@ -2694,18 +2694,18 @@ game.import("character", function () { ai2(target) { const player = get.event("player"); const goon = - player.getHistory("useSkill", (evt) => { + player.hasAllHistory("useSkill", (evt) => { return ( evt.skill == "olgongjie" && (evt.targets || [evt.target]).includes(target) ); - }).length && - player.getHistory("useSkill", (evt) => { + }) && + player.hasAllHistory("useSkill", (evt) => { return ( evt.skill == "olxiangxv" && (evt.targets || [evt.target]).includes(target) ); - }).length, + }), att = get.attitude(player, target); if (goon) return 5 * att; if (!!player.countCards("he", (cardx) => player.canSaveCard(cardx, player))) @@ -2724,12 +2724,12 @@ game.import("character", function () { player.awakenSkill("olxiangzuo"); await player.give(cards, target); if ( - player.getHistory("useSkill", (evt) => { + player.hasAllHistory("useSkill", (evt) => { return evt.skill == "olgongjie" && evt.targets.includes(target); - }).length && - player.getHistory("useSkill", (evt) => { + }) && + player.hasAllHistory("useSkill", (evt) => { return evt.skill == "olxiangxv" && evt.targets.includes(target); - }).length + }) ) await player.recover(cards.length); }, @@ -34530,7 +34530,7 @@ game.import("character", function () { "当你的手牌数变为全场最少时,你可以获得以下效果:本回合结束时,将手牌数调整至与当前回合角色手牌数相同(至多摸至五张),然后若你以此法弃置了至少两张手牌,则你回复1点体力。", olxiangzuo: "襄胙", olxiangzuo_info: - "限定技,当你进入濒死状态时,你可以交给一名其他角色任意张牌,然后若你本回合已对其发动过〖恭节〗和〖相胥〗,你回复等量的体力。", + "限定技,当你进入濒死状态时,你可以交给一名其他角色任意张牌,然后若你已对其发动过〖恭节〗和〖相胥〗,你回复等量的体力。", liyi: "李异", olchanshuang: "缠双", olchanshuang_info: From bafcb867237b84e329ab2189ce596f0f2ae77a9f Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Fri, 19 Apr 2024 13:20:29 +0800 Subject: [PATCH 30/36] =?UTF-8?q?=E7=BB=86=E8=8A=82=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/mobile.js | 6 ++++++ character/sp.js | 7 ++++++- character/sp2.js | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/character/mobile.js b/character/mobile.js index 50f286e225..43f2bb4fce 100644 --- a/character/mobile.js +++ b/character/mobile.js @@ -672,6 +672,9 @@ game.import("character", function () { player ); }, + ai: { + combo: "mbzuoyou" + }, }, //成济 mbkuangli: { @@ -1732,6 +1735,9 @@ game.import("character", function () { }, }, }, + ai: { + combo: "mbxuetu" + }, }, //霍骏 sidai: { diff --git a/character/sp.js b/character/sp.js index c3a9b0c9eb..ea685ffbb7 100755 --- a/character/sp.js +++ b/character/sp.js @@ -14492,6 +14492,10 @@ game.import("character", function () { "的选项" ); }, + ai: { + combo: "luochong", + neg: true + }, }, //SP孟获 spmanwang: { @@ -31488,6 +31492,7 @@ game.import("character", function () { }, usable: 1, direct: true, + derivation: ["lingren_jianxiong", "lingren_xingshang"], content: function () { "step 0"; player @@ -32848,7 +32853,7 @@ game.import("character", function () { }, spmanwang: function (player) { var num = 4 - player.countMark("spmanwang"); - var str = "出牌阶段,你可以弃置任意张牌。然后你依次执行以下选项中的前X项:"; + var str = "出牌阶段,你可以弃置任意张牌。然后你依次执行以下选项中的前等量项:"; var list = ["⒈获得〖叛侵〗。", "⒉摸一张牌。", "⒊回复1点体力。", "⒋摸两张牌并失去〖叛侵〗。"]; for (var i = 0; i < 4; i++) { if (i == num) { diff --git a/character/sp2.js b/character/sp2.js index 6caefd98f7..13678a4957 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -9794,6 +9794,9 @@ game.import("character", function () { player.markSkill("mubing_rewrite"); player.chooseDrawRecover(2, true); }, + ai: { + combo: "mubing" + }, derivation: "mubing_rewrite", }, refenyin_wufan: { audio: 2 }, From a86e2bef4950152f65d01c6170fcf0a55b77c9ef Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Fri, 19 Apr 2024 15:42:17 +0800 Subject: [PATCH 31/36] =?UTF-8?q?=E8=B0=83=E6=95=B4=E3=80=90=E6=98=93?= =?UTF-8?q?=E5=9F=8E=E3=80=91=EF=BC=8C=E6=9B=B9=E5=AE=87=E5=88=86=E5=8C=85?= =?UTF-8?q?=E5=BD=92=E5=B1=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/shiji.js | 3 +++ character/sp.js | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/character/shiji.js b/character/shiji.js index acf6dddf13..88ed695d2c 100644 --- a/character/shiji.js +++ b/character/shiji.js @@ -3554,6 +3554,9 @@ game.import("character", function () { "step 1"; player.addSkills("xinmouli"); }, + ai: { + combo: "xingqi" + }, group: ["mibei_fail", "mibei_silent"], derivation: "xinmouli", subSkill: { diff --git a/character/sp.js b/character/sp.js index ea685ffbb7..a20e01600f 100755 --- a/character/sp.js +++ b/character/sp.js @@ -18,6 +18,7 @@ game.import("character", function () { "tengfanglan", "ruiji", "caoxiancaohua", + "caoyu", ], sp_sibi: [ "ol_lukai", @@ -168,7 +169,6 @@ game.import("character", function () { "ol_tw_zhangji", "ol_liwan", "ol_liuyan", - "caoyu", "liupan", "ol_liupi", ], @@ -1148,7 +1148,7 @@ game.import("character", function () { enable: "phaseUse", usable: 1, async content(event, trigger, player) { - let cards = get.cards(3); + let num = player.maxHp, cards = get.cards(num); await game.cardsGotoOrdering(cards); await player.showCards(cards, get.translation(player) + "发动了【易城】"); if (player.countCards("h")) { @@ -1181,7 +1181,7 @@ game.import("character", function () { .set("filterOk", (moved) => moved[1].some((i) => !get.owner(i))) .set("processAI", (list) => { const player = get.event("player"), - limit = Math.min(3, player.countCards("h")); + limit = Math.min(get.event("num"), player.countCards("h")); let cards = list[0][1].slice(), hs = player.getCards("h"); if ( @@ -1216,7 +1216,8 @@ game.import("character", function () { } return list; } - }); + }) + .set("num", num); if (bool) { const puts = player.getCards("h", (i) => moved[0].includes(i)); const gains = cards.filter((i) => moved[1].includes(i)); @@ -34574,7 +34575,7 @@ game.import("character", function () { ol_liupi: "刘辟", olyicheng: "易城", olyicheng_info: - "出牌阶段限一次,你可以亮出牌堆顶的三张牌,然后你可以以任意手牌交换这些牌,若这三张牌的点数和因此增加,则你可以选择用所有手牌交换这三张牌。最后你将这三张牌置于牌堆顶。", + "出牌阶段限一次,你可以亮出牌堆顶的X张牌(X为你的体力上限),然后你可以以任意手牌交换其中等量张牌,若亮出的牌的点数和因此增加,则你可以选择用所有手牌交换亮出的牌。最后你将亮出的牌置于牌堆顶。", sp_sunce: "SP孙策", sp_sunce_prefix: "SP", olliantao: "连讨", From 49ef090d08d591fec7b777863792b042cf025bed Mon Sep 17 00:00:00 2001 From: lieren2023 <131325076+lieren2023@users.noreply.github.com> Date: Fri, 19 Apr 2024 19:23:13 +0800 Subject: [PATCH 32/36] =?UTF-8?q?=E4=BF=AE=E5=A4=8DTW=E6=82=96=E9=80=86?= =?UTF-8?q?=E6=8A=80=E8=83=BD=E4=B8=8E=E6=8F=8F=E8=BF=B0=E4=B8=8D=E7=AC=A6?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/xianding.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/character/xianding.js b/character/xianding.js index aa1b34a2c7..efbc5c73b7 100644 --- a/character/xianding.js +++ b/character/xianding.js @@ -19631,7 +19631,7 @@ game.import("character", function () { zhugemengxue: "诸葛梦雪", dcjichun: "寄春", dcjichun_info: - "出牌阶段限一次,你可以展示一张手牌并选择一项:①将此牌交给一名手牌数小于你的角色,然后摸X张牌。②弃置此牌并弃置一名手牌数大于你的角色区域里至多X张牌。(X为此牌牌名字数)", + "出牌阶段限一次,你可以展示一张牌并选择一项:①将此牌交给一名手牌数小于你的角色,然后摸X张牌。②弃置此牌并弃置一名手牌数大于你的角色区域里至多X张牌。(X为此牌牌名字数)", dchanying: "寒英", dchanying_info: "准备阶段,你可以亮出牌堆里的一张非赠物装备牌,然后令一名手牌数等于你的角色使用此牌。", From 33a812fd3d0e473b69254509048698f382f5223d Mon Sep 17 00:00:00 2001 From: lieren2023 <131325076+lieren2023@users.noreply.github.com> Date: Fri, 19 Apr 2024 19:26:58 +0800 Subject: [PATCH 33/36] =?UTF-8?q?=E8=AF=B8=E8=91=9B=E6=A2=A6=E9=9B=AA?= =?UTF-8?q?=E5=AF=84=E6=98=A5=E6=8F=8F=E8=BF=B0=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/tw.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/character/tw.js b/character/tw.js index 9c1cc61cd0..e4e72e3109 100644 --- a/character/tw.js +++ b/character/tw.js @@ -18750,7 +18750,9 @@ game.import("character", function () { audio: 2, enable: "phaseUse", usable: 1, - filterTarget: lib.filter.notMe, + filterTarget: function (card, player, target) { + return target.hp >= player.hp; + }, content: function () { "step 0"; var str = get.translation(target); From 1cebde75f08a66988109918aa937041d484bc31d Mon Sep 17 00:00:00 2001 From: nonameShijian <2954700422@qq.com> Date: Fri, 19 Apr 2024 19:34:46 +0800 Subject: [PATCH 34/36] fix import info.json --- noname/ui/create/menu/pages/exetensionMenu.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/noname/ui/create/menu/pages/exetensionMenu.js b/noname/ui/create/menu/pages/exetensionMenu.js index 4d670eef61..df9bd3cb31 100644 --- a/noname/ui/create/menu/pages/exetensionMenu.js +++ b/noname/ui/create/menu/pages/exetensionMenu.js @@ -426,6 +426,13 @@ export const extensionMenu = function (connectMenu) { 'import { lib, game, ui, get, ai, _status } from "../../noname.js";\ngame.import("extension",function(){\n\treturn ' + str + "\n});", + "info.json": JSON.stringify({ + name: page.currentExtension, + author: authorExtLine.querySelector("input").value || "", + diskURL: diskExtLine.querySelector("input").value || "", + forumURL: forumExtLine.querySelector("input").value || "", + version: versionExtLine.querySelector("input").value || "" + }), }; for (var i in dash1.content.image) { extension[i] = dash1.content.image[i]; From 8a8783300b41af617a31c9f9d96d62350a6eb717 Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Fri, 19 Apr 2024 19:36:34 +0800 Subject: [PATCH 35/36] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=8A=80=E8=83=BD=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/ddd.js | 13 +++++++++---- character/huicui.js | 17 +++++++++++++++-- character/jsrg.js | 3 +++ character/offline.js | 4 ++++ character/old.js | 11 ++++++++++- character/sp.js | 3 +++ 6 files changed, 44 insertions(+), 7 deletions(-) diff --git a/character/ddd.js b/character/ddd.js index 07065aeb25..adaa7e8ba4 100644 --- a/character/ddd.js +++ b/character/ddd.js @@ -3361,6 +3361,9 @@ game.import("character", function () { content() { player.draw(3); }, + ai: { + combo: "dddfusi" + }, }, dddchashi: { trigger: { global: "phaseUseBegin" }, @@ -5113,6 +5116,9 @@ game.import("character", function () { }, }, }, + ai: { + combo: "dddyouxue" + }, }, dddyouxue_old: { audio: 2, @@ -6624,7 +6630,7 @@ game.import("character", function () { "锁定技。出牌阶段开始时,你选择一名角色,其弃置两张牌,然后你对一名角色造成1点伤害。" + (player.storage["dddxiaheng_del"] ? "" - : "。“若两名角色:均不为你,你失去一点体力上限;为同一名角色,你失去一点体力;然后若以此法对包括你在内三名不同的角色造成伤害,删除双引号里的描述内容”") + : "“若两名角色:均不为你,你失去一点体力上限;为同一名角色,你失去一点体力;然后若以此法对包括你在内三名不同的角色造成伤害,删除双引号里的描述内容”") ); }, dddshichao(player) { @@ -6638,9 +6644,8 @@ game.import("character", function () { return ( "转换技,摸牌阶段,你" + (player.hasMark("dddxuanlun_del") ? "" : "可") + - "展示手牌(无牌则不展示),并改为摸其中" + - (!player.storage["dddlanghuai"] ? "包含" : "缺少") + - "花色数的牌。" + "展示手牌(无牌则不展示),并改为摸其中:" + + (player.storage["dddlanghuai"] ? '阴:包含花色数的牌;阳:缺少花色数的牌。' : '阴:包含花色数的牌;阳:缺少花色数的牌。') ); }, dddxuanlun(player) { diff --git a/character/huicui.js b/character/huicui.js index 802280436d..d1bc8a5636 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -8005,6 +8005,9 @@ game.import("character", function () { return false; }, }, + ai: { + neg: true + }, }, //公孙度 dczhenze: { @@ -10831,7 +10834,10 @@ game.import("character", function () { player.addTempSkill("zhishi_mark", { player: "phaseBegin" }); } }, - ai: { expose: 0.3 }, + ai: { + combo: "xunli", + expose: 0.3 + }, subSkill: { mark: { trigger: { @@ -12096,6 +12102,9 @@ game.import("character", function () { } } }, + ai: { + combo: "huguan" + }, }, mingluan: { audio: 2, @@ -15060,6 +15069,10 @@ game.import("character", function () { content: function () { player.removeMark("recangchu", Math.min(player.countMark("recangchu"), trigger.num || 1)); }, + ai: { + combo: "recangchu", + neg: true + }, group: "reshishou2", }, reshishou2: { @@ -15493,7 +15506,7 @@ game.import("character", function () { var list = ["sha", "shan", "tao", "jiu"]; for (var i of list) { var strx = "【" + get.translation(i) + "】"; - if (!info || !info[0].includes(i)) + if (info && !info[0].includes(i)) strx = '' + strx + ""; str += strx; if (i != "jiu") str += "/"; diff --git a/character/jsrg.js b/character/jsrg.js index d5015f55d0..1d2830e010 100644 --- a/character/jsrg.js +++ b/character/jsrg.js @@ -8741,6 +8741,9 @@ game.import("character", function () { .set("cards", trigger.cards); } }, + ai: { + combo: "jsrglirang" + }, }, //朱儁 jsrgfendi: { diff --git a/character/offline.js b/character/offline.js index f606dda500..662a28be9e 100644 --- a/character/offline.js +++ b/character/offline.js @@ -4049,6 +4049,7 @@ game.import("character", function () { result: { player: 1, }, + combo: "zyquanji" }, }, //孙綝 @@ -6954,6 +6955,9 @@ game.import("character", function () { player.loseToDiscardpile(cards); if (num <= 1) player.draw(); }, + ai: { + combo: "spyicong" + }, }, sptuji2: { onremove: true, diff --git a/character/old.js b/character/old.js index a4f2eaeed9..aaf9d071f3 100755 --- a/character/old.js +++ b/character/old.js @@ -1169,7 +1169,13 @@ game.import("character", function () { content: function () { player.addToExpansion(cards, player, "give").gaintag.add("old_jijun"); }, - ai: { order: 1, result: { player: 1 } }, + ai: { + order: 1, + result: { + player: 1 + }, + combo: "old_fangtong" + }, }, old_fangtong: { trigger: { @@ -1186,6 +1192,9 @@ game.import("character", function () { var winners = player.getFriends(); game.over(player == game.me || winners.includes(game.me)); }, + ai:{ + combo: "oldjijun" + }, }, oldanxu: { enable: "phaseUse", diff --git a/character/sp.js b/character/sp.js index a20e01600f..039a6784a8 100755 --- a/character/sp.js +++ b/character/sp.js @@ -32648,6 +32648,9 @@ game.import("character", function () { player.gain(event.togain, "gain2"); } }, + ai: { + combo: "xinfu_falu" + }, }, zhenyi_spade: { trigger: { From 79b2fd1787e2b493b9a14cba5852d5f1f3e7d6a2 Mon Sep 17 00:00:00 2001 From: Spmario233 Date: Fri, 19 Apr 2024 19:54:40 +0800 Subject: [PATCH 36/36] v1.10.11.2 metadata --- game/update.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/game/update.js b/game/update.js index 3ad3d7dbe6..374e6f21fa 100644 --- a/game/update.js +++ b/game/update.js @@ -1,13 +1,9 @@ window.noname_update = { - version: "1.10.11.1", + version: "1.10.11.2", update: "NULL", //新版本更新文件较多,直接强制进行全量更新 changeLog: [ - "整合@Rintim @mengxinzxz @nonameShijian @lieren2023 @itsnoteasytonameaccount @kuangshen04 @IceCola97 @PZ157 @universe-st @Iking123 @copcap @nineMangos 的Pull Request", - "OL族王广、族王明山、界王异、刘辟、SP孙策;十周年曹芳、武关羽、神华佗、SP甄姬", - "手杀SP毌丘俭、曹髦、成济、李昭&焦伯;海外服颜良、文丑、袁谭", - "添加“无限火力”单挑模式", - "拆分“技能的消耗”和“技能的效果”,加入“按点卖血”等同时机多次发动技能的机制,逐步淘汰direct:true的写法", - "其他AI优化与bug修复", + "整合@Rintim @nonameShijian @copcap @PZ157 @mengxinzxz @lieren2023 的Pull Request", + "bug修复", ], files: [], };