Jump to content
Shadow

Problem with map animations

Recommended Posts

I put this topic here because I think we gonna need a script fot this bug... Well, here is the problem: When I create an event who call itself an animation, the animation shows perfect, but if I move around the map and scroll it, the animation moves too, I take a screenshot

 

2z880mt.jpg

 

How you can see in the image, the event is in the electric panel, and me move to the right, the screen scroll too and the animation come with me... =(

 

EDIT: SOLVED

Edited by Shadow

Share this post


Link to post
Share on other sites

That's funny I was just trying to fix this bug myself this morning. It is indeed annoying and after looking around a bit it seems like this bug was present in VX too.

Here's a thread where Woratana posted a fix for VX: http://www.rpgrevolution.com/forums/?showtopic=14160

 

I tried this in VX and it works. I also adapted it for Ace, and while it does work, it is kinda choppy, and not as smooth as on VX. I haven't figured out why yet. I'll study the Sprite_Base class more and see if I can figure out why.

 

If you want to try the code paste this in to the editor:

 

 

class Sprite_Base
 alias_method :update_anim_fix_kal, :update
 def update
   set_animation_origin unless @animation.nil?
   update_anim_fix_kal
 end
end

Share this post


Link to post
Share on other sites

Because it needs to be updated with update_animation instead.

 

class Sprite_Base < Sprite
 alias update_animation_bugfix update_animation
 def update_animation
   set_animation_origin if animation?
   update_animation_bugfix
 end
end

 

Also, I don't think this is so much a bug as it is an intended feature. Certain animations like a slash on an event would make more sense if it was set in one position rather than following an event if the event were moving. This "bug" just so happens to look awkward in the instance OP posted.

Edited by Guile

Share this post


Link to post
Share on other sites

Because it needs to be updated with update_animation instead.

 

class Sprite_Base < Sprite
 alias update_animation_bugfix update_animation
 def update_animation
set_animation_origin if animation?
update_animation_bugfix
 end
end

 

Also, I don't think this is so much a bug as it is an intended feature. Certain animations like a slash on an event would make more sense if it was set in one position rather than following an event if the event were moving. This "bug" just so happens to look awkward in the instance OP posted.

 

So a slash makes more sense if it moves away from the target as the player scrolls the screen? If I set an animation to be played on an event, then I expect it to stay in one place, and not move if the screen starts to move. At the very least there needs to be an option to choose whether the animation should stay in on place or move with the screen.

 

Also, why post that code when it's the exact equivalent to what I posted?

Share this post


Link to post
Share on other sites

It isn't the same. Try it out yourself.

 

And what I was saying was the slash makes more sense if it stays locked on the screen instead of following the event.

Share this post


Link to post
Share on other sites

Ah I see, you are right. Sorry, my bad. Looks like we have a solution then! :)

 

Alright, I see what you mean with the slash now. It seems to me that there are some situations where it makes more sense for it to follow the event, and other's where it doesn't, so it's good to have both options available. What about posting this in the completed scripts section? Because I'm sure people are going to ask the same question about this animation quirk down the line.

 

edit: hold on a sec

 

It should be the same. Look at this:

 

 

 def animation?
   @animation != nil
 end

 

Therefore, saying

 

 

set_animation_origin if animation?

 

is the exact same thing as saying

 

 

set_animation_origin unless @animation.nil?

 

 

Actually now I'm getting kinda confused here. Trying this again, it seems to me that there is no noticeable difference between the version I posted and the one Guile posted. I don't know why I thought it looked choppy before, it doesn't seem that way now. Can somebody else test this?

Edited by kal

Share this post


Link to post
Share on other sites

No use posting it because it's not a script, much less even so a scriptlet as Jet calls them. Plus I'm reluctant on posting this myself because I don't consider this a bug. Just a situational off-chance quirk that something looks awkward.

 

If you wish to take credit for it since you're the one who started the "fix", then by all means do so. All I did was post a correction.

Share this post


Link to post
Share on other sites

I don't know if you saw the edit I did or not so I'm gonna post again here.

Share this post


Link to post
Share on other sites

I saw it and was posting a reply.

 

Actually now I'm getting kinda confused here. Trying this again, it seems to me that there is no noticeable difference between the version I posted and the one Guile posted. I don't know why I thought it looked choppy before, it doesn't seem that way now. Can somebody else test this?

 

The difference isn't in animation? and @animation.nil? Those two are the same. The difference is the location you've marked your alias. You've marked your alias in Sprite_Base#update, whereas I marked my alias in Sprite_Base#update_animation. Because of the location you marked your alias, the repositioning occurs first before the super method of update is ran. I don't know what goes on in the super method, but I assume it's stuff that adjusts the position to the viewport the sprite is in, the positioning of the screen, and the positioning of the sprite origin before it mends to whatever the update_animation does. If you change the marked position of the alias to after, then you would get hit by the class variable clears. So, the only place you can position the alias is at the start of update_animation without choppiness.

Share this post


Link to post
Share on other sites

Ah I see I missed that. Now looking at both version for a some time it seems like they are both slightly choppy, though yours is less so than mine. It seems like the animation is playing a little smoother when the screen is not moving in both cases. It's weird because in woratana's VX version I didn't notice any choppiness at all.

Share this post


Link to post
Share on other sites

It's weird because in woratana's VX version I didn't notice any choppiness at all.

 

Woratana's version has more triggerable choppiness. How to do it, I have no desires in undergoing the details since it's an age old script and there's been other script fixes made that render his obsolete.

Share this post


Link to post
Share on other sites

The version I'm talking about (link in the first post I made) is just copying the set_animation_origin method at the beginning of the update method. That's were I got my original version from. Still don't understand why it's so smooth in VX and choppy in Ace, but something must have changed one way or another.

Share this post


Link to post
Share on other sites

Hmmm, didnt understand nothing xDD, I try the two versions and no one works for me. I try to do a lot of things like stopping the animation and set again and nothing with events can fix my problem.

Share this post


Link to post
Share on other sites

Are you sure about that? Paste this in the editor and do it below Sprite_Base

 

class Sprite_Base
 alias update_animation_bugfix update_animation
 def update_animation
   set_animation_origin if animation?
   update_animation_bugfix
 end
end

  • Like 1

Share this post


Link to post
Share on other sites

It doesnt work for me, didnt know why, but the animation didnt work :S I look all my scripts and no one take sprite_base so dont understand. And sorry for my poor english xD

Share this post


Link to post
Share on other sites

Try on a new project without any other scripts. If that doesn't work something is wrong with your VXA.

Share this post


Link to post
Share on other sites

Yep, I try it in a new project and works correctly, Gonna check it out around the scripts and look what is the problem, thank you kal =), maybe I should take this topic sholved?

Share this post


Link to post
Share on other sites

I found the scripts that give me the problem, is a part of the tankentai side wiew battle, im gonna put the script here, so if anyone can fix this.

 

 

#==============================================================================
# â–  Scene_Battle
#------------------------------------------------------------------------------
#  ãƒãƒˆãƒ«ç”»é¢ã®å‡¦ç†ã‚’行ã†ã‚¯ãƒ©ã‚¹ã§ã™ã€‚
#==============================================================================
class Scene_Battle < Scene_Base
 #--------------------------------------------------------------------------
 # ◠フレーム更新(基本)
 #--------------------------------------------------------------------------
 alias update_basic_scene_battle_n03 update_basic
 def update_basic
