|
原地址:[MZ] Event Interaction Hint | RPG Maker Forums (rpgmakerweb.com)
作者:Dustb0
预览:
汉化脚本:
- /*:
- * @plugindesc 靠近事件时展示气泡动画
- * 汉化 by 烁灵 更多插件请访问 www.hknmtt.com
- * @author Dustb0
- * @version 1.2
- *
- * @param balloonID
- * @text 气泡 ID
- * @type number
- * @default 11
- *
- * @help
- * 使用方法:
- * 在事件备注区填写
- * <interact>
- * 即可
- *
- * 如果只想在指定事件页产生气泡,则在事件指令的第一行使用“注释”:
- * \interact
- * 在注释中可以指定气泡ID:
- * \interact[balloon=12]
- * 也可以仅在指定方向上应用气泡效果:
- * \interact[dir=8, balloon=12]
- * (8 = 上, 6 = 右, 2 = 下, 4 = 左)
- *
- */
- (() => {
- const parameters = PluginManager.parameters("SDE_InteractPop");
- const paramBalloonID = Number(parameters["balloonID"])
- Game_Player.prototype.startMapEvent = function(x, y, triggers, normal) {
- if (!$gameMap.isEventRunning()) {
- for (const event of $gameMap.eventsXy(x, y)) {
- if (
- event.isTriggerIn(triggers) &&
- event.isNormalPriority() === normal
- ) {
- event.start();
- } else if (event.page() &&
- event.list().length > 0 &&
- event.list()[0].code === 108 &&
- event.list()[0].parameters[0].match(/\\interact\s*/i)) {
- // Event Page Comment
- // Check direction condition
- const direction = event.list()[0].parameters[0].match(/dir\=(\d)\D*\s*/i);
- if (direction && Number(direction[1]) !== $gamePlayer.direction()) {
- return;
- }
- let balloon = event.list()[0].parameters[0].match(/balloon\=(\d+)\D*\s*/i);
- requestBalloon(balloon ? Number(balloon[1]) : paramBalloonID);
- } else if (event.event().meta["interact"] && event.findProperPageIndex() >= 0) {
- // Event
- let balloonID = paramBalloonID
- // Check if default param gets overriden by event
- if (typeof event.event().meta["interact"] === 'string') {
- balloonID = Number(event.event().meta["interact"]);
- }
- requestBalloon(balloonID);
- }
- }
- }
- }
- requestBalloon = function(balloonID) {
- if ($gamePlayer.requestBalloon) {
- $gamePlayer.requestBalloon(balloonID); // MV
- } else {
- $gameTemp.requestBalloon($gamePlayer, balloonID); // MZ
- }
- }
- })();
复制代码
|
|