(要YEP_EnemyLevels.js)難易度を変更できるオプション設定プラグイン – YEP_X_DifficultySlider.js

タイトル
(Requires YEP_EnemyLevels.js) Give your playersaccess to an option that allows them to change difficulty.
作者名
ヘルプ
============================================================================
Introduction
============================================================================

This plugin requires YEP_EnemyLevels.
Make sure this plugin is located under YEP_EnemyLevels in the plugin list.

Sometimes, players would like to be able to increase or decrease the
difficulty of your game at their own accord. The Difficulty Slider becomes a
feature accessible from the game's option menu with this plugin installed.
There, the player is able to alter the level of the enemies that appear in
battle within a certain range (set by you, the developer).

The Difficulty Slider will only alter the level of the enemies and nothing
else. Therefore, a 200% difficulty will mean only a 200% increase in level
but not necessarily a 200% increase in ATK, for example. The enemies' ATK
value will be based off of its ATK at 200% the original level.

If the Difficulty Slider is disabled in the game, then the level multiplier
will revert back to 100%. You can enable and disable this feature at will
through plugin commands.

============================================================================
Notetags
============================================================================

There is a notetag you can use for the Difficulty Slider plugin.

Enemy Notetag:

<Unaffected by Difficulty Slider>
- This will make the enemy's level unaffected by the difficulty slider,
meaning the enemy will always be at 100% its current calculated level.

============================================================================
Plugin Commands
============================================================================

For those who wish to show/hide the Difficulty Slider from the options menu
midway through the game, you can control it using these plugin commands:

Plugin Commands:

ShowDifficultySlider
- This will show the Difficulty Slider and enable it making it apply to
all enemies in the game that do not have an unaffected notetag.

HideDifficultySlider
- This will hide the Difficulty Slider and also disable the slider's
effects on enemy levels in the game.

============================================================================
Additional Info
============================================================================

For those who wish to use the Difficulty Slider in script calls, you can
find out the value the player has set using:

ConfigManager.difficultySlider

This value will return a whole number. A difficulty setting of 100% will
yield 100 and a difficulty setting of 200% will yield 200. Therefore, if you
wish to make a check that appears only on higher difficulties, you can use
the following:

if (ConfigManager.difficultySlider >= 200) {
Do stuff
}

Have fun!

============================================================================
Options Core Settings - Adding the New Options
============================================================================

If you are using YEP_OptionsCore.js, you can add a new Option using this
plugin. Here's the following code/parameter settings you can use with it.

---------
Settings:
---------

Name:
\i[87]Enemy Difficulty

Help Description:
Determines the level strength of enemies.

Symbol:
difficultySlider

Show/Hide:
if (Imported.YEP_X_DifficultySlider) {
show = $gameSystem.showDifficultySlider();
} else {
show = false;
}

Enable:
enabled = true;

Ext:
ext = 0;

----------
Functions:
----------

Make Option Code:
this.addCommand(name, symbol, enabled, ext);

Draw Option Code:
var rect = this.itemRectForText(index);
var statusWidth = this.statusWidth();
var titleWidth = rect.width - statusWidth;
this.resetTextColor();
this.changePaintOpacity(this.isCommandEnabled(index));
this.drawOptionsName(index);
var value = this.getConfigValue(symbol);
var rate = value / Yanfly.Param.DSliderMaxDif;
var gaugeColor1 = this.textColor(28);
var gaugeColor2 = this.textColor(29);
this.drawOptionsGauge(index, rate, gaugeColor1, gaugeColor2);
this.drawText(this.statusText(index), titleWidth, rect.y, statusWidth, 'center');

Process OK Code:
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
value += Yanfly.Param.DSliderChange;
if (value > Yanfly.Param.DSliderMaxDif) value = Yanfly.Param.DSliderMinDif;
value = value.clamp(Yanfly.Param.DSliderMinDif, Yanfly.Param.DSliderMaxDif);
this.changeValue(symbol, value);

Cursor Right Code:
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
value += Yanfly.Param.DSliderChange;
value = value.clamp(Yanfly.Param.DSliderMinDif, Yanfly.Param.DSliderMaxDif);
this.changeValue(symbol, value);

Cursor Left Code:
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
value -= Yanfly.Param.DSliderChange;
value = value.clamp(Yanfly.Param.DSliderMinDif,
Yanfly.Param.DSliderMaxDif);
this.changeValue(symbol, value);

Default Config Code:
Empty. Provided by this plugin.

Save Config Code:
Empty. Provided by this plugin.

Load Config Code:
Empty. Provided by this plugin.

============================================================================
Changelog
============================================================================

Version 1.04:
- Bypass the isDevToolsOpen() error when bad code is inserted into a script
call or custom Lunatic Mode code segment due to updating to MV 1.6.1.

Version 1.03:
- Compatibility update for YEP_OptionsCore.js.

Version 1.02:
- Updated for RPG Maker MV version 1.5.0.

Version 1.01:
- Bug fixed: Error with pressing right on the difficulty slider causing
the game to crash unexpectedly.

Version 1.00:
- Finished Plugin!
パラメータ
param ---Options---
default
param Command Text
parent ---Options---
desc How the command appears in the options menu.
default Difficulty

param Default Show
parent ---Options---
type boolean
desc Show the command by default? If off, defaults to 100.
ON - true OFF - false
default true

param ---Settings---
default
param Default Difficulty
parent ---Settings---
desc This is the default difficulty value.
type Number
default 100

param Minimum Difficulty
parent ---Settings---
desc This is the minimum difficulty value.
type Number
default 50

param Maximum Difficulty
parent ---Settings---
desc This is the maximum difficulty value.
type Number
default 200

param Change Increment
parent ---Settings---
desc This is the amount the difficulty changes per increment
type Number
default 25

param ---Formulas---
default
param Base Level Formula
parent ---Formulas---
desc The formula used to determine the base level.
level - current level multiplier - multiplier value
default levelmultiplier / 100

param Maximum Level Formula
parent ---Formulas---
desc The formula used to determine the maximum level.
level - current level multiplier - multiplier value
default levelmultiplier / 100

param Minimum Level Formula
parent ---Formulas---
desc The formula used to determine the minimum level.
level - current level multiplier - multiplier value
default levelmultiplier / 100

ライセンス表記

紹介ページ http://yanfly.moe/