update_basic_scene_battle_n03
$sv_camera.update
$sv_camera.wait = N03::TURN_END_WAIT if $sv_camera.win_wait
camera_wait
 end
 #--------------------------------------------------------------------------
 # ◠カメラウェイト
 #--------------------------------------------------------------------------
 def camera_wait
while $sv_camera.wait != 0
  Graphics.update
  Input.update
  update_all_windows
  $game_timer.update
  $game_troop.update
  $sv_camera.update
  @spriteset.update
  update_info_viewport
  update_message_open
  $sv_camera.wait -= 1 if $sv_camera.wait > 0
  $sv_camera.wait = 1 if $sv_camera.wait == 0 && @spriteset.effect?
  BattleManager.victory if $sv_camera.win_wait && $sv_camera.wait == 0
end
 end
 #--------------------------------------------------------------------------
 # ◠カメラウェイトã®ã‚»ãƒƒãƒˆ
 #--------------------------------------------------------------------------
 def set_camera_wait(time)
$sv_camera.wait = time
camera_wait
 end
 #--------------------------------------------------------------------------
 # ◠エフェクト実行ãŒçµ‚ã‚ã‚‹ã¾ã§ã‚¦ã‚§ã‚¤ãƒˆ ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def wait_for_effect
 end
 #--------------------------------------------------------------------------
 # ◠ターン開始
 #--------------------------------------------------------------------------
 alias turn_start_scene_battle_n03 turn_start
 def turn_start
turn_start_scene_battle_n03
N03.camera(nil, N03::BATTLE_CAMERA["ターン開始後"].dup)
 end
 #--------------------------------------------------------------------------
 # ◠ターン終了
 #--------------------------------------------------------------------------
 alias turn_end_scene_battle_n03 turn_end
 def turn_end
turn_end_scene_battle_n03
for member in $game_troop.members + $game_party.members
  N03.set_damage(member, member.sv.result_damage[0],member.sv.result_damage[1])
  member.sv.result_damage = [0,0]
  @spriteset.set_damage_pop(member) if member.result.hp_damage != 0 or member.result.mp_damage != 0
end
set_camera_wait(N03::TURN_END_WAIT)
N03.camera(nil, N03::BATTLE_CAMERA["ターン開始å‰"].dup) if $game_party.inputable?
@log_window.clear
 end
 #--------------------------------------------------------------------------
 # ◠スキルï¼ã‚¢ã‚¤ãƒ†ãƒ ã®ä½¿ç”¨ ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def use_item
item = @subject.current_action.item
display_item(item)
@subject.use_item(item)
refresh_status
@targets = @subject.current_action.make_targets.compact
@targets = [@subject] if @targets.size == 0
set_substitute(item)
for time in item.repeats.times do play_sideview(@targets, item) end
end_reaction(item)
display_end_item
 end
 #--------------------------------------------------------------------------
 # ◠スキルï¼ã‚¢ã‚¤ãƒ†ãƒ å®Ÿè¡Œ
 #--------------------------------------------------------------------------
 def display_item(item)
return @log_window.display_use_item(@subject, item) if N03::BATTLE_LOG
@log_window.off
@skill_name_window = Window_Skill_name.new(item.name) unless N03::NO_DISPLAY_SKILL_ID.include?(item.id) && item.is_a?(RPG::Skill)
 end
 #--------------------------------------------------------------------------
 # ◠スキルï¼ã‚¢ã‚¤ãƒ†ãƒ åã®è¡¨ç¤º
 #--------------------------------------------------------------------------
 def display_item(item)
return @log_window.display_use_item(@subject, item) if N03::BATTLE_LOG
@log_window.off
@skill_name_window = Window_Skill_name.new(item.name) unless N03::NO_DISPLAY_SKILL_ID.include?(item.id) && item.is_a?(RPG::Skill)
 end
 #--------------------------------------------------------------------------
 # ◠スキルï¼ã‚¢ã‚¤ãƒ†ãƒ åã®è¡¨ç¤ºçµ‚了
 #--------------------------------------------------------------------------
 def display_end_item
@skill_name_window.dispose if @skill_name_window != nil
@skill_name_window = nil
set_camera_wait(N03::ACTION_END_WAIT) if @subject.sv.derivation_skill_id == 0
@log_window.clear if N03::BATTLE_LOG
 end
 #--------------------------------------------------------------------------
 # â— åæ’ƒï¼é­”法åå°„ï¼èº«ä»£ã‚り処ç†
 #--------------------------------------------------------------------------
 def end_reaction(item)
end_substitute if @substitute != nil
set_reflection(item) if @reflection_data != nil
set_counter_attack if @counter_attacker != nil
 end
 #--------------------------------------------------------------------------
 # â— åæ’ƒã®ç™ºå‹• ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def invoke_counter_attack(target, item)
return if @subject.sv.counter_id != 0
@counter_attacker = [] if @counter_attacker == nil
return apply_item_effects(apply_substitute(target, item), item) if !target.movable?
@log_window.add_text(sprintf(Vocab::CounterAttack, target.name)) if N03::BATTLE_LOG
target.sv.counter_id = target.sv.counter_skill_id
@counter_attacker.push(target)
 end
 #--------------------------------------------------------------------------
 # ◠魔法åå°„ã®ç™ºå‹• ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def invoke_magic_reflection(target, item)
return if @subject.sv.reflection_id != 0
@log_window.add_text(sprintf(Vocab::MagicReflection, target.name)) if N03::BATTLE_LOG
target.sv.reflection_id = target.sv.reflection_anime_id
 end
 #--------------------------------------------------------------------------
 # ◠身代ã‚りã®é©ç”¨ ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def apply_substitute(target, item)
return target if @substitute == nil
return @substitute
 end
 #--------------------------------------------------------------------------
 # ◠身代ã‚りセット
 #--------------------------------------------------------------------------
 def set_substitute(item)
@substitute = N03.get_enemy_unit(@subject).substitute_battler
return if @substitute == nil
s_targets = []
for i in 0...@targets.size
  next if @targets[i] == @substitute
  next if !check_substitute(@targets[i], item)
  @log_window.add_text(sprintf(Vocab::Substitute, @substitute.name, @targets[i].name))
  @targets[i].sv.start_action(@targets[i].sv.substitute_receiver_start_action)
  s_targets.push(@targets[i])
  @targets[i] = @substitute
end
return if s_targets == []
@substitute.sv.set_target(s_targets)
@substitute.sv.start_action(@substitute.sv.substitute_start_action)
 end
 #--------------------------------------------------------------------------
 # ◠身代ã‚り終了
 #--------------------------------------------------------------------------
 def end_substitute
for member in @substitute.sv.target_battler
  member.sv.start_action(member.sv.substitute_receiver_end_action)
end
@substitute.sv.start_action(@substitute.sv.substitute_end_action)
@substitute = nil
 end
 #--------------------------------------------------------------------------
 # â— åæ’ƒ
 #--------------------------------------------------------------------------
 def set_counter_attack
pre_subject = @subject
for attacker in @counter_attacker
  @subject = attacker
  item = $data_skills[attacker.sv.counter_skill_id]
  play_sideview([pre_subject], item)
  @subject.sv.counter_id = 0
end
@subject = pre_subject
@counter_attacker = nil
 end
 #--------------------------------------------------------------------------
 # ◠魔法åå°„
 #--------------------------------------------------------------------------
 def set_reflection(item)
