#============================================================================== # ** Sideview System
# ** Sideview Battle System Unanimated
#------------------------------------------------------------------------------
# Ordaz , Paradox2D6 and Squall (Credits)
# Version 1.14
# 3/10/2006
#==============================================================================
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log(' Unanimated Sideview Battle System', 'Ordaz', 1, '2006-10-03')
#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state(" Unanimated Sideview Battle System") == true
#------------------------------------------------------------------------------
# * Actual Processing
#------------------------------------------------------------------------------
module SDVA
X_LINE = 400 # ????????????
Y_LINE = 225 # ????????????
X_SPACE = 20 # ?????????????
Y_SPACE = 30 # ?????????????
X_POSITION = 50 # ??[????????]????
Y_POSITION = 0 # ??[????????]????
ATTACK_MOVE = true # ???????????( true / false )
SKILL_MOVE = false # ??????????????( true / false )
ITEM_MOVE = false # ???????????????( true / false )
MOVE_STEP = 3 # ????
MOVE_PIXEL = 10 # ???????????
PARTY_POS = 1 # ?????????( 0:? / 1:? / 2:? / 3:? )
WINDOWPOS_CHANGE = true # ??????????????????????( true / false )
end
#==============================================================================
# ? Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ? Draw X Coordinate
#--------------------------------------------------------------------------
def screen_x
if self.index != nil
# ?????
pos = $data_classes[self.class_id].position
x_pos = pos * SDVA::X_POSITION
scr_x = self.index * SDVA::X_SPACE + SDVA::X_LINE + x_pos
# ??????????
if self.current_action.move_action == true
# ????
scr_x += @shift_x
end
return scr_x
else
return 0
end
end
#--------------------------------------------------------------------------
# ?Draw Y Coordinate
#--------------------------------------------------------------------------
def screen_y
if self.index != nil
# ?????
pos = $data_classes[self.class_id].position
y_pos = pos * SDVA::Y_POSITION
scr_y = self.index * SDVA::Y_SPACE + SDVA::Y_LINE + y_pos
# ??????????
if self.current_action.move_action == true
# ????
scr_y += @shift_y
end
return scr_y
else
return 0
end
end
#--------------------------------------------------------------------------
# ? Draw Z Coordinate
#--------------------------------------------------------------------------
def screen_z
if self.index != nil
return self.index
else
return 0
end
end
end
#==============================================================================
# ? Game_Battler (???? 1)
#==============================================================================
class Game_Battler
#------------------------------------------------------------------------------
# * Public Variables
#------------------------------------------------------------------------------
attr_reader :pattern # ??????
attr_reader :trans_x # X???????
attr_reader :moving # ??????
#--------------------------------------------------------------------------
# ? Initialize Battle
#--------------------------------------------------------------------------
alias initialize_sdva initialize
def initialize
initialize_sdva
move_reset
end
#--------------------------------------------------------------------------
# ? Move Process
#--------------------------------------------------------------------------
def move
@moving = 1
if @step < SDVA::MOVE_STEP
# ??????????
@pattern = (@pattern + 1) % 4
@step += 1
move_step
else
# ????
@pattern = 1
@moving = 2
end
end
#--------------------------------------------------------------------------
# ? Sets up the position of your character
#--------------------------------------------------------------------------
def move_step
# ???????????????????
case SDVA::PARTY_POS
when 0
@shift_y = @step * SDVA::MOVE_PIXEL
when 1
@shift_x = -(@step * SDVA::MOVE_PIXEL)
when 2
@shift_x = @step * SDVA::MOVE_PIXEL
when 3
@shift_y = -(@step * SDVA::MOVE_PIXEL)
end
end
#--------------------------------------------------------------------------
# ? Ending Movement module
#--------------------------------------------------------------------------
def move_reset
@moving = 0
@pattern = 0
@step = 0
@shift_x = 0
@shift_y = 0
end
end
#==============================================================================
# ? Game_BattleAction
#==============================================================================
class Game_BattleAction
#--------------------------------------------------------------------------
# ? Public Insurance Variables
#--------------------------------------------------------------------------
attr_accessor :move_action # ??????????
#--------------------------------------------------------------------------
# ? Clear The System
#--------------------------------------------------------------------------
alias clear_sdva clear
def clear
clear_sdva
@move_action = false
end
end
#==============================================================================
# ? Sprite_Battler
#==============================================================================
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
alias update_sdva update
def update
# ????????????????
if @battler.is_a?(Game_Actor)
# ????????????????????
# ??????
if @battler.battler_name != @battler_name or
@battler.battler_hue != @battler_hue or
@battler.current_action.basic == 0 or
@battler.current_action.kind != 3
# ????????????
@character_name = @battler.character_name
@character_hue = @battler.character_hue
# ???????????
self.bitmap = RPG::Cache.character(@character_name, @character_hue)
cw = self.bitmap.width / 4
ch = self.bitmap.height / 4
@width = cw
@height = ch
if @battler.current_action.move_action == true
# ????
@battler.move
else
@battler.move_reset
end
# ?????????
sx = @battler.pattern * cw
sy = SDVA::PARTY_POS * ch
self.src_rect.set(sx, sy, cw, ch)
self.ox = @width / 2
self.oy = @height
# ??????????? 0 ???
if @battler.hidden
self.opacity = 0
end
end
end
update_sdva
end
end
#==============================================================================
# ? Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ? Initializing the windows and the Bars
#--------------------------------------------------------------------------
alias phase3_setup_command_window_sdva phase3_setup_command_window
def phase3_setup_command_window
phase3_setup_command_window_sdva
if SDVA::WINDOWPOS_CHANGE
# ???????????????????
case SDVA::PARTY_POS
when 0
x_pos = @active_battler.screen_x - (@actor_command_window.width/2)
y_pos = @active_battler.screen_y
when 1
x_pos = @active_battler.screen_x - @actor_command_window.width - 16
y_pos = @active_battler.screen_y - @actor_command_window.height
when 2
x_pos = @active_battler.screen_x + 16
y_pos = @active_battler.screen_y - @actor_command_window.height
when 3
x_pos = @active_battler.screen_x - (@actor_command_window.width/2)
y_pos = @active_battler.screen_y - @actor_command_window.height - 48
end
@actor_command_window.x = x_pos >= 0 ? x_pos : 0
@actor_command_window.x = x_pos+@actor_command_window.width <= 640 ? x_pos : 640-@actor_command_window.width
@actor_command_window.y = y_pos >= 0 ? y_pos : 0
@actor_command_window.y = y_pos+@actor_command_window.height <= 480 ? y_pos : 480-@actor_command_window.height
# ??????????????????
@actor_command_window.z = 9999
end
end
#--------------------------------------------------------------------------
# ? Events Move
#--------------------------------------------------------------------------
alias update_phase4_step3_sdva update_phase4_step3
def update_phase4_step3
if SDVA::ATTACK_MOVE
if @active_battler.current_action.basic == 0
@active_battler.current_action.move_action = true
end
end
if SDVA::SKILL_MOVE
if @active_battler.current_action.kind == 1
@active_battler.current_action.move_action = true
end
end
if SDVA::ITEM_MOVE
if @active_battler.current_action.kind == 2
@active_battler.current_action.move_action = true
end
end
# ??????????????????????
if @active_battler.is_a?(Game_Actor) and
@active_battler.current_action.move_action
# ?????
if @active_battler.moving == 2
update_phase4_step3_sdva
end
elsif @active_battler.moving == 0
update_phase4_step3_sdva
end
end
#--------------------------------------------------------------------------
# ? Enemies Phase
#--------------------------------------------------------------------------
alias update_phase4_step6_sdva update_phase4_step6
def update_phase4_step6
@active_battler.current_action.move_action = false
@active_battler.move_reset
update_phase4_step6_sdva
end
end
#==============================================================================
# ? Spriteset_Battle
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
alias initialize_sdva initialize
def initialize
initialize_sdva
@viewport2.z = 1
end
end
#==============================================================================
# ? Arrow_Actor
#==============================================================================
class Arrow_Actor < Arrow_Base
#--------------------------------------------------------------------------
# ? Update
#--------------------------------------------------------------------------
alias update_sdva update
def update
update_sdva
# ?????
if Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
@index += 1
@index %= $game_party.actors.size
end
# ?????
if Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
@index += $game_party.actors.size - 1
@index %= $game_party.actors.size
end
end
end
#==============================================================================
# ? Arrow_Enemy
#==============================================================================
class Arrow_Enemy < Arrow_Base
#--------------------------------------------------------------------------
# ? Enemy Cursor
#--------------------------------------------------------------------------
alias update_sdva update
def update
update_sdva
# Change Choice
if Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
$game_troop.enemies.size.times do
@index += 1
@index %= $game_troop.enemies.size
break if self.enemy.exist?
end
end
# Change Choice #2
if Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
$game_troop.enemies.size.times do
@index += $game_troop.enemies.size - 1
@index %= $game_troop.enemies.size
break if self.enemy.exist?
end
end
end
end
#--------------------------------------------------------------------------
# ? Damage Class (Written By Squall
#--------------------------------------------------------------------------
class RPG::Sprite < ::Sprite
#--------------------------------------------------------------------------
# ? Initialize
#--------------------------------------------------------------------------
def initialize(viewport = nil)
super(viewport)
@_whiten_duration = 0
@_appear_duration = 0
@_escape_duration = 0
@_collapse_duration = 0
@_damage_durations = []
@_animation_duration = 0
@_blink = false
end
#--------------------------------------------------------------------------
# ? Dispose
#--------------------------------------------------------------------------
def dispose
dispose_damage(0...@_damage_durations.size)
dispose_animation
dispose_loop_animation
super
end
#--------------------------------------------------------------------------
# ? Effect
#--------------------------------------------------------------------------
def effect?
damage_duration = 0
for value in @_damage_durations
damage_duration += value
end
@_whiten_duration > 0 or
@_appear_duration > 0 or
@_escape_duration > 0 or
@_collapse_duration > 0 or
damage_duration > 0 or
@_animation_duration > 0
end
#--------------------------------------------------------------------------
# ? Damage
#--------------------------------------------------------------------------
def damage(value, critical)
dispose_damage(0...@_damage_durations.size)
@_damage_sprites = []
if value.is_a?(Numeric)
damage_string = value.abs.to_s
else
damage_string = value.to_s
end
if critical
damage_string += " CRITICAL HIT"
end
for i in 0...damage_string.size
letter = damage_string[i..i]
bitmap = Bitmap.new(48, 48)
bitmap.font.size = 24
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, 12-1, 48, 48, letter, 1)
bitmap.draw_text(+1, 12-1, 48, 48, letter, 1)
bitmap.draw_text(-1, 12+1, 48, 48, letter, 1)
bitmap.draw_text(+1, 12+1, 48, 48, letter, 1)
if value.is_a?(Numeric) and value < 0
bitmap.font.color.set(176, 255, 144)
else
bitmap.font.color.set(255, 255, 255)
end
bitmap.draw_text(0, 12, 48, 48, letter, 1)
@_damage_sprites[i] = ::Sprite.new(self.viewport)
@_damage_sprites[i].bitmap = bitmap
@_damage_sprites[i].visible = false
@_damage_sprites[i].ox = 16
@_damage_sprites[i].oy = 16
@_damage_sprites[i].x = self.x - self.ox / 2 + i * 12
@_damage_sprites[i].y = self.y - self.oy / 2
@_damage_sprites[i].z = 3000
@_damage_durations[i] = 40 + i * 2
end
end
#--------------------------------------------------------------------------
# ? Dispose Damage
#--------------------------------------------------------------------------
def dispose_damage(index)
return if @_damage_sprites == nil
if @_damage_sprites[index].is_a?(::Sprite) and @_damage_sprites[index].bitmap != nil
@_damage_sprites[index].bitmap.dispose
@_damage_sprites[index].dispose
@_damage_durations[index] = 0
end
end
#--------------------------------------------------------------------------
# ? Update
#--------------------------------------------------------------------------
def update
super
if @_whiten_duration > 0
@_whiten_duration -= 1
self.color.alpha = 128 - (16 - @_whiten_duration) * 10
end
if @_appear_duration > 0
@_appear_duration -= 1
self.opacity = (16 - @_appear_duration) * 16
end
if @_escape_duration > 0
@_escape_duration -= 1
self.opacity = 256 - (32 - @_escape_duration) * 10
end
if @_collapse_duration > 0
@_collapse_duration -= 1
self.opacity = 256 - (48 - @_collapse_duration) * 6
end
for i in 0...@_damage_durations.size
damage_sprite = @_damage_sprites[i]
next if @_damage_durations[i] == nil
if @_damage_durations[i] > 0
@_damage_durations[i] -= 1
damage_sprite.visible = (@_damage_durations[i] <= 40)
case @_damage_durations[i]
when 38..39
damage_sprite.y -= 4
when 36..37
damage_sprite.y -= 2
when 34..35
damage_sprite.y += 2
when 28..33
damage_sprite.y += 4
end
damage_sprite.opacity = 256 - (12 - @_damage_durations[i]) * 32
if @_damage_durations[i] == 0
dispose_damage(i)
end
end
end
if @_animation != nil and (Graphics.frame_count % 2 == 0)
@_animation_duration -= 1
update_animation
end
if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
update_loop_animation
@_loop_animation_index += 1
@_loop_animation_index %= @_loop_animation.frame_max
end
if @_blink
@_blink_count = (@_blink_count + 1) % 32
if @_blink_count < 16
alpha = (16 - @_blink_count) * 6
else
alpha = (@_blink_count - 16) * 6
end
self.color.set(255, 255, 255, alpha)
end
@@_animations.clear
end
end
#--------------------------------------------------------------------------
# ? Ends Damage Class (Written by Squall)
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# ? CBS Menu System (By ParaDog)
#--------------------------------------------------------------------------
module PARA_CTB
# HP Color
HP_COLOR_LEFT = Color.new(0, 40, 0, 255)
# HP Color 2
HP_COLOR_RIGHT= Color.new(0, 150, 0, 255)
# SP Color
SP_COLOR_LEFT = Color.new(0, 0, 40, 255)
# SP Color 2
SP_COLOR_RIGHT= Color.new(0, 0, 150, 255)
#Frames Initialize
FRAME_COLOR = Color.new(192, 192, 192, 255)
# Frame Border size
FRAME_BORDER = 1
# Background Color
BACK_COLOR = Color.new(128, 128, 128, 128)
# Font Size
NAME_FONT_SIZE =17
# HP/SP Font size
HPSP_FONT_SIZE =18
# Enemies name Font
ENEMY_FONT_SIZE =16
# Draws the MAX HP of enemies
MAX_DRAW = false
#--------------------------------------------------------------------------------
# * Party Things
#--------------------------------------------------------------------------------
# Party Size (Default 4)
PARTY_SIZE = 4
# Enemy Group Naming
ENEMY_GROUPING = false
#Sets your opinion if you want
ENEMY_DRAWING_MATER = 0
# Draws Actor's HP / MP in help menu (Default : True)
HELP_DRAWING_MATER_ACTOR = true
# Draws Enemy's HP/MP in help menu (Default : False)
HELP_DRAWING_MATER_ENEMY = false
# Window Positioning Change
WINDOWPOS_CHANGE = false
WINDOWPOS_X = 100 # X??
WINDOWPOS_Y = 320 # Y??
# Sets Menu Opacity
WINDOW_OPACITY = 160
end
#--------------------------------------------------------------------------
# ? Ends The Variables
#--------------------------------------------------------------------------
#==============================================================================
# ? Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ? CTB Main
#--------------------------------------------------------------------------
alias main_ctb main
def main
# Starts CTB Window
@status_window2 = Window_BattleStatus_enemy.new
main_ctb
# Dispose CTB Window
@status_window2.dispose
end
#--------------------------------------------------------------------------
# ? CTB Update
#--------------------------------------------------------------------------
alias ctb_update update
def update
# Interepter call
if $game_system.battle_interpreter.running?
$game_system.battle_interpreter.update
if $game_temp.forcing_battler == nil
unless $game_system.battle_interpreter.running?
unless judge
setup_battle_event
end
end
if @phase != 5
@status_window2.refresh
end
end
end
ctb_update
end
#--------------------------------------------------------------------------
# ? Phases
#--------------------------------------------------------------------------
alias phase3_setup_command_window_ctb phase3_setup_command_window
def phase3_setup_command_window
@actor_command_window.back_opacity = PARA_CTB::WINDOW_OPACITY
phase3_setup_command_window_ctb
if PARA_CTB::WINDOWPOS_CHANGE
# ???????????????????
@actor_command_window.x = PARA_CTB::WINDOWPOS_X
@actor_command_window.y = PARA_CTB::WINDOWPOS_Y
# ??????????????????
@actor_command_window.z = 9999
end
end
#--------------------------------------------------------------------------
# ? Phases
#--------------------------------------------------------------------------
alias update_phase1_ctb update_phase1
def update_phase1
# ???????????
@status_window2.refresh
update_phase1_ctb
end
#--------------------------------------------------------------------------
# ? Phase six
#--------------------------------------------------------------------------
alias update_phase4_step6_ctb update_phase4_step6
def update_phase4_step6
# ???????????
@status_window2.refresh
update_phase4_step6_ctb
end
end
#==============================================================================
# ? Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# ? Initialize
#--------------------------------------------------------------------------
def initialize
super(160, 320, 480, 160)
self.contents = Bitmap.new(width - 32, height - 32)
@level_up_flags = []
for i in 0..$game_party.actors.size
@level_up_flags.push(false)
end
@before_hp = []
@before_sp = []
@before_states = []
@now_hp = []
@now_sp = []
@now_states = []
refresh
end
#--------------------------------------------------------------------------
# ? Refreshes The Party members
#--------------------------------------------------------------------------
def refresh
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
line_height = 120 / PARA_CTB::PARTY_SIZE
actor_y = i * line_height + 4
# ????????????
@now_hp[i] = actor.hp
@now_sp[i] = actor.sp
@now_states[i] = actor.states
# ??????
if @level_up_flags[i]
self.contents.fill_rect(344, actor_y, 100, 32, Color.new(0, 0, 0, 0))
self.contents.font.color = normal_color
self.contents.draw_text(344, actor_y, 120, 32, "LEVEL UP!")
end
end
# ??????????????
# ?????????????????????
if @before_hp == nil or @before_sp == nil or @before_states == nil or @before_hp != @now_hp or @before_sp != @now_sp or @before_states != @now_states
self.contents.clear
for i2 in 0...$game_party.actors.size
actor = $game_party.actors[i2]
line_height = 120 / PARA_CTB::PARTY_SIZE
actor_y = i2 * line_height + 4
self.contents.font.size = PARA_CTB::NAME_FONT_SIZE
# ?????
draw_actor_name(actor, 4, actor_y+16-PARA_CTB::NAME_FONT_SIZE)
# HP???
hp_color1 = PARA_CTB::HP_COLOR_LEFT
hp_color2 = PARA_CTB::HP_COLOR_RIGHT
draw_meter(actor.hp, actor.maxhp, 125, actor_y+14, 80, 8, hp_color1, hp_color2)
draw_actor_hp(actor, 102, actor_y+16-PARA_CTB::HPSP_FONT_SIZE, 100)
# SP???
sp_color1 = PARA_CTB::SP_COLOR_LEFT
sp_color2 = PARA_CTB::SP_COLOR_RIGHT
draw_meter(actor.sp, actor.maxsp, 245, actor_y+14, 80, 8, sp_color1, sp_color2)
draw_actor_sp(actor, 222, actor_y+16-PARA_CTB::HPSP_FONT_SIZE, 100)
# ?????????????
@before_hp[i2] = actor.hp
@before_sp[i2] = actor.sp
@before_states[i2] = actor.states
# ??????
if @level_up_flags[i2] == false
draw_actor_state(actor, 344, actor_y)
end
end
end
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def update
super
end
#--------------------------------------------------------------------------
# ? HP ???
# actor : ????
# x : ??? X ??
# y : ??? Y ??
# width : ?????
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 144)
# ??? "HP" ???
self.contents.font.color = system_color
self.contents.font.size = 16
self.contents.draw_text(x, y+2, 32, 32, $data_system.words.hp)
self.contents.font.color = normal_color
self.contents.font.size = PARA_CTB::HPSP_FONT_SIZE
if PARA_CTB::MAX_DRAW
# MaxHP ???
self.contents.draw_text(x, y, width, 32, actor.maxhp.to_s, 2)
text_size = self.contents.text_size(actor.maxhp.to_s)
text_x = x + width - text_size.width - 12
self.contents.draw_text(text_x, y, 12, 32, "/", 1)
# HP ???
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
text_x = text_x - text_size.width
self.contents.draw_text(text_x, y, text_size.width, 32, actor.hp.to_s, 2)
else
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(x, y, width, 32, actor.hp.to_s, 2)
end
end
#--------------------------------------------------------------------------
# ? SP ???
# actor : ????
# x : ??? X ??
# y : ??? Y ??
# width : ?????
#--------------------------------------------------------------------------
def draw_actor_sp(actor, x, y, width = 144)
# ??? "SP" ???
self.contents.font.color = system_color
self.contents.font.size = 16
self.contents.draw_text(x, y+2, 32, 32, $data_system.words.sp)
self.contents.font.color = normal_color
self.contents.font.size = PARA_CTB::HPSP_FONT_SIZE
if PARA_CTB::MAX_DRAW
# MaxSP ???
self.contents.draw_text(x, y, width, 32, actor.maxsp.to_s, 2)
text_size = self.contents.text_size(actor.maxsp.to_s)
text_x = x + width - text_size.width - 12
self.contents.draw_text(text_x, y, 12, 32, "/", 1)
# SP ???
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
text_x = text_x - text_size.width
self.contents.draw_text(text_x, y, text_size.width, 32, actor.sp.to_s, 2)
else
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text(x, y, width, 32, actor.sp.to_s, 2)
end
end
end
#==============================================================================
# ? ??????????????
#==============================================================================
class Window_BattleStatus_enemy < Window_Base
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def initialize
super(0, 320, 160, 160)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.font.size = PARA_CTB::ENEMY_FONT_SIZE
@exist_enemies = []
if $game_troop.enemies != nil
if PARA_CTB::ENEMY_GROUPING
ememy_list = []
ememy_list_index = []
# ??????????
for i in 0...$game_troop.enemies.size
enemy = $game_troop.enemies[i]
if enemy.exist?
if ememy_list.include?(enemy.name)
ememy_list_index[ememy_list.index(enemy.name)] += 1
else
# ????????
ememy_list.push(enemy.name)
ememy_list_index[ememy_list.index(enemy.name)] = 1
end
end
end
# ????????????
enemy_index = 0
for enemy_name in ememy_list
enemy_y = enemy_index * (PARA_CTB::ENEMY_FONT_SIZE+6) + 4
if ememy_list_index[enemy_index] > 1
enemy_name = enemy_name + "?" + ememy_list_index[enemy_index].to_s
end
self.contents.draw_text(4, enemy_y, 160, 20, enemy_name)
enemy_index += 1
end
else
# ??????????
enemy_index = 0
for i in 0...$game_troop.enemies.size
enemy = $game_troop.enemies[i]
if enemy.exist?
@exist_enemies.push(enemy)
line_height = PARA_CTB::ENEMY_FONT_SIZE + 6
if PARA_CTB::ENEMY_DRAWING_MATER != 0
line_height += 10
end
enemy_y = enemy_index * line_height + 4
self.contents.draw_text(4, enemy_y, 160, 20, enemy.name)
enemy_index += 1
# HP??????
if PARA_CTB::ENEMY_DRAWING_MATER == 1
hp_color1 = PARA_CTB::HP_COLOR_LEFT
hp_color2 = PARA_CTB::HP_COLOR_RIGHT
y = enemy_y + PARA_CTB::ENEMY_FONT_SIZE + 3
draw_meter(enemy.hp, enemy.maxhp, 4, y, 80, 8, hp_color1, hp_color2)
end
end
end
end
end
end
end
#==============================================================================
# ? Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def draw_meter(now, max, x, y, width, height, start_color, end_color=start_color )
self.contents.fill_rect(x, y, width, height, PARA_CTB::FRAME_COLOR)
self.contents.fill_rect(x+PARA_CTB::FRAME_BORDER, y+PARA_CTB::FRAME_BORDER, width-PARA_CTB::FRAME_BORDER*2, height-PARA_CTB::FRAME_BORDER*2, PARA_CTB::BACK_COLOR)
now = now > max ? max : now
percentage = max != 0 ? (width-2) * now / max.to_f : 0
if start_color == end_color
self.contents.fill_rect(x+1, y+1, percentage, height-2, start_color)
else
for i in 1..percentage
r = start_color.red + (end_color.red - start_color.red) / percentage * i
g = start_color.green + (end_color.green - start_color.green) / percentage * i
b = start_color.blue + (end_color.blue - start_color.blue) / percentage * i
a = start_color.alpha + (end_color.alpha - start_color.alpha) / percentage * i
self.contents.fill_rect(x+i, y+1, 1, height-2, Color.new(r, g, b, a))
end
end
end
end
#==============================================================================
# ? Window_Help
#==============================================================================
class Window_Help < Window_Base
#--------------------------------------------------------------------------
# ? ??????
# actor : ??????????????
#--------------------------------------------------------------------------
alias set_actor_ctb set_actor
def set_actor(actor)
if PARA_CTB::HELP_DRAWING_MATER_ACTOR
self.contents.clear
draw_actor_name(actor, 4, 0)
draw_actor_state(actor, 140, 0)
hp_color1 = PARA_CTB::HP_COLOR_LEFT
hp_color2 = PARA_CTB::HP_COLOR_RIGHT
draw_meter(actor.hp, actor.maxhp, 316, 18, 112, 8, hp_color1, hp_color2)
draw_actor_hp(actor, 284, 0)
sp_color1 = PARA_CTB::SP_COLOR_LEFT
sp_color2 = PARA_CTB::SP_COLOR_RIGHT
draw_meter(actor.sp, actor.maxsp, 492, 18, 112, 8, sp_color1, sp_color2)
draw_actor_sp(actor, 460, 0)
@actor = actor
@text = nil
self.visible = true
else
set_actor_ctb(actor)
end
end
#--------------------------------------------------------------------------
# ? ??????
# enemy : ????????????????
#--------------------------------------------------------------------------
alias set_enemy_ctb set_enemy
def set_enemy(enemy)
if PARA_CTB::HELP_DRAWING_MATER_ENEMY
self.contents.clear
draw_actor_name(enemy, 4, 0)
draw_actor_state(enemy, 140, 0)
hp_color1 = PARA_CTB::HP_COLOR_LEFT
hp_color2 = PARA_CTB::HP_COLOR_RIGHT
draw_meter(enemy.hp, enemy.maxhp, 316, 18, 112, 8, hp_color1, hp_color2)
draw_actor_hp(enemy, 284, 0)
sp_color1 = PARA_CTB::SP_COLOR_LEFT
sp_color2 = PARA_CTB::SP_COLOR_RIGHT
draw_meter(enemy.sp, enemy.maxsp, 492, 18, 112, 8, sp_color1, sp_color2)
draw_actor_sp(enemy, 460, 0)
self.visible = true
else
set_enemy_ctb(enemy)
end
end
end
#------------------------------------------------------------------------------
# ? End SDK Enable Test
#------------------------------------------------------------------------------
end
Above main, and below everything else and the SDK. Yes, SDK 1.5 is mandatory.