Skip to content

Instantly share code, notes, and snippets.

@triacontane
Created May 6, 2020 13:43
Show Gist options
  • Save triacontane/cabf2c0383f60d90eea363882f72dc08 to your computer and use it in GitHub Desktop.
Save triacontane/cabf2c0383f60d90eea363882f72dc08 to your computer and use it in GitHub Desktop.
YEP_ExtraEnemyDrops.jsでドロップ率にマイナス値を指定しておくと、すでに指定したドロップを打ち消せるようになります。
(function() {
'use strict';
DropManager.makeConditionalDropItems = function() {
var length = this._data.length;
if (length <= 0) return;
for (var i = 0; i < length; ++i) {
var data = this._data[i];
var item = data[0];
var conditions = data[1];
var rate = this.getConditionalRate(conditions);
if (Math.random() < rate) {
this._drops.push(item);
}
var index = this._drops.indexOf(item);
if (rate < 0 && index >= 0 && Math.random() < Math.abs(rate)) {
this._drops.splice(index, 1);
}
}
};
})();
@triacontane
Copy link
Author

プラグイン管理画面でYEP_ExtraEnemyDrops.jsより下に配置してください。

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