refactor: reorganize engine-based structure and add agent rules
- Engines/ 配下へエンジン別に再編 (Common/Rgss/Tkool/Tyrano/Wolf/Unity/Nwjs) - ゲーム個別処理を Engines/<Engine>/Games/<GameName>/ へ分離し、共通処理から明示呼び出し - 外部ツールを Engines/<Engine>/Tools/ へ移動し、AppPathHelper 経由で解決 - 旧 Tools/ 直下参照と不要な参照ファイル/バックアップを削除 - エージェント規則 AGENTS.md を追加し、README から参照 - publish.ps1 を Engines/<Engine>/Tools/ の再帰配置に対応
This commit is contained in:
1 parent
0d11039ee9
commit
8cea2a147d
47 files changed
+2976
-176
No files matched your search
@@ -0,0 +1,99 @@
|
||||
/*:
|
||||
* @plugindesc GameLauncher mod (HP once at self turn start / MP always MAX / speed).
|
||||
* @author GameLauncher
|
||||
*
|
||||
* @param EnableHpRecover
|
||||
* @text HP自動回復(自ターン開始時のみ)
|
||||
* @type boolean
|
||||
* @default true
|
||||
*
|
||||
* @param EnableMpRecover
|
||||
* @text MP常時MAX
|
||||
* @type boolean
|
||||
* @default true
|
||||
*
|
||||
* @param SpeedMultiplier
|
||||
* @text 速度倍率
|
||||
* @type number
|
||||
* @decimals 2
|
||||
* @default 3.0
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var pluginName = 'GameLauncher_Mod';
|
||||
var params = PluginManager.parameters(pluginName) || {};
|
||||
|
||||
function toBool(v, def) {
|
||||
if (v === undefined || v === null || v === '') return def;
|
||||
return String(v).toLowerCase() === 'true';
|
||||
}
|
||||
|
||||
var ENABLE_HP = toBool(params['EnableHpRecover'], true);
|
||||
var ENABLE_MP = toBool(params['EnableMpRecover'], true);
|
||||
var SPEED = parseFloat(params['SpeedMultiplier']);
|
||||
if (isNaN(SPEED) || SPEED <= 0) SPEED = 3.0;
|
||||
|
||||
// 自パーティのアクターかどうか(他ゲーム・敵などへ影響しないよう厳密判定)
|
||||
function isPlayerActor(battler) {
|
||||
return battler && typeof battler.isActor === 'function' && battler.isActor();
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// HP: 自ターン開始時に1度だけ MAX まで回復する。
|
||||
// 毎フレーム回復はしない(次ターンまでプレイヤーは自由にHPを減らせる)。
|
||||
// =========================================================================
|
||||
if (ENABLE_HP && typeof BattleManager !== 'undefined' && BattleManager.startTurn) {
|
||||
var _GameLauncher_startTurn = BattleManager.startTurn;
|
||||
BattleManager.startTurn = function () {
|
||||
_GameLauncher_startTurn.call(this);
|
||||
var battler = this.actor && this.actor();
|
||||
if (isPlayerActor(battler)) {
|
||||
// この瞬間に一度だけ全回復(以降はダメージで減らせる)
|
||||
battler.setHp(battler.mhp);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// MP: 常時 MAX を維持する(自アクターのみ、値が mmp 未満なら即座に戻す)。
|
||||
// =========================================================================
|
||||
if (ENABLE_MP && typeof Game_Battler !== 'undefined' && Game_Battler.prototype) {
|
||||
var _GameLauncher_setMp = Game_Battler.prototype.setMp;
|
||||
Game_Battler.prototype.setMp = function (value) {
|
||||
_GameLauncher_setMp.call(this, value);
|
||||
if (isPlayerActor(this)) {
|
||||
this._mp = this.mmp;
|
||||
}
|
||||
};
|
||||
|
||||
var _GameLauncher_refresh = Game_Battler.prototype.refresh;
|
||||
Game_Battler.prototype.refresh = function () {
|
||||
_GameLauncher_refresh.call(this);
|
||||
if (isPlayerActor(this)) {
|
||||
this._mp = this.mmp;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// 速度倍率: シーン更新のデルタタイムを実質的に乗算する(speedhack)。
|
||||
// =========================================================================
|
||||
if (SPEED !== 1.0 && typeof SceneManager !== 'undefined' && SceneManager.updateMain) {
|
||||
var _GameLauncher_updateMain = SceneManager.updateMain;
|
||||
SceneManager.updateMain = function () {
|
||||
var scene = this._scene;
|
||||
if (scene && scene.isActive && scene.isActive()) {
|
||||
var delta = this._deltaTime || (1000 / 60);
|
||||
if (scene.update) {
|
||||
scene.update(delta * SPEED);
|
||||
}
|
||||
if (scene.isActive && scene.isActive()) {
|
||||
_GameLauncher_updateMain.call(this);
|
||||
}
|
||||
return;
|
||||
}
|
||||
_GameLauncher_updateMain.call(this);
|
||||
};
|
||||
}
|
||||
})();
|
||||
Reference in new issue
Block a user