/*------------------------------ Copyright (c) 2025 PotatoDragon Released under the MIT License. https://opensource.org/license/mit ------------------------------*/ /*: @target MZ @url https://raw.githubusercontent.com/pota-gon/RPGMakerMZ/refs/heads/main/plugins/Battle/Tp.js @plugindesc TP Ver1.0.2 (2023/12/9) @author PotatoDragon @license MIT License @help English Help Translator: munokura This is an unofficial English translation of the plugin help, created to support global RPG Maker users. Feedback is welcome to improve translation quality (see: https://github.com/munokura/PotatoDragon-MZ-plugins ). Original plugin by PotatoDragon. Please check the latest official version at: https://github.com/pota-gon/RPGMakerMZ/wiki ----- ## Overview Change TP settings ## Usage Change TP-related parameters as needed. @param MaxTp @text TP Maximum @desc Maximum Take Profit @type number @default 100 @param FixedTp @text TP initialization fixed @desc Whether to fix the TP initialization value @type boolean @on Make it fixed @off Do not fix @default true @param InitTp @text Initial TP value at the start of battle @desc Initial TP value at the start of battle @type number @default 0 @parent FixedTp @param NoChargeTpDamage @text Does not recover TP when taking damage @desc Whether to recover TP when taking damage @type boolean @on No recovery @off recover @default true */ /*:ja @plugindesc TP Ver1.0.2(2023/12/9) @url https://raw.githubusercontent.com/pota-gon/RPGMakerMZ/refs/heads/main/plugins/Battle/Tp.js @target MZ @author ポテトードラゴン ・アップデート情報 Ver1.0.2: TP最大値 を設定する機能追加 Copyright (c) 2025 ポテトードラゴン Released under the MIT License. https://opensource.org/license/mit @help ## 概要 TPの設定を変更します ## 使い方 TP関連のパラメータを必要に応じて変更してください @param MaxTp @type number @text TP最大値 @desc TPの最大値 @default 100 @param FixedTp @type boolean @text TP初期化固定 @desc TP初期化の値を固定にするか @on 固定にする @off 固定にしない @default true @param InitTp @parent FixedTp @type number @text 戦闘開始TP初期値 @desc 戦闘開始時のTP初期値 @default 0 @param NoChargeTpDamage @type boolean @text 被ダメージ時にTPを回復しない @desc 被ダメージ時にTPを回復するかどうか @on 回復しない @off 回復する @default true */ (() => { 'use strict'; // ベースプラグインの処理 function Potadra_getPluginName(extension = 'js') { const reg = new RegExp(".+\/(.+)\." + extension); return decodeURIComponent(document.currentScript.src).replace(reg, '$1'); } function Potadra_convertNum(value, default_value) { return Number(value || default_value); } function Potadra_convertBool(bool) { if (bool === "false" || bool === '' || bool === undefined) { return false; } else { return true; } } // パラメータ用変数 const plugin_name = Potadra_getPluginName(); const params = PluginManager.parameters(plugin_name); // 各パラメータ用変数 const MaxTp = Potadra_convertNum(params.MaxTp, 100); const FixedTp = Potadra_convertBool(params.FixedTp); const InitTp = Potadra_convertNum(params.InitTp, 0); const NoChargeTpDamage = Potadra_convertBool(params.NoChargeTpDamage); /** * TP の最大値を取得 * * @returns {number} */ Game_BattlerBase.prototype.maxTp = function() { return MaxTp; }; /** * TP の初期化 */ if (FixedTp) { Game_Battler.prototype.initTp = function() { this.setTp(InitTp); }; } /** * 被ダメージによる TP チャージ * * @param {} damageRate - */ if (NoChargeTpDamage) { Game_Battler.prototype.chargeTpByDamage = function(damageRate) {}; } })();