查看: 2326|回复: 5

[已经过期] 新人请教NoMethodError怎么解决啊啊啊啊!

[复制链接]
梦石
0
星屑
289
在线时间
28 小时
注册时间
2020-4-6
回帖
6
发表于 2020-7-4 14:27:55 | 显示全部楼层 |阅读模式

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

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

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

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

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

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

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

R考场第七期纪念奖

发表于 2020-7-4 15:53:35 | 显示全部楼层
草
看不见行数啊。。
回复

使用道具 举报

头像被屏蔽
梦石
0
星屑
5706
在线时间
922 小时
注册时间
2013-8-29
回帖
1401
发表于 2020-7-4 15:58:09 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

梦石
0
星屑
289
在线时间
28 小时
注册时间
2020-4-6
回帖
6
 楼主| 发表于 2020-7-4 16:30:26 | 显示全部楼层
chanszeman1018 发表于 2020-7-4 15:58
看到又如何??
#--------------------------------------------------------------------------
  # ?

大佬有办法解决吗_(:з」∠)_
回复

使用道具 举报

头像被屏蔽
梦石
0
星屑
5706
在线时间
922 小时
注册时间
2013-8-29
回帖
1401
发表于 2020-7-4 16:39:43 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

梦石
0
星屑
289
在线时间
28 小时
注册时间
2020-4-6
回帖
6
 楼主| 发表于 2020-7-4 18:52:01 | 显示全部楼层