@log_window.back_to(1)
for data in @reflection_data
  @subject.sv.damage_action(@subject, item)
  N03.set_damage_anime_data(@subject, data)
  apply_item_effects(@subject, item)
  @spriteset.set_damage_pop(@subject)
end
set_camera_wait(N03.get_anime_time(@reflection_data[0][0]))
@reflection_data = nil
 end
 #--------------------------------------------------------------------------
 # ◠サイドビューアクション実行
 #--------------------------------------------------------------------------
 def play_sideview(targets, item)
@subject.sv.set_target(targets)
return if @subject.sv.attack_action(item) == nil
return if !@subject.movable?
return if item.scope != 9 && item.scope != 10 && !N03.targets_alive?(targets)
@subject.sv.start_action(@subject.sv.attack_action(item))
loop do
  update_basic
  data = @subject.sv.play_data
  second_targets_set				if data[0] == "second_targets_set"
  targets_set					   if data[0] == "targets_set"
  @immortal = N03.immortaling	   if data[0] == "no_collapse"
  @immortal = N03.unimmortaling	 if data[0] == "collapse"
  next set_move_anime(item)		 if @subject.sv.m_a_data != []
  set_damage(item)				  if @subject.sv.set_damage
  break N03.derived_skill(@subject) if @subject.sv.derivation_skill_id != 0
  break							 if @subject.sv.action_end
end
@immortal = N03.unimmortaling	   if @immortal
 end
 #--------------------------------------------------------------------------
 # ◠ターゲットをセカンドターゲットã¸
 #--------------------------------------------------------------------------
 def second_targets_set
@targets = @subject.sv.second_targets
@subject.sv.target_battler = @subject.sv.second_targets
 end
 #--------------------------------------------------------------------------
 # ◠セカンドターゲットをターゲットã¸
 #--------------------------------------------------------------------------
 def targets_set
@subject.sv.second_targets = @subject.current_action.make_targets.compact
@subject.sv.target_battler = @subject.sv.second_targets
 end
 #--------------------------------------------------------------------------
 # ◠ダメージã®å®Ÿè¡Œ
 #--------------------------------------------------------------------------
 def set_damage(item)
targets = @targets
targets = [@subject.sv.individual_targets[0]] if @subject.sv.individual_targets.size != 0
for target in targets do damage_anime(target, item) end
@subject.sv.set_damage = false
@subject.sv.damage_anime_data = []
 end
 #--------------------------------------------------------------------------
 # ◠ダメージ戦闘アニメ処ç†
 #--------------------------------------------------------------------------
 def damage_anime(target, item)
@log_window.back_to(1) if @log_window.line_number == 5
@miss = false
invoke_item(target,item)
if target.result.missed
  target.sv.miss_action(@subject, item)
  return @miss = true
elsif target.result.evaded or target.sv.counter_id != 0
  target.sv.evasion_action(@subject, item)
  return @miss = true
elsif target.sv.reflection_id != 0
  N03.set_damage_anime_data(target, [target.sv.reflection_id, false, false, true])
  target.sv.reflection_id = 0
  @reflection_data = [] if @reflection_data == nil
  return @reflection_data.push([N03.get_attack_anime_id(-3, @subject), false, false, true])
end
target.sv.damage_action(@subject, item)
N03.set_damage(@subject, -target.result.hp_drain, -target.result.mp_drain)
@spriteset.set_damage_pop(target)
@spriteset.set_damage_pop(@subject) if @subject.result.hp_damage != 0 or @subject.result.mp_damage != 0
N03.set_damage_anime_data(target, @subject.sv.damage_anime_data) if @subject.sv.damage_anime_data != []
 end
 #--------------------------------------------------------------------------
 # ◠飛ã°ã—アニメ処ç†
 #--------------------------------------------------------------------------
 def set_move_anime(item)
for data in @subject.sv.m_a_data
  @subject.sv.damage_anime_data = data[4]
  hit_targets = []
  for target in data[1]
	damage_anime(target, item) if data[0]
	hit_targets.push(target) if !@miss
  end
  @miss = false if !data[3]
  @spriteset.set_hit_animation(@subject, data[2], hit_targets, @miss)
end
@subject.sv.set_damage = false
@subject.sv.m_a_data = []
 end
end
#==============================================================================
# â–  DataManager
#------------------------------------------------------------------------------
#  データベースã¨ã‚²ãƒ¼ãƒ ã‚ªãƒ–ジェクトを管ç†ã™ã‚‹ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã§ã™ã€‚
#==============================================================================
module DataManager
 #--------------------------------------------------------------------------
 # â— å„種ゲームオブジェクトã®ä½œæˆ ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def self.create_game_objects
$game_temp		  = Game_Temp.new
$game_system		= Game_System.new
$game_timer		 = Game_Timer.new
$game_message	   = Game_Message.new
$game_switches	  = Game_Switches.new
$game_variables	 = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_actors		= Game_Actors.new
$game_party		 = Game_Party.new
$game_troop		 = Game_Troop.new
$game_map		   = Game_Map.new
$game_player		= Game_Player.new
$sv_camera		  = Battle_Camera.new
 end
end
#==============================================================================
# â–  BattleManager
#------------------------------------------------------------------------------
#  戦闘ã®é€²è¡Œã‚’管ç†ã™ã‚‹ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã§ã™ã€‚
#==============================================================================
module BattleManager
 #--------------------------------------------------------------------------
 # ◠エンカウント時ã®å‡¦ç† ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def self.on_encounter
@preemptive = (rand < rate_preemptive)
@surprise = (rand < rate_surprise && !@preemptive)
$sv_camera.mirror = @surprise if N03::BACK_ATTACK
 end
 #--------------------------------------------------------------------------
 # â— å‹åˆ©ã®å‡¦ç† ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def self.process_victory
$sv_camera.win_wait = true
 end
 #--------------------------------------------------------------------------
 # â— å‹åˆ©
 #--------------------------------------------------------------------------
 def self.victory
$sv_camera.win_wait = false
N03.camera(nil, N03::BATTLE_CAMERA["戦闘終了時"].dup)
for member in $game_party.members do member.sv.start_action(member.sv.win) if member.movable? end
play_battle_end_me
replay_bgm_and_bgs
$game_message.add(sprintf(Vocab::Victory, $game_party.name))
display_exp
gain_gold
gain_drop_items
gain_exp
SceneManager.return
battle_end(0)
return true
 end
 #--------------------------------------------------------------------------
 # ◠逃走ã®å‡¦ç† ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def self.process_escape
$game_message.add(sprintf(Vocab::EscapeStart, $game_party.name))
success = @preemptive ? true : (rand < @escape_ratio)
Sound.play_escape
if success
  process_abort
  for member in $game_party.members do member.sv.start_action(member.sv.escape) if member.movable? end
else
  @escape_ratio += 0.1
  $game_message.add('\.' + Vocab::EscapeFailure)
  $game_party.clear_actions
  for member in $game_party.members do member.sv.start_action(member.sv.escape_ng) if member.movable? end
end
wait_for_message
return success
 end
 #--------------------------------------------------------------------------
 # ◠次ã®ã‚³ãƒžãƒ³ãƒ‰å…¥åŠ›ã¸ â˜…å†å®šç¾©
 #--------------------------------------------------------------------------
 def self.next_command
begin
  if !actor || !actor.next_command
	@actor_index += 1
	if @actor_index >= $game_party.members.size
	  for member in $game_party.battle_members.reverse
		break member.sv.start_action(member.sv.command_a) if member.inputable?
	  end
	  return false
	end
  end
