KenzoMe92

KZM - Core

Jul 15th, 2021
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.95 KB | None | 0 0
  1. $imported = {} if $imported == nil
  2. $imported["KZM_CORE"] = true
  3. #==============================================================#
  4. # KZM - Core                                                   #
  5. #==============================================================#
  6. # Quest'opera รจ stata rilasciata con licenza Creative Commons  #
  7. # Attribuzione - Condividi allo stesso modo 3.0 Italia. Per    #
  8. # leggere una copia della licenza visita il sito web           #
  9. # http://creativecommons.org/licenses/by-sa/3.0/it/            #
  10. # o spedisci una lettera a                                     #
  11. # Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. #
  12. #==============================================================#
  13. # Versione 1.1                                                 #
  14. #--------------------------------------------------------------#
  15. # Storia                                                       #
  16. # 08/06/2015 Script iniziato e finito                          #
  17. # 07/06/2016 Inclusa la Cura su Level UP all'interno del Core  #
  18. #==============================================================#
  19. # Descrizione                                                  #
  20. # Questo script permette di personalizzare il vostro           #
  21. # progetto solamente configurando la parte qua sotto           #
  22. #==============================================================#
  23. # Istruzioni                                                   #
  24. # Installare sotto "โ–ผ Materials" e sopra "โ–ผ Main".             #
  25. #==============================================================#
  26. # CONFIGURAZIONE                                               #
  27. #==============================================================#
  28. module KZM
  29.   RISOLUZIONE = [640,480] # Game resolution, max 640x480
  30.   SALVATAGGIO = '.sav' # save file extension
  31.   SLOT = 15 # number of save slots
  32.   Font.default_name = ["Times New Roman"] # default text font
  33.   SIZE    = 20       # font size
  34.   BOLD    = true     # grassetto true => attivo, false => disattivo
  35.   ITALIC  = false    # corsivo true => attivo, false => disattivo
  36.   OUTLINE = true     # bordo true => attivo, false => disattivo
  37.   SHADOW  = true     # ombreggiatura true => attivo, false => disattivo
  38.   ATTIVO  = 1        # enable Switch [x] to enable heal on level up function (write the switch number instead of 1)
  39.   HP      = 2        # if heal on level up is on, with this switch enabled (write the switch number instead of 2),
  40.                      # only hp and mp will be restored on level up, else, even states will be affected by it
  41. end
  42. #=============================================================#
  43. # FINE CONFIGURAZIONE    ** DO NOT MODIFY ANYTHING BELOW **   #
  44. #=============================================================#
  45. module SceneManager
  46.   def self.run
  47.     Graphics.resize_screen(KZM::RISOLUZIONE[0],KZM::RISOLUZIONE[1])
  48.     DataManager.init
  49.     Audio.setup_midi if use_midi?
  50.     @scene = first_scene_class.new
  51.     @scene.main while @scene
  52.   end
  53. end
  54. module DataManager
  55.   def self.save_file_exists?
  56.     !Dir.glob('Save*' + KZM::SALVATAGGIO).empty?
  57.   end
  58.   def self.savefile_max
  59.     return KZM::SLOT
  60.   end
  61.   def self.make_filename(index)
  62.     sprintf("Save%02d" + KZM::SALVATAGGIO, index + 1)
  63.   end
  64. end
  65. class Window_Base < Window
  66.   def setup_message_font
  67.     change_color(normal_color)
  68.     contents.font.out_color = Font.default_out_color
  69.     contents.font.size = KZM::SIZE
  70.     contents.font.bold = KZM::BOLD
  71.     contents.font.italic = KZM::ITALIC
  72.     contents.font.outline = KZM::OUTLINE
  73.     contents.font.shadow = KZM::SHADOW
  74.   end
  75.   alias window_base_reset_font_settings_ams reset_font_settings
  76.   def reset_font_settings
  77.     setup_message_font
  78.   end
  79. end
  80. class Game_Actor < Game_Battler
  81.    alias heal_on_level_up level_up
  82.    def level_up
  83.      heal_on_level_up
  84.        if $game_switches[KZM::ATTIVO]
  85.          if $game_switches[KZM::HP]
  86.           @hp = mhp
  87.           @mp = mmp
  88.          else
  89.           recover_all
  90.         end
  91.       end
  92.    end
  93. end
Add Comment
Please, Sign In to add comment