本帖最后由 铅笔描绘的思念 于 2017-6-13 17:57 编辑
就是只需要添加一个level属性给敌人就好了是吧。。。这个其实貌似蛮简单的
简单糊的未测试
(function() { Object.defineProperty(Game_Enemy.prototype, 'level', { get: function() { return this._level; }, configurable: true }); var El_GameEnemt_initMenbers = Game_Enemy.prototype.initMembers; Game_Enemy.prototype.initMembers = function() { El_GameEnemt_initMenbers.call(this); this._level = 0; }; var El_GameEnemy_setup = Game_Enemy.prototype.setup; Game_Enemy.prototype.setup = function(enemyId, x, y) { El_GameEnemy_setup.call(this, enemyId, x, y); this._level = Number($dataEnemies[enemyId].meta.level); }; })();
(function() {
Object.defineProperty(Game_Enemy.prototype, 'level', {
get: function() {
return this._level;
},
configurable: true
});
var El_GameEnemt_initMenbers = Game_Enemy.prototype.initMembers;
Game_Enemy.prototype.initMembers = function() {
El_GameEnemt_initMenbers.call(this);
this._level = 0;
};
var El_GameEnemy_setup = Game_Enemy.prototype.setup;
Game_Enemy.prototype.setup = function(enemyId, x, y) {
El_GameEnemy_setup.call(this, enemyId, x, y);
this._level = Number($dataEnemies[enemyId].meta.level);
};
})();
在敌人备注里定义<lev[/code]el:X>就好 但这个是不是有点鸡肋啊。。一个敌人只能设置一个等级诶。。 有稍微详细点的要求我可以当练手的说
已改 @欧买歌 |