Skip to content

Instantly share code, notes, and snippets.

View triacontane's full-sized avatar

トリアコンタン triacontane

View GitHub Profile
@triacontane
triacontane / SceneCustomMenuPlugin.js
Last active October 27, 2022 14:20
カスタムメニュー作成プラグインを改造
const _Window_CustomMenu_drawItem = Window_CustomMenu.prototype.drawItem;
Window_CustomMenu.prototype.drawItem = function(index) {
console.log(index);
_Window_CustomMenu_drawItem.apply(this, arguments);
};
Window_CustomMenu.prototype.outLog = function() {
console.log('test');
};
@triacontane
triacontane / CheckAsc.js
Created October 27, 2022 13:42
配列の昇順チェック
const arr = [4, 6, 7, 9];
const result = arr.every((value, i, self) => i + 1 === self.length || value <= self[i + 1]);
console.log(result);
@triacontane
triacontane / ExistsSync.js
Created October 11, 2022 14:34
ローカル実行でのみ使えるファイルの存在チェック
require('fs').existsSync('img/pictures/aaa.png')
@triacontane
triacontane / ForceActionByMember.js
Created October 8, 2022 07:41
パーティメンバーの並び順を指定して戦闘行動の強制
const partyIndex = 0;
const battler = $gameParty.members()[partyIndex];
if (!battler.isDeathStateAffected()) {
const skillId = 8;
const targetIndex = 0;
battler.forceAction(skillId, targetIndex);
BattleManager.forceAction(battler);
this.setWaitMode("action");
}
@triacontane
triacontane / BattlerHasAction.js
Created September 17, 2022 04:55
指定したバトラーが行動済みかどうかを判定する
!!$gameActors.actor(2).currentAction(); // ID[2]のアクターが行動済みかどうか
!!$gameTroop.members()[0].currentAction(); // 0番目の敵キャラが行動済みかどうか
@triacontane
triacontane / SceneGlossaryConfirmed.js
Created September 5, 2022 13:14
用語辞典プラグインで指定アイテムを閲覧済みにする
$gameParty.setSelectedGlossaryType("1");
$gameParty.setConfirmedGlossaryItem($dataItems[1]);
@triacontane
triacontane / bracketSample.js
Created September 1, 2022 11:51
ブラケット表記法サンプル
const test = ( tes )=>{
let i = [1,2,3];
let g = i[tes];
console.log( g );
}
test( 'length' );
@triacontane
triacontane / initFaceImage.js
Created August 27, 2022 05:09
パーティのフェイスグラフィックを初期化
$gameParty.allMembers().forEach(member => {
const data = member.actor();
member.setFaceImage(data.faceName, data.faceIndex);
});
@triacontane
triacontane / CallStatus.js
Created August 6, 2022 04:44
ステータス画面を直接呼び出す
$gameParty.setMenuActor($gameParty.members()[1]);
SceneManager.push(Scene_Status);
@triacontane
triacontane / MessageWindowForceClose
Created August 3, 2022 16:13
メッセージ表示を強制終了
const mesWin = SceneManager._scene._messageWindow;
mesWin.onEndOfText();
mesWin.terminateMessage();
mesWin.pause = false;