查看: 3373|回复: 17

[已经解决] 怎么去掉战斗信息和脸图战斗改TP槽的位置

[复制链接]
梦石
0
星屑
750
在线时间
228 小时
注册时间
2009-2-19
回帖
171
发表于 2017-9-25 22:02:36 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 根五 于 2017-9-29 14:47 编辑

如题脸图战斗怎么把TP槽改到MP下面啊?我觉得好像是被限制在脸图的范围内了

  1. $脸图战斗 = true
  2. $imported = {} if $imported.nil?
  3. module YEA
  4.   module BATTLE
  5.     SKIP_PARTY_COMMAND = true
  6.     BATTLESTATUS_NAME_FONT_SIZE = 20
  7.     BATTLESTATUS_TEXT_FONT_SIZE = 16
  8.     BATTLESTATUS_NO_ACTION_ICON = 185
  9.     BATTLESTATUS_HPGAUGE_Y_PLUS = 11
  10.     BATTLESTATUS_CENTER_FACES   = false
  11.     HELP_TEXT_ALL_FOES        = "全体敌人"
  12.     HELP_TEXT_ONE_RANDOM_FOE  = "单个敌人"
  13.     HELP_TEXT_MANY_RANDOM_FOE = "%d个随机敌人"
  14.     HELP_TEXT_ALL_ALLIES      = "全体队友"
  15.     HELP_TEXT_ALL_DEAD_ALLIES = "全体死亡队友"
  16.     HELP_TEXT_ONE_RANDOM_ALLY = "单个随机队友"
  17.     HELP_TEXT_RANDOM_ALLIES   = "%d个随机队友"
  18.   end
  19. end
  20. class Game_Battler
  21.   def can_collapse?
  22.     return false unless dead?
  23.     unless actor?
  24.       return false unless sprite.battler_visible
  25.       array = [:collapse, :boss_collapse, :instant_collapse]
  26.       return false if array.include?(sprite.effect_type)
  27.     end
  28.     return true
  29.   end
  30.   def draw_mp?
  31.     return true
  32.   end
  33.   def draw_tp?
  34.     return $data_system.opt_display_tp
  35.   end
  36. end
  37. module Icon
  38.   def self.no_action; return YEA::BATTLE::BATTLESTATUS_NO_ACTION_ICON; end
  39. end
  40. class Game_Temp
  41.   attr_accessor :battle_aid
  42.   attr_accessor :evaluating
  43. end
  44. class Game_Action
  45.   alias evaluate_item_with_target_abe evaluate_item_with_target
  46.   def evaluate_item_with_target(target)
  47.     $game_temp.evaluating = true
  48.     result = evaluate_item_with_target_abe(target)
  49.     $game_temp.evaluating = false
  50.     return result
  51.   end
  52. end
  53. class Game_Actor < Game_Battler
  54.   def draw_mp?
  55.     return true unless draw_tp?
  56.     for skill in skills
  57.       next unless added_skill_types.include?(skill.stype_id)
  58.       return true if skill.mp_cost > 0
  59.     end
  60.     return false
  61.   end
  62.   def draw_tp?
  63.     return false unless $data_system.opt_display_tp
  64.     for skill in skills
  65.       next unless added_skill_types.include?(skill.stype_id)
  66.       return true if skill.tp_cost > 0
  67.     end
  68.     return false
  69.   end
  70. end
  71. class Window_BattleStatus < Window_Selectable
  72.   def initialize
  73.     super(0, 0, window_width, window_height)
  74.     self.openness = 0
  75.     self.opacity = 0
  76.     @party = $game_party.battle_members.clone
  77.   end
  78.   def col_max; return $game_party.max_battle_members; end
  79.   def battle_members; return $game_party.battle_members; end
  80.   def actor; return battle_members[@index]; end
  81.   def update
  82.     super
  83.     return if @party == $game_party.battle_members
  84.     @party = $game_party.battle_members.clone
  85.     refresh
  86.   end
  87.   def draw_item(index)
  88.     return if index.nil?
  89.     clear_item(index)
  90.     actor = battle_members[index]
  91.     rect = item_rect(index)
  92.     return if actor.nil?
  93.     draw_actor_face(actor, rect.x+2, rect.y+2, actor.alive?)
  94.     draw_actor_name(actor, rect.x, rect.y, rect.width-8)
  95.     draw_actor_action(actor, rect.x, rect.y)
  96.     draw_actor_icons(actor, rect.x, line_height*1, rect.width)
  97.     gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
  98.     contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
  99.     draw_actor_hp(actor, rect.x+2, line_height*2+gx, rect.width-4)
  100.     if draw_tp?(actor) && draw_mp?(actor)
  101.       dw = rect.width/2-2
  102.       dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE
  103.       draw_actor_tp(actor, rect.x+2, line_height*3, dw)
  104.       dw = rect.width - rect.width/2 - 2
  105.       draw_actor_mp(actor, rect.x+rect.width/2, line_height*3, dw)
  106.     elsif draw_tp?(actor) && !draw_mp?(actor)
  107.       draw_actor_tp(actor, rect.x+2, line_height*3, rect.width-4)
  108.     else
  109.       draw_actor_mp(actor, rect.x+2, line_height*3, rect.width-4)
  110.     end
  111.   end
  112.   def item_rect(index)
  113.     rect = Rect.new
  114.     rect.width = contents.width / $game_party.max_battle_members
  115.     rect.height = contents.height
  116.     rect.x = index * rect.width
  117.     if YEA::BATTLE::BATTLESTATUS_CENTER_FACES
  118.       rect.x += (contents.width - $game_party.members.size * rect.width) / 2
  119.     end
  120.     rect.y = 0
  121.     return rect
  122.   end
  123.   def draw_face(face_name, face_index, dx, dy, enabled = true)
  124.     bitmap = Cache.face(face_name)
  125.     fx = [(96 - item_rect(0).width + 1) / 2, 0].max
  126.     fy = face_index / 4 * 96 + 2
  127.     fw = [item_rect(0).width - 4, 92].min
  128.     rect = Rect.new(fx, fy, fw, 92)
  129.     rect = Rect.new(face_index % 4 * 96 + fx, fy, fw, 92)#这里
  130.     contents.blt(dx, dy, bitmap, rect, enabled ? 255 : translucent_alpha)
  131.     bitmap.dispose
  132.   end
  133.   def draw_actor_name(actor, dx, dy, dw = 112)
  134.     reset_font_settings
  135.     contents.font.size = YEA::BATTLE::BATTLESTATUS_NAME_FONT_SIZE
  136.     change_color(hp_color(actor))
  137.     draw_text(dx+24, dy, dw-24, line_height, actor.name)
  138.   end
  139.   def draw_actor_action(actor, dx, dy)
  140.     draw_icon(action_icon(actor), dx, dy)
  141.   end
  142.   def action_icon(actor)
  143.     return Icon.no_action if actor.current_action.nil?
  144.     return Icon.no_action if actor.current_action.item.nil?
  145.     return actor.current_action.item.icon_index
  146.   end
  147.   def draw_tp?(actor)
  148.     return actor.draw_tp?
  149.   end
  150.   def draw_mp?(actor)
  151.     return actor.draw_mp?
  152.   end
  153.   def draw_current_and_max_values(dx, dy, dw, current, max, color1, color2)
  154.     change_color(color1)
  155.     draw_text(dx, dy, dw, line_height, current.to_s, 2)
  156.   end
  157.   def draw_actor_hp(actor, dx, dy, width = 124)
  158.     draw_gauge(dx, dy, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  159.     change_color(system_color)
  160.     cy = (Font.default_size - contents.font.size) / 2 + 1
  161.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::hp_a)
  162.     draw_current_and_max_values(dx, dy+cy, width, actor.hp, actor.mhp,
  163.       hp_color(actor), normal_color)
  164.     end
  165.   def draw_actor_mp(actor, dx, dy, width = 124)
  166.     draw_gauge(dx, dy, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  167.     change_color(system_color)
  168.     cy = (Font.default_size - contents.font.size) / 2 + 1
  169.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a)
  170.     draw_current_and_max_values(dx, dy+cy, width, actor.mp, actor.mmp,
  171.       mp_color(actor), normal_color)
  172.     end
  173.   def draw_actor_tp(actor, dx, dy, width = 124)
  174.     draw_gauge(dx, dy, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  175.     change_color(system_color)
  176.     cy = (Font.default_size - contents.font.size) / 2 + 1
  177.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::tp_a)
  178.     change_color(tp_color(actor))
  179.     draw_text(dx + width - 42, dy+cy, 42, line_height, actor.tp.to_i, 2)
  180.   end
  181. end
  182. class Window_BattleActor < Window_BattleStatus
  183.   def show
  184.     create_flags
  185.     super
  186.   end
  187.   def create_flags
  188.     set_select_flag(:any)
  189.     select(0)
  190.     return if $game_temp.battle_aid.nil?
  191.     if $game_temp.battle_aid.need_selection?
  192.       select(0)
  193.       set_select_flag(:dead) if $game_temp.battle_aid.for_dead_friend?
  194.     elsif $game_temp.battle_aid.for_user?
  195.       battler = BattleManager.actor
  196.       id = battler.nil? ? 0 : $game_party.battle_members.index(battler)
  197.       select(id)
  198.       set_select_flag(:user)
  199.     elsif $game_temp.battle_aid.for_all?
  200.       select(0)
  201.       set_select_flag(:all)
  202.       set_select_flag(:all_dead) if $game_temp.battle_aid.for_dead_friend?
  203.     elsif $game_temp.battle_aid.for_random?
  204.       select(0)
  205.       set_select_flag(:random) if $game_temp.battle_aid.for_random?
  206.     end
  207.   end
  208.   def set_select_flag(flag)
  209.     @select_flag = flag
  210.     case @select_flag
  211.     when :all, :all_dead, :random
  212.       @cursor_all = true
  213.     else
  214.       @cursor_all = false
  215.     end
  216.   end
  217.   def update_cursor
  218.     if @cursor_all
  219.       cursor_rect.set(0, 0, contents.width, contents.height)
  220.       self.top_row = 0
  221.     elsif @index < 0
  222.       cursor_rect.empty
  223.     else
  224.       ensure_cursor_visible
  225.       cursor_rect.set(item_rect(@index))
  226.     end
  227.   end
  228.   def cursor_movable?
  229.     return false if @select_flag == :user
  230.     return super
  231.   end
  232.   def current_item_enabled?
  233.     return true if $game_temp.battle_aid.nil?
  234.     if $game_temp.battle_aid.need_selection?
  235.       member = $game_party.battle_members[@index]
  236.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  237.     elsif $game_temp.battle_aid.for_dead_friend?
  238.       for member in $game_party.battle_members
  239.         return true if member.dead?
  240.       end
  241.       return false
  242.     end
  243.     return true
  244.   end
  245. end
  246. class Window_BattleStatusAid < Window_BattleStatus
  247.   attr_accessor :status_window
  248.   def initialize
  249.     super
  250.     self.visible = false
  251.     self.openness = 255
  252.   end
  253.   def window_width; return 128; end
  254.   def show
  255.     super
  256.     refresh
  257.   end
  258.   def refresh
  259.     contents.clear
  260.     return if @status_window.nil?
  261.     draw_item(@status_window.index)
  262.   end
  263.   def item_rect(index)
  264.     return Rect.new(0, 0, contents.width, contents.height)
  265.   end
  266. end
  267. class Window_BattleEnemy < Window_Selectable
  268.   def initialize(info_viewport)
  269.     super(0, Graphics.height, window_width, fitting_height(1))
  270.     refresh
  271.     self.visible = false
  272.     @info_viewport = info_viewport
  273.   end
  274.   def col_max; return item_max; end
  275.   def show
  276.     create_flags
  277.     super
  278.   end
  279.   def create_flags
  280.     set_select_flag(:any)
  281.     select(0)
  282.     return if $game_temp.battle_aid.nil?
  283.     if $game_temp.battle_aid.need_selection?
  284.       select(0)
  285.     elsif $game_temp.battle_aid.for_all?
  286.       select(0)
  287.       set_select_flag(:all)
  288.     elsif $game_temp.battle_aid.for_random?
  289.       select(0)
  290.       set_select_flag(:random)
  291.     end
  292.   end
  293.   def set_select_flag(flag)
  294.     @select_flag = flag
  295.     case @select_flag
  296.     when :all, :random
  297.       @cursor_all = true
  298.     else
  299.       @cursor_all = false
  300.     end
  301.   end
  302.   def select_all?
  303.     return true if @select_flag == :all
  304.     return true if @select_flag == :random
  305.     return false
  306.   end
  307.   def update_cursor
  308.     if @cursor_all
  309.       cursor_rect.set(0, 0, contents.width, contents.height)
  310.       self.top_row = 0
  311.     elsif @index < 0
  312.       cursor_rect.empty
  313.     else
  314.       ensure_cursor_visible
  315.       cursor_rect.set(item_rect(@index))
  316.     end
  317.   end
  318.   def cursor_movable?
  319.     return false if @select_flag == :user
  320.     return super
  321.   end
  322.   def current_item_enabled?
  323.     return true if $game_temp.battle_aid.nil?
  324.     if $game_temp.battle_aid.need_selection?
  325.       member = $game_party.battle_members[@index]
  326.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  327.     elsif $game_temp.battle_aid.for_dead_friend?
  328.       for member in $game_party.battle_members
  329.         return true if member.dead?
  330.       end
  331.       return false
  332.     end
  333.     return true
  334.   end
  335.   def enemy; @data[index]; end
  336.   def refresh
  337.     make_item_list
  338.     create_contents
  339.     draw_all_items
  340.   end
  341.   def make_item_list
  342.     @data = $game_troop.alive_members
  343.     @data.sort! { |a,b| a.screen_x <=> b.screen_x }
  344.   end
  345.   def draw_item(index); return; end
  346.   def update
  347.     super
  348.     return unless active
  349.     enemy.sprite_effect_type = :whiten
  350.     return unless select_all?
  351.     for enemy in $game_troop.alive_members
  352.       enemy.sprite_effect_type = :whiten
  353.     end
  354.   end
  355. end
  356. class Window_BattleHelp < Window_Help
  357.   attr_accessor :actor_window
  358.   attr_accessor :enemy_window
  359.   def update
  360.     super
  361.     if !self.visible and @text != ""
  362.       @text = ""
  363.       return refresh
  364.     end
  365.     update_battler_name
  366.   end
  367.   def update_battler_name
  368.     return unless @actor_window.active || @enemy_window.active
  369.     if @actor_window.active
  370.       battler = $game_party.battle_members[@actor_window.index]
  371.     elsif @enemy_window.active
  372.       battler = @enemy_window.enemy
  373.     end
  374.     if special_display?
  375.       refresh_special_case(battler)
  376.     else
  377.       refresh_battler_name(battler) if battler_name(battler) != @text
  378.     end
  379.   end
  380.   def battler_name(battler)
  381.     text = battler.name.clone
  382.     return text
  383.   end
  384.   def refresh_battler_name(battler)
  385.     contents.clear
  386.     reset_font_settings
  387.     change_color(normal_color)
  388.     @text = battler_name(battler)
  389.     icons = battler.state_icons + battler.buff_icons
  390.     dy = icons.size <= 0 ? line_height / 2 : 0
  391.     draw_text(0, dy, contents.width, line_height, @text, 1)
  392.     dx = (contents.width - (icons.size * 24)) / 2
  393.     draw_actor_icons(battler, dx, line_height, contents.width)
  394.   end
  395.   def special_display?
  396.     return false if $game_temp.battle_aid.nil?
  397.     return false if $game_temp.battle_aid.for_user?
  398.     return !$game_temp.battle_aid.need_selection?
  399.   end
  400.   def refresh_special_case(battler)
  401.     if $game_temp.battle_aid.for_opponent?
  402.       if $game_temp.battle_aid.for_all?
  403.         text = YEA::BATTLE::HELP_TEXT_ALL_FOES
  404.       else
  405.         case $game_temp.battle_aid.number_of_targets
  406.         when 1
  407.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_FOE
  408.         else
  409.           number = $game_temp.battle_aid.number_of_targets
  410.           text = sprintf(YEA::BATTLE::HELP_TEXT_MANY_RANDOM_FOE, number)
  411.         end
  412.       end
  413.     else
  414.       if $game_temp.battle_aid.for_dead_friend?
  415.         text = YEA::BATTLE::HELP_TEXT_ALL_DEAD_ALLIES
  416.       elsif $game_temp.battle_aid.for_random?
  417.         case $game_temp.battle_aid.number_of_targets
  418.         when 1
  419.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_ALLY
  420.         else
  421.           number = $game_temp.battle_aid.number_of_targets
  422.           text = sprintf(YEA::BATTLE::HELP_TEXT_RANDOM_ALLIES, number)
  423.         end
  424.       else
  425.         text = YEA::BATTLE::HELP_TEXT_ALL_ALLIES
  426.       end
  427.     end
  428.     return if text == @text
  429.     @text = text
  430.     contents.clear
  431.     reset_font_settings
  432.     draw_text(0, 0, contents.width, line_height*2, @text, 1)
  433.   end
  434. end
  435. class Window_SkillList < Window_Selectable
  436.   def spacing
  437.     return 8 if $game_party.in_battle
  438.     return super
  439.   end
  440. end
  441. class Window_ItemList < Window_Selectable
  442.   def spacing
  443.     return 8 if $game_party.in_battle
  444.     return super
  445.   end
  446. end
  447. class Scene_Battle < Scene_Base
  448.   attr_accessor :enemy_window
  449.   attr_accessor :info_viewport
  450.   attr_accessor :spriteset
  451.   attr_accessor :status_window
  452.   attr_accessor :status_aid_window
  453.   attr_accessor :subject
  454.   alias scene_battle_create_all_windows_abe create_all_windows
  455.   def create_all_windows
  456.     scene_battle_create_all_windows_abe
  457.     create_battle_status_aid_window
  458.     set_help_window
  459.   end
  460.   alias scene_battle_create_info_viewport_abe create_info_viewport
  461.   def create_info_viewport
  462.     scene_battle_create_info_viewport_abe
  463.     @status_window.refresh
  464.   end
  465.   def create_battle_status_aid_window
  466.     @status_aid_window = Window_BattleStatusAid.new
  467.     @status_aid_window.status_window = @status_window
  468.     @status_aid_window.x = Graphics.width - @status_aid_window.width
  469.     @status_aid_window.y = Graphics.height - @status_aid_window.height
  470.   end
  471.   def create_help_window
  472.     @help_window = Window_BattleHelp.new
  473.     @help_window.hide
  474.   end
  475.   def set_help_window
  476.     @help_window.actor_window = @actor_window
  477.     @help_window.enemy_window = @enemy_window
  478.   end
  479.   alias scene_battle_create_skill_window_abe create_skill_window
  480.   def create_skill_window
  481.     scene_battle_create_skill_window_abe
  482.     @skill_window.height = @info_viewport.rect.height
  483.     @skill_window.width = Graphics.width - @actor_command_window.width
  484.     @skill_window.y = Graphics.height - @skill_window.height
  485.   end
  486.   alias scene_battle_create_item_window_abe create_item_window
  487.   def create_item_window
  488.     scene_battle_create_item_window_abe
  489.     @item_window.height = @skill_window.height
  490.     @item_window.width = @skill_window.width
  491.     @item_window.y = Graphics.height - @item_window.height
  492.   end
  493.   alias scene_battle_next_command_abe next_command
  494.   def next_command
  495.     @status_window.show
  496.     redraw_current_status
  497.     @actor_command_window.show
  498.     @status_aid_window.hide
  499.     scene_battle_next_command_abe
  500.   end
  501.   alias scene_battle_prior_command_abe prior_command
  502.   def prior_command
  503.     redraw_current_status
  504.     scene_battle_prior_command_abe
  505.   end
  506.   def redraw_current_status
  507.     return if @status_window.index < 0
  508.     @status_window.draw_item(@status_window.index)
  509.   end
  510.   alias scene_battle_command_attack_abe command_attack
  511.   def command_attack
  512.     $game_temp.battle_aid = $data_skills[BattleManager.actor.attack_skill_id]
  513.     scene_battle_command_attack_abe
  514.   end
  515.   alias scene_battle_command_skill_abe command_skill
  516.   def command_skill
  517.     scene_battle_command_skill_abe
  518.     @status_window.hide
  519.     @actor_command_window.hide
  520.     @status_aid_window.show
  521.   end
  522.   alias scene_battle_command_item_abe command_item
  523.   def command_item
  524.     scene_battle_command_item_abe
  525.     @status_window.hide
  526.     @actor_command_window.hide
  527.     @status_aid_window.show
  528.   end
  529.   def on_skill_ok
  530.     [url=home.php?mod=space&uid=260100]@skill[/url] = @skill_window.item
  531.     $game_temp.battle_aid = @skill
  532.     BattleManager.actor.input.set_skill(@skill.id)
  533.     BattleManager.actor.last_skill.object = @skill
  534.     if @skill.for_opponent?
  535.       select_enemy_selection
  536.     elsif @skill.for_friend?
  537.       select_actor_selection
  538.     else
  539.       @skill_window.hide
  540.       next_command
  541.       $game_temp.battle_aid = nil
  542.     end
  543.   end
  544.   alias scene_battle_on_skill_cancel_abe on_skill_cancel
  545.   def on_skill_cancel
  546.     scene_battle_on_skill_cancel_abe
  547.     @status_window.show
  548.     @actor_command_window.show
  549.     @status_aid_window.hide
  550.   end
  551.   def on_item_ok
  552.     @item = @item_window.item
  553.     $game_temp.battle_aid = @item
  554.     BattleManager.actor.input.set_item(@item.id)
  555.     if @item.for_opponent?
  556.       select_enemy_selection
  557.     elsif @item.for_friend?
  558.       select_actor_selection
  559.     else
  560.       @item_window.hide
  561.       next_command
  562.       $game_temp.battle_aid = nil
  563.     end
  564.     $game_party.last_item.object = @item
  565.   end
  566.   alias scene_battle_on_item_cancel_abe on_item_cancel
  567.   def on_item_cancel
  568.     scene_battle_on_item_cancel_abe
  569.     @status_window.show
  570.     @actor_command_window.show
  571.     @status_aid_window.hide
  572.   end
  573.   alias scene_battle_select_actor_selection_abe select_actor_selection
  574.   def select_actor_selection
  575.     @status_aid_window.refresh
  576.     scene_battle_select_actor_selection_abe
  577.     @status_window.hide
  578.     @skill_window.hide
  579.     @item_window.hide
  580.     @help_window.show
  581.   end
  582.   alias scene_battle_on_actor_ok_abe on_actor_ok
  583.   def on_actor_ok
  584.     $game_temp.battle_aid = nil
  585.     scene_battle_on_actor_ok_abe
  586.     @status_window.show
  587.     if $imported["YEA-BattleCommandList"] && !@confirm_command_window.nil?
  588.       @actor_command_window.visible = !@confirm_command_window.visible
  589.     else
  590.       @actor_command_window.show
  591.     end
  592.     @status_aid_window.hide
  593.   end
  594.   alias scene_battle_on_actor_cancel_abe on_actor_cancel
  595.   def on_actor_cancel
  596.     BattleManager.actor.input.clear
  597.     @status_aid_window.refresh
  598.     $game_temp.battle_aid = nil
  599.     scene_battle_on_actor_cancel_abe
  600.     case @actor_command_window.current_symbol
  601.     when :skill
  602.       @skill_window.show
  603.     when :item
  604.       @item_window.show
  605.     end
  606.   end
  607.   alias scene_battle_select_enemy_selection_abe select_enemy_selection
  608.   def select_enemy_selection
  609.     @status_aid_window.refresh
  610.     scene_battle_select_enemy_selection_abe
  611.     @help_window.show
  612.   end
  613.   alias scene_battle_on_enemy_ok_abe on_enemy_ok
  614.   def on_enemy_ok
  615.     $game_temp.battle_aid = nil
  616.     scene_battle_on_enemy_ok_abe
  617.   end
  618.   alias scene_battle_on_enemy_cancel_abe on_enemy_cancel
  619.   def on_enemy_cancel
  620.     BattleManager.actor.input.clear
  621.     @status_aid_window.refresh
  622.     $game_temp.battle_aid = nil
  623.     scene_battle_on_enemy_cancel_abe
  624.     if @skill_window.visible || @item_window.visible
  625.       @help_window.show
  626.     else
  627.       @help_window.hide
  628.     end
  629.   end
  630.   def end_battle_conditions?
  631.     return true if $game_party.members.empty?
  632.     return true if $game_party.all_dead?
  633.     return true if $game_troop.all_dead?
  634.     return true if BattleManager.aborting?
  635.     return false
  636.   end
  637.   def refresh_status
  638.     #如果你是程序员,请顺手帮忙优化下这里,谢谢。
  639.     @status_window.refresh
  640.     for i in $game_party.battle_members
  641.       @status_window.draw_item($game_party.battle_members.index(i))
  642.     end
  643.   end
  644. end
