VX 스크립트

▶ MAIN 섹쉰 위쪽에 추가해주세요
#===============================================================================
# Regenerate HP/MP - RMVX Version
#===============================================================================
# Written by Synthesize
# Version 1.2.0
# January 19, 2008
#===============================================================================
#            *This script is not compatible with RPG Maker XP*
#===============================================================================
module SynRegen
  # Format = { Actor_ID => Percent to restore, Actor_ID2 => Percent to restore}
  HP_regen = {1 => 5, 2 =>7} # %
  # You can define how much HP each individual actor regenerates when they
  # Defend. Add new actors by seperating each returning value with a comma (,)
  #-----------------------------------------------------------------------------
  # This value determines the Default Percent growth if the Actor_ID is not
  # in the above hash
  HP_regen.default = 5 # %
  #-----------------------------------------------------------------------------
  # Set to true to enable HP regen in battle, false to disable.
  Use_hp_regen = true
  #----------------------------------------------------------------------------
  # Format = {Actor_ID => SP to restore
  SP_regen = {1 => 5, 2 => 7} # %
  # You can define how much SP each individual actor regenerates when they
  # defend. Add new actors by seperating each returning value with a comma (,)
  #-----------------------------------------------------------------------------
  # This is the default percentage to regenerate if the Actor_ID is not in the
  # hash.
  SP_regen.default = 5 # %
  #-----------------------------------------------------------------------------
  # Set to true to enable, false to disable
  Use_mp_regen = true
  #-----------------------------------------------------------------------------
  # Draw how much HP/MP the actor regenerated?
  Draw_text = true
  #-----------------------------------------------------------------------------
  # The defense rate if the actor has 'Super Defense'
  Super_guard_rate = 4
  #-----------------------------------------------------------------------------
  # The defense rate if the actor has 'Normal Defense'
  Normal_guard_rate = 2
end
#-------------------------------------------------------------------------------
# Scene_Battle
#   This aliases the execute_action_guard method in Scene_Battle
#-------------------------------------------------------------------------------
class Scene_Battle
  # Alias execute_action_guard
  alias syn_regen_execute_guard execute_action_guard
  #-----------------------------------------------------------------------------
  # Execute Action_Guard
  #-----------------------------------------------------------------------------
  def execute_action_guard
    # Calculate the amount of HP and MP gained
    hp_restore = ((@active_battler.maxhp * SynRegen::HP_regen[@active_battler.id]) / 100) if SynRegen::Use_hp_regen == true
    sp_restore = ((@active_battler.maxmp * SynRegen::SP_regen[@active_battler.id]) / 100) if SynRegen::Use_mp_regen == true
    # Calculate the different between MaxHP, HP, MaxMP and MP
    temp_value_hp = (@active_battler.maxhp - @active_battler.hp)
    temp_value_mp = (@active_battler.maxmp - @active_battler.mp)
    # Add HP and MP
    @active_battler.hp += hp_restore if SynRegen::Use_hp_regen == true
    @active_battler.mp += sp_restore if SynRegen::Use_mp_regen == true
    # Draw how much HP/MP the actor regenerated
    if temp_value_hp != 0 and temp_value_mp != 0
      @message_window.add_instant_text("#{@active_battler.name} HP increased by #{hp_restore} and MP increased by #{sp_restore}")
    elsif temp_value_hp != 0 and temp_value_mp == 0
      @message_window.add_instant_text("#{@active_battler.name} HP increased by #{hp_restore}")
    elsif temp_value_hp == 0 and temp_value_mp != 0
      @message_window.add_instant_text("#{@active_battler.name} MP increased by #{sp_restore}")
    end
    # Call the original code
    syn_regen_execute_guard
  end
end
#-------------------------------------------------------------------------------
# Game_Battler
#   This rewrites the defense method found in Game_Battler
#-------------------------------------------------------------------------------
class Game_Battler
  #-----------------------------------------------------------------------------
  # Apply_Guard_Damage
  #-----------------------------------------------------------------------------
  def apply_guard(damage)
    if damage > 0 and guarding?
      # Divide the total damage from the effectivness of the defense rate.
      damage /= super_guard ? SynRegen::Super_guard_rate : SynRegen::Normal_guard_rate    
    end
    return damage
  end
