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

[转载发布] MP Regen System

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

    连续签到: 1 天

    [LV.7]常住居民III

    3646

    主题

    862

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 前天 20:01 | 显示全部楼层 |阅读模式
    Mp Regeneration System

    v 1.4

    FenixFyreX



    Introduction

    This script sets everyone's MP to 0 (one actually, cause of the first turn) at the beginning of the battle and gives each actor and enemy a defined amount of MP each turn.

    Features


    • -=- Make MP start at 0 and work it's way up, making battles much more strategic.
      -=- Turn the whole system off entirely, just for actors, or just for enemies via script calls.
      -=- Manipulate the amount of MP Regen via a script call.

    Version Changes


    • -=- v1.0 -- Added in switches and such, allowing for more customization.
      -=- v1.1 -- Fixed a bug
      -=- v1.2 -- Added support for and intelligence boost
      -=- v1.3 -- Fixed a bug and changed one method
      -=- v1.4 -- Changed the system to regen mp per actor, not to whole party / troop

    How To

    To turn the whole system off, call this in an event:



                    Code:        
    mpreg_sys(true / false)

    To disable the whole system for actors, call this in an event:



                    Code:        
    mpreg_act(true / false)

    To disable the whole system for enemies, call this in an event:



                    Code:        
    mpreg_eny(true / false)

    To change the amount of mp regeneration per turn, call this in an event:



                    Code:        
    mpreg_amt(type, number)

    Where type is 0 (actors) or 1 (enemies) and number is the amount you wish to change to.

    Script

    Spoiler                 Code:        
    =begin -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -=                                           MP Regenerator System v1.4                                                   -= -=                                                          FenixFyreX                                                                        -= -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=   There are a couple commands to be aware of.  To turn the whole system off, use this script call:     mpreg_sys(true / false)   To turn the system off only for actors, use this:     mpreg_act(true / false)   To turn the system off only for enemies, use this:     mpreg_eny(true / false)   To change how much mp each turn regenerates, use this:     mpreg_amt(type, number)    Where type is 0(actors) or 1(enemies) and number is the amount to regen each   turn.    Other setup is below.  =end  module Mp_Reg_Setup    # If the below is 0, mp will be returned to 0 after battle. if 1, mp will   # be fully restored. any other number will result in mp staying the same.    Mp_Return_Action = 0    #--------------------------   # What each actor's mp will be set as at the beginning of battle.    Mp_Start_Value   = 0    #--------------------------   # How much mp each actor and enemy gains per turn.    Regen_Amount_A   = 1  # Actors   Regen_Amount_E   = 1  # Enemies    #--------------------------   # Which options to start with    Start_System         = true   Start_Actors         = true   Start_Enemys         = true    #--------------------------   # do you want the system to NOT effect those who are dead?   Stop_When_Dead   = true    #--------------------------   # If true, intelligence will affect the mp gained.    Use_Int_Effect   = true    #---------------------------   # You can use your own formula for the above switch via the global variable:   # To specify the active battler be it actor or enemy, use i. So, i is the   # active battler.    $mp_reg_form = "((i.spi / 100) * 4)"  end  class Scene_Battle < Scene_Base    alias mpregen_prog start unless $@   def start         mpregen_prog         start_mp_regen   end    def start_mp_regen         if $game_system.mp_regen_switch[0]           if $game_system.mp_regen_switch[1]                 $game_party.members.each {|i| i.mp = Mp_Reg_Setup::Mp_Start_Value}           end           if $game_system.mp_regen_switch[2]                 $game_troop.members.each {|i| i.mp = Mp_Reg_Setup::Mp_Start_Value}           end           $game_party.members.each {|i| do_add_mp_regen(i)}         end   end    alias mpreg_s_main process_action unless $@   def process_action         if !Mp_Reg_Setup::Stop_When_Dead           do_add_mp_regen(@active_battler) if $game_system.mp_regen_switch[0]         else           if !@active_battler.nil?                 if !@active_battler.state?(1)                   do_add_mp_regen(@active_battler) if $game_system.mp_regen_switch[0]                 end           end         end         mpreg_s_main   end    def do_add_mp_regen(i)         if $game_system.mp_regen_switch[1] and @active_battler.is_a?(Game_Actor)           if Mp_Reg_Setup::Use_Int_Effect                 number = ((i.spi / 100) * 4).to_i if $mp_reg_form == nil                 number = eval($mp_reg_form) if $mp_reg_form != nil                 i.mp += $game_system.mp_regen_amt[0] + number                 if i.mp > i.maxmp                   i.mp = i.maxmp                 end           else                 i.mp += $game_system.mp_regen_amt[0]                 if i.mp > i.maxmp                   i.mp = i.maxmp                 end           end         end         if $game_system.mp_regen_switch[2] and @active_battler.is_a?(Game_Enemy)           if Mp_Reg_Setup::Use_Int_Effect                 number = ((i.spi / 100) * 4).to_i if $mp_reg_form == nil                 number = eval($mp_reg_form) if $mp_reg_form != nil                 i.mp += $game_system.mp_regen_amt[0] + number                 if i.mp > i.maxmp                   i.mp = i.maxmp                 end           else                 i.mp += $game_system.mp_regen_amt[1]                 if i.mp > i.maxmp                   i.mp = i.maxmp                 end           end         end   end    def do_regen_end         regener = Mp_Reg_Setup::Mp_Return_Action         if regener == 0           $game_party.members.each {|i| i.mp = 0}         elsif regener == 1           $game_party.members.each {|i| i.mp = i.maxmp}         end   end    alias mp_regen_batend battle_end unless $@   def battle_end(*args)         switch = $game_system.mp_regen_switch         do_regen_end if switch[0] and switch[1]         mp_regen_batend(*args)   end end  class Game_System    include Mp_Reg_Setup    attr_accessor :mp_regen_switch   attr_accessor :mp_regen_amt    alias mp_regen_init initialize unless $@   def initialize         mp_regen_init         @mp_regen_switch = [Start_System, Start_Actors, Start_Enemys]         @mp_regen_amt        = [Regen_Amount_A,Regen_Amount_E]   end end  class Game_Interpreter    def mpreg_amt(item, number)         $game_system.mp_regen_amt[item] = number   end    def mpreg_sys(sys)         $game_system.mp_regen_switch[0] = sys   end    def mpreg_act(actr)         $game_system.mp_regen_switch[1] = actr   end    def mpreg_eny(eny)         $game_system.mp_regen_switch[2] = eny   end end #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# # END #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#





    Notes / Credit

    Give credit to me for creating this and Rezna for requesting it, please  


    Also, this should work with any battle system out there. If not, just yell and I'll patch it.

    EDIT: It should work with any battle system now o.0 But as most battle systems are different, I can't guarantee that XD


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-10 01:08 , Processed in 0.117918 second(s), 57 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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