复制代码


[img][/img]
梦石
0
星屑
1829
在线时间
80 小时
注册时间
2017-9-28
回帖
89
发表于 2017-9-29 00:25:59 | 显示全部楼层
本帖最后由 心六 于 2017-9-29 13:09 编辑

又是我(没有恶意.....楼主,好像没有把所有该脚本内容复制出来,希望楼主能够复制出来...
占楼待回复

点评

只是要改掉MP条和TP条的位置而已对吧?  发表于 2017-9-29 22:19
还有另一个问题是,楼主现在已经不想要改掉战斗信息了对吗?  发表于 2017-9-29 17:59
不过有些奇怪的是,我复制楼主提供的脚本后,战斗时并没有显示TP条。  发表于 2017-9-29 17:58
为什么我复制的脚本到530行自己就加了些莫名其妙的东西? 你可以把530行改成@skill = @skill_window.item就可以了  发表于 2017-9-29 14:49
回复

使用道具 举报

梦石
0
星屑
750
在线时间
228 小时
注册时间
2009-2-19
回帖
171
 楼主| 发表于 2017-10-1 10:42:03 | 显示全部楼层
心六 发表于 2017-9-29 00:25
又是我(没有恶意.....楼主,好像没有把所有该脚本内容复制出来,希望楼主能够复制出来...
占楼待回 ...

第一个问题还是存在的!
这个脚本要把技能设定成耗费TP值才会显示TP条

点评

原来,太久没碰过RM,糊涂了,哈哈哈,好的好的,谢谢楼主告知。  发表于 2017-10-1 13:16
[img][/img]
回复

使用道具 举报

梦石
0
星屑
1829
在线时间
80 小时
注册时间
2017-9-28
回帖
89
发表于 2017-10-1 14:29:22 | 显示全部楼层
本帖最后由 心六 于 2017-10-1 14:35 编辑
根五 发表于 2017-10-1 10:42
第一个问题还是存在的!
这个脚本要把技能设定成耗费TP值才会显示TP条

1111111.png
这个效果如何?如果不满意,我可以继续更改。
我把脚本原本设定的消耗TP值才会显示TP条,改回系统默认设定,这个如果也不满意,我可以继续改。

#补充脚本
脚本内容
  1. $脸图战斗 = true
  2. $imported = {} if $imported.nil?
  3. module YEA
  4.   module BATTLE
  5.     SKIP_PARTY_COMMAND = true
  6.     BATTLESTATUS_NAME_FONT_SIZE = 20
  7.     BATTLESTATUS_TEXT_FONT_SIZE = 16
  8.     BATTLESTATUS_NO_ACTION_ICON = 185
  9.     BATTLESTATUS_HPGAUGE_Y_PLUS = 11
  10.     BATTLESTATUS_CENTER_FACES   = false
  11.     HELP_TEXT_ALL_FOES        = "全体敌人"
  12.     HELP_TEXT_ONE_RANDOM_FOE  = "单个敌人"
  13.     HELP_TEXT_MANY_RANDOM_FOE = "%d个随机敌人"
  14.     HELP_TEXT_ALL_ALLIES      = "全体队友"
  15.     HELP_TEXT_ALL_DEAD_ALLIES = "全体死亡队友"
  16.     HELP_TEXT_ONE_RANDOM_ALLY = "单个随机队友"
  17.     HELP_TEXT_RANDOM_ALLIES   = "%d个随机队友"
  18.   end
  19. end
  20. class Game_Battler
  21.   def can_collapse?
  22.     return false unless dead?
  23.     unless actor?
  24.       return false unless sprite.battler_visible
  25.       array = [:collapse, :boss_collapse, :instant_collapse]
  26.       return false if array.include?(sprite.effect_type)
  27.     end
  28.     return true
  29.   end
  30.   def draw_mp?
  31.     return true
  32.   end
  33.   def draw_tp?
  34.     return $data_system.opt_display_tp
  35.   end
  36. end
  37. module Icon
  38.   def self.no_action; return YEA::BATTLE::BATTLESTATUS_NO_ACTION_ICON; end
  39. end
  40. class Game_Temp
  41.   attr_accessor :battle_aid
  42.   attr_accessor :evaluating
  43. end
  44. class Game_Action
  45.   alias evaluate_item_with_target_abe evaluate_item_with_target
  46.   def evaluate_item_with_target(target)
  47.     $game_temp.evaluating = true
  48.     result = evaluate_item_with_target_abe(target)
  49.     $game_temp.evaluating = false
  50.     return result
  51.   end
  52. end
  53. =begin
  54. class Game_Actor < Game_Battler
  55.   def draw_mp?
  56.     return true unless draw_tp?
  57.     for skill in skills
  58.       next unless added_skill_types.include?(skill.stype_id)
  59.       return true if skill.mp_cost > 0
  60.     end
  61.     return false
  62.   end
  63.   def draw_tp?
  64.     return false unless $data_system.opt_display_tp
  65.     for skill in skills
  66.       next unless added_skill_types.include?(skill.stype_id)
  67.       return true if skill.tp_cost > 0
  68.     end
  69.     return false
  70.   end
  71. end
  72. =end
  73. class Window_BattleStatus < Window_Selectable
  74.   def initialize
  75.     super(0, 0, window_width, window_height)
  76.     self.openness = 0
  77.     self.opacity = 0
  78.     @party = $game_party.battle_members.clone
  79.   end
  80.   def col_max; return $game_party.max_battle_members; end
  81.   def battle_members; return $game_party.battle_members; end
  82.   def actor; return battle_members[@index]; end
  83.   def update
  84.     super
  85.     return if @party == $game_party.battle_members
  86.     @party = $game_party.battle_members.clone
  87.     refresh
  88.   end
  89.   def draw_item(index)
  90.     return if index.nil?
  91.     clear_item(index)
  92.     actor = battle_members[index]
  93.     rect = item_rect(index)
  94.     return if actor.nil?
  95.     draw_actor_face(actor, rect.x+2, rect.y+2, actor.alive?)
  96.     draw_actor_name(actor, rect.x, rect.y, rect.width-8)
  97.     draw_actor_action(actor, rect.x, rect.y)
  98.     draw_actor_icons(actor, rect.x, line_height*1, rect.width)
  99.     gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
  100.     contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
  101.     draw_actor_hp(actor, rect.x+2, line_height*2+gx, rect.width-4)
  102.     if draw_tp?(actor) && draw_mp?(actor)
  103.       dw = rect.width/2-2
  104.       dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE
  105.       draw_actor_mp(actor, rect.x+2, line_height*3, dw)
  106.       dw = rect.width - rect.width/2 - 2
  107.       draw_actor_tp(actor, rect.x+rect.width/2, line_height*3, dw)
  108.     end
  109.   end
  110.   def item_rect(index)
  111.     rect = Rect.new
  112.     rect.width = contents.width / $game_party.max_battle_members
  113.     rect.height = contents.height
  114.     rect.x = index * rect.width
  115.     if YEA::BATTLE::BATTLESTATUS_CENTER_FACES
  116.       rect.x += (contents.width - $game_party.members.size * rect.width) / 2
  117.     end
  118.     rect.y = 0
  119.     return rect
  120.   end
  121.   def draw_face(face_name, face_index, dx, dy, enabled = true)
  122.     bitmap = Cache.face(face_name)
  123.     fx = [(96 - item_rect(0).width + 1) / 2, 0].max
  124.     fy = face_index / 4 * 96 + 2
  125.     fw = [item_rect(0).width - 4, 92].min
  126.     rect = Rect.new(fx, fy, fw, 92)
  127.     rect = Rect.new(face_index % 4 * 96 + fx, fy, fw, 92)#这里
  128.     contents.blt(dx, dy, bitmap, rect, enabled ? 255 : translucent_alpha)
  129.     bitmap.dispose
  130.   end
  131.   def draw_actor_name(actor, dx, dy, dw = 112)
  132.     reset_font_settings
  133.     contents.font.size = YEA::BATTLE::BATTLESTATUS_NAME_FONT_SIZE
  134.     change_color(hp_color(actor))
  135.     draw_text(dx+24, dy, dw-24, line_height, actor.name)
  136.   end
  137.   def draw_actor_action(actor, dx, dy)
  138.     draw_icon(action_icon(actor), dx, dy)
  139.   end
  140.   def action_icon(actor)
  141.     return Icon.no_action if actor.current_action.nil?
  142.     return Icon.no_action if actor.current_action.item.nil?
  143.     return actor.current_action.item.icon_index
  144.   end
  145.   def draw_tp?(actor)
  146.     return actor.draw_tp?
  147.   end
  148.   def draw_mp?(actor)
  149.     return actor.draw_mp?
  150.   end
  151.   def draw_current_and_max_values(dx, dy, dw, current, max, color1, color2)
  152.     change_color(color1)
  153.     draw_text(dx, dy, dw, line_height, current.to_s, 2)
  154.   end
  155.   def draw_actor_hp(actor, dx, dy, width = 124)
  156.     draw_gauge(dx, dy, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  157.     change_color(system_color)
  158.     cy = (Font.default_size - contents.font.size) / 2 + 1
  159.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::hp_a)
  160.     draw_current_and_max_values(dx, dy+cy, width, actor.hp, actor.mhp,
  161.       hp_color(actor), normal_color)
  162.     end
  163.   def draw_actor_mp(actor, dx, dy, width = 124)
  164.     draw_gauge(dx, dy, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  165.     change_color(system_color)
  166.     cy = (Font.default_size - contents.font.size) / 2 + 1
  167.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a)
  168.     draw_current_and_max_values(dx, dy+cy, width, actor.mp, actor.mmp,
  169.       mp_color(actor), normal_color)
  170.     end
  171.   def draw_actor_tp(actor, dx, dy, width = 124)
  172.     draw_gauge(dx, dy, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  173.     change_color(system_color)
  174.     cy = (Font.default_size - contents.font.size) / 2 + 1
  175.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::tp_a)
  176.     change_color(tp_color(actor))
  177.     draw_text(dx + width - 42, dy+cy, 42, line_height, actor.tp.to_i, 2)
  178.   end
  179. end
  180. class Window_BattleActor < Window_BattleStatus
  181.   def show
  182.     create_flags
  183.     super
  184.   end
  185.   def create_flags
  186.     set_select_flag(:any)
  187.     select(0)
  188.     return if $game_temp.battle_aid.nil?
  189.     if $game_temp.battle_aid.need_selection?
  190.       select(0)
  191.       set_select_flag(:dead) if $game_temp.battle_aid.for_dead_friend?
  192.     elsif $game_temp.battle_aid.for_user?
  193.       battler = BattleManager.actor
  194.       id = battler.nil? ? 0 : $game_party.battle_members.index(battler)
  195.       select(id)
  196.       set_select_flag(:user)
  197.     elsif $game_temp.battle_aid.for_all?
  198.       select(0)
  199.       set_select_flag(:all)
  200.       set_select_flag(:all_dead) if $game_temp.battle_aid.for_dead_friend?
  201.     elsif $game_temp.battle_aid.for_random?
  202.       select(0)
  203.       set_select_flag(:random) if $game_temp.battle_aid.for_random?
  204.     end
  205.   end
  206.   def set_select_flag(flag)
  207.     @select_flag = flag
  208.     case @select_flag
  209.     when :all, :all_dead, :random
  210.       @cursor_all = true
  211.     else
  212.       @cursor_all = false
  213.     end
  214.   end
  215.   def update_cursor
  216.     if @cursor_all
  217.       cursor_rect.set(0, 0, contents.width, contents.height)
  218.       self.top_row = 0
  219.     elsif @index < 0
  220.       cursor_rect.empty
  221.     else
  222.       ensure_cursor_visible
  223.       cursor_rect.set(item_rect(@index))
  224.     end
  225.   end
  226.   def cursor_movable?
  227.     return false if @select_flag == :user
  228.     return super
  229.   end
  230.   def current_item_enabled?
  231.     return true if $game_temp.battle_aid.nil?
  232.     if $game_temp.battle_aid.need_selection?
  233.       member = $game_party.battle_members[@index]
  234.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  235.     elsif $game_temp.battle_aid.for_dead_friend?
  236.       for member in $game_party.battle_members
  237.         return true if member.dead?
  238.       end
  239.       return false
  240.     end
  241.     return true
  242.   end
  243. end
  244. class Window_BattleStatusAid < Window_BattleStatus
  245.   attr_accessor :status_window
  246.   def initialize
  247.     super
  248.     self.visible = false
  249.     self.openness = 255
  250.   end
  251.   def window_width; return 128; end
  252.   def show
  253.     super
  254.     refresh
  255.   end
  256.   def refresh
  257.     contents.clear
  258.     return if @status_window.nil?
  259.     draw_item(@status_window.index)
  260.   end
  261.   def item_rect(index)
  262.     return Rect.new(0, 0, contents.width, contents.height)
  263.   end
  264. end
  265. class Window_BattleEnemy < Window_Selectable
  266.   def initialize(info_viewport)
  267.     super(0, Graphics.height, window_width, fitting_height(1))
  268.     refresh
  269.     self.visible = false
  270.     @info_viewport = info_viewport
  271.   end
  272.   def col_max; return item_max; end
  273.   def show
  274.     create_flags
  275.     super
  276.   end
  277.   def create_flags
  278.     set_select_flag(:any)
  279.     select(0)
  280.     return if $game_temp.battle_aid.nil?
  281.     if $game_temp.battle_aid.need_selection?
  282.       select(0)
  283.     elsif $game_temp.battle_aid.for_all?
  284.       select(0)
  285.       set_select_flag(:all)
  286.     elsif $game_temp.battle_aid.for_random?
  287.       select(0)
  288.       set_select_flag(:random)
  289.     end
  290.   end
  291.   def set_select_flag(flag)
  292.     @select_flag = flag
  293.     case @select_flag
  294.     when :all, :random
  295.       @cursor_all = true
  296.     else
  297.       @cursor_all = false
  298.     end
  299.   end
  300.   def select_all?
  301.     return true if @select_flag == :all
  302.     return true if @select_flag == :random
  303.     return false
  304.   end
  305.   def update_cursor
  306.     if @cursor_all
  307.       cursor_rect.set(0, 0, contents.width, contents.height)
  308.       self.top_row = 0
  309.     elsif @index < 0
  310.       cursor_rect.empty
  311.     else
  312.       ensure_cursor_visible
  313.       cursor_rect.set(item_rect(@index))
  314.     end
  315.   end
  316.   def cursor_movable?
  317.     return false if @select_flag == :user
  318.     return super
  319.   end
  320.   def current_item_enabled?
  321.     return true if $game_temp.battle_aid.nil?
  322.     if $game_temp.battle_aid.need_selection?
  323.       member = $game_party.battle_members[@index]
  324.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  325.     elsif $game_temp.battle_aid.for_dead_friend?
  326.       for member in $game_party.battle_members
  327.         return true if member.dead?
  328.       end
  329.       return false
  330.     end
  331.     return true
  332.   end
  333.   def enemy; @data[index]; end
  334.   def refresh
  335.     make_item_list
  336.     create_contents
  337.     draw_all_items
  338.   end
  339.   def make_item_list
  340.     @data = $game_troop.alive_members
  341.     @data.sort! { |a,b| a.screen_x <=> b.screen_x }
  342.   end
  343.   def draw_item(index); return; end
  344.   def update
  345.     super
  346.     return unless active
  347.     enemy.sprite_effect_type = :whiten
  348.     return unless select_all?
  349.     for enemy in $game_troop.alive_members
  350.       enemy.sprite_effect_type = :whiten
  351.     end
  352.   end
  353. end
  354. class Window_BattleHelp < Window_Help
  355.   attr_accessor :actor_window
  356.   attr_accessor :enemy_window
  357.   def update
  358.     super
  359.     if !self.visible and @text != ""
  360.       @text = ""
  361.       return refresh
  362.     end
  363.     update_battler_name
  364.   end
  365.   def update_battler_name
  366.     return unless @actor_window.active || @enemy_window.active
  367.     if @actor_window.active
  368.       battler = $game_party.battle_members[@actor_window.index]
  369.     elsif @enemy_window.active
  370.       battler = @enemy_window.enemy
  371.     end
  372.     if special_display?
  373.       refresh_special_case(battler)
  374.     else
  375.       refresh_battler_name(battler) if battler_name(battler) != @text
  376.     end
  377.   end
  378.   def battler_name(battler)
  379.     text = battler.name.clone
  380.     return text
  381.   end
  382.   def refresh_battler_name(battler)
  383.     contents.clear
  384.     reset_font_settings
  385.     change_color(normal_color)
  386.     @text = battler_name(battler)
  387.     icons = battler.state_icons + battler.buff_icons
  388.     dy = icons.size <= 0 ? line_height / 2 : 0
  389.     draw_text(0, dy, contents.width, line_height, @text, 1)
  390.     dx = (contents.width - (icons.size * 24)) / 2
  391.     draw_actor_icons(battler, dx, line_height, contents.width)
  392.   end
  393.   def special_display?
  394.     return false if $game_temp.battle_aid.nil?
  395.     return false if $game_temp.battle_aid.for_user?
  396.     return !$game_temp.battle_aid.need_selection?
  397.   end
  398.   def refresh_special_case(battler)
  399.     if $game_temp.battle_aid.for_opponent?
  400.       if $game_temp.battle_aid.for_all?
  401.         text = YEA::BATTLE::HELP_TEXT_ALL_FOES
  402.       else
  403.         case $game_temp.battle_aid.number_of_targets
  404.         when 1
  405.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_FOE
  406.         else
  407.           number = $game_temp.battle_aid.number_of_targets
  408.           text = sprintf(YEA::BATTLE::HELP_TEXT_MANY_RANDOM_FOE, number)
  409.         end
  410.       end
  411.     else
  412.       if $game_temp.battle_aid.for_dead_friend?
  413.         text = YEA::BATTLE::HELP_TEXT_ALL_DEAD_ALLIES
  414.       elsif $game_temp.battle_aid.for_random?
  415.         case $game_temp.battle_aid.number_of_targets
  416.         when 1
  417.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_ALLY
  418.         else
  419.           number = $game_temp.battle_aid.number_of_targets
  420.           text = sprintf(YEA::BATTLE::HELP_TEXT_RANDOM_ALLIES, number)
  421.         end
  422.       else
  423.         text = YEA::BATTLE::HELP_TEXT_ALL_ALLIES
  424.       end
  425.     end
  426.     return if text == @text
  427.     @text = text
  428.     contents.clear
  429.     reset_font_settings
  430.     draw_text(0, 0, contents.width, line_height*2, @text, 1)
  431.   end
  432. end
  433. class Window_SkillList < Window_Selectable
  434.   def spacing
  435.     return 8 if $game_party.in_battle
  436.     return super
  437.   end
  438. end
  439. class Window_ItemList < Window_Selectable
  440.   def spacing
  441.     return 8 if $game_party.in_battle
  442.     return super
  443.   end
  444. end
  445. class Scene_Battle < Scene_Base
  446.   attr_accessor :enemy_window
  447.   attr_accessor :info_viewport
  448.   attr_accessor :spriteset
  449.   attr_accessor :status_window
  450.   attr_accessor :status_aid_window
  451.   attr_accessor :subject
  452.   alias scene_battle_create_all_windows_abe create_all_windows
  453.   def create_all_windows
  454.     scene_battle_create_all_windows_abe
  455.     create_battle_status_aid_window
  456.     set_help_window
  457.   end
  458.   alias scene_battle_create_info_viewport_abe create_info_viewport
  459.   def create_info_viewport
  460.     scene_battle_create_info_viewport_abe
  461.     @status_window.refresh
  462.   end
  463.   def create_battle_status_aid_window
  464.     @status_aid_window = Window_BattleStatusAid.new
  465.     @status_aid_window.status_window = @status_window
  466.     @status_aid_window.x = Graphics.width - @status_aid_window.width
  467.     @status_aid_window.y = Graphics.height - @status_aid_window.height
  468.   end
  469.   def create_help_window
  470.     @help_window = Window_BattleHelp.new
  471.     @help_window.hide
  472.   end
  473.   def set_help_window
  474.     @help_window.actor_window = @actor_window
  475.     @help_window.enemy_window = @enemy_window
  476.   end
  477.   alias scene_battle_create_skill_window_abe create_skill_window
  478.   def create_skill_window
  479.     scene_battle_create_skill_window_abe
  480.     @skill_window.height = @info_viewport.rect.height
  481.     @skill_window.width = Graphics.width - @actor_command_window.width
  482.     @skill_window.y = Graphics.height - @skill_window.height
  483.   end
  484.   alias scene_battle_create_item_window_abe create_item_window
  485.   def create_item_window
  486.     scene_battle_create_item_window_abe
  487.     @item_window.height = @skill_window.height
  488.     @item_window.width = @skill_window.width
  489.     @item_window.y = Graphics.height - @item_window.height
  490.   end
  491.   alias scene_battle_next_command_abe next_command
  492.   def next_command
  493.     @status_window.show
  494.     redraw_current_status
  495.     @actor_command_window.show
  496.     @status_aid_window.hide
  497.     scene_battle_next_command_abe
  498.   end
  499.   alias scene_battle_prior_command_abe prior_command
  500.   def prior_command
  501.     redraw_current_status
  502.     scene_battle_prior_command_abe
  503.   end
  504.   def redraw_current_status
  505.     return if @status_window.index < 0
  506.     @status_window.draw_item(@status_window.index)
  507.   end
  508.   alias scene_battle_command_attack_abe command_attack
  509.   def command_attack
  510.     $game_temp.battle_aid = $data_skills[BattleManager.actor.attack_skill_id]
  511.     scene_battle_command_attack_abe
  512.   end
  513.   alias scene_battle_command_skill_abe command_skill
  514.   def command_skill
  515.     scene_battle_command_skill_abe
  516.     @status_window.hide
  517.     @actor_command_window.hide
  518.     @status_aid_window.show
  519.   end
  520.   alias scene_battle_command_item_abe command_item
  521.   def command_item
  522.     scene_battle_command_item_abe
  523.     @status_window.hide
  524.     @actor_command_window.hide
  525.     @status_aid_window.show
  526.   end
  527.   def on_skill_ok
  528.     [url=home.php?mod=space&uid=260100]@skill[/url] = @skill_window.item
  529.     $game_temp.battle_aid = @skill
  530.     BattleManager.actor.input.set_skill(@skill.id)
  531.     BattleManager.actor.last_skill.object = @skill
  532.     if @skill.for_opponent?
  533.       select_enemy_selection
  534.     elsif @skill.for_friend?
  535.       select_actor_selection
  536.     else
  537.       @skill_window.hide
  538.       next_command
  539.       $game_temp.battle_aid = nil
  540.     end
  541.   end
  542.   alias scene_battle_on_skill_cancel_abe on_skill_cancel
  543.   def on_skill_cancel
  544.     scene_battle_on_skill_cancel_abe
  545.     @status_window.show
  546.     @actor_command_window.show
  547.     @status_aid_window.hide
  548.   end
  549.   def on_item_ok
  550.     @item = @item_window.item
  551.     $game_temp.battle_aid = @item
  552.     BattleManager.actor.input.set_item(@item.id)
  553.     if @item.for_opponent?
  554.       select_enemy_selection
  555.     elsif @item.for_friend?
  556.       select_actor_selection
  557.     else
  558.       @item_window.hide
  559.       next_command
  560.       $game_temp.battle_aid = nil
  561.     end
  562.     $game_party.last_item.object = @item
  563.   end
  564.   alias scene_battle_on_item_cancel_abe on_item_cancel
  565.   def on_item_cancel
  566.     scene_battle_on_item_cancel_abe
  567.     @status_window.show
  568.     @actor_command_window.show
  569.     @status_aid_window.hide
  570.   end
  571.   alias scene_battle_select_actor_selection_abe select_actor_selection
  572.   def select_actor_selection
  573.     @status_aid_window.refresh
  574.     scene_battle_select_actor_selection_abe
  575.     @status_window.hide
  576.     @skill_window.hide
  577.     @item_window.hide
  578.     @help_window.show
  579.   end
  580.   alias scene_battle_on_actor_ok_abe on_actor_ok
  581.   def on_actor_ok
  582.     $game_temp.battle_aid = nil
  583.     scene_battle_on_actor_ok_abe
  584.     @status_window.show
  585.     if $imported["YEA-BattleCommandList"] && !@confirm_command_window.nil?
  586.       @actor_command_window.visible = !@confirm_command_window.visible
  587.     else
  588.       @actor_command_window.show
  589.     end
  590.     @status_aid_window.hide
  591.   end
  592.   alias scene_battle_on_actor_cancel_abe on_actor_cancel
  593.   def on_actor_cancel
  594.     BattleManager.actor.input.clear
  595.     @status_aid_window.refresh
  596.     $game_temp.battle_aid = nil
  597.     scene_battle_on_actor_cancel_abe
  598.     case @actor_command_window.current_symbol
  599.     when :skill
  600.       @skill_window.show
  601.     when :item
  602.       @item_window.show
  603.     end
  604.   end
  605.   alias scene_battle_select_enemy_selection_abe select_enemy_selection
  606.   def select_enemy_selection
  607.     @status_aid_window.refresh
  608.     scene_battle_select_enemy_selection_abe
  609.     @help_window.show
  610.   end
  611.   alias scene_battle_on_enemy_ok_abe on_enemy_ok
  612.   def on_enemy_ok
  613.     $game_temp.battle_aid = nil
  614.     scene_battle_on_enemy_ok_abe
  615.   end
  616.   alias scene_battle_on_enemy_cancel_abe on_enemy_cancel
  617.   def on_enemy_cancel
  618.     BattleManager.actor.input.clear
  619.     @status_aid_window.refresh
  620.     $game_temp.battle_aid = nil
  621.     scene_battle_on_enemy_cancel_abe
  622.     if @skill_window.visible || @item_window.visible
  623.       @help_window.show
  624.     else
  625.       @help_window.hide
  626.     end
  627.   end
  628.   def end_battle_conditions?
  629.     return true if $game_party.members.empty?
  630.     return true if $game_party.all_dead?
  631.     return true if $game_troop.all_dead?
  632.     return true if BattleManager.aborting?
  633.     return false
  634.   end
  635.   def refresh_status
  636.     #如果你是程序员,请顺手帮忙优化下这里,谢谢。
  637.     @status_window.refresh
  638.     for i in $game_party.battle_members
  639.       @status_window.draw_item($game_party.battle_members.index(i))
  640.     end
  641.   end
  642. end
复制代码


回复

使用道具 举报

梦石
0
星屑
750
在线时间
228 小时
注册时间
2009-2-19
回帖
171
 楼主| 发表于 2017-10-1 16:29:41 | 显示全部楼层
本帖最后由 根五 于 2017-10-1 16:31 编辑
心六 发表于 2017-10-1 14:29
这个效果如何?如果不满意,我可以继续更改。
我把脚本原本设定的消耗TP值才会显示TP条,改回系统默认设 ...

我的意思是把TP槽改到MP槽的下面。
因为目前这个样子MP的数值一大就会很别扭
像这样

1.png

点评

那麻烦你帮我改一下!我试试!谢谢!  发表于 2017-10-1 20:43
或者说楼主有别的办法吗?我会尽力而为帮楼主的。  发表于 2017-10-1 19:18
嗯,因为战斗状态窗口大小被限制了,感觉除了把HP槽和MP槽望上移以外没有办法...  发表于 2017-10-1 19:14
你的意思是要把HP槽和MP槽往上移动?  发表于 2017-10-1 17:42
如果槽挡到了五官也没关系吗?  发表于 2017-10-1 16:53
[img][/img]
回复

使用道具 举报

梦石
0
星屑
1829
在线时间
80 小时
注册时间
2017-9-28
回帖
89
发表于 2017-10-1 23:44:57 | 显示全部楼层
111111111111111111111111111111.png

效果
脚本内容
  1. $脸图战斗 = true
  2. $imported = {} if $imported.nil?
  3. module YEA
  4.   module BATTLE
  5.     SKIP_PARTY_COMMAND = true
  6.     BATTLESTATUS_NAME_FONT_SIZE = 20
  7.     BATTLESTATUS_TEXT_FONT_SIZE = 16
  8.     BATTLESTATUS_NO_ACTION_ICON = 185
  9.     BATTLESTATUS_HPGAUGE_Y_PLUS = 11
  10.     BATTLESTATUS_CENTER_FACES   = false
  11.     HELP_TEXT_ALL_FOES        = "全体敌人"
  12.     HELP_TEXT_ONE_RANDOM_FOE  = "单个敌人"
  13.     HELP_TEXT_MANY_RANDOM_FOE = "%d个随机敌人"
  14.     HELP_TEXT_ALL_ALLIES      = "全体队友"
  15.     HELP_TEXT_ALL_DEAD_ALLIES = "全体死亡队友"
  16.     HELP_TEXT_ONE_RANDOM_ALLY = "单个随机队友"
  17.     HELP_TEXT_RANDOM_ALLIES   = "%d个随机队友"
  18.   end
  19. end
  20. class Game_Battler
  21.   def can_collapse?
  22.     return false unless dead?
  23.     unless actor?
  24.       return false unless sprite.battler_visible
  25.       array = [:collapse, :boss_collapse, :instant_collapse]
  26.       return false if array.include?(sprite.effect_type)
  27.     end
  28.     return true
  29.   end
  30.   def draw_mp
  31.     return true
  32.   end
  33.   def draw_tp
  34.     return $data_system.opt_display_tp
  35.   end
  36. end
  37. module Icon
  38.   def self.no_action; return YEA::BATTLE::BATTLESTATUS_NO_ACTION_ICON; end
  39. end
  40. class Game_Temp
  41.   attr_accessor :battle_aid
  42.   attr_accessor :evaluating
  43. end
  44. class Game_Action
  45.   alias evaluate_item_with_target_abe evaluate_item_with_target
  46.   def evaluate_item_with_target(target)
  47.     $game_temp.evaluating = true
  48.     result = evaluate_item_with_target_abe(target)
  49.     $game_temp.evaluating = false
  50.     return result
  51.   end
  52. end
  53. =begin
  54. class Game_Actor < Game_Battler
  55.   def draw_mp?
  56.     return true unless draw_tp?
  57.     for skill in skills
  58.       next unless added_skill_types.include?(skill.stype_id)
  59.       return true if skill.mp_cost > 0
  60.     end
  61.     return false
  62.   end
  63.   def draw_tp?
  64.     return false unless $data_system.opt_display_tp
  65.     for skill in skills
  66.       next unless added_skill_types.include?(skill.stype_id)
  67.       return true if skill.tp_cost > 0
  68.     end
  69.     return false
  70.   end
  71. end
  72. =end
  73. class Window_BattleStatus < Window_Selectable
  74.   def initialize
  75.     super(0, 0, window_width, window_height)
  76.     self.openness = 0
  77.     self.opacity = 0
  78.     @party = $game_party.battle_members.clone
  79.   end
  80.   def col_max; return $game_party.max_battle_members; end
  81.   def battle_members; return $game_party.battle_members; end
  82.   def actor; return battle_members[@index]; end
  83.   def update
  84.     super
  85.     return if @party == $game_party.battle_members
  86.     @party = $game_party.battle_members.clone
  87.     refresh
  88.   end
  89.   def draw_item(index)
  90.     return if index.nil?
  91.     clear_item(index)
  92.     actor = battle_members[index]
  93.     rect = item_rect(index)
  94.     return if actor.nil?
  95.     draw_actor_face(actor, rect.x+2, rect.y+2, actor.alive?)
  96.     draw_actor_name(actor, rect.x, rect.y, rect.width-8)
  97.     draw_actor_action(actor, rect.x, rect.y)
  98.     draw_actor_icons(actor, rect.x, line_height*1, rect.width)
  99.     gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
  100.     contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
  101.     draw_actor_hp(actor, rect.x+2, line_height*1.5+gx, rect.width-4)
  102.       dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE
  103.       draw_actor_mp(actor, rect.x+2, line_height*2+gx, rect.width-4)
  104.       draw_actor_tp(actor, rect.x+2, line_height*2.5+gx, rect.width-4)
  105.     end
  106.   def item_rect(index)
  107.     rect = Rect.new
  108.     rect.width = contents.width / $game_party.max_battle_members
  109.     rect.height = contents.height
  110.     rect.x = index * rect.width
  111.     if YEA::BATTLE::BATTLESTATUS_CENTER_FACES
  112.       rect.x += (contents.width - $game_party.members.size * rect.width) / 2
  113.     end
  114.     rect.y = 0
  115.     return rect
  116.   end
  117.   def draw_face(face_name, face_index, dx, dy, enabled = true)
  118.     bitmap = Cache.face(face_name)
  119.     fx = [(96 - item_rect(0).width + 1) / 2, 0].max
  120.     fy = face_index / 4 * 96 + 2
  121.     fw = [item_rect(0).width - 4, 92].min
  122.     rect = Rect.new(fx, fy, fw, 92)
  123.     rect = Rect.new(face_index % 4 * 96 + fx, fy, fw, 92)#这里
  124.     contents.blt(dx, dy, bitmap, rect, enabled ? 255 : translucent_alpha)
  125.     bitmap.dispose
  126.   end
  127.   def draw_actor_name(actor, dx, dy, dw = 112)
  128.     reset_font_settings
  129.     contents.font.size = YEA::BATTLE::BATTLESTATUS_NAME_FONT_SIZE
  130.     change_color(hp_color(actor))
  131.     draw_text(dx+24, dy, dw-24, line_height, actor.name)
  132.   end
  133.   def draw_actor_action(actor, dx, dy)
  134.     draw_icon(action_icon(actor), dx, dy)
  135.   end
  136.   def action_icon(actor)
  137.     return Icon.no_action if actor.current_action.nil?
  138.     return Icon.no_action if actor.current_action.item.nil?
  139.     return actor.current_action.item.icon_index
  140.   end
  141.   def draw_tp(actor)
  142.     return actor.draw_tp
  143.   end
  144.   def draw_mp(actor)
  145.     return actor.draw_mp
  146.   end
  147.   def draw_current_and_max_values(dx, dy, dw, current, max, color1, color2)
  148.     change_color(color1)
  149.     draw_text(dx, dy, dw, line_height, current.to_s, 2)
  150.   end
  151.   def draw_actor_hp(actor, dx, dy, width = 124)
  152.     draw_gauge(dx, dy, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  153.     change_color(system_color)
  154.     cy = (Font.default_size - contents.font.size) / 2 + 1
  155.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::hp_a)
  156.     draw_current_and_max_values(dx, dy+cy, width, actor.hp, actor.mhp,
  157.       hp_color(actor), normal_color)
  158.     end
  159.   def draw_actor_mp(actor, dx, dy, width = 124)
  160.     draw_gauge(dx, dy, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  161.     change_color(system_color)
  162.     cy = (Font.default_size - contents.font.size) / 2 + 1
  163.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a)
  164.     draw_current_and_max_values(dx, dy+cy, width, actor.mp, actor.mmp,
  165.       mp_color(actor), normal_color)
  166.     end
  167.   def draw_actor_tp(actor, dx, dy, width = 124)
  168.     draw_gauge(dx, dy, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  169.     change_color(system_color)
  170.     cy = (Font.default_size - contents.font.size) / 2 + 1
  171.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::tp_a)
  172.     change_color(tp_color(actor))
  173.     draw_text(dx + width - 42, dy+cy, 42, line_height, actor.tp.to_i, 2)
  174.   end
  175. end
  176. class Window_BattleActor < Window_BattleStatus
  177.   def show
  178.     create_flags
  179.     super
  180.   end
  181.   def create_flags
  182.     set_select_flag(:any)
  183.     select(0)
  184.     return if $game_temp.battle_aid.nil?
  185.     if $game_temp.battle_aid.need_selection?
  186.       select(0)
  187.       set_select_flag(:dead) if $game_temp.battle_aid.for_dead_friend?
  188.     elsif $game_temp.battle_aid.for_user?
  189.       battler = BattleManager.actor
  190.       id = battler.nil? ? 0 : $game_party.battle_members.index(battler)
  191.       select(id)
  192.       set_select_flag(:user)
  193.     elsif $game_temp.battle_aid.for_all?
  194.       select(0)
  195.       set_select_flag(:all)
  196.       set_select_flag(:all_dead) if $game_temp.battle_aid.for_dead_friend?
  197.     elsif $game_temp.battle_aid.for_random?
  198.       select(0)
  199.       set_select_flag(:random) if $game_temp.battle_aid.for_random?
  200.     end
  201.   end
  202.   def set_select_flag(flag)
  203.     @select_flag = flag
  204.     case @select_flag
  205.     when :all, :all_dead, :random
  206.       @cursor_all = true
  207.     else
  208.       @cursor_all = false
  209.     end
  210.   end
  211.   def update_cursor
  212.     if @cursor_all
  213.       cursor_rect.set(0, 0, contents.width, contents.height)
  214.       self.top_row = 0
  215.     elsif @index < 0
  216.       cursor_rect.empty
  217.     else
  218.       ensure_cursor_visible
  219.       cursor_rect.set(item_rect(@index))
  220.     end
  221.   end
  222.   def cursor_movable?
  223.     return false if @select_flag == :user
  224.     return super
  225.   end
  226.   def current_item_enabled?
  227.     return true if $game_temp.battle_aid.nil?
  228.     if $game_temp.battle_aid.need_selection?
  229.       member = $game_party.battle_members[@index]
  230.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  231.     elsif $game_temp.battle_aid.for_dead_friend?
  232.       for member in $game_party.battle_members
  233.         return true if member.dead?
  234.       end
  235.       return false
  236.     end
  237.     return true
  238.   end
  239. end
  240. class Window_BattleStatusAid < Window_BattleStatus
  241.   attr_accessor :status_window
  242.   def initialize
  243.     super
  244.     self.visible = false
  245.     self.openness = 255
  246.   end
  247.   def window_width; return 128; end
  248.   def show
  249.     super
  250.     refresh
  251.   end
  252.   def refresh
  253.     contents.clear
  254.     return if @status_window.nil?
  255.     draw_item(@status_window.index)
  256.   end
  257.   def item_rect(index)
  258.     return Rect.new(0, 0, contents.width, contents.height)
  259.   end
  260. end
  261. class Window_BattleEnemy < Window_Selectable
  262.   def initialize(info_viewport)
  263.     super(0, Graphics.height, window_width, fitting_height(1))
  264.     refresh
  265.     self.visible = false
  266.     @info_viewport = info_viewport
  267.   end
  268.   def col_max; return item_max; end
  269.   def show
  270.     create_flags
  271.     super
  272.   end
  273.   def create_flags
  274.     set_select_flag(:any)
  275.     select(0)
  276.     return if $game_temp.battle_aid.nil?
  277.     if $game_temp.battle_aid.need_selection?
  278.       select(0)
  279.     elsif $game_temp.battle_aid.for_all?
  280.       select(0)
  281.       set_select_flag(:all)
  282.     elsif $game_temp.battle_aid.for_random?
  283.       select(0)
  284.       set_select_flag(:random)
  285.     end
  286.   end
  287.   def set_select_flag(flag)
  288.     @select_flag = flag
  289.     case @select_flag
  290.     when :all, :random
  291.       @cursor_all = true
  292.     else
  293.       @cursor_all = false
  294.     end
  295.   end
  296.   def select_all?
  297.     return true if @select_flag == :all
  298.     return true if @select_flag == :random
  299.     return false
  300.   end
  301.   def update_cursor
  302.     if @cursor_all
  303.       cursor_rect.set(0, 0, contents.width, contents.height)
  304.       self.top_row = 0
  305.     elsif @index < 0
  306.       cursor_rect.empty
  307.     else
  308.       ensure_cursor_visible
  309.       cursor_rect.set(item_rect(@index))
  310.     end
  311.   end
  312.   def cursor_movable?
  313.     return false if @select_flag == :user
  314.     return super
  315.   end
  316.   def current_item_enabled?
  317.     return true if $game_temp.battle_aid.nil?
  318.     if $game_temp.battle_aid.need_selection?
  319.       member = $game_party.battle_members[@index]
  320.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  321.     elsif $game_temp.battle_aid.for_dead_friend?
  322.       for member in $game_party.battle_members
  323.         return true if member.dead?
  324.       end
  325.       return false
  326.     end
  327.     return true
  328.   end
  329.   def enemy; @data[index]; end
  330.   def refresh
  331.     make_item_list
  332.     create_contents
  333.     draw_all_items
  334.   end
  335.   def make_item_list
  336.     @data = $game_troop.alive_members
  337.     @data.sort! { |a,b| a.screen_x <=> b.screen_x }
  338.   end
  339.   def draw_item(index); return; end
  340.   def update
  341.     super
  342.     return unless active
  343.     enemy.sprite_effect_type = :whiten
  344.     return unless select_all?
  345.     for enemy in $game_troop.alive_members
  346.       enemy.sprite_effect_type = :whiten
  347.     end
  348.   end
  349. end
  350. class Window_BattleHelp < Window_Help
  351.   attr_accessor :actor_window
  352.   attr_accessor :enemy_window
  353.   def update
  354.     super
  355.     if !self.visible and @text != ""
  356.       @text = ""
  357.       return refresh
  358.     end
  359.     update_battler_name
  360.   end
  361.   def update_battler_name
  362.     return unless @actor_window.active || @enemy_window.active
  363.     if @actor_window.active
  364.       battler = $game_party.battle_members[@actor_window.index]
  365.     elsif @enemy_window.active
  366.       battler = @enemy_window.enemy
  367.     end
  368.     if special_display?
  369.       refresh_special_case(battler)
  370.     else
  371.       refresh_battler_name(battler) if battler_name(battler) != @text
  372.     end
  373.   end
  374.   def battler_name(battler)
  375.     text = battler.name.clone
  376.     return text
  377.   end
  378.   def refresh_battler_name(battler)
  379.     contents.clear
  380.     reset_font_settings
  381.     change_color(normal_color)
  382.     @text = battler_name(battler)
  383.     icons = battler.state_icons + battler.buff_icons
  384.     dy = icons.size <= 0 ? line_height / 2 : 0
  385.     draw_text(0, dy, contents.width, line_height, @text, 1)
  386.     dx = (contents.width - (icons.size * 24)) / 2
  387.     draw_actor_icons(battler, dx, line_height, contents.width)
  388.   end
  389.   def special_display?
  390.     return false if $game_temp.battle_aid.nil?
  391.     return false if $game_temp.battle_aid.for_user?
  392.     return !$game_temp.battle_aid.need_selection?
  393.   end
  394.   def refresh_special_case(battler)
  395.     if $game_temp.battle_aid.for_opponent?
  396.       if $game_temp.battle_aid.for_all?
  397.         text = YEA::BATTLE::HELP_TEXT_ALL_FOES
  398.       else
  399.         case $game_temp.battle_aid.number_of_targets
  400.         when 1
  401.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_FOE
  402.         else
  403.           number = $game_temp.battle_aid.number_of_targets
  404.           text = sprintf(YEA::BATTLE::HELP_TEXT_MANY_RANDOM_FOE, number)
  405.         end
  406.       end
  407.     else
  408.       if $game_temp.battle_aid.for_dead_friend?
  409.         text = YEA::BATTLE::HELP_TEXT_ALL_DEAD_ALLIES
  410.       elsif $game_temp.battle_aid.for_random?
  411.         case $game_temp.battle_aid.number_of_targets
  412.         when 1
  413.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_ALLY
  414.         else
  415.           number = $game_temp.battle_aid.number_of_targets
  416.           text = sprintf(YEA::BATTLE::HELP_TEXT_RANDOM_ALLIES, number)
  417.         end
  418.       else
  419.         text = YEA::BATTLE::HELP_TEXT_ALL_ALLIES
  420.       end
  421.     end
  422.     return if text == @text
  423.     @text = text
  424.     contents.clear
  425.     reset_font_settings
  426.     draw_text(0, 0, contents.width, line_height*2, @text, 1)
  427.   end
  428. end
  429. class Window_SkillList < Window_Selectable
  430.   def spacing
  431.     return 8 if $game_party.in_battle
  432.     return super
  433.   end
  434. end
  435. class Window_ItemList < Window_Selectable
  436.   def spacing
  437.     return 8 if $game_party.in_battle
  438.     return super
  439.   end
  440. end
  441. class Scene_Battle < Scene_Base
  442.   attr_accessor :enemy_window
  443.   attr_accessor :info_viewport
  444.   attr_accessor :spriteset
  445.   attr_accessor :status_window
  446.   attr_accessor :status_aid_window
  447.   attr_accessor :subject
  448.   alias scene_battle_create_all_windows_abe create_all_windows
  449.   def create_all_windows
  450.     scene_battle_create_all_windows_abe
  451.     create_battle_status_aid_window
  452.     set_help_window
  453.   end
  454.   alias scene_battle_create_info_viewport_abe create_info_viewport
  455.   def create_info_viewport
  456.     scene_battle_create_info_viewport_abe
  457.     @status_window.refresh
  458.   end
  459.   def create_battle_status_aid_window
  460.     @status_aid_window = Window_BattleStatusAid.new
  461.     @status_aid_window.status_window = @status_window
  462.     @status_aid_window.x = Graphics.width - @status_aid_window.width
  463.     @status_aid_window.y = Graphics.height - @status_aid_window.height
  464.   end
  465.   def create_help_window
  466.     @help_window = Window_BattleHelp.new
  467.     @help_window.hide
  468.   end
  469.   def set_help_window
  470.     @help_window.actor_window = @actor_window
  471.     @help_window.enemy_window = @enemy_window
  472.   end
  473.   alias scene_battle_create_skill_window_abe create_skill_window
  474.   def create_skill_window
  475.     scene_battle_create_skill_window_abe
  476.     @skill_window.height = @info_viewport.rect.height
  477.     @skill_window.width = Graphics.width - @actor_command_window.width
  478.     @skill_window.y = Graphics.height - @skill_window.height
  479.   end
  480.   alias scene_battle_create_item_window_abe create_item_window
  481.   def create_item_window
  482.     scene_battle_create_item_window_abe
  483.     @item_window.height = @skill_window.height
  484.     @item_window.width = @skill_window.width
  485.     @item_window.y = Graphics.height - @item_window.height
  486.   end
  487.   alias scene_battle_next_command_abe next_command
  488.   def next_command
  489.     @status_window.show
  490.     redraw_current_status
  491.     @actor_command_window.show
  492.     @status_aid_window.hide
  493.     scene_battle_next_command_abe
  494.   end
  495.   alias scene_battle_prior_command_abe prior_command
  496.   def prior_command
  497.     redraw_current_status
  498.     scene_battle_prior_command_abe
  499.   end
  500.   def redraw_current_status
  501.     return if @status_window.index < 0
  502.     @status_window.draw_item(@status_window.index)
  503.   end
  504.   alias scene_battle_command_attack_abe command_attack
  505.   def command_attack
  506.     $game_temp.battle_aid = $data_skills[BattleManager.actor.attack_skill_id]
  507.     scene_battle_command_attack_abe
  508.   end
  509.   alias scene_battle_command_skill_abe command_skill
  510.   def command_skill
  511.     scene_battle_command_skill_abe
  512.     @status_window.hide
  513.     @actor_command_window.hide
  514.     @status_aid_window.show
  515.   end
  516.   alias scene_battle_command_item_abe command_item
  517.   def command_item
  518.     scene_battle_command_item_abe
  519.     @status_window.hide
  520.     @actor_command_window.hide
  521.     @status_aid_window.show
  522.   end
  523.   def on_skill_ok
  524.     [url=home.php?mod=space&uid=260100]@skill[/url] = @skill_window.item
  525.     $game_temp.battle_aid = @skill
  526.     BattleManager.actor.input.set_skill(@skill.id)
  527.     BattleManager.actor.last_skill.object = @skill
  528.     if @skill.for_opponent?
  529.       select_enemy_selection
  530.     elsif @skill.for_friend?
  531.       select_actor_selection
  532.     else
  533.       @skill_window.hide
  534.       next_command
  535.       $game_temp.battle_aid = nil
  536.     end
  537.   end
  538.   alias scene_battle_on_skill_cancel_abe on_skill_cancel
  539.   def on_skill_cancel
  540.     scene_battle_on_skill_cancel_abe
  541.     @status_window.show
  542.     @actor_command_window.show
  543.     @status_aid_window.hide
  544.   end
  545.   def on_item_ok
  546.     @item = @item_window.item
  547.     $game_temp.battle_aid = @item
  548.     BattleManager.actor.input.set_item(@item.id)
  549.     if @item.for_opponent?
  550.       select_enemy_selection
  551.     elsif @item.for_friend?
  552.       select_actor_selection
  553.     else
  554.       @item_window.hide
  555.       next_command
  556.       $game_temp.battle_aid = nil
  557.     end
  558.     $game_party.last_item.object = @item
  559.   end
  560.   alias scene_battle_on_item_cancel_abe on_item_cancel
  561.   def on_item_cancel
  562.     scene_battle_on_item_cancel_abe
  563.     @status_window.show
  564.     @actor_command_window.show
  565.     @status_aid_window.hide
  566.   end
  567.   alias scene_battle_select_actor_selection_abe select_actor_selection
  568.   def select_actor_selection
  569.     @status_aid_window.refresh
  570.     scene_battle_select_actor_selection_abe
  571.     @status_window.hide
  572.     @skill_window.hide
  573.     @item_window.hide
  574.     @help_window.show
  575.   end
  576.   alias scene_battle_on_actor_ok_abe on_actor_ok
  577.   def on_actor_ok
  578.     $game_temp.battle_aid = nil
  579.     scene_battle_on_actor_ok_abe
  580.     @status_window.show
  581.     if $imported["YEA-BattleCommandList"] && !@confirm_command_window.nil?
  582.       @actor_command_window.visible = !@confirm_command_window.visible
  583.     else
  584.       @actor_command_window.show
  585.     end
  586.     @status_aid_window.hide
  587.   end
  588.   alias scene_battle_on_actor_cancel_abe on_actor_cancel
  589.   def on_actor_cancel
  590.     BattleManager.actor.input.clear
  591.     @status_aid_window.refresh
  592.     $game_temp.battle_aid = nil
  593.     scene_battle_on_actor_cancel_abe
  594.     case @actor_command_window.current_symbol
  595.     when :skill
  596.       @skill_window.show
  597.     when :item
  598.       @item_window.show
  599.     end
  600.   end
  601.   alias scene_battle_select_enemy_selection_abe select_enemy_selection
  602.   def select_enemy_selection
  603.     @status_aid_window.refresh
  604.     scene_battle_select_enemy_selection_abe
  605.     @help_window.show
  606.   end
  607.   alias scene_battle_on_enemy_ok_abe on_enemy_ok
  608.   def on_enemy_ok
  609.     $game_temp.battle_aid = nil
  610.     scene_battle_on_enemy_ok_abe
  611.   end
  612.   alias scene_battle_on_enemy_cancel_abe on_enemy_cancel
  613.   def on_enemy_cancel
  614.     BattleManager.actor.input.clear
  615.     @status_aid_window.refresh
  616.     $game_temp.battle_aid = nil
  617.     scene_battle_on_enemy_cancel_abe
  618.     if @skill_window.visible || @item_window.visible
  619.       @help_window.show
  620.     else
  621.       @help_window.hide
  622.     end
  623.   end
  624.   def end_battle_conditions?
  625.     return true if $game_party.members.empty?
  626.     return true if $game_party.all_dead?
  627.     return true if $game_troop.all_dead?
  628.     return true if BattleManager.aborting?
  629.     return false
  630.   end
  631.   def refresh_status
  632.     #如果你是程序员,请顺手帮忙优化下这里,谢谢。
  633.     @status_window.refresh
  634.     for i in $game_party.battle_members
  635.       @status_window.draw_item($game_party.battle_members.index(i))
  636.     end
  637.   end
  638. end
复制代码

点评

效果不错啊!谢谢啦!  发表于 2017-10-2 10:27
回复

使用道具 举报

梦石
0
星屑
1964
在线时间
217 小时
注册时间
2009-11-10
回帖
202
发表于 2019-10-15 19:23:45 | 显示全部楼层
文字 怎么可以调的 更清晰啊 谢谢
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部