设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 3596|回复: 1
打印 上一主题 下一主题

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

[复制链接]

Lv4.逐梦者

梦石
0
星屑
5712
在线时间
1556 小时
注册时间
2011-6-14
帖子
520
跳转到指定楼层
1
发表于 2016-3-20 15:06:30 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
8星屑
本帖最后由 余烬之中 于 2016-8-3 10:06 编辑

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


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

Lv1.梦旅人

Mr.Gandum

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

贵宾

2
发表于 2016-8-8 21:51:17 | 只看该作者
只显示对象受到的SP伤害就行?
回复

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-29 03:51

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表