Skip to content

Instantly share code, notes, and snippets.

Avatar

トリアコンタン triacontane

View GitHub Profile
@triacontane
triacontane / changeOption.js
Created Sep 4, 2021
オプションの状態を変更してセーブするサンプル
View changeOption.js
ConfigManager.touchUI = true;
ConfigManager.save();
@triacontane
triacontane / HalfMoveFindStartableEvents.js
Created Aug 28, 2021
プレイヤーの前方にあたるイベントを取得
View HalfMoveFindStartableEvents.js
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 Aug 28, 2021
半歩移動プラグインでイベント起動可能チェック
View HalfMoveCanStartEvent.js
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 Aug 28, 2021
AdditionalDescription行間変更
View AdditionalDescription_patch.js
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 Aug 24, 2021
並列パーティプラグインで別パーティのアクターID取得
View ParallelPartyFindActor.js
$gameSystem._parties._data[0].members()[0].actorId();
@triacontane
triacontane / FindActorId.js
Created Aug 21, 2021
アクターのIDを取得
View FindActorId.js
$gameParty.members()[$gameVariables.value(2)].actorId();
@triacontane
triacontane / AShasArmor.js
Created Aug 19, 2021
ステート自動付与:特定の防具を3種類装備していること
View AShasArmor.js
<AS計算式:this.isActor() &&
this.hasArmor($dataArmors[1]) &&
this.hasArmor($dataArmors[2]) &&
this.hasArmor($dataArmors[3])>
@triacontane
triacontane / MessagePadding.js
Created Aug 12, 2021
メッセージウィンドウの余白変更 メッセージウィンドウの余白変更
View MessagePadding.js
/*:
* @plugindesc サンプルコード
* @target MZ
*/
(()=> {
'use strict';
Window_Message.prototype.updatePadding = function() {
this.padding = 50;
};
@triacontane
triacontane / AutoLoadScript.js
Last active Jul 31, 2021
自動ロードスクリプト
View AutoLoadScript.js
const promise = DataManager.loadGameLatest();
if (promise) {
promise.then(() => {
$gameSystem.onAfterLoad();
SceneManager.goto(Scene_Map);
});
}
@triacontane
triacontane / AddTimer.js
Created Jul 13, 2021
タイマーの秒数を加減
View AddTimer.js
$gameTimer._frames += 1 * 60;