Cria um status no qual você se cura automaticamente à cada turno Algo como quando se usa o ataque Aqua Ring no Pokémon. Pode ser usado para recuperar também SP.

Desenvolvimento: Site KGC

Tradutor: MogHunter

Crie estes status no banco de dados HPREC e SPREC.

Ao lado de cada status devemos definir o valor de porcentagem.

EXEMPLO:

Para definirmos que o status ira recuperar 15% do HP do  personagem, devemos nomear o status desta maneira: HPREC15%

E no caso do SP: SPREC15%

module KGC
  AR_RECOVER_TIMING = 0
end
$imported["AutoRecover"] = true
$game_state_auto_recover = /(HP|SP)?REC(\\d+)(%|%)?/i
class Scene_Battle
  alias start_phase2_KGC_AutoRecover start_phase2
  def start_phase2
    @last_turn = $game_temp.battle_turn if @last_turn == nil
    if KGC::AR_RECOVER_TIMING == 1 && $game_temp.battle_turn != @last_turn
      @last_turn = $game_temp.battle_turn
      ($game_party.actors + $game_troop.enemies).each { |battler|
        battler.states.compact.each { |state|
          next unless $game_state_auto_recover =~ $data_states[state].name
          recover = $2.to_i
          case $1.upcase
          when "HP"  
            recover_hp = $3 != nil ? battler.maxhp * recover / 100 : recover
          when "SP"  
            recover_sp = $3 != nil ? battler.maxsp * recover / 100 : recover
          else 
            if $3 != nil
              recover_hp = battler.maxhp * recover / 100
              recover_sp = battler.maxsp * recover / 100
            else
              recover_hp = recover
              recover_sp = recover
            end
          end
          battler.hp += recover_hp if recover_hp != nil
          battler.sp += recover_sp if recover_sp != nil
          if recover_hp != nil && recover_hp > 0
            battler.damage = -recover_hp
            if $imported["SPDamage"] && recover_sp != nil
              if battler.sp_damage != nil
                battler.sp_damage -= recover_sp
              else
                battler.sp_damage = -recover_sp
              end
            end
            battler.damage_pop = true
          elsif recover_sp != nil && recover_sp > 0
            battler.damage = nil
            if $imported["SPDamage"]
              if battler.sp_damage != nil
                battler.sp_damage -= recover_sp
              else
                battler.sp_damage = -recover_sp
              end
            else
              battler.damage = "#{$data_system.words.sp}+ #{recover_sp}"
            end
            battler.damage_pop = true
          end
        }
      }
      @status_window.refresh
    end
    start_phase2_KGC_AutoRecover
  end
end
class Scene_Battle
  alias update_phase4_step6_KGC_AutoRecover update_phase4_step6
  def update_phase4_step6
    update_phase4_step6_KGC_AutoRecover
    if KGC::AR_RECOVER_TIMING == 0 && !@active_battler.dead?
      @active_battler.states.compact.each { |state|
        next unless $game_state_auto_recover =~ $data_states[state].name
        recover = $2.to_i
        case $1.upcase
        when "HP" 
          recover_hp = $3 != nil ? @active_battler.maxhp * recover / 100 : recover
        when "SP" 
          recover_sp = $3 != nil ? @active_battler.maxsp * recover / 100 : recover
        else  
          if $3 != nil
            recover_hp = @active_battler.maxhp * recover / 100
            recover_sp = @active_battler.maxsp * recover / 100
          else
            recover_hp = recover
            recover_sp = recover
          end
        end
        @active_battler.hp += recover_hp if recover_hp != nil
        @active_battler.sp += recover_sp if recover_sp != nil
        if recover_hp != nil && recover_hp > 0
          @active_battler.damage = -recover_hp
          if $imported["SPDamage"] && recover_sp != nil
            if @active_battler.sp_damage != nil
              @active_battler.sp_damage -= recover_sp
            else
              @active_battler.sp_damage = -recover_sp
            end
          end
          @active_battler.damage_pop = true
        elsif recover_sp != nil && recover_sp > 0
          @active_battler.damage = nil
          if $imported["SPDamage"]
            if @active_battler.sp_damage != nil
              @active_battler.sp_damage -= recover_sp
            else
              @active_battler.sp_damage = -recover_sp
            end
          else
            @active_battler.damage = "#{$data_system.words.sp}+ #{recover_sp}"
          end
          @active_battler.damage_pop = true
        end
      }
      @status_window.refresh if @active_battler.damage_pop
    end
  end
end
Anúncios