Project1

标题: 如何显示两次伤害呢??? [打印本页]

作者: stella    时间: 2008-7-10 00:25
标题: 如何显示两次伤害呢???
在 Scene_Battle 4 的显示伤害部分设置了攻击反弹(状态18)和吸血(状态50),然后当吸血状态的角色打反弹状态的敌人时,伤害显示就不正常了,如何能让伤害先显示吸血的数字然后再显示被敌人反弹的伤害数字呢?


脚本如下:

  #--------------------------------------------------------------------------
  # ● 刷新画面 (主回合步骤 5 : 显示伤害)
  #--------------------------------------------------------------------------
  def update_phase4_step5
    # 隐藏帮助窗口
    @help_window.visible = false
    # 刷新状态窗口
    @status_window.refresh
    # 显示伤害
    for target in @target_battlers
      
#描述反弹伤害部分   
      if target.state?(18)
        if @active_battler.current_action.kind == 0 and target.damage != "Miss"
          target.animation_id = 98
          @active_battler.hp -= @active_battler.damage.to_i
          @active_battler.damage_pop = true
        end
      end

#描述吸血部分   
    if (@active_battler.state?(50) and @active_battler.current_action.basic == 0 and @active_battler.current_action.kind == 0) or (@active_battler.state?(50) and @active_battler.current_action.kind == 1 and $data_skills[@active_battler.current_action.skill_id].power > 0)
       for target in @target_battlers
       if target.damage != nil and target.damage != "Miss"
       @active_battler.hp += (target.damage*0.1).to_i
       @active_battler.damage = 0 - (target.damage*0.1).to_i
       @active_battler.damage_pop = true   
       end
       end
    end

      if target.damage != nil
        target.damage_pop = true
      end
    end
   
    # 移至步骤 6
    @phase4_step = 6
  end








[LINE]1,#dddddd[/LINE]此贴于 2008-7-13 12:48:57 被版主darkten提醒,请楼主看到后对本贴做出回应。 [LINE]1,#dddddd[/LINE]此贴于 2008-7-16 12:31:35 被版主darkten提醒,请楼主看到后对本贴做出回应。 [LINE]1,#dddddd[/LINE]版务信息:版主帮忙结贴~
作者: stella    时间: 2008-7-10 00:29
找不到这种两种特效遭遇在一起的情况
作者: dbshy    时间: 2008-7-10 00:38
    该成
    if target.damage != nil or target.state?(18)
       target.damage_pop = true
     end

作者: 大地的雨    时间: 2008-7-10 06:35
damage_pop几次用的是同一个Sprite,分开Sprite就行了,这样还能同时出现。
作者: stella    时间: 2008-7-10 19:09
以下引用大地的雨于2008-7-9 22:35:21的发言:

damage_pop几次用的是同一个Sprite,分开Sprite就行了,这样还能同时出现。




那么如何分开Sprite呢??
作者: 大地的雨    时间: 2008-7-14 02:51
有两个方法:
1. 重定义 def damage,用数组来增加 Sprite 。
2. 直接在该位置生成一个新的 Sprite.new ,然后直接执行 damage 。 [LINE]1,#dddddd[/LINE]系统信息:本贴由本区版主认可为正确答案,66RPG感谢您的热情解答~




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