Skip to content

Instantly share code, notes, and snippets.

View triacontane's full-sized avatar

トリアコンタン triacontane

View GitHub Profile
@triacontane
triacontane / TextLengthCondition.js
Created September 15, 2019 04:16
文字列の長さで処理を分岐(イベントコマンド「条件分岐」の「スクリプト」から使用)
$gameVariables.value(a).length === b;
@triacontane
triacontane / isExistPicture.js
Created August 22, 2019 23:08
ピクチャの存在判定
$gameScreen.picture(1)
@triacontane
triacontane / TargetEnemy.js
Created July 20, 2019 07:02
味方の攻撃対象となった敵の情報を取得
// ラストターゲットのINDEXを取得
var index = BattleManager._subject._lastTargetIndex;
// 敵グループの情報からパラメータ(攻撃力を出力)
console.log($gameTroop.members()[index].param(2));
(function() {
'use strict';
delete Input.keyMapper[27]; // escape key code
})();
@triacontane
triacontane / RefreshCommonEvent.js
Created July 7, 2019 03:50
コモンイベントのみをリフレッシュ
$gameMap._commonEvents.forEach(function(event) {
event.refresh();
});
@triacontane
triacontane / WindowContentsOffset.js
Last active June 23, 2019 05:59
ウィンドウの中身だけをずらすサンプルです。
(function() {
'use strict';
var offsetY = 10;
var _Window_Help__refreshContents = Window_Help.prototype._refreshContents;
Window_Help.prototype._refreshContents = function() {
_Window_Help__refreshContents.apply(this, arguments);
this._windowContentsSprite.y += offsetY;
};
@triacontane
triacontane / StructTone.js
Last active May 25, 2019 14:43
トーン用Structure
/*~struct~tone:
* @param red
* @text 赤
* @default -68
* @type number
* @min -255
* @max 255
*
* @param green
* @text 緑
@triacontane
triacontane / DynamicDefine.js
Created April 20, 2019 13:16
動的な関数の再定義
var className = 'Window_BattleSkill';
window[className].prototype.maxCols = function() {
return 1;
}
@triacontane
triacontane / VehicleGetOff.js
Created February 3, 2019 06:11
強制的な降車
$gamePlayer._vehicleGettingOff = true;
$gamePlayer.vehicle().getOff();
$gamePlayer.setMoveSpeed(4);
@triacontane
triacontane / VehicleGetOn.js
Created February 3, 2019 06:08
強制的な乗車
$gamePlayer._vehicleType = 'airship';
$gamePlayer._vehicleGettingOn = true;