From 3406abaa0ad36c3a17316ec889f60554132e4ae2 Mon Sep 17 00:00:00 2001 From: Salted <44394537+xian18@users.noreply.github.com> Date: Sun, 25 Sep 2022 11:12:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=8F=A0=E5=8A=A0=E6=8F=92=E4=BB=B6=20#2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Readme.md | 3 +- js/plugins.js | 2 + js/plugins/SF_StateSuperpose.js | 98 +++++++++++++++++++++++++++++++++ js/plugins/SF_StatesOverride.js | 24 +------- 4 files changed, 103 insertions(+), 24 deletions(-) create mode 100644 js/plugins/SF_StateSuperpose.js diff --git a/Readme.md b/Readme.md index 0f5669f..eed493c 100644 --- a/Readme.md +++ b/Readme.md @@ -21,9 +21,10 @@ ## 更新记录 +- **2022/9/24**;**咸鱼**;添加了状态叠加插件 #2 - **2022/9/24**;**咸鱼**;添加了状态覆盖插件 #1 - **2022/9/17**;**咸鱼**;修改了 Galv_MessageBusts 支持了预先扫描文件来获取相关信息 -- **2022/9/17**;**咸鱼**;添加了普攻替换插件 # +- **2022/9/17**;**咸鱼**;添加了普攻替换插件 #3 - **2022/9/7**;**面具**;数值整理,素材整理,添加怪物 - **2022/8/30**;**不明枪兵**;更新海上的剧情 - **2022/8/25**;**不明枪兵**;更新海滩前的剧情 diff --git a/js/plugins.js b/js/plugins.js index 73afbfd..ca4aeeb 100644 --- a/js/plugins.js +++ b/js/plugins.js @@ -32,6 +32,8 @@ var $plugins = {"name":"--------------------","status":true,"description":"------------------------------------------------------------","parameters":{}}, {"name":"SF_SkillUpdate","status":true,"description":"v1.0 Allows you to auto Update skills.","parameters":{}}, {"name":"SF_CommonAttack","status":true,"description":"v1.0 普攻替换插件","parameters":{}}, +{"name":"SF_StateSuperpose","status":true,"description":"状态叠加插件","parameters":{}}, +{"name":"SF_StatesOverride","status":true,"description":"状态覆盖插件","parameters":{}}, {"name":"SF_QuestSystem","status":true,"description":"v1.0 Allows you to show quests.","parameters":{"Quest List Window":"","Quest List Window X":"260","Quest List Window Y":"90","Quest List Window Width":"120","Quest List Window Height":"370","Quest List Window Font Size":"18","Quest Detail Window":"","Quest Detail Window X":"380","Quest Detail Window Y":"90","Quest Detail Window Width":"440","Quest Detail Window Height":"370","Quest Detail Window Font Size":"18","Quest Editor":"","Quest Editor Enable":"false","Quest List Info X":"0","Quest List Info Y":"90","Quest List Info Width":"240","Quest List Info Height":"370","Quest List Info Font Size":"18"}}, {"name":"--------------------","status":true,"description":"------------------------------------------------------------","parameters":{}}, {"name":"MOG_ActorHud","status":true,"description":"(v2.0 *) Adiciona uma Hud com os parâmetros do personagem.","parameters":{"-> MAIN <<<<<<<<<<<<<<<<<<<<<<<":"","Initial Visible":"true","Hud X-Axis":"0","Hud Y-Axis":"0","Smart Fade":"true","Auto Fade":"true","":"","-> LAYOUT 2 <<<<<<<<<<<<<<<<<<<<<<<":"","Layout Overlay Visible":"false","Layout Overlay X-Axis":"0","Layout Overlay Y-Axis":"0","-> FACE <<<<<<<<<<<<<<<<<<<<<<<":"","Face Visible":"true","Face X-Axis":"51","Face Y-Axis":"50","Face Priority":"1","-> NAME <<<<<<<<<<<<<<<<<<<<<<<":"","Name Visible":"false","Name X-Axis":"5","Name Y-Axis":"20","Name Font Size":"20","Name Bold Size":"4","Name Font Italic":"false","-> HP <<<<<<<<<<<<<<<<<<<<<<<":"","HP Meter Visible":"true","HP Meter X-Axis":"110","HP Meter Y-Axis":"33","HP Meter Angle":"0","HP Meter Flow Anime":"true","HP Meter Flow Speed":"4","HP Number Visible":"false","HP Number Align":"0","HP Number X-Axis":"270","HP Number Y-Axis":"70","MaxHP Number Visible":"false","MaxHP Number X-Axis":"185","MaxHP Number Y-Axis":"40","HP Icon Visible":"false","HP Icon Half Mode":"false","HP Icon Max Colors":"2","HP Icon Max Rows":"10","HP Icon Max Columns":"2","HP Icon X-Axis":"143","HP Icon Y-Axis":"85","HP Icon Space X":"0","HP Icon Space Y":"0","HP Icon Zoom Anime":"true","-> MP <<<<<<<<<<<<<<<<<<<<<<<":"","MP Meter Visible":"true","MP Meter X-Axis":"110","MP Meter Y-Axis":"48","MP Meter Angle":"0","MP Meter Flow Anime":"true","MP Meter Flow Speed":"4","MP Number Visible":"false","MP Number Align":"0","MP Number X-Axis":"287","MP Number Y-Axis":"100","MaxMP Number Visible":"false","MaxMP Number X-Axis":"196","MaxMP Number Y-Axis":"78","MP Icon Visible":"false","MP Icon Half Mode":"false","MP Icon Max Colors":"2","MP Icon Max Rows":"10","MP Icon Max Columns":"2","MP Icon X-Axis":"143","MP Icon Y-Axis":"120","MP Icon Space X":"0","MP Icon Space Y":"0","MP Icon Zoom Anime":"true","-> TP <<<<<<<<<<<<<<<<<<<<<<<":"","TP Meter Visible":"false","TP Meter X-Axis":"143","TP Meter Y-Axis":"50","TP Meter Angle":"0","TP Meter Flow Anime":"true","TP Meter Flow Speed":"4","TP Number Visible":"false","TP Number Align":"0","TP Number X-Axis":"270","TP Number Y-Axis":"130","MaxTP Number Visible":"false","MaxTP Number X-Axis":"185","MaxTP Number Y-Axis":"116","TP Icon Visible":"false","TP Icon Half Mode":"false","TP Icon Max Colors":"2","TP Icon Max Rows":"10","TP Icon Max Columns":"2","TP Icon X-Axis":"143","TP Icon Y-Axis":"50","TP Icon Space X":"0","TP Icon Space Y":"0","TP Icon Zoom Anime":"true","-> EXP <<<<<<<<<<<<<<<<<<<<<<<":"","EXP Meter Visible":"true","EXP Meter X-Axis":"110","EXP Meter Y-Axis":"63","EXP Meter Angle":"0","Level Number Visible":"false","Level Number Align":"1","Level Number X-Axis":"65","Level Number Y-Axis":"153","-> STATES <<<<<<<<<<<<<<<<<<<<<<<":"","States Visible":"false","States X-Axis":"5","States Y-Axis":"64"}}, diff --git a/js/plugins/SF_StateSuperpose.js b/js/plugins/SF_StateSuperpose.js new file mode 100644 index 0000000..42a120d --- /dev/null +++ b/js/plugins/SF_StateSuperpose.js @@ -0,0 +1,98 @@ +//============================================================================= +// Salted Fish Plugins - State Superpose +// SF_StateSuperpose.js +//============================================================================= +"use strict"; +var Imported = Imported || {}; +Imported.SF_StateSuperpose = True; + +var SF_Plugins = SF_Plugins || {}; +//============================================================================= +/*: + * @plugindesc 状态叠加插件 + * @author Salted Fish + * + * @help + * ============================================================================ + * 介绍 + * ============================================================================ + * 获得同类状态时,将已有的同类状态持续时间刷新到与新获得的同类状态一致 + * + * 使用 状态ID 作为状态的类别标识。 + * + * ============================================================================ + * 使用 + * ============================================================================ + * + * + * ============================================================================ + * 举例 + * ============================================================================ + * 定义五个状态 + * 1.a 抓伤a + * 1.b 抓伤b + * 1.c 抓伤c + * 1.d 抓伤d + * 1.e 抓伤e + * + * 插件需要实现的效果是: + * 在拥有1.a 抓伤a的情况下,获得1.e抓伤e, + * 则将1.a抓伤a的持续回合数刷新到与1.e抓伤e相同 + * + * 在拥有1.b 抓伤b和1.d 抓伤d的情况下,获得1.a 抓伤a, + * 则将1.b 抓伤b和1.d 抓伤d的持续回合数刷新到与1.a 抓伤a相同 + * + * ============================================================================ + * 已知问题 + * ============================================================================ + * - 与状态覆盖插件不兼容,不能两个状态既属于需要覆盖的,又属于需要叠加的。 + * 如果出现这种情况,取决于在插件列表中的顺序,行为暂时不可预测 + * + */ +//============================================================================= +SF_Plugins.SF_StateSuperpose = SF_Plugins.SF_StateSuperpose || {}; +SF_Plugins.SF_StateSuperpose.version = 1.0; + +//============================================================================= +// DataManager +//============================================================================= + +SF_Plugins.SF_StateSuperpose.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded; +DataManager.isDatabaseLoaded = function () { + if (!SF_Plugins.SF_StateSuperpose.DataManager_isDatabaseLoaded.call(this)) return false; + if (!this.SF_StateSuperpose_isDatabaseLoaded($dataStates)) return false; + return true; +}; + +DataManager.SF_StateSuperpose_isDatabaseLoaded = function (group) { + var note = //i; + for (var i = 1; i < group.length; i++) { + var obj = group[i]; + var noteData = obj.note.split(/[\r\n]+/); + for (var j = 0; j < noteData.length; j++) { + var line = noteData[j]; + if (line.match(note)) { + obj.SF_StateSuperpose_ID = RegExp.$1; + } + } + } + return true; +}; + +//============================================================================= +// Game_Battler +//============================================================================= +SF_Plugins.SF_StateSuperpose.GameBattler_addState = Game_Battler.prototype.addState; +Game_Battler.prototype.addState = function (stateId) { + SF_Plugins.SF_StateOverride.GameBattler_addState.call(this, stateId); + + var stateSuperpose_ID = $dataStates[stateId].SF_StateSuperpose_ID; + if (this.result().isStateAdded(stateId) && stateSuperpose_ID !== undefined) { + var turns = this._stateTurns[stateId]; + this.states().forEach(function (state) { + if (state.SF_StateSuperpose_ID === stateSuperpose_ID) { + this._stateTurns[stateId] = turns; + } + }, this); + } +}; diff --git a/js/plugins/SF_StatesOverride.js b/js/plugins/SF_StatesOverride.js index 0df6915..4d7c2e6 100644 --- a/js/plugins/SF_StatesOverride.js +++ b/js/plugins/SF_StatesOverride.js @@ -63,7 +63,7 @@ SF_Plugins.SF_StateOverride.version = 1.0; SF_Plugins.SF_StateOverride.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded; DataManager.isDatabaseLoaded = function () { - if (!SF_Plugins.SF_SkillUpdate.DataManager_isDatabaseLoaded.call(this)) return false; + if (!SF_Plugins.SF_StateOverride.DataManager_isDatabaseLoaded.call(this)) return false; if (!this.SF_StateOverride_isDatabaseLoaded($dataStates)) return false; return true; }; @@ -116,25 +116,3 @@ Game_Battler.prototype.addState = function (stateId) { } SF_Plugins.SF_StateOverride.GameBattler_addState.call(this, stateId); }; - -SF_Plugins.SF_StateOverride.GameBattler_isStateAddable = Game_Battler.prototype.isStateAddable; -Game_Battler.prototype.isStateAddable = function (stateId) { - if (!SF_Plugins.SF_StateOverride.GameBattler_isStateAddable.call(this, stateId)) { - return false; - } - - // 判断是否存在优先级更高的状态 - var needAddState = $dataStates[stateId]; - var isAddable = true; - if (needAddState.SF_StateOverride_ID != undefined) { - this.states().forEach(function (state) { - if ( - state.SF_StateOverride_ID === needAddState.SF_StateOverride_ID && - state.SF_StateOverride_Priority > needAddState.SF_StateOverride_Priority - ) { - isAddable = false; - } - }); - } - return isAddable; -};