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

[转载发布] J MapTime Regen

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    5778

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 昨天 21:21 | 显示全部楼层 |阅读模式
    J_MapTime


    V: 1.0 
            Creator name: J ( Jragyn, J, Jeremy, take your pick)
    Introduction

            This is a stand-alone plugin that puts use to stats like HRG/MRG/TRG on the map. I'll say this many times, but even though it does work without a HUD, I imagine that it would make the most sense to find a HUD that displays two or three of the stats: HP/MP/TP, or whatever you're using.

    Features
            This enables HRG/MRG/TRG to function while on the map.
            Additionally, due to the way I used it (and figured others may too), I setup TP to regenerate about 10x faster than HP/MP.


            I did this to give the illusion that TP was like stamina or something, so it can be (is by default) configured to consume TP when dashing.

    Screenshots
            It is difficult to capture regeneration with imagery.

    How to Use

            Just take the plugin and throw it in your project like you would any other plugin.


            It should just work.


            There is a single setting: "useTPtoDash". Set it to "true"(default) to consume TP when dashing. Set it to "false" to disable that.



    Demo
            This is plug-n-play, there are no dependencies, nor demo needed to demonstrate this.

    Script



            If I am a slacker and fail to keep it up to date on here, you can also find it on my pastebin.

    Spoiler/* -------------------------------------------------------------------------- */
    // J_MapTime
    // V: 1.0

    /*
    plugindesc Provides functionality for HRG/MRG/TRG while on the map.
    @author J

    @param useTPforDash
    @desc Enable/Disable to control dashing with TP availability.
    @default true

    @help This plugin adds the functionality of HP/MP/TP regeneration on the map.
      Ideally, this system would be used in conjunction with an ABS of sorts,
      as it was originally designed to hold hands with qABS, but it does work all
      by itself, too.

    MATH BREAKDOWN: actor's HRG = 50(%).
      formula per tick = ((actor.hrg * 100) / 2) / 5;
    ((0.5 * 100) / 2) / 5
    (50 / 2)  / 5
    25 / 5
    5 per tick (1 tick = 30 frames = 0.5 seconds)

    In short, the actor will regenerate 1/10 of whatever his HRG/MRG is, per tick.
    I opted into making it flatHP instead of %maxHP since % would be pretty op.

    NOTE: TRG's regeneration is updated 10x faster (1 tick = 3 frames = 0.05s)
      Currently, it is being used as "stamina".
      Try making a skill cost like, 15 TP or something and use it as a basic
      attack limiter to prevent the player from swinging excessively.
      If you don't like it, you can just turn it off, too.
      For reference, it takes 15% TRG to cancel out TP depletion while dashing.

    If you intend to use this, I highly recommend you make use of a couple other
    plugins as well:
        > Some ABS (qABS works, but I don't have a link to the original code)
        > A functional HUD: http://pastebin.com/53UjUNiZ (I made it myself :] )
    */
    /* -------------------------------------------------------------------------- */
    var Imported = Imported || {};
    Imported.J_MapTime = true;

    var J = J || {};
    J.mapTime = J.mapTime || {};
    J.mapTime.Parameters = PluginManager.parameters('J_MapTime');
    J.mapTime.useTPforDash = String(J.mapTime.Parameters['useTPforDash']);

    (function() { // start plugin.
    /* -------------------------------------------------------------------------- */
    //  Game_Map Modifications
    //    Handles all the extra variables and adds functionality for the xRG stuff.
    /* -------------------------------------------------------------------------- */

      // adds in timing variables for monitoring when to tick the regenerations.
      var _Game_Map_jRegen_initialize = Game_Map.prototype.initialize;
      Game_Map.prototype.initialize = function() {
        _Game_Map_jRegen_initialize.call(this);
        this._timingHPMP = 0;
        this._timingTP = 0;
      };

      // processes the function that provides HRG/MRG/TRG on the map.
      var _Game_Map_jRegen_update = Game_Map.prototype.update;
      Game_Map.prototype.update = function(sceneActive) {
          _Game_Map_jRegen_update.call(this, sceneActive);
          this.regenOnMap();
          window.console.log(J.mapTime.useTPforDash + ": dash4tp?");
      };

      // Checks if party exists, then performs the onMapFX once per 30 frames.
      // Effects are divided into HP+MP, and TP, so that TP can regenerate at
      //   a faster rate for purpose of being like "stamina".
      Game_Map.prototype.regenOnMap = function() {
        if ($gameParty != null) { var actor = $gameParty.leader(); }
        if (actor) {
          if (this._timingHPMP <= 0) {
            this.doHPMPregen(actor);
            this._timingHPMP = 30;
          }
          else { this._timingHPMP--; }
          if (this._timingTP <= 0) {
            this.doTPregen(actor);
            this._timingTP = 3;
          }
          else { this._timingTP--; }
        }
      };

      // Here, HP/MP regeneration is handled based on HRG/MRG.
      // It is significantly slower than TP Regeneration.
      // Additionally, it is flat regen, not %max regen.
      Game_Map.prototype.doHPMPregen = function(actor) {
        var hpRegen = ((actor.hrg * 100) / 2) / 5;
        var mpRegen = ((actor.mrg * 100) / 2) / 5;
        actor.gainHp(hpRegen);
        actor.gainMp(mpRegen);
      };

      // this rapidly regenerates the player's TP.
      // and also deplete stamina while dashing.
      Game_Map.prototype.doTPregen = function(actor) {
        var mod = 0;
        if (J.mapTime.useTPforDash === "true")
          mod = Game_Player.prototype.isDashButtonPressed() ? 2.5 : 0.0;
        var tpRegen = (((actor.trg + 0.1) * 100) / 10) - mod;
        actor.gainTp(tpRegen);
      };

      // this forces the player to be unable to run while out of TP.
      // note: hopefully this is okay since only actor's can dash (?).
      var _Game_CharacterBase_jqmt_realMoveSpeed = Game_CharacterBase.prototype.realMoveSpeed;
      Game_CharacterBase.prototype.realMoveSpeed = function() {
        if (J.mapTime.useTPforDash === "true") {
          if ($gameParty != null) { var actor = $gameParty.leader(); }
          return this._moveSpeed + ((this.isDashing() && actor.tp > 0) ? 1 : 0);
        }
        else { return _Game_CharacterBase_jqmt_realMoveSpeed.call(this); }
      };
    /* -------------------------------------------------------------------------- */
    //  Window_Base Modification
    //    Because floats are innately messy, this is cleans them up visually.
    /* -------------------------------------------------------------------------- */

      // this fixes the issue of drawing excessively long decimal numbers
      // in places like the menu that draw gauges for HP/MP.
      var _Window_Base_jqmt_drawCurrentAndMax = Window_Base.prototype.drawCurrentAndMax;
      Window_Base.prototype.drawCurrentAndMax = function(current, max, x, y, width, color1, color2) {
        current = current.toFixed(0);
        _Window_Base_jqmt_drawCurrentAndMax.call(this, current, max, x, y, width, color1, color2);
      };
    /* -------------------------------------------------------------------------- */
    })(); // end plugin.






    FAQPost question and answers to common question here in the following format:Q: How come I can't see anything happening?A: You'll probably need a on-the-map HUD. Additionally, you may need to add some base HRG/MRG/TRG to your characters.Credit and Thanks- I wrote this, J, or Jragyn, but J makes more sense based on how I setup stuff in the plugin.Author's NotesAs I mentioned before, this plugin works stand-alone, but is best used in tandem with a HUD or something... and probably an ABS of sorts.


    I've never really submitted anything to these forums, so hopefully this is useful, not bug-ridden, and in proper format!


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-26 02:47 , Processed in 0.112303 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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