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

Project1

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

[已经解决] 谁帮我改一下坐标

[复制链接]

Lv1.梦旅人

梦石
0
星屑
199
在线时间
248 小时
注册时间
2012-4-29
帖子
386
跳转到指定楼层
1
发表于 2013-6-2 18:25:52 | 只看该作者 |只看大图 回帖奖励 |正序浏览 |阅读模式

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

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

x
本帖最后由 Sion 于 2013-6-2 20:59 编辑

我用了这个脚本(表示在选择敌人的时候有一个箭头出现在敌人身上而不是在下面选择名字)
坐标乱了    谁帮我改一下  
下面是脚本
  1. #==============================================================================
  2. # ** Victor Engine - Target Arrow
  3. #------------------------------------------------------------------------------
  4. # Author : Victor Sant
  5. #
  6. # Version History:
  7. #  v 1.00 - 2012.01.15 > First relase
  8. #------------------------------------------------------------------------------
  9. #  This script allows to change target selection to a arrow like selection.
  10. # It's possible to make it animated and set different graphics for enemies
  11. # and actors target selections.
  12. # If using the script 'Victor Engine - Loop Animation', it's also possible
  13. # to make the cursor an animation
  14. #------------------------------------------------------------------------------
  15. # Compatibility
  16. #   Requires the script 'Victor Engine - Basic Module' v 1.09 or higher
  17. #   If used with 'Victor Engine - Custom Basic Actions' paste this one bellow
  18. #   it.
  19. #
  20. # * Overwrite methods (Default)
  21. #   class RPG::UsableItem < RPG::BaseItem
  22. #     def need_selection?
  23. #
  24. #   class Window_BattleEnemy < Window_Selectable
  25. #     def show
  26. #     def hide
  27. #     def cursor_movable?
  28. #     def cursor_down(wrap = false)
  29. #     def cursor_up(wrap = false)
  30. #     def cursor_right(wrap = false)
  31. #     def cursor_left(wrap = false)
  32. #     def update_help
  33. #
  34. #   class Window_BattleActor < Window_BattleStatus
  35. #     def cursor_movable?
  36. #     def cursor_down(wrap = false)
  37. #     def cursor_up(wrap = false)
  38. #     def cursor_right(wrap = false)
  39. #     def cursor_left(wrap = false)
  40. #     def update_help
  41. #     def update_cursor
  42. #
  43. # * Alias methods (Default)
  44. #   class Window_BattleEnemy < Window_Selectable
  45. #     def initialize(info_viewport)
  46. #     def update
  47. #     def dispose
  48. #
  49. #   class Window_BattleActor < Window_BattleStatus
  50. #     def initialize(info_viewport)
  51. #     def update
  52. #     def show
  53. #     def hide
  54. #     def update_cursor
  55. #     def dispose
  56. #
  57. #   class Scene_Battle < Scene_Base
  58. #     def create_actor_window
  59. #     def create_enemy_window
  60. #     def command_attack
  61. #     def on_skill_ok
  62. #     def on_item_ok
  63. #     def on_enemy_cancel
  64. #     def on_actor_cancel
  65. #
  66. #------------------------------------------------------------------------------
  67. # Instructions:
  68. #  To instal the script, open you script editor and paste this script on
  69. #  a new section on bellow the Materials section. This script must also
  70. #  be bellow the scripts 'Victor Engine - Basic'
  71. #
  72. #------------------------------------------------------------------------------
  73. # Skills and Items note tags:
  74. #   Tags to be used on Skills and Items note boxes.
  75. #
  76. #  <target description>
  77. #  string
  78. #  </target description>
  79. #   The target description text, the string is the text, to add a break line
  80. #   use \\n.
  81. #
  82. #------------------------------------------------------------------------------
  83. # Additional instructions:
  84. #
  85. #  The cursors graphics must be in the folder Graphics/System.
  86. #
  87. #  To use animations as cursors you need the script  
  88. #  'Victor Engine - Loop Animation' v 1.02 or higher.
  89. #
  90. #==============================================================================

  91. #==============================================================================
  92. # ** Victor Engine
  93. #------------------------------------------------------------------------------
  94. #   Setting module for the Victor Engine
  95. #==============================================================================

  96. module Victor_Engine
  97.   #--------------------------------------------------------------------------
  98.   # * Set the automatic text control codes
  99.   #   when false, it's needed to add \# on the start of the text to use
  100.   #   control codes
  101.   #--------------------------------------------------------------------------
  102.   VE_ARROW_DEFAULT = {
  103.     name:   "Cursor", # Cursor graphic filename ("filename")
  104.     frames: 3,        # Number of frames of the arrow (1 for no animation)
  105.     speed:  20,       # Cursto animation wait time (60 frames = 1 second)
  106.     height: true,     # Adjust arrow based on target height
  107.     help:   true,     # Show help window when selecting target
  108.     x:      15,        # Coordinate x adjust
  109.     y:      35,        # Coordinate y adjust

  110.     move:   0,        # Set move type. 0 : all directions, 1 : left and right
  111.                       # 2 : up and down
  112.     anim:   111,       # Animation ID displayed as arrow. Requires the script
  113.                       # "Victor Engine - Loop Animation", this makes the
  114.                       # arrow a looping battle animation instead of a
  115.                       # simple bitmap graphic
  116.   } # Don't remove
  117.   #--------------------------------------------------------------------------
  118.   # * Custom arrow settings
  119.   #    Set different configuration for arrows based on the window class
  120.   #    it is being shown. It needs to add only the changed values.
  121.   #      type: {setting},
  122.   #      type: actor: or enemy:
  123.   #--------------------------------------------------------------------------
  124.   VE_ARROW_CUSTOM = {
  125.     actor: {name: "Cursor"},
  126.     enemy: {name: "Cursor"},
  127.   } # Don't remove
  128.   #--------------------------------------------------------------------------
  129.   # * Hide skill window during target selection
  130.   #    Since the window is placed above the battlers, the arrow stay behind
  131.   #    the skill window. you can set it false if the window is placed
  132.   #    in a different position with scripts.
  133.   #--------------------------------------------------------------------------
  134.   VE_HIDE_SKILL_WINDOW = true
  135.   #--------------------------------------------------------------------------
  136.   # * Hide item window during target selection
  137.   #    Since the window is placed above the battlers, the arrow stay behind
  138.   #    the item window. you can set it false if the window is placed
  139.   #    in a different position with scripts.
  140.   #--------------------------------------------------------------------------
  141.   VE_HIDE_ITEM_WINDOW = true
  142.   #--------------------------------------------------------------------------
  143.   # * Set the use of target help window
  144.   #--------------------------------------------------------------------------
  145.   VE_USE_TARGET_HELP = true
  146.   #--------------------------------------------------------------------------
  147.   # * Settings for the target help window.
  148.   #--------------------------------------------------------------------------
  149.   VE_TARGET_HELP_WINDOW = {
  150.     text_align:    1,    # Text align, 0: left, 1: center, 2: right
  151.     target_info:   true, # If true show target info, if false show skill name
  152.     all_enemies:   "全部敌人",   # Target info for all enemies actions
  153.     all_actors:    "全部角色",    # Target info for all actors actions
  154.     all_target:    "全部对象",   # Target info for all targets actions
  155.     random_enemy:  "随机 敌人",  # Target info for random enemy actions
  156.     random_actor:  "随机 角色",   # Target info for random actor actions
  157.     random_target: "随机 对象", # Target info for random target actions
  158.   } # Don't remove
  159. end

  160. $imported[:ve_target_arrow] = true

  161. #==============================================================================
  162. # ** RPG::UsableItem
  163. #------------------------------------------------------------------------------
  164. #  This is the superclass for skills and items.
  165. #==============================================================================

  166. class RPG::UsableItem < RPG::BaseItem
  167.   #--------------------------------------------------------------------------
  168.   # * Overwrite method: need_selection?
  169.   #--------------------------------------------------------------------------
  170.   def need_selection?
  171.     @scope > 0
  172.   end
  173. end

  174. #==============================================================================
  175. # ** Window_Selectable
  176. #------------------------------------------------------------------------------
  177. #  This window contains cursor movement and scroll functions.
  178. #==============================================================================

  179. class Window_Selectable < Window_Base
  180.   #--------------------------------------------------------------------------
  181.   # * New method: init_arrow
  182.   #--------------------------------------------------------------------------
  183.   def init_arrow
  184.     [url=home.php?mod=space&uid=333268]@arrows[/url] = []
  185.     @arrows_anim = 0
  186.     @arrows_value = VE_ARROW_CUSTOM.dup
  187.     @arrows_value.default = VE_ARROW_DEFAULT.dup
  188.     @arrows_value.each do |key, value|
  189.       arrow = @arrows_value[key]
  190.       arrow[:x]      = VE_ARROW_DEFAULT[:x]      if !value[:x]
  191.       arrow[:y]      = VE_ARROW_DEFAULT[:y]      if !value[:y]
  192.       arrow[:name]   = VE_ARROW_DEFAULT[:name]   if !value[:name]
  193.       arrow[:frames] = VE_ARROW_DEFAULT[:frames] if !value[:frames]
  194.       arrow[:rect]   = VE_ARROW_DEFAULT[:rect]   if !value[:rect]
  195.       arrow[:speed]  = VE_ARROW_DEFAULT[:speed]  if !value[:speed]
  196.       arrow[:anim]   = VE_ARROW_DEFAULT[:anim]   if !value[:anim]
  197.       arrow[:move]   = VE_ARROW_DEFAULT[:move]   if !value[:move]
  198.       arrow[:height] = VE_ARROW_DEFAULT[:height] if !value[:height]
  199.     end
  200.   end
  201.   #--------------------------------------------------------------------------
  202.   # * New method: init_arrow_sprite
  203.   #--------------------------------------------------------------------------
  204.   def init_arrow_sprite(forced = false)
  205.     dispose_arrow if @arrows_index != @index || forced
  206.     return unless self.active
  207.     if target_all?
  208.       item_max.times {|i| create_arrow_sprite(i) }
  209.     elsif @index > -1
  210.       create_arrow_sprite(0)
  211.     end
  212.     @arrows_index = @index
  213.     update_arrow_sprite
  214.   end
  215.   #--------------------------------------------------------------------------
  216.   # * New method: target_all?
  217.   #--------------------------------------------------------------------------
  218.   def target_all?
  219.     @action && (@action.for_all? || @action.for_random?)
  220.   end
  221.   #--------------------------------------------------------------------------
  222.   # * New method: target_self?
  223.   #--------------------------------------------------------------------------
  224.   def target_self?
  225.     @action && @action.for_user?
  226.   end
  227.   #--------------------------------------------------------------------------
  228.   # * New method: create_arrow_sprite
  229.   #--------------------------------------------------------------------------
  230.   def create_arrow_sprite(i)
  231.     return if @arrows[i]
  232.     @arrows[i] = Sprite_Base.new
  233.     @arrows[i].bitmap = Cache.system(arrow_filename)
  234.   end
  235.   #--------------------------------------------------------------------------
  236.   # * New method: arrow_animation
  237.   #--------------------------------------------------------------------------
  238.   def arrow_animation?
  239.     arrow_animation != 0 && $imported[:ve_loop_animation]
  240.   end
  241.   #--------------------------------------------------------------------------
  242.   # * New method: update_arrow_sprite
  243.   #--------------------------------------------------------------------------
  244.   def update_arrow_sprite
  245.     @arrows.each_index do |i|
  246.       next unless @arrows[i]
  247.       @arrows[i].viewport = sprite(target(i)).viewport
  248.       arrow_animation? ? set_arrow_animation(i) : set_arrow_bitmap(i)
  249.       update_arrow_position(i)
  250.     end
  251.     update_all_arrows
  252.   end
  253.   #--------------------------------------------------------------------------
  254.   # * New method: set_arrow_bitmap
  255.   #--------------------------------------------------------------------------
  256.   def set_arrow_bitmap(i)
  257.     bitmap = @arrows[i].bitmap
  258.     arrow_width   = bitmap.width / arrow_frames
  259.     current_frame = arrow_width * @arrows_anim
  260.     @arrows[i].src_rect.set(current_frame, 0, arrow_width, bitmap.height)
  261.   end
  262.   #--------------------------------------------------------------------------
  263.   # * New method: set_arrow_animation
  264.   #--------------------------------------------------------------------------
  265.   def set_arrow_animation(i)
  266.     target = target(i)
  267.     return if !target || sprite(target).loop_anim?(:arrow)
  268.     settings = {anim: arrow_animation, type: :arrow, loop: 1}
  269.     sprite(target).add_loop_animation(settings)
  270.   end
  271.   #--------------------------------------------------------------------------
  272.   # * New method: update_arrow_position
  273.   #--------------------------------------------------------------------------
  274.   def update_arrow_position(i)
  275.     adjust = arrow_height ? sprite(target(i)).oy / 2 : 0
  276.     @arrows[i].x  = target(i).screen_x + arrow_x
  277.     @arrows[i].y  = target(i).screen_y + arrow_y - adjust
  278.     @arrows[i].z  = self.z + 100
  279.     @arrows[i].ox = @arrows[i].width  / 2
  280.     @arrows[i].oy = @arrows[i].height / 2
  281.   end
  282.   #--------------------------------------------------------------------------
  283.   # * New method: update_all_arrows
  284.   #--------------------------------------------------------------------------
  285.   def update_all_arrows
  286.     @arrows.each {|arrow| arrow.update }
  287.   end
  288.   #--------------------------------------------------------------------------
  289.   # * New method: sprite
  290.   #--------------------------------------------------------------------------
  291.   def sprite(subject)
  292.     SceneManager.scene.spriteset.sprite(subject)
  293.   end
  294.   #--------------------------------------------------------------------------
  295.   # * New method: arrow_frames
  296.   #--------------------------------------------------------------------------
  297.   def target_window_type
  298.     self.instance_of?(Window_BattleEnemy) ? :enemy : :actor
  299.   end
  300.   #--------------------------------------------------------------------------
  301.   # * New method: arrow_filename
  302.   #--------------------------------------------------------------------------
  303.   def arrow_filename
  304.     arrow_animation? ? "" : @arrows_value[target_window_type][:name]
  305.   end
  306.   #--------------------------------------------------------------------------
  307.   # * New method: arrow_frames
  308.   #--------------------------------------------------------------------------
  309.   def arrow_frames
  310.     [@arrows_value[target_window_type][:frames], 1].max
  311.   end
  312.   #--------------------------------------------------------------------------
  313.   # * New method: arrow_old_rect
  314.   #--------------------------------------------------------------------------
  315.   def arrow_old_rect
  316.     @arrows_value[target_window_type][:rect]
  317.   end
  318.   #--------------------------------------------------------------------------
  319.   # * New method: arrow_animspeed
  320.   #--------------------------------------------------------------------------
  321.   def arrow_animspeed
  322.     [@arrows_value[target_window_type][:speed], 1].max
  323.   end
  324.   #--------------------------------------------------------------------------
  325.   # * New method: arrow_x
  326.   #--------------------------------------------------------------------------
  327.   def arrow_x
  328.     @arrows_value[target_window_type][:x]
  329.   end
  330.   #--------------------------------------------------------------------------
  331.   # * New method: arrow_y
  332.   #--------------------------------------------------------------------------
  333.   def arrow_y
  334.     @arrows_value[target_window_type][:y]
  335.   end
  336.   #--------------------------------------------------------------------------
  337.   # * New method: arrow_animation
  338.   #--------------------------------------------------------------------------
  339.   def arrow_animation
  340.     @arrows_value[target_window_type][:anim]
  341.   end
  342.   #--------------------------------------------------------------------------
  343.   # * New method: arrow_height
  344.   #--------------------------------------------------------------------------
  345.   def arrow_height
  346.     @arrows_value[target_window_type][:height]
  347.   end
  348.   #--------------------------------------------------------------------------
  349.   # * New method: arrow_move
  350.   #--------------------------------------------------------------------------
  351.   def arrow_move
  352.     @arrows_value[target_window_type][:move]
  353.   end
  354.   #--------------------------------------------------------------------------
  355.   # * New method: help_info
  356.   #--------------------------------------------------------------------------
  357.   def help_info
  358.     VE_TARGET_HELP_WINDOW
  359.   end
  360.   #--------------------------------------------------------------------------
  361.   # * New method: target_description
  362.   #--------------------------------------------------------------------------
  363.   def target_description
  364.     return "" unless @action
  365.     value  = "TARGET DESCRIPTION"
  366.     regexp = /<#{value}>((?:[^<]|<[^\/])*)<\/#{value}>/im
  367.     text   = ""
  368.     @action.note.scan(regexp) do
  369.       info = $1.dup
  370.       info.gsub!(/\r\n/) { "" }
  371.       info.gsub!(/\\n/)  { "\r\n" }
  372.       text += info
  373.     end
  374.     text
  375.   end
  376.   #--------------------------------------------------------------------------
  377.   # * New method: update_target_help
  378.   #--------------------------------------------------------------------------  
  379.   def update_target_help
  380.     text  = target_description
  381.     align = help_info[:text_align]
  382.     @help_window.visible = true
  383.     if text != ""
  384.       @help_window.set_info_text(text, align)
  385.     else
  386.       if help_info[:target_info]
  387.         draw_tartge_info(align)
  388.       else
  389.         @help_window.set_item_text(@action, align)
  390.       end
  391.     end
  392.   end
  393.   #--------------------------------------------------------------------------
  394.   # * New method: draw_tartge_inf
  395.   #--------------------------------------------------------------------------  
  396.   def draw_tartge_info(align)
  397.     if @action.for_one?
  398.       @help_window.set_target_text(target(0), align)
  399.     elsif @action.for_all? && @action.for_random?
  400.       text = help_info[:random_enemies] if @action.for_opponent?
  401.       text = help_info[:random_actors]  if @action.for_friend?
  402.       text = help_info[:random_target]  if @action.for_all_targets?
  403.       @help_window.set_info_text(text, align)
  404.     elsif @action.for_all? && [email protected]_random?
  405.       text = help_info[:all_enemies] if @action.for_opponent?
  406.       text = help_info[:all_actors]  if @action.for_friend?
  407.       text = help_info[:all_target]  if @action.for_all_targets?
  408.       @help_window.set_info_text(text, align)
  409.     end
  410.   end
  411. end

  412. #==============================================================================
  413. # ** Window_Help
  414. #------------------------------------------------------------------------------
  415. #  This window shows skill and item explanations along with actor status.
  416. #==============================================================================

  417. class Window_Help < Window_Base
  418.   #--------------------------------------------------------------------------
  419.   # * New method: set_target_text
  420.   #--------------------------------------------------------------------------
  421.   def set_target_text(target, align = 0)
  422.     if target != @target || @target.name != @text
  423.       @text   = ""
  424.       @target = target
  425.       @align  = align
  426.       target_info
  427.     end
  428.   end
  429.   #--------------------------------------------------------------------------
  430.   # * New method: set_info_text
  431.   #--------------------------------------------------------------------------
  432.   def set_info_text(text, align = 0)
  433.     if text != @text
  434.       @text = text
  435.       contents.clear
  436.       adj = @text[/\r\n/i]
  437.       draw_text(0, 0, width, line_height * (adj ? 1 : 2), @text, align)
  438.     end
  439.   end
  440.   #--------------------------------------------------------------------------
  441.   # * New method: set_item_text
  442.   #--------------------------------------------------------------------------
  443.   def set_item_text(item, align = 0)
  444.     if item.name != @text
  445.       @text = item.name
  446.       contents.clear
  447.       iw = item.icon_index == 0 ? 0 : 24
  448.       text_width = text_size(@text).width
  449.       x = align == 0 ? 0 : (contents_width - 24 - text_width) / (3 - align)
  450.       draw_icon(item.icon_index, x, line_height / 2, true)
  451.       draw_text(iw + 2, 0, contents_width - iw, line_height * 2, @text, align)
  452.     end
  453.   end
  454.   #--------------------------------------------------------------------------
  455.   # * New method: target_info
  456.   #--------------------------------------------------------------------------
  457.   def target_info
  458.     contents.clear
  459.     change_color(hp_color(@target))
  460.     adj = (@target.state_icons + @target.buff_icons).size == 0
  461.     height = line_height * (adj ? 2 : 1)
  462.     draw_text(0, 0, contents_width, height, @target.name, @align)
  463.     draw_target_icons
  464.   end
  465.   #--------------------------------------------------------------------------
  466.   # * New method: draw_target_icons
  467.   #--------------------------------------------------------------------------
  468.   def draw_target_icons
  469.     icons = (@target.state_icons + @target.buff_icons)[0, contents_width / 24]
  470.     x = @align == 0 ? 0 : (contents_width - icons.size * 24) / (3 - @align)
  471.     icons.each_with_index {|n, i| draw_icon(n, x + 24 * i, line_height) }
  472.   end
  473. end

  474. #==============================================================================
  475. # ** Window_BattleEnemy
  476. #------------------------------------------------------------------------------
  477. #  This window display a list of enemies on the battle screen.
  478. #==============================================================================

  479. class Window_BattleEnemy < Window_Selectable
  480.   #--------------------------------------------------------------------------
  481.   # * Overwrite method: show
  482.   #--------------------------------------------------------------------------
  483.   def show
  484.     result = super
  485.     select(0)
  486.     init_arrow_sprite(true)
  487.     self.visible = false
  488.     result


  489.   end
  490.   #--------------------------------------------------------------------------
  491.   # * Overwrite method: hide
  492.   #--------------------------------------------------------------------------
  493.   def hide
  494.     result = super
  495.     dispose_arrow
  496.     result
  497.   end
  498.   #--------------------------------------------------------------------------
  499.   # * Overwrite method: cursor_movable?
  500.   #--------------------------------------------------------------------------
  501.   def cursor_movable?
  502.     active && !cursor_all && !target_all? && !target_self?
  503.   end
  504.   #--------------------------------------------------------------------------
  505.   # * Overwrite method: cursor_down
  506.   #--------------------------------------------------------------------------
  507.   def cursor_down(wrap = false)
  508.     select((index + 1) % item_max) if arrow_move != 1
  509.   end
  510.   #--------------------------------------------------------------------------
  511.   # * Overwrite method: cursor_up
  512.   #--------------------------------------------------------------------------
  513.   def cursor_up(wrap = false)
  514.     select((index - 1 + item_max) % item_max) if arrow_move != 1
  515.   end
  516.   #--------------------------------------------------------------------------
  517.   # * Overwrite method: cursor_right
  518.   #--------------------------------------------------------------------------
  519.   def cursor_right(wrap = false)
  520.     select((index + 1) % item_max) if arrow_move != 2
  521.   end
  522.   #--------------------------------------------------------------------------
  523.   # * Overwrite method: cursor_left
  524.   #--------------------------------------------------------------------------
  525.   def cursor_left(wrap = false)
  526.     select((index - 1 + item_max) % item_max) if arrow_move != 2
  527.   end
  528.   #--------------------------------------------------------------------------
  529.   # * Overwrite method: update_help
  530.   #--------------------------------------------------------------------------
  531.   def update_help
  532.     update_target_help
  533.   end
  534.   #--------------------------------------------------------------------------
  535.   # * New method: update_target_help
  536.   #--------------------------------------------------------------------------  
  537.   def update_target_help
  538.     text  = target_description
  539.     align = help_info[:text_align]

  540.     @help_window.opacity = 0

  541.     @help_window.y += 35

  542.     @help_window.visible = true
  543.     if text != ""
  544.       @help_window.set_info_text(text, align)
  545.     else
  546.       if help_info[:target_info]
  547.         draw_tartge_info(align)
  548.       else
  549.         @help_window.set_item_text(@action, align)
  550.       end
  551.     end
  552.   end
  553.   #--------------------------------------------------------------------------
  554.   # * Alias method: initialize
  555.   #--------------------------------------------------------------------------
  556.   alias :initialize_ve_arrow_arrow :initialize
  557.   def initialize(info_viewport)
  558.     initialize_ve_arrow_arrow(info_viewport)
  559.     init_arrow
  560.   end
  561.   #--------------------------------------------------------------------------
  562.   # * Alias method: update
  563.   #--------------------------------------------------------------------------
  564.   alias :update_ve_arrow_arrow :update
  565.   def update
  566.     update_ve_arrow_arrow
  567.     init_arrow_sprite
  568.     update_arrow_sprite
  569.     return if Graphics.frame_count % arrow_animspeed != 0
  570.     @arrows_anim = (@arrows_anim + 1) % arrow_frames
  571.   end
  572.   #--------------------------------------------------------------------------
  573.   # * Alias method: dispose
  574.   #--------------------------------------------------------------------------
  575.   alias :dispose_ve_arrow_arrow :dispose
  576.   def dispose
  577.     dispose_ve_arrow_arrow
  578.     dispose_arrow
  579.   end
  580.   #--------------------------------------------------------------------------
  581.   # * New method: init_arrow
  582.   #--------------------------------------------------------------------------
  583.   def set_action(action)
  584.     @action = action
  585.   end
  586.   #--------------------------------------------------------------------------
  587.   # * New method: enemies
  588.   #--------------------------------------------------------------------------
  589.   def enemies
  590.     $game_troop.alive_members
  591.   end
  592.   #--------------------------------------------------------------------------
  593.   # * New method: target
  594.   #--------------------------------------------------------------------------
  595.   def target(i)
  596.     target_all? ? enemies[i] : enemy
  597.   end
  598.   #--------------------------------------------------------------------------
  599.   # * New method: dispose_arrow
  600.   #--------------------------------------------------------------------------
  601.   def dispose_arrow
  602.     if arrow_animation?
  603.       enemies.each {|enemy| sprite(enemy).end_loop_anim(:arrow) }
  604.     end
  605.     @arrows.each {|arrow| arrow.dispose }
  606.     @arrows.clear
  607.   end
  608. end

  609. #==============================================================================
  610. # ** Window_BattleActor
  611. #------------------------------------------------------------------------------
  612. #  This window display a list of actors on the battle screen.
  613. #==============================================================================

  614. class Window_BattleActor < Window_BattleStatus
  615.   #--------------------------------------------------------------------------
  616.   # * Overwrite method: cursor_movable?
  617.   #--------------------------------------------------------------------------
  618.   def cursor_movable?
  619.     active && !cursor_all && !target_all? && !target_self?
  620.   end
  621.   #--------------------------------------------------------------------------
  622.   # * Overwrite method: cursor_down
  623.   #--------------------------------------------------------------------------
  624.   def cursor_down(wrap = false)
  625.     return if show_actor && arrow_move == 1
  626.     show_actor ? select((index + 1) % item_max) : super
  627.   end
  628.   #--------------------------------------------------------------------------
  629.   # * Overwrite method: cursor_up
  630.   #--------------------------------------------------------------------------
  631.   def cursor_up(wrap = false)
  632.     return if show_actor && arrow_move == 1
  633.     show_actor ? select((index - 1 + item_max) % item_max) : super
  634.   end
  635.   #--------------------------------------------------------------------------
  636.   # * Overwrite method: cursor_right(
  637.   #--------------------------------------------------------------------------
  638.   def cursor_right(wrap = false)
  639.     return if show_actor && arrow_move == 2
  640.     show_actor ? select((index + 1) % item_max) : super
  641.   end
  642.   #--------------------------------------------------------------------------
  643.   # * Overwrite method: cursor_left
  644.   #--------------------------------------------------------------------------
  645.   def cursor_left(wrap = false)
  646.     return if show_actor && arrow_move == 2
  647.     show_actor ? select((index - 1 + item_max) % item_max) :  super
  648.   end
  649.   #--------------------------------------------------------------------------
  650.   # * Overwrite method: update_help
  651.   #--------------------------------------------------------------------------
  652.   def update_help
  653.     update_target_help
  654.   end
  655.   #--------------------------------------------------------------------------
  656.   # * Overwrite method: initialize
  657.   #--------------------------------------------------------------------------
  658.   def update_cursor
  659.     @cursor_all = cursor_all
  660.     super
  661.   end
  662.   #--------------------------------------------------------------------------
  663.   # * Alias method: initialize
  664.   #--------------------------------------------------------------------------
  665.   alias :initialize_ve_arrow_arrow :initialize
  666.   def initialize(info_viewport)
  667.     initialize_ve_arrow_arrow(info_viewport)
  668.     init_arrow if show_actor
  669.   end
  670.   #--------------------------------------------------------------------------
  671.   # * Alias method: update
  672.   #--------------------------------------------------------------------------
  673.   alias :update_ve_arrow_arrow :update
  674.   def update
  675.     update_ve_arrow_arrow
  676.     return unless show_actor
  677.     init_arrow_sprite
  678.     update_arrow_sprite
  679.     return if Graphics.frame_count % arrow_animspeed != 0
  680.     @arrows_anim = (@arrows_anim + 1) % arrow_frames
  681.   end
  682.   #--------------------------------------------------------------------------
  683.   # * Alias method: show
  684.   #--------------------------------------------------------------------------
  685.   alias :show_ve_arrow_arrow :show
  686.   def show
  687.     if show_actor
  688.       result = super
  689.       self.visible = false
  690.       select(0)
  691.       result
  692.     else
  693.       show_ve_arrow_arrow
  694.     end
  695.   end
  696.   #--------------------------------------------------------------------------
  697.   # * Alias method: hide
  698.   #--------------------------------------------------------------------------
  699.   alias :hide_ve_arrow_arrow :hide
  700.   def hide
  701.     result = hide_ve_arrow_arrow
  702.     dispose_arrow if show_actor
  703.     result
  704.   end
  705.   #--------------------------------------------------------------------------
  706.   # * Alias method: dispose
  707.   #--------------------------------------------------------------------------
  708.   alias :update_cursor_ve_arrow_arrow :update_cursor
  709.   def update_cursor
  710.     show_actor ? cursor_rect.empty : update_cursor_ve_arrow_arrow
  711.   end
  712.   #--------------------------------------------------------------------------
  713.   # * Alias method: dispose
  714.   #--------------------------------------------------------------------------
  715.   alias :dispose_ve_arrow_arrow :dispose
  716.   def dispose
  717.     dispose_ve_arrow_arrow
  718.     dispose_arrow if show_actor
  719.   end
  720.   #--------------------------------------------------------------------------
  721.   # * New method: set_action
  722.   #--------------------------------------------------------------------------
  723.   def set_action(action)
  724.     @action = action
  725.   end
  726.   #--------------------------------------------------------------------------
  727.   # * New method: cursor_all
  728.   #--------------------------------------------------------------------------
  729.   def cursor_all
  730.     @action && @action.for_all?
  731.   end
  732.   #--------------------------------------------------------------------------
  733.   # * New method: actor
  734.   #--------------------------------------------------------------------------
  735.   def actor
  736.     $game_party.battle_members[@index]
  737.   end
  738.   #--------------------------------------------------------------------------
  739.   # * New method: actors
  740.   #--------------------------------------------------------------------------
  741.   def actors
  742.     $game_party.battle_members
  743.   end
  744.   #--------------------------------------------------------------------------
  745.   # * New method: target
  746.   #--------------------------------------------------------------------------
  747.   def target(i)
  748.     target_all? ? actors[i] : actor
  749.   end
  750.   #--------------------------------------------------------------------------
  751.   # * New method: show_actor
  752.   #--------------------------------------------------------------------------
  753.   def show_actor
  754.     $imported[:ve_actor_battlers]
  755.   end
  756.   #--------------------------------------------------------------------------
  757.   # * New method: dispose_arrow
  758.   #--------------------------------------------------------------------------
  759.   def dispose_arrow
  760.     if arrow_animation?
  761.       actors.each {|actor| sprite(actor).end_loop_anim(:arrow) }
  762.     end
  763.     @arrows.each {|arrow| arrow.dispose }
  764.     @arrows.clear
  765.   end
  766. end

  767. #==============================================================================
  768. # ** Scene_Battle
  769. #------------------------------------------------------------------------------
  770. #  This class performs battle screen processing.
  771. #==============================================================================

  772. class Scene_Battle < Scene_Base
  773.   #--------------------------------------------------------------------------
  774.   # * Alias method: create_actor_window
  775.   #--------------------------------------------------------------------------
  776.   alias :create_actor_window_ve_arrow_arrow :create_actor_window
  777.   def create_actor_window
  778.     create_actor_window_ve_arrow_arrow
  779.     @actor_window.help_window = @help_window if VE_USE_TARGET_HELP
  780.   end
  781.   #--------------------------------------------------------------------------
  782.   # * Alias method: create_enemy_window
  783.   #--------------------------------------------------------------------------
  784.   alias :create_enemy_window_ve_arrow_arrow :create_enemy_window
  785.   def create_enemy_window
  786.     create_enemy_window_ve_arrow_arrow
  787.     @enemy_window.help_window = @help_window if VE_USE_TARGET_HELP
  788.   end
  789.   #--------------------------------------------------------------------------
  790.   # * Alias method: command_attack
  791.   #--------------------------------------------------------------------------
  792.   alias :command_attack_ve_arrow_arrow :command_attack
  793.   def command_attack
  794.     set_window_action($data_skills[BattleManager.actor.attack_skill_id])
  795.     command_attack_ve_arrow_arrow
  796.   end
  797.   #--------------------------------------------------------------------------
  798.   # * Alias method: on_skill_ok
  799.   #--------------------------------------------------------------------------
  800.   alias :on_skill_ok_ve_arrow_arrow :on_skill_ok
  801.   def on_skill_ok
  802.     set_window_action(@skill_window.item)
  803.     on_skill_ok_ve_arrow_arrow
  804.     @skill_window.visible = false if VE_HIDE_SKILL_WINDOW
  805.   end
  806.   #--------------------------------------------------------------------------
  807.   # * Alias method: on_item_ok
  808.   #--------------------------------------------------------------------------
  809.   alias :on_item_ok_ve_arrow_arrow :on_item_ok
  810.   def on_item_ok
  811.     set_window_action(@item_window.item)
  812.     on_item_ok_ve_arrow_arrow
  813.     @item_window.visible = false if VE_HIDE_ITEM_WINDOW
  814.   end
  815.   #--------------------------------------------------------------------------
  816.   # * Alias method: on_enemy_cancel
  817.   #--------------------------------------------------------------------------
  818.   alias :on_enemy_cancel_ve_arrow_arrow :on_enemy_cancel
  819.   def on_enemy_cancel
  820.     on_enemy_cancel_ve_arrow_arrow
  821.     case @actor_command_window.current_symbol
  822.     when :attack then @help_window.visible  = false
  823.     when :skill  then @skill_window.visible = true
  824.     when :item   then @item_window.visible  = true
  825.     end
  826.   end
  827.   #--------------------------------------------------------------------------
  828.   # * Alias method: on_actor_cancel
  829.   #--------------------------------------------------------------------------
  830.   alias :on_actor_cancel_ve_arrow_arrow :on_actor_cancel
  831.   def on_actor_cancel
  832.     on_actor_cancel_ve_arrow_arrow
  833.     case @actor_command_window.current_symbol
  834.     when :attack then @help_window.visible  = false
  835.     when :skill  then @skill_window.visible = true
  836.     when :item   then @item_window.visible  = true
  837.     end
  838.   end
  839.   #--------------------------------------------------------------------------
  840.   # * New method: set_window_action
  841.   #--------------------------------------------------------------------------
  842.   def set_window_action(item)
  843.     @enemy_window.set_action(item) if item.for_opponent?
  844.     @enemy_window.update_help      if item.for_opponent?
  845.     @actor_window.set_action(item) if item.for_friend?
  846.     @actor_window.update_help      if item.for_friend?
  847.   end
  848. end
复制代码

YN[@C_GKKI$LIF[703B$C.jpg (95.12 KB, 下载次数: 12)

YN[@C_GKKI$LIF[703B$C.jpg

点评

请用<代码>功能贴脚本,并确认给出的脚本能够单独运行。  发表于 2013-6-2 20:27
你的意思就是要打架咯?

Lv1.梦旅人

梦石
0
星屑
199
在线时间
248 小时
注册时间
2012-4-29
帖子
386
2
 楼主| 发表于 2013-6-2 21:23:19 | 只看该作者
好吧   自己已改好!!!!!!
你的意思就是要打架咯?
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-18 16:31

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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