当前位置: 首页 > news >正文

RPGMZ 清爽战斗界面

个人记录保存

//================================================================================================= // Fun_Battle.js //================================================================================================= /*: * @target MZ * @plugindesc 战斗系统改造。 * @author 希夷先生 * * @help * 插件功能:战斗系统改造 */ (() => { //=============================战斗开始============================= const _Scene_Battle_prototype_start = Scene_Battle.prototype.start; Scene_Battle.prototype.start = function() { _Scene_Battle_prototype_start.call(this); //PluginManager.callCommand($gameMap._interpreter, "Fun_Mess_Auto", "开启自动跳过", "开启自动跳过"); }; //=============================战斗结束============================= const _Scene_Battle_prototype_stop = Scene_Battle.prototype.stop; Scene_Battle.prototype.stop = function(){ _Scene_Battle_prototype_stop.call(this); //PluginManager.callCommand($gameMap._interpreter, "Fun_Mess_Auto", "关闭自动跳过", "关闭自动跳过"); }; const _Scene_Map_prototype_updateEncounterEffect = Scene_Map.prototype.updateEncounterEffect; Scene_Map.prototype.updateEncounterEffect = function() { if (this._encounterEffectDuration > 0) { this._encounterEffectDuration--; const speed = this.encounterEffectSpeed(); const n = speed - this._encounterEffectDuration; const p = n / speed; const q = ((p - 1) * 20 * p + 5) * p + 1; const zoomX = $gamePlayer.screenX(); const zoomY = $gamePlayer.screenY() - 24; if (n === 2) { $gameScreen.setZoom(zoomX, zoomY, 1); this.snapForBattleBackground(); //this.startFlashForEncounter(speed / 2); } //$gameScreen.setZoom(zoomX, zoomY, q); if (n === Math.floor(speed / 6)) { //this.startFlashForEncounter(speed / 2); } if (n === Math.floor(speed / 2)) { BattleManager.playBattleBgm(); this.startFadeOut(this.fadeSpeed()); } } }; //战斗结束处理 BattleManager.updateBattleEnd = function() { if (this.isBattleTest()) { AudioManager.stopBgm(); SceneManager.exit(); } else if (!this._escaped && $gameParty.isAllDead()) { //战斗失败回到上一个界面 不结束游戏 $gameParty.reviveBattleMembers(); SceneManager.pop(); } else { SceneManager.pop(); } this._phase = ""; }; //修改为10帧 瞬间渐变进入战斗 Scene_Map.prototype.encounterEffectSpeed = function() { return 10; }; //战斗失败 文本关闭 const _BattleManager_displayDefeatMessage = BattleManager.displayDefeatMessage; BattleManager.displayDefeatMessage = function() { //$gameMessage.add(TextManager.defeat.format($gameParty.name())); }; //敌人出现文本消息 //=================== 保存原始的 BattleManager.displayStartMessages 方法========================== const _BattleManager_displayStartMessages = BattleManager.displayStartMessages; BattleManager.displayStartMessages = function() { // 移除敌人出现消息的循环 // 移除先手/偷袭状态提示 //战斗开始 //if (this._preemptive) { // $gameMessage.add(TextManager.preemptive.format($gameParty.name())); //} else if (this._surprise) { // $gameMessage.add(TextManager.surprise.format($gameParty.name())); //} }; //战斗结算文本消息 //=================== 保存原始的 BattleManager.displayVictoryMessage 方法========================== const _BattleManager_displayVictoryMessage = BattleManager.displayVictoryMessage; BattleManager.displayVictoryMessage = function() { //$gameMessage.add(TextManager.victory.format($gameParty.name())); }; //战斗胜利 显示经验 BattleManager.displayExp = function() { const exp = this._rewards.exp; if (exp > 0) { const text = TextManager.obtainExp.format(exp, TextManager.exp); console.log("战斗胜利:" + text); $gameMessage.add("\\." + text); } }; //去掉升级信息 Game_Actor.prototype.shouldDisplayLevelUp = function() { return false; }; //去掉掉落物品信息 BattleManager.displayDropItems = function() { }; //去掉AB显示 Game_Enemy.prototype.setPlural = function(plural) { this._plural = false; }; Scene_Battle.prototype.statusWindowRect = function() { const extra = 10; const ww = Graphics.boxWidth - 192; const wh = this.windowAreaHeight() - 30; const wx = 1000; const wy = 1000; return new Rectangle(wx, wy, ww, wh); }; Window_BattleEnemy.prototype.initialize = function(rect) { this._enemies = []; Window_Selectable.prototype.initialize.call(this, rect); this.refresh(); this.hide(); // 1. 窗口整体透明 this.opacity = 0; // 2. 背景透明 this.backOpacity = 0; // 3. 边框隐藏 this.frameVisible = false; // 4. 黑色遮罩隐藏 this.hideBackgroundDimmer(); // 5. 关键:不绘制任何内容(文字、头像、图标全都不画) this.contentsOpacity = 0; }; // --- 关键:去掉选中项背景阴影 --- Window_BattleEnemy.prototype.drawItemBackground = function(index) { // 空函数:不画任何背景 }; // --- 关键:不画光标/选择框阴影 --- Window_BattleEnemy.prototype.drawCursor = function(x, y, width, height) { // 空函数:不画光标 }; Scene_Battle.prototype.partyCommandWindowRect = function() { const ww = 192; const wh = this.windowAreaHeight(); const wx = Graphics.boxWidth / 2 - ww / 2 const wy = Graphics.boxHeight / 2 - wh / 2; return new Rectangle(wx, wy, ww, wh); }; Scene_Battle.prototype.actorCommandWindowRect = function() { const ww = 192; const wh = this.windowAreaHeight(); const wx = Graphics.boxWidth / 2 - ww / 2 const wy = Graphics.boxHeight / 2 - wh / 2; return new Rectangle(wx, wy, ww, wh); }; Scene_Battle.prototype.createActorCommandWindow = function() { const rect = this.actorCommandWindowRect(); const commandWindow = new Window_ActorCommand(rect); //commandWindow.y = Graphics.boxHeight - commandWindow.height; commandWindow.setHandler("attack", this.commandAttack.bind(this)); commandWindow.setHandler("skill", this.commandSkill.bind(this)); commandWindow.setHandler("guard", this.commandGuard.bind(this)); commandWindow.setHandler("item", this.commandItem.bind(this)); commandWindow.setHandler("cancel", this.commandCancel.bind(this)); this.addWindow(commandWindow); this._actorCommandWindow = commandWindow; }; Window_PartyCommand.prototype.initialize = function(rect) { Window_Command.prototype.initialize.call(this, rect); this.openness = 0; this.deactivate(); this.backOpacity = 0; // 3. 边框隐藏 this.frameVisible = false; }; Window_ActorCommand.prototype.initialize = function(rect) { Window_Command.prototype.initialize.call(this, rect); this.openness = 0; this.deactivate(); this._actor = null; this.backOpacity = 0; // 3. 边框隐藏 this.frameVisible = false; }; Window_BattleSkill.prototype.initialize = function(rect) { Window_SkillList.prototype.initialize.call(this, rect); this.hide(); this.backOpacity = 0; // 3. 边框隐藏 this.frameVisible = false; }; Window_BattleItem.prototype.initialize = function(rect) { Window_ItemList.prototype.initialize.call(this, rect); this.hide(); this.backOpacity = 0; // 3. 边框隐藏 this.frameVisible = false; }; Window_Help.prototype.initialize = function(rect) { Window_Base.prototype.initialize.call(this, rect); this._text = ""; if (SceneManager._scene instanceof Scene_Battle) { // 3. 边框隐藏 this.frameVisible = false; } }; Window_Message.prototype.initialize = function(rect) { Window_Base.prototype.initialize.call(this, rect); this.openness = 0; this.initMembers(); if (SceneManager._scene instanceof Scene_Battle) { // 3. 边框隐藏 this.frameVisible = false; } }; Window.prototype._updatePauseSign = function() { //取消暂停标记 }; Window_Scrollable.prototype.updateArrows = function() { this.downArrowVisible = false; this.upArrowVisible = false; }; })();

