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

Project1

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

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

[复制链接]

Lv2.观梦者

梦石
0
星屑
289
在线时间
28 小时
注册时间
2020-4-6
帖子
8
跳转到指定楼层
1
发表于 2020-7-4 14:27:55 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 VIPArcher 于 2022-5-28 02:10 编辑

RUBY 代码复制
  1. #==============================================================================
  2. # Mother3 Visuals
  3. # Author Ramiro
  4. # Version, 1.3
  5. #------------------------------------------------------------------------------
  6. # Shows Mother 3 visual, battle system.
  7. #==============================================================================
  8.  
  9. $imported = {} if $imported.nil?
  10. $imported['Ramiro-Mother3Visual'] = true
  11.  
  12. module BattleConfig
  13.  
  14.   # tone of the window when dead and when the hp is below 1/4
  15.   Window_DeadTone      = Tone.new(200, 0, 0)
  16.   Window_CriticalTone  = Tone.new(200, 120, 10)
  17.   # Chech if the message window is always on the top of the screen.
  18.   AlwaysOnTop          = false
  19.  
  20.   # animations used on magic reflection and counterattack, set to 0 if you
  21.   # wish to disable
  22.   Reflex_AnimationID        = 0
  23.   Counterattack_AnimationID = 0
  24.  
  25.   PanoramicCamera  = false
  26.   PanoramicCameraH = 160
  27.  
  28.   DisapearWhenNoSelection = false
  29.  
  30. end
  31.  
  32. #==============================================================================
  33. # ?
  34. #==============================================================================
  35. class Scene_Base
  36.  
  37.   #--------------------------------------------------------------------------
  38.   # ?
  39.   #--------------------------------------------------------------------------   
  40.   attr_reader :info_viewport
  41.  
  42. end
  43.  
  44. #==============================================================================
  45. # ?
  46. #==============================================================================
  47. module BattleManager
  48.  
  49.   #--------------------------------------------------------------------------
  50.   # ?
  51.   #--------------------------------------------------------------------------  
  52.   class << self
  53.     alias ramiro_m3_process_victory process_victory
  54.   end
  55.  
  56.   #--------------------------------------------------------------------------
  57.   # ?
  58.   #--------------------------------------------------------------------------
  59.   def self.phase
  60.     return @phase
  61.   end
  62.  
  63.   #--------------------------------------------------------------------------
  64.   # ?
  65.   #--------------------------------------------------------------------------
  66.   def self.process_victory  
  67.     SceneManager.scene.wait(1)
  68.     $game_party.members.each do |i|
  69.       i.sprite.battle_show if i.alive?
  70.     end
  71.     SceneManager.scene.wait(1)
  72.     ramiro_m3_process_victory
  73.   end
  74.  
  75. end
  76.  
  77. #==============================================================================
  78. # ?Game_Message
  79. #==============================================================================
  80.  
  81. class Game_Message
  82.  
  83.   alias ramiro_m3_position position
  84.  
  85.   def position
  86.     return 0 if BattleConfig::AlwaysOnTop && SceneManager.scene_is?(Scene_Battle)
  87.     ramiro_m3_position
  88.   end
  89.  
  90. end
  91.  
  92. #==============================================================================
  93. # ?
  94. #==============================================================================
  95. class Window_BattleStatusPart < Window_Base
  96.  
  97.   #--------------------------------------------------------------------------
  98.   # ?
  99.   #--------------------------------------------------------------------------  
  100.   def initialize(actor_index)
  101.     @shake_time = 0
  102.     @actor_index = actor_index
  103.     @move_time = 0
  104.     @x_position = x_at(actor_index)
  105.     @x_destination = @x_position
  106.     @y_position = 20
  107.     @y_destination = 20
  108.     super(0, 0, window_width, window_height)
  109.     update_screen_position
  110.     refresh
  111.     hide_actor_quickly
  112.   end
  113.  
  114.   #--------------------------------------------------------------------------
  115.   # ?
  116.   #--------------------------------------------------------------------------   
  117.   def x_at(actor_index)
  118.     128 + (total_draw_area - window_width * window_count) / 2 + window_width * actor_index
  119.   end
  120.  
  121.   #--------------------------------------------------------------------------
  122.   # ?
  123.   #--------------------------------------------------------------------------
  124.   def update_tone
  125.     if actor.dead?
  126.       self.tone.set(BattleConfig::Window_DeadTone)
  127.     elsif actor.hp < actor.mhp / 4
  128.       self.tone.set(BattleConfig::Window_CriticalTone)
  129.     else
  130.       super
  131.     end
  132.   end   
  133.  
  134.   #--------------------------------------------------------------------------
  135.   # ?
  136.   #--------------------------------------------------------------------------  
  137.   def total_draw_area
  138.     Graphics.width - 128
  139.   end
  140.  
  141.   #--------------------------------------------------------------------------
  142.   # ?
  143.   #--------------------------------------------------------------------------  
  144.   def window_count
  145.     $game_party.members.size
  146.   end
  147.  
  148.   #--------------------------------------------------------------------------
  149.   # ?
  150.   #--------------------------------------------------------------------------  
  151.   def max_window_count
  152.     $game_party.max_battle_members
  153.   end  
  154.  
  155.   #--------------------------------------------------------------------------
  156.   # ?
  157.   #--------------------------------------------------------------------------
  158.   def window_width
  159.     total_draw_area / max_window_count
  160.   end
  161.  
  162.   #--------------------------------------------------------------------------
  163.   # ?
  164.   #--------------------------------------------------------------------------
  165.   def window_height
  166.     fitting_height(visible_line_number) - 20
  167.   end
  168.  
  169.   #--------------------------------------------------------------------------
  170.   # ?
  171.   #--------------------------------------------------------------------------  
  172.   def screen_x
  173.     @x_position
  174.   end
  175.  
  176.   #--------------------------------------------------------------------------
  177.   # ?
  178.   #--------------------------------------------------------------------------  
  179.   def screen_y
  180.     return @y_position
  181.   end
  182.  
  183.   #--------------------------------------------------------------------------
  184.   # ?
  185.   #--------------------------------------------------------------------------
  186.   def visible_line_number
  187.     return 4
  188.   end  
  189.  
  190.   #--------------------------------------------------------------------------
  191.   # ?
  192.   #--------------------------------------------------------------------------  
  193.   def update
  194.     super
  195.     if @move_time > 0
  196.       @x_position = (@x_position * (@move_time - 1) + @x_destination) / @move_time
  197.       @y_position = (@y_position * (@move_time - 1) + @y_destination) / @move_time
  198.       @move_time -= 1
  199.     end  
  200.     update_screen_position
  201.   end
  202.  
  203.   #--------------------------------------------------------------------------
  204.   # ?
  205.   #--------------------------------------------------------------------------   
  206.   def move_to_index(actor_index)
  207.     @x_destination = x_at(actor_index)
  208.     @move_time = 1
  209.   end
  210.  
  211.   #--------------------------------------------------------------------------
  212.   # ?
  213.   #--------------------------------------------------------------------------   
  214.   def return_to_origin
  215.     @x_destination = x_at(actor.index)
  216.     @y_destination = 20
  217.     @move_time = 1   
  218.   end
  219.  
  220.   #--------------------------------------------------------------------------
  221.   # ?
  222.   #--------------------------------------------------------------------------   
  223.   def move_down
  224.     @y_destination = self.height - line_height - standard_padding
  225.     @move_time = 1
  226.   end
  227.  
  228.   #--------------------------------------------------------------------------
  229.   # ?
  230.   #--------------------------------------------------------------------------   
  231.   def update_screen_position
  232.     self.x = screen_x + shake_amp
  233.     self.y = screen_y
  234.     self.z = self.y
  235.   end
  236.  
  237.   #--------------------------------------------------------------------------
  238.   # ?
  239.   #--------------------------------------------------------------------------     
  240.   def shake_amp
  241.     if @shake_time > 0
  242.       @shake_time -= 1
  243.       return @shake_time % 2 * 4 - 2
  244.     else
  245.       return 0
  246.     end  
  247.   end
  248.  
  249.   #--------------------------------------------------------------------------
  250.   # ?
  251.   #--------------------------------------------------------------------------  
  252.   def refresh
  253.     self.contents.clear
  254.     draw_actor_status if actor
  255.   end
  256.  
  257.   #--------------------------------------------------------------------------
  258.   # ?
  259.   #--------------------------------------------------------------------------
  260.   def line_color
  261.     color = normal_color
  262.     color.alpha = 48
  263.     color
  264.   end  
  265.  
  266.   #--------------------------------------------------------------------------
  267.   # ?
  268.   #--------------------------------------------------------------------------
  269.   def draw_horz_line(y)
  270.     line_y = y - 1
  271.     contents.fill_rect(0, line_y, contents_width - 24, 2, line_color)
  272.   end  
  273.  
  274.   #--------------------------------------------------------------------------
  275.   # ?
  276.   #--------------------------------------------------------------------------   
  277.   def draw_actor_status
  278.     self.contents.font.size = 16
  279.     draw_actor_name(actor, 0, 0, contents.width - 24)
  280.     draw_horz_line(line_height)
  281.     self.contents.font.size = 16
  282.     draw_actor_hp(actor, 2, line_height, contents.width - 4)
  283.     if $data_system.opt_display_tp
  284.       draw_actor_mp(actor, 2, line_height * 2, contents.width / 2 - 6)
  285.       draw_actor_tp(actor, 4 + contents.width / 2, line_height * 2, contents.width / 2 - 6)
  286.     else
  287.       draw_actor_mp(actor, 2, line_height * 2, contents.width - 4)
  288.     end  
  289.     draw_actor_icons(actor, contents.width - 24, 0, 24)
  290.   end
  291.  
  292.   #--------------------------------------------------------------------------
  293.   # ?
  294.   #--------------------------------------------------------------------------  
  295.   def show_actor
  296.     actor.sprite.battle_show
  297.   end
  298.  
  299.   #--------------------------------------------------------------------------
  300.   # ?
  301.   #--------------------------------------------------------------------------  
  302.   def hide_actor
  303.     actor.sprite.battle_hide
  304.   end
  305.   #--------------------------------------------------------------------------
  306.   # ?
  307.   #--------------------------------------------------------------------------   
  308.   def hide_actor_quickly
  309.     actor.sprite.opacity = 0
  310.   end  
  311.   #--------------------------------------------------------------------------
  312.   # ?
  313.   #--------------------------------------------------------------------------  
  314.   def index
  315.     @actor_index
  316.   end
  317.  
  318.   #--------------------------------------------------------------------------
  319.   # ?
  320.   #--------------------------------------------------------------------------  
  321.   def actor
  322.     $game_party.members[@actor_index]
  323.   end
  324.  
  325.   #--------------------------------------------------------------------------
  326.   # ?
  327.   #--------------------------------------------------------------------------  
  328.   def shake
  329.     @shake_time = 20
  330.   end
  331.  
  332. end
  333.  
  334. #==============================================================================
  335. # ?
  336. #==============================================================================
  337. class Window_BattleStatusPatner < Window_BattleStatusPart
  338.  
  339.   #--------------------------------------------------------------------------
  340.   # ?
  341.   #--------------------------------------------------------------------------   
  342.   attr_accessor :actor_index
  343.  
  344.   #--------------------------------------------------------------------------
  345.   # ?
  346.   #--------------------------------------------------------------------------
  347.   def window_width
  348.     128
  349.   end  
  350.  
  351.   #--------------------------------------------------------------------------
  352.   # ?
  353.   #--------------------------------------------------------------------------   
  354.   def screen_x
  355.     0
  356.   end
  357.  
  358.   #--------------------------------------------------------------------------
  359.   # ?
  360.   #--------------------------------------------------------------------------   
  361.   def show
  362.     return if $imported["YEA-BattleEngine"]
  363.     super
  364.   end
  365.  
  366.   #--------------------------------------------------------------------------
  367.   # ?
  368.   #--------------------------------------------------------------------------   
  369.   def screen_y
  370.     Graphics.height - window_height - 20
  371.   end  
  372.  
  373. end
  374.  
  375. #==============================================================================
  376. # ?Window_BattleStatus
  377. #==============================================================================
  378. class Window_BattleStatusMultiple < Window_BattleStatus
  379.  
  380.   #--------------------------------------------------------------------------
  381.   # ?
  382.   #--------------------------------------------------------------------------   
  383.   attr_accessor :viewport
  384.   attr_accessor :wait_method
  385.  
  386.   #--------------------------------------------------------------------------
  387.   # ?
  388.   #--------------------------------------------------------------------------  
  389.   def initialize
  390.     super
  391.     @status_windows = []
  392.     @viewport = nil
  393.     @wait_method = 1
  394.     self.visible = false
  395.     self.windowskin = Cache.system('')
  396.     @index = -1
  397.   end
  398.  
  399.   #--------------------------------------------------------------------------
  400.   # ? ??????????
  401.   #--------------------------------------------------------------------------
  402.   def create_contents
  403.     self.contents.dispose if self.contents && !self.contents.disposed?
  404.     self.contents = Bitmap.new(1, 1)
  405.   end  
  406.   #--------------------------------------------------------------------------
  407.   # ? ??????????
  408.   #--------------------------------------------------------------------------  
  409.   def draw_item(index)
  410.     return if index.nil?
  411.     return unless $game_party.members[index]
  412.     @status_windows = [] unless @status_windows
  413.     return unless @status_windows[index]
  414.     @status_windows[index].refresh
  415.   end  
  416.   #--------------------------------------------------------------------------
  417.   # ?
  418.   #--------------------------------------------------------------------------  
  419.   def window_width
  420.     Graphics.width - 128
  421.   end
  422.  
  423.   #--------------------------------------------------------------------------
  424.   # ?
  425.   #--------------------------------------------------------------------------
  426.   def window_height
  427.     fitting_height(visible_line_number)
  428.   end
  429.  
  430.   #--------------------------------------------------------------------------
  431.   # ?
  432.   #--------------------------------------------------------------------------
  433.   def visible_line_number
  434.     return 4
  435.   end   
  436.  
  437.   #--------------------------------------------------------------------------
  438.   # ?
  439.   #--------------------------------------------------------------------------  
  440.   def refresh
  441.         @status_windows = [] if !@status_windows
  442.     @status_windows.each do |i|
  443.       i.refresh
  444.     end  
  445.   end
  446.  
  447.   #--------------------------------------------------------------------------
  448.   # ?
  449.   #--------------------------------------------------------------------------  
  450.   def update
  451.     super
  452.         @status_windows = [] if !@status_windows
  453.     need_wait = false
  454.     self.visible = false
  455.     $game_party.members.each do |actor|
  456.       if !@status_windows.any? { |i| i.index == actor.index}
  457.         window = Window_BattleStatusPart.new(actor.index)
  458.         window.viewport = self.viewport
  459.         @status_windows << window
  460.         actor.sprite.update
  461.         window.x = window.screen_x
  462.         window.update
  463.         window.viewport.update
  464.         window.update
  465.         need_wait = false
  466.       end  
  467.     end  
  468.     @status_windows.each do |i|
  469.       if $game_party.members.include?(i.actor)
  470.         i.update
  471.         i.viewport = self.viewport
  472.       else
  473.         @status_windows.delete(i)
  474.         i.dispose
  475.       end  
  476.     end
  477.     SceneManager.scene.wait(1) if need_wait
  478.   end
  479.  
  480.   #--------------------------------------------------------------------------
  481.   # ?
  482.   #--------------------------------------------------------------------------  
  483.   def dispose
  484.     super
  485.     @status_windows = [] if !@status_windows
  486.     @status_windows.each do |i|
  487.       i.dispose
  488.     end   
  489.   end
  490.  
  491.   #--------------------------------------------------------------------------
  492.   # ?
  493.   #--------------------------------------------------------------------------   
  494.   def show_actor(index)
  495.     @status_windows = [] if !@status_windows
  496.     @status_windows.sort! { |a, b| a.index <=> b.index}
  497.     @status_windows[index].show_actor if index >= 0 && @status_windows[index]
  498.   end
  499.  
  500.   #--------------------------------------------------------------------------
  501.   # ?
  502.   #--------------------------------------------------------------------------   
  503.   def hide_actor(index)
  504.     @status_windows = [] if !@status_windows
  505.     @status_windows.sort! { |a, b| a.index <=> b.index}
  506.     @status_windows[index].hide_actor if index >= 0 && @status_windows[index]
  507.   end
  508.  
  509.   #--------------------------------------------------------------------------
  510.   # ?
  511.   #--------------------------------------------------------------------------   
  512.   def select(index=0)
  513.     hide_actor(@index) if index > @index || BattleConfig::DisapearWhenNoSelection
  514.     wait_show
  515.     @index = index
  516.     show_actor(@index)
  517.     wait_show
  518.   end
  519.   #--------------------------------------------------------------------------
  520.   # ?
  521.   #--------------------------------------------------------------------------
  522.   def wait_show
  523.     return unless @wait_method
  524.     @wait_method.call(1)
  525.   end
  526.  
  527.   #--------------------------------------------------------------------------
  528.   # ?
  529.   #--------------------------------------------------------------------------   
  530.   def unselect
  531.     #hide_actor(@index)
  532.     @index = -1
  533.   end
  534.  
  535.   #--------------------------------------------------------------------------
  536.   # ?
  537.   #--------------------------------------------------------------------------  
  538.   def shake_window(index)
  539.         @status_windows = [] if !@status_windows
  540.     @status_windows.sort! { |a, b| a.index <=> b.index}
  541.     @status_windows[index].shake
  542.   end
  543.  
  544.   #--------------------------------------------------------------------------
  545.   # ?
  546.   #--------------------------------------------------------------------------  
  547.   def window_at(index)
  548.         @status_windows = [] if !@status_windows
  549.     @status_windows.sort! { |a, b| a.index <=> b.index}
  550.     @status_windows[index]
  551.   end
  552.  
  553.   #--------------------------------------------------------------------------
  554.   # ?
  555.   #--------------------------------------------------------------------------   
  556.   def show
  557.         @status_windows = [] if !@status_windows
  558.     @status_windows.each do |i|
  559.       i.show
  560.     end
  561.     super
  562.   end
  563.  
  564.   #--------------------------------------------------------------------------
  565.   # ?
  566.   #--------------------------------------------------------------------------   
  567.   def hide
  568.         @status_windows = [] if !@status_windows
  569.     @status_windows.each do |i|
  570.       i.hide
  571.     end
  572.     super
  573.   end  
  574.  
  575.   #--------------------------------------------------------------------------
  576.   # ?
  577.   #--------------------------------------------------------------------------   
  578.   def make_window_return(index)
  579.         @status_windows = [] if !@status_windows
  580.     @status_windows.sort! { |a, b| a.index <=> b.index}
  581.     @status_windows[index].return_to_origin
  582.   end
  583.  
  584.   #--------------------------------------------------------------------------
  585.   # ?
  586.   #--------------------------------------------------------------------------   
  587.   def substitute(target_index, substitute_index)  
  588.         @status_windows = [] if !@status_windows
  589.     @status_windows[substitute_index].move_to_index(target_index)
  590.     @status_windows[target_index].move_down
  591.   end  
  592.  
  593. end
  594.  
  595. #==============================================================================
  596. # ?
  597. #==============================================================================
  598. class Game_Enemy < Game_Battler
  599.  
  600.   #--------------------------------------------------------------------------
  601.   # ?
  602.   #--------------------------------------------------------------------------  
  603.   def sprite
  604.     SceneManager.scene.spriteset.enemy_sprites.reverse[self.index]
  605.   end  
  606.  
  607.   #--------------------------------------------------------------------------
  608.   # ?
  609.   #--------------------------------------------------------------------------  
  610.   def atk_animation_id1
  611.     return self.enemy.note[/<ATK ANI 1 ID:(\d+)>/mi] ? $1.to_i : 1
  612.   end
  613.  
  614.   #--------------------------------------------------------------------------
  615.   # ?
  616.   #--------------------------------------------------------------------------  
  617.   def atk_animation_id2
  618.     return self.enemy.note[/<ATK ANI 2 ID:(\d+)>/mi] ? $1.to_i : 0
  619.   end  
  620.  
  621.   def no_panoramic
  622.     return self.enemy.note[/<NO PANORAMIC>/mi] ? true : false
  623.   end
  624.  
  625. end
  626.  
  627. #==============================================================================
  628. # ?
  629. #==============================================================================
  630. class Game_Actor < Game_Battler
  631.  
  632.   #--------------------------------------------------------------------------
  633.   # ?
  634.   #--------------------------------------------------------------------------   
  635.   alias ramiro_m3_setup setup
  636.  
  637.   #--------------------------------------------------------------------------
  638.   # ?
  639.   #--------------------------------------------------------------------------   
  640.   attr_accessor :extra_y
  641.  
  642.   #--------------------------------------------------------------------------
  643.   # ?
  644.   #--------------------------------------------------------------------------   
  645.   def setup(actor_id)
  646.     ramiro_m3_setup(actor_id)
  647.     @extra_y = 0
  648.   end
  649.  
  650.   #--------------------------------------------------------------------------
  651.   # ?
  652.   #--------------------------------------------------------------------------  
  653.   def use_sprite?
  654.     return true
  655.   end
  656.  
  657.   #--------------------------------------------------------------------------
  658.   # ?
  659.   #--------------------------------------------------------------------------  
  660.   def sprite
  661.     return if !SceneManager.scene
  662.     SceneManager.scene.spriteset.actor_sprites[self.index]
  663.   end
  664.  
  665.   #--------------------------------------------------------------------------
  666.   # ?
  667.   #--------------------------------------------------------------------------   
  668.   def status_window
  669.     return nil if !SceneManager.scene_is?(Scene_Battle)
  670.     return nil if !SceneManager.scene.status_window
  671.     SceneManager.scene.status_window.window_at(self.index)
  672.   end
  673.  
  674.   #--------------------------------------------------------------------------
  675.   # ?
  676.   #--------------------------------------------------------------------------   
  677.   def screen_y
  678.     return Graphics.height - 100# + @extra_y
  679.   end
  680.  
  681.   #--------------------------------------------------------------------------
  682.   # ?
  683.   #--------------------------------------------------------------------------   
  684.   def screen_x
  685.     return 0 if !self.index   
  686.     return -1000 if !SceneManager.scene
  687.     return -1000 if !status_window
  688.     sw = status_window
  689.     sw.screen_x + sw.width / 2 - sw.viewport.ox + sw.viewport.rect.x
  690.   end
  691.  
  692.   #--------------------------------------------------------------------------
  693.   # ?
  694.   #--------------------------------------------------------------------------   
  695.   def screen_z
  696.     return -1000 if !self.index   
  697.     return -1000 if !SceneManager.scene   
  698.     100
  699.   end  
  700.  
  701. end
  702.  
  703. #==============================================================================
  704. # ?
  705. #==============================================================================
  706. class Sprite_Battler < Sprite_Base
  707.  
  708.   FRONTAL = false
  709.  
  710.   #--------------------------------------------------------------------------
  711.   # ?
  712.   #--------------------------------------------------------------------------  
  713.   alias ramiro_m3_initialize initialize
  714.   alias ramiro_m3_start_effect start_effect
  715.   alias ramiro_m3_update_effect update_effect
  716.   alias ramiro_m3_setup_new_animation setup_new_animation
  717.   #--------------------------------------------------------------------------
  718.   # ?
  719.   #--------------------------------------------------------------------------   
  720.   def initialize(viewport, battler=nil)
  721.     ramiro_m3_initialize(viewport, battler)
  722.     if battler && battler.actor?
  723.       self.visible = false
  724.       self.opacity = 0
  725.     end
  726.   end
  727.   #--------------------------------------------------------------------------
  728.   # ?
  729.   #--------------------------------------------------------------------------  
  730.   def battle_show
  731.     return if !@battler || @battler.enemy?
  732.     start_effect(:go_up)
  733.   end
  734.  
  735.   #--------------------------------------------------------------------------
  736.   # ?
  737.   #--------------------------------------------------------------------------  
  738.   def battle_hide
  739.     return if !@battler || @battler.enemy?
  740.     start_effect(:go_down)   
  741.   end
  742.  
  743.   #--------------------------------------------------------------------------
  744.   # ?
  745.   #--------------------------------------------------------------------------  
  746.   def start_effect(effect_type)
  747.     @effect_type = effect_type   
  748.     case effect_type
  749.     when :go_up
  750.       revert_to_normal
  751.       @effect_duration = 5
  752.     when :go_down
  753.       revert_to_normal
  754.       @effect_duration = 5
  755.     else  
  756.       ramiro_m3_start_effect(effect_type)
  757.     end  
  758.   end
  759.  
  760.   #--------------------------------------------------------------------------
  761.   # ?
  762.   #--------------------------------------------------------------------------
  763.   def update_effect
  764.     if @effect_duration > 0
  765.       @effect_duration -= 1
  766.       case @effect_type
  767.       when :go_up
  768.         update_go_up_effect
  769.       when :go_down
  770.         update_go_down_effect
  771.       end  
  772.       @effect_duration += 1
  773.     end  
  774.     ramiro_m3_update_effect
  775.   end
  776.  
  777.   #--------------------------------------------------------------------------
  778.   # ?
  779.   #--------------------------------------------------------------------------  
  780.   def update_go_up_effect
  781.     self.opacity = (self.opacity * @effect_duration + 255 ) / (@effect_duration + 1)
  782. #    @battler.extra_y = (@battler.extra_y * @effect_duration) / (@effect_duration + 1)
  783.     self.visible = (self.opacity > 50)
  784.   end
  785.  
  786.   #--------------------------------------------------------------------------
  787.   # ?
  788.   #--------------------------------------------------------------------------  
  789.   def update_go_down_effect
  790.     self.opacity = (self.opacity * @effect_duration) / (@effect_duration + 1)
  791. #    @battler.extra_y = (@battler.extra_y * @effect_duration + 60) / (@effect_duration + 1)   
  792.     self.visible = (self.opacity > 50)
  793.   end
  794.  
  795.   #--------------------------------------------------------------------------
  796.   # ?
  797.   #--------------------------------------------------------------------------
  798.   def update_bitmap
  799.     if @battler.enemy?
  800.       new_bitmap = Cache.battler(@battler.battler_name, @battler.battler_hue)
  801.     else
  802.       new_bitmap = Cache.character(@battler.character_name)
  803.     end  
  804.     if bitmap != new_bitmap
  805.       self.bitmap = new_bitmap
  806.       init_visibility
  807.       update_rect if self.bitmap && @battler.actor?
  808.     end
  809.     self.opacity = 0 if @battler.actor? && @battler.extra_y == 60
  810.   end  
  811.  
  812.   #--------------------------------------------------------------------------
  813.   # ?
  814.   #--------------------------------------------------------------------------
  815.   def update_blink
  816.  
  817.   end  
  818.  
  819.   #--------------------------------------------------------------------------
  820.   # * Initialize Visibility
  821.   #--------------------------------------------------------------------------
  822.   def init_visibility
  823.     return @battler_visible = true if @battler.actor?
  824.     @battler_visible = @battler.alive?
  825.     self.opacity = 0 unless @battler_visible
  826.   end  
  827.  
  828.   #--------------------------------------------------------------------------
  829.   # ?
  830.   #--------------------------------------------------------------------------
  831.   def setup_new_effect
  832.     if !@battler_visible && @battler.alive? && @battler.enemy?
  833.       start_effect(:appear)
  834.     elsif @battler_visible && @battler.hidden? && @battler.enemy?
  835.       start_effect(:disappear)
  836.     elsif @battler.alive? && @was_dead
  837.       @was_dead = false
  838.       start_effect(:appear)
  839.     end
  840.     if @battler_visible && @battler.sprite_effect_type
  841.       start_effect(@battler.sprite_effect_type)
  842.       @battler.sprite_effect_type = nil
  843.     end
  844.     setup_popups if $imported["YEA-BattleEngine"]
  845.   end  
  846.  
  847.   #--------------------------------------------------------------------------
  848.   # ?
  849.   #--------------------------------------------------------------------------
  850.   def revert_to_normal
  851.     self.blend_type = 0
  852.     self.color.set(0, 0, 0, 0)
  853.     self.opacity = 255
  854.     self.ox = bitmap.width / 2 if bitmap
  855.     if @battler.enemy?
  856.       self.src_rect.y = 0
  857.     else  
  858.       update_rect
  859.     end  
  860.   end  
  861.  
  862.   alias ramiro_m3_revert_to_normal revert_to_normal
  863.  
  864.   #--------------------------------------------------------------------------
  865.   # * Revert to Normal Settings
  866.   #--------------------------------------------------------------------------
  867.   def revert_to_normal
  868.     ramiro_m3_revert_to_normal
  869.     if self.battler.actor?
  870.       update_rect
  871.       update_origin
  872.     end
  873.   end  
  874.  
  875.   #--------------------------------------------------------------------------
  876.   # ?
  877.   #--------------------------------------------------------------------------  
  878.   def update_rect
  879.     sign = @battler.character_name[/^[\!\$]./]
  880.     if sign && sign.include?('$')
  881.       i = 0
  882.       j = 0
  883.       w = self.bitmap.width / 3
  884.       h = self.bitmap.height / 4
  885.     else
  886.       i = @battler.character_index % 4
  887.       j = @battler.character_index / 4
  888.       w = self.bitmap.width / 12
  889.       h = self.bitmap.height / 8      
  890.     end
  891.     k = FRONTAL ? 3 : 0
  892.     self.src_rect.set(w + i * w * 3, j * h * 4 + k, w, h * 3 / 4)
  893.   end
  894.  
  895.   #--------------------------------------------------------------------------
  896.   # ?
  897.   #--------------------------------------------------------------------------
  898.   def update_origin
  899.     if bitmap
  900.       self.ox = self.width / 2
  901.       self.oy = self.height
  902.     end
  903.   end  
  904.  
  905.   #--------------------------------------------------------------------------
  906.   # ?
  907.   #--------------------------------------------------------------------------
  908.   def animation_set_sprites(frame)
  909.     cell_data = frame.cell_data
  910.     @ani_sprites.each_with_index do |sprite, i|
  911.       next unless sprite
  912.       pattern = cell_data[i, 0]
  913.       if !pattern || pattern < 0
  914.         sprite.visible = false
  915.         next
  916.       end
  917.       sprite.bitmap = pattern < 100 ? @ani_bitmap1 : @ani_bitmap2
  918.       sprite.visible = true
  919.       sprite.src_rect.set(pattern % 5 * 192,
  920.         pattern % 100 / 5 * 192, 192, 192)
  921.       if @ani_mirror
  922.         sprite.x = @ani_ox - cell_data[i, 1]
  923.         sprite.y = @ani_oy + cell_data[i, 2]
  924.         sprite.angle = (360 - cell_data[i, 4])
  925.         sprite.mirror = (cell_data[i, 5] == 0)
  926.       else
  927.         sprite.x = @ani_ox + cell_data[i, 1]
  928.         sprite.y = @ani_oy + cell_data[i, 2]
  929.         sprite.angle = cell_data[i, 4]
  930.         sprite.mirror = (cell_data[i, 5] == 1)
  931.       end
  932.       sprite.z = self.z + 300 + i
  933.       sprite.ox = 96
  934.       sprite.oy = 96
  935.       sprite.zoom_x = cell_data[i, 3] / 100.0
  936.       sprite.zoom_y = cell_data[i, 3] / 100.0
  937.       sprite.opacity = cell_data[i, 6]
  938.       sprite.blend_type = cell_data[i, 7]
  939.     end
  940.   end  
  941.  
  942.   #--------------------------------------------------------------------------
  943.   # ?
  944.   #--------------------------------------------------------------------------
  945.   def setup_new_animation
  946.     return if @battler.actor?
  947.     ramiro_m3_setup_new_animation
  948.   end  
  949.  
  950.   alias ramiro_m3_update update
  951.  
  952.   def update
  953.     ramiro_m3_update
  954.     return unless BattleConfig::PanoramicCamera
  955.     return unless self.battler
  956.     return if self.battler.enemy? && self.battler.no_panoramic
  957.      self.zoom_x = self.zoom_y = ((self.y - BattleConfig::PanoramicCameraH * 130 / 100) * 0.005 + 1.0) if self.battler.enemy?
  958.   end
  959.  
  960. end
  961.  
  962. #==============================================================================
  963. # ?
  964. #==============================================================================
  965. class Spriteset_Battle
  966.  
  967.   #--------------------------------------------------------------------------
  968.   # ?
  969.   #--------------------------------------------------------------------------
  970.   alias ramiro_m3_create_viewports create_viewports
  971.   alias ramiro_m3_update_viewports update_viewports
  972.   alias ramiro_m3_dispose_viewports dispose_viewports
  973.   alias ramiro_m3_create_actors create_actors
  974.   alias ramiro_m3_dispose_actors dispose_actors
  975.   alias ramiro_m3_update_actors update_actors
  976.  
  977.   #--------------------------------------------------------------------------
  978.   # ?
  979.   #--------------------------------------------------------------------------   
  980.   attr_reader :actor_sprites
  981.   attr_reader :enemy_sprites
  982.  
  983.   #--------------------------------------------------------------------------
  984.   # ?
  985.   #--------------------------------------------------------------------------
  986.   def create_viewports
  987.     @viewport4 = Viewport.new
  988.     @viewport4.z = 200
  989.     ramiro_m3_create_viewports
  990.     @viewportPopups.z = 500 if @viewportPopups
  991.   end  
  992.  
  993.   #--------------------------------------------------------------------------
  994.   # ?
  995.   #--------------------------------------------------------------------------  
  996.   def update_viewports
  997.     ramiro_m3_update_viewports
  998.     @viewport4.update
  999.   end
  1000.  
  1001.   #--------------------------------------------------------------------------
  1002.   # ?
  1003.   #--------------------------------------------------------------------------  
  1004.   def dispose_viewports
  1005.     ramiro_m3_dispose_viewports
  1006.     @viewport4.dispose
  1007.   end
  1008.  
  1009.   #--------------------------------------------------------------------------
  1010.   # ?
  1011.   #--------------------------------------------------------------------------  
  1012.   def create_actors
  1013.     ramiro_m3_create_actors
  1014.     @actor_animation = Array.new(4) {Sprite_ActorAnimation.new(@viewport4)}
  1015.   end  
  1016.  
  1017.   #--------------------------------------------------------------------------
  1018.   # ?
  1019.   #--------------------------------------------------------------------------
  1020.   def dispose_actors
  1021.     ramiro_m3_dispose_actors
  1022.     @actor_animation.each do |i|
  1023.       i.dispose
  1024.     end  
  1025.   end
  1026.  
  1027.   #--------------------------------------------------------------------------
  1028.   # ?
  1029.   #--------------------------------------------------------------------------
  1030.   def update_actors
  1031.     ramiro_m3_update_actors
  1032.      @actor_animation.each_with_index do |sprite, i|
  1033.       sprite.update
  1034.       sprite.actor = $game_party.members[i]
  1035.     end   
  1036.   end  
  1037.  
  1038. end
  1039.  
  1040. #==============================================================================
  1041. # ?
  1042. #==============================================================================
  1043. class Sprite_ActorAnimation < Sprite_Base
  1044.  
  1045.   #--------------------------------------------------------------------------
  1046.   # ?
  1047.   #--------------------------------------------------------------------------  
  1048.   attr_accessor :actor
  1049.  
  1050.   #--------------------------------------------------------------------------
  1051.   # ?
  1052.   #--------------------------------------------------------------------------  
  1053.   def initialize(viewport, actor=nil)
  1054.     super(viewport)
  1055.     @actor = actor
  1056.   end
  1057.  
  1058.   #--------------------------------------------------------------------------
  1059.   # ?
  1060.   #--------------------------------------------------------------------------  
  1061.   def update
  1062.     super
  1063.     return unless @actor
  1064.     if @actor.animation_id != 0
  1065.       animation = $data_animations[@actor.animation_id]
  1066.       mirror = @actor.animation_mirror
  1067.       start_animation(animation, mirror)      
  1068.       @actor.animation_id = 0
  1069.     end  
  1070.     self.x = @actor.screen_x
  1071.     self.y = @actor.screen_y
  1072.   end
  1073.  
  1074. end
  1075.  
  1076. #==============================================================================
  1077. # ?
  1078. #==============================================================================
  1079. class Scene_Battle < Scene_Base
  1080.  
  1081.   #--------------------------------------------------------------------------
  1082.   # ?
  1083.   #--------------------------------------------------------------------------   
  1084.   alias ramiro_m3_next_command next_command
  1085.   alias ramiro_m3_prior_command prior_command
  1086.   alias ramiro_m3_apply_item_effects apply_item_effects
  1087.   alias ramiro_m3_create_all_windows create_all_windows
  1088.   alias ramiro_m3_on_actor_ok on_actor_ok
  1089.   alias ramiro_m3_on_actor_cancel on_actor_cancel
  1090.   alias ramiro_m3_select_actor_selection select_actor_selection  
  1091.   alias ramiro_m3_invoke_item invoke_item
  1092.   alias ramiro_m3_apply_substitute apply_substitute
  1093.   alias ramiro_m3_invoke_counter_attack invoke_counter_attack
  1094.   alias ramiro_m3_invoke_magic_reflection invoke_magic_reflection
  1095.   #--------------------------------------------------------------------------
  1096.   # ?
  1097.   #--------------------------------------------------------------------------   
  1098.   attr_reader :spriteset
  1099.   attr_reader :status_window
  1100.  
  1101.   #--------------------------------------------------------------------------
  1102.   # ?
  1103.   #--------------------------------------------------------------------------  
  1104.   def apply_item_effects(target, item)
  1105.     @status_window.shake_window(target.index) if target.actor? && !item.damage.none? && !item.damage.recover?
  1106.     ramiro_m3_apply_item_effects(target, item)
  1107.   end
  1108.  
  1109.   #--------------------------------------------------------------------------
  1110.   # ?
  1111.   #--------------------------------------------------------------------------
  1112.   def create_status_window
  1113.     @status_window = Window_BattleStatusMultiple.new
  1114.     @status_window.wait_method = method( :wait )
  1115.   end
  1116.  
  1117.   #--------------------------------------------------------------------------
  1118.   # ?
  1119.   #--------------------------------------------------------------------------
  1120.   def show_attack_animation(targets)
  1121.     show_normal_animation(targets, @subject.atk_animation_id1, false)
  1122.     show_normal_animation(targets, @subject.atk_animation_id2, true)
  1123.   end  
  1124.  
  1125.   #--------------------------------------------------------------------------
  1126.   # ?
  1127.   #--------------------------------------------------------------------------
  1128.   def next_command
  1129.     ramiro_m3_next_command
  1130.   end
  1131.  
  1132.   #--------------------------------------------------------------------------
  1133.   # ?
  1134.   #--------------------------------------------------------------------------
  1135.   def prior_command
  1136.     ramiro_m3_prior_command
  1137.   end
  1138.  
  1139.   #--------------------------------------------------------------------------
  1140.   # ?
  1141.   #--------------------------------------------------------------------------  
  1142.   def create_all_windows
  1143.     ramiro_m3_create_all_windows
  1144.     create_actor_selection_partner_window
  1145.   end
  1146.  
  1147.   #--------------------------------------------------------------------------
  1148.   # ?
  1149.   #--------------------------------------------------------------------------  
  1150.   def create_actor_selection_partner_window
  1151.     @actor_selection_patner = Window_BattleStatusPatner.new(0)
  1152.     @actor_selection_patner.z = 9999
  1153.     @actor_selection_patner.hide
  1154.   end
  1155.  
  1156.   #--------------------------------------------------------------------------
  1157.   # ?
  1158.   #--------------------------------------------------------------------------  
  1159.   def set_patner_info(index)
  1160.     @actor_selection_patner.actor_index = index
  1161.     @actor_selection_patner.refresh
  1162.     @actor_selection_patner.show
  1163.   end
  1164.  
  1165.   #--------------------------------------------------------------------------
  1166.   # ?
  1167.   #--------------------------------------------------------------------------
  1168.   def execute_action
  1169.     @subject.sprite.battle_show if @subject.actor?
  1170.     @invoked_targets = [@subject]
  1171.     wait(1)
  1172.     use_item
  1173.     @log_window.wait_and_clear
  1174.     unless $game_troop.all_dead?
  1175.       @invoked_targets.each do |actor|
  1176.         next unless actor.actor? && actor.exist?
  1177.         actor.sprite.battle_hide
  1178.       end
  1179.     end  
  1180.     wait(1)
  1181.   end   
  1182.  
  1183.   #--------------------------------------------------------------------------
  1184.   # ?
  1185.   #--------------------------------------------------------------------------  
  1186.   def on_actor_ok
  1187.     @actor_selection_patner.hide
  1188.     ramiro_m3_on_actor_ok
  1189.   end
  1190.  
  1191.   #--------------------------------------------------------------------------
  1192.   # ?
  1193.   #--------------------------------------------------------------------------  
  1194.   def on_actor_cancel
  1195.     @actor_selection_patner.hide
  1196.     ramiro_m3_on_actor_cancel
  1197.   end
  1198.  
  1199.   #--------------------------------------------------------------------------
  1200.   # ?
  1201.   #--------------------------------------------------------------------------  
  1202.   def select_actor_selection
  1203.     set_patner_info(BattleManager.actor.index)
  1204.     ramiro_m3_select_actor_selection
  1205.   end
  1206.  
  1207.   #--------------------------------------------------------------------------
  1208.   # ?
  1209.   #--------------------------------------------------------------------------   
  1210.   def invoke_item(target, item)
  1211.     ramiro_m3_invoke_item(target, item)
  1212.     wait(1)
  1213.     $game_party.members.each do |actor|
  1214.       @status_window.make_window_return(actor.index)
  1215.     end
  1216.     wait(1)     
  1217.   end
  1218.  
  1219.   #--------------------------------------------------------------------------
  1220.   # ?
  1221.   #--------------------------------------------------------------------------  
  1222.   def invoke_counter_attack(target, item)
  1223.     @invoked_targets.push << target   
  1224.     target.sprite.battle_show if target.actor?
  1225.     target.animation_id = BattleConfig::Counterattack_AnimationID   
  1226.     ramiro_m3_invoke_counter_attack(target, item)
  1227.   end
  1228.  
  1229.   #--------------------------------------------------------------------------
  1230.   # ?
  1231.   #--------------------------------------------------------------------------
  1232.   def invoke_magic_reflection(target, item)  
  1233.     @invoked_targets.push << target   
  1234.     target.sprite.battle_show if target.actor?
  1235.     target.animation_id = BattleConfig::Reflex_AnimationID
  1236.     ramiro_m3_invoke_magic_reflection(target, item)  
  1237.   end
  1238.  
  1239.   #--------------------------------------------------------------------------
  1240.   # ?
  1241.   #--------------------------------------------------------------------------
  1242.   def apply_substitute(target, item)
  1243.     new_target = ramiro_m3_apply_substitute(target, item)
  1244.     if new_target != target && target.actor? && new_target.actor?
  1245.       @status_window.substitute(target.index, new_target.index)
  1246.       wait(1)
  1247.     end
  1248.     new_target
  1249.   end  
  1250.  
  1251.   alias ramiro_m3_start_party_command_selection start_party_command_selection
  1252.  
  1253.   def start_party_command_selection
  1254.     for battler in $game_party.members
  1255.       battler.sprite_effect_type = $game_troop.turn_count > 0 ? :go_up : :appear
  1256.     end  
  1257.     wait(1)
  1258.     ramiro_m3_start_party_command_selection
  1259.   end  
  1260.  
  1261.   alias ramiro_m3_command_escape command_escape
  1262.  
  1263.   def command_escape
  1264.     for battler in $game_party.members
  1265.       battler.sprite_effect_type = :go_down
  1266.     end  
  1267.     wait(1)
  1268.     ramiro_m3_command_escape
  1269.   end   
  1270.  
  1271.   alias ramiro_m3_turn_start turn_start
  1272.  
  1273.   def turn_start
  1274.     wait(1)
  1275.     @info_viewport.ox = 0
  1276.     for battler in $game_party.members
  1277.       battler.status_window.viewport = @info_viewport if battler.status_window
  1278.       battler.sprite_effect_type = :go_down
  1279.     end  
  1280.     wait(1)
  1281.     ramiro_m3_turn_start
  1282.   end     
  1283.  
  1284. end

