查看: 5152|回复: 1

[搬运汉化] 死亡执行公共事件

[复制链接]
梦石
0
星屑
2457
在线时间
912 小时
注册时间
2014-10-14
回帖
1155

开拓者

发表于 2020-11-23 20:56:29 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×


即使在战斗中被消灭,游戏也不会结束。
当参数指定的开关为ON时
如果在战斗中被消灭,游戏将不会结束,
移至地图屏幕后执行常见事件。

*未经作者许可,可以修改和重新分发,
*使用方式没有任何限制(商业用途,18种禁止使用等)。


[pre lang="ruby"]/*
* --------------------------------------------------
* MNKR_NoLose Ver.1.2.0
* Copyright (c) 2020 Munokura
* This software is released under the MIT license.
* http://opensource.org/licenses/mit-license.php
* --------------------------------------------------
*/

/*:
* @target MZ MV
* @url https://raw.githubusercontent.co ... ster/MNKR_NoLose.js
* @plugindesc 死亡执行公共事件。
* @author munokura
*
* @param Switch Id
* @text スイッチID
* @type switch
* @desc 発動させるスイッチID
* @default 11
*
* @param Common Id
* @type common_event
* @text コモンイベントID
* @desc 全滅時に実行するコモンイベント
* 戦闘終了後にマップで実行されます。
* @default 0
*
* @help
* パラメーターで指定したスイッチがONの時、
* 戦闘で全滅するとゲームオーバーにならず、
* マップ画面へ移行後にコモンイベントを実行します。
*
* プラグインコマンドはありません。
*
*
* 利用規約:
*   MITライセンスです。
*   https://ja.osdn.net/projects/ope ... enses%2FMIT_license
*   作者に無断で改変、再配布が可能で、
*   利用形態(商用、18禁利用等)についても制限はありません。
*/

(function() {
    'use strict'

    const pluginName = 'MNKR_NoLose';
    const parameters = PluginManager.parameters(pluginName);
    const switchId = Number(parameters['Switch Id'] || 11);
    const commonId = Number(parameters['Common Id'] || 0);

    const _BattleManager_setup = BattleManager.setup
    BattleManager.setup = function(troopId, canEscape, canLose) {
        _BattleManager_setup.apply(this, arguments);
        if ($gameSwitches.value(switchId)) {
            this._canLose = true;
        }
    }

    const _BattleManager_updateBattleEnd = BattleManager.updateBattleEnd
    BattleManager.updateBattleEnd = function() {
        _BattleManager_updateBattleEnd.call(this);
        if ($gameSwitches.value(switchId) && commonId > 0) {
            $gameTemp.reserveCommonEvent(commonId);
        }
    }

})()[/pre]
------落尽红樱君不见,轻绘梨花泪沾衣。~~~
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部