非常的清爽

结尾总结

Project1论坛 小圈子 人才 离开

http://www.cnnetsun.cn/news/1915894.html

相关文章:

  • GitHub仓库搬家实战:从Fork到本地Ubuntu,再到同步上游更新的完整工作流
  • 3个核心疑问:为什么你的ComfyUI-Impact-Pack安装总是失败?
  • 如何用三月七小助手实现崩坏星穹铁道全自动游戏管理:终极指南
  • 乙二醇脱醛技术研究
  • AsrTools:5分钟上手,让音频文件批量转字幕变得如此简单
  • RT-Thread PWM驱动电机调速实战——基于STM32F407
  • 论文小白逆袭指南:书匠策AI——你的课程论文“外挂神器”
  • Docker Swarm服务发现到底怎么玩?一个Overlay网络+Stack的完整微服务通信Demo
  • 51单片机复位电路电容选型实战:从10uF到8uF的取舍与计算
  • 从底线防守到体验破局,数美广告素材审核解决方案升级!
  • StarRocks数据类型深度解析:从基础到复杂,构建高效数据模型
  • Python实战:用pynput库5分钟搞定鼠标键盘监听(附完整代码)
  • 从零调参到稳定飞行:手把手教你调试Mahony姿态解算的Kp和Ki参数(附MPU6050实测数据)
  • 大模型的“记忆“:无状态架构如何实现个性化对话体验?
  • 国内萨克斯演奏家森林受邀参演沃伦·希尔上海演奏会 与国际大师同台交流
  • BilibiliDown免费下载器:3步完成B站视频下载的终极指南
  • TypeScript基础语法使用参考
  • 你还在用tag管理Qwen-VL和InternVL?这5个未公开的版本管理反模式,正悄悄吞噬你的多模态推理稳定性(含真实SLO跌落日志截图)
  • League Akari:英雄联盟玩家的智能助手,三大核心功能提升游戏体验
  • ThinkPad风扇控制终极方案:TPFanCtrl2让你的笔记本告别噪音与过热
  • AI时代工程师的超级进化论
  • 从图形化到命令行:一次 SVN 工程化能力补齐与流程治理实践(Windows)
  • 15分钟掌握libIEC61850:电力自动化通信的标准化解决方案
  • STM32内存管理全解析:从map文件看堆、栈、bss段的内存分配机制
  • 三阶跃迁:ChemBERTa如何用Transformer架构重塑药物研发范式
  • 10. C++17新特性-保证的拷贝消除 (Guaranteed Copy Elision / RVO)
  • AUTOSAR从入门到精通-【自动驾驶】自动驾驶激光雷达点云畸变的成因与解决方案
  • Electron终端中文乱码终结者:动态编码检测与转换实战
  • 零基础复盘:从命令行运行 Python 文件失败到成功,我踩过的 5 个坑
  • AI地铁轻轨门控系统功率MOSFET选型方案——高可靠、快速响应与长寿命驱动系统设计指南