#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Active Action Info for Blizz ABS
# Version: 1.27
# Author : LiTTleDRAgo
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
module ZetsuDrago
ACT_HUD_X = 200 # This is for x position
ACT_HUD_Y = 400 # This is for y position
ACT_TIME = 2
ACT_SE = "001-System01" # Sound Effect when receiving an item
ACT_SWITCH = 8 # Switch to enable Active Action Info
end
#==============================================================================
# Config End
#==============================================================================
class Game_Temp
attr_accessor :act_hud ; attr_accessor :act_text_zoom
attr_accessor :act_text; attr_accessor :act_start
alias_method :drago_act_initialize, :initialize
def initialize
drago_act_initialize
@act_hud, @act_text_zoom = [], []
@act_hud[1...13] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
@act_text_zoom[1], @act_text_zoom[2] = 1.00, 1.00
@act_text,@act_start = "", false
end
end
class Game_System
attr_accessor :mpit; alias_method :drago25_init, :initialize
def initialize;drago25_init; @mpit = []; mpit[1...6] = 0, 0, 1, 1, 0, 0; end
end
class Interpreter
alias_method :drago25_command126, :command_126
alias_method :drago25_command127, :command_127
alias_method :drago25_command128, :command_128
alias_method :drago25_command125, :command_125
def command_126; drago25_command126; $game_system.mpit[5] = 1; parsys; end
def command_127; drago25_command127; $game_system.mpit[5] = 2; parsys; end
def command_128; drago25_command128; $game_system.mpit[5] = 3; parsys; end
def command_125; drago25_command125; $game_system.mpit[5] = 4
$game_system.mpit[4] = operate_value(@parameters[0], @parameters[1], @parameters[2])
end
def parsys
$game_system.mpit[3], @param = @parameters[0], @parameters; $ref = true
$game_system.mpit[4] = operate_value (@param[1], @param[2], @param[3])
end
end
class Game_Map
attr_reader :map_id
def mpitnm
$mpitnm = load_data("Data/Items.rxdata")
$mpitnm[$game_system.mpit[3]].name; end; def mpwpnm
$mpwpnm = load_data("Data/Weapons.rxdata")
$mpwpnm[$game_system.mpit[3]].name; end; def mparnm
$mparnm = load_data("Data/Armors.rxdata")
$mparnm[$game_system.mpit[3]].name
end
end
class Window_Base < Window
include ZetsuDrago
def draw_mpitem(x,y)
dev, @gam, @map = "Got "+$game_system.mpit[4].to_s, $game_system, $game_map
$game_temp.act_text = dev + " x " + @map.mpitnm.to_s if @gam.mpit[5] == 1
$game_temp.act_text = dev + " x " + @map.mpwpnm.to_s if @gam.mpit[5] == 2
$game_temp.act_text = dev + " x " + @map.mparnm.to_s if @gam.mpit[5] == 3
$game_temp.act_text = dev+" "+$data_system.words.gold if @gam.mpit[5] == 4
if @gam.mpit[5] != 0 && $game_switches[ACT_SWITCH] && $game_system.mpit[4] > 0
$game_temp.act_hud[13],$game_temp.act_start = 20,true
Audio.se_play("Audio/SE/" + ACT_SE , 70, 100) rescue nil
end
end
end
if $BlizzABS && BlizzABS::VERSION >= 2.82
class Map_Battler
include ZetsuDrago
alias use_skill_activeinfo_earlier use_skill
def use_skill(skill, forced = false)
result = use_skill_activeinfo_earlier(skill, forced)
if result && @battler.is_a?(Game_Actor) &&
$game_switches[ACT_SWITCH]
draw_skl(skill.name)
end
return result
end
alias use_item_activeinfo_earlier use_item
def use_item(item, forced = false)
result = use_item_activeinfo_earlier(item, forced)
if result && @battler.is_a?(Game_Actor) &&
$game_switches[ACT_SWITCH]
draw_item(item.name)
end
return result
end
def draw_skl(value)
$game_temp.act_text = value
$game_temp.act_hud[13], $game_temp.act_start = 20, true
end
def draw_item(value)
$game_temp.act_text = "Use "+ value
$game_temp.act_hud[13], $game_temp.act_start = 20, true
end
end
end
class Bitmap
def draw_hemming_text(x, y, w, h, t, a = 0)
original_color = self.font.color.dup; self.font.color = Color.new(0,0,0,255)
self.draw_text(x , y , w, h, t, a); self.draw_text(x , y+2, w, h, t, a)
self.draw_text(x+2, y+2, w, h, t, a); self.draw_text(x+2, y , w, h, t, a)
self.font.color = original_color; self.draw_text(x+1, y+1, w, h, t, a)
end
end
class Act < Sprite
include ZetsuDrago
def initialize
@viewport = Viewport.new(0, 0, 640, 480)
@viewport.z = 99999
super(@viewport)
@hud1, @hud2, @hud3, @text = Sprite.new, Sprite.new, Sprite.new, Sprite.new
@hud1.bitmap = RPG::Cache.picture("AF_Lay1")
@hud2.bitmap = RPG::Cache.picture("AF_Lay2")
@hud3.bitmap = RPG::Cache.picture("AF_Lay3")
@text.bitmap = Bitmap.new(120,40); @time = ACT_TIME; hudposition
@hud1.z, @hud2.z, @hud3.z, @text.z = 9000, 9000, 9003, 9002
@text.bitmap.font.name, @text.bitmap.font.size = "Georgia", 20
@text.bitmap.font.bold = @text.bitmap.font.italic = true
@text.bitmap.font.color.set(250, 250, 250, 220)
end
def dispose
[@hud1, @hud2, @hud3, @text, @viewport].each {|s| s.dispose if s != nil}
end
def refresh
@temp.act_start = false; @text.bitmap.clear
@xhud[9], @xhud[10], @xhud[11], @xhud[12] = 100, 100, 100, 100
@xhud[1], @xhud[2], @zoom[1], @xhud[7] = 100, -100, 1.50, 0
@text.bitmap.draw_hemming_text(0, 0, 120, 40, @temp.act_text.to_s,1)
@time -= 1; @time = 0 if @time < 0
end
def update
hudposition
@xhud[13] -= 1 if @xhud[13] > 0
if @xhud[13] > 0
@xhud[9] += 10 if @xhud[9] < 255; @xhud[10] += 10 if @xhud[9] < 255
@xhud[11] += 10 if @xhud[9] < 255; @xhud[12] += 10 if @xhud[9] < 255
@xhud[1] -= 10 if @xhud[1] > 0; @xhud[2] += 10 if @xhud[1] > 0
@xhud[1] = @xhud[2] = 0 if @xhud[1] < 0;@zoom[1] -= 0.1 if @zoom[1] > 1.00
@zoom[1] = 1.00 if @zoom[1] < 1.00; @zoom[2] = 1.00 if @zoom[1] < 1.00
@xhud[4] = 0 if @zoom[1] < 1.00
else
if @time == 0
@xhud[9] -= 10 if @xhud[9] > 0; @xhud[10] -= 10 if @xhud[9] > 0
@xhud[11] -= 10 if @xhud[9] > 0; @xhud[12] -= 10 if @xhud[9] > 0
@xhud[1] -= 10 if @xhud[1] < 100; @xhud[2] += 10 if @xhud[1] < 100
@xhud[1] = @xhud[2] = 100 if @xhud[1] > 100
end
end
refresh if @temp.act_start == true
end
def hudposition
@hud1.ox, @temp = -ACT_HUD_X + $game_temp.act_hud[1], $game_temp
@hud1.oy, @xhud = -ACT_HUD_Y + @temp.act_hud[5], $game_temp.act_hud
@hud2.ox, @zoom = -ACT_HUD_X - 50 + @xhud[2], $game_temp.act_text_zoom
@hud2.oy = -ACT_HUD_Y - 20 + @xhud[6]; @hud3.ox = -ACT_HUD_X - 80 + @xhud[3]
@hud3.oy = -ACT_HUD_Y + 20 + @xhud[7]; @text.ox = -ACT_HUD_X - 50 + @xhud[4]
@text.oy = -ACT_HUD_Y + 5 + @xhud[8]
@hud1.opacity, @hud2.opacity = @xhud[9], @xhud[10]
@hud3.opacity, @text.opacity = @xhud[11], @xhud[12]
@text.zoom_x, @text.zoom_y = @zoom[1], @zoom[2]
end
end
class Mpitem < Window_Base
def initialize
super(0, 0, 250, 100)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0; self.contents.clear; refresh
end
def refresh; draw_mpitem(10,0); @gam.mpit[5] = 0; end
end
class Scene_Map
alias_method :drago_act_main, :main
alias_method :drago25_update, :update
def main
@act = Act.new; @mpit = Mpitem.new
@mpit.visible, @mpit.contents_opacity = true, $game_system.mpit[6]
drago_act_main;[@act, @mpit].each {|s| s.dispose if s != nil}
@mpit = @act = nil
end
def update
drago25_update
@act.update if @act != nil; @mpit.refresh if $ref == true
@mpit.x, @mpit.y, $ref = 200, 480, false if $ref == true
$game_system.mpit[1], $game_system.mpit[2]= @mpit.x, @mpit.y
@mpit.contents_opacity, @mpit.visible= $game_system.mpit[6], true
@mpit.y -= 8 if @mpit.y > 380; @mpit.y = 380 if @mpit.y >= 380
$game_system.mpit[6] -= 3
end
end