SharedScreenshot.jpg (12.91 KB, 下载次数: 23)

SharedScreenshot.jpg

SharedScreenshot.jpg (12.91 KB, 下载次数: 24)

SharedScreenshot.jpg

Lv4.逐梦者

梦石
0
星屑
11352
在线时间
611 小时
注册时间
2016-8-25
帖子
1400

R考场第七期纪念奖

2
发表于 2020-7-4 15:53:35 | 只看该作者

看不见行数啊。。
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv4.逐梦者 (禁止发言)

梦石
0
星屑
5706
在线时间
922 小时
注册时间
2013-8-29
帖子
1468
3
发表于 2020-7-4 15:58:09 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
289
在线时间
28 小时
注册时间
2020-4-6
帖子
8
4
 楼主| 发表于 2020-7-4 16:30:26 | 只看该作者
chanszeman1018 发表于 2020-7-4 15:58
看到又如何??
#--------------------------------------------------------------------------
  # ?

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

使用道具 举报

头像被屏蔽

Lv4.逐梦者 (禁止发言)

梦石
0
星屑
5706
在线时间
922 小时
注册时间
2013-8-29
帖子
1468
5
发表于 2020-7-4 16:39:43 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
289
在线时间
28 小时
注册时间
2020-4-6
帖子
8
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 (12.91 KB, 下载次数: 21)

SharedScreenshot.jpg
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-16 08:24

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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