end until actor.inputable?
actor.sv.start_action(actor.sv.command_ if actor != nil && actor.inputable?
if pre_actor
  pre_actor.sv.start_action(pre_actor.sv.command_a) if pre_actor != nil && pre_actor.inputable?
end
return true
 end
 #--------------------------------------------------------------------------
 # â— å‰ã®ã‚³ãƒžãƒ³ãƒ‰å…¥åŠ›ã¸ â˜…å†å®šç¾©
 #--------------------------------------------------------------------------
 def self.prior_command
begin
  if !actor || !actor.prior_command
	@actor_index -= 1
	if @actor_index < 0
	  for member in $game_party.battle_members
		break member.sv.start_action(member.sv.command_a) if member.inputable?
	  end
	  return false
	end
  end
end until actor.inputable?
actor.sv.start_action(actor.sv.command_ if actor.inputable?
after_actor.sv.start_action(after_actor.sv.command_a) if after_actor != nil && after_actor.inputable?
return true
 end
 #--------------------------------------------------------------------------
 # ◠コマンド入力å‰ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã‚’å–å¾—
 #--------------------------------------------------------------------------
 def self.pre_actor
return if @actor_index == 0
$game_party.members[@actor_index - 1]
 end
 #--------------------------------------------------------------------------
 # ◠コマンド入力後ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã‚’å–å¾—
 #--------------------------------------------------------------------------
 def self.after_actor
$game_party.members[@actor_index + 1]
 end
 #--------------------------------------------------------------------------
 # ◠戦闘行動者をå‰ã«è¿½åŠ 
 #--------------------------------------------------------------------------
 def self.unshift_action_battlers(battler)
@action_battlers.unshift(battler)
 end
end
#==============================================================================
# â–  Game_Battler
#------------------------------------------------------------------------------
#  スプライトや行動ã«é–¢ã™ã‚‹ãƒ¡ã‚½ãƒƒãƒ‰ã‚’追加ã—ãŸãƒãƒˆãƒ©ãƒ¼ã®ã‚¯ãƒ©ã‚¹ã§ã™ã€‚
#==============================================================================
class Game_Battler < Game_BattlerBase
 #--------------------------------------------------------------------------
 # ◠公開インスタンス変数
 #--------------------------------------------------------------------------
 attr_reader   :sv					 # サイドビューデータ
 #--------------------------------------------------------------------------
 # â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
 #--------------------------------------------------------------------------
 alias initialize_game_battler_n03 initialize
 def initialize
initialize_game_battler_n03
@sv = SideView.new(self)
 end
 #--------------------------------------------------------------------------
 # â— ç¾åœ¨ã®æˆ¦é—˜è¡Œå‹•を除去
 #--------------------------------------------------------------------------
 alias remove_current_action_game_battler_n03 remove_current_action
 def remove_current_action
return @sv.derivation_skill_id = 0 if @sv.derivation_skill_id != 0
remove_current_action_game_battler_n03
 end
 #--------------------------------------------------------------------------
 # ◠ターン終了処ç†
 #--------------------------------------------------------------------------
 alias on_turn_end_game_battler_n03 on_turn_end
 def on_turn_end
on_turn_end_game_battler_n03
@sv.add_state = []
@sv.result_damage = [@result.hp_damage, @result.mp_damage]
 end
 #--------------------------------------------------------------------------
 # ◠パラメータæ¡ä»¶æ¯”較 data = [種別, 数値, 判別]
 #--------------------------------------------------------------------------
 def comparison_parameter(data)
return true if data[0][0] == 0
kind = data[0]
num = data[1]
select = data[2]
case kind
when  1 ; par = level
when  2 ; par = mhp
when  3 ; par = mmp
when  4 ; par = hp
when  5 ; par = mp
when  6 ; par = tp
when  7 ; par = atk
when  8 ; par = self.def
when  9 ; par = mat
when 10 ; par = mdf
when 11 ; par = agi
when 12 ; par = luk
end
if num < 0
  case kind
  when  4 ; num = mhp * num / 100
  when  5 ; num = mmp * num / 100
  when  6 ; num = max_tp * num / 100
  end
  num = num.abs
end
case select
when  0 ; return par == num
when  1 ; return par < num
when  2 ; return par > num
end
 end
 #--------------------------------------------------------------------------
 # ◠装備æ¡ä»¶æ¯”較 data = [装備種別, タイプID]
 #--------------------------------------------------------------------------
 def comparison_equip(data)
kind = data[0]
items = weapons if kind == 0
items = armors  if kind == 1
for item in items
  for id in data[1]
	return true if id > 0 && item.is_a?(RPG::Weapon) && item == $data_weapons[id.abs]
	return true if id > 0 && item.is_a?(RPG::Armor) && item == $data_armors[id.abs]
	return true if id < 0 && item.is_a?(RPG::Weapon) && item.wtype_id == id.abs
	return true if id < 0 && item.is_a?(RPG::Armor) && item.stype_id == id.abs
  end
end
return false
 end

end
#==============================================================================
# â–  Game_Actor
#------------------------------------------------------------------------------
#  アクターを扱ã†ã‚¯ãƒ©ã‚¹ã§ã™ã€‚
#==============================================================================
class Game_Actor < Game_Battler
 #--------------------------------------------------------------------------
 # ◠公開インスタンス変数
 #--------------------------------------------------------------------------
 attr_reader :actor_id					# ID
 #--------------------------------------------------------------------------
 # â— ID
 #--------------------------------------------------------------------------
 def id
return @actor_id
 end
 #--------------------------------------------------------------------------
 # ◠スプライトを使ã†ã‹ï¼Ÿ ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def use_sprite?
return true
 end
 #--------------------------------------------------------------------------
 # ◠ダメージ効果ã®å®Ÿè¡Œ ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def perform_damage_effect
return if !N03::ACTOR_DAMAGE
$game_troop.screen.start_shake(5, 5, 10)
@sprite_effect_type = :blink
Sound.play_actor_damage
 end

end
#==============================================================================
# â–  Game_Enemy
#------------------------------------------------------------------------------
#  敵キャラを扱ã†ã‚¯ãƒ©ã‚¹ã§ã™ã€‚
#==============================================================================
class Game_Enemy < Game_Battler
 #--------------------------------------------------------------------------
 # ◠公開インスタンス変数
 #--------------------------------------------------------------------------
 attr_reader :enemy_id					# ID
 #--------------------------------------------------------------------------
 # â— ID
 #--------------------------------------------------------------------------
 def id
return @enemy_id
 end
 #--------------------------------------------------------------------------
 # ◠レベル
 #--------------------------------------------------------------------------
 def level
return @sv.level
 end
 #--------------------------------------------------------------------------
 # ◠ダメージ効果ã®å®Ÿè¡Œ ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def perform_damage_effect
return if !N03::ENEMY_DAMAGE
@sprite_effect_type = :blink
Sound.play_enemy_damage
 end
 #--------------------------------------------------------------------------
 # ◠武器
 #--------------------------------------------------------------------------
 def weapons
weapon1 = $data_weapons[@sv.enemy_weapon1_id]
weapon2 = $data_weapons[@sv.enemy_weapon2_id]
return [weapon1, weapon2]
 end
 #--------------------------------------------------------------------------
 # ◠防具
 #--------------------------------------------------------------------------
 def armors
return [$data_armors[@sv.enemy_shield_id]]
 end
 #--------------------------------------------------------------------------
 # ◠二刀æµã®åˆ¤å®š
 #--------------------------------------------------------------------------
 def dual_wield?
return $data_weapons[@sv.enemy_weapon2_id] != nil
 end
 #--------------------------------------------------------------------------
 # â— ãƒãƒˆãƒ©ãƒ¼ç”»åƒå¤‰æ›´
 #--------------------------------------------------------------------------
 def graphics_change(battler_name)
@battler_name = battler_name
 end
 #--------------------------------------------------------------------------
 # ◠通常攻撃 アニメーション ID ã®å–å¾—
 #--------------------------------------------------------------------------
 def atk_animation_id1
return weapons[0].animation_id if weapons[0]
return weapons[1] ? 0 : 1
 end
 #--------------------------------------------------------------------------
 # ◠通常攻撃 アニメーション ID ã®å–得(二刀æµï¼šæ­¦å™¨ï¼’)
 #--------------------------------------------------------------------------
 def atk_animation_id2
return weapons[1] ? weapons[1].animation_id : 0
 end
end
#==============================================================================
# â–  Sprite_Base
#------------------------------------------------------------------------------
#  アニメーションã®è¡¨ç¤ºå‡¦ç†ã‚’追加ã—ãŸã‚¹ãƒ—ライトã®ã‚¯ãƒ©ã‚¹ã§ã™ã€‚
#==============================================================================
class Sprite_Base < Sprite
 #--------------------------------------------------------------------------
 # ◠アニメーションã®åº§æ¨™æ›´æ–° (ホーミングã‚り)
 #--------------------------------------------------------------------------
 def update_animation_position_horming
return if @action_end_cancel
ani_ox_set if @horming
camera_zoom = $sv_camera.zoom
camera_zoom = 1 if @move_anime
kind = 1
kind = -1 if @ani_mirror && !@anime_no_mirror
cell_data = @animation.frames[@animation.frame_max - (@ani_duration + @ani_rate - 1) / @ani_rate].cell_data
for i in 0..15
  @ani_sprites[i].x = (@ani_ox + cell_data[i, 1] * kind - $sv_camera.x) * camera_zoom if @ani_sprites[i] != nil && cell_data[i, 1] != nil
  @ani_sprites[i].y = (@ani_oy + cell_data[i, 2] - $sv_camera.y) * camera_zoom if @ani_sprites[i] != nil && cell_data[i, 2] != nil
end
 end
 #--------------------------------------------------------------------------
 # ◠アニメーション元ã®åº§æ¨™ã‚’セット
 #--------------------------------------------------------------------------
 def ani_ox_set
@real_x = x if !@real_x
@real_y = y if !@real_y
@ani_ox = @real_x - ox + width / 2
@ani_oy = @real_y - oy + height / 2
@ani_oy -= height / 2 if @animation.position == 0
@ani_oy += height / 2 if @animation.position == 2
 end
 #--------------------------------------------------------------------------
 # â— ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³ã®æ›´æ–°
 #--------------------------------------------------------------------------
 alias update_animation_sprite_base_n03 update_animation
 def update_animation
update_animation_position_horming if animation? && @animation.position != 3
set_animation_origin if animation?
update_animation_sprite_base_n03
 end
 #--------------------------------------------------------------------------
 # ◠アニメーションã®åŽŸç‚¹è¨­å®š ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def set_animation_origin
return ani_ox_set if @animation.position != 3
if viewport == nil
  @ani_ox = Graphics.width / 2
  @ani_oy = Graphics.height / 2
else
  @ani_ox = viewport.rect.width / 2
  @ani_oy = viewport.rect.height / 2
end
 end
 #--------------------------------------------------------------------------
 # ◠アニメーションスプライトã®è¨­å®š ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def animation_set_sprites(frame)
camera_zoom = 1
camera_zoom = $sv_camera.zoom if @anime_camera_zoom && @animation.position != 3
camera_x = $sv_camera.x
camera_y = $sv_camera.y
camera_x = 0 if @animation.position == 3
camera_y = 0 if @animation.position == 3
cell_data = frame.cell_data
@ani_sprites.each_with_index do |sprite, i|
  next unless sprite
  pattern = cell_data[i, 0]
  if !pattern || pattern < 0
	sprite.visible = false
	next
  end
  sprite.bitmap = pattern < 100 ? @ani_bitmap1 : @ani_bitmap2
  sprite.visible = true
  sprite.src_rect.set(pattern % 5 * 192,
	pattern % 100 / 5 * 192, 192, 192)
  if @ani_mirror && !@anime_no_mirror
	sprite.x = (@ani_ox - cell_data[i, 1] - camera_x) * camera_zoom
	sprite.y = (@ani_oy + cell_data[i, 2] - camera_y) * camera_zoom
	sprite.angle = (360 - cell_data[i, 4])
	sprite.mirror = (cell_data[i, 5] == 0)
  else
	sprite.x = (@ani_ox + cell_data[i, 1] - camera_x) * camera_zoom
	sprite.y = (@ani_oy + cell_data[i, 2] - camera_y) * camera_zoom
	sprite.angle = cell_data[i, 4]
	sprite.mirror = (cell_data[i, 5] == 1)
  end
  sprite.z = self.z + 300 + i
  sprite.ox = 96
  sprite.oy = 96
  sprite.zoom_x = cell_data[i, 3] * camera_zoom / 100.0
  sprite.zoom_y = cell_data[i, 3] * camera_zoom/ 100.0
  sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  sprite.blend_type = cell_data[i, 7]
end
 end
 #--------------------------------------------------------------------------
 # â— å­ã‚¹ãƒ—ライトフラグ
 #--------------------------------------------------------------------------
 def set(battler, horming, camera_zoom, no_mirror)
@battler = battler
@next = true
self.bitmap = Bitmap.new(@battler.sv.cw, @battler.sv.ch)
self.ox = bitmap.width / 2
self.oy = bitmap.height
@horming = horming
@anime_camera_zoom = camera_zoom
@anime_no_mirror = no_mirror
@battler.sv.reset_anime_data
 end
 #--------------------------------------------------------------------------
 # â— å­ã‚¹ãƒ—ライト座標セット
 #--------------------------------------------------------------------------
 def set_position(z, zoom_x, zoom_y, real_x, real_y)
self.z = z
self.zoom_x = zoom_x
self.zoom_y = zoom_y
@real_x = real_x
@real_y = real_y
 end
 #--------------------------------------------------------------------------
 # ◠他スプライトã¸ã®ã‚¿ã‚¤ãƒŸãƒ³ã‚°å‡¦ç†
 #--------------------------------------------------------------------------
 def other_process_timing(timing)
se_flug = true
se_flug = @se_flug if @se_flug != nil
@battler.sv.timing.push([se_flug, timing.dup])
 end
 #--------------------------------------------------------------------------
 # â— SE ã¨ãƒ•ラッシュã®ã‚¿ã‚¤ãƒŸãƒ³ã‚°å‡¦ç†
 #--------------------------------------------------------------------------
 alias animation_process_timing_sprite_base_n03 animation_process_timing
 def animation_process_timing(timing)
return other_process_timing(timing) if @next != nil
animation_process_timing_sprite_base_n03(timing)
 end
end

#==============================================================================
# â–  Sprite_Battler
#------------------------------------------------------------------------------
#  ãƒãƒˆãƒ©ãƒ¼è¡¨ç¤ºç”¨ã®ã‚¹ãƒ—ライトã§ã™ã€‚
#==============================================================================
class Sprite_Battler < Sprite_Base
 #--------------------------------------------------------------------------
 # ◠公開インスタンス変数 
 #--------------------------------------------------------------------------
 attr_accessor   :removing			 # パーティ離脱中
 #--------------------------------------------------------------------------
 # â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
 #--------------------------------------------------------------------------
 alias initialize_sprite_battler_n03 initialize
 def initialize(viewport, battler = nil)
initialize_sprite_battler_n03(viewport, battler)
@real_x = @real_y = 0
update_bitmap if @battler != nil
 end
 #--------------------------------------------------------------------------
 # ◠アニメーションã®é–‹å§‹ ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def start_animation(animation, mirror = false)
return next_animation(animation, mirror) if animation?
@animation = animation
if @animation
  @horming = @battler.sv.anime_horming
  @anime_camera_zoom = @battler.sv.anime_camera_zoom
  @anime_no_mirror = @battler.sv.anime_no_mirror
  @battler.sv.reset_anime_data
  @ani_mirror = mirror
  set_animation_rate
  @ani_duration = @animation.frame_max * @ani_rate + 1
  load_animation_bitmap
  make_animation_sprites
  set_animation_origin
end
 end
 #--------------------------------------------------------------------------
 # ◠次ã®ã‚¢ãƒ‹ãƒ¡ã‚’é–‹å§‹
 #--------------------------------------------------------------------------
 def next_animation(animation, mirror)
@next_anime = [] if @next_anime == nil
@next_anime.push(Sprite_Base.new(viewport))
@next_anime[@next_anime.size - 1].set(battler, @battler.sv.anime_horming, @battler.sv.anime_camera_zoom, @battler.sv.anime_no_mirror)
@next_anime[@next_anime.size - 1].set_position(self.z, self.zoom_x, self.zoom_y, @real_x, @real_y)
@next_anime[@next_anime.size - 1].start_animation(animation, mirror)
 end
 #--------------------------------------------------------------------------
 # ◠影グラフィック作æˆ
 #--------------------------------------------------------------------------
 def create_shadow
reset_shadow
return if @battler.sv.shadow == false
@shadow = Sprite.new(viewport) if @shadow == nil
@shadow.bitmap = Cache.character(@battler.sv.shadow)
@shadow.ox = @shadow.bitmap.width / 2
@shadow.oy = @shadow.bitmap.height / 2
 end
 #--------------------------------------------------------------------------
 # â— å½±ã‚°ãƒ©ãƒ•ã‚£ãƒƒã‚¯åˆæœŸåŒ–
 #--------------------------------------------------------------------------
 def reset_shadow
return if @shadow == nil
@shadow.dispose
@shadow = nil
 end
 #--------------------------------------------------------------------------
 # ◠転é€å…ƒãƒ“ãƒƒãƒˆãƒžãƒƒãƒ—ã®æ›´æ–° ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def update_bitmap
update_bitmap_enemy if !@battler.actor?
update_bitmap_actor if @battler.actor?
update_src_rect if @battler != nil
update_color if @battler != nil
 end
 #--------------------------------------------------------------------------
 # ◠転é€å…ƒãƒ“ットマップ:エãƒãƒŸãƒ¼
 #--------------------------------------------------------------------------
 def update_bitmap_enemy
if @battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue
  @battler_name = @battler.battler_name
  @battler_hue = @battler.battler_hue
  @battler_graphic_file_index = @battler.sv.graphic_file_index
  @graphic_mirror_flug = @battler.sv.graphic_mirror_flug
  self.bitmap = Cache.battler(@battler_name + @battler_graphic_file_index, @battler_hue)
  @battler.sv.setup(self.bitmap.width, self.bitmap.height, @battler_id != @battler.id)
  create_shadow
  init_visibility
  @battler_id = @battler.id
end
 end
 #--------------------------------------------------------------------------
 # ◠転é€å…ƒãƒ“ットマップ:アクター
 #--------------------------------------------------------------------------
 def update_bitmap_actor
if @battler.character_name != @battler_name or @battler.character_index != @battler_index
  @battler_name = @battler.character_name
  @battler_index = @battler.character_index
  @battler_graphic_file_index = @battler.sv.graphic_file_index
  @graphic_mirror_flug = @battler.sv.graphic_mirror_flug
  self.bitmap = Cache.character(@battler_name + @battler_graphic_file_index)
  @battler.sv.setup(self.bitmap.width, self.bitmap.height, @battler_id != @battler.id)
  create_shadow
  init_visibility
  @battler_id = @battler.id
end
 end
 #--------------------------------------------------------------------------
 # â— å¯è¦–状態ã®åˆæœŸåŒ– ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def init_visibility
@battler_visible = @battler.alive?
@battler_visible = true if @battler.sv.state(1) != "通常コラプス"
@battler_visible = false if @battler.hidden?
self.opacity = 0 unless @battler_visible
self.opacity = 255 if @battler_visible
 end
 #--------------------------------------------------------------------------
 # ◠転é€å…ƒçŸ©å½¢ã®æ›´æ–°
 #--------------------------------------------------------------------------
 def update_src_rect
return if @battler.sv.collapse
if @battler_graphic_file_index != @battler.sv.graphic_file_index
  @battler_graphic_file_index = @battler.sv.graphic_file_index
  self.bitmap = Cache.character(@battler_name + @battler_graphic_file_index) if @battler.actor?
  self.bitmap = Cache.battler(@battler_name + @battler_graphic_file_index, @battler_hue) if !@battler.actor?
  @battler.sv.set_graphics(self.bitmap.width, self.bitmap.height)
end
self.src_rect.set(@battler.sv.sx, @battler.sv.sy, @battler.sv.cw, @battler.sv.ch)
@battler.sv.opacity = 0 if self.opacity == 0 && @battler.sv.opacity_data == []
self.opacity = @battler.sv.opacity
set_process_timing(@battler.sv.timing) if @battler && @battler.sv.timing != []
 end
 #--------------------------------------------------------------------------
 # â— ä½ç½®ã®æ›´æ–° ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def update_position
@real_x = @battler.sv.x / 100
@real_y = (@battler.sv.y - @battler.sv.h - @battler.sv.j - @battler.sv.c - @battler.sv.oy_adjust)/ 100
self.x = @real_x - $sv_camera.x
self.y = @real_y - $sv_camera.y
self.z = @battler.sv.z - @battler.sv.c
if @battler.sv.h <= 0
  self.x += $sv_camera.sx / 100
  self.y += $sv_camera.sy / 100
end
self.x *= $sv_camera.zoom
self.y *= $sv_camera.zoom
 end
 #--------------------------------------------------------------------------
 # â— åŽŸç‚¹ã®æ›´æ–° ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def update_origin
return if !bitmap or @battler.sv.collapse
self.ox = @battler.sv.ox
self.oy = @battler.sv.oy
self.angle = @battler.sv.angle
self.zoom_x = @battler.sv.zoom_x * $sv_camera.zoom
self.zoom_y = @battler.sv.zoom_y * $sv_camera.zoom
self.mirror = @battler.sv.mirror if !@graphic_mirror_flug
self.mirror = !@battler.sv.mirror if @graphic_mirror_flug
 end
 #--------------------------------------------------------------------------
 # â— å½±ã‚°ãƒ©ãƒ•ã‚£ãƒƒã‚¯ã®æ›´æ–°
 #--------------------------------------------------------------------------
 def update_shadow
@shadow.visible = @battler.sv.shadow_visible
@shadow.opacity = @battler.sv.opacity if @battler.sv.opacity_data[3]
@shadow.opacity = self.opacity if !@battler.sv.opacity_data[3]
@shadow.x = @real_x - $sv_camera.x
@shadow.y = (@battler.sv.y - @battler.sv.c)/ 100 - $sv_camera.y
@shadow.z = @battler.sv.z - 10
@shadow.zoom_x = $sv_camera.zoom
@shadow.zoom_y = $sv_camera.zoom
@shadow.x += $sv_camera.sx / 100
@shadow.y += $sv_camera.sy / 100
@shadow.x *= $sv_camera.zoom
@shadow.y *= $sv_camera.zoom
@shadow.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil
 end
 #--------------------------------------------------------------------------
 # â— ãµãã ã—ã®æ›´æ–°
 #--------------------------------------------------------------------------
 def update_balloon
if @battler.sv.balloon_data == [] && @balloon
  @balloon_data = []
  @balloon.dispose
  return @balloon = nil
elsif @battler.sv.balloon_data != [] && @battler.sv.balloon_data != @balloon_data
  @balloon_data = @battler.sv.balloon_data
  @balloon = Sprite.new(self.viewport)
  @balloon.bitmap = Cache.system("Balloon")
  @balloon.zoom_x = @balloon_data[3]
  @balloon.zoom_y = @balloon_data[3]
  @balloon.ox = 32 if @battler.sv.mirror
  @balloon.oy = 16
  @balloon_count = 0
end
return if !@balloon
@balloon.opacity = self.opacity
@balloon.x = self.x
@balloon.y = self.y - @battler.sv.ch * $sv_camera.zoom
@balloon.z = self.z + 20
@balloon.src_rect.set(32 + @balloon_count / @balloon_data[2] * 32, @balloon_data[1] * 32, 32, 32) if @balloon_count % @balloon_data[2] == 0
@balloon.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil
@balloon_count += 1
@balloon_count = 0 if @balloon_count == @balloon_data[2] * 7
 end
 #--------------------------------------------------------------------------
 # â— è‰²èª¿å¤‰æ›´ã®æ›´æ–°
 #--------------------------------------------------------------------------
 def update_color
color_set if @battler.sv.color_set != []
return if @color_data == nil
@color_data[4] -= 1
if @color_data[4] == 0 && @color_data[5] != 0
  @color_data[4] = @color_data[5]
  @color_data[5] = 0
  @color_data[6] = [0,0,0,0]
elsif @color_data[4] == 0
  @remain_color_data = @color_data
  @battler.sv.color = @color_data.dup
  return @color_data = nil
end
for i in 0..3
  @color_data[i] = (@color_data[i] * (@color_data[4] - 1) + @color_data[6][i]) / @color_data[4]
end
@battler.sv.color = @color_data.dup
self.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3])
 end
 #--------------------------------------------------------------------------
 # ◠残åƒã®æ›´æ–°
 #--------------------------------------------------------------------------
 def update_mirage
