Professional Documents
Culture Documents
#==============================================================================
# ** Game_CharacterBase
#-----------------------------------------------------------------------------# This class deals with characters. Common to all characters, stores basic
# data, such as coordinates and graphics. It's used as a superclass of the
# Game_Character class.
#==============================================================================
class Game_CharacterBase
#-------------------------------------------------------------------------# * Public Instance Variables
#-------------------------------------------------------------------------attr_reader :pose_sufix
attr_accessor :pose_list
attr_accessor :idle_stance
attr_accessor :walk_stance
attr_accessor :dash_stance
attr_accessor :jump_stance
#-------------------------------------------------------------------------# * Overwrite method: update_animation
#-------------------------------------------------------------------------def update_animation
update_anime_count
if (@pose_speed != 0 && @anime_count > @pose_speed) ||
(@pose_speed == 0 && @anime_count > 18 - real_move_speed * 2)
update_anime_pattern
@anime_count = 0
change_pose(idle_stance) if @pattern == 0 && @playing_pose && !@pose_loop
end
end
#-------------------------------------------------------------------------# * Alias method: init_public_members
#-------------------------------------------------------------------------alias :init_public_members_ve_character_control :init_public_members
def init_public_members
init_public_members_ve_character_control
@pose_list = []
@pose_sufix = ""
clear_stances
end
#-------------------------------------------------------------------------# * Alias method: init_private_members
#-------------------------------------------------------------------------alias :init_private_members_ve_character_control :init_private_members
def init_private_members
init_private_members_ve_character_control
change_pose(idle_stance)
end
#-------------------------------------------------------------------------# * Alias method: update_anime_count
#-------------------------------------------------------------------------alias :update_anime_count_ve_character_control :update_anime_count
def update_anime_count
if @playing_pose
@anime_count += 1.5
else
update_anime_count_ve_character_control
end
end
#--------------------------------------------------------------------------
@jump_stance = VE_DEFAULT_JUMP_SUFIX
end
end
#==============================================================================
# ** Game_Interpreter
#-----------------------------------------------------------------------------# An interpreter for executing event commands. This class is used within the
# Game_Map, Game_Troop, and Game_Event classes.
#==============================================================================
class Game_Interpreter
#-------------------------------------------------------------------------# * Alias method: comment_call
#-------------------------------------------------------------------------alias :comment_call_ve_character_control :comment_call
def comment_call
call_clear_pose("EVENT")
call_clear_pose("ACTOR")
call_change_stance("EVENT")
call_change_stance("ACTOR")
call_change_pose("EVENT", "ADD POSE")
call_change_pose("ACTOR", "ADD POSE")
call_change_pose("EVENT", "CHANGE POSE")
call_change_pose("ACTOR", "CHANGE POSE")
comment_call_ve_character_control
end
#-------------------------------------------------------------------------# * New method: call_clear_pose
#-------------------------------------------------------------------------def call_clear_pose(type)
note.scan(/<#{type} CLEAR POSE: (\d+)>/i) do
subject = $game_map.events[$1.to_i] if type == "EVENT"
subject = $game_map.actors[$1.to_i] if type == "ACTOR"
next unless subject
subject.clear_poses
end
end
#-------------------------------------------------------------------------# * New method: call_clear_stances
#-------------------------------------------------------------------------def call_clear_stances(type)
note.scan(/<#{type} CLEAR STANCES: (\d+)>/i) do
subject = $game_map.events[$1.to_i] if type == "EVENT"
subject = $game_map.actors[$1.to_i] if type == "ACTOR"
next unless subject
subject.clear_stances
end
end
#-------------------------------------------------------------------------# * New method: call_change_stance
#-------------------------------------------------------------------------def call_change_stance(type)
regexp = /<#{type} (\w+) STANCE (\d+): #{get_filename}>/i
note.scan(regexp) do |move, id, value|
subject = $game_map.events[id.to_i] if type == "EVENT"
subject = $game_map.actors[id.to_i] if type == "ACTOR"
next unless subject
subject.idle_stance = value if move.upcase == "IDLE"
subject.walk_stance = value if move.upcase == "WALK"
if $imported[:ve_visual_equip]
return set_bitmap_name_ve_character_control
elsif character_exist?(@character_name + sufix)
return @character_name + sufix
elsif character_exist?(@character_name + @pose_sufix)
return @character_name + @pose_sufix
else
return set_bitmap_name_ve_character_control
end
end
#-------------------------------------------------------------------------# * Alias method: set_bitmap_position
#-------------------------------------------------------------------------alias :set_bitmap_position_ve_character_control :set_bitmap_position
def set_bitmap_position
set_bitmap_position_ve_character_control
self.ox -= (@character_name[/\[x([+-]?\d+)\]/i] ? $1.to_i : 0)
self.oy -= (@character_name[/\[y([+-]?\d+)\]/i] ? $1.to_i : 0)
end
end
#==============================================================================
# ** Window_Base
#-----------------------------------------------------------------------------# This is a superclass of all windows in the game.
#==============================================================================
class Window_Base < Window
#-------------------------------------------------------------------------# * Alias method: draw_character
#-------------------------------------------------------------------------alias :draw_character_ve_character_control :draw_character
def draw_character(character_name, character_index, x, y, parts = nil)
return unless character_name
x += (character_name[/\[x([+-]?\d+)\]/i] ? $1.to_i : 0)
y += (character_name[/\[y([+-]?\d+)\]/i] ? $1.to_i : 0)
args = [character_name, character_index, x, y]
args.push(parts) if $imported[:ve_visual_equip]
draw_character_ve_character_control(*args)
end
end