惊了,居然可以了,不过另一个脚本到处错了
  1. #==============================================================================
  2. # Mother3 Add-ON (HP scrolling)
  3. # Author Ramiro
  4. # Version, 1.1
  5. #------------------------------------------------------------------------------
  6. # Performs a similar effect like Mother series.
  7. #==============================================================================
  8. $imported = {} if $imported.nil?
  9. $imported['Ramiro-M3-HPScroll'] = true
  10. #==============================================================================
  11. # |
  12. #==============================================================================
  13. class Game_BattlerBase
  14.   
  15.   # Sets the interval of gain/loose of 1 hp, must be an integer value.
  16.   SCROLL_FRAME_INTERVAL   = 7
  17.   #Notes for multipliers:
  18.   # Numbers bigger than 1 means than the time between intervals will be shorter.
  19.   # Lower numbers than 1 means the opposite.
  20.   # 1 means Same as normal hp discount.
  21.   # Multiplier when guarding
  22.   SCROLL_GUARD_MULTIPLIER = 1
  23.   # Multiplier when hp = 0
  24.   SCROLL_DEAD_MULTIPLIER  = 1
  25.   #multiplier when recovering HP
  26.   SCROLL_RECOVERY_RATE    = 0.5
  27.   
  28.   #--------------------------------------------------------------------------
  29.   # *
  30.   #--------------------------------------------------------------------------
  31.   attr_accessor :scroll_hp
  32.   
  33.   #--------------------------------------------------------------------------
  34.   # *
  35.   #--------------------------------------------------------------------------  
  36.   alias ramiro_m3dmgscrll_initialize initialize
  37.   #--------------------------------------------------------------------------
  38.   # *
  39.   #--------------------------------------------------------------------------
  40.   def initialize
  41.     ramiro_m3dmgscrll_initialize
  42.     @scroll_hp = @hp
  43.   end
  44.   #--------------------------------------------------------------------------
  45.   # *
  46.   #--------------------------------------------------------------------------
  47.   def real_hp_value
  48.     actor? ? @scroll_hp : @hp
  49.   end
  50.   #--------------------------------------------------------------------------
  51.   # *
  52.   #--------------------------------------------------------------------------
  53.   def refresh
  54.     state_resist_set.each {|state_id| erase_state(state_id) }
  55.     @hp = [[@hp, mhp].min, 0].max
  56.     @mp = [[@mp, mmp].min, 0].max
  57.     real_hp_value == 0 ? add_state(death_state_id) : remove_state(death_state_id)
  58.   end  
  59.   #--------------------------------------------------------------------------
  60.   # *
  61.   #--------------------------------------------------------------------------
  62.   def refresh_scroll
  63.     alive = alive?
  64.     real_hp_value == 0 ? add_state(death_state_id) : remove_state(death_state_id)
  65.     perform_collapse_effect if dead? && alive
  66.   end
  67. end

  68. class Game_Battler < Game_BattlerBase
  69.   #--------------------------------------------------------------------------
  70.   # *
  71.   #--------------------------------------------------------------------------  
  72.   alias ramiro_m3dmgscrll_die die
  73.   alias ramiro_m3dmgscrll_revive revive
  74.   #--------------------------------------------------------------------------
  75.   # *
  76.   #--------------------------------------------------------------------------
  77.   def die
  78.     @scroll_hp = 0
  79.     ramiro_m3dmgscrll_die
  80.   end
  81.   #--------------------------------------------------------------------------
  82.   # *
  83.   #--------------------------------------------------------------------------
  84.   def revive
  85.     @scroll_hp = 1 if @scroll_hp == 0
  86.     ramiro_m3dmgscrll_revive
  87.   end
  88.   #--------------------------------------------------------------------------
  89.   # *
  90.   #--------------------------------------------------------------------------
  91.   def scroll_dead_multiplier
  92.     SCROLL_DEAD_MULTIPLIER
  93.   end
  94.   #--------------------------------------------------------------------------
  95.   # *
  96.   #--------------------------------------------------------------------------
  97.   def scroll_guard_multiplier
  98.     SCROLL_GUARD_MULTIPLIER * self.grd
  99.   end
  100.   #--------------------------------------------------------------------------
  101.   # *
  102.   #--------------------------------------------------------------------------
  103.   def scroll_recovery_interval
  104.     r = SCROLL_FRAME_INTERVAL * SCROLL_RECOVERY_RATE
  105.     r *= self.grd if guard?
  106.     r.to_i
  107.   end
  108.   #--------------------------------------------------------------------------
  109.   # *
  110.   #--------------------------------------------------------------------------
  111.   def scroll_interval
  112.     return (SCROLL_FRAME_INTERVAL * scroll_guard_multiplier).to_i if guard?
  113.     return (SCROLL_FRAME_INTERVAL * scroll_dead_multiplier).to_i  if self.hp == 0
  114.     SCROLL_FRAME_INTERVAL
  115.   end
  116.   #--------------------------------------------------------------------------
  117.   # *
  118.   #--------------------------------------------------------------------------
  119.   def scroll_update
  120.     if actor?
  121.       update_actor_hp_scroll
  122.     end
  123.   end
  124.   #--------------------------------------------------------------------------
  125.   # *
  126.   #--------------------------------------------------------------------------
  127.   def update_actor_hp_scroll
  128.     if @scroll_hp > @hp
  129.       return if BattleManager.actor == self #CAUTION!
  130. #      return if SceneManager.scene.subject && SceneManager.scene.subject == self
  131.       if Graphics.frame_count % scroll_interval == 0
  132.         @scroll_hp -= 1
  133.         refresh_scroll
  134.       end  
  135.     elsif @scroll_hp < @hp
  136.       @scroll_hp += 1 if Graphics.frame_rate % scroll_recovery_interval == 0
  137.       refresh_scroll
  138.     end   
  139.   end  
  140.   
  141. end
  142. #==============================================================================
  143. # |
  144. #==============================================================================
  145. module BattleManager
  146.   #--------------------------------------------------------------------------
  147.   # *
  148.   #--------------------------------------------------------------------------
  149.   class << self
  150.     alias ramiro_m3dmgscrll_process_victory process_victory
  151.     alias ramiro_m3dmgscrll_process_abort process_abort
  152.   end
  153.   #--------------------------------------------------------------------------
  154.   # *
  155.   #--------------------------------------------------------------------------
  156.   def self.process_victory
  157.     for actor in $game_party.members
  158.       actor.hp = actor.scroll_hp if actor.scroll_hp > actor.hp
  159.     end
  160.     ramiro_m3dmgscrll_process_victory
  161.   end
  162.   
  163.   def self.process_abort
  164.     for actor in $game_party.members
  165.       actor.hp = actor.scroll_hp if actor.scroll_hp > actor.hp
  166.     end
  167.     ramiro_m3dmgscrll_process_abort
  168.   end
  169. end
  170. #==============================================================================
  171. # |
  172. #==============================================================================
  173. class Scene_Battle < Scene_Base
  174.   #--------------------------------------------------------------------------
  175.   # *
  176.   #--------------------------------------------------------------------------
  177.   attr_accessor :subject
  178.   #--------------------------------------------------------------------------
  179.   # *
  180.   #--------------------------------------------------------------------------
  181.   alias ramiro_m3dmgscrll_start start
  182.   alias ramiro_m3dmgscrll_update_basic update_basic
  183.   #--------------------------------------------------------------------------
  184.   # *
  185.   #--------------------------------------------------------------------------
  186.   def start
  187.     for actor in $game_party.members
  188.       actor.scroll_hp = actor.hp
  189.     end
  190.     ramiro_m3dmgscrll_start
  191.   end
  192.   #--------------------------------------------------------------------------
  193.   # *
  194.   #--------------------------------------------------------------------------
  195.   def update_basic
  196.     ramiro_m3dmgscrll_update_basic
  197.     for battler in $game_troop.members+$game_party.members
  198.       return if $game_troop.interpreter.running? #CAUTION!
  199.       battler.scroll_update
  200.     end
  201.     if BattleManager.actor && BattleManager.actor.dead?
  202.       if $imported['Ramiro-Mother3Visual']
  203.         for battler in $game_party.members
  204.           next if BattleManager.actor.index <= battler.index
  205.           battler.sprite_effect_type = :go_down
  206.         end
  207.       end         
  208.       cancel_all_windows
  209.       next_command
  210.     end  
  211.   end
  212.   #--------------------------------------------------------------------------
  213.   # *
  214.   #--------------------------------------------------------------------------
  215.   def cancel_all_windows
  216.     @help_window.hide
  217.     @help_window.contents.clear
  218.     @item_window.hide
  219.     @skill_window.hide
  220.     @actor_window.hide
  221.     @enemy_window.hide
  222.     @item_window.unselect
  223.     @actor_window.unselect
  224.     @skill_window.unselect
  225.     @enemy_window.unselect
  226.     if $imported['Ramiro-RBS-TargetSelection']
  227.       @selection_active = false
  228.     end
  229.   end
  230.   
  231. end
  232. #==============================================================================
  233. # |
  234. #==============================================================================
  235. class Game_Actor < Game_Battler
  236.   #--------------------------------------------------------------------------
  237.   # *
  238.   #--------------------------------------------------------------------------  
  239.   def hp_scroll_rate  
  240.     return @scroll_hp.to_f / mhp
  241.   end
  242. end
  243. #==============================================================================
  244. # |
  245. #==============================================================================
  246. class Window_Base < Window
  247.   
  248.   #--------------------------------------------------------------------------
  249.   # * Draw Gauge
  250.   #     rate   : Rate (full at 1.0)
  251.   #     color1 : Left side gradation
  252.   #     color2 : Right side gradation
  253.   #--------------------------------------------------------------------------
  254.   def draw_gauge(x, y, width, rate, color1, color2, background=true)
  255.     fill_w = (width * rate).to_i
  256.     gauge_y = y + line_height - 8
  257.     contents.fill_rect(x, gauge_y, width, 6, gauge_back_color) if background
  258.     contents.gradient_fill_rect(x, gauge_y, fill_w, 6, color1, color2)
  259.   end  
  260.   #--------------------------------------------------------------------------
  261.   # *
  262.   #--------------------------------------------------------------------------
  263.   def hp_scroll_base_color1(actor)
  264.     actor.scroll_hp > actor.hp ? Color.new(255,0,0) : Color.new(0,255,0)
  265.   end  
  266.   #--------------------------------------------------------------------------
  267.   # *
  268.   #--------------------------------------------------------------------------  
  269.   def hp_scroll_base_color2(actor)
  270.     actor.scroll_hp > actor.hp ? Color.new(128,0,0) : Color.new(0,128,0)
  271.   end   
  272. end

  273. if $imported['Ramiro-Mother3Visual']  
  274.   
  275. #==============================================================================
  276. # |
  277. #==============================================================================
  278. class Window_BattleStatusPart < Window_Base
  279.   #--------------------------------------------------------------------------
  280.   # *
  281.   #--------------------------------------------------------------------------
  282.   alias ramiro_m3dmgscrll_update update
  283.   #--------------------------------------------------------------------------
  284.   # * Draw HP
  285.   #--------------------------------------------------------------------------
  286.   def draw_actor_hp(actor, x, y, width = 124)
  287.     rates = [actor.hp_scroll_rate, actor.hp_rate]
  288.     draw_gauge(x, y, width, rates.max, hp_scroll_base_color1(actor), hp_scroll_base_color2(actor))
  289.     draw_gauge(x, y, width, rates.min, hp_gauge_color1, hp_gauge_color2, false)
  290.     change_color(system_color)
  291.     draw_text(x, y, 30, line_height, Vocab::hp_a)
  292.     draw_current_and_max_values(x, y, width, actor.scroll_hp, actor.mhp,
  293.       hp_color(actor), normal_color)
  294.   end  
  295.   #--------------------------------------------------------------------------
  296.   # *
  297.   #--------------------------------------------------------------------------
  298.   def update
  299.     ramiro_m3dmgscrll_update
  300.     update_scroll_hp
  301.   end
  302.   #--------------------------------------------------------------------------
  303.   # *
  304.   #--------------------------------------------------------------------------
  305.   def update_scroll_hp
  306.     @saved_hp = 0 if !@saved_hp
  307.     if actor.scroll_hp != @saved_hp
  308.       @saved_hp = actor.scroll_hp
  309.       contents.clear_rect(2, line_height, contents.width - 4, line_height)
  310.       draw_actor_hp(actor, 2, line_height, contents.width - 4)
  311.       refresh if @saved_hp == 0
  312.     end
  313.   end
  314. end
  315. else
  316. #==============================================================================
  317. # |
  318. #==============================================================================
  319. class Window_BattleStatus < Window_Selectable
  320.   #--------------------------------------------------------------------------
  321.   # *
  322.   #--------------------------------------------------------------------------
  323.   alias ramiro_m3dmgscrll_update update
  324.   #--------------------------------------------------------------------------
  325.   # * Draw HP
  326.   #--------------------------------------------------------------------------
  327.   def draw_actor_hp(actor, x, y, width = 124)
  328.     rates = [actor.hp_scroll_rate, actor.hp_rate]
  329.     draw_gauge(x, y, width, rates.max, hp_scroll_base_color1(actor), hp_scroll_base_color2(actor))
  330.     draw_gauge(x, y, width, rates.min, hp_gauge_color1, hp_gauge_color2, false)
  331.     change_color(system_color)
  332.     draw_text(x, y, 30, line_height, Vocab::hp_a)
  333.     draw_current_and_max_values(x, y, width, actor.scroll_hp, actor.mhp,
  334.       hp_color(actor), normal_color)
  335.   end  
  336.   #--------------------------------------------------------------------------
  337.   # *
  338.   #--------------------------------------------------------------------------
  339.   def update
  340.     ramiro_m3dmgscrll_update
  341.     update_scroll_hp
  342.   end
  343.   #--------------------------------------------------------------------------
  344.   # *
  345.   #--------------------------------------------------------------------------
  346.   def update_scroll_hp
  347.     @saved_hp = 0 if !@saved_hp
  348.     if actor.scroll_hp != @saved_hp
  349.       @saved_hp = actor.scroll_hp
  350.       contents.clear_rect(2, line_height, contents.width - 4, line_height)
  351.       draw_actor_hp(actor, 2, line_height, contents.width - 4)
  352.     end
  353.   end
  354.   
  355. end  

  356. end
  357. #==============================================================================
  358. # |
  359. #==============================================================================
  360. class Scene_Base
  361.   #--------------------------------------------------------------------------
  362.   # *
  363.   #--------------------------------------------------------------------------
  364.   alias ramiro_m3dmgscrll_update update
  365.   #--------------------------------------------------------------------------
  366.   # *
  367.   #--------------------------------------------------------------------------
  368.   def update
  369.     ramiro_m3dmgscrll_update
  370.     return if self.is_a?(Scene_Battle)
  371.     for actor in $game_party.members
  372.       actor.scroll_hp = actor.hp
  373.     end
  374.   end
  375.   
  376. end
复制代码



SharedScreenshot.jpg
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部