查看: 4307|回复: 1

[已经过期] 求帮大神移植一个脚本

[复制链接]
梦石
0
星屑
6963
在线时间
1557 小时
注册时间
2011-6-14
回帖
425
发表于 2016-3-20 15:06:30 | 显示全部楼层 |阅读模式
悬赏8星屑未解决
本帖最后由 余烬之中 于 2016-8-3 10:06 编辑

求大神帮把这个脚本移植成为插件,然后可以调用代码决定是否显示


[pre lang="ruby"]#==========================================================================
# 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以del哦
#==========================================================================
#==============================================================================
# SP伤害显示 v1.0
#==============================================================================
# By 叶子  Date: 12-25-2005
# “23种战斗特效的公共事件版”作者:SailCat
# 本脚本同时整合了 SailCat 的“23种战斗特效的公共事件版”脚本
# 请访问shownews.asp?id=19 学习“23种战斗特效的公共事件版”的使用
# 感谢 SailCat,为战斗特效创造了无数可能
#==============================================================================
# SP伤害颜色设定:
#搜索 bitmap.font.color.set
# 显示使用者SP变化的特技:
# 在SHOW_SP_DAMAGE_SKILLS后面的中括号中填上需要显示使用者SP变化的特技ID,中间以逗号“ , ”隔开
# 例如要5号,8号,16号特技显示使用者SP变化:
# SHOW_SP_DAMAGE_SKILLS = [5,8,16]
class Scene_Battle
SHOW_SP_DAMAGE_SKILLS = []
end
#==============================================================================
# ■ Sprite_Battler
#------------------------------------------------------------------------------
#  战斗显示用活动块。Game_Battler 类的实例监视、
# 活动块的状态的监视。
#==============================================================================
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
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
     #---------------------------------
     # SP伤害
     if @battler.sp_damage_pop
       sp_damage(@battler.sp_damage)
       @battler.sp_damage = nil
       @battler.sp_damage_pop = false
     end
     #---------------------------------
      #---------------------------------
     # SP伤害-2
     if @battler.sp2_damage_pop
       sp2_damage(@battler.sp2_damage)
       @battler.sp2_damage = nil
       @battler.sp2_damage_pop = false
     end
     #---------------------------------
     #---------------------------------
     # CP伤害
     if @battler.cp_damage_pop
       cp_damage(@battler.cp_damage)
       @battler.cp_damage = nil
       @battler.cp_damage_pop = false
     end
     #---------------------------------
     #---------------------------------
     # DP伤害
     if @battler.dp_damage_pop
       dp_damage(@battler.dp_damage)
       @battler.dp_damage = nil
       @battler.dp_damage_pop = false
     end
     #---------------------------------
      #---------------------------------
     # CP伤害-2
     if @battler.cp2_damage_pop
       cp2_damage(@battler.cp2_damage)
       @battler.cp2_damage = nil
       @battler.cp2_damage_pop = false
     end
     #---------------------------------
     #---------------------------------
     # DP伤害-2
     if @battler.dp2_damage_pop
       dp2_damage(@battler.dp2_damage)
       @battler.dp2_damage = nil
       @battler.dp2_damage_pop = false
     end
     #---------------------------------
     #---------------------------------
     # PP伤害
     if @battler.pp_damage_pop
       pp_damage(@battler.pp_damage)
       @battler.pp_damage = nil
       @battler.pp_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
end

