Skip to content

Instantly share code, notes, and snippets.

@keda-studio
Created September 15, 2017 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keda-studio/52e4f701e706a99f9a4c7adc0301bf7d to your computer and use it in GitHub Desktop.
Save keda-studio/52e4f701e706a99f9a4c7adc0301bf7d to your computer and use it in GitHub Desktop.
自動戦闘時の行動を完全にランダムにする ref: http://qiita.com/keda_studio/items/198ccb4c7ae27a68eac2
Game_Action.prototype.evaluate = function() {
return Math.random();
};
var _Game_Action_evaluate = Game_Action.prototype.evaluate;
Game_Action.prototype.evaluate = function() {
// 72番のアクターのみランダム
if(this._subjectActorId == 72) {
return Math.random();
}
return _Game_Action_evaluate.call(this);
};
Game_Action.prototype.evaluate = function() {
var val = Math.random();
// Skill68番を優先
if(this.isSkill() && this._item._itemId == 68) {
val *= 2;
}
return val;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment