Skip to content

Instantly share code, notes, and snippets.

View triacontane's full-sized avatar

トリアコンタン triacontane

View GitHub Profile
@triacontane
triacontane / forceAction.js
Created September 23, 2021 04:40
戦闘行動の強制
const id = $gameVariables.value(1);
this.command339([1, id, 8, 1]);
@triacontane
triacontane / changeOption.js
Created September 4, 2021 13:22
オプションの状態を変更してセーブするサンプル
ConfigManager.touchUI = true;
ConfigManager.save();
@triacontane
triacontane / HalfMoveFindStartableEvents.js
Created August 28, 2021 12:15
プレイヤーの前方にあたるイベントを取得
Game_Player.prototype.findStartableEvents = function() {
const x = $gameMap.roundXWithDirection(this.x, this._direction);
const y = $gameMap.roundHalfYWithDirection(this.y, this._direction);
return $gameMap.eventsXy(x, y);
};
@triacontane
triacontane / HalfMoveCanStartEvent.js
Created August 28, 2021 09:52
半歩移動プラグインでイベント起動可能チェック
Game_Player.prototype.canStartEvent = function() {
this.checkEventTriggerHere([0]);
this.checkEventTriggerThere([0, 1, 2]);
let result = false;
$gameMap.events().forEach(event => {
if (event.isStarting()) {
event.clearStartingFlag();
event.unlock();
result = true;
}
@triacontane
triacontane / AdditionalDescription_patch.js
Created August 28, 2021 05:21
AdditionalDescription行間変更
const _Window_Help_calcTextHeight = Window_Help.prototype.calcTextHeight;
Window_Help.prototype.calcTextHeight = function(testState) {
const result = _Window_Help_calcTextHeight.apply(this, arguments);
if (this._anotherTextVisible && testState.text !== param.ChangePage) {
return result - 12;
} else {
return result;
}
};
@triacontane
triacontane / ParallelPartyFindActor.js
Created August 24, 2021 14:37
並列パーティプラグインで別パーティのアクターID取得
$gameSystem._parties._data[0].members()[0].actorId();
@triacontane
triacontane / FindActorId.js
Created August 21, 2021 05:13
アクターのIDを取得
$gameParty.members()[$gameVariables.value(2)].actorId();
@triacontane
triacontane / AShasArmor.js
Created August 19, 2021 13:22
ステート自動付与:特定の防具を3種類装備していること
<AS計算式:this.isActor() &&
this.hasArmor($dataArmors[1]) &&
this.hasArmor($dataArmors[2]) &&
this.hasArmor($dataArmors[3])>
@triacontane
triacontane / MessagePadding.js
Created August 12, 2021 15:10
メッセージウィンドウの余白変更 メッセージウィンドウの余白変更
/*:
* @plugindesc サンプルコード
* @target MZ
*/
(()=> {
'use strict';
Window_Message.prototype.updatePadding = function() {
this.padding = 50;
};
@triacontane
triacontane / AutoLoadScript.js
Last active July 31, 2021 06:02
自動ロードスクリプト
const promise = DataManager.loadGameLatest();
if (promise) {
promise.then(() => {
$gameSystem.onAfterLoad();
SceneManager.goto(Scene_Map);
});
}