RMParadise

It seems you either have yet to login or are not a member of RMP. If you are not yet a member, please feel free to sign up so that you can unlock every feature our forums have to offer. If you have yet to login, please do so soon.

A Paradise for RPGMakers.

Welcome everyone to RMP, your very own RPGMaker Paradise.
If you are reading this, that means that you are one of the select few who have been invited to experience our site as a Beta User.
Being a Beta User only requires that you report any bugs and/or problems upon finding them.
You get the chance to have free roam over the boards before they are public and are further up in line for promotions (which will be happening very soon, so stay on your best behavior).
Check out the thread for the RMP Beta Contest. Lets get some new content rolling.
Chat
Back to Top

    Restore/Set after Battle/Level

    Share
    avatar
    Vlue
    I'm a new member :)
    I'm a new member :)

    Registered on Registered on : 2012-05-28
    Posts Posts : 30
    Rep. Points Rep. Points : 13

    Restore/Set after Battle/Level

    Post by Vlue on Mon Jun 04, 2012 12:20 am

    Restore/Set after Battle/Level v1.1
    By V.M. of D.T.


    Introduction
    Simple simple simple... Lost where I was going with that. Small edit to allow you to set hp/mp after battle by percentage or certain amount.
    Perfect if you say want full restores after battle or for hp or mp to recover by a certain amount after each battle.
    Now with restore after Level!

    How to Use
    Plug and play and customize if need be.

    Script:
    Code:
    #Restore After Battle
    #----------#
    #Features: Allows you to set designated amounts of hp or mp to restore after
    #          a battle for different methods of game style.
    #
    #Usage:    Plug and play and customize
    #       
    #Customization: Set below, in comments.
    #----------#
    #-- Script by: V.M of D.T
    #--- Free to use in any project with credit given

    LEVELRESTORE  = true #Full restore Upon leveling
    BATTLERESTORE = true #Set restore Upon battle end

    #HPSETTYPE and MPSETTYPE
    # Set to 0 for setting of hp/mp to a specific number after battle.
    # Set to 1 for setting of hp/mp to a specific percentage after battle.
    # Set to 2 for adding to hp/mp by a certain percentage of maxhp/maxmp
    HPSETTYPE = 0     
    MPSETTYPE = 0

    #The numbers to use when setting hp/mp after battle!
    HPSET    = 100
    MPSET    = 100

    class Game_Actor < Game_Battler
      alias recover_level_up level_up
      def level_up
        recover_level_up
        self.hp = self.mhp if LEVELRESTORE
        self.mp = self.mmp if LEVELRESTORE
      end
    end

    class Scene_Battle < Scene_Base 
      alias recover_terminate terminate
      def terminate
        if BATTLERESTORE != true then recover_terminate else
        recover_terminate
        for actor in $game_party.members
          case HPSETTYPE
          when 0
            actor.hp = HPSET
          when 1
            actor.hp = actor.mhp * HPSET / 100
          when 2
            actor.hp += actor.mhp * HPSET / 100
          end
          case MPSETTYPE
          when 0
            actor.mp = MPSET
          when 1
            actor.mp = actor.mmp * MPSET / 100
          when 2
            actor.mp += actor.mmp * MPSET / 100
          end
        end
        end
      end
    end

    FAQ
    N/A

    Credit and Thanks
    - By V.M. of D.T.
    - Free to use in any project with credit given.

    History
    Version 1.1 - Added restore after leveling
    avatar
    Hyde
    Administrator
    Administrator

    Registered on Registered on : 2012-05-18
    Posts Posts : 101
    Rep. Points Rep. Points : 6

    Re: Restore/Set after Battle/Level

    Post by Hyde on Mon Jun 04, 2012 12:43 am

    Again, a nice little script that will end up helping alot of people out. Thank you for bringing this to us.


    _________________

    avatar
    DawningStar
    I'm a new member :)
    I'm a new member :)

    Registered on Registered on : 2012-05-29
    Posts Posts : 65
    Rep. Points Rep. Points : 9

    Re: Restore/Set after Battle/Level

    Post by DawningStar on Mon Jun 04, 2012 1:51 pm

    I love it! Great job on the script! :D

    Sponsored content

    Re: Restore/Set after Battle/Level

    Post by Sponsored content


      Current date/time is Thu Dec 13, 2018 7:43 am