设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 97|回复: 0

[转载发布] Random Enemies Emergence more than 8 enemies.

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    慵懒
    3 天前
  • 签到天数: 207 天

    连续签到: 1 天

    [LV.7]常住居民III

    3646

    主题

    862

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    21262
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    25800

    灌水之王

    发表于 3 天前 | 显示全部楼层 |阅读模式
    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

    [/url]

    [url=https://forums.rpgmakerweb.com/attachments/supponre02-jpg.25353/]



    [/url]

    [url=https://forums.rpgmakerweb.com/attachments/supponre04-jpg.25355/]


     

    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[this._troopId].pages[0].list;        for (var i=0; i<lists.length; i++) {            console.log(lists);            if (!lists.parameters[0] || !(lists.code === 356)){continue};            var args = lists.parameters[0].split(" ")            var command = args.shift();                   if (command == "supponREE") {                for (var j=0; j<args[1]; j++){                if (args[0] > Math.randomInt(100) || enemyNumber == 0) {                    var enemyId = args[2+Math.randomInt(args.length - 2)];                    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

    [/url]

    [url=https://forums.rpgmakerweb.com/attachments/supponre02-jpg.25353/]


    [/url]

    [url=https://forums.rpgmakerweb.com/attachments/supponre04-jpg.25355/]



    本贴来自国际rpgmaker官方论坛作者:suppon2008处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/random-enemies-emergence-more-than-8-enemies.48776/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-7-10 04:21 , Processed in 0.134552 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表