Jump to content
Rpg²S Forum

Mithos

Utenti
  • Posts

    97
  • Joined

  • Last visited

Posts posted by Mithos

  1. Dato cher molti dei miei progetti sono andati a farsi benedire a causa di molte, forse troppe lacune,

    ho iniziato a pensare che il miglior modo per imparare sarebbe rubare il mestiere a qualcun'altro, ossia andare a prendere un gioco completo, smontarmelo ed osservare come è fatto, però ho notato che tutti i giochi che ho trovato avevano un archivio criptato e per quanto sia possibile aprire anche quei progetti con le dovute accortezze mi sembrerebbe di cattivo gusto andare a "derubare" un progetto volutamente nascosto.

     

    Voi conoscete qualche gioco completo che non sia criptato per osservarlo smontato?

  2. Buonasera a tutti!

    Stavo cercando invano di recuperare i Faceset ed i battler di Toriaka, però purtroppo il suo sito personale è stato chiuso. (o perlomeno, il link che seguivo io per arrivarci)

    Per chi non li conoscesse, sono questi:

    http://blog-imgs-32.fc2.com/t/o/r/toriaka/vx_face_fsm1.png

     

    Faceset

    http://rpgmaker.net/media/content/games/4844/screenshots/battle2.png

     

    Battler

     

     

    Qualcuno di voi ha, in qualche sperduta cartella queste risorse (sia face che battler) o sa dirmi dove recuperarle?

  3. Salve a tutti!

    Prendendo spunto da un discorso avvenuto in un altro topic ho pensato di raccogliere alcune

    formule utili a creare formule complesse pr i nostri giochi, utili per creare alcuni attacchi personalizzati senza ricorrere a chilometrici script...

     

     

    Se ne sapete altre, suggeritele!

     

    FURTO

    Per eseguire un semplice comando che permetta di rubare denaro al nemico, inserite come formula per l'abilità

    $game_party.gain_gold(N); FORMULA

    dove N è la quantità di oro che vogliamo venga rubato, mentre con FORMULA si intende la formula per infliggere danno. In caso non volessimo danneggiare l'avversario, ma solo derubarlo, inseriamo 0 come formula.

     

    EFFETTO AL LANCIATORE

    Per eseguire un attacco che abbia un effetto secondario sull'utilizzatore creiamo innanzitutto lo stato che vogliamo venga inflitto al lanciatore nel menù stati.

    Quindi inseriamo come formula dell'attacco

    a.add_state(N); FORMULA

    dove N è l' ID dello stato che vogliamo venga aggiunto al lanciatore, mentre FORMULA, la formula per calcolare il danno.

     

    EFFETTO DIVERSO A SECONDA DELL' ARMA

    a.weapons.include?($data_weapons[N]) ? FORMULACON : FORMULASENZA

    Un tantino più complessa: Permette di fare in modo che, se si ha equipaggiato una determinata arma,

    l'effetto dell' attacco sia differente.

    N indica l'arma che attiva la formula personalizzata, FORMULACON la formula in questione e FORMULASENZA il danno dell' abilità senza quell'arma equipaggiata.

    Sostituendo weapons con armors, potremo far modificare l'abilità in base ad una specifica armatura.

     

    EFFETTO INDIVIDUALE

    Ipotizziamo che vogliamo creare un abilità, che abbia un effetto diverso su di un pg.

    La formula da utilizzare è:

    b.id == N ? FORMULACON : FORMULASENZA

    Dove N è l' ID del personaggio che riceve il bonus differente, FORMULACON la formula del bonus per quel personaggio e FORMULASENZA il normale effetto dell'abilità.

     

    EFFETTO DIVERSO SU PIU' PG

    Simile alla precedente, ma ci permette di selezionare più personaggi che subiscano un effetto diverso

    (b.id==N or b.id==N or b.id==N) ? FORMULACON : FORMULASENZA

    In questo caso per ogni N metteremo un Id diverso.

     

    EFFETTO MODIFICATO DA SWITCH

    Se vogliamo che una determinata abilità venga modificata da uno switch, possiamo utilizzare il comando

    $game_switches[N] ? FORMULAON : FORMULAOFF

    Dove N è il numero dello switch, FORMULAON la formula per il danno inflitto quando lo switch è ON, mentre FORMULAOFF il danno inflitto con lo switch su OFF.

     

     

    Ovviamente, tutte queste formule possono essere applicate anche agli oggetti.

     

    PS. Non essendo veri e propri script, credo che la sezione supporto sia la più indicata... Se così non è spostate pure!

  4. Ho scoperto da poco un trucchetto utilissimo:

    Senza bisogno di script o simili, se nella forumal dell attacco inseriamo

    a.add_state(n); dove N è il numero dello stato che vogliamo venga inflitto,

    possiamo infliggere a chi lancia l'attacco uno stato alterato.

    Creando quindi uno stato che toglie PV, ecco che abbiamo una tecnica autolesiva ed aumentando i turni, una tecnica sanguinolenta.

    Senza evetni, script, tricche e ballacche.

     

    spero di esservi stato utile!

  5. Già, un attimo... Circa... :mellow: (Ci abbiamo messo tutta una serata in due a fare quell' HUD schifido...)

     

    a parte tutto, abbiamo pensato ad un ulteriore modo per utilizzare gli Animus fuori dalla battaglia.

    Signori e signore:

     

    IL PENSATORIUM

    Il Pensatorium è un luogo accessibile solo dagli Animus.

    All' interno del palazzo della Gilda troveremo infatti uno speciale dispositivo in cui poter inserire fino a 4 Animæ.

    Una volta inseriti, gli Animus corrispondenti inizieranno a condividere tra di loro le loro esperienze e ad inventare

    ricette per armi, oggetti e quant'altro.

    Il tempo in cui gli Animus possono rimanere nel Pensatorium è limitato e tutte le ricette che inventeranno in quel

    tempo verranno trascritte su pergamene che potremo utilizzare in qualunque momento, a patto di avere gli ingredienti

    necessari.

    Ovviamente, diversi Animus creeranno ricette diverse, spingendoci a provare tutte le connessioni possibili.

    Utilizzare il Pensatorium avrà tuttavia un costo in cristalli.

     

    Ad esempio:

    Inseriamo nel Pensatorium Harpyne e Sundance.

    Harpyne ha un inclinazione a creare Accessori e Arnesi, ed ha un affinità all'aria mentre Sundance crea Munizioni e cappelli ed ha un affinità al fuoco.

    Durante il tempo in cui sono insieme nel Pensatorium potranno quindi creare, ad esempio, la ricetta per delle munizioni che aggiungono danno da vento, o che stordiscono (nel gioco la Paralisi è relativa principalmente alle abilità di tipo Vento), o per un cappello che impedisce di eesere storditi, o ancora la ricetta un coltello da lancio che infligge danni da fuoco.

    Tutto giocherà su delle variabili ed ovviamente Animus di livello superiore creeranno oggetti di utilità superiore.

    Anche il costo in cristalli dipenderà dal livello degli Animus e dal loro numero, rendendo più costose le combinazioni migliori.

     

    L'idea l'abbiamo "rubata" a quel capolavoro che fu Star Ocean: The Last Hope, se l'avete mai giocato...

  6. Uhm...

    L'idea era di fare un interfaccia "leggera" ma forse in effetti abbiamo esagerato.

    Vedremo se troviamo qualcosa di meglio.

    Per la questione contorno però il problema è sempre quello...

    Con i caratteri giochiamo dagli 8 agli 11 pixel tutto tirato, e contornarli un pixel tutto intorno li rende troppo carichi, specie numeri con i buchi come l' otto...

    Suggerimenti?

  7. Si, in effetti non saranno veri e propri enigmi quelli degli Animus.

    In compenso, senza spoilerare come fa qualcuno ( :sleep: ) vi dico solo che Nomore ha tirato su una roba con delle

    candele e delle leve che stavo sbroccando io a farlo quando me l'ha passato.

    Poi, sono andato a vedere gli eventi. ._.

     

     

    EDIT: NUOVO CONCEPT HUD.

    http://img4.imageshack.us/img4/8708/immagineuyh.jpg

    Alcune cose sono ancora da modificare come il fatto che dobbiamo capire come far passare il face "davanti" alla pergamena. E si, il ragno dovrebbe essere più in alto.

    Per il resto come vi sembra?

  8. Beh, dargli una buona grafica effettivamente è una fatica per tutti e due, che cerchiamo di capire come funziona Gimp, intanto capire come funziona la grafica, nel frattempo cercare di fare qualcosa di bello...

    Ruba un sacco di tempo, ma d'altronde sapevamo che sarebbe stato quello a rallentarci parecchio...

     

     

    Ed in effetti ha ragione Flame... Font troppo elaborati danno più fastidio che stile..

  9. siccome ho visto che Lupius si è preso la briga di "smontare" la megaDemo di Moghunter per postare singolarmante gli script e siccome ne utilizzo uno nel mio progetto ho pensato di dargli una mano, postando per lui lo script relativo al Battle Hud.

     

    Quindi ecco a voi:

     

    MOGHUNTER ADVANCED BATTLE HUD

    Descrizione

    Questo script modifica l' Hud di battaglia, aggiungendo la possibilità di inserire un volto ai personaggi, che "reagirà" durante gli scontri, come quando attacchiamo o veniamo attaccati ed un cursore che indica i nemici attualmente selezionati.

     

    Autore

    MOGHUNTER

    Allegati

    Saranno necessarie quattro immagini, da inserire nella cartella Graphic/System.

    Eccoli qui:

    http://img834.imageshack.us/img834/1926/battlecursor.png

    Questo andrà nominato Battle_Cursor. Indicherà i nemici attualmente selezionati.

    http://img266.imageshack.us/img266/3579/battlehudlayout.png

    Quest' altro andrà nominato Battle_Hud_Layout. Sarà L'Hud vero e proprio. Nel quadrato verranno inserite le icone relative agli stati.

    http://img545.imageshack.us/img545/2403/battlehudnumber.png

    Questo andrà nominato Battle_Hud_Number. Saranno i numeri posti sulla barra dell' Hud ed indicherà il valore numerico di HP, MP e HP.

    http://img15.imageshack.us/img15/4633/battlehudmeter.png

    Infine questo andrà nominato Battle_Hud_Meter. Sarà il gradiente che riempe le tre barre dell' Hud.

     

    Istruzioni per l'uso

    Per inserire i face dei personaggi, dovrete creare un immagine che riproduce il face del personaggio per 5 volte. Non sono importanti le dimensioni (lo script ritaglierà automaticamente le 5 immagini) ma devono avere tutte la stessa immagine.

    Le immagini rappresenteraano nell' ordine:

    PG Normale

    PG Curato (o Buff positivi)

    PG Attacco

    PG Colpito

    PG Morto

    NB. I Faceset così creati dovranno essere importati nella cartella Graphic/Battler e andrà nominato con il nome del PG in questione. (Attenzione: è Case Sensitive)

    Esempi:

    http://img22.imageshack.us/img22/8879/evalg.png

    Questo Faceset è inserito nella Demo da MogHunter stesso.

    http://img594.imageshack.us/img594/8185/sonyav.png

    Questo invece, l'ho creato appositamente per il mio progetto. Per quanto di dimensioni diverse, si adatta perfettamente allo script.

     

    Script

     

    if false# Set true to enable the script
      
    #==============================================================================
    # ■ +++ MOG - Master HUD (v1.3) +++
    #==============================================================================
    # By Moghunter
    # http://www.atelier-rgss.com
    #==============================================================================
    # - Sistema de hud baseado em imagens que possui todas as carácteristicas
    #   básicas necessárias em um projeto.
    #==============================================================================
    # CUSTOMIZAÇÃO
    #
    # - Basta criar as imagens de sua hud em um editor de imagem e após 
    # isso configure a posição das imagens no editor de script.
    #==============================================================================
    # Para ativar ou desativar a HUD use o comando abaixo.
    #
    # $game_system.hud_visible = true
    #
    #==============================================================================
    # ● Histórico (Version History)
    #==============================================================================
    # v 1.3 - Melhoria no sistema de dispose de imagens.
    #==============================================================================
    module MOG_HUD
      #Posição geral da HUD
      HUD = [0,330]
      #Posição do Medidor de HP
      HP_METER = [105,14]
      #Posição do numero de HP
      HP_NUMBER = [110,14]
      #Posição do Medidor de MP
      MP_METER = [65,33] 
      #Posição do numero de MP
      MP_NUMBER = [70,33] 
      #Posição do medidor de EXP 
      EXP_METER = [37,55]
      #Posição do Level.
      EXP_NUMBER = [45,9]
      #Posição do layout.
      LAYOUT = [5,10]
      #Posição da face.
      FACE = [5,-15]
      #Posição das condições.
      STATES = [340,50]
      #Prioridade da hud na tela.
      HUD_Z = 105
    end
    
    #==============================================================================
    # ■ Game_Temp
    #==============================================================================
    class Game_System
    
      attr_accessor :hud_visible  
    
      #--------------------------------------------------------------------------
      # ● Initialize
      #--------------------------------------------------------------------------        
      alias active_hud_initialize initialize
      def initialize
          active_hud_initialize
          @hud_visible = false
      end  
    end
    
    #==============================================================================
    # ■ Game_Actor
    #==============================================================================
    class Game_Actor < Game_Battler
      #--------------------------------------------------------------------------
      # ● now_exp
      #--------------------------------------------------------------------------      
      def now_exp
          return current_level_exp
      end
      #--------------------------------------------------------------------------
      # ● next_exp
      #--------------------------------------------------------------------------          
      def next_exp
        return next_level_exp
      end
    end
    
    #===============================================================================
    # ■ RPG_FileTest 
    #===============================================================================
    module RPG_FileTest
      
      #--------------------------------------------------------------------------
      # ● RPG_FileTest.system_exist?
      #--------------------------------------------------------------------------
      def RPG_FileTest.system_exist?(filename)
          return Cache.system(filename) rescue return false
      end  
      
    end
    
    #==============================================================================
    # ■ Hud
    #==============================================================================
    class Hud 
      include MOG_HUD
      
      #--------------------------------------------------------------------------
      # ● Initialize
      #--------------------------------------------------------------------------
      def initialize
          @actor = $game_party.members[0]
          dispose
          return if @actor == nil
          @pre_leader_id = $game_party.members[0].id
          create_layout
          create_face
          create_state
          create_hp   
          create_mp    
          create_level
          update_visible    
      end
      
      #--------------------------------------------------------------------------
      # ●  refresh_actor
      #--------------------------------------------------------------------------  
      def refresh_actor
          dispose
          initialize
      end
      
      #--------------------------------------------------------------------------
      # ●  create_layout
      #--------------------------------------------------------------------------   
      def create_layout
          @layout_sprite = Sprite.new
          @layout_sprite.bitmap = Cache.system("Hud_Layout")
          @layout_sprite.z = HUD_Z
          @layout_sprite.x = HUD[0] + LAYOUT[0]
          @layout_sprite.y = HUD[1] + LAYOUT[1]   
      end
      
      #--------------------------------------------------------------------------
      # ● create_face
      #--------------------------------------------------------------------------      
      def create_face    
          image_name = "Hud_Face" + @actor.id.to_s
          unless RPG_FileTest.system_exist?(image_name)
             image_name = ""
          end  
          @face_image = Cache.system(image_name)
          @face_sprite = Sprite.new
          @face_sprite.bitmap = Bitmap.new(@face_image.width,@face_image.height)
          @face_cw = @face_image.width
          @face_ch = @face_image.height 
          @face_src_rect_back = Rect.new(0, 0,@face_cw , @face_ch)
          @face_sprite.bitmap.blt(0,0, @face_image, @face_src_rect_back)      
          @face_sprite.z = 1 + HUD_Z
          @face_sprite.x = HUD[0] + FACE[0]
          @face_sprite.y = HUD[1] + FACE[1]        
      end
      
      #--------------------------------------------------------------------------
      # ● create_state
      #--------------------------------------------------------------------------    
      def create_state
          @states_max = 0
          @states = Sprite.new 
          @states.bitmap = Bitmap.new(72,24)
          @states_x = -1
          @states_y = 0
          @states_f = false
          @states_max = 0
          @states.x = HUD[0] + STATES[0]
          @states.y = @states_y + HUD[1] + STATES[1]
          @states.z = 3 + HUD_Z
          states_refresh
      end
      
      #--------------------------------------------------------------------------
      # ●  create_hp 
      #--------------------------------------------------------------------------  
      def create_hp 
          @hp = @actor.hp
          @hp_old = @actor.hp
          @hp_ref = @hp_old
          @hp_refresh = false
          #Number SP ----
          @hp_number_image = Cache.system("Hud_HP_Number")
          @hp_number_sprite = Sprite.new
          @hp_number_sprite.bitmap = Bitmap.new(@hp_number_image.width,@hp_number_image.height)
          @hp_number_sprite.z = 153
          @hp_number_sprite.x = HUD[0] + HP_NUMBER[0]
          @hp_number_sprite.y = HUD[1] + HP_NUMBER[1]
          @im_cw = @hp_number_image.width / 10
          @im_ch = @hp_number_image.height   
          #Meter HP -----
          @hp_image = Cache.system("Hud_HP_Meter")
          @hp_range = @hp_image.width 
          @hp_height = @hp_image.height 
          @hp_width = @hp_range  * @actor.hp / @actor.mhp 
          @hp_width_old = @hp_width    
          @hp_sprite = Sprite.new
          @hp_sprite.bitmap = Bitmap.new(@hp_image.width,@hp_image.height)
          @hp_sprite.z = 2 + HUD_Z
          @hp_sprite.x = HUD[0] + HP_METER[0]
          @hp_sprite.y = HUD[1] + HP_METER[1]
          hp_flow_update
          hp_number_refresh    
      end
      
      #--------------------------------------------------------------------------
      # ●  create_mp
      #--------------------------------------------------------------------------  
      def create_mp
          @sp = @actor.mp
          @sp_old = @actor.mp
          @sp_ref = @sp_old 
          @sp_refresh = false 
          #Number SP -----
          @sp_number_image = Cache.system("Hud_MP_Number")
          @sp_number_sprite = Sprite.new
          @sp_number_sprite.bitmap = Bitmap.new(@sp_number_image.width,@sp_number_image.height)
          @sp_number_sprite.z = 153
          @sp_number_sprite.x = HUD[0] + MP_NUMBER[0]
          @sp_number_sprite.y = HUD[1] + MP_NUMBER[1]
          @sp_im_cw = @sp_number_image.width / 10
          @sp_im_ch = @sp_number_image.height  
          #Meter SP -----
          @sp_image = Cache.system("Hud_MP_Meter")
          @sp_range = @sp_image.width
          @sp_height = @sp_image.height
          @sp_width = @sp_range  * @actor.mp / @actor.mmp        
          @sp_width_old = @sp_width
          @sp_sprite = Sprite.new
          @sp_sprite.bitmap = Bitmap.new(@sp_image.width,@sp_image.height)
          @sp_sprite.z = 2 + HUD_Z
          @sp_sprite.x = HUD[0] + MP_METER[0]
          @sp_sprite.y = HUD[1] + MP_METER[1]
          mp_flow_update
          mp_number_refresh      
      end  
        
      #--------------------------------------------------------------------------
      # ● create_level
      #--------------------------------------------------------------------------
       def create_level
           @level = @actor.level 
           @exp = @actor.exp
           @level_image = Cache.system("Hud_Exp_Meter")
           @level_sprite = Sprite.new   
           @level_sprite.bitmap = Bitmap.new(@level_image.width,@level_image.height)       
           if @actor.next_exp != 0
              rate = @actor.now_exp.to_f / @actor.next_exp
           else
              rate = 1
           end
           if @actor.level < 99
              @level_cw = @level_image.width * rate 
           else
              @level_cw = @level_image.width
           end       
           @level_src_rect_back = Rect.new(0, 0,@level_cw, @level_image.height)
           @level_sprite.bitmap.blt(0,0, @level_image, @level_src_rect_back)      
           @level_sprite.z = 2 + HUD_Z
           @level_sprite.x = HUD[0] + EXP_METER[0]
           @level_sprite.y = HUD[1] + EXP_METER[1]   
           # Level Number -----
           @level_number_image = Cache.system("Hud_Exp_Number")
           @level_number_sprite = Sprite.new
           @level_number_sprite.bitmap = Bitmap.new(@level_number_image.width,@level_number_image.height)
           @level_number_sprite.z = HUD_Z + 3
           @level_number_sprite.y = HUD[1] + EXP_NUMBER[1]
           @level_im_cw = @level_number_image.width / 10
           @level_im_ch = @level_number_image.height
           level_update
      end  
         
      #--------------------------------------------------------------------------
      # ●  Dispose
      #--------------------------------------------------------------------------
      def dispose
          return if @layout_sprite == nil
          #Hp Number Dispose
          @hp_number_sprite.bitmap.dispose
          @hp_number_sprite.dispose
          #HP Meter Dispose
          @hp_sprite.bitmap.dispose
          @hp_sprite.dispose
          #MP Number Dispose
          @sp_number_sprite.bitmap.dispose
          @sp_number_sprite.dispose
          #MP Meter Dispose
          @sp_sprite.bitmap.dispose
          @sp_sprite.dispose
          #States Dispose
          @states.bitmap.dispose
          @states.dispose
          #Level Meter Dispose
          @level_sprite.bitmap.dispose
          @level_sprite.dispose
          #Level Number Dispose
          @level_number_sprite.bitmap.dispose
          @level_number_sprite.dispose
          #Layout Dispose
          @layout_sprite.bitmap.dispose
          @layout_sprite.dispose
          @layout_sprite = nil
          #Face Dispose
          @face_sprite.bitmap.dispose
          @face_sprite.dispose
          #Dispose Images
          @hp_number_image.dispose
          @hp_image.dispose
          @sp_number_image.dispose
          @sp_image.dispose
          @level_image.dispose
          @level_number_image.dispose
          @face_image.dispose    
      end
      #--------------------------------------------------------------------------
      # ● Update Visible
      #--------------------------------------------------------------------------
      def update_visible
          #Visible
          if $game_message.visible or $game_system.hud_visible == false
             vis = false
          else
             vis = true
          end  
          @hp_number_sprite.visible = vis
          @hp_sprite.visible = vis
          @sp_number_sprite.visible = vis
          @sp_sprite.visible = vis
          @states.visible = vis
          @level_sprite.visible = vis
          @level_number_sprite.visible = vis
          @layout_sprite.visible = vis
          @face_sprite.visible = vis   
      end
      
      #--------------------------------------------------------------------------
      # ● Update
      #--------------------------------------------------------------------------
      def update
          if @actor == nil
             refresh_actor if $game_party.members[0] != nil
             return 
          end  
          update_visible
          hp_number_update if @hp_old != @actor.hp
          hp_number_refresh if @hp_refresh or @actor.hp == 0 
          mp_number_update if @sp_old != @actor.mp
          mp_number_refresh if @sp_refresh
          level_update if @level != @actor.level
          exp_update if @exp != @actor.exp
          states_refresh
          hp_flow_update
          mp_flow_update
          refresh_actor if can_refresh_hud?      
       end
       
      #--------------------------------------------------------------------------
      # ● States Refresh
      #--------------------------------------------------------------------------
      def states_refresh
          return if @states_x == @actor.states.size
          @states_x = @actor.states.size
          @states.bitmap.clear
          return if @actor.states.size  == 0
          @states_max = 0
          for i in @actor.states
              unless @states_max > 3
                     icon = Cache.system("Iconset")
                     icon_index = i.icon_index
                     rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
                     @states.bitmap.blt(24 * @states_max, 0, icon, rect)
                     @states_max += 1 
                     icon.dispose
               end
          end  
      end
       
      #--------------------------------------------------------------------------
      # ● hp_number_update
      #--------------------------------------------------------------------------
      def hp_number_update 
           @hp_refresh = true
           if @hp_old < @actor.hp
               @hp_ref = 5 * (@actor.hp - @hp_old) / 100
               @hp_ref = 1 if @hp_ref < 1
               @hp += @hp_ref     
               if @hp >= @actor.hp
                  @hp_old = @actor.hp 
                  @hp = @actor.hp   
                  @hp_ref = 0
               end              
            elsif @hp_old > @actor.hp   
               @hp_refresh = true
               @hp_ref = 5 * (@hp_old - @actor.hp) / 100
               @hp_ref = 1 if @hp_ref < 1 
               @hp -= @hp_ref                
               if @hp <= @actor.hp
                  @hp_old = @actor.hp 
                  @hp = @actor.hp   
                  @hp_ref = 0
               end            
            end  
      end  
          
      #--------------------------------------------------------------------------
      # ● hp_number_refresh
      #--------------------------------------------------------------------------
      def hp_number_refresh 
          @hp_number_sprite.bitmap.clear
          @hp_number_text = @hp.abs.to_s.split(//)
          for r in 0..@hp_number_text.size - 1         
             @hp_number_abs = @hp_number_text[r].to_i 
             @hp_src_rect = Rect.new(@im_cw * @hp_number_abs, 0, @im_cw, @im_ch)
             @hp_number_sprite.bitmap.blt(@im_cw *  r, 0, @hp_number_image, @hp_src_rect)        
          end  
          @hp_refresh = false if @hp == @actor.hp
      end 
         
      #--------------------------------------------------------------------------
      # ● Hp Flow Update
      #--------------------------------------------------------------------------
      def hp_flow_update
          @hp_sprite.bitmap.clear
          @hp_width = @hp_range  * @actor.hp / @actor.mhp  
              #HP Damage---------------------------------
              if @hp_width_old != @hp_width
              valor = (@hp_width_old - @hp_width) * 3 / 100
              valor = 0.5 if valor < 1                                
              @hp_width_old -= valor if @hp_width_old > @hp_width  
              if @hp_width_old < @hp_width 
                 @hp_width_old = @hp_width
              end      
              @hp_src_rect_old = Rect.new(0, 0,@hp_width_old, @hp_height)
              @hp_sprite.bitmap.blt(0,0, @hp_image, @hp_src_rect_old)       
              end        
          #HP Real------------------------------------
          @hp_src_rect = Rect.new(0, 0,@hp_width, @hp_height)
          @hp_sprite.bitmap.blt(0,0, @hp_image, @hp_src_rect)          
      end
        
      #--------------------------------------------------------------------------
      # ● Mp_number_update
      #--------------------------------------------------------------------------
      def mp_number_update
        @sp_refresh = true
        if @sp_old < @actor.mp
           @sp_refresh = true
           @sp_ref = 5 * (@actor.mp - @sp_old) / 100
           @sp_ref = 1 if @sp_ref < 1
           @sp += @sp_ref  
           if @sp >= @actor.mp
              @sp_old = @actor.mp 
              @sp = @actor.mp   
              @sp_ref = 0         
           end  
        elsif @sp_old >= @actor.mp    
           @sp_ref = 5 * (@sp_old - @actor.mp) / 100
           @sp_ref = 1 if @sp_ref < 1 
           @sp -= @sp_ref     
           if @sp <= @actor.mp
              @sp_old = @actor.mp 
              @sp = @actor.mp   
              @sp_ref = 0         
            end          
        end     
      end 
      
      #--------------------------------------------------------------------------
      # ● Mp_number_refresh
      #--------------------------------------------------------------------------
      def mp_number_refresh 
          @sp_number_sprite.bitmap.clear
          @s = @actor.mp * 100 / @actor.mmp
          @sp_number_text = @sp.abs.to_s.split(//)
          for r in 0..@sp_number_text.size - 1         
             @sp_number_abs = @sp_number_text[r].to_i 
             @sp_src_rect = Rect.new(@sp_im_cw * @sp_number_abs, 0, @sp_im_cw, @sp_im_ch)
             @sp_number_sprite.bitmap.blt(@sp_im_cw *  r, 0, @sp_number_image, @sp_src_rect)        
          end  
          @sp_refresh = false if @sp == @actor.mp
       end       
       
      #--------------------------------------------------------------------------
      # ● Mp Flow Update
      #--------------------------------------------------------------------------
      def mp_flow_update
          @sp_sprite.bitmap.clear
          @sp_width = @sp_range  * @actor.mp / @actor.mmp 
              #SP Damage---------------------------------
              if @sp_width_old != @sp_width
              valor = (@sp_width_old - @sp_width) * 3 / 100
              valor = 0.5 if valor < 1             
              @sp_width_old -= valor if @sp_width_old > @sp_width  
              if @sp_width_old < @sp_width 
                 @sp_width_old = @sp_width
              end      
              @sp_src_rect_old = Rect.new(0, 0,@sp_width_old, @sp_height)
              @sp_sprite.bitmap.blt(0,0, @sp_image, @sp_src_rect_old) 
              end
          #SP Real------------------------------------
          @sp_src_rect = Rect.new(0, 0,@sp_width, @sp_height)
          @sp_sprite.bitmap.blt(0,0, @sp_image, @sp_src_rect)
        end  
        
      #--------------------------------------------------------------------------
      # ● level_update
      #--------------------------------------------------------------------------
      def level_update      
          @level_number_sprite.bitmap.clear
          @level_number_text = @actor.level.abs.to_s.split(//)
          ex = 0
          for r in 0..@level_number_text.size - 1
             ex += 1
             @level_number_abs = @level_number_text[r].to_i 
             @level_src_rect = Rect.new(@level_im_cw * @level_number_abs, 0, @level_im_cw, @level_im_ch)
             @level_number_sprite.bitmap.blt(@level_im_cw *  r, 0, @level_number_image, @level_src_rect)        
          end       
          @level = @actor.level
          cx = ex * (@level_im_cw / 2)
          @level_number_sprite.x = HUD[0] + EXP_NUMBER[0] - cx
          hp_number_refresh 
          mp_number_refresh 
      end
      
      #--------------------------------------------------------------------------
      # ● exp_update
      #--------------------------------------------------------------------------
      def exp_update
          @level_sprite.bitmap.clear    
          if @actor.next_exp != 0
             rate = @actor.now_exp.to_f / @actor.next_exp
          else
             rate = 1
          end
          if @actor.level < 99
             @level_cw = @level_image.width * rate 
          else
             @level_cw = @level_image.width
          end       
          @level_src_rect_back = Rect.new(0, 0,@level_cw, @level_image.height)
          @level_sprite.bitmap.blt(0,0, @level_image, @level_src_rect_back)  
          @exp = @actor.exp
      end
        
      #--------------------------------------------------------------------------
      # ● Can Refresh Hud
      #--------------------------------------------------------------------------    
      def can_refresh_hud?
          if $game_party.members[0] == nil
             return true if @pre_leader_id != nil
          elsif $game_party.members[0] != nil   
             return true if @pre_leader_id == nil
             return true if @pre_leader_id != $game_party.members[0].id 
          end  
          return false
      end  
        
    end
    
    #==============================================================================
    # ■ Spriteset_Map
    #==============================================================================
    class Spriteset_Map
      
      #--------------------------------------------------------------------------
      # ● initialize  
      #--------------------------------------------------------------------------
      alias mog_hud_initialize initialize 
      def initialize  
          @hud = Hud.new
          mog_hud_initialize
      end
      
      #--------------------------------------------------------------------------
      # ● dispose
      #--------------------------------------------------------------------------
      alias mog_hud_dispose dispose
      def dispose    
          @hud.dispose
          mog_hud_dispose
      end
      
      #--------------------------------------------------------------------------
      # ● update   
      #--------------------------------------------------------------------------
      alias mog_hud_update update
      def update   
          @hud.update
          mog_hud_update
      end
    
    end   
    
    $mog_rgss3_master_hud = true
    
    end
    

     

     

    Bugs e Conflitti Noti

    N/A

    Logicamente non sarà compatibile con altri script che influenzano l' HUD

    Altri dettagli

    Ecco il risultato finale:

    http://img202.imageshack.us/img202/4219/immaginefpn.jpg

    La barra AT in basso fa parte di un ulteriore Add On.

  10. Salve a tutti!

    Stavo usando lo script di Moghunter per modificare l'HUD di battaglia.

    Per chi non lo conoscesse, è questo:

     

     

    #==============================================================================
    # +++ MOG - ADVANCED BATTLE HUD  (v1.6) +++
    #==============================================================================
    # By Moghunter 
    # http://www.atelier-rgss.com/
    #==============================================================================
    # Sistema de hud avançado de batalha.
    #==============================================================================
    
    #==============================================================================
    # ● Histórico (Version History)
    #==============================================================================
    # v 1.6 - Corrigido o erro quando o MP ou TP maximo é iguál a zero.
    # v 1.5 - Corrigido a animação da face quando uma skill tem a função charge.
    # v 1.4 - Corrigido o erro de crash randômico. (relativo a dispose de imagem.)
    # v 1.3 - Script 100% independente do sistema de AT System.
    #       - Correção da posição inicial da janela de Fuga.
    #       - Correção da posição do cursor nos aliados quando a face está
    #         desabilitada.
    # v 1.2 - Corrigido a prioridade das condições.
    # v 1.1 - Corrigido o glitch inicial da prioridade da face.
    # v 1.0 - Primeiro lançamento.
    #==============================================================================
    
    #==============================================================================
    # ■ - FACE ANIMADAS DOS PERSONAGENS - (Opcional)
    #==============================================================================
    # 1 - Grave as imagens das faces dos personagens na pasta.
    #
    # GRAPHICS/BATTLERS/
    #
    # 2 - Nomeie a imagem com o mesmo nome do personagem. (EG - Hertor.png)
    # 3 - A largura da imagem deverá ser dividido por 5. (A escolha do tamanho
    #     da face é livre desde que a lagura dividido pela altura seja igual a 5 )
    #
    #==============================================================================
    
    #==============================================================================
    # ■ BATTLE HUD SETTING
    #==============================================================================
    module MOG_BATTLE_HUD
      # Ativar Battlers dos personagens em faces, deixe desativado em caso de haver
      # outros scripts que usam battlers dos personagens em seu projeto.
      BATTLER_FACE_ENABLE = true
      #Definição geral da posição da HUD.
      HUD_POSITION = [5,315]
      #Definição da posição da face
      FACE_POSITION = [60,30]
      #Definição da posição do numero de HP.
      HP_NUMBER_POSITION = [85,28]
      #Definição da posição do medidor de HP.
      HP_METER_POSITION = [27,37]
      #Definição da posição do numero de MP.
      MP_NUMBER_POSITION = [101,46]
      #Definição da posição do medidor de MP.
      MP_METER_POSITION = [43,55]  
      #Definição da posição do numero de TP.
      TP_NUMBER_POSITION = [85,64]
      #Definição da posição do medidor de TP.
      TP_METER_POSITION = [27,73]   
      #Definição da posição das condições
      STATES_POSITION = [5,1]
      #Definição da posição do comando de batalha.
      COMMAND_POSITION = [0,-145]  
      #Definição da posição do espaço da HUD entre os membros do grupo.
      MEMBERS_SPACE = [136,0]
      #Definição da prioridade da HUD.
      BATTLE_HUD_Z = 50
      #Definição da velocidade de animação dos medidores.
      METER_FLOW_SPEED = 2
      #Ativa o layout mais limpo nas janelas de item e skill. 
      ITEM_SKILL_WINDOWS_CLEAN_STYLE = true
      #Definição da opacidade das janelas.
      ITEM_SKILL_WINDOW_OPACITY = 0
    end
    
    #==============================================================================
    # ■ CURSOR SETTING
    #==============================================================================
    module MOG_BATTLE_CURSOR
      #Definição da posição do cursor em relação ao alvo.
      CURSOR_POSITION = [-45, -16]
      #Definição da posição do nome do alvo.
      CURSOR_NAME_POSITION = [-10, 35]
      #Ativar efeito deslizar.
      CURSOR_SLIDE_EFFECT = true
      #Ativar animação de levitação.
      CURSOR_FLOAT_EFFECT = true  
    end  
    
    
    if MOG_BATTLE_HUD::BATTLER_FACE_ENABLE #BATTLER_FACE SYSTEM START
    #==============================================================================
    # ■ Game_Actor
    #==============================================================================
    class Game_Actor < Game_Battler
      
      attr_accessor :battler_face
      attr_accessor :screen_x
      attr_accessor :screen_y   
      
      #--------------------------------------------------------------------------
      # ● Initialize
      #--------------------------------------------------------------------------
      alias mog_battle_hud_initialize setup
      def setup(actor_id)
          mog_battle_hud_initialize(actor_id)
          battler_sprite_setup    
      end  
      
      #--------------------------------------------------------------------------
      # ● Battler Sprite Setup
      #--------------------------------------------------------------------------  
      def battler_sprite_setup
          @battler_face = [0,0,0]
          @battler_name = @name
          @screen_x = 0
          @screen_y = 0
      end
      
      #--------------------------------------------------------------------------
      # ● Use Sprite?
      #--------------------------------------------------------------------------
      def use_sprite?
          return true
      end
      
      #--------------------------------------------------------------------------
      # ● Screen Z
      #--------------------------------------------------------------------------
      def screen_z
          return MOG_BATTLE_HUD::BATTLE_HUD_Z + 4
      end  
    
      #------------------------------------------------------------------------
      # ● Screen X
      #------------------------------------------------------------------------        
      def screen_x 
          return FACE_POSITION[0] + HUD_POSITION[0] + (MEMBERS_SPACE[0] * index)
      end  
          
      #------------------------------------------------------------------------
      # ● Screen Y
      #------------------------------------------------------------------------       
      def screen_y
          return FACE_POSITION[1] + HUD_POSITION[1] + (MEMBERS_SPACE[1] * index)
      end     
      
    end
    
    #==============================================================================
    # ■ Sprite_Battler
    #==============================================================================
    class Sprite_Battler < Sprite_Base
      include MOG_BATTLE_HUD
      
      #--------------------------------------------------------------------------
      # ● Initialize
      #--------------------------------------------------------------------------  
       alias mog_battle_hud_initialize initialize
       def initialize(viewport, battler = nil)
           battle_hud_setup
           mog_battle_hud_initialize(viewport, battler)
       end
    
      #--------------------------------------------------------------------------
      # ● Battle Hud Setup
      #--------------------------------------------------------------------------     
       def battle_hud_setup
           @old_face_index = 0
       end
     
      #--------------------------------------------------------------------------
      # ● Dispose
      #--------------------------------------------------------------------------        
       alias mog_battle_hud_dispose dispose
       def dispose
           mog_battle_hud_dispose
           if @f_im != nil
              @f_im.dispose
           end
       end
       
      #--------------------------------------------------------------------------
      # ● Update Bitmap
      #--------------------------------------------------------------------------        
       alias mog_battle_hud_update_bitmap update_bitmap
       def update_bitmap
           if @battler.is_a?(Game_Actor)
              create_actor_battler
              update_actor_battler
              return 
           end 
           mog_battle_hud_update_bitmap
       end  
       
      #--------------------------------------------------------------------------
      # ● Create Actor Battler
      #--------------------------------------------------------------------------                
       def create_actor_battler  
           return if self.bitmap != nil
           @f_im = Cache.battler(@battler.battler_name, 0)
           @f_cw = @f_im.width / 5
           @f_ch = @f_im.height
           self.bitmap = Bitmap.new(@f_cw,@f_ch)
           x = FACE_POSITION[0] + HUD_POSITION[0] + (MEMBERS_SPACE[0] * @battler.index)
           y = FACE_POSITION[1] + HUD_POSITION[1] + (MEMBERS_SPACE[1] * @battler.index)
           @org_pos = [x,y]
           @battler.battler_face = [0,0,0]
           @battler_visible = true
           @low_hp = @battler.mhp * 30 / 100
           self.z = @battler.screen_z + 100
           make_face(true)
       end
       
      #--------------------------------------------------------------------------
      # ● Face Base Setting
      #--------------------------------------------------------------------------                 
      def face_base_setting 
          self.x = @org_pos[0]
          self.y = @org_pos[1]
          self.z = @battler.screen_z
          self.zoom_x = 1
          self.zoom_y = 1
          self.mirror = false   
      end
      
      #--------------------------------------------------------------------------
      # ● Check Base Face
      #--------------------------------------------------------------------------              
       def check_base_face(reset)
           face_base_setting
           return if @battler.battler_face[2] > 0 
           @battler.battler_face = [0,0,0] if reset and @battler.battler_face[1] != 2  
           @battler.battler_face[0] = 3 if @battler.hp < @low_hp
           @battler.battler_face[0] = 4 if @battler.hp == 0
       end  
       
      #--------------------------------------------------------------------------
      # ● Make Face
      #--------------------------------------------------------------------------              
       def make_face(reset = false)
           self.bitmap.clear
           check_base_face(reset)
           src_rect_back = Rect.new(@f_cw * @battler.battler_face[0], 0, @f_cw, @f_ch)
           self.bitmap.blt(0,0, @f_im, src_rect_back)
           @old_face_index = @battler.battler_face[0]    
       end  
    
      #--------------------------------------------------------------------------
      # ● Update Actor Battler
      #--------------------------------------------------------------------------           
       def update_actor_battler
           return if self.bitmap == nil
           update_face_effect
           update_face_reset_time
           update_face_z
           make_face if @old_face_index != @battler.battler_face[0]              
       end
         
      #--------------------------------------------------------------------------
      # ● Update Face Z
      #--------------------------------------------------------------------------              
      def update_face_z 
          self.z = @battler.screen_z + BATTLE_HUD_Z rescue 100
      end  
      
      #--------------------------------------------------------------------------
      # ● Update Face Reset Time 
      #--------------------------------------------------------------------------              
       def update_face_reset_time
           return if @battler.battler_face[2] == 0
           @battler.battler_face[2] -= 1
           if @battler.battler_face[2] == 0 or 
             (@battler.hp < @low_hp and @battler.battler_face[0] == 0)
              make_face(true) 
           end   
       end  
       
      #--------------------------------------------------------------------------
      # ● Update Face Effect
      #--------------------------------------------------------------------------                 
       def update_face_effect
           return if @battler.battler_face[2] == 0
           case @battler.battler_face[1]
              when 0
                 face_damage
              when 1..2
                 face_heal
              when 3
                 face_action
           end
       end  
       
      #--------------------------------------------------------------------------
      # ● Face Damage
      #--------------------------------------------------------------------------                    
       def face_damage
           self.x = (@org_pos[0] - (@battler.battler_face[2] /2)) + rand(@battler.battler_face[2])
       end  
       
      #--------------------------------------------------------------------------
      # ● Face Heal
      #--------------------------------------------------------------------------                    
       def face_heal
           case  @battler.battler_face[2]
             when 20..40
                 self.zoom_x += 0.01
                 self.zoom_y = self.zoom_x
             when 0..20
                 self.zoom_x -= 0.01
                 self.zoom_y = self.zoom_x       
           end
       end     
       
      #--------------------------------------------------------------------------
      # ● Face Action
      #--------------------------------------------------------------------------                    
       def face_action
           case  @battler.battler_face[2]
             when 25..50
                 self.zoom_x += 0.01 
                 self.zoom_y = self.zoom_x
                 self.mirror = true
             when 0..25
                 self.zoom_x -= 0.01
                 self.zoom_y = self.zoom_x
                 self.mirror = false
           end
           self.zoom_x = self.zoom_x > 1.5 ? self.zoom_x = 1.5 : self.zoom_x < 1 ? 1 : self.zoom_x
           self.zoom_y = self.zoom_y > 1.5 ? self.zoom_y = 1.5 : self.zoom_y < 1 ? 1 : self.zoom_y
       end
       
      #--------------------------------------------------------------------------
      # ● Update Position
      #--------------------------------------------------------------------------                       
       alias mog_battle_hud_update_position update_position
       def update_position
           return if @battle.is_a?(Game_Actor)
           mog_battle_hud_update_position
       end   
       
      #--------------------------------------------------------------------------
      # ● Update Collapse
      #--------------------------------------------------------------------------                          
       alias mog_battle_hud_update_collapse update_collapse
       def update_collapse
           return if @battler.is_a?(Game_Actor)
           mog_battle_hud_update_collapse
       end  
       
      #--------------------------------------------------------------------------
      # ● Update Instant Collapse
      #--------------------------------------------------------------------------                             
       alias mog_battle_hud_update_instant_collapse update_instant_collapse
       def update_instant_collapse
           return if @battler.is_a?(Game_Actor)
           mog_battle_hud_update_instant_collapse
       end  
       
     end
     
    #==============================================================================
    # ■ Battle Manager
    #==============================================================================
    class << BattleManager
      
      #--------------------------------------------------------------------------
      # ● Battle End
      #--------------------------------------------------------------------------                    
      alias mog_battle_hud_battle_process_victory process_victory
      def process_victory
          execute_face_effect    
          mog_battle_hud_battle_process_victory
      end
      
      #--------------------------------------------------------------------------
      # ● Prepare
      #--------------------------------------------------------------------------                  
      def execute_face_effect
          for i in $game_party.members
              if i.hp > 0
                 i.battler_face = [1,2,40]         
              end  
          end  
      end
      
    end
    
    #==============================================================================
    # ■ Game Action
    #==============================================================================
    class Scene_Battle < Scene_Base
      
      #--------------------------------------------------------------------------
      # ● Show Animations
      #--------------------------------------------------------------------------     
      alias mog_battle_hud_show_animation show_animation
      def show_animation(targets, animation_id)
         # execute_battle_cry(2, @subject.current_action.item.id, @subject)
          make_face_action_battle 
          mog_battle_hud_show_animation(targets, animation_id)
      end
      
      #--------------------------------------------------------------------------
      # ● Make Face Action
      #--------------------------------------------------------------------------                  
      def make_face_action_battle
          return if !@subject.is_a?(Game_Actor) 
          @subject.battler_face = [2,3,50]
      end    
      
    end  
    
    #==============================================================================
    # ■ Game Battler
    #==============================================================================
    class Game_Battler < Game_BattlerBase
      
      #--------------------------------------------------------------------------
      # ● Item Apply
      #--------------------------------------------------------------------------                
      alias mog_battle_hud_item_apply item_apply 
      def item_apply(user, item)
          old_hp = self.hp
          old_mp = self.mp
          mog_battle_hud_item_apply(user, item)
          check_face_effect(old_hp,old_mp) if can_check_face_effect?(old_hp,old_mp)
      end
      
      #--------------------------------------------------------------------------
      # ● Check Face Effect
      #--------------------------------------------------------------------------  
      def check_face_effect(old_hp,old_mp)
          if self.hp > old_hp or self.mp > old_mp
             self.battler_face = [1,1,40]
          elsif self.hp < old_hp
             self.battler_face = [3,0,40]
          end  
      end  
      
      #--------------------------------------------------------------------------
      # ● Added New State
      #--------------------------------------------------------------------------  
      alias mog_battle_hud_add_new_state add_new_state
      def add_new_state(state_id)
          mog_battle_hud_add_new_state(state_id)
          if self.is_a?(Game_Actor)
             self.battler_face = [1,1,40] if $data_states[state_id].note =~ /<Good State>/
             self.battler_face = [3,0,40] if $data_states[state_id].note =~ /<Bad State>/
          end   
      end    
      
      #--------------------------------------------------------------------------
      # ● Regenerate HP
      #--------------------------------------------------------------------------
      alias mog_battle_hud_regenerate_hp regenerate_hp
      def regenerate_hp
          old_hp = self.hp
          old_mp = self.mp    
          mog_battle_hud_regenerate_hp
          check_face_effect(old_hp,old_mp) if can_check_face_effect?(old_hp,old_mp)
      end
    
      #--------------------------------------------------------------------------
      # ● Regenerate MP
      #--------------------------------------------------------------------------
      alias mog_battle_hud_regenerate_mp regenerate_mp
      def regenerate_mp
          old_hp = self.hp
          old_mp = self.mp    
          mog_battle_hud_regenerate_mp
          check_face_effect(old_hp,old_mp) if can_check_face_effect?(old_hp,old_mp)
      end  
    
      #--------------------------------------------------------------------------
      # ● Can Check Face Effect
      #--------------------------------------------------------------------------                  
      def can_check_face_effect?(old_hp,old_mp)
          return false if self.is_a?(Game_Enemy)
          return true if old_hp != self.hp
          return true if old_mp != self.mp
          return false
      end    
      
    end
    
    #==============================================================================
    # ■ Scene_Battle
    #==============================================================================
    class Scene_Battle < Scene_Base
      
      #--------------------------------------------------------------------------
      # ● Invoke Counter Attack
      #--------------------------------------------------------------------------        
      alias mog_battle_hud_invoke_counter_attack invoke_counter_attack
      def invoke_counter_attack(target, item)
          mog_battle_hud_invoke_counter_attack(target, item)
          if target.is_a?(Game_Actor) and target.battler_face[0] != 2        
             target.battler_face = [2,3,50]
          end  
      end  
      
      #--------------------------------------------------------------------------
      # ● Invoke Magic Reflection
      #--------------------------------------------------------------------------        
      alias mog_battle_hud_invoke_magic_reflection invoke_magic_reflection
      def invoke_magic_reflection(target, item)
          mog_battle_hud_invoke_magic_reflection(target, item)
          if target.is_a?(Game_Actor) and target.battler_face[0] != 2        
             target.battler_face = [2,3,50]
          end  
      end    
      
    end
    
    end #BATTLER FACE SYSTEM END --------------------------------------------------
    
    #==============================================================================
    # ■ Battle_Hud
    #==============================================================================
    class Battle_Hud
      include MOG_BATTLE_HUD
      
      #--------------------------------------------------------------------------
      # ● Initialize
      #--------------------------------------------------------------------------    
      def initialize(actor)
          dispose
          @actor = actor
          @x = HUD_POSITION[0] + (MEMBERS_SPACE[0] * @actor.index)
          @y = HUD_POSITION[1] + (MEMBERS_SPACE[1] * @actor.index)
          pre_cache
          create_layout
          create_hp_number
          create_hp_meter
          create_mp_number
          create_mp_meter
          create_tp_number
          create_tp_meter
          create_states
      end
      
      #--------------------------------------------------------------------------
      # ● Pre Cache
      #--------------------------------------------------------------------------      
      def pre_cache
          @number = Cache.system("Battle_Hud_Number")
          @number_cw = @number.width / 10
          @number_ch = @number.height / 4
          @meter = Cache.system("Battle_Hud_Meter")
          @meter_cw = @meter.width / 3
          @meter_ch = @meter.height / 3
          @icon = Cache.system("Iconset")
      end
      
      #--------------------------------------------------------------------------
      # ● Create Layout
      #--------------------------------------------------------------------------      
      def create_layout
          @layout = Sprite.new
          @layout.bitmap = Cache.system("Battle_Hud_Layout")
          @layout.z = BATTLE_HUD_Z
          @layout.x = @x
          @layout.y = @y
      end
      
      #--------------------------------------------------------------------------
      # ● Create HP Number
      #--------------------------------------------------------------------------        
      def create_hp_number
          @hp = @actor.hp
          @hp_old = @actor.hp
          @hp_ref = @hp_old
          @hp_refresh = false
          @hp_number = Sprite.new
          @hp_number.bitmap = Bitmap.new((@number_cw * 6),@number_ch)
          @hp_number.z = BATTLE_HUD_Z + 2
          @hp_number.x = @x + HP_NUMBER_POSITION[0]
          @hp_number.y = @y + HP_NUMBER_POSITION[1]
          refresh_hp_number
      end
      
      #--------------------------------------------------------------------------
      # ● Create HP Meter
      #--------------------------------------------------------------------------      
      def create_hp_meter
          @hp_meter = Sprite.new
          @hp_meter.bitmap = Bitmap.new(@meter_cw,@meter_ch)
          @hp_meter.z =  BATTLE_HUD_Z + 1
          @hp_meter.x = @x + HP_METER_POSITION[0]
          @hp_meter.y = @y + HP_METER_POSITION[1] 
          @hp_flow = rand(@meter_cw * 2)
          @hp_width_old = @meter_cw * @actor.hp / @actor.mhp 
          hp_flow_update
      end  
      
      #--------------------------------------------------------------------------
      # ● Hp Flow Update
      #--------------------------------------------------------------------------
      def hp_flow_update
          @hp_meter.bitmap.clear
          hp_width = @meter_cw * @actor.hp / @actor.mhp
          #execute_damage_flow(hp_width)
          hp_src_rect = Rect.new(@hp_flow, 0,hp_width, @meter_ch)
          @hp_meter.bitmap.blt(0,0, @meter, hp_src_rect)
          @hp_flow += METER_FLOW_SPEED
          @hp_flow = 0 if @hp_flow >=  @meter_cw * 2      
      end
        
      #--------------------------------------------------------------------------
      # ● Execute Damage Flow
      #-------------------------------------------------------------------------- 
      def execute_damage_flow(hp_width)
         n = (@hp_width_old - hp_width).abs * 3 / 100
         damage_flow = [[n, 2].min,0.5].max
         @hp_width_old -= damage_flow         
         @hp_width_old = hp_width if @hp_width_old < hp_width 
         src_rect_old = Rect.new(@hp_flow, @meter_ch * 3,@hp_width_old, @meter_ch)
         @hp_meter.bitmap.blt(0,0, @meter, src_rect_old)       
      end  
     
      #--------------------------------------------------------------------------
      # ● Update HP Number
      #--------------------------------------------------------------------------      
      def update_hp_number
          @hp_refresh = true
          n =  2 * (@actor.hp - @hp_old).abs / 100
          hp_ref = [[n, 100].min,1].max
          if @hp_old < @actor.hp
              @hp += hp_ref     
              if @hp >= @actor.hp
                 @hp_old = @actor.hp 
                 @hp = @actor.hp   
                 @hp_ref = 0
              end              
            elsif @hp_old > @actor.hp   
               @hp -= hp_ref                
               if @hp <= @actor.hp
                  @hp_old = @actor.hp 
                  @hp = @actor.hp   
                  @hp_ref = 0
               end            
            end      
        
      end  
      
      #--------------------------------------------------------------------------
      # ● Refresh HP Number
      #--------------------------------------------------------------------------      
      def refresh_hp_number
          @hp_number.bitmap.clear
          number_value = @hp.abs.to_s.split(//)
          hp_color = @hp < @actor.mhp * 30 / 100 ? @number_ch : 0
          center_x = 0
          for r in 0..number_value.size - 1         
             number_value_abs = number_value[r].to_i 
             src_rect = Rect.new(@number_cw * number_value_abs, hp_color, @number_cw, @number_ch)
             @hp_number.bitmap.blt((@number_cw + 1) *  r, 0, @number, src_rect) 
             center_x += 1
          end
          @hp_number.x = @x + HP_NUMBER_POSITION[0] - (center_x * (@number_cw + 1))
          @hp_refresh = false if @hp == @actor.hp      
      end  
      
      #--------------------------------------------------------------------------
      # ● Create MP Number
      #--------------------------------------------------------------------------        
      def create_mp_number
          @mp = @actor.mp
          @mp_old = @actor.mp
          @mp_ref = @mp_old
          @mp_refresh = false
          @mp_number = Sprite.new
          @mp_number.bitmap = Bitmap.new((@number_cw * 6),@number_ch)
          @mp_number.z = BATTLE_HUD_Z + 2
          @mp_number.x = @x + MP_NUMBER_POSITION[0]
          @mp_number.y = @y + MP_NUMBER_POSITION[1]
          refresh_mp_number
      end
      
      #--------------------------------------------------------------------------
      # ● Create MP Meter
      #--------------------------------------------------------------------------      
      def create_mp_meter
          @mp_meter = Sprite.new
          @mp_meter.bitmap = Bitmap.new(@meter_cw,@meter_ch)
          @mp_meter.z =  BATTLE_HUD_Z + 1
          @mp_meter.x = @x + MP_METER_POSITION[0]
          @mp_meter.y = @y + MP_METER_POSITION[1] 
          @mp_flow = rand(@meter_cw * 2)
          @mp_width_old = @meter_cw * @actor.mp / @actor.mmp rescue 0
          mp_flow_update
      end  
      
      #--------------------------------------------------------------------------
      # ● Mp Flow Update
      #--------------------------------------------------------------------------
      def mp_flow_update
          return if @actor.mmp == 0
          @mp_meter.bitmap.clear
          mp_width = @meter_cw * @actor.mp / @actor.mmp rescue 0
          src_rect = Rect.new(@mp_flow, @meter_ch,mp_width, @meter_ch)
          @mp_meter.bitmap.blt(0,0, @meter, src_rect)
          @mp_flow += METER_FLOW_SPEED
          @mp_flow = 0 if @mp_flow >=  @meter_cw * 2      
        end
        
      #--------------------------------------------------------------------------
      # ● Update MP Number
      #--------------------------------------------------------------------------      
      def update_mp_number
          @mp_refresh = true
          n =  2 * (@actor.mp - @mp_old).abs / 100
          mp_ref = [[n, 100].min,1].max
          if @mp_old < @actor.mp
              @mp += mp_ref     
              if @mp >= @actor.mp
                 @mp_old = @actor.mp 
                 @mp = @actor.mp   
                 @mp_ref = 0
              end              
            elsif @mp_old > @actor.mp   
               @mp -= mp_ref                
               if @mp <= @actor.mp
                  @mp_old = @actor.mp 
                  @mp = @actor.mp   
                  @mp_ref = 0
               end            
            end          
      end  
      
      #--------------------------------------------------------------------------
      # ● Refresh MP Number
      #--------------------------------------------------------------------------      
      def refresh_mp_number
          @mp_number.bitmap.clear
          number_value = @mp.abs.to_s.split(//)
          center_x = 0
          for r in 0..number_value.size - 1         
             number_value_abs = number_value[r].to_i 
             src_rect = Rect.new(@number_cw * number_value_abs, @number_ch * 2, @number_cw, @number_ch)
             @mp_number.bitmap.blt((@number_cw + 1) *  r, 0, @number, src_rect) 
             center_x += 1
          end
          @mp_number.x = @x + MP_NUMBER_POSITION[0] - (center_x * (@number_cw + 1))
          @mp_refresh = false if @mp == @actor.mp      
      end  
      
      #--------------------------------------------------------------------------
      # ● Create TP Number
      #--------------------------------------------------------------------------        
      def create_tp_number
          @tp = @actor.tp
          @tp_old = @actor.tp
          @tp_ref = @tp_old
          @tp_refresh = false
          @tp_number = Sprite.new
          @tp_number.bitmap = Bitmap.new((@number_cw * 6),@number_ch)
          @tp_number.z = BATTLE_HUD_Z + 2
          @tp_number.x = @x + TP_NUMBER_POSITION[0]
          @tp_number.y = @y + TP_NUMBER_POSITION[1]
          refresh_tp_number
      end
      
      #--------------------------------------------------------------------------
      # ● Create TP Meter
      #--------------------------------------------------------------------------      
      def create_tp_meter
          @tp_meter = Sprite.new
          @tp_meter.bitmap = Bitmap.new(@meter_cw,@meter_ch)
          @tp_meter.z =  BATTLE_HUD_Z + 1
          @tp_meter.x = @x + TP_METER_POSITION[0]
          @tp_meter.y = @y + TP_METER_POSITION[1] 
          @tp_flow = rand(@meter_cw * 2)
          @tp_width_old = @meter_cw * @actor.tp / @actor.max_tp rescue 0 
          tp_flow_update
      end  
      
      #--------------------------------------------------------------------------
      # ● TP Flow Update
      #--------------------------------------------------------------------------
      def tp_flow_update
          return if @actor.max_tp == 0
          @tp_meter.bitmap.clear
          tp_width = @meter_cw * @actor.tp / @actor.max_tp rescue 0
          src_rect = Rect.new(@tp_flow, @meter_ch * 2,tp_width, @meter_ch)
          @tp_meter.bitmap.blt(0,0, @meter, src_rect)
          @tp_flow += METER_FLOW_SPEED
          @tp_flow = 0 if @tp_flow >=  @meter_cw * 2      
      end
        
      #--------------------------------------------------------------------------
      # ● Update TP Number
      #--------------------------------------------------------------------------      
      def update_tp_number
          @tp_refresh = true
          n =  2 * (@actor.tp - @tp_old).abs / 100
          tp_ref = [[n, 100].min,1].max
          if @tp_old < @actor.tp
              @tp += tp_ref     
              if @tp >= @actor.tp
                 @tp_old = @actor.tp 
                 @tp = @actor.tp   
                 @tp_ref = 0
              end              
            elsif @tp_old > @actor.tp   
               @tp -= tp_ref                
               if @tp <= @actor.tp
                  @tp_old = @actor.tp 
                  @tp = @actor.tp   
                  @tp_ref = 0
               end           
             end            
      end      
        
      #--------------------------------------------------------------------------
      # ● Refresh TP Number
      #--------------------------------------------------------------------------      
      def refresh_tp_number
          @tp_number.bitmap.clear
          number_value = @tp.truncate.to_s.split(//)
          center_x = 0
          for r in 0..number_value.size - 1        
             number_value_abs = number_value[r].to_i 
             src_rect = Rect.new(@number_cw * number_value_abs, @number_ch * 3, @number_cw, @number_ch)
             @tp_number.bitmap.blt((@number_cw + 1) *  r, 0, @number, src_rect) 
             center_x += 1
          end
          @tp_number.x = @x + TP_NUMBER_POSITION[0] - (center_x * (@number_cw + 1))
          @tp_refresh = false if @tp == @actor.tp
      end    
      
      #--------------------------------------------------------------------------
      # ● Create_States
      #--------------------------------------------------------------------------      
      def create_states
          refresh_states
          @status = Sprite.new
          @status.bitmap = Bitmap.new(24,24)
          @status.x = @x + STATES_POSITION[0]
          @status.y = @y + STATES_POSITION[1]      
          @status_flow = -24
          @states_speed = 50
          @status.z = BATTLE_HUD_Z + 2
          @old_states = @actor.states
          flow_states
      end  
      
      #--------------------------------------------------------------------------
      # ● Flow_Status
      #--------------------------------------------------------------------------          
      def flow_states
          return if @actor.states.size == 0 and !@status.visible
          @states_speed = 0
          @status.bitmap.clear
          src_rect = Rect.new(@status_flow,0, 24,24)
          @status.bitmap.blt(0,0, @actor_status, src_rect)
          @status.visible = @actor.states.size == 0 ? false : true
          @status_flow += 1
          @status_flow = -24 if @status_flow >= @states_size - 24
      end    
      
      #--------------------------------------------------------------------------
      # ● Refresh States
      #--------------------------------------------------------------------------        
      def refresh_states
          refresh_icon if @icon == nil or @icon.disposed?
          @old_states = @actor.states
          if @actor_status != nil
             @actor_status.dispose
             @actor_status = nil
          end
          @states_size = @actor.states.size > 0 ? (48 * @actor.states.size) : 24 
          @actor_status = Bitmap.new(@states_size,24)
          index = 0
          for i in  @actor.states
             rect = Rect.new(i.icon_index % 16 * 24, i.icon_index / 16 * 24, 24, 24)
             @actor_status.blt(48 * index , 0, @icon, rect)
             index += 1
          end
      end  
      
      #--------------------------------------------------------------------------
      # ● Refresh Icon
      #--------------------------------------------------------------------------      
      def refresh_icon      
          if @icon != nil
             if !@icon.disposed?
                 @icon.dispose
             end
             @icon = nil
          end  
          @icon = Cache.system("Iconset")
      end
      
      #--------------------------------------------------------------------------
      # ● Dispose
      #--------------------------------------------------------------------------    
      def dispose
          return if @meter == nil
          @meter.dispose
          @meter = nil
          @number.dispose
          if @icon != nil
             if !@icon.disposed?
                 @icon.dispose
             end
             @icon = nil
          end     
          @layout.bitmap.dispose
          @layout.dispose
          @hp_number.bitmap.dispose
          @hp_number.dispose
          @hp_meter.bitmap.dispose
          @hp_meter.dispose
          @mp_number.bitmap.dispose
          @mp_number.dispose
          @mp_meter.bitmap.dispose
          @mp_meter.dispose      
          @tp_number.bitmap.dispose
          @tp_number.dispose
          @tp_meter.bitmap.dispose
          @tp_meter.dispose
          @status.bitmap.dispose
          @status.dispose
          if @actor_status != nil
             @actor_status.dispose
             @actor_status = nil
          end        
      end
      
      #--------------------------------------------------------------------------
      # ● Update
      #--------------------------------------------------------------------------    
      def update
          return if @meter == nil
          update_hp_number if @hp_old != @actor.hp
          refresh_hp_number if @hp_refresh
          update_mp_number if @mp_old != @actor.mp
          refresh_mp_number if @mp_refresh
          update_tp_number if @tp_old != @actor.tp
          refresh_tp_number if @tp_refresh
          refresh_states if @old_states != @actor.states
          hp_flow_update
          tp_flow_update
          mp_flow_update
          flow_states
      end
      
    end
    
    #==============================================================================
    # ■ Spriteset Battle
    #==============================================================================
    class Spriteset_Battle
      
      #--------------------------------------------------------------------------
      # ● Initialize
      #--------------------------------------------------------------------------  
      alias mog_battle_hud_initialize initialize
      def initialize
          mog_battle_hud_initialize
          create_battle_hud      
      end
      
      #--------------------------------------------------------------------------
      # ● Create Battle Hud
      #--------------------------------------------------------------------------    
      def create_battle_hud
          dispose_battle_hud
          @battle_hud = []      
          for i in $game_party.members
              @battle_hud.push(Battle_Hud.new(i))
          end
      end
      
      #--------------------------------------------------------------------------
      # ● Dispose
      #--------------------------------------------------------------------------      
      alias mog_battle_hud_dispose dispose
      def dispose
          mog_battle_hud_dispose
          dispose_battle_hud
      end  
      
      #--------------------------------------------------------------------------
      # ● Dispose Battle Hud
      #--------------------------------------------------------------------------        
      def dispose_battle_hud
          return if @battle_hud == nil
          @battle_hud.each {|sprite| sprite.dispose }
          @battle_hud.clear
          @battle_hud = nil
      end
      
      #--------------------------------------------------------------------------
      # ● Update
      #--------------------------------------------------------------------------        
      alias mog_battle_hud_update update
      def update
          mog_battle_hud_update
          update_battle_hud
      end
      
      #--------------------------------------------------------------------------
      # ● Update Battle Hud
      #--------------------------------------------------------------------------          
      def update_battle_hud
          return if @battle_hud == nil
          @battle_hud.each {|sprite| sprite.update }
      end
        
    end
    
    #==============================================================================
    # ■ Game_Actor
    #==============================================================================
    class Game_Actor < Game_Battler
      include MOG_BATTLE_HUD
       
       attr_accessor :hud_x
       attr_accessor :hud_y
    
      #--------------------------------------------------------------------------
      # ● HUD X
      #--------------------------------------------------------------------------     
      def hud_x
          return HUD_POSITION[0] + (MEMBERS_SPACE[0] * index)
      end
      
      #--------------------------------------------------------------------------
      # ● HUD Y
      #--------------------------------------------------------------------------    
      def hud_y
          return HUD_POSITION[1] + (MEMBERS_SPACE[1] * index)
      end  
      
    end  
    
    #==============================================================================
    # ■ Scene Battle
    #==============================================================================
    class Scene_Battle < Scene_Base
      
      #--------------------------------------------------------------------------
      # ● Create Party Command Window
      #--------------------------------------------------------------------------    
      alias mog_battle_hud_create_party_command_window create_party_command_window
      def create_party_command_window
          mog_battle_hud_create_party_command_window
          set_party_window_position 
      end  
      
      #--------------------------------------------------------------------------
      # ● Set Party Window Position
      #--------------------------------------------------------------------------      
      def set_party_window_position
          @party_command_window.viewport = nil  
          return if $mog_rgss3_at_system != nil
          a_index = []
          for actor in $game_party.alive_members
              a_index = [actor.hud_x, actor.hud_y]
              break
          end
          return if a_index.empty? 
          @party_command_window.x = MOG_BATTLE_HUD::COMMAND_POSITION[0] + a_index[0]
          @party_command_window.y = MOG_BATTLE_HUD::COMMAND_POSITION[1] + a_index[1]      
      end  
      
      #--------------------------------------------------------------------------
      # ● Set Party Window Position
      #--------------------------------------------------------------------------        
      alias mog_battle_hud_start_party_command_selection start_party_command_selection
      def start_party_command_selection
          set_party_window_position 
          mog_battle_hud_start_party_command_selection
      end  
      
      #--------------------------------------------------------------------------
      # ● Update
      #--------------------------------------------------------------------------  
      alias mog_battle_hud_update_basic update_basic
      def update_basic
          mog_battle_hud_update_basic
          update_command_window_visible
      end  
      
      #--------------------------------------------------------------------------
      # ● Update Command Window Visible
      #--------------------------------------------------------------------------    
      def update_command_window_visible
          @status_window.visible = @status_window.active ? true : false
          @actor_command_window.visible = @actor_command_window.active ? true : false
          @skill_window.visible = @skill_window.active ? true : false
          @item_window.visible = @item_window.active ? true : false      
      end
      
      #--------------------------------------------------------------------------
      # ● Start Actor Command Selection
      #--------------------------------------------------------------------------    
      alias mog_battle_hud_start_actor_command_selection start_actor_command_selection
      def start_actor_command_selection
          mog_battle_hud_start_actor_command_selection
          @actor_command_window.viewport = nil
          @actor_command_window.x = MOG_BATTLE_HUD::COMMAND_POSITION[0] + $game_party.members[battleManager.actor.index].hud_x
          @actor_command_window.y = MOG_BATTLE_HUD::COMMAND_POSITION[1] + $game_party.members[battleManager.actor.index].hud_y
          @party_command_window.x = @actor_command_window.x
          @party_command_window.y = @actor_command_window.y  
      end  
    
    end
    
    
    #==============================================================================
    # ■ Game Temp
    #==============================================================================
    class Game_Temp 
      
      attr_accessor :battle_cursor
      
      #--------------------------------------------------------------------------
      # ● Initialize
      #--------------------------------------------------------------------------  
      alias mog_battle_cursor_initialize initialize
      def initialize
          @battle_cursor = [0,0,true,""]
          mog_battle_cursor_initialize
      end  
      
    end
    
    #==============================================================================
    # ■ Spriteset Battle
    #==============================================================================
    class Spriteset_Battle
      
      include MOG_BATTLE_CURSOR
      
      #--------------------------------------------------------------------------
      # ● Initialize
      #--------------------------------------------------------------------------      
      alias mog_battle_cursor_initialize initialize
      def initialize
          mog_battle_cursor_initialize
          create_cursor
      end
      
      #--------------------------------------------------------------------------
      # ● Create_Cursor
      #--------------------------------------------------------------------------        
      def create_cursor
          @cursor = Sprite.new
          @cursor.bitmap = Cache.system("Battle_Cursor")
          @cursor.z = 999
          @cursor.visible = false
          @cursor_new_x = 0
          @cursor_new_y = 0
          @cursor_float_y = 0
          @cursor_float_duration = 0
          @c_real_y = 0
          @cursor_name = Sprite.new
          @cursor_name.bitmap = Bitmap.new(120,32)
          @cursor_name.z = @cursor.z + 1
          @cursor_name.bitmap.font.size = 16
          refresh_cursor_name
          update_cursor_name
          $game_temp.battle_cursor = [@cursor_new_x,@cursor_new_y,false]
      end  
      
      #--------------------------------------------------------------------------
      # ● Refresh Cursor Name
      #--------------------------------------------------------------------------              
      def refresh_cursor_name 
          return if  !(@cursor.x == $game_temp.battle_cursor[0] and
                       @cursor.y == @c_real_y)
          @cursor_name_enemy = $game_temp.battle_cursor[3]
          @cursor_name.bitmap.clear      
          @cursor_name.bitmap.draw_text(0,0,120,32,@cursor_name_enemy.to_s,1)      
      end
        
      #--------------------------------------------------------------------------
      # ● Dispose
      #--------------------------------------------------------------------------      
      alias mog_battle_cursor_dispose dispose
      def dispose
          mog_battle_cursor_dispose
          dispose_cursor
      end  
      
      #--------------------------------------------------------------------------
      # ● Dispose Cursor
      #--------------------------------------------------------------------------        
      def dispose_cursor    
          @cursor.bitmap.dispose
          @cursor.dispose
          @cursor_name.bitmap.dispose
          @cursor_name.dispose
      end
      
      #--------------------------------------------------------------------------
      # ● Update
      #--------------------------------------------------------------------------          
      alias mog_battle_cursor_update update
      def update
          mog_battle_cursor_update
          update_battle_cursor
      end  
      
      #--------------------------------------------------------------------------
      # ● Update Battle Cursor
      #--------------------------------------------------------------------------            
      def update_battle_cursor
          return if @cursor == nil
          @cursor.visible = $game_temp.battle_cursor[2]
          update_cursor_name
          if !@cursor.visible
             @cursor.x = 0
             @cursor.y = 0
             @cursor.opacity = 0
             update_cursor_name
             return
          end        
          @cursor.opacity += 15 
          update_cursor_float_effect
          if CURSOR_SLIDE_EFFECT
             update_cursor_slide_effect
          else
             @cursor.x = $game_temp.battle_cursor[0]
             @cursor.y = $game_temp.battle_cursor[1]
          end
      end
      
      #--------------------------------------------------------------------------
      # ● Update Cursor Name
      #--------------------------------------------------------------------------              
      def update_cursor_name
          refresh_cursor_name if @cursor_name_enemy != $game_temp.battle_cursor[3]
          @cursor_name.x = @cursor.x + CURSOR_NAME_POSITION[0] 
          @cursor_name.y = @cursor.y + CURSOR_NAME_POSITION[1]
          @cursor_name.opacity = @cursor.opacity
          @cursor_name.visible = @cursor.visible    
      end  
        
      #--------------------------------------------------------------------------
      # ● Update Cursor Slide Effect
      #--------------------------------------------------------------------------                
      def update_cursor_slide_effect
          @cursor_new_x = $game_temp.battle_cursor[0]
          @cursor_new_y = $game_temp.battle_cursor[1]      
          @cs_x = 5 + ((@cursor.x - @cursor_new_x).abs / 5)
          @cs_y = 5 + ((@cursor.y - @cursor_new_y).abs / 5)
          if @cursor.x > @cursor_new_x 
             @cursor.x -= @cs_x
             @cursor.x = @cursor_new_x if @cursor.x < @cursor_new_x
          elsif  @cursor.x < @cursor_new_x 
             @cursor.x += @cs_x
             @cursor.x = @cursor_new_x if @cursor.x > @cursor_new_x
          end     
          @c_real_y = @cursor_new_y + @cursor_float_y 
          if @cursor.y > @cursor_new_y 
             @cursor.y -= @cs_y
             @cursor.y = @c_real_y if @cursor.y < @c_real_y
          elsif  @cursor.y < @c_real_y 
             @cursor.y += @cs_y
             @cursor.y = @c_real_y if @cursor.y > @c_real_y
          end  
      end
      
      #--------------------------------------------------------------------------
      # ● Update Cursor Float Effect
      #--------------------------------------------------------------------------              
      def update_cursor_float_effect
          return if !CURSOR_FLOAT_EFFECT
          @cursor_float_duration += 1
          case @cursor_float_duration
            when 0..20
              @cursor_float_y += 1
            when 21..40
              @cursor_float_y  -= 1
            else
              @cursor_float_y = 0
              @cursor_float_duration = 0
          end        
      end
        
    end
    
    #==============================================================================
    # ■ Window BattleStatus
    #==============================================================================
    class Window_BattleStatus < Window_Selectable
    
      #--------------------------------------------------------------------------
      # ● Initialize
      #--------------------------------------------------------------------------
      alias mog_battle_hud_initialize initialize
      def initialize
          mog_battle_hud_initialize
          self.visible = false      
      end
        
      #--------------------------------------------------------------------------
      # ● Refresh
      #--------------------------------------------------------------------------          
      alias mog_battle_hud_refresh refresh
      def refresh
          return
          mog_battle_hud_refresh      
      end  
      
    end
    
    #==============================================================================
    # ■ Scene Battle
    #==============================================================================
    class Scene_Battle < Scene_Base
      
      #--------------------------------------------------------------------------
      # ● Create Enemy Window
      #--------------------------------------------------------------------------              
      def create_enemy_window
          @enemy_window = Window_BattleEnemy_Cursor.new
          @enemy_window.set_handler(:ok,     method(:on_enemy_ok))
          @enemy_window.set_handler(:cancel, method(:on_enemy_cancel))
      end
      
      #--------------------------------------------------------------------------
      # ● Create Actor Window
      #--------------------------------------------------------------------------                
      def create_actor_window
          @actor_window = Window_BattleActor_Cursor.new
          @actor_window.set_handler(:ok,     method(:on_actor_ok))
          @actor_window.set_handler(:cancel, method(:on_actor_cancel))
      end  
    
    end
    
    #==============================================================================
    # ■ Window Selectable Battle_Cursor
    #==============================================================================
    class Window_Selectable_Battle_Cursor < Window_Base
      
      attr_reader   :index
      
      #--------------------------------------------------------------------------
      # ● Initialize
      #-------------------------------------------------------------------------
      def initialize(x, y, width, height)
          super
          @index = -1
          @handler = {}
          deactivate
      end
    
      #--------------------------------------------------------------------------
      # ● Item Max
      #--------------------------------------------------------------------------
      def item_max
        return 0
      end
      
      #--------------------------------------------------------------------------
      # ● Active
      #--------------------------------------------------------------------------
      def active=(active)
          super
      end
      
      #--------------------------------------------------------------------------
      # ● Index
      #--------------------------------------------------------------------------
      def index=(index)
          @index = index
      end
    
      #--------------------------------------------------------------------------
      # ● Set Handler
      #--------------------------------------------------------------------------
      def set_handler(symbol, method)
          @handler[symbol] = method
      end
      
      #--------------------------------------------------------------------------
      # ● Handle?
      #--------------------------------------------------------------------------
      def handle?(symbol)
          @handler.include?(symbol)
      end
      
      #--------------------------------------------------------------------------
      # ● Call Handler
      #--------------------------------------------------------------------------
      def call_handler(symbol)
          @handler[symbol].call if handle?(symbol)
      end
     
      #--------------------------------------------------------------------------
      # ● Cursor Movable
      #--------------------------------------------------------------------------
      def cursor_movable?
          active && open? && !@cursor_fix && !@cursor_all && item_max > 0
      end  
      
      #--------------------------------------------------------------------------
      # ● Cursor Down
      #--------------------------------------------------------------------------  
      def cursor_down(wrap = false)
          self.index += 1
          check_index_limit
      end
      
      #--------------------------------------------------------------------------
      # ● Cursor Right
      #--------------------------------------------------------------------------
      def cursor_right(wrap = false)
          self.index += 1
          check_index_limit
      end  
      
      #--------------------------------------------------------------------------
      # ● Cursor UP
      #--------------------------------------------------------------------------
      def cursor_up(wrap = false)
          self.index -= 1
          check_index_limit
      end  
      
      #--------------------------------------------------------------------------
      # ● Cursor Left
      #--------------------------------------------------------------------------
      def cursor_left(wrap = false)
          self.index -= 1
          check_index_limit(self.index)
      end
      
      #--------------------------------------------------------------------------
      # ● Update
      #--------------------------------------------------------------------------
      def update
          super
          process_cursor_move
          process_handling
      end
      
      #--------------------------------------------------------------------------
      # ● Process Cursor Move
      #--------------------------------------------------------------------------
      def process_cursor_move
          return unless cursor_movable?
          last_index = @index
          cursor_down (Input.trigger?(:DOWN))  if Input.repeat?(:DOWN)
          cursor_up   (Input.trigger?(:UP))    if Input.repeat?(:UP)
          cursor_right(Input.trigger?(:RIGHT)) if Input.repeat?(:RIGHT)
          cursor_left (Input.trigger?(:LEFT))  if Input.repeat?(:LEFT)
          if @index != last_index
             Sound.play_cursor
             set_cursor_position(@index)
          end   
      end
      
      #--------------------------------------------------------------------------
      # ● Process Handling
      #--------------------------------------------------------------------------
      def process_handling
          return unless open? && active
          return process_ok       if ok_enabled?        && Input.trigger?(:C)
          return process_cancel   if cancel_enabled?    && Input.trigger?(:B)
      end
      
      #--------------------------------------------------------------------------
      # ● OK Enabled
      #--------------------------------------------------------------------------
      def ok_enabled?
          handle?(:ok)
      end
      
      #--------------------------------------------------------------------------
      # ● Cancel Enabled
      #--------------------------------------------------------------------------
      def cancel_enabled?
          handle?(:cancel)
      end
     
      #--------------------------------------------------------------------------
      # ● Process OK
      #--------------------------------------------------------------------------
      def process_ok
          if current_item_enabled?
             Sound.play_ok
             Input.update
             deactivate
             call_ok_handler
          else
             Sound.play_buzzer
          end
      end
      
      #--------------------------------------------------------------------------
      # ● Call OK Handler
      #--------------------------------------------------------------------------
      def call_ok_handler
          call_handler(:ok)
      end
      
      #--------------------------------------------------------------------------
      # ● Process Cancel
      #--------------------------------------------------------------------------
      def process_cancel
          Sound.play_cancel
          Input.update
          deactivate
          call_cancel_handler
      end
     
      #--------------------------------------------------------------------------
      # ● Call Cancel Handler
      #--------------------------------------------------------------------------
      def call_cancel_handler
          call_handler(:cancel)
      end
    
      #--------------------------------------------------------------------------
      # ● Set Cursor Position
      #--------------------------------------------------------------------------    
      def set_cursor_position(index)    
      end  
      
      #--------------------------------------------------------------------------
      # ● Current Item Enabled?
      #--------------------------------------------------------------------------
      def current_item_enabled?
          return true
      end
    
      #--------------------------------------------------------------------------
      # ● Refresh
      #--------------------------------------------------------------------------
      def refresh
          contents.clear
      end
      
      #--------------------------------------------------------------------------
      # ● Show
      #--------------------------------------------------------------------------
      def show
          set_cursor_position(self.index)
          $game_temp.battle_cursor[2] = true
          super
      end
      
      #--------------------------------------------------------------------------
      # ● Hide
      #--------------------------------------------------------------------------
      def hide
          $game_temp.battle_cursor[2] = false
          super
      end  
      
      #--------------------------------------------------------------------------
      # ● Check Index Limit
      #--------------------------------------------------------------------------      
      def check_index_limit(index = self.index)
          self.index = index
          self.index = 0 if self.index >= item_max
          self.index = (item_max - 1) if self.index < 0
      end      
      
    end
    
    #==============================================================================
    # ■ Window_BattleEnemy
    #==============================================================================
    class Window_BattleEnemy_Cursor < Window_Selectable_Battle_Cursor
      
      include MOG_BATTLE_CURSOR
      
      #--------------------------------------------------------------------------
      # ● Initialize
      #--------------------------------------------------------------------------
      def initialize
          super(-32, -32, 32, 32)
          self.index = 0
          self.visible = false
          set_cursor_position(self.index) 
      end  
      
      #--------------------------------------------------------------------------
      # ● Item Max
      #--------------------------------------------------------------------------
      def item_max
          $game_troop.alive_members.size
      end
        
      #--------------------------------------------------------------------------
      # ● Enemy
      #--------------------------------------------------------------------------  
      def enemy
          $game_troop.alive_members[self.index]
      end  
      
      #--------------------------------------------------------------------------
      # ● Set Cursor Position
      #--------------------------------------------------------------------------    
      def set_cursor_position(index)
          check_index_limit(index)
          return if $game_troop.alive_members[self.index] == nil
          $game_temp.battle_cursor[0] = $game_troop.alive_members[self.index].screen_x + CURSOR_POSITION[0]
          $game_temp.battle_cursor[1] = $game_troop.alive_members[self.index].screen_y + CURSOR_POSITION[1]
          $game_temp.battle_cursor[3] = $game_troop.alive_members[self.index].name
      end
    
    end
    
    #==============================================================================
    # ■ Window_BattleActor Cursor
    #==============================================================================
    class Window_BattleActor_Cursor < Window_Selectable_Battle_Cursor
      
      include MOG_BATTLE_CURSOR
      include MOG_BATTLE_HUD
      #--------------------------------------------------------------------------
      # ● Initialize
      #--------------------------------------------------------------------------
      def initialize
          super(-32, -32, 32, 32)
          self.index = 0
          self.visible = true
          set_cursor_position(self.index) 
      end  
      
      #--------------------------------------------------------------------------
      # ● Item Max
      #--------------------------------------------------------------------------
      def item_max
          $game_party.members.size
      end
      
      #--------------------------------------------------------------------------
      # ● Set Cursor Position
      #--------------------------------------------------------------------------    
      def set_cursor_position(index)
          check_index_limit(index)
          return if $game_party.members[self.index] == nil
          screen_x = $game_party.members[self.index].screen_x rescue nil
          screen_y = $game_party.members[self.index].screen_y rescue nil
          if screen_x == nil or screen_y == nil
             screen_x = $game_party.members[self.index].hud_x + (HP_NUMBER_POSITION[0] / 3) + 32
             screen_y = $game_party.members[self.index].hud_y + (HP_NUMBER_POSITION[1] / 2) + 32
          end  
          $game_temp.battle_cursor[0] = screen_x + CURSOR_POSITION[0]
          $game_temp.battle_cursor[1] = screen_y + CURSOR_POSITION[1]
          $game_temp.battle_cursor[3] = $game_party.members[self.index].name
      end
     
    end
    
    $mog_rgss3_battle_hud = true
    
    

     

     

     

     

    Ora:

    Dopo aver modificato l'HUD vero e proprio con una grafica personalizzata, avevo pensato di modificare anche il cursore che trovavo troppo "ingombrante" facendo diventare questo

    http://imageshack.us/a/img834/1926/battlecursor.png

    questo:

    http://img62.imageshack.us/img62/4646/chaincursor.png

     

    Tuttavia, pur provando a "smanettare" sullo script non ho capito come fare in modo che il cursore, anzichè sotto il nemico, si posizioni al centro dello stesso...

    E' possibile? E dove devo andare a modificare?

    Grazie per l'aiuto...

×
×
  • Create New...