Advertisement
LiTTleDRAgo

[RGSS] Blizz-ABS Active Action Info

Oct 21st, 2011
429
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 7.85 KB | None | 0 0
  1. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2. # Blizz ABS Active Action Info
  3. # Version: 1.52
  4. # Author : LiTTleDRAgo
  5. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  6.  
  7. module ZetsuDrago
  8.  
  9.   ACT_HUD_X = 200
  10.   ACT_HUD_Y = 400
  11.   ACT_FONT = 'Calibri'
  12.   ACT_SIZE = 20
  13.   ACT_BOLD = true
  14.   ACT_ITALIC = true
  15.   ACT_SE = "EF_Pop10"
  16.   ACT_SWITCH = 47
  17.  
  18. end
  19. #==============================================================================
  20. # Config End
  21. #==============================================================================
  22. class Game_Temp
  23.     attr_accessor :act_hud ; attr_accessor :act_text_zoom
  24.     attr_accessor :act_text; attr_accessor :act_start
  25.     alias_method  :drago_act_initialize, :initialize
  26.  
  27.  def initialize  
  28.   drago_act_initialize
  29.     @act_hud, @act_text_zoom = [], []
  30.     @act_hud[1...13] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  31.     @act_text_zoom[1], @act_text_zoom[2] = 1.00, 1.00
  32.     @act_text, @act_start = "", false  
  33.  end
  34. end
  35.  
  36. class Game_System
  37.   alias_method  :drago25_init, :initialize
  38.   def mpit() @mpit ||= [0, 0, 1, 1, 0, 0] end
  39. end
  40.  
  41. class Interpreter
  42.  
  43.   alias_method :drago25_command126, :command_126
  44.   alias_method :drago25_command127, :command_127
  45.   alias_method :drago25_command128, :command_128
  46.   alias_method :drago25_command125, :command_125
  47.  
  48.   def command_126; drago25_command126; $game_system.mpit[5] = 1; parsys; end
  49.   def command_127; drago25_command127; $game_system.mpit[5] = 2; parsys; end
  50.   def command_128; drago25_command128; $game_system.mpit[5] = 3; parsys; end
  51.   def command_125; drago25_command125; $game_system.mpit[5] = 4
  52.     $game_system.mpit[4] = operate_value(@parameters[0], @parameters[1], @parameters[2])
  53.   end
  54.  
  55.   def parsys
  56.    $game_system.mpit[3], @param, $ref = @parameters[0], @parameters,  true
  57.    $game_system.mpit[4] = operate_value (@param[1], @param[2], @param[3])
  58.   end
  59. end
  60.  
  61. class Game_Map
  62.   attr_reader   :map_id
  63.  
  64.   def mpitnm
  65.     $mpitnm = load_data("Data/Items.rxdata")
  66.     $mpitnm[$game_system.mpit[3]].name; end; def mpwpnm
  67.     $mpwpnm = load_data("Data/Weapons.rxdata")
  68.     $mpwpnm[$game_system.mpit[3]].name; end; def mparnm
  69.     $mparnm = load_data("Data/Armors.rxdata")
  70.     $mparnm[$game_system.mpit[3]].name
  71.   end
  72. end
  73.  
  74. class Window_Base < Window
  75.   SWITCH = ZetsuDrago::ACT_SWITCH
  76.   def draw_mpitem(x,y)
  77.     $game_system.mpit = [] if $game_system.mpit == nil
  78.     dev, @gam, @map = "Got  "+$game_system.mpit[4].to_s, $game_system, $game_map
  79.     $game_temp.act_text = dev + "  x  " + @map.mpitnm.to_s if @gam.mpit[5] == 1
  80.     $game_temp.act_text = dev + "  x  " + @map.mpwpnm.to_s if @gam.mpit[5] == 2
  81.     $game_temp.act_text = dev + "  x  " + @map.mparnm.to_s if @gam.mpit[5] == 3
  82.     $game_temp.act_text = dev+"  "+$data_system.words.gold if @gam.mpit[5] == 4
  83.     if @gam.mpit[5] != 0 && $game_switches[SWITCH] && $game_system.mpit[4] > 0
  84.       $game_temp.act_hud[13], $game_temp.act_start = 20, true
  85.       Audio.se_play("Audio/SE/" + ZetsuDrago::ACT_SE , 70, 100) rescue nil
  86.     end
  87.   end
  88. end
  89.  
  90. if $BlizzABS && BlizzABS::VERSION >= 2.7
  91.   class Map_Battler
  92.  
  93.     alias use_skill_activeinfo_earlier use_skill
  94.     def use_skill(skill,*args)
  95.       result = use_skill_activeinfo_earlier(skill,*args)
  96.       draw_skl(skill.name) if result
  97.       return result
  98.     end
  99.    
  100.     alias use_item_activeinfo_earlier use_item
  101.     def use_item(item,*args)
  102.       result = use_item_activeinfo_earlier(item,*args)
  103.       draw_item(item.name) if result
  104.       return result
  105.     end
  106.  
  107.     def draw_skl(value)
  108.       if @battler.is_a?(Game_Actor) && $game_switches[ZetsuDrago::ACT_SWITCH] &&
  109.         @battler.id == $game_party.actors[0].id
  110.         $game_temp.act_text = value
  111.         $game_temp.act_hud[13], $game_temp.act_start = 20, true
  112.       end
  113.     end
  114.    
  115.     def draw_item(value)
  116.       if @battler.is_a?(Game_Actor) && $game_switches[ZetsuDrago::ACT_SWITCH] &&
  117.         @battler.id == $game_party.actors[0].id
  118.         $game_temp.act_text = "Use  "+ value
  119.         $game_temp.act_hud[13], $game_temp.act_start = 20, true
  120.       end
  121.     end
  122.   end
  123. end
  124.  
  125. class Act < Sprite
  126.   ACT_HUD_X, ACT_HUD_Y = ZetsuDrago::ACT_HUD_X, ZetsuDrago::ACT_HUD_Y
  127.   def initialize
  128.      @viewport = Viewport.new(0, 0, 640, 480)
  129.      @viewport.z = 99999  
  130.      super(@viewport)
  131.      @hud1, @hud2, @hud3, @text = Sprite.new, Sprite.new, Sprite.new, Sprite.new
  132.      @hud1.bitmap = RPG::Cache.picture("AF_Lay1") rescue RPG::Cache.picture("")
  133.      @hud2.bitmap = RPG::Cache.picture("AF_Lay2") rescue RPG::Cache.picture("")
  134.      @hud3.bitmap = RPG::Cache.picture("AF_Lay3") rescue RPG::Cache.picture("")
  135.      @text.bitmap = Bitmap.new(120,40); hudposition  
  136.      @hud1.z, @hud2.z, @hud3.z, @text.z  = 9000, 9000, 9003, 9002  
  137.      @text.bitmap.font.name   = ZetsuDrago::ACT_FONT
  138.      @text.bitmap.font.size   = ZetsuDrago::ACT_SIZE
  139.      @text.bitmap.font.bold   = ZetsuDrago::ACT_BOLD
  140.      @text.bitmap.font.italic = ZetsuDrago::ACT_ITALIC
  141.      @text.bitmap.font.color.set(250, 250, 250, 220)
  142.    end
  143.    
  144.   def dispose      
  145.     [@hud1, @hud2, @hud3, @text, @viewport].each {|s| s.dispose if s != nil}
  146.   end
  147.  
  148.   def refresh
  149.      @temp.act_start = false; @text.bitmap.clear
  150.      @xhud[9], @xhud[10], @xhud[11], @xhud[12], @xhud[1], @xhud[2], @zoom[1],
  151.      @xhud[7] = 100, 100, 100, 100, 100, -100, 1.50, 0
  152.      @text.bitmap.draw_text(0, 0, 120, 40, @temp.act_text.to_s,1)
  153.   end
  154.  
  155.   def update
  156.     hudposition  
  157.     @xhud[13] -= 1 if @xhud[13] > 0
  158.     if @xhud[13] > 0
  159.       @xhud[9] += 10 if @xhud[9] < 255;       @xhud[10] += 10 if @xhud[9] < 255
  160.       @xhud[11] += 10 if @xhud[9] < 255;      @xhud[12] += 10 if @xhud[9] < 255
  161.       @xhud[1] -= 10 if @xhud[1] > 0;         @xhud[2] += 10 if @xhud[1] > 0
  162.       @xhud[1] = @xhud[2] = 0 if @xhud[1] < 0;@zoom[1] -= 0.1 if @zoom[1] > 1.00
  163.       @zoom[1] = 1.00 if @zoom[1] < 1.00;     @zoom[2] = 1.00 if @zoom[1] < 1.00
  164.       @xhud[4] = 0 if @zoom[1] < 1.00
  165.     else
  166.         @xhud[9] -= 10 if @xhud[9] > 0;     @xhud[10] -= 10 if @xhud[9] > 0
  167.         @xhud[11] -= 10 if @xhud[9] > 0;    @xhud[12] -= 10 if @xhud[9] > 0
  168.         @xhud[1] -= 10 if @xhud[1] < 100;   @xhud[2] += 10 if @xhud[1] < 100
  169.         @xhud[1] = @xhud[2] = 100 if @xhud[1] > 100
  170.     end
  171.     refresh if @temp.act_start == true
  172.   end
  173.  
  174.   def hudposition
  175.     @hud1.ox, @temp  = -ACT_HUD_X + $game_temp.act_hud[1], $game_temp
  176.     @hud1.oy, @xhud = -ACT_HUD_Y + @temp.act_hud[5], $game_temp.act_hud
  177.     @hud2.ox, @zoom = -ACT_HUD_X - 50 + @xhud[2], $game_temp.act_text_zoom      
  178.     @hud2.oy = -ACT_HUD_Y - 20 + @xhud[6]; @hud3.ox = -ACT_HUD_X - 80 + @xhud[3]
  179.     @hud3.oy = -ACT_HUD_Y + 20 + @xhud[7]; @text.ox = -ACT_HUD_X - 50 + @xhud[4]
  180.     @text.oy = -ACT_HUD_Y + 5 + @xhud[8]
  181.     @hud1.opacity, @hud2.opacity = @xhud[9], @xhud[10]
  182.     @hud3.opacity, @text.opacity = @xhud[11], @xhud[12]
  183.     @text.zoom_x, @text.zoom_y = @zoom[1], @zoom[2]  
  184.   end
  185. end
  186.  
  187. class Mpitem < Window_Base
  188.   def initialize
  189.     super(0, 0, 250, 100)
  190.     self.contents, self.opacity = Bitmap.new(width - 32, height - 32), 0
  191.     self.contents.clear; refresh
  192.   end
  193.   def refresh; draw_mpitem(10,0); @gam.mpit[5] = 0; end
  194. end
  195.  
  196. class Scene_Map  
  197.   alias_method :drago_act_main, :main
  198.   alias_method :drago25_update, :update
  199.  
  200.   def main
  201.     @act, @mpit = Act.new, Mpitem.new
  202.     @mpit.visible, @mpit.contents_opacity = true, $game_system.mpit[6]
  203.     drago_act_main;[@act, @mpit].each {|s| s.dispose if s != nil}
  204.     @mpit = @act = nil
  205.   end  
  206.  
  207.   def update
  208.     drago25_update
  209.     @act.update if @act != nil; @mpit.refresh if @mpit != nil
  210.     @mpit.x, @mpit.y, $ref = 200, 480, false if $ref == true
  211.     $game_system.mpit[1], $game_system.mpit[2]= @mpit.x, @mpit.y
  212.     @mpit.contents_opacity, @mpit.visible= $game_system.mpit[6], true
  213.     @mpit.y -= 8 if @mpit.y > 380; @mpit.y = 380 if @mpit.y >= 380
  214.     $game_system.mpit[6] -= 3
  215.   end
  216. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement