Skip to content

Instantly share code, notes, and snippets.

@triacontane
Created January 1, 2022 05:36
Show Gist options
  • Select an option

  • Save triacontane/1a089ae8b5808bee9928f8b3569a300e to your computer and use it in GitHub Desktop.

Select an option

Save triacontane/1a089ae8b5808bee9928f8b3569a300e to your computer and use it in GitHub Desktop.
魔法専用の消費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);
} else {
return _Game_BattlerBase_skillMpCost.apply(this, arguments);
}
};
})();
@triacontane
Copy link
Copy Markdown
Author

triacontane commented Jan 1, 2022

findMegicMcrはメモタグ等から専用の消費率を算出する処理。
必ずundefined以外の値を返す。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment