[Script] [ACE] [VXA]Viewed Battle System
Đi vòng vòng mấy trang nước ngoài thấy cái này cũng hay hay nên về post cho ae xem, script này đã được mình sử dụng
[php]#===============================================================================
# Jet's Viewed Battle System
# By Jet10985(Jet)
#===============================================================================
# This script will add actor sprites into the battle scene.
# This script has: 10 customization options.
#===============================================================================
# Overwritten Methods:
# Game_Actor: use_sprite?, screen_x, screen_y
# Sprite_Battler: revert_to_normal
# Scene_Battle: show_attack_animation
#
# Aliased methods:
# Game_Enemy: screen_x, screen_y
# Sprite_Battler: update_origin, update_bitmap
# Window_BattleEnemy: update
# Window_BattleActor: update
# Window_ActorCommand: update
#===============================================================================
=begin
Set an enemy's attack animation by using this in their notebox:
<anim: 50>
Replace 50 with the animation id.
You may use a sprite for a monster instead of a regular battler by using this
notetag in the monster's notebox:
<sprite: ImageName, 0>
Replace ImageName with the name of the spritesheet, and 0 with the index on the
spritesheet you want the monster to use.
=end
module Jet
module VBS
# Which direction do actors face on the field? There are 4 options:
# :up, :down, :left, or :right. Actor's will direction chosen.
ACTOR_ORIENTATION = :left
# This will make it so actor's are centered on the screen instead of being
# placed in pre-determined lines using START_POINT and SPACE_DIFFERENCE.
CENTER_ACTORS = true
# This is the x and y starting point for actors. This option may take one of
# 2 functions. If CENTER_ACTORS is true, and ACTOR_ORIENTATION is either
# :left, or :right, then only the x value will be used as where to center
# the actors. If it is :down or :up, only the y value will be used.
# If CENTER_ACTORS is false, then this is where actor's will begin to be
# placed on screen.
START_POINT = [400, 250]
# This is how much space is between each actor on the field.
SPACE_DIFFERENCE = 50
# If you're using the :left or :right view, this will push each
# subsequent actor back by a certain number of pixels, to avoid having
# a straight line.
SIDEVIEW_PUSH_BACK = 16
# Do you want to reverse the direction and field during an ambush?
# (This is when enemies surprise the player and get the first turn)
REVERSE_FIELD_FOR_AMBUSH = true
# this is how far the actor will move forward when they are selection an
# action, as well as executing it.
SLIDE_AMOUNT = 66
# This is how far the actor will slide each frame until they reach their
# goal of SLIDE_FORWARD. Best used when this is a factor of SLIDE_FORWARD.
FRAME_SLIDE = 6
# During selecting an actor command, and during selecting an enemy target,
# would you like the selected character to flash?
DO_FLASH = true
# These are state-based sprite changes. If the actor has one of these states
# then the game will search for a sprite of the character's regular sprite
# name with the special state tag appended to it. So if Jimmy's sprite
# name was $Jimmy, and he had poison inflcted on him, and poison's id was
# listed here as ["_poison", 0], it would change Jimmy's in-battle sprite
# to $Jimmy_poison at the first sprite index.
STATE_SPRITES = {
1 => ["", 0],
2 => ["", 0]
}
# Do not touch this option.
DIR_ORIENT = {right: 6, left: 4, down: 2, up: 8}[ACTOR_ORIENTATION]
end
end
#===============================================================================
# DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.
#===============================================================================
class Integer
def even?
self % 2 == 0
end
def odd?
!even?
end
end
class RPG::Enemy
def animation
(f = note.match(/<anim:[ ]*(\d+)>/i)) ? f[1].to_i : 1
end
def battle_sprite
(f = note.match(/<sprite:[ ]*(.+),[ ]*(\d+)>/i)) ? f[1..2] : false
end
end
module BattleManager
class << self
alias jet3845_on_encounter on_encounter
def on_encounter(*args, &block)
jet3845_on_encounter(*args, &block)
@true_surprise = @surprise
end
end
def self.true_surprise
@true_surprise ||= false
end
def self.player_dir
if @true_surprise && Jet::VBS::REVERSE_FIELD_FOR_AMBUSH
return 10 - Jet::VBS::DIR_ORIENT
else
return Jet::VBS::DIR_ORIENT
end
end
end
class Game_Actor
def use_sprite?
true
end
def screen_x
if [8, 2].include?(BattleManager.player_dir)
if Jet::VBS::CENTER_ACTORS
x = Graphics.width / 2
x -= 16
x += Jet::VBS::SPACE_DIFFERENCE / 2 if $game_party.members.size.even?
x -= ($game_party.members.size / 2 - index) * Jet::VBS::SPACE_DIFFERENCE
return x
else
return Jet::VBS::START_POINT[0] + Jet::VBS::SPACE_DIFFERENCE * index
end
end
return Jet::VBS::START_POINT[0]
end
alias jet3745_screen_x screen_x
def screen_x(*args, &block)
x = jet3745_screen_x(*args, &block)
case BattleManager.player_dir
when 4
x += Jet::VBS::SIDEVIEW_PUSH_BACK * index
when 6
x -= Jet::VBS::SIDEVIEW_PUSH_BACK * index
end
return x if !Jet::VBS::REVERSE_FIELD_FOR_AMBUSH
x = Graphics.width - x if BattleManager.true_surprise && [6, 4].include?(BattleManager.player_dir)
x
end
def screen_y
if [6, 4].include?(BattleManager.player_dir)
if Jet::VBS::CENTER_ACTORS
y = Graphics.height / 2
y -= 16
y += Jet::VBS::SPACE_DIFFERENCE / 2 if $game_party.members.size.even?
y -= ($game_party.members.size / 2 - index) * Jet::VBS::SPACE_DIFFERENCE
return y
else
return Jet::VBS::START_POINT[1] + Jet::VBS::SPACE_DIFFERENCE * index
end
end
return Jet::VBS::START_POINT[1]
end
alias jet3745_screen_y screen_y
def screen_y(*args, &block)
y = jet3745_screen_y(*args, &block)
return y if !Jet::VBS::REVERSE_FIELD_FOR_AMBUSH
y = Graphics.height - y if BattleManager.true_surprise && [8, 2].include?(BattleManager.player_dir)
y
end
def screen_z
101 + index
end
alias jet3745_character_name character_name
def character_name(*args, &block)
name = jet3745_character_name(*args, &block)
return name unless SceneManager.scene_is?(Scene_Battle)
states.sort {|a, b| b.priority <=> a.priority }.each {|a|
if (add = Jet::VBS::STATE_SPRITES[a.id])
return name + add[0]
end
}
return name
end
alias jet3745_character_index character_index
def character_index(*args, &block)
index = jet3745_character_index(*args, &block)
return index unless SceneManager.scene_is?(Scene_Battle)
states.sort {|a, b| b.priority <=> a.priority }.each {|a|
if (add = Jet::VBS::STATE_SPRITES[a.id])
return index + add[1]
end
}
return index
end
end
class Game_Enemy
alias jet3745_screen_x screen_x
def screen_x(*args, &block)
x = jet3745_screen_x(*args, &block)
return x if !Jet::VBS::REVERSE_FIELD_FOR_AMBUSH
x = Graphics.width - x if BattleManager.true_surprise && [6, 4].include?(BattleManager.player_dir)
x
end
alias jet3745_screen_y screen_y
def screen_y(*args, &block)
y = jet3745_screen_y(*args, &block)
return y if !Jet::VBS::REVERSE_FIELD_FOR_AMBUSH
y = Graphics.height - y if BattleManager.true_surprise && [8, 2].include?(BattleManager.player_dir)
y
end
def atk_animation_id1
enemy.animation
end
def atk_animation_id2
0
end
def bat_sprite?
!!enemy.battle_sprite
end
def character_name
enemy.battle_sprite[0]
end
def character_index
enemy.battle_sprite[1].to_i
end
alias jet3745_character_name character_name
def character_name(*args, &block)
name = jet3745_character_name(*args, &block)
return name unless SceneManager.scene_is?(Scene_Battle)
states.sort {|a, b| b.priority <=> a.priority }.each {|a|
if (add = Jet::VBS::STATE_SPRITES[a.id])
return name + add[0]
end
}
return name
end
alias jet3745_character_index character_index
def character_index(*args, &block)
index = jet3745_character_index(*args, &block)
return index unless SceneManager.scene_is?(Scene_Battle)
states.sort {|a, b| b.priority <=> a.priority }.each {|a|
if (add = Jet::VBS::STATE_SPRITES[a.id])
return index + add[1]
end
}
return index
end
end
class Sprite_Battler
alias jet3835_update_bitmap update_bitmap
def update_bitmap(*args, &block)
if @battler.actor? || @battler.bat_sprite?
actor_update_bitmap
elsif @battler.enemy?
jet3835_update_bitmap(*args, &block)
end
end
def actor_update_bitmap
@timer ||= 0
@index ||= 1
@char_index ||= @battler.character_index
@back_time ||= false
index = @index
char_index = @char_index
@timer += 1
(@index += (@back_time ? -1 : 1); @timer = 0) if @timer == 19
if @index == 3
@back_time = true
@index = 1
elsif @index == -1
@back_time = false
@index = 1
end
@char_index = @battler.character_index
bitmap = Cache.character(@battler.character_name)
return if bitmap == @bitmap && index == @index && @char_index == char_index
self.bitmap = bitmap
sign = @battler.character_name[/^[\!\$]./]
if sign && sign.include?('$')
cw = bitmap.width / 3
ch = bitmap.height / 4
else
cw = bitmap.width / 12
ch = bitmap.height / 8
end
dir = BattleManager.player_dir
dir = 10 - dir if @battler.is_a?(Game_Enemy)
sx = (@battler.character_index % 4 * 3) * cw + (cw * @index)
sy = (@battler.character_index / 4 * 4 + (dir - 2) / 2) * ch
self.src_rect.set(sx, sy, cw, ch)
end
alias jet3745_update_origin update_origin
def update_origin(*args, &block)
if @battler.actor? || @battler.bat_sprite?
actor_update_origin
elsif @battler.enemy?
jet3745_update_origin(*args, &block)
end
end
def actor_update_origin
self.ox = (@actor_ox ||= 0)
self.oy = (@actor_oy ||= 0)
end
def revert_to_normal
self.blend_type = 0
self.color.set(0, 0, 0, 0)
self.opacity = 255
if bitmap && @battler && !@battler.actor? && !@battler.bat_sprite?
self.ox = bitmap.width / 2 if bitmap
self.src_rect.y = 0
end
end
def slide_forward(amount = Jet::VBS::SLIDE_AMOUNT, frame = Jet::VBS::FRAME_SLIDE)
dir = BattleManager.player_dir
dir = 10 - dir if @battler.is_a?(Game_Enemy)
case dir
when 2
affect = :@actor_oy
frame *= -1
when 4
affect = :@actor_ox
amount *= -1
when 6
affect = :@actor_ox
frame *= -1
when 8
affect = :@actor_oy
amount *= -1
end
orig_amount = amount
until (orig_amount < 0 ? amount >= 0 : amount <= 0)
instance_variable_set(affect, instance_variable_get(affect) + frame)
amount += frame
SceneManager.scene.spriteset.update
Graphics.update
end
end
def slide_backward(amount = Jet::VBS::SLIDE_AMOUNT, frame = Jet::VBS::FRAME_SLIDE)
dir = BattleManager.player_dir
dir = 10 - dir if @battler.is_a?(Game_Enemy)
case dir
when 2
affect = :@actor_oy
amount *= -1
when 4
affect = :@actor_ox
frame *= -1
when 6
affect = :@actor_ox
amount *= -1
when 8
affect = :@actor_oy
frame *= -1
end
orig_amount = amount
until (orig_amount < 0 ? amount >= 0 : amount <= 0)
instance_variable_set(affect, instance_variable_get(affect) + frame)
amount += frame
SceneManager.scene.spriteset.update
Graphics.update
end
end
end
class Scene_Battle
attr_reader :spriteset
def show_attack_animation(targets)
show_normal_animation(targets, @subject.atk_animation_id1, false)
show_normal_animation(targets, @subject.atk_animation_id2, true)
end
alias jet3746_use_item use_item
def use_item(*args, &block)
sprite = @spriteset.battler_to_sprite(@subject)
if (@subject.actor? || @subject.bat_sprite?) && !@subject.current_action.guard?
sprite.slide_forward
end
jet3746_use_item(*args, &block)
if (@subject.actor? || @subject.bat_sprite?) && !@subject.current_action.guard?
sprite.slide_backward
end
end
end
class Spriteset_Battle
def battler_to_sprite(actor)
battler_sprites.each {|a|
return a if a.battler == actor
}
return false
end
end
class Window_BattleEnemy
alias jet3745_update update
def update(*args, &block)
jet3745_update(*args, &block)
if self.active && Jet::VBS::DO_FLASH
if Object.const_defined?(:Mouse)
$game_troop.alive_members.each {|a|
img = SceneManager.scene.spriteset.battler_to_sprite(a)
x = img.x - img.ox
y = img.y - img.oy
if Mouse.area?(x, y, img.src_rect.width, img.src_rect.height)
self.index = a.index
end
}
end
active_troop = $game_troop.alive_members[@index]
sprite = SceneManager.scene.spriteset.battler_to_sprite(active_troop)
sprite.start_effect(:whiten) if !sprite.effect?
end
end
end
class Window_BattleActor
alias jet3745_update update
def update(*args, &block)
jet3745_update(*args, &block)
if self.active && Jet::VBS::DO_FLASH
if Object.const_defined?(:Mouse)
$game_party.alive_members.each {|a|
img = SceneManager.scene.spriteset.battler_to_sprite(a)
x = img.x - img.ox
y = img.y - img.oy
if Mouse.area?(x, y, img.src_rect.width, img.src_rect.height)
self.index = a.index
end
}
end
active_troop = $game_party.members[@index]
sprite = SceneManager.scene.spriteset.battler_to_sprite(active_troop)
sprite.start_effect(:whiten) if !sprite.effect?
end
end
end
class Window_ActorCommand
alias jet3745_update update
def update(*args, &block)
jet3745_update(*args, &block)
if self.active && Jet::VBS::DO_FLASH
active_troop = @actor
sprite = SceneManager.scene.spriteset.battler_to_sprite(active_troop)
sprite.start_effect(:whiten) if !sprite.effect?
end
end
end
class Game_Action
def guard?
item == $data_skills[subject.guard_skill_id]
end
end[/php]
Có thể kết hợp thêm cái này để hiện HP Enemy ( chân thành cám ơn finalholylight giới thiệu )
[php]#============================================================================
#VTS Enemy HP Bars
#By Ventwig
#Version 1.7 - May 24 2013
#For RPGMaker VX Ace
#============================================================================
# Here's another window-ish thing to show HP
# Thanks Shaz for helping me out with this one :D
# Thanks ItsKouta for showing me a horrible bug!
# Thanks to #tag-this for helping with the hide numbers option!
# Thanks Helladen for pointing out a small error!
# Thanks Ulises for helping with the hurdle of not having RMVXA with me!
# Thanks estriole, Tsukihime, and selchar for help with notetags!
# Thanks Everyone for your suppourt & suggestions!
#=============================================================================
# Description:
# This code shows the name, HP, and MP for up to 8 enemies at once.
# Plug'N'Play and the HP bar updates after every hit/kill.
# You can also set it so the numbers are hidden! Oooh!
# Long boss bars, "hidden minions", and hover-over-battler bars are available
# features! Yaaaaay!
# Super cool: BARS CAN HOVER OVER THE ENEMY!
# Options to scan enemies or show states will be added.
#==============================================================================
# Compatability:
# alias-es Game_Enemy and Scene_Battle
# Works with Neo Gauge Ultimate Ace (Recommended)
#===============================================================================
# Instructions: Put in materials, above main. Almost Plug and Play
# Put above Neo Gauge Ultimate Ace if used
#==============================================================================
# Please give Credit to Ventwig if you would like to use one of my scripts
# in a NON-COMMERCIAL project.
# Please ask for permission if you would like to use it in a commercial game.
# You may not re-distribute any of my scripts or claim as your own.
# You may not release edits without permission, combatability patches are okay.
#===============================================================================
#Notetags
#==============================================================================
#<hide_hp>
#<show_mp>/<hide_mp>
#<boss_bar>
#==============================================================================
#Mix and match the three notetags! They're pretty much self-explanatory.
#<hide_hp> stops hp from being shown
#<show_mp> shows an mp bar, if REVERSE_MP below is set to false.
#<hide_mp> hides the mp bar, if REVERSE_MP is true.
# If reverse_mp is false, enemies have hidden mp by default. If true,
# then they normally have mp shown. Please use the right one.
#<boss_bar> sets the enemy to a boss, using the long bar (A BOSS MUST BE THE
# FIRST ENEMY IN THE TROOP OR ELSE EVERYTHING GOES WHACK)
#==============================================================================
module EHUD
#====================================================================
#Breakthrough point! You can now choose to place the bar right where
#the enemy's battler is! But if you liked the old version, it's still
#there!
#TRUE means that the bar will hover over, like a cool new version.
#FALSE will keep all the normal info at the top.
#==============================================================
#TRUE still has the boss bar at the top, too!
#==============================================================
HOVER_BAR = true
#Changes how far down the bars are in non-hover mode Recommended 20.
WINDOW_Y = 20
#Want to show mp for most enemies but don't want to bother putting all the
#noteatags? Turn this to true and show_mp turns into hide_mp and will actually
#HIDE the mp with mp always showing by default
REVERSE_MP = false
#Toggles whether or not a delay will be added after each attack so that the
#player can see the current hp/changes
DELAY = false
#Number, choose how long to wait between attacks (to let the player look
#at the HP bars. Recommended 4-6
#Only works if above is set to true
WINDOW_WAIT = 5
#Decides whether or not to show the HP numbers/etc/etc.
#0 means normal (HP name, current and max hp)
#1 means just show HP amount, not the word, nor the max
#2 means just the bar <RECOMMENDED>
DRAW_HP_NUMBERS = 2
#DRAW_LETTERS sets whether or not the script should draw the letters
#for the enemy in case there's multiple enemies, such as
#"Slime A" and "Slime B". This is recommended only for hover bars
#to make knowing who to target easy. It just looks clunky when the name is
#already shown.
DRAW_LETTERS = true
#Selects whether or not you have Neo Gauge Ultimate Ace.
#If it is set to true, this doesnt matter, if it's false,
#make sure you have it right!!!
NEO_ULTIMATE_ACE = true
#These settings make it compatible with my "Nova Battle Display" system!
#Play around with the numbers, but I've provided recommended "Nova" settings
#Change the X value of the bar. Def: 0 Nova:150
BOSS_GAUGEX = 0
#How long the boss gauge should be. Def: 475 Nova:325
BOSS_GAUGEW = 475
#Determines whether or not the minions' HP will still be shown even
#in a boss battle!
#This is determined via a switch, so you can toggle per boss!
#ON=HIDE
#OFF=SHOW
#The thing about this switch, though, is that you have to toggle it MANUALLY
#everytime you want to change it. So before a boss fight, turn it on.
#After, turn it back off.
#THIS DOES NOT HAVE TO BE USED WITH JUST BOSSES
HIDE_MINIONS = 1
end
#module RPG
class RPG::BaseItem
def show_mp
if @show_mp.nil?
if EHUD::REVERSE_MP == false
if @note =~ /<show_mp>/i
@show_mp= true
end
else
if @note =~ /<hide_mp>/i
@show_mp= false
else
@show_mp = true
end
end
end
@show_mp
end
def hide_hp
if @hide_hp.nil?
if @note =~ /<hide_hp>/i
@hide_hp = true
else
@hide_hp = false
end
end
@hide_hp
end
def boss_bar
if @boss_bar.nil?
if @note =~ /<boss_bar>/i
@boss_bar= true
else
@boss_bar = false
end
end
@boss_bar
end
end
#end
class Game_Enemy < Game_Battler
#
# * Method Aliases
#
alias shaz_enemyhud_initialize initialize
#
# * Public Instance Variables
#
attr_accessor :old_hp # hp on last hud refresh
attr_accessor :old_mp # mp on last hud refresh
#
# * Object Initialization
#
def initialize(index, enemy_id)
shaz_enemyhud_initialize(index, enemy_id)
@old_hp = mhp
@old_mp = mmp
end
def boss_bar
return enemy.boss_bar
end
def show_mp
return enemy.show_mp
end
def hide_hp
return enemy.hide_hp
end
end
class Window_Enemy_Hud < Window_Base
###################################################################
#Sets up what appears in the HUD
#Questions names and HUD, then displays them
#################################################################
#Set up the window's start-up
def initialize
#Draws window
super(0,EHUD::WINDOW_Y,545,400) #h=130
self.opacity = 0
self.arrows_visible = false
self.z = 0
@x, @y = 5, 50
troop_fix
if @enemy1.boss_bar == true
@boss_troop = true
@boss_enemy = @enemy1
else
@boss_troop = false
@boss_enemy = nil
end
enemy_hud
refresh
end
if EHUD::NEO_ULTIMATE_ACE == false
def draw_actor_mp(actor, x, y, width = 124)
draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
change_color(system_color)
end
else
def draw_actor_mp(actor, x, y, width = 124)
gwidth = width * actor.mp / [actor.mmp, 1].max
cg = neo_gauge_back_color
c1, c2, c3 = cg[0], cg[1], cg[2]
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, width, HPMP_GAUGE_HEIGHT, c1, c2, c3)
(1..3).each {|i| eval("c#{i} = MP_GCOLOR_#{i}")}
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, gwidth, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,
width, 40)
change_color(system_color)
end
end
if EHUD::DRAW_HP_NUMBERS == 0
if EHUD::NEO_ULTIMATE_ACE == false
def draw_actor_hp(actor, x, y, width = 124)
draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
change_color(hp_color(actor))
draw_current_and_max_values(x, y, 124, actor.hp, actor.mhp,
hp_color(actor), normal_color)
change_color(system_color)
if EHUD::DRAW_LETTERS == true
draw_text(x,y,20,line_height,actor.letter)
end
end
else
def draw_actor_hp(actor, x, y, width = 124)
gwidth = width * actor.hp / actor.mhp
cg = neo_gauge_back_color
c1, c2, c3 = cg[0], cg[1], cg[2]
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, width, HPMP_GAUGE_HEIGHT, c1, c2, c3)
(1..3).each {|i| eval("c#{i} = HP_GCOLOR_#{i}")}
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, gwidth, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,
width, 30)
change_color(system_color)
draw_current_and_max_values(x-25, y, 124, actor.hp, actor.mhp,
hp_color(actor), normal_color)
if EHUD::DRAW_LETTERS == true
draw_text(x,y,20,line_height,actor.letter)
end
end
end
end
if EHUD::DRAW_HP_NUMBERS == 1
if EHUD::NEO_ULTIMATE_ACE == false
def draw_actor_hp(actor, x, y, width = 124)
draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
change_color(hp_color(actor))
draw_text(x+40, y, 100, line_height, actor.hp)
change_color(system_color)
if EHUD::DRAW_LETTERS == true
draw_text(x,y,20,line_height,actor.letter)
end
end
else
def draw_actor_hp(actor, x, y, width = 124)
gwidth = width * actor.hp / actor.mhp
cg = neo_gauge_back_color
c1, c2, c3 = cg[0], cg[1], cg[2]
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, width, HPMP_GAUGE_HEIGHT, c1, c2, c3)
(1..3).each {|i| eval("c#{i} = HP_GCOLOR_#{i}")}
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, gwidth, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,
width, 30)
change_color(hp_color(actor))
draw_text(x+40, y, 100, line_height, actor.hp)
change_color(system_color)
if EHUD::DRAW_LETTERS == true
draw_text(x,y,20,line_height,actor.letter)
end
end
end
end
if EHUD::DRAW_HP_NUMBERS == 2
if EHUD::NEO_ULTIMATE_ACE == false
def draw_actor_hp(actor, x, y, width = 124)
draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
if EHUD::DRAW_LETTERS == true
draw_text(x,y,20,line_height,actor.letter)
end
end
else
def draw_actor_hp(actor, x, y, width = 124)
gwidth = width * actor.hp / actor.mhp
cg = neo_gauge_back_color
c1, c2, c3 = cg[0], cg[1], cg[2]
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, width, HPMP_GAUGE_HEIGHT, c1, c2, c3)
(1..3).each {|i| eval("c#{i} = HP_GCOLOR_#{i}")}
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, gwidth, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,
width, 30)
if EHUD::DRAW_LETTERS == true
draw_text(x,y,20,line_height,actor.letter)
end
end
end
end
def troop_fix
if $game_troop.alive_members.size > 0
@enemy1 = $game_troop.alive_members[0]
end
if $game_troop.alive_members.size > 1
@enemy2 = $game_troop.alive_members[1]
end
if $game_troop.alive_members.size > 2
@enemy3 = $game_troop.alive_members[2]
end
if $game_troop.alive_members.size > 3
@enemy4 = $game_troop.alive_members[3]
end
if $game_troop.alive_members.size > 4
@enemy5 = $game_troop.alive_members[4]
end
if $game_troop.alive_members.size > 5
@enemy6 = $game_troop.alive_members[5]
end
if $game_troop.alive_members.size > 6
@enemy7 = $game_troop.alive_members[6]
end
if $game_troop.alive_members.size > 7
@enemy8 = $game_troop.alive_members[7]
end
end
#########################################################################
#########################################################################
#########################################################################
def enemy_hud
troop_fix
if EHUD::HOVER_BAR == false
if $game_troop.alive_members.size > 0
if @boss_troop == true and @boss_enemy.enemy_id == @enemy1.enemy_id
draw_actor_name(@enemy1,EHUD::BOSS_GAUGEX,0)
draw_actor_hp(@enemy1,EHUD::BOSS_GAUGEX,20,width=EHUD::BOSS_GAUGEW)
draw_actor_icons(@enemy1, EHUD::BOSS_GAUGEX+200, 20, width = 96)
if @enemy1.show_mp[@enemy1.enemy_id]==true
draw_actor_mp(@enemy1,EHUD::BOSS_GAUGEX,30,width=EHUD::BOSS_GAUGEW)
end
else
if @enemy1.hide_hp == true
draw_actor_name(@enemy1,10,0)
else
draw_actor_name(@enemy1,10,0)
draw_actor_hp(@enemy1,10,20,width=96)
if @enemy1.show_mp == true
draw_actor_mp(@enemy1,10,30,width=96)
end
end
end
end
if !$game_switches[EHUD::HIDE_MINIONS]
if $game_troop.alive_members.size > 1
if @boss_troop == true and @boss_enemy.enemy_id == @enemy1.enemy_id
draw_actor_name(@enemy2,10,50)
draw_actor_hp(@enemy2,10,70,width=96)
if @enemy2.show_mp == true
draw_actor_mp(@enemy2,10,80,width=96)
end
else
if @enemy2.hide_hp == true
draw_actor_name(@enemy2,10+125,0)
else
draw_actor_name(@enemy2,10+125,0)
draw_actor_hp(@enemy2,10+125,20,width=96)
if @enemy2.show_mp == true
draw_actor_mp(@enemy2,10+125,20,width=96)
end
end
end
end
if $game_troop.alive_members.size > 2
if @boss_troop == true and @boss_enemy.enemy_id == @enemy1.enemy_id
draw_actor_name(@enemy3,10+125,50)
draw_actor_hp(@enemy3,10+125,70,width=96)
if @enemy3.show_mp == true
draw_actor_mp(@enemy3,10+125,80,width=96)
end
else
if @enemy3.hide_hp == true
draw_actor_name(@enemy3,10+250,0)
else
draw_actor_name(@enemy3,10+250,0)
draw_actor_hp(@enemy3,10+250,20,width=96)
if @enemy3.show_mp == true
draw_actor_mp(@enemy3,10+250,30,width=96)
end
end
end
end
if $game_troop.alive_members.size > 3
if @boss_troop == true and @boss_enemy.enemy_id == @enemy1.enemy_id
draw_actor_name(@enemy4,10+250,50)
draw_actor_hp(@enemy4,10+250,70,width=96)
if @enemy4.show_mp == true
draw_actor_mp(@enemy4,10+250,80,width=96)
end
else
if @enemy4.hide_hp == true
draw_actor_name(@enemy4,10+375,0)
else
draw_actor_name(@enemy4,10+375,0)
draw_actor_hp(@enemy4,10+375,20,width=96)
if @enemy4.show_mp == true
draw_actor_mp(@enemy4,10+375,30,width=96)
end
end
end
end
if $game_troop.alive_members.size > 4
if @boss_troop == true and @boss_enemy.enemy_id == @enemy1.enemy_id
draw_actor_name(@enemy5,10+375,50)
draw_actor_hp(@enemy5,10+375,70,width=96)
if @enemy5.show_mp == true
draw_actor_mp(@enemy5,10+375,80,width=96)
end
else
if @enemy5.hide_hp == true
draw_actor_name(@enemy5,10,50)
else
draw_actor_name(@enemy5,10,50)
draw_actor_hp(@enemy5,10,70,width=96)
if @enemy5.show_mp == true
draw_actor_mp(@enemy5,10,80,width=96)
end
end
end
end
if $game_troop.alive_members.size > 5
if @boss_troop == false
if @enemy6.hide_hp == true
draw_actor_name(@enemy6,10+125,50)
else
draw_actor_name(@enemy6,10+125,50)
draw_actor_hp(@enemy6,10+125,70,width=96)
if @enemy6.show_mp == true
draw_actor_mp(@enemy6,10+125,80,width=96)
end
end
end
end
if $game_troop.alive_members.size > 6
if @boss_troop == false
if @enemy7.hide_hp == true
draw_actor_name(@enemy7,10+250,50)
else
draw_actor_name(@enemy7,10+250,50)
draw_actor_hp(@enemy7,10+250,70,width=96)
if @enemy7.show_mp == true
draw_actor_mp(@enemy7,10+250,80,width=96)
end
end
end
end
if $game_troop.alive_members.size > 7
if @boss_troop == false
if @enemy8.hide_hp == true
draw_actor_name(@enemy8,10+375,50)
else
draw_actor_name(@enemy8,10+375,50)
draw_actor_hp(@enemy8,10+375,70,width=96)
if @enemy8.show_mp == true
draw_actor_mp(@enemy8,10+375,80,width=96)
end
end
end
end
end
else
if $game_troop.alive_members.size > 0
if @boss_troop == true and @boss_enemy.enemy_id == @enemy1.enemy_id
draw_actor_name(@enemy1,EHUD::BOSS_GAUGEX,0)
draw_actor_hp(@enemy1,EHUD::BOSS_GAUGEX,20,width=EHUD::BOSS_GAUGEW)
draw_actor_icons(@enemy1,EHUD::BOSS_GAUGEX+200,0, width = 96)
if @enemy1.show_mp == true
draw_actor_mp(@enemy1,EHUD::BOSS_GAUGEX,30,width=EHUD::BOSS_GAUGEW)
end
elsif !$game_switches[EHUD::HIDE_MINIONS]
if @enemy1.hide_hp == true
#blank
else
draw_actor_hp(@enemy1,@enemy1.screen_x-50,@enemy1.screen_y-50,width=96)
if @enemy1.show_mp == true
draw_actor_mp(@enemy1,@enemy1.screen_x-50,@enemy1.screen_y-40,width=96)
end
end
end
end
if !$game_switches[EHUD::HIDE_MINIONS]
if $game_troop.alive_members.size > 1
if @enemy2.hide_hp == true
#blank
else
draw_actor_hp(@enemy2,@enemy2.screen_x-50,@enemy2.screen_y-50,width=96)
if @enemy2.show_mp == true
draw_actor_mp(@enemy2,@enemy2.screen_x-50,@enemy2.screen_y-40,width=96)
end
end
end
if $game_troop.alive_members.size > 2
if @enemy3.hide_hp == true
#blank
else
draw_actor_hp(@enemy3,@enemy3.screen_x-50,@enemy3.screen_y-50,width=96)
if @enemy3.show_mp == true
draw_actor_mp(@enemy3,@enemy3.screen_x-50,@enemy3.screen_y-40,width=96)
end
end
end
if $game_troop.alive_members.size > 3
if @enemy4.hide_hp == true
#blank
else
draw_actor_hp(@enemy4,@enemy4.screen_x-50,@enemy4.screen_y-50,width=96)
if @enemy4.show_mp == true
draw_actor_mp(@enemy4,@enemy4.screen_x-50,@enemy4.screen_y-40,width=96)
end
end
end
if $game_troop.alive_members.size > 4
if @enemy5.hide_hp == true
#blank
else
draw_actor_hp(@enemy5,@enemy5.screen_x-50,@enemy5.screen_y-50,width=96)
if @enemy5.show_mp == true
draw_actor_mp(@enemy5,@enemy5.screen_x-50,@enemy5.screen_y-40,width=96)
end
end
end
if $game_troop.alive_members.size > 5
if @enemy6.hide_hp == true
#blank
else
draw_actor_hp(@enemy6,10+125,70,width=96)
if @enemy6.show_mp == true
draw_actor_mp(@enemy6,10+125,80,width=96)
end
end
end
if $game_troop.alive_members.size > 6
if @enemy7.hide_hp == true
#blank
else
draw_actor_hp(@enemy7,10+250,70,width=96)
if @enemy7.show_mp == true
draw_actor_mp(@enemy7,10+250,80,width=96)
end
end
end
if $game_troop.alive_members.size > 7
if @enemy8.hide_hp == true
#blank
else
draw_actor_hp(@enemy8,10+375,70,width=96)
if @enemy8.show_mp == true
draw_actor_mp(@enemy8,10+375,80,width=96)
end
end
end
end
end
end
def refresh
contents.clear
enemy_hud
# @old_size = $game_troop.alive_members.size
# if @old_size < 5 and @boss_troop == false
# self.height = 80
# end
end
def update
# assume no refresh needed
refresh_okay = false
# loop through remaining enemies one at a time - each enemy is put into the temporary variable called 'enemy'
$game_troop.alive_members.each do |enemy|
# have the hp or mp changed since last time?
if enemy.hp != enemy.old_hp || enemy.mp != enemy.old_mp
# we do need to update the hud
refresh_okay = true
# and replace the old values with the current values
enemy.old_hp = enemy.hp
enemy.old_mp = enemy.mp
end
end
if $game_troop.alive_members.size != @old_size
refresh_okay = true
end
if @boss_enemy != nil
if @enemy1.enemy_id == @boss_enemy.enemy_id
@boss_troop = true
else
@boss_troop = false
end
end
if refresh_okay
refresh
end
end
end
if EHUD::DELAY == true
class Window_BattleLog
alias enemy_hud_battle_log_wait wait_and_clear
def wait_and_clear
wait while @num_wait < EHUD::WINDOW_WAIT if line_number > 0
clear
end
end
end
#Show the window on the map
class Scene_Battle < Scene_Base
alias original_create_all_windows create_all_windows
def create_all_windows
original_create_all_windows
create_enemy_hud_window
end
def create_enemy_hud_window
@enemy_hud_window = Window_Enemy_Hud.new
end
end
#########################################################################
#End Of Script #
#########################################################################[/php]
[php]#===============================================================================
#
# Neo Gauge Ultimate Ace (1.1a)
# 21/02/2012
# Ported to Ace by Pacman (original script by Woratana and edited by Pacman)
# This script changes the way gauges are drawn. This script supports drawing
# gauges horizontally and vertically, uses a 3-colour gradient, has a very
# simple setup and two brilliant methods to change the bitmap.
# Note that much of this work is Woratana's, you should credit him the same as
# (if not more than) me. I do not claim writing this script entirely, I edited
# the VX version a while back, and this is the VXA port of that.
#
# Detailed instructions on the configuration are below.
#
#===============================================================================
class Window_Base < Window # DO NOT TOUCH THIS
#==========================================================================
# NEO GAUGE SETTING #
# Color: Color.new(Red, Green, Blue) # Each number you can put integer 0-255
# * You can use this site to get RGB color:
# http://web.njit.edu/~kevin/rgb.txt.html
#==========================================================================
GAUGE_GLOW_EFFECT = true # Use glow effect?
GAUGE_GLOW_COLOR = Color.new(0,0,0) # Glow color
GAUGE_OUTSIDE_BORDER = true # Use outside border?
GAUGE_OUTSIDE_BORDER_COLOR = Color.new(255,255,255)
GAUGE_OUTSIDE_BORDER_COLOR2 = Color.new(255,255,255)
GAUGE_CLEAR_CORNER_OUTSIDE_BORDER = true
GAUGE_INSIDE_BORDER = false # Use inside border?
GAUGE_INSIDE_BORDER_COLOR = Color.new(255, 255, 255)
GAUGE_INSIDE_BORDER_COLOR2 = Color.new(0, 0, 0)
#=============================================================
# NEO HP/MP/TP/STATS GAUGE SETTING #
#=============================================================
# Note: The HPMP options also apply to the TP gauge.
HPMP_GAUGE_HEIGHT = 8 # gauge height (minumum: 6)
# Recommend to use HPMP_GAUGE_HEIGHT at least 8,
# if you're using GAUGE_INSIDE_BORDER in Neo-Gauge
HPMP_GAUGE_X_PLUS = 0 # Move gauge horizontally (+,-)
HPMP_GAUGE_Y_PLUS = ((-1)*(HPMP_GAUGE_HEIGHT - 6)) # (+,-)
# Change '((-1)*(HPMP_GAUGE_HEIGHT - 6))' to number to move gauge vertically
# BACK GAUGE COLORS
BACK_GCOLOR_1 = Color.new(0, 0, 0) # Black [Color1]
BACK_GCOLOR_2 = Color.new(100, 100, 100) # Dark Gray [Color2]
BACK_GCOLOR_3 = Color.new(200, 200, 200) # Light Gray [Color3]
USE_HP_GAUGE = true # Use HP Gauge? (true/false)
USE_MP_GAUGE = true # Use MP Gauge?
USE_TP_GAUGE = true # Use TP Gauge?
USE_STATS_GAUGE = true # Use Attack/Defense/Spirit/Agility/Luck Gauge?
# HP GAUGE COLORS
HP_GCOLOR_1 = Color.new(139,0,0) # Dark Red
HP_GCOLOR_2 = Color.new(255,0,0) # Pure Red
HP_GCOLOR_3 = Color.new(255,193,37) # Goldenrod
# MP GAUGE COLORS
MP_GCOLOR_1 = Color.new(0,0,128) # Dark Blue
MP_GCOLOR_2 = Color.new(0,191,255) # Blue
MP_GCOLOR_3 = Color.new(46,139,87) # Light Green
# TP GAUGE COLORS
TP_GCOLOR_1 = Color.new(0, 100, 0) # Dark Green
TP_GCOLOR_2 = Color.new(191, 255, 0) # Lime Green
TP_GCOLOR_3 = Color.new(173, 255, 47) # Yellow Green
# STAT GAUGE COLORS
STAT_GCOLOR_1 = Color.new(0,0,128)
STAT_GCOLOR_2 = Color.new(0,191,255)
STAT_GCOLOR_3 = Color.new(152,251,152)
#===============================================================================
#
# END CONFIGURATION
#
#===============================================================================
#==============================================================================
# ■ Window_Base
#
# ゲーム中の全てのウィンドウのスーパークラスです。
#==============================================================================
#
# * Get Gauge Back Colours
#
def neo_gauge_back_color
return BACK_GCOLOR_1, BACK_GCOLOR_2, BACK_GCOLOR_3
end
#
if USE_HP_GAUGE
#
# * Draw Actor HP
#
def draw_actor_hp(actor, x, y, width = 124)
gwidth = width * actor.hp / actor.mhp
cg = neo_gauge_back_color
c1, c2, c3 = cg[0], cg[1], cg[2]
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, width, HPMP_GAUGE_HEIGHT, c1, c2, c3)
(1..3).each {|i| eval("c#{i} = HP_GCOLOR_#{i}")}
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, gwidth, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,
width, 30)
change_color(system_color)
draw_text(x, y, 30, line_height, Vocab::hp_a)
draw_current_and_max_values(x, y, width, actor.hp, actor.mhp,
hp_color(actor), normal_color)
end
#
end
if USE_MP_GAUGE
#
# * Draw Actor MP
#
def draw_actor_mp(actor, x, y, width = 124)
gwidth = width * actor.mp / [actor.mmp, 1].max
cg = neo_gauge_back_color
c1, c2, c3 = cg[0], cg[1], cg[2]
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, width, HPMP_GAUGE_HEIGHT, c1, c2, c3)
(1..3).each {|i| eval("c#{i} = MP_GCOLOR_#{i}")}
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, gwidth, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,
width, 40)
change_color(system_color)
draw_text(x, y, 30, line_height, Vocab::mp_a)
draw_current_and_max_values(x, y, width, actor.mp, actor.mmp,
mp_color(actor), normal_color)
end
#
end
if USE_TP_GAUGE
#
# * Draw Actor TP
#
def draw_actor_tp(actor, x, y, width = 124)
gwidth = width * actor.tp / 100
cg = neo_gauge_back_color
c1, c2, c3 = cg[0], cg[1], cg[2]
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, width, HPMP_GAUGE_HEIGHT, c1, c2, c3)
(1..3).each {|i| eval("c#{i} = TP_GCOLOR_#{i}")}
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, gwidth, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,
width, 40)
change_color(system_color)
draw_text(x, y, 30, line_height, Vocab::tp_a)
change_color(tp_color(actor))
draw_text(x + width - 42, y, 42, line_height, actor.tp.to_i, 2)
end
#
end
if USE_STATS_GAUGE
#
# * Draw Actor Stats
#
def draw_actor_param(actor, x, y, param_id)
param_name = Vocab::param(param_id)
param_value = actor.param(param_id)
param_max = actor.neo_param_max(param_id)
width = 156
gwidth = width * param_value / [param_max, 1].max
cg = neo_gauge_back_color
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, width, HPMP_GAUGE_HEIGHT, cg[0], cg[1], cg[2])
c1, c2, c3 = STAT_GCOLOR_1, STAT_GCOLOR_2, STAT_GCOLOR_3
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, gwidth, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,
width, 40)
change_color(system_color)
draw_text(x, y, 120, line_height, param_name)
change_color(normal_color)
draw_text(x + 120, y, 36, line_height, param_value, 2)
end
#
end
#
# * Draw Neo Gauge
# c1, c2, c3 : 3 Colours in the gradient
# vert : Whether the gauge is vertical or not.
# outline : Draw an outline of the gauge?
# max_width : Maximum width the gauge can reach.
# c2_spot : Point where the second colour is drawn.
#
def draw_neo_gauge(x, y, width, height, c1, c2, c3, vert = false,
outline = true, max_width = nil, c2_spot = 50)
if max_width.nil? # Get Max Width
max_width = vert ? height : width
end
glow = GAUGE_GLOW_EFFECT
dx = x; dy = y
x = y = 0
bitmap = Bitmap.new(max_width, height)
if glow # If drawing glow
if outline # If drawing outline
if vert; rect = Rect.new(x, y, width, max_width) # Make vertical gauge
else; rect = Rect.new(x, y, max_width, height) # Make horizontal gauge
end
bitmap.fill_rect(rect, GAUGE_GLOW_COLOR) # Make glow
bitmap.neo_clear_corner(rect.x, rect.y, rect.width, rect.height) # Clear
else # No outline
height -= 2; width -= 2; x += 1; y += 1
if GAUGE_INSIDE_BORDER
height -= 2; width -= 2; x += 1; y += 1
end
end
end
#
# I'm not going to comment every line. There's a lot of stuff here. It may
# look daunting, but it's actually not that diffciult to get your head
# around. If you really want to figure this all out, just look at it a lot.
# Failing that, you could probably just ask a more experienced scripter or
# myself.
#
if vert
if glow; gx = gx2 = x + 1; gy = y
else; gx = gx2 = x; gy = y
end
gy2 = gy - 1 + ((c2_spot * max_width) / 100)
gw = gw2 = width - 2; gh = ((c2_spot * max_width) / 100)
gh2 = max_width - gh - 2
bitmap.gradient_fill_rect(gx, gy, gw, gh, c1, c2, true)
bitmap.gradient_fill_rect(gx2, gy2, gw2, gh2, c2, c3, true)
gh = (gh + gh2)
else
if glow; gx = x; gy = gy2 = y
gx = x + 1; gy = gy2 = y + 1
else; gx = x; gy = gy2 = y
end
gx2 = gx - 1 + ((c2_spot * max_width) / 100)
gw = ((c2_spot * max_width) / 100); gh = gh2 = (height - 2)
gw2 = max_width - gw - 2
bitmap.gradient_fill_rect(gx, gy, gw, gh, c1, c2)
bitmap.gradient_fill_rect(gx2, gy2, gw2, gh2, c2, c3)
gw = (gw + gw2)
end
if outline
if GAUGE_OUTSIDE_BORDER
bitmap.draw_neo_border(gx, gy, gw, gh, GAUGE_OUTSIDE_BORDER_COLOR,
GAUGE_OUTSIDE_BORDER_COLOR2)
if GAUGE_CLEAR_CORNER_OUTSIDE_BORDER
bitmap.neo_clear_corner(gx, gy, gw, gh)
end
end
if GAUGE_INSIDE_BORDER
gx += 1; gy += 1; gw -= 2; gh -= 2
bitmap.draw_neo_border(gx, gy, gw, gh, GAUGE_INSIDE_BORDER_COLOR,
GAUGE_INSIDE_BORDER_COLOR2)
end
end
rect = Rect.new(0, 0, width, bitmap.height)
self.contents.blt(dx, dy, bitmap, rect)
bitmap.dispose
end
end
#==============================================================================
# ■ Bitmap
#
# かわいいですね。
#==============================================================================
class Bitmap
#
# * Draw border of Neo Gauge
#
def draw_neo_border(x, y, width, height, color, color2 = color, size = 1)
gradient_fill_rect(x, y, width, size, color, color2)
fill_rect(x, y, size, height, color)
fill_rect(x + width - size, y, size, height, color2)
gradient_fill_rect(x, y + height - size, width, size, color, color2)
end
#
# * Clear Corner of Neo Gauge
#
def neo_clear_corner(x, y, width, height, size = 1)
clear_rect(x, y, size, size)
clear_rect(x + width - size, y, size, size)
clear_rect(x, y + height - size, size, size)
clear_rect(x + width - size, y + height - size, size, size)
end
end
#==============================================================================
# ■ Game_Battler
#
# スプライトや行動に関するメソッドを追加したバトラーのクラスです。このクラス
# は Game_Actor クラスと Game_Enemy クラスのスーパークラスとして使用されます。
#==============================================================================
class Game_Battler < Game_BattlerBase
#
# * Get class (simpler method)
#
def klass
self.class if self.is_a?(Game_Actor)
end
#
# * Get Neo Parameter Max
#
def neo_param_max(param_id)
case param_id
when 2; maxatk
when 3; maxdef
when 4; maxspi
when 5; maxmdef
when 6; maxagi
when 7; maxluk
end
end
#
# * Max attack
#
def maxatk
n = atk
if self.is_a?(Game_Actor)
n = n - klass.params[2, @level] + klass.params[2, 99]
end
return n
end
#
# * Max defense
#
def maxdef
n = atk
if self.is_a?(Game_Actor)
n = n - klass.params[3, @level] + klass.params[3, 99]
end
return n
end
#
# * Max magic
#
def maxspi
n = atk
if self.is_a?(Game_Actor)
n = n - klass.params[4, @level] + klass.params[4, 99]
end
return n
end
#
# * Max magic defense
#
def maxmdef
n = atk
if self.is_a?(Game_Actor)
n = n - klass.params[5, @level] + klass.params[5, 99]
end
return n
end
#
# * Max agility
#
def maxagi
n = atk
if self.is_a?(Game_Actor)
n = n - klass.params[6, @level] + klass.params[6, 99]
end
return n
end
#
# * Max luck
#
def maxluk
n = atk
if self.is_a?(Game_Actor)
n = n - klass.params[7, @level] + klass.params[7, 99]
end
return n
end
end
$imported ||= {}
$imported[:neo_gauge_ultimate]
#===============================================================================
#
# END OF SCRIPT
#
#===============================================================================[/php]
Screen lấy mẫu từ game của mình đang làm luôn


Nhớ credit tên tác giả
script 1 là của Jet10985(Jet)
script 2 là của Ventwig
còn script thứ 3 ko ghi trong script thì chịu
:D
[php]#===============================================================================
# Jet's Viewed Battle System
# By Jet10985(Jet)
#===============================================================================
# This script will add actor sprites into the battle scene.
# This script has: 10 customization options.
#===============================================================================
# Overwritten Methods:
# Game_Actor: use_sprite?, screen_x, screen_y
# Sprite_Battler: revert_to_normal
# Scene_Battle: show_attack_animation
#
# Aliased methods:
# Game_Enemy: screen_x, screen_y
# Sprite_Battler: update_origin, update_bitmap
# Window_BattleEnemy: update
# Window_BattleActor: update
# Window_ActorCommand: update
#===============================================================================
=begin
Set an enemy's attack animation by using this in their notebox:
<anim: 50>
Replace 50 with the animation id.
You may use a sprite for a monster instead of a regular battler by using this
notetag in the monster's notebox:
<sprite: ImageName, 0>
Replace ImageName with the name of the spritesheet, and 0 with the index on the
spritesheet you want the monster to use.
=end
module Jet
module VBS
# Which direction do actors face on the field? There are 4 options:
# :up, :down, :left, or :right. Actor's will direction chosen.
ACTOR_ORIENTATION = :left
# This will make it so actor's are centered on the screen instead of being
# placed in pre-determined lines using START_POINT and SPACE_DIFFERENCE.
CENTER_ACTORS = true
# This is the x and y starting point for actors. This option may take one of
# 2 functions. If CENTER_ACTORS is true, and ACTOR_ORIENTATION is either
# :left, or :right, then only the x value will be used as where to center
# the actors. If it is :down or :up, only the y value will be used.
# If CENTER_ACTORS is false, then this is where actor's will begin to be
# placed on screen.
START_POINT = [400, 250]
# This is how much space is between each actor on the field.
SPACE_DIFFERENCE = 50
# If you're using the :left or :right view, this will push each
# subsequent actor back by a certain number of pixels, to avoid having
# a straight line.
SIDEVIEW_PUSH_BACK = 16
# Do you want to reverse the direction and field during an ambush?
# (This is when enemies surprise the player and get the first turn)
REVERSE_FIELD_FOR_AMBUSH = true
# this is how far the actor will move forward when they are selection an
# action, as well as executing it.
SLIDE_AMOUNT = 66
# This is how far the actor will slide each frame until they reach their
# goal of SLIDE_FORWARD. Best used when this is a factor of SLIDE_FORWARD.
FRAME_SLIDE = 6
# During selecting an actor command, and during selecting an enemy target,
# would you like the selected character to flash?
DO_FLASH = true
# These are state-based sprite changes. If the actor has one of these states
# then the game will search for a sprite of the character's regular sprite
# name with the special state tag appended to it. So if Jimmy's sprite
# name was $Jimmy, and he had poison inflcted on him, and poison's id was
# listed here as ["_poison", 0], it would change Jimmy's in-battle sprite
# to $Jimmy_poison at the first sprite index.
STATE_SPRITES = {
1 => ["", 0],
2 => ["", 0]
}
# Do not touch this option.
DIR_ORIENT = {right: 6, left: 4, down: 2, up: 8}[ACTOR_ORIENTATION]
end
end
#===============================================================================
# DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.
#===============================================================================
class Integer
def even?
self % 2 == 0
end
def odd?
!even?
end
end
class RPG::Enemy
def animation
(f = note.match(/<anim:[ ]*(\d+)>/i)) ? f[1].to_i : 1
end
def battle_sprite
(f = note.match(/<sprite:[ ]*(.+),[ ]*(\d+)>/i)) ? f[1..2] : false
end
end
module BattleManager
class << self
alias jet3845_on_encounter on_encounter
def on_encounter(*args, &block)
jet3845_on_encounter(*args, &block)
@true_surprise = @surprise
end
end
def self.true_surprise
@true_surprise ||= false
end
def self.player_dir
if @true_surprise && Jet::VBS::REVERSE_FIELD_FOR_AMBUSH
return 10 - Jet::VBS::DIR_ORIENT
else
return Jet::VBS::DIR_ORIENT
end
end
end
class Game_Actor
def use_sprite?
true
end
def screen_x
if [8, 2].include?(BattleManager.player_dir)
if Jet::VBS::CENTER_ACTORS
x = Graphics.width / 2
x -= 16
x += Jet::VBS::SPACE_DIFFERENCE / 2 if $game_party.members.size.even?
x -= ($game_party.members.size / 2 - index) * Jet::VBS::SPACE_DIFFERENCE
return x
else
return Jet::VBS::START_POINT[0] + Jet::VBS::SPACE_DIFFERENCE * index
end
end
return Jet::VBS::START_POINT[0]
end
alias jet3745_screen_x screen_x
def screen_x(*args, &block)
x = jet3745_screen_x(*args, &block)
case BattleManager.player_dir
when 4
x += Jet::VBS::SIDEVIEW_PUSH_BACK * index
when 6
x -= Jet::VBS::SIDEVIEW_PUSH_BACK * index
end
return x if !Jet::VBS::REVERSE_FIELD_FOR_AMBUSH
x = Graphics.width - x if BattleManager.true_surprise && [6, 4].include?(BattleManager.player_dir)
x
end
def screen_y
if [6, 4].include?(BattleManager.player_dir)
if Jet::VBS::CENTER_ACTORS
y = Graphics.height / 2
y -= 16
y += Jet::VBS::SPACE_DIFFERENCE / 2 if $game_party.members.size.even?
y -= ($game_party.members.size / 2 - index) * Jet::VBS::SPACE_DIFFERENCE
return y
else
return Jet::VBS::START_POINT[1] + Jet::VBS::SPACE_DIFFERENCE * index
end
end
return Jet::VBS::START_POINT[1]
end
alias jet3745_screen_y screen_y
def screen_y(*args, &block)
y = jet3745_screen_y(*args, &block)
return y if !Jet::VBS::REVERSE_FIELD_FOR_AMBUSH
y = Graphics.height - y if BattleManager.true_surprise && [8, 2].include?(BattleManager.player_dir)
y
end
def screen_z
101 + index
end
alias jet3745_character_name character_name
def character_name(*args, &block)
name = jet3745_character_name(*args, &block)
return name unless SceneManager.scene_is?(Scene_Battle)
states.sort {|a, b| b.priority <=> a.priority }.each {|a|
if (add = Jet::VBS::STATE_SPRITES[a.id])
return name + add[0]
end
}
return name
end
alias jet3745_character_index character_index
def character_index(*args, &block)
index = jet3745_character_index(*args, &block)
return index unless SceneManager.scene_is?(Scene_Battle)
states.sort {|a, b| b.priority <=> a.priority }.each {|a|
if (add = Jet::VBS::STATE_SPRITES[a.id])
return index + add[1]
end
}
return index
end
end
class Game_Enemy
alias jet3745_screen_x screen_x
def screen_x(*args, &block)
x = jet3745_screen_x(*args, &block)
return x if !Jet::VBS::REVERSE_FIELD_FOR_AMBUSH
x = Graphics.width - x if BattleManager.true_surprise && [6, 4].include?(BattleManager.player_dir)
x
end
alias jet3745_screen_y screen_y
def screen_y(*args, &block)
y = jet3745_screen_y(*args, &block)
return y if !Jet::VBS::REVERSE_FIELD_FOR_AMBUSH
y = Graphics.height - y if BattleManager.true_surprise && [8, 2].include?(BattleManager.player_dir)
y
end
def atk_animation_id1
enemy.animation
end
def atk_animation_id2
0
end
def bat_sprite?
!!enemy.battle_sprite
end
def character_name
enemy.battle_sprite[0]
end
def character_index
enemy.battle_sprite[1].to_i
end
alias jet3745_character_name character_name
def character_name(*args, &block)
name = jet3745_character_name(*args, &block)
return name unless SceneManager.scene_is?(Scene_Battle)
states.sort {|a, b| b.priority <=> a.priority }.each {|a|
if (add = Jet::VBS::STATE_SPRITES[a.id])
return name + add[0]
end
}
return name
end
alias jet3745_character_index character_index
def character_index(*args, &block)
index = jet3745_character_index(*args, &block)
return index unless SceneManager.scene_is?(Scene_Battle)
states.sort {|a, b| b.priority <=> a.priority }.each {|a|
if (add = Jet::VBS::STATE_SPRITES[a.id])
return index + add[1]
end
}
return index
end
end
class Sprite_Battler
alias jet3835_update_bitmap update_bitmap
def update_bitmap(*args, &block)
if @battler.actor? || @battler.bat_sprite?
actor_update_bitmap
elsif @battler.enemy?
jet3835_update_bitmap(*args, &block)
end
end
def actor_update_bitmap
@timer ||= 0
@index ||= 1
@char_index ||= @battler.character_index
@back_time ||= false
index = @index
char_index = @char_index
@timer += 1
(@index += (@back_time ? -1 : 1); @timer = 0) if @timer == 19
if @index == 3
@back_time = true
@index = 1
elsif @index == -1
@back_time = false
@index = 1
end
@char_index = @battler.character_index
bitmap = Cache.character(@battler.character_name)
return if bitmap == @bitmap && index == @index && @char_index == char_index
self.bitmap = bitmap
sign = @battler.character_name[/^[\!\$]./]
if sign && sign.include?('$')
cw = bitmap.width / 3
ch = bitmap.height / 4
else
cw = bitmap.width / 12
ch = bitmap.height / 8
end
dir = BattleManager.player_dir
dir = 10 - dir if @battler.is_a?(Game_Enemy)
sx = (@battler.character_index % 4 * 3) * cw + (cw * @index)
sy = (@battler.character_index / 4 * 4 + (dir - 2) / 2) * ch
self.src_rect.set(sx, sy, cw, ch)
end
alias jet3745_update_origin update_origin
def update_origin(*args, &block)
if @battler.actor? || @battler.bat_sprite?
actor_update_origin
elsif @battler.enemy?
jet3745_update_origin(*args, &block)
end
end
def actor_update_origin
self.ox = (@actor_ox ||= 0)
self.oy = (@actor_oy ||= 0)
end
def revert_to_normal
self.blend_type = 0
self.color.set(0, 0, 0, 0)
self.opacity = 255
if bitmap && @battler && !@battler.actor? && !@battler.bat_sprite?
self.ox = bitmap.width / 2 if bitmap
self.src_rect.y = 0
end
end
def slide_forward(amount = Jet::VBS::SLIDE_AMOUNT, frame = Jet::VBS::FRAME_SLIDE)
dir = BattleManager.player_dir
dir = 10 - dir if @battler.is_a?(Game_Enemy)
case dir
when 2
affect = :@actor_oy
frame *= -1
when 4
affect = :@actor_ox
amount *= -1
when 6
affect = :@actor_ox
frame *= -1
when 8
affect = :@actor_oy
amount *= -1
end
orig_amount = amount
until (orig_amount < 0 ? amount >= 0 : amount <= 0)
instance_variable_set(affect, instance_variable_get(affect) + frame)
amount += frame
SceneManager.scene.spriteset.update
Graphics.update
end
end
def slide_backward(amount = Jet::VBS::SLIDE_AMOUNT, frame = Jet::VBS::FRAME_SLIDE)
dir = BattleManager.player_dir
dir = 10 - dir if @battler.is_a?(Game_Enemy)
case dir
when 2
affect = :@actor_oy
amount *= -1
when 4
affect = :@actor_ox
frame *= -1
when 6
affect = :@actor_ox
amount *= -1
when 8
affect = :@actor_oy
frame *= -1
end
orig_amount = amount
until (orig_amount < 0 ? amount >= 0 : amount <= 0)
instance_variable_set(affect, instance_variable_get(affect) + frame)
amount += frame
SceneManager.scene.spriteset.update
Graphics.update
end
end
end
class Scene_Battle
attr_reader :spriteset
def show_attack_animation(targets)
show_normal_animation(targets, @subject.atk_animation_id1, false)
show_normal_animation(targets, @subject.atk_animation_id2, true)
end
alias jet3746_use_item use_item
def use_item(*args, &block)
sprite = @spriteset.battler_to_sprite(@subject)
if (@subject.actor? || @subject.bat_sprite?) && !@subject.current_action.guard?
sprite.slide_forward
end
jet3746_use_item(*args, &block)
if (@subject.actor? || @subject.bat_sprite?) && !@subject.current_action.guard?
sprite.slide_backward
end
end
end
class Spriteset_Battle
def battler_to_sprite(actor)
battler_sprites.each {|a|
return a if a.battler == actor
}
return false
end
end
class Window_BattleEnemy
alias jet3745_update update
def update(*args, &block)
jet3745_update(*args, &block)
if self.active && Jet::VBS::DO_FLASH
if Object.const_defined?(:Mouse)
$game_troop.alive_members.each {|a|
img = SceneManager.scene.spriteset.battler_to_sprite(a)
x = img.x - img.ox
y = img.y - img.oy
if Mouse.area?(x, y, img.src_rect.width, img.src_rect.height)
self.index = a.index
end
}
end
active_troop = $game_troop.alive_members[@index]
sprite = SceneManager.scene.spriteset.battler_to_sprite(active_troop)
sprite.start_effect(:whiten) if !sprite.effect?
end
end
end
class Window_BattleActor
alias jet3745_update update
def update(*args, &block)
jet3745_update(*args, &block)
if self.active && Jet::VBS::DO_FLASH
if Object.const_defined?(:Mouse)
$game_party.alive_members.each {|a|
img = SceneManager.scene.spriteset.battler_to_sprite(a)
x = img.x - img.ox
y = img.y - img.oy
if Mouse.area?(x, y, img.src_rect.width, img.src_rect.height)
self.index = a.index
end
}
end
active_troop = $game_party.members[@index]
sprite = SceneManager.scene.spriteset.battler_to_sprite(active_troop)
sprite.start_effect(:whiten) if !sprite.effect?
end
end
end
class Window_ActorCommand
alias jet3745_update update
def update(*args, &block)
jet3745_update(*args, &block)
if self.active && Jet::VBS::DO_FLASH
active_troop = @actor
sprite = SceneManager.scene.spriteset.battler_to_sprite(active_troop)
sprite.start_effect(:whiten) if !sprite.effect?
end
end
end
class Game_Action
def guard?
item == $data_skills[subject.guard_skill_id]
end
end[/php]
Có thể kết hợp thêm cái này để hiện HP Enemy ( chân thành cám ơn finalholylight giới thiệu )
[php]#============================================================================
#VTS Enemy HP Bars
#By Ventwig
#Version 1.7 - May 24 2013
#For RPGMaker VX Ace
#============================================================================
# Here's another window-ish thing to show HP

