Random Enemies Emergence more than 8 enemies.
I made my first JS Plugin "Suppon Random Enemies Emergence" for RPG maker MV.It allows following.
[*]
[*]Random enemies emergence.
[*]
[*]Emergence more than 8 enemies.
[*]
[*]It can set emergence probability.
[*]
[*]Enemies are lined up automatically
[*]
my temporal site
How to useEnter follow sentence as Plugin Command of Battle Event 1st page
supponREE ratio times id id id....
ratio : Emergence probability numer
times : Repetition number
id : Enemy ID
Example
supponREE 80 20 1 2 3 4
Enter the sentence in Battle Event 1st page of Troops.
It doesen't work when it put on other page.
Punctuate numbers by space, but don't put space at end.
It can read and works more than 2 sentence at once.
I don't have enough JS skill.
If you find a bug, please fix it yourself.
Thank you reading.
This plugin All free to use in both commercial and non-commercial.
Credit is not needed.
//=============================================================================// SupponRandomEnemyEmergence.js//=============================================================================/*: * @plugindesc Random Enemies emergence. Version 1.01 * @author Suppon * ** @help * * Plugin Command: * supponREE ratio times id id id.... * ratio : Emergence probability numer* times : Repetition number * id : Enemy ID * * Example * supponREE 80 20 1 2 3 4 * * Enter the sentence in Battle Event 1st page of Troops. * It doesen't work when it put other page. * Punctuate numbers by space, but don't put space at end. * It can read and works more than 2 sentence at once. *//*:ja * @plugindesc モンスターランダム出現です。 * @author Suppon * * @help * * プラグインコマンド: * supponREE ratio times id id id・・・ * ratio : 出現確率%です。 * times : 繰り返す回数です。 * id : エネミーのIDです。 ** 使用例 * supponREE 80 20 1 2 3 4 ** TroopsのBattle Eventの1ページ目に入れてください。ほかのページでは動きません。 * 複数行いれてもOKです。数字はスペースで区切ってください。最後にスペースを入れないでください。 */(function() { var _Game_Troop_setup = Game_Troop.prototype.setup; Game_Troop.prototype.setup = function(troopId) { this.clear(); this.supponReUsed = false this._troopId = troopId; var enemyNumber = 0; var lists = $dataTroops.pages.list; for (var i=0; i<lists.length; i++) { console.log(lists); if (!lists.parameters || !(lists.code === 356)){continue}; var args = lists.parameters.split(" ") var command = args.shift(); if (command == "supponREE") { for (var j=0; j<args; j++){ if (args > Math.randomInt(100) || enemyNumber == 0) { var enemyId = args; var enemy = new Game_Enemy(enemyId, 0, 0); this._enemies.push(enemy); enemyNumber++; } } } }; if (enemyNumber>0) { this.makeUniqueNames(); this.supponReUsed = true return; } else { _Game_Troop_setup.call(this, troopId); } } Spriteset_Battle.prototype.supponReLinedUpEnemy = function(){ var whole_x = 0; var depth = 0; this._enemySprites.reverse(); this._enemySprites.forEach(function(sprite){ var base_y = Math.round(Graphics.height*0.7); depth = Math.round(Graphics.height*0.15); sprite._homeY = base_y; whole_x += Math.ceil(sprite.width * sprite.scale.x); }); var line = Math.floor(whole_x / Graphics.width)+1; var l = 0; var j = 1; var maxx = null; var minx = null; var size = this._enemySprites.length; var n = Math.ceil(size/line); this._enemySprites.forEach(function(sprite){ l = Math.ceil(j/n); sprite._homeX = Graphics.width*((j-1)%n)/(n*1.2); sprite._homeX += Graphics.width*l/(n*1.2*line); sprite._homeY -= depth-(Math.ceil(depth*Math.pow(0.7,l))) if (j==1) {maxx = sprite._homeX; minx = sprite._homeX}; if (maxx<sprite._homeX) {maxx=sprite._homeX}; if (minx>sprite._homeX) {minx=sprite._homeY}; j++; }); var centerx = (maxx + minx)/2; var shiftx = (maxx + minx)/2-Graphics.width/2; this._enemySprites.forEach(function(sprite){ sprite._homeX -= shiftx; }); }; Spriteset_Battle.prototype.supponReLinedUpEnemySV = function(){ var whole_x = 0; var depth = 0; this._enemySprites.reverse(); this._enemySprites.forEach(function(sprite){ var base_y = Math.round(Graphics.height*0.5); depth = Math.round(Graphics.height*0.15); sprite._homeY = base_y; whole_x += Math.ceil(sprite.width * sprite.scale.x); }); var line = Math.floor(whole_x / Graphics.width*2)+1; var l = 0; var j = 1; var size = this._enemySprites.length; this._enemySprites.forEach(function(sprite){ l = Math.floor(line*(j-1)/size); sprite._homeX = (Graphics.width/(1+size)*0.6)*(1+line*(j-1)%(size)); sprite._homeY += (Graphics.height/line*3)*(line-l*2)/15 -(Graphics.height/line*3)/30; j++; }); }; _Scene_Battle_start = Scene_Battle.prototype.start; Scene_Battle.prototype.start = function(){ _Scene_Battle_start.call(this) if ($gameTroop.supponReUsed) { if ($dataSystem.optSideView){ this._spriteset.supponReLinedUpEnemySV(); } else { this._spriteset.supponReLinedUpEnemy(); } } } })();
SupponREE101.zip
本贴来自国际rpgmaker官方论坛作者:suppon2008处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/random-enemies-emergence-more-than-8-enemies.48776/
页:
[1]