Ogłoszenie 

Uwaga! To forum jest w trybie offline.
Wszelką pomoc uzyskasz pod adresem
forum.ultimateam.pl


Administracja Forum


Poprzedni temat «» Następny temat
Regeneracja obronna
Autor Wiadomość
Asantos 




Preferowany:
RPG Maker VX

Ranga RM:
1 gra

Pomógł: 15 razy
Dołączył: 31 Sty 2010
Posty: 236
Skąd: Gniezno
Wysłany: Wto 04 Maj, 2010 21:38
Regeneracja obronna
~ Regeneracja obronna ~

Krótki opis
Skrypt wprowadza regeneracje życia i/lub many podczas obrony w trakcie trwania walki.

Autor skryptu
Synthesize


Tłumaczenie

Asantos

Kompatybilność

Tylko VX

Skrypt

Spoiler:

Kod:
#===============================================================================
# Regenerate HP/MP - RMVX Version
#===============================================================================
# Written by Synthesize
# Version 1.2.0
# January 19, 2008
#===============================================================================
#            *Nie kompatybilny z XP*
#===============================================================================
module SynRegen
  # Format = { Actor_ID => procent regeneracji, Actor_ID2 => procent regeneracji}
  HP_regen = {1 => 5, 2 =>7} # %
  # Możesz zdecydować ile HP będzie regenerował jaki bohater.
  # Bohaterów oddzielaj przecinkiem (,)
  #-----------------------------------------------------------------------------
  # Jeśli nie jest ustawione ID bohatera to jest domyślna wartość
  HP_regen.default = 5 # %
  #-----------------------------------------------------------------------------
  # Prawdziwość regeneracji HP
  Use_hp_regen = true
  #----------------------------------------------------------------------------
  # Format = {Actor_ID => MP regenerowane
  MP regenerowane = {1 => 5, 2 => 7} # %
  # Tak jak wyżej, tylko decydujemy o MP
  #
  #-----------------------------------------------------------------------------
  # Domyślny procent regeneracji
  SP_regen.default = 5 # %
  #-----------------------------------------------------------------------------
  # Prawdziwość regeneracji MP
  Use_mp_regen = true
  #-----------------------------------------------------------------------------
  # MA być wyświetlane ilość zregenerowanego życia i many
  Draw_text = true
  #-----------------------------------------------------------------------------
  # Ilość obron aby można było uzyskać SUPER OBRONĘ
  Super_guard_rate = 4
  #-----------------------------------------------------------------------------
  # Ilość obron dla normalnej obrony
  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 zregenerowane o #{hp_restore}  MP zregenerowane o #{sp_restore}")
    elsif temp_value_hp != 0 and temp_value_mp == 0
      @message_window.add_instant_text("#{@active_battler.name} HP zregenerowane o #{hp_restore}")
    elsif temp_value_hp == 0 and temp_value_mp != 0
      @message_window.add_instant_text("#{@active_battler.name} MP zregenerowane o #{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
#===============================================================================
# Skrypt nie jest kompatybilny RMXP
#===============================================================================
#           * Skrypt powinien teoretycznie działać *
#===============================================================================
# Written by Synthesize
# January 19, 2008
#===============================================================================
# Regeneracja HP/MP - RMVX Version
#===============================================================================


Demo

niepotrzebne

Instrukcja

1. Wklej skrypt nad "Main" w Edytorze Skryptu.
2. Reszta instrukcji znajduje się w treści skryptu.
________________________
Rebelianci łączcie się!
Ostatnio zmieniony przez Asantos Wto 04 Maj, 2010 22:17, w całości zmieniany 2 razy  
 
 
Asantos 




Preferowany:
RPG Maker VX

Ranga RM:
1 gra

Pomógł: 15 razy
Dołączył: 31 Sty 2010
Posty: 236
Skąd: Gniezno
Wysłany: Wto 04 Maj, 2010 22:17
Poprawione hehe :) Mój błąd...
________________________
Rebelianci łączcie się!
 
 
cj2 




Preferowany:
RPG Maker VXAce

Ranga RM:
1 gra

Pomógł: 6 razy
Dołączył: 07 Mar 2010
Posty: 261
Skąd: Gliwice
Wysłany: Sro 05 Maj, 2010 13:59
Czy działa przy walce na mapie?
________________________
Porady dla twórców gier
Nie ma śniegu, a zgubiłem normalny avatar :I
 
 
Sabikku 




Nagrody:
UF i UFT2 Winner

Ranga RM:
4 gry

Pomógł: 73 razy
Dołączył: 04 Kwi 2010
Posty: 428
Wysłany: Sro 05 Maj, 2010 19:50
Jakby ktoś chciał do xp, proszę:
Spoiler:



Przydatny skrypt.
 
 
 
MrQubo 



Preferowany:
RPG Maker VX

Dołączył: 08 Wrz 2012
Posty: 10
Skąd: Tłuszcz
Wysłany: Pią 16 Lis, 2012 16:54
MP regenerowane = {1 => 5, 2 => 7} # %

Tu jest błąd, trzeba zamienić na SP_regen :

SP_regen = {1 => 5, 2 => 7} # %
________________________
Postęp w tworzeniu mojej gry:
Nazwa: 0% XD
Fabuła: 1%
Skrypty: 20%
Mapy: 5%
Grafika: 1%
Questy: 0%

Chętnie zrobię projekt wspólnie, każdy się przyda. :)

Zapraszam do gry w League of Legends: KLIK, naprawdę bardzo fajna gra :)
 
 
Wyświetl posty z ostatnich:   
Odpowiedz do tematu
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Nie możesz załączać plików na tym forum
Możesz ściągać załączniki na tym forum
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

Powered by phpBB modified by Przemo © 2003 phpBB Group | Template Klam by Ayene