Project1

标题: 如何使战斗中的角色图像不闪烁和不透明? [打印本页]

作者: reichal    时间: 2009-5-20 21:53
标题: 如何使战斗中的角色图像不闪烁和不透明?
在战斗中,当给角色选定动作时,角色图像(也就是RPG Maker XP\RGSS\Standard\Graphics\Battlers里的图文件)会处于闪烁状态,并且所有的角色图像都是半透明的,请各位学长教教我修改哪里的脚本,可以令角色图像不闪烁,而且不透明? [LINE]1,#dddddd[/LINE]版务信息:版主帮忙结贴~
作者: hitlerson    时间: 2009-5-20 21:54
不知所云{/fn}
作者: 紫苏    时间: 2009-5-21 05:27
找到 Sprite_Battler 的如下一段,把红色部分的语句统统注释掉~
  def update
    super
    # 战斗者为 nil 的情况下
    if @battler == nil
      self.bitmap = nil
      loop_animation(nil)
      return
    end
    # 文件名和色相与当前情况有差异的情况下
    if @battler.battler_name != @battler_name or
       @battler.battler_hue != @battler_hue
      # 获取、设置位图
      @battler_name = @battler.battler_name
      @battler_hue = @battler.battler_hue
      self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
      @width = bitmap.width
      @height = bitmap.height
      self.ox = @width / 2
      self.oy = @height
      # 如果是战斗不能或者是隐藏状态就把透明度设置成 0
      if @battler.dead? or @battler.hidden
        self.opacity = 0
      end
    end
    # 动画 ID 与当前的情况有差异的情况下
    if @battler.damage == nil and
       @battler.state_animation_id != @state_animation_id
      @state_animation_id = @battler.state_animation_id
      loop_animation($data_animations[@state_animation_id])
    end
    # 应该被显示的角色的情况下
    #if @battler.is_a?(Game_Actor) and @battler_visible
       # 不是主状态的时候稍稍降低点透明度
    #  if $game_temp.battle_main_phase
    #    self.opacity += 3 if self.opacity < 255
    #  else
    #    self.opacity -= 3 if self.opacity > 207
    # end
    #end
    # 明灭
    #if @battler.blink
    #  blink_on
    #else
    #  blink_off
    #end

    # 不可见的情况下
    unless @battler_visible
      # 出现
      if not @battler.hidden and not @battler.dead? and
         (@battler.damage == nil or @battler.damage_pop)
        appear
        @battler_visible = true
      end
    end
    # 可见的情况下
    if @battler_visible
      # 逃跑
      if @battler.hidden
        $game_system.se_play($data_system.escape_se)
        escape
        @battler_visible = false
      end
      # 白色闪烁
      if @battler.white_flash
        whiten
        @battler.white_flash = false
      end
      # 动画
      if @battler.animation_id != 0
        animation = $data_animations[@battler.animation_id]
        animation(animation, @battler.animation_hit)
        @battler.animation_id = 0
      end
      # 伤害
      if @battler.damage_pop
        damage(@battler.damage, @battler.critical)
        @battler.damage = nil
        @battler.critical = false
        @battler.damage_pop = false
      end
      # korapusu
      if @battler.damage == nil and @battler.dead?
        if @battler.is_a?(Game_Enemy)
          $game_system.se_play($data_system.enemy_collapse_se)
        else
          $game_system.se_play($data_system.actor_collapse_se)
        end
        collapse
        @battler_visible = false
      end
    end
    # 设置活动块的坐标
    self.x = @battler.screen_x
    self.y = @battler.screen_y
    self.z = @battler.screen_z
  end
[LINE]1,#dddddd[/LINE]系统信息:本贴由本区版主认可为正确答案,66RPG感谢您的热情解答~
作者: reichal    时间: 2009-5-27 06:16
不好意思,这两天出差了,没来得及回帖。谢谢楼上的学长帮忙。谢谢了。{/qiang}




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1