if @battler.sv.mirage == [] && @mirages
  @mirage_data = []
  for mirage in @mirages do mirage.dispose end
  return @mirages = nil
elsif @battler.sv.mirage != [] && @battler.sv.mirage != @mirage_data
  @mirage_data = @battler.sv.mirage
  @mirages = []
  for i in 0...@mirage_data[1] do @mirages[i] = Sprite.new(self.viewport) end
  @mirage_count = 0
end
return if !@mirages
@mirage_count += 1
@mirage_count = 0 if @mirage_count == @mirage_data[2] * @mirages.size
for i in 0...@mirages.size
  mirage_body(@mirages[i], @mirage_data[4]) if @mirage_count == 1 + i * @mirage_data[2]
end
 end
 #--------------------------------------------------------------------------
 # â— æ®‹åƒæœ¬ä½“
 #--------------------------------------------------------------------------
 def mirage_body(body, opacity)
body.bitmap = self.bitmap.dup
body.x = self.x
body.y = self.y
body.ox = self.ox
body.oy = self.oy
body.z = self.z - 20
body.mirror = self.mirror
body.angle = self.angle
body.opacity = opacity * self.opacity / 255
body.zoom_x = self.zoom_x
body.zoom_y = self.zoom_y  
body.src_rect.set(@battler.sv.sx, @battler.sv.sy, @battler.sv.cw, @battler.sv.ch)
body.color.set(@color_data[0], @color_data[1], @color_data[2], @color_data[3]) if @color_data != nil
 end  
 #--------------------------------------------------------------------------
 # ◠次ã®ã‚¢ãƒ‹ãƒ¡ã‚’æ›´æ–°
 #--------------------------------------------------------------------------
 def update_next_anime