# Thanks Shaz for helping me out with this one :D
# Thanks ItsKouta for showing me a horrible bug!
# Thanks to #tag-this for helping with the hide numbers option!
# Thanks Helladen for pointing out a small error!
# Thanks Ulises for helping with the hurdle of not having RMVXA with me!
# Thanks estriole, Tsukihime, and selchar for help with notetags!
# Thanks Everyone for your suppourt & suggestions!
#=============================================================================
# Description:
# This code shows the name, HP, and MP for up to 8 enemies at once.
# Plug'N'Play and the HP bar updates after every hit/kill.
# You can also set it so the numbers are hidden! Oooh!
# Long boss bars, "hidden minions", and hover-over-battler bars are available
# features! Yaaaaay!
# Super cool: BARS CAN HOVER OVER THE ENEMY!
# Options to scan enemies or show states will be added.
#==============================================================================
# Compatability:
# alias-es Game_Enemy and Scene_Battle
# Works with Neo Gauge Ultimate Ace (Recommended)
#===============================================================================
# Instructions: Put in materials, above main. Almost Plug and Play
# Put above Neo Gauge Ultimate Ace if used
#==============================================================================
# Please give Credit to Ventwig if you would like to use one of my scripts
# in a NON-COMMERCIAL project.
# Please ask for permission if you would like to use it in a commercial game.
# You may not re-distribute any of my scripts or claim as your own.
# You may not release edits without permission, combatability patches are okay.
#===============================================================================
#Notetags
#==============================================================================
#<hide_hp>
#<show_mp>/<hide_mp>
#<boss_bar>
#==============================================================================
#Mix and match the three notetags! They're pretty much self-explanatory.
#<hide_hp> stops hp from being shown
#<show_mp> shows an mp bar, if REVERSE_MP below is set to false.
#<hide_mp> hides the mp bar, if REVERSE_MP is true.
# If reverse_mp is false, enemies have hidden mp by default. If true,
# then they normally have mp shown. Please use the right one.
#<boss_bar> sets the enemy to a boss, using the long bar (A BOSS MUST BE THE
# FIRST ENEMY IN THE TROOP OR ELSE EVERYTHING GOES WHACK)
#==============================================================================
module EHUD
#====================================================================
#Breakthrough point! You can now choose to place the bar right where
#the enemy's battler is! But if you liked the old version, it's still
#there!
#TRUE means that the bar will hover over, like a cool new version.
#FALSE will keep all the normal info at the top.
#==============================================================
#TRUE still has the boss bar at the top, too!
#==============================================================
HOVER_BAR = true
#Changes how far down the bars are in non-hover mode Recommended 20.
WINDOW_Y = 20
#Want to show mp for most enemies but don't want to bother putting all the
#noteatags? Turn this to true and show_mp turns into hide_mp and will actually
#HIDE the mp with mp always showing by default
REVERSE_MP = false
#Toggles whether or not a delay will be added after each attack so that the
#player can see the current hp/changes
DELAY = false
#Number, choose how long to wait between attacks (to let the player look
#at the HP bars. Recommended 4-6
#Only works if above is set to true
WINDOW_WAIT = 5
#Decides whether or not to show the HP numbers/etc/etc.
#0 means normal (HP name, current and max hp)
#1 means just show HP amount, not the word, nor the max
#2 means just the bar <RECOMMENDED>
DRAW_HP_NUMBERS = 2
#DRAW_LETTERS sets whether or not the script should draw the letters
#for the enemy in case there's multiple enemies, such as
#"Slime A" and "Slime B". This is recommended only for hover bars
#to make knowing who to target easy. It just looks clunky when the name is
#already shown.
DRAW_LETTERS = true
#Selects whether or not you have Neo Gauge Ultimate Ace.
#If it is set to true, this doesnt matter, if it's false,
#make sure you have it right!!!
NEO_ULTIMATE_ACE = true
#These settings make it compatible with my "Nova Battle Display" system!
#Play around with the numbers, but I've provided recommended "Nova" settings
#Change the X value of the bar. Def: 0 Nova:150
BOSS_GAUGEX = 0
#How long the boss gauge should be. Def: 475 Nova:325
BOSS_GAUGEW = 475
#Determines whether or not the minions' HP will still be shown even
#in a boss battle!
#This is determined via a switch, so you can toggle per boss!
#ON=HIDE
#OFF=SHOW
#The thing about this switch, though, is that you have to toggle it MANUALLY
#everytime you want to change it. So before a boss fight, turn it on.
#After, turn it back off.
#THIS DOES NOT HAVE TO BE USED WITH JUST BOSSES
HIDE_MINIONS = 1
end
#module RPG
class RPG::BaseItem
def show_mp
if @show_mp.nil?
if EHUD::REVERSE_MP == false
if @note =~ /<show_mp>/i
@show_mp= true
end
else
if @note =~ /<hide_mp>/i
@show_mp= false
else
@show_mp = true
end
end
end
@show_mp
end
def hide_hp
if @hide_hp.nil?
if @note =~ /<hide_hp>/i
@hide_hp = true
else
@hide_hp = false
end
end
@hide_hp
end
def boss_bar
if @boss_bar.nil?
if @note =~ /<boss_bar>/i
@boss_bar= true
else
@boss_bar = false
end
end
@boss_bar
end
end
#end
class Game_Enemy < Game_Battler
#
# * Method Aliases
#
alias shaz_enemyhud_initialize initialize
#
# * Public Instance Variables
#
attr_accessor :old_hp # hp on last hud refresh
attr_accessor :old_mp # mp on last hud refresh
#
# * Object Initialization
#
def initialize(index, enemy_id)
shaz_enemyhud_initialize(index, enemy_id)
@old_hp = mhp
@old_mp = mmp
end
def boss_bar
return enemy.boss_bar
end
def show_mp
return enemy.show_mp
end
def hide_hp
return enemy.hide_hp
end
end
class Window_Enemy_Hud < Window_Base
###################################################################
#Sets up what appears in the HUD
#Questions names and HUD, then displays them
#################################################################
#Set up the window's start-up
def initialize
#Draws window
super(0,EHUD::WINDOW_Y,545,400) #h=130
self.opacity = 0
self.arrows_visible = false
self.z = 0
@x, @y = 5, 50
troop_fix
if @enemy1.boss_bar == true
@boss_troop = true
@boss_enemy = @enemy1
else
@boss_troop = false
@boss_enemy = nil
end
enemy_hud
refresh
end
if EHUD::NEO_ULTIMATE_ACE == false
def draw_actor_mp(actor, x, y, width = 124)
draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
change_color(system_color)
end
else
def draw_actor_mp(actor, x, y, width = 124)
gwidth = width * actor.mp / [actor.mmp, 1].max
cg = neo_gauge_back_color
c1, c2, c3 = cg[0], cg[1], cg[2]
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, width, HPMP_GAUGE_HEIGHT, c1, c2, c3)
(1..3).each {|i| eval("c#{i} = MP_GCOLOR_#{i}")}
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, gwidth, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,
width, 40)
change_color(system_color)
end
end
if EHUD::DRAW_HP_NUMBERS == 0
if EHUD::NEO_ULTIMATE_ACE == false
def draw_actor_hp(actor, x, y, width = 124)
draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
change_color(hp_color(actor))
draw_current_and_max_values(x, y, 124, actor.hp, actor.mhp,
hp_color(actor), normal_color)
change_color(system_color)
if EHUD::DRAW_LETTERS == true
draw_text(x,y,20,line_height,actor.letter)
end
end
else
def draw_actor_hp(actor, x, y, width = 124)
gwidth = width * actor.hp / actor.mhp
cg = neo_gauge_back_color
c1, c2, c3 = cg[0], cg[1], cg[2]
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, width, HPMP_GAUGE_HEIGHT, c1, c2, c3)
(1..3).each {|i| eval("c#{i} = HP_GCOLOR_#{i}")}
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, gwidth, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,
width, 30)
change_color(system_color)
draw_current_and_max_values(x-25, y, 124, actor.hp, actor.mhp,
hp_color(actor), normal_color)
if EHUD::DRAW_LETTERS == true
draw_text(x,y,20,line_height,actor.letter)
end
end
end
end
if EHUD::DRAW_HP_NUMBERS == 1
if EHUD::NEO_ULTIMATE_ACE == false
def draw_actor_hp(actor, x, y, width = 124)
draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
change_color(hp_color(actor))
draw_text(x+40, y, 100, line_height, actor.hp)
change_color(system_color)
if EHUD::DRAW_LETTERS == true
draw_text(x,y,20,line_height,actor.letter)
end
end
else
def draw_actor_hp(actor, x, y, width = 124)
gwidth = width * actor.hp / actor.mhp
cg = neo_gauge_back_color
c1, c2, c3 = cg[0], cg[1], cg[2]
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, width, HPMP_GAUGE_HEIGHT, c1, c2, c3)
(1..3).each {|i| eval("c#{i} = HP_GCOLOR_#{i}")}
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, gwidth, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,
width, 30)
change_color(hp_color(actor))
draw_text(x+40, y, 100, line_height, actor.hp)
change_color(system_color)
if EHUD::DRAW_LETTERS == true
draw_text(x,y,20,line_height,actor.letter)
end
end
end
end
if EHUD::DRAW_HP_NUMBERS == 2
if EHUD::NEO_ULTIMATE_ACE == false
def draw_actor_hp(actor, x, y, width = 124)
draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
if EHUD::DRAW_LETTERS == true
draw_text(x,y,20,line_height,actor.letter)
end
end
else
def draw_actor_hp(actor, x, y, width = 124)
gwidth = width * actor.hp / actor.mhp
cg = neo_gauge_back_color
c1, c2, c3 = cg[0], cg[1], cg[2]
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, width, HPMP_GAUGE_HEIGHT, c1, c2, c3)
(1..3).each {|i| eval("c#{i} = HP_GCOLOR_#{i}")}
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, gwidth, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,
width, 30)
if EHUD::DRAW_LETTERS == true
draw_text(x,y,20,line_height,actor.letter)
end
end
end
end
def troop_fix
if $game_troop.alive_members.size > 0
@enemy1 = $game_troop.alive_members[0]
end
if $game_troop.alive_members.size > 1
@enemy2 = $game_troop.alive_members[1]
end
if $game_troop.alive_members.size > 2
@enemy3 = $game_troop.alive_members[2]
end
if $game_troop.alive_members.size > 3
@enemy4 = $game_troop.alive_members[3]
end
if $game_troop.alive_members.size > 4
@enemy5 = $game_troop.alive_members[4]
end
if $game_troop.alive_members.size > 5
@enemy6 = $game_troop.alive_members[5]
end
if $game_troop.alive_members.size > 6
@enemy7 = $game_troop.alive_members[6]
end
if $game_troop.alive_members.size > 7
@enemy8 = $game_troop.alive_members[7]
end
end
#########################################################################
#########################################################################
#########################################################################
def enemy_hud
troop_fix
if EHUD::HOVER_BAR == false
if $game_troop.alive_members.size > 0
if @boss_troop == true and @boss_enemy.enemy_id == @enemy1.enemy_id
draw_actor_name(@enemy1,EHUD::BOSS_GAUGEX,0)
draw_actor_hp(@enemy1,EHUD::BOSS_GAUGEX,20,width=EHUD::BOSS_GAUGEW)
draw_actor_icons(@enemy1, EHUD::BOSS_GAUGEX+200, 20, width = 96)
if @enemy1.show_mp[@enemy1.enemy_id]==true
draw_actor_mp(@enemy1,EHUD::BOSS_GAUGEX,30,width=EHUD::BOSS_GAUGEW)
end
else
if @enemy1.hide_hp == true
draw_actor_name(@enemy1,10,0)
else
draw_actor_name(@enemy1,10,0)
draw_actor_hp(@enemy1,10,20,width=96)
if @enemy1.show_mp == true
draw_actor_mp(@enemy1,10,30,width=96)
end
end
end
end
if !$game_switches[EHUD::HIDE_MINIONS]
if $game_troop.alive_members.size > 1
if @boss_troop == true and @boss_enemy.enemy_id == @enemy1.enemy_id
draw_actor_name(@enemy2,10,50)
draw_actor_hp(@enemy2,10,70,width=96)
if @enemy2.show_mp == true
draw_actor_mp(@enemy2,10,80,width=96)
end
else
if @enemy2.hide_hp == true
draw_actor_name(@enemy2,10+125,0)
else
draw_actor_name(@enemy2,10+125,0)
draw_actor_hp(@enemy2,10+125,20,width=96)
if @enemy2.show_mp == true
draw_actor_mp(@enemy2,10+125,20,width=96)
end
end
end
end
if $game_troop.alive_members.size > 2
if @boss_troop == true and @boss_enemy.enemy_id == @enemy1.enemy_id
draw_actor_name(@enemy3,10+125,50)
draw_actor_hp(@enemy3,10+125,70,width=96)
if @enemy3.show_mp == true
draw_actor_mp(@enemy3,10+125,80,width=96)
end
else
if @enemy3.hide_hp == true
draw_actor_name(@enemy3,10+250,0)
else
draw_actor_name(@enemy3,10+250,0)
draw_actor_hp(@enemy3,10+250,20,width=96)
if @enemy3.show_mp == true
draw_actor_mp(@enemy3,10+250,30,width=96)
end
end
end
end
if $game_troop.alive_members.size > 3
if @boss_troop == true and @boss_enemy.enemy_id == @enemy1.enemy_id
draw_actor_name(@enemy4,10+250,50)
draw_actor_hp(@enemy4,10+250,70,width=96)
if @enemy4.show_mp == true
draw_actor_mp(@enemy4,10+250,80,width=96)
end
else
if @enemy4.hide_hp == true
draw_actor_name(@enemy4,10+375,0)
else
draw_actor_name(@enemy4,10+375,0)
draw_actor_hp(@enemy4,10+375,20,width=96)
if @enemy4.show_mp == true
draw_actor_mp(@enemy4,10+375,30,width=96)
end
end
end
end
if $game_troop.alive_members.size > 4
if @boss_troop == true and @boss_enemy.enemy_id == @enemy1.enemy_id
draw_actor_name(@enemy5,10+375,50)
draw_actor_hp(@enemy5,10+375,70,width=96)
if @enemy5.show_mp == true
draw_actor_mp(@enemy5,10+375,80,width=96)
end
else
if @enemy5.hide_hp == true
draw_actor_name(@enemy5,10,50)
else
draw_actor_name(@enemy5,10,50)
draw_actor_hp(@enemy5,10,70,width=96)
if @enemy5.show_mp == true
draw_actor_mp(@enemy5,10,80,width=96)
end
end
end
end
if $game_troop.alive_members.size > 5
if @boss_troop == false
if @enemy6.hide_hp == true
draw_actor_name(@enemy6,10+125,50)
else
draw_actor_name(@enemy6,10+125,50)
draw_actor_hp(@enemy6,10+125,70,width=96)
if @enemy6.show_mp == true
draw_actor_mp(@enemy6,10+125,80,width=96)
end
end
end
end
if $game_troop.alive_members.size > 6
if @boss_troop == false
if @enemy7.hide_hp == true
draw_actor_name(@enemy7,10+250,50)
else
draw_actor_name(@enemy7,10+250,50)
draw_actor_hp(@enemy7,10+250,70,width=96)
if @enemy7.show_mp == true
draw_actor_mp(@enemy7,10+250,80,width=96)
end
end
end
end
if $game_troop.alive_members.size > 7
if @boss_troop == false
if @enemy8.hide_hp == true
draw_actor_name(@enemy8,10+375,50)
else
draw_actor_name(@enemy8,10+375,50)
draw_actor_hp(@enemy8,10+375,70,width=96)
if @enemy8.show_mp == true
draw_actor_mp(@enemy8,10+375,80,width=96)
end
end
end
end
end
else
if $game_troop.alive_members.size > 0
if @boss_troop == true and @boss_enemy.enemy_id == @enemy1.enemy_id
draw_actor_name(@enemy1,EHUD::BOSS_GAUGEX,0)
draw_actor_hp(@enemy1,EHUD::BOSS_GAUGEX,20,width=EHUD::BOSS_GAUGEW)
draw_actor_icons(@enemy1,EHUD::BOSS_GAUGEX+200,0, width = 96)
if @enemy1.show_mp == true
draw_actor_mp(@enemy1,EHUD::BOSS_GAUGEX,30,width=EHUD::BOSS_GAUGEW)
end
elsif !$game_switches[EHUD::HIDE_MINIONS]
if @enemy1.hide_hp == true
#blank
else
draw_actor_hp(@enemy1,@enemy1.screen_x-50,@enemy1.screen_y-50,width=96)
if @enemy1.show_mp == true
draw_actor_mp(@enemy1,@enemy1.screen_x-50,@enemy1.screen_y-40,width=96)
end
end
end
end
if !$game_switches[EHUD::HIDE_MINIONS]
if $game_troop.alive_members.size > 1
if @enemy2.hide_hp == true
#blank
else
draw_actor_hp(@enemy2,@enemy2.screen_x-50,@enemy2.screen_y-50,width=96)
if @enemy2.show_mp == true
draw_actor_mp(@enemy2,@enemy2.screen_x-50,@enemy2.screen_y-40,width=96)
end
end
end
if $game_troop.alive_members.size > 2
if @enemy3.hide_hp == true
#blank
else
draw_actor_hp(@enemy3,@enemy3.screen_x-50,@enemy3.screen_y-50,width=96)
if @enemy3.show_mp == true
draw_actor_mp(@enemy3,@enemy3.screen_x-50,@enemy3.screen_y-40,width=96)
end
end
end
if $game_troop.alive_members.size > 3
if @enemy4.hide_hp == true
#blank
else
draw_actor_hp(@enemy4,@enemy4.screen_x-50,@enemy4.screen_y-50,width=96)
if @enemy4.show_mp == true
draw_actor_mp(@enemy4,@enemy4.screen_x-50,@enemy4.screen_y-40,width=96)
end
end
end
if $game_troop.alive_members.size > 4
if @enemy5.hide_hp == true
#blank
else
draw_actor_hp(@enemy5,@enemy5.screen_x-50,@enemy5.screen_y-50,width=96)
if @enemy5.show_mp == true
draw_actor_mp(@enemy5,@enemy5.screen_x-50,@enemy5.screen_y-40,width=96)
end
end
end
if $game_troop.alive_members.size > 5
if @enemy6.hide_hp == true
#blank
else
draw_actor_hp(@enemy6,10+125,70,width=96)
if @enemy6.show_mp == true
draw_actor_mp(@enemy6,10+125,80,width=96)
end
end
end
if $game_troop.alive_members.size > 6
if @enemy7.hide_hp == true
#blank
else
draw_actor_hp(@enemy7,10+250,70,width=96)
if @enemy7.show_mp == true
draw_actor_mp(@enemy7,10+250,80,width=96)
end
end
end
if $game_troop.alive_members.size > 7
if @enemy8.hide_hp == true
#blank
else
draw_actor_hp(@enemy8,10+375,70,width=96)
if @enemy8.show_mp == true
draw_actor_mp(@enemy8,10+375,80,width=96)
end
end
end
end
end
end
def refresh
contents.clear
enemy_hud
# @old_size = $game_troop.alive_members.size
# if @old_size < 5 and @boss_troop == false
# self.height = 80
# end
end
def update
# assume no refresh needed
refresh_okay = false
# loop through remaining enemies one at a time - each enemy is put into the temporary variable called 'enemy'
$game_troop.alive_members.each do |enemy|
# have the hp or mp changed since last time?
if enemy.hp != enemy.old_hp || enemy.mp != enemy.old_mp
# we do need to update the hud
refresh_okay = true
# and replace the old values with the current values
enemy.old_hp = enemy.hp
enemy.old_mp = enemy.mp
end
end
if $game_troop.alive_members.size != @old_size
refresh_okay = true
end
if @boss_enemy != nil
if @enemy1.enemy_id == @boss_enemy.enemy_id
@boss_troop = true
else
@boss_troop = false
end
end
if refresh_okay
refresh
end
end
end
if EHUD::DELAY == true
class Window_BattleLog
alias enemy_hud_battle_log_wait wait_and_clear
def wait_and_clear
wait while @num_wait < EHUD::WINDOW_WAIT if line_number > 0
clear
end
end
end
#Show the window on the map
class Scene_Battle < Scene_Base
alias original_create_all_windows create_all_windows
def create_all_windows
original_create_all_windows
create_enemy_hud_window
end
def create_enemy_hud_window
@enemy_hud_window = Window_Enemy_Hud.new
end
end
#########################################################################
#End Of Script #
#########################################################################[/php]
[php]#===============================================================================
#
# Neo Gauge Ultimate Ace (1.1a)
# 21/02/2012
# Ported to Ace by Pacman (original script by Woratana and edited by Pacman)
# This script changes the way gauges are drawn. This script supports drawing
# gauges horizontally and vertically, uses a 3-colour gradient, has a very
# simple setup and two brilliant methods to change the bitmap.
# Note that much of this work is Woratana's, you should credit him the same as
# (if not more than) me. I do not claim writing this script entirely, I edited
# the VX version a while back, and this is the VXA port of that.
#
# Detailed instructions on the configuration are below.
#
#===============================================================================
class Window_Base < Window # DO NOT TOUCH THIS
#==========================================================================
# NEO GAUGE SETTING #
# Color: Color.new(Red, Green, Blue) # Each number you can put integer 0-255
# * You can use this site to get RGB color:
# http://web.njit.edu/~kevin/rgb.txt.html
#==========================================================================
GAUGE_GLOW_EFFECT = true # Use glow effect?
GAUGE_GLOW_COLOR = Color.new(0,0,0) # Glow color
GAUGE_OUTSIDE_BORDER = true # Use outside border?
GAUGE_OUTSIDE_BORDER_COLOR = Color.new(255,255,255)
GAUGE_OUTSIDE_BORDER_COLOR2 = Color.new(255,255,255)
GAUGE_CLEAR_CORNER_OUTSIDE_BORDER = true
GAUGE_INSIDE_BORDER = false # Use inside border?
GAUGE_INSIDE_BORDER_COLOR = Color.new(255, 255, 255)
GAUGE_INSIDE_BORDER_COLOR2 = Color.new(0, 0, 0)
#=============================================================
# NEO HP/MP/TP/STATS GAUGE SETTING #
#=============================================================
# Note: The HPMP options also apply to the TP gauge.
HPMP_GAUGE_HEIGHT = 8 # gauge height (minumum: 6)
# Recommend to use HPMP_GAUGE_HEIGHT at least 8,
# if you're using GAUGE_INSIDE_BORDER in Neo-Gauge
HPMP_GAUGE_X_PLUS = 0 # Move gauge horizontally (+,-)
HPMP_GAUGE_Y_PLUS = ((-1)*(HPMP_GAUGE_HEIGHT - 6)) # (+,-)
# Change '((-1)*(HPMP_GAUGE_HEIGHT - 6))' to number to move gauge vertically
# BACK GAUGE COLORS
BACK_GCOLOR_1 = Color.new(0, 0, 0) # Black [Color1]
BACK_GCOLOR_2 = Color.new(100, 100, 100) # Dark Gray [Color2]
BACK_GCOLOR_3 = Color.new(200, 200, 200) # Light Gray [Color3]
USE_HP_GAUGE = true # Use HP Gauge? (true/false)
USE_MP_GAUGE = true # Use MP Gauge?
USE_TP_GAUGE = true # Use TP Gauge?
USE_STATS_GAUGE = true # Use Attack/Defense/Spirit/Agility/Luck Gauge?
# HP GAUGE COLORS
HP_GCOLOR_1 = Color.new(139,0,0) # Dark Red
HP_GCOLOR_2 = Color.new(255,0,0) # Pure Red
HP_GCOLOR_3 = Color.new(255,193,37) # Goldenrod
# MP GAUGE COLORS
MP_GCOLOR_1 = Color.new(0,0,128) # Dark Blue
MP_GCOLOR_2 = Color.new(0,191,255) # Blue
MP_GCOLOR_3 = Color.new(46,139,87) # Light Green
# TP GAUGE COLORS
TP_GCOLOR_1 = Color.new(0, 100, 0) # Dark Green
TP_GCOLOR_2 = Color.new(191, 255, 0) # Lime Green
TP_GCOLOR_3 = Color.new(173, 255, 47) # Yellow Green
# STAT GAUGE COLORS
STAT_GCOLOR_1 = Color.new(0,0,128)
STAT_GCOLOR_2 = Color.new(0,191,255)
STAT_GCOLOR_3 = Color.new(152,251,152)
#===============================================================================
#
# END CONFIGURATION
#
#===============================================================================
#==============================================================================
# ■ Window_Base
#
# ゲーム中の全てのウィンドウのスーパークラスです。
#==============================================================================
#
# * Get Gauge Back Colours
#
def neo_gauge_back_color
return BACK_GCOLOR_1, BACK_GCOLOR_2, BACK_GCOLOR_3
end
#
if USE_HP_GAUGE
#
# * Draw Actor HP
#
def draw_actor_hp(actor, x, y, width = 124)
gwidth = width * actor.hp / actor.mhp
cg = neo_gauge_back_color
c1, c2, c3 = cg[0], cg[1], cg[2]
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, width, HPMP_GAUGE_HEIGHT, c1, c2, c3)
(1..3).each {|i| eval("c#{i} = HP_GCOLOR_#{i}")}
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, gwidth, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,
width, 30)
change_color(system_color)
draw_text(x, y, 30, line_height, Vocab::hp_a)
draw_current_and_max_values(x, y, width, actor.hp, actor.mhp,
hp_color(actor), normal_color)
end
#
end
if USE_MP_GAUGE
#
# * Draw Actor MP
#
def draw_actor_mp(actor, x, y, width = 124)
gwidth = width * actor.mp / [actor.mmp, 1].max
cg = neo_gauge_back_color
c1, c2, c3 = cg[0], cg[1], cg[2]
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, width, HPMP_GAUGE_HEIGHT, c1, c2, c3)
(1..3).each {|i| eval("c#{i} = MP_GCOLOR_#{i}")}
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, gwidth, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,
width, 40)
change_color(system_color)
draw_text(x, y, 30, line_height, Vocab::mp_a)
draw_current_and_max_values(x, y, width, actor.mp, actor.mmp,
mp_color(actor), normal_color)
end
#
end
if USE_TP_GAUGE
#
# * Draw Actor TP
#
def draw_actor_tp(actor, x, y, width = 124)
gwidth = width * actor.tp / 100
cg = neo_gauge_back_color
c1, c2, c3 = cg[0], cg[1], cg[2]
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, width, HPMP_GAUGE_HEIGHT, c1, c2, c3)
(1..3).each {|i| eval("c#{i} = TP_GCOLOR_#{i}")}
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, gwidth, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,
width, 40)
change_color(system_color)
draw_text(x, y, 30, line_height, Vocab::tp_a)
change_color(tp_color(actor))
draw_text(x + width - 42, y, 42, line_height, actor.tp.to_i, 2)
end
#
end
if USE_STATS_GAUGE
#
# * Draw Actor Stats
#
def draw_actor_param(actor, x, y, param_id)
param_name = Vocab::param(param_id)
param_value = actor.param(param_id)
param_max = actor.neo_param_max(param_id)
width = 156
gwidth = width * param_value / [param_max, 1].max
cg = neo_gauge_back_color
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, width, HPMP_GAUGE_HEIGHT, cg[0], cg[1], cg[2])
c1, c2, c3 = STAT_GCOLOR_1, STAT_GCOLOR_2, STAT_GCOLOR_3
draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
HPMP_GAUGE_Y_PLUS, gwidth, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,
width, 40)
change_color(system_color)
draw_text(x, y, 120, line_height, param_name)
change_color(normal_color)
draw_text(x + 120, y, 36, line_height, param_value, 2)
end
#
end
#
# * Draw Neo Gauge
# c1, c2, c3 : 3 Colours in the gradient
# vert : Whether the gauge is vertical or not.
# outline : Draw an outline of the gauge?
# max_width : Maximum width the gauge can reach.
# c2_spot : Point where the second colour is drawn.
#
def draw_neo_gauge(x, y, width, height, c1, c2, c3, vert = false,
outline = true, max_width = nil, c2_spot = 50)
if max_width.nil? # Get Max Width
max_width = vert ? height : width
end
glow = GAUGE_GLOW_EFFECT
dx = x; dy = y
x = y = 0
bitmap = Bitmap.new(max_width, height)
if glow # If drawing glow
if outline # If drawing outline
if vert; rect = Rect.new(x, y, width, max_width) # Make vertical gauge
else; rect = Rect.new(x, y, max_width, height) # Make horizontal gauge
end
bitmap.fill_rect(rect, GAUGE_GLOW_COLOR) # Make glow
bitmap.neo_clear_corner(rect.x, rect.y, rect.width, rect.height) # Clear
else # No outline
height -= 2; width -= 2; x += 1; y += 1
if GAUGE_INSIDE_BORDER
height -= 2; width -= 2; x += 1; y += 1
end
end
end
#
# I'm not going to comment every line. There's a lot of stuff here. It may
# look daunting, but it's actually not that diffciult to get your head
# around. If you really want to figure this all out, just look at it a lot.
# Failing that, you could probably just ask a more experienced scripter or
# myself.
#
if vert
if glow; gx = gx2 = x + 1; gy = y
else; gx = gx2 = x; gy = y
end
gy2 = gy - 1 + ((c2_spot * max_width) / 100)
gw = gw2 = width - 2; gh = ((c2_spot * max_width) / 100)
gh2 = max_width - gh - 2
bitmap.gradient_fill_rect(gx, gy, gw, gh, c1, c2, true)
bitmap.gradient_fill_rect(gx2, gy2, gw2, gh2, c2, c3, true)
gh = (gh + gh2)
else
if glow; gx = x; gy = gy2 = y
gx = x + 1; gy = gy2 = y + 1
else; gx = x; gy = gy2 = y
end
gx2 = gx - 1 + ((c2_spot * max_width) / 100)
gw = ((c2_spot * max_width) / 100); gh = gh2 = (height - 2)
gw2 = max_width - gw - 2
bitmap.gradient_fill_rect(gx, gy, gw, gh, c1, c2)
bitmap.gradient_fill_rect(gx2, gy2, gw2, gh2, c2, c3)
gw = (gw + gw2)
end
if outline
if GAUGE_OUTSIDE_BORDER
bitmap.draw_neo_border(gx, gy, gw, gh, GAUGE_OUTSIDE_BORDER_COLOR,
GAUGE_OUTSIDE_BORDER_COLOR2)
if GAUGE_CLEAR_CORNER_OUTSIDE_BORDER
bitmap.neo_clear_corner(gx, gy, gw, gh)
end
end
if GAUGE_INSIDE_BORDER
gx += 1; gy += 1; gw -= 2; gh -= 2
bitmap.draw_neo_border(gx, gy, gw, gh, GAUGE_INSIDE_BORDER_COLOR,
GAUGE_INSIDE_BORDER_COLOR2)
end
end
rect = Rect.new(0, 0, width, bitmap.height)
self.contents.blt(dx, dy, bitmap, rect)
bitmap.dispose
end
end
#==============================================================================
# ■ Bitmap
#
# かわいいですね。
#==============================================================================
class Bitmap
#
# * Draw border of Neo Gauge
#
def draw_neo_border(x, y, width, height, color, color2 = color, size = 1)
gradient_fill_rect(x, y, width, size, color, color2)
fill_rect(x, y, size, height, color)
fill_rect(x + width - size, y, size, height, color2)
gradient_fill_rect(x, y + height - size, width, size, color, color2)
end
#
# * Clear Corner of Neo Gauge
#
def neo_clear_corner(x, y, width, height, size = 1)
clear_rect(x, y, size, size)
clear_rect(x + width - size, y, size, size)
clear_rect(x, y + height - size, size, size)
clear_rect(x + width - size, y + height - size, size, size)
end
end
#==============================================================================
# ■ Game_Battler
#
# スプライトや行動に関するメソッドを追加したバトラーのクラスです。このクラス
# は Game_Actor クラスと Game_Enemy クラスのスーパークラスとして使用されます。
#==============================================================================
class Game_Battler < Game_BattlerBase
#
# * Get class (simpler method)
#
def klass
self.class if self.is_a?(Game_Actor)
end
#
# * Get Neo Parameter Max
#
def neo_param_max(param_id)
case param_id
when 2; maxatk
when 3; maxdef
when 4; maxspi
when 5; maxmdef
when 6; maxagi
when 7; maxluk
end
end
#
# * Max attack
#
def maxatk
n = atk
if self.is_a?(Game_Actor)
n = n - klass.params[2, @level] + klass.params[2, 99]
end
return n
end
#
# * Max defense
#
def maxdef
n = atk
if self.is_a?(Game_Actor)
n = n - klass.params[3, @level] + klass.params[3, 99]
end
return n
end
#
# * Max magic
#
def maxspi
n = atk
if self.is_a?(Game_Actor)
n = n - klass.params[4, @level] + klass.params[4, 99]
end
return n
end
#
# * Max magic defense
#
def maxmdef
n = atk
if self.is_a?(Game_Actor)
n = n - klass.params[5, @level] + klass.params[5, 99]
end
return n
end
#
# * Max agility
#
def maxagi
n = atk
if self.is_a?(Game_Actor)
n = n - klass.params[6, @level] + klass.params[6, 99]
end
return n
end
#
# * Max luck
#
def maxluk
n = atk
if self.is_a?(Game_Actor)
n = n - klass.params[7, @level] + klass.params[7, 99]
end
return n
end
end
$imported ||= {}
$imported[:neo_gauge_ultimate]
#===============================================================================
#
# END OF SCRIPT
#
#===============================================================================[/php]
Screen lấy mẫu từ game của mình đang làm luôn


Nhớ credit tên tác giả
script 1 là của Jet10985(Jet)
script 2 là của Ventwig
còn script thứ 3 ko ghi trong script thì chịu
:D