Skip to content

Instantly share code, notes, and snippets.

View triacontane's full-sized avatar

トリアコンタン triacontane

View GitHub Profile
@triacontane
triacontane / ActorFirstChar.js
Created January 24, 2022 16:20
アクター名称の最初の一文字を取得
$gameActors.actor(1).name().slice(0, 1);
@triacontane
triacontane / CharacterScreenNoFloor.js
Created January 16, 2022 07:19
キャラクター表示座標の端数を許可
/*:
* @plugindesc キャラクター表示座標の端数を許可
* @target MZ
*/
(()=> {
Game_CharacterBase.prototype.screenX = function() {
const tw = $gameMap.tileWidth();
return this.scrolledX() * tw + tw / 2;
};
@triacontane
triacontane / MenuActor.js
Created January 14, 2022 04:14
メニュー画面で現在選択中のアクターIDを取得
$gameParty.menuActor().actorId();
@triacontane
triacontane / PhantomEventSupport.js
Created January 11, 2022 13:30
ファントムイベントプラグインの可視距離を動的に変更
$gameMap.event(1)._visibleDistance = 48
@triacontane
triacontane / MagicMpCostRate.js
Created January 1, 2022 05:36
魔法専用の消費MPレート
(function() {
'use strict';
const _Game_BattlerBase_skillMpCost = Game_BattlerBase.prototype.skillMpCost;
Game_BattlerBase.prototype.skillMpCost = function(skill) {
if (skill.hitType === Game_Action.HITTYPE_MAGICAL) {
if (this._magicMcr === undefined) {
this._magicMcr = this.findMegicMcr();
}
return Math.floor(skill.mpCost * this._magicMcr);
@triacontane
triacontane / checkArmorAll.js
Created December 26, 2021 04:51
全ての防具を装備しているかどうか
[1, 2, 3].every(id => $gameActors.actor(1).hasArmor($dataArmors[id]));
@triacontane
triacontane / NoMpPopup.js
Created December 21, 2021 14:29
MPのポップアップを無効化
/*:
* @plugindesc MPのポップアップを無効化
* @target MZ
*/
(()=> {
Game_Battler.prototype.shouldPopupDamage = function() {
const result = this._result;
return (
result.missed ||
result.evaded ||
@triacontane
triacontane / RemoveState.js
Created December 20, 2021 17:08
For文でアクターのステートを一括解除
for(var i = 221; i <= 271; i++){
$gameActors.actor($gameVariables.value(17)).removeState(i);
}
@triacontane
triacontane / SeScript.js
Created November 25, 2021 14:46
スクリプトから効果音を演奏
AudioManager.playSe({name:'Attack1', volume:$gameVariables.value(1), pitch:100});
@triacontane
triacontane / FontLoadSample.js
Created November 25, 2021 13:42
フォントロードプラグインの利用例
/*:
* @plugindesc フォントロードプラグインのプラグイン利用例
* @target MZ
*/
(()=> {
const _Window_Base_drawItemName = Window_Base.prototype.drawItemName;
Window_Base.prototype.drawItemName = function(item, x, y, width) {
const prev = this.contents.fontFace;
this.contents.fontFace = 'test';