alias old_set_graphic set_graphic
def set_graphic(character_name, character_index)
old_set_graphic(character_name, character_index)
@original_pattern = 0
end
#--------------------------------------------------------------------------
# ● 更改方向,不需要重置stop_count
#--------------------------------------------------------------------------
def set_direction(d)
@direction = d if !@direction_fix && d != 0
end
end
class Game_Character < Game_CharacterBase
#--------------------------------------------------------------------------
# ● 更新动画图案
#--------------------------------------------------------------------------
def update_anime_pattern
#1.静止时,有无动态图
if (!@step_anime && @stop_count > 0)
if @frame_s == 0 #无动态图,则采用行走图
@pattern = (@pattern + 1) % @frame_m
else #有动态图
@pattern = (@pattern + 1) % @frame_s
end
#2.踏步动画或移动中时
else
if @frame_m == 0 #无行走图,则采用静止动态图
@pattern = (@pattern + 1) % @frame_s
else #有行走图则采用行走图
@pattern = @frame_s + (@pattern - @frame_s + 1) % @frame_m
end
end
end
#--------------------------------------------------------------------------
# ● 更新动画计数
#--------------------------------------------------------------------------
def update_anime_count
if moving? && @walk_anime
@anime_count += 1.5
elsif @step_anime || @pattern != @original_pattern || @frame_s > 1 || @walk_anime#静止有动态图时也要更新计数
@anime_count += 0.75
end
end
end