Skip to content

Instantly share code, notes, and snippets.

View triacontane's full-sized avatar

トリアコンタン triacontane

View GitHub Profile
@triacontane
triacontane / MenuButtonScale.js
Created November 14, 2021 05:04
メニューButtonの表示倍率を変更
/*:
* @plugindesc メニューボタンの表示倍率を変更
* @target MZ
*/
(()=> {
const scale = 2.0;
const _Scene_Map_createMenuButton = Scene_Map.prototype.createMenuButton;
Scene_Map.prototype.createMenuButton = function() {
@triacontane
triacontane / FindDatabaseIndex.js
Created November 9, 2021 23:58
指定した名称と一致するデータベースのインデックスを取得
$dataCommonEvents.findIndex(item => item && item.name === 'コモンイベント名称');
@triacontane
triacontane / DiscardEquipActorId.js
Created November 9, 2021 23:44
装備品を解除させられたアクターのIDを保持
/*:
* @plugindesc 装備品を解除させられたアクターのIDを保持
* @target MZ
*/
(()=> {
const variableId = 1;
const _Game_Actor_discardEquip = Game_Actor.prototype.discardEquip;
Game_Actor.prototype.discardEquip = function(item) {
_Game_Actor_discardEquip.apply(this, arguments);
@triacontane
triacontane / SceneEquipShift.js
Last active November 3, 2021 03:47
装備画面を右にずらす
/*:
* @plugindesc 装備画面を右にずらす
* @target MZ
*/
(()=> {
const offsetX = 200;
Scene_Equip.prototype.statusWindowRect = function() {
const wx = offsetX;
@triacontane
triacontane / checkArmor.js
Last active November 1, 2021 15:45
アクターが指定した防具を装備しているかどうか
$gameActors.actor(1).armors().some(armor => [1, 2, 3].contains(armor.id))
@triacontane
triacontane / HelpRefreshCommandSkill.js
Created October 29, 2021 06:36
スキル選択時にヘルプウィンドウを再描画
/*:
* @plugindesc スキル選択時にヘルプウィンドウを再描画
* @target MZ
*/
(()=> {
const _Scene_Battle_commandSkill = Scene_Battle.prototype.commandSkill;
Scene_Battle.prototype.commandSkill = function() {
_Scene_Battle_commandSkill.apply(this, arguments);
this._helpWindow.refresh();
@triacontane
triacontane / DynamicDatabaseSample
Created October 27, 2021 11:30
動的データベースのメモ欄サンプル
<DD攻撃力:$dataWeapons[data.id + 1].params[2] * 2>
@triacontane
triacontane / CallPluginCommand.js
Last active October 27, 2021 07:37
スクリプトからのプラグインコマンド呼び出し例
const cpdArgs = {
character : '0',
valueVariable : String($gameVariables._data[1]),
setting: '{"reverse":"false","type":"HP","critical":"false"}'
};
PluginManager.callCommand(
this, 'CharacterPopupDamage' , 'POPUP_DAMAGE', cpdArgs
);
@triacontane
triacontane / FindWeaponId.js
Created October 12, 2021 12:26
武器の名前からIDを逆引き
const weaponName = '武器の名前';
const variableId = 1;
const data = $dataWeapons.find(weapon => weapon && weapon.name === weaponName);
if (data) {
$gameVariables.setValue(variableId, data.id);
}
@triacontane
triacontane / ChangeBgmVolume.js
Created October 4, 2021 13:30
BGMの音量のみ変更
AudioManager._currentBgm.volume = 10;
AudioManager.updateBgmParameters(AudioManager._currentBgm);