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

Project1

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

[已经过期] 脚本中动画没显示完就继续执行指令了

[复制链接]

Lv4.逐梦者

梦石
0
星屑
7922
在线时间
956 小时
注册时间
2015-2-10
帖子
248
跳转到指定楼层
1
发表于 2016-10-7 16:56:59 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
这个脚本可以让敌方攻击我方时的动画显示,不过有个问题,就是一些比较长的动画,还没显示完就继续执行指令了,哪位大神能帮我把它改成动画要显示完才能继续执行指令?
  1. #==============================================================================
  2. # Mother3 Visuals
  3. # Author Ramiro
  4. # Version, 1.3
  5. #------------------------------------------------------------------------------
  6. # Shows Mother 3 visual, battle system.
  7. #==============================================================================

  8. $imported = {} if $imported.nil?
  9. $imported['Ramiro-Mother3Visual'] = true

  10. module BattleConfig

  11.   # tone of the window when dead and when the hp is below 1/4
  12.   Window_DeadTone      = Tone.new(200, 0, 0)
  13.   Window_CriticalTone  = Tone.new(200, 120, 10)
  14.   # Chech if the message window is always on the top of the screen.
  15.   AlwaysOnTop          = false
  16.   
  17.   # animations used on magic reflection and counterattack, set to 0 if you
  18.   # wish to disable
  19.   Reflex_AnimationID        = 0
  20.   Counterattack_AnimationID = 0

  21.   PanoramicCamera  = false
  22.   PanoramicCameraH = 160
  23.   
  24.   DisapearWhenNoSelection = false
  25.   
  26. end

  27. #==============================================================================
  28. # ?
  29. #==============================================================================
  30. class Scene_Base
  31.   
  32.   #--------------------------------------------------------------------------
  33.   # ?
  34.   #--------------------------------------------------------------------------   
  35.   attr_reader :info_viewport
  36.   
  37. end

  38. #==============================================================================
  39. # ?
  40. #==============================================================================
  41. module BattleManager
  42.   
  43.   #--------------------------------------------------------------------------
  44.   # ?
  45.   #--------------------------------------------------------------------------  
  46.   class << self
  47.     alias ramiro_m3_process_victory process_victory
  48.   end
  49.   
  50.   #--------------------------------------------------------------------------
  51.   # ?
  52.   #--------------------------------------------------------------------------
  53.   def self.phase
  54.     return @phase
  55.   end
  56.   
  57.   #--------------------------------------------------------------------------
  58.   # ?
  59.   #--------------------------------------------------------------------------
  60.   def self.process_victory  
  61.     SceneManager.scene.wait(1)
  62.     $game_party.members.each do |i|
  63.       i.sprite.battle_show if i.alive?
  64.     end
  65.     SceneManager.scene.wait(1)
  66.     ramiro_m3_process_victory
  67.   end
  68.   
  69. end

  70. #==============================================================================
  71. # ?Game_Message
  72. #==============================================================================

  73. class Game_Message
  74.   
  75.   alias ramiro_m3_position position
  76.   
  77.   def position
  78.     return 0 if BattleConfig::AlwaysOnTop && SceneManager.scene_is?(Scene_Battle)
  79.     ramiro_m3_position
  80.   end
  81.   
  82. end

  83. #==============================================================================
  84. # ?
  85. #==============================================================================
  86. class Window_BattleStatusPart < Window_Base
  87.   
  88.   #--------------------------------------------------------------------------
  89.   # ?
  90.   #--------------------------------------------------------------------------  
  91.   def initialize(actor_index)
  92.     @shake_time = 0
  93.     @actor_index = actor_index
  94.     @move_time = 0
  95.     @x_position = x_at(actor_index)
  96.     @x_destination = @x_position
  97.     @y_position = 20
  98.     @y_destination = 20
  99.     super(0, 0, window_width, window_height)
  100.     update_screen_position
  101.     refresh
  102.     hide_actor_quickly
  103.   end
  104.   
  105.   #--------------------------------------------------------------------------
  106.   # ?
  107.   #--------------------------------------------------------------------------   
  108.   def x_at(actor_index)
  109.     128 + (total_draw_area - window_width * window_count) / 2 + window_width * actor_index
  110.   end
  111.   
  112.   #--------------------------------------------------------------------------
  113.   # ?
  114.   #--------------------------------------------------------------------------
  115.   def update_tone
  116.     if actor.dead?
  117.       self.tone.set(BattleConfig::Window_DeadTone)
  118.     elsif actor.hp < actor.mhp / 4
  119.       self.tone.set(BattleConfig::Window_CriticalTone)
  120.     else
  121.       super
  122.     end
  123.   end   
  124.   
  125.   #--------------------------------------------------------------------------
  126.   # ?
  127.   #--------------------------------------------------------------------------  
  128.   def total_draw_area
  129.     Graphics.width - 128
  130.   end
  131.   
  132.   #--------------------------------------------------------------------------
  133.   # ?
  134.   #--------------------------------------------------------------------------  
  135.   def window_count
  136.     $game_party.members.size
  137.   end
  138.   
  139.   #--------------------------------------------------------------------------
  140.   # ?
  141.   #--------------------------------------------------------------------------  
  142.   def max_window_count
  143.     $game_party.max_battle_members
  144.   end  
  145.   
  146.   #--------------------------------------------------------------------------
  147.   # ?
  148.   #--------------------------------------------------------------------------
  149.   def window_width
  150.     total_draw_area / max_window_count
  151.   end
  152.   
  153.   #--------------------------------------------------------------------------
  154.   # ?
  155.   #--------------------------------------------------------------------------
  156.   def window_height
  157.     fitting_height(visible_line_number) - 20
  158.   end
  159.   
  160.   #--------------------------------------------------------------------------
  161.   # ?
  162.   #--------------------------------------------------------------------------  
  163.   def screen_x
  164.     @x_position
  165.   end
  166.   
  167.   #--------------------------------------------------------------------------
  168.   # ?
  169.   #--------------------------------------------------------------------------  
  170.   def screen_y
  171.     return @y_position
  172.   end
  173.   
  174.   #--------------------------------------------------------------------------
  175.   # ?
  176.   #--------------------------------------------------------------------------
  177.   def visible_line_number
  178.     return 4
  179.   end  
  180.   
  181.   #--------------------------------------------------------------------------
  182.   # ?
  183.   #--------------------------------------------------------------------------  
  184.   def update
  185.     super
  186.     if @move_time > 0
  187.       @x_position = (@x_position * (@move_time - 1) + @x_destination) / @move_time
  188.       @y_position = (@y_position * (@move_time - 1) + @y_destination) / @move_time
  189.       @move_time -= 1
  190.     end  
  191.     update_screen_position
  192.   end
  193.   
  194.   #--------------------------------------------------------------------------
  195.   # ?
  196.   #--------------------------------------------------------------------------   
  197.   def move_to_index(actor_index)
  198.     @x_destination = x_at(actor_index)
  199.     @move_time = 1
  200.   end
  201.   
  202.   #--------------------------------------------------------------------------
  203.   # ?
  204.   #--------------------------------------------------------------------------   
  205.   def return_to_origin
  206.     @x_destination = x_at(actor.index)
  207.     @y_destination = 20
  208.     @move_time = 1   
  209.   end
  210.   
  211.   #--------------------------------------------------------------------------
  212.   # ?
  213.   #--------------------------------------------------------------------------   
  214.   def move_down
  215.     @y_destination = self.height - line_height - standard_padding
  216.     @move_time = 1
  217.   end
  218.   
  219.   #--------------------------------------------------------------------------
  220.   # ?
  221.   #--------------------------------------------------------------------------   
  222.   def update_screen_position
  223.     self.x = screen_x + shake_amp
  224.     self.y = screen_y
  225.     self.z = self.y
  226.   end
  227.   
  228.   #--------------------------------------------------------------------------
  229.   # ?
  230.   #--------------------------------------------------------------------------     
  231.   def shake_amp
  232.     if @shake_time > 0
  233.       @shake_time -= 1
  234.       return @shake_time % 2 * 4 - 2
  235.     else
  236.       return 0
  237.     end  
  238.   end
  239.   
  240.   #--------------------------------------------------------------------------
  241.   # ?
  242.   #--------------------------------------------------------------------------  
  243.   def refresh
  244.     self.contents.clear
  245.     draw_actor_status if actor
  246.   end
  247.   
  248.   #--------------------------------------------------------------------------
  249.   # ?
  250.   #--------------------------------------------------------------------------
  251.   def line_color
  252.     color = normal_color
  253.     color.alpha = 48
  254.     color
  255.   end  
  256.   
  257.   #--------------------------------------------------------------------------
  258.   # ?
  259.   #--------------------------------------------------------------------------
  260.   def draw_horz_line(y)
  261.     line_y = y - 1
  262.     contents.fill_rect(0, line_y, contents_width - 24, 2, line_color)
  263.   end  
  264.   
  265.   #--------------------------------------------------------------------------
  266.   # ?
  267.   #--------------------------------------------------------------------------   
  268.   def draw_actor_status
  269.     self.contents.font.size = 16
  270.     draw_actor_name(actor, 0, 0, contents.width - 24)
  271.     draw_horz_line(line_height)
  272.     self.contents.font.size = 16
  273.     draw_actor_hp(actor, 2, line_height, contents.width - 4)
  274.     if $data_system.opt_display_tp
  275.       draw_actor_mp(actor, 2, line_height * 2, contents.width / 2 - 6)
  276.       draw_actor_tp(actor, 4 + contents.width / 2, line_height * 2, contents.width / 2 - 6)
  277.     else
  278.       draw_actor_mp(actor, 2, line_height * 2, contents.width - 4)
  279.     end  
  280.     draw_actor_icons(actor, contents.width - 24, 0, 24)
  281.   end
  282.   
  283.   #--------------------------------------------------------------------------
  284.   # ?
  285.   #--------------------------------------------------------------------------  
  286.   def show_actor
  287.     actor.sprite.battle_show
  288.   end
  289.   
  290.   #--------------------------------------------------------------------------
  291.   # ?
  292.   #--------------------------------------------------------------------------  
  293.   def hide_actor
  294.     actor.sprite.battle_hide
  295.   end
  296.   #--------------------------------------------------------------------------
  297.   # ?
  298.   #--------------------------------------------------------------------------   
  299.   def hide_actor_quickly
  300.     actor.sprite.opacity = 0
  301.   end  
  302.   #--------------------------------------------------------------------------
  303.   # ?
  304.   #--------------------------------------------------------------------------  
  305.   def index
  306.     @actor_index
  307.   end
  308.   
  309.   #--------------------------------------------------------------------------
  310.   # ?
  311.   #--------------------------------------------------------------------------  
  312.   def actor
  313.     $game_party.members[@actor_index]
  314.   end
  315.   
  316.   #--------------------------------------------------------------------------
  317.   # ?
  318.   #--------------------------------------------------------------------------  
  319.   def shake
  320.     @shake_time = 20
  321.   end
  322.   
  323. end

  324. #==============================================================================
  325. # ?
  326. #==============================================================================
  327. class Window_BattleStatusPatner < Window_BattleStatusPart
  328.   
  329.   #--------------------------------------------------------------------------
  330.   # ?
  331.   #--------------------------------------------------------------------------   
  332.   attr_accessor :actor_index
  333.   
  334.   #--------------------------------------------------------------------------
  335.   # ?
  336.   #--------------------------------------------------------------------------
  337.   def window_width
  338.     128
  339.   end  
  340.   
  341.   #--------------------------------------------------------------------------
  342.   # ?
  343.   #--------------------------------------------------------------------------   
  344.   def screen_x
  345.     0
  346.   end
  347.   
  348.   #--------------------------------------------------------------------------
  349.   # ?
  350.   #--------------------------------------------------------------------------   
  351.   def show
  352.     return if $imported["YEA-BattleEngine"]
  353.     super
  354.   end
  355.   
  356.   #--------------------------------------------------------------------------
  357.   # ?
  358.   #--------------------------------------------------------------------------   
  359.   def screen_y
  360.     Graphics.height - window_height - 20
  361.   end  
  362.   
  363. end

  364. #==============================================================================
  365. # ?Window_BattleStatus
  366. #==============================================================================
  367. class Window_BattleStatusMultiple < Window_BattleStatus
  368.   
  369.   #--------------------------------------------------------------------------
  370.   # ?
  371.   #--------------------------------------------------------------------------   
  372.   attr_accessor :viewport
  373.   attr_accessor :wait_method
  374.   
  375.   #--------------------------------------------------------------------------
  376.   # ?
  377.   #--------------------------------------------------------------------------  
  378.   def initialize
  379.     super
  380.     @status_windows = []
  381.     @viewport = nil
  382.     @wait_method = 1
  383.     self.visible = false
  384.     self.windowskin = Cache.system('')
  385.     @index = -1
  386.   end
  387.   
  388.   #--------------------------------------------------------------------------
  389.   # ? ??????????
  390.   #--------------------------------------------------------------------------
  391.   def create_contents
  392.     self.contents.dispose if self.contents && !self.contents.disposed?
  393.     self.contents = Bitmap.new(1, 1)
  394.   end  
  395.   #--------------------------------------------------------------------------
  396.   # ? ??????????
  397.   #--------------------------------------------------------------------------  
  398.   def draw_item(index)
  399.     return if index.nil?
  400.     return unless $game_party.members[index]
  401.     @status_windows = [] unless @status_windows
  402.     return unless @status_windows[index]
  403.     @status_windows[index].refresh
  404.   end  
  405.   #--------------------------------------------------------------------------
  406.   # ?
  407.   #--------------------------------------------------------------------------  
  408.   def window_width
  409.     Graphics.width - 128
  410.   end
  411.   
  412.   #--------------------------------------------------------------------------
  413.   # ?
  414.   #--------------------------------------------------------------------------
  415.   def window_height
  416.     fitting_height(visible_line_number)
  417.   end
  418.   
  419.   #--------------------------------------------------------------------------
  420.   # ?
  421.   #--------------------------------------------------------------------------
  422.   def visible_line_number
  423.     return 4
  424.   end   
  425.   
  426.   #--------------------------------------------------------------------------
  427.   # ?
  428.   #--------------------------------------------------------------------------  
  429.   def refresh
  430.         @status_windows = [] if !@status_windows
  431.     @status_windows.each do |i|
  432.       i.refresh
  433.     end  
  434.   end
  435.   
  436.   #--------------------------------------------------------------------------
  437.   # ?
  438.   #--------------------------------------------------------------------------  
  439.   def update
  440.     super
  441.         @status_windows = [] if !@status_windows
  442.     need_wait = false
  443.     self.visible = false
  444.     $game_party.members.each do |actor|
  445.       if !@status_windows.any? { |i| i.index == actor.index}
  446.         window = Window_BattleStatusPart.new(actor.index)
  447.         window.viewport = self.viewport
  448.         @status_windows << window
  449.         actor.sprite.update
  450.         window.x = window.screen_x
  451.         window.update
  452.         window.viewport.update
  453.         window.update
  454.         need_wait = false
  455.       end  
  456.     end  
  457.     @status_windows.each do |i|
  458.       if $game_party.members.include?(i.actor)
  459.         i.update
  460.         i.viewport = self.viewport
  461.       else
  462.         @status_windows.delete(i)
  463.         i.dispose
  464.       end  
  465.     end
  466.     SceneManager.scene.wait(1) if need_wait
  467.   end
  468.   
  469.   #--------------------------------------------------------------------------
  470.   # ?
  471.   #--------------------------------------------------------------------------  
  472.   def dispose
  473.     super
  474.     @status_windows = [] if !@status_windows
  475.     @status_windows.each do |i|
  476.       i.dispose
  477.     end   
  478.   end
  479.   
  480.   #--------------------------------------------------------------------------
  481.   # ?
  482.   #--------------------------------------------------------------------------   
  483.   def show_actor(index)
  484.     @status_windows = [] if !@status_windows
  485.     @status_windows.sort! { |a, b| a.index <=> b.index}
  486.     @status_windows[index].show_actor if index >= 0 && @status_windows[index]
  487.   end
  488.   
  489.   #--------------------------------------------------------------------------
  490.   # ?
  491.   #--------------------------------------------------------------------------   
  492.   def hide_actor(index)
  493.     @status_windows = [] if !@status_windows
  494.     @status_windows.sort! { |a, b| a.index <=> b.index}
  495.     @status_windows[index].hide_actor if index >= 0 && @status_windows[index]
  496.   end
  497.   
  498.   #--------------------------------------------------------------------------
  499.   # ?
  500.   #--------------------------------------------------------------------------   
  501.   def select(index=0)
  502.     hide_actor(@index) if index > @index || BattleConfig::DisapearWhenNoSelection
  503.     wait_show
  504.     @index = index
  505.     show_actor(@index)
  506.     wait_show
  507.   end
  508.   #--------------------------------------------------------------------------
  509.   # ?
  510.   #--------------------------------------------------------------------------
  511.   def wait_show
  512.     return unless @wait_method
  513.     @wait_method.call(1)
  514.   end
  515.   
  516.   #--------------------------------------------------------------------------
  517.   # ?
  518.   #--------------------------------------------------------------------------   
  519.   def unselect
  520.     #hide_actor(@index)
  521.     @index = -1
  522.   end
  523.   
  524.   #--------------------------------------------------------------------------
  525.   # ?
  526.   #--------------------------------------------------------------------------  
  527.   def shake_window(index)
  528.         @status_windows = [] if !@status_windows
  529.     @status_windows.sort! { |a, b| a.index <=> b.index}
  530.     @status_windows[index].shake
  531.   end
  532.   
  533.   #--------------------------------------------------------------------------
  534.   # ?
  535.   #--------------------------------------------------------------------------  
  536.   def window_at(index)
  537.         @status_windows = [] if !@status_windows
  538.     @status_windows.sort! { |a, b| a.index <=> b.index}
  539.     @status_windows[index]
  540.   end
  541.   
  542.   #--------------------------------------------------------------------------
  543.   # ?
  544.   #--------------------------------------------------------------------------   
  545.   def show
  546.         @status_windows = [] if !@status_windows
  547.     @status_windows.each do |i|
  548.       i.show
  549.     end
  550.     super
  551.   end
  552.   
  553.   #--------------------------------------------------------------------------
  554.   # ?
  555.   #--------------------------------------------------------------------------   
  556.   def hide
  557.         @status_windows = [] if !@status_windows
  558.     @status_windows.each do |i|
  559.       i.hide
  560.     end
  561.     super
  562.   end  
  563.   
  564.   #--------------------------------------------------------------------------
  565.   # ?
  566.   #--------------------------------------------------------------------------   
  567.   def make_window_return(index)
  568.         @status_windows = [] if !@status_windows
  569.     @status_windows.sort! { |a, b| a.index <=> b.index}
  570.     @status_windows[index].return_to_origin
  571.   end
  572.   
  573.   #--------------------------------------------------------------------------
  574.   # ?
  575.   #--------------------------------------------------------------------------   
  576.   def substitute(target_index, substitute_index)  
  577.         @status_windows = [] if !@status_windows
  578.     @status_windows[substitute_index].move_to_index(target_index)
  579.     @status_windows[target_index].move_down
  580.   end  
  581.   
  582. end

  583. #==============================================================================
  584. # ?
  585. #==============================================================================
  586. class Game_Enemy < Game_Battler
  587.   
  588.   #--------------------------------------------------------------------------
  589.   # ?
  590.   #--------------------------------------------------------------------------  
  591.   def sprite
  592.     SceneManager.scene.spriteset.enemy_sprites.reverse[self.index]
  593.   end  
  594.   
  595.   #--------------------------------------------------------------------------
  596.   # ?
  597.   #--------------------------------------------------------------------------  
  598.   def atk_animation_id1
  599.     return self.enemy.note[/<ATK ANI 1 ID:(\d+)>/mi] ? $1.to_i : 1
  600.   end
  601.   
  602.   #--------------------------------------------------------------------------
  603.   # ?
  604.   #--------------------------------------------------------------------------  
  605.   def atk_animation_id2
  606.     return self.enemy.note[/<ATK ANI 2 ID:(\d+)>/mi] ? $1.to_i : 0
  607.   end  
  608.   
  609.   def no_panoramic
  610.     return self.enemy.note[/<NO PANORAMIC>/mi] ? true : false
  611.   end
  612.   
  613. end

  614. #==============================================================================
  615. # ?
  616. #==============================================================================
  617. class Game_Actor < Game_Battler
  618.   
  619.   #--------------------------------------------------------------------------
  620.   # ?
  621.   #--------------------------------------------------------------------------   
  622.   alias ramiro_m3_setup setup
  623.   
  624.   #--------------------------------------------------------------------------
  625.   # ?
  626.   #--------------------------------------------------------------------------   
  627.   attr_accessor :extra_y
  628.   
  629.   #--------------------------------------------------------------------------
  630.   # ?
  631.   #--------------------------------------------------------------------------   
  632.   def setup(actor_id)
  633.     ramiro_m3_setup(actor_id)
  634.     @extra_y = 0
  635.   end
  636.   
  637.   #--------------------------------------------------------------------------
  638.   # ?
  639.   #--------------------------------------------------------------------------  
  640.   def use_sprite?
  641.     return true
  642.   end
  643.   
  644.   #--------------------------------------------------------------------------
  645.   # ?
  646.   #--------------------------------------------------------------------------  
  647.   def sprite
  648.     return if !SceneManager.scene
  649.     SceneManager.scene.spriteset.actor_sprites[self.index]
  650.   end
  651.   
  652.   #--------------------------------------------------------------------------
  653.   # ?
  654.   #--------------------------------------------------------------------------   
  655.   def status_window
  656.     return nil if !SceneManager.scene_is?(Scene_Battle)
  657.     return nil if !SceneManager.scene.status_window
  658.     SceneManager.scene.status_window.window_at(self.index)
  659.   end
  660.   
  661.   #--------------------------------------------------------------------------
  662.   # ?
  663.   #--------------------------------------------------------------------------   
  664.   def screen_y
  665.     return Graphics.height - 100# + @extra_y
  666.   end
  667.   
  668.   #--------------------------------------------------------------------------
  669.   # ?
  670.   #--------------------------------------------------------------------------   
  671.   def screen_x
  672.     return 0 if !self.index   
  673.     return -1000 if !SceneManager.scene
  674.     return -1000 if !status_window
  675.     sw = status_window
  676.     sw.screen_x + sw.width / 2 - sw.viewport.ox + sw.viewport.rect.x
  677.   end
  678.   
  679.   #--------------------------------------------------------------------------
  680.   # ?
  681.   #--------------------------------------------------------------------------   
  682.   def screen_z
  683.     return -1000 if !self.index   
  684.     return -1000 if !SceneManager.scene   
  685.     100
  686.   end  
  687.   
  688. end

  689. #==============================================================================
  690. # ?
  691. #==============================================================================
  692. class Sprite_Battler < Sprite_Base
  693.   
  694.   FRONTAL = false
  695.   
  696.   #--------------------------------------------------------------------------
  697.   # ?
  698.   #--------------------------------------------------------------------------  
  699.   alias ramiro_m3_initialize initialize
  700.   alias ramiro_m3_start_effect start_effect
  701.   alias ramiro_m3_update_effect update_effect
  702.   alias ramiro_m3_setup_new_animation setup_new_animation
  703.   #--------------------------------------------------------------------------
  704.   # ?
  705.   #--------------------------------------------------------------------------   
  706.   def initialize(viewport, battler=nil)
  707.     ramiro_m3_initialize(viewport, battler)
  708.     if battler && battler.actor?
  709.       self.visible = false
  710.       self.opacity = 0
  711.     end
  712.   end
  713.   #--------------------------------------------------------------------------
  714.   # ?
  715.   #--------------------------------------------------------------------------  
  716.   def battle_show
  717.     return if ![url=home.php?mod=space&uid=133701]@battler[/url] || @battler.enemy?
  718.     start_effect(:go_up)
  719.   end
  720.   
  721.   #--------------------------------------------------------------------------
  722.   # ?
  723.   #--------------------------------------------------------------------------  
  724.   def battle_hide
  725.     return if !@battler || @battler.enemy?
  726.     start_effect(:go_down)   
  727.   end
  728.   
  729.   #--------------------------------------------------------------------------
  730.   # ?
  731.   #--------------------------------------------------------------------------  
  732.   def start_effect(effect_type)
  733.     @effect_type = effect_type   
  734.     case effect_type
  735.     when :go_up
  736.       revert_to_normal
  737.       @effect_duration = 5
  738.     when :go_down
  739.       revert_to_normal
  740.       @effect_duration = 5
  741.     else  
  742.       ramiro_m3_start_effect(effect_type)
  743.     end  
  744.   end
  745.   
  746.   #--------------------------------------------------------------------------
  747.   # ?
  748.   #--------------------------------------------------------------------------
  749.   def update_effect
  750.     if @effect_duration > 0
  751.       @effect_duration -= 1
  752.       case @effect_type
  753.       when :go_up
  754.         update_go_up_effect
  755.       when :go_down
  756.         update_go_down_effect
  757.       end  
  758.       @effect_duration += 1
  759.     end  
  760.     ramiro_m3_update_effect
  761.   end
  762.    
  763.   #--------------------------------------------------------------------------
  764.   # ?
  765.   #--------------------------------------------------------------------------  
  766.   def update_go_up_effect
  767.     self.opacity = (self.opacity * @effect_duration + 255 ) / (@effect_duration + 1)
  768. #    @battler.extra_y = (@battler.extra_y * @effect_duration) / (@effect_duration + 1)
  769.     self.visible = (self.opacity > 50)
  770.   end
  771.   
  772.   #--------------------------------------------------------------------------
  773.   # ?
  774.   #--------------------------------------------------------------------------  
  775.   def update_go_down_effect
  776.     self.opacity = (self.opacity * @effect_duration) / (@effect_duration + 1)
  777. #    @battler.extra_y = (@battler.extra_y * @effect_duration + 60) / (@effect_duration + 1)   
  778.     self.visible = (self.opacity > 50)
  779.   end
  780.   
  781.   #--------------------------------------------------------------------------
  782.   # ?
  783.   #--------------------------------------------------------------------------
  784.   def update_bitmap
  785.     if @battler.enemy?
  786.       new_bitmap = Cache.battler(@battler.battler_name, @battler.battler_hue)
  787.     else
  788.       new_bitmap = Cache.character(@battler.character_name)
  789.     end  
  790.     if bitmap != new_bitmap
  791.       self.bitmap = new_bitmap
  792.       init_visibility
  793.       update_rect if self.bitmap && @battler.actor?
  794.     end
  795.     self.opacity = 0 if @battler.actor? && @battler.extra_y == 60
  796.   end  
  797.   
  798.   #--------------------------------------------------------------------------
  799.   # ?
  800.   #--------------------------------------------------------------------------
  801.   def update_blink
  802.    
  803.   end  
  804.   
  805.   #--------------------------------------------------------------------------
  806.   # * Initialize Visibility
  807.   #--------------------------------------------------------------------------
  808.   def init_visibility
  809.     return @battler_visible = true if @battler.actor?
  810.     @battler_visible = @battler.alive?
  811.     self.opacity = 0 unless @battler_visible
  812.   end  
  813.   
  814.   #--------------------------------------------------------------------------
  815.   # ?
  816.   #--------------------------------------------------------------------------
  817.   def setup_new_effect
  818.     if !@battler_visible && @battler.alive? && @battler.enemy?
  819.       start_effect(:appear)
  820.     elsif @battler_visible && @battler.hidden? && @battler.enemy?
  821.       start_effect(:disappear)
  822.     elsif @battler.alive? && @was_dead
  823.       @was_dead = false
  824.       start_effect(:appear)
  825.     end
  826.     if @battler_visible && @battler.sprite_effect_type
  827.       start_effect(@battler.sprite_effect_type)
  828.       @battler.sprite_effect_type = nil
  829.     end
  830.     setup_popups if $imported["YEA-BattleEngine"]
  831.   end  
  832.   
  833.   #--------------------------------------------------------------------------
  834.   # ?
  835.   #--------------------------------------------------------------------------
  836.   def revert_to_normal
  837.     self.blend_type = 0
  838.     self.color.set(0, 0, 0, 0)
  839.     self.opacity = 255
  840.     self.ox = bitmap.width / 2 if bitmap
  841.     if @battler.enemy?
  842.       self.src_rect.y = 0
  843.     else  
  844.       update_rect
  845.     end  
  846.   end  
  847.   
  848.   alias ramiro_m3_revert_to_normal revert_to_normal
  849.   
  850.   #--------------------------------------------------------------------------
  851.   # * Revert to Normal Settings
  852.   #--------------------------------------------------------------------------
  853.   def revert_to_normal
  854.     ramiro_m3_revert_to_normal
  855.     if self.battler.actor?
  856.       update_rect
  857.       update_origin
  858.     end
  859.   end  
  860.   
  861.   #--------------------------------------------------------------------------
  862.   # ?
  863.   #--------------------------------------------------------------------------  
  864.   def update_rect
  865.     sign = @battler.character_name[/^[\!\$]./]
  866.     if sign && sign.include?('


  867. )
  868.       i = 0
  869.       j = 0
  870.       w = self.bitmap.width / 3
  871.       h = self.bitmap.height / 4
  872.     else
  873.       i = @battler.character_index % 4
  874.       j = @battler.character_index / 4
  875.       w = self.bitmap.width / 12
  876.       h = self.bitmap.height / 8      
  877.     end
  878.     k = FRONTAL ? 3 : 0
  879.     self.src_rect.set(w + i * w * 3, j * h * 4 + k, w, h * 3 / 4)
  880.   end
  881.   
  882.   #--------------------------------------------------------------------------
  883.   # ?
  884.   #--------------------------------------------------------------------------
  885.   def update_origin
  886.     if bitmap
  887.       self.ox = self.width / 2
  888.       self.oy = self.height
  889.     end
  890.   end  
  891.   
  892.   #--------------------------------------------------------------------------
  893.   # ?
  894.   #--------------------------------------------------------------------------
  895.   def animation_set_sprites(frame)
  896.     cell_data = frame.cell_data
  897.     @ani_sprites.each_with_index do |sprite, i|
  898.       next unless sprite
  899.       pattern = cell_data[i, 0]
  900.       if !pattern || pattern < 0
  901.         sprite.visible = false
  902.         next
  903.       end
  904.       sprite.bitmap = pattern < 100 ? @ani_bitmap1 : @ani_bitmap2
  905.       sprite.visible = true
  906.       sprite.src_rect.set(pattern % 5 * 192,
  907.         pattern % 100 / 5 * 192, 192, 192)
  908.       if @ani_mirror
  909.         sprite.x = @ani_ox - cell_data[i, 1]
  910.         sprite.y = @ani_oy + cell_data[i, 2]
  911.         sprite.angle = (360 - cell_data[i, 4])
  912.         sprite.mirror = (cell_data[i, 5] == 0)
  913.       else
  914.         sprite.x = @ani_ox + cell_data[i, 1]
  915.         sprite.y = @ani_oy + cell_data[i, 2]
  916.         sprite.angle = cell_data[i, 4]
  917.         sprite.mirror = (cell_data[i, 5] == 1)
  918.       end
  919.       sprite.z = self.z + 300 + i
  920.       sprite.ox = 96
  921.       sprite.oy = 96
  922.       sprite.zoom_x = cell_data[i, 3] / 100.0
  923.       sprite.zoom_y = cell_data[i, 3] / 100.0
  924.       sprite.opacity = cell_data[i, 6]
  925.       sprite.blend_type = cell_data[i, 7]
  926.     end
  927.   end  
  928.   
  929.   #--------------------------------------------------------------------------
  930.   # ?
  931.   #--------------------------------------------------------------------------
  932.   def setup_new_animation
  933.     return if @battler.actor?
  934.     ramiro_m3_setup_new_animation
  935.   end  
  936.   
  937.   alias ramiro_m3_update update
  938.   
  939.   def update
  940.     ramiro_m3_update
  941.     return unless BattleConfig::PanoramicCamera
  942.     return unless self.battler
  943.     return if self.battler.enemy? && self.battler.no_panoramic
  944.      self.zoom_x = self.zoom_y = ((self.y - BattleConfig::PanoramicCameraH * 130 / 100) * 0.005 + 1.0) if self.battler.enemy?
  945.   end
  946.   
  947. end

  948. #==============================================================================
  949. # ?
  950. #==============================================================================
  951. class Spriteset_Battle
  952.   
  953.   #--------------------------------------------------------------------------
  954.   # ?
  955.   #--------------------------------------------------------------------------
  956.   alias ramiro_m3_create_viewports create_viewports
  957.   alias ramiro_m3_update_viewports update_viewports
  958.   alias ramiro_m3_dispose_viewports dispose_viewports
  959.   alias ramiro_m3_create_actors create_actors
  960.   alias ramiro_m3_dispose_actors dispose_actors
  961.   alias ramiro_m3_update_actors update_actors
  962.   
  963.   #--------------------------------------------------------------------------
  964.   # ?
  965.   #--------------------------------------------------------------------------   
  966.   attr_reader :actor_sprites
  967.   attr_reader :enemy_sprites
  968.   
  969.   #--------------------------------------------------------------------------
  970.   # ?
  971.   #--------------------------------------------------------------------------
  972.   def create_viewports
  973.     @viewport4 = Viewport.new
  974.     @viewport4.z = 200
  975.     ramiro_m3_create_viewports
  976.     @viewportPopups.z = 500 if @viewportPopups
  977.   end  
  978.   
  979.   #--------------------------------------------------------------------------
  980.   # ?
  981.   #--------------------------------------------------------------------------  
  982.   def update_viewports
  983.     ramiro_m3_update_viewports
  984.     @viewport4.update
  985.   end
  986.   
  987.   #--------------------------------------------------------------------------
  988.   # ?
  989.   #--------------------------------------------------------------------------  
  990.   def dispose_viewports
  991.     ramiro_m3_dispose_viewports
  992.     @viewport4.dispose
  993.   end
  994.   
  995.   #--------------------------------------------------------------------------
  996.   # ?
  997.   #--------------------------------------------------------------------------  
  998.   def create_actors
  999.     ramiro_m3_create_actors
  1000.     @actor_animation = Array.new(4) {Sprite_ActorAnimation.new(@viewport4)}
  1001.   end  
  1002.   
  1003.   #--------------------------------------------------------------------------
  1004.   # ?
  1005.   #--------------------------------------------------------------------------
  1006.   def dispose_actors
  1007.     ramiro_m3_dispose_actors
  1008.     @actor_animation.each do |i|
  1009.       i.dispose
  1010.     end  
  1011.   end
  1012.   
  1013.   #--------------------------------------------------------------------------
  1014.   # ?
  1015.   #--------------------------------------------------------------------------
  1016.   def update_actors
  1017.     ramiro_m3_update_actors
  1018.      @actor_animation.each_with_index do |sprite, i|
  1019.       sprite.update
  1020.       sprite.actor = $game_party.members[i]
  1021.     end   
  1022.   end  
  1023.   
  1024. end

  1025. #==============================================================================
  1026. # ?
  1027. #==============================================================================
  1028. class Sprite_ActorAnimation < Sprite_Base
  1029.   
  1030.   #--------------------------------------------------------------------------
  1031.   # ?
  1032.   #--------------------------------------------------------------------------  
  1033.   attr_accessor :actor
  1034.   
  1035.   #--------------------------------------------------------------------------
  1036.   # ?
  1037.   #--------------------------------------------------------------------------  
  1038.   def initialize(viewport, actor=nil)
  1039.     super(viewport)
  1040.     @actor = actor
  1041.   end
  1042.   
  1043.   #--------------------------------------------------------------------------
  1044.   # ?
  1045.   #--------------------------------------------------------------------------  
  1046.   def update
  1047.     super
  1048.     return unless @actor
  1049.     if @actor.animation_id != 0
  1050.       animation = $data_animations[@actor.animation_id]
  1051.       mirror = @actor.animation_mirror
  1052.       start_animation(animation, mirror)      
  1053.       @actor.animation_id = 0
  1054.     end  
  1055.     self.x = @actor.screen_x
  1056.     self.y = @actor.screen_y
  1057.   end
  1058.   
  1059. end

  1060. #==============================================================================
  1061. # ?
  1062. #==============================================================================
  1063. class Scene_Battle < Scene_Base
  1064.   
  1065.   #--------------------------------------------------------------------------
  1066.   # ?
  1067.   #--------------------------------------------------------------------------   
  1068.   alias ramiro_m3_next_command next_command
  1069.   alias ramiro_m3_prior_command prior_command
  1070.   alias ramiro_m3_apply_item_effects apply_item_effects
  1071.   alias ramiro_m3_create_all_windows create_all_windows
  1072.   alias ramiro_m3_on_actor_ok on_actor_ok
  1073.   alias ramiro_m3_on_actor_cancel on_actor_cancel
  1074.   alias ramiro_m3_select_actor_selection select_actor_selection  
  1075.   alias ramiro_m3_invoke_item invoke_item
  1076.   alias ramiro_m3_apply_substitute apply_substitute
  1077.   alias ramiro_m3_invoke_counter_attack invoke_counter_attack
  1078.   alias ramiro_m3_invoke_magic_reflection invoke_magic_reflection
  1079.   #--------------------------------------------------------------------------
  1080.   # ?
  1081.   #--------------------------------------------------------------------------   
  1082.   attr_reader :spriteset
  1083.   attr_reader :status_window
  1084.   
  1085.   #--------------------------------------------------------------------------
  1086.   # ?
  1087.   #--------------------------------------------------------------------------  
  1088.   def apply_item_effects(target, item)
  1089.     @status_window.shake_window(target.index) if target.actor? && !item.damage.none? && !item.damage.recover?
  1090.     ramiro_m3_apply_item_effects(target, item)
  1091.   end
  1092.   
  1093.   #--------------------------------------------------------------------------
  1094.   # ?
  1095.   #--------------------------------------------------------------------------
  1096.   def create_status_window
  1097.     @status_window = Window_BattleStatusMultiple.new
  1098.     @status_window.wait_method = method( :wait )
  1099.   end
  1100.   
  1101.   #--------------------------------------------------------------------------
  1102.   # ?
  1103.   #--------------------------------------------------------------------------
  1104.   def show_attack_animation(targets)
  1105.     show_normal_animation(targets, @subject.atk_animation_id1, false)
  1106.     show_normal_animation(targets, @subject.atk_animation_id2, true)
  1107.   end  
  1108.   
  1109.   #--------------------------------------------------------------------------
  1110.   # ?
  1111.   #--------------------------------------------------------------------------
  1112.   def next_command
  1113.     ramiro_m3_next_command
  1114.   end
  1115.   
  1116.   #--------------------------------------------------------------------------
  1117.   # ?
  1118.   #--------------------------------------------------------------------------
  1119.   def prior_command
  1120.     ramiro_m3_prior_command
  1121.   end

  1122.   #--------------------------------------------------------------------------
  1123.   # ?
  1124.   #--------------------------------------------------------------------------  
  1125.   def create_all_windows
  1126.     ramiro_m3_create_all_windows
  1127.     create_actor_selection_partner_window
  1128.   end
  1129.   
  1130.   #--------------------------------------------------------------------------
  1131.   # ?
  1132.   #--------------------------------------------------------------------------  
  1133.   def create_actor_selection_partner_window
  1134.     @actor_selection_patner = Window_BattleStatusPatner.new(0)
  1135.     @actor_selection_patner.z = 9999
  1136.     @actor_selection_patner.hide
  1137.   end
  1138.   
  1139.   #--------------------------------------------------------------------------
  1140.   # ?
  1141.   #--------------------------------------------------------------------------  
  1142.   def set_patner_info(index)
  1143.     @actor_selection_patner.actor_index = index
  1144.     @actor_selection_patner.refresh
  1145.     @actor_selection_patner.show
  1146.   end
  1147.   
  1148.   #--------------------------------------------------------------------------
  1149.   # ?
  1150.   #--------------------------------------------------------------------------
  1151.   def execute_action
  1152.     @subject.sprite.battle_show if @subject.actor?
  1153.     @invoked_targets = [@subject]
  1154.     wait(1)
  1155.     use_item
  1156.     @log_window.wait_and_clear
  1157.     unless $game_troop.all_dead?
  1158.       @invoked_targets.each do |actor|
  1159.         next unless actor.actor? && actor.exist?
  1160.         actor.sprite.battle_hide
  1161.       end
  1162.     end  
  1163.     wait(1)
  1164.   end   
  1165.   
  1166.   #--------------------------------------------------------------------------
  1167.   # ?
  1168.   #--------------------------------------------------------------------------  
  1169.   def on_actor_ok
  1170.     @actor_selection_patner.hide
  1171.     ramiro_m3_on_actor_ok
  1172.   end
  1173.   
  1174.   #--------------------------------------------------------------------------
  1175.   # ?
  1176.   #--------------------------------------------------------------------------  
  1177.   def on_actor_cancel
  1178.     @actor_selection_patner.hide
  1179.     ramiro_m3_on_actor_cancel
  1180.   end
  1181.   
  1182.   #--------------------------------------------------------------------------
  1183.   # ?
  1184.   #--------------------------------------------------------------------------  
  1185.   def select_actor_selection
  1186.     set_patner_info(BattleManager.actor.index)
  1187.     ramiro_m3_select_actor_selection
  1188.   end
  1189.   
  1190.   #--------------------------------------------------------------------------
  1191.   # ?
  1192.   #--------------------------------------------------------------------------   
  1193.   def invoke_item(target, item)
  1194.     ramiro_m3_invoke_item(target, item)
  1195.     wait(1)
  1196.     $game_party.members.each do |actor|
  1197.       @status_window.make_window_return(actor.index)
  1198.     end
  1199.     wait(1)     
  1200.   end
  1201.   
  1202.   #--------------------------------------------------------------------------
  1203.   # ?
  1204.   #--------------------------------------------------------------------------  
  1205.   def invoke_counter_attack(target, item)
  1206.     @invoked_targets.push << target   
  1207.     target.sprite.battle_show if target.actor?
  1208.     target.animation_id = BattleConfig::Counterattack_AnimationID   
  1209.     ramiro_m3_invoke_counter_attack(target, item)
  1210.   end
  1211.   
  1212.   #--------------------------------------------------------------------------
  1213.   # ?
  1214.   #--------------------------------------------------------------------------
  1215.   def invoke_magic_reflection(target, item)  
  1216.     @invoked_targets.push << target   
  1217.     target.sprite.battle_show if target.actor?
  1218.     target.animation_id = BattleConfig::Reflex_AnimationID
  1219.     ramiro_m3_invoke_magic_reflection(target, item)  
  1220.   end
  1221.   
  1222.   #--------------------------------------------------------------------------
  1223.   # ?
  1224.   #--------------------------------------------------------------------------
  1225.   def apply_substitute(target, item)
  1226.     new_target = ramiro_m3_apply_substitute(target, item)
  1227.     if new_target != target && target.actor? && new_target.actor?
  1228.       @status_window.substitute(target.index, new_target.index)
  1229.       wait(1)
  1230.     end
  1231.     new_target
  1232.   end  
  1233.   
  1234.   alias ramiro_m3_start_party_command_selection start_party_command_selection
  1235.   
  1236.   def start_party_command_selection
  1237.     for battler in $game_party.members
  1238.       battler.sprite_effect_type = $game_troop.turn_count > 0 ? :go_up : :appear
  1239.     end  
  1240.     wait(1)
  1241.     ramiro_m3_start_party_command_selection
  1242.   end  
  1243.   
  1244.   alias ramiro_m3_command_escape command_escape
  1245.   
  1246.   def command_escape
  1247.     for battler in $game_party.members
  1248.       battler.sprite_effect_type = :go_down
  1249.     end  
  1250.     wait(1)
  1251.     ramiro_m3_command_escape
  1252.   end   
  1253.   
  1254.   alias ramiro_m3_turn_start turn_start
  1255.   
  1256.   def turn_start
  1257.     wait(1)
  1258.     @info_viewport.ox = 0
  1259.     for battler in $game_party.members
  1260.       battler.status_window.viewport = @info_viewport if battler.status_window
  1261.       battler.sprite_effect_type = :go_down
  1262.     end  
  1263.     wait(1)
  1264.     ramiro_m3_turn_start
  1265.   end     
  1266.   
  1267. end
复制代码



Lv4.逐梦者

梦石
0
星屑
7922
在线时间
956 小时
注册时间
2015-2-10
帖子
248
2
 楼主| 发表于 2016-10-15 18:53:53 | 只看该作者
不会吧,没法解决吗?

评分

参与人数 1星屑 -5 收起 理由
丿梁丶小柒 -5 纯水

查看全部评分

回复 支持 反对

使用道具 举报

Lv5.捕梦者 (暗夜天使)

梦石
1
星屑
20950
在线时间
4886 小时
注册时间
2014-12-22
帖子
1527

开拓者

3
发表于 2016-10-15 21:39:57 | 只看该作者
不知道你这个脚本具体情况,也不知道你是否用的原版的战斗系统还是别的系统,不过也许可以换个别的脚本看看?
比如这里有个帖子:
如何让敌人使用技能时显示动画?
https://rpg.blue/forum.php?mod=viewthread&tid=377663
你可以试试看这个~

评分

参与人数 1星屑 +50 收起 理由
丿梁丶小柒 + 50 我很赞同

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-14 04:13

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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