#==============================================================================
#--
# RPG::Sprite
# 追加了 RPGXP 使用的各种效果处理的精灵的类。
#--
#==============================================================================
module RPG
class Sprite < ::Sprite
   
   def initialize(viewport = nil)
     super(viewport)
     @_whiten_duration = 0
     @_appear_duration = 0
     @_escape_duration = 0
     @_collapse_duration = 0
     @_damage_duration = 0
     @_sp2_damage_duration = 0
     @_sp_damage_duration = 0
     @_cp_damage_duration = 0
     @_dp_damage_duration = 0
     @_cp2_damage_duration = 0
     @_dp2_damage_duration = 0
     @_pp_damage_duration = 0
     @_animation_duration = 0
     @_blink = false
   end
   def dispose
     dispose_damage
     dispose_sp2_damage
     dispose_sp_damage
     dispose_cp_damage
     dispose_dp_damage
     dispose_cp2_damage
     dispose_dp2_damage
     dispose_pp_damage
     dispose_animation
     dispose_loop_animation
     super
   end
   def pp_damage(value)
     dispose_pp_damage
     if value.is_a?(Numeric)
       damage_string = value.abs.to_s
     else
       damage_string = value.to_s
     end
     bitmap = Bitmap.new(160+1000, 48)
     bitmap.font.name = ["黑体", "楷体", "宋体"]
     bitmap.font.size = 20
     bitmap.font.color.set(0, 0, 0)
     bitmap.draw_text(-1, 12-1, 160+1000, 36, damage_string, 0)
     bitmap.draw_text(+1, 12-1, 160+1000, 36, damage_string, 0)
     bitmap.draw_text(-1, 12+1, 160+1000, 36, damage_string, 0)
     bitmap.draw_text(+1, 12+1, 160+1000, 36, damage_string, 0)
     if value.is_a?(Numeric) and value < 0
       bitmap.font.color.set(99, 255, 71) # xx绿  
     else
      # bitmap.font.color.set(255, 99, 71) # 番茄红
       bitmap.font.color.set(99, 255, 71) # xx绿
     end
     bitmap.draw_text(0, 12, 160+1000, 36, damage_string, 0)
   #  @_sp_damage_sprite = ::Sprite.new(self.viewport)
     @_pp_damage_sprite = ::Sprite.new(Viewport.new(0, 0, 640, 480))
     @_pp_damage_sprite.bitmap = bitmap
     @_pp_damage_sprite.ox = 80
     @_pp_damage_sprite.oy = 100
     @_pp_damage_sprite.x = self.x
     @_pp_damage_sprite.y = self.y - self.oy / 2 + 64
     @_pp_damage_sprite.z = 9995
     @_pp_damage_sprite.viewport.z = self.viewport.z + 1
     @_pp_damage_duration = 80
   end
   def dispose_pp_damage
     if @_pp_damage_sprite != nil
       @_pp_damage_sprite.viewport.dispose
       @_pp_damage_sprite.bitmap.dispose
       @_pp_damage_sprite.dispose
       @_pp_damage_sprite = nil
       @_pp_damage_duration = 0
     end
   end
   #-----------------------------------
   def sp_damage(value)
     dispose_sp_damage
     if value.is_a?(Numeric)
       damage_string = value.abs.to_s
     else
       damage_string = value.to_s
     end
     bitmap = Bitmap.new(160+1000, 48)
     bitmap.font.name = ["黑体", "楷体", "宋体"]
     bitmap.font.size = 20
     bitmap.font.color.set(0, 0, 0)
     bitmap.draw_text(-1, 12-1, 160+1000, 36, damage_string, 0)
     bitmap.draw_text(+1, 12-1, 160+1000, 36, damage_string, 0)
     bitmap.draw_text(-1, 12+1, 160+1000, 36, damage_string, 0)
     bitmap.draw_text(+1, 12+1, 160+1000, 36, damage_string, 0)
     if value.is_a?(Numeric) and value < 0
       bitmap.font.color.set(255, 99, 71) # 番茄红
     else
      # bitmap.font.color.set(255, 99, 71) # 番茄红
       bitmap.font.color.set(0, 0, 205) # 适中的蓝色
     end
     bitmap.draw_text(0, 12, 160+1000, 36, damage_string, 0)
   #  @_sp_damage_sprite = ::Sprite.new(self.viewport)
     @_sp_damage_sprite = ::Sprite.new(Viewport.new(0, 0, 640, 480))
     @_sp_damage_sprite.bitmap = bitmap
     @_sp_damage_sprite.ox = 80
     @_sp_damage_sprite.oy = 100
     @_sp_damage_sprite.x = self.x
     @_sp_damage_sprite.y = self.y - self.oy / 2 +48
     @_sp_damage_sprite.z = 9998
     @_sp_damage_sprite.viewport.z = self.viewport.z + 1
     @_sp_damage_duration = 72
   end
   def dispose_sp_damage
     if @_sp_damage_sprite != nil
       @_sp_damage_sprite.viewport.dispose
       @_sp_damage_sprite.bitmap.dispose
       @_sp_damage_sprite.dispose
       @_sp_damage_sprite = nil
       @_sp_damage_duration = 0
     end
   end
   #-----------------------------------
   def sp2_damage(value)
     dispose_sp2_damage
     if value.is_a?(Numeric)
       damage_string = value.abs.to_s
     else
       damage_string = value.to_s
     end
     bitmap = Bitmap.new(160+1000, 48)
     bitmap.font.name = ["黑体", "楷体", "宋体"]
     bitmap.font.size = 20
     bitmap.font.color.set(0, 0, 0)
     bitmap.draw_text(-1, 12-1, 160+1000, 36, damage_string, 0)
     bitmap.draw_text(+1, 12-1, 160+1000, 36, damage_string, 0)
     bitmap.draw_text(-1, 12+1, 160+1000, 36, damage_string, 0)
     bitmap.draw_text(+1, 12+1, 160+1000, 36, damage_string, 0)
     if value.is_a?(Numeric) and value < 0
       bitmap.font.color.set(255, 255, 128)
     else
       bitmap.font.color.set(255, 255, 128)
     end
     bitmap.draw_text(0, 12, 160+1000, 36, damage_string, 0)
   #  @_sp_damage_sprite = ::Sprite.new(self.viewport)
     @_sp2_damage_sprite = RPG::Sprite.new(Viewport.new(0, 0, 640, 480)) #::Sprite.new(Viewport.new(0, 0, 640, 480))
     @_sp2_damage_sprite.bitmap = bitmap
     @_sp2_damage_sprite.ox = 80
     @_sp2_damage_sprite.oy = 100
     @_sp2_damage_sprite.x = self.x-((value.to_s.size*6-114)/2).round
     @_sp2_damage_sprite.y = self.y - self.oy / 2 +56
     @_sp2_damage_sprite.z = 9900
     @_sp2_damage_sprite.viewport.z = self.viewport.z + 1
     @_sp2_damage_duration = 108
   end
   def dispose_sp2_damage
     if @_sp2_damage_sprite != nil
       @_sp2_damage_sprite.viewport.dispose
       @_sp2_damage_sprite.bitmap.dispose
       @_sp2_damage_sprite.dispose
       @_sp2_damage_sprite = nil
       @_sp2_damage_duration = 0
     end
   end
    #-----------------------------------
   def cp2_damage(value)
     dispose_cp2_damage
     if value.is_a?(Numeric)
       damage_string = value.abs.to_s
     else
       damage_string = value.to_s
     end
     bitmap = Bitmap.new(160+1000, 48)
     bitmap.font.name = ["黑体", "楷体", "宋体"]
     bitmap.font.size = 20
     bitmap.font.color.set(0, 0, 0)
     bitmap.draw_text(-1, 12-1, 160+1000, 36, damage_string, 0)
     bitmap.draw_text(+1, 12-1, 160+1000, 36, damage_string, 0)
     bitmap.draw_text(-1, 12+1, 160+1000, 36, damage_string, 0)
     bitmap.draw_text(+1, 12+1, 160+1000, 36, damage_string, 0)
     if value.is_a?(Numeric) and value < 0
       bitmap.font.color.set(255, 255, 120)
     else
       bitmap.font.color.set(255, 255, 120)
     end
     bitmap.draw_text(0, 12, 160+1000, 36, damage_string, 0)
   #  @_sp_damage_sprite = ::Sprite.new(self.viewport)
     @_cp2_damage_sprite = RPG::Sprite.new(Viewport.new(0, 0, 640, 480)) #::Sprite.new(Viewport.new(0, 0, 640, 480))
     @_cp2_damage_sprite.bitmap = bitmap
     @_cp2_damage_sprite.ox = 80
     @_cp2_damage_sprite.oy = 100
     @_cp2_damage_sprite.x = self.x-((value.to_s.size*6-130)/2).round
     @_cp2_damage_sprite.y = self.y - self.oy / 2 +64
     @_cp2_damage_sprite.z = 9901
     @_cp2_damage_sprite.viewport.z = self.viewport.z + 1
     @_cp2_damage_duration = 40
   end
   def dispose_cp2_damage
     if @_cp2_damage_sprite != nil
       @_cp2_damage_sprite.viewport.dispose
       @_cp2_damage_sprite.bitmap.dispose
       @_cp2_damage_sprite.dispose
       @_cp2_damage_sprite = nil
       @_cp2_damage_duration = 0
     end
   end
   def cp_damage(value)
     dispose_cp_damage
     if value.is_a?(Numeric)
       damage_string = value.abs.to_s
     else
       damage_string = value.to_s
     end
     bitmap = Bitmap.new(160+1000, 48)
     bitmap.font.name = ["黑体", "楷体", "宋体"]
     bitmap.font.size = 20
     bitmap.font.color.set(0, 0, 0)
     bitmap.draw_text(-1, 12-1, 160+1000, 36, damage_string, 0)
     bitmap.draw_text(+1, 12-1, 160+1000, 36, damage_string, 0)
     bitmap.draw_text(-1, 12+1, 160+1000, 36, damage_string, 0)
     bitmap.draw_text(+1, 12+1, 160+1000, 36, damage_string, 0)
     if value.is_a?(Numeric) and value < 0
       #bitmap.font.color.set(255, 99, 71) # 番茄红
       bitmap.font.color.set(255, 255, 128)
     else
       bitmap.font.color.set(255, 255, 128)
       #bitmap.font.color.set(255, 99, 71) # 番茄红
       #bitmap.font.color.set(0, 0, 205) # 适中的蓝色
     end
     bitmap.draw_text(0, 12, 160+1000, 36, damage_string, 0)
    # @_cp_damage_sprite = ::Sprite.new(self.viewport)
     @_cp_damage_sprite = ::Sprite.new(Viewport.new(0, 0, 640, 480))
     @_cp_damage_sprite.bitmap = bitmap
     @_cp_damage_sprite.ox = 80
     @_cp_damage_sprite.oy = 100
     @_cp_damage_sprite.x = self.x
     @_cp_damage_sprite.y = self.y - self.oy / 2 +140
     @_cp_damage_sprite.z = 9997
     @_cp_damage_sprite.viewport.z = self.viewport.z + 1
     @_cp_damage_duration = 112
   end
   def dispose_cp_damage
     if @_cp_damage_sprite != nil
       @_cp_damage_sprite.viewport.dispose
       @_cp_damage_sprite.bitmap.dispose
       @_cp_damage_sprite.dispose
       @_cp_damage_sprite = nil
       @_cp_damage_duration = 0
     end
   end
    #-----------------------------------
   def dp2_damage(value)
     dispose_dp2_damage
     if value.is_a?(Numeric)
       damage_string = value.abs.to_s
     else
       damage_string = value.to_s
     end
     bitmap = Bitmap.new(160+1000, 48)
     bitmap.font.name = ["黑体", "楷体", "宋体"]
     bitmap.font.size = 20
     bitmap.font.color.set(0, 0, 0)
     bitmap.draw_text(-1, 12-1, 160+1000, 36, damage_string, 0)
     bitmap.draw_text(+1, 12-1, 160+1000, 36, damage_string, 0)
     bitmap.draw_text(-1, 12+1, 160+1000, 36, damage_string, 0)
     bitmap.draw_text(+1, 12+1, 160+1000, 36, damage_string, 0)
     if value.is_a?(Numeric) and value < 0
       bitmap.font.color.set(255, 99, 71)
     else
       bitmap.font.color.set(255, 99, 71)
     end
     bitmap.draw_text(0, 12, 160+1000, 36, damage_string, 0)
   #  @_sp_damage_sprite = ::Sprite.new(self.viewport)
     @_dp2_damage_sprite = RPG::Sprite.new(Viewport.new(0, 0, 640, 480)) #::Sprite.new(Viewport.new(0, 0, 640, 480))
     @_dp2_damage_sprite.bitmap = bitmap
     @_dp2_damage_sprite.ox = 80
     @_dp2_damage_sprite.oy = 100
     @_dp2_damage_sprite.x = self.x-((value.to_s.size*6-138)/2).round
     @_dp2_damage_sprite.y = self.y - self.oy / 2 +36
     @_dp2_damage_sprite.z = 9902
     @_dp2_damage_sprite.viewport.z = self.viewport.z + 1
     @_dp2_damage_duration = 40
   end
   def dispose_dp2_damage
     if @_dp2_damage_sprite != nil
       @_dp2_damage_sprite.viewport.dispose
       @_dp2_damage_sprite.bitmap.dispose
       @_dp2_damage_sprite.dispose
       @_dp2_damage_sprite = nil
       @_dp2_damage_duration = 0
     end
   end
   def dp_damage(value)
     dispose_dp_damage
     if value.is_a?(Numeric)
       damage_string = value.abs.to_s
     else
       damage_string = value.to_s
     end
     bitmap = Bitmap.new(160+1000, 48)
     bitmap.font.name = ["黑体", "楷体", "宋体"]
     bitmap.font.size = 20
     bitmap.font.color.set(0, 0, 0)
     bitmap.draw_text(-1, 12-1, 160+1000, 36, damage_string, 0)
     bitmap.draw_text(+1, 12-1, 160+1000, 36, damage_string, 0)
     bitmap.draw_text(-1, 12+1, 160+1000, 36, damage_string, 0)
     bitmap.draw_text(+1, 12+1, 160+1000, 36, damage_string, 0)
     if value.is_a?(Numeric) and value < 0
       bitmap.font.color.set(255, 99, 71) # 番茄红
       #bitmap.font.color.set(255, 255, 128)
     else
       #bitmap.font.color.set(255, 255, 128)
       bitmap.font.color.set(255, 99, 71) # 番茄红
       #bitmap.font.color.set(0, 0, 205) # 适中的蓝色
     end
     bitmap.draw_text(0, 12, 160+1000, 36, damage_string, 0)
     #@_dp_damage_sprite = ::Sprite.new(self.viewport)
     @_dp_damage_sprite = ::Sprite.new(Viewport.new(0, 0, 640, 480))
     @_dp_damage_sprite.bitmap = bitmap
     @_dp_damage_sprite.ox = 80
     @_dp_damage_sprite.oy = 100
     @_dp_damage_sprite.x = self.x
     @_dp_damage_sprite.y = self.y - self.oy / 2 +84
     @_dp_damage_sprite.z = 9999
     @_dp_damage_sprite.viewport.z = self.viewport.z + 1
     @_dp_damage_duration = 88
   end
   def dispose_dp_damage
     if @_dp_damage_sprite != nil
       @_dp_damage_sprite.viewport.dispose
       @_dp_damage_sprite.bitmap.dispose
       @_dp_damage_sprite.dispose
       @_dp_damage_sprite = nil
       @_dp_damage_duration = 0
     end
   end
   def effect?
     @_whiten_duration > 0 or
     @_appear_duration > 0 or
     @_escape_duration > 0 or
     @_collapse_duration > 0 or
     @_damage_duration > 0 or
     @_sp2_damage_duration > 0 or
     @_sp_damage_duration > 0 or
     @_cp_damage_duration > 0 or
     @_dp_damage_duration > 0 or
     @_cp2_damage_duration > 0 or
     @_dp2_damage_duration > 0 or
     @_pp_damage_duration > 0 or
     @_animation_duration > 0
   end
   def update
     super
     if @_whiten_duration > 0
       @_whiten_duration -= 1
       self.color.alpha = 128 - (16 - @_whiten_duration) * 10
     end
     if @_appear_duration > 0
       @_appear_duration -= 1
       self.opacity = (16 - @_appear_duration) * 16
     end
     if @_escape_duration > 0
       @_escape_duration -= 1
       self.opacity = 256 - (32 - @_escape_duration) * 10
     end
     if @_collapse_duration > 0
       @_collapse_duration -= 1
       self.opacity = 256 - (48 - @_collapse_duration) * 6
     end
     if @_damage_duration > 0
       @_damage_duration -= 1
       case @_damage_duration
       when 38..39
         @_damage_sprite.y -= 4
       when 36..37
         @_damage_sprite.y -= 2
       when 34..35
         @_damage_sprite.y += 2
       when 28..33
         @_damage_sprite.y += 4
       end
       @_damage_sprite.opacity = 256 - (12 - @_damage_duration) * 32
       if @_damage_duration == 0
         dispose_damage
       end
     end
     #---------------------------------
     if @_sp_damage_duration > 0
       @_sp_damage_duration -= 1
       case @_sp_damage_duration
       # 这里把SP伤害数值的显示设成往上飘了
       # 如要往下飘,把@_sp_damage_sprite.y后的-换成+
       when 0..60
         @_sp_damage_sprite.y -= 1
       end
       @_sp_damage_sprite.opacity = 256 - (40 - @_sp_damage_duration) * 7
       if @_sp_damage_duration == 0
         dispose_sp_damage
       end
     end
     #---------------------------------
      #---------------------------------
     if @_sp2_damage_duration > 0
       @_sp2_damage_duration -= 1
     #  case @_sp2_damage_duration
       # 这里把SP伤害数值的显示设成往上飘了
       # 如要往下飘,把@_sp_damage_sprite.y后的-换成+
      # when 0..60
        # @_sp2_damage_sprite.y -= 1
       #end
       @_sp2_damage_sprite.blink_on
       @_sp2_damage_sprite.opacity = 256 - (40 - @_sp2_damage_duration) * 7
       if @_sp2_damage_duration == 0
         dispose_sp2_damage
       end
     end
     #---------------------------------
      #---------------------------------
     if @_cp2_damage_duration > 0
       @_cp2_damage_duration -= 1
      case @_cp2_damage_duration
       when 38..39
         @_cp2_damage_sprite.y -= 4
       when 36..37
         @_cp2_damage_sprite.y -= 2
       when 34..35
         @_cp2_damage_sprite.y += 2
       when 28..33
         @_cp2_damage_sprite.y += 4
       end
       @_cp2_damage_sprite.opacity = 256 - (12 - @_cp2_damage_duration) * 32
       if @_cp2_damage_duration == 0
         dispose_cp2_damage
       end
     end
     #---------------------------------
      #---------------------------------
     if @_dp2_damage_duration > 0
       @_dp2_damage_duration -= 1
      case @_dp2_damage_duration
       when 38..39
         @_dp2_damage_sprite.y -= 4
       when 36..37
         @_dp2_damage_sprite.y -= 2
       when 34..35
         @_dp2_damage_sprite.y += 2
       when 28..33
         @_dp2_damage_sprite.y += 4
       end
       @_dp2_damage_sprite.opacity = 256 - (12 - @_dp2_damage_duration) * 32
       if @_dp2_damage_duration == 0
         dispose_dp2_damage
       end
     end
     #---------------------------------
     #---------------------------------
     if @_cp_damage_duration > 0
       @_cp_damage_duration -= 1
       case @_cp_damage_duration
       when 0..99
         @_cp_damage_duration -= 5
       when 110..111
         @_cp_damage_sprite.y -= 4
       when 108..109
         @_cp_damage_sprite.y -= 2
       when 106..107
         @_cp_damage_sprite.y += 2
       when 100..105
         @_cp_damage_sprite.y += 4
       end
       @_cp_damage_sprite.opacity = 256 - (12 - @_cp_damage_duration) * 32
       if @_cp_damage_duration == 0
         dispose_cp_damage
       end
     end
     #---------------------------------
     #---------------------------------
     if @_dp_damage_duration > 0
       @_dp_damage_duration -= 1
       case @_dp_damage_duration
       # 这里把SP伤害数值的显示设成往上飘了
       # 如要往下飘,把@_sp_damage_sprite.y后的-换成+
       when 0..132
         @_dp_damage_sprite.y -= 1
        # @_dp_damage_sprite.x -= 1
       end
       @_dp_damage_sprite.opacity = 256 - (40 - @_dp_damage_duration) * 7
       if @_dp_damage_duration == 0
         dispose_dp_damage
       end
     end
     #---------------------------------
      #---------------------------------
    if @_pp_damage_duration > 0
       @_pp_damage_duration -= 1
       case @_pp_damage_duration
       when 0..67
         @_pp_damage_sprite.y -= 1
       when 78..79
         @_pp_damage_sprite.y -= 4
       when 76..77
         @_pp_damage_sprite.y -= 2
       when 74..75
         @_pp_damage_sprite.y += 2
       when 68..73
         @_pp_damage_sprite.y += 4
       end
       @_pp_damage_sprite.opacity = 256 - (12 - @_pp_damage_duration) * 32
       if @_pp_damage_duration == 0
         dispose_pp_damage
       end
     end
     #---------------------------------
     if @_animation != nil and (Graphics.frame_count % 2 == 0)
       @_animation_duration -= 1
       update_animation
     end
     if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
       update_loop_animation
       @_loop_animation_index += 1
       @_loop_animation_index %= @_loop_animation.frame_max
     end
     if @_blink
       @_blink_count = (@_blink_count + 1) % 32
       if @_blink_count < 16
         alpha = (16 - @_blink_count) * 6
       else
         alpha = (@_blink_count - 16) * 6
       end
       self.color.set(255, 255, 255, alpha)
     end
     @@_animations.clear
   end
end
end
class Game_Battler
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_reader   :last_hp                  # 受效前的HP
attr_accessor :sp_damage                   # SP伤害值
attr_accessor :last_sp                            # 受效前的SP
attr_accessor :sp_damage_pop               # 显示SP伤害标志
attr_accessor :cp_damage
attr_accessor :cp_damage_pop
attr_accessor :dp_damage
attr_accessor :dp_damage_pop
attr_accessor :cp2_damage
attr_accessor :cp2_damage_pop
attr_accessor :dp2_damage
attr_accessor :dp2_damage_pop
attr_accessor :pp_damage
attr_accessor :pp_damage_pop
attr_accessor :sp2_damage
attr_accessor :sp2_damage_pop
end
class Scene_Battle
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_accessor :target_battlers
attr_accessor :active_battler
attr_reader :skill
end[/pre]

Mr.Gandum

梦石
0
星屑
226
在线时间
2070 小时
注册时间
2007-1-31
回帖
2982

贵宾

发表于 2016-8-8 21:51:17 | 显示全部楼层
只显示对象受到的SP伤害就行?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部