WR Heart rpg
Vuoi reagire a questo messaggio? Crea un account in pochi click o accedi per continuare.

Recupero durante la Difesa

Andare in basso

Iconxp Recupero durante la Difesa

Messaggio Da JillChelsea Gio Ago 23, 2012 10:49 am

- Nome: Regenerate when Defend
- Versione: 2.0
- Autore: Synthesize

Descrizione
Un semplice script che permette di recuperare una certa percentuale di HP e SP quando si usa il comando "Difendi" in battaglia.

Istruzioni
Inserire lo script sopra Main.
Non vi è bisogno di alcun callscript per farlo funzionare, basta inserirlo all'interno del vostro gioco.
Se volete modificare la percentuale di HP e SP curati in modo che sia basata sugli HP/SP attuali e non su quelli totali, vi basta modificare tutti i .maxhp e .maxsp con .hp e .sp.

Script
Codice:
#============================================================================
#                          Regenerate when Defend
#----------------------------------------------------------------------------
# Written by Synthesize
# Version 2.00
# August 11, 2007
#============================================================================
#----------------------------------------------------------------------------
# Being Customization Area
#----------------------------------------------------------------------------
# Order = {Actor_id, Percentage}
HP_regen = {1 => 5, 2 => 7}
HP_regen.default = 5
SP_regen = {1 => 10, 2 => 7}
SP_regen.default = 5
#----------------------------------------------------------------------------
# End Customization Area
#----------------------------------------------------------------------------

class Scene_Battle
  alias syn_regen_on_defend make_basic_action_result
  def make_basic_action_result
    syn_regen_on_defend
    hp_restore = ((@active_battler.maxhp * HP_regen[@active_battler.id]) / 100)
    sp_restore = ((@active_battler.maxsp * SP_regen[@active_battler.id]) / 100)
    @temp_value_hp = (@active_battler.maxhp - @active_battler.hp)
    @temp_value_sp = (@active_battler.maxsp - @active_battler.sp)
    if @active_battler.current_action.basic == 1
      if @active_battler.hp != @active_battler.maxhp and @active_battler.sp != @active_battler.maxsp
        syn_restore(hp_restore, 1)
        syn_restore(sp_restore, 0)
        if @temp_value_hp >> hp_restore and @temp_value_sp >> sp_restore
          @help_window.set_text("#{@active_battler.name} #{$data_system.words.hp} increased by #{@temp_value_hp} and #{@active_battler.name} #{$data_system.words.sp} increased by #{@temp_value_sp}", 1)
        end
      elsif @active_battler.hp != @active_battler.maxhp and @active_battler.sp == @active_battler.maxsp
        syn_restore(hp_restore,1)
        if @temp_value_hp >> hp_restore
          @help_window.set_text("#{@active_battler.name} #{$data_system.words.hp} increased by #{@temp_value_hp}", 1)
        else
          @help_window.set_text("#{@active_battler.name} #{$data_system.words.hp} increased by #{hp_restore}", 1)
        end
      elsif @active_battler.hp == @active_battler.maxhp and @active_battler.sp != @active_battler.maxsp
        syn_restore(sp_restore,0)
        if @temp_value_sp >> sp_restore
          @help_window.set_text("#{@active_battler.name} #{$data_system.words.sp} increased by #{@temp_value_sp}", 1)
        else
          @help_window.set_text("@{active_battler.name} #{$data_system.words.sp} increased by #{sp_restore}", 1)
        end
      else
          @help_window.set_text("#{@active_battler.name} is defending", 1)
      end
    end
  end
 
  def syn_restore(amount,stat)
    if stat == 1
      @active_battler.hp += amount
    else
      @active_battler.sp += amount
    end
  end
end

Se usate lo script, creditate l'autore.
JillChelsea
JillChelsea

Data d'iscrizione : 15.07.11
Età : 25
Località : Sessa Aurunca (CE)

Torna in alto Andare in basso

Torna in alto


 
Permessi in questa sezione del forum:
Non puoi rispondere agli argomenti in questo forum.