Bigace360

Help Window+

Nov 24th, 2011
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.40 KB | None | 0 0
  1. #==============================================================================
  2. # ■ Help Window+
  3. # ■ Author: Bigace360  
  4. # ■ Version: 1.0
  5. # ■ Date: Feb. 1, 2011
  6. # Help window Plus adds the HP & SP gauge for enemies, it also allows the
  7. # developer choose which enemies will show ??? to hid the HP instead.
  8. #==============================================================================
  9. module ACE
  10.     BACK_OPACITY = 255
  11.   WINDOW_OPACITY = 255
  12.     ENEMIES_IDS = [1]
  13.   NEW_WINDOW = true #false returns the enemy help window back to default
  14. end
  15.  
  16. #==============================================================================
  17. # ** Window_Base
  18. #==============================================================================
  19. class Window_Base < Window
  20.     def draw_battle_hp(actor, x, y, width = 144)
  21.         self.contents.font.color = system_color
  22.         self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
  23.         self.contents.font.color = normal_color
  24.         self.contents.draw_text(x+35, y, 120, 32, "????" + " / " + "????", 1)
  25.     end
  26.     def draw_battle_sp(actor, x, y, width = 144)
  27.         self.contents.font.color = system_color
  28.         self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
  29.         self.contents.font.color = normal_color
  30.         self.contents.draw_text(x+35, y, 120, 32, "???" + " / " + "???", 1)
  31.     end
  32. end
  33. #==============================================================================
  34. # ** Window_Help
  35. #==============================================================================
  36. class Window_Help < Window_Base
  37.     include ACE
  38.     alias ace_initial_window_help initialize
  39.     def initialize
  40.         ace_initial_window_help
  41.         self.z = 4000 if $game_temp.in_battle
  42.         self.back_opacity = BACK_OPACITY if $game_temp.in_battle
  43.     self.opacity = WINDOW_OPACITY if $game_temp.in_battle
  44.     end
  45.     #--------------------------------------------------------------------------
  46.   alias ace_set_enemy set_enemy
  47.     def set_enemy(enemy)
  48.     if NEW_WINDOW
  49.       if enemy != @enemy
  50.         self.contents.clear
  51.         draw_actor_name(enemy, 4, 0)
  52.         draw_actor_state(enemy, 140, 0)
  53.         unless ENEMIES_IDS.include?(enemy.id)
  54.           draw_actor_hp(enemy, 284, 0)
  55.           draw_actor_sp(enemy, 460, 0)
  56.         else
  57.           draw_battle_hp(enemy, 284, 0)
  58.           draw_battle_sp(enemy, 460, 0)            
  59.         end
  60.         @enemy, @text = enemy, nil
  61.         self.visible = true
  62.       end
  63.         else
  64.       ace_set_enemy(enemy)
  65.     end
  66.     end
  67. end
Advertisement
Add Comment
Please, Sign In to add comment