return if !@next_anime
for anime in @next_anime
  anime.update
  anime.set_position(self.z, self.zoom_x, self.zoom_y, @real_x, @real_y) if @horming
  anime.dispose if !anime.animation?
  @next_anime.delete(anime) if !anime.animation?
end
 end
 #--------------------------------------------------------------------------
 # ◠フレーム更新
 #--------------------------------------------------------------------------
 alias update_sprite_battler_n03 update
 def update
@battler.sv.update if @battler
update_sprite_battler_n03
update_next_anime
update_shadow  if @battler && @shadow
update_mirage  if @battler
update_balloon if @battler
update_remove if @battler && @removing && @battler.sv.change_up
 end
 #--------------------------------------------------------------------------
 # â— ãƒãƒˆãƒ©ãƒ¼å…¥ã‚Œæ›¿ãˆ
 #--------------------------------------------------------------------------
 def remove
@battler.sv.start_action(@battler.sv.remove_action)
$sv_camera.wait = -1
@battler.sv.add_action("eval('set_change')")
@removing = true
 end
 #--------------------------------------------------------------------------
 # â— ãƒãƒˆãƒ©ãƒ¼å…¥ã‚Œæ›¿ãˆã®æ›´æ–°
 #--------------------------------------------------------------------------
 def update_remove
