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 기타 게임 해상도를 조절 하는 스크립트 19 아방스 2008.01.21 4780
» 전투 방어를 했을경우 hp / mp 회복 되도록 하는 스크립트 15 아방스 2008.01.22 3746
635 전투 전투배경을 자신이 원하는 형태로 45 file 아방스 2008.01.23 7137
634 전투 전투 배경을 이미지로 설정하는 스크립트 20 file 아방스 2008.01.23 4889
633 이동 및 탈것 동료가 따라다니게 하는 스크립트 59 file 아방스 2008.01.23 6512
632 메시지 문장 넘길대 소리나게 하는스크립트 19 아방스 2008.01.24 4180
631 전투 맨손 공격시 2번공격하는 스크립트 5 아방스 2008.01.24 2357
630 타이틀/게임오버 RPG VX - 타이틀 스크린 스크립트 23 아방스 2008.01.24 5740
629 메뉴 메뉴변경 스크립트 34 아방스 2008.01.24 7937
628 이동 및 탈것 달릴때 그래픽을 바꿔주는 스크립트 12 file 아방스 2008.01.24 4097
627 전투 전투시 메시지 표시 시간 조절 7 file 아방스 2008.01.24 2827
626 전투 Target 몬스터 플래시 스크립트 16 아방스 2008.01.24 4512
625 메뉴 rpg 만들기 vx 정보창에 조금더 자세한 정보가 나오게 하는 스크립트 28 아방스 2008.01.25 5076
624 전투 VX에서 전투배경을 XP스타일로 나오게 하는 스크립트 7 아방스 2008.01.25 4839
623 HUD rpg 만들기 vx - 맵이름 띠우는 스크립트 ^^ 74 아방스 2008.01.27 11920
622 그래픽 RPG XP의 Transitions효과를 VX에도 적용을 해보자 4 아방스 2008.01.27 3930
621 장비 [스크립트]무기에 옵션을 부가하자 18 아방이 2008.01.29 5380
620 변수/스위치 특정 키눌러서 스위치 온 시키는 스크립트 7 아방이 2008.01.30 2607
619 맵/타일 ◆ 타일 세트 확장 스크립트 [업데이트 수정] 24 file 아방이 2008.01.30 4386
618 메뉴 윈도우창 크기 조절 스크립트 0.3 5 아방스 2008.01.30 3038
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