end
#===============================================================================
# This script is not compatible with Rpg Maker XP. However, I have also made a
# RPG Maker Xp version which can be found on RPGRPG Revolution.
#===============================================================================
#           * This script is untested but should work in theory *
#===============================================================================
# Written by Synthesize
# January 19, 2008
#===============================================================================
# Regenerate HP/MP - RMVX Version
#===============================================================================




Comment '15'
  • ?
    참겨니 2008.01.25 19:01

    메세지를 아에 않나오게 할 수는 없나요?

  • ?
    넌닝구가좋아 2008.03.21 18:05
    감사 감사!
  • profile
    NewSet 2008.03.28 21:40
    감사합니다^^!
  • ?
    이렐 2008.08.20 15:56

    감사합니다~

  • ?
    21thcentuary 2008.09.23 19:13
    좋긴좋은데 쓰기는 싫네.
  • ?
    레핀 2008.09.24 03:14
    이 스크립트를 쓰고서 [방어] 커맨드 이름을 [휴식]으로 바꿔버리면 딱이겠네요 ~
  • ?
    불독 2008.11.04 18:35
    저두 레핀 님 생각에 동의.
  • profile
    카와이 2009.01.12 19:30
    멋쟁이 ㅋ
  • ?
    흠냐흠냐 2009.07.07 17:46

    흠냐 복사하면 한줄로 쭉 나와서 어떻게 할수가 없네요 ㅎㄷ;;

  • ?
    음냐~~ 2010.02.12 15:04

    방어를 하니 mp,hp가 올라가는군요

    지정된 방패만 이 기능이 있으면 좋을것 같네요

  • ?
    이수 2010.06.12 14:04

    감사합니당ㅋㅋ

  • ?
    다시한번 2010.07.28 09:25

    감사합니다~ ㅇㅁㅇ 이런거 있는줄 모랐어요 ㅇㅁㅇ;;

  • ?
    달봉스쿨 2010.08.20 18:58

    스크립트는 좋은데, 이것도 어떻게 쓰느냐 일 것 같네요.ㅋ

  • ?
    하얀아이 2011.09.24 03:07

    오 마침 찾고 있었는데

  • ?
    러닝금빛 2012.06.15 20:27

    피가 사기적으로 차지 않도록 회복량 조절도 해주면 좋겠어요 ㅋ


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5398
637 기타 Gamepad Extender VX 습작 2015.01.02 672
636 버그픽스 DerVVulfman's Tileset Reader VX Bug Fix 습작 2014.11.16 701
635 아이템 현재있는 파티원 선택 레벨업 아이템 만들기 1 file 싸패 2016.06.06 713
634 메뉴 Etude87_Ace_Style_Formation_Change ver.1.01 습작 2014.10.05 758
633 저장 세이브 파일 개수 16개로 늘리기 (기본 세이브 엔진용) 1 file Bunny_Boy 2015.09.07 816
632 ??? 1 Man... 2008.10.27 1020
631 버그픽스 Graphical Object Global Reference VX by Mithran Alkaid 2014.03.03 1027
630 키입력 No F1, F12 and Alt+Return (Kein F1, F12 und Alt+Eingabe) by cremno 습작 2013.04.19 1046
629 메시지 Etude87 Dialogue History Scene file 습작 2014.07.07 1069
628 ??(다 영어)여기서 부터 드레그만 빼고 Man... 2008.10.27 1078
627 메뉴 KGC - 커스텀 메뉴 커멘드 (번역) 1 듀란테 2015.07.27 1078
626 Scene_Credit script Plug & Play 1 Man... 2008.10.27 1085
625 Multi-threader snippet by Omegazion Man... 2008.10.28 1107
624 메뉴 MOG - Scroll Bar for VX file 습작 2014.07.06 1115
623 Screen Shortcut Script Man... 2008.10.27 1142
622 LevelMe v1.2 3 Man... 2008.10.27 1154
621 Screen Resolution 3 Man... 2008.10.28 1171
620 키입력 Key Simulator by Fantasist 습작 2013.05.01 1176
619 MAX Level Limitation System 3 Man... 2008.10.28 1198
618 Simple Fon Chage 3 Man... 2008.10.28 1212
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 32 Next
/ 32