@battler.sv.change_up = false
@removing = false
@battler = nil
 end
 #--------------------------------------------------------------------------
 # â— ãƒãƒˆãƒ©ãƒ¼åŠ å…¥
 #--------------------------------------------------------------------------
 def join(join_battler)
$sv_camera.wait = 30
@battler = join_battler
@battler_name = @battler.character_name
@battler_index = @battler.character_index
@battler_graphic_file_index = @battler.sv.graphic_file_index
self.bitmap = Cache.character(@battler_name)
@battler.sv.setup(self.bitmap.width, self.bitmap.height, true)
create_shadow
init_visibility
 end
 #--------------------------------------------------------------------------
 # ◠通常ã®è¨­å®šã«æˆ»ã™ ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def revert_to_normal
self.blend_type = 0
self.opacity = 255
 end
 #--------------------------------------------------------------------------
 # â— å´©å£Šã‚¨ãƒ•ã‚§ã‚¯ãƒˆã®æ›´æ–°
 #--------------------------------------------------------------------------
 alias update_collapse_sprite_battler_n03 update_collapse
 def update_collapse
return if @battler.sv.state(1) != "敵コラプス"
update_collapse_sprite_battler_n03
 end
 #--------------------------------------------------------------------------
 # ◠別スプライトã‹ã‚‰ã®ã‚¿ã‚¤ãƒŸãƒ³ã‚°å‡¦ç†
 #--------------------------------------------------------------------------
 def set_process_timing(timing_data)
