/*:
* @plugindesc Allows players to distribute points to different stats of the Actors at his or her discretion.
* @author SumRndmDde
*
* @param Default Stats
* @desc A list of stats Actors can distribute to by default.
* All of the available stats can be found in HELP.
* @default mhp, mmp, atk, def, mat, mdf, agi, luk
*
* @param Default Formula
* @desc The default formula used for determining how many "stat points" an Actor gains by leveling up.
* @default Math.ceil(level / 10)
*
* @param Show on Menu
* @desc If 'true', this plugin will place the command in the menu.
* @default true
*
* @param == Stat Reset ==
* @default
*
* @param Allow Stat Resets
* @desc If 'true', then players will have the option to reset the distributed stats and return the used stat points.
* @default true
*
* @param Reset Gold Cost
* @desc The formula determining the amount of gold for resetting.
* Use "points" to reference the amount of points used.
* @default points * 100
*
* @param == Custom Texts ==
* @default
*
* @param Level Up Message
* @desc This message is displayed when an actor levels up to show how many points were gained. %1 is the number of points.
* @default Got %1 stat points!
*
* @param Command Name
* @desc The is the name of the command for stat distribution in the menu.
* @default Stat Boost
*
* @param Points Text
* @desc The text used to display how much points an Actor has.
* @default Stat Points:
*
* @param Upgrade Text
* @desc The text used to display how much points an upgrade is worth.
* @default Upgrade Cost:
*
* @param Spend Text
* @desc The text used in the command window to begin spending.
* @default Spend
*
* @param Reset Text
* @desc The text used in the command window to reset stat points.
* @default Reset
*
* @param Finish Text
* @desc The text used in the command window to leave the scene.
* @default Finish
*
* @param == Gauge Options ==
* @default
*
* @param Use Gauges
* @desc If 'true', the stat distribution will have gauges representing how close the distributed stat is to reaching its max.
* @default true
*
* @param Gauge Height
* @desc The height of the gauges used in the stat distribution.
* @default 14
*
* @param == Points Label ==
* @default
*
* @param Point Icon
* @desc Input the icon index of the icon for stat points.
* Set to 0 to use text instead.
* @default 87
*
* @param Point Text
* @desc If "Point Icon" is set to 0, this will be used as the label for stat points.
* @default Points
*
* @param Point Color
* @desc If using text, this will be the color of the text.
* @default #66ff66
*
* @help
*
* Stat Distribution
* Version 1.07
* SumRndmDde
*
*
* This plugin allows players to distribute points to different stats of the
* Actors at his or her discretion. A command is added to the menu which allows
* access to a new menu for stat distribution!
*
*
* ==============================================================================
* Plugin Commands
* ==============================================================================
*
* Use the following plugin commands to preform various actions.
*
*
*
* OpenStatDistribution Actor [actorId]
*
* This opens the Stat Distribution Menu for the specified Actor ID.
*
*
*
* OpenStatDistribution Party [memberIndex]
*
* This opens the Stat Distribution Menu for the specified Actor based on the
* index in which they are in the party. For example, setting "memberIndex"
* to 0 will open the menu for the party's leader.
*
*
*
* AddStatPoints Actor [actorId] [points]
* AddStatPoints Party [memberIndex] [points]
*
* This adds a specific amount points to a specific Actor.
*
*
* ==============================================================================
* Upgradeable Stats
* ==============================================================================
*
* In order to determine what stats can be upgraded, use the "Default Stats"
* Parameter. Otherwise, notetags can be used to customize the stats
* per each individual Actor:
*
*
*
*
* Sets the Actor's stats to this list.
*
*
*
*
*
* Adds stats to the Actor's already existing upgradeable stats.
*
*
* ==============================================================================
* How to Customize Stats
* ==============================================================================
*
* In order to customize the properties of stats, you must use the Database EX.
* Simply go to the customizable editors, and select "Stat Distribution Editor".
*
* Within here, a list of stats will be available and their variables can
* be changed to fit with your needs. Be sure to reload to see the changes!
*
*
* ==============================================================================
* List of Upgradeable Stats
* ==============================================================================
*
* Here is a list of all the available stats and their three-letter codes.
*
*
* == Base Stats ==
* mhp - Max HP
* mmp - Max MP
* atk - Attack
* def - Defense
* mat - Magical Attack
* mdf - Magical Defense
* agi - Agility
* luk - Luck
*
* == Ex Stats ==
* hit - Hit Rate
* eva - Evasion Rate
* cri - Critical Rate
* cev - Critical Evasion Rate
* mev - Magic Evasion Rate
* mrf - Magic Reflection Rate
* cnt - Counter Attack Rate
* hrg - Hp Regeneration
* mrg - Mp Regeneration
* trg - Tp Regeneration
*
* == Sp Stats ==
* tgr - Target Rate
* grd - Guard Effect Rate
* rec - Recovery Effect Rate
* pha - Pharmacology
* mcr - Mp Cost Rate
* tcr - Tp Charge Rate
* pdr - Physical Damage Rate
* mdr - Magical Damage Rate
* fdr - Floor Damage Rate
* exr - Experience Rate
*
*
* ==============================================================================
* Stat Points
* ==============================================================================
*
* Stat points can be gained by leveling up the Actors.
* The "Default Formula" Parameter can be used to set up a formula for how many
* stat points an Actor will gain upon level. Alternatively, the following
* notetags can be used to give Actors their own formulas:
*
*
*
* For example:
*
*
*
*
* ==============================================================================
* End of Help File
* ==============================================================================
*
* Welcome to the bottom of the Help file.
*
*
* Thanks for reading!
* If you have questions, or if you enjoyed this Plugin, please check
* out my YouTube channel!
*
* https://www.youtube.com/c/SumRndmDde
*
*
* Until next time,
* ~ SumRndmDde
*
*/
/*:ja
* @plugindesc アクターの能力値にプレイヤーの裁量でポイントを分配できるシステムです。
* @author SumRndmDde
*
* @param Default Stats
* @text デフォルト能力値
* @desc デフォルトでアクターが割当可能な能力値のリスト
* 利用可能な能力値はヘルプ参照
* @default mhp, mmp, atk, def, mat, mdf, agi, luk
*
* @param Default Formula
* @text デフォルト式
* @desc アクターがレベルアップすることで得られる能力値ポイントの値を決定するデフォルトの計算式
* @default Math.ceil(level / 10)
*
* @param Show on Menu
* @text メニュー表示
* @type boolean
* @on 表示
* @off 非表示
* @desc メニューにコマンドを表示
* 表示:true / 非表示:false
* @default true
*
* @param == Stat Reset ==
* @text -- 能力値リセット
* @default
*
* @param Allow Stat Resets
* @text 能力値リセット許可
* @type boolean
* @on 許可
* @off 禁止
* @desc プレイヤーは割当された能力値をリセットして使用済みの能力値ポイントを戻せます
* @default true
*
* @param Reset Gold Cost
* @text リセット所持金コスト
* @desc リセットのための所持金の量を決定する式
* points:使用ポイント量
* @default points * 100
*
* @param == Custom Texts ==
* @text -- カスタムテキスト
* @default
*
* @param Level Up Message
* @text レベルアップメッセージ
* @desc アクターがレベルアップした時の表示メッセージ
* 獲得したポイント数:%1
* @default %1能力値ポイントを得た!
*
* @param Command Name
* @text コマンド名
* @desc メニュー中の能力値割当のコマンド名
* @default 能力値割当
*
* @param Points Text
* @text ポイントのラベル
* @desc アクターが持っているポイントのラベル
* @default 能力値ポイント:
*
* @param Upgrade Text
* @text アップグレードのラベル
* @desc アップグレードのポイント数のラベル
* @default アップグレードコスト:
*
* @param Spend Text
* @text 割当テキスト
* @desc 割当を開始するコマンドの表示テキスト
* @default 割当
*
* @param Reset Text
* @text リセットラベル
* @desc 能力値ポイントをリセットするコマンドの表示テキスト
* @default リセット
*
* @param Finish Text
* @text 完了テキスト
* @desc シーンを完了するコマンドの表示テキスト
* @default 完了
*
* @param == Gauge Options ==
* @text -- ゲージオプション
* @default
*
* @param Use Gauges
* @text ゲージの使用
* @desc trueの場合、能力値量の分布には、分布している能力値量が最大値にどれだけ近づいているかを表すゲージが表示されます
* @default true
*
* @param Gauge Height
* @text ゲージの高さ
* @desc 能力値分布で使用されるゲージの高さ
* @default 14
*
* @param == Points Label ==
* @text -- ポイントラベル
* @default
*
* @param Point Icon
* @text ポイントアイコン
* @desc 能力値ポイント用のアイコンのアイコンインデックスを入力します
* 0に設定して、代わりにテキストを使用します。
* @default 87
*
* @param Point Text
* @text ポイントテキスト
* @desc PointIcon"が0に設定されている場合、これが能力値ポイントのラベルとして使用されます
* @default テキスト
*
* @param Point Color
* @text ポイントカラー
* @desc テキストを使用する場合は、テキストの色になります
* @default #66ff66
*
* @help
* 翻訳:ムノクラ
* https://fungamemake.com/
* https://twitter.com/munokura/
*
* 元プラグイン: http://sumrndm.site/stat-distribution/
*
*
* Stat Distribution
* Version 1.07
* SumRndmDde
*
*
* アクターの能力値にプレイヤーの裁量でポイントを分配できるシステムです。
* メニューにコマンドが追加され、
* 能力値割当の新しいメニューにアクセスできるようになります。
*
* このプラグインを使用するには、SRD_SuperToolsEngineが必要です。
* プラグイン管理でこのプラグインを
* SRD_SuperToolsEngineの下側に配置してください。
*
*
* ==========================================================================
* プラグインコマンド
* ==========================================================================
*
* 以下のプラグインコマンドを使用して、アクションを実行します。
*
*
* OpenStatDistribution Actor [actorId]
* 指定したアクターIDの能力値割当メニューを開きます。
*
*
* OpenStatDistribution Party [memberIndex]
* パーティ内のインデックスに基づいて、
* 指定されたアクターの能力値割当メニューを開きます。
* 例えば、'memberIndex'を0に設定すると、
* パーティのリーダーのメニューが開きます。
*
*
* AddStatPoints Actor [actorId] [points]
* AddStatPoints Party [memberIndex] [points]
* これにより、特定のアクターに指定値のポイントが追加されます。
*
*
* ==========================================================================
* アップグレード可能な能力値
* ==========================================================================
*
* アップグレード可能な能力値を決定するには、
* 'DefaultStats'パラメータを使用します。
* それ以外の場合、
* メモタグを使って、
* 個々のアクター毎に能力値をカスタマイズすることができます。
*
*
*
* アクターの能力値をこのリストに設定します。
*
*
*
* アクターの既存のアップグレード可能な能力値に能力値を追加します。
*
*
* ==========================================================================
* 能力値をカスタマイズする方法
* ==========================================================================
*
* 能力値情報のプロパティをカスタマイズするには、
* データベースEXを利用する必要があります。
* カスタマイズ可能なエディタに移動し、
* 'Stat Distribution Editor'を選択するだけです。
* ここでは、
* 能力値情報の一覧が表示され、
* 必要に応じて変数を変更することができます。
* 変更内容を確認するには、
* 必ずリロードしてください。
*
*
* ==========================================================================
* アップグレード可能なステータス一覧
* ==========================================================================
*
* ここでは、利用可能な全ての能力値とその3文字コードのリストを紹介します。
*
*
* -- 通常能力値 --
* mhp - 最大HP
* mmp - 最大MP
* atk - 攻撃力
* def - 防御力
* mat - 魔法力
* mdf - 魔法防御
* agi - 敏捷性
* luk - 運
*
* -- 追加能力値 --
* hit - 命中率
* eva - 回避率
* cri - 会心率
* cev - 会心回避率
* mev - 魔法回避率
* mrf - 魔法反射率
* cnt - 反撃率
* hrg - HP再生率
* mrg - MP再生率
* trp - TP再生率
*
* -- 特殊能力値 --
* tgr - 狙われ率
* grd - 防御効果率
* rec - 回復効果率
* pha - 薬の知識
* mcr - MP消費率
* tcr - TPチャージ率
* pdr - 物理ダメージ率
* mdr - 魔法ダメージ率
* fdr - 床ダメージ率
* exr - 経験獲得率
*
*
* ==========================================================================
* 能力値ポイント
* ==========================================================================
*
* 能力値ポイントはアクターをレベルアップさせることで獲得できます。
* 'Default Formula'パラメータを使用して、アクターがレベルアップした時、
* 何点の能力値ポイントを獲得するかを設定することができます。
* また、以下のメモタグを使用して、アクターに独自の式を与えることもできます。
*
*
*
*
* 例:
*
*
*
* ==========================================================================
* ヘルプファイルの終わり
* ==========================================================================
*
* ヘルプファイルの終わりへようこそ。
*
* 読んでくれてありがとう!
* 質問があったり、このプラグインを楽しめたら、
* 私のYouTubeチャンネルを登録してください!!
*
* https://www.youtube.com/c/SumRndmDde
*
*
* 次の機会まで
* ~ SumRndmDde
*
*/
var SRD = SRD || {};
SRD.StatDistribution = SRD.StatDistribution || {};
SRD.PluginCommands = SRD.PluginCommands || {};
SRD.NotetagGetters = SRD.NotetagGetters || [];
var Imported = Imported || {};
Imported["SumRndmDde Stat Distribution"] = 1.07;
var $dataDistributeStats = {};
function Scene_Distribute() {
this.initialize.apply(this, arguments);
}
function Window_DistributePoints() {
this.initialize.apply(this, arguments);
}
function Window_DistributeStatus() {
this.initialize.apply(this, arguments);
}
function Window_Distribute() {
this.initialize.apply(this, arguments);
}
function Window_DistributeCommand() {
this.initialize.apply(this, arguments)
}
(function (_) {
"use strict";
//-----------------------------------------------------------------------------
// SRD.StatDistribution
//-----------------------------------------------------------------------------
const params = PluginManager.parameters('SRD_StatDistribution');
_.stats = String(params['Default Stats']).split(/\s*,\s*/);
_.formula = String(params['Default Formula']);
_.show = String(params['Show on Menu']).trim().toLowerCase() === 'true';
_.reset = String(params['Allow Stat Resets']).trim().toLowerCase() === 'true';
_.cost = String(params['Reset Gold Cost']);
_.name = String(params['Command Name']);
_.messsage = String(params['Level Up Message']);
_.points = String(params['Points Text']);
_.upgrade = String(params['Upgrade Text']);
_.spendText = String(params['Spend Text']);
_.resetText = String(params['Reset Text']);
_.finishText = String(params['Finish Text']);
_.drawGauges = String(params['Use Gauges']).trim().toLowerCase() === 'true';
_.gaugeHeight = parseInt(params['Gauge Height']);
_.iconIndex = parseInt(params['Point Icon']);
_.pointText = String(params['Point Text']);
_.pointColor = String(params['Point Color']);
_.checkFileExists = function () {
FileManager.checkDataExists("DistributionStats.json", JsonEx.stringify({
"mhp": { "name": "Max HP", "description": "The maximum amount of HP for the actor.", "cost": "1", "gain": "5", "max": "500", "min_col": "#ffa655", "max_col": "#ea7000" },
"mmp": { "name": "Max MP", "description": "The maximum amount of MP for the actor.", "cost": "1", "gain": "2", "max": "200", "min_col": "#6666ff", "max_col": "#0000ff" },
"atk": { "name": "Attack", "description": "Strengthens the damage of physical skills used by \nthe actor.", "cost": "1", "gain": "1", "max": "100", "min_col": "#ff7777", "max_col": "#f90000" },
"def": { "name": "Defense", "description": "Reduces the damage of physical skills the actor is \ntargeted with.", "cost": "1", "gain": "1", "max": "100", "min_col": "#52ff33", "max_col": "#12b700" },
"mat": { "name": "Magic Attack", "description": "Strengthens the damage of magical skills used by \nthe actor.", "cost": "1", "gain": "1", "max": "100", "min_col": "#b355ff", "max_col": "#a300d9" },
"mdf": { "name": "Magic Defense", "description": "Reduces the damage of magical skills the actor is \ntargeted with.", "cost": "1", "gain": "1", "max": "100", "min_col": "#55ffe6", "max_col": "#00d7b7" },
"agi": { "name": "Agility", "description": "Determines how soon the actor will be able to \npreform a turn in battle.", "cost": "1", "gain": "1", "max": "100", "min_col": "#fbff55", "max_col": "#d9d300" },
"luk": { "name": "Luck", "description": "Influences various luck factors for the actor in \ntheir favor.", "cost": "1", "gain": "1", "max": "100", "min_col": "#ff55e6", "max_col": "#cc00ad" },
"hit": { "name": "Hit Rate", "description": "Increases the chance of skills hitting their \ntarget.", "cost": "2", "gain": "0.005", "max": "0.5", "min_col": "#aaaaaa", "max_col": "#ffffff" },
"eva": { "name": "Evasion Rate", "description": "Increases the likely-hood of an actor evading\na physical skill.", "cost": "2", "gain": "0.005", "max": "0.5", "min_col": "#aaaaaa", "max_col": "#ffffff" },
"cri": { "name": "Critical Rate", "description": "Determines how likely an actor will preform \na critical hit.", "cost": "2", "gain": "0.005", "max": "0.5", "min_col": "#aaaaaa", "max_col": "#ffffff" },
"cev": { "name": "Critical Evasion Rate", "description": "Decreases the likely-hood of skills targeting \nthe actor being critical.", "cost": "2", "gain": "0.005", "max": "0.5", "min_col": "#aaaaaa", "max_col": "#ffffff" },
"mev": { "name": "Magic Evasion Rate", "description": "Increases the likely-hood of an actor evading \na magical skill.", "cost": "2", "gain": "0.005", "max": "0.5", "min_col": "#aaaaaa", "max_col": "#ffffff" },
"mrf": { "name": "Magic Reflection Rate", "description": "The higher the value, the more likely magical \nreflection will occur.", "cost": "2", "gain": "0.005", "max": "0.5", "min_col": "#aaaaaa", "max_col": "#ffffff" },
"cnt": { "name": "Counter Attack Rate", "description": "The higher the value, the more likely physical \nreflection will occur.", "cost": "2", "gain": "0.005", "max": "0.5", "min_col": "#aaaaaa", "max_col": "#ffffff" },
"hrg": { "name": "Hp Regeneration", "description": "The rate in which the actor gains HP each turn.", "cost": "2", "gain": "0.005", "max": "0.5", "min_col": "#aaaaaa", "max_col": "#ffffff" },
"mrg": { "name": "Mp Regeneration", "description": "The rate in which the actor gains MP each turn.", "cost": "2", "gain": "0.005", "max": "0.5", "min_col": "#aaaaaa", "max_col": "#ffffff" },
"trg": { "name": "Tp Regeneration", "description": "The rate in which the actor gains TP each turn.", "cost": "2", "gain": "0.005", "max": "0.5", "min_col": "#aaaaaa", "max_col": "#ffffff" },
"tgr": { "name": "Target Rate", "description": "Increases the chance of the actor being attacked.", "cost": "2", "gain": "0.005", "max": "0.5", "min_col": "#aaaaaa", "max_col": "#ffffff" },
"grd": { "name": "Guard Effect Rate", "description": "Increases the effectiveness of the actor's guard", "cost": "2", "gain": "0.005", "max": "0.5", "min_col": "#aaaaaa", "max_col": "#ffffff" },
"rec": { "name": "Recovery Effect Rate", "description": "Determines the effectiveness of recovery skills.", "cost": "2", "gain": "0.005", "max": "0.5", "min_col": "#aaaaaa", "max_col": "#ffffff" },
"pha": { "name": "Pharmacology", "description": "Determines the effectiveness of recovery items.", "cost": "2", "gain": "0.005", "max": "0.5", "min_col": "#aaaaaa", "max_col": "#ffffff" },
"mcr": { "name": "Mp Cost Rate", "description": "The rate in which MP skills cost.", "cost": "2", "gain": "0.005", "max": "0.5", "min_col": "#aaaaaa", "max_col": "#ffffff" },
"tcr": { "name": "Tp Charge Rate", "description": "The rate in which TP skills cost.", "cost": "2", "gain": "0.005", "max": "0.5", "min_col": "#aaaaaa", "max_col": "#ffffff" },
"pdr": { "name": "Physical Damage Rate", "description": "The rate in which physical damage occurs.", "cost": "2", "gain": "0.005", "max": "0.5", "min_col": "#aaaaaa", "max_col": "#ffffff" },
"mdr": { "name": "Magical Damage Rate", "description": "The rate in which magical damage occurs.", "cost": "2", "gain": "0.005", "max": "0.5", "min_col": "#aaaaaa", "max_col": "#ffffff" },
"fdr": { "name": "Floor Damage Rate", "description": "The rate in which floor damage occurs.", "cost": "2", "gain": "0.005", "max": "0.5", "min_col": "#aaaaaa", "max_col": "#ffffff" },
"exr": { "name": "Experience Rate", "description": "The rate in which the actor gains experience.", "cost": "2", "gain": "0.005", "max": "0.5", "min_col": "#aaaaaa", "max_col": "#ffffff" }
}));
};
_.loadNotetags = function () {
const data = $dataActors;
const regex1 = //im;
const regex2 = //im;
const regex3 = //im;
for (let i = 1; i < data.length; i++) {
const note = data[i].note;
if (note.match(regex1)) {
const stats = String(RegExp.$1).split(/\s*,\s*/);
data[i]._sd_stats = stats;
}
if (note.match(regex2)) {
const stats = String(RegExp.$1).split(/\s*,\s*/);
if (data[i]._sd_stats === undefined) data[i]._sd_stats = _.stats.clone();
data[i]._sd_stats = data[i]._sd_stats.concat(stats);
}
if (note.match(regex3)) {
data[i]._sd_formula = String(RegExp.$1);
}
}
};
SRD.NotetagGetters.push(_.loadNotetags);
_.alertNeedSuperToolsEngine = function () {
alert("The 'SRD_SuperToolsEngine' plugin is required for using the 'SRD_StatDistribution' plugin.");
if (confirm("Do you want to open the download page to 'SRD_SuperToolsEngine'?")) {
window.open('http://sumrndm.site/super-tools-engine/');
}
};
if (!Imported["SumRndmDde Super Tools Engine"]) {
_.alertNeedSuperToolsEngine();
return;
}
_.checkFileExists();
//-----------------------------------------------------------------------------
// SRD.PluginCommands
//-----------------------------------------------------------------------------
SRD.PluginCommands._sd_getActorType = function (args) {
const type = String(args[0]).toLowerCase();
const id = parseInt(args[1]);
let actor;
if (type === 'actor') {
actor = $gameActors.actor(id);
} else {
actor = $gameParty.members()[id];
}
return actor;
};
SRD.PluginCommands['openstatdistribution'] = function (args) {
const actor = SRD.PluginCommands._sd_getActorType(args);
if (actor) {
$gameParty.setMenuActor(actor);
SceneManager.push(Scene_Distribute);
}
};
SRD.PluginCommands['addstatpoints'] = function (args) {
const actor = SRD.PluginCommands._sd_getActorType(args);
if (actor) {
const points = parseInt(args[2]);
actor.addDistributePoints(points);
}
};
//-----------------------------------------------------------------------------
// DataManager
//-----------------------------------------------------------------------------
DataManager._testExceptions.push("DistributionStats.json");
DataManager._databaseFiles.push({ name: '$dataDistributeStats', src: "DistributionStats.json" });
if (!SRD.DataManager_isDatabaseLoaded) {
SRD.notetagsLoaded = false;
SRD.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
DataManager.isDatabaseLoaded = function () {
if (!SRD.DataManager_isDatabaseLoaded.apply(this, arguments)) return false;
if (!SRD.notetagsLoaded) {
SRD.NotetagGetters.forEach(function (func) {
func.call(this);
}, this);
SRD.notetagsLoaded = true;
}
return true;
};
}
//-----------------------------------------------------------------------------
// DataManagerEX
//-----------------------------------------------------------------------------
DataManagerEX._distributeStat = 'mhp';
_.DataManagerEX_getCustomInfo = DataManagerEX.getCustomInfo;
DataManagerEX.getCustomInfo = function () {
const result = _.DataManagerEX_getCustomInfo.apply(this, arguments);
result.push(['Stat Distribution Editor', 'DataManagerEX.getStatDistributionHtml']);
return result;
};
DataManagerEX.getStatDistributionHtml = function () {
const data = $dataDistributeStats['mhp'];
return `