查看: 4365|回复: 1

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

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

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


  1. #==========================================================================
  2. # 本脚本来自[url]www.66rpg.com[/url],用于任何游戏请保留此信息。别以为加密就可以del哦
  3. #==========================================================================
  4. #==============================================================================
  5. # SP伤害显示 v1.0
  6. #==============================================================================
  7. # By 叶子  Date: 12-25-2005
  8. # “23种战斗特效的公共事件版”作者:SailCat
  9. # 本脚本同时整合了 SailCat 的“23种战斗特效的公共事件版”脚本
  10. # 请访问shownews.asp?id=19 学习“23种战斗特效的公共事件版”的使用
  11. # 感谢 SailCat,为战斗特效创造了无数可能
  12. #==============================================================================
  13. # SP伤害颜色设定:
  14. #搜索 bitmap.font.color.set
  15. # 显示使用者SP变化的特技:
  16. # 在SHOW_SP_DAMAGE_SKILLS后面的中括号中填上需要显示使用者SP变化的特技ID,中间以逗号“ , ”隔开
  17. # 例如要5号,8号,16号特技显示使用者SP变化:
  18. # SHOW_SP_DAMAGE_SKILLS = [5,8,16]
  19. class Scene_Battle
  20. SHOW_SP_DAMAGE_SKILLS = []
  21. end
  22. #==============================================================================
  23. # ■ Sprite_Battler
  24. #------------------------------------------------------------------------------
  25. #  战斗显示用活动块。Game_Battler 类的实例监视、
  26. # 活动块的状态的监视。
  27. #==============================================================================
  28. class Sprite_Battler < RPG::Sprite
  29. #--------------------------------------------------------------------------
  30. # ● 刷新画面
  31. #--------------------------------------------------------------------------
  32. def update
  33.    super
  34.    # 战斗者为 nil 的情况下
  35.    if @battler == nil
  36.      self.bitmap = nil
  37.      loop_animation(nil)
  38.      return
  39.    end
  40.    # 文件名和色相与当前情况有差异的情况下
  41.    if @battler.battler_name != @battler_name or
  42.       @battler.battler_hue != @battler_hue
  43.      # 获取、设置位图
  44.      @battler_name = @battler.battler_name
  45.      @battler_hue = @battler.battler_hue
  46.      self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  47.      @width = bitmap.width
  48.      @height = bitmap.height
  49.      self.ox = @width / 2
  50.      self.oy = @height
  51.      # 如果是战斗不能或者是隐藏状态就把透明度设置成 0
  52.      if @battler.dead? or @battler.hidden
  53.        self.opacity = 0
  54.      end
  55.    end
  56.    # 动画 ID 与当前的情况有差异的情况下
  57.    if @battler.damage == nil and
  58.       @battler.state_animation_id != @state_animation_id
  59.      @state_animation_id = @battler.state_animation_id
  60.      loop_animation($data_animations[@state_animation_id])
  61.    end
  62.    # 应该被显示的角色的情况下
  63.    if @battler.is_a?(Game_Actor) and @battler_visible
  64.      # 不是主状态的时候稍稍降低点透明度
  65.      if $game_temp.battle_main_phase
  66.        self.opacity += 3 if self.opacity < 255
  67.      else
  68.        self.opacity -= 3 if self.opacity > 207
  69.      end
  70.    end
  71.    # 明灭
  72.    if @battler.blink
  73.      blink_on
  74.    else
  75.      blink_off
  76.    end
  77.    # 不可见的情况下
  78.    unless @battler_visible
  79.      # 出现
  80.      if not @battler.hidden and not @battler.dead? and
  81.         (@battler.damage == nil or @battler.damage_pop)
  82.        appear
  83.        @battler_visible = true
  84.      end
  85.    end
  86.    # 可见的情况下
  87.    if @battler_visible
  88.      # 逃跑
  89.      if @battler.hidden
  90.        $game_system.se_play($data_system.escape_se)
  91.        escape
  92.        @battler_visible = false
  93.      end
  94.      # 白色闪烁
  95.      if @battler.white_flash
  96.        whiten
  97.        @battler.white_flash = false
  98.      end
  99.      # 动画
  100.      if @battler.animation_id != 0
  101.        animation = $data_animations[@battler.animation_id]
  102.        animation(animation, @battler.animation_hit)
  103.        @battler.animation_id = 0
  104.      end
  105.      # 伤害
  106.      if @battler.damage_pop
  107.        damage(@battler.damage, @battler.critical)
  108.        @battler.damage = nil
  109.        @battler.critical = false
  110.        @battler.damage_pop = false
  111.      end
  112.      #---------------------------------
  113.      # SP伤害
  114.      if @battler.sp_damage_pop
  115.        sp_damage(@battler.sp_damage)
  116.        @battler.sp_damage = nil
  117.        @battler.sp_damage_pop = false
  118.      end
  119.      #---------------------------------
  120.       #---------------------------------
  121.      # SP伤害-2
  122.      if @battler.sp2_damage_pop
  123.        sp2_damage(@battler.sp2_damage)
  124.        @battler.sp2_damage = nil
  125.        @battler.sp2_damage_pop = false
  126.      end
  127.      #---------------------------------
  128.      #---------------------------------
  129.      # CP伤害
  130.      if @battler.cp_damage_pop
  131.        cp_damage(@battler.cp_damage)
  132.        @battler.cp_damage = nil
  133.        @battler.cp_damage_pop = false
  134.      end
  135.      #---------------------------------
  136.      #---------------------------------
  137.      # DP伤害
  138.      if @battler.dp_damage_pop
  139.        dp_damage(@battler.dp_damage)
  140.        @battler.dp_damage = nil
  141.        @battler.dp_damage_pop = false
  142.      end
  143.      #---------------------------------
  144.       #---------------------------------
  145.      # CP伤害-2
  146.      if @battler.cp2_damage_pop
  147.        cp2_damage(@battler.cp2_damage)
  148.        @battler.cp2_damage = nil
  149.        @battler.cp2_damage_pop = false
  150.      end
  151.      #---------------------------------
  152.      #---------------------------------
  153.      # DP伤害-2
  154.      if @battler.dp2_damage_pop
  155.        dp2_damage(@battler.dp2_damage)
  156.        @battler.dp2_damage = nil
  157.        @battler.dp2_damage_pop = false
  158.      end
  159.      #---------------------------------
  160.      #---------------------------------
  161.      # PP伤害
  162.      if @battler.pp_damage_pop
  163.        pp_damage(@battler.pp_damage)
  164.        @battler.pp_damage = nil
  165.        @battler.pp_damage_pop = false
  166.      end
  167.      #---------------------------------
  168.      # korapusu
  169.      if @battler.damage == nil and @battler.dead?
  170.        if @battler.is_a?(Game_Enemy)
  171.          $game_system.se_play($data_system.enemy_collapse_se)
  172.        else
  173.          $game_system.se_play($data_system.actor_collapse_se)
  174.        end
  175.        collapse
  176.        @battler_visible = false
  177.      end
  178.    end
  179.    # 设置活动块的坐标
  180.    self.x = @battler.screen_x
  181.    self.y = @battler.screen_y
  182.    self.z = @battler.screen_z
  183. end
  184. end

  185. #==============================================================================
  186. #--
  187. # RPG::Sprite
  188. # 追加了 RPGXP 使用的各种效果处理的精灵的类。
  189. #--
  190. #==============================================================================
  191. module RPG
  192. class Sprite < ::Sprite
  193.    
  194.    def initialize(viewport = nil)
  195.      super(viewport)
  196.      @_whiten_duration = 0
  197.      @_appear_duration = 0
  198.      @_escape_duration = 0
  199.      @_collapse_duration = 0
  200.      @_damage_duration = 0
  201.      @_sp2_damage_duration = 0
  202.      @_sp_damage_duration = 0
  203.      @_cp_damage_duration = 0
  204.      @_dp_damage_duration = 0
  205.      @_cp2_damage_duration = 0
  206.      @_dp2_damage_duration = 0
  207.      @_pp_damage_duration = 0
  208.      @_animation_duration = 0
  209.      @_blink = false
  210.    end
  211.    def dispose
  212.      dispose_damage
  213.      dispose_sp2_damage
  214.      dispose_sp_damage
  215.      dispose_cp_damage
  216.      dispose_dp_damage
  217.      dispose_cp2_damage
  218.      dispose_dp2_damage
  219.      dispose_pp_damage
  220.      dispose_animation
  221.      dispose_loop_animation
  222.      super
  223.    end
  224.    def pp_damage(value)
  225.      dispose_pp_damage
  226.      if value.is_a?(Numeric)
  227.        damage_string = value.abs.to_s
  228.      else
  229.        damage_string = value.to_s
  230.      end
  231.      bitmap = Bitmap.new(160+1000, 48)
  232.      bitmap.font.name = ["黑体", "楷体", "宋体"]
  233.      bitmap.font.size = 20
  234.      bitmap.font.color.set(0, 0, 0)
  235.      bitmap.draw_text(-1, 12-1, 160+1000, 36, damage_string, 0)
  236.      bitmap.draw_text(+1, 12-1, 160+1000, 36, damage_string, 0)
  237.      bitmap.draw_text(-1, 12+1, 160+1000, 36, damage_string, 0)
  238.      bitmap.draw_text(+1, 12+1, 160+1000, 36, damage_string, 0)
  239.      if value.is_a?(Numeric) and value < 0
  240.        bitmap.font.color.set(99, 255, 71) # xx绿  
  241.      else
  242.       # bitmap.font.color.set(255, 99, 71) # 番茄红
  243.        bitmap.font.color.set(99, 255, 71) # xx绿
  244.      end
  245.      bitmap.draw_text(0, 12, 160+1000, 36, damage_string, 0)
  246.    #  @_sp_damage_sprite = ::Sprite.new(self.viewport)
  247.      @_pp_damage_sprite = ::Sprite.new(Viewport.new(0, 0, 640, 480))
  248.      @_pp_damage_sprite.bitmap = bitmap
  249.      @_pp_damage_sprite.ox = 80
  250.      @_pp_damage_sprite.oy = 100
  251.      @_pp_damage_sprite.x = self.x
  252.      @_pp_damage_sprite.y = self.y - self.oy / 2 + 64
  253.      @_pp_damage_sprite.z = 9995
  254.      @_pp_damage_sprite.viewport.z = self.viewport.z + 1
  255.      @_pp_damage_duration = 80
  256.    end
  257.    def dispose_pp_damage
  258.      if @_pp_damage_sprite != nil
  259.        @_pp_damage_sprite.viewport.dispose
  260.        @_pp_damage_sprite.bitmap.dispose
  261.        @_pp_damage_sprite.dispose
  262.        @_pp_damage_sprite = nil
  263.        @_pp_damage_duration = 0
  264.      end
  265.    end
  266.    #-----------------------------------
  267.    def sp_damage(value)
  268.      dispose_sp_damage
  269.      if value.is_a?(Numeric)
  270.        damage_string = value.abs.to_s
  271.      else
  272.        damage_string = value.to_s
  273.      end
  274.      bitmap = Bitmap.new(160+1000, 48)
  275.      bitmap.font.name = ["黑体", "楷体", "宋体"]
  276.      bitmap.font.size = 20
  277.      bitmap.font.color.set(0, 0, 0)
  278.      bitmap.draw_text(-1, 12-1, 160+1000, 36, damage_string, 0)
  279.      bitmap.draw_text(+1, 12-1, 160+1000, 36, damage_string, 0)
  280.      bitmap.draw_text(-1, 12+1, 160+1000, 36, damage_string, 0)
  281.      bitmap.draw_text(+1, 12+1, 160+1000, 36, damage_string, 0)
  282.      if value.is_a?(Numeric) and value < 0
  283.        bitmap.font.color.set(255, 99, 71) # 番茄红
  284.      else
  285.       # bitmap.font.color.set(255, 99, 71) # 番茄红
  286.        bitmap.font.color.set(0, 0, 205) # 适中的蓝色
  287.      end
  288.      bitmap.draw_text(0, 12, 160+1000, 36, damage_string, 0)
  289.    #  @_sp_damage_sprite = ::Sprite.new(self.viewport)
  290.      @_sp_damage_sprite = ::Sprite.new(Viewport.new(0, 0, 640, 480))
  291.      @_sp_damage_sprite.bitmap = bitmap
  292.      @_sp_damage_sprite.ox = 80
  293.      @_sp_damage_sprite.oy = 100
  294.      @_sp_damage_sprite.x = self.x
  295.      @_sp_damage_sprite.y = self.y - self.oy / 2 +48
  296.      @_sp_damage_sprite.z = 9998
  297.      @_sp_damage_sprite.viewport.z = self.viewport.z + 1
  298.      @_sp_damage_duration = 72
  299.    end
  300.    def dispose_sp_damage
  301.      if @_sp_damage_sprite != nil
  302.        @_sp_damage_sprite.viewport.dispose
  303.        @_sp_damage_sprite.bitmap.dispose
  304.        @_sp_damage_sprite.dispose
  305.        @_sp_damage_sprite = nil
  306.        @_sp_damage_duration = 0
  307.      end
  308.    end
  309.    #-----------------------------------
  310.    def sp2_damage(value)
  311.      dispose_sp2_damage
  312.      if value.is_a?(Numeric)
  313.        damage_string = value.abs.to_s
  314.      else
  315.        damage_string = value.to_s
  316.      end
  317.      bitmap = Bitmap.new(160+1000, 48)
  318.      bitmap.font.name = ["黑体", "楷体", "宋体"]
  319.      bitmap.font.size = 20
  320.      bitmap.font.color.set(0, 0, 0)
  321.      bitmap.draw_text(-1, 12-1, 160+1000, 36, damage_string, 0)
  322.      bitmap.draw_text(+1, 12-1, 160+1000, 36, damage_string, 0)
  323.      bitmap.draw_text(-1, 12+1, 160+1000, 36, damage_string, 0)
  324.      bitmap.draw_text(+1, 12+1, 160+1000, 36, damage_string, 0)
  325.      if value.is_a?(Numeric) and value < 0
  326.        bitmap.font.color.set(255, 255, 128)
  327.      else
  328.        bitmap.font.color.set(255, 255, 128)
  329.      end
  330.      bitmap.draw_text(0, 12, 160+1000, 36, damage_string, 0)
  331.    #  @_sp_damage_sprite = ::Sprite.new(self.viewport)
  332.      @_sp2_damage_sprite = RPG::Sprite.new(Viewport.new(0, 0, 640, 480)) #::Sprite.new(Viewport.new(0, 0, 640, 480))
  333.      @_sp2_damage_sprite.bitmap = bitmap
  334.      @_sp2_damage_sprite.ox = 80
  335.      @_sp2_damage_sprite.oy = 100
  336.      @_sp2_damage_sprite.x = self.x-((value.to_s.size*6-114)/2).round
  337.      @_sp2_damage_sprite.y = self.y - self.oy / 2 +56
  338.      @_sp2_damage_sprite.z = 9900
  339.      @_sp2_damage_sprite.viewport.z = self.viewport.z + 1
  340.      @_sp2_damage_duration = 108
  341.    end
  342.    def dispose_sp2_damage
  343.      if @_sp2_damage_sprite != nil
  344.        @_sp2_damage_sprite.viewport.dispose
  345.        @_sp2_damage_sprite.bitmap.dispose
  346.        @_sp2_damage_sprite.dispose
  347.        @_sp2_damage_sprite = nil
  348.        @_sp2_damage_duration = 0
  349.      end
  350.    end
  351.     #-----------------------------------
  352.    def cp2_damage(value)
  353.      dispose_cp2_damage
  354.      if value.is_a?(Numeric)
  355.        damage_string = value.abs.to_s
  356.      else
  357.        damage_string = value.to_s
  358.      end
  359.      bitmap = Bitmap.new(160+1000, 48)
  360.      bitmap.font.name = ["黑体", "楷体", "宋体"]
  361.      bitmap.font.size = 20
  362.      bitmap.font.color.set(0, 0, 0)
  363.      bitmap.draw_text(-1, 12-1, 160+1000, 36, damage_string, 0)
  364.      bitmap.draw_text(+1, 12-1, 160+1000, 36, damage_string, 0)
  365.      bitmap.draw_text(-1, 12+1, 160+1000, 36, damage_string, 0)
  366.      bitmap.draw_text(+1, 12+1, 160+1000, 36, damage_string, 0)
  367.      if value.is_a?(Numeric) and value < 0
  368.        bitmap.font.color.set(255, 255, 120)
  369.      else
  370.        bitmap.font.color.set(255, 255, 120)
  371.      end
  372.      bitmap.draw_text(0, 12, 160+1000, 36, damage_string, 0)
  373.    #  @_sp_damage_sprite = ::Sprite.new(self.viewport)
  374.      @_cp2_damage_sprite = RPG::Sprite.new(Viewport.new(0, 0, 640, 480)) #::Sprite.new(Viewport.new(0, 0, 640, 480))
  375.      @_cp2_damage_sprite.bitmap = bitmap
  376.      @_cp2_damage_sprite.ox = 80
  377.      @_cp2_damage_sprite.oy = 100
  378.      @_cp2_damage_sprite.x = self.x-((value.to_s.size*6-130)/2).round
  379.      @_cp2_damage_sprite.y = self.y - self.oy / 2 +64
  380.      @_cp2_damage_sprite.z = 9901
  381.      @_cp2_damage_sprite.viewport.z = self.viewport.z + 1
  382.      @_cp2_damage_duration = 40
  383.    end
  384.    def dispose_cp2_damage
  385.      if @_cp2_damage_sprite != nil
  386.        @_cp2_damage_sprite.viewport.dispose
  387.        @_cp2_damage_sprite.bitmap.dispose
  388.        @_cp2_damage_sprite.dispose
  389.        @_cp2_damage_sprite = nil
  390.        @_cp2_damage_duration = 0
  391.      end
  392.    end
  393.    def cp_damage(value)
  394.      dispose_cp_damage
  395.      if value.is_a?(Numeric)
  396.        damage_string = value.abs.to_s
  397.      else
  398.        damage_string = value.to_s
  399.      end
  400.      bitmap = Bitmap.new(160+1000, 48)
  401.      bitmap.font.name = ["黑体", "楷体", "宋体"]
  402.      bitmap.font.size = 20
  403.      bitmap.font.color.set(0, 0, 0)
  404.      bitmap.draw_text(-1, 12-1, 160+1000, 36, damage_string, 0)
  405.      bitmap.draw_text(+1, 12-1, 160+1000, 36, damage_string, 0)
  406.      bitmap.draw_text(-1, 12+1, 160+1000, 36, damage_string, 0)
  407.      bitmap.draw_text(+1, 12+1, 160+1000, 36, damage_string, 0)
  408.      if value.is_a?(Numeric) and value < 0
  409.        #bitmap.font.color.set(255, 99, 71) # 番茄红
  410.        bitmap.font.color.set(255, 255, 128)
  411.      else
  412.        bitmap.font.color.set(255, 255, 128)
  413.        #bitmap.font.color.set(255, 99, 71) # 番茄红
  414.        #bitmap.font.color.set(0, 0, 205) # 适中的蓝色
  415.      end
  416.      bitmap.draw_text(0, 12, 160+1000, 36, damage_string, 0)
  417.     # @_cp_damage_sprite = ::Sprite.new(self.viewport)
  418.      @_cp_damage_sprite = ::Sprite.new(Viewport.new(0, 0, 640, 480))
  419.      @_cp_damage_sprite.bitmap = bitmap
  420.      @_cp_damage_sprite.ox = 80
  421.      @_cp_damage_sprite.oy = 100
  422.      @_cp_damage_sprite.x = self.x
  423.      @_cp_damage_sprite.y = self.y - self.oy / 2 +140
  424.      @_cp_damage_sprite.z = 9997
  425.      @_cp_damage_sprite.viewport.z = self.viewport.z + 1
  426.      @_cp_damage_duration = 112
  427.    end
  428.    def dispose_cp_damage
  429.      if @_cp_damage_sprite != nil
  430.        @_cp_damage_sprite.viewport.dispose
  431.        @_cp_damage_sprite.bitmap.dispose
  432.        @_cp_damage_sprite.dispose
  433.        @_cp_damage_sprite = nil
  434.        @_cp_damage_duration = 0
  435.      end
  436.    end
  437.     #-----------------------------------
  438.    def dp2_damage(value)
  439.      dispose_dp2_damage
  440.      if value.is_a?(Numeric)
  441.        damage_string = value.abs.to_s
  442.      else
  443.        damage_string = value.to_s
  444.      end
  445.      bitmap = Bitmap.new(160+1000, 48)
  446.      bitmap.font.name = ["黑体", "楷体", "宋体"]
  447.      bitmap.font.size = 20
  448.      bitmap.font.color.set(0, 0, 0)
  449.      bitmap.draw_text(-1, 12-1, 160+1000, 36, damage_string, 0)
  450.      bitmap.draw_text(+1, 12-1, 160+1000, 36, damage_string, 0)
  451.      bitmap.draw_text(-1, 12+1, 160+1000, 36, damage_string, 0)
  452.      bitmap.draw_text(+1, 12+1, 160+1000, 36, damage_string, 0)
  453.      if value.is_a?(Numeric) and value < 0
  454.        bitmap.font.color.set(255, 99, 71)
  455.      else
  456.        bitmap.font.color.set(255, 99, 71)
  457.      end
  458.      bitmap.draw_text(0, 12, 160+1000, 36, damage_string, 0)
  459.    #  @_sp_damage_sprite = ::Sprite.new(self.viewport)
  460.      @_dp2_damage_sprite = RPG::Sprite.new(Viewport.new(0, 0, 640, 480)) #::Sprite.new(Viewport.new(0, 0, 640, 480))
  461.      @_dp2_damage_sprite.bitmap = bitmap
  462.      @_dp2_damage_sprite.ox = 80
  463.      @_dp2_damage_sprite.oy = 100
  464.      @_dp2_damage_sprite.x = self.x-((value.to_s.size*6-138)/2).round
  465.      @_dp2_damage_sprite.y = self.y - self.oy / 2 +36
  466.      @_dp2_damage_sprite.z = 9902
  467.      @_dp2_damage_sprite.viewport.z = self.viewport.z + 1
  468.      @_dp2_damage_duration = 40
  469.    end
  470.    def dispose_dp2_damage
  471.      if @_dp2_damage_sprite != nil
  472.        @_dp2_damage_sprite.viewport.dispose
  473.        @_dp2_damage_sprite.bitmap.dispose
  474.        @_dp2_damage_sprite.dispose
  475.        @_dp2_damage_sprite = nil
  476.        @_dp2_damage_duration = 0
  477.      end
  478.    end
  479.    def dp_damage(value)
  480.      dispose_dp_damage
  481.      if value.is_a?(Numeric)
  482.        damage_string = value.abs.to_s
  483.      else
  484.        damage_string = value.to_s
  485.      end
  486.      bitmap = Bitmap.new(160+1000, 48)
  487.      bitmap.font.name = ["黑体", "楷体", "宋体"]
  488.      bitmap.font.size = 20
  489.      bitmap.font.color.set(0, 0, 0)
  490.      bitmap.draw_text(-1, 12-1, 160+1000, 36, damage_string, 0)
  491.      bitmap.draw_text(+1, 12-1, 160+1000, 36, damage_string, 0)
  492.      bitmap.draw_text(-1, 12+1, 160+1000, 36, damage_string, 0)
  493.      bitmap.draw_text(+1, 12+1, 160+1000, 36, damage_string, 0)
  494.      if value.is_a?(Numeric) and value < 0
  495.        bitmap.font.color.set(255, 99, 71) # 番茄红
  496.        #bitmap.font.color.set(255, 255, 128)
  497.      else
  498.        #bitmap.font.color.set(255, 255, 128)
  499.        bitmap.font.color.set(255, 99, 71) # 番茄红
  500.        #bitmap.font.color.set(0, 0, 205) # 适中的蓝色
  501.      end
  502.      bitmap.draw_text(0, 12, 160+1000, 36, damage_string, 0)
  503.      #@_dp_damage_sprite = ::Sprite.new(self.viewport)
  504.      @_dp_damage_sprite = ::Sprite.new(Viewport.new(0, 0, 640, 480))
  505.      @_dp_damage_sprite.bitmap = bitmap
  506.      @_dp_damage_sprite.ox = 80
  507.      @_dp_damage_sprite.oy = 100
  508.      @_dp_damage_sprite.x = self.x
  509.      @_dp_damage_sprite.y = self.y - self.oy / 2 +84
  510.      @_dp_damage_sprite.z = 9999
  511.      @_dp_damage_sprite.viewport.z = self.viewport.z + 1
  512.      @_dp_damage_duration = 88
  513.    end
  514.    def dispose_dp_damage
  515.      if @_dp_damage_sprite != nil
  516.        @_dp_damage_sprite.viewport.dispose
  517.        @_dp_damage_sprite.bitmap.dispose
  518.        @_dp_damage_sprite.dispose
  519.        @_dp_damage_sprite = nil
  520.        @_dp_damage_duration = 0
  521.      end
  522.    end
  523.    def effect?
  524.      @_whiten_duration > 0 or
  525.      @_appear_duration > 0 or
  526.      @_escape_duration > 0 or
  527.      @_collapse_duration > 0 or
  528.      @_damage_duration > 0 or
  529.      @_sp2_damage_duration > 0 or
  530.      @_sp_damage_duration > 0 or
  531.      @_cp_damage_duration > 0 or
  532.      @_dp_damage_duration > 0 or
  533.      @_cp2_damage_duration > 0 or
  534.      @_dp2_damage_duration > 0 or
  535.      @_pp_damage_duration > 0 or
  536.      @_animation_duration > 0
  537.    end
  538.    def update
  539.      super
  540.      if @_whiten_duration > 0
  541.        @_whiten_duration -= 1
  542.        self.color.alpha = 128 - (16 - @_whiten_duration) * 10
  543.      end
  544.      if @_appear_duration > 0
  545.        @_appear_duration -= 1
  546.        self.opacity = (16 - @_appear_duration) * 16
  547.      end
  548.      if @_escape_duration > 0
  549.        @_escape_duration -= 1
  550.        self.opacity = 256 - (32 - @_escape_duration) * 10
  551.      end
  552.      if @_collapse_duration > 0
  553.        @_collapse_duration -= 1
  554.        self.opacity = 256 - (48 - @_collapse_duration) * 6
  555.      end
  556.      if @_damage_duration > 0
  557.        @_damage_duration -= 1
  558.        case @_damage_duration
  559.        when 38..39
  560.          @_damage_sprite.y -= 4
  561.        when 36..37
  562.          @_damage_sprite.y -= 2
  563.        when 34..35
  564.          @_damage_sprite.y += 2
  565.        when 28..33
  566.          @_damage_sprite.y += 4
  567.        end
  568.        @_damage_sprite.opacity = 256 - (12 - @_damage_duration) * 32
  569.        if @_damage_duration == 0
  570.          dispose_damage
  571.        end
  572.      end
  573.      #---------------------------------
  574.      if @_sp_damage_duration > 0
  575.        @_sp_damage_duration -= 1
  576.        case @_sp_damage_duration
  577.        # 这里把SP伤害数值的显示设成往上飘了
  578.        # 如要往下飘,把@_sp_damage_sprite.y后的-换成+
  579.        when 0..60
  580.          @_sp_damage_sprite.y -= 1
  581.        end
  582.        @_sp_damage_sprite.opacity = 256 - (40 - @_sp_damage_duration) * 7
  583.        if @_sp_damage_duration == 0
  584.          dispose_sp_damage
  585.        end
  586.      end
  587.      #---------------------------------
  588.       #---------------------------------
  589.      if @_sp2_damage_duration > 0
  590.        @_sp2_damage_duration -= 1
  591.      #  case @_sp2_damage_duration
  592.        # 这里把SP伤害数值的显示设成往上飘了
  593.        # 如要往下飘,把@_sp_damage_sprite.y后的-换成+
  594.       # when 0..60
  595.         # @_sp2_damage_sprite.y -= 1
  596.        #end
  597.        @_sp2_damage_sprite.blink_on
  598.        @_sp2_damage_sprite.opacity = 256 - (40 - @_sp2_damage_duration) * 7
  599.        if @_sp2_damage_duration == 0
  600.          dispose_sp2_damage
  601.        end
  602.      end
  603.      #---------------------------------
  604.       #---------------------------------
  605.      if @_cp2_damage_duration > 0
  606.        @_cp2_damage_duration -= 1
  607.       case @_cp2_damage_duration
  608.        when 38..39
  609.          @_cp2_damage_sprite.y -= 4
  610.        when 36..37
  611.          @_cp2_damage_sprite.y -= 2
  612.        when 34..35
  613.          @_cp2_damage_sprite.y += 2
  614.        when 28..33
  615.          @_cp2_damage_sprite.y += 4
  616.        end
  617.        @_cp2_damage_sprite.opacity = 256 - (12 - @_cp2_damage_duration) * 32
  618.        if @_cp2_damage_duration == 0
  619.          dispose_cp2_damage
  620.        end
  621.      end
  622.      #---------------------------------
  623.       #---------------------------------
  624.      if @_dp2_damage_duration > 0
  625.        @_dp2_damage_duration -= 1
  626.       case @_dp2_damage_duration
  627.        when 38..39
  628.          @_dp2_damage_sprite.y -= 4
  629.        when 36..37
  630.          @_dp2_damage_sprite.y -= 2
  631.        when 34..35
  632.          @_dp2_damage_sprite.y += 2
  633.        when 28..33
  634.          @_dp2_damage_sprite.y += 4
  635.        end
  636.        @_dp2_damage_sprite.opacity = 256 - (12 - @_dp2_damage_duration) * 32
  637.        if @_dp2_damage_duration == 0
  638.          dispose_dp2_damage
  639.        end
  640.      end
  641.      #---------------------------------
  642.      #---------------------------------
  643.      if @_cp_damage_duration > 0
  644.        @_cp_damage_duration -= 1
  645.        case @_cp_damage_duration
  646.        when 0..99
  647.          @_cp_damage_duration -= 5
  648.        when 110..111
  649.          @_cp_damage_sprite.y -= 4
  650.        when 108..109
  651.          @_cp_damage_sprite.y -= 2
  652.        when 106..107
  653.          @_cp_damage_sprite.y += 2
  654.        when 100..105
  655.          @_cp_damage_sprite.y += 4
  656.        end
  657.        @_cp_damage_sprite.opacity = 256 - (12 - @_cp_damage_duration) * 32
  658.        if @_cp_damage_duration == 0
  659.          dispose_cp_damage
  660.        end
  661.      end
  662.      #---------------------------------
  663.      #---------------------------------
  664.      if @_dp_damage_duration > 0
  665.        @_dp_damage_duration -= 1
  666.        case @_dp_damage_duration
  667.        # 这里把SP伤害数值的显示设成往上飘了
  668.        # 如要往下飘,把@_sp_damage_sprite.y后的-换成+
  669.        when 0..132
  670.          @_dp_damage_sprite.y -= 1
  671.         # @_dp_damage_sprite.x -= 1
  672.        end
  673.        @_dp_damage_sprite.opacity = 256 - (40 - @_dp_damage_duration) * 7
  674.        if @_dp_damage_duration == 0
  675.          dispose_dp_damage
  676.        end
  677.      end
  678.      #---------------------------------
  679.       #---------------------------------
  680.     if @_pp_damage_duration > 0
  681.        @_pp_damage_duration -= 1
  682.        case @_pp_damage_duration
  683.        when 0..67
  684.          @_pp_damage_sprite.y -= 1
  685.        when 78..79
  686.          @_pp_damage_sprite.y -= 4
  687.        when 76..77
  688.          @_pp_damage_sprite.y -= 2
  689.        when 74..75
  690.          @_pp_damage_sprite.y += 2
  691.        when 68..73
  692.          @_pp_damage_sprite.y += 4
  693.        end
  694.        @_pp_damage_sprite.opacity = 256 - (12 - @_pp_damage_duration) * 32
  695.        if @_pp_damage_duration == 0
  696.          dispose_pp_damage
  697.        end
  698.      end
  699.      #---------------------------------
  700.      if @_animation != nil and (Graphics.frame_count % 2 == 0)
  701.        @_animation_duration -= 1
  702.        update_animation
  703.      end
  704.      if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
  705.        update_loop_animation
  706.        @_loop_animation_index += 1
  707.        @_loop_animation_index %= @_loop_animation.frame_max
  708.      end
  709.      if @_blink
  710.        @_blink_count = (@_blink_count + 1) % 32
  711.        if @_blink_count < 16
  712.          alpha = (16 - @_blink_count) * 6
  713.        else
  714.          alpha = (@_blink_count - 16) * 6
  715.        end
  716.        self.color.set(255, 255, 255, alpha)
  717.      end
  718.      @@_animations.clear
  719.    end
  720. end
  721. end
  722. class Game_Battler
  723. #--------------------------------------------------------------------------
  724. # ● 定义实例变量
  725. #--------------------------------------------------------------------------
  726. attr_reader   :last_hp                  # 受效前的HP
  727. attr_accessor :sp_damage                   # SP伤害值
  728. attr_accessor :last_sp                            # 受效前的SP
  729. attr_accessor :sp_damage_pop               # 显示SP伤害标志
  730. attr_accessor :cp_damage
  731. attr_accessor :cp_damage_pop
  732. attr_accessor :dp_damage
  733. attr_accessor :dp_damage_pop
  734. attr_accessor :cp2_damage
  735. attr_accessor :cp2_damage_pop
  736. attr_accessor :dp2_damage
  737. attr_accessor :dp2_damage_pop
  738. attr_accessor :pp_damage
  739. attr_accessor :pp_damage_pop
  740. attr_accessor :sp2_damage
  741. attr_accessor :sp2_damage_pop
  742. end
  743. class Scene_Battle
  744. #--------------------------------------------------------------------------
  745. # ● 定义实例变量
  746. #--------------------------------------------------------------------------
  747. attr_accessor :target_battlers
  748. attr_accessor :active_battler
  749. attr_reader :skill
  750. end
复制代码

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.

在本版发帖返回顶部