for data in timing_data
  set_timing(data[0],data[1])
end
@battler.sv.timing = []
 end
 #--------------------------------------------------------------------------
 # ◠タイミング処ç†
 #--------------------------------------------------------------------------
 def set_timing(se_flug, data)
@ani_rate = 4
data.se.play if se_flug
case data.flash_scope
when 1 ;self.flash(data.flash_color, data.flash_duration * @ani_rate)
when 2 ;viewport.flash(data.flash_color, data.flash_duration * @ani_rate) if viewport
when 3 ;self.flash(nil, data.flash_duration * @ani_rate)
end
 end
 #--------------------------------------------------------------------------
 # ◠色調変更
 #--------------------------------------------------------------------------
 def color_set
set = @battler.sv.color_set
@battler.sv.color_set= []
set[4] = 1 if set[4] == 0
@remain_color_data = [0,0,0,0] if @remain_color_data == nil
@color_data = @remain_color_data
@color_data[4] = set[4]
@color_data[5] = set[5]
@color_data[6] = set
 end
 #--------------------------------------------------------------------------
 # ◠解放
 #--------------------------------------------------------------------------
 alias dispose_sprite_battler_n03 dispose
 def dispose
dispose_sprite_battler_n03
@shadow.dispose if @shadow != nil
@balloon.dispose if @balloon != nil
for mirage in @mirages do mirage.dispose end if @mirages != nil
 end
end

#==============================================================================
# â–  Spriteset_Battle
#------------------------------------------------------------------------------
#  ãƒãƒˆãƒ«ç”»é¢ã®ã‚¹ãƒ—ライトをã¾ã¨ã‚ãŸã‚¯ãƒ©ã‚¹ã§ã™ã€‚
#==============================================================================
class Spriteset_Battle
 #--------------------------------------------------------------------------
 # ◠戦闘背景(床)スプライトã®ä½œæˆ ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def create_battleback1
@back1_sprite = Sprite_Battle_Back.new(@viewport1, 1, battleback1_name)
@back1_sprite.set_graphics(battleback1_bitmap) if battleback1_name != nil
@back1_sprite.z = 0
 end
 #--------------------------------------------------------------------------
 # ◠戦闘背景(å£ï¼‰ã‚¹ãƒ—ライトã®ä½œæˆ ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def create_battleback2
@back2_sprite = Sprite_Battle_Back.new(@viewport1, 2, battleback2_name)
@back2_sprite.set_graphics(battleback2_bitmap) if battleback2_name != nil
@back2_sprite.z = 1
 end
 #--------------------------------------------------------------------------
 # ◠アクタースプライトã®ä½œæˆ ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def create_actors
@actor_sprites = []
for i in 0...$game_party.max_battle_members
  @actor_sprites[i] = Sprite_Battler.new(@viewport1, $game_party.members[i])
end
@effect_sprites = Spriteset_Sideview.new(@viewport1)
 end
 #--------------------------------------------------------------------------
 # â— ã‚¢ã‚¯ã‚¿ãƒ¼ã‚¹ãƒ—ãƒ©ã‚¤ãƒˆã®æ›´æ–° ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def update_actors
@actor_sprites.each_with_index do |sprite, i|
  sprite_join($game_party.members[i], sprite) if sprite.battler == nil && sprite.battler != $game_party.members[i]
  sprite.remove if sprite.battler != nil && !sprite.removing && sprite.battler != $game_party.members[i]
  sprite.update
end
@effect_sprites.update
update_program
 end
 #--------------------------------------------------------------------------
 # ◠メンãƒãƒ¼ã‚’加ãˆã‚‹
 #--------------------------------------------------------------------------
 def sprite_join(member, sprite)
for sp in @actor_sprites
  sp.update_remove if member == sp.battler && !sp.battler.sv.change_up
end
sprite.join(member)
 end
 #--------------------------------------------------------------------------
 # â— ãƒãƒˆãƒ«ãƒ—ãƒ­ã‚°ãƒ©ãƒ ã®æ›´æ–°
 #--------------------------------------------------------------------------
 def update_program
return if $sv_camera.program_scroll == []
for data in  $sv_camera.program_scroll
  @back1_sprite.start_back_data(data) if data[2] == 1
  @back2_sprite.start_back_data(data) if data[2] == 2
end
$sv_camera.program_scroll = []
 end
 #--------------------------------------------------------------------------
 # â— ãƒ’ãƒƒãƒˆæ™‚ã®æˆ¦é—˜ã‚¢ãƒ‹ãƒ¡å®Ÿè¡Œ
 #--------------------------------------------------------------------------
 def set_hit_animation(battler, weapon_index, hit_targets, miss)
@effect_sprites.set_hit_animation(battler, weapon_index, hit_targets, miss)
 end
 #--------------------------------------------------------------------------
 # ◠ダメージPOP
 #--------------------------------------------------------------------------
 def set_damage_pop(target)
@effect_sprites.set_damage_pop(target)
 end
 #--------------------------------------------------------------------------
 # ◠解放
 #--------------------------------------------------------------------------
 alias dispose_spriteset_battle_n03 dispose
 def dispose
dispose_spriteset_battle_n03
@effect_sprites.dispose
 end



end

#==============================================================================
# â–  Window_BattleLog
#------------------------------------------------------------------------------
#  戦闘ã®é€²è¡Œã‚’実æ³è¡¨ç¤ºã™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§ã™ã€‚
#==============================================================================
class Window_BattleLog < Window_Selectable
 #--------------------------------------------------------------------------
 # ◠ウェイト ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def wait
 end
 #--------------------------------------------------------------------------
 # ◠ウェイトã¨ã‚¯ãƒªã‚¢ ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def wait_and_clear
$sv_camera.wait = 10
 end
 #--------------------------------------------------------------------------
 # â— è¡Œå‹•çµæžœã®è¡¨ç¤º ★å†å®šç¾©
 #--------------------------------------------------------------------------
 def display_action_results(target, item)
if target.result.used
  last_line_number = line_number
  display_critical(target, item)
  display_damage(target, item)
  display_affected_status(target, item)
  display_failure(target, item)
end
off if !N03::BATTLE_LOG
 end
 #--------------------------------------------------------------------------
 # ◠ウインドウéžè¡¨ç¤º
 #--------------------------------------------------------------------------
 def off
@back_sprite.visible = self.visible = false
 end
end
#==============================================================================
# â–  Game_Interpreter
#------------------------------------------------------------------------------
#  イベントコマンドを実行ã™ã‚‹ã‚¤ãƒ³ã‚¿ãƒ—リタã§ã™ã€‚
#==============================================================================
class Game_Interpreter
 #--------------------------------------------------------------------------
 # ◠スイッãƒã®æ“作
 #--------------------------------------------------------------------------
 alias command_121_game_interpreter_n03 command_121
 def command_121
command_121_game_interpreter_n03
$sv_camera.program_check
 end
end

 

 

 

The Sprite_Base is in the line 637

Edited by Shadow

Share this post


Link to post
Share on other sites

Are you sure about that? Paste this in the editor and do it below Sprite_Base

 

class Sprite_Base
  alias update_animation_bugfix update_animation
  def update_animation
    set_animation_origin if animation?
    update_animation_bugfix
  end
end

 

I had been looking for this bug fix for the past few months! I finally found it!!

Share this post


Link to post
Share on other sites

ShinGamix please don't necropost... You've been told 3 times already in the last month... Closing this.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted