幻想森林

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1514|回复: 0

菜鸟垃圾脚本(全屏动画提速),照顾新人表pia哦

[复制链接]

4

主题

18

帖子

200

积分

③业余

积分
200
发表于 2008-3-30 19:13:43 | 显示全部楼层 |阅读模式
针对默认战斗,大幅提升播放很夸张的全屏动画时的FPS,整合请自己做-_____________-
module RPG
  class Sprite < ::Sprite
    attr_accessor :重复打断
    alias initialize_is2 :initialize
    def initialize(viewport = nil)
      initialize_is2(viewport)
      @重复打断 = false
    end
    @@_animations = []
    @@_reference_count = {}
    def update_animation
      if @_animation_duration > 0
        frame_index = @_animation.frame_max - @_animation_duration
        cell_data = @_animation.frames[frame_index].cell_data
        position = @_animation.position
        animation_set_sprites(@_animation_sprites, cell_data, position) unless @重复打断 == true
        for timing in @_animation.timings
          if timing.frame == frame_index
            animation_process_timing(timing, @_animation_hit)
          end
        end
      else
        dispose_animation
      end
    end
  end
end
class Sprite_Battler < RPG::Sprite
  attr_accessor :重复打断
  alias update_is2 :update
  def update
    update_is2
    @重复打断 = @battler.重复打断
  end
end
class Game_Battler
  attr_accessor :重复打断
end
class Scene_Battle
  def update_phase4_step4
    # 对像方动画
    for target in @target_battlers
      target.animation_id = @animation2_id
      target.animation_hit = (target.damage != "Miss")
      target.重复打断 = ($data_animations[@animation2_id].position == 3 && target.index > 0)
    end
    # 限制动画长度、最低 8 帧
    @wait_count = 8
    # 移至步骤 5
    @phase4_step = 5
  end
end
我是一只小小的白。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|幻想森林

GMT+8, 2025-6-20 06:33 , Processed in 0.009822 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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